eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 1.56 kB
JavaScript
import{createFrameworkUserMessage}from"#harness/messages.js";import{composeRuntimeBasePrompt}from"#runtime/prompt/compose.js";const BOOTSTRAP_RUNTIME_MODEL_ID=`eve-bootstrap-model`,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT=`You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.`;function createResolvedRuntimeTurnAgent(e){let t=e.agent,n=t.config,r=e.id??n?.name;if(r===void 0)throw Error(`Expected a path-derived agent id while resolving agent resources.`);let i=e.tools.some(e=>e.kind===`subagent`||e.kind===`remote`),a=e.tools.some(e=>e.behavior?.handling?.kind===`dispatch`&&e.behavior.handling.target.kind===`self-agent-call`),o={availableSkills:t.skills.map(e=>({description:e.description,name:e.name})),id:r,initialMessages:t.instructions.filter(e=>e.role===`user`&&e.content.trim().length>0).map(e=>createFrameworkUserMessage(`context.instruction`,e.content.trim())),instructions:composeRuntimeBasePrompt({connections:t.connections,instructions:t.instructions,subagentsAvailable:e.dynamicSubagentsAvailable===!0||i||a,toolsAvailable:e.tools.length>0,workspaceSpec:t.workspaceSpec}),compactionModel:n?.compaction?.model,nodeId:e.nodeId,outputSchema:n?.outputSchema,reasoning:n?.reasoning,tools:[...e.tools],workspaceSpec:t.workspaceSpec};return n===void 0?{...o,configResolver:!0}:n.dynamicModel===void 0?{...o,model:n.model}:{...o,dynamicModel:n.dynamicModel}}export{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT,createResolvedRuntimeTurnAgent};