@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":"constants.js","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wCAAwC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAElD,uBAAuB;AACvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE9C,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAEhF,sCAAsC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC;AAEtC,iCAAiC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAE9C,+BAA+B;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getContentType(filePath: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
/** Shared by task attachments and thread-message attachments. */
|
|
3
|
+
const CONTENT_TYPES_BY_EXTENSION = {
|
|
4
|
+
".avif": "image/avif",
|
|
5
|
+
".css": "text/css",
|
|
6
|
+
".csv": "text/csv",
|
|
7
|
+
".gif": "image/gif",
|
|
8
|
+
".htm": "text/html",
|
|
9
|
+
".html": "text/html",
|
|
10
|
+
".jpeg": "image/jpeg",
|
|
11
|
+
".jpg": "image/jpeg",
|
|
12
|
+
".js": "text/javascript",
|
|
13
|
+
".json": "application/json",
|
|
14
|
+
".md": "text/markdown",
|
|
15
|
+
".pdf": "application/pdf",
|
|
16
|
+
".png": "image/png",
|
|
17
|
+
".svg": "image/svg+xml",
|
|
18
|
+
".txt": "text/plain",
|
|
19
|
+
".webp": "image/webp",
|
|
20
|
+
".xml": "application/xml",
|
|
21
|
+
".zip": "application/zip",
|
|
22
|
+
};
|
|
23
|
+
export function getContentType(filePath) {
|
|
24
|
+
const extension = path.extname(filePath).toLowerCase();
|
|
25
|
+
return CONTENT_TYPES_BY_EXTENSION[extension] ?? "application/octet-stream";
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=content-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-type.js","sourceRoot":"","sources":["../../../src/lib/content-type.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,iEAAiE;AACjE,MAAM,0BAA0B,GAA2B;IACzD,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;CAC1B,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IACvD,OAAO,0BAA0B,CAAC,SAAS,CAAC,IAAI,0BAA0B,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A caught error's user-facing message, with Convex's transport noise removed.
|
|
3
|
+
*
|
|
4
|
+
* A failed query rejects with the `[CONVEX Q(path)] ... Called by client`
|
|
5
|
+
* stacktrace in `message`; a `ConvexError`'s clean text is in `data`. Mirrors
|
|
6
|
+
* `getErrorMessage` in `apps/web/lib/errors.ts` — this package cannot import it.
|
|
7
|
+
*
|
|
8
|
+
* `cursor` is the caller's `--cursor`, if any. Convex raises an undeserializable
|
|
9
|
+
* cursor as a plain `Error` from inside `.paginate()`, whose text production
|
|
10
|
+
* redacts, so the cursor is named as the likely cause rather than matched on.
|
|
11
|
+
*/
|
|
12
|
+
export declare function toUserFacingError(error: unknown, cursor?: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ConvexError } from "convex/values";
|
|
2
|
+
/**
|
|
3
|
+
* The Convex client's own transport frame, prepended to every server-side
|
|
4
|
+
* failure. Stable across deployments, unlike the message it wraps: production
|
|
5
|
+
* redacts a plain `Error`'s text to "Server Error".
|
|
6
|
+
*/
|
|
7
|
+
const TRANSPORT_FRAME = "[CONVEX ";
|
|
8
|
+
/**
|
|
9
|
+
* A caught error's user-facing message, with Convex's transport noise removed.
|
|
10
|
+
*
|
|
11
|
+
* A failed query rejects with the `[CONVEX Q(path)] ... Called by client`
|
|
12
|
+
* stacktrace in `message`; a `ConvexError`'s clean text is in `data`. Mirrors
|
|
13
|
+
* `getErrorMessage` in `apps/web/lib/errors.ts` — this package cannot import it.
|
|
14
|
+
*
|
|
15
|
+
* `cursor` is the caller's `--cursor`, if any. Convex raises an undeserializable
|
|
16
|
+
* cursor as a plain `Error` from inside `.paginate()`, whose text production
|
|
17
|
+
* redacts, so the cursor is named as the likely cause rather than matched on.
|
|
18
|
+
*/
|
|
19
|
+
export function toUserFacingError(error, cursor) {
|
|
20
|
+
if (error instanceof ConvexError) {
|
|
21
|
+
return typeof error.data === "string" ? error.data : error.message;
|
|
22
|
+
}
|
|
23
|
+
if (!(error instanceof Error)) {
|
|
24
|
+
return String(error);
|
|
25
|
+
}
|
|
26
|
+
// Only a server-side failure carries the frame; anything we threw ourselves
|
|
27
|
+
// (a missing thread, a bad --limit) already reads correctly.
|
|
28
|
+
if (cursor !== undefined && error.message.includes(TRANSPORT_FRAME)) {
|
|
29
|
+
return `${error.message}\nThis often means --cursor is no longer valid. Re-run without --cursor to start from the first page.`;
|
|
30
|
+
}
|
|
31
|
+
return error.message;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=convex-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex-error.js","sourceRoot":"","sources":["../../../src/lib/convex-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,MAAM,eAAe,GAAG,UAAU,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc,EAAE,MAAe;IAC/D,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QACjC,OAAO,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;IACrE,CAAC;IAED,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,4EAA4E;IAC5E,6DAA6D;IAC7D,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACpE,OAAO,GAAG,KAAK,CAAC,OAAO,uGAAuG,CAAC;IACjI,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden-ref git checkpoints around a batch run (OS-1142).
|
|
3
|
+
*
|
|
4
|
+
* A checkpoint is a commit built from a temporary index (GIT_INDEX_FILE), so the user's
|
|
5
|
+
* real index, HEAD and branches are never touched. Refs under
|
|
6
|
+
* refs/opensana/checkpoints/ keep the objects reachable across gc; old refs are pruned
|
|
7
|
+
* per thread.
|
|
8
|
+
*/
|
|
9
|
+
export interface RunDiffFile {
|
|
10
|
+
path: string;
|
|
11
|
+
kind: "added" | "modified" | "deleted";
|
|
12
|
+
additions: number;
|
|
13
|
+
deletions: number;
|
|
14
|
+
binary?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface RunDiffSummary {
|
|
17
|
+
preRef: string;
|
|
18
|
+
postRef: string;
|
|
19
|
+
files: RunDiffFile[];
|
|
20
|
+
truncated?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const MAX_DIFF_FILES = 200;
|
|
23
|
+
export declare function checkpointRef(threadId: string, batchId: string, phase: "pre" | "post"): string;
|
|
24
|
+
/**
|
|
25
|
+
* Snapshot the working tree (tracked + untracked-but-not-ignored files) into
|
|
26
|
+
* a commit stored at `ref`. Idempotent: an existing ref is left untouched.
|
|
27
|
+
*/
|
|
28
|
+
export declare function captureCheckpoint(cwd: string, ref: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Capture the pre-run baseline for a batch. Returns false when the working
|
|
31
|
+
* directory is not a git repo (post-run capture should then be skipped too).
|
|
32
|
+
*/
|
|
33
|
+
export declare function capturePreRunCheckpoint(cwd: string, threadId: string, batchId: string): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Capture the post-run checkpoint and diff it against the batch baseline.
|
|
36
|
+
* Returns null when nothing changed. Also prunes old checkpoint refs for the
|
|
37
|
+
* thread as a side effect.
|
|
38
|
+
*/
|
|
39
|
+
export declare function captureRunDiffSummary(cwd: string, threadId: string, batchId: string): Promise<RunDiffSummary | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Join `git diff --numstat -z` (line counts) with `--name-status -z` (change
|
|
42
|
+
* kind) into per-file entries. Exported for tests.
|
|
43
|
+
*/
|
|
44
|
+
export declare function parseDiffSummary(numstatOutput: string, nameStatusOutput: string): RunDiffFile[];
|
|
45
|
+
export declare const MAX_FILE_OP_CHARS = 700000;
|
|
46
|
+
export interface FileAtRef {
|
|
47
|
+
content: string;
|
|
48
|
+
truncated: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface FileDiff {
|
|
51
|
+
patch: string;
|
|
52
|
+
truncated: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Read one file's content at a checkpoint ref (`git show ref:path`). Throws
|
|
56
|
+
* with a user-facing message for missing blobs (pruned ref / deleted file),
|
|
57
|
+
* binary content, or oversized files.
|
|
58
|
+
*/
|
|
59
|
+
export declare function readFileAtRef(cwd: string, ref: string, filePath: string): Promise<FileAtRef>;
|
|
60
|
+
/**
|
|
61
|
+
* Unified patch between the pre and post checkpoint refs — for one file when
|
|
62
|
+
* `filePath` is given, otherwise for the whole run.
|
|
63
|
+
*/
|
|
64
|
+
export declare function diffBetweenRefs(cwd: string, preRef: string, postRef: string, filePath?: string): Promise<FileDiff>;
|
|
65
|
+
/**
|
|
66
|
+
* Restore the working tree (tracked + untracked files) to a checkpoint
|
|
67
|
+
* (OS-1151). Discards everything that happened after the checkpoint,
|
|
68
|
+
* including the user's own uncommitted edits; HEAD and the index end up
|
|
69
|
+
* unchanged/unstaged. t3code's revert recipe. With `filePath` (OS-1156) only
|
|
70
|
+
* that one path is restored — or deleted, when the run created it.
|
|
71
|
+
*/
|
|
72
|
+
export declare function revertToCheckpoint(cwd: string, ref: string, filePath?: string): Promise<void>;
|
|
73
|
+
/** Keep the newest checkpoint refs for a thread, delete the rest. */
|
|
74
|
+
export declare function pruneCheckpointRefs(cwd: string, threadId: string): Promise<void>;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { runGit } from "./exec.js";
|
|
5
|
+
export const MAX_DIFF_FILES = 200;
|
|
6
|
+
// Refs per thread to retain (2 per batch). Older checkpoints become
|
|
7
|
+
// unreachable and are eventually gc'd with their objects.
|
|
8
|
+
const MAX_REFS_PER_THREAD = 40;
|
|
9
|
+
const CAPTURE_TIMEOUT_MS = 120_000;
|
|
10
|
+
// Snapshot commits need an ident even in repos without user.name/email.
|
|
11
|
+
const IDENT_ARGS = ["-c", "user.name=opensana", "-c", "user.email=cli@opensana.dev"];
|
|
12
|
+
export function checkpointRef(threadId, batchId, phase) {
|
|
13
|
+
return `refs/opensana/checkpoints/${threadId}/${batchId}/${phase}`;
|
|
14
|
+
}
|
|
15
|
+
async function refExists(cwd, ref) {
|
|
16
|
+
const result = await runGit(cwd, ["rev-parse", "--verify", "--quiet", ref], { allowNonZeroExit: true });
|
|
17
|
+
return result.exitCode === 0;
|
|
18
|
+
}
|
|
19
|
+
async function isGitWorkTree(cwd) {
|
|
20
|
+
const result = await runGit(cwd, ["rev-parse", "--is-inside-work-tree"], { allowNonZeroExit: true });
|
|
21
|
+
return result.exitCode === 0 && result.stdout.trim() === "true";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Snapshot the working tree (tracked + untracked-but-not-ignored files) into
|
|
25
|
+
* a commit stored at `ref`. Idempotent: an existing ref is left untouched.
|
|
26
|
+
*/
|
|
27
|
+
export async function captureCheckpoint(cwd, ref) {
|
|
28
|
+
if (await refExists(cwd, ref)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const tempDir = await mkdtemp(join(tmpdir(), "opensana-checkpoint-"));
|
|
32
|
+
const env = { GIT_INDEX_FILE: join(tempDir, "index") };
|
|
33
|
+
try {
|
|
34
|
+
const head = await runGit(cwd, ["rev-parse", "--verify", "--quiet", "HEAD"], { allowNonZeroExit: true });
|
|
35
|
+
if (head.exitCode === 0) {
|
|
36
|
+
await runGit(cwd, ["read-tree", "HEAD"], { env });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
await runGit(cwd, ["read-tree", "--empty"], { env });
|
|
40
|
+
}
|
|
41
|
+
await runGit(cwd, ["add", "-A", "--", "."], { env, timeoutMs: CAPTURE_TIMEOUT_MS });
|
|
42
|
+
const tree = (await runGit(cwd, ["write-tree"], { env })).stdout.trim();
|
|
43
|
+
const commit = (await runGit(cwd, [...IDENT_ARGS, "commit-tree", tree, "-m", `convoy checkpoint ${ref}`], { env })).stdout.trim();
|
|
44
|
+
await runGit(cwd, ["update-ref", ref, commit]);
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Capture the pre-run baseline for a batch. Returns false when the working
|
|
52
|
+
* directory is not a git repo (post-run capture should then be skipped too).
|
|
53
|
+
*/
|
|
54
|
+
export async function capturePreRunCheckpoint(cwd, threadId, batchId) {
|
|
55
|
+
if (!(await isGitWorkTree(cwd))) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
await captureCheckpoint(cwd, checkpointRef(threadId, batchId, "pre"));
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Capture the post-run checkpoint and diff it against the batch baseline.
|
|
63
|
+
* Returns null when nothing changed. Also prunes old checkpoint refs for the
|
|
64
|
+
* thread as a side effect.
|
|
65
|
+
*/
|
|
66
|
+
export async function captureRunDiffSummary(cwd, threadId, batchId) {
|
|
67
|
+
const preRef = checkpointRef(threadId, batchId, "pre");
|
|
68
|
+
const postRef = checkpointRef(threadId, batchId, "post");
|
|
69
|
+
await captureCheckpoint(cwd, postRef);
|
|
70
|
+
await pruneCheckpointRefs(cwd, threadId);
|
|
71
|
+
// ponytail: --no-renames keeps parsing uniform (renames show as
|
|
72
|
+
// delete+add); switch to -M plus a previousPath field if that reads poorly.
|
|
73
|
+
const [numstat, nameStatus] = await Promise.all([
|
|
74
|
+
runGit(cwd, ["diff", "--numstat", "--no-renames", "-z", preRef, postRef], { timeoutMs: CAPTURE_TIMEOUT_MS }),
|
|
75
|
+
runGit(cwd, ["diff", "--name-status", "--no-renames", "-z", preRef, postRef], { timeoutMs: CAPTURE_TIMEOUT_MS }),
|
|
76
|
+
]);
|
|
77
|
+
const files = parseDiffSummary(numstat.stdout, nameStatus.stdout);
|
|
78
|
+
if (files.length === 0) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
if (files.length > MAX_DIFF_FILES) {
|
|
82
|
+
return { preRef, postRef, files: files.slice(0, MAX_DIFF_FILES), truncated: true };
|
|
83
|
+
}
|
|
84
|
+
return { preRef, postRef, files };
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Join `git diff --numstat -z` (line counts) with `--name-status -z` (change
|
|
88
|
+
* kind) into per-file entries. Exported for tests.
|
|
89
|
+
*/
|
|
90
|
+
export function parseDiffSummary(numstatOutput, nameStatusOutput) {
|
|
91
|
+
const kindByPath = new Map();
|
|
92
|
+
// -z name-status output alternates: status NUL path NUL ...
|
|
93
|
+
const nameStatusParts = nameStatusOutput.split("\0");
|
|
94
|
+
for (let i = 0; i + 1 < nameStatusParts.length; i += 2) {
|
|
95
|
+
const status = nameStatusParts[i]?.trim();
|
|
96
|
+
const path = nameStatusParts[i + 1];
|
|
97
|
+
if (!status || !path) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
kindByPath.set(path, status.startsWith("A") ? "added" : status.startsWith("D") ? "deleted" : "modified");
|
|
101
|
+
}
|
|
102
|
+
const files = [];
|
|
103
|
+
// -z numstat entries: "additions\tdeletions\tpath" NUL-separated; binary
|
|
104
|
+
// files report "-" for both counts.
|
|
105
|
+
for (const entry of numstatOutput.split("\0")) {
|
|
106
|
+
const [additionsRaw, deletionsRaw, path] = entry.split("\t");
|
|
107
|
+
if (!path || additionsRaw === undefined || deletionsRaw === undefined) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const binary = additionsRaw === "-";
|
|
111
|
+
files.push({
|
|
112
|
+
path,
|
|
113
|
+
kind: kindByPath.get(path) ?? "modified",
|
|
114
|
+
additions: binary ? 0 : Number.parseInt(additionsRaw, 10) || 0,
|
|
115
|
+
deletions: binary ? 0 : Number.parseInt(deletionsRaw, 10) || 0,
|
|
116
|
+
...(binary ? { binary } : {}),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return files;
|
|
120
|
+
}
|
|
121
|
+
// Result payload cap for the on-demand file viewer (OS-1143). Chars, not
|
|
122
|
+
// bytes: keeps the JSON-escaped resultJson safely under Convex's 1MB doc cap.
|
|
123
|
+
export const MAX_FILE_OP_CHARS = 700_000;
|
|
124
|
+
// Blobs past this size are refused outright instead of streamed+sliced.
|
|
125
|
+
const MAX_FILE_OP_BLOB_BYTES = 5 * 1024 * 1024;
|
|
126
|
+
/**
|
|
127
|
+
* Read one file's content at a checkpoint ref (`git show ref:path`). Throws
|
|
128
|
+
* with a user-facing message for missing blobs (pruned ref / deleted file),
|
|
129
|
+
* binary content, or oversized files.
|
|
130
|
+
*/
|
|
131
|
+
export async function readFileAtRef(cwd, ref, filePath) {
|
|
132
|
+
const spec = `${ref}:${filePath}`;
|
|
133
|
+
const exists = await runGit(cwd, ["cat-file", "-e", spec], { allowNonZeroExit: true });
|
|
134
|
+
if (exists.exitCode !== 0) {
|
|
135
|
+
throw new Error("File not found at this checkpoint (the checkpoint may have been pruned)");
|
|
136
|
+
}
|
|
137
|
+
const size = Number.parseInt((await runGit(cwd, ["cat-file", "-s", spec])).stdout.trim(), 10);
|
|
138
|
+
if (Number.isFinite(size) && size > MAX_FILE_OP_BLOB_BYTES) {
|
|
139
|
+
throw new Error(`File is too large to view (${Math.round(size / 1024 / 1024)} MB)`);
|
|
140
|
+
}
|
|
141
|
+
const content = (await runGit(cwd, ["show", spec])).stdout;
|
|
142
|
+
if (content.includes("\0")) {
|
|
143
|
+
throw new Error("Binary file");
|
|
144
|
+
}
|
|
145
|
+
if (content.length > MAX_FILE_OP_CHARS) {
|
|
146
|
+
return { content: content.slice(0, MAX_FILE_OP_CHARS), truncated: true };
|
|
147
|
+
}
|
|
148
|
+
return { content, truncated: false };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Unified patch between the pre and post checkpoint refs — for one file when
|
|
152
|
+
* `filePath` is given, otherwise for the whole run.
|
|
153
|
+
*/
|
|
154
|
+
export async function diffBetweenRefs(cwd, preRef, postRef, filePath) {
|
|
155
|
+
const result = await runGit(cwd, ["diff", "--no-renames", preRef, postRef, ...(filePath ? ["--", filePath] : [])], { timeoutMs: CAPTURE_TIMEOUT_MS });
|
|
156
|
+
const patch = result.stdout;
|
|
157
|
+
if (patch.length > MAX_FILE_OP_CHARS) {
|
|
158
|
+
return { patch: patch.slice(0, MAX_FILE_OP_CHARS), truncated: true };
|
|
159
|
+
}
|
|
160
|
+
return { patch, truncated: false };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Restore the working tree (tracked + untracked files) to a checkpoint
|
|
164
|
+
* (OS-1151). Discards everything that happened after the checkpoint,
|
|
165
|
+
* including the user's own uncommitted edits; HEAD and the index end up
|
|
166
|
+
* unchanged/unstaged. t3code's revert recipe. With `filePath` (OS-1156) only
|
|
167
|
+
* that one path is restored — or deleted, when the run created it.
|
|
168
|
+
*/
|
|
169
|
+
export async function revertToCheckpoint(cwd, ref, filePath) {
|
|
170
|
+
if (!(await refExists(cwd, ref))) {
|
|
171
|
+
throw new Error("Checkpoint no longer exists (it may have been pruned)");
|
|
172
|
+
}
|
|
173
|
+
if (filePath !== undefined) {
|
|
174
|
+
const inCheckpoint = await runGit(cwd, ["cat-file", "-e", `${ref}:${filePath}`], { allowNonZeroExit: true });
|
|
175
|
+
if (inCheckpoint.exitCode === 0) {
|
|
176
|
+
await runGit(cwd, ["restore", "--source", ref, "--worktree", "--staged", "--", filePath], {
|
|
177
|
+
timeoutMs: CAPTURE_TIMEOUT_MS,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
// The run created this file — pre-run state is "absent".
|
|
182
|
+
await rm(join(cwd, filePath), { force: true });
|
|
183
|
+
}
|
|
184
|
+
// Leave the user's index at HEAD (changes show as unstaged, not staged);
|
|
185
|
+
// also drops a staged index entry for a deleted run-created file.
|
|
186
|
+
await runGit(cwd, ["reset", "--quiet", "--", filePath], { timeoutMs: CAPTURE_TIMEOUT_MS, allowNonZeroExit: true });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
// Worktree+index → checkpoint tree; files absent from it become untracked…
|
|
190
|
+
await runGit(cwd, ["restore", "--source", ref, "--worktree", "--staged", "--", "."], { timeoutMs: CAPTURE_TIMEOUT_MS });
|
|
191
|
+
// …and are removed here.
|
|
192
|
+
await runGit(cwd, ["clean", "-fd", "--", "."], { timeoutMs: CAPTURE_TIMEOUT_MS });
|
|
193
|
+
// Leave the user's index at HEAD (changes show as unstaged, not staged).
|
|
194
|
+
await runGit(cwd, ["reset", "--quiet", "--", "."], { timeoutMs: CAPTURE_TIMEOUT_MS, allowNonZeroExit: true });
|
|
195
|
+
}
|
|
196
|
+
/** Keep the newest checkpoint refs for a thread, delete the rest. */
|
|
197
|
+
export async function pruneCheckpointRefs(cwd, threadId) {
|
|
198
|
+
const prefix = `refs/opensana/checkpoints/${threadId}/`;
|
|
199
|
+
const result = await runGit(cwd, [
|
|
200
|
+
"for-each-ref",
|
|
201
|
+
"--sort=-creatordate",
|
|
202
|
+
"--format=%(refname)",
|
|
203
|
+
prefix,
|
|
204
|
+
]);
|
|
205
|
+
const refs = result.stdout.split("\n").filter((ref) => ref.startsWith(prefix));
|
|
206
|
+
for (const ref of refs.slice(MAX_REFS_PER_THREAD)) {
|
|
207
|
+
await runGit(cwd, ["update-ref", "-d", ref], { allowNonZeroExit: true });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=checkpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint.js","sourceRoot":"","sources":["../../../../src/lib/git/checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AA0BnC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC,oEAAoE;AACpE,0DAA0D;AAC1D,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEnC,wEAAwE;AACxE,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,6BAA6B,CAAC,CAAC;AAErF,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,OAAe,EAAE,KAAqB;IACpF,OAAO,6BAA6B,QAAQ,IAAI,OAAO,IAAI,KAAK,EAAE,CAAC;AACrE,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,GAAW;IAC/C,MAAM,MAAM,GAAG,MAAM,MAA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|
|
5
|
+
}
|
|
6
|
+
export interface RunGitOptions {
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
/** Resolve (instead of throwing) when git exits non-zero. */
|
|
9
|
+
allowNonZeroExit?: boolean;
|
|
10
|
+
/** Extra environment variables merged over process.env (e.g. GIT_INDEX_FILE). */
|
|
11
|
+
env?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export declare class GitCommandError extends Error {
|
|
14
|
+
readonly gitArgs: readonly string[];
|
|
15
|
+
readonly exitCode: number | null;
|
|
16
|
+
readonly stderr: string;
|
|
17
|
+
constructor(message: string, gitArgs: readonly string[], exitCode: number | null, stderr: string);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Single spawn point for git in the CLI. Bounded by a timeout and an output
|
|
21
|
+
* cap; failures surface as GitCommandError with stderr attached.
|
|
22
|
+
*/
|
|
23
|
+
export declare function runGit(cwd: string, args: string[], options?: RunGitOptions): Promise<GitResult>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
3
|
+
const MAX_OUTPUT_BYTES = 10 * 1024 * 1024;
|
|
4
|
+
export class GitCommandError extends Error {
|
|
5
|
+
gitArgs;
|
|
6
|
+
exitCode;
|
|
7
|
+
stderr;
|
|
8
|
+
constructor(message, gitArgs, exitCode, stderr) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.gitArgs = gitArgs;
|
|
11
|
+
this.exitCode = exitCode;
|
|
12
|
+
this.stderr = stderr;
|
|
13
|
+
this.name = "GitCommandError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function firstLine(text) {
|
|
17
|
+
return text.trim().split("\n")[0]?.trim() ?? "";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Single spawn point for git in the CLI. Bounded by a timeout and an output
|
|
21
|
+
* cap; failures surface as GitCommandError with stderr attached.
|
|
22
|
+
*/
|
|
23
|
+
export async function runGit(cwd, args, options = {}) {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
execFile("git", args, {
|
|
26
|
+
cwd,
|
|
27
|
+
timeout: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
28
|
+
maxBuffer: MAX_OUTPUT_BYTES,
|
|
29
|
+
encoding: "utf8",
|
|
30
|
+
...(options.env ? { env: { ...process.env, ...options.env } } : {}),
|
|
31
|
+
}, (error, stdout, stderr) => {
|
|
32
|
+
if (!error) {
|
|
33
|
+
resolve({ stdout, stderr, exitCode: 0 });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const exitCode = typeof error.code === "number" ? error.code : null;
|
|
37
|
+
if (exitCode !== null && options.allowNonZeroExit) {
|
|
38
|
+
resolve({ stdout, stderr, exitCode });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const reason = error.killed ? `git ${args[0] ?? ""} timed out` : firstLine(stderr) || error.message;
|
|
42
|
+
reject(new GitCommandError(reason, args, exitCode, stderr));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../../src/lib/git/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA0B,MAAM,oBAAoB,CAAC;AAEtE,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAgB1C,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAGtB;IACA;IACA;IAJlB,YACE,OAAe,EACC,OAA0B,EAC1B,QAAuB,EACvB,MAAc;QAE9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,YAAO,GAAP,OAAO,CAAmB;QAC1B,aAAQ,GAAR,QAAQ,CAAe;QACvB,WAAM,GAAN,MAAM,CAAQ;Q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G,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC;YACpG,MAAM,CAAC,IAAI,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QAC9D,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search the workspace file index. An empty query returns the top entries
|
|
3
|
+
* alphabetically (the bare-`@` menu). Case-insensitive substring match with
|
|
4
|
+
* basename-first ranking.
|
|
5
|
+
*/
|
|
6
|
+
export declare function searchWorkspaceFiles(cwd: string, query: string, limit?: number): Promise<string[]>;
|
|
7
|
+
/** Test hook: drop all cached indexes. */
|
|
8
|
+
export declare function clearWorkspaceFileIndexCache(): void;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { readdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { runGit } from "./exec.js";
|
|
4
|
+
/**
|
|
5
|
+
* Workspace file index + search for composer @-file mentions (OS-1144).
|
|
6
|
+
* Modeled on t3code's workspaceEntries (docs/analysis/t3code-file-mentions.md).
|
|
7
|
+
*/
|
|
8
|
+
const INDEX_CACHE_TTL_MS = 15_000;
|
|
9
|
+
const INDEX_CACHE_MAX_KEYS = 4;
|
|
10
|
+
const MAX_INDEX_ENTRIES = 25_000;
|
|
11
|
+
const DEFAULT_SEARCH_LIMIT = 50;
|
|
12
|
+
/** Directories the fs-walk fallback never descends into (t3code's list). */
|
|
13
|
+
const EXCLUDED_DIRS = new Set([
|
|
14
|
+
".git",
|
|
15
|
+
"node_modules",
|
|
16
|
+
".next",
|
|
17
|
+
".turbo",
|
|
18
|
+
"dist",
|
|
19
|
+
"build",
|
|
20
|
+
"out",
|
|
21
|
+
".cache",
|
|
22
|
+
".convex",
|
|
23
|
+
]);
|
|
24
|
+
// Caching the promise (not the result) also dedupes concurrent builds.
|
|
25
|
+
const indexCache = new Map();
|
|
26
|
+
async function listFilesViaGit(cwd) {
|
|
27
|
+
// Tracked + untracked-but-not-ignored files, NUL-separated.
|
|
28
|
+
const { stdout } = await runGit(cwd, ["ls-files", "--cached", "--others", "--exclude-standard", "-z"]);
|
|
29
|
+
return stdout.split("\0").filter((path) => path.length > 0);
|
|
30
|
+
}
|
|
31
|
+
async function listFilesViaWalk(cwd) {
|
|
32
|
+
const files = [];
|
|
33
|
+
const queue = [""];
|
|
34
|
+
while (queue.length > 0 && files.length < MAX_INDEX_ENTRIES) {
|
|
35
|
+
const dir = queue.shift();
|
|
36
|
+
let entries;
|
|
37
|
+
try {
|
|
38
|
+
entries = await readdir(join(cwd, dir), { withFileTypes: true });
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
for (const entry of entries) {
|
|
44
|
+
const relPath = dir ? `${dir}/${entry.name}` : entry.name;
|
|
45
|
+
if (entry.isDirectory()) {
|
|
46
|
+
if (!EXCLUDED_DIRS.has(entry.name)) {
|
|
47
|
+
queue.push(relPath);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else if (entry.isFile()) {
|
|
51
|
+
files.push(relPath);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return files;
|
|
56
|
+
}
|
|
57
|
+
async function buildIndex(cwd) {
|
|
58
|
+
let files;
|
|
59
|
+
try {
|
|
60
|
+
files = await listFilesViaGit(cwd);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// Not a git repo (or transient git failure) — walk the filesystem.
|
|
64
|
+
files = await listFilesViaWalk(cwd);
|
|
65
|
+
}
|
|
66
|
+
return files.slice(0, MAX_INDEX_ENTRIES);
|
|
67
|
+
}
|
|
68
|
+
function getIndex(cwd) {
|
|
69
|
+
const now = Date.now();
|
|
70
|
+
const cached = indexCache.get(cwd);
|
|
71
|
+
if (cached && cached.expiresAt > now) {
|
|
72
|
+
return cached.files;
|
|
73
|
+
}
|
|
74
|
+
const files = buildIndex(cwd);
|
|
75
|
+
indexCache.set(cwd, { expiresAt: now + INDEX_CACHE_TTL_MS, files });
|
|
76
|
+
// ponytail: crude size cap via oldest-inserted eviction, fine for ≤ a few cwds.
|
|
77
|
+
while (indexCache.size > INDEX_CACHE_MAX_KEYS) {
|
|
78
|
+
const oldestKey = indexCache.keys().next().value;
|
|
79
|
+
indexCache.delete(oldestKey);
|
|
80
|
+
}
|
|
81
|
+
return files;
|
|
82
|
+
}
|
|
83
|
+
function basename(path) {
|
|
84
|
+
const lastSlash = path.lastIndexOf("/");
|
|
85
|
+
return lastSlash === -1 ? path : path.slice(lastSlash + 1);
|
|
86
|
+
}
|
|
87
|
+
/** t3code's basename-first ranking: lower score sorts first. */
|
|
88
|
+
function scoreMatch(path, query) {
|
|
89
|
+
const base = basename(path);
|
|
90
|
+
if (base === query)
|
|
91
|
+
return 0;
|
|
92
|
+
if (path === query)
|
|
93
|
+
return 1;
|
|
94
|
+
if (base.startsWith(query))
|
|
95
|
+
return 2;
|
|
96
|
+
if (path.startsWith(query))
|
|
97
|
+
return 3;
|
|
98
|
+
if (path.includes(`/${query}`))
|
|
99
|
+
return 4;
|
|
100
|
+
return 5;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Search the workspace file index. An empty query returns the top entries
|
|
104
|
+
* alphabetically (the bare-`@` menu). Case-insensitive substring match with
|
|
105
|
+
* basename-first ranking.
|
|
106
|
+
*/
|
|
107
|
+
export async function searchWorkspaceFiles(cwd, query, limit = DEFAULT_SEARCH_LIMIT) {
|
|
108
|
+
const files = await getIndex(cwd);
|
|
109
|
+
const normalized = query.trim().replace(/^[@./]+/, "").toLowerCase();
|
|
110
|
+
const scored = [];
|
|
111
|
+
for (const path of files) {
|
|
112
|
+
const lower = path.toLowerCase();
|
|
113
|
+
if (normalized.length > 0 && !lower.includes(normalized)) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
scored.push({ path, score: normalized.length > 0 ? scoreMatch(lower, normalized) : 5 });
|
|
117
|
+
}
|
|
118
|
+
scored.sort((a, b) => a.score - b.score || (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
119
|
+
return scored.slice(0, limit).map((entry) => entry.path);
|
|
120
|
+
}
|
|
121
|
+
/** Test hook: drop all cached indexes. */
|
|
122
|
+
export function clearWorkspaceFileIndexCache() {
|
|
123
|
+
indexCache.clear();
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=file-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-index.js","sourceRoot":"","sources":["../../../../src/lib/git/file-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;GAGG;AAEH,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,4EAA4E;AAC5E,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,MAAM;IACN,cAAc;IACd,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;IACL,QAAQ;IACR,SAAS;CACV,CAAC,CAAC;AAEH,uEAAuE;AACvE,MAAM,UAAU,GAAG,IAAI,GAAG,EAA2D,CAAC;AAEtF,KAAK,UAAU,eAAe,CAAC,GAAW;IACxC,4DAA4D;IAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,U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AAC,CAAC,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7F,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,4BAA4B;IAC1C,UAAU,CAAC,KAAK,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { GitCommandError, runGit, type GitResult } from "./exec.js";
|
|
2
|
+
export { capturePreRunCheckpoint, captureRunDiffSummary, checkpointRef, diffBetweenRefs, readFileAtRef, revertToCheckpoint, type FileAtRef, type FileDiff, type RunDiffFile, type RunDiffSummary, } from "./checkpoint.js";
|
|
3
|
+
export { clearWorkspaceFileIndexCache, searchWorkspaceFiles } from "./file-index.js";
|
|
4
|
+
export { branchExists, getCurrentBranch, getDefaultBranch, getGitRemoteUrl, isWorkingTreeDirty, listBranchRefs, type BranchRef } from "./repo.js";
|
|
5
|
+
export { buildDefaultWorktreePath, createWorktree, listWorktrees, parseWorktreeList, removeWorktree, type CreateWorktreeInput, type CreateWorktreeResult, type WorktreeInfo, } from "./worktrees.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { GitCommandError, runGit } from "./exec.js";
|
|
2
|
+
export { capturePreRunCheckpoint, captureRunDiffSummary, checkpointRef, diffBetweenRefs, readFileAtRef, revertToCheckpoint, } from "./checkpoint.js";
|
|
3
|
+
export { clearWorkspaceFileIndexCache, searchWorkspaceFiles } from "./file-index.js";
|
|
4
|
+
export { branchExists, getCurrentBranch, getDefaultBranch, getGitRemoteUrl, isWorkingTreeDirty, listBranchRefs } from "./repo.js";
|
|
5
|
+
export { buildDefaultWorktreePath, createWorktree, listWorktrees, parseWorktreeList, removeWorktree, } from "./worktrees.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAkB,MAAM,WAAW,CAAC;AACpE,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,aAAa,EACb,kBAAkB,GAKnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAkB,MAAM,WAAW,CAAC;AAClJ,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,GAIf,MAAM,gBAAgB,CAAC"}
|