/** Typed option bags shared by the route engine, drain engine, and CLI commands. */ export interface TodosTaskRouteOptions { eventFile?: string; eventJson?: string; policy?: string; preset?: string; routePolicyEvidence?: string; template?: string; provider?: string; providerRule?: string[]; authProfile?: string; authProfilePool?: string; triageAuthProfile?: string; plannerAuthProfile?: string; workerAuthProfile?: string; verifierAuthProfile?: string; account?: string; accountPool?: string; triageAccount?: string; plannerAccount?: string; workerAccount?: string; verifierAccount?: string; accountTool?: string; model?: string; variant?: string; agent?: string; addDir?: string[]; timeout?: string; verifierIdleTimeout?: string; permissionMode?: string; sandbox?: string; allowTool?: string[]; allowCommand?: string[]; safetyReason?: string; manualBreakGlass?: boolean; projectPath?: string; projectGroup?: string; maxActive?: string; maxActivePerProject?: string; maxActivePerProjectGroup?: string; maxActiveScope?: string; providerActiveCap?: string; codewithActiveCap?: string; providerAdmissionCheck?: boolean; maxPerProfile?: string; worktreeMode?: string; worktreeRoot?: string; worktreeBranchPrefix?: string; prHandoff?: boolean; githubReviewer?: string; githubReviewerPool?: string; namePrefix?: string; preflight?: boolean; dryRun?: boolean; todosProject?: string; /** Internal drain context; never derived from CLI/event fields. */ sourceTodosProjectPath?: string; /** Canonical task id returned by the active todos source queue (internal drain proof). */ sourceTaskResolvedId?: string; } export interface TodosReadyTask { id?: string; task_id?: string; taskId?: string; source_project_path?: string; sourceProjectPath?: string; title?: string; description?: string; body?: string; status?: string; working_dir?: string; workingDir?: string; project_path?: string; projectPath?: string; cwd?: string; tags?: string[] | string; metadata?: Record; project_id?: string; projectId?: string; task_list_id?: string; taskListId?: string; task_list?: { id?: string; slug?: string; }; [key: string]: unknown; } export interface TodosDrainOptions extends TodosTaskRouteOptions { todosProject?: string; todosProjectsFromRegistry?: boolean; todosProjectInclude?: string[]; todosProjectId?: string; taskList?: string; tags?: string; tag?: string; projectPathPrefix?: string; limit?: string; scanLimit?: string; maxDispatch?: string; launchGate?: string; launchGateBlocker?: string[]; evidenceDir?: string; compact?: boolean; } export interface TodosTaskRoutePrint { kind: "skipped" | "deduped" | "throttled" | "created"; /** * `sourceUnavailable` is the flag the CLI reads to exit non-zero when the task * source could not be reached (see handleRouteEvent). Naming it here documents * that contract and pins its TYPE: writing a non-boolean to this exact key is a * compile error (TS2322). * * It does NOT pin the NAME. The `Record` index signature is * still present, so a misspelling on either the producer or the consumer side * compiles cleanly — measured: a probe misspelling it in both places typechecks * rc=0, while assigning a number to the correct name errors TS2322. A typo would * therefore pass every test and silently restore the bug where an unreachable * source exited 0. The regression tests in route-event.test.ts are what actually * guard the name; the type only guards the shape. Closing that gap means * dropping the index signature or routing both sides through one shared * constant, which is tracked separately rather than smuggled in here. */ value: Record & { sourceUnavailable?: boolean; }; human: string; }