@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 @@
1
+ {"version":3,"file":"session-controller.js","sourceRoot":"","sources":["../src/session-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAO9B,MAAM,gEAAgE,CAAC;AAExE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,2DAA2D,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD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K,CAAC,cAAc,GAAG,EAAE,CAAC;IACjC,CAAC;IAEO,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,EAAE,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAChC,CAAC;IAEO,MAAM;QACZ,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QAClB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS;YAAE,QAAQ,EAAE,CAAC;IACpD,CAAC;CACF","sourcesContent":["import {\n isCrewCoderRemote,\n parseExtensionRendererRecords,\n type CrewCoderCrewOptions,\n type CrewCoderCrewTarget,\n type CrewCoderEventHandler,\n type CrewCoderProcessOptions,\n type CrewCoderResumeOptions,\n type SessionRecord\n} from \"@onpoint-dev-tools/crewcoder-tui-core/bridge/crewcoder-process\";\nimport type { CrewCoderJsonEvent } from \"@onpoint-dev-tools/crewcoder-tui-core/bridge/event-parser\";\nimport { applyCrewCoderEvent, stopCrew } from \"@onpoint-dev-tools/crewcoder-tui-core/state/event-reducer\";\nimport { readCrewTaskSnapshot } from \"@onpoint-dev-tools/crewcoder-tui-core/state/crew-tasks\";\nimport { createInitialState, normalizeTuiMode, type TuiEventBlock, type TuiState } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport { SidebarController, type TaskReader } from \"./sidebar.js\";\nimport { IDLE_RECALL, sentMessages, stepRecall, type HistoryRecall } from \"./prompt-history.js\";\nimport { attachImagePaths, pasteFromClipboard, systemClipboard, type ClipboardSource } from \"./attachments.js\";\nimport { actionLabel } from \"./keybindings.js\";\nimport { listPathSuggestions, mentionRows, type PathLister } from \"./path-suggestions.js\";\nimport { Mentions, type MentionState } from \"./mentions.js\";\nimport { alertRows, type FooterAlert } from \"./alert-model.js\";\nimport { CommandRunner, type CommandHost, type SummaryEditorState } from \"./command-runner.js\";\nimport { DRAFT_PREFIX, paletteCommands } from \"./commands.js\";\nimport { errorMessage, processCli, type CrewCoderCli, type LoadedSkill } from \"./crewcoder-cli.js\";\nimport { composerRows, type FooterExtras } from \"./footer-layout.js\";\nimport { computeLineAnchors, readLocalFile, type FileReader } from \"./diff-anchors.js\";\nimport type { TerminalRun } from \"./hunk.js\";\nimport type { LineAnchors } from \"./tool-diff.js\";\nimport { pickerEntries, pickerMaxRows, pickerView, type PaletteCommand, type PickerView } from \"./palette-model.js\";\nimport { PickerFlows } from \"./picker-flows.js\";\nimport { PICKER_COMMANDS, type Picker } from \"./pickers.js\";\nimport { TranscriptSearch } from \"./search-controller.js\";\nimport { editGoalField, GOAL_FIELDS, initialGoalForm, selectGoalField, submitGoalForm, type GoalDefaults, type GoalFormState } from \"./goal-form.js\";\nimport { ThemeController } from \"./theme-controller.js\";\nimport { handoffEnv, removeCrewHandoff, tmuxAttachHint, writeCrewHandoff, type TmuxLauncher } from \"./tmux.js\";\nimport type { ToolExpansion } from \"./transcript.js\";\nimport { choiceAnswer, questionChoices, questionContentWidth, questionMaxRows, questionView, type QuestionAnswer, type QuestionBlock, type QuestionView } from \"./question-model.js\";\n\n/** The subset of `CrewCoderProcessBridge` the OpenTUI shell drives. */\nexport type SessionBridge = {\n readonly running: boolean;\n run(options: CrewCoderProcessOptions, onEvent: CrewCoderEventHandler): () => void;\n resume(options: CrewCoderResumeOptions, onEvent: CrewCoderEventHandler): () => void;\n crew(options: CrewCoderCrewOptions, onEvent: CrewCoderEventHandler): () => void;\n followUp(message: string): boolean;\n resolveApproval(approvalId: string, approved: boolean, reason?: string): boolean;\n requestCompactionPreview(): boolean;\n resolveCompactionPreview(previewId: string, approved: boolean, summary?: string): boolean;\n resolveUiRequest(requestId: string, value: QuestionAnswer): boolean;\n stop(): void;\n};\n\ntype PendingApproval = Extract<TuiEventBlock, { type: \"approval\" }>;\ntype PendingCrew = { target: CrewCoderCrewTarget; task: string; command: string };\n\nconst CREW_IN_TMUX = \"tmux\";\nconst CREW_HERE = \"here\";\n\n/** `planner + builder` or `team feature`, for the picker title and tmux names. */\nfunction crewLabel(target: CrewCoderCrewTarget): string {\n return target.kind === \"team\" ? `team ${target.team}` : target.workers.join(\" + \");\n}\ntype ToolBlock = Extract<TuiEventBlock, { type: \"tool\" }>;\n\n/** Summary editor text rows for a terminal height (the editor adds border + hint). */\nexport function summaryEditorTextRows(terminalHeight: number): number {\n return Math.max(3, Math.min(14, terminalHeight - 5));\n}\n\n/**\n * Owns the shared TUI state and the agent bridge for one terminal session.\n * React subscribes through `subscribe`/`getVersion`; the reducer mutates\n * `state` in place, so every change bumps `version` to trigger a render.\n */\nexport class SessionController implements CommandHost {\n readonly state: TuiState;\n readonly cli: CrewCoderCli;\n private readonly bridge: SessionBridge;\n private readonly flows: PickerFlows;\n private readonly commands: CommandRunner;\n private readonly listeners = new Set<() => void>();\n private version = 0;\n private pendingSkills: LoadedSkill[] = [];\n /** The open palette or picker; at most one at a time. */\n picker: Picker | undefined;\n pickerQuery = \"\";\n /** Index into `pickerEntries(picker.items, pickerQuery)`. */\n pickerCursor = 0;\n /** Text a picker wants in the composer; App applies it when `composerDraftVersion` changes. */\n composerDraft = \"\";\n composerDraftVersion = 0;\n private historyRecall: HistoryRecall = IDLE_RECALL;\n /** Visual (wrapped) lines in the composer, reported by App; sizes the footer. */\n composerLines = 1;\n /** Shown above the composer until the next keypress or command. */\n currentAlert: FooterAlert | undefined;\n /** The compaction summary being edited, if any. */\n editor: SummaryEditorState | undefined;\n /** The bare `/goal` preflight form, if open (`goal-form.ts`). */\n goalForm: GoalFormState | undefined;\n /** Hands the terminal to a full-screen program such as Hunk (`/diff`); wired by cli.tsx. */\n runInTerminal: TerminalRun | undefined;\n /** `/repaint`: redraws every cell, discarding whatever else wrote to the terminal; wired by cli.tsx. */\n repaint: (() => void) | undefined;\n /** `/quit`: the same exit as Ctrl+C; wired by cli.tsx. */\n quit: (() => void) | undefined;\n /**\n * Crews in tmux (`docs/CREWS.md#tmux`): the launcher and the command that starts a\n * second UI on a handoff file. Wired by cli.tsx only when tmux is installed and the\n * workspace is local; undefined means /crew and /team run here without asking.\n */\n crewTmux: { launcher: TmuxLauncher; command(handoffFile: string): string[] } | undefined;\n /** A /crew or /team waiting for the \"here or tmux\" choice. */\n private pendingCrew: PendingCrew | undefined;\n /** Ctrl+O: every tool's output expanded. A per-tool toggle flips its own state against this. */\n private allToolsExpanded = false;\n /** Tools toggled individually. Keyed by identity: the reducer mutates blocks in place. */\n private toggledTools = new WeakSet<ToolBlock>();\n /** Ctrl+T: every edit's diff hidden. A per-tool toggle flips its own diff against this. */\n private allDiffsHidden = false;\n private toggledDiffs = new WeakSet<ToolBlock>();\n private readonly anchors = new WeakMap<ToolBlock, LineAnchors>();\n private readonly readFile: FileReader;\n /** Latest composer text, so a draft survives an overlay that unmounts the composer. */\n private composerText = \"\";\n /** Cursor and scroll for the open question; reset when another request opens. */\n private questionNav = { requestId: \"\", cursor: 0, offset: 0 };\n /** `@` path suggestions under the composer (`mentions.ts`). */\n readonly mentions: Mentions;\n private readonly clipboard: ClipboardSource;\n /** The right sidebar (Ctrl+B, `/sidebar`): open state, width, crew tasks. */\n readonly sidebar: SidebarController;\n /** The active theme and `/theme` (preview, apply, saved pick); configured by cli.tsx. */\n readonly themes: ThemeController;\n /** Transcript search (Ctrl+F, `/find`); App scrolls to its current match. */\n readonly search: TranscriptSearch;\n\n constructor(\n bridge: SessionBridge,\n state: TuiState = createInitialState(),\n cli: CrewCoderCli = processCli,\n readFile: FileReader = readLocalFile,\n // null, not undefined: an explicit undefined would take this default.\n listPaths: PathLister | null = isCrewCoderRemote() ? null : listPathSuggestions,\n clipboard: ClipboardSource = systemClipboard,\n // The task store lives on the workspace's disk; remote workspaces are not local.\n readTasks: TaskReader | null = isCrewCoderRemote() ? null : readCrewTaskSnapshot\n ) {\n this.sidebar = new SidebarController(this, readTasks);\n this.themes = new ThemeController(this);\n this.search = new TranscriptSearch(this);\n this.clipboard = clipboard;\n this.bridge = bridge;\n this.state = state;\n this.cli = cli;\n this.readFile = readFile;\n this.mentions = new Mentions(listPaths, {\n cwd: () => this.state.cwd,\n changed: () => this.notify(),\n failed: (error) => this.alert({ variant: \"error\", title: \"Could not list workspace paths\", body: errorMessage(error) })\n });\n this.flows = new PickerFlows(this);\n this.commands = new CommandRunner(this, this.flows);\n // The legacy help tip refers to slash commands this preview does not ship yet.\n this.state.blocks = [];\n }\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n };\n\n getVersion = (): number => this.version;\n\n /** The open `@` list, when the composer cursor is in an `@token`. */\n get mention(): MentionState | undefined {\n return this.mentions.current;\n }\n\n get bridgeRunning(): boolean {\n return this.bridge.running;\n }\n\n // ── Pickers ────────────────────────────────────────────────────────────────\n\n /** Ctrl+P: open the command palette, or close it when open. The composer draft survives. */\n togglePalette(): void {\n if (this.picker?.kind === \"commands\") return this.closePicker();\n this.preserveComposerDraft();\n this.openCommandPalette();\n }\n\n /** Tab / Ctrl+I: the modes and saved workers picker (the legacy agents overlay). */\n openModesPicker(): void {\n this.preserveComposerDraft();\n this.flows.open(\"mode\");\n }\n\n openCommandPalette(): void {\n this.openPicker({ kind: \"commands\", placeholder: \"Search commands…\", emptyText: \"No commands found\", items: paletteCommands(this.state.integrationProfile), loading: false });\n }\n\n /** A small picker whose items are commands or `draft:` texts (see commands.ts). */\n openMenu(title: string, items: PaletteCommand[], load?: () => Promise<PaletteCommand[]>): void {\n const menu: Picker = { kind: \"menu\", title, placeholder: \"Search…\", emptyText: \"Nothing to pick\", items, loading: load !== undefined };\n if (load) this.flows.load(menu, load);\n else this.openPicker(menu);\n }\n\n /** Show a picker. Replacing a loading picker of the same kind keeps the query and a moved cursor. */\n openPicker(next: Picker): void {\n if (this.picker?.kind === \"theme\" && next.kind !== \"theme\") this.themes.endPreview();\n const refresh = this.picker?.kind === next.kind && this.picker.loading;\n if (!refresh) this.pickerQuery = \"\";\n if (!refresh || this.pickerCursor === 0) {\n const current = pickerEntries(next.items, this.pickerQuery).findIndex((item) => item.current);\n this.pickerCursor = Math.max(0, current);\n }\n this.picker = next;\n this.notify();\n }\n\n closePicker(): void {\n if (!this.picker) return;\n // Esc on \"where should the crew run\" cancels the crew.\n if (this.picker.kind === \"crewLaunch\") this.pendingCrew = undefined;\n // Leaving /theme without Enter keeps the applied theme (a no-op after Enter applied one).\n if (this.picker.kind === \"theme\") this.themes.endPreview();\n this.picker = undefined;\n this.pickerQuery = \"\";\n this.pickerCursor = 0;\n this.notify();\n }\n\n setPickerQuery(query: string): void {\n if (!this.picker) return;\n this.pickerQuery = query;\n this.pickerCursor = 0;\n this.previewHighlightedTheme();\n this.notify();\n }\n\n movePickerCursor(delta: number): void {\n if (!this.picker) return;\n const count = pickerEntries(this.picker.items, this.pickerQuery).length;\n this.pickerCursor = Math.max(0, Math.min(Math.max(0, count - 1), this.pickerCursor + delta));\n this.previewHighlightedTheme();\n this.notify();\n }\n\n /** In /theme the highlighted theme is shown live; Esc returns to the applied one. */\n private previewHighlightedTheme(): void {\n if (this.picker?.kind !== \"theme\") return;\n this.themes.preview(pickerEntries(this.picker.items, this.pickerQuery)[this.pickerCursor]?.id);\n }\n\n /** Apply the highlighted item. Async choices report failures as error alerts. */\n selectPickerItem(): void {\n const picker = this.picker;\n if (!picker) return;\n const item = pickerEntries(picker.items, this.pickerQuery)[this.pickerCursor];\n if (!item) return;\n if (picker.kind === \"theme\") {\n // Applied synchronously before closing, so the old theme never flashes back for a frame.\n const applied = this.flows.select(\"theme\", item.id);\n this.closePicker();\n applied.then(\n () => this.notify(),\n (error: unknown) => this.alert({ variant: \"error\", title: `Could not apply theme ${item.id}`, body: errorMessage(error) })\n );\n return;\n }\n if (picker.kind === \"crewLaunch\") {\n const pending = this.pendingCrew;\n this.closePicker();\n if (!pending) return;\n if (item.id === CREW_IN_TMUX) void this.runCrewInTmux(pending);\n else this.startCrew(pending.target, pending.task, pending.command);\n return;\n }\n this.closePicker();\n if (picker.kind === \"commands\" || picker.kind === \"menu\") {\n if (item.id.startsWith(DRAFT_PREFIX)) this.setComposerDraft(item.id.slice(DRAFT_PREFIX.length));\n else this.submit(item.id);\n return;\n }\n this.flows.select(picker.kind, item.id).then(\n () => this.notify(),\n (error: unknown) => this.alert({ variant: \"error\", title: \"Could not apply that choice\", body: errorMessage(error) })\n );\n }\n\n /** Tab in /sessions: branch the highlighted session and open the branch. */\n branchPickerItem(): void {\n const picker = this.picker;\n if (picker?.kind !== \"session\" || picker.loading) return;\n const item = pickerEntries(picker.items, this.pickerQuery)[this.pickerCursor];\n if (!item) return;\n this.closePicker();\n this.flows.branch(item.id).then(\n () => this.notify(),\n (error: unknown) => this.alert({ variant: \"error\", title: \"Could not branch the session\", body: errorMessage(error) })\n );\n }\n\n pickerView(terminalHeight: number): PickerView | undefined {\n return this.picker ? pickerView(this.picker.items, this.pickerQuery, this.pickerCursor, pickerMaxRows(terminalHeight)) : undefined;\n }\n\n /**\n * Rows the alert and composer take; the welcome screen hides the logo when they do not\n * fit. `alertWidth` is the alert box's width, since long alert text wraps.\n */\n footerExtras(alertWidth: number): FooterExtras {\n return {\n alertRows: alertRows(this.currentAlert, alertWidth),\n composerRows: composerRows(this.composerLines),\n mentionRows: this.mention ? mentionRows(this.mention.items.length) : 0,\n attachmentRows: this.state.attachments.length > 0 ? 1 : 0\n };\n }\n\n // ── Image attachments ────────────────────────────────────────────────────────────\n\n /**\n * Ctrl+V: attach a clipboard image (or image files the clipboard text names)\n * and return undefined, or return clipboard text for the composer. Remote\n * mode attaches nothing: local files cannot reach the SSH host yet.\n */\n pasteClipboard(): string | undefined {\n if (isCrewCoderRemote()) {\n const text = this.clipboard.text();\n if (!text && this.clipboard.image()) this.alert({ variant: \"warning\", title: \"Images are not available in remote SSH mode\" });\n return text;\n }\n let result: ReturnType<typeof pasteFromClipboard>;\n try {\n result = pasteFromClipboard(this.clipboard, this.state.attachments);\n } catch (error) {\n this.alert({ variant: \"error\", title: \"Could not attach the clipboard image\", body: errorMessage(error) });\n return undefined;\n }\n if (result.attached.length > 0) {\n this.state.attachments = [...this.state.attachments, ...result.attached];\n this.notify();\n }\n return result.text;\n }\n\n /** Ctrl+X: drop the pending images; false when there were none. */\n clearAttachments(): boolean {\n if (this.state.attachments.length === 0) return false;\n this.state.attachments = [];\n this.notify();\n return true;\n }\n\n // ── Tool output ───────────────────────────────────────────────────────────────\n\n readonly toolExpansion: ToolExpansion = {\n isExpanded: (block) => this.allToolsExpanded !== this.toggledTools.has(block),\n toggle: (block) => this.flip(this.toggledTools, block),\n isDiffShown: (block) => this.allDiffsHidden === this.toggledDiffs.has(block),\n toggleDiff: (block) => this.flip(this.toggledDiffs, block),\n lineAnchors: (block) => this.anchors.get(block)\n };\n\n /**\n * Number a finished edit's diff with real file lines, read once from the\n * local workspace (remote files are not readable here; those diffs stay plain).\n */\n private anchorEdit(toolCallId: unknown): void {\n {\n if (typeof toolCallId !== \"string\" || isCrewCoderRemote()) return;\n const block = this.state.blocks.find((candidate): candidate is ToolBlock => candidate.type === \"tool\" && candidate.id === toolCallId);\n // The agent's snapshot diffs (file_diff, before tool_execution_end) already carry real line numbers.\n if (!block || block.fileDiffs?.length) return;\n computeLineAnchors(block, this.state.cwd, this.readFile).then((anchors) => {\n if (!anchors) return;\n this.anchors.set(block, anchors);\n this.notify();\n }, () => undefined);\n }\n }\n\n /**\n * Extension tool renderers (`docs/TRANSCRIPT.md#extension-tool-renderers`): declarative\n * templates from `crewcoder extension renderers --json`, through the injectable CLI so\n * remote mode asks the SSH host. Loaded at startup and by `/reload`; a failure keeps the\n * previous list (tools then draw as usual) and says why.\n */\n async loadExtensionRenderers(): Promise<void> {\n try {\n const { stdout, stderr, exitCode } = await this.cli.exec([\"extension\", \"renderers\", \"--json\"]);\n if (exitCode !== 0) throw new Error(stderr.trim() || `extension renderers exited with code ${exitCode}`);\n this.state.rendererHooks = parseExtensionRendererRecords(JSON.parse(stdout || \"[]\"));\n this.notify();\n } catch (error) {\n this.alert({ variant: \"warning\", title: \"Could not load extension tool renderers\", body: errorMessage(error) });\n }\n }\n\n /**\n * Ctrl+F / `/find [text]`: search the transcript. The bar takes the composer's\n * place, so the draft is kept; there is nothing to search on the welcome screen.\n */\n openSearch(query = \"\"): void {\n if (this.state.blocks.length === 0) return this.alert({ variant: \"info\", title: \"Nothing to search yet\" });\n this.preserveComposerDraft();\n this.search.open(query);\n }\n\n /** Hide or show every edit's diff, resetting per-tool diff toggles. */\n toggleAllDiffs(): void {\n this.allDiffsHidden = !this.allDiffsHidden;\n this.toggledDiffs = new WeakSet();\n this.notify();\n }\n\n private flip(set: WeakSet<ToolBlock>, block: ToolBlock): void {\n if (set.has(block)) set.delete(block);\n else set.add(block);\n this.notify();\n }\n\n /** Expand or collapse every tool's output, resetting individual toggles. */\n toggleAllToolOutput(): void {\n this.allToolsExpanded = !this.allToolsExpanded;\n this.toggledTools = new WeakSet();\n this.notify();\n }\n\n // ── Extension questions ────────────────────────────────────────────────────\n\n /**\n * The extension question waiting for an answer: the oldest pending\n * `extension_ui` request of the active run. Only a running agent can receive\n * the answer, so none shows once the run is over.\n */\n question(): QuestionBlock | undefined {\n if (!this.bridge.running) return undefined;\n return this.state.blocks.find((block): block is QuestionBlock => block.type === \"extension_ui\" && block.status === \"pending\" && block.requestId !== \"\");\n }\n\n questionView(terminalHeight: number, terminalWidth: number): QuestionView | undefined {\n const block = this.question();\n if (!block) return undefined;\n const nav = this.navFor(block);\n return questionView(block, questionContentWidth(terminalWidth), questionMaxRows(terminalHeight), nav.cursor, nav.offset);\n }\n\n /** Move between choices (confirm, select, component), wrapping at either end. */\n moveQuestionCursor(delta: number): void {\n const block = this.question();\n if (!block) return;\n const count = questionChoices(block).length;\n if (count === 0) return;\n const nav = this.navFor(block);\n this.questionNav = { ...nav, cursor: (((nav.cursor + delta) % count) + count) % count };\n this.notify();\n }\n\n /** Scroll a question that is too long for the card; the view clamps the offset. */\n scrollQuestion(delta: number, terminalHeight: number, terminalWidth: number): void {\n const block = this.question();\n if (!block) return;\n const nav = this.navFor(block);\n const applied = this.questionView(terminalHeight, terminalWidth)?.offset ?? nav.offset;\n this.questionNav = { ...nav, offset: Math.max(0, applied + delta) };\n this.notify();\n }\n\n /** Answer with the highlighted choice (Enter on confirm, select, or component). */\n submitQuestionChoice(): void {\n const block = this.question();\n if (block) this.answerQuestion(choiceAnswer(block, this.navFor(block).cursor));\n }\n\n /** Answer with a clicked choice. */\n chooseQuestion(choice: number): void {\n const block = this.question();\n if (block) this.answerQuestion(choiceAnswer(block, choice));\n }\n\n /**\n * Send the answer over the `ui_response` control channel; `null` cancels.\n * The block is settled locally at once so the card closes; the agent's\n * `extension_ui_resolved` confirms it.\n */\n answerQuestion(value: QuestionAnswer): void {\n const block = this.question();\n if (!block) return;\n if (!this.bridge.resolveUiRequest(block.requestId, value)) {\n this.state.blocks.push({ type: \"error\", text: \"No active CrewCoder run is waiting for this extension question.\" });\n }\n block.status = value === null ? \"cancelled\" : \"answered\";\n if (value !== null) block.answer = typeof value === \"boolean\" ? (value ? \"yes\" : \"no\") : value;\n this.notify();\n }\n\n private navFor(block: QuestionBlock): { requestId: string; cursor: number; offset: number } {\n return this.questionNav.requestId === block.requestId ? this.questionNav : { requestId: block.requestId, cursor: 0, offset: 0 };\n }\n\n // ── Alerts, composer, editor ───────────────────────────────────────────────\n\n alert(alert: FooterAlert): void {\n this.currentAlert = alert;\n this.notify();\n }\n\n dismissAlert(): void {\n if (!this.currentAlert) return;\n this.currentAlert = undefined;\n this.notify();\n }\n\n setComposerDraft(text: string): void {\n this.composerDraft = text;\n this.composerDraftVersion += 1;\n this.notify();\n }\n\n /** The composer's current text; restored as a draft after an overlay closes. */\n setComposerText(text: string): void {\n this.composerText = text;\n }\n\n /** Keep the composer draft when an overlay that unmounts it opens on its own. */\n private preserveComposerDraft(): void {\n if (this.composerText) this.setComposerDraft(this.composerText);\n }\n\n /**\n * Up/Down on the composer's first/last line: the text of the older/newer\n * sent message (or the saved draft), or undefined when there is nothing\n * further that way. See `prompt-history.ts`.\n */\n recallPrompt(direction: \"up\" | \"down\", current: string): string | undefined {\n const step = stepRecall(this.historyRecall, direction, current, sentMessages(this.state.blocks));\n if (!step) return undefined;\n this.historyRecall = step.recall;\n return step.text;\n }\n\n setComposerLines(lines: number): void {\n const next = Math.max(1, lines);\n if (next === this.composerLines) return;\n this.composerLines = next;\n this.notify();\n }\n\n // ── /goal preflight form ─────────────────────────────────────────────────────\n\n /** Bare `/goal`: settings for this goal only, prefilled from `config.goals`. The draft is kept. */\n openGoalForm(defaults: GoalDefaults): void {\n this.preserveComposerDraft();\n this.picker = undefined;\n this.goalForm = initialGoalForm(defaults);\n this.notify();\n }\n\n selectGoalField(index: number): void {\n if (!this.goalForm) return;\n this.goalForm = selectGoalField(this.goalForm, index);\n this.notify();\n }\n\n moveGoalField(delta: number): void {\n if (this.goalForm) this.selectGoalField(this.goalForm.selected + delta);\n }\n\n editGoalField(value: string): void {\n if (!this.goalForm) return;\n this.goalForm = editGoalField(this.goalForm, value);\n this.notify();\n }\n\n /** Enter: the next field, or start the goal from the last one (legacy). */\n goalFormEnter(): void {\n if (!this.goalForm) return;\n if (this.goalForm.selected < GOAL_FIELDS.length - 1) this.moveGoalField(1);\n else this.submitGoalForm();\n }\n\n /** Ctrl+S: start the goal, or show what is wrong on that field. */\n submitGoalForm(): void {\n if (!this.goalForm) return;\n const result = submitGoalForm(this.goalForm);\n if (\"form\" in result) {\n this.goalForm = result.form;\n this.notify();\n return;\n }\n this.goalForm = undefined;\n this.notify();\n this.commands.startGoal(result.start).then(\n () => this.notify(),\n (error: unknown) => this.alert({ variant: \"error\", title: \"Could not start the goal\", body: errorMessage(error) })\n );\n }\n\n closeGoalForm(): void {\n if (!this.goalForm) return;\n this.goalForm = undefined;\n this.notify();\n }\n\n openSummaryEditor(editor: SummaryEditorState): void {\n this.picker = undefined;\n this.editor = editor;\n this.currentAlert = undefined;\n this.notify();\n }\n\n /** Apply (with the edited text) or cancel the open compaction summary editor. */\n resolveSummary(approved: boolean, summary: string): void {\n const editor = this.editor;\n if (!editor) return;\n this.editor = undefined;\n const context = editor.context;\n if (context.mode === \"live\") {\n if (!this.bridge.resolveCompactionPreview(context.previewId, approved, approved ? summary : undefined)) {\n this.alert({ variant: \"error\", title: \"No active run is waiting for this compaction preview\" });\n } else {\n this.alert(approved ? { variant: \"success\", title: \"Edited summary sent to the running session\" } : { variant: \"info\", title: \"Compaction preview cancelled\" });\n }\n return;\n }\n if (!approved) {\n this.alert({ variant: \"info\", title: \"Compaction preview cancelled\" });\n return;\n }\n this.commands.applyEditedSummary(context.sessionId, summary).then(\n () => this.notify(),\n (error: unknown) => this.alert({ variant: \"error\", title: \"Could not apply the edited summary\", body: errorMessage(error) })\n );\n }\n\n requestLiveCompactionPreview(): boolean {\n return this.bridge.requestCompactionPreview();\n }\n\n clearScreen(): void {\n this.search.close();\n this.state.blocks = [];\n this.currentAlert = undefined;\n this.notify();\n }\n\n // ── Session ────────────────────────────────────────────────────────────────\n\n /** Start, resume, or queue a follow-up for the active run. */\n submit(input: string): void {\n // A sent message ends any recall; the next Up starts from the newest again.\n this.historyRecall = IDLE_RECALL;\n const text = input.trim();\n // A pasted screenshot can be sent on its own.\n if (!text && this.state.attachments.length === 0) return;\n if (text.startsWith(\"/\")) {\n this.runCommand(text);\n this.notify();\n return;\n }\n if (this.bridge.running) {\n // The control channel carries text only; pending images wait for the next prompt.\n if (!text) return this.alert({ variant: \"info\", title: \"Images are sent with the next prompt, after this turn\" });\n if (!this.queueFollowUp(text)) this.alert({ variant: \"error\", title: \"Could not queue the follow-up for the active run\" });\n return;\n }\n // Image paths in the prompt (a file dropped on the terminal) attach too; the text keeps them.\n if (!isCrewCoderRemote()) this.state.attachments = [...this.state.attachments, ...attachImagePaths(text, this.state.attachments)];\n this.startRun(text);\n }\n\n startPrompt(text: string): void {\n this.startRun(text);\n }\n\n /**\n * `/crew` and `/team`. With tmux available (local workspaces), first ask where the\n * crew runs: here (quitting stops it) or in tmux (keeps running after this UI\n * closes). Without tmux it runs here.\n */\n launchCrew(target: CrewCoderCrewTarget, task: string, command: string): void {\n if (this.refuseBusyCrew()) return;\n if (!this.crewTmux || isCrewCoderRemote()) return this.startCrew(target, task, command);\n this.preserveComposerDraft();\n this.pendingCrew = { target, task, command };\n this.openPicker({\n kind: \"crewLaunch\",\n title: `Where should ${crewLabel(target)} run?`,\n placeholder: \"Search…\",\n emptyText: \"Nothing to pick\",\n loading: false,\n items: [\n // Short: picker rows do not wrap.\n { id: CREW_IN_TMUX, label: \"Run in tmux\", description: \"survives closing CrewCoder; attach to approve\" },\n { id: CREW_HERE, label: \"Run here\", description: \"quitting CrewCoder stops the crew\" }\n ]\n });\n }\n\n /**\n * Hand the crew to a second UI in tmux. Its settings and `CREWCODER_*` variables go\n * in a private handoff file the new UI reads and deletes (`tmux.ts`).\n */\n private async runCrewInTmux(pending: PendingCrew): Promise<void> {\n const tmux = this.crewTmux;\n if (!tmux || this.refuseBusyCrew()) return;\n const state = this.state;\n let file: string | undefined;\n try {\n file = writeCrewHandoff({\n version: 1, ...pending, cwd: state.cwd, provider: state.provider, model: state.model, effort: state.effort,\n mode: state.mode, systemPrompt: state.systemPrompt, fullAccess: state.fullAccess, env: handoffEnv(process.env)\n });\n const placement = await tmux.launcher.launch(tmux.command(file), state.cwd, crewLabel(pending.target));\n // A record that outlives the next keypress: the attach command is needed later.\n state.blocks.push({ type: \"user\", text: pending.command });\n state.blocks.push({ type: \"system\", text: tmuxAttachHint(placement) });\n this.notify();\n } catch (error) {\n if (file) removeCrewHandoff(file);\n this.alert({ variant: \"error\", title: \"Could not start the crew in tmux\", body: errorMessage(error) });\n }\n }\n\n private refuseBusyCrew(): boolean {\n if (!this.bridge.running && !this.state.running) return false;\n this.alert({ variant: \"warning\", title: \"Wait for the current run to finish before starting a crew\", body: \"Use /stop to end it.\" });\n return true;\n }\n\n /**\n * `/crew` and `/team`: stream the crew through the bridge so its roster, each\n * worker's work, and approvals show live. Workers run in their own sessions;\n * this session's id and transcript stay. `command` is what the user typed.\n */\n startCrew(target: CrewCoderCrewTarget, task: string, command: string): void {\n if (this.refuseBusyCrew()) return;\n const state = this.state;\n state.blocks.push({ type: \"user\", text: command });\n state.running = true;\n // The AGENTS roster lives in the sidebar; a crew is the moment to show it.\n if (!this.sidebar.open) this.sidebar.setOpen(true);\n // The agent's crew commands take no worker, budget, image, or directory options.\n const options: CrewCoderCrewOptions = {\n target,\n prompt: task,\n provider: state.provider,\n mode: state.mode,\n model: state.model,\n systemPrompt: state.systemPrompt,\n effort: state.effort,\n cwd: state.cwd,\n approval: state.fullAccess ? \"full-access\" : \"review\"\n };\n try {\n this.bridge.crew(options, this.onEvent);\n } catch (error) {\n state.running = false;\n this.alert({ variant: \"error\", title: \"Could not start the crew\", body: errorMessage(error) });\n return;\n }\n this.notify();\n }\n\n queueFollowUp(text: string): boolean {\n if (!this.bridge.followUp(text)) return false;\n this.state.blocks.push({ type: \"user\", text, background: [\"Queued follow-up for the running turn.\"] });\n this.notify();\n return true;\n }\n\n /** Resolve a pending approval (the latest by default) over the live control channel. */\n resolveApproval(approvalId: string | undefined, approved: boolean): void {\n const id = approvalId ?? this.pendingApproval()?.id;\n const verb = approved ? \"approve\" : \"deny\";\n if (!id) return this.alert({ variant: \"warning\", title: `No pending approval to ${verb}` });\n if (!this.bridge.running) return this.alert({ variant: \"warning\", title: \"No active run is waiting for approval\" });\n const reason = approved ? \"Approved from OpenTUI control channel.\" : \"Denied from OpenTUI control channel.\";\n if (!this.bridge.resolveApproval(id, approved, reason)) this.alert({ variant: \"error\", title: `Could not ${verb} ${id}` });\n this.notify();\n }\n\n /** The approval card buttons and Ctrl+Y / Ctrl+N. */\n resolvePendingApproval(approved: boolean): boolean {\n const pending = this.pendingApproval();\n if (!pending?.id || !this.bridge.running) return false;\n const reason = approved ? \"Approved from OpenTUI control channel.\" : \"Denied from OpenTUI control channel.\";\n const resolved = this.bridge.resolveApproval(pending.id, approved, reason);\n if (!resolved) this.state.blocks.push({ type: \"error\", text: `Could not ${approved ? \"approve\" : \"deny\"} ${pending.id}.` });\n this.notify();\n return resolved;\n }\n\n pendingApproval(): PendingApproval | undefined {\n for (let index = this.state.blocks.length - 1; index >= 0; index--) {\n const block = this.state.blocks[index];\n if (block?.type === \"approval\" && block.status === \"pending\") return block;\n }\n return undefined;\n }\n\n /** Abort the active run. Returns false when nothing was running. */\n abort(): boolean {\n if (!this.bridge.running && !this.state.running) return false;\n this.bridge.stop();\n // A stopped crew sends no crew_end; finish its roster here.\n stopCrew(this.state);\n this.state.running = false;\n this.state.blocks.push({ type: \"system\", text: \"Request aborted.\" });\n this.notify();\n return true;\n }\n\n push(block: TuiEventBlock): void {\n this.state.blocks.push(block);\n this.notify();\n }\n\n changed(): void {\n this.notify();\n }\n\n attachSkill(skill: LoadedSkill): void {\n if (this.pendingSkills.some((attached) => attached.name === skill.name)) {\n this.alert({ variant: \"info\", title: `Skill already attached: ${skill.name}`, body: \"It goes with your next message.\" });\n return;\n }\n this.pendingSkills.push(skill);\n this.alert({ variant: \"success\", title: `Skill attached: ${skill.name}`, body: `Goes with your next message (${this.pendingSkills.length} attached).` });\n }\n\n /** Load a saved session's history with its provider, model, effort, mode, and directories. */\n resumeSession(session: SessionRecord): void {\n this.bridge.stop();\n this.search.close();\n const state = this.state;\n this.resetCrew();\n state.blocks = [];\n state.changedFiles = [];\n state.systemPrompt = undefined;\n state.worker = undefined;\n if (session.provider) state.provider = session.provider;\n if (session.model) state.model = session.model;\n // A saved level the resumed model rejects (e.g. xhigh) must not ride along.\n state.effort = PickerFlows.resumeEffort(state, session.effort);\n state.externalDirectories = [...(session.externalDirectories ?? [])];\n const mode = session.requestedMode || session.resolvedMode;\n if (mode) state.mode = normalizeTuiMode(mode);\n state.sessionId = session.id;\n state.running = true;\n this.notify();\n this.bridge.resume({ ...this.runOptions(), sessionId: session.id }, this.onEvent);\n }\n\n dispose(): void {\n this.sidebar.dispose();\n this.bridge.stop();\n this.listeners.clear();\n }\n\n private readonly onEvent = (event: CrewCoderJsonEvent): void => {\n const questionOpen = this.question() !== undefined;\n applyCrewCoderEvent(this.state, event);\n if (event.type === \"tool_execution_end\") this.anchorEdit(event.toolCallId);\n // Task tools write the store; a finished run may have moved the branch or dirtied the tree.\n if (this.sidebar.open && (event.type === \"tool_execution_end\" || event.type === \"agent_end\")) void this.sidebar.refreshTasks();\n if (event.type === \"agent_end\") void this.sidebar.refreshGitLabel();\n // An extension question replaces the footer, picker included; keep what the user was typing.\n if (event.type === \"extension_ui_request\" && !questionOpen && this.question()) {\n this.preserveComposerDraft();\n this.picker = undefined;\n this.pickerQuery = \"\";\n this.pickerCursor = 0;\n }\n // A live /compact preview: the loop paused for the user to edit the summary.\n if (event.type === \"session_compaction_preview\" && typeof event.previewId === \"string\" && typeof event.summary === \"string\") {\n this.preserveComposerDraft();\n this.openSummaryEditor({\n summary: event.summary,\n context: { mode: \"live\", previewId: event.previewId },\n source: typeof event.source === \"string\" ? event.source : undefined,\n originalMessageCount: typeof event.originalMessageCount === \"number\" ? event.originalMessageCount : undefined,\n retainedMessageCount: typeof event.retainedMessageCount === \"number\" ? event.retainedMessageCount : undefined\n });\n return;\n }\n this.notify();\n };\n\n private runOptions(): Omit<CrewCoderProcessOptions, \"prompt\"> {\n const state = this.state;\n return {\n provider: state.provider,\n mode: state.mode,\n worker: state.worker,\n model: state.model,\n systemPrompt: state.systemPrompt,\n effort: state.effort,\n cwd: state.cwd,\n approval: state.fullAccess ? \"full-access\" : \"review\",\n budget: state.tokenBudget,\n externalDirectories: state.externalDirectories\n };\n }\n\n private startRun(text: string): void {\n const attachments = this.state.attachments;\n if (attachments.length > 0 && isCrewCoderRemote()) {\n this.alert({ variant: \"error\", title: \"Local images cannot be sent in remote SSH mode\", body: `Clear them with ${actionLabel(\"clearAttachments\")} and send the prompt again.` });\n return;\n }\n this.state.blocks.push({ type: \"user\", text: text || \"(image attached)\" });\n // Each image shows under the user turn; the agent gets the files as --image.\n for (const attachment of attachments) this.state.blocks.push({ type: \"image\", attachment });\n this.state.attachments = [];\n this.state.running = true;\n const prompt = this.withPendingSkills(text);\n const images = attachments.map((attachment) => attachment.path);\n this.notify();\n if (this.state.sessionId && this.state.sessionId !== \"new\") {\n this.bridge.resume({ ...this.runOptions(), prompt, images, sessionId: this.state.sessionId }, this.onEvent);\n return;\n }\n this.bridge.run({ ...this.runOptions(), prompt, images }, this.onEvent);\n }\n\n /** Skills from /skills ride ahead of the next prompt once; the transcript shows only the typed text. */\n private withPendingSkills(prompt: string): string {\n if (!this.pendingSkills.length) return prompt;\n const skills = this.pendingSkills.map((skill) => `# Skill: ${skill.name}\\n${skill.description}\\n\\n${skill.body}`).join(\"\\n\\n\");\n this.pendingSkills = [];\n return `The user attached the following skill(s). Follow their instructions when relevant to the request below.\\n\\n${skills}\\n\\n---\\n\\n${prompt}`;\n }\n\n private runCommand(command: string): void {\n const match = /^(\\S+)\\s*([\\s\\S]*)$/.exec(command);\n const name = match?.[1] ?? command;\n const rest = match?.[2] ?? \"\";\n if (name === \"/new\") return this.newSession();\n if (name === \"/stop\") {\n if (!this.abort()) this.alert({ variant: \"info\", title: \"Nothing is running\" });\n return;\n }\n const kind = Object.hasOwn(PICKER_COMMANDS, name) ? PICKER_COMMANDS[name] : undefined;\n if (kind && rest.trim()) {\n this.flows.applyArgument(kind, rest.trim()).then(\n () => this.notify(),\n (error: unknown) => this.alert({ variant: \"error\", title: name, body: errorMessage(error) })\n );\n return;\n }\n if (kind) return this.flows.open(kind);\n if (this.commands.run(name, rest)) return;\n this.alert({\n variant: \"warning\",\n title: `${name} is not available in OpenTUI yet`,\n body: \"Use the legacy UI (crewcoder-tui) or the agent CLI for it.\"\n });\n }\n\n /** Crews belong to the session they ran from: a stopped one is finished, its workers forgotten. */\n private resetCrew(): void {\n stopCrew(this.state);\n this.state.crewWorkers = [];\n this.state.crewSessionIds = [];\n }\n\n private newSession(): void {\n this.bridge.stop();\n this.search.close();\n this.resetCrew();\n this.state.sessionId = \"new\";\n this.state.blocks = [];\n this.state.running = false;\n this.state.changedFiles = [];\n this.state.checkpoints = [];\n this.state.usage = { turns: 0 };\n this.state.externalDirectories = [];\n this.state.tokenBudget = undefined;\n this.state.fullAccess = false;\n this.state.attachments = [];\n this.pendingSkills = [];\n this.editor = undefined;\n this.currentAlert = undefined;\n }\n\n private notify(): void {\n this.version += 1;\n for (const listener of this.listeners) listener();\n }\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import { type CrewTaskSnapshot } from "@onpoint-dev-tools/crewcoder-tui-core/state/crew-tasks";
2
+ import type { TuiState } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
3
+ export { wrapCells } from "./text-wrap.js";
4
+ /**
5
+ * The right sidebar, ported from the legacy `RightSidebar`/`TaskWidget`: safety
6
+ * status, modified files, live crew agents, and crew tasks from the top, and
7
+ * the `<cwd>:<git>` workspace with the brand anchored at the bottom. Pure, so
8
+ * the rows the component draws are exactly the rows tested here.
9
+ */
10
+ /** Below this many terminal columns the sidebar is hidden (its open/closed setting is kept). */
11
+ export declare const MIN_SIDEBAR_TERMINAL_WIDTH = 60;
12
+ export declare const MIN_SIDEBAR_WIDTH = 18;
13
+ export declare const MAX_SIDEBAR_WIDTH = 60;
14
+ /** The conversation keeps at least this many columns when the divider is dragged. */
15
+ export declare const MIN_MAIN_WIDTH = 32;
16
+ /** Left inset of section text; one cell stays free on the right. */
17
+ export declare const SIDEBAR_INSET = 2;
18
+ export type SidebarTone = "heading" | "taskHeading" | "count" | "text" | "muted" | "subtle" | "success" | "warning" | "error" | "active" | "rule" | "brand";
19
+ export type SidebarSpan = {
20
+ text: string;
21
+ tone: SidebarTone;
22
+ bold?: boolean;
23
+ strike?: boolean;
24
+ };
25
+ /** One terminal row. Never wider than the sidebar. */
26
+ export type SidebarRow = readonly SidebarSpan[];
27
+ export type SidebarState = Pick<TuiState, "cwd" | "remoteTarget" | "gitLabel" | "changedFiles" | "showFileChanges" | "crewWorkers" | "safetyPolicies" | "sessionId" | "crewSessionIds">;
28
+ export type SidebarInput = {
29
+ state: SidebarState;
30
+ /** The crew task store; `undefined` where it cannot be read (remote SSH workspaces). */
31
+ tasks: CrewTaskSnapshot | undefined;
32
+ /** Spinner frame for running workers. */
33
+ spinner: string;
34
+ /** Local home directory, shortened to `~` in the footer; omit for remote workspaces. */
35
+ home?: string;
36
+ };
37
+ /** Sidebar columns for a terminal width; 0 when the terminal is too narrow for one. */
38
+ export declare function sidebarWidth(terminalWidth: number, preferred?: number): number;
39
+ /** Keep a dragged width inside the sidebar bounds and leave the conversation room. */
40
+ export declare function clampSidebarWidth(width: number, terminalWidth: number): number;
41
+ /** Exactly `height` rows (blank rows pad the gap above the footer). */
42
+ export declare function sidebarRows(input: SidebarInput, width: number, height: number): SidebarRow[];
43
+ /** Cut to `width` cells with a trailing `…`. */
44
+ export declare function truncateCells(value: string, width: number): string;
45
+ //# sourceMappingURL=sidebar-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"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OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAgB5F;AAmKD,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASlE"}
@@ -0,0 +1,223 @@
1
+ import { prioritizedTasks, sessionDisplayNumbers, taskBlocked, taskLabel, tasksForSessions } from "@onpoint-dev-tools/crewcoder-tui-core/state/crew-tasks";
2
+ import stringWidth from "string-width";
3
+ import { relativePath } from "./tool-presentation.js";
4
+ import { normalize } from "./transcript.js";
5
+ import { wrapCells } from "./text-wrap.js";
6
+ export { wrapCells } from "./text-wrap.js";
7
+ /**
8
+ * The right sidebar, ported from the legacy `RightSidebar`/`TaskWidget`: safety
9
+ * status, modified files, live crew agents, and crew tasks from the top, and
10
+ * the `<cwd>:<git>` workspace with the brand anchored at the bottom. Pure, so
11
+ * the rows the component draws are exactly the rows tested here.
12
+ */
13
+ /** Below this many terminal columns the sidebar is hidden (its open/closed setting is kept). */
14
+ export const MIN_SIDEBAR_TERMINAL_WIDTH = 60;
15
+ export const MIN_SIDEBAR_WIDTH = 18;
16
+ export const MAX_SIDEBAR_WIDTH = 60;
17
+ /** The conversation keeps at least this many columns when the divider is dragged. */
18
+ export const MIN_MAIN_WIDTH = 32;
19
+ /** Left inset of section text; one cell stays free on the right. */
20
+ export const SIDEBAR_INSET = 2;
21
+ /** Sidebar columns for a terminal width; 0 when the terminal is too narrow for one. */
22
+ export function sidebarWidth(terminalWidth, preferred) {
23
+ if (terminalWidth < MIN_SIDEBAR_TERMINAL_WIDTH)
24
+ return 0;
25
+ return clampSidebarWidth(preferred ?? Math.min(36, Math.max(20, Math.floor(terminalWidth * 0.26))), terminalWidth);
26
+ }
27
+ /** Keep a dragged width inside the sidebar bounds and leave the conversation room. */
28
+ export function clampSidebarWidth(width, terminalWidth) {
29
+ const maximum = Math.max(MIN_SIDEBAR_WIDTH, Math.min(MAX_SIDEBAR_WIDTH, terminalWidth - MIN_MAIN_WIDTH - 1));
30
+ return Math.max(MIN_SIDEBAR_WIDTH, Math.min(maximum, Math.round(width)));
31
+ }
32
+ /** Exactly `height` rows (blank rows pad the gap above the footer). */
33
+ export function sidebarRows(input, width, height) {
34
+ if (width <= 0 || height <= 0)
35
+ return [];
36
+ const footer = workspaceRows(input, width);
37
+ const contentHeight = Math.max(0, height - footer.length);
38
+ const status = statusRows(input.state.safetyPolicies, width);
39
+ const agents = agentRows(input.state.crewWorkers, input.spinner, width, height);
40
+ const fixed = [
41
+ ...(status.length ? [...status, rule(width)] : []),
42
+ ...fileRows(input.state, width, height),
43
+ rule(width),
44
+ ...(agents.length ? [...agents, rule(width)] : [])
45
+ ];
46
+ const taskRows = crewTaskRows(input, width, Math.max(0, contentHeight - fixed.length));
47
+ const content = [...fixed, ...taskRows].slice(0, contentHeight);
48
+ while (content.length < contentHeight)
49
+ content.push([]);
50
+ return [...content, ...footer].slice(0, height);
51
+ }
52
+ function statusRows(policies, width) {
53
+ if (!policies.length)
54
+ return [];
55
+ const label = "SAFETY ";
56
+ const lines = wrapCells(safetySummary(policies), textWidth(width) - label.length);
57
+ return [
58
+ heading("STATUS", "1", width),
59
+ ...lines.map((line, index) => index === 0
60
+ ? [inset(), { text: "SAFETY", tone: "muted", bold: true }, { text: " ", tone: "muted" }, { text: line, tone: "warning" }]
61
+ : [inset(SIDEBAR_INSET + label.length), { text: line, tone: "warning" }])
62
+ ];
63
+ }
64
+ function safetySummary(policies) {
65
+ const blocks = policies.filter((policy) => policy.action === "block").length;
66
+ const reviews = policies.filter((policy) => policy.action === "review").length;
67
+ return [String(policies.length), blocks ? `${blocks} block` : "", reviews ? `${reviews} review` : ""].filter(Boolean).join(" · ");
68
+ }
69
+ /** Newest files last; when they do not all fit, the newest stay and the rest are counted. */
70
+ function fileRows(state, width, height) {
71
+ const files = state.changedFiles;
72
+ const rows = [heading("MODIFIED FILES", state.showFileChanges ? String(files.length) : "off", width)];
73
+ if (!state.showFileChanges)
74
+ return [...rows, ...text("Display disabled", "muted", width), ...text("/file-changes on", "subtle", width)];
75
+ if (!files.length)
76
+ return [...rows, ...text("✓ No file changes", "success", width)];
77
+ const budget = Math.max(3, Math.min(9, Math.floor(height * 0.3)));
78
+ const shown = [];
79
+ let firstShown = files.length;
80
+ for (let index = files.length - 1; index >= 0; index--) {
81
+ const item = itemRows(relativePath(normalize(files[index] ?? ""), state.cwd), "●", "warning", "text", width);
82
+ // Keep a row for "… N more" while older files remain.
83
+ if (rows.length + shown.length + item.length + (index > 0 ? 1 : 0) > budget)
84
+ break;
85
+ shown.unshift(...item);
86
+ firstShown = index;
87
+ }
88
+ const more = firstShown > 0 ? text(`… ${firstShown} more`, "muted", width) : [];
89
+ return [...rows, ...shown, ...more];
90
+ }
91
+ /** Shown only while a crew is live; a finished crew does not linger here. */
92
+ function agentRows(workers, spinner, width, height) {
93
+ if (!workers.some((worker) => worker.status === "running" || worker.status === "pending"))
94
+ return [];
95
+ const rank = { running: 0, pending: 1, failed: 2, completed: 3 };
96
+ const ordered = [...workers].sort((left, right) => rank[left.status] - rank[right.status]);
97
+ const running = ordered.filter((worker) => worker.status === "running").map((worker) => normalize(worker.name));
98
+ const budget = Math.max(2, Math.min(8, Math.floor(height * 0.25)));
99
+ const rows = [heading(`AGENTS: ${running.length ? running.join(", ") : "waiting"}`, "", width)];
100
+ let shown = 0;
101
+ for (const [index, worker] of ordered.entries()) {
102
+ const style = WORKER_STYLES[worker.status];
103
+ const item = itemRows(`${normalize(worker.name)} ${style.label}`, worker.status === "running" ? spinner : style.icon, style.tone, "text", width);
104
+ if (rows.length + item.length + (index < ordered.length - 1 ? 1 : 0) > budget)
105
+ break;
106
+ rows.push(...item);
107
+ shown += 1;
108
+ }
109
+ if (ordered.length > shown)
110
+ rows.push(...text(`… ${ordered.length - shown} more`, "muted", width));
111
+ return rows;
112
+ }
113
+ const WORKER_STYLES = {
114
+ running: { icon: "", tone: "active", label: "running" },
115
+ pending: { icon: "□", tone: "muted", label: "queued" },
116
+ completed: { icon: "✓", tone: "success", label: "completed" },
117
+ failed: { icon: "✕", tone: "error", label: "failed" }
118
+ };
119
+ /** Most crew tasks fit; the store is reread by the controller, never here. */
120
+ const MAX_VISIBLE_TASKS = 9;
121
+ function crewTaskRows(input, width, height) {
122
+ if (height <= 0)
123
+ return [];
124
+ if (!input.tasks)
125
+ return [taskHeading(undefined, width), ...text("Not shown for SSH workspaces", "muted", width)].slice(0, height);
126
+ if (!input.tasks.enabled)
127
+ return [];
128
+ // Crew workers record tasks under their own sessions; they belong to this one.
129
+ const tasks = tasksForSessions(input.tasks.tasks, [input.state.sessionId, ...input.state.crewSessionIds]);
130
+ const done = tasks.filter((task) => task.status === "completed").length;
131
+ const rows = [taskHeading({ done, total: tasks.length }, width)];
132
+ if (!tasks.length)
133
+ return [...rows, ...text("No tasks for this session", "muted", width)].slice(0, height);
134
+ const numbers = sessionDisplayNumbers(tasks);
135
+ const candidates = prioritizedTasks(tasks).slice(0, Math.max(3, Math.min(MAX_VISIBLE_TASKS, tasks.length)));
136
+ let shown = 0;
137
+ for (const [index, task] of candidates.entries()) {
138
+ const item = taskRows(task, numbers.get(task.id) ?? 1, width);
139
+ if (rows.length + item.length + (index < tasks.length - 1 ? 1 : 0) > height)
140
+ break;
141
+ rows.push(...item);
142
+ shown += 1;
143
+ }
144
+ if (tasks.length > shown)
145
+ rows.push(...text(`… ${tasks.length - shown} more`, "muted", width));
146
+ return rows.slice(0, height);
147
+ }
148
+ function taskHeading(progress, width) {
149
+ const full = progress ? ` — ${progress.done}/${progress.total} completed` : "";
150
+ const counts = progress && stringWidth(`CREW TASKS${full}`) > textWidth(width) ? ` ${progress.done}/${progress.total}` : full;
151
+ const label = truncateCells("CREW TASKS", Math.max(1, textWidth(width) - stringWidth(counts)));
152
+ return [inset(), { text: label, tone: "taskHeading", bold: true }, { text: truncateCells(counts, textWidth(width) - stringWidth(label)), tone: "count" }];
153
+ }
154
+ /** `◉ 2. Writing tests`: active, `○` queued, `!` blocked, `✓` done (struck through). */
155
+ function taskRows(task, number, width) {
156
+ const blocked = taskBlocked(task);
157
+ const completed = task.status === "completed";
158
+ const active = task.status === "in_progress";
159
+ const icon = completed ? "✓" : active ? "◉" : blocked ? "!" : "○";
160
+ const iconTone = completed ? "success" : active || blocked ? "warning" : "muted";
161
+ const labelTone = completed ? "muted" : active ? "warning" : "text";
162
+ const prefix = `${icon} ${number}. `;
163
+ const lines = wrapCells(normalize(taskLabel(task)), textWidth(width) - stringWidth(prefix));
164
+ return lines.map((line, index) => index === 0
165
+ ? [inset(), { text: icon, tone: iconTone }, { text: " ", tone: "text" }, { text: `${number}.`, tone: completed ? "subtle" : "warning", bold: true }, { text: " ", tone: "text" }, { text: line, tone: labelTone, bold: active, strike: completed }]
166
+ : [inset(SIDEBAR_INSET + stringWidth(prefix)), { text: line, tone: labelTone, bold: active, strike: completed }]);
167
+ }
168
+ /** Rule, `<cwd>:<git>` (wrapped, never truncated), a gap, and the brand. */
169
+ function workspaceRows(input, width) {
170
+ const { cwd, remoteTarget, gitLabel } = input.state;
171
+ const home = input.home;
172
+ const location = remoteTarget
173
+ ? `${remoteTarget}:${cwd}`
174
+ : home && (cwd === home || cwd.startsWith(`${home}/`)) ? `~${cwd.slice(home.length)}` : cwd;
175
+ const workspace = `${normalize(location)}:${gitLabel ? normalize(gitLabel) : "local"}`;
176
+ return [
177
+ rule(width),
178
+ ...text(workspace, gitLabel ? "text" : "muted", width),
179
+ [],
180
+ [inset(), { text: "•", tone: "brand" }, { text: " ", tone: "text" }, { text: "CrewCoder", tone: "text", bold: true }]
181
+ ];
182
+ }
183
+ function heading(label, count, width) {
184
+ const room = Math.max(1, textWidth(width) - (count ? stringWidth(count) + 1 : 0));
185
+ const row = [inset(), { text: truncateCells(label, room), tone: "heading", bold: true }];
186
+ return count ? [...row, { text: ` ${count}`, tone: "count" }] : row;
187
+ }
188
+ /** An icon, then text that wraps under itself. */
189
+ function itemRows(value, icon, iconTone, tone, width) {
190
+ const iconWidth = Math.max(1, stringWidth(icon));
191
+ return wrapCells(value, textWidth(width) - iconWidth - 1).map((line, index) => index === 0
192
+ ? [inset(), { text: icon, tone: iconTone }, { text: " ", tone: "text" }, { text: line, tone }]
193
+ : [inset(SIDEBAR_INSET + iconWidth + 1), { text: line, tone }]);
194
+ }
195
+ /** Plain section text; wraps, never truncates. */
196
+ function text(value, tone, width) {
197
+ return wrapCells(value, textWidth(width)).map((line) => [inset(), { text: line, tone }]);
198
+ }
199
+ function rule(width) {
200
+ return [{ text: "─".repeat(width), tone: "rule" }];
201
+ }
202
+ function inset(cells = SIDEBAR_INSET) {
203
+ return { text: " ".repeat(cells), tone: "text" };
204
+ }
205
+ function textWidth(width) {
206
+ return Math.max(1, width - SIDEBAR_INSET - 1);
207
+ }
208
+ const graphemes = new Intl.Segmenter(undefined, { granularity: "grapheme" });
209
+ /** Cut to `width` cells with a trailing `…`. */
210
+ export function truncateCells(value, width) {
211
+ if (stringWidth(value) <= width)
212
+ return value;
213
+ if (width <= 0)
214
+ return "";
215
+ let out = "";
216
+ for (const { segment } of graphemes.segment(value)) {
217
+ if (stringWidth(out) + stringWidth(segment) + 1 > width)
218
+ break;
219
+ out += segment;
220
+ }
221
+ return `${out}…`;
222
+ }
223
+ //# sourceMappingURL=sidebar-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-model.js","sourceRoot":"","sources":["../src/sid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AC,KAAK,GAAG,aAAa;IAClC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACnD,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC;AAE7E,gDAAgD;AAChD,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,KAAa;IACxD,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IAC9C,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAC1B,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACnD,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK;YAAE,MAAM;QAC/D,GAAG,IAAI,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,GAAG,GAAG,GAAG,CAAC;AACnB,CAAC","sourcesContent":["import {\n prioritizedTasks, sessionDisplayNumbers, taskBlocked, taskLabel, tasksForSessions,\n type CrewTaskRecord, type CrewTaskSnapshot\n} from \"@onpoint-dev-tools/crewcoder-tui-core/state/crew-tasks\";\nimport type { TuiCrewWorker, TuiSafetyPolicy, TuiState } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport stringWidth from \"string-width\";\nimport { relativePath } from \"./tool-presentation.js\";\nimport { normalize } from \"./transcript.js\";\nimport { wrapCells } from \"./text-wrap.js\";\n\nexport { wrapCells } from \"./text-wrap.js\";\n\n/**\n * The right sidebar, ported from the legacy `RightSidebar`/`TaskWidget`: safety\n * status, modified files, live crew agents, and crew tasks from the top, and\n * the `<cwd>:<git>` workspace with the brand anchored at the bottom. Pure, so\n * the rows the component draws are exactly the rows tested here.\n */\n\n/** Below this many terminal columns the sidebar is hidden (its open/closed setting is kept). */\nexport const MIN_SIDEBAR_TERMINAL_WIDTH = 60;\nexport const MIN_SIDEBAR_WIDTH = 18;\nexport const MAX_SIDEBAR_WIDTH = 60;\n/** The conversation keeps at least this many columns when the divider is dragged. */\nexport const MIN_MAIN_WIDTH = 32;\n/** Left inset of section text; one cell stays free on the right. */\nexport const SIDEBAR_INSET = 2;\n\nexport type SidebarTone =\n | \"heading\" | \"taskHeading\" | \"count\" | \"text\" | \"muted\" | \"subtle\"\n | \"success\" | \"warning\" | \"error\" | \"active\" | \"rule\" | \"brand\";\n\nexport type SidebarSpan = { text: string; tone: SidebarTone; bold?: boolean; strike?: boolean };\n/** One terminal row. Never wider than the sidebar. */\nexport type SidebarRow = readonly SidebarSpan[];\n\nexport type SidebarState = Pick<\n TuiState,\n \"cwd\" | \"remoteTarget\" | \"gitLabel\" | \"changedFiles\" | \"showFileChanges\" | \"crewWorkers\" | \"safetyPolicies\" | \"sessionId\" | \"crewSessionIds\"\n>;\n\nexport type SidebarInput = {\n state: SidebarState;\n /** The crew task store; `undefined` where it cannot be read (remote SSH workspaces). */\n tasks: CrewTaskSnapshot | undefined;\n /** Spinner frame for running workers. */\n spinner: string;\n /** Local home directory, shortened to `~` in the footer; omit for remote workspaces. */\n home?: string;\n};\n\n/** Sidebar columns for a terminal width; 0 when the terminal is too narrow for one. */\nexport function sidebarWidth(terminalWidth: number, preferred?: number): number {\n if (terminalWidth < MIN_SIDEBAR_TERMINAL_WIDTH) return 0;\n return clampSidebarWidth(preferred ?? Math.min(36, Math.max(20, Math.floor(terminalWidth * 0.26))), terminalWidth);\n}\n\n/** Keep a dragged width inside the sidebar bounds and leave the conversation room. */\nexport function clampSidebarWidth(width: number, terminalWidth: number): number {\n const maximum = Math.max(MIN_SIDEBAR_WIDTH, Math.min(MAX_SIDEBAR_WIDTH, terminalWidth - MIN_MAIN_WIDTH - 1));\n return Math.max(MIN_SIDEBAR_WIDTH, Math.min(maximum, Math.round(width)));\n}\n\n/** Exactly `height` rows (blank rows pad the gap above the footer). */\nexport function sidebarRows(input: SidebarInput, width: number, height: number): SidebarRow[] {\n if (width <= 0 || height <= 0) return [];\n const footer = workspaceRows(input, width);\n const contentHeight = Math.max(0, height - footer.length);\n const status = statusRows(input.state.safetyPolicies, width);\n const agents = agentRows(input.state.crewWorkers, input.spinner, width, height);\n const fixed: SidebarRow[] = [\n ...(status.length ? [...status, rule(width)] : []),\n ...fileRows(input.state, width, height),\n rule(width),\n ...(agents.length ? [...agents, rule(width)] : [])\n ];\n const taskRows = crewTaskRows(input, width, Math.max(0, contentHeight - fixed.length));\n const content = [...fixed, ...taskRows].slice(0, contentHeight);\n while (content.length < contentHeight) content.push([]);\n return [...content, ...footer].slice(0, height);\n}\n\nfunction statusRows(policies: readonly TuiSafetyPolicy[], width: number): SidebarRow[] {\n if (!policies.length) return [];\n const label = \"SAFETY \";\n const lines = wrapCells(safetySummary(policies), textWidth(width) - label.length);\n return [\n heading(\"STATUS\", \"1\", width),\n ...lines.map((line, index): SidebarRow => index === 0\n ? [inset(), { text: \"SAFETY\", tone: \"muted\", bold: true }, { text: \" \", tone: \"muted\" }, { text: line, tone: \"warning\" }]\n : [inset(SIDEBAR_INSET + label.length), { text: line, tone: \"warning\" }])\n ];\n}\n\nfunction safetySummary(policies: readonly TuiSafetyPolicy[]): string {\n const blocks = policies.filter((policy) => policy.action === \"block\").length;\n const reviews = policies.filter((policy) => policy.action === \"review\").length;\n return [String(policies.length), blocks ? `${blocks} block` : \"\", reviews ? `${reviews} review` : \"\"].filter(Boolean).join(\" · \");\n}\n\n/** Newest files last; when they do not all fit, the newest stay and the rest are counted. */\nfunction fileRows(state: SidebarState, width: number, height: number): SidebarRow[] {\n const files = state.changedFiles;\n const rows: SidebarRow[] = [heading(\"MODIFIED FILES\", state.showFileChanges ? String(files.length) : \"off\", width)];\n if (!state.showFileChanges) return [...rows, ...text(\"Display disabled\", \"muted\", width), ...text(\"/file-changes on\", \"subtle\", width)];\n if (!files.length) return [...rows, ...text(\"✓ No file changes\", \"success\", width)];\n const budget = Math.max(3, Math.min(9, Math.floor(height * 0.3)));\n const shown: SidebarRow[] = [];\n let firstShown = files.length;\n for (let index = files.length - 1; index >= 0; index--) {\n const item = itemRows(relativePath(normalize(files[index] ?? \"\"), state.cwd), \"●\", \"warning\", \"text\", width);\n // Keep a row for \"… N more\" while older files remain.\n if (rows.length + shown.length + item.length + (index > 0 ? 1 : 0) > budget) break;\n shown.unshift(...item);\n firstShown = index;\n }\n const more = firstShown > 0 ? text(`… ${firstShown} more`, \"muted\", width) : [];\n return [...rows, ...shown, ...more];\n}\n\n/** Shown only while a crew is live; a finished crew does not linger here. */\nfunction agentRows(workers: readonly TuiCrewWorker[], spinner: string, width: number, height: number): SidebarRow[] {\n if (!workers.some((worker) => worker.status === \"running\" || worker.status === \"pending\")) return [];\n const rank: Record<TuiCrewWorker[\"status\"], number> = { running: 0, pending: 1, failed: 2, completed: 3 };\n const ordered = [...workers].sort((left, right) => rank[left.status] - rank[right.status]);\n const running = ordered.filter((worker) => worker.status === \"running\").map((worker) => normalize(worker.name));\n const budget = Math.max(2, Math.min(8, Math.floor(height * 0.25)));\n const rows: SidebarRow[] = [heading(`AGENTS: ${running.length ? running.join(\", \") : \"waiting\"}`, \"\", width)];\n let shown = 0;\n for (const [index, worker] of ordered.entries()) {\n const style = WORKER_STYLES[worker.status];\n const item = itemRows(`${normalize(worker.name)} ${style.label}`, worker.status === \"running\" ? spinner : style.icon, style.tone, \"text\", width);\n if (rows.length + item.length + (index < ordered.length - 1 ? 1 : 0) > budget) break;\n rows.push(...item);\n shown += 1;\n }\n if (ordered.length > shown) rows.push(...text(`… ${ordered.length - shown} more`, \"muted\", width));\n return rows;\n}\n\nconst WORKER_STYLES: Readonly<Record<TuiCrewWorker[\"status\"], { icon: string; tone: SidebarTone; label: string }>> = {\n running: { icon: \"\", tone: \"active\", label: \"running\" },\n pending: { icon: \"□\", tone: \"muted\", label: \"queued\" },\n completed: { icon: \"✓\", tone: \"success\", label: \"completed\" },\n failed: { icon: \"✕\", tone: \"error\", label: \"failed\" }\n};\n\n/** Most crew tasks fit; the store is reread by the controller, never here. */\nconst MAX_VISIBLE_TASKS = 9;\n\nfunction crewTaskRows(input: SidebarInput, width: number, height: number): SidebarRow[] {\n if (height <= 0) return [];\n if (!input.tasks) return [taskHeading(undefined, width), ...text(\"Not shown for SSH workspaces\", \"muted\", width)].slice(0, height);\n if (!input.tasks.enabled) return [];\n // Crew workers record tasks under their own sessions; they belong to this one.\n const tasks = tasksForSessions(input.tasks.tasks, [input.state.sessionId, ...input.state.crewSessionIds]);\n const done = tasks.filter((task) => task.status === \"completed\").length;\n const rows: SidebarRow[] = [taskHeading({ done, total: tasks.length }, width)];\n if (!tasks.length) return [...rows, ...text(\"No tasks for this session\", \"muted\", width)].slice(0, height);\n const numbers = sessionDisplayNumbers(tasks);\n const candidates = prioritizedTasks(tasks).slice(0, Math.max(3, Math.min(MAX_VISIBLE_TASKS, tasks.length)));\n let shown = 0;\n for (const [index, task] of candidates.entries()) {\n const item = taskRows(task, numbers.get(task.id) ?? 1, width);\n if (rows.length + item.length + (index < tasks.length - 1 ? 1 : 0) > height) break;\n rows.push(...item);\n shown += 1;\n }\n if (tasks.length > shown) rows.push(...text(`… ${tasks.length - shown} more`, \"muted\", width));\n return rows.slice(0, height);\n}\n\nfunction taskHeading(progress: { done: number; total: number } | undefined, width: number): SidebarRow {\n const full = progress ? ` — ${progress.done}/${progress.total} completed` : \"\";\n const counts = progress && stringWidth(`CREW TASKS${full}`) > textWidth(width) ? ` ${progress.done}/${progress.total}` : full;\n const label = truncateCells(\"CREW TASKS\", Math.max(1, textWidth(width) - stringWidth(counts)));\n return [inset(), { text: label, tone: \"taskHeading\", bold: true }, { text: truncateCells(counts, textWidth(width) - stringWidth(label)), tone: \"count\" }];\n}\n\n/** `◉ 2. Writing tests`: active, `○` queued, `!` blocked, `✓` done (struck through). */\nfunction taskRows(task: CrewTaskRecord, number: number, width: number): SidebarRow[] {\n const blocked = taskBlocked(task);\n const completed = task.status === \"completed\";\n const active = task.status === \"in_progress\";\n const icon = completed ? \"✓\" : active ? \"◉\" : blocked ? \"!\" : \"○\";\n const iconTone: SidebarTone = completed ? \"success\" : active || blocked ? \"warning\" : \"muted\";\n const labelTone: SidebarTone = completed ? \"muted\" : active ? \"warning\" : \"text\";\n const prefix = `${icon} ${number}. `;\n const lines = wrapCells(normalize(taskLabel(task)), textWidth(width) - stringWidth(prefix));\n return lines.map((line, index): SidebarRow => index === 0\n ? [inset(), { text: icon, tone: iconTone }, { text: \" \", tone: \"text\" }, { text: `${number}.`, tone: completed ? \"subtle\" : \"warning\", bold: true }, { text: \" \", tone: \"text\" }, { text: line, tone: labelTone, bold: active, strike: completed }]\n : [inset(SIDEBAR_INSET + stringWidth(prefix)), { text: line, tone: labelTone, bold: active, strike: completed }]);\n}\n\n/** Rule, `<cwd>:<git>` (wrapped, never truncated), a gap, and the brand. */\nfunction workspaceRows(input: SidebarInput, width: number): SidebarRow[] {\n const { cwd, remoteTarget, gitLabel } = input.state;\n const home = input.home;\n const location = remoteTarget\n ? `${remoteTarget}:${cwd}`\n : home && (cwd === home || cwd.startsWith(`${home}/`)) ? `~${cwd.slice(home.length)}` : cwd;\n const workspace = `${normalize(location)}:${gitLabel ? normalize(gitLabel) : \"local\"}`;\n return [\n rule(width),\n ...text(workspace, gitLabel ? \"text\" : \"muted\", width),\n [],\n [inset(), { text: \"•\", tone: \"brand\" }, { text: \" \", tone: \"text\" }, { text: \"CrewCoder\", tone: \"text\", bold: true }]\n ];\n}\n\nfunction heading(label: string, count: string, width: number): SidebarRow {\n const room = Math.max(1, textWidth(width) - (count ? stringWidth(count) + 1 : 0));\n const row: SidebarSpan[] = [inset(), { text: truncateCells(label, room), tone: \"heading\", bold: true }];\n return count ? [...row, { text: ` ${count}`, tone: \"count\" }] : row;\n}\n\n/** An icon, then text that wraps under itself. */\nfunction itemRows(value: string, icon: string, iconTone: SidebarTone, tone: SidebarTone, width: number): SidebarRow[] {\n const iconWidth = Math.max(1, stringWidth(icon));\n return wrapCells(value, textWidth(width) - iconWidth - 1).map((line, index): SidebarRow => index === 0\n ? [inset(), { text: icon, tone: iconTone }, { text: \" \", tone: \"text\" }, { text: line, tone }]\n : [inset(SIDEBAR_INSET + iconWidth + 1), { text: line, tone }]);\n}\n\n/** Plain section text; wraps, never truncates. */\nfunction text(value: string, tone: SidebarTone, width: number): SidebarRow[] {\n return wrapCells(value, textWidth(width)).map((line): SidebarRow => [inset(), { text: line, tone }]);\n}\n\nfunction rule(width: number): SidebarRow {\n return [{ text: \"─\".repeat(width), tone: \"rule\" }];\n}\n\nfunction inset(cells = SIDEBAR_INSET): SidebarSpan {\n return { text: \" \".repeat(cells), tone: \"text\" };\n}\n\nfunction textWidth(width: number): number {\n return Math.max(1, width - SIDEBAR_INSET - 1);\n}\n\nconst graphemes = new Intl.Segmenter(undefined, { granularity: \"grapheme\" });\n\n/** Cut to `width` cells with a trailing `…`. */\nexport function truncateCells(value: string, width: number): string {\n if (stringWidth(value) <= width) return value;\n if (width <= 0) return \"\";\n let out = \"\";\n for (const { segment } of graphemes.segment(value)) {\n if (stringWidth(out) + stringWidth(segment) + 1 > width) break;\n out += segment;\n }\n return `${out}…`;\n}\n"]}
@@ -0,0 +1,49 @@
1
+ import { type CrewTaskSnapshot } from "@onpoint-dev-tools/crewcoder-tui-core/state/crew-tasks";
2
+ import type { TuiState } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
3
+ /** Reads the crew task store for a workspace (tui-core `readCrewTaskSnapshot`). */
4
+ export type TaskReader = (cwd: string) => Promise<CrewTaskSnapshot>;
5
+ /** `<branch>[*]` for a workspace (tui-core `readGitLabelAsync`). */
6
+ export type GitLabelReader = (cwd: string) => Promise<string | undefined>;
7
+ /** How often the open sidebar rereads the task store; the agent writes it from another process. */
8
+ export declare const TASK_POLL_MS = 1000;
9
+ type SidebarHost = {
10
+ readonly state: TuiState;
11
+ changed(): void;
12
+ };
13
+ /**
14
+ * Sidebar display state for one UI instance: open or closed, the dragged
15
+ * width, the crew task snapshot, and refreshing the git label after runs.
16
+ * Instance-local by design; nothing here is saved or shared.
17
+ */
18
+ export declare class SidebarController {
19
+ open: boolean;
20
+ /** Width set by dragging the divider; undefined uses the default for the terminal. */
21
+ preferredWidth: number | undefined;
22
+ /** Undefined when tasks cannot be read here (remote SSH workspaces). */
23
+ tasks: CrewTaskSnapshot | undefined;
24
+ /** Wired by cli.tsx for local workspaces; undefined leaves `state.gitLabel` as it is. */
25
+ gitLabelReader: GitLabelReader | undefined;
26
+ private readonly host;
27
+ private readonly readTasks;
28
+ private timer;
29
+ private taskSignature;
30
+ private terminalWidth;
31
+ constructor(host: SidebarHost, readTasks: TaskReader | null);
32
+ /** Columns the sidebar takes in this terminal: 0 when closed or too narrow. */
33
+ columns(terminalWidth: number): number;
34
+ /** True when the sidebar is open but the terminal is too narrow to show it. */
35
+ get hiddenByWidth(): boolean;
36
+ toggle(): void;
37
+ setOpen(open: boolean): void;
38
+ /** The divider was dragged; `width` is the sidebar's new width in columns. */
39
+ resize(width: number, terminalWidth: number): void;
40
+ /** Reread the task store; renders only when something changed. Failures leave the last snapshot. */
41
+ refreshTasks(): Promise<void>;
42
+ /** After a run: the branch may have moved and the tree is likely dirty now. */
43
+ refreshGitLabel(): Promise<void>;
44
+ dispose(): void;
45
+ private startPolling;
46
+ private stopPolling;
47
+ }
48
+ export {};
49
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../src/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,M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