@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":"picker-flows.js","sourceRoot":"","sources":["../src/picker-flows.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAClI,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CA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IAC5B,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAgC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpF,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;AACxG,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO;QACL,aAAa,EAAE,OAAO,MAAM,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAClF,YAAY,EAAE,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KAChF,CAAC;AACJ,CAAC","sourcesContent":["import path from \"node:path\";\nimport type { ProviderRecord, SessionRecord } from \"@onpoint-dev-tools/crewcoder-tui-core/bridge/crewcoder-process\";\nimport { DEFAULT_EFFORT, effortLevelsForModel, normalizeEffort } from \"@onpoint-dev-tools/crewcoder-tui-core/state/effort-levels\";\nimport { builtinProviderDefaults, resolveProviderRecord } from \"@onpoint-dev-tools/crewcoder-tui-core/state/provider-defaults\";\nimport { isTuiMode, type TuiEventBlock, type TuiState } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport type { FooterAlert } from \"./alert-model.js\";\nimport {\n cliJson, cliText, errorMessage, readToolMode,\n type CrewCoderCli, type LoadedPromptCommand, type LoadedSkill, type NamedEntry, type RewindPreview, type RewindResult, type WorkerSummary\n} from \"./crewcoder-cli.js\";\nimport { actionLabel } from \"./keybindings.js\";\nimport type { PaletteCommand } from \"./palette-model.js\";\nimport type { ThemeController } from \"./theme-controller.js\";\nimport {\n checkpointItems, directoryItems, effortItems, modeItems, modelItems, namedItems, profileItems, providerItems,\n rewindConfirmItems, sessionItems, toolModeItems, workerItems, type Picker, type PickerKind\n} from \"./pickers.js\";\n\n/** What picker flows may do to the session. Implemented by SessionController. */\nexport interface PickerHost {\n readonly state: TuiState;\n readonly cli: CrewCoderCli;\n readonly bridgeRunning: boolean;\n openPicker(picker: Picker): void;\n /** The open picker, used to drop results for a picker the user already left. */\n readonly picker: Picker | undefined;\n push(block: TuiEventBlock): void;\n /** Show a status alert above the composer until the next key. */\n alert(alert: FooterAlert): void;\n changed(): void;\n resumeSession(session: SessionRecord): void;\n setComposerDraft(text: string): void;\n attachSkill(skill: LoadedSkill): void;\n /** The active theme, the `/theme` list, preview, and the saved pick. */\n readonly themes: ThemeController;\n}\n\nexport type OpenableKind = Exclude<PickerKind, \"commands\" | \"menu\" | \"rewindConfirm\" | \"crewLaunch\">;\n\nconst SESSION_HINT = `↑↓ navigate · Enter resume · ${actionLabel(\"sessionBranch\")} branch · Esc close`;\nconst THEME_HINT = \"↑↓ preview · Enter apply · Esc keep current\";\n\nconst picker = (kind: PickerKind, title: string, items: PaletteCommand[] = [], loading = false, emptyText = \"Nothing to pick\"): Picker =>\n ({ kind, title, placeholder: \"Search…\", emptyText, items, loading });\n\nexport class PickerFlows {\n private readonly host: PickerHost;\n private providers: ProviderRecord[] | undefined;\n private sessions: SessionRecord[] = [];\n private workers: WorkerSummary[] = [];\n\n constructor(host: PickerHost) {\n this.host = host;\n }\n\n open(kind: OpenableKind): void {\n const { state } = this.host;\n switch (kind) {\n case \"provider\":\n return this.load(picker(\"provider\", \"Provider\", [], true), async () => providerItems(await this.loadProviders(), state.provider));\n case \"model\":\n return this.load(picker(\"model\", \"Model\", [], true), async () => modelItems(state.provider, (await this.loadProviders()).find((item) => item.id === state.provider), state.model));\n case \"effort\":\n return this.host.openPicker(picker(\"effort\", `Reasoning effort · ${state.model}`, effortItems(state.provider, state.model, state.effort)));\n case \"mode\":\n // Built-in modes show at once; saved workers fill in when listed.\n return this.load(picker(\"mode\", \"Mode or worker\", modeItems(state, this.workers), true), async () =>\n modeItems(state, await this.loadWorkers().catch(() => this.workers)));\n case \"systemPrompt\":\n return this.load(picker(\"systemPrompt\", \"System prompt\", [], true, \"No system prompts in ~/.crewcoder/system-prompts/\"), async () =>\n namedItems(await cliJson<NamedEntry[]>(this.host.cli, [\"system-prompt\", \"list\", \"--json\"], []), state.systemPrompt));\n case \"promptCommand\":\n return this.load(picker(\"promptCommand\", \"Insert prompt command\", [], true, \"No prompt commands in ~/.crewcoder/commands/\"), async () =>\n namedItems(await cliJson<NamedEntry[]>(this.host.cli, [\"command\", \"list\", \"--json\"], [])));\n case \"skill\":\n return this.load(picker(\"skill\", \"Attach a skill\", [], true, \"No skills in ~/.crewcoder/skills/\"), async () =>\n namedItems(await cliJson<NamedEntry[]>(this.host.cli, [\"skill\", \"list\", \"--json\"], [])));\n case \"profile\":\n return this.host.openPicker(picker(\"profile\", \"Integration profile\", profileItems(state.integrationProfile)));\n case \"toolMode\":\n if (this.blockedWhileRunning(\"changing Tool mode\")) return;\n return this.load(picker(\"toolMode\", \"Tool mode for new sessions\", [], true), async () => toolModeItems(await readToolMode(this.host.cli)));\n case \"removeDir\":\n if (!state.externalDirectories.length) return this.host.alert({ variant: \"info\", title: \"No external directories attached\" });\n return this.host.openPicker(picker(\"removeDir\", \"Remove external directory\", directoryItems(state.externalDirectories)));\n case \"session\":\n return this.load({ ...picker(\"session\", \"Resume session\", [], true, \"No sessions found\"), hint: SESSION_HINT }, async () => {\n this.sessions = await this.host.cli.sessions();\n return sessionItems(this.sessions, state.sessionId);\n });\n case \"rewind\":\n if (!state.checkpoints.length) {\n return this.host.alert({ variant: \"warning\", title: \"No checkpoint found\", body: \"Run a mutating tool first, then use /rewind.\" });\n }\n return this.host.openPicker(picker(\"rewind\", \"Rewind to checkpoint\", checkpointItems(state.checkpoints)));\n case \"handoff\":\n if (!hasSavedSession(state)) return this.noSavedSession(\"handing it off\");\n return this.load(picker(\"handoff\", \"Hand off to worker\", [], true, \"No workers. Create one with: crewcoder workers create <name>\"), async () =>\n workerItems(await this.loadWorkers()));\n case \"theme\":\n // Local UI files (also in --remote mode: the theme belongs to this terminal, not the workspace).\n return this.host.openPicker({ ...picker(\"theme\", \"Theme\", this.host.themes.items()), hint: THEME_HINT });\n }\n }\n\n /** Apply a choice. The picker is already closed; a follow-up picker may open. */\n async select(kind: PickerKind, id: string): Promise<void> {\n const { state } = this.host;\n switch (kind) {\n case \"commands\":\n case \"menu\":\n case \"crewLaunch\":\n return;\n case \"provider\":\n state.provider = id;\n return this.open(\"model\");\n case \"model\": {\n state.model = id;\n const levels = effortLevelsForModel(state.provider, state.model);\n if (!levels.includes(state.effort)) state.effort = levels[0] ?? state.effort;\n return this.open(\"effort\");\n }\n case \"effort\":\n state.effort = normalizeEffort(id, effortLevelsForModel(state.provider, state.model)) ?? state.effort;\n return;\n case \"mode\":\n return this.selectMode(id);\n case \"systemPrompt\":\n await cliText(this.host.cli, [\"system-prompt\", \"show\", id, \"--json\"]);\n state.systemPrompt = id;\n return this.host.alert({ variant: \"success\", title: `System prompt selected: ${id}` });\n case \"promptCommand\":\n return this.insertPromptCommand(id);\n case \"skill\": {\n const skill = await cliJson<LoadedSkill | null>(this.host.cli, [\"skill\", \"show\", id, \"--json\"], null);\n if (!skill) throw new Error(`Skill not found: ${id}`);\n return this.host.attachSkill(skill);\n }\n case \"profile\":\n return this.setProfile(id === \"crewcode\" ? \"crewcode\" : \"standalone\");\n case \"toolMode\":\n await cliText(this.host.cli, [\"config\", \"set\", \"toolMode\", id]);\n return this.host.alert({ variant: \"success\", title: `Tool mode set to ${id} for new sessions`, body: \"Use /new to apply it; existing sessions keep their mode.\" });\n case \"removeDir\":\n return this.removeDirectory(id);\n case \"session\": {\n const session = this.sessions.find((item) => item.id === id);\n if (session) this.host.resumeSession(session);\n return;\n }\n case \"rewind\":\n return this.previewRewind(id);\n case \"rewindConfirm\":\n if (id.startsWith(\"restore:\")) return this.restore(id.slice(\"restore:\".length));\n return this.host.alert({ variant: \"info\", title: \"Rewind cancelled\" });\n case \"handoff\":\n return this.handoff(id);\n case \"theme\":\n return this.applyTheme(id);\n }\n }\n\n /**\n * A picker command with an argument (`/effort high`, `/provider opencode`,\n * `/rewind latest`, ...): apply it directly, through the same path as picking it.\n */\n async applyArgument(kind: OpenableKind, arg: string): Promise<void> {\n const { state } = this.host;\n switch (kind) {\n case \"provider\":\n return this.setProvider(arg);\n case \"model\": {\n state.model = arg;\n const levels = effortLevelsForModel(state.provider, state.model);\n if (!levels.includes(state.effort)) state.effort = levels[0] ?? state.effort;\n return this.host.alert({ variant: \"success\", title: `Model: ${state.model}`, body: `Reasoning effort: ${state.effort}` });\n }\n case \"effort\": {\n const levels = effortLevelsForModel(state.provider, state.model);\n const effort = normalizeEffort(arg, levels);\n if (!effort) return this.host.alert({ variant: \"error\", title: `Unknown effort: ${arg}`, body: `${state.model} supports: ${levels.join(\", \")}` });\n state.effort = effort;\n return this.host.alert({ variant: \"success\", title: `Reasoning effort: ${effort}` });\n }\n case \"mode\":\n return this.selectModeOrWorker(arg);\n case \"promptCommand\": {\n const [name = \"\", ...args] = arg.split(/\\s+/);\n return this.insertPromptCommand(name, args);\n }\n case \"profile\":\n if (arg !== \"standalone\" && arg !== \"crewcode\") return this.usage(\"/profile standalone|crewcode\");\n return this.setProfile(arg);\n case \"toolMode\":\n if (arg === \"status\") {\n const mode = await readToolMode(this.host.cli);\n return this.host.alert({ variant: \"info\", title: `Tool mode for new sessions: ${mode}`, body: \"Existing sessions keep their saved mode; host policy takes precedence.\" });\n }\n if (arg !== \"native\" && arg !== \"crewcoder\") return this.usage(\"/tool-mode native|crewcoder|status\");\n if (this.blockedWhileRunning(\"changing Tool mode\")) return;\n return this.select(\"toolMode\", arg);\n case \"session\":\n return this.resumeById(arg);\n case \"rewind\": {\n const id = arg === \"latest\" ? state.checkpoints.at(-1)?.id : arg;\n if (!id) return this.host.alert({ variant: \"warning\", title: \"No checkpoint found\", body: \"Run a mutating tool with /checkpoints on, then use /rewind.\" });\n return this.previewRewind(id);\n }\n case \"handoff\": {\n const match = /^(?:worker:)?(\\S+)(?:\\s+([\\s\\S]+))?$/.exec(arg);\n if (!match?.[1]) return this.usage(\"/handoff worker:<name> [continuation prompt]\");\n return this.handoff(match[1], match[2]?.trim());\n }\n case \"systemPrompt\":\n case \"skill\":\n case \"removeDir\":\n case \"theme\":\n return this.select(kind, arg);\n }\n }\n\n /** Picker Enter and `/theme <name>`: apply, save, and say where it is saved. */\n private applyTheme(id: string): void {\n this.host.alert({ variant: \"success\", ...this.host.themes.apply(id) });\n }\n\n /** Effort to resume a session with: its saved level when the model supports it. */\n static resumeEffort(state: TuiState, saved: string | undefined): TuiState[\"effort\"] {\n const levels = effortLevelsForModel(state.provider, state.model);\n return normalizeEffort(saved, levels) ?? normalizeEffort(state.effort, levels) ?? DEFAULT_EFFORT;\n }\n\n /** Drop cached providers and workers, then list providers again (`/reload`). */\n async reloadProviders(): Promise<ProviderRecord[]> {\n this.providers = undefined;\n this.workers = [];\n return this.loadProviders();\n }\n\n /** Open `initial` (loading) and fill it in; ignored if the user already left it. */\n load(initial: Picker, items: () => Promise<PaletteCommand[]>): void {\n this.host.openPicker(initial);\n items().then(\n (loaded) => {\n if (this.host.picker !== initial) return;\n this.host.openPicker({ ...initial, items: loaded, loading: false });\n },\n (error: unknown) => {\n if (this.host.picker !== initial) return;\n this.host.openPicker({ ...initial, loading: false, emptyText: `Error: ${errorMessage(error)}` });\n }\n );\n }\n\n private async loadProviders(): Promise<ProviderRecord[]> {\n if (this.providers) return this.providers;\n try {\n const providers = await this.host.cli.providers();\n if (providers.length) this.providers = providers;\n } catch {\n // Offline or older CLI: fall back to the built-in catalog below.\n }\n return this.providers ?? builtinProviderDefaults;\n }\n\n private async loadWorkers(): Promise<WorkerSummary[]> {\n this.workers = await cliJson<WorkerSummary[]>(this.host.cli, [\"workers\", \"list\", \"--json\"], []);\n return this.workers;\n }\n\n private selectMode(id: string): void {\n const { state } = this.host;\n if (id.startsWith(\"worker:\")) {\n // Per-session only: sent as --worker on each run; the global active worker is unchanged.\n state.worker = id.slice(\"worker:\".length);\n return;\n }\n if (!isTuiMode(id)) return;\n if (id === \"plugin\" && state.integrationProfile !== \"crewcode\") {\n this.host.alert({ variant: \"warning\", title: \"CrewCode integration is disabled for this project\", body: \"Enable it with /profile.\" });\n return;\n }\n state.mode = id;\n state.worker = undefined;\n }\n\n /** Typed provider: must be one CrewCoder knows; keeps a model the provider offers. */\n private async setProvider(id: string): Promise<void> {\n const { state } = this.host;\n const providers = await this.loadProviders();\n const provider = providers.find((item) => item.id === id);\n if (!provider) {\n return this.host.alert({ variant: \"error\", title: `Unknown provider: ${id}`, body: `Available: ${providers.map((item) => item.id).join(\", \")}` });\n }\n state.provider = provider.id;\n const models = resolveProviderRecord(provider.id, provider);\n if (models.models.length && !models.models.includes(state.model)) state.model = models.defaultModel ?? models.models[0] ?? state.model;\n const levels = effortLevelsForModel(state.provider, state.model);\n if (!levels.includes(state.effort)) state.effort = levels[0] ?? state.effort;\n this.host.alert({ variant: \"success\", title: `Provider: ${state.provider}`, body: `Model: ${state.model} · effort ${state.effort}` });\n }\n\n /** Typed mode or saved worker name. */\n private async selectModeOrWorker(name: string): Promise<void> {\n const { state } = this.host;\n if (isTuiMode(name)) {\n this.selectMode(name);\n if (state.mode === name) this.host.alert({ variant: \"success\", title: `Mode: ${name}` });\n return;\n }\n const workers = await this.loadWorkers();\n if (!workers.some((worker) => worker.name === name)) {\n return this.host.alert({ variant: \"error\", title: `No mode or worker named ${name}`, body: `Modes: general, crewcoder, extension${this.host.state.integrationProfile === \"crewcode\" ? \", plugin\" : \"\"}. Workers: ${workers.map((worker) => worker.name).join(\", \") || \"none\"}` });\n }\n this.selectMode(`worker:${name}`);\n this.host.alert({ variant: \"success\", title: `Worker: ${name}`, body: \"This session only.\" });\n }\n\n /**\n * Fork a listed session and open the fork (Tab in /sessions, `/branch <id>`).\n * The branch loads like a resume, with its conversation and saved settings, so\n * the screen and new messages both belong to it; the original is untouched.\n */\n async branch(id: string): Promise<void> {\n if (this.blockedWhileRunning(\"branching a session\")) return;\n const source = this.sessions.find((session) => session.id === id);\n if (!source) return this.host.alert({ variant: \"error\", title: `Session not found: ${id}`, body: \"Run /sessions to pick from the list.\" });\n this.host.alert({ variant: \"info\", title: \"Branching session…\" });\n const branchedId = (await this.host.cli.branch(source.id)).trim();\n if (!branchedId || branchedId === source.id) throw new Error(\"session branch did not return a new session id.\");\n this.host.resumeSession({ ...source, id: branchedId });\n this.host.alert({ variant: \"success\", title: \"Branched session\", body: \"New messages go to the branch; the original session is unchanged.\" });\n }\n\n /** `/branch <id>`: an exact id or a unique prefix from the session list. */\n async branchById(id: string): Promise<void> {\n const session = await this.findSession(id);\n if (session) await this.branch(session.id);\n }\n\n /** `/sessions <id>`: an exact id or a unique prefix. */\n private async resumeById(id: string): Promise<void> {\n const session = await this.findSession(id);\n if (session) this.host.resumeSession(session);\n }\n\n /** Reload the list and match an exact id or a unique prefix; alerts and returns undefined otherwise. */\n private async findSession(id: string): Promise<SessionRecord | undefined> {\n this.sessions = await this.host.cli.sessions();\n const exact = this.sessions.find((session) => session.id === id);\n const matches = exact ? [exact] : this.sessions.filter((session) => session.id.startsWith(id));\n if (matches.length === 1 && matches[0]) return matches[0];\n this.host.alert({ variant: \"error\", title: matches.length ? `${matches.length} sessions start with ${id}` : `Session not found: ${id}`, body: \"Run /sessions to pick from the list.\" });\n return undefined;\n }\n\n private usage(text: string): void {\n this.host.alert({ variant: \"warning\", title: \"Usage\", body: text });\n }\n\n private async insertPromptCommand(name: string, args: string[] = []): Promise<void> {\n const command = await cliJson<LoadedPromptCommand>(this.host.cli, [\"command\", \"show\", name, \"--json\", ...(args.length ? [\"--arg\", ...args] : [])], { content: \"\" });\n const content = command.content.trim();\n if (!content) throw new Error(`Prompt command is empty: ${name}`);\n if (command.missingArguments?.length) this.host.alert({ variant: \"warning\", title: \"Missing command arguments\", body: command.missingArguments.join(\", \") });\n this.host.setComposerDraft(content);\n }\n\n private async setProfile(profile: TuiState[\"integrationProfile\"]): Promise<void> {\n const { state } = this.host;\n const stdout = await cliText(this.host.cli, [\"profile\", \"use\", profile, \"--project\"]);\n state.integrationProfile = profile;\n if (profile === \"standalone\" && state.mode === \"plugin\") state.mode = \"general\";\n this.host.alert({ variant: \"success\", title: `Integration profile: ${profile}`, body: stdout.trim() || undefined });\n }\n\n private async removeDirectory(directory: string): Promise<void> {\n const { state } = this.host;\n if (this.blockedWhileRunning(\"changing external directories\")) return;\n const target = state.externalDirectories.find((existing) => existing === directory || existing === path.resolve(state.cwd, directory));\n if (!target) return this.host.alert({ variant: \"error\", title: \"External directory is not attached\", body: directory });\n if (hasSavedSession(state)) {\n const remaining = await cliJson<unknown>(this.host.cli, [\"session\", \"remove-dir\", state.sessionId, target, \"--json\"], []);\n state.externalDirectories = Array.isArray(remaining) ? remaining.filter((value): value is string => typeof value === \"string\") : [];\n } else {\n state.externalDirectories = state.externalDirectories.filter((existing) => existing !== target);\n }\n this.host.alert({ variant: \"success\", title: \"External directory removed from this session\", body: target });\n }\n\n private async previewRewind(checkpointId: string): Promise<void> {\n const { state } = this.host;\n if (this.blockedWhileRunning(\"rewinding\")) return;\n if (!hasSavedSession(state)) return this.noSavedSession(\"rewinding\");\n const preview = parsePreview(await cliJson<unknown>(this.host.cli, [\"session\", \"rewind-preview\", state.sessionId, checkpointId, \"--json\"], {}));\n const lines = [\n ...preview.restoreFiles.slice(0, 5).map((file) => `restore ${file}`),\n ...preview.deleteFiles.slice(0, 5).map((file) => `delete ${file}`)\n ];\n this.host.alert({\n variant: preview.deleteFiles.length ? \"warning\" : \"info\",\n title: `Rewind ${checkpointId}: restore ${preview.restoreFiles.length} files, delete ${preview.deleteFiles.length}`,\n body: lines.join(\"\\n\")\n });\n // Deleting files the agent created is destructive; ask first, defaulting to Cancel.\n if (preview.deleteFiles.length) {\n this.host.openPicker(picker(\"rewindConfirm\", `Rewind deletes ${preview.deleteFiles.length} files`, rewindConfirmItems(checkpointId, preview.deleteFiles.length)));\n return;\n }\n await this.restore(checkpointId);\n }\n\n private async restore(checkpointId: string): Promise<void> {\n const { state } = this.host;\n if (this.blockedWhileRunning(\"rewinding\") || !hasSavedSession(state)) return;\n const result = parseRewind(await cliJson<unknown>(this.host.cli, [\"session\", \"rewind\", state.sessionId, checkpointId, \"--json\"], {}));\n this.host.alert({ variant: \"success\", title: `Rewound to ${checkpointId}`, body: `Restored ${result.restoredFiles} files, deleted ${result.deletedFiles} files.` });\n }\n\n private async handoff(worker: string, prompt?: string): Promise<void> {\n const { state } = this.host;\n if (this.blockedWhileRunning(\"handing off\")) return;\n if (!hasSavedSession(state)) return this.noSavedSession(\"handing it off\");\n const source = state.sessionId;\n this.host.alert({ variant: \"info\", title: `Handing off ${source} to ${worker}…` });\n const args = [\"crew\", \"handoff\", `worker:${worker}`, source, ...(prompt ? [prompt] : []), \"--provider\", state.provider, \"--mode\", state.mode, \"--effort\", state.effort, \"--approval\", state.fullAccess ? \"full-access\" : \"review\"];\n if (state.model) args.push(\"--model\", state.model);\n if (state.systemPrompt) args.push(\"--system-prompt\", state.systemPrompt);\n const result = await cliJson<{ sessionId?: string; worker?: string; summary?: string }>(this.host.cli, [...args, \"--json\"], {});\n if (!result.sessionId) throw new Error(\"Handoff completed without a new session id.\");\n state.sessionId = result.sessionId;\n state.worker = result.worker ?? worker;\n state.changedFiles = [];\n this.host.alert({ variant: \"success\", title: \"Handoff complete\", body: `${source} → ${result.sessionId} as ${state.worker}` });\n if (result.summary) this.host.push({ type: \"assistant\", text: result.summary });\n }\n\n private blockedWhileRunning(action: string): boolean {\n if (!this.host.bridgeRunning && !this.host.state.running) return false;\n this.host.alert({ variant: \"warning\", title: `Wait for the current run to finish before ${action}`, body: \"Use /stop to end it.\" });\n return true;\n }\n\n private noSavedSession(action: string): void {\n this.host.alert({ variant: \"warning\", title: `Start or resume a saved session before ${action}` });\n }\n}\n\nfunction hasSavedSession(state: TuiState): boolean {\n return Boolean(state.sessionId) && state.sessionId !== \"new\";\n}\n\nfunction stringList(value: unknown): string[] {\n return Array.isArray(value) ? value.filter((item): item is string => typeof item === \"string\") : [];\n}\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === \"object\" ? value as Record<string, unknown> : {};\n}\n\nfunction parsePreview(value: unknown): RewindPreview {\n const fields = record(value);\n return { restoreFiles: stringList(fields.restoreFiles), deleteFiles: stringList(fields.deleteFiles) };\n}\n\nfunction parseRewind(value: unknown): RewindResult {\n const fields = record(value);\n return {\n restoredFiles: typeof fields.restoredFiles === \"number\" ? fields.restoredFiles : 0,\n deletedFiles: typeof fields.deletedFiles === \"number\" ? fields.deletedFiles : 0\n };\n}\n"]}
@@ -0,0 +1,34 @@
1
+ import type { ProviderRecord, SessionRecord } from "@onpoint-dev-tools/crewcoder-tui-core/bridge/crewcoder-process";
2
+ import { type EffortLevel } from "@onpoint-dev-tools/crewcoder-tui-core/state/effort-levels";
3
+ import type { TuiCheckpoint, TuiState } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
4
+ import type { NamedEntry, WorkerSummary } from "./crewcoder-cli.js";
5
+ import type { PaletteCommand } from "./palette-model.js";
6
+ /** Every list the palette can show. `commands` is the `/` palette itself. */
7
+ export type PickerKind = "commands" | "menu" | "provider" | "model" | "effort" | "mode" | "systemPrompt" | "promptCommand" | "skill" | "profile" | "toolMode" | "removeDir" | "session" | "rewind" | "rewindConfirm" | "handoff" | "theme" | "crewLaunch";
8
+ export type Picker = {
9
+ kind: PickerKind;
10
+ title?: string;
11
+ placeholder: string;
12
+ emptyText: string;
13
+ items: PaletteCommand[];
14
+ loading: boolean;
15
+ /** Replaces the default `↑↓ navigate · Enter select · Esc close` row (pickers with extra keys). */
16
+ hint?: string;
17
+ };
18
+ /** Typed names (including legacy aliases) that open a picker. */
19
+ export declare const PICKER_COMMANDS: Readonly<Record<string, Exclude<PickerKind, "commands" | "menu" | "rewindConfirm" | "crewLaunch">>>;
20
+ export declare function providerItems(providers: readonly ProviderRecord[], current: string): PaletteCommand[];
21
+ export declare function modelItems(providerId: string, provider: ProviderRecord | undefined, current: string): PaletteCommand[];
22
+ export declare function effortItems(provider: string, model: string, current: EffortLevel): PaletteCommand[];
23
+ /** Built-in modes, then saved workers. `plugin` only exists under the CrewCode profile. */
24
+ export declare function modeItems(state: Pick<TuiState, "mode" | "worker" | "integrationProfile">, workers: readonly WorkerSummary[]): PaletteCommand[];
25
+ export declare function namedItems(entries: readonly NamedEntry[], current?: string): PaletteCommand[];
26
+ export declare function profileItems(current: TuiState["integrationProfile"]): PaletteCommand[];
27
+ export declare function toolModeItems(current: "native" | "crewcoder"): PaletteCommand[];
28
+ export declare function directoryItems(directories: readonly string[]): PaletteCommand[];
29
+ /** Newest first, grouped by day, labeled by the session's first prompt. */
30
+ export declare function sessionItems(sessions: readonly SessionRecord[], current: string): PaletteCommand[];
31
+ export declare function checkpointItems(checkpoints: readonly TuiCheckpoint[]): PaletteCommand[];
32
+ export declare function rewindConfirmItems(checkpointId: string, deleteCount: number): PaletteCommand[];
33
+ export declare function workerItems(workers: readonly WorkerSummary[]): PaletteCommand[];
34
+ //# sourceMappingURL=pickers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickers.d.ts","sourceRoot":"","sources":["../src/pickers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AACpH,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,2DAA2D,CAAC;AAEnH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD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,cAAc,EAAE,CAiB9I;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,CAO7F;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,cAAc,EAAE,CAKtF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,WAAW,GAAG,cAAc,EAAE,CAK/E;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,EAAE,CAE/E;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE,CAQlG;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,GAAG,cAAc,EAAE,CAMvF;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CAK9F;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,cAAc,EAAE,CAM/E"}
@@ -0,0 +1,136 @@
1
+ import { effortLevelsForModel } from "@onpoint-dev-tools/crewcoder-tui-core/state/effort-levels";
2
+ import { resolveProviderRecord } from "@onpoint-dev-tools/crewcoder-tui-core/state/provider-defaults";
3
+ /** Typed names (including legacy aliases) that open a picker. */
4
+ export const PICKER_COMMANDS = {
5
+ "/sessions": "session", "/resume": "session",
6
+ "/provider": "provider", "/model": "model", "/effort": "effort",
7
+ "/modes": "mode", "/mode": "mode", "/workers": "mode", "/worker": "mode",
8
+ "/prompts": "systemPrompt", "/commands": "promptCommand", "/skills": "skill",
9
+ "/profile": "profile", "/tool-mode": "toolMode", "/remove-dir": "removeDir",
10
+ "/rewind": "rewind", "/handoff": "handoff",
11
+ "/theme": "theme", "/themes": "theme"
12
+ };
13
+ const EFFORT_DESCRIPTIONS = {
14
+ none: "disable model reasoning",
15
+ low: "fast, light thinking",
16
+ medium: "balanced thinking",
17
+ high: "deeper reasoning",
18
+ xhigh: "maximum available reasoning"
19
+ };
20
+ export function providerItems(providers, current) {
21
+ return providers.map((provider) => ({
22
+ id: provider.id,
23
+ label: provider.id,
24
+ description: (provider.description ?? provider.title).replace(/^-\s*/, ""),
25
+ current: provider.id === current
26
+ }));
27
+ }
28
+ export function modelItems(providerId, provider, current) {
29
+ const resolved = resolveProviderRecord(providerId, provider);
30
+ const models = resolved.models.length ? resolved.models : [current];
31
+ return models.map((model) => ({
32
+ id: model,
33
+ label: model,
34
+ description: model === resolved.defaultModel ? "default" : undefined,
35
+ current: model === current
36
+ }));
37
+ }
38
+ export function effortItems(provider, model, current) {
39
+ return effortLevelsForModel(provider, model).map((level) => ({
40
+ id: level,
41
+ label: level,
42
+ description: EFFORT_DESCRIPTIONS[level],
43
+ current: level === current
44
+ }));
45
+ }
46
+ /** Built-in modes, then saved workers. `plugin` only exists under the CrewCode profile. */
47
+ export function modeItems(state, workers) {
48
+ const modes = [
49
+ ["general", "General coding agent mode"],
50
+ ["crewcoder", "Clarify, plan, approve, and implement"],
51
+ ...(state.integrationProfile === "crewcode" ? [["plugin", "CrewCode app plugin architect mode"]] : []),
52
+ ["extension", "CrewCoder extension architect mode"]
53
+ ];
54
+ return [
55
+ ...modes.map(([id, description]) => ({ id, label: id, description, group: "Modes", current: !state.worker && state.mode === id })),
56
+ ...workers.map((worker) => ({
57
+ id: `worker:${worker.name}`,
58
+ label: worker.name,
59
+ description: worker.ownerName ? `owner: ${worker.ownerName}` : undefined,
60
+ group: "Workers",
61
+ current: state.worker === worker.name
62
+ }))
63
+ ];
64
+ }
65
+ export function namedItems(entries, current) {
66
+ return entries.map((entry) => ({
67
+ id: entry.name,
68
+ label: entry.name,
69
+ description: entry.description || entry.path,
70
+ current: entry.name === current
71
+ }));
72
+ }
73
+ export function profileItems(current) {
74
+ return [
75
+ { id: "standalone", label: "standalone", description: "Coding agent without CrewCode desktop compatibility", current: current === "standalone" },
76
+ { id: "crewcode", label: "crewcode", description: "CrewCode plugins, mode, tools, and UI compatibility", current: current === "crewcode" }
77
+ ];
78
+ }
79
+ export function toolModeItems(current) {
80
+ return [
81
+ { id: "native", label: "Provider-native tools", description: "Native execution plus CrewCoder specialized tools", current: current === "native" },
82
+ { id: "crewcoder", label: "CrewCoder tools", description: "CrewCoder handles tools and approvals for every provider", current: current === "crewcoder" }
83
+ ];
84
+ }
85
+ export function directoryItems(directories) {
86
+ return directories.map((directory) => ({ id: directory, label: directory }));
87
+ }
88
+ /** Newest first, grouped by day, labeled by the session's first prompt. */
89
+ export function sessionItems(sessions, current) {
90
+ return sessions.map((session) => ({
91
+ id: session.id,
92
+ label: truncate(session.prompt.replace(/\s+/g, " ").trim() || "Untitled session", 60),
93
+ description: formatTime(session.startedAt),
94
+ group: formatDay(session.startedAt),
95
+ current: session.id === current
96
+ }));
97
+ }
98
+ export function checkpointItems(checkpoints) {
99
+ return [...checkpoints].reverse().map((checkpoint) => ({
100
+ id: checkpoint.id,
101
+ label: checkpoint.id,
102
+ description: `${checkpoint.toolName ?? "checkpoint"} · ${checkpoint.fileCount} files · ${checkpoint.reason}`
103
+ }));
104
+ }
105
+ export function rewindConfirmItems(checkpointId, deleteCount) {
106
+ return [
107
+ { id: "cancel", label: "Cancel", description: "Do not restore this checkpoint" },
108
+ { id: `restore:${checkpointId}`, label: "Restore anyway", description: `Restore ${checkpointId} and delete ${deleteCount} new files` }
109
+ ];
110
+ }
111
+ export function workerItems(workers) {
112
+ return workers.map((worker) => ({
113
+ id: worker.name,
114
+ label: worker.name,
115
+ description: worker.ownerName ? `owner: ${worker.ownerName}` : "worker"
116
+ }));
117
+ }
118
+ function truncate(text, max) {
119
+ return text.length > max ? `${text.slice(0, max - 1)}…` : text;
120
+ }
121
+ function sessionDate(iso) {
122
+ const date = new Date(iso);
123
+ return Number.isNaN(date.getTime()) ? undefined : date;
124
+ }
125
+ function formatDay(iso) {
126
+ const date = sessionDate(iso);
127
+ if (!date)
128
+ return "Unknown date";
129
+ return new Intl.DateTimeFormat("en-US", { weekday: "short", month: "short", day: "2-digit", year: "numeric" })
130
+ .format(date).replaceAll(",", "");
131
+ }
132
+ function formatTime(iso) {
133
+ const date = sessionDate(iso);
134
+ return date ? new Intl.DateTimeFormat("en-US", { hour: "numeric", minute: "2-digit" }).format(date) : "";
135
+ }
136
+ //# sourceMappingURL=pickers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickers.js","sourceRoot":"","sources":["../src/pickers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2DAA2D,CAAC;AACnH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AAuBtG,iEAAiE;AACjE,MAAM,CAAC,MAAM,eAAe,GAAwG;IAClI,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IAC5C,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ;IAC/D,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IACxE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO;IAC5E,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW;IAC3E,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS;IAC1C,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO;CACtC,CAAC;AAEF,MAAM,mBAAmB,GAA0C;IACjE,IAAI,EAAE,yBAAyB;IAC/B,GAAG,EAAE,sBAAsB;IAC3B,MAAM,EAAE,mBAAmB;IAC3B,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,6BAA6B;CACrC,CAAC;AAEF,MAAM,U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ewcoder-tui-core/bridge/crewcoder-process\";\nimport { effortLevelsForModel, type EffortLevel } from \"@onpoint-dev-tools/crewcoder-tui-core/state/effort-levels\";\nimport { resolveProviderRecord } from \"@onpoint-dev-tools/crewcoder-tui-core/state/provider-defaults\";\nimport type { TuiCheckpoint, TuiState } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport type { NamedEntry, WorkerSummary } from \"./crewcoder-cli.js\";\nimport type { PaletteCommand } from \"./palette-model.js\";\n\n/** Every list the palette can show. `commands` is the `/` palette itself. */\nexport type PickerKind =\n | \"commands\" | \"menu\" | \"provider\" | \"model\" | \"effort\" | \"mode\" | \"systemPrompt\" | \"promptCommand\" | \"skill\"\n | \"profile\" | \"toolMode\" | \"removeDir\" | \"session\" | \"rewind\" | \"rewindConfirm\" | \"handoff\" | \"theme\"\n // Where a /crew or /team runs (here or in tmux); handled by SessionController.\n | \"crewLaunch\";\n\nexport type Picker = {\n kind: PickerKind;\n title?: string;\n placeholder: string;\n emptyText: string;\n items: PaletteCommand[];\n loading: boolean;\n /** Replaces the default `↑↓ navigate · Enter select · Esc close` row (pickers with extra keys). */\n hint?: string;\n};\n\n/** Typed names (including legacy aliases) that open a picker. */\nexport const PICKER_COMMANDS: Readonly<Record<string, Exclude<PickerKind, \"commands\" | \"menu\" | \"rewindConfirm\" | \"crewLaunch\">>> = {\n \"/sessions\": \"session\", \"/resume\": \"session\",\n \"/provider\": \"provider\", \"/model\": \"model\", \"/effort\": \"effort\",\n \"/modes\": \"mode\", \"/mode\": \"mode\", \"/workers\": \"mode\", \"/worker\": \"mode\",\n \"/prompts\": \"systemPrompt\", \"/commands\": \"promptCommand\", \"/skills\": \"skill\",\n \"/profile\": \"profile\", \"/tool-mode\": \"toolMode\", \"/remove-dir\": \"removeDir\",\n \"/rewind\": \"rewind\", \"/handoff\": \"handoff\",\n \"/theme\": \"theme\", \"/themes\": \"theme\"\n};\n\nconst EFFORT_DESCRIPTIONS: Readonly<Record<EffortLevel, string>> = {\n none: \"disable model reasoning\",\n low: \"fast, light thinking\",\n medium: \"balanced thinking\",\n high: \"deeper reasoning\",\n xhigh: \"maximum available reasoning\"\n};\n\nexport function providerItems(providers: readonly ProviderRecord[], current: string): PaletteCommand[] {\n return providers.map((provider) => ({\n id: provider.id,\n label: provider.id,\n description: (provider.description ?? provider.title).replace(/^-\\s*/, \"\"),\n current: provider.id === current\n }));\n}\n\nexport function modelItems(providerId: string, provider: ProviderRecord | undefined, current: string): PaletteCommand[] {\n const resolved = resolveProviderRecord(providerId, provider);\n const models = resolved.models.length ? resolved.models : [current];\n return models.map((model) => ({\n id: model,\n label: model,\n description: model === resolved.defaultModel ? \"default\" : undefined,\n current: model === current\n }));\n}\n\nexport function effortItems(provider: string, model: string, current: EffortLevel): PaletteCommand[] {\n return effortLevelsForModel(provider, model).map((level) => ({\n id: level,\n label: level,\n description: EFFORT_DESCRIPTIONS[level],\n current: level === current\n }));\n}\n\n/** Built-in modes, then saved workers. `plugin` only exists under the CrewCode profile. */\nexport function modeItems(state: Pick<TuiState, \"mode\" | \"worker\" | \"integrationProfile\">, workers: readonly WorkerSummary[]): PaletteCommand[] {\n const modes: Array<[string, string]> = [\n [\"general\", \"General coding agent mode\"],\n [\"crewcoder\", \"Clarify, plan, approve, and implement\"],\n ...(state.integrationProfile === \"crewcode\" ? [[\"plugin\", \"CrewCode app plugin architect mode\"] as [string, string]] : []),\n [\"extension\", \"CrewCoder extension architect mode\"]\n ];\n return [\n ...modes.map(([id, description]) => ({ id, label: id, description, group: \"Modes\", current: !state.worker && state.mode === id })),\n ...workers.map((worker) => ({\n id: `worker:${worker.name}`,\n label: worker.name,\n description: worker.ownerName ? `owner: ${worker.ownerName}` : undefined,\n group: \"Workers\",\n current: state.worker === worker.name\n }))\n ];\n}\n\nexport function namedItems(entries: readonly NamedEntry[], current?: string): PaletteCommand[] {\n return entries.map((entry) => ({\n id: entry.name,\n label: entry.name,\n description: entry.description || entry.path,\n current: entry.name === current\n }));\n}\n\nexport function profileItems(current: TuiState[\"integrationProfile\"]): PaletteCommand[] {\n return [\n { id: \"standalone\", label: \"standalone\", description: \"Coding agent without CrewCode desktop compatibility\", current: current === \"standalone\" },\n { id: \"crewcode\", label: \"crewcode\", description: \"CrewCode plugins, mode, tools, and UI compatibility\", current: current === \"crewcode\" }\n ];\n}\n\nexport function toolModeItems(current: \"native\" | \"crewcoder\"): PaletteCommand[] {\n return [\n { id: \"native\", label: \"Provider-native tools\", description: \"Native execution plus CrewCoder specialized tools\", current: current === \"native\" },\n { id: \"crewcoder\", label: \"CrewCoder tools\", description: \"CrewCoder handles tools and approvals for every provider\", current: current === \"crewcoder\" }\n ];\n}\n\nexport function directoryItems(directories: readonly string[]): PaletteCommand[] {\n return directories.map((directory) => ({ id: directory, label: directory }));\n}\n\n/** Newest first, grouped by day, labeled by the session's first prompt. */\nexport function sessionItems(sessions: readonly SessionRecord[], current: string): PaletteCommand[] {\n return sessions.map((session) => ({\n id: session.id,\n label: truncate(session.prompt.replace(/\\s+/g, \" \").trim() || \"Untitled session\", 60),\n description: formatTime(session.startedAt),\n group: formatDay(session.startedAt),\n current: session.id === current\n }));\n}\n\nexport function checkpointItems(checkpoints: readonly TuiCheckpoint[]): PaletteCommand[] {\n return [...checkpoints].reverse().map((checkpoint) => ({\n id: checkpoint.id,\n label: checkpoint.id,\n description: `${checkpoint.toolName ?? \"checkpoint\"} · ${checkpoint.fileCount} files · ${checkpoint.reason}`\n }));\n}\n\nexport function rewindConfirmItems(checkpointId: string, deleteCount: number): PaletteCommand[] {\n return [\n { id: \"cancel\", label: \"Cancel\", description: \"Do not restore this checkpoint\" },\n { id: `restore:${checkpointId}`, label: \"Restore anyway\", description: `Restore ${checkpointId} and delete ${deleteCount} new files` }\n ];\n}\n\nexport function workerItems(workers: readonly WorkerSummary[]): PaletteCommand[] {\n return workers.map((worker) => ({\n id: worker.name,\n label: worker.name,\n description: worker.ownerName ? `owner: ${worker.ownerName}` : \"worker\"\n }));\n}\n\nfunction truncate(text: string, max: number): string {\n return text.length > max ? `${text.slice(0, max - 1)}…` : text;\n}\n\nfunction sessionDate(iso: string): Date | undefined {\n const date = new Date(iso);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\nfunction formatDay(iso: string): string {\n const date = sessionDate(iso);\n if (!date) return \"Unknown date\";\n return new Intl.DateTimeFormat(\"en-US\", { weekday: \"short\", month: \"short\", day: \"2-digit\", year: \"numeric\" })\n .format(date).replaceAll(\",\", \"\");\n}\n\nfunction formatTime(iso: string): string {\n const date = sessionDate(iso);\n return date ? new Intl.DateTimeFormat(\"en-US\", { hour: \"numeric\", minute: \"2-digit\" }).format(date) : \"\";\n}\n"]}
@@ -0,0 +1,32 @@
1
+ import type { TuiEventBlock } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
2
+ /**
3
+ * Prompt history recall, ported from the legacy composer
4
+ * (`crewcoder-tui/src/components/Composer.ts` `recallHistory`).
5
+ *
6
+ * History is this session's user messages, read from the transcript, so it is
7
+ * session-scoped for free and a resumed session recalls its own messages.
8
+ * Each Up loads the next older message; Down walks back toward newer ones and
9
+ * finally restores the draft that was in the composer before the first Up.
10
+ */
11
+ export type HistoryRecall = {
12
+ /** Position in `sentMessages` (0 = newest) of the recalled message; unset when not recalling. */
13
+ index?: number;
14
+ /** Composer text before the first Up, restored by Down past the newest message. */
15
+ draft: string;
16
+ /** The text last put in the composer, to notice the user editing it. */
17
+ recalled?: string;
18
+ };
19
+ export declare const IDLE_RECALL: HistoryRecall;
20
+ /** This session's user messages, newest first, without blanks or back-to-back repeats. */
21
+ export declare function sentMessages(blocks: readonly TuiEventBlock[]): string[];
22
+ /**
23
+ * One Up or Down step. Returns the next recall state and the text to put in
24
+ * the composer, or `undefined` when there is nothing to recall in that
25
+ * direction (the key then does nothing). Editing a recalled message abandons
26
+ * the recall, so the next Up starts again from the newest message.
27
+ */
28
+ export declare function stepRecall(recall: HistoryRecall, direction: "up" | "down", current: string, messages: readonly string[]): {
29
+ recall: HistoryRecall;
30
+ text: string;
31
+ } | undefined;
32
+ //# sourceMappingURL=prompt-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-history.d.ts","sourceRoot":"","sources":["../src/prompt-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAE3F;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAA6B,CAAC;AAExD,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,EAAE,CAUvE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAcrD"}
@@ -0,0 +1,40 @@
1
+ export const IDLE_RECALL = { draft: "" };
2
+ /** This session's user messages, newest first, without blanks or back-to-back repeats. */
3
+ export function sentMessages(blocks) {
4
+ const messages = [];
5
+ for (const block of blocks) {
6
+ // Crew workers' briefs were never typed; the `/crew` or `/team` command that started them was.
7
+ if (block.type !== "user" || block.worker)
8
+ continue;
9
+ const text = block.text.trim();
10
+ // Repeats of the next message are skipped so every Up shows different text.
11
+ if (text && text !== messages[0])
12
+ messages.unshift(text);
13
+ }
14
+ return messages;
15
+ }
16
+ /**
17
+ * One Up or Down step. Returns the next recall state and the text to put in
18
+ * the composer, or `undefined` when there is nothing to recall in that
19
+ * direction (the key then does nothing). Editing a recalled message abandons
20
+ * the recall, so the next Up starts again from the newest message.
21
+ */
22
+ export function stepRecall(recall, direction, current, messages) {
23
+ const active = recall.index !== undefined && current === recall.recalled ? recall : IDLE_RECALL;
24
+ if (direction === "up") {
25
+ const older = active.index === undefined ? 0 : active.index + 1;
26
+ const text = messages[older];
27
+ if (text === undefined)
28
+ return undefined;
29
+ const draft = active.index === undefined ? current : active.draft;
30
+ return { recall: { index: older, draft, recalled: text }, text };
31
+ }
32
+ if (active.index === undefined)
33
+ return undefined;
34
+ if (active.index === 0)
35
+ return { recall: IDLE_RECALL, text: active.draft };
36
+ const newer = active.index - 1;
37
+ const text = messages[newer];
38
+ return { recall: { index: newer, draft: active.draft, recalled: text }, text };
39
+ }
40
+ //# sourceMappingURL=prompt-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-history.js","sourceRoot":"","sources":["../src/prompt-history.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,WAAW,GAAkB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAExD,0FAA0F;AAC1F,MAAM,UAAU,YAAY,CAAC,MAAgC;IAC3D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,+FAA+F;QAC/F,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM;YAAE,SAAS;QACpD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/B,4EAA4E;QAC5E,IAAI,IAAI,IAAI,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;YAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,MAAqB,EACrB,SAAwB,EACxB,OAAe,EACf,QAA2B;IAE3B,MAAM,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acy composer\n * (`crewcoder-tui/src/components/Composer.ts` `recallHistory`).\n *\n * History is this session's user messages, read from the transcript, so it is\n * session-scoped for free and a resumed session recalls its own messages.\n * Each Up loads the next older message; Down walks back toward newer ones and\n * finally restores the draft that was in the composer before the first Up.\n */\nexport type HistoryRecall = {\n /** Position in `sentMessages` (0 = newest) of the recalled message; unset when not recalling. */\n index?: number;\n /** Composer text before the first Up, restored by Down past the newest message. */\n draft: string;\n /** The text last put in the composer, to notice the user editing it. */\n recalled?: string;\n};\n\nexport const IDLE_RECALL: HistoryRecall = { draft: \"\" };\n\n/** This session's user messages, newest first, without blanks or back-to-back repeats. */\nexport function sentMessages(blocks: readonly TuiEventBlock[]): string[] {\n const messages: string[] = [];\n for (const block of blocks) {\n // Crew workers' briefs were never typed; the `/crew` or `/team` command that started them was.\n if (block.type !== \"user\" || block.worker) continue;\n const text = block.text.trim();\n // Repeats of the next message are skipped so every Up shows different text.\n if (text && text !== messages[0]) messages.unshift(text);\n }\n return messages;\n}\n\n/**\n * One Up or Down step. Returns the next recall state and the text to put in\n * the composer, or `undefined` when there is nothing to recall in that\n * direction (the key then does nothing). Editing a recalled message abandons\n * the recall, so the next Up starts again from the newest message.\n */\nexport function stepRecall(\n recall: HistoryRecall,\n direction: \"up\" | \"down\",\n current: string,\n messages: readonly string[]\n): { recall: HistoryRecall; text: string } | undefined {\n const active = recall.index !== undefined && current === recall.recalled ? recall : IDLE_RECALL;\n if (direction === \"up\") {\n const older = active.index === undefined ? 0 : active.index + 1;\n const text = messages[older];\n if (text === undefined) return undefined;\n const draft = active.index === undefined ? current : active.draft;\n return { recall: { index: older, draft, recalled: text }, text };\n }\n if (active.index === undefined) return undefined;\n if (active.index === 0) return { recall: IDLE_RECALL, text: active.draft };\n const newer = active.index - 1;\n const text = messages[newer]!;\n return { recall: { index: newer, draft: active.draft, recalled: text }, text };\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from "react";
2
+ import type { AppTheme } from "../theme.js";
3
+ /**
4
+ * The active theme for the whole tree: termcn tokens through `ThemeProvider`
5
+ * (`useTheme`) and diff/syntax/markdown/logo colors through `AppColorsContext`
6
+ * (`useAppColors`). The theme is chosen once at startup.
7
+ */
8
+ export declare function AppThemeProvider({ theme, children }: {
9
+ theme: AppTheme;
10
+ children: ReactNode;
11
+ }): ReactNode;
12
+ //# sourceMappingURL=app-theme-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-theme-provider.d.ts","sourceRoot":"","sources":["../../src/providers/app-theme-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAOzG"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "@opentui/react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { AppColorsContext } from "../hooks/use-app-colors.js";
4
+ import { ThemeProvider } from "./theme-provider.js";
5
+ /**
6
+ * The active theme for the whole tree: termcn tokens through `ThemeProvider`
7
+ * (`useTheme`) and diff/syntax/markdown/logo colors through `AppColorsContext`
8
+ * (`useAppColors`). The theme is chosen once at startup.
9
+ */
10
+ export function AppThemeProvider({ theme, children }) {
11
+ const colors = useMemo(() => ({ diff: theme.diff, syntax: theme.syntax, markdown: theme.markdown, logo: theme.logo }), [theme]);
12
+ return (_jsx(ThemeProvider, { theme: theme.ui, children: _jsx(AppColorsContext.Provider, { value: colors, children: children }) }));
13
+ }
14
+ //# sourceMappingURL=app-theme-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-theme-provider.js","sourceRoot":"","sources":["../../src/providers/app-theme-provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA4C;IAC5F,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAChI,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,CAAC,EAAE,YAC5B,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YAAG,QAAQ,GAA6B,GAClE,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo, type ReactNode } from \"react\";\nimport { AppColorsContext } from \"../hooks/use-app-colors.js\";\nimport type { AppTheme } from \"../theme.js\";\nimport { ThemeProvider } from \"./theme-provider.js\";\n\n/**\n * The active theme for the whole tree: termcn tokens through `ThemeProvider`\n * (`useTheme`) and diff/syntax/markdown/logo colors through `AppColorsContext`\n * (`useAppColors`). The theme is chosen once at startup.\n */\nexport function AppThemeProvider({ theme, children }: { theme: AppTheme; children: ReactNode }): ReactNode {\n const colors = useMemo(() => ({ diff: theme.diff, syntax: theme.syntax, markdown: theme.markdown, logo: theme.logo }), [theme]);\n return (\n <ThemeProvider theme={theme.ui}>\n <AppColorsContext.Provider value={colors}>{children}</AppColorsContext.Provider>\n </ThemeProvider>\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import type { AutoThemeProviderProps, Theme, ThemeProviderProps } from "../components/ui/types.js";
3
+ export type { AutoThemeProviderProps, BorderStyle, BorderTokens, ColorTokens, SpacingTokens, Theme, ThemeProviderProps, TypographyTokens, } from "../components/ui/types.js";
4
+ export declare const detectColorScheme: () => "dark" | "light";
5
+ export declare const ThemeProvider: ({ children, theme, }: ThemeProviderProps) => React.ReactNode;
6
+ export declare const AutoThemeProvider: ({ children, darkTheme, lightTheme, }: AutoThemeProviderProps) => React.ReactNode;
7
+ export declare const createTheme: (overrides: Partial<Theme> & {
8
+ name: string;
9
+ }) => Theme;
10
+ //# sourceMappingURL=theme-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../src/providers/theme-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,sBAAsB,EACtB,KAAK,EACL,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAKnC,eAAO,MAAM,iBAAiB,QAAO,MAAM,GAAG,OAmB7C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,sBAG3B,kBAAkB,oBAepB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,sCAI/B,sBAAsB,oBAOxB,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,WAAW,OAAO,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,KAC3C,KAmBD,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx } from "@opentui/react/jsx-runtime";
2
+ /* @jsxImportSource @opentui/react */
3
+ import * as React from "react";
4
+ import { ThemeContext } from "../hooks/use-theme.js";
5
+ import { defaultTheme } from "../lib/terminal-themes/default.js";
6
+ const getEnv = (name) => typeof process !== "undefined" && process.env ? process.env[name] : undefined;
7
+ export const detectColorScheme = () => {
8
+ const colorFgBg = getEnv("COLORFGBG");
9
+ if (colorFgBg) {
10
+ const parts = colorFgBg.split(";");
11
+ const background = Number.parseInt(parts.at(-1) ?? "0", 10);
12
+ if (!Number.isNaN(background)) {
13
+ return background <= 6 ? "dark" : "light";
14
+ }
15
+ }
16
+ const termBackground = getEnv("TERM_BACKGROUND");
17
+ if (termBackground === "light") {
18
+ return "light";
19
+ }
20
+ if (termBackground === "dark") {
21
+ return "dark";
22
+ }
23
+ return "dark";
24
+ };
25
+ export const ThemeProvider = ({ children, theme = defaultTheme, }) => {
26
+ const [currentTheme, setCurrentTheme] = React.useState(theme);
27
+ React.useEffect(() => {
28
+ setCurrentTheme(theme);
29
+ }, [theme]);
30
+ const themeValue = React.useMemo(() => ({ setTheme: setCurrentTheme, theme: currentTheme }), [currentTheme]);
31
+ return (_jsx(ThemeContext.Provider, { value: themeValue, children: children }));
32
+ };
33
+ export const AutoThemeProvider = ({ children, darkTheme, lightTheme, }) => {
34
+ const scheme = detectColorScheme();
35
+ return (_jsx(ThemeProvider, { theme: scheme === "dark" ? darkTheme : lightTheme, children: children }));
36
+ };
37
+ export const createTheme = (overrides) => ({
38
+ ...defaultTheme,
39
+ ...overrides,
40
+ border: {
41
+ ...defaultTheme.border,
42
+ ...overrides.border,
43
+ },
44
+ colors: {
45
+ ...defaultTheme.colors,
46
+ ...overrides.colors,
47
+ },
48
+ spacing: {
49
+ ...defaultTheme.spacing,
50
+ ...overrides.spacing,
51
+ },
52
+ typography: {
53
+ ...defaultTheme.typography,
54
+ ...overrides.typography,
55
+ },
56
+ });
57
+ //# sourceMappingURL=theme-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-provider.js","sourceRoot":"","sources":["../../src/providers/theme-provider.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAA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AAC,GAAG,EAAE;QACnB,eAAe,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAC9B,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAC1D,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YAAG,QAAQ,GAAyB,CAC7E,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,QAAQ,EACR,SAAS,EACT,UAAU,GACa,EAAE,EAAE;IAC3B,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,YAC7D,QAAQ,GACK,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAA4C,EACrC,EAAE,CAAC,CAAC;IACX,GAAG,YAAY;IACf,GAAG,SAAS;IACZ,MAAM,EAAE;QACN,GAAG,YAAY,CAAC,MAAM;QACtB,GAAG,SAAS,CAAC,MAAM;KACpB;IACD,MAAM,EAAE;QACN,GAAG,YAAY,CAAC,MAAM;QACtB,GAAG,SAAS,CAAC,MAAM;KACpB;IACD,OAAO,EAAE;QACP,GAAG,YAAY,CAAC,OAAO;QACvB,GAAG,SAAS,CAAC,OAAO;KACrB;IACD,UAAU,EAAE;QACV,GAAG,YAAY,CAAC,UAAU;QAC1B,GAAG,SAAS,CAAC,UAAU;KACxB;CACF,CAAC,CAAC","sourcesContent":["/* @jsxImportSource @opentui/react */\nimport * as React from \"react\";\n\nimport { ThemeContext } from \"../hooks/use-theme.js\";\nimport { defaultTheme } from \"../lib/terminal-themes/default.js\";\nimport type {\n AutoThemeProviderProps,\n Theme,\n ThemeProviderProps,\n} from \"../components/ui/types.js\";\n\nexport type {\n AutoThemeProviderProps,\n BorderStyle,\n BorderTokens,\n ColorTokens,\n SpacingTokens,\n Theme,\n ThemeProviderProps,\n TypographyTokens,\n} from \"../components/ui/types.js\";\n\nconst getEnv = (name: string): string | undefined =>\n typeof process !== \"undefined\" && process.env ? process.env[name] : undefined;\n\nexport const detectColorScheme = (): \"dark\" | \"light\" => {\n const colorFgBg = getEnv(\"COLORFGBG\");\n if (colorFgBg) {\n const parts = colorFgBg.split(\";\");\n const background = Number.parseInt(parts.at(-1) ?? \"0\", 10);\n if (!Number.isNaN(background)) {\n return background <= 6 ? \"dark\" : \"light\";\n }\n }\n\n const termBackground = getEnv(\"TERM_BACKGROUND\");\n if (termBackground === \"light\") {\n return \"light\";\n }\n if (termBackground === \"dark\") {\n return \"dark\";\n }\n\n return \"dark\";\n};\n\nexport const ThemeProvider = ({\n children,\n theme = defaultTheme,\n}: ThemeProviderProps) => {\n const [currentTheme, setCurrentTheme] = React.useState(theme);\n\n React.useEffect(() => {\n setCurrentTheme(theme);\n }, [theme]);\n\n const themeValue = React.useMemo(\n () => ({ setTheme: setCurrentTheme, theme: currentTheme }),\n [currentTheme]\n );\n\n return (\n <ThemeContext.Provider value={themeValue}>{children}</ThemeContext.Provider>\n );\n};\n\nexport const AutoThemeProvider = ({\n children,\n darkTheme,\n lightTheme,\n}: AutoThemeProviderProps) => {\n const scheme = detectColorScheme();\n return (\n <ThemeProvider theme={scheme === \"dark\" ? darkTheme : lightTheme}>\n {children}\n </ThemeProvider>\n );\n};\n\nexport const createTheme = (\n overrides: Partial<Theme> & { name: string }\n): Theme => ({\n ...defaultTheme,\n ...overrides,\n border: {\n ...defaultTheme.border,\n ...overrides.border,\n },\n colors: {\n ...defaultTheme.colors,\n ...overrides.colors,\n },\n spacing: {\n ...defaultTheme.spacing,\n ...overrides.spacing,\n },\n typography: {\n ...defaultTheme.typography,\n ...overrides.typography,\n },\n});\n"]}