import type { ResumeCursor, SessionHandle } from "@velum-labs/routekit-harness-core"; import { type ApplyOutcome, type ApplyReview, type Delegation, type DelegationInput, type LocalWorkerBinding, type ReviewReceipt, type SessionScope, type SidekickResult, type TestOutcome, type WorktreeBinding } from "../sidekick-contracts/index.js"; declare const STATE_VERSION: 1; /** A driver-independent seam used by local orchestration and offline fakes. */ export type LocalSessionFactory = (input: { cwd: string; model: string; harness: "codex" | "claude_code"; resume?: ResumeCursor; }) => Promise; export type LocalCoordinatorOptions = { /** The lead checkout. It is never used as the worker cwd. */ leadCwd: string; /** RouteKit-owned directory for state, locks, and detached worktrees. */ stateDir: string; scope: SessionScope; sessionFactory: LocalSessionFactory; /** Optional test commands, run only in the isolated worker worktree. */ testCommands?: readonly string[]; now?: () => Date; }; export type LocalCoordinatorState = { version: typeof STATE_VERSION; delegations: Delegation[]; workers: Record; reviews: ReviewReceipt[]; }; declare function workingTreeDigest(cwd: string): string; /** * Local durable coordinator. All mutations are serialized by the state lock; * worker execution is intentionally outside that lock so cancellation and * cleanup can proceed even when a native harness is slow or disconnected. */ export declare class LocalSidekickCoordinator { #private; constructor(options: LocalCoordinatorOptions); get statePath(): string; list(): readonly Delegation[]; get(delegationId: string): Delegation; delegate(input: DelegationInput): Promise; wait(delegationId: string): Promise; followUp(input: { delegationId: string; generation: string; resultDigest: string; task: string; operationId: string; }): Promise; result(delegationId: string): Promise; cancel(delegationId: string, generation: string): Promise; review(rawRequest: ApplyReview, hostApproved?: boolean): Promise; /** Reconnect an active persisted worker after a process replacement. */ resume(delegationId: string): Promise; dispose(): Promise; } export { workingTreeDigest }; export type { ApplyOutcome, ApplyReview, Delegation, DelegationInput, LocalWorkerBinding, ReviewReceipt, SessionScope, SidekickResult, TestOutcome, WorktreeBinding };