@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,104 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { readFile, stat } from "node:fs/promises";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import ora from "ora";
|
|
5
|
+
import { api } from "../convex/_generated/api.js";
|
|
6
|
+
import { getContentType } from "./content-type.js";
|
|
7
|
+
import { toUserFacingError } from "./convex-error.js";
|
|
8
|
+
/** Matches `MAX_MESSAGE_ATTACHMENTS` in `apps/web/convex/cli/lib/messages/attachments.ts`. */
|
|
9
|
+
const MAX_ATTACHMENTS = 10;
|
|
10
|
+
/**
|
|
11
|
+
* Mirrors the web composer's default `MAX_ATTACHMENT_SIZE` (`apps/web/lib/config.ts`,
|
|
12
|
+
* `NEXT_PUBLIC_MAX_ATTACHMENT_SIZE_MB`). Client-side on both surfaces — the backend
|
|
13
|
+
* caps attachment *count*, not bytes — so this is about failing before a whole file
|
|
14
|
+
* is read into memory, not a trust boundary.
|
|
15
|
+
*/
|
|
16
|
+
const MAX_ATTACHMENT_SIZE_MB = 50;
|
|
17
|
+
const MAX_ATTACHMENT_SIZE = MAX_ATTACHMENT_SIZE_MB * 1024 * 1024;
|
|
18
|
+
function isUploadResponse(value) {
|
|
19
|
+
return typeof value === "object" && value !== null && typeof Reflect.get(value, "storageId") === "string";
|
|
20
|
+
}
|
|
21
|
+
async function uploadOne(client, projectId, filePath) {
|
|
22
|
+
const absolutePath = path.resolve(filePath);
|
|
23
|
+
const fileStat = await stat(absolutePath);
|
|
24
|
+
if (!fileStat.isFile()) {
|
|
25
|
+
throw new Error(`${filePath} is not a file.`);
|
|
26
|
+
}
|
|
27
|
+
// Before `readFile`, so an oversized file is rejected rather than buffered.
|
|
28
|
+
if (fileStat.size > MAX_ATTACHMENT_SIZE) {
|
|
29
|
+
throw new Error(`${filePath} exceeds the ${MAX_ATTACHMENT_SIZE_MB} MB attachment size limit.`);
|
|
30
|
+
}
|
|
31
|
+
const fileName = path.basename(absolutePath);
|
|
32
|
+
const contentType = getContentType(absolutePath);
|
|
33
|
+
const spinner = ora(`Uploading ${fileName}`).start();
|
|
34
|
+
try {
|
|
35
|
+
const uploadUrl = await client.mutation(api.cli.messages.generateMessageAttachmentUploadUrl, { projectId });
|
|
36
|
+
const response = await fetch(uploadUrl, {
|
|
37
|
+
method: "POST",
|
|
38
|
+
headers: { "Content-Type": contentType },
|
|
39
|
+
body: await readFile(absolutePath),
|
|
40
|
+
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new Error(`Upload failed: ${response.status} - ${await response.text()}`);
|
|
43
|
+
}
|
|
44
|
+
const json = await response.json();
|
|
45
|
+
if (!isUploadResponse(json)) {
|
|
46
|
+
throw new Error("Upload response did not include a storageId.");
|
|
47
|
+
}
|
|
48
|
+
// Registered before the send, never skipped: there is no cron sweep, so an
|
|
49
|
+
// unregistered blob has no reclaimer. Spec: docs/specs/cli-message-attachments.md.
|
|
50
|
+
await client.mutation(api.cli.messages.registerPendingUploadedAttachment, {
|
|
51
|
+
projectId,
|
|
52
|
+
storageId: json.storageId,
|
|
53
|
+
});
|
|
54
|
+
spinner.succeed(`Uploaded ${fileName}`);
|
|
55
|
+
return { storageId: json.storageId, fileName, fileSize: fileStat.size, contentType };
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
spinner.fail(`Failed to upload ${fileName}`);
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Upload `files`, hand the metadata to `send`, and always discard the pending
|
|
64
|
+
* uploads — a failed send would otherwise leak the blobs. Discarding after a
|
|
65
|
+
* *successful* send is a no-op on storage: the mutation deletes bytes only when
|
|
66
|
+
* no message references them (`createAttachmentRefs` already dropped the rows).
|
|
67
|
+
*
|
|
68
|
+
* Cleanup never changes the outcome: every blob is attempted even if one fails,
|
|
69
|
+
* and a cleanup failure is warned about rather than thrown. Rethrowing would turn
|
|
70
|
+
* a committed send into a reported failure — losing the message id and inviting a
|
|
71
|
+
* retry that queues a duplicate.
|
|
72
|
+
*/
|
|
73
|
+
export async function withThreadAttachments(client, projectId, files, send) {
|
|
74
|
+
if (files.length === 0) {
|
|
75
|
+
return send([]);
|
|
76
|
+
}
|
|
77
|
+
if (files.length > MAX_ATTACHMENTS) {
|
|
78
|
+
throw new Error(`A message can include at most ${MAX_ATTACHMENTS} attachments.`);
|
|
79
|
+
}
|
|
80
|
+
const uploaded = [];
|
|
81
|
+
try {
|
|
82
|
+
for (const file of files) {
|
|
83
|
+
uploaded.push(await uploadOne(client, projectId, file));
|
|
84
|
+
}
|
|
85
|
+
return await send(uploaded);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
await discardPendingUploads(client, projectId, uploaded);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function discardPendingUploads(client, projectId, uploaded) {
|
|
92
|
+
const results = await Promise.allSettled(uploaded.map((attachment) => client.mutation(api.cli.messages.deletePendingUploadedAttachment, {
|
|
93
|
+
projectId,
|
|
94
|
+
storageId: attachment.storageId,
|
|
95
|
+
})));
|
|
96
|
+
for (const [index, result] of results.entries()) {
|
|
97
|
+
if (result.status === "rejected") {
|
|
98
|
+
const storageId = uploaded[index]?.storageId;
|
|
99
|
+
console.error(chalk.yellow("!") +
|
|
100
|
+
` Could not discard pending upload ${storageId}: ${toUserFacingError(result.reason)}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=thread-attachments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-attachments.js","sourceRoot":"","sources":["../../../src/lib/thread-attachments.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Trim whitespace and trailing slashes so pasted URLs like "….convex.cloud/ " work. */
|
|
2
|
+
export declare function normalizeConvexUrl(url: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Convert a Convex Cloud URL to its HTTP site URL.
|
|
5
|
+
* Convex queries use *.convex.cloud, but HTTP routes (including MCP)
|
|
6
|
+
* are served from *.convex.site. Self-hosted Convex serves HTTP routes
|
|
7
|
+
* on port 3211 next to the client API on port 3210.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toConvexSiteUrl(cloudUrl: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Build the full MCP endpoint URL for a project-scoped connection.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildMcpUrl(convexCloudUrl: string, orgSlug: string, projectAlias: string): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Trim whitespace and trailing slashes so pasted URLs like "….convex.cloud/ " work. */
|
|
2
|
+
export function normalizeConvexUrl(url) {
|
|
3
|
+
return url.trim().replace(/\/+$/, "");
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Convert a Convex Cloud URL to its HTTP site URL.
|
|
7
|
+
* Convex queries use *.convex.cloud, but HTTP routes (including MCP)
|
|
8
|
+
* are served from *.convex.site. Self-hosted Convex serves HTTP routes
|
|
9
|
+
* on port 3211 next to the client API on port 3210.
|
|
10
|
+
*/
|
|
11
|
+
export function toConvexSiteUrl(cloudUrl) {
|
|
12
|
+
if (cloudUrl.includes(".convex.cloud")) {
|
|
13
|
+
return cloudUrl.replace(".convex.cloud", ".convex.site");
|
|
14
|
+
}
|
|
15
|
+
return cloudUrl.replace(/:3210(\/|$)/, ":3211$1");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Build the full MCP endpoint URL for a project-scoped connection.
|
|
19
|
+
*/
|
|
20
|
+
export function buildMcpUrl(convexCloudUrl, orgSlug, projectAlias) {
|
|
21
|
+
const siteUrl = toConvexSiteUrl(convexCloudUrl);
|
|
22
|
+
const project = `${encodeURIComponent(orgSlug)}/${encodeURIComponent(projectAlias)}`;
|
|
23
|
+
return `${siteUrl}/api/mcp?project=${project}`;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../src/lib/url.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,IAAI,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACvC,OAAO,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,cAAsB,EACtB,OAAe,EACf,YAAoB;IAEpB,MAAM,OAAO,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;IACrF,OAAO,GAAG,OAAO,oBAAoB,OAAO,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
function readPackageVersion(packageJsonPath) {
|
|
5
|
+
let packageJson;
|
|
6
|
+
try {
|
|
7
|
+
packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (!packageJson || typeof packageJson !== "object") {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const { name, version } = packageJson;
|
|
16
|
+
if (name !== "@useconvoy/cli" || typeof version !== "string") {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return version;
|
|
20
|
+
}
|
|
21
|
+
/** The @useconvoy/cli package version, walking up from this module. */
|
|
22
|
+
export function getCliVersion() {
|
|
23
|
+
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
for (let depth = 0; depth < 5; depth += 1) {
|
|
25
|
+
const version = readPackageVersion(path.join(dir, "package.json"));
|
|
26
|
+
if (version) {
|
|
27
|
+
return version;
|
|
28
|
+
}
|
|
29
|
+
dir = path.dirname(dir);
|
|
30
|
+
}
|
|
31
|
+
return "0.0.0";
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,SAAS,kBAAkB,CAAC,eAAuB;IACjD,IAAI,WAAoB,CAAC;IAEzB,IAAI,CAAC;QACH,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,WAAoD,CAAC;IAC/E,IAAI,IAAI,KAAK,gBAAgB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,aAAa;IAC3B,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEvD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC;QACnE,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
FROM node:20
|
|
2
|
+
|
|
3
|
+
ARG TZ
|
|
4
|
+
ENV TZ="$TZ"
|
|
5
|
+
|
|
6
|
+
# Install basic development tools and iptables/ipset
|
|
7
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
8
|
+
less \
|
|
9
|
+
git \
|
|
10
|
+
procps \
|
|
11
|
+
sudo \
|
|
12
|
+
fzf \
|
|
13
|
+
zsh \
|
|
14
|
+
man-db \
|
|
15
|
+
unzip \
|
|
16
|
+
gnupg2 \
|
|
17
|
+
gh \
|
|
18
|
+
iptables \
|
|
19
|
+
ipset \
|
|
20
|
+
iproute2 \
|
|
21
|
+
dnsutils \
|
|
22
|
+
aggregate \
|
|
23
|
+
jq \
|
|
24
|
+
nano \
|
|
25
|
+
vim \
|
|
26
|
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
27
|
+
|
|
28
|
+
# Ensure default node user has access to /usr/local/share
|
|
29
|
+
RUN mkdir -p /usr/local/share/npm-global && \
|
|
30
|
+
chown -R node:node /usr/local/share
|
|
31
|
+
|
|
32
|
+
ARG USERNAME=node
|
|
33
|
+
|
|
34
|
+
# Persist bash history.
|
|
35
|
+
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
|
|
36
|
+
&& mkdir /commandhistory \
|
|
37
|
+
&& touch /commandhistory/.bash_history \
|
|
38
|
+
&& chown -R $USERNAME /commandhistory
|
|
39
|
+
|
|
40
|
+
# Set `DEVCONTAINER` environment variable to help with orientation
|
|
41
|
+
ENV DEVCONTAINER=true
|
|
42
|
+
|
|
43
|
+
# Create workspace and config directories and set permissions
|
|
44
|
+
RUN mkdir -p /workspace /home/node/.claude && \
|
|
45
|
+
chown -R node:node /workspace /home/node/.claude
|
|
46
|
+
|
|
47
|
+
WORKDIR /workspace
|
|
48
|
+
|
|
49
|
+
ARG GIT_DELTA_VERSION=0.18.2
|
|
50
|
+
RUN ARCH=$(dpkg --print-architecture) && \
|
|
51
|
+
wget "https://github.com/dandavison/delta/releases/download/${GIT_DELTA_VERSION}/git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
|
|
52
|
+
sudo dpkg -i "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb" && \
|
|
53
|
+
rm "git-delta_${GIT_DELTA_VERSION}_${ARCH}.deb"
|
|
54
|
+
|
|
55
|
+
# Enable corepack so a project-pinned package manager (pnpm/yarn) works out of the box
|
|
56
|
+
RUN corepack enable
|
|
57
|
+
|
|
58
|
+
# Set up non-root user
|
|
59
|
+
USER node
|
|
60
|
+
|
|
61
|
+
# Install global packages
|
|
62
|
+
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
|
|
63
|
+
ENV PATH=$PATH:/usr/local/share/npm-global/bin
|
|
64
|
+
|
|
65
|
+
# Set the default shell to zsh rather than sh
|
|
66
|
+
ENV SHELL=/bin/zsh
|
|
67
|
+
|
|
68
|
+
# Set the default editor and visual
|
|
69
|
+
ENV EDITOR=nano
|
|
70
|
+
ENV VISUAL=nano
|
|
71
|
+
|
|
72
|
+
# Default powerline10k theme
|
|
73
|
+
ARG ZSH_IN_DOCKER_VERSION=1.2.0
|
|
74
|
+
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v${ZSH_IN_DOCKER_VERSION}/zsh-in-docker.sh)" -- \
|
|
75
|
+
-p git \
|
|
76
|
+
-p fzf \
|
|
77
|
+
-a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
|
|
78
|
+
-a "source /usr/share/doc/fzf/examples/completion.zsh" \
|
|
79
|
+
-a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
|
|
80
|
+
-x
|
|
81
|
+
|
|
82
|
+
# Agent CLIs (claude, codex, opencode, cursor-agent) are NOT installed here.
|
|
83
|
+
# A `RUN npm install -g ...@latest` layer is cached, so every rebuild reinstates
|
|
84
|
+
# whatever version the first build happened to fetch. They install from
|
|
85
|
+
# `postCreateCommand` instead, which Docker never caches. cursor-agent lands in
|
|
86
|
+
# ~/.local/bin, hence the PATH entry.
|
|
87
|
+
ENV PATH=$PATH:/home/node/.local/bin
|
|
88
|
+
|
|
89
|
+
# Copy and set up the firewall script
|
|
90
|
+
COPY init-firewall.sh /usr/local/bin/
|
|
91
|
+
USER root
|
|
92
|
+
RUN chmod +x /usr/local/bin/init-firewall.sh && \
|
|
93
|
+
echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-devcontainer && \
|
|
94
|
+
chmod 0440 /etc/sudoers.d/node-devcontainer
|
|
95
|
+
USER node
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# AI Agent Sandbox Dev Container
|
|
2
|
+
|
|
3
|
+
A sandboxed dev container for running AI coding agents (Claude Code, Codex, OpenCode, Cursor CLI) against any project, with an optional outbound-network firewall.
|
|
4
|
+
|
|
5
|
+
This is the distributable version of the [OpenSana](https://opensana.dev) dev container. It is generic: nothing in it requires OpenSana, but OpenSana users get their CLI profiles and Convex backend wired in automatically when the corresponding env vars are set.
|
|
6
|
+
|
|
7
|
+
## What you get
|
|
8
|
+
|
|
9
|
+
- **Claude Code, Codex CLI, OpenCode CLI, and Cursor CLI** installed globally from `latest` on container create (via `postCreateCommand`, so rebuilds are never stuck on a cached image layer's versions)
|
|
10
|
+
- **Agent auth shared with the host** — log in once on the host, the container reuses `~/.codex`, `~/.cursor`, `~/.local/share/opencode`, `~/.config/opencode`, and (optionally) `~/.config/opensana`
|
|
11
|
+
- **Two network modes** — `strict` blocks all outbound traffic except a curated allowlist; `open` skips the firewall
|
|
12
|
+
- **Persistent shell history and Claude Code config** across container rebuilds (Docker volumes)
|
|
13
|
+
- zsh + powerlevel10k, fzf, git-delta, gh, jq, corepack (pnpm/yarn via project pin)
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
### With the OpenSana CLI
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cd your-project
|
|
21
|
+
npx @useconvoy/cli devcontainer
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This writes the template into `./.devcontainer/`. It fetches the latest version from GitHub when reachable and otherwise uses the copy bundled with the CLI. Use `--force` to overwrite an existing `.devcontainer/`.
|
|
25
|
+
|
|
26
|
+
### Manually
|
|
27
|
+
|
|
28
|
+
Copy the four files from this directory (`devcontainer.json`, `Dockerfile`, `init-firewall.sh`, `README.md`) into a `.devcontainer/` folder at the root of your project.
|
|
29
|
+
|
|
30
|
+
## Quick start
|
|
31
|
+
|
|
32
|
+
1. Set any env vars you need on your **host** (see below)
|
|
33
|
+
2. Open the project in VS Code (or Cursor) with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
|
34
|
+
3. Run **Dev Containers: Reopen in Container** from the command palette
|
|
35
|
+
4. Inside the container, run `claude`, `codex`, `opencode`, or `cursor-agent`
|
|
36
|
+
|
|
37
|
+
## Environment variables
|
|
38
|
+
|
|
39
|
+
Everything is optional. The container pulls values from your host environment via `${localEnv:...}`; nothing is committed to the repo.
|
|
40
|
+
|
|
41
|
+
| Variable | Default | Description |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `DEVCONTAINER_NETWORK_MODE` | `strict` | `strict` enables the outbound firewall, `open` skips it |
|
|
44
|
+
| `DEVCONTAINER_EXTRA_ALLOWED_DOMAINS` | (unset) | Extra domains for the strict-mode allowlist, comma or space separated (e.g. `api.myservice.com, cdn.myservice.com`) |
|
|
45
|
+
| `AWS_BEARER_TOKEN_BEDROCK` | (unset) | Set to use Claude Code via AWS Bedrock |
|
|
46
|
+
| `CLAUDE_CODE_USE_BEDROCK` | (unset) | Set to `1` to route Claude Code through Bedrock |
|
|
47
|
+
| `AWS_REGION` | `us-east-1` | AWS region for the Bedrock firewall allowlist entry |
|
|
48
|
+
| `CONVEX_DEPLOYMENT` | (unset) | OpenSana/Convex deployment slug — adds `$CONVEX_DEPLOYMENT.convex.site` and `.convex.cloud` to the allowlist |
|
|
49
|
+
|
|
50
|
+
Export them in your shell profile (`~/.zshrc` / `~/.bashrc`) **before** the container starts, then rebuild.
|
|
51
|
+
|
|
52
|
+
## Network modes
|
|
53
|
+
|
|
54
|
+
### `strict` (default)
|
|
55
|
+
|
|
56
|
+
Runs `init-firewall.sh` on container startup. All outbound traffic is blocked except:
|
|
57
|
+
|
|
58
|
+
- **GitHub** — git operations and API (GitHub meta API ranges, with a DNS fallback)
|
|
59
|
+
- **npm registry** — `registry.npmjs.org`
|
|
60
|
+
- **Anthropic** — `api.anthropic.com`, `sentry.io`, `statsig.anthropic.com`, `statsig.com`
|
|
61
|
+
- **OpenAI / Codex** — `api.openai.com`, `auth.openai.com`, `auth.api.openai.org`, `chatgpt.com`, `chat.openai.com`, `ab.chatgpt.com`, `persistent.oaistatic.com`
|
|
62
|
+
- **OpenCode** — `opencode.ai`, `api.opencode.ai`, `models.dev`
|
|
63
|
+
- **Cursor** — `cursor.com`, `api2.cursor.sh`, `api3.cursor.sh`, `api4.cursor.sh`, `downloads.cursor.com`
|
|
64
|
+
- **VS Code** — marketplace, updates, blob storage
|
|
65
|
+
- **AWS Bedrock** — `bedrock-runtime.$AWS_REGION.amazonaws.com`
|
|
66
|
+
- **Convex** — `$CONVEX_DEPLOYMENT.convex.site` / `.convex.cloud` (only when `CONVEX_DEPLOYMENT` is set)
|
|
67
|
+
- **Your extras** — anything in `DEVCONTAINER_EXTRA_ALLOWED_DOMAINS`
|
|
68
|
+
- **Localhost and the host network** — local dev servers, Docker DNS
|
|
69
|
+
|
|
70
|
+
### `open`
|
|
71
|
+
|
|
72
|
+
Skips the firewall entirely. Use it when you want fewer networking surprises or broader tool compatibility.
|
|
73
|
+
|
|
74
|
+
### Switching modes
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
export DEVCONTAINER_NETWORK_MODE=open # or strict
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then rebuild the container (not just reopen) so the mode is picked up.
|
|
81
|
+
|
|
82
|
+
## Allowing more domains
|
|
83
|
+
|
|
84
|
+
Preferably, set `DEVCONTAINER_EXTRA_ALLOWED_DOMAINS` on the host and rebuild. For a running container, you can also edit `init-firewall.sh` and re-apply without a rebuild:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
sudo /usr/local/bin/init-firewall.sh
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The script is safe to re-run — it temporarily opens HTTPS to fetch external data before rebuilding the firewall.
|
|
91
|
+
|
|
92
|
+
## Stale allowlist IPs
|
|
93
|
+
|
|
94
|
+
The firewall resolves allowed domains to IPs once at startup. Providers rotate IPs behind DNS, so after a long-running session an agent may start failing with network/retry errors that have no HTTP status. Re-running `sudo /usr/local/bin/init-firewall.sh` (or restarting the container) refreshes the allowlist. If errors disappear in `open` mode, the stale allowlist was the cause.
|
|
95
|
+
|
|
96
|
+
## Agent auth
|
|
97
|
+
|
|
98
|
+
- **Claude Code** — config lives in a container-local volume (`/home/node/.claude`). Log in inside the container, or set the Bedrock env vars above.
|
|
99
|
+
- **Codex** — shared with the host via `~/.codex`. Run `codex login` on the host; the container reuses `~/.codex/auth.json`.
|
|
100
|
+
- **OpenCode** — shared with the host via `~/.local/share/opencode` (auth) and `~/.config/opencode` (config). Run `opencode auth login` on the host. Providers other than Anthropic/OpenAI need their API endpoints added to the allowlist in strict mode.
|
|
101
|
+
- **Cursor CLI** — shared with the host via `~/.cursor`. Run `cursor-agent login` on the host; the container reuses the stored credentials.
|
|
102
|
+
- **OpenSana CLI** — profiles and API keys shared via `~/.config/opensana`. If you don't use OpenSana the mount is harmless (the directory is auto-created empty).
|
|
103
|
+
|
|
104
|
+
## Mounted volumes
|
|
105
|
+
|
|
106
|
+
| Host path | Container path | Purpose |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| (Docker volume) | `/commandhistory` | Persistent bash/zsh history across rebuilds |
|
|
109
|
+
| (Docker volume) | `/home/node/.claude` | Claude Code config and session data |
|
|
110
|
+
| `~/.codex/` | `/home/node/.codex/` | Codex CLI auth, config, sessions (shared with host) |
|
|
111
|
+
| `~/.cursor/` | `/home/node/.cursor/` | Cursor CLI auth and config (shared with host) |
|
|
112
|
+
| `~/.local/share/opencode/` | `/home/node/.local/share/opencode/` | OpenCode auth and sessions (shared with host) |
|
|
113
|
+
| `~/.config/opencode/` | `/home/node/.config/opencode/` | OpenCode configuration (shared with host) |
|
|
114
|
+
| `~/.config/opensana/` | `/home/node/.config/opensana/` | OpenSana CLI profiles and API keys (optional) |
|
|
115
|
+
|
|
116
|
+
The container's `initializeCommand` creates the host directories automatically if they are missing.
|
|
117
|
+
|
|
118
|
+
## Node projects with native dependencies
|
|
119
|
+
|
|
120
|
+
The workspace is bind-mounted from the host, so `node_modules` is shared with the host by default. If your project has dependencies with platform-native binaries (e.g. `esbuild`, `lightningcss`), isolate `node_modules` in a container-only volume by adding a mount:
|
|
121
|
+
|
|
122
|
+
```jsonc
|
|
123
|
+
"mounts": [
|
|
124
|
+
// ...existing mounts...
|
|
125
|
+
"source=my-project-node-modules-${devcontainerId},target=/workspace/node_modules,type=volume"
|
|
126
|
+
]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
and run your package manager's install inside the container after the first start (you may need to `sudo chown -R node:node /workspace/node_modules` first).
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "AI Agent Sandbox",
|
|
3
|
+
"build": {
|
|
4
|
+
"dockerfile": "Dockerfile",
|
|
5
|
+
"args": {
|
|
6
|
+
"TZ": "${localEnv:TZ:America/Los_Angeles}",
|
|
7
|
+
"GIT_DELTA_VERSION": "0.18.2",
|
|
8
|
+
"ZSH_IN_DOCKER_VERSION": "1.2.0"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"runArgs": [
|
|
12
|
+
"--cap-add=NET_ADMIN",
|
|
13
|
+
"--cap-add=NET_RAW"
|
|
14
|
+
],
|
|
15
|
+
"customizations": {
|
|
16
|
+
"vscode": {
|
|
17
|
+
"extensions": [
|
|
18
|
+
"anthropic.claude-code",
|
|
19
|
+
"eamodio.gitlens"
|
|
20
|
+
],
|
|
21
|
+
"settings": {
|
|
22
|
+
"terminal.integrated.defaultProfile.linux": "zsh",
|
|
23
|
+
"terminal.integrated.profiles.linux": {
|
|
24
|
+
"bash": {
|
|
25
|
+
"path": "bash",
|
|
26
|
+
"icon": "terminal-bash"
|
|
27
|
+
},
|
|
28
|
+
"zsh": {
|
|
29
|
+
"path": "zsh"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"remoteUser": "node",
|
|
36
|
+
"mounts": [
|
|
37
|
+
// Persistent shell history and Claude Code config across rebuilds
|
|
38
|
+
"source=agent-sandbox-bashhistory-${devcontainerId},target=/commandhistory,type=volume",
|
|
39
|
+
"source=agent-sandbox-claude-config-${devcontainerId},target=/home/node/.claude,type=volume",
|
|
40
|
+
// Agent auth/config shared with the host (log in once on the host, reuse in the container)
|
|
41
|
+
"source=${localEnv:HOME}/.codex,target=/home/node/.codex,type=bind,consistency=cached",
|
|
42
|
+
"source=${localEnv:HOME}/.cursor,target=/home/node/.cursor,type=bind,consistency=cached",
|
|
43
|
+
"source=${localEnv:HOME}/.local/share/opencode,target=/home/node/.local/share/opencode,type=bind,consistency=cached",
|
|
44
|
+
"source=${localEnv:HOME}/.config/opencode,target=/home/node/.config/opencode,type=bind,consistency=cached",
|
|
45
|
+
// Optional: OpenSana CLI profiles and API keys (harmless if you don't use OpenSana)
|
|
46
|
+
"source=${localEnv:HOME}/.config/opensana,target=/home/node/.config/opensana,type=bind,consistency=cached"
|
|
47
|
+
],
|
|
48
|
+
"containerEnv": {
|
|
49
|
+
"DEVCONTAINER_NETWORK_MODE": "${localEnv:DEVCONTAINER_NETWORK_MODE:strict}",
|
|
50
|
+
"NODE_OPTIONS": "--max-old-space-size=4096",
|
|
51
|
+
"CLAUDE_CONFIG_DIR": "/home/node/.claude",
|
|
52
|
+
"POWERLEVEL9K_DISABLE_GITSTATUS": "true",
|
|
53
|
+
// Codex indexes each thread's rollout file by ABSOLUTE path in
|
|
54
|
+
// ~/.codex/state_5.sqlite. The host's ~/.codex is bind-mounted above, so a
|
|
55
|
+
// shared state db would be written by both sides with mutually invalid
|
|
56
|
+
// prefixes (host: /Users/you/.codex/..., container: /home/node/.codex/...).
|
|
57
|
+
// Whichever side wrote last wins, and resuming a thread then hard-fails with
|
|
58
|
+
// "failed to resolve rollout path ...: file does not exist" — the first
|
|
59
|
+
// message of a thread works, and every followup breaks.
|
|
60
|
+
// A container-private CODEX_HOME keeps the state db local; postCreateCommand
|
|
61
|
+
// symlinks auth/config/sessions back to the mount so credentials, config,
|
|
62
|
+
// and thread history stay shared with the host.
|
|
63
|
+
"CODEX_HOME": "/home/node/.codex-local"
|
|
64
|
+
},
|
|
65
|
+
"remoteEnv": {
|
|
66
|
+
// Optional: Claude Code via AWS Bedrock (leave unset to use anthropic.com auth)
|
|
67
|
+
"AWS_BEARER_TOKEN_BEDROCK": "${localEnv:AWS_BEARER_TOKEN_BEDROCK}",
|
|
68
|
+
"AWS_REGION": "${localEnv:AWS_REGION:us-east-1}",
|
|
69
|
+
"CLAUDE_CODE_USE_BEDROCK": "${localEnv:CLAUDE_CODE_USE_BEDROCK}",
|
|
70
|
+
// Optional: OpenSana/Convex backend — adds $CONVEX_DEPLOYMENT.convex.{site,cloud} to the strict-mode firewall allowlist
|
|
71
|
+
"CONVEX_DEPLOYMENT": "${localEnv:CONVEX_DEPLOYMENT}",
|
|
72
|
+
// Optional: extra domains for the strict-mode firewall allowlist (comma or space separated)
|
|
73
|
+
"DEVCONTAINER_EXTRA_ALLOWED_DOMAINS": "${localEnv:DEVCONTAINER_EXTRA_ALLOWED_DOMAINS}"
|
|
74
|
+
},
|
|
75
|
+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
|
|
76
|
+
"workspaceFolder": "/workspace",
|
|
77
|
+
"initializeCommand": "mkdir -p \"${localEnv:HOME}/.codex\" \"${localEnv:HOME}/.cursor\" \"${localEnv:HOME}/.local/share/opencode\" \"${localEnv:HOME}/.config/opencode\" \"${localEnv:HOME}/.config/opensana\"",
|
|
78
|
+
// Agent CLIs install here, not in the Dockerfile: Docker caches a
|
|
79
|
+
// `RUN npm install -g ...@latest` layer forever, so rebuilds silently keep the
|
|
80
|
+
// first build's versions. postCreateCommand runs once per container create,
|
|
81
|
+
// uncached and before the firewall, so it always resolves the real `latest`.
|
|
82
|
+
// The $CODEX_HOME symlinks are (re)created here because /home/node/.codex-local
|
|
83
|
+
// lives on the container filesystem and does not survive a rebuild. Only
|
|
84
|
+
// state_5.sqlite stays container-private; `sessions` is shared, and Codex
|
|
85
|
+
// falls back to scanning it by thread id when the db has no row, so threads
|
|
86
|
+
// started on either side remain resumable. `rm -rf` on the sessions path is
|
|
87
|
+
// load-bearing: `ln -sfn` onto an existing real directory nests the link
|
|
88
|
+
// inside it (sessions/sessions) instead of replacing it.
|
|
89
|
+
"postCreateCommand": "npm install -g @anthropic-ai/claude-code@latest @openai/codex@latest opencode-ai@latest && curl -fsSL https://cursor.com/install | bash && mkdir -p \"$CODEX_HOME\" && rm -rf \"$CODEX_HOME/sessions\" && ln -sfn /home/node/.codex/sessions \"$CODEX_HOME/sessions\" && ln -sfn /home/node/.codex/auth.json \"$CODEX_HOME/auth.json\" && ln -sfn /home/node/.codex/config.toml \"$CODEX_HOME/config.toml\"",
|
|
90
|
+
"postStartCommand": "if [ \"$DEVCONTAINER_NETWORK_MODE\" = \"strict\" ]; then sudo /usr/local/bin/init-firewall.sh; else echo \"Skipping firewall setup (DEVCONTAINER_NETWORK_MODE=$DEVCONTAINER_NETWORK_MODE)\"; fi",
|
|
91
|
+
"waitFor": "postStartCommand"
|
|
92
|
+
}
|