/** * `commandmate mem decisions` — read a branch's decisions and one decision's reference diff * (Issue #4355, design `docs/design/mem-decisions-ux-4355.md` §3.4). * * commandmate mem decisions [--worktree [--branch ] | --repository --branch ] [--pending] [--json] * commandmate mem decisions [--worktree | --repository ] [--effect spec|record_only] [--json] * * Reads only, with GET: nothing here writes the decisions or makes what a person approves. * Approving stays on the screen (#4225 D9; the person's decision of 2026-11-13 kept the CLI * to reading). The diff printed here is a reference: it is never a preview, so it cannot be * approved, and it says so first. * * Kept apart from `mem.ts` (which has the writes of the items) so that the guard * `tests/unit/guards/mem-promote-screen-only-4225.test.ts`, which reads a file as a whole, * keeps saying "the CLI has no write of the decisions" (design §3.4.1). * * The free fields (the text, the quote, the destination, the body) were typed by an agent * or a person: the text output shows the terminal's controls as `\xHH` (`\n` kept only in * the body), and `--json` carries them as JSON strings only. */ import { Command } from 'commander'; import type { MemCommonOptions } from '../types'; import type { ApiClient } from '../utils/api-client'; import type { MemErrorCode } from '../../types/mem'; import type { PromoteOperationView } from '../../lib/promote/model'; import type { MemDecisionDiffJsonV1, MemDecisionsJsonV1, PromoteListWire, PromoteReferenceDiffView } from '../types/mem-decisions'; /** What `mem.ts` lends this command: its runner, its refusals and its target options. */ export interface MemDecisionsHost { run: (options: MemCommonOptions, action: (client: ApiClient) => Promise) => Promise; usage: (code: MemErrorCode, message: string, field?: string) => Error; /** The worktree of the caller's own session, if any. */ sessionWorktreeId: (client: ApiClient) => Promise; withTargetOptions: (command: Command, write: boolean) => Command; } export interface MemDecisionsOptions extends MemCommonOptions { pending?: boolean; effect?: string; } /** Show the terminal's controls (C0, DEL, C1, and the invisible / bidi code points) as escapes. */ export declare function escapeTerminal(value: string, keepNewlines?: boolean): string; /** An operation a person still has to look at: in progress, unknown, or its item's move pending (I9). */ export declare function operationNeedsReconcile(operation: Pick): boolean; /** * `--json` (schema 1, I7). `counts` is taken before `--pending`; `--pending` keeps the open * decisions and, whatever their state, those with an operation to reconcile (I9). */ export declare function toDecisionsJson(repositoryId: string, list: PromoteListWire, pending: boolean): MemDecisionsJsonV1; /** The text output (design §3.4.1): one head line per decision, an indented line per operation. */ export declare function decisionsLines(json: MemDecisionsJsonV1): string[]; /** ` --json` (schema 1): the server's reference diff as it is, `ok` dropped. */ export declare function toDiffJson(view: PromoteReferenceDiffView): MemDecisionDiffJsonV1; /** The text output of a reference diff: the notice first, then what it is drawn from, then the body. */ export declare function diffLines(view: PromoteReferenceDiffView): string[]; /** Register `decisions` on `mem` (called by `mem.ts`). */ export declare function addMemDecisionsCommand(mem: Command, host: MemDecisionsHost): void; //# sourceMappingURL=mem-decisions.d.ts.map