openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
18 lines (17 loc) • 853 B
JavaScript
import { l as normalizeOptionalString } from "./string-coerce-CCIiB4H7.mjs";
import { n as normalizeAgentId } from "./agent-id-CQjtp2ft.mjs";
import { j as parseAgentSessionKey } from "./session-key-CqAyZeVk.mjs";
//#region src/gateway/chat-run-owner.ts
function resolveChatRunOwnerAgentId(e) {
const t = normalizeOptionalString(e.agentId) ?? parseAgentSessionKey(e.sessionKey)?.agentId ?? normalizeOptionalString(e.defaultAgentId);
return t ? normalizeAgentId(t) : void 0;
}
function chatRunBelongsToAgent(e, t) {
return resolveChatRunOwnerAgentId(e) === normalizeAgentId(t);
}
function chatRunBelongsToSelectedAgent(e) {
const t = normalizeOptionalString(e.selectedAgentId);
return t ? chatRunBelongsToAgent(e, t) : false;
}
//#endregion
export { chatRunBelongsToSelectedAgent as n, resolveChatRunOwnerAgentId as r, chatRunBelongsToAgent as t };