import type { IsoTime, NodeIdDTO } from './common.js'; /** Report tier — `crtr push {update,urgent,final}`. */ export type ReportTierDTO = 'update' | 'urgent' | 'final'; /** `POST /v1/nodes/{id}/reports` body ({id} = the reporting node). */ export interface PushReportRequest { tier: ReportTierDTO; body: string; } /** Result of a push. `transitioned` is present only for `final`, which drives a * server-side lifecycle transition. */ export interface PushReportResultDTO { /** Absolute path of the written report file. */ report_path: string; /** Subscriber node ids that received an inbox entry. */ notified: NodeIdDTO[]; transitioned?: { from: string; to: string; }; /** Present (and true) only for a `final` push whose reporting node owned a * managed worktree with zero commits ahead of its base and no uncommitted * changes: the server auto-dropped it instead of blocking on `node worktree * close` (#327/#333). A worktree with real unlanded work instead blocks with * an `open_managed_worktree` error. */ worktree_auto_dropped?: boolean; /** Present only alongside `worktree_auto_dropped`: the checkout path dropped. */ worktree_auto_dropped_path?: string; } /** `GET /v1/nodes/{id}/reports` query filters. */ export interface ReportsQuery { tier?: ReportTierDTO; limit?: number; } /** A single stored report entry. */ export interface ReportDTO { /** Absolute path of the report file. */ path: string; tier: ReportTierDTO; body: string; created: IsoTime; }