@unbrained/pm-cli 2026.6.30 → 2026.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (628) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +26 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +58 -47
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/aggregate.js +102 -79
  9. package/dist/cli/commands/aggregate.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +339 -303
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/close-many.js +89 -68
  13. package/dist/cli/commands/close-many.js.map +1 -1
  14. package/dist/cli/commands/close.js +157 -129
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments-audit.js +50 -42
  17. package/dist/cli/commands/comments-audit.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +2 -0
  19. package/dist/cli/commands/config.js +443 -879
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.js +365 -287
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +352 -238
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +483 -434
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +46 -39
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/dedupe-merge.js +88 -69
  30. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  31. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  32. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +129 -78
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/managed-state.js +101 -57
  36. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  38. package/dist/cli/commands/extension/scaffold.js +214 -186
  39. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  40. package/dist/cli/commands/extension.d.ts +6 -1
  41. package/dist/cli/commands/extension.js +1034 -902
  42. package/dist/cli/commands/extension.js.map +1 -1
  43. package/dist/cli/commands/get.js +114 -81
  44. package/dist/cli/commands/get.js.map +1 -1
  45. package/dist/cli/commands/health.d.ts +17 -0
  46. package/dist/cli/commands/health.js +446 -307
  47. package/dist/cli/commands/health.js.map +1 -1
  48. package/dist/cli/commands/history-compact.js +209 -140
  49. package/dist/cli/commands/history-compact.js.map +1 -1
  50. package/dist/cli/commands/history-redact.js +162 -119
  51. package/dist/cli/commands/history-redact.js.map +1 -1
  52. package/dist/cli/commands/history-repair.js +120 -85
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts +8 -2
  55. package/dist/cli/commands/init.js +263 -162
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/list-filter-shared.js +55 -48
  58. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  59. package/dist/cli/commands/list.js +152 -102
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/next.js +49 -32
  62. package/dist/cli/commands/next.js.map +1 -1
  63. package/dist/cli/commands/plan.js +373 -298
  64. package/dist/cli/commands/plan.js.map +1 -1
  65. package/dist/cli/commands/recurrence-parsers.js +43 -25
  66. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  67. package/dist/cli/commands/reindex.d.ts +21 -5
  68. package/dist/cli/commands/reindex.js +345 -205
  69. package/dist/cli/commands/reindex.js.map +1 -1
  70. package/dist/cli/commands/restore.d.ts +8 -7
  71. package/dist/cli/commands/restore.js +105 -69
  72. package/dist/cli/commands/restore.js.map +1 -1
  73. package/dist/cli/commands/schema.js +33 -30
  74. package/dist/cli/commands/schema.js.map +1 -1
  75. package/dist/cli/commands/search.d.ts +10 -2
  76. package/dist/cli/commands/search.js +595 -536
  77. package/dist/cli/commands/search.js.map +1 -1
  78. package/dist/cli/commands/telemetry.js +98 -87
  79. package/dist/cli/commands/telemetry.js.map +1 -1
  80. package/dist/cli/commands/test-all.js +237 -168
  81. package/dist/cli/commands/test-all.js.map +1 -1
  82. package/dist/cli/commands/test.d.ts +6 -5
  83. package/dist/cli/commands/test.js +530 -464
  84. package/dist/cli/commands/test.js.map +1 -1
  85. package/dist/cli/commands/update-many.js +57 -42
  86. package/dist/cli/commands/update-many.js.map +1 -1
  87. package/dist/cli/commands/update.d.ts +1 -1
  88. package/dist/cli/commands/update.js +764 -747
  89. package/dist/cli/commands/update.js.map +1 -1
  90. package/dist/cli/commands/validate.d.ts +18 -1
  91. package/dist/cli/commands/validate.js +466 -343
  92. package/dist/cli/commands/validate.js.map +1 -1
  93. package/dist/cli/error-guidance.js +399 -357
  94. package/dist/cli/error-guidance.js.map +1 -1
  95. package/dist/cli/extension-command-options.js +48 -21
  96. package/dist/cli/extension-command-options.js.map +1 -1
  97. package/dist/cli/main.d.ts +47 -0
  98. package/dist/cli/main.js +428 -341
  99. package/dist/cli/main.js.map +1 -1
  100. package/dist/cli/migration-gates.js +22 -45
  101. package/dist/cli/migration-gates.js.map +1 -1
  102. package/dist/cli/register-list-query.js +94 -105
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +400 -416
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +86 -66
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +120 -101
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +117 -122
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
  113. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  114. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
  115. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
  117. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  118. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
  119. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
  120. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
  121. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
  125. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
  127. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
  129. package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
  132. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  133. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
  135. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
  137. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
  138. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
  140. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
  142. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
  144. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
  146. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
  148. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
  150. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
  152. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
  154. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
  156. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
  158. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
  160. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  162. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
  164. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
  165. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
  168. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
  169. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
  172. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
  173. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
  174. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
  178. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
  180. package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
  182. package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
  185. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
  187. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
  189. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
  192. package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
  196. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
  199. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
  200. package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
  202. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  203. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
  204. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
  206. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
  208. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
  211. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
  213. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
  214. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
  216. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
  218. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
  220. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
  222. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
  224. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
  225. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
  227. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
  229. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  230. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  231. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
  233. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
  235. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  236. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
  237. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
  239. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
  241. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
  243. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
  246. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
  248. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  249. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  250. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
  252. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
  253. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
  254. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
  255. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  256. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
  257. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  258. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
  259. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  260. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
  261. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
  262. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  263. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  265. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
  267. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
  268. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
  269. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
  271. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
  273. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
  274. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
  275. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  276. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
  277. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
  278. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
  279. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
  280. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
  281. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
  282. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
  283. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
  284. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
  285. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
  286. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
  287. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
  288. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
  289. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
  290. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
  291. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
  292. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
  293. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
  295. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  296. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
  297. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
  299. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  300. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  301. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
  302. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
  303. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  304. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
  305. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  306. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  307. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
  308. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
  309. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
  311. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  312. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
  313. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  314. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
  315. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
  316. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
  317. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
  318. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
  319. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
  321. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  322. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
  323. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
  324. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
  325. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  326. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
  327. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  328. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
  329. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
  330. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
  331. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  332. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
  333. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  334. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
  335. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
  337. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  338. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
  339. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
  341. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
  343. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
  345. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
  347. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  348. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  349. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  350. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
  351. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
  352. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
  353. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
  354. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
  355. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
  356. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
  357. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
  359. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
  361. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
  362. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  363. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  364. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  365. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  366. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
  367. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
  369. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  370. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  371. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
  372. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
  373. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
  374. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
  375. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
  377. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
  379. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
  381. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
  383. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  384. package/dist/cli-bundle/main.js +986 -1500
  385. package/dist/cli-bundle/main.js.map +4 -4
  386. package/dist/core/config/nested-settings.js +89 -67
  387. package/dist/core/config/nested-settings.js.map +1 -1
  388. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  389. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  390. package/dist/core/extensions/extension-policy.d.ts +18 -3
  391. package/dist/core/extensions/extension-policy.js +116 -106
  392. package/dist/core/extensions/extension-policy.js.map +1 -1
  393. package/dist/core/extensions/loader.js +310 -232
  394. package/dist/core/extensions/loader.js.map +1 -1
  395. package/dist/core/governance/metadata-coverage.js +20 -28
  396. package/dist/core/governance/metadata-coverage.js.map +1 -1
  397. package/dist/core/history/drift-scan.js +93 -81
  398. package/dist/core/history/drift-scan.js.map +1 -1
  399. package/dist/core/item/item-format.js +523 -410
  400. package/dist/core/item/item-format.js.map +1 -1
  401. package/dist/core/item/item-type-definition.js +14 -14
  402. package/dist/core/item/item-type-definition.js.map +1 -1
  403. package/dist/core/item/type-registry.js +87 -82
  404. package/dist/core/item/type-registry.js.map +1 -1
  405. package/dist/core/output/mutation-projection.js +42 -26
  406. package/dist/core/output/mutation-projection.js.map +1 -1
  407. package/dist/core/schema/runtime-schema.js +34 -28
  408. package/dist/core/schema/runtime-schema.js.map +1 -1
  409. package/dist/core/search/semantic-defaults.js +64 -37
  410. package/dist/core/search/semantic-defaults.js.map +1 -1
  411. package/dist/core/search/vector-stores.js +32 -17
  412. package/dist/core/search/vector-stores.js.map +1 -1
  413. package/dist/core/sentry/helpers.js +31 -28
  414. package/dist/core/sentry/helpers.js.map +1 -1
  415. package/dist/core/sentry/instrument.js +54 -43
  416. package/dist/core/sentry/instrument.js.map +1 -1
  417. package/dist/core/store/front-matter-cache.js +239 -153
  418. package/dist/core/store/front-matter-cache.js.map +1 -1
  419. package/dist/core/store/item-store.js +33 -26
  420. package/dist/core/store/item-store.js.map +1 -1
  421. package/dist/core/store/settings.js +247 -203
  422. package/dist/core/store/settings.js.map +1 -1
  423. package/dist/core/test/background-runs.js +189 -160
  424. package/dist/core/test/background-runs.js.map +1 -1
  425. package/dist/mcp/server.js +387 -367
  426. package/dist/mcp/server.js.map +1 -1
  427. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  428. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  429. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  430. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  431. package/dist/sdk/compose.d.ts +4 -1
  432. package/dist/sdk/compose.js +181 -115
  433. package/dist/sdk/compose.js.map +1 -1
  434. package/docs/RELEASING.md +2 -3
  435. package/package.json +2 -2
  436. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  437. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  438. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  439. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  440. package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  443. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  444. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  451. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  459. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  465. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
  471. package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  484. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  485. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  486. package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
  488. package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
  489. package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
  490. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  491. package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
  492. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  493. package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
  494. package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
  495. package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
  496. package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
  497. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
  498. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
  499. package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
  500. package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
  501. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  502. package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
  503. package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
  504. package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
  505. package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
  506. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  507. package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
  508. package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
  509. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  510. package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
  512. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  513. package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
  514. package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
  515. package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
  516. package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
  517. package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
  518. package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
  522. package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
  523. package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
  524. package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
  525. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  526. package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
  527. package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
  529. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
  531. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
  533. package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
  534. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  535. package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
  536. package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
  537. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/init.ts","../../../../../../../../cli/commands/init-agent-guidance.ts"],"sourcesContent":["/**\n * @module cli/commands/init\n *\n * Implements the pm init command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { normalizePrefix } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ensureRuntimeSchemaFileScaffold,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../../core/schema/runtime-schema.js\";\nimport {\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n} from \"../../core/schema/item-types-file.js\";\nimport {\n normalizeTypePresetName,\n resolveTypePresetDefinitions,\n TYPE_PRESET_NAMES,\n type TypePresetName,\n} from \"../../core/schema/type-presets.js\";\nimport { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, writeSettings } from \"../../core/store/settings.js\";\nimport type { GovernancePreset, PmSettings } from \"../../types/index.js\";\nimport { runExtension, type ExtensionCommandResult } from \"./extension.js\";\nimport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n} from \"./init-agent-guidance.js\";\n\n/**\n * Documents the init installed packages summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitInstalledPackagesSummary {\n installed_all: boolean;\n installed_count: number;\n packages: Array<{\n alias: string;\n ok: boolean;\n }>;\n}\n\n/**\n * Restricts init type preset name values accepted by command, SDK, and storage contracts.\n */\nexport type InitTypePresetName = TypePresetName;\n\n/**\n * Documents the init registered type preset summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitRegisteredTypePresetSummary {\n name: InitTypePresetName;\n registered: string[];\n updated: string[];\n file: string;\n}\n\n/**\n * Documents the init result payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitResult {\n ok: boolean;\n path: string;\n settings: PmSettings;\n created_dirs: string[];\n warnings: string[];\n governance_preset: GovernancePreset;\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n}\n\n/**\n * Documents the init command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitCommandOptions {\n preset?: string;\n defaults?: boolean;\n author?: string;\n withPackages?: boolean;\n agentGuidance?: string;\n typePreset?: string;\n force?: boolean;\n}\n\n/**\n * Concise projection of an InitResult for the default (toon) renderer. It keeps\n * every piece of information that only init can surface — the resolved path, id\n * prefix, governance preset, telemetry capture level, created-directory count,\n * the full warnings list (including `already_exists:` markers), agent-guidance\n * summary, and next steps — but replaces the verbose full settings tree (~190\n * lines) with a compact `settings` summary. Use --verbose for the full tree.\n */\nexport interface InitConciseResult {\n ok: boolean;\n path: string;\n id_prefix: string;\n governance_preset: GovernancePreset;\n telemetry: {\n enabled: boolean;\n capture_level: string;\n };\n output_format: string;\n created_dirs_count: number;\n created_dirs: string[];\n warnings: string[];\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n hint: string;\n}\n\n/**\n * Implements summarize init result for the public runtime surface of this module.\n */\nexport function summarizeInitResult(result: InitResult): InitConciseResult {\n return {\n ok: result.ok,\n path: result.path,\n id_prefix: result.settings.id_prefix,\n governance_preset: result.governance_preset,\n telemetry: {\n enabled: result.settings.telemetry.enabled,\n capture_level: result.settings.telemetry.capture_level,\n },\n output_format: result.settings.output.default_format,\n created_dirs_count: result.created_dirs.length,\n created_dirs: result.created_dirs,\n warnings: result.warnings,\n wizard_used: result.wizard_used,\n ...(result.registered_type_preset ? { registered_type_preset: result.registered_type_preset } : {}),\n ...(result.installed_packages ? { installed_packages: result.installed_packages } : {}),\n next_steps: result.next_steps,\n agent_guidance: result.agent_guidance,\n hint: \"Re-run with --verbose for the full settings tree.\",\n };\n}\n\nexport const _testOnly = {\n normalizeInitGovernancePreset,\n normalizeInitTypePreset,\n normalizeOptionalInitAuthor,\n normalizeInitAgentGuidanceMode,\n isPathLikeInitTarget,\n resolveInitInvocation,\n parseYesNoChoice,\n applyGovernancePreset,\n runInitWizard,\n setInitReadlineFactoryForTests,\n summarizeInstalledPackages,\n registerInitTypePreset,\n assertExplicitTrackerPathIsNotWorkspaceRoot,\n isLikelyWorkspaceRoot,\n};\n\ntype InitReadlineInterface = ReturnType<typeof readline.createInterface>;\nlet createInitReadlineInterface = (): InitReadlineInterface => readline.createInterface({ input, output });\n\nfunction setInitReadlineFactoryForTests(factory: (() => InitReadlineInterface) | undefined): void {\n createInitReadlineInterface = factory ?? (() => readline.createInterface({ input, output }));\n}\n\nfunction cloneDefaults(): PmSettings {\n return structuredClone(SETTINGS_DEFAULTS);\n}\n\ntype BuiltinGovernancePreset = Exclude<GovernancePreset, \"custom\">;\nconst BUILTIN_GOVERNANCE_PRESETS: BuiltinGovernancePreset[] = [\"minimal\", \"default\", \"strict\"];\nfunction normalizeInitGovernancePreset(rawValue: string | undefined): BuiltinGovernancePreset | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"minimal\" || normalized === \"default\" || normalized === \"strict\") {\n return normalized;\n }\n if (normalized === \"lite\" || normalized === \"minimum\") {\n return \"minimal\";\n }\n throw new PmCliError(\n `Invalid --preset value \"${rawValue}\". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeInitTypePreset(rawValue: string | undefined): InitTypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n if (rawValue.trim().length === 0) {\n throw new PmCliError(\"--type-preset must not be empty\", EXIT_CODE.USAGE);\n }\n try {\n // Non-undefined input never returns undefined; the shared normalizer throws\n // a plain Error for empty/unknown values, which we re-map to init's --type-preset\n // PmCliError wording for a consistent CLI surface.\n return normalizeTypePresetName(rawValue) as InitTypePresetName;\n } catch {\n throw new PmCliError(\n `Invalid --type-preset value \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction normalizeOptionalInitAuthor(rawValue: string | undefined): string | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim();\n if (normalized.length === 0) {\n throw new PmCliError(\"--author must not be empty\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction isPathLikeInitTarget(rawValue: string | undefined): boolean {\n if (rawValue === undefined) {\n return false;\n }\n const trimmed = rawValue.trim();\n if (trimmed.length === 0) {\n return false;\n }\n return path.isAbsolute(trimmed) || trimmed.startsWith(\".\") || trimmed.includes(\"/\") || trimmed.includes(\"\\\\\");\n}\n\nfunction resolveInitInvocation(\n cwd: string,\n global: GlobalOptions,\n prefixArg: string | undefined,\n): { pmRoot: string; prefixArg: string | undefined; positional_target?: string } {\n if (global.path === undefined && isPathLikeInitTarget(prefixArg)) {\n const positionalTarget = path.resolve(cwd, prefixArg!.trim());\n return {\n pmRoot: positionalTarget,\n prefixArg: undefined,\n positional_target: positionalTarget,\n };\n }\n return {\n pmRoot: resolvePmRoot(cwd, global.path),\n prefixArg,\n };\n}\n\nfunction normalizeInitAgentGuidanceMode(rawValue: string | undefined): InitAgentGuidanceMode {\n if (rawValue === undefined) {\n return \"ask\";\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--agent-guidance must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"ask\" || normalized === \"add\" || normalized === \"skip\" || normalized === \"status\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --agent-guidance value \"${rawValue}\". Allowed: ${INIT_AGENT_GUIDANCE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseYesNoChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nfunction applyGovernancePreset(settings: PmSettings, preset: BuiltinGovernancePreset): void {\n const knobs = GOVERNANCE_PRESET_DEFAULTS[preset];\n settings.governance = {\n preset,\n ...knobs,\n };\n settings.validation.parent_reference = knobs.parent_reference;\n settings.validation.metadata_profile = knobs.metadata_profile;\n}\n\nfunction isInstalledPackageEntry(value: unknown): value is { alias?: unknown; ok?: unknown } {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction summarizeInstalledPackages(result: ExtensionCommandResult): InitInstalledPackagesSummary {\n const details = result.details as {\n installed_all?: unknown;\n installed_count?: unknown;\n packages?: Array<{\n alias?: unknown;\n ok?: unknown;\n }>;\n };\n return {\n installed_all: details.installed_all === true,\n installed_count: typeof details.installed_count === \"number\" ? details.installed_count : 0,\n packages: Array.isArray(details.packages)\n ? details.packages.filter(isInstalledPackageEntry).map((entry) => ({\n alias: typeof entry.alias === \"string\" ? entry.alias : \"\",\n ok: entry.ok === true,\n }))\n : [],\n };\n}\n\nasync function registerInitTypePreset(\n pmRoot: string,\n settings: PmSettings,\n preset: InitTypePresetName,\n): Promise<InitRegisteredTypePresetSummary> {\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const parsed = parseItemTypesFile(await readFileIfExists(typesPath));\n let nextFile = parsed;\n const registered: string[] = [];\n const updated: string[] = [];\n for (const normalized of resolveTypePresetDefinitions(preset)) {\n const upsert = upsertItemType(nextFile, normalized);\n nextFile = upsert.file;\n (upsert.replaced ? updated : registered).push(upsert.definition.name);\n }\n await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));\n return {\n name: preset,\n registered,\n updated,\n file: typesPath,\n };\n}\n\nasync function isLikelyWorkspaceRoot(candidate: string): Promise<boolean> {\n const indicators = [\n \".git\",\n \"package.json\",\n \"pnpm-workspace.yaml\",\n \"AGENTS.md\",\n path.join(\".agents\", \"pm\"),\n ];\n for (const indicator of indicators) {\n if (await pathExists(path.join(candidate, indicator))) {\n return true;\n }\n }\n return false;\n}\n\nasync function assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot: string, global: GlobalOptions, force: boolean): Promise<void> {\n if (global.path === undefined || force) {\n return;\n }\n if (await pathExists(path.join(pmRoot, \"settings.json\"))) {\n return;\n }\n if (!(await isLikelyWorkspaceRoot(pmRoot))) {\n return;\n }\n const nestedTracker = path.join(pmRoot, \".agents\", \"pm\");\n throw new PmCliError(\n `Refusing to initialize tracker files directly in workspace root \"${pmRoot}\".`,\n EXIT_CODE.USAGE,\n {\n code: \"workspace_root_pm_path\",\n type: \"urn:pm-cli:error:workspace_root_pm_path\",\n why: \"--pm-path/--path points at the tracker storage directory itself, not the repository workspace. Point it at .agents/pm or pass --force if you intentionally want root-level tracker files.\",\n examples: [\n `pm --pm-path ${nestedTracker} init --yes`,\n \"pm init --yes\",\n `pm --pm-path ${pmRoot} init --yes --force`,\n ],\n nextSteps: [\n \"Use --pm-path <repo>/.agents/pm for repository-local tracker storage.\",\n \"Use PM_PATH only for sandboxed tests or explicit tracker roots.\",\n \"Pass --force only when root-level tracker files are intentional.\",\n ],\n recovery: {\n next_best_command: `pm --pm-path ${nestedTracker} init --yes`,\n },\n },\n );\n}\n\nasync function runInitWizard(initialPrefix: string, telemetryDefault: boolean): Promise<{\n prefix: string;\n preset: BuiltinGovernancePreset;\n telemetry_enabled: boolean;\n}> {\n const rl = createInitReadlineInterface();\n try {\n output.write(\"pm init setup wizard (agent-optimized)\\n\");\n output.write(\"This walkthrough is non-destructive and each choice can be changed later with pm config.\\n\\n\");\n\n output.write(\"1/3 Item ID prefix\\n\");\n output.write(\"Prefix is prepended to generated IDs (for example pm-a1b2).\\n\");\n const prefixAnswer = await rl.question(`Item ID prefix [${initialPrefix}]: `);\n const resolvedPrefix = prefixAnswer.trim().length > 0 ? normalizePrefix(prefixAnswer) : initialPrefix;\n\n output.write(\"\\n2/3 Governance preset\\n\");\n output.write(\"minimal: no ownership blocking, progressive create defaults, close validation off.\\n\");\n output.write(\"default: ownership conflict warnings, progressive create defaults, close validation warn.\\n\");\n output.write(\"strict: ownership blocking, strict create defaults, close validation strict.\\n\");\n const presetAnswer = await rl.question(\"Governance preset [minimal/default/strict] (default: minimal): \");\n const presetChoice = presetAnswer.trim().length > 0 ? presetAnswer.trim() : \"minimal\";\n // The wizard is forgiving: a typo'd/unknown preset defaults to minimal with a\n // notice instead of throwing and aborting an in-progress interactive setup.\n // normalizeInitGovernancePreset returns a concrete preset for valid input and\n // throws (never returns undefined) for invalid non-empty input, so the result is\n // always a BuiltinGovernancePreset on the success path.\n let resolvedPreset: BuiltinGovernancePreset = \"minimal\";\n try {\n resolvedPreset = normalizeInitGovernancePreset(presetChoice) as BuiltinGovernancePreset;\n } catch {\n output.write(`Unrecognized governance preset \"${presetChoice}\"; using minimal.\\n`);\n }\n\n output.write(\"\\n3/3 Project telemetry\\n\");\n output.write(\"Telemetry helps improve reliability and can be disabled anytime via pm config.\\n\");\n const telemetryLabel = telemetryDefault ? \"Y/n\" : \"y/N\";\n const telemetryAnswer = await rl.question(`Enable telemetry for this project? [${telemetryLabel}] `);\n const telemetryEnabled = parseYesNoChoice(telemetryAnswer, telemetryDefault);\n\n output.write(\"\\n\");\n return {\n prefix: resolvedPrefix,\n preset: resolvedPreset,\n telemetry_enabled: telemetryEnabled,\n };\n } finally {\n rl.close();\n }\n}\n\n/**\n * Implements run init for the public runtime surface of this module.\n */\nexport async function runInit(\n prefixArg: string | undefined,\n global: GlobalOptions,\n options: InitCommandOptions = {},\n): Promise<InitResult> {\n const cwd = process.cwd();\n const invocation = resolveInitInvocation(cwd, global, prefixArg);\n const pmRoot = invocation.pmRoot;\n prefixArg = invocation.prefixArg;\n await assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot, global, options.force === true);\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n let wizardUsed = false;\n\n for (const subdir of PM_REQUIRED_SUBDIRS) {\n const target = subdir ? path.join(pmRoot, subdir) : pmRoot;\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n const settingsPath = path.join(pmRoot, \"settings.json\");\n const settingsExists = await pathExists(settingsPath);\n let normalizedPrefix = normalizePrefix(prefixArg);\n const presetFromOption = normalizeInitGovernancePreset(options.preset);\n const useDefaults = options.defaults === true;\n const authorFromOption = normalizeOptionalInitAuthor(options.author);\n const installBundledPackages = options.withPackages === true;\n const agentGuidanceMode = normalizeInitAgentGuidanceMode(options.agentGuidance);\n const typePreset = normalizeInitTypePreset(options.typePreset);\n let chosenPreset = presetFromOption;\n let chosenTelemetryEnabled: boolean | undefined;\n\n let settings: PmSettings;\n if (settingsExists) {\n settings = await readSettings(pmRoot);\n warnings.push(`already_exists:${settingsPath}`);\n const pendingChanges: string[] = [];\n const shouldUpdatePrefix = prefixArg !== undefined && settings.id_prefix !== normalizedPrefix;\n const shouldUpdatePreset = presetFromOption !== undefined && settings.governance.preset !== presetFromOption;\n const shouldUpdateAuthor = authorFromOption !== undefined && settings.author_default !== authorFromOption;\n if (shouldUpdatePrefix) {\n pendingChanges.push(\"id_prefix\");\n }\n if (shouldUpdatePreset) {\n pendingChanges.push(\"governance_preset\");\n }\n if (shouldUpdateAuthor) {\n pendingChanges.push(\"author_default\");\n }\n if (pendingChanges.length > 0 && options.force !== true) {\n throw new PmCliError(\n `Refusing to update existing tracker settings at ${settingsPath} without --force.`,\n EXIT_CODE.USAGE,\n {\n code: \"init_existing_settings_requires_force\",\n type: \"urn:pm-cli:error:init_existing_settings_requires_force\",\n required: `--force for ${pendingChanges.join(\", \")}`,\n why: \"pm init is safe to rerun, but changing id prefix, governance preset, or default author on an existing tracker can corrupt long-lived project context when an agent meant to initialize a sandbox path.\",\n examples: [\n \"pm init --yes\",\n \"pm init ./sandbox-pm --yes\",\n \"pm init acme --yes --force\",\n ],\n nextSteps: [\n \"If you meant to initialize a sandbox tracker, pass a path-like positional such as ./sandbox-pm or /tmp/pm-test.\",\n \"If you intentionally want to rewrite this existing tracker's init-managed settings, rerun with --force.\",\n ],\n },\n );\n }\n let changed = false;\n if (shouldUpdatePrefix) {\n settings.id_prefix = normalizedPrefix;\n warnings.push(`updated:id_prefix:${normalizedPrefix}`);\n changed = true;\n }\n if (shouldUpdatePreset) {\n applyGovernancePreset(settings, presetFromOption!);\n warnings.push(`updated:governance_preset:${presetFromOption}`);\n changed = true;\n }\n if (shouldUpdateAuthor) {\n settings.author_default = authorFromOption!;\n warnings.push(`updated:author_default:${authorFromOption}`);\n changed = true;\n }\n if (changed) {\n await writeSettings(pmRoot, settings);\n }\n } else {\n if (presetFromOption === undefined && !useDefaults && process.stdin.isTTY === true && process.stdout.isTTY === true) {\n const wizardChoices = await runInitWizard(normalizedPrefix, SETTINGS_DEFAULTS.telemetry.enabled);\n normalizedPrefix = wizardChoices.prefix;\n chosenPreset = wizardChoices.preset;\n chosenTelemetryEnabled = wizardChoices.telemetry_enabled;\n wizardUsed = true;\n }\n const effectivePreset = chosenPreset ?? \"minimal\";\n settings = cloneDefaults();\n settings.id_prefix = normalizedPrefix;\n applyGovernancePreset(settings, effectivePreset);\n if (authorFromOption !== undefined) {\n settings.author_default = authorFromOption;\n }\n if (chosenTelemetryEnabled !== undefined) {\n settings.telemetry.enabled = chosenTelemetryEnabled;\n settings.telemetry.first_run_prompt_completed = true;\n }\n await writeSettings(pmRoot, settings);\n }\n\n const agentGuidanceResult = await runInitAgentGuidance({\n pm_root: pmRoot,\n cwd,\n mode: agentGuidanceMode,\n interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,\n settings,\n });\n warnings.push(...agentGuidanceResult.warnings);\n if (agentGuidanceResult.settings_changed) {\n await writeSettings(pmRoot, settings);\n }\n\n const runtimeSchemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, settings.schema);\n for (const createdPath of runtimeSchemaScaffold.created_paths) {\n createdDirs.push(createdPath);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: createdPath,\n scope: \"project\",\n op: \"init:runtime_schema_file\",\n })),\n );\n }\n\n let registeredTypePreset: InitRegisteredTypePresetSummary | undefined;\n if (typePreset !== undefined) {\n registeredTypePreset = await registerInitTypePreset(pmRoot, settings, typePreset);\n warnings.push(`registered_type_preset:${typePreset}`);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: registeredTypePreset.file,\n scope: \"project\",\n op: \"init:type_preset\",\n })),\n );\n settings = await readSettings(pmRoot);\n }\n\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n for (const typeFolder of typeRegistry.folders) {\n if ((PM_REQUIRED_SUBDIRS as readonly string[]).includes(typeFolder)) {\n continue;\n }\n const target = path.join(pmRoot, typeFolder);\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n let installedPackages: InitInstalledPackagesSummary | undefined;\n if (installBundledPackages) {\n const packageInstallResult = await runExtension(\"all\", { install: true, project: true }, global);\n warnings.push(...packageInstallResult.warnings);\n installedPackages = summarizeInstalledPackages(packageInstallResult);\n if (!installedPackages.installed_all || installedPackages.packages.some((entry) => !entry.ok)) {\n throw new PmCliError(\"pm init --with-packages did not install all bundled packages successfully.\", EXIT_CODE.GENERIC_FAILURE);\n }\n }\n\n const nextSteps: string[] = [\n 'Create your first item: pm create --type Task --title \"<title>\"',\n 'List active items: pm list',\n 'Get agent-friendly project context: pm context',\n ];\n if (!installBundledPackages) {\n nextSteps.push(\n \"Add optional packages for richer workflows: pm install calendar --project, pm install templates --project, pm install guide-shell --project\",\n );\n nextSteps.push(\"Or install everything bundled: pm init --with-packages (idempotent on re-run)\");\n } else {\n nextSteps.push(\"Explore newly-available commands: pm cal, pm templates, pm guide\");\n }\n if (registeredTypePreset) {\n nextSteps.push(`Inspect registered preset types: pm schema list, pm schema show ${registeredTypePreset.registered[0] ?? registeredTypePreset.updated[0]}`);\n }\n nextSteps.push(\"Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.\");\n for (const guidanceNextStep of agentGuidanceResult.next_steps) {\n if (!nextSteps.includes(guidanceNextStep)) {\n nextSteps.push(guidanceNextStep);\n }\n }\n\n return {\n ok: true,\n path: pmRoot,\n settings,\n created_dirs: createdDirs,\n warnings,\n governance_preset: settings.governance.preset,\n wizard_used: wizardUsed,\n ...(registeredTypePreset ? { registered_type_preset: registeredTypePreset } : {}),\n ...(installedPackages ? { installed_packages: installedPackages } : {}),\n next_steps: nextSteps,\n agent_guidance: agentGuidanceResult.summary,\n };\n}\n","/**\n * @module cli/commands/init-agent-guidance\n *\n * Implements the pm init agent guidance command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { PmSettings } from \"../../types/index.js\";\n\n/**\n * Restricts init agent guidance mode values accepted by command, SDK, and storage contracts.\n */\nexport type InitAgentGuidanceMode = \"ask\" | \"add\" | \"skip\" | \"status\";\n\nexport const INIT_AGENT_GUIDANCE_MODE_VALUES: InitAgentGuidanceMode[] = [\"ask\", \"add\", \"skip\", \"status\"];\n\nconst AGENT_GUIDANCE_TARGET_FILENAMES = [\"AGENTS.md\", \"CLAUDE.md\"] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKENS = [\n \"pm init\",\n \"pm context\",\n \"pm search\",\n \"pm create\",\n \"pm claim\",\n \"pm files\",\n \"pm docs\",\n \"pm test --run\",\n \"pm close\",\n \"pm release\",\n \"pm_author\",\n] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD = 8;\nconst AGENT_GUIDANCE_TEMPLATE_VERSION = 1;\nconst AGENT_GUIDANCE_START_MARKER_PREFIX = \"<!-- pm-cli:agent-guidance:start:\";\nconst AGENT_GUIDANCE_START_MARKER = `<!-- pm-cli:agent-guidance:start:v${AGENT_GUIDANCE_TEMPLATE_VERSION} -->`;\nconst AGENT_GUIDANCE_END_MARKER = \"<!-- pm-cli:agent-guidance:end -->\";\n\nexport const _testOnly = {\n toPortableRelativePath,\n ensureTrailingNewline,\n detectLineEnding,\n findGuidanceBlockRange,\n buildAgentGuidanceBlock,\n upsertAgentGuidanceBlock,\n resolveProjectRoot,\n resolveTargetGuidancePath,\n parsePromptChoice,\n pushUnique,\n promptForGuidanceWrite,\n normalizeAgentGuidanceState,\n applyAgentGuidanceState,\n writeGuidanceFile,\n setAgentGuidanceReadlineFactoryForTests,\n};\n\ntype AgentGuidanceReadlineInterface = ReturnType<typeof readline.createInterface>;\nlet createAgentGuidanceReadlineInterface = (): AgentGuidanceReadlineInterface => readline.createInterface({ input, output });\n\nfunction setAgentGuidanceReadlineFactoryForTests(factory: (() => AgentGuidanceReadlineInterface) | undefined): void {\n createAgentGuidanceReadlineInterface = factory ?? (() => readline.createInterface({ input, output }));\n}\n\ninterface AgentGuidanceFileScan {\n file_path: string;\n exists: boolean;\n has_guidance: boolean;\n has_marker: boolean;\n}\n\ninterface AgentGuidanceBlockRange {\n start_index: number;\n end_index: number;\n}\n\n/**\n * Documents the init agent guidance summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitAgentGuidanceSummary {\n mode: InitAgentGuidanceMode;\n present: boolean;\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n declined: boolean;\n prompt_completed: boolean;\n template_version: number;\n target_file: string;\n checked_files: string[];\n files_with_guidance: string[];\n missing_files: string[];\n}\n\n/**\n * Documents the run init agent guidance options payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceOptions {\n pm_root: string;\n cwd: string;\n mode: InitAgentGuidanceMode;\n interactive: boolean;\n settings: PmSettings;\n}\n\n/**\n * Documents the run init agent guidance result payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceResult {\n summary: InitAgentGuidanceSummary;\n warnings: string[];\n next_steps: string[];\n settings_changed: boolean;\n}\n\nfunction toPortableRelativePath(projectRoot: string, targetPath: string): string {\n const relative = path.relative(projectRoot, targetPath);\n if (relative.length === 0) {\n return path.basename(targetPath);\n }\n return relative.split(path.sep).join(\"/\");\n}\n\nfunction ensureTrailingNewline(value: string): string {\n return value.endsWith(\"\\n\") ? value : `${value}\\n`;\n}\n\nfunction detectLineEnding(value: string): \"\\n\" | \"\\r\\n\" {\n return value.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n}\n\nfunction findGuidanceBlockRange(content: string): AgentGuidanceBlockRange | null {\n const startIndex = content.indexOf(AGENT_GUIDANCE_START_MARKER_PREFIX);\n if (startIndex === -1) {\n return null;\n }\n const endMarkerIndex = content.indexOf(AGENT_GUIDANCE_END_MARKER, startIndex);\n if (endMarkerIndex === -1) {\n return null;\n }\n return {\n start_index: startIndex,\n end_index: endMarkerIndex + AGENT_GUIDANCE_END_MARKER.length,\n };\n}\n\nfunction hasGuidanceMarker(content: string): boolean {\n return findGuidanceBlockRange(content) !== null;\n}\n\nfunction buildAgentGuidanceBlock(lineEnding: \"\\n\" | \"\\r\\n\"): string {\n const lines = [\n AGENT_GUIDANCE_START_MARKER,\n \"## pm Workflow (Agent Quickstart)\",\n \"\",\n \"- Orient before mutate: `pm context --limit 10`, `pm search \\\"<keywords>\\\" --limit 10`, `pm list-open --limit 20`.\",\n \"- Claim and execute: `pm claim <id>` then `pm update <id> --status in_progress`.\",\n \"- Link evidence while coding: `pm files <id> --add ...`, `pm docs <id> --add ...`, `pm test <id> --add command=\\\"node scripts/run-tests.mjs test -- ...\\\"`.\",\n \"- Verify and close: `pm test <id> --run --progress`, `pm close <id> \\\"<evidence>\\\" --validate-close warn`, `pm release <id>`.\",\n \"- Set `PM_AUTHOR=<stable-agent-id>` before mutation commands.\",\n \"\",\n AGENT_GUIDANCE_END_MARKER,\n \"\",\n ];\n return lines.join(lineEnding);\n}\n\nfunction upsertAgentGuidanceBlock(existingContent: string): { next_content: string; changed: boolean } {\n const lineEnding = detectLineEnding(existingContent);\n const nextBlock = buildAgentGuidanceBlock(lineEnding);\n const existingRange = findGuidanceBlockRange(existingContent);\n if (existingRange) {\n const trailingContent = existingContent.slice(existingRange.end_index);\n const normalizedTrailingContent = trailingContent.startsWith(\"\\r\\n\")\n ? trailingContent.slice(2)\n : trailingContent.startsWith(\"\\n\")\n ? trailingContent.slice(1)\n : trailingContent;\n const nextContent = ensureTrailingNewline(\n `${existingContent.slice(0, existingRange.start_index)}${nextBlock}${normalizedTrailingContent}`,\n );\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n }\n const separator = existingContent.length === 0 ? \"\" : existingContent.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\n const nextContent = ensureTrailingNewline(`${existingContent}${separator}${nextBlock}`);\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n}\n\nfunction resolveProjectRoot(pmRoot: string, cwd: string): string {\n const parent = path.dirname(pmRoot);\n if (path.basename(pmRoot) === \"pm\" && path.basename(parent) === \".agents\") {\n return path.dirname(parent);\n }\n return path.resolve(cwd, pmRoot);\n}\n\nfunction resolveTargetGuidancePath(scans: AgentGuidanceFileScan[], projectRoot: string): string {\n const existingAgents = scans.find((entry) => path.basename(entry.file_path) === \"AGENTS.md\" && entry.exists);\n if (existingAgents) {\n return existingAgents.file_path;\n }\n const existingAny = scans.find((entry) => entry.exists);\n if (existingAny) {\n return existingAny.file_path;\n }\n return path.join(projectRoot, \"AGENTS.md\");\n}\n\nfunction parsePromptChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nasync function promptForGuidanceWrite(targetRelativePath: string): Promise<boolean> {\n const rl = createAgentGuidanceReadlineInterface();\n try {\n output.write(\"\\nAgent guidance check\\n\");\n output.write(\"No AGENTS.md/CLAUDE.md file currently contains compact pm workflow guidance.\\n\");\n const answer = await rl.question(`Add a compact pm workflow section to ${targetRelativePath}? [Y/n] `);\n output.write(\"\\n\");\n return parsePromptChoice(answer, true);\n } finally {\n rl.close();\n }\n}\n\nfunction normalizeAgentGuidanceState(settings: PmSettings): PmSettings[\"agent_guidance\"] {\n const current = settings.agent_guidance;\n return {\n prompt_completed: current?.prompt_completed === true,\n declined: current?.declined === true,\n declined_at: typeof current?.declined_at === \"string\" ? current.declined_at : \"\",\n template_version:\n typeof current?.template_version === \"number\" && Number.isInteger(current.template_version) && current.template_version > 0\n ? current.template_version\n : AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: Array.isArray(current?.last_checked_files)\n ? [...new Set(current.last_checked_files.map((value) => value.trim()).filter((value) => value.length > 0))].sort(\n (left, right) => left.localeCompare(right),\n )\n : [],\n };\n}\n\nasync function scanGuidanceFiles(projectRoot: string): Promise<AgentGuidanceFileScan[]> {\n const scans: AgentGuidanceFileScan[] = [];\n for (const filename of AGENT_GUIDANCE_TARGET_FILENAMES) {\n const filePath = path.join(projectRoot, filename);\n const exists = await pathExists(filePath);\n if (!exists) {\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: false,\n has_marker: false,\n });\n continue;\n }\n const content = await fs.readFile(filePath, \"utf8\");\n const contentLower = content.toLowerCase();\n const tokenHits = AGENT_GUIDANCE_REQUIRED_TOKENS.filter((token) => contentLower.includes(token));\n const hasMarker = hasGuidanceMarker(content);\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: hasMarker || tokenHits.length >= AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD,\n has_marker: hasMarker,\n });\n }\n return scans;\n}\n\nfunction pushUnique(target: string[], value: string): void {\n if (!target.includes(value)) {\n target.push(value);\n }\n}\n\nfunction applyAgentGuidanceState(\n settings: PmSettings,\n currentState: PmSettings[\"agent_guidance\"],\n): { changed: boolean; state: PmSettings[\"agent_guidance\"] } {\n const existing = normalizeAgentGuidanceState(settings);\n const changed = JSON.stringify(existing) !== JSON.stringify(currentState);\n if (changed) {\n settings.agent_guidance = currentState;\n }\n return { changed, state: currentState };\n}\n\nasync function writeGuidanceFile(filePath: string): Promise<{ changed: boolean; warnings: string[] }> {\n const exists = await pathExists(filePath);\n const currentContent = exists ? await fs.readFile(filePath, \"utf8\") : \"\";\n const nextContent = upsertAgentGuidanceBlock(currentContent);\n if (!nextContent.changed) {\n return { changed: false, warnings: [] };\n }\n await fs.writeFile(filePath, nextContent.next_content, \"utf8\");\n return {\n changed: true,\n warnings: await runActiveOnWriteHooks({\n path: filePath,\n scope: \"project\",\n op: \"init:agent_guidance_file\",\n }),\n };\n}\n\n/**\n * Implements run init agent guidance for the public runtime surface of this module.\n */\nexport async function runInitAgentGuidance(options: RunInitAgentGuidanceOptions): Promise<RunInitAgentGuidanceResult> {\n const warnings: string[] = [];\n const nextSteps: string[] = [];\n const projectRoot = resolveProjectRoot(options.pm_root, options.cwd);\n let scans = await scanGuidanceFiles(projectRoot);\n const targetPath = resolveTargetGuidancePath(scans, projectRoot);\n const targetRelativePath = toPortableRelativePath(projectRoot, targetPath);\n const addLaterHint = \"Add workflow guidance later: pm init --agent-guidance add\";\n let prompted = false;\n let applied = false;\n let skipped = false;\n let state = normalizeAgentGuidanceState(options.settings);\n const checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));\n const presentBefore = scans.some((entry) => entry.has_guidance);\n\n const markState = (partial: Partial<PmSettings[\"agent_guidance\"]>): void => {\n state = {\n ...state,\n ...partial,\n template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: checkedFiles,\n };\n };\n\n if (options.mode === \"status\") {\n if (!presentBefore) {\n warnings.push(\"agent_guidance:missing\");\n pushUnique(nextSteps, addLaterHint);\n }\n } else if (options.mode === \"skip\") {\n skipped = true;\n markState({\n prompt_completed: true,\n declined: true,\n declined_at: state.declined_at.length > 0 ? state.declined_at : new Date().toISOString(),\n });\n warnings.push(\"agent_guidance:explicit_skip\");\n pushUnique(nextSteps, addLaterHint);\n } else if (options.mode === \"add\") {\n if (!presentBefore) {\n const writeResult = await writeGuidanceFile(targetPath);\n warnings.push(...writeResult.warnings);\n if (writeResult.changed) {\n applied = true;\n warnings.push(`agent_guidance:added:${targetRelativePath}`);\n }\n }\n markState({\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n } else if (presentBefore) {\n if (state.declined) {\n markState({\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n }\n } else if (state.prompt_completed && state.declined) {\n skipped = true;\n warnings.push(\"agent_guidance:skipped_declined\");\n pushUnique(nextSteps, addLaterHint);\n } else if (options.interactive) {\n prompted = true;\n const approved = await promptForGuidanceWrite(targetRelativePath);\n if (approved) {\n const writeResult = await writeGuidanceFile(targetPath);\n warnings.push(...writeResult.warnings);\n if (writeResult.changed) {\n applied = true;\n warnings.push(`agent_guidance:added:${targetRelativePath}`);\n }\n markState({\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n } else {\n skipped = true;\n markState({\n prompt_completed: true,\n declined: true,\n declined_at: new Date().toISOString(),\n });\n warnings.push(\"agent_guidance:declined\");\n pushUnique(nextSteps, addLaterHint);\n }\n } else {\n warnings.push(\"agent_guidance:missing_non_interactive\");\n pushUnique(nextSteps, addLaterHint);\n }\n\n const stateUpdate = applyAgentGuidanceState(options.settings, state);\n if (applied) {\n scans = await scanGuidanceFiles(projectRoot);\n }\n\n const summary: InitAgentGuidanceSummary = {\n mode: options.mode,\n present: scans.some((entry) => entry.has_guidance),\n prompted,\n applied,\n skipped,\n declined: state.declined,\n prompt_completed: state.prompt_completed,\n template_version: state.template_version,\n target_file: targetRelativePath,\n checked_files: scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),\n files_with_guidance: scans\n .filter((entry) => entry.has_guidance)\n .map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),\n missing_files: scans\n .filter((entry) => !entry.exists)\n .map((entry) => toPortableRelativePath(projectRoot, entry.file_path)),\n };\n\n return {\n summary,\n warnings,\n next_steps: nextSteps,\n settings_changed: stateUpdate.changed,\n };\n}\n"],"names":["fs","path","readline","input","output","nextContent","readline","input","output","path","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAOA,SAAQ;AACf,OAAOC,WAAU;AACjB,OAAOC,eAAc;AACrB,SAAS,SAASC,QAAO,UAAUC,eAAc;;;ACHjD,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,SAAS,SAAS,OAAO,UAAU,cAAc;AAU1C,IAAM,kCAA2D,CAAC,OAAO,OAAO,QAAQ,QAAQ;AAEvG,IAAM,kCAAkC,CAAC,aAAa,WAAW;AACjE,IAAM,iCAAiC;EACrC;EACA;EACA;EAC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