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,6 +1,5 @@
1
1
  import type { AgentplaneConfig } from "@agentplaneorg/core";
2
2
  import type { TaskData, TaskEvent } from "../../../backends/task-backend.js";
3
- import type { CommandContext } from "../../shared/task-backend.js";
4
3
  export declare function appendTaskEvent(task: TaskData, event: TaskEvent): TaskEvent[];
5
4
  export declare function ensurePlanApprovedIfRequired(task: TaskData, config: AgentplaneConfig): void;
6
5
  export declare function ensureVerificationSatisfiedIfRequired(task: TaskData, config: AgentplaneConfig): void;
@@ -19,6 +18,15 @@ export declare function ensureCommentCommitAllowed(opts: {
19
18
  statusFrom: string;
20
19
  statusTo: string;
21
20
  }): void;
21
+ export declare function resolveCommentCommitWarning(opts: {
22
+ enabled: boolean;
23
+ config: AgentplaneConfig;
24
+ action: string;
25
+ confirmed: boolean;
26
+ quiet: boolean;
27
+ statusFrom: string;
28
+ statusTo: string;
29
+ }): string | null;
22
30
  export declare function requireStructuredComment(body: string, prefix: string, minChars: number): void;
23
31
  export declare function readHeadCommit(cwd: string): Promise<{
24
32
  hash: string;
@@ -32,11 +40,18 @@ export declare function enforceStatusCommitPolicy(opts: {
32
40
  statusFrom: string;
33
41
  statusTo: string;
34
42
  }): void;
43
+ export declare function resolveStatusCommitPolicyWarning(opts: {
44
+ policy: AgentplaneConfig["status_commit_policy"];
45
+ action: string;
46
+ confirmed: boolean;
47
+ quiet: boolean;
48
+ statusFrom: string;
49
+ statusTo: string;
50
+ }): string | null;
35
51
  export declare function isMajorStatusCommitTransition(statusFrom: string, statusTo: string): boolean;
36
52
  export declare function readCommitInfo(cwd: string, rev: string): Promise<{
37
53
  hash: string;
38
54
  message: string;
39
55
  }>;
40
56
  export declare function defaultCommitEmojiForStatus(status: string): string;
41
- export declare function defaultCommitEmojiForAgentId(ctx: CommandContext, agentId: string): Promise<string>;
42
57
  //# sourceMappingURL=transitions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,CAW7E;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAc3F;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,gBAAgB,GACvB,IAAI,CAkBN;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAO1E;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,aAAa,EAAE,MAAM,CA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2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMlE"}
@@ -1,8 +1,6 @@
1
1
  import { execFile } from "node:child_process";
2
- import path from "node:path";
3
2
  import { promisify } from "node:util";
4
3
  import { warnMessage } from "../../../cli/output.js";
5
- import { resolveCommitEmojiForAgent } from "../../../shared/agent-emoji.js";
6
4
  import { CliError } from "../../../shared/errors.js";
7
5
  import { parseGitLogHashSubject } from "../../../shared/git-log.js";
8
6
  import { requiresVerificationByPrimary, toStringArray } from "./tags.js";
@@ -73,8 +71,14 @@ export function ensureStatusTransitionAllowed(opts) {
73
71
  });
74
72
  }
75
73
  export function ensureCommentCommitAllowed(opts) {
74
+ const warning = resolveCommentCommitWarning(opts);
75
+ if (warning) {
76
+ process.stderr.write(`${warnMessage(warning)}\n`);
77
+ }
78
+ }
79
+ export function resolveCommentCommitWarning(opts) {
76
80
  if (!opts.enabled)
77
- return;
81
+ return null;
78
82
  if (opts.config.commit_automation === "finish_only") {
79
83
  throw new CliError({
80
84
  exitCode: 2,
@@ -83,7 +87,7 @@ export function ensureCommentCommitAllowed(opts) {
83
87
  "(allowed only in finish).",
84
88
  });
85
89
  }
86
- enforceStatusCommitPolicy({
90
+ return resolveStatusCommitPolicyWarning({
87
91
  policy: opts.config.status_commit_policy,
88
92
  action: opts.action,
89
93
  confirmed: opts.confirmed,
@@ -115,6 +119,12 @@ export async function readHeadCommit(cwd) {
115
119
  return { hash, message: subject };
116
120
  }
117
121
  export function enforceStatusCommitPolicy(opts) {
122
+ const warning = resolveStatusCommitPolicyWarning(opts);
123
+ if (warning) {
124
+ process.stderr.write(`${warnMessage(warning)}\n`);
125
+ }
126
+ }
127
+ export function resolveStatusCommitPolicyWarning(opts) {
118
128
  if (!isMajorStatusCommitTransition(opts.statusFrom, opts.statusTo)) {
119
129
  throw new CliError({
120
130
  exitCode: 2,
@@ -124,12 +134,12 @@ export function enforceStatusCommitPolicy(opts) {
124
134
  });
125
135
  }
126
136
  if (opts.policy === "off")
127
- return;
137
+ return null;
128
138
  if (opts.policy === "warn") {
129
- if (!opts.quiet && !opts.confirmed) {
130
- process.stderr.write(`${warnMessage(`${opts.action}: status/comment-driven commit requested; policy=warn (pass --confirm-status-commit to acknowledge)`)}\n`);
131
- }
132
- return;
139
+ return opts.quiet || opts.confirmed
140
+ ? null
141
+ : `${opts.action}: status/comment-driven commit requested; policy=warn ` +
142
+ "(pass --confirm-status-commit to acknowledge)";
133
143
  }
134
144
  if (opts.policy === "confirm" && !opts.confirmed) {
135
145
  throw new CliError({
@@ -139,6 +149,7 @@ export function enforceStatusCommitPolicy(opts) {
139
149
  "(pass --confirm-status-commit to proceed)",
140
150
  });
141
151
  }
152
+ return null;
142
153
  }
143
154
  const MAJOR_STATUS_COMMIT_TRANSITIONS = new Set([
144
155
  "READY->DOING",
@@ -169,7 +180,3 @@ export function defaultCommitEmojiForStatus(status) {
169
180
  return "⛔";
170
181
  return "🧩";
171
182
  }
172
- export async function defaultCommitEmojiForAgentId(ctx, agentId) {
173
- const agentsDir = path.join(ctx.resolvedProject.gitRoot, ctx.config.paths.agents_dir);
174
- return await resolveCommitEmojiForAgent({ agentsDirAbs: agentsDir, agentId });
175
- }
@@ -1,7 +1,7 @@
1
1
  export { dedupeStrings } from "../../shared/strings.js";
2
- export { nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
2
+ export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
3
3
  export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, type PrimaryTagResolution, type TaskTagPolicy, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
4
- export { type DependencyState, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
5
- export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, requireStructuredComment, enforceStatusCommitPolicy, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, defaultCommitEmojiForAgentId, } from "./shared/transitions.js";
4
+ export { type DependencyState, dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
5
+ export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, resolveCommentCommitWarning, requireStructuredComment, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
6
6
  export { type TaskListFilters, parseTaskListFilters, handleTaskListWarnings, taskTextBlob, } from "./shared/listing.js";
7
7
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,qBAAqB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export { dedupeStrings } from "../../shared/strings.js";
2
- export { nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
2
+ export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
3
3
  export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
4
- export { ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
5
- export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, requireStructuredComment, enforceStatusCommitPolicy, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, defaultCommitEmojiForAgentId, } from "./shared/transitions.js";
4
+ export { dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
5
+ export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, resolveCommentCommitWarning, requireStructuredComment, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
6
6
  export { parseTaskListFilters, handleTaskListWarnings, taskTextBlob, } from "./shared/listing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAwBnC,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiMlB"}
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAyEnC,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkLlB"}
@@ -1,13 +1,49 @@
1
1
  import { mapBackendError } from "../../cli/error-map.js";
2
- import { invalidValueMessage, successMessage, warnMessage } from "../../cli/output.js";
2
+ import { infoMessage, successMessage, warnMessage } from "../../cli/output.js";
3
3
  import { formatCommentBodyForCommit } from "../../shared/comment-format.js";
4
4
  import { CliError } from "../../shared/errors.js";
5
5
  import { commitFromComment } from "../guard/index.js";
6
6
  import { ensureActionApproved } from "../shared/approval-requirements.js";
7
7
  import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
8
- import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
8
+ import { appendTaskCommentIntent, appendTaskEventIntent, backendIsLocalFileBackend, getTaskStore, mutateTaskStore, setTaskFieldsIntent, touchTaskDocMetaIntent, } from "../shared/task-store.js";
9
9
  import { readDirectWorkLock } from "../../shared/direct-work-lock.js";
10
- import { appendTaskEvent, ensurePlanApprovedIfRequired, ensureCommentCommitAllowed, ensureStatusTransitionAllowed, extractTaskObservationSection, defaultCommitEmojiForAgentId, extractDocSection, isVerifyStepsFilled, normalizeTaskDocVersion, nowIso, requiresVerifyStepsByPrimary, requireStructuredComment, resolveTaskDependencyState, resolvePrimaryTag, taskObservationSectionName, toStringArray, } from "./shared.js";
10
+ import { appendTaskEvent, ensurePlanApprovedIfRequired, ensureCommentCommitAllowed, ensureStatusTransitionAllowed, extractTaskObservationSection, defaultCommitEmojiForStatus, extractDocSection, isVerifyStepsFilled, normalizeTaskDocVersion, nowIso, requiresVerifyStepsByPrimary, requireStructuredComment, resolveTaskDependencyState, resolvePrimaryTag, taskObservationSectionName, toStringArray, } from "./shared.js";
11
+ function assertStartDocRequirements(task, config) {
12
+ if (config.agents?.approvals?.require_plan === true)
13
+ return;
14
+ const enforce = config.tasks.verify.enforce_on_start_when_no_plan !== false;
15
+ if (!enforce)
16
+ return;
17
+ const tags = toStringArray(task.tags);
18
+ const spikeTag = (config.tasks.verify.spike_tag ?? "spike").trim().toLowerCase();
19
+ const verifyRequired = requiresVerifyStepsByPrimary(tags, config);
20
+ const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
21
+ const doc = typeof task.doc === "string" ? task.doc : "";
22
+ if (verifyRequired || isSpike) {
23
+ const verifySteps = extractDocSection(doc, "Verify Steps");
24
+ if (!isVerifyStepsFilled(verifySteps)) {
25
+ throw new CliError({
26
+ exitCode: 3,
27
+ code: "E_VALIDATION",
28
+ message: `${task.id}: cannot start work: ## Verify Steps section is missing/empty/unfilled ` +
29
+ "(fill it before starting work when plan approval is disabled)",
30
+ });
31
+ }
32
+ }
33
+ if (!isSpike)
34
+ return;
35
+ const docVersion = normalizeTaskDocVersion(task.doc_version);
36
+ const observationSection = taskObservationSectionName(docVersion);
37
+ const observation = extractTaskObservationSection(doc, docVersion);
38
+ if (!observation || observation.trim().length === 0) {
39
+ throw new CliError({
40
+ exitCode: 3,
41
+ code: "E_VALIDATION",
42
+ message: `${task.id}: cannot start spike: ## ${observationSection} section is missing or empty ` +
43
+ "(include Findings/Decision/Next Steps)",
44
+ });
45
+ }
46
+ }
11
47
  export async function cmdStart(opts) {
12
48
  try {
13
49
  const ctx = opts.ctx ??
@@ -27,47 +63,18 @@ export async function cmdStart(opts) {
27
63
  const task = useStore
28
64
  ? await store.get(opts.taskId)
29
65
  : await loadTaskFromContext({ ctx, taskId: opts.taskId });
30
- if (ctx.config.agents?.approvals?.require_plan !== true) {
31
- const enforce = ctx.config.tasks.verify.enforce_on_start_when_no_plan !== false;
32
- if (enforce) {
33
- const tags = toStringArray(task.tags);
34
- const spikeTag = (ctx.config.tasks.verify.spike_tag ?? "spike").trim().toLowerCase();
35
- const verifyRequired = requiresVerifyStepsByPrimary(tags, ctx.config);
36
- const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
37
- const doc = typeof task.doc === "string" ? task.doc : "";
38
- if (verifyRequired || isSpike) {
39
- const verifySteps = extractDocSection(doc, "Verify Steps");
40
- if (!isVerifyStepsFilled(verifySteps)) {
41
- throw new CliError({
42
- exitCode: 3,
43
- code: "E_VALIDATION",
44
- message: `${task.id}: cannot start work: ## Verify Steps section is missing/empty/unfilled ` +
45
- "(fill it before starting work when plan approval is disabled)",
46
- });
47
- }
48
- }
49
- if (isSpike) {
50
- const docVersion = normalizeTaskDocVersion(task.doc_version);
51
- const observationSection = taskObservationSectionName(docVersion);
52
- const observation = extractTaskObservationSection(doc, docVersion);
53
- if (!observation || observation.trim().length === 0) {
54
- throw new CliError({
55
- exitCode: 3,
56
- code: "E_VALIDATION",
57
- message: `${task.id}: cannot start spike: ## ${observationSection} section is missing or empty ` +
58
- "(include Findings/Decision/Next Steps)",
59
- });
60
- }
61
- }
62
- }
66
+ if (!useStore) {
67
+ assertStartDocRequirements(task, ctx.config);
68
+ ensurePlanApprovedIfRequired(task, ctx.config);
63
69
  }
64
- ensurePlanApprovedIfRequired(task, ctx.config);
65
70
  const currentStatus = String(task.status || "TODO").toUpperCase();
66
- ensureStatusTransitionAllowed({
67
- currentStatus,
68
- nextStatus: "DOING",
69
- force: opts.force,
70
- });
71
+ if (!useStore) {
72
+ ensureStatusTransitionAllowed({
73
+ currentStatus,
74
+ nextStatus: "DOING",
75
+ force: opts.force,
76
+ });
77
+ }
71
78
  ensureCommentCommitAllowed({
72
79
  enabled: opts.commitFromComment,
73
80
  config: ctx.config,
@@ -107,27 +114,58 @@ export async function cmdStart(opts) {
107
114
  { author: opts.author, body: commentBody },
108
115
  ];
109
116
  const at = nowIso();
110
- const nextTask = {
111
- ...task,
112
- status: "DOING",
113
- comments: commentsValue,
114
- events: appendTaskEvent(task, {
115
- type: "status",
116
- at,
117
- author: opts.author,
118
- from: currentStatus,
119
- to: "DOING",
120
- note: commentBody,
121
- }),
122
- doc_version: normalizeTaskDocVersion(task.doc_version),
123
- doc_updated_at: at,
124
- doc_updated_by: opts.author,
125
- };
117
+ let currentStatusForCommit = currentStatus;
118
+ let primaryTagForCommit = resolvePrimaryTag(toStringArray(task.tags), ctx).primary;
126
119
  await (useStore
127
- ? store.update(opts.taskId, () => nextTask)
128
- : ctx.taskBackend.writeTask(nextTask));
120
+ ? mutateTaskStore(store, opts.taskId, (current) => {
121
+ assertStartDocRequirements(current, ctx.config);
122
+ ensurePlanApprovedIfRequired(current, ctx.config);
123
+ const currentStatus = String(current.status || "TODO").toUpperCase();
124
+ currentStatusForCommit = currentStatus;
125
+ primaryTagForCommit = resolvePrimaryTag(toStringArray(current.tags), ctx).primary;
126
+ ensureStatusTransitionAllowed({
127
+ currentStatus,
128
+ nextStatus: "DOING",
129
+ force: opts.force,
130
+ });
131
+ return [
132
+ setTaskFieldsIntent({ status: "DOING" }),
133
+ appendTaskCommentIntent({ author: opts.author, body: commentBody }),
134
+ appendTaskEventIntent({
135
+ type: "status",
136
+ at,
137
+ author: opts.author,
138
+ from: currentStatus,
139
+ to: "DOING",
140
+ note: commentBody,
141
+ }),
142
+ touchTaskDocMetaIntent({
143
+ updatedBy: opts.author,
144
+ version: normalizeTaskDocVersion(current.doc_version),
145
+ }),
146
+ ];
147
+ })
148
+ : ctx.taskBackend.writeTask({
149
+ ...task,
150
+ status: "DOING",
151
+ comments: commentsValue,
152
+ events: appendTaskEvent(task, {
153
+ type: "status",
154
+ at,
155
+ author: opts.author,
156
+ from: currentStatus,
157
+ to: "DOING",
158
+ note: commentBody,
159
+ }),
160
+ doc_version: normalizeTaskDocVersion(task.doc_version),
161
+ doc_updated_at: at,
162
+ doc_updated_by: opts.author,
163
+ }));
129
164
  let commitInfo = null;
130
165
  if (opts.commitFromComment) {
166
+ if (!opts.quiet) {
167
+ process.stdout.write(`${infoMessage("task marked DOING; creating commit from start comment")}\n`);
168
+ }
131
169
  const mode = ctx.config.workflow_mode;
132
170
  let executorAgent = opts.author;
133
171
  if (mode === "direct") {
@@ -136,27 +174,19 @@ export async function cmdStart(opts) {
136
174
  if (lockAgent)
137
175
  executorAgent = lockAgent;
138
176
  }
139
- const expectedEmoji = await defaultCommitEmojiForAgentId(ctx, executorAgent);
140
- if (typeof opts.commitEmoji === "string" && opts.commitEmoji.trim() !== expectedEmoji) {
141
- throw new CliError({
142
- exitCode: 2,
143
- code: "E_USAGE",
144
- message: invalidValueMessage("--commit-emoji", opts.commitEmoji, `${expectedEmoji} (executor agent=${executorAgent})`),
145
- });
146
- }
147
177
  commitInfo = await commitFromComment({
148
178
  ctx,
149
179
  cwd: opts.cwd,
150
180
  rootOverride: opts.rootOverride,
151
181
  taskId: opts.taskId,
152
- primaryTag: resolvePrimaryTag(toStringArray(task.tags), ctx).primary,
182
+ primaryTag: primaryTagForCommit,
153
183
  executorAgent,
154
184
  author: opts.author,
155
- statusFrom: currentStatus,
185
+ statusFrom: currentStatusForCommit,
156
186
  statusTo: "DOING",
157
187
  commentBody: opts.body,
158
188
  formattedComment,
159
- emoji: opts.commitEmoji ?? expectedEmoji,
189
+ emoji: opts.commitEmoji ?? defaultCommitEmojiForStatus("DOING"),
160
190
  allow: opts.commitAllow,
161
191
  autoAllow: opts.commitAutoAllow || opts.commitAllow.length === 0,
162
192
  allowTasks: opts.commitAllowTasks,
@@ -0,0 +1,8 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ type TaskGroupParsed = {
3
+ cmd: string[];
4
+ };
5
+ export declare const taskSpec: CommandSpec<TaskGroupParsed>;
6
+ export declare const runTask: CommandHandler<TaskGroupParsed>;
7
+ export {};
8
+ //# sourceMappingURL=task.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/task.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAItF,KAAK,eAAe,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AA6BzC,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,eAAe,CA8BjD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,eAAe,CAWnD,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { usageError } from "../../cli/spec/errors.js";
2
+ import { suggestOne } from "../../cli/spec/suggest.js";
3
+ const TASK_SUBCOMMANDS = [
4
+ "add",
5
+ "close-duplicate",
6
+ "close-noop",
7
+ "comment",
8
+ "derive",
9
+ "doc",
10
+ "export",
11
+ "lint",
12
+ "list",
13
+ "migrate",
14
+ "migrate-doc",
15
+ "new",
16
+ "next",
17
+ "normalize",
18
+ "plan",
19
+ "rebuild-index",
20
+ "scrub",
21
+ "search",
22
+ "set-status",
23
+ "show",
24
+ "start-ready",
25
+ "update",
26
+ "verify",
27
+ "verify-show",
28
+ ];
29
+ export const taskSpec = {
30
+ id: ["task"],
31
+ group: "Task",
32
+ summary: "Task lifecycle and task-store commands.",
33
+ synopsis: ["agentplane task <subcommand> [args] [options]"],
34
+ args: [{ name: "cmd", required: false, variadic: true, valueHint: "<subcommand>" }],
35
+ notes: [
36
+ "Direct task route: task new -> task plan set -> task plan approve -> task start-ready -> task verify-show -> verify -> finish.",
37
+ "Use `agentplane help task plan`, `agentplane help task doc`, and `agentplane help task verify` to inspect task sub-areas.",
38
+ "Verification recording and closure stay top-level lifecycle commands: `agentplane verify ...` and `agentplane finish ...`.",
39
+ ],
40
+ examples: [
41
+ {
42
+ cmd: 'agentplane task new --title "..." --description "..." --owner CODER --tag code',
43
+ why: "Create a task.",
44
+ },
45
+ {
46
+ cmd: 'agentplane task plan set <task-id> --text "..." --updated-by ORCHESTRATOR',
47
+ why: "Write the execution plan.",
48
+ },
49
+ {
50
+ cmd: 'agentplane task start-ready <task-id> --author CODER --body "Start: ..."',
51
+ why: "Start the task after approval.",
52
+ },
53
+ {
54
+ cmd: "agentplane task verify-show <task-id>",
55
+ why: "Show Verify Steps before running checks.",
56
+ },
57
+ ],
58
+ parse: (raw) => ({ cmd: (raw.args.cmd ?? []) }),
59
+ };
60
+ export const runTask = (_ctx, p) => {
61
+ const input = p.cmd.join(" ");
62
+ const suggestion = suggestOne(input, [...TASK_SUBCOMMANDS]);
63
+ const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
64
+ const message = p.cmd.length === 0 ? "Missing subcommand." : `Unknown subcommand: ${p.cmd[0]}.`;
65
+ throw usageError({
66
+ spec: taskSpec,
67
+ command: "task",
68
+ message: `${message}${suffix}`,
69
+ context: { command: "task" },
70
+ });
71
+ };
@@ -0,0 +1,16 @@
1
+ import type { CommandSpec, OptionSpec, ParsedRaw } from "../../cli/spec/spec.js";
2
+ export type VerifyCommonParsed = {
3
+ by: string;
4
+ note: string;
5
+ details?: string;
6
+ file?: string;
7
+ quiet: boolean;
8
+ };
9
+ export declare const verifyCommonOptions: readonly OptionSpec[];
10
+ export declare function validateVerifyDetailsFileExclusive<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
11
+ command?: string;
12
+ message?: string;
13
+ }): void;
14
+ export declare function validateVerifyNonEmptyInput<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, name: "by" | "note"): void;
15
+ export declare function parseVerifyCommonOptions(raw: ParsedRaw): VerifyCommonParsed;
16
+ //# sourceMappingURL=verify-command-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-command-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-command-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,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,mBAAmB,EAAE,SAAS,UAAU,EA2B3C,CAAC;AAEX,wBAAgB,kCAAkC,CAAC,OAAO,EACxD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,IAAI,CAQN;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EACjD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,EAAE,IAAI,GAAG,MAAM,GAClB,IAAI,CAKN;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,SAAS,GAAG,kBAAkB,CAQ3E"}
@@ -0,0 +1,53 @@
1
+ import { usageError } from "../../cli/spec/errors.js";
2
+ export const verifyCommonOptions = [
3
+ { kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
4
+ {
5
+ kind: "string",
6
+ name: "note",
7
+ valueHint: "<text>",
8
+ required: true,
9
+ description: "Short verification note.",
10
+ },
11
+ {
12
+ kind: "string",
13
+ name: "details",
14
+ valueHint: "<text>",
15
+ description: "Optional details text (mutually exclusive with --file).",
16
+ },
17
+ {
18
+ kind: "string",
19
+ name: "file",
20
+ valueHint: "<path>",
21
+ description: "Optional details file path (mutually exclusive with --details).",
22
+ },
23
+ {
24
+ kind: "boolean",
25
+ name: "quiet",
26
+ default: false,
27
+ description: "Suppress normal output (still prints errors).",
28
+ },
29
+ ];
30
+ export function validateVerifyDetailsFileExclusive(raw, spec, opts) {
31
+ if (typeof raw.opts.details === "string" && typeof raw.opts.file === "string") {
32
+ throw usageError({
33
+ spec,
34
+ command: opts?.command,
35
+ message: opts?.message ?? "Options --details and --file are mutually exclusive.",
36
+ });
37
+ }
38
+ }
39
+ export function validateVerifyNonEmptyInput(raw, spec, name) {
40
+ const value = raw.opts[name];
41
+ if (typeof value === "string" && value.trim().length === 0) {
42
+ throw usageError({ spec, message: `Invalid value for --${name}: empty.` });
43
+ }
44
+ }
45
+ export function parseVerifyCommonOptions(raw) {
46
+ return {
47
+ by: typeof raw.opts.by === "string" ? raw.opts.by : "",
48
+ note: typeof raw.opts.note === "string" ? raw.opts.note : "",
49
+ details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
50
+ file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
51
+ quiet: raw.opts.quiet === true,
52
+ };
53
+ }
@@ -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 TaskVerifyOkParsed = {
3
+ import { type VerifyCommonParsed } from "./verify-command-shared.js";
4
+ export type TaskVerifyOkParsed = 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 taskVerifyOkSpec: CommandSpec<TaskVerifyOkParsed>;
12
8
  export declare function makeRunTaskVerifyOkHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskVerifyOkParsed) => Promise<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"verify-ok.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-ok.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,kBAAkB,GAAG;IAC/B,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,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAiE5D,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC3E,KAAK,UAAU,EAAE,GAAG,kBAAkB,KAAG,OAAO,CAAC,MAAM,CAAC,CAavE"}
1
+ {"version":3,"file":"verify-ok.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-ok.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,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAuB5D,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC3E,KAAK,UAAU,EAAE,GAAG,kBAAkB,KAAG,OAAO,CAAC,MAAM,CAAC,CAavE"}