@llblab/pi-actors 0.46.1 → 0.47.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.
Files changed (53) hide show
  1. package/AGENTS.md +7 -5
  2. package/BACKLOG.md +0 -582
  3. package/CHANGELOG.md +11 -0
  4. package/README.md +2 -1
  5. package/dist/lib/prompts.d.ts +6 -5
  6. package/dist/lib/prompts.js +22 -23
  7. package/dist/lib/recipes-discovery.d.ts +4 -0
  8. package/dist/lib/recipes-discovery.js +13 -1
  9. package/dist/lib/recipes-references.js +10 -6
  10. package/dist/lib/registry.d.ts +15 -11
  11. package/dist/lib/registry.js +195 -25
  12. package/dist/lib/runtime.js +37 -2
  13. package/dist/lib/tools-inspect.js +156 -12
  14. package/dist/lib/tools-register.js +2 -1
  15. package/dist/lib/tools-response.js +5 -1
  16. package/dist/scripts/conformance.mjs +1 -0
  17. package/dist/skills/actors/SKILL.md +76 -65
  18. package/dist/skills/actors/references/diagnostics.md +44 -0
  19. package/dist/skills/actors/references/persistent-tools.md +74 -0
  20. package/dist/skills/actors/references/recipes.md +51 -0
  21. package/dist/skills/actors/references/runs.md +39 -0
  22. package/dist/skills/artifacts/SKILL.md +24 -7
  23. package/dist/skills/media/SKILL.md +35 -7
  24. package/dist/skills/project-work/SKILL.md +28 -7
  25. package/dist/skills/recipe-memory/SKILL.md +27 -7
  26. package/dist/skills/swarm/SKILL.md +41 -445
  27. package/dist/skills/swarm/references/development-swarm.md +87 -539
  28. package/dist/skills/swarm/references/review-swarms.md +115 -0
  29. package/docs/README.md +5 -5
  30. package/docs/recipe-library.md +15 -10
  31. package/docs/tool-registry.md +10 -4
  32. package/lib/prompts.ts +24 -24
  33. package/lib/recipes-discovery.ts +22 -1
  34. package/lib/recipes-references.ts +14 -6
  35. package/lib/registry.ts +288 -51
  36. package/lib/runtime.ts +41 -2
  37. package/lib/tools-inspect.ts +202 -10
  38. package/lib/tools-register.ts +4 -3
  39. package/lib/tools-response.ts +5 -1
  40. package/package.json +1 -1
  41. package/scripts/conformance.mjs +1 -0
  42. package/skills/actors/SKILL.md +76 -65
  43. package/skills/actors/references/diagnostics.md +44 -0
  44. package/skills/actors/references/persistent-tools.md +74 -0
  45. package/skills/actors/references/recipes.md +51 -0
  46. package/skills/actors/references/runs.md +39 -0
  47. package/skills/artifacts/SKILL.md +24 -7
  48. package/skills/media/SKILL.md +35 -7
  49. package/skills/project-work/SKILL.md +28 -7
  50. package/skills/recipe-memory/SKILL.md +27 -7
  51. package/skills/swarm/SKILL.md +41 -445
  52. package/skills/swarm/references/development-swarm.md +87 -539
  53. package/skills/swarm/references/review-swarms.md +115 -0
package/AGENTS.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  ## Meta-Protocol Principles
4
4
 
5
- - `README.md`: human product entrypoint.
6
- - `AGENTS.md`: durable implementation protocol.
5
+ - `README.md` and `docs/`: human-facing product entrypoint, concepts, and reference.
6
+ - `skills/`: agent-facing operating protocols and Skill-local operational references.
7
+ - injected system prompt: routing-only meta-protocol that selects the owning Skill.
8
+ - `AGENTS.md`, source, and tests: implementation protocol and executable evidence.
7
9
  - `BACKLOG.md`: canonical future-only work.
8
10
  - `CHANGELOG.md`: completed delivery history.
9
- - `docs/README.md`: documentation index.
10
11
 
11
- Keep these surfaces distinct and reconcile them after meaningful changes. Every release section, historical or new, keeps at most 8 outcome records of at most 512 characters.
12
+ Do not make normal-use Skills depend on README/docs, do not copy Skill operating manuals into the system prompt, and do not present implementation evidence as the agent operating path. Keep these surfaces distinct and reconcile them after meaningful changes. Every release section, historical or new, keeps at most 8 outcome records of at most 512 characters.
12
13
 
13
14
  ## Concept
14
15
 
@@ -37,7 +38,8 @@ Pi host
37
38
  -> lib/inspector*.ts owner-filtered actor-instance inspection
38
39
  -> scripts/*.mjs process/service entrypoints
39
40
  -> skills/*/recipes/* Skill-owned Recipe components
40
- -> skills/* + docs/* agent and human guidance
41
+ -> skills/* agent operating protocols
42
+ -> README.md / docs/* human product guidance
41
43
  ```
42
44
 
43
45
  `index.ts` wires Pi ports and must not own domain behavior. Keep the local TypeScript import graph acyclic. For architecture-affecting work, load and follow `.agents/skills/domain-dag/SKILL.md`; its validator is local agent tooling, not an npm, CI, or release gate.
package/BACKLOG.md CHANGED
@@ -1,585 +1,3 @@
1
1
  # Project Backlog
2
2
 
3
- ## 0.46.1 — Registration Truth
4
-
5
- **Base:** `0.46.0` at `4abe9b26525a57883446b1d897e9e1ddf6cacde5`
6
- **Release type:** patch / contract repair
7
- **Primary evidence:** `tests/registration-truth.test.ts`, distilled from `PI_ACTORS_RECIPE_UX_SESSION_REPORT.md`
8
- **Release sentence:** every live pi-actors surface resolves user Recipes against the same session Skill context, registration validates the effective delegated contract before persistence, activation is truthfully observable, and unrelated invalid Skill components can no longer poison valid capability discovery.
9
-
10
- ## Mission
11
-
12
- Repair the runtime seams exposed by the first real `0.46.0` Skill-Recipe authoring session before redesigning agent guidance.
13
-
14
- The intended operation was:
15
-
16
- ```text
17
- maintained Skill Recipe
18
- media/player
19
- ↓ specialize
20
- persistent user tool
21
- music_player
22
- ↓ activate
23
- call in the same session
24
- ```
25
-
26
- The session instead observed:
27
-
28
- ```text
29
- spawn resolves media/player
30
- standalone QA resolves media/player
31
- register_tool cannot resolve media/player
32
- live registry rejects the wrapper
33
- one unrelated invalid Skill Recipe empties the catalog
34
- runtime-owned placeholders leak into the tool schema
35
- registry persistence is reported as registration success
36
- spawn is mistakenly used as proof of tool invocation
37
- ```
38
-
39
- `0.46.1` owns the mechanical truth required for `0.47.0` agent-native UX.
40
-
41
- Do **not** solve these failures with more prose, compatibility aliases, copied Recipe contracts, helper paths, shell wrappers, or new orchestration concepts.
42
-
43
- The target transaction is:
44
-
45
- ```text
46
- current session
47
- ↓
48
- one RecipeResolutionContext
49
- ↓
50
- resolve candidate
51
- ↓
52
- derive effective Recipe/tool contract
53
- ↓
54
- validate candidate
55
- ↓
56
- persist
57
- ↓
58
- registry admission
59
- ↓
60
- host registration + active-tool reconciliation
61
- ↓
62
- verify activation
63
- ↓
64
- return truthful state
65
- ```
66
-
67
- ---
68
-
69
- # 1. Retained Canon
70
-
71
- The `0.46.0` capability model remains authoritative:
72
-
73
- ```text
74
- Recipe --spawn--> Run
75
- Run = Recipe + Trace + Control
76
- ```
77
-
78
- Public Run verbs remain:
79
-
80
- ```text
81
- spawn
82
- message
83
- inspect
84
- ```
85
-
86
- Persistent capability mutation remains:
87
-
88
- ```text
89
- register_tool
90
- ```
91
-
92
- Run views remain:
93
-
94
- ```text
95
- recipe
96
- trace
97
- control
98
- ```
99
-
100
- Recipe references remain exactly:
101
-
102
- ```text
103
- <skill>/<recipe>
104
- explicit/path.json
105
- explicit/path.md
106
- ```
107
-
108
- Skill Recipe identity remains:
109
-
110
- ```text
111
- <active Skill identity>/<direct Recipe filename stem>
112
- ```
113
-
114
- Retain:
115
-
116
- - six bundled Skill-owned capability packs;
117
- - flat Skill `recipes/` directories;
118
- - no root packaged Recipe library;
119
- - no `std:` or `skill:` prefixes;
120
- - no top-level file-backed Recipe `name`;
121
- - session-scoped active Skill identity;
122
- - runtime-owned `{recipe_dir}` and `{skill_dir}`;
123
- - bounded Trace and Control;
124
- - owner/generation/process fencing;
125
- - automatic review transactions;
126
- - secure npm publication;
127
- - project-local Domain DAG Skill outside CI/release.
128
-
129
- ---
130
-
131
- # 2. Contract
132
-
133
- ## 2.1 One live resolution environment
134
-
135
- Every operation that decides whether a Recipe can be used in the live session must consume the same immutable session resolution environment.
136
-
137
- Conceptually:
138
-
139
- ```ts
140
- interface RecipeResolutionContext {
141
- session_id: string;
142
- cwd: string;
143
- active_skills: ActiveSkillRecipeContext;
144
- generation: string;
145
- }
146
- ```
147
-
148
- The exact internal type may be smaller, but there must be one explicit owner and one semantic contract.
149
-
150
- The following must not invent independent active-Skill contexts:
151
-
152
- ```text
153
- spawn
154
- register_tool candidate validation
155
- user Recipe registry admission
156
- user Recipe registry reload
157
- tool schema derivation
158
- inspect recipes
159
- inspect tool
160
- automatic review when resolving user wrappers
161
- live Recipe validation used by registration
162
- ```
163
-
164
- Standalone package QA may still construct an offline package context, but it must be labeled as offline/package QA and may not be represented as proof of live registry admission.
165
-
166
- ## 2.2 One user Recipe admission path
167
-
168
- A user Recipe under:
169
-
170
- ```text
171
- ~/.pi/agent/recipes/<name>.json
172
- ```
173
-
174
- is an active agent tool only if one authoritative admission function can:
175
-
176
- 1. parse the authored Recipe;
177
- 2. resolve its delegation/import graph with the live `RecipeResolutionContext`;
178
- 3. derive runtime-owned origins;
179
- 4. derive the effective argument/type/default contract;
180
- 5. classify async behavior;
181
- 6. validate Control/artifacts;
182
- 7. produce one `RegisteredTool` projection;
183
- 8. produce bounded diagnostics on failure.
184
-
185
- `register_tool`, startup/reload discovery, and live revalidation must use this same admission contract.
186
-
187
- Do not maintain one path that creates a `RegisteredTool` directly from `register_tool` input and another path that later interprets the persisted Recipe differently.
188
-
189
- ## 2.3 Registration is a state transition
190
-
191
- A successful registration response must distinguish at least:
192
-
193
- ```text
194
- resolved
195
- validated
196
- persisted
197
- registry_active
198
- host_registered
199
- active_tool
200
- callable_now
201
- ```
202
-
203
- These states may all become `true` in the healthy path, but they are not synonyms.
204
-
205
- Never return text that implies current-session invocation if the system cannot prove it.
206
-
207
- ## 2.4 Effective contract before mutation
208
-
209
- A Recipe-backed tool must be validated from the **resolved effective contract**, not the shallow wrapper shape.
210
-
211
- For:
212
-
213
- ```json
214
- {
215
- "description": "Play local music.",
216
- "defaults": {
217
- "source": "~/Music/1MIX"
218
- },
219
- "template": "media/player"
220
- }
221
- ```
222
-
223
- the effective tool contract inherits from `media/player`:
224
-
225
- ```text
226
- async
227
- args
228
- arg types
229
- defaults
230
- artifacts
231
- Control
232
- runtime-owned origins
233
- ```
234
-
235
- without copying those fields into the authored wrapper.
236
-
237
- The tool schema must contain only caller-owned inputs.
238
-
239
- ## 2.5 Partial catalog, exact resolver
240
-
241
- The active Skill component catalog is diagnostic/discovery state.
242
-
243
- It must never be required for exact resolution of an unrelated valid component.
244
-
245
- An invalid:
246
-
247
- ```text
248
- some-skill/bad-recipe
249
- ```
250
-
251
- must not make:
252
-
253
- ```text
254
- media/player
255
- ```
256
-
257
- unresolvable merely because a catalog listing failed.
258
-
259
- ---
260
-
261
- # 3. Runtime-Owned Inputs
262
-
263
- The following are runtime-owned and must never leak into caller-facing tool schemas merely because they occur in an effective Recipe template:
264
-
265
- ```text
266
- recipe_dir
267
- skill_dir
268
- state_dir
269
- trace_file
270
- run_instance_id
271
- owner/session identity
272
- runtime state root
273
- ```
274
-
275
- `run_id` remains an intentional caller-visible optional override for async tool invocation if the existing public contract retains it.
276
-
277
- The executor must inventory every runtime-injected placeholder and centralize ownership rather than maintaining ad hoc exclusion lists in unrelated schema code.
278
-
279
- Declared user args retain their actual types:
280
-
281
- ```text
282
- string
283
- path
284
- bool
285
- int
286
- number
287
- enum
288
- array
289
- ```
290
-
291
- A delegated Recipe may not degrade them all to strings.
292
-
293
- ---
294
-
295
- # 4. Activation Truth
296
-
297
- `pi-actors` must determine what the Pi host can actually guarantee after dynamic `registerTool`.
298
-
299
- Preferred contract:
300
-
301
- ```text
302
- register_tool returns callable_now=true
303
- → host definition exists
304
- → tool is in the current active tool set
305
- → the next model step in the same session can call it
306
- ```
307
-
308
- If the Pi host cannot guarantee that:
309
-
310
- ```text
311
- register_tool returns callable_now=false
312
- activation=<exact boundary>
313
- ```
314
-
315
- and all prompts/docs must say so.
316
-
317
- Do not infer model visibility from persistence or an extension-local map.
318
-
319
- The implementation must test the real Pi integration path, not only mocked registration callbacks.
320
-
321
- ---
322
-
323
- # 5. Registration Atomicity
324
-
325
- For a new registration:
326
-
327
- ```text
328
- candidate
329
- → resolve/validate without mutation
330
- → durable write
331
- → authoritative registry admission
332
- → host registration/activation
333
- → verification
334
- ```
335
-
336
- If failure occurs before persistence, no user Recipe file appears.
337
-
338
- If persistence succeeds but authoritative admission fails unexpectedly:
339
-
340
- - restore/delete the just-written candidate under the canonical mutation lock;
341
- - restore prior in-memory registry state;
342
- - report the exact failed phase;
343
- - do not leave an invalid file while returning generic success.
344
-
345
- For updates:
346
-
347
- - preserve the prior file bytes until replacement is known valid;
348
- - do not destroy a working tool because the replacement cannot resolve;
349
- - retain existing CAS/path/symlink/mutation safety.
350
-
351
- Host APIs that cannot unregister stale dynamic definitions must be explicitly accounted for. Validate as much as possible before host mutation.
352
-
353
- ---
354
-
355
- # 6. Registry and Component Observability
356
-
357
- Existing:
358
-
359
- ```text
360
- inspect target=recipes view=status
361
- inspect target=recipes view=summary
362
- inspect target=recipes view=doctor
363
- inspect target=tool:<name> view=status
364
- inspect target=tool:<name> view=schema
365
- ```
366
-
367
- remain the public surfaces.
368
-
369
- Do not add a new `recipe:` target in this patch.
370
-
371
- Recipe registry inspection must expose bounded current state such as:
372
-
373
- ```text
374
- registry_generation
375
- scanned_at
376
- resolution_generation
377
- watch_status
378
- user_recipe_count
379
- active_tool_count
380
- skill_component_count
381
- rejected_skill_component_count
382
- catalog_partial
383
- ```
384
-
385
- Rejected Skill components must be reported individually with:
386
-
387
- ```text
388
- skill
389
- stem if derivable
390
- portable file location
391
- reason
392
- ```
393
-
394
- Use portable paths such as:
395
-
396
- ```text
397
- ~/.pi/agent/skills/...
398
- <pi-actors>/skills/...
399
- ```
400
-
401
- rather than raw home-directory leakage.
402
-
403
- `inspect tool:<name> view=status` must expose activation state where it can be proven.
404
-
405
- ---
406
-
407
- # 7. Fail-Soft Skill Component Discovery
408
-
409
- Refactor active Skill component listing so it returns valid entries and failures together.
410
-
411
- Conceptually:
412
-
413
- ```ts
414
- interface SkillComponentInventory {
415
- components: ActiveSkillRecipeComponent[];
416
- rejected: SkillComponentDiagnostic[];
417
- partial: boolean;
418
- }
419
- ```
420
-
421
- Rules:
422
-
423
- - invalid top-level `Recipe.name` rejects that component;
424
- - nested Recipe files reject those files/that namespace as appropriate;
425
- - JSON/Markdown same-stem collision rejects that stem;
426
- - one duplicate active Skill identity may invalidate that Skill namespace;
427
- - unrelated Skill namespaces continue;
428
- - every rejection is bounded and diagnosable;
429
- - exact resolver remains independent and may resolve a valid exact component while catalog inventory is partial.
430
-
431
- Do not silently omit bad components.
432
-
433
- ---
434
-
435
- # 8. Launch-Kind Truth
436
-
437
- Keep existing usage distinctions:
438
-
439
- ```text
440
- tool
441
- spawn
442
- direct Recipe/foreground execution where applicable
443
- ```
444
-
445
- At minimum:
446
-
447
- - `spawn` result/details expose `launch_kind: "spawn"`;
448
- - registered tool invocation evidence exposes `launch_kind: "tool"`;
449
- - `inspect tool` usage summary distinguishes tool calls from Recipe spawn calls;
450
- - no product copy describes `spawn recipe=<user-wrapper>` as invoking the registered tool.
451
-
452
- Do not add a second generic invocation mechanism just for testing.
453
-
454
- ---
455
-
456
- # 9. Work Items
457
-
458
- ## RGT-12 — Publish `0.46.1`
459
-
460
- **Goal:** ship the prepared registration-truth release before agent UX redesign.
461
-
462
- **State:** gated on explicit release intent and repository `ADMIN` authority.
463
-
464
- **Remaining:**
465
-
466
- - Run the existing guarded GitHub release flow for prepared version `0.46.1`.
467
- - Verify npm package identity/provenance and GitHub Release convergence.
468
- - After successful publication, reset this backlog to:
469
-
470
- ```text
471
- # Project Backlog
472
-
473
3
  No open items.
474
- ```
475
-
476
- **Unblocker:** the operator explicitly authorizes the `0.46.1` release and confirms `ADMIN` permission for this repository.
477
-
478
- **Dependencies:** none.
479
-
480
- ---
481
-
482
- # 10. Dependency Graph
483
-
484
- ```text
485
- RGT-12
486
- ```
487
-
488
- Integration hotspots:
489
-
490
- ```text
491
- lib/extension-runtime.ts
492
- lib/recipes-references.ts
493
- lib/recipes-discovery.ts
494
- lib/runtime.ts
495
- lib/registry.ts
496
- lib/tools-register.ts
497
- lib/tools-local.ts
498
- lib/tools-inspect.ts
499
- lib/schema.ts
500
- lib/recipes-usage.ts
501
- ```
502
-
503
- Use one integration owner for resolution/admission semantics.
504
-
505
- ---
506
-
507
- # 11. Required Test Matrix
508
-
509
- | Boundary | Required evidence |
510
- | ---------------------- | ----------------------------------------------------------------- |
511
- | Live context | spawn/register/registry/inspect share exact session Skill context |
512
- | Session isolation | no context bleed across sessions/replacements |
513
- | Startup | Skill-dependent user tools reconcile after active Skills known |
514
- | Watcher | reload uses current context/generation, stale callback fenced |
515
- | Delegation | compact wrapper inherits effective Recipe contract |
516
- | Invalid wrapper | rejected before persistence with precise diagnostic |
517
- | Schema ownership | runtime-owned values absent |
518
- | Schema types | enum/bool/int/path/array retained |
519
- | Defaults | wrapper overrides validated against effective types |
520
- | Catalog | unrelated bad component yields partial inventory |
521
- | Exact resolution | valid component resolves despite unrelated rejection |
522
- | Registry observability | generation/time/watch/current counts available |
523
- | Registration | persisted/active/host/callable states separated |
524
- | Rollback | failed update preserves previous working tool |
525
- | Pi host | same-session injection proven or truthful limitation returned |
526
- | Launch kind | tool vs spawn explicit in result/usage |
527
- | Source/dist | same behavior in repository and packed install |
528
- | Security | path/CAS/redaction/generation/review safety retained |
529
-
530
- ---
531
-
532
- # 12. Explicitly Deferred to `0.47.0`
533
-
534
- Only the **agent interface/guidance layer** is deferred:
535
-
536
- ```text
537
- register_tool from=<skill>/<recipe>
538
- register_tool defaults={...}
539
- system prompt redesign as Skill-loading meta-protocol
540
- actors Skill redesign as root agent operating protocol
541
- capability Skill description/entrypoint redesign
542
- agent-facing delegation-vs-import decision guidance
543
- focused resolution explanation UX
544
- fresh-agent journey dogfood
545
- human-doc vs agent-Skill separation cleanup
546
- ```
547
-
548
- Do not defer any known runtime inconsistency from the report.
549
-
550
- ---
551
-
552
- # 13. Negative Scope
553
-
554
- Do not add:
555
-
556
- ```text
557
- new Run nouns
558
- new Run views
559
- new generic invocation tool
560
- new recipe target namespace
561
- task graph runtime
562
- actor chat
563
- rooms/peers/mailboxes
564
- remote Recipe registry
565
- compatibility std:/skill: aliases
566
- copied packaged Recipe wrappers
567
- shell fallbacks
568
- new capability-authoring Skill
569
- large system-prompt rewrite
570
- ```
571
-
572
- ---
573
-
574
- # 14. Stop Conditions
575
-
576
- Stop and preserve evidence if:
577
-
578
- - Pi cannot dynamically expose a newly registered tool in the same session and the product cannot observe the activation boundary;
579
- - one authoritative user Recipe admission path cannot serve registry and `register_tool`;
580
- - session-scoped Skill-dependent tools require global mutable state;
581
- - rollback would overwrite concurrent user edits;
582
- - schema ownership cannot distinguish runtime and caller values without changing Recipe semantics;
583
- - fixing a failure appears to require copying a Skill Recipe contract into the user wrapper.
584
-
585
- Resolve blockers at the owning boundary rather than hiding them with agent guidance.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.47.0: Agent-Native Actor UX
4
+
5
+ - `Skill-First Operation`: Replaced the injected product manual with a compact Skill-routing meta-protocol. `actors` is now the decision-first authority for generic Recipe/tool/Run mechanics, capability Skills own capability choice, and `swarm` owns only multi-actor methodology.
6
+ - `Persistent Capability Authoring`: Added explicit, mutually exclusive `register_tool from`, `template`, and `draft` modes; public caller `defaults`; canonical Skill/file resolution; compact direct delegation; inherited descriptions, async contracts, typed args, artifacts, Control, and runtime origins; and removal of public `values`.
7
+ - `Registration Truth UX`: Registration now reports logical source, effective required/optional args, persistence, registry/host/active-tool state, callability, activation boundary, and bounded next actions without raw config or executable template payloads. Failed activation retains rollback guarantees.
8
+ - `Focused Diagnosis`: Added `inspect target=recipes view=doctor identity=<skill>/<recipe>` with active ownership, exact resolvability, partial-catalog state, portable source, generation, rejection, and next actions. Tool status now includes source, effective args, activation boundary, and separate spawn/tool usage.
9
+ - `Capability Protocols`: Rewrote all six Skill descriptions as routing triggers and made Media, Artifacts, Project Work, and Recipe Memory compact agent operating guides. Human installation, product, catalog, development, and release guidance remains independently owned by README/docs.
10
+ - `Swarm Methodology`: Reduced Swarm to overhead admission, decomposition, disjoint ownership, lenses, quorum, conflict evidence, integration, and stop rules; moved deep review/development methods to Skill-local references and delegated all generic Run/Recipe mechanics to `actors`.
11
+ - `Safe Recovery`: Inactive, missing, duplicate, removed, malformed, rejected, partial-catalog, and inactive-tool failures now preserve logical identity, redact physical Skill paths, and teach bounded public diagnosis/retry actions without copied contracts, helper paths, shell evaluation, backgrounding, or spawn substitution.
12
+ - `Journey and Package Evidence`: Added deterministic Journeys A-G, reviewed fresh-agent Journey B evidence, and packed first-session parity for final Skills/prompt/references, `from` registration, source-equivalent schema, same-session activation, focused doctor, actual tool invocation, and unshipped `.agents/` evidence.
13
+
3
14
  ## 0.46.1: Registration Truth
4
15
 
5
16
  - `Live Resolution`: Spawn, registration, registry admission/reload, schema derivation, and Inspect now consume one immutable session Recipe context. Skill-dependent user wrappers reconcile only after Pi supplies active Skills, watcher reloads retain the current generation, and stale session consumers fail closed.
package/README.md CHANGED
@@ -74,6 +74,7 @@ inspect target=run:test view=trace source=lifecycle lines=40
74
74
  inspect target=run:test view=control
75
75
  inspect target=runtime view=status
76
76
  inspect target=recipes view=status
77
+ inspect target=recipes view=doctor identity=media/player
77
78
  inspect target=tool:my_tool view=status
78
79
  ```
79
80
 
@@ -81,7 +82,7 @@ A Run exposes exactly `recipe`, `trace`, and `control` views.
81
82
 
82
83
  ### `register_tool`
83
84
 
84
- Persist a trusted command template or Recipe-backed capability under `~/.pi/agent/recipes`. Registration remains separate from running Control. Treat it as callable in the current session only when the result reports `callable_now: true`; persistence, Recipe spawning, and registered-tool invocation are distinct states.
85
+ Persist a maintained Recipe with `register_tool name=<tool> from=<skill>/<recipe> defaults={...}`, or register a trusted command through the separate `template` mode. Definitions live under `~/.pi/agent/recipes`. Treat a tool as callable in the current session only when the result reports `callable_now: true`; persistence, Recipe spawning, and registered-tool invocation are distinct states.
85
86
 
86
87
  ## Recipe
87
88
 
@@ -4,20 +4,21 @@
4
4
  * Owns LLM-facing descriptions, prompt snippets, guidelines, and parameter descriptions
5
5
  */
6
6
  export declare const REGISTER_TOOL_DESCRIPTION: string;
7
- export declare const REGISTER_TOOL_PROMPT_SNIPPET = "Register persistent command templates as agent-callable tools";
7
+ export declare const REGISTER_TOOL_PROMPT_SNIPPET = "Register persistent Recipes or command templates as agent-callable tools";
8
8
  export declare const REGISTER_TOOL_GUIDELINES: string[];
9
- export declare const ONBOARDING_SYSTEM_PROMPT = "pi-actors quick model:\n- Local-first actor memory: persist trusted local capabilities instead of rebuilding shell recipes.\n- Layers: task -> command template -> recipe/tool -> spawn -> run:<id>; tool:<name> wraps registered capabilities.\n- Command templates stay sync and shell-free: string leaves split into executable + argv, infer .js/.mjs through node\u2192bun\u2192deno run and .sh through bash, and treat operators such as && as literal arguments; use template arrays for sequencing or an explicit trusted shell/script when shell semantics are required. Flags include args/defaults, parallel, concurrency, min_successful, when, timeout, delay, retry, failure, recover, repeat, accept_output, output.\n- Placeholders support typed/default args plus {value??fallback} and {flag?yes:no}.\n- ~/.pi/agent/recipes/*.json is actor muscle memory: valid admitted recipes are reconciled as tools across sessions; register_tool writes there and reports current activation truth.\n- Recipes own template directly and may declare metadata/defaults/imports/control/artifacts; files >1 MiB or import depth >32 fail closed.\n- Recipe imports are local variables; imported recipes are definitions, not nested async runs; parent async:true creates one run.\n- Actor-mode trigger: if work may outlive this turn, need steering/follow-up/artifacts, run as a service, fan out, or be resumed/inspected later, use spawn -> message -> inspect instead of ad hoc shell backgrounding.\n- Use spawn/message/inspect for actor-level start/send/observe; short foreground checks can stay ordinary tools/templates; avoid internal transport vocabulary in public guidance.\n- Run state lives under ~/.pi/agent/tmp/pi-actors/runs. Inspect intentionally and avoid busy-polling. Terminal and coordinator-bound notifications queue as Pi follow-ups so concurrently completed actors can reach the coordinator after current work instead of steering between tool calls. Terminal follow-up content stays minimal: run, status, one base path, and relative artifact names only; semantic output stays in non-LLM details and run state. When a deferred actor result gates the next step, wait for its terminal follow-up; do not schedule continuation loops, repeatedly inspect, or mutate its reviewed scope while it runs. Inspect early only for an operator request, a meaningful actor event, or diagnosis of an overdue/stuck run.\n- Maintain ~/.pi/agent/recipes like MEMORY.md for capabilities: keep useful tools, curate stale ones, and fix/remove/disable invalid recipes flagged by registry warnings; active-Skill and explicit file Recipes remain components outside user tool discovery; offer to save successful recurring patterns only after confirmation.\n- Prefer maintained active-Skill Recipes with spawn recipe=<skill>/<recipe> before ad hoc scripts/wrappers; explicit file Recipes use exact .json/.md paths; review swarms inherit current model/thinking, preflight before fanout, and expose quorum/concurrency/TTL knobs unless explicit args are passed.\n- For any non-trivial actor use or pi-actors change, read the bundled actors skill first. Before launching multiple actors/subagents for parallel implementation, independent artifact generation, delegated audit, or review, also read the bundled swarm skill; the coordinator owns decomposition, disjoint scopes, launch correctness, integration, and final validation. For deeper guidance, inspect installed extension sources/docs/recipes because README/docs are not automatically in context.";
9
+ export declare const ONBOARDING_SYSTEM_PROMPT = "pi-actors Skill routing:\n- Treat active bundled Skills as the operating authority.\n- For non-trivial pi-actors operation, diagnosis, or development, load and read the actors Skill before acting.\n- For work requiring multiple actors or subagents, additionally load and read the swarm Skill.\n- For capability-specific selection or constraints, load the owning capability Skill; actors owns generic mechanics and swarm owns multi-actor methodology.\n- Keep a Skill Recipe distinct from a registered tool and a Recipe spawn distinct from registered-tool invocation; actors owns the proof rules.\n- Treat persistence or registration as distinct from current callability; actors owns activation proof.\n- On failure or disagreement, preserve the logical Recipe identity, stop, and follow actors diagnosis; never bypass the owning Skills with copied contracts, helper paths, shell evaluation, or background-process workarounds.\n- If a capability Skill conflicts with actors about generic mechanics, follow actors and report the stale capability guidance.\n- README and docs are human-facing references, not the normal agent operating path.\n- AGENTS, source, and tests are implementation protocol and evidence; use them when changing or debugging the extension, not as substitutes for operating Skills.";
10
10
  export declare const REGISTER_TOOL_PARAM_DESCRIPTIONS: {
11
11
  readonly name: "Tool name in snake_case (e.g., 'transcribe')";
12
12
  readonly description: "Describe what the tool does for the LLM. Required unless deleting; omitted updates keep the old description.";
13
- readonly draft: "Promote a draft recipe path from ~/.pi/agent/recipes/drafts into an active named recipe under ~/.pi/agent/recipes. Requires name; use update=true to overwrite.";
13
+ readonly from: "Recipe to specialize by canonical <skill>/<recipe> identity or explicit .json/.md path. Inherits async, args/types, source defaults, artifacts, Control, and runtime origins.";
14
+ readonly defaults: "Optional caller-owned defaults. Keys and values must satisfy the effective source or command-template argument contract.";
15
+ readonly draft: "Promote a captured draft Recipe path from ~/.pi/agent/recipes/drafts. This is a source mode; do not combine it with from or template.";
14
16
  readonly async: "Set true for a co-located async template recipe. Omit for ordinary command templates or file-backed recipe references.";
15
- readonly template: "Command template with {arg} or {arg=default} placeholders, or a template recipe JSON path/name. With async, this is the co-located recipe body. Bare recipe names resolve under ~/.pi/agent/recipes. Omitted updates keep the old template. Empty string deletes the tool.";
17
+ readonly template: "Trusted command template with {arg} or {arg=default} placeholders. To specialize a Recipe, use from instead. Omitted updates keep the old template; empty string deletes the tool.";
16
18
  readonly templateArray: "Sequential command-template composition array. Leaves may be strings or objects with template/defaults/timeout/retry/failure/recover.";
17
19
  readonly templateNull: "Delete the tool when template is null.";
18
20
  readonly args: "Optional comma-separated placeholder declarations. Usually omit because args are derived from template placeholders. Interactive shorthand defaults are accepted and normalized. Example: file,lang,mode=fast";
19
21
  readonly update: "Set to true to overwrite an existing tool registration.";
20
- readonly values: "Optional default runtime placeholder values for a co-located template recipe.";
21
22
  };
22
23
  export declare function formatRegisteredToolPromptSnippet(template: unknown): string;
23
24
  export declare function formatRecipeToolPromptSnippet(recipe: string, asyncRecipe: boolean): string;