agentplane 0.3.22 → 0.3.23

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 (36) hide show
  1. package/assets/policy/incidents.md +1 -0
  2. package/dist/.build-manifest.json +44 -24
  3. package/dist/cli/run-cli/commands/init/orchestrate-v2.d.ts.map +1 -1
  4. package/dist/cli/run-cli/commands/init/orchestrate-v2.js +10 -2
  5. package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -1
  6. package/dist/cli/run-cli/commands/init/orchestrate.js +10 -2
  7. package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
  8. package/dist/cli/run-cli/commands/init/recipes.js +3 -1
  9. package/dist/cli.js +337 -337
  10. package/dist/commands/hooks/install.d.ts +4 -0
  11. package/dist/commands/hooks/install.d.ts.map +1 -1
  12. package/dist/commands/hooks/install.js +19 -0
  13. package/dist/commands/hooks/run.pre-push.d.ts.map +1 -1
  14. package/dist/commands/hooks/run.pre-push.js +5 -2
  15. package/dist/commands/recipes/impl/installed-recipes.d.ts +5 -1
  16. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  17. package/dist/commands/recipes/impl/installed-recipes.js +38 -19
  18. package/dist/commands/release/apply.mutation.d.ts.map +1 -1
  19. package/dist/commands/release/apply.mutation.js +5 -4
  20. package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -1
  21. package/dist/commands/release/apply.pipeline/mutation.js +6 -1
  22. package/dist/commands/release/apply.preflight.d.ts.map +1 -1
  23. package/dist/commands/release/apply.preflight.js +5 -4
  24. package/dist/runtime/prompt-modules/index.d.ts +3 -0
  25. package/dist/runtime/prompt-modules/index.d.ts.map +1 -0
  26. package/dist/runtime/prompt-modules/index.js +1 -0
  27. package/dist/runtime/prompt-modules/model.d.ts +89 -0
  28. package/dist/runtime/prompt-modules/model.d.ts.map +1 -0
  29. package/dist/runtime/prompt-modules/model.js +1 -0
  30. package/dist/runtime/prompt-modules/mutations.d.ts +103 -0
  31. package/dist/runtime/prompt-modules/mutations.d.ts.map +1 -0
  32. package/dist/runtime/prompt-modules/mutations.js +1 -0
  33. package/dist/shared/runtime-env.d.ts +3 -0
  34. package/dist/shared/runtime-env.d.ts.map +1 -0
  35. package/dist/shared/runtime-env.js +73 -0
  36. package/package.json +3 -3
@@ -1,3 +1,7 @@
1
+ export declare function collectHooksInstallConflicts(opts: {
2
+ gitRoot: string;
3
+ agentplaneDir: string;
4
+ }): Promise<string[]>;
1
5
  export declare function cmdHooksInstall(opts: {
2
6
  cwd: string;
3
7
  rootOverride?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/install.ts"],"names":[],"mappings":"AAgGA,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/install.ts"],"names":[],"mappings":"AA+CA,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBpB;AAmDD,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB"}
@@ -32,6 +32,25 @@ function resolveInstalledHookRunnerPath() {
32
32
  const activeBin = String(process.env.AGENTPLANE_RUNTIME_ACTIVE_BIN ?? "").trim();
33
33
  return activeBin || resolveAgentplaneBinPath();
34
34
  }
35
+ export async function collectHooksInstallConflicts(opts) {
36
+ const hooksDir = await resolveGitHooksDir(opts.gitRoot);
37
+ const conflicts = [];
38
+ const shimPath = path.join(opts.agentplaneDir, "bin", "agentplane");
39
+ if (await fileExists(shimPath)) {
40
+ const managed = await fileIsManaged(shimPath, SHIM_MARKER);
41
+ if (!managed)
42
+ conflicts.push(shimPath);
43
+ }
44
+ for (const hook of HOOK_NAMES) {
45
+ const hookPath = path.join(hooksDir, hook);
46
+ if (!(await fileExists(hookPath)))
47
+ continue;
48
+ const managed = await fileIsManaged(hookPath, HOOK_MARKER);
49
+ if (!managed)
50
+ conflicts.push(hookPath);
51
+ }
52
+ return conflicts;
53
+ }
35
54
  function shimScriptText(installedRunnerPath) {
36
55
  return [
37
56
  "#!/usr/bin/env sh",
@@ -1 +1 @@
1
- {"version":3,"file":"run.pre-push.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.pre-push.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAyBhD,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMxB;AA+TD,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB3E"}
1
+ {"version":3,"file":"run.pre-push.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/run.pre-push.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAyBhD,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMxB;AAiUD,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB3E"}
@@ -4,6 +4,7 @@ import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { fileExists } from "../../cli/fs-utils.js";
6
6
  import { resolveAgentplaneRepoScriptPath } from "../../shared/package-paths.js";
7
+ import { resolvePreferredNodeExecutable, withPreferredRuntimePath, } from "../../shared/runtime-env.js";
7
8
  function resolveBundledPrePushHookScriptPath() {
8
9
  return resolveAgentplaneRepoScriptPath("run-pre-push-hook.mjs");
9
10
  }
@@ -45,7 +46,7 @@ function runHookCommand(gitRoot, command, args) {
45
46
  command,
46
47
  args,
47
48
  cwd: gitRoot,
48
- env: process.env,
49
+ env: withPreferredRuntimePath(process.env),
49
50
  stdout: "inherit",
50
51
  stderr: "inherit",
51
52
  reject: false,
@@ -222,7 +223,9 @@ function runInternalPrePushHook(gitRoot, stdin) {
222
223
  if (isReleasePush) {
223
224
  const releaseNotesScript = path.join(gitRoot, "scripts", "check-release-notes.mjs");
224
225
  if (fileExistsSync(releaseNotesScript)) {
225
- const notesExitCode = runHookCommand(gitRoot, "node", ["scripts/check-release-notes.mjs"]);
226
+ const notesExitCode = runHookCommand(gitRoot, resolvePreferredNodeExecutable(process.env), [
227
+ "scripts/check-release-notes.mjs",
228
+ ]);
226
229
  if (notesExitCode !== 0)
227
230
  return notesExitCode;
228
231
  }
@@ -1,5 +1,9 @@
1
1
  import { type InstalledRecipesFile } from "@agentplaneorg/recipes";
2
+ type ValidateInstalledRecipesFileOptions = {
3
+ dropInvalidEntries?: boolean;
4
+ };
2
5
  export declare function readInstalledRecipesFile(filePath: string): Promise<InstalledRecipesFile>;
3
- export declare function readAndMigrateInstalledRecipesFile(filePath: string): Promise<InstalledRecipesFile>;
6
+ export declare function readAndMigrateInstalledRecipesFile(filePath: string, opts?: ValidateInstalledRecipesFileOptions): Promise<InstalledRecipesFile>;
4
7
  export declare function writeInstalledRecipesFile(filePath: string, file: InstalledRecipesFile): Promise<void>;
8
+ export {};
5
9
  //# sourceMappingURL=installed-recipes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAgDhC,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS9F;AAED,wBAAsB,kCAAkC,CACtD,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,oBAAoB,CAAC,CAc/B;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
1
+ {"version":3,"file":"installed-recipes.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/installed-recipes.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAMhC,KAAK,mCAAmC,GAAG;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAgEF,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAS9F;AAED,wBAAsB,kCAAkC,CACtD,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,mCAAmC,GACzC,OAAO,CAAC,oBAAoB,CAAC,CAc/B;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -5,7 +5,39 @@ import { normalizeRecipeTags, validateRecipeManifest, } from "@agentplaneorg/rec
5
5
  import { invalidFieldMessage } from "../../../cli/output.js";
6
6
  import { isRecord } from "../../../shared/guards.js";
7
7
  import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
8
- function validateInstalledRecipesFile(raw) {
8
+ function normalizeInstalledRecipeEntry(entry, opts) {
9
+ if (!isRecord(entry)) {
10
+ if (opts?.dropInvalidEntries)
11
+ return null;
12
+ throw new Error(invalidFieldMessage("recipes.json.recipes[]", "object"));
13
+ }
14
+ let manifest;
15
+ try {
16
+ manifest = validateRecipeManifest(entry.manifest);
17
+ }
18
+ catch (error) {
19
+ if (opts?.dropInvalidEntries)
20
+ return null;
21
+ throw error;
22
+ }
23
+ const id = typeof entry.id === "string" ? entry.id.trim() : manifest.id;
24
+ const version = typeof entry.version === "string" ? entry.version.trim() : manifest.version;
25
+ const source = typeof entry.source === "string" ? entry.source.trim() : "";
26
+ const installedAt = typeof entry.installed_at === "string" ? entry.installed_at.trim() : "";
27
+ if (!id || !version || !source || !installedAt) {
28
+ if (opts?.dropInvalidEntries)
29
+ return null;
30
+ throw new Error(invalidFieldMessage("recipes.json.recipes[]", "id, version, source, installed_at"));
31
+ }
32
+ if (id !== manifest.id || version !== manifest.version) {
33
+ if (opts?.dropInvalidEntries)
34
+ return null;
35
+ throw new Error(invalidFieldMessage("recipes.json.recipes[]", "id/version match manifest"));
36
+ }
37
+ const tags = normalizeRecipeTags(entry.tags ?? manifest.tags ?? []);
38
+ return { id, version, source, installed_at: installedAt, tags, manifest };
39
+ }
40
+ function validateInstalledRecipesFile(raw, opts) {
9
41
  if (!isRecord(raw))
10
42
  throw new Error(invalidFieldMessage("recipes.json", "object"));
11
43
  if (raw.schema_version !== 1)
@@ -13,22 +45,9 @@ function validateInstalledRecipesFile(raw) {
13
45
  if (!Array.isArray(raw.recipes))
14
46
  throw new Error(invalidFieldMessage("recipes.json.recipes", "array"));
15
47
  const updatedAt = typeof raw.updated_at === "string" ? raw.updated_at : "";
16
- const recipes = raw.recipes
17
- .filter((entry) => isRecord(entry))
18
- .map((entry) => {
19
- const manifest = validateRecipeManifest(entry.manifest);
20
- const id = typeof entry.id === "string" ? entry.id.trim() : manifest.id;
21
- const version = typeof entry.version === "string" ? entry.version.trim() : manifest.version;
22
- const source = typeof entry.source === "string" ? entry.source.trim() : "";
23
- const installedAt = typeof entry.installed_at === "string" ? entry.installed_at.trim() : "";
24
- if (!id || !version || !source || !installedAt) {
25
- throw new Error(invalidFieldMessage("recipes.json.recipes[]", "id, version, source, installed_at"));
26
- }
27
- if (id !== manifest.id || version !== manifest.version) {
28
- throw new Error(invalidFieldMessage("recipes.json.recipes[]", "id/version match manifest"));
29
- }
30
- const tags = normalizeRecipeTags(entry.tags ?? manifest.tags ?? []);
31
- return { id, version, source, installed_at: installedAt, tags, manifest };
48
+ const recipes = raw.recipes.flatMap((entry) => {
49
+ const normalized = normalizeInstalledRecipeEntry(entry, opts);
50
+ return normalized ? [normalized] : [];
32
51
  });
33
52
  return { schema_version: 1, updated_at: updatedAt, recipes };
34
53
  }
@@ -54,10 +73,10 @@ export async function readInstalledRecipesFile(filePath) {
54
73
  throw err;
55
74
  }
56
75
  }
57
- export async function readAndMigrateInstalledRecipesFile(filePath) {
76
+ export async function readAndMigrateInstalledRecipesFile(filePath, opts) {
58
77
  try {
59
78
  const raw = JSON.parse(await readFile(filePath, "utf8"));
60
- const normalized = sortInstalledRecipes(validateInstalledRecipesFile(raw));
79
+ const normalized = sortInstalledRecipes(validateInstalledRecipesFile(raw, opts));
61
80
  if (installedRecipesNeedMigration(raw, normalized)) {
62
81
  await mkdir(path.dirname(filePath), { recursive: true });
63
82
  await writeJsonStableIfChanged(filePath, normalized);
@@ -1 +1 @@
1
- {"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AASA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED,wBAAsB,8BAA8B,CAClD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,wBAAgB,YAAY,IAAI,MAAM,CAAC,UAAU,CAOhD"}
1
+ {"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AAaA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED,wBAAsB,8BAA8B,CAClD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,wBAAgB,YAAY,IAAI,MAAM,CAAC,UAAU,CAOhD"}
@@ -3,6 +3,7 @@ import { readFile, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { exitCodeForError } from "../../cli/exit-codes.js";
5
5
  import { CliError } from "../../shared/errors.js";
6
+ import { resolvePreferredNodeExecutable, withPreferredRuntimePath, } from "../../shared/runtime-env.js";
6
7
  import { execFileAsync } from "@agentplaneorg/core/process";
7
8
  import { gitEnv } from "@agentplaneorg/core/git";
8
9
  export async function replacePackageVersionInFile(pkgJsonPath, nextVersion) {
@@ -75,7 +76,7 @@ export async function maybeUpdateBunLockfile(gitRoot, fileExists) {
75
76
  try {
76
77
  await execFileAsync("bun", ["install", "--ignore-scripts"], {
77
78
  cwd: gitRoot,
78
- env: process.env,
79
+ env: withPreferredRuntimePath(process.env),
79
80
  maxBuffer: 50 * 1024 * 1024,
80
81
  });
81
82
  }
@@ -97,9 +98,9 @@ export async function maybeRefreshGeneratedReference(gitRoot, fileExists) {
97
98
  if (!(await fileExists(scriptPath)))
98
99
  return false;
99
100
  try {
100
- await execFileAsync("node", [scriptPath], {
101
+ await execFileAsync(resolvePreferredNodeExecutable(process.env), [scriptPath], {
101
102
  cwd: gitRoot,
102
- env: process.env,
103
+ env: withPreferredRuntimePath(process.env),
103
104
  maxBuffer: 20 * 1024 * 1024,
104
105
  });
105
106
  }
@@ -132,5 +133,5 @@ export function cleanHookEnv() {
132
133
  delete env.AGENTPLANE_STATUS_TO;
133
134
  delete env.AGENTPLANE_AGENT_ID;
134
135
  env.AGENTPLANE_ALLOW_CONFIG = "1";
135
- return env;
136
+ return withPreferredRuntimePath(env);
136
137
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/apply.pipeline/mutation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAU,UAAU,EAAyB,MAAM,yBAAyB,CAAC;AAYpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGrF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA6DlC;AAED,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAgBjC"}
1
+ {"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../../../../src/commands/release/apply.pipeline/mutation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAU,UAAU,EAAyB,MAAM,yBAAyB,CAAC;AAYpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGrF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAuElC;AAED,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAgBjC"}
@@ -14,9 +14,14 @@ export async function applyReleaseMutation(opts) {
14
14
  ]);
15
15
  const shouldUpdateTestkitAgentplaneDependency = (await fileExists(opts.testkitPkgPath)) &&
16
16
  (await packageDependencyExists(opts.testkitPkgPath, "agentplane"));
17
+ const shouldUpdateTestkitCoreDependency = (await fileExists(opts.testkitPkgPath)) &&
18
+ (await packageDependencyExists(opts.testkitPkgPath, "@agentplaneorg/core"));
17
19
  if (shouldUpdateTestkitAgentplaneDependency) {
18
20
  await replacePackageDependencyVersion(opts.testkitPkgPath, "agentplane", opts.nextVersion);
19
21
  }
22
+ if (shouldUpdateTestkitCoreDependency) {
23
+ await replacePackageDependencyVersion(opts.testkitPkgPath, "@agentplaneorg/core", opts.nextVersion);
24
+ }
20
25
  const expectedCliVersionPersisted = await maybePersistExpectedCliVersion(opts.agentplaneDir, opts.nextVersion);
21
26
  await maybeUpdateBunLockfile(opts.gitRoot, fileExists);
22
27
  const generatedReferenceExists = await maybeRefreshGeneratedReference(opts.gitRoot, fileExists);
@@ -26,7 +31,7 @@ export async function applyReleaseMutation(opts) {
26
31
  "packages/recipes/package.json",
27
32
  path.relative(opts.gitRoot, opts.notesPath),
28
33
  ];
29
- if (shouldUpdateTestkitAgentplaneDependency) {
34
+ if (shouldUpdateTestkitAgentplaneDependency || shouldUpdateTestkitCoreDependency) {
30
35
  stagePaths.push("packages/testkit/package.json");
31
36
  }
32
37
  if (expectedCliVersionPersisted) {
@@ -1 +1 @@
1
- {"version":3,"file":"apply.preflight.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.preflight.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5D;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAE3D;AAaD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAuBjE;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBxE;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAW7E;AAoBD,wBAAsB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;AAED,wBAAsB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exitCodeForError } from "../../cli/exit-codes.js";
4
4
  import { withDiagnosticContext } from "../shared/diagnostics.js";
5
5
  import { CliError } from "../../shared/errors.js";
6
+ import { resolvePreferredNodeExecutable, withPreferredRuntimePath, } from "../../shared/runtime-env.js";
6
7
  import { execFileAsync } from "@agentplaneorg/core/process";
7
8
  import { gitEnv } from "@agentplaneorg/core/git";
8
9
  export async function fileExists(p) {
@@ -270,9 +271,9 @@ export async function ensureRemoteTagDoesNotExist(gitRoot, remote, tag, commandL
270
271
  export async function ensureNpmVersionsAvailable(gitRoot, version, commandLabel = "release apply") {
271
272
  const scriptPath = path.join(gitRoot, "scripts", "check-npm-version-availability.mjs");
272
273
  try {
273
- await execFileAsync("node", [scriptPath, "--version", version], {
274
+ await execFileAsync(resolvePreferredNodeExecutable(process.env), [scriptPath, "--version", version], {
274
275
  cwd: gitRoot,
275
- env: process.env,
276
+ env: withPreferredRuntimePath(process.env),
276
277
  maxBuffer: 10 * 1024 * 1024,
277
278
  });
278
279
  }
@@ -299,13 +300,13 @@ export async function ensureNpmVersionsAvailable(gitRoot, version, commandLabel
299
300
  async function runReleasePrepublishPhase(gitRoot, phase) {
300
301
  await execFileAsync("bun", ["run", `release:prepublish:${phase}`], {
301
302
  cwd: gitRoot,
302
- env: {
303
+ env: withPreferredRuntimePath({
303
304
  ...process.env,
304
305
  GIT_AUTHOR_NAME: process.env.GIT_AUTHOR_NAME ?? "agentplane-release",
305
306
  GIT_AUTHOR_EMAIL: process.env.GIT_AUTHOR_EMAIL ?? "agentplane-release@example.com",
306
307
  GIT_COMMITTER_NAME: process.env.GIT_COMMITTER_NAME ?? "agentplane-release",
307
308
  GIT_COMMITTER_EMAIL: process.env.GIT_COMMITTER_EMAIL ?? "agentplane-release@example.com",
308
- },
309
+ }),
309
310
  maxBuffer: 200 * 1024 * 1024,
310
311
  });
311
312
  }
@@ -0,0 +1,3 @@
1
+ export { PROMPT_MODULE_CONTRACT_SCHEMA_VERSION, type PromptModule, type PromptModuleAddress, type PromptModuleConflictPolicy, type PromptModuleContentKind, type PromptModuleContractSchemaVersion, type PromptModuleDependency, type PromptModuleGraph, type PromptModuleGraphNode, type PromptModuleLoadCondition, type PromptModuleMergeMode, type PromptModuleMergePolicy, type PromptModuleMutability, type PromptModuleNamespace, type PromptModuleOwner, type PromptModuleProvenance, type PromptModuleReference, type PromptModuleSlot, type PromptModuleSourceKind, type PromptModuleSurface, type PromptModuleTarget, } from "./model.js";
2
+ export type { PromptModuleAddMutation, PromptModuleBindMutation, PromptModuleBinding, PromptModuleBindingKind, PromptModuleDisableMutation, PromptModuleMutation, PromptModuleMutationBase, PromptModuleMutationSet, PromptModuleMutationSource, PromptModuleMutationWhen, PromptModulePatchMutation, PromptModuleReplaceMutation, PromptModuleSelector, PromptModuleStructuredPatch, PromptModuleValidator, PromptModuleValidatorMutation, PromptModuleValidatorPhase, } from "./mutations.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/prompt-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,EACtC,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export { PROMPT_MODULE_CONTRACT_SCHEMA_VERSION, } from "./model.js";
@@ -0,0 +1,89 @@
1
+ export declare const PROMPT_MODULE_CONTRACT_SCHEMA_VERSION: 1;
2
+ export type PromptModuleContractSchemaVersion = typeof PROMPT_MODULE_CONTRACT_SCHEMA_VERSION;
3
+ export type PromptModuleNamespace = "framework" | "project" | "runtime" | `recipe.${string}`;
4
+ export type PromptModuleSurface = "gateway" | "policy" | "agent_profile" | "runner" | "validator" | "template";
5
+ export type PromptModuleTarget = "AGENTS.md" | "CLAUDE.md" | ".agentplane/policy" | ".agentplane/agents" | "runner.bundle" | "recipe.manifest" | "generated.artifact";
6
+ export type PromptModuleSlot = "frontmatter" | "purpose" | "startup" | "commands" | "load_rules" | "source_of_truth" | "hard_constraint" | "body" | "example" | "identity" | "inputs" | "outputs" | "permissions" | "workflow" | "cli_notes" | "context" | "schema" | "check" | "partial" | "file";
7
+ export type PromptModuleAddress = {
8
+ /**
9
+ * Canonical stable address, for example
10
+ * `framework/gateway/AGENTS.md/load_rules/base`.
11
+ */
12
+ value: string;
13
+ namespace: PromptModuleNamespace;
14
+ surface: PromptModuleSurface;
15
+ target: PromptModuleTarget;
16
+ slot: PromptModuleSlot;
17
+ name: string;
18
+ };
19
+ export type PromptModuleOwner = {
20
+ kind: "framework";
21
+ package_name: "agentplane";
22
+ version?: string;
23
+ } | {
24
+ kind: "project";
25
+ project_root?: string;
26
+ } | {
27
+ kind: "recipe";
28
+ recipe_id: string;
29
+ version?: string;
30
+ } | {
31
+ kind: "runtime";
32
+ adapter_id?: string;
33
+ };
34
+ export type PromptModuleContentKind = "markdown" | "json" | "text" | "typescript" | "command";
35
+ export type PromptModuleMutability = "locked" | "replaceable" | "extendable" | "append_only";
36
+ export type PromptModuleMergeMode = "pick_one" | "replace" | "prepend" | "append" | "merge_object" | "union_by_id";
37
+ export type PromptModuleConflictPolicy = "error" | "highest_precedence" | "last_writer_wins" | "keep_all";
38
+ export type PromptModuleMergePolicy = {
39
+ mode: PromptModuleMergeMode;
40
+ conflict: PromptModuleConflictPolicy;
41
+ precedence?: number;
42
+ };
43
+ export type PromptModuleLoadCondition = {
44
+ workflow_modes?: ("direct" | "branch_pr")[];
45
+ policy_gateways?: ("codex" | "claude")[];
46
+ roles?: string[];
47
+ commands?: string[];
48
+ task_tags_any?: string[];
49
+ repo_types?: string[];
50
+ recipe_ids?: string[];
51
+ };
52
+ export type PromptModuleSourceKind = "framework_builtin" | "project_file" | "recipe_asset" | "generated" | "runtime";
53
+ export type PromptModuleProvenance = {
54
+ source_kind: PromptModuleSourceKind;
55
+ source_ref: string;
56
+ recipe_id?: string;
57
+ recipe_version?: string;
58
+ generated_by?: string;
59
+ content_hash?: string;
60
+ };
61
+ export type PromptModuleDependency = {
62
+ address: string;
63
+ required: boolean;
64
+ };
65
+ export type PromptModule<TContent = string | Record<string, unknown>> = {
66
+ schema_version: PromptModuleContractSchemaVersion;
67
+ address: PromptModuleAddress;
68
+ owner: PromptModuleOwner;
69
+ title: string;
70
+ summary?: string;
71
+ content_kind: PromptModuleContentKind;
72
+ content: TContent;
73
+ mutability: PromptModuleMutability;
74
+ merge: PromptModuleMergePolicy;
75
+ load?: PromptModuleLoadCondition;
76
+ dependencies?: PromptModuleDependency[];
77
+ provenance: PromptModuleProvenance;
78
+ };
79
+ export type PromptModuleReference = Pick<PromptModule, "address" | "owner" | "provenance">;
80
+ export type PromptModuleGraphNode = {
81
+ module: PromptModule;
82
+ replaces?: string[];
83
+ extends?: string[];
84
+ };
85
+ export type PromptModuleGraph = {
86
+ schema_version: PromptModuleContractSchemaVersion;
87
+ nodes: PromptModuleGraphNode[];
88
+ };
89
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/runtime/prompt-modules/model.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,EAAG,CAAU,CAAC;AAEhE,MAAM,MAAM,iCAAiC,GAAG,OAAO,qCAAqC,CAAC;AAE7F,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,MAAM,EAAE,CAAC;AAE7F,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,QAAQ,GACR,eAAe,GACf,QAAQ,GACR,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,MAAM,kBAAkB,GAC1B,WAAW,GACX,WAAW,GACX,oBAAoB,GACpB,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,SAAS,GACT,SAAS,GACT,UAAU,GACV,YAAY,GACZ,iBAAiB,GACjB,iBAAiB,GACjB,MAAM,GACN,SAAS,GACT,UAAU,GACV,QAAQ,GACR,SAAS,GACT,aAAa,GACb,UAAU,GACV,WAAW,GACX,SAAS,GACT,QAAQ,GACR,OAAO,GACP,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,qBAAqB,CAAC;IACjC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACD;IACE,IAAI,EAAE,SAAS,CAA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AC;CAChC,CAAC"}
@@ -0,0 +1 @@
1
+ export const PROMPT_MODULE_CONTRACT_SCHEMA_VERSION = 1;
@@ -0,0 +1,103 @@
1
+ import type { PromptModule, PromptModuleAddress, PromptModuleDependency, PromptModuleLoadCondition, PromptModuleMergePolicy, PromptModuleMutability, PromptModuleOwner, PromptModuleProvenance, PromptModuleSlot, PromptModuleSurface, PromptModuleTarget } from "./model.js";
2
+ export type PromptModuleSelector = {
3
+ address?: string;
4
+ namespace?: PromptModuleAddress["namespace"];
5
+ surface?: PromptModuleSurface;
6
+ target?: PromptModuleTarget;
7
+ slot?: PromptModuleSlot;
8
+ owner?: PromptModuleOwner["kind"];
9
+ recipe_id?: string;
10
+ };
11
+ export type PromptModuleMutationWhen = PromptModuleLoadCondition & {
12
+ module_present?: string[];
13
+ module_absent?: string[];
14
+ };
15
+ export type PromptModuleMutationSource = {
16
+ owner: PromptModuleOwner;
17
+ provenance: PromptModuleProvenance;
18
+ };
19
+ export type PromptModuleStructuredPatch<TContent = string | Record<string, unknown>> = {
20
+ title?: string;
21
+ summary?: string | null;
22
+ content?: TContent;
23
+ mutability?: PromptModuleMutability;
24
+ merge?: PromptModuleMergePolicy;
25
+ load?: PromptModuleLoadCondition | null;
26
+ dependencies?: PromptModuleDependency[] | null;
27
+ provenance?: PromptModuleProvenance;
28
+ };
29
+ export type PromptModuleBindingKind = "extends" | "replaces" | "requires" | "feeds" | "validates";
30
+ export type PromptModuleBinding = {
31
+ id: string;
32
+ kind: PromptModuleBindingKind;
33
+ from: string;
34
+ to: string;
35
+ order?: number;
36
+ required?: boolean;
37
+ when?: PromptModuleMutationWhen;
38
+ };
39
+ export type PromptModuleValidatorPhase = "resolve" | "compile" | "emit" | "doctor";
40
+ export type PromptModuleValidator = {
41
+ id: string;
42
+ phase: PromptModuleValidatorPhase;
43
+ kind: "required_module";
44
+ target: PromptModuleSelector;
45
+ required: true;
46
+ when?: PromptModuleMutationWhen;
47
+ } | {
48
+ id: string;
49
+ phase: PromptModuleValidatorPhase;
50
+ kind: "forbidden_module";
51
+ target: PromptModuleSelector;
52
+ required: true;
53
+ when?: PromptModuleMutationWhen;
54
+ } | {
55
+ id: string;
56
+ phase: PromptModuleValidatorPhase;
57
+ kind: "required_command";
58
+ command: string;
59
+ required: boolean;
60
+ when?: PromptModuleMutationWhen;
61
+ };
62
+ export type PromptModuleMutationBase = {
63
+ id: string;
64
+ source: PromptModuleMutationSource;
65
+ when?: PromptModuleMutationWhen;
66
+ reason?: string;
67
+ };
68
+ export type PromptModuleAddMutation = PromptModuleMutationBase & {
69
+ op: "add_module";
70
+ module: PromptModule;
71
+ };
72
+ export type PromptModuleReplaceMutation = PromptModuleMutationBase & {
73
+ op: "replace_module";
74
+ target: PromptModuleSelector;
75
+ module: PromptModule;
76
+ };
77
+ export type PromptModulePatchMutation<TContent = string | Record<string, unknown>> = PromptModuleMutationBase & {
78
+ op: "patch_module";
79
+ target: PromptModuleSelector;
80
+ patch: PromptModuleStructuredPatch<TContent>;
81
+ };
82
+ export type PromptModuleDisableMutation = PromptModuleMutationBase & {
83
+ op: "disable_module";
84
+ target: PromptModuleSelector;
85
+ };
86
+ export type PromptModuleBindMutation = PromptModuleMutationBase & {
87
+ op: "bind_module";
88
+ binding: PromptModuleBinding;
89
+ };
90
+ export type PromptModuleValidatorMutation = PromptModuleMutationBase & ({
91
+ op: "add_validator";
92
+ validator: PromptModuleValidator;
93
+ } | {
94
+ op: "disable_validator";
95
+ validator_id: string;
96
+ });
97
+ export type PromptModuleMutation = PromptModuleAddMutation | PromptModuleReplaceMutation | PromptModulePatchMutation | PromptModuleDisableMutation | PromptModuleBindMutation | PromptModuleValidatorMutation;
98
+ export type PromptModuleMutationSet = {
99
+ schema_version: 1;
100
+ recipe_id?: string;
101
+ mutations: PromptModuleMutation[];
102
+ };
103
+ //# sourceMappingURL=mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/runtime/prompt-modules/mutations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Ac,EAAE,CAAC,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,oBAAoB,EAAE,CAAC;CACnC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function withPreferredRuntimePath(baseEnv?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
2
+ export declare function resolvePreferredNodeExecutable(baseEnv?: NodeJS.ProcessEnv): string;
3
+ //# sourceMappingURL=runtime-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-env.d.ts","sourceRoot":"","sources":["../../src/shared/runtime-env.ts"],"names":[],"mappings":"AAUA,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM,CAAC,UAAU,CA0BnB;AA8BD,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAe/F"}
@@ -0,0 +1,73 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ function pushUnique(entries, value) {
5
+ const trimmed = value.trim();
6
+ if (!trimmed || entries.includes(trimmed))
7
+ return;
8
+ entries.push(trimmed);
9
+ }
10
+ export function withPreferredRuntimePath(baseEnv = process.env) {
11
+ const env = { ...baseEnv };
12
+ const pathEntries = String(baseEnv.PATH ?? "")
13
+ .split(path.delimiter)
14
+ .map((entry) => entry.trim())
15
+ .filter(Boolean);
16
+ const preferredEntries = [];
17
+ pushUnique(preferredEntries, path.dirname(resolvePreferredNodeExecutable(baseEnv)));
18
+ const bunInstallDir = String(baseEnv.BUN_INSTALL ?? "").trim();
19
+ if (bunInstallDir) {
20
+ pushUnique(preferredEntries, path.join(bunInstallDir, "bin"));
21
+ }
22
+ const homeDir = String(baseEnv.HOME ?? os.homedir() ?? "").trim();
23
+ if (homeDir) {
24
+ pushUnique(preferredEntries, path.join(homeDir, ".bun", "bin"));
25
+ }
26
+ for (const entry of pathEntries) {
27
+ pushUnique(preferredEntries, entry);
28
+ }
29
+ env.PATH = preferredEntries.join(path.delimiter);
30
+ return env;
31
+ }
32
+ function isExecutableFile(filePath) {
33
+ try {
34
+ return fs.statSync(filePath).isFile();
35
+ }
36
+ catch {
37
+ return false;
38
+ }
39
+ }
40
+ function readLatestNvmNodeBin(homeDir) {
41
+ const versionsDir = path.join(homeDir, ".nvm", "versions", "node");
42
+ let entries = [];
43
+ try {
44
+ entries = fs.readdirSync(versionsDir);
45
+ }
46
+ catch {
47
+ return null;
48
+ }
49
+ const latest = entries
50
+ .map((entry) => entry.trim())
51
+ .filter(Boolean)
52
+ .toSorted()
53
+ .at(-1);
54
+ if (!latest)
55
+ return null;
56
+ const candidate = path.join(versionsDir, latest, "bin", "node");
57
+ return isExecutableFile(candidate) ? candidate : null;
58
+ }
59
+ export function resolvePreferredNodeExecutable(baseEnv = process.env) {
60
+ const homeDir = String(baseEnv.HOME ?? os.homedir() ?? "").trim();
61
+ const candidates = [
62
+ path.join(String(baseEnv.NVM_BIN ?? "").trim(), "node"),
63
+ path.join(String(baseEnv.VOLTA_HOME ?? "").trim(), "bin", "node"),
64
+ homeDir ? readLatestNvmNodeBin(homeDir) : null,
65
+ process.execPath,
66
+ ];
67
+ for (const candidate of candidates) {
68
+ if (typeof candidate === "string" && candidate.trim() && isExecutableFile(candidate)) {
69
+ return candidate;
70
+ }
71
+ }
72
+ return process.execPath;
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentplane",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
4
4
  "description": "Agent Plane CLI for task workflows, recipes, and project automation.",
5
5
  "keywords": [
6
6
  "agentplane",
@@ -56,8 +56,8 @@
56
56
  "prepublishOnly": "node ../../scripts/enforce-github-publish.mjs && npm run prepack"
57
57
  },
58
58
  "dependencies": {
59
- "@agentplaneorg/core": "0.3.22",
60
- "@agentplaneorg/recipes": "0.3.22",
59
+ "@agentplaneorg/core": "0.3.23",
60
+ "@agentplaneorg/recipes": "0.3.23",
61
61
  "@clack/prompts": "^1.2.0",
62
62
  "yauzl": "^2.10.0",
63
63
  "zod": "^3",