@delegance/claude-autopilot 5.0.0 → 5.0.2
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/dist/presets/go/rules/go-sql-injection.d.ts +4 -0
- package/dist/presets/nextjs-supabase/rules/supabase-rls-bypass.d.ts +4 -0
- package/dist/presets/python-fastapi/rules/fastapi-missing-auth.d.ts +4 -0
- package/dist/presets/rails-postgres/rules/rails-sql-injection.d.ts +4 -0
- package/dist/presets/t3/rules/t3-server-only.d.ts +4 -0
- package/dist/src/adapters/base.d.ts +11 -0
- package/dist/src/adapters/council/claude.d.ts +3 -0
- package/dist/src/adapters/council/openai.d.ts +3 -0
- package/dist/src/adapters/council/types.d.ts +5 -0
- package/dist/src/adapters/loader.d.ts +11 -0
- package/dist/src/adapters/migration-runner/supabase.d.ts +4 -0
- package/dist/src/adapters/migration-runner/types.d.ts +31 -0
- package/dist/src/adapters/review-bot-parser/cursor.d.ts +3 -0
- package/dist/src/adapters/review-bot-parser/declarative-base.d.ts +13 -0
- package/{src/adapters/review-bot-parser/types.ts → dist/src/adapters/review-bot-parser/types.d.ts} +4 -4
- package/dist/src/adapters/review-engine/auto.d.ts +4 -0
- package/dist/src/adapters/review-engine/claude.d.ts +4 -0
- package/dist/src/adapters/review-engine/codex.d.ts +4 -0
- package/dist/src/adapters/review-engine/gemini.d.ts +4 -0
- package/dist/src/adapters/review-engine/openai-compatible.d.ts +4 -0
- package/dist/src/adapters/review-engine/parse-output.d.ts +13 -0
- package/dist/src/adapters/review-engine/prompt-builder.d.ts +4 -0
- package/dist/src/adapters/review-engine/types.d.ts +28 -0
- package/dist/src/adapters/vcs-host/commit-status.d.ts +12 -0
- package/dist/src/adapters/vcs-host/github.d.ts +4 -0
- package/dist/src/adapters/vcs-host/types.d.ts +42 -0
- package/{src/cli/_pkg-root.ts → dist/src/cli/_pkg-root.d.ts} +4 -42
- package/dist/src/cli/autoregress-bridge.d.ts +3 -0
- package/dist/src/cli/baseline.d.ts +7 -0
- package/dist/src/cli/ci.d.ts +23 -0
- package/dist/src/cli/costs.d.ts +2 -0
- package/dist/src/cli/council.d.ts +8 -0
- package/dist/src/cli/detector.d.ts +8 -0
- package/dist/src/cli/explain.d.ts +8 -0
- package/dist/src/cli/fix.d.ts +10 -0
- package/dist/src/cli/hook.d.ts +9 -0
- package/dist/src/cli/ignore-helper.d.ts +7 -0
- package/dist/src/cli/index.d.ts +3 -0
- package/dist/src/cli/index.js +39 -1
- package/dist/src/cli/lsp.d.ts +29 -0
- package/dist/src/cli/mcp.d.ts +5 -0
- package/dist/src/cli/migrate-v4.d.ts +28 -0
- package/dist/src/cli/pr-comment.d.ts +13 -0
- package/dist/src/cli/pr-desc.d.ts +31 -0
- package/dist/src/cli/pr-review-comments.d.ts +12 -0
- package/dist/src/cli/pr.d.ts +9 -0
- package/dist/src/cli/preflight.d.ts +8 -0
- package/dist/src/cli/preflight.js +17 -4
- package/dist/src/cli/report.d.ts +7 -0
- package/dist/src/cli/run.d.ts +23 -0
- package/dist/src/cli/scan.d.ts +11 -0
- package/dist/src/cli/setup.d.ts +9 -0
- package/dist/src/cli/test-gen.d.ts +10 -0
- package/dist/src/cli/triage.d.ts +5 -0
- package/dist/src/cli/watch.d.ts +18 -0
- package/dist/src/cli/worker.d.ts +5 -0
- package/dist/src/core/cache/cached-engine.d.ts +8 -0
- package/dist/src/core/cache/review-cache.d.ts +21 -0
- package/dist/src/core/chunking/index.d.ts +18 -0
- package/dist/src/core/chunking/risk-ranker.d.ts +10 -0
- package/dist/src/core/config/loader.d.ts +3 -0
- package/dist/src/core/config/preset-resolver.d.ts +9 -0
- package/dist/src/core/config/schema.d.ts +342 -0
- package/dist/src/core/config/types.d.ts +115 -0
- package/dist/src/core/council/config.d.ts +3 -0
- package/dist/src/core/council/context.d.ts +2 -0
- package/dist/src/core/council/runner.d.ts +4 -0
- package/dist/src/core/council/types.d.ts +36 -0
- package/dist/src/core/detect/git-context.d.ts +12 -0
- package/dist/src/core/detect/llm-key.d.ts +38 -0
- package/dist/src/core/detect/protected-paths.d.ts +6 -0
- package/dist/src/core/detect/provider-usage.d.ts +17 -0
- package/dist/src/core/detect/stack.d.ts +6 -0
- package/dist/src/core/detect/workspaces.d.ts +11 -0
- package/dist/src/core/errors.d.ts +17 -0
- package/dist/src/core/findings/dedup.d.ts +4 -0
- package/dist/src/core/findings/types.d.ts +33 -0
- package/dist/src/core/fix/generator.d.ts +17 -0
- package/dist/src/core/git/diff-hunks.d.ts +22 -0
- package/dist/src/core/git/touched-files.d.ts +11 -0
- package/dist/src/core/ignore/index.d.ts +11 -0
- package/dist/src/core/index.d.ts +2 -0
- package/dist/src/core/logging/ndjson-writer.d.ts +16 -0
- package/dist/src/core/logging/redaction.d.ts +4 -0
- package/dist/src/core/mcp/concurrency.d.ts +2 -0
- package/dist/src/core/mcp/handlers/fix-finding.d.ts +17 -0
- package/dist/src/core/mcp/handlers/get-capabilities.d.ts +14 -0
- package/dist/src/core/mcp/handlers/get-findings.d.ts +13 -0
- package/dist/src/core/mcp/handlers/review-diff.d.ts +18 -0
- package/dist/src/core/mcp/handlers/scan-files.d.ts +15 -0
- package/dist/src/core/mcp/handlers/validate-fix.d.ts +12 -0
- package/dist/src/core/mcp/run-store.d.ts +12 -0
- package/dist/src/core/mcp/workspace.d.ts +3 -0
- package/dist/src/core/persist/baseline.d.ts +39 -0
- package/dist/src/core/persist/cost-log.d.ts +11 -0
- package/dist/src/core/persist/findings-cache.d.ts +9 -0
- package/dist/src/core/persist/triage.d.ts +30 -0
- package/dist/src/core/phases/static-rules.d.ts +24 -0
- package/dist/src/core/phases/tests.d.ts +15 -0
- package/dist/src/core/pipeline/review-phase.d.ts +27 -0
- package/dist/src/core/pipeline/run.d.ts +27 -0
- package/dist/src/core/runtime/idempotency.d.ts +2 -0
- package/dist/src/core/runtime/lock.d.ts +5 -0
- package/dist/src/core/runtime/state.d.ts +39 -0
- package/dist/src/core/schema-alignment/detector.d.ts +3 -0
- package/dist/src/core/schema-alignment/extractor/index.d.ts +3 -0
- package/dist/src/core/schema-alignment/extractor/prisma.d.ts +3 -0
- package/dist/src/core/schema-alignment/extractor/sql.d.ts +3 -0
- package/dist/src/core/schema-alignment/llm-check.d.ts +4 -0
- package/dist/src/core/schema-alignment/scanner.d.ts +3 -0
- package/dist/src/core/schema-alignment/types.d.ts +38 -0
- package/dist/src/core/shell.d.ts +15 -0
- package/dist/src/core/static-rules/registry.d.ts +5 -0
- package/dist/src/core/static-rules/rules/brand-tokens.d.ts +3 -0
- package/dist/src/core/static-rules/rules/console-log.d.ts +3 -0
- package/dist/src/core/static-rules/rules/hardcoded-secrets.d.ts +3 -0
- package/dist/src/core/static-rules/rules/insecure-redirect.d.ts +3 -0
- package/dist/src/core/static-rules/rules/large-file.d.ts +3 -0
- package/dist/src/core/static-rules/rules/missing-auth.d.ts +3 -0
- package/dist/src/core/static-rules/rules/missing-tests.d.ts +3 -0
- package/dist/src/core/static-rules/rules/npm-audit.d.ts +3 -0
- package/dist/src/core/static-rules/rules/package-lock-sync.d.ts +3 -0
- package/dist/src/core/static-rules/rules/schema-alignment.d.ts +3 -0
- package/dist/src/core/static-rules/rules/sql-injection.d.ts +3 -0
- package/dist/src/core/static-rules/rules/ssrf.d.ts +3 -0
- package/dist/src/core/static-rules/rules/todo-fixme.d.ts +3 -0
- package/dist/src/core/static-rules/tailwind-extractor.d.ts +7 -0
- package/dist/src/core/test-gen/coverage-analyzer.d.ts +7 -0
- package/dist/src/core/test-gen/framework-detector.d.ts +3 -0
- package/dist/src/core/test-gen/test-writer.d.ts +4 -0
- package/dist/src/core/ui/design-context-loader.d.ts +7 -0
- package/dist/src/core/worker/client.d.ts +23 -0
- package/dist/src/core/worker/lockfile.d.ts +12 -0
- package/dist/src/core/worker/server.d.ts +17 -0
- package/dist/src/formatters/github-annotations.d.ts +5 -0
- package/{src/formatters/index.ts → dist/src/formatters/index.d.ts} +1 -0
- package/dist/src/formatters/junit.d.ts +5 -0
- package/dist/src/formatters/sarif.d.ts +56 -0
- package/{src/index.ts → dist/src/index.d.ts} +1 -0
- package/package.json +7 -6
- package/dist/presets/go/rules/go-sql-injection.js.map +0 -1
- package/dist/presets/nextjs-supabase/rules/supabase-rls-bypass.js.map +0 -1
- package/dist/presets/python-fastapi/rules/fastapi-missing-auth.js.map +0 -1
- package/dist/presets/rails-postgres/rules/rails-sql-injection.js.map +0 -1
- package/dist/presets/t3/rules/t3-server-only.js.map +0 -1
- package/dist/src/adapters/base.js.map +0 -1
- package/dist/src/adapters/council/claude.js.map +0 -1
- package/dist/src/adapters/council/openai.js.map +0 -1
- package/dist/src/adapters/council/types.js.map +0 -1
- package/dist/src/adapters/loader.js.map +0 -1
- package/dist/src/adapters/migration-runner/supabase.js.map +0 -1
- package/dist/src/adapters/migration-runner/types.js.map +0 -1
- package/dist/src/adapters/review-bot-parser/cursor.js.map +0 -1
- package/dist/src/adapters/review-bot-parser/declarative-base.js.map +0 -1
- package/dist/src/adapters/review-bot-parser/types.js.map +0 -1
- package/dist/src/adapters/review-engine/auto.js.map +0 -1
- package/dist/src/adapters/review-engine/claude.js.map +0 -1
- package/dist/src/adapters/review-engine/codex.js.map +0 -1
- package/dist/src/adapters/review-engine/gemini.js.map +0 -1
- package/dist/src/adapters/review-engine/openai-compatible.js.map +0 -1
- package/dist/src/adapters/review-engine/parse-output.js.map +0 -1
- package/dist/src/adapters/review-engine/prompt-builder.js.map +0 -1
- package/dist/src/adapters/review-engine/types.js.map +0 -1
- package/dist/src/adapters/vcs-host/commit-status.js.map +0 -1
- package/dist/src/adapters/vcs-host/github.js.map +0 -1
- package/dist/src/adapters/vcs-host/types.js.map +0 -1
- package/dist/src/cli/_pkg-root.js.map +0 -1
- package/dist/src/cli/autoregress-bridge.js.map +0 -1
- package/dist/src/cli/baseline.js.map +0 -1
- package/dist/src/cli/ci.js.map +0 -1
- package/dist/src/cli/costs.js.map +0 -1
- package/dist/src/cli/council.js.map +0 -1
- package/dist/src/cli/detector.js.map +0 -1
- package/dist/src/cli/explain.js.map +0 -1
- package/dist/src/cli/fix.js.map +0 -1
- package/dist/src/cli/hook.js.map +0 -1
- package/dist/src/cli/ignore-helper.js.map +0 -1
- package/dist/src/cli/index.js.map +0 -1
- package/dist/src/cli/lsp.js.map +0 -1
- package/dist/src/cli/mcp.js.map +0 -1
- package/dist/src/cli/migrate-v4.js.map +0 -1
- package/dist/src/cli/pr-comment.js.map +0 -1
- package/dist/src/cli/pr-desc.js.map +0 -1
- package/dist/src/cli/pr-review-comments.js.map +0 -1
- package/dist/src/cli/pr.js.map +0 -1
- package/dist/src/cli/preflight.js.map +0 -1
- package/dist/src/cli/report.js.map +0 -1
- package/dist/src/cli/run.js.map +0 -1
- package/dist/src/cli/scan.js.map +0 -1
- package/dist/src/cli/setup.js.map +0 -1
- package/dist/src/cli/test-gen.js.map +0 -1
- package/dist/src/cli/triage.js.map +0 -1
- package/dist/src/cli/watch.js.map +0 -1
- package/dist/src/cli/worker.js.map +0 -1
- package/dist/src/core/cache/cached-engine.js.map +0 -1
- package/dist/src/core/cache/review-cache.js.map +0 -1
- package/dist/src/core/chunking/index.js.map +0 -1
- package/dist/src/core/chunking/risk-ranker.js.map +0 -1
- package/dist/src/core/config/loader.js.map +0 -1
- package/dist/src/core/config/preset-resolver.js.map +0 -1
- package/dist/src/core/config/schema.js.map +0 -1
- package/dist/src/core/config/types.js.map +0 -1
- package/dist/src/core/council/config.js.map +0 -1
- package/dist/src/core/council/context.js.map +0 -1
- package/dist/src/core/council/runner.js.map +0 -1
- package/dist/src/core/council/types.js.map +0 -1
- package/dist/src/core/detect/git-context.js.map +0 -1
- package/dist/src/core/detect/llm-key.js.map +0 -1
- package/dist/src/core/detect/protected-paths.js.map +0 -1
- package/dist/src/core/detect/provider-usage.js.map +0 -1
- package/dist/src/core/detect/stack.js.map +0 -1
- package/dist/src/core/detect/workspaces.js.map +0 -1
- package/dist/src/core/errors.js.map +0 -1
- package/dist/src/core/findings/dedup.js.map +0 -1
- package/dist/src/core/findings/types.js.map +0 -1
- package/dist/src/core/fix/generator.js.map +0 -1
- package/dist/src/core/git/diff-hunks.js.map +0 -1
- package/dist/src/core/git/touched-files.js.map +0 -1
- package/dist/src/core/ignore/index.js.map +0 -1
- package/dist/src/core/index.js.map +0 -1
- package/dist/src/core/logging/ndjson-writer.js.map +0 -1
- package/dist/src/core/logging/redaction.js.map +0 -1
- package/dist/src/core/mcp/concurrency.js.map +0 -1
- package/dist/src/core/mcp/handlers/fix-finding.js.map +0 -1
- package/dist/src/core/mcp/handlers/get-capabilities.js.map +0 -1
- package/dist/src/core/mcp/handlers/get-findings.js.map +0 -1
- package/dist/src/core/mcp/handlers/review-diff.js.map +0 -1
- package/dist/src/core/mcp/handlers/scan-files.js.map +0 -1
- package/dist/src/core/mcp/handlers/validate-fix.js.map +0 -1
- package/dist/src/core/mcp/run-store.js.map +0 -1
- package/dist/src/core/mcp/workspace.js.map +0 -1
- package/dist/src/core/persist/baseline.js.map +0 -1
- package/dist/src/core/persist/cost-log.js.map +0 -1
- package/dist/src/core/persist/findings-cache.js.map +0 -1
- package/dist/src/core/persist/triage.js.map +0 -1
- package/dist/src/core/phases/static-rules.js.map +0 -1
- package/dist/src/core/phases/tests.js.map +0 -1
- package/dist/src/core/pipeline/review-phase.js.map +0 -1
- package/dist/src/core/pipeline/run.js.map +0 -1
- package/dist/src/core/runtime/idempotency.js.map +0 -1
- package/dist/src/core/runtime/lock.js.map +0 -1
- package/dist/src/core/runtime/state.js.map +0 -1
- package/dist/src/core/schema-alignment/detector.js.map +0 -1
- package/dist/src/core/schema-alignment/extractor/index.js.map +0 -1
- package/dist/src/core/schema-alignment/extractor/prisma.js.map +0 -1
- package/dist/src/core/schema-alignment/extractor/sql.js.map +0 -1
- package/dist/src/core/schema-alignment/llm-check.js.map +0 -1
- package/dist/src/core/schema-alignment/scanner.js.map +0 -1
- package/dist/src/core/schema-alignment/types.js.map +0 -1
- package/dist/src/core/shell.js.map +0 -1
- package/dist/src/core/static-rules/registry.js.map +0 -1
- package/dist/src/core/static-rules/rules/brand-tokens.js.map +0 -1
- package/dist/src/core/static-rules/rules/console-log.js.map +0 -1
- package/dist/src/core/static-rules/rules/hardcoded-secrets.js.map +0 -1
- package/dist/src/core/static-rules/rules/insecure-redirect.js.map +0 -1
- package/dist/src/core/static-rules/rules/large-file.js.map +0 -1
- package/dist/src/core/static-rules/rules/missing-auth.js.map +0 -1
- package/dist/src/core/static-rules/rules/missing-tests.js.map +0 -1
- package/dist/src/core/static-rules/rules/npm-audit.js.map +0 -1
- package/dist/src/core/static-rules/rules/package-lock-sync.js.map +0 -1
- package/dist/src/core/static-rules/rules/schema-alignment.js.map +0 -1
- package/dist/src/core/static-rules/rules/sql-injection.js.map +0 -1
- package/dist/src/core/static-rules/rules/ssrf.js.map +0 -1
- package/dist/src/core/static-rules/rules/todo-fixme.js.map +0 -1
- package/dist/src/core/static-rules/tailwind-extractor.js.map +0 -1
- package/dist/src/core/test-gen/coverage-analyzer.js.map +0 -1
- package/dist/src/core/test-gen/framework-detector.js.map +0 -1
- package/dist/src/core/test-gen/test-writer.js.map +0 -1
- package/dist/src/core/ui/design-context-loader.js.map +0 -1
- package/dist/src/core/worker/client.js.map +0 -1
- package/dist/src/core/worker/lockfile.js.map +0 -1
- package/dist/src/core/worker/server.js.map +0 -1
- package/dist/src/formatters/github-annotations.js.map +0 -1
- package/dist/src/formatters/index.js.map +0 -1
- package/dist/src/formatters/junit.js.map +0 -1
- package/dist/src/formatters/sarif.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/src/adapters/base.ts +0 -19
- package/src/adapters/council/claude.ts +0 -41
- package/src/adapters/council/openai.ts +0 -40
- package/src/adapters/council/types.ts +0 -7
- package/src/adapters/loader.ts +0 -108
- package/src/adapters/migration-runner/supabase.ts +0 -56
- package/src/adapters/migration-runner/types.ts +0 -36
- package/src/adapters/review-bot-parser/cursor.ts +0 -13
- package/src/adapters/review-bot-parser/declarative-base.ts +0 -64
- package/src/adapters/review-engine/auto.ts +0 -94
- package/src/adapters/review-engine/claude.ts +0 -100
- package/src/adapters/review-engine/codex.ts +0 -82
- package/src/adapters/review-engine/gemini.ts +0 -105
- package/src/adapters/review-engine/openai-compatible.ts +0 -100
- package/src/adapters/review-engine/parse-output.ts +0 -74
- package/src/adapters/review-engine/prompt-builder.ts +0 -19
- package/src/adapters/review-engine/types.ts +0 -19
- package/src/adapters/vcs-host/commit-status.ts +0 -39
- package/src/adapters/vcs-host/github.ts +0 -77
- package/src/adapters/vcs-host/types.ts +0 -44
- package/src/cli/autoregress-bridge.ts +0 -30
- package/src/cli/baseline.ts +0 -125
- package/src/cli/ci.ts +0 -45
- package/src/cli/costs.ts +0 -80
- package/src/cli/council.ts +0 -96
- package/src/cli/detector.ts +0 -92
- package/src/cli/explain.ts +0 -197
- package/src/cli/fix.ts +0 -249
- package/src/cli/hook.ts +0 -124
- package/src/cli/ignore-helper.ts +0 -116
- package/src/cli/index.ts +0 -612
- package/src/cli/lsp.ts +0 -200
- package/src/cli/mcp.ts +0 -206
- package/src/cli/migrate-v4.ts +0 -388
- package/src/cli/pr-comment.ts +0 -139
- package/src/cli/pr-desc.ts +0 -168
- package/src/cli/pr-review-comments.ts +0 -92
- package/src/cli/pr.ts +0 -76
- package/src/cli/preflight.ts +0 -235
- package/src/cli/report.ts +0 -186
- package/src/cli/run.ts +0 -425
- package/src/cli/scan.ts +0 -233
- package/src/cli/setup.ts +0 -191
- package/src/cli/test-gen.ts +0 -125
- package/src/cli/triage.ts +0 -137
- package/src/cli/watch.ts +0 -190
- package/src/cli/worker.ts +0 -109
- package/src/core/.gitkeep +0 -0
- package/src/core/cache/cached-engine.ts +0 -32
- package/src/core/cache/review-cache.ts +0 -70
- package/src/core/chunking/index.ts +0 -113
- package/src/core/chunking/risk-ranker.ts +0 -56
- package/src/core/config/loader.ts +0 -53
- package/src/core/config/preset-resolver.ts +0 -46
- package/src/core/config/schema.ts +0 -181
- package/src/core/config/types.ts +0 -98
- package/src/core/council/config.ts +0 -71
- package/src/core/council/context.ts +0 -17
- package/src/core/council/runner.ts +0 -83
- package/src/core/council/types.ts +0 -45
- package/src/core/detect/git-context.ts +0 -27
- package/src/core/detect/llm-key.ts +0 -89
- package/src/core/detect/protected-paths.ts +0 -63
- package/src/core/detect/provider-usage.ts +0 -74
- package/src/core/detect/stack.ts +0 -153
- package/src/core/detect/workspaces.ts +0 -103
- package/src/core/errors.ts +0 -37
- package/src/core/findings/dedup.ts +0 -14
- package/src/core/findings/types.ts +0 -39
- package/src/core/fix/generator.ts +0 -149
- package/src/core/git/diff-hunks.ts +0 -86
- package/src/core/git/touched-files.ts +0 -73
- package/src/core/ignore/index.ts +0 -54
- package/src/core/index.ts +0 -1
- package/src/core/logging/ndjson-writer.ts +0 -37
- package/src/core/logging/redaction.ts +0 -19
- package/src/core/mcp/concurrency.ts +0 -16
- package/src/core/mcp/handlers/fix-finding.ts +0 -126
- package/src/core/mcp/handlers/get-capabilities.ts +0 -62
- package/src/core/mcp/handlers/get-findings.ts +0 -36
- package/src/core/mcp/handlers/review-diff.ts +0 -65
- package/src/core/mcp/handlers/scan-files.ts +0 -65
- package/src/core/mcp/handlers/validate-fix.ts +0 -41
- package/src/core/mcp/run-store.ts +0 -85
- package/src/core/mcp/workspace.ts +0 -35
- package/src/core/persist/baseline.ts +0 -112
- package/src/core/persist/cost-log.ts +0 -30
- package/src/core/persist/findings-cache.ts +0 -43
- package/src/core/persist/triage.ts +0 -112
- package/src/core/phases/static-rules.ts +0 -93
- package/src/core/phases/tests.ts +0 -51
- package/src/core/pipeline/review-phase.ts +0 -182
- package/src/core/pipeline/run.ts +0 -116
- package/src/core/runtime/idempotency.ts +0 -6
- package/src/core/runtime/lock.ts +0 -29
- package/src/core/runtime/state.ts +0 -97
- package/src/core/schema-alignment/detector.ts +0 -59
- package/src/core/schema-alignment/extractor/index.ts +0 -24
- package/src/core/schema-alignment/extractor/prisma.ts +0 -21
- package/src/core/schema-alignment/extractor/sql.ts +0 -99
- package/src/core/schema-alignment/llm-check.ts +0 -91
- package/src/core/schema-alignment/scanner.ts +0 -107
- package/src/core/schema-alignment/types.ts +0 -43
- package/src/core/shell.ts +0 -48
- package/src/core/static-rules/registry.ts +0 -59
- package/src/core/static-rules/rules/brand-tokens.ts +0 -145
- package/src/core/static-rules/rules/console-log.ts +0 -42
- package/src/core/static-rules/rules/hardcoded-secrets.ts +0 -83
- package/src/core/static-rules/rules/insecure-redirect.ts +0 -67
- package/src/core/static-rules/rules/large-file.ts +0 -37
- package/src/core/static-rules/rules/missing-auth.ts +0 -70
- package/src/core/static-rules/rules/missing-tests.ts +0 -57
- package/src/core/static-rules/rules/npm-audit.ts +0 -38
- package/src/core/static-rules/rules/package-lock-sync.ts +0 -54
- package/src/core/static-rules/rules/schema-alignment.ts +0 -132
- package/src/core/static-rules/rules/sql-injection.ts +0 -71
- package/src/core/static-rules/rules/ssrf.ts +0 -63
- package/src/core/static-rules/rules/todo-fixme.ts +0 -40
- package/src/core/static-rules/tailwind-extractor.ts +0 -38
- package/src/core/test-gen/coverage-analyzer.ts +0 -93
- package/src/core/test-gen/framework-detector.ts +0 -21
- package/src/core/test-gen/test-writer.ts +0 -33
- package/src/core/ui/design-context-loader.ts +0 -87
- package/src/core/worker/client.ts +0 -46
- package/src/core/worker/lockfile.ts +0 -38
- package/src/core/worker/server.ts +0 -81
- package/src/formatters/github-annotations.ts +0 -36
- package/src/formatters/junit.ts +0 -52
- package/src/formatters/sarif.ts +0 -103
package/src/cli/index.ts
DELETED
|
@@ -1,612 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* guardrail CLI — entry point
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* guardrail run review git-changed files
|
|
7
|
-
* guardrail scan src/auth/ review any path (no git required)
|
|
8
|
-
* guardrail scan --ask "..." ask a targeted question about code
|
|
9
|
-
* guardrail ci opinionated CI entrypoint
|
|
10
|
-
* guardrail watch re-run on every file save
|
|
11
|
-
* guardrail doctor check prerequisites
|
|
12
|
-
*/
|
|
13
|
-
import { runCommand } from './run.ts';
|
|
14
|
-
import { runWatch } from './watch.ts';
|
|
15
|
-
import { runSetup } from './setup.ts';
|
|
16
|
-
import { runDoctor } from './preflight.ts';
|
|
17
|
-
import { runCi } from './ci.ts';
|
|
18
|
-
import { runFix } from './fix.ts';
|
|
19
|
-
import { runScan } from './scan.ts';
|
|
20
|
-
import { runReport } from './report.ts';
|
|
21
|
-
import { runExplain } from './explain.ts';
|
|
22
|
-
import { runIgnore } from './ignore-helper.ts';
|
|
23
|
-
import { runPr } from './pr.ts';
|
|
24
|
-
import { runBaseline } from './baseline.ts';
|
|
25
|
-
import { runTriage } from './triage.ts';
|
|
26
|
-
import { runLsp } from './lsp.ts';
|
|
27
|
-
import { runWorker } from './worker.ts';
|
|
28
|
-
import { runTestGen } from './test-gen.ts';
|
|
29
|
-
import { runCouncilCmd } from './council.ts';
|
|
30
|
-
import { runMigrateV4 } from './migrate-v4.ts';
|
|
31
|
-
import { findPackageRoot } from './_pkg-root.ts';
|
|
32
|
-
|
|
33
|
-
const args = process.argv.slice(2);
|
|
34
|
-
|
|
35
|
-
// Version flag — read package.json via the shared package-root helper. Works
|
|
36
|
-
// under both source (src/cli/index.ts) and compiled (dist/src/cli/index.js)
|
|
37
|
-
// layouts since findPackageRoot walks up to the canonical package root.
|
|
38
|
-
if (args[0] === '--version' || args[0] === '-v') {
|
|
39
|
-
const root = findPackageRoot(import.meta.url);
|
|
40
|
-
if (root) {
|
|
41
|
-
const nodeFs = await import('node:fs');
|
|
42
|
-
const nodePath = await import('node:path');
|
|
43
|
-
const pkg = JSON.parse(nodeFs.readFileSync(nodePath.join(root, 'package.json'), 'utf8')) as { version: string };
|
|
44
|
-
console.log(pkg.version);
|
|
45
|
-
} else {
|
|
46
|
-
console.log('unknown');
|
|
47
|
-
}
|
|
48
|
-
process.exit(0);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Help flag — route to help handler explicitly before subcommand defaulting.
|
|
52
|
-
// Without this, `--help` falls through the "args[0].startsWith('--')" check below
|
|
53
|
-
// and defaults to `run`, which is surprising and a v4 regression we preserve no longer.
|
|
54
|
-
if (args[0] === '--help' || args[0] === '-h') {
|
|
55
|
-
args.unshift('help');
|
|
56
|
-
args.splice(1, 1); // remove the original --help/-h token
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Verb grouping (new in alpha.2): `claude-autopilot review <verb>` and
|
|
60
|
-
// `claude-autopilot advanced <verb>` are dispatcher prefixes that route to the
|
|
61
|
-
// same flat handlers. Legacy flat invocation (`claude-autopilot run`) is unchanged
|
|
62
|
-
// — the grouped form is purely additive.
|
|
63
|
-
//
|
|
64
|
-
// Scope gates enforce that only the documented verb sets work under each prefix,
|
|
65
|
-
// so `claude-autopilot review doctor` is rejected with a clear error instead of
|
|
66
|
-
// silently routing to the doctor handler (which would confuse the mental model).
|
|
67
|
-
const REVIEW_VERBS = new Set(['run', 'scan', 'ci', 'fix', 'baseline', 'explain', 'watch', 'report']);
|
|
68
|
-
// `detector` is a library used by setup/run, not a CLI subcommand — leave it out.
|
|
69
|
-
const ADVANCED_VERBS = new Set(['lsp', 'mcp', 'worker', 'autoregress', 'test-gen', 'hook', 'ignore']);
|
|
70
|
-
if (args[0] === 'review') {
|
|
71
|
-
const sub = args[1];
|
|
72
|
-
if (!sub || sub === '--help' || sub === '-h') {
|
|
73
|
-
console.log(`
|
|
74
|
-
Usage: claude-autopilot review <verb> [options]
|
|
75
|
-
|
|
76
|
-
Review-phase verbs:
|
|
77
|
-
run Review git-changed files (default)
|
|
78
|
-
scan Review any path — no git required
|
|
79
|
-
ci Opinionated CI entrypoint (post comments + SARIF)
|
|
80
|
-
fix Auto-fix cached findings using the configured LLM
|
|
81
|
-
baseline Manage the committed findings baseline
|
|
82
|
-
explain Deep-dive explanation + remediation for a specific finding
|
|
83
|
-
watch Watch for file changes and re-run on each save
|
|
84
|
-
report Render cached findings as a markdown report
|
|
85
|
-
|
|
86
|
-
These are aliases for the flat subcommands — \`claude-autopilot run\` and
|
|
87
|
-
\`claude-autopilot review run\` are equivalent.
|
|
88
|
-
`);
|
|
89
|
-
process.exit(0);
|
|
90
|
-
}
|
|
91
|
-
if (!REVIEW_VERBS.has(sub)) {
|
|
92
|
-
console.error(`\x1b[31m[claude-autopilot] "${sub}" is not a review-phase verb.\x1b[0m`);
|
|
93
|
-
console.error(`\x1b[2m Valid: ${[...REVIEW_VERBS].join(', ')}\x1b[0m`);
|
|
94
|
-
console.error(`\x1b[2m Did you mean: claude-autopilot ${sub} ...?\x1b[0m`);
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
97
|
-
args.shift(); // drop 'review', leave the flat subcommand at args[0]
|
|
98
|
-
}
|
|
99
|
-
if (args[0] === 'advanced') {
|
|
100
|
-
const sub = args[1];
|
|
101
|
-
if (!sub || sub === '--help' || sub === '-h') {
|
|
102
|
-
console.log(`
|
|
103
|
-
Usage: claude-autopilot advanced <verb> [options]
|
|
104
|
-
|
|
105
|
-
Advanced / niche verbs (hidden from top-level --help to keep it readable):
|
|
106
|
-
lsp Language server — publishes findings as LSP diagnostics
|
|
107
|
-
mcp MCP server for Claude / ChatGPT integration
|
|
108
|
-
worker Persistent review daemon (start|stop|status)
|
|
109
|
-
autoregress Snapshot regression tests
|
|
110
|
-
test-gen Generate test cases for uncovered exports
|
|
111
|
-
hook Install / remove the pre-push git hook
|
|
112
|
-
ignore Edit the findings ignore list
|
|
113
|
-
|
|
114
|
-
These are aliases for the flat subcommands; they still work without the 'advanced' prefix.
|
|
115
|
-
`);
|
|
116
|
-
process.exit(0);
|
|
117
|
-
}
|
|
118
|
-
if (!ADVANCED_VERBS.has(sub)) {
|
|
119
|
-
console.error(`\x1b[31m[claude-autopilot] "${sub}" is not an advanced verb.\x1b[0m`);
|
|
120
|
-
console.error(`\x1b[2m Valid: ${[...ADVANCED_VERBS].join(', ')}\x1b[0m`);
|
|
121
|
-
process.exit(1);
|
|
122
|
-
}
|
|
123
|
-
args.shift(); // drop 'advanced'
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const SUBCOMMANDS = ['init', 'run', 'scan', 'report', 'explain', 'ignore', 'ci', 'pr', 'fix', 'costs', 'watch', 'hook', 'autoregress', 'baseline', 'triage', 'lsp', 'worker', 'mcp', 'test-gen', 'pr-desc', 'doctor', 'preflight', 'setup', 'council', 'migrate-v4', 'brainstorm', 'help', '--help', '-h'] as const;
|
|
127
|
-
const VALUE_FLAGS = ['base', 'config', 'files', 'format', 'output', 'debounce', 'ask', 'focus', 'fail-on', 'note', 'reason', 'expires', 'profile', 'severity', 'prompt', 'context-file', 'path'];
|
|
128
|
-
|
|
129
|
-
// Bare invocation — no subcommand, no flags → show welcome guide
|
|
130
|
-
if (args.length === 0) {
|
|
131
|
-
const hasKey = !!(process.env.ANTHROPIC_API_KEY || process.env.GEMINI_API_KEY ||
|
|
132
|
-
process.env.GOOGLE_API_KEY || process.env.OPENAI_API_KEY || process.env.GROQ_API_KEY);
|
|
133
|
-
const keyLine = hasKey
|
|
134
|
-
? '\x1b[32m✓\x1b[0m LLM API key detected'
|
|
135
|
-
: '\x1b[33m!\x1b[0m No LLM API key found — set one of:\n ANTHROPIC_API_KEY https://console.anthropic.com/\n OPENAI_API_KEY https://platform.openai.com/api-keys\n GEMINI_API_KEY https://aistudio.google.com/app/apikey\n GROQ_API_KEY https://console.groq.com/keys (fast free tier)';
|
|
136
|
-
console.log(`
|
|
137
|
-
\x1b[1m@delegance/claude-autopilot\x1b[0m — Autonomous dev pipeline for Claude Code
|
|
138
|
-
\x1b[2m(brainstorm → spec → plan → implement → migrate → validate → PR → review)\x1b[0m
|
|
139
|
-
|
|
140
|
-
${keyLine}
|
|
141
|
-
|
|
142
|
-
\x1b[1mQuick start — full pipeline:\x1b[0m
|
|
143
|
-
|
|
144
|
-
\x1b[36mclaude-autopilot brainstorm "add SSO for enterprise tenants"\x1b[0m
|
|
145
|
-
Turn an idea into a reviewed spec, then auto-implement end-to-end.
|
|
146
|
-
|
|
147
|
-
\x1b[1mOr just the review phase (v4 compatible):\x1b[0m
|
|
148
|
-
|
|
149
|
-
\x1b[36mclaude-autopilot run --base main\x1b[0m Review files changed vs main
|
|
150
|
-
\x1b[36mclaude-autopilot scan src/auth/\x1b[0m Scan any path (no git required)
|
|
151
|
-
\x1b[36mclaude-autopilot scan --ask "SQL injection?" src/db/\x1b[0m
|
|
152
|
-
\x1b[36mclaude-autopilot fix\x1b[0m Auto-fix cached findings
|
|
153
|
-
\x1b[36mclaude-autopilot migrate-v4\x1b[0m Codemod: migrate v4 config / CI / hooks
|
|
154
|
-
|
|
155
|
-
\x1b[1mSetup:\x1b[0m
|
|
156
|
-
|
|
157
|
-
\x1b[36mclaude-autopilot setup\x1b[0m Auto-detect stack, write config, install hook
|
|
158
|
-
\x1b[36mclaude-autopilot doctor\x1b[0m Check prerequisites
|
|
159
|
-
|
|
160
|
-
Run \x1b[36mclaude-autopilot --help\x1b[0m for full command reference.
|
|
161
|
-
`);
|
|
162
|
-
process.exit(0);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Detect first non-flag arg as subcommand, default to 'run'
|
|
166
|
-
const subcommand = (args[0] && !args[0].startsWith('--')) ? args[0] : 'run';
|
|
167
|
-
|
|
168
|
-
/** Returns value for --name <value>. Exits if value is missing (next token is another flag or absent). */
|
|
169
|
-
function flag(name: string): string | undefined {
|
|
170
|
-
const idx = args.indexOf(`--${name}`);
|
|
171
|
-
if (idx < 0) return undefined;
|
|
172
|
-
const val = args[idx + 1];
|
|
173
|
-
if (val === undefined || val.startsWith('--')) {
|
|
174
|
-
console.error(`\x1b[31m[claude-autopilot] --${name} requires a value\x1b[0m`);
|
|
175
|
-
process.exit(1);
|
|
176
|
-
}
|
|
177
|
-
return val;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function boolFlag(name: string): boolean {
|
|
181
|
-
return args.includes(`--${name}`);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function printUsage(): void {
|
|
185
|
-
console.log(`
|
|
186
|
-
Usage: claude-autopilot <command> [options] (legacy alias: guardrail)
|
|
187
|
-
|
|
188
|
-
Commands:
|
|
189
|
-
run Review git-changed files (default)
|
|
190
|
-
scan Review any path — no git required
|
|
191
|
-
report Render cached findings as a markdown report
|
|
192
|
-
explain Deep-dive explanation + remediation for a specific finding
|
|
193
|
-
ignore Interactively add findings to .guardrail-ignore
|
|
194
|
-
watch Watch for file changes and re-run on each save
|
|
195
|
-
pr Review a specific PR by number (auto-detects if on PR branch)
|
|
196
|
-
fix Auto-fix cached findings using the configured LLM
|
|
197
|
-
costs Show per-run cost summary
|
|
198
|
-
ci Opinionated CI entrypoint (post comments + SARIF)
|
|
199
|
-
init Scaffold guardrail.config.yaml from a preset
|
|
200
|
-
setup Auto-detect stack, write config, install pre-push hook
|
|
201
|
-
doctor Check prerequisites (alias: preflight)
|
|
202
|
-
preflight Check prerequisites (alias: doctor)
|
|
203
|
-
hook Install / remove the pre-push git hook
|
|
204
|
-
baseline Manage the committed findings baseline (create|update|show|delete)
|
|
205
|
-
triage Mark individual findings as accepted/dismissed
|
|
206
|
-
pr-desc Generate a PR title / summary / test plan from the current diff
|
|
207
|
-
council Multi-model review — dispatch the diff to N models and synthesize consensus
|
|
208
|
-
mcp MCP server for Claude / ChatGPT integration
|
|
209
|
-
autoregress Snapshot regression tests (run|diff|update|generate)
|
|
210
|
-
lsp Language server — publishes findings as LSP diagnostics (stdin/stdout)
|
|
211
|
-
worker Persistent review daemon for multi-terminal parallel usage (start|stop|status)
|
|
212
|
-
test-gen Detect uncovered exports and generate test cases using the LLM
|
|
213
|
-
|
|
214
|
-
Options (run):
|
|
215
|
-
--base <ref> Git base ref for diff (default: HEAD~1)
|
|
216
|
-
--config <path> Path to config file (default: ./guardrail.config.yaml)
|
|
217
|
-
--files <a,b,c> Explicit comma-separated file list (skips git detection)
|
|
218
|
-
--dry-run Show what would run without executing
|
|
219
|
-
--diff Send git diff hunks instead of full files (~70% fewer tokens)
|
|
220
|
-
--delta Only report findings new since last run (suppress pre-existing)
|
|
221
|
-
--inline-comments Post per-line review comments on the PR diff
|
|
222
|
-
--post-comments Post/update a summary comment on the open PR
|
|
223
|
-
--format <text|sarif> Output format (default: text)
|
|
224
|
-
--output <path> Output file path (required with --format sarif)
|
|
225
|
-
|
|
226
|
-
Options (scan):
|
|
227
|
-
<path> [path...] Files or directories to scan (or --all for entire codebase)
|
|
228
|
-
--all Scan entire codebase
|
|
229
|
-
--ask <question> Targeted question to inject into the LLM review prompt
|
|
230
|
-
--focus <type> security | logic | performance (default: all)
|
|
231
|
-
--dry-run List files that would be scanned without running
|
|
232
|
-
--config <path> Path to config file
|
|
233
|
-
|
|
234
|
-
Options (pr):
|
|
235
|
-
<number> PR number to review (optional if on a PR branch)
|
|
236
|
-
--no-post-comments Skip posting/updating PR summary comment
|
|
237
|
-
--no-inline-comments Skip posting per-line inline annotations
|
|
238
|
-
--config <path> Path to config file
|
|
239
|
-
|
|
240
|
-
Options (fix):
|
|
241
|
-
--severity <critical|warning|all> Which findings to fix (default: critical)
|
|
242
|
-
--dry-run Preview fixes without writing files
|
|
243
|
-
--config <path> Path to config file
|
|
244
|
-
|
|
245
|
-
Options (watch):
|
|
246
|
-
--config <path> Path to config file (default: ./guardrail.config.yaml)
|
|
247
|
-
--debounce <ms> Debounce delay in ms (default: 300)
|
|
248
|
-
|
|
249
|
-
Options (autoregress):
|
|
250
|
-
--all Run/diff all snapshots
|
|
251
|
-
--since <ref> Git ref for changed-files detection
|
|
252
|
-
--snapshot <slug> Target a single snapshot
|
|
253
|
-
--files <a,b,c> Explicit file list for generate (skips git detection)
|
|
254
|
-
`);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
switch (subcommand) {
|
|
258
|
-
case 'scan': {
|
|
259
|
-
const config = flag('config');
|
|
260
|
-
const ask = flag('ask');
|
|
261
|
-
const focusArg = flag('focus');
|
|
262
|
-
if (focusArg && !['security', 'logic', 'performance', 'brand', 'all'].includes(focusArg)) {
|
|
263
|
-
console.error(`\x1b[31m[claude-autopilot] --focus must be "security", "logic", "performance", or "all"\x1b[0m`);
|
|
264
|
-
process.exit(1);
|
|
265
|
-
}
|
|
266
|
-
const dryRun = boolFlag('dry-run');
|
|
267
|
-
const all = boolFlag('all');
|
|
268
|
-
// Remaining non-flag args after 'scan' are paths
|
|
269
|
-
const targets = args.slice(1).filter(a => !a.startsWith('--') && a !== ask && a !== focusArg && a !== config);
|
|
270
|
-
const code = await runScan({
|
|
271
|
-
configPath: config,
|
|
272
|
-
targets: targets.length > 0 ? targets : undefined,
|
|
273
|
-
all,
|
|
274
|
-
ask,
|
|
275
|
-
focus: focusArg as 'security' | 'logic' | 'performance' | 'brand' | 'all' | undefined,
|
|
276
|
-
dryRun,
|
|
277
|
-
});
|
|
278
|
-
process.exit(code);
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
case 'init': {
|
|
283
|
-
console.log('\x1b[33m[init] guardrail init is deprecated — use: npx guardrail setup\x1b[0m\n');
|
|
284
|
-
const force = args.includes('--force');
|
|
285
|
-
await runSetup({ force });
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
case 'doctor':
|
|
290
|
-
case 'preflight': {
|
|
291
|
-
const result = await runDoctor();
|
|
292
|
-
process.exit(result.blockers > 0 ? 1 : 0);
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
case 'help':
|
|
297
|
-
case '--help':
|
|
298
|
-
case '-h':
|
|
299
|
-
printUsage();
|
|
300
|
-
break;
|
|
301
|
-
|
|
302
|
-
case 'watch': {
|
|
303
|
-
const config = flag('config');
|
|
304
|
-
const debounceArg = flag('debounce');
|
|
305
|
-
const debounceMs = debounceArg ? parseInt(debounceArg, 10) : undefined;
|
|
306
|
-
if (debounceArg && (isNaN(debounceMs!) || debounceMs! < 0)) {
|
|
307
|
-
console.error(`\x1b[31m[claude-autopilot] --debounce must be a non-negative integer\x1b[0m`);
|
|
308
|
-
process.exit(1);
|
|
309
|
-
}
|
|
310
|
-
await runWatch({ configPath: config, debounceMs });
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
case 'run': {
|
|
315
|
-
const base = flag('base');
|
|
316
|
-
const config = flag('config');
|
|
317
|
-
const filesArg = flag('files');
|
|
318
|
-
const dryRun = boolFlag('dry-run');
|
|
319
|
-
const diff = boolFlag('diff');
|
|
320
|
-
const delta = boolFlag('delta');
|
|
321
|
-
const staticOnly = args.includes('--static-only');
|
|
322
|
-
const inlineComments = boolFlag('inline-comments');
|
|
323
|
-
const postComments = boolFlag('post-comments');
|
|
324
|
-
const formatArg = flag('format');
|
|
325
|
-
const outputPath = flag('output');
|
|
326
|
-
|
|
327
|
-
if (formatArg && formatArg !== 'text' && formatArg !== 'sarif' && formatArg !== 'junit') {
|
|
328
|
-
console.error(`\x1b[31m[claude-autopilot] --format must be "text", "sarif", or "junit"\x1b[0m`);
|
|
329
|
-
process.exit(1);
|
|
330
|
-
}
|
|
331
|
-
if ((formatArg === 'sarif' || formatArg === 'junit') && !outputPath) {
|
|
332
|
-
console.error(`\x1b[31m[claude-autopilot] --format ${formatArg} requires --output <path>\x1b[0m`);
|
|
333
|
-
process.exit(1);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const failOnArg = flag('fail-on');
|
|
337
|
-
if (failOnArg && !['critical', 'warning', 'note', 'none'].includes(failOnArg)) {
|
|
338
|
-
console.error(`\x1b[31m[claude-autopilot] --fail-on must be "critical", "warning", "note", or "none"\x1b[0m`);
|
|
339
|
-
process.exit(1);
|
|
340
|
-
}
|
|
341
|
-
const newOnly = boolFlag('new-only');
|
|
342
|
-
|
|
343
|
-
const code = await runCommand({
|
|
344
|
-
base,
|
|
345
|
-
configPath: config,
|
|
346
|
-
files: filesArg ? filesArg.split(',').map(f => f.trim()) : undefined,
|
|
347
|
-
dryRun,
|
|
348
|
-
diff,
|
|
349
|
-
delta,
|
|
350
|
-
newOnly,
|
|
351
|
-
failOn: failOnArg as 'critical' | 'warning' | 'note' | 'none' | undefined,
|
|
352
|
-
inlineComments,
|
|
353
|
-
postComments,
|
|
354
|
-
format: formatArg as 'text' | 'sarif' | 'junit' | undefined,
|
|
355
|
-
outputPath,
|
|
356
|
-
skipReview: staticOnly,
|
|
357
|
-
});
|
|
358
|
-
process.exit(code);
|
|
359
|
-
break;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
case 'ci': {
|
|
363
|
-
const base = flag('base');
|
|
364
|
-
const config = flag('config');
|
|
365
|
-
const outputPath = flag('output');
|
|
366
|
-
const noPostComments = boolFlag('no-post-comments');
|
|
367
|
-
const noInlineComments = boolFlag('no-inline-comments');
|
|
368
|
-
const diff = boolFlag('diff');
|
|
369
|
-
const newOnly = boolFlag('new-only');
|
|
370
|
-
const failOnArg = flag('fail-on');
|
|
371
|
-
const code = await runCi({
|
|
372
|
-
configPath: config,
|
|
373
|
-
base,
|
|
374
|
-
sarifOutput: outputPath,
|
|
375
|
-
postComments: noPostComments ? false : undefined,
|
|
376
|
-
inlineComments: noInlineComments ? false : undefined,
|
|
377
|
-
diff,
|
|
378
|
-
newOnly,
|
|
379
|
-
failOn: failOnArg as 'critical' | 'warning' | 'note' | 'none' | undefined,
|
|
380
|
-
});
|
|
381
|
-
process.exit(code);
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
case 'baseline': {
|
|
386
|
-
const { runBaseline: rb } = await import('./baseline.ts');
|
|
387
|
-
const sub = args[1] ?? 'show';
|
|
388
|
-
const note = flag('note');
|
|
389
|
-
const config = flag('config');
|
|
390
|
-
const code = await rb(sub, { cwd: process.cwd(), note, baselinePath: config });
|
|
391
|
-
process.exit(code);
|
|
392
|
-
break;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
case 'pr': {
|
|
396
|
-
const config = flag('config');
|
|
397
|
-
const noPostComments = boolFlag('no-post-comments');
|
|
398
|
-
const noInlineComments = boolFlag('no-inline-comments');
|
|
399
|
-
const prNumber = args.slice(1).find(a => !a.startsWith('--') && /^\d+$/.test(a));
|
|
400
|
-
const code = await runPr({
|
|
401
|
-
configPath: config,
|
|
402
|
-
prNumber,
|
|
403
|
-
noPostComments,
|
|
404
|
-
noInlineComments,
|
|
405
|
-
});
|
|
406
|
-
process.exit(code);
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
case 'hook': {
|
|
411
|
-
const { runHook } = await import('./hook.ts');
|
|
412
|
-
const hookSub = args[1] ?? 'status';
|
|
413
|
-
const force = boolFlag('force');
|
|
414
|
-
const code = await runHook(hookSub, {
|
|
415
|
-
force,
|
|
416
|
-
preCommitOnly: args.includes('--pre-commit-only'),
|
|
417
|
-
prePushOnly: args.includes('--pre-push-only'),
|
|
418
|
-
});
|
|
419
|
-
process.exit(code);
|
|
420
|
-
break;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
case 'autoregress': {
|
|
424
|
-
const { runAutoregress } = await import('./autoregress-bridge.ts');
|
|
425
|
-
const code = runAutoregress(args.slice(1));
|
|
426
|
-
process.exit(code);
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
case 'fix': {
|
|
431
|
-
const config = flag('config');
|
|
432
|
-
const severityArg = flag('severity');
|
|
433
|
-
if (severityArg && !['critical', 'warning', 'all'].includes(severityArg)) {
|
|
434
|
-
console.error(`\x1b[31m[claude-autopilot] --severity must be "critical", "warning", or "all"\x1b[0m`);
|
|
435
|
-
process.exit(1);
|
|
436
|
-
}
|
|
437
|
-
const dryRun = boolFlag('dry-run');
|
|
438
|
-
const noVerify = boolFlag('no-verify');
|
|
439
|
-
const code = await runFix({
|
|
440
|
-
configPath: config,
|
|
441
|
-
severity: severityArg as 'critical' | 'warning' | 'all' | undefined,
|
|
442
|
-
dryRun,
|
|
443
|
-
noVerify,
|
|
444
|
-
});
|
|
445
|
-
process.exit(code);
|
|
446
|
-
break;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
case 'triage': {
|
|
450
|
-
const sub = args[1];
|
|
451
|
-
const rest = args.slice(2);
|
|
452
|
-
const code = await runTriage(sub, rest);
|
|
453
|
-
process.exit(code);
|
|
454
|
-
break;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
case 'test-gen': {
|
|
458
|
-
const config = flag('config');
|
|
459
|
-
const base = flag('base');
|
|
460
|
-
const dryRun = boolFlag('dry-run');
|
|
461
|
-
const verify = boolFlag('verify');
|
|
462
|
-
const targets = args.slice(1).filter(a => !a.startsWith('--') && a !== config && a !== base);
|
|
463
|
-
const code = await runTestGen({
|
|
464
|
-
cwd: process.cwd(),
|
|
465
|
-
configPath: config,
|
|
466
|
-
targets: targets.length > 0 ? targets : undefined,
|
|
467
|
-
base,
|
|
468
|
-
dryRun,
|
|
469
|
-
verify,
|
|
470
|
-
});
|
|
471
|
-
process.exit(code);
|
|
472
|
-
break;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
case 'pr-desc': {
|
|
476
|
-
const { runPrDesc } = await import('./pr-desc.ts');
|
|
477
|
-
const baseIdx = args.indexOf('--base');
|
|
478
|
-
const base = baseIdx !== -1 ? args[baseIdx + 1] : undefined;
|
|
479
|
-
const outputIdx = args.indexOf('--output');
|
|
480
|
-
const output = outputIdx !== -1 ? args[outputIdx + 1] : undefined;
|
|
481
|
-
await runPrDesc({
|
|
482
|
-
base,
|
|
483
|
-
post: args.includes('--post'),
|
|
484
|
-
yes: args.includes('--yes'),
|
|
485
|
-
output,
|
|
486
|
-
});
|
|
487
|
-
break;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
case 'lsp': {
|
|
491
|
-
await runLsp({ cwd: process.cwd() });
|
|
492
|
-
break;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
case 'costs': {
|
|
496
|
-
const { runCosts } = await import('./costs.ts');
|
|
497
|
-
const code = await runCosts();
|
|
498
|
-
process.exit(code);
|
|
499
|
-
break;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
case 'report': {
|
|
503
|
-
const outputPath = flag('output');
|
|
504
|
-
const trend = boolFlag('trend');
|
|
505
|
-
const code = await runReport({ output: outputPath, trend });
|
|
506
|
-
process.exit(code);
|
|
507
|
-
break;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
case 'explain': {
|
|
511
|
-
const config = flag('config');
|
|
512
|
-
// Target is the first non-flag arg after 'explain'
|
|
513
|
-
const target = args.slice(1).find(a => !a.startsWith('--'));
|
|
514
|
-
const code = await runExplain({ configPath: config, target });
|
|
515
|
-
process.exit(code);
|
|
516
|
-
break;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
case 'ignore': {
|
|
520
|
-
const all = boolFlag('all');
|
|
521
|
-
const dryRun = boolFlag('dry-run');
|
|
522
|
-
const code = await runIgnore({ all, dryRun });
|
|
523
|
-
process.exit(code);
|
|
524
|
-
break;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
case 'setup': {
|
|
528
|
-
const force = args.includes('--force');
|
|
529
|
-
const profileArg = flag('profile');
|
|
530
|
-
if (profileArg && !['security-strict', 'team', 'solo'].includes(profileArg)) {
|
|
531
|
-
console.error(`\x1b[31m[claude-autopilot] --profile must be "security-strict", "team", or "solo"\x1b[0m`);
|
|
532
|
-
process.exit(1);
|
|
533
|
-
}
|
|
534
|
-
await runSetup({ force, profile: profileArg as 'security-strict' | 'team' | 'solo' | undefined });
|
|
535
|
-
break;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
case 'worker': {
|
|
539
|
-
const sub = args[1];
|
|
540
|
-
const config = flag('config');
|
|
541
|
-
const code = await runWorker(sub, { cwd: process.cwd(), configPath: config });
|
|
542
|
-
process.exit(code);
|
|
543
|
-
break;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
case 'council': {
|
|
547
|
-
const config = flag('config');
|
|
548
|
-
const prompt = flag('prompt');
|
|
549
|
-
const contextFile = flag('context-file');
|
|
550
|
-
const dryRun = boolFlag('dry-run');
|
|
551
|
-
const noSynthesize = boolFlag('no-synthesize');
|
|
552
|
-
const code = await runCouncilCmd({
|
|
553
|
-
prompt,
|
|
554
|
-
contextFile,
|
|
555
|
-
configPath: config,
|
|
556
|
-
dryRun,
|
|
557
|
-
noSynthesize,
|
|
558
|
-
});
|
|
559
|
-
process.exit(code);
|
|
560
|
-
break;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
case 'mcp': {
|
|
564
|
-
const { runMcp } = await import('./mcp.ts');
|
|
565
|
-
const configPath = flag('config');
|
|
566
|
-
await runMcp({ cwd: process.cwd(), configPath });
|
|
567
|
-
break;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
case 'migrate-v4': {
|
|
571
|
-
const code = await runMigrateV4({
|
|
572
|
-
cwd: flag('path') ?? process.cwd(),
|
|
573
|
-
write: boolFlag('write'),
|
|
574
|
-
undo: boolFlag('undo'),
|
|
575
|
-
});
|
|
576
|
-
process.exit(code);
|
|
577
|
-
break;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
case 'brainstorm': {
|
|
581
|
-
// `brainstorm` is the front of the pipeline and is implemented as a Claude
|
|
582
|
-
// Code skill (superpowers:brainstorming → autopilot), not a standalone CLI.
|
|
583
|
-
// The welcome screen advertises `claude-autopilot brainstorm "..."` as the
|
|
584
|
-
// primary quickstart, so users WILL land here. Give them clear instructions
|
|
585
|
-
// instead of a generic "Unknown subcommand" rejection. Only reference CLI
|
|
586
|
-
// subcommands that actually route (verified by the welcome regression test).
|
|
587
|
-
console.log(`
|
|
588
|
-
\x1b[1m[brainstorm]\x1b[0m The pipeline entry point is a Claude Code skill, not a CLI subcommand.
|
|
589
|
-
|
|
590
|
-
Invoke it from Claude Code:
|
|
591
|
-
|
|
592
|
-
\x1b[36m/brainstorm\x1b[0m Interactive spec writing
|
|
593
|
-
\x1b[36m/autopilot\x1b[0m Full pipeline from an approved spec
|
|
594
|
-
\x1b[36m/migrate\x1b[0m Database migration phase (stack-dependent)
|
|
595
|
-
|
|
596
|
-
From the terminal, the CLI subset exposes only the individual review-phase subcommands:
|
|
597
|
-
|
|
598
|
-
\x1b[36mclaude-autopilot run --base main\x1b[0m Just the review phase
|
|
599
|
-
\x1b[36mclaude-autopilot doctor\x1b[0m Check prerequisites (incl. superpowers plugin)
|
|
600
|
-
\x1b[36mclaude-autopilot migrate-v4\x1b[0m Codemod for v4 → v5 repo migration (not a pipeline phase)
|
|
601
|
-
|
|
602
|
-
Full pipeline docs: https://github.com/axledbetter/claude-autopilot#the-pipeline-phase-by-phase
|
|
603
|
-
`);
|
|
604
|
-
process.exit(0);
|
|
605
|
-
break;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
default:
|
|
609
|
-
console.error(`\x1b[31m[claude-autopilot] Unknown subcommand: "${subcommand}"\x1b[0m`);
|
|
610
|
-
printUsage();
|
|
611
|
-
process.exit(1);
|
|
612
|
-
}
|