eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
59 lines (58 loc) • 2.72 kB
TypeScript
import { type SandboxPreparedArtifact, type SandboxProviderPrepareContext, type SandboxProviderRuntime } from "#shared/sandbox-provider.js";
import { type RuntimeCompiledArtifactsSource, type RuntimeDiskCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";
import { type ResolvedAgentGraphBundle } from "#runtime/graph.js";
import type { SandboxPreparedArtifactEntry } from "#shared/sandbox-prepared-artifacts.js";
export interface SandboxPreparedArtifactStore {
write(input: {
readonly compileDirectoryPath: string;
readonly entries: readonly SandboxPreparedArtifactEntry[];
}): Promise<void>;
}
/**
* Optional dispatch override that intercepts every provider `prepare()`
* call. Production code never supplies this; the orchestrator dispatches
* directly to the provider. Tests inject a recorder to verify which
* templates the orchestrator emits and what preparation calls flow through
* them.
*/
export type SandboxProviderPrepareDispatch = (input: {
readonly context: SandboxProviderPrepareContext;
readonly provider: SandboxProviderRuntime;
}) => Promise<SandboxPreparedArtifact>;
interface PrewarmSandboxesInput {
readonly appRoot: string;
readonly compileDirectoryPath: string;
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
readonly graph: ResolvedAgentGraphBundle;
readonly log?: (message: string) => void;
readonly dispatch?: SandboxProviderPrepareDispatch;
readonly preparedArtifactStore?: SandboxPreparedArtifactStore;
}
/**
* Prepares every provider sandbox template required by one compiled
* runtime graph.
*
* Iterates every registered sandbox and invokes `provider.prepare(...)`
* for each provider template.
*/
export declare function prewarmSandboxes(input: PrewarmSandboxesInput): Promise<void>;
/**
* Loads the compiled runtime graph for one authored app root and
* prepares every provider sandbox template required by that graph.
*
* Hydrates the module map directly from authored source so callers
* don't need a pre-existing `module-map.mjs` import in Node's cache.
* Shared entrypoint for `eve dev` startup, the dev watcher, and the
* Vercel build hook.
*/
export declare function prewarmAppSandboxes(input: {
readonly appRoot: string;
readonly compiledArtifactsSource?: RuntimeCompiledArtifactsSource;
readonly loadAgentGraph?: (input: Readonly<{
compiledArtifactsSource: RuntimeDiskCompiledArtifactsSource;
}>) => Promise<ResolvedAgentGraphBundle>;
readonly log?: (message: string) => void;
readonly dispatch?: SandboxProviderPrepareDispatch;
readonly preparedArtifactStore?: SandboxPreparedArtifactStore;
}): Promise<void>;
export {};