@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,56 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
function isMcpConfig(value) {
|
|
4
|
+
return (typeof value === "object" &&
|
|
5
|
+
value !== null &&
|
|
6
|
+
"mcpServers" in value &&
|
|
7
|
+
typeof value.mcpServers === "object" &&
|
|
8
|
+
value.mcpServers !== null);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Read existing .mcp.json from the given directory.
|
|
12
|
+
* Returns undefined if file doesn't exist.
|
|
13
|
+
* Returns a validated McpConfig, or throws on malformed content.
|
|
14
|
+
*/
|
|
15
|
+
export function readMcpConfig(dir) {
|
|
16
|
+
const filePath = path.join(dir, ".mcp.json");
|
|
17
|
+
if (!fs.existsSync(filePath)) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
21
|
+
const parsed = JSON.parse(content);
|
|
22
|
+
if (!isMcpConfig(parsed)) {
|
|
23
|
+
throw new Error(`Invalid .mcp.json: expected an object with "mcpServers" key.`);
|
|
24
|
+
}
|
|
25
|
+
return parsed;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Write .mcp.json to the given directory.
|
|
29
|
+
*/
|
|
30
|
+
export function writeMcpConfig(dir, config) {
|
|
31
|
+
const filePath = path.join(dir, ".mcp.json");
|
|
32
|
+
fs.writeFileSync(filePath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Upsert the opensana MCP server entry into an existing or new config.
|
|
36
|
+
* Preserves other servers in the config.
|
|
37
|
+
*/
|
|
38
|
+
export function upsertOpensanaServer(existing, server) {
|
|
39
|
+
const config = existing ?? { mcpServers: {} };
|
|
40
|
+
config.mcpServers = config.mcpServers ?? {};
|
|
41
|
+
config.mcpServers.opensana = server;
|
|
42
|
+
return config;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if .mcp.json is listed in .gitignore.
|
|
46
|
+
*/
|
|
47
|
+
export function isMcpJsonGitignored(dir) {
|
|
48
|
+
const gitignorePath = path.join(dir, ".gitignore");
|
|
49
|
+
if (!fs.existsSync(gitignorePath))
|
|
50
|
+
return false;
|
|
51
|
+
const content = fs.readFileSync(gitignorePath, "utf-8");
|
|
52
|
+
return content
|
|
53
|
+
.split("\n")
|
|
54
|
+
.some((line) => line.trim() === ".mcp.json" || line.trim() === "/.mcp.json");
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=claude-mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-mcp.js","sourceRoot":"","sources":["../../../../../src/commands/init/config/claude-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAYlC,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,YAAY,IAAI,KAAK;QACrB,OAAQ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G;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,KAAK,CAAC;IAChD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACxD,OAAO,OAAO;SACX,KAAK,CAAC,IAAI,CAAC;SACX,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,YAAY,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type AnyRecord = Record<string, unknown>;
|
|
2
|
+
export interface CodexMcpServerConfig {
|
|
3
|
+
url: string;
|
|
4
|
+
http_headers: Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
export declare function getCodexMcpConfigPath(dir: string): string;
|
|
7
|
+
export declare function readCodexMcpConfig(dir: string): AnyRecord | undefined;
|
|
8
|
+
export declare function hasCodexOpensanaServer(config: AnyRecord | undefined): boolean;
|
|
9
|
+
export declare function upsertCodexOpensanaServer(existing: AnyRecord | undefined, server: CodexMcpServerConfig): AnyRecord;
|
|
10
|
+
export declare function writeCodexMcpConfig(dir: string, config: AnyRecord): void;
|
|
11
|
+
export declare function isCodexMcpConfigGitignored(dir: string): boolean;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import * as TOML from "smol-toml";
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return typeof value === "object" && value !== null;
|
|
6
|
+
}
|
|
7
|
+
function resolveTableKey(config) {
|
|
8
|
+
const hasSnake = "mcp_servers" in config;
|
|
9
|
+
if (hasSnake) {
|
|
10
|
+
const value = config.mcp_servers;
|
|
11
|
+
if (!isRecord(value)) {
|
|
12
|
+
throw new Error('Invalid .codex/config.toml: expected "mcp_servers" to be a table');
|
|
13
|
+
}
|
|
14
|
+
return "mcp_servers";
|
|
15
|
+
}
|
|
16
|
+
const hasCamel = "mcpServers" in config;
|
|
17
|
+
if (hasCamel) {
|
|
18
|
+
const value = config.mcpServers;
|
|
19
|
+
if (!isRecord(value)) {
|
|
20
|
+
throw new Error('Invalid .codex/config.toml: expected "mcpServers" to be a table');
|
|
21
|
+
}
|
|
22
|
+
return "mcpServers";
|
|
23
|
+
}
|
|
24
|
+
return "mcp_servers";
|
|
25
|
+
}
|
|
26
|
+
export function getCodexMcpConfigPath(dir) {
|
|
27
|
+
return path.join(dir, ".codex", "config.toml");
|
|
28
|
+
}
|
|
29
|
+
export function readCodexMcpConfig(dir) {
|
|
30
|
+
const filePath = getCodexMcpConfigPath(dir);
|
|
31
|
+
if (!fs.existsSync(filePath)) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
35
|
+
const parsed = TOML.parse(content);
|
|
36
|
+
if (!isRecord(parsed)) {
|
|
37
|
+
throw new Error("Invalid .codex/config.toml: expected a top-level TOML table");
|
|
38
|
+
}
|
|
39
|
+
return parsed;
|
|
40
|
+
}
|
|
41
|
+
export function hasCodexOpensanaServer(config) {
|
|
42
|
+
if (!config) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const tableKey = resolveTableKey(config);
|
|
46
|
+
const table = config[tableKey];
|
|
47
|
+
if (!isRecord(table)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return "opensana" in table;
|
|
51
|
+
}
|
|
52
|
+
export function upsertCodexOpensanaServer(existing, server) {
|
|
53
|
+
const config = existing ? { ...existing } : {};
|
|
54
|
+
const tableKey = resolveTableKey(config);
|
|
55
|
+
const existingTable = config[tableKey];
|
|
56
|
+
const table = isRecord(existingTable) ? { ...existingTable } : {};
|
|
57
|
+
table.opensana = server;
|
|
58
|
+
config[tableKey] = table;
|
|
59
|
+
return config;
|
|
60
|
+
}
|
|
61
|
+
export function writeCodexMcpConfig(dir, config) {
|
|
62
|
+
const filePath = getCodexMcpConfigPath(dir);
|
|
63
|
+
const codexDir = path.dirname(filePath);
|
|
64
|
+
if (!fs.existsSync(codexDir)) {
|
|
65
|
+
fs.mkdirSync(codexDir, { recursive: true });
|
|
66
|
+
}
|
|
67
|
+
const content = TOML.stringify(config);
|
|
68
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
69
|
+
}
|
|
70
|
+
export function isCodexMcpConfigGitignored(dir) {
|
|
71
|
+
const gitignorePath = path.join(dir, ".gitignore");
|
|
72
|
+
if (!fs.existsSync(gitignorePath))
|
|
73
|
+
return false;
|
|
74
|
+
const content = fs.readFileSync(gitignorePath, "utf-8");
|
|
75
|
+
return content
|
|
76
|
+
.split("\n")
|
|
77
|
+
.map((line) => line.trim())
|
|
78
|
+
.some((line) => line === ".codex" ||
|
|
79
|
+
line === "/.codex" ||
|
|
80
|
+
line === ".codex/config.toml" ||
|
|
81
|
+
line === "/.codex/config.toml");
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=codex-mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-mcp.js","sourceRoot":"","sources":["../../../../../src/commands/init/config/codex-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAWlC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,SAAS,eAAe,CAAC,MAAiB;IACxC,MAAM,QAAQ,GAAG,aAAa,IAAI,MAAM,CAAC;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IACvC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,GAAW;IACpD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,KAAK,CAAC;IAEhD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACxD,OAAO,OAAO;SACX,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,IAAI,CACH,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,KAAK,QAAQ;QACjB,IAAI,KAAK,SAAS;QAClB,IAAI,KAAK,oBAAoB;QAC7B,IAAI,KAAK,qBAAqB,CACjC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type AnyRecord = Record<string, unknown>;
|
|
2
|
+
/** OpenCode remote MCP server entry (`opencode.json` `mcp` key). */
|
|
3
|
+
export interface OpencodeMcpServerConfig {
|
|
4
|
+
type: "remote";
|
|
5
|
+
url: string;
|
|
6
|
+
headers: Record<string, string>;
|
|
7
|
+
/** Bearer header auth — disable OpenCode's OAuth auto-detection. */
|
|
8
|
+
oauth: false;
|
|
9
|
+
}
|
|
10
|
+
export declare function getOpencodeMcpConfigPath(dir: string): string;
|
|
11
|
+
export declare function readOpencodeMcpConfig(dir: string): AnyRecord | undefined;
|
|
12
|
+
export declare function hasOpencodeOpensanaServer(config: AnyRecord | undefined): boolean;
|
|
13
|
+
export declare function upsertOpencodeOpensanaServer(existing: AnyRecord | undefined, server: OpencodeMcpServerConfig): AnyRecord;
|
|
14
|
+
export declare function writeOpencodeMcpConfig(dir: string, config: AnyRecord): void;
|
|
15
|
+
export declare function isOpencodeMcpConfigGitignored(dir: string): boolean;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
const OPENCODE_CONFIG_SCHEMA = "https://opencode.ai/config.json";
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
|
+
}
|
|
7
|
+
export function getOpencodeMcpConfigPath(dir) {
|
|
8
|
+
return path.join(dir, "opencode.json");
|
|
9
|
+
}
|
|
10
|
+
export function readOpencodeMcpConfig(dir) {
|
|
11
|
+
const filePath = getOpencodeMcpConfigPath(dir);
|
|
12
|
+
if (!fs.existsSync(filePath)) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
16
|
+
const parsed = JSON.parse(content);
|
|
17
|
+
if (!isRecord(parsed)) {
|
|
18
|
+
throw new Error("Invalid opencode.json: expected a top-level JSON object");
|
|
19
|
+
}
|
|
20
|
+
return parsed;
|
|
21
|
+
}
|
|
22
|
+
export function hasOpencodeOpensanaServer(config) {
|
|
23
|
+
if (!config) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const mcp = config.mcp;
|
|
27
|
+
return isRecord(mcp) && "opensana" in mcp;
|
|
28
|
+
}
|
|
29
|
+
export function upsertOpencodeOpensanaServer(existing, server) {
|
|
30
|
+
const config = existing
|
|
31
|
+
? { ...existing }
|
|
32
|
+
: { $schema: OPENCODE_CONFIG_SCHEMA };
|
|
33
|
+
if ("mcp" in config && !isRecord(config.mcp)) {
|
|
34
|
+
throw new Error('Invalid opencode.json: expected "mcp" to be an object');
|
|
35
|
+
}
|
|
36
|
+
const mcp = isRecord(config.mcp) ? { ...config.mcp } : {};
|
|
37
|
+
mcp.opensana = server;
|
|
38
|
+
config.mcp = mcp;
|
|
39
|
+
return config;
|
|
40
|
+
}
|
|
41
|
+
export function writeOpencodeMcpConfig(dir, config) {
|
|
42
|
+
const filePath = getOpencodeMcpConfigPath(dir);
|
|
43
|
+
fs.writeFileSync(filePath, `${JSON.stringify(config, null, 2)}\n`, "utf-8");
|
|
44
|
+
}
|
|
45
|
+
export function isOpencodeMcpConfigGitignored(dir) {
|
|
46
|
+
const gitignorePath = path.join(dir, ".gitignore");
|
|
47
|
+
if (!fs.existsSync(gitignorePath))
|
|
48
|
+
return false;
|
|
49
|
+
const content = fs.readFileSync(gitignorePath, "utf-8");
|
|
50
|
+
return content
|
|
51
|
+
.split("\n")
|
|
52
|
+
.map((line) => line.trim())
|
|
53
|
+
.some((line) => line === "opencode.json" || line === "/opencode.json");
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=opencode-mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-mcp.js","sourceRoot":"","sources":["../../../../../src/commands/init/config/opencode-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAalC,MAAM,sBAAsB,GAAG,iCAAiC,CAAC;AAEjE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,QAAQ,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAC/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC;IACnB,CAAC;I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AC,GAAG,CAAC,CAAC;IAC/C,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,GAAW;IACvD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,KAAK,CAAC;IAEhD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACxD,OAAO,OAAO;SACX,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,eAAe,IAAI,IAAI,KAAK,gBAAgB,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/commands/init/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { InitError } from "./errors.js";
|
|
2
|
+
export { runInitMcp } from "./mcp-service.js";
|
|
3
|
+
export { runInitSkill } from "./skill-service.js";
|
|
4
|
+
export { getMarketplaceDir } from "./marketplace.js";
|
|
5
|
+
export { parseCliTargets, parseScope, parseClaudeMethods, } from "./parsers.js";
|
|
6
|
+
export { resolveSkillTargets } from "./prompts.js";
|
|
7
|
+
export { getClaudeSkillDestination } from "./targets/claude.js";
|
|
8
|
+
export { getCodexSkillDestination } from "./targets/codex.js";
|
|
9
|
+
export { INIT_TARGETS, INIT_SCOPES, CLAUDE_METHODS, type InitTarget, type InitScope, type ClaudeMethod, type InitMcpConfig, type InitSkillConfig, type TargetInstallResult, } from "./types.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { InitError } from "./errors.js";
|
|
2
|
+
export { runInitMcp } from "./mcp-service.js";
|
|
3
|
+
export { runInitSkill } from "./skill-service.js";
|
|
4
|
+
export { getMarketplaceDir } from "./marketplace.js";
|
|
5
|
+
export { parseCliTargets, parseScope, parseClaudeMethods, } from "./parsers.js";
|
|
6
|
+
export { resolveSkillTargets } from "./prompts.js";
|
|
7
|
+
export { getClaudeSkillDestination } from "./targets/claude.js";
|
|
8
|
+
export { getCodexSkillDestination } from "./targets/codex.js";
|
|
9
|
+
export { INIT_TARGETS, INIT_SCOPES, CLAUDE_METHODS, } from "./types.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,eAAe,EACf,UAAU,EACV,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,GAOf,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { InitTarget, TargetInstallResult } from "../types.js";
|
|
2
|
+
export declare function copyDirectoryWithOverwrite(config: {
|
|
3
|
+
target: InitTarget;
|
|
4
|
+
label: string;
|
|
5
|
+
sourceDir: string;
|
|
6
|
+
destinationDir: string;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
confirmOverwrite?: (message: string) => Promise<boolean>;
|
|
9
|
+
preparedDestinations?: Set<string>;
|
|
10
|
+
}): Promise<TargetInstallResult>;
|
|
11
|
+
export declare function symlinkDirectoryWithOverwrite(config: {
|
|
12
|
+
target: InitTarget;
|
|
13
|
+
label: string;
|
|
14
|
+
sourceDir: string;
|
|
15
|
+
destinationDir: string;
|
|
16
|
+
force?: boolean;
|
|
17
|
+
confirmOverwrite?: (message: string) => Promise<boolean>;
|
|
18
|
+
}): Promise<TargetInstallResult>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import ora from "ora";
|
|
5
|
+
function pathExists(filePath) {
|
|
6
|
+
try {
|
|
7
|
+
fs.lstatSync(filePath);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function shouldReplaceExisting(config) {
|
|
18
|
+
if (config.force) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
const confirmOverwrite = config.confirmOverwrite ?? (async () => false);
|
|
22
|
+
return confirmOverwrite(`Existing Opensana skill found at ${config.destinationDir}. Overwrite?`);
|
|
23
|
+
}
|
|
24
|
+
export async function copyDirectoryWithOverwrite(config) {
|
|
25
|
+
const preparedKey = path.resolve(config.destinationDir);
|
|
26
|
+
if (config.preparedDestinations?.has(preparedKey)) {
|
|
27
|
+
return {
|
|
28
|
+
target: config.target,
|
|
29
|
+
label: config.label,
|
|
30
|
+
status: "installed",
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (pathExists(config.destinationDir)) {
|
|
34
|
+
const shouldOverwrite = await shouldReplaceExisting(config);
|
|
35
|
+
if (!shouldOverwrite) {
|
|
36
|
+
return {
|
|
37
|
+
target: config.target,
|
|
38
|
+
label: config.label,
|
|
39
|
+
status: "skipped",
|
|
40
|
+
reason: `Destination already exists: ${config.destinationDir}`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
fs.rmSync(config.destinationDir, { recursive: true, force: true });
|
|
44
|
+
}
|
|
45
|
+
const spinner = ora(`Copying skill files for ${config.label}...`).start();
|
|
46
|
+
try {
|
|
47
|
+
fs.mkdirSync(path.dirname(config.destinationDir), { recursive: true });
|
|
48
|
+
fs.cpSync(config.sourceDir, config.destinationDir, {
|
|
49
|
+
recursive: true,
|
|
50
|
+
force: false,
|
|
51
|
+
errorOnExist: true,
|
|
52
|
+
});
|
|
53
|
+
config.preparedDestinations?.add(preparedKey);
|
|
54
|
+
spinner.succeed(`Skill files installed for ${config.label}`);
|
|
55
|
+
console.log(chalk.dim(` Destination: ${config.destinationDir}`));
|
|
56
|
+
return {
|
|
57
|
+
target: config.target,
|
|
58
|
+
label: config.label,
|
|
59
|
+
status: "installed",
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
spinner.fail(`Failed to copy skill files for ${config.label}`);
|
|
64
|
+
return {
|
|
65
|
+
target: config.target,
|
|
66
|
+
label: config.label,
|
|
67
|
+
status: "failed",
|
|
68
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export async function symlinkDirectoryWithOverwrite(config) {
|
|
73
|
+
const resolvedSource = path.resolve(config.sourceDir);
|
|
74
|
+
const resolvedDestination = path.resolve(config.destinationDir);
|
|
75
|
+
if (pathExists(resolvedDestination)) {
|
|
76
|
+
const existing = fs.lstatSync(resolvedDestination);
|
|
77
|
+
if (existing.isSymbolicLink()) {
|
|
78
|
+
const currentTarget = fs.readlinkSync(resolvedDestination);
|
|
79
|
+
const resolvedCurrentTarget = path.resolve(path.dirname(resolvedDestination), currentTarget);
|
|
80
|
+
if (resolvedCurrentTarget === resolvedSource) {
|
|
81
|
+
return {
|
|
82
|
+
target: config.target,
|
|
83
|
+
label: config.label,
|
|
84
|
+
status: "installed",
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const shouldOverwrite = await shouldReplaceExisting({
|
|
89
|
+
destinationDir: resolvedDestination,
|
|
90
|
+
force: config.force,
|
|
91
|
+
confirmOverwrite: config.confirmOverwrite,
|
|
92
|
+
});
|
|
93
|
+
if (!shouldOverwrite) {
|
|
94
|
+
return {
|
|
95
|
+
target: config.target,
|
|
96
|
+
label: config.label,
|
|
97
|
+
status: "skipped",
|
|
98
|
+
reason: `Destination already exists: ${resolvedDestination}`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
fs.rmSync(resolvedDestination, { recursive: true, force: true });
|
|
102
|
+
}
|
|
103
|
+
const spinner = ora(`Linking skill files for ${config.label}...`).start();
|
|
104
|
+
try {
|
|
105
|
+
fs.mkdirSync(path.dirname(resolvedDestination), { recursive: true });
|
|
106
|
+
const symlinkTarget = process.platform === "win32"
|
|
107
|
+
? resolvedSource
|
|
108
|
+
: path.relative(path.dirname(resolvedDestination), resolvedSource);
|
|
109
|
+
fs.symlinkSync(symlinkTarget, resolvedDestination, process.platform === "win32" ? "junction" : "dir");
|
|
110
|
+
spinner.succeed(`Skill files linked for ${config.label}`);
|
|
111
|
+
console.log(chalk.dim(` Destination: ${resolvedDestination}`));
|
|
112
|
+
console.log(chalk.dim(` Source: ${resolvedSource}`));
|
|
113
|
+
return {
|
|
114
|
+
target: config.target,
|
|
115
|
+
label: config.label,
|
|
116
|
+
status: "installed",
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
spinner.fail(`Failed to link skill files for ${config.label}`);
|
|
121
|
+
return {
|
|
122
|
+
target: config.target,
|
|
123
|
+
label: config.label,
|
|
124
|
+
status: "failed",
|
|
125
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=file-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-copy.js","sourceRoot":"","sources":["../../../../../src/commands/init/io/file-copy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AAGtB,SAAS,UAAU,CAAC,QAAgB;IAClC,IAAI,CAAC;QACH,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,KAAK,UAAU,qBAAqB,CAAC,MAIpC;IACC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;IACxE,OAAO,gBAAgB,CACrB,oCAAoC,MAAM,CAAC,cAAc,cAAc,CACxE,CAAC;AAC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OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAClD,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,0BAA0B,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,mBAAmB,EAAE,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,cAAc,EAAE,CAAC,CAAC,CAAC;QACtD,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,WAAW;SACpB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,kCAAkC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/D,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the bundled marketplace directory (contains marketplace.json + plugins).
|
|
3
|
+
*
|
|
4
|
+
* Expected layout:
|
|
5
|
+
* Built (npm): dist/src/commands/init/marketplace.js -> ../../../marketplace -> dist/marketplace/
|
|
6
|
+
* Dev (tsx): src/commands/init/marketplace.ts -> ../../../../../plugins
|
|
7
|
+
*/
|
|
8
|
+
export declare function getMarketplaceDir(): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the bundled marketplace directory (contains marketplace.json + plugins).
|
|
6
|
+
*
|
|
7
|
+
* Expected layout:
|
|
8
|
+
* Built (npm): dist/src/commands/init/marketplace.js -> ../../../marketplace -> dist/marketplace/
|
|
9
|
+
* Dev (tsx): src/commands/init/marketplace.ts -> ../../../../../plugins
|
|
10
|
+
*/
|
|
11
|
+
export function getMarketplaceDir() {
|
|
12
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const candidates = [
|
|
14
|
+
path.resolve(__dirname, "../../../marketplace"),
|
|
15
|
+
path.resolve(__dirname, "../../../../../plugins"),
|
|
16
|
+
];
|
|
17
|
+
for (const candidate of candidates) {
|
|
18
|
+
if (fs.existsSync(candidate) &&
|
|
19
|
+
fs.existsSync(path.join(candidate, ".claude-plugin/marketplace.json"))) {
|
|
20
|
+
return candidate;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
throw new Error(`Bundled marketplace directory not found. Searched: ${candidates.join(", ")}`);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=marketplace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../../../src/commands/init/marketplace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAE/D,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wBAAwB,CAAC;KAClD,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IACE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YACxB,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC,EACtE,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CACb,sDAAsD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC9E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import ora from "ora";
|
|
4
|
+
import { confirm } from "@inquirer/prompts";
|
|
5
|
+
import { api } from "../../convex/_generated/api.js";
|
|
6
|
+
import { createConvexClient } from "../../lib/config/index.js";
|
|
7
|
+
import { buildMcpUrl } from "../../lib/url.js";
|
|
8
|
+
import { InitError } from "./errors.js";
|
|
9
|
+
import { getInitDrivers } from "./targets/registry.js";
|
|
10
|
+
import { INIT_TARGETS } from "./types.js";
|
|
11
|
+
async function resolveProjectMcpUrl(config) {
|
|
12
|
+
const spinner = ora("Fetching project info...").start();
|
|
13
|
+
const client = createConvexClient({
|
|
14
|
+
url: config.convexUrl,
|
|
15
|
+
apiKey: config.apiKey,
|
|
16
|
+
});
|
|
17
|
+
let orgSlug;
|
|
18
|
+
let projectAlias;
|
|
19
|
+
try {
|
|
20
|
+
const projects = await client.query(api.projects.core.listAccessible, {});
|
|
21
|
+
const project = projects.find((item) => item._id === config.projectId);
|
|
22
|
+
if (!project) {
|
|
23
|
+
spinner.fail("Project not found");
|
|
24
|
+
throw new InitError(`Project ${config.projectId} not found or not accessible with this API key.`);
|
|
25
|
+
}
|
|
26
|
+
orgSlug = project.organizationSlug;
|
|
27
|
+
projectAlias = project.alias;
|
|
28
|
+
spinner.succeed(`Project: ${chalk.cyan(`${orgSlug}/${projectAlias}`)} (${project.name})`);
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
await client.close();
|
|
32
|
+
}
|
|
33
|
+
return buildMcpUrl(config.convexUrl, orgSlug, projectAlias);
|
|
34
|
+
}
|
|
35
|
+
export async function runInitMcp(config) {
|
|
36
|
+
const baseDir = path.resolve(config.outputDir ?? process.cwd());
|
|
37
|
+
const targets = config.cliTargets ?? INIT_TARGETS;
|
|
38
|
+
if (targets.length === 0) {
|
|
39
|
+
throw new InitError(`No MCP targets selected. Choose one of: ${INIT_TARGETS.join(", ")}`);
|
|
40
|
+
}
|
|
41
|
+
const mcpUrl = await resolveProjectMcpUrl({
|
|
42
|
+
convexUrl: config.convexUrl,
|
|
43
|
+
apiKey: config.apiKey,
|
|
44
|
+
projectId: config.projectId,
|
|
45
|
+
});
|
|
46
|
+
const drivers = getInitDrivers(targets);
|
|
47
|
+
const logger = {
|
|
48
|
+
info(message) {
|
|
49
|
+
console.log(message);
|
|
50
|
+
},
|
|
51
|
+
warn(message) {
|
|
52
|
+
console.warn(message);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
for (const driver of drivers) {
|
|
56
|
+
await driver.configureMcp({
|
|
57
|
+
baseDir,
|
|
58
|
+
mcpUrl,
|
|
59
|
+
apiKey: config.apiKey,
|
|
60
|
+
force: config.force,
|
|
61
|
+
confirmOverwrite: (message) => confirm({ message, default: true }),
|
|
62
|
+
log: logger,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=mcp-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-service.js","sourceRoot":"","sources":["../../../../src/commands/init/mcp-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,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AK;YACnB,gBAAgB,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC1E,GAAG,EAAE,MAAM;SACZ,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ClaudeMethod, type InitScope, type InitTarget } from "./types.js";
|
|
2
|
+
export declare function parseCliTargets(value: string | string[] | undefined): InitTarget[] | undefined;
|
|
3
|
+
export declare function parseScope(value: string | undefined): InitScope | undefined;
|
|
4
|
+
export declare function parseClaudeMethods(value: string | string[] | undefined): ClaudeMethod[] | undefined;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { InitError } from "./errors.js";
|
|
2
|
+
import { CLAUDE_METHODS, INIT_SCOPES, INIT_TARGETS, } from "./types.js";
|
|
3
|
+
export function parseCliTargets(value) {
|
|
4
|
+
if (value === undefined) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const normalized = (Array.isArray(value) ? value : [value])
|
|
8
|
+
.flatMap((entry) => entry.split(","))
|
|
9
|
+
.map((entry) => entry.trim())
|
|
10
|
+
.filter((entry) => entry.length > 0);
|
|
11
|
+
const invalidTargets = normalized.filter((entry) => !INIT_TARGETS.includes(entry));
|
|
12
|
+
if (invalidTargets.length > 0) {
|
|
13
|
+
throw new InitError(`Invalid --cli target(s): ${invalidTargets.join(", ")}. Must be one of: ${INIT_TARGETS.join(", ")}`);
|
|
14
|
+
}
|
|
15
|
+
return [...new Set(normalized)];
|
|
16
|
+
}
|
|
17
|
+
export function parseScope(value) {
|
|
18
|
+
if (value === undefined) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
if (!INIT_SCOPES.includes(value)) {
|
|
22
|
+
throw new InitError(`Invalid scope "${value}". Must be one of: ${INIT_SCOPES.join(", ")}`);
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
export function parseClaudeMethods(value) {
|
|
27
|
+
if (value === undefined) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const normalized = (Array.isArray(value) ? value : [value])
|
|
31
|
+
.flatMap((entry) => entry.split(","))
|
|
32
|
+
.map((entry) => entry.trim())
|
|
33
|
+
.filter((entry) => entry.length > 0);
|
|
34
|
+
const invalidMethods = normalized.filter((entry) => !CLAUDE_METHODS.includes(entry));
|
|
35
|
+
if (invalidMethods.length > 0) {
|
|
36
|
+
throw new InitError(`Invalid --claude-method value(s): ${invalidMethods.join(", ")}. Must be one of: ${CLAUDE_METHODS.join(", ")}`);
|
|
37
|
+
}
|
|
38
|
+
return [...new Set(normalized)];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=parsers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../../../src/commands/init/parsers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,cAAc,EAEd,WAAW,EAEX,YAAY,GAEb,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,eAAe,CAC7B,KAAoC;IAEpC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SACxD,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;I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C,MAAM,GAAG,CAAC,CAAC,CAAC;IAEvC,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CACtC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAqB,CAAC,CAC3D,CAAC;IACF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CACjB,qCAAqC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC/G,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAmB,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ClaudeMethod, type InitScope, type InitTarget } from "./types.js";
|
|
2
|
+
export declare function resolveSkillTargets(targets: InitTarget[] | undefined): Promise<InitTarget[]>;
|
|
3
|
+
export declare function resolveScope(scope: InitScope | undefined): Promise<InitScope>;
|
|
4
|
+
export declare function resolveClaudeMethods(methods: ClaudeMethod[] | undefined): Promise<ClaudeMethod[]>;
|