@llblab/pi-actors 0.13.4 → 0.14.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/BACKLOG.md +1 -1
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/docs/actor-messages.md +1 -1
- package/docs/async-runs.md +3 -3
- package/docs/recipe-library.md +3 -3
- package/docs/task-first-recipes.md +5 -5
- package/lib/tools.ts +6 -7
- package/package.json +1 -1
- package/scripts/recipe-utils.mjs +1 -1
package/BACKLOG.md
CHANGED
|
@@ -6,7 +6,7 @@ Continue progressive component/pipeline expansion in small validated slices; rea
|
|
|
6
6
|
|
|
7
7
|
- Plan organic universal communication primitives.
|
|
8
8
|
- Priority: High.
|
|
9
|
-
- Status: The actor-like model is empirically useful: async runs can emit follow-up messages upward, coordinators can send run-local commands downward, multiple parallel runs can progress independently, and recipes no longer need sleep-poll coordination. The design is captured in `docs/actor-messages.md`: `spawn`, `message`, and `inspect` as concentrated verbs; addressed actors; one symmetric message envelope; mailbox `accepts`/`emits`; and adapter mappings from runtime async actions. Initial implementation landed pure actor address/message normalization plus public `spawn`, `message`, and `inspect` tools for `run:<id>` actors; `spawn` accepts state/artifact metadata, `message` routes `run:<id>` → `coordinator` and `run:<id>` → `session:<id>` envelopes into the runtime attention path, `message` can invoke `tool:<name>` actors, `inspect target=tool:<name>` exposes registered tool actor contracts, `inspect target=coordinator` exposes current-session run inventory, all packaged async recipes declare mailbox metadata, `inspect view=mailbox` exposes recipe mailbox contracts from run metadata, recipe-authored messages now use envelope-aligned `type` fields with deterministic validated wrapping available through `utility-actor-message`, run termination now uses actor-native `control.stop`/`control.cancel`/`control.kill` without runtime-prefixed control aliases, async command events preserve full argv details while keeping coordinator summaries bounded, async-run operations recommendations now emit structured `message`/`inspect` objects instead of shell-like suggestion strings, `inspect view=messages` exposes run actor messages while retaining `events` as a compatibility alias, async-run operations recipes now expose `message_file`/`messages` terminology instead of public event-file args, and operator-facing docs now describe coordination with actor-message terminology before transport details, async-run docs separate public actor behavior from storage/transport mechanics more clearly, public actor-message/template guidance avoids transport-specific wording, and async-run operations recipes now use only `message_file` for actor-message inputs,
|
|
9
|
+
- Status: The actor-like model is empirically useful: async runs can emit follow-up messages upward, coordinators can send run-local commands downward, multiple parallel runs can progress independently, and recipes no longer need sleep-poll coordination. The design is captured in `docs/actor-messages.md`: `spawn`, `message`, and `inspect` as concentrated verbs; addressed actors; one symmetric message envelope; mailbox `accepts`/`emits`; and adapter mappings from runtime async actions. Initial implementation landed pure actor address/message normalization plus public `spawn`, `message`, and `inspect` tools for `run:<id>` actors; `spawn` accepts state/artifact metadata, `message` routes `run:<id>` → `coordinator` and `run:<id>` → `session:<id>` envelopes into the runtime attention path, `message` can invoke `tool:<name>` actors, `inspect target=tool:<name>` exposes registered tool actor contracts, `inspect target=coordinator` exposes current-session run inventory, all packaged async recipes declare mailbox metadata, `inspect view=mailbox` exposes recipe mailbox contracts from run metadata, recipe-authored messages now use envelope-aligned `type` fields with deterministic validated wrapping available through `utility-actor-message`, run termination now uses actor-native `control.stop`/`control.cancel`/`control.kill` without runtime-prefixed control aliases, async command events preserve full argv details while keeping coordinator summaries bounded, async-run operations recommendations now emit structured `message`/`inspect` objects instead of shell-like suggestion strings, `inspect view=messages` exposes run actor messages while retaining `events` as a compatibility alias, async-run operations recipes now expose `message_file`/`messages` terminology instead of public event-file args, and operator-facing docs now describe coordination with actor-message terminology before transport details, async-run docs separate public actor behavior from storage/transport mechanics more clearly, public actor-message/template guidance avoids transport-specific wording, and async-run operations recipes now use only `message_file` for actor-message inputs, interactive recipe mailboxes now advertise actor-native termination controls where the runtime already supports them, task-first/library docs now describe operations snapshots in terms of actor-message tails instead of event tails, and `inspect view=events` has been removed from the public inspect surface in favor of `inspect view=messages`. Remaining work is to absorb remaining runtime async action surfaces into the actor vocabulary instead of preserving a parallel public API.
|
|
10
10
|
- Scope: Design and implement a small semantic layer around addressed messages and actors while preserving low-level primitives as adapters where useful. Candidate top-level concepts are `spawn` for creating an actor/run from a recipe or template, `message` for sending typed messages to any address, and `inspect` for intentional observation/debugging. Candidate addresses include `run:<id>`, `branch:<run>/<branch>`, `coordinator`, `session:<id>`, `tool:<name>`, and future chat/session endpoints. Candidate message fields include `to`, `from`, `type`, `summary`, `body`, `reply_to`, `correlation_id`, and `metadata`.
|
|
11
11
|
- Contract direction: Unify “send down” and “messages up” as one message model. `to: run:<id>` routes to a run mailbox, `to: coordinator` routes to the coordinator attention path, and branch/tool/session addresses can be layered over the same semantic envelope. Recipes should declare mailbox capability (`accepts`, `emits`) without exposing FIFO/outbox mechanics or delivery policy as their public interface.
|
|
12
12
|
- Design gates: Breaking changes are allowed in this phase, so compress concepts instead of preserving accidental surfaces. Consolidate duplicated lifecycle/message/event APIs into a concentrated protocol with the fewest durable nouns and verbs that still explain the system. Duplex communication should be symmetric where the domain is symmetric: the same message envelope should represent run→coordinator, coordinator→run, run→run, branch→parent, and parent→branch traffic, with routing/transport hidden below it. Keep command templates as the portable synchronous execution graph; keep recipe files as semantic definitions; avoid leaking transports into public args; make polling an explicit diagnostic operation, not an example path; replace runtime action names with the actor API rather than preserving parallel concepts.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.0: Message-Only Run Inspection
|
|
4
|
+
|
|
5
|
+
- `[Actor Tools]` Removed `inspect view=events` as a public compatibility alias. Impact: run actor message streams are inspected only with `inspect view=messages`, keeping the public observation vocabulary aligned with actor messages.
|
|
6
|
+
- `[Docs]` Updated README and async-run/actor-message docs to remove the events inspection view and point operators to `inspect view=messages`. Impact: examples and tool descriptions no longer teach the transitional events alias.
|
|
7
|
+
|
|
8
|
+
## 0.13.5: Actor Message Snapshot Wording
|
|
9
|
+
|
|
10
|
+
- `[Docs]` Replaced remaining task-first and recipe-library event-tail wording for async-run operations with actor-message tail terminology. Impact: operations guidance now matches the `message_file` recipe surface and `inspect view=messages` actor vocabulary.
|
|
11
|
+
- `[Utilities]` Updated the `recipe-utils.mjs run-ops-snapshot` usage text from `<event-file>` to `<message-file>`. Impact: helper diagnostics no longer teach the old public noun.
|
|
12
|
+
|
|
3
13
|
## 0.13.4: Interactive Recipe Termination Contracts
|
|
4
14
|
|
|
5
15
|
- `[Recipe Library]` Added actor-native `control.stop`, `control.cancel`, and `control.kill` mailbox accepts to interactive artifact/message/fanout recipes and the music player recipe. Impact: `inspect view=mailbox` now advertises the run termination messages that the actor runtime supports for these long-lived recipe actors.
|
package/README.md
CHANGED
|
@@ -377,7 +377,7 @@ See [`docs/recipe-library.md`](./docs/recipe-library.md) for install notes and r
|
|
|
377
377
|
- `async: true` on a recipe selects detached run lifecycle; omitted or false async runs the recipe foreground through registered tools.
|
|
378
378
|
- Layer boundaries stay explicit: command templates define synchronous execution graphs; template recipes add saved JSON metadata/import resolution and named `artifacts`; async runs add detached lifecycle, state, IPC, and observability.
|
|
379
379
|
- `spawn`, `message`, and `inspect` are high-level actor adapters. `spawn` creates `run:<id>` actors from recipes or inline templates with optional state/artifact metadata, `message` sends one typed envelope to `run:<id>` mailboxes, `branch:<run>/<branch>` mailboxes, `tool:<name>` calls, or coordinator/session attention paths, and `inspect` intentionally reads `run:<id>` status/tail/messages/mailbox metadata, coordinator/session run status, or registered `tool:<name>` contracts while the broader actor/message protocol is refined.
|
|
380
|
-
- `spawn`, `message`, and `inspect` are the public async coordination vocabulary. Low-level async actions map to this actor API: start belongs to `spawn`; send/control/stop/kill belongs to `message`; status/tail/messages/list belongs to `inspect
|
|
380
|
+
- `spawn`, `message`, and `inspect` are the public async coordination vocabulary. Low-level async actions map to this actor API: start belongs to `spawn`; send/control/stop/kill belongs to `message`; status/tail/messages/list belongs to `inspect`. Use `inspect view=messages` for actor-envelope streams. Use `control.stop`, `control.cancel`, and `control.kill` for run termination; runtime-prefixed control aliases are no longer part of the public surface.
|
|
381
381
|
- Actor management returns compact text by default; pass `verbose: true` to `inspect` when full JSON state is needed.
|
|
382
382
|
- Detached runs inject `{run_id}` and `{state_dir}` into template values for run-local artifacts or recipe-specific control endpoints.
|
|
383
383
|
- Runtime actor messages are persisted in the run state dir; coordinator attention is inferred by the runtime, not exposed as recipe or message-envelope input. Follow-ups preserve bounded body previews and metadata for decision messages.
|
package/docs/actor-messages.md
CHANGED
|
@@ -131,7 +131,7 @@ Recipes can declare their conversational surface:
|
|
|
131
131
|
}
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
The implementation supports `status`, `tail`, `messages`, `
|
|
134
|
+
The implementation supports `status`, `tail`, `messages`, `artifacts`, `files`, and `mailbox` for `run:<id>` actors, `status`/`runs` for `coordinator`, `session:<id>`, and `session:all` actors with optional status filtering, and `status`/`schema` for registered `tool:<name>` actors. Use `messages` for actor-envelope inspection. `inspect target=coordinator` requires a current coordinator session; use `session:<id>` or `session:all` when the session is intentionally explicit. Direct `run:<id>` inspection respects coordinator-session ownership when the current session is known. `inspect` is for decision points and diagnosis only; examples must not teach sleep-then-inspect polling.
|
|
135
135
|
|
|
136
136
|
## Runtime Direction
|
|
137
137
|
|
package/docs/async-runs.md
CHANGED
|
@@ -135,13 +135,13 @@ The actor-level surface is:
|
|
|
135
135
|
|
|
136
136
|
- `spawn`: start a detached `run:<id>` actor from `file`, `recipe`, or inline `template`.
|
|
137
137
|
- `message`: send one typed envelope to `run:<id>`, `branch:<run>/<branch>`, `tool:<name>`, `coordinator`, or `session:<id>`.
|
|
138
|
-
- `inspect`: intentionally read owned `run:<id>` status, tail, messages,
|
|
138
|
+
- `inspect`: intentionally read owned `run:<id>` status, tail, messages, artifacts, files, or mailbox metadata; read current `coordinator` run inventory only when a coordinator session is known; read `session:<id>` or `session:all` run inventory with optional status filtering when the session is explicit; read `tool:<name>` status or schema for registered tool actors.
|
|
139
139
|
|
|
140
140
|
Low-level async actions map into the actor surface instead of forming a second public model:
|
|
141
141
|
|
|
142
142
|
- start → `spawn`
|
|
143
143
|
- send/control → `message`
|
|
144
|
-
- status/tail/messages/
|
|
144
|
+
- status/tail/messages/list → `inspect`
|
|
145
145
|
- stop/kill → `message` with `control.stop` or `control.kill`, with synchronous results
|
|
146
146
|
|
|
147
147
|
Compact text is returned by default so async management does not flood agent context; use verbose inspection when the full state object is needed. List output intentionally shares one state root across music, subagents, timers, and other async work; source fields such as `tool` and `recipe` distinguish run purpose when the launcher recorded them. Registered tools are the preferred user-facing surface for reusable recipes.
|
|
@@ -304,7 +304,7 @@ Coordinator responsibilities stay outside the async runtime:
|
|
|
304
304
|
- Partition backlog tasks by stable task IDs and non-overlapping mutation zones.
|
|
305
305
|
- Write scope files before starting the run.
|
|
306
306
|
- Pass scope paths and branch names as values.
|
|
307
|
-
- Use `inspect target=run:<id> view=status` or `view=tail` after terminal
|
|
307
|
+
- Use `inspect target=run:<id> view=status` or `view=tail` after terminal run messages.
|
|
308
308
|
- Treat pushed branches as artifacts for review, not as automatic merges.
|
|
309
309
|
- Record failed scopes back into the backlog.
|
|
310
310
|
|
package/docs/recipe-library.md
CHANGED
|
@@ -71,7 +71,7 @@ Pipeline recipes demonstrate second-order composition:
|
|
|
71
71
|
- `recipes/subagent-review-coordinator.json`: Lens reviewers → verifier → merger → judge → normalizer.
|
|
72
72
|
- `recipes/pipeline-release-readiness.json`: Task-first release cell: changelog section → validation → release review → artifact report.
|
|
73
73
|
- `recipes/pipeline-repo-health.json`: Task-first repository-health cell: git status/log → docs index → validation → normalized artifact report.
|
|
74
|
-
- `recipes/pipeline-async-run-ops.json`: Task-first async-run operations cell: run summary →
|
|
74
|
+
- `recipes/pipeline-async-run-ops.json`: Task-first async-run operations cell: run summary → actor-message tail → normalized operations report → artifact report.
|
|
75
75
|
- `recipes/pipeline-review-readiness.json`: Release/readiness gate over selected lenses.
|
|
76
76
|
- `recipes/pipeline-quorum-review.json`: Quorum vote shape → merge → judge → normalize.
|
|
77
77
|
- `recipes/pipeline-architect-coordinator.json`: Architecture lens fanout → critique → verification → synthesis → next slice.
|
|
@@ -91,7 +91,7 @@ These are examples of library composition, not a workflow DSL. Pipeline recipes
|
|
|
91
91
|
Utility recipes cover local operator workflows that do not need subagents:
|
|
92
92
|
|
|
93
93
|
- `recipes/utility-markdown-index.json`: List Markdown files in a directory as input for README/docs index maintenance.
|
|
94
|
-
- `recipes/utility-jsonl-tail.json`: Tail a JSONL/
|
|
94
|
+
- `recipes/utility-jsonl-tail.json`: Tail a JSONL message/log file with a configurable line count.
|
|
95
95
|
- `recipes/utility-validation-wrapper.json`: Run a caller-supplied validation command in a scoped directory with a bounded timeout.
|
|
96
96
|
- `recipes/utility-git-status.json`: Read concise branch/worktree state for a repo.
|
|
97
97
|
- `recipes/utility-git-log.json`: Read recent decorated commit history for a repo.
|
|
@@ -99,7 +99,7 @@ Utility recipes cover local operator workflows that do not need subagents:
|
|
|
99
99
|
- `recipes/utility-changelog-head.json`: Read the top slice of a changelog for release summary prep.
|
|
100
100
|
- `recipes/utility-playlist-scan.json`: List local media files as playlist-building input.
|
|
101
101
|
- `recipes/utility-run-summary.json`: Use `scripts/recipe-utils.mjs` to summarize async run state files as JSON.
|
|
102
|
-
- `recipes/utility-run-ops-snapshot.json`: Combine async run summaries,
|
|
102
|
+
- `recipes/utility-run-ops-snapshot.json`: Combine async run summaries, actor-message JSONL tails, and stale/terminal recommendations into one structured operations snapshot.
|
|
103
103
|
- `recipes/utility-playlist-build.json`: Use `scripts/recipe-utils.mjs` to build a filtered playlist listing as newline paths, M3U, or inline `|`-separated source.
|
|
104
104
|
- `recipes/utility-changelog-section.json`: Use `scripts/recipe-utils.mjs` to extract one changelog release section.
|
|
105
105
|
- `recipes/utility-artifact-manifest.json`: Use `scripts/recipe-utils.mjs` to emit a machine-readable JSON manifest for an artifact path.
|
|
@@ -88,13 +88,13 @@ Purpose: inspect, summarize, and decide actions for local async runs.
|
|
|
88
88
|
Pipeline:
|
|
89
89
|
|
|
90
90
|
```text
|
|
91
|
-
run-state summary →
|
|
91
|
+
run-state summary → actor-message tail → stale/active classification → recommended action → optional stop/control message
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Likely needed cells:
|
|
95
95
|
|
|
96
96
|
- run summary helper
|
|
97
|
-
- JSONL
|
|
97
|
+
- JSONL actor-message tailer
|
|
98
98
|
- stale-run classifier
|
|
99
99
|
- control-message recommender
|
|
100
100
|
- run report artifact
|
|
@@ -108,7 +108,7 @@ Existing seeds:
|
|
|
108
108
|
|
|
109
109
|
Implemented seed:
|
|
110
110
|
|
|
111
|
-
- `pipeline-async-run-ops`: structured run operations snapshot → normalized operations report → artifact report. The snapshot combines run summary,
|
|
111
|
+
- `pipeline-async-run-ops`: structured run operations snapshot → normalized operations report → artifact report. The snapshot combines run summary, actor-message tail, and recommended inspect/control messages before the LLM normalization step.
|
|
112
112
|
|
|
113
113
|
### Research Brief Cell
|
|
114
114
|
|
|
@@ -197,14 +197,14 @@ Purpose: convert local media directories into controllable playback workflows.
|
|
|
197
197
|
Pipeline:
|
|
198
198
|
|
|
199
199
|
```text
|
|
200
|
-
media scan → playlist build → playback start →
|
|
200
|
+
media scan → playlist build → playback start → message summary → controls
|
|
201
201
|
```
|
|
202
202
|
|
|
203
203
|
Likely needed cells:
|
|
204
204
|
|
|
205
205
|
- playlist builder
|
|
206
206
|
- music player
|
|
207
|
-
- run/
|
|
207
|
+
- run/message summary
|
|
208
208
|
- control recommender
|
|
209
209
|
|
|
210
210
|
Existing seeds:
|
package/lib/tools.ts
CHANGED
|
@@ -423,14 +423,14 @@ export function createInspectToolDefinition<TContext = unknown>(
|
|
|
423
423
|
name: "inspect",
|
|
424
424
|
label: "Inspect",
|
|
425
425
|
description:
|
|
426
|
-
"Intentionally inspect an actor. Supports run:<id> views: status, tail,
|
|
426
|
+
"Intentionally inspect an actor. Supports run:<id> views: status, tail, messages, artifacts, files, mailbox; coordinator/session status; and tool:<name> status/schema.",
|
|
427
427
|
parameters: objectSchema(
|
|
428
428
|
{
|
|
429
|
-
lines: stringSchema("Line count for tail/
|
|
429
|
+
lines: stringSchema("Line count for tail/messages views. Default 40."),
|
|
430
430
|
status: stringSchema("Optional session run filter: all, running, active, terminal, done, failed, cancelled, killed, or exited."),
|
|
431
431
|
target: stringSchema("Actor address to inspect, e.g. run:<id>, coordinator, session:<id>, session:all, or tool:<name>."),
|
|
432
432
|
verbose: booleanSchema("Return full JSON instead of compact text where available."),
|
|
433
|
-
view: stringSchema("Inspection view: status, tail, messages,
|
|
433
|
+
view: stringSchema("Inspection view: status, tail, messages, artifacts, files, or mailbox."),
|
|
434
434
|
},
|
|
435
435
|
["target", "view"],
|
|
436
436
|
),
|
|
@@ -522,8 +522,7 @@ export function createInspectToolDefinition<TContext = unknown>(
|
|
|
522
522
|
const text = AsyncRuns.tailRun(runId, Number(input.lines || 40));
|
|
523
523
|
return { content: [{ type: "text" as const, text: `\n${text}` }], details: {} };
|
|
524
524
|
}
|
|
525
|
-
case "messages":
|
|
526
|
-
case "events": {
|
|
525
|
+
case "messages": {
|
|
527
526
|
assertRunAccessibleToContext(runId, ctx);
|
|
528
527
|
const messages = AsyncRuns.readRunEvents(runId, Number(input.lines || 40));
|
|
529
528
|
return {
|
|
@@ -533,7 +532,7 @@ export function createInspectToolDefinition<TContext = unknown>(
|
|
|
533
532
|
text: maybeJsonText(messages, input.verbose === true, compactRunEvents(messages)),
|
|
534
533
|
},
|
|
535
534
|
],
|
|
536
|
-
details: { messages
|
|
535
|
+
details: { messages },
|
|
537
536
|
};
|
|
538
537
|
}
|
|
539
538
|
case "artifacts":
|
|
@@ -563,7 +562,7 @@ export function createInspectToolDefinition<TContext = unknown>(
|
|
|
563
562
|
};
|
|
564
563
|
}
|
|
565
564
|
default:
|
|
566
|
-
throw new Error("inspect view must be one of: status, tail, messages,
|
|
565
|
+
throw new Error("inspect view must be one of: status, tail, messages, artifacts, files, mailbox.");
|
|
567
566
|
}
|
|
568
567
|
},
|
|
569
568
|
};
|
package/package.json
CHANGED
package/scripts/recipe-utils.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname, extname, join, relative, resolve } from "node:path";
|
|
|
5
5
|
function usage() {
|
|
6
6
|
console.error(`Usage:
|
|
7
7
|
recipe-utils.mjs run-summary <state-root>
|
|
8
|
-
recipe-utils.mjs run-ops-snapshot <state-root> <
|
|
8
|
+
recipe-utils.mjs run-ops-snapshot <state-root> <message-file> [lines] [stale-minutes]
|
|
9
9
|
recipe-utils.mjs playlist <source-dir> [extensions] [max-depth] [paths|m3u|inline]
|
|
10
10
|
recipe-utils.mjs changelog-section <file> <version>
|
|
11
11
|
recipe-utils.mjs artifact-manifest <artifact-path> <title> <status> [summary]
|