UNPKG

eve

Version:

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

25 lines (24 loc) • 1.34 kB
import type { HarnessSession, StepResult } from "#harness/types.js"; import { type ContextContainer } from "#context/container.js"; import type { FrameworkContextProvider } from "#context/provider.js"; interface ContextScopeResult<T> { readonly result: T; readonly session: HarnessSession; } /** * Runs `callback` inside a fully-initialized ALS scope with all framework * providers (session, connection, sandbox) built and committed. * * The callback receives the enriched session and must return both its own * result and the (possibly mutated) session so provider commit hooks can * persist provider-owned state (e.g. sandbox snapshots). */ export declare function withContextScope<T>(ctx: ContextContainer, harnessSession: HarnessSession, callback: (session: HarnessSession) => Promise<ContextScopeResult<T>>, additionalProviders?: readonly FrameworkContextProvider<any>[]): Promise<ContextScopeResult<T>>; /** * Runs one harness step inside the unified context. * * Delegates to {@link withContextScope} for provider lifecycle, then * reassembles the {@link StepResult}. */ export declare function runStep(ctx: ContextContainer, harnessSession: HarnessSession, callback: (session: HarnessSession) => Promise<StepResult>, additionalProviders?: readonly FrameworkContextProvider<any>[]): Promise<StepResult>; export {};