@bastani/atomic 0.9.11-alpha.4 → 0.9.11-alpha.6
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/CHANGELOG.md +55 -0
- package/README.md +12 -5
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +6 -0
- package/dist/builtin/mcp/README.md +3 -3
- package/dist/builtin/mcp/cli.js +0 -1
- package/dist/builtin/mcp/config.ts +0 -2
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/mcp/types.ts +0 -1
- package/dist/builtin/subagents/CHANGELOG.md +19 -0
- package/dist/builtin/subagents/README.md +10 -1
- package/dist/builtin/subagents/agents/code-simplifier.md +47 -102
- package/dist/builtin/subagents/agents/codebase-analyzer.md +27 -130
- package/dist/builtin/subagents/agents/codebase-locator.md +24 -83
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +60 -259
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +29 -207
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +28 -150
- package/dist/builtin/subagents/agents/codebase-research-locator.md +21 -118
- package/dist/builtin/subagents/agents/debugger.md +29 -65
- package/dist/builtin/subagents/agents/worker.md +23 -30
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/prompts/gather-context-and-clarify.md +18 -11
- package/dist/builtin/subagents/prompts/parallel-cleanup.md +34 -33
- package/dist/builtin/subagents/prompts/parallel-context-build.md +22 -36
- package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +20 -52
- package/dist/builtin/subagents/prompts/parallel-research.md +17 -41
- package/dist/builtin/subagents/prompts/parallel-review.md +23 -28
- package/dist/builtin/subagents/prompts/review-loop.md +18 -27
- package/dist/builtin/subagents/skills/subagent/SKILL.md +6 -6
- package/dist/builtin/subagents/src/extension/prompt-guidance.ts +4 -1
- package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +23 -4
- package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +2 -0
- package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +10 -0
- package/dist/builtin/subagents/src/runs/background/subagent-runner-step.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +8 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +6 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +7 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +3 -0
- package/dist/builtin/subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +1 -2
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -0
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +5 -3
- package/dist/builtin/subagents/src/shared/settings.ts +4 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +53 -0
- package/dist/builtin/workflows/README.md +72 -70
- package/dist/builtin/workflows/ambient.d.ts +0 -5
- package/dist/builtin/workflows/builtin/adversarial-verification-prompts.ts +7 -4
- package/dist/builtin/workflows/builtin/adversarial-verification-runner.ts +1 -1
- package/dist/builtin/workflows/builtin/adversarial-verification.ts +2 -1
- package/dist/builtin/workflows/builtin/classify-and-act-prompts.ts +5 -2
- package/dist/builtin/workflows/builtin/classify-and-act-runner.ts +5 -7
- package/dist/builtin/workflows/builtin/classify-and-act.ts +3 -2
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize-prompts.ts +6 -3
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize-runner.ts +5 -5
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.ts +3 -2
- package/dist/builtin/workflows/builtin/generate-and-filter-prompts.ts +7 -4
- package/dist/builtin/workflows/builtin/generate-and-filter-runner.ts +6 -3
- package/dist/builtin/workflows/builtin/generate-and-filter.ts +3 -2
- package/dist/builtin/workflows/builtin/goal-artifacts.ts +1 -1
- package/dist/builtin/workflows/builtin/goal-models.ts +39 -39
- package/dist/builtin/workflows/builtin/goal-orchestrator-prompts.ts +94 -0
- package/dist/builtin/workflows/builtin/goal-prompts.ts +66 -286
- package/dist/builtin/workflows/builtin/goal-reducer.ts +1 -1
- package/dist/builtin/workflows/builtin/goal-runner.ts +72 -116
- package/dist/builtin/workflows/builtin/goal.ts +9 -8
- package/dist/builtin/workflows/builtin/index.d.ts +17 -112
- package/dist/builtin/workflows/builtin/index.ts +1 -2
- package/dist/builtin/workflows/builtin/loop-until-done-prompts.ts +20 -12
- package/dist/builtin/workflows/builtin/loop-until-done-runner.ts +3 -0
- package/dist/builtin/workflows/builtin/loop-until-done.ts +3 -2
- package/dist/builtin/workflows/builtin/open-claude-design-phases.ts +52 -55
- package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +45 -52
- package/dist/builtin/workflows/builtin/open-claude-design-setup.ts +41 -46
- package/dist/builtin/workflows/builtin/open-claude-design-utils.ts +16 -21
- package/dist/builtin/workflows/builtin/open-claude-design.ts +2 -1
- package/dist/builtin/workflows/builtin/ralph-core.ts +61 -57
- package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +41 -45
- package/dist/builtin/workflows/builtin/ralph-models.ts +33 -43
- package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +35 -117
- package/dist/builtin/workflows/builtin/ralph-runner.ts +81 -108
- package/dist/builtin/workflows/builtin/ralph.ts +2 -1
- package/dist/builtin/workflows/builtin/shared-prompts.ts +111 -80
- package/dist/builtin/workflows/builtin/steering-context.ts +51 -0
- package/dist/builtin/workflows/builtin/tournament-prompts.ts +21 -12
- package/dist/builtin/workflows/builtin/tournament-runner.ts +3 -0
- package/dist/builtin/workflows/builtin/tournament.ts +3 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/create-spec/SKILL.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +6 -8
- package/dist/builtin/workflows/skills/impeccable/reference/live.md +3 -4
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +2 -20
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +4 -42
- package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +3 -3
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +2 -3
- package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +0 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +2 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +4 -4
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +57 -252
- package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +70 -226
- package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +64 -103
- package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +81 -155
- package/dist/builtin/workflows/src/authoring.d.ts +5 -1
- package/dist/builtin/workflows/src/durable/backend.ts +68 -9
- package/dist/builtin/workflows/src/durable/boundary-lifecycle.ts +148 -0
- package/dist/builtin/workflows/src/durable/boundary-topology.ts +420 -0
- package/dist/builtin/workflows/src/durable/child-invocation.ts +14 -0
- package/dist/builtin/workflows/src/durable/child-primitive.ts +74 -44
- package/dist/builtin/workflows/src/durable/completed-catalog-stage-groups.ts +250 -0
- package/dist/builtin/workflows/src/durable/completed-catalog.ts +205 -131
- package/dist/builtin/workflows/src/durable/completed-inspection.ts +8 -2
- package/dist/builtin/workflows/src/durable/completed-subtree.ts +31 -0
- package/dist/builtin/workflows/src/durable/dbos-backend.ts +28 -24
- package/dist/builtin/workflows/src/durable/dbos-envelope.ts +130 -3
- package/dist/builtin/workflows/src/durable/dbos-metadata.ts +18 -0
- package/dist/builtin/workflows/src/durable/scoped-backend.ts +64 -17
- package/dist/builtin/workflows/src/durable/stage-primitive.ts +60 -60
- package/dist/builtin/workflows/src/durable/stage-topology-validation.ts +234 -0
- package/dist/builtin/workflows/src/durable/stage-topology.ts +53 -0
- package/dist/builtin/workflows/src/durable/tool-failure-checkpoint.ts +49 -0
- package/dist/builtin/workflows/src/durable/tool-outcome.ts +120 -0
- package/dist/builtin/workflows/src/durable/tool-primitive.ts +367 -58
- package/dist/builtin/workflows/src/durable/types.ts +97 -0
- package/dist/builtin/workflows/src/durable/ui-primitive.ts +46 -0
- package/dist/builtin/workflows/src/durable/workflow-child-result.ts +58 -0
- package/dist/builtin/workflows/src/engine/options.ts +1 -0
- package/dist/builtin/workflows/src/engine/primitives/workflow.ts +19 -10
- package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +11 -1
- package/dist/builtin/workflows/src/engine/run-durable-topology.ts +190 -18
- package/dist/builtin/workflows/src/engine/run-terminal-event.ts +37 -0
- package/dist/builtin/workflows/src/engine/run-terminal-failure.ts +50 -0
- package/dist/builtin/workflows/src/engine/run-tool-execution-tracker.ts +152 -0
- package/dist/builtin/workflows/src/engine/run-tool-node-lifecycle.ts +87 -0
- package/dist/builtin/workflows/src/engine/run.ts +111 -110
- package/dist/builtin/workflows/src/engine/runtime.ts +15 -2
- package/dist/builtin/workflows/src/extension/extension-factory.ts +1 -0
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +11 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +6599 -4776
- package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +16 -5
- package/dist/builtin/workflows/src/extension/render-result.ts +16 -2
- package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +3 -0
- package/dist/builtin/workflows/src/extension/runtime.ts +4 -0
- package/dist/builtin/workflows/src/extension/wiring.ts +3 -1
- package/dist/builtin/workflows/src/extension/workflow-command-surfaces.ts +1 -0
- package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +9 -3
- package/dist/builtin/workflows/src/extension/workflow-module-loader.ts +18 -3
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +27 -9
- package/dist/builtin/workflows/src/extension/workflow-status-summary.ts +43 -0
- package/dist/builtin/workflows/src/extension/workflow-targets.ts +34 -30
- package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +12 -5
- package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +162 -63
- package/dist/builtin/workflows/src/runs/background/run-inspect.ts +7 -1
- package/dist/builtin/workflows/src/runs/background/status.ts +18 -8
- package/dist/builtin/workflows/src/runs/background/workflow-lifecycle-aggregate.ts +3 -11
- package/dist/builtin/workflows/src/runs/foreground/executor-child-boundary.ts +24 -21
- package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +1 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-lifecycle.ts +30 -13
- package/dist/builtin/workflows/src/runs/foreground/executor-prompt-nodes.ts +102 -53
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +13 -5
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +26 -8
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +11 -4
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +7 -1
- package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +35 -1
- package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +136 -17
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +12 -4
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +35 -42
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +5 -1
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-pause.ts +195 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +0 -13
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +14 -2
- package/dist/builtin/workflows/src/runs/shared/model-fallback-candidates.ts +3 -143
- package/dist/builtin/workflows/src/sdk-surface.ts +1 -1
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -11
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +6 -11
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +57 -6
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +76 -11
- package/dist/builtin/workflows/src/shared/expanded-workflow-graph.ts +206 -116
- package/dist/builtin/workflows/src/shared/intercom-group.ts +17 -10
- package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +30 -0
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +5 -0
- package/dist/builtin/workflows/src/shared/render-inputs-schema.ts +3 -3
- package/dist/builtin/workflows/src/shared/store-factory.ts +2 -0
- package/dist/builtin/workflows/src/shared/store-internal.ts +8 -0
- package/dist/builtin/workflows/src/shared/store-public-types.ts +8 -0
- package/dist/builtin/workflows/src/shared/store-run-methods.ts +9 -0
- package/dist/builtin/workflows/src/shared/store-stage-methods.ts +2 -0
- package/dist/builtin/workflows/src/shared/store-tool-node-methods.ts +46 -0
- package/dist/builtin/workflows/src/shared/store-types.ts +34 -0
- package/dist/builtin/workflows/src/shared/types.ts +14 -24
- package/dist/builtin/workflows/src/shared/workflow-failures-classifier.ts +11 -5
- package/dist/builtin/workflows/src/shared/workflow-failures-signals.ts +58 -0
- package/dist/builtin/workflows/src/shared/workflow-run-ownership.ts +53 -0
- package/dist/builtin/workflows/src/tui/graph-view-input.ts +2 -8
- package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +11 -4
- package/dist/builtin/workflows/src/tui/graph-view-render.ts +1 -0
- package/dist/builtin/workflows/src/tui/graph-view-state.ts +27 -9
- package/dist/builtin/workflows/src/tui/graph-view-types.ts +4 -3
- package/dist/builtin/workflows/src/tui/node-card.ts +4 -3
- package/dist/builtin/workflows/src/tui/overlay-adapter.ts +0 -4
- package/dist/builtin/workflows/src/tui/run-detail.ts +53 -17
- package/dist/builtin/workflows/src/tui/session-list.ts +8 -4
- package/dist/builtin/workflows/src/tui/stage-chat-view-render-helpers.ts +12 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-render-settings.ts +21 -1
- package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +3 -19
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +4 -2
- package/dist/builtin/workflows/src/tui/switcher.ts +13 -3
- package/dist/builtin/workflows/src/tui/workflow-attach-pane-handle.ts +1 -1
- package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +0 -9
- package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +16 -49
- package/dist/builtin/workflows/src/tui/workflow-status.ts +7 -0
- package/dist/builtin/workflows/src/workflows/identity.ts +1 -1
- package/dist/cli/args.d.ts +0 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -20
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -2
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +2 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.js +2 -2
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config-self-update.js +1 -1
- package/dist/config-self-update.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +34 -10
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-accessors.d.ts.map +1 -1
- package/dist/core/agent-session-accessors.js +2 -1
- package/dist/core/agent-session-accessors.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts +4 -3
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +55 -59
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts +9 -6
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +32 -13
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts +11 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +87 -19
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-custom-message-commit.d.ts +14 -0
- package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -0
- package/dist/core/agent-session-custom-message-commit.js +141 -0
- package/dist/core/agent-session-custom-message-commit.js.map +1 -0
- package/dist/core/agent-session-delivery-forwarding.d.ts +9 -0
- package/dist/core/agent-session-delivery-forwarding.d.ts.map +1 -0
- package/dist/core/agent-session-delivery-forwarding.js +36 -0
- package/dist/core/agent-session-delivery-forwarding.js.map +1 -0
- package/dist/core/agent-session-events.d.ts +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +45 -14
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +2 -6
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +18 -11
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +5 -2
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +91 -97
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +47 -39
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-models.d.ts +2 -38
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +5 -147
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts +47 -0
- package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -0
- package/dist/core/agent-session-persistent-custom-messages.js +267 -0
- package/dist/core/agent-session-persistent-custom-messages.js.map +1 -0
- package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js +34 -9
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts +2 -0
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +42 -16
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts +10 -0
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -0
- package/dist/core/agent-session-queue-pause.js +86 -0
- package/dist/core/agent-session-queue-pause.js.map +1 -0
- package/dist/core/agent-session-retry.d.ts +0 -11
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +8 -57
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.d.ts +6 -0
- package/dist/core/agent-session-runtime-auth.d.ts.map +1 -0
- package/dist/core/agent-session-runtime-auth.js +26 -0
- package/dist/core/agent-session-runtime-auth.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +13 -2
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +32 -6
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +0 -2
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +6 -7
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +3 -0
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +6 -1
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +2 -18
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.d.ts +4 -0
- package/dist/core/agent-session-transfer.d.ts.map +1 -0
- package/dist/core/agent-session-transfer.js +71 -0
- package/dist/core/agent-session-transfer.js.map +1 -0
- package/dist/core/agent-session-tree.js +1 -1
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +5 -11
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js +0 -3
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +12 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +8 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +31 -33
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/auth-storage.js +2 -2
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts +5 -3
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +5 -4
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +0 -6
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +8 -3
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +17 -6
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts +18 -1
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.js +2 -2
- package/dist/core/compaction/compaction-boundary.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +61 -6
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +242 -18
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts +53 -2
- package/dist/core/compaction/compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/compaction-types.js.map +1 -1
- package/dist/core/compaction/fallback-planner.d.ts +64 -0
- package/dist/core/compaction/fallback-planner.d.ts.map +1 -0
- package/dist/core/compaction/fallback-planner.js +75 -0
- package/dist/core/compaction/fallback-planner.js.map +1 -0
- package/dist/core/compaction/index.d.ts +3 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +3 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/planner-outcome.d.ts +86 -0
- package/dist/core/compaction/planner-outcome.d.ts.map +1 -0
- package/dist/core/compaction/planner-outcome.js +122 -0
- package/dist/core/compaction/planner-outcome.js.map +1 -0
- package/dist/core/compaction/range-planner-diagnostics.d.ts +58 -6
- package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.js +69 -31
- package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
- package/dist/core/compaction/range-planner.d.ts +36 -8
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +136 -51
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/region-trimming.d.ts +34 -0
- package/dist/core/compaction/region-trimming.d.ts.map +1 -0
- package/dist/core/compaction/region-trimming.js +73 -0
- package/dist/core/compaction/region-trimming.js.map +1 -0
- package/dist/core/compaction/transcript-serialization.d.ts +8 -1
- package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
- package/dist/core/compaction/transcript-serialization.js +78 -27
- package/dist/core/compaction/transcript-serialization.js.map +1 -1
- package/dist/core/context-tool-pairing.d.ts +19 -0
- package/dist/core/context-tool-pairing.d.ts.map +1 -0
- package/dist/core/context-tool-pairing.js +50 -0
- package/dist/core/context-tool-pairing.js.map +1 -0
- package/dist/core/diagnostics.d.ts +8 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +3 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -0
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +48 -27
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts +2 -4
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +199 -18
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/message-types.d.ts +7 -4
- package/dist/core/extensions/message-types.d.ts.map +1 -1
- package/dist/core/extensions/message-types.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +9 -4
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +2 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +4 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +28 -20
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +25 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/tool-types.d.ts +7 -3
- package/dist/core/extensions/tool-types.d.ts.map +1 -1
- package/dist/core/extensions/tool-types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +14 -4
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/fallback-models.d.ts +37 -0
- package/dist/core/fallback-models.d.ts.map +1 -0
- package/dist/core/fallback-models.js +48 -0
- package/dist/core/fallback-models.js.map +1 -0
- package/dist/core/flattened-tool-arguments.d.ts +4 -7
- package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
- package/dist/core/flattened-tool-arguments.js +4 -7
- package/dist/core/flattened-tool-arguments.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +0 -5
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/messages.d.ts +14 -2
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +28 -4
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-capabilities.d.ts +18 -0
- package/dist/core/model-capabilities.d.ts.map +1 -0
- package/dist/core/model-capabilities.js +23 -0
- package/dist/core/model-capabilities.js.map +1 -0
- package/dist/core/model-registry-auth.d.ts.map +1 -1
- package/dist/core/model-registry-auth.js +0 -2
- package/dist/core/model-registry-auth.js.map +1 -1
- package/dist/core/model-registry-builtins.d.ts +0 -2
- package/dist/core/model-registry-builtins.d.ts.map +1 -1
- package/dist/core/model-registry-builtins.js +9 -76
- package/dist/core/model-registry-builtins.js.map +1 -1
- package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
- package/dist/core/model-registry-custom-loader.js +1 -12
- package/dist/core/model-registry-custom-loader.js.map +1 -1
- package/dist/core/model-registry-dynamic.d.ts.map +1 -1
- package/dist/core/model-registry-dynamic.js +3 -15
- package/dist/core/model-registry-dynamic.js.map +1 -1
- package/dist/core/model-registry-extension-refresh.d.ts +23 -0
- package/dist/core/model-registry-extension-refresh.d.ts.map +1 -0
- package/dist/core/model-registry-extension-refresh.js +32 -0
- package/dist/core/model-registry-extension-refresh.js.map +1 -0
- package/dist/core/model-registry-schemas.d.ts +118 -9
- package/dist/core/model-registry-schemas.d.ts.map +1 -1
- package/dist/core/model-registry-schemas.js +10 -3
- package/dist/core/model-registry-schemas.js.map +1 -1
- package/dist/core/model-registry-types.d.ts +5 -5
- package/dist/core/model-registry-types.d.ts.map +1 -1
- package/dist/core/model-registry-types.js.map +1 -1
- package/dist/core/model-registry-validation.d.ts +7 -0
- package/dist/core/model-registry-validation.d.ts.map +1 -0
- package/dist/core/model-registry-validation.js +12 -0
- package/dist/core/model-registry-validation.js.map +1 -0
- package/dist/core/model-registry.d.ts +5 -3
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +34 -33
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-defaults.d.ts.map +1 -1
- package/dist/core/model-resolver-defaults.js +0 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.js +9 -0
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-resolver-patterns.d.ts.map +1 -1
- package/dist/core/model-resolver-patterns.js +0 -2
- package/dist/core/model-resolver-patterns.js.map +1 -1
- package/dist/core/model-resolver-scope.d.ts +2 -0
- package/dist/core/model-resolver-scope.d.ts.map +1 -1
- package/dist/core/model-resolver-scope.js +18 -4
- package/dist/core/model-resolver-scope.js.map +1 -1
- package/dist/core/model-resolver-types.d.ts +2 -0
- package/dist/core/model-resolver-types.d.ts.map +1 -1
- package/dist/core/model-resolver-types.js.map +1 -1
- package/dist/core/oauth-provider-bridge.d.ts +21 -0
- package/dist/core/oauth-provider-bridge.d.ts.map +1 -1
- package/dist/core/oauth-provider-bridge.js +68 -7
- package/dist/core/oauth-provider-bridge.js.map +1 -1
- package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
- package/dist/core/package-manager-auto-resources.js +12 -4
- package/dist/core/package-manager-auto-resources.js.map +1 -1
- package/dist/core/package-manager-resolver.d.ts.map +1 -1
- package/dist/core/package-manager-resolver.js +42 -11
- package/dist/core/package-manager-resolver.js.map +1 -1
- package/dist/core/package-manager-types.d.ts +2 -0
- package/dist/core/package-manager-types.d.ts.map +1 -1
- package/dist/core/package-manager-types.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +17 -11
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.js +30 -4
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/resource-loader-context-files.d.ts.map +1 -1
- package/dist/core/resource-loader-context-files.js +3 -1
- package/dist/core/resource-loader-context-files.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +2 -1
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +3 -0
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-extensions.d.ts +1 -0
- package/dist/core/resource-loader-extensions.d.ts.map +1 -1
- package/dist/core/resource-loader-extensions.js +120 -7
- package/dist/core/resource-loader-extensions.js.map +1 -1
- package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
- package/dist/core/resource-loader-package-resources.js +14 -1
- package/dist/core/resource-loader-package-resources.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +2 -1
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-source-info.d.ts.map +1 -1
- package/dist/core/resource-loader-source-info.js +6 -3
- package/dist/core/resource-loader-source-info.js.map +1 -1
- package/dist/core/sdk-types.d.ts +11 -10
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +13 -84
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +3 -3
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +18 -25
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +2 -5
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +2 -8
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +3 -3
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +49 -27
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts +6 -0
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +38 -5
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +6 -6
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +0 -4
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +0 -50
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts +2 -4
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +5 -51
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-storage.d.ts +3 -1
- package/dist/core/settings-storage.d.ts.map +1 -1
- package/dist/core/settings-storage.js +22 -0
- package/dist/core/settings-storage.js.map +1 -1
- package/dist/core/settings-types.d.ts +2 -4
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +69 -23
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +3 -1
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +2 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
- package/dist/core/tools/bash-session-environment.d.ts +13 -0
- package/dist/core/tools/bash-session-environment.d.ts.map +1 -0
- package/dist/core/tools/bash-session-environment.js +35 -0
- package/dist/core/tools/bash-session-environment.js.map +1 -0
- package/dist/core/tools/bash.d.ts +4 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +16 -8
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +3 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +10 -2
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +3 -2
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +9 -3
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/main-session-options.d.ts.map +1 -1
- package/dist/main-session-options.js +0 -4
- package/dist/main-session-options.js.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +2 -1
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -17
- package/dist/main.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/chat-input-actions.d.ts +1 -1
- package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
- package/dist/modes/interactive/chat-input-actions.js +14 -96
- package/dist/modes/interactive/chat-input-actions.js.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.d.ts +9 -8
- package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.js +68 -24
- package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
- package/dist/modes/interactive/components/atomic-working-status.d.ts +52 -0
- package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -0
- package/dist/modes/interactive/components/atomic-working-status.js +202 -0
- package/dist/modes/interactive/components/atomic-working-status.js.map +1 -0
- package/dist/modes/interactive/components/chat-message-renderer.js +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js +99 -7
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.js +3 -3
- package/dist/modes/interactive/components/chat-session-host-editor.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +52 -9
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +23 -7
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +2 -0
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.js +67 -18
- package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts +9 -0
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.js +5 -0
- package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.d.ts +10 -0
- package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +2 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +3 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +9 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +3 -2
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +14 -43
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +18 -13
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/startup-identity.d.ts +22 -0
- package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -0
- package/dist/modes/interactive/components/startup-identity.js +58 -0
- package/dist/modes/interactive/components/startup-identity.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js +0 -6
- package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.js +0 -1
- package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
- package/dist/modes/interactive/components/working-status.d.ts +5 -11
- package/dist/modes/interactive/components/working-status.d.ts.map +1 -1
- package/dist/modes/interactive/components/working-status.js +14 -15
- package/dist/modes/interactive/components/working-status.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +23 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +120 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-agent-events.js +25 -20
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +16 -6
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +3 -0
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.d.ts +2 -1
- package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +8 -0
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +49 -19
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.js +4 -3
- package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +3 -2
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-initial-session-binding.d.ts +4 -0
- package/dist/modes/interactive/interactive-initial-session-binding.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-initial-session-binding.js +23 -0
- package/dist/modes/interactive/interactive-initial-session-binding.js.map +1 -0
- package/dist/modes/interactive/interactive-input-handling.d.ts +2 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +27 -51
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +11 -7
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +14 -6
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +2 -4
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +2 -4
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +9 -8
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.d.ts +2 -3
- package/dist/modes/interactive/interactive-model-catalog-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-catalog-startup.js +3 -6
- package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +26 -97
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-pause.d.ts +4 -0
- package/dist/modes/interactive/interactive-pause.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-pause.js +8 -0
- package/dist/modes/interactive/interactive-pause.js.map +1 -0
- package/dist/modes/interactive/interactive-process-lifecycle.js +5 -4
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-turn.d.ts +2 -0
- package/dist/modes/interactive/interactive-prompt-turn.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-prompt-turn.js +41 -0
- package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -0
- package/dist/modes/interactive/interactive-render-chat.js +20 -8
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-paths.js +11 -2
- package/dist/modes/interactive/interactive-resource-paths.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +99 -0
- package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup-chat-container.d.ts +20 -0
- package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-startup-chat-container.js +26 -0
- package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -0
- package/dist/modes/interactive/interactive-startup.d.ts +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +30 -25
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-summarization-retry-events.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-summarization-retry-events.js +9 -3
- package/dist/modes/interactive/interactive-summarization-retry-events.js.map +1 -1
- package/dist/modes/interactive/theme/catppuccin-frappe.json +1 -1
- package/dist/modes/interactive/theme/catppuccin-latte.json +1 -1
- package/dist/modes/interactive/theme/catppuccin-macchiato.json +1 -1
- package/dist/modes/interactive/theme/catppuccin-mocha.json +9 -1
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts +4 -0
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +7 -0
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.js +4 -0
- package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts +32 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.js +8 -0
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +15 -2
- package/dist/modes/interactive/whimsical-messages.d.ts +1 -0
- package/dist/modes/interactive/whimsical-messages.d.ts.map +1 -1
- package/dist/modes/interactive/whimsical-messages.js +2 -2
- package/dist/modes/interactive/whimsical-messages.js.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js +3 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-args.js +0 -1
- package/dist/modes/interactive-engine/engine-args.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +5 -17
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-render-service.js +8 -19
- package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +2 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +3 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts +10 -0
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -0
- package/dist/modes/interactive-engine/isolated-auth.js +14 -0
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +9 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +46 -34
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +3 -10
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js +10 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/interactive-engine/remote-queue-pause.d.ts +13 -0
- package/dist/modes/interactive-engine/remote-queue-pause.d.ts.map +1 -0
- package/dist/modes/interactive-engine/remote-queue-pause.js +38 -0
- package/dist/modes/interactive-engine/remote-queue-pause.js.map +1 -0
- package/dist/modes/interactive-engine/remote-renderer.d.ts +3 -1
- package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-renderer.js +4 -1
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +5 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +2 -7
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +7 -24
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/queued-writer.d.ts +19 -0
- package/dist/modes/rpc/queued-writer.d.ts.map +1 -0
- package/dist/modes/rpc/{bounded-writer.js → queued-writer.js} +7 -30
- package/dist/modes/rpc/queued-writer.js.map +1 -0
- package/dist/modes/rpc/rpc-bash-request-owners.d.ts +24 -0
- package/dist/modes/rpc/rpc-bash-request-owners.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-bash-request-owners.js +45 -0
- package/dist/modes/rpc/rpc-bash-request-owners.js.map +1 -0
- package/dist/modes/rpc/rpc-client-api.d.ts +8 -5
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +10 -11
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts +1 -4
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +2 -14
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +8 -4
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +21 -30
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts +7 -4
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +76 -93
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-input-scheduler.d.ts +3 -3
- package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-input-scheduler.js +7 -4
- package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +5 -5
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-model-fallback-prompt.d.ts +4 -0
- package/dist/modes/rpc/rpc-model-fallback-prompt.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-model-fallback-prompt.js +11 -0
- package/dist/modes/rpc/rpc-model-fallback-prompt.js.map +1 -0
- package/dist/modes/rpc/rpc-oauth-client.d.ts +22 -0
- package/dist/modes/rpc/rpc-oauth-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-oauth-client.js +74 -0
- package/dist/modes/rpc/rpc-oauth-client.js.map +1 -0
- package/dist/modes/rpc/rpc-oauth-interaction.d.ts +9 -0
- package/dist/modes/rpc/rpc-oauth-interaction.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-oauth-interaction.js +49 -0
- package/dist/modes/rpc/rpc-oauth-interaction.js.map +1 -0
- package/dist/modes/rpc/rpc-output-buffer.d.ts +2 -1
- package/dist/modes/rpc/rpc-output-buffer.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-output-buffer.js +4 -39
- package/dist/modes/rpc/rpc-output-buffer.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +23 -0
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-provider-auth.js +145 -0
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -0
- package/dist/modes/rpc/rpc-responses.d.ts +0 -1
- package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-responses.js +0 -14
- package/dist/modes/rpc/rpc-responses.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +83 -27
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +21 -8
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/changelog.mdx +12 -1
- package/docs/compaction.md +101 -18
- package/docs/custom-provider.md +13 -4
- package/docs/docs.json +1 -0
- package/docs/environment-variables.md +37 -0
- package/docs/extensions.md +45 -9
- package/docs/index.md +1 -0
- package/docs/intercom.md +1 -1
- package/docs/json.md +4 -4
- package/docs/keybindings.md +4 -2
- package/docs/llama-cpp.md +3 -1
- package/docs/models.md +29 -43
- package/docs/providers.md +18 -24
- package/docs/quickstart.md +19 -16
- package/docs/rpc.md +38 -85
- package/docs/sdk.md +15 -22
- package/docs/session-format.md +2 -15
- package/docs/sessions.md +1 -1
- package/docs/settings.md +10 -15
- package/docs/skills.md +8 -0
- package/docs/subagents.md +24 -8
- package/docs/themes.md +10 -1
- package/docs/tui.md +3 -3
- package/docs/usage.md +30 -2
- package/docs/windows.md +1 -1
- package/docs/workflows.md +1128 -522
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/handoff.ts +8 -1
- package/examples/extensions/message-renderer.ts +2 -2
- package/examples/extensions/summarize.ts +3 -0
- package/examples/extensions/working-indicator.ts +2 -2
- package/npm-shrinkwrap.json +40 -46
- package/package.json +9 -7
- package/dist/builtin/cursor/CHANGELOG.md +0 -281
- package/dist/builtin/cursor/LICENSE +0 -26
- package/dist/builtin/cursor/README.md +0 -24
- package/dist/builtin/cursor/index.ts +0 -9
- package/dist/builtin/cursor/package.json +0 -47
- package/dist/builtin/cursor/src/auth.ts +0 -352
- package/dist/builtin/cursor/src/catalog-cache.ts +0 -155
- package/dist/builtin/cursor/src/config.ts +0 -123
- package/dist/builtin/cursor/src/conversation-state.ts +0 -135
- package/dist/builtin/cursor/src/cursor-models-raw.json +0 -412
- package/dist/builtin/cursor/src/model-mapper.ts +0 -369
- package/dist/builtin/cursor/src/model-reference.ts +0 -282
- package/dist/builtin/cursor/src/models.ts +0 -54
- package/dist/builtin/cursor/src/native-loader.ts +0 -71
- package/dist/builtin/cursor/src/proto/README.md +0 -34
- package/dist/builtin/cursor/src/proto/agent_pb.ts +0 -15294
- package/dist/builtin/cursor/src/proto/protobuf-codec-base64.ts +0 -22
- package/dist/builtin/cursor/src/proto/protobuf-codec-json.ts +0 -44
- package/dist/builtin/cursor/src/proto/protobuf-codec-request.ts +0 -311
- package/dist/builtin/cursor/src/proto/protobuf-codec-wire.ts +0 -248
- package/dist/builtin/cursor/src/proto/protobuf-codec.ts +0 -200
- package/dist/builtin/cursor/src/provider.ts +0 -301
- package/dist/builtin/cursor/src/stream.ts +0 -494
- package/dist/builtin/cursor/src/transport-errors.ts +0 -74
- package/dist/builtin/cursor/src/transport-frame.ts +0 -56
- package/dist/builtin/cursor/src/transport-http2.ts +0 -122
- package/dist/builtin/cursor/src/transport-native-client.ts +0 -161
- package/dist/builtin/cursor/src/transport-run-stream.ts +0 -188
- package/dist/builtin/cursor/src/transport-timeouts.ts +0 -87
- package/dist/builtin/cursor/src/transport-types.ts +0 -143
- package/dist/builtin/cursor/src/transport.ts +0 -26
- package/dist/builtin/workflows/builtin/deep-research-codebase-runner.ts +0 -492
- package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +0 -383
- package/dist/builtin/workflows/builtin/deep-research-codebase.d.ts +0 -35
- package/dist/builtin/workflows/builtin/deep-research-codebase.ts +0 -47
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-before-edit.mjs +0 -516
- package/dist/core/context-window.d.ts +0 -54
- package/dist/core/context-window.d.ts.map +0 -1
- package/dist/core/context-window.js +0 -110
- package/dist/core/context-window.js.map +0 -1
- package/dist/core/copilot-anthropic-sse-repair.d.ts +0 -23
- package/dist/core/copilot-anthropic-sse-repair.d.ts.map +0 -1
- package/dist/core/copilot-anthropic-sse-repair.js +0 -340
- package/dist/core/copilot-anthropic-sse-repair.js.map +0 -1
- package/dist/core/copilot-errors.d.ts +0 -9
- package/dist/core/copilot-errors.d.ts.map +0 -1
- package/dist/core/copilot-errors.js +0 -32
- package/dist/core/copilot-errors.js.map +0 -1
- package/dist/core/copilot-gemini-payload-sanitizer.d.ts +0 -72
- package/dist/core/copilot-gemini-payload-sanitizer.d.ts.map +0 -1
- package/dist/core/copilot-gemini-payload-sanitizer.js +0 -296
- package/dist/core/copilot-gemini-payload-sanitizer.js.map +0 -1
- package/dist/core/copilot-gemini-reasoning.d.ts +0 -126
- package/dist/core/copilot-gemini-reasoning.d.ts.map +0 -1
- package/dist/core/copilot-gemini-reasoning.js +0 -265
- package/dist/core/copilot-gemini-reasoning.js.map +0 -1
- package/dist/core/copilot-gemini-tool-arguments.d.ts +0 -42
- package/dist/core/copilot-gemini-tool-arguments.d.ts.map +0 -1
- package/dist/core/copilot-gemini-tool-arguments.js +0 -159
- package/dist/core/copilot-gemini-tool-arguments.js.map +0 -1
- package/dist/core/copilot-hosts.d.ts +0 -12
- package/dist/core/copilot-hosts.d.ts.map +0 -1
- package/dist/core/copilot-hosts.js +0 -33
- package/dist/core/copilot-hosts.js.map +0 -1
- package/dist/core/copilot-model-catalog.d.ts +0 -114
- package/dist/core/copilot-model-catalog.d.ts.map +0 -1
- package/dist/core/copilot-model-catalog.js +0 -392
- package/dist/core/copilot-model-catalog.js.map +0 -1
- package/dist/core/copilot-model-static-fallbacks.d.ts +0 -43
- package/dist/core/copilot-model-static-fallbacks.d.ts.map +0 -1
- package/dist/core/copilot-model-static-fallbacks.js +0 -50
- package/dist/core/copilot-model-static-fallbacks.js.map +0 -1
- package/dist/core/copilot-model-synthesis.d.ts +0 -10
- package/dist/core/copilot-model-synthesis.d.ts.map +0 -1
- package/dist/core/copilot-model-synthesis.js +0 -91
- package/dist/core/copilot-model-synthesis.js.map +0 -1
- package/dist/modes/interactive/components/context-window-selector.d.ts +0 -53
- package/dist/modes/interactive/components/context-window-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/context-window-selector.js +0 -136
- package/dist/modes/interactive/components/context-window-selector.js.map +0 -1
- package/dist/modes/rpc/bounded-writer.d.ts +0 -27
- package/dist/modes/rpc/bounded-writer.d.ts.map +0 -1
- package/dist/modes/rpc/bounded-writer.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface CursorImageBase64Context {
|
|
2
|
-
readonly kind: string;
|
|
3
|
-
readonly mimeType: string;
|
|
4
|
-
readonly index?: number;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// Cursor image protobuf serialization accepts canonical standard base64 after MIME line wrapping is removed.
|
|
8
|
-
const BASE64_WHITESPACE_PATTERN = /[\t\n\f\r ]+/gu;
|
|
9
|
-
const STANDARD_BASE64_PATTERN = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u;
|
|
10
|
-
|
|
11
|
-
export function decodeStrictBase64ImageData(data: string, context: CursorImageBase64Context): Uint8Array {
|
|
12
|
-
const normalized = data.replace(BASE64_WHITESPACE_PATTERN, "");
|
|
13
|
-
if (normalized.length === 0 || normalized.length % 4 !== 0 || !STANDARD_BASE64_PATTERN.test(normalized)) {
|
|
14
|
-
throwInvalidBase64ImageData(context);
|
|
15
|
-
}
|
|
16
|
-
return Buffer.from(normalized, "base64");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function throwInvalidBase64ImageData(context: CursorImageBase64Context): never {
|
|
20
|
-
const index = context.index === undefined ? "" : ` at index ${context.index}`;
|
|
21
|
-
throw new Error(`Invalid ${context.kind} base64 image data${index} for MIME type ${context.mimeType}`);
|
|
22
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { fromBinary, fromJson, toBinary, toJson, type JsonValue as ProtobufJsonValue } from "@bufbuild/protobuf";
|
|
2
|
-
import { ValueSchema } from "@bufbuild/protobuf/wkt";
|
|
3
|
-
import { parseJsonValue, type JsonObject, type JsonValue } from "../config.js";
|
|
4
|
-
|
|
5
|
-
const textEncoder = new TextEncoder();
|
|
6
|
-
const textDecoder = new TextDecoder();
|
|
7
|
-
|
|
8
|
-
export function encodeProtobufValue(value: JsonValue): Uint8Array {
|
|
9
|
-
return toBinary(ValueSchema, fromJson(ValueSchema, value as ProtobufJsonValue));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function encodeMcpArgValue(value: JsonValue): Uint8Array {
|
|
13
|
-
try {
|
|
14
|
-
return encodeProtobufValue(value);
|
|
15
|
-
} catch {
|
|
16
|
-
return textEncoder.encode(String(value));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function encodeMcpArgsMap(args: JsonObject): Record<string, Uint8Array> {
|
|
21
|
-
const encoded: Record<string, Uint8Array> = {};
|
|
22
|
-
for (const [key, value] of Object.entries(args)) encoded[key] = encodeMcpArgValue(value);
|
|
23
|
-
return encoded;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function decodeMcpArgValue(value: Uint8Array): JsonValue {
|
|
27
|
-
try {
|
|
28
|
-
const decoded = toJson(ValueSchema, fromBinary(ValueSchema, value)) as ProtobufJsonValue;
|
|
29
|
-
return parseJsonValue(JSON.stringify(decoded)) ?? null;
|
|
30
|
-
} catch {
|
|
31
|
-
return textDecoder.decode(value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function decodeMcpArgsMap(args: Record<string, Uint8Array>): JsonObject {
|
|
36
|
-
const decoded: JsonObject = {};
|
|
37
|
-
for (const [key, value] of Object.entries(args)) decoded[key] = decodeMcpArgValue(value);
|
|
38
|
-
return decoded;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function serializableJsonValue(value: object): JsonValue {
|
|
42
|
-
return parseJsonValue(JSON.stringify(value)) ?? {};
|
|
43
|
-
}
|
|
44
|
-
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
import { create, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
3
|
-
import type { ImageContent } from "@earendil-works/pi-ai/compat";
|
|
4
|
-
import { parseJsonObject, type JsonObject } from "../config.js";
|
|
5
|
-
import type { CursorRunRequest, CursorToolResultContent } from "../transport.js";
|
|
6
|
-
import {
|
|
7
|
-
AgentClientMessageSchema,
|
|
8
|
-
AgentConversationTurnStructureSchema,
|
|
9
|
-
AgentRunRequestSchema,
|
|
10
|
-
AssistantMessageSchema,
|
|
11
|
-
ConversationActionSchema,
|
|
12
|
-
ConversationStateStructureSchema,
|
|
13
|
-
ConversationStepSchema,
|
|
14
|
-
ConversationTurnStructureSchema,
|
|
15
|
-
McpArgsSchema,
|
|
16
|
-
McpToolCallSchema,
|
|
17
|
-
McpToolDefinitionSchema,
|
|
18
|
-
ModelDetailsSchema,
|
|
19
|
-
SelectedContextSchema,
|
|
20
|
-
SelectedImageSchema,
|
|
21
|
-
ToolCallSchema,
|
|
22
|
-
UserMessageActionSchema,
|
|
23
|
-
UserMessageSchema,
|
|
24
|
-
type ConversationStateStructure,
|
|
25
|
-
type McpToolDefinition,
|
|
26
|
-
type SelectedImage,
|
|
27
|
-
type UserMessage,
|
|
28
|
-
} from "./agent_pb.js";
|
|
29
|
-
import { encodeMcpArgsMap, encodeProtobufValue, serializableJsonValue } from "./protobuf-codec-json.js";
|
|
30
|
-
import { decodeStrictBase64ImageData } from "./protobuf-codec-base64.js";
|
|
31
|
-
import { createMcpToolCallResult } from "./protobuf-codec-wire.js";
|
|
32
|
-
|
|
33
|
-
export interface ParsedAssistantTextStep {
|
|
34
|
-
readonly kind: "assistantText";
|
|
35
|
-
readonly text: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ParsedToolCallStep {
|
|
39
|
-
readonly kind: "toolCall";
|
|
40
|
-
readonly toolCallId: string;
|
|
41
|
-
readonly toolName: string;
|
|
42
|
-
readonly arguments: JsonObject;
|
|
43
|
-
result?: { readonly content: string | readonly CursorToolResultContent[]; readonly isError: boolean; readonly fallbackText?: string };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type ParsedTurnStep = ParsedAssistantTextStep | ParsedToolCallStep;
|
|
47
|
-
|
|
48
|
-
export interface ParsedTurn {
|
|
49
|
-
readonly userText: string;
|
|
50
|
-
readonly userImages: readonly ImageContent[];
|
|
51
|
-
readonly steps: ParsedTurnStep[];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const CURSOR_PROTO_CLIENT_NAME = "pi";
|
|
55
|
-
const textEncoder = new TextEncoder();
|
|
56
|
-
export function buildMcpToolDefinitions(request: CursorRunRequest): readonly McpToolDefinition[] {
|
|
57
|
-
return (request.context.tools ?? []).map((tool) => {
|
|
58
|
-
const jsonSchema = serializableJsonValue(tool.parameters);
|
|
59
|
-
return create(McpToolDefinitionSchema, {
|
|
60
|
-
name: tool.name,
|
|
61
|
-
description: tool.description,
|
|
62
|
-
providerIdentifier: CURSOR_PROTO_CLIENT_NAME,
|
|
63
|
-
toolName: tool.name,
|
|
64
|
-
inputSchema: encodeProtobufValue(jsonSchema),
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function buildCursorRequest(
|
|
70
|
-
modelId: string,
|
|
71
|
-
systemPrompt: string,
|
|
72
|
-
userText: string,
|
|
73
|
-
turns: readonly ParsedTurn[],
|
|
74
|
-
conversationId: string,
|
|
75
|
-
checkpoint: Uint8Array | null,
|
|
76
|
-
existingBlobStore?: Map<string, Uint8Array>,
|
|
77
|
-
userImages: readonly ImageContent[] = [],
|
|
78
|
-
): { readonly requestBytes: Uint8Array; readonly blobStore: Map<string, Uint8Array> } {
|
|
79
|
-
const blobStore = new Map<string, Uint8Array>(existingBlobStore ?? []);
|
|
80
|
-
const systemBlobId = storeAsBlob(textEncoder.encode(JSON.stringify({ role: "system", content: systemPrompt })), blobStore);
|
|
81
|
-
const selectedContextBlob = storeAsBlob(buildSelectedContextBlob([systemBlobId], CURSOR_PROTO_CLIENT_NAME), blobStore);
|
|
82
|
-
const conversationState = checkpoint
|
|
83
|
-
? fromBinary(ConversationStateStructureSchema, checkpoint)
|
|
84
|
-
: buildConversationState(turns, blobStore, systemBlobId, selectedContextBlob);
|
|
85
|
-
const userMessage = createUserMessage(userText, selectedContextBlob, userImages);
|
|
86
|
-
const action = create(ConversationActionSchema, {
|
|
87
|
-
action: { case: "userMessageAction", value: create(UserMessageActionSchema, { userMessage }) },
|
|
88
|
-
});
|
|
89
|
-
const modelDetails = create(ModelDetailsSchema, { modelId, displayModelId: modelId, displayName: modelId });
|
|
90
|
-
const runRequest = create(AgentRunRequestSchema, { conversationState, action, modelDetails, conversationId });
|
|
91
|
-
const clientMessage = create(AgentClientMessageSchema, {
|
|
92
|
-
message: { case: "runRequest", value: runRequest },
|
|
93
|
-
});
|
|
94
|
-
return { requestBytes: toBinary(AgentClientMessageSchema, clientMessage), blobStore };
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function buildConversationState(
|
|
98
|
-
turns: readonly ParsedTurn[],
|
|
99
|
-
blobStore: Map<string, Uint8Array>,
|
|
100
|
-
systemBlobId: Uint8Array,
|
|
101
|
-
selectedContextBlob: Uint8Array,
|
|
102
|
-
): ConversationStateStructure {
|
|
103
|
-
const turnBlobIds: Uint8Array[] = [];
|
|
104
|
-
for (const turn of turns) {
|
|
105
|
-
const userMessage = createUserMessage(turn.userText, selectedContextBlob, turn.userImages);
|
|
106
|
-
const userMessageBlobId = storeAsBlob(toBinary(UserMessageSchema, userMessage), blobStore);
|
|
107
|
-
const stepBlobIds = turn.steps.map((step) => storeAsBlob(buildTurnStepBytes(step), blobStore));
|
|
108
|
-
const agentTurn = create(AgentConversationTurnStructureSchema, {
|
|
109
|
-
userMessage: userMessageBlobId,
|
|
110
|
-
steps: stepBlobIds,
|
|
111
|
-
requestId: randomUUID(),
|
|
112
|
-
});
|
|
113
|
-
const turnStructure = create(ConversationTurnStructureSchema, {
|
|
114
|
-
turn: { case: "agentConversationTurn", value: agentTurn },
|
|
115
|
-
});
|
|
116
|
-
turnBlobIds.push(storeAsBlob(toBinary(ConversationTurnStructureSchema, turnStructure), blobStore));
|
|
117
|
-
}
|
|
118
|
-
return create(ConversationStateStructureSchema, {
|
|
119
|
-
rootPromptMessagesJson: [systemBlobId],
|
|
120
|
-
turns: turnBlobIds,
|
|
121
|
-
todos: [],
|
|
122
|
-
pendingToolCalls: [],
|
|
123
|
-
previousWorkspaceUris: [],
|
|
124
|
-
mode: 1,
|
|
125
|
-
fileStates: {},
|
|
126
|
-
fileStatesV2: {},
|
|
127
|
-
summaryArchives: [],
|
|
128
|
-
turnTimings: [],
|
|
129
|
-
subagentStates: {},
|
|
130
|
-
selfSummaryCount: 0,
|
|
131
|
-
readPaths: [],
|
|
132
|
-
clientName: CURSOR_PROTO_CLIENT_NAME,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function createUserMessage(text: string, selectedContextBlob: Uint8Array, images: readonly ImageContent[] = []): UserMessage {
|
|
137
|
-
const messageId = randomUUID();
|
|
138
|
-
const selectedImages = images.map((image, index) => createSelectedImage(image, index));
|
|
139
|
-
return create(UserMessageSchema, {
|
|
140
|
-
text,
|
|
141
|
-
messageId,
|
|
142
|
-
selectedContext: create(SelectedContextSchema, { selectedImages }),
|
|
143
|
-
mode: 1,
|
|
144
|
-
selectedContextBlob,
|
|
145
|
-
correlationId: messageId,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function createSelectedImage(image: ImageContent, index: number): SelectedImage {
|
|
150
|
-
const data = decodeStrictBase64ImageData(image.data, { kind: "selected image", mimeType: image.mimeType, index });
|
|
151
|
-
const hash = createHash("sha256").update(data).digest("hex").slice(0, 16);
|
|
152
|
-
return create(SelectedImageSchema, {
|
|
153
|
-
uuid: randomUUID(),
|
|
154
|
-
path: `/atomic/inline-images/${hash}-${index}.${extensionForMimeType(image.mimeType)}`,
|
|
155
|
-
mimeType: image.mimeType,
|
|
156
|
-
dataOrBlobId: { case: "data", value: data },
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function extensionForMimeType(mimeType: string): string {
|
|
161
|
-
const normalized = mimeType.toLowerCase();
|
|
162
|
-
if (normalized === "image/jpeg" || normalized === "image/jpg") return "jpg";
|
|
163
|
-
if (normalized === "image/png") return "png";
|
|
164
|
-
if (normalized === "image/gif") return "gif";
|
|
165
|
-
if (normalized === "image/webp") return "webp";
|
|
166
|
-
return "img";
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function buildTurnStepBytes(step: ParsedTurnStep): Uint8Array {
|
|
170
|
-
if (step.kind === "assistantText") {
|
|
171
|
-
return toBinary(ConversationStepSchema, create(ConversationStepSchema, {
|
|
172
|
-
message: { case: "assistantMessage", value: create(AssistantMessageSchema, { text: step.text }) },
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
const toolName = step.toolName || "tool";
|
|
176
|
-
const mcpToolCall = create(McpToolCallSchema, {
|
|
177
|
-
args: create(McpArgsSchema, {
|
|
178
|
-
name: toolName,
|
|
179
|
-
args: encodeMcpArgsMap(step.arguments),
|
|
180
|
-
toolCallId: step.toolCallId,
|
|
181
|
-
providerIdentifier: CURSOR_PROTO_CLIENT_NAME,
|
|
182
|
-
toolName,
|
|
183
|
-
}),
|
|
184
|
-
...(step.result ? { result: createMcpToolCallResult(step.result.content, step.result.isError, step.result.fallbackText ?? "") } : {}),
|
|
185
|
-
});
|
|
186
|
-
return toBinary(ConversationStepSchema, create(ConversationStepSchema, {
|
|
187
|
-
message: {
|
|
188
|
-
case: "toolCall",
|
|
189
|
-
value: create(ToolCallSchema, { tool: { case: "mcpToolCall", value: mcpToolCall } }),
|
|
190
|
-
},
|
|
191
|
-
}));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function parseHistoricalTurns(messages: readonly CursorRunRequest["context"]["messages"][number][]): readonly ParsedTurn[] {
|
|
195
|
-
const turns: ParsedTurn[] = [];
|
|
196
|
-
let currentTurn: { userText: string; userImages: readonly ImageContent[]; steps: ParsedTurnStep[]; toolCallById: Map<string, ParsedToolCallStep> } | undefined;
|
|
197
|
-
const ensureTurn = (): { userText: string; userImages: readonly ImageContent[]; steps: ParsedTurnStep[]; toolCallById: Map<string, ParsedToolCallStep> } => {
|
|
198
|
-
currentTurn ??= { userText: "", userImages: [], steps: [], toolCallById: new Map() };
|
|
199
|
-
return currentTurn;
|
|
200
|
-
};
|
|
201
|
-
const flushTurn = (): void => {
|
|
202
|
-
if (!currentTurn) return;
|
|
203
|
-
if (currentTurn.userText || currentTurn.userImages.length > 0 || currentTurn.steps.length > 0) {
|
|
204
|
-
turns.push({ userText: currentTurn.userText, userImages: currentTurn.userImages, steps: currentTurn.steps });
|
|
205
|
-
}
|
|
206
|
-
currentTurn = undefined;
|
|
207
|
-
};
|
|
208
|
-
for (const message of messages) {
|
|
209
|
-
if (message.role === "user") {
|
|
210
|
-
flushTurn();
|
|
211
|
-
currentTurn = { userText: textFromMessage(message), userImages: imagesFromUserMessage(message), steps: [], toolCallById: new Map() };
|
|
212
|
-
} else if (message.role === "assistant") {
|
|
213
|
-
const turn = ensureTurn();
|
|
214
|
-
for (const part of message.content) {
|
|
215
|
-
if (part.type === "text") appendAssistantTextStep(turn.steps, part.text);
|
|
216
|
-
else if (part.type === "thinking") appendAssistantTextStep(turn.steps, part.thinking);
|
|
217
|
-
else {
|
|
218
|
-
const step: ParsedToolCallStep = { kind: "toolCall", toolCallId: part.id, toolName: part.name, arguments: parseJsonObject(JSON.stringify(part.arguments)) ?? {} };
|
|
219
|
-
turn.steps.push(step);
|
|
220
|
-
turn.toolCallById.set(step.toolCallId, step);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
} else {
|
|
224
|
-
const turn = ensureTurn();
|
|
225
|
-
let step = turn.toolCallById.get(message.toolCallId);
|
|
226
|
-
if (!step) {
|
|
227
|
-
step = { kind: "toolCall", toolCallId: message.toolCallId, toolName: message.toolName, arguments: {} };
|
|
228
|
-
turn.steps.push(step);
|
|
229
|
-
turn.toolCallById.set(step.toolCallId, step);
|
|
230
|
-
}
|
|
231
|
-
step.result = { content: message.content, isError: message.isError, fallbackText: rawToolResultText(message) };
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
flushTurn();
|
|
235
|
-
return turns;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function appendAssistantTextStep(steps: ParsedTurnStep[], text: string): void {
|
|
239
|
-
if (!text) return;
|
|
240
|
-
const last = steps.at(-1);
|
|
241
|
-
if (last?.kind === "assistantText") {
|
|
242
|
-
steps[steps.length - 1] = { kind: "assistantText", text: `${last.text}${text}` };
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
steps.push({ kind: "assistantText", text });
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export function extractCurrentActionText(request: CursorRunRequest): string {
|
|
249
|
-
const last = request.context.messages.at(-1);
|
|
250
|
-
return last ? textFromMessage(last) : "";
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export function extractCurrentActionImages(request: CursorRunRequest): readonly ImageContent[] {
|
|
254
|
-
const last = request.context.messages.at(-1);
|
|
255
|
-
if (!last || last.role !== "user") return [];
|
|
256
|
-
return imagesFromUserMessage(last);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function imagesFromUserMessage(message: Extract<CursorRunRequest["context"]["messages"][number], { readonly role: "user" }>): readonly ImageContent[] {
|
|
260
|
-
if (typeof message.content === "string") return [];
|
|
261
|
-
return message.content.filter((part): part is ImageContent => part.type === "image");
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function rawToolResultText(message: Extract<CursorRunRequest["context"]["messages"][number], { readonly role: "toolResult" }>): string {
|
|
265
|
-
return message.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n");
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function textFromMessage(message: CursorRunRequest["context"]["messages"][number]): string {
|
|
269
|
-
if (message.role === "user") {
|
|
270
|
-
if (typeof message.content === "string") return message.content;
|
|
271
|
-
return message.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n");
|
|
272
|
-
}
|
|
273
|
-
if (message.role === "assistant") {
|
|
274
|
-
return message.content.map((part) => {
|
|
275
|
-
if (part.type === "text") return part.text;
|
|
276
|
-
if (part.type === "thinking") return part.thinking;
|
|
277
|
-
return `toolCall:${part.id}:${part.name}:${JSON.stringify(part.arguments)}`;
|
|
278
|
-
}).join("\n");
|
|
279
|
-
}
|
|
280
|
-
return rawToolResultText(message);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function buildSelectedContextBlob(rootPromptBlobIds: readonly Uint8Array[], clientName: string): Uint8Array {
|
|
284
|
-
const parts: Uint8Array[] = [];
|
|
285
|
-
for (const blobId of rootPromptBlobIds) {
|
|
286
|
-
parts.push(new Uint8Array([0x0a, blobId.length, ...blobId]));
|
|
287
|
-
}
|
|
288
|
-
const clientBytes = textEncoder.encode(clientName);
|
|
289
|
-
parts.push(new Uint8Array([0xb2, 0x01, clientBytes.length, ...clientBytes]));
|
|
290
|
-
return concatBytes(...parts);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function storeAsBlob(data: Uint8Array, blobStore: Map<string, Uint8Array>): Uint8Array {
|
|
294
|
-
const blobId = new Uint8Array(createHash("sha256").update(data).digest());
|
|
295
|
-
blobStore.set(blobKey(blobId), data);
|
|
296
|
-
return blobId;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export function blobKey(blobId: Uint8Array): string {
|
|
300
|
-
return Buffer.from(blobId).toString("hex");
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function concatBytes(...parts: readonly Uint8Array[]): Uint8Array {
|
|
304
|
-
const output = new Uint8Array(parts.reduce((sum, part) => sum + part.length, 0));
|
|
305
|
-
let offset = 0;
|
|
306
|
-
for (const part of parts) {
|
|
307
|
-
output.set(part, offset);
|
|
308
|
-
offset += part.length;
|
|
309
|
-
}
|
|
310
|
-
return output;
|
|
311
|
-
}
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { create, toBinary } from "@bufbuild/protobuf";
|
|
3
|
-
import type { CursorControlMessage, CursorProtocolMessage, CursorServerMessage, CursorToolResultContent } from "../transport.js";
|
|
4
|
-
import {
|
|
5
|
-
AgentClientMessageSchema,
|
|
6
|
-
BackgroundShellSpawnResultSchema,
|
|
7
|
-
ConversationStateStructureSchema,
|
|
8
|
-
DeleteRejectedSchema,
|
|
9
|
-
DeleteResultSchema,
|
|
10
|
-
DiagnosticsResultSchema,
|
|
11
|
-
ExecClientMessageSchema,
|
|
12
|
-
FetchErrorSchema,
|
|
13
|
-
FetchResultSchema,
|
|
14
|
-
GrepErrorSchema,
|
|
15
|
-
GrepResultSchema,
|
|
16
|
-
KvClientMessageSchema,
|
|
17
|
-
LsRejectedSchema,
|
|
18
|
-
LsResultSchema,
|
|
19
|
-
McpErrorSchema,
|
|
20
|
-
McpImageContentSchema,
|
|
21
|
-
McpResultSchema,
|
|
22
|
-
McpSuccessSchema,
|
|
23
|
-
McpTextContentSchema,
|
|
24
|
-
McpToolErrorSchema,
|
|
25
|
-
McpToolResultContentItemSchema,
|
|
26
|
-
McpToolResultSchema,
|
|
27
|
-
ReadRejectedSchema,
|
|
28
|
-
ReadResultSchema,
|
|
29
|
-
RequestContextResultSchema,
|
|
30
|
-
RequestContextSchema,
|
|
31
|
-
RequestContextSuccessSchema,
|
|
32
|
-
ShellRejectedSchema,
|
|
33
|
-
ShellResultSchema,
|
|
34
|
-
ShellStreamSchema,
|
|
35
|
-
WriteRejectedSchema,
|
|
36
|
-
WriteResultSchema,
|
|
37
|
-
WriteShellStdinErrorSchema,
|
|
38
|
-
WriteShellStdinResultSchema,
|
|
39
|
-
type AgentServerMessage,
|
|
40
|
-
type ExecServerMessage,
|
|
41
|
-
type KvServerMessage,
|
|
42
|
-
type McpToolDefinition,
|
|
43
|
-
} from "./agent_pb.js";
|
|
44
|
-
import { decodeStrictBase64ImageData } from "./protobuf-codec-base64.js";
|
|
45
|
-
import { decodeMcpArgsMap } from "./protobuf-codec-json.js";
|
|
46
|
-
|
|
47
|
-
const NATIVE_EXEC_REJECT_REASON = "Tool not available in this environment. Use the MCP tools provided instead.";
|
|
48
|
-
|
|
49
|
-
const EXEC_CASE_FIELD_NUMBERS: ReadonlyMap<string, number> = new Map([
|
|
50
|
-
["shellArgs", 2],
|
|
51
|
-
["writeArgs", 3],
|
|
52
|
-
["deleteArgs", 4],
|
|
53
|
-
["grepArgs", 5],
|
|
54
|
-
["readArgs", 7],
|
|
55
|
-
["lsArgs", 8],
|
|
56
|
-
["diagnosticsArgs", 9],
|
|
57
|
-
["requestContextArgs", 10],
|
|
58
|
-
["mcpArgs", 11],
|
|
59
|
-
["shellStreamArgs", 14],
|
|
60
|
-
["backgroundShellSpawnArgs", 16],
|
|
61
|
-
["listMcpResourcesExecArgs", 17],
|
|
62
|
-
["readMcpResourceExecArgs", 18],
|
|
63
|
-
["fetchArgs", 20],
|
|
64
|
-
["recordScreenArgs", 21],
|
|
65
|
-
["computerUseArgs", 22],
|
|
66
|
-
["writeShellStdinArgs", 23],
|
|
67
|
-
]);
|
|
68
|
-
|
|
69
|
-
export function decodeAgentServerMessage(message: AgentServerMessage): readonly CursorProtocolMessage[] {
|
|
70
|
-
switch (message.message.case) {
|
|
71
|
-
case "interactionUpdate": {
|
|
72
|
-
const update = message.message.value;
|
|
73
|
-
if (update.message.case === "textDelta") return update.message.value.text ? [{ type: "textDelta", text: update.message.value.text }] : [];
|
|
74
|
-
if (update.message.case === "thinkingDelta") return update.message.value.text ? [{ type: "thinkingDelta", text: update.message.value.text }] : [];
|
|
75
|
-
if (update.message.case === "tokenDelta") return [{ type: "usage", kind: "outputDelta", outputTokens: update.message.value.tokens }];
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
case "conversationCheckpointUpdate": {
|
|
79
|
-
const checkpointState = message.message.value;
|
|
80
|
-
const checkpoint = toBinary(ConversationStateStructureSchema, checkpointState);
|
|
81
|
-
const messages: CursorProtocolMessage[] = [{ type: "conversationCheckpoint", checkpoint }];
|
|
82
|
-
if (checkpointState.tokenDetails) messages.push({ type: "usage", kind: "checkpoint", usedTokens: checkpointState.tokenDetails.usedTokens });
|
|
83
|
-
return messages;
|
|
84
|
-
}
|
|
85
|
-
case "kvServerMessage":
|
|
86
|
-
return decodeKvServerMessage(message.message.value);
|
|
87
|
-
case "execServerMessage":
|
|
88
|
-
return decodeExecServerMessage(message.message.value);
|
|
89
|
-
case "interactionQuery":
|
|
90
|
-
return [];
|
|
91
|
-
default:
|
|
92
|
-
return [];
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function decodeKvServerMessage(kvMessage: KvServerMessage): readonly CursorControlMessage[] {
|
|
97
|
-
if (kvMessage.message.case === "getBlobArgs") return [{ type: "kvGetBlob", id: kvMessage.id, blobId: kvMessage.message.value.blobId }];
|
|
98
|
-
if (kvMessage.message.case === "setBlobArgs") {
|
|
99
|
-
return [{ type: "kvSetBlob", id: kvMessage.id, blobId: kvMessage.message.value.blobId, blobData: kvMessage.message.value.blobData }];
|
|
100
|
-
}
|
|
101
|
-
return [];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function decodeExecServerMessage(execMessage: ExecServerMessage): readonly CursorProtocolMessage[] {
|
|
105
|
-
const execCase = execMessage.message.case;
|
|
106
|
-
if (execCase === "requestContextArgs") {
|
|
107
|
-
return [{ type: "requestContext", ...(execMessage.execId ? { execId: execMessage.execId } : {}), execNumericId: execMessage.id }];
|
|
108
|
-
}
|
|
109
|
-
if (execCase === "mcpArgs") {
|
|
110
|
-
const mcpArgs = execMessage.message.value;
|
|
111
|
-
return [{
|
|
112
|
-
type: "toolCall",
|
|
113
|
-
id: mcpArgs.toolCallId || randomUUID(),
|
|
114
|
-
name: mcpArgs.toolName || mcpArgs.name || "cursor_tool",
|
|
115
|
-
argumentsJson: JSON.stringify(decodeMcpArgsMap(mcpArgs.args ?? {})),
|
|
116
|
-
...(execMessage.execId ? { execId: execMessage.execId } : {}),
|
|
117
|
-
execNumericId: execMessage.id,
|
|
118
|
-
}];
|
|
119
|
-
}
|
|
120
|
-
const fieldNumber = execCase ? EXEC_CASE_FIELD_NUMBERS.get(execCase) : undefined;
|
|
121
|
-
return fieldNumber === undefined ? [] : [{ type: "nonMcpExec", fieldNumber, ...(execMessage.execId ? { execId: execMessage.execId } : {}), execNumericId: execMessage.id }];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function encodeKvClientMessage(id: number, messageCase: "getBlobResult" | "setBlobResult", value: unknown): Uint8Array {
|
|
125
|
-
const response = create(KvClientMessageSchema, { id, message: { case: messageCase, value } as never });
|
|
126
|
-
const clientMessage = create(AgentClientMessageSchema, { message: { case: "kvClientMessage", value: response } });
|
|
127
|
-
return toBinary(AgentClientMessageSchema, clientMessage);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function encodeRequestContextResult(message: Extract<CursorControlMessage, { readonly type: "requestContext" }>, toolDefinitions: readonly McpToolDefinition[]): Uint8Array {
|
|
131
|
-
const requestContext = create(RequestContextSchema, {
|
|
132
|
-
rules: [],
|
|
133
|
-
repositoryInfo: [],
|
|
134
|
-
tools: [...toolDefinitions],
|
|
135
|
-
gitRepos: [],
|
|
136
|
-
projectLayouts: [],
|
|
137
|
-
mcpInstructions: [],
|
|
138
|
-
fileContents: {},
|
|
139
|
-
customSubagents: [],
|
|
140
|
-
});
|
|
141
|
-
const result = create(RequestContextResultSchema, {
|
|
142
|
-
result: { case: "success", value: create(RequestContextSuccessSchema, { requestContext }) },
|
|
143
|
-
});
|
|
144
|
-
return encodeExecClientMessage(message.execNumericId, message.execId, "requestContextResult", result);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export function encodeNativeExecRejection(message: Extract<CursorServerMessage, { readonly type: "nonMcpExec" }>): Uint8Array | undefined {
|
|
148
|
-
const result = createNativeExecResult(message.fieldNumber);
|
|
149
|
-
return result ? encodeExecClientMessage(message.execNumericId, message.execId, result.caseName, result.value) : undefined;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function createNativeExecResult(fieldNumber: number): { readonly caseName: string; readonly value: unknown } | undefined {
|
|
153
|
-
switch (fieldNumber) {
|
|
154
|
-
case 2:
|
|
155
|
-
return { caseName: "shellResult", value: create(ShellResultSchema, { result: { case: "rejected", value: createShellRejected() } }) };
|
|
156
|
-
case 3:
|
|
157
|
-
return { caseName: "writeResult", value: create(WriteResultSchema, { result: { case: "rejected", value: create(WriteRejectedSchema, { path: "", reason: NATIVE_EXEC_REJECT_REASON }) } }) };
|
|
158
|
-
case 4:
|
|
159
|
-
return { caseName: "deleteResult", value: create(DeleteResultSchema, { result: { case: "rejected", value: create(DeleteRejectedSchema, { path: "", reason: NATIVE_EXEC_REJECT_REASON }) } }) };
|
|
160
|
-
case 5:
|
|
161
|
-
return { caseName: "grepResult", value: create(GrepResultSchema, { result: { case: "error", value: create(GrepErrorSchema, { error: NATIVE_EXEC_REJECT_REASON }) } }) };
|
|
162
|
-
case 7:
|
|
163
|
-
return { caseName: "readResult", value: create(ReadResultSchema, { result: { case: "rejected", value: create(ReadRejectedSchema, { path: "", reason: NATIVE_EXEC_REJECT_REASON }) } }) };
|
|
164
|
-
case 8:
|
|
165
|
-
return { caseName: "lsResult", value: create(LsResultSchema, { result: { case: "rejected", value: create(LsRejectedSchema, { path: "", reason: NATIVE_EXEC_REJECT_REASON }) } }) };
|
|
166
|
-
case 9:
|
|
167
|
-
return { caseName: "diagnosticsResult", value: create(DiagnosticsResultSchema, {}) };
|
|
168
|
-
case 14:
|
|
169
|
-
return { caseName: "shellStream", value: create(ShellStreamSchema, { event: { case: "rejected", value: createShellRejected() } }) };
|
|
170
|
-
case 16:
|
|
171
|
-
return { caseName: "backgroundShellSpawnResult", value: create(BackgroundShellSpawnResultSchema, { result: { case: "rejected", value: createShellRejected() } }) };
|
|
172
|
-
case 17:
|
|
173
|
-
return { caseName: "listMcpResourcesExecResult", value: create(McpResultSchema, {}) };
|
|
174
|
-
case 18:
|
|
175
|
-
return { caseName: "readMcpResourceExecResult", value: create(McpResultSchema, {}) };
|
|
176
|
-
case 20:
|
|
177
|
-
return { caseName: "fetchResult", value: create(FetchResultSchema, { result: { case: "error", value: create(FetchErrorSchema, { url: "", error: NATIVE_EXEC_REJECT_REASON }) } }) };
|
|
178
|
-
case 21:
|
|
179
|
-
return { caseName: "recordScreenResult", value: create(McpResultSchema, {}) };
|
|
180
|
-
case 22:
|
|
181
|
-
return { caseName: "computerUseResult", value: create(McpResultSchema, {}) };
|
|
182
|
-
case 23:
|
|
183
|
-
return { caseName: "writeShellStdinResult", value: create(WriteShellStdinResultSchema, { result: { case: "error", value: create(WriteShellStdinErrorSchema, { error: NATIVE_EXEC_REJECT_REASON }) } }) };
|
|
184
|
-
default:
|
|
185
|
-
return undefined;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function createShellRejected(): ReturnType<typeof create<typeof ShellRejectedSchema>> {
|
|
190
|
-
return create(ShellRejectedSchema, {
|
|
191
|
-
command: "",
|
|
192
|
-
workingDirectory: "",
|
|
193
|
-
reason: NATIVE_EXEC_REJECT_REASON,
|
|
194
|
-
isReadonly: false,
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export function encodeExecClientMessage(execNumericId: number | undefined, execId: string | undefined, messageCase: string, value: unknown): Uint8Array {
|
|
199
|
-
const execClientMessage = create(ExecClientMessageSchema, {
|
|
200
|
-
id: execNumericId ?? 0,
|
|
201
|
-
execId: execId ?? "",
|
|
202
|
-
message: { case: messageCase, value } as never,
|
|
203
|
-
});
|
|
204
|
-
const clientMessage = create(AgentClientMessageSchema, { message: { case: "execClientMessage", value: execClientMessage } });
|
|
205
|
-
return toBinary(AgentClientMessageSchema, clientMessage);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export function createMcpToolResult(content: string | readonly CursorToolResultContent[], isError: boolean, fallbackText = ""): ReturnType<typeof create<typeof McpResultSchema>> {
|
|
209
|
-
const text = typeof content === "string" ? content : fallbackText;
|
|
210
|
-
if (isError) {
|
|
211
|
-
return create(McpResultSchema, { result: { case: "error", value: create(McpErrorSchema, { error: text }) } });
|
|
212
|
-
}
|
|
213
|
-
return create(McpResultSchema, {
|
|
214
|
-
result: {
|
|
215
|
-
case: "success",
|
|
216
|
-
value: createMcpSuccess(content, fallbackText),
|
|
217
|
-
},
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export function createMcpToolCallResult(content: string | readonly CursorToolResultContent[], isError: boolean, fallbackText = ""): ReturnType<typeof create<typeof McpToolResultSchema>> {
|
|
222
|
-
const text = typeof content === "string" ? content : fallbackText;
|
|
223
|
-
if (isError) {
|
|
224
|
-
return create(McpToolResultSchema, { result: { case: "error", value: create(McpToolErrorSchema, { error: text }) } });
|
|
225
|
-
}
|
|
226
|
-
return create(McpToolResultSchema, { result: { case: "success", value: createMcpSuccess(content, fallbackText) } });
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function createMcpSuccess(content: string | readonly CursorToolResultContent[], fallbackText: string): ReturnType<typeof create<typeof McpSuccessSchema>> {
|
|
230
|
-
const items = typeof content === "string"
|
|
231
|
-
? [createTextContentItem(content)]
|
|
232
|
-
: content.map((part, index) => part.type === "text" ? createTextContentItem(part.text) : createImageContentItem(part.data, part.mimeType, index));
|
|
233
|
-
return create(McpSuccessSchema, {
|
|
234
|
-
content: items.length > 0 ? items : [createTextContentItem(fallbackText)],
|
|
235
|
-
isError: false,
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function createTextContentItem(text: string): ReturnType<typeof create<typeof McpToolResultContentItemSchema>> {
|
|
240
|
-
return create(McpToolResultContentItemSchema, { content: { case: "text", value: create(McpTextContentSchema, { text }) } });
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
function createImageContentItem(data: string, mimeType: string, index: number): ReturnType<typeof create<typeof McpToolResultContentItemSchema>> {
|
|
244
|
-
return create(McpToolResultContentItemSchema, {
|
|
245
|
-
content: { case: "image", value: create(McpImageContentSchema, { data: decodeStrictBase64ImageData(data, { kind: "MCP image", mimeType, index }), mimeType }) },
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|