import type { BindingOrigin } from "./contract/expression.js"; import type { FlowNode } from "./engine/types.js"; /** @deprecated Use {@link DeterministicFlowNode}; `NodeExecutorRequest.node` widened to include `check`. */ export type FunctionFlowNode = FlowNode & { run: Extract, { kind: "function"; }>; }; /** Strict v2 function or check node — the two kinds NodeExecutor runs outside an agent turn. */ export type DeterministicFlowNode = FlowNode & { run: Extract, { kind: "function" | "check"; }>; }; /** Resolved execution request handed across the flow engine's only I/O seam. */ export interface NodeExecutorRequest { /** Available strict v2 function or check node selected by the pure engine. */ node: DeterministicFlowNode; /** Binding values already resolved at the node boundary. */ inputs: Record; /** Provenance retained separately from the values serialized for execution. */ inputOrigins: Record; } /** Captured result of one deterministic node process. */ export interface NodeExecutorResult { /** Process exit status, matched against the node's declared successful statuses. */ exitStatus: number; /** Complete UTF-8 standard output from the process. */ stdout: string; /** Complete UTF-8 standard error from the process. */ stderr: string; } /** Ambient per-call controls, kept off {@link NodeExecutorRequest} because they are not execution data. */ export interface NodeExecutorOptions { /** Fires once the caller has abandoned this result — the work should stop. */ signal?: AbortSignal; } /** Runtime seam for node kinds that execute outside an agent turn. */ export interface NodeExecutor { /** * Executes one available deterministic node with already-resolved inputs. * * `options.signal` fires once the caller has abandoned the result; an * implementation that honors it should stop the work and reject only after it * has stopped. Ignoring it is supported — an executor declaring only * `(request)` still satisfies this interface and behaves exactly as before, * forgoing only the reaping of work whose result is already discarded. */ execute(request: NodeExecutorRequest, options?: NodeExecutorOptions): Promise; } /** Session workspace required to keep deterministic execution inside the active run. */ export interface SessionNodeExecutorOptions { /** Root of the already-materialized session workspace. */ workspaceDir: string; } /** * Grace between the abort's `SIGTERM` and the `SIGKILL` that makes it true. A * command that traps or ignores `SIGTERM` would otherwise keep running while * the node reads as aborted. Exported so a caller sequencing work behind an * abort can outlast the escalation instead of guessing at it. */ export declare const ABORT_SIGKILL_GRACE_MS = 2000; /** Runs deterministic nodes inside the existing session workspace and environment. */ export declare class SessionNodeExecutor implements NodeExecutor { private readonly workspaceDir; /** Creates an executor scoped to one already-materialized session workspace. */ constructor(options: SessionNodeExecutorOptions); /** Runs one function or check node process with session environment and binding overrides. */ execute(request: NodeExecutorRequest, options?: NodeExecutorOptions): Promise; } //# sourceMappingURL=node-executor.d.ts.map