@llblab/pi-actors 0.12.3 → 0.12.5
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 +2 -2
- package/CHANGELOG.md +8 -0
- package/README.md +88 -49
- package/package.json +5 -4
package/AGENTS.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Concept
|
|
11
11
|
|
|
12
|
-
`pi-actors` is a local-first
|
|
12
|
+
`pi-actors` is a local-first actor runtime and orchestrator for pi. It wraps trusted local programs, scripts, services, pipelines, and recipes as addressable actors that agents can `spawn`, control with typed `message` envelopes, and observe with `inspect`. It also persists user/agent-registered actor-control tools in `~/.pi/agent/actors-tools.json`, giving agents durable operational muscle memory for launching and managing the local actor zoo.
|
|
13
13
|
|
|
14
14
|
## Topology
|
|
15
15
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
- Prefer explicit migration boundaries over silent user-config rewrites
|
|
31
31
|
- Keep published documentation portable: use `~`, `<repo>`, or relative paths instead of machine-local absolute paths
|
|
32
32
|
- Preserve runtime output discipline because tool output flows directly into agent context
|
|
33
|
-
- Keep the project lens local-first and cybernetic: agents
|
|
33
|
+
- Keep the project lens local-first and cybernetic: agents wrap durable local capabilities as actors, then use semantic tools and messages instead of repeatedly reconstructing shell commands
|
|
34
34
|
- Design recipes as agent-callable tools: make prompts, scopes, paths, models, and policy knobs public args/defaults when the caller should decide them at invocation time
|
|
35
35
|
|
|
36
36
|
## Durable Conventions
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.12.5: README Actor Recipe Example
|
|
6
|
+
|
|
7
|
+
- `[Docs]` Replaced the placeholder shader-ring onboarding recipe with a concrete async docs-review actor recipe that includes typed args, mailbox metadata, and a real launch template. Impact: README onboarding now demonstrates actor wrapping instead of an abstract placeholder.
|
|
8
|
+
|
|
9
|
+
## 0.12.4: Actor Runtime Positioning
|
|
10
|
+
|
|
11
|
+
- `[Docs]` Reframed README and package metadata around `pi-actors` as an actor runtime and orchestrator for agent-managed local processes, while preserving the persistent actor-tool registry as one capability. Impact: new readers see how templates, recipes, mailboxes, messages, artifacts, and run state turn any trusted local process into an agent-controllable actor.
|
|
12
|
+
|
|
5
13
|
## 0.12.3: Package Metadata Hygiene
|
|
6
14
|
|
|
7
15
|
- `[Package]` Normalized npm repository metadata to the canonical `git+https://` URL form. Impact: npm publish no longer needs to auto-correct package metadata.
|
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# pi-actors
|
|
2
2
|
|
|
3
|
-
Actor runtime and
|
|
3
|
+
Actor runtime and orchestrator for agent-managed local processes.
|
|
4
4
|
|
|
5
|
-
`pi-actors`
|
|
5
|
+
`pi-actors` turns local programs, scripts, services, recipes, and long-running processes into addressable actors that agents can start, message, inspect, and compose. A music player, a sub-agent fanout, a repo-health pipeline, or any trusted local process can become an actor when it has a template-backed launch path, a mailbox contract, and observable runtime state.
|
|
6
|
+
|
|
7
|
+
The persistent tool registry is still useful: it lets agents keep durable operational muscle memory for trusted local commands and wrappers. But the project lens is broader than stored tools. `pi-actors` is a local-first orchestration runtime for wrapping capabilities as agent-managed entities with explicit interfaces.
|
|
6
8
|
|
|
7
9
|
## Start Here
|
|
8
10
|
|
|
@@ -11,20 +13,48 @@ Actor runtime and persistent local tool registry extension for the pi coding age
|
|
|
11
13
|
- [Changelog](./CHANGELOG.md)
|
|
12
14
|
- [Documentation](./docs/README.md)
|
|
13
15
|
|
|
16
|
+
## What It Is
|
|
17
|
+
|
|
18
|
+
`pi-actors` is the runtime layer that lets a pi agent turn a local capability into a controllable actor:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
program/process/service
|
|
22
|
+
→ command template
|
|
23
|
+
→ actor recipe
|
|
24
|
+
→ spawn
|
|
25
|
+
→ addressable actor
|
|
26
|
+
→ message / inspect / artifacts
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
An actor can be:
|
|
30
|
+
|
|
31
|
+
- A sub-agent running `pi -p` in a clean context.
|
|
32
|
+
- A background music player controlled by `player.next` or `player.pause` messages.
|
|
33
|
+
- A validation or repo-health pipeline that reports completion and artifacts.
|
|
34
|
+
- A parallel quorum review with branch-level progress.
|
|
35
|
+
- Any trusted local process with a launch template and a useful control surface.
|
|
36
|
+
|
|
37
|
+
The key move is not just “register a command.” It is to wrap a process in an agent-readable contract:
|
|
38
|
+
|
|
39
|
+
- **Launch**: `spawn` starts the actor from a template or recipe.
|
|
40
|
+
- **Interface**: `mailbox` declares accepted and emitted message types.
|
|
41
|
+
- **Control**: `message` sends typed envelopes to runs, branches, tools, or the coordinator.
|
|
42
|
+
- **Observation**: `inspect` reads status, logs, messages, mailbox metadata, files, and artifacts intentionally.
|
|
43
|
+
- **Persistence**: `artifacts` and state files make outcomes durable.
|
|
44
|
+
- **Memory**: `actors-tools.json` stores reusable actor-control wrappers across sessions.
|
|
45
|
+
|
|
14
46
|
## Key Features
|
|
15
47
|
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **Context Onboarding**: Injects a compact system-prompt note explaining templates, recipes, async runs, tasks, and agent fanout so installed sessions have the mental model available by default.
|
|
27
|
-
- **Coordinator-Scoped Run Observability**: Shows at least one stable triangle per running async run started by the current agent session, adds triangles for active parallel branches, then injects compact completion events only back to the launching coordinator when attention is needed.
|
|
48
|
+
- **Actor Runtime**: Starts local templates and recipes as addressable `run:<id>` actors with state, logs, message mailboxes, cancellation, and artifacts.
|
|
49
|
+
- **Agent-Managed Processes**: Wraps sub-agents, media players, pipelines, diagnostics, and other local programs as controllable entities instead of one-off commands.
|
|
50
|
+
- **Message-Oriented Control**: Uses `spawn`, `message`, and `inspect` as the public coordination vocabulary for start, control, and observation.
|
|
51
|
+
- **Mailbox Contracts**: Lets recipes declare what messages they accept and emit, so agents can discover how to interact with an actor.
|
|
52
|
+
- **Actor Tool Registry**: Stores persistent actor-control tool definitions in `~/.pi/agent/actors-tools.json` and registers them automatically on session start.
|
|
53
|
+
- **Command Template Substrate**: Keeps process launch portable with named placeholders, typed args, defaults, sequences, guarded nodes, retries, failure policy, and `parallel: true` fanout.
|
|
54
|
+
- **Composable Actor Recipes**: Stores reusable recipe JSON under `~/.pi/agent/recipes/*.json`; recipes can import other recipes, reuse defaults, declare artifacts, and opt into detached actor lifecycle with `async: true`.
|
|
55
|
+
- **Coordinator-Scoped Observability**: Shows ambient triangles for active actor runs and sends compact completion or request-for-attention follow-ups only to the launching coordinator.
|
|
56
|
+
- **Bounded Context Impact**: Returns compact output by default, truncates oversized stdout, and keeps full logs/artifacts in files for intentional inspection.
|
|
57
|
+
- **Local-First Tool Memory**: Still lets agents create durable semantic tools from trusted commands so they do not repeatedly reconstruct shell invocations.
|
|
28
58
|
|
|
29
59
|
## Install
|
|
30
60
|
|
|
@@ -64,50 +94,59 @@ The extension does not silently rewrite old registry files; keep or delete the o
|
|
|
64
94
|
|
|
65
95
|
## Mental Model
|
|
66
96
|
|
|
67
|
-
`pi-actors`
|
|
97
|
+
`pi-actors` separates launch mechanics from actor semantics:
|
|
68
98
|
|
|
69
99
|
```text
|
|
70
|
-
command
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
100
|
+
command template = how to start work
|
|
101
|
+
actor recipe = saved actor definition
|
|
102
|
+
spawn = create actor instance
|
|
103
|
+
message = connect/control actors
|
|
104
|
+
inspect = observe intentionally
|
|
105
|
+
artifacts = persist outcomes
|
|
106
|
+
mailbox = declare interaction contract
|
|
75
107
|
```
|
|
76
108
|
|
|
77
109
|
- A **command** is one concrete local process.
|
|
78
|
-
- A **command template** is the reusable shape
|
|
79
|
-
-
|
|
80
|
-
- A **registered tool** gives a
|
|
81
|
-
-
|
|
110
|
+
- A **command template** is the reusable launch shape for that process, with named placeholders.
|
|
111
|
+
- An **actor recipe** is saved JSON containing a template, defaults, imports, mailbox metadata, artifacts, and optional detached lifecycle.
|
|
112
|
+
- A **registered tool** gives a template or actor recipe a stable agent-facing name.
|
|
113
|
+
- A **run actor** is one execution instance with state, logs, actor messages, mailbox metadata, status, cancellation, and kill control.
|
|
82
114
|
|
|
83
|
-
The template remains the execution
|
|
115
|
+
The template remains the execution substrate. The recipe is the actor definition. `async: true` opts into detached actor lifecycle. `spawn` creates actors, `message` connects or controls them, and `inspect` observes them without teaching agents to poll blindly.
|
|
84
116
|
|
|
85
117
|
## Operator Onboarding
|
|
86
118
|
|
|
87
|
-
Start with foreground templates
|
|
119
|
+
Start with foreground templates when the work is short and deterministic:
|
|
88
120
|
|
|
89
121
|
```text
|
|
90
122
|
register_tool name=lint_docs description="Lint docs" template="npm run lint:docs"
|
|
91
123
|
```
|
|
92
124
|
|
|
93
|
-
Move to
|
|
125
|
+
Move to actor recipes when work is long-running, parallel, service-like, or agentic:
|
|
94
126
|
|
|
95
127
|
```json
|
|
96
128
|
{
|
|
97
|
-
"name": "
|
|
129
|
+
"name": "docs-review",
|
|
98
130
|
"async": true,
|
|
99
|
-
"
|
|
100
|
-
"
|
|
131
|
+
"args": ["scope:path", "model:string"],
|
|
132
|
+
"defaults": {
|
|
133
|
+
"model": "openai-codex/gpt-5.5"
|
|
134
|
+
},
|
|
135
|
+
"mailbox": {
|
|
136
|
+
"accepts": ["control.stop"],
|
|
137
|
+
"emits": ["review.completed", "run.failed"]
|
|
138
|
+
},
|
|
139
|
+
"template": "pi -p --model {model} --no-tools \"Review {scope} for unclear actor-runtime onboarding. Return concise findings.\""
|
|
101
140
|
}
|
|
102
141
|
```
|
|
103
142
|
|
|
104
|
-
Expose a reusable recipe as a normal capability:
|
|
143
|
+
Expose a reusable actor recipe as a normal capability:
|
|
105
144
|
|
|
106
145
|
```text
|
|
107
|
-
register_tool name=
|
|
146
|
+
register_tool name=docs_review description="Start an async docs review actor" template="docs-review.json" args="scope:path,model:string=openai-codex/gpt-5.5"
|
|
108
147
|
```
|
|
109
148
|
|
|
110
|
-
`Task` is the user's work item. `Template` is the execution graph. `
|
|
149
|
+
`Task` is the user's work item. `Template` is the execution graph. `Actor recipe` is saved JSON. `Run` is one actor instance with status, logs, messages, cancellation, artifacts, and ambient triangles.
|
|
111
150
|
|
|
112
151
|
## Compose Recipes With Imports
|
|
113
152
|
|
|
@@ -152,13 +191,13 @@ register_tool name=review_pair \
|
|
|
152
191
|
|
|
153
192
|
Imported recipes are recipe definitions, not nested async runs. The parent recipe's `async: true` creates one run with one state dir; imported recipes contribute command-template graph, args, defaults, and values.
|
|
154
193
|
|
|
155
|
-
## Register Tools
|
|
194
|
+
## Register Actor-Control Tools
|
|
156
195
|
|
|
157
|
-
`register_tool` lists, registers, updates, or deletes persistent tools. Call it without arguments to list the current registry.
|
|
196
|
+
`register_tool` lists, registers, updates, or deletes persistent actor-control tools. Call it without arguments to list the current registry. These tools are convenient handles for creating or invoking actors, not the whole runtime model.
|
|
158
197
|
|
|
159
198
|
### Local command: transcription
|
|
160
199
|
|
|
161
|
-
`pi-actors` is useful for exposing stable local commands as normal tools. For example, register an STT command:
|
|
200
|
+
`pi-actors` is also useful for exposing stable local commands as normal tools. For example, register an STT command:
|
|
162
201
|
|
|
163
202
|
```text
|
|
164
203
|
register_tool name=transcribe \
|
|
@@ -168,16 +207,16 @@ register_tool name=transcribe \
|
|
|
168
207
|
|
|
169
208
|
### Template recipe
|
|
170
209
|
|
|
171
|
-
For reusable workflows, keep the large template in a recipe file and register a small tool:
|
|
210
|
+
For reusable actor workflows, keep the large template and mailbox contract in a recipe file and register a small tool:
|
|
172
211
|
|
|
173
212
|
```text
|
|
174
|
-
register_tool name=
|
|
175
|
-
description="Start
|
|
176
|
-
template="
|
|
177
|
-
args="
|
|
213
|
+
register_tool name=docs_review \
|
|
214
|
+
description="Start an async docs review actor" \
|
|
215
|
+
template="docs-review.json" \
|
|
216
|
+
args="scope:path,model:string=openai-codex/gpt-5.5"
|
|
178
217
|
```
|
|
179
218
|
|
|
180
|
-
If the recipe file contains `async: true`, calling `
|
|
219
|
+
If the recipe file contains `async: true`, calling `docs_review` starts a detached run and returns metadata immediately. If `async` is omitted or false, the same recipe runs foreground and returns normal tool output.
|
|
181
220
|
|
|
182
221
|
A recipe can also be co-located in `actors-tools.json` when keeping metadata and the recipe body together is clearer:
|
|
183
222
|
|
|
@@ -230,19 +269,19 @@ The commands above persist entries like this in `~/.pi/agent/actors-tools.json`;
|
|
|
230
269
|
"description": "Run pi as a non-interactive sub-agent",
|
|
231
270
|
"template": "pi -p --model {model=openai-codex/gpt-5.5} --no-tools {prompt}"
|
|
232
271
|
},
|
|
233
|
-
"
|
|
234
|
-
"description": "Start
|
|
235
|
-
"args": ["
|
|
236
|
-
"template": "
|
|
272
|
+
"docs_review": {
|
|
273
|
+
"description": "Start an async docs review actor",
|
|
274
|
+
"args": ["scope:path", "model:string=openai-codex/gpt-5.5"],
|
|
275
|
+
"template": "docs-review.json"
|
|
237
276
|
}
|
|
238
277
|
}
|
|
239
278
|
```
|
|
240
279
|
|
|
241
280
|
This file is the durable actor-tool registry. `register_tool` is the interactive API; `actors-tools.json` is the persisted state that is loaded on future sessions.
|
|
242
281
|
|
|
243
|
-
## Manage
|
|
282
|
+
## Manage Actors
|
|
244
283
|
|
|
245
|
-
Use `spawn` when a command template may outlive the current turn. It starts the work now as an addressable actor, returns immediately with state metadata, and keeps ordinary files under `~/.pi/agent/tmp/pi-actors/runs/<run>` for later inspection.
|
|
284
|
+
Use `spawn` when a command template, service, pipeline, or recipe may outlive the current turn. It starts the work now as an addressable actor, returns immediately with state metadata, and keeps ordinary files under `~/.pi/agent/tmp/pi-actors/runs/<run>` for later inspection.
|
|
246
285
|
|
|
247
286
|
Start from an inline template as an addressable run actor:
|
|
248
287
|
|
|
@@ -316,7 +355,7 @@ See [`docs/recipe-library.md`](./docs/recipe-library.md) for install notes and r
|
|
|
316
355
|
|
|
317
356
|
## Runtime Contract
|
|
318
357
|
|
|
319
|
-
-
|
|
358
|
+
- Actor-control tool names are normalized to snake_case.
|
|
320
359
|
- Reserved built-in names are blocked.
|
|
321
360
|
- Templates are split into shell-like words first, then placeholders are substituted per command arg.
|
|
322
361
|
- Tool args are derived from placeholders when `args` is omitted.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llblab/pi-actors",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Actor runtime and orchestrator for agent-managed local processes",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
"keywords": [
|
|
17
17
|
"pi-package",
|
|
18
18
|
"pi-extension",
|
|
19
|
-
"
|
|
19
|
+
"actors",
|
|
20
|
+
"orchestration",
|
|
20
21
|
"automation",
|
|
21
|
-
"
|
|
22
|
+
"tools"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
25
|
"check": "node --experimental-strip-types -e \"await import('./index.ts'); console.log('pi-actors: extension import ok')\"",
|