UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

1 lines • 1.14 kB
import{toErrorMessage}from"#shared/errors.js";import{REMOTE_AGENT_START_FAILED}from"#subagents/agent-handle-errors.js";function createUnavailableDynamicSubagentResult(e){let t=getSubagentName(e);return{callId:e.callId,isError:!0,kind:`subagent-result`,origin:`dispatch`,output:{code:`SUBAGENT_UNAVAILABLE`,message:`Subagent "${t}" is not available in the current session context.`},subagentName:t}}function getSubagentName(e){return e.kind===`remote-agent-call`?e.remoteAgentName:e.subagentName}function createRemoteAgentStartFailureResult(e){return{callId:e.action.callId,isError:!0,kind:`subagent-result`,origin:`dispatch`,output:{code:REMOTE_AGENT_START_FAILED,message:toErrorMessage(e.error)},subagentName:e.action.remoteAgentName}}function createRecursiveAgentRootOnlyResult(e){return{callId:e.callId,isError:!0,kind:`subagent-result`,origin:`dispatch`,output:{code:`RECURSIVE_AGENT_ROOT_ONLY`,message:`The built-in "agent" tool is only available to the root session.`},subagentName:e.subagentName}}export{createRecursiveAgentRootOnlyResult,createRemoteAgentStartFailureResult,createUnavailableDynamicSubagentResult,getSubagentName};