@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.
- package/AGENTS.md +9 -7
- package/CHANGELOG.md +8 -1
- package/README.md +26 -12
- package/dist/fixtures/protocol/recipe-summary.json +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/async-runs.d.ts +4 -1
- package/dist/lib/async-runs.js +22 -23
- package/dist/lib/automatic-review-runtime.d.ts +2 -0
- package/dist/lib/automatic-review-runtime.js +12 -5
- package/dist/lib/draft-sleep.js +0 -1
- package/dist/lib/extension-runtime.d.ts +1 -1
- package/dist/lib/extension-runtime.js +8 -2
- package/dist/lib/inspector.js +45 -7
- package/dist/lib/paths.d.ts +0 -1
- package/dist/lib/paths.js +0 -7
- package/dist/lib/prompts.d.ts +1 -1
- package/dist/lib/prompts.js +2 -2
- package/dist/lib/recipes-context.js +2 -2
- package/dist/lib/recipes-references.d.ts +24 -9
- package/dist/lib/recipes-references.js +152 -126
- package/dist/lib/runtime.d.ts +0 -1
- package/dist/lib/runtime.js +1 -3
- package/dist/lib/tools-inspect.d.ts +0 -1
- package/dist/lib/tools-inspect.js +35 -8
- package/dist/lib/tools-local.d.ts +2 -0
- package/dist/lib/tools-local.js +1 -1
- package/dist/lib/tools-spawn.d.ts +2 -0
- package/dist/lib/tools-spawn.js +24 -52
- package/dist/scripts/build-dist.mjs +13 -4
- package/dist/skills/actors/SKILL.md +6 -6
- package/dist/skills/actors/recipes/recipe-validate.json +11 -0
- package/{recipes/utility-coordinator-lock-snapshot.json → dist/skills/actors/recipes/resource-locker-snapshot.json} +1 -3
- package/dist/{recipes → skills/actors/recipes}/resource-locker.json +1 -3
- package/dist/{recipes/utility-run-ops-snapshot.json → skills/actors/recipes/run-ops-snapshot.json} +1 -3
- package/dist/skills/actors/recipes/run-summary.json +9 -0
- package/dist/{scripts/locker.mjs → skills/actors/scripts/resource-locker.mjs} +2 -2
- package/dist/skills/actors/scripts/run-utils.mjs +164 -0
- package/{scripts → dist/skills/actors/scripts}/validate-recipe.mjs +134 -17
- package/dist/skills/artifacts/SKILL.md +16 -0
- package/{recipes/pipeline-artifact-bundle.json → dist/skills/artifacts/recipes/bundle.json} +4 -4
- package/dist/{recipes/utility-artifact-write.json → skills/artifacts/recipes/file-write.json} +1 -3
- package/dist/{recipes/utility-artifact-manifest.json → skills/artifacts/recipes/manifest.json} +1 -3
- package/{recipes/pipeline-artifact-report.json → dist/skills/artifacts/recipes/report.json} +2 -2
- package/dist/{recipes/pipeline-artifact-write.json → skills/artifacts/recipes/write.json} +3 -3
- package/dist/skills/artifacts/scripts/artifact-utils.mjs +63 -0
- package/dist/skills/media/SKILL.md +16 -0
- package/dist/{recipes/pipeline-media-library.json → skills/media/recipes/library.json} +2 -2
- package/{recipes/music-player.json → dist/skills/media/recipes/player.json} +1 -3
- package/dist/{recipes/utility-playlist-build.json → skills/media/recipes/playlist-build.json} +1 -3
- package/dist/skills/media/scripts/media-utils.mjs +47 -0
- package/dist/{scripts → skills/media/scripts}/music-player.mjs +9 -3
- package/dist/skills/project-work/SKILL.md +16 -0
- package/dist/skills/project-work/recipes/changelog-section.json +11 -0
- package/{recipes/pipeline-docs-maintenance.json → dist/skills/project-work/recipes/docs-maintenance.json} +4 -4
- package/dist/skills/project-work/recipes/package-summary.json +9 -0
- package/{recipes/pipeline-release-readiness.json → dist/skills/project-work/recipes/release-readiness.json} +6 -6
- package/dist/{recipes/pipeline-release-summary.json → skills/project-work/recipes/release-summary.json} +5 -5
- package/{recipes/pipeline-repo-health.json → dist/skills/project-work/recipes/repo-health.json} +6 -6
- package/{recipes/pipeline-async-run-ops.json → dist/skills/project-work/recipes/run-ops.json} +3 -3
- package/dist/skills/project-work/recipes/skill-summary.json +11 -0
- package/dist/skills/project-work/scripts/project-utils.mjs +89 -0
- package/dist/skills/recipe-memory/SKILL.md +16 -0
- package/dist/skills/swarm/SKILL.md +4 -4
- package/{recipes/pipeline-architect-coordinator.json → dist/skills/swarm/recipes/architect.json} +5 -5
- package/{recipes/pipeline-checkpoint-continuation.json → dist/skills/swarm/recipes/checkpoint-continuation.json} +3 -3
- package/dist/{recipes/pipeline-development-tasking.json → skills/swarm/recipes/development-tasking.json} +4 -4
- package/dist/{recipes/lens-swarm.json → skills/swarm/recipes/lens-review.json} +1 -1
- package/dist/{recipes/pipeline-quorum-review.json → skills/swarm/recipes/quorum-review.json} +4 -4
- package/{recipes/pipeline-research-synthesis.json → dist/skills/swarm/recipes/research-synthesis.json} +6 -6
- package/{recipes/pipeline-review-readiness.json → dist/skills/swarm/recipes/review-readiness.json} +1 -1
- package/{recipes/subagents-prompts.json → dist/skills/swarm/recipes/subagent-prompts.json} +1 -1
- package/{recipes → dist/skills/swarm/recipes}/subagent-quorum.json +1 -1
- package/dist/{recipes → skills/swarm/recipes}/subagent-review-coordinator.json +6 -6
- package/docs/actor-inspector.md +4 -3
- package/docs/async-runs.md +2 -2
- package/docs/recipe-library.md +23 -23
- package/docs/releasing.md +2 -2
- package/docs/template-recipes.md +30 -14
- package/docs/tool-registry.md +2 -2
- package/fixtures/protocol/recipe-summary.json +1 -1
- package/index.ts +2 -1
- package/lib/async-runs.ts +47 -24
- package/lib/automatic-review-runtime.ts +16 -3
- package/lib/draft-sleep.ts +0 -1
- package/lib/extension-runtime.ts +21 -2
- package/lib/inspector.ts +56 -11
- package/lib/paths.ts +0 -7
- package/lib/prompts.ts +2 -2
- package/lib/recipes-context.ts +2 -2
- package/lib/recipes-references.ts +223 -134
- package/lib/runtime.ts +1 -5
- package/lib/tools-inspect.ts +42 -9
- package/lib/tools-local.ts +2 -0
- package/lib/tools-spawn.ts +37 -74
- package/package.json +2 -4
- package/scripts/build-dist.mjs +13 -4
- package/skills/actors/SKILL.md +6 -6
- package/skills/actors/recipes/recipe-validate.json +11 -0
- package/{dist/recipes/utility-coordinator-lock-snapshot.json → skills/actors/recipes/resource-locker-snapshot.json} +1 -3
- package/{recipes → skills/actors/recipes}/resource-locker.json +1 -3
- package/{recipes/utility-run-ops-snapshot.json → skills/actors/recipes/run-ops-snapshot.json} +1 -3
- package/skills/actors/recipes/run-summary.json +9 -0
- package/{scripts/locker.mjs → skills/actors/scripts/resource-locker.mjs} +2 -2
- package/skills/actors/scripts/run-utils.mjs +164 -0
- package/{dist → skills/actors}/scripts/validate-recipe.mjs +134 -17
- package/skills/artifacts/SKILL.md +16 -0
- package/{dist/recipes/pipeline-artifact-bundle.json → skills/artifacts/recipes/bundle.json} +4 -4
- package/{recipes/utility-artifact-write.json → skills/artifacts/recipes/file-write.json} +1 -3
- package/{recipes/utility-artifact-manifest.json → skills/artifacts/recipes/manifest.json} +1 -3
- package/{dist/recipes/pipeline-artifact-report.json → skills/artifacts/recipes/report.json} +2 -2
- package/{recipes/pipeline-artifact-write.json → skills/artifacts/recipes/write.json} +3 -3
- package/skills/artifacts/scripts/artifact-utils.mjs +63 -0
- package/skills/media/SKILL.md +16 -0
- package/{recipes/pipeline-media-library.json → skills/media/recipes/library.json} +2 -2
- package/{dist/recipes/music-player.json → skills/media/recipes/player.json} +1 -3
- package/{recipes/utility-playlist-build.json → skills/media/recipes/playlist-build.json} +1 -3
- package/skills/media/scripts/media-utils.mjs +47 -0
- package/{scripts → skills/media/scripts}/music-player.mjs +9 -3
- package/skills/project-work/SKILL.md +16 -0
- package/skills/project-work/recipes/changelog-section.json +11 -0
- package/{dist/recipes/pipeline-docs-maintenance.json → skills/project-work/recipes/docs-maintenance.json} +4 -4
- package/skills/project-work/recipes/package-summary.json +9 -0
- package/{dist/recipes/pipeline-release-readiness.json → skills/project-work/recipes/release-readiness.json} +6 -6
- package/{recipes/pipeline-release-summary.json → skills/project-work/recipes/release-summary.json} +5 -5
- package/{dist/recipes/pipeline-repo-health.json → skills/project-work/recipes/repo-health.json} +6 -6
- package/{dist/recipes/pipeline-async-run-ops.json → skills/project-work/recipes/run-ops.json} +3 -3
- package/skills/project-work/recipes/skill-summary.json +11 -0
- package/skills/project-work/scripts/project-utils.mjs +89 -0
- package/skills/recipe-memory/SKILL.md +16 -0
- package/skills/swarm/SKILL.md +4 -4
- package/{dist/recipes/pipeline-architect-coordinator.json → skills/swarm/recipes/architect.json} +5 -5
- package/{dist/recipes/pipeline-checkpoint-continuation.json → skills/swarm/recipes/checkpoint-continuation.json} +3 -3
- package/{recipes/pipeline-development-tasking.json → skills/swarm/recipes/development-tasking.json} +4 -4
- package/{recipes/lens-swarm.json → skills/swarm/recipes/lens-review.json} +1 -1
- package/{recipes/pipeline-quorum-review.json → skills/swarm/recipes/quorum-review.json} +4 -4
- package/{dist/recipes/pipeline-research-synthesis.json → skills/swarm/recipes/research-synthesis.json} +6 -6
- package/{dist/recipes/pipeline-review-readiness.json → skills/swarm/recipes/review-readiness.json} +1 -1
- package/{dist/recipes/subagents-prompts.json → skills/swarm/recipes/subagent-prompts.json} +1 -1
- package/{dist → skills/swarm}/recipes/subagent-quorum.json +1 -1
- package/{recipes → skills/swarm/recipes}/subagent-review-coordinator.json +6 -6
- package/dist/recipes/utility-changelog-section.json +0 -13
- package/dist/recipes/utility-package-summary.json +0 -11
- package/dist/recipes/utility-run-summary.json +0 -11
- package/dist/recipes/utility-skill-summary.json +0 -13
- package/dist/recipes/utility-validate-recipe.json +0 -13
- package/dist/scripts/executable-block-style.d.mts +0 -1
- package/dist/scripts/executable-block-style.mjs +0 -73
- package/dist/scripts/recipe-utils.mjs +0 -404
- package/dist/scripts/release-gates.mjs +0 -281
- package/recipes/utility-changelog-section.json +0 -13
- package/recipes/utility-package-summary.json +0 -11
- package/recipes/utility-run-summary.json +0 -11
- package/recipes/utility-skill-summary.json +0 -13
- package/recipes/utility-validate-recipe.json +0 -13
- package/scripts/executable-block-style.d.mts +0 -1
- package/scripts/executable-block-style.mjs +0 -73
- package/scripts/recipe-utils.mjs +0 -404
- package/scripts/release-gates.mjs +0 -281
- /package/dist/{recipes/utility-validation-wrapper.json → skills/actors/recipes/command-validate.json} +0 -0
- /package/dist/{recipes/utility-jsonl-tail.json → skills/actors/recipes/jsonl-tail.json} +0 -0
- /package/dist/{recipes/utility-run-state-files.json → skills/actors/recipes/run-state-files.json} +0 -0
- /package/dist/{recipes/utility-playlist-scan.json → skills/media/recipes/playlist-scan.json} +0 -0
- /package/dist/{recipes/utility-changelog-head.json → skills/project-work/recipes/changelog-head.json} +0 -0
- /package/dist/{recipes/utility-git-log.json → skills/project-work/recipes/git-log.json} +0 -0
- /package/dist/{recipes/utility-git-status.json → skills/project-work/recipes/git-status.json} +0 -0
- /package/dist/{recipes/utility-markdown-index.json → skills/project-work/recipes/markdown-index.json} +0 -0
- /package/dist/{recipes → skills/recipe-memory/recipes}/draft-review.json +0 -0
- /package/dist/{recipes → skills/recipe-memory/recipes}/tool-review.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-artifact.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-checkpoint.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-conflict-report.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-contradiction-map.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-critic.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-evidence-map.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-followup.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-judge.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-merge.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-normalize.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-plan.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-preflight.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-prompt.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-review.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-task-card.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-tools.json +0 -0
- /package/dist/{recipes → skills/swarm/recipes}/subagent-verify.json +0 -0
- /package/{recipes/utility-validation-wrapper.json → skills/actors/recipes/command-validate.json} +0 -0
- /package/{recipes/utility-jsonl-tail.json → skills/actors/recipes/jsonl-tail.json} +0 -0
- /package/{recipes/utility-run-state-files.json → skills/actors/recipes/run-state-files.json} +0 -0
- /package/{recipes/utility-playlist-scan.json → skills/media/recipes/playlist-scan.json} +0 -0
- /package/{recipes/utility-changelog-head.json → skills/project-work/recipes/changelog-head.json} +0 -0
- /package/{recipes/utility-git-log.json → skills/project-work/recipes/git-log.json} +0 -0
- /package/{recipes/utility-git-status.json → skills/project-work/recipes/git-status.json} +0 -0
- /package/{recipes/utility-markdown-index.json → skills/project-work/recipes/markdown-index.json} +0 -0
- /package/{recipes → skills/recipe-memory/recipes}/draft-review.json +0 -0
- /package/{recipes → skills/recipe-memory/recipes}/tool-review.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-artifact.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-checkpoint.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-conflict-report.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-contradiction-map.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-critic.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-evidence-map.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-followup.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-judge.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-merge.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-normalize.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-plan.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-preflight.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-prompt.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-review.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-task-card.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-tools.json +0 -0
- /package/{recipes → skills/swarm/recipes}/subagent-verify.json +0 -0
package/lib/extension-runtime.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
132
|
-
|
|
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
|
-
|
|
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;
|
|
34
|
-
- Prefer maintained
|
|
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 = {
|
package/lib/recipes-context.ts
CHANGED
|
@@ -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.
|
|
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
|
|