@llblab/pi-actors 0.45.1 → 0.46.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 (212) hide show
  1. package/AGENTS.md +9 -7
  2. package/CHANGELOG.md +8 -1
  3. package/README.md +26 -12
  4. package/dist/fixtures/protocol/recipe-summary.json +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/lib/async-runs.d.ts +4 -1
  7. package/dist/lib/async-runs.js +22 -23
  8. package/dist/lib/automatic-review-runtime.d.ts +2 -0
  9. package/dist/lib/automatic-review-runtime.js +12 -5
  10. package/dist/lib/draft-sleep.js +0 -1
  11. package/dist/lib/extension-runtime.d.ts +1 -1
  12. package/dist/lib/extension-runtime.js +8 -2
  13. package/dist/lib/inspector.js +45 -7
  14. package/dist/lib/paths.d.ts +0 -1
  15. package/dist/lib/paths.js +0 -7
  16. package/dist/lib/prompts.d.ts +1 -1
  17. package/dist/lib/prompts.js +2 -2
  18. package/dist/lib/recipes-context.js +2 -2
  19. package/dist/lib/recipes-references.d.ts +24 -9
  20. package/dist/lib/recipes-references.js +152 -126
  21. package/dist/lib/runtime.d.ts +0 -1
  22. package/dist/lib/runtime.js +1 -3
  23. package/dist/lib/tools-inspect.d.ts +0 -1
  24. package/dist/lib/tools-inspect.js +35 -8
  25. package/dist/lib/tools-local.d.ts +2 -0
  26. package/dist/lib/tools-local.js +1 -1
  27. package/dist/lib/tools-spawn.d.ts +2 -0
  28. package/dist/lib/tools-spawn.js +24 -52
  29. package/dist/scripts/build-dist.mjs +13 -4
  30. package/dist/skills/actors/SKILL.md +6 -6
  31. package/dist/skills/actors/recipes/recipe-validate.json +11 -0
  32. package/{recipes/utility-coordinator-lock-snapshot.json → dist/skills/actors/recipes/resource-locker-snapshot.json} +1 -3
  33. package/dist/{recipes → skills/actors/recipes}/resource-locker.json +1 -3
  34. package/dist/{recipes/utility-run-ops-snapshot.json → skills/actors/recipes/run-ops-snapshot.json} +1 -3
  35. package/dist/skills/actors/recipes/run-summary.json +9 -0
  36. package/dist/{scripts/locker.mjs → skills/actors/scripts/resource-locker.mjs} +2 -2
  37. package/dist/skills/actors/scripts/run-utils.mjs +164 -0
  38. package/{scripts → dist/skills/actors/scripts}/validate-recipe.mjs +134 -17
  39. package/dist/skills/artifacts/SKILL.md +16 -0
  40. package/{recipes/pipeline-artifact-bundle.json → dist/skills/artifacts/recipes/bundle.json} +4 -4
  41. package/dist/{recipes/utility-artifact-write.json → skills/artifacts/recipes/file-write.json} +1 -3
  42. package/dist/{recipes/utility-artifact-manifest.json → skills/artifacts/recipes/manifest.json} +1 -3
  43. package/{recipes/pipeline-artifact-report.json → dist/skills/artifacts/recipes/report.json} +2 -2
  44. package/dist/{recipes/pipeline-artifact-write.json → skills/artifacts/recipes/write.json} +3 -3
  45. package/dist/skills/artifacts/scripts/artifact-utils.mjs +63 -0
  46. package/dist/skills/media/SKILL.md +16 -0
  47. package/dist/{recipes/pipeline-media-library.json → skills/media/recipes/library.json} +2 -2
  48. package/{recipes/music-player.json → dist/skills/media/recipes/player.json} +1 -3
  49. package/dist/{recipes/utility-playlist-build.json → skills/media/recipes/playlist-build.json} +1 -3
  50. package/dist/skills/media/scripts/media-utils.mjs +47 -0
  51. package/dist/{scripts → skills/media/scripts}/music-player.mjs +9 -3
  52. package/dist/skills/project-work/SKILL.md +16 -0
  53. package/dist/skills/project-work/recipes/changelog-section.json +11 -0
  54. package/{recipes/pipeline-docs-maintenance.json → dist/skills/project-work/recipes/docs-maintenance.json} +4 -4
  55. package/dist/skills/project-work/recipes/package-summary.json +9 -0
  56. package/{recipes/pipeline-release-readiness.json → dist/skills/project-work/recipes/release-readiness.json} +6 -6
  57. package/dist/{recipes/pipeline-release-summary.json → skills/project-work/recipes/release-summary.json} +5 -5
  58. package/{recipes/pipeline-repo-health.json → dist/skills/project-work/recipes/repo-health.json} +6 -6
  59. package/{recipes/pipeline-async-run-ops.json → dist/skills/project-work/recipes/run-ops.json} +3 -3
  60. package/dist/skills/project-work/recipes/skill-summary.json +11 -0
  61. package/dist/skills/project-work/scripts/project-utils.mjs +89 -0
  62. package/dist/skills/recipe-memory/SKILL.md +16 -0
  63. package/dist/skills/swarm/SKILL.md +4 -4
  64. package/{recipes/pipeline-architect-coordinator.json → dist/skills/swarm/recipes/architect.json} +5 -5
  65. package/{recipes/pipeline-checkpoint-continuation.json → dist/skills/swarm/recipes/checkpoint-continuation.json} +3 -3
  66. package/dist/{recipes/pipeline-development-tasking.json → skills/swarm/recipes/development-tasking.json} +4 -4
  67. package/dist/{recipes/lens-swarm.json → skills/swarm/recipes/lens-review.json} +1 -1
  68. package/dist/{recipes/pipeline-quorum-review.json → skills/swarm/recipes/quorum-review.json} +4 -4
  69. package/{recipes/pipeline-research-synthesis.json → dist/skills/swarm/recipes/research-synthesis.json} +6 -6
  70. package/{recipes/pipeline-review-readiness.json → dist/skills/swarm/recipes/review-readiness.json} +1 -1
  71. package/{recipes/subagents-prompts.json → dist/skills/swarm/recipes/subagent-prompts.json} +1 -1
  72. package/{recipes → dist/skills/swarm/recipes}/subagent-quorum.json +1 -1
  73. package/dist/{recipes → skills/swarm/recipes}/subagent-review-coordinator.json +6 -6
  74. package/docs/actor-inspector.md +4 -3
  75. package/docs/async-runs.md +2 -2
  76. package/docs/recipe-library.md +23 -23
  77. package/docs/releasing.md +2 -2
  78. package/docs/template-recipes.md +30 -14
  79. package/docs/tool-registry.md +2 -2
  80. package/fixtures/protocol/recipe-summary.json +1 -1
  81. package/index.ts +2 -1
  82. package/lib/async-runs.ts +47 -24
  83. package/lib/automatic-review-runtime.ts +16 -3
  84. package/lib/draft-sleep.ts +0 -1
  85. package/lib/extension-runtime.ts +21 -2
  86. package/lib/inspector.ts +56 -11
  87. package/lib/paths.ts +0 -7
  88. package/lib/prompts.ts +2 -2
  89. package/lib/recipes-context.ts +2 -2
  90. package/lib/recipes-references.ts +223 -134
  91. package/lib/runtime.ts +1 -5
  92. package/lib/tools-inspect.ts +42 -9
  93. package/lib/tools-local.ts +2 -0
  94. package/lib/tools-spawn.ts +37 -74
  95. package/package.json +2 -4
  96. package/scripts/build-dist.mjs +13 -4
  97. package/skills/actors/SKILL.md +6 -6
  98. package/skills/actors/recipes/recipe-validate.json +11 -0
  99. package/{dist/recipes/utility-coordinator-lock-snapshot.json → skills/actors/recipes/resource-locker-snapshot.json} +1 -3
  100. package/{recipes → skills/actors/recipes}/resource-locker.json +1 -3
  101. package/{recipes/utility-run-ops-snapshot.json → skills/actors/recipes/run-ops-snapshot.json} +1 -3
  102. package/skills/actors/recipes/run-summary.json +9 -0
  103. package/{scripts/locker.mjs → skills/actors/scripts/resource-locker.mjs} +2 -2
  104. package/skills/actors/scripts/run-utils.mjs +164 -0
  105. package/{dist → skills/actors}/scripts/validate-recipe.mjs +134 -17
  106. package/skills/artifacts/SKILL.md +16 -0
  107. package/{dist/recipes/pipeline-artifact-bundle.json → skills/artifacts/recipes/bundle.json} +4 -4
  108. package/{recipes/utility-artifact-write.json → skills/artifacts/recipes/file-write.json} +1 -3
  109. package/{recipes/utility-artifact-manifest.json → skills/artifacts/recipes/manifest.json} +1 -3
  110. package/{dist/recipes/pipeline-artifact-report.json → skills/artifacts/recipes/report.json} +2 -2
  111. package/{recipes/pipeline-artifact-write.json → skills/artifacts/recipes/write.json} +3 -3
  112. package/skills/artifacts/scripts/artifact-utils.mjs +63 -0
  113. package/skills/media/SKILL.md +16 -0
  114. package/{recipes/pipeline-media-library.json → skills/media/recipes/library.json} +2 -2
  115. package/{dist/recipes/music-player.json → skills/media/recipes/player.json} +1 -3
  116. package/{recipes/utility-playlist-build.json → skills/media/recipes/playlist-build.json} +1 -3
  117. package/skills/media/scripts/media-utils.mjs +47 -0
  118. package/{scripts → skills/media/scripts}/music-player.mjs +9 -3
  119. package/skills/project-work/SKILL.md +16 -0
  120. package/skills/project-work/recipes/changelog-section.json +11 -0
  121. package/{dist/recipes/pipeline-docs-maintenance.json → skills/project-work/recipes/docs-maintenance.json} +4 -4
  122. package/skills/project-work/recipes/package-summary.json +9 -0
  123. package/{dist/recipes/pipeline-release-readiness.json → skills/project-work/recipes/release-readiness.json} +6 -6
  124. package/{recipes/pipeline-release-summary.json → skills/project-work/recipes/release-summary.json} +5 -5
  125. package/{dist/recipes/pipeline-repo-health.json → skills/project-work/recipes/repo-health.json} +6 -6
  126. package/{dist/recipes/pipeline-async-run-ops.json → skills/project-work/recipes/run-ops.json} +3 -3
  127. package/skills/project-work/recipes/skill-summary.json +11 -0
  128. package/skills/project-work/scripts/project-utils.mjs +89 -0
  129. package/skills/recipe-memory/SKILL.md +16 -0
  130. package/skills/swarm/SKILL.md +4 -4
  131. package/{dist/recipes/pipeline-architect-coordinator.json → skills/swarm/recipes/architect.json} +5 -5
  132. package/{dist/recipes/pipeline-checkpoint-continuation.json → skills/swarm/recipes/checkpoint-continuation.json} +3 -3
  133. package/{recipes/pipeline-development-tasking.json → skills/swarm/recipes/development-tasking.json} +4 -4
  134. package/{recipes/lens-swarm.json → skills/swarm/recipes/lens-review.json} +1 -1
  135. package/{recipes/pipeline-quorum-review.json → skills/swarm/recipes/quorum-review.json} +4 -4
  136. package/{dist/recipes/pipeline-research-synthesis.json → skills/swarm/recipes/research-synthesis.json} +6 -6
  137. package/{dist/recipes/pipeline-review-readiness.json → skills/swarm/recipes/review-readiness.json} +1 -1
  138. package/{dist/recipes/subagents-prompts.json → skills/swarm/recipes/subagent-prompts.json} +1 -1
  139. package/{dist → skills/swarm}/recipes/subagent-quorum.json +1 -1
  140. package/{recipes → skills/swarm/recipes}/subagent-review-coordinator.json +6 -6
  141. package/dist/recipes/utility-changelog-section.json +0 -13
  142. package/dist/recipes/utility-package-summary.json +0 -11
  143. package/dist/recipes/utility-run-summary.json +0 -11
  144. package/dist/recipes/utility-skill-summary.json +0 -13
  145. package/dist/recipes/utility-validate-recipe.json +0 -13
  146. package/dist/scripts/executable-block-style.d.mts +0 -1
  147. package/dist/scripts/executable-block-style.mjs +0 -73
  148. package/dist/scripts/recipe-utils.mjs +0 -404
  149. package/dist/scripts/release-gates.mjs +0 -281
  150. package/recipes/utility-changelog-section.json +0 -13
  151. package/recipes/utility-package-summary.json +0 -11
  152. package/recipes/utility-run-summary.json +0 -11
  153. package/recipes/utility-skill-summary.json +0 -13
  154. package/recipes/utility-validate-recipe.json +0 -13
  155. package/scripts/executable-block-style.d.mts +0 -1
  156. package/scripts/executable-block-style.mjs +0 -73
  157. package/scripts/recipe-utils.mjs +0 -404
  158. package/scripts/release-gates.mjs +0 -281
  159. /package/dist/{recipes/utility-validation-wrapper.json → skills/actors/recipes/command-validate.json} +0 -0
  160. /package/dist/{recipes/utility-jsonl-tail.json → skills/actors/recipes/jsonl-tail.json} +0 -0
  161. /package/dist/{recipes/utility-run-state-files.json → skills/actors/recipes/run-state-files.json} +0 -0
  162. /package/dist/{recipes/utility-playlist-scan.json → skills/media/recipes/playlist-scan.json} +0 -0
  163. /package/dist/{recipes/utility-changelog-head.json → skills/project-work/recipes/changelog-head.json} +0 -0
  164. /package/dist/{recipes/utility-git-log.json → skills/project-work/recipes/git-log.json} +0 -0
  165. /package/dist/{recipes/utility-git-status.json → skills/project-work/recipes/git-status.json} +0 -0
  166. /package/dist/{recipes/utility-markdown-index.json → skills/project-work/recipes/markdown-index.json} +0 -0
  167. /package/dist/{recipes → skills/recipe-memory/recipes}/draft-review.json +0 -0
  168. /package/dist/{recipes → skills/recipe-memory/recipes}/tool-review.json +0 -0
  169. /package/dist/{recipes → skills/swarm/recipes}/subagent-artifact.json +0 -0
  170. /package/dist/{recipes → skills/swarm/recipes}/subagent-checkpoint.json +0 -0
  171. /package/dist/{recipes → skills/swarm/recipes}/subagent-conflict-report.json +0 -0
  172. /package/dist/{recipes → skills/swarm/recipes}/subagent-contradiction-map.json +0 -0
  173. /package/dist/{recipes → skills/swarm/recipes}/subagent-critic.json +0 -0
  174. /package/dist/{recipes → skills/swarm/recipes}/subagent-evidence-map.json +0 -0
  175. /package/dist/{recipes → skills/swarm/recipes}/subagent-followup.json +0 -0
  176. /package/dist/{recipes → skills/swarm/recipes}/subagent-judge.json +0 -0
  177. /package/dist/{recipes → skills/swarm/recipes}/subagent-merge.json +0 -0
  178. /package/dist/{recipes → skills/swarm/recipes}/subagent-normalize.json +0 -0
  179. /package/dist/{recipes → skills/swarm/recipes}/subagent-plan.json +0 -0
  180. /package/dist/{recipes → skills/swarm/recipes}/subagent-preflight.json +0 -0
  181. /package/dist/{recipes → skills/swarm/recipes}/subagent-prompt.json +0 -0
  182. /package/dist/{recipes → skills/swarm/recipes}/subagent-review.json +0 -0
  183. /package/dist/{recipes → skills/swarm/recipes}/subagent-task-card.json +0 -0
  184. /package/dist/{recipes → skills/swarm/recipes}/subagent-tools.json +0 -0
  185. /package/dist/{recipes → skills/swarm/recipes}/subagent-verify.json +0 -0
  186. /package/{recipes/utility-validation-wrapper.json → skills/actors/recipes/command-validate.json} +0 -0
  187. /package/{recipes/utility-jsonl-tail.json → skills/actors/recipes/jsonl-tail.json} +0 -0
  188. /package/{recipes/utility-run-state-files.json → skills/actors/recipes/run-state-files.json} +0 -0
  189. /package/{recipes/utility-playlist-scan.json → skills/media/recipes/playlist-scan.json} +0 -0
  190. /package/{recipes/utility-changelog-head.json → skills/project-work/recipes/changelog-head.json} +0 -0
  191. /package/{recipes/utility-git-log.json → skills/project-work/recipes/git-log.json} +0 -0
  192. /package/{recipes/utility-git-status.json → skills/project-work/recipes/git-status.json} +0 -0
  193. /package/{recipes/utility-markdown-index.json → skills/project-work/recipes/markdown-index.json} +0 -0
  194. /package/{recipes → skills/recipe-memory/recipes}/draft-review.json +0 -0
  195. /package/{recipes → skills/recipe-memory/recipes}/tool-review.json +0 -0
  196. /package/{recipes → skills/swarm/recipes}/subagent-artifact.json +0 -0
  197. /package/{recipes → skills/swarm/recipes}/subagent-checkpoint.json +0 -0
  198. /package/{recipes → skills/swarm/recipes}/subagent-conflict-report.json +0 -0
  199. /package/{recipes → skills/swarm/recipes}/subagent-contradiction-map.json +0 -0
  200. /package/{recipes → skills/swarm/recipes}/subagent-critic.json +0 -0
  201. /package/{recipes → skills/swarm/recipes}/subagent-evidence-map.json +0 -0
  202. /package/{recipes → skills/swarm/recipes}/subagent-followup.json +0 -0
  203. /package/{recipes → skills/swarm/recipes}/subagent-judge.json +0 -0
  204. /package/{recipes → skills/swarm/recipes}/subagent-merge.json +0 -0
  205. /package/{recipes → skills/swarm/recipes}/subagent-normalize.json +0 -0
  206. /package/{recipes → skills/swarm/recipes}/subagent-plan.json +0 -0
  207. /package/{recipes → skills/swarm/recipes}/subagent-preflight.json +0 -0
  208. /package/{recipes → skills/swarm/recipes}/subagent-prompt.json +0 -0
  209. /package/{recipes → skills/swarm/recipes}/subagent-review.json +0 -0
  210. /package/{recipes → skills/swarm/recipes}/subagent-task-card.json +0 -0
  211. /package/{recipes → skills/swarm/recipes}/subagent-tools.json +0 -0
  212. /package/{recipes → skills/swarm/recipes}/subagent-verify.json +0 -0
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "async": true,
3
3
  "imports": {
4
- "subagent": "subagent-prompt.json",
5
- "merger": "subagent-merge.json",
6
- "judge": "subagent-judge.json",
7
- "normalizer": "subagent-normalize.json"
4
+ "subagent": "swarm/subagent-prompt",
5
+ "merger": "swarm/subagent-merge",
6
+ "judge": "swarm/subagent-judge",
7
+ "normalizer": "swarm/subagent-normalize"
8
8
  },
9
9
  "args": [
10
10
  "prompt:string",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "async": true,
3
3
  "imports": {
4
- "planner": "subagent-plan.json",
5
- "evidence": "subagent-evidence-map.json",
6
- "contradictions": "subagent-contradiction-map.json",
7
- "verifier": "subagent-verify.json",
8
- "merger": "subagent-merge.json",
9
- "normalizer": "subagent-normalize.json"
4
+ "planner": "swarm/subagent-plan",
5
+ "evidence": "swarm/subagent-evidence-map",
6
+ "contradictions": "swarm/subagent-contradiction-map",
7
+ "verifier": "swarm/subagent-verify",
8
+ "merger": "swarm/subagent-merge",
9
+ "normalizer": "swarm/subagent-normalize"
10
10
  },
11
11
  "args": [
12
12
  "question:string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "async": true,
3
3
  "imports": {
4
- "coordinator": "subagent-review-coordinator.json"
4
+ "coordinator": "swarm/subagent-review-coordinator"
5
5
  },
6
6
  "args": [
7
7
  "scope:string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "async": true,
3
3
  "imports": {
4
- "subagent": "subagent-prompt.json"
4
+ "subagent": "swarm/subagent-prompt"
5
5
  },
6
6
  "args": [
7
7
  "prompts:array",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "async": true,
3
3
  "imports": {
4
- "subagent": "subagent-prompt.json"
4
+ "subagent": "swarm/subagent-prompt"
5
5
  },
6
6
  "args": [
7
7
  "prompt:string",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "async": true,
3
3
  "imports": {
4
- "preflight": "subagent-preflight.json",
5
- "reviewer": "subagent-review.json",
6
- "verifier": "subagent-verify.json",
7
- "merger": "subagent-merge.json",
8
- "judge": "subagent-judge.json",
9
- "normalizer": "subagent-normalize.json"
4
+ "preflight": "swarm/subagent-preflight",
5
+ "reviewer": "swarm/subagent-review",
6
+ "verifier": "swarm/subagent-verify",
7
+ "merger": "swarm/subagent-merge",
8
+ "judge": "swarm/subagent-judge",
9
+ "normalizer": "swarm/subagent-normalize"
10
10
  },
11
11
  "args": [
12
12
  "scope:string",
@@ -12,13 +12,14 @@ The Inspector follows the kernel directly. It shows Runs owned by the current Pi
12
12
 
13
13
  Shows captured execution provenance:
14
14
 
15
- - Recipe name and source path;
15
+ - file-derived Recipe stem and logical reference;
16
+ - source kind (`user_registry_capability`, `active_skill_component`, or `explicit_file_recipe`) and Skill identity when owned;
16
17
  - resolved template and values;
17
- - imports/context records;
18
+ - root/import roles plus alias ancestry;
18
19
  - declared artifacts and actor-local actions;
19
20
  - model/thinking policy and launch source.
20
21
 
21
- Captured Recipe evidence belongs to the Run generation and does not change when an active Recipe file later changes. Non-empty object values render as indented brace-delimited property lists rather than flattened inline strings.
22
+ Captured Recipe evidence belongs to the Run generation and does not change when an active Recipe file later changes. Skill components display logical identities such as `artifacts/report`; private physical `source_file`, `skill_dir`, and `recipe_dir` stay out of Inspector and model-facing views. Non-empty object values render as indented brace-delimited property lists rather than flattened inline strings.
22
23
 
23
24
  ## Trace
24
25
 
@@ -123,8 +123,8 @@ Archive and prune apply only to terminal Runs and enforce path containment. Rete
123
123
 
124
124
  Packaged controlled services demonstrate the endpoint protocol:
125
125
 
126
- - `music-player` consumes playback Controls and emits playback Trace;
127
- - `resource-locker` consumes queue/lease actions, emits lock Trace, and atomically retains at most 512 valid journal records within 1 MiB.
126
+ - `media/player` consumes playback Controls and emits playback Trace;
127
+ - `actors/resource-locker` consumes queue/lease actions, emits lock Trace, and atomically retains at most 512 valid journal records within 1 MiB.
128
128
 
129
129
  Shared archive/prune evidence similarly retains at most 256 valid records within 1 MiB under its canonical lock. The obsolete advisory `wake.jsonl` notifier was removed; filesystem watchers and bounded reconciliation observe authoritative state directly.
130
130
 
@@ -1,43 +1,43 @@
1
- # Packaged Recipe Library
1
+ # Skill-Owned Recipe Components
2
2
 
3
- Packaged Recipes provide maintained execution graphs and service definitions. User Recipes with the same name shadow packaged definitions; invalid shadowing fails closed.
3
+ Active Skills provide maintained execution graphs and service definitions. Skill Recipe identity is `<active Skill name>/<Recipe filename stem>`. Recipe files have no top-level `name`; `SKILL.md` `name` remains Pi host metadata matching the Skill directory, and pi-actors introduces no additional Skill identity field. Skill components are outside user Recipe discovery and never become tools merely because a Skill is active.
4
4
 
5
5
  ## Recommended Entry Points
6
6
 
7
7
  ### Repository and delivery
8
8
 
9
- - `pipeline-repo-health.json` — repository inspection and bounded health artifact.
10
- - `pipeline-docs-maintenance.json` — documentation analysis and artifact preparation.
11
- - `pipeline-release-readiness.json` — release checks and readiness artifact.
12
- - `pipeline-release-summary.json` — release-summary artifact.
13
- - `pipeline-development-tasking.json` — task-card and implementation planning pipeline.
9
+ - `project-work/repo-health` — repository inspection and bounded health artifact.
10
+ - `project-work/docs-maintenance` — documentation analysis and artifact preparation.
11
+ - `project-work/release-readiness` — release checks and readiness artifact.
12
+ - `project-work/release-summary` — release-summary artifact.
13
+ - `swarm/development-tasking` — task-card and implementation planning pipeline.
14
14
 
15
15
  ### Review and synthesis
16
16
 
17
- - `pipeline-quorum-review.json` — parallel reviewers with quorum-oriented synthesis.
18
- - `pipeline-review-readiness.json` — review plus readiness stages.
19
- - `pipeline-research-synthesis.json` — evidence-oriented research synthesis.
20
- - `lens-swarm.json` — configurable repeated review lenses.
21
- - `subagent-review-coordinator.json` — lower-level review/verify/merge/judge composition.
17
+ - `swarm/quorum-review` — parallel reviewers with quorum-oriented synthesis.
18
+ - `swarm/review-readiness` — review plus readiness stages.
19
+ - `swarm/research-synthesis` — evidence-oriented research synthesis.
20
+ - `swarm/lens-review` — configurable repeated review lenses.
21
+ - `swarm/subagent-review-coordinator` — lower-level review/verify/merge/judge composition.
22
22
 
23
23
  Callers should own model, thinking, concurrency, quorum, and mission policy. Review pipelines preflight provider/model availability before expensive fanout.
24
24
 
25
25
  ### Artifacts
26
26
 
27
- - `pipeline-artifact-report.json` — prepare one artifact body.
28
- - `pipeline-artifact-write.json` — prepare and deterministically write an artifact.
29
- - `pipeline-artifact-bundle.json` — optional validation, artifact write, manifest generation, and manifest write.
30
- - `utility-artifact-write.json` — deterministic create/overwrite/append helper.
31
- - `utility-artifact-manifest.json` — artifact manifest generation.
27
+ - `artifacts/report` — prepare one artifact body.
28
+ - `artifacts/write` — prepare and deterministically write an artifact.
29
+ - `artifacts/bundle` — optional validation, artifact write, manifest generation, and manifest write.
30
+ - `artifacts/file-write` — deterministic create/overwrite/append helper.
31
+ - `artifacts/manifest` — artifact manifest generation.
32
32
 
33
33
  Artifact pipelines terminate in files/manifests and result evidence; they do not fabricate communication events.
34
34
 
35
35
  ### Controlled services
36
36
 
37
- - `music-player.json` — playback service with declared playback actions, `controls.jsonl`, generation-fenced endpoint readiness, state artifact, and playback Trace. Player selection is `player:enum(auto,mpv,afplay,ffplay,cvlc,play,wmp)=auto`.
38
- - `resource-locker.json` — optional queue/lease-lock service with explicit owner/resource input, lock Trace, and a 512-record/1 MiB atomically retained journal.
37
+ - `media/player` — playback service with declared playback actions, `controls.jsonl`, generation-fenced endpoint readiness, state artifact, and playback Trace. Player selection is `player:enum(auto,mpv,afplay,ffplay,cvlc,play,wmp)=auto`.
38
+ - `actors/resource-locker` — optional queue/lease-lock service with explicit owner/resource input, lock Trace, and a 512-record/1 MiB atomically retained journal.
39
39
 
40
- These are the packaged Recipes that declare actor-local Control. Ordinary one-shot Recipes omit it. Helper-backed packaged Recipes self-locate their installed package root when `repo` is omitted; an explicit caller value still wins for development or custom layouts.
40
+ These Recipes declare actor-local Control. Ordinary one-shot Recipes omit it. Helper-backed Skill Recipes self-locate through runtime-owned `{skill_dir}`; callers do not pass package installation roots.
41
41
 
42
42
  ## Component Recipes
43
43
 
@@ -45,7 +45,7 @@ Subagent components provide reusable command-template cells for normalization, p
45
45
 
46
46
  Imports compose these definitions inside one parent Run. They are not independently addressable peers. Parent template flags control sequencing, parallelism, retries, failure scope, recovery, and repeated execution.
47
47
 
48
- Packaged components can be selected exactly as `std:<recipe-name>`. Recipes bundled under a Pi-active Skill are selected as `skill:<skill-name>/<recipe-path>` and receive runtime-owned `{skill_dir}` plus `{recipe_dir}`. Active Skill components are namespaced library entries, never automatic tools; expose one intentionally through a user Recipe wrapper when a direct tool is desired.
48
+ Recipes bundled under a Pi-active Skill are selected as `<skill-name>/<recipe-stem>` and receive runtime-owned `{skill_dir}` plus `{recipe_dir}`. Explicit `.json` / `.md` paths select exact files: entry paths are based at invocation `cwd`, while relative imports are based at the importing Recipe's directory. Active Skill components are library entries, never automatic tools; expose one intentionally through a user Recipe wrapper when a direct tool is desired.
49
49
 
50
50
  ## Utility Recipes
51
51
 
@@ -70,7 +70,7 @@ Use utilities as imported cells or registered tools where their contract fits.
70
70
 
71
71
  ## Installation Safety
72
72
 
73
- Do not bulk-copy `recipes/*.json` into the user Recipe root. Internal `draft-review.json` and `tool-review.json` support fenced automatic review and must not become user-installed callable tools. Register or wrap only the specific public capability you intend to use.
73
+ Do not bulk-copy bundled Recipes into the user Recipe root. Internal `recipe-memory/draft-review` and `recipe-memory/tool-review` components support fenced automatic review and must not become user-installed callable tools. Register or wrap only the specific public capability you intend to use.
74
74
 
75
75
  ## Validation
76
76
 
@@ -78,7 +78,7 @@ Do not bulk-copy `recipes/*.json` into the user Recipe root. Internal `draft-rev
78
78
  npm run recipes:qa
79
79
  ```
80
80
 
81
- Recipe QA validates syntax, imports, Control declarations, artifact paths, helper references, and platform documentation. Recipe descriptions are optional because discovery supplies stable fallback tool copy; internal component Recipes do not need boilerplate. The packaged baseline requires zero diagnostics and zero warnings, and any future warning is release-blocking with its concrete file and repair. Removed mailbox declarations fail with the migration diagnostic rather than receiving automatic conversion.
81
+ Recipe QA recursively inventories direct Skill components and validates filesystem identity, syntax, imports, Control declarations, origin ownership, portable artifact paths, and `{skill_dir}` helper references. Nested files and JSON/Markdown stem collisions fail precisely. Recipe descriptions remain optional; QA requires zero capability diagnostics and zero warnings without enforcing style, documentation quotas, or architecture policy. Removed mailbox declarations fail with the migration diagnostic rather than receiving automatic conversion.
82
82
 
83
83
  ## Related
84
84
 
package/docs/releasing.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Release Operations
2
2
 
3
- Stable releases use one immutable tag workflow. The workflow runs the complete reusable Ubuntu, macOS, Windows, and dependency-audit boundary before any publication, publishes and verifies the exact npm package through Trusted Publisher, then creates or converges the GitHub Release from the matching changelog section.
3
+ Stable releases use one immutable tag workflow. The workflow runs normal product validation on Ubuntu, macOS, and Windows plus the dependency audit before any publication, publishes and verifies the exact npm package through Trusted Publisher, then creates or converges the GitHub Release from the matching changelog section. Architecture review uses the project-local Domain DAG Skill during architecture-affecting development; release automation does not run policy, line-count, source-style, or Domain DAG gates.
4
4
 
5
5
  ## One-time npm Trusted Publisher setup
6
6
 
@@ -19,7 +19,7 @@ Do not create `NPM_TOKEN`, `NODE_AUTH_TOKEN`, or another long-lived npm publish
19
19
 
20
20
  1. Merge the validated release tree through the repository's guarded `dev` to `main` flow.
21
21
  2. Create one immutable `v<package.version>` tag on the verified `main` commit.
22
- 3. Let `.github/workflows/release.yml` invoke the complete reusable validation workflow.
22
+ 3. Let `.github/workflows/release.yml` invoke the reusable `npm run validate` and dependency-audit workflow.
23
23
  4. Let the publication job verify the tag commit, package manifests, and non-empty changelog section.
24
24
  5. Publish the exact public npm package through OIDC when the version does not exist.
25
25
  6. Verify npm version, `gitHead`, Pi extension/skill metadata, and packed runtime manifests.
@@ -10,7 +10,7 @@ A Recipe stores a reusable command-template definition as JSON or Markdown.
10
10
  "description": "Create a repository health artifact",
11
11
  "args": ["repo:path", "artifact_path:path", "model:string"],
12
12
  "defaults": { "artifact_path": "{state_dir}/health.md" },
13
- "imports": { "review": "subagent-review.json" },
13
+ "imports": { "review": "swarm/quorum-review" },
14
14
  "artifacts": { "report": "{artifact_path}" },
15
15
  "template": {
16
16
  "name": "review",
@@ -39,11 +39,13 @@ summarize {file}
39
39
 
40
40
  Fences marked `template`, `command-template`, `json`, or `recipe` can define execution. Frontmatter supports Recipe metadata and command-template flags.
41
41
 
42
+ Skill Recipe identity is `<active Skill name>/<Recipe filename stem>`. Recipe files have no top-level `name`; both JSON and Markdown fail with migration guidance when that removed field is present. `SKILL.md` `name` remains Pi host metadata and matches the Skill directory; pi-actors introduces no additional Skill identity field. The `name` field on a command-template node still selects an imported alias and is not Recipe self-identity.
43
+
42
44
  ## Fields
43
45
 
44
46
  Common Recipe fields:
45
47
 
46
- - `name`, `description`, `disabled`;
48
+ - `description`, `disabled`;
47
49
  - `args`, typed arg declarations, inline defaults, `defaults`, and composition `values`;
48
50
  - `imports` with optional binding defaults/values;
49
51
  - `template`;
@@ -58,25 +60,39 @@ Common Recipe fields:
58
60
  ```json
59
61
  {
60
62
  "imports": {
61
- "review": "subagent-review.json",
62
- "verify": {
63
- "from": "subagent-verify.json",
63
+ "review": "swarm/quorum-review",
64
+ "report": {
65
+ "from": "../shared/report.md",
64
66
  "defaults": { "thinking": "medium" }
65
67
  }
66
68
  },
67
69
  "template": [
68
70
  { "name": "review", "values": { "input": "{input}" } },
69
- { "name": "verify", "values": { "input": "Use prior output" } }
71
+ { "name": "report", "values": { "input": "Use prior output" } }
70
72
  ]
71
73
  }
72
74
  ```
73
75
 
74
76
  Imports are local definitions. Named nodes call imported templates inside the same execution graph and Run. Effective values follow `caller > node/import/Recipe values > defaults > inline arg default > missing-value error`, then the selected value is checked against its declared type or enum.
75
77
 
76
- Bare references preserve user → adjacent → packaged resolution. `std:<name>` selects a packaged Recipe exactly. `skill:<skill-name>/<recipe-path>` selects a component under the `recipes/` tree of a Skill currently active through Pi resource discovery. Skill Recipes never become tools merely by existing, and duplicate active Skill names fail as ambiguous rather than shadowing silently.
78
+ Imports accept exactly `<skill>/<recipe>` or an explicit `.json` / `.md` file path. A Skill reference selects one direct filename stem under the exact Skill currently active through Pi resource discovery; duplicate active Skill identities and JSON/Markdown stem collisions fail closed. Explicit paths may be relative (`./local-review.json`, `../shared/report.md`) or absolute (`/absolute/path/to/recipe.json`). An entry file path resolves from invocation `cwd`; a relative import resolves from the importing Recipe's directory. No bare or ambient lookup remains.
77
79
 
78
80
  Direct delegation can use another Recipe as the entire template. The delegated Recipe remains the source of truth while the wrapper may narrow args/defaults or override selected lifecycle metadata.
79
81
 
82
+ A launched Run captures each entry/import role, filename-derived stem, logical reference, Skill identity when owned, and import alias ancestry. Private physical source paths remain execution provenance; Inspector and child-agent context expose logical identities rather than machine-local Skill locations.
83
+
84
+ ## Migration from pre-0.46 references
85
+
86
+ ```text
87
+ std:foo -> owning-skill/foo
88
+ skill:foo/bar -> foo/bar
89
+ root packaged foo -> owning-skill/new-file-stem
90
+ Recipe name field -> delete; filename is identity
91
+ nested skill path -> flatten filename or use explicit file path
92
+ ```
93
+
94
+ Removed `std:` and `skill:` forms fail with migration guidance; they are not aliases. Root packaged Recipes no longer exist. Flatten a maintained Skill component to a direct filename, or reference a nested/local file explicitly when it is intentionally outside the Skill component namespace.
95
+
80
96
  ## Control
81
97
 
82
98
  Only a process that consumes actor-local input declares actions:
@@ -85,7 +101,7 @@ Only a process that consumes actor-local input declares actions:
85
101
  {
86
102
  "async": true,
87
103
  "control": ["pause", "resume", "stop"],
88
- "template": "{repo}/scripts/service.mjs --state-dir {state_dir}"
104
+ "template": "{skill_dir}/scripts/service.mjs --state-dir {state_dir}"
89
105
  }
90
106
  ```
91
107
 
@@ -110,7 +126,7 @@ Every file-backed Recipe receives immutable `{recipe_dir}`. A Recipe under an ac
110
126
 
111
127
  ## Context and Provenance
112
128
 
113
- File-backed Runs capture Recipe context records for the entry and imports, including qualified `std:` or `skill:` identity when applicable. The captured bundle explains composition identity and remains generation-local evidence. Runtime origin paths remain in local Run provenance but are omitted from model-facing launch values. It does not override the authored task prompt.
129
+ File-backed Runs capture Recipe context records for the entry and imports. File identity is the filename stem; a direct Recipe under an active Skill has the logical identity `<skill>/<stem>`. The captured bundle explains composition identity and remains generation-local evidence. Runtime origin paths remain in local Run provenance but are omitted from model-facing launch values. It does not override the authored task prompt.
114
130
 
115
131
  Recipes that need a minimal child prompt may opt out of injected Recipe context through the documented `actor_context` launch option.
116
132
 
@@ -129,18 +145,18 @@ Defaults can inherit current Pi policy:
129
145
 
130
146
  Resolution fails before launch when required current policy is unavailable. The Run persists whether values were inherited or explicit.
131
147
 
132
- ## Resolution and Shadowing
148
+ ## Resolution Context
133
149
 
134
- User Recipes under `~/.pi/agent/recipes` take priority over adjacent and packaged Recipes for compatible bare lookup. Exact `std:` and `skill:` references bypass that ambiguous space. The active Skill namespace converges from Pi's loaded Skill metadata on startup/reload; pi-actors does not scan ambient Skill roots independently. An invalid active file blocks fallback and reports both paths. Disabled Recipes cannot launch. Registry watchers converge after atomic changes without executing partial definitions.
150
+ User Recipes under `~/.pi/agent/recipes` remain intentionally registered tools, not an ambient import namespace. Each session receives an immutable active-Skill resolution context from Pi's loaded Skill metadata; pi-actors does not scan ambient Skill roots independently or keep a process-global mutable namespace. A launch captures its resolved graph, so later Skill changes affect only future launches. An invalid or missing exact target fails without fallback. Disabled Recipes cannot launch. Registry watchers converge after atomic changes without executing partial definitions.
135
151
 
136
152
  ## Validation
137
153
 
138
154
  ```bash
139
- node scripts/validate-recipe.mjs recipes/example.json --qa
140
- node scripts/validate-recipe.mjs recipes --all --qa --summary
155
+ node skills/actors/scripts/validate-recipe.mjs path/to/recipe.json --qa
156
+ node skills/actors/scripts/validate-recipe.mjs skills --skills --qa --summary
141
157
  ```
142
158
 
143
- Validation checks JSON/Markdown compilation, imports, Control, artifacts, helper paths, and platform notes. Files exceed 1 MiB or import depth 32 fail closed.
159
+ Skill validation recursively inventories every direct `<skill>/recipes/*.json|*.md` component, rejects nested files and duplicate stems, and checks filename identity, JSON/Markdown compilation, origins, imports, Control, artifacts, portable paths, helper targets, and platform notes. Files exceeding 1 MiB or import depth 32 fail closed.
144
160
 
145
161
  ## Related
146
162
 
@@ -22,7 +22,7 @@ Promote an immutable captured draft only with its draft path and explicit target
22
22
 
23
23
  ## Resolution
24
24
 
25
- User Recipes take priority over packaged Recipes. Active invalid or disabled shadowing blocks fallback and reports both paths. Runtime reload watches the Recipe root and converges after atomic changes; stale watcher generations cannot replace current registration state.
25
+ User Recipes are the only file-discovered tool source. Invalid or disabled user entries fail closed. Active Skill Recipes remain exact components outside tool discovery. Runtime reload watches the user Recipe root and converges after atomic changes; stale watcher generations cannot replace current registration state.
26
26
 
27
27
  Inspect registry state with:
28
28
 
@@ -61,7 +61,7 @@ Usage and lineage live in locked metadata ledgers rather than authored Recipe fi
61
61
 
62
62
  ## Wrapping Existing Recipes
63
63
 
64
- Prefer a small user-root wrapper that imports a maintained Recipe by exact `std:<recipe>` or `skill:<skill>/<recipe-path>` identity and delegates by alias. Skill Recipes remain components and are never exposed merely because their Skill is active. Do not duplicate executable templates, defaults, Control declarations, artifacts, or runtime-owned `{recipe_dir}`/`{skill_dir}`. Install only specific capabilities; internal automatic-review Recipes must not become user-callable tools.
64
+ Prefer a small user-root wrapper that imports a maintained Recipe by exact `<skill>/<recipe>` identity and delegates by alias. Skill Recipes remain components and are never exposed merely because their Skill is active. Do not duplicate executable templates, defaults, Control declarations, artifacts, or runtime-owned `{recipe_dir}`/`{skill_dir}`. Install only specific capabilities; internal automatic-review Recipes must not become user-callable tools.
65
65
 
66
66
  ## Safety
67
67
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "music-player",
3
- "path": "recipes/music-player.json",
3
+ "path": "skills/media/recipes/player.json",
4
4
  "location": "packaged",
5
5
  "active": true,
6
6
  "args": ["repo", "command", "source", "loop", "volume", "player", "state_dir"],
package/index.ts CHANGED
@@ -18,10 +18,11 @@ export default function toolRegistryExtension(pi: Pi.ExtensionAPI) {
18
18
  pi.on("session_shutdown", async (event, ctx) =>
19
19
  runtime.onSessionShutdown(event.reason, ctx),
20
20
  );
21
- pi.on("before_agent_start", async (event) =>
21
+ pi.on("before_agent_start", async (event, ctx) =>
22
22
  runtime.beforeAgentStart(
23
23
  event.systemPrompt,
24
24
  event.systemPromptOptions.skills ?? [],
25
+ ctx,
25
26
  ),
26
27
  );
27
28
  InspectorCommand.registerActorInspectorCommand(pi, runtime.getRunOwnerId);
package/lib/async-runs.ts CHANGED
@@ -259,11 +259,23 @@ function assertNoActiveRunState(stateDir: string): void {
259
259
  RunsStart.assertNoActiveRunState(stateDir, readJson, RUNNER_PATH);
260
260
  }
261
261
 
262
- function resolveRecipeFile(file: string): string {
263
- return (
264
- RecipesReferences.resolveRecipeReferencePath(file, Paths.getRecipeRoot()) ??
265
- RecipesReferences.getRecipePath(file, Paths.getRecipeRoot()) ??
266
- RecipesReferences.resolveRecipePath(file, Paths.getRecipeRoot())
262
+ export interface AsyncRunStartOptions {
263
+ skillContext?: RecipesReferences.ActiveSkillRecipeContext;
264
+ }
265
+
266
+ function resolveRecipeFile(
267
+ file: string,
268
+ cwd: string,
269
+ options: AsyncRunStartOptions,
270
+ ): string {
271
+ const path = RecipesReferences.resolveRecipeReferencePath(
272
+ file,
273
+ cwd,
274
+ options.skillContext,
275
+ );
276
+ if (path) return path;
277
+ throw new Error(
278
+ `Recipe reference not found. Use <skill>/<recipe> or an explicit .json/.md file path: ${file}`,
267
279
  );
268
280
  }
269
281
 
@@ -274,13 +286,18 @@ function isMutableUsageRecipeFile(file: string): boolean {
274
286
  return relation !== "" && !relation.startsWith("..") && !isAbsolute(relation);
275
287
  }
276
288
 
277
- function readRecipeFile(file: string): AsyncRunStartParams {
278
- const path = resolveRecipeFile(file);
289
+ function readRecipeFile(
290
+ file: string,
291
+ cwd: string,
292
+ options: AsyncRunStartOptions,
293
+ ): AsyncRunStartParams {
294
+ const path = resolveRecipeFile(file, cwd, options);
279
295
  const raw = RecipesReferences.readRawRecipeConfig(path);
280
296
  const includeActorRecipeContext =
281
297
  raw?.actor_context !== false && raw?.actor_context !== "off";
282
298
  const config = RecipesReferences.readResolvedRecipeConfig(path, [], {
283
299
  includeActorRecipeContext,
300
+ skillContext: options.skillContext,
284
301
  });
285
302
  if (!config) {
286
303
  throw new Error(`Template recipe must define template: ${path}`);
@@ -301,9 +318,13 @@ function getRunIdFromFile(file: string | undefined): string | undefined {
301
318
  return name || undefined;
302
319
  }
303
320
 
304
- function resolveStartParams(params: AsyncRunStartParams): AsyncRunStartParams {
321
+ function resolveStartParams(
322
+ params: AsyncRunStartParams,
323
+ cwd: string,
324
+ options: AsyncRunStartOptions,
325
+ ): AsyncRunStartParams {
305
326
  if (!params.file) return params;
306
- const fileParams = readRecipeFile(params.file);
327
+ const fileParams = readRecipeFile(params.file, cwd, options);
307
328
  return {
308
329
  ...fileParams,
309
330
  ...params,
@@ -468,25 +489,15 @@ function prepareStateDirForStart(stateDir: string): void {
468
489
  export function startRun(
469
490
  params: AsyncRunStartParams,
470
491
  cwd: string,
492
+ options: AsyncRunStartOptions = {},
471
493
  ): AsyncRunMeta {
472
- const startParams = resolveStartParams(params);
494
+ const startParams = resolveStartParams(params, cwd, options);
473
495
  const resolved = resolveRunTemplate(startParams);
474
496
  const run = safeRunId(startParams.run_id);
475
497
  const stateDir = resolveStateDir(startParams, run);
476
498
  const recipeFile = startParams.file
477
- ? resolveRecipeFile(startParams.file)
499
+ ? resolveRecipeFile(startParams.file, cwd, options)
478
500
  : undefined;
479
- const packagedRecipeRoot = resolve(Paths.getPackagedRecipeRoot());
480
- const recipeRelation = recipeFile
481
- ? relative(packagedRecipeRoot, recipeFile)
482
- : undefined;
483
- const packagedRepo =
484
- startParams.defaults?.repo === "~/.pi/agent/extensions/pi-actors" &&
485
- recipeRelation &&
486
- !recipeRelation.startsWith("..") &&
487
- !isAbsolute(recipeRelation)
488
- ? dirname(packagedRecipeRoot)
489
- : undefined;
490
501
  const argSpec = Schema.parseToolArgDeclarationList(startParams.args ?? []);
491
502
  if (argSpec.error) throw new Error(argSpec.error);
492
503
  const declaredArgs = new Set(argSpec.args);
@@ -498,7 +509,6 @@ export function startRun(
498
509
  {
499
510
  ...argSpec.defaults,
500
511
  ...(startParams.defaults || {}),
501
- ...(packagedRepo ? { repo: packagedRepo } : {}),
502
512
  ...(startParams.values || {}),
503
513
  run_id: run,
504
514
  state_dir: stateDir,
@@ -546,7 +556,20 @@ export function startRun(
546
556
  startParams.actor_context !== "off";
547
557
  const recipeContextRecords =
548
558
  recipeFile && includeActorRecipeContext
549
- ? RecipesReferences.buildRecipeContextRecords(recipeFile)
559
+ ? RecipesReferences.buildRecipeContextRecords(
560
+ recipeFile,
561
+ options.skillContext,
562
+ ).map((record, index) =>
563
+ index === 0 &&
564
+ startParams.launch_source === "tool" &&
565
+ record.source_kind === "explicit_file_recipe"
566
+ ? {
567
+ ...record,
568
+ logical_reference: record.name,
569
+ source_kind: "user_registry_capability" as const,
570
+ }
571
+ : record,
572
+ )
550
573
  : undefined;
551
574
  if (
552
575
  recipeFile &&
@@ -4,13 +4,14 @@
4
4
  * Owns automatic-review lifecycle wiring without owning review decisions or filesystem transactions.
5
5
  */
6
6
 
7
- import { join } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
8
 
9
9
  import * as AsyncRuns from "./async-runs.ts";
10
10
  import * as DraftSleep from "./draft-sleep.ts";
11
11
  import * as ModelContext from "./model-context.ts";
12
12
  import * as Paths from "./paths.ts";
13
13
  import type * as Pi from "./pi.ts";
14
+ import * as RecipesReferences from "./recipes-references.ts";
14
15
  import * as ReviewControl from "./review-control.ts";
15
16
  import * as ToolReviewScheduler from "./tool-review-scheduler.ts";
16
17
 
@@ -27,6 +28,16 @@ export interface AutomaticReviewRuntimeDeps {
27
28
  getThinkingLevel(): unknown;
28
29
  }
29
30
 
31
+ export const PACKAGE_RECIPE_MEMORY_CONTEXT =
32
+ RecipesReferences.createActiveSkillRecipeContext([
33
+ {
34
+ name: "recipe-memory",
35
+ filePath: fileURLToPath(
36
+ new URL("../skills/recipe-memory/SKILL.md", import.meta.url),
37
+ ),
38
+ },
39
+ ]);
40
+
30
41
  export function createAutomaticReviewRuntime(
31
42
  deps: AutomaticReviewRuntimeDeps,
32
43
  ): AutomaticReviewRuntime {
@@ -88,7 +99,7 @@ export function createAutomaticReviewRuntime(
88
99
  }
89
100
  return AsyncRuns.startRun(
90
101
  {
91
- file: join(Paths.getPackagedRecipeRoot(), "draft-review.json"),
102
+ file: "recipe-memory/draft-review",
92
103
  launch_source: "tool",
93
104
  notification_policy: "silent",
94
105
  ownerId: deps.getRunOwnerId(ctx),
@@ -97,6 +108,7 @@ export function createAutomaticReviewRuntime(
97
108
  values: { input_path: batch.reviewerInputPath },
98
109
  },
99
110
  ctx.cwd,
111
+ { skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT },
100
112
  );
101
113
  },
102
114
  process: (state) =>
@@ -113,7 +125,7 @@ export function createAutomaticReviewRuntime(
113
125
  }
114
126
  return AsyncRuns.startRun(
115
127
  {
116
- file: join(Paths.getPackagedRecipeRoot(), "tool-review.json"),
128
+ file: "recipe-memory/tool-review",
117
129
  launch_source: "tool",
118
130
  notification_policy: "silent",
119
131
  ownerId: deps.getRunOwnerId(ctx),
@@ -122,6 +134,7 @@ export function createAutomaticReviewRuntime(
122
134
  values: { input_path: batch.reviewerInputPath },
123
135
  },
124
136
  ctx.cwd,
137
+ { skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT },
125
138
  );
126
139
  },
127
140
  process: (state) =>
@@ -96,7 +96,6 @@ function readState(path: string): DraftSleepState | undefined {
96
96
  function defaultActiveTools(recipeRoot: string): DraftReviewActiveTool[] {
97
97
  const discovered = RecipesDiscovery.discoverRecipeSources([
98
98
  { root: recipeRoot, defaultTool: true, mutableUsage: true },
99
- { root: Paths.getPackagedRecipeRoot() },
100
99
  ]);
101
100
  return [...discovered.active.values()]
102
101
  .filter((entry) => existsSync(entry.path))