@bubblebrain-ai/bubble 0.0.52 → 0.0.54
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/dist/update/index.d.ts +1 -0
- package/dist/update/index.js +22 -17
- 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/node_modules/marked/LICENSE +44 -0
- package/node_modules/marked/README.md +115 -0
- package/node_modules/marked/bin/main.js +284 -0
- package/node_modules/marked/bin/marked.js +16 -0
- package/node_modules/marked/lib/marked.d.ts +760 -0
- package/node_modules/marked/lib/marked.esm.js +77 -0
- package/node_modules/marked/lib/marked.esm.js.map +7 -0
- package/node_modules/marked/lib/marked.umd.js +79 -0
- package/node_modules/marked/lib/marked.umd.js.map +7 -0
- package/node_modules/marked/man/marked.1 +113 -0
- package/node_modules/marked/man/marked.1.md +93 -0
- package/node_modules/marked/package.json +103 -0
- package/package.json +25 -10
- 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,158 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Slash-command and MCP-server picker overlays, the local /goal & /loop
|
|
4
|
-
* command table, and the shared PalettePicker list UI they render through.
|
|
5
|
-
*/
|
|
6
|
-
import { useEffect, useMemo, useState } from "react";
|
|
7
|
-
import { Box, Text, useInput } from "ink";
|
|
8
|
-
import { registry as slashRegistry } from "../slash-commands/index.js";
|
|
9
|
-
import { isGrokLocalSlashCommand } from "../external-runtime/grok-input-policy.js";
|
|
10
|
-
import { useTheme } from "./theme.js";
|
|
11
|
-
import { isPrintablePickerInput } from "./model-picker.js";
|
|
12
|
-
import { isKeyReleaseEvent } from "./key-events.js";
|
|
13
|
-
import { clampWindowStartForIndex, truncate } from "./app-helpers.js";
|
|
14
|
-
export function buildCommandPaletteItems(skillRegistry, grokSessionBound = false) {
|
|
15
|
-
const items = new Map();
|
|
16
|
-
const add = (item) => {
|
|
17
|
-
const key = `${item.action ?? "command"}:${item.value}`;
|
|
18
|
-
if (!items.has(key))
|
|
19
|
-
items.set(key, item);
|
|
20
|
-
};
|
|
21
|
-
if (!grokSessionBound) {
|
|
22
|
-
for (const command of INK_LOCAL_SLASH_COMMANDS) {
|
|
23
|
-
add({
|
|
24
|
-
label: `/${command.name}`,
|
|
25
|
-
detail: command.description,
|
|
26
|
-
value: command.name,
|
|
27
|
-
command: `/${command.name}`,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
for (const command of slashRegistry.list()) {
|
|
32
|
-
if (grokSessionBound && !isGrokLocalSlashCommand(command.name))
|
|
33
|
-
continue;
|
|
34
|
-
const source = command.source === "mcp" ? " :mcp" : "";
|
|
35
|
-
const sourceLabel = command.sourceLabel ? `[${command.sourceLabel}] ` : "";
|
|
36
|
-
add({
|
|
37
|
-
label: `/${command.name}${source}`,
|
|
38
|
-
detail: `${sourceLabel}${command.description}`,
|
|
39
|
-
value: command.name,
|
|
40
|
-
command: `/${command.name}`,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
if (!grokSessionBound) {
|
|
44
|
-
for (const skill of skillRegistry.summaries()) {
|
|
45
|
-
add({
|
|
46
|
-
label: `/${skill.name} :skill`,
|
|
47
|
-
detail: `[${skill.source}] ${skill.description}`,
|
|
48
|
-
value: skill.name,
|
|
49
|
-
command: `/${skill.name}`,
|
|
50
|
-
action: "insert-skill",
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return [...items.values()];
|
|
55
|
-
}
|
|
56
|
-
export function buildMcpReconnectItems(mcpManager) {
|
|
57
|
-
return (mcpManager?.getStates() ?? []).map((state) => {
|
|
58
|
-
let detail;
|
|
59
|
-
if (state.status.kind === "connected") {
|
|
60
|
-
const tools = state.status.tools.length;
|
|
61
|
-
const prompts = state.status.prompts.length;
|
|
62
|
-
detail = `connected · ${tools} tool${tools === 1 ? "" : "s"} · ${prompts} prompt${prompts === 1 ? "" : "s"}`;
|
|
63
|
-
}
|
|
64
|
-
else if (state.status.kind === "failed") {
|
|
65
|
-
detail = `failed · ${state.status.error}`;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
detail = "disabled";
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
label: state.name,
|
|
72
|
-
detail,
|
|
73
|
-
value: state.name,
|
|
74
|
-
command: `/mcp reconnect ${state.name}`,
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
export function CommandPalette({ items, terminalColumns, terminalRows, onSelect, onCancel, }) {
|
|
79
|
-
return (_jsx(PalettePicker, { title: "Commands", hint: "Type to filter \u00B7 Up/Down choose \u00B7 Enter run \u00B7 Esc cancel", emptyText: "No commands found.", items: items, terminalColumns: terminalColumns, terminalRows: terminalRows, searchable: true, onSelect: onSelect, onCancel: onCancel }));
|
|
80
|
-
}
|
|
81
|
-
export function McpReconnectPicker({ items, terminalColumns, terminalRows, onSelect, onCancel, }) {
|
|
82
|
-
return (_jsx(PalettePicker, { title: "MCP servers", hint: "Up/Down choose \u00B7 Enter or r reconnect \u00B7 Esc cancel", emptyText: "No MCP servers configured.", items: items, terminalColumns: terminalColumns, terminalRows: terminalRows, reconnectAlias: true, onSelect: onSelect, onCancel: onCancel }));
|
|
83
|
-
}
|
|
84
|
-
function PalettePicker({ title, hint, emptyText, items, terminalColumns, terminalRows, searchable = false, reconnectAlias = false, onSelect, onCancel, }) {
|
|
85
|
-
const theme = useTheme();
|
|
86
|
-
const [query, setQuery] = useState("");
|
|
87
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
88
|
-
const maxVisible = Math.max(5, Math.min(12, terminalRows - 10));
|
|
89
|
-
const filtered = useMemo(() => {
|
|
90
|
-
const needle = query.trim().toLowerCase();
|
|
91
|
-
if (!needle)
|
|
92
|
-
return items;
|
|
93
|
-
return items.filter((item) => item.label.toLowerCase().includes(needle) ||
|
|
94
|
-
item.detail.toLowerCase().includes(needle) ||
|
|
95
|
-
item.value.toLowerCase().includes(needle));
|
|
96
|
-
}, [items, query]);
|
|
97
|
-
useEffect(() => {
|
|
98
|
-
setSelectedIndex((current) => Math.min(Math.max(0, filtered.length - 1), current));
|
|
99
|
-
}, [filtered.length]);
|
|
100
|
-
useInput((input, key) => {
|
|
101
|
-
if (isKeyReleaseEvent(key))
|
|
102
|
-
return;
|
|
103
|
-
if (key.escape) {
|
|
104
|
-
onCancel();
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (key.return || (reconnectAlias && input.toLowerCase() === "r")) {
|
|
108
|
-
const item = filtered[selectedIndex];
|
|
109
|
-
if (item)
|
|
110
|
-
onSelect(item);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (key.upArrow) {
|
|
114
|
-
setSelectedIndex((index) => Math.max(0, index - 1));
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (key.downArrow) {
|
|
118
|
-
setSelectedIndex((index) => Math.min(Math.max(0, filtered.length - 1), index + 1));
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (key.pageUp) {
|
|
122
|
-
setSelectedIndex((index) => Math.max(0, index - maxVisible));
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (key.pageDown) {
|
|
126
|
-
setSelectedIndex((index) => Math.min(Math.max(0, filtered.length - 1), index + maxVisible));
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (!searchable)
|
|
130
|
-
return;
|
|
131
|
-
if (key.backspace || key.delete) {
|
|
132
|
-
setQuery((current) => current.slice(0, -1));
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
if (isPrintablePickerInput(input) && !key.ctrl && !key.meta) {
|
|
136
|
-
setQuery((current) => current + input);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
const start = clampWindowStartForIndex(filtered.length, selectedIndex, maxVisible);
|
|
140
|
-
const visible = filtered.slice(start, start + maxVisible);
|
|
141
|
-
const labelWidth = Math.max(18, Math.min(36, Math.floor(terminalColumns * 0.32)));
|
|
142
|
-
const detailWidth = Math.max(20, terminalColumns - labelWidth - 10);
|
|
143
|
-
return (_jsxs(Box, { flexDirection: "column", marginY: 1, paddingX: 1, borderStyle: "round", borderColor: theme.borderActive, children: [_jsx(Text, { bold: true, color: theme.accent, children: title }), searchable && (_jsxs(Text, { color: theme.muted, children: ["Filter: ", _jsx(Text, { color: theme.userMessageText, children: query || " " })] })), _jsx(Text, { color: theme.muted, children: hint }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [filtered.length === 0 && _jsx(Text, { color: theme.muted, children: emptyText }), visible.map((item, offset) => {
|
|
144
|
-
const actualIndex = start + offset;
|
|
145
|
-
const selected = actualIndex === selectedIndex;
|
|
146
|
-
return (_jsxs(Box, { children: [_jsxs(Text, { color: selected ? theme.accent : undefined, children: [selected ? "> " : " ", truncate(item.label, labelWidth)] }), _jsxs(Text, { color: theme.muted, children: [" ", truncate(item.detail, detailWidth)] })] }, `${item.action ?? "command"}-${item.value}`));
|
|
147
|
-
})] })] }));
|
|
148
|
-
}
|
|
149
|
-
export const INK_LOCAL_SLASH_COMMANDS = [
|
|
150
|
-
{
|
|
151
|
-
name: "goal",
|
|
152
|
-
description: "Set/manage an autonomous goal (/goal <objective>|clear|pause|resume|edit)",
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: "loop",
|
|
156
|
-
description: "Run a prompt on a recurring interval (/loop 5m <prompt>|list|stop [id])",
|
|
157
|
-
},
|
|
158
|
-
];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CompactionProgress } from "../slash-commands/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Map a compaction phase + streamed length onto a 0..1 bar fill. There is no
|
|
4
|
-
* true denominator for a single LLM call, so the curve is honest by design:
|
|
5
|
-
* it ramps but never reaches 1.0 (or even 0.9) until the work is actually done.
|
|
6
|
-
*/
|
|
7
|
-
export declare function compactionFraction(progress: CompactionProgress): number;
|
|
8
|
-
export declare function renderBar(fraction: number, width?: number): {
|
|
9
|
-
filled: string;
|
|
10
|
-
empty: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Bottom-stack progress card for a manual `/compact` run. Mount it only while a
|
|
14
|
-
* compaction is in flight (i.e. render conditionally on a non-null progress) so
|
|
15
|
-
* its elapsed-time clock resets per run.
|
|
16
|
-
*/
|
|
17
|
-
export declare function CompactionProgressCard({ progress }: {
|
|
18
|
-
progress: CompactionProgress | null;
|
|
19
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { Box, Text } from "ink";
|
|
4
|
-
import { useTheme } from "./theme.js";
|
|
5
|
-
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
6
|
-
const BAR_WIDTH = 24;
|
|
7
|
-
// Chars of streamed summary at which the summarizing phase nears its ceiling.
|
|
8
|
-
// A 9-section handoff summary is typically ~1.5–4k chars; this makes the bar
|
|
9
|
-
// feel alive without ever claiming completion before the model actually returns
|
|
10
|
-
// (the curve is asymptotic and capped at 0.9 until the apply phase).
|
|
11
|
-
const SUMMARY_CHAR_ESTIMATE = 2500;
|
|
12
|
-
const PHASE_LABEL = {
|
|
13
|
-
collecting: "收集历史",
|
|
14
|
-
summarizing: "生成摘要中",
|
|
15
|
-
applying: "应用压缩",
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Map a compaction phase + streamed length onto a 0..1 bar fill. There is no
|
|
19
|
-
* true denominator for a single LLM call, so the curve is honest by design:
|
|
20
|
-
* it ramps but never reaches 1.0 (or even 0.9) until the work is actually done.
|
|
21
|
-
*/
|
|
22
|
-
export function compactionFraction(progress) {
|
|
23
|
-
switch (progress.phase) {
|
|
24
|
-
case "collecting":
|
|
25
|
-
return 0.05;
|
|
26
|
-
case "summarizing": {
|
|
27
|
-
const ramp = 1 - Math.exp(-progress.streamedChars / SUMMARY_CHAR_ESTIMATE);
|
|
28
|
-
return Math.min(0.9, 0.1 + 0.8 * ramp);
|
|
29
|
-
}
|
|
30
|
-
case "applying":
|
|
31
|
-
return 0.95;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function renderBar(fraction, width = BAR_WIDTH) {
|
|
35
|
-
const clamped = Math.max(0, Math.min(1, fraction));
|
|
36
|
-
const filledCount = Math.round(clamped * width);
|
|
37
|
-
return {
|
|
38
|
-
filled: "█".repeat(filledCount),
|
|
39
|
-
empty: "░".repeat(width - filledCount),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function formatChars(count) {
|
|
43
|
-
if (count < 1000)
|
|
44
|
-
return `${count}`;
|
|
45
|
-
return `${(count / 1000).toFixed(1)}k`;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Bottom-stack progress card for a manual `/compact` run. Mount it only while a
|
|
49
|
-
* compaction is in flight (i.e. render conditionally on a non-null progress) so
|
|
50
|
-
* its elapsed-time clock resets per run.
|
|
51
|
-
*/
|
|
52
|
-
export function CompactionProgressCard({ progress }) {
|
|
53
|
-
const theme = useTheme();
|
|
54
|
-
const [frameIndex, setFrameIndex] = useState(0);
|
|
55
|
-
const [startedAt] = useState(() => Date.now());
|
|
56
|
-
const [now, setNow] = useState(() => Date.now());
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
const t = setInterval(() => {
|
|
59
|
-
setFrameIndex((i) => (i + 1) % SPINNER_FRAMES.length);
|
|
60
|
-
setNow(Date.now());
|
|
61
|
-
}, 100);
|
|
62
|
-
return () => clearInterval(t);
|
|
63
|
-
}, []);
|
|
64
|
-
if (!progress)
|
|
65
|
-
return null;
|
|
66
|
-
const fraction = compactionFraction(progress);
|
|
67
|
-
const { filled, empty } = renderBar(fraction);
|
|
68
|
-
const pct = Math.round(fraction * 100);
|
|
69
|
-
const elapsed = ((now - startedAt) / 1000).toFixed(1);
|
|
70
|
-
const phaseLine = progress.phase === "summarizing"
|
|
71
|
-
? `· ${PHASE_LABEL.summarizing} (流式接收 ${formatChars(progress.streamedChars)} chars)`
|
|
72
|
-
: `· ${PHASE_LABEL[progress.phase]}`;
|
|
73
|
-
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingBottom: 1, flexShrink: 0, children: [_jsx(Text, { color: theme.accent, children: `${SPINNER_FRAMES[frameIndex]} Compacting context…` }), _jsxs(Text, { children: [_jsx(Text, { color: theme.muted, children: "[" }), _jsx(Text, { color: theme.accent, children: filled }), _jsx(Text, { color: theme.dim, children: empty }), _jsx(Text, { color: theme.muted, children: `] ${pct}%` })] }), _jsx(Text, { color: theme.muted, children: phaseLine }), _jsx(Text, { color: theme.muted, children: `· 已耗时 ${elapsed}s` })] }));
|
|
74
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { detectTerminalTheme, themeFromMacOsAppearance, type ResolvedTheme, } from "../tui/detect-theme.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { detectTerminalTheme, themeFromMacOsAppearance, } from "../tui/detect-theme.js";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { FeedbackPayload } from "../feedback/types.js";
|
|
2
|
-
interface FeedbackDialogProps {
|
|
3
|
-
/** Pre-collected env + transcript; description is filled in by the user. */
|
|
4
|
-
base: Omit<FeedbackPayload, "description">;
|
|
5
|
-
initialDescription: string;
|
|
6
|
-
onDismiss: () => void;
|
|
7
|
-
onResult: (result: {
|
|
8
|
-
kind: "success";
|
|
9
|
-
url: string;
|
|
10
|
-
number: number;
|
|
11
|
-
} | {
|
|
12
|
-
kind: "error";
|
|
13
|
-
message: string;
|
|
14
|
-
} | {
|
|
15
|
-
kind: "cancelled";
|
|
16
|
-
}) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare function FeedbackDialog({ base, initialDescription, onDismiss, onResult }: FeedbackDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export {};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, 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
|
-
import { submitFeedback, FeedbackSubmitError } from "../feedback/submit.js";
|
|
8
|
-
export function FeedbackDialog({ base, initialDescription, onDismiss, onResult }) {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
const [stage, setStage] = useState("edit");
|
|
11
|
-
const [description, setDescription] = useState(initialDescription);
|
|
12
|
-
const [cursor, setCursor] = useState(initialDescription.length);
|
|
13
|
-
const [showPreview, setShowPreview] = useState(false);
|
|
14
|
-
const [finalResult, setFinalResult] = useState(null);
|
|
15
|
-
const transcriptStats = useMemo(() => {
|
|
16
|
-
const total = base.transcript.reduce((sum, m) => sum + m.content.length, 0);
|
|
17
|
-
return { count: base.transcript.length, totalChars: total };
|
|
18
|
-
}, [base.transcript]);
|
|
19
|
-
const insertAtCursor = (text) => {
|
|
20
|
-
setDescription((prev) => prev.slice(0, cursor) + text + prev.slice(cursor));
|
|
21
|
-
setCursor((c) => c + text.length);
|
|
22
|
-
};
|
|
23
|
-
const submit = async () => {
|
|
24
|
-
setStage("submitting");
|
|
25
|
-
const payload = { ...base, description: description.trim() };
|
|
26
|
-
try {
|
|
27
|
-
const result = await submitFeedback(payload);
|
|
28
|
-
setFinalResult({ kind: "success", result });
|
|
29
|
-
setStage("done");
|
|
30
|
-
onResult({ kind: "success", url: result.url, number: result.number });
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
const message = err instanceof FeedbackSubmitError
|
|
34
|
-
? err.message
|
|
35
|
-
: err instanceof Error
|
|
36
|
-
? err.message
|
|
37
|
-
: String(err);
|
|
38
|
-
setFinalResult({ kind: "error", message });
|
|
39
|
-
setStage("done");
|
|
40
|
-
onResult({ kind: "error", message });
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
useInput((input, key) => {
|
|
44
|
-
if (isKeyReleaseEvent(key))
|
|
45
|
-
return;
|
|
46
|
-
const strippedMouseInput = stripTerminalMouseSequences(input);
|
|
47
|
-
if (strippedMouseInput !== input) {
|
|
48
|
-
if (!strippedMouseInput)
|
|
49
|
-
return;
|
|
50
|
-
input = strippedMouseInput;
|
|
51
|
-
}
|
|
52
|
-
if (stage === "submitting")
|
|
53
|
-
return;
|
|
54
|
-
if (stage === "done") {
|
|
55
|
-
if (key.return || key.escape || input === " ") {
|
|
56
|
-
onDismiss();
|
|
57
|
-
}
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
// edit stage
|
|
61
|
-
if (key.escape) {
|
|
62
|
-
onResult({ kind: "cancelled" });
|
|
63
|
-
onDismiss();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (key.tab) {
|
|
67
|
-
setShowPreview((v) => !v);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (key.ctrl && (input === "d" || input === "s")) {
|
|
71
|
-
if (description.trim().length === 0 && transcriptStats.count === 0) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
void submit();
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (key.return) {
|
|
78
|
-
insertAtCursor("\n");
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (key.backspace || key.delete) {
|
|
82
|
-
if (cursor > 0) {
|
|
83
|
-
setDescription((prev) => prev.slice(0, cursor - 1) + prev.slice(cursor));
|
|
84
|
-
setCursor((c) => Math.max(0, c - 1));
|
|
85
|
-
}
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (key.leftArrow) {
|
|
89
|
-
setCursor((c) => Math.max(0, c - 1));
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (key.rightArrow) {
|
|
93
|
-
setCursor((c) => Math.min(description.length, c + 1));
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (key.upArrow || key.downArrow) {
|
|
97
|
-
const before = description.slice(0, cursor);
|
|
98
|
-
const after = description.slice(cursor);
|
|
99
|
-
const beforeLines = before.split("\n");
|
|
100
|
-
const afterLines = after.split("\n");
|
|
101
|
-
const currentCol = beforeLines[beforeLines.length - 1].length;
|
|
102
|
-
if (key.upArrow && beforeLines.length > 1) {
|
|
103
|
-
const prevLine = beforeLines[beforeLines.length - 2];
|
|
104
|
-
const col = Math.min(currentCol, prevLine.length);
|
|
105
|
-
const newCursor = before.length - beforeLines[beforeLines.length - 1].length - 1 - (prevLine.length - col);
|
|
106
|
-
setCursor(Math.max(0, newCursor));
|
|
107
|
-
}
|
|
108
|
-
else if (key.downArrow && afterLines.length > 1) {
|
|
109
|
-
const nextLine = afterLines[1];
|
|
110
|
-
const col = Math.min(currentCol, nextLine.length);
|
|
111
|
-
const newCursor = before.length + afterLines[0].length + 1 + col;
|
|
112
|
-
setCursor(Math.min(description.length, newCursor));
|
|
113
|
-
}
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (input && !key.meta) {
|
|
117
|
-
insertAtCursor(input);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
if (stage === "done" && finalResult) {
|
|
121
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginY: 1, children: [finalResult.kind === "success" ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.accent, bold: true, children: "Feedback submitted" }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: ["Thanks! Issue #", finalResult.result.number, " created."] }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.muted, children: finalResult.result.url }) })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.error, bold: true, children: "Feedback failed to submit" }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: finalResult.message }) })] })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.muted, children: "Press Enter to dismiss" }) })] }));
|
|
122
|
-
}
|
|
123
|
-
if (stage === "submitting") {
|
|
124
|
-
return (_jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginY: 1, children: _jsx(Text, { color: theme.accent, bold: true, children: "Sending feedback..." }) }));
|
|
125
|
-
}
|
|
126
|
-
// edit stage
|
|
127
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginY: 1, children: [_jsx(Text, { color: theme.accent, bold: true, children: "Send feedback" }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.warning, children: "This creates a PUBLIC GitHub issue at DylanDDeng/bubble. Review before sending." }) }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: theme.muted, children: "Describe what happened:" }), _jsx(Box, { borderStyle: "single", borderColor: theme.muted, paddingX: 1, marginTop: 0, minHeight: 3, children: _jsx(Text, { children: renderWithCursor(description, cursor) }) })] }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { color: theme.muted, children: ["Also included: v", base.version, " \u00B7 ", base.platform, "/", base.arch, " \u00B7 node ", base.nodeVersion, " \u00B7", " ", base.provider, "/", base.model, " \u00B7 ", transcriptStats.count, " messages (", transcriptStats.totalChars, " chars, secrets redacted)"] }), showPreview && (_jsxs(Box, { flexDirection: "column", marginTop: 1, borderStyle: "single", borderColor: theme.muted, paddingX: 1, children: [_jsx(Text, { color: theme.muted, bold: true, children: "Payload preview (exactly what will be submitted):" }), base.transcript.map((m, i) => (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { color: theme.accent, children: ["[", m.role, "]"] }), _jsx(Text, { children: m.content })] }, i))), base.recentError && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: theme.error, children: "[recent error]" }), _jsx(Text, { children: base.recentError })] }))] }))] }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: theme.muted, children: [_jsx(Text, { color: theme.accent, bold: true, children: "Ctrl+D" }), " submit \u00B7", " ", _jsx(Text, { color: theme.accent, bold: true, children: "Tab" }), " ", showPreview ? "hide" : "view", " payload \u00B7", " ", _jsx(Text, { color: theme.accent, bold: true, children: "Enter" }), " newline \u00B7", " ", _jsx(Text, { color: theme.accent, bold: true, children: "Esc" }), " cancel"] }) })] }));
|
|
128
|
-
}
|
|
129
|
-
function renderWithCursor(text, cursor) {
|
|
130
|
-
if (text.length === 0)
|
|
131
|
-
return "▏";
|
|
132
|
-
return text.slice(0, cursor) + "▏" + text.slice(cursor);
|
|
133
|
-
}
|