@unbrained/pm-cli 2026.7.6 → 2026.7.8

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 (688) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/cli/commands/annotation-command.d.ts +1 -0
  3. package/dist/cli/commands/annotation-command.js +29 -2
  4. package/dist/cli/commands/annotation-command.js.map +1 -1
  5. package/dist/cli/commands/comments.js +3 -4
  6. package/dist/cli/commands/comments.js.map +1 -1
  7. package/dist/cli/commands/completion.js +10 -2
  8. package/dist/cli/commands/completion.js.map +1 -1
  9. package/dist/cli/commands/context.d.ts +1 -0
  10. package/dist/cli/commands/context.js +4 -4
  11. package/dist/cli/commands/context.js.map +1 -1
  12. package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
  13. package/dist/cli/commands/extension/bundled-catalog.js +38 -28
  14. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  15. package/dist/cli/commands/extension/install-sources.js +81 -18
  16. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  17. package/dist/cli/commands/extension.d.ts +23 -19
  18. package/dist/cli/commands/extension.js +167 -57
  19. package/dist/cli/commands/extension.js.map +1 -1
  20. package/dist/cli/commands/health.js +9 -5
  21. package/dist/cli/commands/health.js.map +1 -1
  22. package/dist/cli/commands/learnings.js +5 -3
  23. package/dist/cli/commands/learnings.js.map +1 -1
  24. package/dist/cli/commands/notes.js +5 -3
  25. package/dist/cli/commands/notes.js.map +1 -1
  26. package/dist/cli/commands/reindex.js +4 -3
  27. package/dist/cli/commands/reindex.js.map +1 -1
  28. package/dist/cli/commands/search.js +4 -4
  29. package/dist/cli/commands/search.js.map +1 -1
  30. package/dist/cli/commands/test.d.ts +9 -0
  31. package/dist/cli/commands/test.js +144 -105
  32. package/dist/cli/commands/test.js.map +1 -1
  33. package/dist/cli/extension-command-help.js +10 -2
  34. package/dist/cli/extension-command-help.js.map +1 -1
  35. package/dist/cli/help-content.js +28 -2
  36. package/dist/cli/help-content.js.map +1 -1
  37. package/dist/cli/register-list-query.d.ts +1 -1
  38. package/dist/cli/register-list-query.js +19 -27
  39. package/dist/cli/register-list-query.js.map +1 -1
  40. package/dist/cli/register-operations.d.ts +0 -8
  41. package/dist/cli/register-operations.js +41 -46
  42. package/dist/cli/register-operations.js.map +1 -1
  43. package/dist/cli/register-setup.js +119 -13
  44. package/dist/cli/register-setup.js.map +1 -1
  45. package/dist/cli/registration-helpers.d.ts +5 -1
  46. package/dist/cli/registration-helpers.js +14 -2
  47. package/dist/cli/registration-helpers.js.map +1 -1
  48. package/dist/cli-bundle/chunks/append-CDPAYYSB.js +11 -0
  49. package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-RSPHC423.js} +8 -9
  50. package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-2BVD4ZD2.js} +288 -233
  51. package/dist/cli-bundle/chunks/chunk-2BVD4ZD2.js.map +7 -0
  52. package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-2RADY7IB.js} +517 -195
  53. package/dist/cli-bundle/chunks/chunk-2RADY7IB.js.map +1 -0
  54. package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-3FRNNVWY.js} +518 -196
  55. package/dist/cli-bundle/chunks/chunk-3FRNNVWY.js.map +7 -0
  56. package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-3FUXM574.js} +8 -8
  57. package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-3SHDAKMF.js} +3 -3
  58. package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-3UXIMY62.js} +4 -6
  59. package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-3UXIMY62.js.map} +1 -1
  60. package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-3V5C7PUH.js} +2 -2
  61. package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-3YJDIJIE.js} +4 -6
  62. package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-3YJDIJIE.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-4I7KS5ES.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-4OCWJ2AP.js} +13 -17
  65. package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-4OCWJ2AP.js.map} +1 -1
  66. package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-5STY7NVM.js} +8 -8
  67. package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-5VAZHYVQ.js} +2 -2
  68. package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-6FU5BVRB.js} +12 -14
  69. package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-6FU5BVRB.js.map} +1 -1
  70. package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-6RR4XM5H.js} +3 -3
  71. package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-6TD5QGIB.js} +7 -7
  72. package/dist/cli-bundle/chunks/chunk-6TD5QGIB.js.map +1 -0
  73. package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-6WCXSC5V.js} +12 -16
  74. package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-6WCXSC5V.js.map} +1 -1
  75. package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-6ZKDMEVT.js} +7 -9
  76. package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-6ZKDMEVT.js.map} +1 -1
  77. package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-7QKSLAHB.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-7TBUV7XS.js} +8 -12
  79. package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-7TBUV7XS.js.map} +1 -1
  80. package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-7UCBLJDF.js} +2 -2
  81. package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-AEOFBBWO.js} +6 -8
  82. package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-AEOFBBWO.js.map} +1 -1
  83. package/dist/cli-bundle/chunks/chunk-ASMRSIDX.js +10498 -0
  84. package/dist/cli-bundle/chunks/chunk-ASMRSIDX.js.map +7 -0
  85. package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-BFNFTHWQ.js} +3 -3
  86. package/dist/cli-bundle/chunks/chunk-BPJ5NYSJ.js +5509 -0
  87. package/dist/cli-bundle/chunks/chunk-BPJ5NYSJ.js.map +7 -0
  88. package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-C3YU3TXX.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-C6XSTACC.js} +11 -7
  90. package/dist/cli-bundle/chunks/chunk-C6XSTACC.js.map +7 -0
  91. package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-CGDUIPJL.js} +3 -3
  92. package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-CXH7EMSB.js} +5 -7
  93. package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-CXH7EMSB.js.map} +1 -1
  94. package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-D63PEJTB.js} +256 -36
  95. package/dist/cli-bundle/chunks/chunk-D63PEJTB.js.map +1 -0
  96. package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-D6J5673C.js} +7 -9
  97. package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-D6J5673C.js.map} +1 -1
  98. package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-DUBC6TI3.js} +28 -34
  99. package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-DUBC6TI3.js.map} +1 -1
  100. package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-EEJKHF7M.js} +7 -6
  101. package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-EEJKHF7M.js.map} +2 -2
  102. package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EP2CKDS7.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-EYPIUFWJ.js} +24 -32
  104. package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-EYPIUFWJ.js.map} +1 -1
  105. package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-F5DDGY6R.js} +6 -6
  106. package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-F5DDGY6R.js.map} +1 -1
  107. package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-FFB3WITE.js} +10 -16
  108. package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-FFB3WITE.js.map} +1 -1
  109. package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-FJR2S7S4.js} +10 -14
  110. package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-FJR2S7S4.js.map} +1 -1
  111. package/dist/cli-bundle/chunks/chunk-FL625JJM.js +6792 -0
  112. package/dist/cli-bundle/chunks/chunk-FL625JJM.js.map +7 -0
  113. package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-FOJEBRDD.js} +16 -20
  114. package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-FOJEBRDD.js.map} +1 -1
  115. package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-G4FKP4ID.js} +1220 -398
  116. package/dist/cli-bundle/chunks/chunk-G4FKP4ID.js.map +1 -0
  117. package/dist/cli-bundle/chunks/chunk-GE44TQMC.js +6726 -0
  118. package/dist/cli-bundle/chunks/chunk-GE44TQMC.js.map +1 -0
  119. package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-GLMJLBLR.js} +6 -10
  120. package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-GLMJLBLR.js.map} +1 -1
  121. package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-GO2X6ZRB.js} +4 -6
  122. package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-GO2X6ZRB.js.map} +1 -1
  123. package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-GQOKFX2G.js} +22 -26
  124. package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-GQOKFX2G.js.map} +1 -1
  125. package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-GSQVQINP.js} +8 -10
  126. package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-GSQVQINP.js.map} +1 -1
  127. package/dist/cli-bundle/chunks/chunk-HI27UADG.js +5434 -0
  128. package/dist/cli-bundle/chunks/chunk-HI27UADG.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-HZZ3AC27.js} +6 -6
  130. package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-HZZ3AC27.js.map} +1 -1
  131. package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-IINCZYM3.js} +8 -12
  132. package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-IINCZYM3.js.map} +1 -1
  133. package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-INOWVPUD.js} +37 -16
  134. package/dist/cli-bundle/chunks/chunk-INOWVPUD.js.map +1 -0
  135. package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-IYRG5AEC.js} +15 -23
  136. package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-IYRG5AEC.js.map} +1 -1
  137. package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-J6AD3GWC.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-JH5XDDYS.js} +14 -20
  139. package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-JH5XDDYS.js.map} +1 -1
  140. package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-JYVPLGOW.js} +9 -11
  141. package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-JYVPLGOW.js.map} +1 -1
  142. package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-K52C6YPA.js} +12 -18
  143. package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-K52C6YPA.js.map} +1 -1
  144. package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-KFL3XHMA.js} +2 -2
  145. package/dist/cli-bundle/chunks/chunk-KMXVZ2P7.js +10320 -0
  146. package/dist/cli-bundle/chunks/chunk-KMXVZ2P7.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-LD2NBQ5T.js} +6 -8
  148. package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-LD2NBQ5T.js.map} +1 -1
  149. package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-LG4N6YOK.js} +8 -7
  150. package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-LG4N6YOK.js.map} +1 -1
  151. package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-LHDHS4Z6.js} +10 -14
  152. package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-LHDHS4Z6.js.map} +1 -1
  153. package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-MCH6IKK7.js} +4 -6
  154. package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-MCH6IKK7.js.map} +1 -1
  155. package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-MFLLULHU.js} +281 -233
  156. package/dist/cli-bundle/chunks/chunk-MFLLULHU.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-ML27MHNM.js} +35 -17
  158. package/dist/cli-bundle/chunks/chunk-ML27MHNM.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-MYHFZNBO.js} +20 -24
  160. package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-MYHFZNBO.js.map} +1 -1
  161. package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-NGBWEYNY.js} +12 -18
  162. package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-NGBWEYNY.js.map} +1 -1
  163. package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-NRMDT4OV.js} +10 -14
  164. package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-NRMDT4OV.js.map} +1 -1
  165. package/dist/cli-bundle/chunks/chunk-NTOOEVJ4.js +5359 -0
  166. package/dist/cli-bundle/chunks/chunk-NTOOEVJ4.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-P2WE5KCU.js} +261 -34
  168. package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-P2WE5KCU.js.map} +4 -4
  169. package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-PAWPLIWW.js} +14 -20
  170. package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-PAWPLIWW.js.map} +1 -1
  171. package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-PCBZ2VJD.js} +7 -7
  172. package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-PJPZTE7P.js} +1216 -387
  173. package/dist/cli-bundle/chunks/chunk-PJPZTE7P.js.map +7 -0
  174. package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-Q3CFSOQZ.js} +7 -7
  175. package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-QJZM5WO5.js} +5 -5
  176. package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-QJZM5WO5.js.map} +2 -2
  177. package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-QLEH6FTQ.js} +6 -6
  178. package/dist/cli-bundle/chunks/chunk-QLEH6FTQ.js.map +7 -0
  179. package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-QYZMZD4L.js} +10 -12
  180. package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-QYZMZD4L.js.map} +1 -1
  181. package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-RDJXIAJB.js} +7 -11
  182. package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-RDJXIAJB.js.map} +1 -1
  183. package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-RFHLRMLQ.js} +6 -8
  184. package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-RFHLRMLQ.js.map} +1 -1
  185. package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-RL24NAUX.js} +10 -12
  186. package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-RL24NAUX.js.map} +1 -1
  187. package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-RLHQ3G4M.js} +99 -51
  188. package/dist/cli-bundle/chunks/chunk-RLHQ3G4M.js.map +7 -0
  189. package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-SCJPFQQT.js} +12 -18
  190. package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-SCJPFQQT.js.map} +1 -1
  191. package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-SIQGG335.js} +12 -16
  192. package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-SIQGG335.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-SN5X5GTU.js} +8 -12
  194. package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-SN5X5GTU.js.map} +1 -1
  195. package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-TKWTJGD6.js} +36 -15
  196. package/dist/cli-bundle/chunks/chunk-TKWTJGD6.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-TR2C6V5T.js} +37 -19
  198. package/dist/cli-bundle/chunks/chunk-TR2C6V5T.js.map +7 -0
  199. package/dist/cli-bundle/chunks/chunk-TTCJCKUJ.js +5514 -0
  200. package/dist/cli-bundle/chunks/chunk-TTCJCKUJ.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-TU5P744I.js} +4 -4
  202. package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-TUDAYIO7.js} +529 -46
  203. package/dist/cli-bundle/chunks/chunk-TUDAYIO7.js.map +1 -0
  204. package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-U72GF3I2.js} +12 -8
  205. package/dist/cli-bundle/chunks/chunk-U72GF3I2.js.map +1 -0
  206. package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-UCRYCT5M.js} +30 -36
  207. package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-UCRYCT5M.js.map} +1 -1
  208. package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-UEATYUZW.js} +2 -2
  209. package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-UFNFHCAC.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-UH6VFRV6.js} +5 -7
  211. package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-UH6VFRV6.js.map} +1 -1
  212. package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-UIHDZS6X.js} +11 -15
  213. package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-UIHDZS6X.js.map} +1 -1
  214. package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-UURYLDDC.js} +14 -18
  215. package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-UURYLDDC.js.map} +1 -1
  216. package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-UVFJSKTF.js} +9 -13
  217. package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-UVFJSKTF.js.map} +1 -1
  218. package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-W2VFNVSJ.js} +6 -8
  219. package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-W2VFNVSJ.js.map} +1 -1
  220. package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-WVEMZZCR.js} +5 -5
  221. package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-WVEMZZCR.js.map} +2 -2
  222. package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-XN5BEN2B.js} +94 -53
  223. package/dist/cli-bundle/chunks/chunk-XN5BEN2B.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XPSGJ4IV.js} +541 -44
  225. package/dist/cli-bundle/chunks/chunk-XPSGJ4IV.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-YQEKE4FO.js} +13 -21
  227. package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-YQEKE4FO.js.map} +1 -1
  228. package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-YR5R4FMQ.js} +26 -34
  229. package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-YR5R4FMQ.js.map} +1 -1
  230. package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-YSRXFGNV.js} +7 -9
  231. package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-YSRXFGNV.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-YUCKM3MD.js} +10 -14
  233. package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-YUCKM3MD.js.map} +1 -1
  234. package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-YUMNZS3X.js} +6 -8
  235. package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-YUMNZS3X.js.map} +1 -1
  236. package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-Z2JQH2MG.js} +2 -2
  237. package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-Z6RLSNUX.js} +4 -6
  238. package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-Z6RLSNUX.js.map} +1 -1
  239. package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-ZMOPZFVT.js} +4 -4
  240. package/dist/cli-bundle/chunks/close-E3RLZSP2.js +12 -0
  241. package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-K6BFI3OX.js} +5 -9
  242. package/dist/cli-bundle/chunks/close-many-6NBL3PM4.js +26 -0
  243. package/dist/cli-bundle/chunks/close-many-X4YKS3RO.js +22 -0
  244. package/dist/cli-bundle/chunks/comments-PLFK5ZKK.js +17 -0
  245. package/dist/cli-bundle/chunks/comments-ZNOD5PTV.js +13 -0
  246. package/dist/cli-bundle/chunks/copy-F7BUFY4J.js +9 -0
  247. package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-VH3L4MN2.js} +4 -8
  248. package/dist/cli-bundle/chunks/create-AMBMYP6F.js +25 -0
  249. package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-TRIBYORN.js} +9 -14
  250. package/dist/cli-bundle/chunks/delete-6KQHZYIP.js +10 -0
  251. package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-ZNXUNCZR.js} +4 -8
  252. package/dist/cli-bundle/chunks/deps-CVDY7FFK.js +13 -0
  253. package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-SZXQHV73.js} +4 -8
  254. package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-DR74ITCD.js} +6 -10
  255. package/dist/cli-bundle/chunks/docs-WCVYY6I7.js +14 -0
  256. package/dist/cli-bundle/chunks/files-H5YCA74Z.js +18 -0
  257. package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-QEFQ2M3H.js} +6 -10
  258. package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-55TRYSNA.js} +7 -9
  259. package/dist/cli-bundle/chunks/focus-N2QGNS5D.js +10 -0
  260. package/dist/cli-bundle/chunks/history-compact-GWQ4UOEI.js +21 -0
  261. package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-JJZ4EFL3.js} +9 -13
  262. package/dist/cli-bundle/chunks/history-redact-4GJOLXCM.js +17 -0
  263. package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-TPPUT3A5.js} +7 -11
  264. package/dist/cli-bundle/chunks/history-repair-HVCVCGUF.js +19 -0
  265. package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-J7PIZ6ZP.js} +9 -13
  266. package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-KB6BT4NR.js} +9 -11
  267. package/dist/cli-bundle/chunks/learnings-YYY3U2Y7.js +13 -0
  268. package/dist/cli-bundle/chunks/notes-BGG7VL72.js +13 -0
  269. package/dist/cli-bundle/chunks/notes-ZTHXVOKM.js +17 -0
  270. package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-CJPKFRBK.js} +10 -15
  271. package/dist/cli-bundle/chunks/plan-MK2QY3GA.js +24 -0
  272. package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-AQNHXOYA.js} +9 -13
  273. package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-HTBFINKQ.js} +9 -13
  274. package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-EEF33SUJ.js} +43 -34
  275. package/dist/cli-bundle/chunks/register-list-query-EEF33SUJ.js.map +1 -0
  276. package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-S4FBWIWN.js} +42 -33
  277. package/dist/cli-bundle/chunks/register-list-query-S4FBWIWN.js.map +7 -0
  278. package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-L5Q7AUDN.js} +34 -39
  279. package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-L5Q7AUDN.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-QFLRBCI7.js} +36 -41
  281. package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-QFLRBCI7.js.map} +1 -1
  282. package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-HDE4FVW4.js} +79 -46
  283. package/dist/cli-bundle/chunks/register-operations-HDE4FVW4.js.map +1 -0
  284. package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-QDU43FCG.js} +78 -45
  285. package/dist/cli-bundle/chunks/register-operations-QDU43FCG.js.map +7 -0
  286. package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-EGMTAXDC.js} +134 -32
  287. package/dist/cli-bundle/chunks/register-setup-EGMTAXDC.js.map +1 -0
  288. package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-PNIO3L2P.js} +133 -31
  289. package/dist/cli-bundle/chunks/register-setup-PNIO3L2P.js.map +7 -0
  290. package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-BTBEZ5CK.js} +7 -11
  291. package/dist/cli-bundle/chunks/restore-EX4UUZL6.js +15 -0
  292. package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DGSTYYQB.js} +6 -10
  293. package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-HAIBEE24.js} +6 -10
  294. package/dist/cli-bundle/chunks/update-MP4XLU56.js +25 -0
  295. package/dist/cli-bundle/chunks/update-SDIRJGSY.js +21 -0
  296. package/dist/cli-bundle/chunks/update-many-34AIU6W7.js +31 -0
  297. package/dist/cli-bundle/chunks/update-many-JUPCNOKV.js +35 -0
  298. package/dist/cli-bundle/main.js +56 -32
  299. package/dist/cli-bundle/main.js.map +2 -2
  300. package/dist/cli-bundle/sdk-runtime.js +161 -107
  301. package/dist/cli-bundle/sdk-testing.js +7 -8
  302. package/dist/cli-bundle/sdk.js +154 -117
  303. package/dist/cli-bundle/sdk.js.map +2 -2
  304. package/dist/core/extensions/extension-types.d.ts +1 -0
  305. package/dist/core/extensions/extension-types.js +2 -2
  306. package/dist/core/extensions/extension-types.js.map +1 -1
  307. package/dist/core/extensions/loader.js +268 -231
  308. package/dist/core/extensions/loader.js.map +1 -1
  309. package/dist/core/history/drift-scan.js +3 -8
  310. package/dist/core/history/drift-scan.js.map +1 -1
  311. package/dist/core/output/mutation-projection.js +11 -5
  312. package/dist/core/output/mutation-projection.js.map +1 -1
  313. package/dist/core/search/cache.js +3 -3
  314. package/dist/core/search/cache.js.map +1 -1
  315. package/dist/core/search/semantic-defaults.d.ts +2 -0
  316. package/dist/core/search/semantic-defaults.js +11 -4
  317. package/dist/core/search/semantic-defaults.js.map +1 -1
  318. package/dist/core/search/vector-stores.d.ts +1 -1
  319. package/dist/core/search/vector-stores.js +33 -7
  320. package/dist/core/search/vector-stores.js.map +1 -1
  321. package/dist/mcp/server.d.ts +1 -1
  322. package/dist/sdk/cli-contracts/commander-types.js +3 -3
  323. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  324. package/dist/sdk/cli-contracts/flag-contracts.js +12 -8
  325. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  326. package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -2
  327. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  328. package/dist/sdk/cli-contracts/tool-schema.js +14 -8
  329. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  330. package/dist/sdk/index.d.ts +1 -1
  331. package/dist/sdk/index.js +3 -3
  332. package/dist/sdk/index.js.map +1 -1
  333. package/dist/sdk/runtime.d.ts +282 -8
  334. package/dist/sdk/runtime.js +453 -14
  335. package/dist/sdk/runtime.js.map +1 -1
  336. package/dist/sdk/start-task-status.d.ts +13 -0
  337. package/dist/sdk/start-task-status.js +19 -0
  338. package/dist/sdk/start-task-status.js.map +1 -0
  339. package/docs/COMMANDS.md +10 -1
  340. package/docs/EXTENSIONS.md +7 -20
  341. package/docs/RELEASING.md +6 -0
  342. package/docs/SDK.md +65 -0
  343. package/docs/TESTING.md +3 -0
  344. package/package.json +2 -1
  345. package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
  346. package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
  347. package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
  348. package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
  349. package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
  350. package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
  351. package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
  352. package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
  353. package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
  354. package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
  355. package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
  356. package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
  357. package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
  358. package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
  359. package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
  360. package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
  362. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
  363. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
  364. package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
  365. package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
  366. package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
  367. package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
  368. package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
  369. package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
  370. package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
  372. package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
  373. package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
  374. package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
  375. package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
  376. package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
  377. package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
  378. package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
  379. package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
  380. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
  381. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
  382. package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
  383. package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
  384. package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
  385. package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
  386. package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
  387. package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
  388. package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
  389. package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
  390. package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
  391. package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
  392. package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
  393. package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
  394. package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
  395. package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
  396. package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
  397. package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
  398. package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
  399. package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
  400. package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
  401. package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
  402. package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
  403. package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
  404. package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
  405. package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
  406. package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
  407. package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
  408. package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
  409. package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
  410. package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
  411. package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
  412. package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
  413. package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
  414. package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
  415. package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
  416. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
  417. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
  418. package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
  419. package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
  420. package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
  421. package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
  422. package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
  423. package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
  424. package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
  425. package/dist/cli-bundle/chunks/chunk-LK6XLOGP.js.map +0 -7
  426. package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
  427. package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
  428. package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
  429. package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
  430. package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
  431. package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
  432. package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
  433. package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
  434. package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
  435. package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
  436. package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
  437. package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
  438. package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
  439. package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
  440. package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
  442. package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
  443. package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
  444. package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
  446. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
  447. package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
  448. package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
  450. package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
  451. package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
  452. package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
  453. package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
  455. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
  457. package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
  459. package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
  461. package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
  463. package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
  466. package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
  468. package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
  469. package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
  470. package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
  472. package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
  473. package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
  474. package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
  475. package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
  476. package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
  478. package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
  479. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
  480. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
  482. package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
  484. package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
  485. package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
  486. package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
  488. package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
  489. package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
  490. package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
  491. package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
  492. package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
  493. package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
  494. package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
  495. package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
  496. package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
  497. package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
  498. package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
  499. package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
  500. package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
  501. package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
  502. package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
  503. package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
  504. package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
  505. package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
  506. package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
  507. package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
  508. package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
  509. package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
  510. package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
  511. package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
  512. package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
  513. package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
  514. package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
  515. package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
  516. package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
  517. package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
  518. package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
  519. package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
  520. package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
  521. package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
  522. package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
  523. package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
  524. package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
  525. package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
  526. package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
  527. package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
  528. package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
  529. package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
  530. package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
  531. package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
  532. package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
  533. package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
  534. package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
  535. package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
  536. package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
  537. package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
  538. package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
  539. package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
  540. package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
  541. package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
  542. package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
  543. package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
  544. package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
  545. package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
  546. package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
  547. package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
  548. package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
  549. package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
  550. package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
  551. package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
  552. package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
  553. package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
  554. package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
  555. package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
  556. package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
  557. package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
  558. package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
  559. package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
  560. package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
  561. package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
  562. package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
  563. package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
  564. package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
  565. package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
  566. package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
  567. package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
  568. package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
  569. package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
  570. package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
  571. package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
  572. package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
  573. package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
  574. package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
  575. package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
  576. package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
  577. package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
  578. package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
  579. package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
  580. package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
  581. package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
  582. package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
  583. package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
  584. package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
  585. package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
  586. package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
  587. package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
  588. package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
  589. package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
  590. package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
  591. package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
  592. package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
  593. package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
  594. package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
  595. package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
  596. package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
  597. package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
  598. package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
  599. package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
  600. package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
  601. package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
  602. package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
  603. package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
  604. package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
  605. package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
  606. package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
  607. package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
  608. package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
  609. package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
  610. package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
  611. package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
  612. package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
  613. package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
  614. package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
  615. package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
  616. package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
  617. package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
  618. package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
  619. package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
  620. package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
  621. package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
  622. package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
  623. /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-CDPAYYSB.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-RSPHC423.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-3FUXM574.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-3SHDAKMF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-3V5C7PUH.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-4I7KS5ES.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-5STY7NVM.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-5VAZHYVQ.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-6RR4XM5H.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-7QKSLAHB.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-7UCBLJDF.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-BFNFTHWQ.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-C3YU3TXX.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-CGDUIPJL.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EP2CKDS7.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-J6AD3GWC.js.map} +0 -0
  639. /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-KFL3XHMA.js.map} +0 -0
  640. /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-PCBZ2VJD.js.map} +0 -0
  641. /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-Q3CFSOQZ.js.map} +0 -0
  642. /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-TU5P744I.js.map} +0 -0
  643. /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-UEATYUZW.js.map} +0 -0
  644. /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-UFNFHCAC.js.map} +0 -0
  645. /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-Z2JQH2MG.js.map} +0 -0
  646. /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-ZMOPZFVT.js.map} +0 -0
  647. /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-E3RLZSP2.js.map} +0 -0
  648. /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-K6BFI3OX.js.map} +0 -0
  649. /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-6NBL3PM4.js.map} +0 -0
  650. /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-X4YKS3RO.js.map} +0 -0
  651. /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-PLFK5ZKK.js.map} +0 -0
  652. /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-ZNOD5PTV.js.map} +0 -0
  653. /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-F7BUFY4J.js.map} +0 -0
  654. /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-VH3L4MN2.js.map} +0 -0
  655. /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AMBMYP6F.js.map} +0 -0
  656. /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-TRIBYORN.js.map} +0 -0
  657. /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-6KQHZYIP.js.map} +0 -0
  658. /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-ZNXUNCZR.js.map} +0 -0
  659. /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-CVDY7FFK.js.map} +0 -0
  660. /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-SZXQHV73.js.map} +0 -0
  661. /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-DR74ITCD.js.map} +0 -0
  662. /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-WCVYY6I7.js.map} +0 -0
  663. /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-H5YCA74Z.js.map} +0 -0
  664. /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-QEFQ2M3H.js.map} +0 -0
  665. /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-55TRYSNA.js.map} +0 -0
  666. /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-N2QGNS5D.js.map} +0 -0
  667. /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-GWQ4UOEI.js.map} +0 -0
  668. /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-JJZ4EFL3.js.map} +0 -0
  669. /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-4GJOLXCM.js.map} +0 -0
  670. /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-TPPUT3A5.js.map} +0 -0
  671. /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-HVCVCGUF.js.map} +0 -0
  672. /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-J7PIZ6ZP.js.map} +0 -0
  673. /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-KB6BT4NR.js.map} +0 -0
  674. /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-YYY3U2Y7.js.map} +0 -0
  675. /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-BGG7VL72.js.map} +0 -0
  676. /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-ZTHXVOKM.js.map} +0 -0
  677. /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-CJPKFRBK.js.map} +0 -0
  678. /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-MK2QY3GA.js.map} +0 -0
  679. /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-AQNHXOYA.js.map} +0 -0
  680. /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-HTBFINKQ.js.map} +0 -0
  681. /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-BTBEZ5CK.js.map} +0 -0
  682. /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-EX4UUZL6.js.map} +0 -0
  683. /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DGSTYYQB.js.map} +0 -0
  684. /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-HAIBEE24.js.map} +0 -0
  685. /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-MP4XLU56.js.map} +0 -0
  686. /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-SDIRJGSY.js.map} +0 -0
  687. /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-34AIU6W7.js.map} +0 -0
  688. /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-JUPCNOKV.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 agent-guidance summary plus generated next-step hints returned by init.\n */\nexport type InitAgentGuidanceResult = InitAgentGuidanceSummary & { next_steps: string[] };\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: InitAgentGuidanceResult;\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: InitAgentGuidanceResult;\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\ninterface InitNormalizedOptions {\n presetFromOption: BuiltinGovernancePreset | undefined;\n useDefaults: boolean;\n authorFromOption: string | undefined;\n installBundledPackages: boolean;\n agentGuidanceMode: InitAgentGuidanceMode;\n typePreset: InitTypePresetName | undefined;\n}\n\ninterface InitSettingsResolution {\n settings: PmSettings;\n normalizedPrefix: string;\n chosenPreset: BuiltinGovernancePreset | undefined;\n wizardUsed: boolean;\n}\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 ensureInitDirectories(pmRoot: string, subdirs: readonly string[]): Promise<{\n createdDirs: string[];\n warnings: string[];\n}> {\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n for (const subdir of 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 return { createdDirs, warnings };\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\nfunction normalizeInitCommandOptions(options: InitCommandOptions): InitNormalizedOptions {\n return {\n presetFromOption: normalizeInitGovernancePreset(options.preset),\n useDefaults: options.defaults === true,\n authorFromOption: normalizeOptionalInitAuthor(options.author),\n installBundledPackages: options.withPackages === true,\n agentGuidanceMode: normalizeInitAgentGuidanceMode(options.agentGuidance),\n typePreset: normalizeInitTypePreset(options.typePreset),\n };\n}\n\nfunction collectExistingSettingsPendingChanges(params: {\n settings: PmSettings;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n presetFromOption: BuiltinGovernancePreset | undefined;\n authorFromOption: string | undefined;\n}): string[] {\n const pendingChanges: string[] = [];\n if (params.prefixArg !== undefined && params.settings.id_prefix !== params.normalizedPrefix) {\n pendingChanges.push(\"id_prefix\");\n }\n if (params.presetFromOption !== undefined && params.settings.governance.preset !== params.presetFromOption) {\n pendingChanges.push(\"governance_preset\");\n }\n if (params.authorFromOption !== undefined && params.settings.author_default !== params.authorFromOption) {\n pendingChanges.push(\"author_default\");\n }\n return pendingChanges;\n}\n\nfunction assertExistingSettingsUpdateAllowed(settingsPath: string, pendingChanges: string[], force: boolean): void {\n if (pendingChanges.length === 0 || force) {\n return;\n }\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\nfunction applyExistingSettingsUpdates(params: {\n settings: PmSettings;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n presetFromOption: BuiltinGovernancePreset | undefined;\n authorFromOption: string | undefined;\n warnings: string[];\n}): boolean {\n let changed = false;\n if (params.prefixArg !== undefined && params.settings.id_prefix !== params.normalizedPrefix) {\n params.settings.id_prefix = params.normalizedPrefix;\n params.warnings.push(`updated:id_prefix:${params.normalizedPrefix}`);\n changed = true;\n }\n if (params.presetFromOption !== undefined && params.settings.governance.preset !== params.presetFromOption) {\n applyGovernancePreset(params.settings, params.presetFromOption);\n params.warnings.push(`updated:governance_preset:${params.presetFromOption}`);\n changed = true;\n }\n if (params.authorFromOption !== undefined && params.settings.author_default !== params.authorFromOption) {\n params.settings.author_default = params.authorFromOption;\n params.warnings.push(`updated:author_default:${params.authorFromOption}`);\n changed = true;\n }\n return changed;\n}\n\nasync function loadExistingInitSettings(params: {\n pmRoot: string;\n settingsPath: string;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n options: InitCommandOptions;\n normalizedOptions: InitNormalizedOptions;\n warnings: string[];\n}): Promise<InitSettingsResolution> {\n const settings = await readSettings(params.pmRoot);\n params.warnings.push(`already_exists:${params.settingsPath}`);\n const pendingChanges = collectExistingSettingsPendingChanges({\n settings,\n normalizedPrefix: params.normalizedPrefix,\n prefixArg: params.prefixArg,\n presetFromOption: params.normalizedOptions.presetFromOption,\n authorFromOption: params.normalizedOptions.authorFromOption,\n });\n assertExistingSettingsUpdateAllowed(params.settingsPath, pendingChanges, params.options.force === true);\n if (\n applyExistingSettingsUpdates({\n settings,\n normalizedPrefix: params.normalizedPrefix,\n prefixArg: params.prefixArg,\n presetFromOption: params.normalizedOptions.presetFromOption,\n authorFromOption: params.normalizedOptions.authorFromOption,\n warnings: params.warnings,\n })\n ) {\n await writeSettings(params.pmRoot, settings);\n }\n return {\n settings,\n normalizedPrefix: params.normalizedPrefix,\n chosenPreset: params.normalizedOptions.presetFromOption,\n wizardUsed: false,\n };\n}\n\nasync function createNewInitSettings(params: {\n pmRoot: string;\n normalizedPrefix: string;\n normalizedOptions: InitNormalizedOptions;\n}): Promise<InitSettingsResolution> {\n let normalizedPrefix = params.normalizedPrefix;\n let chosenPreset = params.normalizedOptions.presetFromOption;\n let chosenTelemetryEnabled: boolean | undefined;\n let wizardUsed = false;\n if (\n params.normalizedOptions.presetFromOption === undefined &&\n !params.normalizedOptions.useDefaults &&\n process.stdin.isTTY === true &&\n process.stdout.isTTY === true\n ) {\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 const settings = cloneDefaults();\n settings.id_prefix = normalizedPrefix;\n applyGovernancePreset(settings, effectivePreset);\n if (params.normalizedOptions.authorFromOption !== undefined) {\n settings.author_default = params.normalizedOptions.authorFromOption;\n }\n if (chosenTelemetryEnabled !== undefined) {\n settings.telemetry.enabled = chosenTelemetryEnabled;\n settings.telemetry.first_run_prompt_completed = true;\n }\n await writeSettings(params.pmRoot, settings);\n return {\n settings,\n normalizedPrefix,\n chosenPreset,\n wizardUsed,\n };\n}\n\nasync function resolveInitSettings(params: {\n pmRoot: string;\n settingsPath: string;\n settingsExists: boolean;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n options: InitCommandOptions;\n normalizedOptions: InitNormalizedOptions;\n warnings: string[];\n}): Promise<InitSettingsResolution> {\n if (params.settingsExists) {\n return await loadExistingInitSettings(params);\n }\n return await createNewInitSettings({\n pmRoot: params.pmRoot,\n normalizedPrefix: params.normalizedPrefix,\n normalizedOptions: params.normalizedOptions,\n });\n}\n\nasync function applyInitAgentGuidance(params: {\n pmRoot: string;\n cwd: string;\n agentGuidanceMode: InitAgentGuidanceMode;\n settings: PmSettings;\n warnings: string[];\n}): Promise<InitAgentGuidanceResult> {\n const agentGuidanceResult = await runInitAgentGuidance({\n pm_root: params.pmRoot,\n cwd: params.cwd,\n mode: params.agentGuidanceMode,\n interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,\n settings: params.settings,\n });\n params.warnings.push(...agentGuidanceResult.warnings);\n if (agentGuidanceResult.settings_changed) {\n await writeSettings(params.pmRoot, params.settings);\n }\n return {\n ...agentGuidanceResult.summary,\n next_steps: agentGuidanceResult.next_steps,\n };\n}\n\nasync function ensureInitRuntimeSchemaFiles(\n pmRoot: string,\n settings: PmSettings,\n): Promise<{\n createdDirs: string[];\n warnings: string[];\n}> {\n const createdDirs: string[] = [];\n const warnings: string[] = [];\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 return { createdDirs, warnings };\n}\n\nasync function maybeRegisterInitTypePreset(params: {\n pmRoot: string;\n settings: PmSettings;\n typePreset: InitTypePresetName | undefined;\n warnings: string[];\n}): Promise<InitRegisteredTypePresetSummary | undefined> {\n if (params.typePreset === undefined) {\n return undefined;\n }\n const registeredTypePreset = await registerInitTypePreset(params.pmRoot, params.settings, params.typePreset);\n params.warnings.push(`registered_type_preset:${params.typePreset}`);\n params.warnings.push(\n ...(await runActiveOnWriteHooks({\n path: registeredTypePreset.file,\n scope: \"project\",\n op: \"init:type_preset\",\n })),\n );\n return registeredTypePreset;\n}\n\nasync function ensureInitTypeDirectories(params: {\n pmRoot: string;\n settings: PmSettings;\n createdDirs: string[];\n warnings: string[];\n}): Promise<void> {\n const typeRegistry = resolveItemTypeRegistry(params.settings, getActiveExtensionRegistrations());\n const customTypeFolders = typeRegistry.folders.filter((folder) => !(PM_REQUIRED_SUBDIRS as readonly string[]).includes(folder));\n const scaffold = await ensureInitDirectories(params.pmRoot, customTypeFolders);\n params.createdDirs.push(...scaffold.createdDirs);\n params.warnings.push(...scaffold.warnings);\n}\n\nasync function maybeInstallInitBundledPackages(\n installBundledPackages: boolean,\n global: GlobalOptions,\n warnings: string[],\n): Promise<InitInstalledPackagesSummary | undefined> {\n if (!installBundledPackages) {\n return undefined;\n }\n const packageInstallResult = await runExtension(\"all\", { install: true, project: true }, global);\n warnings.push(...packageInstallResult.warnings);\n const 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 return installedPackages;\n}\n\nfunction buildInitNextSteps(params: {\n installBundledPackages: boolean;\n registeredTypePreset: InitRegisteredTypePresetSummary | undefined;\n agentGuidanceNextSteps: string[];\n}): string[] {\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 (!params.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 (params.registeredTypePreset) {\n nextSteps.push(`Inspect registered preset types: pm schema list, pm schema show ${params.registeredTypePreset.registered[0] ?? params.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 params.agentGuidanceNextSteps) {\n if (!nextSteps.includes(guidanceNextStep)) {\n nextSteps.push(guidanceNextStep);\n }\n }\n return nextSteps;\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 const baseDirs = await ensureInitDirectories(pmRoot, PM_REQUIRED_SUBDIRS);\n createdDirs.push(...baseDirs.createdDirs);\n warnings.push(...baseDirs.warnings);\n\n const settingsPath = path.join(pmRoot, \"settings.json\");\n const settingsExists = await pathExists(settingsPath);\n const normalizedOptions = normalizeInitCommandOptions(options);\n const settingsResolution = await resolveInitSettings({\n pmRoot,\n settingsPath,\n settingsExists,\n normalizedPrefix: normalizePrefix(prefixArg),\n prefixArg,\n options,\n normalizedOptions,\n warnings,\n });\n let { settings } = settingsResolution;\n\n const agentGuidance = await applyInitAgentGuidance({\n pmRoot,\n cwd,\n agentGuidanceMode: normalizedOptions.agentGuidanceMode,\n settings,\n warnings,\n });\n\n const schemaFiles = await ensureInitRuntimeSchemaFiles(pmRoot, settings);\n createdDirs.push(...schemaFiles.createdDirs);\n warnings.push(...schemaFiles.warnings);\n\n const registeredTypePreset = await maybeRegisterInitTypePreset({\n pmRoot,\n settings,\n typePreset: normalizedOptions.typePreset,\n warnings,\n });\n if (registeredTypePreset) {\n settings = await readSettings(pmRoot);\n }\n\n await ensureInitTypeDirectories({ pmRoot, settings, createdDirs, warnings });\n const installedPackages = await maybeInstallInitBundledPackages(normalizedOptions.installBundledPackages, global, warnings);\n\n const nextSteps = buildInitNextSteps({\n installBundledPackages: normalizedOptions.installBundledPackages,\n registeredTypePreset,\n agentGuidanceNextSteps: agentGuidance.next_steps,\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: settingsResolution.wizardUsed,\n ...(registeredTypePreset ? { registered_type_preset: registeredTypePreset } : {}),\n ...(installedPackages ? { installed_packages: installedPackages } : {}),\n next_steps: nextSteps,\n agent_guidance: agentGuidance,\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 -->\";\nconst AGENT_GUIDANCE_ADD_LATER_HINT = \"Add workflow guidance later: pm init --agent-guidance add\";\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\nfunction buildInitAgentGuidanceSummary(params: {\n mode: InitAgentGuidanceMode;\n scans: AgentGuidanceFileScan[];\n projectRoot: string;\n targetRelativePath: string;\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n state: PmSettings[\"agent_guidance\"];\n}): InitAgentGuidanceSummary {\n return {\n mode: params.mode,\n present: params.scans.some((entry) => entry.has_guidance),\n prompted: params.prompted,\n applied: params.applied,\n skipped: params.skipped,\n declined: params.state.declined,\n prompt_completed: params.state.prompt_completed,\n template_version: params.state.template_version,\n target_file: params.targetRelativePath,\n checked_files: params.scans.map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n files_with_guidance: params.scans\n .filter((entry) => entry.has_guidance)\n .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n missing_files: params.scans\n .filter((entry) => !entry.exists)\n .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n };\n}\n\nasync function refreshGuidanceScansAfterApply(\n applied: boolean,\n scans: AgentGuidanceFileScan[],\n projectRoot: string,\n): Promise<AgentGuidanceFileScan[]> {\n return applied ? await scanGuidanceFiles(projectRoot) : scans;\n}\n\ninterface InitAgentGuidanceFlowState {\n warnings: string[];\n nextSteps: string[];\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n state: PmSettings[\"agent_guidance\"];\n}\n\ninterface InitAgentGuidanceModeContext {\n mode: InitAgentGuidanceMode;\n interactive: boolean;\n targetPath: string;\n targetRelativePath: string;\n checkedFiles: string[];\n presentBefore: boolean;\n}\n\nfunction markAgentGuidanceRunState(\n flow: InitAgentGuidanceFlowState,\n checkedFiles: string[],\n partial: Partial<PmSettings[\"agent_guidance\"]>,\n): void {\n flow.state = {\n ...flow.state,\n ...partial,\n template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: checkedFiles,\n };\n}\n\nasync function addAgentGuidanceBlockIfMissing(\n flow: InitAgentGuidanceFlowState,\n context: Pick<InitAgentGuidanceModeContext, \"presentBefore\" | \"targetPath\" | \"targetRelativePath\">,\n): Promise<void> {\n if (context.presentBefore) {\n return;\n }\n const writeResult = await writeGuidanceFile(context.targetPath);\n flow.warnings.push(...writeResult.warnings);\n if (writeResult.changed) {\n flow.applied = true;\n flow.warnings.push(`agent_guidance:added:${context.targetRelativePath}`);\n }\n}\n\nfunction handleAgentGuidanceStatusMode(flow: InitAgentGuidanceFlowState, presentBefore: boolean): void {\n if (!presentBefore) {\n flow.warnings.push(\"agent_guidance:missing\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n }\n}\n\nfunction handleAgentGuidanceSkipMode(flow: InitAgentGuidanceFlowState, checkedFiles: string[]): void {\n flow.skipped = true;\n markAgentGuidanceRunState(flow, checkedFiles, {\n prompt_completed: true,\n declined: true,\n declined_at: flow.state.declined_at || new Date().toISOString(),\n });\n flow.warnings.push(\"agent_guidance:explicit_skip\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function handleAgentGuidanceAddMode(\n flow: InitAgentGuidanceFlowState,\n context: InitAgentGuidanceModeContext,\n): Promise<void> {\n await addAgentGuidanceBlockIfMissing(flow, context);\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n}\n\nfunction handlePresentAgentGuidance(flow: InitAgentGuidanceFlowState, checkedFiles: string[]): void {\n if (flow.state.declined) {\n markAgentGuidanceRunState(flow, checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n }\n}\n\nfunction handleDeclinedAgentGuidance(flow: InitAgentGuidanceFlowState): void {\n flow.skipped = true;\n flow.warnings.push(\"agent_guidance:skipped_declined\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function handleInteractiveAgentGuidancePrompt(\n flow: InitAgentGuidanceFlowState,\n context: InitAgentGuidanceModeContext,\n): Promise<void> {\n flow.prompted = true;\n const approved = await promptForGuidanceWrite(context.targetRelativePath);\n if (approved) {\n await addAgentGuidanceBlockIfMissing(flow, context);\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n return;\n }\n flow.skipped = true;\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: true,\n declined_at: new Date().toISOString(),\n });\n flow.warnings.push(\"agent_guidance:declined\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nfunction handleNonInteractiveMissingAgentGuidance(flow: InitAgentGuidanceFlowState): void {\n flow.warnings.push(\"agent_guidance:missing_non_interactive\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function applyAgentGuidanceMode(\n initialState: PmSettings[\"agent_guidance\"],\n context: InitAgentGuidanceModeContext,\n): Promise<InitAgentGuidanceFlowState> {\n const flow: InitAgentGuidanceFlowState = {\n warnings: [],\n nextSteps: [],\n prompted: false,\n applied: false,\n skipped: false,\n state: initialState,\n };\n\n if (context.mode === \"status\") {\n handleAgentGuidanceStatusMode(flow, context.presentBefore);\n return flow;\n }\n if (context.mode === \"skip\") {\n handleAgentGuidanceSkipMode(flow, context.checkedFiles);\n return flow;\n }\n if (context.mode === \"add\") {\n await handleAgentGuidanceAddMode(flow, context);\n return flow;\n }\n if (context.presentBefore) {\n handlePresentAgentGuidance(flow, context.checkedFiles);\n return flow;\n }\n if (flow.state.prompt_completed && flow.state.declined) {\n handleDeclinedAgentGuidance(flow);\n return flow;\n }\n if (context.interactive) {\n await handleInteractiveAgentGuidancePrompt(flow, context);\n return flow;\n }\n handleNonInteractiveMissingAgentGuidance(flow);\n return flow;\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 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 checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));\n const presentBefore = scans.some((entry) => entry.has_guidance);\n const flow = await applyAgentGuidanceMode(normalizeAgentGuidanceState(options.settings), {\n mode: options.mode,\n interactive: options.interactive,\n targetPath,\n targetRelativePath,\n checkedFiles,\n presentBefore,\n });\n\n const stateUpdate = applyAgentGuidanceState(options.settings, flow.state);\n scans = await refreshGuidanceScansAfterApply(flow.applied, scans, projectRoot);\n\n const summary = buildInitAgentGuidanceSummary({\n mode: options.mode,\n scans,\n projectRoot,\n targetRelativePath,\n prompted: flow.prompted,\n applied: flow.applied,\n skipped: flow.skipped,\n state: flow.state,\n });\n\n return {\n summary,\n warnings: flow.warnings,\n next_steps: flow.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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF,IAAM,0CAA0C;AAChD,IAAM,kCAAkC;AACxC,IAAM,qCAAqC;AAC3C,IAAM,8BAA8B,qCAAqC,+BAA+B;AACxG,IAAM,4BAA4B;AAClC,IAAM,gCAAgC;AAqBtC,IAAI,uCAAuC,MAAsC,SAAS,gBAAgB,EAAE,OAAO,OAAM,CAAE;AAyD3H,SAAS,uBAAuB,aAAqB,YAAkB;AACrE,QAAM,WAAW,KAAK,S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,mBAAmB;IAChC,GAAI,uBAAuB,EAAE,wBAAwB,qBAAoB,IAAK,CAAA;IAC9E,GAAI,oBAAoB,EAAE,oBAAoB,kBAAiB,IAAK,CAAA;IACpE,YAAY;IACZ,gBAAgB;;AAEpB","debugId":"60eff3e2-3dae-547d-af75-15d1de75a9b5"}
@@ -1,296 +0,0 @@
1
-
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="839b2e78-dad6-599a-a130-572fe274a7d7")}catch(e){}}();
3
- import {
4
- collectBlockedByIds,
5
- computeActionabilityReport
6
- } from "./chunk-Y46GD4IX.js";
7
- import {
8
- buildChildrenByParent,
9
- collectSubtreeIds,
10
- compareCriticalItems,
11
- toContextFocusItem
12
- } from "./chunk-MXYA5SAJ.js";
13
- import {
14
- runList
15
- } from "./chunk-3VHSI5FL.js";
16
- import {
17
- parseIntegerLimit
18
- } from "./chunk-22KBU3MW.js";
19
- import {
20
- normalizeStatusForRegistry,
21
- normalizeStatusInput
22
- } from "./chunk-G24G7ZAV.js";
23
- import {
24
- nowIso
25
- } from "./chunk-3GCS5SKL.js";
26
- import {
27
- PmCliError,
28
- readSettings
29
- } from "./chunk-E3SZTQ4K.js";
30
- import {
31
- EXIT_CODE,
32
- resolvePmRoot,
33
- resolveRuntimeStatusRegistry
34
- } from "./chunk-57NWPFF2.js";
35
-
36
- // dist/cli/commands/next.js
37
- var NEXT_OUTPUT_VALUES = ["markdown", "toon", "json"];
38
- var DEFAULT_NEXT_LIMIT = 5;
39
- var MS_PER_DAY = 24 * 60 * 60 * 1e3;
40
- function parseNextOutputFormat(raw) {
41
- if (!raw)
42
- return void 0;
43
- const normalized = raw.trim().toLowerCase();
44
- if (!NEXT_OUTPUT_VALUES.includes(normalized)) {
45
- throw new PmCliError("Next format must be one of markdown|toon|json", EXIT_CODE.USAGE);
46
- }
47
- return normalized;
48
- }
49
- function resolveNextOutputFormat(options, global) {
50
- const commandFormat = parseNextOutputFormat(options.format);
51
- if (global.json && commandFormat && commandFormat !== "json") {
52
- throw new PmCliError("Cannot combine --json with --format markdown|toon", EXIT_CODE.USAGE);
53
- }
54
- if (global.json) {
55
- return "json";
56
- }
57
- return commandFormat ?? "toon";
58
- }
59
- function parseNextLimit(raw, flag, fallback) {
60
- const parsed = parseIntegerLimit(raw, flag);
61
- if (parsed === void 0 || parsed <= 0)
62
- return fallback;
63
- return parsed;
64
- }
65
- function toNextActionableItem(entry, statusRegistry, childrenByParent) {
66
- return {
67
- ...toContextFocusItem(entry.item, statusRegistry, childrenByParent),
68
- open_blocker_count: entry.open_blockers.length,
69
- blockers: entry.open_blockers.map((blocker) => ({ id: blocker.id, title: blocker.title, status: blocker.status })),
70
- unblocks: entry.unblocks
71
- };
72
- }
73
- function buildRecommendationReasons(entry, statusRegistry, now, completedContainer) {
74
- const item = entry.item;
75
- const reasons = [];
76
- const inProgressStatus = normalizeStatusInput("in_progress", statusRegistry);
77
- reasons.push(normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus ? "in progress \u2014 resume to finish" : "open and ready to start");
78
- if (completedContainer) {
79
- reasons.push("completed container \u2014 governance closeout");
80
- }
81
- reasons.push(`priority p${item.priority}${item.priority === 0 ? " (highest)" : ""}`);
82
- if (typeof item.deadline === "string" && item.deadline.trim().length > 0) {
83
- reasons.push(describeDeadline(item.deadline, now));
84
- }
85
- reasons.push(collectBlockedByIds(item).length > 0 ? "all blockers resolved" : "no blockers");
86
- if (typeof item.parent === "string" && item.parent.trim().length > 0) {
87
- reasons.push(`advances ${item.parent.trim()}`);
88
- }
89
- if (entry.unblocks.length > 0) {
90
- reasons.push(`unblocks ${entry.unblocks.length} item(s): ${entry.unblocks.join(", ")}`);
91
- }
92
- return reasons;
93
- }
94
- function describeDeadline(deadline, now) {
95
- const deadlineMs = Date.parse(deadline);
96
- if (!Number.isFinite(deadlineMs)) {
97
- return `deadline ${deadline.trim()}`;
98
- }
99
- const dateToken = new Date(deadlineMs).toISOString().slice(0, 10);
100
- const nowToken = new Date(Date.parse(now)).toISOString().slice(0, 10);
101
- const days = Math.round((Date.parse(dateToken) - Date.parse(nowToken)) / MS_PER_DAY);
102
- if (days < 0)
103
- return `deadline ${dateToken} (overdue ${-days}d)`;
104
- if (days === 0)
105
- return `deadline ${dateToken} (due today)`;
106
- return `deadline ${dateToken} (in ${days}d)`;
107
- }
108
- function inProgressReadyCount(ready, statusRegistry) {
109
- const inProgressStatus = normalizeStatusInput("in_progress", statusRegistry);
110
- return ready.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus).length;
111
- }
112
- function hasCompletedDescendants(item, childrenByParent) {
113
- return (childrenByParent.get(item.id.trim().toLowerCase()) ?? []).length > 0;
114
- }
115
- function nextListOptions(options, extra) {
116
- return {
117
- type: options.type,
118
- tag: options.tag,
119
- priority: options.priority,
120
- assignee: options.assignee,
121
- assigneeFilter: options.assigneeFilter,
122
- sprint: options.sprint,
123
- release: options.release,
124
- noTruncate: true,
125
- ...extra
126
- };
127
- }
128
- function rankNextReadyEntries(ready, childrenByParent, statusRegistry) {
129
- return [...ready].sort((left, right) => {
130
- const leftCompletedContainer = hasCompletedDescendants(left.item, childrenByParent);
131
- const rightCompletedContainer = hasCompletedDescendants(right.item, childrenByParent);
132
- if (leftCompletedContainer !== rightCompletedContainer) {
133
- return Number(leftCompletedContainer) - Number(rightCompletedContainer);
134
- }
135
- return compareCriticalItems(left.item, right.item, statusRegistry);
136
- });
137
- }
138
- function buildNextRecommendation(params) {
139
- if (params.projectedReady.length === 0) {
140
- return null;
141
- }
142
- return {
143
- ...params.readyRows[0],
144
- reasons: buildRecommendationReasons(params.projectedReady[0], params.statusRegistry, params.now, params.completedContainer)
145
- };
146
- }
147
- function buildNextSuggestions(recommended, blockedRows) {
148
- if (recommended !== null) {
149
- return void 0;
150
- }
151
- if (blockedRows.length > 0) {
152
- return [
153
- `${blockedRows.length} item(s) are blocked; unblock the top one by closing ${blockedRows[0].blockers.map((blocker) => blocker.id).join(", ")}`,
154
- "pm next --ready-only after a blocker closes to re-check ready work",
155
- 'pm create --type Task --title "..." to add new ready work'
156
- ];
157
- }
158
- return [
159
- 'pm create --type Task --title "..." to add a new work item',
160
- "pm list --status in_progress to review work already underway",
161
- "pm context --depth deep for the full project snapshot"
162
- ];
163
- }
164
- function filterCandidatesByParentScope(candidates, corpus, parentScope) {
165
- if (!parentScope) {
166
- return candidates;
167
- }
168
- const subtree = collectSubtreeIds(corpus, parentScope);
169
- if (!subtree.found) {
170
- throw new PmCliError(`Next --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);
171
- }
172
- return candidates.filter((item) => subtree.ids.has(item.id.trim().toLowerCase()));
173
- }
174
- async function runNext(options, global) {
175
- const pmRoot = resolvePmRoot(process.cwd(), global.path);
176
- const settings = await readSettings(pmRoot);
177
- const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
178
- const now = nowIso();
179
- const limit = parseNextLimit(options.limit, "--limit", DEFAULT_NEXT_LIMIT);
180
- const blockedLimit = parseNextLimit(options.blockedLimit, "--blocked-limit", limit);
181
- const readyOnly = options.readyOnly === true;
182
- const parentScope = typeof options.parent === "string" ? options.parent.trim() : "";
183
- const candidatesList = await runList(void 0, nextListOptions(options, { excludeTerminal: true }), global);
184
- const corpusList = await runList(void 0, { excludeTerminal: false, noTruncate: true }, global);
185
- const candidates = filterCandidatesByParentScope(candidatesList.items, corpusList.items, parentScope);
186
- const corpus = corpusList.items;
187
- const report = computeActionabilityReport(candidates, corpus, statusRegistry);
188
- const childrenByParent = buildChildrenByParent(corpus);
189
- const rankedReady = rankNextReadyEntries(report.ready, childrenByParent, statusRegistry);
190
- const rankedBlocked = [...report.blocked].sort((left, right) => compareCriticalItems(left.item, right.item, statusRegistry));
191
- const concreteReady = rankedReady.filter((entry) => !hasCompletedDescendants(entry.item, childrenByParent));
192
- const projectedReady = concreteReady.length > 0 ? concreteReady : rankedReady;
193
- const readyRows = projectedReady.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));
194
- const blockedRows = rankedBlocked.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));
195
- const recommended = buildNextRecommendation({
196
- projectedReady,
197
- readyRows,
198
- statusRegistry,
199
- now,
200
- completedContainer: concreteReady.length === 0
201
- });
202
- const result = {
203
- output_default: "toon",
204
- now,
205
- recommended,
206
- ready: readyRows.slice(0, limit),
207
- blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),
208
- summary: {
209
- recommended: recommended !== null,
210
- ready: readyRows.length,
211
- blocked: blockedRows.length,
212
- in_progress: inProgressReadyCount(readyRows, statusRegistry),
213
- candidates: report.active_count,
214
- containers: report.container_count
215
- },
216
- filters: {
217
- type: options.type ?? null,
218
- tag: options.tag ?? null,
219
- priority: options.priority ?? null,
220
- assignee: options.assignee ?? null,
221
- assignee_filter: options.assigneeFilter ?? null,
222
- sprint: options.sprint ?? null,
223
- release: options.release ?? null,
224
- parent: parentScope.length > 0 ? parentScope : null,
225
- limit,
226
- blocked_limit: blockedLimit,
227
- ready_only: readyOnly
228
- }
229
- };
230
- const warnings = [.../* @__PURE__ */ new Set([...candidatesList.warnings ?? [], ...corpusList.warnings ?? []])].sort((a, b) => a.localeCompare(b));
231
- if (warnings.length > 0)
232
- result.warnings = warnings;
233
- result.suggestions = buildNextSuggestions(recommended, blockedRows);
234
- return result;
235
- }
236
- function renderNextMarkdown(result) {
237
- const lines = ["# pm next", ""];
238
- lines.push(`- now: ${result.now}`);
239
- lines.push(`- ready: ${result.summary.ready} (in_progress: ${result.summary.in_progress}), blocked: ${result.summary.blocked}, candidates: ${result.summary.candidates}`);
240
- if (result.filters.parent) {
241
- lines.push(`- scope: subtree of ${result.filters.parent}`);
242
- }
243
- lines.push("");
244
- lines.push("## Recommended");
245
- if (result.recommended) {
246
- lines.push(`- ${formatNextLine(result.recommended)}`);
247
- lines.push(` why: ${result.recommended.reasons.join("; ")}`);
248
- } else {
249
- lines.push("No ready work.");
250
- }
251
- lines.push("");
252
- lines.push("## Ready");
253
- if (result.ready.length === 0) {
254
- lines.push("No ready items.");
255
- } else {
256
- for (const item of result.ready) {
257
- lines.push(`- ${formatNextLine(item)}`);
258
- }
259
- }
260
- lines.push("");
261
- if (!result.filters.ready_only) {
262
- lines.push("## Blocked");
263
- if (result.blocked.length === 0) {
264
- lines.push("No blocked items.");
265
- } else {
266
- for (const item of result.blocked) {
267
- const by = item.blockers.map((blocker) => `${blocker.id}(${blocker.status ?? "?"})`).join(", ");
268
- lines.push(`- ${formatNextLine(item)} blocked_by:${by}`);
269
- }
270
- }
271
- lines.push("");
272
- }
273
- if (result.suggestions && result.suggestions.length > 0) {
274
- lines.push("## Suggestions");
275
- for (const suggestion of result.suggestions) {
276
- lines.push(`- ${suggestion}`);
277
- }
278
- }
279
- return lines.join("\n").trimEnd();
280
- }
281
- function formatNextLine(item) {
282
- const deadlineToken = item.deadline ?? "-";
283
- const parentToken = item.parent ? ` parent:${item.parent}` : "";
284
- const unblocksToken = item.unblocks.length > 0 ? ` unblocks:${item.unblocks.length}` : "";
285
- return `${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;
286
- }
287
-
288
- export {
289
- NEXT_OUTPUT_VALUES,
290
- resolveNextOutputFormat,
291
- runNext,
292
- renderNextMarkdown
293
- };
294
- //# sourceMappingURL=chunk-ML5X7DP2.js.map
295
-
296
- //# debugId=839b2e78-dad6-599a-a130-572fe274a7d7
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/next.ts"],"sourcesContent":["/**\n * @module cli/commands/next\n *\n * Implements the `pm next` command: the distilled \"what should I work on now?\"\n * query. It loads the active corpus, computes dependency-aware actionability\n * (ready vs blocked leaf work), and returns a single ranked recommendation with a\n * deterministic rationale plus the ranked ready/blocked queues — so an agent gets\n * the next action and the reason for it in one token-efficient read instead of\n * re-deriving readiness from a full `pm context` snapshot every turn.\n */\nimport {\n collectBlockedByIds,\n computeActionabilityReport,\n type ActionableEntry,\n} from \"../../core/item/actionability.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { normalizeStatusInput, normalizeStatusForRegistry } from \"../../core/item/status.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, ItemStatus } from \"../../types/index.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport {\n buildChildrenByParent,\n collectSubtreeIds,\n compareCriticalItems,\n toContextFocusItem,\n type ContextFocusItem,\n} from \"./context.js\";\nimport { runList, type ListOptions } from \"./list.js\";\n\nexport const NEXT_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\n/**\n * Restricts `pm next` output format values accepted by command, SDK, and storage contracts.\n */\nexport type NextOutputFormat = (typeof NEXT_OUTPUT_VALUES)[number];\n\nconst DEFAULT_NEXT_LIMIT = 5;\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/**\n * Documents the `pm next` options payload exchanged by command, SDK, and package integrations.\n */\nexport interface NextOptions {\n type?: string;\n tag?: string;\n priority?: string;\n assignee?: string;\n assigneeFilter?: string;\n sprint?: string;\n release?: string;\n parent?: string;\n limit?: string;\n blockedLimit?: string;\n readyOnly?: boolean;\n format?: string;\n [key: string]: unknown;\n}\n\n/** A blocker reference projected onto the `pm next` output. */\nexport interface NextBlockerRef {\n id: string;\n title: string | null;\n status: ItemStatus | null;\n}\n\n/**\n * A classified actionable item on the `pm next` output: a {@link ContextFocusItem}\n * focus row augmented with its open-blocker references and the downstream items it\n * would unblock.\n */\nexport interface NextActionableItem extends ContextFocusItem {\n open_blocker_count: number;\n blockers: NextBlockerRef[];\n unblocks: string[];\n}\n\n/** The single recommended next item: an actionable row plus its rationale. */\nexport interface NextRecommendation extends NextActionableItem {\n reasons: string[];\n}\n\ninterface NextSummary {\n recommended: boolean;\n ready: number;\n blocked: number;\n in_progress: number;\n candidates: number;\n containers: number;\n}\n\n/**\n * Documents the `pm next` result payload exchanged by command, SDK, and package integrations.\n */\nexport interface NextResult {\n output_default: \"toon\";\n now: string;\n recommended: NextRecommendation | null;\n ready: NextActionableItem[];\n blocked: NextActionableItem[];\n summary: NextSummary;\n filters: {\n type: string | null;\n tag: string | null;\n priority: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n sprint: string | null;\n release: string | null;\n parent: string | null;\n limit: number;\n blocked_limit: number;\n ready_only: boolean;\n };\n suggestions?: string[];\n warnings?: string[];\n}\n\nfunction parseNextOutputFormat(raw: string | undefined): NextOutputFormat | undefined {\n if (!raw) return undefined;\n const normalized = raw.trim().toLowerCase();\n if (!NEXT_OUTPUT_VALUES.includes(normalized as NextOutputFormat)) {\n throw new PmCliError(\"Next format must be one of markdown|toon|json\", EXIT_CODE.USAGE);\n }\n return normalized as NextOutputFormat;\n}\n\n/**\n * Resolves the effective `pm next` output format from the command `--format` flag\n * and the global `--json` switch, rejecting the contradictory `--json --format\n * markdown|toon` combination. Defaults to `toon`.\n */\nexport function resolveNextOutputFormat(options: NextOptions, global: GlobalOptions): NextOutputFormat {\n const commandFormat = parseNextOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\"Cannot combine --json with --format markdown|toon\", EXIT_CODE.USAGE);\n }\n if (global.json) {\n return \"json\";\n }\n return commandFormat ?? \"toon\";\n}\n\n// Per-section row cap. A non-positive or absent value falls back to the default;\n// invalid (non-integer) values throw via parseIntegerLimit.\nfunction parseNextLimit(raw: string | undefined, flag: string, fallback: number): number {\n const parsed = parseIntegerLimit(raw, flag);\n if (parsed === undefined || parsed <= 0) return fallback;\n return parsed;\n}\n\n// Projects an actionable entry onto its output row. Ready entries carry no\n// blockers; blocked entries surface their unresolved blockers for the agent.\nfunction toNextActionableItem(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n childrenByParent: Map<string, ItemFrontMatter[]>,\n): NextActionableItem {\n return {\n ...toContextFocusItem(entry.item, statusRegistry, childrenByParent),\n open_blocker_count: entry.open_blockers.length,\n blockers: entry.open_blockers.map((blocker) => ({ id: blocker.id, title: blocker.title, status: blocker.status })),\n unblocks: entry.unblocks,\n };\n}\n\n// Builds the human+agent readable rationale for the recommended item, ordering\n// clauses from most to least decisive (status, priority, deadline, blocker\n// clearance, parent advancement, downstream unblocks).\nfunction buildRecommendationReasons(\n entry: ActionableEntry,\n statusRegistry: RuntimeStatusRegistry,\n now: string,\n completedContainer: boolean,\n): string[] {\n const item = entry.item;\n const reasons: string[] = [];\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n reasons.push(\n normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus\n ? \"in progress — resume to finish\"\n : \"open and ready to start\",\n );\n if (completedContainer) {\n reasons.push(\"completed container — governance closeout\");\n }\n reasons.push(`priority p${item.priority}${item.priority === 0 ? \" (highest)\" : \"\"}`);\n if (typeof item.deadline === \"string\" && item.deadline.trim().length > 0) {\n reasons.push(describeDeadline(item.deadline, now));\n }\n reasons.push(collectBlockedByIds(item).length > 0 ? \"all blockers resolved\" : \"no blockers\");\n if (typeof item.parent === \"string\" && item.parent.trim().length > 0) {\n reasons.push(`advances ${item.parent.trim()}`);\n }\n if (entry.unblocks.length > 0) {\n reasons.push(`unblocks ${entry.unblocks.length} item(s): ${entry.unblocks.join(\", \")}`);\n }\n return reasons;\n}\n\n// Renders a deadline as a date token plus a relative tag (overdue/today/in Nd).\n// The relative delta is computed on UTC calendar dates (both sides normalized to\n// midnight) so a deadline due today never reads as \"overdue 1d\" just because the\n// wall-clock time of `now` has passed midnight. Unparseable deadlines degrade to\n// the raw token (defensive — stored deadlines are always valid ISO).\nfunction describeDeadline(deadline: string, now: string): string {\n const deadlineMs = Date.parse(deadline);\n /* c8 ignore start -- defensive: a stored deadline that fails Date.parse still surfaces its raw token */\n if (!Number.isFinite(deadlineMs)) {\n return `deadline ${deadline.trim()}`;\n }\n /* c8 ignore stop */\n const dateToken = new Date(deadlineMs).toISOString().slice(0, 10);\n const nowToken = new Date(Date.parse(now)).toISOString().slice(0, 10);\n const days = Math.round((Date.parse(dateToken) - Date.parse(nowToken)) / MS_PER_DAY);\n if (days < 0) return `deadline ${dateToken} (overdue ${-days}d)`;\n if (days === 0) return `deadline ${dateToken} (due today)`;\n return `deadline ${dateToken} (in ${days}d)`;\n}\n\nfunction inProgressReadyCount(ready: NextActionableItem[], statusRegistry: RuntimeStatusRegistry): number {\n const inProgressStatus = normalizeStatusInput(\"in_progress\", statusRegistry);\n return ready.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus).length;\n}\n\n// Returns true when an otherwise-ready item still has terminal descendants. Such\n// rows are useful governance closeout context, but concrete leaf work should rank\n// ahead of them in the default agent loop.\nfunction hasCompletedDescendants(item: ItemFrontMatter, childrenByParent: Map<string, ItemFrontMatter[]>): boolean {\n return (childrenByParent.get(item.id.trim().toLowerCase()) ?? []).length > 0;\n}\n\n// Strips projection/pagination flags so the corpus reads stay full: limits are\n// per-section display caps applied after classification, never corpus filters.\nfunction nextListOptions(options: NextOptions, extra: Partial<ListOptions>): ListOptions {\n return {\n type: options.type,\n tag: options.tag,\n priority: options.priority,\n assignee: options.assignee,\n assigneeFilter: options.assigneeFilter,\n sprint: options.sprint,\n release: options.release,\n noTruncate: true,\n ...extra,\n };\n}\n\nfunction rankNextReadyEntries(\n ready: ActionableEntry[],\n childrenByParent: Map<string, ItemFrontMatter[]>,\n statusRegistry: RuntimeStatusRegistry,\n): ActionableEntry[] {\n return [...ready].sort((left, right) => {\n const leftCompletedContainer = hasCompletedDescendants(left.item, childrenByParent);\n const rightCompletedContainer = hasCompletedDescendants(right.item, childrenByParent);\n if (leftCompletedContainer !== rightCompletedContainer) {\n return Number(leftCompletedContainer) - Number(rightCompletedContainer);\n }\n return compareCriticalItems(left.item, right.item, statusRegistry);\n });\n}\n\nfunction buildNextRecommendation(params: {\n projectedReady: ActionableEntry[];\n readyRows: NextActionableItem[];\n statusRegistry: RuntimeStatusRegistry;\n now: string;\n completedContainer: boolean;\n}): NextRecommendation | null {\n if (params.projectedReady.length === 0) {\n return null;\n }\n return {\n ...params.readyRows[0],\n reasons: buildRecommendationReasons(\n params.projectedReady[0],\n params.statusRegistry,\n params.now,\n params.completedContainer,\n ),\n };\n}\n\nfunction buildNextSuggestions(recommended: NextRecommendation | null, blockedRows: NextActionableItem[]): string[] | undefined {\n if (recommended !== null) {\n return undefined;\n }\n if (blockedRows.length > 0) {\n return [\n `${blockedRows.length} item(s) are blocked; unblock the top one by closing ${blockedRows[0].blockers\n .map((blocker) => blocker.id)\n .join(\", \")}`,\n \"pm next --ready-only after a blocker closes to re-check ready work\",\n 'pm create --type Task --title \"...\" to add new ready work',\n ];\n }\n return [\n 'pm create --type Task --title \"...\" to add a new work item',\n \"pm list --status in_progress to review work already underway\",\n \"pm context --depth deep for the full project snapshot\",\n ];\n}\n\nfunction filterCandidatesByParentScope(\n candidates: ItemFrontMatter[],\n corpus: ItemFrontMatter[],\n parentScope: string,\n): ItemFrontMatter[] {\n if (!parentScope) {\n return candidates;\n }\n const subtree = collectSubtreeIds(corpus, parentScope);\n if (!subtree.found) {\n throw new PmCliError(`Next --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);\n }\n return candidates.filter((item) => subtree.ids.has(item.id.trim().toLowerCase()));\n}\n\n/**\n * Implements `pm next`: computes the ranked ready/blocked actionable queues and a\n * single recommended next item with rationale for the public runtime surface.\n */\nexport async function runNext(options: NextOptions, global: GlobalOptions): Promise<NextResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const now = nowIso();\n const limit = parseNextLimit(options.limit, \"--limit\", DEFAULT_NEXT_LIMIT);\n const blockedLimit = parseNextLimit(options.blockedLimit, \"--blocked-limit\", limit);\n const readyOnly = options.readyOnly === true;\n const parentScope = typeof options.parent === \"string\" ? options.parent.trim() : \"\";\n\n // Active (non-terminal) candidates honor the caller's filters; the corpus is the\n // FULL, UNFILTERED set (every status, every item) so blocker and descendant\n // resolution still sees items outside the caller's filters or --parent subtree —\n // otherwise a real blocker assigned to someone else (or a parent of a different\n // type) would be missing and the blocked item misread as ready.\n const candidatesList = await runList(undefined, nextListOptions(options, { excludeTerminal: true }), global);\n const corpusList = await runList(undefined, { excludeTerminal: false, noTruncate: true }, global);\n const candidates = filterCandidatesByParentScope(candidatesList.items as ItemFrontMatter[], corpusList.items as ItemFrontMatter[], parentScope);\n const corpus = corpusList.items as ItemFrontMatter[];\n\n const report = computeActionabilityReport(candidates, corpus, statusRegistry);\n const childrenByParent = buildChildrenByParent(corpus);\n const rankedReady = rankNextReadyEntries(report.ready, childrenByParent, statusRegistry);\n const rankedBlocked = [...report.blocked].sort((left, right) =>\n compareCriticalItems(left.item, right.item, statusRegistry),\n );\n const concreteReady = rankedReady.filter((entry) => !hasCompletedDescendants(entry.item, childrenByParent));\n const projectedReady = concreteReady.length > 0 ? concreteReady : rankedReady;\n\n const readyRows = projectedReady.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));\n const blockedRows = rankedBlocked.map((entry) => toNextActionableItem(entry, statusRegistry, childrenByParent));\n\n const recommended = buildNextRecommendation({\n projectedReady,\n readyRows,\n statusRegistry,\n now,\n completedContainer: concreteReady.length === 0,\n });\n\n const result: NextResult = {\n output_default: \"toon\",\n now,\n recommended,\n ready: readyRows.slice(0, limit),\n blocked: readyOnly ? [] : blockedRows.slice(0, blockedLimit),\n summary: {\n recommended: recommended !== null,\n ready: readyRows.length,\n blocked: blockedRows.length,\n in_progress: inProgressReadyCount(readyRows, statusRegistry),\n candidates: report.active_count,\n containers: report.container_count,\n },\n filters: {\n type: options.type ?? null,\n tag: options.tag ?? null,\n priority: options.priority ?? null,\n assignee: options.assignee ?? null,\n assignee_filter: options.assigneeFilter ?? null,\n sprint: options.sprint ?? null,\n release: options.release ?? null,\n parent: parentScope.length > 0 ? parentScope : null,\n limit,\n blocked_limit: blockedLimit,\n ready_only: readyOnly,\n },\n };\n\n const warnings = [...new Set([...(candidatesList.warnings ?? []), ...(corpusList.warnings ?? [])])].sort((a, b) =>\n a.localeCompare(b),\n );\n if (warnings.length > 0) result.warnings = warnings;\n\n result.suggestions = buildNextSuggestions(recommended, blockedRows);\n\n return result;\n}\n\n/**\n * Renders a {@link NextResult} as compact agent-readable markdown: the\n * recommendation with its rationale, the ranked ready queue, and (unless\n * `--ready-only`) the blocked queue annotated with each item's open blockers.\n */\nexport function renderNextMarkdown(result: NextResult): string {\n const lines: string[] = [\"# pm next\", \"\"];\n lines.push(`- now: ${result.now}`);\n lines.push(\n `- ready: ${result.summary.ready} (in_progress: ${result.summary.in_progress}), blocked: ${result.summary.blocked}, candidates: ${result.summary.candidates}`,\n );\n if (result.filters.parent) {\n lines.push(`- scope: subtree of ${result.filters.parent}`);\n }\n lines.push(\"\");\n\n lines.push(\"## Recommended\");\n if (result.recommended) {\n lines.push(`- ${formatNextLine(result.recommended)}`);\n lines.push(` why: ${result.recommended.reasons.join(\"; \")}`);\n } else {\n lines.push(\"No ready work.\");\n }\n lines.push(\"\");\n\n lines.push(\"## Ready\");\n if (result.ready.length === 0) {\n lines.push(\"No ready items.\");\n } else {\n for (const item of result.ready) {\n lines.push(`- ${formatNextLine(item)}`);\n }\n }\n lines.push(\"\");\n\n if (!result.filters.ready_only) {\n lines.push(\"## Blocked\");\n if (result.blocked.length === 0) {\n lines.push(\"No blocked items.\");\n } else {\n for (const item of result.blocked) {\n const by = item.blockers\n .map((blocker) => `${blocker.id}(${blocker.status ?? \"?\"})`)\n .join(\", \");\n lines.push(`- ${formatNextLine(item)} blocked_by:${by}`);\n }\n }\n lines.push(\"\");\n }\n\n if (result.suggestions && result.suggestions.length > 0) {\n lines.push(\"## Suggestions\");\n for (const suggestion of result.suggestions) {\n lines.push(`- ${suggestion}`);\n }\n }\n\n return lines.join(\"\\n\").trimEnd();\n}\n\n// Formats a single actionable row: id, priority, status, type, deadline, parent,\n// downstream-unblock count, and title. Mirrors the context focus-line shape.\nfunction formatNextLine(item: NextActionableItem): string {\n const deadlineToken = item.deadline ?? \"-\";\n const parentToken = item.parent ? ` parent:${item.parent}` : \"\";\n const unblocksToken = item.unblocks.length > 0 ? ` unblocks:${item.unblocks.length}` : \"\";\n return `${item.id} p${item.priority} ${item.status} ${item.type} deadline:${deadlineToken}${parentToken}${unblocksToken} ${item.title}`;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,IAAM,qBAAqB,CAAC,YAAY,QAAQ,MAAM;AAM7D,IAAM,qBAAqB;AAC3B,IAAM,aAAa,KAAK,KAAK,KAAK;AAgFlC,SAAS,sBAAsB,KAAuB;AACpD,MAAI,CAAC;AAAK,WAAO;AACjB,QAAM,aAAa,IAAI,KAAI,EAAG,YAAW;AACzC,MAAI,CAAC,mBAAmB,SAAS,UAA8B,GAAG;AAChE,UAAM,IAAI,WAAW,iDAAiD,UAAU,KAAK;EACvF;AACA,SAAO;AACT;AAOM,SAAU,wBAAwB,SAAsB,QAAqB;AACjF,QAAM,gBAAgB,sBAAsB,QAAQ,MAAM;AAC1D,MAAI,OAAO,QAAQ,iBAAiB,kBAAkB,QAAQ;AAC5D,UAAM,IAAI,WAAW,qDAAqD,UAAU,KAAK;EAC3F;AACA,MAAI,OAAO,MAAM;AACf,WAAO;EACT;AACA,SAAO,iBAAiB;AAC1B;AAIA,SAAS,eAAe,KAAyB,MAAc,UAAgB;AAC7E,QAAM,SAAS,kBAAkB,KAAK,IAAI;AAC1C,MAAI,WAAW,UAAa,UAAU;A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AAO;AAC/B,YAAM,KAAK,KAAK,eAAe,IAAI,CAAC,EAAE;IACxC;EACF;AACA,QAAM,KAAK,EAAE;AAEb,MAAI,CAAC,OAAO,QAAQ,YAAY;AAC9B,UAAM,KAAK,YAAY;AACvB,QAAI,OAAO,QAAQ,WAAW,GAAG;AAC/B,YAAM,KAAK,mBAAmB;IAChC,OAAO;AACL,iBAAW,QAAQ,OAAO,SAAS;AACjC,cAAM,KAAK,KAAK,SACb,IAAI,CAAC,YAAY,GAAG,QAAQ,EAAE,IAAI,QAAQ,UAAU,GAAG,GAAG,EAC1D,KAAK,IAAI;AACZ,cAAM,KAAK,KAAK,eAAe,IAAI,CAAC,eAAe,EAAE,EAAE;MACzD;IACF;AACA,UAAM,KAAK,EAAE;EACf;AAEA,MAAI,OAAO,eAAe,OAAO,YAAY,SAAS,GAAG;AACvD,UAAM,KAAK,gBAAgB;AAC3B,eAAW,cAAc,OAAO,aAAa;AAC3C,YAAM,KAAK,KAAK,UAAU,EAAE;IAC9B;EACF;AAEA,SAAO,MAAM,KAAK,IAAI,EAAE,QAAO;AACjC;AAIA,SAAS,eAAe,MAAwB;AAC9C,QAAM,gBAAgB,KAAK,YAAY;AACvC,QAAM,cAAc,KAAK,SAAS,WAAW,KAAK,MAAM,KAAK;AAC7D,QAAM,gBAAgB,KAAK,SAAS,SAAS,IAAI,aAAa,KAAK,SAAS,MAAM,KAAK;AACvF,SAAO,GAAG,KAAK,EAAE,KAAK,KAAK,QAAQ,IAAI,KAAK,MAAM,IAAI,KAAK,IAAI,aAAa,aAAa,GAAG,WAAW,GAAG,aAAa,IAAI,KAAK,KAAK;AACvI","debugId":"839b2e78-dad6-599a-a130-572fe274a7d7"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../core/output/mutation-projection.ts","../../../../../../../../core/output/output.ts"],"sourcesContent":["/**\n * Shared projection helper for mutation command results.\n *\n * Mutation commands (create/update/close/append/update-many) return a result\n * envelope that carries a `changed_fields` string array. On create this array simply\n * re-lists every field the command just set, which the item echo above it already\n * shows, so for high-volume agent loops it is ~50% redundant payload. This helper\n * lets the CLI (`--no-changed-fields`) and the MCP agent path trim that array down\n * to a deterministic `changed_field_count` without losing mutation evidence.\n *\n * Compaction is deliberately scoped to the mutation envelope only:\n * - the envelope's own top-level `changed_fields` (create/update/close/append), and\n * - `rows[*].changed_fields` (update-many reports its delta per row).\n * It does NOT recurse into arbitrary nested objects, so unrelated payloads that\n * legitimately carry `changed_fields` (for example `pm history --diff` entries, or a\n * custom runtime metadata field) are left untouched.\n *\n * The helper is pure and side-effect free, reused by both the output layer and the\n * MCP server, and returns the original reference unchanged when nothing is compacted.\n */\n\n/** Controls whether mutation output keeps full changed fields or compact counts. */\nexport type ChangedFieldsMode = \"full\" | \"compact\";\n\n/**\n * Documents the mutation projection options payload exchanged by command, SDK, and package integrations.\n */\nexport interface MutationProjectionOptions {\n /** Defaults to \"full\" (unchanged output). \"compact\" drops the array, keeping a count. */\n changedFields?: ChangedFieldsMode;\n /** Return only id/status for single-item mutation envelopes. */\n idOnly?: boolean;\n}\n\nconst CHANGED_FIELDS_KEY = \"changed_fields\";\nconst CHANGED_FIELD_COUNT_KEY = \"changed_field_count\";\nconst ROWS_KEY = \"rows\";\nconst UPDATE_MANY_MUTATION_MODES = new Set([\"apply\", \"rollback\"]);\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype;\n}\n\n/** Replace a single envelope's own top-level `changed_fields` array with a count. */\nfunction compactOwnChangedFields(envelope: Record<string, unknown>): Record<string, unknown> | null {\n const changedFields = envelope[CHANGED_FIELDS_KEY];\n if (!Array.isArray(changedFields)) {\n return null;\n }\n const projected: Record<string, unknown> =\n Object.getPrototypeOf(envelope) === null ? Object.create(null) : {};\n for (const [key, value] of Object.entries(envelope)) {\n if (key !== CHANGED_FIELDS_KEY) {\n projected[key] = value;\n }\n }\n projected[CHANGED_FIELD_COUNT_KEY] = changedFields.length;\n return projected;\n}\n\nfunction isMutationEnvelope(value: Record<string, unknown>): boolean {\n return \"item\" in value && Array.isArray(value[CHANGED_FIELDS_KEY]);\n}\n\nfunction isUpdateManyMutationEnvelope(value: Record<string, unknown>): boolean {\n return (\n typeof value.mode === \"string\" &&\n UPDATE_MANY_MUTATION_MODES.has(value.mode) &&\n Array.isArray(value[ROWS_KEY])\n );\n}\n\nfunction replaceRows(envelope: Record<string, unknown>, rows: unknown[]): Record<string, unknown> {\n const projected: Record<string, unknown> =\n Object.getPrototypeOf(envelope) === null ? Object.create(null) : {};\n Object.assign(projected, envelope);\n projected[ROWS_KEY] = rows;\n return projected;\n}\n\nfunction projectIdOnlyResult(result: unknown): unknown | null {\n if (!isPlainObject(result) || !isPlainObject(result.item)) {\n return null;\n }\n const id = typeof result.item.id === \"string\" ? result.item.id : undefined;\n const status = typeof result.item.status === \"string\" ? result.item.status : undefined;\n if (!id) {\n return null;\n }\n return status ? { id, status } : { id };\n}\n\nfunction compactUpdateManyRows(envelope: Record<string, unknown>): { projected: Record<string, unknown>; changed: boolean } {\n const rows = isUpdateManyMutationEnvelope(envelope) ? envelope[ROWS_KEY] : undefined;\n if (!Array.isArray(rows)) {\n return { projected: envelope, changed: false };\n }\n let rowsChanged = false;\n const nextRows = rows.map((row) => {\n if (!isPlainObject(row)) {\n return row;\n }\n const compactedRow = compactOwnChangedFields(row);\n if (compactedRow) {\n rowsChanged = true;\n return compactedRow;\n }\n return row;\n });\n return rowsChanged\n ? { projected: replaceRows(envelope, nextRows), changed: true }\n : { projected: envelope, changed: false };\n}\n\n/**\n * Returns a copy of a mutation result with the envelope `changed_fields` arrays\n * replaced by `changed_field_count` when compact mode is requested. Inputs that are\n * not a mutation envelope (or full mode) are returned unchanged (same reference).\n */\nexport function projectMutationResult(result: unknown, options: MutationProjectionOptions = {}): unknown {\n if (options.idOnly === true) {\n const idOnly = projectIdOnlyResult(result);\n if (idOnly !== null) {\n return idOnly;\n }\n }\n\n const mode = options.changedFields ?? \"full\";\n if (mode === \"full\" || !isPlainObject(result)) {\n return result;\n }\n\n let changed = false;\n let projected: Record<string, unknown> = result;\n\n const compactedTop = isMutationEnvelope(result) ? compactOwnChangedFields(result) : null;\n if (compactedTop !== null) {\n projected = compactedTop;\n changed = true;\n }\n\n const rowProjection = compactUpdateManyRows(projected);\n if (rowProjection.changed) {\n projected = rowProjection.projected;\n changed = true;\n }\n\n return changed ? projected : result;\n}\n","/**\n * @module core/output/output\n *\n * Formats compact human and machine output for Output.\n */\nimport {\n runActiveCommandOverride,\n runActiveRendererOverride,\n runActiveServiceOverrideSync,\n setActiveCommandResult,\n} from \"../extensions/index.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { projectMutationResult } from \"./mutation-projection.js\";\n\n/**\n * Documents the output options payload exchanged by command, SDK, and package integrations.\n */\nexport interface OutputOptions {\n json?: boolean;\n quiet?: boolean;\n /** When true, mutation results drop the verbose changed_fields array (keeps changed_field_count). */\n noChangedFields?: boolean;\n /** When true, single-item mutation results print only id and status. */\n idOnly?: boolean;\n defaultOutputFormat?: \"toon\" | \"json\";\n command?: string;\n commandArgs?: string[];\n commandOptions?: Record<string, unknown>;\n pmRoot?: string;\n}\n\ninterface NodeLikeError {\n code?: string;\n}\n\nconst NATIVE_OUTPUT_MARKER = \"__pm_native_output\";\n\nlet streamErrorHandlersInstalled = false;\ntype OutputStreamTarget = \"stdout\" | \"stderr\";\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction shouldUseNativeOutput(result: unknown): boolean {\n return isPlainObject(result) && result[NATIVE_OUTPUT_MARKER] === true;\n}\n\nfunction stripNativeOutputMarker<T>(result: T): T {\n if (!isPlainObject(result) || result[NATIVE_OUTPUT_MARKER] !== true) {\n return result;\n }\n const { [NATIVE_OUTPUT_MARKER]: _marker, ...rest } = result;\n return rest as T;\n}\n\nfunction isBrokenPipeError(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && (error as NodeLikeError).code === \"EPIPE\";\n}\n\nfunction markStdoutBrokenPipeExitCode(): void {\n if (process.exitCode === undefined || process.exitCode === EXIT_CODE.SUCCESS) {\n process.exitCode = EXIT_CODE.SUCCESS;\n }\n}\n\nfunction markStderrBrokenPipeExitCode(): void {\n if (process.exitCode === undefined || process.exitCode === EXIT_CODE.SUCCESS) {\n process.exitCode = EXIT_CODE.GENERIC_FAILURE;\n }\n}\n\nfunction markBrokenPipeExitCode(target: OutputStreamTarget): void {\n if (target === \"stdout\") {\n markStdoutBrokenPipeExitCode();\n return;\n }\n markStderrBrokenPipeExitCode();\n}\n\nfunction handleUnhandledStreamError(error: unknown): void {\n const unhandled = error instanceof Error ? error : new Error(String(error));\n setImmediate(() => {\n throw unhandled;\n });\n}\n\nfunction installStreamErrorHandlers(): void {\n if (streamErrorHandlersInstalled) {\n return;\n }\n streamErrorHandlersInstalled = true;\n process.stdout.on(\"error\", (error: unknown) => {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(\"stdout\");\n return;\n }\n handleUnhandledStreamError(error);\n });\n process.stderr.on(\"error\", (error: unknown) => {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(\"stderr\");\n return;\n }\n handleUnhandledStreamError(error);\n });\n}\n\nfunction writeToStream(target: OutputStreamTarget, text: string): boolean {\n installStreamErrorHandlers();\n try {\n if (target === \"stdout\") {\n process.stdout.write(text);\n } else {\n process.stderr.write(text);\n }\n return true;\n } catch (error: unknown) {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(target);\n return false;\n }\n throw error;\n }\n}\n\n/**\n * Implements write stdout for the public runtime surface of this module.\n */\nexport function writeStdout(text: string): boolean {\n return writeToStream(\"stdout\", text);\n}\n\n/**\n * Implements write stderr for the public runtime surface of this module.\n */\nexport function writeStderr(text: string): boolean {\n return writeToStream(\"stderr\", text);\n}\n\nfunction renderScalar(value: unknown): string {\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n if (value === null) return \"null\";\n return JSON.stringify(value);\n}\n\nfunction compactToonValue(value: unknown): unknown | undefined {\n if (value === null || value === undefined) {\n return undefined;\n }\n\n if (Array.isArray(value)) {\n const compactedEntries = value\n .map((entry) => compactToonValue(entry))\n .filter((entry): entry is unknown => entry !== undefined);\n return compactedEntries.length > 0 ? compactedEntries : undefined;\n }\n\n if (isPlainObject(value)) {\n const compacted: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n const compactedEntry = compactToonValue(entry);\n if (compactedEntry !== undefined) {\n compacted[key] = compactedEntry;\n }\n }\n return Object.keys(compacted).length > 0 ? compacted : undefined;\n }\n\n return value;\n}\n\nfunction renderToonValue(value: unknown, depth: number): string {\n const indent = \" \".repeat(depth);\n\n if (Array.isArray(value)) {\n if (value.length === 0) return \"[]\";\n return value\n .map((entry) => {\n if (!isPlainObject(entry) && !Array.isArray(entry)) {\n return `${indent}- ${renderScalar(entry)}`;\n }\n const rendered = renderToonValue(entry, depth + 1);\n const lines = rendered.split(\"\\n\");\n const [firstLine, ...rest] = lines;\n if (rest.length === 0) {\n return `${indent}- ${firstLine.trimStart()}`;\n }\n return `${indent}- ${firstLine.trimStart()}\\n${rest.join(\"\\n\")}`;\n })\n .join(\"\\n\");\n }\n\n if (isPlainObject(value)) {\n const entries = Object.entries(value);\n if (entries.length === 0) return \"{}\";\n return entries\n .map(([key, entry]) => {\n if (!isPlainObject(entry) && !Array.isArray(entry)) {\n return `${indent}${key}: ${renderScalar(entry)}`;\n }\n if (Array.isArray(entry) && entry.length === 0) {\n return `${indent}${key}: []`;\n }\n if (isPlainObject(entry) && Object.keys(entry).length === 0) {\n return `${indent}${key}: {}`;\n }\n return `${indent}${key}:\\n${renderToonValue(entry, depth + 1)}`;\n })\n .join(\"\\n\");\n }\n\n return `${indent}${renderScalar(value)}`;\n}\n\nfunction renderDefaultMarkdownResult(value: unknown): string | null {\n if (!isPlainObject(value) || value.output_default !== \"markdown\") {\n return null;\n }\n if (typeof value.view !== \"string\" || !Array.isArray(value.events) || !Array.isArray(value.days)) {\n return null;\n }\n const lines = [`# pm calendar (${value.view})`, \"\"];\n const summary = isPlainObject(value.summary) ? value.summary : {};\n lines.push(`- events: ${String(summary.events ?? 0)}`);\n lines.push(\"\");\n if (value.events.length === 0) {\n lines.push(\"No calendar events matched the selected filters.\");\n return `${lines.join(\"\\n\")}\\n`;\n }\n for (const event of value.events) {\n if (!isPlainObject(event)) {\n continue;\n }\n const kind = typeof event.kind === \"string\" ? event.kind : \"event\";\n const title = typeof event.item_title === \"string\" ? event.item_title : \"\";\n const itemId = typeof event.item_id === \"string\" ? event.item_id : \"\";\n const reminderText = typeof event.reminder_text === \"string\" && event.reminder_text.length > 0 ? ` ${event.reminder_text}` : \"\";\n lines.push(`- [${kind}] ${itemId} ${title}${reminderText}`.trim());\n }\n return `${lines.join(\"\\n\")}\\n`;\n}\n\n/**\n * Implements format output for the public runtime surface of this module.\n */\nexport function formatOutput(result: unknown, options: OutputOptions): string {\n const commandOverride = runActiveCommandOverride(result);\n const nativeOutput = shouldUseNativeOutput(commandOverride.result);\n const effectiveResult = stripNativeOutputMarker(commandOverride.result);\n setActiveCommandResult(effectiveResult);\n const format =\n options.json === true\n ? \"json\"\n : options.json === false\n ? \"toon\"\n : options.defaultOutputFormat === \"json\"\n ? \"json\"\n : \"toon\";\n const serviceOverride = nativeOutput ? { handled: false, result: effectiveResult } : runActiveServiceOverrideSync(\"output_format\", {\n command: options.command,\n args: options.commandArgs,\n command_options: options.commandOptions,\n global: { ...options },\n pm_root: options.pmRoot,\n format,\n options: { ...options },\n result: effectiveResult,\n });\n if (serviceOverride.handled && typeof serviceOverride.result === \"string\") {\n return serviceOverride.result.endsWith(\"\\n\") ? serviceOverride.result : `${serviceOverride.result}\\n`;\n }\n const outputResult = serviceOverride.handled ? serviceOverride.result : effectiveResult;\n if (format === \"toon\") {\n const markdownDefault = renderDefaultMarkdownResult(outputResult);\n if (markdownDefault !== null) {\n return markdownDefault;\n }\n }\n const rendererOverride = nativeOutput ? { rendered: null } : runActiveRendererOverride(format, outputResult);\n if (rendererOverride.rendered !== null) {\n return rendererOverride.rendered.endsWith(\"\\n\") ? rendererOverride.rendered : `${rendererOverride.rendered}\\n`;\n }\n if (format === \"json\") {\n return `${JSON.stringify(outputResult, null, 2)}\\n`;\n }\n const compactedToon = compactToonValue(outputResult);\n if (compactedToon === undefined) {\n return \"{}\\n\";\n }\n return `${renderToonValue(compactedToon, 0)}\\n`;\n}\n\n/**\n * Implements print result for the public runtime surface of this module.\n */\nexport function printResult(result: unknown, options: OutputOptions): void {\n const projected = options.idOnly\n ? projectMutationResult(result, { idOnly: true })\n : options.noChangedFields\n ? projectMutationResult(result, { changedFields: \"compact\" })\n : result;\n const rendered = formatOutput(projected, options);\n if (options.quiet) {\n return;\n }\n writeStdout(rendered);\n}\n\n/**\n * Implements print error for the public runtime surface of this module.\n */\nexport function printError(message: string): void {\n const override = runActiveServiceOverrideSync(\"error_format\", {\n message,\n });\n const rendered = override.handled && typeof override.result === \"string\" ? override.result : message;\n writeStderr(rendered.endsWith(\"\\n\") ? rendered : `${rendered}\\n`);\n}\n\nexport const outputTestOnly = {\n compactToonValue,\n renderToonValue,\n};\n"],"names":["isPlainObject"],"mappings":";;;;;;;;;;;;;AAkCA,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAChC,IAAM,WAAW;AACjB,IAAM,6BAA6B,oBAAI,IAAI,CAAC,SAAS,UAAU,CAAC;AAEhE,SAAS,cAAc,OAAc;AACnC,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG;AACvE,WAAO;EACT;AACA,QAAM,QAAQ,OAAO,eAAe,KAAK;AACzC,SAAO,UAAU,QAAQ,UAAU,OAAO;AAC5C;AAGA,SAAS,wBAAwB,UAAiC;AAChE,QAAM,gBAAgB,SAAS,kBAAkB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