@unbrained/pm-cli 2026.11.30 → 2026.12.2

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 (382) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/commander-usage.js +10 -10
  3. package/dist/cli/error-guidance.js +5 -5
  4. package/dist/cli/extension-command-help.js +6 -6
  5. package/dist/cli/help-json-payload.js +7 -7
  6. package/dist/cli/main.js +5 -5
  7. package/dist/cli/register-list-query.js +10 -10
  8. package/dist/cli/register-mutation.js +3 -3
  9. package/dist/cli/runtime/invocation-command-path.js +2 -0
  10. package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
  11. package/dist/cli-bundle/bundle-manifest.json +1 -1
  12. package/dist/cli-bundle/chunks/{chunk-DCWGM7CY.js → chunk-3HKPVOAN.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-Z7YL2SUM.js → chunk-3KEMIPKG.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-TX74QJ4W.js → chunk-4YYFY33T.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-47ZS6RPL.js → chunk-7NAO7I75.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-IGEFPHV7.js → chunk-7V65VACG.js} +52 -52
  17. package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +2 -0
  18. package/dist/cli-bundle/chunks/{chunk-5PNOVDVO.js → chunk-AHV3CSQG.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-KCVSSONY.js → chunk-C6WM6ZN4.js} +3 -3
  20. package/dist/cli-bundle/chunks/chunk-CBUC4X7Q.js +127 -0
  21. package/dist/cli-bundle/chunks/{chunk-CCKM5YQM.js → chunk-G6TARHFK.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-TY55UX6M.js → chunk-GOEQXVOI.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-I4SPJQQI.js +3 -0
  24. package/dist/cli-bundle/chunks/{chunk-Q4VZSMUL.js → chunk-L2ZSSMYY.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-NHBG5ET3.js → chunk-MZZ4ZJ5Z.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +113 -0
  27. package/dist/cli-bundle/chunks/{chunk-YVTALIN3.js → chunk-OBPO6V7H.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-KXTKLDKD.js → chunk-OXC5KBIQ.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-HXQ3OHQR.js → chunk-PCDTWL6V.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-AOTI76Q6.js → chunk-Q6K7HWZ7.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-NZSXWIX7.js → chunk-ROTEELDL.js} +7 -7
  33. package/dist/cli-bundle/chunks/{chunk-WFYE34TO.js → chunk-SDXCJZKB.js} +23 -23
  34. package/dist/cli-bundle/chunks/{chunk-2SBTXR6C.js → chunk-SY5C3U32.js} +3 -3
  35. package/dist/cli-bundle/chunks/{chunk-FR7ULTM4.js → chunk-TKUG2X24.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-FECZV72T.js → chunk-UNBW2LF3.js} +2 -2
  37. package/dist/cli-bundle/chunks/chunk-V2S4XAX3.js +2 -0
  38. package/dist/cli-bundle/chunks/chunk-WSEIEDEK.js +2 -0
  39. package/dist/cli-bundle/chunks/{chunk-ZA5NS3PL.js → chunk-ZL6J6JYT.js} +6 -6
  40. package/dist/cli-bundle/chunks/{field-option-collisions-2F2Z7R7B.js → field-option-collisions-BBGTV7AD.js} +2 -2
  41. package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +2 -0
  42. package/dist/cli-bundle/chunks/item-transaction-56J5OCHA.js +2 -0
  43. package/dist/cli-bundle/chunks/{linked-resource-value-list-WXPPYUVQ.js → linked-resource-value-list-ZBIY4H23.js} +2 -2
  44. package/dist/cli-bundle/chunks/{mutation-actor-UK3QNEEB.js → mutation-actor-NHN33ITJ.js} +2 -2
  45. package/dist/cli-bundle/chunks/{mutation-admission-UTDYPFWP.js → mutation-admission-PGKJTCG6.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-list-query-DRA3CWHI.js → register-list-query-7S5QWDTI.js} +11 -11
  47. package/dist/cli-bundle/chunks/{register-mutation-WO74VLEQ.js → register-mutation-EK6DVIQK.js} +5 -5
  48. package/dist/cli-bundle/chunks/{register-operations-CRBKH7WN.js → register-operations-6MURXE4V.js} +2 -2
  49. package/dist/cli-bundle/chunks/{register-setup-6V6NQB5C.js → register-setup-RW26X3GJ.js} +2 -2
  50. package/dist/cli-bundle/chunks/{stage-DYEHGASU.js → stage-4ZCF74G4.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-RQYVX2T6.js → chunk-2DGKVXFT.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-2UWKU2BQ.js +3 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-A3DORTXS.js → chunk-3COWDIPX.js} +54 -54
  54. package/dist/cli-bundle/focused-chunks/{chunk-UQJ4PY2Y.js → chunk-4SCFAWAW.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-7G7JIXLL.js → chunk-6BKT6XQN.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/chunk-6IY5CVGJ.js +2 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-7A6SEZEY.js +4 -0
  58. package/dist/cli-bundle/focused-chunks/{chunk-IJ3T3W4U.js → chunk-BHNBPCHP.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-LWBZ7UGG.js → chunk-EQCQTYKO.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-FM5WQ6ZU.js → chunk-HTDYNY4L.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-TQQO42C2.js → chunk-J72TRWR5.js} +26 -26
  62. package/dist/cli-bundle/focused-chunks/{chunk-L357ZAES.js → chunk-JPZGC3W4.js} +5 -5
  63. package/dist/cli-bundle/focused-chunks/{chunk-62AMZMR4.js → chunk-KNBGHCIP.js} +3 -3
  64. package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +100 -0
  65. package/dist/cli-bundle/focused-chunks/{chunk-IIVDBAJM.js → chunk-OG57ESZK.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{chunk-MZNV26XE.js → chunk-P2H3GTJK.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/{chunk-SXC3NVZI.js → chunk-TR22GU7M.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{chunk-M57KDG7I.js → chunk-TXTPAFHJ.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/chunk-VK3IE3TS.js +29 -0
  73. package/dist/cli-bundle/focused-chunks/{chunk-NJTKGBSK.js → chunk-VQIC3UZB.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/{chunk-U35K7FSE.js → chunk-W4JMV7GF.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/{field-option-collisions-7TG7STO7.js → field-option-collisions-2C6DLUC4.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +2 -0
  77. package/dist/cli-bundle/focused-chunks/{item-transaction-2IC2MLML.js → item-transaction-LQLQLZE7.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{mutation-actor-LJVF2HVD.js → mutation-actor-DJMZUIZI.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/mutation-admission-SDWQVVHN.js +2 -0
  80. package/dist/cli-bundle/focused-chunks/{stage-MWR73LTZ.js → stage-QBZIK3T5.js} +2 -2
  81. package/dist/cli-bundle/main.js +27 -27
  82. package/dist/cli-bundle/sdk-authoring.js +1 -1
  83. package/dist/cli-bundle/sdk-contracts.js +1 -1
  84. package/dist/cli-bundle/sdk-core.js +1 -1
  85. package/dist/cli-bundle/sdk-governance.js +1 -1
  86. package/dist/cli-bundle/sdk-graph.js +1 -1
  87. package/dist/cli-bundle/sdk-merge.js +61 -61
  88. package/dist/cli-bundle/sdk-query.js +1 -1
  89. package/dist/cli-bundle/sdk-runtime.js +1 -1
  90. package/dist/cli-bundle/sdk-testing.js +1 -1
  91. package/dist/cli-bundle/sdk.js +2 -2
  92. package/dist/core/extensions/reserved-host-flags.js +1 -1
  93. package/dist/core/shared/secret-rules.d.ts +86 -12
  94. package/dist/core/shared/secret-rules.js +7 -5
  95. package/dist/sdk/cli-bootstrap.js +1 -1
  96. package/dist/sdk/cli-contracts/flag-contracts.d.ts +50 -0
  97. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  98. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
  99. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  100. package/dist/sdk/extension/command-options.js +1 -1
  101. package/dist/sdk/extension/install-sources.d.ts +2 -2
  102. package/dist/sdk/extension/install-sources.js +5 -5
  103. package/dist/sdk/lifecycle/expect-hash-admission.d.ts +15 -0
  104. package/dist/sdk/lifecycle/expect-hash-admission.js +2 -0
  105. package/dist/sdk/lifecycle/item-revision.d.ts +4 -1
  106. package/dist/sdk/lifecycle/item-revision.js +1 -1
  107. package/dist/sdk/mutation-guard.js +1 -1
  108. package/dist/sdk/output-contracts.js +1 -1
  109. package/dist/sdk/output-projection.d.ts +1 -1
  110. package/dist/sdk/output-projection.js +1 -1
  111. package/dist/sdk/public-surface.json +1 -1
  112. package/dist/sdk/query/aggregate.js +1 -1
  113. package/dist/sdk/query/context.js +1 -1
  114. package/dist/sdk/query/list.js +1 -1
  115. package/dist/sdk/query/next.js +1 -1
  116. package/dist/sdk/query/search-contracts.js +1 -1
  117. package/dist/sdk/read-output/surfaces.js +1 -1
  118. package/dist/sdk/read-output-budget.d.ts +1 -1
  119. package/dist/sdk/read-output-budget.js +1 -1
  120. package/dist/sdk/read-output-contracts.js +1 -1
  121. package/dist/sdk/read-output-rows.js +1 -1
  122. package/docs/COMMANDS.md +37 -0
  123. package/docs/MUTATION_INTEGRITY.md +226 -10
  124. package/docs/SDK.md +16 -6
  125. package/docs/agent-task-token-baseline.json +1 -1
  126. package/marketplace.json +1 -1
  127. package/node_modules/tar/README.md +1792 -1147
  128. package/node_modules/tar/dist/commonjs/bytes.d.ts +21 -0
  129. package/node_modules/tar/dist/commonjs/bytes.js +83 -0
  130. package/node_modules/tar/dist/commonjs/codec.d.ts +53 -0
  131. package/node_modules/tar/dist/commonjs/codec.js +35 -0
  132. package/node_modules/tar/dist/commonjs/concat.d.ts +3 -0
  133. package/node_modules/tar/dist/commonjs/concat.js +20 -0
  134. package/node_modules/tar/dist/commonjs/create.d.ts +39 -2
  135. package/node_modules/tar/dist/commonjs/create.js +150 -64
  136. package/node_modules/tar/dist/commonjs/dealias.d.ts +79 -0
  137. package/node_modules/tar/dist/commonjs/dealias.js +50 -0
  138. package/node_modules/tar/dist/commonjs/delete.d.ts +19 -0
  139. package/node_modules/tar/dist/commonjs/delete.js +121 -0
  140. package/node_modules/tar/dist/commonjs/entries.d.ts +82 -0
  141. package/node_modules/tar/dist/commonjs/entries.js +398 -0
  142. package/node_modules/tar/dist/commonjs/extract.d.ts +14 -2
  143. package/node_modules/tar/dist/commonjs/extract.js +40 -81
  144. package/node_modules/tar/dist/commonjs/fs.d.ts +201 -0
  145. package/node_modules/tar/dist/commonjs/fs.js +5 -0
  146. package/node_modules/tar/dist/commonjs/header.d.ts +4 -4
  147. package/node_modules/tar/dist/commonjs/header.js +71 -53
  148. package/node_modules/tar/dist/commonjs/index.d.ts +25 -18
  149. package/node_modules/tar/dist/commonjs/index.js +46 -18
  150. package/node_modules/tar/dist/commonjs/index.min.js +2 -3
  151. package/node_modules/tar/dist/commonjs/large-numbers.d.ts +2 -2
  152. package/node_modules/tar/dist/commonjs/large-numbers.js +4 -4
  153. package/node_modules/tar/dist/commonjs/list.d.ts +23 -6
  154. package/node_modules/tar/dist/commonjs/list.js +99 -138
  155. package/node_modules/tar/dist/commonjs/mkdir.d.ts +16 -11
  156. package/node_modules/tar/dist/commonjs/mkdir.js +121 -159
  157. package/node_modules/tar/dist/commonjs/normalize-unicode.js +9 -0
  158. package/node_modules/tar/dist/commonjs/options.d.ts +284 -513
  159. package/node_modules/tar/dist/commonjs/options.js +20 -61
  160. package/node_modules/tar/dist/commonjs/pack.d.ts +150 -96
  161. package/node_modules/tar/dist/commonjs/pack.js +752 -445
  162. package/node_modules/tar/dist/commonjs/parser.d.ts +98 -0
  163. package/node_modules/tar/dist/commonjs/parser.js +452 -0
  164. package/node_modules/tar/dist/commonjs/path-reservations.d.ts +17 -7
  165. package/node_modules/tar/dist/commonjs/path-reservations.js +110 -140
  166. package/node_modules/tar/dist/commonjs/path.d.ts +19 -0
  167. package/node_modules/tar/dist/commonjs/path.js +90 -0
  168. package/node_modules/tar/dist/commonjs/pax.d.ts +3 -1
  169. package/node_modules/tar/dist/commonjs/pax.js +67 -36
  170. package/node_modules/tar/dist/commonjs/read-entry.d.ts +97 -11
  171. package/node_modules/tar/dist/commonjs/read-entry.js +251 -97
  172. package/node_modules/tar/dist/commonjs/read-file.d.ts +22 -0
  173. package/node_modules/tar/dist/commonjs/read-file.js +104 -0
  174. package/node_modules/tar/dist/commonjs/replace.d.ts +45 -1
  175. package/node_modules/tar/dist/commonjs/replace.js +164 -211
  176. package/node_modules/tar/dist/commonjs/server/codecs.d.ts +38 -0
  177. package/node_modules/tar/dist/commonjs/server/codecs.js +252 -0
  178. package/node_modules/tar/dist/commonjs/server/index.d.ts +115 -0
  179. package/node_modules/tar/dist/commonjs/server/index.js +166 -0
  180. package/node_modules/tar/dist/commonjs/server/index.min.js +3 -0
  181. package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +8 -0
  182. package/node_modules/tar/dist/commonjs/strip-absolute-path.js +17 -20
  183. package/node_modules/tar/dist/commonjs/to-stream.d.ts +7 -0
  184. package/node_modules/tar/dist/commonjs/to-stream.js +22 -0
  185. package/node_modules/tar/dist/commonjs/types.d.ts +4 -3
  186. package/node_modules/tar/dist/commonjs/types.js +4 -3
  187. package/node_modules/tar/dist/commonjs/unpack.d.ts +143 -89
  188. package/node_modules/tar/dist/commonjs/unpack.js +780 -725
  189. package/node_modules/tar/dist/commonjs/update.d.ts +11 -1
  190. package/node_modules/tar/dist/commonjs/update.js +37 -28
  191. package/node_modules/tar/dist/commonjs/warn.d.ts +27 -0
  192. package/node_modules/tar/dist/commonjs/warn.js +36 -0
  193. package/node_modules/tar/dist/commonjs/win32-path.d.ts +16 -0
  194. package/node_modules/tar/dist/commonjs/win32-path.js +67 -0
  195. package/node_modules/tar/dist/commonjs/write-entry.d.ts +64 -111
  196. package/node_modules/tar/dist/commonjs/write-entry.js +108 -672
  197. package/node_modules/tar/dist/commonjs/write-flag.d.ts +18 -0
  198. package/node_modules/tar/dist/commonjs/write-flag.js +29 -0
  199. package/node_modules/tar/dist/esm/bytes.d.ts +21 -0
  200. package/node_modules/tar/dist/esm/bytes.js +72 -0
  201. package/node_modules/tar/dist/esm/codec.d.ts +53 -0
  202. package/node_modules/tar/dist/esm/codec.js +32 -0
  203. package/node_modules/tar/dist/esm/concat.d.ts +3 -0
  204. package/node_modules/tar/dist/esm/concat.js +16 -0
  205. package/node_modules/tar/dist/esm/create.d.ts +39 -2
  206. package/node_modules/tar/dist/esm/create.js +144 -61
  207. package/node_modules/tar/dist/esm/dealias.d.ts +79 -0
  208. package/node_modules/tar/dist/esm/dealias.js +46 -0
  209. package/node_modules/tar/dist/esm/delete.d.ts +19 -0
  210. package/node_modules/tar/dist/esm/delete.js +117 -0
  211. package/node_modules/tar/dist/esm/entries.d.ts +82 -0
  212. package/node_modules/tar/dist/esm/entries.js +388 -0
  213. package/node_modules/tar/dist/esm/extract.d.ts +14 -2
  214. package/node_modules/tar/dist/esm/extract.js +37 -44
  215. package/node_modules/tar/dist/esm/fs.d.ts +201 -0
  216. package/node_modules/tar/dist/esm/fs.js +4 -0
  217. package/node_modules/tar/dist/esm/header.d.ts +4 -4
  218. package/node_modules/tar/dist/esm/header.js +71 -53
  219. package/node_modules/tar/dist/esm/index.d.ts +25 -18
  220. package/node_modules/tar/dist/esm/index.js +23 -18
  221. package/node_modules/tar/dist/esm/index.min.js +2 -3
  222. package/node_modules/tar/dist/esm/large-numbers.d.ts +2 -2
  223. package/node_modules/tar/dist/esm/large-numbers.js +4 -4
  224. package/node_modules/tar/dist/esm/list.d.ts +23 -6
  225. package/node_modules/tar/dist/esm/list.js +96 -101
  226. package/node_modules/tar/dist/esm/mkdir.d.ts +16 -11
  227. package/node_modules/tar/dist/esm/mkdir.js +119 -154
  228. package/node_modules/tar/dist/esm/normalize-unicode.js +9 -0
  229. package/node_modules/tar/dist/esm/options.d.ts +284 -513
  230. package/node_modules/tar/dist/esm/options.js +17 -51
  231. package/node_modules/tar/dist/esm/pack.d.ts +150 -96
  232. package/node_modules/tar/dist/esm/pack.js +750 -441
  233. package/node_modules/tar/dist/esm/parser.d.ts +98 -0
  234. package/node_modules/tar/dist/esm/parser.js +448 -0
  235. package/node_modules/tar/dist/esm/path-reservations.d.ts +17 -7
  236. package/node_modules/tar/dist/esm/path-reservations.js +110 -140
  237. package/node_modules/tar/dist/esm/path.d.ts +19 -0
  238. package/node_modules/tar/dist/esm/path.js +80 -0
  239. package/node_modules/tar/dist/esm/pax.d.ts +3 -1
  240. package/node_modules/tar/dist/esm/pax.js +66 -35
  241. package/node_modules/tar/dist/esm/read-entry.d.ts +97 -11
  242. package/node_modules/tar/dist/esm/read-entry.js +248 -96
  243. package/node_modules/tar/dist/esm/read-file.d.ts +22 -0
  244. package/node_modules/tar/dist/esm/read-file.js +99 -0
  245. package/node_modules/tar/dist/esm/replace.d.ts +45 -1
  246. package/node_modules/tar/dist/esm/replace.js +160 -207
  247. package/node_modules/tar/dist/esm/server/codecs.d.ts +38 -0
  248. package/node_modules/tar/dist/esm/server/codecs.js +214 -0
  249. package/node_modules/tar/dist/esm/server/index.d.ts +115 -0
  250. package/node_modules/tar/dist/esm/server/index.js +102 -0
  251. package/node_modules/tar/dist/esm/server/index.min.js +3 -0
  252. package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +8 -0
  253. package/node_modules/tar/dist/esm/strip-absolute-path.js +17 -20
  254. package/node_modules/tar/dist/esm/to-stream.d.ts +7 -0
  255. package/node_modules/tar/dist/esm/to-stream.js +18 -0
  256. package/node_modules/tar/dist/esm/types.d.ts +4 -3
  257. package/node_modules/tar/dist/esm/types.js +4 -3
  258. package/node_modules/tar/dist/esm/unpack.d.ts +143 -89
  259. package/node_modules/tar/dist/esm/unpack.js +776 -719
  260. package/node_modules/tar/dist/esm/update.d.ts +11 -1
  261. package/node_modules/tar/dist/esm/update.js +35 -28
  262. package/node_modules/tar/dist/esm/warn.d.ts +27 -0
  263. package/node_modules/tar/dist/esm/warn.js +31 -0
  264. package/node_modules/tar/dist/esm/win32-path.d.ts +16 -0
  265. package/node_modules/tar/dist/esm/win32-path.js +60 -0
  266. package/node_modules/tar/dist/esm/write-entry.d.ts +64 -111
  267. package/node_modules/tar/dist/esm/write-entry.js +107 -633
  268. package/node_modules/tar/dist/esm/write-flag.d.ts +18 -0
  269. package/node_modules/tar/dist/esm/write-flag.js +25 -0
  270. package/node_modules/tar/package.json +68 -224
  271. package/package.json +2 -2
  272. package/packages/pm-beads/package.json +1 -1
  273. package/packages/pm-calendar/package.json +1 -1
  274. package/packages/pm-command-kit/package.json +1 -1
  275. package/packages/pm-digital-twin/package.json +1 -1
  276. package/packages/pm-governance-audit/package.json +1 -1
  277. package/packages/pm-guide-shell/package.json +1 -1
  278. package/packages/pm-kanban/package.json +1 -1
  279. package/packages/pm-lifecycle-hooks/package.json +1 -1
  280. package/packages/pm-linked-test-adapters/package.json +1 -1
  281. package/packages/pm-search-advanced/package.json +1 -1
  282. package/packages/pm-templates/package.json +1 -1
  283. package/packages/pm-todos/package.json +1 -1
  284. package/packages/pm-vcs/package.json +1 -1
  285. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  286. package/plugins/pm-claude/package.json +1 -1
  287. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  288. package/plugins/pm-codex/package.json +1 -1
  289. package/plugins/pm-codex/plugin.json +1 -1
  290. package/runtime-dependencies.json +1 -1
  291. package/dist/cli-bundle/chunks/chunk-3TXEWHQX.js +0 -125
  292. package/dist/cli-bundle/chunks/chunk-JPJNJHQW.js +0 -2
  293. package/dist/cli-bundle/chunks/chunk-NVYDPNQP.js +0 -2
  294. package/dist/cli-bundle/chunks/chunk-SJWIPGZW.js +0 -113
  295. package/dist/cli-bundle/chunks/chunk-USBTXMKS.js +0 -2
  296. package/dist/cli-bundle/chunks/chunk-VCXQ6A35.js +0 -3
  297. package/dist/cli-bundle/chunks/chunk-YPMNXG2C.js +0 -2
  298. package/dist/cli-bundle/chunks/item-revision-UAF6L47R.js +0 -2
  299. package/dist/cli-bundle/chunks/item-transaction-RJECL53Y.js +0 -2
  300. package/dist/cli-bundle/focused-chunks/chunk-2UUBS4BG.js +0 -2
  301. package/dist/cli-bundle/focused-chunks/chunk-4ER3VMST.js +0 -2
  302. package/dist/cli-bundle/focused-chunks/chunk-4YBMHMBJ.js +0 -2
  303. package/dist/cli-bundle/focused-chunks/chunk-HXM7K6VH.js +0 -100
  304. package/dist/cli-bundle/focused-chunks/chunk-NGHT2LNG.js +0 -3
  305. package/dist/cli-bundle/focused-chunks/chunk-P55AZPFN.js +0 -2
  306. package/dist/cli-bundle/focused-chunks/chunk-WAP3DF4B.js +0 -27
  307. package/dist/cli-bundle/focused-chunks/chunk-XR745UGE.js +0 -4
  308. package/dist/cli-bundle/focused-chunks/item-revision-J7EUGCHR.js +0 -2
  309. package/dist/cli-bundle/focused-chunks/mutation-admission-SLFAUONA.js +0 -2
  310. package/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
  311. package/node_modules/@isaacs/fs-minipass/README.md +0 -71
  312. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +0 -118
  313. package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
  314. package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
  315. package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +0 -118
  316. package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
  317. package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
  318. package/node_modules/@isaacs/fs-minipass/package.json +0 -72
  319. package/node_modules/chownr/LICENSE.md +0 -63
  320. package/node_modules/chownr/README.md +0 -3
  321. package/node_modules/chownr/dist/commonjs/index.d.ts +0 -3
  322. package/node_modules/chownr/dist/commonjs/index.js +0 -93
  323. package/node_modules/chownr/dist/commonjs/package.json +0 -3
  324. package/node_modules/chownr/dist/esm/index.d.ts +0 -3
  325. package/node_modules/chownr/dist/esm/index.js +0 -85
  326. package/node_modules/chownr/dist/esm/package.json +0 -3
  327. package/node_modules/chownr/package.json +0 -69
  328. package/node_modules/minipass/LICENSE.md +0 -55
  329. package/node_modules/minipass/README.md +0 -825
  330. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  331. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  332. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  333. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  334. package/node_modules/minipass/dist/esm/index.js +0 -1020
  335. package/node_modules/minipass/dist/esm/package.json +0 -3
  336. package/node_modules/minipass/package.json +0 -77
  337. package/node_modules/minizlib/LICENSE +0 -26
  338. package/node_modules/minizlib/README.md +0 -64
  339. package/node_modules/minizlib/dist/commonjs/constants.d.ts +0 -2
  340. package/node_modules/minizlib/dist/commonjs/constants.js +0 -123
  341. package/node_modules/minizlib/dist/commonjs/index.d.ts +0 -99
  342. package/node_modules/minizlib/dist/commonjs/index.js +0 -416
  343. package/node_modules/minizlib/dist/commonjs/package.json +0 -3
  344. package/node_modules/minizlib/dist/esm/constants.d.ts +0 -2
  345. package/node_modules/minizlib/dist/esm/constants.js +0 -117
  346. package/node_modules/minizlib/dist/esm/index.d.ts +0 -99
  347. package/node_modules/minizlib/dist/esm/index.js +0 -363
  348. package/node_modules/minizlib/dist/esm/package.json +0 -3
  349. package/node_modules/minizlib/package.json +0 -80
  350. package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +0 -2
  351. package/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
  352. package/node_modules/tar/dist/commonjs/make-command.d.ts +0 -49
  353. package/node_modules/tar/dist/commonjs/make-command.js +0 -52
  354. package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +0 -2
  355. package/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
  356. package/node_modules/tar/dist/commonjs/parse.d.ts +0 -92
  357. package/node_modules/tar/dist/commonjs/parse.js +0 -655
  358. package/node_modules/tar/dist/commonjs/process-umask.d.ts +0 -2
  359. package/node_modules/tar/dist/commonjs/process-umask.js +0 -7
  360. package/node_modules/tar/dist/commonjs/warn-method.d.ts +0 -24
  361. package/node_modules/tar/dist/commonjs/warn-method.js +0 -31
  362. package/node_modules/tar/dist/esm/get-write-flag.d.ts +0 -2
  363. package/node_modules/tar/dist/esm/get-write-flag.js +0 -26
  364. package/node_modules/tar/dist/esm/make-command.d.ts +0 -49
  365. package/node_modules/tar/dist/esm/make-command.js +0 -48
  366. package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +0 -2
  367. package/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
  368. package/node_modules/tar/dist/esm/parse.d.ts +0 -92
  369. package/node_modules/tar/dist/esm/parse.js +0 -651
  370. package/node_modules/tar/dist/esm/process-umask.d.ts +0 -2
  371. package/node_modules/tar/dist/esm/process-umask.js +0 -3
  372. package/node_modules/tar/dist/esm/warn-method.d.ts +0 -24
  373. package/node_modules/tar/dist/esm/warn-method.js +0 -27
  374. package/node_modules/yallist/LICENSE.md +0 -63
  375. package/node_modules/yallist/README.md +0 -205
  376. package/node_modules/yallist/dist/commonjs/index.d.ts +0 -39
  377. package/node_modules/yallist/dist/commonjs/index.js +0 -384
  378. package/node_modules/yallist/dist/commonjs/package.json +0 -3
  379. package/node_modules/yallist/dist/esm/index.d.ts +0 -39
  380. package/node_modules/yallist/dist/esm/index.js +0 -379
  381. package/node_modules/yallist/dist/esm/package.json +0 -3
  382. package/node_modules/yallist/package.json +0 -68
@@ -1,4 +1,4 @@
1
- import{a as Tt}from"./chunk-HXQ3OHQR.js";import{a as It}from"./chunk-YPMNXG2C.js";import{b as Et}from"./chunk-HZZLSBIJ.js";import"./chunk-SLFRSZK6.js";import{a as Dt,b as Pt}from"./chunk-47ZS6RPL.js";import{c as le,g as Ct,l as Rt,m as Ot,n as Ft,o as Mt}from"./chunk-FECZV72T.js";import{$ as so,A as At,C as kt,D as xt,E as _t,V as to,W as oo,X as io,Y as no,Z as ao,_ as ro,aa as lo,ba as uo,ca as ae,da as re,ea as se,s as dt,t as ht,u as yt,v as gt,w as oe,x as ie,y as ne,z as bt}from"./chunk-NZSXWIX7.js";import"./chunk-CCKM5YQM.js";import"./chunk-2SBTXR6C.js";import{$a as ft,$b as wt,Oa as lt,Qa as ct,Ub as te,Ya as pt,_a as mt,ab as vt,m as Re,n as Oe,tc as St}from"./chunk-WFYE34TO.js";import{aa as ut,hb as ee}from"./chunk-ZA5NS3PL.js";import"./chunk-X5D5YUHR.js";import"./chunk-4QA5O64H.js";import"./chunk-Q4VZSMUL.js";import"./chunk-TY55UX6M.js";import{$ as nt,A as Te,B as Ie,C as De,D as Pe,E as Ne,G as $e,H as Le,I as He,J as Ue,K as Be,L as Ge,M as je,N as qe,O as Ve,P as ze,Q as Je,R as Ke,S as We,T as Xe,U as Ye,V as Ze,W as Qe,X as et,Y as tt,Z as ot,_ as it,aa as at,ba as rt,ca as st,x as B}from"./chunk-IGEFPHV7.js";import"./chunk-DCWGM7CY.js";import"./chunk-6H36ZHMI.js";import{o as Q}from"./chunk-AOTI76Q6.js";import"./chunk-OGVSGXQX.js";import"./chunk-AA52P34H.js";import{$ as Me,Ka as w,j as X,la as D,m as Fe,pa as v,sa as d,ta as s,ua as b,va as P,wa as U,xa as Y,ya as Z,za as Ee}from"./chunk-KCVSSONY.js";import"./chunk-USBTXMKS.js";import"./chunk-5PNOVDVO.js";import"./chunk-PZA7QECY.js";import{A as C,R as F,_ as J,a as be,da as K,jd as W,oa as x,qc as Ce,t as V,u as Se}from"./chunk-3TXEWHQX.js";import{u as I}from"./chunk-KXTKLDKD.js";import"./chunk-3AZOATC2.js";import{Ib as z,Pe as g,Q as xe,Ue as f,Ve as y,a as we,t as q}from"./chunk-SJWIPGZW.js";import{o as R}from"./chunk-GSLOAEY2.js";import"./chunk-NVYDPNQP.js";import"./chunk-JPJNJHQW.js";import{x as O}from"./chunk-VCXQ6A35.js";import{a as Ae,da as _e,y as ke}from"./chunk-TE6FBDHP.js";import{A as c,C as m}from"./chunk-K672XXGQ.js";import{a as ge}from"./chunk-XAWE4EAK.js";function Nt(t,e,o){return yt(t,x(e),o)}function $t(t,e){return wt(x(t),e)}var N={};ge(N,{PROFILE_SUBCOMMANDS:()=>to,formatProfileApplyHuman:()=>uo,formatProfileLintHuman:()=>lo,formatProfileListHuman:()=>ro,formatProfileShowHuman:()=>so,runProfileApply:()=>ao,runProfileLint:()=>no,runProfileList:()=>oo,runProfileShow:()=>io});function Lt(t,e){let o=x(t.update);return xt({...t,update:o},e)}async function de(t){typeof t.description=="string"&&t.description.trim()==="-"&&(t.description=await C().resolveValue(t.description,"--description")??"")}import{readFile as co}from"node:fs/promises";import po from"node:path";async function mo(t,e,o,n){let i=v(n),r=o.expectedResult??o.expected,a=await bt(t,e,{status:typeof o.status=="string"?o.status:void 0,expectedResult:typeof r=="string"?r:void 0,author:typeof o.author=="string"?o.author:i.author,message:typeof o.message=="string"?o.message:void 0,force:o.force===!0},i);await w(i,a),f(a,i)}async function fo(t,e){let o=typeof t.from=="string"?t.from.trim():"";if(o.length>0&&o!=="-"){if(e.getOptionValueSource("stdinJson")==="cli")throw new m("pm item mutate cannot combine --from <path> with explicit --stdin-json. Select one input source.",c.USAGE);try{return await co(po.resolve(process.cwd(),o),"utf8")}catch(i){throw new m(`pm item mutate could not read --from ${o}: ${Ce(i)}`,c.USAGE,{code:"mutation_document_unreadable",required:"Pass a readable JSON, JSON Lines, or envelope document path, or `-` for stdin.",why:"The whole document must be available before any tracker write begins."})}}return await C().resolveValue("-","--stdin-json")??""}async function vo(t,e){let o=v(e),n=await fo(t,e);if(n.trim().length===0)throw new m("pm item mutate requires a non-empty JSON batch on stdin or via --from <path>.",c.USAGE);if(t.transactionId!==void 0&&(typeof t.transactionId!="string"||t.transactionId.trim().length===0))throw new m("pm item mutate requires --transaction-id <value> to be non-empty when provided.",c.USAGE);let i=R(process.cwd(),o.path),r=await I(i),a=await Pt({pmRoot:i,input:n,settings:r,...typeof t.transactionId=="string"?{transactionId:t.transactionId}:{},...typeof t.upsertKey=="string"?{upsertKey:t.upsertKey}:{}}),{mutations:l,references:u,rows:p}=a,h=a.transaction_id,S={transaction_id:h,transaction_id_source:a.transaction_id_source,...a.upsert_key===void 0?{}:{upsert_key:a.upsert_key}},A=le(t),M=z(typeof t.author=="string"?t.author:o.author,r.author_default);if(t.dryRun===!0){let T=await Dt({pmRoot:i,author:M,plan:a});f({...S,dry_run:!0,validation:T.validation,mutation_count:l.length,mutations:l,references:u,rows:T.rows},o);return}let E=await Ot({pmRoot:i,transactionId:h,author:M,mutations:l,...A});f({...E,...S,mutation_count:l.length,references:u,rows:p},o)}function ho(t,e){return typeof t=="string"&&t.trim().length>0?t.trim():typeof e=="string"?e.trim():""}async function yo(t,e,o,n){let i=v(n),r=typeof o.transactionId=="string"?o.transactionId.trim():"";if(r.length===0)throw new m("pm item complete requires --transaction-id <value>.",c.USAGE);let a=ho(e,o.reason);if(a.length===0)throw new m("pm item complete requires a close reason.",c.USAGE);let u=Object.fromEntries(["file","doc","test","comment","note","learning"].filter(k=>o[k]!==void 0).map(k=>[k,o[k]])),p=o.force===!0,{lockTtlSeconds:h,lockWaitMs:S}=le(o),A={...typeof o.resolution=="string"?{resolution:o.resolution}:{},...typeof o.expectedResult=="string"?{expectedResult:o.expectedResult}:{},...typeof o.actualResult=="string"?{actualResult:o.actualResult}:{},...typeof o.completedAt=="string"?{completedAt:o.completedAt}:{},...typeof o.validateClose=="string"?{validateClose:o.validateClose}:{},...p?{force:!0}:{}},M={id:t,reason:a,...Object.keys(u).length===0?{}:{evidence:u},...Object.keys(A).length===0?{}:{closeOptions:A},...p?{releaseOptions:{force:!0}}:{}},E=R(process.cwd(),i.path),T=z(typeof o.author=="string"?o.author:i.author,(await I(E)).author_default);if(o.dryRun===!0){let k=Ft(M),eo=await Rt({pmRoot:E,transactionId:r,author:T,mutations:k});f({transaction_id:r,dry_run:!0,validation:eo,mutation_count:k.length,mutations:k},i);return}let ye=await Mt({pmRoot:E,transactionId:r,author:T,...M,lockTtlSeconds:h,lockWaitMs:S});f({...ye,mutation_count:Object.keys(ye.results).length},i)}function Ht(t){let e=t.commands.find(o=>o.name()==="item")??t.command("item").description("Run item lifecycle operations.");e.command("reopen <id> <reason>").option("--status <value>","Active target status: open or in_progress").option("--expected-result <value>","Current active planning expectation; otherwise the receipt offers recovery").option("--expected <value>","Alias for --expected-result").option("--message <value>","Human-readable recurrence history message").option("--force","Override ownership or stale-lock conflicts").option("--author <value>","Mutation author").description("Reopen terminal work with recurrence evidence.").action(mo),e.command("mutate").option("--transaction-id <value>","Stable idempotency key used to resume an interrupted batch; derived from the document when omitted").option("--stdin-json","Read the JSON mutation array from stdin",!0).option("--from <path>","Read the JSON, JSON Lines, or envelope document from a file (- for stdin)").option("--upsert-key <field>","Update the existing item whose field matches instead of creating a duplicate").option("--dry-run","Validate and preview the batch without writing").option("--create-compensation <mode>","Created-item compensation policy: close or delete","close").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--author <value>","Mutation author").description("Apply SDK-backed mutations atomically.").action(vo),e.command("complete <id> [reason]").requiredOption("--transaction-id <value>","Stable idempotency key for the composed completion").option("--reason <value>","Close reason when omitted positionally").option("--file <value>","Linked file evidence",d).option("--doc <value>","Linked documentation evidence",d).option("--test <value>","Linked test evidence",d).option("--comment <value>","Evidence comment",d).option("--note <value>","Completion note",d).option("--learning <value>","Durable completion learning",d).option("--resolution <value>","Structured resolution evidence").option("--expected-result <value>","Expected result evidence").option("--actual-result <value>","Actual result evidence").option("--completed-at <value>","Actual completion time").option("--validate-close <mode>","Close validation: off, warn, or strict").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--dry-run","Validate and preview completion without writing").option("--force","Override lifecycle and ownership conflicts").option("--author <value>","Completion author").description("Close with evidence and release the claim.").action(yo)}async function go(t,e){let o=v(e),n=Array.isArray(t.event)?t.event:[],i=await lt(R(process.cwd(),o.path),{historyEvent:n,allActionable:t.allActionable===!0,dryRun:t.dryRun===!0,planFingerprint:s(t,"planFingerprint"),limit:t.limit,attributedAuthor:s(t,"attributedAuthor"),reviewer:s(t,"reviewer"),reason:s(t,"reason")});f(i,o)}function Ut(t){t.command("history-author-acknowledge").option("--event <item-id:line>","Unknown-author event coordinate (repeatable)",d).option("--all-actionable","Select all actionable events").option("--dry-run","Preview a deterministic source-bound plan").option("--plan-fingerprint <sha256>","Apply the exact fingerprint returned by --dry-run").option("--limit <n>","Maximum coordinate rows returned in the plan").option("--attributed-author <value>","Reviewed principal attribution").option("--reviewer <value>","Disposition reviewer").option("--reason <value>","Review evidence").description("Append audited dispositions for immutable unknown-author events.").action(go)}function Bt(t){let e=x(t.options);return kt({...t,options:e})}function ue(t,e,o,n){if(e.trim().toLowerCase()!=="add"||!o?.trim())return;let i=s(n,"add")??s(n,"text")??s(n,"note")??s(n,"body")??s(n,"comment"),r=s(n,"file"),a=[t,o.trim()];i!==void 0?a.push("--add",i):n.stdin===!0?a.push("--stdin"):r!==void 0?a.push("--file",r):a.push("--add","-");let l=O(a),u=O([t,o.trim(),"--add","-"]);throw new m(`The positional token "add" was parsed as the item id, while "${o.trim()}" was parsed as annotation text. ${t} does not use an add subcommand.`,c.USAGE,{code:"annotation_transposed_subcommand",reason:"noun_verb_object_transposition",required:`Place the item id immediately after ${t}, then use --add for annotation text.`,examples:[...new Set([l,u])],recovery:{attempted_command:`pm ${t} add ${o.trim()}`,normalized_args:[t,"add",o.trim()],parsed_positionals:[{role:"transposed_subcommand",value:"add"},{role:"item_id",value:o.trim()}],suggested_retry:l}})}var Gt={comments:["add","text","body","comment"],notes:["add","text","note"],learnings:["add","text"]};function wo(t,e,o,n,i){let r=Gt[t].some(l=>`--${l}`!==e&&s(i,l)!==void 0),a=i.delete!==void 0||i.edit!==void 0&&i.ifAbsent===!0;if(!(r||a||i.stdin===!0||s(i,"file")!==void 0||s(i,"addJson")!==void 0)){if(o==="--file")return n===void 0?void 0:["--file",n];if(o==="--stdin"||o.startsWith("--file="))return n===void 0?[o]:void 0}}function ce(t,e,o,n){let i=Gt[t].map(l=>({flag:`--${l}`,value:s(n,l)?.trim()})).find(l=>l.value!==void 0&&Re(l.value));if(i===void 0)return;let r=[t,e,...typeof n.edit=="number"?["--edit",String(n.edit)]:[]],a=wo(t,i.flag,i.value,o,n);throw Oe({collectionKey:t,textFlag:i.flag,value:i.value,commandPrefix:O(r),...a===void 0?{}:{retryArgs:[...r,...a]},...a===void 0&&o!==void 0&&i.value!=="--file"?{conflictingOperand:o}:{}})}function jt(t,e,o){let n=o.flatMap(r=>{let a=s(e,r);return a===void 0?[]:[{alias:r,value:a}]});if([...new Set(n.map(({value:r})=>r))].length>1)throw new m(`Specify ${t} text with one alias or the same value across aliases: ${n.map(({alias:r})=>`--${r}`).join(", ")}`,c.USAGE,{code:"annotation_alias_conflict"});return n[0]?.value}function bo(t,e){let o=typeof e.edit=="number"?e.edit:void 0,n=typeof e.delete=="number"?e.delete:void 0,i=jt("comment",e,["add","text","body","comment"]),r=typeof t=="string"?t:void 0,a=e.stdin===!0,l=s(e,"file");if(+(i!==void 0)+ +(r!==void 0)+Number(a)+ +(l!==void 0)>1)throw i!==void 0&&r!==void 0&&!a&&l===void 0?new m("Specify comment text either as positional [text] or with --add, not both",c.USAGE):new m("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file",c.USAGE);let p=i??r;return{add:p,readFromStdin:a,readFromFile:l,editIndex:o,deleteIndex:n,isMutation:typeof p=="string"||a||l!==void 0||o!==void 0||n!==void 0}}function qt(t,e,o){let n=jt(t,o,t==="note"?["add","text","note"]:["add","text"]),i=typeof e=="string"?e:void 0;if(n!==void 0&&i!==void 0)throw new m(`Specify ${t} text either as positional [text] or with --add, not both`,c.USAGE);let r=n??i,a=t==="note"?s(o,"addJson"):void 0,l=o.stdin===!0,u=s(o,"file"),p=typeof o.edit=="number"?o.edit:void 0,h=typeof o.delete=="number"?o.delete:void 0;return{add:r,addJson:a,readFromStdin:l,readFromFile:u,editIndex:p,deleteIndex:h,isMutation:typeof r=="string"||a!==void 0||l||u!==void 0||p!==void 0||h!==void 0}}function pe(t){return{fullHistory:t.fullHistory===!0,ifAbsent:t.ifAbsent===!0,expectAt:s(t,"expectAt"),author:s(t,"author"),message:s(t,"message"),ownershipAppendBypass:t.ownershipAppendBypass===!0,force:!!t.force}}async function So(t,e,o,n){let i=v(n),r=Date.now();ue("comments",t,e,o),ce("comments",t,e,o);let a=bo(e,o),l=await dt(t,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),...pe(o)},i);a.isMutation&&l.changed!==!1&&await w(i,l),me("comments",l,i,r)}async function Ao(t,e,o,n){let i=v(n),r=Date.now();ue("notes",t,e,o),ce("notes",t,e,o);let a=qt("note",e,o),l=await _t(t,{add:a.add,addJson:a.addJson,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),since:s(o,"since"),eventType:s(o,"eventType"),includeMeta:o.includeMeta===!0,...pe(o)},i);a.isMutation&&l.changed!==!1&&await w(i,l),me("notes",l,i,r)}async function ko(t,e,o,n){let i=v(n),r=Date.now();ue("learnings",t,e,o),ce("learnings",t,e,o);let a=qt("learning",e,o),l=await ht(t,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),...pe(o)},i);a.isMutation&&l.changed!==!1&&await w(i,l),me("learnings",l,i,r)}function me(t,e,o,n){f(e,o),o.profile&&y(`profile:command=${t} took_ms=${Date.now()-n}`)}function Vt(t,e){let o=t.command("comments").argument("<id>","Item id").argument("[text]","Optional comment text shorthand (equivalent to --add)").option("--add <text>","Append comment text; use text=<value> for structured input or - for stdin").option("--stdin","Read comment text from stdin (supports multiline markdown)").option("--file <path>","Read comment text from a file or stdin (-)").option("--edit <index>","Replace one comment using positional text, --add, --stdin, or --file",e("--edit")).option("--delete <index>","Delete the comment at 1-based <index>",e("--delete")).option("--expect-at <ts>","Edit/delete only if the entry's created_at is <ts>").option("--limit <n>","Return only latest n comments").option("--full-history","Return complete comment history instead of a bounded mutation receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Comment author; defaults to PM_AUTHOR or settings").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete comments for an item.").action(So);b(o,"--body <text>","Alias for --add",!1),b(o,"--text <text>","Alias for --add",!1),b(o,"--comment <text>","Alias for --add",!1);let n=t.command("notes").argument("<id>","Item id").argument("[text]","Optional note text shorthand for --add").option("--add <text>","Add a text note (- reads stdin)").option("--note <text>","Alias for --add").option("--add-json <json>","Append a JSON event").option("--stdin","Read note text from stdin").option("--file <path>","Read note from file or stdin (-)").option("--edit <index>","Replace a 1-based note using the selected text input",e("--edit")).option("--delete <index>","Delete the note at 1-based <index>",e("--delete")).option("--expect-at <ts>","Edit/delete only if the entry's created_at is <ts>").option("--limit <n>","Return only latest n notes").option("--since <timestamp>","Filter JSON events from this ISO time").option("--event-type <value>","Filter JSON events by top-level type").option("--include-meta","Include count and truncation metadata").option("--full-history","Return complete note history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Author; defaults to PM_AUTHOR/settings").option("--message <value>","History message").option("--force","Force ownership override").description("Manage merge-safe text notes and JSON context events.").action(Ao);b(n,"--text <text>","Alias for --add",!1);let i=t.command("learnings").argument("<id>","Item id").argument("[text]","Optional learning text shorthand for --add").option("--add <text>","Append learning text; use text=<value> or - for stdin").option("--stdin","Read learning text from stdin").option("--file <path>","Read learning text from a file or stdin (-)").option("--edit <index>","Replace one learning using positional text, --add, --stdin, or --file",e("--edit")).option("--delete <index>","Delete the learning at 1-based <index>",e("--delete")).option("--expect-at <ts>","Edit/delete only if the entry's created_at is <ts>").option("--limit <n>","Return only latest n learnings").option("--full-history","Return complete learning history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete learnings for an item.").action(ko);b(i,"--text <text>","Alias for --add",!1)}function fe(t,e){return o=>{let n=Number(o);if(!Number.isInteger(n)||n<e)throw new m(`${t} must be an integer greater than or equal to ${e}.`,c.USAGE);return n}}async function xo(t,e,o){let n=v(o);if(e.scope!==void 0&&e.scope!=="project"&&e.scope!=="global")throw new m("--scope must be either project or global.",c.USAGE);let i=await ft({paths:t,scope:e.scope,limit:typeof e.limit=="number"?e.limit:void 0,offset:typeof e.offset=="number"?e.offset:void 0,noTruncate:e.noTruncate===!0,strictRead:e.strictRead===!0,explain:e.explain===!0,lineRange:typeof e.lines=="string"?pt(e.lines):void 0,decisionDepth:typeof e.decisionDepth=="number"?e.decisionDepth:void 0},n);f(i,n)}function zt(t){t.command("lookup").argument("<paths...>","Project-relative or absolute source paths").option("--scope <scope>","Restrict links to project or global scope").option("--limit <n>","Maximum referencing items to return",fe("--limit",1)).option("--offset <n>","Number of referencing items to skip",fe("--offset",0)).option("--no-truncate","Return every referencing item").option("--strict-read","Fail when any authoritative item cannot be read").option("--explain","Include ranked source-to-work rationale").option("--lines <start:end>","Attribute an inclusive source line range").option("--decision-depth <n>","Maximum governing-decision relationship depth",fe("--decision-depth",1)).description("Find and explain pm items that govern requested source paths.").action(xo)}var _o=["add-","apply-","list-","remove-","show-"],Co=new Set(["field","fields","help","status","statuses","type","types"]);function ve(t){let e=t.trim(),o=e.toLowerCase();return o.length===0?!1:e[0]===o[0]||Co.has(o)||_o.some(n=>o.startsWith(n))}function G(t){if(t!=null){if(typeof t=="number"){if(!Number.isInteger(t))throw new m("--order must be a finite integer.",c.USAGE);return t}if(typeof t=="string"){if(t.trim().length===0)return;let e=Number(t);if(!Number.isInteger(e))throw new m("--order must be a finite integer.",c.USAGE);return e}throw new m("--order must be a finite integer.",c.USAGE)}}function $(t){if(Array.isArray(t))return t;if(typeof t=="string")return[t]}var L={};ge(L,{SCHEMA_SUBCOMMANDS:()=>De,_testOnlySchemaCommand:()=>st,formatSchemaAddFieldHuman:()=>tt,formatSchemaAddStatusHuman:()=>Xe,formatSchemaAddTypeHuman:()=>Ke,formatSchemaApplyPresetHuman:()=>at,formatSchemaEvolutionMigrationHuman:()=>Ie,formatSchemaInferTypesHuman:()=>rt,formatSchemaListFieldsHuman:()=>it,formatSchemaListHuman:()=>Ze,formatSchemaRemoveFieldHuman:()=>ot,formatSchemaRemoveStatusHuman:()=>Ye,formatSchemaRemoveTypeHuman:()=>We,formatSchemaShowFieldHuman:()=>nt,formatSchemaShowHuman:()=>Qe,formatSchemaShowStatusHuman:()=>et,runSchemaAddField:()=>Ge,runSchemaAddStatus:()=>$e,runSchemaAddType:()=>Pe,runSchemaApplyPreset:()=>ze,runSchemaEvolutionMigration:()=>Te,runSchemaInferTypes:()=>Je,runSchemaList:()=>He,runSchemaListFields:()=>qe,runSchemaRemoveField:()=>je,runSchemaRemoveStatus:()=>Le,runSchemaRemoveType:()=>Ne,runSchemaShow:()=>Ue,runSchemaShowField:()=>Ve,runSchemaShowStatus:()=>Be,runWorkflowPolicyAction:()=>B});function Ro(t,e){let o=e.normalizedSubcommand;return o!=="rename-type"&&o!=="rename-field"&&o!=="remap-status"?null:t.runSchemaEvolutionMigration({kind:o,from:e.typeName,to:s(e.options,"to"),...o==="rename-field"&&typeof e.options.type=="string"?{type:e.options.type}:{}},{migrationId:s(e.options,"migrationId")??s(e.options,"migration_id"),dryRun:e.options.dryRun===!0,author:e.author,force:e.force},e.globalOptions)}function Oo(t,e){let{normalizedSubcommand:o,typeName:n,globalOptions:i,author:r,force:a}=e;switch(o){case"list":return t.runSchemaList(i);case"show":return t.runSchemaShow(n,i);case"show-status":return t.runSchemaShowStatus(n,i);case"list-fields":return t.runSchemaListFields(i);case"show-field":return t.runSchemaShowField(n,i);case"remove-type":return t.runSchemaRemoveType(n,{author:r,force:a},i);case"remove-field":return t.runSchemaRemoveField(n,{author:r,force:a},i);case"remove-status":return t.runSchemaRemoveStatus(n,{author:r,force:a},i);case"apply-preset":return t.runSchemaApplyPreset(n,{author:r,force:a},i);default:return null}}async function Fo(t,e){let{normalizedSubcommand:o,typeName:n,options:i,globalOptions:r}=e,{author:a,force:l,description:u}=e,p=Ro(t,e);if(p)return p;let h=Oo(t,e);if(h)return h;switch(o){case"add-field":return t.runSchemaAddField(n,{type:typeof i.type=="string"?i.type:void 0,commands:e.commands,description:u,cliFlag:typeof i.cliFlag=="string"?i.cliFlag:void 0,alias:e.aliases,required:!!i.required,requiredOnCreate:!!i.requiredOnCreate,allowUnset:i.allowUnset!==!1,requiredTypes:e.requiredTypes,author:a,force:l},r);case"add-status":return t.runSchemaAddStatus(n,{role:e.roles,alias:e.aliases,description:u,order:e.order,author:a,force:l},r);default:return i.infer===!0?t.runSchemaInferTypes({minCount:e.minCount,apply:!!i.apply,author:a,force:l},r):t.runSchemaAddType(n,{description:u,defaultStatus:e.defaultStatus,folder:typeof i.folder=="string"?i.folder:void 0,alias:e.aliases,author:a,force:l},r)}}function Mo(t,e){if("migration_id"in e){g(`${t.formatSchemaEvolutionMigrationHuman(e)}
1
+ import{a as Tt}from"./chunk-PCDTWL6V.js";import{a as It}from"./chunk-V2S4XAX3.js";import{b as Et}from"./chunk-HZZLSBIJ.js";import"./chunk-SLFRSZK6.js";import{a as Dt,b as Pt}from"./chunk-7NAO7I75.js";import{c as le,g as Ct,l as Rt,m as Ot,n as Ft,o as Mt}from"./chunk-UNBW2LF3.js";import{$ as so,A as At,C as kt,D as xt,E as _t,V as to,W as oo,X as io,Y as no,Z as ao,_ as ro,aa as lo,ba as co,ca as ae,da as re,ea as se,s as dt,t as ht,u as yt,v as gt,w as oe,x as ie,y as ne,z as bt}from"./chunk-ROTEELDL.js";import"./chunk-G6TARHFK.js";import"./chunk-SY5C3U32.js";import{$a as ft,$b as wt,Oa as lt,Qa as ut,Ub as te,Ya as pt,_a as mt,ab as vt,m as Re,n as Oe,tc as St}from"./chunk-SDXCJZKB.js";import{aa as ct,hb as ee}from"./chunk-ZL6J6JYT.js";import"./chunk-X5D5YUHR.js";import"./chunk-4QA5O64H.js";import"./chunk-L2ZSSMYY.js";import"./chunk-GOEQXVOI.js";import{$ as nt,A as Te,B as Ie,C as De,D as Pe,E as Ne,G as $e,H as Le,I as He,J as Ue,K as Be,L as Ge,M as je,N as qe,O as Ve,P as ze,Q as Je,R as Ke,S as We,T as Xe,U as Ye,V as Ze,W as Qe,X as et,Y as tt,Z as ot,_ as it,aa as at,ba as rt,ca as st,x as B}from"./chunk-7V65VACG.js";import"./chunk-3HKPVOAN.js";import"./chunk-6H36ZHMI.js";import{o as Q}from"./chunk-Q6K7HWZ7.js";import"./chunk-OGVSGXQX.js";import"./chunk-AA52P34H.js";import{$ as Me,Ka as w,j as X,la as D,m as Fe,pa as v,sa as d,ta as s,ua as b,va as P,wa as U,xa as Y,ya as Z,za as Ee}from"./chunk-C6WM6ZN4.js";import"./chunk-QDV7S2QS.js";import"./chunk-AHV3CSQG.js";import"./chunk-PZA7QECY.js";import{A as C,R as F,_ as J,a as be,da as K,jd as W,oa as x,qc as Ce,t as V,u as Se}from"./chunk-CBUC4X7Q.js";import{u as I}from"./chunk-OXC5KBIQ.js";import"./chunk-3AZOATC2.js";import{Ib as z,Ke as g,Pe as f,Q as xe,Qe as y,a as we,t as q}from"./chunk-NRQCBUYD.js";import{o as R}from"./chunk-GSLOAEY2.js";import"./chunk-WSEIEDEK.js";import"./chunk-A5ZEMOVR.js";import{x as O}from"./chunk-I4SPJQQI.js";import{a as Ae,da as _e,y as ke}from"./chunk-TE6FBDHP.js";import{A as u,C as m}from"./chunk-K672XXGQ.js";import{a as ge}from"./chunk-XAWE4EAK.js";function Nt(t,e,o){return yt(t,x(e),o)}function $t(t,e){return wt(x(t),e)}var N={};ge(N,{PROFILE_SUBCOMMANDS:()=>to,formatProfileApplyHuman:()=>co,formatProfileLintHuman:()=>lo,formatProfileListHuman:()=>ro,formatProfileShowHuman:()=>so,runProfileApply:()=>ao,runProfileLint:()=>no,runProfileList:()=>oo,runProfileShow:()=>io});function Lt(t,e){let o=x(t.update);return xt({...t,update:o},e)}async function de(t){typeof t.description=="string"&&t.description.trim()==="-"&&(t.description=await C().resolveValue(t.description,"--description")??"")}import{readFile as uo}from"node:fs/promises";import po from"node:path";async function mo(t,e,o,n){let i=v(n),r=o.expectedResult??o.expected,a=await bt(t,e,{status:typeof o.status=="string"?o.status:void 0,expectedResult:typeof r=="string"?r:void 0,author:typeof o.author=="string"?o.author:i.author,message:typeof o.message=="string"?o.message:void 0,force:o.force===!0},i);await w(i,a),f(a,i)}async function fo(t,e){let o=typeof t.from=="string"?t.from.trim():"";if(o.length>0&&o!=="-"){if(e.getOptionValueSource("stdinJson")==="cli")throw new m("pm item mutate cannot combine --from <path> with explicit --stdin-json. Select one input source.",u.USAGE);try{return await uo(po.resolve(process.cwd(),o),"utf8")}catch(i){throw new m(`pm item mutate could not read --from ${o}: ${Ce(i)}`,u.USAGE,{code:"mutation_document_unreadable",required:"Pass a readable JSON, JSON Lines, or envelope document path, or `-` for stdin.",why:"The whole document must be available before any tracker write begins."})}}return await C().resolveValue("-","--stdin-json")??""}async function vo(t,e){let o=v(e),n=await fo(t,e);if(n.trim().length===0)throw new m("pm item mutate requires a non-empty JSON batch on stdin or via --from <path>.",u.USAGE);if(t.transactionId!==void 0&&(typeof t.transactionId!="string"||t.transactionId.trim().length===0))throw new m("pm item mutate requires --transaction-id <value> to be non-empty when provided.",u.USAGE);let i=R(process.cwd(),o.path),r=await I(i),a=await Pt({pmRoot:i,input:n,settings:r,...typeof t.transactionId=="string"?{transactionId:t.transactionId}:{},...typeof t.upsertKey=="string"?{upsertKey:t.upsertKey}:{}}),{mutations:l,references:c,rows:p}=a,h=a.transaction_id,S={transaction_id:h,transaction_id_source:a.transaction_id_source,...a.upsert_key===void 0?{}:{upsert_key:a.upsert_key}},A=le(t),M=z(typeof t.author=="string"?t.author:o.author,r.author_default);if(t.dryRun===!0){let T=await Dt({pmRoot:i,author:M,plan:a});f({...S,dry_run:!0,validation:T.validation,mutation_count:l.length,mutations:l,references:c,rows:T.rows},o);return}let E=await Ot({pmRoot:i,transactionId:h,author:M,mutations:l,...A});f({...E,...S,mutation_count:l.length,references:c,rows:p},o)}function ho(t,e){return typeof t=="string"&&t.trim().length>0?t.trim():typeof e=="string"?e.trim():""}async function yo(t,e,o,n){let i=v(n),r=typeof o.transactionId=="string"?o.transactionId.trim():"";if(r.length===0)throw new m("pm item complete requires --transaction-id <value>.",u.USAGE);let a=ho(e,o.reason);if(a.length===0)throw new m("pm item complete requires a close reason.",u.USAGE);let c=Object.fromEntries(["file","doc","test","comment","note","learning"].filter(k=>o[k]!==void 0).map(k=>[k,o[k]])),p=o.force===!0,{lockTtlSeconds:h,lockWaitMs:S}=le(o),A={...typeof o.resolution=="string"?{resolution:o.resolution}:{},...typeof o.expectedResult=="string"?{expectedResult:o.expectedResult}:{},...typeof o.actualResult=="string"?{actualResult:o.actualResult}:{},...typeof o.completedAt=="string"?{completedAt:o.completedAt}:{},...typeof o.validateClose=="string"?{validateClose:o.validateClose}:{},...p?{force:!0}:{}},M={id:t,reason:a,...Object.keys(c).length===0?{}:{evidence:c},...Object.keys(A).length===0?{}:{closeOptions:A},...p?{releaseOptions:{force:!0}}:{}},E=R(process.cwd(),i.path),T=z(typeof o.author=="string"?o.author:i.author,(await I(E)).author_default);if(o.dryRun===!0){let k=Ft(M),eo=await Rt({pmRoot:E,transactionId:r,author:T,mutations:k});f({transaction_id:r,dry_run:!0,validation:eo,mutation_count:k.length,mutations:k},i);return}let ye=await Mt({pmRoot:E,transactionId:r,author:T,...M,lockTtlSeconds:h,lockWaitMs:S});f({...ye,mutation_count:Object.keys(ye.results).length},i)}function Ht(t){let e=t.commands.find(o=>o.name()==="item")??t.command("item").description("Run item lifecycle operations.");e.command("reopen <id> <reason>").option("--status <value>","Active target status: open or in_progress").option("--expected-result <value>","Current active planning expectation; otherwise the receipt offers recovery").option("--expected <value>","Alias for --expected-result").option("--message <value>","Human-readable recurrence history message").option("--force","Override ownership or stale-lock conflicts").option("--author <value>","Mutation author").description("Reopen terminal work with recurrence evidence.").action(mo),e.command("mutate").option("--transaction-id <value>","Stable idempotency key used to resume an interrupted batch; derived from the document when omitted").option("--stdin-json","Read the JSON mutation array from stdin",!0).option("--from <path>","Read the JSON, JSON Lines, or envelope document from a file (- for stdin)").option("--upsert-key <field>","Update the existing item whose field matches instead of creating a duplicate").option("--dry-run","Validate and preview the batch without writing").option("--create-compensation <mode>","Created-item compensation policy: close or delete","close").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--author <value>","Mutation author").description("Apply SDK-backed mutations atomically.").action(vo),e.command("complete <id> [reason]").requiredOption("--transaction-id <value>","Stable idempotency key for the composed completion").option("--reason <value>","Close reason when omitted positionally").option("--file <value>","Linked file evidence",d).option("--doc <value>","Linked documentation evidence",d).option("--test <value>","Linked test evidence",d).option("--comment <value>","Evidence comment",d).option("--note <value>","Completion note",d).option("--learning <value>","Durable completion learning",d).option("--resolution <value>","Structured resolution evidence").option("--expected-result <value>","Expected result evidence").option("--actual-result <value>","Actual result evidence").option("--completed-at <value>","Actual completion time").option("--validate-close <mode>","Close validation: off, warn, or strict").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--dry-run","Validate and preview completion without writing").option("--force","Override lifecycle and ownership conflicts").option("--author <value>","Completion author").description("Close with evidence and release the claim.").action(yo)}async function go(t,e){let o=v(e),n=Array.isArray(t.event)?t.event:[],i=await lt(R(process.cwd(),o.path),{historyEvent:n,allActionable:t.allActionable===!0,dryRun:t.dryRun===!0,planFingerprint:s(t,"planFingerprint"),limit:t.limit,attributedAuthor:s(t,"attributedAuthor"),reviewer:s(t,"reviewer"),reason:s(t,"reason")});f(i,o)}function Ut(t){t.command("history-author-acknowledge").option("--event <item-id:line>","Unknown-author event coordinate (repeatable)",d).option("--all-actionable","Select all actionable events").option("--dry-run","Preview a deterministic source-bound plan").option("--plan-fingerprint <sha256>","Apply the exact fingerprint returned by --dry-run").option("--limit <n>","Maximum coordinate rows returned in the plan").option("--attributed-author <value>","Reviewed principal attribution").option("--reviewer <value>","Disposition reviewer").option("--reason <value>","Review evidence").description("Append audited dispositions for immutable unknown-author events.").action(go)}function Bt(t){let e=x(t.options);return kt({...t,options:e})}function ce(t,e,o,n){if(e.trim().toLowerCase()!=="add"||!o?.trim())return;let i=s(n,"add")??s(n,"text")??s(n,"note")??s(n,"body")??s(n,"comment"),r=s(n,"file"),a=[t,o.trim()];i!==void 0?a.push("--add",i):n.stdin===!0?a.push("--stdin"):r!==void 0?a.push("--file",r):a.push("--add","-");let l=O(a),c=O([t,o.trim(),"--add","-"]);throw new m(`The positional token "add" was parsed as the item id, while "${o.trim()}" was parsed as annotation text. ${t} does not use an add subcommand.`,u.USAGE,{code:"annotation_transposed_subcommand",reason:"noun_verb_object_transposition",required:`Place the item id immediately after ${t}, then use --add for annotation text.`,examples:[...new Set([l,c])],recovery:{attempted_command:`pm ${t} add ${o.trim()}`,normalized_args:[t,"add",o.trim()],parsed_positionals:[{role:"transposed_subcommand",value:"add"},{role:"item_id",value:o.trim()}],suggested_retry:l}})}var Gt={comments:["add","text","body","comment"],notes:["add","text","note"],learnings:["add","text"]};function wo(t,e,o,n,i){let r=Gt[t].some(l=>`--${l}`!==e&&s(i,l)!==void 0),a=i.delete!==void 0||i.edit!==void 0&&i.ifAbsent===!0;if(!(r||a||i.stdin===!0||s(i,"file")!==void 0||s(i,"addJson")!==void 0)){if(o==="--file")return n===void 0?void 0:["--file",n];if(o==="--stdin"||o.startsWith("--file="))return n===void 0?[o]:void 0}}function ue(t,e,o,n){let i=Gt[t].map(l=>({flag:`--${l}`,value:s(n,l)?.trim()})).find(l=>l.value!==void 0&&Re(l.value));if(i===void 0)return;let r=[t,e,...typeof n.edit=="number"?["--edit",String(n.edit)]:[]],a=wo(t,i.flag,i.value,o,n);throw Oe({collectionKey:t,textFlag:i.flag,value:i.value,commandPrefix:O(r),...a===void 0?{}:{retryArgs:[...r,...a]},...a===void 0&&o!==void 0&&i.value!=="--file"?{conflictingOperand:o}:{}})}function jt(t,e,o){let n=o.flatMap(r=>{let a=s(e,r);return a===void 0?[]:[{alias:r,value:a}]});if([...new Set(n.map(({value:r})=>r))].length>1)throw new m(`Specify ${t} text with one alias or the same value across aliases: ${n.map(({alias:r})=>`--${r}`).join(", ")}`,u.USAGE,{code:"annotation_alias_conflict"});return n[0]?.value}function bo(t,e){let o=typeof e.edit=="number"?e.edit:void 0,n=typeof e.delete=="number"?e.delete:void 0,i=jt("comment",e,["add","text","body","comment"]),r=typeof t=="string"?t:void 0,a=e.stdin===!0,l=s(e,"file");if(+(i!==void 0)+ +(r!==void 0)+Number(a)+ +(l!==void 0)>1)throw i!==void 0&&r!==void 0&&!a&&l===void 0?new m("Specify comment text either as positional [text] or with --add, not both",u.USAGE):new m("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file",u.USAGE);let p=i??r;return{add:p,readFromStdin:a,readFromFile:l,editIndex:o,deleteIndex:n,isMutation:typeof p=="string"||a||l!==void 0||o!==void 0||n!==void 0}}function qt(t,e,o){let n=jt(t,o,t==="note"?["add","text","note"]:["add","text"]),i=typeof e=="string"?e:void 0;if(n!==void 0&&i!==void 0)throw new m(`Specify ${t} text either as positional [text] or with --add, not both`,u.USAGE);let r=n??i,a=t==="note"?s(o,"addJson"):void 0,l=o.stdin===!0,c=s(o,"file"),p=typeof o.edit=="number"?o.edit:void 0,h=typeof o.delete=="number"?o.delete:void 0;return{add:r,addJson:a,readFromStdin:l,readFromFile:c,editIndex:p,deleteIndex:h,isMutation:typeof r=="string"||a!==void 0||l||c!==void 0||p!==void 0||h!==void 0}}function pe(t){return{fullHistory:t.fullHistory===!0,ifAbsent:t.ifAbsent===!0,expectAt:s(t,"expectAt"),author:s(t,"author"),message:s(t,"message"),ownershipAppendBypass:t.ownershipAppendBypass===!0,force:!!t.force}}async function So(t,e,o,n){let i=v(n),r=Date.now();ce("comments",t,e,o),ue("comments",t,e,o);let a=bo(e,o),l=await dt(t,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),...pe(o)},i);a.isMutation&&l.changed!==!1&&await w(i,l),me("comments",l,i,r)}async function Ao(t,e,o,n){let i=v(n),r=Date.now();ce("notes",t,e,o),ue("notes",t,e,o);let a=qt("note",e,o),l=await _t(t,{add:a.add,addJson:a.addJson,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),since:s(o,"since"),eventType:s(o,"eventType"),includeMeta:o.includeMeta===!0,...pe(o)},i);a.isMutation&&l.changed!==!1&&await w(i,l),me("notes",l,i,r)}async function ko(t,e,o,n){let i=v(n),r=Date.now();ce("learnings",t,e,o),ue("learnings",t,e,o);let a=qt("learning",e,o),l=await ht(t,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),...pe(o)},i);a.isMutation&&l.changed!==!1&&await w(i,l),me("learnings",l,i,r)}function me(t,e,o,n){f(e,o),o.profile&&y(`profile:command=${t} took_ms=${Date.now()-n}`)}function Vt(t,e){let o=t.command("comments").argument("<id>","Item id").argument("[text]","Optional comment text shorthand (equivalent to --add)").option("--add <text>","Append comment text; use text=<value> for structured input or - for stdin").option("--stdin","Read comment text from stdin (supports multiline markdown)").option("--file <path>","Read comment text from a file or stdin (-)").option("--edit <index>","Replace one comment using positional text, --add, --stdin, or --file",e("--edit")).option("--delete <index>","Delete the comment at 1-based <index>",e("--delete")).option("--expect-at <ts>","Edit/delete only if the entry's created_at is <ts>").option("--limit <n>","Return only latest n comments").option("--full-history","Return complete comment history instead of a bounded mutation receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Comment author; defaults to PM_AUTHOR or settings").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete comments for an item.").action(So);b(o,"--body <text>","Alias for --add",!1),b(o,"--text <text>","Alias for --add",!1),b(o,"--comment <text>","Alias for --add",!1);let n=t.command("notes").argument("<id>","Item id").argument("[text]","Optional note text shorthand for --add").option("--add <text>","Add a text note (- reads stdin)").option("--note <text>","Alias for --add").option("--add-json <json>","Append a JSON event").option("--stdin","Read note text from stdin").option("--file <path>","Read note from file or stdin (-)").option("--edit <index>","Replace a 1-based note using the selected text input",e("--edit")).option("--delete <index>","Delete the note at 1-based <index>",e("--delete")).option("--expect-at <ts>","Edit/delete only if the entry's created_at is <ts>").option("--limit <n>","Return only latest n notes").option("--since <timestamp>","Filter JSON events from this ISO time").option("--event-type <value>","Filter JSON events by top-level type").option("--include-meta","Include count and truncation metadata").option("--full-history","Return complete note history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Author; defaults to PM_AUTHOR/settings").option("--message <value>","History message").option("--force","Force ownership override").description("Manage merge-safe text notes and JSON context events.").action(Ao);b(n,"--text <text>","Alias for --add",!1);let i=t.command("learnings").argument("<id>","Item id").argument("[text]","Optional learning text shorthand for --add").option("--add <text>","Append learning text; use text=<value> or - for stdin").option("--stdin","Read learning text from stdin").option("--file <path>","Read learning text from a file or stdin (-)").option("--edit <index>","Replace one learning using positional text, --add, --stdin, or --file",e("--edit")).option("--delete <index>","Delete the learning at 1-based <index>",e("--delete")).option("--expect-at <ts>","Edit/delete only if the entry's created_at is <ts>").option("--limit <n>","Return only latest n learnings").option("--full-history","Return complete learning history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete learnings for an item.").action(ko);b(i,"--text <text>","Alias for --add",!1)}function fe(t,e){return o=>{let n=Number(o);if(!Number.isInteger(n)||n<e)throw new m(`${t} must be an integer greater than or equal to ${e}.`,u.USAGE);return n}}async function xo(t,e,o){let n=v(o);if(e.scope!==void 0&&e.scope!=="project"&&e.scope!=="global")throw new m("--scope must be either project or global.",u.USAGE);let i=await ft({paths:t,scope:e.scope,limit:typeof e.limit=="number"?e.limit:void 0,offset:typeof e.offset=="number"?e.offset:void 0,noTruncate:e.noTruncate===!0,strictRead:e.strictRead===!0,explain:e.explain===!0,lineRange:typeof e.lines=="string"?pt(e.lines):void 0,decisionDepth:typeof e.decisionDepth=="number"?e.decisionDepth:void 0},n);f(i,n)}function zt(t){t.command("lookup").argument("<paths...>","Project-relative or absolute source paths").option("--scope <scope>","Restrict links to project or global scope").option("--limit <n>","Maximum referencing items to return",fe("--limit",1)).option("--offset <n>","Number of referencing items to skip",fe("--offset",0)).option("--no-truncate","Return every referencing item").option("--strict-read","Fail when any authoritative item cannot be read").option("--explain","Include ranked source-to-work rationale").option("--lines <start:end>","Attribute an inclusive source line range").option("--decision-depth <n>","Maximum governing-decision relationship depth",fe("--decision-depth",1)).description("Find and explain pm items that govern requested source paths.").action(xo)}var _o=["add-","apply-","list-","remove-","show-"],Co=new Set(["field","fields","help","status","statuses","type","types"]);function ve(t){let e=t.trim(),o=e.toLowerCase();return o.length===0?!1:e[0]===o[0]||Co.has(o)||_o.some(n=>o.startsWith(n))}function G(t){if(t!=null){if(typeof t=="number"){if(!Number.isInteger(t))throw new m("--order must be a finite integer.",u.USAGE);return t}if(typeof t=="string"){if(t.trim().length===0)return;let e=Number(t);if(!Number.isInteger(e))throw new m("--order must be a finite integer.",u.USAGE);return e}throw new m("--order must be a finite integer.",u.USAGE)}}function $(t){if(Array.isArray(t))return t;if(typeof t=="string")return[t]}var L={};ge(L,{SCHEMA_SUBCOMMANDS:()=>De,_testOnlySchemaCommand:()=>st,formatSchemaAddFieldHuman:()=>tt,formatSchemaAddStatusHuman:()=>Xe,formatSchemaAddTypeHuman:()=>Ke,formatSchemaApplyPresetHuman:()=>at,formatSchemaEvolutionMigrationHuman:()=>Ie,formatSchemaInferTypesHuman:()=>rt,formatSchemaListFieldsHuman:()=>it,formatSchemaListHuman:()=>Ze,formatSchemaRemoveFieldHuman:()=>ot,formatSchemaRemoveStatusHuman:()=>Ye,formatSchemaRemoveTypeHuman:()=>We,formatSchemaShowFieldHuman:()=>nt,formatSchemaShowHuman:()=>Qe,formatSchemaShowStatusHuman:()=>et,runSchemaAddField:()=>Ge,runSchemaAddStatus:()=>$e,runSchemaAddType:()=>Pe,runSchemaApplyPreset:()=>ze,runSchemaEvolutionMigration:()=>Te,runSchemaInferTypes:()=>Je,runSchemaList:()=>He,runSchemaListFields:()=>qe,runSchemaRemoveField:()=>je,runSchemaRemoveStatus:()=>Le,runSchemaRemoveType:()=>Ne,runSchemaShow:()=>Ue,runSchemaShowField:()=>Ve,runSchemaShowStatus:()=>Be,runWorkflowPolicyAction:()=>B});function Ro(t,e){let o=e.normalizedSubcommand;return o!=="rename-type"&&o!=="rename-field"&&o!=="remap-status"?null:t.runSchemaEvolutionMigration({kind:o,from:e.typeName,to:s(e.options,"to"),...o==="rename-field"&&typeof e.options.type=="string"?{type:e.options.type}:{}},{migrationId:s(e.options,"migrationId")??s(e.options,"migration_id"),dryRun:e.options.dryRun===!0,author:e.author,force:e.force},e.globalOptions)}function Oo(t,e){let{normalizedSubcommand:o,typeName:n,globalOptions:i,author:r,force:a}=e;switch(o){case"list":return t.runSchemaList(i);case"show":return t.runSchemaShow(n,i);case"show-status":return t.runSchemaShowStatus(n,i);case"list-fields":return t.runSchemaListFields(i);case"show-field":return t.runSchemaShowField(n,i);case"remove-type":return t.runSchemaRemoveType(n,{author:r,force:a},i);case"remove-field":return t.runSchemaRemoveField(n,{author:r,force:a},i);case"remove-status":return t.runSchemaRemoveStatus(n,{author:r,force:a},i);case"apply-preset":return t.runSchemaApplyPreset(n,{author:r,force:a},i);default:return null}}async function Fo(t,e){let{normalizedSubcommand:o,typeName:n,options:i,globalOptions:r}=e,{author:a,force:l,description:c}=e,p=Ro(t,e);if(p)return p;let h=Oo(t,e);if(h)return h;switch(o){case"add-field":return t.runSchemaAddField(n,{type:typeof i.type=="string"?i.type:void 0,commands:e.commands,description:c,cliFlag:typeof i.cliFlag=="string"?i.cliFlag:void 0,alias:e.aliases,required:!!i.required,requiredOnCreate:!!i.requiredOnCreate,allowUnset:i.allowUnset!==!1,requiredTypes:e.requiredTypes,author:a,force:l},r);case"add-status":return t.runSchemaAddStatus(n,{role:e.roles,alias:e.aliases,description:c,order:e.order,author:a,force:l},r);default:return i.infer===!0?t.runSchemaInferTypes({minCount:e.minCount,apply:!!i.apply,author:a,force:l},r):t.runSchemaAddType(n,{description:c,defaultStatus:e.defaultStatus,folder:typeof i.folder=="string"?i.folder:void 0,alias:e.aliases,author:a,force:l},r)}}function Mo(t,e){if("migration_id"in e){g(`${t.formatSchemaEvolutionMigrationHuman(e)}
2
2
  `);return}switch(e.action){case"list":g(`${t.formatSchemaListHuman(e)}
3
3
  `);return;case"show":g(`${t.formatSchemaShowHuman(e)}
4
4
  `);return;case"show-status":g(`${t.formatSchemaShowStatusHuman(e)}
@@ -12,10 +12,10 @@ import{a as Tt}from"./chunk-HXQ3OHQR.js";import{a as It}from"./chunk-YPMNXG2C.js
12
12
  `);break;case"add-status":g(`${t.formatSchemaAddStatusHuman(e)}
13
13
  `);break;case"remove-status":g(`${t.formatSchemaRemoveStatusHuman(e)}
14
14
  `);break;default:g(`${t.formatSchemaAddTypeHuman(e)}
15
- `);break}e.warnings.length>0&&y(`schema ${e.action} warnings: ${U(e.warnings)}`)}function Jt(t){if(Array.isArray(t))return t.flatMap(e=>e.split(",")).map(e=>e.trim()).filter(e=>e.length>0)}async function Eo(t,e,o,n){let i=v(n),r=Date.now(),{SCHEMA_SUBCOMMANDS:a}=L,l=(t??"").trim().toLowerCase(),u=e;if(To(l,a),!a.includes(l)&&u===void 0&&!ve(t)&&(u=t,l="add-type"),!a.includes(l))throw F({command_path:"schema",token:l,allowed:a});let p=we.find(h=>h===l);if(be(l,o.dryRun===!0),p)f(await B(p,e,{definition:o.definition,policy:s(o,"policy"),message:s(o,"message"),author:s(o,"author"),dryRun:o.dryRun===!0},i),i);else{let h=await Fo(L,{normalizedSubcommand:l,typeName:u,options:o,aliases:$(o.alias),roles:$(o.role),commands:Jt(o.commands),requiredTypes:Jt(o.requiredTypes),defaultStatus:s(o,"defaultStatus")??s(o,"default_status"),order:G(o.order),minCount:G(o.minCount),author:s(o,"author"),force:!!o.force,description:s(o,"description"),globalOptions:i});i.json===!0||i.defaultOutputFormat==="json"?f(h,i):i.quiet||Mo(L,h)}i.profile&&y(`profile:command=schema took_ms=${Date.now()-r}`)}function To(t,e){if(!t)throw new m(`pm schema requires a subcommand. Allowed: ${e.join(", ")}`,c.USAGE,{code:"missing_required_argument",examples:["pm schema list","pm schema show Task","pm schema show-status open",'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',"pm schema remove-type Spike","pm schema add-status review --role active --alias in_review","pm schema remove-status review","pm schema add-field severity_level --type string --commands create,update","pm schema list-fields","pm schema apply-preset agile","pm schema add-type --infer --min-count 10","pm schema rename-type Spike --to Experiment --migration-id spike-v2 --dry-run","pm schema rename-field severity --to impact --migration-id severity-v2","pm schema remap-status review --to verifying --migration-id review-v2"]})}function Kt(t){let e=t.command("schema").option("--definition <json>","Policy or proposed fields JSON").option("--policy <id>","Policy id for policy-approve").option("--message <text>","Audit rationale for a policy mutation").argument("[subcommand]","Required; schema verb (list/show, add/remove, rename/remap, policy-*), or custom type shorthand").argument("[name]","Definition/source name or item id; policy-mode: advise|refuse").option("--description <text>","Type, status, or field description").option("--default-status <status>","Default status for this type").option("--folder <dir>","Storage folder for items of this custom type").option("--alias <name>","Alias for the custom type, status, or field flag (repeatable, csv-friendly)",d).option("--role <value>","Lifecycle role for a custom status (repeatable): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel",d).option("--order <n>","Display/sort order for a custom status").optionsGroup("Field options (add-field):").option("--type <type>","Value type for a custom field (add-field): string, number, boolean, string_array, array, object").option("--commands <list>","Field commands (repeatable/csv): create, update, update_many, list, search, calendar, context",d).option("--cli-flag <flag>","Override the auto-derived CLI flag for a custom field (add-field)").option("--required","Mark a custom field as always required (add-field)").option("--required-on-create","Mark a custom field as required at create time (add-field)").option("--no-allow-unset","Disallow clearing a custom field via --unset (add-field)").option("--required-types <list>","Restrict a custom field's requirement to specific item types (add-field; repeatable, comma-friendly)",d).optionsGroup("Type inference and migration options:").option("--infer","Infer custom item types from title-prefix conventions (add-type; preview unless --apply)").option("--min-count <n>","Minimum items sharing a prefix for add-type --infer (default 10)").option("--apply","Register inferred types (add-type --infer); without it the command previews only").option("--to <name>","Target definition name for rename/remap migrations").option("--migration-id <id>","Stable idempotency key for a resumable schema migration").option("--dry-run","Preview rename/remap migrations and workflow-policy actions without writes").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("Manage types, statuses, fields, presets, and workflow policies.");b(e,"--default_status <status>","Alias for --default-status",!1),b(e,"--migration_id <id>","Alias for --migration-id",!1),e.action(Eo)}var Io=new Set(Ae.map(t=>t.toLowerCase())),Do=new Set(Me.map(t=>t==="estimate"?"estimatedMinutes":t));async function Po(t,e,o,n,i){switch(e){case"list":return t.runProfileList();case"show":return t.runProfileShow(o);case"lint":return t.runProfileLint(o);default:return t.runProfileApply(o,{dryRun:n.dryRun===!0,author:typeof n.author=="string"?n.author:void 0,force:n.force===!0},i)}}function No(t,e){switch(e.action){case"list":g(`${t.formatProfileListHuman(e)}
15
+ `);break}e.warnings.length>0&&y(`schema ${e.action} warnings: ${U(e.warnings)}`)}function Jt(t){if(Array.isArray(t))return t.flatMap(e=>e.split(",")).map(e=>e.trim()).filter(e=>e.length>0)}async function Eo(t,e,o,n){let i=v(n),r=Date.now(),{SCHEMA_SUBCOMMANDS:a}=L,l=(t??"").trim().toLowerCase(),c=e;if(To(l,a),!a.includes(l)&&c===void 0&&!ve(t)&&(c=t,l="add-type"),!a.includes(l))throw F({command_path:"schema",token:l,allowed:a});let p=we.find(h=>h===l);if(be(l,o.dryRun===!0),p)f(await B(p,e,{definition:o.definition,policy:s(o,"policy"),message:s(o,"message"),author:s(o,"author"),dryRun:o.dryRun===!0},i),i);else{let h=await Fo(L,{normalizedSubcommand:l,typeName:c,options:o,aliases:$(o.alias),roles:$(o.role),commands:Jt(o.commands),requiredTypes:Jt(o.requiredTypes),defaultStatus:s(o,"defaultStatus")??s(o,"default_status"),order:G(o.order),minCount:G(o.minCount),author:s(o,"author"),force:!!o.force,description:s(o,"description"),globalOptions:i});i.json===!0||i.defaultOutputFormat==="json"?f(h,i):i.quiet||Mo(L,h)}i.profile&&y(`profile:command=schema took_ms=${Date.now()-r}`)}function To(t,e){if(!t)throw new m(`pm schema requires a subcommand. Allowed: ${e.join(", ")}`,u.USAGE,{code:"missing_required_argument",examples:["pm schema list","pm schema show Task","pm schema show-status open",'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',"pm schema remove-type Spike","pm schema add-status review --role active --alias in_review","pm schema remove-status review","pm schema add-field severity_level --type string --commands create,update","pm schema list-fields","pm schema apply-preset agile","pm schema add-type --infer --min-count 10","pm schema rename-type Spike --to Experiment --migration-id spike-v2 --dry-run","pm schema rename-field severity --to impact --migration-id severity-v2","pm schema remap-status review --to verifying --migration-id review-v2"]})}function Kt(t){let e=t.command("schema").option("--definition <json>","Policy or proposed fields JSON").option("--policy <id>","Policy id for policy-approve").option("--message <text>","Audit rationale for a policy mutation").argument("[subcommand]","Required; schema verb (list/show, add/remove, rename/remap, policy-*), or custom type shorthand").argument("[name]","Definition/source name or item id; policy-mode: advise|refuse").option("--description <text>","Type, status, or field description").option("--default-status <status>","Default status for this type").option("--folder <dir>","Storage folder for items of this custom type").option("--alias <name>","Alias for the custom type, status, or field flag (repeatable, csv-friendly)",d).option("--role <value>","Lifecycle role for a custom status (repeatable): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel",d).option("--order <n>","Display/sort order for a custom status").optionsGroup("Field options (add-field):").option("--type <type>","Value type for a custom field (add-field): string, number, boolean, string_array, array, object").option("--commands <list>","Field commands (repeatable/csv): create, update, update_many, list, search, calendar, context",d).option("--cli-flag <flag>","Override the auto-derived CLI flag for a custom field (add-field)").option("--required","Mark a custom field as always required (add-field)").option("--required-on-create","Mark a custom field as required at create time (add-field)").option("--no-allow-unset","Disallow clearing a custom field via --unset (add-field)").option("--required-types <list>","Restrict a custom field's requirement to specific item types (add-field; repeatable, comma-friendly)",d).optionsGroup("Type inference and migration options:").option("--infer","Infer custom item types from title-prefix conventions (add-type; preview unless --apply)").option("--min-count <n>","Minimum items sharing a prefix for add-type --infer (default 10)").option("--apply","Register inferred types (add-type --infer); without it the command previews only").option("--to <name>","Target definition name for rename/remap migrations").option("--migration-id <id>","Stable idempotency key for a resumable schema migration").option("--dry-run","Preview rename/remap migrations and workflow-policy actions without writes").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("Manage types, statuses, fields, presets, and workflow policies.");b(e,"--default_status <status>","Alias for --default-status",!1),b(e,"--migration_id <id>","Alias for --migration-id",!1),e.action(Eo)}var Io=new Set(Ae.map(t=>t.toLowerCase())),Do=new Set(Me.map(t=>t==="estimate"?"estimatedMinutes":t));async function Po(t,e,o,n,i){switch(e){case"list":return t.runProfileList();case"show":return t.runProfileShow(o);case"lint":return t.runProfileLint(o);default:return t.runProfileApply(o,{dryRun:n.dryRun===!0,author:typeof n.author=="string"?n.author:void 0,force:n.force===!0},i)}}function No(t,e){switch(e.action){case"list":g(`${t.formatProfileListHuman(e)}
16
16
  `);return;case"show":g(`${t.formatProfileShowHuman(e)}
17
17
  `);return;case"lint":g(`${t.formatProfileLintHuman(e)}
18
18
  `);return;default:g(`${t.formatProfileApplyHuman(e)}
19
- `),e.warnings.length>0&&y(`profile apply warnings: ${U(e.warnings)}`);break}}function $o(t){return e=>{let o=Number(e);if(!Number.isInteger(o)||o<1)throw new m(`${t} must be a positive integer (1-based index).`,c.USAGE);return o}}function Wt(t,e){t.option("--filter-has-notes",`Select only items that have notes before ${e}`).option("--filter-no-notes",`Select only items that have no notes before ${e}`).option("--filter-has-learnings",`Select only items that have learnings before ${e}`).option("--filter-no-learnings",`Select only items that have no learnings before ${e}`).option("--filter-has-files",`Select only items that have linked files before ${e}`).option("--filter-no-files",`Select only items that have no linked files before ${e}`).option("--filter-has-docs",`Select only items that have linked docs before ${e}`).option("--filter-no-docs",`Select only items that have no linked docs before ${e}`).option("--filter-has-tests",`Select only items that have linked tests before ${e}`).option("--filter-no-tests",`Select only items that have no linked tests before ${e}`).option("--filter-has-comments",`Select only items that have comments before ${e}`).option("--filter-no-comments",`Select only items that have no comments before ${e}`).option("--filter-has-deps",`Select only items that have dependencies before ${e}`).option("--filter-no-deps",`Select only items that have no dependencies before ${e}`).option("--filter-has-body",`Select only items that have a non-empty body before ${e}`).option("--filter-empty-body",`Select only items with an empty body before ${e}`).option("--filter-has-linked-command",`Select only items whose linked tests carry a runnable command before ${e}`).option("--filter-no-linked-command",`Select only items whose linked tests carry no runnable command before ${e}`).option("--filter-reviewer-missing",`Select only items missing reviewer before ${e}`).option("--filter-risk-missing",`Select only items missing risk before ${e}`).option("--filter-confidence-missing",`Select only items missing confidence before ${e}`).option("--filter-sprint-missing",`Select only items missing sprint before ${e}`).option("--filter-release-missing",`Select only items missing release before ${e}`)}var Lo=[["filterHasNotes","filterNoNotes","--filter-has-notes","--filter-no-notes"],["filterHasLearnings","filterNoLearnings","--filter-has-learnings","--filter-no-learnings"],["filterHasFiles","filterNoFiles","--filter-has-files","--filter-no-files"],["filterHasDocs","filterNoDocs","--filter-has-docs","--filter-no-docs"],["filterHasTests","filterNoTests","--filter-has-tests","--filter-no-tests"],["filterHasComments","filterNoComments","--filter-has-comments","--filter-no-comments"],["filterHasDeps","filterNoDeps","--filter-has-deps","--filter-no-deps"],["filterHasBody","filterEmptyBody","--filter-has-body","--filter-empty-body"],["filterHasLinkedCommand","filterNoLinkedCommand","--filter-has-linked-command","--filter-no-linked-command"]];function Xt(t){let e=o=>t[o]===!0?!0:void 0;for(let[o,n,i,r]of Lo)if(t[o]===!0&&t[n]===!0)throw new m(`Cannot combine ${i} with ${r} for the same field.`,c.USAGE);return{filterReviewerMissing:e("filterReviewerMissing"),filterRiskMissing:e("filterRiskMissing"),filterConfidenceMissing:e("filterConfidenceMissing"),filterSprintMissing:e("filterSprintMissing"),filterReleaseMissing:e("filterReleaseMissing"),hasNotes:e("filterHasNotes"),hasLearnings:e("filterHasLearnings"),hasFiles:e("filterHasFiles"),hasDocs:e("filterHasDocs"),hasTests:e("filterHasTests"),hasComments:e("filterHasComments"),hasDeps:e("filterHasDeps"),hasBody:e("filterHasBody"),hasLinkedCommand:e("filterHasLinkedCommand"),noNotes:e("filterNoNotes"),noLearnings:e("filterNoLearnings"),noFiles:e("filterNoFiles"),noDocs:e("filterNoDocs"),noTests:e("filterNoTests"),noComments:e("filterNoComments"),noDeps:e("filterNoDeps"),emptyBody:e("filterEmptyBody"),noLinkedCommand:e("filterNoLinkedCommand")}}function he(t,e){for(let o of e){let n=[],i=t.args,r=a=>(t.args!==i&&(n.length=0,i=t.args),n.push(a),n);o.required?t.requiredOption(o.option,o.description):o.repeatable?t.option(o.option,o.description,r):t.option(o.option,o.description);for(let a of o.aliasOptions??[])W(o.option,a.option)?b(t,a.option,a.description,o.repeatable===!0,o.repeatable?r:void 0):o.repeatable?t.option(a.option,a.description,r):t.option(a.option,a.description)}}function Ho(t){let e=o=>typeof t[o]=="string"?t[o]:void 0;return{type:e("filterType"),tag:e("filterTag"),priority:e("filterPriority"),deadlineBefore:e("filterDeadlineBefore"),deadlineAfter:e("filterDeadlineAfter"),updatedAfter:e("filterUpdatedAfter"),updatedBefore:e("filterUpdatedBefore"),createdAfter:e("filterCreatedAfter"),createdBefore:e("filterCreatedBefore"),ids:e("ids"),assignee:e("filterAssignee"),assigneeFilter:e("filterAssigneeFilter")??e("filterAssignee_filter"),parent:e("filterParent"),sprint:e("filterSprint"),release:e("filterRelease"),filterAcMissing:t.filterAcMissing===!0?!0:void 0,filterEstimatesMissing:t.filterEstimatesMissing===!0||t.filterEstimateMissing===!0?!0:void 0,filterResolutionMissing:t.filterResolutionMissing===!0?!0:void 0,filterMetadataMissing:t.filterMetadataMissing===!0?!0:void 0,...Xt(t),limit:e("limit"),offset:e("offset"),includeBody:!0}}function H(...t){for(let e of t)if(typeof e=="string")return e}function Uo(t,e,o){if(!(t!=="many"||e!==void 0||o.title!==void 0||o.type!==void 0))throw new m("pm create many is not a command; bulk creation is pm item mutate.",c.USAGE,{code:"bulk_create_route",required:"Pipe a JSON array, JSON Lines, or {schema_version, mutations} document to pm item mutate, or pass --from <path>.",why:"pm item mutate commits every record in one workspace transaction with a replay-safe transaction id, so an interrupted or repeated import never duplicates items.",nextSteps:["pm item mutate --from items.jsonl --dry-run --json","pm item mutate --from items.jsonl --upsert-key external_id --json","pm guide lifecycle"],examples:["pm item mutate --from items.jsonl --json",`printf '%s\\n' '{"title":"First","type":"Task"}' '{"title":"Second","type":"Task"}' | pm item mutate --json`]})}function Bo(t,e,o){return typeof e=="string"&&e.length>0?{positionalType:t,positionalTitle:e}:typeof t!="string"||t.length===0?{positionalType:void 0,positionalTitle:void 0}:typeof o.title=="string"&&o.title.trim().length>0&&o.type===void 0?{positionalType:t,positionalTitle:void 0}:{positionalType:void 0,positionalTitle:t}}function Go(t,e,o,n){if(t!==void 0||typeof e!="string"||e.length===0||o.title!==void 0||o.type!==void 0||!Io.has(e.trim().toLowerCase()))return;let i=e.trim(),r=Et(),a=r.length===0?"":`
20
- The CLI read ${r.map(l=>`"${l.from}" as ${l.flag}`).join(", ")}; pass --title to keep text as the title.`;throw new m(`pm create needs a title: "${i}" looks like an item type. Pass the title with --title or as a second positional.${a}`,c.USAGE,{code:"create_positional_type_without_title",why:'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "'+i+'".',examples:[`pm create ${i} --title "Wire up SSO for the agent harness"`,`pm create ${i} "Wire up SSO for the agent harness"`,`pm create "Wire up SSO for the agent harness" --type ${i}`],nextSteps:r.length===0?[`Pass the title as an option: ${O(["create",i,"--title","<title>",...n])}`]:r.map(l=>`Keep "${l.from}" as the title: ${O(["create",i,"--title",l.from,...n])}`)})}var jo=["body","bodyFile","description","dep","depRemove","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ids"];function j(t){let e=jo.flatMap(o=>{let n=t[o],i=typeof n=="string"&&n.trim()==="-"?1:Array.isArray(n)?n.filter(a=>typeof a=="string"&&a.trim()==="-").length:0,r=`--${o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`)}`;return Array.from({length:i},()=>r)});if(t.stdinJson===!0&&e.unshift("--stdin-json"),e.length>1)throw new m(`Only one option may consume stdin per command invocation. Found: ${e.join(", ")}.`,c.USAGE)}function Yt(t,e,o){let n=[];e&&n.push("body"),o&&n.push("description"),Se(t,n)}function Zt(t,e){return!e&&typeof t.description=="string"&&t.description.trim()==="-"}async function Qt(t,e,o,n){let i=await I(R(process.cwd(),n.path));return Ct(t,e,o,_e(i.schema).definitions)}async function qo(t,e,o,n){let i=v(n),r=Date.now();j(o);let a=o.stdinJson===!0;if(a){let A=await C().resolveValue("-","--stdin-json");o=await Qt(A??"","create",o,i)}Uo(t,e,o);let l=Bo(t,e,o);Go(l.positionalType,l.positionalTitle,o,xe(i)),typeof l.positionalType=="string"&&l.positionalType.length>0&&o.type===void 0&&(o.type=l.positionalType),typeof l.positionalTitle=="string"&&l.positionalTitle.length>0&&o.title===void 0&&(o.title=l.positionalTitle);let u=Zt(o,a);a||await de(o);let p=typeof o.bodyFile=="string";p&&(o.body=await K(String(o.bodyFile),o.body!==void 0?String(o.body):void 0),delete o.bodyFile);let h=Y(o,{requireType:!1});Yt(h,p,u),a&&V(h);let S=await $t(h,i);await w(i,S),f(S,i),i.profile&&y(`profile:command=create took_ms=${Date.now()-r}`)}function Vo(t){return{type:s(t,"filterType"),tag:s(t,"filterTag"),priority:s(t,"filterPriority"),deadlineBefore:s(t,"filterDeadlineBefore"),deadlineAfter:s(t,"filterDeadlineAfter"),updatedAfter:s(t,"filterUpdatedAfter"),updatedBefore:s(t,"filterUpdatedBefore"),createdAfter:s(t,"filterCreatedAfter"),createdBefore:s(t,"filterCreatedBefore"),ids:s(t,"ids"),assignee:s(t,"filterAssignee"),assigneeFilter:H(t.filterAssigneeFilter,t.filterAssignee_filter),parent:s(t,"filterParent"),sprint:s(t,"filterSprint"),release:s(t,"filterRelease"),...Xt(t),limit:s(t,"limit"),offset:s(t,"offset")}}async function zo(t,e){let o=v(e),n=Date.now();j(t),t.ids=await J(s(t,"ids"));let i=await gt({status:s(t,"filterStatus"),list:Vo(t),reason:s(t,"reason"),completedAt:s(t,"completedAt"),resolution:s(t,"resolution"),expectedResult:H(t.expectedResult,t.expected_result,t.expected),actualResult:H(t.actualResult,t.actual_result,t.actual),validateClose:t.validateClose===!0?"warn":s(t,"validateClose"),author:s(t,"author"),message:s(t,"message"),force:!!t.force,dryRun:t.dryRun===!0?!0:void 0,rollback:s(t,"rollback"),checkpoint:t.checkpoint===!1?!1:void 0},o);await w(o,i),f(i,o),o.profile&&y(`profile:command=close-many took_ms=${Date.now()-n}`)}async function Jo(t,e){let o=v(e),n=Date.now();j(t),t.ids=await J(s(t,"ids"));let i=await Lt({status:s(t,"filterStatus"),list:Ho(t),update:Z(Ee(t)),dryRun:t.dryRun===!0?!0:void 0,rollback:s(t,"rollback"),checkpoint:t.checkpoint===!1?!1:void 0},o);await w(o,i),f(await D("update-many",[],t,o,i),o),o.profile&&y(`profile:command=update-many took_ms=${Date.now()-n}`)}async function Ko(t,e,o,n){let i=v(n),r=Date.now(),a=typeof o.reason=="string"&&o.reason.trim().length>0&&o.reason||typeof o.closeReason=="string"&&o.closeReason.trim().length>0&&o.closeReason||void 0,l=typeof e=="string"&&e.length>0?e:a,p=await(o.releaseAssignment===!0?St:te)(t,l,{author:s(o,"author"),message:s(o,"message"),validateClose:o.validateClose===!0?"warn":s(o,"validateClose"),force:!!o.force,duplicateOf:s(o,"duplicateOf"),completedAt:s(o,"completedAt"),resolution:s(o,"resolution"),expectedResult:H(o.expectedResult,o.expected_result,o.expected),actualResult:H(o.actualResult,o.actual_result,o.actual)},i);await w(i,p),f(p,i),i.profile&&y(`profile:command=close took_ms=${Date.now()-r}`)}function Wo(t){let e={...t},o=[["blocked_by","blockedBy"],["resume_context","resumeContext"],["from_search","fromSearch"],["step_title","stepTitle"],["step_body","stepBody"],["step_owner","stepOwner"],["step_status","stepStatus"],["step_evidence","stepEvidence"],["step_blocked_reason","stepBlockedReason"],["step_replacement","stepReplacement"],["depends_on","dependsOn"],["link_kind","linkKind"],["link_note","linkNote"],["promote_to_item_dep","promoteToItemDep"],["allow_multiple_active","allowMultipleActive"],["decision_text","decisionText"],["decision_rationale","decisionRationale"],["decision_evidence","decisionEvidence"],["discovery_text","discoveryText"],["validation_text","validationText"],["validation_command","validationCommand"],["validation_expected","validationExpected"],["materialize_type","materializeType"],["materialize_parent","materializeParent"],["materialize_tags","materializeTags"]];for(let[i,r]of o)e[i]!==void 0&&e[r]===void 0&&(e[r]=e[i]);let n=Y(e,{requireType:!1});return n.blockedBy=e.blockedBy,n}function Xo(t,e){if(!t)throw new m(`pm plan requires a subcommand. Allowed: ${e.join(", ")}`,c.USAGE,{code:"missing_required_argument",examples:['pm plan create --title "Refactor lock retry"',"pm plan show pm-a1b2 --depth standard",'pm plan add-step pm-a1b2 --step-title "Read lock.ts"']});if(e.includes(t))return;throw F({command_path:"plan",token:t,allowed:e,examples:t==="list"||t==="ls"?["pm list --type Plan","pm list --all --type Plan"]:void 0,retry_command:t==="list"||t==="ls"?"pm list --type Plan":void 0})}function Yo(t,e){if(t!=="reorder-step"||typeof e!="string")return;let o=Number.parseInt(e,10);if(!Number.isFinite(o))throw new m(`reorder-step requires an integer new order, got "${e}"`,c.USAGE);return o}async function Zo(t,e,o,n,i,r){let a=v(r),l=Date.now(),u=(t??"").trim().toLowerCase();Xo(u,At);let p=Wo(i),h=Yo(u,n),S=u==="create"&&typeof e=="string"&&e.length>0&&p.title===void 0?void 0:e;S===void 0&&typeof e=="string"&&e.length>0&&(p.title=e);let A=await Bt({subcommand:u,id:S,stepRef:o,reorderTo:h,options:p,global:a});await w(a,A),f(A,a),a.profile&&y(`profile:command=plan took_ms=${Date.now()-l}`)}async function Qo(t,e,o){if(t!==void 0)throw new m("merge reconcile takes no positional arguments.",c.USAGE);let n=await se({dryRun:e.dryRun===!0,force:e.force===!0,stage:e.stage===!0,message:typeof e.message=="string"?e.message:void 0,author:o.author},o);f(n,o),n.ok||(process.exitCode=c.GENERIC_FAILURE)}async function ei(t,e,o,n,i,r){if(t===void 0||e===void 0||o===void 0||n===void 0)throw new m("merge driver requires <artifact> <base> <ours> <theirs> (git supplies %O %A %B). Example: pm merge driver history %O %A %B",c.USAGE);let a=await re({artifact:t,basePath:e,oursPath:o,theirsPath:n,outputPath:typeof i.output=="string"?i.output:void 0,itemPath:typeof i.itemPath=="string"?i.itemPath:void 0,prefer:typeof i.prefer=="string"?i.prefer:void 0},r);f(a,r),a.ok||(process.exitCode=c.GENERIC_FAILURE)}async function ti(t,e,o,n,i,r,a){let l=v(a),u=Date.now();switch(t.trim().toLowerCase()){case"install":{if(e!==void 0)throw new m("merge install takes no positional arguments.",c.USAGE);let h=await Q({dryRun:r.dryRun===!0,preCommitHook:r.preCommitHook===!0},l);f(h,l);break}case"reconcile":await Qo(e,r,l);break;case"report":{if(e!==void 0)throw new m("merge report takes no positional arguments.",c.USAGE);let h=await ee({includeReconciled:r.includeReconciled===!0});f(h,l),h.ok||(process.exitCode=c.GENERIC_FAILURE);break}case"driver":await ei(e,o,n,i,r,l);break;default:throw F({command_path:"merge",token:t,allowed:q,display_name:"merge"})}l.profile&&y(`profile:command=merge took_ms=${Date.now()-u}`)}async function oi(t,e,o){let n=v(o),i=Date.now(),r=await oe(t,{title:s(e,"title"),author:s(e,"author"),message:s(e,"message"),allowDuplicate:e.allowDuplicate===!0},n);await w(n,r),f(r,n),n.profile&&y(`profile:command=copy took_ms=${Date.now()-i}`)}async function ii(t,e,o){let n=v(o),i=Date.now(),r=await ne(t,{clear:e.clear===!0},n);f(r,n),n.profile&&y(`profile:command=focus took_ms=${Date.now()-i}`)}async function ni(t,e,o){let n=v(o),i=Date.now();j(e);let r=e.stdinJson===!0;if(r){let h=await C().resolveValue("-","--stdin-json");e=await Qt(h??"","update",e,n)}let a=Zt(e,r);r||await de(e);let l=typeof e.bodyFile=="string";l&&(e.body=await K(String(e.bodyFile),e.body!==void 0?String(e.body):void 0),delete e.bodyFile);let u=Z(e);Yt(u,l,a),r&&V(u);let p=await It(t,u,n);await w(n,p),f(await D("update",[t],e,n,p),n),n.profile&&y(`profile:command=update took_ms=${Date.now()-i}`)}async function ai(t,e,o){let n=v(o),i=Date.now(),r=await ie(t,{author:s(e,"author"),message:s(e,"message"),force:!!e.force,dryRun:e.dryRun===!0},n);r.dry_run!==!0&&await w(n,r),f(r,n),n.profile&&y(`profile:command=delete took_ms=${Date.now()-i}`)}function ri(t,e){let o=s(e,"body"),n=s(e,"text"),i=typeof t=="string"?t:void 0;if([o,n,i].filter(l=>l!==void 0).length>1)throw new m("Specify append text with exactly one source: positional [text], --body, or --text",c.USAGE);let a=o??n??i;if(a===void 0)throw new m("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).",c.USAGE);return a}async function si(t,e,o,n){let i=v(n),r=Date.now(),a=await Nt(t,{body:ri(e,o),author:s(o,"author"),message:s(o,"message"),force:!!o.force},i);await w(i,a),f(a,i),i.profile&&y(`profile:command=append took_ms=${Date.now()-r}`)}async function li(t,e,o,n){let i=v(n),r=Date.now(),{PROFILE_SUBCOMMANDS:a}=N,l=(t??"").trim().toLowerCase();if(!l)throw new m(`pm profile requires a subcommand. Allowed: ${a.join(", ")}`,c.USAGE,{code:"missing_required_argument",examples:["pm profile list","pm profile show agile","pm profile apply agile --dry-run","pm profile lint agile"]});if(!a.includes(l))throw F({command_path:"profile",token:l,allowed:a});let u=await Po(N,l,e,o,i);i.json===!0||i.defaultOutputFormat==="json"?f(u,i):i.quiet||No(N,u),u.action==="lint"&&!u.ok&&(process.exitCode=c.GENERIC_FAILURE),i.profile&&y(`profile:command=profile took_ms=${Date.now()-r}`)}function _(t,e){return $(t[e])??[]}async function di(t,e,o){let n=v(o),i=Date.now(),r=_(e,"add"),a=_(e,"addGlob"),l=_(e,"remove"),u=_(e,"migrate"),p=await mt(t,{add:r,addGlob:a,remove:l,migrate:u,note:s(e,"note"),noteConflict:s(e,"noteConflict"),list:!!e.list,appendStable:!!e.appendStable,validatePaths:!!e.validatePaths,fullHistory:e.fullHistory===!0,author:s(e,"author"),message:s(e,"message"),force:!!e.force},n);(r.length>0||a.length>0||l.length>0||u.length>0)&&await w(n,p),f(await D("files",[t],e,n,p),n),n.profile&&y(`profile:command=files took_ms=${Date.now()-i}`)}async function ui(t,e,o){let n=v(o),i=Date.now(),r={...o.optsWithGlobals(),...e},a=await vt(t,{apply:!!r.apply,note:s(r,"note"),appendStable:!!r.appendStable,author:s(r,"author"),message:s(r,"message"),force:!!r.force},n);a.changed&&await w(n,a),f(a,n),n.profile&&y(`profile:command=files.discover took_ms=${Date.now()-i}`)}async function ci(t,e,o){let n=v(o),i=Date.now(),r=_(e,"add"),a=_(e,"addGlob"),l=_(e,"remove"),u=_(e,"migrate"),p=await ct(t,{add:r,addGlob:a,remove:l,migrate:u,note:s(e,"note"),noteConflict:s(e,"noteConflict"),list:!!e.list,validatePaths:!!e.validatePaths,fullHistory:e.fullHistory===!0,author:s(e,"author"),message:s(e,"message"),force:!!e.force},n);(r.length>0||a.length>0||l.length>0||u.length>0)&&await w(n,p),f(await D("docs",[t],e,n,p),n),n.profile&&y(`profile:command=docs took_ms=${Date.now()-i}`)}async function pi(t,e,o){let n=v(o),i=Date.now(),r=await ut(t,{format:e.format,maxDepth:s(e,"maxDepth"),collapse:e.collapse,summary:e.summary===!0,full:e.full===!0,nodeLimit:s(e,"nodeLimit"),edgeLimit:s(e,"edgeLimit"),tokenBudget:s(e,"tokenBudget"),cursor:s(e,"cursor"),direction:s(e,"direction"),...Array.isArray(e.kind)?{kind:e.kind}:{}},n);f(r,n),n.profile&&y(`profile:command=deps took_ms=${Date.now()-i}`)}function wa(t,e={}){let o=t.command("create").argument("[type-or-title]",'Title, or type followed by title (e.g. task "Fix bug")').argument("[title]","Title following an item type").description("Create a new project management item.");if(he(o,X),o.option("--stdin-json","Item JSON from stdin; explicit flags override").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--allow-duplicate","Explicitly create even when strict similarity governance finds likely duplicates").option("--inherit-focus","Use saved focus as parent (CLI default; SDK/MCP opt in)",!0).option("--no-inherit-focus","Ignore saved focus; --unset parent also suppresses it").action(qo),e.targetCommandName==="create")return;t.command("copy").argument("<id>","Source item id").option("--title <value>","Optional title override for the copied item").option("--author <value>","Mutation author").option("--message <value>","History message").option("--allow-duplicate","Explicitly copy even when strict similarity governance finds likely duplicates").description("Copy an item into a new item id while resetting lifecycle fields.").action(oi),t.command("focus").argument("[id]","Item id to focus (omit to show current focus)").option("--clear","Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(ii);let n=t.command("update").argument("<id>","Item id").description("Update item fields and metadata.");he(n,Fe),n.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--replace-deps","Atomically replace dependency entries with the provided --dep values").option("--replace-tests","Atomically replace linked test entries with the provided --test values").option("--replace-files","Atomically replace linked file entries with the provided --file values").option("--replace-docs","Atomically replace linked doc entries with the provided --doc values").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--force","Force ownership override"),n.action(ni),Ht(t);let i=t.command("update-many").description("Bulk-update matched items with dry-run plans and rollback checkpoints.").option("--filter-status <value>","Filter by status before applying updates").option("--filter-type <value>","Filter by item type before applying updates").option("--filter-tag <value>","Filter by tag before applying updates").option("--filter-priority <value>","Filter by priority before applying updates").option("--filter-deadline-before <value>","Filter by deadline upper bound before applying updates").option("--filter-deadline-after <value>","Filter by deadline lower bound before applying updates").option("--filter-updated-after <value>","Filter by updated_at lower bound before applying updates (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before applying updates (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before applying updates (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before applying updates (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before applying updates").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before applying updates").option("--filter-parent <value>","Filter by parent item ID before applying updates").option("--filter-sprint <value>","Filter by sprint before applying updates").option("--filter-release <value>","Filter by release before applying updates").option("--filter-ac-missing","Select only items missing acceptance_criteria (bulk backfill)").option("--filter-estimates-missing","Select only items missing estimated_minutes (bulk backfill)").option("--filter-resolution-missing","Select only terminal items missing resolution (bulk backfill)").option("--filter-metadata-missing","Select only items missing any tracked metadata (AC, estimate, or resolution)");Wt(i,"applying updates"),i.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--dry-run","Preview per-item diffs and checkpoint intent without mutating").option("--rollback <value>","Rollback a prior update-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode").option("--title, -t <value>","Set title").option("--description, -d <value>","Set description").option("--body, -b <value>","Set body (allow empty string)").option("--status, -s <value>","Set status (use close command for closed)").option("--priority, -p <value>","Set priority").option("--type <value>","Set type").option("--tags <value>","Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.").option("--add-tags <value>","Add tags additively without replacing existing (repeatable; CSV accepted)",d).option("--remove-tags <value>","Remove tags from the existing list (repeatable; CSV accepted)",d).option("--deadline <value>","Set deadline (ISO/date string or relative)").option("--estimate, --estimated-minutes <value>","Set estimated minutes").option("--acceptance-criteria <value>","Set acceptance criteria").option("--ac <value>","Alias for --acceptance-criteria").option("--add-ac <value>","Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",d).option("--remove-ac <value>","Remove one semicolon-free acceptance criterion by exact text match (repeatable)",d).option("--definition-of-ready <value>","Set definition of ready").option("--order <value>","Set planning order/rank integer").option("--rank <value>","Alias for --order").option("--goal <value>","Set goal identifier").option("--objective <value>","Set objective identifier").option("--value <value>","Set business value summary").option("--impact <value>","Set business impact summary").option("--outcome <value>","Set expected outcome summary").option("--why-now <value>","Set why-now rationale").option("--assignee <value>","Set assignee").option("--parent <value>","Set parent item ID").option("--reviewer <value>","Set reviewer").option("--risk <value>","Set risk level").option("--confidence <value>","Set confidence level").option("--sprint <value>","Set sprint identifier").option("--release <value>","Set release identifier").option("--blocked-by <value>","Set blocked-by item ID or reason").option("--blocked-reason <value>","Set blocked reason").option("--unblock-note <value>","Set unblock rationale note").option("--reporter <value>","Set issue reporter").option("--severity <value>","Set issue severity").option("--environment <value>","Set issue environment context").option("--repro-steps <value>","Set issue reproduction steps").option("--resolution <value>","Set issue resolution summary").option("--expected-result <value>","Set issue expected behavior").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Set issue observed behavior").option("--actual <value>","Short alias for --actual-result").option("--affected-version <value>","Set affected version identifier").option("--fixed-version <value>","Set fixed version identifier").option("--component <value>","Set issue component ownership").option("--regression [value]","Set regression marker; bare flag means true, or pass true|false|1|0").option("--customer-impact <value>","Set customer impact summary").option("--dep <value>","Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>",d).option("--dep-remove <value>","Remove dependency entries by id/kind/author/timestamp signature",d).option("--replace-deps","Atomically replace dependency entries with provided --dep values").option("--replace-tests","Atomically replace linked tests with provided --test values").option("--replace-files","Atomically replace linked files with provided --file values").option("--replace-docs","Atomically replace linked docs with provided --doc values").option("--comment <value>","Add comment seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--note <value>","Add note seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--learning <value>","Add learning seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--file <value>","Add linked file path=<value>,scope=<project|global>,note=<text>",d).option("--test <value>","Add linked test command=<value>,path=<value>,scope=<project|global>",d).option("--doc <value>","Add linked doc path=<value>,scope=<project|global>,note=<text>",d).option("--reminder <value>","Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>",d).option("--event <value>","Add event entry start=<iso|relative>,end=<iso|relative>,recur_*",d).option("--type-option <value>","Set type options key=value (repeatable)",d).option("--unset <field>","Clear scalar fields by name (repeatable or csv)",d).option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override"),P(i,[["--filter-assignee_filter <value>","Alias for --filter-assignee-filter"],["--estimated_minutes <value>","Alias for --estimated-minutes"],["--acceptance_criteria <value>","Alias for --acceptance-criteria"],["--definition_of_ready <value>","Alias for --definition-of-ready"],["--why_now <value>","Alias for --why-now"],["--blocked_by <value>","Alias for --blocked-by"],["--blocked_reason <value>","Alias for --blocked-reason"],["--unblock_note <value>","Alias for --unblock-note"],["--repro_steps <value>","Alias for --repro-steps"],["--expected_result <value>","Alias for --expected-result"],["--actual_result <value>","Alias for --actual-result"],["--affected_version <value>","Alias for --affected-version"],["--fixed_version <value>","Alias for --fixed-version"],["--customer_impact <value>","Alias for --customer-impact"],["--filter-estimate-missing","Alias for --filter-estimates-missing"]],!1),P(i,[["--dep_remove <value>","Alias for --dep-remove"],["--type_option <value>","Alias for --type-option"],["--add_tags <value>","Alias for --add-tags"],["--remove_tags <value>","Alias for --remove-tags"],["--add_ac <value>","Alias for --add-ac"],["--remove_ac <value>","Alias for --remove-ac"]],!0),i.action(Jo);let r=t.command("close").option("--release-assignment","Release ownership after closure").argument("<id>","Item id").argument("[text]","Close reason text (alias: --reason)").option("-r, --reason <value>","Close reason text (alias for positional <text>)").option("--close-reason <value>","Close reason text (alias for positional <text>)").option("--completed-at <value>","Actual completion timestamp (ISO or relative), distinct from tracker close time").option("-d, --duplicate-of <id>","Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata").option("--author <value>","Mutation author").option("-m, --message <value>","History message").option("--validate-close [mode]",'Validate closure metadata before close: "off", "warn", or "strict" (default: settings governance preset)').option("--resolution <value>","Closure resolution summary (checked by --validate-close strict)").option("--expected-result <value>","Expected outcome for closure validation").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Observed outcome for closure validation").option("--actual <value>","Short alias for --actual-result").option("--force","Force ownership override").description("Close an item. Close reason requirement follows governance.require_close_reason.");b(r,"--expected_result <value>","Alias for --expected-result",!1),b(r,"--actual_result <value>","Alias for --actual-result",!1),r.action(Ko);let a=t.command("close-many").description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).").option("--filter-status <value>","Filter by status before closing").option("--filter-type <value>","Filter by item type before closing").option("--filter-tag <value>","Filter by tag before closing").option("--filter-priority <value>","Filter by priority before closing").option("--filter-deadline-before <value>","Filter by deadline upper bound before closing").option("--filter-deadline-after <value>","Filter by deadline lower bound before closing").option("--filter-updated-after <value>","Filter by updated_at lower bound before closing (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before closing (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before closing (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before closing (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before closing").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before closing").option("--filter-parent <value>","Filter by parent item ID before closing").option("--filter-sprint <value>","Filter by sprint before closing").option("--filter-release <value>","Filter by release before closing");Wt(a,"closing"),a.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--reason <value>","Shared close reason applied to matched items (required when governance.require_close_reason is enabled)").option("--completed-at <value>","Actual completion timestamp (ISO or relative) applied to every matched item").option("--resolution <value>","Shared closure resolution applied to every matched item (closure-validation field)").option("--expected-result <value>","Shared expected-result note (closure-validation field)").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Shared actual-result note (closure-validation field)").option("--actual <value>","Short alias for --actual-result").option("--validate-close [mode]",'Validate closure metadata per item: "off", "warn", or "strict" (default: settings governance preset)').option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Re-close already-terminal matches and override ownership").option("--dry-run","Preview matched items + per-item skip/active-child plan without mutating").option("--rollback <value>","Rollback a prior close-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode"),b(a,"--filter-assignee_filter <value>","Alias for --filter-assignee-filter",!1),b(a,"--expected_result <value>","Alias for --expected-result",!1),b(a,"--actual_result <value>","Alias for --actual-result",!1),a.action(zo),t.command("delete").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").option("--dry-run","Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(ai),t.command("append").argument("<id>","Item id").argument("[text]","Body text; same as --body (- reads stdin)").option("--body <value>","Text to append to body (or - for stdin)").option("--text <value>","Alias for --body").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override").description("Append text to an item's body. For concurrent writes, use pm notes.").action(si);let l=t.command("plan").description("Plan workflow: create, manage steps and dependencies, approve, and materialize.").argument("[subcommand]","Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize").argument("[id]","Plan id (non-create); positional title for create").argument("[step]","Step reference: stable id (plan-step-001) or order integer").argument("[new-order]","New order integer for reorder-step").option("--title <value>","Plan title").option("--description <value>","Plan description").option("--scope <value>","Change or investigation scope").option("--parent <value>","Parent pm item id").option("--inherit-focus","Create under saved focus (CLI default)",!0).option("--no-inherit-focus","Create without saved focus").option("--related <value>","Related item ids (repeatable CSV)",d).option("--blocks <value>","Blocked item ids (repeatable CSV)",d).option("--blocked-by <value>","Blocking item ids (repeatable CSV)",d).option("--harness <value>","Plan harness provenance: codex|claude-code|cursor|generic").option("--mode <value>","Plan mode: draft|research|review|approved|executing|paused|completed|superseded").option("--resume-context <value>","Compact context summary for a future stateless agent").option("--tags <value>","Comma-separated tags").option("--priority <value>","Priority 0-4").option("--body <value>","Plan item body").option("--claim","Claim the plan on create for the author").option("--from-search <value>","Record the search query that led to plan creation").option("--template <value>","Seed plan steps from a built-in template: bug-investigation|feature-implementation|refactoring-sprint").option("--step-title <value>","Step title for add-step / update-step").option("--step <value>","Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)",d).option("--step-body <value>","Step body text").option("--step-owner <value>","Step owner").option("--step-status <value>","Step status: pending|in_progress|completed|blocked|skipped|superseded").option("--step-evidence <value>","Step evidence text (used by update-step/complete-step)").option("--step-blocked-reason <value>","Step blocked reason (required when blocking)").option("--step-replacement <value>","Replacement reference for a superseded step").option("--depends-on <value>","Pm item ids the step depends on (repeatable, csv-friendly)",d).option("--link <value>","Pm item id to link (repeatable, csv-friendly)",d).option("--link-kind <value>",`Link kind: ${ke.join("|")}`).option("--link-note <value>","Optional note for the link").option("--promote-to-item-dep","Also add the linked id as a top-level item dependency when linking").option("--allow-multiple-active","Allow multiple steps to be in_progress at once").option("--file <value>","Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--test <value>","Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)",d).option("--doc <value>","Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--decision-text <value>","Decision log entry text").option("--decision <value>","Alias for --decision-text").option("--decision-rationale <value>","Decision log entry rationale").option("--decision-evidence <value>","Decision log entry evidence").option("--discovery-text <value>","Discovery log entry text").option("--discovery <value>","Alias for --discovery-text").option("--validation-text <value>","Validation log entry text").option("--validation <value>","Alias for --validation-text").option("--validation-command <value>","Validation log entry command").option("--validation-expected <value>","Validation log entry expected outcome").option("--depth <value>","Show depth: brief|standard|deep (default: brief)").option("--fields <value>","Comma-separated field projection for show output").option("--steps <value>","Comma-separated step ids/orders for materialize").option("--materialize-type <value>","Item type for materialized steps (default: Task)").option("--materialize-parent <value>","Parent item id for materialized children (default: the plan)").option("--materialize-tags <value>","Comma-separated tags for materialized children").option("--field <name=value>","Custom field value forwarded to every materialized child (repeatable)",d).option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override");he(l,X.filter(h=>Do.has(h.target))),P(l,[["--resume_context <value>","Alias for --resume-context"],["--from_search <value>","Alias for --from-search"],["--step_title <value>","Alias for --step-title"],["--step_body <value>","Alias for --step-body"],["--step_owner <value>","Alias for --step-owner"],["--step_status <value>","Alias for --step-status"],["--step_evidence <value>","Alias for --step-evidence"],["--step_blocked_reason <value>","Alias for --step-blocked-reason"],["--step_replacement <value>","Alias for --step-replacement"],["--link_kind <value>","Alias for --link-kind"],["--link_note <value>","Alias for --link-note"],["--promote_to_item_dep","Alias for --promote-to-item-dep"],["--allow_multiple_active","Alias for --allow-multiple-active"],["--decision_text <value>","Alias for --decision-text"],["--decision_rationale <value>","Alias for --decision-rationale"],["--decision_evidence <value>","Alias for --decision-evidence"],["--discovery_text <value>","Alias for --discovery-text"],["--validation_text <value>","Alias for --validation-text"],["--validation_command <value>","Alias for --validation-command"],["--validation_expected <value>","Alias for --validation-expected"],["--materialize_type <value>","Alias for --materialize-type"],["--materialize_parent <value>","Alias for --materialize-parent"],["--materialize_tags <value>","Alias for --materialize-tags"]],!1),P(l,[["--blocked_by <value>","Alias for --blocked-by"],["--depends_on <value>","Alias for --depends-on"]],!0),l.action(Zo),Tt(t,!1),Ut(t),t.command("merge").argument("<subcommand>",`${q.join(" | ")}`).argument("[artifact]",`driver: ${ae.join(" | ")}`).argument("[base]","driver: ancestor file (%O)").argument("[ours]","driver: current file (%A)").argument("[theirs]","driver: incoming file (%B)").option("--dry-run","install/reconcile: preview").option("--pre-commit-hook","install: opt into merge settlement hook").option("--stage","reconcile: stage lossless audit evidence").option("--message <text>","reconcile: audit message").option("--force","reconcile: accept reviewed decisions").option("--include-reconciled","report: include settled receipts").option("--output <path>","driver: alternate output").option("--item-path <path>","driver: repository-relative path (%P)").option("--prefer <side>","driver: ours|theirs (default ours)").description("Manage tracker merges.").action(ti),Kt(t),t.command("profile").argument("[subcommand]","Required; Profile subcommand: list, show, apply, or lint").argument("[name]","Profile name for show/apply/lint: agile, ops, or research").option("--dry-run","Preview the apply diff without writing any files (apply)").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("List, show, apply, and lint project profiles \u2014 archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.").action(li),Vt(t,$o);let p=t.command("files").description("Manage files linked to an item.");p.argument("<id>","Item id").option("--add <value>","Add linked file entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--note-conflict <mode>","On a different stored note: refuse (default)|replace|append").option("--list","List linked files without mutating").option("--append-stable","Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths","Validate linked file paths for existence and file shape").option("--full-history","Return all linked files after a write").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").action(di),p.command("discover").argument("<id>","Item id").option("--apply","Add discovered missing files to the item").option("--note <value>","Note to attach to discovered file links").option("--append-stable","Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(ui),zt(p),t.command("docs").argument("<id>","Item id").option("--add <value>","Add linked doc entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--note-conflict <mode>","On a different stored note: refuse (default)|replace|append").option("--list","List linked docs without mutating").option("--validate-paths","Validate linked doc paths for existence and file shape").option("--full-history","Return all linked docs after a write").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage docs linked to an item.").action(ci),t.command("deps").argument("<id>","Item id").option("--format <value>","Output format (tree, graph, or context)","tree").option("--max-depth <value>","Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>","Collapse mode (none or repeated)","none").option("--summary","Return counts only without full tree/graph payload").option("--full","Return the complete dependency row projection").option("--node-limit <value>","Maximum nodes in context output").option("--edge-limit <value>","Maximum edges and missing-reference rows in context output").option("--token-budget <value>","Maximum estimated tokens in context output").option("--cursor <value>","Continue an equivalent context query").option("--direction <value>","Context traversal direction (outgoing, incoming, or both)").option("--kind <value>","Restrict context traversal to registered relationship kinds (repeatable or comma-separated)",d).description("Show dependency relationships for an item.").action(pi)}export{ve as looksLikeSchemaSubcommandTypo,$o as parsePositiveIntOption,G as parseSchemaOrderOption,he as registerCommanderOptionContracts,wa as registerMutationCommands};
21
- //# sourceMappingURL=register-mutation-WO74VLEQ.js.map
19
+ `),e.warnings.length>0&&y(`profile apply warnings: ${U(e.warnings)}`);break}}function $o(t){return e=>{let o=Number(e);if(!Number.isInteger(o)||o<1)throw new m(`${t} must be a positive integer (1-based index).`,u.USAGE);return o}}function Wt(t,e){t.option("--filter-has-notes",`Select only items that have notes before ${e}`).option("--filter-no-notes",`Select only items that have no notes before ${e}`).option("--filter-has-learnings",`Select only items that have learnings before ${e}`).option("--filter-no-learnings",`Select only items that have no learnings before ${e}`).option("--filter-has-files",`Select only items that have linked files before ${e}`).option("--filter-no-files",`Select only items that have no linked files before ${e}`).option("--filter-has-docs",`Select only items that have linked docs before ${e}`).option("--filter-no-docs",`Select only items that have no linked docs before ${e}`).option("--filter-has-tests",`Select only items that have linked tests before ${e}`).option("--filter-no-tests",`Select only items that have no linked tests before ${e}`).option("--filter-has-comments",`Select only items that have comments before ${e}`).option("--filter-no-comments",`Select only items that have no comments before ${e}`).option("--filter-has-deps",`Select only items that have dependencies before ${e}`).option("--filter-no-deps",`Select only items that have no dependencies before ${e}`).option("--filter-has-body",`Select only items that have a non-empty body before ${e}`).option("--filter-empty-body",`Select only items with an empty body before ${e}`).option("--filter-has-linked-command",`Select only items whose linked tests carry a runnable command before ${e}`).option("--filter-no-linked-command",`Select only items whose linked tests carry no runnable command before ${e}`).option("--filter-reviewer-missing",`Select only items missing reviewer before ${e}`).option("--filter-risk-missing",`Select only items missing risk before ${e}`).option("--filter-confidence-missing",`Select only items missing confidence before ${e}`).option("--filter-sprint-missing",`Select only items missing sprint before ${e}`).option("--filter-release-missing",`Select only items missing release before ${e}`)}var Lo=[["filterHasNotes","filterNoNotes","--filter-has-notes","--filter-no-notes"],["filterHasLearnings","filterNoLearnings","--filter-has-learnings","--filter-no-learnings"],["filterHasFiles","filterNoFiles","--filter-has-files","--filter-no-files"],["filterHasDocs","filterNoDocs","--filter-has-docs","--filter-no-docs"],["filterHasTests","filterNoTests","--filter-has-tests","--filter-no-tests"],["filterHasComments","filterNoComments","--filter-has-comments","--filter-no-comments"],["filterHasDeps","filterNoDeps","--filter-has-deps","--filter-no-deps"],["filterHasBody","filterEmptyBody","--filter-has-body","--filter-empty-body"],["filterHasLinkedCommand","filterNoLinkedCommand","--filter-has-linked-command","--filter-no-linked-command"]];function Xt(t){let e=o=>t[o]===!0?!0:void 0;for(let[o,n,i,r]of Lo)if(t[o]===!0&&t[n]===!0)throw new m(`Cannot combine ${i} with ${r} for the same field.`,u.USAGE);return{filterReviewerMissing:e("filterReviewerMissing"),filterRiskMissing:e("filterRiskMissing"),filterConfidenceMissing:e("filterConfidenceMissing"),filterSprintMissing:e("filterSprintMissing"),filterReleaseMissing:e("filterReleaseMissing"),hasNotes:e("filterHasNotes"),hasLearnings:e("filterHasLearnings"),hasFiles:e("filterHasFiles"),hasDocs:e("filterHasDocs"),hasTests:e("filterHasTests"),hasComments:e("filterHasComments"),hasDeps:e("filterHasDeps"),hasBody:e("filterHasBody"),hasLinkedCommand:e("filterHasLinkedCommand"),noNotes:e("filterNoNotes"),noLearnings:e("filterNoLearnings"),noFiles:e("filterNoFiles"),noDocs:e("filterNoDocs"),noTests:e("filterNoTests"),noComments:e("filterNoComments"),noDeps:e("filterNoDeps"),emptyBody:e("filterEmptyBody"),noLinkedCommand:e("filterNoLinkedCommand")}}function he(t,e){for(let o of e){let n=[],i=t.args,r=a=>(t.args!==i&&(n.length=0,i=t.args),n.push(a),n);o.required?t.requiredOption(o.option,o.description):o.repeatable?t.option(o.option,o.description,r):t.option(o.option,o.description);for(let a of o.aliasOptions??[])W(o.option,a.option)?b(t,a.option,a.description,o.repeatable===!0,o.repeatable?r:void 0):o.repeatable?t.option(a.option,a.description,r):t.option(a.option,a.description)}}function Ho(t){let e=o=>typeof t[o]=="string"?t[o]:void 0;return{type:e("filterType"),tag:e("filterTag"),priority:e("filterPriority"),deadlineBefore:e("filterDeadlineBefore"),deadlineAfter:e("filterDeadlineAfter"),updatedAfter:e("filterUpdatedAfter"),updatedBefore:e("filterUpdatedBefore"),createdAfter:e("filterCreatedAfter"),createdBefore:e("filterCreatedBefore"),ids:e("ids"),assignee:e("filterAssignee"),assigneeFilter:e("filterAssigneeFilter")??e("filterAssignee_filter"),parent:e("filterParent"),sprint:e("filterSprint"),release:e("filterRelease"),filterAcMissing:t.filterAcMissing===!0?!0:void 0,filterEstimatesMissing:t.filterEstimatesMissing===!0||t.filterEstimateMissing===!0?!0:void 0,filterResolutionMissing:t.filterResolutionMissing===!0?!0:void 0,filterMetadataMissing:t.filterMetadataMissing===!0?!0:void 0,...Xt(t),limit:e("limit"),offset:e("offset"),includeBody:!0}}function H(...t){for(let e of t)if(typeof e=="string")return e}function Uo(t,e,o){if(!(t!=="many"||e!==void 0||o.title!==void 0||o.type!==void 0))throw new m("pm create many is not a command; bulk creation is pm item mutate.",u.USAGE,{code:"bulk_create_route",required:"Pipe a JSON array, JSON Lines, or {schema_version, mutations} document to pm item mutate, or pass --from <path>.",why:"pm item mutate commits every record in one workspace transaction with a replay-safe transaction id, so an interrupted or repeated import never duplicates items.",nextSteps:["pm item mutate --from items.jsonl --dry-run --json","pm item mutate --from items.jsonl --upsert-key external_id --json","pm guide lifecycle"],examples:["pm item mutate --from items.jsonl --json",`printf '%s\\n' '{"title":"First","type":"Task"}' '{"title":"Second","type":"Task"}' | pm item mutate --json`]})}function Bo(t,e,o){return typeof e=="string"&&e.length>0?{positionalType:t,positionalTitle:e}:typeof t!="string"||t.length===0?{positionalType:void 0,positionalTitle:void 0}:typeof o.title=="string"&&o.title.trim().length>0&&o.type===void 0?{positionalType:t,positionalTitle:void 0}:{positionalType:void 0,positionalTitle:t}}function Go(t,e,o,n){if(t!==void 0||typeof e!="string"||e.length===0||o.title!==void 0||o.type!==void 0||!Io.has(e.trim().toLowerCase()))return;let i=e.trim(),r=Et(),a=r.length===0?"":`
20
+ The CLI read ${r.map(l=>`"${l.from}" as ${l.flag}`).join(", ")}; pass --title to keep text as the title.`;throw new m(`pm create needs a title: "${i}" looks like an item type. Pass the title with --title or as a second positional.${a}`,u.USAGE,{code:"create_positional_type_without_title",why:'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "'+i+'".',examples:[`pm create ${i} --title "Wire up SSO for the agent harness"`,`pm create ${i} "Wire up SSO for the agent harness"`,`pm create "Wire up SSO for the agent harness" --type ${i}`],nextSteps:r.length===0?[`Pass the title as an option: ${O(["create",i,"--title","<title>",...n])}`]:r.map(l=>`Keep "${l.from}" as the title: ${O(["create",i,"--title",l.from,...n])}`)})}var jo=["body","bodyFile","description","dep","depRemove","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ids"];function j(t){let e=jo.flatMap(o=>{let n=t[o],i=typeof n=="string"&&n.trim()==="-"?1:Array.isArray(n)?n.filter(a=>typeof a=="string"&&a.trim()==="-").length:0,r=`--${o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`)}`;return Array.from({length:i},()=>r)});if(t.stdinJson===!0&&e.unshift("--stdin-json"),e.length>1)throw new m(`Only one option may consume stdin per command invocation. Found: ${e.join(", ")}.`,u.USAGE)}function Yt(t,e,o){let n=[];e&&n.push("body"),o&&n.push("description"),Se(t,n)}function Zt(t,e){return!e&&typeof t.description=="string"&&t.description.trim()==="-"}async function Qt(t,e,o,n){let i=await I(R(process.cwd(),n.path));return Ct(t,e,o,_e(i.schema).definitions)}async function qo(t,e,o,n){let i=v(n),r=Date.now();j(o);let a=o.stdinJson===!0;if(a){let A=await C().resolveValue("-","--stdin-json");o=await Qt(A??"","create",o,i)}Uo(t,e,o);let l=Bo(t,e,o);Go(l.positionalType,l.positionalTitle,o,xe(i)),typeof l.positionalType=="string"&&l.positionalType.length>0&&o.type===void 0&&(o.type=l.positionalType),typeof l.positionalTitle=="string"&&l.positionalTitle.length>0&&o.title===void 0&&(o.title=l.positionalTitle);let c=Zt(o,a);a||await de(o);let p=typeof o.bodyFile=="string";p&&(o.body=await K(String(o.bodyFile),o.body!==void 0?String(o.body):void 0),delete o.bodyFile);let h=Y(o,{requireType:!1});Yt(h,p,c),a&&V(h);let S=await $t(h,i);await w(i,S),f(S,i),i.profile&&y(`profile:command=create took_ms=${Date.now()-r}`)}function Vo(t){return{type:s(t,"filterType"),tag:s(t,"filterTag"),priority:s(t,"filterPriority"),deadlineBefore:s(t,"filterDeadlineBefore"),deadlineAfter:s(t,"filterDeadlineAfter"),updatedAfter:s(t,"filterUpdatedAfter"),updatedBefore:s(t,"filterUpdatedBefore"),createdAfter:s(t,"filterCreatedAfter"),createdBefore:s(t,"filterCreatedBefore"),ids:s(t,"ids"),assignee:s(t,"filterAssignee"),assigneeFilter:H(t.filterAssigneeFilter,t.filterAssignee_filter),parent:s(t,"filterParent"),sprint:s(t,"filterSprint"),release:s(t,"filterRelease"),...Xt(t),limit:s(t,"limit"),offset:s(t,"offset")}}async function zo(t,e){let o=v(e),n=Date.now();j(t),t.ids=await J(s(t,"ids"));let i=await gt({status:s(t,"filterStatus"),list:Vo(t),reason:s(t,"reason"),completedAt:s(t,"completedAt"),resolution:s(t,"resolution"),expectedResult:H(t.expectedResult,t.expected_result,t.expected),actualResult:H(t.actualResult,t.actual_result,t.actual),validateClose:t.validateClose===!0?"warn":s(t,"validateClose"),author:s(t,"author"),message:s(t,"message"),force:!!t.force,dryRun:t.dryRun===!0?!0:void 0,rollback:s(t,"rollback"),checkpoint:t.checkpoint===!1?!1:void 0},o);await w(o,i),f(i,o),o.profile&&y(`profile:command=close-many took_ms=${Date.now()-n}`)}async function Jo(t,e){let o=v(e),n=Date.now();j(t),t.ids=await J(s(t,"ids"));let i=await Lt({status:s(t,"filterStatus"),list:Ho(t),update:Z(Ee(t)),dryRun:t.dryRun===!0?!0:void 0,rollback:s(t,"rollback"),checkpoint:t.checkpoint===!1?!1:void 0},o);await w(o,i),f(await D("update-many",[],t,o,i),o),o.profile&&y(`profile:command=update-many took_ms=${Date.now()-n}`)}async function Ko(t,e,o,n){let i=v(n),r=Date.now(),a=typeof o.reason=="string"&&o.reason.trim().length>0&&o.reason||typeof o.closeReason=="string"&&o.closeReason.trim().length>0&&o.closeReason||void 0,l=typeof e=="string"&&e.length>0?e:a,p=await(o.releaseAssignment===!0?St:te)(t,l,{author:s(o,"author"),message:s(o,"message"),validateClose:o.validateClose===!0?"warn":s(o,"validateClose"),force:!!o.force,duplicateOf:s(o,"duplicateOf"),completedAt:s(o,"completedAt"),resolution:s(o,"resolution"),expectedResult:H(o.expectedResult,o.expected_result,o.expected),actualResult:H(o.actualResult,o.actual_result,o.actual)},i);await w(i,p),f(p,i),i.profile&&y(`profile:command=close took_ms=${Date.now()-r}`)}function Wo(t){let e={...t},o=[["blocked_by","blockedBy"],["resume_context","resumeContext"],["from_search","fromSearch"],["step_title","stepTitle"],["step_body","stepBody"],["step_owner","stepOwner"],["step_status","stepStatus"],["step_evidence","stepEvidence"],["step_blocked_reason","stepBlockedReason"],["step_replacement","stepReplacement"],["depends_on","dependsOn"],["link_kind","linkKind"],["link_note","linkNote"],["promote_to_item_dep","promoteToItemDep"],["allow_multiple_active","allowMultipleActive"],["decision_text","decisionText"],["decision_rationale","decisionRationale"],["decision_evidence","decisionEvidence"],["discovery_text","discoveryText"],["validation_text","validationText"],["validation_command","validationCommand"],["validation_expected","validationExpected"],["materialize_type","materializeType"],["materialize_parent","materializeParent"],["materialize_tags","materializeTags"]];for(let[i,r]of o)e[i]!==void 0&&e[r]===void 0&&(e[r]=e[i]);let n=Y(e,{requireType:!1});return n.blockedBy=e.blockedBy,n}function Xo(t,e){if(!t)throw new m(`pm plan requires a subcommand. Allowed: ${e.join(", ")}`,u.USAGE,{code:"missing_required_argument",examples:['pm plan create --title "Refactor lock retry"',"pm plan show pm-a1b2 --depth standard",'pm plan add-step pm-a1b2 --step-title "Read lock.ts"']});if(e.includes(t))return;throw F({command_path:"plan",token:t,allowed:e,examples:t==="list"||t==="ls"?["pm list --type Plan","pm list --all --type Plan"]:void 0,retry_command:t==="list"||t==="ls"?"pm list --type Plan":void 0})}function Yo(t,e){if(t!=="reorder-step"||typeof e!="string")return;let o=Number.parseInt(e,10);if(!Number.isFinite(o))throw new m(`reorder-step requires an integer new order, got "${e}"`,u.USAGE);return o}async function Zo(t,e,o,n,i,r){let a=v(r),l=Date.now(),c=(t??"").trim().toLowerCase();Xo(c,At);let p=Wo(i),h=Yo(c,n),S=c==="create"&&typeof e=="string"&&e.length>0&&p.title===void 0?void 0:e;S===void 0&&typeof e=="string"&&e.length>0&&(p.title=e);let A=await Bt({subcommand:c,id:S,stepRef:o,reorderTo:h,options:p,global:a});await w(a,A),f(A,a),a.profile&&y(`profile:command=plan took_ms=${Date.now()-l}`)}async function Qo(t,e,o){if(t!==void 0)throw new m("merge reconcile takes no positional arguments.",u.USAGE);let n=await se({dryRun:e.dryRun===!0,force:e.force===!0,stage:e.stage===!0,message:typeof e.message=="string"?e.message:void 0,author:o.author},o);f(n,o),n.ok||(process.exitCode=u.GENERIC_FAILURE)}async function ei(t,e,o,n,i,r){if(t===void 0||e===void 0||o===void 0||n===void 0)throw new m("merge driver requires <artifact> <base> <ours> <theirs> (git supplies %O %A %B). Example: pm merge driver history %O %A %B",u.USAGE);let a=await re({artifact:t,basePath:e,oursPath:o,theirsPath:n,outputPath:typeof i.output=="string"?i.output:void 0,itemPath:typeof i.itemPath=="string"?i.itemPath:void 0,prefer:typeof i.prefer=="string"?i.prefer:void 0},r);f(a,r),a.ok||(process.exitCode=u.GENERIC_FAILURE)}async function ti(t,e,o,n,i,r,a){let l=v(a),c=Date.now();switch(t.trim().toLowerCase()){case"install":{if(e!==void 0)throw new m("merge install takes no positional arguments.",u.USAGE);let h=await Q({dryRun:r.dryRun===!0,preCommitHook:r.preCommitHook===!0},l);f(h,l);break}case"reconcile":await Qo(e,r,l);break;case"report":{if(e!==void 0)throw new m("merge report takes no positional arguments.",u.USAGE);let h=await ee({includeReconciled:r.includeReconciled===!0});f(h,l),h.ok||(process.exitCode=u.GENERIC_FAILURE);break}case"driver":await ei(e,o,n,i,r,l);break;default:throw F({command_path:"merge",token:t,allowed:q,display_name:"merge"})}l.profile&&y(`profile:command=merge took_ms=${Date.now()-c}`)}async function oi(t,e,o){let n=v(o),i=Date.now(),r=await oe(t,{title:s(e,"title"),author:s(e,"author"),message:s(e,"message"),allowDuplicate:e.allowDuplicate===!0},n);await w(n,r),f(r,n),n.profile&&y(`profile:command=copy took_ms=${Date.now()-i}`)}async function ii(t,e,o){let n=v(o),i=Date.now(),r=await ne(t,{clear:e.clear===!0},n);f(r,n),n.profile&&y(`profile:command=focus took_ms=${Date.now()-i}`)}async function ni(t,e,o){let n=v(o),i=Date.now();j(e);let r=e.stdinJson===!0;if(r){let h=await C().resolveValue("-","--stdin-json");e=await Qt(h??"","update",e,n)}let a=Zt(e,r);r||await de(e);let l=typeof e.bodyFile=="string";l&&(e.body=await K(String(e.bodyFile),e.body!==void 0?String(e.body):void 0),delete e.bodyFile);let c=Z(e);Yt(c,l,a),r&&V(c);let p=await It(t,c,n);await w(n,p),f(await D("update",[t],e,n,p),n),n.profile&&y(`profile:command=update took_ms=${Date.now()-i}`)}async function ai(t,e,o){let n=v(o),i=Date.now(),r=await ie(t,{author:s(e,"author"),message:s(e,"message"),force:!!e.force,dryRun:e.dryRun===!0},n);r.dry_run!==!0&&await w(n,r),f(r,n),n.profile&&y(`profile:command=delete took_ms=${Date.now()-i}`)}function ri(t,e){let o=s(e,"body"),n=s(e,"text"),i=typeof t=="string"?t:void 0;if([o,n,i].filter(l=>l!==void 0).length>1)throw new m("Specify append text with exactly one source: positional [text], --body, or --text",u.USAGE);let a=o??n??i;if(a===void 0)throw new m("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).",u.USAGE);return a}async function si(t,e,o,n){let i=v(n),r=Date.now(),a=await Nt(t,{body:ri(e,o),author:s(o,"author"),message:s(o,"message"),force:!!o.force},i);await w(i,a),f(a,i),i.profile&&y(`profile:command=append took_ms=${Date.now()-r}`)}async function li(t,e,o,n){let i=v(n),r=Date.now(),{PROFILE_SUBCOMMANDS:a}=N,l=(t??"").trim().toLowerCase();if(!l)throw new m(`pm profile requires a subcommand. Allowed: ${a.join(", ")}`,u.USAGE,{code:"missing_required_argument",examples:["pm profile list","pm profile show agile","pm profile apply agile --dry-run","pm profile lint agile"]});if(!a.includes(l))throw F({command_path:"profile",token:l,allowed:a});let c=await Po(N,l,e,o,i);i.json===!0||i.defaultOutputFormat==="json"?f(c,i):i.quiet||No(N,c),c.action==="lint"&&!c.ok&&(process.exitCode=u.GENERIC_FAILURE),i.profile&&y(`profile:command=profile took_ms=${Date.now()-r}`)}function _(t,e){return $(t[e])??[]}async function di(t,e,o){let n=v(o),i=Date.now(),r=_(e,"add"),a=_(e,"addGlob"),l=_(e,"remove"),c=_(e,"migrate"),p=await mt(t,{add:r,addGlob:a,remove:l,migrate:c,note:s(e,"note"),noteConflict:s(e,"noteConflict"),list:!!e.list,appendStable:!!e.appendStable,validatePaths:!!e.validatePaths,fullHistory:e.fullHistory===!0,author:s(e,"author"),message:s(e,"message"),force:!!e.force},n);(r.length>0||a.length>0||l.length>0||c.length>0)&&await w(n,p),f(await D("files",[t],e,n,p),n),n.profile&&y(`profile:command=files took_ms=${Date.now()-i}`)}async function ci(t,e,o){let n=v(o),i=Date.now(),r={...o.optsWithGlobals(),...e},a=await vt(t,{apply:!!r.apply,note:s(r,"note"),appendStable:!!r.appendStable,author:s(r,"author"),message:s(r,"message"),force:!!r.force},n);a.changed&&await w(n,a),f(a,n),n.profile&&y(`profile:command=files.discover took_ms=${Date.now()-i}`)}async function ui(t,e,o){let n=v(o),i=Date.now(),r=_(e,"add"),a=_(e,"addGlob"),l=_(e,"remove"),c=_(e,"migrate"),p=await ut(t,{add:r,addGlob:a,remove:l,migrate:c,note:s(e,"note"),noteConflict:s(e,"noteConflict"),list:!!e.list,validatePaths:!!e.validatePaths,fullHistory:e.fullHistory===!0,author:s(e,"author"),message:s(e,"message"),force:!!e.force},n);(r.length>0||a.length>0||l.length>0||c.length>0)&&await w(n,p),f(await D("docs",[t],e,n,p),n),n.profile&&y(`profile:command=docs took_ms=${Date.now()-i}`)}async function pi(t,e,o){let n=v(o),i=Date.now(),r=await ct(t,{format:e.format,maxDepth:s(e,"maxDepth"),collapse:e.collapse,summary:e.summary===!0,full:e.full===!0,nodeLimit:s(e,"nodeLimit"),edgeLimit:s(e,"edgeLimit"),tokenBudget:s(e,"tokenBudget"),cursor:s(e,"cursor"),direction:s(e,"direction"),...Array.isArray(e.kind)?{kind:e.kind}:{}},n);f(r,n),n.profile&&y(`profile:command=deps took_ms=${Date.now()-i}`)}function wa(t,e={}){let o=t.command("create").argument("[type-or-title]",'Title, or type followed by title (e.g. task "Fix bug")').argument("[title]","Title following an item type").description("Create a new project management item.");if(he(o,X),o.option("--stdin-json","Item JSON from stdin; explicit flags override").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--allow-duplicate","Explicitly create even when strict similarity governance finds likely duplicates").option("--inherit-focus","Use saved focus as parent (CLI default; SDK/MCP opt in)",!0).option("--no-inherit-focus","Ignore saved focus; --unset parent also suppresses it").action(qo),e.targetCommandName==="create")return;t.command("copy").argument("<id>","Source item id").option("--title <value>","Optional title override for the copied item").option("--author <value>","Mutation author").option("--message <value>","History message").option("--allow-duplicate","Explicitly copy even when strict similarity governance finds likely duplicates").description("Copy an item into a new item id while resetting lifecycle fields.").action(oi),t.command("focus").argument("[id]","Item id to focus (omit to show current focus)").option("--clear","Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(ii);let n=t.command("update").argument("<id>","Item id").description("Update item fields and metadata.");he(n,Fe),n.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--replace-deps","Atomically replace dependency entries with the provided --dep values").option("--replace-tests","Atomically replace linked test entries with the provided --test values").option("--replace-files","Atomically replace linked file entries with the provided --file values").option("--replace-docs","Atomically replace linked doc entries with the provided --doc values").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--force","Force ownership override"),n.action(ni),Ht(t);let i=t.command("update-many").description("Bulk-update matched items with dry-run plans and rollback checkpoints.").option("--filter-status <value>","Filter by status before applying updates").option("--filter-type <value>","Filter by item type before applying updates").option("--filter-tag <value>","Filter by tag before applying updates").option("--filter-priority <value>","Filter by priority before applying updates").option("--filter-deadline-before <value>","Filter by deadline upper bound before applying updates").option("--filter-deadline-after <value>","Filter by deadline lower bound before applying updates").option("--filter-updated-after <value>","Filter by updated_at lower bound before applying updates (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before applying updates (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before applying updates (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before applying updates (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before applying updates").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before applying updates").option("--filter-parent <value>","Filter by parent item ID before applying updates").option("--filter-sprint <value>","Filter by sprint before applying updates").option("--filter-release <value>","Filter by release before applying updates").option("--filter-ac-missing","Select only items missing acceptance_criteria (bulk backfill)").option("--filter-estimates-missing","Select only items missing estimated_minutes (bulk backfill)").option("--filter-resolution-missing","Select only terminal items missing resolution (bulk backfill)").option("--filter-metadata-missing","Select only items missing any tracked metadata (AC, estimate, or resolution)");Wt(i,"applying updates"),i.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--dry-run","Preview per-item diffs and checkpoint intent without mutating").option("--rollback <value>","Rollback a prior update-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode").option("--title, -t <value>","Set title").option("--description, -d <value>","Set description").option("--body, -b <value>","Set body (allow empty string)").option("--status, -s <value>","Set status (use close command for closed)").option("--priority, -p <value>","Set priority").option("--type <value>","Set type").option("--tags <value>","Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.").option("--add-tags <value>","Add tags additively without replacing existing (repeatable; CSV accepted)",d).option("--remove-tags <value>","Remove tags from the existing list (repeatable; CSV accepted)",d).option("--deadline <value>","Set deadline (ISO/date string or relative)").option("--estimate, --estimated-minutes <value>","Set estimated minutes").option("--acceptance-criteria <value>","Set acceptance criteria").option("--ac <value>","Alias for --acceptance-criteria").option("--add-ac <value>","Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",d).option("--remove-ac <value>","Remove one semicolon-free acceptance criterion by exact text match (repeatable)",d).option("--definition-of-ready <value>","Set definition of ready").option("--order <value>","Set planning order/rank integer").option("--rank <value>","Alias for --order").option("--goal <value>","Set goal identifier").option("--objective <value>","Set objective identifier").option("--value <value>","Set business value summary").option("--impact <value>","Set business impact summary").option("--outcome <value>","Set expected outcome summary").option("--why-now <value>","Set why-now rationale").option("--assignee <value>","Set assignee").option("--parent <value>","Set parent item ID").option("--reviewer <value>","Set reviewer").option("--risk <value>","Set risk level").option("--confidence <value>","Set confidence level").option("--sprint <value>","Set sprint identifier").option("--release <value>","Set release identifier").option("--blocked-by <value>","Set blocked-by item ID or reason").option("--blocked-reason <value>","Set blocked reason").option("--unblock-note <value>","Set unblock rationale note").option("--reporter <value>","Set issue reporter").option("--severity <value>","Set issue severity").option("--environment <value>","Set issue environment context").option("--repro-steps <value>","Set issue reproduction steps").option("--resolution <value>","Set issue resolution summary").option("--expected-result <value>","Set issue expected behavior").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Set issue observed behavior").option("--actual <value>","Short alias for --actual-result").option("--affected-version <value>","Set affected version identifier").option("--fixed-version <value>","Set fixed version identifier").option("--component <value>","Set issue component ownership").option("--regression [value]","Set regression marker; bare flag means true, or pass true|false|1|0").option("--customer-impact <value>","Set customer impact summary").option("--dep <value>","Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>",d).option("--dep-remove <value>","Remove dependency entries by id/kind/author/timestamp signature",d).option("--allow-unresolved-deps","Allow unresolved local dependency targets and emit explicit warning receipts").option("--replace-deps","Atomically replace dependency entries with provided --dep values").option("--replace-tests","Atomically replace linked tests with provided --test values").option("--replace-files","Atomically replace linked files with provided --file values").option("--replace-docs","Atomically replace linked docs with provided --doc values").option("--comment <value>","Add comment seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--note <value>","Add note seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--learning <value>","Add learning seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--file <value>","Add linked file path=<value>,scope=<project|global>,note=<text>",d).option("--test <value>","Add linked test command=<value>,path=<value>,scope=<project|global>",d).option("--doc <value>","Add linked doc path=<value>,scope=<project|global>,note=<text>",d).option("--reminder <value>","Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>",d).option("--event <value>","Add event entry start=<iso|relative>,end=<iso|relative>,recur_*",d).option("--type-option <value>","Set type options key=value (repeatable)",d).option("--unset <field>","Clear scalar fields by name (repeatable or csv)",d).option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override"),P(i,[["--filter-assignee_filter <value>","Alias for --filter-assignee-filter"],["--estimated_minutes <value>","Alias for --estimated-minutes"],["--acceptance_criteria <value>","Alias for --acceptance-criteria"],["--definition_of_ready <value>","Alias for --definition-of-ready"],["--why_now <value>","Alias for --why-now"],["--blocked_by <value>","Alias for --blocked-by"],["--blocked_reason <value>","Alias for --blocked-reason"],["--unblock_note <value>","Alias for --unblock-note"],["--repro_steps <value>","Alias for --repro-steps"],["--expected_result <value>","Alias for --expected-result"],["--actual_result <value>","Alias for --actual-result"],["--affected_version <value>","Alias for --affected-version"],["--fixed_version <value>","Alias for --fixed-version"],["--customer_impact <value>","Alias for --customer-impact"],["--filter-estimate-missing","Alias for --filter-estimates-missing"]],!1),P(i,[["--dep_remove <value>","Alias for --dep-remove"],["--type_option <value>","Alias for --type-option"],["--add_tags <value>","Alias for --add-tags"],["--remove_tags <value>","Alias for --remove-tags"],["--add_ac <value>","Alias for --add-ac"],["--remove_ac <value>","Alias for --remove-ac"]],!0),i.action(Jo);let r=t.command("close").option("--release-assignment","Release ownership after closure").argument("<id>","Item id").argument("[text]","Close reason text (alias: --reason)").option("-r, --reason <value>","Close reason text (alias for positional <text>)").option("--close-reason <value>","Close reason text (alias for positional <text>)").option("--completed-at <value>","Actual completion timestamp (ISO or relative), distinct from tracker close time").option("-d, --duplicate-of <id>","Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata").option("--author <value>","Mutation author").option("-m, --message <value>","History message").option("--validate-close [mode]",'Validate closure metadata before close: "off", "warn", or "strict" (default: settings governance preset)').option("--resolution <value>","Closure resolution summary (checked by --validate-close strict)").option("--expected-result <value>","Expected outcome for closure validation").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Observed outcome for closure validation").option("--actual <value>","Short alias for --actual-result").option("--force","Force ownership override").description("Close an item. Close reason requirement follows governance.require_close_reason.");b(r,"--expected_result <value>","Alias for --expected-result",!1),b(r,"--actual_result <value>","Alias for --actual-result",!1),r.action(Ko);let a=t.command("close-many").description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).").option("--filter-status <value>","Filter by status before closing").option("--filter-type <value>","Filter by item type before closing").option("--filter-tag <value>","Filter by tag before closing").option("--filter-priority <value>","Filter by priority before closing").option("--filter-deadline-before <value>","Filter by deadline upper bound before closing").option("--filter-deadline-after <value>","Filter by deadline lower bound before closing").option("--filter-updated-after <value>","Filter by updated_at lower bound before closing (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before closing (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before closing (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before closing (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before closing").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before closing").option("--filter-parent <value>","Filter by parent item ID before closing").option("--filter-sprint <value>","Filter by sprint before closing").option("--filter-release <value>","Filter by release before closing");Wt(a,"closing"),a.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--reason <value>","Shared close reason applied to matched items (required when governance.require_close_reason is enabled)").option("--completed-at <value>","Actual completion timestamp (ISO or relative) applied to every matched item").option("--resolution <value>","Shared closure resolution applied to every matched item (closure-validation field)").option("--expected-result <value>","Shared expected-result note (closure-validation field)").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Shared actual-result note (closure-validation field)").option("--actual <value>","Short alias for --actual-result").option("--validate-close [mode]",'Validate closure metadata per item: "off", "warn", or "strict" (default: settings governance preset)').option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Re-close already-terminal matches and override ownership").option("--dry-run","Preview matched items + per-item skip/active-child plan without mutating").option("--rollback <value>","Rollback a prior close-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode"),b(a,"--filter-assignee_filter <value>","Alias for --filter-assignee-filter",!1),b(a,"--expected_result <value>","Alias for --expected-result",!1),b(a,"--actual_result <value>","Alias for --actual-result",!1),a.action(zo),t.command("delete").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").option("--dry-run","Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(ai),t.command("append").argument("<id>","Item id").argument("[text]","Body text; same as --body (- reads stdin)").option("-b, --body <value>","Text to append to body (or - for stdin)").option("--text <value>","Alias for --body").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override").description("Append text to an item's body. For concurrent writes, use pm notes.").action(si);let l=t.command("plan").description("Plan workflow: create, manage steps and dependencies, approve, and materialize.").argument("[subcommand]","Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize").argument("[id]","Plan id (non-create); positional title for create").argument("[step]","Step reference: stable id (plan-step-001) or order integer").argument("[new-order]","New order integer for reorder-step").option("--title <value>","Plan title").option("--description <value>","Plan description").option("--scope <value>","Change or investigation scope").option("--parent <value>","Parent pm item id").option("--inherit-focus","Create under saved focus (CLI default)",!0).option("--no-inherit-focus","Create without saved focus").option("--related <value>","Related item ids (repeatable CSV)",d).option("--blocks <value>","Blocked item ids (repeatable CSV)",d).option("--blocked-by <value>","Blocking item ids (repeatable CSV)",d).option("--harness <value>","Plan harness provenance: codex|claude-code|cursor|generic").option("--mode <value>","Plan mode: draft|research|review|approved|executing|paused|completed|superseded").option("--resume-context <value>","Compact context summary for a future stateless agent").option("--tags <value>","Comma-separated tags").option("--priority <value>","Priority 0-4").option("--body <value>","Plan item body").option("--claim","Claim the plan on create for the author").option("--from-search <value>","Record the search query that led to plan creation").option("--template <value>","Seed plan steps from a built-in template: bug-investigation|feature-implementation|refactoring-sprint").option("--step-title <value>","Step title for add-step / update-step").option("--step <value>","Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)",d).option("--step-body <value>","Step body text").option("--step-owner <value>","Step owner").option("--step-status <value>","Step status: pending|in_progress|completed|blocked|skipped|superseded").option("--step-evidence <value>","Step evidence text (used by update-step/complete-step)").option("--step-blocked-reason <value>","Step blocked reason (required when blocking)").option("--step-replacement <value>","Replacement reference for a superseded step").option("--depends-on <value>","Pm item ids the step depends on (repeatable, csv-friendly)",d).option("--link <value>","Pm item id to link (repeatable, csv-friendly)",d).option("--link-kind <value>",`Link kind: ${ke.join("|")}`).option("--link-note <value>","Optional note for the link").option("--promote-to-item-dep","Also add the linked id as a top-level item dependency when linking").option("--allow-multiple-active","Allow multiple steps to be in_progress at once").option("--file <value>","Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--test <value>","Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)",d).option("--doc <value>","Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--decision-text <value>","Decision log entry text").option("--decision <value>","Alias for --decision-text").option("--decision-rationale <value>","Decision log entry rationale").option("--decision-evidence <value>","Decision log entry evidence").option("--discovery-text <value>","Discovery log entry text").option("--discovery <value>","Alias for --discovery-text").option("--validation-text <value>","Validation log entry text").option("--validation <value>","Alias for --validation-text").option("--validation-command <value>","Validation log entry command").option("--validation-expected <value>","Validation log entry expected outcome").option("--depth <value>","Show depth: brief|standard|deep (default: brief)").option("--fields <value>","Comma-separated field projection for show output").option("--steps <value>","Comma-separated step ids/orders for materialize").option("--materialize-type <value>","Item type for materialized steps (default: Task)").option("--materialize-parent <value>","Parent item id for materialized children (default: the plan)").option("--materialize-tags <value>","Comma-separated tags for materialized children").option("--field <name=value>","Custom field value forwarded to every materialized child (repeatable)",d).option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override");he(l,X.filter(h=>Do.has(h.target))),P(l,[["--resume_context <value>","Alias for --resume-context"],["--from_search <value>","Alias for --from-search"],["--step_title <value>","Alias for --step-title"],["--step_body <value>","Alias for --step-body"],["--step_owner <value>","Alias for --step-owner"],["--step_status <value>","Alias for --step-status"],["--step_evidence <value>","Alias for --step-evidence"],["--step_blocked_reason <value>","Alias for --step-blocked-reason"],["--step_replacement <value>","Alias for --step-replacement"],["--link_kind <value>","Alias for --link-kind"],["--link_note <value>","Alias for --link-note"],["--promote_to_item_dep","Alias for --promote-to-item-dep"],["--allow_multiple_active","Alias for --allow-multiple-active"],["--decision_text <value>","Alias for --decision-text"],["--decision_rationale <value>","Alias for --decision-rationale"],["--decision_evidence <value>","Alias for --decision-evidence"],["--discovery_text <value>","Alias for --discovery-text"],["--validation_text <value>","Alias for --validation-text"],["--validation_command <value>","Alias for --validation-command"],["--validation_expected <value>","Alias for --validation-expected"],["--materialize_type <value>","Alias for --materialize-type"],["--materialize_parent <value>","Alias for --materialize-parent"],["--materialize_tags <value>","Alias for --materialize-tags"]],!1),P(l,[["--blocked_by <value>","Alias for --blocked-by"],["--depends_on <value>","Alias for --depends-on"]],!0),l.action(Zo),Tt(t,!1),Ut(t),t.command("merge").argument("<subcommand>",`${q.join(" | ")}`).argument("[artifact]",`driver: ${ae.join(" | ")}`).argument("[base]","driver: ancestor file (%O)").argument("[ours]","driver: current file (%A)").argument("[theirs]","driver: incoming file (%B)").option("--dry-run","install/reconcile: preview").option("--pre-commit-hook","install: opt into merge settlement hook").option("--stage","reconcile: stage lossless audit evidence").option("--message <text>","reconcile: audit message").option("--force","reconcile: accept reviewed decisions").option("--include-reconciled","report: include settled receipts").option("--output <path>","driver: alternate output").option("--item-path <path>","driver: repository-relative path (%P)").option("--prefer <side>","driver: ours|theirs (default ours)").description("Manage tracker merges.").action(ti),Kt(t),t.command("profile").argument("[subcommand]","Required; Profile subcommand: list, show, apply, or lint").argument("[name]","Profile name for show/apply/lint: agile, ops, or research").option("--dry-run","Preview the apply diff without writing any files (apply)").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("List, show, apply, and lint project profiles \u2014 archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.").action(li),Vt(t,$o);let p=t.command("files").description("Manage files linked to an item.");p.argument("<id>","Item id").option("--add <value>","Add linked file entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--note-conflict <mode>","On a different stored note: refuse (default)|replace|append").option("--list","List linked files without mutating").option("--append-stable","Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths","Validate linked file paths for existence and file shape").option("--full-history","Return all linked files after a write").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").action(di),p.command("discover").argument("<id>","Item id").option("--apply","Add discovered missing files to the item").option("--note <value>","Note to attach to discovered file links").option("--append-stable","Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(ci),zt(p),t.command("docs").argument("<id>","Item id").option("--add <value>","Add linked doc entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--note-conflict <mode>","On a different stored note: refuse (default)|replace|append").option("--list","List linked docs without mutating").option("--validate-paths","Validate linked doc paths for existence and file shape").option("--full-history","Return all linked docs after a write").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage docs linked to an item.").action(ui),t.command("deps").argument("<id>","Item id").option("--format <value>","Output format (tree, graph, or context)","tree").option("--max-depth <value>","Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>","Collapse mode (none or repeated)","none").option("--summary","Return counts only without full tree/graph payload").option("--full","Return the complete dependency row projection").option("--node-limit <value>","Maximum nodes in context output").option("--edge-limit <value>","Maximum edges and missing-reference rows in context output").option("--token-budget <value>","Maximum estimated tokens in context output").option("--cursor <value>","Continue an equivalent context query").option("--direction <value>","Context traversal direction (outgoing, incoming, or both)").option("--kind <value>","Restrict context traversal to registered relationship kinds (repeatable or comma-separated)",d).description("Show dependency relationships for an item.").action(pi)}export{ve as looksLikeSchemaSubcommandTypo,$o as parsePositiveIntOption,G as parseSchemaOrderOption,he as registerCommanderOptionContracts,wa as registerMutationCommands};
21
+ //# sourceMappingURL=register-mutation-EK6DVIQK.js.map