eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 709 B
JavaScript
import{getAuthoredModuleExport,materializeAuthoredModuleExport}from"#internal/authored-module.js";import{join}from"node:path";import{toErrorMessage}from"#shared/errors.js";import{loadAuthoredModuleNamespace}from"#internal/authored-module-loader.js";async function loadModuleBackedDefinition(t){let n=getAuthoredModuleExport(await loadAuthoredModuleNamespace(join(t.agentRoot,t.source.logicalPath),{externalDependencies:t.externalDependencies}),t.source);try{return await materializeAuthoredModuleExport(n)}catch(e){throw Error(`Failed to execute the ${t.kind} export "${t.source.exportName??`default`}" from "${t.displayPath??t.source.logicalPath}": ${toErrorMessage(e)}`)}}export{loadModuleBackedDefinition};