@vincemakes/kiso-tui 0.1.39 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,8 @@
8
8
  * The model:
9
9
  * - cells (the CLI's mutation surface) → components → lines;
10
10
  * - `lines[] + commitIndex` (the scrollback fork — the departure from
11
- * pi): a line COMMITS (leaves the live region) via the real-LF
11
+ * the reference implementation's model): a line COMMITS (leaves the
12
+ * live region) via the real-LF
12
13
  * scroll at the last row (`\x1b[1B\n` — CUP-free) when its cell is
13
14
  * DONE and the region needs the room. Committed bytes are never
14
15
  * re-emitted — the native scrollback gets them, reflow-safe, and
@@ -19,8 +20,8 @@
19
20
  * commits the oldest live line regardless of done-ness — the one
20
21
  * sharp edge (asserted by the VT-emulator gate);
21
22
  * - two crash invariants: ① every emitted line's visible width ≤ W
22
- * (components fold; a violation THROWS with diagnostics — pi
23
- * tui-main-screen.ts:447-473, no silent truncate); ② every steady-
23
+ * (components fold; a violation THROWS with diagnostics — the
24
+ * no-silent-truncate ruling); ② every steady-
24
25
  * frame CUP lands in the CONTENT area (rows ≤ H−4−menu — the
25
26
  * committed band, the stale/gap ELs, and the LIVE lines at their
26
27
  * model rows; fix C's sanctioned reinterpretation, ADR-0046) — the
@@ -42,6 +43,7 @@
42
43
  * line-mode bytes byte-for-byte (the e2e guards them).
43
44
  */
44
45
  import { type MenuItem } from "./editor.js";
46
+ import { type PanelState } from "./approval-panel.js";
45
47
  import { type ResumeMeta } from "./render.js";
46
48
  /** The cursor marker — an APC private sequence the focus component
47
49
  * embeds at the edit position; the compositor strips it and moves
@@ -73,6 +75,16 @@ export declare class Body {
73
75
  thinkingEnd(): void;
74
76
  toolStart(name: string, callId: string, input: Record<string, unknown>): void;
75
77
  toolApproval(callId: string, diff: import("./diff.js").DiffResult | null): void;
78
+ /** A5: the approval verdict — the permission_decided event binds into
79
+ * the cell (the aggregated head row: name + status + decidedBy in
80
+ * ONE row; no free-standing ` approved` orphan). The decision lands
81
+ * after the panel closes (the streamed event) — the cell is usually
82
+ * running by then; the record rides the settled row (`· approved by
83
+ * X` on an extension's auto-approval, `· by X` on its denial). A
84
+ * verdict with no live cell is dropped — the registry holds only
85
+ * in-flight calls, and the committed cells already told their
86
+ * outcome. */
87
+ toolVerdict(callId: string, decision: "approved" | "denied", decidedBy?: string, reason?: string): void;
76
88
  toolRunning(callId: string): void;
77
89
  toolSucceeded(callId: string): void;
78
90
  toolFailed(callId: string, error: string): void;
@@ -165,8 +177,10 @@ export declare class Body {
165
177
  * must survive repaints). */
166
178
  setStatus(text: string, hint?: string | null): void;
167
179
  setTail(tail: string): void;
168
- showQuestion(question: string): void;
169
- clearQuestion(): void;
180
+ /** Bind the editor's panel state — the PanelSelect slot occupant
181
+ * (W21: the panel replaces the live region + the input lead while
182
+ * up; the old ApprovalPrompt's question slot retires with it). */
183
+ bindApproval(state: () => PanelState | null): void;
170
184
  /** Bind the CURRENT input line's state — the focus component reads it. */
171
185
  bindInput(state: () => {
172
186
  line: string;
@@ -178,6 +192,10 @@ export declare class Body {
178
192
  items: readonly MenuItem[];
179
193
  selected: number;
180
194
  } | null): void;
195
+ /** Bind the pending-turn queue — the CLI's live slots (chat.ts):
196
+ * the chips render in the menu-rows family, the live caps shrink
197
+ * by their rows, and the +N queued hint rides the status row. */
198
+ bindQueue(state: () => readonly string[]): void;
181
199
  /** The input line's edit column — the old dock's API. v6: the CURSOR
182
200
  * derives from the frame's marker; this is the same value computed
183
201
  * from the bound input state (the CLI's BodyOptions.editCol callback
@@ -200,15 +218,16 @@ export declare class Body {
200
218
  * input/menu bindings, which the CLI performs BEFORE the Body exists,
201
219
  * are buffered and applied by the Body's constructor. */
202
220
  export declare class Dock {
203
- #private;
204
221
  get active(): boolean;
205
222
  enter(): void;
206
223
  exit(): void;
207
224
  onResize(): void;
208
225
  setStatus(text: string, hint?: string | null): void;
209
226
  setTail(tail: string): void;
210
- showQuestion(question: string): void;
211
- clearQuestion(): void;
227
+ /** W21: bind the editor's panel state — the PanelSelect slot
228
+ * occupant (the panel replaces the live region + the input lead
229
+ * while up; the old ApprovalPrompt's question slot retires). */
230
+ bindApproval(state: () => PanelState | null): void;
212
231
  bindInput(state: () => {
213
232
  line: string;
214
233
  cursor: number;
@@ -217,6 +236,10 @@ export declare class Dock {
217
236
  items: readonly MenuItem[];
218
237
  selected: number;
219
238
  } | null): void;
239
+ /** W22: bind the pending-turn queue — the chips + the +N queued
240
+ * hint (the CLI binds it from chat(); the editor's pop keys ride
241
+ * the LineInput's own bindQueue). */
242
+ bindQueue(state: () => readonly string[]): void;
220
243
  editCol(): number;
221
244
  redraw(): void;
222
245
  }