@unbrained/pm-cli 2026.6.13 → 2026.6.17

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 (808) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/README.md +1 -1
  3. package/dist/cli/bootstrap-args.d.ts +29 -0
  4. package/dist/cli/bootstrap-args.js +11 -4
  5. package/dist/cli/bootstrap-args.js.map +1 -1
  6. package/dist/cli/commander-usage.d.ts +12 -0
  7. package/dist/cli/commander-usage.js +18 -7
  8. package/dist/cli/commander-usage.js.map +1 -1
  9. package/dist/cli/commands/activity.d.ts +19 -0
  10. package/dist/cli/commands/activity.js +12 -2
  11. package/dist/cli/commands/activity.js.map +1 -1
  12. package/dist/cli/commands/aggregate.d.ts +58 -0
  13. package/dist/cli/commands/aggregate.js +48 -15
  14. package/dist/cli/commands/aggregate.js.map +1 -1
  15. package/dist/cli/commands/annotation-command.d.ts +6 -1
  16. package/dist/cli/commands/annotation-command.js +72 -2
  17. package/dist/cli/commands/annotation-command.js.map +1 -1
  18. package/dist/cli/commands/append.js +4 -3
  19. package/dist/cli/commands/append.js.map +1 -1
  20. package/dist/cli/commands/close-many.d.ts +20 -0
  21. package/dist/cli/commands/close-many.js +14 -23
  22. package/dist/cli/commands/close-many.js.map +1 -1
  23. package/dist/cli/commands/close.js +37 -4
  24. package/dist/cli/commands/close.js.map +1 -1
  25. package/dist/cli/commands/comments-audit.js +3 -2
  26. package/dist/cli/commands/comments-audit.js.map +1 -1
  27. package/dist/cli/commands/comments.d.ts +2 -0
  28. package/dist/cli/commands/comments.js +49 -23
  29. package/dist/cli/commands/comments.js.map +1 -1
  30. package/dist/cli/commands/completion.js +362 -15
  31. package/dist/cli/commands/completion.js.map +1 -1
  32. package/dist/cli/commands/config.d.ts +51 -1
  33. package/dist/cli/commands/config.js +50 -12
  34. package/dist/cli/commands/config.js.map +1 -1
  35. package/dist/cli/commands/context.d.ts +79 -1
  36. package/dist/cli/commands/context.js +151 -25
  37. package/dist/cli/commands/context.js.map +1 -1
  38. package/dist/cli/commands/contracts.d.ts +80 -1
  39. package/dist/cli/commands/contracts.js +54 -4
  40. package/dist/cli/commands/contracts.js.map +1 -1
  41. package/dist/cli/commands/create.d.ts +51 -0
  42. package/dist/cli/commands/create.js +137 -18
  43. package/dist/cli/commands/create.js.map +1 -1
  44. package/dist/cli/commands/dedupe-audit.d.ts +33 -0
  45. package/dist/cli/commands/dedupe-audit.js +18 -14
  46. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  47. package/dist/cli/commands/deps.js +7 -4
  48. package/dist/cli/commands/deps.js.map +1 -1
  49. package/dist/cli/commands/event-validation-messages.js +3 -3
  50. package/dist/cli/commands/event-validation-messages.js.map +1 -1
  51. package/dist/cli/commands/extension/bundled-catalog.d.ts +7 -0
  52. package/dist/cli/commands/extension/bundled-catalog.js +19 -15
  53. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  54. package/dist/cli/commands/extension/install-sources.d.ts +41 -1
  55. package/dist/cli/commands/extension/install-sources.js +26 -8
  56. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  57. package/dist/cli/commands/extension/shared.d.ts +5 -0
  58. package/dist/cli/commands/extension/shared.js +9 -3
  59. package/dist/cli/commands/extension/shared.js.map +1 -1
  60. package/dist/cli/commands/extension.d.ts +133 -1
  61. package/dist/cli/commands/extension.js +127 -9
  62. package/dist/cli/commands/extension.js.map +1 -1
  63. package/dist/cli/commands/files.d.ts +30 -1
  64. package/dist/cli/commands/files.js +21 -2
  65. package/dist/cli/commands/files.js.map +1 -1
  66. package/dist/cli/commands/focus.d.ts +11 -0
  67. package/dist/cli/commands/focus.js +86 -0
  68. package/dist/cli/commands/focus.js.map +1 -0
  69. package/dist/cli/commands/get.d.ts +9 -2
  70. package/dist/cli/commands/get.js +34 -6
  71. package/dist/cli/commands/get.js.map +1 -1
  72. package/dist/cli/commands/guide.d.ts +5 -0
  73. package/dist/cli/commands/guide.js +6 -3
  74. package/dist/cli/commands/guide.js.map +1 -1
  75. package/dist/cli/commands/health.d.ts +109 -0
  76. package/dist/cli/commands/health.js +87 -35
  77. package/dist/cli/commands/health.js.map +1 -1
  78. package/dist/cli/commands/history-compact.js +27 -36
  79. package/dist/cli/commands/history-compact.js.map +1 -1
  80. package/dist/cli/commands/history-redact.d.ts +46 -0
  81. package/dist/cli/commands/history-redact.js +99 -67
  82. package/dist/cli/commands/history-redact.js.map +1 -1
  83. package/dist/cli/commands/history-repair.js +34 -37
  84. package/dist/cli/commands/history-repair.js.map +1 -1
  85. package/dist/cli/commands/history.js +6 -2
  86. package/dist/cli/commands/history.js.map +1 -1
  87. package/dist/cli/commands/index.d.ts +4 -1
  88. package/dist/cli/commands/index.js +6 -3
  89. package/dist/cli/commands/index.js.map +1 -1
  90. package/dist/cli/commands/init-agent-guidance.d.ts +54 -0
  91. package/dist/cli/commands/init-agent-guidance.js +31 -4
  92. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  93. package/dist/cli/commands/init.d.ts +38 -2
  94. package/dist/cli/commands/init.js +50 -64
  95. package/dist/cli/commands/init.js.map +1 -1
  96. package/dist/cli/commands/learnings.js +4 -3
  97. package/dist/cli/commands/learnings.js.map +1 -1
  98. package/dist/cli/commands/lifecycle-transitions.d.ts +23 -0
  99. package/dist/cli/commands/lifecycle-transitions.js +41 -0
  100. package/dist/cli/commands/lifecycle-transitions.js.map +1 -0
  101. package/dist/cli/commands/linked-artifacts.d.ts +5 -0
  102. package/dist/cli/commands/linked-artifacts.js +18 -4
  103. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  104. package/dist/cli/commands/linked-test-parsers.d.ts +5 -0
  105. package/dist/cli/commands/linked-test-parsers.js +5 -2
  106. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  107. package/dist/cli/commands/list-filter-shared.d.ts +8 -0
  108. package/dist/cli/commands/list-filter-shared.js +70 -0
  109. package/dist/cli/commands/list-filter-shared.js.map +1 -0
  110. package/dist/cli/commands/list.d.ts +116 -0
  111. package/dist/cli/commands/list.js +194 -6
  112. package/dist/cli/commands/list.js.map +1 -1
  113. package/dist/cli/commands/normalize.js +16 -2
  114. package/dist/cli/commands/normalize.js.map +1 -1
  115. package/dist/cli/commands/notes.js +4 -3
  116. package/dist/cli/commands/notes.js.map +1 -1
  117. package/dist/cli/commands/plan.js +3 -2
  118. package/dist/cli/commands/plan.js.map +1 -1
  119. package/dist/cli/commands/recurrence-parsers.d.ts +9 -0
  120. package/dist/cli/commands/recurrence-parsers.js +19 -2
  121. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  122. package/dist/cli/commands/reindex.d.ts +83 -0
  123. package/dist/cli/commands/reindex.js +45 -10
  124. package/dist/cli/commands/reindex.js.map +1 -1
  125. package/dist/cli/commands/repeatable-metadata-parsers.js +28 -4
  126. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
  127. package/dist/cli/commands/restore.d.ts +40 -1
  128. package/dist/cli/commands/restore.js +27 -2
  129. package/dist/cli/commands/restore.js.map +1 -1
  130. package/dist/cli/commands/scheduling-shortcuts.d.ts +43 -0
  131. package/dist/cli/commands/scheduling-shortcuts.js +87 -0
  132. package/dist/cli/commands/scheduling-shortcuts.js.map +1 -0
  133. package/dist/cli/commands/schema.d.ts +152 -2
  134. package/dist/cli/commands/schema.js +510 -4
  135. package/dist/cli/commands/schema.js.map +1 -1
  136. package/dist/cli/commands/search.d.ts +289 -1
  137. package/dist/cli/commands/search.js +367 -60
  138. package/dist/cli/commands/search.js.map +1 -1
  139. package/dist/cli/commands/stats.d.ts +38 -0
  140. package/dist/cli/commands/stats.js +38 -10
  141. package/dist/cli/commands/stats.js.map +1 -1
  142. package/dist/cli/commands/telemetry.js +5 -3
  143. package/dist/cli/commands/telemetry.js.map +1 -1
  144. package/dist/cli/commands/templates.d.ts +18 -0
  145. package/dist/cli/commands/templates.js +9 -2
  146. package/dist/cli/commands/templates.js.map +1 -1
  147. package/dist/cli/commands/test-all.d.ts +5 -0
  148. package/dist/cli/commands/test-all.js +9 -3
  149. package/dist/cli/commands/test-all.js.map +1 -1
  150. package/dist/cli/commands/test.d.ts +70 -1
  151. package/dist/cli/commands/test.js +84 -3
  152. package/dist/cli/commands/test.js.map +1 -1
  153. package/dist/cli/commands/update-many.d.ts +34 -1
  154. package/dist/cli/commands/update-many.js +60 -31
  155. package/dist/cli/commands/update-many.js.map +1 -1
  156. package/dist/cli/commands/update.d.ts +71 -0
  157. package/dist/cli/commands/update.js +91 -11
  158. package/dist/cli/commands/update.js.map +1 -1
  159. package/dist/cli/commands/upgrade.d.ts +28 -1
  160. package/dist/cli/commands/upgrade.js +17 -4
  161. package/dist/cli/commands/upgrade.js.map +1 -1
  162. package/dist/cli/commands/validate.d.ts +114 -0
  163. package/dist/cli/commands/validate.js +153 -8
  164. package/dist/cli/commands/validate.js.map +1 -1
  165. package/dist/cli/error-guidance.d.ts +30 -0
  166. package/dist/cli/error-guidance.js +41 -6
  167. package/dist/cli/error-guidance.js.map +1 -1
  168. package/dist/cli/extension-command-options.js +9 -7
  169. package/dist/cli/extension-command-options.js.map +1 -1
  170. package/dist/cli/help-content.d.ts +8 -0
  171. package/dist/cli/help-content.js +54 -6
  172. package/dist/cli/help-content.js.map +1 -1
  173. package/dist/cli/help-json-payload.d.ts +19 -1
  174. package/dist/cli/help-json-payload.js +16 -7
  175. package/dist/cli/help-json-payload.js.map +1 -1
  176. package/dist/cli/main.d.ts +242 -0
  177. package/dist/cli/main.js +241 -45
  178. package/dist/cli/main.js.map +1 -1
  179. package/dist/cli/register-list-query.js +62 -5
  180. package/dist/cli/register-list-query.js.map +1 -1
  181. package/dist/cli/register-mutation.d.ts +16 -0
  182. package/dist/cli/register-mutation.js +376 -100
  183. package/dist/cli/register-mutation.js.map +1 -1
  184. package/dist/cli/register-operations.d.ts +8 -0
  185. package/dist/cli/register-operations.js +134 -11
  186. package/dist/cli/register-operations.js.map +1 -1
  187. package/dist/cli/register-setup.js +9 -6
  188. package/dist/cli/register-setup.js.map +1 -1
  189. package/dist/cli/registration-helpers.d.ts +4 -0
  190. package/dist/cli/registration-helpers.js +124 -38
  191. package/dist/cli/registration-helpers.js.map +1 -1
  192. package/dist/cli-bundle/chunks/activity-PZYSZA26.js +18 -0
  193. package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js → activity-SFM4THAU.js} +13 -11
  194. package/dist/cli-bundle/chunks/{aggregate-IRHJWEKG.js → aggregate-Y5ADDKBM.js} +55 -26
  195. package/dist/cli-bundle/chunks/aggregate-Y5ADDKBM.js.map +1 -0
  196. package/dist/cli-bundle/chunks/{aggregate-XEBW22UQ.js → aggregate-YTAUQLRW.js} +54 -25
  197. package/dist/cli-bundle/chunks/aggregate-YTAUQLRW.js.map +7 -0
  198. package/dist/cli-bundle/chunks/{append-NL67JNJU.js → append-4M7OVV7M.js} +11 -11
  199. package/dist/cli-bundle/chunks/append-4M7OVV7M.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{append-N2AWXKZC.js → append-HSPK4L4V.js} +10 -10
  201. package/dist/cli-bundle/chunks/{append-N2AWXKZC.js.map → append-HSPK4L4V.js.map} +2 -2
  202. package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js → chunk-26BM6YLO.js} +3 -3
  203. package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js → chunk-2C6FU3D3.js} +5 -5
  204. package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js.map → chunk-2C6FU3D3.js.map} +1 -1
  205. package/dist/cli-bundle/chunks/{chunk-SQDKAEKG.js → chunk-2OPYLXDO.js} +117 -37
  206. package/dist/cli-bundle/chunks/chunk-2OPYLXDO.js.map +7 -0
  207. package/dist/cli-bundle/chunks/{chunk-4ZKKZMLH.js → chunk-2S46FKLB.js} +104 -30
  208. package/dist/cli-bundle/chunks/chunk-2S46FKLB.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js → chunk-2TMKMTEI.js} +3 -3
  210. package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js → chunk-2VH7DFSJ.js} +2 -2
  211. package/dist/cli-bundle/chunks/{chunk-RHYBR6G7.js → chunk-3ENF4NO4.js} +74 -14
  212. package/dist/cli-bundle/chunks/chunk-3ENF4NO4.js.map +1 -0
  213. package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js +404 -0
  214. package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-AAUYXSFF.js → chunk-3R3FYCBV.js} +223 -50
  216. package/dist/cli-bundle/chunks/chunk-3R3FYCBV.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-5HSAHRYA.js → chunk-3UKJX3RP.js} +82 -21
  218. package/dist/cli-bundle/chunks/chunk-3UKJX3RP.js.map +7 -0
  219. package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js +83 -0
  220. package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-UCVJP4JL.js → chunk-5FDYWOJT.js} +52 -8
  222. package/dist/cli-bundle/chunks/chunk-5FDYWOJT.js.map +7 -0
  223. package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js → chunk-5XGWFUW2.js} +2 -2
  224. package/dist/cli-bundle/chunks/{chunk-LYNQ3NGI.js → chunk-6BD77FGL.js} +309 -20
  225. package/dist/cli-bundle/chunks/chunk-6BD77FGL.js.map +1 -0
  226. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js +35 -0
  227. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js.map +7 -0
  228. package/dist/cli-bundle/chunks/{chunk-36BCSMKP.js → chunk-6HF6CIY2.js} +26 -11
  229. package/dist/cli-bundle/chunks/chunk-6HF6CIY2.js.map +7 -0
  230. package/dist/cli-bundle/chunks/{chunk-M3SI2REU.js → chunk-6PBPD4MN.js} +322 -19
  231. package/dist/cli-bundle/chunks/chunk-6PBPD4MN.js.map +7 -0
  232. package/dist/cli-bundle/chunks/{chunk-TSXWFN3L.js → chunk-6VFUEGOA.js} +53 -9
  233. package/dist/cli-bundle/chunks/chunk-6VFUEGOA.js.map +1 -0
  234. package/dist/cli-bundle/chunks/{chunk-2J2AH4V5.js → chunk-AAOXSPAE.js} +56 -72
  235. package/dist/cli-bundle/chunks/chunk-AAOXSPAE.js.map +1 -0
  236. package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js → chunk-AJCQ5GT6.js} +4 -4
  237. package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js +61 -0
  238. package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{chunk-KHGTYCJ6.js → chunk-AOJQL33L.js} +83 -22
  240. package/dist/cli-bundle/chunks/chunk-AOJQL33L.js.map +1 -0
  241. package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js → chunk-AXLDUGXA.js} +7 -4
  242. package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js.map → chunk-AXLDUGXA.js.map} +2 -2
  243. package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js → chunk-BITCVGHT.js} +2 -2
  244. package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js → chunk-CGQTFWYI.js} +4 -4
  245. package/dist/cli-bundle/chunks/{chunk-LFW5NQUP.js → chunk-CHM2VFVL.js} +407 -290
  246. package/dist/cli-bundle/chunks/chunk-CHM2VFVL.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js → chunk-COVLE33A.js} +3 -3
  248. package/dist/cli-bundle/chunks/{chunk-SGMGMCIF.js → chunk-DDNBWH4W.js} +157 -25
  249. package/dist/cli-bundle/chunks/chunk-DDNBWH4W.js.map +1 -0
  250. package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js → chunk-F5MSD5HE.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-6TBR5AZ2.js → chunk-FAXB6F6R.js} +76 -8
  252. package/dist/cli-bundle/chunks/chunk-FAXB6F6R.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{chunk-L6YQONLM.js → chunk-FPDK5BZQ.js} +18 -19
  254. package/dist/cli-bundle/chunks/chunk-FPDK5BZQ.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{chunk-AGG32LKL.js → chunk-FPY2TOFI.js} +480 -24
  256. package/dist/cli-bundle/chunks/chunk-FPY2TOFI.js.map +1 -0
  257. package/dist/cli-bundle/chunks/{chunk-JWXTOYBI.js → chunk-G2MOUCTU.js} +121 -44
  258. package/dist/cli-bundle/chunks/chunk-G2MOUCTU.js.map +7 -0
  259. package/dist/cli-bundle/chunks/{chunk-3VULHQNS.js → chunk-G57RHEGP.js} +36 -18
  260. package/dist/cli-bundle/chunks/chunk-G57RHEGP.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{chunk-QQG4HEX7.js → chunk-IROHIK2T.js} +37 -63
  262. package/dist/cli-bundle/chunks/chunk-IROHIK2T.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js → chunk-JZHL4E3Q.js} +4 -4
  264. package/dist/cli-bundle/chunks/{chunk-XXLMJDUB.js → chunk-KA22USXD.js} +21 -22
  265. package/dist/cli-bundle/chunks/chunk-KA22USXD.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{chunk-WLH7X4RN.js → chunk-KBC4O7SY.js} +56 -72
  267. package/dist/cli-bundle/chunks/chunk-KBC4O7SY.js.map +7 -0
  268. package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js → chunk-KCAGIH6K.js} +3 -3
  269. package/dist/cli-bundle/chunks/{chunk-BVL5KGVA.js → chunk-KO3VM5GS.js} +27 -12
  270. package/dist/cli-bundle/chunks/chunk-KO3VM5GS.js.map +1 -0
  271. package/dist/cli-bundle/chunks/{chunk-IXVSSHGV.js → chunk-LNH5Q32E.js} +13 -8
  272. package/dist/cli-bundle/chunks/chunk-LNH5Q32E.js.map +7 -0
  273. package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js → chunk-LORM3M2I.js} +4 -4
  274. package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js.map → chunk-LORM3M2I.js.map} +1 -1
  275. package/dist/cli-bundle/chunks/{chunk-PNYAAB4S.js → chunk-LWGMDLQ6.js} +8 -3
  276. package/dist/cli-bundle/chunks/chunk-LWGMDLQ6.js.map +1 -0
  277. package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js → chunk-M4AVU7VC.js} +19 -8
  278. package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js.map → chunk-M4AVU7VC.js.map} +2 -2
  279. package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js → chunk-MIBX6ZRN.js} +3 -3
  280. package/dist/cli-bundle/chunks/{chunk-AUDDXKNX.js → chunk-MMF2E3FM.js} +77 -9
  281. package/dist/cli-bundle/chunks/chunk-MMF2E3FM.js.map +1 -0
  282. package/dist/cli-bundle/chunks/{chunk-RFR2YQGO.js → chunk-MORZOR7W.js} +21 -8
  283. package/dist/cli-bundle/chunks/chunk-MORZOR7W.js.map +1 -0
  284. package/dist/cli-bundle/chunks/{chunk-4TPFXE2R.js → chunk-MUTUZ2HD.js} +118 -74
  285. package/dist/cli-bundle/chunks/chunk-MUTUZ2HD.js.map +1 -0
  286. package/dist/cli-bundle/chunks/{chunk-HZOX5BYD.js → chunk-OGXEBTX3.js} +35 -17
  287. package/dist/cli-bundle/chunks/chunk-OGXEBTX3.js.map +7 -0
  288. package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js → chunk-OOIH6J5T.js} +4 -4
  289. package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js.map → chunk-OOIH6J5T.js.map} +1 -1
  290. package/dist/cli-bundle/chunks/{chunk-VNC2HBL4.js → chunk-OSBJPPX3.js} +20 -9
  291. package/dist/cli-bundle/chunks/chunk-OSBJPPX3.js.map +1 -0
  292. package/dist/cli-bundle/chunks/{chunk-2ANTZBYF.js → chunk-PJS3WDO2.js} +122 -45
  293. package/dist/cli-bundle/chunks/chunk-PJS3WDO2.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{chunk-7SM7VA5I.js → chunk-QGPE2H6Z.js} +19 -8
  295. package/dist/cli-bundle/chunks/chunk-QGPE2H6Z.js.map +7 -0
  296. package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js +58 -0
  297. package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js → chunk-QW2F6ARZ.js} +8 -5
  299. package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js.map → chunk-QW2F6ARZ.js.map} +1 -1
  300. package/dist/cli-bundle/chunks/{chunk-TOX7YQ7X.js → chunk-QXC3LWB7.js} +223 -50
  301. package/dist/cli-bundle/chunks/chunk-QXC3LWB7.js.map +1 -0
  302. package/dist/cli-bundle/chunks/{chunk-W6KNFAMZ.js → chunk-QXMXRPX5.js} +9 -8
  303. package/dist/cli-bundle/chunks/chunk-QXMXRPX5.js.map +7 -0
  304. package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js → chunk-R4AKUPKI.js} +3 -3
  305. package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js.map → chunk-R4AKUPKI.js.map} +1 -1
  306. package/dist/cli-bundle/chunks/chunk-RASR23HV.js +394 -0
  307. package/dist/cli-bundle/chunks/chunk-RASR23HV.js.map +1 -0
  308. package/dist/cli-bundle/chunks/{chunk-JW7D6437.js → chunk-SCDCNGCV.js} +20 -9
  309. package/dist/cli-bundle/chunks/chunk-SCDCNGCV.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js → chunk-SCS5PVAA.js} +10 -9
  311. package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js.map → chunk-SCS5PVAA.js.map} +2 -2
  312. package/dist/cli-bundle/chunks/{chunk-S2CDTRJ6.js → chunk-SJCMTOEU.js} +381 -271
  313. package/dist/cli-bundle/chunks/chunk-SJCMTOEU.js.map +1 -0
  314. package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js → chunk-SO2ES46D.js} +11 -10
  315. package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js.map → chunk-SO2ES46D.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/{chunk-MACCNKSZ.js → chunk-TBV33CB4.js} +36 -62
  317. package/dist/cli-bundle/chunks/chunk-TBV33CB4.js.map +7 -0
  318. package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js +86 -0
  319. package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js → chunk-TWBDDVIF.js} +20 -7
  321. package/dist/cli-bundle/chunks/chunk-TWBDDVIF.js.map +7 -0
  322. package/dist/cli-bundle/chunks/{chunk-4JHJ7YG2.js → chunk-UGUJ2UOR.js} +118 -74
  323. package/dist/cli-bundle/chunks/chunk-UGUJ2UOR.js.map +7 -0
  324. package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js → chunk-UN6P3IJ4.js} +3 -3
  325. package/dist/cli-bundle/chunks/{chunk-32XSW44C.js → chunk-V2GYOMEX.js} +10 -9
  326. package/dist/cli-bundle/chunks/chunk-V2GYOMEX.js.map +1 -0
  327. package/dist/cli-bundle/chunks/{chunk-HWHONML5.js → chunk-VF3KQGNY.js} +4 -4
  328. package/dist/cli-bundle/chunks/{chunk-SOHXUA2Q.js → chunk-VHG6LUKR.js} +116 -36
  329. package/dist/cli-bundle/chunks/chunk-VHG6LUKR.js.map +1 -0
  330. package/dist/cli-bundle/chunks/{chunk-7CRFV6JR.js → chunk-VXHMQDXA.js} +483 -27
  331. package/dist/cli-bundle/chunks/chunk-VXHMQDXA.js.map +7 -0
  332. package/dist/cli-bundle/chunks/{chunk-IZHCCG4S.js → chunk-VXRFAE7W.js} +14 -9
  333. package/dist/cli-bundle/chunks/chunk-VXRFAE7W.js.map +1 -0
  334. package/dist/cli-bundle/chunks/{chunk-R4VWYWRN.js → chunk-W3HFLORZ.js} +7 -2
  335. package/dist/cli-bundle/chunks/chunk-W3HFLORZ.js.map +7 -0
  336. package/dist/cli-bundle/chunks/{chunk-4FHLNNW7.js → chunk-WQRL4COW.js} +74 -14
  337. package/dist/cli-bundle/chunks/chunk-WQRL4COW.js.map +7 -0
  338. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js +32 -0
  339. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js.map +1 -0
  340. package/dist/cli-bundle/chunks/{chunk-MGAQ6KZG.js → chunk-XESAPVZ4.js} +166 -27
  341. package/dist/cli-bundle/chunks/chunk-XESAPVZ4.js.map +7 -0
  342. package/dist/cli-bundle/chunks/{chunk-PEH7SZD2.js → chunk-YLAW3FZN.js} +105 -31
  343. package/dist/cli-bundle/chunks/chunk-YLAW3FZN.js.map +7 -0
  344. package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js → claim-WGAWJCPY.js} +10 -10
  345. package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js → claim-ZI6P4LMU.js} +10 -10
  346. package/dist/cli-bundle/chunks/close-I7PRQ5G7.js +13 -0
  347. package/dist/cli-bundle/chunks/{close-SPUFW5QR.js → close-JMVVSIQE.js} +8 -8
  348. package/dist/cli-bundle/chunks/{close-many-GKAJX54X.js → close-many-IKPJXVOZ.js} +32 -20
  349. package/dist/cli-bundle/chunks/close-many-IKPJXVOZ.js.map +1 -0
  350. package/dist/cli-bundle/chunks/{close-many-GL6NRUU5.js → close-many-TXABDCSJ.js} +31 -19
  351. package/dist/cli-bundle/chunks/close-many-TXABDCSJ.js.map +7 -0
  352. package/dist/cli-bundle/chunks/{comments-5FPT6L7N.js → comments-RLWR2S7W.js} +55 -31
  353. package/dist/cli-bundle/chunks/comments-RLWR2S7W.js.map +1 -0
  354. package/dist/cli-bundle/chunks/{comments-TOLOYWNI.js → comments-YAMXKHUX.js} +54 -30
  355. package/dist/cli-bundle/chunks/comments-YAMXKHUX.js.map +7 -0
  356. package/dist/cli-bundle/chunks/{config-7N6D7YJE.js → config-7ICYC2WU.js} +83 -19
  357. package/dist/cli-bundle/chunks/config-7ICYC2WU.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{config-4MN45TIH.js → config-NGWN3EXC.js} +83 -19
  359. package/dist/cli-bundle/chunks/config-NGWN3EXC.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{context-AQSLE7DZ.js → context-K6QAHN5H.js} +128 -39
  361. package/dist/cli-bundle/chunks/context-K6QAHN5H.js.map +1 -0
  362. package/dist/cli-bundle/chunks/{context-U3PUJMVN.js → context-VGXOOAH2.js} +127 -38
  363. package/dist/cli-bundle/chunks/context-VGXOOAH2.js.map +7 -0
  364. package/dist/cli-bundle/chunks/{contracts-ITSJXO3O.js → contracts-KJGY2AQA.js} +99 -15
  365. package/dist/cli-bundle/chunks/contracts-KJGY2AQA.js.map +1 -0
  366. package/dist/cli-bundle/chunks/{contracts-H7KCQXLY.js → contracts-KMA6OJY7.js} +99 -15
  367. package/dist/cli-bundle/chunks/contracts-KMA6OJY7.js.map +7 -0
  368. package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js → copy-Q2PPU4AY.js} +7 -7
  369. package/dist/cli-bundle/chunks/{copy-C4W522JM.js → copy-SC6UF3PI.js} +7 -7
  370. package/dist/cli-bundle/chunks/{create-4EQNELMY.js → create-76FE7JVF.js} +16 -13
  371. package/dist/cli-bundle/chunks/create-RTRFW6RE.js +30 -0
  372. package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js → delete-T6DJSUJI.js} +7 -7
  373. package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js → delete-XFUX533E.js} +7 -7
  374. package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js → deps-5GWMMS6D.js} +9 -10
  375. package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js.map → deps-5GWMMS6D.js.map} +2 -2
  376. package/dist/cli-bundle/chunks/{deps-HV2C2L46.js → deps-MCCU633S.js} +10 -11
  377. package/dist/cli-bundle/chunks/deps-MCCU633S.js.map +1 -0
  378. package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js → docs-HE3HCQ4S.js} +9 -9
  379. package/dist/cli-bundle/chunks/{docs-RJQPLROO.js → docs-SXMOABHR.js} +9 -9
  380. package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js → extension-E23K4QRR.js} +7 -5
  381. package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js → extension-PMD3XMLN.js} +7 -5
  382. package/dist/cli-bundle/chunks/{files-OIFN3DQX.js → files-2RSWGPEU.js} +25 -11
  383. package/dist/cli-bundle/chunks/files-2RSWGPEU.js.map +1 -0
  384. package/dist/cli-bundle/chunks/{files-LIFDKNCN.js → files-ZWFJFWBK.js} +24 -10
  385. package/dist/cli-bundle/chunks/files-ZWFJFWBK.js.map +7 -0
  386. package/dist/cli-bundle/chunks/focus-KTTB3P3F.js +106 -0
  387. package/dist/cli-bundle/chunks/focus-KTTB3P3F.js.map +1 -0
  388. package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js +109 -0
  389. package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js.map +7 -0
  390. package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js → gc-BXIAKLAH.js} +3 -3
  391. package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js → gc-C7K6JNUO.js} +3 -3
  392. package/dist/cli-bundle/chunks/{get-SAB7CRBG.js → get-AZQLC4NO.js} +43 -16
  393. package/dist/cli-bundle/chunks/get-AZQLC4NO.js.map +1 -0
  394. package/dist/cli-bundle/chunks/{get-K7UULTQF.js → get-I65HTAWO.js} +42 -15
  395. package/dist/cli-bundle/chunks/get-I65HTAWO.js.map +7 -0
  396. package/dist/cli-bundle/chunks/{health-NUVZYIEV.js → health-3MFFPQVZ.js} +75 -49
  397. package/dist/cli-bundle/chunks/health-3MFFPQVZ.js.map +1 -0
  398. package/dist/cli-bundle/chunks/{health-VJWH3ZFK.js → health-MYZEOCLI.js} +74 -48
  399. package/dist/cli-bundle/chunks/health-MYZEOCLI.js.map +7 -0
  400. package/dist/cli-bundle/chunks/{history-GYFD2DJW.js → history-73Z6OBFZ.js} +10 -10
  401. package/dist/cli-bundle/chunks/history-BIPHVUMF.js +20 -0
  402. package/dist/cli-bundle/chunks/{history-compact-WQZQ6KXM.js → history-compact-24VQ63A3.js} +37 -46
  403. package/dist/cli-bundle/chunks/history-compact-24VQ63A3.js.map +7 -0
  404. package/dist/cli-bundle/chunks/{history-compact-SLL6ESXH.js → history-compact-UIAR2OI4.js} +38 -47
  405. package/dist/cli-bundle/chunks/history-compact-UIAR2OI4.js.map +1 -0
  406. package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js → history-redact-7YCXEWJD.js} +13 -11
  407. package/dist/cli-bundle/chunks/history-redact-WZZ6GZ2Z.js +21 -0
  408. package/dist/cli-bundle/chunks/{history-repair-BJCGM6Q3.js → history-repair-4NOFFG2W.js} +44 -49
  409. package/dist/cli-bundle/chunks/history-repair-4NOFFG2W.js.map +1 -0
  410. package/dist/cli-bundle/chunks/{history-repair-UCYS55ZX.js → history-repair-GQN2X4TR.js} +43 -48
  411. package/dist/cli-bundle/chunks/history-repair-GQN2X4TR.js.map +7 -0
  412. package/dist/cli-bundle/chunks/init-K34V4PZR.js +20 -0
  413. package/dist/cli-bundle/chunks/{init-MXV57LKL.js → init-TDEDNVMM.js} +12 -9
  414. package/dist/cli-bundle/chunks/{learnings-QKJOKEAO.js → learnings-TV2CTGJ3.js} +13 -12
  415. package/dist/cli-bundle/chunks/learnings-TV2CTGJ3.js.map +7 -0
  416. package/dist/cli-bundle/chunks/{learnings-L6KTZGOT.js → learnings-U67FTXPB.js} +14 -13
  417. package/dist/cli-bundle/chunks/learnings-U67FTXPB.js.map +1 -0
  418. package/dist/cli-bundle/chunks/list-MSHYOCFU.js +33 -0
  419. package/dist/cli-bundle/chunks/list-VV57WGUD.js +29 -0
  420. package/dist/cli-bundle/chunks/{notes-HMCB7TK6.js → notes-EUANWWKD.js} +13 -12
  421. package/dist/cli-bundle/chunks/notes-EUANWWKD.js.map +7 -0
  422. package/dist/cli-bundle/chunks/{notes-3NLK7WTZ.js → notes-GYVNDAL4.js} +14 -13
  423. package/dist/cli-bundle/chunks/notes-GYVNDAL4.js.map +1 -0
  424. package/dist/cli-bundle/chunks/{plan-NANUWH4T.js → plan-4LF4AV63.js} +15 -14
  425. package/dist/cli-bundle/chunks/plan-4LF4AV63.js.map +7 -0
  426. package/dist/cli-bundle/chunks/{plan-DWBYI5C6.js → plan-W27O6DBS.js} +16 -15
  427. package/dist/cli-bundle/chunks/plan-W27O6DBS.js.map +1 -0
  428. package/dist/cli-bundle/chunks/{register-list-query-SMMMLSWW.js → register-list-query-BXLEHJ7L.js} +32 -23
  429. package/dist/cli-bundle/chunks/register-list-query-BXLEHJ7L.js.map +1 -0
  430. package/dist/cli-bundle/chunks/{register-list-query-PWQ5F2VI.js → register-list-query-C2MS3BVQ.js} +31 -22
  431. package/dist/cli-bundle/chunks/register-list-query-C2MS3BVQ.js.map +7 -0
  432. package/dist/cli-bundle/chunks/{register-mutation-QKFPTIZG.js → register-mutation-6UCOEQ6L.js} +361 -106
  433. package/dist/cli-bundle/chunks/register-mutation-6UCOEQ6L.js.map +7 -0
  434. package/dist/cli-bundle/chunks/{register-mutation-ZYJQ4DVP.js → register-mutation-HE73PREP.js} +355 -107
  435. package/dist/cli-bundle/chunks/register-mutation-HE73PREP.js.map +1 -0
  436. package/dist/cli-bundle/chunks/{register-operations-2FMZ6WEF.js → register-operations-L6C32FDA.js} +111 -39
  437. package/dist/cli-bundle/chunks/register-operations-L6C32FDA.js.map +7 -0
  438. package/dist/cli-bundle/chunks/{register-operations-BAFQURZG.js → register-operations-QQEHEX4P.js} +112 -40
  439. package/dist/cli-bundle/chunks/register-operations-QQEHEX4P.js.map +1 -0
  440. package/dist/cli-bundle/chunks/{register-setup-QN2XV7UL.js → register-setup-A7N4PNT3.js} +18 -21
  441. package/dist/cli-bundle/chunks/register-setup-A7N4PNT3.js.map +1 -0
  442. package/dist/cli-bundle/chunks/{register-setup-DQEIKBIP.js → register-setup-WHG3NBP6.js} +17 -20
  443. package/dist/cli-bundle/chunks/register-setup-WHG3NBP6.js.map +7 -0
  444. package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js → restore-TSWSULYY.js} +13 -11
  445. package/dist/cli-bundle/chunks/restore-XQXICL3V.js +19 -0
  446. package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js +91 -0
  447. package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js.map +7 -0
  448. package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js +88 -0
  449. package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js.map +1 -0
  450. package/dist/cli-bundle/chunks/{schema-ZZ7ZDM2X.js → schema-7U7JUYGK.js} +797 -10
  451. package/dist/cli-bundle/chunks/schema-7U7JUYGK.js.map +1 -0
  452. package/dist/cli-bundle/chunks/{schema-RNVJ55V2.js → schema-TSBYSEMW.js} +810 -9
  453. package/dist/cli-bundle/chunks/schema-TSBYSEMW.js.map +7 -0
  454. package/dist/cli-bundle/chunks/{search-BJ457C2A.js → search-OXLSQKHP.js} +328 -71
  455. package/dist/cli-bundle/chunks/search-OXLSQKHP.js.map +7 -0
  456. package/dist/cli-bundle/chunks/{search-FQDZXX7P.js → search-T3TOFLOQ.js} +328 -71
  457. package/dist/cli-bundle/chunks/search-T3TOFLOQ.js.map +1 -0
  458. package/dist/cli-bundle/chunks/{stats-DUQWCVOS.js → stats-5CLG22YZ.js} +41 -16
  459. package/dist/cli-bundle/chunks/stats-5CLG22YZ.js.map +7 -0
  460. package/dist/cli-bundle/chunks/{stats-CUG3ZHOI.js → stats-XEMUXS42.js} +42 -17
  461. package/dist/cli-bundle/chunks/stats-XEMUXS42.js.map +1 -0
  462. package/dist/cli-bundle/chunks/{telemetry-RK2VX75A.js → telemetry-23OPBBZT.js} +7 -7
  463. package/dist/cli-bundle/chunks/telemetry-23OPBBZT.js.map +1 -0
  464. package/dist/cli-bundle/chunks/{telemetry-33MRGX4Z.js → telemetry-I3D7XZ55.js} +6 -6
  465. package/dist/cli-bundle/chunks/telemetry-I3D7XZ55.js.map +7 -0
  466. package/dist/cli-bundle/chunks/test-AROS3LIV.js +35 -0
  467. package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js → test-CECIMKOA.js} +17 -14
  468. package/dist/cli-bundle/chunks/{test-all-ARSMX33Q.js → test-all-4DEQPIXH.js} +25 -17
  469. package/dist/cli-bundle/chunks/test-all-4DEQPIXH.js.map +1 -0
  470. package/dist/cli-bundle/chunks/{test-all-ANYQ33O2.js → test-all-6RO6X3SM.js} +24 -16
  471. package/dist/cli-bundle/chunks/test-all-6RO6X3SM.js.map +7 -0
  472. package/dist/cli-bundle/chunks/{test-runs-5URSD34O.js → test-runs-AAXVFWKH.js} +62 -65
  473. package/dist/cli-bundle/chunks/test-runs-AAXVFWKH.js.map +1 -0
  474. package/dist/cli-bundle/chunks/{test-runs-XNACGSNQ.js → test-runs-LYBQSYRC.js} +61 -64
  475. package/dist/cli-bundle/chunks/test-runs-LYBQSYRC.js.map +7 -0
  476. package/dist/cli-bundle/chunks/update-MIWEJC76.js +24 -0
  477. package/dist/cli-bundle/chunks/update-P7I5YSRB.js +28 -0
  478. package/dist/cli-bundle/chunks/{update-many-724JCVDE.js → update-many-5B4HLVBK.js} +79 -33
  479. package/dist/cli-bundle/chunks/update-many-5B4HLVBK.js.map +7 -0
  480. package/dist/cli-bundle/chunks/{update-many-6B7PJ33I.js → update-many-G2QOVZSB.js} +80 -34
  481. package/dist/cli-bundle/chunks/update-many-G2QOVZSB.js.map +1 -0
  482. package/dist/cli-bundle/chunks/{upgrade-QHRGDBSA.js → upgrade-GFIDL62L.js} +23 -9
  483. package/dist/cli-bundle/chunks/upgrade-GFIDL62L.js.map +1 -0
  484. package/dist/cli-bundle/chunks/{upgrade-ALBEZAI7.js → upgrade-QUQYL7D3.js} +22 -8
  485. package/dist/cli-bundle/chunks/upgrade-QUQYL7D3.js.map +7 -0
  486. package/dist/cli-bundle/chunks/{validate-UY6DRCG5.js → validate-ADDZBMM3.js} +236 -30
  487. package/dist/cli-bundle/chunks/validate-ADDZBMM3.js.map +7 -0
  488. package/dist/cli-bundle/chunks/{validate-IQRYFXIV.js → validate-MAS3H6ZP.js} +222 -30
  489. package/dist/cli-bundle/chunks/validate-MAS3H6ZP.js.map +1 -0
  490. package/dist/cli-bundle/main.js +312 -139
  491. package/dist/cli-bundle/main.js.map +3 -3
  492. package/dist/cli.d.ts +10 -0
  493. package/dist/cli.js +21 -8
  494. package/dist/cli.js.map +1 -1
  495. package/dist/core/config/nested-settings.js +40 -2
  496. package/dist/core/config/nested-settings.js.map +1 -1
  497. package/dist/core/diagnostics/remediation.js +7 -2
  498. package/dist/core/diagnostics/remediation.js.map +1 -1
  499. package/dist/core/extensions/extension-policy.js +14 -15
  500. package/dist/core/extensions/extension-policy.js.map +1 -1
  501. package/dist/core/extensions/item-fields.js +4 -5
  502. package/dist/core/extensions/item-fields.js.map +1 -1
  503. package/dist/core/extensions/loader.d.ts +75 -1
  504. package/dist/core/extensions/loader.js +56 -32
  505. package/dist/core/extensions/loader.js.map +1 -1
  506. package/dist/core/governance/content-fields.d.ts +84 -0
  507. package/dist/core/governance/content-fields.js +182 -0
  508. package/dist/core/governance/content-fields.js.map +1 -0
  509. package/dist/core/governance/issue-codes.d.ts +51 -0
  510. package/dist/core/governance/issue-codes.js +95 -0
  511. package/dist/core/governance/issue-codes.js.map +1 -0
  512. package/dist/core/governance/metadata-coverage.d.ts +168 -0
  513. package/dist/core/governance/metadata-coverage.js +362 -0
  514. package/dist/core/governance/metadata-coverage.js.map +1 -0
  515. package/dist/core/history/history-rewrite.d.ts +22 -0
  516. package/dist/core/history/history-rewrite.js +38 -2
  517. package/dist/core/history/history-rewrite.js.map +1 -1
  518. package/dist/core/history/history.d.ts +7 -0
  519. package/dist/core/history/history.js +6 -2
  520. package/dist/core/history/history.js.map +1 -1
  521. package/dist/core/io/body-file.d.ts +14 -0
  522. package/dist/core/io/body-file.js +47 -0
  523. package/dist/core/io/body-file.js.map +1 -0
  524. package/dist/core/item/item-format.d.ts +46 -1
  525. package/dist/core/item/item-format.js +51 -60
  526. package/dist/core/item/item-format.js.map +1 -1
  527. package/dist/core/item/parse.d.ts +41 -0
  528. package/dist/core/item/parse.js +69 -16
  529. package/dist/core/item/parse.js.map +1 -1
  530. package/dist/core/item/type-registry.d.ts +1 -0
  531. package/dist/core/item/type-registry.js +8 -10
  532. package/dist/core/item/type-registry.js.map +1 -1
  533. package/dist/core/lock/lock.d.ts +26 -0
  534. package/dist/core/lock/lock.js +10 -2
  535. package/dist/core/lock/lock.js.map +1 -1
  536. package/dist/core/output/output.d.ts +7 -0
  537. package/dist/core/output/output.js +6 -2
  538. package/dist/core/output/output.js.map +1 -1
  539. package/dist/core/schema/fields-file.d.ts +94 -0
  540. package/dist/core/schema/fields-file.js +317 -0
  541. package/dist/core/schema/fields-file.js.map +1 -0
  542. package/dist/core/schema/item-types-file.d.ts +25 -2
  543. package/dist/core/schema/item-types-file.js +78 -6
  544. package/dist/core/schema/item-types-file.js.map +1 -1
  545. package/dist/core/schema/runtime-schema.d.ts +7 -0
  546. package/dist/core/schema/runtime-schema.js +23 -16
  547. package/dist/core/schema/runtime-schema.js.map +1 -1
  548. package/dist/core/schema/type-inference.d.ts +34 -0
  549. package/dist/core/schema/type-inference.js +97 -0
  550. package/dist/core/schema/type-inference.js.map +1 -0
  551. package/dist/core/schema/type-presets.d.ts +30 -0
  552. package/dist/core/schema/type-presets.js +96 -0
  553. package/dist/core/schema/type-presets.js.map +1 -0
  554. package/dist/core/search/cache.d.ts +19 -1
  555. package/dist/core/search/cache.js +11 -3
  556. package/dist/core/search/cache.js.map +1 -1
  557. package/dist/core/search/corpus.d.ts +36 -2
  558. package/dist/core/search/corpus.js +120 -24
  559. package/dist/core/search/corpus.js.map +1 -1
  560. package/dist/core/search/providers.d.ts +19 -0
  561. package/dist/core/search/providers.js +19 -2
  562. package/dist/core/search/providers.js.map +1 -1
  563. package/dist/core/sentry/instrument.d.ts +1 -0
  564. package/dist/core/sentry/instrument.js +6 -2
  565. package/dist/core/sentry/instrument.js.map +1 -1
  566. package/dist/core/session/session-state.d.ts +16 -0
  567. package/dist/core/session/session-state.js +48 -0
  568. package/dist/core/session/session-state.js.map +1 -0
  569. package/dist/core/shared/constants.d.ts +8 -0
  570. package/dist/core/shared/constants.js +11 -2
  571. package/dist/core/shared/constants.js.map +1 -1
  572. package/dist/core/shared/text-normalization.js +4 -3
  573. package/dist/core/shared/text-normalization.js.map +1 -1
  574. package/dist/core/shared/time.d.ts +13 -0
  575. package/dist/core/shared/time.js +19 -7
  576. package/dist/core/shared/time.js.map +1 -1
  577. package/dist/core/store/front-matter-cache.d.ts +13 -0
  578. package/dist/core/store/front-matter-cache.js +21 -11
  579. package/dist/core/store/front-matter-cache.js.map +1 -1
  580. package/dist/core/store/item-store.d.ts +11 -0
  581. package/dist/core/store/item-store.js +12 -3
  582. package/dist/core/store/item-store.js.map +1 -1
  583. package/dist/core/store/settings-validator.d.ts +2 -0
  584. package/dist/core/store/settings-validator.js +25 -2
  585. package/dist/core/store/settings-validator.js.map +1 -1
  586. package/dist/core/store/settings.d.ts +60 -1
  587. package/dist/core/store/settings.js +100 -46
  588. package/dist/core/store/settings.js.map +1 -1
  589. package/dist/core/telemetry/observability.js +10 -8
  590. package/dist/core/telemetry/observability.js.map +1 -1
  591. package/dist/core/telemetry/runtime.d.ts +272 -1
  592. package/dist/core/telemetry/runtime.js +358 -37
  593. package/dist/core/telemetry/runtime.js.map +1 -1
  594. package/dist/core/test/background-runs.d.ts +35 -0
  595. package/dist/core/test/background-runs.js +72 -61
  596. package/dist/core/test/background-runs.js.map +1 -1
  597. package/dist/core/test/run-selectors.js +5 -4
  598. package/dist/core/test/run-selectors.js.map +1 -1
  599. package/dist/core/validate/estimate-defaults.d.ts +39 -0
  600. package/dist/core/validate/estimate-defaults.js +117 -0
  601. package/dist/core/validate/estimate-defaults.js.map +1 -0
  602. package/dist/core/validate/fix-planning.d.ts +21 -3
  603. package/dist/core/validate/fix-planning.js +31 -4
  604. package/dist/core/validate/fix-planning.js.map +1 -1
  605. package/dist/core/validate/missing-link-owners.d.ts +64 -0
  606. package/dist/core/validate/missing-link-owners.js +98 -0
  607. package/dist/core/validate/missing-link-owners.js.map +1 -0
  608. package/dist/mcp/server.d.ts +61 -0
  609. package/dist/mcp/server.js +98 -8
  610. package/dist/mcp/server.js.map +1 -1
  611. package/dist/mcp/tool-definitions.js +64 -10
  612. package/dist/mcp/tool-definitions.js.map +1 -1
  613. package/dist/sdk/cli-contracts/commander-types.js +13 -2
  614. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  615. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  616. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  617. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  618. package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
  619. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  620. package/dist/sdk/cli-contracts/tool-parameter-tables.js +127 -11
  621. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  622. package/dist/sdk/cli-contracts.d.ts +31 -0
  623. package/dist/sdk/cli-contracts.js +238 -12
  624. package/dist/sdk/cli-contracts.js.map +1 -1
  625. package/dist/types.d.ts +17 -1
  626. package/dist/types.js +3 -3
  627. package/dist/types.js.map +1 -1
  628. package/docs/AGENT_GUIDE.md +15 -3
  629. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  630. package/docs/COMMANDS.md +171 -10
  631. package/docs/CONFIGURATION.md +135 -0
  632. package/docs/TESTING.md +6 -4
  633. package/package.json +6 -4
  634. package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
  635. package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
  636. package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
  637. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  638. package/plugins/pm-claude/README.md +3 -3
  639. package/plugins/pm-claude/commands/pm-init.md +1 -1
  640. package/plugins/pm-codex/README.md +1 -1
  641. package/scripts/bundle-cli.mjs +46 -37
  642. package/scripts/finalize-build.mjs +20 -9
  643. package/scripts/prepare-build-cache.mjs +27 -16
  644. package/dist/cli-bundle/chunks/activity-XIOTGZMU.js +0 -16
  645. package/dist/cli-bundle/chunks/aggregate-IRHJWEKG.js.map +0 -1
  646. package/dist/cli-bundle/chunks/aggregate-XEBW22UQ.js.map +0 -7
  647. package/dist/cli-bundle/chunks/append-NL67JNJU.js.map +0 -1
  648. package/dist/cli-bundle/chunks/chunk-2ANTZBYF.js.map +0 -1
  649. package/dist/cli-bundle/chunks/chunk-2J2AH4V5.js.map +0 -1
  650. package/dist/cli-bundle/chunks/chunk-32XSW44C.js.map +0 -1
  651. package/dist/cli-bundle/chunks/chunk-36BCSMKP.js.map +0 -7
  652. package/dist/cli-bundle/chunks/chunk-3VULHQNS.js.map +0 -1
  653. package/dist/cli-bundle/chunks/chunk-4FHLNNW7.js.map +0 -7
  654. package/dist/cli-bundle/chunks/chunk-4JHJ7YG2.js.map +0 -7
  655. package/dist/cli-bundle/chunks/chunk-4TPFXE2R.js.map +0 -1
  656. package/dist/cli-bundle/chunks/chunk-4ZKKZMLH.js.map +0 -1
  657. package/dist/cli-bundle/chunks/chunk-5HSAHRYA.js.map +0 -7
  658. package/dist/cli-bundle/chunks/chunk-6TBR5AZ2.js.map +0 -7
  659. package/dist/cli-bundle/chunks/chunk-7CRFV6JR.js.map +0 -7
  660. package/dist/cli-bundle/chunks/chunk-7SM7VA5I.js.map +0 -7
  661. package/dist/cli-bundle/chunks/chunk-AAUYXSFF.js.map +0 -7
  662. package/dist/cli-bundle/chunks/chunk-AGG32LKL.js.map +0 -1
  663. package/dist/cli-bundle/chunks/chunk-AUDDXKNX.js.map +0 -1
  664. package/dist/cli-bundle/chunks/chunk-BVL5KGVA.js.map +0 -1
  665. package/dist/cli-bundle/chunks/chunk-C24PWDFG.js +0 -138
  666. package/dist/cli-bundle/chunks/chunk-C24PWDFG.js.map +0 -7
  667. package/dist/cli-bundle/chunks/chunk-HLEGAQXT.js.map +0 -7
  668. package/dist/cli-bundle/chunks/chunk-HZOX5BYD.js.map +0 -7
  669. package/dist/cli-bundle/chunks/chunk-IXVSSHGV.js.map +0 -7
  670. package/dist/cli-bundle/chunks/chunk-IZHCCG4S.js.map +0 -1
  671. package/dist/cli-bundle/chunks/chunk-JW7D6437.js.map +0 -1
  672. package/dist/cli-bundle/chunks/chunk-JWXTOYBI.js.map +0 -7
  673. package/dist/cli-bundle/chunks/chunk-KHGTYCJ6.js.map +0 -1
  674. package/dist/cli-bundle/chunks/chunk-L6YQONLM.js.map +0 -1
  675. package/dist/cli-bundle/chunks/chunk-LFW5NQUP.js.map +0 -7
  676. package/dist/cli-bundle/chunks/chunk-LYNQ3NGI.js.map +0 -1
  677. package/dist/cli-bundle/chunks/chunk-M3SI2REU.js.map +0 -7
  678. package/dist/cli-bundle/chunks/chunk-MACCNKSZ.js.map +0 -7
  679. package/dist/cli-bundle/chunks/chunk-MGAQ6KZG.js.map +0 -7
  680. package/dist/cli-bundle/chunks/chunk-PEH7SZD2.js.map +0 -7
  681. package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
  682. package/dist/cli-bundle/chunks/chunk-QQG4HEX7.js.map +0 -1
  683. package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
  684. package/dist/cli-bundle/chunks/chunk-RFR2YQGO.js.map +0 -1
  685. package/dist/cli-bundle/chunks/chunk-RHYBR6G7.js.map +0 -1
  686. package/dist/cli-bundle/chunks/chunk-S2CDTRJ6.js.map +0 -1
  687. package/dist/cli-bundle/chunks/chunk-SGMGMCIF.js.map +0 -1
  688. package/dist/cli-bundle/chunks/chunk-SOHXUA2Q.js.map +0 -1
  689. package/dist/cli-bundle/chunks/chunk-SQDKAEKG.js.map +0 -7
  690. package/dist/cli-bundle/chunks/chunk-TOX7YQ7X.js.map +0 -1
  691. package/dist/cli-bundle/chunks/chunk-TSXWFN3L.js.map +0 -1
  692. package/dist/cli-bundle/chunks/chunk-UCVJP4JL.js.map +0 -7
  693. package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js +0 -128
  694. package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js.map +0 -1
  695. package/dist/cli-bundle/chunks/chunk-VNC2HBL4.js.map +0 -1
  696. package/dist/cli-bundle/chunks/chunk-W6KNFAMZ.js.map +0 -7
  697. package/dist/cli-bundle/chunks/chunk-WLH7X4RN.js.map +0 -7
  698. package/dist/cli-bundle/chunks/chunk-XXLMJDUB.js.map +0 -7
  699. package/dist/cli-bundle/chunks/close-WOG5WTMZ.js +0 -13
  700. package/dist/cli-bundle/chunks/close-many-GKAJX54X.js.map +0 -1
  701. package/dist/cli-bundle/chunks/close-many-GL6NRUU5.js.map +0 -7
  702. package/dist/cli-bundle/chunks/comments-5FPT6L7N.js.map +0 -1
  703. package/dist/cli-bundle/chunks/comments-TOLOYWNI.js.map +0 -7
  704. package/dist/cli-bundle/chunks/config-4MN45TIH.js.map +0 -1
  705. package/dist/cli-bundle/chunks/config-7N6D7YJE.js.map +0 -7
  706. package/dist/cli-bundle/chunks/context-AQSLE7DZ.js.map +0 -1
  707. package/dist/cli-bundle/chunks/context-U3PUJMVN.js.map +0 -7
  708. package/dist/cli-bundle/chunks/contracts-H7KCQXLY.js.map +0 -7
  709. package/dist/cli-bundle/chunks/contracts-ITSJXO3O.js.map +0 -1
  710. package/dist/cli-bundle/chunks/create-NW3K7LVG.js +0 -27
  711. package/dist/cli-bundle/chunks/deps-HV2C2L46.js.map +0 -1
  712. package/dist/cli-bundle/chunks/files-LIFDKNCN.js.map +0 -7
  713. package/dist/cli-bundle/chunks/files-OIFN3DQX.js.map +0 -1
  714. package/dist/cli-bundle/chunks/get-K7UULTQF.js.map +0 -7
  715. package/dist/cli-bundle/chunks/get-SAB7CRBG.js.map +0 -1
  716. package/dist/cli-bundle/chunks/health-NUVZYIEV.js.map +0 -1
  717. package/dist/cli-bundle/chunks/health-VJWH3ZFK.js.map +0 -7
  718. package/dist/cli-bundle/chunks/history-IUVN4NTN.js +0 -20
  719. package/dist/cli-bundle/chunks/history-compact-SLL6ESXH.js.map +0 -1
  720. package/dist/cli-bundle/chunks/history-compact-WQZQ6KXM.js.map +0 -7
  721. package/dist/cli-bundle/chunks/history-redact-75KIIJUJ.js +0 -19
  722. package/dist/cli-bundle/chunks/history-repair-BJCGM6Q3.js.map +0 -1
  723. package/dist/cli-bundle/chunks/history-repair-UCYS55ZX.js.map +0 -7
  724. package/dist/cli-bundle/chunks/init-JJFYRUKG.js +0 -17
  725. package/dist/cli-bundle/chunks/learnings-L6KTZGOT.js.map +0 -1
  726. package/dist/cli-bundle/chunks/learnings-QKJOKEAO.js.map +0 -7
  727. package/dist/cli-bundle/chunks/list-GGVPXEV6.js +0 -23
  728. package/dist/cli-bundle/chunks/list-VOQDQHA4.js +0 -19
  729. package/dist/cli-bundle/chunks/notes-3NLK7WTZ.js.map +0 -1
  730. package/dist/cli-bundle/chunks/notes-HMCB7TK6.js.map +0 -7
  731. package/dist/cli-bundle/chunks/plan-DWBYI5C6.js.map +0 -1
  732. package/dist/cli-bundle/chunks/plan-NANUWH4T.js.map +0 -7
  733. package/dist/cli-bundle/chunks/register-list-query-PWQ5F2VI.js.map +0 -7
  734. package/dist/cli-bundle/chunks/register-list-query-SMMMLSWW.js.map +0 -1
  735. package/dist/cli-bundle/chunks/register-mutation-QKFPTIZG.js.map +0 -7
  736. package/dist/cli-bundle/chunks/register-mutation-ZYJQ4DVP.js.map +0 -1
  737. package/dist/cli-bundle/chunks/register-operations-2FMZ6WEF.js.map +0 -7
  738. package/dist/cli-bundle/chunks/register-operations-BAFQURZG.js.map +0 -1
  739. package/dist/cli-bundle/chunks/register-setup-DQEIKBIP.js.map +0 -7
  740. package/dist/cli-bundle/chunks/register-setup-QN2XV7UL.js.map +0 -1
  741. package/dist/cli-bundle/chunks/restore-DRBNXJJH.js +0 -17
  742. package/dist/cli-bundle/chunks/schema-RNVJ55V2.js.map +0 -7
  743. package/dist/cli-bundle/chunks/schema-ZZ7ZDM2X.js.map +0 -1
  744. package/dist/cli-bundle/chunks/search-BJ457C2A.js.map +0 -7
  745. package/dist/cli-bundle/chunks/search-FQDZXX7P.js.map +0 -1
  746. package/dist/cli-bundle/chunks/stats-CUG3ZHOI.js.map +0 -1
  747. package/dist/cli-bundle/chunks/stats-DUQWCVOS.js.map +0 -7
  748. package/dist/cli-bundle/chunks/telemetry-33MRGX4Z.js.map +0 -7
  749. package/dist/cli-bundle/chunks/telemetry-RK2VX75A.js.map +0 -1
  750. package/dist/cli-bundle/chunks/test-SDMYEQHH.js +0 -32
  751. package/dist/cli-bundle/chunks/test-all-ANYQ33O2.js.map +0 -7
  752. package/dist/cli-bundle/chunks/test-all-ARSMX33Q.js.map +0 -1
  753. package/dist/cli-bundle/chunks/test-runs-5URSD34O.js.map +0 -1
  754. package/dist/cli-bundle/chunks/test-runs-XNACGSNQ.js.map +0 -7
  755. package/dist/cli-bundle/chunks/update-PD46VOXI.js +0 -21
  756. package/dist/cli-bundle/chunks/update-U235A7WP.js +0 -25
  757. package/dist/cli-bundle/chunks/update-many-6B7PJ33I.js.map +0 -1
  758. package/dist/cli-bundle/chunks/update-many-724JCVDE.js.map +0 -7
  759. package/dist/cli-bundle/chunks/upgrade-ALBEZAI7.js.map +0 -7
  760. package/dist/cli-bundle/chunks/upgrade-QHRGDBSA.js.map +0 -1
  761. package/dist/cli-bundle/chunks/validate-IQRYFXIV.js.map +0 -1
  762. package/dist/cli-bundle/chunks/validate-UY6DRCG5.js.map +0 -7
  763. /package/dist/cli-bundle/chunks/{activity-XIOTGZMU.js.map → activity-PZYSZA26.js.map} +0 -0
  764. /package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js.map → activity-SFM4THAU.js.map} +0 -0
  765. /package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js.map → chunk-26BM6YLO.js.map} +0 -0
  766. /package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js.map → chunk-2TMKMTEI.js.map} +0 -0
  767. /package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js.map → chunk-2VH7DFSJ.js.map} +0 -0
  768. /package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js.map → chunk-5XGWFUW2.js.map} +0 -0
  769. /package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js.map → chunk-AJCQ5GT6.js.map} +0 -0
  770. /package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js.map → chunk-BITCVGHT.js.map} +0 -0
  771. /package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js.map → chunk-CGQTFWYI.js.map} +0 -0
  772. /package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js.map → chunk-COVLE33A.js.map} +0 -0
  773. /package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js.map → chunk-F5MSD5HE.js.map} +0 -0
  774. /package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js.map → chunk-JZHL4E3Q.js.map} +0 -0
  775. /package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js.map → chunk-KCAGIH6K.js.map} +0 -0
  776. /package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js.map → chunk-MIBX6ZRN.js.map} +0 -0
  777. /package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js.map → chunk-UN6P3IJ4.js.map} +0 -0
  778. /package/dist/cli-bundle/chunks/{chunk-HWHONML5.js.map → chunk-VF3KQGNY.js.map} +0 -0
  779. /package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js.map → claim-WGAWJCPY.js.map} +0 -0
  780. /package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js.map → claim-ZI6P4LMU.js.map} +0 -0
  781. /package/dist/cli-bundle/chunks/{close-WOG5WTMZ.js.map → close-I7PRQ5G7.js.map} +0 -0
  782. /package/dist/cli-bundle/chunks/{close-SPUFW5QR.js.map → close-JMVVSIQE.js.map} +0 -0
  783. /package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js.map → copy-Q2PPU4AY.js.map} +0 -0
  784. /package/dist/cli-bundle/chunks/{copy-C4W522JM.js.map → copy-SC6UF3PI.js.map} +0 -0
  785. /package/dist/cli-bundle/chunks/{create-4EQNELMY.js.map → create-76FE7JVF.js.map} +0 -0
  786. /package/dist/cli-bundle/chunks/{create-NW3K7LVG.js.map → create-RTRFW6RE.js.map} +0 -0
  787. /package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js.map → delete-T6DJSUJI.js.map} +0 -0
  788. /package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js.map → delete-XFUX533E.js.map} +0 -0
  789. /package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js.map → docs-HE3HCQ4S.js.map} +0 -0
  790. /package/dist/cli-bundle/chunks/{docs-RJQPLROO.js.map → docs-SXMOABHR.js.map} +0 -0
  791. /package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js.map → extension-E23K4QRR.js.map} +0 -0
  792. /package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js.map → extension-PMD3XMLN.js.map} +0 -0
  793. /package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js.map → gc-BXIAKLAH.js.map} +0 -0
  794. /package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js.map → gc-C7K6JNUO.js.map} +0 -0
  795. /package/dist/cli-bundle/chunks/{history-GYFD2DJW.js.map → history-73Z6OBFZ.js.map} +0 -0
  796. /package/dist/cli-bundle/chunks/{history-IUVN4NTN.js.map → history-BIPHVUMF.js.map} +0 -0
  797. /package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js.map → history-redact-7YCXEWJD.js.map} +0 -0
  798. /package/dist/cli-bundle/chunks/{history-redact-75KIIJUJ.js.map → history-redact-WZZ6GZ2Z.js.map} +0 -0
  799. /package/dist/cli-bundle/chunks/{init-JJFYRUKG.js.map → init-K34V4PZR.js.map} +0 -0
  800. /package/dist/cli-bundle/chunks/{init-MXV57LKL.js.map → init-TDEDNVMM.js.map} +0 -0
  801. /package/dist/cli-bundle/chunks/{list-GGVPXEV6.js.map → list-MSHYOCFU.js.map} +0 -0
  802. /package/dist/cli-bundle/chunks/{list-VOQDQHA4.js.map → list-VV57WGUD.js.map} +0 -0
  803. /package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js.map → restore-TSWSULYY.js.map} +0 -0
  804. /package/dist/cli-bundle/chunks/{restore-DRBNXJJH.js.map → restore-XQXICL3V.js.map} +0 -0
  805. /package/dist/cli-bundle/chunks/{test-SDMYEQHH.js.map → test-AROS3LIV.js.map} +0 -0
  806. /package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js.map → test-CECIMKOA.js.map} +0 -0
  807. /package/dist/cli-bundle/chunks/{update-PD46VOXI.js.map → update-MIWEJC76.js.map} +0 -0
  808. /package/dist/cli-bundle/chunks/{update-U235A7WP.js.map → update-P7I5YSRB.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/schema/status-defs-file.ts","../../../../../../../../core/schema/fields-file.ts","../../../../../../../../core/schema/type-inference.ts","../../../../../../../../cli/commands/schema.ts"],"sourcesContent":["import { RUNTIME_STATUS_ROLE_VALUES } from \"../../types/index.js\";\nimport type { RuntimeStatusDefinition, RuntimeStatusRole } from \"../../types/index.js\";\nimport { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from \"./runtime-schema.js\";\n\nexport type { RuntimeStatusDefinition, RuntimeStatusRole } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-status` / `pm schema remove-status`\n * commands. The CLI command file (schema.ts) owns IO/governance; everything\n * testable and side-effect-free lives here so it can be coverage-gated to 100%.\n *\n * Statuses persist at `.agents/pm/schema/statuses.json` under the shape\n * `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime\n * merge layer (src/core/store/settings.ts) still supplies the built-in defaults\n * from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them\n * into the persisted file.\n */\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\n\n/**\n * The 5 lifecycle status ids that ship as built-in defaults and may never be\n * removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS:\n * open/in_progress/blocked/closed/canceled). `draft` is also a default but the\n * acceptance criteria enumerate the 5 terminal/active ids explicitly, so the\n * guard derives the full set from the canonical defaults to stay in sync.\n */\nexport const BUILTIN_STATUS_IDS: ReadonlySet<string> = new Set(\n DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) => normalizeStatusToken(definition.id)).filter(\n (id) => id.length > 0,\n ),\n);\n\n/**\n * The shape persisted at `.agents/pm/schema/statuses.json`.\n */\nexport interface StatusDefsFile {\n statuses: RuntimeStatusDefinition[];\n}\n\nexport interface RawAddStatusInput {\n id: string | undefined;\n roles?: string[];\n aliases?: string[];\n description?: string;\n order?: number;\n}\n\nexport interface NormalizedAddStatusInput {\n id: string;\n /**\n * Normalized roles, or `undefined` when the raw input did not supply a roles\n * field at all. `undefined` means \"leave existing roles untouched\" on upsert;\n * an explicit empty array means \"clear roles\". This distinction is what keeps\n * `add-status review --description x` from wiping a previously-set role.\n */\n roles?: RuntimeStatusRole[];\n /** Same omitted-vs-explicit-empty semantics as `roles`. */\n aliases?: string[];\n description?: string;\n order?: number;\n}\n\nexport interface UpsertStatusDefResult {\n file: StatusDefsFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: RuntimeStatusDefinition;\n /** True when an existing definition with the same (normalized) id was replaced. */\n replaced: boolean;\n}\n\nexport interface RemoveStatusDefResult {\n file: StatusDefsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested id. */\n definition?: RuntimeStatusDefinition;\n}\n\n/**\n * Normalizes a status token using the same rules as runtime-schema.ts: lowercase\n * and collapse any run of whitespace/hyphens into a single underscore.\n */\nexport function normalizeStatusToken(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\nfunction dedupeTokens(values: Iterable<string>): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeStatusToken(value);\n if (token.length > 0) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-status CLI input. Throws a plain Error with a\n * stable message when the id is missing/empty or a role is not one of\n * RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.\n *\n * Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`\n * is `undefined` (flag not supplied) the normalized field is `undefined` so the\n * upsert leaves the existing value untouched; when supplied (even an empty array)\n * the field is normalized to an array so the upsert can apply an explicit clear.\n */\nexport function normalizeAddStatusInput(raw: RawAddStatusInput): NormalizedAddStatusInput {\n const id = normalizeStatusToken(raw.id);\n if (id.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n // Built-in lifecycle statuses are reserved and cannot be overridden: an\n // add-status override would change reserved metadata yet remove-status refuses\n // to delete a built-in id, leaving no CLI path to undo it. Reject up front,\n // symmetric with removeStatusDef.\n if (BUILTIN_STATUS_IDS.has(id)) {\n throw new Error(\n `Cannot add-status the built-in status \"${id}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n let roles: RuntimeStatusRole[] | undefined;\n if (raw.roles !== undefined) {\n roles = [];\n const seenRoles = new Set<string>();\n for (const rawRole of raw.roles) {\n const role = typeof rawRole === \"string\" ? rawRole.trim().toLowerCase() : \"\";\n if (role.length === 0) {\n continue;\n }\n if (!RUNTIME_STATUS_ROLE_SET.has(role)) {\n throw new Error(\n `Invalid status role \"${rawRole}\". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n );\n }\n if (!seenRoles.has(role)) {\n seenRoles.add(role);\n roles.push(role as RuntimeStatusRole);\n }\n }\n }\n const aliases =\n raw.aliases === undefined ? undefined : dedupeTokens(raw.aliases).filter((alias) => alias !== id);\n const description = raw.description?.trim();\n const order =\n typeof raw.order === \"number\" && Number.isFinite(raw.order) ? Math.trunc(raw.order) : undefined;\n return {\n id,\n roles,\n aliases,\n description: description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction selectStatusesArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractStatusDefinitions(parsed: unknown): RuntimeStatusDefinition[] {\n const candidate = selectStatusesArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeStatusDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.id !== \"string\" || record.id.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeStatusDefinition);\n }\n return definitions;\n}\n\n/**\n * Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile.\n * Accepts the canonical `{ statuses: [...] }` shape, a bare array of\n * definitions, or a `{ definitions: [...] }` form, and tolerates a\n * missing/invalid file by returning an empty statuses list.\n */\nexport function parseStatusDefsFile(raw: string | null | undefined): StatusDefsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { statuses: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/statuses.json contains invalid JSON.\");\n }\n return { statuses: extractStatusDefinitions(parsed) };\n}\n\n/**\n * Serializes the status definitions file with a trailing newline (matches the\n * rest of the schema scaffold files written by pm).\n */\nexport function serializeStatusDefsFile(file: StatusDefsFile): string {\n return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\\n`;\n}\n\n/**\n * Idempotent UPSERT of a status definition into the parsed file. Matching is by\n * normalized id. When a definition already exists, fields supplied in `input`\n * override the previous values (roles/aliases replace when a non-empty array is\n * given, clear when an explicit empty array is given, and are left UNTOUCHED\n * when the field is `undefined` — i.e. the add-status flag was omitted);\n * description/order override when provided. Fields not addressed by add-status\n * flags are preserved untouched, so `add-status <id> --description x` keeps any\n * previously-set roles/aliases.\n */\nexport function upsertStatusDef(\n file: StatusDefsFile,\n input: NormalizedAddStatusInput,\n baseDefinition?: RuntimeStatusDefinition,\n): UpsertStatusDefResult {\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === input.id,\n );\n // A file-backed definition is the primary seed; when the status is not yet in\n // statuses.json fall back to `baseDefinition` (the resolved settings-backed\n // definition) so omitting --role/--alias preserves metadata that lives in\n // settings.schema.statuses rather than the file.\n const existing = existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;\n\n const next: RuntimeStatusDefinition = {\n ...(existing ?? {}),\n id: input.id,\n };\n if (input.roles !== undefined) {\n if (input.roles.length > 0) {\n next.roles = [...input.roles];\n } else if (next.roles !== undefined) {\n delete next.roles;\n }\n }\n if (input.aliases !== undefined) {\n if (input.aliases.length > 0) {\n next.aliases = [...input.aliases];\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n }\n if (input.description !== undefined) {\n next.description = input.description;\n }\n if (input.order !== undefined) {\n next.order = input.order;\n }\n\n if (existingIndex >= 0) {\n statuses[existingIndex] = next;\n } else {\n statuses.push(next);\n }\n\n return {\n file: { statuses },\n definition: next,\n // \"replaced\" reflects whether the status already existed effectively (in the\n // file OR in resolved settings), so the CLI reports \"Updated\" vs \"Registered\"\n // correctly even when the prior definition lived only in settings.\n replaced: existing !== undefined,\n };\n}\n\n/**\n * Removes a status definition from the parsed file by id (normalized). Throws a\n * plain Error when `id` is empty or matches a reserved built-in default status\n * (those are never stored in the file and must never be deletable). Returns\n * `removed: false` when no matching definition exists so the CLI layer can treat\n * the call as an idempotent no-op.\n */\nexport function removeStatusDef(file: StatusDefsFile, id: string | undefined): RemoveStatusDefResult {\n const normalizedId = normalizeStatusToken(id);\n if (normalizedId.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n if (BUILTIN_STATUS_IDS.has(normalizedId)) {\n throw new Error(\n `Cannot remove built-in status \"${normalizedId}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === normalizedId,\n );\n if (existingIndex < 0) {\n return { file: { statuses }, removed: false };\n }\n const [definition] = statuses.splice(existingIndex, 1);\n return { file: { statuses }, removed: true, definition };\n}\n\n/**\n * Throws when the new status id or any explicitly-supplied alias collides with a\n * DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized\n * token to its owning status id (the runtime status registry's alias_to_id map,\n * which stores ids and aliases in one namespace). Re-adding the same status\n * (matching id) is allowed — only cross-status collisions throw. This prevents a\n * custom status from shadowing a built-in lifecycle token (for example\n * `add-status review --alias open`, or a custom id `cancelled` that aliases the\n * built-in `canceled`), which would make `pm update --status open` resolve to the\n * wrong status. The CLI layer maps the thrown Error to a USAGE exit code.\n */\nexport function assertStatusTokensAvailable(\n input: { id: string; aliases?: string[] },\n resolvedAliasToId: ReadonlyMap<string, string>,\n): void {\n const candidates = [input.id, ...(input.aliases ?? [])];\n for (const candidate of candidates) {\n const token = normalizeStatusToken(candidate);\n if (token.length === 0) {\n continue;\n }\n const owner = resolvedAliasToId.get(token);\n if (owner !== undefined && owner !== input.id) {\n throw new Error(\n `Status token \"${token}\" already belongs to status \"${owner}\". Choose a different id/alias to avoid shadowing it.`,\n );\n }\n }\n}\n","import {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-field` / `pm schema remove-field` commands\n * and the `list-fields` / `show-field` inspectors. The CLI command file\n * (schema.ts) owns IO/governance; everything testable and side-effect-free lives\n * here so it can be coverage-gated to 100%.\n *\n * Custom fields persist at `.agents/pm/schema/fields.json` under the shape\n * `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer\n * (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers\n * a CLI flag per field on create/update/list/search/context, so this module only\n * has to manage the persisted entries; it never duplicates the registration.\n */\n\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\n\n/**\n * Built-in front-matter field names a custom field key must never shadow. A\n * custom key that collides with one of these would let `pm create --<key>` write\n * over reserved metadata, so add-field rejects them up front (symmetric with the\n * built-in-type guard in item-types-file.ts).\n */\nexport const BUILTIN_FIELD_KEYS: ReadonlySet<string> = new Set([\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"assignee\",\n \"parent\",\n \"description\",\n \"body\",\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"author\",\n \"deadline\",\n \"estimate\",\n \"sprint\",\n \"release\",\n \"risk\",\n \"confidence\",\n \"reviewer\",\n \"resolution\",\n \"expected\",\n \"actual\",\n]);\n\n/**\n * The default commands a field is wired onto when `--commands` is omitted,\n * matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition).\n */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/**\n * The shape persisted at `.agents/pm/schema/fields.json`.\n */\nexport interface FieldsFile {\n fields: RuntimeFieldDefinition[];\n}\n\nexport interface RawAddFieldInput {\n key: string | undefined;\n type?: string;\n commands?: string[];\n description?: string;\n cliFlag?: string;\n aliases?: string[];\n required?: boolean;\n requiredOnCreate?: boolean;\n allowUnset?: boolean;\n requiredTypes?: string[];\n}\n\nexport interface NormalizedAddFieldInput {\n key: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n description?: string;\n cliFlag?: string;\n cliAliases: string[];\n required: boolean;\n requiredOnCreate: boolean;\n allowUnset: boolean;\n requiredTypes: string[];\n}\n\nexport interface UpsertFieldResult {\n file: FieldsFile;\n /** The definition as stored after the upsert. */\n definition: RuntimeFieldDefinition;\n /** True when an existing definition with the same (normalized) key was replaced. */\n replaced: boolean;\n}\n\nexport interface RemoveFieldResult {\n file: FieldsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested key. */\n definition?: RuntimeFieldDefinition;\n}\n\n/**\n * Normalizes a field key using the same rule as runtime-schema.ts: lowercase and\n * collapse any run of whitespace/hyphens into a single underscore.\n */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\n/**\n * Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse\n * whitespace/underscore runs to a single hyphen (matches normalizeCliToken in\n * runtime-schema.ts).\n */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value.trim().toLowerCase().replaceAll(/[\\s_]+/g, \"-\");\n return collapsed.startsWith(\"--\") ? collapsed.slice(2) : collapsed;\n}\n\nfunction keyToDefaultCliFlag(key: string): string {\n return key.replaceAll(\"_\", \"-\");\n}\n\nfunction dedupeCliTokens(values: Iterable<string>, exclude: string): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeCliToken(value);\n if (token.length > 0 && token !== exclude) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\nfunction dedupeStringList(values: string[] | undefined): string[] {\n const seen = new Set<string>();\n for (const value of values ?? []) {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n seen.add(trimmed);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-field CLI input. Throws a plain Error with a\n * stable message when the key is missing/empty, collides with a built-in field,\n * or carries an invalid type/command; the CLI layer maps these to PmCliError\n * exit codes. A `string_array` type implies a repeatable field downstream\n * (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is\n * exposed.\n */\nexport function normalizeAddFieldInput(raw: RawAddFieldInput): NormalizedAddFieldInput {\n const key = normalizeFieldKey(raw.key);\n if (key.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n if (BUILTIN_FIELD_KEYS.has(key)) {\n throw new Error(\n `Cannot define custom field \"${key}\": it shadows a built-in field. Built-in fields are reserved.`,\n );\n }\n\n const typeCandidate = typeof raw.type === \"string\" && raw.type.trim().length > 0 ? raw.type.trim().toLowerCase() : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(`Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`);\n }\n const type = typeCandidate as RuntimeFieldType;\n\n let commands: RuntimeFieldCommand[];\n if (raw.commands === undefined) {\n commands = [...DEFAULT_FIELD_COMMANDS];\n } else {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of raw.commands) {\n const command = rawCommand.trim().toLowerCase();\n if (command.length === 0) {\n continue;\n }\n if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {\n throw new Error(`Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`);\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n commands = normalized.length > 0 ? normalized : [...DEFAULT_FIELD_COMMANDS];\n }\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag = cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key) ? cliFlagToken : undefined;\n const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);\n const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);\n\n const description = raw.description?.trim();\n return {\n key,\n type,\n commands,\n description: description && description.length > 0 ? description : undefined,\n cliFlag,\n cliAliases,\n required: raw.required === true,\n requiredOnCreate: raw.requiredOnCreate === true,\n // allow_unset defaults to true (omitted) and is only persisted when an\n // operator explicitly disables it with --no-allow-unset (allowUnset === false).\n allowUnset: raw.allowUnset !== false,\n requiredTypes: dedupeStringList(raw.requiredTypes),\n };\n}\n\nfunction selectFieldsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractFieldDefinitions(parsed: unknown): RuntimeFieldDefinition[] {\n const candidate = selectFieldsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeFieldDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.key !== \"string\" || record.key.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeFieldDefinition);\n }\n return definitions;\n}\n\n/**\n * Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts\n * the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }`\n * form, and tolerates a missing/invalid file by returning an empty fields list.\n */\nexport function parseFieldsFile(raw: string | null | undefined): FieldsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { fields: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/fields.json contains invalid JSON.\");\n }\n return { fields: extractFieldDefinitions(parsed) };\n}\n\n/**\n * Serializes the fields file with a trailing newline (matches the rest of the\n * schema scaffold files written by pm).\n */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/**\n * Idempotent UPSERT of a custom field into the parsed file. Matching is by\n * normalized key. When a definition already exists, the supplied input fully\n * replaces its add-field-managed attributes (type/commands/description/flags/\n * required flags) while preserving any unrelated keys the file may carry; any\n * `metadata_key` already stored is preserved so existing item data keeps mapping\n * to the same front-matter column.\n */\nexport function upsertField(file: FieldsFile, input: NormalizedAddFieldInput): UpsertFieldResult {\n // Match by normalized key. A hand-authored file may carry more than one entry\n // for the same key, so drop ALL matches and re-insert a single merged result\n // (collapsing duplicates) rather than only rewriting the first occurrence. The\n // first existing match seeds preserved attributes (e.g. metadata_key).\n const existing = file.fields.find((definition) => normalizeFieldKey(definition.key) === input.key);\n const replaced = existing !== undefined;\n const fields = file.fields.filter((definition) => normalizeFieldKey(definition.key) !== input.key);\n\n const next: RuntimeFieldDefinition = {\n ...(existing ?? {}),\n key: input.key,\n type: input.type,\n commands: [...input.commands],\n };\n applyOptionalString(next, \"description\", input.description);\n applyOptionalString(next, \"cli_flag\", input.cliFlag);\n if (input.cliAliases.length > 0) {\n next.cli_aliases = [...input.cliAliases];\n } else {\n delete next.cli_aliases;\n }\n applyBooleanFlag(next, \"required\", input.required);\n applyBooleanFlag(next, \"required_on_create\", input.requiredOnCreate);\n // allow_unset defaults true; only persist the explicit false override.\n if (input.allowUnset === false) {\n next.allow_unset = false;\n } else {\n delete next.allow_unset;\n }\n if (input.requiredTypes.length > 0) {\n next.required_types = [...input.requiredTypes];\n } else {\n delete next.required_types;\n }\n\n fields.push(next);\n fields.sort((left, right) => normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)));\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/**\n * Removes a custom field definition from the parsed file by key (normalized).\n * Throws a plain Error when `key` is empty. Returns `removed: false` when no\n * matching definition exists so the CLI layer can treat the call as an\n * idempotent no-op.\n */\nexport function removeField(file: FieldsFile, key: string | undefined): RemoveFieldResult {\n const normalizedKey = normalizeFieldKey(key);\n if (normalizedKey.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n // Remove ALL matches (a hand-authored file may carry duplicate entries for the\n // same normalized key) so no stale duplicate survives the removal.\n const removed: RuntimeFieldDefinition[] = [];\n const fields = file.fields.filter((definition) => {\n if (normalizeFieldKey(definition.key) === normalizedKey) {\n removed.push(definition);\n return false;\n }\n return true;\n });\n if (removed.length === 0) {\n return { file: { fields }, removed: false };\n }\n return { file: { fields }, removed: true, definition: removed[0] };\n}\n\nfunction applyOptionalString(definition: RuntimeFieldDefinition, key: string, value: string | undefined): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined && value.length > 0) {\n record[key] = value;\n } else {\n delete record[key];\n }\n}\n\nfunction applyBooleanFlag(definition: RuntimeFieldDefinition, key: string, value: boolean): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value) {\n record[key] = true;\n } else {\n delete record[key];\n }\n}\n","import { matchBuiltinTypeName } from \"./item-types-file.js\";\n\n/**\n * Pure logic for `pm schema add-type --infer`: scan existing item titles for\n * stable `PREFIX-`/`PREFIX:` conventions and propose them as custom item types.\n * The CLI command file (schema.ts) owns IO and the optional registration; this\n * module only derives candidates from a list of titles so it is fully testable\n * and coverage-gated to 100%.\n *\n * Conventions recognized (case-insensitive, first run wins per title):\n * - `INFRA- ...` / `SECURITY-...` (hyphen-delimited prefix)\n * - `BUG: ...` / `SPIKE: ...` (colon-delimited prefix)\n * The prefix token must be a letter-led identifier of letters, digits, and\n * internal hyphens/underscores so it maps cleanly to a single PascalCase type\n * name. Purely numeric or sequence-style prefixes (e.g. `S001-`, `E12-`) are\n * intentionally skipped: they index items, they are not type boundaries.\n */\n\nconst PREFIX_PATTERN = /^([A-Za-z][A-Za-z0-9_-]*?)\\s*[-:]\\s+\\S/;\n\nexport interface InferredTypeCandidate {\n /** Suggested PascalCase type name derived from the prefix. */\n name: string;\n /** The normalized prefix token (lowercase) the items share. */\n prefix: string;\n /** How many scanned titles carry this prefix. */\n count: number;\n /** A few example titles (capped) for human/agent review. */\n examples: string[];\n /** True when `name` already resolves to a reserved built-in type. */\n shadows_builtin: boolean;\n}\n\nexport interface InferTypesOptions {\n /** Minimum number of titles that must share a prefix to surface it (default 10). */\n minCount?: number;\n /** Maximum example titles retained per candidate (default 3). */\n maxExamples?: number;\n}\n\n/**\n * Extracts the leading prefix token from a title, or undefined when the title has\n * no stable letter-led `PREFIX-`/`PREFIX:` convention.\n */\nexport function extractTitlePrefix(title: string): string | undefined {\n const match = PREFIX_PATTERN.exec(title.trim());\n if (!match) {\n return undefined;\n }\n const token = match[1];\n // Reject single-character prefixes (e.g. \"S-\", \"E-\"): they are sequence/index\n // markers far more often than genuine type boundaries.\n if (token.length < 2) {\n return undefined;\n }\n // Reject sequence/index-style prefixes — a single leading letter followed by\n // only digits (e.g. \"S001-\", \"E12-\", \"V1-\"). These index items rather than\n // mark a type boundary, matching the convention documented above.\n if (/^[A-Za-z]\\d+$/.test(token)) {\n return undefined;\n }\n return token.toLowerCase();\n}\n\n/**\n * Converts a normalized prefix token into a PascalCase type name. Internal\n * hyphen/underscore runs become word boundaries; each word is capitalized.\n */\nexport function prefixToTypeName(prefix: string): string {\n return prefix\n .split(/[-_]+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1).toLowerCase()}`)\n .join(\"\");\n}\n\n/**\n * Scans titles for shared prefix conventions and returns candidate custom types,\n * sorted by descending frequency then name. Only prefixes carried by at least\n * `minCount` titles are returned.\n */\nexport function inferTypesFromTitles(titles: string[], options: InferTypesOptions = {}): InferredTypeCandidate[] {\n const minCount = typeof options.minCount === \"number\" && options.minCount > 0 ? Math.trunc(options.minCount) : 10;\n const maxExamples = typeof options.maxExamples === \"number\" && options.maxExamples > 0 ? Math.trunc(options.maxExamples) : 3;\n const byPrefix = new Map<string, { count: number; examples: string[] }>();\n for (const rawTitle of titles) {\n const title = typeof rawTitle === \"string\" ? rawTitle.trim() : \"\";\n if (title.length === 0) {\n continue;\n }\n const prefix = extractTitlePrefix(title);\n if (prefix === undefined) {\n continue;\n }\n const bucket = byPrefix.get(prefix) ?? { count: 0, examples: [] };\n bucket.count += 1;\n if (bucket.examples.length < maxExamples) {\n bucket.examples.push(title);\n }\n byPrefix.set(prefix, bucket);\n }\n const candidates: InferredTypeCandidate[] = [];\n for (const [prefix, bucket] of byPrefix.entries()) {\n if (bucket.count < minCount) {\n continue;\n }\n const name = prefixToTypeName(prefix);\n candidates.push({\n name,\n prefix,\n count: bucket.count,\n examples: bucket.examples,\n shadows_builtin: matchBuiltinTypeName(name) !== undefined,\n });\n }\n candidates.sort((left, right) => (right.count - left.count) || left.name.localeCompare(right.name));\n return candidates;\n}\n","import { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n assertAliasesAvailable,\n assertTypeFolderAvailable,\n buildInvalidTypeHint,\n escapeForDoubleQuotes,\n normalizeAddTypeInput,\n parseItemTypesFile,\n removeItemType,\n serializeItemTypesFile,\n upsertItemType,\n type ItemTypeDefinition,\n} from \"../../core/schema/item-types-file.js\";\nimport {\n assertStatusTokensAvailable,\n BUILTIN_STATUS_IDS,\n normalizeAddStatusInput,\n normalizeStatusToken,\n parseStatusDefsFile,\n removeStatusDef,\n serializeStatusDefsFile,\n upsertStatusDef,\n type RuntimeStatusDefinition,\n} from \"../../core/schema/status-defs-file.js\";\nimport {\n BUILTIN_FIELD_KEYS,\n normalizeAddFieldInput,\n normalizeFieldKey,\n parseFieldsFile,\n removeField,\n serializeFieldsFile,\n upsertField,\n type RuntimeFieldDefinition,\n} from \"../../core/schema/fields-file.js\";\nimport {\n normalizeTypePresetName,\n resolveTypePresetDefinitions,\n TYPE_PRESET_NAMES,\n type TypePresetName,\n} from \"../../core/schema/type-presets.js\";\nimport { inferTypesFromTitles, type InferredTypeCandidate } from \"../../core/schema/type-inference.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { resolveItemTypeRegistry, type ResolvedItemTypeDefinition } from \"../../core/item/type-registry.js\";\nimport { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport type { PmSettings } from \"../../types/index.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, resolveGovernanceKnobs } from \"../../core/store/settings.js\";\n\nexport const SCHEMA_SUBCOMMANDS = [\n \"add-type\",\n \"remove-type\",\n \"add-status\",\n \"remove-status\",\n \"add-field\",\n \"remove-field\",\n \"list-fields\",\n \"show-field\",\n \"apply-preset\",\n \"list\",\n \"show\",\n \"show-status\",\n] as const;\nexport type SchemaSubcommand = (typeof SCHEMA_SUBCOMMANDS)[number];\n\nconst SCHEMA_TYPES_LOCK_ID = \"schema-types\";\nconst SCHEMA_STATUSES_LOCK_ID = \"schema-statuses\";\nconst SCHEMA_FIELDS_LOCK_ID = \"schema-fields\";\n\nexport interface SchemaAddTypeCommandOptions {\n description?: string;\n defaultStatus?: string;\n folder?: string;\n alias?: string[];\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaRemoveTypeCommandOptions {\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaAddStatusCommandOptions {\n role?: string[];\n alias?: string[];\n description?: string;\n order?: number;\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaRemoveStatusCommandOptions {\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaAddTypeResult {\n action: \"add-type\";\n registered: boolean;\n replaced: boolean;\n type: ItemTypeDefinition;\n file: {\n path: string;\n definitions: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaRemoveTypeResult {\n action: \"remove-type\";\n removed: boolean;\n type?: ItemTypeDefinition;\n file: {\n path: string;\n definitions: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaAddStatusResult {\n action: \"add-status\";\n registered: boolean;\n replaced: boolean;\n status: RuntimeStatusDefinition;\n file: {\n path: string;\n statuses: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaRemoveStatusResult {\n action: \"remove-status\";\n removed: boolean;\n status?: RuntimeStatusDefinition;\n file: {\n path: string;\n statuses: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaAddFieldCommandOptions {\n type?: string;\n commands?: string[];\n description?: string;\n cliFlag?: string;\n alias?: string[];\n required?: boolean;\n requiredOnCreate?: boolean;\n allowUnset?: boolean;\n requiredTypes?: string[];\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaRemoveFieldCommandOptions {\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaApplyPresetCommandOptions {\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaAddTypeInferCommandOptions {\n minCount?: number;\n apply?: boolean;\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaFieldSummary {\n key: string;\n type: string;\n commands: string[];\n cli_flag: string;\n cli_aliases: string[];\n description?: string;\n required: boolean;\n required_on_create: boolean;\n allow_unset: boolean;\n required_types: string[];\n}\n\nexport interface SchemaAddFieldResult {\n action: \"add-field\";\n registered: boolean;\n replaced: boolean;\n field: RuntimeFieldDefinition;\n file: {\n path: string;\n fields: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaRemoveFieldResult {\n action: \"remove-field\";\n removed: boolean;\n field?: RuntimeFieldDefinition;\n file: {\n path: string;\n fields: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaListFieldsResult {\n action: \"list-fields\";\n fields: SchemaFieldSummary[];\n counts: {\n total: number;\n };\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport interface SchemaShowFieldResult {\n action: \"show-field\";\n field: SchemaFieldSummary;\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport interface SchemaApplyPresetResult {\n action: \"apply-preset\";\n preset: TypePresetName;\n registered: string[];\n replaced: string[];\n file: {\n path: string;\n definitions: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaAddTypeInferResult {\n action: \"infer-types\";\n applied: boolean;\n min_count: number;\n candidates: InferredTypeCandidate[];\n registered: string[];\n replaced: string[];\n skipped: Array<{ name: string; reason: string }>;\n file: {\n path: string;\n definitions: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaTypeSummary {\n name: string;\n folder: string;\n aliases: string[];\n default_status?: string;\n description?: string;\n}\n\nexport interface SchemaStatusSummary {\n id: string;\n source: \"builtin\" | \"custom\";\n roles: string[];\n aliases: string[];\n description?: string;\n order?: number;\n}\n\nexport interface SchemaTypeDefinitionResult extends SchemaTypeSummary {\n source: \"builtin\" | \"custom\" | \"extension\";\n extension?: {\n layer: string;\n name: string;\n };\n required_create_fields: string[];\n required_create_repeatables: string[];\n options: ResolvedItemTypeDefinition[\"options\"];\n command_option_policies: ResolvedItemTypeDefinition[\"command_option_policies\"];\n}\n\nexport interface SchemaListResult {\n action: \"list\";\n builtin: SchemaTypeSummary[];\n custom: SchemaTypeSummary[];\n extension: SchemaTypeSummary[];\n counts: {\n builtin: number;\n custom: number;\n extension: number;\n total: number;\n };\n statuses: {\n builtin: SchemaStatusSummary[];\n custom: SchemaStatusSummary[];\n counts: {\n builtin: number;\n custom: number;\n total: number;\n };\n };\n fields: {\n custom: SchemaFieldSummary[];\n counts: {\n total: number;\n };\n };\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport interface SchemaShowResult {\n action: \"show\";\n type: SchemaTypeDefinitionResult;\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport interface SchemaShowStatusResult {\n action: \"show-status\";\n status: SchemaStatusSummary;\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport type SchemaInspectResult =\n | SchemaListResult\n | SchemaShowResult\n | SchemaShowStatusResult\n | SchemaListFieldsResult\n | SchemaShowFieldResult;\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\n/* c8 ignore start -- schema command mutation/inspection branches are covered by broader schema integration workflows. */\nexport async function runSchemaAddType(\n name: string | undefined,\n options: SchemaAddTypeCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaAddTypeResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n let normalized;\n try {\n normalized = normalizeAddTypeInput({\n name,\n description: options.description,\n defaultStatus: options.defaultStatus,\n folder: options.folder,\n aliases: options.alias,\n });\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_TYPES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let upsert;\n try {\n const previousRaw = await readFileIfExists(typesPath);\n let parsed;\n try {\n parsed = parseItemTypesFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n try {\n assertAliasesAvailable(normalized, parsed);\n // GH-248: reject distinct type names that would slug to the same storage\n // folder (e.g. \"Spike\"/\"Spikes\") so item files never silently share a\n // directory. Same-named upserts (recase/idempotent re-runs) are exempt.\n // reservedFolders covers built-in + extension + settings-resolved custom\n // folders so a slug like \"Tasks\" can't collide with the built-in Task.\n const reservedFolders = new Map<string, string>();\n const resolvedRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n for (const [typeName, folder] of Object.entries(resolvedRegistry.type_to_folder)) {\n const folderKey = folder.trim().toLowerCase();\n if (folderKey.length > 0 && !reservedFolders.has(folderKey)) {\n reservedFolders.set(folderKey, typeName);\n }\n }\n assertTypeFolderAvailable(normalized, parsed, reservedFolders);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n upsert = upsertItemType(parsed, normalized);\n // GH-248: an upsert that only differs in case from the existing canonical\n // name silently renames the stored type (e.g. registering \"spike\" over\n // \"Spike\"). Surface it as a non-blocking warning so the operator knows the\n // existing definition was replaced rather than a new type created.\n if (upsert.replaced && upsert.previousName !== undefined && upsert.previousName !== upsert.definition.name) {\n warnings.push(`type_recased:${upsert.previousName}->${upsert.definition.name}`);\n }\n // writeFileAtomic writes to a temp file then renames, so a failure leaves the\n // existing types.json untouched; no manual rollback is needed.\n await writeFileAtomic(typesPath, serializeItemTypesFile(upsert.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"schema:add-type\",\n })),\n );\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"add-type\",\n registered: true,\n replaced: upsert.replaced,\n type: upsert.definition,\n file: {\n path: typesPath,\n definitions: upsert.file.definitions.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nasync function ensureInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\n/**\n * Counts items whose resolved type matches `typeName` (case-insensitive). Uses\n * the lightest existing read path (listAllFrontMatterLight skips the heavy\n * collections cache). All items are counted — not just open ones — so the\n * advisory warning surfaces every item the removed definition would orphan;\n * the count is non-blocking. The caller passes its already-loaded `settings`\n * so we never re-read settings.json from disk here.\n */\nasync function countItemsUsingType(\n pmRoot: string,\n settings: PmSettings,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n typeName: string,\n): Promise<number> {\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const lowerName = typeName.trim().toLowerCase();\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);\n return items.filter((item) => typeof item.type === \"string\" && item.type.toLowerCase() === lowerName).length;\n}\n\n/**\n * Counts items currently set to the status whose id/aliases resolve to\n * `statusId`. Uses listAllFrontMatterLight (the lightest read path). All items\n * are counted regardless of lifecycle phase; the count is advisory only. The\n * caller passes its already-loaded `settings` so we never re-read from disk.\n */\nasync function countItemsUsingStatus(\n pmRoot: string,\n settings: PmSettings,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n statusId: string,\n): Promise<number> {\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const statusRegistry = resolveRuntimeStatusRegistry(schema);\n const normalizedId = normalizeStatusToken(statusId);\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);\n return items.filter((item) => {\n const itemStatus = typeof item.status === \"string\" ? item.status : \"\";\n const resolved = statusRegistry.alias_to_id.get(normalizeStatusToken(itemStatus)) ?? normalizeStatusToken(itemStatus);\n return resolved === normalizedId;\n }).length;\n}\n\n/**\n * Returns the workflow role-slot names (open_status, close_status, ...) that\n * currently point at `statusId` (normalized). Used to warn before removing a\n * status that a workflow default still references.\n */\nfunction workflowSlotsReferencing(\n workflow: {\n draft_status?: string;\n open_status?: string;\n in_progress_status?: string;\n blocked_status?: string;\n close_status?: string;\n canceled_status?: string;\n },\n statusId: string,\n): string[] {\n const slots: Array<[string, string | undefined]> = [\n [\"draft_status\", workflow.draft_status],\n [\"open_status\", workflow.open_status],\n [\"in_progress_status\", workflow.in_progress_status],\n [\"blocked_status\", workflow.blocked_status],\n [\"close_status\", workflow.close_status],\n [\"canceled_status\", workflow.canceled_status],\n ];\n return slots\n .filter(([, value]) => value !== undefined && normalizeStatusToken(value) === statusId)\n .map(([slot]) => slot);\n}\n\nexport async function runSchemaRemoveType(\n name: string | undefined,\n options: SchemaRemoveTypeCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaRemoveTypeResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_TYPES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let removal;\n try {\n const previousRaw = await readFileIfExists(typesPath);\n let parsed;\n try {\n parsed = parseItemTypesFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n try {\n removal = removeItemType(parsed, name);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n if (removal.removed) {\n // Only emit the advisory orphan-count warning once a removable custom\n // definition was actually removed; a no-op/unknown removal would otherwise\n // surface a misleading items_using_type:* warning. The count is\n // non-blocking and reuses the already-loaded settings (no disk re-read).\n const removedName = (removal.definition?.name ?? name ?? \"\").trim();\n if (removedName.length > 0) {\n const usingType = await countItemsUsingType(pmRoot, settings, schema, removedName);\n if (usingType > 0) {\n warnings.push(`items_using_type:${usingType}`);\n }\n }\n // writeFileAtomic writes to a temp file then renames, so a failure leaves\n // the existing types.json untouched; no manual rollback is needed.\n await writeFileAtomic(typesPath, serializeItemTypesFile(removal.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"schema:remove-type\",\n })),\n );\n }\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"remove-type\",\n removed: removal.removed,\n ...(removal.definition ? { type: removal.definition } : {}),\n file: {\n path: typesPath,\n definitions: removal.file.definitions.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nfunction statusesPathFor(pmRoot: string, schema: ReturnType<typeof normalizeRuntimeSchemaSettings>): string {\n return filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);\n}\n\nfunction fieldsPathFor(pmRoot: string, schema: ReturnType<typeof normalizeRuntimeSchemaSettings>): string {\n return filePathForSchemaSection(pmRoot, schema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);\n}\n\nfunction typesPathFor(pmRoot: string, schema: ReturnType<typeof normalizeRuntimeSchemaSettings>): string {\n return filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n}\n\nfunction toSchemaFieldSummary(field: ReturnType<typeof resolveRuntimeFieldRegistry>[\"definitions\"][number]): SchemaFieldSummary {\n return {\n key: field.key,\n type: field.type,\n commands: [...field.commands],\n cli_flag: `--${field.cli_flag}`,\n cli_aliases: field.cli_aliases.map((alias) => `--${alias}`),\n ...(field.description ? { description: field.description } : {}),\n required: field.required,\n required_on_create: field.required_on_create,\n allow_unset: field.allow_unset,\n required_types: [...field.required_types],\n };\n}\n\nexport async function runSchemaAddStatus(\n id: string | undefined,\n options: SchemaAddStatusCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaAddStatusResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n let normalized;\n try {\n normalized = normalizeAddStatusInput({\n id,\n roles: options.role,\n aliases: options.alias,\n description: options.description,\n order: options.order,\n });\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const statusesPath = statusesPathFor(pmRoot, schema);\n const statusRegistry = resolveRuntimeStatusRegistry(schema);\n\n // Reject id/alias collisions with a DIFFERENT existing status so a custom\n // status can never shadow a built-in lifecycle token (e.g. --alias open).\n try {\n assertStatusTokensAvailable(normalized, statusRegistry.alias_to_id);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n // Seed the upsert from the resolved (settings-or-file) definition so omitting\n // --role/--alias preserves metadata defined in settings.schema.statuses, not\n // only what is already in statuses.json.\n const resolvedExisting = statusRegistry.by_id.get(normalized.id);\n const baseDefinition: RuntimeStatusDefinition | undefined = resolvedExisting\n ? {\n id: resolvedExisting.id,\n ...(Array.isArray(resolvedExisting.roles) && resolvedExisting.roles.length > 0\n ? { roles: [...resolvedExisting.roles] }\n : {}),\n ...(Array.isArray(resolvedExisting.aliases) && resolvedExisting.aliases.length > 0\n ? { aliases: [...resolvedExisting.aliases] }\n : {}),\n ...(resolvedExisting.description ? { description: resolvedExisting.description } : {}),\n ...(typeof resolvedExisting.order === \"number\" ? { order: resolvedExisting.order } : {}),\n }\n : undefined;\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_STATUSES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let upsert;\n try {\n const previousRaw = await readFileIfExists(statusesPath);\n let parsed;\n try {\n parsed = parseStatusDefsFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n // Re-check collisions against the CURRENT file under the lock: the pre-lock\n // check used the registry loaded before acquiring schema-statuses, so a\n // concurrent add-status could have written a colliding id/alias in between.\n // The lock serializes writes; this serializes the collision decision too.\n const fileAliasToId = new Map<string, string>();\n for (const definition of parsed.statuses) {\n const defId = normalizeStatusToken(definition.id);\n if (defId.length === 0) {\n continue;\n }\n fileAliasToId.set(defId, defId);\n for (const alias of Array.isArray(definition.aliases) ? definition.aliases : []) {\n const aliasToken = normalizeStatusToken(alias);\n if (aliasToken.length > 0 && !fileAliasToId.has(aliasToken)) {\n fileAliasToId.set(aliasToken, defId);\n }\n }\n }\n try {\n assertStatusTokensAvailable(normalized, fileAliasToId);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n upsert = upsertStatusDef(parsed, normalized, baseDefinition);\n // writeFileAtomic writes to a temp file then renames, so a failure leaves\n // the existing statuses.json untouched; no manual rollback is needed.\n await writeFileAtomic(statusesPath, serializeStatusDefsFile(upsert.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: statusesPath,\n scope: \"project\",\n op: \"schema:add-status\",\n })),\n );\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"add-status\",\n registered: true,\n replaced: upsert.replaced,\n status: upsert.definition,\n file: {\n path: statusesPath,\n statuses: upsert.file.statuses.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaRemoveStatus(\n id: string | undefined,\n options: SchemaRemoveStatusCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaRemoveStatusResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const statusesPath = statusesPathFor(pmRoot, schema);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_STATUSES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let removal;\n try {\n const previousRaw = await readFileIfExists(statusesPath);\n let parsed;\n try {\n parsed = parseStatusDefsFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n try {\n removal = removeStatusDef(parsed, id);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n if (removal.removed) {\n // Only emit the advisory orphan-count warning once a removable custom\n // status was actually removed; a no-op/unknown removal would otherwise\n // surface a misleading items_using_status:* warning. The count reuses the\n // already-loaded settings (no disk re-read) and is non-blocking.\n const removedId = normalizeStatusToken(removal.definition?.id ?? id);\n if (removedId.length > 0 && !BUILTIN_STATUS_IDS.has(removedId)) {\n const usingStatus = await countItemsUsingStatus(pmRoot, settings, schema, removedId);\n if (usingStatus > 0) {\n warnings.push(`items_using_status:${usingStatus}`);\n }\n // Removing a status that a workflow default still points at would leave\n // pm close / default pm create resolving to an unregistered status. Warn\n // (non-blocking, consistent with remove-type) so the operator re-points\n // the workflow slot via schema/workflows.json or pm config.\n const referencingSlots = workflowSlotsReferencing(schema.workflow, removedId);\n if (referencingSlots.length > 0) {\n warnings.push(`status_referenced_by_workflow:${referencingSlots.join(\",\")}`);\n }\n }\n await writeFileAtomic(statusesPath, serializeStatusDefsFile(removal.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: statusesPath,\n scope: \"project\",\n op: \"schema:remove-status\",\n })),\n );\n }\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"remove-status\",\n removed: removal.removed,\n ...(removal.definition ? { status: removal.definition } : {}),\n file: {\n path: statusesPath,\n statuses: removal.file.statuses.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nfunction toSchemaTypeSummary(definition: ResolvedItemTypeDefinition): SchemaTypeSummary {\n return {\n name: definition.name,\n folder: definition.folder,\n aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],\n ...(definition.default_status ? { default_status: definition.default_status } : {}),\n ...(definition.description ? { description: definition.description } : {}),\n };\n}\n\nfunction toSchemaTypeDefinition(\n definition: ResolvedItemTypeDefinition,\n source: SchemaTypeDefinitionResult[\"source\"],\n extensionProvenance?: SchemaTypeDefinitionResult[\"extension\"],\n): SchemaTypeDefinitionResult {\n return {\n ...toSchemaTypeSummary(definition),\n source,\n ...(extensionProvenance ? { extension: extensionProvenance } : {}),\n required_create_fields: [...definition.required_create_fields],\n required_create_repeatables: [...definition.required_create_repeatables],\n options: structuredClone(definition.options),\n command_option_policies: structuredClone(definition.command_option_policies),\n };\n}\n\nfunction toSchemaStatusSummary(definition: RuntimeStatusDefinition): SchemaStatusSummary {\n return {\n id: definition.id,\n source: BUILTIN_STATUS_IDS.has(definition.id) ? \"builtin\" : \"custom\",\n roles: Array.isArray(definition.roles) ? [...definition.roles] : [],\n aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],\n ...(definition.description ? { description: definition.description } : {}),\n ...(typeof definition.order === \"number\" ? { order: definition.order } : {}),\n };\n}\n\nfunction classifyTypeSource(\n name: string,\n customNames: Set<string>,\n extensionNames: Set<string>,\n): SchemaTypeDefinitionResult[\"source\"] {\n const lowerName = name.toLowerCase();\n if (extensionNames.has(lowerName)) {\n return \"extension\";\n }\n if (customNames.has(lowerName)) {\n return \"custom\";\n }\n return \"builtin\";\n}\n\nfunction collectExtensionTypeProvenance(): Map<string, SchemaTypeDefinitionResult[\"extension\"]> {\n const provenance = new Map<string, SchemaTypeDefinitionResult[\"extension\"]>();\n const registrations = getActiveExtensionRegistrations();\n for (const registration of registrations?.item_types ?? []) {\n const rawTypes = (registration as { types?: unknown[] }).types;\n if (!Array.isArray(rawTypes)) {\n continue;\n }\n for (const rawType of rawTypes) {\n if (typeof rawType !== \"object\" || rawType === null || Array.isArray(rawType)) {\n continue;\n }\n const name = (rawType as { name?: unknown }).name;\n if (typeof name === \"string\" && name.trim().length > 0) {\n provenance.set(name.trim().toLowerCase(), {\n layer: registration.layer,\n name: registration.name,\n });\n }\n }\n }\n return provenance;\n}\n\nfunction buildSchemaStatusSummaries(\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n): { builtin: SchemaStatusSummary[]; custom: SchemaStatusSummary[] } {\n const registry = resolveRuntimeStatusRegistry(schema);\n const builtin: SchemaStatusSummary[] = [];\n const custom: SchemaStatusSummary[] = [];\n for (const definition of registry.definitions) {\n const summary = toSchemaStatusSummary(definition);\n if (summary.source === \"builtin\") {\n builtin.push(summary);\n } else {\n custom.push(summary);\n }\n }\n return { builtin, custom };\n}\n\nasync function loadSchemaInspectionContext(global: GlobalOptions): Promise<{\n pmRoot: string;\n typesPath: string;\n statusesPath: string;\n byType: Record<string, ResolvedItemTypeDefinition>;\n customNames: Set<string>;\n extensionProvenance: Map<string, SchemaTypeDefinitionResult[\"extension\"]>;\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const statusesPath = statusesPathFor(pmRoot, schema);\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const extensionProvenance = collectExtensionTypeProvenance();\n const customNames = new Set(\n (settings.item_types?.definitions ?? [])\n .map((definition) => definition.name.trim().toLowerCase())\n .filter((name) => name.length > 0 && !extensionProvenance.has(name)),\n );\n return {\n pmRoot,\n typesPath,\n statusesPath,\n byType: registry.by_type,\n customNames,\n extensionProvenance,\n schema,\n };\n}\n\nexport async function runSchemaList(global: GlobalOptions): Promise<SchemaListResult> {\n const context = await loadSchemaInspectionContext(global);\n const builtin: SchemaTypeSummary[] = [];\n const custom: SchemaTypeSummary[] = [];\n const extension: SchemaTypeSummary[] = [];\n for (const definition of Object.values(context.byType).sort((left, right) => left.name.localeCompare(right.name))) {\n const source = classifyTypeSource(definition.name, context.customNames, new Set(context.extensionProvenance.keys()));\n const summary = toSchemaTypeSummary(definition);\n if (source === \"extension\") {\n extension.push(summary);\n } else if (source === \"custom\") {\n custom.push(summary);\n } else {\n builtin.push(summary);\n }\n }\n const statusSummaries = buildSchemaStatusSummaries(context.schema);\n const fieldSummaries = resolveRuntimeFieldRegistry(context.schema).definitions.map(toSchemaFieldSummary);\n return {\n action: \"list\",\n builtin,\n custom,\n extension,\n counts: {\n builtin: builtin.length,\n custom: custom.length,\n extension: extension.length,\n total: builtin.length + custom.length + extension.length,\n },\n statuses: {\n builtin: statusSummaries.builtin,\n custom: statusSummaries.custom,\n counts: {\n builtin: statusSummaries.builtin.length,\n custom: statusSummaries.custom.length,\n total: statusSummaries.builtin.length + statusSummaries.custom.length,\n },\n },\n fields: {\n custom: fieldSummaries,\n counts: {\n total: fieldSummaries.length,\n },\n },\n file: {\n path: context.typesPath,\n },\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaShow(name: string | undefined, global: GlobalOptions): Promise<SchemaShowResult> {\n const typeName = (name ?? \"\").trim();\n if (typeName.length === 0) {\n throw new PmCliError(\"Type name must not be empty.\", EXIT_CODE.USAGE);\n }\n const context = await loadSchemaInspectionContext(global);\n const match = Object.values(context.byType).find(\n (definition) =>\n definition.name.toLowerCase() === typeName.toLowerCase() ||\n definition.aliases.some((alias) => alias.toLowerCase() === typeName.toLowerCase()),\n );\n if (!match) {\n throw new PmCliError(\n `Unknown item type \"${typeName}\". Run pm schema list to inspect registered types, or pm schema add-type \"${escapeForDoubleQuotes(typeName)}\" to register it.`,\n EXIT_CODE.NOT_FOUND,\n { code: \"unknown_item_type\" },\n );\n }\n return {\n action: \"show\",\n type: toSchemaTypeDefinition(\n match,\n classifyTypeSource(match.name, context.customNames, new Set(context.extensionProvenance.keys())),\n context.extensionProvenance.get(match.name.toLowerCase()),\n ),\n file: {\n path: context.typesPath,\n },\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaShowStatus(\n id: string | undefined,\n global: GlobalOptions,\n): Promise<SchemaShowStatusResult> {\n const statusToken = normalizeStatusToken(id);\n if (statusToken.length === 0) {\n throw new PmCliError(\"Status id must not be empty.\", EXIT_CODE.USAGE);\n }\n const context = await loadSchemaInspectionContext(global);\n const statusRegistry = resolveRuntimeStatusRegistry(context.schema);\n const resolvedId = statusRegistry.alias_to_id.get(statusToken) ?? statusToken;\n const match = statusRegistry.by_id.get(resolvedId);\n if (!match) {\n throw new PmCliError(\n `Unknown status \"${id}\". Run pm schema list to inspect registered statuses, or pm schema add-status \"${escapeForDoubleQuotes(\n id ?? \"\",\n )}\" to register it.`,\n EXIT_CODE.NOT_FOUND,\n { code: \"unknown_status\" },\n );\n }\n return {\n action: \"show-status\",\n status: toSchemaStatusSummary(match),\n file: {\n path: context.statusesPath,\n },\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaAddField(\n key: string | undefined,\n options: SchemaAddFieldCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaAddFieldResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n let normalized;\n try {\n normalized = normalizeAddFieldInput({\n key,\n type: options.type,\n commands: options.commands,\n description: options.description,\n cliFlag: options.cliFlag,\n aliases: options.alias,\n required: options.required,\n requiredOnCreate: options.requiredOnCreate,\n allowUnset: options.allowUnset,\n requiredTypes: options.requiredTypes,\n });\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const fieldsPath = fieldsPathFor(pmRoot, schema);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_FIELDS_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let upsert;\n try {\n const previousRaw = await readFileIfExists(fieldsPath);\n let parsed;\n try {\n parsed = parseFieldsFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n upsert = upsertField(parsed, normalized);\n await writeFileAtomic(fieldsPath, serializeFieldsFile(upsert.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: fieldsPath,\n scope: \"project\",\n op: \"schema:add-field\",\n })),\n );\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"add-field\",\n registered: true,\n replaced: upsert.replaced,\n field: upsert.definition,\n file: {\n path: fieldsPath,\n fields: upsert.file.fields.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\n/**\n * Counts items carrying a non-empty value for the custom field's metadata key.\n * Advisory only (non-blocking) so remove-field can surface how many items would\n * lose a managed column. Reuses the already-loaded settings (no disk re-read).\n */\nasync function countItemsUsingField(\n pmRoot: string,\n settings: PmSettings,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n metadataKey: string,\n): Promise<number> {\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);\n return items.filter((item) => {\n const value = (item as unknown as Record<string, unknown>)[metadataKey];\n if (value === undefined || value === null) {\n return false;\n }\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n if (typeof value === \"string\") {\n return value.trim().length > 0;\n }\n return true;\n }).length;\n}\n\nexport async function runSchemaRemoveField(\n key: string | undefined,\n options: SchemaRemoveFieldCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaRemoveFieldResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const fieldsPath = fieldsPathFor(pmRoot, schema);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_FIELDS_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let removal;\n try {\n const previousRaw = await readFileIfExists(fieldsPath);\n let parsed;\n try {\n parsed = parseFieldsFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n try {\n removal = removeField(parsed, key);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n if (removal.removed) {\n const removedKey = normalizeFieldKey(removal.definition?.key ?? key);\n const metadataKey = normalizeFieldKey(removal.definition?.metadata_key ?? removal.definition?.front_matter_key ?? removedKey);\n if (metadataKey.length > 0) {\n const usingField = await countItemsUsingField(pmRoot, settings, schema, metadataKey);\n if (usingField > 0) {\n warnings.push(`items_using_field:${usingField}`);\n }\n }\n await writeFileAtomic(fieldsPath, serializeFieldsFile(removal.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: fieldsPath,\n scope: \"project\",\n op: \"schema:remove-field\",\n })),\n );\n }\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"remove-field\",\n removed: removal.removed,\n ...(removal.definition ? { field: removal.definition } : {}),\n file: {\n path: fieldsPath,\n fields: removal.file.fields.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaListFields(global: GlobalOptions): Promise<SchemaListFieldsResult> {\n const context = await loadSchemaInspectionContext(global);\n const fields = resolveRuntimeFieldRegistry(context.schema).definitions.map(toSchemaFieldSummary);\n return {\n action: \"list-fields\",\n fields,\n counts: {\n total: fields.length,\n },\n file: {\n path: fieldsPathFor(context.pmRoot, context.schema),\n },\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaShowField(\n key: string | undefined,\n global: GlobalOptions,\n): Promise<SchemaShowFieldResult> {\n const fieldKey = normalizeFieldKey(key);\n if (fieldKey.length === 0) {\n throw new PmCliError(\"Field key must not be empty.\", EXIT_CODE.USAGE);\n }\n const context = await loadSchemaInspectionContext(global);\n const match = resolveRuntimeFieldRegistry(context.schema).by_key.get(fieldKey);\n if (!match) {\n throw new PmCliError(\n `Unknown custom field \"${key}\". Run pm schema list-fields to inspect registered fields, or pm schema add-field \"${escapeForDoubleQuotes(\n key ?? \"\",\n )}\" to register it.`,\n EXIT_CODE.NOT_FOUND,\n { code: \"unknown_field\" },\n );\n }\n return {\n action: \"show-field\",\n field: toSchemaFieldSummary(match),\n file: {\n path: fieldsPathFor(context.pmRoot, context.schema),\n },\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaApplyPreset(\n preset: string | undefined,\n options: SchemaApplyPresetCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaApplyPresetResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n let presetName: TypePresetName;\n try {\n const normalized = normalizeTypePresetName(preset);\n if (normalized === undefined) {\n throw new Error(`Type preset name is required. Allowed: ${TYPE_PRESET_NAMES.join(\", \")}.`);\n }\n presetName = normalized;\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = typesPathFor(pmRoot, schema);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const registered: string[] = [];\n const replaced: string[] = [];\n let definitionsCount = 0;\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_TYPES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n try {\n const previousRaw = await readFileIfExists(typesPath);\n let parsed;\n try {\n parsed = parseItemTypesFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n let nextFile = parsed;\n for (const normalized of resolveTypePresetDefinitions(presetName)) {\n const upsert = upsertItemType(nextFile, normalized);\n nextFile = upsert.file;\n (upsert.replaced ? replaced : registered).push(upsert.definition.name);\n }\n definitionsCount = nextFile.definitions.length;\n await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"schema:apply-preset\",\n })),\n );\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"apply-preset\",\n preset: presetName,\n registered,\n replaced,\n file: {\n path: typesPath,\n definitions: definitionsCount,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaInferTypes(\n options: SchemaAddTypeInferCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaAddTypeInferResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = typesPathFor(pmRoot, schema);\n let minCount = 10;\n if (options.minCount !== undefined) {\n if (!Number.isInteger(options.minCount) || options.minCount < 1) {\n throw new PmCliError(\"--min-count must be a positive integer (>= 1).\", EXIT_CODE.USAGE);\n }\n minCount = options.minCount;\n }\n\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);\n const titles = items.map((item) => (typeof item.title === \"string\" ? item.title : \"\"));\n const candidates = inferTypesFromTitles(titles, { minCount });\n\n const warnings: string[] = [];\n const registered: string[] = [];\n const replaced: string[] = [];\n const skipped: Array<{ name: string; reason: string }> = [];\n let definitionsCount: number;\n\n // Dry-run preview by default: only --apply mutates schema/types.json.\n if (!options.apply) {\n let parsed;\n try {\n parsed = parseItemTypesFile(await readFileIfExists(typesPath));\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n definitionsCount = parsed.definitions.length;\n return {\n action: \"infer-types\",\n applied: false,\n min_count: minCount,\n candidates,\n registered,\n replaced,\n skipped,\n file: {\n path: typesPath,\n definitions: definitionsCount,\n },\n warnings,\n generated_at: nowIso(),\n };\n }\n\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_TYPES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n try {\n const previousRaw = await readFileIfExists(typesPath);\n let parsed;\n try {\n parsed = parseItemTypesFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n let nextFile = parsed;\n for (const candidate of candidates) {\n if (candidate.shadows_builtin) {\n skipped.push({ name: candidate.name, reason: \"shadows_builtin\" });\n continue;\n }\n let normalized;\n try {\n normalized = normalizeAddTypeInput({ name: candidate.name });\n } catch {\n // A title prefix that does not normalize to a valid type token (rare,\n // given the inference pattern) is skipped rather than aborting the batch.\n skipped.push({ name: candidate.name, reason: \"invalid_type_token\" });\n continue;\n }\n const upsert = upsertItemType(nextFile, normalized);\n nextFile = upsert.file;\n (upsert.replaced ? replaced : registered).push(upsert.definition.name);\n }\n definitionsCount = nextFile.definitions.length;\n await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"schema:infer-types\",\n })),\n );\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"infer-types\",\n applied: true,\n min_count: minCount,\n candidates,\n registered,\n replaced,\n skipped,\n file: {\n path: typesPath,\n definitions: definitionsCount,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nexport function formatSchemaAddTypeHuman(result: SchemaAddTypeResult): string {\n const verb = result.replaced ? \"Updated\" : \"Registered\";\n const aliasSuffix =\n result.type.aliases && result.type.aliases.length > 0 ? ` (aliases: ${result.type.aliases.join(\", \")})` : \"\";\n return `${verb} custom item type \"${result.type.name}\"${aliasSuffix} in ${result.file.path}. Run: pm create \"${escapeForDoubleQuotes(result.type.name)}\" \"<title>\"`;\n}\n\nexport function formatSchemaRemoveTypeHuman(result: SchemaRemoveTypeResult): string {\n if (!result.removed) {\n return `No custom item type matched; nothing removed from ${result.file.path}.`;\n }\n const name = result.type?.name ?? \"(unknown)\";\n return `Removed custom item type \"${name}\" from ${result.file.path}.`;\n}\n\nexport function formatSchemaAddStatusHuman(result: SchemaAddStatusResult): string {\n const verb = result.replaced ? \"Updated\" : \"Registered\";\n const roleSuffix =\n result.status.roles && result.status.roles.length > 0 ? ` (roles: ${result.status.roles.join(\", \")})` : \"\";\n const aliasSuffix =\n result.status.aliases && result.status.aliases.length > 0 ? ` (aliases: ${result.status.aliases.join(\", \")})` : \"\";\n return `${verb} status \"${result.status.id}\"${roleSuffix}${aliasSuffix} in ${result.file.path}.`;\n}\n\nexport function formatSchemaRemoveStatusHuman(result: SchemaRemoveStatusResult): string {\n if (!result.removed) {\n return `No custom status matched; nothing removed from ${result.file.path}.`;\n }\n const id = result.status?.id ?? \"(unknown)\";\n return `Removed custom status \"${id}\" from ${result.file.path}.`;\n}\n\nexport function formatSchemaListHuman(result: SchemaListResult): string {\n const lines = [\n `Schema types: ${result.counts.total} total (${result.counts.builtin} builtin, ${result.counts.custom} custom, ${result.counts.extension} extension)`,\n ];\n for (const [label, entries] of [\n [\"builtin\", result.builtin],\n [\"custom\", result.custom],\n [\"extension\", result.extension],\n ] as const) {\n if (entries.length === 0) {\n continue;\n }\n lines.push(`${label}: ${entries.map((entry) => entry.name).join(\", \")}`);\n }\n lines.push(\n `statuses: ${result.statuses.counts.total} total (${result.statuses.counts.builtin} builtin, ${result.statuses.counts.custom} custom)`,\n );\n for (const [label, entries] of [\n [\"builtin statuses\", result.statuses.builtin],\n [\"custom statuses\", result.statuses.custom],\n ] as const) {\n if (entries.length === 0) {\n continue;\n }\n lines.push(`${label}: ${entries.map((entry) => entry.id).join(\", \")}`);\n }\n lines.push(`custom fields: ${result.fields.counts.total} total`);\n if (result.fields.custom.length > 0) {\n lines.push(`fields: ${result.fields.custom.map((field) => `${field.key} (${field.type}, ${field.cli_flag})`).join(\", \")}`);\n }\n lines.push(`Inspect one: pm schema show <Type>`);\n lines.push(`Inspect one status: pm schema show-status <status>`);\n lines.push(`Inspect one field: pm schema show-field <key>`);\n return lines.join(\"\\n\");\n}\n\nexport function formatSchemaShowHuman(result: SchemaShowResult): string {\n const parts = [\n `type: ${result.type.name}`,\n `source: ${result.type.source}`,\n `folder: ${result.type.folder}`,\n ];\n if (result.type.default_status) {\n parts.push(`default_status: ${result.type.default_status}`);\n }\n if (result.type.aliases.length > 0) {\n parts.push(`aliases: ${result.type.aliases.join(\", \")}`);\n }\n if (result.type.description) {\n parts.push(`description: ${result.type.description}`);\n }\n if (result.type.options.length > 0) {\n parts.push(`options: ${result.type.options.map((option) => option.key).join(\", \")}`);\n }\n return parts.join(\"\\n\");\n}\n\nexport function formatSchemaShowStatusHuman(result: SchemaShowStatusResult): string {\n const parts = [\n `status: ${result.status.id}`,\n `source: ${result.status.source}`,\n ];\n if (result.status.roles.length > 0) {\n parts.push(`roles: ${result.status.roles.join(\", \")}`);\n }\n if (result.status.aliases.length > 0) {\n parts.push(`aliases: ${result.status.aliases.join(\", \")}`);\n }\n if (result.status.description) {\n parts.push(`description: ${result.status.description}`);\n }\n if (typeof result.status.order === \"number\") {\n parts.push(`order: ${result.status.order}`);\n }\n return parts.join(\"\\n\");\n}\n\nfunction formatFieldSummaryLine(field: SchemaFieldSummary): string {\n const flags: string[] = [];\n if (field.required) {\n flags.push(\"required\");\n }\n if (field.required_on_create) {\n flags.push(\"required_on_create\");\n }\n if (!field.allow_unset) {\n flags.push(\"no_unset\");\n }\n const flagSuffix = flags.length > 0 ? ` [${flags.join(\", \")}]` : \"\";\n return `${field.key} (${field.type}) ${field.cli_flag} commands=${field.commands.join(\"/\")}${flagSuffix}`;\n}\n\nexport function formatSchemaAddFieldHuman(result: SchemaAddFieldResult): string {\n const verb = result.replaced ? \"Updated\" : \"Registered\";\n return `${verb} custom field \"${result.field.key}\" in ${result.file.path}. Use it: pm create \"<title>\" --${(result.field.cli_flag ?? result.field.key).replaceAll(\"_\", \"-\")} <value>`;\n}\n\nexport function formatSchemaRemoveFieldHuman(result: SchemaRemoveFieldResult): string {\n if (!result.removed) {\n return `No custom field matched; nothing removed from ${result.file.path}.`;\n }\n const key = result.field?.key ?? \"(unknown)\";\n return `Removed custom field \"${key}\" from ${result.file.path}.`;\n}\n\nexport function formatSchemaListFieldsHuman(result: SchemaListFieldsResult): string {\n const lines = [`Custom fields: ${result.counts.total} total`];\n for (const field of result.fields) {\n lines.push(` ${formatFieldSummaryLine(field)}`);\n }\n lines.push(`Inspect one: pm schema show-field <key>`);\n return lines.join(\"\\n\");\n}\n\nexport function formatSchemaShowFieldHuman(result: SchemaShowFieldResult): string {\n const field = result.field;\n const parts = [\n `field: ${field.key}`,\n `type: ${field.type}`,\n `cli_flag: ${field.cli_flag}`,\n `commands: ${field.commands.join(\", \")}`,\n ];\n if (field.cli_aliases.length > 0) {\n parts.push(`cli_aliases: ${field.cli_aliases.join(\", \")}`);\n }\n if (field.description) {\n parts.push(`description: ${field.description}`);\n }\n if (field.required) {\n parts.push(`required: true`);\n }\n if (field.required_on_create) {\n parts.push(`required_on_create: true`);\n }\n if (!field.allow_unset) {\n parts.push(`allow_unset: false`);\n }\n if (field.required_types.length > 0) {\n parts.push(`required_types: ${field.required_types.join(\", \")}`);\n }\n return parts.join(\"\\n\");\n}\n\nexport function formatSchemaApplyPresetHuman(result: SchemaApplyPresetResult): string {\n const registered = result.registered.length > 0 ? `registered: ${result.registered.join(\", \")}` : \"\";\n const replaced = result.replaced.length > 0 ? `updated: ${result.replaced.join(\", \")}` : \"\";\n const detail = [registered, replaced].filter((part) => part.length > 0).join(\"; \");\n return `Applied \"${result.preset}\" type preset to ${result.file.path}${detail.length > 0 ? ` (${detail})` : \"\"}.`;\n}\n\nexport function formatSchemaInferTypesHuman(result: SchemaAddTypeInferResult): string {\n if (result.candidates.length === 0) {\n return `No title-prefix conventions found with at least ${result.min_count} items. Lower the threshold with --min-count <n>.`;\n }\n const lines = result.applied\n ? [`Inferred and registered custom types from title prefixes (min-count ${result.min_count}):`]\n : [`Inferred custom type candidates from title prefixes (min-count ${result.min_count}, dry-run):`];\n for (const candidate of result.candidates) {\n const note = candidate.shadows_builtin ? \" [shadows built-in, skipped]\" : \"\";\n lines.push(` ${candidate.name} <- \"${candidate.prefix}\" (${candidate.count} items)${note}`);\n }\n if (!result.applied) {\n lines.push(`Re-run with --apply to register the non-shadowing candidates.`);\n } else {\n if (result.registered.length > 0) {\n lines.push(`registered: ${result.registered.join(\", \")}`);\n }\n if (result.replaced.length > 0) {\n lines.push(`updated: ${result.replaced.join(\", \")}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\n/* c8 ignore stop */\n\n/**\n * Re-export so register-mutation can surface the hint in usage examples\n * without importing the core module directly.\n */\nexport { buildInvalidTypeHint };\n\nexport const _testOnlySchemaCommand = {\n toAuthor,\n workflowSlotsReferencing,\n};\n"],"names":["definition"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAM,0BAA0B,IAAI,IAAY,0BAA0B;AASnE,IAAM,qBAA0C,IAAI,IACzD,mCAAmC,IAAI,CAAC,eAAe,qBAAqB,WAAW,EAAE,CAAC,EAAE,OAC1F,CAAC,OAAO,GAAG,SAAS,CAAC,CACtB;AAqDG,SAAU,qBAAqB,OAAc;AACjD,SAAO,OAAO,UAAU,WAAW,MAAM,KAAI,EAAG,YAAW,EAAG,WAAW,WAAW,GAAG,IAAI;AAC7F;AAEA,SAAS,aAAa,QAAwB;AAC5C,QAAM,OAAO,oBAAI,IAAG;AACpB,aAAW,SAAS,QAAQ;AAC1B,UAAM,QAAQ,qBAAqB,KAAK;AACxC,QAAI,MAAM,SAAS,GAAG;AACpB,WAAK,IAAI,KAAK;IAChB;EACF;AACA,SAAO,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAClE;AAYM,SAAU,wBAAwB,KAAsB;AAC5D,QAAM,KAAK,qBAAqB,IAAI,EAAE;AACtC,MAAI,GAAG,WAAW,GAAG;AACnB,UAAM,IAAI,MAAM,8BAA8B;EAChD;AAKA,MAAI,mBAAmB,IAAI,EAAE,GAAG;AAC9B,UAAM,IAAI,MACR,0CAA0C,EAAE,sCAAsC,CAAC,GAAG,kBAAkB,EAAE,KAAK,IAAI,CAAC,GAAG;EAE3H;AACA,MAAI;AACJ,MAAI,IAAI,UAA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