/** * Factory-bound production dispatch surface. * The campaign owner may resolve current advice without effects, then invoke * the two mutating operations: request_advice or launch_worker. * Worktree preparation is internal to launch_worker. * * Production long lane resolves sealed Goal capability from the journal and builds * the fixed interactive native /goal plan — no injectable plan/capability callbacks. * Session is derived solely from stable launch operation identity (no mint allocator). */ import { type RolePolicyConfig } from "../domain/role-policy.js"; import { type AdviceAdapter, type CurrentAdviceResolution, type FreshAdviceResult } from "./dispatch-advice.js"; import { type LaunchLane, type LaunchWorkerResult, type WorkerLaunchAdapter } from "./launch.js"; import type { GoalCapabilityProbeAdapter } from "./providers.js"; import type { Clock, KernelPaths } from "./types.js"; import type { WorktreeAdapter } from "./worktree.js"; export interface DispatchServiceConfig { readonly paths: KernelPaths; readonly clock: Clock; readonly rolePolicy?: RolePolicyConfig; readonly adviceAdapter: AdviceAdapter; readonly worktreeAdapter: WorktreeAdapter; readonly launchAdapter: WorkerLaunchAdapter; readonly claudeBinary: string; readonly resolveWorkerMcpConfigPath: (input: { readonly task_id: string; readonly worktree_path: string; readonly worktree_git_dir: string; }) => string; readonly resolveClaudeWorkerSettingsPath?: (input: { readonly task_id: string; readonly worktree_path: string; readonly worktree_git_dir: string; readonly common_git_dir: string; readonly branch: string; }) => string; readonly resolveCodexWorkerHomePath?: (input: { readonly task_id: string; readonly session_id: string; readonly worktree_path: string; readonly worktree_git_dir: string; }) => string; readonly goalCapabilityAdapter?: GoalCapabilityProbeAdapter; readonly env?: NodeJS.ProcessEnv; } export interface DispatchService { resolveAdvice(input: { readonly taskId: string; }): CurrentAdviceResolution; requestAdvice(input: { readonly expectedRunId?: string; readonly expectedRunVersion?: number; readonly taskId: string; readonly expectedVersion: number; readonly expectedSourceDigest: string; }): FreshAdviceResult; launchWorker(input: { readonly expectedRunId?: string; readonly expectedRunVersion?: number; readonly taskId: string; readonly expectedVersion: number; readonly expectedSourceDigest: string; readonly lane: LaunchLane; }): LaunchWorkerResult; } export declare function createDispatchService(config: DispatchServiceConfig): DispatchService;