import type { ISessionClient } from "../../platform/ports/session-client.ts"; import type { ResolvedFunction } from "../../types.ts"; import type { ArtifactStore } from "../../function/artifact-store.ts"; /** Inputs the builtin continuation source needs from the session.idle handler. */ export interface BuiltinContinuationContext { /** The session being evaluated. */ sessionID: string; /** * Active function names to evaluate, iterated in insertion order — the SAME * Set the caller computed (iteration order decides which fn wins the ONE * continuation-per-idle race). */ activeSet: Set; /** All resolved functions for the session's roles — resolves each name. */ allFns: ResolvedFunction[]; /** Whether any active fn declares Tier-2 handlers (precomputed by caller). */ hasHandlers: boolean; /** Last assistant text (precomputed by the caller; may be null). */ lastText: string | null; artifacts: ArtifactStore; /** Workspace directory — feeds CondEnv.workspaceDir. */ workspaceDir: string; /** Hook-owned session→agent registry (sessionAgentRegistry). */ sessionAgentRegistry: Map; /** Platform session client used to inject the continuation reminder. */ session: ISessionClient; } /** * Builtin continuation policy — ONE continuation per idle event. * * Encapsulates the exact logic extracted from event-handler.ts session.idle: * per-function loop over `functionRuntime.all(sid)`, gated-unblock backstop * (120s default), requires_evidence gate, declarative continue_until + additive * shouldContinue, the unmodified decideContinuation call (cfg * `{ globalMaxTurns: 25, perFnMax: fn.continue_max ?? 5 }` — DEFAULT_COOLDOWN_RULES * applies inside decideContinuation when cfg.cooldownRules is absent), prompt * injection via `session.prompt` with the [auto-continue N/M for fn] reminder, * and prompt-failure rollback of continuationCount + cooldownUntilTurn. * * @returns true when a continuation prompt was successfully sent. */ export declare function evaluateBuiltinContinuation(ctx: BuiltinContinuationContext): Promise; //# sourceMappingURL=builtin.d.ts.map