@sagmans/dsh-tui 0.11.2 → 0.13.0

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.
Files changed (132) hide show
  1. package/README.md +49 -2
  2. package/cordis.patch.yml +4 -0
  3. package/lib/agent/status.d.ts +5 -0
  4. package/lib/agent/status.d.ts.map +1 -1
  5. package/lib/agent/status.js +2 -0
  6. package/lib/agent/status.js.map +1 -1
  7. package/lib/gates/questions.d.ts.map +1 -1
  8. package/lib/gates/questions.js +9 -6
  9. package/lib/gates/questions.js.map +1 -1
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +14 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/input/action-catalog.d.ts +3 -1
  14. package/lib/input/action-catalog.d.ts.map +1 -1
  15. package/lib/input/action-catalog.js +7 -2
  16. package/lib/input/action-catalog.js.map +1 -1
  17. package/lib/input/actions.d.ts +8 -3
  18. package/lib/input/actions.d.ts.map +1 -1
  19. package/lib/input/actions.js +22 -12
  20. package/lib/input/actions.js.map +1 -1
  21. package/lib/input/completion.js +4 -2
  22. package/lib/input/completion.js.map +1 -1
  23. package/lib/input/file-search.d.ts +3 -1
  24. package/lib/input/file-search.d.ts.map +1 -1
  25. package/lib/input/file-search.js +22 -6
  26. package/lib/input/file-search.js.map +1 -1
  27. package/lib/input/keymap-conflicts.d.ts +5 -4
  28. package/lib/input/keymap-conflicts.d.ts.map +1 -1
  29. package/lib/input/keymap-conflicts.js +12 -12
  30. package/lib/input/keymap-conflicts.js.map +1 -1
  31. package/lib/input/keymap-settings.d.ts +4 -7
  32. package/lib/input/keymap-settings.d.ts.map +1 -1
  33. package/lib/input/keymap-settings.js +6 -5
  34. package/lib/input/keymap-settings.js.map +1 -1
  35. package/lib/input/keymap.d.ts.map +1 -1
  36. package/lib/input/keymap.js +6 -6
  37. package/lib/input/keymap.js.map +1 -1
  38. package/lib/input/submission.d.ts +3 -0
  39. package/lib/input/submission.d.ts.map +1 -1
  40. package/lib/input/submission.js.map +1 -1
  41. package/lib/input.d.ts +6 -0
  42. package/lib/input.d.ts.map +1 -1
  43. package/lib/input.js +32 -1
  44. package/lib/input.js.map +1 -1
  45. package/lib/keymaps.d.ts +56 -0
  46. package/lib/keymaps.d.ts.map +1 -0
  47. package/lib/keymaps.js +106 -0
  48. package/lib/keymaps.js.map +1 -0
  49. package/lib/keys-command.d.ts.map +1 -1
  50. package/lib/keys-command.js +4 -4
  51. package/lib/keys-command.js.map +1 -1
  52. package/lib/surface/appearance.d.ts +3 -0
  53. package/lib/surface/appearance.d.ts.map +1 -1
  54. package/lib/surface/appearance.js +15 -3
  55. package/lib/surface/appearance.js.map +1 -1
  56. package/lib/surface/commands.d.ts +2 -0
  57. package/lib/surface/commands.d.ts.map +1 -1
  58. package/lib/surface/commands.js +3 -0
  59. package/lib/surface/commands.js.map +1 -1
  60. package/lib/surface/modal-input.d.ts +1 -0
  61. package/lib/surface/modal-input.d.ts.map +1 -1
  62. package/lib/surface/modal-input.js +77 -45
  63. package/lib/surface/modal-input.js.map +1 -1
  64. package/lib/surface/model-choice.d.ts +5 -0
  65. package/lib/surface/model-choice.d.ts.map +1 -1
  66. package/lib/surface/model-choice.js +6 -2
  67. package/lib/surface/model-choice.js.map +1 -1
  68. package/lib/surface/plugin-actions.d.ts +18 -0
  69. package/lib/surface/plugin-actions.d.ts.map +1 -0
  70. package/lib/surface/plugin-actions.js +45 -0
  71. package/lib/surface/plugin-actions.js.map +1 -0
  72. package/lib/surface/prompt-input.d.ts.map +1 -1
  73. package/lib/surface/prompt-input.js +4 -0
  74. package/lib/surface/prompt-input.js.map +1 -1
  75. package/lib/terminal/host-writes.d.ts.map +1 -1
  76. package/lib/terminal/host-writes.js +15 -9
  77. package/lib/terminal/host-writes.js.map +1 -1
  78. package/lib/terminal/warning-screen.d.ts +9 -2
  79. package/lib/terminal/warning-screen.d.ts.map +1 -1
  80. package/lib/terminal/warning-screen.js +148 -22
  81. package/lib/terminal/warning-screen.js.map +1 -1
  82. package/lib/terminal-text.d.ts.map +1 -1
  83. package/lib/terminal-text.js +12 -6
  84. package/lib/terminal-text.js.map +1 -1
  85. package/lib/theme-settings.d.ts +2 -10
  86. package/lib/theme-settings.d.ts.map +1 -1
  87. package/lib/transcript.d.ts +5 -0
  88. package/lib/transcript.d.ts.map +1 -1
  89. package/lib/transcript.js +30 -13
  90. package/lib/transcript.js.map +1 -1
  91. package/lib/ui/copy.js +3 -0
  92. package/lib/ui/copy.js.map +1 -1
  93. package/lib/ui/dock.d.ts +8 -0
  94. package/lib/ui/dock.d.ts.map +1 -1
  95. package/lib/ui/dock.js +17 -0
  96. package/lib/ui/dock.js.map +1 -1
  97. package/lib/ui/editor.d.ts +16 -11
  98. package/lib/ui/editor.d.ts.map +1 -1
  99. package/lib/ui/editor.js +62 -39
  100. package/lib/ui/editor.js.map +1 -1
  101. package/lib/ui/frame.d.ts +11 -5
  102. package/lib/ui/frame.d.ts.map +1 -1
  103. package/lib/ui/frame.js +23 -7
  104. package/lib/ui/frame.js.map +1 -1
  105. package/lib/ui/layout.d.ts +3 -4
  106. package/lib/ui/layout.d.ts.map +1 -1
  107. package/lib/ui/layout.js +12 -7
  108. package/lib/ui/layout.js.map +1 -1
  109. package/lib/ui/picker.d.ts +1 -0
  110. package/lib/ui/picker.d.ts.map +1 -1
  111. package/lib/ui/picker.js +22 -9
  112. package/lib/ui/picker.js.map +1 -1
  113. package/lib/ui/queue.d.ts +1 -1
  114. package/lib/ui/queue.d.ts.map +1 -1
  115. package/lib/ui/queue.js +14 -3
  116. package/lib/ui/queue.js.map +1 -1
  117. package/lib/ui/status.d.ts +2 -0
  118. package/lib/ui/status.d.ts.map +1 -1
  119. package/lib/ui/status.js +4 -3
  120. package/lib/ui/status.js.map +1 -1
  121. package/lib/ui/view/document.d.ts +30 -0
  122. package/lib/ui/view/document.d.ts.map +1 -0
  123. package/lib/ui/view/document.js +87 -0
  124. package/lib/ui/view/document.js.map +1 -0
  125. package/lib/ui/view/transcript-message.d.ts.map +1 -1
  126. package/lib/ui/view/transcript-message.js +4 -3
  127. package/lib/ui/view/transcript-message.js.map +1 -1
  128. package/lib/ui/view.d.ts +45 -76
  129. package/lib/ui/view.d.ts.map +1 -1
  130. package/lib/ui/view.js +71 -148
  131. package/lib/ui/view.js.map +1 -1
  132. package/package.json +6 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/ui/view/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,MAAM,qBAAqB,CAAA;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAiB,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAkB,MAAM,YAAY,CAAA;AAkB3C,wFAAwF;AACxF,MAAM,OAAO,kBAAkB;IAQA;IAPZ,IAAI,GAAG,IAAI,QAAQ,EAAmB,CAAA;IACtC,UAAU,GAAG,IAAI,OAAO,EAAyC,CAAA;IACjE,SAAS,GAAG,IAAI,OAAO,EAAwC,CAAA;IACxE,KAAK,CAA2B;IAChC,UAAU,GAAyB,EAAE,CAAA;IACrC,MAAM,GAAwB,EAAE,CAAA;IAExC,YAA6B,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;IAAG,CAAC;IAEzD,4FAA4F;IAC5F,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,UAAU,CAAA;IACxB,CAAC;IAED,uFAAuF;IACvF,UAAU;QACR,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;IACxB,CAAC;IAED,8FAA8F;IAC9F,MAAM,CAAC,KAAa,EAAE,GAAW,EAAE,YAAoB;QACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,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P,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,eAAe;IAErD;;;;;SAKK;IACH,OAAO,CAAC,aAAa;IAKvB;;;;;SAKK;IACH,OAAO,CAAC,YAAY;IAkBtB;;;;;;;;;;SAUK;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,GAAG,IAAI;IAkB5I;;;;;;SAMK;IACH,OAAO,CAAC,aAAa;IAIvB,0GAA0G;IACxG,QAAQ,IAAI,YAAY;IAG1B,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,EAAE;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI;IA2B/H,gFAAgF;IAC9E,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;CAIvC"}
@@ -12,7 +12,7 @@ import {} from "../../transcript.js";
12
12
  import {} from "../../theme-tokens.js";
13
13
  import {} from "../../theme.js";
14
14
  import { codeBlockLines } from "../diff.js";
15
- import { canFrame, frameBlock, FRAME_COLUMNS, textWidth } from "../frame.js";
15
+ import { canFrame, frameBlock, RAIL_COLUMNS, textWidth } from "../frame.js";
16
16
  import { gapRows } from "../gap.js";
17
17
  import { ANSWER_FACE } from "../markdown.js";
18
18
  import {} from "../view.js";
@@ -96,13 +96,14 @@ export class Messages {
96
96
  * only the drawing knows which columns of a row are the frame's.
97
97
  */
98
98
  pushFramed(lines, copy, text, width, live, face, borderToken) {
99
- const framed = canFrame(width, this.context.theme.visible(borderToken));
100
- const inside = framed ? width - FRAME_COLUMNS : width;
99
+ const framed = canFrame(width, this.context.theme.visible(borderToken), true);
100
+ const inside = framed ? width - RAIL_COLUMNS : width;
101
101
  const body = this.markdownLines(text, textWidth(inside), live, face);
102
102
  const block = frameBlock(body, width, {
103
103
  text: line => line,
104
104
  border: rule => this.context.theme.style(borderToken, rule),
105
105
  framed,
106
+ rail: true,
106
107
  });
107
108
  // A card is an object of the transcript rather than a paragraph of it, so it
108
109
  // opens and closes with air: the prompt and the reply of one exchange stop
@@ -1 +1 @@
1
- {"version":3,"file":"transcript-message.js","sourceRoot":"","sources":["../../../src/ui/view/transcript-message.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAsB,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAgB,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAwB,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAiB,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAiB,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAiB,MAAM,aAAa,CAAA;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAA4C,MAAM,gBAAgB,CAAA;AACtF,OAAO,EAAkB,MAAM,YAAY,CAAA;AAE3C,MAAM,aAAa,GAAG,MAAM,CAAA;AAC5B;;;;;;;;;;GAUG;AACH,SAAS,sBAAsB,CAAC,KAA+B,EAAE,KAAe;IAC9E,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,KAAK;QAClB,EAAE,EAAE,KAAK;QACT,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,KAAK;QACX,MA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C,CAAC,GAAG,KAAK,GAAG,CAAA;IACxC,CAAC;CACJ"}
package/lib/ui/view.d.ts CHANGED
@@ -25,12 +25,6 @@ export interface ViewState {
25
25
  * to a click on the card's own header or to the nested-calls key.
26
26
  */
27
27
  export declare const DEFAULT_VIEW_STATE: ViewState;
28
- /**
29
- * Where one clickable message drew, so a click can find what it landed on.
30
- *
31
- * A card's rows cover the calls it dispatched, so the card and each of those
32
- * calls have a span; the click takes the tightest one it falls in.
33
- */
34
28
  /**
35
29
  * Where one clickable message drew, so a click can find what it landed on.
36
30
  *
@@ -49,10 +43,9 @@ export interface ClickSpan {
49
43
  /**
50
44
  * Renders the transcript rows and any pending gate as terminal lines.
51
45
  *
52
- * The component stays a pure projection: it holds no cache of its own, so a
53
- * resize, a resume, or an open gate redraws the same rows without replaying
54
- * anything. Everything it draws came from a model, a tool, or a file, so the
55
- * text passes through the display escaping before it is styled.
46
+ * Retained rows must keep their click and copy accounts, so one document owner
47
+ * refreshes them together while overlays remain transient. External text still
48
+ * passes through display escaping before styling because it is not terminal protocol.
56
49
  */
57
50
  /** What sits below the transcript while the reader is being asked something. */
58
51
  export interface TranscriptViewOptions {
@@ -68,10 +61,10 @@ export interface TranscriptViewOptions {
68
61
  */
69
62
  readonly keys?: () => Keymap;
70
63
  /**
71
- * How one tool's cards draw, read per render.
64
+ * Mutable tool policies require invalidate() when changed.
72
65
  *
73
- * The settings document is hot-reloaded, so a captured table would keep
74
- * folding a session under the policy it happened to start with.
66
+ * Callback identity cannot describe live configuration, so entry and
67
+ * document caches must refresh together. The settings composition already does this.
75
68
  */
76
69
  readonly toolDisplay?: (tool: string) => ToolDisplaySpec;
77
70
  /**
@@ -87,39 +80,13 @@ export declare class TranscriptView implements Component {
87
80
  private readonly theme;
88
81
  private readonly markdown;
89
82
  private readonly options;
90
- private readonly rows;
91
- /**
92
- * Fold choices the reader made by clicking, per message.
93
- *
94
- * Absent means the key or the tool's own policy decides, so a settings edit
95
- * stays in charge of messages nobody clicked. Keyed by the call or thought id
96
- * rather than by the entry, because a result replaces the entry a click was
97
- * made on and a thought outlives the live row that streamed it.
98
- */
83
+ private readonly document;
99
84
  private readonly clicked;
100
- /** The rows each clickable message drew last render, for mapping a click back to it. */
101
- private spans;
102
- /** The same spans relative to their entry, so a cached entry still answers clicks. */
103
- private readonly entrySpans;
104
- /**
105
- * The framed rows each entry drew last render, for reading a copy back out.
106
- *
107
- * Relative to the entry for the same reason the spans are: a cached entry draws
108
- * no rows this frame and still has to answer for what it drew before.
109
- */
110
- private readonly entryCopy;
111
- /**
112
- * The framed rows the in-flight entries drew this frame.
113
- *
114
- * They cannot be kept by entry the way the settled ones are: every frame builds
115
- * a live entry as a fresh object, so a map keyed by it would never answer. A copy
116
- * is read against the last frame, so it is the render that keeps them.
117
- */
118
- private liveCopy;
85
+ private presentationRevision;
119
86
  private readonly cards;
120
87
  private readonly messages;
121
88
  private readonly gates;
122
- /** The row renderers, each told only what it draws, so the view stays the one owner of view state and row caches. */
89
+ /** Presentation policy stays here; the document retains rows with their hit and copy metadata. */
123
90
  constructor(model: TranscriptModel, theme: TuiTheme, markdown: MarkdownRenderer, options?: TranscriptViewOptions);
124
91
  private get viewState();
125
92
  /** The display the reader configured for a tool, or the shipped one. */
@@ -127,12 +94,12 @@ export declare class TranscriptView implements Component {
127
94
  /** The air in force, or the shipped spacing for a caller that lent none. */
128
95
  private air;
129
96
  /**
130
- * Whether one tool message draws open.
131
- *
132
- * A click outranks the key, which outranks the tool's start state: Ctrl+O
133
- * stays "show me everything", while one clicked message keeps the state the
134
- * reader gave it.
135
- */
97
+ * Whether one tool message draws open.
98
+ *
99
+ * A click outranks the key, which outranks the tool's start state: Ctrl+O
100
+ * stays "show me everything", while one clicked message keeps the state the
101
+ * reader gave it.
102
+ */
136
103
  private expansionOf;
137
104
  /** Whether one thought draws its body; a click decides for that thought alone. */
138
105
  private reasoningOpen;
@@ -154,48 +121,50 @@ export declare class TranscriptView implements Component {
154
121
  */
155
122
  private subCallsOpen;
156
123
  /**
157
- * Answer a click on a message by folding or unfolding that one row.
158
- *
159
- * The tightest span under the point wins, so a click on a dispatched call
160
- * opens that call rather than the card around it. Only a left click is
161
- * consumed: a press, a drag, and a wheel belong to the surface's own
162
- * selection and scrolling, and a row that swallowed them would cost the
163
- * reader the ability to copy the command it just drew.
164
- */
124
+ * Answer a click on a message by folding or unfolding that one row.
125
+ *
126
+ * The tightest span under the point wins, so a click on a dispatched call
127
+ * opens that call rather than the card around it. Only a left click is
128
+ * consumed: a press, a drag, and a wheel belong to the surface's own
129
+ * selection and scrolling, and a row that swallowed them would cost the
130
+ * reader the ability to copy the command it just drew.
131
+ */
165
132
  handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
166
133
  invalidate(): void;
167
134
  /**
168
- * Wrap one text block under a prefix, keeping the prefix's column budget.
169
- *
170
- * The block is drawn before it is wrapped: a sequence a terminal would have
171
- * acted on has to be gone before pi-tui measures the row, and a tab has to
172
- * land on the stop the writer saw rather than one a wrapper would guess at.
173
- * The prefix seeds that stop, because it is already on the row.
174
- */
135
+ * Wrap one text block under a prefix, keeping the prefix's column budget.
136
+ *
137
+ * The block is drawn before it is wrapped: a sequence a terminal would have
138
+ * acted on has to be gone before pi-tui measures the row, and a tab has to
139
+ * land on the stop the writer saw rather than one a wrapper would guess at.
140
+ * The prefix seeds that stop, because it is already on the row.
141
+ */
175
142
  private pushWrapped;
176
143
  /** The live map, or the shipped one for a caller that did not lend one. */
177
144
  private keymap;
178
145
  private reasoningFoldHint;
179
146
  /**
180
- * Whether any part of one card is still in flight.
181
- *
182
- * Only a card with work outstanding has a clock attached to its cache, so the
183
- * moment the last call settles the row stops being rebuilt: a program that
184
- * came back must not keep spending the cache its result is now stored in.
185
- */
147
+ * Whether any part of one card is still in flight.
148
+ *
149
+ * Only a card with work outstanding has a clock attached to its cache, so the
150
+ * moment the last call settles the row stops being rebuilt: a program that
151
+ * came back must not keep spending the cache its result is now stored in.
152
+ */
186
153
  private isLive;
187
154
  private pushPicker;
188
155
  /** The rows one transcript entry becomes; `live` marks the entry the turn is still writing. */
189
156
  private renderEntry;
157
+ /** Entry folds remain local so a click does not spend every settled row's cache. */
158
+ private entryTag;
190
159
  render(width: number): string[];
191
160
  /**
192
- * The framed rows the last render drew, in the order the transcript reads.
193
- *
194
- * A copy of a selection is read off the screen, so it carries the frame the
195
- * surface drew around a message — the sides, the padding beside them, and the
196
- * rules above and below. This is the account that lets the surface take its own
197
- * frame back out of a copy without ever touching a character the reader wrote.
198
- */
161
+ * The framed rows the last render drew, in the order the transcript reads.
162
+ *
163
+ * A copy of a selection is read off the screen, so it carries the frame the
164
+ * surface drew around a message — the sides, the padding beside them, and the
165
+ * rules above and below. This is the account that lets the surface take its own
166
+ * frame back out of a copy without ever touching a character the reader wrote.
167
+ */
199
168
  copyRows(): readonly FrameRow[];
200
169
  }
201
170
  //# sourceMappingURL=view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/ui/view.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAkC,MA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;;;OAMG;IACH,OAAO,CAAC,WAAW;IAKrB,kFAAkF;IAChF,OAAO,CAAC,aAAa;IAKvB,6FAA6F;IAC3F,OAAO,CAAC,WAAW;IAGnB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,YAAY;IAMpB;;;;;;;;OAQG;IACH,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,mBAAmB,GAAG,SAAS;IAqBlE,UAAU,IAAI,IAAI;IAKlB;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;IAcrB,2EAA2E;IACzE,OAAO,CAAC,MAAM;IAGd,OAAO,CAAC,iBAAiB;IAGzB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,UAAU;IASpB,+FAA+F;IAC7F,OAAO,CAAC,WAAW;IAmCnB,oFAAoF;IACpF,OAAO,CAAC,QAAQ;IAUhB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAkB/B;;;;;;;OAOG;IACH,QAAQ,IAAI,SAAS,QAAQ,EAAE;CAGhC"}
package/lib/ui/view.js CHANGED
@@ -1,9 +1,9 @@
1
- import { RowCache } from "./rows.js";
1
+ import { TranscriptDocument } from "./view/document.js";
2
2
  import {} from "./picker.js";
3
3
  import { pickerCardLines } from "./picker-card.js";
4
4
  import { ANSWER_FACE } from "./markdown.js";
5
5
  import {} from "./frame.js";
6
- import { gapRows, placeGap, pushGap } from "./gap.js";
6
+ import { gapRows, pushGap } from "./gap.js";
7
7
  import {} from "../theme.js";
8
8
  import {} from "../theme-tokens.js";
9
9
  import { DEFAULT_TOOL_DISPLAY } from "../tool-display.js";
@@ -49,39 +49,13 @@ export class TranscriptView {
49
49
  theme;
50
50
  markdown;
51
51
  options;
52
- rows;
53
- /**
54
- * Fold choices the reader made by clicking, per message.
55
- *
56
- * Absent means the key or the tool's own policy decides, so a settings edit
57
- * stays in charge of messages nobody clicked. Keyed by the call or thought id
58
- * rather than by the entry, because a result replaces the entry a click was
59
- * made on and a thought outlives the live row that streamed it.
60
- */
52
+ document;
61
53
  clicked = new Map();
62
- /** The rows each clickable message drew last render, for mapping a click back to it. */
63
- spans = [];
64
- /** The same spans relative to their entry, so a cached entry still answers clicks. */
65
- entrySpans = new WeakMap();
66
- /**
67
- * The framed rows each entry drew last render, for reading a copy back out.
68
- *
69
- * Relative to the entry for the same reason the spans are: a cached entry draws
70
- * no rows this frame and still has to answer for what it drew before.
71
- */
72
- entryCopy = new WeakMap();
73
- /**
74
- * The framed rows the in-flight entries drew this frame.
75
- *
76
- * They cannot be kept by entry the way the settled ones are: every frame builds
77
- * a live entry as a fresh object, so a map keyed by it would never answer. A copy
78
- * is read against the last frame, so it is the render that keeps them.
79
- */
80
- liveCopy = [];
54
+ presentationRevision = 0;
81
55
  cards;
82
56
  messages;
83
57
  gates;
84
- /** The row renderers, each told only what it draws, so the view stays the one owner of view state and row caches. */
58
+ /** Presentation policy stays here; the document retains rows with their hit and copy metadata. */
85
59
  constructor(model, theme, markdown, options = {}) {
86
60
  this.model = model;
87
61
  this.theme = theme;
@@ -90,7 +64,12 @@ export class TranscriptView {
90
64
  this.cards = new ToolCards({ theme: this.theme, keymap: () => this.keymap(), toolDisplay: tool => this.toolDisplay(tool), expansionOf: entry => this.expansionOf(entry), subCallsOpen: entry => this.subCallsOpen(entry), liveCall: callId => this.model.liveCall(callId), cardOpenHint: () => hintKeys(this.keymap(), 'surface.toolDetail') || CARD_OPEN_FALLBACK, toolKey: id => toolClickKey(id), subCallsKey: id => nestedCallsClickKey(id), subCallKey: (parentId, id) => subCallClickKey(parentId, id), subCallOpen: (parentId, id) => this.subCallOpen(parentId, id) });
91
65
  this.messages = new Messages({ theme: this.theme, markdown: this.markdown, reasoningOpen: entry => this.reasoningOpen(entry), reasoningFoldHint: () => this.reasoningFoldHint(), reasoningKey: id => reasoningClickKey(id), spacing: () => this.air(), pushWrapped: (lines, text, width, prefix, token) => this.pushWrapped(lines, text, width, prefix, token) });
92
66
  this.gates = new GateCards({ theme: this.theme, pushWrapped: (lines, text, width, prefix, token) => this.pushWrapped(lines, text, width, prefix, token) });
93
- this.rows = new RowCache();
67
+ this.document = new TranscriptDocument({
68
+ model,
69
+ entryTag: (entry, base) => this.entryTag(entry, base),
70
+ clocked: entry => this.isLive(entry) || (entry.kind === 'reasoning' && entry.live),
71
+ renderEntry: (entry, lines, width, live, spans, copy) => this.renderEntry(entry, lines, width, live, spans, copy),
72
+ });
94
73
  }
95
74
  get viewState() {
96
75
  return this.options.state?.() ?? DEFAULT_VIEW_STATE;
@@ -104,12 +83,12 @@ export class TranscriptView {
104
83
  return this.options.spacing?.() ?? DEFAULT_SPACING;
105
84
  }
106
85
  /**
107
- * Whether one tool message draws open.
108
- *
109
- * A click outranks the key, which outranks the tool's start state: Ctrl+O
110
- * stays "show me everything", while one clicked message keeps the state the
111
- * reader gave it.
112
- */
86
+ * Whether one tool message draws open.
87
+ *
88
+ * A click outranks the key, which outranks the tool's start state: Ctrl+O
89
+ * stays "show me everything", while one clicked message keeps the state the
90
+ * reader gave it.
91
+ */
113
92
  expansionOf(entry) {
114
93
  const key = toolClickKey(entry.id);
115
94
  const clicked = key === undefined ? undefined : this.clicked.get(key);
@@ -147,19 +126,19 @@ export class TranscriptView {
147
126
  return clicked ?? this.viewState.expandSubCalls;
148
127
  }
149
128
  /**
150
- * Answer a click on a message by folding or unfolding that one row.
151
- *
152
- * The tightest span under the point wins, so a click on a dispatched call
153
- * opens that call rather than the card around it. Only a left click is
154
- * consumed: a press, a drag, and a wheel belong to the surface's own
155
- * selection and scrolling, and a row that swallowed them would cost the
156
- * reader the ability to copy the command it just drew.
157
- */
129
+ * Answer a click on a message by folding or unfolding that one row.
130
+ *
131
+ * The tightest span under the point wins, so a click on a dispatched call
132
+ * opens that call rather than the card around it. Only a left click is
133
+ * consumed: a press, a drag, and a wheel belong to the surface's own
134
+ * selection and scrolling, and a row that swallowed them would cost the
135
+ * reader the ability to copy the command it just drew.
136
+ */
158
137
  handleMouse(event) {
159
138
  if (event.type !== 'click' || event.button !== 'left')
160
139
  return undefined;
161
140
  let span;
162
- for (const candidate of this.spans) {
141
+ for (const candidate of this.document.spans) {
163
142
  if (event.y < candidate.start || event.y >= candidate.end)
164
143
  continue;
165
144
  if (span === undefined || candidate.end - candidate.start < span.end - span.start)
@@ -167,6 +146,7 @@ export class TranscriptView {
167
146
  }
168
147
  if (span === undefined)
169
148
  return undefined;
149
+ this.presentationRevision++;
170
150
  // One click on a program's header opens the one level under it: the calls the
171
151
  // program dispatched, each still the single row it is read at. The program's
172
152
  // own body is the level below that, and it stays folded here because a click
@@ -182,16 +162,16 @@ export class TranscriptView {
182
162
  invalidate() {
183
163
  // The rows are keyed by width and expansion state, so a real change misses
184
164
  // anyway; an explicit invalidate means the caller wants them rebuilt.
185
- this.rows.clear();
165
+ this.document.invalidate();
186
166
  }
187
167
  /**
188
- * Wrap one text block under a prefix, keeping the prefix's column budget.
189
- *
190
- * The block is drawn before it is wrapped: a sequence a terminal would have
191
- * acted on has to be gone before pi-tui measures the row, and a tab has to
192
- * land on the stop the writer saw rather than one a wrapper would guess at.
193
- * The prefix seeds that stop, because it is already on the row.
194
- */
168
+ * Wrap one text block under a prefix, keeping the prefix's column budget.
169
+ *
170
+ * The block is drawn before it is wrapped: a sequence a terminal would have
171
+ * acted on has to be gone before pi-tui measures the row, and a tab has to
172
+ * land on the stop the writer saw rather than one a wrapper would guess at.
173
+ * The prefix seeds that stop, because it is already on the row.
174
+ */
195
175
  pushWrapped(lines, text, width, prefix, token) {
196
176
  const lead = visibleWidth(prefix);
197
177
  const indent = ' '.repeat(lead);
@@ -208,12 +188,12 @@ export class TranscriptView {
208
188
  return hintKeys(this.keymap(), 'surface.reasoning') || REASONING_FOLD_FALLBACK;
209
189
  }
210
190
  /**
211
- * Whether any part of one card is still in flight.
212
- *
213
- * Only a card with work outstanding has a clock attached to its cache, so the
214
- * moment the last call settles the row stops being rebuilt: a program that
215
- * came back must not keep spending the cache its result is now stored in.
216
- */
191
+ * Whether any part of one card is still in flight.
192
+ *
193
+ * Only a card with work outstanding has a clock attached to its cache, so the
194
+ * moment the last call settles the row stops being rebuilt: a program that
195
+ * came back must not keep spending the cache its result is now stored in.
196
+ */
217
197
  isLive(entry) {
218
198
  if (entry.kind !== 'tool')
219
199
  return false;
@@ -248,8 +228,8 @@ export class TranscriptView {
248
228
  lines.push(...gapRows(this.air().steps));
249
229
  return;
250
230
  case 'assistant':
251
- // The reply is boxed the way the prompt that asked for it is, so one
252
- // exchange reads as two objects rather than as a box and then a stream.
231
+ // Matching rails keep both halves of an exchange visually related
232
+ // without enclosing the reader's words or the agent's reply.
253
233
  this.messages.pushFramed(lines, copy, entry.text, width, live, ANSWER_FACE, 'transcript.assistant.border');
254
234
  return;
255
235
  case 'user': {
@@ -271,105 +251,48 @@ export class TranscriptView {
271
251
  return;
272
252
  }
273
253
  }
254
+ /** Entry folds remain local so a click does not spend every settled row's cache. */
255
+ entryTag(entry, base) {
256
+ const open = entry.kind === 'tool' ? this.expansionOf(entry) : entry.kind === 'reasoning' ? this.reasoningOpen(entry) : undefined;
257
+ const shape = entry.kind === 'tool' && this.subCallsOpen(entry) ? 'P' : 'p';
258
+ const marks = entry.kind === 'tool'
259
+ ? `${open === true ? '+' : '-'}${shape}${(entry.card.subCalls ?? []).map(call => (this.subCallOpen(entry.id, call.id) ? '1' : '0')).join('')}`
260
+ : open === true ? '+' : '-';
261
+ const clock = this.isLive(entry) ? `|${Math.floor(this.model.now() / SECOND_MS)}` : '';
262
+ return `${base}|${marks}${clock}`;
263
+ }
274
264
  render(width) {
275
265
  if (width <= 0)
276
266
  return [];
277
267
  const state = this.viewState;
278
- // The revision is part of the key: rows drawn under an older theme table
279
- // must miss, or a settings change would restyle only the rows that happened
280
- // to be redrawn for another reason.
281
- // The air the reader asked for is part of the key for the same reason: the rows
282
- // an entry holds are its own air plus its own body.
283
268
  const gaps = this.air();
284
- const baseTag = `${width}|${state.expandCards ? 'c' : '-'}${state.expandReasoning ? 'r' : '-'}${state.expandSubCalls ? 'p' : '-'}|${this.theme.revision}|${gaps.messages}${gaps.steps}`;
285
- const lines = [];
286
- const spans = [];
287
- const liveCopy = [];
288
- const settled = this.model.settledCount();
289
- const entries = this.model.entries();
290
- for (const [index, entry] of entries.entries()) {
291
- const start = lines.length;
292
- // Every fold this entry can answer to is part of the tag, so clicking one
293
- // message — or one call inside it — rebuilds that message alone while the
294
- // rows around it stay cached.
295
- const open = entry.kind === 'tool' ? this.expansionOf(entry) : entry.kind === 'reasoning' ? this.reasoningOpen(entry) : undefined;
296
- // Whether a program's calls are drawn is part of the key, because it moves
297
- // rows the card's own fold does not: the calls come and go under a header
298
- // that stays where it is, and a cached entry would keep answering with what
299
- // the reader had already clicked away from.
300
- const shape = entry.kind === 'tool' && this.subCallsOpen(entry) ? 'P' : 'p';
301
- const marks = entry.kind === 'tool'
302
- ? `${open === true ? '+' : '-'}${shape}${(entry.card.subCalls ?? []).map(call => (this.subCallOpen(entry.id, call.id) ? '1' : '0')).join('')}`
303
- : open === true ? '+' : '-';
304
- // A running row is drawn from a clock the rest of the row is not, so its
305
- // cache is spent every second: the entries after it stay put, and a card
306
- // waiting out a two-minute run keeps saying so instead of freezing at the
307
- // first second it was drawn.
308
- const tag = `${baseTag}|${marks}${this.isLive(entry) ? `|${Math.floor(this.model.now() / SECOND_MS)}` : ''}`;
309
- const local = [];
310
- const copy = [];
311
- const rows = [];
312
- // The in-flight rows change on every frame, so caching them would only
313
- // fill the cache with objects nobody will ask for again.
314
- if (index >= settled) {
315
- this.renderEntry(entry, rows, width, true, local, copy);
316
- // A row still arriving is drawn every frame, so it is never cached: its
317
- // copy account goes to the frame rather than to an entry nobody can name.
318
- liveCopy.push(...copy);
319
- }
320
- else {
321
- const cached = this.rows.lookup(entry, tag);
322
- const saved = this.entrySpans.get(entry);
323
- const savedCopy = this.entryCopy.get(entry);
324
- if (cached !== undefined && saved !== undefined && savedCopy !== undefined) {
325
- rows.push(...cached);
326
- local.push(...saved);
327
- }
328
- else {
329
- this.renderEntry(entry, rows, width, false, local, copy);
330
- this.rows.store(entry, tag, rows);
331
- this.entrySpans.set(entry, local);
332
- this.entryCopy.set(entry, copy);
333
- }
334
- }
335
- // The entry goes in through the seam rather than straight onto the rows drawn
336
- // so far: the air it opens with is given up when the row above is already air,
337
- // so a break between two things stays one break however many asked for one.
338
- const base = start - placeGap(lines, rows);
339
- // A span is kept relative to its entry so a cached entry can still hand it
340
- // back, and the row of air a seam dropped moves it with the rows that stayed.
341
- for (const span of local) {
342
- spans.push({ ...span, start: span.start + base, end: span.end + base });
343
- }
344
- }
345
- this.spans = spans;
346
- this.liveCopy = liveCopy;
269
+ const keys = this.keymap();
270
+ // Width, folds, theme, spacing, and key hints can change without a transcript event.
271
+ const base = `${width}|${state.expandCards ? 'c' : '-'}${state.expandReasoning ? 'r' : '-'}${state.expandSubCalls ? 'p' : '-'}|${this.theme.revision}|${gaps.messages}:${gaps.steps}|${hintKeys(keys, 'surface.toolDetail')}|${hintKeys(keys, 'surface.reasoning')}`;
272
+ const retained = this.document.render(width, base, this.presentationRevision);
347
273
  const picker = this.options.picker?.();
274
+ const gate = this.options.gate?.();
275
+ // pi-tui requires string[] but borrows child rows; the native PTY gate protects this pinned boundary.
276
+ if (picker === undefined && gate === undefined)
277
+ return retained;
278
+ // Overlays have independent mutable state and must never enter the retained conversation.
279
+ const lines = [...retained];
348
280
  if (picker !== undefined)
349
281
  this.pushPicker(lines, picker, width);
350
- const gate = this.options.gate?.();
351
282
  if (gate !== undefined)
352
283
  this.gates.pushGate(lines, gate, width);
353
284
  return lines;
354
285
  }
355
286
  /**
356
- * The framed rows the last render drew, in the order the transcript reads.
357
- *
358
- * A copy of a selection is read off the screen, so it carries the frame the
359
- * surface drew around a message — the sides, the padding beside them, and the
360
- * rules above and below. This is the account that lets the surface take its own
361
- * frame back out of a copy without ever touching a character the reader wrote.
362
- */
287
+ * The framed rows the last render drew, in the order the transcript reads.
288
+ *
289
+ * A copy of a selection is read off the screen, so it carries the frame the
290
+ * surface drew around a message — the sides, the padding beside them, and the
291
+ * rules above and below. This is the account that lets the surface take its own
292
+ * frame back out of a copy without ever touching a character the reader wrote.
293
+ */
363
294
  copyRows() {
364
- const rows = [];
365
- for (const entry of this.model.entries()) {
366
- const saved = this.entryCopy.get(entry);
367
- if (saved !== undefined)
368
- rows.push(...saved);
369
- }
370
- // The rows still arriving are not kept by entry, so they come from the frame.
371
- rows.push(...this.liveCopy);
372
- return rows;
295
+ return this.document.copyRows();
373
296
  }
374
297
  }
375
298
  //# sourceMappingURL=view.js.map