@sagmans/dsh-tui 0.6.0 → 0.7.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 (250) hide show
  1. package/.agents/skills/dsh-tui-dogfood/SKILL.md +83 -0
  2. package/.agents/skills/dsh-tui-dogfood/references/home-state.md +78 -0
  3. package/.agents/skills/dsh-tui-dogfood/scripts/clone-links.mjs +133 -0
  4. package/.agents/skills/dsh-tui-dogfood/scripts/run-plugin-from-worktree.sh +417 -0
  5. package/.agents/skills/dsh-tui-update-models/SKILL.md +121 -0
  6. package/.agents/skills/dsh-tui-update-models/references/model-wiring.md +162 -0
  7. package/.agents/skills/dsh-tui-update-models/scripts/dump-model-catalog.mjs +178 -0
  8. package/README.md +99 -5
  9. package/lib/agent/present.d.ts.map +1 -1
  10. package/lib/agent/present.js +2 -1
  11. package/lib/agent/present.js.map +1 -1
  12. package/lib/cards/composition.d.ts +68 -0
  13. package/lib/cards/composition.d.ts.map +1 -0
  14. package/lib/cards/composition.js +117 -0
  15. package/lib/cards/composition.js.map +1 -0
  16. package/lib/cards/presenter.d.ts +23 -0
  17. package/lib/cards/presenter.d.ts.map +1 -0
  18. package/lib/cards/presenter.js +394 -0
  19. package/lib/cards/presenter.js.map +1 -0
  20. package/lib/cards/preview.d.ts +42 -0
  21. package/lib/cards/preview.d.ts.map +1 -0
  22. package/lib/cards/preview.js +51 -0
  23. package/lib/cards/preview.js.map +1 -0
  24. package/lib/cards.d.ts +12 -120
  25. package/lib/cards.d.ts.map +1 -1
  26. package/lib/cards.js +4 -556
  27. package/lib/cards.js.map +1 -1
  28. package/lib/compat/section.d.ts +29 -0
  29. package/lib/compat/section.d.ts.map +1 -0
  30. package/lib/compat/section.js +82 -0
  31. package/lib/compat/section.js.map +1 -0
  32. package/lib/config.d.ts +27 -2
  33. package/lib/config.d.ts.map +1 -1
  34. package/lib/config.js +61 -1
  35. package/lib/config.js.map +1 -1
  36. package/lib/contracts.d.ts +28 -0
  37. package/lib/contracts.d.ts.map +1 -1
  38. package/lib/fold-cursor.d.ts +8 -0
  39. package/lib/fold-cursor.d.ts.map +1 -1
  40. package/lib/fold-cursor.js +18 -0
  41. package/lib/fold-cursor.js.map +1 -1
  42. package/lib/gates/question-card.d.ts +77 -0
  43. package/lib/gates/question-card.d.ts.map +1 -0
  44. package/lib/gates/question-card.js +113 -0
  45. package/lib/gates/question-card.js.map +1 -0
  46. package/lib/gates/questions.d.ts +127 -0
  47. package/lib/gates/questions.d.ts.map +1 -0
  48. package/lib/gates/questions.js +418 -0
  49. package/lib/gates/questions.js.map +1 -0
  50. package/lib/gates.d.ts +1 -113
  51. package/lib/gates.d.ts.map +1 -1
  52. package/lib/gates.js +1 -484
  53. package/lib/gates.js.map +1 -1
  54. package/lib/index.d.ts +1 -0
  55. package/lib/index.d.ts.map +1 -1
  56. package/lib/index.js +343 -2602
  57. package/lib/index.js.map +1 -1
  58. package/lib/input/action-catalog.d.ts +74 -0
  59. package/lib/input/action-catalog.d.ts.map +1 -0
  60. package/lib/input/action-catalog.js +137 -0
  61. package/lib/input/action-catalog.js.map +1 -0
  62. package/lib/input/actions.d.ts +5 -81
  63. package/lib/input/actions.d.ts.map +1 -1
  64. package/lib/input/actions.js +4 -625
  65. package/lib/input/actions.js.map +1 -1
  66. package/lib/input/completion.d.ts +1 -1
  67. package/lib/input/completion.d.ts.map +1 -1
  68. package/lib/input/completion.js +2 -1
  69. package/lib/input/completion.js.map +1 -1
  70. package/lib/input/file-index.d.ts +40 -0
  71. package/lib/input/file-index.d.ts.map +1 -0
  72. package/lib/input/file-index.js +141 -0
  73. package/lib/input/file-index.js.map +1 -0
  74. package/lib/input/file-search.d.ts +1 -38
  75. package/lib/input/file-search.d.ts.map +1 -1
  76. package/lib/input/file-search.js +1 -487
  77. package/lib/input/file-search.js.map +1 -1
  78. package/lib/input/key-press.d.ts +57 -0
  79. package/lib/input/key-press.d.ts.map +1 -0
  80. package/lib/input/key-press.js +218 -0
  81. package/lib/input/key-press.js.map +1 -0
  82. package/lib/input/keymap-conflicts.d.ts +59 -0
  83. package/lib/input/keymap-conflicts.d.ts.map +1 -0
  84. package/lib/input/keymap-conflicts.js +292 -0
  85. package/lib/input/keymap-conflicts.js.map +1 -0
  86. package/lib/input/keymap-settings.js +1 -1
  87. package/lib/input/keymap-settings.js.map +1 -1
  88. package/lib/input/keymap.d.ts.map +1 -1
  89. package/lib/input/keymap.js +3 -1
  90. package/lib/input/keymap.js.map +1 -1
  91. package/lib/input/workspace-files.d.ts +10 -0
  92. package/lib/input/workspace-files.d.ts.map +1 -0
  93. package/lib/input/workspace-files.js +359 -0
  94. package/lib/input/workspace-files.js.map +1 -0
  95. package/lib/install-skills.d.ts +20 -0
  96. package/lib/install-skills.d.ts.map +1 -0
  97. package/lib/install-skills.js +198 -0
  98. package/lib/install-skills.js.map +1 -0
  99. package/lib/keys-command.d.ts +2 -1
  100. package/lib/keys-command.d.ts.map +1 -1
  101. package/lib/keys-command.js +2 -1
  102. package/lib/keys-command.js.map +1 -1
  103. package/lib/model-list.d.ts +37 -0
  104. package/lib/model-list.d.ts.map +1 -0
  105. package/lib/model-list.js +60 -0
  106. package/lib/model-list.js.map +1 -0
  107. package/lib/startup.d.ts +8 -0
  108. package/lib/startup.d.ts.map +1 -1
  109. package/lib/startup.js +120 -24
  110. package/lib/startup.js.map +1 -1
  111. package/lib/subagents.d.ts +7 -3
  112. package/lib/subagents.d.ts.map +1 -1
  113. package/lib/subagents.js +28 -4
  114. package/lib/subagents.js.map +1 -1
  115. package/lib/surface/appearance-preferences.d.ts +26 -0
  116. package/lib/surface/appearance-preferences.d.ts.map +1 -0
  117. package/lib/surface/appearance-preferences.js +139 -0
  118. package/lib/surface/appearance-preferences.js.map +1 -0
  119. package/lib/surface/appearance.d.ts +87 -0
  120. package/lib/surface/appearance.d.ts.map +1 -0
  121. package/lib/surface/appearance.js +353 -0
  122. package/lib/surface/appearance.js.map +1 -0
  123. package/lib/surface/background-work.d.ts +49 -0
  124. package/lib/surface/background-work.d.ts.map +1 -0
  125. package/lib/surface/background-work.js +146 -0
  126. package/lib/surface/background-work.js.map +1 -0
  127. package/lib/surface/commands.d.ts +80 -0
  128. package/lib/surface/commands.d.ts.map +1 -0
  129. package/lib/surface/commands.js +364 -0
  130. package/lib/surface/commands.js.map +1 -0
  131. package/lib/surface/modal-input.d.ts +58 -0
  132. package/lib/surface/modal-input.d.ts.map +1 -0
  133. package/lib/surface/modal-input.js +237 -0
  134. package/lib/surface/modal-input.js.map +1 -0
  135. package/lib/surface/model-choice.d.ts +54 -0
  136. package/lib/surface/model-choice.d.ts.map +1 -0
  137. package/lib/surface/model-choice.js +325 -0
  138. package/lib/surface/model-choice.js.map +1 -0
  139. package/lib/surface/preset-choice.d.ts +78 -0
  140. package/lib/surface/preset-choice.d.ts.map +1 -0
  141. package/lib/surface/preset-choice.js +163 -0
  142. package/lib/surface/preset-choice.js.map +1 -0
  143. package/lib/surface/prompt-input.d.ts +97 -0
  144. package/lib/surface/prompt-input.d.ts.map +1 -0
  145. package/lib/surface/prompt-input.js +215 -0
  146. package/lib/surface/prompt-input.js.map +1 -0
  147. package/lib/surface/prompt-memory.d.ts +76 -0
  148. package/lib/surface/prompt-memory.d.ts.map +1 -0
  149. package/lib/surface/prompt-memory.js +167 -0
  150. package/lib/surface/prompt-memory.js.map +1 -0
  151. package/lib/surface/session-lifecycle.d.ts +120 -0
  152. package/lib/surface/session-lifecycle.d.ts.map +1 -0
  153. package/lib/surface/session-lifecycle.js +321 -0
  154. package/lib/surface/session-lifecycle.js.map +1 -0
  155. package/lib/surface/session-picker.d.ts +39 -0
  156. package/lib/surface/session-picker.d.ts.map +1 -0
  157. package/lib/surface/session-picker.js +107 -0
  158. package/lib/surface/session-picker.js.map +1 -0
  159. package/lib/surface/session-view.d.ts +86 -0
  160. package/lib/surface/session-view.d.ts.map +1 -0
  161. package/lib/surface/session-view.js +215 -0
  162. package/lib/surface/session-view.js.map +1 -0
  163. package/lib/surface/staged-turns.d.ts +81 -0
  164. package/lib/surface/staged-turns.d.ts.map +1 -0
  165. package/lib/surface/staged-turns.js +206 -0
  166. package/lib/surface/staged-turns.js.map +1 -0
  167. package/lib/surface/terminal-lifecycle.d.ts +76 -0
  168. package/lib/surface/terminal-lifecycle.d.ts.map +1 -0
  169. package/lib/surface/terminal-lifecycle.js +222 -0
  170. package/lib/surface/terminal-lifecycle.js.map +1 -0
  171. package/lib/terminal-text/scan.d.ts +44 -0
  172. package/lib/terminal-text/scan.d.ts.map +1 -0
  173. package/lib/terminal-text/scan.js +195 -0
  174. package/lib/terminal-text/scan.js.map +1 -0
  175. package/lib/terminal-text/sgr.d.ts +32 -0
  176. package/lib/terminal-text/sgr.d.ts.map +1 -0
  177. package/lib/terminal-text/sgr.js +203 -0
  178. package/lib/terminal-text/sgr.js.map +1 -0
  179. package/lib/terminal-text.d.ts +1 -1
  180. package/lib/terminal-text.d.ts.map +1 -1
  181. package/lib/terminal-text.js +2 -379
  182. package/lib/terminal-text.js.map +1 -1
  183. package/lib/theme-command.js +2 -1
  184. package/lib/theme-command.js.map +1 -1
  185. package/lib/theme-defaults.d.ts +64 -0
  186. package/lib/theme-defaults.d.ts.map +1 -0
  187. package/lib/theme-defaults.js +248 -0
  188. package/lib/theme-defaults.js.map +1 -0
  189. package/lib/theme-resolver.d.ts +36 -0
  190. package/lib/theme-resolver.d.ts.map +1 -0
  191. package/lib/theme-resolver.js +112 -0
  192. package/lib/theme-resolver.js.map +1 -0
  193. package/lib/theme-schema.d.ts.map +1 -1
  194. package/lib/theme-schema.js +3 -2
  195. package/lib/theme-schema.js.map +1 -1
  196. package/lib/theme-settings.d.ts +5 -7
  197. package/lib/theme-settings.d.ts.map +1 -1
  198. package/lib/theme-settings.js +27 -19
  199. package/lib/theme-settings.js.map +1 -1
  200. package/lib/theme-tokens.d.ts +0 -89
  201. package/lib/theme-tokens.d.ts.map +1 -1
  202. package/lib/theme-tokens.js +0 -356
  203. package/lib/theme-tokens.js.map +1 -1
  204. package/lib/theme.d.ts +1 -1
  205. package/lib/theme.d.ts.map +1 -1
  206. package/lib/theme.js +2 -1
  207. package/lib/theme.js.map +1 -1
  208. package/lib/tool-display.d.ts.map +1 -1
  209. package/lib/tool-display.js +2 -1
  210. package/lib/tool-display.js.map +1 -1
  211. package/lib/transcript/message-content.d.ts +21 -0
  212. package/lib/transcript/message-content.d.ts.map +1 -0
  213. package/lib/transcript/message-content.js +61 -0
  214. package/lib/transcript/message-content.js.map +1 -0
  215. package/lib/transcript/tool-calls.d.ts +106 -0
  216. package/lib/transcript/tool-calls.d.ts.map +1 -0
  217. package/lib/transcript/tool-calls.js +254 -0
  218. package/lib/transcript/tool-calls.js.map +1 -0
  219. package/lib/transcript.d.ts +14 -55
  220. package/lib/transcript.d.ts.map +1 -1
  221. package/lib/transcript.js +31 -253
  222. package/lib/transcript.js.map +1 -1
  223. package/lib/ui/dock.d.ts +14 -2
  224. package/lib/ui/dock.d.ts.map +1 -1
  225. package/lib/ui/dock.js +52 -10
  226. package/lib/ui/dock.js.map +1 -1
  227. package/lib/ui/editor.d.ts.map +1 -1
  228. package/lib/ui/editor.js +2 -1
  229. package/lib/ui/editor.js.map +1 -1
  230. package/lib/ui/keymap-picker.d.ts +2 -1
  231. package/lib/ui/keymap-picker.d.ts.map +1 -1
  232. package/lib/ui/keymap-picker.js +1 -0
  233. package/lib/ui/keymap-picker.js.map +1 -1
  234. package/lib/ui/view/gate-card.d.ts +21 -0
  235. package/lib/ui/view/gate-card.d.ts.map +1 -0
  236. package/lib/ui/view/gate-card.js +104 -0
  237. package/lib/ui/view/gate-card.js.map +1 -0
  238. package/lib/ui/view/tool-card.d.ts +138 -0
  239. package/lib/ui/view/tool-card.d.ts.map +1 -0
  240. package/lib/ui/view/tool-card.js +413 -0
  241. package/lib/ui/view/tool-card.js.map +1 -0
  242. package/lib/ui/view/transcript-message.d.ts +62 -0
  243. package/lib/ui/view/transcript-message.d.ts.map +1 -0
  244. package/lib/ui/view/transcript-message.js +158 -0
  245. package/lib/ui/view/transcript-message.js.map +1 -0
  246. package/lib/ui/view.d.ts +80 -220
  247. package/lib/ui/view.d.ts.map +1 -1
  248. package/lib/ui/view.js +81 -675
  249. package/lib/ui/view.js.map +1 -1
  250. package/package.json +3 -1
@@ -0,0 +1,158 @@
1
+ /**
2
+ * How one non-tool message draws: user and assistant text, a folded thought, and
3
+ * the notices and markers a session records between them.
4
+ *
5
+ * These rows share the recessive markdown theme and the framed-copy bookkeeping
6
+ * the view reads back, so they belong together rather than beside the row cache
7
+ * that only decides which of them to rebuild.
8
+ */
9
+ import { visibleWidth } from '@earendil-works/pi-tui';
10
+ import {} from "../../transcript.js";
11
+ import {} from "../../theme-tokens.js";
12
+ import {} from "../../theme.js";
13
+ import { codeBlockLines } from "../diff.js";
14
+ import { canFrame, frameBlock, FRAME_COLUMNS, textWidth } from "../frame.js";
15
+ import { ANSWER_FACE } from "../markdown.js";
16
+ import {} from "../view.js";
17
+ const DETAIL_INDENT = ' ';
18
+ /**
19
+ * A markdown theme that keeps every element in one token.
20
+ *
21
+ * A thought is deliberately recessive, and the answer's theme would let a
22
+ * heading or a link inside it outshine the answer it produced. The structure
23
+ * still shows because markdown draws it around the text — bullets, fences,
24
+ * indents, table rules — rather than in the text's own colour. A fenced diff is
25
+ * the one block that does not recede: red and green are what the fence means
26
+ * rather than how loudly it is drawn, and a thought showing a change is the
27
+ * place the reader most needs to see which side of it moved.
28
+ */
29
+ function recessiveMarkdownTheme(style, theme) {
30
+ return {
31
+ heading: style,
32
+ link: style,
33
+ linkUrl: style,
34
+ code: style,
35
+ codeBlock: style,
36
+ codeBlockBorder: style,
37
+ quote: style,
38
+ quoteBorder: style,
39
+ hr: style,
40
+ listBullet: style,
41
+ bold: style,
42
+ italic: style,
43
+ strikethrough: style,
44
+ underline: style,
45
+ highlightCode: (code, lang) => codeBlockLines(code, lang, {
46
+ style: (token, text) => theme.style(token, text),
47
+ visible: token => theme.visible(token),
48
+ plain: style,
49
+ }),
50
+ };
51
+ }
52
+ export class Messages {
53
+ context;
54
+ constructor(context) {
55
+ this.context = context;
56
+ }
57
+ /**
58
+ * The rows one markdown message draws, with the padding pi-tui adds for background styling removed.
59
+ *
60
+ * The source is drawn first so the markdown renderer never measures a sequence
61
+ * it cannot see; its own spans are applied around the result afterwards.
62
+ */
63
+ markdownLines(text, width, live, face, column = 0) {
64
+ return this.context.markdown
65
+ .render(this.context.theme.rich(text, { column }), Math.max(1, width), live, face)
66
+ .map(line => line.replace(/[ \t]+$/u, ''));
67
+ }
68
+ /**
69
+ * Render one message's text as markdown.
70
+ *
71
+ * A thought passes its own face and an indent, so the row stays visibly a
72
+ * detail of the step that produced it rather than a second answer.
73
+ */
74
+ pushMarkdown(lines, text, width, live, face = ANSWER_FACE, indent = '') {
75
+ const lead = visibleWidth(indent);
76
+ for (const line of this.markdownLines(text, Math.max(1, width - lead), live, face, lead)) {
77
+ // A blank markdown line stays blank: it shows nothing, so it holds nothing.
78
+ if (line === '') {
79
+ lines.push('');
80
+ continue;
81
+ }
82
+ lines.push(this.context.theme.cut(`${indent}${line}`, width, '…'));
83
+ }
84
+ }
85
+ /**
86
+ * One message closed into a frame, with its markdown laid out to what is left inside.
87
+ *
88
+ * A prompt and a reply are the two objects of an exchange, so both are drawn as
89
+ * bars rather than as one more stretch of rows; the face, the border's element,
90
+ * and whether the text is still arriving are the only differences. Markdown lays
91
+ * itself out to the frame's text width, so the frame may only place the rows:
92
+ * wrapping them again would break what it drew. The rows are recorded as they
93
+ * are drawn, because a copy of this message will carry the frame with it and
94
+ * only the drawing knows which columns of a row are the frame's.
95
+ */
96
+ pushFramed(lines, copy, text, width, live, face, borderToken) {
97
+ const framed = canFrame(width, this.context.theme.visible(borderToken));
98
+ const inside = framed ? width - FRAME_COLUMNS : width;
99
+ const body = this.markdownLines(text, textWidth(inside), live, face);
100
+ const block = frameBlock(body, width, {
101
+ text: line => line,
102
+ border: rule => this.context.theme.style(borderToken, rule),
103
+ framed,
104
+ });
105
+ lines.push(...block.drawn);
106
+ copy.push(...block.copy);
107
+ }
108
+ /**
109
+ * The face a thought is drawn in.
110
+ *
111
+ * Its shade stays the thought body's and it asks for no drawing: a diagram in
112
+ * the middle of a thought would carry the answer's weight, and the answer's
113
+ * colours would make the thinking compete with it.
114
+ */
115
+ reasoningFace() {
116
+ const body = (text) => this.context.theme.style('transcript.reasoning.body', text);
117
+ return { name: 'reasoning', base: { color: body }, theme: recessiveMarkdownTheme(body, this.context.theme), transform: false };
118
+ }
119
+ /** The face a submitted prompt is drawn in: its structure is markdown's, its shade stays the prompt's. */
120
+ userFace() {
121
+ return { name: 'user', base: { color: text => this.context.theme.style('transcript.user', text) } };
122
+ }
123
+ pushReasoning(lines, entry, width, spans) {
124
+ if (!this.context.theme.visible('transcript.reasoning.summary'))
125
+ return;
126
+ const start = lines.length;
127
+ const open = this.context.reasoningOpen(entry);
128
+ const glyph = this.context.theme.glyph('transcript.reasoning.summary');
129
+ const lead = glyph === '' ? '' : `${glyph} `;
130
+ // A folded row carries the key that opens it, because a count with no way to
131
+ // reach the text reads the same as the text never having arrived. The key
132
+ // rides the row rather than a line of its own, so naming the hidden body
133
+ // costs no vertical space.
134
+ const suffix = !open && entry.body !== '' && this.context.theme.visible('transcript.reasoning.hint')
135
+ ? ` (${this.context.reasoningFoldHint()})`
136
+ : '';
137
+ // The key is kept whole: the summary is the part that gives up room.
138
+ const room = Math.max(1, width - visibleWidth(suffix));
139
+ const summary = this.context.theme.cut(this.context.theme.rich(`${lead}${entry.summary}`, { token: 'transcript.reasoning.summary', column: visibleWidth(lead) }), room, '');
140
+ const lined = suffix === '' ? summary : `${summary}${this.context.theme.style('transcript.reasoning.hint', suffix)}`;
141
+ // The key is kept whole only while the row has room for it: a row wider than
142
+ // the surface loses its tail to the terminal, and the terminal's clamp is not
143
+ // one this component can count on.
144
+ lines.push(this.context.theme.cut(lined, width, '…'));
145
+ if (open && this.context.theme.visible('transcript.reasoning.body')) {
146
+ this.pushMarkdown(lines, entry.body, width, entry.live, this.reasoningFace(), DETAIL_INDENT);
147
+ }
148
+ const key = this.context.reasoningKey(entry.id);
149
+ if (key !== undefined)
150
+ spans.push({ key, start, end: lines.length, expanded: open });
151
+ }
152
+ /** The mark and the space that introduce an element, empty when it has none. */
153
+ elementLead(token) {
154
+ const glyph = this.context.theme.visible(token) ? this.context.theme.glyph(token) : '';
155
+ return glyph === '' ? '' : `${glyph} `;
156
+ }
157
+ }
158
+ //# sourceMappingURL=transcript-message.js.map
@@ -0,0 +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,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,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,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,KAAK;QACp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,IAAI,GAAG,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACtF,CAAC;IACH,gFAAgF;IAC9E,WAAW,CAAC,KAAe;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QACtF,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAA;IACxC,CAAC;CACJ"}
package/lib/ui/view.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { type Component, type TuiMouseEvent, type TuiMouseEventResult } from '@earendil-works/pi-tui';
2
- import { type Keymap } from '../input/actions.ts';
3
- import { type GateCard } from '../gates.ts';
4
- import { type TranscriptEntry, type TranscriptModel } from '../transcript.ts';
5
- import { type ToolDisplaySpec } from '../tool-display.ts';
6
- import type { TuiTheme } from '../theme.ts';
7
- import { type FrameRow } from './frame.ts';
8
- import { type MarkdownRenderer } from './markdown.ts';
9
- import type { PickerCard } from './picker.ts';
10
1
  import { RowCache, type RowCacheStats } from './rows.ts';
2
+ import { type PickerCard } from './picker.ts';
3
+ import { type MarkdownRenderer } from './markdown.ts';
4
+ import { type FrameRow } from './frame.ts';
5
+ import { type TuiTheme } from '../theme.ts';
6
+ import { type ToolDisplaySpec } from '../tool-display.ts';
7
+ import { type TranscriptEntry, type TranscriptModel } from '../transcript.ts';
8
+ import { type GateCard } from '../gates.ts';
9
+ import { type Keymap } from '../input/actions.ts';
10
+ import { type Component, type TuiMouseEvent, type TuiMouseEventResult } from '@earendil-works/pi-tui';
11
11
  /** Which rows the reader has opened by key; a click decides for one message instead. */
12
12
  export interface ViewState {
13
13
  readonly expandCards: boolean;
@@ -24,6 +24,21 @@ export interface ViewState {
24
24
  * a program's calls, whose one line per dispatch is what the card stands for.
25
25
  */
26
26
  export declare const DEFAULT_VIEW_STATE: ViewState;
27
+ /**
28
+ * Where one clickable message drew, so a click can find what it landed on.
29
+ *
30
+ * A card's rows cover the calls it dispatched, so the card and each of those
31
+ * calls have a span; the click takes the tightest one it falls in.
32
+ */
33
+ export interface ClickSpan {
34
+ /** Stable across redraws, so a click outlives the entry it was made on. */
35
+ readonly key: string;
36
+ readonly start: number;
37
+ /** Exclusive: the row after the message's last. */
38
+ readonly end: number;
39
+ /** Whether the message was open when those rows were drawn. */
40
+ readonly expanded: boolean;
41
+ }
27
42
  /**
28
43
  * Renders the transcript rows and any pending gate as terminal lines.
29
44
  *
@@ -62,253 +77,98 @@ export declare class TranscriptView implements Component {
62
77
  private readonly options;
63
78
  private readonly rows;
64
79
  /**
65
- * Fold choices the reader made by clicking, per message.
66
- *
67
- * Absent means the key or the tool's own policy decides, so a settings edit
68
- * stays in charge of messages nobody clicked. Keyed by the call or thought id
69
- * rather than by the entry, because a result replaces the entry a click was
70
- * made on and a thought outlives the live row that streamed it.
71
- */
80
+ * Fold choices the reader made by clicking, per message.
81
+ *
82
+ * Absent means the key or the tool's own policy decides, so a settings edit
83
+ * stays in charge of messages nobody clicked. Keyed by the call or thought id
84
+ * rather than by the entry, because a result replaces the entry a click was
85
+ * made on and a thought outlives the live row that streamed it.
86
+ */
72
87
  private readonly clicked;
73
88
  /** The rows each clickable message drew last render, for mapping a click back to it. */
74
89
  private spans;
75
90
  /** The same spans relative to their entry, so a cached entry still answers clicks. */
76
91
  private readonly entrySpans;
77
92
  /**
78
- * The framed rows each entry drew last render, for reading a copy back out.
79
- *
80
- * Relative to the entry for the same reason the spans are: a cached entry draws
81
- * no rows this frame and still has to answer for what it drew before.
82
- */
93
+ * The framed rows each entry drew last render, for reading a copy back out.
94
+ *
95
+ * Relative to the entry for the same reason the spans are: a cached entry draws
96
+ * no rows this frame and still has to answer for what it drew before.
97
+ */
83
98
  private readonly entryCopy;
84
99
  /**
85
- * The framed rows the in-flight entries drew this frame.
86
- *
87
- * They cannot be kept by entry the way the settled ones are: every frame builds
88
- * a live entry as a fresh object, so a map keyed by it would never answer. A copy
89
- * is read against the last frame, so it is the render that keeps them.
90
- */
100
+ * The framed rows the in-flight entries drew this frame.
101
+ *
102
+ * They cannot be kept by entry the way the settled ones are: every frame builds
103
+ * a live entry as a fresh object, so a map keyed by it would never answer. A copy
104
+ * is read against the last frame, so it is the render that keeps them.
105
+ */
91
106
  private liveCopy;
107
+ private readonly cards;
108
+ private readonly messages;
109
+ private readonly gates;
110
+ /** The row renderers, each told only what it draws, so the view stays the one owner of view state and row caches. */
92
111
  constructor(model: TranscriptModel, theme: TuiTheme, markdown: MarkdownRenderer, options?: TranscriptViewOptions);
93
112
  private get viewState();
94
113
  /** The display the reader configured for a tool, or the shipped one. */
95
114
  private toolDisplay;
96
115
  /**
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
- */
116
+ * Whether one tool message draws open.
117
+ *
118
+ * A click outranks the key, which outranks the tool's start state: Ctrl+O
119
+ * stays "show me everything", while one clicked message keeps the state the
120
+ * reader gave it.
121
+ */
103
122
  private expansionOf;
104
123
  /** Whether one thought draws its body; a click decides for that thought alone. */
105
124
  private reasoningOpen;
106
125
  /** Whether one dispatched call draws its argument in full; a click decides for that call. */
107
126
  private subCallOpen;
108
127
  /**
109
- * Answer a click on a message by folding or unfolding that one row.
110
- *
111
- * The tightest span under the point wins, so a click on a dispatched call
112
- * opens that call rather than the card around it. Only a left click is
113
- * consumed: a press, a drag, and a wheel belong to the surface's own
114
- * selection and scrolling, and a row that swallowed them would cost the
115
- * reader the ability to copy the command it just drew.
116
- */
128
+ * Answer a click on a message by folding or unfolding that one row.
129
+ *
130
+ * The tightest span under the point wins, so a click on a dispatched call
131
+ * opens that call rather than the card around it. Only a left click is
132
+ * consumed: a press, a drag, and a wheel belong to the surface's own
133
+ * selection and scrolling, and a row that swallowed them would cost the
134
+ * reader the ability to copy the command it just drew.
135
+ */
117
136
  handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
118
137
  /** The cache's own account of the work it avoided; a test reads this. */
119
138
  rowStats(): RowCacheStats;
120
139
  invalidate(): void;
121
140
  /**
122
- * Wrap one text block under a prefix, keeping the prefix's column budget.
123
- *
124
- * The block is drawn before it is wrapped: a sequence a terminal would have
125
- * acted on has to be gone before pi-tui measures the row, and a tab has to
126
- * land on the stop the writer saw rather than one a wrapper would guess at.
127
- * The prefix seeds that stop, because it is already on the row.
128
- */
141
+ * Wrap one text block under a prefix, keeping the prefix's column budget.
142
+ *
143
+ * The block is drawn before it is wrapped: a sequence a terminal would have
144
+ * acted on has to be gone before pi-tui measures the row, and a tab has to
145
+ * land on the stop the writer saw rather than one a wrapper would guess at.
146
+ * The prefix seeds that stop, because it is already on the row.
147
+ */
129
148
  private pushWrapped;
130
- /**
131
- * Wrap one already-styled block under a prefix.
132
- *
133
- * A card header mixes tokens — title, argument, stats — in a single string, so
134
- * it cannot go through {@link pushWrapped}, which escapes and restyles plain
135
- * text. Its width still has to fold at the screen edge rather than be cut,
136
- * because the argument is the part a reader scans for and a silently dropped
137
- * command is worse than a taller card.
138
- */
139
- private pushStyledWrapped;
140
- /**
141
- * The rows one markdown message draws, with the padding pi-tui adds for background styling removed.
142
- *
143
- * The source is drawn first so the markdown renderer never measures a sequence
144
- * it cannot see; its own spans are applied around the result afterwards.
145
- */
146
- private markdownLines;
147
- /**
148
- * Render one message's text as markdown.
149
- *
150
- * A thought passes its own face and an indent, so the row stays visibly a
151
- * detail of the step that produced it rather than a second answer.
152
- */
153
- private pushMarkdown;
154
- /**
155
- * One message closed into a frame, with its markdown laid out to what is left inside.
156
- *
157
- * A prompt and a reply are the two objects of an exchange, so both are drawn as
158
- * bars rather than as one more stretch of rows; the face, the border's element,
159
- * and whether the text is still arriving are the only differences. Markdown lays
160
- * itself out to the frame's text width, so the frame may only place the rows:
161
- * wrapping them again would break what it drew. The rows are recorded as they
162
- * are drawn, because a copy of this message will carry the frame with it and
163
- * only the drawing knows which columns of a row are the frame's.
164
- */
165
- private pushFramed;
166
- /**
167
- * The face a thought is drawn in.
168
- *
169
- * Its shade stays the thought body's and it asks for no drawing: a diagram in
170
- * the middle of a thought would carry the answer's weight, and the answer's
171
- * colours would make the thinking compete with it.
172
- */
173
- private reasoningFace;
174
- /** The face a submitted prompt is drawn in: its structure is markdown's, its shade stays the prompt's. */
175
- private userFace;
176
149
  /** The live map, or the shipped one for a caller that did not lend one. */
177
150
  private keymap;
178
151
  private reasoningFoldHint;
179
- private pushReasoning;
180
- private pushCard;
181
- /**
182
- * The calls one card dispatched, one entry each.
183
- *
184
- * A nested call is a signpost rather than a card of its own, so it keeps one
185
- * entry per call, clipped to that entry until the reader clicks it: the
186
- * argument is the part a reader scans for, and one that always wrapped pushed
187
- * the rest of the program off the screen.
188
- */
189
- private pushSubCalls;
190
- /**
191
- * What a dispatched call declared and what it produced, under its argument.
192
- *
193
- * The parent card keeps only the program's return value, so both are otherwise
194
- * gone; a reader who opens the row is asking for them, which is why the call's
195
- * own rows come first and its outcome under them. Each section keeps the
196
- * retention its card used, so a long run still says what it dropped.
197
- */
198
- private pushSubCallOutput;
199
- /**
200
- * A folded card's one row: label, clipped argument, measured facts, outcome.
201
- *
202
- * The outcome rides this row rather than a row of its own, because one line
203
- * per call is what folding promises. A shell card's hidden rows are counted
204
- * here too: its output is the answer the reader asked for, and a fold that
205
- * left no trace of it would read as a call that produced nothing.
206
- *
207
- * The argument is the part that gives up room: it is clipped to whatever the
208
- * label, the facts, and the outcome leave before the edge, so a wide terminal
209
- * shows more of the call while a narrow one still shows how it ended.
210
- */
211
- private renderCollapsedHead;
212
- /**
213
- * One detail row, drawn with its own kind's colours or nothing at all.
214
- *
215
- * The row says what it is, so the renderer never guesses from the text: a diff
216
- * line beginning with "+" is an addition because the presenter said so, not
217
- * because of its first character.
218
- */
219
- private detailRow;
220
- /** The mark that introduces a card, empty when the theme hides its label. */
221
- private cardLead;
222
- /** A card's label, styled, or nothing when the theme hides it. */
223
- private cardTitle;
224
- /** A card's argument, styled and flattened, clipped to `limit` when one is given. */
225
- private cardArgument;
226
- /**
227
- * A card's header: its label, its argument, and its measured facts.
228
- *
229
- * The glyph is returned apart from the body so a wrapped continuation can
230
- * align under the label rather than under the mark. An opened terminal's
231
- * argument is left out because it needs a row of its own — it is the one
232
- * argument that can be a whole command rather than a word.
233
- */
234
- private renderHead;
235
- /**
236
- * The colour a call's name is drawn in, which is the whole of its state.
237
- *
238
- * The name is where a reader looking for a call looks first, so what that call
239
- * is doing belongs in the name rather than in a glyph beside it: one name, in
240
- * the colour of its state, and nothing a reader has to learn to read first.
241
- *
242
- * A state is only how a name is painted, though, so a reader who turns one of
243
- * these colours off still gets the name: hiding a state token takes the colour
244
- * away, not the word it was painted on.
245
- */
246
- private titleToken;
247
- /**
248
- * The seconds a call has taken: counting while it is unanswered, and kept on
249
- * the card of a program that dispatched calls.
250
- *
251
- * A plain tool's duration is not worth the width once its outcome is on the
252
- * row, but a program is a thing that took time, and the reader who watched the
253
- * timer count wants the total it ended on — quietly, since the work is over.
254
- */
255
- private elapsedStat;
256
- /**
257
- * Whether this card drew calls a program dispatched.
258
- *
259
- * The child rows are the fold's own statement that the card is a program's, so
260
- * the view never has to know the name of the tool that runs one.
261
- */
262
- private dispatchedCalls;
263
- /**
264
- * The card as this frame reads it, with its elapsed time filled in.
265
- *
266
- * The entry itself is left alone: the rows are cached by entry identity, so
267
- * rewriting one every second to carry a number that changes every second would
268
- * discard the rows of a call that has been waiting all along.
269
- */
270
- private cardOf;
271
152
  /**
272
- * Whether any part of one card is still in flight.
273
- *
274
- * Only a card with work outstanding has a clock attached to its cache, so the
275
- * moment the last call settles the row stops being rebuilt: a program that
276
- * came back must not keep spending the cache its result is now stored in.
277
- */
153
+ * Whether any part of one card is still in flight.
154
+ *
155
+ * Only a card with work outstanding has a clock attached to its cache, so the
156
+ * moment the last call settles the row stops being rebuilt: a program that
157
+ * came back must not keep spending the cache its result is now stored in.
158
+ */
278
159
  private isLive;
279
- /** The separator a header uses between its label, its facts, and its outcome. */
280
- private statSeparator;
281
- /**
282
- * The measured facts, each in its own colour, or nothing when none is visible.
283
- *
284
- * The lead is a parameter because a header that already carries a title and an
285
- * argument separates its facts with the same mark as its outcome, while facts
286
- * on a row of their own stand apart with blank columns.
287
- */
288
- private renderStats;
289
160
  private pushPicker;
290
- private pushGate;
291
- /**
292
- * One row a reader can choose: the cursor, the box, the number, the label.
293
- *
294
- * The row wraps under the label it belongs to rather than at the screen edge,
295
- * because the label and its description together are what tells two rows
296
- * apart, and a mark on a continuation line reads as another row.
297
- */
298
- private pushGateRow;
299
161
  /** The rows one transcript entry becomes; `live` marks the entry the turn is still writing. */
300
162
  private renderEntry;
301
- /** The mark and the space that introduce an element, empty when it has none. */
302
- private elementLead;
303
163
  render(width: number): string[];
304
164
  /**
305
- * The framed rows the last render drew, in the order the transcript reads.
306
- *
307
- * A copy of a selection is read off the screen, so it carries the frame the
308
- * surface drew around a message — the sides, the padding beside them, and the
309
- * rules above and below. This is the account that lets the surface take its own
310
- * frame back out of a copy without ever touching a character the reader wrote.
311
- */
165
+ * The framed rows the last render drew, in the order the transcript reads.
166
+ *
167
+ * A copy of a selection is read off the screen, so it carries the frame the
168
+ * surface drew around a message — the sides, the padding beside them, and the
169
+ * rules above and below. This is the account that lets the surface take its own
170
+ * frame back out of a copy without ever touching a character the reader wrote.
171
+ */
312
172
  copyRows(): readonly FrameRow[];
313
173
  }
314
174
  //# sourceMappingURL=view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/ui/view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,aAAa,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