@bubblebrain-ai/bubble 0.0.52 → 0.0.53
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/README.md +4 -12
- package/dist/agent/routing-catalog.js +3 -2
- package/dist/agent/subagent/router.js +5 -0
- package/dist/agent/subagent/runtime.d.ts +1 -0
- package/dist/agent/subagent/runtime.js +13 -1
- package/dist/agent/subagent-control.d.ts +4 -0
- package/dist/agent/subagent-control.js +1 -0
- package/dist/agent/subagent-store.js +2 -0
- package/dist/agent/workflow/control.d.ts +2 -0
- package/dist/agent/workflow/runs.d.ts +1 -0
- package/dist/agent/workflow/runs.js +3 -0
- package/dist/agent.d.ts +11 -1
- package/dist/agent.js +158 -57
- package/dist/bin.js +2 -44
- package/dist/config.d.ts +14 -1
- package/dist/config.js +45 -4
- package/dist/context/budget.d.ts +7 -1
- package/dist/context/budget.js +25 -2
- package/dist/context/compact-llm.d.ts +1 -1
- package/dist/context/compact-llm.js +5 -2
- package/dist/context/overflow.js +2 -0
- package/dist/context/projector.d.ts +8 -0
- package/dist/context/projector.js +55 -6
- package/dist/context/tool-output-truncate.d.ts +17 -1
- package/dist/context/tool-output-truncate.js +171 -49
- package/dist/feishu/agent-host/run-driver.js +3 -0
- package/dist/feishu/serve.js +2 -0
- package/dist/goal/command.d.ts +1 -1
- package/dist/goal/command.js +7 -2
- package/dist/main.d.ts +1 -1
- package/dist/main.js +38 -8
- package/dist/memory/db.js +0 -7
- package/dist/model-catalog.js +25 -6
- package/dist/model-config.js +3 -2
- package/dist/model-pricing.d.ts +24 -5
- package/dist/model-pricing.js +0 -0
- package/dist/model-selection.js +13 -4
- package/dist/network/chatgpt-transport.js +0 -34
- package/dist/network/errors.d.ts +19 -0
- package/dist/network/errors.js +24 -0
- package/dist/network/provider-transport.d.ts +0 -4
- package/dist/network/provider-transport.js +3 -35
- package/dist/network/retry.d.ts +6 -1
- package/dist/network/retry.js +9 -0
- package/dist/provider-model-policy.d.ts +16 -0
- package/dist/provider-model-policy.js +33 -0
- package/dist/provider-registry.d.ts +1 -1
- package/dist/provider-registry.js +73 -10
- package/dist/provider-transform.js +32 -4
- package/dist/provider.d.ts +6 -2
- package/dist/provider.js +95 -6
- package/dist/question/controller.js +5 -4
- package/dist/question/normalize.d.ts +6 -0
- package/dist/question/normalize.js +11 -0
- package/dist/rewind.d.ts +20 -0
- package/dist/rewind.js +29 -0
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +11 -3
- package/dist/session.d.ts +7 -0
- package/dist/session.js +20 -0
- package/dist/skills/discovery.js +18 -0
- package/dist/skills/registry.d.ts +12 -2
- package/dist/skills/registry.js +40 -5
- package/dist/skills/types.d.ts +2 -0
- package/dist/slash-commands/commands.js +120 -81
- package/dist/slash-commands/registry.d.ts +2 -1
- package/dist/slash-commands/registry.js +3 -0
- package/dist/slash-commands/types.d.ts +22 -4
- package/dist/stats/usage.d.ts +3 -1
- package/dist/stats/usage.js +22 -13
- package/dist/tasks/manager.d.ts +4 -2
- package/dist/tasks/manager.js +34 -9
- package/dist/tasks/promotion.d.ts +2 -2
- package/dist/tasks/promotion.js +2 -2
- package/dist/tools/agent-lifecycle.js +4 -0
- package/dist/tools/bash.d.ts +3 -1
- package/dist/tools/bash.js +13 -2
- package/dist/tools/grep.d.ts +5 -1
- package/dist/tools/grep.js +318 -69
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +1 -0
- package/dist/tools/question.js +5 -4
- package/dist/tools/read.js +40 -21
- package/dist/tui/animation-clock.d.ts +14 -0
- package/dist/tui/animation-clock.js +34 -0
- package/dist/tui/app.d.ts +176 -0
- package/dist/tui/app.js +1647 -0
- package/dist/tui/components/approval-dialog.d.ts +43 -0
- package/dist/tui/components/approval-dialog.js +247 -0
- package/dist/tui/components/bottom-sheet.d.ts +9 -0
- package/dist/tui/components/bottom-sheet.js +32 -0
- package/dist/tui/components/context-info.d.ts +54 -0
- package/dist/tui/components/context-info.js +388 -0
- package/dist/tui/components/feedback-dialog.d.ts +56 -0
- package/dist/tui/components/feedback-dialog.js +262 -0
- package/dist/tui/components/feishu-setup-dialog.d.ts +65 -0
- package/dist/tui/components/feishu-setup-dialog.js +332 -0
- package/dist/tui/components/image-preview.d.ts +32 -0
- package/dist/tui/components/image-preview.js +130 -0
- package/dist/tui/components/plan-dialog.d.ts +34 -0
- package/dist/tui/components/plan-dialog.js +196 -0
- package/dist/tui/components/provider-key-input.d.ts +18 -0
- package/dist/tui/components/provider-key-input.js +49 -0
- package/dist/tui/components/question-dialog.d.ts +25 -0
- package/dist/tui/components/question-dialog.js +263 -0
- package/dist/tui/components/responsive-transcript.d.ts +31 -0
- package/dist/tui/components/responsive-transcript.js +77 -0
- package/dist/tui/components/rewind-picker.d.ts +62 -0
- package/dist/tui/components/rewind-picker.js +317 -0
- package/dist/tui/components/session-picker.d.ts +49 -0
- package/dist/tui/components/session-picker.js +303 -0
- package/dist/tui/components/skills-panel.d.ts +59 -0
- package/dist/tui/components/skills-panel.js +568 -0
- package/dist/tui/components/stats-panel.d.ts +40 -0
- package/dist/tui/components/stats-panel.js +301 -0
- package/dist/tui/components/streaming-message.d.ts +69 -0
- package/dist/tui/components/streaming-message.js +393 -0
- package/dist/tui/components/subagent-inspector.d.ts +28 -0
- package/dist/tui/components/subagent-inspector.js +127 -0
- package/dist/tui/components/task-inspector.d.ts +26 -0
- package/dist/tui/components/task-inspector.js +70 -0
- package/dist/tui/components/tasks-pane.d.ts +88 -0
- package/dist/tui/components/tasks-pane.js +416 -0
- package/dist/tui/components/transcript.d.ts +96 -0
- package/dist/tui/components/transcript.js +771 -0
- package/dist/tui/components/welcome.d.ts +20 -0
- package/dist/tui/components/welcome.js +133 -0
- package/dist/tui/components/workflow-inspector.d.ts +30 -0
- package/dist/tui/components/workflow-inspector.js +136 -0
- package/dist/tui/composer-autocomplete.d.ts +61 -0
- package/dist/tui/composer-autocomplete.js +383 -0
- package/dist/tui/composer-style.d.ts +7 -0
- package/dist/tui/composer-style.js +29 -0
- package/dist/tui/controller/agent-event-reducer.d.ts +75 -0
- package/dist/tui/controller/agent-event-reducer.js +238 -0
- package/dist/tui/controller/composer-controller.d.ts +95 -0
- package/dist/tui/controller/composer-controller.js +502 -0
- package/dist/tui/controller/controller.d.ts +194 -0
- package/dist/tui/controller/controller.js +1035 -0
- package/dist/tui/controller/effects.d.ts +71 -0
- package/dist/tui/controller/effects.js +1 -0
- package/dist/tui/controller/goal-runtime-controller.d.ts +47 -0
- package/dist/tui/controller/goal-runtime-controller.js +202 -0
- package/dist/tui/controller/input-queue-machine.d.ts +71 -0
- package/dist/tui/controller/input-queue-machine.js +121 -0
- package/dist/tui/controller/intents.d.ts +56 -0
- package/dist/tui/controller/intents.js +6 -0
- package/dist/tui/controller/overlay-controller.d.ts +64 -0
- package/dist/tui/controller/overlay-controller.js +129 -0
- package/dist/tui/controller/ports.d.ts +57 -0
- package/dist/tui/controller/ports.js +9 -0
- package/dist/tui/controller/session-transition.d.ts +54 -0
- package/dist/tui/controller/session-transition.js +68 -0
- package/dist/tui/controller/state.d.ts +14 -0
- package/dist/tui/controller/state.js +36 -0
- package/dist/tui/controller/task-runtime-controller.d.ts +66 -0
- package/dist/tui/controller/task-runtime-controller.js +158 -0
- package/dist/tui/footer.d.ts +37 -0
- package/dist/tui/footer.js +80 -0
- package/dist/{tui-ink → tui/formatting}/edit-diff.d.ts +1 -1
- package/dist/{tui-ink → tui/formatting}/edit-diff.js +1 -1
- package/dist/{tui-ink/app-helpers.d.ts → tui/formatting/summary.d.ts} +4 -4
- package/dist/{tui-ink/app-helpers.js → tui/formatting/summary.js} +2 -2
- package/dist/tui/fullscreen.d.ts +48 -0
- package/dist/tui/fullscreen.js +255 -0
- package/dist/tui/image-display.d.ts +4 -0
- package/dist/tui/image-display.js +30 -12
- package/dist/tui/markdown-style.d.ts +5 -0
- package/dist/tui/markdown-style.js +23 -0
- package/dist/{tui-ink → tui/model}/composer-buffer.js +1 -1
- package/dist/tui/model/composer-types.d.ts +17 -0
- package/dist/tui/model/composer-types.js +1 -0
- package/dist/{tui-ink → tui/model}/display-history.d.ts +7 -1
- package/dist/{tui-ink → tui/model}/display-reconstruct.d.ts +1 -1
- package/dist/{tui-ink → tui/model}/display-reconstruct.js +54 -6
- package/dist/{tui-ink → tui/model}/file-mentions.d.ts +2 -0
- package/dist/{tui-ink → tui/model}/file-mentions.js +4 -0
- package/dist/tui/model/image-attachment.d.ts +15 -0
- package/dist/tui/model/image-attachment.js +1 -0
- package/dist/{tui-ink → tui/model}/image-paste.d.ts +7 -1
- package/dist/{tui-ink → tui/model}/image-paste.js +46 -0
- package/dist/tui/model/input-history.d.ts +1 -0
- package/dist/tui/model/input-history.js +1 -0
- package/dist/{tui-ink → tui/model}/input-queue.d.ts +1 -1
- package/dist/{tui-ink → tui/model}/recent-activity.js +1 -1
- package/dist/{tui-ink → tui/model}/subagent-view.d.ts +17 -2
- package/dist/{tui-ink → tui/model}/subagent-view.js +125 -4
- package/dist/{tui-ink → tui/model}/submit-dedupe.d.ts +1 -1
- package/dist/tui/model/theme-style.d.ts +10 -0
- package/dist/tui/model/theme-style.js +79 -0
- package/dist/{tui-ink → tui/model}/theme.d.ts +11 -23
- package/dist/{tui-ink → tui/model}/theme.js +23 -38
- package/dist/{tui-ink → tui/model}/trace-groups.d.ts +2 -0
- package/dist/{tui-ink → tui/model}/trace-groups.js +91 -30
- package/dist/tui/model/trace-interaction.d.ts +63 -0
- package/dist/tui/model/trace-interaction.js +87 -0
- package/dist/tui/model-picker-data.d.ts +1 -2
- package/dist/tui/model-picker-data.js +8 -1
- package/dist/tui/model-switch.js +2 -0
- package/dist/{tui-ink → tui}/run-session-picker.d.ts +2 -3
- package/dist/tui/run-session-picker.js +64 -0
- package/dist/tui/run.d.ts +72 -0
- package/dist/tui/run.js +139 -0
- package/dist/tui/terminal/multiplexer.d.ts +5 -0
- package/dist/tui/terminal/multiplexer.js +14 -0
- package/dist/tui/testing/fake-agent.d.ts +24 -0
- package/dist/tui/testing/fake-agent.js +22 -0
- package/dist/tui/testing/spy-host.d.ts +21 -0
- package/dist/tui/testing/spy-host.js +55 -0
- package/dist/tui/trace-groups.js +27 -6
- package/dist/types.d.ts +7 -0
- package/node_modules/@bubblebrain-ai/pi-tui/LICENSE +21 -0
- package/node_modules/@bubblebrain-ai/pi-tui/README.md +854 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.d.ts +26 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.js +121 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.d.ts +86 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.js +649 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.d.ts +13 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.js +36 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.d.ts +22 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.js +99 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.js +36 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.d.ts +330 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.js +2344 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.d.ts +7 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.js +43 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.d.ts +28 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.js +82 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.d.ts +48 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.js +390 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.d.ts +31 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.js +67 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.d.ts +103 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.js +797 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.d.ts +56 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.js +179 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.d.ts +53 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.js +175 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.d.ts +50 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.js +174 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.d.ts +12 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.js +22 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.d.ts +32 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.js +109 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.d.ts +19 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.js +81 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.d.ts +13 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.js +48 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.d.ts +8 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.js +26 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.d.ts +39 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.js +2 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.d.ts +16 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.js +110 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.d.ts +31 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.js +42 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.d.ts +273 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.js +231 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.d.ts +184 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.js +1174 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.d.ts +28 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.js +46 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.d.ts +10 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.js +1268 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.d.ts +40 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.js +6 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.d.ts +42 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.js +335 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.d.ts +3 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.js +60 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.d.ts +56 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.js +363 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.d.ts +10 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.js +59 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.d.ts +116 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.js +518 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.d.ts +142 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.js +544 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.d.ts +11 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.js +11 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.d.ts +140 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.js +1334 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-main-screen.d.ts +39 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-main-screen.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-main-screen.js +536 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-main-screen.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.d.ts +338 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.js +1016 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/undo-stack.d.ts +17 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/undo-stack.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/undo-stack.js +27 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/undo-stack.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/utils.d.ts +96 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/utils.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/utils.js +1193 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/utils.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/word-navigation.d.ts +25 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/word-navigation.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/word-navigation.js +96 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/word-navigation.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/test/virtual-terminal.d.ts +73 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/test/virtual-terminal.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/test/virtual-terminal.js +188 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/test/virtual-terminal.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/darwin/README.md +20 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/darwin/build.sh +62 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/darwin/src/darwin-modifiers.c +70 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/win32/README.md +22 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/win32/build.mjs +229 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@bubblebrain-ai/pi-tui/native/win32/src/win32-console-mode.c +119 -0
- package/node_modules/@bubblebrain-ai/pi-tui/package.json +66 -0
- package/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/node_modules/get-east-asian-width/index.js +30 -0
- package/node_modules/get-east-asian-width/license +9 -0
- package/node_modules/get-east-asian-width/lookup-data.js +21 -0
- package/node_modules/get-east-asian-width/lookup.js +138 -0
- package/node_modules/get-east-asian-width/package.json +71 -0
- package/node_modules/get-east-asian-width/readme.md +65 -0
- package/node_modules/get-east-asian-width/utilities.js +24 -0
- package/package.json +23 -10
- package/packages/pi-tui/node_modules/marked/LICENSE +44 -0
- package/packages/pi-tui/node_modules/marked/README.md +115 -0
- package/packages/pi-tui/node_modules/marked/bin/main.js +284 -0
- package/packages/pi-tui/node_modules/marked/bin/marked.js +16 -0
- package/packages/pi-tui/node_modules/marked/lib/marked.d.ts +760 -0
- package/packages/pi-tui/node_modules/marked/lib/marked.esm.js +77 -0
- package/packages/pi-tui/node_modules/marked/lib/marked.esm.js.map +7 -0
- package/packages/pi-tui/node_modules/marked/lib/marked.umd.js +79 -0
- package/packages/pi-tui/node_modules/marked/lib/marked.umd.js.map +7 -0
- package/packages/pi-tui/node_modules/marked/man/marked.1 +113 -0
- package/packages/pi-tui/node_modules/marked/man/marked.1.md +93 -0
- package/packages/pi-tui/node_modules/marked/package.json +103 -0
- package/dist/tui-ink/app.d.ts +0 -76
- package/dist/tui-ink/app.js +0 -2377
- package/dist/tui-ink/approval/approval-dialog.d.ts +0 -13
- package/dist/tui-ink/approval/approval-dialog.js +0 -184
- package/dist/tui-ink/approval/diff-view.d.ts +0 -7
- package/dist/tui-ink/approval/diff-view.js +0 -44
- package/dist/tui-ink/approval/select.d.ts +0 -35
- package/dist/tui-ink/approval/select.js +0 -98
- package/dist/tui-ink/code-highlight.d.ts +0 -8
- package/dist/tui-ink/code-highlight.js +0 -121
- package/dist/tui-ink/command-palette.d.ts +0 -32
- package/dist/tui-ink/command-palette.js +0 -158
- package/dist/tui-ink/compaction-progress.d.ts +0 -19
- package/dist/tui-ink/compaction-progress.js +0 -74
- package/dist/tui-ink/detect-theme.d.ts +0 -1
- package/dist/tui-ink/detect-theme.js +0 -1
- package/dist/tui-ink/feedback-dialog.d.ts +0 -19
- package/dist/tui-ink/feedback-dialog.js +0 -133
- package/dist/tui-ink/feishu-setup-picker.d.ts +0 -5
- package/dist/tui-ink/feishu-setup-picker.js +0 -271
- package/dist/tui-ink/footer.d.ts +0 -26
- package/dist/tui-ink/footer.js +0 -51
- package/dist/tui-ink/input-box.d.ts +0 -189
- package/dist/tui-ink/input-box.js +0 -1279
- package/dist/tui-ink/input-history.d.ts +0 -1
- package/dist/tui-ink/input-history.js +0 -1
- package/dist/tui-ink/markdown.d.ts +0 -103
- package/dist/tui-ink/markdown.js +0 -747
- package/dist/tui-ink/message-list.d.ts +0 -49
- package/dist/tui-ink/message-list.js +0 -841
- package/dist/tui-ink/model-picker.d.ts +0 -143
- package/dist/tui-ink/model-picker.js +0 -966
- package/dist/tui-ink/plan-confirm.d.ts +0 -7
- package/dist/tui-ink/plan-confirm.js +0 -115
- package/dist/tui-ink/question-dialog.d.ts +0 -8
- package/dist/tui-ink/question-dialog.js +0 -135
- package/dist/tui-ink/rewind-picker.d.ts +0 -8
- package/dist/tui-ink/rewind-picker.js +0 -102
- package/dist/tui-ink/run-session-picker.js +0 -22
- package/dist/tui-ink/run.d.ts +0 -62
- package/dist/tui-ink/run.js +0 -103
- package/dist/tui-ink/session-picker.d.ts +0 -10
- package/dist/tui-ink/session-picker.js +0 -113
- package/dist/tui-ink/stats-panel.d.ts +0 -11
- package/dist/tui-ink/stats-panel.js +0 -65
- package/dist/tui-ink/subagent-inspector.d.ts +0 -21
- package/dist/tui-ink/subagent-inspector.js +0 -205
- package/dist/tui-ink/use-terminal-size.d.ts +0 -4
- package/dist/tui-ink/use-terminal-size.js +0 -48
- package/dist/tui-ink/waiting-indicator.d.ts +0 -12
- package/dist/tui-ink/waiting-indicator.js +0 -129
- package/dist/tui-ink/welcome.d.ts +0 -25
- package/dist/tui-ink/welcome.js +0 -88
- package/dist/tui-ink/wordmark.d.ts +0 -8
- package/dist/tui-ink/wordmark.js +0 -103
- /package/dist/{tui-ink → tui/model}/composer-buffer.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/display-history.js +0 -0
- /package/dist/{tui-ink → tui/model}/input-queue.js +0 -0
- /package/dist/{tui-ink → tui/model}/key-events.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/key-events.js +0 -0
- /package/dist/{tui-ink → tui/model}/paste-operation-tracker.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/paste-operation-tracker.js +0 -0
- /package/dist/{tui-ink → tui/model}/recent-activity.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/submit-dedupe.js +0 -0
- /package/dist/{tui-ink → tui/model}/sync-output.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/sync-output.js +0 -0
- /package/dist/{tui-ink → tui/model}/terminal-env.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/terminal-env.js +0 -0
- /package/dist/{tui-ink → tui/model}/terminal-mouse.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/terminal-mouse.js +0 -0
- /package/dist/{tui-ink → tui/model}/width.d.ts +0 -0
- /package/dist/{tui-ink → tui/model}/width.js +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ApprovalDecision, ApprovalRequest } from "../../approval/types.js";
|
|
2
|
-
interface ApprovalDialogProps {
|
|
3
|
-
request: ApprovalRequest;
|
|
4
|
-
onDecision: (decision: ApprovalDecision) => void;
|
|
5
|
-
/**
|
|
6
|
-
* Selecting "Yes, and don't ask again for <prefix>" calls this with the
|
|
7
|
-
* (possibly user-edited) prefix so the harness can register it in the
|
|
8
|
-
* session-scoped bash allowlist.
|
|
9
|
-
*/
|
|
10
|
-
onAllowBashPrefix?: (prefix: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function ApprovalDialog({ request, onDecision, onAllowBashPrefix, }: ApprovalDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { useTheme } from "../theme.js";
|
|
4
|
-
import { ApprovalSelect } from "./select.js";
|
|
5
|
-
import { DiffView } from "./diff-view.js";
|
|
6
|
-
import { inferBashPrefix } from "../../approval/session-cache.js";
|
|
7
|
-
import { classifyBashDanger } from "../../approval/danger.js";
|
|
8
|
-
export function ApprovalDialog({ request, onDecision, onAllowBashPrefix, }) {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
const options = buildOptions(request);
|
|
11
|
-
const onSubmit = (id, extras) => {
|
|
12
|
-
switch (id) {
|
|
13
|
-
case "yes":
|
|
14
|
-
onDecision({ action: "approve", feedback: extras.feedback });
|
|
15
|
-
return;
|
|
16
|
-
case "yes-bash-prefix": {
|
|
17
|
-
const prefix = (extras.editedValue ?? "").trim();
|
|
18
|
-
if (prefix)
|
|
19
|
-
onAllowBashPrefix?.(prefix);
|
|
20
|
-
onDecision({ action: "approve" });
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
case "no":
|
|
24
|
-
default:
|
|
25
|
-
onDecision({ action: "reject", feedback: extras.feedback });
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const onCancel = () => onDecision({ action: "reject" });
|
|
30
|
-
const title = dialogTitle(request);
|
|
31
|
-
const question = dialogQuestion(request);
|
|
32
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginY: 1, children: [_jsx(Text, { color: theme.accent, bold: true, children: title }), (request.type === "edit" || request.type === "write") && request.outsideWorkspace && (_jsx(Text, { color: theme.warning, bold: true, children: "\u26A0 This path is outside the workspace" })), _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(RequestPreview, { request: request }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: question }) }), _jsx(Box, { marginTop: 1, children: _jsx(ApprovalSelect, { options: options, onSubmit: onSubmit, onCancel: onCancel, hint: "\u2191\u2193 choose \u00B7 Enter select \u00B7 Tab add feedback \u00B7 Esc reject" }) })] }));
|
|
33
|
-
}
|
|
34
|
-
function buildOptions(request) {
|
|
35
|
-
if (request.type === "bash") {
|
|
36
|
-
const prefix = inferBashPrefix(request.command);
|
|
37
|
-
return [
|
|
38
|
-
{ id: "yes", label: "Yes", allowAmend: true, amendPlaceholder: "and tell Claude what to do next" },
|
|
39
|
-
{
|
|
40
|
-
id: "yes-bash-prefix",
|
|
41
|
-
label: "Yes, and don't ask again for",
|
|
42
|
-
editableValue: {
|
|
43
|
-
initial: prefix,
|
|
44
|
-
placeholder: "command prefix (e.g. npm run:*)",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "no",
|
|
49
|
-
label: "No",
|
|
50
|
-
description: "(tab to add feedback)",
|
|
51
|
-
allowAmend: true,
|
|
52
|
-
amendPlaceholder: "and tell Claude what to do differently",
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
}
|
|
56
|
-
// edit / write / patch
|
|
57
|
-
return [
|
|
58
|
-
{ id: "yes", label: "Yes", allowAmend: true, amendPlaceholder: "and tell Claude what to do next" },
|
|
59
|
-
{
|
|
60
|
-
id: "no",
|
|
61
|
-
label: "No",
|
|
62
|
-
description: "(tab to add feedback)",
|
|
63
|
-
allowAmend: true,
|
|
64
|
-
amendPlaceholder: "and tell Claude what to do differently",
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
function dialogTitle(req) {
|
|
69
|
-
switch (req.type) {
|
|
70
|
-
case "edit":
|
|
71
|
-
return "Edit file";
|
|
72
|
-
case "patch":
|
|
73
|
-
return "Apply patch";
|
|
74
|
-
case "write":
|
|
75
|
-
return req.fileExists ? "Overwrite file" : "Create file";
|
|
76
|
-
case "bash":
|
|
77
|
-
return "Bash command";
|
|
78
|
-
case "lsp":
|
|
79
|
-
return "Language server operation";
|
|
80
|
-
case "agent_profile":
|
|
81
|
-
return "Project agent profile";
|
|
82
|
-
case "external_tool":
|
|
83
|
-
return "External tool permission";
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function dialogQuestion(req) {
|
|
87
|
-
switch (req.type) {
|
|
88
|
-
case "edit":
|
|
89
|
-
return `Do you want to make this edit to ${basename(req.path)}?`;
|
|
90
|
-
case "patch":
|
|
91
|
-
return `Do you want to apply this patch to ${req.paths.length} file${req.paths.length === 1 ? "" : "s"}?`;
|
|
92
|
-
case "write":
|
|
93
|
-
return `Do you want to ${req.fileExists ? "overwrite" : "create"} ${basename(req.path)}?`;
|
|
94
|
-
case "bash":
|
|
95
|
-
return "Do you want to proceed?";
|
|
96
|
-
case "lsp":
|
|
97
|
-
return `Do you want to run ${req.operation} on ${basename(req.path)}?`;
|
|
98
|
-
case "agent_profile":
|
|
99
|
-
return `Trust the repository profile "${req.name}" to drive a subagent? It is remembered for this session until the file changes.`;
|
|
100
|
-
case "external_tool":
|
|
101
|
-
return `Do you want to allow ${req.title || req.kind || "this external tool"}?`;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function basename(p) {
|
|
105
|
-
const idx = p.lastIndexOf("/");
|
|
106
|
-
return idx >= 0 ? p.slice(idx + 1) : p;
|
|
107
|
-
}
|
|
108
|
-
function RequestPreview({ request }) {
|
|
109
|
-
switch (request.type) {
|
|
110
|
-
case "bash":
|
|
111
|
-
return _jsx(BashPreview, { command: request.command, cwd: request.cwd, background: request.background });
|
|
112
|
-
case "edit":
|
|
113
|
-
return _jsx(DiffView, { diff: request.diff });
|
|
114
|
-
case "patch":
|
|
115
|
-
return _jsx(DiffView, { diff: request.diff });
|
|
116
|
-
case "write":
|
|
117
|
-
return _jsx(WritePreview, { path: request.path, content: request.content });
|
|
118
|
-
case "agent_profile":
|
|
119
|
-
return _jsx(AgentProfilePreview, { path: request.path, promptPreview: request.promptPreview });
|
|
120
|
-
case "external_tool":
|
|
121
|
-
return _jsx(ExternalToolPreview, { request: request });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
const MAX_EXTERNAL_INPUT_CHARS = 1_200;
|
|
125
|
-
function ExternalToolPreview({ request, }) {
|
|
126
|
-
const theme = useTheme();
|
|
127
|
-
const input = formatExternalInput(request.rawInput);
|
|
128
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: request.title || "Untitled external tool" }), _jsxs(Text, { color: theme.muted, children: ["kind: ", request.kind || "other"] }), request.locations?.map((location, index) => (_jsxs(Text, { color: theme.muted, children: [compressHome(location.path), location.line == null ? "" : `:${location.line}`] }, `${location.path}:${location.line ?? ""}:${index}`))), input !== undefined && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: theme.muted, children: "Input" }), _jsx(Text, { children: input })] }))] }));
|
|
129
|
-
}
|
|
130
|
-
function formatExternalInput(rawInput) {
|
|
131
|
-
if (rawInput === undefined)
|
|
132
|
-
return undefined;
|
|
133
|
-
let json;
|
|
134
|
-
try {
|
|
135
|
-
const seen = new WeakSet();
|
|
136
|
-
json = JSON.stringify(rawInput, (_key, value) => {
|
|
137
|
-
if (typeof value === "bigint")
|
|
138
|
-
return value.toString();
|
|
139
|
-
if (typeof value === "object" && value !== null) {
|
|
140
|
-
if (seen.has(value))
|
|
141
|
-
return "[Circular]";
|
|
142
|
-
seen.add(value);
|
|
143
|
-
}
|
|
144
|
-
return value;
|
|
145
|
-
}, 2) ?? String(rawInput);
|
|
146
|
-
}
|
|
147
|
-
catch {
|
|
148
|
-
json = String(rawInput);
|
|
149
|
-
}
|
|
150
|
-
if (json.length <= MAX_EXTERNAL_INPUT_CHARS)
|
|
151
|
-
return json;
|
|
152
|
-
return `${json.slice(0, MAX_EXTERNAL_INPUT_CHARS)}\n… (truncated)`;
|
|
153
|
-
}
|
|
154
|
-
function AgentProfilePreview({ path, promptPreview }) {
|
|
155
|
-
const theme = useTheme();
|
|
156
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: theme.muted, children: compressHome(path) }), _jsx(Text, { children: promptPreview }), _jsx(Text, { color: theme.warning, children: "This prompt comes from the repository's .bubble/agents and will drive a subagent." })] }));
|
|
157
|
-
}
|
|
158
|
-
function BashPreview({ command, cwd, background }) {
|
|
159
|
-
const theme = useTheme();
|
|
160
|
-
const danger = classifyBashDanger(command);
|
|
161
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: theme.muted, children: "$ " }), _jsx(Text, { children: command })] }), _jsxs(Text, { color: theme.muted, children: ["cwd: ", compressHome(cwd)] }), background && (_jsx(Text, { color: theme.warning, children: "runs in background \u2014 keeps running after this turn ends" })), danger && (_jsxs(Box, { marginTop: 1, children: [_jsxs(Text, { color: theme.warning, bold: true, children: ["\u26A0 ", danger.pattern, ":"] }), _jsxs(Text, { color: theme.warning, children: [" ", danger.message] })] }))] }));
|
|
162
|
-
}
|
|
163
|
-
const MAX_WRITE_PREVIEW_LINES = 20;
|
|
164
|
-
function WritePreview({ path, content }) {
|
|
165
|
-
const theme = useTheme();
|
|
166
|
-
const lines = content.split("\n");
|
|
167
|
-
const shown = lines.slice(0, MAX_WRITE_PREVIEW_LINES);
|
|
168
|
-
const overflow = lines.length - shown.length;
|
|
169
|
-
const totalBytes = Buffer.byteLength(content, "utf-8");
|
|
170
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: theme.muted, children: compressHome(path) }), _jsxs(Text, { color: theme.muted, children: [" \u00B7 ", lines.length, " line", lines.length === 1 ? "" : "s", " \u00B7 ", formatBytes(totalBytes)] })] }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [shown.map((line, i) => (_jsxs(Text, { color: theme.diffAddFg, children: ["+ ", line || " "] }, i))), overflow > 0 && (_jsxs(Text, { color: theme.muted, children: ["\u2026 ", overflow, " more line", overflow === 1 ? "" : "s"] }))] })] }));
|
|
171
|
-
}
|
|
172
|
-
function formatBytes(n) {
|
|
173
|
-
if (n < 1024)
|
|
174
|
-
return `${n}B`;
|
|
175
|
-
if (n < 1024 * 1024)
|
|
176
|
-
return `${(n / 1024).toFixed(1)}KB`;
|
|
177
|
-
return `${(n / (1024 * 1024)).toFixed(1)}MB`;
|
|
178
|
-
}
|
|
179
|
-
function compressHome(p) {
|
|
180
|
-
const home = process.env.HOME || "";
|
|
181
|
-
if (home && p.startsWith(home))
|
|
182
|
-
return `~${p.slice(home.length)}`;
|
|
183
|
-
return p;
|
|
184
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface DiffViewProps {
|
|
2
|
-
diff: string;
|
|
3
|
-
/** Hard cap on total rendered lines across all hunks. Excess is truncated. */
|
|
4
|
-
maxLines?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function DiffView({ diff, maxLines }: DiffViewProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { useTheme } from "../theme.js";
|
|
4
|
-
import { parseDiffHunks } from "../../approval/diff-hunks.js";
|
|
5
|
-
const DEFAULT_MAX_LINES = 40;
|
|
6
|
-
export function DiffView({ diff, maxLines = DEFAULT_MAX_LINES }) {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
const hunks = parseDiffHunks(diff);
|
|
9
|
-
if (hunks.length === 0) {
|
|
10
|
-
return (_jsx(Text, { color: theme.muted, children: "(no diff body to display)" }));
|
|
11
|
-
}
|
|
12
|
-
// Distribute the line budget across hunks. Simple approach: render hunks in
|
|
13
|
-
// order until the budget is exhausted; if a hunk overflows, keep its header,
|
|
14
|
-
// show as many body lines as fit, then emit a "… N more" marker.
|
|
15
|
-
let remaining = maxLines;
|
|
16
|
-
const rendered = [];
|
|
17
|
-
let trailingSkipped = 0;
|
|
18
|
-
for (let i = 0; i < hunks.length; i++) {
|
|
19
|
-
const hunk = hunks[i];
|
|
20
|
-
if (remaining <= 1) {
|
|
21
|
-
trailingSkipped += hunk.lines.length + 1;
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
remaining -= 1; // header line
|
|
25
|
-
const available = Math.max(0, remaining);
|
|
26
|
-
if (hunk.lines.length <= available) {
|
|
27
|
-
rendered.push({ hunk, shown: hunk.lines, truncatedBy: 0 });
|
|
28
|
-
remaining -= hunk.lines.length;
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
const shown = hunk.lines.slice(0, available);
|
|
32
|
-
rendered.push({ hunk, shown, truncatedBy: hunk.lines.length - available });
|
|
33
|
-
remaining = 0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return (_jsxs(Box, { flexDirection: "column", children: [rendered.map(({ hunk, shown, truncatedBy }, i) => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: theme.accent, children: hunk.header }), shown.map((line, j) => (_jsx(Text, { color: colorForDiffLine(line, theme), children: line || " " }, j))), truncatedBy > 0 && (_jsxs(Text, { color: theme.muted, children: ["\u2026 ", truncatedBy, " more line", truncatedBy === 1 ? "" : "s", " in this hunk"] }))] }, i))), trailingSkipped > 0 && (_jsxs(Text, { color: theme.muted, children: ["\u2026 ", trailingSkipped, " more line", trailingSkipped === 1 ? "" : "s", " across later hunks"] }))] }));
|
|
37
|
-
}
|
|
38
|
-
function colorForDiffLine(line, theme) {
|
|
39
|
-
if (line.startsWith("+"))
|
|
40
|
-
return theme.diffAddFg;
|
|
41
|
-
if (line.startsWith("-"))
|
|
42
|
-
return theme.diffRemoveFg;
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export interface ApprovalOption {
|
|
2
|
-
/** Stable identifier returned to the parent. */
|
|
3
|
-
id: string;
|
|
4
|
-
/** Primary label shown in the menu. */
|
|
5
|
-
label: string;
|
|
6
|
-
/** Dim description appended after the label. */
|
|
7
|
-
description?: string;
|
|
8
|
-
/** If true, Tab on this option turns it into a feedback input. */
|
|
9
|
-
allowAmend?: boolean;
|
|
10
|
-
/** Placeholder shown in the amend input. */
|
|
11
|
-
amendPlaceholder?: string;
|
|
12
|
-
/**
|
|
13
|
-
* If set, this option has an inline-editable data value (rendered right
|
|
14
|
-
* after `label`). When the option is focused, typing modifies the value;
|
|
15
|
-
* backspace removes the last character. Use-case: "Yes, and don't ask
|
|
16
|
-
* again for `<prefix>`" — the prefix is editable before submit.
|
|
17
|
-
*/
|
|
18
|
-
editableValue?: {
|
|
19
|
-
initial: string;
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export type ApprovalSubmit = (optionId: string, extras: {
|
|
24
|
-
feedback?: string;
|
|
25
|
-
editedValue?: string;
|
|
26
|
-
}) => void;
|
|
27
|
-
interface ApprovalSelectProps {
|
|
28
|
-
options: ApprovalOption[];
|
|
29
|
-
onSubmit: ApprovalSubmit;
|
|
30
|
-
onCancel: () => void;
|
|
31
|
-
hint?: string;
|
|
32
|
-
initialIndex?: number;
|
|
33
|
-
}
|
|
34
|
-
export declare function ApprovalSelect({ options, onSubmit, onCancel, hint, initialIndex, }: ApprovalSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export {};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Box, Text, useInput } from "ink";
|
|
4
|
-
import { isKeyReleaseEvent } from "../key-events.js";
|
|
5
|
-
import { useTheme } from "../theme.js";
|
|
6
|
-
import { stripTerminalMouseSequences } from "../terminal-mouse.js";
|
|
7
|
-
export function ApprovalSelect({ options, onSubmit, onCancel, hint, initialIndex = 0, }) {
|
|
8
|
-
const theme = useTheme();
|
|
9
|
-
const [focusIndex, setFocusIndex] = useState(Math.max(0, Math.min(initialIndex, options.length - 1)));
|
|
10
|
-
const [amending, setAmending] = useState(false);
|
|
11
|
-
const [amendText, setAmendText] = useState("");
|
|
12
|
-
// Map of option.id → current edited value. Populated lazily so navigating
|
|
13
|
-
// away and back preserves edits.
|
|
14
|
-
const [editedValues, setEditedValues] = useState(() => {
|
|
15
|
-
const seed = {};
|
|
16
|
-
for (const opt of options) {
|
|
17
|
-
if (opt.editableValue)
|
|
18
|
-
seed[opt.id] = opt.editableValue.initial;
|
|
19
|
-
}
|
|
20
|
-
return seed;
|
|
21
|
-
});
|
|
22
|
-
const focused = options[focusIndex];
|
|
23
|
-
const canAmend = !!focused?.allowAmend;
|
|
24
|
-
const hasEditableValue = !!focused?.editableValue;
|
|
25
|
-
const currentValue = focused?.editableValue ? editedValues[focused.id] ?? "" : "";
|
|
26
|
-
useInput((input, key) => {
|
|
27
|
-
if (isKeyReleaseEvent(key))
|
|
28
|
-
return;
|
|
29
|
-
const strippedMouseInput = stripTerminalMouseSequences(input);
|
|
30
|
-
if (strippedMouseInput !== input) {
|
|
31
|
-
if (!strippedMouseInput)
|
|
32
|
-
return;
|
|
33
|
-
input = strippedMouseInput;
|
|
34
|
-
}
|
|
35
|
-
if (amending) {
|
|
36
|
-
if (key.escape) {
|
|
37
|
-
setAmending(false);
|
|
38
|
-
setAmendText("");
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (key.return) {
|
|
42
|
-
const editedValue = focused.editableValue ? currentValue : undefined;
|
|
43
|
-
onSubmit(focused.id, { feedback: amendText.trim() || undefined, editedValue });
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (key.backspace || key.delete) {
|
|
47
|
-
setAmendText((prev) => prev.slice(0, -1));
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (input) {
|
|
51
|
-
setAmendText((prev) => prev + input);
|
|
52
|
-
}
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (key.escape) {
|
|
56
|
-
onCancel();
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
// Vertical nav always works regardless of editable value, so the user can
|
|
60
|
-
// still move off an option they don't want.
|
|
61
|
-
if (key.upArrow) {
|
|
62
|
-
setFocusIndex((i) => (i - 1 + options.length) % options.length);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (key.downArrow) {
|
|
66
|
-
setFocusIndex((i) => (i + 1) % options.length);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (key.return) {
|
|
70
|
-
const editedValue = focused.editableValue ? currentValue : undefined;
|
|
71
|
-
onSubmit(focused.id, { editedValue });
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (key.tab && canAmend) {
|
|
75
|
-
setAmending(true);
|
|
76
|
-
setAmendText("");
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
// When the focused option has an editable value, plain keypresses mutate it.
|
|
80
|
-
if (hasEditableValue) {
|
|
81
|
-
if (key.backspace || key.delete) {
|
|
82
|
-
setEditedValues((prev) => ({ ...prev, [focused.id]: (prev[focused.id] ?? "").slice(0, -1) }));
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (input && !key.ctrl && !key.meta) {
|
|
86
|
-
setEditedValues((prev) => ({ ...prev, [focused.id]: (prev[focused.id] ?? "") + input }));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
return (_jsxs(Box, { flexDirection: "column", children: [options.map((option, idx) => {
|
|
91
|
-
const isFocused = idx === focusIndex;
|
|
92
|
-
const value = option.editableValue ? editedValues[option.id] ?? "" : undefined;
|
|
93
|
-
if (isFocused && amending) {
|
|
94
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: theme.accent, children: "› " }), _jsxs(Text, { bold: true, children: [option.label, ":"] }), _jsx(Text, { children: " " }), _jsx(Text, { color: amendText ? undefined : theme.muted, children: amendText || option.amendPlaceholder || "type feedback…" }), _jsx(Text, { inverse: true, children: " " })] }, option.id));
|
|
95
|
-
}
|
|
96
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: isFocused ? theme.accent : theme.muted, children: isFocused ? "› " : " " }), _jsx(Text, { bold: isFocused, color: isFocused ? undefined : theme.muted, children: option.label }), option.editableValue && (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.muted, children: " " }), _jsx(Text, { color: isFocused ? theme.accent : theme.muted, children: "[" }), _jsx(Text, { color: isFocused ? undefined : theme.muted, children: value || option.editableValue.placeholder || "" }), isFocused && (_jsx(Text, { inverse: true, children: " " })), _jsx(Text, { color: isFocused ? theme.accent : theme.muted, children: "]" })] })), option.description && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: theme.muted, children: option.description })] }))] }, option.id));
|
|
97
|
-
}), hint && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.muted, children: hint }) }))] }));
|
|
98
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lightweight code highlighting for TUI using Shiki.
|
|
3
|
-
* Converts token colors to ANSI escape codes for Ink rendering.
|
|
4
|
-
*/
|
|
5
|
-
export declare function warmHighlighter(): void;
|
|
6
|
-
export declare function highlightCode(code: string, lang: string): Promise<string>;
|
|
7
|
-
export declare function highlightCodeSync(code: string, lang: string): string | null;
|
|
8
|
-
export declare function inferLang(path?: string): string;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lightweight code highlighting for TUI using Shiki.
|
|
3
|
-
* Converts token colors to ANSI escape codes for Ink rendering.
|
|
4
|
-
*/
|
|
5
|
-
import { createHighlighter } from "shiki";
|
|
6
|
-
let highlighterPromise = null;
|
|
7
|
-
let highlighterReady = null;
|
|
8
|
-
function getHighlighter() {
|
|
9
|
-
if (!highlighterPromise) {
|
|
10
|
-
highlighterPromise = createHighlighter({
|
|
11
|
-
themes: ["github-dark"],
|
|
12
|
-
langs: [
|
|
13
|
-
"bash",
|
|
14
|
-
"css",
|
|
15
|
-
"diff",
|
|
16
|
-
"dockerfile",
|
|
17
|
-
"go",
|
|
18
|
-
"html",
|
|
19
|
-
"ini",
|
|
20
|
-
"javascript",
|
|
21
|
-
"json",
|
|
22
|
-
"jsx",
|
|
23
|
-
"markdown",
|
|
24
|
-
"python",
|
|
25
|
-
"rust",
|
|
26
|
-
"shell",
|
|
27
|
-
"sql",
|
|
28
|
-
"typescript",
|
|
29
|
-
"tsx",
|
|
30
|
-
"yaml",
|
|
31
|
-
],
|
|
32
|
-
}).then((h) => {
|
|
33
|
-
highlighterReady = h;
|
|
34
|
-
return h;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return highlighterPromise;
|
|
38
|
-
}
|
|
39
|
-
// Fire-and-forget warmup so synchronous callers can use highlightCodeSync once
|
|
40
|
-
// shiki has finished loading. Safe to call multiple times.
|
|
41
|
-
export function warmHighlighter() {
|
|
42
|
-
getHighlighter().catch(() => { });
|
|
43
|
-
}
|
|
44
|
-
function hexToAnsiFg(hex) {
|
|
45
|
-
if (!hex)
|
|
46
|
-
return "";
|
|
47
|
-
const r = parseInt(hex.slice(1, 3), 16);
|
|
48
|
-
const g = parseInt(hex.slice(3, 5), 16);
|
|
49
|
-
const b = parseInt(hex.slice(5, 7), 16);
|
|
50
|
-
return `\x1b[38;2;${r};${g};${b}m`;
|
|
51
|
-
}
|
|
52
|
-
function tokensToAnsi(tokens) {
|
|
53
|
-
const lines = [];
|
|
54
|
-
for (const line of tokens) {
|
|
55
|
-
let lineStr = "";
|
|
56
|
-
for (const token of line) {
|
|
57
|
-
lineStr += hexToAnsiFg(token.color) + token.content;
|
|
58
|
-
}
|
|
59
|
-
lineStr += "\x1b[0m";
|
|
60
|
-
lines.push(lineStr);
|
|
61
|
-
}
|
|
62
|
-
return lines.join("\n");
|
|
63
|
-
}
|
|
64
|
-
function runHighlight(h, code, lang) {
|
|
65
|
-
const loaded = h.getLoadedLanguages();
|
|
66
|
-
const safeLang = loaded.includes(lang) ? lang : "text";
|
|
67
|
-
const { tokens } = h.codeToTokens(code, { lang: safeLang, theme: "github-dark" });
|
|
68
|
-
return tokensToAnsi(tokens);
|
|
69
|
-
}
|
|
70
|
-
export async function highlightCode(code, lang) {
|
|
71
|
-
const h = await getHighlighter();
|
|
72
|
-
return runHighlight(h, code, lang);
|
|
73
|
-
}
|
|
74
|
-
// Synchronous variant that returns null when shiki hasn't finished loading yet,
|
|
75
|
-
// so the first transcript frame can already carry highlighted output when warm.
|
|
76
|
-
export function highlightCodeSync(code, lang) {
|
|
77
|
-
if (!highlighterReady) {
|
|
78
|
-
// Ensure warmup is in flight for future renders.
|
|
79
|
-
warmHighlighter();
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
return runHighlight(highlighterReady, code, lang);
|
|
84
|
-
}
|
|
85
|
-
catch {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
const LANG_MAP = {
|
|
90
|
-
bash: "bash",
|
|
91
|
-
css: "css",
|
|
92
|
-
diff: "diff",
|
|
93
|
-
dockerfile: "dockerfile",
|
|
94
|
-
go: "go",
|
|
95
|
-
html: "html",
|
|
96
|
-
htm: "html",
|
|
97
|
-
ini: "ini",
|
|
98
|
-
cfg: "ini",
|
|
99
|
-
toml: "ini",
|
|
100
|
-
js: "javascript",
|
|
101
|
-
json: "json",
|
|
102
|
-
jsx: "jsx",
|
|
103
|
-
md: "markdown",
|
|
104
|
-
mdx: "markdown",
|
|
105
|
-
py: "python",
|
|
106
|
-
rs: "rust",
|
|
107
|
-
sh: "bash",
|
|
108
|
-
shell: "shell",
|
|
109
|
-
sql: "sql",
|
|
110
|
-
ts: "typescript",
|
|
111
|
-
tsx: "tsx",
|
|
112
|
-
yaml: "yaml",
|
|
113
|
-
yml: "yaml",
|
|
114
|
-
zsh: "bash",
|
|
115
|
-
};
|
|
116
|
-
export function inferLang(path) {
|
|
117
|
-
if (!path)
|
|
118
|
-
return "text";
|
|
119
|
-
const ext = path.split(".").pop()?.toLowerCase();
|
|
120
|
-
return (ext && LANG_MAP[ext]) || "text";
|
|
121
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SkillRegistry } from "../skills/registry.js";
|
|
2
|
-
import type { McpManager } from "../mcp/manager.js";
|
|
3
|
-
export interface PaletteItem {
|
|
4
|
-
label: string;
|
|
5
|
-
detail: string;
|
|
6
|
-
value: string;
|
|
7
|
-
command: string;
|
|
8
|
-
action?: "insert-skill";
|
|
9
|
-
}
|
|
10
|
-
export declare function buildCommandPaletteItems(skillRegistry: SkillRegistry, grokSessionBound?: boolean): PaletteItem[];
|
|
11
|
-
export declare function buildMcpReconnectItems(mcpManager?: McpManager): PaletteItem[];
|
|
12
|
-
export declare function CommandPalette({ items, terminalColumns, terminalRows, onSelect, onCancel, }: {
|
|
13
|
-
items: PaletteItem[];
|
|
14
|
-
terminalColumns: number;
|
|
15
|
-
terminalRows: number;
|
|
16
|
-
onSelect: (item: PaletteItem) => void;
|
|
17
|
-
onCancel: () => void;
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare function McpReconnectPicker({ items, terminalColumns, terminalRows, onSelect, onCancel, }: {
|
|
20
|
-
items: PaletteItem[];
|
|
21
|
-
terminalColumns: number;
|
|
22
|
-
terminalRows: number;
|
|
23
|
-
onSelect: (item: PaletteItem) => void;
|
|
24
|
-
onCancel: () => void;
|
|
25
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare const INK_LOCAL_SLASH_COMMANDS: readonly [{
|
|
27
|
-
readonly name: "goal";
|
|
28
|
-
readonly description: "Set/manage an autonomous goal (/goal <objective>|clear|pause|resume|edit)";
|
|
29
|
-
}, {
|
|
30
|
-
readonly name: "loop";
|
|
31
|
-
readonly description: "Run a prompt on a recurring interval (/loop 5m <prompt>|list|stop [id])";
|
|
32
|
-
}];
|