UNPKG

eve

Version:

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

1 lines 1.3 kB
import{createAuthoredSourceRuntimeCompiledArtifactsSource}from"#internal/application/runtime-compiled-artifacts-source.js";import{createNitroArtifactsConfig}from"#internal/nitro/host/artifacts-config.js";import{createScheduleRegistrations}from"#runtime/schedules/register.js";import{loadResolvedCompiledSchedules}from"#runtime/schedules/resolve-schedule.js";var UnknownDevScheduleError=class extends Error{availableScheduleIds;scheduleId;constructor(e,t){let n=t.length===0?`No schedules are defined in this app.`:`Available schedules: ${t.map(e=>`"${e}"`).join(`, `)}.`;super(`Unknown schedule "${e}". ${n}`),this.name=`UnknownDevScheduleError`,this.scheduleId=e,this.availableScheduleIds=t}};async function dispatchScheduleInDev(r){let i=createScheduleRegistrations(await loadResolvedCompiledSchedules({compiledArtifactsSource:createAuthoredSourceRuntimeCompiledArtifactsSource(r.appRoot)})),a=i.find(e=>e.scheduleId===r.scheduleId);if(a===void 0)throw new UnknownDevScheduleError(r.scheduleId,i.map(e=>e.scheduleId));let{dispatchScheduleTask:o}=await import(`#internal/nitro/routes/schedule-task.js`),s=createNitroArtifactsConfig({appRoot:r.appRoot,dev:!0}),c=await o(a.taskName,s);return{scheduleId:c.scheduleId,sessionIds:[...c.sessionIds]}}export{UnknownDevScheduleError,dispatchScheduleInDev};