@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":"GoalForm.d.ts","sourceRoot":"","sources":["../../src/components/GoalForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYlF;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IACrE,IAAI,EAAE,aAAa,CAAC;IACpB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,GAAG,SAAS,CAyCZ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { GOAL_FIELDS } from "../goal-form.js";
|
|
3
|
+
import { useTheme } from "../hooks/use-theme.js";
|
|
4
|
+
import { actionLabel } from "../keybindings.js";
|
|
5
|
+
/** What an empty field means: the objective is required; a blank check model turns the verifier off. */
|
|
6
|
+
function emptyText(field) {
|
|
7
|
+
return field === "objective" ? "(required)" : "(disabled)";
|
|
8
|
+
}
|
|
9
|
+
/** Label column width: the longest label ("Check model") plus a space. */
|
|
10
|
+
const LABEL_WIDTH = 12;
|
|
11
|
+
/**
|
|
12
|
+
* The bare `/goal` preflight form (`goal-form.ts`), in the footer's place like the
|
|
13
|
+
* other overlays: one row per field with its hint under it, the first error, and the
|
|
14
|
+
* keys. Only the selected field is an input (focused); the others show their value.
|
|
15
|
+
* Keys go through `DEFAULT_APP_KEYBINDINGS` in `App`; a click selects a field.
|
|
16
|
+
*/
|
|
17
|
+
export function GoalForm({ form, maker, inputRef, onInput, onSelect }) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const keys = `${actionLabel("goalFormNext")}/↑↓ fields · ${actionLabel("goalFormEnter")} next/start · ${actionLabel("goalFormSubmit")} start · ${actionLabel("goalFormCancel")} cancel`;
|
|
20
|
+
return (_jsxs("box", { flexDirection: "column", border: true, borderStyle: "rounded", borderColor: theme.colors.focusRing, paddingLeft: 1, paddingRight: 1, flexShrink: 0, children: [_jsx("text", { fg: theme.colors.primary, height: 1, wrapMode: "none", flexShrink: 0, children: _jsx("b", { children: "Start durable goal" }) }), _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, children: `maker ${maker} · settings apply only to this goal` }), _jsx("box", { height: 1, flexShrink: 0 }), GOAL_FIELDS.map((field, index) => {
|
|
21
|
+
const active = index === form.selected;
|
|
22
|
+
const value = form.values[field.key];
|
|
23
|
+
return (_jsxs("box", { flexDirection: "column", flexShrink: 0, onMouseDown: () => onSelect(index), children: [_jsxs("box", { flexDirection: "row", height: 1, flexShrink: 0, children: [_jsx("text", { fg: active ? theme.colors.primary : theme.colors.mutedForeground, wrapMode: "none", flexShrink: 0, children: active ? "› " : " " }), _jsx("text", { fg: active ? theme.colors.foreground : theme.colors.mutedForeground, wrapMode: "none", flexShrink: 0, children: field.label.padEnd(LABEL_WIDTH) }), active ? (_jsx("input", { ref: inputRef, focused: true, flexGrow: 1, value: value, placeholder: emptyText(field.key), placeholderColor: theme.colors.mutedForeground, textColor: theme.colors.foreground, focusedTextColor: theme.colors.foreground, onInput: onInput })) : (_jsx("text", { fg: value ? theme.colors.foreground : theme.colors.mutedForeground, wrapMode: "none", flexGrow: 1, flexShrink: 1, children: value || emptyText(field.key) }))] }), _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, paddingLeft: 2, children: field.hint })] }, field.key));
|
|
24
|
+
}), _jsx("text", { fg: theme.colors.error, height: 1, wrapMode: "none", flexShrink: 0, children: form.error ?? " " }), _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, children: keys }), _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, children: "Existing goals: /goal status \u00B7 /goal list \u00B7 /goal logs" })] }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=GoalForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoalForm.js","sourceRoot":"","sources":["../../src/components/GoalForm.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAsC,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,wGAAwG;AACxG,SAAS,SAAS,CAAC,KAAgB;IACjC,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;AAC7D,CAAC;AAED,0EAA0E;AAC1E,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAOlE;IACC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,GAAG,WAAW,CAAC,cAAc,CAAC,gBAAgB,WAAW,CAAC,eAAe,CAAC,iBAAiB,WAAW,CAA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,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,YAAG,IAAI,CAAC,KAAK,IAAI,GAAG,GAAQ,EAClG,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,YAAG,IAAI,GAAQ,EAC/F,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,iFAA+D,IAC3I,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { InputRenderable } from \"@opentui/core\";\nimport type { ReactNode, RefObject } from \"react\";\nimport { GOAL_FIELDS, type GoalField, type GoalFormState } from \"../goal-form.js\";\nimport { useTheme } from \"../hooks/use-theme.js\";\nimport { actionLabel } from \"../keybindings.js\";\n\n/** What an empty field means: the objective is required; a blank check model turns the verifier off. */\nfunction emptyText(field: GoalField): string {\n return field === \"objective\" ? \"(required)\" : \"(disabled)\";\n}\n\n/** Label column width: the longest label (\"Check model\") plus a space. */\nconst LABEL_WIDTH = 12;\n\n/**\n * The bare `/goal` preflight form (`goal-form.ts`), in the footer's place like the\n * other overlays: one row per field with its hint under it, the first error, and the\n * keys. Only the selected field is an input (focused); the others show their value.\n * Keys go through `DEFAULT_APP_KEYBINDINGS` in `App`; a click selects a field.\n */\nexport function GoalForm({ form, maker, inputRef, onInput, onSelect }: {\n form: GoalFormState;\n /** `provider/model` that makes the goal's turns. */\n maker: string;\n inputRef: RefObject<InputRenderable | null>;\n onInput: (value: string) => void;\n onSelect: (index: number) => void;\n}): ReactNode {\n const theme = useTheme();\n const keys = `${actionLabel(\"goalFormNext\")}/↑↓ fields · ${actionLabel(\"goalFormEnter\")} next/start · ${actionLabel(\"goalFormSubmit\")} start · ${actionLabel(\"goalFormCancel\")} cancel`;\n return (\n <box flexDirection=\"column\" border borderStyle=\"rounded\" borderColor={theme.colors.focusRing} paddingLeft={1} paddingRight={1} flexShrink={0}>\n <text fg={theme.colors.primary} height={1} wrapMode=\"none\" flexShrink={0}><b>Start durable goal</b></text>\n <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0}>{`maker ${maker} · settings apply only to this goal`}</text>\n <box height={1} flexShrink={0} />\n {GOAL_FIELDS.map((field, index) => {\n const active = index === form.selected;\n const value = form.values[field.key];\n return (\n <box key={field.key} flexDirection=\"column\" flexShrink={0} onMouseDown={() => onSelect(index)}>\n <box flexDirection=\"row\" height={1} flexShrink={0}>\n <text fg={active ? theme.colors.primary : theme.colors.mutedForeground} wrapMode=\"none\" flexShrink={0}>{active ? \"› \" : \" \"}</text>\n <text fg={active ? theme.colors.foreground : theme.colors.mutedForeground} wrapMode=\"none\" flexShrink={0}>{field.label.padEnd(LABEL_WIDTH)}</text>\n {active ? (\n <input\n ref={inputRef}\n focused\n flexGrow={1}\n value={value}\n placeholder={emptyText(field.key)}\n placeholderColor={theme.colors.mutedForeground}\n textColor={theme.colors.foreground}\n focusedTextColor={theme.colors.foreground}\n onInput={onInput}\n />\n ) : (\n <text fg={value ? theme.colors.foreground : theme.colors.mutedForeground} wrapMode=\"none\" flexGrow={1} flexShrink={1}>{value || emptyText(field.key)}</text>\n )}\n </box>\n <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0} paddingLeft={2}>{field.hint}</text>\n </box>\n );\n })}\n <text fg={theme.colors.error} height={1} wrapMode=\"none\" flexShrink={0}>{form.error ?? \" \"}</text>\n <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0}>{keys}</text>\n <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0}>Existing goals: /goal status · /goal list · /goal logs</text>\n </box>\n );\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type HomeProps = {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
/** Muted identity line under the tip, e.g. `provider · model · cwd`. */
|
|
6
|
+
info: string;
|
|
7
|
+
/** The composer, rendered centered at the home width. */
|
|
8
|
+
composer: ReactNode;
|
|
9
|
+
/** A status alert, shown above the composer. */
|
|
10
|
+
alert?: ReactNode;
|
|
11
|
+
/** Rows the alert and extra composer lines add, so the logo only shows when everything fits. */
|
|
12
|
+
extraRows?: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The fresh-session welcome screen: the CrewCoder logo centered in a footer
|
|
16
|
+
* that fills the terminal, with the composer beneath it, mirroring the legacy
|
|
17
|
+
* landing page. It disappears as soon as the session has any block. On windows
|
|
18
|
+
* too small for the wordmark only the composer is shown.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Home({ width, height, info, composer, alert, extraRows }: HomeProps): ReactNode;
|
|
21
|
+
//# sourceMappingURL=Home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/components/Home.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQpE,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,QAAQ,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAa,EAAE,EAAE,SAAS,GAAG,SAAS,CAyBlG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { bigCrewCodeLogoLines } from "@onpoint-dev-tools/crewcoder-tui-core/theme/logo";
|
|
3
|
+
import { useKeyboard } from "@opentui/react";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { homeComposerWidth, homeLogo } from "../footer-layout.js";
|
|
6
|
+
import { useAnimation } from "../hooks/use-animation.js";
|
|
7
|
+
import { useAppColors } from "../hooks/use-app-colors.js";
|
|
8
|
+
import { useMotion } from "../hooks/use-motion.js";
|
|
9
|
+
import { useTheme } from "../hooks/use-theme.js";
|
|
10
|
+
import { logoPulseColor, PULSE_FRAME_MS, pulseClock, pulseFrozen } from "../logo-pulse.js";
|
|
11
|
+
/**
|
|
12
|
+
* The fresh-session welcome screen: the CrewCoder logo centered in a footer
|
|
13
|
+
* that fills the terminal, with the composer beneath it, mirroring the legacy
|
|
14
|
+
* landing page. It disappears as soon as the session has any block. On windows
|
|
15
|
+
* too small for the wordmark only the composer is shown.
|
|
16
|
+
*/
|
|
17
|
+
export function Home({ width, height, info, composer, alert, extraRows = 0 }) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const logo = homeLogo(width, height, bigCrewCodeLogoLines, extraRows);
|
|
20
|
+
const composerWidth = homeComposerWidth(width);
|
|
21
|
+
return (_jsxs("box", { flexDirection: "column", width: "100%", height: "100%", justifyContent: "center", alignItems: "center", children: [logo ? (_jsxs(_Fragment, { children: [_jsx(PulsingLogo, { lines: logo }), _jsx("box", { height: 1, flexShrink: 0 })] })) : null, _jsxs("box", { width: composerWidth, flexDirection: "column", flexShrink: 0, children: [alert, composer] }), _jsx("box", { height: 2, flexShrink: 0 }), _jsxs("text", { height: 1, wrapMode: "none", flexShrink: 0, children: [_jsx("span", { fg: theme.colors.accent, children: "Tip" }), _jsx("span", { fg: theme.colors.mutedForeground, children: " Type your first request below and press Enter" })] }), _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, children: info })] }));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The wordmark breathing in one color (`logo-pulse.ts`). Only this component
|
|
25
|
+
* re-renders per frame. The timer runs only while the logo is mounted, stops
|
|
26
|
+
* after `PULSE_FREEZE_MS` without a key, and never starts under reduced motion
|
|
27
|
+
* (`NO_MOTION=1`, `CI=true`), which shows the peak color.
|
|
28
|
+
*/
|
|
29
|
+
function PulsingLogo({ lines }) {
|
|
30
|
+
const { logo: colors } = useAppColors();
|
|
31
|
+
const { reduced } = useMotion();
|
|
32
|
+
const idleSince = useRef(Date.now());
|
|
33
|
+
const [frozen, setFrozen] = useState(false);
|
|
34
|
+
useAnimation({ intervalMs: PULSE_FRAME_MS, isActive: !frozen });
|
|
35
|
+
// Any key restarts the freeze countdown; key handling itself stays in App.
|
|
36
|
+
useKeyboard(() => {
|
|
37
|
+
idleSince.current = Date.now();
|
|
38
|
+
setFrozen(false);
|
|
39
|
+
});
|
|
40
|
+
const now = Date.now();
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!frozen && pulseFrozen(idleSince.current, Date.now()))
|
|
43
|
+
setFrozen(true);
|
|
44
|
+
});
|
|
45
|
+
const color = reduced ? colors.bright : logoPulseColor(colors, pulseClock(idleSince.current, now));
|
|
46
|
+
return (_jsx(_Fragment, { children: lines.map((line, index) => (_jsx("text", { fg: color, height: 1, wrapMode: "none", flexShrink: 0, children: _jsx("b", { children: line }) }, `logo-${index}`))) }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Home.js","sourceRoot":"","sources":["../../src/components/Home.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OA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ACH,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnG,OAAO,CACL,4BACG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,eAA4B,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,YAC7E,sBAAI,IAAI,GAAK,IADJ,QAAQ,KAAK,EAAE,CAEnB,CACR,CAAC,GACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import { bigCrewCodeLogoLines } from \"@onpoint-dev-tools/crewcoder-tui-core/theme/logo\";\nimport { useKeyboard } from \"@opentui/react\";\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { homeComposerWidth, homeLogo } from \"../footer-layout.js\";\nimport { useAnimation } from \"../hooks/use-animation.js\";\nimport { useAppColors } from \"../hooks/use-app-colors.js\";\nimport { useMotion } from \"../hooks/use-motion.js\";\nimport { useTheme } from \"../hooks/use-theme.js\";\nimport { logoPulseColor, PULSE_FRAME_MS, pulseClock, pulseFrozen } from \"../logo-pulse.js\";\n\nexport type HomeProps = {\n width: number;\n height: number;\n /** Muted identity line under the tip, e.g. `provider · model · cwd`. */\n info: string;\n /** The composer, rendered centered at the home width. */\n composer: ReactNode;\n /** A status alert, shown above the composer. */\n alert?: ReactNode;\n /** Rows the alert and extra composer lines add, so the logo only shows when everything fits. */\n extraRows?: number;\n};\n\n/**\n * The fresh-session welcome screen: the CrewCoder logo centered in a footer\n * that fills the terminal, with the composer beneath it, mirroring the legacy\n * landing page. It disappears as soon as the session has any block. On windows\n * too small for the wordmark only the composer is shown.\n */\nexport function Home({ width, height, info, composer, alert, extraRows = 0 }: HomeProps): ReactNode {\n const theme = useTheme();\n const logo = homeLogo(width, height, bigCrewCodeLogoLines, extraRows);\n const composerWidth = homeComposerWidth(width);\n\n return (\n <box flexDirection=\"column\" width=\"100%\" height=\"100%\" justifyContent=\"center\" alignItems=\"center\">\n {logo ? (\n <>\n <PulsingLogo lines={logo} />\n <box height={1} flexShrink={0} />\n </>\n ) : null}\n <box width={composerWidth} flexDirection=\"column\" flexShrink={0}>\n {alert}\n {composer}\n </box>\n <box height={2} flexShrink={0} />\n <text height={1} wrapMode=\"none\" flexShrink={0}>\n <span fg={theme.colors.accent}>Tip</span>\n <span fg={theme.colors.mutedForeground}> Type your first request below and press Enter</span>\n </text>\n <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0}>{info}</text>\n </box>\n );\n}\n\n/**\n * The wordmark breathing in one color (`logo-pulse.ts`). Only this component\n * re-renders per frame. The timer runs only while the logo is mounted, stops\n * after `PULSE_FREEZE_MS` without a key, and never starts under reduced motion\n * (`NO_MOTION=1`, `CI=true`), which shows the peak color.\n */\nfunction PulsingLogo({ lines }: { lines: readonly string[] }): ReactNode {\n const { logo: colors } = useAppColors();\n const { reduced } = useMotion();\n const idleSince = useRef(Date.now());\n const [frozen, setFrozen] = useState(false);\n useAnimation({ intervalMs: PULSE_FRAME_MS, isActive: !frozen });\n // Any key restarts the freeze countdown; key handling itself stays in App.\n useKeyboard(() => {\n idleSince.current = Date.now();\n setFrozen(false);\n });\n const now = Date.now();\n useEffect(() => {\n if (!frozen && pulseFrozen(idleSince.current, Date.now())) setFrozen(true);\n });\n const color = reduced ? colors.bright : logoPulseColor(colors, pulseClock(idleSince.current, now));\n\n return (\n <>\n {lines.map((line, index) => (\n <text key={`logo-${index}`} fg={color} height={1} wrapMode=\"none\" flexShrink={0}>\n <b>{line}</b>\n </text>\n ))}\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { MentionState } from "../mentions.js";
|
|
3
|
+
export declare const MENTION_EMPTY_TEXT = "No matching paths";
|
|
4
|
+
/**
|
|
5
|
+
* `@` path suggestions under the composer (legacy "Attach file or folder"
|
|
6
|
+
* popover). At most MENTION_ROWS rows, scrolled to keep the highlighted one
|
|
7
|
+
* visible; `mentionRows` in `path-suggestions.ts` must match what renders
|
|
8
|
+
* here. The composer keeps focus: App routes Up/Down/Enter/Tab/Esc here
|
|
9
|
+
* through DEFAULT_APP_KEYBINDINGS.
|
|
10
|
+
*/
|
|
11
|
+
export declare function MentionList({ mention }: {
|
|
12
|
+
mention: MentionState;
|
|
13
|
+
}): ReactNode;
|
|
14
|
+
//# sourceMappingURL=MentionList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionList.d.ts","sourceRoot":"","sources":["../../src/components/MentionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,GAAG,SAAS,CAqB7E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "../hooks/use-theme.js";
|
|
3
|
+
import { MENTION_ROWS, mentionWindowStart } from "../path-suggestions.js";
|
|
4
|
+
export const MENTION_EMPTY_TEXT = "No matching paths";
|
|
5
|
+
/**
|
|
6
|
+
* `@` path suggestions under the composer (legacy "Attach file or folder"
|
|
7
|
+
* popover). At most MENTION_ROWS rows, scrolled to keep the highlighted one
|
|
8
|
+
* visible; `mentionRows` in `path-suggestions.ts` must match what renders
|
|
9
|
+
* here. The composer keeps focus: App routes Up/Down/Enter/Tab/Esc here
|
|
10
|
+
* through DEFAULT_APP_KEYBINDINGS.
|
|
11
|
+
*/
|
|
12
|
+
export function MentionList({ mention }) {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
if (mention.items.length === 0) {
|
|
15
|
+
return _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, paddingLeft: 2, children: MENTION_EMPTY_TEXT });
|
|
16
|
+
}
|
|
17
|
+
const start = mentionWindowStart(mention.items.length, mention.cursor);
|
|
18
|
+
const shown = mention.items.slice(start, start + MENTION_ROWS);
|
|
19
|
+
return (_jsx("box", { flexDirection: "column", width: "100%", flexShrink: 0, children: shown.map((item, offset) => {
|
|
20
|
+
const selected = start + offset === mention.cursor;
|
|
21
|
+
return (_jsxs("box", { flexDirection: "row", height: 1, flexShrink: 0, paddingLeft: 1, backgroundColor: selected ? theme.colors.selection : undefined, children: [_jsx("text", { fg: selected ? theme.colors.primary : theme.colors.mutedForeground, wrapMode: "none", flexShrink: 0, children: selected ? "▸ " : " " }), _jsx("text", { fg: selected ? theme.colors.selectionForeground : theme.colors.foreground, wrapMode: "none", flexGrow: 1, flexShrink: 1, children: item.path }), item.type === "directory" ? _jsx("text", { fg: theme.colors.mutedForeground, wrapMode: "none", flexShrink: 0, children: " dir " }) : null] }, item.path));
|
|
22
|
+
}) }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=MentionList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionList.js","sourceRoot":"","sources":["../../src/components/MentionList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,EAA6B;IAChE,MAAM,KAAK,GAAG,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AK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,YAAG,IAAI,CAAC,IAAI,GAAQ,EAC9I,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,sBAAc,CAAC,CAAC,CAAC,IAAI,KAH/G,IAAI,CAAC,IAAI,CAIb,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { useTheme } from \"../hooks/use-theme.js\";\nimport { MENTION_ROWS, mentionWindowStart } from \"../path-suggestions.js\";\nimport type { MentionState } from \"../mentions.js\";\n\nexport const MENTION_EMPTY_TEXT = \"No matching paths\";\n\n/**\n * `@` path suggestions under the composer (legacy \"Attach file or folder\"\n * popover). At most MENTION_ROWS rows, scrolled to keep the highlighted one\n * visible; `mentionRows` in `path-suggestions.ts` must match what renders\n * here. The composer keeps focus: App routes Up/Down/Enter/Tab/Esc here\n * through DEFAULT_APP_KEYBINDINGS.\n */\nexport function MentionList({ mention }: { mention: MentionState }): ReactNode {\n const theme = useTheme();\n if (mention.items.length === 0) {\n return <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0} paddingLeft={2}>{MENTION_EMPTY_TEXT}</text>;\n }\n const start = mentionWindowStart(mention.items.length, mention.cursor);\n const shown = mention.items.slice(start, start + MENTION_ROWS);\n return (\n <box flexDirection=\"column\" width=\"100%\" flexShrink={0}>\n {shown.map((item, offset) => {\n const selected = start + offset === mention.cursor;\n return (\n <box key={item.path} flexDirection=\"row\" height={1} flexShrink={0} paddingLeft={1} backgroundColor={selected ? theme.colors.selection : undefined}>\n <text fg={selected ? theme.colors.primary : theme.colors.mutedForeground} wrapMode=\"none\" flexShrink={0}>{selected ? \"▸ \" : \" \"}</text>\n <text fg={selected ? theme.colors.selectionForeground : theme.colors.foreground} wrapMode=\"none\" flexGrow={1} flexShrink={1}>{item.path}</text>\n {item.type === \"directory\" ? <text fg={theme.colors.mutedForeground} wrapMode=\"none\" flexShrink={0}> dir </text> : null}\n </box>\n );\n })}\n </box>\n );\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { InputRenderable } from "@opentui/core";
|
|
2
|
+
import type { ReactNode, RefObject } from "react";
|
|
3
|
+
import type { TranscriptSearch } from "../search-controller.js";
|
|
4
|
+
/** Rows the search bar takes in the footer: the field and the match line. */
|
|
5
|
+
export declare const SEARCH_BAR_ROWS = 2;
|
|
6
|
+
/**
|
|
7
|
+
* Transcript search in the footer, in the composer's place
|
|
8
|
+
* (`docs/TRANSCRIPT.md#search`): the query field with its counter and keys,
|
|
9
|
+
* then the current match's line with the match picked out. Keys other than
|
|
10
|
+
* typing go through `DEFAULT_APP_KEYBINDINGS` in `App`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function SearchBar({ search, width, inputRef, onQuery }: {
|
|
13
|
+
search: TranscriptSearch;
|
|
14
|
+
/** Columns the bar may use. */
|
|
15
|
+
width: number;
|
|
16
|
+
inputRef: RefObject<InputRenderable | null>;
|
|
17
|
+
onQuery: (query: string) => void;
|
|
18
|
+
}): ReactNode;
|
|
19
|
+
//# sourceMappingURL=SearchBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../../src/components/SearchBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,6EAA6E;AAC7E,eAAO,MAAM,eAAe,IAAI,CAAC;AAIjC;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAC9D,MAAM,EAAE,gBAAgB,CAAC;IACzB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,GAAG,SAAS,CAiCZ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "../hooks/use-theme.js";
|
|
3
|
+
import { actionLabel } from "../keybindings.js";
|
|
4
|
+
import { matchCounter, matchSnippet } from "../transcript-search.js";
|
|
5
|
+
/** Rows the search bar takes in the footer: the field and the match line. */
|
|
6
|
+
export const SEARCH_BAR_ROWS = 2;
|
|
7
|
+
const LABEL = "Find ";
|
|
8
|
+
/**
|
|
9
|
+
* Transcript search in the footer, in the composer's place
|
|
10
|
+
* (`docs/TRANSCRIPT.md#search`): the query field with its counter and keys,
|
|
11
|
+
* then the current match's line with the match picked out. Keys other than
|
|
12
|
+
* typing go through `DEFAULT_APP_KEYBINDINGS` in `App`.
|
|
13
|
+
*/
|
|
14
|
+
export function SearchBar({ search, width, inputRef, onQuery }) {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
const counter = matchCounter(search.index, search.matches.length);
|
|
17
|
+
const hint = `${actionLabel("searchOlder")} older · ${actionLabel("searchNewer")} newer · ${actionLabel("searchClose")} close`;
|
|
18
|
+
const current = search.current;
|
|
19
|
+
// The match line goes under the field, past the label.
|
|
20
|
+
const snippetWidth = Math.max(1, width - LABEL.length - 2);
|
|
21
|
+
return (_jsxs("box", { flexDirection: "column", width: "100%", flexShrink: 0, paddingLeft: 1, paddingRight: 1, children: [_jsxs("box", { flexDirection: "row", height: 1, flexShrink: 0, children: [_jsx("text", { fg: theme.colors.primary, wrapMode: "none", flexShrink: 0, children: _jsx("b", { children: LABEL }) }), _jsx("input", { ref: inputRef, focused: true, flexGrow: 1, flexShrink: 1, value: search.query, placeholder: "Search the transcript", placeholderColor: theme.colors.mutedForeground, textColor: theme.colors.foreground, focusedTextColor: theme.colors.foreground, onInput: onQuery }), _jsxs("text", { height: 1, wrapMode: "none", flexShrink: 0, children: [_jsx("span", { fg: search.query && !current ? theme.colors.error : theme.colors.accent, children: ` ${counter}` }), _jsx("span", { fg: theme.colors.mutedForeground, children: ` ${hint}` })] })] }), _jsx("text", { height: 1, wrapMode: "none", flexShrink: 0, paddingLeft: LABEL.length, children: current ? _jsx(MatchLine, { match: current, width: snippetWidth }) : _jsx("span", { fg: theme.colors.mutedForeground, children: search.query ? "No matches" : " " }) })] }));
|
|
22
|
+
}
|
|
23
|
+
function MatchLine({ match, width }) {
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
const snippet = matchSnippet(match, width);
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { fg: theme.colors.mutedForeground, children: snippet.before }), _jsx("span", { fg: theme.colors.warningForeground, bg: theme.colors.warning, children: _jsx("b", { children: snippet.match }) }), _jsx("span", { fg: theme.colors.mutedForeground, children: snippet.after })] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../src/components/SearchBar.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAErE,6EAA6E;AAC7E,MAAM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AC,KAAK,GAAK,GAAO,EACjG,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,YAAG,OAAO,CAAC,KAAK,GAAQ,IAC7D,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import type { InputRenderable } from \"@opentui/core\";\nimport type { ReactNode, RefObject } from \"react\";\nimport { useTheme } from \"../hooks/use-theme.js\";\nimport { actionLabel } from \"../keybindings.js\";\nimport type { TranscriptSearch } from \"../search-controller.js\";\nimport { matchCounter, matchSnippet } from \"../transcript-search.js\";\n\n/** Rows the search bar takes in the footer: the field and the match line. */\nexport const SEARCH_BAR_ROWS = 2;\n\nconst LABEL = \"Find \";\n\n/**\n * Transcript search in the footer, in the composer's place\n * (`docs/TRANSCRIPT.md#search`): the query field with its counter and keys,\n * then the current match's line with the match picked out. Keys other than\n * typing go through `DEFAULT_APP_KEYBINDINGS` in `App`.\n */\nexport function SearchBar({ search, width, inputRef, onQuery }: {\n search: TranscriptSearch;\n /** Columns the bar may use. */\n width: number;\n inputRef: RefObject<InputRenderable | null>;\n onQuery: (query: string) => void;\n}): ReactNode {\n const theme = useTheme();\n const counter = matchCounter(search.index, search.matches.length);\n const hint = `${actionLabel(\"searchOlder\")} older · ${actionLabel(\"searchNewer\")} newer · ${actionLabel(\"searchClose\")} close`;\n const current = search.current;\n // The match line goes under the field, past the label.\n const snippetWidth = Math.max(1, width - LABEL.length - 2);\n return (\n <box flexDirection=\"column\" width=\"100%\" flexShrink={0} paddingLeft={1} paddingRight={1}>\n <box flexDirection=\"row\" height={1} flexShrink={0}>\n <text fg={theme.colors.primary} wrapMode=\"none\" flexShrink={0}><b>{LABEL}</b></text>\n <input\n ref={inputRef}\n focused\n flexGrow={1}\n flexShrink={1}\n value={search.query}\n placeholder=\"Search the transcript\"\n placeholderColor={theme.colors.mutedForeground}\n textColor={theme.colors.foreground}\n focusedTextColor={theme.colors.foreground}\n onInput={onQuery}\n />\n <text height={1} wrapMode=\"none\" flexShrink={0}>\n <span fg={search.query && !current ? theme.colors.error : theme.colors.accent}>{` ${counter}`}</span>\n <span fg={theme.colors.mutedForeground}>{` ${hint}`}</span>\n </text>\n </box>\n <text height={1} wrapMode=\"none\" flexShrink={0} paddingLeft={LABEL.length}>\n {current ? <MatchLine match={current} width={snippetWidth} /> : <span fg={theme.colors.mutedForeground}>{search.query ? \"No matches\" : \" \"}</span>}\n </text>\n </box>\n );\n}\n\nfunction MatchLine({ match, width }: { match: NonNullable<TranscriptSearch[\"current\"]>; width: number }): ReactNode {\n const theme = useTheme();\n const snippet = matchSnippet(match, width);\n return (\n <>\n <span fg={theme.colors.mutedForeground}>{snippet.before}</span>\n <span fg={theme.colors.warningForeground} bg={theme.colors.warning}><b>{snippet.match}</b></span>\n <span fg={theme.colors.mutedForeground}>{snippet.after}</span>\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { CrewTaskSnapshot } from "@onpoint-dev-tools/crewcoder-tui-core/state/crew-tasks";
|
|
3
|
+
import { type SidebarState } from "../sidebar-model.js";
|
|
4
|
+
export type SidebarProps = {
|
|
5
|
+
state: SidebarState;
|
|
6
|
+
tasks: CrewTaskSnapshot | undefined;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
/** Local home directory for `~` in the footer; omit for remote workspaces. */
|
|
10
|
+
home?: string;
|
|
11
|
+
/** The divider was dragged to terminal column `x` (0-based). */
|
|
12
|
+
onDividerDrag: (x: number) => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The right sidebar: a draggable divider, then the rows from `sidebarRows`.
|
|
16
|
+
* The spinner only ticks while a crew worker runs.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Sidebar({ state, tasks, width, height, home, onDividerDrag }: SidebarProps): ReactNode;
|
|
19
|
+
//# sourceMappingURL=Sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../src/components/Sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAI/F,OAAO,EAAe,KAAK,YAAY,EAAoB,MAAM,qBAAqB,CAAC;AAEvF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,YAAY,GAAG,SAAS,CA6BrG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { TextAttributes } from "@opentui/core";
|
|
3
|
+
import cliSpinners from "cli-spinners";
|
|
4
|
+
import { useAnimation } from "../hooks/use-animation.js";
|
|
5
|
+
import { useTheme } from "../hooks/use-theme.js";
|
|
6
|
+
import { sidebarRows } from "../sidebar-model.js";
|
|
7
|
+
const SPINNER = cliSpinners.dots;
|
|
8
|
+
/**
|
|
9
|
+
* The right sidebar: a draggable divider, then the rows from `sidebarRows`.
|
|
10
|
+
* The spinner only ticks while a crew worker runs.
|
|
11
|
+
*/
|
|
12
|
+
export function Sidebar({ state, tasks, width, height, home, onDividerDrag }) {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const running = state.crewWorkers.some((worker) => worker.status === "running");
|
|
15
|
+
const frame = useAnimation({ intervalMs: SPINNER.interval, isActive: running });
|
|
16
|
+
const rows = sidebarRows({ state, tasks, spinner: SPINNER.frames[frame % SPINNER.frames.length] ?? "•", home }, width, height);
|
|
17
|
+
return (_jsxs("box", { flexDirection: "row", height: "100%", flexShrink: 0, children: [_jsx("box", { width: 1, height: "100%", flexShrink: 0, border: ["left"], borderColor: theme.colors.border, onMouseDrag: (event) => onDividerDrag(event.x) }), _jsx("box", { width: width, height: "100%", flexDirection: "column", flexShrink: 0, backgroundColor: theme.colors.muted, children: rows.map((row, index) => (_jsx("text", { height: 1, wrapMode: "none", flexShrink: 0, children: row.map((span, spanIndex) => (_jsx("span", { fg: toneColor(theme, span.tone), attributes: (span.bold ? TextAttributes.BOLD : 0) | (span.strike ? TextAttributes.STRIKETHROUGH : 0), children: span.text }, spanIndex))) }, index))) })] }));
|
|
18
|
+
}
|
|
19
|
+
function toneColor(theme, tone) {
|
|
20
|
+
switch (tone) {
|
|
21
|
+
case "heading": return theme.colors.accent;
|
|
22
|
+
case "taskHeading":
|
|
23
|
+
case "warning": return theme.colors.warning;
|
|
24
|
+
case "text": return theme.colors.foreground;
|
|
25
|
+
case "count":
|
|
26
|
+
case "muted":
|
|
27
|
+
case "subtle": return theme.colors.mutedForeground;
|
|
28
|
+
case "success": return theme.colors.success;
|
|
29
|
+
case "error": return theme.colors.error;
|
|
30
|
+
case "active": return theme.colors.info;
|
|
31
|
+
case "rule": return theme.colors.border;
|
|
32
|
+
case "brand": return theme.colors.primary;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.js","sourceRoot":"","sources":["../../src/components/Sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AAChE,OAAO,WAAW,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,C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AC,KAAK,CAAC;QACxC,KAAK,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QACxC,KAAK,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;QACxC,KAAK,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;IAC5C,CAAC;AACH,CAAC","sourcesContent":["import { TextAttributes, type MouseEvent } from \"@opentui/core\";\nimport cliSpinners from \"cli-spinners\";\nimport type { ReactNode } from \"react\";\nimport type { CrewTaskSnapshot } from \"@onpoint-dev-tools/crewcoder-tui-core/state/crew-tasks\";\nimport { useAnimation } from \"../hooks/use-animation.js\";\nimport { useTheme } from \"../hooks/use-theme.js\";\nimport type { Theme } from \"./ui/types.js\";\nimport { sidebarRows, type SidebarState, type SidebarTone } from \"../sidebar-model.js\";\n\nexport type SidebarProps = {\n state: SidebarState;\n tasks: CrewTaskSnapshot | undefined;\n width: number;\n height: number;\n /** Local home directory for `~` in the footer; omit for remote workspaces. */\n home?: string;\n /** The divider was dragged to terminal column `x` (0-based). */\n onDividerDrag: (x: number) => void;\n};\n\nconst SPINNER = cliSpinners.dots;\n\n/**\n * The right sidebar: a draggable divider, then the rows from `sidebarRows`.\n * The spinner only ticks while a crew worker runs.\n */\nexport function Sidebar({ state, tasks, width, height, home, onDividerDrag }: SidebarProps): ReactNode {\n const theme = useTheme();\n const running = state.crewWorkers.some((worker) => worker.status === \"running\");\n const frame = useAnimation({ intervalMs: SPINNER.interval, isActive: running });\n const rows = sidebarRows({ state, tasks, spinner: SPINNER.frames[frame % SPINNER.frames.length] ?? \"•\", home }, width, height);\n return (\n <box flexDirection=\"row\" height=\"100%\" flexShrink={0}>\n {/* A box, not text: text would start a mouse selection instead of a drag. */}\n <box\n width={1}\n height=\"100%\"\n flexShrink={0}\n border={[\"left\"]}\n borderColor={theme.colors.border}\n onMouseDrag={(event: MouseEvent) => onDividerDrag(event.x)}\n />\n <box width={width} height=\"100%\" flexDirection=\"column\" flexShrink={0} backgroundColor={theme.colors.muted}>\n {rows.map((row, index) => (\n <text key={index} height={1} wrapMode=\"none\" flexShrink={0}>\n {row.map((span, spanIndex) => (\n <span key={spanIndex} fg={toneColor(theme, span.tone)} attributes={(span.bold ? TextAttributes.BOLD : 0) | (span.strike ? TextAttributes.STRIKETHROUGH : 0)}>\n {span.text}\n </span>\n ))}\n </text>\n ))}\n </box>\n </box>\n );\n}\n\nfunction toneColor(theme: Theme, tone: SidebarTone): string {\n switch (tone) {\n case \"heading\": return theme.colors.accent;\n case \"taskHeading\":\n case \"warning\": return theme.colors.warning;\n case \"text\": return theme.colors.foreground;\n case \"count\":\n case \"muted\":\n case \"subtle\": return theme.colors.mutedForeground;\n case \"success\": return theme.colors.success;\n case \"error\": return theme.colors.error;\n case \"active\": return theme.colors.info;\n case \"rule\": return theme.colors.border;\n case \"brand\": return theme.colors.primary;\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TextareaRenderable } from "@opentui/core";
|
|
2
|
+
import { type ReactNode, type RefObject } from "react";
|
|
3
|
+
import type { SummaryEditorState } from "../command-runner.js";
|
|
4
|
+
export type SummaryEditorProps = {
|
|
5
|
+
editor: SummaryEditorState;
|
|
6
|
+
editorRef: RefObject<TextareaRenderable | null>;
|
|
7
|
+
/** Text rows (`summaryEditorTextRows`); the editor adds its border and hint row. */
|
|
8
|
+
textRows: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* `/compact preview`: edit the proposed compaction summary before it is
|
|
12
|
+
* installed. It gates a live compaction, so it is a focused editor, not a log.
|
|
13
|
+
* Keys (apply / reset / cancel) are routed by App through DEFAULT_APP_KEYBINDINGS.
|
|
14
|
+
*/
|
|
15
|
+
export declare function SummaryEditor({ editor, editorRef, textRows }: SummaryEditorProps): ReactNode;
|
|
16
|
+
//# sourceMappingURL=SummaryEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SummaryEditor.d.ts","sourceRoot":"","sources":["../../src/components/SummaryEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAChD,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,SAAS,CAyB5F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useTheme } from "../hooks/use-theme.js";
|
|
4
|
+
import { actionLabel } from "../keybindings.js";
|
|
5
|
+
/**
|
|
6
|
+
* `/compact preview`: edit the proposed compaction summary before it is
|
|
7
|
+
* installed. It gates a live compaction, so it is a focused editor, not a log.
|
|
8
|
+
* Keys (apply / reset / cancel) are routed by App through DEFAULT_APP_KEYBINDINGS.
|
|
9
|
+
*/
|
|
10
|
+
export function SummaryEditor({ editor, editorRef, textRows }) {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
// Open with the cursor after the summary, so typing appends instead of prepending.
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
editorRef.current?.gotoBufferEnd();
|
|
15
|
+
}, [editorRef, editor]);
|
|
16
|
+
const counts = editor.originalMessageCount !== undefined && editor.retainedMessageCount !== undefined
|
|
17
|
+
? ` · ${editor.originalMessageCount} → ${editor.retainedMessageCount} messages` : "";
|
|
18
|
+
const title = ` Edit compaction summary${editor.source ? ` · ${editor.source}` : ""}${counts} `;
|
|
19
|
+
return (_jsxs("box", { flexDirection: "column", border: true, borderStyle: "rounded", borderColor: theme.colors.focusRing, title: title, titleColor: theme.colors.mutedForeground, paddingLeft: 1, paddingRight: 1, flexShrink: 0, children: [_jsx("textarea", { ref: editorRef, focused: true, height: textRows, wrapMode: "word", initialValue: editor.summary, textColor: theme.colors.foreground, focusedTextColor: theme.colors.foreground }), _jsx("text", { fg: theme.colors.mutedForeground, height: 1, wrapMode: "none", flexShrink: 0, children: `${actionLabel("summaryApply")} apply · ${actionLabel("summaryReset")} reset · ${actionLabel("summaryCancel")} cancel` })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=SummaryEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SummaryEditor.js","sourceRoot":"","sources":["../../src/components/SummaryEditor.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAsB;IAC/E,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,mFAAmF;IACnF,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;IACrC,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACxB,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB,KAAK,SAAS,IAAI,MAAM,CAAC,oBAAoB,KAAK,SAAS;QACnG,CAAC,CAAC,MAAM,MAAM,CAAC,oBAAoB,MAAM,MAAM,CAAC,oBAAoB,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACvF,MAAM,KAAK,GAAG,2BAA2B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,GAAG,CAAC;IAChG,OAAO,CACL,eAAK,aAAa,EAAC,QAAQ,EAAC,MAAM,QAAC,WAAW,EAAC,SAAS,EAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,aAClM,mBACE,GAAG,EAAE,SAAS,EACd,OAAO,QACP,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAC,MAAM,EACf,YAAY,EAAE,MAAM,CAAC,OAAO,EAC5B,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,EAClC,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,GACzC,EACF,eAAM,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAC,MAAM,EAAC,UAAU,EAAE,CAAC,YAC7E,GAAG,WAAW,CAAC,cAAc,CAAC,YAAY,WAAW,CAAC,cAAc,CAAC,YAAY,WAAW,CAAC,eAAe,CAAC,SAAS,GAClH,IACH,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { TextareaRenderable } from \"@opentui/core\";\nimport { useEffect, type ReactNode, type RefObject } from \"react\";\nimport type { SummaryEditorState } from \"../command-runner.js\";\nimport { useTheme } from \"../hooks/use-theme.js\";\nimport { actionLabel } from \"../keybindings.js\";\n\nexport type SummaryEditorProps = {\n editor: SummaryEditorState;\n editorRef: RefObject<TextareaRenderable | null>;\n /** Text rows (`summaryEditorTextRows`); the editor adds its border and hint row. */\n textRows: number;\n};\n\n/**\n * `/compact preview`: edit the proposed compaction summary before it is\n * installed. It gates a live compaction, so it is a focused editor, not a log.\n * Keys (apply / reset / cancel) are routed by App through DEFAULT_APP_KEYBINDINGS.\n */\nexport function SummaryEditor({ editor, editorRef, textRows }: SummaryEditorProps): ReactNode {\n const theme = useTheme();\n // Open with the cursor after the summary, so typing appends instead of prepending.\n useEffect(() => {\n editorRef.current?.gotoBufferEnd();\n }, [editorRef, editor]);\n const counts = editor.originalMessageCount !== undefined && editor.retainedMessageCount !== undefined\n ? ` · ${editor.originalMessageCount} → ${editor.retainedMessageCount} messages` : \"\";\n const title = ` Edit compaction summary${editor.source ? ` · ${editor.source}` : \"\"}${counts} `;\n return (\n <box flexDirection=\"column\" border borderStyle=\"rounded\" borderColor={theme.colors.focusRing} title={title} titleColor={theme.colors.mutedForeground} paddingLeft={1} paddingRight={1} flexShrink={0}>\n <textarea\n ref={editorRef}\n focused\n height={textRows}\n wrapMode=\"word\"\n initialValue={editor.summary}\n textColor={theme.colors.foreground}\n focusedTextColor={theme.colors.foreground}\n />\n <text fg={theme.colors.mutedForeground} height={1} wrapMode=\"none\" flexShrink={0}>\n {`${actionLabel(\"summaryApply\")} apply · ${actionLabel(\"summaryReset\")} reset · ${actionLabel(\"summaryCancel\")} cancel`}\n </text>\n </box>\n );\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BorderCharacters, ScrollBoxRenderable } from "@opentui/core";
|
|
2
|
+
import type { TuiEventBlock } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
|
|
3
|
+
import { type ReactNode, type Ref } from "react";
|
|
4
|
+
import { type ImageMode } from "../image-view.js";
|
|
5
|
+
import type { TuiRendererHook } from "@onpoint-dev-tools/crewcoder-tui-core/state/tui-store";
|
|
6
|
+
import { type ToolExpansion } from "../transcript.js";
|
|
7
|
+
export type TranscriptProps = {
|
|
8
|
+
blocks: readonly TuiEventBlock[];
|
|
9
|
+
running: boolean;
|
|
10
|
+
cwd: string;
|
|
11
|
+
expansion: ToolExpansion;
|
|
12
|
+
images: ImageDisplay;
|
|
13
|
+
scrollRef?: Ref<ScrollBoxRenderable>;
|
|
14
|
+
/** Content row of the current search match; a marker points at it from the left margin. */
|
|
15
|
+
markRow?: number;
|
|
16
|
+
/** Extension tool renderers (`crewcoder extension renderers`); a match draws the tool from its template. */
|
|
17
|
+
renderers?: readonly TuiRendererHook[];
|
|
18
|
+
};
|
|
19
|
+
/** How image blocks draw: the pixel mode, the columns they may use, and the screen height they are capped against. */
|
|
20
|
+
export type ImageDisplay = {
|
|
21
|
+
mode: ImageMode;
|
|
22
|
+
cols: number;
|
|
23
|
+
screenRows: number;
|
|
24
|
+
};
|
|
25
|
+
/** Shown under an image whose pixels could not be drawn (unreadable or undecodable file). */
|
|
26
|
+
export declare const IMAGE_FAILED_TEXT = "(image could not be drawn)";
|
|
27
|
+
/** Dashed rounded border for the Agent work box. */
|
|
28
|
+
export declare const DASHED_BORDER: BorderCharacters;
|
|
29
|
+
export declare const AGENT_WORK_TITLE = "Agent work";
|
|
30
|
+
export declare const REASONING_LABEL = "Reasoning";
|
|
31
|
+
/**
|
|
32
|
+
* The whole conversation in a scrollbox that sticks to the bottom while new
|
|
33
|
+
* output arrives and stays put once the user scrolls up (until they scroll back
|
|
34
|
+
* down). Sections follow event order, divided by a blank row.
|
|
35
|
+
*/
|
|
36
|
+
export declare function Transcript({ blocks, running, cwd, expansion, images, scrollRef, markRow, renderers }: TranscriptProps): ReactNode;
|
|
37
|
+
//# sourceMappingURL=Transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transcript.d.ts","sourceRoot":"","sources":["../../src/components/Transcript.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAqB,KAAK,SAAS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