@sagmans/dsh-tui 0.5.2 → 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 (285) 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 +131 -17
  9. package/lib/agent/host.d.ts +11 -0
  10. package/lib/agent/host.d.ts.map +1 -1
  11. package/lib/agent/host.js +16 -2
  12. package/lib/agent/host.js.map +1 -1
  13. package/lib/agent/present.d.ts.map +1 -1
  14. package/lib/agent/present.js +2 -1
  15. package/lib/agent/present.js.map +1 -1
  16. package/lib/agent/undo.d.ts +52 -0
  17. package/lib/agent/undo.d.ts.map +1 -0
  18. package/lib/agent/undo.js +106 -0
  19. package/lib/agent/undo.js.map +1 -0
  20. package/lib/cards/composition.d.ts +68 -0
  21. package/lib/cards/composition.d.ts.map +1 -0
  22. package/lib/cards/composition.js +117 -0
  23. package/lib/cards/composition.js.map +1 -0
  24. package/lib/cards/presenter.d.ts +23 -0
  25. package/lib/cards/presenter.d.ts.map +1 -0
  26. package/lib/cards/presenter.js +394 -0
  27. package/lib/cards/presenter.js.map +1 -0
  28. package/lib/cards/preview.d.ts +42 -0
  29. package/lib/cards/preview.d.ts.map +1 -0
  30. package/lib/cards/preview.js +51 -0
  31. package/lib/cards/preview.js.map +1 -0
  32. package/lib/cards.d.ts +42 -95
  33. package/lib/cards.d.ts.map +1 -1
  34. package/lib/cards.js +4 -526
  35. package/lib/cards.js.map +1 -1
  36. package/lib/compat/section.d.ts +29 -0
  37. package/lib/compat/section.d.ts.map +1 -0
  38. package/lib/compat/section.js +82 -0
  39. package/lib/compat/section.js.map +1 -0
  40. package/lib/config.d.ts +27 -2
  41. package/lib/config.d.ts.map +1 -1
  42. package/lib/config.js +61 -1
  43. package/lib/config.js.map +1 -1
  44. package/lib/contracts.d.ts +28 -0
  45. package/lib/contracts.d.ts.map +1 -1
  46. package/lib/fold-cursor.d.ts +8 -0
  47. package/lib/fold-cursor.d.ts.map +1 -1
  48. package/lib/fold-cursor.js +18 -0
  49. package/lib/fold-cursor.js.map +1 -1
  50. package/lib/gates/question-card.d.ts +77 -0
  51. package/lib/gates/question-card.d.ts.map +1 -0
  52. package/lib/gates/question-card.js +113 -0
  53. package/lib/gates/question-card.js.map +1 -0
  54. package/lib/gates/questions.d.ts +127 -0
  55. package/lib/gates/questions.d.ts.map +1 -0
  56. package/lib/gates/questions.js +418 -0
  57. package/lib/gates/questions.js.map +1 -0
  58. package/lib/gates.d.ts +1 -113
  59. package/lib/gates.d.ts.map +1 -1
  60. package/lib/gates.js +1 -484
  61. package/lib/gates.js.map +1 -1
  62. package/lib/herdr/reporter.d.ts +9 -4
  63. package/lib/herdr/reporter.d.ts.map +1 -1
  64. package/lib/herdr/reporter.js +5 -9
  65. package/lib/herdr/reporter.js.map +1 -1
  66. package/lib/herdr/state.d.ts +35 -4
  67. package/lib/herdr/state.d.ts.map +1 -1
  68. package/lib/herdr/state.js +37 -4
  69. package/lib/herdr/state.js.map +1 -1
  70. package/lib/index.d.ts +1 -0
  71. package/lib/index.d.ts.map +1 -1
  72. package/lib/index.js +343 -2267
  73. package/lib/index.js.map +1 -1
  74. package/lib/input/action-catalog.d.ts +74 -0
  75. package/lib/input/action-catalog.d.ts.map +1 -0
  76. package/lib/input/action-catalog.js +137 -0
  77. package/lib/input/action-catalog.js.map +1 -0
  78. package/lib/input/actions.d.ts +5 -81
  79. package/lib/input/actions.d.ts.map +1 -1
  80. package/lib/input/actions.js +4 -621
  81. package/lib/input/actions.js.map +1 -1
  82. package/lib/input/completion.d.ts +11 -1
  83. package/lib/input/completion.d.ts.map +1 -1
  84. package/lib/input/completion.js +17 -1
  85. package/lib/input/completion.js.map +1 -1
  86. package/lib/input/file-index.d.ts +40 -0
  87. package/lib/input/file-index.d.ts.map +1 -0
  88. package/lib/input/file-index.js +141 -0
  89. package/lib/input/file-index.js.map +1 -0
  90. package/lib/input/file-search.d.ts +1 -38
  91. package/lib/input/file-search.d.ts.map +1 -1
  92. package/lib/input/file-search.js +1 -487
  93. package/lib/input/file-search.js.map +1 -1
  94. package/lib/input/key-press.d.ts +57 -0
  95. package/lib/input/key-press.d.ts.map +1 -0
  96. package/lib/input/key-press.js +218 -0
  97. package/lib/input/key-press.js.map +1 -0
  98. package/lib/input/keymap-conflicts.d.ts +59 -0
  99. package/lib/input/keymap-conflicts.d.ts.map +1 -0
  100. package/lib/input/keymap-conflicts.js +292 -0
  101. package/lib/input/keymap-conflicts.js.map +1 -0
  102. package/lib/input/keymap-settings.js +1 -1
  103. package/lib/input/keymap-settings.js.map +1 -1
  104. package/lib/input/keymap.d.ts.map +1 -1
  105. package/lib/input/keymap.js +5 -1
  106. package/lib/input/keymap.js.map +1 -1
  107. package/lib/input/submission.d.ts +11 -1
  108. package/lib/input/submission.d.ts.map +1 -1
  109. package/lib/input/submission.js +10 -1
  110. package/lib/input/submission.js.map +1 -1
  111. package/lib/input/workspace-files.d.ts +10 -0
  112. package/lib/input/workspace-files.d.ts.map +1 -0
  113. package/lib/input/workspace-files.js +359 -0
  114. package/lib/input/workspace-files.js.map +1 -0
  115. package/lib/install-skills.d.ts +20 -0
  116. package/lib/install-skills.d.ts.map +1 -0
  117. package/lib/install-skills.js +198 -0
  118. package/lib/install-skills.js.map +1 -0
  119. package/lib/keys-command.d.ts +2 -1
  120. package/lib/keys-command.d.ts.map +1 -1
  121. package/lib/keys-command.js +2 -1
  122. package/lib/keys-command.js.map +1 -1
  123. package/lib/model-list.d.ts +37 -0
  124. package/lib/model-list.d.ts.map +1 -0
  125. package/lib/model-list.js +60 -0
  126. package/lib/model-list.js.map +1 -0
  127. package/lib/startup.d.ts +8 -0
  128. package/lib/startup.d.ts.map +1 -1
  129. package/lib/startup.js +120 -24
  130. package/lib/startup.js.map +1 -1
  131. package/lib/subagents.d.ts +7 -3
  132. package/lib/subagents.d.ts.map +1 -1
  133. package/lib/subagents.js +28 -4
  134. package/lib/subagents.js.map +1 -1
  135. package/lib/surface/appearance-preferences.d.ts +26 -0
  136. package/lib/surface/appearance-preferences.d.ts.map +1 -0
  137. package/lib/surface/appearance-preferences.js +139 -0
  138. package/lib/surface/appearance-preferences.js.map +1 -0
  139. package/lib/surface/appearance.d.ts +87 -0
  140. package/lib/surface/appearance.d.ts.map +1 -0
  141. package/lib/surface/appearance.js +353 -0
  142. package/lib/surface/appearance.js.map +1 -0
  143. package/lib/surface/background-work.d.ts +49 -0
  144. package/lib/surface/background-work.d.ts.map +1 -0
  145. package/lib/surface/background-work.js +146 -0
  146. package/lib/surface/background-work.js.map +1 -0
  147. package/lib/surface/commands.d.ts +80 -0
  148. package/lib/surface/commands.d.ts.map +1 -0
  149. package/lib/surface/commands.js +364 -0
  150. package/lib/surface/commands.js.map +1 -0
  151. package/lib/surface/modal-input.d.ts +58 -0
  152. package/lib/surface/modal-input.d.ts.map +1 -0
  153. package/lib/surface/modal-input.js +237 -0
  154. package/lib/surface/modal-input.js.map +1 -0
  155. package/lib/surface/model-choice.d.ts +54 -0
  156. package/lib/surface/model-choice.d.ts.map +1 -0
  157. package/lib/surface/model-choice.js +325 -0
  158. package/lib/surface/model-choice.js.map +1 -0
  159. package/lib/surface/preset-choice.d.ts +78 -0
  160. package/lib/surface/preset-choice.d.ts.map +1 -0
  161. package/lib/surface/preset-choice.js +163 -0
  162. package/lib/surface/preset-choice.js.map +1 -0
  163. package/lib/surface/prompt-input.d.ts +97 -0
  164. package/lib/surface/prompt-input.d.ts.map +1 -0
  165. package/lib/surface/prompt-input.js +215 -0
  166. package/lib/surface/prompt-input.js.map +1 -0
  167. package/lib/surface/prompt-memory.d.ts +76 -0
  168. package/lib/surface/prompt-memory.d.ts.map +1 -0
  169. package/lib/surface/prompt-memory.js +167 -0
  170. package/lib/surface/prompt-memory.js.map +1 -0
  171. package/lib/surface/session-lifecycle.d.ts +120 -0
  172. package/lib/surface/session-lifecycle.d.ts.map +1 -0
  173. package/lib/surface/session-lifecycle.js +321 -0
  174. package/lib/surface/session-lifecycle.js.map +1 -0
  175. package/lib/surface/session-picker.d.ts +39 -0
  176. package/lib/surface/session-picker.d.ts.map +1 -0
  177. package/lib/surface/session-picker.js +107 -0
  178. package/lib/surface/session-picker.js.map +1 -0
  179. package/lib/surface/session-view.d.ts +86 -0
  180. package/lib/surface/session-view.d.ts.map +1 -0
  181. package/lib/surface/session-view.js +215 -0
  182. package/lib/surface/session-view.js.map +1 -0
  183. package/lib/surface/staged-turns.d.ts +81 -0
  184. package/lib/surface/staged-turns.d.ts.map +1 -0
  185. package/lib/surface/staged-turns.js +206 -0
  186. package/lib/surface/staged-turns.js.map +1 -0
  187. package/lib/surface/terminal-lifecycle.d.ts +76 -0
  188. package/lib/surface/terminal-lifecycle.d.ts.map +1 -0
  189. package/lib/surface/terminal-lifecycle.js +222 -0
  190. package/lib/surface/terminal-lifecycle.js.map +1 -0
  191. package/lib/terminal/warning-screen.d.ts +8 -1
  192. package/lib/terminal/warning-screen.d.ts.map +1 -1
  193. package/lib/terminal/warning-screen.js +9 -0
  194. package/lib/terminal/warning-screen.js.map +1 -1
  195. package/lib/terminal-text/scan.d.ts +44 -0
  196. package/lib/terminal-text/scan.d.ts.map +1 -0
  197. package/lib/terminal-text/scan.js +195 -0
  198. package/lib/terminal-text/scan.js.map +1 -0
  199. package/lib/terminal-text/sgr.d.ts +32 -0
  200. package/lib/terminal-text/sgr.d.ts.map +1 -0
  201. package/lib/terminal-text/sgr.js +203 -0
  202. package/lib/terminal-text/sgr.js.map +1 -0
  203. package/lib/terminal-text.d.ts +1 -1
  204. package/lib/terminal-text.d.ts.map +1 -1
  205. package/lib/terminal-text.js +2 -379
  206. package/lib/terminal-text.js.map +1 -1
  207. package/lib/theme-command.js +2 -1
  208. package/lib/theme-command.js.map +1 -1
  209. package/lib/theme-defaults.d.ts +64 -0
  210. package/lib/theme-defaults.d.ts.map +1 -0
  211. package/lib/theme-defaults.js +248 -0
  212. package/lib/theme-defaults.js.map +1 -0
  213. package/lib/theme-resolver.d.ts +36 -0
  214. package/lib/theme-resolver.d.ts.map +1 -0
  215. package/lib/theme-resolver.js +112 -0
  216. package/lib/theme-resolver.js.map +1 -0
  217. package/lib/theme-schema.d.ts +6 -6
  218. package/lib/theme-schema.d.ts.map +1 -1
  219. package/lib/theme-schema.js +3 -2
  220. package/lib/theme-schema.js.map +1 -1
  221. package/lib/theme-settings.d.ts +13 -15
  222. package/lib/theme-settings.d.ts.map +1 -1
  223. package/lib/theme-settings.js +27 -19
  224. package/lib/theme-settings.js.map +1 -1
  225. package/lib/theme-tokens.d.ts +1 -90
  226. package/lib/theme-tokens.d.ts.map +1 -1
  227. package/lib/theme-tokens.js +11 -341
  228. package/lib/theme-tokens.js.map +1 -1
  229. package/lib/theme.d.ts +1 -1
  230. package/lib/theme.d.ts.map +1 -1
  231. package/lib/theme.js +2 -1
  232. package/lib/theme.js.map +1 -1
  233. package/lib/tool-display.d.ts.map +1 -1
  234. package/lib/tool-display.js +2 -1
  235. package/lib/tool-display.js.map +1 -1
  236. package/lib/transcript/message-content.d.ts +21 -0
  237. package/lib/transcript/message-content.d.ts.map +1 -0
  238. package/lib/transcript/message-content.js +61 -0
  239. package/lib/transcript/message-content.js.map +1 -0
  240. package/lib/transcript/tool-calls.d.ts +106 -0
  241. package/lib/transcript/tool-calls.d.ts.map +1 -0
  242. package/lib/transcript/tool-calls.js +254 -0
  243. package/lib/transcript/tool-calls.js.map +1 -0
  244. package/lib/transcript.d.ts +38 -43
  245. package/lib/transcript.d.ts.map +1 -1
  246. package/lib/transcript.js +58 -245
  247. package/lib/transcript.js.map +1 -1
  248. package/lib/ui/copy.d.ts +17 -0
  249. package/lib/ui/copy.d.ts.map +1 -0
  250. package/lib/ui/copy.js +104 -0
  251. package/lib/ui/copy.js.map +1 -0
  252. package/lib/ui/dock.d.ts +35 -3
  253. package/lib/ui/dock.d.ts.map +1 -1
  254. package/lib/ui/dock.js +124 -23
  255. package/lib/ui/dock.js.map +1 -1
  256. package/lib/ui/editor.d.ts.map +1 -1
  257. package/lib/ui/editor.js +2 -1
  258. package/lib/ui/editor.js.map +1 -1
  259. package/lib/ui/frame.d.ts +31 -0
  260. package/lib/ui/frame.d.ts.map +1 -1
  261. package/lib/ui/frame.js +27 -4
  262. package/lib/ui/frame.js.map +1 -1
  263. package/lib/ui/keymap-picker.d.ts +2 -1
  264. package/lib/ui/keymap-picker.d.ts.map +1 -1
  265. package/lib/ui/keymap-picker.js +1 -0
  266. package/lib/ui/keymap-picker.js.map +1 -1
  267. package/lib/ui/view/gate-card.d.ts +21 -0
  268. package/lib/ui/view/gate-card.d.ts.map +1 -0
  269. package/lib/ui/view/gate-card.js +104 -0
  270. package/lib/ui/view/gate-card.js.map +1 -0
  271. package/lib/ui/view/tool-card.d.ts +138 -0
  272. package/lib/ui/view/tool-card.d.ts.map +1 -0
  273. package/lib/ui/view/tool-card.js +413 -0
  274. package/lib/ui/view/tool-card.js.map +1 -0
  275. package/lib/ui/view/transcript-message.d.ts +62 -0
  276. package/lib/ui/view/transcript-message.d.ts.map +1 -0
  277. package/lib/ui/view/transcript-message.js +158 -0
  278. package/lib/ui/view/transcript-message.js.map +1 -0
  279. package/lib/ui/view.d.ts +87 -156
  280. package/lib/ui/view.d.ts.map +1 -1
  281. package/lib/ui/view.js +122 -556
  282. package/lib/ui/view.js.map +1 -1
  283. package/package.json +3 -1
  284. package/themes/deepseek-blue.yaml +9 -0
  285. package/themes/violet-orbit.yaml +7 -0
@@ -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;QACpB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE;YACxD,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,C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,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,12 +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, TranscriptModel } from '../transcript.ts';
5
- import { type ToolDisplaySpec } from '../tool-display.ts';
6
- import type { TuiTheme } from '../theme.ts';
7
- import { type MarkdownRenderer } from './markdown.ts';
8
- import type { PickerCard } from './picker.ts';
9
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';
10
11
  /** Which rows the reader has opened by key; a click decides for one message instead. */
11
12
  export interface ViewState {
12
13
  readonly expandCards: boolean;
@@ -23,6 +24,21 @@ export interface ViewState {
23
24
  * a program's calls, whose one line per dispatch is what the card stands for.
24
25
  */
25
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
+ }
26
42
  /**
27
43
  * Renders the transcript rows and any pending gate as terminal lines.
28
44
  *
@@ -61,183 +77,98 @@ export declare class TranscriptView implements Component {
61
77
  private readonly options;
62
78
  private readonly rows;
63
79
  /**
64
- * Fold choices the reader made by clicking, per message.
65
- *
66
- * Absent means the key or the tool's own policy decides, so a settings edit
67
- * stays in charge of messages nobody clicked. Keyed by the call or thought id
68
- * rather than by the entry, because a result replaces the entry a click was
69
- * made on and a thought outlives the live row that streamed it.
70
- */
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
+ */
71
87
  private readonly clicked;
72
88
  /** The rows each clickable message drew last render, for mapping a click back to it. */
73
89
  private spans;
74
90
  /** The same spans relative to their entry, so a cached entry still answers clicks. */
75
91
  private readonly entrySpans;
92
+ /**
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
+ */
98
+ private readonly entryCopy;
99
+ /**
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
+ */
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. */
76
111
  constructor(model: TranscriptModel, theme: TuiTheme, markdown: MarkdownRenderer, options?: TranscriptViewOptions);
77
112
  private get viewState();
78
113
  /** The display the reader configured for a tool, or the shipped one. */
79
114
  private toolDisplay;
80
115
  /**
81
- * Whether one tool message draws open.
82
- *
83
- * A click outranks the key, which outranks the tool's start state: Ctrl+O
84
- * stays "show me everything", while one clicked message keeps the state the
85
- * reader gave it.
86
- */
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
+ */
87
122
  private expansionOf;
88
123
  /** Whether one thought draws its body; a click decides for that thought alone. */
89
124
  private reasoningOpen;
90
125
  /** Whether one dispatched call draws its argument in full; a click decides for that call. */
91
126
  private subCallOpen;
92
127
  /**
93
- * Answer a click on a message by folding or unfolding that one row.
94
- *
95
- * The tightest span under the point wins, so a click on a dispatched call
96
- * opens that call rather than the card around it. Only a left click is
97
- * consumed: a press, a drag, and a wheel belong to the surface's own
98
- * selection and scrolling, and a row that swallowed them would cost the
99
- * reader the ability to copy the command it just drew.
100
- */
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
+ */
101
136
  handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
102
137
  /** The cache's own account of the work it avoided; a test reads this. */
103
138
  rowStats(): RowCacheStats;
104
139
  invalidate(): void;
105
140
  /**
106
- * Wrap one text block under a prefix, keeping the prefix's column budget.
107
- *
108
- * The block is drawn before it is wrapped: a sequence a terminal would have
109
- * acted on has to be gone before pi-tui measures the row, and a tab has to
110
- * land on the stop the writer saw rather than one a wrapper would guess at.
111
- * The prefix seeds that stop, because it is already on the row.
112
- */
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
+ */
113
148
  private pushWrapped;
114
- /**
115
- * Wrap one already-styled block under a prefix.
116
- *
117
- * A card header mixes tokens — title, argument, stats — in a single string, so
118
- * it cannot go through {@link pushWrapped}, which escapes and restyles plain
119
- * text. Its width still has to fold at the screen edge rather than be cut,
120
- * because the argument is the part a reader scans for and a silently dropped
121
- * command is worse than a taller card.
122
- */
123
- private pushStyledWrapped;
124
- /**
125
- * The rows one markdown message draws, with the padding pi-tui adds for background styling removed.
126
- *
127
- * The source is drawn first so the markdown renderer never measures a sequence
128
- * it cannot see; its own spans are applied around the result afterwards.
129
- */
130
- private markdownLines;
131
- /**
132
- * Render one message's text as markdown.
133
- *
134
- * A thought passes its own face and an indent, so the row stays visibly a
135
- * detail of the step that produced it rather than a second answer.
136
- */
137
- private pushMarkdown;
138
- /**
139
- * One message closed into a frame, with its markdown laid out to what is left inside.
140
- *
141
- * A prompt and a reply are the two objects of an exchange, so both are drawn as
142
- * bars rather than as one more stretch of rows; the face, the border's element,
143
- * and whether the text is still arriving are the only differences. Markdown lays
144
- * itself out to the frame's text width, so the frame may only place the rows:
145
- * wrapping them again would break what it drew.
146
- */
147
- private pushFramed;
148
- /**
149
- * The face a thought is drawn in.
150
- *
151
- * Its shade stays the thought body's and it asks for no drawing: a diagram in
152
- * the middle of a thought would carry the answer's weight, and the answer's
153
- * colours would make the thinking compete with it.
154
- */
155
- private reasoningFace;
156
- /** The face a submitted prompt is drawn in: its structure is markdown's, its shade stays the prompt's. */
157
- private userFace;
158
149
  /** The live map, or the shipped one for a caller that did not lend one. */
159
150
  private keymap;
160
151
  private reasoningFoldHint;
161
- private pushReasoning;
162
- private pushCard;
163
- /**
164
- * The calls one card dispatched, one entry each.
165
- *
166
- * A nested call is a signpost rather than a card of its own, so it keeps one
167
- * entry per call, clipped to that entry until the reader clicks it: the
168
- * argument is the part a reader scans for, and one that always wrapped pushed
169
- * the rest of the program off the screen.
170
- */
171
- private pushSubCalls;
172
- /**
173
- * What a dispatched call declared and what it produced, under its argument.
174
- *
175
- * The parent card keeps only the program's return value, so both are otherwise
176
- * gone; a reader who opens the row is asking for them, which is why the call's
177
- * own rows come first and its outcome under them. Each section keeps the
178
- * retention its card used, so a long run still says what it dropped.
179
- */
180
- private pushSubCallOutput;
181
- /**
182
- * A folded card's one row: label, clipped argument, measured facts, outcome.
183
- *
184
- * The outcome rides this row rather than a row of its own, because one line
185
- * per call is what folding promises. A shell card's hidden rows are counted
186
- * here too: its output is the answer the reader asked for, and a fold that
187
- * left no trace of it would read as a call that produced nothing.
188
- *
189
- * The argument is the part that gives up room: it is clipped to whatever the
190
- * label, the facts, and the outcome leave before the edge, so a wide terminal
191
- * shows more of the call while a narrow one still shows how it ended.
192
- */
193
- private renderCollapsedHead;
194
- /**
195
- * One detail row, drawn with its own kind's colours or nothing at all.
196
- *
197
- * The row says what it is, so the renderer never guesses from the text: a diff
198
- * line beginning with "+" is an addition because the presenter said so, not
199
- * because of its first character.
200
- */
201
- private detailRow;
202
- /** The mark that introduces a card, empty when the theme hides its label. */
203
- private cardLead;
204
- /** A card's label, styled, or nothing when the theme hides it. */
205
- private cardTitle;
206
- /** A card's argument, styled and flattened, clipped to `limit` when one is given. */
207
- private cardArgument;
208
152
  /**
209
- * A card's header: its label, its argument, and its measured facts.
210
- *
211
- * The glyph is returned apart from the body so a wrapped continuation can
212
- * align under the label rather than under the mark. An opened terminal's
213
- * argument is left out because it needs a row of its own — it is the one
214
- * argument that can be a whole command rather than a word.
215
- */
216
- private renderHead;
217
- /** The separator a header uses between its label, its facts, and its outcome. */
218
- private statSeparator;
219
- /**
220
- * The measured facts, each in its own colour, or nothing when none is visible.
221
- *
222
- * The lead is a parameter because a header that already carries a title and an
223
- * argument separates its facts with the same mark as its outcome, while facts
224
- * on a row of their own stand apart with blank columns.
225
- */
226
- private renderStats;
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
+ */
159
+ private isLive;
227
160
  private pushPicker;
228
- private pushGate;
229
- /**
230
- * One row a reader can choose: the cursor, the box, the number, the label.
231
- *
232
- * The row wraps under the label it belongs to rather than at the screen edge,
233
- * because the label and its description together are what tells two rows
234
- * apart, and a mark on a continuation line reads as another row.
235
- */
236
- private pushGateRow;
237
161
  /** The rows one transcript entry becomes; `live` marks the entry the turn is still writing. */
238
162
  private renderEntry;
239
- /** The mark and the space that introduce an element, empty when it has none. */
240
- private elementLead;
241
163
  render(width: number): string[];
164
+ /**
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
+ */
172
+ copyRows(): readonly FrameRow[];
242
173
  }
243
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,EAClB,KAAK,mBAAmB,EAGzB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAE/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,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