@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
@@ -20,6 +20,7 @@ export interface ActorExtensionRuntime {
20
20
  beforeAgentStart(
21
21
  systemPrompt: string,
22
22
  skills: RecipesReferences.ActiveSkillRecipeSource[],
23
+ ctx: Pi.ExtensionContext,
23
24
  ): { systemPrompt: string };
24
25
  discoverResources(metaUrl: string): { skillPaths: string[] } | undefined;
25
26
  getRunOwnerId(ctx: Pi.ExtensionContext): string;
@@ -33,7 +34,14 @@ export function createActorExtensionRuntime(
33
34
  pi: Pi.ExtensionAPI,
34
35
  ): ActorExtensionRuntime {
35
36
  let activeRunContext: Pi.ExtensionContext | undefined;
37
+ const skillContextsBySession = new Map<
38
+ string,
39
+ RecipesReferences.ActiveSkillRecipeContext
40
+ >();
36
41
  const getRunOwnerId = Pi.getSessionId;
42
+ const getSkillContext = (ctx: Pi.ExtensionContext) =>
43
+ skillContextsBySession.get(getRunOwnerId(ctx)) ??
44
+ RecipesReferences.EMPTY_ACTIVE_SKILL_RECIPE_CONTEXT;
37
45
  const automaticReview = AutomaticReviewRuntime.createAutomaticReviewRuntime({
38
46
  getActiveContext: () => activeRunContext,
39
47
  getRunOwnerId,
@@ -59,6 +67,9 @@ export function createActorExtensionRuntime(
59
67
  if (ctx && typeof ctx === "object") {
60
68
  nextArgs[4] = {
61
69
  ...(ctx as Record<string, unknown>),
70
+ activeSkillRecipeContext: getSkillContext(
71
+ ctx as Pi.ExtensionContext,
72
+ ),
62
73
  getThinkingLevel: () => pi.getThinkingLevel(),
63
74
  };
64
75
  }
@@ -84,8 +95,11 @@ export function createActorExtensionRuntime(
84
95
  });
85
96
  const recipeReload = Runtime.createRecipeToolReloadWatcher(runtime);
86
97
  return {
87
- beforeAgentStart(systemPrompt, skills) {
88
- RecipesReferences.setActiveSkillRecipeSources(skills);
98
+ beforeAgentStart(systemPrompt, skills, ctx) {
99
+ skillContextsBySession.set(
100
+ getRunOwnerId(ctx),
101
+ RecipesReferences.createActiveSkillRecipeContext(skills),
102
+ );
89
103
  return {
90
104
  systemPrompt: `${systemPrompt}\n\n${Prompts.ONBOARDING_SYSTEM_PROMPT}`,
91
105
  };
@@ -99,12 +113,17 @@ export function createActorExtensionRuntime(
99
113
  if (activeRunContext === ctx) automaticReview.schedule();
100
114
  },
101
115
  onSessionShutdown(reason, ctx) {
116
+ skillContextsBySession.delete(getRunOwnerId(ctx));
102
117
  activeRunContext = undefined;
103
118
  automaticReview.close();
104
119
  recipeReload.close();
105
120
  runUiRuntime.shutdown(reason, ctx);
106
121
  },
107
122
  async onSessionStart(ctx) {
123
+ skillContextsBySession.set(
124
+ getRunOwnerId(ctx),
125
+ RecipesReferences.EMPTY_ACTIVE_SKILL_RECIPE_CONTEXT,
126
+ );
108
127
  ctx.ui.setWidget("zz-pi-actors-comms", undefined);
109
128
  activeRunContext = ctx;
110
129
  runUiRuntime.close();
package/lib/inspector.ts CHANGED
@@ -102,17 +102,51 @@ export function readActorInspectorRecipe(
102
102
  !Array.isArray(primary.recipe)
103
103
  ? (primary.recipe as Record<string, unknown>)
104
104
  : undefined;
105
- const redactedRecord = (value: Record<string, unknown>): Record<string, unknown> =>
106
- SessionEvidence.redactSessionEvidenceValue(
107
- Object.fromEntries(
108
- Object.entries(value).filter(
105
+ const stripPrivateOrigins = (value: unknown): unknown => {
106
+ if (Array.isArray(value)) return value.map(stripPrivateOrigins);
107
+ if (!value || typeof value !== "object") return value;
108
+ return Object.fromEntries(
109
+ Object.entries(value as Record<string, unknown>)
110
+ .filter(
109
111
  ([key, entry]) =>
110
112
  entry !== undefined &&
111
113
  key !== "recipe_dir" &&
112
- key !== "skill_dir",
113
- ),
114
- ),
114
+ key !== "skill_dir" &&
115
+ key !== "source_file",
116
+ )
117
+ .map(([key, entry]) => [
118
+ key,
119
+ key === "actorRecipeContext" && entry && typeof entry === "object"
120
+ ? stripPrivateOrigins(
121
+ Object.fromEntries(
122
+ Object.entries(entry as Record<string, unknown>).filter(
123
+ ([contextKey]) => contextKey !== "file",
124
+ ),
125
+ ),
126
+ )
127
+ : stripPrivateOrigins(entry),
128
+ ]),
129
+ );
130
+ };
131
+ const redactedRecord = (value: Record<string, unknown>): Record<string, unknown> =>
132
+ SessionEvidence.redactSessionEvidenceValue(
133
+ stripPrivateOrigins(value),
115
134
  ) as Record<string, unknown>;
135
+ const primarySourceKind =
136
+ primary?.source_kind === "active_skill_component"
137
+ ? "active_skill_component"
138
+ : primary?.source_kind === "user_registry_capability" ||
139
+ meta.launch_source === "tool"
140
+ ? "user_registry_capability"
141
+ : "explicit_file_recipe";
142
+ const primaryLogicalReference =
143
+ typeof primary?.logical_reference === "string"
144
+ ? primary.logical_reference
145
+ : typeof primary?.name === "string"
146
+ ? primary.name
147
+ : typeof meta.recipe === "string"
148
+ ? meta.recipe
149
+ : "unknown";
116
150
  const launchValues =
117
151
  meta.values && typeof meta.values === "object" && !Array.isArray(meta.values)
118
152
  ? Object.fromEntries(
@@ -126,10 +160,18 @@ export function readActorInspectorRecipe(
126
160
  redactedRecord({
127
161
  ...(typeof entry.alias === "string" ? { alias: entry.alias } : {}),
128
162
  depth: entry.depth,
129
- file: entry.file,
130
163
  import_path: entry.import_path,
131
- name: entry.name,
132
- qualified_name: entry.qualified_name,
164
+ logical_reference: entry.logical_reference ?? entry.name,
165
+ recipe_stem: entry.name,
166
+ role: entry.role,
167
+ ...(typeof entry.skill === "string" ? { skill: entry.skill } : {}),
168
+ source_kind:
169
+ entry.source_kind === "active_skill_component"
170
+ ? "active_skill_component"
171
+ : entry.source_kind === "user_registry_capability" ||
172
+ (entry.depth === 0 && meta.launch_source === "tool")
173
+ ? "user_registry_capability"
174
+ : "explicit_file_recipe",
133
175
  }),
134
176
  ),
135
177
  ...(definition ? { definition: redactedRecord(definition) } : {}),
@@ -137,7 +179,10 @@ export function readActorInspectorRecipe(
137
179
  identity: redactedRecord({
138
180
  run: meta.run,
139
181
  recipe: meta.recipe,
140
- recipe_file: meta.recipe_file,
182
+ recipe_stem: primary?.name ?? meta.recipe,
183
+ logical_reference: primaryLogicalReference,
184
+ ...(typeof primary?.skill === "string" ? { skill: primary.skill } : {}),
185
+ source_kind: primarySourceKind,
141
186
  launch_source: meta.launch_source,
142
187
  }),
143
188
  launch: redactedRecord({
package/lib/paths.ts CHANGED
@@ -109,10 +109,3 @@ export function getRecipeRoot(agentDir = getAgentDir()): string {
109
109
  export function getRecipeDraftRoot(agentDir = getAgentDir()): string {
110
110
  return join(getRecipeRoot(agentDir), "drafts");
111
111
  }
112
-
113
- export function getPackagedRecipeRoot(): string {
114
- const here = dirname(fileURLToPath(import.meta.url));
115
- const compiledRoot = resolve(here, "..", "..", "recipes");
116
- if (existsSync(compiledRoot)) return compiledRoot;
117
- return resolve(here, "..", "recipes");
118
- }
package/lib/prompts.ts CHANGED
@@ -30,8 +30,8 @@ export const ONBOARDING_SYSTEM_PROMPT = `pi-actors quick model:
30
30
  - 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.
31
31
  - 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.
32
32
  - 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.
33
- - 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; packaged/ad hoc recipes are lower-priority components; offer to save successful recurring patterns only after confirmation.
34
- - Prefer maintained packaged recipes/pipelines with spawn file=<recipe> before ad hoc scripts/wrappers; review swarms inherit current model/thinking, preflight before fanout, and expose quorum/concurrency/TTL knobs unless explicit args are passed.
33
+ - 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.
34
+ - 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.
35
35
  - 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.`;
36
36
 
37
37
  export const REGISTER_TOOL_PARAM_DESCRIPTIONS = {
@@ -96,7 +96,7 @@ function matchesActorContext(
96
96
  context: CommandTemplateActorRecipeContext | undefined,
97
97
  ): boolean {
98
98
  if (!context) return record.role === "entry";
99
- if (context.file && context.file === record.file) return true;
99
+ if (context.file && context.file === record.source_file) return true;
100
100
  if (context.name && context.name === record.name) return true;
101
101
  if (context.alias && context.alias === record.alias) return true;
102
102
  return false;
@@ -131,7 +131,7 @@ export function formatRecipeContextJsonl(
131
131
  context?: CommandTemplateActorRecipeContext,
132
132
  ): string {
133
133
  return markRecipeContextRecords(records, context)
134
- .map((record) => JSON.stringify(record))
134
+ .map(({ source_file: _sourceFile, ...record }) => JSON.stringify(record))
135
135
  .join("\n");
136
136
  }
137
137