UNPKG

eve

Version:

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

56 lines (55 loc) 2.49 kB
export declare const LOCAL_DEV_INTERACTIVE_CLIENT_HEADER = "x-eve-dev-interactive-client"; /** * Capabilities available to authored code in an execution initiated by a * same-machine request to `eve dev`. * * Absence is the signal, not a disabled flag: a deployed runtime has no * authored tree to mutate or watcher to pause, and a request from a remote * client is not authorized to mutate the server's authored tree. * {@link getLocalDevCapability} returns `undefined` in both cases. */ export interface LocalDevCapability { /** * Absolute path of the authored application root — the directory holding * `package.json` and the authored `agent/` tree, never a runtime snapshot. */ readonly appRoot: string; /** * Whether the requesting client is the dev TUI and can therefore run a flow * that asks questions in its terminal. */ readonly interactiveClient: boolean; /** * Runs `task` with the authored-source watcher paused, then resumes it. * * Each suspension has an idempotent lease, so concurrent holders cannot * resume each other early; the final release rebuilds authored * artifacts instead of waiting for the watcher's change debounce. */ withSuspendedSource<T>(task: () => Promise<T>): Promise<T>; } /** * Publishes the local dev capability to the runtime for one dev server. * * Returns a restore function that reinstates the previous values, matching the * other environment installers the dev host tears down on close. */ export declare function installLocalDevCapabilityEnvironment(input: { readonly appRoot: string; readonly serverUrl: string; }): () => void; /** * Seeds durable local-dev provenance only when the parent host signed a * loopback peer address. Public address headers cannot grant access. */ export declare function withLocalDevRequestScope<T>(request: Request, callback: () => Promise<T>): Promise<T>; /** * Resolves the local dev capability, or `undefined` outside an execution * initiated by an authorized local request to `eve dev`. * * This is deliberately not a {@link import("#public/definitions/tool.js").ToolContext} * field: both values are meaningless in a deployed runtime, and a capability * that cannot exist there should be absent from the type rather than present * and undefined. */ export declare function getLocalDevCapability(environment?: Readonly<Record<string, string | undefined>>): LocalDevCapability | undefined;