agentplane 0.3.21 → 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 (57) hide show
  1. package/assets/policy/incidents.md +4 -0
  2. package/dist/.build-manifest.json +67 -42
  3. package/dist/cli/bootstrap-guide.d.ts +1 -0
  4. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  5. package/dist/cli/bootstrap-guide.js +3 -2
  6. package/dist/cli/command-guide.d.ts.map +1 -1
  7. package/dist/cli/command-guide.js +5 -4
  8. package/dist/cli/run-cli/commands/init/orchestrate-v2.d.ts.map +1 -1
  9. package/dist/cli/run-cli/commands/init/orchestrate-v2.js +10 -2
  10. package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -1
  11. package/dist/cli/run-cli/commands/init/orchestrate.js +10 -2
  12. package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
  13. package/dist/cli/run-cli/commands/init/recipes.js +3 -1
  14. package/dist/cli.js +356 -341
  15. package/dist/commands/branch/work-start.hook-shim.d.ts.map +1 -1
  16. package/dist/commands/branch/work-start.hook-shim.js +16 -4
  17. package/dist/commands/doctor/hook-readiness.d.ts +2 -0
  18. package/dist/commands/doctor/hook-readiness.d.ts.map +1 -0
  19. package/dist/commands/doctor/hook-readiness.js +171 -0
  20. package/dist/commands/doctor/workspace.d.ts.map +1 -1
  21. package/dist/commands/doctor/workspace.js +2 -1
  22. package/dist/commands/guard/impl/commit.d.ts.map +1 -1
  23. package/dist/commands/guard/impl/commit.js +26 -0
  24. package/dist/commands/hooks/install.d.ts +4 -0
  25. package/dist/commands/hooks/install.d.ts.map +1 -1
  26. package/dist/commands/hooks/install.js +35 -4
  27. package/dist/commands/hooks/run.pre-push.d.ts.map +1 -1
  28. package/dist/commands/hooks/run.pre-push.js +237 -13
  29. package/dist/commands/recipes/impl/installed-recipes.d.ts +5 -1
  30. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  31. package/dist/commands/recipes/impl/installed-recipes.js +38 -19
  32. package/dist/commands/release/apply.mutation.d.ts.map +1 -1
  33. package/dist/commands/release/apply.mutation.js +5 -4
  34. package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -1
  35. package/dist/commands/release/apply.pipeline/mutation.js +6 -1
  36. package/dist/commands/release/apply.preflight.d.ts.map +1 -1
  37. package/dist/commands/release/apply.preflight.js +5 -4
  38. package/dist/commands/task/derive.command.js +1 -1
  39. package/dist/commands/task/finish-execute.d.ts.map +1 -1
  40. package/dist/commands/task/finish-execute.js +8 -1
  41. package/dist/commands/task/shared/transitions.d.ts.map +1 -1
  42. package/dist/commands/task/shared/transitions.js +11 -2
  43. package/dist/commands/task/verify-command-shared.d.ts.map +1 -1
  44. package/dist/commands/task/verify-command-shared.js +8 -2
  45. package/dist/runtime/prompt-modules/index.d.ts +3 -0
  46. package/dist/runtime/prompt-modules/index.d.ts.map +1 -0
  47. package/dist/runtime/prompt-modules/index.js +1 -0
  48. package/dist/runtime/prompt-modules/model.d.ts +89 -0
  49. package/dist/runtime/prompt-modules/model.d.ts.map +1 -0
  50. package/dist/runtime/prompt-modules/model.js +1 -0
  51. package/dist/runtime/prompt-modules/mutations.d.ts +103 -0
  52. package/dist/runtime/prompt-modules/mutations.d.ts.map +1 -0
  53. package/dist/runtime/prompt-modules/mutations.js +1 -0
  54. package/dist/shared/runtime-env.d.ts +3 -0
  55. package/dist/shared/runtime-env.d.ts.map +1 -0
  56. package/dist/shared/runtime-env.js +73 -0
  57. package/package.json +3 -3
@@ -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;AA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K,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,uBAAuB,CAAC;IACtC,OAAO,EAAE,QAAQ,CAAC;IAClB,UAAU,EAAE,sBAAsB,CAAC;IACnC,KAAK,EAAE,uBAAuB,CAAC;IAC/B,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,YAAY,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACxC,UAAU,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC,CAAC;AAE3F,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,iCAAiC,CAAC;IAClD,KAAK,EAAE,qBAAqB,EAAE,CAAC;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.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACp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AK,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;CAC9C,CAAC;AAEJ,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG;IACnE,EAAE,EAAE,gBAAgB,CAAC;IACrB,MAAM,EAAE,oBAAoB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,GAAG;IAChE,EAAE,EAAE,aAAa,CAAC;IAClB,OAAO,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,GAClE,CACI;IACE,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,qBAAqB,CAAC;CAClC,GACD;IACE,EAAE,EAAE,mBAAmB,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC;AAEJ,MAAM,MAAM,oBAAoB,GAC5B,uBAAuB,GACvB,2BAA2B,GAC3B,yBAAyB,GACzB,2BAA2B,GAC3B,wBAAwB,GACxB,6BAA6B,CAAC;AAElC,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,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.21",
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.21",
60
- "@agentplaneorg/recipes": "0.3.21",
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",