@marcoscale98/pi-extensible-workflows 5.19.1-fork.1 → 6.2.1-fork.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/CHANGELOG.md +77 -0
- package/README.md +2 -2
- package/dist/src/agent-execution.d.ts +43 -10
- package/dist/src/agent-execution.js +365 -127
- package/dist/src/background-widget.d.ts +0 -1
- package/dist/src/background-widget.js +4 -9
- package/dist/src/decoders.d.ts +2 -3
- package/dist/src/decoders.js +33 -37
- package/dist/src/execution.d.ts +2 -0
- package/dist/src/execution.js +5 -5
- package/dist/src/host-delivery.js +4 -8
- package/dist/src/host-navigator.js +5 -2
- package/dist/src/host-phases.d.ts +1 -0
- package/dist/src/host-recovery.d.ts +6 -6
- package/dist/src/host-recovery.js +14 -22
- package/dist/src/host-runtime.js +56 -5
- package/dist/src/host-view.d.ts +1 -1
- package/dist/src/host-view.js +17 -15
- package/dist/src/host.js +62 -87
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.js +1523 -1630
- package/dist/src/index.js.map +3 -3
- package/dist/src/paths.d.ts +7 -6
- package/dist/src/paths.js +24 -15
- package/dist/src/persistence.d.ts +1 -0
- package/dist/src/persistence.js +1 -0
- package/dist/src/pi-runtime-runner.js +4 -1
- package/dist/src/registry.d.ts +9 -7
- package/dist/src/registry.js +28 -70
- package/dist/src/runtime/agent-runner.d.ts +2 -0
- package/dist/src/session-lease.d.ts +1 -1
- package/dist/src/session-lease.js +45 -11
- package/dist/src/settings.d.ts +6 -3
- package/dist/src/settings.js +36 -47
- package/dist/src/store.d.ts +3 -1
- package/dist/src/store.js +17 -1
- package/dist/src/trajectory.d.ts +0 -1
- package/dist/src/trajectory.js +2 -3
- package/dist/src/types.d.ts +100 -44
- package/dist/src/types.js +4 -7
- package/dist/src/utils.d.ts +3 -2
- package/dist/src/utils.js +20 -10
- package/dist/src/validation.d.ts +8 -2
- package/dist/src/validation.js +122 -86
- package/dist/starter/index.js +8 -9
- package/dist/starter/index.js.map +1 -1
- package/dist/starter/review-loop.js +8 -7
- package/dist/subagents/index.js +654 -814
- package/dist/subagents/index.js.map +3 -3
- package/dist/subagents/src/contracts.d.ts +4 -3
- package/dist/subagents/src/contracts.js +2 -2
- package/dist/subagents/src/index.d.ts +1 -1
- package/dist/subagents/src/index.js +1 -2
- package/dist/subagents/src/manager.js +49 -70
- package/dist/subagents/src/navigator.js +3 -14
- package/dist/subagents/src/view.d.ts +0 -1
- package/dist/subagents/src/view.js +2 -16
- package/dist/subagents/src/worktree.js +1 -1
- package/dist/trajectory/assets/index.html +8 -8
- package/dist/trajectory/index.js +487 -891
- package/dist/trajectory/index.js.map +3 -3
- package/dist/trajectory/src/assets/index.html +8 -8
- package/dist/trajectory/src/index.js +126 -86
- package/dist/trajectory/src/server.js +264 -25
- package/dist/trajectory/src/server.js.map +3 -3
- package/dist/trajectory/src/startup-mutex.d.ts +17 -0
- package/dist/trajectory/src/startup-mutex.js +172 -0
- package/examples/workflow-extension-template/README.md +4 -7
- package/examples/workflow-extension-template/extension.test.mjs +4 -8
- package/examples/workflow-extension-template/index.js +0 -3
- package/package.json +5 -5
- package/skills/pi-extensible-workflows/SKILL.md +10 -8
- package/src/agent-execution.ts +339 -127
- package/src/background-widget.ts +4 -10
- package/src/decoders.ts +31 -37
- package/src/execution.ts +5 -5
- package/src/host-delivery.ts +4 -8
- package/src/host-navigator.ts +4 -2
- package/src/host-phases.ts +1 -1
- package/src/host-recovery.ts +20 -26
- package/src/host-runtime.ts +44 -6
- package/src/host-view.ts +18 -11
- package/src/host.ts +62 -113
- package/src/index.ts +1 -2
- package/src/paths.ts +18 -12
- package/src/persistence.ts +1 -0
- package/src/pi-runtime-runner.ts +3 -1
- package/src/registry.ts +27 -63
- package/src/runtime/agent-runner.ts +2 -0
- package/src/session-lease.ts +34 -6
- package/src/settings.ts +35 -47
- package/src/store.ts +18 -2
- package/src/trajectory.ts +2 -4
- package/src/types.ts +71 -30
- package/src/utils.ts +18 -9
- package/src/validation.ts +102 -79
- package/starter/index.ts +0 -1
- package/starter/review-loop.ts +8 -7
- package/starter/roles/developer.md +0 -1
- package/starter/roles/oracle.md +0 -1
- package/starter/roles/researcher.md +0 -1
- package/starter/roles/reviewer.md +0 -1
- package/starter/roles/scout.md +0 -1
- package/subagents/README.md +8 -14
- package/subagents/src/contracts.ts +3 -4
- package/subagents/src/index.ts +2 -3
- package/subagents/src/manager.ts +45 -125
- package/subagents/src/navigator.ts +4 -13
- package/subagents/src/view.ts +4 -14
- package/subagents/src/worktree.ts +1 -1
- package/trajectory/src/assets/index.html +8 -8
- package/trajectory/src/index.ts +106 -82
- package/trajectory/src/server.ts +44 -8
- package/trajectory/src/startup-mutex.ts +127 -0
- package/dist/src/roles.d.ts +0 -70
- package/dist/src/roles.js +0 -326
- package/dist/starter/roles/developer.md +0 -6
- package/dist/starter/roles/oracle.md +0 -18
- package/dist/starter/roles/researcher.md +0 -20
- package/dist/starter/roles/reviewer.md +0 -19
- package/dist/starter/roles/scout.md +0 -18
- package/examples/workflow-extension-template/roles/reviewer.md +0 -4
- package/src/roles.ts +0 -327
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marcoscale98/pi-extensible-workflows",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Deterministic multi-agent workflow orchestration for Pi",
|
|
3
|
+
"version": "6.2.1-fork.1",
|
|
4
|
+
"description": "Deterministic multi-agent workflow orchestration and codemode scripts for Pi",
|
|
5
5
|
"homepage": "https://vekexasia.github.io/pi-extensible-workflows/",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"workflow",
|
|
16
16
|
"multi-agent",
|
|
17
17
|
"orchestration",
|
|
18
|
-
"automation"
|
|
18
|
+
"automation",
|
|
19
|
+
"codemode"
|
|
19
20
|
],
|
|
20
21
|
"exports": {
|
|
21
22
|
".": "./dist/src/index.js",
|
|
@@ -24,7 +25,6 @@
|
|
|
24
25
|
"./utils": "./dist/src/utils.js",
|
|
25
26
|
"./budget": "./dist/src/budget.js",
|
|
26
27
|
"./validation": "./dist/src/validation.js",
|
|
27
|
-
"./roles": "./dist/src/roles.js",
|
|
28
28
|
"./registry": "./dist/src/registry.js",
|
|
29
29
|
"./runtime": "./dist/src/runtime/index.js",
|
|
30
30
|
"./trajectory": "./dist/trajectory/index.js"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"CHANGELOG.md"
|
|
49
49
|
],
|
|
50
50
|
"scripts": {
|
|
51
|
-
"build": "rm -rf dist && tsc -p tsconfig.json && cp -R
|
|
51
|
+
"build": "rm -rf dist && tsc -p tsconfig.json && cp -R trajectory/src/assets dist/trajectory/src/assets && cp -R trajectory/src/assets dist/trajectory/assets && esbuild src/index.ts starter/index.ts subagents/index.ts trajectory/index.ts --bundle --format=esm --platform=node --packages=external --sourcemap --sources-content=false --outbase=. --outdir=dist && esbuild trajectory/src/server.ts --bundle --format=esm --platform=node --sourcemap --sources-content=false --outfile=dist/trajectory/src/server.js",
|
|
52
52
|
"lint": "eslint .",
|
|
53
53
|
"test": "npm run test:layout && npm run build && npm run test:widget && npm run test:run && npm run test:herdr && npm run test:subagents",
|
|
54
54
|
"test:layout": "node --test --test-timeout=10000 --test-force-exit test/workspace-layout.test.mjs",
|
|
@@ -74,11 +74,11 @@ For a failed run, call `workflow_status({ runId })` first: a compact authoritati
|
|
|
74
74
|
export interface AgentOptions {
|
|
75
75
|
label?: string; // display name
|
|
76
76
|
model?: string; // provider/model:thinking, or alias[:thinking]
|
|
77
|
-
role?: string; // role file name
|
|
78
77
|
contextFiles?: Array<"global" | "project" | "cwd">; // which Pi context files to load
|
|
79
|
-
skills?: string[]; // minimatch
|
|
80
|
-
extensions?: string[]; // minimatch
|
|
81
|
-
tools?: string[]; // minimatch
|
|
78
|
+
skills?: string[]; // minimatch selector, ordered defaults then call options
|
|
79
|
+
extensions?: string[]; // minimatch selector, ordered defaults then call options
|
|
80
|
+
tools?: string[]; // minimatch selector, ordered defaults then call options
|
|
81
|
+
excludeTools?: string[]; // exact tool names removed after preparation; no patterns or workflow_result; never widens the parent ceiling
|
|
82
82
|
outputSchema?: JsonSchema; // structured result for a later phase
|
|
83
83
|
retries?: number; // extra same-run retries for this agent
|
|
84
84
|
timeoutMs?: number | null; // attempt timeout; null = none
|
|
@@ -86,9 +86,9 @@ export interface AgentOptions {
|
|
|
86
86
|
}
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
Restrict resource selectors with `["!*", "read", "grep"]`; `["*"]` selects every resource allowed by the parent ceiling.
|
|
90
90
|
|
|
91
|
-
Extensions may add JSON-compatible agent options such as `advisor: true`; core keys retain validation and
|
|
91
|
+
Extensions may add JSON-compatible agent options such as `advisor: true`; core keys retain validation and parent ceilings. Extension options go to setup hooks/native setup and are not inherited by child agents.
|
|
92
92
|
|
|
93
93
|
Agent calls are unnamed. Direct calls receive hidden source call-site identity; aliases are unsupported, and calls from one source site must not race outside `parallel` or `pipeline`, whose structural keys make replay deterministic.
|
|
94
94
|
|
|
@@ -97,7 +97,7 @@ Agent calls are unnamed. Direct calls receive hidden source call-site identity;
|
|
|
97
97
|
Use `agent.create(...)` when one agent must keep its transcript across several turns; use plain `agent(...)` calls for independent work.
|
|
98
98
|
|
|
99
99
|
```js
|
|
100
|
-
const author = agent.create({ name: "author"
|
|
100
|
+
const author = agent.create({ name: "author" });
|
|
101
101
|
const draft = await author.send("Create the first draft");
|
|
102
102
|
const revised = await author.send(
|
|
103
103
|
prompt("Apply these findings:\n\n{findings}", { findings }),
|
|
@@ -145,12 +145,14 @@ const results = await parallel("implementation", {
|
|
|
145
145
|
});
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
Registered extension functions also get `context.agent.create({ name, ... })` with the same handle rules as scripts. Handle journal identity is scoped by function invocation, branch, worktree, and name, so repeated or nested invocations and script handles never share a transcript; the prefix `function-handle/` is reserved in script names. Each turn is a separate agent node, with no automatic grouping.
|
|
149
|
+
|
|
148
150
|
Registered extension functions receive `withWorktree` in context and can compose other registered functions with `context.invoke("reviewRepository", { focus: "security" }, "security-review")`. The optional label is presentation-only; journal identity remains the function name and occurrence. Their public inputs and outputs remain JSON; callbacks cannot cross the extension boundary.
|
|
149
151
|
|
|
150
152
|
## Rules
|
|
151
153
|
|
|
152
154
|
- Workflow run does not inherit any of the main agent context. Keep that in mind when creating agent's prompts.
|
|
153
|
-
- `model` must be a configured alias or the canonical `provider/model:thinking` form. Aliases are listed by `workflow_catalog`; prefer a suitable alias over a hardcoded model. Never guess a model identifier: verify unknown names with `pi --list-models "search term"` first, then use the fully qualified identifier it returns.
|
|
155
|
+
- If `model` is specified, it must be a configured alias or the canonical `provider/model:thinking` form. Aliases are listed by `workflow_catalog`; prefer a suitable alias over a hardcoded model. Never guess a model identifier: verify unknown names with `pi --list-models "search term"` first, then use the fully qualified identifier it returns.
|
|
154
156
|
- Use `log(messageString)` for brief operator status and `phase(phaseName)` to signal the start of another phase.
|
|
155
157
|
- Use `parallel()` for independent tasks with different flows and `pipeline()` when every keyed item follows the same ordered stages; do not duplicate identical chains in `parallel()`. Signatures are `parallel(operationName, tasksRecord)` and `pipeline(operationName, itemsRecord, stagesRecord)`; keys are stable task, item, and stage names.
|
|
156
158
|
- Use a JavaScript loop for repeated work; each direct `agent(...)` call gets deterministic call-site and occurrence identity.
|