@vincemakes/kiso-tui 0.40.5 → 0.40.7

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.
@@ -309,7 +309,15 @@ export declare class Body {
309
309
  reprint(): void;
310
310
  /** DC-50 — the switch itself, for the CLI's affordance text. */
311
311
  expandedAll(): boolean;
312
- /** §2.3 — ctrl+t: the committed thinking blocks fold, and fold back.
312
+ /** §2.3 — ctrl+t: thinking hidden, and shown again.
313
+ *
314
+ * 0.40.6 (the owner, 2026-09-23): hidden is ONE italic line per block,
315
+ * live and settled alike — `thinking…` while it runs, `thinking… ·
316
+ * /think` once it settles — and the choice is remembered (the CLI
317
+ * writes it to preferences.json; `setThinkingHidden` restores it at
318
+ * start). It used to fold only SETTLED blocks, into a 100-character
319
+ * preview, while an open block kept streaming its text: the part the
320
+ * owner wanted gone was exactly the part it left.
313
321
  *
314
322
  * DC-50's mechanism exactly: one boolean, then the session is printed
315
323
  * again, so the blocks ALREADY on screen obey the switch rather than
@@ -322,6 +330,12 @@ export declare class Body {
322
330
  * either, which is the same exemption `toggleExpanded` states for a
323
331
  * card that is still growing. */
324
332
  toggleThinking(): void;
333
+ /** 0.40.6: the thinking display, set — at start from the remembered
334
+ * choice, and by ctrl+t. Every thinking block obeys it, the open one
335
+ * included; the session is reprinted only when something is on it. */
336
+ setThinkingHidden(hidden: boolean): void;
337
+ /** 0.40.6: whether thinking is hidden — for the preference and /settings. */
338
+ thinkingHidden(): boolean;
325
339
  /** W18: the status row's right-aligned hint is part of the status
326
340
  * state — the compacting row passes "esc to cancel" (the affordance
327
341
  * must survive repaints). */
@@ -208,8 +208,9 @@ export class Body {
208
208
  #lastTool = null;
209
209
  #pendingCalls = new Map();
210
210
  #pipeBuf = ""; // the passthrough's thinking buffer
211
- // §2.3 — the ctrl+t switch. A block that completes AFTER the press
212
- // inherits it, so the session stays one way up rather than mixing.
211
+ // §2.3 / 0.40.6 — the ctrl+t switch: thinking hidden (and remembered by
212
+ // the CLI). A block that opens or completes AFTER the press inherits it,
213
+ // so the session stays one way up rather than mixing.
213
214
  #thinkingFolded = false;
214
215
  /** TUI2-MD ⑤ — the markdown scanner of the message currently
215
216
  * streaming, and the cell index its first block landed at. Null
@@ -381,7 +382,9 @@ export class Body {
381
382
  last.text += text;
382
383
  }
383
384
  else {
384
- this.#cells.push({ kind: "thinking", text, done: false, turn: this.#turns.length - 1 });
385
+ // 0.40.6: a block opened while thinking is hidden is hidden from its
386
+ // first character — the text is never streamed to the screen.
387
+ this.#cells.push({ kind: "thinking", text, done: false, turn: this.#turns.length - 1, folded: this.#thinkingFolded });
385
388
  // R7 (owner-ruled 2026-08-31): thinking is WORDS, not work — a
386
389
  // cell like prose.
387
390
  const t0 = this.#turns[this.#turns.length - 1];
@@ -1449,7 +1452,15 @@ export class Body {
1449
1452
  expandedAll() {
1450
1453
  return this.#expandedAll;
1451
1454
  }
1452
- /** §2.3 — ctrl+t: the committed thinking blocks fold, and fold back.
1455
+ /** §2.3 — ctrl+t: thinking hidden, and shown again.
1456
+ *
1457
+ * 0.40.6 (the owner, 2026-09-23): hidden is ONE italic line per block,
1458
+ * live and settled alike — `thinking…` while it runs, `thinking… ·
1459
+ * /think` once it settles — and the choice is remembered (the CLI
1460
+ * writes it to preferences.json; `setThinkingHidden` restores it at
1461
+ * start). It used to fold only SETTLED blocks, into a 100-character
1462
+ * preview, while an open block kept streaming its text: the part the
1463
+ * owner wanted gone was exactly the part it left.
1453
1464
  *
1454
1465
  * DC-50's mechanism exactly: one boolean, then the session is printed
1455
1466
  * again, so the blocks ALREADY on screen obey the switch rather than
@@ -1462,12 +1473,26 @@ export class Body {
1462
1473
  * either, which is the same exemption `toggleExpanded` states for a
1463
1474
  * card that is still growing. */
1464
1475
  toggleThinking() {
1465
- this.#thinkingFolded = !this.#thinkingFolded;
1476
+ this.setThinkingHidden(!this.#thinkingFolded);
1477
+ }
1478
+ /** 0.40.6: the thinking display, set — at start from the remembered
1479
+ * choice, and by ctrl+t. Every thinking block obeys it, the open one
1480
+ * included; the session is reprinted only when something is on it. */
1481
+ setThinkingHidden(hidden) {
1482
+ this.#thinkingFolded = hidden;
1483
+ let any = false;
1466
1484
  for (const cell of this.#cells) {
1467
- if (cell.kind === "thinking" && cell.done)
1468
- cell.folded = this.#thinkingFolded;
1485
+ if (cell.kind === "thinking") {
1486
+ cell.folded = hidden;
1487
+ any = true;
1488
+ }
1469
1489
  }
1470
- this.#reprint();
1490
+ if (any)
1491
+ this.#reprint();
1492
+ }
1493
+ /** 0.40.6: whether thinking is hidden — for the preference and /settings. */
1494
+ thinkingHidden() {
1495
+ return this.#thinkingFolded;
1471
1496
  }
1472
1497
  /** W18: the status row's right-aligned hint is part of the status
1473
1498
  * state — the compacting row passes "esc to cancel" (the affordance
package/dist/editor.js CHANGED
@@ -134,6 +134,7 @@ export const MENU_ITEMS = [
134
134
  // never be re-wrapped in place (ADR-0046); this appends it re-folded.
135
135
  { name: "/rewrap", desc: "re-print the recent prose at the current width" },
136
136
  { name: "/status", desc: "show session id, event count, and context estimate" },
137
+ { name: "/settings", desc: "show the settings in force, each value's source, and how to change it" },
137
138
  // TUI2-R1 (E): the rent-ledger attribution — where the context went
138
139
  { name: "/context", desc: "show where the context went — the last request's rent ledger" },
139
140
  // 0.40.0: the person's door to the installed skills — `/<name>` works
@@ -41,6 +41,9 @@ export class PanelInput {
41
41
  * (restored at close — commit AND cancel), the panel takes the
42
42
  * keys and the input row's lead, the composer's own bands close. */
43
43
  begin(view, onCommit, opts) {
44
+ // MP-1 (0.40.7): a pick opens on the row its caller names as current
45
+ const initial = view.pick?.initial;
46
+ const start = view.pick !== undefined && initial !== undefined && Number.isInteger(initial) && initial >= 0 && initial < view.pick.options.length ? initial : 0;
44
47
  this.#panel = {
45
48
  view,
46
49
  phase: "options",
@@ -49,7 +52,7 @@ export class PanelInput {
49
52
  safer: opts?.safer,
50
53
  saferRun: null,
51
54
  ask: view.ask === undefined ? null : askStart(view.ask),
52
- pick: view.pick === undefined ? null : { cursor: 0, phase: "options", level: startLevel(view.pick.options[0]) },
55
+ pick: view.pick === undefined ? null : { cursor: start, phase: "options", level: startLevel(view.pick.options[start]) },
53
56
  onCommit,
54
57
  stash: this.host.stash(),
55
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-tui",
3
- "version": "0.40.5",
3
+ "version": "0.40.7",
4
4
  "description": "kiso tui \u2014 the pure terminal layer (cell renderer, dock, raw editor, diff, palette). Zero runtime dependencies: input is data, output is bytes.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,6 +35,6 @@
35
35
  },
36
36
  "homepage": "https://github.com/vincemakes/kiso/tree/main/packages/tui#readme",
37
37
  "dependencies": {
38
- "@vincemakes/kiso-tui-cells": "0.40.5"
38
+ "@vincemakes/kiso-tui-cells": "0.40.7"
39
39
  }
40
40
  }