@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,184 @@
|
|
|
1
|
+
import { spawn as nodeSpawn } from "node:child_process";
|
|
2
|
+
import { GrokRuntimeError } from "./grok-errors.js";
|
|
3
|
+
export const defaultGrokSpawn = (command, args, options) => nodeSpawn(command, [...args], { ...options, shell: false });
|
|
4
|
+
function appendBounded(chunks, chunk, used, limit) {
|
|
5
|
+
if (used >= limit)
|
|
6
|
+
return used;
|
|
7
|
+
const remaining = limit - used;
|
|
8
|
+
chunks.push(chunk.subarray(0, remaining));
|
|
9
|
+
return used + Math.min(chunk.byteLength, remaining);
|
|
10
|
+
}
|
|
11
|
+
export function sanitizeGrokDiagnostic(input, maxLength = 2048) {
|
|
12
|
+
let value = input
|
|
13
|
+
.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, "")
|
|
14
|
+
.replace(/https:\/\/auth\.x\.ai\/oauth2\/authorize[^\s"'<>`]*/gi, "https://auth.x.ai/oauth2/authorize?[redacted]")
|
|
15
|
+
.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [redacted]")
|
|
16
|
+
.replace(/\bxai-[A-Za-z0-9_-]+/gi, "xai-[redacted]")
|
|
17
|
+
.replace(/([?&](?:access_token|refresh_token|token|api_key|key|secret|password)=)[^\s&#]+/gi, "$1[redacted]")
|
|
18
|
+
.replace(/(["']?(?:access_token|refresh_token|id_token|token|api_key|secret|password)["']?\s*[:=]\s*["']?)[^"',\s}]+/gi, "$1[redacted]")
|
|
19
|
+
.replace(/\b([A-Z0-9_]*(?:TOKEN|KEY|SECRET|PASSWORD|AUTH)[A-Z0-9_]*)\s*=\s*[^\s]+/gi, "$1=[redacted]")
|
|
20
|
+
.replace(/\beyJ[A-Za-z0-9_-]{16,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]{8,})?/g, "[redacted-jwt]")
|
|
21
|
+
.replace(/(https?:\/\/)[^\s/@:]+:[^\s/@]+@/gi, "$1[redacted]@");
|
|
22
|
+
if (value.length > maxLength)
|
|
23
|
+
value = `${value.slice(0, maxLength)}…`;
|
|
24
|
+
return value.trim();
|
|
25
|
+
}
|
|
26
|
+
const GROK_OAUTH_AUTHORIZE_PREFIX = "https://auth.x.ai/oauth2/authorize";
|
|
27
|
+
/**
|
|
28
|
+
* Extract only the pinned xAI authorization endpoint. OAuth query values are
|
|
29
|
+
* intentionally treated as opaque and are never copied into diagnostics.
|
|
30
|
+
*/
|
|
31
|
+
export function extractGrokOAuthAuthorizeUrl(input) {
|
|
32
|
+
let offset = 0;
|
|
33
|
+
while (offset < input.length) {
|
|
34
|
+
const start = input.indexOf(GROK_OAUTH_AUTHORIZE_PREFIX, offset);
|
|
35
|
+
if (start < 0)
|
|
36
|
+
return undefined;
|
|
37
|
+
let end = start + GROK_OAUTH_AUTHORIZE_PREFIX.length;
|
|
38
|
+
while (end < input.length) {
|
|
39
|
+
const char = input[end];
|
|
40
|
+
const code = char.charCodeAt(0);
|
|
41
|
+
if (code <= 0x20 || code === 0x7f || char === '"' || char === "'" || char === "<" || char === ">" || char === "`") {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
end += 1;
|
|
45
|
+
}
|
|
46
|
+
let candidate = input.slice(start, end);
|
|
47
|
+
while (/[),.;\]}]$/.test(candidate))
|
|
48
|
+
candidate = candidate.slice(0, -1);
|
|
49
|
+
try {
|
|
50
|
+
const parsed = new URL(candidate);
|
|
51
|
+
if (parsed.protocol === "https:"
|
|
52
|
+
&& parsed.hostname === "auth.x.ai"
|
|
53
|
+
&& parsed.port === ""
|
|
54
|
+
&& parsed.username === ""
|
|
55
|
+
&& parsed.password === ""
|
|
56
|
+
&& parsed.pathname === "/oauth2/authorize"
|
|
57
|
+
&& parsed.hash === "") {
|
|
58
|
+
return parsed.toString();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Keep scanning: a malformed lookalike must not suppress a later valid URL.
|
|
63
|
+
}
|
|
64
|
+
offset = start + GROK_OAUTH_AUTHORIZE_PREFIX.length;
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
export async function runGrokCommand(spawn, binary, args, options) {
|
|
69
|
+
return await new Promise((resolve, reject) => {
|
|
70
|
+
if (options.signal?.aborted) {
|
|
71
|
+
reject(new GrokRuntimeError("cancelled", "Grok command cancelled."));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const child = spawn(binary, args, {
|
|
75
|
+
cwd: options.cwd,
|
|
76
|
+
env: options.env,
|
|
77
|
+
shell: false,
|
|
78
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
79
|
+
});
|
|
80
|
+
const stdout = [];
|
|
81
|
+
const stderr = [];
|
|
82
|
+
const maxStdout = options.maxStdoutBytes ?? 512 * 1024;
|
|
83
|
+
const maxStderr = options.maxStderrBytes ?? 8 * 1024;
|
|
84
|
+
let stdoutBytes = 0;
|
|
85
|
+
let stdoutStoredBytes = 0;
|
|
86
|
+
let stderrBytes = 0;
|
|
87
|
+
let stdoutOverflow = false;
|
|
88
|
+
let oauthStdoutScanBuffer = "";
|
|
89
|
+
let oauthStderrScanBuffer = "";
|
|
90
|
+
let oauthUrlSeen = false;
|
|
91
|
+
let oauthHandlerFailed = false;
|
|
92
|
+
let childError;
|
|
93
|
+
let aborted = false;
|
|
94
|
+
let killTimer;
|
|
95
|
+
const terminate = () => {
|
|
96
|
+
if (child.exitCode !== null || child.signalCode !== null)
|
|
97
|
+
return;
|
|
98
|
+
child.kill("SIGTERM");
|
|
99
|
+
if (killTimer)
|
|
100
|
+
return;
|
|
101
|
+
killTimer = setTimeout(() => {
|
|
102
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
103
|
+
child.kill("SIGKILL");
|
|
104
|
+
}, 1_000);
|
|
105
|
+
killTimer.unref?.();
|
|
106
|
+
};
|
|
107
|
+
const onAbort = () => {
|
|
108
|
+
aborted = true;
|
|
109
|
+
terminate();
|
|
110
|
+
};
|
|
111
|
+
const scanOAuthChunk = (source, text) => {
|
|
112
|
+
if (oauthUrlSeen || !options.onOAuthAuthorizeUrl)
|
|
113
|
+
return;
|
|
114
|
+
if (source === "stdout") {
|
|
115
|
+
oauthStdoutScanBuffer = `${oauthStdoutScanBuffer}${text}`.slice(-64 * 1024);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
oauthStderrScanBuffer = `${oauthStderrScanBuffer}${text}`.slice(-64 * 1024);
|
|
119
|
+
}
|
|
120
|
+
const url = extractGrokOAuthAuthorizeUrl(source === "stdout" ? oauthStdoutScanBuffer : oauthStderrScanBuffer);
|
|
121
|
+
if (!url)
|
|
122
|
+
return;
|
|
123
|
+
oauthUrlSeen = true;
|
|
124
|
+
try {
|
|
125
|
+
options.onOAuthAuthorizeUrl(url);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
oauthHandlerFailed = true;
|
|
129
|
+
terminate();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
133
|
+
child.stdout?.on("data", (chunk) => {
|
|
134
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
135
|
+
if (!stdoutOverflow && stdoutBytes + bytes.byteLength > maxStdout) {
|
|
136
|
+
stdoutOverflow = true;
|
|
137
|
+
terminate();
|
|
138
|
+
}
|
|
139
|
+
stdoutBytes += bytes.byteLength;
|
|
140
|
+
if (!options.discardStdout) {
|
|
141
|
+
stdoutStoredBytes = appendBounded(stdout, bytes, stdoutStoredBytes, maxStdout);
|
|
142
|
+
}
|
|
143
|
+
scanOAuthChunk("stdout", bytes.toString("utf8"));
|
|
144
|
+
});
|
|
145
|
+
child.stderr?.on("data", (chunk) => {
|
|
146
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
147
|
+
stderrBytes = appendBounded(stderr, bytes, stderrBytes, maxStderr);
|
|
148
|
+
scanOAuthChunk("stderr", bytes.toString("utf8"));
|
|
149
|
+
});
|
|
150
|
+
child.once("error", (error) => {
|
|
151
|
+
childError = error;
|
|
152
|
+
});
|
|
153
|
+
child.once("close", (code, signal) => {
|
|
154
|
+
options.signal?.removeEventListener("abort", onAbort);
|
|
155
|
+
if (killTimer)
|
|
156
|
+
clearTimeout(killTimer);
|
|
157
|
+
if (aborted || options.signal?.aborted) {
|
|
158
|
+
reject(new GrokRuntimeError("cancelled", "Grok command cancelled."));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (stdoutOverflow) {
|
|
162
|
+
reject(new GrokRuntimeError("protocol_error", "Grok command output exceeded the safe capture limit."));
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (oauthHandlerFailed) {
|
|
166
|
+
reject(new GrokRuntimeError("protocol_error", "Grok OAuth URL handling failed."));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (childError) {
|
|
170
|
+
reject(childError);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (code === null) {
|
|
174
|
+
reject(new GrokRuntimeError("process_crashed", `Grok runtime terminated by ${signal ?? "an unknown signal"}.`));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
resolve({
|
|
178
|
+
stdout: Buffer.concat(stdout).toString("utf8"),
|
|
179
|
+
stderr: sanitizeGrokDiagnostic(Buffer.concat(stderr).toString("utf8")),
|
|
180
|
+
code,
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface GrokProfile {
|
|
2
|
+
root: string;
|
|
3
|
+
home: string;
|
|
4
|
+
grokHome: string;
|
|
5
|
+
tmp: string;
|
|
6
|
+
workspace: string;
|
|
7
|
+
configPath: string;
|
|
8
|
+
requirementsPath: string;
|
|
9
|
+
lockPath: string;
|
|
10
|
+
}
|
|
11
|
+
export interface GrokProfileLock {
|
|
12
|
+
release(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function isSafeGrokSkillName(name: string): boolean;
|
|
15
|
+
export declare function buildGrokConfigToml(extraDisabledSkills?: readonly string[]): string;
|
|
16
|
+
export declare function buildGrokRequirementsToml(extraDisabledSkills?: readonly string[]): string;
|
|
17
|
+
export declare const GROK_CONFIG_TOML: string;
|
|
18
|
+
export declare const GROK_REQUIREMENTS_TOML: string;
|
|
19
|
+
export declare function getGrokProfile(bubbleHome?: string): GrokProfile;
|
|
20
|
+
/**
|
|
21
|
+
* Establish only the private directory needed to create runtime.lock. Existing
|
|
22
|
+
* profile content is validated but never chmodded or rewritten here, because
|
|
23
|
+
* another Bubble process may already own the lock and be using that profile.
|
|
24
|
+
*/
|
|
25
|
+
export declare function prepareGrokProfileLockRoot(profile?: GrokProfile, uid?: number | undefined): Promise<GrokProfile>;
|
|
26
|
+
export declare function prepareGrokProfile(profile?: GrokProfile, uid?: number | undefined, extraDisabledSkills?: readonly string[]): Promise<GrokProfile>;
|
|
27
|
+
export declare function buildGrokChildEnv(profile: GrokProfile, parentEnv?: NodeJS.ProcessEnv, proxy?: string): NodeJS.ProcessEnv;
|
|
28
|
+
export declare function acquireGrokProfileLock(profile: GrokProfile): Promise<GrokProfileLock>;
|
|
29
|
+
export declare function grokProfileHasAuth(profile: GrokProfile): Promise<boolean>;
|
|
30
|
+
export declare function clearGrokRuntimeData(profile: GrokProfile, includeAuth: boolean): Promise<void>;
|
|
31
|
+
/** Remove extension surfaces that the pinned CLI may materialize at startup. */
|
|
32
|
+
export declare function clearGrokGeneratedExtensions(profile: GrokProfile): Promise<void>;
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { constants as fsConstants, realpathSync, statSync } from "node:fs";
|
|
2
|
+
import { chmod, lstat, mkdir, open, readFile, realpath, rm, stat } from "node:fs/promises";
|
|
3
|
+
import { dirname, join, resolve, sep } from "node:path";
|
|
4
|
+
import { getBubbleHome } from "../bubble-home.js";
|
|
5
|
+
import { GrokRuntimeError } from "./grok-errors.js";
|
|
6
|
+
const DIRECTORY_MODE = 0o700;
|
|
7
|
+
const FILE_MODE = 0o600;
|
|
8
|
+
// Skills the pinned Grok CLI bundles and can materialize on its own. They are
|
|
9
|
+
// disabled by name because the runtime re-creates their files at startup.
|
|
10
|
+
const GROK_BUNDLED_SKILLS = [
|
|
11
|
+
"code-review",
|
|
12
|
+
"xlsx",
|
|
13
|
+
"create-skill",
|
|
14
|
+
"pptx",
|
|
15
|
+
"check-work",
|
|
16
|
+
"docx",
|
|
17
|
+
"imagine",
|
|
18
|
+
"help",
|
|
19
|
+
];
|
|
20
|
+
// `[skills] disabled` entries are written into TOML basic strings. Only accept
|
|
21
|
+
// names that cannot alter the document structure or smuggle escapes.
|
|
22
|
+
const SAFE_GROK_SKILL_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
23
|
+
export function isSafeGrokSkillName(name) {
|
|
24
|
+
return SAFE_GROK_SKILL_NAME.test(name);
|
|
25
|
+
}
|
|
26
|
+
function grokDisabledSkillsLine(extraDisabledSkills) {
|
|
27
|
+
for (const name of extraDisabledSkills) {
|
|
28
|
+
if (!isSafeGrokSkillName(name)) {
|
|
29
|
+
throw new GrokRuntimeError("profile_unsafe", "A discovered Grok skill name cannot be disabled safely.");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const disabled = [...new Set([...GROK_BUNDLED_SKILLS, ...extraDisabledSkills])].sort();
|
|
33
|
+
return `disabled = [${disabled.map((name) => JSON.stringify(name)).join(", ")}]`;
|
|
34
|
+
}
|
|
35
|
+
// Keep credentials and runtime configuration isolated while allowing the
|
|
36
|
+
// official Grok runtime to work inside the user's selected workspace. Tool
|
|
37
|
+
// execution is still gated by ACP permission requests handled by Bubble.
|
|
38
|
+
export function buildGrokConfigToml(extraDisabledSkills = []) {
|
|
39
|
+
return `[cli]
|
|
40
|
+
auto_update = false
|
|
41
|
+
|
|
42
|
+
[session]
|
|
43
|
+
load_envrc = false
|
|
44
|
+
|
|
45
|
+
[sandbox]
|
|
46
|
+
profile = "strict"
|
|
47
|
+
auto_allow_bash = false
|
|
48
|
+
|
|
49
|
+
[features]
|
|
50
|
+
web_fetch = false
|
|
51
|
+
write_file = true
|
|
52
|
+
tool_search = false
|
|
53
|
+
lsp_tools = false
|
|
54
|
+
|
|
55
|
+
[subagents]
|
|
56
|
+
enabled = false
|
|
57
|
+
|
|
58
|
+
[memory]
|
|
59
|
+
enabled = false
|
|
60
|
+
|
|
61
|
+
[skills]
|
|
62
|
+
${grokDisabledSkillsLine(extraDisabledSkills)}
|
|
63
|
+
|
|
64
|
+
[compat.cursor]
|
|
65
|
+
skills = false
|
|
66
|
+
rules = false
|
|
67
|
+
agents = false
|
|
68
|
+
mcps = false
|
|
69
|
+
hooks = false
|
|
70
|
+
|
|
71
|
+
[compat.claude]
|
|
72
|
+
skills = false
|
|
73
|
+
rules = false
|
|
74
|
+
agents = false
|
|
75
|
+
mcps = false
|
|
76
|
+
hooks = false
|
|
77
|
+
|
|
78
|
+
# Grok's Claude permission compatibility is independent from the extension
|
|
79
|
+
# compatibility switches above. Mark the one-time import as complete so the
|
|
80
|
+
# runtime never reads workspace .claude/settings*.json permission rules.
|
|
81
|
+
[claude_compat]
|
|
82
|
+
imported = true
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
export function buildGrokRequirementsToml(extraDisabledSkills = []) {
|
|
86
|
+
return `[cli]
|
|
87
|
+
auto_update = false
|
|
88
|
+
|
|
89
|
+
[session]
|
|
90
|
+
load_envrc = false
|
|
91
|
+
|
|
92
|
+
[sandbox]
|
|
93
|
+
profile = "strict"
|
|
94
|
+
auto_allow_bash = false
|
|
95
|
+
|
|
96
|
+
[features]
|
|
97
|
+
web_fetch = false
|
|
98
|
+
write_file = true
|
|
99
|
+
tool_search = false
|
|
100
|
+
lsp_tools = false
|
|
101
|
+
|
|
102
|
+
[subagents]
|
|
103
|
+
enabled = false
|
|
104
|
+
|
|
105
|
+
[memory]
|
|
106
|
+
enabled = false
|
|
107
|
+
|
|
108
|
+
[skills]
|
|
109
|
+
${grokDisabledSkillsLine(extraDisabledSkills)}
|
|
110
|
+
|
|
111
|
+
[compat.cursor]
|
|
112
|
+
skills = false
|
|
113
|
+
rules = false
|
|
114
|
+
agents = false
|
|
115
|
+
mcps = false
|
|
116
|
+
hooks = false
|
|
117
|
+
|
|
118
|
+
[compat.claude]
|
|
119
|
+
skills = false
|
|
120
|
+
rules = false
|
|
121
|
+
agents = false
|
|
122
|
+
mcps = false
|
|
123
|
+
hooks = false
|
|
124
|
+
|
|
125
|
+
[claude_compat]
|
|
126
|
+
imported = true
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
export const GROK_CONFIG_TOML = buildGrokConfigToml();
|
|
130
|
+
export const GROK_REQUIREMENTS_TOML = buildGrokRequirementsToml();
|
|
131
|
+
export function getGrokProfile(bubbleHome = getBubbleHome()) {
|
|
132
|
+
const root = resolve(bubbleHome, "runtimes", "grok");
|
|
133
|
+
const grokHome = join(root, "grok-home");
|
|
134
|
+
return {
|
|
135
|
+
root,
|
|
136
|
+
home: join(root, "home"),
|
|
137
|
+
grokHome,
|
|
138
|
+
tmp: join(root, "tmp"),
|
|
139
|
+
workspace: join(root, "workspace"),
|
|
140
|
+
configPath: join(grokHome, "config.toml"),
|
|
141
|
+
requirementsPath: join(grokHome, "requirements.toml"),
|
|
142
|
+
lockPath: join(root, "runtime.lock"),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
async function ensurePrivateDirectory(path, uid, repairMode = true) {
|
|
146
|
+
let created = false;
|
|
147
|
+
try {
|
|
148
|
+
const before = await lstat(path);
|
|
149
|
+
if (!before.isDirectory() || before.isSymbolicLink() || before.uid !== uid) {
|
|
150
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok profile contains an unsafe path.");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
if (error.code !== "ENOENT")
|
|
155
|
+
throw error;
|
|
156
|
+
await mkdir(path, { recursive: true, mode: DIRECTORY_MODE });
|
|
157
|
+
created = true;
|
|
158
|
+
}
|
|
159
|
+
if (created || repairMode)
|
|
160
|
+
await chmod(path, DIRECTORY_MODE);
|
|
161
|
+
const after = await stat(path);
|
|
162
|
+
if (!after.isDirectory() || after.uid !== uid || (after.mode & 0o077) !== 0) {
|
|
163
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok profile must be private to the current user.");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Establish only the private directory needed to create runtime.lock. Existing
|
|
168
|
+
* profile content is validated but never chmodded or rewritten here, because
|
|
169
|
+
* another Bubble process may already own the lock and be using that profile.
|
|
170
|
+
*/
|
|
171
|
+
export async function prepareGrokProfileLockRoot(profile = getGrokProfile(), uid = process.getuid?.()) {
|
|
172
|
+
if (uid === undefined) {
|
|
173
|
+
throw new GrokRuntimeError("unsupported_platform", "The Grok runtime requires a POSIX user account.");
|
|
174
|
+
}
|
|
175
|
+
await ensurePrivateDirectory(dirname(profile.root), uid, false);
|
|
176
|
+
await ensurePrivateDirectory(profile.root, uid, false);
|
|
177
|
+
return profile;
|
|
178
|
+
}
|
|
179
|
+
async function writePrivateFile(path, contents, uid) {
|
|
180
|
+
try {
|
|
181
|
+
const existing = await lstat(path);
|
|
182
|
+
if (!existing.isFile() || existing.isSymbolicLink() || existing.uid !== uid) {
|
|
183
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok profile contains an unsafe configuration file.");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
if (error.code !== "ENOENT")
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
190
|
+
const handle = await open(path, fsConstants.O_WRONLY | fsConstants.O_CREAT | fsConstants.O_TRUNC | fsConstants.O_NOFOLLOW, FILE_MODE);
|
|
191
|
+
try {
|
|
192
|
+
await handle.writeFile(contents, { encoding: "utf8" });
|
|
193
|
+
}
|
|
194
|
+
finally {
|
|
195
|
+
await handle.close();
|
|
196
|
+
}
|
|
197
|
+
await chmod(path, FILE_MODE);
|
|
198
|
+
const metadata = await stat(path);
|
|
199
|
+
if (!metadata.isFile() || metadata.uid !== uid || (metadata.mode & 0o077) !== 0) {
|
|
200
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok configuration must be private to the current user.");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
export async function prepareGrokProfile(profile = getGrokProfile(), uid = process.getuid?.(), extraDisabledSkills = []) {
|
|
204
|
+
if (uid === undefined) {
|
|
205
|
+
throw new GrokRuntimeError("unsupported_platform", "The Grok runtime requires a POSIX user account.");
|
|
206
|
+
}
|
|
207
|
+
await ensurePrivateDirectory(dirname(profile.root), uid);
|
|
208
|
+
await ensurePrivateDirectory(profile.root, uid);
|
|
209
|
+
for (const path of [profile.home, profile.grokHome, profile.tmp, profile.workspace]) {
|
|
210
|
+
await ensurePrivateDirectory(path, uid);
|
|
211
|
+
}
|
|
212
|
+
const canonicalRoot = await realpath(profile.root);
|
|
213
|
+
for (const path of [profile.home, profile.grokHome, profile.tmp, profile.workspace]) {
|
|
214
|
+
const canonical = await realpath(path);
|
|
215
|
+
if (canonical !== canonicalRoot && !canonical.startsWith(`${canonicalRoot}${sep}`)) {
|
|
216
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok profile escaped its private root.");
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
await writePrivateFile(profile.configPath, buildGrokConfigToml(extraDisabledSkills), uid);
|
|
220
|
+
await writePrivateFile(profile.requirementsPath, buildGrokRequirementsToml(extraDisabledSkills), uid);
|
|
221
|
+
return profile;
|
|
222
|
+
}
|
|
223
|
+
export function buildGrokChildEnv(profile, parentEnv = process.env, proxy) {
|
|
224
|
+
const env = {
|
|
225
|
+
HOME: profile.home,
|
|
226
|
+
GROK_HOME: profile.grokHome,
|
|
227
|
+
TMPDIR: profile.tmp,
|
|
228
|
+
PATH: "/usr/bin:/bin:/usr/sbin:/sbin",
|
|
229
|
+
GROK_DISABLE_AUTOUPDATER: "1",
|
|
230
|
+
GROK_SANDBOX: "strict",
|
|
231
|
+
GROK_SANDBOX_AUTO_ALLOW_BASH: "0",
|
|
232
|
+
GROK_MEMORY: "0",
|
|
233
|
+
GROK_SUBAGENTS: "0",
|
|
234
|
+
GROK_WEB_FETCH: "0",
|
|
235
|
+
GROK_WRITE_FILE: "1",
|
|
236
|
+
GROK_TOOL_SEARCH: "0",
|
|
237
|
+
GROK_LSP_TOOLS: "0",
|
|
238
|
+
GROK_CURSOR_SKILLS_ENABLED: "0",
|
|
239
|
+
GROK_CURSOR_RULES_ENABLED: "0",
|
|
240
|
+
GROK_CURSOR_AGENTS_ENABLED: "0",
|
|
241
|
+
GROK_CURSOR_MCPS_ENABLED: "0",
|
|
242
|
+
GROK_CURSOR_HOOKS_ENABLED: "0",
|
|
243
|
+
GROK_CLAUDE_SKILLS_ENABLED: "0",
|
|
244
|
+
GROK_CLAUDE_RULES_ENABLED: "0",
|
|
245
|
+
GROK_CLAUDE_AGENTS_ENABLED: "0",
|
|
246
|
+
GROK_CLAUDE_MCPS_ENABLED: "0",
|
|
247
|
+
GROK_CLAUDE_HOOKS_ENABLED: "0",
|
|
248
|
+
// Pinned Grok 0.2.93 has a separate Claude permission compatibility gate.
|
|
249
|
+
// Keep its exact process override as defense in depth for every child.
|
|
250
|
+
_GROK_CLAUDE_MARKER_OVERRIDE: "1",
|
|
251
|
+
GROK_CRASH_HANDLER: "0",
|
|
252
|
+
};
|
|
253
|
+
const uid = process.getuid?.();
|
|
254
|
+
const safePath = parentEnv.PATH?.split(":").filter((entry) => {
|
|
255
|
+
if (!entry.startsWith("/") || /[\r\n\0]/.test(entry))
|
|
256
|
+
return false;
|
|
257
|
+
try {
|
|
258
|
+
const canonical = realpathSync(entry);
|
|
259
|
+
const metadata = statSync(canonical);
|
|
260
|
+
return metadata.isDirectory()
|
|
261
|
+
&& (uid === undefined || metadata.uid === 0 || metadata.uid === uid)
|
|
262
|
+
&& (metadata.mode & 0o022) === 0;
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
if (safePath?.length)
|
|
269
|
+
env.PATH = [...new Set(safePath)].join(":");
|
|
270
|
+
for (const name of ["LANG", "LC_ALL", "TERM", "COLORTERM", "NO_COLOR"]) {
|
|
271
|
+
const value = parentEnv[name];
|
|
272
|
+
if (value && !/[\r\n\0]/.test(value))
|
|
273
|
+
env[name] = value;
|
|
274
|
+
}
|
|
275
|
+
if (proxy) {
|
|
276
|
+
env.HTTPS_PROXY = proxy;
|
|
277
|
+
env.ALL_PROXY = proxy;
|
|
278
|
+
}
|
|
279
|
+
return env;
|
|
280
|
+
}
|
|
281
|
+
export async function acquireGrokProfileLock(profile) {
|
|
282
|
+
const uid = process.getuid?.();
|
|
283
|
+
const openNewLock = async () => await open(profile.lockPath, "wx", FILE_MODE);
|
|
284
|
+
let handle;
|
|
285
|
+
try {
|
|
286
|
+
handle = await openNewLock();
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
if (error.code !== "EEXIST")
|
|
290
|
+
throw error;
|
|
291
|
+
const metadata = await lstat(profile.lockPath);
|
|
292
|
+
if (!metadata.isFile() || metadata.isSymbolicLink() || uid === undefined || metadata.uid !== uid || (metadata.mode & 0o077) !== 0) {
|
|
293
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok runtime lock is unsafe.");
|
|
294
|
+
}
|
|
295
|
+
const rawPid = (await readFile(profile.lockPath, "utf8")).trim();
|
|
296
|
+
if (!/^[1-9][0-9]*$/.test(rawPid)) {
|
|
297
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok runtime lock is invalid.");
|
|
298
|
+
}
|
|
299
|
+
const pid = Number(rawPid);
|
|
300
|
+
if (!Number.isSafeInteger(pid) || pid > 2_147_483_647) {
|
|
301
|
+
throw new GrokRuntimeError("profile_unsafe", "The isolated Grok runtime lock is invalid.");
|
|
302
|
+
}
|
|
303
|
+
let stale = false;
|
|
304
|
+
try {
|
|
305
|
+
process.kill(pid, 0);
|
|
306
|
+
}
|
|
307
|
+
catch (probeError) {
|
|
308
|
+
if (probeError.code === "ESRCH")
|
|
309
|
+
stale = true;
|
|
310
|
+
else
|
|
311
|
+
throw new GrokRuntimeError("profile_locked", "The isolated Grok runtime is already in use.");
|
|
312
|
+
}
|
|
313
|
+
if (!stale) {
|
|
314
|
+
throw new GrokRuntimeError("profile_locked", "The isolated Grok runtime is already in use.");
|
|
315
|
+
}
|
|
316
|
+
await rm(profile.lockPath);
|
|
317
|
+
try {
|
|
318
|
+
handle = await openNewLock();
|
|
319
|
+
}
|
|
320
|
+
catch (retryError) {
|
|
321
|
+
if (retryError.code === "EEXIST") {
|
|
322
|
+
throw new GrokRuntimeError("profile_locked", "The isolated Grok runtime is already in use.");
|
|
323
|
+
}
|
|
324
|
+
throw retryError;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
await handle.writeFile(`${process.pid}\n`, { encoding: "utf8" });
|
|
328
|
+
let released = false;
|
|
329
|
+
return {
|
|
330
|
+
async release() {
|
|
331
|
+
if (released)
|
|
332
|
+
return;
|
|
333
|
+
released = true;
|
|
334
|
+
await handle.close();
|
|
335
|
+
await rm(profile.lockPath, { force: true });
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
export async function grokProfileHasAuth(profile) {
|
|
340
|
+
for (const path of [join(profile.grokHome, "auth.json"), join(profile.grokHome, "auth")]) {
|
|
341
|
+
try {
|
|
342
|
+
const metadata = await lstat(path);
|
|
343
|
+
if (metadata.isFile() || metadata.isDirectory())
|
|
344
|
+
return true;
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
if (error.code !== "ENOENT")
|
|
348
|
+
throw error;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
export async function clearGrokRuntimeData(profile, includeAuth) {
|
|
354
|
+
const names = [
|
|
355
|
+
"sessions",
|
|
356
|
+
"logs",
|
|
357
|
+
"log",
|
|
358
|
+
"crash",
|
|
359
|
+
"leader.sock",
|
|
360
|
+
"leader.pid",
|
|
361
|
+
"socket",
|
|
362
|
+
"sockets",
|
|
363
|
+
"active_sessions.json",
|
|
364
|
+
"active_sessions.lock",
|
|
365
|
+
"sandbox-events.jsonl",
|
|
366
|
+
"auth.json.lock",
|
|
367
|
+
];
|
|
368
|
+
if (includeAuth)
|
|
369
|
+
names.push("auth.json", "auth");
|
|
370
|
+
for (const name of names) {
|
|
371
|
+
await rm(join(profile.grokHome, name), { recursive: true, force: true });
|
|
372
|
+
}
|
|
373
|
+
// OAuth helpers may place browser hand-off logs or sockets under TMPDIR.
|
|
374
|
+
// The directory is dedicated to this isolated runtime, so clear and
|
|
375
|
+
// recreate it at every authentication boundary.
|
|
376
|
+
await rm(profile.tmp, { recursive: true, force: true });
|
|
377
|
+
await mkdir(profile.tmp, { mode: DIRECTORY_MODE });
|
|
378
|
+
await chmod(profile.tmp, DIRECTORY_MODE);
|
|
379
|
+
// The process workspace is intentionally disposable and never points at the user's project.
|
|
380
|
+
await rm(profile.workspace, { recursive: true, force: true });
|
|
381
|
+
await mkdir(profile.workspace, { mode: DIRECTORY_MODE });
|
|
382
|
+
await chmod(profile.workspace, DIRECTORY_MODE);
|
|
383
|
+
}
|
|
384
|
+
/** Remove extension surfaces that the pinned CLI may materialize at startup. */
|
|
385
|
+
export async function clearGrokGeneratedExtensions(profile) {
|
|
386
|
+
for (const name of [
|
|
387
|
+
"skills",
|
|
388
|
+
"plugins",
|
|
389
|
+
"marketplaces",
|
|
390
|
+
"hooks",
|
|
391
|
+
"agents",
|
|
392
|
+
"mcp",
|
|
393
|
+
"lsp",
|
|
394
|
+
"docs",
|
|
395
|
+
// The pinned CLI can materialize transcript-bearing archives and logs
|
|
396
|
+
// even with memory disabled. They are never inputs to a later turn.
|
|
397
|
+
"upload_queue",
|
|
398
|
+
"logs",
|
|
399
|
+
"log",
|
|
400
|
+
"crash",
|
|
401
|
+
"sandbox-events.jsonl",
|
|
402
|
+
"README.md",
|
|
403
|
+
".config-init.lock",
|
|
404
|
+
"managed_config.lock",
|
|
405
|
+
"auth.json.lock",
|
|
406
|
+
"active_sessions.json",
|
|
407
|
+
"active_sessions.lock",
|
|
408
|
+
"leader.sock",
|
|
409
|
+
"leader.pid",
|
|
410
|
+
"socket",
|
|
411
|
+
"sockets",
|
|
412
|
+
]) {
|
|
413
|
+
await rm(join(profile.grokHome, name), { recursive: true, force: true });
|
|
414
|
+
}
|
|
415
|
+
// Bundled skills/docs are written under isolated HOME rather than GROK_HOME.
|
|
416
|
+
// Remove them after every short-lived process so the next preflight/sidecar
|
|
417
|
+
// starts from the same empty extension surface it verified.
|
|
418
|
+
await rm(join(profile.home, ".grok"), { recursive: true, force: true });
|
|
419
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Canonical product/picker identity for the subscription-backed runtime. */
|
|
2
|
+
export declare const GROK_SUBSCRIPTION_PROVIDER_ID: "grok-subscription";
|
|
3
|
+
/** Short command alias accepted by `/provider`, `/login`, and `/logout`. */
|
|
4
|
+
export declare const GROK_SUBSCRIPTION_COMMAND_ALIAS: "grok";
|
|
5
|
+
export declare const GROK_SUBSCRIPTION_PROVIDER_NAME: "Grok Subscription";
|
|
6
|
+
export declare const GROK_SUBSCRIPTION_PROVIDER_LABEL: "Grok Subscription [OAuth]";
|
|
7
|
+
export declare const GROK_SUBSCRIPTION_PROVIDER: Readonly<{
|
|
8
|
+
id: "grok-subscription";
|
|
9
|
+
commandAlias: "grok";
|
|
10
|
+
name: "Grok Subscription";
|
|
11
|
+
label: "Grok Subscription [OAuth]";
|
|
12
|
+
}>;
|
|
13
|
+
export interface ExternalProviderPickerEntry {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface GrokSubscriptionPickerOptions {
|
|
19
|
+
label?: string;
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Normalize only Grok's public command alias; unrelated provider IDs pass through. */
|
|
23
|
+
export declare function normalizeGrokSubscriptionProviderId(providerId: string): string;
|
|
24
|
+
export declare function isGrokSubscriptionProviderId(providerId: string | undefined): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Append one canonical Grok row after native provider rows. Existing canonical
|
|
27
|
+
* or command-alias rows are replaced, so independently composed picker lists
|
|
28
|
+
* cannot show Grok twice. This helper is intentionally independent from
|
|
29
|
+
* ProviderRegistry: Grok Subscription remains an external runtime.
|
|
30
|
+
*/
|
|
31
|
+
export declare function withGrokSubscriptionProvider(entries: readonly ExternalProviderPickerEntry[], options?: GrokSubscriptionPickerOptions): ExternalProviderPickerEntry[];
|