@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AdapterBase {
|
|
2
|
+
name: string;
|
|
3
|
+
apiVersion: string;
|
|
4
|
+
getCapabilities(): Capabilities;
|
|
5
|
+
}
|
|
6
|
+
export interface Capabilities {
|
|
7
|
+
[feature: string]: boolean | number | string;
|
|
8
|
+
}
|
|
9
|
+
export declare const CORE_ADAPTER_API_VERSION_MAJOR = 1;
|
|
10
|
+
export declare function checkApiVersionCompatibility(adapterApiVersion: string): boolean;
|
|
11
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AdapterBase } from './base.ts';
|
|
2
|
+
export type IntegrationPoint = 'review-engine' | 'vcs-host' | 'migration-runner' | 'review-bot-parser';
|
|
3
|
+
export interface LoadAdapterOptions {
|
|
4
|
+
point: IntegrationPoint;
|
|
5
|
+
ref: string;
|
|
6
|
+
options?: Record<string, unknown>;
|
|
7
|
+
/** Allow loading adapters from arbitrary local paths. Off by default for security. */
|
|
8
|
+
unsafeAllowLocalAdapters?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function loadAdapter<T extends AdapterBase>(options: LoadAdapterOptions): Promise<T>;
|
|
11
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AdapterBase } from '../base.ts';
|
|
2
|
+
export type MigrationEnv = 'dev' | 'qa' | 'prod';
|
|
3
|
+
export interface Migration {
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
content?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DryRunResult {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
errors?: string[];
|
|
11
|
+
warnings?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface ApplyResult {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
appliedSha?: string;
|
|
16
|
+
durationMs?: number;
|
|
17
|
+
errors?: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface LedgerEntry {
|
|
20
|
+
name: string;
|
|
21
|
+
appliedAt: string;
|
|
22
|
+
sha?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface MigrationRunner extends AdapterBase {
|
|
25
|
+
discover(touchedFiles: string[]): Migration[];
|
|
26
|
+
dryRun(migration: Migration): Promise<DryRunResult>;
|
|
27
|
+
apply(migration: Migration, env: MigrationEnv): Promise<ApplyResult>;
|
|
28
|
+
ledger(env: MigrationEnv): Promise<LedgerEntry[]>;
|
|
29
|
+
alreadyApplied(migration: Migration, env: MigrationEnv): Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReviewBotParser } from './types.ts';
|
|
2
|
+
export interface DeclarativeParserConfig {
|
|
3
|
+
name: string;
|
|
4
|
+
author: string | RegExp;
|
|
5
|
+
severityMap: {
|
|
6
|
+
critical?: RegExp;
|
|
7
|
+
warning?: RegExp;
|
|
8
|
+
note?: RegExp;
|
|
9
|
+
};
|
|
10
|
+
dismissalKeywords: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function makeDeclarativeParser(config: DeclarativeParserConfig): ReviewBotParser;
|
|
13
|
+
//# sourceMappingURL=declarative-base.d.ts.map
|
package/{src/adapters/review-bot-parser/types.ts → dist/src/adapters/review-bot-parser/types.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AdapterBase } from '../base.ts';
|
|
2
2
|
import type { Finding } from '../../core/findings/types.ts';
|
|
3
3
|
import type { GenericComment, VcsHost } from '../vcs-host/types.ts';
|
|
4
|
-
|
|
5
4
|
export interface ReviewBotParser extends AdapterBase {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
detect(comment: GenericComment): boolean;
|
|
6
|
+
fetchFindings(vcs: VcsHost, pr: number | string): Promise<Finding[]>;
|
|
7
|
+
detectDismissal(reply: string): boolean;
|
|
9
8
|
}
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Finding } from '../../core/findings/types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Parses the structured CRITICAL|WARNING|NOTE markdown format produced by all review
|
|
4
|
+
* engine adapters. Extracts file:line references from the finding body when present.
|
|
5
|
+
*
|
|
6
|
+
* Tolerates common LLM format drift (missing brackets, bold wrappers) because the prompt
|
|
7
|
+
* alone doesn't guarantee literal `### [CRITICAL]` — models routinely emit
|
|
8
|
+
* `### CRITICAL` or `### **CRITICAL**`. A strict parser silently returns zero findings
|
|
9
|
+
* on otherwise-valid output, which is exactly the silent-failure mode this file exists to
|
|
10
|
+
* prevent.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseReviewOutput(output: string, idPrefix: string): Finding[];
|
|
13
|
+
//# sourceMappingURL=parse-output.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReviewInput } from './types.ts';
|
|
2
|
+
export declare function buildSystemPrompt(input: ReviewInput, template: string): string;
|
|
3
|
+
export declare function classifyError(message: string): 'auth' | 'rate_limit' | 'transient_network';
|
|
4
|
+
//# sourceMappingURL=prompt-builder.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AdapterBase } from '../base.ts';
|
|
2
|
+
import type { Finding } from '../../core/findings/types.ts';
|
|
3
|
+
export interface ReviewInput {
|
|
4
|
+
content: string;
|
|
5
|
+
kind: 'spec' | 'pr-diff' | 'file-batch';
|
|
6
|
+
context?: {
|
|
7
|
+
spec?: string;
|
|
8
|
+
plan?: string;
|
|
9
|
+
stack?: string;
|
|
10
|
+
cwd?: string;
|
|
11
|
+
gitSummary?: string;
|
|
12
|
+
designSchema?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface ReviewOutput {
|
|
16
|
+
findings: Finding[];
|
|
17
|
+
rawOutput: string;
|
|
18
|
+
usage?: {
|
|
19
|
+
input: number;
|
|
20
|
+
output: number;
|
|
21
|
+
costUSD?: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ReviewEngine extends AdapterBase {
|
|
25
|
+
review(input: ReviewInput): Promise<ReviewOutput>;
|
|
26
|
+
estimateTokens(content: string): number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type CommitState = 'pending' | 'success' | 'failure' | 'error';
|
|
2
|
+
export interface CommitStatusOptions {
|
|
3
|
+
sha: string;
|
|
4
|
+
state: CommitState;
|
|
5
|
+
description?: string;
|
|
6
|
+
context?: string;
|
|
7
|
+
targetUrl?: string;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveCommitSha(cwd: string, envSha?: string): string | null;
|
|
11
|
+
export declare function postCommitStatus(opts: CommitStatusOptions): boolean;
|
|
12
|
+
//# sourceMappingURL=commit-status.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AdapterBase } from '../base.ts';
|
|
2
|
+
export interface GenericComment {
|
|
3
|
+
id: string | number;
|
|
4
|
+
author: string;
|
|
5
|
+
body: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
line?: number;
|
|
8
|
+
url?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PrMetadata {
|
|
11
|
+
title: string;
|
|
12
|
+
body: string;
|
|
13
|
+
files: string[];
|
|
14
|
+
headSha: string;
|
|
15
|
+
baseRef: string;
|
|
16
|
+
headRef: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CreatePrOptions {
|
|
19
|
+
title: string;
|
|
20
|
+
body: string;
|
|
21
|
+
base: string;
|
|
22
|
+
head: string;
|
|
23
|
+
draft?: boolean;
|
|
24
|
+
idempotencyKey?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CreatePrResult {
|
|
27
|
+
number: number;
|
|
28
|
+
url: string;
|
|
29
|
+
alreadyExisted: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface VcsHost extends AdapterBase {
|
|
32
|
+
getPrDiff(pr: number | string): Promise<string>;
|
|
33
|
+
getPrMetadata(pr: number | string): Promise<PrMetadata>;
|
|
34
|
+
postComment(pr: number | string, body: string, idempotencyKey?: string): Promise<void>;
|
|
35
|
+
getReviewComments(pr: number | string): Promise<GenericComment[]>;
|
|
36
|
+
replyToComment(pr: number | string, commentId: string | number, body: string, idempotencyKey?: string): Promise<void>;
|
|
37
|
+
createPr(opts: CreatePrOptions): Promise<CreatePrResult>;
|
|
38
|
+
push(branch: string, opts?: {
|
|
39
|
+
setUpstream?: boolean;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -15,52 +15,17 @@
|
|
|
15
15
|
* `@delegance/claude-autopilot` package.json. Both source and compiled callers
|
|
16
16
|
* land in the same place.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
import * as fs from 'node:fs';
|
|
20
|
-
import * as path from 'node:path';
|
|
21
|
-
import { fileURLToPath } from 'node:url';
|
|
22
|
-
|
|
23
|
-
const PACKAGE_NAME = '@delegance/claude-autopilot';
|
|
24
|
-
|
|
25
18
|
/**
|
|
26
19
|
* Walks up from the caller's location looking for the package.json that
|
|
27
20
|
* declares `name === '@delegance/claude-autopilot'`. Returns the directory
|
|
28
21
|
* containing that package.json, or null if not found within `maxDepth` levels.
|
|
29
22
|
*/
|
|
30
|
-
export function findPackageRoot(callerImportMetaUrl: string, maxDepth
|
|
31
|
-
let dir = path.dirname(fileURLToPath(callerImportMetaUrl));
|
|
32
|
-
for (let i = 0; i < maxDepth; i++) {
|
|
33
|
-
const candidate = path.join(dir, 'package.json');
|
|
34
|
-
if (fs.existsSync(candidate)) {
|
|
35
|
-
try {
|
|
36
|
-
const pkg = JSON.parse(fs.readFileSync(candidate, 'utf8')) as { name?: string };
|
|
37
|
-
if (pkg.name === PACKAGE_NAME) return dir;
|
|
38
|
-
} catch {
|
|
39
|
-
/* keep walking */
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const parent = path.dirname(dir);
|
|
43
|
-
if (parent === dir) break;
|
|
44
|
-
dir = parent;
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
23
|
+
export declare function findPackageRoot(callerImportMetaUrl: string, maxDepth?: number): string | null;
|
|
49
24
|
/**
|
|
50
25
|
* Throws a clear error if the package root can't be located. Use at sites that
|
|
51
26
|
* absolutely require the root (e.g. preset config lookup).
|
|
52
27
|
*/
|
|
53
|
-
export function requirePackageRoot(callerImportMetaUrl: string): string
|
|
54
|
-
const root = findPackageRoot(callerImportMetaUrl);
|
|
55
|
-
if (!root) {
|
|
56
|
-
throw new Error(
|
|
57
|
-
`[claude-autopilot] Could not locate package root from ${fileURLToPath(callerImportMetaUrl)}. ` +
|
|
58
|
-
`Reinstall: npm install -g @delegance/claude-autopilot@alpha`,
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
return root;
|
|
62
|
-
}
|
|
63
|
-
|
|
28
|
+
export declare function requirePackageRoot(callerImportMetaUrl: string): string;
|
|
64
29
|
/**
|
|
65
30
|
* Resolve a sibling-module path for dynamic `import()` that works under both
|
|
66
31
|
* source (caller is `.ts`) and compiled (caller is `.js`) layouts.
|
|
@@ -78,8 +43,5 @@ export function requirePackageRoot(callerImportMetaUrl: string): string {
|
|
|
78
43
|
* @param callerImportMetaUrl Caller's `import.meta.url`.
|
|
79
44
|
* @returns Absolute filesystem path suitable for `import()`.
|
|
80
45
|
*/
|
|
81
|
-
export function resolveSiblingModule(ref: string, callerImportMetaUrl: string): string
|
|
82
|
-
|
|
83
|
-
const adjustedRef = callerIsCompiled ? ref.replace(/\.ts$/, '.js') : ref;
|
|
84
|
-
return fileURLToPath(new URL(adjustedRef, callerImportMetaUrl));
|
|
85
|
-
}
|
|
46
|
+
export declare function resolveSiblingModule(ref: string, callerImportMetaUrl: string): string;
|
|
47
|
+
//# sourceMappingURL=_pkg-root.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface CiCommandOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
configPath?: string;
|
|
4
|
+
base?: string;
|
|
5
|
+
postComments?: boolean;
|
|
6
|
+
sarifOutput?: string;
|
|
7
|
+
diff?: boolean;
|
|
8
|
+
inlineComments?: boolean;
|
|
9
|
+
newOnly?: boolean;
|
|
10
|
+
failOn?: 'critical' | 'warning' | 'note' | 'none';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `guardrail ci` — opinionated single-command CI entrypoint.
|
|
14
|
+
*
|
|
15
|
+
* Defaults:
|
|
16
|
+
* base GITHUB_BASE_REF → HEAD~1
|
|
17
|
+
* output guardrail.sarif
|
|
18
|
+
* post-comments true
|
|
19
|
+
* fail-on critical (or policy.failOn from config)
|
|
20
|
+
* new-only false (or policy.newOnly from config)
|
|
21
|
+
*/
|
|
22
|
+
export declare function runCi(options?: CiCommandOptions): Promise<number>;
|
|
23
|
+
//# sourceMappingURL=ci.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FixCommandOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
configPath?: string;
|
|
4
|
+
severity?: 'critical' | 'warning' | 'all';
|
|
5
|
+
dryRun?: boolean;
|
|
6
|
+
yes?: boolean;
|
|
7
|
+
noVerify?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function runFix(options?: FixCommandOptions): Promise<number>;
|
|
10
|
+
//# sourceMappingURL=fix.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const GUARDRAIL_MARKER = "# guardrail-managed";
|
|
2
|
+
export declare function runHook(sub: string, options?: {
|
|
3
|
+
cwd?: string;
|
|
4
|
+
force?: boolean;
|
|
5
|
+
silent?: boolean;
|
|
6
|
+
preCommitOnly?: boolean;
|
|
7
|
+
prePushOnly?: boolean;
|
|
8
|
+
}): Promise<number>;
|
|
9
|
+
//# sourceMappingURL=hook.d.ts.map
|
package/dist/src/cli/index.js
CHANGED
|
@@ -28,6 +28,44 @@ import { runTestGen } from "./test-gen.js";
|
|
|
28
28
|
import { runCouncilCmd } from "./council.js";
|
|
29
29
|
import { runMigrateV4 } from "./migrate-v4.js";
|
|
30
30
|
import { findPackageRoot } from "./_pkg-root.js";
|
|
31
|
+
import { GuardrailError } from "../core/errors.js";
|
|
32
|
+
// Format unhandled errors as a one-line user-facing message instead of dumping a
|
|
33
|
+
// Node stack trace. Auth/network failures are by far the most common path here
|
|
34
|
+
// (bad/missing API key, rate limit, network blip) and surfacing the raw stack
|
|
35
|
+
// reads as "the tool is broken" when it isn't.
|
|
36
|
+
function formatTopLevelError(err) {
|
|
37
|
+
if (err instanceof GuardrailError) {
|
|
38
|
+
const provider = err.provider ? ` [${err.provider}]` : '';
|
|
39
|
+
const hint = err.code === 'auth'
|
|
40
|
+
? '\n hint: check your API key (ANTHROPIC_API_KEY / OPENAI_API_KEY / GEMINI_API_KEY) or run: claude-autopilot doctor'
|
|
41
|
+
: err.code === 'rate_limit'
|
|
42
|
+
? '\n hint: rate-limited by provider — retry shortly or switch model in guardrail.config.yaml'
|
|
43
|
+
: err.code === 'invalid_config'
|
|
44
|
+
? '\n hint: check guardrail.config.yaml — claude-autopilot doctor'
|
|
45
|
+
: '';
|
|
46
|
+
return { message: `[claude-autopilot]${provider} ${err.code}: ${err.message}${hint}`, exit: 1 };
|
|
47
|
+
}
|
|
48
|
+
if (err instanceof Error) {
|
|
49
|
+
return { message: `[claude-autopilot] ${err.message}`, exit: 1 };
|
|
50
|
+
}
|
|
51
|
+
return { message: `[claude-autopilot] ${String(err)}`, exit: 1 };
|
|
52
|
+
}
|
|
53
|
+
process.on('unhandledRejection', err => {
|
|
54
|
+
const { message, exit } = formatTopLevelError(err);
|
|
55
|
+
process.stderr.write(`\x1b[31m${message}\x1b[0m\n`);
|
|
56
|
+
if (process.env.CLAUDE_AUTOPILOT_DEBUG === '1' && err instanceof Error && err.stack) {
|
|
57
|
+
process.stderr.write(`\x1b[2m${err.stack}\x1b[0m\n`);
|
|
58
|
+
}
|
|
59
|
+
process.exit(exit);
|
|
60
|
+
});
|
|
61
|
+
process.on('uncaughtException', err => {
|
|
62
|
+
const { message, exit } = formatTopLevelError(err);
|
|
63
|
+
process.stderr.write(`\x1b[31m${message}\x1b[0m\n`);
|
|
64
|
+
if (process.env.CLAUDE_AUTOPILOT_DEBUG === '1' && err.stack) {
|
|
65
|
+
process.stderr.write(`\x1b[2m${err.stack}\x1b[0m\n`);
|
|
66
|
+
}
|
|
67
|
+
process.exit(exit);
|
|
68
|
+
});
|
|
31
69
|
const args = process.argv.slice(2);
|
|
32
70
|
// Version flag — read package.json via the shared package-root helper. Works
|
|
33
71
|
// under both source (src/cli/index.ts) and compiled (dist/src/cli/index.js)
|
|
@@ -269,7 +307,7 @@ switch (subcommand) {
|
|
|
269
307
|
break;
|
|
270
308
|
}
|
|
271
309
|
case 'init': {
|
|
272
|
-
|
|
310
|
+
// `init` and `setup` are aliases. Keep both supported — no nag banner.
|
|
273
311
|
const force = args.includes('--force');
|
|
274
312
|
await runSetup({ force });
|
|
275
313
|
break;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Finding } from '../core/findings/types.ts';
|
|
2
|
+
export declare function findingToUri(filePath: string, cwd: string): string;
|
|
3
|
+
export declare function findingToDiagnostic(f: Finding): {
|
|
4
|
+
range: {
|
|
5
|
+
start: {
|
|
6
|
+
line: number;
|
|
7
|
+
character: number;
|
|
8
|
+
};
|
|
9
|
+
end: {
|
|
10
|
+
line: number;
|
|
11
|
+
character: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
severity: number;
|
|
15
|
+
source: string;
|
|
16
|
+
code: string;
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function groupByUri(findings: Finding[], cwd: string): Map<string, Finding[]>;
|
|
20
|
+
export declare function encodeMessage(body: object): Buffer;
|
|
21
|
+
/** Parse as many complete LSP messages as possible from `buf`. Returns parsed objects and remaining bytes. */
|
|
22
|
+
export declare function parseMessages(buf: Buffer): {
|
|
23
|
+
messages: unknown[];
|
|
24
|
+
remaining: Buffer;
|
|
25
|
+
};
|
|
26
|
+
export declare function runLsp(options?: {
|
|
27
|
+
cwd?: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=lsp.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `claude-autopilot migrate-v4` — codemod for v4 → v5 rename.
|
|
3
|
+
*
|
|
4
|
+
* Scans a repo for @delegance/guardrail + guardrail CLI references and proposes
|
|
5
|
+
* replacements. Writes with `--write`, restores from manifest with `--undo`.
|
|
6
|
+
*
|
|
7
|
+
* Mutation rules (per codex review of alpha.3 spec):
|
|
8
|
+
* - package.json: updates dependencies, devDependencies, optionalDependencies,
|
|
9
|
+
* peerDependencies. Preserves key ordering within each section. Preserves
|
|
10
|
+
* semver operator shape (^/~/>=/exact) — only rewrites the package name and
|
|
11
|
+
* bumps to ^5.0.0-alpha.
|
|
12
|
+
* - Shell scripts, Makefiles, workflow yaml, Dockerfiles: word-boundary match
|
|
13
|
+
* on `guardrail <verb>` → `claude-autopilot <verb>`, and
|
|
14
|
+
* `@delegance/guardrail` → `@delegance/claude-autopilot`.
|
|
15
|
+
* - package-lock.json: NOT touched (regenerated by npm install).
|
|
16
|
+
*
|
|
17
|
+
* --undo reads `.claude-autopilot/migrate-v4-manifest.json` and restores files
|
|
18
|
+
* by sha256 match. Rejects restoration if the current file differs from the
|
|
19
|
+
* backup's post-write hash, preventing clobber of user edits.
|
|
20
|
+
*/
|
|
21
|
+
export interface MigrateV4Options {
|
|
22
|
+
cwd?: string;
|
|
23
|
+
write?: boolean;
|
|
24
|
+
undo?: boolean;
|
|
25
|
+
path?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function runMigrateV4(options?: MigrateV4Options): Promise<number>;
|
|
28
|
+
//# sourceMappingURL=migrate-v4.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RunResult } from '../core/pipeline/run.ts';
|
|
2
|
+
import type { GuardrailConfig } from '../core/config/types.ts';
|
|
3
|
+
import type { GitContext } from '../core/detect/git-context.ts';
|
|
4
|
+
/** Detect the current open PR number via gh CLI or CI env vars. */
|
|
5
|
+
export declare function detectPrNumber(cwd: string): number | null;
|
|
6
|
+
/** Format a RunResult into a markdown PR comment. */
|
|
7
|
+
export declare function formatComment(result: RunResult, config: GuardrailConfig, gitCtx: GitContext, touchedFileCount: number): string;
|
|
8
|
+
/** Post or update the autopilot comment on the given PR. */
|
|
9
|
+
export declare function postPrComment(pr: number, body: string, cwd: string): Promise<{
|
|
10
|
+
action: 'created' | 'updated';
|
|
11
|
+
url: string | null;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=pr-comment.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Finding } from '../core/findings/types.ts';
|
|
2
|
+
export interface PrDescOptions {
|
|
3
|
+
base?: string;
|
|
4
|
+
post?: boolean;
|
|
5
|
+
yes?: boolean;
|
|
6
|
+
output?: string;
|
|
7
|
+
_gitDiff?: string;
|
|
8
|
+
_branchName?: string;
|
|
9
|
+
_cachedFindings?: Finding[];
|
|
10
|
+
_reviewEngine?: {
|
|
11
|
+
review(input: {
|
|
12
|
+
content: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
rawOutput: string;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface PrDescResult {
|
|
20
|
+
title: string;
|
|
21
|
+
body: string;
|
|
22
|
+
prUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function truncateDiff(diff: string, charLimit?: number): string;
|
|
25
|
+
export declare function summarizeFindings(findings: Finding[], max?: number): string;
|
|
26
|
+
export declare function parseDescription(raw: string): {
|
|
27
|
+
title: string;
|
|
28
|
+
body: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function runPrDesc(options: PrDescOptions): Promise<PrDescResult>;
|
|
31
|
+
//# sourceMappingURL=pr-desc.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Finding } from '../core/findings/types.ts';
|
|
2
|
+
export interface PostReviewCommentsResult {
|
|
3
|
+
posted: number;
|
|
4
|
+
skipped: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Posts (or re-submits) a PR review with inline comments for each finding
|
|
8
|
+
* that has a file + line number. Findings without line numbers are skipped.
|
|
9
|
+
* Re-runs dismiss the previous autopilot review first to avoid stacking.
|
|
10
|
+
*/
|
|
11
|
+
export declare function postReviewComments(pr: number, findings: Finding[], cwd: string): Promise<PostReviewCommentsResult>;
|
|
12
|
+
//# sourceMappingURL=pr-review-comments.d.ts.map
|