eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
27 lines (26 loc) • 1.41 kB
TypeScript
import type { ModelMessage } from "ai";
import type { HarnessSession, SessionStateMap } from "#harness/types.js";
import type { CodeModeInterrupt } from "#shared/code-mode.js";
/**
* One code-mode invocation parked on a host interrupt (nested-tool approval,
* connection auth, or any future durable interrupt kind), plus the assistant
* response messages that produced the outer `code_mode` tool result.
*
* Every interrupt kind rides this single pending slot; the kind-specific
* behavior lives in {@link parkOnCodeModeInterrupt} /
* {@link continuePendingCodeModeInterrupt}, keyed by `interrupt.payload.kind`.
*/
export interface PendingCodeModeInterrupt {
readonly interrupt: CodeModeInterrupt;
readonly responseMessages: readonly ModelMessage[];
}
/** Returns the pending code-mode interrupt stored on the session, if any. */
export declare function getPendingCodeModeInterrupt(state: SessionStateMap | undefined): PendingCodeModeInterrupt | undefined;
/** Stores one pending code-mode interrupt on the session. */
export declare function setPendingCodeModeInterrupt(input: {
readonly interrupt: CodeModeInterrupt;
readonly responseMessages: readonly ModelMessage[];
readonly session: HarnessSession;
}): HarnessSession;
/** Clears any pending code-mode interrupt from the session. */
export declare function clearPendingCodeModeInterrupt(session: HarnessSession): HarnessSession;