import type { MsgContext } from "../../auto-reply/templating.js"; import {
buildAgentMainSessionKey,
DEFAULT_AGENT_ID,
normalizeMainKey,
} from "../../routing/session-key.js"; import { normalizeE164 } from "../../utils.js"; import { normalizeExplicitSessionKey } from "./explicit-session-key-normalization.js"; import { resolveGroupSessionKey } from "./group.js"; import type { SessionScope } from "./types.js";
// Decide which session bucket to use (per-sender vs global).
export function deriveSessionKey(scope: SessionScope, ctx: MsgContext) { if (scope === "global") { return"global";
} const resolvedGroup = resolveGroupSessionKey(ctx); if (resolvedGroup) { return resolvedGroup.key;
} const from = ctx.From ? normalizeE164(ctx.From) : ""; return from || "unknown";
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.