@llblab/pi-actors 0.12.0 → 0.12.2
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 +10 -0
- package/README.md +26 -4
- package/docs/template-recipes.md +1 -1
- package/docs/tool-registry.md +17 -1
- package/index.ts +1 -1
- package/lib/config.ts +1 -1
- package/lib/paths.ts +1 -1
- package/lib/prompts.ts +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Concept
|
|
11
11
|
|
|
12
|
-
`pi-actors` is a local-first, cybernetic actor layer for pi. It persists user/agent-registered tools in `~/.pi/agent/tools.json` and registers them automatically across sessions, giving agents durable operational muscle memory for trusted local commands, scripts, actor recipes, and async actor runs. Treat it as MCP-adjacent local capability creation: the agent can create and refine its own tools instead of depending only on external tool servers.
|
|
12
|
+
`pi-actors` is a local-first, cybernetic actor layer for pi. It persists user/agent-registered actor-control tools in `~/.pi/agent/actors-tools.json` and registers them automatically across sessions, giving agents durable operational muscle memory for trusted local commands, scripts, actor recipes, and async actor runs. Treat it as MCP-adjacent local capability creation: the agent can create and refine its own tools instead of depending only on external tool servers.
|
|
13
13
|
|
|
14
14
|
## Topology
|
|
15
15
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
## Durable Conventions
|
|
37
37
|
|
|
38
|
-
- `Tool registry source`: `~/.pi/agent/tools.json` is the persistent user config | Trigger: Any runtime registration or migration work | Action: Preserve atomic writes and avoid hidden format changes without an explicit migration path
|
|
38
|
+
- `Tool registry source`: `~/.pi/agent/actors-tools.json` is the persistent user config | Trigger: Any runtime registration or migration work | Action: Preserve atomic writes and avoid hidden format changes without an explicit migration path
|
|
39
39
|
- `Current runtime contract`: Register trusted command templates with tool names from registry keys, placeholder-derived args, progressive typed arg declarations, inline/default/`??`/ternary config fallback, placeholder-derived numeric node controls, split-first command-arg construction, sequential or `parallel: true` composition, direct no-shell execution, optional per-node `when`, optional per-node positive `timeout` disabled by default, lightweight warnings for obvious trusted-executable risk shapes, per-node `delay`, bounded leaf/node `retry`, `failure: "continue|branch|root"` propagation, `recover` cleanup between retry attempts, template recipes with explicit `async: true` detached mode, actor-oriented `spawn`/`message`/`inspect` tools with run-local JSONL outbox messages, Unix FIFO send, graceful cancel, and force kill, generic detached run primitives with process-group cancellation, injected async `{run_id}` and `{state_dir}` values, coordinator-scoped event-driven observability with at least one triangle per active async run and extra triangles for active parallel branches, runtime-inferred `command.done` bubbling for packaged multi-agent fanout, named recipe `artifacts`, recipe `mailbox` metadata, terminal follow-ups for `done`/`failed`/unhandled `killed`/`exited` states, `template` recipe references, recipe-layer `imports`, co-located recipe entries, `~/.pi/agent/recipes/*.json` template recipe files, run state under `~/.pi/agent/tmp/pi-actors/runs`, and `{file}` as the canonical local file path arg | Trigger: Changing registration or invocation behavior | Action: Keep README, command-template docs, template-recipe docs, async-run docs, actor-message docs, implementation, and migration notes aligned
|
|
40
40
|
- `Typed arg authoring`: Typed args support `string`, `path`, `int`, `number`, `bool`, and `enum(...)` plus two equivalent readability styles: metadata-first (`args` + `defaults` + simple `{name}` placeholders) for long command lines, and inline-first (`{name:type=default}` placeholders) for compact one-property templates | Trigger: Changing arg parsing, docs, schema generation, or registry serialization | Action: Preserve both styles, keep explicit `args` type declarations higher priority than inline placeholder types, and make breaking cleanup explicit when removing old arg shapes
|
|
41
41
|
- `Template recipe graph`: The valid execution chain is `tool → template → recipe → run → template`; file-backed and co-located recipes are storage variants of that chain | Trigger: Adding registry bindings, recipes, docs, or runtime shortcuts | Action: Keep command templates synchronous and portable, use `async: true` as the detached run switch, require every recipe to own `template` directly, and reject cyclic shortcuts such as recipe-owned `tool`
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.12.2: Registry Migration Notes
|
|
6
|
+
|
|
7
|
+
- `[Docs]` Added explicit rename migration instructions for copying `~/.pi/agent/auto-tools.json` or the short-lived `~/.pi/agent/tools.json` to `~/.pi/agent/actors-tools.json`. Impact: operators keep control of config migration while the package avoids silent rewrites of old registry files.
|
|
8
|
+
|
|
9
|
+
## 0.12.1: Actor Tool Registry Name
|
|
10
|
+
|
|
11
|
+
- `[Registry]` Renamed the new pi-actors registry filename from `tools.json` to `actors-tools.json`. Impact: the persisted config name now clearly describes actor-control tools instead of implying every pi tool belongs to this extension.
|
|
12
|
+
|
|
13
|
+
## 0.12.0: Rename to pi-actors
|
|
14
|
+
|
|
5
15
|
- `[Rename]` Renamed the package and current public surface from `@llblab/pi-auto-tools` / `pi-auto-tools` to `@llblab/pi-actors` / `pi-actors`, moved the persistent registry filename from `auto-tools.json` to `tools.json`, and moved runtime state defaults from `~/.pi/agent/tmp/pi-auto-tools` to `~/.pi/agent/tmp/pi-actors`. Impact: the package name now matches the actor API model introduced in 0.10-0.11, while the durable registry becomes the generic pi agent tools config.
|
|
6
16
|
|
|
7
17
|
## 0.11.0: Actor API Compression
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Actor runtime and persistent local tool registry extension for the pi coding age
|
|
|
15
15
|
|
|
16
16
|
- **Local-First Tool Memory**: Lets agents create and persist their own trusted local tools, forming durable operational muscle memory instead of one-off shell commands.
|
|
17
17
|
- **Commands Become Capabilities**: Turns stable local workflows into semantic agent tools, so the agent chooses what it can do instead of reconstructing how to run shell commands.
|
|
18
|
-
- **
|
|
18
|
+
- **Actor Tool Registry**: Stores actor-control tool definitions in `~/.pi/agent/actors-tools.json` and registers them automatically on session start.
|
|
19
19
|
- **Compact Semantic Interface**: Exposes short tool names, descriptions, named args, and defaults instead of long paths, positional command-arg order, and repeated command boilerplate.
|
|
20
20
|
- **Safer Local Automation**: Wraps trusted command templates as narrow tools using split-first command-arg construction, placeholder substitution, and no shell evaluation.
|
|
21
21
|
- **Reusable Building Blocks**: Makes skill scripts, sub-agent wrappers, diagnostics, and project workflows available as composable agent capabilities.
|
|
@@ -40,6 +40,28 @@ From git:
|
|
|
40
40
|
pi install git:github.com/llblab/pi-actors
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
## Rename Migration
|
|
44
|
+
|
|
45
|
+
`pi-actors` reads persistent actor-control tools from:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
~/.pi/agent/actors-tools.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If you previously used `pi-auto-tools`, copy the old registry intentionally:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cp ~/.pi/agent/auto-tools.json ~/.pi/agent/actors-tools.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If you installed the brief `0.12.0`/`0.12.1` line and created `tools.json`, copy that file instead:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
cp ~/.pi/agent/tools.json ~/.pi/agent/actors-tools.json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The extension does not silently rewrite old registry files; keep or delete the old file after confirming the new registry loads as expected.
|
|
64
|
+
|
|
43
65
|
## Mental Model
|
|
44
66
|
|
|
45
67
|
`pi-actors` has one execution idea that grows in place:
|
|
@@ -157,7 +179,7 @@ register_tool name=shader_ring \
|
|
|
157
179
|
|
|
158
180
|
If the recipe file contains `async: true`, calling `shader_ring` starts a detached run and returns metadata immediately. If `async` is omitted or false, the same recipe runs foreground and returns normal tool output.
|
|
159
181
|
|
|
160
|
-
A recipe can also be co-located in `tools.json` when keeping metadata and the recipe body together is clearer:
|
|
182
|
+
A recipe can also be co-located in `actors-tools.json` when keeping metadata and the recipe body together is clearer:
|
|
161
183
|
|
|
162
184
|
```json
|
|
163
185
|
{
|
|
@@ -196,7 +218,7 @@ register_tool name=call_subagent template=null
|
|
|
196
218
|
|
|
197
219
|
## Resulting Config
|
|
198
220
|
|
|
199
|
-
The commands above persist entries like this in `~/.pi/agent/tools.json`; tool names come from the top-level keys. Stored entries keep `template` last so flags and metadata are read before executable content:
|
|
221
|
+
The commands above persist entries like this in `~/.pi/agent/actors-tools.json`; tool names come from the top-level keys. Stored entries keep `template` last so flags and metadata are read before executable content:
|
|
200
222
|
|
|
201
223
|
```json
|
|
202
224
|
{
|
|
@@ -216,7 +238,7 @@ The commands above persist entries like this in `~/.pi/agent/tools.json`; tool n
|
|
|
216
238
|
}
|
|
217
239
|
```
|
|
218
240
|
|
|
219
|
-
This file is the durable registry. `register_tool` is the interactive API; `tools.json` is the persisted state that is loaded on future sessions.
|
|
241
|
+
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.
|
|
220
242
|
|
|
221
243
|
## Manage Run Actors
|
|
222
244
|
|
package/docs/template-recipes.md
CHANGED
|
@@ -180,7 +180,7 @@ A registered tool can point at an actor recipe by storing the recipe path or nam
|
|
|
180
180
|
|
|
181
181
|
If `shader-ring-8-parallel.json` contains `async: true`, calling `shader_ring` starts a detached run and returns metadata. If `async` is omitted or false, calling `shader_ring` executes the recipe foreground and returns normal tool output.
|
|
182
182
|
|
|
183
|
-
A registered tool may also co-locate an actor recipe directly in `tools.json`:
|
|
183
|
+
A registered tool may also co-locate an actor recipe directly in `actors-tools.json`:
|
|
184
184
|
|
|
185
185
|
```json
|
|
186
186
|
{
|
package/docs/tool-registry.md
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
# Tool Registry
|
|
2
2
|
|
|
3
|
-
`pi-actors` stores registered command-template tools and template-recipe launchers in `~/.pi/agent/tools.json` and registers them automatically on session start.
|
|
3
|
+
`pi-actors` stores registered actor-control command-template tools and template-recipe launchers in `~/.pi/agent/actors-tools.json` and registers them automatically on session start.
|
|
4
4
|
|
|
5
5
|
This document is the local adaptation of the portable [Command Template Standard](./command-templates.md).
|
|
6
6
|
|
|
7
|
+
## Rename Migration
|
|
8
|
+
|
|
9
|
+
`pi-actors` reads only `~/.pi/agent/actors-tools.json` as its registry source. When moving from `pi-auto-tools`, copy the previous registry explicitly:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cp ~/.pi/agent/auto-tools.json ~/.pi/agent/actors-tools.json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If a short-lived `~/.pi/agent/tools.json` file exists from the early `pi-actors` rename window, copy that file instead:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cp ~/.pi/agent/tools.json ~/.pi/agent/actors-tools.json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
No automatic rewrite is performed so operators can decide when to retire old config files.
|
|
22
|
+
|
|
7
23
|
## Registering Tools
|
|
8
24
|
|
|
9
25
|
`register_tool` is the interactive API for listing, creating, updating, or deleting persistent tools. Call it without arguments to list registered tools.
|
package/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* pi-actors — actor runtime and persistent local tool registry for pi.
|
|
3
3
|
* Zones: composition root, pi agent, actor runtime
|
|
4
4
|
*
|
|
5
|
-
* Wraps command templates as callable pi tools, stores their definitions in tools.json, and exposes actor orchestration across reloads and sessions.
|
|
5
|
+
* Wraps command templates as callable pi tools, stores their definitions in actors-tools.json, and exposes actor orchestration across reloads and sessions.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { existsSync, readdirSync, watch, type FSWatcher } from "node:fs";
|
package/lib/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Persistent tool registry config helpers
|
|
3
3
|
* Zones: registry config, persistence, migration boundary
|
|
4
|
-
* Owns tools.json loading, normalization, unsupported-shape rejection, and serialization
|
|
4
|
+
* Owns actors-tools.json loading, normalization, unsupported-shape rejection, and serialization
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { existsSync, readFileSync } from "node:fs";
|
package/lib/paths.ts
CHANGED
package/lib/prompts.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
export const REGISTER_TOOL_DESCRIPTION =
|
|
8
8
|
"Register a persistent custom tool from a command template, template recipe path, or co-located template recipe. " +
|
|
9
|
-
"Definitions are stored in tools.json across reloads. " +
|
|
9
|
+
"Definitions are stored in actors-tools.json across reloads. " +
|
|
10
10
|
"Use update=true to overwrite an existing tool, template=null/empty to delete.";
|
|
11
11
|
|
|
12
12
|
export const REGISTER_TOOL_PROMPT_SNIPPET =
|