import type { ResolvedConfig } from "./config.ts"; export type RunLifecycleState = "provisioning" | "running" | "interrupted" | "resumed" | "failed-to-launch"; export interface RunState { task: string; repository: string; agent: string; worktreeDir: string; branchName: string; workspaceName: string; state: RunLifecycleState; createdAt: string; updatedAt: string; resumeCount: number; reason?: string; detail?: string; /** * Task title at dispatch time. Cached so `crew status` can render it * without re-hitting the task source; lifecycle transitions * (resume/interrupt) that omit the field preserve the on-disk value. */ title?: string; /** * Direct task URL at dispatch time. Same caching rationale as `title`; * the source adapter populates it when it can (e.g., Linear), otherwise * the field stays undefined and `crew status` falls back to displaying * just the task id. */ url?: string; /** * Canonical source-prefixed id used for no-PR self-completion. Cached so * resumed workers keep the same completion target as the original launch. */ completionTaskId?: string; /** * True when the branch was adopted from an existing local/remote branch * rather than created by groundcrew. Teardown must preserve such branches. */ adoptedBranch?: boolean; } export interface RunStateDraft { task: string; repository: string; agent: string; worktreeDir: string; branchName: string; workspaceName: string; state: RunLifecycleState; reason?: string; detail?: string; resumeCount?: number; title?: string; url?: string; completionTaskId?: string; adoptedBranch?: boolean; } export interface RecordRunStateInput { config: ResolvedConfig; state: RunStateDraft; } export interface UpdateRunStateInput { config: ResolvedConfig; task: string; patch: Partial> & { state: RunLifecycleState; }; } export declare function runStateDirectory(config: Pick): string; export declare function runStatePath(config: Pick, task: string): string; export declare function readRunState(config: ResolvedConfig, task: string): RunState | undefined; export declare function recordRunState(input: RecordRunStateInput): RunState; export declare function updateRunState(input: UpdateRunStateInput): RunState | undefined; export declare function removeRunState(config: ResolvedConfig, task: string): void; //# sourceMappingURL=runState.d.ts.map