refactor(messages): centralize per-agent prefixes
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
DEFAULT_AGENT_ID,
|
||||
DEFAULT_MAIN_KEY,
|
||||
normalizeAgentId,
|
||||
parseAgentSessionKey,
|
||||
resolveAgentIdFromSessionKey,
|
||||
} from "../routing/session-key.js";
|
||||
import { normalizeE164 } from "../utils.js";
|
||||
import {
|
||||
@@ -232,12 +232,7 @@ export function resolveMainSessionKey(cfg?: {
|
||||
return buildAgentMainSessionKey({ agentId, mainKey });
|
||||
}
|
||||
|
||||
export function resolveAgentIdFromSessionKey(
|
||||
sessionKey?: string | null,
|
||||
): string {
|
||||
const parsed = parseAgentSessionKey(sessionKey);
|
||||
return normalizeAgentId(parsed?.agentId ?? DEFAULT_AGENT_ID);
|
||||
}
|
||||
export { resolveAgentIdFromSessionKey };
|
||||
|
||||
export function resolveAgentMainSessionKey(params: {
|
||||
cfg?: { session?: { mainKey?: string } };
|
||||
|
||||
Reference in New Issue
Block a user