@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 @@
|
|
|
1
|
+
{"version":3,"file":"convex-client.js","sourceRoot":"","sources":["../../../../src/lib/config/convex-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAY9C;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA4B;IAC7D,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE7C,OAAO;QACL;;WAEG;QACH,MAAM;QAEN;;WAEG;QACH,KAAK,CAAC,KAAK,CACT,KAAY,EACZ,IAA+D;YAE/D,MAAM,cAAc,GAAG;gBACrB,GAAG,IAAI;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM;aACf,CAAC;YACzB,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QAC7C,CAAC;QAED;;WAEG;QACH,KAAK,CAAC,QAAQ,CACZ,QAAkB,EAClB,IAAkE;YAElE,MAAM,cAAc,GAAG;gBACrB,GAAG,IAAI;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM;aACZ,CAAC;YAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QACnD,CAAC;QAED;;WAEG;QACH,SAAS,CACP,KAAY,EACZ,IAA+D,EAC/D,SAGC;YAED,MAAM,cAAc,GAAG;gBACrB,GAAG,IAAI;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM;aACf,CAAC;YAEzB,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CACjC,KAAK,EACL,cAAc,EACd,CAAC,KAAgC,EAAE,EAAE;gBACnC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,CACF,CAAC;YAEF,OAAO,WAAW,CAAC;QACrB,CAAC;QAED;;WAEG;QACH,KAAK,CAAC,KAAK;YACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { ResolvedConfig, RequiredConfig, CliOverrides, Profile, Settings, ConfigFile, ProviderKey, } from "./types.js";
|
|
2
|
+
export { ProfileSchema, SettingsSchema, ConfigFileSchema, ProviderKeySchema, } from "./types.js";
|
|
3
|
+
export { getConfigPath, configExists, readConfig, writeConfig, getProfileByKey, setProfile as setProfileInConfig, deleteProfileByKey, listAllProfiles, getDefaultProfileKey, setDefaultProfile, addPathToProfile, removePathFromProfile, listProviderKeys, getProviderKey, setProviderKey, deleteProviderKey, setProfileProviderKey, } from "./toml.js";
|
|
4
|
+
export { resolveProfileProviderKey, resolveProviderKeyByName, buildProviderKeyEnv, applyProviderKeyEnv, buildProviderSettingsJson, providerRequiresToken, CLAUDE_PROVIDER_ENV_VAR, PROVIDER_LABELS, type ResolvedProviderKey, } from "./provider-keys.js";
|
|
5
|
+
export { resolveProfile, resolveConfigFromProfile, resolveConfigFromProfileCommand, hasProfiles, getAllProfiles, type ProfileResolution, } from "./profile.js";
|
|
6
|
+
export { ConfigError, requireCredentials, requireProject, handleConfigError, withConfigError, } from "./validate.js";
|
|
7
|
+
export { createConvexClient, type ConvexClientOptions, type OpenSanaClient, } from "./convex-client.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Re-export all config-related functionality
|
|
2
|
+
export { ProfileSchema, SettingsSchema, ConfigFileSchema, ProviderKeySchema, } from "./types.js";
|
|
3
|
+
// TOML config (unified config at ~/.config/opensana/config.toml)
|
|
4
|
+
export { getConfigPath, configExists, readConfig, writeConfig, getProfileByKey, setProfile as setProfileInConfig, deleteProfileByKey, listAllProfiles, getDefaultProfileKey, setDefaultProfile, addPathToProfile, removePathFromProfile, listProviderKeys, getProviderKey, setProviderKey, deleteProviderKey, setProfileProviderKey, } from "./toml.js";
|
|
5
|
+
// Provider keys (per-profile Bedrock/Mantle credential or pinned claude.ai)
|
|
6
|
+
export { resolveProfileProviderKey, resolveProviderKeyByName, buildProviderKeyEnv, applyProviderKeyEnv, buildProviderSettingsJson, providerRequiresToken, CLAUDE_PROVIDER_ENV_VAR, PROVIDER_LABELS, } from "./provider-keys.js";
|
|
7
|
+
// Profile resolution
|
|
8
|
+
export { resolveProfile, resolveConfigFromProfile, resolveConfigFromProfileCommand, hasProfiles, getAllProfiles, } from "./profile.js";
|
|
9
|
+
// Validation
|
|
10
|
+
export { ConfigError, requireCredentials, requireProject, handleConfigError, withConfigError, } from "./validate.js";
|
|
11
|
+
// Convex client
|
|
12
|
+
export { createConvexClient, } from "./convex-client.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/config/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAa7C,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,iEAAiE;AACjE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,IAAI,kBAAkB,EAChC,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AAEnB,4EAA4E;AAC5E,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,GAEhB,MAAM,oBAAoB,CAAC;AAE5B,qBAAqB;AACrB,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,+BAA+B,EAC/B,WAAW,EACX,cAAc,GAEf,MAAM,cAAc,CAAC;AAEtB,aAAa;AACb,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,gBAAgB;AAChB,OAAO,EACL,kBAAkB,GAGnB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { Profile, ResolvedConfig, CliOverrides } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Result of profile resolution
|
|
5
|
+
*/
|
|
6
|
+
export interface ProfileResolution {
|
|
7
|
+
/** The resolved profile, if found */
|
|
8
|
+
profile: Profile | undefined;
|
|
9
|
+
/** The key of the resolved profile */
|
|
10
|
+
key: string | undefined;
|
|
11
|
+
/** How the profile was resolved */
|
|
12
|
+
source: "cli-flag" | "env" | "path-match" | "default" | "none";
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a profile, in priority order: `--profile` flag, `OPENSANA_PROFILE`, a
|
|
16
|
+
* `profile.paths` entry matching (or an ancestor of) cwd, `settings.default_profile`, then
|
|
17
|
+
* no match.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveProfile(cwd?: string, overrides?: CliOverrides): ProfileResolution;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve full config from profile + overrides + env
|
|
22
|
+
* This merges profile data with any CLI/env overrides
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveConfigFromProfile(cwd?: string, overrides?: CliOverrides): ResolvedConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve config using global CLI options from Commander
|
|
27
|
+
* Use in command actions: resolveConfigFromCommand(cmd)
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveConfigFromProfileCommand(cmd: Command, cwd?: string): ResolvedConfig;
|
|
30
|
+
/**
|
|
31
|
+
* Check if any profiles exist
|
|
32
|
+
*/
|
|
33
|
+
export declare function hasProfiles(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Get all profiles for display/selection
|
|
36
|
+
*/
|
|
37
|
+
export declare function getAllProfiles(): Array<{
|
|
38
|
+
key: string;
|
|
39
|
+
profile: Profile;
|
|
40
|
+
}>;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import { ENV_PROFILE, ENV_URL, ENV_API_KEY } from "../constants.js";
|
|
3
|
+
import { readConfig, getProfileByKey, getDefaultProfileKey, listAllProfiles, } from "./toml.js";
|
|
4
|
+
/**
|
|
5
|
+
* Check if a path is equal to or a subdirectory of another path
|
|
6
|
+
*/
|
|
7
|
+
function isPathMatch(targetPath, profilePath) {
|
|
8
|
+
const normalizedTarget = path.resolve(targetPath);
|
|
9
|
+
const normalizedProfile = path.resolve(profilePath);
|
|
10
|
+
// Exact match
|
|
11
|
+
if (normalizedTarget === normalizedProfile) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
// Check if target is a subdirectory of profile path
|
|
15
|
+
const relative = path.relative(normalizedProfile, normalizedTarget);
|
|
16
|
+
return (relative !== "" &&
|
|
17
|
+
!relative.startsWith("..") &&
|
|
18
|
+
!path.isAbsolute(relative));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Find a profile that matches the given path.
|
|
22
|
+
* Iterates all paths in every profile, returning the most specific (longest) match.
|
|
23
|
+
*/
|
|
24
|
+
function findProfileByPath(targetPath) {
|
|
25
|
+
const profiles = listAllProfiles();
|
|
26
|
+
let bestMatch;
|
|
27
|
+
let longestPath = 0;
|
|
28
|
+
for (const { key, profile } of profiles) {
|
|
29
|
+
for (const profilePath of profile.paths) {
|
|
30
|
+
if (isPathMatch(targetPath, profilePath)) {
|
|
31
|
+
const pathLength = path.resolve(profilePath).length;
|
|
32
|
+
if (pathLength > longestPath) {
|
|
33
|
+
longestPath = pathLength;
|
|
34
|
+
bestMatch = { key, profile };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return bestMatch;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a profile, in priority order: `--profile` flag, `OPENSANA_PROFILE`, a
|
|
43
|
+
* `profile.paths` entry matching (or an ancestor of) cwd, `settings.default_profile`, then
|
|
44
|
+
* no match.
|
|
45
|
+
*/
|
|
46
|
+
export function resolveProfile(cwd, overrides) {
|
|
47
|
+
const targetPath = cwd || process.cwd();
|
|
48
|
+
// 1. CLI flag
|
|
49
|
+
if (overrides?.profile) {
|
|
50
|
+
const profile = getProfileByKey(overrides.profile);
|
|
51
|
+
return {
|
|
52
|
+
profile,
|
|
53
|
+
key: overrides.profile,
|
|
54
|
+
source: "cli-flag",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// 2. Environment variable
|
|
58
|
+
const envProfile = process.env[ENV_PROFILE];
|
|
59
|
+
if (envProfile) {
|
|
60
|
+
const profile = getProfileByKey(envProfile);
|
|
61
|
+
return {
|
|
62
|
+
profile,
|
|
63
|
+
key: envProfile,
|
|
64
|
+
source: "env",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// 3. Path match
|
|
68
|
+
const pathMatch = findProfileByPath(targetPath);
|
|
69
|
+
if (pathMatch) {
|
|
70
|
+
return {
|
|
71
|
+
profile: pathMatch.profile,
|
|
72
|
+
key: pathMatch.key,
|
|
73
|
+
source: "path-match",
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// 4. Default profile
|
|
77
|
+
const defaultKey = getDefaultProfileKey();
|
|
78
|
+
if (defaultKey) {
|
|
79
|
+
const profile = getProfileByKey(defaultKey);
|
|
80
|
+
if (profile) {
|
|
81
|
+
return {
|
|
82
|
+
profile,
|
|
83
|
+
key: defaultKey,
|
|
84
|
+
source: "default",
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// 5. No match
|
|
89
|
+
return {
|
|
90
|
+
profile: undefined,
|
|
91
|
+
key: undefined,
|
|
92
|
+
source: "none",
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolve full config from profile + overrides + env
|
|
97
|
+
* This merges profile data with any CLI/env overrides
|
|
98
|
+
*/
|
|
99
|
+
export function resolveConfigFromProfile(cwd, overrides) {
|
|
100
|
+
const resolution = resolveProfile(cwd, overrides);
|
|
101
|
+
// Start with profile values
|
|
102
|
+
let convexUrl = resolution.profile?.url;
|
|
103
|
+
let apiKey = resolution.profile?.api_key;
|
|
104
|
+
let projectId = resolution.profile?.project_id;
|
|
105
|
+
// Apply environment variable overrides
|
|
106
|
+
if (process.env[ENV_URL]) {
|
|
107
|
+
convexUrl = process.env[ENV_URL];
|
|
108
|
+
}
|
|
109
|
+
if (process.env[ENV_API_KEY]) {
|
|
110
|
+
apiKey = process.env[ENV_API_KEY];
|
|
111
|
+
}
|
|
112
|
+
// Apply CLI overrides (highest priority)
|
|
113
|
+
if (overrides?.url) {
|
|
114
|
+
convexUrl = overrides.url;
|
|
115
|
+
}
|
|
116
|
+
if (overrides?.apiKey) {
|
|
117
|
+
apiKey = overrides.apiKey;
|
|
118
|
+
}
|
|
119
|
+
if (overrides?.projectId) {
|
|
120
|
+
projectId = overrides.projectId;
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
convexUrl,
|
|
124
|
+
apiKey,
|
|
125
|
+
projectId,
|
|
126
|
+
profile: resolution.key,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Resolve config using global CLI options from Commander
|
|
131
|
+
* Use in command actions: resolveConfigFromCommand(cmd)
|
|
132
|
+
*/
|
|
133
|
+
export function resolveConfigFromProfileCommand(cmd, cwd) {
|
|
134
|
+
const opts = cmd.optsWithGlobals();
|
|
135
|
+
return resolveConfigFromProfile(cwd, {
|
|
136
|
+
url: opts.url,
|
|
137
|
+
apiKey: opts.apiKey,
|
|
138
|
+
profile: opts.profile,
|
|
139
|
+
projectId: opts.project,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Check if any profiles exist
|
|
144
|
+
*/
|
|
145
|
+
export function hasProfiles() {
|
|
146
|
+
const config = readConfig();
|
|
147
|
+
return Object.keys(config.profiles).length > 0;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Get all profiles for display/selection
|
|
151
|
+
*/
|
|
152
|
+
export function getAllProfiles() {
|
|
153
|
+
return listAllProfiles();
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../../src/lib/config/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EACL,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,WAAW,CAAC;AAmBnB;;GAEG;AACH,SAAS,WAAW,CAAC,UAAkB,EAAE,WAAmB;IAC1D,MAAM,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AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,eAAe,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Profile, ProviderKey } from "./types.js";
|
|
2
|
+
export interface ResolvedProviderKey {
|
|
3
|
+
name: string;
|
|
4
|
+
key: ProviderKey;
|
|
5
|
+
}
|
|
6
|
+
export declare const PROVIDER_LABELS: Record<ProviderKey["provider"], string>;
|
|
7
|
+
/** Providers that carry a credential; `anthropic` uses the machine's sign-in. */
|
|
8
|
+
export declare function providerRequiresToken(provider: ProviderKey["provider"]): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the profile's assigned provider key. Throws when the profile
|
|
11
|
+
* references a key that no longer exists — connecting silently on the
|
|
12
|
+
* machine's default Claude config would be a misconfiguration.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveProfileProviderKey(profile: Profile): ResolvedProviderKey | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Resolve a provider key by explicit name (the `--provider-key` connect
|
|
17
|
+
* override). Throws when the key does not exist in config.toml.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveProviderKeyByName(name: string): ResolvedProviderKey;
|
|
20
|
+
/**
|
|
21
|
+
* Environment the CLI process (and every spawned agent) gets when a provider key is
|
|
22
|
+
* assigned. Mirrors a manual Claude Code Bedrock/Mantle setup; explicit "0"/"1" flags so
|
|
23
|
+
* machine-level config cannot bleed in.
|
|
24
|
+
*
|
|
25
|
+
* `anthropic` emits only the "0" flags: they travel through `--settings`, which outranks
|
|
26
|
+
* `~/.claude/settings.json`, so the run lands on the machine's Claude sign-in even where
|
|
27
|
+
* Bedrock is enabled globally. A lingering AWS_BEARER_TOKEN_BEDROCK needs no unsetting —
|
|
28
|
+
* Claude Code ignores it while the flags are off.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildProviderKeyEnv(key: ProviderKey): Record<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* Marker env var carrying the provider env as JSON from `convoy connect`
|
|
33
|
+
* to the Claude Code runner, which re-sends it via the `--settings` CLI
|
|
34
|
+
* layer (see buildProviderSettingsJson).
|
|
35
|
+
*/
|
|
36
|
+
export declare const CLAUDE_PROVIDER_ENV_VAR = "OPENSANA_CLAUDE_PROVIDER_ENV";
|
|
37
|
+
export declare function applyProviderKeyEnv(env: Record<string, string>): void;
|
|
38
|
+
/**
|
|
39
|
+
* Claude Code applies `env` from ~/.claude/settings.json ON TOP of its process
|
|
40
|
+
* environment, so inherited vars alone lose to machine settings. Command-line
|
|
41
|
+
* `--settings` outranks user settings, so the runner re-sends the provider env through
|
|
42
|
+
* that layer; the user's file is never modified. Undefined when the marker is absent or
|
|
43
|
+
* malformed.
|
|
44
|
+
*/
|
|
45
|
+
export declare function buildProviderSettingsJson(markerValue: string | undefined): string | undefined;
|
|
46
|
+
/** Parse the marker value back into the injected provider env. */
|
|
47
|
+
export declare function parseProviderKeyEnv(markerValue: string | undefined): Record<string, string> | undefined;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { getProviderKey } from "./toml.js";
|
|
2
|
+
export const PROVIDER_LABELS = {
|
|
3
|
+
bedrock: "AWS Bedrock",
|
|
4
|
+
mantle: "AWS Bedrock (Mantle)",
|
|
5
|
+
anthropic: "Claude.ai subscription",
|
|
6
|
+
};
|
|
7
|
+
/** Providers that carry a credential; `anthropic` uses the machine's sign-in. */
|
|
8
|
+
export function providerRequiresToken(provider) {
|
|
9
|
+
return provider !== "anthropic";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the profile's assigned provider key. Throws when the profile
|
|
13
|
+
* references a key that no longer exists — connecting silently on the
|
|
14
|
+
* machine's default Claude config would be a misconfiguration.
|
|
15
|
+
*/
|
|
16
|
+
export function resolveProfileProviderKey(profile) {
|
|
17
|
+
if (!profile.provider_key) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const key = getProviderKey(profile.provider_key);
|
|
21
|
+
if (!key) {
|
|
22
|
+
throw new Error(`Profile references provider key "${profile.provider_key}" which is not defined in config.toml. Run 'convoy keys list' or 'convoy keys unassign'.`);
|
|
23
|
+
}
|
|
24
|
+
return { name: profile.provider_key, key };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolve a provider key by explicit name (the `--provider-key` connect
|
|
28
|
+
* override). Throws when the key does not exist in config.toml.
|
|
29
|
+
*/
|
|
30
|
+
export function resolveProviderKeyByName(name) {
|
|
31
|
+
const key = getProviderKey(name);
|
|
32
|
+
if (!key) {
|
|
33
|
+
throw new Error(`Provider key "${name}" is not defined in config.toml. Run 'convoy keys list' to see available keys.`);
|
|
34
|
+
}
|
|
35
|
+
return { name, key };
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Environment the CLI process (and every spawned agent) gets when a provider key is
|
|
39
|
+
* assigned. Mirrors a manual Claude Code Bedrock/Mantle setup; explicit "0"/"1" flags so
|
|
40
|
+
* machine-level config cannot bleed in.
|
|
41
|
+
*
|
|
42
|
+
* `anthropic` emits only the "0" flags: they travel through `--settings`, which outranks
|
|
43
|
+
* `~/.claude/settings.json`, so the run lands on the machine's Claude sign-in even where
|
|
44
|
+
* Bedrock is enabled globally. A lingering AWS_BEARER_TOKEN_BEDROCK needs no unsetting —
|
|
45
|
+
* Claude Code ignores it while the flags are off.
|
|
46
|
+
*/
|
|
47
|
+
export function buildProviderKeyEnv(key) {
|
|
48
|
+
if (key.provider === "anthropic") {
|
|
49
|
+
return { CLAUDE_CODE_USE_BEDROCK: "0", CLAUDE_CODE_USE_MANTLE: "0" };
|
|
50
|
+
}
|
|
51
|
+
const env = {
|
|
52
|
+
CLAUDE_CODE_USE_BEDROCK: "1",
|
|
53
|
+
CLAUDE_CODE_USE_MANTLE: key.provider === "mantle" ? "1" : "0",
|
|
54
|
+
...(key.token ? { AWS_BEARER_TOKEN_BEDROCK: key.token } : {}),
|
|
55
|
+
};
|
|
56
|
+
if (key.region) {
|
|
57
|
+
env.AWS_REGION = key.region;
|
|
58
|
+
}
|
|
59
|
+
return env;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Marker env var carrying the provider env as JSON from `convoy connect`
|
|
63
|
+
* to the Claude Code runner, which re-sends it via the `--settings` CLI
|
|
64
|
+
* layer (see buildProviderSettingsJson).
|
|
65
|
+
*/
|
|
66
|
+
export const CLAUDE_PROVIDER_ENV_VAR = "OPENSANA_CLAUDE_PROVIDER_ENV";
|
|
67
|
+
export function applyProviderKeyEnv(env) {
|
|
68
|
+
Object.assign(process.env, env, {
|
|
69
|
+
[CLAUDE_PROVIDER_ENV_VAR]: JSON.stringify(env),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Claude Code applies `env` from ~/.claude/settings.json ON TOP of its process
|
|
74
|
+
* environment, so inherited vars alone lose to machine settings. Command-line
|
|
75
|
+
* `--settings` outranks user settings, so the runner re-sends the provider env through
|
|
76
|
+
* that layer; the user's file is never modified. Undefined when the marker is absent or
|
|
77
|
+
* malformed.
|
|
78
|
+
*/
|
|
79
|
+
export function buildProviderSettingsJson(markerValue) {
|
|
80
|
+
const env = parseProviderKeyEnv(markerValue);
|
|
81
|
+
return env ? JSON.stringify({ env }) : undefined;
|
|
82
|
+
}
|
|
83
|
+
/** Parse the marker value back into the injected provider env. */
|
|
84
|
+
export function parseProviderKeyEnv(markerValue) {
|
|
85
|
+
if (!markerValue) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const parsed = JSON.parse(markerValue);
|
|
90
|
+
const env = Object.fromEntries(Object.entries(parsed).filter((entry) => typeof entry[1] === "string"));
|
|
91
|
+
return Object.keys(env).length > 0 ? env : undefined;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=provider-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-keys.js","sourceRoot":"","sources":["../../../../src/lib/config/provider-keys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAO3C,MAAM,CAAC,MAAM,eAAe,GAA4C;IACtE,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,sBAAsB;IAC9B,SAAS,EAAE,wBAAwB;CACpC,CAAC;AAEF,iFAAiF;AACjF,MAAM,UAAU,qBAAqB,CAAC,QAAiC;IACrE,OAAO,QAAQ,KAAK,WAAW,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAgB;IAEhB,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACjD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,oCAAoC,OAAO,CAAC,YAAY,0FAA0F,CACnJ,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,iBAAiB,IAAI,gFAAgF,CACtG,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AACvB,CAAC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,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAA4B,CAAC;QAClE,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAC3B,CAAC,KAAK,EAA6B,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CACnE,CACF,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type ConfigFile, type Profile, type ProviderKey } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get the path to the config file
|
|
4
|
+
*/
|
|
5
|
+
export declare function getConfigPath(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Check if config file exists
|
|
8
|
+
*/
|
|
9
|
+
export declare function configExists(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Read the config file
|
|
12
|
+
* Returns empty config if file doesn't exist
|
|
13
|
+
*/
|
|
14
|
+
export declare function readConfig(): ConfigFile;
|
|
15
|
+
/**
|
|
16
|
+
* Write the config file
|
|
17
|
+
*/
|
|
18
|
+
export declare function writeConfig(config: ConfigFile): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get a profile by key
|
|
21
|
+
*/
|
|
22
|
+
export declare function getProfileByKey(key: string): Profile | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Set a profile by key
|
|
25
|
+
*/
|
|
26
|
+
export declare function setProfile(key: string, profile: Profile): void;
|
|
27
|
+
/**
|
|
28
|
+
* Delete a profile by key
|
|
29
|
+
*/
|
|
30
|
+
export declare function deleteProfileByKey(key: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* List all profiles
|
|
33
|
+
*/
|
|
34
|
+
export declare function listAllProfiles(): Array<{
|
|
35
|
+
key: string;
|
|
36
|
+
profile: Profile;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Add a path to an existing profile.
|
|
40
|
+
* No-op if the path is already present.
|
|
41
|
+
*/
|
|
42
|
+
export declare function addPathToProfile(key: string, newPath: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Remove a path from an existing profile.
|
|
45
|
+
* Throws if it's the last path (min 1 required).
|
|
46
|
+
*/
|
|
47
|
+
export declare function removePathFromProfile(key: string, targetPath: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* List all stored provider keys
|
|
50
|
+
*/
|
|
51
|
+
export declare function listProviderKeys(): Array<{
|
|
52
|
+
name: string;
|
|
53
|
+
key: ProviderKey;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Get a provider key by name
|
|
57
|
+
*/
|
|
58
|
+
export declare function getProviderKey(name: string): ProviderKey | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Create or overwrite a provider key
|
|
61
|
+
*/
|
|
62
|
+
export declare function setProviderKey(name: string, key: ProviderKey): void;
|
|
63
|
+
/**
|
|
64
|
+
* Delete a provider key. Throws if any profile still references it.
|
|
65
|
+
*/
|
|
66
|
+
export declare function deleteProviderKey(name: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Assign a provider key to a profile (or clear with undefined).
|
|
69
|
+
*/
|
|
70
|
+
export declare function setProfileProviderKey(profileKey: string, keyName: string | undefined): void;
|
|
71
|
+
/**
|
|
72
|
+
* Get the default profile name from settings
|
|
73
|
+
*/
|
|
74
|
+
export declare function getDefaultProfileKey(): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Set the default profile in settings
|
|
77
|
+
*/
|
|
78
|
+
export declare function setDefaultProfile(key: string): void;
|