import type { Project } from "../config.js"; import { type HostingAdapter } from "../domain.js"; import type { Store } from "../store.js"; import type { ApprovalGate, SdlcPolicy } from "./schema.js"; import type { WorkInspection } from "./store.js"; export interface WorkItemView extends WorkInspection { approvalSource: SdlcPolicy["approvalSource"]; runIds: string[]; /** Ready work in a project blocked by escalation; an operator may resubmit it. */ recoverable: boolean; } export interface WorkOperator { list(): Promise; inspect(id: string): Promise; /** Record local human approval of the inspected revision. */ approve(id: string, approval: { gate: ApprovalGate; revision: string; }): Promise; /** * Admit the inspected ready revision into a blocked project after checking * that earlier processes stopped and the checkout is clean. */ resubmit(id: string, revision: string): Promise; } /** * Operator actions on Work Items for an interactive surface (CLI, terminal or * web monitor). Items outside `projects` are reported as not found. Store * errors keep their kinds: WorkItemNotFoundError, ApprovalForbiddenError and * WorkConflictError. */ export declare function workOperator(options: { store: Store; /** SDLC-enabled projects the surface exposes; read on every call. */ projects: () => Promise; /** Approver identity; defaults to the local OS user. */ operator?: string; /** Absolute state directory; required for `resubmit`. */ stateDirectory?: string; hosting?: (project: Project) => HostingAdapter; }): WorkOperator;