agentplane 0.2.25 → 0.2.26

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 (166) hide show
  1. package/bin/agentplane.js +91 -54
  2. package/dist/.build-manifest.json +11 -0
  3. package/dist/backends/task-backend/local-backend.d.ts +2 -0
  4. package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
  5. package/dist/backends/task-backend/local-backend.js +12 -1
  6. package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
  7. package/dist/backends/task-backend/redmine/mapping.js +26 -1
  8. package/dist/backends/task-backend/redmine-backend.d.ts +4 -0
  9. package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
  10. package/dist/backends/task-backend/redmine-backend.js +92 -9
  11. package/dist/backends/task-backend/shared/types.d.ts +1 -0
  12. package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
  13. package/dist/backends/task-index.d.ts.map +1 -1
  14. package/dist/backends/task-index.js +8 -1
  15. package/dist/cli/command-guide.d.ts.map +1 -1
  16. package/dist/cli/command-guide.js +21 -8
  17. package/dist/cli/command-snippets.d.ts +24 -0
  18. package/dist/cli/command-snippets.d.ts.map +1 -0
  19. package/dist/cli/command-snippets.js +23 -0
  20. package/dist/cli/reason-codes.d.ts +9 -0
  21. package/dist/cli/reason-codes.d.ts.map +1 -0
  22. package/dist/cli/reason-codes.js +79 -0
  23. package/dist/cli/recipes-bundled.d.ts +1 -0
  24. package/dist/cli/recipes-bundled.d.ts.map +1 -1
  25. package/dist/cli/recipes-bundled.js +4 -1
  26. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  27. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  28. package/dist/cli/run-cli/command-catalog.js +40 -1
  29. package/dist/cli/run-cli/commands/config.d.ts +5 -0
  30. package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
  31. package/dist/cli/run-cli/commands/config.js +86 -1
  32. package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
  33. package/dist/cli/run-cli/commands/core.js +55 -0
  34. package/dist/cli/run-cli/commands/init/recipes.d.ts +5 -1
  35. package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
  36. package/dist/cli/run-cli/commands/init/recipes.js +24 -4
  37. package/dist/cli/run-cli/commands/init/write-workflow.d.ts +7 -0
  38. package/dist/cli/run-cli/commands/init/write-workflow.d.ts.map +1 -0
  39. package/dist/cli/run-cli/commands/init/write-workflow.js +52 -0
  40. package/dist/cli/run-cli/commands/init.d.ts +2 -1
  41. package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
  42. package/dist/cli/run-cli/commands/init.js +104 -54
  43. package/dist/cli/run-cli.d.ts.map +1 -1
  44. package/dist/cli/run-cli.js +70 -1
  45. package/dist/commands/backend/sync.command.d.ts.map +1 -1
  46. package/dist/commands/backend/sync.command.js +7 -6
  47. package/dist/commands/backend.d.ts.map +1 -1
  48. package/dist/commands/backend.js +2 -0
  49. package/dist/commands/doctor.run.d.ts.map +1 -1
  50. package/dist/commands/doctor.run.js +96 -10
  51. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  52. package/dist/commands/guard/impl/commands.js +12 -6
  53. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  54. package/dist/commands/recipes/impl/commands/install.js +36 -13
  55. package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
  56. package/dist/commands/recipes/impl/scenario.js +25 -0
  57. package/dist/commands/recipes/impl/types.d.ts +4 -0
  58. package/dist/commands/recipes/impl/types.d.ts.map +1 -1
  59. package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
  60. package/dist/commands/scenario/impl/commands.js +74 -3
  61. package/dist/commands/scenario/impl/report.d.ts +8 -0
  62. package/dist/commands/scenario/impl/report.d.ts.map +1 -1
  63. package/dist/commands/scenario/impl/report.js +1 -0
  64. package/dist/commands/shared/reconcile-check.d.ts +7 -0
  65. package/dist/commands/shared/reconcile-check.d.ts.map +1 -0
  66. package/dist/commands/shared/reconcile-check.js +60 -0
  67. package/dist/commands/sync.command.d.ts.map +1 -1
  68. package/dist/commands/sync.command.js +9 -2
  69. package/dist/commands/task/finish.d.ts.map +1 -1
  70. package/dist/commands/task/finish.js +2 -0
  71. package/dist/commands/task/list.d.ts.map +1 -1
  72. package/dist/commands/task/list.js +2 -1
  73. package/dist/commands/task/list.spec.d.ts.map +1 -1
  74. package/dist/commands/task/list.spec.js +7 -0
  75. package/dist/commands/task/next.d.ts.map +1 -1
  76. package/dist/commands/task/next.js +2 -1
  77. package/dist/commands/task/next.spec.d.ts.map +1 -1
  78. package/dist/commands/task/next.spec.js +7 -0
  79. package/dist/commands/task/search.d.ts.map +1 -1
  80. package/dist/commands/task/search.js +2 -1
  81. package/dist/commands/task/search.spec.d.ts.map +1 -1
  82. package/dist/commands/task/search.spec.js +7 -0
  83. package/dist/commands/task/shared.d.ts +7 -0
  84. package/dist/commands/task/shared.d.ts.map +1 -1
  85. package/dist/commands/task/shared.js +21 -1
  86. package/dist/commands/task/verify-record.d.ts.map +1 -1
  87. package/dist/commands/task/verify-record.js +2 -0
  88. package/dist/commands/workflow-build.command.d.ts +8 -0
  89. package/dist/commands/workflow-build.command.d.ts.map +1 -0
  90. package/dist/commands/workflow-build.command.js +96 -0
  91. package/dist/commands/workflow-playbook.command.d.ts +10 -0
  92. package/dist/commands/workflow-playbook.command.d.ts.map +1 -0
  93. package/dist/commands/workflow-playbook.command.js +174 -0
  94. package/dist/commands/workflow-restore.command.d.ts +5 -0
  95. package/dist/commands/workflow-restore.command.d.ts.map +1 -0
  96. package/dist/commands/workflow-restore.command.js +30 -0
  97. package/dist/commands/workflow.command.d.ts +6 -0
  98. package/dist/commands/workflow.command.d.ts.map +1 -0
  99. package/dist/commands/workflow.command.js +36 -0
  100. package/dist/harness/dynamic-tool-contract.d.ts +29 -0
  101. package/dist/harness/dynamic-tool-contract.d.ts.map +1 -0
  102. package/dist/harness/dynamic-tool-contract.js +86 -0
  103. package/dist/harness/hooks-lifecycle.d.ts +27 -0
  104. package/dist/harness/hooks-lifecycle.d.ts.map +1 -0
  105. package/dist/harness/hooks-lifecycle.js +67 -0
  106. package/dist/harness/index.d.ts +9 -0
  107. package/dist/harness/index.d.ts.map +1 -0
  108. package/dist/harness/index.js +8 -0
  109. package/dist/harness/reconcile.d.ts +37 -0
  110. package/dist/harness/reconcile.d.ts.map +1 -0
  111. package/dist/harness/reconcile.js +42 -0
  112. package/dist/harness/retry-policy.d.ts +31 -0
  113. package/dist/harness/retry-policy.d.ts.map +1 -0
  114. package/dist/harness/retry-policy.js +33 -0
  115. package/dist/harness/scheduler.d.ts +18 -0
  116. package/dist/harness/scheduler.d.ts.map +1 -0
  117. package/dist/harness/scheduler.js +55 -0
  118. package/dist/harness/state-machine.d.ts +17 -0
  119. package/dist/harness/state-machine.d.ts.map +1 -0
  120. package/dist/harness/state-machine.js +70 -0
  121. package/dist/harness/token-accounting.d.ts +19 -0
  122. package/dist/harness/token-accounting.d.ts.map +1 -0
  123. package/dist/harness/token-accounting.js +77 -0
  124. package/dist/harness/workspace-safety.d.ts +14 -0
  125. package/dist/harness/workspace-safety.d.ts.map +1 -0
  126. package/dist/harness/workspace-safety.js +62 -0
  127. package/dist/recipes/bundled-recipes.d.ts +4 -0
  128. package/dist/recipes/bundled-recipes.d.ts.map +1 -1
  129. package/dist/recipes/bundled-recipes.js +11 -0
  130. package/dist/shared/errors.d.ts +6 -0
  131. package/dist/shared/errors.d.ts.map +1 -1
  132. package/dist/shared/errors.js +1 -0
  133. package/dist/workflow-runtime/build.d.ts +4 -0
  134. package/dist/workflow-runtime/build.d.ts.map +1 -0
  135. package/dist/workflow-runtime/build.js +114 -0
  136. package/dist/workflow-runtime/enforcement.d.ts +3 -0
  137. package/dist/workflow-runtime/enforcement.d.ts.map +1 -0
  138. package/dist/workflow-runtime/enforcement.js +10 -0
  139. package/dist/workflow-runtime/file-ops.d.ts +11 -0
  140. package/dist/workflow-runtime/file-ops.d.ts.map +1 -0
  141. package/dist/workflow-runtime/file-ops.js +248 -0
  142. package/dist/workflow-runtime/fix.d.ts +9 -0
  143. package/dist/workflow-runtime/fix.d.ts.map +1 -0
  144. package/dist/workflow-runtime/fix.js +107 -0
  145. package/dist/workflow-runtime/index.d.ts +11 -0
  146. package/dist/workflow-runtime/index.d.ts.map +1 -0
  147. package/dist/workflow-runtime/index.js +10 -0
  148. package/dist/workflow-runtime/markdown.d.ts +10 -0
  149. package/dist/workflow-runtime/markdown.d.ts.map +1 -0
  150. package/dist/workflow-runtime/markdown.js +147 -0
  151. package/dist/workflow-runtime/observability.d.ts +12 -0
  152. package/dist/workflow-runtime/observability.d.ts.map +1 -0
  153. package/dist/workflow-runtime/observability.js +14 -0
  154. package/dist/workflow-runtime/paths.d.ts +3 -0
  155. package/dist/workflow-runtime/paths.d.ts.map +1 -0
  156. package/dist/workflow-runtime/paths.js +11 -0
  157. package/dist/workflow-runtime/template.d.ts +7 -0
  158. package/dist/workflow-runtime/template.d.ts.map +1 -0
  159. package/dist/workflow-runtime/template.js +94 -0
  160. package/dist/workflow-runtime/types.d.ts +68 -0
  161. package/dist/workflow-runtime/types.d.ts.map +1 -0
  162. package/dist/workflow-runtime/types.js +1 -0
  163. package/dist/workflow-runtime/validate.d.ts +8 -0
  164. package/dist/workflow-runtime/validate.d.ts.map +1 -0
  165. package/dist/workflow-runtime/validate.js +331 -0
  166. package/package.json +3 -3
@@ -0,0 +1,23 @@
1
+ export const COMMAND_SNIPPETS = {
2
+ core: {
3
+ taskList: "agentplane task list",
4
+ taskShow: "agentplane task show <task-id>",
5
+ taskNew: 'agentplane task new --title "..." --description "..." --priority med --owner CODER --tag <tag>',
6
+ startTask: 'agentplane start <task-id> --author <ROLE> --body "Start: ..."',
7
+ verifyTask: 'agentplane verify <task-id> --ok|--rework --by <ROLE> --note "..."',
8
+ finishTask: 'agentplane finish <task-id> --author <ROLE> --body "Verified: ..." --commit <git-rev> --close-commit',
9
+ quickstart: "agentplane quickstart",
10
+ role: "agentplane role <ROLE>",
11
+ },
12
+ sync: {
13
+ pullConfigured: "agentplane sync --direction pull",
14
+ pushConfiguredWithYes: "agentplane sync --direction push --yes",
15
+ pullRedmineExplicit: "agentplane sync redmine --direction pull",
16
+ pushRedmineExplicitWithYes: "agentplane sync redmine --direction push --yes",
17
+ },
18
+ backendSync: {
19
+ pullLocal: "agentplane backend sync local --direction pull",
20
+ pullRedmine: "agentplane backend sync redmine --direction pull",
21
+ pushRedmineWithYes: "agentplane backend sync redmine --direction push --yes",
22
+ },
23
+ };
@@ -0,0 +1,9 @@
1
+ export type ReasonCodeCategory = "usage" | "reconcile" | "git" | "network" | "backend" | "validation";
2
+ export type ReasonCodeMeta = {
3
+ code: string;
4
+ category: ReasonCodeCategory;
5
+ summary: string;
6
+ action: string;
7
+ };
8
+ export declare function getReasonCodeMeta(code: string | undefined): ReasonCodeMeta | undefined;
9
+ //# sourceMappingURL=reason-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/cli/reason-codes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,WAAW,GACX,KAAK,GACL,SAAS,GACT,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6EF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAGtF"}
@@ -0,0 +1,79 @@
1
+ const REASON_CODE_MAP = {
2
+ usage_help: {
3
+ code: "usage_help",
4
+ category: "usage",
5
+ summary: "command invocation is incomplete or invalid",
6
+ action: "open command help and fix required args/flags",
7
+ },
8
+ sync_backend_mismatch: {
9
+ code: "sync_backend_mismatch",
10
+ category: "backend",
11
+ summary: "sync command backend id does not match active backend",
12
+ action: "inspect config and rerun sync for matching backend",
13
+ },
14
+ reconcile_git_state_unreadable: {
15
+ code: "reconcile_git_state_unreadable",
16
+ category: "reconcile",
17
+ summary: "reconcile guard cannot read git state",
18
+ action: "run git status and fix repository visibility/permissions",
19
+ },
20
+ reconcile_task_scan_failed: {
21
+ code: "reconcile_task_scan_failed",
22
+ category: "reconcile",
23
+ summary: "reconcile guard could not complete task scan",
24
+ action: "run strict task scan and resolve parse/read errors",
25
+ },
26
+ reconcile_task_scan_incomplete: {
27
+ code: "reconcile_task_scan_incomplete",
28
+ category: "reconcile",
29
+ summary: "task scan produced skipped files/warnings",
30
+ action: "resolve scan warnings before mutating commands",
31
+ },
32
+ git_branch_state: {
33
+ code: "git_branch_state",
34
+ category: "git",
35
+ summary: "branch command cannot determine branch state",
36
+ action: "inspect branch state and repository context",
37
+ },
38
+ git_index_state: {
39
+ code: "git_index_state",
40
+ category: "git",
41
+ summary: "commit command found problematic index/worktree state",
42
+ action: "inspect staged/unstaged changes and retry",
43
+ },
44
+ git_context: {
45
+ code: "git_context",
46
+ category: "git",
47
+ summary: "command requires valid git repository context",
48
+ action: "confirm repository root and tracked changes",
49
+ },
50
+ network_gate: {
51
+ code: "network_gate",
52
+ category: "network",
53
+ summary: "network access is blocked by policy or environment",
54
+ action: "recheck approvals/connectivity and retry",
55
+ },
56
+ backend_sync_config: {
57
+ code: "backend_sync_config",
58
+ category: "backend",
59
+ summary: "sync command failed due to backend configuration",
60
+ action: "inspect backend config and active backend settings",
61
+ },
62
+ backend_config: {
63
+ code: "backend_config",
64
+ category: "backend",
65
+ summary: "backend configuration is missing or invalid",
66
+ action: "inspect backend config under .agentplane/backends",
67
+ },
68
+ validation_preflight: {
69
+ code: "validation_preflight",
70
+ category: "validation",
71
+ summary: "input/config validation failed before execution",
72
+ action: "run preflight and fix reported validation issues",
73
+ },
74
+ };
75
+ export function getReasonCodeMeta(code) {
76
+ if (!code)
77
+ return undefined;
78
+ return REASON_CODE_MAP[code];
79
+ }
@@ -6,4 +6,5 @@ export type BundledRecipeInfo = {
6
6
  export declare function listBundledRecipes(): BundledRecipeInfo[];
7
7
  export declare function renderBundledRecipesHint(): string;
8
8
  export declare function validateBundledRecipesSelection(recipes: string[]): void;
9
+ export declare function getBundledRecipeSourcePath(recipeId: string): string | null;
9
10
  //# sourceMappingURL=recipes-bundled.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recipes-bundled.d.ts","sourceRoot":"","sources":["../../src/cli/recipes-bundled.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,wBAAgB,kBAAkB,IAAI,iBAAiB,EAAE,CAMxD;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAMjD;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAevE"}
1
+ {"version":3,"file":"recipes-bundled.d.ts","sourceRoot":"","sources":["../../src/cli/recipes-bundled.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,wBAAgB,kBAAkB,IAAI,iBAAiB,EAAE,CAMxD;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAMjD;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAevE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE1E"}
@@ -1,4 +1,4 @@
1
- import { BUNDLED_RECIPES_CATALOG } from "../recipes/bundled-recipes.js";
1
+ import { BUNDLED_RECIPES_CATALOG, resolveBundledRecipeSourcePath, } from "../recipes/bundled-recipes.js";
2
2
  import { CliError } from "../shared/errors.js";
3
3
  export function listBundledRecipes() {
4
4
  return BUNDLED_RECIPES_CATALOG.recipes.map((recipe) => ({
@@ -31,3 +31,6 @@ export function validateBundledRecipesSelection(recipes) {
31
31
  });
32
32
  }
33
33
  }
34
+ export function getBundledRecipeSourcePath(recipeId) {
35
+ return resolveBundledRecipeSourcePath(recipeId);
36
+ }
@@ -15,5 +15,5 @@ export type CommandEntry = {
15
15
  needsConfig: boolean;
16
16
  needsTaskContext: boolean;
17
17
  };
18
- export declare const COMMANDS: readonly [CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry];
18
+ export declare const COMMANDS: readonly [CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry];
19
19
  //# sourceMappingURL=command-catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/command-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAoGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEzE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,CAAC,sBAAsB,EAAE,MA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AAE,MAAM,SAAS,QAAQ,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgBF,eAAO,MAAM,QAAQ,m4CA+hBuB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { initSpec } from "./commands/init.js";
2
2
  import { agentsSpec, preflightSpec, quickstartSpec, roleSpec } from "./commands/core.js";
3
- import { configSetSpec, configShowSpec, modeGetSpec, modeSetSpec } from "./commands/config.js";
3
+ import { configSetSpec, configShowSpec, modeGetSpec, modeSetSpec, profileSetSpec, } from "./commands/config.js";
4
4
  import { ideSyncSpec } from "./commands/ide.js";
5
5
  import { taskNewSpec } from "../../commands/task/new.spec.js";
6
6
  import { taskListSpec } from "../../commands/task/list.spec.js";
@@ -62,6 +62,10 @@ import { verifySpec } from "../../commands/verify.spec.js";
62
62
  import { finishSpec } from "../../commands/finish.spec.js";
63
63
  import { readySpec } from "../../commands/ready.command.js";
64
64
  import { doctorSpec } from "../../commands/doctor.spec.js";
65
+ import { workflowSpec } from "../../commands/workflow.command.js";
66
+ import { workflowBuildSpec } from "../../commands/workflow-build.command.js";
67
+ import { workflowRestoreSpec } from "../../commands/workflow-restore.command.js";
68
+ import { workflowDebugSpec, workflowLandSpec, workflowSyncSpec, } from "../../commands/workflow-playbook.command.js";
65
69
  import { docsCliSpec } from "../../commands/docs/cli.command.js";
66
70
  import { hooksSpec } from "../../commands/hooks/hooks.command.js";
67
71
  import { hooksInstallSpec } from "../../commands/hooks/install.command.js";
@@ -150,6 +154,11 @@ export const COMMANDS = [
150
154
  needsConfig: true,
151
155
  needsTaskContext: false,
152
156
  }),
157
+ entry(profileSetSpec, (deps) => import("./commands/config.js").then((m) => m.makeRunProfileSetHandler(deps)), {
158
+ needsProject: true,
159
+ needsConfig: true,
160
+ needsTaskContext: false,
161
+ }),
153
162
  entry(ideSyncSpec, (deps) => import("./commands/ide.js").then((m) => m.makeRunIdeSyncHandler(deps)), {
154
163
  needsProject: true,
155
164
  needsConfig: true,
@@ -160,6 +169,36 @@ export const COMMANDS = [
160
169
  needsConfig: false,
161
170
  needsTaskContext: false,
162
171
  }),
172
+ entry(workflowSpec, () => import("../../commands/workflow.command.js").then((m) => m.runWorkflow), {
173
+ needsProject: false,
174
+ needsConfig: false,
175
+ needsTaskContext: false,
176
+ }),
177
+ entry(workflowBuildSpec, () => import("../../commands/workflow-build.command.js").then((m) => m.runWorkflowBuild), {
178
+ needsProject: true,
179
+ needsConfig: false,
180
+ needsTaskContext: false,
181
+ }),
182
+ entry(workflowRestoreSpec, () => import("../../commands/workflow-restore.command.js").then((m) => m.runWorkflowRestore), {
183
+ needsProject: true,
184
+ needsConfig: false,
185
+ needsTaskContext: false,
186
+ }),
187
+ entry(workflowDebugSpec, () => import("../../commands/workflow-playbook.command.js").then((m) => m.runWorkflowDebug), {
188
+ needsProject: true,
189
+ needsConfig: false,
190
+ needsTaskContext: false,
191
+ }),
192
+ entry(workflowSyncSpec, () => import("../../commands/workflow-playbook.command.js").then((m) => m.runWorkflowSync), {
193
+ needsProject: true,
194
+ needsConfig: false,
195
+ needsTaskContext: false,
196
+ }),
197
+ entry(workflowLandSpec, () => import("../../commands/workflow-playbook.command.js").then((m) => m.runWorkflowLand), {
198
+ needsProject: true,
199
+ needsConfig: false,
200
+ needsTaskContext: false,
201
+ }),
163
202
  entry(taskListSpec, (deps) => import("../../commands/task/list.run.js").then((m) => m.makeRunTaskListHandler(deps.getCtx))),
164
203
  entry(taskNextSpec, (deps) => import("../../commands/task/next.run.js").then((m) => m.makeRunTaskNextHandler(deps.getCtx))),
165
204
  entry(taskSearchSpec, (deps) => import("../../commands/task/search.run.js").then((m) => m.makeRunTaskSearchHandler(deps.getCtx))),
@@ -17,5 +17,10 @@ type ModeSetParsed = {
17
17
  };
18
18
  export declare const modeSetSpec: CommandSpec<ModeSetParsed>;
19
19
  export declare function makeRunModeSetHandler(deps: RunDeps): CommandHandler<ModeSetParsed>;
20
+ type ProfileSetParsed = {
21
+ profile: string;
22
+ };
23
+ export declare const profileSetSpec: CommandSpec<ProfileSetParsed>;
24
+ export declare function makeRunProfileSetHandler(deps: RunDeps): CommandHandler<ProfileSetParsed>;
20
25
  export {};
21
26
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAMxD,CAAC;AAcF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAExF;AAED,KAAK,eAAe,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,eAAe,CAgBtD,CAAC;AA6BF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,eAAe,CAAC,CAStF;AAED,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE3C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAMlD,CAAC;AAcF,wBAAgB,qBAAqB,CAAC,I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M,WAAW,EAAE,WAAW,CAAC,aAAa,CAgBlD,CAAC;AA0BF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAQlF;AAED,KAAK,gBAAgB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AA4C5C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAoBxD,CAAC;AAmCF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAQxF"}
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { saveConfig, setByDottedKey } from "@agentplaneorg/core";
2
+ import { buildExecutionProfile, saveConfig, setByDottedKey } from "@agentplaneorg/core";
3
3
  import { usageError } from "../../spec/errors.js";
4
4
  import { wrapCommand } from "./wrap-command.js";
5
5
  export const configShowSpec = {
@@ -117,3 +117,88 @@ export function makeRunModeSetHandler(deps) {
117
117
  deps,
118
118
  });
119
119
  }
120
+ const PROFILE_PRESETS = {
121
+ light: {
122
+ requirePlan: false,
123
+ requireNetwork: false,
124
+ requireVerify: false,
125
+ executionProfile: "aggressive",
126
+ strictUnsafeConfirm: false,
127
+ },
128
+ normal: {
129
+ requirePlan: true,
130
+ requireNetwork: true,
131
+ requireVerify: true,
132
+ executionProfile: "balanced",
133
+ strictUnsafeConfirm: false,
134
+ },
135
+ "full-harness": {
136
+ requirePlan: true,
137
+ requireNetwork: true,
138
+ requireVerify: true,
139
+ executionProfile: "conservative",
140
+ strictUnsafeConfirm: true,
141
+ },
142
+ };
143
+ function normalizeProfile(value) {
144
+ const normalized = value.trim().toLowerCase();
145
+ if (normalized === "light" || normalized === "vibecoder")
146
+ return "light";
147
+ if (normalized === "normal" || normalized === "manager")
148
+ return "normal";
149
+ if (normalized === "full-harness" || normalized === "developer" || normalized === "enterprise") {
150
+ return "full-harness";
151
+ }
152
+ return null;
153
+ }
154
+ export const profileSetSpec = {
155
+ id: ["profile", "set"],
156
+ group: "Config",
157
+ summary: "Apply setup profile presets to config.",
158
+ args: [{ name: "profile", required: true, valueHint: "<light|normal|full-harness>" }],
159
+ examples: [
160
+ { cmd: "agentplane profile set light", why: "Apply flexible defaults." },
161
+ { cmd: "agentplane profile set normal", why: "Apply balanced defaults." },
162
+ { cmd: "agentplane profile set full-harness", why: "Apply strict defaults." },
163
+ ],
164
+ parse: (raw) => ({ profile: String(raw.args.profile ?? "") }),
165
+ validate: (p) => {
166
+ if (!normalizeProfile(p.profile)) {
167
+ throw usageError({
168
+ spec: profileSetSpec,
169
+ command: "profile set",
170
+ message: `Invalid value for profile: ${p.profile} (expected: light|normal|full-harness)`,
171
+ });
172
+ }
173
+ },
174
+ };
175
+ async function cmdProfileSet(opts) {
176
+ return wrapCommand({
177
+ command: "profile set",
178
+ rootOverride: opts.rootOverride,
179
+ context: { profile: opts.profile },
180
+ }, async () => {
181
+ const resolved = await opts.deps.getResolvedProject("profile set");
182
+ const loaded = await opts.deps.getLoadedConfig("profile set");
183
+ const raw = { ...loaded.raw };
184
+ const preset = PROFILE_PRESETS[opts.profile];
185
+ const execution = buildExecutionProfile(preset.executionProfile, {
186
+ strictUnsafeConfirm: preset.strictUnsafeConfirm,
187
+ });
188
+ setByDottedKey(raw, "agents.approvals.require_plan", String(preset.requirePlan));
189
+ setByDottedKey(raw, "agents.approvals.require_network", String(preset.requireNetwork));
190
+ setByDottedKey(raw, "agents.approvals.require_verify", String(preset.requireVerify));
191
+ setByDottedKey(raw, "execution", JSON.stringify(execution));
192
+ await saveConfig(resolved.agentplaneDir, raw);
193
+ process.stdout.write(`${opts.profile}\n`);
194
+ return 0;
195
+ });
196
+ }
197
+ export function makeRunProfileSetHandler(deps) {
198
+ return (ctx, p) => cmdProfileSet({
199
+ cwd: ctx.cwd,
200
+ rootOverride: ctx.rootOverride,
201
+ profile: normalizeProfile(p.profile),
202
+ deps,
203
+ });
204
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/core.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIrD,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAcxD,CAAC;AA6BF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAE1D,CAAC;AAEF,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AACtC,KAAK,eAAe,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AA6L9D,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,eAAe,CAuCtD,CAAC;AA4CF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,eAAe,CAExD,CAAC;AAEF,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,UAAU,CAe5C,CAAC;AAoOF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,UAAU,CAE9C,CAAC;AAEF,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAMhD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,YAAY,CAAC,CA0FhF"}
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/core.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIrD,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAcxD,CAAC;AA6BF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAE1D,CAAC;AAEF,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AACtC,KAAK,eAAe,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAkP9D,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,eAAe,CAuCtD,CAAC;AAiDF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,eAAe,CAExD,CAAC;AAEF,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,UAAU,CAe5C,CAAC;AAoOF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,UAAU,CAE9C,CAAC;AAEF,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAMhD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,YAAY,CAAC,CA0FhF"}
@@ -9,6 +9,7 @@ import { CliError } from "../../../shared/errors.js";
9
9
  import { dedupeStrings } from "../../../shared/strings.js";
10
10
  import { usageError } from "../../spec/errors.js";
11
11
  import { listRoles, renderQuickstart, renderRole } from "../../command-guide.js";
12
+ import { isWorkflowEnforcementDisabled, validateWorkflowAtPath, workflowEnforcementEnvHint, } from "../../../workflow-runtime/index.js";
12
13
  import { toStringList } from "../../spec/parse-utils.js";
13
14
  import { wrapCommand } from "./wrap-command.js";
14
15
  export const quickstartSpec = {
@@ -95,6 +96,7 @@ function inferApprovals(config) {
95
96
  }
96
97
  async function buildPreflightReport(opts) {
97
98
  const nextActions = [];
99
+ const harnessHealthReasons = [];
98
100
  const quickstartText = renderQuickstart();
99
101
  const quickstartLoaded = {
100
102
  ok: quickstartText.trim().length > 0,
@@ -125,6 +127,7 @@ async function buildPreflightReport(opts) {
125
127
  command: "agentplane config show",
126
128
  reason: `config failed validation (${message})`,
127
129
  });
130
+ harnessHealthReasons.push("config_unavailable");
128
131
  }
129
132
  }
130
133
  let taskListLoaded = {
@@ -147,6 +150,46 @@ async function buildPreflightReport(opts) {
147
150
  command: "agentplane task list",
148
151
  reason: `task backend unavailable (${message})`,
149
152
  });
153
+ harnessHealthReasons.push("task_backend_unavailable");
154
+ }
155
+ }
156
+ let workflowLoaded = { ok: false, error: "project not resolved" };
157
+ if (resolved) {
158
+ if (isWorkflowEnforcementDisabled()) {
159
+ workflowLoaded = {
160
+ ok: true,
161
+ error: `workflow checks disabled via ${workflowEnforcementEnvHint()}`,
162
+ };
163
+ }
164
+ else {
165
+ try {
166
+ const workflowValidation = await validateWorkflowAtPath(resolved.gitRoot);
167
+ workflowLoaded = workflowValidation.ok
168
+ ? { ok: true }
169
+ : {
170
+ ok: false,
171
+ error: workflowValidation.diagnostics
172
+ .filter((d) => d.severity === "ERROR")
173
+ .map((d) => `${d.code}:${d.path}`)
174
+ .join(", "),
175
+ };
176
+ if (!workflowValidation.ok) {
177
+ harnessHealthReasons.push("workflow_contract_invalid");
178
+ nextActions.push({
179
+ command: "agentplane workflow build --validate --dry-run",
180
+ reason: "workflow contract is invalid",
181
+ });
182
+ }
183
+ }
184
+ catch (err) {
185
+ const message = compactError(err);
186
+ workflowLoaded = { ok: false, error: message };
187
+ harnessHealthReasons.push("workflow_contract_unreadable");
188
+ nextActions.push({
189
+ command: "agentplane workflow build --validate --dry-run",
190
+ reason: `cannot validate workflow (${message})`,
191
+ });
192
+ }
150
193
  }
151
194
  }
152
195
  let workingTree = {
@@ -166,6 +209,7 @@ async function buildPreflightReport(opts) {
166
209
  ]);
167
210
  workingTree = { ok: true, value: staged.length === 0 && unstagedTracked.length === 0 };
168
211
  if (!workingTree.value) {
212
+ harnessHealthReasons.push("working_tree_dirty");
169
213
  nextActions.push({
170
214
  command: "git status --short --untracked-files=no",
171
215
  reason: "tracked changes detected",
@@ -175,6 +219,7 @@ async function buildPreflightReport(opts) {
175
219
  catch (err) {
176
220
  const message = compactError(err);
177
221
  workingTree = { ok: false, error: message };
222
+ harnessHealthReasons.push("working_tree_unreadable");
178
223
  nextActions.push({
179
224
  command: "git status --short --untracked-files=no",
180
225
  reason: `cannot inspect git status (${message})`,
@@ -193,11 +238,16 @@ async function buildPreflightReport(opts) {
193
238
  project_detected: resolved !== null,
194
239
  config_loaded: configLoaded,
195
240
  quickstart_loaded: quickstartLoaded,
241
+ workflow_loaded: workflowLoaded,
196
242
  task_list_loaded: taskListLoaded,
197
243
  working_tree_clean_tracked: workingTree,
198
244
  current_branch: branch,
199
245
  workflow_mode: inferWorkflowMode(config),
200
246
  approvals: inferApprovals(config),
247
+ harness_health: {
248
+ status: harnessHealthReasons.length === 0 ? "ok" : "warn",
249
+ reasons: dedupeStrings(harnessHealthReasons),
250
+ },
201
251
  outside_repo_needed: false,
202
252
  next_actions: nextActions,
203
253
  };
@@ -256,10 +306,15 @@ async function cmdPreflight(opts) {
256
306
  process.stdout.write(`- project detected: ${report.project_detected ? "yes" : "no"}\n`);
257
307
  process.stdout.write(`- config loaded: ${probeYesNo(report.config_loaded)}\n`);
258
308
  process.stdout.write(`- quickstart loaded: ${probeYesNo(report.quickstart_loaded)}\n`);
309
+ process.stdout.write(`- workflow loaded: ${probeYesNo(report.workflow_loaded)}\n`);
259
310
  process.stdout.write(`- task list loaded: ${probeYesNo(report.task_list_loaded)}\n`);
260
311
  process.stdout.write(`- working tree clean (tracked-only): ${probeValueOrUnknown(report.working_tree_clean_tracked)}\n`);
261
312
  process.stdout.write(`- current git branch: ${probeValueOrUnknown(report.current_branch)}\n`);
262
313
  process.stdout.write(`- workflow_mode: ${report.workflow_mode}\n`);
314
+ process.stdout.write(`- harness engeneering health: ${report.harness_health.status}\n`);
315
+ if (report.harness_health.reasons.length > 0) {
316
+ process.stdout.write(` - reasons: ${report.harness_health.reasons.join(", ")}\n`);
317
+ }
263
318
  process.stdout.write("- approval gates:\n");
264
319
  process.stdout.write(` - require_plan: ${String(report.approvals.require_plan)}\n`);
265
320
  process.stdout.write(` - require_verify: ${String(report.approvals.require_verify)}\n`);
@@ -1,2 +1,6 @@
1
- export declare function maybeInstallBundledRecipes(recipes: string[]): void;
1
+ export declare function maybeInstallBundledRecipes(opts: {
2
+ recipes: string[];
3
+ cwd: string;
4
+ rootOverride?: string;
5
+ }): Promise<void>;
2
6
  //# sourceMappingURL=recipes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/recipes.ts"],"names":[],"mappings":"AAGA,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CASlE"}
1
+ {"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/recipes.ts"],"names":[],"mappings":"AAKA,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BhB"}
@@ -1,11 +1,31 @@
1
+ import { cmdRecipeInstall } from "../../../../commands/recipes.js";
1
2
  import { infoMessage } from "../../../output.js";
2
- import { listBundledRecipes } from "../../../recipes-bundled.js";
3
- export function maybeInstallBundledRecipes(recipes) {
4
- if (recipes.length === 0)
3
+ import { getBundledRecipeSourcePath, listBundledRecipes } from "../../../recipes-bundled.js";
4
+ import { CliError } from "../../../../shared/errors.js";
5
+ export async function maybeInstallBundledRecipes(opts) {
6
+ if (opts.recipes.length === 0)
5
7
  return;
6
8
  if (listBundledRecipes().length === 0) {
7
9
  process.stdout.write(`${infoMessage("bundled recipes are empty; nothing to install")}\n`);
8
10
  return;
9
11
  }
10
- process.stdout.write(`${infoMessage("bundled recipe install is not implemented; skipping")}\n`);
12
+ for (const recipeId of opts.recipes) {
13
+ const sourcePath = getBundledRecipeSourcePath(recipeId);
14
+ if (!sourcePath) {
15
+ throw new CliError({
16
+ exitCode: 3,
17
+ code: "E_VALIDATION",
18
+ message: `Bundled recipe ${recipeId} is missing source_path in bundled catalog`,
19
+ });
20
+ }
21
+ await cmdRecipeInstall({
22
+ cwd: opts.cwd,
23
+ rootOverride: opts.rootOverride,
24
+ source: { type: "path", value: sourcePath },
25
+ index: undefined,
26
+ refresh: false,
27
+ onConflict: "overwrite",
28
+ yes: true,
29
+ });
30
+ }
11
31
  }
@@ -0,0 +1,7 @@
1
+ export declare function ensureInitWorkflow(opts: {
2
+ gitRoot: string;
3
+ workflowMode: "direct" | "branch_pr";
4
+ }): Promise<{
5
+ installPaths: string[];
6
+ }>;
7
+ //# sourceMappingURL=write-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-workflow.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-workflow.ts"],"names":[],"mappings":"AASA,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,QAAQ,GAAG,WAAW,CAAC;CACtC,GAAG,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoDtC"}
@@ -0,0 +1,52 @@
1
+ import { CliError } from "../../../../shared/errors.js";
2
+ import { DEFAULT_WORKFLOW_TEMPLATE, buildWorkflowFromTemplates, diagnosticsSummary, publishWorkflowCandidate, resolveWorkflowPaths, } from "../../../../workflow-runtime/index.js";
3
+ export async function ensureInitWorkflow(opts) {
4
+ const built = buildWorkflowFromTemplates({
5
+ baseTemplate: DEFAULT_WORKFLOW_TEMPLATE,
6
+ runtimeContext: {
7
+ workflow: {
8
+ mode: opts.workflowMode,
9
+ version: 1,
10
+ },
11
+ runtime: {
12
+ repo_root: opts.gitRoot,
13
+ timestamp: new Date().toISOString(),
14
+ },
15
+ },
16
+ });
17
+ if (built.diagnostics.some((d) => d.severity === "ERROR")) {
18
+ throw new CliError({
19
+ exitCode: 3,
20
+ code: "E_VALIDATION",
21
+ message: `Failed to generate WORKFLOW.md: ${diagnosticsSummary(built.diagnostics)}`,
22
+ context: {
23
+ diagnostics: built.diagnostics.map((d) => ({
24
+ severity: d.severity,
25
+ code: d.code,
26
+ path: d.path,
27
+ message: d.message,
28
+ })),
29
+ },
30
+ });
31
+ }
32
+ const published = await publishWorkflowCandidate(opts.gitRoot, built.text);
33
+ if (!published.ok) {
34
+ throw new CliError({
35
+ exitCode: 3,
36
+ code: "E_VALIDATION",
37
+ message: `Failed to publish WORKFLOW.md: ${diagnosticsSummary(published.diagnostics)}`,
38
+ context: {
39
+ diagnostics: published.diagnostics.map((d) => ({
40
+ severity: d.severity,
41
+ code: d.code,
42
+ path: d.path,
43
+ message: d.message,
44
+ })),
45
+ },
46
+ });
47
+ }
48
+ const workflowPaths = resolveWorkflowPaths(opts.gitRoot);
49
+ return {
50
+ installPaths: [workflowPaths.workflowPath, workflowPaths.lastKnownGoodPath],
51
+ };
52
+ }
@@ -1,7 +1,7 @@
1
1
  import type { CommandHandler, CommandSpec } from "../../spec/spec.js";
2
2
  import { type ExecutionProfile } from "@agentplaneorg/core";
3
3
  type InitFlags = {
4
- setupProfile?: "developer" | "vibecoder" | "manager" | "enterprise";
4
+ setupProfile?: SetupProfilePreset;
5
5
  ide?: "codex" | "cursor" | "windsurf";
6
6
  workflow?: "direct" | "branch_pr";
7
7
  backend?: "local" | "redmine";
@@ -17,6 +17,7 @@ type InitFlags = {
17
17
  backup?: boolean;
18
18
  yes: boolean;
19
19
  };
20
+ type SetupProfilePreset = "light" | "normal" | "full-harness";
20
21
  type InitParsed = Omit<InitFlags, "yes"> & {
21
22
  yes: boolean;
22
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/init.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAa7B,KAAK,SAAS,GAAG;IACf,YAAY,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;IACpE,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACtC,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAmFF,KAAK,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5D,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,UAAU,CAwL5C,CAA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