UNPKG

eve

Version:

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

1 lines 1.75 kB
import{createBundledRuntimeCompiledArtifactsSource,createDiskRuntimeCompiledArtifactsSource}from"#runtime/compiled-artifacts-source.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{readDevelopmentRuntimeArtifactsSnapshotRoot}from"#internal/nitro/dev-runtime-artifacts.js";import{resolveSchedules}from"#runtime/schedules/resolve-schedule.js";import{loadCompiledModuleMap}from"#runtime/loaders/module-map.js";import{resolveAgent}from"#runtime/resolve-agent.js";async function loadAgentInfoData(e){return await loadAgentInfoDataFromArtifacts(e.compiledArtifactsSource)}async function loadAgentInfoManifestData(e){let t=await loadCompiledManifest({compiledArtifactsSource:e.compiledArtifactsSource});return{manifest:t,schedules:await resolveSchedules({manifest:t})}}function resolveAgentInfoCompiledArtifactsSource(r={}){if(r.dev===!0&&r.appRoot!==void 0)return createDiskRuntimeCompiledArtifactsSource(readDevelopmentRuntimeArtifactsSnapshotRoot(r.devRuntimeArtifactsPointerPath)??r.appRoot);if(readBundledCompiledArtifacts()!==null)return createBundledRuntimeCompiledArtifactsSource();if(r.appRoot!==void 0)return createDiskRuntimeCompiledArtifactsSource(r.appRoot);throw Error(`eve agent info runtime data requires bundled artifacts or an app root.`)}async function loadAgentInfoDataFromArtifacts(e){let[t,n]=await Promise.all([loadCompiledManifest({compiledArtifactsSource:e}),loadCompiledModuleMap({compiledArtifactsSource:e})]),i=await resolveSchedules({manifest:t});return{agent:await resolveAgent({manifest:t,moduleMap:n}),manifest:t,schedules:i}}export{loadAgentInfoData,loadAgentInfoManifestData,resolveAgentInfoCompiledArtifactsSource};