UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

19 lines (18 loc) • 984 B
import { l as normalizeOptionalString } from "./string-coerce-1VuiLaaR.mjs"; import { a as isNativeCommandTurn, c as resolveCommandTurnContext } from "./command-turn-context-TJGbDzsZ.mjs"; import { o as resolveInternalSessionKey, s as resolveMainSessionAlias } from "./sessions-resolution-DvbCWXwD.mjs"; import "./sessions-helpers-CA0CJ1ys.mjs"; //#region src/auto-reply/reply/command-source-session-key.ts function resolveCommandSourceSessionKey(params, opts) { const commandTarget = normalizeOptionalString(params.ctx.CommandTargetSessionKey); const commandSession = normalizeOptionalString(params.sessionKey); const raw = opts?.preferCommandTarget ?? isNativeCommandTurn(resolveCommandTurnContext(params.ctx)) ? commandTarget || commandSession : commandSession || commandTarget; if (!raw) return; const { alias } = resolveMainSessionAlias(params.cfg); return resolveInternalSessionKey({ key: raw, alias }); } //#endregion export { resolveCommandSourceSessionKey as t };