@davidorex/pi-workflows 0.2.0 → 0.3.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.
- package/CHANGELOG.md +7 -4
- package/README.md +12 -2
- package/agents/architecture-designer.agent.yaml +58 -0
- package/agents/architecture-inferrer.agent.yaml +60 -0
- package/agents/gap-identifier.agent.yaml +66 -0
- package/agents/handoff-writer.agent.yaml +64 -0
- package/agents/plan-creator.agent.yaml +63 -0
- package/agents/project-definer.agent.yaml +53 -0
- package/agents/project-inferrer.agent.yaml +63 -0
- package/agents/requirements-gatherer.agent.yaml +58 -0
- package/dist/agent-spec.d.ts +27 -0
- package/dist/agent-spec.d.ts.map +1 -0
- package/dist/agent-spec.js +112 -0
- package/dist/agent-spec.js.map +1 -0
- package/dist/checkpoint.d.ts +50 -0
- package/dist/checkpoint.d.ts.map +1 -0
- package/dist/checkpoint.js +109 -0
- package/dist/checkpoint.js.map +1 -0
- package/dist/completion.d.ts +18 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +58 -0
- package/dist/completion.js.map +1 -0
- package/dist/dag.d.ts +56 -0
- package/dist/dag.d.ts.map +1 -0
- package/dist/dag.js +172 -0
- package/dist/dag.js.map +1 -0
- package/dist/dispatch.d.ts +35 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/dispatch.js +311 -0
- package/dist/dispatch.js.map +1 -0
- package/dist/expression.d.ts +64 -0
- package/dist/expression.d.ts.map +1 -0
- package/dist/expression.js +294 -0
- package/dist/expression.js.map +1 -0
- package/dist/format.d.ts +19 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +42 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +675 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +12 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +59 -0
- package/dist/output.js.map +1 -0
- package/dist/state.d.ts +66 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +227 -0
- package/dist/state.js.map +1 -0
- package/dist/step-agent.d.ts +35 -0
- package/dist/step-agent.d.ts.map +1 -0
- package/dist/step-agent.js +156 -0
- package/dist/step-agent.js.map +1 -0
- package/dist/step-command.d.ts +21 -0
- package/dist/step-command.d.ts.map +1 -0
- package/dist/step-command.js +150 -0
- package/dist/step-command.js.map +1 -0
- package/dist/step-foreach.d.ts +33 -0
- package/dist/step-foreach.d.ts.map +1 -0
- package/dist/step-foreach.js +112 -0
- package/dist/step-foreach.js.map +1 -0
- package/dist/step-gate.d.ts +18 -0
- package/dist/step-gate.d.ts.map +1 -0
- package/dist/step-gate.js +137 -0
- package/dist/step-gate.js.map +1 -0
- package/dist/step-loop.d.ts +32 -0
- package/dist/step-loop.d.ts.map +1 -0
- package/dist/step-loop.js +278 -0
- package/dist/step-loop.js.map +1 -0
- package/dist/step-monitor.d.ts +56 -0
- package/dist/step-monitor.d.ts.map +1 -0
- package/dist/step-monitor.js +317 -0
- package/dist/step-monitor.js.map +1 -0
- package/dist/step-parallel.d.ts +43 -0
- package/dist/step-parallel.d.ts.map +1 -0
- package/dist/step-parallel.js +122 -0
- package/dist/step-parallel.js.map +1 -0
- package/{src/step-pause.ts → dist/step-pause.d.ts} +3 -13
- package/dist/step-pause.d.ts.map +1 -0
- package/dist/step-pause.js +22 -0
- package/dist/step-pause.js.map +1 -0
- package/dist/step-shared.d.ts +57 -0
- package/dist/step-shared.d.ts.map +1 -0
- package/dist/step-shared.js +125 -0
- package/dist/step-shared.js.map +1 -0
- package/dist/step-transform.d.ts +11 -0
- package/dist/step-transform.d.ts.map +1 -0
- package/dist/step-transform.js +41 -0
- package/dist/step-transform.js.map +1 -0
- package/dist/template.d.ts +51 -0
- package/dist/template.d.ts.map +1 -0
- package/{src/template.ts → dist/template.js} +32 -38
- package/dist/template.js.map +1 -0
- package/dist/test-helpers.d.ts +17 -0
- package/dist/test-helpers.d.ts.map +1 -0
- package/dist/test-helpers.js +46 -0
- package/dist/test-helpers.js.map +1 -0
- package/dist/tui.d.ts +47 -0
- package/dist/tui.d.ts.map +1 -0
- package/dist/tui.js +143 -0
- package/dist/tui.js.map +1 -0
- package/dist/types.d.ts +164 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/workflow-discovery.d.ts +23 -0
- package/dist/workflow-discovery.d.ts.map +1 -0
- package/dist/workflow-discovery.js +103 -0
- package/dist/workflow-discovery.js.map +1 -0
- package/dist/workflow-executor.d.ts +50 -0
- package/dist/workflow-executor.d.ts.map +1 -0
- package/dist/workflow-executor.js +726 -0
- package/dist/workflow-executor.js.map +1 -0
- package/dist/workflow-sdk.d.ts +44 -0
- package/dist/workflow-sdk.d.ts.map +1 -0
- package/dist/workflow-sdk.js +438 -0
- package/dist/workflow-sdk.js.map +1 -0
- package/dist/workflow-spec.d.ts +33 -0
- package/dist/workflow-spec.d.ts.map +1 -0
- package/dist/workflow-spec.js +464 -0
- package/dist/workflow-spec.js.map +1 -0
- package/dist/workflows-dir.d.ts +3 -0
- package/dist/workflows-dir.d.ts.map +1 -0
- package/{src/workflows-dir.ts → dist/workflows-dir.js} +1 -0
- package/dist/workflows-dir.js.map +1 -0
- package/package.json +53 -38
- package/schemas/decomposition-specs.schema.json +48 -48
- package/schemas/execution-results.schema.json +48 -48
- package/schemas/investigation-findings.schema.json +43 -43
- package/schemas/pattern-analysis.schema.json +41 -41
- package/schemas/phase.schema.json +48 -0
- package/schemas/plan-breakdown.schema.json +20 -20
- package/schemas/quality-analysis.schema.json +33 -33
- package/schemas/research-findings.schema.json +42 -42
- package/schemas/structure-analysis.schema.json +40 -40
- package/schemas/synthesis.schema.json +31 -31
- package/schemas/verifier-output.schema.json +94 -94
- package/skill-narrative.md +84 -0
- package/skills/pi-workflows/SKILL.md +247 -0
- package/templates/architecture-designer/task.md +117 -0
- package/templates/architecture-inferrer/task.md +61 -0
- package/templates/gap-identifier/task.md +103 -0
- package/templates/handoff-writer/task.md +91 -0
- package/templates/plan-creator/task.md +143 -0
- package/templates/project-definer/task.md +67 -0
- package/templates/project-inferrer/task.md +56 -0
- package/templates/requirements-gatherer/task.md +90 -0
- package/workflows/analyze-existing-project.workflow.yaml +74 -0
- package/workflows/create-handoff.workflow.yaml +58 -0
- package/workflows/create-phase.workflow.yaml +1 -1
- package/workflows/do-gap.workflow.yaml +4 -4
- package/workflows/fix-audit.workflow.yaml +1 -1
- package/workflows/gap-to-phase.workflow.yaml +1 -1
- package/workflows/init-new-project.workflow.yaml +55 -0
- package/workflows/plan-from-requirements.workflow.yaml +51 -0
- package/workflows/self-implement.workflow.yaml +3 -3
- package/workflows/typed-analysis.workflow.yaml +4 -4
- package/src/agent-spec.test.ts +0 -289
- package/src/agent-spec.ts +0 -122
- package/src/block-validation.test.ts +0 -350
- package/src/checkpoint.test.ts +0 -237
- package/src/checkpoint.ts +0 -140
- package/src/completion.test.ts +0 -143
- package/src/completion.ts +0 -68
- package/src/dag.test.ts +0 -350
- package/src/dag.ts +0 -219
- package/src/dispatch.test.ts +0 -475
- package/src/dispatch.ts +0 -353
- package/src/expression.test.ts +0 -353
- package/src/expression.ts +0 -332
- package/src/format.test.ts +0 -80
- package/src/format.ts +0 -41
- package/src/graduated-failure.test.ts +0 -556
- package/src/index.test.ts +0 -114
- package/src/index.ts +0 -516
- package/src/loop.test.ts +0 -551
- package/src/output.test.ts +0 -213
- package/src/output.ts +0 -70
- package/src/parallel-integration.test.ts +0 -175
- package/src/resume.test.ts +0 -192
- package/src/state.test.ts +0 -192
- package/src/state.ts +0 -254
- package/src/step-agent.test.ts +0 -327
- package/src/step-agent.ts +0 -178
- package/src/step-command.test.ts +0 -330
- package/src/step-command.ts +0 -132
- package/src/step-foreach.test.ts +0 -647
- package/src/step-foreach.ts +0 -148
- package/src/step-gate.test.ts +0 -185
- package/src/step-gate.ts +0 -116
- package/src/step-loop.test.ts +0 -626
- package/src/step-loop.ts +0 -323
- package/src/step-parallel.test.ts +0 -475
- package/src/step-parallel.ts +0 -168
- package/src/step-pause.test.ts +0 -30
- package/src/step-shared.test.ts +0 -355
- package/src/step-shared.ts +0 -157
- package/src/step-transform.test.ts +0 -155
- package/src/step-transform.ts +0 -47
- package/src/template-integration.test.ts +0 -72
- package/src/template.test.ts +0 -162
- package/src/test-helpers.ts +0 -51
- package/src/tui.test.ts +0 -355
- package/src/tui.ts +0 -182
- package/src/types.ts +0 -195
- package/src/verifier-schema.test.ts +0 -226
- package/src/workflow-discovery.test.ts +0 -105
- package/src/workflow-discovery.ts +0 -114
- package/src/workflow-executor.test.ts +0 -1532
- package/src/workflow-executor.ts +0 -810
- package/src/workflow-sdk.test.ts +0 -238
- package/src/workflow-sdk.ts +0 -262
- package/src/workflow-spec.test.ts +0 -576
- package/src/workflow-spec.ts +0 -471
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { parseWorkflowSpec } from "./workflow-spec.js";
|
|
5
|
+
import { WORKFLOWS_DIR } from "./workflows-dir.js";
|
|
6
|
+
/**
|
|
7
|
+
* Discover all workflow specs from project, user, and builtin directories.
|
|
8
|
+
*
|
|
9
|
+
* Scans (highest priority first):
|
|
10
|
+
* 1. .workflows/ (project-level, source: "project")
|
|
11
|
+
* 2. ~/.pi/agent/workflows/ (user-level, source: "user")
|
|
12
|
+
* 3. <package>/workflows/ (builtin workflows, source: "user")
|
|
13
|
+
*
|
|
14
|
+
* Higher-priority specs shadow lower-priority specs with the same name.
|
|
15
|
+
*
|
|
16
|
+
* @param cwd - current working directory (project root)
|
|
17
|
+
* @param builtinDir - optional path to builtin workflows (defaults to workflows/ relative to package root)
|
|
18
|
+
* @returns Array of parsed WorkflowSpec objects. Specs that fail parsing are
|
|
19
|
+
* skipped with a warning (logged to stderr), not thrown.
|
|
20
|
+
*/
|
|
21
|
+
export function discoverWorkflows(cwd, builtinDir) {
|
|
22
|
+
const projectDir = path.join(cwd, WORKFLOWS_DIR);
|
|
23
|
+
const userDir = path.join(os.homedir(), ".pi", "agent", "workflows");
|
|
24
|
+
const demoDir = builtinDir ?? path.resolve(import.meta.dirname, "..", "workflows");
|
|
25
|
+
const projectSpecs = scanDirectory(projectDir, "project");
|
|
26
|
+
const userSpecs = scanDirectory(userDir, "user");
|
|
27
|
+
const builtinSpecs = scanDirectory(demoDir, "user");
|
|
28
|
+
// Deduplicate: project > user > builtin (last write wins, so add lowest priority first)
|
|
29
|
+
const byName = new Map();
|
|
30
|
+
for (const spec of builtinSpecs) {
|
|
31
|
+
byName.set(spec.name, spec);
|
|
32
|
+
}
|
|
33
|
+
for (const spec of userSpecs) {
|
|
34
|
+
byName.set(spec.name, spec);
|
|
35
|
+
}
|
|
36
|
+
for (const spec of projectSpecs) {
|
|
37
|
+
byName.set(spec.name, spec);
|
|
38
|
+
}
|
|
39
|
+
// Return sorted by name
|
|
40
|
+
const result = Array.from(byName.values());
|
|
41
|
+
result.sort((a, b) => a.name.localeCompare(b.name));
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Find a workflow by name from discovered workflows.
|
|
46
|
+
* Returns undefined if not found.
|
|
47
|
+
*/
|
|
48
|
+
export function findWorkflow(name, cwd, builtinDir) {
|
|
49
|
+
const specs = discoverWorkflows(cwd, builtinDir);
|
|
50
|
+
return specs.find((s) => s.name === name);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Scan a directory for *.workflow.yaml files and parse them.
|
|
54
|
+
* Non-recursive. Returns parsed specs; logs warnings for parse failures.
|
|
55
|
+
*/
|
|
56
|
+
function scanDirectory(dirPath, source) {
|
|
57
|
+
if (!fs.existsSync(dirPath)) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
let entries;
|
|
61
|
+
try {
|
|
62
|
+
entries = fs.readdirSync(dirPath);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
const specs = [];
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
if (!entry.endsWith(".workflow.yaml")) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const filePath = path.join(dirPath, entry);
|
|
73
|
+
// Only process files, not directories
|
|
74
|
+
let stat;
|
|
75
|
+
try {
|
|
76
|
+
stat = fs.statSync(filePath);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (!stat.isFile()) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
let content;
|
|
85
|
+
try {
|
|
86
|
+
content = fs.readFileSync(filePath, "utf-8");
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
console.error(`[pi-workflows] Warning: skipping ${filePath}: could not read file`);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const spec = parseWorkflowSpec(content, filePath, source);
|
|
94
|
+
specs.push(spec);
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
98
|
+
console.error(`[pi-workflows] Warning: skipping ${filePath}: ${msg}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return specs;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=workflow-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-discovery.js","sourceRoot":"","sources":["../src/workflow-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;;;;;;;GAcG;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AO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,CAAC,KAAK,CAAC,oCAAoC,QAAQ,uBAAuB,CAAC,CAAC;YACnF,SAAS;QACV,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC1D,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,CAAC,KAAK,CAAC,oCAAoC,QAAQ,KAAK,GAAG,EAAE,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { dispatch } from "./dispatch.js";
|
|
2
|
+
import { SIGKILL_GRACE_MS } from "./step-shared.js";
|
|
3
|
+
import type { AgentSpec, ExecutionState, WorkflowResult, WorkflowSpec } from "./types.js";
|
|
4
|
+
export { SIGKILL_GRACE_MS };
|
|
5
|
+
/** Set by the extension keybinding to request a pause after the current step. */
|
|
6
|
+
export declare function requestPause(): void;
|
|
7
|
+
export interface ExecuteOptions {
|
|
8
|
+
/** pi extension context (for TUI, cwd, etc.) */
|
|
9
|
+
ctx: any;
|
|
10
|
+
/** pi extension API (for sendMessage) */
|
|
11
|
+
pi: any;
|
|
12
|
+
/** AbortSignal for cancellation (e.g. user presses Ctrl+C) */
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
/**
|
|
15
|
+
* Agent spec loader. Given an agent name, returns the AgentSpec.
|
|
16
|
+
* The executor does not know how to load agent specs — the caller provides this.
|
|
17
|
+
* If the agent is not found, return a minimal spec with just the name.
|
|
18
|
+
*/
|
|
19
|
+
loadAgent: (name: string) => AgentSpec;
|
|
20
|
+
/** Injectable dispatch function for testing; defaults to real dispatch. */
|
|
21
|
+
dispatchFn?: typeof dispatch;
|
|
22
|
+
/** Project-level model config; loaded from .project/model-config.json if not provided. */
|
|
23
|
+
modelConfig?: import("./dispatch.js").ModelConfig;
|
|
24
|
+
/** Resume from an incomplete run instead of starting fresh. */
|
|
25
|
+
resume?: {
|
|
26
|
+
runId: string;
|
|
27
|
+
runDir: string;
|
|
28
|
+
state: ExecutionState;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** Retry context passed to step executors on retry attempts. */
|
|
32
|
+
export interface RetryContext {
|
|
33
|
+
attempt: number;
|
|
34
|
+
priorErrors: string[];
|
|
35
|
+
steeringMessage?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Execute a workflow from a parsed spec and validated input.
|
|
39
|
+
*
|
|
40
|
+
* Runs steps sequentially (phase 1), resolving ${{ }} expressions,
|
|
41
|
+
* dispatching subprocesses, validating outputs, persisting state,
|
|
42
|
+
* updating TUI, and injecting the result into the conversation.
|
|
43
|
+
*
|
|
44
|
+
* Supports step types: agent (default), gate, transform, loop.
|
|
45
|
+
* Supports `when` conditionals for skipping steps.
|
|
46
|
+
*
|
|
47
|
+
* Returns the WorkflowResult (also injected into conversation via sendMessage).
|
|
48
|
+
*/
|
|
49
|
+
export declare function executeWorkflow(spec: WorkflowSpec, input: unknown, options: ExecuteOptions): Promise<WorkflowResult>;
|
|
50
|
+
//# sourceMappingURL=workflow-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-executor.d.ts","sourceRoot":"","sources":["../src/workflow-executor.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAmBzC,OAAO,EAAkC,gBAAgB,EAAwB,MAAM,kBAAkB,CAAC;AAK1G,OAAO,KAAK,EACX,SAAS,EACT,cAAc,EAId,cAAc,EACd,YAAY,EACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAK5B,iFAAiF;AACjF,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAOD,MAAM,WAAW,cAAc;IAC9B,gDAAgD;IAChD,GAAG,EAAE,GAAG,CAAC;IACT,yCAAyC;IACzC,EAAE,EAAE,GAAG,CAAC;IACR,8DAA8D;IAC9D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;IACvC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,QAAQ,CAAC;IAC7B,0FAA0F;IAC1F,WAAW,CAAC,EAAE,OAAO,eAAe,EAAE,WAAW,CAAC;IAClD,+DAA+D;IAC/D,MAAM,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,cAAc,CAAC;KACtB,CAAC;CACF;AAgTD,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAuND;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACpC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,cAAc,CAAC,CAiQzB"}
|