@onpoint-dev-tools/crewcoder-opentui 0.0.0-stage → 0.1.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 (325) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +262 -2
  3. package/THIRD_PARTY_NOTICES.md +51 -0
  4. package/dist/App.d.ts +16 -0
  5. package/dist/App.d.ts.map +1 -0
  6. package/dist/App.js +428 -0
  7. package/dist/App.js.map +1 -0
  8. package/dist/Root.d.ts +11 -0
  9. package/dist/Root.d.ts.map +1 -0
  10. package/dist/Root.js +13 -0
  11. package/dist/Root.js.map +1 -0
  12. package/dist/alert-model.d.ts +31 -0
  13. package/dist/alert-model.d.ts.map +1 -0
  14. package/dist/alert-model.js +34 -0
  15. package/dist/alert-model.js.map +1 -0
  16. package/dist/args.d.ts +13 -0
  17. package/dist/args.d.ts.map +1 -0
  18. package/dist/args.js +63 -0
  19. package/dist/args.js.map +1 -0
  20. package/dist/attachments.d.ts +29 -0
  21. package/dist/attachments.d.ts.map +1 -0
  22. package/dist/attachments.js +38 -0
  23. package/dist/attachments.js.map +1 -0
  24. package/dist/block-panels.d.ts +43 -0
  25. package/dist/block-panels.d.ts.map +1 -0
  26. package/dist/block-panels.js +210 -0
  27. package/dist/block-panels.js.map +1 -0
  28. package/dist/cli.d.ts +3 -0
  29. package/dist/cli.d.ts.map +1 -0
  30. package/dist/cli.js +138 -0
  31. package/dist/cli.js.map +1 -0
  32. package/dist/command-format.d.ts +18 -0
  33. package/dist/command-format.d.ts.map +1 -0
  34. package/dist/command-format.js +66 -0
  35. package/dist/command-format.js.map +1 -0
  36. package/dist/command-runner.d.ts +128 -0
  37. package/dist/command-runner.d.ts.map +1 -0
  38. package/dist/command-runner.js +571 -0
  39. package/dist/command-runner.js.map +1 -0
  40. package/dist/commands.d.ts +47 -0
  41. package/dist/commands.d.ts.map +1 -0
  42. package/dist/commands.js +108 -0
  43. package/dist/commands.js.map +1 -0
  44. package/dist/components/AttachmentRow.d.ts +11 -0
  45. package/dist/components/AttachmentRow.d.ts.map +1 -0
  46. package/dist/components/AttachmentRow.js +17 -0
  47. package/dist/components/AttachmentRow.js.map +1 -0
  48. package/dist/components/Composer.d.ts +23 -0
  49. package/dist/components/Composer.d.ts.map +1 -0
  50. package/dist/components/Composer.js +45 -0
  51. package/dist/components/Composer.js.map +1 -0
  52. package/dist/components/ExtensionQuestion.d.ts +18 -0
  53. package/dist/components/ExtensionQuestion.d.ts.map +1 -0
  54. package/dist/components/ExtensionQuestion.js +45 -0
  55. package/dist/components/ExtensionQuestion.js.map +1 -0
  56. package/dist/components/GoalForm.d.ts +18 -0
  57. package/dist/components/GoalForm.d.ts.map +1 -0
  58. package/dist/components/GoalForm.js +26 -0
  59. package/dist/components/GoalForm.js.map +1 -0
  60. package/dist/components/Home.d.ts +21 -0
  61. package/dist/components/Home.d.ts.map +1 -0
  62. package/dist/components/Home.js +48 -0
  63. package/dist/components/Home.js.map +1 -0
  64. package/dist/components/MentionList.d.ts +14 -0
  65. package/dist/components/MentionList.d.ts.map +1 -0
  66. package/dist/components/MentionList.js +24 -0
  67. package/dist/components/MentionList.js.map +1 -0
  68. package/dist/components/SearchBar.d.ts +19 -0
  69. package/dist/components/SearchBar.d.ts.map +1 -0
  70. package/dist/components/SearchBar.js +28 -0
  71. package/dist/components/SearchBar.js.map +1 -0
  72. package/dist/components/Sidebar.d.ts +19 -0
  73. package/dist/components/Sidebar.d.ts.map +1 -0
  74. package/dist/components/Sidebar.js +35 -0
  75. package/dist/components/Sidebar.js.map +1 -0
  76. package/dist/components/SummaryEditor.d.ts +16 -0
  77. package/dist/components/SummaryEditor.d.ts.map +1 -0
  78. package/dist/components/SummaryEditor.js +21 -0
  79. package/dist/components/SummaryEditor.js.map +1 -0
  80. package/dist/components/Transcript.d.ts +37 -0
  81. package/dist/components/Transcript.d.ts.map +1 -0
  82. package/dist/components/Transcript.js +314 -0
  83. package/dist/components/Transcript.js.map +1 -0
  84. package/dist/components/ui/alert.d.ts +9 -0
  85. package/dist/components/ui/alert.d.ts.map +1 -0
  86. package/dist/components/ui/alert.js +18 -0
  87. package/dist/components/ui/alert.js.map +1 -0
  88. package/dist/components/ui/command-palette.d.ts +15 -0
  89. package/dist/components/ui/command-palette.d.ts.map +1 -0
  90. package/dist/components/ui/command-palette.js +14 -0
  91. package/dist/components/ui/command-palette.js.map +1 -0
  92. package/dist/components/ui/confirm.d.ts +12 -0
  93. package/dist/components/ui/confirm.d.ts.map +1 -0
  94. package/dist/components/ui/confirm.js +16 -0
  95. package/dist/components/ui/confirm.js.map +1 -0
  96. package/dist/components/ui/select.d.ts +11 -0
  97. package/dist/components/ui/select.d.ts.map +1 -0
  98. package/dist/components/ui/select.js +29 -0
  99. package/dist/components/ui/select.js.map +1 -0
  100. package/dist/components/ui/spinner.d.ts +14 -0
  101. package/dist/components/ui/spinner.d.ts.map +1 -0
  102. package/dist/components/ui/spinner.js +17 -0
  103. package/dist/components/ui/spinner.js.map +1 -0
  104. package/dist/components/ui/tool-approval.d.ts +14 -0
  105. package/dist/components/ui/tool-approval.d.ts.map +1 -0
  106. package/dist/components/ui/tool-approval.js +37 -0
  107. package/dist/components/ui/tool-approval.js.map +1 -0
  108. package/dist/components/ui/tool-call.d.ts +12 -0
  109. package/dist/components/ui/tool-call.d.ts.map +1 -0
  110. package/dist/components/ui/tool-call.js +69 -0
  111. package/dist/components/ui/tool-call.js.map +1 -0
  112. package/dist/components/ui/types.d.ts +82 -0
  113. package/dist/components/ui/types.d.ts.map +1 -0
  114. package/dist/components/ui/types.js +2 -0
  115. package/dist/components/ui/types.js.map +1 -0
  116. package/dist/crewcoder-cli.d.ts +51 -0
  117. package/dist/crewcoder-cli.d.ts.map +1 -0
  118. package/dist/crewcoder-cli.js +26 -0
  119. package/dist/crewcoder-cli.js.map +1 -0
  120. package/dist/diff-anchors.d.ts +14 -0
  121. package/dist/diff-anchors.d.ts.map +1 -0
  122. package/dist/diff-anchors.js +43 -0
  123. package/dist/diff-anchors.js.map +1 -0
  124. package/dist/footer-layout.d.ts +49 -0
  125. package/dist/footer-layout.d.ts.map +1 -0
  126. package/dist/footer-layout.js +79 -0
  127. package/dist/footer-layout.js.map +1 -0
  128. package/dist/glyphs.d.ts +32 -0
  129. package/dist/glyphs.d.ts.map +1 -0
  130. package/dist/glyphs.js +35 -0
  131. package/dist/glyphs.js.map +1 -0
  132. package/dist/goal-form.d.ts +47 -0
  133. package/dist/goal-form.d.ts.map +1 -0
  134. package/dist/goal-form.js +59 -0
  135. package/dist/goal-form.js.map +1 -0
  136. package/dist/hooks/use-animation.d.ts +6 -0
  137. package/dist/hooks/use-animation.d.ts.map +1 -0
  138. package/dist/hooks/use-animation.js +52 -0
  139. package/dist/hooks/use-animation.js.map +1 -0
  140. package/dist/hooks/use-app-colors.d.ts +6 -0
  141. package/dist/hooks/use-app-colors.d.ts.map +1 -0
  142. package/dist/hooks/use-app-colors.js +6 -0
  143. package/dist/hooks/use-app-colors.js.map +1 -0
  144. package/dist/hooks/use-glyph-set.d.ts +8 -0
  145. package/dist/hooks/use-glyph-set.d.ts.map +1 -0
  146. package/dist/hooks/use-glyph-set.js +22 -0
  147. package/dist/hooks/use-glyph-set.js.map +1 -0
  148. package/dist/hooks/use-motion.d.ts +6 -0
  149. package/dist/hooks/use-motion.d.ts.map +1 -0
  150. package/dist/hooks/use-motion.js +8 -0
  151. package/dist/hooks/use-motion.js.map +1 -0
  152. package/dist/hooks/use-terminal-focus.d.ts +16 -0
  153. package/dist/hooks/use-terminal-focus.d.ts.map +1 -0
  154. package/dist/hooks/use-terminal-focus.js +30 -0
  155. package/dist/hooks/use-terminal-focus.js.map +1 -0
  156. package/dist/hooks/use-theme.d.ts +6 -0
  157. package/dist/hooks/use-theme.d.ts.map +1 -0
  158. package/dist/hooks/use-theme.js +11 -0
  159. package/dist/hooks/use-theme.js.map +1 -0
  160. package/dist/hunk.d.ts +27 -0
  161. package/dist/hunk.d.ts.map +1 -0
  162. package/dist/hunk.js +43 -0
  163. package/dist/hunk.js.map +1 -0
  164. package/dist/image-view.d.ts +33 -0
  165. package/dist/image-view.d.ts.map +1 -0
  166. package/dist/image-view.js +51 -0
  167. package/dist/image-view.js.map +1 -0
  168. package/dist/keybindings.d.ts +28 -0
  169. package/dist/keybindings.d.ts.map +1 -0
  170. package/dist/keybindings.js +105 -0
  171. package/dist/keybindings.js.map +1 -0
  172. package/dist/lib/terminal-themes/default.d.ts +3 -0
  173. package/dist/lib/terminal-themes/default.d.ts.map +1 -0
  174. package/dist/lib/terminal-themes/default.js +49 -0
  175. package/dist/lib/terminal-themes/default.js.map +1 -0
  176. package/dist/logo-pulse.d.ts +23 -0
  177. package/dist/logo-pulse.d.ts.map +1 -0
  178. package/dist/logo-pulse.js +30 -0
  179. package/dist/logo-pulse.js.map +1 -0
  180. package/dist/markdown-style.d.ts +47 -0
  181. package/dist/markdown-style.d.ts.map +1 -0
  182. package/dist/markdown-style.js +138 -0
  183. package/dist/markdown-style.js.map +1 -0
  184. package/dist/mentions.d.ts +57 -0
  185. package/dist/mentions.d.ts.map +1 -0
  186. package/dist/mentions.js +109 -0
  187. package/dist/mentions.js.map +1 -0
  188. package/dist/palette-model.d.ts +42 -0
  189. package/dist/palette-model.d.ts.map +1 -0
  190. package/dist/palette-model.js +77 -0
  191. package/dist/palette-model.js.map +1 -0
  192. package/dist/path-suggestions.d.ts +50 -0
  193. package/dist/path-suggestions.d.ts.map +1 -0
  194. package/dist/path-suggestions.js +99 -0
  195. package/dist/path-suggestions.js.map +1 -0
  196. package/dist/picker-flows.d.ts +78 -0
  197. package/dist/picker-flows.d.ts.map +1 -0
  198. package/dist/picker-flows.js +444 -0
  199. package/dist/picker-flows.js.map +1 -0
  200. package/dist/pickers.d.ts +34 -0
  201. package/dist/pickers.d.ts.map +1 -0
  202. package/dist/pickers.js +136 -0
  203. package/dist/pickers.js.map +1 -0
  204. package/dist/prompt-history.d.ts +32 -0
  205. package/dist/prompt-history.d.ts.map +1 -0
  206. package/dist/prompt-history.js +40 -0
  207. package/dist/prompt-history.js.map +1 -0
  208. package/dist/providers/app-theme-provider.d.ts +12 -0
  209. package/dist/providers/app-theme-provider.d.ts.map +1 -0
  210. package/dist/providers/app-theme-provider.js +14 -0
  211. package/dist/providers/app-theme-provider.js.map +1 -0
  212. package/dist/providers/theme-provider.d.ts +10 -0
  213. package/dist/providers/theme-provider.d.ts.map +1 -0
  214. package/dist/providers/theme-provider.js +57 -0
  215. package/dist/providers/theme-provider.js.map +1 -0
  216. package/dist/question-model.d.ts +71 -0
  217. package/dist/question-model.d.ts.map +1 -0
  218. package/dist/question-model.js +176 -0
  219. package/dist/question-model.js.map +1 -0
  220. package/dist/search-controller.d.ts +46 -0
  221. package/dist/search-controller.d.ts.map +1 -0
  222. package/dist/search-controller.js +89 -0
  223. package/dist/search-controller.js.map +1 -0
  224. package/dist/search-jump.d.ts +27 -0
  225. package/dist/search-jump.d.ts.map +1 -0
  226. package/dist/search-jump.js +65 -0
  227. package/dist/search-jump.js.map +1 -0
  228. package/dist/session-controller.d.ts +268 -0
  229. package/dist/session-controller.d.ts.map +1 -0
  230. package/dist/session-controller.js +941 -0
  231. package/dist/session-controller.js.map +1 -0
  232. package/dist/sidebar-model.d.ts +45 -0
  233. package/dist/sidebar-model.d.ts.map +1 -0
  234. package/dist/sidebar-model.js +223 -0
  235. package/dist/sidebar-model.js.map +1 -0
  236. package/dist/sidebar.d.ts +49 -0
  237. package/dist/sidebar.d.ts.map +1 -0
  238. package/dist/sidebar.js +106 -0
  239. package/dist/sidebar.js.map +1 -0
  240. package/dist/status-line.d.ts +32 -0
  241. package/dist/status-line.d.ts.map +1 -0
  242. package/dist/status-line.js +69 -0
  243. package/dist/status-line.js.map +1 -0
  244. package/dist/syntax/filetype.d.ts +12 -0
  245. package/dist/syntax/filetype.d.ts.map +1 -0
  246. package/dist/syntax/filetype.js +28 -0
  247. package/dist/syntax/filetype.js.map +1 -0
  248. package/dist/syntax/grammars.d.ts +42 -0
  249. package/dist/syntax/grammars.d.ts.map +1 -0
  250. package/dist/syntax/grammars.js +52 -0
  251. package/dist/syntax/grammars.js.map +1 -0
  252. package/dist/text-offset.d.ts +5 -0
  253. package/dist/text-offset.d.ts.map +1 -0
  254. package/dist/text-offset.js +38 -0
  255. package/dist/text-offset.js.map +1 -0
  256. package/dist/text-wrap.d.ts +12 -0
  257. package/dist/text-wrap.d.ts.map +1 -0
  258. package/dist/text-wrap.js +53 -0
  259. package/dist/text-wrap.js.map +1 -0
  260. package/dist/theme-controller.d.ts +77 -0
  261. package/dist/theme-controller.d.ts.map +1 -0
  262. package/dist/theme-controller.js +178 -0
  263. package/dist/theme-controller.js.map +1 -0
  264. package/dist/theme.d.ts +51 -0
  265. package/dist/theme.d.ts.map +1 -0
  266. package/dist/theme.js +86 -0
  267. package/dist/theme.js.map +1 -0
  268. package/dist/tmux-check.d.ts +35 -0
  269. package/dist/tmux-check.d.ts.map +1 -0
  270. package/dist/tmux-check.js +66 -0
  271. package/dist/tmux-check.js.map +1 -0
  272. package/dist/tmux.d.ts +69 -0
  273. package/dist/tmux.d.ts.map +1 -0
  274. package/dist/tmux.js +135 -0
  275. package/dist/tmux.js.map +1 -0
  276. package/dist/tool-diff.d.ts +51 -0
  277. package/dist/tool-diff.d.ts.map +1 -0
  278. package/dist/tool-diff.js +158 -0
  279. package/dist/tool-diff.js.map +1 -0
  280. package/dist/tool-presentation.d.ts +46 -0
  281. package/dist/tool-presentation.d.ts.map +1 -0
  282. package/dist/tool-presentation.js +148 -0
  283. package/dist/tool-presentation.js.map +1 -0
  284. package/dist/tool-renderer-view.d.ts +14 -0
  285. package/dist/tool-renderer-view.d.ts.map +1 -0
  286. package/dist/tool-renderer-view.js +10 -0
  287. package/dist/tool-renderer-view.js.map +1 -0
  288. package/dist/transcript-search.d.ts +54 -0
  289. package/dist/transcript-search.d.ts.map +1 -0
  290. package/dist/transcript-search.js +160 -0
  291. package/dist/transcript-search.js.map +1 -0
  292. package/dist/transcript.d.ts +59 -0
  293. package/dist/transcript.d.ts.map +1 -0
  294. package/dist/transcript.js +123 -0
  295. package/dist/transcript.js.map +1 -0
  296. package/dist/workflow-tools.d.ts +42 -0
  297. package/dist/workflow-tools.d.ts.map +1 -0
  298. package/dist/workflow-tools.js +89 -0
  299. package/dist/workflow-tools.js.map +1 -0
  300. package/examples/themes/ember.json +75 -0
  301. package/grammars/bash/LICENSE +21 -0
  302. package/grammars/bash/highlights.scm +56 -0
  303. package/grammars/bash/tree-sitter-bash.wasm +0 -0
  304. package/grammars/css/LICENSE +21 -0
  305. package/grammars/css/highlights.scm +76 -0
  306. package/grammars/css/tree-sitter-css.wasm +0 -0
  307. package/grammars/go/LICENSE +21 -0
  308. package/grammars/go/highlights.scm +123 -0
  309. package/grammars/go/tree-sitter-go.wasm +0 -0
  310. package/grammars/html/LICENSE +21 -0
  311. package/grammars/html/highlights.scm +13 -0
  312. package/grammars/html/tree-sitter-html.wasm +0 -0
  313. package/grammars/json/LICENSE +21 -0
  314. package/grammars/json/highlights.scm +16 -0
  315. package/grammars/json/tree-sitter-json.wasm +0 -0
  316. package/grammars/python/LICENSE +21 -0
  317. package/grammars/python/highlights.scm +137 -0
  318. package/grammars/python/tree-sitter-python.wasm +0 -0
  319. package/grammars/rust/LICENSE +21 -0
  320. package/grammars/rust/highlights.scm +161 -0
  321. package/grammars/rust/tree-sitter-rust.wasm +0 -0
  322. package/grammars/yaml/LICENSE +20 -0
  323. package/grammars/yaml/highlights.scm +79 -0
  324. package/grammars/yaml/tree-sitter-yaml.wasm +0 -0
  325. package/package.json +56 -5
@@ -0,0 +1,314 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@opentui/react/jsx-runtime";
2
+ import { pathToFileURL } from "node:url";
3
+ import { useRenderer } from "@opentui/react";
4
+ import { useMemo, useState } from "react";
5
+ import { blockPanel, isPanelBlock } from "../block-panels.js";
6
+ import { reasoningIcon } from "../glyphs.js";
7
+ import { useAppColors } from "../hooks/use-app-colors.js";
8
+ import { useGlyphSet } from "../hooks/use-glyph-set.js";
9
+ import { useTheme } from "../hooks/use-theme.js";
10
+ import { codeFence, useCodeStyle, useMarkdownStyle } from "../markdown-style.js";
11
+ import { codeFiletype } from "../syntax/filetype.js";
12
+ import { imageBox } from "../image-view.js";
13
+ import { bodyColor, toneColor } from "../theme.js";
14
+ import { toolDiffs } from "../tool-diff.js";
15
+ import { clampOutput, COLLAPSED_OUTPUT_LINES, diffLineTone, toolPresentation } from "../tool-presentation.js";
16
+ import { actionLabel } from "../keybindings.js";
17
+ import { blockElementId, chromeId } from "../search-jump.js";
18
+ import { SEARCH_MARKER } from "../glyphs.js";
19
+ import { workflowView } from "../workflow-tools.js";
20
+ import { renderedTool } from "../tool-renderer-view.js";
21
+ import { findToolRenderer } from "@onpoint-dev-tools/crewcoder-tui-core/state/tool-renderers";
22
+ import { blockToRow, isStreaming, normalize, throughputLabel, transcriptSections, workerOf } from "../transcript.js";
23
+ import { Spinner } from "./ui/spinner.js";
24
+ /** Shown under an image whose pixels could not be drawn (unreadable or undecodable file). */
25
+ export const IMAGE_FAILED_TEXT = "(image could not be drawn)";
26
+ /** Dashed rounded border for the Agent work box. */
27
+ export const DASHED_BORDER = {
28
+ topLeft: "╭", topRight: "╮", bottomLeft: "╰", bottomRight: "╯",
29
+ horizontal: "╌", vertical: "╎",
30
+ topT: "┬", bottomT: "┴", leftT: "├", rightT: "┤", cross: "┼"
31
+ };
32
+ export const AGENT_WORK_TITLE = "Agent work";
33
+ export const REASONING_LABEL = "Reasoning";
34
+ /**
35
+ * The whole conversation in a scrollbox that sticks to the bottom while new
36
+ * output arrives and stays put once the user scrolls up (until they scroll back
37
+ * down). Sections follow event order, divided by a blank row.
38
+ */
39
+ export function Transcript({ blocks, running, cwd, expansion, images, scrollRef, markRow, renderers = [] }) {
40
+ const theme = useTheme();
41
+ // Emoji icons only where the terminal draws them whole; single-cell symbols elsewhere.
42
+ const glyphs = useGlyphSet();
43
+ const sections = transcriptSections(blocks);
44
+ const lastIndex = blocks.length - 1;
45
+ return (_jsxs("scrollbox", { ref: scrollRef, flexGrow: 1, flexShrink: 1, width: "100%",
46
+ // Clicking the transcript must not take focus from the composer; the wheel still scrolls it.
47
+ focusable: false, stickyScroll: true, stickyStart: "bottom", viewportCulling: true, contentOptions: { flexDirection: "column", paddingLeft: 1, paddingRight: 1 }, verticalScrollbarOptions: { trackOptions: { foregroundColor: theme.colors.border, backgroundColor: theme.colors.background } }, children: [sections.map((section, index) => (_jsx("box", { ...(section.kind === "block" ? { id: blockElementId(section.start) } : {}), flexDirection: "column", width: "100%", flexShrink: 0, marginTop: index === 0 ? 0 : 1, children: section.kind === "work"
48
+ ? _jsx(AgentWork, { blocks: section.blocks, start: section.start, cwd: cwd, expansion: expansion, glyphs: glyphs, renderers: renderers })
49
+ : _jsx(BlockView, { block: section.block, index: section.start, streaming: isStreaming(section.block, section.start === lastIndex, running), glyphs: glyphs, images: images }) }, `${section.kind}-${section.start}`))), markRow !== undefined ? (_jsx("box", { position: "absolute", top: markRow, left: 0, width: 1, height: 1, children: _jsx("text", { id: chromeId("search-mark"), fg: theme.colors.warning, wrapMode: "none", children: _jsx("b", { children: SEARCH_MARKER }) }) })) : null] }));
50
+ }
51
+ function BlockView({ block, index, streaming, glyphs, images }) {
52
+ if (block.type === "thinking")
53
+ return _jsx(ReasoningPanel, { text: blockToRow(block).text, worker: block.worker, streaming: streaming, glyphs: glyphs, index: index });
54
+ if (block.type === "assistant")
55
+ return _jsx(AssistantMessage, { text: blockToRow(block).text, worker: block.worker, throughput: throughputLabel(block), streaming: streaming, index: index });
56
+ if (block.type === "image")
57
+ return _jsx(ImageView, { block: block, display: images, index: index });
58
+ // A crew worker's brief keeps its `TASK → <worker>` label row.
59
+ if (block.type === "user" && !block.worker)
60
+ return _jsx(UserMessage, { block: block });
61
+ if (isPanelBlock(block))
62
+ return _jsx(PanelView, { panel: blockPanel(block) });
63
+ return _jsx(RowView, { block: block, index: index });
64
+ }
65
+ function panelColor(theme, tone) {
66
+ switch (tone) {
67
+ case "primary": return theme.colors.primary;
68
+ case "success": return theme.colors.success;
69
+ case "warning": return theme.colors.warning;
70
+ case "error": return theme.colors.error;
71
+ case "info": return theme.colors.info;
72
+ case "muted": return theme.colors.mutedForeground;
73
+ case "text": return theme.colors.foreground;
74
+ }
75
+ }
76
+ /**
77
+ * A crew, goal, review summary, `/why` answer, background job, validation, or
78
+ * checkpoint: a rounded box in its status color, a title row (spinner while it
79
+ * is still changing), then its rows. Text wraps; markers keep their own column.
80
+ */
81
+ function PanelView({ panel }) {
82
+ const theme = useTheme();
83
+ const color = panelColor(theme, panel.tone);
84
+ return (_jsxs("box", { flexDirection: "column", width: "100%", border: true, borderStyle: "rounded", borderColor: color, paddingLeft: 1, paddingRight: 1, children: [_jsxs("box", { flexDirection: "row", width: "100%", flexShrink: 0, children: [panel.live ? _jsx(Spinner, { color: color, flexShrink: 0, marginRight: 1 }) : null, _jsxs("text", { wrapMode: "word", flexGrow: 1, flexShrink: 1, children: [_jsx("span", { fg: color, children: _jsx("b", { children: panel.title }) }), panel.meta ? _jsx("span", { fg: theme.colors.mutedForeground, children: ` ${panel.meta}` }) : null] })] }), panel.lines.map((row, index) => (_jsxs("box", { flexDirection: "row", width: "100%", flexShrink: 0, children: [row.marker === "spinner"
85
+ ? _jsx(Spinner, { color: theme.colors.warning, flexShrink: 0, marginRight: 1 })
86
+ : row.marker
87
+ ? _jsx("text", { fg: panelColor(theme, row.marker.tone), flexShrink: 0, marginRight: 1, children: row.marker.glyph })
88
+ : null, _jsx("text", { fg: panelColor(theme, row.tone), wrapMode: "word", flexGrow: 1, flexShrink: 1, children: row.text || " " })] }, index)))] }));
89
+ }
90
+ /**
91
+ * An attached or tool-produced image: label, name and size, the pixels through
92
+ * OpenTUI's `<image>` (kitty, sixel, or half-block cells, per `display.mode`),
93
+ * then the file path. A file that cannot be read or decoded keeps the caption
94
+ * and says so; it never fails the render.
95
+ */
96
+ function ImageView({ block, display, index }) {
97
+ const theme = useTheme();
98
+ const row = blockToRow(block);
99
+ const { path, width, height } = block.attachment;
100
+ const [failedPath, setFailedPath] = useState();
101
+ // A file URL, never a bare string: OpenTUI fetches strings that look like http(s) URLs.
102
+ const source = useMemo(() => pathToFileURL(path), [path]);
103
+ const failed = failedPath === path;
104
+ const box = imageBox(width, height, display.cols, display.screenRows);
105
+ return (_jsxs(_Fragment, { children: [_jsx("text", { id: chromeId("label", index), fg: toneColor(theme, row.tone), wrapMode: "word", width: "100%", children: _jsx("b", { children: row.label }) }), _jsx("text", { fg: bodyColor(theme, row.tone), wrapMode: "word", width: "100%", children: row.text }), display.mode !== "none" && !failed ? (_jsx("image", { source: source, protocol: display.mode, fit: "fit", width: box.cols, height: box.rows, flexShrink: 0, onError: () => setFailedPath(path) })) : null, failed ? _jsx("text", { id: chromeId("image-failed", index), fg: theme.colors.mutedForeground, wrapMode: "word", width: "100%", children: IMAGE_FAILED_TEXT }) : null, row.detail ? _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "word", width: "100%", children: row.detail }) : null] }));
106
+ }
107
+ /** `CREW CODER` (`· <worker>` in a crew) and its muted throughput (`42.3 tok/s`), then the reply as markdown. */
108
+ function AssistantMessage({ text, worker, throughput, streaming, index }) {
109
+ const theme = useTheme();
110
+ const { markdown } = useAppColors();
111
+ return (_jsxs(_Fragment, { children: [_jsxs("text", { id: chromeId("label", index), fg: theme.colors.success, wrapMode: "none", flexShrink: 0, children: [_jsx("b", { children: "CREW CODER" }), worker ? _jsx("span", { fg: theme.colors.accent, children: ` · ${normalize(worker)}` }) : null, throughput ? _jsx("span", { fg: theme.colors.mutedForeground, children: ` ${throughput}` }) : null] }), _jsx(MarkdownText, { text: text, streaming: streaming, colors: { base: bodyColor(theme, "assistant"), heading: markdown.heading } })] }));
112
+ }
113
+ /**
114
+ * Reasoning after termcn's `thinking-block`: amber single border, bold
115
+ * `💭 Reasoning` header (`∴` where emoji clip), blank row, markdown. Always
116
+ * expanded: thinking summaries must stay visible (event-rendering guardrails).
117
+ */
118
+ function ReasoningPanel({ text, worker, streaming, glyphs, index }) {
119
+ const theme = useTheme();
120
+ return (_jsxs("box", { flexDirection: "column", width: "100%", border: true, borderStyle: "single", borderColor: theme.colors.warning, paddingLeft: 1, paddingRight: 1, children: [_jsxs("text", { id: chromeId("label", index), wrapMode: "none", flexShrink: 0, children: [_jsx("span", { children: `${reasoningIcon(glyphs)} ` }), _jsx("span", { fg: theme.colors.warning, children: _jsx("b", { children: REASONING_LABEL }) }), worker ? _jsx("span", { fg: theme.colors.accent, children: ` · ${normalize(worker)}` }) : null] }), _jsx("box", { marginTop: 1, width: "100%", children: _jsx(MarkdownText, { text: text.trimEnd(), streaming: streaming, colors: { base: theme.colors.foreground, heading: theme.colors.foreground } }) })] }));
121
+ }
122
+ function MarkdownText({ text, streaming, colors }) {
123
+ const theme = useTheme();
124
+ const renderer = useRenderer();
125
+ const style = useMarkdownStyle(theme, colors);
126
+ return (_jsx("markdown", { content: text, syntaxStyle: style, fg: colors.base, width: "100%", streaming: streaming, conceal: true, tableOptions: { borderColor: theme.colors.border, wrapMode: "word", widthMode: "content", cellPaddingX: 1 }, renderBlock: (block, context) => (block.kind === "code" ? codeFence(renderer, theme, context) : undefined) }));
127
+ }
128
+ /**
129
+ * The user's own message: a filled circle (`primary`) left of the text, which wraps
130
+ * under itself, never under the marker. Background context stays muted and
131
+ * separate below (event-rendering guardrails).
132
+ */
133
+ function UserMessage({ block }) {
134
+ const theme = useTheme();
135
+ const row = blockToRow(block);
136
+ return (_jsxs(_Fragment, { children: [_jsxs("box", { flexDirection: "row", width: "100%", flexShrink: 0, children: [_jsx("text", { fg: toneColor(theme, row.tone), flexShrink: 0, marginRight: 1, children: row.label }), _jsx("text", { fg: bodyColor(theme, row.tone), wrapMode: "word", flexGrow: 1, flexShrink: 1, children: row.text || " " })] }), row.detail ? _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "word", width: "100%", paddingLeft: USER_TEXT_INDENT, children: row.detail }) : null] }));
137
+ }
138
+ /** The marker and its space: background context lines up with the message text. */
139
+ const USER_TEXT_INDENT = 2;
140
+ /** Label row, plain text, and optional muted detail. */
141
+ function RowView({ block, index }) {
142
+ const theme = useTheme();
143
+ const row = blockToRow(block);
144
+ return (_jsxs(_Fragment, { children: [_jsx("text", { id: chromeId("label", index), fg: toneColor(theme, row.tone), wrapMode: "word", width: "100%", children: _jsx("b", { children: row.label }) }), row.text ? _jsx("text", { fg: bodyColor(theme, row.tone), wrapMode: "word", width: "100%", children: row.text }) : null, row.detail ? _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "word", width: "100%", children: row.detail }) : null] }));
145
+ }
146
+ /**
147
+ * Consecutive tool calls and approvals in one dashed box titled `Agent work`.
148
+ * Running tools show here live, with a spinner, as soon as they start.
149
+ */
150
+ function AgentWork({ blocks, start, cwd, expansion, glyphs, renderers }) {
151
+ const theme = useTheme();
152
+ // A box holds one worker's tools (transcriptSections splits on a worker change).
153
+ const worker = blocks.map(workerOf).find(Boolean);
154
+ return (_jsx("box", { flexDirection: "column", width: "100%", border: true, customBorderChars: DASHED_BORDER, borderColor: theme.colors.border, title: ` ${AGENT_WORK_TITLE}${worker ? ` · ${normalize(worker)}` : ""} `, titleColor: theme.colors.primary, paddingLeft: 1, paddingRight: 1, children: blocks.map((block, index) => (_jsx("box", { id: blockElementId(start + index), flexDirection: "column", width: "100%", flexShrink: 0, marginTop: index === 0 ? 0 : 1, children: block.type === "tool"
155
+ ? _jsx(ToolEntry, { block: block, index: start + index, cwd: cwd, expansion: expansion, glyphs: glyphs, renderers: renderers })
156
+ : _jsx(ApprovalEntry, { block: block }) }, block.type === "tool" ? (block.id ?? `tool-${index}`) : (block.id ?? `approval-${index}`)))) }));
157
+ }
158
+ /**
159
+ * One tool call: status, highlighted title chip, target, then either the
160
+ * file diff of an edit (`DiffSection`) or its output, collapsed to
161
+ * COLLAPSED_OUTPUT_LINES with a clickable toggle.
162
+ */
163
+ function ToolEntry({ block, index, cwd, expansion, glyphs, renderers }) {
164
+ const theme = useTheme();
165
+ // An extension's declarative renderer replaces the whole view, as in legacy.
166
+ const renderer = findToolRenderer(block, renderers);
167
+ if (renderer)
168
+ return _jsx(RenderedTool, { block: block, renderer: renderer });
169
+ // A CrewCoder-mode plan or clarify step reads from its arguments, never collapsed;
170
+ // its title replaces the tool name and it has no target (that would repeat an argument).
171
+ const workflow = workflowView(block);
172
+ const presented = toolPresentation(block, cwd, glyphs);
173
+ const tool = workflow ? { ...presented, title: workflow.title, target: undefined } : presented;
174
+ const running = block.status === "running";
175
+ const expanded = expansion.isExpanded(block);
176
+ const onToggle = () => expansion.toggle(block);
177
+ const diffs = workflow ? [] : toolDiffs(block, cwd, expansion.lineAnchors(block));
178
+ // An edit's diff replaces its output ("Edited src/a.ts" says nothing more).
179
+ // Only edit/write tools have diffs; commands show their output alone.
180
+ const text = diffs.length > 0 || workflow ? undefined : tool.output;
181
+ // The highlighted title: dark text on a light chip, so each step stands out in the box.
182
+ const chipBg = tool.failed ? theme.colors.error : theme.colors.primary;
183
+ const chipFg = tool.failed ? theme.colors.errorForeground : theme.colors.primaryForeground;
184
+ const output = text ? clampOutput(text, expanded) : undefined;
185
+ const canCollapse = expanded && text !== undefined && clampOutput(text, false).hidden > 0;
186
+ return (_jsxs(_Fragment, { children: [_jsxs("box", { flexDirection: "row", width: "100%", flexShrink: 0, children: [running
187
+ ? _jsx(Spinner, { color: theme.colors.warning, flexShrink: 0 })
188
+ : _jsx("text", { fg: tool.failed ? theme.colors.error : theme.colors.success, flexShrink: 0, children: tool.failed ? "✗" : "✓" }), _jsxs("text", { marginLeft: 1, wrapMode: "word", flexGrow: 1, flexShrink: 1, children: [_jsx("span", { bg: chipBg, fg: chipFg, children: _jsx("b", { children: ` ${tool.icon} ${tool.title || block.name} ` }) }), tool.layout === "inline" && tool.target ? _jsx("span", { fg: theme.colors.accent, children: ` ${tool.target}` }) : null, running ? _jsx("span", { fg: theme.colors.mutedForeground, children: " running\u2026" }) : null, tool.failed ? _jsx("span", { fg: theme.colors.error, children: " failed" }) : null] })] }), tool.layout === "stacked" && tool.target
189
+ ? _jsx("text", { fg: theme.colors.accent, wrapMode: "word", width: "100%", paddingLeft: OUTPUT_INDENT, children: tool.target })
190
+ : null, workflow ? _jsx(WorkflowBody, { view: workflow, index: index, theme: theme }) : null, output ? _jsx(ToolOutput, { lines: output.lines, diff: tool.diff, failed: tool.failed, filetype: tool.filetype, theme: theme }) : null, output ? _jsx(ExpandRow, { id: chromeId("output-toggle", index), hidden: output.hidden, canCollapse: canCollapse, onToggle: onToggle, theme: theme }) : null, diffs.length > 0
191
+ ? _jsx(DiffSection, { index: index, diffs: diffs, shown: expansion.isDiffShown(block), onToggleShown: () => expansion.toggleDiff(block), expanded: expanded, onToggle: onToggle, theme: theme })
192
+ : null] }));
193
+ }
194
+ /**
195
+ * A tool drawn by an extension's template (`renderToolTemplate`, values only; no extension
196
+ * code runs): status, the renderer's title chip and its extension, then the filled-in
197
+ * template as markdown. Not collapsed, as in legacy: the template decides what shows.
198
+ */
199
+ function RenderedTool({ block, renderer }) {
200
+ const theme = useTheme();
201
+ const view = renderedTool(block, renderer);
202
+ const failed = block.status === "error";
203
+ return (_jsxs(_Fragment, { children: [_jsxs("box", { flexDirection: "row", width: "100%", flexShrink: 0, children: [block.status === "running"
204
+ ? _jsx(Spinner, { color: theme.colors.warning, flexShrink: 0 })
205
+ : _jsx("text", { fg: failed ? theme.colors.error : theme.colors.success, flexShrink: 0, children: failed ? "✗" : "✓" }), _jsxs("text", { marginLeft: 1, wrapMode: "word", flexGrow: 1, flexShrink: 1, children: [_jsx("span", { bg: failed ? theme.colors.error : theme.colors.primary, fg: failed ? theme.colors.errorForeground : theme.colors.primaryForeground, children: _jsx("b", { children: ` ${view.title} ` }) }), _jsx("span", { fg: theme.colors.mutedForeground, children: ` ${view.source}` }), block.status === "running" ? _jsx("span", { fg: theme.colors.mutedForeground, children: " running\u2026" }) : null, failed ? _jsx("span", { fg: theme.colors.error, children: " failed" }) : null] })] }), view.body ? (_jsx("box", { width: "100%", paddingLeft: OUTPUT_INDENT, flexShrink: 0, children: _jsx(MarkdownText, { text: view.body, streaming: false, colors: { base: theme.colors.foreground, heading: theme.colors.foreground } }) })) : null] }));
206
+ }
207
+ const FILE_ACTION_TONES = {
208
+ create: (theme) => theme.colors.success,
209
+ delete: (theme) => theme.colors.error,
210
+ modify: (theme) => theme.colors.warning
211
+ };
212
+ /**
213
+ * A plan's sections (Requirements, Investigation, File changes, Plan, Acceptance
214
+ * criteria) or the clarify questions, then the approval hint. Headings and the hint are
215
+ * labels (`chromeId`), so search skips them as `workflowTexts` does.
216
+ */
217
+ function WorkflowBody({ view, index, theme }) {
218
+ return (_jsxs("box", { flexDirection: "column", width: "100%", paddingLeft: OUTPUT_INDENT, flexShrink: 0, children: [view.sections.map((section, at) => (_jsxs("box", { flexDirection: "column", width: "100%", flexShrink: 0, marginTop: at === 0 ? 0 : 1, children: [section.heading ? _jsx("text", { id: chromeId("workflow-heading", `${index}-${at}`), fg: theme.colors.primary, wrapMode: "word", width: "100%", children: _jsx("b", { children: section.heading }) }) : null, section.kind === "text" ? _jsx("text", { fg: theme.colors.foreground, wrapMode: "word", width: "100%", children: section.text }) : null, section.kind === "list" ? section.items.map((item, number) => (_jsx("text", { fg: theme.colors.foreground, wrapMode: "word", width: "100%", children: `${number + 1}. ${item}` }, number))) : null, section.kind === "files" ? section.files.map((file, fileIndex) => (_jsxs("box", { flexDirection: "column", width: "100%", flexShrink: 0, marginTop: fileIndex === 0 ? 0 : 1, children: [_jsxs("text", { wrapMode: "word", width: "100%", children: [_jsx("span", { fg: (FILE_ACTION_TONES[file.action] ?? ((value) => value.colors.info))(theme), children: file.action }), _jsx("span", { fg: theme.colors.accent, children: ` ${file.path}` })] }), file.description ? _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "word", width: "100%", children: file.description }) : null, file.snippet ? _jsx(SnippetView, { snippet: file.snippet, path: file.path, theme: theme }) : null] }, `${file.path}-${fileIndex}`))) : null] }, at))), view.hint ? _jsx("text", { id: chromeId("workflow-hint", index), fg: theme.colors.warning, wrapMode: "word", width: "100%", marginTop: 1, children: view.hint }) : null] }));
219
+ }
220
+ /** A planned change's code, highlighted by its path's language when a parser covers it. */
221
+ function SnippetView({ snippet, path, theme }) {
222
+ const style = useCodeStyle(theme);
223
+ const filetype = codeFiletype(path);
224
+ return (_jsx("box", { width: "100%", border: ["left"], borderStyle: "single", borderColor: theme.colors.border, paddingLeft: 1, flexShrink: 0, children: filetype
225
+ ? _jsx("code", { content: snippet, filetype: filetype, syntaxStyle: style, fg: theme.colors.foreground, wrapMode: "word", width: "100%", conceal: false })
226
+ : _jsx("text", { fg: theme.colors.foreground, wrapMode: "word", width: "100%", children: snippet }) }));
227
+ }
228
+ function ExpandRow({ id, hidden, canCollapse, onToggle, theme }) {
229
+ if (hidden > 0)
230
+ return _jsx(ToggleRow, { id: id, label: `▸ Show ${hidden} more ${hidden === 1 ? "line" : "lines"}`, hint: "toggleToolOutput", onToggle: onToggle, theme: theme });
231
+ return canCollapse ? _jsx(ToggleRow, { id: id, label: "\u25BE Show less", hint: "toggleToolOutput", onToggle: onToggle, theme: theme }) : null;
232
+ }
233
+ /**
234
+ * An edit's file changes inline: a clickable `▾ Diff +3 -1` header that hides
235
+ * or shows them, then one OpenTUI `<diff>` per file. Long diffs collapse to
236
+ * COLLAPSED_OUTPUT_LINES rows like other output.
237
+ */
238
+ function DiffSection({ index, diffs, shown, onToggleShown, expanded, onToggle, theme }) {
239
+ const added = diffs.reduce((sum, diff) => sum + diff.added, 0);
240
+ const removed = diffs.reduce((sum, diff) => sum + diff.removed, 0);
241
+ const multi = diffs.length > 1;
242
+ // Rows: diff lines, plus a file-name row per file when there are several.
243
+ const rows = diffs.reduce((sum, diff) => sum + Math.max(diff.body.length, diff.note ? 1 : 0) + (multi ? 1 : 0), 0);
244
+ const hidden = expanded ? 0 : Math.max(0, rows - COLLAPSED_OUTPUT_LINES);
245
+ const files = multi ? `${diffs.length} files` : (diffs[0] ? fileLabel(diffs[0]) : "");
246
+ return (_jsxs(_Fragment, { children: [_jsxs("text", { id: chromeId("diff-header", index), wrapMode: "none", paddingLeft: OUTPUT_INDENT, flexShrink: 0, onMouseDown: onToggleShown, children: [_jsx("span", { fg: theme.colors.info, children: shown ? "▾ Diff" : "▸ Diff" }), _jsx("span", { fg: theme.colors.success, children: ` +${added}` }), _jsx("span", { fg: theme.colors.error, children: ` -${removed}` }), _jsx("span", { fg: theme.colors.mutedForeground, children: ` ${files}${shown ? "" : ` (click, or ${actionLabel("toggleDiffs")} for all)`}` })] }), shown ? (_jsx("box", { flexDirection: "column", width: "100%", paddingLeft: OUTPUT_INDENT, flexShrink: 0, height: hidden > 0 ? COLLAPSED_OUTPUT_LINES : undefined, overflow: "hidden", children: diffs.map((diff, file) => (_jsxs("box", { flexDirection: "column", width: "100%", flexShrink: 0, children: [multi ? _jsx("text", { id: chromeId("diff-file", `${index}-${file}`), fg: theme.colors.accent, wrapMode: "none", flexShrink: 0, children: fileLabel(diff) }) : null, _jsx(FileDiffView, { diff: diff, theme: theme })] }, `${diff.path}-${file}`))) })) : null, shown ? _jsx(ExpandRow, { id: chromeId("diff-toggle", index), hidden: hidden, canCollapse: expanded && rows > COLLAPSED_OUTPUT_LINES, onToggle: onToggle, theme: theme }) : null] }));
247
+ }
248
+ function fileLabel(diff) {
249
+ return diff.status === "added" ? `${diff.path} (new)` : diff.path;
250
+ }
251
+ /**
252
+ * One file's change: OpenTUI `<diff>` when the line numbers are real, tinted
253
+ * +/- lines otherwise (OpenTUI draws signs in its line-number gutter), or a
254
+ * note for binary and oversized changes.
255
+ */
256
+ function FileDiffView({ diff, theme }) {
257
+ if (diff.note)
258
+ return _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "none", flexShrink: 0, children: `(${diff.note})` });
259
+ if (!diff.exactLines)
260
+ return _jsx(DiffLines, { lines: diff.body, theme: theme });
261
+ return _jsx(HighlightedDiff, { diff: diff, theme: theme });
262
+ }
263
+ /** OpenTUI `<diff>`, highlighted by the edited file's language when a parser covers it. */
264
+ function HighlightedDiff({ diff, theme }) {
265
+ const style = useCodeStyle(theme);
266
+ const { diff: colors } = useAppColors();
267
+ const filetype = codeFiletype(diff.path);
268
+ return (_jsx("diff", { diff: diff.patch, ...(filetype ? { filetype, syntaxStyle: style } : {}), view: "unified", width: "100%", wrapMode: "word", showLineNumbers: true, fg: theme.colors.foreground, addedBg: colors.addedBg, removedBg: colors.removedBg, contextBg: theme.colors.background, addedSignColor: theme.colors.success, removedSignColor: theme.colors.error, lineNumberFg: theme.colors.mutedForeground, lineNumberBg: colors.lineNumberBg, addedLineNumberBg: colors.addedLineNumberBg, removedLineNumberBg: colors.removedLineNumberBg }));
269
+ }
270
+ /** Output starts under the title text, past the status icon and its space. */
271
+ const OUTPUT_INDENT = 2;
272
+ const LINE_TONE_COLORS = {
273
+ added: (theme) => theme.colors.success,
274
+ removed: (theme) => theme.colors.error,
275
+ hunk: (theme) => theme.colors.info,
276
+ plain: (theme) => theme.colors.mutedForeground
277
+ };
278
+ /** Diff lines with their +/- signs, tinted like the `<diff>` rows. */
279
+ function DiffLines({ lines, theme }) {
280
+ const { diff: colors } = useAppColors();
281
+ return (_jsx("box", { flexDirection: "column", width: "100%", flexShrink: 0, children: lines.map((line, index) => {
282
+ const tone = diffLineTone(line);
283
+ const bg = tone === "added" ? colors.addedBg : tone === "removed" ? colors.removedBg : undefined;
284
+ const fg = tone === "plain" ? theme.colors.foreground : LINE_TONE_COLORS[tone](theme);
285
+ return _jsx("text", { fg: fg, bg: bg, width: "100%", wrapMode: "word", flexShrink: 0, children: line || " " }, index);
286
+ }) }));
287
+ }
288
+ function ToolOutput({ lines, diff, failed, filetype, theme }) {
289
+ if (filetype && !failed)
290
+ return _jsx(CodeOutput, { text: lines.join("\n"), filetype: filetype, theme: theme });
291
+ if (!diff || failed) {
292
+ return _jsx("text", { fg: failed ? theme.colors.error : theme.colors.mutedForeground, wrapMode: "word", width: "100%", paddingLeft: OUTPUT_INDENT, children: lines.join("\n") });
293
+ }
294
+ return (_jsx("text", { wrapMode: "word", width: "100%", paddingLeft: OUTPUT_INDENT, children: lines.map((line, index) => (_jsx("span", { fg: LINE_TONE_COLORS[diffLineTone(line)](theme), children: index === lines.length - 1 ? line : `${line}\n` }, index))) }));
295
+ }
296
+ /** A read tool's file contents, highlighted by the read path's language. */
297
+ function CodeOutput({ text, filetype, theme }) {
298
+ const style = useCodeStyle(theme);
299
+ // `<code>` draws its text buffer from its own left edge, so the indent comes from a box.
300
+ return (_jsx("box", { width: "100%", paddingLeft: OUTPUT_INDENT, flexShrink: 0, children: _jsx("code", { content: text, filetype: filetype, syntaxStyle: style, fg: theme.colors.foreground, wrapMode: "word", width: "100%", conceal: false }) }));
301
+ }
302
+ function ToggleRow({ id, label, hint, onToggle, theme }) {
303
+ return (_jsxs("text", { id: id, fg: theme.colors.info, wrapMode: "none", paddingLeft: OUTPUT_INDENT, flexShrink: 0, onMouseDown: onToggle, children: [label, _jsx("span", { fg: theme.colors.mutedForeground, children: ` (click, or ${actionLabel(hint)} for all)` })] }));
304
+ }
305
+ function ApprovalEntry({ block }) {
306
+ const theme = useTheme();
307
+ const name = block.toolName ?? "tool";
308
+ const status = block.status === "pending" ? "waiting for approval" : block.status;
309
+ const color = block.status === "denied" ? theme.colors.error : theme.colors.warning;
310
+ return (_jsxs(_Fragment, { children: [_jsxs("text", { wrapMode: "word", width: "100%", children: [_jsx("span", { fg: color, children: block.status === "pending" ? "⚠" : block.status === "approved" ? "✓" : "✗" }), _jsx("span", { fg: color, children: ` Approval · ${name} · ${status}` })] }), block.resolutionReason
311
+ ? _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "word", width: "100%", paddingLeft: OUTPUT_INDENT, children: normalize(block.resolutionReason) })
312
+ : null] }));
313
+ }
314
+ //# sourceMappingURL=Transcript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transcript.js","sourceRoot":"","sources":["../../src/components/Transcript.tsx"],"names":[],"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CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAQ;gBAC7I,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import { pathToFileURL } from \"node:url\";\nimport type { BorderCharacters, ScrollBoxRenderable } from \"@opentui/core\";\nimport { useRenderer } from \"@opentui/react\";\nimport type { TuiEventBlock } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport { useMemo, useState, type ReactNode, type Ref } from \"react\";\nimport { blockPanel, isPanelBlock, type BlockPanel, type PanelTone } from \"../block-panels.js\";\nimport { reasoningIcon, type GlyphSet } from \"../glyphs.js\";\nimport { useAppColors } from \"../hooks/use-app-colors.js\";\nimport { useGlyphSet } from \"../hooks/use-glyph-set.js\";\nimport { useTheme } from \"../hooks/use-theme.js\";\nimport { codeFence, useCodeStyle, useMarkdownStyle, type MarkdownTextColors } from \"../markdown-style.js\";\nimport { codeFiletype } from \"../syntax/filetype.js\";\nimport { imageBox, type ImageMode } from \"../image-view.js\";\nimport { bodyColor, toneColor } from \"../theme.js\";\nimport { toolDiffs, type FileDiff } from \"../tool-diff.js\";\nimport { clampOutput, COLLAPSED_OUTPUT_LINES, diffLineTone, toolPresentation, type DiffLineTone } from \"../tool-presentation.js\";\nimport { actionLabel, type AppAction } from \"../keybindings.js\";\nimport { blockElementId, chromeId } from \"../search-jump.js\";\nimport { SEARCH_MARKER } from \"../glyphs.js\";\nimport { workflowView, type WorkflowView } from \"../workflow-tools.js\";\nimport { renderedTool } from \"../tool-renderer-view.js\";\nimport { findToolRenderer } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tool-renderers\";\nimport type { TuiRendererHook } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport { blockToRow, isStreaming, normalize, throughputLabel, transcriptSections, workerOf, type ApprovalBlock, type ToolBlock, type ToolExpansion, type WorkBlock } from \"../transcript.js\";\nimport { Spinner } from \"./ui/spinner.js\";\nimport type { Theme } from \"./ui/types.js\";\n\nexport type TranscriptProps = {\n blocks: readonly TuiEventBlock[];\n running: boolean;\n cwd: string;\n expansion: ToolExpansion;\n images: ImageDisplay;\n scrollRef?: Ref<ScrollBoxRenderable>;\n /** Content row of the current search match; a marker points at it from the left margin. */\n markRow?: number;\n /** Extension tool renderers (`crewcoder extension renderers`); a match draws the tool from its template. */\n renderers?: readonly TuiRendererHook[];\n};\n\n/** How image blocks draw: the pixel mode, the columns they may use, and the screen height they are capped against. */\nexport type ImageDisplay = { mode: ImageMode; cols: number; screenRows: number };\n\n/** Shown under an image whose pixels could not be drawn (unreadable or undecodable file). */\nexport const IMAGE_FAILED_TEXT = \"(image could not be drawn)\";\n\n/** Dashed rounded border for the Agent work box. */\nexport const DASHED_BORDER: BorderCharacters = {\n topLeft: \"╭\", topRight: \"╮\", bottomLeft: \"╰\", bottomRight: \"╯\",\n horizontal: \"╌\", vertical: \"╎\",\n topT: \"┬\", bottomT: \"┴\", leftT: \"├\", rightT: \"┤\", cross: \"┼\"\n};\n\nexport const AGENT_WORK_TITLE = \"Agent work\";\nexport const REASONING_LABEL = \"Reasoning\";\n\n/**\n * The whole conversation in a scrollbox that sticks to the bottom while new\n * output arrives and stays put once the user scrolls up (until they scroll back\n * down). Sections follow event order, divided by a blank row.\n */\nexport function Transcript({ blocks, running, cwd, expansion, images, scrollRef, markRow, renderers = [] }: TranscriptProps): ReactNode {\n const theme = useTheme();\n // Emoji icons only where the terminal draws them whole; single-cell symbols elsewhere.\n const glyphs = useGlyphSet();\n const sections = transcriptSections(blocks);\n const lastIndex = blocks.length - 1;\n return (\n <scrollbox\n ref={scrollRef}\n flexGrow={1}\n flexShrink={1}\n width=\"100%\"\n // Clicking the transcript must not take focus from the composer; the wheel still scrolls it.\n focusable={false}\n stickyScroll\n stickyStart=\"bottom\"\n viewportCulling\n contentOptions={{ flexDirection: \"column\", paddingLeft: 1, paddingRight: 1 }}\n verticalScrollbarOptions={{ trackOptions: { foregroundColor: theme.colors.border, backgroundColor: theme.colors.background } }}\n >\n {sections.map((section, index) => (\n <box\n key={`${section.kind}-${section.start}`}\n // Search finds a block by this id (`search-jump.ts`); work entries carry their own.\n {...(section.kind === \"block\" ? { id: blockElementId(section.start) } : {})}\n flexDirection=\"column\"\n width=\"100%\"\n flexShrink={0}\n marginTop={index === 0 ? 0 : 1}\n >\n {section.kind === \"work\"\n ? <AgentWork blocks={section.blocks} start={section.start} cwd={cwd} expansion={expansion} glyphs={glyphs} renderers={renderers} />\n : <BlockView block={section.block} index={section.start} streaming={isStreaming(section.block, section.start === lastIndex, running)} glyphs={glyphs} images={images} />}\n </box>\n ))}\n {/* Last, so the first child stays the content origin; it sits in the content's left padding. */}\n {markRow !== undefined ? (\n <box position=\"absolute\" top={markRow} left={0} width={1} height={1}>\n <text id={chromeId(\"search-mark\")} fg={theme.colors.warning} wrapMode=\"none\"><b>{SEARCH_MARKER}</b></text>\n </box>\n ) : null}\n </scrollbox>\n );\n}\n\nfunction BlockView({ block, index, streaming, glyphs, images }: { block: TuiEventBlock; index: number; streaming: boolean; glyphs: GlyphSet; images: ImageDisplay }): ReactNode {\n if (block.type === \"thinking\") return <ReasoningPanel text={blockToRow(block).text} worker={block.worker} streaming={streaming} glyphs={glyphs} index={index} />;\n if (block.type === \"assistant\") return <AssistantMessage text={blockToRow(block).text} worker={block.worker} throughput={throughputLabel(block)} streaming={streaming} index={index} />;\n if (block.type === \"image\") return <ImageView block={block} display={images} index={index} />;\n // A crew worker's brief keeps its `TASK → <worker>` label row.\n if (block.type === \"user\" && !block.worker) return <UserMessage block={block} />;\n if (isPanelBlock(block)) return <PanelView panel={blockPanel(block)} />;\n return <RowView block={block} index={index} />;\n}\n\nfunction panelColor(theme: Theme, tone: PanelTone): string {\n switch (tone) {\n case \"primary\": return theme.colors.primary;\n case \"success\": return theme.colors.success;\n case \"warning\": return theme.colors.warning;\n case \"error\": return theme.colors.error;\n case \"info\": return theme.colors.info;\n case \"muted\": return theme.colors.mutedForeground;\n case \"text\": return theme.colors.foreground;\n }\n}\n\n/**\n * A crew, goal, review summary, `/why` answer, background job, validation, or\n * checkpoint: a rounded box in its status color, a title row (spinner while it\n * is still changing), then its rows. Text wraps; markers keep their own column.\n */\nfunction PanelView({ panel }: { panel: BlockPanel }): ReactNode {\n const theme = useTheme();\n const color = panelColor(theme, panel.tone);\n return (\n <box flexDirection=\"column\" width=\"100%\" border borderStyle=\"rounded\" borderColor={color} paddingLeft={1} paddingRight={1}>\n <box flexDirection=\"row\" width=\"100%\" flexShrink={0}>\n {panel.live ? <Spinner color={color} flexShrink={0} marginRight={1} /> : null}\n <text wrapMode=\"word\" flexGrow={1} flexShrink={1}>\n <span fg={color}><b>{panel.title}</b></span>\n {panel.meta ? <span fg={theme.colors.mutedForeground}>{` ${panel.meta}`}</span> : null}\n </text>\n </box>\n {panel.lines.map((row, index) => (\n <box key={index} flexDirection=\"row\" width=\"100%\" flexShrink={0}>\n {row.marker === \"spinner\"\n ? <Spinner color={theme.colors.warning} flexShrink={0} marginRight={1} />\n : row.marker\n ? <text fg={panelColor(theme, row.marker.tone)} flexShrink={0} marginRight={1}>{row.marker.glyph}</text>\n : null}\n <text fg={panelColor(theme, row.tone)} wrapMode=\"word\" flexGrow={1} flexShrink={1}>{row.text || \" \"}</text>\n </box>\n ))}\n </box>\n );\n}\n\ntype ImageBlock = Extract<TuiEventBlock, { type: \"image\" }>;\n\n/**\n * An attached or tool-produced image: label, name and size, the pixels through\n * OpenTUI's `<image>` (kitty, sixel, or half-block cells, per `display.mode`),\n * then the file path. A file that cannot be read or decoded keeps the caption\n * and says so; it never fails the render.\n */\nfunction ImageView({ block, display, index }: { block: ImageBlock; display: ImageDisplay; index: number }): ReactNode {\n const theme = useTheme();\n const row = blockToRow(block);\n const { path, width, height } = block.attachment;\n const [failedPath, setFailedPath] = useState<string>();\n // A file URL, never a bare string: OpenTUI fetches strings that look like http(s) URLs.\n const source = useMemo(() => pathToFileURL(path), [path]);\n const failed = failedPath === path;\n const box = imageBox(width, height, display.cols, display.screenRows);\n return (\n <>\n <text id={chromeId(\"label\", index)} fg={toneColor(theme, row.tone)} wrapMode=\"word\" width=\"100%\"><b>{row.label}</b></text>\n <text fg={bodyColor(theme, row.tone)} wrapMode=\"word\" width=\"100%\">{row.text}</text>\n {display.mode !== \"none\" && !failed ? (\n <image\n source={source}\n protocol={display.mode}\n fit=\"fit\"\n width={box.cols}\n height={box.rows}\n flexShrink={0}\n onError={() => setFailedPath(path)}\n />\n ) : null}\n {failed ? <text id={chromeId(\"image-failed\", index)} fg={theme.colors.mutedForeground} wrapMode=\"word\" width=\"100%\">{IMAGE_FAILED_TEXT}</text> : null}\n {row.detail ? <text fg={theme.colors.mutedForeground} wrapMode=\"word\" width=\"100%\">{row.detail}</text> : null}\n </>\n );\n}\n\n/** `CREW CODER` (`· <worker>` in a crew) and its muted throughput (`42.3 tok/s`), then the reply as markdown. */\nfunction AssistantMessage({ text, worker, throughput, streaming, index }: { text: string; worker?: string; throughput?: string; streaming: boolean; index: number }): ReactNode {\n const theme = useTheme();\n const { markdown } = useAppColors();\n return (\n <>\n <text id={chromeId(\"label\", index)} fg={theme.colors.success} wrapMode=\"none\" flexShrink={0}>\n <b>CREW CODER</b>\n {worker ? <span fg={theme.colors.accent}>{` · ${normalize(worker)}`}</span> : null}\n {throughput ? <span fg={theme.colors.mutedForeground}>{` ${throughput}`}</span> : null}\n </text>\n <MarkdownText text={text} streaming={streaming} colors={{ base: bodyColor(theme, \"assistant\"), heading: markdown.heading }} />\n </>\n );\n}\n\n/**\n * Reasoning after termcn's `thinking-block`: amber single border, bold\n * `💭 Reasoning` header (`∴` where emoji clip), blank row, markdown. Always\n * expanded: thinking summaries must stay visible (event-rendering guardrails).\n */\nfunction ReasoningPanel({ text, worker, streaming, glyphs, index }: { text: string; worker?: string; streaming: boolean; glyphs: GlyphSet; index: number }): ReactNode {\n const theme = useTheme();\n return (\n <box flexDirection=\"column\" width=\"100%\" border borderStyle=\"single\" borderColor={theme.colors.warning} paddingLeft={1} paddingRight={1}>\n <text id={chromeId(\"label\", index)} wrapMode=\"none\" flexShrink={0}>\n <span>{`${reasoningIcon(glyphs)} `}</span>\n <span fg={theme.colors.warning}><b>{REASONING_LABEL}</b></span>\n {worker ? <span fg={theme.colors.accent}>{` · ${normalize(worker)}`}</span> : null}\n </text>\n {/* Trailing blank lines between reasoning summaries would only pad the panel. */}\n <box marginTop={1} width=\"100%\">\n <MarkdownText text={text.trimEnd()} streaming={streaming} colors={{ base: theme.colors.foreground, heading: theme.colors.foreground }} />\n </box>\n </box>\n );\n}\n\nfunction MarkdownText({ text, streaming, colors }: { text: string; streaming: boolean; colors: MarkdownTextColors }): ReactNode {\n const theme = useTheme();\n const renderer = useRenderer();\n const style = useMarkdownStyle(theme, colors);\n return (\n <markdown\n content={text}\n syntaxStyle={style}\n fg={colors.base}\n width=\"100%\"\n streaming={streaming}\n conceal\n tableOptions={{ borderColor: theme.colors.border, wrapMode: \"word\", widthMode: \"content\", cellPaddingX: 1 }}\n renderBlock={(block, context) => (block.kind === \"code\" ? codeFence(renderer, theme, context) : undefined)}\n />\n );\n}\n\n/**\n * The user's own message: a filled circle (`primary`) left of the text, which wraps\n * under itself, never under the marker. Background context stays muted and\n * separate below (event-rendering guardrails).\n */\nfunction UserMessage({ block }: { block: Extract<TuiEventBlock, { type: \"user\" }> }): ReactNode {\n const theme = useTheme();\n const row = blockToRow(block);\n return (\n <>\n <box flexDirection=\"row\" width=\"100%\" flexShrink={0}>\n <text fg={toneColor(theme, row.tone)} flexShrink={0} marginRight={1}>{row.label}</text>\n <text fg={bodyColor(theme, row.tone)} wrapMode=\"word\" flexGrow={1} flexShrink={1}>{row.text || \" \"}</text>\n </box>\n {row.detail ? <text fg={theme.colors.mutedForeground} wrapMode=\"word\" width=\"100%\" paddingLeft={USER_TEXT_INDENT}>{row.detail}</text> : null}\n </>\n );\n}\n\n/** The marker and its space: background context lines up with the message text. */\nconst USER_TEXT_INDENT = 2;\n\n/** Label row, plain text, and optional muted detail. */\nfunction RowView({ block, index }: { block: TuiEventBlock; index: number }): ReactNode {\n const theme = useTheme();\n const row = blockToRow(block);\n return (\n <>\n <text id={chromeId(\"label\", index)} fg={toneColor(theme, row.tone)} wrapMode=\"word\" width=\"100%\"><b>{row.label}</b></text>\n {row.text ? <text fg={bodyColor(theme, row.tone)} wrapMode=\"word\" width=\"100%\">{row.text}</text> : null}\n {row.detail ? <text fg={theme.colors.mutedForeground} wrapMode=\"word\" width=\"100%\">{row.detail}</text> : null}\n </>\n );\n}\n\n/**\n * Consecutive tool calls and approvals in one dashed box titled `Agent work`.\n * Running tools show here live, with a spinner, as soon as they start.\n */\nfunction AgentWork({ blocks, start, cwd, expansion, glyphs, renderers }: { blocks: readonly WorkBlock[]; start: number; cwd: string; expansion: ToolExpansion; glyphs: GlyphSet; renderers: readonly TuiRendererHook[] }): ReactNode {\n const theme = useTheme();\n // A box holds one worker's tools (transcriptSections splits on a worker change).\n const worker = blocks.map(workerOf).find(Boolean);\n return (\n <box\n flexDirection=\"column\"\n width=\"100%\"\n border\n customBorderChars={DASHED_BORDER}\n borderColor={theme.colors.border}\n title={` ${AGENT_WORK_TITLE}${worker ? ` · ${normalize(worker)}` : \"\"} `}\n titleColor={theme.colors.primary}\n paddingLeft={1}\n paddingRight={1}\n >\n {blocks.map((block, index) => (\n <box key={block.type === \"tool\" ? (block.id ?? `tool-${index}`) : (block.id ?? `approval-${index}`)} id={blockElementId(start + index)} flexDirection=\"column\" width=\"100%\" flexShrink={0} marginTop={index === 0 ? 0 : 1}>\n {block.type === \"tool\"\n ? <ToolEntry block={block} index={start + index} cwd={cwd} expansion={expansion} glyphs={glyphs} renderers={renderers} />\n : <ApprovalEntry block={block} />}\n </box>\n ))}\n </box>\n );\n}\n\n/**\n * One tool call: status, highlighted title chip, target, then either the\n * file diff of an edit (`DiffSection`) or its output, collapsed to\n * COLLAPSED_OUTPUT_LINES with a clickable toggle.\n */\nfunction ToolEntry({ block, index, cwd, expansion, glyphs, renderers }: { block: ToolBlock; index: number; cwd: string; expansion: ToolExpansion; glyphs: GlyphSet; renderers: readonly TuiRendererHook[] }): ReactNode {\n const theme = useTheme();\n // An extension's declarative renderer replaces the whole view, as in legacy.\n const renderer = findToolRenderer(block, renderers);\n if (renderer) return <RenderedTool block={block} renderer={renderer} />;\n // A CrewCoder-mode plan or clarify step reads from its arguments, never collapsed;\n // its title replaces the tool name and it has no target (that would repeat an argument).\n const workflow = workflowView(block);\n const presented = toolPresentation(block, cwd, glyphs);\n const tool = workflow ? { ...presented, title: workflow.title, target: undefined } : presented;\n const running = block.status === \"running\";\n const expanded = expansion.isExpanded(block);\n const onToggle = (): void => expansion.toggle(block);\n const diffs = workflow ? [] : toolDiffs(block, cwd, expansion.lineAnchors(block));\n // An edit's diff replaces its output (\"Edited src/a.ts\" says nothing more).\n // Only edit/write tools have diffs; commands show their output alone.\n const text = diffs.length > 0 || workflow ? undefined : tool.output;\n // The highlighted title: dark text on a light chip, so each step stands out in the box.\n const chipBg = tool.failed ? theme.colors.error : theme.colors.primary;\n const chipFg = tool.failed ? theme.colors.errorForeground : theme.colors.primaryForeground;\n const output = text ? clampOutput(text, expanded) : undefined;\n const canCollapse = expanded && text !== undefined && clampOutput(text, false).hidden > 0;\n return (\n <>\n <box flexDirection=\"row\" width=\"100%\" flexShrink={0}>\n {running\n ? <Spinner color={theme.colors.warning} flexShrink={0} />\n : <text fg={tool.failed ? theme.colors.error : theme.colors.success} flexShrink={0}>{tool.failed ? \"✗\" : \"✓\"}</text>}\n <text marginLeft={1} wrapMode=\"word\" flexGrow={1} flexShrink={1}>\n <span bg={chipBg} fg={chipFg}><b>{` ${tool.icon} ${tool.title || block.name} `}</b></span>\n {tool.layout === \"inline\" && tool.target ? <span fg={theme.colors.accent}>{` ${tool.target}`}</span> : null}\n {running ? <span fg={theme.colors.mutedForeground}> running…</span> : null}\n {tool.failed ? <span fg={theme.colors.error}> failed</span> : null}\n </text>\n </box>\n {tool.layout === \"stacked\" && tool.target\n ? <text fg={theme.colors.accent} wrapMode=\"word\" width=\"100%\" paddingLeft={OUTPUT_INDENT}>{tool.target}</text>\n : null}\n {workflow ? <WorkflowBody view={workflow} index={index} theme={theme} /> : null}\n {output ? <ToolOutput lines={output.lines} diff={tool.diff} failed={tool.failed} filetype={tool.filetype} theme={theme} /> : null}\n {output ? <ExpandRow id={chromeId(\"output-toggle\", index)} hidden={output.hidden} canCollapse={canCollapse} onToggle={onToggle} theme={theme} /> : null}\n {diffs.length > 0\n ? <DiffSection index={index} diffs={diffs} shown={expansion.isDiffShown(block)} onToggleShown={() => expansion.toggleDiff(block)} expanded={expanded} onToggle={onToggle} theme={theme} />\n : null}\n </>\n );\n}\n\n/**\n * A tool drawn by an extension's template (`renderToolTemplate`, values only; no extension\n * code runs): status, the renderer's title chip and its extension, then the filled-in\n * template as markdown. Not collapsed, as in legacy: the template decides what shows.\n */\nfunction RenderedTool({ block, renderer }: { block: ToolBlock; renderer: TuiRendererHook }): ReactNode {\n const theme = useTheme();\n const view = renderedTool(block, renderer);\n const failed = block.status === \"error\";\n return (\n <>\n <box flexDirection=\"row\" width=\"100%\" flexShrink={0}>\n {block.status === \"running\"\n ? <Spinner color={theme.colors.warning} flexShrink={0} />\n : <text fg={failed ? theme.colors.error : theme.colors.success} flexShrink={0}>{failed ? \"✗\" : \"✓\"}</text>}\n <text marginLeft={1} wrapMode=\"word\" flexGrow={1} flexShrink={1}>\n <span bg={failed ? theme.colors.error : theme.colors.primary} fg={failed ? theme.colors.errorForeground : theme.colors.primaryForeground}><b>{` ${view.title} `}</b></span>\n <span fg={theme.colors.mutedForeground}>{` ${view.source}`}</span>\n {block.status === \"running\" ? <span fg={theme.colors.mutedForeground}> running…</span> : null}\n {failed ? <span fg={theme.colors.error}> failed</span> : null}\n </text>\n </box>\n {view.body ? (\n <box width=\"100%\" paddingLeft={OUTPUT_INDENT} flexShrink={0}>\n <MarkdownText text={view.body} streaming={false} colors={{ base: theme.colors.foreground, heading: theme.colors.foreground }} />\n </box>\n ) : null}\n </>\n );\n}\n\nconst FILE_ACTION_TONES: Readonly<Record<string, (theme: Theme) => string>> = {\n create: (theme) => theme.colors.success,\n delete: (theme) => theme.colors.error,\n modify: (theme) => theme.colors.warning\n};\n\n/**\n * A plan's sections (Requirements, Investigation, File changes, Plan, Acceptance\n * criteria) or the clarify questions, then the approval hint. Headings and the hint are\n * labels (`chromeId`), so search skips them as `workflowTexts` does.\n */\nfunction WorkflowBody({ view, index, theme }: { view: WorkflowView; index: number; theme: Theme }): ReactNode {\n return (\n <box flexDirection=\"column\" width=\"100%\" paddingLeft={OUTPUT_INDENT} flexShrink={0}>\n {view.sections.map((section, at) => (\n <box key={at} flexDirection=\"column\" width=\"100%\" flexShrink={0} marginTop={at === 0 ? 0 : 1}>\n {section.heading ? <text id={chromeId(\"workflow-heading\", `${index}-${at}`)} fg={theme.colors.primary} wrapMode=\"word\" width=\"100%\"><b>{section.heading}</b></text> : null}\n {section.kind === \"text\" ? <text fg={theme.colors.foreground} wrapMode=\"word\" width=\"100%\">{section.text}</text> : null}\n {section.kind === \"list\" ? section.items.map((item, number) => (\n <text key={number} fg={theme.colors.foreground} wrapMode=\"word\" width=\"100%\">{`${number + 1}. ${item}`}</text>\n )) : null}\n {section.kind === \"files\" ? section.files.map((file, fileIndex) => (\n <box key={`${file.path}-${fileIndex}`} flexDirection=\"column\" width=\"100%\" flexShrink={0} marginTop={fileIndex === 0 ? 0 : 1}>\n <text wrapMode=\"word\" width=\"100%\">\n <span fg={(FILE_ACTION_TONES[file.action] ?? ((value: Theme) => value.colors.info))(theme)}>{file.action}</span>\n <span fg={theme.colors.accent}>{` ${file.path}`}</span>\n </text>\n {file.description ? <text fg={theme.colors.mutedForeground} wrapMode=\"word\" width=\"100%\">{file.description}</text> : null}\n {file.snippet ? <SnippetView snippet={file.snippet} path={file.path} theme={theme} /> : null}\n </box>\n )) : null}\n </box>\n ))}\n {view.hint ? <text id={chromeId(\"workflow-hint\", index)} fg={theme.colors.warning} wrapMode=\"word\" width=\"100%\" marginTop={1}>{view.hint}</text> : null}\n </box>\n );\n}\n\n/** A planned change's code, highlighted by its path's language when a parser covers it. */\nfunction SnippetView({ snippet, path, theme }: { snippet: string; path: string; theme: Theme }): ReactNode {\n const style = useCodeStyle(theme);\n const filetype = codeFiletype(path);\n return (\n <box width=\"100%\" border={[\"left\"]} borderStyle=\"single\" borderColor={theme.colors.border} paddingLeft={1} flexShrink={0}>\n {filetype\n ? <code content={snippet} filetype={filetype} syntaxStyle={style} fg={theme.colors.foreground} wrapMode=\"word\" width=\"100%\" conceal={false} />\n : <text fg={theme.colors.foreground} wrapMode=\"word\" width=\"100%\">{snippet}</text>}\n </box>\n );\n}\n\nfunction ExpandRow({ id, hidden, canCollapse, onToggle, theme }: { id: string; hidden: number; canCollapse: boolean; onToggle: () => void; theme: Theme }): ReactNode {\n if (hidden > 0) return <ToggleRow id={id} label={`▸ Show ${hidden} more ${hidden === 1 ? \"line\" : \"lines\"}`} hint=\"toggleToolOutput\" onToggle={onToggle} theme={theme} />;\n return canCollapse ? <ToggleRow id={id} label=\"▾ Show less\" hint=\"toggleToolOutput\" onToggle={onToggle} theme={theme} /> : null;\n}\n\n/**\n * An edit's file changes inline: a clickable `▾ Diff +3 -1` header that hides\n * or shows them, then one OpenTUI `<diff>` per file. Long diffs collapse to\n * COLLAPSED_OUTPUT_LINES rows like other output.\n */\nfunction DiffSection({ index, diffs, shown, onToggleShown, expanded, onToggle, theme }: {\n index: number;\n diffs: readonly FileDiff[];\n shown: boolean;\n onToggleShown: () => void;\n expanded: boolean;\n onToggle: () => void;\n theme: Theme;\n}): ReactNode {\n const added = diffs.reduce((sum, diff) => sum + diff.added, 0);\n const removed = diffs.reduce((sum, diff) => sum + diff.removed, 0);\n const multi = diffs.length > 1;\n // Rows: diff lines, plus a file-name row per file when there are several.\n const rows = diffs.reduce((sum, diff) => sum + Math.max(diff.body.length, diff.note ? 1 : 0) + (multi ? 1 : 0), 0);\n const hidden = expanded ? 0 : Math.max(0, rows - COLLAPSED_OUTPUT_LINES);\n const files = multi ? `${diffs.length} files` : (diffs[0] ? fileLabel(diffs[0]) : \"\");\n return (\n <>\n <text id={chromeId(\"diff-header\", index)} wrapMode=\"none\" paddingLeft={OUTPUT_INDENT} flexShrink={0} onMouseDown={onToggleShown}>\n <span fg={theme.colors.info}>{shown ? \"▾ Diff\" : \"▸ Diff\"}</span>\n <span fg={theme.colors.success}>{` +${added}`}</span>\n <span fg={theme.colors.error}>{` -${removed}`}</span>\n <span fg={theme.colors.mutedForeground}>{` ${files}${shown ? \"\" : ` (click, or ${actionLabel(\"toggleDiffs\")} for all)`}`}</span>\n </text>\n {shown ? (\n <box flexDirection=\"column\" width=\"100%\" paddingLeft={OUTPUT_INDENT} flexShrink={0} height={hidden > 0 ? COLLAPSED_OUTPUT_LINES : undefined} overflow=\"hidden\">\n {diffs.map((diff, file) => (\n <box key={`${diff.path}-${file}`} flexDirection=\"column\" width=\"100%\" flexShrink={0}>\n {multi ? <text id={chromeId(\"diff-file\", `${index}-${file}`)} fg={theme.colors.accent} wrapMode=\"none\" flexShrink={0}>{fileLabel(diff)}</text> : null}\n <FileDiffView diff={diff} theme={theme} />\n </box>\n ))}\n </box>\n ) : null}\n {shown ? <ExpandRow id={chromeId(\"diff-toggle\", index)} hidden={hidden} canCollapse={expanded && rows > COLLAPSED_OUTPUT_LINES} onToggle={onToggle} theme={theme} /> : null}\n </>\n );\n}\n\nfunction fileLabel(diff: FileDiff): string {\n return diff.status === \"added\" ? `${diff.path} (new)` : diff.path;\n}\n\n/**\n * One file's change: OpenTUI `<diff>` when the line numbers are real, tinted\n * +/- lines otherwise (OpenTUI draws signs in its line-number gutter), or a\n * note for binary and oversized changes.\n */\nfunction FileDiffView({ diff, theme }: { diff: FileDiff; theme: Theme }): ReactNode {\n if (diff.note) return <text fg={theme.colors.mutedForeground} wrapMode=\"none\" flexShrink={0}>{`(${diff.note})`}</text>;\n if (!diff.exactLines) return <DiffLines lines={diff.body} theme={theme} />;\n return <HighlightedDiff diff={diff} theme={theme} />;\n}\n\n/** OpenTUI `<diff>`, highlighted by the edited file's language when a parser covers it. */\nfunction HighlightedDiff({ diff, theme }: { diff: FileDiff; theme: Theme }): ReactNode {\n const style = useCodeStyle(theme);\n const { diff: colors } = useAppColors();\n const filetype = codeFiletype(diff.path);\n return (\n <diff\n diff={diff.patch}\n {...(filetype ? { filetype, syntaxStyle: style } : {})}\n view=\"unified\"\n width=\"100%\"\n wrapMode=\"word\"\n showLineNumbers\n fg={theme.colors.foreground}\n addedBg={colors.addedBg}\n removedBg={colors.removedBg}\n contextBg={theme.colors.background}\n addedSignColor={theme.colors.success}\n removedSignColor={theme.colors.error}\n lineNumberFg={theme.colors.mutedForeground}\n lineNumberBg={colors.lineNumberBg}\n addedLineNumberBg={colors.addedLineNumberBg}\n removedLineNumberBg={colors.removedLineNumberBg}\n />\n );\n}\n\n/** Output starts under the title text, past the status icon and its space. */\nconst OUTPUT_INDENT = 2;\n\nconst LINE_TONE_COLORS: Readonly<Record<DiffLineTone, (theme: Theme) => string>> = {\n added: (theme) => theme.colors.success,\n removed: (theme) => theme.colors.error,\n hunk: (theme) => theme.colors.info,\n plain: (theme) => theme.colors.mutedForeground\n};\n\n/** Diff lines with their +/- signs, tinted like the `<diff>` rows. */\nfunction DiffLines({ lines, theme }: { lines: readonly string[]; theme: Theme }): ReactNode {\n const { diff: colors } = useAppColors();\n return (\n <box flexDirection=\"column\" width=\"100%\" flexShrink={0}>\n {lines.map((line, index) => {\n const tone = diffLineTone(line);\n const bg = tone === \"added\" ? colors.addedBg : tone === \"removed\" ? colors.removedBg : undefined;\n const fg = tone === \"plain\" ? theme.colors.foreground : LINE_TONE_COLORS[tone](theme);\n return <text key={index} fg={fg} bg={bg} width=\"100%\" wrapMode=\"word\" flexShrink={0}>{line || \" \"}</text>;\n })}\n </box>\n );\n}\n\nfunction ToolOutput({ lines, diff, failed, filetype, theme }: { lines: readonly string[]; diff: boolean; failed: boolean; filetype?: string; theme: Theme }): ReactNode {\n if (filetype && !failed) return <CodeOutput text={lines.join(\"\\n\")} filetype={filetype} theme={theme} />;\n if (!diff || failed) {\n return <text fg={failed ? theme.colors.error : theme.colors.mutedForeground} wrapMode=\"word\" width=\"100%\" paddingLeft={OUTPUT_INDENT}>{lines.join(\"\\n\")}</text>;\n }\n return (\n <text wrapMode=\"word\" width=\"100%\" paddingLeft={OUTPUT_INDENT}>\n {lines.map((line, index) => (\n <span key={index} fg={LINE_TONE_COLORS[diffLineTone(line)](theme)}>{index === lines.length - 1 ? line : `${line}\\n`}</span>\n ))}\n </text>\n );\n}\n\n/** A read tool's file contents, highlighted by the read path's language. */\nfunction CodeOutput({ text, filetype, theme }: { text: string; filetype: string; theme: Theme }): ReactNode {\n const style = useCodeStyle(theme);\n // `<code>` draws its text buffer from its own left edge, so the indent comes from a box.\n return (\n <box width=\"100%\" paddingLeft={OUTPUT_INDENT} flexShrink={0}>\n {/* Source, not a rendered document: `# Title` and `**bold**` keep their markers (OpenTUI conceals by default). */}\n <code content={text} filetype={filetype} syntaxStyle={style} fg={theme.colors.foreground} wrapMode=\"word\" width=\"100%\" conceal={false} />\n </box>\n );\n}\n\nfunction ToggleRow({ id, label, hint, onToggle, theme }: { id: string; label: string; hint: AppAction; onToggle: () => void; theme: Theme }): ReactNode {\n return (\n <text id={id} fg={theme.colors.info} wrapMode=\"none\" paddingLeft={OUTPUT_INDENT} flexShrink={0} onMouseDown={onToggle}>\n {label}\n <span fg={theme.colors.mutedForeground}>{` (click, or ${actionLabel(hint)} for all)`}</span>\n </text>\n );\n}\n\nfunction ApprovalEntry({ block }: { block: ApprovalBlock }): ReactNode {\n const theme = useTheme();\n const name = block.toolName ?? \"tool\";\n const status = block.status === \"pending\" ? \"waiting for approval\" : block.status;\n const color = block.status === \"denied\" ? theme.colors.error : theme.colors.warning;\n return (\n <>\n <text wrapMode=\"word\" width=\"100%\">\n <span fg={color}>{block.status === \"pending\" ? \"⚠\" : block.status === \"approved\" ? \"✓\" : \"✗\"}</span>\n <span fg={color}>{` Approval · ${name} · ${status}`}</span>\n </text>\n {block.resolutionReason\n ? <text fg={theme.colors.mutedForeground} wrapMode=\"word\" width=\"100%\" paddingLeft={OUTPUT_INDENT}>{normalize(block.resolutionReason)}</text>\n : null}\n </>\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ import { type AlertVariant, type AlertView } from "../../alert-model.js";
3
+ export type { AlertVariant } from "../../alert-model.js";
4
+ export interface AlertProps {
5
+ variant?: AlertVariant;
6
+ view: AlertView;
7
+ }
8
+ export declare function Alert({ variant, view }: AlertProps): ReactNode;
9
+ //# sourceMappingURL=alert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG7F,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AASzD,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,wBAAgB,KAAK,CAAC,EAAE,OAAgB,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,SAAS,CAmBvE"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
+ import { ALERT_ICON_COLUMNS } from "../../alert-model.js";
3
+ import { useTheme } from "../../hooks/use-theme.js";
4
+ const ICONS = {
5
+ error: "✗",
6
+ info: "ℹ",
7
+ success: "✓",
8
+ warning: "⚠"
9
+ };
10
+ export function Alert({ variant = "info", view }) {
11
+ const theme = useTheme();
12
+ const color = variant === "success" ? theme.colors.success
13
+ : variant === "error" ? theme.colors.error
14
+ : variant === "warning" ? theme.colors.warning
15
+ : theme.colors.info;
16
+ return (_jsxs("box", { border: true, borderColor: color, borderStyle: theme.border.style, flexDirection: "column", paddingLeft: 1, paddingRight: 1, flexShrink: 0, children: [view.title.map((line, index) => (_jsxs("box", { flexDirection: "row", height: 1, flexShrink: 0, children: [_jsx("text", { fg: color, wrapMode: "none", width: ALERT_ICON_COLUMNS, flexShrink: 0, children: _jsx("b", { children: index === 0 ? ICONS[variant] : " " }) }), _jsx("text", { fg: color, wrapMode: "none", children: _jsx("b", { children: line }) })] }, `title-${index}`))), view.lines.map((line, index) => (_jsx("text", { fg: theme.colors.foreground, height: 1, wrapMode: "none", flexShrink: 0, children: line || " " }, index)))] }));
17
+ }
18
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,kBAAkB,EAAqC,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,MAAM,KAAK,GAAiC;IAC1C,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;CACb,CAAC;AAOF,MAAM,UAAU,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,EAAc;IAC1D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO;QACxD,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;YACxC,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO;gBAC5C,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,OAAO,CACL,eAAK,MAAM,QAAC,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,aACnI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC/B,eAA4B,aAAa,EAAC,KAAK,EAAC,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,aACtE,eAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAC,MAAM,EAAC,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC,YAAE,sBAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,GAAK,GAAO,EAC7H,eAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAC,MAAM,YAAC,sBAAI,IAAI,GAAK,GAAO,KAF7C,SAAS,KAAK,EAAE,CAGpB,CACP,CAAC,EACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC/B,eAAkB,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,YAAG,IAAI,IAAI,GAAG,IAA1F,KAAK,CAA6F,CAC9G,CAAC,IACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["/* @jsxImportSource @opentui/react */\n// Adapted from termcn (opentui/alert). CrewCoder changes:\n// - The icon/title row sets flexDirection=\"row\"; upstream `<box gap={1}>` stacks\n// them in OpenTUI, whose boxes default to column.\n// - The bordered variant sets `border`; upstream passed only borderColor/style,\n// which draws no border in OpenTUI.\n// - Title and body come pre-wrapped (`alertView`, `alert-model.ts`) and draw as\n// one-row lines, so long text wraps instead of being cut at the border and the\n// height is exactly `alertRows()`, which sizes the footer.\n// - Unused props (custom icon/color/padding/borderless) removed.\nimport type { ReactNode } from \"react\";\nimport { ALERT_ICON_COLUMNS, type AlertVariant, type AlertView } from \"../../alert-model.js\";\nimport { useTheme } from \"../../hooks/use-theme.js\";\n\nexport type { AlertVariant } from \"../../alert-model.js\";\n\nconst ICONS: Record<AlertVariant, string> = {\n error: \"✗\",\n info: \"ℹ\",\n success: \"✓\",\n warning: \"⚠\"\n};\n\nexport interface AlertProps {\n variant?: AlertVariant;\n view: AlertView;\n}\n\nexport function Alert({ variant = \"info\", view }: AlertProps): ReactNode {\n const theme = useTheme();\n const color = variant === \"success\" ? theme.colors.success\n : variant === \"error\" ? theme.colors.error\n : variant === \"warning\" ? theme.colors.warning\n : theme.colors.info;\n return (\n <box border borderColor={color} borderStyle={theme.border.style} flexDirection=\"column\" paddingLeft={1} paddingRight={1} flexShrink={0}>\n {view.title.map((line, index) => (\n <box key={`title-${index}`} flexDirection=\"row\" height={1} flexShrink={0}>\n <text fg={color} wrapMode=\"none\" width={ALERT_ICON_COLUMNS} flexShrink={0}><b>{index === 0 ? ICONS[variant] : \" \"}</b></text>\n <text fg={color} wrapMode=\"none\"><b>{line}</b></text>\n </box>\n ))}\n {view.lines.map((line, index) => (\n <text key={index} fg={theme.colors.foreground} height={1} wrapMode=\"none\" flexShrink={0}>{line || \" \"}</text>\n ))}\n </box>\n );\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ import type { PickerView } from "../../palette-model.js";
3
+ export type { PaletteCommand } from "../../palette-model.js";
4
+ export interface CommandPaletteProps {
5
+ view: PickerView;
6
+ query: string;
7
+ title?: string;
8
+ placeholder?: string;
9
+ /** Shown instead of the list when it is empty. */
10
+ emptyText?: string;
11
+ /** Key hint row; defaults to navigate/select/close. */
12
+ hint?: string;
13
+ }
14
+ export declare function CommandPalette({ view, query, title, placeholder, emptyText, hint }: CommandPaletteProps): ReactNode;
15
+ //# sourceMappingURL=command-palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/ui/command-palette.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,WAAgC,EAAE,SAA+B,EAAE,IAA+C,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAkCzM"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
+ import { useTheme } from "../../hooks/use-theme.js";
3
+ export function CommandPalette({ view, query, title, placeholder = "Search commands…", emptyText = "No commands found", hint = "↑↓ navigate · Enter select · Esc close" }) {
4
+ const theme = useTheme();
5
+ const position = view.total > view.rows.filter((row) => row.kind === "item").length ? ` · ${view.selectedIndex + 1}/${view.total}` : "";
6
+ return (_jsxs("box", { flexDirection: "column", border: true, borderStyle: "rounded", borderColor: theme.colors.focusRing, title: title ? ` ${title} ` : undefined, titleColor: theme.colors.mutedForeground, paddingLeft: 1, paddingRight: 1, children: [_jsxs("box", { flexDirection: "row", border: true, borderStyle: "single", borderColor: theme.colors.border, paddingLeft: 1, paddingRight: 1, flexShrink: 0, children: [_jsx("text", { fg: theme.colors.mutedForeground, children: "\u2318 " }), _jsx("text", { fg: query ? theme.colors.foreground : theme.colors.mutedForeground, children: query || placeholder }), _jsx("text", { fg: theme.colors.focusRing, children: "\u2588" })] }), view.rows.length === 0 ? (_jsx("box", { paddingLeft: 1, paddingRight: 1, height: 1, flexShrink: 0, children: _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "none", children: emptyText }) })) : (view.rows.map((row) => {
7
+ if (row.kind === "header") {
8
+ return _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, children: _jsx("b", { children: row.label }) }, `group:${row.label}`);
9
+ }
10
+ const selected = row.index === view.selectedIndex;
11
+ return (_jsxs("box", { flexDirection: "row", paddingLeft: 1, paddingRight: 1, height: 1, flexShrink: 0, children: [_jsx("text", { fg: selected ? theme.colors.selectionForeground : theme.colors.foreground, bg: selected ? theme.colors.selection : undefined, wrapMode: "none", flexShrink: 0, children: selected ? _jsx("b", { children: row.item.label }) : row.item.label }), row.item.current ? _jsx("text", { fg: theme.colors.focusRing, wrapMode: "none", flexShrink: 0, children: " ●" }) : null, row.item.description ? _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "none", children: ` — ${row.item.description}` }) : null] }, `item:${row.item.id}`));
12
+ })), _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, children: `${hint}${position}` })] }));
13
+ }
14
+ //# sourceMappingURL=command-palette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../../src/components/ui/command-palette.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAgBpD,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,GAAG,kBAAkB,EAAE,SAAS,GAAG,mBAAmB,EAAE,IAAI,GAAG,wCAAwC,EAAuB;IAC5L,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,IA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G,IAAI,GAAQ,CAAC,CAAC,CAAC,IAAI,EACxG,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAE,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAQ,CAAC,CAAC,CAAC,IAAI,KALpH,QAAQ,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,CAMzB,CACP,CAAC;YACJ,CAAC,CAAC,CACH,EACD,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,YAAG,GAAG,IAAI,GAAG,QAAQ,EAAE,GAAQ,IAC3G,CACP,CAAC;AACJ,CAAC","sourcesContent":["/* @jsxImportSource @opentui/react */\n// Adapted from termcn (opentui/command-palette). CrewCoder changes:\n// - Presentation only: App routes keys through DEFAULT_APP_KEYBINDINGS so the\n// palette cannot race the composer or other global handlers.\n// - Uses CrewCoder slate theme tokens instead of hardcoded colors.\n// - Renders a precomputed PickerView (palette-model.ts) so the same component\n// serves every picker, scrolls long lists, and matches footer sizing exactly.\n// - Optional border title and a marker for the current value.\n// - Optional hint row text, for pickers with extra keys (/sessions: Tab branch).\nimport type { ReactNode } from \"react\";\nimport { useTheme } from \"../../hooks/use-theme.js\";\nimport type { PickerView } from \"../../palette-model.js\";\n\nexport type { PaletteCommand } from \"../../palette-model.js\";\n\nexport interface CommandPaletteProps {\n view: PickerView;\n query: string;\n title?: string;\n placeholder?: string;\n /** Shown instead of the list when it is empty. */\n emptyText?: string;\n /** Key hint row; defaults to navigate/select/close. */\n hint?: string;\n}\n\nexport function CommandPalette({ view, query, title, placeholder = \"Search commands…\", emptyText = \"No commands found\", hint = \"↑↓ navigate · Enter select · Esc close\" }: CommandPaletteProps): ReactNode {\n const theme = useTheme();\n const position = view.total > view.rows.filter((row) => row.kind === \"item\").length ? ` · ${view.selectedIndex + 1}/${view.total}` : \"\";\n return (\n <box flexDirection=\"column\" border borderStyle=\"rounded\" borderColor={theme.colors.focusRing} title={title ? ` ${title} ` : undefined} titleColor={theme.colors.mutedForeground} paddingLeft={1} paddingRight={1}>\n <box flexDirection=\"row\" border borderStyle=\"single\" borderColor={theme.colors.border} paddingLeft={1} paddingRight={1} flexShrink={0}>\n <text fg={theme.colors.mutedForeground}>⌘ </text>\n <text fg={query ? theme.colors.foreground : theme.colors.mutedForeground}>{query || placeholder}</text>\n <text fg={theme.colors.focusRing}>█</text>\n </box>\n {view.rows.length === 0 ? (\n <box paddingLeft={1} paddingRight={1} height={1} flexShrink={0}>\n <text fg={theme.colors.mutedForeground} wrapMode=\"none\">{emptyText}</text>\n </box>\n ) : (\n view.rows.map((row) => {\n if (row.kind === \"header\") {\n return <text key={`group:${row.label}`} fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0}><b>{row.label}</b></text>;\n }\n const selected = row.index === view.selectedIndex;\n return (\n <box key={`item:${row.item.id}`} flexDirection=\"row\" paddingLeft={1} paddingRight={1} height={1} flexShrink={0}>\n <text fg={selected ? theme.colors.selectionForeground : theme.colors.foreground} bg={selected ? theme.colors.selection : undefined} wrapMode=\"none\" flexShrink={0}>\n {selected ? <b>{row.item.label}</b> : row.item.label}\n </text>\n {row.item.current ? <text fg={theme.colors.focusRing} wrapMode=\"none\" flexShrink={0}>{\" ●\"}</text> : null}\n {row.item.description ? <text fg={theme.colors.mutedForeground} wrapMode=\"none\">{` — ${row.item.description}`}</text> : null}\n </box>\n );\n })\n )}\n <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0}>{`${hint}${position}`}</text>\n </box>\n );\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export interface ConfirmProps {
2
+ message?: string;
3
+ /** true = the confirm label is highlighted. */
4
+ selected: boolean;
5
+ onConfirm?: () => void;
6
+ onCancel?: () => void;
7
+ confirmLabel?: string;
8
+ cancelLabel?: string;
9
+ variant?: "default" | "danger";
10
+ }
11
+ export declare const Confirm: ({ message, selected, onConfirm, onCancel, confirmLabel, cancelLabel, variant, }: ConfirmProps) => import("react").ReactNode;
12
+ //# sourceMappingURL=confirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/components/ui/confirm.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAChC;AAED,eAAO,MAAM,OAAO,GAAI,iFAQrB,YAAY,8BAqBd,CAAC"}