import type { ActiveRun } from "../run-manager.js"; import { type StoredAgentHarnessSession } from "./store.js"; import type { AgentHarnessAdapter, AgentHarnessApproval, AgentHarnessCreateSessionOptions, AgentHarnessEvent, AgentHarnessSession } from "./types.js"; export type AgentHarnessLifecycleErrorCode = "not_found" | "owner_mismatch" | "approval_mismatch" | "unavailable" | "invalid_input"; export interface AgentHarnessLifecycleResult { ok: boolean; runId: string; session?: StoredAgentHarnessSession; events?: AgentHarnessEvent[]; idempotent?: boolean; rehydrated?: boolean; error?: string; errorCode?: AgentHarnessLifecycleErrorCode; } export interface AgentHarnessOwnerScope { ownerEmail: string | null; orgId?: string | null; } export declare function registerLiveAgentHarnessSession(input: { sessionId: string; adapter: AgentHarnessAdapter; session: AgentHarnessSession; createSession?: AgentHarnessCreateSessionOptions; ownerEmail?: string | null; orgId?: string | null; generation: number; }): void; export declare function refreshLiveAgentHarnessSessionGeneration(sessionId: string, session: AgentHarnessSession, generation: number): void; export declare function getLiveAgentHarnessSessionGeneration(sessionId: string, session: AgentHarnessSession): number | null; export declare function releaseLiveAgentHarnessSession(sessionId: string, session?: AgentHarnessSession): void; export declare function resolveAgentHarnessApproval(input: { runId: string; approval: AgentHarnessApproval; scope: AgentHarnessOwnerScope; onHarnessEvent?: (event: AgentHarnessEvent) => void | Promise; }): Promise; export declare function sendAgentHarnessFollowUp(input: { runId: string; prompt: string; scope: AgentHarnessOwnerScope; metadata?: Record; onHarnessEvent?: (event: AgentHarnessEvent) => void | Promise; onRunComplete?: (run: ActiveRun) => void | Promise; }): Promise; export declare function stopLiveAgentHarnessSession(input: { sessionId: string; scope: AgentHarnessOwnerScope; }): Promise; export declare function stopAndPersistAgentHarnessSession(input: { sessionId: string; scope: AgentHarnessOwnerScope; status: "stopped" | "errored"; }): Promise; export declare function sweepExpiredAgentHarnessSessions(now?: number): Promise; export declare function sweepExpiredAgentHarnessFollowUps(limit?: number): Promise<{ recovered: number; truncated: boolean; }>; export declare function sweepExpiredAgentHarnessApprovalResolutions(limit?: number): Promise<{ recovered: number; truncated: boolean; }>;