eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 1.43 kB
JavaScript
import{DynamicSkillManifestKey,SandboxKey}from"#context/keys.js";import{loadContext}from"#context/container.js";import{loadSkillFromSandbox}from"#runtime/skills/sandbox-access.js";async function executeLoadSkillTool(e){let r=loadContext(),i=r.get(SandboxKey);if(i===void 0)throw Error(`The load_skill tool requires sandbox access on the runtime context. Ensure the step is running inside a managed runtime context with sandbox support.`);let{skill:a}=e;return await loadSkillFromSandbox(i,a,availableSkillNames(r))}function availableSkillNames(t){let n=Object.values(t.get(DynamicSkillManifestKey)??{}).flat().map(e=>e.name);return[...new Set(n)].sort()}const SKILL_OUTPUT_SCHEMA={type:`string`},SKILL_TOOL_DEFINITION={description:[`Load the full instructions for one available skill by name or id.`,`Use this tool when the request clearly matches a listed skill description or when the user explicitly asks for that skill.`,`Loading adds the skill instructions to the current turn.`,`Choose the "skill" value from the Available skills block.`].join(` `),execute:e=>executeLoadSkillTool(e),inputSchema:{additionalProperties:!1,properties:{skill:{description:`Available skill name or id.`,type:`string`}},required:[`skill`],type:`object`},logicalPath:`eve:framework/load-skill`,name:`load_skill`,outputSchema:SKILL_OUTPUT_SCHEMA,sourceId:`eve:load-skill-tool`,sourceKind:`module`};export{SKILL_OUTPUT_SCHEMA,SKILL_TOOL_DEFINITION};