@osolmaz/pi-workflows 0.13.0 → 0.13.1

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 (45) hide show
  1. package/README.md +7 -5
  2. package/dist/builtins/autodoc.workflow.d.ts +191 -4
  3. package/dist/builtins/autodoc.workflow.js +156 -30
  4. package/dist/builtins/autodoc.workflow.js.map +1 -1
  5. package/dist/builtins/autoimplement-command-batches.d.ts +1 -0
  6. package/dist/builtins/autoimplement-command-batches.js +29 -31
  7. package/dist/builtins/autoimplement-command-batches.js.map +1 -1
  8. package/dist/builtins/autoimplement.workflow.d.ts +1255 -29
  9. package/dist/builtins/autoimplement.workflow.js +416 -153
  10. package/dist/builtins/autoimplement.workflow.js.map +1 -1
  11. package/dist/builtins/catalog.js +2 -2
  12. package/dist/builtins/catalog.js.map +1 -1
  13. package/dist/builtins/change-verification.workflow.d.ts +110 -0
  14. package/dist/builtins/change-verification.workflow.js +860 -0
  15. package/dist/builtins/change-verification.workflow.js.map +1 -0
  16. package/dist/builtins/monitor.workflow.js +4 -3
  17. package/dist/builtins/monitor.workflow.js.map +1 -1
  18. package/dist/builtins/plan-change.workflow.d.ts +359 -6
  19. package/dist/builtins/plan-change.workflow.js +26 -0
  20. package/dist/builtins/plan-change.workflow.js.map +1 -1
  21. package/dist/builtins/workspace-preparation.workflow.d.ts +75 -0
  22. package/dist/builtins/workspace-preparation.workflow.js +498 -0
  23. package/dist/builtins/workspace-preparation.workflow.js.map +1 -0
  24. package/dist/extension/executor.js +1 -4
  25. package/dist/extension/executor.js.map +1 -1
  26. package/dist/extension/index.js +0 -14
  27. package/dist/extension/index.js.map +1 -1
  28. package/docs/WORKFLOW_COMPOSITION.md +8 -0
  29. package/docs/plans/2026-08-23-assistant-agent-completion-plan.md +1 -1
  30. package/docs/plans/2026-08-24-change-scoped-verification-plan.md +419 -0
  31. package/docs/workflows.md +8 -13
  32. package/herdr-plugin.toml +1 -1
  33. package/package.json +1 -1
  34. package/skills/autodoc/SKILL.md +7 -0
  35. package/skills/autoimplement/SKILL.md +4 -0
  36. package/src/builtins/autodoc.workflow.ts +184 -33
  37. package/src/builtins/autoimplement-command-batches.ts +39 -33
  38. package/src/builtins/autoimplement.workflow.ts +483 -175
  39. package/src/builtins/catalog.ts +2 -2
  40. package/src/builtins/change-verification.workflow.ts +1143 -0
  41. package/src/builtins/monitor.workflow.ts +6 -3
  42. package/src/builtins/plan-change.workflow.ts +35 -0
  43. package/src/builtins/workspace-preparation.workflow.ts +668 -0
  44. package/src/extension/executor.ts +1 -4
  45. package/src/extension/index.ts +0 -14
@@ -795,6 +795,11 @@ const monitorWorkflow: WorkflowDefinition = defineWorkflow({
795
795
  const request = actionFrom(outputs);
796
796
  const documented = currentRepairPlan(outputs);
797
797
  if (request.kind !== "repair") throw new Error("monitor repair action is missing");
798
+ if (request.authority.repository === undefined) {
799
+ throw new Error(
800
+ "monitor repair requires an absolute repository for workspace preparation",
801
+ );
802
+ }
798
803
  const implementationInput: AutoimplementInput = {
799
804
  task: request.nextAction,
800
805
  plan: documented.plan,
@@ -805,9 +810,7 @@ const monitorWorkflow: WorkflowDefinition = defineWorkflow({
805
810
  },
806
811
  scope: authorityScope(request),
807
812
  constraints: authorityConstraints(request),
808
- ...(request.authority.repository !== undefined
809
- ? { repository: request.authority.repository }
810
- : {}),
813
+ repository: request.authority.repository,
811
814
  ...(request.authority.baseBranch !== undefined
812
815
  ? { baseBranch: request.authority.baseBranch }
813
816
  : {}),
@@ -7,6 +7,7 @@ import {
7
7
  import type { WorkflowNodeContext } from "../workflows/types.js";
8
8
  import autodocWorkflow, { type AutodocInput, type DocumentedPlan } from "./autodoc.workflow.js";
9
9
  import autoplanWorkflow, { type AutoplanInput, type AutoplanReady } from "./autoplan.workflow.js";
10
+ import type { VerificationCheck } from "./change-verification.workflow.js";
10
11
  import planApprovalWorkflow, {
11
12
  parsePlanApprovalPolicy,
12
13
  type PlanApprovalContinue,
@@ -15,6 +16,10 @@ import planApprovalWorkflow, {
15
16
  type PlanApprovalResolution,
16
17
  type ResolvedPlanApprovalPolicy,
17
18
  } from "./plan-approval.workflow.js";
19
+ import {
20
+ parsePreparedWorkspace,
21
+ type PreparedWorkspace,
22
+ } from "./workspace-preparation.workflow.js";
18
23
 
19
24
  export type PlanChangeInput = {
20
25
  task: string;
@@ -25,6 +30,9 @@ export type PlanChangeInput = {
25
30
  previousPlan?: unknown;
26
31
  newEvidence?: unknown;
27
32
  approval?: PlanApprovalPolicy;
33
+ preparedWorkspace?: PreparedWorkspace;
34
+ directDefaultBranchAuthorized?: boolean;
35
+ verificationChecks?: VerificationCheck[];
28
36
  };
29
37
 
30
38
  export type NormalizedPlanChangeInput = Omit<PlanChangeInput, "approval"> & {
@@ -91,11 +99,20 @@ function parseInput(value: unknown): NormalizedPlanChangeInput {
91
99
  "previousPlan",
92
100
  "newEvidence",
93
101
  "approval",
102
+ "preparedWorkspace",
103
+ "directDefaultBranchAuthorized",
104
+ "verificationChecks",
94
105
  ],
95
106
  "plan change input",
96
107
  );
97
108
  const constraints = parseStringArray(input.constraints, "plan change constraints");
98
109
  const documents = parseStringArray(input.documents, "plan change documents");
110
+ if (
111
+ input.directDefaultBranchAuthorized !== undefined &&
112
+ typeof input.directDefaultBranchAuthorized !== "boolean"
113
+ ) {
114
+ throw new Error("plan change directDefaultBranchAuthorized must be a boolean");
115
+ }
99
116
  return {
100
117
  task: requireString(input.task, "plan change task"),
101
118
  ...(input.scope !== undefined
@@ -108,6 +125,15 @@ function parseInput(value: unknown): NormalizedPlanChangeInput {
108
125
  ...(documents !== undefined ? { documents } : {}),
109
126
  ...(input.previousPlan !== undefined ? { previousPlan: input.previousPlan } : {}),
110
127
  ...(input.newEvidence !== undefined ? { newEvidence: input.newEvidence } : {}),
128
+ ...(input.preparedWorkspace === undefined
129
+ ? {}
130
+ : { preparedWorkspace: parsePreparedWorkspace(input.preparedWorkspace) }),
131
+ ...(input.directDefaultBranchAuthorized === undefined
132
+ ? {}
133
+ : { directDefaultBranchAuthorized: input.directDefaultBranchAuthorized }),
134
+ ...(input.verificationChecks === undefined
135
+ ? {}
136
+ : { verificationChecks: input.verificationChecks as VerificationCheck[] }),
111
137
  approval: parsePlanApprovalPolicy(input.approval),
112
138
  };
113
139
  }
@@ -216,6 +242,15 @@ export const planChangeWorkflow = defineWorkflow({
216
242
  task: request.task,
217
243
  plan: design.plan,
218
244
  ...(request.repository !== undefined ? { repository: request.repository } : {}),
245
+ ...(request.preparedWorkspace === undefined
246
+ ? {}
247
+ : { preparedWorkspace: request.preparedWorkspace }),
248
+ ...(request.directDefaultBranchAuthorized === undefined
249
+ ? {}
250
+ : { directDefaultBranchAuthorized: request.directDefaultBranchAuthorized }),
251
+ ...(request.verificationChecks === undefined
252
+ ? {}
253
+ : { verificationChecks: request.verificationChecks }),
219
254
  ...(request.documents !== undefined ? { documents: request.documents } : {}),
220
255
  evidence: request.newEvidence,
221
256
  };