@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
package/dist/cli.js ADDED
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env node
2
+ import { jsx as _jsx } from "@opentui/react/jsx-runtime";
3
+ import path from "node:path";
4
+ import { effortLevelsForModel, normalizeEffort } from "@onpoint-dev-tools/crewcoder-tui-core/state/effort-levels";
5
+ import { normalizeTuiMode } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
6
+ import { CrewCoderProcessBridge } from "@onpoint-dev-tools/crewcoder-tui-core/bridge/crewcoder-process";
7
+ import { readCrewCoderRemoteConnection } from "@onpoint-dev-tools/crewcoder-tui-core/bridge/remote-connection";
8
+ import { readGitLabel, readGitLabelAsync, readGitRepoName } from "@onpoint-dev-tools/crewcoder-tui-core/state/git-status";
9
+ import { createCliRenderer } from "@opentui/core";
10
+ import { createRoot } from "@opentui/react";
11
+ import { mouseEnabled, parseArgs, USAGE } from "./args.js";
12
+ import { spawnInTerminal } from "./hunk.js";
13
+ import { Root } from "./Root.js";
14
+ import { SessionController } from "./session-controller.js";
15
+ import { registerBundledGrammars } from "./syntax/grammars.js";
16
+ import { defaultThemeDirs, fileThemeStore, resolveStartupTheme } from "./theme-controller.js";
17
+ import { readCrewHandoff, systemTmux } from "./tmux.js";
18
+ import { copyAlert, readTmuxOption, readTmuxSettings, TMUX_HINT_ENV, tmuxIssues, tmuxSettingsAlert } from "./tmux-check.js";
19
+ async function main() {
20
+ const parsed = parseArgs(process.argv.slice(2));
21
+ if (parsed.help) {
22
+ process.stdout.write(USAGE);
23
+ return;
24
+ }
25
+ // A crew handed over from another UI ("Run in tmux"). Read first: its CREWCODER_*
26
+ // variables (agent binary, home, theme) must apply before anything reads them.
27
+ const crew = parsed.crewFile ? readCrewHandoff(parsed.crewFile) : undefined;
28
+ if (crew)
29
+ Object.assign(process.env, crew.env);
30
+ // Remote mode is resolved by the shared bridge from these variables.
31
+ if (parsed.remote)
32
+ process.env.CREWCODER_REMOTE = parsed.remote;
33
+ if (parsed.remoteCwd)
34
+ process.env.CREWCODER_REMOTE_CWD = parsed.remoteCwd;
35
+ if (parsed.remoteBin)
36
+ process.env.CREWCODER_REMOTE_BIN = parsed.remoteBin;
37
+ // Before the renderer starts, so a bad --theme / CREWCODER_THEME fails with a
38
+ // plain error on a normal screen. A saved pick that broke falls back to slate.
39
+ const themeStore = fileThemeStore();
40
+ const themeDirs = defaultThemeDirs();
41
+ const startupTheme = resolveStartupTheme(parsed.theme, process.env.CREWCODER_THEME, themeStore, themeDirs);
42
+ // Bundled Tree-sitter grammars (local files only) must be registered before
43
+ // the first highlight starts OpenTUI's parser worker.
44
+ registerBundledGrammars();
45
+ const controller = new SessionController(new CrewCoderProcessBridge());
46
+ controller.themes.configure(startupTheme, themeStore, themeDirs);
47
+ if (startupTheme.warning)
48
+ controller.alert({ variant: "warning", title: "Theme", body: startupTheme.warning });
49
+ const remote = readCrewCoderRemoteConnection();
50
+ if (remote) {
51
+ // The workspace is `<target>:<cwd>` on the SSH host (sidebar footer, welcome
52
+ // screen). Never inspect the local directory for it: no repo name, no git label.
53
+ controller.state.cwd = remote.cwd;
54
+ controller.state.remoteTarget = remote.target;
55
+ }
56
+ else {
57
+ controller.state.gitRepo = readGitRepoName(controller.state.cwd);
58
+ controller.state.gitLabel = readGitLabel(controller.state.cwd);
59
+ controller.sidebar.gitLabelReader = readGitLabelAsync;
60
+ // /crew and /team ask "here or tmux" only when tmux exists and the workspace is local.
61
+ const launcher = systemTmux();
62
+ const self = path.resolve(process.argv[1] ?? "");
63
+ if (launcher)
64
+ controller.crewTmux = { launcher, command: (file) => [process.execPath, ...process.execArgv, self, "--crew-file", file] };
65
+ }
66
+ if (crew)
67
+ applyCrewSettings(controller, crew);
68
+ // Full screen: the UI draws the whole conversation in a scrollbox, so tools
69
+ // update in place and tool output can expand and collapse.
70
+ const renderer = await createCliRenderer({
71
+ exitOnCtrlC: false,
72
+ screenMode: "alternate-screen",
73
+ // CREWCODER_TUI_MOUSE=0 leaves the mouse to the terminal (native selection).
74
+ useMouse: mouseEnabled(),
75
+ backgroundColor: controller.themes.current.ui.colors.background,
76
+ onDestroy: () => controller.dispose()
77
+ });
78
+ // The mouse belongs to the UI, so a finished drag selection is copied over
79
+ // OSC 52 (most terminals; Shift+drag still uses the terminal's own selection).
80
+ renderer.on("selection", (selection) => {
81
+ const text = selection.getSelectedText();
82
+ // Under tmux the write is dropped unless `set-clipboard on`; say so instead of "Copied".
83
+ // Read at copy time so fixing tmux.conf works without a restart.
84
+ if (text && renderer.copyToClipboardOSC52(text)) {
85
+ controller.alert(copyAlert(text.length, process.env.TMUX ? readTmuxOption("set-clipboard") : undefined));
86
+ }
87
+ });
88
+ // Inside tmux, say once which settings are missing (copy, Shift+Enter, focus, colors).
89
+ const tmuxAlert = process.env[TMUX_HINT_ENV] === "0" ? undefined : tmuxSettingsAlert(tmuxIssues(readTmuxSettings() ?? {}));
90
+ if (tmuxAlert && !controller.currentAlert)
91
+ controller.alert(tmuxAlert);
92
+ // /diff: Hunk takes over the terminal; the renderer gives it back afterwards.
93
+ controller.runInTerminal = async (command, args, cwd) => {
94
+ await renderer.suspend();
95
+ try {
96
+ return await spawnInTerminal(command, args, cwd);
97
+ }
98
+ finally {
99
+ await renderer.resume();
100
+ }
101
+ };
102
+ // /repaint: OpenTUI has no public full-redraw call, and a resize to the same
103
+ // size is a no-op (0.9.2 only repaints when a different size was seen in
104
+ // between). Resizing one row away and straight back reallocates the frame and
105
+ // redraws every cell; both calls run before the next frame, so nothing flashes.
106
+ controller.repaint = () => {
107
+ const { terminalWidth: width, terminalHeight: height } = renderer;
108
+ renderer.resize(width, Math.max(1, height - 1));
109
+ renderer.resize(width, height);
110
+ };
111
+ const quit = () => {
112
+ renderer.destroy();
113
+ process.exit(0);
114
+ };
115
+ controller.quit = quit;
116
+ // /theme previews and picks: the terminal area outside the React tree follows too.
117
+ controller.themes.onChange = (theme) => renderer.setBackgroundColor(theme.ui.colors.background);
118
+ createRoot(renderer).render(_jsx(Root, { controller: controller, onQuit: quit }));
119
+ // The handed-over crew starts right away, with the settings it was launched with.
120
+ if (crew)
121
+ controller.startCrew(crew.target, crew.task, crew.command);
122
+ void controller.loadExtensionRenderers();
123
+ }
124
+ /** The launching UI's provider, model, effort, mode, system prompt, and access. */
125
+ function applyCrewSettings(controller, crew) {
126
+ const state = controller.state;
127
+ state.provider = crew.provider;
128
+ state.model = crew.model;
129
+ state.effort = normalizeEffort(crew.effort, effortLevelsForModel(crew.provider, crew.model)) ?? state.effort;
130
+ state.mode = normalizeTuiMode(crew.mode);
131
+ state.systemPrompt = crew.systemPrompt;
132
+ state.fullAccess = crew.fullAccess;
133
+ }
134
+ main().catch((error) => {
135
+ process.stderr.write(`crewcoder-opentui: ${error instanceof Error ? error.message : String(error)}\n`);
136
+ process.exit(1);
137
+ });
138
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":";;AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAE,6BAA6B,EAAE,MAAM,gEAAgE,CAAC;AAC/G,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAC1H,OAAO,EAAE,iBAAiB,EAAkB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,UAAU,EAAoB,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,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CAAC;IACrE,KAAK,UAAU,CAAC,sBAAsB,EAAE,CAAC;AAC3C,CAAC;AAED,mFAAmF;AACnF,SAAS,iBAAiB,CAAC,UAA6B,EAAE,IAAiB;IACzE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAC/B,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,KAAK,CAAC,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC;IAC7G,KAAK,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACvC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;AACrC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport path from \"node:path\";\nimport { effortLevelsForModel, normalizeEffort } from \"@onpoint-dev-tools/crewcoder-tui-core/state/effort-levels\";\nimport { normalizeTuiMode } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport { CrewCoderProcessBridge } from \"@onpoint-dev-tools/crewcoder-tui-core/bridge/crewcoder-process\";\nimport { readCrewCoderRemoteConnection } from \"@onpoint-dev-tools/crewcoder-tui-core/bridge/remote-connection\";\nimport { readGitLabel, readGitLabelAsync, readGitRepoName } from \"@onpoint-dev-tools/crewcoder-tui-core/state/git-status\";\nimport { createCliRenderer, type Selection } from \"@opentui/core\";\nimport { createRoot } from \"@opentui/react\";\nimport { mouseEnabled, parseArgs, USAGE } from \"./args.js\";\nimport { spawnInTerminal } from \"./hunk.js\";\nimport { Root } from \"./Root.js\";\nimport { SessionController } from \"./session-controller.js\";\nimport { registerBundledGrammars } from \"./syntax/grammars.js\";\nimport { defaultThemeDirs, fileThemeStore, resolveStartupTheme } from \"./theme-controller.js\";\nimport { readCrewHandoff, systemTmux, type CrewHandoff } from \"./tmux.js\";\nimport { copyAlert, readTmuxOption, readTmuxSettings, TMUX_HINT_ENV, tmuxIssues, tmuxSettingsAlert } from \"./tmux-check.js\";\n\nasync function main(): Promise<void> {\n const parsed = parseArgs(process.argv.slice(2));\n if (parsed.help) {\n process.stdout.write(USAGE);\n return;\n }\n // A crew handed over from another UI (\"Run in tmux\"). Read first: its CREWCODER_*\n // variables (agent binary, home, theme) must apply before anything reads them.\n const crew = parsed.crewFile ? readCrewHandoff(parsed.crewFile) : undefined;\n if (crew) Object.assign(process.env, crew.env);\n // Remote mode is resolved by the shared bridge from these variables.\n if (parsed.remote) process.env.CREWCODER_REMOTE = parsed.remote;\n if (parsed.remoteCwd) process.env.CREWCODER_REMOTE_CWD = parsed.remoteCwd;\n if (parsed.remoteBin) process.env.CREWCODER_REMOTE_BIN = parsed.remoteBin;\n // Before the renderer starts, so a bad --theme / CREWCODER_THEME fails with a\n // plain error on a normal screen. A saved pick that broke falls back to slate.\n const themeStore = fileThemeStore();\n const themeDirs = defaultThemeDirs();\n const startupTheme = resolveStartupTheme(parsed.theme, process.env.CREWCODER_THEME, themeStore, themeDirs);\n\n // Bundled Tree-sitter grammars (local files only) must be registered before\n // the first highlight starts OpenTUI's parser worker.\n registerBundledGrammars();\n const controller = new SessionController(new CrewCoderProcessBridge());\n controller.themes.configure(startupTheme, themeStore, themeDirs);\n if (startupTheme.warning) controller.alert({ variant: \"warning\", title: \"Theme\", body: startupTheme.warning });\n const remote = readCrewCoderRemoteConnection();\n if (remote) {\n // The workspace is `<target>:<cwd>` on the SSH host (sidebar footer, welcome\n // screen). Never inspect the local directory for it: no repo name, no git label.\n controller.state.cwd = remote.cwd;\n controller.state.remoteTarget = remote.target;\n } else {\n controller.state.gitRepo = readGitRepoName(controller.state.cwd);\n controller.state.gitLabel = readGitLabel(controller.state.cwd);\n controller.sidebar.gitLabelReader = readGitLabelAsync;\n // /crew and /team ask \"here or tmux\" only when tmux exists and the workspace is local.\n const launcher = systemTmux();\n const self = path.resolve(process.argv[1] ?? \"\");\n if (launcher) controller.crewTmux = { launcher, command: (file) => [process.execPath, ...process.execArgv, self, \"--crew-file\", file] };\n }\n if (crew) applyCrewSettings(controller, crew);\n // Full screen: the UI draws the whole conversation in a scrollbox, so tools\n // update in place and tool output can expand and collapse.\n const renderer = await createCliRenderer({\n exitOnCtrlC: false,\n screenMode: \"alternate-screen\",\n // CREWCODER_TUI_MOUSE=0 leaves the mouse to the terminal (native selection).\n useMouse: mouseEnabled(),\n backgroundColor: controller.themes.current.ui.colors.background,\n onDestroy: () => controller.dispose()\n });\n // The mouse belongs to the UI, so a finished drag selection is copied over\n // OSC 52 (most terminals; Shift+drag still uses the terminal's own selection).\n renderer.on(\"selection\", (selection: Selection) => {\n const text = selection.getSelectedText();\n // Under tmux the write is dropped unless `set-clipboard on`; say so instead of \"Copied\".\n // Read at copy time so fixing tmux.conf works without a restart.\n if (text && renderer.copyToClipboardOSC52(text)) {\n controller.alert(copyAlert(text.length, process.env.TMUX ? readTmuxOption(\"set-clipboard\") : undefined));\n }\n });\n // Inside tmux, say once which settings are missing (copy, Shift+Enter, focus, colors).\n const tmuxAlert = process.env[TMUX_HINT_ENV] === \"0\" ? undefined : tmuxSettingsAlert(tmuxIssues(readTmuxSettings() ?? {}));\n if (tmuxAlert && !controller.currentAlert) controller.alert(tmuxAlert);\n // /diff: Hunk takes over the terminal; the renderer gives it back afterwards.\n controller.runInTerminal = async (command, args, cwd) => {\n await renderer.suspend();\n try {\n return await spawnInTerminal(command, args, cwd);\n } finally {\n await renderer.resume();\n }\n };\n // /repaint: OpenTUI has no public full-redraw call, and a resize to the same\n // size is a no-op (0.9.2 only repaints when a different size was seen in\n // between). Resizing one row away and straight back reallocates the frame and\n // redraws every cell; both calls run before the next frame, so nothing flashes.\n controller.repaint = () => {\n const { terminalWidth: width, terminalHeight: height } = renderer;\n renderer.resize(width, Math.max(1, height - 1));\n renderer.resize(width, height);\n };\n const quit = (): void => {\n renderer.destroy();\n process.exit(0);\n };\n controller.quit = quit;\n // /theme previews and picks: the terminal area outside the React tree follows too.\n controller.themes.onChange = (theme) => renderer.setBackgroundColor(theme.ui.colors.background);\n createRoot(renderer).render(<Root controller={controller} onQuit={quit} />);\n // The handed-over crew starts right away, with the settings it was launched with.\n if (crew) controller.startCrew(crew.target, crew.task, crew.command);\n void controller.loadExtensionRenderers();\n}\n\n/** The launching UI's provider, model, effort, mode, system prompt, and access. */\nfunction applyCrewSettings(controller: SessionController, crew: CrewHandoff): void {\n const state = controller.state;\n state.provider = crew.provider;\n state.model = crew.model;\n state.effort = normalizeEffort(crew.effort, effortLevelsForModel(crew.provider, crew.model)) ?? state.effort;\n state.mode = normalizeTuiMode(crew.mode);\n state.systemPrompt = crew.systemPrompt;\n state.fullAccess = crew.fullAccess;\n}\n\nmain().catch((error: unknown) => {\n process.stderr.write(`crewcoder-opentui: ${error instanceof Error ? error.message : String(error)}\\n`);\n process.exit(1);\n});\n"]}
@@ -0,0 +1,18 @@
1
+ import type { TuiDecisionExplanation, TuiGoal, TuiReviewSummary } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
2
+ import type { FooterAlert } from "./alert-model.js";
3
+ /** Pure formatting of structured command results into alert text. */
4
+ export declare function goalLines(goal: TuiGoal): string[];
5
+ export declare function goalsAlert(goals: readonly TuiGoal[]): FooterAlert;
6
+ /**
7
+ * `/why`. The badge keeps a real model explanation visibly distinct from the
8
+ * deterministic transcript readout the backend falls back to.
9
+ */
10
+ export declare function whyAlert(decision: TuiDecisionExplanation): FooterAlert;
11
+ export declare function reviewSummaryAlert(summary: TuiReviewSummary): FooterAlert;
12
+ /** Text output of a one-shot CLI command; stderr turns it into an error. */
13
+ export declare function cliOutputAlert(title: string, result: {
14
+ stdout: string;
15
+ stderr: string;
16
+ exitCode: number;
17
+ }): FooterAlert;
18
+ //# sourceMappingURL=command-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-format.d.ts","sourceRoot":"","sources":["../src/command-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AAC/H,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,qEAAqE;AAErE,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAYjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,WAAW,CAQjE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,GAAG,WAAW,CAUtE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW,CASzE;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAMvH"}
@@ -0,0 +1,66 @@
1
+ /** Pure formatting of structured command results into alert text. */
2
+ export function goalLines(goal) {
3
+ const turns = goal.maxTurns ? `${goal.cycle}/${goal.maxTurns}` : String(goal.cycle);
4
+ const lines = [
5
+ `${goal.id} · ${goal.status.replace("_", " ")} · turn ${turns} · ${goal.provider}/${goal.model}`,
6
+ ` ${goal.objective}`
7
+ ];
8
+ if (goal.pendingApproval)
9
+ lines.push(` needs approval: ${goal.pendingApproval.toolName} (${goal.pendingApproval.reason}) — /goal approve or /goal deny`);
10
+ if (goal.lastCheck)
11
+ lines.push(` last check (${goal.lastCheck.model}): ${goal.lastCheck.verdict} — ${goal.lastCheck.reason}`);
12
+ if (goal.pauseReason)
13
+ lines.push(` paused: ${goal.pauseReason}`);
14
+ if (goal.error)
15
+ lines.push(` error: ${goal.error}`);
16
+ if (goal.completionSummary)
17
+ lines.push(` done: ${goal.completionSummary}`);
18
+ return lines;
19
+ }
20
+ export function goalsAlert(goals) {
21
+ if (!goals.length)
22
+ return { variant: "info", title: "No goal found in this workspace", body: "Start one with /goal <objective>." };
23
+ const attention = goals.some((goal) => goal.status === "failed" || goal.status === "awaiting_approval");
24
+ return {
25
+ variant: attention ? "warning" : "info",
26
+ title: goals.length === 1 ? "Goal" : `Goals (${goals.length})`,
27
+ body: goals.flatMap(goalLines).join("\n")
28
+ };
29
+ }
30
+ /**
31
+ * `/why`. The badge keeps a real model explanation visibly distinct from the
32
+ * deterministic transcript readout the backend falls back to.
33
+ */
34
+ export function whyAlert(decision) {
35
+ const lines = [decision.explanation];
36
+ if (decision.toolCalls.length)
37
+ lines.push("", `Tools: ${decision.toolCalls.join(", ")}`);
38
+ if (decision.changedFiles.length)
39
+ lines.push(`Files: ${decision.changedFiles.join(", ")}`);
40
+ if (decision.fallbackReason)
41
+ lines.push("", `Fallback: ${decision.fallbackReason}`);
42
+ return {
43
+ variant: decision.source === "model" ? "info" : "warning",
44
+ title: decision.source === "model" ? "Why · model explanation" : "Why · transcript readout",
45
+ body: lines.join("\n")
46
+ };
47
+ }
48
+ export function reviewSummaryAlert(summary) {
49
+ const lines = [
50
+ `Branch: ${summary.branch ?? "(detached)"} · ${summary.clean ? "clean" : `${summary.changedFiles.length} changed`}`,
51
+ ...summary.changedFiles.map((file) => ` ${file}`)
52
+ ];
53
+ if (summary.issueReferences.length) {
54
+ lines.push("Issues:", ...summary.issueReferences.map((ref) => ` ${ref.id} (${ref.source}) ${ref.text}${ref.url ? ` ${ref.url}` : ""}`));
55
+ }
56
+ return { variant: "info", title: "Review summary", body: lines.join("\n") };
57
+ }
58
+ /** Text output of a one-shot CLI command; stderr turns it into an error. */
59
+ export function cliOutputAlert(title, result) {
60
+ if (result.exitCode !== 0) {
61
+ return { variant: "error", title, body: result.stderr.trim() || result.stdout.trim() || `Exited with code ${result.exitCode}.` };
62
+ }
63
+ const body = [result.stdout.trim(), result.stderr.trim()].filter(Boolean).join("\n");
64
+ return { variant: "info", title, body: body || "(no output)" };
65
+ }
66
+ //# sourceMappingURL=command-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-format.js","sourceRoot":"","sources":["../src/command-format.ts"],"names":[],"mappings":"AAGA,qEAAqE;AAErE,MAAM,UAAU,SAAS,CAAC,IAAa;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG;QACZ,GAAG,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,WAAW,KAAK,MAAM,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,EAAE;QAChG,KAAK,IAAI,CAAC,SAAS,EAAE;KACtB,CAAC;IACF,IAAI,IAAI,CAAC,eAAe;QAAE,KAAK,CAAC,IAAI,CAAC,qBAAqB,IAAI,CAAC,eAAe,CAAC,QAAQ,KAAK,IAAI,CAAC,eAAe,CAAC,MAAM,iCAAiC,CAAC,CAAC;IAC1J,IAAI,IAAI,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,IAAI,CA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,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3I,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC9E,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,MAA4D;IACxG,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,oBAAoB,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;IACnI,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,IAAI,aAAa,EAAE,CAAC;AACjE,CAAC","sourcesContent":["import type { TuiDecisionExplanation, TuiGoal, TuiReviewSummary } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport type { FooterAlert } from \"./alert-model.js\";\n\n/** Pure formatting of structured command results into alert text. */\n\nexport function goalLines(goal: TuiGoal): string[] {\n const turns = goal.maxTurns ? `${goal.cycle}/${goal.maxTurns}` : String(goal.cycle);\n const lines = [\n `${goal.id} · ${goal.status.replace(\"_\", \" \")} · turn ${turns} · ${goal.provider}/${goal.model}`,\n ` ${goal.objective}`\n ];\n if (goal.pendingApproval) lines.push(` needs approval: ${goal.pendingApproval.toolName} (${goal.pendingApproval.reason}) — /goal approve or /goal deny`);\n if (goal.lastCheck) lines.push(` last check (${goal.lastCheck.model}): ${goal.lastCheck.verdict} — ${goal.lastCheck.reason}`);\n if (goal.pauseReason) lines.push(` paused: ${goal.pauseReason}`);\n if (goal.error) lines.push(` error: ${goal.error}`);\n if (goal.completionSummary) lines.push(` done: ${goal.completionSummary}`);\n return lines;\n}\n\nexport function goalsAlert(goals: readonly TuiGoal[]): FooterAlert {\n if (!goals.length) return { variant: \"info\", title: \"No goal found in this workspace\", body: \"Start one with /goal <objective>.\" };\n const attention = goals.some((goal) => goal.status === \"failed\" || goal.status === \"awaiting_approval\");\n return {\n variant: attention ? \"warning\" : \"info\",\n title: goals.length === 1 ? \"Goal\" : `Goals (${goals.length})`,\n body: goals.flatMap(goalLines).join(\"\\n\")\n };\n}\n\n/**\n * `/why`. The badge keeps a real model explanation visibly distinct from the\n * deterministic transcript readout the backend falls back to.\n */\nexport function whyAlert(decision: TuiDecisionExplanation): FooterAlert {\n const lines = [decision.explanation];\n if (decision.toolCalls.length) lines.push(\"\", `Tools: ${decision.toolCalls.join(\", \")}`);\n if (decision.changedFiles.length) lines.push(`Files: ${decision.changedFiles.join(\", \")}`);\n if (decision.fallbackReason) lines.push(\"\", `Fallback: ${decision.fallbackReason}`);\n return {\n variant: decision.source === \"model\" ? \"info\" : \"warning\",\n title: decision.source === \"model\" ? \"Why · model explanation\" : \"Why · transcript readout\",\n body: lines.join(\"\\n\")\n };\n}\n\nexport function reviewSummaryAlert(summary: TuiReviewSummary): FooterAlert {\n const lines = [\n `Branch: ${summary.branch ?? \"(detached)\"} · ${summary.clean ? \"clean\" : `${summary.changedFiles.length} changed`}`,\n ...summary.changedFiles.map((file) => ` ${file}`)\n ];\n if (summary.issueReferences.length) {\n lines.push(\"Issues:\", ...summary.issueReferences.map((ref) => ` ${ref.id} (${ref.source}) ${ref.text}${ref.url ? ` ${ref.url}` : \"\"}`));\n }\n return { variant: \"info\", title: \"Review summary\", body: lines.join(\"\\n\") };\n}\n\n/** Text output of a one-shot CLI command; stderr turns it into an error. */\nexport function cliOutputAlert(title: string, result: { stdout: string; stderr: string; exitCode: number }): FooterAlert {\n if (result.exitCode !== 0) {\n return { variant: \"error\", title, body: result.stderr.trim() || result.stdout.trim() || `Exited with code ${result.exitCode}.` };\n }\n const body = [result.stdout.trim(), result.stderr.trim()].filter(Boolean).join(\"\\n\");\n return { variant: \"info\", title, body: body || \"(no output)\" };\n}\n"]}
@@ -0,0 +1,128 @@
1
+ import { type CrewCoderCrewTarget } from "@onpoint-dev-tools/crewcoder-tui-core/bridge/crewcoder-process";
2
+ import { type GoalStartInput } from "@onpoint-dev-tools/crewcoder-tui-core/state/command-results";
3
+ import { type TerminalRun } from "./hunk.js";
4
+ import { type GoalDefaults } from "./goal-form.js";
5
+ import type { PaletteCommand } from "./palette-model.js";
6
+ import type { PickerFlows, PickerHost } from "./picker-flows.js";
7
+ import type { SidebarController } from "./sidebar.js";
8
+ /** A summary waiting in the compaction editor, idle (saved session) or live (running loop). */
9
+ export type SummaryEditorState = {
10
+ summary: string;
11
+ context: {
12
+ mode: "idle";
13
+ sessionId: string;
14
+ } | {
15
+ mode: "live";
16
+ previewId: string;
17
+ };
18
+ source?: string;
19
+ originalMessageCount?: number;
20
+ retainedMessageCount?: number;
21
+ };
22
+ /** What commands may do to the session. Implemented by SessionController. */
23
+ export interface CommandHost extends PickerHost {
24
+ openCommandPalette(): void;
25
+ openMenu(title: string, items: PaletteCommand[], load?: () => Promise<PaletteCommand[]>): void;
26
+ startPrompt(text: string): void;
27
+ /** `/crew`, `/team`: ask here-or-tmux when tmux is available, then run; `command` is the typed text. */
28
+ launchCrew(target: CrewCoderCrewTarget, task: string, command: string): void;
29
+ queueFollowUp(text: string): boolean;
30
+ resolveApproval(approvalId: string | undefined, approved: boolean): void;
31
+ clearScreen(): void;
32
+ openSummaryEditor(editor: SummaryEditorState): void;
33
+ requestLiveCompactionPreview(): boolean;
34
+ /** Hands the terminal to a full-screen program (wired by cli.tsx); undefined without one. */
35
+ readonly runInTerminal: TerminalRun | undefined;
36
+ /** Redraws every cell of the screen (wired by cli.tsx); undefined without a renderer. */
37
+ readonly repaint: (() => void) | undefined;
38
+ /** Leaves the UI like Ctrl+C (wired by cli.tsx); undefined without a renderer. */
39
+ readonly quit: (() => void) | undefined;
40
+ readonly sidebar: SidebarController;
41
+ /** `/find [text]`: open transcript search, like Ctrl+F. */
42
+ openSearch(query?: string): void;
43
+ /** Reload extension tool renderers (`/reload`). */
44
+ loadExtensionRenderers(): Promise<void>;
45
+ /** Bare `/goal`: the preflight form, prefilled from `config.goals`. */
46
+ openGoalForm(defaults: GoalDefaults): void;
47
+ }
48
+ /**
49
+ * Every slash command that is not a picker. Results are alerts (status,
50
+ * on/off, and text output); failures are error alerts. None of them sends a
51
+ * prompt to the agent except /approve-plan, which is a prompt by design.
52
+ */
53
+ export declare class CommandRunner {
54
+ private readonly host;
55
+ private readonly flows;
56
+ private readonly handlers;
57
+ constructor(host: CommandHost, flows: PickerFlows);
58
+ /** Run `name` with the raw text after it. Returns false for commands it does not own. */
59
+ run(name: string, rest: string): boolean;
60
+ /** Install an edited summary into a saved session (idle compaction preview). */
61
+ applyEditedSummary(sessionId: string, summary: string): Promise<void>;
62
+ private alert;
63
+ private get state();
64
+ private busy;
65
+ private savedSession;
66
+ /**
67
+ * `/ext.<extension-id>.<command-id> [args]`: runs an extension's executable
68
+ * command through `crewcoder command run`, which enforces the extension's
69
+ * trust (as in the legacy UI). Its notifications come back as one alert;
70
+ * nothing is sent to the agent. `--` keeps typed arguments from being read as
71
+ * agent CLI options, and the CLI runs without a shell.
72
+ */
73
+ private extensionCommand;
74
+ private quit;
75
+ /**
76
+ * Recovery for a garbled screen: something wrote to the terminal behind
77
+ * OpenTUI's back (a stray child process, a system message, a glitch after
78
+ * /diff). Silent on success; the redrawn screen is the result.
79
+ */
80
+ private repaint;
81
+ /** Review this session's file changes in Hunk; the UI is suspended until Hunk exits. */
82
+ private diff;
83
+ /** Bare `/sidebar` toggles; on/off/status are explicit. Display only: nothing is saved. */
84
+ private setSidebar;
85
+ /**
86
+ * Show or hide modified files in the sidebar. Tracking never stops, so
87
+ * turning it back on restores the list. Instance-local and kept across /new.
88
+ */
89
+ private fileChanges;
90
+ private usage;
91
+ private readConfig;
92
+ private cliAlert;
93
+ private configToggle;
94
+ private fullAccess;
95
+ private compact;
96
+ private compactNow;
97
+ private previewCompaction;
98
+ private modelArgs;
99
+ private memory;
100
+ private remember;
101
+ private setBudget;
102
+ private addDirectory;
103
+ private task;
104
+ /** CrewCode app plugin templates: only meaningful with CrewCode integration on. */
105
+ private plugins;
106
+ /** `/team <team> <task>`: a team declared in crewcoder.json, streamed live. */
107
+ private team;
108
+ /** `/crew <worker1,worker2> <task>`: named workers in order, streamed live. */
109
+ private crew;
110
+ private reviewSummary;
111
+ /** A one-shot `session why`, never a prompt in the session. */
112
+ private why;
113
+ /**
114
+ * Fork the current session in place. Refused mid-run: the copy would miss the
115
+ * rest of the turn (and any follow-ups), which keep going to the original.
116
+ */
117
+ private branch;
118
+ private exportSession;
119
+ private reload;
120
+ private goal;
121
+ /** Detached goals run in CrewCoder's supervisor; closing the TUI does not stop them. */
122
+ startGoal(start: GoalStartInput): Promise<void>;
123
+ private goalArgs;
124
+ private clear;
125
+ private approvePlan;
126
+ private followUp;
127
+ }
128
+ //# sourceMappingURL=command-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-runner.d.ts","sourceRoot":"","sources":["../src/command-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiC,KAAK,mBAAmB,EAAE,MAAM,gEAAgE,CAAC;AACzI,OAAO,EAEyD,KAAK,cAAc,EAClF,MAAM,6DAA6D,CAAC;AASrE,OAAO,EAAiD,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC5F,OAAO,EAA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