/** * Worktree-sync runtime composition: the pieces main.ts / RuntimeBuilder wire together. * * The lane binding is an ENVIRONMENT contract: a session launched with `PI_WORKTREE_LANE=` * (set by the `--worktree-lane` CLI flag, or directly by any launcher -- tmux panes inherit it * from the launch command line) is lane-bound: its file-mutation tools run behind the lane gate * (G8/G10) and its epoch watcher injects staleness notices. The env form is deliberate -- it * crosses EVERY process boundary (tmux, exec, nested shells) without per-launcher plumbing. */ import type { SettingsManager } from "../settings-manager.ts"; import { type WorktreeSyncEngineDeps } from "./git-engine.ts"; export declare const PI_WORKTREE_LANE_ENV = "PI_WORKTREE_LANE"; /** The lane this process is bound to, from the cross-process env contract. Invalid values are * ignored (never a crash on a malformed env). */ export declare function getBoundWorktreeLaneKey(env?: NodeJS.ProcessEnv): string | undefined; export interface WorktreeSyncEngineConfig { cwd: string; agentDir: string; settingsManager: SettingsManager; sessionId?: string; signal?: AbortSignal; } /** Build production engine deps from session facts + resolved settings. */ export declare function buildWorktreeSyncEngineDeps(config: WorktreeSyncEngineConfig): WorktreeSyncEngineDeps; export interface WorktreeSyncRuntimeConfig extends WorktreeSyncEngineConfig { /** Structural notice injection into the running session (host `sendCustomMessage` seam): * "steer" mid-turn, trigger a turn when idle -- the host closure decides the mechanics. */ notify: (text: string) => void; /** Diagnostics sink for startup-reconcile findings (never throws into the session). */ onDiagnostic?: (message: string) => void; } export interface WorktreeSyncRuntimeHandle { stop(): void; } /** * Start the per-session worktree-sync runtime (main.ts composition root): * 1. one startup reconcile pass (registry vs git reality -- orphans marked, lost lanes * re-registered, dead owners cleared, provably-stale lock released), and * 2. for a LANE-BOUND session, the epoch watcher: a land anywhere on this machine injects a * deterministic staleness notice into this session promptly (the pull-guaranteed channel is * still the lane gate + turn-start checks -- enforcement never rides on the watcher). * * No-op when worktree-sync is disabled. Never throws: this runs at session start and a broken * repo state must surface as a diagnostic, not a startup crash. */ export declare function startWorktreeSyncRuntime(config: WorktreeSyncRuntimeConfig): Promise; //# sourceMappingURL=runtime.d.ts.map