@llblab/pi-actors 0.42.0 → 0.42.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/BACKLOG.md +1 -5
- package/CHANGELOG.md +10 -0
- package/README.md +2 -0
- package/dist/lib/async-runs.d.ts +12 -0
- package/dist/lib/async-runs.js +46 -5
- package/dist/lib/command-templates.js +1 -1
- package/dist/lib/inspector-overlay.d.ts +4 -1
- package/dist/lib/inspector-overlay.js +71 -15
- package/dist/lib/inspector.js +1 -1
- package/dist/lib/observability.d.ts +12 -0
- package/dist/lib/observability.js +149 -5
- package/dist/lib/runs-control.d.ts +2 -0
- package/dist/lib/runs-control.js +14 -1
- package/dist/lib/runs-ownership.js +17 -3
- package/dist/lib/runs-process.js +4 -3
- package/dist/lib/runs-start.js +1 -0
- package/dist/lib/runs-status.js +3 -0
- package/dist/lib/tools-inspect.js +2 -1
- package/dist/lib/tools-local.js +17 -2
- package/dist/lib/tools-spawn.js +10 -1
- package/dist/scripts/async-runner.mjs +9 -9
- package/dist/scripts/build-dist.mjs +6 -1
- package/dist/scripts/conformance.mjs +6 -1
- package/dist/scripts/recipe-utils.mjs +3 -3
- package/dist/skills/actors/SKILL.md +1 -1
- package/dist/skills/swarm/SKILL.md +1 -1
- package/docs/actor-inspector.md +1 -1
- package/docs/async-runs.md +7 -1
- package/docs/tool-registry.md +2 -0
- package/lib/async-runs.ts +65 -5
- package/lib/command-templates.ts +1 -1
- package/lib/inspector-overlay.ts +67 -15
- package/lib/inspector.ts +1 -1
- package/lib/observability.ts +180 -4
- package/lib/runs-control.ts +20 -1
- package/lib/runs-ownership.ts +22 -3
- package/lib/runs-process.ts +4 -3
- package/lib/runs-start.ts +1 -0
- package/lib/runs-status.ts +5 -0
- package/lib/tools-inspect.ts +2 -1
- package/lib/tools-local.ts +21 -2
- package/lib/tools-spawn.ts +14 -1
- package/package.json +4 -3
- package/scripts/async-runner.mjs +9 -9
- package/scripts/build-dist.mjs +6 -1
- package/scripts/conformance.mjs +6 -1
- package/scripts/recipe-utils.mjs +3 -3
- package/skills/actors/SKILL.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.42.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local Actor Kernel for Pi",
|
|
6
6
|
"keywords": [
|
|
@@ -27,11 +27,12 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"check": "node --experimental-strip-types -e \"await import('./index.ts'); console.log('pi-actors: extension import ok')\"",
|
|
29
29
|
"conformance": "node scripts/conformance.mjs",
|
|
30
|
-
"test": "node --experimental-strip-types --test tests/*.test.ts",
|
|
30
|
+
"test": "node --experimental-strip-types --test --test-concurrency=1 tests/*.test.ts",
|
|
31
31
|
"pack:dry": "npm pack --dry-run",
|
|
32
32
|
"recipes:qa": "node scripts/validate-recipe.mjs recipes --all --qa --summary",
|
|
33
33
|
"release:validate": "npm run validate && node scripts/release-gates.mjs",
|
|
34
|
-
"validate": "npx tsc --noEmit && npm run recipes:qa && npm run build && npm run check && npm test && npm run conformance && npm
|
|
34
|
+
"validate": "npx tsc --noEmit && npm run recipes:qa && npm run build && npm run check && npm test && npm run conformance && npm run pack:dry",
|
|
35
|
+
"audit:dependencies": "npm audit --audit-level=high --omit=peer",
|
|
35
36
|
"build": "node scripts/build-dist.mjs",
|
|
36
37
|
"prepack": "npm run build"
|
|
37
38
|
},
|
package/scripts/async-runner.mjs
CHANGED
|
@@ -135,7 +135,7 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
135
135
|
try {
|
|
136
136
|
return readdirSync(sessionDir, { withFileTypes: true })
|
|
137
137
|
.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl"))
|
|
138
|
-
.map((entry) => relative(stateDir, join(sessionDir, entry.name)))
|
|
138
|
+
.map((entry) => relative(stateDir, join(sessionDir, entry.name)).replaceAll("\\", "/"))
|
|
139
139
|
.sort();
|
|
140
140
|
} catch {
|
|
141
141
|
return [];
|
|
@@ -167,12 +167,12 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
167
167
|
...(recipeContext ? { recipe_context: recipeContext } : {}),
|
|
168
168
|
command: commandDetail,
|
|
169
169
|
...(materialized.promptFile
|
|
170
|
-
? { prompt_file: relative(stateDir, materialized.promptFile) }
|
|
170
|
+
? { prompt_file: relative(stateDir, materialized.promptFile).replaceAll("\\", "/") }
|
|
171
171
|
: {}),
|
|
172
172
|
...(materialized.promptBytes
|
|
173
173
|
? { prompt_bytes: materialized.promptBytes }
|
|
174
174
|
: {}),
|
|
175
|
-
...(sessionDir ? { session_dir: relative(stateDir, sessionDir) } : {}),
|
|
175
|
+
...(sessionDir ? { session_dir: relative(stateDir, sessionDir).replaceAll("\\", "/") } : {}),
|
|
176
176
|
attempts: [],
|
|
177
177
|
semantic_acceptance:
|
|
178
178
|
options?.evidenceContext?.acceptOutput === "review_evidence" ||
|
|
@@ -209,11 +209,11 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
209
209
|
attempts.push({
|
|
210
210
|
attempt,
|
|
211
211
|
stdout: {
|
|
212
|
-
path: relative(stateDir, stdoutFile),
|
|
212
|
+
path: relative(stateDir, stdoutFile).replaceAll("\\", "/"),
|
|
213
213
|
bytes: existsSync(stdoutFile) ? statSync(stdoutFile).size : 0,
|
|
214
214
|
},
|
|
215
215
|
stderr: {
|
|
216
|
-
path: relative(stateDir, stderrFile),
|
|
216
|
+
path: relative(stateDir, stderrFile).replaceAll("\\", "/"),
|
|
217
217
|
bytes: existsSync(stderrFile) ? statSync(stderrFile).size : 0,
|
|
218
218
|
},
|
|
219
219
|
});
|
|
@@ -248,12 +248,12 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
248
248
|
...(recipeContext ? { recipe_context: recipeContext } : {}),
|
|
249
249
|
command: commandDetail,
|
|
250
250
|
...(materialized.promptFile
|
|
251
|
-
? { prompt_file: relative(stateDir, materialized.promptFile) }
|
|
251
|
+
? { prompt_file: relative(stateDir, materialized.promptFile).replaceAll("\\", "/") }
|
|
252
252
|
: {}),
|
|
253
253
|
...(materialized.promptBytes
|
|
254
254
|
? { prompt_bytes: materialized.promptBytes }
|
|
255
255
|
: {}),
|
|
256
|
-
...(sessionDir ? { session_dir: relative(stateDir, sessionDir) } : {}),
|
|
256
|
+
...(sessionDir ? { session_dir: relative(stateDir, sessionDir).replaceAll("\\", "/") } : {}),
|
|
257
257
|
...(commandSessionFiles(sessionDir).length > 0
|
|
258
258
|
? { session_files: commandSessionFiles(sessionDir) }
|
|
259
259
|
: {}),
|
|
@@ -386,7 +386,7 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
386
386
|
command: commandDetail,
|
|
387
387
|
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
388
388
|
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
389
|
-
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir) } : {}),
|
|
389
|
+
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
390
390
|
});
|
|
391
391
|
progressRunning();
|
|
392
392
|
const captureDir = join(stateDir, "captures", commandId);
|
|
@@ -457,7 +457,7 @@ export async function runAsyncRunner(stateDir = process.argv[2]) {
|
|
|
457
457
|
...captureDetails(result),
|
|
458
458
|
...(materialized.promptFile ? { prompt_file: materialized.promptFile } : {}),
|
|
459
459
|
...(materialized.promptBytes ? { prompt_bytes: materialized.promptBytes } : {}),
|
|
460
|
-
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir) } : {}),
|
|
460
|
+
...(session.sessionDir ? { session_dir: relative(stateDir, session.sessionDir).replaceAll("\\", "/") } : {}),
|
|
461
461
|
...(commandSessionFiles(session.sessionDir).length > 0
|
|
462
462
|
? { session_files: commandSessionFiles(session.sessionDir) }
|
|
463
463
|
: {}),
|
package/scripts/build-dist.mjs
CHANGED
|
@@ -20,13 +20,18 @@ import { join } from "node:path";
|
|
|
20
20
|
|
|
21
21
|
function run(command, args) {
|
|
22
22
|
const result = spawnSync(command, args, { stdio: "inherit" });
|
|
23
|
+
if (result.error) throw result.error;
|
|
23
24
|
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
rmSync("dist", { recursive: true, force: true });
|
|
27
28
|
mkdirSync("dist", { recursive: true });
|
|
28
29
|
|
|
29
|
-
run(
|
|
30
|
+
run(process.execPath, [
|
|
31
|
+
join("node_modules", "typescript", "bin", "tsc"),
|
|
32
|
+
"-p",
|
|
33
|
+
"tsconfig.build.json",
|
|
34
|
+
]);
|
|
30
35
|
|
|
31
36
|
mkdirSync(join("dist", "pi-actors"), { recursive: true });
|
|
32
37
|
writeFileSync(
|
package/scripts/conformance.mjs
CHANGED
|
@@ -28,7 +28,12 @@ function packageRoot() {
|
|
|
28
28
|
|
|
29
29
|
const result = spawnSync(
|
|
30
30
|
process.execPath,
|
|
31
|
-
[
|
|
31
|
+
[
|
|
32
|
+
"--experimental-strip-types",
|
|
33
|
+
"--test",
|
|
34
|
+
"--test-concurrency=1",
|
|
35
|
+
...conformanceSuites,
|
|
36
|
+
],
|
|
32
37
|
{ cwd: packageRoot(), encoding: "utf8", stdio: "pipe" },
|
|
33
38
|
);
|
|
34
39
|
|
package/scripts/recipe-utils.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
statSync,
|
|
17
17
|
writeFileSync,
|
|
18
18
|
} from "node:fs";
|
|
19
|
-
import { dirname, extname, join, relative, resolve } from "node:path";
|
|
19
|
+
import { basename, dirname, extname, join, relative, resolve, sep } from "node:path";
|
|
20
20
|
|
|
21
21
|
function usage() {
|
|
22
22
|
console.error(`Usage:
|
|
@@ -101,7 +101,7 @@ function collectRunSummary(rootValue) {
|
|
|
101
101
|
const root = resolve(
|
|
102
102
|
rootValue.replace(/^~(?=\/|$)/, process.env.HOME ?? "~"),
|
|
103
103
|
);
|
|
104
|
-
const files = walkFiles(root, 2).filter((file) => file
|
|
104
|
+
const files = walkFiles(root, 2).filter((file) => basename(file) === "run.json");
|
|
105
105
|
const rows = [];
|
|
106
106
|
for (const file of files) {
|
|
107
107
|
const run = readJson(file);
|
|
@@ -118,7 +118,7 @@ function collectRunSummary(rootValue) {
|
|
|
118
118
|
const progress = readJson(join(runDir, "progress.json"));
|
|
119
119
|
const result = readJson(join(runDir, "result.json"));
|
|
120
120
|
rows.push({
|
|
121
|
-
run: run.run_id ?? run.run ?? relative(root, file).split(
|
|
121
|
+
run: run.run_id ?? run.run ?? relative(root, file).split(sep)[0],
|
|
122
122
|
status: getRunStatus(run, progress, result),
|
|
123
123
|
recipe: run.recipe ?? run.recipe_file ?? "",
|
|
124
124
|
updated:
|
package/skills/actors/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: actors
|
|
3
3
|
description: Required practical guide for non-trivial pi-actors use, including parallel actor launches, subagent fanout, and autonomous coordinator workflows. Read before using or changing spawn, message, inspect, actor runs, tools, recipes, command templates, async lifecycle, mailboxes, artifacts, and local orchestration mechanics.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.42.
|
|
5
|
+
version: 0.42.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
package/skills/swarm/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: swarm
|
|
3
3
|
description: Subagent and actor orchestration with scoped locks, fanout, and quorum consensus. Use before launching multiple parallel actors or subagents for independent implementation, artifact generation, review, delegated audit, coordinated execution, or any workflow that needs autonomous coordinator decomposition and integration.
|
|
4
4
|
metadata:
|
|
5
|
-
version: 0.42.
|
|
5
|
+
version: 0.42.1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Swarm
|