@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.
- package/LICENSE +191 -0
- package/README.md +262 -2
- package/THIRD_PARTY_NOTICES.md +51 -0
- package/dist/App.d.ts +16 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +428 -0
- package/dist/App.js.map +1 -0
- package/dist/Root.d.ts +11 -0
- package/dist/Root.d.ts.map +1 -0
- package/dist/Root.js +13 -0
- package/dist/Root.js.map +1 -0
- package/dist/alert-model.d.ts +31 -0
- package/dist/alert-model.d.ts.map +1 -0
- package/dist/alert-model.js +34 -0
- package/dist/alert-model.js.map +1 -0
- package/dist/args.d.ts +13 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +63 -0
- package/dist/args.js.map +1 -0
- package/dist/attachments.d.ts +29 -0
- package/dist/attachments.d.ts.map +1 -0
- package/dist/attachments.js +38 -0
- package/dist/attachments.js.map +1 -0
- package/dist/block-panels.d.ts +43 -0
- package/dist/block-panels.d.ts.map +1 -0
- package/dist/block-panels.js +210 -0
- package/dist/block-panels.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +138 -0
- package/dist/cli.js.map +1 -0
- package/dist/command-format.d.ts +18 -0
- package/dist/command-format.d.ts.map +1 -0
- package/dist/command-format.js +66 -0
- package/dist/command-format.js.map +1 -0
- package/dist/command-runner.d.ts +128 -0
- package/dist/command-runner.d.ts.map +1 -0
- package/dist/command-runner.js +571 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/commands.d.ts +47 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +108 -0
- package/dist/commands.js.map +1 -0
- package/dist/components/AttachmentRow.d.ts +11 -0
- package/dist/components/AttachmentRow.d.ts.map +1 -0
- package/dist/components/AttachmentRow.js +17 -0
- package/dist/components/AttachmentRow.js.map +1 -0
- package/dist/components/Composer.d.ts +23 -0
- package/dist/components/Composer.d.ts.map +1 -0
- package/dist/components/Composer.js +45 -0
- package/dist/components/Composer.js.map +1 -0
- package/dist/components/ExtensionQuestion.d.ts +18 -0
- package/dist/components/ExtensionQuestion.d.ts.map +1 -0
- package/dist/components/ExtensionQuestion.js +45 -0
- package/dist/components/ExtensionQuestion.js.map +1 -0
- package/dist/components/GoalForm.d.ts +18 -0
- package/dist/components/GoalForm.d.ts.map +1 -0
- package/dist/components/GoalForm.js +26 -0
- package/dist/components/GoalForm.js.map +1 -0
- package/dist/components/Home.d.ts +21 -0
- package/dist/components/Home.d.ts.map +1 -0
- package/dist/components/Home.js +48 -0
- package/dist/components/Home.js.map +1 -0
- package/dist/components/MentionList.d.ts +14 -0
- package/dist/components/MentionList.d.ts.map +1 -0
- package/dist/components/MentionList.js +24 -0
- package/dist/components/MentionList.js.map +1 -0
- package/dist/components/SearchBar.d.ts +19 -0
- package/dist/components/SearchBar.d.ts.map +1 -0
- package/dist/components/SearchBar.js +28 -0
- package/dist/components/SearchBar.js.map +1 -0
- package/dist/components/Sidebar.d.ts +19 -0
- package/dist/components/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar.js +35 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/SummaryEditor.d.ts +16 -0
- package/dist/components/SummaryEditor.d.ts.map +1 -0
- package/dist/components/SummaryEditor.js +21 -0
- package/dist/components/SummaryEditor.js.map +1 -0
- package/dist/components/Transcript.d.ts +37 -0
- package/dist/components/Transcript.d.ts.map +1 -0
- package/dist/components/Transcript.js +314 -0
- package/dist/components/Transcript.js.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +18 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/command-palette.d.ts +15 -0
- package/dist/components/ui/command-palette.d.ts.map +1 -0
- package/dist/components/ui/command-palette.js +14 -0
- package/dist/components/ui/command-palette.js.map +1 -0
- package/dist/components/ui/confirm.d.ts +12 -0
- package/dist/components/ui/confirm.d.ts.map +1 -0
- package/dist/components/ui/confirm.js +16 -0
- package/dist/components/ui/confirm.js.map +1 -0
- package/dist/components/ui/select.d.ts +11 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +29 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +14 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +17 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/tool-approval.d.ts +14 -0
- package/dist/components/ui/tool-approval.d.ts.map +1 -0
- package/dist/components/ui/tool-approval.js +37 -0
- package/dist/components/ui/tool-approval.js.map +1 -0
- package/dist/components/ui/tool-call.d.ts +12 -0
- package/dist/components/ui/tool-call.d.ts.map +1 -0
- package/dist/components/ui/tool-call.js +69 -0
- package/dist/components/ui/tool-call.js.map +1 -0
- package/dist/components/ui/types.d.ts +82 -0
- package/dist/components/ui/types.d.ts.map +1 -0
- package/dist/components/ui/types.js +2 -0
- package/dist/components/ui/types.js.map +1 -0
- package/dist/crewcoder-cli.d.ts +51 -0
- package/dist/crewcoder-cli.d.ts.map +1 -0
- package/dist/crewcoder-cli.js +26 -0
- package/dist/crewcoder-cli.js.map +1 -0
- package/dist/diff-anchors.d.ts +14 -0
- package/dist/diff-anchors.d.ts.map +1 -0
- package/dist/diff-anchors.js +43 -0
- package/dist/diff-anchors.js.map +1 -0
- package/dist/footer-layout.d.ts +49 -0
- package/dist/footer-layout.d.ts.map +1 -0
- package/dist/footer-layout.js +79 -0
- package/dist/footer-layout.js.map +1 -0
- package/dist/glyphs.d.ts +32 -0
- package/dist/glyphs.d.ts.map +1 -0
- package/dist/glyphs.js +35 -0
- package/dist/glyphs.js.map +1 -0
- package/dist/goal-form.d.ts +47 -0
- package/dist/goal-form.d.ts.map +1 -0
- package/dist/goal-form.js +59 -0
- package/dist/goal-form.js.map +1 -0
- package/dist/hooks/use-animation.d.ts +6 -0
- package/dist/hooks/use-animation.d.ts.map +1 -0
- package/dist/hooks/use-animation.js +52 -0
- package/dist/hooks/use-animation.js.map +1 -0
- package/dist/hooks/use-app-colors.d.ts +6 -0
- package/dist/hooks/use-app-colors.d.ts.map +1 -0
- package/dist/hooks/use-app-colors.js +6 -0
- package/dist/hooks/use-app-colors.js.map +1 -0
- package/dist/hooks/use-glyph-set.d.ts +8 -0
- package/dist/hooks/use-glyph-set.d.ts.map +1 -0
- package/dist/hooks/use-glyph-set.js +22 -0
- package/dist/hooks/use-glyph-set.js.map +1 -0
- package/dist/hooks/use-motion.d.ts +6 -0
- package/dist/hooks/use-motion.d.ts.map +1 -0
- package/dist/hooks/use-motion.js +8 -0
- package/dist/hooks/use-motion.js.map +1 -0
- package/dist/hooks/use-terminal-focus.d.ts +16 -0
- package/dist/hooks/use-terminal-focus.d.ts.map +1 -0
- package/dist/hooks/use-terminal-focus.js +30 -0
- package/dist/hooks/use-terminal-focus.js.map +1 -0
- package/dist/hooks/use-theme.d.ts +6 -0
- package/dist/hooks/use-theme.d.ts.map +1 -0
- package/dist/hooks/use-theme.js +11 -0
- package/dist/hooks/use-theme.js.map +1 -0
- package/dist/hunk.d.ts +27 -0
- package/dist/hunk.d.ts.map +1 -0
- package/dist/hunk.js +43 -0
- package/dist/hunk.js.map +1 -0
- package/dist/image-view.d.ts +33 -0
- package/dist/image-view.d.ts.map +1 -0
- package/dist/image-view.js +51 -0
- package/dist/image-view.js.map +1 -0
- package/dist/keybindings.d.ts +28 -0
- package/dist/keybindings.d.ts.map +1 -0
- package/dist/keybindings.js +105 -0
- package/dist/keybindings.js.map +1 -0
- package/dist/lib/terminal-themes/default.d.ts +3 -0
- package/dist/lib/terminal-themes/default.d.ts.map +1 -0
- package/dist/lib/terminal-themes/default.js +49 -0
- package/dist/lib/terminal-themes/default.js.map +1 -0
- package/dist/logo-pulse.d.ts +23 -0
- package/dist/logo-pulse.d.ts.map +1 -0
- package/dist/logo-pulse.js +30 -0
- package/dist/logo-pulse.js.map +1 -0
- package/dist/markdown-style.d.ts +47 -0
- package/dist/markdown-style.d.ts.map +1 -0
- package/dist/markdown-style.js +138 -0
- package/dist/markdown-style.js.map +1 -0
- package/dist/mentions.d.ts +57 -0
- package/dist/mentions.d.ts.map +1 -0
- package/dist/mentions.js +109 -0
- package/dist/mentions.js.map +1 -0
- package/dist/palette-model.d.ts +42 -0
- package/dist/palette-model.d.ts.map +1 -0
- package/dist/palette-model.js +77 -0
- package/dist/palette-model.js.map +1 -0
- package/dist/path-suggestions.d.ts +50 -0
- package/dist/path-suggestions.d.ts.map +1 -0
- package/dist/path-suggestions.js +99 -0
- package/dist/path-suggestions.js.map +1 -0
- package/dist/picker-flows.d.ts +78 -0
- package/dist/picker-flows.d.ts.map +1 -0
- package/dist/picker-flows.js +444 -0
- package/dist/picker-flows.js.map +1 -0
- package/dist/pickers.d.ts +34 -0
- package/dist/pickers.d.ts.map +1 -0
- package/dist/pickers.js +136 -0
- package/dist/pickers.js.map +1 -0
- package/dist/prompt-history.d.ts +32 -0
- package/dist/prompt-history.d.ts.map +1 -0
- package/dist/prompt-history.js +40 -0
- package/dist/prompt-history.js.map +1 -0
- package/dist/providers/app-theme-provider.d.ts +12 -0
- package/dist/providers/app-theme-provider.d.ts.map +1 -0
- package/dist/providers/app-theme-provider.js +14 -0
- package/dist/providers/app-theme-provider.js.map +1 -0
- package/dist/providers/theme-provider.d.ts +10 -0
- package/dist/providers/theme-provider.d.ts.map +1 -0
- package/dist/providers/theme-provider.js +57 -0
- package/dist/providers/theme-provider.js.map +1 -0
- package/dist/question-model.d.ts +71 -0
- package/dist/question-model.d.ts.map +1 -0
- package/dist/question-model.js +176 -0
- package/dist/question-model.js.map +1 -0
- package/dist/search-controller.d.ts +46 -0
- package/dist/search-controller.d.ts.map +1 -0
- package/dist/search-controller.js +89 -0
- package/dist/search-controller.js.map +1 -0
- package/dist/search-jump.d.ts +27 -0
- package/dist/search-jump.d.ts.map +1 -0
- package/dist/search-jump.js +65 -0
- package/dist/search-jump.js.map +1 -0
- package/dist/session-controller.d.ts +268 -0
- package/dist/session-controller.d.ts.map +1 -0
- package/dist/session-controller.js +941 -0
- package/dist/session-controller.js.map +1 -0
- package/dist/sidebar-model.d.ts +45 -0
- package/dist/sidebar-model.d.ts.map +1 -0
- package/dist/sidebar-model.js +223 -0
- package/dist/sidebar-model.js.map +1 -0
- package/dist/sidebar.d.ts +49 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +106 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/status-line.d.ts +32 -0
- package/dist/status-line.d.ts.map +1 -0
- package/dist/status-line.js +69 -0
- package/dist/status-line.js.map +1 -0
- package/dist/syntax/filetype.d.ts +12 -0
- package/dist/syntax/filetype.d.ts.map +1 -0
- package/dist/syntax/filetype.js +28 -0
- package/dist/syntax/filetype.js.map +1 -0
- package/dist/syntax/grammars.d.ts +42 -0
- package/dist/syntax/grammars.d.ts.map +1 -0
- package/dist/syntax/grammars.js +52 -0
- package/dist/syntax/grammars.js.map +1 -0
- package/dist/text-offset.d.ts +5 -0
- package/dist/text-offset.d.ts.map +1 -0
- package/dist/text-offset.js +38 -0
- package/dist/text-offset.js.map +1 -0
- package/dist/text-wrap.d.ts +12 -0
- package/dist/text-wrap.d.ts.map +1 -0
- package/dist/text-wrap.js +53 -0
- package/dist/text-wrap.js.map +1 -0
- package/dist/theme-controller.d.ts +77 -0
- package/dist/theme-controller.d.ts.map +1 -0
- package/dist/theme-controller.js +178 -0
- package/dist/theme-controller.js.map +1 -0
- package/dist/theme.d.ts +51 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +86 -0
- package/dist/theme.js.map +1 -0
- package/dist/tmux-check.d.ts +35 -0
- package/dist/tmux-check.d.ts.map +1 -0
- package/dist/tmux-check.js +66 -0
- package/dist/tmux-check.js.map +1 -0
- package/dist/tmux.d.ts +69 -0
- package/dist/tmux.d.ts.map +1 -0
- package/dist/tmux.js +135 -0
- package/dist/tmux.js.map +1 -0
- package/dist/tool-diff.d.ts +51 -0
- package/dist/tool-diff.d.ts.map +1 -0
- package/dist/tool-diff.js +158 -0
- package/dist/tool-diff.js.map +1 -0
- package/dist/tool-presentation.d.ts +46 -0
- package/dist/tool-presentation.d.ts.map +1 -0
- package/dist/tool-presentation.js +148 -0
- package/dist/tool-presentation.js.map +1 -0
- package/dist/tool-renderer-view.d.ts +14 -0
- package/dist/tool-renderer-view.d.ts.map +1 -0
- package/dist/tool-renderer-view.js +10 -0
- package/dist/tool-renderer-view.js.map +1 -0
- package/dist/transcript-search.d.ts +54 -0
- package/dist/transcript-search.d.ts.map +1 -0
- package/dist/transcript-search.js +160 -0
- package/dist/transcript-search.js.map +1 -0
- package/dist/transcript.d.ts +59 -0
- package/dist/transcript.d.ts.map +1 -0
- package/dist/transcript.js +123 -0
- package/dist/transcript.js.map +1 -0
- package/dist/workflow-tools.d.ts +42 -0
- package/dist/workflow-tools.d.ts.map +1 -0
- package/dist/workflow-tools.js +89 -0
- package/dist/workflow-tools.js.map +1 -0
- package/examples/themes/ember.json +75 -0
- package/grammars/bash/LICENSE +21 -0
- package/grammars/bash/highlights.scm +56 -0
- package/grammars/bash/tree-sitter-bash.wasm +0 -0
- package/grammars/css/LICENSE +21 -0
- package/grammars/css/highlights.scm +76 -0
- package/grammars/css/tree-sitter-css.wasm +0 -0
- package/grammars/go/LICENSE +21 -0
- package/grammars/go/highlights.scm +123 -0
- package/grammars/go/tree-sitter-go.wasm +0 -0
- package/grammars/html/LICENSE +21 -0
- package/grammars/html/highlights.scm +13 -0
- package/grammars/html/tree-sitter-html.wasm +0 -0
- package/grammars/json/LICENSE +21 -0
- package/grammars/json/highlights.scm +16 -0
- package/grammars/json/tree-sitter-json.wasm +0 -0
- package/grammars/python/LICENSE +21 -0
- package/grammars/python/highlights.scm +137 -0
- package/grammars/python/tree-sitter-python.wasm +0 -0
- package/grammars/rust/LICENSE +21 -0
- package/grammars/rust/highlights.scm +161 -0
- package/grammars/rust/tree-sitter-rust.wasm +0 -0
- package/grammars/yaml/LICENSE +20 -0
- package/grammars/yaml/highlights.scm +79 -0
- package/grammars/yaml/tree-sitter-yaml.wasm +0 -0
- package/package.json +56 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-model.js","sourceRoot":"","sources":["../src/alert-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAc5C,sGAAsG;AACtG,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAKpC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,KAAkB,EAAE,KAAa;IACzD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,oBAAoB,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,kBAAkB,CAAC,CAAC,CAAC;IAC5F,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7D,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,IAAI,oBAAoB;QAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAClE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IACvD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,aAAa,CAAC,EAAE,CAAC;AACrF,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,SAAS,CAAC,KAA8B,EAAE,KAAa;IACrE,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AACnD,CAAC","sourcesContent":["import { wrapIndented } from \"./text-wrap.js\";\nimport { normalize } from \"./transcript.js\";\n\nexport type AlertVariant = \"success\" | \"error\" | \"warning\" | \"info\";\n\n/**\n * A status message shown above the composer until the next keypress or\n * command: on/off/status results and the text output of one-shot commands.\n */\nexport type FooterAlert = {\n variant: AlertVariant;\n title: string;\n body?: string;\n};\n\n/** Most body rows (after wrapping) an alert shows; longer output ends with a \"… N more lines\" row. */\nexport const MAX_ALERT_BODY_LINES = 16;\n\n/** Columns the alert box itself takes: its border (1 + 1) and padding (1 + 1). */\nexport const ALERT_CHROME_COLUMNS = 4;\n\n/** The icon and the gap after it, before the title text. */\nexport const ALERT_ICON_COLUMNS = 2;\n\n/** What an alert draws at a box width: the title and body, wrapped (never cut) to fit. */\nexport type AlertView = { title: string[]; lines: string[] };\n\n/**\n * Title and body rows at `width` (the alert box's outer width). Text wraps to the\n * room inside the border and padding, keeping each line's indent and hanging a list\n * item's continuation under its text; the title wraps beside its icon. The body is\n * clamped after wrapping, so `alertRows` is exactly what draws.\n */\nexport function alertView(alert: FooterAlert, width: number): AlertView {\n const inner = Math.max(1, width - ALERT_CHROME_COLUMNS);\n const title = wrapIndented(normalize(alert.title), Math.max(1, inner - ALERT_ICON_COLUMNS));\n const body = normalize(alert.body ?? \"\").replace(/\\s+$/, \"\");\n if (!body) return { title, lines: [] };\n const lines = wrapIndented(body, inner);\n if (lines.length <= MAX_ALERT_BODY_LINES) return { title, lines };\n const shown = lines.slice(0, MAX_ALERT_BODY_LINES - 1);\n return { title, lines: [...shown, `… ${lines.length - shown.length} more lines`] };\n}\n\n/** Footer rows the alert takes at `width`: border (2) + title rows + body rows. */\nexport function alertRows(alert: FooterAlert | undefined, width: number): number {\n if (!alert) return 0;\n const view = alertView(alert, width);\n return 2 + view.title.length + view.lines.length;\n}\n"]}
|
package/dist/args.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ParsedArgs = {
|
|
2
|
+
theme?: string;
|
|
3
|
+
remote?: string;
|
|
4
|
+
remoteCwd?: string;
|
|
5
|
+
remoteBin?: string;
|
|
6
|
+
crewFile?: string;
|
|
7
|
+
help: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const USAGE = "CrewCoder OpenTUI (preview)\n\nUsage:\n crewcoder-opentui [--theme <name|path>]\n crewcoder-opentui --remote <user@host> --remote-cwd <path> [--remote-bin <path>]\n\nTheme:\n --theme slate|dark|light Built-in theme (default slate; dark is Gotham)\n --theme <name|path> Custom JSON theme: a file path, or\n $CREWCODER_HOME/themes/<name>.json\n\nRemote agent:\n --remote user@vps Run the CrewCoder backend through SSH\n --remote-cwd /workspace Remote project directory (defaults to ~)\n --remote-bin <path> Remote CrewCoder binary (defaults to ~/crewcoder-runner/crewcoder)\n\nInternal:\n --crew-file <path> Start the crew in a handoff file (written by /crew and /team\n when you pick \"Run in tmux\"); the file is read and deleted\n\nEnvironment:\n CREWCODER_THEME=<name> Theme when --theme is not given (else the /theme pick, else slate)\n CREWCODER_TUI_MOUSE=0 Leave the mouse to the terminal (native selection;\n no click toggles, wheel scrolling depends on the terminal)\n CREWCODER_TUI_ICONS=text Single-cell icons (or emoji; default picks per terminal)\n CREWCODER_TUI_TMUX_HINT=0 Hide the startup note about missing tmux settings\n\nRequires Node.js >=26.4. The legacy UI remains available as crewcoder-tui\n(npm i -g @onpoint-dev-tools/crewcoder-tui).\n";
|
|
10
|
+
export declare function parseArgs(values: readonly string[]): ParsedArgs;
|
|
11
|
+
/** Mouse reporting stays on unless `CREWCODER_TUI_MOUSE=0`, the same switch as the legacy UI. */
|
|
12
|
+
export declare function mouseEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
13
|
+
//# sourceMappingURL=args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvI,eAAO,MAAM,KAAK,o3CA6BjB,CAAC;AAUF,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAe/D;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAE1E"}
|
package/dist/args.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const USAGE = `CrewCoder OpenTUI (preview)
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
crewcoder-opentui [--theme <name|path>]
|
|
5
|
+
crewcoder-opentui --remote <user@host> --remote-cwd <path> [--remote-bin <path>]
|
|
6
|
+
|
|
7
|
+
Theme:
|
|
8
|
+
--theme slate|dark|light Built-in theme (default slate; dark is Gotham)
|
|
9
|
+
--theme <name|path> Custom JSON theme: a file path, or
|
|
10
|
+
$CREWCODER_HOME/themes/<name>.json
|
|
11
|
+
|
|
12
|
+
Remote agent:
|
|
13
|
+
--remote user@vps Run the CrewCoder backend through SSH
|
|
14
|
+
--remote-cwd /workspace Remote project directory (defaults to ~)
|
|
15
|
+
--remote-bin <path> Remote CrewCoder binary (defaults to ~/crewcoder-runner/crewcoder)
|
|
16
|
+
|
|
17
|
+
Internal:
|
|
18
|
+
--crew-file <path> Start the crew in a handoff file (written by /crew and /team
|
|
19
|
+
when you pick "Run in tmux"); the file is read and deleted
|
|
20
|
+
|
|
21
|
+
Environment:
|
|
22
|
+
CREWCODER_THEME=<name> Theme when --theme is not given (else the /theme pick, else slate)
|
|
23
|
+
CREWCODER_TUI_MOUSE=0 Leave the mouse to the terminal (native selection;
|
|
24
|
+
no click toggles, wheel scrolling depends on the terminal)
|
|
25
|
+
CREWCODER_TUI_ICONS=text Single-cell icons (or emoji; default picks per terminal)
|
|
26
|
+
CREWCODER_TUI_TMUX_HINT=0 Hide the startup note about missing tmux settings
|
|
27
|
+
|
|
28
|
+
Requires Node.js >=26.4. The legacy UI remains available as crewcoder-tui
|
|
29
|
+
(npm i -g @onpoint-dev-tools/crewcoder-tui).
|
|
30
|
+
`;
|
|
31
|
+
const VALUE_FLAGS = {
|
|
32
|
+
"--theme": "theme",
|
|
33
|
+
"--remote": "remote",
|
|
34
|
+
"--remote-cwd": "remoteCwd",
|
|
35
|
+
"--remote-bin": "remoteBin",
|
|
36
|
+
"--crew-file": "crewFile"
|
|
37
|
+
};
|
|
38
|
+
export function parseArgs(values) {
|
|
39
|
+
const result = { help: false };
|
|
40
|
+
for (let index = 0; index < values.length; index++) {
|
|
41
|
+
const value = values[index] ?? "";
|
|
42
|
+
if (value === "--help" || value === "-h") {
|
|
43
|
+
result.help = true;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const [flag, inline] = value.includes("=") ? [value.slice(0, value.indexOf("=")), value.slice(value.indexOf("=") + 1)] : [value, undefined];
|
|
47
|
+
if (!isValueFlag(flag))
|
|
48
|
+
throw new Error(`Unknown argument: ${value}`);
|
|
49
|
+
const next = inline ?? values[++index];
|
|
50
|
+
if (!next)
|
|
51
|
+
throw new Error(`${flag} requires a value`);
|
|
52
|
+
result[VALUE_FLAGS[flag]] = next;
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
/** Mouse reporting stays on unless `CREWCODER_TUI_MOUSE=0`, the same switch as the legacy UI. */
|
|
57
|
+
export function mouseEnabled(env = process.env) {
|
|
58
|
+
return env.CREWCODER_TUI_MOUSE !== "0";
|
|
59
|
+
}
|
|
60
|
+
function isValueFlag(flag) {
|
|
61
|
+
return Object.hasOwn(VALUE_FLAGS, flag);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=args.js.map
|
package/dist/args.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BpB,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,WAAW;IAC3B,aAAa,EAAE,UAAU;CAC0B,CAAC;AAEtD,MAAM,UAAU,SAAS,CAAC,MAAyB;IACjD,MAAM,MAAM,GAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC3C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;YACnB,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC5I,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,EAAE,CAAC,CAAC;QACtE,MAAM,IAAI,GAAG,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,mBAAmB,CAAC,CAAC;QACvD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IACnC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,YAAY,CAAC,MAAyB,OAAO,CAAC,GAAG;IAC/D,OAAO,GAAG,CAAC,mBAAmB,KAAK,GAAG,CAAC;AACzC,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["export type ParsedArgs = { theme?: string; remote?: string; remoteCwd?: string; remoteBin?: string; crewFile?: string; help: boolean };\n\nexport const USAGE = `CrewCoder OpenTUI (preview)\n\nUsage:\n crewcoder-opentui [--theme <name|path>]\n crewcoder-opentui --remote <user@host> --remote-cwd <path> [--remote-bin <path>]\n\nTheme:\n --theme slate|dark|light Built-in theme (default slate; dark is Gotham)\n --theme <name|path> Custom JSON theme: a file path, or\n $CREWCODER_HOME/themes/<name>.json\n\nRemote agent:\n --remote user@vps Run the CrewCoder backend through SSH\n --remote-cwd /workspace Remote project directory (defaults to ~)\n --remote-bin <path> Remote CrewCoder binary (defaults to ~/crewcoder-runner/crewcoder)\n\nInternal:\n --crew-file <path> Start the crew in a handoff file (written by /crew and /team\n when you pick \"Run in tmux\"); the file is read and deleted\n\nEnvironment:\n CREWCODER_THEME=<name> Theme when --theme is not given (else the /theme pick, else slate)\n CREWCODER_TUI_MOUSE=0 Leave the mouse to the terminal (native selection;\n no click toggles, wheel scrolling depends on the terminal)\n CREWCODER_TUI_ICONS=text Single-cell icons (or emoji; default picks per terminal)\n CREWCODER_TUI_TMUX_HINT=0 Hide the startup note about missing tmux settings\n\nRequires Node.js >=26.4. The legacy UI remains available as crewcoder-tui\n(npm i -g @onpoint-dev-tools/crewcoder-tui).\n`;\n\nconst VALUE_FLAGS = {\n \"--theme\": \"theme\",\n \"--remote\": \"remote\",\n \"--remote-cwd\": \"remoteCwd\",\n \"--remote-bin\": \"remoteBin\",\n \"--crew-file\": \"crewFile\"\n} as const satisfies Record<string, keyof ParsedArgs>;\n\nexport function parseArgs(values: readonly string[]): ParsedArgs {\n const result: ParsedArgs = { help: false };\n for (let index = 0; index < values.length; index++) {\n const value = values[index] ?? \"\";\n if (value === \"--help\" || value === \"-h\") {\n result.help = true;\n continue;\n }\n const [flag, inline] = value.includes(\"=\") ? [value.slice(0, value.indexOf(\"=\")), value.slice(value.indexOf(\"=\") + 1)] : [value, undefined];\n if (!isValueFlag(flag)) throw new Error(`Unknown argument: ${value}`);\n const next = inline ?? values[++index];\n if (!next) throw new Error(`${flag} requires a value`);\n result[VALUE_FLAGS[flag]] = next;\n }\n return result;\n}\n\n/** Mouse reporting stays on unless `CREWCODER_TUI_MOUSE=0`, the same switch as the legacy UI. */\nexport function mouseEnabled(env: NodeJS.ProcessEnv = process.env): boolean {\n return env.CREWCODER_TUI_MOUSE !== \"0\";\n}\n\nfunction isValueFlag(flag: string): flag is keyof typeof VALUE_FLAGS {\n return Object.hasOwn(VALUE_FLAGS, flag);\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ClipboardImage } from "@onpoint-dev-tools/crewcoder-tui-core/state/clipboard";
|
|
2
|
+
import { type ImageAttachment } from "@onpoint-dev-tools/crewcoder-tui-core/state/image-attachment";
|
|
3
|
+
/**
|
|
4
|
+
* Image attachments for the next prompt, ported from the legacy composer:
|
|
5
|
+
* Ctrl+V takes a screenshot off the clipboard, image paths in the prompt
|
|
6
|
+
* (a file dropped on the terminal pastes its path) attach when it is sent, and
|
|
7
|
+
* Ctrl+X clears them. Files are copied into the CrewCoder image cache
|
|
8
|
+
* (`persistImageBuffer` / `persistImageFile` in tui-core) and reach the agent
|
|
9
|
+
* as `--image <path>`.
|
|
10
|
+
*/
|
|
11
|
+
export type ClipboardSource = {
|
|
12
|
+
image(): ClipboardImage | undefined;
|
|
13
|
+
text(): string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** The system clipboard through platform tools (tui-core `state/clipboard`). */
|
|
16
|
+
export declare const systemClipboard: ClipboardSource;
|
|
17
|
+
/** What Ctrl+V did: attached images, or text for the composer, or nothing. */
|
|
18
|
+
export type PasteResult = {
|
|
19
|
+
attached: ImageAttachment[];
|
|
20
|
+
text?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Prefer an image on the clipboard; otherwise clipboard text that names image
|
|
24
|
+
* files attaches those files; otherwise the text is returned for the composer.
|
|
25
|
+
*/
|
|
26
|
+
export declare function pasteFromClipboard(clipboard: ClipboardSource, existing: readonly ImageAttachment[]): PasteResult;
|
|
27
|
+
/** Image files named in `text` that exist and are not attached yet; unreadable paths are skipped. */
|
|
28
|
+
export declare function attachImagePaths(text: string, existing: readonly ImageAttachment[]): ImageAttachment[];
|
|
29
|
+
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../src/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,uDAAuD,CAAC;AAE/H,OAAO,EAAyF,KAAK,eAAe,EAAE,MAAM,8DAA8D,CAAC;AAE3L;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,IAAI,cAAc,GAAG,SAAS,CAAC;IACpC,IAAI,IAAI,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,eAAoE,CAAC;AAEnG,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,WAAW,CAUhH;AAED,qGAAqG;AACrG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAYtG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { readClipboard, readClipboardImage } from "@onpoint-dev-tools/crewcoder-tui-core/state/clipboard";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { attachedSources, imagePathsFromText, persistImageBuffer, persistImageFile, sniffImage } from "@onpoint-dev-tools/crewcoder-tui-core/state/image-attachment";
|
|
4
|
+
/** The system clipboard through platform tools (tui-core `state/clipboard`). */
|
|
5
|
+
export const systemClipboard = { image: readClipboardImage, text: readClipboard };
|
|
6
|
+
/**
|
|
7
|
+
* Prefer an image on the clipboard; otherwise clipboard text that names image
|
|
8
|
+
* files attaches those files; otherwise the text is returned for the composer.
|
|
9
|
+
*/
|
|
10
|
+
export function pasteFromClipboard(clipboard, existing) {
|
|
11
|
+
const image = clipboard.image();
|
|
12
|
+
if (image) {
|
|
13
|
+
const info = sniffImage(image.data) ?? { mime: "image/png" };
|
|
14
|
+
return { attached: [persistImageBuffer(image.data, info, "clipboard")] };
|
|
15
|
+
}
|
|
16
|
+
const text = clipboard.text();
|
|
17
|
+
if (!text)
|
|
18
|
+
return { attached: [] };
|
|
19
|
+
const attached = attachImagePaths(text, existing);
|
|
20
|
+
return attached.length > 0 ? { attached } : { attached: [], text };
|
|
21
|
+
}
|
|
22
|
+
/** Image files named in `text` that exist and are not attached yet; unreadable paths are skipped. */
|
|
23
|
+
export function attachImagePaths(text, existing) {
|
|
24
|
+
// Checked before copying: each attach writes a new cache file.
|
|
25
|
+
const seen = attachedSources(existing);
|
|
26
|
+
const attached = [];
|
|
27
|
+
for (const filePath of imagePathsFromText(text)) {
|
|
28
|
+
if (seen.has(path.resolve(filePath)))
|
|
29
|
+
continue;
|
|
30
|
+
const attachment = persistImageFile(filePath);
|
|
31
|
+
if (!attachment)
|
|
32
|
+
continue;
|
|
33
|
+
seen.add(attachment.sourcePath ?? attachment.path);
|
|
34
|
+
attached.push(attachment);
|
|
35
|
+
}
|
|
36
|
+
return attached;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=attachments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../src/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAuB,MAAM,uDAAuD,CAAC;AAC/H,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAwB,MAAM,8DAA8D,CAAC;AAe3L,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAoB,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,aAAa,EA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U,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;QACnD,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { readClipboard, readClipboardImage, type ClipboardImage } from \"@onpoint-dev-tools/crewcoder-tui-core/state/clipboard\";\nimport path from \"node:path\";\nimport { attachedSources, imagePathsFromText, persistImageBuffer, persistImageFile, sniffImage, type ImageAttachment } from \"@onpoint-dev-tools/crewcoder-tui-core/state/image-attachment\";\n\n/**\n * Image attachments for the next prompt, ported from the legacy composer:\n * Ctrl+V takes a screenshot off the clipboard, image paths in the prompt\n * (a file dropped on the terminal pastes its path) attach when it is sent, and\n * Ctrl+X clears them. Files are copied into the CrewCoder image cache\n * (`persistImageBuffer` / `persistImageFile` in tui-core) and reach the agent\n * as `--image <path>`.\n */\nexport type ClipboardSource = {\n image(): ClipboardImage | undefined;\n text(): string | undefined;\n};\n\n/** The system clipboard through platform tools (tui-core `state/clipboard`). */\nexport const systemClipboard: ClipboardSource = { image: readClipboardImage, text: readClipboard };\n\n/** What Ctrl+V did: attached images, or text for the composer, or nothing. */\nexport type PasteResult = { attached: ImageAttachment[]; text?: string };\n\n/**\n * Prefer an image on the clipboard; otherwise clipboard text that names image\n * files attaches those files; otherwise the text is returned for the composer.\n */\nexport function pasteFromClipboard(clipboard: ClipboardSource, existing: readonly ImageAttachment[]): PasteResult {\n const image = clipboard.image();\n if (image) {\n const info = sniffImage(image.data) ?? { mime: \"image/png\" as const };\n return { attached: [persistImageBuffer(image.data, info, \"clipboard\")] };\n }\n const text = clipboard.text();\n if (!text) return { attached: [] };\n const attached = attachImagePaths(text, existing);\n return attached.length > 0 ? { attached } : { attached: [], text };\n}\n\n/** Image files named in `text` that exist and are not attached yet; unreadable paths are skipped. */\nexport function attachImagePaths(text: string, existing: readonly ImageAttachment[]): ImageAttachment[] {\n // Checked before copying: each attach writes a new cache file.\n const seen = attachedSources(existing);\n const attached: ImageAttachment[] = [];\n for (const filePath of imagePathsFromText(text)) {\n if (seen.has(path.resolve(filePath))) continue;\n const attachment = persistImageFile(filePath);\n if (!attachment) continue;\n seen.add(attachment.sourcePath ?? attachment.path);\n attached.push(attachment);\n }\n return attached;\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { TuiEventBlock } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
|
|
2
|
+
/**
|
|
3
|
+
* Structured transcript blocks that render as a status panel: crews, goals,
|
|
4
|
+
* review summaries, `/why` answers, background jobs, plugin validation, and
|
|
5
|
+
* checkpoints. Pure, so every view is tested without a renderer; the panel
|
|
6
|
+
* component (`Transcript.tsx`) only draws what this returns.
|
|
7
|
+
*/
|
|
8
|
+
export type PanelBlock = Extract<TuiEventBlock, {
|
|
9
|
+
type: "crew" | "goal" | "review_summary" | "why" | "background_job" | "validation" | "checkpoint" | "checkpoint_diff";
|
|
10
|
+
}>;
|
|
11
|
+
/** Theme roles a panel may use; the component maps them to theme colors. */
|
|
12
|
+
export type PanelTone = "primary" | "success" | "warning" | "error" | "info" | "muted" | "text";
|
|
13
|
+
/** One row. `marker` sits in its own column so wrapped text stays indented under the text. */
|
|
14
|
+
export type PanelLine = {
|
|
15
|
+
text: string;
|
|
16
|
+
tone: PanelTone;
|
|
17
|
+
marker?: PanelMarker;
|
|
18
|
+
};
|
|
19
|
+
/** A fixed glyph, or `spinner` for something still running. */
|
|
20
|
+
export type PanelMarker = {
|
|
21
|
+
glyph: string;
|
|
22
|
+
tone: PanelTone;
|
|
23
|
+
} | "spinner";
|
|
24
|
+
export type BlockPanel = {
|
|
25
|
+
title: string;
|
|
26
|
+
/** Border and title color: the block's status. */
|
|
27
|
+
tone: PanelTone;
|
|
28
|
+
/** Still changing: the title shows a spinner. */
|
|
29
|
+
live: boolean;
|
|
30
|
+
/** Muted text after the title (ids, counts, branch). */
|
|
31
|
+
meta?: string;
|
|
32
|
+
lines: PanelLine[];
|
|
33
|
+
};
|
|
34
|
+
/** Changed files listed before `… N more`; legacy's bound. */
|
|
35
|
+
export declare const REVIEW_FILE_LIMIT = 8;
|
|
36
|
+
/** Issue references listed before `… N more`; legacy's bound. */
|
|
37
|
+
export declare const REVIEW_ISSUE_LIMIT = 6;
|
|
38
|
+
/** Background job output shows its newest lines, like a terminal tail. */
|
|
39
|
+
export declare const BACKGROUND_OUTPUT_LINES = 8;
|
|
40
|
+
export declare function isPanelBlock(block: TuiEventBlock): block is PanelBlock;
|
|
41
|
+
export declare function blockPanel(block: PanelBlock): BlockPanel;
|
|
42
|
+
export declare function formatBytes(bytes: number): string;
|
|
43
|
+
//# sourceMappingURL=block-panels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-panels.d.ts","sourceRoot":"","sources":["../src/block-panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAW,MAAM,uDAAuD,CAAC;AAGpG;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE;IAC9C,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,gBAAgB,GAAG,KAAK,GAAG,gBAAgB,GAAG,YAAY,GAAG,YAAY,GAAG,iBAAiB,CAAC;CACvH,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhG,8FAA8F;AAC9F,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAChF,+DAA+D;AAC/D,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,IAAI,EAAE,SAAS,CAAC;IAChB,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAMzC,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK,IAAI,UAAU,CAEtE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAWxD;AAqKD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { normalize } from "./transcript.js";
|
|
2
|
+
/** Changed files listed before `… N more`; legacy's bound. */
|
|
3
|
+
export const REVIEW_FILE_LIMIT = 8;
|
|
4
|
+
/** Issue references listed before `… N more`; legacy's bound. */
|
|
5
|
+
export const REVIEW_ISSUE_LIMIT = 6;
|
|
6
|
+
/** Background job output shows its newest lines, like a terminal tail. */
|
|
7
|
+
export const BACKGROUND_OUTPUT_LINES = 8;
|
|
8
|
+
const PANEL_TYPES = new Set([
|
|
9
|
+
"crew", "goal", "review_summary", "why", "background_job", "validation", "checkpoint", "checkpoint_diff"
|
|
10
|
+
]);
|
|
11
|
+
export function isPanelBlock(block) {
|
|
12
|
+
return PANEL_TYPES.has(block.type);
|
|
13
|
+
}
|
|
14
|
+
export function blockPanel(block) {
|
|
15
|
+
switch (block.type) {
|
|
16
|
+
case "crew": return crewPanel(block);
|
|
17
|
+
case "goal": return goalPanel(block.goal);
|
|
18
|
+
case "review_summary": return reviewPanel(block);
|
|
19
|
+
case "why": return whyPanel(block);
|
|
20
|
+
case "background_job": return backgroundJobPanel(block);
|
|
21
|
+
case "validation": return validationPanel(block);
|
|
22
|
+
case "checkpoint": return checkpointPanel(block);
|
|
23
|
+
case "checkpoint_diff": return checkpointDiffPanel(block);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function line(text, tone, marker) {
|
|
27
|
+
return marker ? { text: normalize(text), tone, marker } : { text: normalize(text), tone };
|
|
28
|
+
}
|
|
29
|
+
function plural(count, word) {
|
|
30
|
+
return `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
31
|
+
}
|
|
32
|
+
const WORKER_MARKERS = {
|
|
33
|
+
pending: { glyph: "○", tone: "muted" },
|
|
34
|
+
completed: { glyph: "✓", tone: "success" },
|
|
35
|
+
failed: { glyph: "✗", tone: "error" }
|
|
36
|
+
};
|
|
37
|
+
function crewPanel(block) {
|
|
38
|
+
const active = block.workers.filter((worker) => worker.status === "running").length;
|
|
39
|
+
const failed = block.workers.filter((worker) => worker.status === "failed").length;
|
|
40
|
+
const title = !block.completed ? "Crew running" : failed ? "Crew finished with failures" : "Crew complete";
|
|
41
|
+
const lines = block.workers.flatMap((worker) => {
|
|
42
|
+
const marker = worker.status === "running" ? "spinner" : WORKER_MARKERS[worker.status];
|
|
43
|
+
const tone = worker.status === "failed" ? "error" : worker.status === "pending" ? "muted" : "text";
|
|
44
|
+
const rows = [line(worker.name, tone, marker)];
|
|
45
|
+
if (worker.error)
|
|
46
|
+
rows.push(line(worker.error, "error", { glyph: " ", tone: "muted" }));
|
|
47
|
+
return rows;
|
|
48
|
+
});
|
|
49
|
+
return {
|
|
50
|
+
title,
|
|
51
|
+
tone: failed ? "error" : block.completed ? "success" : "primary",
|
|
52
|
+
live: !block.completed,
|
|
53
|
+
meta: [plural(block.workers.length, "agent"), active ? `${active} active` : ""].filter(Boolean).join(" · "),
|
|
54
|
+
lines: lines.length ? lines : [line("No workers", "muted")]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const GOAL_TONES = {
|
|
58
|
+
queued: "primary",
|
|
59
|
+
running: "primary",
|
|
60
|
+
awaiting_approval: "warning",
|
|
61
|
+
paused: "warning",
|
|
62
|
+
completed: "success",
|
|
63
|
+
failed: "error",
|
|
64
|
+
cancelled: "error"
|
|
65
|
+
};
|
|
66
|
+
function goalPanel(goal) {
|
|
67
|
+
const lines = [line(goal.objective, "text")];
|
|
68
|
+
lines.push(line(`maker ${goal.provider}/${goal.model}`, "muted"));
|
|
69
|
+
if (goal.checkModel) {
|
|
70
|
+
lines.push(line(`verifier ${goal.provider}/${goal.checkModel}${goal.timeoutMinutes ? ` · timeout ${goal.timeoutMinutes}m` : ""}`, "info"));
|
|
71
|
+
}
|
|
72
|
+
if (goal.lastCheck) {
|
|
73
|
+
const { verdict, reason, model } = goal.lastCheck;
|
|
74
|
+
lines.push(line(`Last check (${model}): ${verdict} — ${reason}`, verdict === "complete" ? "success" : "warning"));
|
|
75
|
+
}
|
|
76
|
+
if (goal.pendingApproval) {
|
|
77
|
+
lines.push(line(`Needs approval for ${goal.pendingApproval.toolName}: ${goal.pendingApproval.reason}`, "warning", { glyph: "⚠", tone: "warning" }));
|
|
78
|
+
lines.push(line("/goal approve or /goal deny", "muted"));
|
|
79
|
+
}
|
|
80
|
+
if (goal.pauseReason)
|
|
81
|
+
lines.push(line(`Paused: ${goal.pauseReason}`, "warning"));
|
|
82
|
+
if (goal.error)
|
|
83
|
+
lines.push(line(goal.error, "error"));
|
|
84
|
+
if (goal.completionSummary)
|
|
85
|
+
lines.push(line(goal.completionSummary, "success"));
|
|
86
|
+
if (goal.completionEvidence)
|
|
87
|
+
lines.push(line(`Evidence: ${goal.completionEvidence}`, "muted"));
|
|
88
|
+
const turns = goal.maxTurns ? `${goal.cycle}/${goal.maxTurns}` : String(goal.cycle);
|
|
89
|
+
return {
|
|
90
|
+
title: `Goal · ${goal.status.replace(/_/g, " ")}`,
|
|
91
|
+
tone: GOAL_TONES[goal.status],
|
|
92
|
+
live: goal.status === "running" || goal.status === "queued",
|
|
93
|
+
meta: `${goal.id} · turn ${turns}`,
|
|
94
|
+
lines
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** `… N more` under a bounded list, or nothing. */
|
|
98
|
+
function moreLine(total, shown) {
|
|
99
|
+
return total > shown ? [line(`… ${total - shown} more`, "muted")] : [];
|
|
100
|
+
}
|
|
101
|
+
function reviewPanel(block) {
|
|
102
|
+
const { branch, clean, changedFiles, issueReferences } = block.summary;
|
|
103
|
+
const lines = [];
|
|
104
|
+
if (changedFiles.length) {
|
|
105
|
+
lines.push(line("Changed files", "success"));
|
|
106
|
+
for (const file of changedFiles.slice(0, REVIEW_FILE_LIMIT))
|
|
107
|
+
lines.push(line(file, "text", { glyph: "•", tone: "success" }));
|
|
108
|
+
lines.push(...moreLine(changedFiles.length, REVIEW_FILE_LIMIT));
|
|
109
|
+
}
|
|
110
|
+
if (issueReferences.length) {
|
|
111
|
+
lines.push(line("Issues", "info"));
|
|
112
|
+
for (const issue of issueReferences.slice(0, REVIEW_ISSUE_LIMIT)) {
|
|
113
|
+
lines.push(line(`${issue.text} (${issue.source})${issue.url ? ` ${issue.url}` : ""}`, "text", { glyph: "#", tone: "info" }));
|
|
114
|
+
}
|
|
115
|
+
lines.push(...moreLine(issueReferences.length, REVIEW_ISSUE_LIMIT));
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
lines.push(line("No issue references found in the branch, recent commits, or git status.", "muted"));
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
title: "Review summary",
|
|
122
|
+
tone: clean ? "success" : "warning",
|
|
123
|
+
live: false,
|
|
124
|
+
meta: `${branch ?? "(no branch)"} · ${clean ? "clean" : `${plural(changedFiles.length, "changed file")}`}`,
|
|
125
|
+
lines
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* `/why`. A transcript readout is a deterministic fallback, not the model's
|
|
130
|
+
* reasoning: its title and color must never match a real explanation, and the
|
|
131
|
+
* reason the model was not used stays visible.
|
|
132
|
+
*/
|
|
133
|
+
function whyPanel(block) {
|
|
134
|
+
const { explanation, source, fallbackReason, toolCalls, changedFiles } = block.decision;
|
|
135
|
+
const fromModel = source === "model";
|
|
136
|
+
const lines = [];
|
|
137
|
+
if (fallbackReason)
|
|
138
|
+
lines.push(line(`The model explainer was not used: ${fallbackReason}`, "warning"));
|
|
139
|
+
lines.push(line(explanation, "text"));
|
|
140
|
+
if (toolCalls.length)
|
|
141
|
+
lines.push(line(`Tools: ${toolCalls.join(", ")}`, "muted"));
|
|
142
|
+
if (changedFiles.length)
|
|
143
|
+
lines.push(line(`Files: ${changedFiles.join(", ")}`, "muted"));
|
|
144
|
+
return {
|
|
145
|
+
title: fromModel ? "Why · model explanation" : "Why · transcript readout",
|
|
146
|
+
tone: fromModel ? "info" : "warning",
|
|
147
|
+
live: false,
|
|
148
|
+
lines
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
const JOB_TONES = {
|
|
152
|
+
running: "warning",
|
|
153
|
+
completed: "success",
|
|
154
|
+
failed: "error",
|
|
155
|
+
stopped: "error"
|
|
156
|
+
};
|
|
157
|
+
function backgroundJobPanel(block) {
|
|
158
|
+
const output = normalize(block.output).replace(/\n+$/, "");
|
|
159
|
+
const all = output ? output.split("\n") : [];
|
|
160
|
+
const tail = all.slice(-BACKGROUND_OUTPUT_LINES);
|
|
161
|
+
const lines = [line(block.command, "text", { glyph: "$", tone: "primary" })];
|
|
162
|
+
if (all.length > tail.length)
|
|
163
|
+
lines.push(line(`… ${plural(all.length - tail.length, "earlier line")}`, "muted"));
|
|
164
|
+
for (const text of tail)
|
|
165
|
+
lines.push({ text, tone: "muted", marker: { glyph: "│", tone: "muted" } });
|
|
166
|
+
if (!all.length)
|
|
167
|
+
lines.push(line(block.status === "running" ? "(waiting for output)" : "(no output)", "muted"));
|
|
168
|
+
const exit = block.exitCode === undefined ? "" : ` · exit ${String(block.exitCode)}`;
|
|
169
|
+
return {
|
|
170
|
+
title: `Background job · ${block.status}`,
|
|
171
|
+
tone: JOB_TONES[block.status],
|
|
172
|
+
live: block.status === "running",
|
|
173
|
+
meta: `${block.bgId}${exit}`,
|
|
174
|
+
lines
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function validationPanel(block) {
|
|
178
|
+
const lines = [
|
|
179
|
+
...(block.errors ?? []).map((error) => line(error, "text", { glyph: "✗", tone: "error" })),
|
|
180
|
+
...(block.warnings ?? []).map((warning) => line(warning, "text", { glyph: "⚠", tone: "warning" }))
|
|
181
|
+
];
|
|
182
|
+
return {
|
|
183
|
+
title: `Validation · ${block.status}`,
|
|
184
|
+
tone: block.status === "failed" ? "error" : block.status === "passed" ? "success" : "warning",
|
|
185
|
+
live: block.status === "running",
|
|
186
|
+
meta: normalize(block.target),
|
|
187
|
+
lines
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export function formatBytes(bytes) {
|
|
191
|
+
if (bytes < 1024)
|
|
192
|
+
return `${bytes} B`;
|
|
193
|
+
if (bytes < 1024 * 1024)
|
|
194
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
195
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
196
|
+
}
|
|
197
|
+
function checkpointPanel(block) {
|
|
198
|
+
const before = block.toolName ? `before ${block.toolName} · ` : "";
|
|
199
|
+
const lines = [line(`${before}${plural(block.fileCount, "file")} · ${formatBytes(block.totalBytes)}${block.truncated ? " · truncated" : ""}`, "muted")];
|
|
200
|
+
lines.push(line(`/rewind ${block.checkpointId} · ${block.reason}`, "muted"));
|
|
201
|
+
return { title: "Checkpoint", tone: "info", live: false, meta: block.checkpointId, lines };
|
|
202
|
+
}
|
|
203
|
+
/** Unified, like inline edit diffs (side-by-side is not planned). */
|
|
204
|
+
function checkpointDiffPanel(block) {
|
|
205
|
+
const lines = block.lines.map((text) => line(text, text.startsWith("+") ? "success" : text.startsWith("-") ? "error" : "muted"));
|
|
206
|
+
if (block.truncated)
|
|
207
|
+
lines.push(line("(truncated)", "muted"));
|
|
208
|
+
return { title: "Checkpoint diff", tone: "info", live: false, meta: `${normalize(block.path)} · ${block.checkpointId}`, lines };
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=block-panels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-panels.js","sourceRoot":"","sources":["../src/block-panels.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA+B5C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AACnC,iEAAiE;AACjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,MAAM,WAAW,GAAuC,IAAI,GAAG,CAAqB;IAClF,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB;CACzG,CAAC,CAAC;AAEH,MAAM,UAAU,YAAY,CAAC,KAAoB;IAC/C,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAiB;IAC1C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,MAAM,CAAC,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,MAAM,CAAC,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1C,KAAK,gBAAgB,CAAC,CAAC,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QACjD,KAAK,KAAK,CAAC,CAAC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnC,KAAK,gBAAgB,CAAC,CAAC,OAAO,kBAAkB,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AAM,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACxJ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,YAAY,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7E,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,EAAE,CAAC;AAC7F,CAAC;AAED,qEAAqE;AACrE,SAAS,mBAAmB,CAAC,KAAuD;IAClF,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjI,IAAI,KAAK,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9D,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC;AAClI,CAAC","sourcesContent":["import type { TuiEventBlock, TuiGoal } from \"@onpoint-dev-tools/crewcoder-tui-core/state/tui-store\";\nimport { normalize } from \"./transcript.js\";\n\n/**\n * Structured transcript blocks that render as a status panel: crews, goals,\n * review summaries, `/why` answers, background jobs, plugin validation, and\n * checkpoints. Pure, so every view is tested without a renderer; the panel\n * component (`Transcript.tsx`) only draws what this returns.\n */\nexport type PanelBlock = Extract<TuiEventBlock, {\n type: \"crew\" | \"goal\" | \"review_summary\" | \"why\" | \"background_job\" | \"validation\" | \"checkpoint\" | \"checkpoint_diff\";\n}>;\n\n/** Theme roles a panel may use; the component maps them to theme colors. */\nexport type PanelTone = \"primary\" | \"success\" | \"warning\" | \"error\" | \"info\" | \"muted\" | \"text\";\n\n/** One row. `marker` sits in its own column so wrapped text stays indented under the text. */\nexport type PanelLine = { text: string; tone: PanelTone; marker?: PanelMarker };\n/** A fixed glyph, or `spinner` for something still running. */\nexport type PanelMarker = { glyph: string; tone: PanelTone } | \"spinner\";\n\nexport type BlockPanel = {\n title: string;\n /** Border and title color: the block's status. */\n tone: PanelTone;\n /** Still changing: the title shows a spinner. */\n live: boolean;\n /** Muted text after the title (ids, counts, branch). */\n meta?: string;\n lines: PanelLine[];\n};\n\n/** Changed files listed before `… N more`; legacy's bound. */\nexport const REVIEW_FILE_LIMIT = 8;\n/** Issue references listed before `… N more`; legacy's bound. */\nexport const REVIEW_ISSUE_LIMIT = 6;\n/** Background job output shows its newest lines, like a terminal tail. */\nexport const BACKGROUND_OUTPUT_LINES = 8;\n\nconst PANEL_TYPES: ReadonlySet<TuiEventBlock[\"type\"]> = new Set<PanelBlock[\"type\"]>([\n \"crew\", \"goal\", \"review_summary\", \"why\", \"background_job\", \"validation\", \"checkpoint\", \"checkpoint_diff\"\n]);\n\nexport function isPanelBlock(block: TuiEventBlock): block is PanelBlock {\n return PANEL_TYPES.has(block.type);\n}\n\nexport function blockPanel(block: PanelBlock): BlockPanel {\n switch (block.type) {\n case \"crew\": return crewPanel(block);\n case \"goal\": return goalPanel(block.goal);\n case \"review_summary\": return reviewPanel(block);\n case \"why\": return whyPanel(block);\n case \"background_job\": return backgroundJobPanel(block);\n case \"validation\": return validationPanel(block);\n case \"checkpoint\": return checkpointPanel(block);\n case \"checkpoint_diff\": return checkpointDiffPanel(block);\n }\n}\n\nfunction line(text: string, tone: PanelTone, marker?: PanelMarker): PanelLine {\n return marker ? { text: normalize(text), tone, marker } : { text: normalize(text), tone };\n}\n\nfunction plural(count: number, word: string): string {\n return `${count} ${word}${count === 1 ? \"\" : \"s\"}`;\n}\n\nconst WORKER_MARKERS: Readonly<Record<\"pending\" | \"completed\" | \"failed\", { glyph: string; tone: PanelTone }>> = {\n pending: { glyph: \"○\", tone: \"muted\" },\n completed: { glyph: \"✓\", tone: \"success\" },\n failed: { glyph: \"✗\", tone: \"error\" }\n};\n\nfunction crewPanel(block: Extract<PanelBlock, { type: \"crew\" }>): BlockPanel {\n const active = block.workers.filter((worker) => worker.status === \"running\").length;\n const failed = block.workers.filter((worker) => worker.status === \"failed\").length;\n const title = !block.completed ? \"Crew running\" : failed ? \"Crew finished with failures\" : \"Crew complete\";\n const lines = block.workers.flatMap((worker) => {\n const marker = worker.status === \"running\" ? \"spinner\" : WORKER_MARKERS[worker.status];\n const tone: PanelTone = worker.status === \"failed\" ? \"error\" : worker.status === \"pending\" ? \"muted\" : \"text\";\n const rows = [line(worker.name, tone, marker)];\n if (worker.error) rows.push(line(worker.error, \"error\", { glyph: \" \", tone: \"muted\" }));\n return rows;\n });\n return {\n title,\n tone: failed ? \"error\" : block.completed ? \"success\" : \"primary\",\n live: !block.completed,\n meta: [plural(block.workers.length, \"agent\"), active ? `${active} active` : \"\"].filter(Boolean).join(\" · \"),\n lines: lines.length ? lines : [line(\"No workers\", \"muted\")]\n };\n}\n\nconst GOAL_TONES: Readonly<Record<TuiGoal[\"status\"], PanelTone>> = {\n queued: \"primary\",\n running: \"primary\",\n awaiting_approval: \"warning\",\n paused: \"warning\",\n completed: \"success\",\n failed: \"error\",\n cancelled: \"error\"\n};\n\nfunction goalPanel(goal: TuiGoal): BlockPanel {\n const lines = [line(goal.objective, \"text\")];\n lines.push(line(`maker ${goal.provider}/${goal.model}`, \"muted\"));\n if (goal.checkModel) {\n lines.push(line(`verifier ${goal.provider}/${goal.checkModel}${goal.timeoutMinutes ? ` · timeout ${goal.timeoutMinutes}m` : \"\"}`, \"info\"));\n }\n if (goal.lastCheck) {\n const { verdict, reason, model } = goal.lastCheck;\n lines.push(line(`Last check (${model}): ${verdict} — ${reason}`, verdict === \"complete\" ? \"success\" : \"warning\"));\n }\n if (goal.pendingApproval) {\n lines.push(line(`Needs approval for ${goal.pendingApproval.toolName}: ${goal.pendingApproval.reason}`, \"warning\", { glyph: \"⚠\", tone: \"warning\" }));\n lines.push(line(\"/goal approve or /goal deny\", \"muted\"));\n }\n if (goal.pauseReason) lines.push(line(`Paused: ${goal.pauseReason}`, \"warning\"));\n if (goal.error) lines.push(line(goal.error, \"error\"));\n if (goal.completionSummary) lines.push(line(goal.completionSummary, \"success\"));\n if (goal.completionEvidence) lines.push(line(`Evidence: ${goal.completionEvidence}`, \"muted\"));\n const turns = goal.maxTurns ? `${goal.cycle}/${goal.maxTurns}` : String(goal.cycle);\n return {\n title: `Goal · ${goal.status.replace(/_/g, \" \")}`,\n tone: GOAL_TONES[goal.status],\n live: goal.status === \"running\" || goal.status === \"queued\",\n meta: `${goal.id} · turn ${turns}`,\n lines\n };\n}\n\n/** `… N more` under a bounded list, or nothing. */\nfunction moreLine(total: number, shown: number): PanelLine[] {\n return total > shown ? [line(`… ${total - shown} more`, \"muted\")] : [];\n}\n\nfunction reviewPanel(block: Extract<PanelBlock, { type: \"review_summary\" }>): BlockPanel {\n const { branch, clean, changedFiles, issueReferences } = block.summary;\n const lines: PanelLine[] = [];\n if (changedFiles.length) {\n lines.push(line(\"Changed files\", \"success\"));\n for (const file of changedFiles.slice(0, REVIEW_FILE_LIMIT)) lines.push(line(file, \"text\", { glyph: \"•\", tone: \"success\" }));\n lines.push(...moreLine(changedFiles.length, REVIEW_FILE_LIMIT));\n }\n if (issueReferences.length) {\n lines.push(line(\"Issues\", \"info\"));\n for (const issue of issueReferences.slice(0, REVIEW_ISSUE_LIMIT)) {\n lines.push(line(`${issue.text} (${issue.source})${issue.url ? ` ${issue.url}` : \"\"}`, \"text\", { glyph: \"#\", tone: \"info\" }));\n }\n lines.push(...moreLine(issueReferences.length, REVIEW_ISSUE_LIMIT));\n } else {\n lines.push(line(\"No issue references found in the branch, recent commits, or git status.\", \"muted\"));\n }\n return {\n title: \"Review summary\",\n tone: clean ? \"success\" : \"warning\",\n live: false,\n meta: `${branch ?? \"(no branch)\"} · ${clean ? \"clean\" : `${plural(changedFiles.length, \"changed file\")}`}`,\n lines\n };\n}\n\n/**\n * `/why`. A transcript readout is a deterministic fallback, not the model's\n * reasoning: its title and color must never match a real explanation, and the\n * reason the model was not used stays visible.\n */\nfunction whyPanel(block: Extract<PanelBlock, { type: \"why\" }>): BlockPanel {\n const { explanation, source, fallbackReason, toolCalls, changedFiles } = block.decision;\n const fromModel = source === \"model\";\n const lines: PanelLine[] = [];\n if (fallbackReason) lines.push(line(`The model explainer was not used: ${fallbackReason}`, \"warning\"));\n lines.push(line(explanation, \"text\"));\n if (toolCalls.length) lines.push(line(`Tools: ${toolCalls.join(\", \")}`, \"muted\"));\n if (changedFiles.length) lines.push(line(`Files: ${changedFiles.join(\", \")}`, \"muted\"));\n return {\n title: fromModel ? \"Why · model explanation\" : \"Why · transcript readout\",\n tone: fromModel ? \"info\" : \"warning\",\n live: false,\n lines\n };\n}\n\nconst JOB_TONES: Readonly<Record<Extract<PanelBlock, { type: \"background_job\" }>[\"status\"], PanelTone>> = {\n running: \"warning\",\n completed: \"success\",\n failed: \"error\",\n stopped: \"error\"\n};\n\nfunction backgroundJobPanel(block: Extract<PanelBlock, { type: \"background_job\" }>): BlockPanel {\n const output = normalize(block.output).replace(/\\n+$/, \"\");\n const all = output ? output.split(\"\\n\") : [];\n const tail = all.slice(-BACKGROUND_OUTPUT_LINES);\n const lines = [line(block.command, \"text\", { glyph: \"$\", tone: \"primary\" })];\n if (all.length > tail.length) lines.push(line(`… ${plural(all.length - tail.length, \"earlier line\")}`, \"muted\"));\n for (const text of tail) lines.push({ text, tone: \"muted\", marker: { glyph: \"│\", tone: \"muted\" } });\n if (!all.length) lines.push(line(block.status === \"running\" ? \"(waiting for output)\" : \"(no output)\", \"muted\"));\n const exit = block.exitCode === undefined ? \"\" : ` · exit ${String(block.exitCode)}`;\n return {\n title: `Background job · ${block.status}`,\n tone: JOB_TONES[block.status],\n live: block.status === \"running\",\n meta: `${block.bgId}${exit}`,\n lines\n };\n}\n\nfunction validationPanel(block: Extract<PanelBlock, { type: \"validation\" }>): BlockPanel {\n const lines = [\n ...(block.errors ?? []).map((error) => line(error, \"text\", { glyph: \"✗\", tone: \"error\" })),\n ...(block.warnings ?? []).map((warning) => line(warning, \"text\", { glyph: \"⚠\", tone: \"warning\" }))\n ];\n return {\n title: `Validation · ${block.status}`,\n tone: block.status === \"failed\" ? \"error\" : block.status === \"passed\" ? \"success\" : \"warning\",\n live: block.status === \"running\",\n meta: normalize(block.target),\n lines\n };\n}\n\nexport function formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nfunction checkpointPanel(block: Extract<PanelBlock, { type: \"checkpoint\" }>): BlockPanel {\n const before = block.toolName ? `before ${block.toolName} · ` : \"\";\n const lines = [line(`${before}${plural(block.fileCount, \"file\")} · ${formatBytes(block.totalBytes)}${block.truncated ? \" · truncated\" : \"\"}`, \"muted\")];\n lines.push(line(`/rewind ${block.checkpointId} · ${block.reason}`, \"muted\"));\n return { title: \"Checkpoint\", tone: \"info\", live: false, meta: block.checkpointId, lines };\n}\n\n/** Unified, like inline edit diffs (side-by-side is not planned). */\nfunction checkpointDiffPanel(block: Extract<PanelBlock, { type: \"checkpoint_diff\" }>): BlockPanel {\n const lines = block.lines.map((text) => line(text, text.startsWith(\"+\") ? \"success\" : text.startsWith(\"-\") ? \"error\" : \"muted\"));\n if (block.truncated) lines.push(line(\"(truncated)\", \"muted\"));\n return { title: \"Checkpoint diff\", tone: \"info\", live: false, meta: `${normalize(block.path)} · ${block.checkpointId}`, lines };\n}\n"]}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":""}
|