@bubblebrain-ai/bubble 0.0.63 → 0.0.64
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 +437 -11
- package/dist/agent/abort-errors.d.ts +18 -0
- package/dist/agent/abort-errors.js +51 -0
- package/dist/agent/budget-ledger.d.ts +20 -0
- package/dist/agent/budget-ledger.js +45 -0
- package/dist/agent/categories.d.ts +100 -0
- package/dist/agent/categories.js +203 -0
- package/dist/agent/change-tracker.d.ts +40 -0
- package/dist/agent/change-tracker.js +89 -0
- package/dist/agent/child-runner.d.ts +64 -0
- package/dist/agent/child-runner.js +405 -0
- package/dist/agent/input-controller.d.ts +14 -0
- package/dist/agent/input-controller.js +43 -0
- package/dist/agent/internal-reminder-sanitizer.d.ts +25 -0
- package/dist/agent/internal-reminder-sanitizer.js +297 -0
- package/dist/agent/profiles.d.ts +76 -0
- package/dist/agent/profiles.js +526 -0
- package/dist/agent/provider-fingerprint.d.ts +6 -0
- package/dist/agent/provider-fingerprint.js +89 -0
- package/dist/agent/resident-history.d.ts +7 -0
- package/dist/agent/resident-history.js +61 -0
- package/dist/agent/result-integrator.d.ts +22 -0
- package/dist/agent/result-integrator.js +50 -0
- package/dist/agent/routing-catalog.d.ts +131 -0
- package/dist/agent/routing-catalog.js +260 -0
- package/dist/agent/structured-output.d.ts +37 -0
- package/dist/agent/structured-output.js +193 -0
- package/dist/agent/subagent/router.d.ts +65 -0
- package/dist/agent/subagent/router.js +203 -0
- package/dist/agent/subagent/runtime.d.ts +235 -0
- package/dist/agent/subagent/runtime.js +835 -0
- package/dist/agent/subagent-control.d.ts +100 -0
- package/dist/agent/subagent-control.js +70 -0
- package/dist/agent/subagent-lifecycle-reminder.d.ts +3 -0
- package/dist/agent/subagent-lifecycle-reminder.js +112 -0
- package/dist/agent/subagent-route-format.d.ts +8 -0
- package/dist/agent/subagent-route-format.js +18 -0
- package/dist/agent/subagent-scheduler.d.ts +105 -0
- package/dist/agent/subagent-scheduler.js +287 -0
- package/dist/agent/subagent-store.d.ts +57 -0
- package/dist/agent/subagent-store.js +180 -0
- package/dist/agent/subagent-summary.d.ts +30 -0
- package/dist/agent/subagent-summary.js +74 -0
- package/dist/agent/subagent-wait-guidance.d.ts +2 -0
- package/dist/agent/subagent-wait-guidance.js +8 -0
- package/dist/agent/subtask-policy.d.ts +13 -0
- package/dist/agent/subtask-policy.js +56 -0
- package/dist/agent/task-lifecycle-reminder.d.ts +26 -0
- package/dist/agent/task-lifecycle-reminder.js +59 -0
- package/dist/agent/tool-intent.d.ts +45 -0
- package/dist/agent/tool-intent.js +318 -0
- package/dist/agent/tool-visibility.d.ts +10 -0
- package/dist/agent/tool-visibility.js +6 -0
- package/dist/agent/transcript-helpers.d.ts +20 -0
- package/dist/agent/transcript-helpers.js +63 -0
- package/dist/agent/update-queue.d.ts +13 -0
- package/dist/agent/update-queue.js +69 -0
- package/dist/agent/workflow/control.d.ts +60 -0
- package/dist/agent/workflow/control.js +62 -0
- package/dist/agent/workflow/errors.d.ts +16 -0
- package/dist/agent/workflow/errors.js +24 -0
- package/dist/agent/workflow/runs.d.ts +73 -0
- package/dist/agent/workflow/runs.js +160 -0
- package/dist/agent/workflow/runtime.d.ts +88 -0
- package/dist/agent/workflow/runtime.js +319 -0
- package/dist/agent/worktree.d.ts +29 -0
- package/dist/agent/worktree.js +73 -0
- package/dist/agent.d.ts +460 -0
- package/dist/agent.js +2210 -0
- package/dist/anthropic-thinking.d.ts +4 -0
- package/dist/anthropic-thinking.js +11 -0
- package/dist/approval/controller.d.ts +71 -0
- package/dist/approval/controller.js +286 -0
- package/dist/approval/danger.d.ts +13 -0
- package/dist/approval/danger.js +55 -0
- package/dist/approval/diff-hunks.d.ts +12 -0
- package/dist/approval/diff-hunks.js +32 -0
- package/dist/approval/protected-paths.d.ts +1 -0
- package/dist/approval/protected-paths.js +35 -0
- package/dist/approval/session-cache.d.ts +21 -0
- package/dist/approval/session-cache.js +38 -0
- package/dist/approval/tool-helper.d.ts +14 -0
- package/dist/approval/tool-helper.js +47 -0
- package/dist/approval/types.d.ts +146 -0
- package/dist/approval/types.js +8 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +3 -0
- package/dist/bubble-home.d.ts +8 -0
- package/dist/bubble-home.js +19 -0
- package/dist/checkpoints.d.ts +57 -0
- package/dist/checkpoints.js +0 -0
- package/dist/cli.d.ts +37 -0
- package/dist/cli.js +175 -0
- package/dist/clipboard.d.ts +14 -0
- package/dist/clipboard.js +132 -0
- package/dist/config.d.ts +96 -0
- package/dist/config.js +287 -0
- package/dist/context/budget.d.ts +28 -0
- package/dist/context/budget.js +130 -0
- package/dist/context/checkpoint.d.ts +18 -0
- package/dist/context/checkpoint.js +117 -0
- package/dist/context/compact-llm.d.ts +25 -0
- package/dist/context/compact-llm.js +175 -0
- package/dist/context/compact.d.ts +124 -0
- package/dist/context/compact.js +635 -0
- package/dist/context/compaction-files.d.ts +44 -0
- package/dist/context/compaction-files.js +148 -0
- package/dist/context/llm-compactor.d.ts +53 -0
- package/dist/context/llm-compactor.js +424 -0
- package/dist/context/overflow.d.ts +9 -0
- package/dist/context/overflow.js +50 -0
- package/dist/context/projector.d.ts +34 -0
- package/dist/context/projector.js +251 -0
- package/dist/context/prune.d.ts +26 -0
- package/dist/context/prune.js +171 -0
- package/dist/context/session-write-lock.d.ts +20 -0
- package/dist/context/session-write-lock.js +162 -0
- package/dist/context/token-estimator.d.ts +14 -0
- package/dist/context/token-estimator.js +106 -0
- package/dist/context/tool-images.d.ts +3 -0
- package/dist/context/tool-images.js +35 -0
- package/dist/context/tool-output-truncate.d.ts +24 -0
- package/dist/context/tool-output-truncate.js +181 -0
- package/dist/context/usage.d.ts +34 -0
- package/dist/context/usage.js +230 -0
- package/dist/debug-trace.d.ts +27 -0
- package/dist/debug-trace.js +401 -0
- package/dist/diff-stats.d.ts +5 -0
- package/dist/diff-stats.js +21 -0
- package/dist/external-runtime/grok-acp.d.ts +56 -0
- package/dist/external-runtime/grok-acp.js +386 -0
- package/dist/external-runtime/grok-binary.d.ts +25 -0
- package/dist/external-runtime/grok-binary.js +108 -0
- package/dist/external-runtime/grok-errors.d.ts +7 -0
- package/dist/external-runtime/grok-errors.js +15 -0
- package/dist/external-runtime/grok-input-policy.d.ts +58 -0
- package/dist/external-runtime/grok-input-policy.js +52 -0
- package/dist/external-runtime/grok-ndjson.d.ts +14 -0
- package/dist/external-runtime/grok-ndjson.js +193 -0
- package/dist/external-runtime/grok-network.d.ts +15 -0
- package/dist/external-runtime/grok-network.js +81 -0
- package/dist/external-runtime/grok-preflight.d.ts +28 -0
- package/dist/external-runtime/grok-preflight.js +194 -0
- package/dist/external-runtime/grok-process.d.ts +26 -0
- package/dist/external-runtime/grok-process.js +184 -0
- package/dist/external-runtime/grok-profile.d.ts +32 -0
- package/dist/external-runtime/grok-profile.js +419 -0
- package/dist/external-runtime/grok-provider.d.ts +31 -0
- package/dist/external-runtime/grok-provider.js +41 -0
- package/dist/external-runtime/grok-runtime.d.ts +91 -0
- package/dist/external-runtime/grok-runtime.js +882 -0
- package/dist/external-runtime/index.d.ts +13 -0
- package/dist/external-runtime/index.js +13 -0
- package/dist/external-runtime/session-policy.d.ts +11 -0
- package/dist/external-runtime/session-policy.js +30 -0
- package/dist/external-runtime/types.d.ts +65 -0
- package/dist/external-runtime/types.js +1 -0
- package/dist/feedback/collect.d.ts +7 -0
- package/dist/feedback/collect.js +119 -0
- package/dist/feedback/config.d.ts +14 -0
- package/dist/feedback/config.js +16 -0
- package/dist/feedback/redact.d.ts +1 -0
- package/dist/feedback/redact.js +25 -0
- package/dist/feedback/submit.d.ts +6 -0
- package/dist/feedback/submit.js +43 -0
- package/dist/feedback/types.d.ts +22 -0
- package/dist/feedback/types.js +1 -0
- package/dist/feishu/agent-host/approval-card.d.ts +11 -0
- package/dist/feishu/agent-host/approval-card.js +85 -0
- package/dist/feishu/agent-host/approval-ui.d.ts +59 -0
- package/dist/feishu/agent-host/approval-ui.js +214 -0
- package/dist/feishu/agent-host/run-driver.d.ts +51 -0
- package/dist/feishu/agent-host/run-driver.js +397 -0
- package/dist/feishu/agent-host/runtime-deps.d.ts +33 -0
- package/dist/feishu/agent-host/runtime-deps.js +8 -0
- package/dist/feishu/card/budget.d.ts +40 -0
- package/dist/feishu/card/budget.js +134 -0
- package/dist/feishu/card/renderer.d.ts +29 -0
- package/dist/feishu/card/renderer.js +245 -0
- package/dist/feishu/card/run-state-types.d.ts +49 -0
- package/dist/feishu/card/run-state-types.js +15 -0
- package/dist/feishu/card/run-state.d.ts +21 -0
- package/dist/feishu/card/run-state.js +223 -0
- package/dist/feishu/channel/channel.d.ts +52 -0
- package/dist/feishu/channel/channel.js +74 -0
- package/dist/feishu/config.d.ts +24 -0
- package/dist/feishu/config.js +97 -0
- package/dist/feishu/format.d.ts +6 -0
- package/dist/feishu/format.js +14 -0
- package/dist/feishu/index.d.ts +4 -0
- package/dist/feishu/index.js +4 -0
- package/dist/feishu/logger.d.ts +31 -0
- package/dist/feishu/logger.js +62 -0
- package/dist/feishu/paths.d.ts +12 -0
- package/dist/feishu/paths.js +38 -0
- package/dist/feishu/process-registry.d.ts +29 -0
- package/dist/feishu/process-registry.js +90 -0
- package/dist/feishu/router/commands.d.ts +38 -0
- package/dist/feishu/router/commands.js +286 -0
- package/dist/feishu/router/event-router.d.ts +40 -0
- package/dist/feishu/router/event-router.js +208 -0
- package/dist/feishu/router/whitelist.d.ts +23 -0
- package/dist/feishu/router/whitelist.js +20 -0
- package/dist/feishu/runtime/active-runs.d.ts +32 -0
- package/dist/feishu/runtime/active-runs.js +84 -0
- package/dist/feishu/runtime/pending-queue.d.ts +36 -0
- package/dist/feishu/runtime/pending-queue.js +98 -0
- package/dist/feishu/runtime/process-pool.d.ts +29 -0
- package/dist/feishu/runtime/process-pool.js +49 -0
- package/dist/feishu/schema.d.ts +17 -0
- package/dist/feishu/schema.js +252 -0
- package/dist/feishu/scope/scope-registry.d.ts +39 -0
- package/dist/feishu/scope/scope-registry.js +148 -0
- package/dist/feishu/scope/session-binder.d.ts +44 -0
- package/dist/feishu/scope/session-binder.js +100 -0
- package/dist/feishu/scope/session-store.d.ts +24 -0
- package/dist/feishu/scope/session-store.js +73 -0
- package/dist/feishu/secrets.d.ts +37 -0
- package/dist/feishu/secrets.js +129 -0
- package/dist/feishu/serve.d.ts +12 -0
- package/dist/feishu/serve.js +302 -0
- package/dist/feishu/types.d.ts +75 -0
- package/dist/feishu/types.js +23 -0
- package/dist/feishu/wizard.d.ts +24 -0
- package/dist/feishu/wizard.js +121 -0
- package/dist/goal/command.d.ts +20 -0
- package/dist/goal/command.js +76 -0
- package/dist/goal/engine.d.ts +33 -0
- package/dist/goal/engine.js +65 -0
- package/dist/goal/format.d.ts +18 -0
- package/dist/goal/format.js +112 -0
- package/dist/goal/prompts.d.ts +13 -0
- package/dist/goal/prompts.js +84 -0
- package/dist/goal/store.d.ts +64 -0
- package/dist/goal/store.js +174 -0
- package/dist/goal/tools.d.ts +13 -0
- package/dist/goal/tools.js +67 -0
- package/dist/goal/usage.d.ts +2 -0
- package/dist/goal/usage.js +3 -0
- package/dist/hooks/config.d.ts +9 -0
- package/dist/hooks/config.js +278 -0
- package/dist/hooks/controller.d.ts +24 -0
- package/dist/hooks/controller.js +254 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/log.d.ts +14 -0
- package/dist/hooks/log.js +54 -0
- package/dist/hooks/runner.d.ts +5 -0
- package/dist/hooks/runner.js +225 -0
- package/dist/hooks/trust.d.ts +37 -0
- package/dist/hooks/trust.js +143 -0
- package/dist/hooks/types.d.ts +173 -0
- package/dist/hooks/types.js +46 -0
- package/dist/loop/engine.d.ts +29 -0
- package/dist/loop/engine.js +63 -0
- package/dist/lsp/config.d.ts +18 -0
- package/dist/lsp/config.js +58 -0
- package/dist/lsp/diagnostics.d.ts +24 -0
- package/dist/lsp/diagnostics.js +103 -0
- package/dist/lsp/index.d.ts +3 -0
- package/dist/lsp/index.js +3 -0
- package/dist/lsp/service.d.ts +97 -0
- package/dist/lsp/service.js +815 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.js +984 -0
- package/dist/mcp/client.d.ts +68 -0
- package/dist/mcp/client.js +177 -0
- package/dist/mcp/config.d.ts +30 -0
- package/dist/mcp/config.js +144 -0
- package/dist/mcp/manager.d.ts +67 -0
- package/dist/mcp/manager.js +328 -0
- package/dist/mcp/name.d.ts +26 -0
- package/dist/mcp/name.js +40 -0
- package/dist/mcp/transports.d.ts +54 -0
- package/dist/mcp/transports.js +267 -0
- package/dist/mcp/types.d.ts +111 -0
- package/dist/mcp/types.js +14 -0
- package/dist/memory/db.d.ts +65 -0
- package/dist/memory/db.js +332 -0
- package/dist/memory/index.d.ts +10 -0
- package/dist/memory/index.js +10 -0
- package/dist/memory/paths.d.ts +18 -0
- package/dist/memory/paths.js +38 -0
- package/dist/memory/phase1.d.ts +23 -0
- package/dist/memory/phase1.js +292 -0
- package/dist/memory/phase2.d.ts +19 -0
- package/dist/memory/phase2.js +119 -0
- package/dist/memory/prompts.d.ts +19 -0
- package/dist/memory/prompts.js +104 -0
- package/dist/memory/reset.d.ts +1 -0
- package/dist/memory/reset.js +13 -0
- package/dist/memory/session-policy.d.ts +25 -0
- package/dist/memory/session-policy.js +55 -0
- package/dist/memory/start.d.ts +24 -0
- package/dist/memory/start.js +50 -0
- package/dist/memory/storage.d.ts +11 -0
- package/dist/memory/storage.js +95 -0
- package/dist/memory/store.d.ts +43 -0
- package/dist/memory/store.js +193 -0
- package/dist/memory/usage.d.ts +1 -0
- package/dist/memory/usage.js +38 -0
- package/dist/model-catalog.d.ts +65 -0
- package/dist/model-catalog.js +387 -0
- package/dist/model-config.d.ts +40 -0
- package/dist/model-config.js +74 -0
- package/dist/model-data.generated.d.ts +16 -0
- package/dist/model-data.generated.js +275 -0
- package/dist/model-pricing.d.ts +54 -0
- package/dist/model-pricing.js +244 -0
- package/dist/model-selection.d.ts +7 -0
- package/dist/model-selection.js +18 -0
- package/dist/network/chatgpt-transport.d.ts +16 -0
- package/dist/network/chatgpt-transport.js +232 -0
- package/dist/network/errors.d.ts +47 -0
- package/dist/network/errors.js +48 -0
- package/dist/network/provider-transport-log.d.ts +12 -0
- package/dist/network/provider-transport-log.js +32 -0
- package/dist/network/provider-transport.d.ts +37 -0
- package/dist/network/provider-transport.js +256 -0
- package/dist/network/retry.d.ts +34 -0
- package/dist/network/retry.js +97 -0
- package/dist/network/system-proxy.d.ts +18 -0
- package/dist/network/system-proxy.js +175 -0
- package/dist/oauth/grok.d.ts +26 -0
- package/dist/oauth/grok.js +251 -0
- package/dist/oauth/index.d.ts +4 -0
- package/dist/oauth/index.js +3 -0
- package/dist/oauth/openai-codex.d.ts +15 -0
- package/dist/oauth/openai-codex.js +193 -0
- package/dist/oauth/refresh-control.d.ts +12 -0
- package/dist/oauth/refresh-control.js +42 -0
- package/dist/oauth/storage.d.ts +88 -0
- package/dist/oauth/storage.js +357 -0
- package/dist/oauth/types.d.ts +15 -0
- package/dist/oauth/types.js +1 -0
- package/dist/orchestrator/default-hooks.d.ts +22 -0
- package/dist/orchestrator/default-hooks.js +127 -0
- package/dist/orchestrator/hooks.d.ts +69 -0
- package/dist/orchestrator/hooks.js +52 -0
- package/dist/permission/mode.d.ts +19 -0
- package/dist/permission/mode.js +16 -0
- package/dist/permissions/rule.d.ts +42 -0
- package/dist/permissions/rule.js +293 -0
- package/dist/permissions/settings.d.ts +97 -0
- package/dist/permissions/settings.js +289 -0
- package/dist/permissions/shell-command.d.ts +36 -0
- package/dist/permissions/shell-command.js +226 -0
- package/dist/permissions/trust-prompt.d.ts +10 -0
- package/dist/permissions/trust-prompt.js +34 -0
- package/dist/permissions/trust.d.ts +26 -0
- package/dist/permissions/trust.js +113 -0
- package/dist/permissions/types.d.ts +61 -0
- package/dist/permissions/types.js +14 -0
- package/dist/print-output.d.ts +98 -0
- package/dist/print-output.js +117 -0
- package/dist/prompt/compose.d.ts +19 -0
- package/dist/prompt/compose.js +110 -0
- package/dist/prompt/delegation.d.ts +14 -0
- package/dist/prompt/delegation.js +100 -0
- package/dist/prompt/environment.d.ts +12 -0
- package/dist/prompt/environment.js +55 -0
- package/dist/prompt/provider-prompts/anthropic.d.ts +1 -0
- package/dist/prompt/provider-prompts/anthropic.js +5 -0
- package/dist/prompt/provider-prompts/codex.d.ts +1 -0
- package/dist/prompt/provider-prompts/codex.js +5 -0
- package/dist/prompt/provider-prompts/deepseek.d.ts +1 -0
- package/dist/prompt/provider-prompts/deepseek.js +7 -0
- package/dist/prompt/provider-prompts/default.d.ts +1 -0
- package/dist/prompt/provider-prompts/default.js +6 -0
- package/dist/prompt/provider-prompts/gemini.d.ts +1 -0
- package/dist/prompt/provider-prompts/gemini.js +5 -0
- package/dist/prompt/provider-prompts/glm.d.ts +1 -0
- package/dist/prompt/provider-prompts/glm.js +7 -0
- package/dist/prompt/provider-prompts/gpt.d.ts +1 -0
- package/dist/prompt/provider-prompts/gpt.js +5 -0
- package/dist/prompt/provider-prompts/kimi.d.ts +1 -0
- package/dist/prompt/provider-prompts/kimi.js +8 -0
- package/dist/prompt/reminders.d.ts +33 -0
- package/dist/prompt/reminders.js +135 -0
- package/dist/prompt/routing.d.ts +14 -0
- package/dist/prompt/routing.js +71 -0
- package/dist/prompt/runtime.d.ts +12 -0
- package/dist/prompt/runtime.js +40 -0
- package/dist/prompt/task-reminders.d.ts +12 -0
- package/dist/prompt/task-reminders.js +64 -0
- package/dist/provider-ai-sdk.d.ts +59 -0
- package/dist/provider-ai-sdk.js +541 -0
- package/dist/provider-anthropic.d.ts +126 -0
- package/dist/provider-anthropic.js +940 -0
- package/dist/provider-ark-responses.d.ts +29 -0
- package/dist/provider-ark-responses.js +518 -0
- package/dist/provider-artifacts.d.ts +7 -0
- package/dist/provider-artifacts.js +60 -0
- package/dist/provider-error-record.d.ts +43 -0
- package/dist/provider-error-record.js +213 -0
- package/dist/provider-grok.d.ts +50 -0
- package/dist/provider-grok.js +110 -0
- package/dist/provider-model-policy.d.ts +16 -0
- package/dist/provider-model-policy.js +33 -0
- package/dist/provider-openai-codex.d.ts +66 -0
- package/dist/provider-openai-codex.js +781 -0
- package/dist/provider-registry.d.ts +197 -0
- package/dist/provider-registry.js +1194 -0
- package/dist/provider-transform.d.ts +12 -0
- package/dist/provider-transform.js +293 -0
- package/dist/provider-zen-errors.d.ts +9 -0
- package/dist/provider-zen-errors.js +36 -0
- package/dist/provider.d.ts +85 -0
- package/dist/provider.js +925 -0
- package/dist/question/controller.d.ts +22 -0
- package/dist/question/controller.js +98 -0
- package/dist/question/index.d.ts +2 -0
- package/dist/question/index.js +2 -0
- package/dist/question/normalize.d.ts +6 -0
- package/dist/question/normalize.js +11 -0
- package/dist/question/types.d.ts +42 -0
- package/dist/question/types.js +6 -0
- package/dist/reasoning-debug.d.ts +7 -0
- package/dist/reasoning-debug.js +33 -0
- package/dist/rewind.d.ts +20 -0
- package/dist/rewind.js +29 -0
- package/dist/sdk/index.d.ts +319 -0
- package/dist/sdk/index.js +1068 -0
- package/dist/sdk/replay-event-log.d.ts +26 -0
- package/dist/sdk/replay-event-log.js +122 -0
- package/dist/sdk/session-turn-coordinator.d.ts +45 -0
- package/dist/sdk/session-turn-coordinator.js +227 -0
- package/dist/session-context-fence.d.ts +16 -0
- package/dist/session-context-fence.js +26 -0
- package/dist/session-log.d.ts +25 -0
- package/dist/session-log.js +444 -0
- package/dist/session-title.d.ts +16 -0
- package/dist/session-title.js +131 -0
- package/dist/session-types.d.ts +86 -0
- package/dist/session-types.js +1 -0
- package/dist/session.d.ts +135 -0
- package/dist/session.js +664 -0
- package/dist/skills/discovery.d.ts +12 -0
- package/dist/skills/discovery.js +166 -0
- package/dist/skills/format.d.ts +32 -0
- package/dist/skills/format.js +68 -0
- package/dist/skills/frontmatter.d.ts +5 -0
- package/dist/skills/frontmatter.js +60 -0
- package/dist/skills/invocation.d.ts +8 -0
- package/dist/skills/invocation.js +33 -0
- package/dist/skills/registry.d.ts +28 -0
- package/dist/skills/registry.js +79 -0
- package/dist/skills/types.d.ts +34 -0
- package/dist/skills/types.js +1 -0
- package/dist/slash-commands/commands.d.ts +10 -0
- package/dist/slash-commands/commands.js +1251 -0
- package/dist/slash-commands/feishu.d.ts +17 -0
- package/dist/slash-commands/feishu.js +400 -0
- package/dist/slash-commands/index.d.ts +4 -0
- package/dist/slash-commands/index.js +8 -0
- package/dist/slash-commands/registry.d.ts +32 -0
- package/dist/slash-commands/registry.js +73 -0
- package/dist/slash-commands/types.d.ts +109 -0
- package/dist/slash-commands/types.js +1 -0
- package/dist/slash-commands/unified.d.ts +38 -0
- package/dist/slash-commands/unified.js +38 -0
- package/dist/stats/usage.d.ts +59 -0
- package/dist/stats/usage.js +485 -0
- package/dist/stream-json.d.ts +13 -0
- package/dist/stream-json.js +74 -0
- package/dist/system-prompt.d.ts +40 -0
- package/dist/system-prompt.js +7 -0
- package/dist/tasks/manager.d.ts +145 -0
- package/dist/tasks/manager.js +634 -0
- package/dist/tasks/process-utils.d.ts +10 -0
- package/dist/tasks/process-utils.js +49 -0
- package/dist/tasks/promotion.d.ts +17 -0
- package/dist/tasks/promotion.js +30 -0
- package/dist/tasks/wake.d.ts +53 -0
- package/dist/tasks/wake.js +125 -0
- package/dist/text-display.d.ts +3 -0
- package/dist/text-display.js +25 -0
- package/dist/tools/agent-lifecycle.d.ts +30 -0
- package/dist/tools/agent-lifecycle.js +790 -0
- package/dist/tools/bash.d.ts +23 -0
- package/dist/tools/bash.js +443 -0
- package/dist/tools/child-tools.d.ts +41 -0
- package/dist/tools/child-tools.js +122 -0
- package/dist/tools/edit-apply.d.ts +25 -0
- package/dist/tools/edit-apply.js +274 -0
- package/dist/tools/edit.d.ts +18 -0
- package/dist/tools/edit.js +200 -0
- package/dist/tools/exa-mcp.d.ts +3 -0
- package/dist/tools/exa-mcp.js +74 -0
- package/dist/tools/exit-plan-mode.d.ts +22 -0
- package/dist/tools/exit-plan-mode.js +79 -0
- package/dist/tools/file-mutation-queue.d.ts +2 -0
- package/dist/tools/file-mutation-queue.js +43 -0
- package/dist/tools/file-state.d.ts +48 -0
- package/dist/tools/file-state.js +76 -0
- package/dist/tools/grep.d.ts +9 -0
- package/dist/tools/grep.js +387 -0
- package/dist/tools/index.d.ts +63 -0
- package/dist/tools/index.js +76 -0
- package/dist/tools/ls.d.ts +3 -0
- package/dist/tools/ls.js +85 -0
- package/dist/tools/lsp.d.ts +4 -0
- package/dist/tools/lsp.js +95 -0
- package/dist/tools/memory.d.ts +8 -0
- package/dist/tools/memory.js +77 -0
- package/dist/tools/path-utils.d.ts +8 -0
- package/dist/tools/path-utils.js +53 -0
- package/dist/tools/prompt-metadata.d.ts +3 -0
- package/dist/tools/prompt-metadata.js +17 -0
- package/dist/tools/question.d.ts +3 -0
- package/dist/tools/question.js +177 -0
- package/dist/tools/read.d.ts +8 -0
- package/dist/tools/read.js +309 -0
- package/dist/tools/sensitive-paths.d.ts +11 -0
- package/dist/tools/sensitive-paths.js +106 -0
- package/dist/tools/server-manager.d.ts +6 -0
- package/dist/tools/server-manager.js +6 -0
- package/dist/tools/server.d.ts +6 -0
- package/dist/tools/server.js +249 -0
- package/dist/tools/skill-search.d.ts +10 -0
- package/dist/tools/skill-search.js +134 -0
- package/dist/tools/skill.d.ts +7 -0
- package/dist/tools/skill.js +81 -0
- package/dist/tools/task-tools.d.ts +10 -0
- package/dist/tools/task-tools.js +133 -0
- package/dist/tools/tool-search.d.ts +23 -0
- package/dist/tools/tool-search.js +145 -0
- package/dist/tools/web-fetch.d.ts +6 -0
- package/dist/tools/web-fetch.js +76 -0
- package/dist/tools/web-search.d.ts +5 -0
- package/dist/tools/web-search.js +50 -0
- package/dist/tools/write.d.ts +10 -0
- package/dist/tools/write.js +155 -0
- 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 +1659 -0
- package/dist/tui/components/approval-dialog.d.ts +43 -0
- package/dist/tui/components/approval-dialog.js +212 -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 +63 -0
- package/dist/tui/components/skills-panel.js +582 -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 +398 -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 +126 -0
- package/dist/tui/components/tasks-pane.js +566 -0
- package/dist/tui/components/transcript.d.ts +103 -0
- package/dist/tui/components/transcript.js +858 -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 +76 -0
- package/dist/tui/composer-autocomplete.js +465 -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 +239 -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 +199 -0
- package/dist/tui/controller/controller.js +1034 -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/detect-theme.d.ts +4 -0
- package/dist/tui/detect-theme.js +116 -0
- package/dist/tui/display-history.d.ts +64 -0
- package/dist/tui/display-history.js +283 -0
- package/dist/tui/display-sanitizer.d.ts +3 -0
- package/dist/tui/display-sanitizer.js +38 -0
- package/dist/tui/edit-diff.d.ts +11 -0
- package/dist/tui/edit-diff.js +57 -0
- package/dist/tui/file-mentions.d.ts +29 -0
- package/dist/tui/file-mentions.js +174 -0
- package/dist/tui/footer.d.ts +37 -0
- package/dist/tui/footer.js +80 -0
- package/dist/tui/formatting/edit-diff.d.ts +11 -0
- package/dist/tui/formatting/edit-diff.js +52 -0
- package/dist/tui/formatting/summary.d.ts +43 -0
- package/dist/tui/formatting/summary.js +150 -0
- package/dist/tui/fullscreen.d.ts +48 -0
- package/dist/tui/fullscreen.js +256 -0
- package/dist/tui/image-display.d.ts +23 -0
- package/dist/tui/image-display.js +92 -0
- package/dist/tui/image-paste.d.ts +113 -0
- package/dist/tui/image-paste.js +565 -0
- package/dist/tui/input-history.d.ts +47 -0
- package/dist/tui/input-history.js +250 -0
- package/dist/tui/markdown-style.d.ts +5 -0
- package/dist/tui/markdown-style.js +23 -0
- package/dist/tui/model/composer-buffer.d.ts +55 -0
- package/dist/tui/model/composer-buffer.js +317 -0
- package/dist/tui/model/composer-types.d.ts +17 -0
- package/dist/tui/model/composer-types.js +1 -0
- package/dist/tui/model/display-history.d.ts +78 -0
- package/dist/tui/model/display-history.js +124 -0
- package/dist/tui/model/display-reconstruct.d.ts +3 -0
- package/dist/tui/model/display-reconstruct.js +130 -0
- package/dist/tui/model/file-mentions.d.ts +31 -0
- package/dist/tui/model/file-mentions.js +178 -0
- package/dist/tui/model/image-attachment.d.ts +15 -0
- package/dist/tui/model/image-attachment.js +1 -0
- package/dist/tui/model/image-paste.d.ts +119 -0
- package/dist/tui/model/image-paste.js +610 -0
- package/dist/tui/model/input-history.d.ts +1 -0
- package/dist/tui/model/input-history.js +1 -0
- package/dist/tui/model/input-queue.d.ts +12 -0
- package/dist/tui/model/input-queue.js +17 -0
- package/dist/tui/model/key-events.d.ts +9 -0
- package/dist/tui/model/key-events.js +8 -0
- package/dist/tui/model/paste-operation-tracker.d.ts +13 -0
- package/dist/tui/model/paste-operation-tracker.js +25 -0
- package/dist/tui/model/recent-activity.d.ts +8 -0
- package/dist/tui/model/recent-activity.js +71 -0
- package/dist/tui/model/subagent-view.d.ts +87 -0
- package/dist/tui/model/subagent-view.js +336 -0
- package/dist/tui/model/submit-dedupe.d.ts +5 -0
- package/dist/tui/model/submit-dedupe.js +25 -0
- package/dist/tui/model/sync-output.d.ts +17 -0
- package/dist/tui/model/sync-output.js +35 -0
- package/dist/tui/model/task-lifecycle.d.ts +57 -0
- package/dist/tui/model/task-lifecycle.js +124 -0
- package/dist/tui/model/terminal-env.d.ts +15 -0
- package/dist/tui/model/terminal-env.js +22 -0
- package/dist/tui/model/terminal-mouse.d.ts +28 -0
- package/dist/tui/model/terminal-mouse.js +82 -0
- package/dist/tui/model/theme-style.d.ts +10 -0
- package/dist/tui/model/theme-style.js +79 -0
- package/dist/tui/model/theme.d.ts +72 -0
- package/dist/tui/model/theme.js +121 -0
- package/dist/tui/model/trace-groups.d.ts +45 -0
- package/dist/tui/model/trace-groups.js +558 -0
- package/dist/tui/model/trace-interaction.d.ts +63 -0
- package/dist/tui/model/trace-interaction.js +87 -0
- package/dist/tui/model/width.d.ts +18 -0
- package/dist/tui/model/width.js +130 -0
- package/dist/tui/model-picker-data.d.ts +9 -0
- package/dist/tui/model-picker-data.js +39 -0
- package/dist/tui/model-switch.d.ts +49 -0
- package/dist/tui/model-switch.js +67 -0
- package/dist/tui/paste-placeholder.d.ts +11 -0
- package/dist/tui/paste-placeholder.js +52 -0
- package/dist/tui/recent-activity.d.ts +8 -0
- package/dist/tui/recent-activity.js +71 -0
- package/dist/tui/run-session-picker.d.ts +9 -0
- 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/session-display.d.ts +6 -0
- package/dist/tui/session-display.js +12 -0
- package/dist/tui/session-picker-data.d.ts +18 -0
- package/dist/tui/session-picker-data.js +21 -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.d.ts +43 -0
- package/dist/tui/trace-groups.js +554 -0
- package/dist/tui/wordmark.d.ts +18 -0
- package/dist/tui/wordmark.js +208 -0
- package/dist/types.d.ts +503 -0
- package/dist/types.js +4 -0
- package/dist/update/index.d.ts +61 -0
- package/dist/update/index.js +267 -0
- package/dist/variant/thinking-level.d.ts +5 -0
- package/dist/variant/thinking-level.js +26 -0
- package/dist/variant/variant-resolver.d.ts +28 -0
- package/dist/variant/variant-resolver.js +62 -0
- package/node_modules/@bubblebrain-ai/pi-tui/LICENSE +21 -0
- package/node_modules/@bubblebrain-ai/pi-tui/README.md +854 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.d.ts +26 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.js +121 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/alt-screen-search.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.d.ts +86 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.js +649 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/autocomplete.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.d.ts +13 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.js +36 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/alt-screen-flash.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.d.ts +22 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.js +99 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/box.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.js +36 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/cancellable-loader.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.d.ts +330 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.js +2344 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/editor.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.d.ts +7 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.js +43 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/h-stack.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.d.ts +28 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.js +82 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/image.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.d.ts +48 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.js +390 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/input.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.d.ts +31 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.js +67 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/loader.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.d.ts +103 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.js +797 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/markdown.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.d.ts +56 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.js +179 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/scroll-view.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.d.ts +53 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.js +175 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/select-list.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.d.ts +50 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.js +174 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/settings-list.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.d.ts +12 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.js +22 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/spacer.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.d.ts +32 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.js +109 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/stack.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.d.ts +19 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.js +81 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/text.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.d.ts +13 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.js +48 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/truncated-text.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.d.ts +8 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.js +26 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/components/v-stack.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.d.ts +39 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.js +2 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/editor-component.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.d.ts +16 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.js +110 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/fuzzy.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.d.ts +31 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.js +42 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/index.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.d.ts +273 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.js +231 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keybindings.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.d.ts +184 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.js +1174 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/keys.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.d.ts +28 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.js +46 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/kill-ring.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.d.ts +10 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.js +1268 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/latex.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.d.ts +40 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.js +6 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout-node.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.d.ts +42 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.js +335 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/layout.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.d.ts +3 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.js +60 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/native-modifiers.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.d.ts +56 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.js +363 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/stdin-buffer.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.d.ts +10 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.js +59 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-colors.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.d.ts +116 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.js +518 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal-image.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.d.ts +142 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.js +544 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/terminal.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.d.ts +11 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.d.ts.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.js +11 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/testing.js.map +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.d.ts +141 -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 +1340 -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 +340 -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 +1020 -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 +96 -17
- package/bin/bubble.js +0 -39
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { type Component, type TuiMouseEvent } from "@bubblebrain-ai/pi-tui";
|
|
2
|
+
import type { WorkflowRunSnapshot } from "../../agent/workflow/control.js";
|
|
3
|
+
import type { BackgroundTaskInfo } from "../../tasks/manager.js";
|
|
4
|
+
import { type Theme } from "../model/theme.js";
|
|
5
|
+
import { type SubagentDisplay, type SubagentGroup } from "../model/subagent-view.js";
|
|
6
|
+
export interface TasksPaneSnapshot {
|
|
7
|
+
groups: SubagentGroup[];
|
|
8
|
+
workflows: WorkflowRunSnapshot[];
|
|
9
|
+
tasks: BackgroundTaskInfo[];
|
|
10
|
+
/** Start of the current agent run; undefined keeps finished work hidden. */
|
|
11
|
+
turnStartedAt?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkflowPaneItem {
|
|
14
|
+
kind: "workflow";
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
status: string;
|
|
18
|
+
members: SubagentDisplay[];
|
|
19
|
+
createdAt?: number;
|
|
20
|
+
updatedAt?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface SubagentPaneItem {
|
|
23
|
+
kind: "subagent";
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
status: string;
|
|
27
|
+
member: SubagentDisplay;
|
|
28
|
+
}
|
|
29
|
+
export interface TaskPaneItem {
|
|
30
|
+
kind: "task";
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
status: string;
|
|
34
|
+
task: BackgroundTaskInfo;
|
|
35
|
+
}
|
|
36
|
+
export type PaneItem = WorkflowPaneItem | SubagentPaneItem | TaskPaneItem;
|
|
37
|
+
export interface TasksPaneCallbacks {
|
|
38
|
+
onRender(): void;
|
|
39
|
+
onOpenWorkflow(item: WorkflowPaneItem): void;
|
|
40
|
+
onOpenSubagent(item: SubagentPaneItem): void;
|
|
41
|
+
onOpenTask(item: TaskPaneItem): void;
|
|
42
|
+
onStopWorkflow(id: string): void;
|
|
43
|
+
onStopSubagent(id: string): void;
|
|
44
|
+
onStopTask(id: string): void;
|
|
45
|
+
onCopyTaskOutput?(id: string): void;
|
|
46
|
+
onEscape(): void;
|
|
47
|
+
}
|
|
48
|
+
export declare class TasksPaneComponent implements Component {
|
|
49
|
+
private readonly getSnapshot;
|
|
50
|
+
private readonly getTerminalRows;
|
|
51
|
+
private readonly callbacks;
|
|
52
|
+
private readonly getTheme;
|
|
53
|
+
focused: boolean;
|
|
54
|
+
private open;
|
|
55
|
+
private manuallyClosed;
|
|
56
|
+
/**
|
|
57
|
+
* History is a view the user opts into for one look, never a mode: it is
|
|
58
|
+
* dropped whenever the pane closes and when a new round of activity starts.
|
|
59
|
+
* Otherwise one Ctrl+G after a finished turn left every earlier subagent
|
|
60
|
+
* listed above the composer for the rest of the session, next to a header
|
|
61
|
+
* that counts only the running ones.
|
|
62
|
+
*/
|
|
63
|
+
private showHistory;
|
|
64
|
+
private selectedId?;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the user picked the selection (keys or click). The pane always
|
|
67
|
+
* needs one, so it defaults to the first row — but a default nobody chose
|
|
68
|
+
* must not steer the window: a task that was once the only row stayed
|
|
69
|
+
* "selected" and scrolled later subagents out of an untouched pane.
|
|
70
|
+
*/
|
|
71
|
+
private selectionIsUsers;
|
|
72
|
+
private hoveredId?;
|
|
73
|
+
private lastActiveCount;
|
|
74
|
+
private lastTurnStartedAt;
|
|
75
|
+
private lastRows;
|
|
76
|
+
private allRows;
|
|
77
|
+
private frame;
|
|
78
|
+
private readonly collapsed;
|
|
79
|
+
constructor(getSnapshot: () => TasksPaneSnapshot, getTerminalRows: () => number, callbacks: TasksPaneCallbacks, getTheme?: () => Theme);
|
|
80
|
+
isAnimationActive(): boolean;
|
|
81
|
+
advanceAnimationFrame(): boolean;
|
|
82
|
+
dispose(): void;
|
|
83
|
+
invalidate(): void;
|
|
84
|
+
isOpen(): boolean;
|
|
85
|
+
isAvailable(): boolean;
|
|
86
|
+
activeCount(): number;
|
|
87
|
+
/** Rows the default view lists: running work plus what this turn launched. */
|
|
88
|
+
defaultViewCount(): number;
|
|
89
|
+
visibleCount(): number;
|
|
90
|
+
/**
|
|
91
|
+
* Finished rows the pane lists next to the running ones, by outcome. Counted
|
|
92
|
+
* in the pane's current view, history included when it is showing, so the
|
|
93
|
+
* header never reports fewer rows than the list holds.
|
|
94
|
+
*/
|
|
95
|
+
settledCounts(): {
|
|
96
|
+
done: number;
|
|
97
|
+
failed: number;
|
|
98
|
+
stopped: number;
|
|
99
|
+
};
|
|
100
|
+
totalCount(): number;
|
|
101
|
+
activityGlyph(): string;
|
|
102
|
+
theme(): Theme;
|
|
103
|
+
toggle(forceFocus?: boolean): void;
|
|
104
|
+
close(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Advance open/history state from the latest snapshot. Both the status bar
|
|
107
|
+
* and the pane call this before rendering: the bar is laid out first, so a
|
|
108
|
+
* transition made only inside the pane's render would leave the bar one
|
|
109
|
+
* frame behind — forever, when nothing is animating to trigger a redraw.
|
|
110
|
+
* Idempotent per snapshot (it compares against the last values it saw).
|
|
111
|
+
*/
|
|
112
|
+
syncState(): void;
|
|
113
|
+
render(width: number): string[];
|
|
114
|
+
private renderItem;
|
|
115
|
+
handleInput(data: string): void;
|
|
116
|
+
handleMouse(event: TuiMouseEvent): boolean;
|
|
117
|
+
private openItem;
|
|
118
|
+
private stopItem;
|
|
119
|
+
}
|
|
120
|
+
export declare class TaskStatusBarComponent implements Component {
|
|
121
|
+
private readonly pane;
|
|
122
|
+
constructor(pane: TasksPaneComponent);
|
|
123
|
+
render(width: number): string[];
|
|
124
|
+
handleMouse(event: TuiMouseEvent): boolean;
|
|
125
|
+
invalidate(): void;
|
|
126
|
+
}
|
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
import { matchesKey, truncateToWidth, visibleWidth, } from "@bubblebrain-ai/pi-tui";
|
|
2
|
+
import { darkTheme } from "../model/theme.js";
|
|
3
|
+
import { themeBackground, themeDim, themeForeground } from "../model/theme-style.js";
|
|
4
|
+
import { safeSheetText } from "./bottom-sheet.js";
|
|
5
|
+
import { latestSubagentNote, } from "../model/subagent-view.js";
|
|
6
|
+
const FINAL = new Set(["completed", "failed", "blocked", "cancelled", "closed", "killed"]);
|
|
7
|
+
const SPINNER = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
8
|
+
function isActive(status) {
|
|
9
|
+
return !FINAL.has(status);
|
|
10
|
+
}
|
|
11
|
+
function safe(value) {
|
|
12
|
+
return safeSheetText(value).replace(/[\r\n\t]+/g, " ").trim();
|
|
13
|
+
}
|
|
14
|
+
function pad(line, width) {
|
|
15
|
+
const clipped = truncateToWidth(line, width, "");
|
|
16
|
+
return clipped + " ".repeat(Math.max(0, width - visibleWidth(clipped)));
|
|
17
|
+
}
|
|
18
|
+
function paint(line, width, state, theme = darkTheme) {
|
|
19
|
+
const filled = pad(line, width);
|
|
20
|
+
if (state === "selected")
|
|
21
|
+
return themeBackground(theme.traceSelectedBg, filled);
|
|
22
|
+
if (state === "hover")
|
|
23
|
+
return themeBackground(theme.traceHoverBg, filled);
|
|
24
|
+
return filled;
|
|
25
|
+
}
|
|
26
|
+
function statusGlyph(status, frame, theme = darkTheme) {
|
|
27
|
+
if (status === "completed" || status === "closed")
|
|
28
|
+
return themeForeground(theme.success, "✓");
|
|
29
|
+
if (status === "failed" || status === "blocked")
|
|
30
|
+
return themeForeground(theme.error, "×");
|
|
31
|
+
if (status === "cancelled" || status === "killed")
|
|
32
|
+
return themeForeground(theme.muted, "■");
|
|
33
|
+
if (status === "queued")
|
|
34
|
+
return themeForeground(theme.muted, "○");
|
|
35
|
+
return themeForeground(theme.accent, SPINNER[frame % SPINNER.length]);
|
|
36
|
+
}
|
|
37
|
+
function elapsed(createdAt, updatedAt, active = true) {
|
|
38
|
+
if (!createdAt)
|
|
39
|
+
return "";
|
|
40
|
+
const ms = Math.max(0, (active ? Date.now() : updatedAt ?? Date.now()) - createdAt);
|
|
41
|
+
const seconds = Math.floor(ms / 1000);
|
|
42
|
+
if (seconds < 60)
|
|
43
|
+
return `${seconds}s`;
|
|
44
|
+
const minutes = Math.floor(seconds / 60);
|
|
45
|
+
return minutes < 60 ? `${minutes}m` : `${Math.floor(minutes / 60)}h${minutes % 60}m`;
|
|
46
|
+
}
|
|
47
|
+
function usageLabel(member) {
|
|
48
|
+
const usage = member.usage;
|
|
49
|
+
if (!usage)
|
|
50
|
+
return "";
|
|
51
|
+
const total = usage.promptTokens + usage.completionTokens;
|
|
52
|
+
return total >= 1000 ? `${(total / 1000).toFixed(total < 10_000 ? 1 : 0)}k` : String(total);
|
|
53
|
+
}
|
|
54
|
+
function workflowMembers(workflow, groups) {
|
|
55
|
+
if (workflow.snapshots.length > 0) {
|
|
56
|
+
return workflow.snapshots.map((snapshot) => ({
|
|
57
|
+
subAgentId: snapshot.agentId,
|
|
58
|
+
agentName: snapshot.agentName,
|
|
59
|
+
nickname: snapshot.nickname,
|
|
60
|
+
status: snapshot.status,
|
|
61
|
+
category: snapshot.category,
|
|
62
|
+
phase: snapshot.phase,
|
|
63
|
+
route: snapshot.route,
|
|
64
|
+
task: snapshot.task,
|
|
65
|
+
summary: snapshot.summary,
|
|
66
|
+
toolNotes: snapshot.toolNotes,
|
|
67
|
+
error: snapshot.error,
|
|
68
|
+
usage: snapshot.usage,
|
|
69
|
+
createdAt: snapshot.createdAt,
|
|
70
|
+
updatedAt: snapshot.updatedAt,
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
return groups.find((group) => group.kind === "workflow" && group.runId === workflow.runId)?.members ?? [];
|
|
74
|
+
}
|
|
75
|
+
function normalize(snapshot, showHistory) {
|
|
76
|
+
const workflowItems = snapshot.workflows.map((workflow) => ({
|
|
77
|
+
kind: "workflow",
|
|
78
|
+
id: workflow.runId,
|
|
79
|
+
title: workflow.title,
|
|
80
|
+
status: workflow.status,
|
|
81
|
+
members: workflowMembers(workflow, snapshot.groups),
|
|
82
|
+
createdAt: workflow.createdAt,
|
|
83
|
+
updatedAt: workflow.updatedAt,
|
|
84
|
+
}));
|
|
85
|
+
const knownWorkflowRuns = new Set(snapshot.workflows.map((workflow) => workflow.runId));
|
|
86
|
+
for (const group of snapshot.groups) {
|
|
87
|
+
if (group.kind !== "workflow" || (group.runId && knownWorkflowRuns.has(group.runId)))
|
|
88
|
+
continue;
|
|
89
|
+
const statuses = group.members.map((member) => member.status ?? "running");
|
|
90
|
+
const status = statuses.some(isActive)
|
|
91
|
+
? "running"
|
|
92
|
+
: statuses.some((value) => value === "failed" || value === "blocked") ? "failed" : "completed";
|
|
93
|
+
workflowItems.push({
|
|
94
|
+
kind: "workflow",
|
|
95
|
+
id: group.runId ?? group.id,
|
|
96
|
+
title: group.label,
|
|
97
|
+
status,
|
|
98
|
+
members: group.members,
|
|
99
|
+
createdAt: group.members.map((member) => member.createdAt).filter((value) => value !== undefined).sort()[0],
|
|
100
|
+
updatedAt: Math.max(0, ...group.members.map((member) => member.updatedAt ?? 0)),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const subagentItems = snapshot.groups
|
|
104
|
+
.filter((group) => group.kind !== "workflow")
|
|
105
|
+
.flatMap((group) => group.members.map((member) => ({
|
|
106
|
+
kind: "subagent",
|
|
107
|
+
id: member.subAgentId ?? group.id,
|
|
108
|
+
title: member.nickname ?? member.agentName ?? group.label,
|
|
109
|
+
status: member.status ?? "running",
|
|
110
|
+
member,
|
|
111
|
+
})));
|
|
112
|
+
const taskItems = snapshot.tasks.map((task) => ({
|
|
113
|
+
kind: "task",
|
|
114
|
+
id: task.id,
|
|
115
|
+
title: task.description || task.command,
|
|
116
|
+
status: task.status,
|
|
117
|
+
task,
|
|
118
|
+
}));
|
|
119
|
+
// Which rows belong above the composer is derived, not remembered: whatever
|
|
120
|
+
// is still running, plus whatever this turn launched — so a sibling that
|
|
121
|
+
// finishes (or fails) first stays in view with its outcome until the next
|
|
122
|
+
// turn, whether its siblings ran in parallel or one after another. Work from
|
|
123
|
+
// earlier turns is history and shows only on request.
|
|
124
|
+
const launchedThisTurn = (item) => {
|
|
125
|
+
const launchedAt = itemLaunchedAt(item);
|
|
126
|
+
return snapshot.turnStartedAt !== undefined && launchedAt !== undefined && launchedAt >= snapshot.turnStartedAt;
|
|
127
|
+
};
|
|
128
|
+
const filter = (items) => (showHistory
|
|
129
|
+
? items
|
|
130
|
+
: items.filter((item) => isActive(item.status) || launchedThisTurn(item)))
|
|
131
|
+
.sort((left, right) => {
|
|
132
|
+
const activityOrder = Number(isActive(right.status)) - Number(isActive(left.status));
|
|
133
|
+
if (activityOrder !== 0)
|
|
134
|
+
return activityOrder;
|
|
135
|
+
return itemUpdatedAt(right) - itemUpdatedAt(left);
|
|
136
|
+
});
|
|
137
|
+
return {
|
|
138
|
+
workflows: filter(workflowItems),
|
|
139
|
+
subagents: filter(subagentItems),
|
|
140
|
+
tasks: filter(taskItems),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function itemLaunchedAt(item) {
|
|
144
|
+
if (item.kind === "workflow")
|
|
145
|
+
return item.createdAt;
|
|
146
|
+
if (item.kind === "subagent")
|
|
147
|
+
return item.member.createdAt;
|
|
148
|
+
return item.task.startedAt;
|
|
149
|
+
}
|
|
150
|
+
function itemUpdatedAt(item) {
|
|
151
|
+
if (item.kind === "workflow")
|
|
152
|
+
return item.updatedAt ?? item.createdAt ?? 0;
|
|
153
|
+
if (item.kind === "subagent")
|
|
154
|
+
return item.member.updatedAt ?? item.member.createdAt ?? 0;
|
|
155
|
+
return item.task.endedAt ?? item.task.startedAt;
|
|
156
|
+
}
|
|
157
|
+
export class TasksPaneComponent {
|
|
158
|
+
getSnapshot;
|
|
159
|
+
getTerminalRows;
|
|
160
|
+
callbacks;
|
|
161
|
+
getTheme;
|
|
162
|
+
focused = false;
|
|
163
|
+
open = false;
|
|
164
|
+
manuallyClosed = false;
|
|
165
|
+
/**
|
|
166
|
+
* History is a view the user opts into for one look, never a mode: it is
|
|
167
|
+
* dropped whenever the pane closes and when a new round of activity starts.
|
|
168
|
+
* Otherwise one Ctrl+G after a finished turn left every earlier subagent
|
|
169
|
+
* listed above the composer for the rest of the session, next to a header
|
|
170
|
+
* that counts only the running ones.
|
|
171
|
+
*/
|
|
172
|
+
showHistory = false;
|
|
173
|
+
selectedId;
|
|
174
|
+
/**
|
|
175
|
+
* Whether the user picked the selection (keys or click). The pane always
|
|
176
|
+
* needs one, so it defaults to the first row — but a default nobody chose
|
|
177
|
+
* must not steer the window: a task that was once the only row stayed
|
|
178
|
+
* "selected" and scrolled later subagents out of an untouched pane.
|
|
179
|
+
*/
|
|
180
|
+
selectionIsUsers = false;
|
|
181
|
+
hoveredId;
|
|
182
|
+
lastActiveCount = 0;
|
|
183
|
+
lastTurnStartedAt;
|
|
184
|
+
lastRows = [];
|
|
185
|
+
allRows = [];
|
|
186
|
+
frame = 0;
|
|
187
|
+
collapsed = new Set();
|
|
188
|
+
constructor(getSnapshot, getTerminalRows, callbacks, getTheme = () => darkTheme) {
|
|
189
|
+
this.getSnapshot = getSnapshot;
|
|
190
|
+
this.getTerminalRows = getTerminalRows;
|
|
191
|
+
this.callbacks = callbacks;
|
|
192
|
+
this.getTheme = getTheme;
|
|
193
|
+
}
|
|
194
|
+
isAnimationActive() {
|
|
195
|
+
return this.isAvailable() && this.activeCount() > 0;
|
|
196
|
+
}
|
|
197
|
+
advanceAnimationFrame() {
|
|
198
|
+
if (!this.isAnimationActive())
|
|
199
|
+
return false;
|
|
200
|
+
this.frame = (this.frame + 1) % SPINNER.length;
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
dispose() { }
|
|
204
|
+
invalidate() { }
|
|
205
|
+
isOpen() {
|
|
206
|
+
return this.open && this.getTerminalRows() >= 12;
|
|
207
|
+
}
|
|
208
|
+
isAvailable() {
|
|
209
|
+
return this.getTerminalRows() >= 12;
|
|
210
|
+
}
|
|
211
|
+
activeCount() {
|
|
212
|
+
const items = normalize(this.getSnapshot(), true);
|
|
213
|
+
return Object.values(items).flat().filter((item) => isActive(item.status)).length;
|
|
214
|
+
}
|
|
215
|
+
/** Rows the default view lists: running work plus what this turn launched. */
|
|
216
|
+
defaultViewCount() {
|
|
217
|
+
return Object.values(normalize(this.getSnapshot(), false)).flat().length;
|
|
218
|
+
}
|
|
219
|
+
visibleCount() {
|
|
220
|
+
return Object.values(normalize(this.getSnapshot(), this.showHistory)).flat().length;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Finished rows the pane lists next to the running ones, by outcome. Counted
|
|
224
|
+
* in the pane's current view, history included when it is showing, so the
|
|
225
|
+
* header never reports fewer rows than the list holds.
|
|
226
|
+
*/
|
|
227
|
+
settledCounts() {
|
|
228
|
+
const counts = { done: 0, failed: 0, stopped: 0 };
|
|
229
|
+
for (const item of Object.values(normalize(this.getSnapshot(), this.showHistory)).flat()) {
|
|
230
|
+
if (isActive(item.status))
|
|
231
|
+
continue;
|
|
232
|
+
if (item.status === "failed" || item.status === "blocked")
|
|
233
|
+
counts.failed += 1;
|
|
234
|
+
else if (item.status === "cancelled" || item.status === "killed")
|
|
235
|
+
counts.stopped += 1;
|
|
236
|
+
else
|
|
237
|
+
counts.done += 1;
|
|
238
|
+
}
|
|
239
|
+
return counts;
|
|
240
|
+
}
|
|
241
|
+
totalCount() {
|
|
242
|
+
const items = normalize(this.getSnapshot(), true);
|
|
243
|
+
return Object.values(items).flat().length;
|
|
244
|
+
}
|
|
245
|
+
activityGlyph() {
|
|
246
|
+
return SPINNER[this.frame % SPINNER.length];
|
|
247
|
+
}
|
|
248
|
+
theme() {
|
|
249
|
+
return this.getTheme();
|
|
250
|
+
}
|
|
251
|
+
toggle(forceFocus = false) {
|
|
252
|
+
if (this.open && !forceFocus) {
|
|
253
|
+
this.open = false;
|
|
254
|
+
this.manuallyClosed = true;
|
|
255
|
+
this.showHistory = false;
|
|
256
|
+
// Closing through the status bar (a click) bypasses the app's Ctrl+G
|
|
257
|
+
// handler. A pane that still owned the keyboard would swallow input while
|
|
258
|
+
// invisible — and the bar itself can now be hidden — so hand focus back.
|
|
259
|
+
if (this.focused) {
|
|
260
|
+
this.focused = false;
|
|
261
|
+
this.callbacks.onEscape();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
this.open = true;
|
|
266
|
+
this.manuallyClosed = false;
|
|
267
|
+
// Once all activity has settled, Ctrl+G must remain a usable route back
|
|
268
|
+
// to the completed child transcript. Opening an empty active-only pane
|
|
269
|
+
// makes the work look lost even though the child session still exists.
|
|
270
|
+
// This turn's rows (what the bar counts) open first; older history only
|
|
271
|
+
// when there is nothing else to show, and behind `h` otherwise.
|
|
272
|
+
if (this.activeCount() === 0 && this.defaultViewCount() === 0 && this.totalCount() > 0)
|
|
273
|
+
this.showHistory = true;
|
|
274
|
+
}
|
|
275
|
+
this.callbacks.onRender();
|
|
276
|
+
}
|
|
277
|
+
close() {
|
|
278
|
+
this.open = false;
|
|
279
|
+
this.manuallyClosed = true;
|
|
280
|
+
this.showHistory = false;
|
|
281
|
+
this.callbacks.onRender();
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Advance open/history state from the latest snapshot. Both the status bar
|
|
285
|
+
* and the pane call this before rendering: the bar is laid out first, so a
|
|
286
|
+
* transition made only inside the pane's render would leave the bar one
|
|
287
|
+
* frame behind — forever, when nothing is animating to trigger a redraw.
|
|
288
|
+
* Idempotent per snapshot (it compares against the last values it saw).
|
|
289
|
+
*/
|
|
290
|
+
syncState() {
|
|
291
|
+
if (this.getTerminalRows() < 12)
|
|
292
|
+
return;
|
|
293
|
+
const activeCount = this.activeCount();
|
|
294
|
+
// A new run, or activity starting from idle, ends the history view. The
|
|
295
|
+
// run boundary matters on its own: with a task still running the count
|
|
296
|
+
// never crosses zero, and new work would otherwise keep listing history.
|
|
297
|
+
// A user who is browsing history inside the pane keeps their rows; the
|
|
298
|
+
// view resets when they close it.
|
|
299
|
+
const turnStartedAt = this.getSnapshot().turnStartedAt;
|
|
300
|
+
const newTurn = turnStartedAt !== this.lastTurnStartedAt;
|
|
301
|
+
this.lastTurnStartedAt = turnStartedAt;
|
|
302
|
+
const activityFromIdle = activeCount > 0 && this.lastActiveCount === 0;
|
|
303
|
+
if ((newTurn || activityFromIdle) && !this.focused) {
|
|
304
|
+
this.showHistory = false;
|
|
305
|
+
// If that leaves nothing to list (the pane was opened while idle, then a
|
|
306
|
+
// turn launches nothing), close it rather than keep an empty pane under
|
|
307
|
+
// a "0 completed" header. Not a manual close: the next activity reopens it.
|
|
308
|
+
if (this.open && this.visibleCount() === 0) {
|
|
309
|
+
this.open = false;
|
|
310
|
+
this.manuallyClosed = false;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (activityFromIdle && !this.manuallyClosed)
|
|
314
|
+
this.open = true;
|
|
315
|
+
if (activeCount === 0 && this.lastActiveCount > 0) {
|
|
316
|
+
if (this.focused) {
|
|
317
|
+
// A user who is already inspecting the pane should see the final
|
|
318
|
+
// status land in place instead of watching the selected row vanish.
|
|
319
|
+
// This turn's rows stay on their own; only work launched in an earlier
|
|
320
|
+
// turn needs the history view to remain visible.
|
|
321
|
+
if (this.visibleCount() === 0)
|
|
322
|
+
this.showHistory = true;
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
this.open = false;
|
|
326
|
+
this.manuallyClosed = false;
|
|
327
|
+
this.showHistory = false;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
this.lastActiveCount = activeCount;
|
|
331
|
+
}
|
|
332
|
+
render(width) {
|
|
333
|
+
const terminalRows = this.getTerminalRows();
|
|
334
|
+
if (terminalRows < 12) {
|
|
335
|
+
this.lastRows = [];
|
|
336
|
+
this.allRows = [];
|
|
337
|
+
return [];
|
|
338
|
+
}
|
|
339
|
+
this.syncState();
|
|
340
|
+
if (!this.open) {
|
|
341
|
+
this.lastRows = [];
|
|
342
|
+
this.allRows = [];
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
345
|
+
const items = normalize(this.getSnapshot(), this.showHistory);
|
|
346
|
+
const sections = [
|
|
347
|
+
["workflows", "Workflows"],
|
|
348
|
+
["subagents", "Subagents"],
|
|
349
|
+
["tasks", "Tasks"],
|
|
350
|
+
];
|
|
351
|
+
const rows = [];
|
|
352
|
+
for (const [section] of sections) {
|
|
353
|
+
if (items[section].length === 0)
|
|
354
|
+
continue;
|
|
355
|
+
rows.push({ kind: "header", section });
|
|
356
|
+
if (!this.collapsed.has(section))
|
|
357
|
+
rows.push(...items[section].map((item) => ({ kind: "item", item })));
|
|
358
|
+
}
|
|
359
|
+
const itemRows = rows.filter((row) => row.kind === "item");
|
|
360
|
+
this.allRows = rows;
|
|
361
|
+
const selectionGone = !this.selectedId
|
|
362
|
+
|| !itemRows.some((row) => `${row.item.kind}:${row.item.id}` === this.selectedId);
|
|
363
|
+
if (selectionGone)
|
|
364
|
+
this.selectionIsUsers = false;
|
|
365
|
+
if (!this.selectionIsUsers) {
|
|
366
|
+
this.selectedId = itemRows[0] ? `${itemRows[0].item.kind}:${itemRows[0].item.id}` : undefined;
|
|
367
|
+
}
|
|
368
|
+
// When the rows do not fit, the last line says how many are out of view
|
|
369
|
+
// rather than clipping them silently. Only a focused pane scrolls to its
|
|
370
|
+
// selection; untouched, it shows the top, where running work sorts first.
|
|
371
|
+
const maxRows = Math.max(3, Math.min(8, Math.floor(terminalRows * 0.15)));
|
|
372
|
+
const selectedIndex = this.focused
|
|
373
|
+
? rows.findIndex((row) => row.kind === "item" && `${row.item.kind}:${row.item.id}` === this.selectedId)
|
|
374
|
+
: -1;
|
|
375
|
+
const layout = (windowRows) => {
|
|
376
|
+
const start = selectedIndex >= windowRows ? selectedIndex - windowRows + 1 : 0;
|
|
377
|
+
const items = (slice) => slice.filter((row) => row.kind === "item").length;
|
|
378
|
+
return { start, windowRows, above: items(rows.slice(0, start)), below: items(rows.slice(start + windowRows)) };
|
|
379
|
+
};
|
|
380
|
+
// Reserve the last line only when it has something to say: hidden rows can
|
|
381
|
+
// be nothing but collapsed section headers, and a blank reserved slot would
|
|
382
|
+
// cost one of as few as three lines.
|
|
383
|
+
let view = layout(maxRows);
|
|
384
|
+
if (rows.length > maxRows) {
|
|
385
|
+
const reserved = layout(maxRows - 1);
|
|
386
|
+
if (reserved.above + reserved.below > 0)
|
|
387
|
+
view = reserved;
|
|
388
|
+
}
|
|
389
|
+
const visibleRows = rows.slice(view.start, view.start + view.windowRows);
|
|
390
|
+
this.lastRows = visibleRows;
|
|
391
|
+
const theme = this.getTheme();
|
|
392
|
+
const more = [
|
|
393
|
+
view.above > 0 ? `${view.above} more above` : "",
|
|
394
|
+
view.below > 0 ? `${view.below} more below` : "",
|
|
395
|
+
].filter(Boolean).join(" · ");
|
|
396
|
+
const moreLine = view.windowRows < maxRows && more
|
|
397
|
+
? [themeDim(theme.dim, pad(` … ${more}${this.focused ? "" : " · Ctrl+G"}`, width))]
|
|
398
|
+
: [];
|
|
399
|
+
return [...visibleRows.map((row) => {
|
|
400
|
+
if (row.kind === "header") {
|
|
401
|
+
const count = items[row.section].length;
|
|
402
|
+
const marker = this.collapsed.has(row.section) ? "▸" : "▾";
|
|
403
|
+
const label = sections.find(([section]) => section === row.section)?.[1] ?? row.section;
|
|
404
|
+
return themeDim(theme.dim, pad(` ${marker} ${label} ${count}`, width));
|
|
405
|
+
}
|
|
406
|
+
const key = `${row.item.kind}:${row.item.id}`;
|
|
407
|
+
const state = key === this.selectedId && this.focused ? "selected" : key === this.hoveredId ? "hover" : "idle";
|
|
408
|
+
return paint(this.renderItem(row.item, width), width, state, theme);
|
|
409
|
+
}), ...moreLine];
|
|
410
|
+
}
|
|
411
|
+
renderItem(item, width) {
|
|
412
|
+
const theme = this.getTheme();
|
|
413
|
+
const glyph = statusGlyph(item.status, this.frame, theme);
|
|
414
|
+
if (item.kind === "workflow") {
|
|
415
|
+
const done = item.members.filter((member) => !isActive(member.status ?? "running")).length;
|
|
416
|
+
const progress = item.members.length > 0 ? `${done}/${item.members.length}` : item.status;
|
|
417
|
+
const duration = elapsed(item.createdAt, item.updatedAt, isActive(item.status));
|
|
418
|
+
return truncateToWidth(` ${glyph} ${safe(item.title)} ${themeDim(theme.dim, `${progress}${duration ? ` · ${duration}` : ""}`)}${isActive(item.status) ? themeDim(theme.dim, " view ×") : themeDim(theme.dim, " view")}`, width, "");
|
|
419
|
+
}
|
|
420
|
+
if (item.kind === "task") {
|
|
421
|
+
const duration = elapsed(item.task.startedAt, item.task.endedAt, isActive(item.status));
|
|
422
|
+
const lineCount = `${item.task.outputLines} line${item.task.outputLines === 1 ? "" : "s"}`;
|
|
423
|
+
return truncateToWidth(` ${glyph} ${safe(item.title)} ${themeDim(theme.dim, `${item.status}${duration ? ` · ${duration}` : ""} · ${lineCount}`)}${isActive(item.status) ? themeDim(theme.dim, " view ×") : themeDim(theme.dim, " view")}`, width, "");
|
|
424
|
+
}
|
|
425
|
+
const member = item.member;
|
|
426
|
+
const activity = latestSubagentNote(member);
|
|
427
|
+
const model = member.route?.model ?? member.agentName ?? "";
|
|
428
|
+
const tokens = usageLabel(member);
|
|
429
|
+
const duration = elapsed(member.createdAt, member.updatedAt, isActive(item.status));
|
|
430
|
+
const meta = [model, tokens ? `${tokens} tok` : "", duration].filter(Boolean).join(" · ");
|
|
431
|
+
const detail = activity ? ` — ${safe(activity)}` : "";
|
|
432
|
+
return truncateToWidth(` ${glyph} ${safe(item.title)}${detail} ${themeDim(theme.dim, meta)}${isActive(item.status) ? themeDim(theme.dim, " view ×") : themeDim(theme.dim, " view")}`, width, "");
|
|
433
|
+
}
|
|
434
|
+
handleInput(data) {
|
|
435
|
+
if (matchesKey(data, "escape")) {
|
|
436
|
+
this.focused = false;
|
|
437
|
+
this.callbacks.onEscape();
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (data === "h") {
|
|
441
|
+
this.showHistory = !this.showHistory;
|
|
442
|
+
this.callbacks.onRender();
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
const itemRows = this.allRows.filter((row) => row.kind === "item");
|
|
446
|
+
const index = Math.max(0, itemRows.findIndex((row) => `${row.item.kind}:${row.item.id}` === this.selectedId));
|
|
447
|
+
if (matchesKey(data, "up") || data === "k") {
|
|
448
|
+
const row = itemRows[Math.max(0, index - 1)];
|
|
449
|
+
if (row) {
|
|
450
|
+
this.selectedId = `${row.item.kind}:${row.item.id}`;
|
|
451
|
+
this.selectionIsUsers = true;
|
|
452
|
+
}
|
|
453
|
+
this.callbacks.onRender();
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (matchesKey(data, "down") || data === "j") {
|
|
457
|
+
const row = itemRows[Math.min(itemRows.length - 1, index + 1)];
|
|
458
|
+
if (row) {
|
|
459
|
+
this.selectedId = `${row.item.kind}:${row.item.id}`;
|
|
460
|
+
this.selectionIsUsers = true;
|
|
461
|
+
}
|
|
462
|
+
this.callbacks.onRender();
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const selected = itemRows.find((row) => `${row.item.kind}:${row.item.id}` === this.selectedId)?.item;
|
|
466
|
+
if ((matchesKey(data, "left") || matchesKey(data, "right")) && selected) {
|
|
467
|
+
const section = selected.kind === "workflow" ? "workflows" : selected.kind === "subagent" ? "subagents" : "tasks";
|
|
468
|
+
if (matchesKey(data, "left"))
|
|
469
|
+
this.collapsed.add(section);
|
|
470
|
+
else
|
|
471
|
+
this.collapsed.delete(section);
|
|
472
|
+
this.callbacks.onRender();
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if ((matchesKey(data, "enter") || matchesKey(data, "ctrl+f")) && selected)
|
|
476
|
+
this.openItem(selected);
|
|
477
|
+
if (data === "x" && selected && isActive(selected.status))
|
|
478
|
+
this.stopItem(selected);
|
|
479
|
+
if (data === "y" && selected?.kind === "task")
|
|
480
|
+
this.callbacks.onCopyTaskOutput?.(selected.id);
|
|
481
|
+
}
|
|
482
|
+
handleMouse(event) {
|
|
483
|
+
if (event.kind === "leave") {
|
|
484
|
+
const changed = this.hoveredId !== undefined;
|
|
485
|
+
this.hoveredId = undefined;
|
|
486
|
+
return changed;
|
|
487
|
+
}
|
|
488
|
+
const row = this.lastRows[event.y];
|
|
489
|
+
if (event.kind === "move") {
|
|
490
|
+
const next = row?.kind === "item" ? `${row.item.kind}:${row.item.id}` : undefined;
|
|
491
|
+
const changed = next !== this.hoveredId;
|
|
492
|
+
this.hoveredId = next;
|
|
493
|
+
return changed;
|
|
494
|
+
}
|
|
495
|
+
if (event.release || (event.button & 3) !== 0 || !row)
|
|
496
|
+
return false;
|
|
497
|
+
if (row.kind === "header") {
|
|
498
|
+
if (this.collapsed.has(row.section))
|
|
499
|
+
this.collapsed.delete(row.section);
|
|
500
|
+
else
|
|
501
|
+
this.collapsed.add(row.section);
|
|
502
|
+
return true;
|
|
503
|
+
}
|
|
504
|
+
this.selectedId = `${row.item.kind}:${row.item.id}`;
|
|
505
|
+
this.selectionIsUsers = true;
|
|
506
|
+
if (event.clickCount >= 2)
|
|
507
|
+
this.openItem(row.item);
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
openItem(item) {
|
|
511
|
+
if (item.kind === "workflow")
|
|
512
|
+
this.callbacks.onOpenWorkflow(item);
|
|
513
|
+
else if (item.kind === "subagent")
|
|
514
|
+
this.callbacks.onOpenSubagent(item);
|
|
515
|
+
else
|
|
516
|
+
this.callbacks.onOpenTask(item);
|
|
517
|
+
}
|
|
518
|
+
stopItem(item) {
|
|
519
|
+
if (item.kind === "workflow")
|
|
520
|
+
this.callbacks.onStopWorkflow(item.id);
|
|
521
|
+
else if (item.kind === "subagent")
|
|
522
|
+
this.callbacks.onStopSubagent(item.id);
|
|
523
|
+
else
|
|
524
|
+
this.callbacks.onStopTask(item.id);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
export class TaskStatusBarComponent {
|
|
528
|
+
pane;
|
|
529
|
+
constructor(pane) {
|
|
530
|
+
this.pane = pane;
|
|
531
|
+
}
|
|
532
|
+
render(width) {
|
|
533
|
+
if (!this.pane.isAvailable())
|
|
534
|
+
return [];
|
|
535
|
+
this.pane.syncState();
|
|
536
|
+
const count = this.pane.activeCount();
|
|
537
|
+
// The bar describes what the pane lists: open, the rows on screen; closed,
|
|
538
|
+
// the default view Ctrl+G opens (running work plus this turn's). It used to
|
|
539
|
+
// count the whole session, a number that only ever grew. With nothing from
|
|
540
|
+
// this turn the bar is hidden; Ctrl+G still reaches the history.
|
|
541
|
+
const total = this.pane.isOpen() ? this.pane.visibleCount() : this.pane.defaultViewCount();
|
|
542
|
+
if (total === 0 && !this.pane.isOpen())
|
|
543
|
+
return [];
|
|
544
|
+
const marker = this.pane.isOpen() ? "▾" : "▸";
|
|
545
|
+
const theme = this.pane.theme();
|
|
546
|
+
// The list below also holds this turn's finished rows; say so, or the
|
|
547
|
+
// header counts fewer activities than the pane shows.
|
|
548
|
+
const settled = this.pane.settledCounts();
|
|
549
|
+
const outcome = [
|
|
550
|
+
settled.failed > 0 ? themeForeground(theme.error, `${settled.failed} failed`) : "",
|
|
551
|
+
settled.done > 0 ? `${settled.done} done` : "",
|
|
552
|
+
settled.stopped > 0 ? `${settled.stopped} stopped` : "",
|
|
553
|
+
].filter(Boolean).map((part) => ` · ${part}`).join("");
|
|
554
|
+
const text = count > 0
|
|
555
|
+
? `${marker} ${themeForeground(theme.accent, this.pane.activityGlyph())} ${count} background activit${count === 1 ? "y" : "ies"}${outcome} · Ctrl+G`
|
|
556
|
+
: `${marker} ${themeForeground(theme.success, "✓")} ${total} completed activit${total === 1 ? "y" : "ies"} · Ctrl+G`;
|
|
557
|
+
return [themeDim(theme.dim, truncateToWidth(` ${text}`, Math.max(1, width), ""))];
|
|
558
|
+
}
|
|
559
|
+
handleMouse(event) {
|
|
560
|
+
if (event.kind !== "press" || event.release || (event.button & 3) !== 0)
|
|
561
|
+
return false;
|
|
562
|
+
this.pane.toggle();
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
565
|
+
invalidate() { }
|
|
566
|
+
}
|