@llblab/pi-actors 0.50.0 → 0.52.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/AGENTS.md +5 -3
- package/BACKLOG.md +1 -1
- package/CHANGELOG.md +15 -0
- package/README.md +5 -3
- package/dist/index.js +4 -1
- package/dist/lib/async-runs.d.ts +2 -2
- package/dist/lib/async-runs.js +42 -19
- package/dist/lib/extension-runtime.d.ts +2 -1
- package/dist/lib/extension-runtime.js +7 -2
- package/dist/lib/limits.d.ts +9 -0
- package/dist/lib/limits.js +9 -0
- package/dist/lib/observability.d.ts +10 -11
- package/dist/lib/observability.js +81 -56
- package/dist/lib/pi.d.ts +31 -0
- package/dist/lib/pi.js +180 -0
- package/dist/lib/run-delivery.d.ts +115 -0
- package/dist/lib/run-delivery.js +623 -0
- package/dist/lib/run-ui-runtime.d.ts +3 -0
- package/dist/lib/run-ui-runtime.js +341 -13
- package/dist/lib/runs-trace.d.ts +1 -1
- package/dist/lib/runs-trace.js +5 -3
- package/dist/lib/session-evidence.d.ts +16 -0
- package/dist/lib/session-evidence.js +143 -0
- package/dist/lib/temp.js +1 -1
- package/dist/lib/tools-inspect.js +3 -1
- package/dist/scripts/async-runner.mjs +5 -19
- package/dist/skills/actors/SKILL.md +2 -2
- package/dist/skills/actors/references/runs.md +1 -1
- package/dist/skills/swarm/SKILL.md +1 -1
- package/docs/README.md +1 -0
- package/docs/async-runs.md +8 -4
- package/docs/coordinator-delivery.md +207 -0
- package/index.ts +4 -1
- package/lib/async-runs.ts +42 -21
- package/lib/extension-runtime.ts +8 -3
- package/lib/limits.ts +9 -0
- package/lib/observability.ts +97 -78
- package/lib/pi.ts +210 -0
- package/lib/run-delivery.ts +800 -0
- package/lib/run-ui-runtime.ts +370 -18
- package/lib/runs-trace.ts +6 -4
- package/lib/session-evidence.ts +153 -0
- package/lib/temp.ts +1 -1
- package/lib/tools-inspect.ts +4 -1
- package/package.json +3 -3
- package/scripts/async-runner.mjs +5 -19
- package/skills/actors/SKILL.md +2 -2
- package/skills/actors/references/runs.md +1 -1
- package/skills/swarm/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llblab/pi-actors",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local Actor Kernel for Pi",
|
|
6
6
|
"keywords": [
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"image": "https://raw.githubusercontent.com/llblab/pi-actors/main/banner.jpg"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@earendil-works/pi-coding-agent": "
|
|
70
|
-
"@earendil-works/pi-tui": "
|
|
69
|
+
"@earendil-works/pi-coding-agent": ">=0.84.4",
|
|
70
|
+
"@earendil-works/pi-tui": ">=0.84.4"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/node": "latest",
|
package/scripts/async-runner.mjs
CHANGED
|
@@ -284,9 +284,6 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
284
284
|
complete_allowed: missing.length === 0,
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function getCommandDoneDelivery(result) {
|
|
288
|
-
return result.code !== 0 || activeSubagents > 0 ? "followup" : "log";
|
|
289
|
-
}
|
|
290
287
|
function progressRunning() {
|
|
291
288
|
progress("running", {
|
|
292
289
|
activeSubagents,
|
|
@@ -433,21 +430,6 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
433
430
|
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
434
431
|
});
|
|
435
432
|
}
|
|
436
|
-
event("command.done", {
|
|
437
|
-
activeSubagents,
|
|
438
|
-
command_id: commandId,
|
|
439
|
-
code: result.code,
|
|
440
|
-
command: commandDetail,
|
|
441
|
-
killed: result.killed,
|
|
442
|
-
...captureDetails(result),
|
|
443
|
-
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
444
|
-
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
445
|
-
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
446
|
-
...(commandSessionFiles(session.sessionDir).length > 0
|
|
447
|
-
? { session_files: commandSessionFiles(session.sessionDir) }
|
|
448
|
-
: {}),
|
|
449
|
-
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
450
|
-
});
|
|
451
433
|
observation(
|
|
452
434
|
"command.done",
|
|
453
435
|
`Command ${summarizeCommandDetail(commandDetail)} completed with code ${result.code}`,
|
|
@@ -462,9 +444,13 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
462
444
|
...captureDetails(result),
|
|
463
445
|
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
464
446
|
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
447
|
+
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
448
|
+
...(commandSessionFiles(session.sessionDir).length > 0
|
|
449
|
+
? { session_files: commandSessionFiles(session.sessionDir) }
|
|
450
|
+
: {}),
|
|
465
451
|
...(preflightDiagnostic ? { preflight: preflightDiagnostic } : {}),
|
|
466
452
|
},
|
|
467
|
-
|
|
453
|
+
"log",
|
|
468
454
|
result.code === 0 ? "info" : "error",
|
|
469
455
|
);
|
|
470
456
|
progressRunning();
|
package/skills/actors/SKILL.md
CHANGED
|
@@ -85,7 +85,7 @@ There are two distinct multi-instance shapes:
|
|
|
85
85
|
|
|
86
86
|
In host-coordinator mode, the top-level agent receives declarative outcomes, preserves user authority and global context, delegates bounded concrete execution, and owns integration plus final validation. It is not merely another worker after delegation begins. One bounded implementation worker normally runs with reasoning off; consequential output receives a separate reasoning-enabled review. Several independent participants or reviewers additionally use `swarm`.
|
|
87
87
|
|
|
88
|
-
Delegation is not mandatory for every prompt. Work inline when one short bounded act has one natural validation boundary and spawning would add more coordination than isolation, latency hiding, clean context, or continued coordinator availability can repay. For admitted delegation, prefer
|
|
88
|
+
Delegation is not mandatory for every prompt. Work inline when one short bounded act has one natural validation boundary and spawning would add more coordination than isolation, latency hiding, clean context, or continued coordinator availability can repay. For admitted delegation, prefer the settled completion batch and durable Trace/artifacts; inspect on meaningful attention, operator request, or an evidence-based overdue timer rather than busy polling. Treat `attention: "steer"` as an actor-authored urgent semantic checkpoint at Pi's next safe boundary, never as a status-derived completion signal; the later root terminal still arrives through its ordinary completion batch.
|
|
89
89
|
|
|
90
90
|
## Run workflow
|
|
91
91
|
|
|
@@ -97,7 +97,7 @@ Run = Recipe + Trace + Control
|
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
1. Spawn with the exact logical Recipe identity and caller-owned values.
|
|
100
|
-
2. Retain the returned `run:<id>` and normally wait for
|
|
100
|
+
2. Retain the returned `run:<id>` and normally wait for its settled completion batch instead of polling.
|
|
101
101
|
3. Inspect `view=trace` when retained observations or attention matter.
|
|
102
102
|
4. Inspect `view=control` before diagnosing service readiness, stale work, or saturation.
|
|
103
103
|
5. Send `message` only for an action declared and consumed by that controlled Recipe.
|
|
@@ -14,7 +14,7 @@ A rare Skill Recipe may declare `singleton: true`. Do not pass `as`: the runtime
|
|
|
14
14
|
|
|
15
15
|
## Observe
|
|
16
16
|
|
|
17
|
-
Normally wait for
|
|
17
|
+
Normally wait for the settled completion batch. Inspect only when requested, when meaningful attention arrives, or when the Run is overdue or blocked:
|
|
18
18
|
|
|
19
19
|
```text
|
|
20
20
|
inspect target=run:<id> view=recipe
|
package/skills/swarm/SKILL.md
CHANGED
|
@@ -15,7 +15,7 @@ A swarm can be coordinated without an external gateway. In this model the curren
|
|
|
15
15
|
|
|
16
16
|
This resembles gateway orchestration in dependency direction but not in ownership: the coordinator is itself an agent instance with inspectable Runs, not an infrastructure service that implicitly creates sessions. Preserve that distinction in prompts, docs, recovery, and target routing.
|
|
17
17
|
|
|
18
|
-
Once work is delegated, keep the coordinator available for decisions and integration instead of duplicating participant implementation. Wait for
|
|
18
|
+
Once work is delegated, keep the coordinator available for decisions and integration instead of duplicating participant implementation. Wait for the settled completion batch by default; use meaningful attention or evidence-based timers for overdue work rather than a tight inspection loop.
|
|
19
19
|
|
|
20
20
|
## Reasoning allocation
|
|
21
21
|
|