UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

20 lines (19 loc) • 643 B
//#region src/agents/agent-run-terminal-delivery.ts /** Rejects malformed lifecycle/RPC input and projects only the bounded delivery fact. */ function normalizeAgentRunTerminalDeliverySnapshot(e) { if (!e || typeof e !== "object" || Array.isArray(e)) return; const t = e; if (typeof t.resultCount !== "number" || !Number.isSafeInteger(t.resultCount) || t.resultCount < 0) return; switch (t.status) { case "sent": case "suppressed": case "partial_failed": case "failed": return { status: t.status, resultCount: t.resultCount }; default: return; } } //#endregion export { normalizeAgentRunTerminalDeliverySnapshot as t };