@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,6 +1,6 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
|
-
import { getEditDiffDetails } from "
|
|
3
|
-
import {
|
|
2
|
+
import { getEditDiffDetails } from "../formatting/edit-diff.js";
|
|
3
|
+
import { analyzeToolIntent } from "../../agent/tool-intent.js";
|
|
4
4
|
const DEFAULT_MAX_ITEMS = 6;
|
|
5
5
|
const DEFAULT_MAX_PREVIEW_LINES = 8;
|
|
6
6
|
export function buildTraceGroups(toolCalls, options = {}) {
|
|
@@ -22,6 +22,14 @@ export function buildTraceGroups(toolCalls, options = {}) {
|
|
|
22
22
|
bucketClassifier = null;
|
|
23
23
|
};
|
|
24
24
|
for (const toolCall of toolCalls) {
|
|
25
|
+
// Grok keeps background-agent lifecycle in Tasks Pane. The transcript
|
|
26
|
+
// records only the launch event; wait/list/input/close echoes would repeat
|
|
27
|
+
// the same roster on every provider turn without adding chat history.
|
|
28
|
+
if (toolCall.metadata?.kind === "subagent"
|
|
29
|
+
&& toolCall.name !== "spawn_agent"
|
|
30
|
+
&& toolCall.name !== "run_workflow") {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
25
33
|
const classifier = classifyTool(toolCall);
|
|
26
34
|
if (!classifier.groupable) {
|
|
27
35
|
flush();
|
|
@@ -97,7 +105,20 @@ export function executeCommandBlock(group, maxLines) {
|
|
|
97
105
|
}
|
|
98
106
|
function classifyTool(toolCall) {
|
|
99
107
|
if (toolCall.metadata?.kind === "subagent") {
|
|
100
|
-
|
|
108
|
+
const workflow = toolCall.name === "run_workflow" || toolCall.metadata.mode === "workflow";
|
|
109
|
+
return { kind: "subagent", title: workflow ? "Workflow" : "Subagent", bucketKey: `subagent:${toolCall.id}`, groupable: false };
|
|
110
|
+
}
|
|
111
|
+
if (toolCall.name === "bash") {
|
|
112
|
+
const semanticKind = toolCall.metadata?.kind;
|
|
113
|
+
const family = semanticKind === "read" || semanticKind === "search"
|
|
114
|
+
? semanticKind
|
|
115
|
+
: analyzeToolIntent({ name: toolCall.name, parsedArgs: toolCall.args }).family;
|
|
116
|
+
if (family === "read") {
|
|
117
|
+
return { kind: "read", title: "Read", bucketKey: "read", groupable: true };
|
|
118
|
+
}
|
|
119
|
+
if (family === "search") {
|
|
120
|
+
return { kind: "search", title: "Search", bucketKey: "search", groupable: true };
|
|
121
|
+
}
|
|
101
122
|
}
|
|
102
123
|
switch (toolCall.name) {
|
|
103
124
|
case "glob": {
|
|
@@ -188,7 +209,7 @@ function listResultItems(tool, homeDir) {
|
|
|
188
209
|
const metadataPaths = Array.isArray(tool.metadata?.paths)
|
|
189
210
|
? tool.metadata.paths.filter((item) => typeof item === "string" && item.trim().length > 0)
|
|
190
211
|
: [];
|
|
191
|
-
if (metadataPaths.length > 0
|
|
212
|
+
if (metadataPaths.length > 0) {
|
|
192
213
|
return metadataPaths.map((line) => formatTracePath(line, homeDir));
|
|
193
214
|
}
|
|
194
215
|
return resultLines(tool.result)
|
|
@@ -220,7 +241,11 @@ function isListResultLine(line) {
|
|
|
220
241
|
}
|
|
221
242
|
function buildPathGroup(classifier, raw, options, pending, startedAt, hasError, errorCount, nounBase) {
|
|
222
243
|
const items = unique(raw
|
|
223
|
-
.map((tool) => formatTracePath(tool.args.path
|
|
244
|
+
.map((tool) => formatTracePath(tool.args.path
|
|
245
|
+
?? tool.args.file
|
|
246
|
+
?? tool.metadata?.path
|
|
247
|
+
?? analyzeToolIntent({ name: tool.name, parsedArgs: tool.args }).read?.path
|
|
248
|
+
?? "", options.homeDir))
|
|
224
249
|
.filter(Boolean));
|
|
225
250
|
const { shown, omitted } = take(items, options.maxItems);
|
|
226
251
|
const count = items.length || raw.length;
|
|
@@ -242,12 +267,16 @@ function buildPathGroup(classifier, raw, options, pending, startedAt, hasError,
|
|
|
242
267
|
}
|
|
243
268
|
function buildSearchGroup(classifier, raw, options, pending, startedAt, hasError, errorCount) {
|
|
244
269
|
const items = raw.map((tool) => {
|
|
245
|
-
const
|
|
246
|
-
const
|
|
270
|
+
const intent = analyzeToolIntent({ name: tool.name, parsedArgs: tool.args }).search;
|
|
271
|
+
const pattern = String(tool.args.pattern ?? tool.args.query ?? tool.metadata?.pattern ?? intent?.pattern ?? "").trim();
|
|
272
|
+
const scope = String(tool.args.path ?? tool.args.glob ?? tool.args.include ?? tool.metadata?.path ?? intent?.path ?? "").trim();
|
|
247
273
|
const patternText = pattern ? `"${pattern}"` : "(pattern)";
|
|
248
274
|
return scope ? `${patternText} in ${formatTracePath(scope, options.homeDir)}` : patternText;
|
|
249
275
|
});
|
|
276
|
+
const resultPreview = raw.flatMap((tool) => resultLines(tool.result))
|
|
277
|
+
.map((line) => formatTracePath(line, options.homeDir));
|
|
250
278
|
const { shown, omitted } = take(items, options.maxItems);
|
|
279
|
+
const preview = take(resultPreview, options.maxPreviewLines);
|
|
251
280
|
const count = raw.length;
|
|
252
281
|
return {
|
|
253
282
|
kind: "search",
|
|
@@ -256,9 +285,9 @@ function buildSearchGroup(classifier, raw, options, pending, startedAt, hasError
|
|
|
256
285
|
count,
|
|
257
286
|
noun: plural(count, "search", "searches"),
|
|
258
287
|
items: shown,
|
|
259
|
-
previewLines:
|
|
288
|
+
previewLines: preview.shown,
|
|
260
289
|
errorLines: collectErrorLines(raw, options),
|
|
261
|
-
omitted,
|
|
290
|
+
omitted: omitted + preview.omitted,
|
|
262
291
|
pending,
|
|
263
292
|
hasError,
|
|
264
293
|
errorCount,
|
|
@@ -270,9 +299,33 @@ function buildExecuteGroup(classifier, tool, options, pending, startedAt, hasErr
|
|
|
270
299
|
const { shown, omitted } = take(lines, options.maxPreviewLines);
|
|
271
300
|
const rawCommand = String(tool.args.command ?? tool.args.cmd ?? commandFromRawArguments(tool.rawArguments) ?? "");
|
|
272
301
|
const description = String(tool.args.description ?? "").trim() || undefined;
|
|
302
|
+
const taskId = typeof tool.metadata?.taskId === "string" ? tool.metadata.taskId : undefined;
|
|
303
|
+
const lifecycle = typeof tool.metadata?.taskLifecycle === "string"
|
|
304
|
+
? tool.metadata.taskLifecycle
|
|
305
|
+
: undefined;
|
|
306
|
+
const backgroundLaunch = tool.metadata?.background === true && taskId && !lifecycle;
|
|
307
|
+
const title = lifecycle === "completed"
|
|
308
|
+
? "Task completed"
|
|
309
|
+
: lifecycle === "failed"
|
|
310
|
+
? "Task failed"
|
|
311
|
+
: lifecycle === "killed"
|
|
312
|
+
? "Task killed"
|
|
313
|
+
: backgroundLaunch
|
|
314
|
+
? "Task started"
|
|
315
|
+
: classifier.title;
|
|
316
|
+
const endedAt = typeof tool.metadata?.endedAt === "number" ? tool.metadata.endedAt : undefined;
|
|
317
|
+
const elapsed = endedAt ? formatElapsedDuration(tool.startedAt, endedAt) : undefined;
|
|
318
|
+
const exitCode = typeof tool.metadata?.exitCode === "number" ? tool.metadata.exitCode : undefined;
|
|
319
|
+
const outputLines = typeof tool.metadata?.outputLines === "number" ? tool.metadata.outputLines : undefined;
|
|
320
|
+
const statusLabel = taskId
|
|
321
|
+
? [taskId, elapsed ? `in ${elapsed}` : undefined, exitCode !== undefined ? `exit ${exitCode}` : undefined,
|
|
322
|
+
outputLines !== undefined ? `${outputLines} line${outputLines === 1 ? "" : "s"}` : undefined]
|
|
323
|
+
.filter(Boolean)
|
|
324
|
+
.join(" · ")
|
|
325
|
+
: undefined;
|
|
273
326
|
return {
|
|
274
327
|
kind: "execute",
|
|
275
|
-
title
|
|
328
|
+
title,
|
|
276
329
|
raw: [tool],
|
|
277
330
|
command: normalizeCommand(rawCommand),
|
|
278
331
|
description,
|
|
@@ -285,8 +338,18 @@ function buildExecuteGroup(classifier, tool, options, pending, startedAt, hasErr
|
|
|
285
338
|
hasError,
|
|
286
339
|
errorCount,
|
|
287
340
|
startedAt,
|
|
341
|
+
statusLabel,
|
|
288
342
|
};
|
|
289
343
|
}
|
|
344
|
+
function formatElapsedDuration(startedAt, endedAt) {
|
|
345
|
+
if (startedAt === undefined)
|
|
346
|
+
return undefined;
|
|
347
|
+
const seconds = Math.max(0, Math.round((endedAt - startedAt) / 1000));
|
|
348
|
+
if (seconds < 60)
|
|
349
|
+
return `${seconds}s`;
|
|
350
|
+
const minutes = Math.floor(seconds / 60);
|
|
351
|
+
return `${minutes}m${String(seconds % 60).padStart(2, "0")}s`;
|
|
352
|
+
}
|
|
290
353
|
function buildMutationGroup(classifier, raw, options, pending, startedAt, hasError, errorCount) {
|
|
291
354
|
const items = raw
|
|
292
355
|
.map((tool) => {
|
|
@@ -320,27 +383,35 @@ function buildMutationGroup(classifier, raw, options, pending, startedAt, hasErr
|
|
|
320
383
|
startedAt,
|
|
321
384
|
};
|
|
322
385
|
}
|
|
323
|
-
function buildSubagentGroup(classifier, tool,
|
|
386
|
+
function buildSubagentGroup(classifier, tool, _options, pending, startedAt) {
|
|
324
387
|
const subagents = subagentsFromMetadata(tool);
|
|
325
|
-
const rows = subagents.length > 0
|
|
326
|
-
? subagents.map(formatSubagentRow)
|
|
327
|
-
: resultLines(tool.result).map((line) => formatTracePath(line, options.homeDir));
|
|
328
|
-
const { shown, omitted } = take(rows, options.maxPreviewLines);
|
|
329
388
|
const errorCount = subagents.filter(isFailedSubagent).length + (tool.isError ? 1 : 0);
|
|
389
|
+
const statusLabel = subagents.length > 0
|
|
390
|
+
&& subagents.every((subagent) => subagent.status === "completed" || subagent.status === "closed")
|
|
391
|
+
? "completed"
|
|
392
|
+
: undefined;
|
|
393
|
+
const launchLabel = tool.name === "run_workflow"
|
|
394
|
+
? String(tool.args.title ?? tool.args.description ?? "").trim()
|
|
395
|
+
: subagents[0]?.nickname || subagents[0]?.agentName || String(tool.args.description ?? "").trim();
|
|
330
396
|
return {
|
|
331
397
|
kind: "subagent",
|
|
332
398
|
title: classifier.title,
|
|
399
|
+
description: launchLabel || undefined,
|
|
333
400
|
raw: [tool],
|
|
334
401
|
count: subagents.length || 1,
|
|
335
402
|
noun: plural(subagents.length || 1, "agent", "agents"),
|
|
336
403
|
items: [],
|
|
337
|
-
|
|
404
|
+
// The full roster and live activity belong to Tasks Pane. Keeping member
|
|
405
|
+
// rows here creates two competing sources of truth and makes every
|
|
406
|
+
// wait/list call visually replay the launch.
|
|
407
|
+
previewLines: [],
|
|
338
408
|
errorLines: [],
|
|
339
|
-
omitted,
|
|
409
|
+
omitted: 0,
|
|
340
410
|
pending: pending || subagents.some((subagent) => ["queued", "running"].includes(subagent.status ?? "running")),
|
|
341
411
|
hasError: !!tool.isError || errorCount > 0,
|
|
342
412
|
errorCount,
|
|
343
413
|
startedAt,
|
|
414
|
+
statusLabel,
|
|
344
415
|
};
|
|
345
416
|
}
|
|
346
417
|
function buildOtherGroup(classifier, raw, options, pending, startedAt, hasError, errorCount) {
|
|
@@ -370,23 +441,13 @@ function subagentsFromMetadata(tool) {
|
|
|
370
441
|
return [];
|
|
371
442
|
return raw.filter((item) => typeof item === "object" && item !== null);
|
|
372
443
|
}
|
|
373
|
-
function formatSubagentRow(subagent) {
|
|
374
|
-
const label = subagent.nickname || subagent.agentName || subagent.subAgentId || "subagent";
|
|
375
|
-
const role = [subagent.agentName, subagent.category ? `/${subagent.category}` : ""].join("") || "default";
|
|
376
|
-
const route = formatSubagentRoute(subagent.route);
|
|
377
|
-
const descriptor = route ? `${role} @ ${route}` : role;
|
|
378
|
-
const status = subagent.status || "running";
|
|
379
|
-
const note = subagent.error
|
|
380
|
-
|| subagent.toolNotes?.filter(Boolean).at(-1)
|
|
381
|
-
|| subagent.summary
|
|
382
|
-
|| subagent.task
|
|
383
|
-
|| "";
|
|
384
|
-
return [label, `(${descriptor})`, status, note].filter(Boolean).join(" ");
|
|
385
|
-
}
|
|
386
444
|
function isFailedSubagent(subagent) {
|
|
387
445
|
return subagent.status === "failed" || subagent.status === "blocked" || subagent.status === "cancelled";
|
|
388
446
|
}
|
|
389
447
|
function isToolPending(tool) {
|
|
448
|
+
if (tool.status) {
|
|
449
|
+
return tool.status === "queued" || tool.status === "pending" || tool.status === "running";
|
|
450
|
+
}
|
|
390
451
|
return tool.result === undefined;
|
|
391
452
|
}
|
|
392
453
|
function isDirectoryLikeGlob(pattern) {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { TraceGroup } from "./trace-groups.js";
|
|
2
|
+
export type TraceRowTarget = {
|
|
3
|
+
kind: "group";
|
|
4
|
+
key: string;
|
|
5
|
+
groupKey: string;
|
|
6
|
+
foldable: boolean;
|
|
7
|
+
action?: TraceAction;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "item";
|
|
10
|
+
key: string;
|
|
11
|
+
groupKey: string;
|
|
12
|
+
toolId: string;
|
|
13
|
+
foldable: boolean;
|
|
14
|
+
action?: TraceAction;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "image";
|
|
17
|
+
key: string;
|
|
18
|
+
groupKey: string;
|
|
19
|
+
imageLabel: string;
|
|
20
|
+
foldable: false;
|
|
21
|
+
action: TraceAction;
|
|
22
|
+
};
|
|
23
|
+
export type TraceAction = {
|
|
24
|
+
kind: "open-subagent";
|
|
25
|
+
subAgentId: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "open-task";
|
|
28
|
+
taskId: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "open-image";
|
|
31
|
+
messageKey: string;
|
|
32
|
+
imageLabel: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* UI-only fold/selection state. Tool lifecycle data remains immutable in the
|
|
36
|
+
* controller; live and settled renderers share this object so committing a
|
|
37
|
+
* turn cannot reset an expanded tool entry.
|
|
38
|
+
*/
|
|
39
|
+
export declare class TraceInteractionState {
|
|
40
|
+
private revision;
|
|
41
|
+
private selectedKey?;
|
|
42
|
+
private selectedGroupKey?;
|
|
43
|
+
private hoveredGroupKey?;
|
|
44
|
+
private readonly expandedGroups;
|
|
45
|
+
private readonly expandedItems;
|
|
46
|
+
groupKey(group: TraceGroup): string;
|
|
47
|
+
itemKey(group: TraceGroup, toolId: string): string;
|
|
48
|
+
isSelected(key: string): boolean;
|
|
49
|
+
isGroupSelected(groupKey: string): boolean;
|
|
50
|
+
isGroupHovered(groupKey: string): boolean;
|
|
51
|
+
isGroupExpanded(groupKey: string): boolean;
|
|
52
|
+
isItemExpanded(itemKey: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Monotonic render revision for transcript projection caches. The tool
|
|
55
|
+
* lifecycle remains immutable in the controller; only these UI affordances
|
|
56
|
+
* can change the settled projection without replacing the transcript array.
|
|
57
|
+
*/
|
|
58
|
+
getRevision(): number;
|
|
59
|
+
activate(target: TraceRowTarget, clickCount: 1 | 2): TraceAction | undefined;
|
|
60
|
+
hover(target: TraceRowTarget | undefined): boolean;
|
|
61
|
+
clearHover(): boolean;
|
|
62
|
+
private toggle;
|
|
63
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI-only fold/selection state. Tool lifecycle data remains immutable in the
|
|
3
|
+
* controller; live and settled renderers share this object so committing a
|
|
4
|
+
* turn cannot reset an expanded tool entry.
|
|
5
|
+
*/
|
|
6
|
+
export class TraceInteractionState {
|
|
7
|
+
revision = 0;
|
|
8
|
+
selectedKey;
|
|
9
|
+
selectedGroupKey;
|
|
10
|
+
hoveredGroupKey;
|
|
11
|
+
expandedGroups = new Set();
|
|
12
|
+
expandedItems = new Set();
|
|
13
|
+
groupKey(group) {
|
|
14
|
+
return `${group.kind}:${group.raw[0]?.id ?? group.title}`;
|
|
15
|
+
}
|
|
16
|
+
itemKey(group, toolId) {
|
|
17
|
+
return `${this.groupKey(group)}:item:${toolId}`;
|
|
18
|
+
}
|
|
19
|
+
isSelected(key) {
|
|
20
|
+
return this.selectedKey === key;
|
|
21
|
+
}
|
|
22
|
+
isGroupSelected(groupKey) {
|
|
23
|
+
return this.selectedGroupKey === groupKey;
|
|
24
|
+
}
|
|
25
|
+
isGroupHovered(groupKey) {
|
|
26
|
+
return this.hoveredGroupKey === groupKey;
|
|
27
|
+
}
|
|
28
|
+
isGroupExpanded(groupKey) {
|
|
29
|
+
return this.expandedGroups.has(groupKey);
|
|
30
|
+
}
|
|
31
|
+
isItemExpanded(itemKey) {
|
|
32
|
+
return this.expandedItems.has(itemKey);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Monotonic render revision for transcript projection caches. The tool
|
|
36
|
+
* lifecycle remains immutable in the controller; only these UI affordances
|
|
37
|
+
* can change the settled projection without replacing the transcript array.
|
|
38
|
+
*/
|
|
39
|
+
getRevision() {
|
|
40
|
+
return this.revision;
|
|
41
|
+
}
|
|
42
|
+
activate(target, clickCount) {
|
|
43
|
+
const selectionChanged = this.selectedKey !== target.key || this.selectedGroupKey !== target.groupKey;
|
|
44
|
+
this.selectedKey = target.key;
|
|
45
|
+
this.selectedGroupKey = target.groupKey;
|
|
46
|
+
let foldChanged = false;
|
|
47
|
+
const actionClickCount = target.kind === "image" ? 1 : 2;
|
|
48
|
+
if (clickCount === actionClickCount && target.action) {
|
|
49
|
+
if (selectionChanged)
|
|
50
|
+
this.revision += 1;
|
|
51
|
+
return target.action;
|
|
52
|
+
}
|
|
53
|
+
if (clickCount !== 2 || !target.foldable) {
|
|
54
|
+
if (selectionChanged)
|
|
55
|
+
this.revision += 1;
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
if (target.kind === "group") {
|
|
59
|
+
this.toggle(this.expandedGroups, target.groupKey);
|
|
60
|
+
foldChanged = true;
|
|
61
|
+
}
|
|
62
|
+
else if (target.kind === "item") {
|
|
63
|
+
this.toggle(this.expandedItems, target.key);
|
|
64
|
+
foldChanged = true;
|
|
65
|
+
}
|
|
66
|
+
if (selectionChanged || foldChanged)
|
|
67
|
+
this.revision += 1;
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
hover(target) {
|
|
71
|
+
const next = target?.groupKey;
|
|
72
|
+
if (next === this.hoveredGroupKey)
|
|
73
|
+
return false;
|
|
74
|
+
this.hoveredGroupKey = next;
|
|
75
|
+
this.revision += 1;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
clearHover() {
|
|
79
|
+
return this.hover(undefined);
|
|
80
|
+
}
|
|
81
|
+
toggle(values, key) {
|
|
82
|
+
if (values.has(key))
|
|
83
|
+
values.delete(key);
|
|
84
|
+
else
|
|
85
|
+
values.add(key);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ModelInfo, type ProviderProfile, type ProviderRegistry } from "../provider-registry.js";
|
|
2
|
-
type ModelPickerRegistry = Pick<ProviderRegistry, "getEnabled" | "getModelConfig" | "listModels">;
|
|
2
|
+
export type ModelPickerRegistry = Pick<ProviderRegistry, "getEnabled" | "getModelConfig" | "listModels">;
|
|
3
3
|
export type ModelProviderGroup = {
|
|
4
4
|
provider: ProviderProfile;
|
|
5
5
|
models: ModelInfo[];
|
|
@@ -7,4 +7,3 @@ export type ModelProviderGroup = {
|
|
|
7
7
|
export declare function localModelsForProvider(registry: Pick<ProviderRegistry, "getModelConfig">, provider: ProviderProfile): ModelInfo[];
|
|
8
8
|
export declare function getVisibleModelProviders(registry: Pick<ProviderRegistry, "getEnabled">, providerId?: string): ProviderProfile[];
|
|
9
9
|
export declare function discoverModelProviderGroups(registry: ModelPickerRegistry, providerId?: string): Promise<ModelProviderGroup[]>;
|
|
10
|
-
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { listBuiltinModels } from "../model-catalog.js";
|
|
2
|
+
import { filterProviderModels } from "../provider-model-policy.js";
|
|
2
3
|
import { isUserVisibleProvider, } from "../provider-registry.js";
|
|
3
4
|
export function localModelsForProvider(registry, provider) {
|
|
4
|
-
const customModels = registry.getModelConfig().getCustomModels(provider.id);
|
|
5
|
+
const customModels = filterProviderModels(provider.id, registry.getModelConfig().getCustomModels(provider.id));
|
|
5
6
|
if (customModels.length > 0)
|
|
6
7
|
return customModels;
|
|
7
8
|
const builtinProviderId = provider.id === "openai" && provider.authType === "oauth"
|
|
@@ -11,6 +12,12 @@ export function localModelsForProvider(registry, provider) {
|
|
|
11
12
|
id: model.id,
|
|
12
13
|
name: model.name,
|
|
13
14
|
providerId: provider.id,
|
|
15
|
+
reasoningLevels: model.reasoningLevels,
|
|
16
|
+
defaultReasoningLevel: model.defaultReasoningLevel,
|
|
17
|
+
contextWindow: model.contextWindow,
|
|
18
|
+
useResponsesLite: model.useResponsesLite,
|
|
19
|
+
toolOutputTokenLimit: model.toolOutputTokenLimit,
|
|
20
|
+
tier: model.tier,
|
|
14
21
|
}));
|
|
15
22
|
}
|
|
16
23
|
export function getVisibleModelProviders(registry, providerId) {
|
package/dist/tui/model-switch.js
CHANGED
|
@@ -2,6 +2,7 @@ import { decodeModel, displayModel } from "../provider-registry.js";
|
|
|
2
2
|
import { buildSystemPrompt } from "../system-prompt.js";
|
|
3
3
|
import { getAvailableThinkingLevels, normalizeThinkingLevel } from "../provider-transform.js";
|
|
4
4
|
import { normalizeInheritedThinkingLevel } from "../variant/variant-resolver.js";
|
|
5
|
+
import { assertProviderModelAllowed } from "../provider-model-policy.js";
|
|
5
6
|
export function modelSwitchTarget(model, fallbackProviderId) {
|
|
6
7
|
const decoded = decodeModel(model);
|
|
7
8
|
return {
|
|
@@ -23,6 +24,7 @@ export function formatModelSwitchError(model, error) {
|
|
|
23
24
|
}
|
|
24
25
|
export async function switchAgentModel(options) {
|
|
25
26
|
const { providerId, modelId } = modelSwitchTarget(options.model, options.agent.providerId || options.registry.getDefault()?.id);
|
|
27
|
+
assertProviderModelAllowed(providerId, modelId);
|
|
26
28
|
if (!options.preparedProvider) {
|
|
27
29
|
await options.registry.prepareProvider(providerId);
|
|
28
30
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { SessionSummary } from "../session.js";
|
|
1
|
+
import { SessionSummary } from "../session.js";
|
|
3
2
|
export interface RunSessionPickerOptions {
|
|
4
3
|
currentCwd: string;
|
|
5
4
|
currentSessions: SessionSummary[];
|
|
6
5
|
allSessions: SessionSummary[];
|
|
7
|
-
resolvedTheme
|
|
6
|
+
resolvedTheme?: "light" | "dark";
|
|
8
7
|
themeOverrides?: Record<string, string>;
|
|
9
8
|
}
|
|
10
9
|
export declare function runSessionPicker(options: RunSessionPickerOptions): Promise<string | undefined>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Startup `--resume` session picker on the vendored Pi TUI renderer. Contract:
|
|
3
|
+
* resolve the chosen session file, or undefined on cancel.
|
|
4
|
+
*/
|
|
5
|
+
import { Box, ProcessTerminal, TuiMainScreen, Text, VStack, SelectList } from "@bubblebrain-ai/pi-tui";
|
|
6
|
+
import { paletteFor } from "./model/theme.js";
|
|
7
|
+
import { themeBackground, themeDim, themeForeground } from "./model/theme-style.js";
|
|
8
|
+
export async function runSessionPicker(options) {
|
|
9
|
+
const terminal = new ProcessTerminal();
|
|
10
|
+
const tui = new TuiMainScreen(terminal);
|
|
11
|
+
const theme = paletteFor(options.resolvedTheme ?? "dark", options.themeOverrides);
|
|
12
|
+
const items = [];
|
|
13
|
+
for (const summary of options.currentSessions.slice(0, 10)) {
|
|
14
|
+
items.push({
|
|
15
|
+
value: summary.file,
|
|
16
|
+
label: summary.title ?? summary.file.split("/").pop() ?? summary.file,
|
|
17
|
+
description: "this project",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const otherCount = options.allSessions.length - options.currentSessions.length;
|
|
21
|
+
if (otherCount > 0) {
|
|
22
|
+
for (const summary of options.allSessions.filter((s) => !options.currentSessions.includes(s)).slice(0, 10)) {
|
|
23
|
+
items.push({
|
|
24
|
+
value: summary.file,
|
|
25
|
+
label: summary.title ?? summary.file.split("/").pop() ?? summary.file,
|
|
26
|
+
description: "other project",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (items.length === 0)
|
|
31
|
+
return undefined;
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
const finish = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
tui.stop();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
/* already stopped */
|
|
39
|
+
}
|
|
40
|
+
resolve(value);
|
|
41
|
+
};
|
|
42
|
+
const header = new VStack([
|
|
43
|
+
new Text(themeForeground(theme.accent, "Resume session"), 1, 0),
|
|
44
|
+
new Text(themeDim(theme.dim, "Enter to select · Esc to start fresh"), 1, 0),
|
|
45
|
+
]);
|
|
46
|
+
const list = new SelectList(items, 10, {
|
|
47
|
+
selectedPrefix: () => themeForeground(theme.accent, "› "),
|
|
48
|
+
selectedText: (str) => themeForeground(theme.inputText, str),
|
|
49
|
+
description: (str) => themeDim(theme.dim, str),
|
|
50
|
+
scrollInfo: (str) => themeDim(theme.dim, str),
|
|
51
|
+
noMatch: (str) => themeDim(theme.dim, str),
|
|
52
|
+
}, {});
|
|
53
|
+
const content = new VStack([header, list]);
|
|
54
|
+
const box = theme.background
|
|
55
|
+
? new Box(0, 0, (text) => themeBackground(theme.background, text))
|
|
56
|
+
: new Box(0, 0);
|
|
57
|
+
box.addChild(content);
|
|
58
|
+
list.onSelect = (item) => finish(item.value);
|
|
59
|
+
list.onCancel = () => finish(undefined);
|
|
60
|
+
tui.addChild(box);
|
|
61
|
+
tui.start();
|
|
62
|
+
tui.setFocus(list);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Agent } from "../agent.js";
|
|
2
|
+
import type { SessionManager } from "../session.js";
|
|
3
|
+
import type { ProviderRegistry } from "../provider-registry.js";
|
|
4
|
+
import type { SkillRegistry } from "../skills/registry.js";
|
|
5
|
+
import type { PlanDecision } from "../types.js";
|
|
6
|
+
import type { ApprovalDecision, ApprovalRequest } from "../approval/types.js";
|
|
7
|
+
import type { QuestionController } from "../question/controller.js";
|
|
8
|
+
import type { BashAllowlist } from "../approval/session-cache.js";
|
|
9
|
+
import type { SettingsManager } from "../permissions/settings.js";
|
|
10
|
+
import type { LspService } from "../lsp/service.js";
|
|
11
|
+
import type { McpManager } from "../mcp/manager.js";
|
|
12
|
+
import type { GoalStore } from "../goal/store.js";
|
|
13
|
+
import type { ProcessManager } from "../tasks/manager.js";
|
|
14
|
+
import type { PromotionChannel } from "../tasks/promotion.js";
|
|
15
|
+
import type { ThemeMode } from "../config.js";
|
|
16
|
+
import type { ExternalHookController } from "../hooks/controller.js";
|
|
17
|
+
import type { ExternalRuntimeManager } from "../external-runtime/types.js";
|
|
18
|
+
import type { FlushScheduler } from "./controller/ports.js";
|
|
19
|
+
export interface RunTuiOptions {
|
|
20
|
+
sessionManager?: SessionManager;
|
|
21
|
+
createProvider?: (providerId: string, apiKey: string, baseURL: string) => unknown;
|
|
22
|
+
registry?: ProviderRegistry;
|
|
23
|
+
skillRegistry?: SkillRegistry;
|
|
24
|
+
planHandlerRef?: {
|
|
25
|
+
current?: (plan: string) => Promise<PlanDecision>;
|
|
26
|
+
};
|
|
27
|
+
approvalHandlerRef?: {
|
|
28
|
+
current?: (request: ApprovalRequest) => Promise<ApprovalDecision>;
|
|
29
|
+
};
|
|
30
|
+
questionController?: QuestionController;
|
|
31
|
+
bashAllowlist?: BashAllowlist;
|
|
32
|
+
settingsManager?: SettingsManager;
|
|
33
|
+
switchSession?: (sessionFile: string) => {
|
|
34
|
+
manager: SessionManager;
|
|
35
|
+
} | {
|
|
36
|
+
error: string;
|
|
37
|
+
};
|
|
38
|
+
createFreshSession?: (cwd: string) => {
|
|
39
|
+
manager: SessionManager;
|
|
40
|
+
} | {
|
|
41
|
+
error: string;
|
|
42
|
+
};
|
|
43
|
+
lspService?: LspService;
|
|
44
|
+
mcpManager?: McpManager;
|
|
45
|
+
goalStore?: GoalStore;
|
|
46
|
+
processManager?: ProcessManager;
|
|
47
|
+
tasksAutoResume?: boolean;
|
|
48
|
+
promotionChannel?: PromotionChannel;
|
|
49
|
+
themeMode?: ThemeMode;
|
|
50
|
+
themeOverrides?: Record<string, string>;
|
|
51
|
+
detectedTheme?: "light" | "dark";
|
|
52
|
+
onThemeModeChange?: (mode: ThemeMode) => void;
|
|
53
|
+
flushMemory?: () => Promise<void>;
|
|
54
|
+
runMemoryCompaction?: () => Promise<string>;
|
|
55
|
+
runMemorySummary?: (scope?: string) => Promise<string>;
|
|
56
|
+
runMemoryRefresh?: (scope?: string) => Promise<string>;
|
|
57
|
+
bypassEnabled?: boolean;
|
|
58
|
+
updateNotice?: string;
|
|
59
|
+
updateNoticeRefresh?: Promise<string | null>;
|
|
60
|
+
hookController?: ExternalHookController;
|
|
61
|
+
externalRuntime?: ExternalRuntimeManager;
|
|
62
|
+
}
|
|
63
|
+
export interface TuiExitSummary {
|
|
64
|
+
exitCode: number;
|
|
65
|
+
reason: string;
|
|
66
|
+
wallMs: number;
|
|
67
|
+
}
|
|
68
|
+
export declare function runTui(agent: Agent, _args: unknown, options: RunTuiOptions): Promise<TuiExitSummary>;
|
|
69
|
+
/** Resolve after first paint so git discovery never delays TUI startup. */
|
|
70
|
+
export declare function currentGitBranch(cwd: string): Promise<string | undefined>;
|
|
71
|
+
/** Production streaming repaint scheduler: one cancellable timer per burst. */
|
|
72
|
+
export declare function createFlushScheduler(): FlushScheduler;
|