@llblab/pi-actors 0.35.0 → 0.36.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 +3 -1
- package/BACKLOG.md +4 -72
- package/CHANGELOG.md +11 -3
- package/README.md +2 -1
- package/dist/lib/command-templates.d.ts +2 -0
- package/dist/lib/command-templates.js +76 -0
- package/dist/lib/recipes-discovery.d.ts +2 -0
- package/dist/lib/recipes-discovery.js +52 -5
- package/dist/lib/runtime-notifier.js +8 -3
- package/dist/lib/tools-inspect.js +172 -4
- package/dist/lib/tools-response.js +13 -2
- package/dist/scripts/validate-recipe.mjs +164 -7
- package/dist/skills/actors/SKILL.md +28 -11
- package/dist/skills/swarm/SKILL.md +1 -1
- package/docs/recipe-library.md +2 -0
- package/docs/template-recipes.md +2 -0
- package/docs/tool-registry.md +15 -10
- package/lib/command-templates.ts +124 -0
- package/lib/recipes-discovery.ts +69 -6
- package/lib/runtime-notifier.ts +9 -3
- package/lib/tools-inspect.ts +186 -4
- package/lib/tools-response.ts +16 -2
- package/package.json +3 -2
- package/scripts/validate-recipe.mjs +164 -7
- package/skills/actors/SKILL.md +28 -11
- package/skills/swarm/SKILL.md +1 -1
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. 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.
|
|
5
|
+
version: 0.36.0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Actors (pi-actors)
|
|
@@ -194,12 +194,13 @@ Rules:
|
|
|
194
194
|
2. `async: true` makes spawned work a detached actor run.
|
|
195
195
|
3. Public knobs belong in `args`/`defaults`; hidden launch mechanics stay inside `template`.
|
|
196
196
|
4. Use `imports` to compose recipes; imported recipes are definitions, not nested async runs.
|
|
197
|
-
5.
|
|
198
|
-
6. Declare `
|
|
199
|
-
7.
|
|
200
|
-
8. File-backed
|
|
201
|
-
9.
|
|
202
|
-
10.
|
|
197
|
+
5. When exposing an already-authored recipe as a user tool, make a small wrapper recipe in `~/.pi/agent/recipes` that imports the source recipe and uses a `{ "name": "alias" }` node. Do not copy the ready recipe's script command, defaults, mailbox, or artifacts into a second template.
|
|
198
|
+
6. Declare `mailbox` for actors that accept or emit meaningful messages.
|
|
199
|
+
7. Declare `artifacts` for durable outputs the coordinator should inspect.
|
|
200
|
+
8. File-backed recipe identity comes from the filename basename; legacy top-level `name` fields are ignored by loaders.
|
|
201
|
+
9. File-backed async recipes pass child `pi -p` actors a bounded JSONL recipe context bundle by default: raw entry/import recipe records, derived `name`, import path/alias, and `"you_are_here": true` on the launching recipe node. Set `"actor_context": false` or `"off"` to suppress it for minimal prompts.
|
|
202
|
+
10. Keep packaged recipes generic: no machine-local paths, no private companion identities, no project-specific defaults unless the recipe is explicitly project-specific.
|
|
203
|
+
11. Do not ship concrete model-version defaults in packaged recipes; expose `model`, `models`, and stage-specific model args so the caller must choose current policy at launch.
|
|
203
204
|
|
|
204
205
|
Priority for same-id recipes:
|
|
205
206
|
|
|
@@ -227,16 +228,32 @@ Cleanup rule: periodically inspect `~/.pi/agent/recipes` as the live muscle-memo
|
|
|
227
228
|
|
|
228
229
|
`register_tool` persists trusted local capabilities as recipe files in `~/.pi/agent/recipes/*.json`; hand-authored Markdown recipes in the same directory are also discovered as tools.
|
|
229
230
|
|
|
230
|
-
Use it when a command/template/recipe should become durable agent muscle memory. Prefer typed args or placeholder-derived args; use `update=true` for replacement and `template=null` or `template=""` for deletion. `register_tool` should create/update/delete recipe files in the user recipe root; direct file editing is
|
|
231
|
+
Use it when a command/template/recipe should become durable agent muscle memory. Prefer typed args or placeholder-derived args; use `update=true` for replacement and `template=null` or `template=""` for deletion. `register_tool` should create/update/delete simple recipe files in the user recipe root; direct recipe-file editing is the right path when the wrapper needs `imports` or other top-level recipe metadata not exposed by the interactive mutation API.
|
|
232
|
+
|
|
233
|
+
Ready-recipe registration pattern:
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"description": "Run the ABCd context validator through its skill recipe.",
|
|
238
|
+
"imports": {
|
|
239
|
+
"validate_context": "{agent}/skills/abcd-context/recipes/validate-context.json"
|
|
240
|
+
},
|
|
241
|
+
"args": ["path:path=."],
|
|
242
|
+
"template": { "name": "validate_context" }
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Use this pattern whenever a reusable recipe already exists: packaged pi-actors components, project-local recipes, ad hoc reviewed recipe files, and especially skill-owned recipes that wrap skill scripts. The wrapper owns only the public tool name, description, optional narrowed args/defaults, and local usage metadata. The imported recipe remains the source of truth for the script path, default values, mailbox contract, artifacts, and future fixes.
|
|
231
247
|
|
|
232
248
|
Tool-registration lenses are open-ended prompts for deciding what deserves durable tool status:
|
|
233
249
|
|
|
234
250
|
1. **Reliability lens**: register wrappers for operations where agents commonly omit checks, run steps out of order, pass ambiguous inputs, or recover poorly from partial failure.
|
|
235
251
|
2. **Safety lens**: prefer read-only diagnostics, dry-runs, preflights, confirmations, or bounded adapters around high-impact operations before registering direct action tools.
|
|
236
252
|
3. **Context-affordance lens**: register tools whose mere presence in the injected capability list should steer agents toward the right operational habit.
|
|
237
|
-
4. **Existing-recipe lens**: scan already-authored recipes before inventing a new tool. Packaged recipes, ad hoc project recipes, and recipes co-located under skill directories are
|
|
238
|
-
5. **
|
|
239
|
-
6. **
|
|
253
|
+
4. **Existing-recipe lens**: scan already-authored recipes before inventing a new tool. Packaged recipes, ad hoc project recipes, and recipes co-located under skill directories are the first candidates to import from a user-root wrapper when they match a recurring local workflow.
|
|
254
|
+
5. **Skill-recipe lens**: when a skill ships a recipe for its script, local tools must import that recipe instead of calling the skill script directly. This preserves the skill's maintained interface and keeps future script/default changes centralized.
|
|
255
|
+
6. **Composition lens**: register small semantic entrypoints over reusable recipe components instead of baking one large scenario-specific shell command into a tool.
|
|
256
|
+
7. **Portability lens**: keep recipe files transportable; make tool exposure a consequence of placement in `~/.pi/agent/recipes`, not recipe-owned markers or machine-local assumptions.
|
|
240
257
|
|
|
241
258
|
Default bias: register diagnostic/preflight tools before action tools, and promote existing recipes before writing new orchestration. A good persistent tool shrinks the chance of a subtle operational mistake, not just the number of keystrokes.
|
|
242
259
|
|
package/skills/swarm/SKILL.md
CHANGED