@useconvoy/cli 0.48.0
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/LICENSE +90 -0
- package/README.md +495 -0
- package/dist/bin/convoy.d.ts +2 -0
- package/dist/bin/convoy.js +129 -0
- package/dist/bin/convoy.js.map +1 -0
- package/dist/marketplace/.claude-plugin/marketplace.json +14 -0
- package/dist/marketplace/opensana/.claude-plugin/plugin.json +5 -0
- package/dist/marketplace/opensana/README.md +90 -0
- package/dist/marketplace/opensana/skills/tasks/SKILL.md +133 -0
- package/dist/marketplace/opensana/skills/tasks/references/mcp-setup.md +164 -0
- package/dist/src/agent/app/chunk-flush-buffer.d.ts +35 -0
- package/dist/src/agent/app/chunk-flush-buffer.js +133 -0
- package/dist/src/agent/app/chunk-flush-buffer.js.map +1 -0
- package/dist/src/agent/app/chunk-scrub.d.ts +9 -0
- package/dist/src/agent/app/chunk-scrub.js +120 -0
- package/dist/src/agent/app/chunk-scrub.js.map +1 -0
- package/dist/src/agent/app/interaction-router.d.ts +16 -0
- package/dist/src/agent/app/interaction-router.js +29 -0
- package/dist/src/agent/app/interaction-router.js.map +1 -0
- package/dist/src/agent/app/runner.d.ts +41 -0
- package/dist/src/agent/app/runner.js +353 -0
- package/dist/src/agent/app/runner.js.map +1 -0
- package/dist/src/agent/app/runtime-config.d.ts +3 -0
- package/dist/src/agent/app/runtime-config.js +4 -0
- package/dist/src/agent/app/runtime-config.js.map +1 -0
- package/dist/src/agent/app/thread-attachment-cache.d.ts +17 -0
- package/dist/src/agent/app/thread-attachment-cache.js +124 -0
- package/dist/src/agent/app/thread-attachment-cache.js.map +1 -0
- package/dist/src/agent/app/thread-processor.d.ts +40 -0
- package/dist/src/agent/app/thread-processor.js +792 -0
- package/dist/src/agent/app/thread-processor.js.map +1 -0
- package/dist/src/agent/app/worktree-op-processor.d.ts +27 -0
- package/dist/src/agent/app/worktree-op-processor.js +173 -0
- package/dist/src/agent/app/worktree-op-processor.js.map +1 -0
- package/dist/src/agent/runtimes/agent-instructions.d.ts +16 -0
- package/dist/src/agent/runtimes/agent-instructions.js +33 -0
- package/dist/src/agent/runtimes/agent-instructions.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/continuation.d.ts +1 -0
- package/dist/src/agent/runtimes/claudeCode/continuation.js +30 -0
- package/dist/src/agent/runtimes/claudeCode/continuation.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/detect.d.ts +12 -0
- package/dist/src/agent/runtimes/claudeCode/detect.js +109 -0
- package/dist/src/agent/runtimes/claudeCode/detect.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/interactions.d.ts +13 -0
- package/dist/src/agent/runtimes/claudeCode/interactions.js +167 -0
- package/dist/src/agent/runtimes/claudeCode/interactions.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/models.d.ts +3 -0
- package/dist/src/agent/runtimes/claudeCode/models.js +16 -0
- package/dist/src/agent/runtimes/claudeCode/models.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/prompts.d.ts +1 -0
- package/dist/src/agent/runtimes/claudeCode/prompts.js +5 -0
- package/dist/src/agent/runtimes/claudeCode/prompts.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/runner.d.ts +32 -0
- package/dist/src/agent/runtimes/claudeCode/runner.js +941 -0
- package/dist/src/agent/runtimes/claudeCode/runner.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/runtime.d.ts +2 -0
- package/dist/src/agent/runtimes/claudeCode/runtime.js +126 -0
- package/dist/src/agent/runtimes/claudeCode/runtime.js.map +1 -0
- package/dist/src/agent/runtimes/claudeCode/streaming.d.ts +8 -0
- package/dist/src/agent/runtimes/claudeCode/streaming.js +88 -0
- package/dist/src/agent/runtimes/claudeCode/streaming.js.map +1 -0
- package/dist/src/agent/runtimes/codex/app-server-rpc.d.ts +26 -0
- package/dist/src/agent/runtimes/codex/app-server-rpc.js +109 -0
- package/dist/src/agent/runtimes/codex/app-server-rpc.js.map +1 -0
- package/dist/src/agent/runtimes/codex/app-server-runner.d.ts +59 -0
- package/dist/src/agent/runtimes/codex/app-server-runner.js +688 -0
- package/dist/src/agent/runtimes/codex/app-server-runner.js.map +1 -0
- package/dist/src/agent/runtimes/codex/commands.d.ts +23 -0
- package/dist/src/agent/runtimes/codex/commands.js +25 -0
- package/dist/src/agent/runtimes/codex/commands.js.map +1 -0
- package/dist/src/agent/runtimes/codex/detect.d.ts +5 -0
- package/dist/src/agent/runtimes/codex/detect.js +17 -0
- package/dist/src/agent/runtimes/codex/detect.js.map +1 -0
- package/dist/src/agent/runtimes/codex/models.d.ts +2 -0
- package/dist/src/agent/runtimes/codex/models.js +4 -0
- package/dist/src/agent/runtimes/codex/models.js.map +1 -0
- package/dist/src/agent/runtimes/codex/runner.d.ts +46 -0
- package/dist/src/agent/runtimes/codex/runner.js +298 -0
- package/dist/src/agent/runtimes/codex/runner.js.map +1 -0
- package/dist/src/agent/runtimes/codex/runtime.d.ts +10 -0
- package/dist/src/agent/runtimes/codex/runtime.js +73 -0
- package/dist/src/agent/runtimes/codex/runtime.js.map +1 -0
- package/dist/src/agent/runtimes/contracts.d.ts +215 -0
- package/dist/src/agent/runtimes/contracts.js +33 -0
- package/dist/src/agent/runtimes/contracts.js.map +1 -0
- package/dist/src/agent/runtimes/cursor/commands.d.ts +7 -0
- package/dist/src/agent/runtimes/cursor/commands.js +39 -0
- package/dist/src/agent/runtimes/cursor/commands.js.map +1 -0
- package/dist/src/agent/runtimes/cursor/detect.d.ts +17 -0
- package/dist/src/agent/runtimes/cursor/detect.js +54 -0
- package/dist/src/agent/runtimes/cursor/detect.js.map +1 -0
- package/dist/src/agent/runtimes/cursor/models.d.ts +9 -0
- package/dist/src/agent/runtimes/cursor/models.js +97 -0
- package/dist/src/agent/runtimes/cursor/models.js.map +1 -0
- package/dist/src/agent/runtimes/cursor/runner.d.ts +36 -0
- package/dist/src/agent/runtimes/cursor/runner.js +293 -0
- package/dist/src/agent/runtimes/cursor/runner.js.map +1 -0
- package/dist/src/agent/runtimes/cursor/runtime.d.ts +2 -0
- package/dist/src/agent/runtimes/cursor/runtime.js +48 -0
- package/dist/src/agent/runtimes/cursor/runtime.js.map +1 -0
- package/dist/src/agent/runtimes/cursor/streaming.d.ts +8 -0
- package/dist/src/agent/runtimes/cursor/streaming.js +78 -0
- package/dist/src/agent/runtimes/cursor/streaming.js.map +1 -0
- package/dist/src/agent/runtimes/debug.d.ts +8 -0
- package/dist/src/agent/runtimes/debug.js +19 -0
- package/dist/src/agent/runtimes/debug.js.map +1 -0
- package/dist/src/agent/runtimes/message-format.d.ts +6 -0
- package/dist/src/agent/runtimes/message-format.js +31 -0
- package/dist/src/agent/runtimes/message-format.js.map +1 -0
- package/dist/src/agent/runtimes/opencode/client.d.ts +82 -0
- package/dist/src/agent/runtimes/opencode/client.js +109 -0
- package/dist/src/agent/runtimes/opencode/client.js.map +1 -0
- package/dist/src/agent/runtimes/opencode/detect.d.ts +18 -0
- package/dist/src/agent/runtimes/opencode/detect.js +100 -0
- package/dist/src/agent/runtimes/opencode/detect.js.map +1 -0
- package/dist/src/agent/runtimes/opencode/json.d.ts +4 -0
- package/dist/src/agent/runtimes/opencode/json.js +17 -0
- package/dist/src/agent/runtimes/opencode/json.js.map +1 -0
- package/dist/src/agent/runtimes/opencode/runner.d.ts +50 -0
- package/dist/src/agent/runtimes/opencode/runner.js +598 -0
- package/dist/src/agent/runtimes/opencode/runner.js.map +1 -0
- package/dist/src/agent/runtimes/opencode/runtime.d.ts +9 -0
- package/dist/src/agent/runtimes/opencode/runtime.js +82 -0
- package/dist/src/agent/runtimes/opencode/runtime.js.map +1 -0
- package/dist/src/agent/runtimes/opencode/server.d.ts +36 -0
- package/dist/src/agent/runtimes/opencode/server.js +210 -0
- package/dist/src/agent/runtimes/opencode/server.js.map +1 -0
- package/dist/src/agent/runtimes/opencode/streaming.d.ts +7 -0
- package/dist/src/agent/runtimes/opencode/streaming.js +47 -0
- package/dist/src/agent/runtimes/opencode/streaming.js.map +1 -0
- package/dist/src/agent/runtimes/registry.d.ts +10 -0
- package/dist/src/agent/runtimes/registry.js +48 -0
- package/dist/src/agent/runtimes/registry.js.map +1 -0
- package/dist/src/agent/sdk/adapters/adapter-interface.d.ts +2 -0
- package/dist/src/agent/sdk/adapters/adapter-interface.js +4 -0
- package/dist/src/agent/sdk/adapters/adapter-interface.js.map +1 -0
- package/dist/src/agent/sdk/adapters/claude/claude-adapter.d.ts +9 -0
- package/dist/src/agent/sdk/adapters/claude/claude-adapter.js +95 -0
- package/dist/src/agent/sdk/adapters/claude/claude-adapter.js.map +1 -0
- package/dist/src/agent/sdk/adapters/codex/codex-adapter.d.ts +10 -0
- package/dist/src/agent/sdk/adapters/codex/codex-adapter.js +87 -0
- package/dist/src/agent/sdk/adapters/codex/codex-adapter.js.map +1 -0
- package/dist/src/agent/sdk/adapters/executable-resolution.d.ts +2 -0
- package/dist/src/agent/sdk/adapters/executable-resolution.js +50 -0
- package/dist/src/agent/sdk/adapters/executable-resolution.js.map +1 -0
- package/dist/src/agent/sdk/adapters/generic/generic-subprocess-adapter.d.ts +11 -0
- package/dist/src/agent/sdk/adapters/generic/generic-subprocess-adapter.js +61 -0
- package/dist/src/agent/sdk/adapters/generic/generic-subprocess-adapter.js.map +1 -0
- package/dist/src/agent/sdk/adapters/provider-registry.d.ts +8 -0
- package/dist/src/agent/sdk/adapters/provider-registry.js +32 -0
- package/dist/src/agent/sdk/adapters/provider-registry.js.map +1 -0
- package/dist/src/agent/sdk/constants.d.ts +5 -0
- package/dist/src/agent/sdk/constants.js +29 -0
- package/dist/src/agent/sdk/constants.js.map +1 -0
- package/dist/src/agent/sdk/index.d.ts +2 -0
- package/dist/src/agent/sdk/index.js +2 -0
- package/dist/src/agent/sdk/index.js.map +1 -0
- package/dist/src/agent/sdk/run-handle.d.ts +22 -0
- package/dist/src/agent/sdk/run-handle.js +90 -0
- package/dist/src/agent/sdk/run-handle.js.map +1 -0
- package/dist/src/agent/sdk/runtime/isolation-env.d.ts +9 -0
- package/dist/src/agent/sdk/runtime/isolation-env.js +39 -0
- package/dist/src/agent/sdk/runtime/isolation-env.js.map +1 -0
- package/dist/src/agent/sdk/runtime/line-parser.d.ts +11 -0
- package/dist/src/agent/sdk/runtime/line-parser.js +59 -0
- package/dist/src/agent/sdk/runtime/line-parser.js.map +1 -0
- package/dist/src/agent/sdk/runtime/output-pump.d.ts +20 -0
- package/dist/src/agent/sdk/runtime/output-pump.js +88 -0
- package/dist/src/agent/sdk/runtime/output-pump.js.map +1 -0
- package/dist/src/agent/sdk/runtime/process-group.d.ts +9 -0
- package/dist/src/agent/sdk/runtime/process-group.js +69 -0
- package/dist/src/agent/sdk/runtime/process-group.js.map +1 -0
- package/dist/src/agent/sdk/runtime/provider-supervisor-entrypoint.d.ts +1 -0
- package/dist/src/agent/sdk/runtime/provider-supervisor-entrypoint.js +3 -0
- package/dist/src/agent/sdk/runtime/provider-supervisor-entrypoint.js.map +1 -0
- package/dist/src/agent/sdk/runtime/provider-supervisor.d.ts +1 -0
- package/dist/src/agent/sdk/runtime/provider-supervisor.js +190 -0
- package/dist/src/agent/sdk/runtime/provider-supervisor.js.map +1 -0
- package/dist/src/agent/sdk/runtime/spawn-process.d.ts +7 -0
- package/dist/src/agent/sdk/runtime/spawn-process.js +16 -0
- package/dist/src/agent/sdk/runtime/spawn-process.js.map +1 -0
- package/dist/src/agent/sdk/runtime/spawn-supervised-process.d.ts +17 -0
- package/dist/src/agent/sdk/runtime/spawn-supervised-process.js +203 -0
- package/dist/src/agent/sdk/runtime/spawn-supervised-process.js.map +1 -0
- package/dist/src/agent/sdk/runtime/supervisor-protocol.d.ts +29 -0
- package/dist/src/agent/sdk/runtime/supervisor-protocol.js +90 -0
- package/dist/src/agent/sdk/runtime/supervisor-protocol.js.map +1 -0
- package/dist/src/agent/sdk/runtime/timeouts.d.ts +24 -0
- package/dist/src/agent/sdk/runtime/timeouts.js +65 -0
- package/dist/src/agent/sdk/runtime/timeouts.js.map +1 -0
- package/dist/src/agent/sdk/session-manager.d.ts +38 -0
- package/dist/src/agent/sdk/session-manager.js +557 -0
- package/dist/src/agent/sdk/session-manager.js.map +1 -0
- package/dist/src/agent/sdk/transport/json-stream-decoder.d.ts +6 -0
- package/dist/src/agent/sdk/transport/json-stream-decoder.js +29 -0
- package/dist/src/agent/sdk/transport/json-stream-decoder.js.map +1 -0
- package/dist/src/agent/sdk/transport/line-text-decoder.d.ts +6 -0
- package/dist/src/agent/sdk/transport/line-text-decoder.js +9 -0
- package/dist/src/agent/sdk/transport/line-text-decoder.js.map +1 -0
- package/dist/src/agent/sdk/transport/pty-contract.d.ts +12 -0
- package/dist/src/agent/sdk/transport/pty-contract.js +2 -0
- package/dist/src/agent/sdk/transport/pty-contract.js.map +1 -0
- package/dist/src/agent/sdk/types.d.ts +194 -0
- package/dist/src/agent/sdk/types.js +2 -0
- package/dist/src/agent/sdk/types.js.map +1 -0
- package/dist/src/agent/sdk/versioning/provider-version.d.ts +9 -0
- package/dist/src/agent/sdk/versioning/provider-version.js +41 -0
- package/dist/src/agent/sdk/versioning/provider-version.js.map +1 -0
- package/dist/src/cli.d.ts +7 -0
- package/dist/src/cli.js +56 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/commands/config/command.d.ts +2 -0
- package/dist/src/commands/config/command.js +150 -0
- package/dist/src/commands/config/command.js.map +1 -0
- package/dist/src/commands/connect/command.d.ts +4 -0
- package/dist/src/commands/connect/command.js +19 -0
- package/dist/src/commands/connect/command.js.map +1 -0
- package/dist/src/commands/connect/workflow.d.ts +92 -0
- package/dist/src/commands/connect/workflow.js +381 -0
- package/dist/src/commands/connect/workflow.js.map +1 -0
- package/dist/src/commands/devcontainer/command.d.ts +2 -0
- package/dist/src/commands/devcontainer/command.js +49 -0
- package/dist/src/commands/devcontainer/command.js.map +1 -0
- package/dist/src/commands/devcontainer/install.d.ts +46 -0
- package/dist/src/commands/devcontainer/install.js +107 -0
- package/dist/src/commands/devcontainer/install.js.map +1 -0
- package/dist/src/commands/init/config/claude-mcp.d.ts +27 -0
- package/dist/src/commands/init/config/claude-mcp.js +56 -0
- package/dist/src/commands/init/config/claude-mcp.js.map +1 -0
- package/dist/src/commands/init/config/codex-mcp.d.ts +12 -0
- package/dist/src/commands/init/config/codex-mcp.js +83 -0
- package/dist/src/commands/init/config/codex-mcp.js.map +1 -0
- package/dist/src/commands/init/config/opencode-mcp.d.ts +16 -0
- package/dist/src/commands/init/config/opencode-mcp.js +55 -0
- package/dist/src/commands/init/config/opencode-mcp.js.map +1 -0
- package/dist/src/commands/init/errors.d.ts +3 -0
- package/dist/src/commands/init/errors.js +7 -0
- package/dist/src/commands/init/errors.js.map +1 -0
- package/dist/src/commands/init/index.d.ts +9 -0
- package/dist/src/commands/init/index.js +10 -0
- package/dist/src/commands/init/index.js.map +1 -0
- package/dist/src/commands/init/io/file-copy.d.ts +18 -0
- package/dist/src/commands/init/io/file-copy.js +129 -0
- package/dist/src/commands/init/io/file-copy.js.map +1 -0
- package/dist/src/commands/init/marketplace.d.ts +8 -0
- package/dist/src/commands/init/marketplace.js +25 -0
- package/dist/src/commands/init/marketplace.js.map +1 -0
- package/dist/src/commands/init/mcp-service.d.ts +2 -0
- package/dist/src/commands/init/mcp-service.js +66 -0
- package/dist/src/commands/init/mcp-service.js.map +1 -0
- package/dist/src/commands/init/parsers.d.ts +4 -0
- package/dist/src/commands/init/parsers.js +40 -0
- package/dist/src/commands/init/parsers.js.map +1 -0
- package/dist/src/commands/init/prompts.d.ts +4 -0
- package/dist/src/commands/init/prompts.js +72 -0
- package/dist/src/commands/init/prompts.js.map +1 -0
- package/dist/src/commands/init/skill-service.d.ts +2 -0
- package/dist/src/commands/init/skill-service.js +36 -0
- package/dist/src/commands/init/skill-service.js.map +1 -0
- package/dist/src/commands/init/summary.d.ts +2 -0
- package/dist/src/commands/init/summary.js +22 -0
- package/dist/src/commands/init/summary.js.map +1 -0
- package/dist/src/commands/init/targets/claude.d.ts +4 -0
- package/dist/src/commands/init/targets/claude.js +178 -0
- package/dist/src/commands/init/targets/claude.js.map +1 -0
- package/dist/src/commands/init/targets/codex.d.ts +4 -0
- package/dist/src/commands/init/targets/codex.js +75 -0
- package/dist/src/commands/init/targets/codex.js.map +1 -0
- package/dist/src/commands/init/targets/driver.d.ts +28 -0
- package/dist/src/commands/init/targets/driver.js +2 -0
- package/dist/src/commands/init/targets/driver.js.map +1 -0
- package/dist/src/commands/init/targets/opencode.d.ts +4 -0
- package/dist/src/commands/init/targets/opencode.js +77 -0
- package/dist/src/commands/init/targets/opencode.js.map +1 -0
- package/dist/src/commands/init/targets/registry.d.ts +4 -0
- package/dist/src/commands/init/targets/registry.js +15 -0
- package/dist/src/commands/init/targets/registry.js.map +1 -0
- package/dist/src/commands/init/types.d.ts +30 -0
- package/dist/src/commands/init/types.js +7 -0
- package/dist/src/commands/init/types.js.map +1 -0
- package/dist/src/commands/init.d.ts +3 -0
- package/dist/src/commands/init.js +143 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/keys/command.d.ts +2 -0
- package/dist/src/commands/keys/command.js +154 -0
- package/dist/src/commands/keys/command.js.map +1 -0
- package/dist/src/commands/labels/create.d.ts +2 -0
- package/dist/src/commands/labels/create.js +31 -0
- package/dist/src/commands/labels/create.js.map +1 -0
- package/dist/src/commands/labels/delete.d.ts +2 -0
- package/dist/src/commands/labels/delete.js +51 -0
- package/dist/src/commands/labels/delete.js.map +1 -0
- package/dist/src/commands/labels/formatters.d.ts +4 -0
- package/dist/src/commands/labels/formatters.js +6 -0
- package/dist/src/commands/labels/formatters.js.map +1 -0
- package/dist/src/commands/labels/index.d.ts +2 -0
- package/dist/src/commands/labels/index.js +13 -0
- package/dist/src/commands/labels/index.js.map +1 -0
- package/dist/src/commands/labels/list.d.ts +2 -0
- package/dist/src/commands/labels/list.js +29 -0
- package/dist/src/commands/labels/list.js.map +1 -0
- package/dist/src/commands/labels/resolve.d.ts +9 -0
- package/dist/src/commands/labels/resolve.js +23 -0
- package/dist/src/commands/labels/resolve.js.map +1 -0
- package/dist/src/commands/labels/update.d.ts +2 -0
- package/dist/src/commands/labels/update.js +37 -0
- package/dist/src/commands/labels/update.js.map +1 -0
- package/dist/src/commands/lists/constants.d.ts +7 -0
- package/dist/src/commands/lists/constants.js +14 -0
- package/dist/src/commands/lists/constants.js.map +1 -0
- package/dist/src/commands/lists/create.d.ts +2 -0
- package/dist/src/commands/lists/create.js +45 -0
- package/dist/src/commands/lists/create.js.map +1 -0
- package/dist/src/commands/lists/index.d.ts +2 -0
- package/dist/src/commands/lists/index.js +10 -0
- package/dist/src/commands/lists/index.js.map +1 -0
- package/dist/src/commands/lists/list.d.ts +2 -0
- package/dist/src/commands/lists/list.js +66 -0
- package/dist/src/commands/lists/list.js.map +1 -0
- package/dist/src/commands/lists/resolve.d.ts +11 -0
- package/dist/src/commands/lists/resolve.js +24 -0
- package/dist/src/commands/lists/resolve.js.map +1 -0
- package/dist/src/commands/lists/update.d.ts +2 -0
- package/dist/src/commands/lists/update.js +61 -0
- package/dist/src/commands/lists/update.js.map +1 -0
- package/dist/src/commands/login/command.d.ts +8 -0
- package/dist/src/commands/login/command.js +20 -0
- package/dist/src/commands/login/command.js.map +1 -0
- package/dist/src/commands/orgs/index.d.ts +2 -0
- package/dist/src/commands/orgs/index.js +6 -0
- package/dist/src/commands/orgs/index.js.map +1 -0
- package/dist/src/commands/orgs/list.d.ts +2 -0
- package/dist/src/commands/orgs/list.js +29 -0
- package/dist/src/commands/orgs/list.js.map +1 -0
- package/dist/src/commands/paths/command.d.ts +2 -0
- package/dist/src/commands/paths/command.js +90 -0
- package/dist/src/commands/paths/command.js.map +1 -0
- package/dist/src/commands/profiles/index.d.ts +2 -0
- package/dist/src/commands/profiles/index.js +6 -0
- package/dist/src/commands/profiles/index.js.map +1 -0
- package/dist/src/commands/profiles/list.d.ts +2 -0
- package/dist/src/commands/profiles/list.js +50 -0
- package/dist/src/commands/profiles/list.js.map +1 -0
- package/dist/src/commands/project-agents/create.d.ts +2 -0
- package/dist/src/commands/project-agents/create.js +53 -0
- package/dist/src/commands/project-agents/create.js.map +1 -0
- package/dist/src/commands/project-agents/index.d.ts +2 -0
- package/dist/src/commands/project-agents/index.js +10 -0
- package/dist/src/commands/project-agents/index.js.map +1 -0
- package/dist/src/commands/project-agents/list.d.ts +2 -0
- package/dist/src/commands/project-agents/list.js +30 -0
- package/dist/src/commands/project-agents/list.js.map +1 -0
- package/dist/src/commands/project-agents/parsers.d.ts +16 -0
- package/dist/src/commands/project-agents/parsers.js +80 -0
- package/dist/src/commands/project-agents/parsers.js.map +1 -0
- package/dist/src/commands/project-agents/update.d.ts +2 -0
- package/dist/src/commands/project-agents/update.js +74 -0
- package/dist/src/commands/project-agents/update.js.map +1 -0
- package/dist/src/commands/projects/index.d.ts +2 -0
- package/dist/src/commands/projects/index.js +6 -0
- package/dist/src/commands/projects/index.js.map +1 -0
- package/dist/src/commands/projects/list.d.ts +2 -0
- package/dist/src/commands/projects/list.js +41 -0
- package/dist/src/commands/projects/list.js.map +1 -0
- package/dist/src/commands/prompts/create.d.ts +2 -0
- package/dist/src/commands/prompts/create.js +48 -0
- package/dist/src/commands/prompts/create.js.map +1 -0
- package/dist/src/commands/prompts/formatters.d.ts +4 -0
- package/dist/src/commands/prompts/formatters.js +7 -0
- package/dist/src/commands/prompts/formatters.js.map +1 -0
- package/dist/src/commands/prompts/index.d.ts +2 -0
- package/dist/src/commands/prompts/index.js +11 -0
- package/dist/src/commands/prompts/index.js.map +1 -0
- package/dist/src/commands/prompts/list.d.ts +2 -0
- package/dist/src/commands/prompts/list.js +34 -0
- package/dist/src/commands/prompts/list.js.map +1 -0
- package/dist/src/commands/prompts/parsers.d.ts +9 -0
- package/dist/src/commands/prompts/parsers.js +12 -0
- package/dist/src/commands/prompts/parsers.js.map +1 -0
- package/dist/src/commands/prompts/resolve.d.ts +17 -0
- package/dist/src/commands/prompts/resolve.js +43 -0
- package/dist/src/commands/prompts/resolve.js.map +1 -0
- package/dist/src/commands/prompts/update.d.ts +2 -0
- package/dist/src/commands/prompts/update.js +58 -0
- package/dist/src/commands/prompts/update.js.map +1 -0
- package/dist/src/commands/setup/command.d.ts +2 -0
- package/dist/src/commands/setup/command.js +15 -0
- package/dist/src/commands/setup/command.js.map +1 -0
- package/dist/src/commands/setup/prompts.d.ts +66 -0
- package/dist/src/commands/setup/prompts.js +199 -0
- package/dist/src/commands/setup/prompts.js.map +1 -0
- package/dist/src/commands/setup/workflow.d.ts +17 -0
- package/dist/src/commands/setup/workflow.js +141 -0
- package/dist/src/commands/setup/workflow.js.map +1 -0
- package/dist/src/commands/status/command.d.ts +2 -0
- package/dist/src/commands/status/command.js +83 -0
- package/dist/src/commands/status/command.js.map +1 -0
- package/dist/src/commands/task-types/index.d.ts +2 -0
- package/dist/src/commands/task-types/index.js +6 -0
- package/dist/src/commands/task-types/index.js.map +1 -0
- package/dist/src/commands/task-types/list.d.ts +2 -0
- package/dist/src/commands/task-types/list.js +32 -0
- package/dist/src/commands/task-types/list.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/comments/add.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/comments/add.js +32 -0
- package/dist/src/commands/tasks/artifacts/comments/add.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/comments/formatters.d.ts +7 -0
- package/dist/src/commands/tasks/artifacts/comments/formatters.js +32 -0
- package/dist/src/commands/tasks/artifacts/comments/formatters.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/comments/index.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/comments/index.js +13 -0
- package/dist/src/commands/tasks/artifacts/comments/index.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/comments/list.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/comments/list.js +24 -0
- package/dist/src/commands/tasks/artifacts/comments/list.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/comments/parsers.d.ts +6 -0
- package/dist/src/commands/tasks/artifacts/comments/parsers.js +8 -0
- package/dist/src/commands/tasks/artifacts/comments/parsers.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/comments/reply.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/comments/reply.js +23 -0
- package/dist/src/commands/tasks/artifacts/comments/reply.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/comments/resolve.d.ts +3 -0
- package/dist/src/commands/tasks/artifacts/comments/resolve.js +26 -0
- package/dist/src/commands/tasks/artifacts/comments/resolve.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/create.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/create.js +63 -0
- package/dist/src/commands/tasks/artifacts/create.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/delete.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/delete.js +27 -0
- package/dist/src/commands/tasks/artifacts/delete.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/get.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/get.js +54 -0
- package/dist/src/commands/tasks/artifacts/get.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/index.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/index.js +18 -0
- package/dist/src/commands/tasks/artifacts/index.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/list.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/list.js +31 -0
- package/dist/src/commands/tasks/artifacts/list.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/parsers.d.ts +13 -0
- package/dist/src/commands/tasks/artifacts/parsers.js +24 -0
- package/dist/src/commands/tasks/artifacts/parsers.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/replace.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/replace.js +62 -0
- package/dist/src/commands/tasks/artifacts/replace.js.map +1 -0
- package/dist/src/commands/tasks/artifacts/update.d.ts +2 -0
- package/dist/src/commands/tasks/artifacts/update.js +55 -0
- package/dist/src/commands/tasks/artifacts/update.js.map +1 -0
- package/dist/src/commands/tasks/attach.d.ts +2 -0
- package/dist/src/commands/tasks/attach.js +70 -0
- package/dist/src/commands/tasks/attach.js.map +1 -0
- package/dist/src/commands/tasks/attachments/delete.d.ts +2 -0
- package/dist/src/commands/tasks/attachments/delete.js +61 -0
- package/dist/src/commands/tasks/attachments/delete.js.map +1 -0
- package/dist/src/commands/tasks/attachments/download.d.ts +2 -0
- package/dist/src/commands/tasks/attachments/download.js +42 -0
- package/dist/src/commands/tasks/attachments/download.js.map +1 -0
- package/dist/src/commands/tasks/attachments/formatters.d.ts +5 -0
- package/dist/src/commands/tasks/attachments/formatters.js +18 -0
- package/dist/src/commands/tasks/attachments/formatters.js.map +1 -0
- package/dist/src/commands/tasks/attachments/index.d.ts +2 -0
- package/dist/src/commands/tasks/attachments/index.js +11 -0
- package/dist/src/commands/tasks/attachments/index.js.map +1 -0
- package/dist/src/commands/tasks/attachments/list.d.ts +2 -0
- package/dist/src/commands/tasks/attachments/list.js +36 -0
- package/dist/src/commands/tasks/attachments/list.js.map +1 -0
- package/dist/src/commands/tasks/attachments/resolve.d.ts +6 -0
- package/dist/src/commands/tasks/attachments/resolve.js +15 -0
- package/dist/src/commands/tasks/attachments/resolve.js.map +1 -0
- package/dist/src/commands/tasks/attachments/transfer.d.ts +11 -0
- package/dist/src/commands/tasks/attachments/transfer.js +71 -0
- package/dist/src/commands/tasks/attachments/transfer.js.map +1 -0
- package/dist/src/commands/tasks/comments/add.d.ts +2 -0
- package/dist/src/commands/tasks/comments/add.js +44 -0
- package/dist/src/commands/tasks/comments/add.js.map +1 -0
- package/dist/src/commands/tasks/comments/index.d.ts +2 -0
- package/dist/src/commands/tasks/comments/index.js +6 -0
- package/dist/src/commands/tasks/comments/index.js.map +1 -0
- package/dist/src/commands/tasks/create.d.ts +2 -0
- package/dist/src/commands/tasks/create.js +77 -0
- package/dist/src/commands/tasks/create.js.map +1 -0
- package/dist/src/commands/tasks/delete.d.ts +2 -0
- package/dist/src/commands/tasks/delete.js +31 -0
- package/dist/src/commands/tasks/delete.js.map +1 -0
- package/dist/src/commands/tasks/formatters.d.ts +25 -0
- package/dist/src/commands/tasks/formatters.js +40 -0
- package/dist/src/commands/tasks/formatters.js.map +1 -0
- package/dist/src/commands/tasks/get.d.ts +2 -0
- package/dist/src/commands/tasks/get.js +94 -0
- package/dist/src/commands/tasks/get.js.map +1 -0
- package/dist/src/commands/tasks/hydrate.d.ts +20 -0
- package/dist/src/commands/tasks/hydrate.js +47 -0
- package/dist/src/commands/tasks/hydrate.js.map +1 -0
- package/dist/src/commands/tasks/index.d.ts +2 -0
- package/dist/src/commands/tasks/index.js +33 -0
- package/dist/src/commands/tasks/index.js.map +1 -0
- package/dist/src/commands/tasks/links.d.ts +4 -0
- package/dist/src/commands/tasks/links.js +121 -0
- package/dist/src/commands/tasks/links.js.map +1 -0
- package/dist/src/commands/tasks/list.d.ts +2 -0
- package/dist/src/commands/tasks/list.js +47 -0
- package/dist/src/commands/tasks/list.js.map +1 -0
- package/dist/src/commands/tasks/move-to-list.d.ts +2 -0
- package/dist/src/commands/tasks/move-to-list.js +41 -0
- package/dist/src/commands/tasks/move-to-list.js.map +1 -0
- package/dist/src/commands/tasks/move.d.ts +2 -0
- package/dist/src/commands/tasks/move.js +61 -0
- package/dist/src/commands/tasks/move.js.map +1 -0
- package/dist/src/commands/tasks/parsers.d.ts +22 -0
- package/dist/src/commands/tasks/parsers.js +118 -0
- package/dist/src/commands/tasks/parsers.js.map +1 -0
- package/dist/src/commands/tasks/refs.d.ts +2 -0
- package/dist/src/commands/tasks/refs.js +89 -0
- package/dist/src/commands/tasks/refs.js.map +1 -0
- package/dist/src/commands/tasks/resolve.d.ts +20 -0
- package/dist/src/commands/tasks/resolve.js +57 -0
- package/dist/src/commands/tasks/resolve.js.map +1 -0
- package/dist/src/commands/tasks/search.d.ts +2 -0
- package/dist/src/commands/tasks/search.js +110 -0
- package/dist/src/commands/tasks/search.js.map +1 -0
- package/dist/src/commands/tasks/update.d.ts +2 -0
- package/dist/src/commands/tasks/update.js +101 -0
- package/dist/src/commands/tasks/update.js.map +1 -0
- package/dist/src/commands/test-helpers.d.ts +2 -0
- package/dist/src/commands/test-helpers.js +6 -0
- package/dist/src/commands/test-helpers.js.map +1 -0
- package/dist/src/commands/threads/create.d.ts +2 -0
- package/dist/src/commands/threads/create.js +99 -0
- package/dist/src/commands/threads/create.js.map +1 -0
- package/dist/src/commands/threads/formatters.d.ts +10 -0
- package/dist/src/commands/threads/formatters.js +17 -0
- package/dist/src/commands/threads/formatters.js.map +1 -0
- package/dist/src/commands/threads/get.d.ts +2 -0
- package/dist/src/commands/threads/get.js +53 -0
- package/dist/src/commands/threads/get.js.map +1 -0
- package/dist/src/commands/threads/index.d.ts +2 -0
- package/dist/src/commands/threads/index.js +14 -0
- package/dist/src/commands/threads/index.js.map +1 -0
- package/dist/src/commands/threads/list.d.ts +2 -0
- package/dist/src/commands/threads/list.js +69 -0
- package/dist/src/commands/threads/list.js.map +1 -0
- package/dist/src/commands/threads/messages.d.ts +2 -0
- package/dist/src/commands/threads/messages.js +59 -0
- package/dist/src/commands/threads/messages.js.map +1 -0
- package/dist/src/commands/threads/parsers.d.ts +5 -0
- package/dist/src/commands/threads/parsers.js +19 -0
- package/dist/src/commands/threads/parsers.js.map +1 -0
- package/dist/src/commands/threads/send.d.ts +2 -0
- package/dist/src/commands/threads/send.js +49 -0
- package/dist/src/commands/threads/send.js.map +1 -0
- package/dist/src/commands/threads/spawn-target.d.ts +29 -0
- package/dist/src/commands/threads/spawn-target.js +62 -0
- package/dist/src/commands/threads/spawn-target.js.map +1 -0
- package/dist/src/convex/_generated/ai/ai-files.state.json +6 -0
- package/dist/src/convex/_generated/ai/guidelines.md +371 -0
- package/dist/src/convex/_generated/api.d.ts +598 -0
- package/dist/src/convex/_generated/api.js +23 -0
- package/dist/src/convex/_generated/dataModel.d.ts +60 -0
- package/dist/src/convex/_generated/server.d.ts +143 -0
- package/dist/src/convex/_generated/server.js +93 -0
- package/dist/src/lib/argv.d.ts +1 -0
- package/dist/src/lib/argv.js +7 -0
- package/dist/src/lib/argv.js.map +1 -0
- package/dist/src/lib/browser-login.d.ts +43 -0
- package/dist/src/lib/browser-login.js +216 -0
- package/dist/src/lib/browser-login.js.map +1 -0
- package/dist/src/lib/config/convex-client.d.ts +41 -0
- package/dist/src/lib/config/convex-client.js +53 -0
- package/dist/src/lib/config/convex-client.js.map +1 -0
- package/dist/src/lib/config/index.d.ts +7 -0
- package/dist/src/lib/config/index.js +13 -0
- package/dist/src/lib/config/index.js.map +1 -0
- package/dist/src/lib/config/profile.d.ts +40 -0
- package/dist/src/lib/config/profile.js +155 -0
- package/dist/src/lib/config/profile.js.map +1 -0
- package/dist/src/lib/config/provider-keys.d.ts +47 -0
- package/dist/src/lib/config/provider-keys.js +97 -0
- package/dist/src/lib/config/provider-keys.js.map +1 -0
- package/dist/src/lib/config/toml.d.ts +78 -0
- package/dist/src/lib/config/toml.js +228 -0
- package/dist/src/lib/config/toml.js.map +1 -0
- package/dist/src/lib/config/types.d.ts +98 -0
- package/dist/src/lib/config/types.js +65 -0
- package/dist/src/lib/config/types.js.map +1 -0
- package/dist/src/lib/config/validate.d.ts +30 -0
- package/dist/src/lib/config/validate.js +66 -0
- package/dist/src/lib/config/validate.js.map +1 -0
- package/dist/src/lib/connect-events.d.ts +42 -0
- package/dist/src/lib/connect-events.js +65 -0
- package/dist/src/lib/connect-events.js.map +1 -0
- package/dist/src/lib/constants.d.ts +20 -0
- package/dist/src/lib/constants.js +27 -0
- package/dist/src/lib/constants.js.map +1 -0
- package/dist/src/lib/content-type.d.ts +1 -0
- package/dist/src/lib/content-type.js +27 -0
- package/dist/src/lib/content-type.js.map +1 -0
- package/dist/src/lib/convex-error.d.ts +12 -0
- package/dist/src/lib/convex-error.js +33 -0
- package/dist/src/lib/convex-error.js.map +1 -0
- package/dist/src/lib/git/checkpoint.d.ts +74 -0
- package/dist/src/lib/git/checkpoint.js +210 -0
- package/dist/src/lib/git/checkpoint.js.map +1 -0
- package/dist/src/lib/git/exec.d.ts +23 -0
- package/dist/src/lib/git/exec.js +46 -0
- package/dist/src/lib/git/exec.js.map +1 -0
- package/dist/src/lib/git/file-index.d.ts +8 -0
- package/dist/src/lib/git/file-index.js +125 -0
- package/dist/src/lib/git/file-index.js.map +1 -0
- package/dist/src/lib/git/index.d.ts +5 -0
- package/dist/src/lib/git/index.js +6 -0
- package/dist/src/lib/git/index.js.map +1 -0
- package/dist/src/lib/git/repo.d.ts +32 -0
- package/dist/src/lib/git/repo.js +95 -0
- package/dist/src/lib/git/repo.js.map +1 -0
- package/dist/src/lib/git/worktrees.d.ts +49 -0
- package/dist/src/lib/git/worktrees.js +97 -0
- package/dist/src/lib/git/worktrees.js.map +1 -0
- package/dist/src/lib/global-options.d.ts +3 -0
- package/dist/src/lib/global-options.js +8 -0
- package/dist/src/lib/global-options.js.map +1 -0
- package/dist/src/lib/id.d.ts +3 -0
- package/dist/src/lib/id.js +14 -0
- package/dist/src/lib/id.js.map +1 -0
- package/dist/src/lib/one-shot-command.d.ts +7 -0
- package/dist/src/lib/one-shot-command.js +30 -0
- package/dist/src/lib/one-shot-command.js.map +1 -0
- package/dist/src/lib/one-shot-config.d.ts +3 -0
- package/dist/src/lib/one-shot-config.js +7 -0
- package/dist/src/lib/one-shot-config.js.map +1 -0
- package/dist/src/lib/output.d.ts +10 -0
- package/dist/src/lib/output.js +27 -0
- package/dist/src/lib/output.js.map +1 -0
- package/dist/src/lib/pagination.d.ts +16 -0
- package/dist/src/lib/pagination.js +45 -0
- package/dist/src/lib/pagination.js.map +1 -0
- package/dist/src/lib/parsers.d.ts +2 -0
- package/dist/src/lib/parsers.js +21 -0
- package/dist/src/lib/parsers.js.map +1 -0
- package/dist/src/lib/project-resolution.d.ts +41 -0
- package/dist/src/lib/project-resolution.js +84 -0
- package/dist/src/lib/project-resolution.js.map +1 -0
- package/dist/src/lib/pull-requests.d.ts +47 -0
- package/dist/src/lib/pull-requests.js +305 -0
- package/dist/src/lib/pull-requests.js.map +1 -0
- package/dist/src/lib/skill-install-guidance.d.ts +5 -0
- package/dist/src/lib/skill-install-guidance.js +41 -0
- package/dist/src/lib/skill-install-guidance.js.map +1 -0
- package/dist/src/lib/text-input.d.ts +18 -0
- package/dist/src/lib/text-input.js +36 -0
- package/dist/src/lib/text-input.js.map +1 -0
- package/dist/src/lib/thread-attachments.d.ts +21 -0
- package/dist/src/lib/thread-attachments.js +104 -0
- package/dist/src/lib/thread-attachments.js.map +1 -0
- package/dist/src/lib/url.d.ts +13 -0
- package/dist/src/lib/url.js +25 -0
- package/dist/src/lib/url.js.map +1 -0
- package/dist/src/lib/version.d.ts +2 -0
- package/dist/src/lib/version.js +33 -0
- package/dist/src/lib/version.js.map +1 -0
- package/dist/templates/devcontainer/Dockerfile +95 -0
- package/dist/templates/devcontainer/README.md +129 -0
- package/dist/templates/devcontainer/devcontainer.json +92 -0
- package/dist/templates/devcontainer/init-firewall.sh +271 -0
- package/package.json +79 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thread/message mode. `agent` is the legacy full-access value
|
|
3
|
+
* (bypassPermissions); the rest map 1:1 to provider permission modes.
|
|
4
|
+
*/
|
|
5
|
+
export type CliMode = "agent" | "plan" | "default" | "acceptEdits" | "auto" | "dontAsk";
|
|
6
|
+
export declare const CLI_MODES: readonly CliMode[];
|
|
7
|
+
export type ContentChunk = {
|
|
8
|
+
type: string;
|
|
9
|
+
data: string;
|
|
10
|
+
};
|
|
11
|
+
export type InteractionKind = "tool-approval" | "question" | "plan-approval";
|
|
12
|
+
export interface InteractionRequestInput {
|
|
13
|
+
requestId: string;
|
|
14
|
+
kind: InteractionKind;
|
|
15
|
+
payloadJson: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Provider-neutral bridge from a running provider callback to the web user, signaled
|
|
19
|
+
* through Convex. `request` resolves with the user's raw response JSON and only ever
|
|
20
|
+
* rejects via the abort signal; `cancel` marks a parked request dead.
|
|
21
|
+
*
|
|
22
|
+
* `abandoned` is a structural contract, not a display string (OS-1463): true means the
|
|
23
|
+
* CLI is abandoning the run, so the server row must stay pending — it is the parked
|
|
24
|
+
* signal the wind-down mutations turn into `waiting_input`, cancelling the rows
|
|
25
|
+
* themselves. False means the provider withdrew one request while the run continues.
|
|
26
|
+
*/
|
|
27
|
+
export interface InteractionBridge {
|
|
28
|
+
request(input: InteractionRequestInput, signal: AbortSignal): Promise<string>;
|
|
29
|
+
cancel(requestId: string, opts: {
|
|
30
|
+
abandoned: boolean;
|
|
31
|
+
reason?: string;
|
|
32
|
+
}): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* How a runtime delivers a bound Project agent's prompt (OS-1138):
|
|
36
|
+
* - `system-append`: the per-invocation append channel, re-supplied every run (appends
|
|
37
|
+
* do not survive resume).
|
|
38
|
+
* - `first-message`: prepended to a fresh session's first message; the transcript then
|
|
39
|
+
* carries it across resumes.
|
|
40
|
+
* - `unsupported`: the runtime cannot deliver one.
|
|
41
|
+
*/
|
|
42
|
+
export type AgentPromptDelivery = "system-append" | "first-message" | "unsupported";
|
|
43
|
+
export interface RunnerExecutionOptions {
|
|
44
|
+
cliType: string;
|
|
45
|
+
/**
|
|
46
|
+
* OpenSana CLI thread this run belongs to (OS-1223). Delivered to the
|
|
47
|
+
* spawned runtime as the OPENSANA_THREAD_ID env var and as prompt context
|
|
48
|
+
* so the agent can reference its own thread via MCP thread tools.
|
|
49
|
+
*/
|
|
50
|
+
threadId: string;
|
|
51
|
+
continuationId?: string;
|
|
52
|
+
cliMode?: CliMode;
|
|
53
|
+
/**
|
|
54
|
+
* Bound Project agent prompt (the thread's creation-time snapshot, never a
|
|
55
|
+
* live lookup). Runners deliver it per their `agentPromptDelivery` mode.
|
|
56
|
+
*/
|
|
57
|
+
agentPrompt?: string;
|
|
58
|
+
/** Display name of the bound Project agent (for the delimited block). */
|
|
59
|
+
agentName?: string;
|
|
60
|
+
cliModel?: string;
|
|
61
|
+
resolvedCliModel?: string;
|
|
62
|
+
/** Server-resolved reasoning effort; absent means the machine default. */
|
|
63
|
+
resolvedCliEffort?: string;
|
|
64
|
+
requireContinuation?: boolean;
|
|
65
|
+
inputFormat?: "prompt" | "stream-json";
|
|
66
|
+
bootstrapInput?: unknown[];
|
|
67
|
+
/** Present when the connection supports interactive approvals. */
|
|
68
|
+
interactionBridge?: InteractionBridge;
|
|
69
|
+
/**
|
|
70
|
+
* Keep the run's input stream open so `steer()` can inject additional user
|
|
71
|
+
* turns mid-run. Set when the runner implements `steer`.
|
|
72
|
+
*/
|
|
73
|
+
steerEnabled?: boolean;
|
|
74
|
+
/** Execute this parsed runtime command instead of prompting with text. */
|
|
75
|
+
runtimeCommand?: RuntimeCommandInvocation;
|
|
76
|
+
}
|
|
77
|
+
export interface RunnerExecutionResult {
|
|
78
|
+
continuationId?: string;
|
|
79
|
+
}
|
|
80
|
+
export declare class RunnerExecutionError extends Error {
|
|
81
|
+
continuationId?: string;
|
|
82
|
+
constructor(message: string, options?: {
|
|
83
|
+
continuationId?: string;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Runner for runtimes with no OS sandbox support when isolation is on:
|
|
88
|
+
* every run fails fast with a clear message — a security opt-in must not
|
|
89
|
+
* silently run unsandboxed.
|
|
90
|
+
*/
|
|
91
|
+
export declare function createSandboxUnsupportedRunner(cliType: string): CliRuntimeRunner;
|
|
92
|
+
export interface CliRuntimeRunner {
|
|
93
|
+
execute(workingDirectory: string, prompt: string, options: RunnerExecutionOptions): AsyncGenerator<ContentChunk, RunnerExecutionResult, unknown>;
|
|
94
|
+
/**
|
|
95
|
+
* Inject a prepared user turn into the active steer-enabled run. False when no
|
|
96
|
+
* steerable run is active or the runtime rejected it (the caller then queues for the
|
|
97
|
+
* next batch). May be sync (Claude pushes into an open input stream) or async (codex
|
|
98
|
+
* round-trips `turn/steer`); runtimes without mid-run injection omit this.
|
|
99
|
+
*/
|
|
100
|
+
steer?(injection: PreparedRuntimeExecution): boolean | Promise<boolean>;
|
|
101
|
+
abort(): void;
|
|
102
|
+
shutdown(): Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* OS-level sandbox boundary generated from the profile's `paths[]`
|
|
106
|
+
* (OS-1242). Provider-neutral: each runtime maps `writableRoots` onto its
|
|
107
|
+
* own mechanism (Claude Code Seatbelt/bubblewrap settings, Codex sandbox
|
|
108
|
+
* flags). The run's working directory is writable natively in both
|
|
109
|
+
* runtimes and need not be listed.
|
|
110
|
+
*/
|
|
111
|
+
export interface RunnerSandboxOptions {
|
|
112
|
+
writableRoots: string[];
|
|
113
|
+
}
|
|
114
|
+
export interface CliRuntimeRunnerFactoryOptions {
|
|
115
|
+
streamFile?: string;
|
|
116
|
+
streamDelayMs?: number;
|
|
117
|
+
/** Emit partial (delta) events for live token streaming (connection-level opt-in). */
|
|
118
|
+
partialStreaming?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Run Codex through the experimental `codex app-server` JSON-RPC transport
|
|
121
|
+
* (interactive approvals, plan mode, deltas) instead of `codex exec --json`
|
|
122
|
+
* (connection-level; the default, opt out via `--codex-exec`).
|
|
123
|
+
*/
|
|
124
|
+
codexAppServer?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Present when isolation is enabled (`--isolated` / profile `isolated`).
|
|
127
|
+
* Connection-level like the profile it derives from. Runtimes without OS
|
|
128
|
+
* sandbox support must fail runs fast instead of degrading silently.
|
|
129
|
+
*/
|
|
130
|
+
sandbox?: RunnerSandboxOptions;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Runtime-specific policy for the outgoing chunk flush buffer. Deferrable
|
|
134
|
+
* chunks (deltas) may wait for a flush window and be coalesced; everything
|
|
135
|
+
* else flushes immediately.
|
|
136
|
+
*/
|
|
137
|
+
export interface ChunkStreamPolicy {
|
|
138
|
+
isDeferrable(chunk: ContentChunk): boolean;
|
|
139
|
+
/** Merge `next` into `prev` when both extend the same content block; null = not mergeable. */
|
|
140
|
+
coalesce(prev: ContentChunk, next: ContentChunk): ContentChunk | null;
|
|
141
|
+
}
|
|
142
|
+
export interface RuntimeResolvedAttachment {
|
|
143
|
+
storageId: string;
|
|
144
|
+
fileName: string;
|
|
145
|
+
contentType: string;
|
|
146
|
+
localPath: string;
|
|
147
|
+
inlineImage: boolean;
|
|
148
|
+
}
|
|
149
|
+
export interface RuntimeUserMessageInput {
|
|
150
|
+
id: string;
|
|
151
|
+
createdAt: number;
|
|
152
|
+
cliMode?: string;
|
|
153
|
+
taskRef?: string;
|
|
154
|
+
contentText: string;
|
|
155
|
+
/**
|
|
156
|
+
* Message is a runtime slash command ("/compact", "/my-skill args"). The
|
|
157
|
+
* thread processor batches it alone; runtimes that understand it deliver
|
|
158
|
+
* the text raw (no batch envelope) so the agent interprets it natively.
|
|
159
|
+
*/
|
|
160
|
+
runtimeCommand?: boolean;
|
|
161
|
+
attachments: RuntimeResolvedAttachment[];
|
|
162
|
+
}
|
|
163
|
+
export interface RuntimeBatchExecutionInput {
|
|
164
|
+
messages: RuntimeUserMessageInput[];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Parsed solo runtime-command batch ("/name args" → name + args). Set only
|
|
168
|
+
* by runtimes whose agent does not interpret slash text natively and needs a
|
|
169
|
+
* dedicated execution call instead (OpenCode's session.command); Claude Code
|
|
170
|
+
* omits it and delivers the raw prompt.
|
|
171
|
+
*/
|
|
172
|
+
export interface RuntimeCommandInvocation {
|
|
173
|
+
command: string;
|
|
174
|
+
arguments?: string;
|
|
175
|
+
}
|
|
176
|
+
export interface PreparedRuntimeExecution {
|
|
177
|
+
prompt: string;
|
|
178
|
+
inputFormat: "prompt" | "stream-json";
|
|
179
|
+
bootstrapInput?: unknown[];
|
|
180
|
+
runtimeCommand?: RuntimeCommandInvocation;
|
|
181
|
+
}
|
|
182
|
+
export interface DetectedCliModel {
|
|
183
|
+
/** `providerID/modelID` run slug. */
|
|
184
|
+
slug: string;
|
|
185
|
+
name: string;
|
|
186
|
+
providerID: string;
|
|
187
|
+
modelID: string;
|
|
188
|
+
/** Variant keys (provider-specific reasoning effort) for a future picker. */
|
|
189
|
+
variants?: string[];
|
|
190
|
+
}
|
|
191
|
+
export interface DetectedCli {
|
|
192
|
+
type: string;
|
|
193
|
+
version: string;
|
|
194
|
+
provider?: string;
|
|
195
|
+
/** Dynamic model inventory (OpenCode advertises connected-provider models). */
|
|
196
|
+
models?: DetectedCliModel[];
|
|
197
|
+
defaultModel?: string;
|
|
198
|
+
}
|
|
199
|
+
export interface CliRuntimeDefinition {
|
|
200
|
+
type: string;
|
|
201
|
+
/** How this runtime delivers a bound Project agent's prompt. */
|
|
202
|
+
agentPromptDelivery: AgentPromptDelivery;
|
|
203
|
+
detectAvailableCli(): Promise<DetectedCli | null>;
|
|
204
|
+
createRunner(options: CliRuntimeRunnerFactoryOptions): CliRuntimeRunner;
|
|
205
|
+
normalizeCliModel(model: unknown): string | undefined;
|
|
206
|
+
isInlineImageAttachment(contentType: string): boolean;
|
|
207
|
+
prepareBatchExecution(input: RuntimeBatchExecutionInput): Promise<PreparedRuntimeExecution>;
|
|
208
|
+
getChunkStreamPolicy?(): ChunkStreamPolicy;
|
|
209
|
+
/**
|
|
210
|
+
* The chunk signals that repo state changed mid-run (commit created,
|
|
211
|
+
* branch switched, PR published). The thread processor reacts by
|
|
212
|
+
* refreshing the thread's branch/PR snapshot (OS-1386, OS-1387).
|
|
213
|
+
*/
|
|
214
|
+
signalsVcsStateChange?(chunk: ContentChunk): boolean;
|
|
215
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const CLI_MODES = [
|
|
2
|
+
"agent",
|
|
3
|
+
"plan",
|
|
4
|
+
"default",
|
|
5
|
+
"acceptEdits",
|
|
6
|
+
"auto",
|
|
7
|
+
"dontAsk",
|
|
8
|
+
];
|
|
9
|
+
export class RunnerExecutionError extends Error {
|
|
10
|
+
continuationId;
|
|
11
|
+
constructor(message, options) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "RunnerExecutionError";
|
|
14
|
+
this.continuationId = options?.continuationId;
|
|
15
|
+
Object.setPrototypeOf(this, RunnerExecutionError.prototype);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Runner for runtimes with no OS sandbox support when isolation is on:
|
|
20
|
+
* every run fails fast with a clear message — a security opt-in must not
|
|
21
|
+
* silently run unsandboxed.
|
|
22
|
+
*/
|
|
23
|
+
export function createSandboxUnsupportedRunner(cliType) {
|
|
24
|
+
return {
|
|
25
|
+
// eslint-disable-next-line require-yield
|
|
26
|
+
async *execute() {
|
|
27
|
+
throw new RunnerExecutionError(`${cliType} does not support OS sandboxing. Disable isolation (remove --isolated / profile "isolated") or use claude-code or codex for this thread.`);
|
|
28
|
+
},
|
|
29
|
+
abort() { },
|
|
30
|
+
async shutdown() { },
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../src/agent/runtimes/contracts.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,SAAS,GAAuB;IAC3C,OAAO;IACP,MAAM;IACN,SAAS;IACT,aAAa;IACb,MAAM;IACN,SAAS;CACV,CAAC;AAqFF,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,cAAc,CAAU;IAExB,YAAY,OAAe,EAAE,OAAqC;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,cAAc,GAAG,OAAO,EAAE,cAAc,CAAC;QAC9C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,OAAe;IAC5D,OAAO;QACL,yCAAyC;QACzC,KAAK,CAAC,CAAC,OAAO;YACZ,MAAM,IAAI,oBAAoB,CAC5B,GAAG,OAAO,0IAA0I,CACrJ,CAAC;QACJ,CAAC;QACD,KAAK,KAAU,CAAC;QAChB,KAAK,CAAC,QAAQ,KAAmB,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor CLI reads custom slash commands from `<repo>/.cursor/commands/` and
|
|
3
|
+
* `~/.cursor/commands/` but does not advertise them in its stream, so the runner scans
|
|
4
|
+
* both and reports the inventory as a synthetic `opensana.commands` chunk. Project
|
|
5
|
+
* commands win collisions; any read error means that directory contributes nothing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function discoverCursorCommands(workingDirectory: string): Promise<string[]>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { readdir } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { basename, extname, join } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Cursor CLI reads custom slash commands from `<repo>/.cursor/commands/` and
|
|
6
|
+
* `~/.cursor/commands/` but does not advertise them in its stream, so the runner scans
|
|
7
|
+
* both and reports the inventory as a synthetic `opensana.commands` chunk. Project
|
|
8
|
+
* commands win collisions; any read error means that directory contributes nothing.
|
|
9
|
+
*/
|
|
10
|
+
export async function discoverCursorCommands(workingDirectory) {
|
|
11
|
+
const [projectCommands, globalCommands] = await Promise.all([
|
|
12
|
+
listCommandNames(join(workingDirectory, ".cursor", "commands")),
|
|
13
|
+
listCommandNames(join(homedir(), ".cursor", "commands")),
|
|
14
|
+
]);
|
|
15
|
+
const seen = new Set();
|
|
16
|
+
const commands = [];
|
|
17
|
+
for (const name of [...projectCommands, ...globalCommands]) {
|
|
18
|
+
if (seen.has(name)) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
seen.add(name);
|
|
22
|
+
commands.push(name);
|
|
23
|
+
}
|
|
24
|
+
return commands;
|
|
25
|
+
}
|
|
26
|
+
async function listCommandNames(directory) {
|
|
27
|
+
try {
|
|
28
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
29
|
+
return entries
|
|
30
|
+
.filter((entry) => entry.isFile() && extname(entry.name) === ".md")
|
|
31
|
+
.map((entry) => basename(entry.name, ".md"))
|
|
32
|
+
.filter((name) => name.length > 0)
|
|
33
|
+
.sort();
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../../src/agent/runtimes/cursor/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,gBAAwB;IAExB,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1D,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAC/D,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;KACzD,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,eAAe,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC;QAC3D,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACnB,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,SAAiB;IAC/C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,OAAO,OAAO;aACX,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;aAClE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aAC3C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;aACjC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DetectedCli } from "../contracts.js";
|
|
2
|
+
export type AvailableCursorCli = DetectedCli & {
|
|
3
|
+
type: "cursor";
|
|
4
|
+
};
|
|
5
|
+
/** `cursor-agent --version` prints a bare line like "2025.09.18-7ae6800". */
|
|
6
|
+
export declare function parseCursorVersion(stdout: string): string;
|
|
7
|
+
export declare function detectCursorAgent(): Promise<AvailableCursorCli | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the installed cursor-agent knows `--trust` (trust the working
|
|
10
|
+
* directory). Newer builds require it to run non-interactively without
|
|
11
|
+
* `--force`; older builds (2025.09.x) trust the cwd by default and reject
|
|
12
|
+
* the flag. A `--help` grep is more robust than comparing date-versions
|
|
13
|
+
* against an assumed release date. Memoized per process.
|
|
14
|
+
*/
|
|
15
|
+
export declare function supportsTrustFlag(): Promise<boolean>;
|
|
16
|
+
/** Test-only: reset the memoized `--trust` probe. */
|
|
17
|
+
export declare function resetTrustFlagProbeForTests(): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { resolveCursorExecutablePath } from "./runner.js";
|
|
4
|
+
const execFileAsync = promisify(execFile);
|
|
5
|
+
/** `cursor-agent --version` prints a bare line like "2025.09.18-7ae6800". */
|
|
6
|
+
export function parseCursorVersion(stdout) {
|
|
7
|
+
const line = stdout
|
|
8
|
+
.split("\n")
|
|
9
|
+
.map((entry) => entry.trim())
|
|
10
|
+
.find((entry) => entry.length > 0);
|
|
11
|
+
return line && /^\d{4}\.\d{2}\.\d{2}/.test(line) ? line : "unknown";
|
|
12
|
+
}
|
|
13
|
+
export async function detectCursorAgent() {
|
|
14
|
+
try {
|
|
15
|
+
const executable = await resolveCursorExecutablePath();
|
|
16
|
+
const { stdout } = await execFileAsync(executable.command, ["--version"], {
|
|
17
|
+
timeout: 10_000,
|
|
18
|
+
});
|
|
19
|
+
return { type: "cursor", version: parseCursorVersion(String(stdout ?? "")) };
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
let trustFlagProbe = null;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the installed cursor-agent knows `--trust` (trust the working
|
|
28
|
+
* directory). Newer builds require it to run non-interactively without
|
|
29
|
+
* `--force`; older builds (2025.09.x) trust the cwd by default and reject
|
|
30
|
+
* the flag. A `--help` grep is more robust than comparing date-versions
|
|
31
|
+
* against an assumed release date. Memoized per process.
|
|
32
|
+
*/
|
|
33
|
+
export function supportsTrustFlag() {
|
|
34
|
+
if (!trustFlagProbe) {
|
|
35
|
+
trustFlagProbe = (async () => {
|
|
36
|
+
try {
|
|
37
|
+
const executable = await resolveCursorExecutablePath();
|
|
38
|
+
const { stdout } = await execFileAsync(executable.command, ["--help"], {
|
|
39
|
+
timeout: 10_000,
|
|
40
|
+
});
|
|
41
|
+
return String(stdout ?? "").includes("--trust");
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
})();
|
|
47
|
+
}
|
|
48
|
+
return trustFlagProbe;
|
|
49
|
+
}
|
|
50
|
+
/** Test-only: reset the memoized `--trust` probe. */
|
|
51
|
+
export function resetTrustFlagProbeForTests() {
|
|
52
|
+
trustFlagProbe = null;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../../../../../src/agent/runtimes/cursor/detect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAM1C,6EAA6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,IAAI,GAAG,MAAM;SAChB,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC5B,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,2BAA2B,EAAE,CAAC;QACvD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE;YACxE,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;IAC/E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,IAAI,cAAc,GAA4B,IAAI,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB;IAC/B,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,cAAc,GAAG,CAAC,KAAK,IAAI,EAAE;YAC3B,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,MAAM,2BAA2B,EAAE,CAAC;gBACvD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE;oBACrE,OAAO,EAAE,MAAM;iBAChB,CAAC,CAAC;gBACH,OAAO,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,2BAA2B;IACzC,cAAc,GAAG,IAAI,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function isCursorModelSlot(value: unknown): value is string;
|
|
2
|
+
/**
|
|
3
|
+
* cursor-agent encodes reasoning as `--model` name suffixes instead of a flag (table
|
|
4
|
+
* verified against `cursor-agent --list-models`, July 2026), so this combines the
|
|
5
|
+
* server-resolved base model and effort into the final name. Bare Anthropic base ids are
|
|
6
|
+
* not valid cursor names, so a missing/unknown effort resolves to the canonical suffixed
|
|
7
|
+
* id; other unknown combinations pass through, since cursor-agent is the authority.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveCursorModelName(baseModel: string, reasoning?: string): string;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stored model slots. Keep in sync with
|
|
3
|
+
* `apps/web/convex/cli/lib/runtimes/cursor/models.ts` — no shared package
|
|
4
|
+
* crosses the CLI/Convex boundary.
|
|
5
|
+
*/
|
|
6
|
+
const CURSOR_MODEL_SLOTS = [
|
|
7
|
+
"default",
|
|
8
|
+
"auto",
|
|
9
|
+
"composer-2.5",
|
|
10
|
+
"claude-sonnet-5",
|
|
11
|
+
"claude-opus-4-8",
|
|
12
|
+
"claude-fable-5",
|
|
13
|
+
"gpt-5.5",
|
|
14
|
+
"gpt-5.4",
|
|
15
|
+
"gpt-5-mini",
|
|
16
|
+
"gpt-5.3-codex",
|
|
17
|
+
"gemini-3.1-pro",
|
|
18
|
+
"gemini-3.5-flash",
|
|
19
|
+
"glm-5.2",
|
|
20
|
+
"kimi-k2.7-code",
|
|
21
|
+
"grok-build-0.1",
|
|
22
|
+
];
|
|
23
|
+
export function isCursorModelSlot(value) {
|
|
24
|
+
return (typeof value === "string" &&
|
|
25
|
+
CURSOR_MODEL_SLOTS.includes(value));
|
|
26
|
+
}
|
|
27
|
+
const ANTHROPIC_BASE_MODELS = new Set([
|
|
28
|
+
"claude-sonnet-5",
|
|
29
|
+
"claude-opus-4-8",
|
|
30
|
+
"claude-fable-5",
|
|
31
|
+
]);
|
|
32
|
+
const ANTHROPIC_EFFORT_SUFFIXES = new Set([
|
|
33
|
+
"low",
|
|
34
|
+
"medium",
|
|
35
|
+
"high",
|
|
36
|
+
"xhigh",
|
|
37
|
+
"max",
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* cursor-agent encodes reasoning as `--model` name suffixes instead of a flag (table
|
|
41
|
+
* verified against `cursor-agent --list-models`, July 2026), so this combines the
|
|
42
|
+
* server-resolved base model and effort into the final name. Bare Anthropic base ids are
|
|
43
|
+
* not valid cursor names, so a missing/unknown effort resolves to the canonical suffixed
|
|
44
|
+
* id; other unknown combinations pass through, since cursor-agent is the authority.
|
|
45
|
+
*/
|
|
46
|
+
export function resolveCursorModelName(baseModel, reasoning) {
|
|
47
|
+
if (ANTHROPIC_BASE_MODELS.has(baseModel)) {
|
|
48
|
+
// Canonical id ("Sonnet 5 1M" etc.) is the -high tier.
|
|
49
|
+
if (reasoning === undefined || reasoning === "default") {
|
|
50
|
+
return `${baseModel}-high`;
|
|
51
|
+
}
|
|
52
|
+
// Extended thinking rides its own family; canonical tier is -high too.
|
|
53
|
+
if (reasoning === "thinking") {
|
|
54
|
+
return `${baseModel}-thinking-high`;
|
|
55
|
+
}
|
|
56
|
+
if (ANTHROPIC_EFFORT_SUFFIXES.has(reasoning)) {
|
|
57
|
+
return `${baseModel}-${reasoning}`;
|
|
58
|
+
}
|
|
59
|
+
return `${baseModel}-high`;
|
|
60
|
+
}
|
|
61
|
+
switch (baseModel) {
|
|
62
|
+
case "gpt-5.5":
|
|
63
|
+
// Canonical "GPT-5.5 1M" is the -medium tier; xhigh is spelled
|
|
64
|
+
// "extra-high" in this family only.
|
|
65
|
+
if (reasoning === "low" || reasoning === "high") {
|
|
66
|
+
return `${baseModel}-${reasoning}`;
|
|
67
|
+
}
|
|
68
|
+
if (reasoning === "xhigh") {
|
|
69
|
+
return `${baseModel}-extra-high`;
|
|
70
|
+
}
|
|
71
|
+
return `${baseModel}-medium`;
|
|
72
|
+
case "gpt-5.4":
|
|
73
|
+
// Canonical "GPT-5.4 1M" is the -medium tier.
|
|
74
|
+
if (reasoning === "low" ||
|
|
75
|
+
reasoning === "high" ||
|
|
76
|
+
reasoning === "xhigh") {
|
|
77
|
+
return `${baseModel}-${reasoning}`;
|
|
78
|
+
}
|
|
79
|
+
return `${baseModel}-medium`;
|
|
80
|
+
case "gpt-5.3-codex":
|
|
81
|
+
// The unsuffixed base name is the canonical medium tier.
|
|
82
|
+
if (reasoning === "low" ||
|
|
83
|
+
reasoning === "high" ||
|
|
84
|
+
reasoning === "xhigh") {
|
|
85
|
+
return `${baseModel}-${reasoning}`;
|
|
86
|
+
}
|
|
87
|
+
return baseModel;
|
|
88
|
+
case "glm-5.2":
|
|
89
|
+
// Two tiers only; bare "glm-5.2" is not a valid id.
|
|
90
|
+
return reasoning === "max" ? `${baseModel}-max` : `${baseModel}-high`;
|
|
91
|
+
default:
|
|
92
|
+
// auto, composer-2.5, gemini-*, gpt-5-mini, kimi-k2.7-code,
|
|
93
|
+
// grok-build-0.1: plain ids, no reasoning tiers.
|
|
94
|
+
return baseModel;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../src/agent/runtimes/cursor/models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,kBAAkB,GAAG;IACzB,SAAS;IACT,MAAM;IACN,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,SAAS;IACT,SAAS;IACT,YAAY;IACZ,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,SAAS;IACT,gBAAgB;IAChB,gBAAgB;CACR,CAAC;AAEX,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,kBAAwC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;CACjB,CAAC,CAAC;AAEH,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACxC,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;CACN,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,SAAiB,EACjB,SAAkB;IAElB,IAAI,qBAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,uDAAuD;QACvD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YACvD,OAAO,GAAG,SAAS,OAAO,CAAC;QAC7B,CAAC;QACD,uEAAuE;QACvE,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;YAC7B,OAAO,GAAG,SAAS,gBAAgB,CAAC;QACtC,CAAC;QACD,IAAI,yBAAyB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7C,OAAO,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,GAAG,SAAS,OAAO,CAAC;IAC7B,CAAC;IAED,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,SAAS;YACZ,+DAA+D;YAC/D,oCAAoC;YACpC,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;gBAChD,OAAO,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC;YACrC,CAAC;YACD,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;gBAC1B,OAAO,GAAG,SAAS,aAAa,CAAC;YACnC,CAAC;YACD,OAAO,GAAG,SAAS,SAAS,CAAC;QAC/B,KAAK,SAAS;YACZ,8CAA8C;YAC9C,IACE,SAAS,KAAK,KAAK;gBACnB,SAAS,KAAK,MAAM;gBACpB,SAAS,KAAK,OAAO,EACrB,CAAC;gBACD,OAAO,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC;YACrC,CAAC;YACD,OAAO,GAAG,SAAS,SAAS,CAAC;QAC/B,KAAK,eAAe;YAClB,yDAAyD;YACzD,IACE,SAAS,KAAK,KAAK;gBACnB,SAAS,KAAK,MAAM;gBACpB,SAAS,KAAK,OAAO,EACrB,CAAC;gBACD,OAAO,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC;YACrC,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,KAAK,SAAS;YACZ,oDAAoD;YACpD,OAAO,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,OAAO,CAAC;QACxE;YACE,4DAA4D;YAC5D,iDAAiD;YACjD,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
import { type CliMode, type CliRuntimeRunner } from "../contracts.js";
|
|
3
|
+
/** Env var override for the cursor-agent executable path. */
|
|
4
|
+
export declare const CURSOR_EXECUTABLE_ENV = "OPENSANA_CURSOR_EXECUTABLE";
|
|
5
|
+
/**
|
|
6
|
+
* Build the `cursor-agent` argument list. Print mode is non-interactive and has no
|
|
7
|
+
* sandbox; the only permission knob is `--force`:
|
|
8
|
+
* - `agent` (and unset) auto-allows everything (`--force`)
|
|
9
|
+
* - every other mode follows the machine's Cursor permission config, with `--trust` when
|
|
10
|
+
* the installed binary supports it (newer builds require it non-interactively).
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildCursorAgentArgs(options: {
|
|
13
|
+
cliMode?: CliMode;
|
|
14
|
+
runModel?: string;
|
|
15
|
+
runEffort?: string;
|
|
16
|
+
continuationId?: string;
|
|
17
|
+
trustFlagSupported: boolean;
|
|
18
|
+
}): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Chat id from a parsed stream event. `system` is skipped deliberately: it
|
|
21
|
+
* can fire before the session is initialized, so its `session_id` may be
|
|
22
|
+
* missing or stale (matches the web normalizer's continuation rule).
|
|
23
|
+
*/
|
|
24
|
+
export declare function extractCursorSessionId(value: unknown): string | null;
|
|
25
|
+
export declare function resolveCursorExecutablePath(): Promise<{
|
|
26
|
+
command: string;
|
|
27
|
+
source: string;
|
|
28
|
+
}>;
|
|
29
|
+
export declare function buildCursorSubprocessEnv(threadId: string): NodeJS.ProcessEnv;
|
|
30
|
+
/**
|
|
31
|
+
* The cursor-agent install wraps a native binary in a launcher; killing only
|
|
32
|
+
* the wrapper (especially with SIGKILL, which it cannot forward) orphans the
|
|
33
|
+
* native process. Signal the whole process group instead.
|
|
34
|
+
*/
|
|
35
|
+
export declare function killCursorProcess(child: ChildProcess, signal: NodeJS.Signals): void;
|
|
36
|
+
export declare function createCursorRunner(): CliRuntimeRunner;
|