import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { PlanReceipt } from "../plan/index.js"; import type { StatusCacheDispatchEntry, StatusCacheDispatchWriteResult } from "../status/types.js"; import type { DelegateClientProvider, DelegateDispatchRequest, DispatchResult, DispatchTarget } from "./types.js"; export * from "./types.js"; export { decodeDelegateRuntimeReceipt, loadDelegateClient } from "./runtime.js"; export type DispatchCacheWriter = (cachePath: string, specPath: string, worktreePath: string, entry: StatusCacheDispatchEntry) => Promise; export interface DispatchDependencies { readonly clientProvider?: DelegateClientProvider; readonly cacheWriter?: DispatchCacheWriter; } export interface DispatchPlanInput { readonly plan: PlanReceipt; readonly target: DispatchTarget; readonly context: ExtensionContext; } /** Runtime validation is required because pi-delegate's dispatch request is otherwise Record. */ export declare function validateDelegateDispatchRequest(value: unknown): value is DelegateDispatchRequest; /** * Submit one closed direct request. The injected client surface contains only * dispatch, so this module cannot poll, wait on, steer, cancel, or sequence a run. */ export declare function dispatchPlan(input: DispatchPlanInput, dependencies?: DispatchDependencies): Promise;