@osolmaz/pi-workflows 0.10.0 → 0.11.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.
- package/README.md +32 -14
- package/dist/builtins/autodoc.workflow.d.ts +58 -0
- package/dist/builtins/autodoc.workflow.js +266 -0
- package/dist/builtins/autodoc.workflow.js.map +1 -0
- package/dist/builtins/autoimplement.workflow.d.ts +212 -11
- package/dist/builtins/autoimplement.workflow.js +431 -22
- package/dist/builtins/autoimplement.workflow.js.map +1 -1
- package/dist/builtins/{autodevise.workflow.d.ts → autoplan.workflow.d.ts} +9 -9
- package/dist/builtins/{autodevise.workflow.js → autoplan.workflow.js} +20 -20
- package/dist/builtins/autoplan.workflow.js.map +1 -0
- package/dist/builtins/catalog.js +8 -4
- package/dist/builtins/catalog.js.map +1 -1
- package/dist/builtins/index.d.ts +6 -3
- package/dist/builtins/index.js +5 -2
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/monitor.workflow.d.ts +4 -0
- package/dist/builtins/monitor.workflow.js +134 -9
- package/dist/builtins/monitor.workflow.js.map +1 -1
- package/dist/builtins/plan-approval.workflow.d.ts +83 -0
- package/dist/builtins/plan-approval.workflow.js +148 -0
- package/dist/builtins/plan-approval.workflow.js.map +1 -0
- package/dist/builtins/plan-presentation.d.ts +7 -0
- package/dist/builtins/plan-presentation.js +44 -0
- package/dist/builtins/plan-presentation.js.map +1 -0
- package/dist/extension/decision-channels.d.ts +132 -0
- package/dist/extension/decision-channels.js +1082 -0
- package/dist/extension/decision-channels.js.map +1 -0
- package/dist/extension/index.d.ts +1 -0
- package/dist/extension/index.js +426 -11
- package/dist/extension/index.js.map +1 -1
- package/dist/extension/widget.js +26 -2
- package/dist/extension/widget.js.map +1 -1
- package/dist/extension/workflow-tool.d.ts +1 -37
- package/dist/extension/workflow-tool.js +1 -42
- package/dist/extension/workflow-tool.js.map +1 -1
- package/dist/herdr/setup.d.ts +13 -1
- package/dist/herdr/setup.js +349 -36
- package/dist/herdr/setup.js.map +1 -1
- package/dist/host/rpc-bridge.js +4 -21
- package/dist/host/rpc-bridge.js.map +1 -1
- package/dist/render/graph-render.js +33 -8
- package/dist/render/graph-render.js.map +1 -1
- package/dist/viewer/cli.d.ts +1 -0
- package/dist/viewer/cli.js +21 -10
- package/dist/viewer/cli.js.map +1 -1
- package/dist/viewer/render.js +36 -2
- package/dist/viewer/render.js.map +1 -1
- package/dist/workflows/composition.js +15 -1
- package/dist/workflows/composition.js.map +1 -1
- package/dist/workflows/decision-presentation.d.ts +18 -0
- package/dist/workflows/decision-presentation.js +417 -0
- package/dist/workflows/decision-presentation.js.map +1 -0
- package/dist/workflows/engine.d.ts +2 -1
- package/dist/workflows/engine.js +86 -4
- package/dist/workflows/engine.js.map +1 -1
- package/dist/workflows/human-decision.d.ts +87 -0
- package/dist/workflows/human-decision.js +583 -0
- package/dist/workflows/human-decision.js.map +1 -0
- package/dist/workflows/index.d.ts +3 -1
- package/dist/workflows/index.js +2 -0
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/schema.js +15 -0
- package/dist/workflows/schema.js.map +1 -1
- package/dist/workflows/store.js +7 -0
- package/dist/workflows/store.js.map +1 -1
- package/dist/workflows/tool-input.d.ts +72 -0
- package/dist/workflows/tool-input.js +141 -0
- package/dist/workflows/tool-input.js.map +1 -0
- package/dist/workflows/types.d.ts +223 -0
- package/docs/HUMAN_DECISIONS.md +371 -0
- package/docs/HUMAN_DECISION_PRESENTATIONS.md +323 -0
- package/docs/MONITOR.md +17 -6
- package/docs/WORKFLOW_COMPOSITION.md +13 -6
- package/docs/plans/2026-08-19-human-decision-gates-plan.md +296 -0
- package/docs/plans/2026-08-19-human-decision-presentations-plan.md +172 -0
- package/docs/plans/2026-08-19-provider-compatible-workflow-tool-schema-plan.md +45 -0
- package/docs/plans/2026-08-19-workflow-composition-plan.md +25 -17
- package/docs/plans/2026-08-20-autoimplement-blocker-challenge-plan.md +138 -0
- package/docs/plans/2026-08-20-herdr-plugin-sync-plan.md +104 -0
- package/docs/run-bundles.md +23 -2
- package/docs/workflows.md +47 -5
- package/examples/workflows/approved-plan.workflow.ts +58 -0
- package/examples/workflows/autoplan.workflow.ts +1 -0
- package/examples/workflows/human-decision.workflow.ts +62 -0
- package/herdr-plugin.toml +1 -1
- package/package.json +2 -1
- package/schemas/decision-presentation-v1.schema.json +83 -0
- package/schemas/human-decision-accepted-v1.schema.json +44 -0
- package/schemas/human-decision-accepted-v2.schema.json +50 -0
- package/schemas/human-decision-answer-attempt-v1.schema.json +37 -0
- package/schemas/human-decision-cancellation-v1.schema.json +15 -0
- package/schemas/human-decision-continuation-v1.schema.json +16 -0
- package/schemas/human-decision-delivery-v1.schema.json +28 -0
- package/schemas/human-decision-delivery-v2.schema.json +36 -0
- package/schemas/human-decision-receipt-v1.schema.json +33 -0
- package/schemas/human-decision-receipt-v2.schema.json +39 -0
- package/schemas/human-decision-request-v1.schema.json +59 -0
- package/schemas/human-decision-request-v2.schema.json +69 -0
- package/schemas/human-decision-resolution-v1.schema.json +27 -0
- package/schemas/human-decision-resolution-v2.schema.json +27 -0
- package/schemas/human-decision-settlement-v1.schema.json +28 -0
- package/skills/autodoc/SKILL.md +43 -0
- package/skills/autoimplement/SKILL.md +58 -0
- package/skills/autoimplement/agents/openai.yaml +4 -0
- package/skills/autoplan/SKILL.md +25 -0
- package/skills/monitor/SKILL.md +3 -1
- package/skills/pi-workflows/SKILL.md +3 -3
- package/src/builtins/autodoc.workflow.ts +325 -0
- package/src/builtins/autoimplement.workflow.ts +493 -23
- package/src/builtins/{autodevise.workflow.ts → autoplan.workflow.ts} +32 -32
- package/src/builtins/catalog.ts +8 -4
- package/src/builtins/index.ts +25 -6
- package/src/builtins/monitor.workflow.ts +162 -8
- package/src/builtins/plan-approval.workflow.ts +190 -0
- package/src/builtins/plan-presentation.ts +57 -0
- package/src/extension/decision-channels.ts +1533 -0
- package/src/extension/index.ts +499 -9
- package/src/extension/widget.ts +39 -2
- package/src/extension/workflow-tool.ts +5 -81
- package/src/herdr/setup.ts +429 -39
- package/src/host/rpc-bridge.ts +7 -30
- package/src/render/graph-render.ts +40 -3
- package/src/viewer/cli.ts +22 -10
- package/src/viewer/render.ts +56 -3
- package/src/workflows/composition.ts +16 -1
- package/src/workflows/decision-presentation.ts +501 -0
- package/src/workflows/engine.ts +108 -4
- package/src/workflows/human-decision.ts +819 -0
- package/src/workflows/index.ts +69 -0
- package/src/workflows/schema.ts +17 -0
- package/src/workflows/store.ts +8 -0
- package/src/workflows/tool-input.ts +202 -0
- package/src/workflows/types.ts +265 -0
- package/dist/builtins/autodevise.workflow.js.map +0 -1
- package/examples/workflows/autodevise.workflow.ts +0 -1
package/README.md
CHANGED
|
@@ -36,12 +36,15 @@ Or try the npm package without installing it:
|
|
|
36
36
|
pi -e npm:@osolmaz/pi-workflows
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
The Pi package includes the extension and
|
|
39
|
+
The Pi package includes the extension and five optional skills:
|
|
40
40
|
|
|
41
41
|
- `pi-workflows` teaches the agent how to operate and author workflows.
|
|
42
42
|
- `monitor` starts and operates the built-in monitor workflow.
|
|
43
|
+
- `autoplan` selects the best practical solution and writes an implementation plan.
|
|
44
|
+
- `autodoc` records an existing plan in canonical documentation.
|
|
45
|
+
- `autoimplement` implements an existing plan and verifies the result.
|
|
43
46
|
|
|
44
|
-
Pi discovers
|
|
47
|
+
Pi discovers these skills when it loads the package. Use `pi config` to disable
|
|
45
48
|
the extension, all bundled skills, or one skill independently. The equivalent
|
|
46
49
|
settings entry below keeps the extension and disables only `monitor`:
|
|
47
50
|
|
|
@@ -56,7 +59,7 @@ settings entry below keeps the extension and disables only `monitor`:
|
|
|
56
59
|
}
|
|
57
60
|
```
|
|
58
61
|
|
|
59
|
-
Set `"skills": []` to disable
|
|
62
|
+
Set `"skills": []` to disable all bundled skills while keeping the extension.
|
|
60
63
|
Set `"extensions": []` to keep the skills without loading the extension.
|
|
61
64
|
|
|
62
65
|
Install the interactive terminal viewer separately from crates.io. The crate
|
|
@@ -74,12 +77,19 @@ or run it in place with `npx tsx src/viewer/cli.ts`.
|
|
|
74
77
|
## Herdr integration
|
|
75
78
|
|
|
76
79
|
Pi Workflows also ships as a [Herdr](https://herdr.dev) plugin. After installing
|
|
77
|
-
`piw` and Pi Workflows,
|
|
80
|
+
`piw` and Pi Workflows, synchronize the bundled plugin:
|
|
78
81
|
|
|
79
82
|
```bash
|
|
80
|
-
pi-workflows herdr
|
|
83
|
+
pi-workflows herdr sync
|
|
81
84
|
```
|
|
82
85
|
|
|
86
|
+
Run the same command after a Pi Workflows update. It finds the package that
|
|
87
|
+
provides the running CLI and repairs a Herdr link when npm moved that package.
|
|
88
|
+
`pi-workflows herdr setup` remains an alias for existing installations. Use
|
|
89
|
+
`--json` for versioned machine-readable output. The [Herdr plugin sync
|
|
90
|
+
plan](docs/plans/2026-08-20-herdr-plugin-sync-plan.md) defines update and
|
|
91
|
+
recovery behavior.
|
|
92
|
+
|
|
83
93
|
When Pi runs inside Herdr, a workflow widget shows `Ctrl+Shift+R piw`. When the widget has hidden rows, this call to action shares the existing scroll-controls line instead of taking another line.
|
|
84
94
|
The shortcut opens the exact run bundle and lets you choose a split, tab, or new
|
|
85
95
|
workspace. `/piw` opens the same menu, and `/piw right`, `/piw below`, `/piw
|
|
@@ -145,14 +155,14 @@ A workflow can import another workflow and connect its named exits without copyi
|
|
|
145
155
|
|
|
146
156
|
```typescript
|
|
147
157
|
import { compute, defineWorkflow, includeWorkflow } from "@osolmaz/pi-workflows";
|
|
148
|
-
import
|
|
158
|
+
import autoplan from "./autoplan.workflow.js";
|
|
149
159
|
|
|
150
160
|
export default defineWorkflow({
|
|
151
161
|
source: import.meta.url,
|
|
152
162
|
name: "parent",
|
|
153
163
|
startAt: "start",
|
|
154
164
|
includes: {
|
|
155
|
-
design: includeWorkflow(
|
|
165
|
+
design: includeWorkflow(autoplan, {
|
|
156
166
|
input: ({ outputs }) => ({ problem: String(outputs.start) }),
|
|
157
167
|
}),
|
|
158
168
|
},
|
|
@@ -185,7 +195,7 @@ waits with a normal shell action, and loops until its stop condition or check
|
|
|
185
195
|
limit. Its input supports `task`, `everyMinutes`, `stopWhen`, `maxChecks`, and
|
|
186
196
|
an optional `checkTimeoutMinutes`.
|
|
187
197
|
|
|
188
|
-
Monitor is observation-only by default. An explicit `repair` policy authorizes its composed `
|
|
198
|
+
Monitor is observation-only by default. An explicit `repair` policy authorizes its composed `autoplan` and `autoimplement` path. The monitor checks the target again after repair and stops when the same issue and target evidence return without progress. Project and global workflows can replace the built-in `monitor` by using the same file name.
|
|
189
199
|
|
|
190
200
|
A monitor occupies the session's one active workflow slot. If its Pi runner
|
|
191
201
|
stops during the shell wait, the run parks and repeats that wait node when a
|
|
@@ -193,12 +203,13 @@ runner resumes it.
|
|
|
193
203
|
|
|
194
204
|
Because the workflow runs in your current conversation, you can have a long
|
|
195
205
|
discussion first and then trigger a workflow that builds on it. The
|
|
196
|
-
`
|
|
206
|
+
`autoplan` example does exactly that. It frames the problem and scope, devises
|
|
197
207
|
an elegant production-ready solution, and compares it with the holy grail. It
|
|
198
208
|
then selects the best practical in-scope solution without asking the user to
|
|
199
209
|
resolve the gap. The ideal can win when it is feasible, but work outside the
|
|
200
210
|
current authority cannot block a valid practical solution. The workflow ends
|
|
201
|
-
with a detailed implementation plan.
|
|
211
|
+
with a detailed implementation plan. `autoplan` replaces the earlier
|
|
212
|
+
`autodevise` name; the old command and export are not retained.
|
|
202
213
|
|
|
203
214
|
## Watching a run
|
|
204
215
|
|
|
@@ -332,14 +343,21 @@ example set. Copy any of them into `.pi/workflows/` to use them:
|
|
|
332
343
|
while they run.
|
|
333
344
|
- `two-turn` chains three agent steps that build on each other's outputs in
|
|
334
345
|
the same conversation.
|
|
335
|
-
- `
|
|
346
|
+
- `autoplan` turns the current problem into a chosen practical solution and
|
|
336
347
|
a detailed implementation plan, using the ideal end state as guidance rather
|
|
337
348
|
than an out-of-scope requirement.
|
|
338
|
-
- `autoimplement`
|
|
339
|
-
|
|
349
|
+
- `autoimplement` finds a clear existing plan, documents it when needed,
|
|
350
|
+
implements and verifies it, writes and runs the exact Pi Reviewer command,
|
|
351
|
+
tracks P0 through P2, handles PR comments and CI, and
|
|
340
352
|
finalizes the PR. P0 and P1 fixes require another review. P2-only work is
|
|
341
353
|
verified without another reviewer round. A five-minute CI wait routes to
|
|
342
|
-
additional useful local testing.
|
|
354
|
+
additional useful local testing. New evidence can route through autoplan
|
|
355
|
+
and autodoc before implementation resumes.
|
|
356
|
+
- `human-decision` shows a reusable verified-human gate with a structured
|
|
357
|
+
machine subject, a separate readable operator presentation, plain choices,
|
|
358
|
+
and exact replan text.
|
|
359
|
+
- `approved-plan` composes autoplan, autodoc, and the reusable plan-approval
|
|
360
|
+
workflow without copying their internal nodes.
|
|
343
361
|
- `autoresearch` runs an iterative feature-search loop in the style of
|
|
344
362
|
[karpathy/autoresearch](https://github.com/karpathy/autoresearch): setup
|
|
345
363
|
creates a frozen evaluation harness, one editable feature file, and a
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type AutodocInput = {
|
|
2
|
+
task: string;
|
|
3
|
+
plan?: unknown;
|
|
4
|
+
repository?: string;
|
|
5
|
+
documents?: string[];
|
|
6
|
+
evidence?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export type DocumentedPlan = {
|
|
9
|
+
status: "ready";
|
|
10
|
+
task: string;
|
|
11
|
+
plan: unknown;
|
|
12
|
+
planDigest: string;
|
|
13
|
+
documentation: {
|
|
14
|
+
state: "current" | "updated";
|
|
15
|
+
files: string[];
|
|
16
|
+
digests: Record<string, string>;
|
|
17
|
+
evidence: unknown;
|
|
18
|
+
};
|
|
19
|
+
verification: unknown;
|
|
20
|
+
};
|
|
21
|
+
export type AutodocBlocked = {
|
|
22
|
+
status: "blocked";
|
|
23
|
+
task: string;
|
|
24
|
+
reason: string;
|
|
25
|
+
evidence: unknown;
|
|
26
|
+
};
|
|
27
|
+
export declare const autodocWorkflow: import("../workflows/types.js").WorkflowDefinition<AutodocInput, {
|
|
28
|
+
readonly ready: {
|
|
29
|
+
readonly from: "finalize";
|
|
30
|
+
readonly validate: (value: unknown) => DocumentedPlan;
|
|
31
|
+
};
|
|
32
|
+
readonly blocked: {
|
|
33
|
+
readonly from: "blocked";
|
|
34
|
+
readonly validate: (value: unknown) => AutodocBlocked;
|
|
35
|
+
};
|
|
36
|
+
}, import("../workflows/types.js").WorkflowIncludeMap> & {
|
|
37
|
+
nodes: {
|
|
38
|
+
readonly prepare: import("../workflows/types.js").ComputeNodeDefinition;
|
|
39
|
+
readonly locatePlan: import("../workflows/types.js").AgentNodeDefinition;
|
|
40
|
+
readonly inspectDocumentation: import("../workflows/types.js").AgentNodeDefinition;
|
|
41
|
+
readonly updateDocumentation: import("../workflows/types.js").AgentNodeDefinition;
|
|
42
|
+
readonly verifyDocumentation: import("../workflows/types.js").AgentNodeDefinition;
|
|
43
|
+
readonly finalize: import("../workflows/types.js").ComputeNodeDefinition;
|
|
44
|
+
readonly blocked: import("../workflows/types.js").ComputeNodeDefinition;
|
|
45
|
+
};
|
|
46
|
+
includes?: import("../workflows/types.js").WorkflowIncludeMap;
|
|
47
|
+
exits?: {
|
|
48
|
+
readonly ready: {
|
|
49
|
+
readonly from: "finalize";
|
|
50
|
+
readonly validate: (value: unknown) => DocumentedPlan;
|
|
51
|
+
};
|
|
52
|
+
readonly blocked: {
|
|
53
|
+
readonly from: "blocked";
|
|
54
|
+
readonly validate: (value: unknown) => AutodocBlocked;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export default autodocWorkflow;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { agent, compute, defineWorkflow } from "../workflows/definition.js";
|
|
2
|
+
import { digest } from "../workflows/human-decision.js";
|
|
3
|
+
function requireRecord(value, label) {
|
|
4
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
5
|
+
throw new Error(`${label} must be an object`);
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
function requireString(value, label) {
|
|
10
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
11
|
+
throw new Error(`${label} must be a non-empty string`);
|
|
12
|
+
}
|
|
13
|
+
return value.trim();
|
|
14
|
+
}
|
|
15
|
+
function stringArray(value, label) {
|
|
16
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
|
|
17
|
+
throw new Error(`${label} must be an array of strings`);
|
|
18
|
+
}
|
|
19
|
+
return [...value];
|
|
20
|
+
}
|
|
21
|
+
function stringRecord(value, label) {
|
|
22
|
+
if (value === undefined)
|
|
23
|
+
return {};
|
|
24
|
+
const record = requireRecord(value, label);
|
|
25
|
+
if (Object.values(record).some((item) => typeof item !== "string")) {
|
|
26
|
+
throw new Error(`${label} values must be strings`);
|
|
27
|
+
}
|
|
28
|
+
return record;
|
|
29
|
+
}
|
|
30
|
+
function parseInput(value) {
|
|
31
|
+
const input = requireRecord(value, "autodoc input");
|
|
32
|
+
const documents = input.documents;
|
|
33
|
+
return {
|
|
34
|
+
task: requireString(input.task, "autodoc task"),
|
|
35
|
+
...(input.plan !== undefined ? { plan: input.plan } : {}),
|
|
36
|
+
...(input.repository !== undefined
|
|
37
|
+
? { repository: requireString(input.repository, "autodoc repository") }
|
|
38
|
+
: {}),
|
|
39
|
+
...(documents !== undefined ? { documents: stringArray(documents, "autodoc documents") } : {}),
|
|
40
|
+
...(input.evidence !== undefined ? { evidence: input.evidence } : {}),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function parseLocatedPlan(value) {
|
|
44
|
+
const result = requireRecord(value, "located plan");
|
|
45
|
+
if (result.route !== "found" && result.route !== "blocked") {
|
|
46
|
+
throw new Error("located plan route must be found or blocked");
|
|
47
|
+
}
|
|
48
|
+
if (result.route === "found" && result.plan === undefined) {
|
|
49
|
+
throw new Error("located plan must include the selected plan");
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
route: result.route,
|
|
53
|
+
...(result.plan !== undefined ? { plan: result.plan } : {}),
|
|
54
|
+
...(result.sources !== undefined
|
|
55
|
+
? { sources: stringArray(result.sources, "located plan sources") }
|
|
56
|
+
: {}),
|
|
57
|
+
reason: requireString(result.reason, "located plan reason"),
|
|
58
|
+
evidence: result.evidence ?? null,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function parseDocumentationAssessment(value) {
|
|
62
|
+
const result = requireRecord(value, "documentation assessment");
|
|
63
|
+
if (result.route !== "current" && result.route !== "update" && result.route !== "blocked") {
|
|
64
|
+
throw new Error("documentation assessment route must be current, update, or blocked");
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
route: result.route,
|
|
68
|
+
files: stringArray(result.files, "documentation files"),
|
|
69
|
+
digests: stringRecord(result.digests, "documentation digests"),
|
|
70
|
+
reason: requireString(result.reason, "documentation reason"),
|
|
71
|
+
evidence: result.evidence ?? null,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function currentPlan(context) {
|
|
75
|
+
const explicit = context.input.plan;
|
|
76
|
+
if (explicit !== undefined)
|
|
77
|
+
return explicit;
|
|
78
|
+
const located = context.outputs.locatePlan;
|
|
79
|
+
if (located?.route === "found" && located.plan !== undefined)
|
|
80
|
+
return located.plan;
|
|
81
|
+
throw new Error("autodoc does not have a selected plan");
|
|
82
|
+
}
|
|
83
|
+
function blockedReason(context) {
|
|
84
|
+
const request = context.input;
|
|
85
|
+
const assessment = context.outputs.inspectDocumentation;
|
|
86
|
+
const located = context.outputs.locatePlan;
|
|
87
|
+
return {
|
|
88
|
+
status: "blocked",
|
|
89
|
+
task: request.task,
|
|
90
|
+
reason: assessment?.route === "blocked"
|
|
91
|
+
? assessment.reason
|
|
92
|
+
: located?.route === "blocked"
|
|
93
|
+
? located.reason
|
|
94
|
+
: "Autodoc could not identify a clear selected plan or canonical document target.",
|
|
95
|
+
evidence: assessment?.evidence ?? located?.evidence ?? null,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export const autodocWorkflow = defineWorkflow({
|
|
99
|
+
source: import.meta.url,
|
|
100
|
+
contractId: "pi-workflows.autodoc.v1",
|
|
101
|
+
name: "autodoc",
|
|
102
|
+
input: parseInput,
|
|
103
|
+
title: ({ input }) => `autodoc: ${input.task.slice(0, 60)}`,
|
|
104
|
+
startAt: "prepare",
|
|
105
|
+
maxSteps: 24,
|
|
106
|
+
exits: {
|
|
107
|
+
ready: {
|
|
108
|
+
from: "finalize",
|
|
109
|
+
validate: (value) => value,
|
|
110
|
+
},
|
|
111
|
+
blocked: {
|
|
112
|
+
from: "blocked",
|
|
113
|
+
validate: (value) => value,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
nodes: {
|
|
117
|
+
prepare: compute({
|
|
118
|
+
run: ({ input }) => ({
|
|
119
|
+
route: input.plan === undefined ? "locate" : "inspect",
|
|
120
|
+
}),
|
|
121
|
+
}),
|
|
122
|
+
locatePlan: agent({
|
|
123
|
+
statusDetail: "locating selected plan",
|
|
124
|
+
prompt: ({ input }) => {
|
|
125
|
+
const request = input;
|
|
126
|
+
return [
|
|
127
|
+
"Find the clear plan that has already been selected for this task.",
|
|
128
|
+
"Look in the current conversation context and in the referenced canonical documents.",
|
|
129
|
+
"Do not devise, improve, replace, or implement the plan.",
|
|
130
|
+
"Return blocked when no single clear selected plan exists.",
|
|
131
|
+
`Task: ${request.task}`,
|
|
132
|
+
`Repository: ${request.repository ?? "current repository"}`,
|
|
133
|
+
`Referenced documents: ${JSON.stringify(request.documents ?? [])}`,
|
|
134
|
+
`Evidence: ${JSON.stringify(request.evidence ?? null)}`,
|
|
135
|
+
].join("\n");
|
|
136
|
+
},
|
|
137
|
+
expectedOutput: '{ "route": "found" | "blocked", "plan": {} (required when found), "sources": ["source"], "reason": "reason", "evidence": "evidence" }',
|
|
138
|
+
validate: parseLocatedPlan,
|
|
139
|
+
}),
|
|
140
|
+
inspectDocumentation: agent({
|
|
141
|
+
statusDetail: "checking canonical documentation",
|
|
142
|
+
prompt: (context) => {
|
|
143
|
+
const request = context.input;
|
|
144
|
+
return [
|
|
145
|
+
"Check whether the selected plan is already recorded completely and accurately in the canonical specification and implementation plan.",
|
|
146
|
+
"Use repository guidance to choose canonical files. Do not redesign or implement anything.",
|
|
147
|
+
"Choose current only when the documents already preserve the whole selected plan and its boundaries.",
|
|
148
|
+
"Choose update when documents are missing or stale and can be corrected in scope.",
|
|
149
|
+
"Choose blocked only when no safe canonical target exists or repository rules prohibit the documentation change.",
|
|
150
|
+
`Task: ${request.task}`,
|
|
151
|
+
`Selected plan: ${JSON.stringify(currentPlan(context))}`,
|
|
152
|
+
`Preferred documents: ${JSON.stringify(request.documents ?? [])}`,
|
|
153
|
+
].join("\n");
|
|
154
|
+
},
|
|
155
|
+
expectedOutput: '{ "route": "current" | "update" | "blocked", "files": ["canonical file"], "digests": { "file": "sha256:digest" }, "reason": "reason", "evidence": "evidence" }',
|
|
156
|
+
validate: parseDocumentationAssessment,
|
|
157
|
+
}),
|
|
158
|
+
updateDocumentation: agent({
|
|
159
|
+
timeoutMs: 30 * 60_000,
|
|
160
|
+
statusDetail: "updating canonical documentation",
|
|
161
|
+
prompt: (context) => {
|
|
162
|
+
const request = context.input;
|
|
163
|
+
const assessment = context.outputs.inspectDocumentation;
|
|
164
|
+
return [
|
|
165
|
+
"Update the canonical specification and implementation plan to preserve the selected plan exactly.",
|
|
166
|
+
"Use the repository documentation rules and keep the text plain and complete.",
|
|
167
|
+
"Do not redesign the solution and do not implement code.",
|
|
168
|
+
`Task: ${request.task}`,
|
|
169
|
+
`Selected plan: ${JSON.stringify(currentPlan(context))}`,
|
|
170
|
+
`Canonical files: ${JSON.stringify(assessment.files)}`,
|
|
171
|
+
`Assessment: ${JSON.stringify(assessment)}`,
|
|
172
|
+
].join("\n");
|
|
173
|
+
},
|
|
174
|
+
expectedOutput: '{ "updated": true, "files": ["changed file"], "digests": { "file": "sha256:digest" }, "summary": "what was recorded" }',
|
|
175
|
+
validate: (value) => {
|
|
176
|
+
const result = requireRecord(value, "documentation update");
|
|
177
|
+
if (result.updated !== true)
|
|
178
|
+
throw new Error("documentation update must report updated: true");
|
|
179
|
+
stringArray(result.files, "updated documentation files");
|
|
180
|
+
stringRecord(result.digests, "updated documentation digests");
|
|
181
|
+
requireString(result.summary, "documentation update summary");
|
|
182
|
+
return result;
|
|
183
|
+
},
|
|
184
|
+
}),
|
|
185
|
+
verifyDocumentation: agent({
|
|
186
|
+
timeoutMs: 20 * 60_000,
|
|
187
|
+
statusDetail: "verifying documentation",
|
|
188
|
+
prompt: ({ outputs }) => [
|
|
189
|
+
"Verify the changed canonical documentation.",
|
|
190
|
+
"Run the repository documentation, formatting, link, and privacy checks that apply.",
|
|
191
|
+
"Do not implement code.",
|
|
192
|
+
`Documentation update: ${JSON.stringify(outputs.updateDocumentation)}`,
|
|
193
|
+
].join("\n"),
|
|
194
|
+
expectedOutput: '{ "passed": true | false, "commands": [{ "command": "exact command", "outcome": "result" }], "failures": ["failure"] }',
|
|
195
|
+
validate: (value) => {
|
|
196
|
+
const result = requireRecord(value, "documentation verification");
|
|
197
|
+
if (typeof result.passed !== "boolean") {
|
|
198
|
+
throw new Error("documentation verification passed must be boolean");
|
|
199
|
+
}
|
|
200
|
+
return result;
|
|
201
|
+
},
|
|
202
|
+
}),
|
|
203
|
+
finalize: compute({
|
|
204
|
+
run: (context) => {
|
|
205
|
+
const request = context.input;
|
|
206
|
+
const assessment = context.outputs.inspectDocumentation;
|
|
207
|
+
const plan = currentPlan(context);
|
|
208
|
+
const updated = context.outputs.updateDocumentation;
|
|
209
|
+
if (updated === undefined) {
|
|
210
|
+
return {
|
|
211
|
+
status: "ready",
|
|
212
|
+
task: request.task,
|
|
213
|
+
plan,
|
|
214
|
+
planDigest: digest(plan),
|
|
215
|
+
documentation: {
|
|
216
|
+
state: "current",
|
|
217
|
+
files: assessment.files,
|
|
218
|
+
digests: assessment.digests,
|
|
219
|
+
evidence: assessment.evidence,
|
|
220
|
+
},
|
|
221
|
+
verification: { passed: true, reason: "Canonical documentation was already current." },
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
const updateRecord = requireRecord(updated, "documentation update");
|
|
225
|
+
return {
|
|
226
|
+
status: "ready",
|
|
227
|
+
task: request.task,
|
|
228
|
+
plan,
|
|
229
|
+
planDigest: digest(plan),
|
|
230
|
+
documentation: {
|
|
231
|
+
state: "updated",
|
|
232
|
+
files: stringArray(updateRecord.files, "updated documentation files"),
|
|
233
|
+
digests: stringRecord(updateRecord.digests, "updated documentation digests"),
|
|
234
|
+
evidence: context.outputs.verifyDocumentation,
|
|
235
|
+
},
|
|
236
|
+
verification: context.outputs.verifyDocumentation,
|
|
237
|
+
};
|
|
238
|
+
},
|
|
239
|
+
}),
|
|
240
|
+
blocked: compute({ run: blockedReason }),
|
|
241
|
+
},
|
|
242
|
+
edges: [
|
|
243
|
+
{
|
|
244
|
+
from: "prepare",
|
|
245
|
+
switch: { on: "$.route", cases: { locate: "locatePlan", inspect: "inspectDocumentation" } },
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
from: "locatePlan",
|
|
249
|
+
switch: { on: "$.route", cases: { found: "inspectDocumentation", blocked: "blocked" } },
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
from: "inspectDocumentation",
|
|
253
|
+
switch: {
|
|
254
|
+
on: "$.route",
|
|
255
|
+
cases: { current: "finalize", update: "updateDocumentation", blocked: "blocked" },
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
{ from: "updateDocumentation", to: "verifyDocumentation" },
|
|
259
|
+
{
|
|
260
|
+
from: "verifyDocumentation",
|
|
261
|
+
switch: { on: "$.passed", cases: { true: "finalize", false: "blocked" } },
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
});
|
|
265
|
+
export default autodocWorkflow;
|
|
266
|
+
//# sourceMappingURL=autodoc.workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autodoc.workflow.js","s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