@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,39 @@
1
+ import type { ChildProcessByStdio } from 'node:child_process';
2
+ import type { Readable, Writable } from 'node:stream';
3
+ import type { DeployAdapter, DeployInput, DeployResult } from './types.ts';
4
+ /**
5
+ * Function signature for the spawn dependency. Tests inject a fake spawn that
6
+ * emits canned stdout/exit events without touching the real OS process API.
7
+ */
8
+ export type SpawnFn = (command: string, args: ReadonlyArray<string>, options: {
9
+ shell: boolean | string;
10
+ signal?: AbortSignal;
11
+ }) => ChildProcessByStdio<Writable | null, Readable | null, Readable | null>;
12
+ export interface GenericDeployAdapterOptions {
13
+ /** Free-form shell command (e.g. `vercel --prod`). Required. */
14
+ deployCommand: string;
15
+ /** Optional health-check URL — accepted for forward-compat with Phase 4; unused in Phase 1. */
16
+ healthCheckUrl?: string;
17
+ /** Injected spawn implementation (defaults to `node:child_process` spawn). */
18
+ spawnImpl?: SpawnFn;
19
+ /** When true, suppress teeing child stdout/stderr to the parent's process streams. Tests pass true. */
20
+ quiet?: boolean;
21
+ /** Wall-clock source. Tests pass a controllable counter. */
22
+ nowImpl?: () => number;
23
+ }
24
+ /**
25
+ * Generic shell-command deploy adapter.
26
+ *
27
+ * Captures stdout, looks for the first http(s) URL, returns it as `deployUrl`.
28
+ * Exit code 0 → `pass`; non-zero → `fail`.
29
+ */
30
+ export declare class GenericDeployAdapter implements DeployAdapter {
31
+ readonly name = "generic";
32
+ private readonly deployCommand;
33
+ private readonly spawnImpl;
34
+ private readonly quiet;
35
+ private readonly now;
36
+ constructor(opts: GenericDeployAdapterOptions);
37
+ deploy(input: DeployInput): Promise<DeployResult>;
38
+ }
39
+ //# sourceMappingURL=generic.d.ts.map
@@ -0,0 +1,98 @@
1
+ // src/adapters/deploy/generic.ts
2
+ //
3
+ // Generic deploy adapter — runs an arbitrary shell command and reports back.
4
+ //
5
+ // Wraps the v5.3 "deployCommand" approach as a DeployAdapter so the same
6
+ // CLI surface (`claude-autopilot deploy`) works whether you have a Vercel
7
+ // project, a Fly app with `flyctl deploy`, a custom `make deploy`, or anything
8
+ // else that prints a URL to stdout.
9
+ //
10
+ // `status()` and `rollback()` are deliberately omitted — without platform-API
11
+ // state we have no way to answer "is the build still going" or "promote the
12
+ // previous deploy". Callers that need those can switch to a platform adapter.
13
+ import { spawn as defaultSpawn } from 'node:child_process';
14
+ import { GuardrailError } from "../../core/errors.js";
15
+ const URL_RE = /https?:\/\/[^\s)>"']+/i;
16
+ /**
17
+ * Generic shell-command deploy adapter.
18
+ *
19
+ * Captures stdout, looks for the first http(s) URL, returns it as `deployUrl`.
20
+ * Exit code 0 → `pass`; non-zero → `fail`.
21
+ */
22
+ export class GenericDeployAdapter {
23
+ name = 'generic';
24
+ deployCommand;
25
+ spawnImpl;
26
+ quiet;
27
+ now;
28
+ constructor(opts) {
29
+ if (!opts.deployCommand || opts.deployCommand.trim() === '') {
30
+ throw new GuardrailError('Generic deploy adapter requires `deployCommand`', { code: 'invalid_config', provider: 'generic' });
31
+ }
32
+ this.deployCommand = opts.deployCommand;
33
+ this.spawnImpl = opts.spawnImpl ?? defaultSpawn;
34
+ this.quiet = opts.quiet ?? process.env.AUTOPILOT_DEPLOY_QUIET === '1';
35
+ this.now = opts.nowImpl ?? Date.now;
36
+ }
37
+ async deploy(input) {
38
+ const start = this.now();
39
+ return new Promise((resolve, reject) => {
40
+ let stdoutBuf = '';
41
+ let stderrBuf = '';
42
+ const child = this.spawnImpl(this.deployCommand, [], {
43
+ shell: true,
44
+ signal: input.signal,
45
+ });
46
+ child.stdout?.on('data', (chunk) => {
47
+ const s = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
48
+ stdoutBuf += s;
49
+ if (!this.quiet)
50
+ process.stdout.write(s);
51
+ });
52
+ child.stderr?.on('data', (chunk) => {
53
+ const s = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
54
+ stderrBuf += s;
55
+ if (!this.quiet)
56
+ process.stderr.write(s);
57
+ });
58
+ child.on('error', (err) => {
59
+ // AbortError from a passed signal — surface as an aborted in-progress
60
+ // result rather than a hard reject.
61
+ if (err.name === 'AbortError') {
62
+ resolve({
63
+ status: 'in-progress',
64
+ durationMs: this.now() - start,
65
+ output: 'Deploy aborted by caller.',
66
+ });
67
+ return;
68
+ }
69
+ reject(new GuardrailError(`Generic deploy adapter failed to spawn: ${err.message}`, { code: 'adapter_bug', provider: 'generic', details: { errno: err.code } }));
70
+ });
71
+ child.on('close', (code) => {
72
+ const durationMs = this.now() - start;
73
+ const tail = lastNLines(stdoutBuf + stderrBuf, 20);
74
+ if (code === 0) {
75
+ const match = stdoutBuf.match(URL_RE);
76
+ resolve({
77
+ status: 'pass',
78
+ deployUrl: match?.[0],
79
+ durationMs,
80
+ output: tail,
81
+ });
82
+ }
83
+ else {
84
+ resolve({
85
+ status: 'fail',
86
+ durationMs,
87
+ output: tail,
88
+ });
89
+ }
90
+ });
91
+ });
92
+ }
93
+ }
94
+ function lastNLines(s, n) {
95
+ const lines = s.split(/\r?\n/);
96
+ return lines.slice(Math.max(0, lines.length - n)).join('\n');
97
+ }
98
+ //# sourceMappingURL=generic.js.map
@@ -0,0 +1,15 @@
1
+ import type { DeployAdapter, DeployConfig } from './types.ts';
2
+ export * from './types.ts';
3
+ export { VercelDeployAdapter } from './vercel.ts';
4
+ export { FlyDeployAdapter } from './fly.ts';
5
+ export { RenderDeployAdapter } from './render.ts';
6
+ export { GenericDeployAdapter } from './generic.ts';
7
+ /**
8
+ * Construct the right deploy adapter for the supplied config.
9
+ *
10
+ * Throws `GuardrailError` (code: invalid_config) when required adapter-specific
11
+ * fields are missing — failing fast at construction beats silently dropping
12
+ * the deploy step.
13
+ */
14
+ export declare function createDeployAdapter(config: DeployConfig): DeployAdapter;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,78 @@
1
+ // src/adapters/deploy/index.ts
2
+ //
3
+ // Public surface for the deploy-adapter package + factory.
4
+ import { GuardrailError } from "../../core/errors.js";
5
+ import { FlyDeployAdapter } from "./fly.js";
6
+ import { GenericDeployAdapter } from "./generic.js";
7
+ import { RenderDeployAdapter } from "./render.js";
8
+ import { VercelDeployAdapter } from "./vercel.js";
9
+ export * from "./types.js";
10
+ export { VercelDeployAdapter } from "./vercel.js";
11
+ export { FlyDeployAdapter } from "./fly.js";
12
+ export { RenderDeployAdapter } from "./render.js";
13
+ export { GenericDeployAdapter } from "./generic.js";
14
+ /**
15
+ * Construct the right deploy adapter for the supplied config.
16
+ *
17
+ * Throws `GuardrailError` (code: invalid_config) when required adapter-specific
18
+ * fields are missing — failing fast at construction beats silently dropping
19
+ * the deploy step.
20
+ */
21
+ export function createDeployAdapter(config) {
22
+ switch (config.adapter) {
23
+ case 'vercel': {
24
+ if (!config.project) {
25
+ throw new GuardrailError('deploy.adapter=vercel requires deploy.project (Vercel project ID or slug)', { code: 'invalid_config', provider: 'vercel' });
26
+ }
27
+ return new VercelDeployAdapter({
28
+ project: config.project,
29
+ team: config.team,
30
+ target: config.target,
31
+ });
32
+ }
33
+ case 'fly': {
34
+ // v5.6 Phase 1: Fly requires both `app` and `image`. We surface each
35
+ // missing field with its own error so the user fixes both in one pass
36
+ // instead of hunting through guardrail.config.yaml twice.
37
+ if (!config.app) {
38
+ throw new GuardrailError('deploy.adapter=fly requires deploy.app (Fly app slug)', { code: 'invalid_config', provider: 'fly' });
39
+ }
40
+ if (!config.image) {
41
+ throw new GuardrailError('deploy.adapter=fly requires deploy.image (e.g. registry.fly.io/<app>:<tag>)', { code: 'invalid_config', provider: 'fly' });
42
+ }
43
+ return new FlyDeployAdapter({
44
+ app: config.app,
45
+ image: config.image,
46
+ region: config.region,
47
+ });
48
+ }
49
+ case 'render': {
50
+ // v5.6 Phase 2: Render requires `serviceId`. `clearCache` is optional
51
+ // and defaults to `'do_not_clear'` inside the adapter. We surface the
52
+ // missing-field error with the field name so the user knows exactly
53
+ // what to add to guardrail.config.yaml.
54
+ if (!config.serviceId) {
55
+ throw new GuardrailError('deploy.adapter=render requires deploy.serviceId (Render service ID, e.g. srv-abc123)', { code: 'invalid_config', provider: 'render' });
56
+ }
57
+ return new RenderDeployAdapter({
58
+ serviceId: config.serviceId,
59
+ clearCache: config.clearCache,
60
+ });
61
+ }
62
+ case 'generic': {
63
+ if (!config.deployCommand) {
64
+ throw new GuardrailError('deploy.adapter=generic requires deploy.deployCommand (shell command)', { code: 'invalid_config', provider: 'generic' });
65
+ }
66
+ return new GenericDeployAdapter({
67
+ deployCommand: config.deployCommand,
68
+ healthCheckUrl: config.healthCheckUrl,
69
+ });
70
+ }
71
+ default: {
72
+ // exhaustiveness guard — TS narrows config.adapter to never here
73
+ const exhaustive = config.adapter;
74
+ throw new GuardrailError(`Unknown deploy adapter: ${String(exhaustive)}`, { code: 'invalid_config' });
75
+ }
76
+ }
77
+ }
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,181 @@
1
+ import type { DeployAdapter, DeployAdapterCapabilities, DeployInput, DeployLogLine, DeployResult, DeployRollbackInput, DeployStatusInput, DeployStatusResult, DeployStreamLogsInput } from './types.ts';
2
+ /**
3
+ * Render deploy lifecycle states (per https://api-docs.render.com/).
4
+ *
5
+ * Terminal: `live` (success), `deactivated` / `build_failed` /
6
+ * `update_failed` / `canceled` (failure). Everything else is interim and
7
+ * maps to `in-progress` until the polling budget runs out.
8
+ *
9
+ * Render's API has accreted state names over time; new states observed in
10
+ * the wild are treated as `in-progress` rather than guessing pass/fail.
11
+ */
12
+ type RenderDeployStatus = 'created' | 'build_in_progress' | 'update_in_progress' | 'live' | 'deactivated' | 'build_failed' | 'update_failed' | 'canceled';
13
+ interface RenderDeployResponse {
14
+ id: string;
15
+ /** Commit SHA the deploy is built from — Render returns this on every deploy object. */
16
+ commit?: {
17
+ id?: string;
18
+ message?: string;
19
+ };
20
+ /** Lifecycle state. */
21
+ status?: RenderDeployStatus;
22
+ }
23
+ export interface RenderDeployAdapterOptions {
24
+ /** Render API key. Falls back to `process.env.RENDER_API_KEY`. */
25
+ token?: string;
26
+ /** Render service ID (e.g. `srv-abc123`). Required. */
27
+ serviceId: string;
28
+ /**
29
+ * Whether Render should clear the build cache before deploying.
30
+ * Default: `'do_not_clear'`. Maps to the API body field 1:1.
31
+ */
32
+ clearCache?: 'do_not_clear' | 'clear';
33
+ /** Polling interval (ms) when waiting for the deploy to reach a terminal state. Default: 2000. */
34
+ pollIntervalMs?: number;
35
+ /** Maximum total time to poll before returning `in-progress`. Default: 15 minutes. */
36
+ maxPollMs?: number;
37
+ /** Injected fetch implementation — defaults to `globalThis.fetch`. Tests pass a mock. */
38
+ fetchImpl?: typeof fetch;
39
+ /** Injected sleep implementation — tests pass a no-op so they don't actually wait. */
40
+ sleepImpl?: (ms: number) => Promise<void>;
41
+ /** Wall-clock source — tests pass a controllable counter. */
42
+ nowImpl?: () => number;
43
+ /**
44
+ * Optional caller-supplied redaction patterns (in addition to the
45
+ * built-in default set in `core/logging/redaction.ts`). Typically wired
46
+ * from `config.persistence.redactionPatterns` by the CLI; tests omit it.
47
+ */
48
+ redactionPatterns?: readonly string[];
49
+ /**
50
+ * Polling interval (ms) for the `streamLogs` REST polling loop.
51
+ * Defaults to 2000ms per the v5.6 spec § "Render adapter → Logs".
52
+ * Tests override to 0 so they don't actually wait between polls.
53
+ */
54
+ logPollIntervalMs?: number;
55
+ }
56
+ /**
57
+ * Render deploy adapter.
58
+ *
59
+ * Construct once per pipeline run. The adapter is stateless across calls —
60
+ * all configuration (token, serviceId, clearCache) is captured at
61
+ * construction time. Per the v5.6 spec, only `deploy()` and `status()` are
62
+ * wired in Phase 2; `streamLogs` (REST polling) and `rollback` (simulated
63
+ * via re-deploy) land in Phases 3 and 4 respectively.
64
+ */
65
+ export declare class RenderDeployAdapter implements DeployAdapter {
66
+ readonly name = "render";
67
+ readonly capabilities: DeployAdapterCapabilities;
68
+ private readonly token;
69
+ private readonly serviceId;
70
+ private readonly clearCache;
71
+ private readonly pollIntervalMs;
72
+ private readonly maxPollMs;
73
+ private readonly fetchImpl;
74
+ private readonly sleep;
75
+ private readonly now;
76
+ private readonly redactionPatterns;
77
+ private readonly logPollIntervalMs;
78
+ constructor(opts: RenderDeployAdapterOptions);
79
+ deploy(input: DeployInput): Promise<DeployResult>;
80
+ status(input: DeployStatusInput): Promise<DeployStatusResult>;
81
+ /**
82
+ * Phase 3 of v5.6 — REST-polling log stream for a Render deploy.
83
+ *
84
+ * Render has no WebSocket log endpoint (cf. v5.6 spec § "Render adapter →
85
+ * Logs" and capability metadata `streamMode: 'polling'`). This generator
86
+ * polls `GET /v1/services/{serviceId}/logs?deployId={id}&direction=forward
87
+ * &limit=100` every 2s while the deploy is `in-progress` and yields any
88
+ * new lines.
89
+ *
90
+ * Cursor invariant — keyed by `(timestamp, logId)`:
91
+ * - We track the most-recently-yielded `(ts, id)` pair as `cursor`.
92
+ * - On each poll, we discard every returned line whose `(ts, id)` is
93
+ * `<= cursor` (lexicographic on the pair, primary key timestamp). This
94
+ * handles two real cases:
95
+ * 1. Pagination overlap — Render's forward-direction list often
96
+ * repeats the last entry of the prior page as the first entry of
97
+ * the next. Without dedup we'd yield duplicates.
98
+ * 2. Same-millisecond entries — multiple log lines can share a `ts`.
99
+ * The secondary `id` ordering keeps them stable.
100
+ * - We never miss a line: `cursor` advances strictly monotonically, and
101
+ * the polling URL uses `direction=forward` so Render returns lines
102
+ * newer than (or equal to) our cursor's timestamp.
103
+ *
104
+ * Termination:
105
+ * - `signal.aborted` — exit immediately at the next await boundary.
106
+ * - Deploy status reaches a terminal state (live / build_failed /
107
+ * update_failed / canceled / deactivated) — drain one final poll for
108
+ * any tail lines, then exit.
109
+ * - Hard cap of `maxPollMs` ticks — same budget as `pollUntilTerminal`
110
+ * to avoid an infinite generator if status is stuck.
111
+ *
112
+ * Every yielded line's `text` is run through `redactLogLines()` before
113
+ * leaving the adapter.
114
+ */
115
+ streamLogs(input: DeployStreamLogsInput): AsyncGenerator<DeployLogLine>;
116
+ /**
117
+ * Phase 4 of v5.6 — simulated rollback for Render.
118
+ *
119
+ * Render has no native rollback verb, so we simulate by re-deploying a
120
+ * prior commit per spec § "Render adapter → Rollback":
121
+ *
122
+ * - List recent deploys: `GET /v1/services/{serviceId}/deploys?limit=20`.
123
+ * - Select the rollback target:
124
+ * - When `input.to` is set: look up that specific deploy in the list,
125
+ * read its `commit.id`, and re-deploy that commit. Deploy ID becomes
126
+ * the lookup key.
127
+ * - When `input.to` is unset: walk the list newest-first and pick the
128
+ * most recent deploy with `status === 'live'` *that is not the head*.
129
+ * The intent is "go back one" — the head is the deploy we'd be
130
+ * rolling back from.
131
+ * - Re-deploy via `POST /v1/services/{serviceId}/deploys` with `commitId`,
132
+ * then poll until terminal — re-uses the existing `deploy()`-style
133
+ * machinery via `redeployCommit()`.
134
+ *
135
+ * Throws `GuardrailError({ code: 'no_previous_deploy', provider: 'render' })`
136
+ * when no usable prior `live` deploy exists. Throws `not_found` when
137
+ * `input.to` references a deploy that isn't in the recent-20 window.
138
+ *
139
+ * Returns a `DeployResult` with:
140
+ * - `deployId` — the *new* deploy ID Render returned for the re-deploy.
141
+ * - `rolledBackTo` — the *prior* deploy ID we rolled back to.
142
+ * - `output` — human-readable summary of the swap (commits + IDs), redacted.
143
+ */
144
+ rollback(input: DeployRollbackInput): Promise<DeployResult>;
145
+ /**
146
+ * Private helper — re-uses the deploy() POST + poll machinery to redeploy
147
+ * a specific commit. Used by `rollback()` to reissue a prior commit.
148
+ */
149
+ private redeployCommit;
150
+ /**
151
+ * List the most recent deploys for the configured service. Newest-first.
152
+ * `limit` caps the result set — defaults to 20 (the spec's recommended
153
+ * window for the rollback lookup). Each entry includes `id`, `commit.id`,
154
+ * and `status` per the Render REST API.
155
+ */
156
+ listDeploys(limit?: number, signal?: AbortSignal): Promise<RenderDeployResponse[]>;
157
+ /** Apply the adapter's redaction patterns to a log line's `text` field. */
158
+ private redactLine;
159
+ private pollUntilTerminal;
160
+ private shapeResult;
161
+ private headers;
162
+ private buildLogsUrl;
163
+ /**
164
+ * HTTP-status-keyed error mapper. Per v5.6 spec:
165
+ *
166
+ * | Status | ErrorCode |
167
+ * |---|---|
168
+ * | 401 / 403 | `auth` |
169
+ * | 404 | `not_found` |
170
+ * | 422 / 400 | `invalid_config` |
171
+ * | 5xx | `transient_network` (retryable) |
172
+ * | other 4xx | `adapter_bug` |
173
+ *
174
+ * Render echoes a request-id on the `x-request-id` header on most
175
+ * responses. We capture it into `details.renderRequestId` whenever
176
+ * present so support tickets can quote it back to Render.
177
+ */
178
+ private assertOkOrThrow;
179
+ }
180
+ export {};
181
+ //# sourceMappingURL=render.d.ts.map