agentplane 0.3.5 → 0.3.7

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 (256) hide show
  1. package/README.md +103 -75
  2. package/assets/AGENTS.md +4 -2
  3. package/bin/dist-guard.js +13 -3
  4. package/bin/runtime-watch.d.ts +1 -0
  5. package/bin/runtime-watch.js +22 -5
  6. package/bin/stale-dist-policy.js +9 -2
  7. package/dist/.build-manifest.json +251 -821
  8. package/dist/adapters/task-backend/task-backend-adapter.d.ts +2 -2
  9. package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
  10. package/dist/adapters/task-backend/task-backend-adapter.js +2 -2
  11. package/dist/backends/task-backend/local-backend.d.ts +7 -5
  12. package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
  13. package/dist/backends/task-backend/local-backend.js +79 -7
  14. package/dist/backends/task-backend/redmine/env.d.ts +1 -1
  15. package/dist/backends/task-backend/redmine/env.d.ts.map +1 -1
  16. package/dist/backends/task-backend/redmine/env.js +3 -0
  17. package/dist/backends/task-backend/redmine/inspect.d.ts +11 -0
  18. package/dist/backends/task-backend/redmine/inspect.d.ts.map +1 -0
  19. package/dist/backends/task-backend/redmine/inspect.js +75 -0
  20. package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
  21. package/dist/backends/task-backend/redmine/mapping.js +21 -2
  22. package/dist/backends/task-backend/redmine/state.d.ts +17 -0
  23. package/dist/backends/task-backend/redmine/state.d.ts.map +1 -0
  24. package/dist/backends/task-backend/redmine/state.js +95 -0
  25. package/dist/backends/task-backend/redmine-backend.d.ts +10 -16
  26. package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
  27. package/dist/backends/task-backend/redmine-backend.js +205 -15
  28. package/dist/backends/task-backend/shared/constants.d.ts +1 -1
  29. package/dist/backends/task-backend/shared/constants.js +1 -1
  30. package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
  31. package/dist/backends/task-backend/shared/record.js +20 -1
  32. package/dist/backends/task-backend/shared/types.d.ts +42 -4
  33. package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
  34. package/dist/backends/task-backend/shared.d.ts +1 -1
  35. package/dist/backends/task-backend/shared.d.ts.map +1 -1
  36. package/dist/backends/task-backend.d.ts +1 -1
  37. package/dist/backends/task-backend.d.ts.map +1 -1
  38. package/dist/backends/task-backend.test-helpers.d.ts +4 -0
  39. package/dist/backends/task-backend.test-helpers.d.ts.map +1 -0
  40. package/dist/backends/task-backend.test-helpers.js +33 -0
  41. package/dist/backends/task-index.d.ts.map +1 -1
  42. package/dist/backends/task-index.js +1 -0
  43. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  44. package/dist/cli/bootstrap-guide.js +1 -0
  45. package/dist/cli/command-guide.d.ts.map +1 -1
  46. package/dist/cli/command-guide.js +3 -2
  47. package/dist/cli/reason-codes.d.ts.map +1 -1
  48. package/dist/cli/reason-codes.js +30 -0
  49. package/dist/cli/run-cli/command-catalog/core.d.ts +3 -0
  50. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -0
  51. package/dist/cli/run-cli/command-catalog/core.js +137 -0
  52. package/dist/cli/run-cli/command-catalog/lifecycle.d.ts +3 -0
  53. package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -0
  54. package/dist/cli/run-cli/command-catalog/lifecycle.js +52 -0
  55. package/dist/cli/run-cli/command-catalog/project.d.ts +3 -0
  56. package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -0
  57. package/dist/cli/run-cli/command-catalog/project.js +80 -0
  58. package/dist/cli/run-cli/command-catalog/shared.d.ts +19 -0
  59. package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -0
  60. package/dist/cli/run-cli/command-catalog/shared.js +9 -0
  61. package/dist/cli/run-cli/command-catalog/task.d.ts +3 -0
  62. package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -0
  63. package/dist/cli/run-cli/command-catalog/task.js +85 -0
  64. package/dist/cli/run-cli/command-catalog.d.ts +3 -18
  65. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  66. package/dist/cli/run-cli/command-catalog.js +8 -337
  67. package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
  68. package/dist/cli/run-cli/commands/ide.js +64 -2
  69. package/dist/cli/run-cli/commands/init/ui.d.ts.map +1 -1
  70. package/dist/cli/run-cli/commands/init/ui.js +33 -13
  71. package/dist/cli/run-cli/commands/init/write-env.d.ts.map +1 -1
  72. package/dist/cli/run-cli/commands/init/write-env.js +12 -0
  73. package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +3 -0
  74. package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +1 -0
  75. package/dist/cli/run-cli.core.pr-flow.test-helpers.js +41 -0
  76. package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +2 -0
  77. package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +1 -0
  78. package/dist/cli/run-cli.core.tasks.test-helpers.js +6 -0
  79. package/dist/cli/run-cli.test-helpers.d.ts +3 -0
  80. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  81. package/dist/cli/run-cli.test-helpers.js +140 -6
  82. package/dist/commands/backend/sync.command.d.ts +5 -1
  83. package/dist/commands/backend/sync.command.d.ts.map +1 -1
  84. package/dist/commands/backend/sync.command.js +67 -3
  85. package/dist/commands/backend.d.ts +22 -0
  86. package/dist/commands/backend.d.ts.map +1 -1
  87. package/dist/commands/backend.js +110 -1
  88. package/dist/commands/commit.spec.d.ts.map +1 -1
  89. package/dist/commands/commit.spec.js +31 -7
  90. package/dist/commands/doctor/runtime.d.ts.map +1 -1
  91. package/dist/commands/doctor/runtime.js +3 -6
  92. package/dist/commands/doctor/workspace.d.ts +8 -0
  93. package/dist/commands/doctor/workspace.d.ts.map +1 -1
  94. package/dist/commands/doctor/workspace.js +127 -3
  95. package/dist/commands/guard/commit.command.d.ts.map +1 -1
  96. package/dist/commands/guard/commit.command.js +30 -6
  97. package/dist/commands/guard/impl/allow.d.ts +9 -0
  98. package/dist/commands/guard/impl/allow.d.ts.map +1 -1
  99. package/dist/commands/guard/impl/allow.js +26 -10
  100. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  101. package/dist/commands/guard/impl/commands.js +146 -18
  102. package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
  103. package/dist/commands/guard/impl/comment-commit.js +2 -0
  104. package/dist/commands/hooks/index.d.ts.map +1 -1
  105. package/dist/commands/hooks/index.js +8 -35
  106. package/dist/commands/recipes/impl/apply.d.ts +4 -0
  107. package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
  108. package/dist/commands/recipes/impl/apply.js +34 -0
  109. package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
  110. package/dist/commands/recipes/impl/commands/explain.js +70 -11
  111. package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
  112. package/dist/commands/recipes/impl/commands/info.js +24 -12
  113. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  114. package/dist/commands/recipes/impl/commands/install.js +32 -36
  115. package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
  116. package/dist/commands/recipes/impl/commands/list.js +7 -4
  117. package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
  118. package/dist/commands/recipes/impl/commands/remove.js +9 -11
  119. package/dist/commands/recipes/impl/constants.d.ts +2 -0
  120. package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
  121. package/dist/commands/recipes/impl/constants.js +2 -0
  122. package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
  123. package/dist/commands/recipes/impl/manifest.js +219 -23
  124. package/dist/commands/recipes/impl/normalize.d.ts +3 -0
  125. package/dist/commands/recipes/impl/normalize.d.ts.map +1 -1
  126. package/dist/commands/recipes/impl/normalize.js +28 -24
  127. package/dist/commands/recipes/impl/paths.d.ts +9 -0
  128. package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
  129. package/dist/commands/recipes/impl/paths.js +10 -1
  130. package/dist/commands/recipes/impl/project-installed-recipes.d.ts +7 -0
  131. package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -0
  132. package/dist/commands/recipes/impl/project-installed-recipes.js +102 -0
  133. package/dist/commands/recipes/impl/resolver.d.ts +20 -0
  134. package/dist/commands/recipes/impl/resolver.d.ts.map +1 -0
  135. package/dist/commands/recipes/impl/resolver.js +220 -0
  136. package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
  137. package/dist/commands/recipes/impl/scenario.js +40 -11
  138. package/dist/commands/recipes/impl/types.d.ts +145 -16
  139. package/dist/commands/recipes/impl/types.d.ts.map +1 -1
  140. package/dist/commands/recipes/install.spec.d.ts.map +1 -1
  141. package/dist/commands/recipes/install.spec.js +3 -2
  142. package/dist/commands/recipes.d.ts +6 -4
  143. package/dist/commands/recipes.d.ts.map +1 -1
  144. package/dist/commands/recipes.js +5 -3
  145. package/dist/commands/recipes.test-helpers.d.ts +185 -0
  146. package/dist/commands/recipes.test-helpers.d.ts.map +1 -0
  147. package/dist/commands/recipes.test-helpers.js +339 -0
  148. package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
  149. package/dist/commands/scenario/impl/commands.js +192 -336
  150. package/dist/commands/scenario/info.command.d.ts.map +1 -1
  151. package/dist/commands/scenario/info.command.js +7 -2
  152. package/dist/commands/scenario/list.command.js +2 -2
  153. package/dist/commands/scenario/run.command.d.ts.map +1 -1
  154. package/dist/commands/scenario/run.command.js +7 -2
  155. package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
  156. package/dist/commands/shared/reconcile-check.js +77 -2
  157. package/dist/commands/shared/task-backend.d.ts +1 -1
  158. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  159. package/dist/commands/shared/task-backend.js +9 -0
  160. package/dist/commands/shared/task-store.d.ts +92 -2
  161. package/dist/commands/shared/task-store.d.ts.map +1 -1
  162. package/dist/commands/shared/task-store.js +405 -43
  163. package/dist/commands/task/block.d.ts.map +1 -1
  164. package/dist/commands/task/block.js +84 -46
  165. package/dist/commands/task/close-duplicate.d.ts.map +1 -1
  166. package/dist/commands/task/close-duplicate.js +12 -37
  167. package/dist/commands/task/close-noop.d.ts.map +1 -1
  168. package/dist/commands/task/close-noop.js +12 -30
  169. package/dist/commands/task/close-shared.d.ts +14 -0
  170. package/dist/commands/task/close-shared.d.ts.map +1 -0
  171. package/dist/commands/task/close-shared.js +73 -0
  172. package/dist/commands/task/comment.d.ts.map +1 -1
  173. package/dist/commands/task/comment.js +34 -21
  174. package/dist/commands/task/derive.command.d.ts +1 -0
  175. package/dist/commands/task/derive.command.d.ts.map +1 -1
  176. package/dist/commands/task/derive.command.js +15 -2
  177. package/dist/commands/task/derive.d.ts +1 -0
  178. package/dist/commands/task/derive.d.ts.map +1 -1
  179. package/dist/commands/task/derive.js +27 -4
  180. package/dist/commands/task/doc-set.command.d.ts +2 -1
  181. package/dist/commands/task/doc-set.command.d.ts.map +1 -1
  182. package/dist/commands/task/doc-set.command.js +36 -4
  183. package/dist/commands/task/doc-template.d.ts.map +1 -1
  184. package/dist/commands/task/doc-template.js +2 -7
  185. package/dist/commands/task/doc.command.js +1 -1
  186. package/dist/commands/task/doc.d.ts +2 -1
  187. package/dist/commands/task/doc.d.ts.map +1 -1
  188. package/dist/commands/task/doc.js +139 -76
  189. package/dist/commands/task/finish.d.ts.map +1 -1
  190. package/dist/commands/task/finish.js +142 -80
  191. package/dist/commands/task/migrate-doc.d.ts +15 -0
  192. package/dist/commands/task/migrate-doc.d.ts.map +1 -1
  193. package/dist/commands/task/migrate-doc.js +128 -43
  194. package/dist/commands/task/new.d.ts.map +1 -1
  195. package/dist/commands/task/new.js +3 -1
  196. package/dist/commands/task/plan-set.command.js +1 -1
  197. package/dist/commands/task/plan.command.d.ts +8 -0
  198. package/dist/commands/task/plan.command.d.ts.map +1 -0
  199. package/dist/commands/task/plan.command.js +37 -0
  200. package/dist/commands/task/plan.d.ts.map +1 -1
  201. package/dist/commands/task/plan.js +198 -101
  202. package/dist/commands/task/set-status.command.d.ts.map +1 -1
  203. package/dist/commands/task/set-status.command.js +1 -1
  204. package/dist/commands/task/set-status.d.ts.map +1 -1
  205. package/dist/commands/task/set-status.js +115 -35
  206. package/dist/commands/task/shared/dependencies.d.ts +1 -0
  207. package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
  208. package/dist/commands/task/shared/dependencies.js +10 -0
  209. package/dist/commands/task/shared/docs.d.ts +1 -0
  210. package/dist/commands/task/shared/docs.d.ts.map +1 -1
  211. package/dist/commands/task/shared/docs.js +8 -1
  212. package/dist/commands/task/shared/transitions.d.ts +17 -2
  213. package/dist/commands/task/shared/transitions.d.ts.map +1 -1
  214. package/dist/commands/task/shared/transitions.js +20 -13
  215. package/dist/commands/task/shared.d.ts +3 -3
  216. package/dist/commands/task/shared.d.ts.map +1 -1
  217. package/dist/commands/task/shared.js +3 -3
  218. package/dist/commands/task/start.d.ts.map +1 -1
  219. package/dist/commands/task/start.js +101 -71
  220. package/dist/commands/task/task.command.d.ts +8 -0
  221. package/dist/commands/task/task.command.d.ts.map +1 -0
  222. package/dist/commands/task/task.command.js +71 -0
  223. package/dist/commands/task/verify-command-shared.d.ts +16 -0
  224. package/dist/commands/task/verify-command-shared.d.ts.map +1 -0
  225. package/dist/commands/task/verify-command-shared.js +53 -0
  226. package/dist/commands/task/verify-ok.command.d.ts +2 -6
  227. package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
  228. package/dist/commands/task/verify-ok.command.js +8 -50
  229. package/dist/commands/task/verify-record.d.ts.map +1 -1
  230. package/dist/commands/task/verify-record.js +124 -145
  231. package/dist/commands/task/verify-rework.command.d.ts +2 -6
  232. package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
  233. package/dist/commands/task/verify-rework.command.js +8 -50
  234. package/dist/commands/upgrade/apply.d.ts +2 -0
  235. package/dist/commands/upgrade/apply.d.ts.map +1 -1
  236. package/dist/commands/upgrade/apply.js +33 -1
  237. package/dist/commands/upgrade.command.d.ts.map +1 -1
  238. package/dist/commands/upgrade.command.js +25 -0
  239. package/dist/commands/upgrade.d.ts +1 -0
  240. package/dist/commands/upgrade.d.ts.map +1 -1
  241. package/dist/commands/upgrade.js +34 -0
  242. package/dist/commands/verify.spec.d.ts.map +1 -1
  243. package/dist/commands/verify.spec.js +3 -12
  244. package/dist/policy/rules/allowlist.d.ts.map +1 -1
  245. package/dist/policy/rules/allowlist.js +16 -4
  246. package/dist/policy/rules/protected-paths.d.ts.map +1 -1
  247. package/dist/policy/rules/protected-paths.js +6 -1
  248. package/dist/ports/task-backend-port.d.ts +2 -2
  249. package/dist/ports/task-backend-port.d.ts.map +1 -1
  250. package/dist/shared/agent-emoji.d.ts.map +1 -1
  251. package/dist/shared/protected-paths.d.ts +17 -0
  252. package/dist/shared/protected-paths.d.ts.map +1 -1
  253. package/dist/shared/protected-paths.js +59 -10
  254. package/dist/shared/repo-cli-version.d.ts.map +1 -1
  255. package/dist/shared/repo-cli-version.js +9 -3
  256. package/package.json +2 -2
@@ -1,38 +1,11 @@
1
- import { usageError } from "../../cli/spec/errors.js";
2
1
  import { cmdTaskVerifyOk } from "./verify-record.js";
2
+ import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyNonEmptyInput, verifyCommonOptions, } from "./verify-command-shared.js";
3
3
  export const taskVerifyOkSpec = {
4
4
  id: ["task", "verify", "ok"],
5
5
  group: "Task",
6
6
  summary: "Record verification as OK (updates Verification section and verification frontmatter).",
7
7
  args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
8
- options: [
9
- { kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
10
- {
11
- kind: "string",
12
- name: "note",
13
- valueHint: "<text>",
14
- required: true,
15
- description: "Short verification note.",
16
- },
17
- {
18
- kind: "string",
19
- name: "details",
20
- valueHint: "<text>",
21
- description: "Optional details text (mutually exclusive with --file).",
22
- },
23
- {
24
- kind: "string",
25
- name: "file",
26
- valueHint: "<path>",
27
- description: "Optional details file path (mutually exclusive with --details).",
28
- },
29
- {
30
- kind: "boolean",
31
- name: "quiet",
32
- default: false,
33
- description: "Suppress normal output (still prints errors).",
34
- },
35
- ],
8
+ options: verifyCommonOptions,
36
9
  examples: [
37
10
  {
38
11
  cmd: 'agentplane task verify ok 202602030608-F1Q8AB --by REVIEWER --note "Looks good"',
@@ -40,30 +13,15 @@ export const taskVerifyOkSpec = {
40
13
  },
41
14
  ],
42
15
  validateRaw: (raw) => {
43
- const details = raw.opts.details;
44
- const file = raw.opts.file;
45
- if (typeof details === "string" && typeof file === "string") {
46
- throw usageError({
47
- spec: taskVerifyOkSpec,
48
- message: "Provide at most one of --details or --file.",
49
- });
50
- }
51
- const by = raw.opts.by;
52
- if (typeof by === "string" && by.trim().length === 0) {
53
- throw usageError({ spec: taskVerifyOkSpec, message: "Invalid value for --by: empty." });
54
- }
55
- const note = raw.opts.note;
56
- if (typeof note === "string" && note.trim().length === 0) {
57
- throw usageError({ spec: taskVerifyOkSpec, message: "Invalid value for --note: empty." });
58
- }
16
+ validateVerifyDetailsFileExclusive(raw, taskVerifyOkSpec, {
17
+ message: "Provide at most one of --details or --file.",
18
+ });
19
+ validateVerifyNonEmptyInput(raw, taskVerifyOkSpec, "by");
20
+ validateVerifyNonEmptyInput(raw, taskVerifyOkSpec, "note");
59
21
  },
60
22
  parse: (raw) => ({
61
23
  taskId: String(raw.args["task-id"]),
62
- by: String(raw.opts.by),
63
- note: String(raw.opts.note),
64
- details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
65
- file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
66
- quiet: raw.opts.quiet === true,
24
+ ...parseVerifyCommonOptions(raw),
67
25
  }),
68
26
  };
69
27
  export function makeRunTaskVerifyOkHandler(getCtx) {
@@ -1 +1 @@
1
- {"version":3,"file":"verify-record.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-record.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAanC,KAAK,WAAW,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EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAElB"}
@@ -3,12 +3,12 @@ import { readFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { ensureDocSections, setMarkdownSection } from "@agentplaneorg/core";
5
5
  import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
6
- import { backendNotSupportedMessage } from "../../cli/output.js";
6
+ import { backendNotSupportedMessage, successMessage } from "../../cli/output.js";
7
7
  import { CliError } from "../../shared/errors.js";
8
8
  import { ensureReconciledBeforeMutation } from "../shared/reconcile-check.js";
9
9
  import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
10
- import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
11
- import { appendTaskEvent, extractDocSection, normalizeTaskDocVersion, normalizeVerificationSectionLayout, nowIso, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, } from "./shared.js";
10
+ import { appendTaskEventIntent, backendIsLocalFileBackend, getTaskStore, setTaskFieldsIntent, setTaskSectionIntent, touchTaskDocMetaIntent, } from "../shared/task-store.js";
11
+ import { appendTaskEvent, decodeEscapedTaskTextNewlines, extractDocSection, normalizeTaskDocVersion, normalizeVerificationSectionLayout, nowIso, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, } from "./shared.js";
12
12
  function appendBetweenMarkers(sectionText, entryText, version) {
13
13
  const ensured = normalizeVerificationSectionLayout(sectionText, version);
14
14
  const beginIdx = ensured.indexOf(VERIFICATION_RESULTS_BEGIN);
@@ -65,108 +65,113 @@ async function recordVerificationResult(opts) {
65
65
  }
66
66
  const useStore = backendIsLocalFileBackend(ctx);
67
67
  const store = useStore ? getTaskStore(ctx) : null;
68
- const task = useStore
69
- ? await store.get(opts.taskId)
70
- : await loadTaskFromContext({ ctx, taskId: opts.taskId });
71
- const existingDoc = useStore
72
- ? String(task.doc ?? "")
73
- : (typeof task.doc === "string" ? task.doc : "") || (await backend.getTaskDoc(task.id));
74
- const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
75
- const verificationSection = extractDocSection(baseDoc, "Verification") ?? "";
76
- const verifySteps = extractDocSection(baseDoc, "Verify Steps");
77
- const verifyStepsHash = verifySteps
78
- ? sha256Hex(verifySteps.replaceAll("\r\n", "\n").trim())
79
- : null;
80
- const docVersion = normalizeTaskDocVersion(task.doc_version);
81
- const verifyStepsRef = [
82
- `doc_version=${String(docVersion)}`,
83
- `doc_updated_at=${String(task.doc_updated_at ?? "missing")}`,
84
- `excerpt_hash=sha256:${verifyStepsHash ?? "missing"}`,
85
- ].join(", ");
68
+ const task = useStore ? null : await loadTaskFromContext({ ctx, taskId: opts.taskId });
86
69
  const at = nowIso();
87
- const entry = renderVerificationEntry({
88
- at,
89
- state: opts.state,
90
- by: opts.by,
91
- note: opts.note,
92
- details: opts.details ?? null,
93
- verifyStepsRef,
94
- });
95
- const nextVerification = appendBetweenMarkers(verificationSection, entry, docVersion);
96
- const nextDoc = ensureDocSections(setMarkdownSection(baseDoc, "Verification", nextVerification), config.tasks.doc.required_sections);
97
- const nextTask = {
98
- ...task,
99
- status: opts.state === "needs_rework" ? "DOING" : task.status,
100
- commit: opts.state === "needs_rework" ? null : (task.commit ?? null),
101
- doc: nextDoc,
102
- doc_updated_by: opts.by,
103
- events: appendTaskEvent(task, {
104
- type: "verify",
70
+ if (useStore) {
71
+ await store.mutate(opts.taskId, (current) => {
72
+ const existingDoc = String(current.doc ?? "");
73
+ const baseDoc = ensureDocSections(existingDoc, config.tasks.doc.required_sections);
74
+ const verificationSection = extractDocSection(baseDoc, "Verification") ?? "";
75
+ const verifySteps = extractDocSection(baseDoc, "Verify Steps");
76
+ const verifyStepsHash = verifySteps
77
+ ? sha256Hex(verifySteps.replaceAll("\r\n", "\n").trim())
78
+ : null;
79
+ const docVersion = normalizeTaskDocVersion(current.doc_version);
80
+ const verifyStepsRef = [
81
+ `doc_version=${String(docVersion)}`,
82
+ `doc_updated_at=${String(current.doc_updated_at ?? "missing")}`,
83
+ `excerpt_hash=sha256:${verifyStepsHash ?? "missing"}`,
84
+ ].join(", ");
85
+ const entry = renderVerificationEntry({
86
+ at,
87
+ state: opts.state,
88
+ by: opts.by,
89
+ note: opts.note,
90
+ details: opts.details ?? null,
91
+ verifyStepsRef,
92
+ });
93
+ const nextVerification = appendBetweenMarkers(verificationSection, entry, docVersion);
94
+ return [
95
+ setTaskFieldsIntent({
96
+ status: opts.state === "needs_rework" ? "DOING" : current.status,
97
+ commit: opts.state === "needs_rework" ? null : (current.commit ?? null),
98
+ verification: {
99
+ state: opts.state,
100
+ updated_at: at,
101
+ updated_by: opts.by,
102
+ note: opts.note,
103
+ },
104
+ }),
105
+ setTaskSectionIntent({
106
+ section: "Verification",
107
+ text: nextVerification,
108
+ requiredSections: config.tasks.doc.required_sections,
109
+ }),
110
+ appendTaskEventIntent({
111
+ type: "verify",
112
+ at,
113
+ author: opts.by,
114
+ state: opts.state,
115
+ note: opts.note,
116
+ }),
117
+ touchTaskDocMetaIntent({ updatedBy: opts.by }),
118
+ ];
119
+ });
120
+ }
121
+ else {
122
+ const remoteTask = task;
123
+ const existingDoc = (typeof remoteTask.doc === "string" ? remoteTask.doc : "") ||
124
+ (await backend.getTaskDoc(remoteTask.id));
125
+ const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
126
+ const verificationSection = extractDocSection(baseDoc, "Verification") ?? "";
127
+ const verifySteps = extractDocSection(baseDoc, "Verify Steps");
128
+ const verifyStepsHash = verifySteps
129
+ ? sha256Hex(verifySteps.replaceAll("\r\n", "\n").trim())
130
+ : null;
131
+ const docVersion = normalizeTaskDocVersion(remoteTask.doc_version);
132
+ const verifyStepsRef = [
133
+ `doc_version=${String(docVersion)}`,
134
+ `doc_updated_at=${String(remoteTask.doc_updated_at ?? "missing")}`,
135
+ `excerpt_hash=sha256:${verifyStepsHash ?? "missing"}`,
136
+ ].join(", ");
137
+ const entry = renderVerificationEntry({
105
138
  at,
106
- author: opts.by,
107
139
  state: opts.state,
140
+ by: opts.by,
108
141
  note: opts.note,
109
- }),
110
- verification: {
111
- state: opts.state,
112
- updated_at: at,
113
- updated_by: opts.by,
114
- note: opts.note,
115
- },
116
- };
117
- await (useStore ? store.update(opts.taskId, () => nextTask) : backend.writeTask(nextTask));
118
- if (!opts.quiet) {
119
- const readmePath = path.join(resolved.gitRoot, config.paths.workflow_dir, task.id, "README.md");
120
- process.stdout.write(`${readmePath}\n`);
121
- }
122
- }
123
- export async function cmdTaskVerifyOk(opts) {
124
- const by = String(opts.by ?? "").trim();
125
- const note = String(opts.note ?? "").trim();
126
- if (!by || !note) {
127
- throw new CliError({
128
- exitCode: 2,
129
- code: "E_USAGE",
130
- message: "Missing required inputs: --by and --note.",
142
+ details: opts.details ?? null,
143
+ verifyStepsRef,
131
144
  });
132
- }
133
- if (typeof opts.details === "string" && typeof opts.file === "string") {
134
- throw new CliError({
135
- exitCode: 2,
136
- code: "E_USAGE",
137
- message: "Options --details and --file are mutually exclusive.",
145
+ const nextVerification = appendBetweenMarkers(verificationSection, entry, docVersion);
146
+ const nextDoc = ensureDocSections(setMarkdownSection(baseDoc, "Verification", nextVerification), config.tasks.doc.required_sections);
147
+ await backend.writeTask({
148
+ ...remoteTask,
149
+ status: opts.state === "needs_rework" ? "DOING" : remoteTask.status,
150
+ commit: opts.state === "needs_rework" ? null : (remoteTask.commit ?? null),
151
+ doc: nextDoc,
152
+ doc_updated_by: opts.by,
153
+ events: appendTaskEvent(remoteTask, {
154
+ type: "verify",
155
+ at,
156
+ author: opts.by,
157
+ state: opts.state,
158
+ note: opts.note,
159
+ }),
160
+ verification: {
161
+ state: opts.state,
162
+ updated_at: at,
163
+ updated_by: opts.by,
164
+ note: opts.note,
165
+ },
138
166
  });
139
167
  }
140
- let details = typeof opts.details === "string" ? opts.details : null;
141
- if (typeof opts.file === "string") {
142
- try {
143
- details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
144
- }
145
- catch (err) {
146
- throw mapCoreError(err, { command: "task verify ok", filePath: opts.file });
147
- }
148
- }
149
- try {
150
- await recordVerificationResult({
151
- ctx: opts.ctx,
152
- cwd: opts.cwd,
153
- rootOverride: opts.rootOverride,
154
- taskId: opts.taskId,
155
- state: "ok",
156
- by,
157
- note,
158
- details,
159
- quiet: opts.quiet,
160
- });
161
- return 0;
162
- }
163
- catch (err) {
164
- if (err instanceof CliError)
165
- throw err;
166
- throw mapBackendError(err, { command: "task verify ok", root: opts.rootOverride ?? null });
168
+ if (!opts.quiet) {
169
+ const readmePath = path.join(resolved.gitRoot, config.paths.workflow_dir, opts.taskId, "README.md");
170
+ const relReadmePath = path.relative(resolved.gitRoot, readmePath);
171
+ process.stdout.write(`${successMessage("verified", opts.taskId, `state=${opts.state} readme=${relReadmePath}`)}\n`);
167
172
  }
168
173
  }
169
- export async function cmdTaskVerifyRework(opts) {
174
+ async function resolveVerifyRecordInput(opts) {
170
175
  const by = String(opts.by ?? "").trim();
171
176
  const note = String(opts.note ?? "").trim();
172
177
  if (!by || !note) {
@@ -189,55 +194,16 @@ export async function cmdTaskVerifyRework(opts) {
189
194
  details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
190
195
  }
191
196
  catch (err) {
192
- throw mapCoreError(err, { command: "task verify rework", filePath: opts.file });
197
+ throw mapCoreError(err, { command: opts.command, filePath: opts.file });
193
198
  }
194
199
  }
195
- try {
196
- await recordVerificationResult({
197
- ctx: opts.ctx,
198
- cwd: opts.cwd,
199
- rootOverride: opts.rootOverride,
200
- taskId: opts.taskId,
201
- state: "needs_rework",
202
- by,
203
- note,
204
- details,
205
- quiet: opts.quiet,
206
- });
207
- return 0;
208
- }
209
- catch (err) {
210
- if (err instanceof CliError)
211
- throw err;
212
- throw mapBackendError(err, { command: "task verify rework", root: opts.rootOverride ?? null });
200
+ if (typeof details === "string") {
201
+ details = decodeEscapedTaskTextNewlines(details);
213
202
  }
203
+ return { by, note, details };
214
204
  }
215
- export async function cmdVerifyParsed(opts) {
216
- const by = String(opts.by ?? "").trim();
217
- const note = String(opts.note ?? "").trim();
218
- if (!by || !note) {
219
- throw new CliError({
220
- exitCode: 2,
221
- code: "E_USAGE",
222
- message: "Missing required inputs: --by and --note.",
223
- });
224
- }
225
- if (typeof opts.details === "string" && typeof opts.file === "string") {
226
- throw new CliError({
227
- exitCode: 2,
228
- code: "E_USAGE",
229
- message: "Options --details and --file are mutually exclusive.",
230
- });
231
- }
232
- let details = typeof opts.details === "string" ? opts.details : null;
233
- if (typeof opts.file === "string") {
234
- try {
235
- details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
236
- }
237
- catch (err) {
238
- throw mapCoreError(err, { command: "verify", filePath: opts.file });
239
- }
240
- }
205
+ async function executeVerifyRecordCommand(opts) {
206
+ const input = await resolveVerifyRecordInput(opts);
241
207
  try {
242
208
  await recordVerificationResult({
243
209
  ctx: opts.ctx,
@@ -245,9 +211,9 @@ export async function cmdVerifyParsed(opts) {
245
211
  rootOverride: opts.rootOverride,
246
212
  taskId: opts.taskId,
247
213
  state: opts.state,
248
- by,
249
- note,
250
- details,
214
+ by: input.by,
215
+ note: input.note,
216
+ details: input.details,
251
217
  quiet: opts.quiet,
252
218
  });
253
219
  return 0;
@@ -255,6 +221,19 @@ export async function cmdVerifyParsed(opts) {
255
221
  catch (err) {
256
222
  if (err instanceof CliError)
257
223
  throw err;
258
- throw mapBackendError(err, { command: "verify", root: opts.rootOverride ?? null });
224
+ throw mapBackendError(err, { command: opts.command, root: opts.rootOverride ?? null });
259
225
  }
260
226
  }
227
+ export async function cmdTaskVerifyOk(opts) {
228
+ return await executeVerifyRecordCommand({ ...opts, state: "ok", command: "task verify ok" });
229
+ }
230
+ export async function cmdTaskVerifyRework(opts) {
231
+ return await executeVerifyRecordCommand({
232
+ ...opts,
233
+ state: "needs_rework",
234
+ command: "task verify rework",
235
+ });
236
+ }
237
+ export async function cmdVerifyParsed(opts) {
238
+ return await executeVerifyRecordCommand({ ...opts, command: "verify" });
239
+ }
@@ -1,12 +1,8 @@
1
1
  import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
2
2
  import type { CommandContext } from "../shared/task-backend.js";
3
- export type TaskVerifyReworkParsed = {
3
+ import { type VerifyCommonParsed } from "./verify-command-shared.js";
4
+ export type TaskVerifyReworkParsed = VerifyCommonParsed & {
4
5
  taskId: string;
5
- by: string;
6
- note: string;
7
- details?: string;
8
- file?: string;
9
- quiet: boolean;
10
6
  };
11
7
  export declare const taskVerifyReworkSpec: CommandSpec<TaskVerifyReworkParsed>;
12
8
  export declare function makeRunTaskVerifyReworkHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskVerifyReworkParsed) => Promise<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"verify-rework.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-rework.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAkEpE,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC/E,KAAK,UAAU,EAAE,GAAG,sBAAsB,KAAG,OAAO,CAAC,MAAM,CAAC,CAa3E"}
1
+ {"version":3,"file":"verify-rework.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-rework.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACxD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAwBpE,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC/E,KAAK,UAAU,EAAE,GAAG,sBAAsB,KAAG,OAAO,CAAC,MAAM,CAAC,CAa3E"}
@@ -1,38 +1,11 @@
1
- import { usageError } from "../../cli/spec/errors.js";
2
1
  import { cmdTaskVerifyRework } from "./verify-record.js";
2
+ import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyNonEmptyInput, verifyCommonOptions, } from "./verify-command-shared.js";
3
3
  export const taskVerifyReworkSpec = {
4
4
  id: ["task", "verify", "rework"],
5
5
  group: "Task",
6
6
  summary: "Record verification as needs rework (resets commit, sets status to DOING, updates Verification).",
7
7
  args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
8
- options: [
9
- { kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
10
- {
11
- kind: "string",
12
- name: "note",
13
- valueHint: "<text>",
14
- required: true,
15
- description: "Short verification note.",
16
- },
17
- {
18
- kind: "string",
19
- name: "details",
20
- valueHint: "<text>",
21
- description: "Optional details text (mutually exclusive with --file).",
22
- },
23
- {
24
- kind: "string",
25
- name: "file",
26
- valueHint: "<path>",
27
- description: "Optional details file path (mutually exclusive with --details).",
28
- },
29
- {
30
- kind: "boolean",
31
- name: "quiet",
32
- default: false,
33
- description: "Suppress normal output (still prints errors).",
34
- },
35
- ],
8
+ options: verifyCommonOptions,
36
9
  examples: [
37
10
  {
38
11
  cmd: 'agentplane task verify rework 202602030608-F1Q8AB --by REVIEWER --note "Needs changes"',
@@ -40,30 +13,15 @@ export const taskVerifyReworkSpec = {
40
13
  },
41
14
  ],
42
15
  validateRaw: (raw) => {
43
- const details = raw.opts.details;
44
- const file = raw.opts.file;
45
- if (typeof details === "string" && typeof file === "string") {
46
- throw usageError({
47
- spec: taskVerifyReworkSpec,
48
- message: "Provide at most one of --details or --file.",
49
- });
50
- }
51
- const by = raw.opts.by;
52
- if (typeof by === "string" && by.trim().length === 0) {
53
- throw usageError({ spec: taskVerifyReworkSpec, message: "Invalid value for --by: empty." });
54
- }
55
- const note = raw.opts.note;
56
- if (typeof note === "string" && note.trim().length === 0) {
57
- throw usageError({ spec: taskVerifyReworkSpec, message: "Invalid value for --note: empty." });
58
- }
16
+ validateVerifyDetailsFileExclusive(raw, taskVerifyReworkSpec, {
17
+ message: "Provide at most one of --details or --file.",
18
+ });
19
+ validateVerifyNonEmptyInput(raw, taskVerifyReworkSpec, "by");
20
+ validateVerifyNonEmptyInput(raw, taskVerifyReworkSpec, "note");
59
21
  },
60
22
  parse: (raw) => ({
61
23
  taskId: String(raw.args["task-id"]),
62
- by: String(raw.opts.by),
63
- note: String(raw.opts.note),
64
- details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
65
- file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
66
- quiet: raw.opts.quiet === true,
24
+ ...parseVerifyCommonOptions(raw),
67
25
  }),
68
26
  };
69
27
  export function makeRunTaskVerifyReworkHandler(getCtx) {
@@ -7,6 +7,8 @@ export declare function ensureCleanTrackedTreeForUpgrade(gitRoot: string): Promi
7
7
  export declare function createUpgradeCommit(opts: {
8
8
  gitRoot: string;
9
9
  paths: string[];
10
+ tasksPath: string;
11
+ workflowDir: string;
10
12
  versionLabel: string;
11
13
  source: "local_assets" | "upgrade_bundle" | "repo_tarball";
12
14
  additions: number;
@@ -1 +1 @@
1
- {"version":3,"file":"apply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M,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA8FpD;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC/C,GAAG,OAAO,CAAC,IAAI,CAAC,CA2ChB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,cAAc,CAAC;IAC3D,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,OAAO,CAAC,CA4CnB"}
@@ -5,6 +5,7 @@ import { backupPath, fileExists } from "../../cli/fs-utils.js";
5
5
  import { exitCodeForError } from "../../cli/exit-codes.js";
6
6
  import { withDiagnosticContext } from "../../shared/diagnostics.js";
7
7
  import { CliError } from "../../shared/errors.js";
8
+ import { protectedPathKindForFile } from "../../shared/protected-paths.js";
8
9
  import { execFileAsync, gitEnv } from "../shared/git.js";
9
10
  async function safeRemovePath(targetPath) {
10
11
  try {
@@ -74,10 +75,41 @@ export async function createUpgradeCommit(opts) {
74
75
  `Source: ${opts.source}\n` +
75
76
  `Managed-Changes: add=${opts.additions}, update=${opts.updates}, unchanged=${opts.unchanged}\n` +
76
77
  `Incidents-Appended: ${opts.incidentsAppendedCount}\n`;
78
+ const allow = {
79
+ allowTasks: false,
80
+ allowPolicy: false,
81
+ allowConfig: false,
82
+ allowHooks: false,
83
+ allowCI: false,
84
+ };
85
+ for (const filePath of uniquePaths) {
86
+ const kind = protectedPathKindForFile({
87
+ filePath,
88
+ tasksPath: opts.tasksPath,
89
+ workflowDir: opts.workflowDir,
90
+ });
91
+ if (kind === "tasks")
92
+ allow.allowTasks = true;
93
+ if (kind === "policy")
94
+ allow.allowPolicy = true;
95
+ if (kind === "config")
96
+ allow.allowConfig = true;
97
+ if (kind === "hooks")
98
+ allow.allowHooks = true;
99
+ if (kind === "ci")
100
+ allow.allowCI = true;
101
+ }
77
102
  try {
78
103
  await execFileAsync("git", ["commit", "-m", subject, "-m", body], {
79
104
  cwd: opts.gitRoot,
80
- env: gitEnv(),
105
+ env: {
106
+ ...gitEnv(),
107
+ AGENTPLANE_ALLOW_TASKS: allow.allowTasks ? "1" : "0",
108
+ AGENTPLANE_ALLOW_POLICY: allow.allowPolicy ? "1" : "0",
109
+ AGENTPLANE_ALLOW_CONFIG: allow.allowConfig ? "1" : "0",
110
+ AGENTPLANE_ALLOW_HOOKS: allow.allowHooks ? "1" : "0",
111
+ AGENTPLANE_ALLOW_CI: allow.allowCI ? "1" : "0",
112
+ },
81
113
  maxBuffer: 10 * 1024 * 1024,
82
114
  });
83
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CA8JlD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,aAAa,CACsB,CAAC"}
1
+ {"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAwLlD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,aAAa,CACsB,CAAC"}
@@ -72,6 +72,12 @@ export const upgradeSpec = {
72
72
  default: false,
73
73
  description: "Report changes without modifying files.",
74
74
  },
75
+ {
76
+ kind: "boolean",
77
+ name: "migrate-task-docs",
78
+ default: false,
79
+ description: "After applying the framework upgrade, migrate legacy task README docs in the same run.",
80
+ },
75
81
  {
76
82
  kind: "boolean",
77
83
  name: "no-backup",
@@ -115,6 +121,10 @@ export const upgradeSpec = {
115
121
  cmd: "agentplane upgrade --bundle ./agentplane-upgrade.tar.gz --checksum ./agentplane-upgrade.tar.gz.sha256",
116
122
  why: "Upgrade from local bundle files (no network).",
117
123
  },
124
+ {
125
+ cmd: "agentplane upgrade --yes --migrate-task-docs",
126
+ why: "Apply the framework upgrade and migrate legacy task README docs in one operator run.",
127
+ },
118
128
  ],
119
129
  parse: (raw) => {
120
130
  const noBackup = raw.opts["no-backup"] === true;
@@ -130,6 +140,7 @@ export const upgradeSpec = {
130
140
  checksumAsset: raw.opts["checksum-asset"],
131
141
  dryRun: raw.opts["dry-run"] === true,
132
142
  backup: !noBackup,
143
+ migrateTaskDocs: raw.opts["migrate-task-docs"] === true,
133
144
  yes: raw.opts.yes === true,
134
145
  };
135
146
  },
@@ -151,6 +162,20 @@ export const upgradeSpec = {
151
162
  message: "Remote upgrade options (--tag/--source/--asset/--checksum-asset) require --remote.",
152
163
  });
153
164
  }
165
+ if (p.migrateTaskDocs && p.mode === "agent") {
166
+ throw usageError({
167
+ spec: upgradeSpec,
168
+ command: "upgrade",
169
+ message: "Option --migrate-task-docs cannot be used with --agent.",
170
+ });
171
+ }
172
+ if (p.migrateTaskDocs && p.dryRun) {
173
+ throw usageError({
174
+ spec: upgradeSpec,
175
+ command: "upgrade",
176
+ message: "Option --migrate-task-docs cannot be used with --dry-run.",
177
+ });
178
+ }
154
179
  },
155
180
  };
156
181
  export const runUpgrade = (ctx, flags) => cmdUpgradeParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, flags });
@@ -10,6 +10,7 @@ export type UpgradeFlags = {
10
10
  allowTarball: boolean;
11
11
  dryRun: boolean;
12
12
  backup: boolean;
13
+ migrateTaskDocs: boolean;
13
14
  yes: boolean;
14
15
  };
15
16
  export declare function cmdUpgradeParsed(opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AA4CA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CA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