@osolmaz/pi-workflows 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +15 -6
  2. package/dist/builtins/autoimplement-command-batches.d.ts +52 -0
  3. package/dist/builtins/autoimplement-command-batches.js +258 -0
  4. package/dist/builtins/autoimplement-command-batches.js.map +1 -0
  5. package/dist/builtins/autoimplement.workflow.d.ts +29 -3
  6. package/dist/builtins/autoimplement.workflow.js +876 -231
  7. package/dist/builtins/autoimplement.workflow.js.map +1 -1
  8. package/dist/builtins/catalog.js +3 -1
  9. package/dist/builtins/catalog.js.map +1 -1
  10. package/dist/builtins/index.d.ts +2 -0
  11. package/dist/builtins/index.js +1 -0
  12. package/dist/builtins/index.js.map +1 -1
  13. package/dist/builtins/sanity-check-session.d.ts +17 -0
  14. package/dist/builtins/sanity-check-session.js +168 -0
  15. package/dist/builtins/sanity-check-session.js.map +1 -0
  16. package/dist/builtins/sanity-check.workflow.d.ts +83 -0
  17. package/dist/builtins/sanity-check.workflow.js +398 -0
  18. package/dist/builtins/sanity-check.workflow.js.map +1 -0
  19. package/dist/controllers/sqlite.d.ts +141 -5
  20. package/dist/controllers/sqlite.js +568 -46
  21. package/dist/controllers/sqlite.js.map +1 -1
  22. package/dist/extension/decision-channels.js +7 -7
  23. package/dist/extension/deferred-turn-coordinator.d.ts +32 -0
  24. package/dist/extension/deferred-turn-coordinator.js +143 -0
  25. package/dist/extension/deferred-turn-coordinator.js.map +1 -0
  26. package/dist/extension/deferred-turn.d.ts +44 -0
  27. package/dist/extension/deferred-turn.js +110 -0
  28. package/dist/extension/deferred-turn.js.map +1 -0
  29. package/dist/extension/index.js +515 -84
  30. package/dist/extension/index.js.map +1 -1
  31. package/dist/extension/step-message.d.ts +1 -0
  32. package/dist/extension/step-message.js.map +1 -1
  33. package/dist/herdr/setup.js +4 -4
  34. package/dist/host/runner.js +3 -0
  35. package/dist/host/runner.js.map +1 -1
  36. package/dist/workflows/command-batch.d.ts +38 -0
  37. package/dist/workflows/command-batch.js +176 -0
  38. package/dist/workflows/command-batch.js.map +1 -0
  39. package/dist/workflows/engine.js +8 -4
  40. package/dist/workflows/engine.js.map +1 -1
  41. package/dist/workflows/index.d.ts +1 -0
  42. package/dist/workflows/index.js +1 -0
  43. package/dist/workflows/index.js.map +1 -1
  44. package/dist/workflows/migrate-sources.d.ts +1 -1
  45. package/dist/workflows/migrate-sources.js.map +1 -1
  46. package/dist/workflows/schema.js +2 -1
  47. package/dist/workflows/schema.js.map +1 -1
  48. package/dist/workflows/shell.d.ts +4 -0
  49. package/dist/workflows/shell.js +6 -0
  50. package/dist/workflows/shell.js.map +1 -1
  51. package/dist/workflows/store.js +3 -1
  52. package/dist/workflows/store.js.map +1 -1
  53. package/dist/workflows/tool-input.d.ts +1 -0
  54. package/dist/workflows/tool-input.js +2 -2
  55. package/dist/workflows/tool-input.js.map +1 -1
  56. package/dist/workflows/types.d.ts +4 -3
  57. package/docs/2026-08-18-herdr-piw-plan.md +1 -1
  58. package/docs/2026-08-20-durable-workflow-launch-plan.md +445 -0
  59. package/docs/CONTROLLERS.md +2 -2
  60. package/docs/DEFERRED_TURNS.md +298 -0
  61. package/docs/DESIGN_PHILOSOPHY.md +1 -1
  62. package/docs/HUMAN_DECISIONS.md +7 -7
  63. package/docs/HUMAN_DECISION_PRESENTATIONS.md +3 -3
  64. package/docs/MONITOR.md +2 -2
  65. package/docs/WORKFLOW_COMPOSITION.md +2 -2
  66. package/docs/WORKFLOW_STEP_MESSAGES.md +5 -5
  67. package/docs/WORKFLOW_UPDATES.md +28 -5
  68. package/docs/plans/2026-08-04-controller-runtime-plan.md +1 -1
  69. package/docs/plans/2026-08-05-always-on-workflows-plan.md +1 -1
  70. package/docs/plans/2026-08-10-agent-managed-monitor-workflows-plan.md +9 -9
  71. package/docs/plans/2026-08-13-built-in-workflow-catalog-plan.md +1 -1
  72. package/docs/plans/2026-08-13-session-addressed-workflow-notifications-plan.md +1 -1
  73. package/docs/plans/2026-08-16-workflow-updates-plan.md +3 -3
  74. package/docs/plans/2026-08-17-bundled-skills-plan.md +6 -6
  75. package/docs/plans/2026-08-19-human-decision-gates-plan.md +5 -5
  76. package/docs/plans/2026-08-19-human-decision-presentations-plan.md +1 -1
  77. package/docs/plans/2026-08-19-provider-compatible-workflow-tool-schema-plan.md +1 -1
  78. package/docs/plans/2026-08-19-workflow-composition-plan.md +6 -6
  79. package/docs/plans/2026-08-20-autoimplement-blocker-challenge-plan.md +3 -3
  80. package/docs/plans/2026-08-20-bounded-command-batches-plan.md +206 -0
  81. package/docs/plans/2026-08-20-herdr-plugin-sync-plan.md +9 -9
  82. package/docs/plans/2026-08-21-autoimplement-timeout-fallback-plan.md +242 -0
  83. package/docs/plans/2026-08-21-deferred-turn-intents-plan.md +324 -0
  84. package/docs/plans/2026-08-21-sanity-check-plan.md +175 -0
  85. package/docs/run-bundles.md +3 -1
  86. package/docs/workflows.md +67 -17
  87. package/examples/workflows/command-batch.workflow.ts +50 -0
  88. package/examples/workflows/sanity-check.workflow.ts +1 -0
  89. package/herdr-plugin.toml +3 -3
  90. package/package.json +1 -1
  91. package/schemas/decision-presentation-v1.schema.json +1 -1
  92. package/schemas/human-decision-accepted-v1.schema.json +1 -1
  93. package/schemas/human-decision-accepted-v2.schema.json +1 -1
  94. package/schemas/human-decision-answer-attempt-v1.schema.json +1 -1
  95. package/schemas/human-decision-cancellation-v1.schema.json +1 -1
  96. package/schemas/human-decision-continuation-v1.schema.json +1 -1
  97. package/schemas/human-decision-delivery-v1.schema.json +1 -1
  98. package/schemas/human-decision-delivery-v2.schema.json +1 -1
  99. package/schemas/human-decision-receipt-v1.schema.json +1 -1
  100. package/schemas/human-decision-receipt-v2.schema.json +1 -1
  101. package/schemas/human-decision-request-v1.schema.json +1 -1
  102. package/schemas/human-decision-request-v2.schema.json +1 -1
  103. package/schemas/human-decision-resolution-v1.schema.json +1 -1
  104. package/schemas/human-decision-resolution-v2.schema.json +1 -1
  105. package/schemas/human-decision-settlement-v1.schema.json +1 -1
  106. package/skills/autodoc/SKILL.md +33 -2
  107. package/skills/autoimplement/SKILL.md +66 -12
  108. package/skills/autoplan/SKILL.md +26 -2
  109. package/skills/monitor/SKILL.md +35 -21
  110. package/skills/pi-workflows/SKILL.md +19 -5
  111. package/src/builtins/autoimplement-command-batches.ts +364 -0
  112. package/src/builtins/autoimplement.workflow.ts +1065 -261
  113. package/src/builtins/catalog.ts +3 -1
  114. package/src/builtins/index.ts +13 -0
  115. package/src/builtins/sanity-check-session.ts +205 -0
  116. package/src/builtins/sanity-check.workflow.ts +624 -0
  117. package/src/controllers/sqlite.ts +878 -51
  118. package/src/extension/decision-channels.ts +7 -7
  119. package/src/extension/deferred-turn-coordinator.ts +171 -0
  120. package/src/extension/deferred-turn.ts +166 -0
  121. package/src/extension/index.ts +646 -91
  122. package/src/extension/step-message.ts +1 -0
  123. package/src/herdr/setup.ts +4 -4
  124. package/src/host/runner.ts +3 -0
  125. package/src/workflows/command-batch.ts +254 -0
  126. package/src/workflows/engine.ts +8 -5
  127. package/src/workflows/index.ts +15 -0
  128. package/src/workflows/migrate-sources.ts +5 -1
  129. package/src/workflows/schema.ts +2 -1
  130. package/src/workflows/shell.ts +10 -0
  131. package/src/workflows/store.ts +3 -1
  132. package/src/workflows/tool-input.ts +5 -2
  133. package/src/workflows/types.ts +4 -3
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # pi-workflows
2
2
 
3
+ <p align="center">
4
+ <img src="assets/cover.svg" alt="pi-workflows: a representative multi-step workflow graph with plan, implement, verify, review, a fix loop, and a clean finish" width="880">
5
+ </p>
6
+
3
7
  pi-workflows is a workflow extension for the [pi coding agent](https://pi.dev).
4
8
  It lets you define multi-step agent workflows as TypeScript graphs, trigger
5
9
  them at any point in a pi conversation with `/workflow`, and watch them run
@@ -76,14 +80,14 @@ or run it in place with `npx tsx src/viewer/cli.ts`.
76
80
 
77
81
  ## Herdr integration
78
82
 
79
- Pi Workflows also ships as a [Herdr](https://herdr.dev) plugin. After installing
80
- `piw` and Pi Workflows, synchronize the bundled plugin:
83
+ pi-workflows also ships as a [Herdr](https://herdr.dev) plugin. After installing
84
+ `piw` and pi-workflows, synchronize the bundled plugin:
81
85
 
82
86
  ```bash
83
87
  pi-workflows herdr sync
84
88
  ```
85
89
 
86
- Run the same command after a Pi Workflows update. It finds the package that
90
+ Run the same command after a pi-workflows update. It finds the package that
87
91
  provides the running CLI and repairs a Herdr link when npm moved that package.
88
92
  `pi-workflows herdr setup` remains an alias for existing installations. Use
89
93
  `--json` for versioned machine-readable output. The [Herdr plugin sync
@@ -94,7 +98,7 @@ When Pi runs inside Herdr, a workflow widget shows `Ctrl+Shift+R piw`. When the
94
98
  The shortcut opens the exact run bundle and lets you choose a split, tab, or new
95
99
  workspace. `/piw` opens the same menu, and `/piw right`, `/piw below`, `/piw
96
100
  left`, `/piw above`, `/piw tab`, or `/piw workspace` selects a placement
97
- directly. If a viewer for that run already exists, Pi Workflows focuses it
101
+ directly. If a viewer for that run already exists, pi-workflows focuses it
98
102
  instead of opening a duplicate.
99
103
 
100
104
  The plugin uses Herdr's public pane APIs and runs no service or polling loop. It
@@ -129,6 +133,11 @@ Then, from any pi conversation:
129
133
  /workflow echo summarize this repository
130
134
  ```
131
135
 
136
+ A model-started workflow is saved before the tool reports it as queued. The returned run ID works
137
+ with `workflow status` and `workflow cancel` before execution starts. pi-workflows waits for the
138
+ current agent turn to settle before activation. If activation fails, it saves the failure and sends
139
+ one follow-up turn so the model can correct the cause and start a new run.
140
+
132
141
  `/workflow` with no arguments lists discovered workflows. `/workflow pause`
133
142
  lets the current step finish and then holds the run before the next node. This
134
143
  is useful when you want to interject in the conversation mid-workflow.
@@ -186,7 +195,7 @@ The model can use the same `workflow` tool to list, start, inspect, pause,
186
195
  resume, cancel, and answer workflows. Step contracts use the tool's `submit`
187
196
  action. Slash commands and model actions share one lifecycle implementation.
188
197
 
189
- Pi Workflows includes a `monitor` workflow for plain-language requests such as:
198
+ pi-workflows includes a `monitor` workflow for plain-language requests such as:
190
199
 
191
200
  > Monitor PR 123 every 30 minutes. Report failed checks. Stop when it is merged or closed.
192
201
 
@@ -347,7 +356,7 @@ example set. Copy any of them into `.pi/workflows/` to use them:
347
356
  a detailed implementation plan, using the ideal end state as guidance rather
348
357
  than an out-of-scope requirement.
349
358
  - `autoimplement` finds a clear existing plan, documents it when needed,
350
- implements and verifies it, writes and runs the exact Pi Reviewer command,
359
+ implements and verifies it, writes and runs the exact pi-reviewer command,
351
360
  tracks P0 through P2, handles PR comments and CI, and
352
361
  finalizes the PR. P0 and P1 fixes require another review. P2-only work is
353
362
  verified without another reviewer round. A five-minute CI wait routes to
@@ -0,0 +1,52 @@
1
+ import { type CommandBatchItem } from "../workflows/command-batch.js";
2
+ export declare const REVIEW_TIMEOUT_MS: number;
3
+ export declare const CI_WATCH_TIMEOUT_MS: number;
4
+ export declare const VERIFICATION_TIMEOUT_MS: number;
5
+ export declare const AUTOIMPLEMENT_BATCH_MAX_OUTPUT_CHARS = 1000000;
6
+ export declare const AUTOIMPLEMENT_MAX_CONCURRENCY = 8;
7
+ export type AutoimplementConcurrency = {
8
+ reviewer: number;
9
+ ciWatch: number;
10
+ verification: number;
11
+ };
12
+ export type PublishedRepository = {
13
+ id: string;
14
+ repository: string;
15
+ branch: string;
16
+ baseBranch: string;
17
+ headRevision: string;
18
+ pr: string;
19
+ dependencyFingerprint?: string;
20
+ };
21
+ export type PublishedRepositories = {
22
+ repositories: PublishedRepository[];
23
+ };
24
+ export type VerificationCommandPlan = {
25
+ commands: CommandBatchItem[];
26
+ untested: string[];
27
+ };
28
+ export type CiTargetInspection = {
29
+ id: string;
30
+ repository: string;
31
+ headRevision: string;
32
+ pr: string;
33
+ route: "green" | "failed" | "pending" | "unavailable";
34
+ reason: string;
35
+ relatedFailures: string[];
36
+ unrelatedFailures: string[];
37
+ trackingCommand?: CommandBatchItem;
38
+ };
39
+ export type CiInspectionBatch = {
40
+ route: "green" | "failed" | "pending" | "unavailable";
41
+ reason: string;
42
+ relatedFailures: string[];
43
+ unrelatedFailures: string[];
44
+ targets: CiTargetInspection[];
45
+ };
46
+ export declare function parseAutoimplementConcurrency(value: unknown): AutoimplementConcurrency;
47
+ export declare function parsePublishedRepositories(value: unknown): PublishedRepositories;
48
+ export declare function reviewerCommand(repository: PublishedRepository): CommandBatchItem;
49
+ export declare function parseVerificationCommandPlan(value: unknown): VerificationCommandPlan;
50
+ export declare function parseCiInspectionBatch(value: unknown): CiInspectionBatch;
51
+ export declare function parseCiCommand(value: unknown, id: string, repository: string, pr: string): CommandBatchItem;
52
+ export declare function repositoryId(repository: string): string;
@@ -0,0 +1,258 @@
1
+ import { createHash } from "node:crypto";
2
+ import path from "node:path";
3
+ import { MAX_COMMAND_BATCH_ITEMS, validateCommandBatchRequest, } from "../workflows/command-batch.js";
4
+ export const REVIEW_TIMEOUT_MS = 10 * 60_000;
5
+ export const CI_WATCH_TIMEOUT_MS = 5 * 60_000;
6
+ export const VERIFICATION_TIMEOUT_MS = 45 * 60_000;
7
+ export const AUTOIMPLEMENT_BATCH_MAX_OUTPUT_CHARS = 1_000_000;
8
+ export const AUTOIMPLEMENT_MAX_CONCURRENCY = 8;
9
+ export function parseAutoimplementConcurrency(value) {
10
+ if (value === undefined)
11
+ return { reviewer: 4, ciWatch: 4, verification: 2 };
12
+ const input = requireRecord(value, "autoimplement concurrency");
13
+ for (const key of Object.keys(input)) {
14
+ if (key !== "reviewer" && key !== "ciWatch" && key !== "verification") {
15
+ throw new Error(`autoimplement concurrency.${key} is not supported`);
16
+ }
17
+ }
18
+ return {
19
+ reviewer: concurrencyValue(input.reviewer ?? 4, "reviewer"),
20
+ ciWatch: concurrencyValue(input.ciWatch ?? 4, "ciWatch"),
21
+ verification: concurrencyValue(input.verification ?? 2, "verification"),
22
+ };
23
+ }
24
+ export function parsePublishedRepositories(value) {
25
+ const result = requireRecord(value, "publication result");
26
+ if (!Array.isArray(result.repositories) || result.repositories.length === 0) {
27
+ throw new Error("publication result repositories must be a non-empty array");
28
+ }
29
+ if (result.repositories.length > MAX_COMMAND_BATCH_ITEMS) {
30
+ throw new Error(`publication result repositories must contain at most ${MAX_COMMAND_BATCH_ITEMS} entries`);
31
+ }
32
+ const ids = new Set();
33
+ const repositories = result.repositories.map((entry, index) => {
34
+ const raw = requireRecord(entry, `publication repositories[${index}]`);
35
+ const repository = requireAbsolutePath(raw.repository, `publication repositories[${index}].repository`);
36
+ const id = repositoryId(repository);
37
+ if (ids.has(id))
38
+ throw new Error(`publication repository is duplicated: ${repository}`);
39
+ ids.add(id);
40
+ const dependencyFingerprint = optionalString(raw.dependencyFingerprint, `publication repositories[${index}].dependencyFingerprint`);
41
+ if (raw.pushed !== true) {
42
+ throw new Error(`publication repositories[${index}].pushed must be true`);
43
+ }
44
+ return {
45
+ id,
46
+ repository,
47
+ branch: requireString(raw.branch, `publication repositories[${index}].branch`),
48
+ baseBranch: requireString(raw.baseBranch, `publication repositories[${index}].baseBranch`),
49
+ headRevision: requireString(raw.headRevision, `publication repositories[${index}].headRevision`),
50
+ pr: requireString(raw.pr, `publication repositories[${index}].pr`),
51
+ ...(dependencyFingerprint !== undefined ? { dependencyFingerprint } : {}),
52
+ };
53
+ });
54
+ return { repositories };
55
+ }
56
+ export function reviewerCommand(repository) {
57
+ return {
58
+ id: repository.id,
59
+ command: "pi-reviewer",
60
+ args: ["--base", repository.baseBranch],
61
+ cwd: repository.repository,
62
+ timeoutMs: REVIEW_TIMEOUT_MS,
63
+ maxOutputChars: AUTOIMPLEMENT_BATCH_MAX_OUTPUT_CHARS,
64
+ };
65
+ }
66
+ export function parseVerificationCommandPlan(value) {
67
+ const result = requireRecord(value, "verification command plan");
68
+ if (!Array.isArray(result.commands) || result.commands.length === 0) {
69
+ throw new Error("verification commands must be a non-empty array");
70
+ }
71
+ const directories = new Set();
72
+ const commands = result.commands.map((entry, index) => {
73
+ const command = parseCommandItem(entry, `verification commands[${index}]`, {
74
+ maxTimeoutMs: VERIFICATION_TIMEOUT_MS,
75
+ });
76
+ if (directories.has(command.cwd)) {
77
+ throw new Error(`verification commands must use distinct working directories: ${command.cwd}`);
78
+ }
79
+ directories.add(command.cwd);
80
+ validateVerificationCommand(command, index);
81
+ return command;
82
+ });
83
+ const validated = validateCommandBatchRequest({ items: commands, maxConcurrency: 1 });
84
+ return {
85
+ commands: validated.items,
86
+ untested: stringArray(result.untested ?? [], "verification untested"),
87
+ };
88
+ }
89
+ export function parseCiInspectionBatch(value) {
90
+ const result = requireRecord(value, "CI inspection");
91
+ if (!Array.isArray(result.targets) || result.targets.length === 0) {
92
+ throw new Error("CI inspection targets must be a non-empty array");
93
+ }
94
+ if (result.targets.length > MAX_COMMAND_BATCH_ITEMS) {
95
+ throw new Error(`CI inspection targets must contain at most ${MAX_COMMAND_BATCH_ITEMS} entries`);
96
+ }
97
+ const ids = new Set();
98
+ const targets = result.targets.map((entry, index) => {
99
+ const raw = requireRecord(entry, `CI targets[${index}]`);
100
+ const repository = requireAbsolutePath(raw.repository, `CI targets[${index}].repository`);
101
+ const id = repositoryId(repository);
102
+ if (ids.has(id))
103
+ throw new Error(`CI target is duplicated: ${repository}`);
104
+ ids.add(id);
105
+ if (raw.route !== "green" &&
106
+ raw.route !== "failed" &&
107
+ raw.route !== "pending" &&
108
+ raw.route !== "unavailable") {
109
+ throw new Error(`CI targets[${index}].route is invalid`);
110
+ }
111
+ const pr = requireString(raw.pr, `CI targets[${index}].pr`);
112
+ const target = {
113
+ id,
114
+ repository,
115
+ headRevision: requireString(raw.headRevision, `CI targets[${index}].headRevision`),
116
+ pr,
117
+ route: raw.route,
118
+ reason: requireString(raw.reason, `CI targets[${index}].reason`),
119
+ relatedFailures: stringArray(raw.relatedFailures ?? [], `CI targets[${index}].relatedFailures`),
120
+ unrelatedFailures: stringArray(raw.unrelatedFailures ?? [], `CI targets[${index}].unrelatedFailures`),
121
+ };
122
+ if (raw.route === "pending") {
123
+ target.trackingCommand = parseCiCommand(raw.trackingCommand, id, repository, pr);
124
+ }
125
+ return target;
126
+ });
127
+ const route = targets.some((target) => target.route === "failed")
128
+ ? "failed"
129
+ : targets.some((target) => target.route === "pending")
130
+ ? "pending"
131
+ : targets.some((target) => target.route === "unavailable")
132
+ ? "unavailable"
133
+ : "green";
134
+ return {
135
+ route,
136
+ reason: targets.map((target) => `${target.id}: ${target.reason}`).join("; "),
137
+ relatedFailures: targets.flatMap((target) => target.relatedFailures),
138
+ unrelatedFailures: targets.flatMap((target) => target.unrelatedFailures),
139
+ targets,
140
+ };
141
+ }
142
+ export function parseCiCommand(value, id, repository, pr) {
143
+ const raw = requireRecord(value, "CI tracking command");
144
+ if (raw.id !== id)
145
+ throw new Error("CI tracking command id must match the target repository");
146
+ const command = parseCommandItem(raw, "CI tracking command", {
147
+ id,
148
+ command: "gh",
149
+ cwd: repository,
150
+ maxTimeoutMs: CI_WATCH_TIMEOUT_MS,
151
+ });
152
+ const args = command.args;
153
+ const prWatch = (args.length === 3 && args[0] === "pr" && args[1] === "checks" && args[2] === "--watch") ||
154
+ (args.length === 4 &&
155
+ args[0] === "pr" &&
156
+ args[1] === "checks" &&
157
+ args[2] === pr &&
158
+ args[3] === "--watch");
159
+ const runWatch = args.length === 3 &&
160
+ args[0] === "run" &&
161
+ args[1] === "watch" &&
162
+ /^[1-9]\d*$/.test(args[2] ?? "");
163
+ if (!prWatch && !runWatch) {
164
+ throw new Error("CI tracking command args are not allowed for the target PR");
165
+ }
166
+ return { ...command, args: ["pr", "checks", pr, "--watch"] };
167
+ }
168
+ export function repositoryId(repository) {
169
+ const canonical = path.resolve(repository);
170
+ return createHash("sha256").update(canonical).digest("hex").slice(0, 16);
171
+ }
172
+ function parseCommandItem(value, label, options) {
173
+ const raw = requireRecord(value, label);
174
+ const id = options.id ?? requireString(raw.id, `${label}.id`);
175
+ const command = options.command ?? requireString(raw.command, `${label}.command`);
176
+ if (options.command !== undefined && raw.command !== options.command) {
177
+ throw new Error(`${label}.command must be ${options.command}`);
178
+ }
179
+ if (!Array.isArray(raw.args) || raw.args.some((arg) => typeof arg !== "string")) {
180
+ throw new Error(`${label}.args must be an array of strings`);
181
+ }
182
+ const cwd = options.cwd ?? requireAbsolutePath(raw.cwd, `${label}.cwd`);
183
+ if (options.cwd !== undefined && path.resolve(String(raw.cwd)) !== options.cwd) {
184
+ throw new Error(`${label}.cwd must match the target repository`);
185
+ }
186
+ const timeoutMs = positiveInteger(raw.timeoutMs, `${label}.timeoutMs`, options.maxTimeoutMs);
187
+ const maxOutputChars = positiveInteger(raw.maxOutputChars ?? AUTOIMPLEMENT_BATCH_MAX_OUTPUT_CHARS, `${label}.maxOutputChars`, AUTOIMPLEMENT_BATCH_MAX_OUTPUT_CHARS);
188
+ return { id, command, args: [...raw.args], cwd, timeoutMs, maxOutputChars };
189
+ }
190
+ function validateVerificationCommand(command, index) {
191
+ const forbiddenCommands = new Set([
192
+ "ash",
193
+ "bash",
194
+ "cmd",
195
+ "cmd.exe",
196
+ "csh",
197
+ "dash",
198
+ "fish",
199
+ "gh",
200
+ "git",
201
+ "ksh",
202
+ "powershell",
203
+ "powershell.exe",
204
+ "pwsh",
205
+ "pwsh.exe",
206
+ "rm",
207
+ "sh",
208
+ "tcsh",
209
+ "zsh",
210
+ ]);
211
+ const executable = path.win32.basename(path.basename(command.command)).toLowerCase();
212
+ if (forbiddenCommands.has(executable)) {
213
+ throw new Error(`verification commands[${index}].command is not allowed`);
214
+ }
215
+ const joined = command.args.join(" ").toLowerCase();
216
+ if (/\b(publish|release|deploy|push|merge)\b/.test(joined)) {
217
+ throw new Error(`verification commands[${index}] contains a mutation or publication action`);
218
+ }
219
+ }
220
+ function concurrencyValue(value, field) {
221
+ return positiveInteger(value, `autoimplement concurrency.${field}`, AUTOIMPLEMENT_MAX_CONCURRENCY);
222
+ }
223
+ function positiveInteger(value, label, maximum) {
224
+ if (!Number.isSafeInteger(value) || value < 1 || value > maximum) {
225
+ throw new Error(`${label} must be an integer from 1 through ${maximum}`);
226
+ }
227
+ return value;
228
+ }
229
+ function stringArray(value, label) {
230
+ if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
231
+ throw new Error(`${label} must be an array of strings`);
232
+ }
233
+ return [...value];
234
+ }
235
+ function requireRecord(value, label) {
236
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
237
+ throw new Error(`${label} must be an object`);
238
+ }
239
+ return value;
240
+ }
241
+ function requireString(value, label) {
242
+ if (typeof value !== "string" || value.trim().length === 0) {
243
+ throw new Error(`${label} must be a non-empty string`);
244
+ }
245
+ return value;
246
+ }
247
+ function optionalString(value, label) {
248
+ if (value === undefined)
249
+ return undefined;
250
+ return requireString(value, label);
251
+ }
252
+ function requireAbsolutePath(value, label) {
253
+ const resolved = requireString(value, label);
254
+ if (!path.isAbsolute(resolved))
255
+ throw new Error(`${label} must be absolute`);
256
+ return path.resolve(resolved);
257
+ }
258
+ //# sourceMappingURL=autoimplement-command-batches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoimplement-command-batches.js","sourceRoot":"","sources":["../../src/builtins/autoimplement-command-batches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,GAE5B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAG,MAAM,CAAC;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,MAAM,CAAC;AACnD,MAAM,CAAC,MAAM,oCAAoC,GAAG,SAAS,CAAC;AAC9D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AA+C/C,MAAM,UAAU,6BAA6B,CAAC,KAAc;IAC1D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,Q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CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { WorkflowNodeContext } from "../workflows/types.js";
2
2
  import { type AutodocInput } from "./autodoc.workflow.js";
3
+ import { type AutoimplementConcurrency } from "./autoimplement-command-batches.js";
3
4
  import { type AutoplanInput } from "./autoplan.workflow.js";
4
5
  import { type PlanApprovalInput } from "./plan-approval.workflow.js";
5
6
  export type AutoimplementInput = {
@@ -20,6 +21,7 @@ export type AutoimplementInput = {
20
21
  audience: string;
21
22
  maxReplans: number;
22
23
  };
24
+ concurrency?: Partial<AutoimplementConcurrency>;
23
25
  };
24
26
  export type ExistingPlanDiscovery = {
25
27
  route: "found" | "blocked";
@@ -34,6 +36,19 @@ type ReviewFinding = {
34
36
  kind: "design" | "implementation";
35
37
  summary: string;
36
38
  };
39
+ type RepositoryReviewAssessment = {
40
+ id: string;
41
+ repository: string;
42
+ baseBranch: string;
43
+ headRevision: string;
44
+ dependencyFingerprint?: string;
45
+ invocationSucceeded: boolean;
46
+ p0: ReviewFinding[];
47
+ p1: ReviewFinding[];
48
+ p2: ReviewFinding[];
49
+ lower: ReviewFinding[];
50
+ reason: string;
51
+ };
37
52
  type ReviewAssessment = {
38
53
  route: "critical" | "p2" | "clean" | "command_error";
39
54
  invocationSucceeded: boolean;
@@ -42,6 +57,7 @@ type ReviewAssessment = {
42
57
  p2: ReviewFinding[];
43
58
  lower: ReviewFinding[];
44
59
  reason: string;
60
+ repositories?: RepositoryReviewAssessment[];
45
61
  };
46
62
  export type AutoimplementCompleted = {
47
63
  status: "completed";
@@ -195,16 +211,26 @@ export declare const autoimplementWorkflow: import("../workflows/types.js").Work
195
211
  readonly adoptPlan: import("../workflows/types.js").ComputeNodeDefinition;
196
212
  readonly maybeApproval: import("../workflows/types.js").ComputeNodeDefinition;
197
213
  readonly replanGuard: import("../workflows/types.js").ComputeNodeDefinition;
214
+ readonly timeoutFallbackGuard: import("../workflows/types.js").ComputeNodeDefinition;
215
+ readonly timeoutFallback: import("../workflows/types.js").AgentNodeDefinition;
216
+ readonly routeTimeoutFallback: import("../workflows/types.js").ComputeNodeDefinition;
217
+ readonly propagateSupportedFailure: import("../workflows/types.js").ComputeNodeDefinition;
218
+ readonly routeVerifyP2Result: import("../workflows/types.js").ComputeNodeDefinition;
219
+ readonly routeInspectCommentsResult: import("../workflows/types.js").ComputeNodeDefinition;
220
+ readonly routeInspectCiResult: import("../workflows/types.js").ComputeNodeDefinition;
221
+ readonly routeFinalizeDeliveryResult: import("../workflows/types.js").ComputeNodeDefinition;
198
222
  readonly implement: import("../workflows/types.js").AgentNodeDefinition;
199
223
  readonly classifyImplementation: import("../workflows/types.js").AgentNodeDefinition;
200
224
  readonly challengeBlockerGuard: import("../workflows/types.js").ComputeNodeDefinition;
201
225
  readonly challengeBlocker: import("../workflows/types.js").AgentNodeDefinition;
226
+ readonly planVerification: import("../workflows/types.js").AgentNodeDefinition;
227
+ readonly runVerification: import("../workflows/types.js").FunctionActionNodeDefinition;
202
228
  readonly verify: import("../workflows/types.js").AgentNodeDefinition;
203
229
  readonly classifyVerification: import("../workflows/types.js").AgentNodeDefinition;
204
230
  readonly fix: import("../workflows/types.js").AgentNodeDefinition;
205
231
  readonly publish: import("../workflows/types.js").AgentNodeDefinition;
206
- readonly authorReviewCommand: import("../workflows/types.js").AgentNodeDefinition;
207
- readonly runReview: import("../workflows/types.js").ShellActionNodeDefinition;
232
+ readonly selectReviewCommands: import("../workflows/types.js").ComputeNodeDefinition;
233
+ readonly runReview: import("../workflows/types.js").FunctionActionNodeDefinition;
208
234
  readonly repairReviewCommand: import("../workflows/types.js").AgentNodeDefinition;
209
235
  readonly assessReview: import("../workflows/types.js").AgentNodeDefinition;
210
236
  readonly triageReview: import("../workflows/types.js").ComputeNodeDefinition;
@@ -212,7 +238,7 @@ export declare const autoimplementWorkflow: import("../workflows/types.js").Work
212
238
  readonly verifyP2: import("../workflows/types.js").AgentNodeDefinition;
213
239
  readonly inspectComments: import("../workflows/types.js").AgentNodeDefinition;
214
240
  readonly inspectCi: import("../workflows/types.js").AgentNodeDefinition;
215
- readonly trackCi: import("../workflows/types.js").ShellActionNodeDefinition;
241
+ readonly trackCi: import("../workflows/types.js").FunctionActionNodeDefinition;
216
242
  readonly repairCiCommand: import("../workflows/types.js").AgentNodeDefinition;
217
243
  readonly assessTrackedCi: import("../workflows/types.js").AgentNodeDefinition;
218
244
  readonly opportunisticTest: import("../workflows/types.js").AgentNodeDefinition;