import { type Op } from "./ops.js"; import type { AssessmentDeliveryStatus } from "./model.js"; import type { DetectedAgent, RunnerAgent } from "./agent-runner.js"; import type { Store } from "./store.js"; /** An agent's unapplied change, waiting for a person. */ export interface ReviewProposal { seq: number; by: string; at: string; summary: string; } /** What a person asked an agent for, and how far it got. Queued is not running. */ export interface ReviewRequest { id: string; intent: "assess" | "implement" | "discuss"; status: AssessmentDeliveryStatus; note?: string; revision: number; returns: number; } export interface ReviewList { proposals: ReviewProposal[]; requests: ReviewRequest[]; } /** Everything on this surface is agent-authored. A newline or an escape byte in a job name would * forge a row — a second "Accept:" line, or an attribution reading human: — on the one screen whose * job is saying truthfully who proposed what, and a bidi override (U+202E) reorders a row visually * in a bidi-aware terminal to the same end. Strip the C0/DEL/C1 controls and the Unicode bidi, * zero-width and format controls, then flatten to one bounded line before it reaches a terminal. */ export declare function sanitize(text: string, max: number): string; /** One line a person can decide from without opening the board. */ export declare function summarizeOp(op: Op, name: (id: string) => string): string; /** Everything on one board that is waiting for a person: unapplied proposals and request state. */ export declare function listReview(store: Store, board: string): Promise; /** A decision is a person's act. The actor is recorded, never inferred from who proposed. */ export declare function decideProposal(store: Store, board: string, seq: number, decision: "accept" | "reject", actor: string, reason?: string): Promise; /** Readable on a terminal, with the command that acts on each line. Every cell is sanitized here * too: this is the last point before the text is printed, and it must hold whatever reaches it. */ export declare function formatReview(board: string, list: ReviewList, url?: string): string; /** Name the board when the workspace leaves no doubt; otherwise say which names exist. */ export declare function resolveBoard(board: string | undefined, boards: string[]): string; export interface ListenInput { agent?: string; board?: string; agentBin?: string; detected: DetectedAgent[]; boards: string[]; } export interface ListenResolution { agent: RunnerAgent; agentBin?: string; board: string; } /** Only ask for a flag the terminal cannot work out. */ export declare function resolveListen(input: ListenInput): ListenResolution;