@delegance/claude-autopilot 5.2.2 → 6.2.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.
Files changed (130) hide show
  1. package/CHANGELOG.md +1027 -1
  2. package/README.md +104 -17
  3. package/dist/src/adapters/council/claude.js +2 -1
  4. package/dist/src/adapters/council/openai.js +14 -7
  5. package/dist/src/adapters/deploy/_http.d.ts +43 -0
  6. package/dist/src/adapters/deploy/_http.js +99 -0
  7. package/dist/src/adapters/deploy/fly.d.ts +206 -0
  8. package/dist/src/adapters/deploy/fly.js +696 -0
  9. package/dist/src/adapters/deploy/generic.d.ts +39 -0
  10. package/dist/src/adapters/deploy/generic.js +98 -0
  11. package/dist/src/adapters/deploy/index.d.ts +15 -0
  12. package/dist/src/adapters/deploy/index.js +78 -0
  13. package/dist/src/adapters/deploy/render.d.ts +181 -0
  14. package/dist/src/adapters/deploy/render.js +550 -0
  15. package/dist/src/adapters/deploy/types.d.ts +221 -0
  16. package/dist/src/adapters/deploy/types.js +15 -0
  17. package/dist/src/adapters/deploy/vercel.d.ts +143 -0
  18. package/dist/src/adapters/deploy/vercel.js +426 -0
  19. package/dist/src/adapters/pricing.d.ts +36 -0
  20. package/dist/src/adapters/pricing.js +40 -0
  21. package/dist/src/adapters/review-engine/claude.js +2 -1
  22. package/dist/src/adapters/review-engine/codex.js +12 -8
  23. package/dist/src/adapters/review-engine/gemini.js +2 -1
  24. package/dist/src/adapters/review-engine/openai-compatible.js +2 -1
  25. package/dist/src/adapters/sdk-loader.d.ts +15 -0
  26. package/dist/src/adapters/sdk-loader.js +77 -0
  27. package/dist/src/cli/autopilot.d.ts +71 -0
  28. package/dist/src/cli/autopilot.js +735 -0
  29. package/dist/src/cli/brainstorm.d.ts +23 -0
  30. package/dist/src/cli/brainstorm.js +131 -0
  31. package/dist/src/cli/costs.d.ts +15 -1
  32. package/dist/src/cli/costs.js +99 -10
  33. package/dist/src/cli/deploy.d.ts +71 -0
  34. package/dist/src/cli/deploy.js +539 -0
  35. package/dist/src/cli/fix.d.ts +18 -0
  36. package/dist/src/cli/fix.js +105 -11
  37. package/dist/src/cli/help-text.d.ts +52 -0
  38. package/dist/src/cli/help-text.js +400 -0
  39. package/dist/src/cli/implement.d.ts +91 -0
  40. package/dist/src/cli/implement.js +196 -0
  41. package/dist/src/cli/index.js +784 -222
  42. package/dist/src/cli/json-envelope.d.ts +187 -0
  43. package/dist/src/cli/json-envelope.js +270 -0
  44. package/dist/src/cli/json-mode.d.ts +33 -0
  45. package/dist/src/cli/json-mode.js +201 -0
  46. package/dist/src/cli/migrate.d.ts +111 -0
  47. package/dist/src/cli/migrate.js +305 -0
  48. package/dist/src/cli/plan.d.ts +81 -0
  49. package/dist/src/cli/plan.js +149 -0
  50. package/dist/src/cli/pr.d.ts +106 -0
  51. package/dist/src/cli/pr.js +191 -19
  52. package/dist/src/cli/preflight.js +102 -1
  53. package/dist/src/cli/review.d.ts +27 -0
  54. package/dist/src/cli/review.js +126 -0
  55. package/dist/src/cli/runs-watch-renderer.d.ts +45 -0
  56. package/dist/src/cli/runs-watch-renderer.js +275 -0
  57. package/dist/src/cli/runs-watch.d.ts +41 -0
  58. package/dist/src/cli/runs-watch.js +395 -0
  59. package/dist/src/cli/runs.d.ts +122 -0
  60. package/dist/src/cli/runs.js +902 -0
  61. package/dist/src/cli/scan.d.ts +93 -0
  62. package/dist/src/cli/scan.js +166 -40
  63. package/dist/src/cli/spec.d.ts +66 -0
  64. package/dist/src/cli/spec.js +132 -0
  65. package/dist/src/cli/validate.d.ts +29 -0
  66. package/dist/src/cli/validate.js +131 -0
  67. package/dist/src/core/config/schema.d.ts +43 -0
  68. package/dist/src/core/config/schema.js +25 -0
  69. package/dist/src/core/config/types.d.ts +17 -0
  70. package/dist/src/core/council/runner.d.ts +10 -1
  71. package/dist/src/core/council/runner.js +25 -3
  72. package/dist/src/core/council/types.d.ts +7 -0
  73. package/dist/src/core/errors.d.ts +1 -1
  74. package/dist/src/core/errors.js +12 -0
  75. package/dist/src/core/logging/redaction.d.ts +13 -0
  76. package/dist/src/core/logging/redaction.js +20 -0
  77. package/dist/src/core/migrate/detector-rules.js +6 -0
  78. package/dist/src/core/migrate/schema-validator.js +22 -1
  79. package/dist/src/core/phases/static-rules.d.ts +5 -1
  80. package/dist/src/core/phases/static-rules.js +2 -5
  81. package/dist/src/core/run-state/budget.d.ts +88 -0
  82. package/dist/src/core/run-state/budget.js +141 -0
  83. package/dist/src/core/run-state/cli-internal.d.ts +21 -0
  84. package/dist/src/core/run-state/cli-internal.js +174 -0
  85. package/dist/src/core/run-state/events.d.ts +59 -0
  86. package/dist/src/core/run-state/events.js +504 -0
  87. package/dist/src/core/run-state/lock.d.ts +61 -0
  88. package/dist/src/core/run-state/lock.js +206 -0
  89. package/dist/src/core/run-state/phase-context.d.ts +60 -0
  90. package/dist/src/core/run-state/phase-context.js +108 -0
  91. package/dist/src/core/run-state/phase-registry.d.ts +137 -0
  92. package/dist/src/core/run-state/phase-registry.js +162 -0
  93. package/dist/src/core/run-state/phase-runner.d.ts +80 -0
  94. package/dist/src/core/run-state/phase-runner.js +447 -0
  95. package/dist/src/core/run-state/provider-readback.d.ts +130 -0
  96. package/dist/src/core/run-state/provider-readback.js +426 -0
  97. package/dist/src/core/run-state/replay-decision.d.ts +69 -0
  98. package/dist/src/core/run-state/replay-decision.js +144 -0
  99. package/dist/src/core/run-state/resolve-engine.d.ts +100 -0
  100. package/dist/src/core/run-state/resolve-engine.js +190 -0
  101. package/dist/src/core/run-state/resume-preflight.d.ts +66 -0
  102. package/dist/src/core/run-state/resume-preflight.js +116 -0
  103. package/dist/src/core/run-state/run-phase-with-lifecycle.d.ts +73 -0
  104. package/dist/src/core/run-state/run-phase-with-lifecycle.js +186 -0
  105. package/dist/src/core/run-state/runs.d.ts +57 -0
  106. package/dist/src/core/run-state/runs.js +288 -0
  107. package/dist/src/core/run-state/snapshot.d.ts +14 -0
  108. package/dist/src/core/run-state/snapshot.js +114 -0
  109. package/dist/src/core/run-state/state.d.ts +40 -0
  110. package/dist/src/core/run-state/state.js +164 -0
  111. package/dist/src/core/run-state/types.d.ts +278 -0
  112. package/dist/src/core/run-state/types.js +13 -0
  113. package/dist/src/core/run-state/ulid.d.ts +11 -0
  114. package/dist/src/core/run-state/ulid.js +95 -0
  115. package/dist/src/core/schema-alignment/extractor/index.d.ts +1 -1
  116. package/dist/src/core/schema-alignment/extractor/index.js +2 -2
  117. package/dist/src/core/schema-alignment/extractor/prisma.d.ts +13 -1
  118. package/dist/src/core/schema-alignment/extractor/prisma.js +65 -10
  119. package/dist/src/core/schema-alignment/git-history.d.ts +19 -0
  120. package/dist/src/core/schema-alignment/git-history.js +53 -0
  121. package/dist/src/core/static-rules/rules/brand-tokens.js +2 -2
  122. package/dist/src/core/static-rules/rules/schema-alignment.js +14 -4
  123. package/package.json +9 -5
  124. package/scripts/autoregress.ts +3 -2
  125. package/skills/claude-autopilot.md +1 -1
  126. package/skills/make-interfaces-feel-better/SKILL.md +104 -0
  127. package/skills/migrate/SKILL.md +193 -47
  128. package/skills/simplify-ui/SKILL.md +103 -0
  129. package/skills/ui/SKILL.md +117 -0
  130. package/skills/ui-ux-pro-max/SKILL.md +90 -0
@@ -0,0 +1,77 @@
1
+ // src/adapters/sdk-loader.ts
2
+ //
3
+ // Lazy-load LLM SDKs via dynamic import so the package doesn't pay the boot
4
+ // cost (or install footprint) for providers the user isn't using. The four
5
+ // LLM SDKs together account for ~26 MB of node_modules; users with only one
6
+ // API key need only one of them.
7
+ //
8
+ // On a missing SDK, throw a `GuardrailError` with the exact `npm install`
9
+ // command — same UX as a missing API key.
10
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
11
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
12
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
13
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
14
+ });
15
+ }
16
+ return path;
17
+ };
18
+ import { GuardrailError } from "../core/errors.js";
19
+ function isModuleNotFound(err) {
20
+ if (!err || typeof err !== 'object')
21
+ return false;
22
+ const code = err.code;
23
+ return code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND';
24
+ }
25
+ function missingSdkError(pkg, provider) {
26
+ return new GuardrailError(`${pkg} not installed — run: npm install ${pkg}`, { code: 'auth', provider });
27
+ }
28
+ export async function loadAnthropic() {
29
+ try {
30
+ const mod = await import('@anthropic-ai/sdk');
31
+ return (mod.default ?? mod);
32
+ }
33
+ catch (err) {
34
+ if (isModuleNotFound(err))
35
+ throw missingSdkError('@anthropic-ai/sdk', 'claude');
36
+ throw err;
37
+ }
38
+ }
39
+ export async function loadOpenAI() {
40
+ try {
41
+ const mod = await import('openai');
42
+ return (mod.default ?? mod);
43
+ }
44
+ catch (err) {
45
+ if (isModuleNotFound(err))
46
+ throw missingSdkError('openai', 'openai');
47
+ throw err;
48
+ }
49
+ }
50
+ export async function loadGoogleGenerativeAI() {
51
+ try {
52
+ const mod = await import('@google/generative-ai');
53
+ return mod.GoogleGenerativeAI;
54
+ }
55
+ catch (err) {
56
+ if (isModuleNotFound(err))
57
+ throw missingSdkError('@google/generative-ai', 'gemini');
58
+ throw err;
59
+ }
60
+ }
61
+ /**
62
+ * Quick non-throwing check — used by `doctor` to report install state.
63
+ */
64
+ export async function isSdkInstalled(pkg) {
65
+ try {
66
+ await import(__rewriteRelativeImportExtension(pkg));
67
+ return true;
68
+ }
69
+ catch (err) {
70
+ if (isModuleNotFound(err))
71
+ return false;
72
+ // Other errors (e.g., the SDK itself failed to load) — count as installed
73
+ // but broken; doctor will surface that separately if needed.
74
+ return true;
75
+ }
76
+ }
77
+ //# sourceMappingURL=sdk-loader.js.map
@@ -0,0 +1,71 @@
1
+ import { PHASE_REGISTRY, DEFAULT_FULL_PHASES, type PhaseName } from '../core/run-state/phase-registry.ts';
2
+ export type AutopilotMode = 'full';
3
+ export interface AutopilotOptions {
4
+ cwd?: string;
5
+ configPath?: string;
6
+ /** Pipeline mode. v6.2.0 supports `'full'` only (scan → spec → plan →
7
+ * implement). Defaults to `'full'` when neither `mode` nor `phases`
8
+ * is supplied. */
9
+ mode?: AutopilotMode;
10
+ /** Explicit phase list (overrides `mode`). Validated against
11
+ * PHASE_REGISTRY before any run dir is created — unknown names exit 1
12
+ * with `invalid_config`. */
13
+ phases?: readonly string[];
14
+ /** Run-scope budget (USD). When set, every phase passes through the
15
+ * shared `BudgetConfig` with `scope: 'run'` so `actualSoFar` accumulates
16
+ * across phases. */
17
+ budgetUSD?: number;
18
+ /** v6.0.x — engine knob. The orchestrator REJECTS engine-off explicitly
19
+ * (per spec "Engine-off"); these fields exist so the dispatcher can pass
20
+ * them through and the orchestrator can produce a clear error message. */
21
+ cliEngine?: boolean;
22
+ envEngine?: string;
23
+ /** Test seam — keep stdout banners suppressed. Production callers MUST
24
+ * NOT pass this; the dispatcher does not surface a flag for it. */
25
+ __silent?: boolean;
26
+ }
27
+ export interface AutopilotPhaseSummary {
28
+ name: string;
29
+ status: 'success' | 'failed' | 'skipped' | 'not-run';
30
+ errorCode?: string;
31
+ errorMessage?: string;
32
+ costUSD: number;
33
+ durationMs: number;
34
+ }
35
+ export interface AutopilotResult {
36
+ runId: string | null;
37
+ runDir: string | null;
38
+ exitCode: number;
39
+ errorCode?: string;
40
+ errorMessage?: string;
41
+ phases: AutopilotPhaseSummary[];
42
+ totalCostUSD: number;
43
+ durationMs: number;
44
+ }
45
+ export declare function runAutopilot(options?: AutopilotOptions): Promise<AutopilotResult>;
46
+ export interface AutopilotJsonOptions extends AutopilotOptions {
47
+ /** Test seam — install process-level uncaughtException / unhandledRejection
48
+ * handlers that emit a fallback envelope if the orchestrator throws past
49
+ * our try/catch. Default: true (production behavior). Tests pass false to
50
+ * avoid leaking handlers across the suite. */
51
+ __testInstallProcessHandlers?: boolean;
52
+ /** Test seam — when set, the orchestrator throws AFTER the success
53
+ * envelope is written. Used to verify the single-write latch suppresses
54
+ * the uncaughtException handler's fallback envelope. Production code
55
+ * never sets this. */
56
+ __testThrowAfterEnvelope?: () => never;
57
+ }
58
+ /** v6.2.2 entrypoint for `claude-autopilot autopilot --json`.
59
+ *
60
+ * Wraps `runAutopilot` (which already handles pre-run failures inline by
61
+ * returning an `AutopilotResult` with `runId: null` + populated
62
+ * `errorCode` / `errorMessage`) and emits exactly one envelope on stdout.
63
+ * Process-level fatal handlers (codex WARNING #2) catch async failures
64
+ * that would otherwise bypass our try/catch.
65
+ *
66
+ * Returns the exit code the dispatcher should propagate via
67
+ * `process.exit`. */
68
+ export declare function runAutopilotWithJsonEnvelope(options?: AutopilotJsonOptions): Promise<number>;
69
+ export { PHASE_REGISTRY, DEFAULT_FULL_PHASES };
70
+ export type { PhaseName };
71
+ //# sourceMappingURL=autopilot.d.ts.map