UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 955 B
import{l as isRecord}from"./record-coerce-BTbqdJ3-.mjs"; //!src/channels/turn/agent-run-terminal-outcome.ts const AGENT_RUN_TERMINAL_OUTCOME=Symbol.for(`openclaw.agentRunTerminalOutcome`);const AGENT_RUN_TERMINAL_ERROR=Symbol.for(`openclaw.agentRunTerminalError`);function recordAgentRunTerminalOutcome(e,t,n){return Object.assign(e,{[AGENT_RUN_TERMINAL_OUTCOME]:t,[AGENT_RUN_TERMINAL_ERROR]:t===`failed`?n:void 0})}function readAgentRunTerminalOutcome(e){const t=isRecord(e)&&Object.hasOwn(e,AGENT_RUN_TERMINAL_OUTCOME)?Reflect.get(e,AGENT_RUN_TERMINAL_OUTCOME):void 0;return t===`completed`||t===`failed`?t:void 0}function readAgentRunTerminalError(e){if(!isRecord(e)||readAgentRunTerminalOutcome(e)!==`failed`||!Object.hasOwn(e,AGENT_RUN_TERMINAL_ERROR))return;const t=Reflect.get(e,AGENT_RUN_TERMINAL_ERROR);return typeof t===`string`?t:void 0}export{readAgentRunTerminalOutcome as n,recordAgentRunTerminalOutcome as r,readAgentRunTerminalError as t};