@unbrained/pm-cli 2026.7.5 → 2026.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (597) hide show
  1. package/CHANGELOG.md +42 -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/extension/bundled-catalog.d.ts +3 -0
  8. package/dist/cli/commands/extension/bundled-catalog.js +38 -28
  9. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  10. package/dist/cli/commands/extension/install-sources.js +81 -18
  11. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  12. package/dist/cli/commands/health.js +9 -5
  13. package/dist/cli/commands/health.js.map +1 -1
  14. package/dist/cli/commands/learnings.js +5 -3
  15. package/dist/cli/commands/learnings.js.map +1 -1
  16. package/dist/cli/commands/notes.js +5 -3
  17. package/dist/cli/commands/notes.js.map +1 -1
  18. package/dist/cli/commands/reindex.js +4 -3
  19. package/dist/cli/commands/reindex.js.map +1 -1
  20. package/dist/cli/commands/search.js +3 -3
  21. package/dist/cli/commands/search.js.map +1 -1
  22. package/dist/cli/commands/test.d.ts +9 -0
  23. package/dist/cli/commands/test.js +144 -105
  24. package/dist/cli/commands/test.js.map +1 -1
  25. package/dist/cli/extension-command-help.js +10 -2
  26. package/dist/cli/extension-command-help.js.map +1 -1
  27. package/dist/cli/register-list-query.d.ts +1 -1
  28. package/dist/cli/register-list-query.js +18 -27
  29. package/dist/cli/register-list-query.js.map +1 -1
  30. package/dist/cli/register-operations.d.ts +0 -8
  31. package/dist/cli/register-operations.js +41 -46
  32. package/dist/cli/register-operations.js.map +1 -1
  33. package/dist/cli/register-setup.js +113 -13
  34. package/dist/cli/register-setup.js.map +1 -1
  35. package/dist/cli/registration-helpers.d.ts +5 -1
  36. package/dist/cli/registration-helpers.js +14 -2
  37. package/dist/cli/registration-helpers.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
  39. package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js → append-PVCTBVJG.js} +8 -9
  40. package/dist/cli-bundle/chunks/{chunk-PPE4YUQM.js → chunk-2APXX4TZ.js} +17 -28
  41. package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
  42. package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js → chunk-2LEJGRQ7.js} +3 -12
  43. package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js.map → chunk-2LEJGRQ7.js.map} +1 -1
  44. package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js → chunk-2TILG6F2.js} +3 -3
  45. package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js → chunk-3G6UMXT3.js} +6 -8
  46. package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js.map → chunk-3G6UMXT3.js.map} +1 -1
  47. package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js → chunk-3TYOW6RR.js} +8 -8
  48. package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js → chunk-3X542TEY.js} +7 -7
  49. package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js → chunk-42LXP4VO.js} +14 -21
  50. package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js.map → chunk-42LXP4VO.js.map} +1 -1
  51. package/dist/cli-bundle/chunks/{chunk-5J2XPTAD.js → chunk-43SIHQND.js} +36 -15
  52. package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
  53. package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js → chunk-43UQN754.js} +12 -19
  54. package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js.map → chunk-43UQN754.js.map} +1 -1
  55. package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js → chunk-43YSKY75.js} +4 -6
  56. package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js.map → chunk-43YSKY75.js.map} +1 -1
  57. package/dist/cli-bundle/chunks/{notes-72YXN5JX.js → chunk-4BKDAEDF.js} +6 -13
  58. package/dist/cli-bundle/chunks/{notes-72YXN5JX.js.map → chunk-4BKDAEDF.js.map} +2 -2
  59. package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js → chunk-4IQKDKGE.js} +18 -32
  60. package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js.map → chunk-4IQKDKGE.js.map} +1 -1
  61. package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js → chunk-4MZOKTI2.js} +6 -8
  62. package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js.map → chunk-4MZOKTI2.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js → chunk-52NS7JDP.js} +14 -20
  64. package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js.map → chunk-52NS7JDP.js.map} +1 -1
  65. package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js → chunk-565WYS5W.js} +12 -16
  66. package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js.map → chunk-565WYS5W.js.map} +1 -1
  67. package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js → chunk-5FIQ4EX3.js} +13 -19
  68. package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js.map → chunk-5FIQ4EX3.js.map} +1 -1
  69. package/dist/cli-bundle/chunks/{config-V57QD47V.js → chunk-6G6O3OPQ.js} +259 -41
  70. package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js → chunk-6LCJRGPD.js} +9 -13
  72. package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js.map → chunk-6LCJRGPD.js.map} +1 -1
  73. package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js → chunk-6UQCNWFV.js} +6 -8
  74. package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js.map → chunk-6UQCNWFV.js.map} +1 -1
  75. package/dist/cli-bundle/chunks/{chunk-LEKT4K7I.js → chunk-6XTSYPPO.js} +1216 -387
  76. package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
  77. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
  78. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js → chunk-7PNQA24K.js} +30 -36
  80. package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js.map → chunk-7PNQA24K.js.map} +1 -1
  81. package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js → chunk-7VQ3JJN5.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js → chunk-7Y5N34HX.js} +8 -12
  83. package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js.map → chunk-7Y5N34HX.js.map} +1 -1
  84. package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js → chunk-AGAVEDIE.js} +7 -7
  85. package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js → chunk-AJUON7E6.js} +3 -3
  86. package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js → chunk-ARKHKYYS.js} +16 -30
  87. package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js.map → chunk-ARKHKYYS.js.map} +1 -1
  88. package/dist/cli-bundle/chunks/{chunk-7EQNAZX2.js → chunk-C5ACVMOI.js} +99 -51
  89. package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
  90. package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js → chunk-CJQM7O7R.js} +16 -20
  91. package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js.map → chunk-CJQM7O7R.js.map} +1 -1
  92. package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js → chunk-D2DCTFTL.js} +7 -9
  93. package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js.map → chunk-D2DCTFTL.js.map} +1 -1
  94. package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js → chunk-DDDWVPID.js} +7 -11
  95. package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js.map → chunk-DDDWVPID.js.map} +1 -1
  96. package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js → chunk-DG6BSXZ7.js} +6 -13
  97. package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js.map → chunk-DG6BSXZ7.js.map} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js → chunk-DR2V5OIV.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js → chunk-E3LWJUGF.js} +4 -6
  100. package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js.map → chunk-E3LWJUGF.js.map} +1 -1
  101. package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js → chunk-E3YQFSFE.js} +6 -10
  102. package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js.map → chunk-E3YQFSFE.js.map} +1 -1
  103. package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js → chunk-EDO7VXSO.js} +2 -2
  104. package/dist/cli-bundle/chunks/{chunk-FDBARR33.js → chunk-EIUBK2LT.js} +12 -18
  105. package/dist/cli-bundle/chunks/{chunk-FDBARR33.js.map → chunk-EIUBK2LT.js.map} +1 -1
  106. package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js → chunk-EMXPI36L.js} +14 -20
  107. package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js.map → chunk-EMXPI36L.js.map} +1 -1
  108. package/dist/cli-bundle/chunks/{chunk-4OFLJHX6.js → chunk-EOUVR7JN.js} +13 -8
  109. package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
  110. package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js → chunk-EVEPHNXJ.js} +4 -4
  111. package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js → chunk-F6MT7KKE.js} +6 -10
  112. package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js.map → chunk-F6MT7KKE.js.map} +1 -1
  113. package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js → chunk-F6YC2A6X.js} +7 -11
  114. package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js.map → chunk-F6YC2A6X.js.map} +1 -1
  115. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
  116. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js → chunk-FN6SB4HU.js} +2 -2
  118. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
  119. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
  120. package/dist/cli-bundle/chunks/{chunk-JLA7EVYV.js → chunk-GLS6VMWI.js} +37 -16
  121. package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js → chunk-GPIDUMMN.js} +10 -17
  123. package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js.map → chunk-GPIDUMMN.js.map} +1 -1
  124. package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js → chunk-GTM5HQL4.js} +15 -21
  125. package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js.map → chunk-GTM5HQL4.js.map} +1 -1
  126. package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js → chunk-H2SMKL2N.js} +8 -8
  127. package/dist/cli-bundle/chunks/{chunk-S4APD35C.js → chunk-HHEWQXPD.js} +6 -6
  128. package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js → chunk-HX6QXV5P.js} +2 -2
  130. package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js → chunk-I74FMIWA.js} +11 -17
  131. package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js.map → chunk-I74FMIWA.js.map} +1 -1
  132. package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js +804 -0
  133. package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js → chunk-II7R6KD4.js} +9 -13
  135. package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js.map → chunk-II7R6KD4.js.map} +1 -1
  136. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
  137. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js → chunk-J7BOLHAV.js} +5 -7
  139. package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js.map → chunk-J7BOLHAV.js.map} +1 -1
  140. package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js → chunk-KTGJ2CBU.js} +4 -6
  141. package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js.map → chunk-KTGJ2CBU.js.map} +1 -1
  142. package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js → chunk-LCFJ7XAM.js} +32 -2
  143. package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js.map → chunk-LCFJ7XAM.js.map} +3 -3
  144. package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js → chunk-LZQU6XJG.js} +28 -34
  145. package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js.map → chunk-LZQU6XJG.js.map} +1 -1
  146. package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js → chunk-M62RO3XK.js} +10 -14
  147. package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js.map → chunk-M62RO3XK.js.map} +1 -1
  148. package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js → chunk-MCEUKJKW.js} +9 -11
  149. package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js.map → chunk-MCEUKJKW.js.map} +1 -1
  150. package/dist/cli-bundle/chunks/{chunk-T5Y3QSNF.js → chunk-MHNMCDWR.js} +1447 -86
  151. package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
  152. package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js → chunk-MRFWUSVA.js} +4 -6
  153. package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
  154. package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js → chunk-N6ZHDLUY.js} +6 -8
  155. package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js.map → chunk-N6ZHDLUY.js.map} +1 -1
  156. package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js → chunk-NWWL22C7.js} +8 -12
  157. package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js.map → chunk-NWWL22C7.js.map} +1 -1
  158. package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js → chunk-P3MJJW7P.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js → chunk-PDXJXEZJ.js} +2 -2
  160. package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js → chunk-Q64AYQYW.js} +9 -13
  161. package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js.map → chunk-Q64AYQYW.js.map} +1 -1
  162. package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js → chunk-QDABF2RB.js} +26 -47
  163. package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js.map → chunk-QDABF2RB.js.map} +1 -1
  164. package/dist/cli-bundle/chunks/{chunk-NBFCNJ7Q.js → chunk-QFBSP3NI.js} +529 -46
  165. package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
  166. package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js → chunk-RB3KLPAH.js} +11 -16
  167. package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js.map → chunk-RB3KLPAH.js.map} +1 -1
  168. package/dist/cli-bundle/chunks/{chunk-YSAH5FY5.js → chunk-RY7PTTUB.js} +94 -53
  169. package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-WVSGSZ6J.js → chunk-S547WBYG.js} +1477 -86
  171. package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js → chunk-S5BNGFN5.js} +24 -45
  173. package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js.map → chunk-S5BNGFN5.js.map} +1 -1
  174. package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js → chunk-S6VC2A2K.js} +9 -14
  175. package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js.map → chunk-S6VC2A2K.js.map} +1 -1
  176. package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js → chunk-SIM5JDON.js} +7 -14
  177. package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js.map → chunk-SIM5JDON.js.map} +1 -1
  178. package/dist/cli-bundle/chunks/{chunk-ZD34OFFQ.js → chunk-SY75LYXR.js} +12 -7
  179. package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
  180. package/dist/cli-bundle/chunks/{chunk-TT42JUMF.js → chunk-TEISGNSH.js} +7 -7
  181. package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js → chunk-TEKZOS7M.js} +2 -2
  183. package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js → chunk-TGUK6XN6.js} +14 -18
  184. package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js.map → chunk-TGUK6XN6.js.map} +1 -1
  185. package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js → chunk-TNC6MZUD.js} +10 -21
  186. package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js.map → chunk-TNC6MZUD.js.map} +1 -1
  187. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
  188. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
  189. package/dist/cli-bundle/chunks/{chunk-YD5FML7K.js → chunk-UO7XAZK6.js} +27 -4
  190. package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
  191. package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js → chunk-V5ZWKJNY.js} +5 -14
  192. package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js.map → chunk-V5ZWKJNY.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js → chunk-VGO73OCK.js} +7 -14
  194. package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js.map → chunk-VGO73OCK.js.map} +1 -1
  195. package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js → chunk-VLEA2UTQ.js} +2 -2
  196. package/dist/cli-bundle/chunks/{files-6P57MRKL.js → chunk-W5HXHC7C.js} +8 -15
  197. package/dist/cli-bundle/chunks/{files-6P57MRKL.js.map → chunk-W5HXHC7C.js.map} +1 -1
  198. package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js → chunk-WCWVEXGA.js} +2 -2
  199. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
  200. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{delete-62JQTYT4.js → chunk-XBX5CBRQ.js} +6 -10
  202. package/dist/cli-bundle/chunks/{delete-62JQTYT4.js.map → chunk-XBX5CBRQ.js.map} +1 -1
  203. package/dist/cli-bundle/chunks/{chunk-MTTXDAK4.js → chunk-XC3X7BQR.js} +541 -44
  204. package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
  205. package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js → chunk-XHCVAZGM.js} +17 -23
  206. package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js.map → chunk-XHCVAZGM.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js → chunk-XPMXPR7K.js} +7 -9
  208. package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js.map → chunk-XPMXPR7K.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js → chunk-XS2TMNXR.js} +8 -12
  210. package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js.map → chunk-XS2TMNXR.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/{plan-XWY5T67S.js → chunk-XXIYUTLK.js} +12 -23
  212. package/dist/cli-bundle/chunks/{plan-XWY5T67S.js.map → chunk-XXIYUTLK.js.map} +1 -1
  213. package/dist/cli-bundle/chunks/{chunk-7QH7DHUB.js → chunk-XZWL7VNE.js} +1220 -398
  214. package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
  215. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
  216. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js → chunk-Y7KYVCZM.js} +12 -18
  218. package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js.map → chunk-Y7KYVCZM.js.map} +1 -1
  219. package/dist/cli-bundle/chunks/{chunk-UI5BJ6DO.js → chunk-YCVWWIKY.js} +17 -28
  220. package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
  221. package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js +780 -0
  222. package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js.map +1 -0
  223. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
  224. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
  225. package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js → chunk-YPD7SQ5P.js} +8 -12
  226. package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js.map → chunk-YPD7SQ5P.js.map} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js → chunk-YPMZMKN7.js} +2 -2
  228. package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js → chunk-YTD5GICJ.js} +4 -4
  229. package/dist/cli-bundle/chunks/{config-DJJKZB5R.js → chunk-ZNEG2UDO.js} +264 -39
  230. package/dist/cli-bundle/chunks/{config-DJJKZB5R.js.map → chunk-ZNEG2UDO.js.map} +4 -4
  231. package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js → chunk-ZO7CLOY2.js} +3 -3
  232. package/dist/cli-bundle/chunks/{close-3YRR3XY6.js → close-3YYQ5OG2.js} +5 -9
  233. package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
  234. package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
  235. package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
  236. package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
  237. package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
  238. package/dist/cli-bundle/chunks/copy-44RT5GDW.js +13 -0
  239. package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
  240. package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js → create-4GWJWPXG.js} +9 -14
  241. package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
  242. package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
  243. package/dist/cli-bundle/chunks/delete-YQ2VPXNF.js +14 -0
  244. package/dist/cli-bundle/chunks/deps-BU5EBJDU.js +17 -0
  245. package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
  246. package/dist/cli-bundle/chunks/docs-OQBSJNIA.js +18 -0
  247. package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
  248. package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
  249. package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js → files-HTSB2KJG.js} +13 -13
  250. package/dist/cli-bundle/chunks/focus-FOG4ALC2.js +14 -0
  251. package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
  252. package/dist/cli-bundle/chunks/history-compact-M6IFAMBP.js +25 -0
  253. package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
  254. package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js → history-redact-NQX3OGZP.js} +7 -11
  255. package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
  256. package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
  257. package/dist/cli-bundle/chunks/history-repair-NHOJG7WO.js +23 -0
  258. package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
  259. package/dist/cli-bundle/chunks/learnings-T63JGKKN.js +17 -0
  260. package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
  261. package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
  262. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
  263. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js.map +7 -0
  264. package/dist/cli-bundle/chunks/plan-TN537L24.js +28 -0
  265. package/dist/cli-bundle/chunks/plan-TN537L24.js.map +1 -0
  266. package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js +37 -0
  267. package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js.map +1 -0
  268. package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js +33 -0
  269. package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-list-query-5H66WFYF.js → register-list-query-OHXD7G5N.js} +41 -33
  271. package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
  272. package/dist/cli-bundle/chunks/{register-list-query-FB3FNDLZ.js → register-list-query-ZCRABAPN.js} +42 -34
  273. package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js → register-mutation-P3G4XP6Q.js} +36 -41
  275. package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
  276. package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js → register-mutation-XX4H56PE.js} +34 -39
  277. package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js.map → register-mutation-XX4H56PE.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{register-operations-A3XAM5J7.js → register-operations-V6PIYEDU.js} +80 -52
  279. package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
  280. package/dist/cli-bundle/chunks/{register-operations-SG7HBSUP.js → register-operations-V6VKTG54.js} +79 -51
  281. package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
  282. package/dist/cli-bundle/chunks/{register-setup-K6U3NVY5.js → register-setup-6RVAWT6W.js} +129 -31
  283. package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
  284. package/dist/cli-bundle/chunks/{register-setup-I45OGJUV.js → register-setup-6YVUSQYD.js} +130 -32
  285. package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
  286. package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js → restore-HC3YSWF7.js} +7 -11
  287. package/dist/cli-bundle/chunks/restore-HC3YSWF7.js.map +1 -0
  288. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
  289. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js.map +7 -0
  290. package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js → schema-DAGSYO6E.js} +6 -10
  291. package/dist/cli-bundle/chunks/schema-DAGSYO6E.js.map +7 -0
  292. package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js → schema-UBXJCQAC.js} +6 -10
  293. package/dist/cli-bundle/chunks/schema-UBXJCQAC.js.map +1 -0
  294. package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
  295. package/dist/cli-bundle/chunks/update-CJGG5WMV.js.map +7 -0
  296. package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
  297. package/dist/cli-bundle/chunks/update-LKD64AFP.js.map +1 -0
  298. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
  299. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js.map +7 -0
  300. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
  301. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js.map +1 -0
  302. package/dist/cli-bundle/main.js +29 -31
  303. package/dist/cli-bundle/main.js.map +2 -2
  304. package/dist/cli-bundle/sdk-runtime.js +136 -54
  305. package/dist/cli-bundle/sdk-testing.js +7 -8
  306. package/dist/cli-bundle/sdk.js +132 -84
  307. package/dist/cli-bundle/sdk.js.map +2 -2
  308. package/dist/core/history/drift-scan.js +3 -8
  309. package/dist/core/history/drift-scan.js.map +1 -1
  310. package/dist/core/output/mutation-projection.js +11 -5
  311. package/dist/core/output/mutation-projection.js.map +1 -1
  312. package/dist/core/search/cache.js +3 -3
  313. package/dist/core/search/cache.js.map +1 -1
  314. package/dist/core/search/semantic-defaults.d.ts +2 -0
  315. package/dist/core/search/semantic-defaults.js +11 -4
  316. package/dist/core/search/semantic-defaults.js.map +1 -1
  317. package/dist/core/search/vector-stores.d.ts +1 -1
  318. package/dist/core/search/vector-stores.js +33 -7
  319. package/dist/core/search/vector-stores.js.map +1 -1
  320. package/dist/mcp/server.d.ts +22 -50
  321. package/dist/mcp/server.js +62 -916
  322. package/dist/mcp/server.js.map +1 -1
  323. package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
  324. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  325. package/dist/sdk/cli-contracts/tool-schema.js +9 -7
  326. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  327. package/dist/sdk/index.d.ts +4 -2
  328. package/dist/sdk/index.js +4 -4
  329. package/dist/sdk/index.js.map +1 -1
  330. package/dist/sdk/runtime.d.ts +312 -5
  331. package/dist/sdk/runtime.js +1391 -26
  332. package/dist/sdk/runtime.js.map +1 -1
  333. package/dist/sdk/start-task-status.d.ts +13 -0
  334. package/dist/sdk/start-task-status.js +19 -0
  335. package/dist/sdk/start-task-status.js.map +1 -0
  336. package/dist/sdk/workspace-contracts-cache.d.ts +17 -0
  337. package/dist/sdk/workspace-contracts-cache.js +36 -0
  338. package/dist/sdk/workspace-contracts-cache.js.map +1 -0
  339. package/docs/COMMANDS.md +10 -1
  340. package/docs/RELEASING.md +3 -1
  341. package/docs/SDK.md +81 -0
  342. package/docs/TESTING.md +3 -0
  343. package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +16 -2
  344. package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +16 -1
  345. package/package.json +1 -1
  346. package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +0 -18
  347. package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js +0 -375
  348. package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js.map +0 -7
  349. package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js +0 -372
  350. package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js.map +0 -1
  351. package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
  352. package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js +0 -1961
  354. package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js +0 -1749
  356. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +0 -7
  357. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
  358. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
  359. package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js +0 -822
  360. package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-4OFLJHX6.js.map +0 -1
  362. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js +0 -2181
  363. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +0 -1
  364. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js +0 -1704
  365. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +0 -1
  366. package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js +0 -2330
  367. package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js.map +0 -7
  368. package/dist/cli-bundle/chunks/chunk-5J2XPTAD.js.map +0 -7
  369. package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js +0 -995
  370. package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js +0 -819
  372. package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js.map +0 -1
  373. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
  374. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
  375. package/dist/cli-bundle/chunks/chunk-7EQNAZX2.js.map +0 -7
  376. package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +0 -1
  377. package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js +0 -530
  378. package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js.map +0 -7
  379. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +0 -275
  380. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js +0 -231
  382. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js +0 -2184
  384. package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +0 -7
  385. package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js +0 -1615
  386. package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js.map +0 -7
  387. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js +0 -228
  388. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +0 -1
  389. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js +0 -3237
  390. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js +0 -1570
  392. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +0 -1
  393. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js +0 -3206
  394. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +0 -1
  395. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
  396. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
  397. package/dist/cli-bundle/chunks/chunk-JLA7EVYV.js.map +0 -1
  398. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +0 -76
  399. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +0 -1
  400. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +0 -79
  401. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +0 -7
  402. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +0 -915
  403. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +0 -1
  404. package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js +0 -218
  405. package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js.map +0 -7
  406. package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +0 -7
  407. package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js +0 -1858
  408. package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js.map +0 -1
  409. package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +0 -7
  410. package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js +0 -520
  411. package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js.map +0 -1
  412. package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js +0 -1041
  413. package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js.map +0 -7
  414. package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +0 -1
  415. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
  416. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
  417. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +0 -918
  418. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +0 -7
  419. package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js +0 -1985
  420. package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js.map +0 -7
  421. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +0 -238
  422. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +0 -1
  423. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +0 -1977
  424. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +0 -7
  425. package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js +0 -1031
  426. package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js.map +0 -1
  427. package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +0 -1
  428. package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
  429. package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
  430. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
  431. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
  432. package/dist/cli-bundle/chunks/chunk-S4APD35C.js.map +0 -7
  433. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js +0 -1149
  434. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +0 -1
  435. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +0 -272
  436. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +0 -1
  437. package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +0 -1
  438. package/dist/cli-bundle/chunks/chunk-TT42JUMF.js.map +0 -1
  439. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +0 -165
  440. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +0 -1932
  443. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +0 -1
  444. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +0 -175
  445. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
  447. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
  448. package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js +0 -1868
  449. package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js.map +0 -7
  450. package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +0 -7
  451. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js +0 -1152
  452. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-YSAH5FY5.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js +0 -1005
  456. package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js +0 -215
  458. package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js.map +0 -1
  459. package/dist/cli-bundle/chunks/chunk-ZD34OFFQ.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js +0 -2306
  461. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +0 -241
  463. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +0 -7
  464. package/dist/cli-bundle/chunks/claim-4DROPSIS.js +0 -144
  465. package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +0 -1
  466. package/dist/cli-bundle/chunks/claim-VX54TV5U.js +0 -147
  467. package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +0 -7
  468. package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +0 -16
  469. package/dist/cli-bundle/chunks/config-V57QD47V.js.map +0 -1
  470. package/dist/cli-bundle/chunks/context-4OQGIPSO.js +0 -45
  471. package/dist/cli-bundle/chunks/context-WLA6IAWE.js +0 -49
  472. package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +0 -12
  473. package/dist/cli-bundle/chunks/create-WKOZKPQR.js +0 -30
  474. package/dist/cli-bundle/chunks/eval-N6UHFWVO.js +0 -288
  475. package/dist/cli-bundle/chunks/eval-N6UHFWVO.js.map +0 -7
  476. package/dist/cli-bundle/chunks/eval-PHOTWYHI.js +0 -278
  477. package/dist/cli-bundle/chunks/eval-PHOTWYHI.js.map +0 -1
  478. package/dist/cli-bundle/chunks/extension-NBAH62ML.js +0 -40
  479. package/dist/cli-bundle/chunks/extension-ZF6ZZPOU.js +0 -44
  480. package/dist/cli-bundle/chunks/gc-AETFKZ44.js +0 -398
  481. package/dist/cli-bundle/chunks/gc-AETFKZ44.js.map +0 -7
  482. package/dist/cli-bundle/chunks/gc-RLBP4QVN.js +0 -388
  483. package/dist/cli-bundle/chunks/gc-RLBP4QVN.js.map +0 -1
  484. package/dist/cli-bundle/chunks/get-NH2MPBCI.js +0 -283
  485. package/dist/cli-bundle/chunks/get-NH2MPBCI.js.map +0 -1
  486. package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js +0 -286
  487. package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js.map +0 -7
  488. package/dist/cli-bundle/chunks/health-3GVPMQBL.js +0 -1612
  489. package/dist/cli-bundle/chunks/health-3GVPMQBL.js.map +0 -1
  490. package/dist/cli-bundle/chunks/health-DNTM72GJ.js +0 -1615
  491. package/dist/cli-bundle/chunks/health-DNTM72GJ.js.map +0 -7
  492. package/dist/cli-bundle/chunks/history-RYKLC72X.js +0 -20
  493. package/dist/cli-bundle/chunks/history-SGPYRAFT.js +0 -24
  494. package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +0 -21
  495. package/dist/cli-bundle/chunks/init-RPIPQUNV.js +0 -32
  496. package/dist/cli-bundle/chunks/init-SKQAESQS.js +0 -28
  497. package/dist/cli-bundle/chunks/list-64LHZ3HM.js +0 -32
  498. package/dist/cli-bundle/chunks/list-7LXBTEKI.js +0 -36
  499. package/dist/cli-bundle/chunks/next-7ODPAQ4U.js +0 -306
  500. package/dist/cli-bundle/chunks/next-7ODPAQ4U.js.map +0 -7
  501. package/dist/cli-bundle/chunks/next-ODJUM4ZM.js +0 -303
  502. package/dist/cli-bundle/chunks/next-ODJUM4ZM.js.map +0 -1
  503. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +0 -397
  504. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +0 -1
  505. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +0 -400
  506. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +0 -7
  507. package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js.map +0 -7
  508. package/dist/cli-bundle/chunks/register-list-query-FB3FNDLZ.js.map +0 -1
  509. package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js.map +0 -1
  510. package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js.map +0 -7
  511. package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js.map +0 -1
  512. package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js.map +0 -7
  513. package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +0 -19
  514. package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js +0 -91
  515. package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js.map +0 -7
  516. package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js +0 -88
  517. package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js.map +0 -1
  518. package/dist/cli-bundle/chunks/search-3S72CTD6.js +0 -38
  519. package/dist/cli-bundle/chunks/search-WNUNBQXO.js +0 -34
  520. package/dist/cli-bundle/chunks/stats-IJYTRQGV.js +0 -250
  521. package/dist/cli-bundle/chunks/stats-IJYTRQGV.js.map +0 -7
  522. package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js +0 -240
  523. package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js.map +0 -1
  524. package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js +0 -309
  525. package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js.map +0 -7
  526. package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js +0 -306
  527. package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-DQ2QFJ7W.js +0 -45
  529. package/dist/cli-bundle/chunks/test-W7QBLVJS.js +0 -41
  530. package/dist/cli-bundle/chunks/test-all-636NTRTT.js +0 -434
  531. package/dist/cli-bundle/chunks/test-all-636NTRTT.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js +0 -437
  533. package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js.map +0 -7
  534. package/dist/cli-bundle/chunks/test-runs-245OINZR.js +0 -28
  535. package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +0 -24
  536. package/dist/cli-bundle/chunks/update-SFLZPJXX.js +0 -30
  537. package/dist/cli-bundle/chunks/update-SJZ6S77U.js +0 -26
  538. package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js +0 -290
  539. package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js.map +0 -7
  540. package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js +0 -287
  541. package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js.map +0 -1
  542. package/dist/cli-bundle/chunks/validate-PA4FDTOV.js +0 -2143
  543. package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +0 -7
  544. package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js +0 -2105
  545. package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +0 -1
  546. /package/dist/cli-bundle/chunks/{activity-4XQIDNM5.js.map → append-F7WPGIQL.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js.map → append-PVCTBVJG.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js.map → chunk-2TILG6F2.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js.map → chunk-3TYOW6RR.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js.map → chunk-3X542TEY.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js.map → chunk-7VQ3JJN5.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js.map → chunk-AGAVEDIE.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js.map → chunk-AJUON7E6.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js.map → chunk-DR2V5OIV.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js.map → chunk-EDO7VXSO.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js.map → chunk-EVEPHNXJ.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js.map → chunk-FN6SB4HU.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js.map → chunk-H2SMKL2N.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js.map → chunk-HX6QXV5P.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js.map → chunk-P3MJJW7P.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js.map → chunk-PDXJXEZJ.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js.map → chunk-TEKZOS7M.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js.map → chunk-VLEA2UTQ.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js.map → chunk-WCWVEXGA.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js.map → chunk-YPMZMKN7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js.map → chunk-YTD5GICJ.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js.map → chunk-ZO7CLOY2.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{close-3YRR3XY6.js.map → close-3YYQ5OG2.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{close-OB2Y4QP5.js.map → close-Z3Q4U7TS.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{context-4OQGIPSO.js.map → close-many-3L2RXH3M.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{context-WLA6IAWE.js.map → close-many-D366FTIG.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js.map → comments-54XDJNFE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{contracts-HXJLKCRI.js.map → comments-HGHC2PN6.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js.map → copy-44RT5GDW.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{create-WKOZKPQR.js.map → copy-UGMUGHZA.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{extension-ZF6ZZPOU.js.map → create-4GWJWPXG.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{extension-NBAH62ML.js.map → create-AZXCUYKP.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{history-RYKLC72X.js.map → delete-Y6SXIQ4X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-SGPYRAFT.js.map → delete-YQ2VPXNF.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js.map → deps-BU5EBJDU.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{history-redact-4H3FCKF3.js.map → deps-FMANWFRP.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{init-RPIPQUNV.js.map → docs-OQBSJNIA.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{init-SKQAESQS.js.map → docs-VNPBZXEL.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{list-64LHZ3HM.js.map → files-72HZEBOE.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{list-7LXBTEKI.js.map → files-HTSB2KJG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js.map → focus-FOG4ALC2.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{restore-PXOFL6AM.js.map → focus-SUTMKXGX.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js.map → history-compact-M6IFAMBP.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js.map → history-compact-NEXRPP2O.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{search-3S72CTD6.js.map → history-redact-NQX3OGZP.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{search-WNUNBQXO.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{test-W7QBLVJS.js.map → history-repair-CBHMHAJO.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{test-DQ2QFJ7W.js.map → history-repair-NHOJG7WO.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{test-runs-ZRD4GCTT.js.map → learnings-M64NTSOR.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{test-runs-245OINZR.js.map → learnings-T63JGKKN.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{update-SJZ6S77U.js.map → notes-73WE2UV2.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-SFLZPJXX.js.map → notes-U7L6HQQ2.js.map} +0 -0
@@ -1,17 +1,34 @@
1
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]="c63a3843-4fe5-59f1-a28c-51139dae3ccd")}catch(e){}}();
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]="143ba130-1e4a-555a-ad5a-281c82c7f363")}catch(e){}}();
3
3
  import {
4
- locateItem,
5
- readLocatedItem
6
- } from "./chunk-57C2RLW5.js";
4
+ ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,
5
+ CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,
6
+ CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
7
+ CREATE_COMMANDER_STRING_OPTION_CONTRACTS,
8
+ LIST_COMMANDER_STRING_OPTION_CONTRACTS,
9
+ NEXT_COMMANDER_STRING_OPTION_CONTRACTS,
10
+ SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,
11
+ UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,
12
+ UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,
13
+ readFirstStringFromCommanderOptions,
14
+ readFirstValueFromCommanderOptions,
15
+ readStringArrayFromCommanderOptions
16
+ } from "./chunk-2APXX4TZ.js";
7
17
  import {
8
- nowIso
9
- } from "./chunk-FJRKQREY.js";
18
+ printError,
19
+ writeStdout
20
+ } from "./chunk-EOUVR7JN.js";
10
21
  import {
22
+ PmCliError,
11
23
  getActiveExtensionRegistrations,
12
- readSettings
13
- } from "./chunk-US3T3W5J.js";
24
+ locateItem,
25
+ nowIso,
26
+ readLocatedItem,
27
+ readSettings,
28
+ setActiveCommandResult
29
+ } from "./chunk-GH73UOSJ.js";
14
30
  import {
31
+ EXIT_CODE,
15
32
  coercePositiveInteger,
16
33
  getSettingsPath,
17
34
  isFiniteNumberArray,
@@ -20,11 +37,18 @@ import {
20
37
  removeFileIfExists,
21
38
  resolveItemTypeRegistry,
22
39
  resolvePmPackageRootFromModule,
40
+ resolvePmRoot,
23
41
  toErrorMessage,
24
42
  toNonEmptyString,
25
43
  trimTrailingSlashes,
26
44
  writeFileAtomic
27
- } from "./chunk-YD5FML7K.js";
45
+ } from "./chunk-UO7XAZK6.js";
46
+
47
+ // dist/cli/registration-helpers.js
48
+ import { Option } from "commander";
49
+
50
+ // dist/core/search/cache.js
51
+ import path2 from "node:path";
28
52
 
29
53
  // dist/core/search/http-client.js
30
54
  var DEFAULT_SEARCH_HTTP_TIMEOUT_MS = 3e4;
@@ -511,12 +535,157 @@ function buildSemanticCorpusInput(document, options = {}) {
511
535
  return `${serialized.slice(0, keepLength)}${SEMANTIC_CORPUS_TRUNCATION_SUFFIX}`;
512
536
  }
513
537
 
538
+ // dist/core/search/embedding-batches.js
539
+ function resolveBatchRuntime(settings, maxInputCharacters) {
540
+ const batchSizeCandidate = settings.search.embedding_batch_size;
541
+ const timeoutMsCandidate = settings.search.embedding_timeout_ms;
542
+ const maxRetriesCandidate = settings.search.scanner_max_batch_retries;
543
+ const batchSize = Number.isFinite(batchSizeCandidate) && batchSizeCandidate > 0 ? Math.floor(batchSizeCandidate) : 1;
544
+ const timeoutMs = Number.isFinite(timeoutMsCandidate) && timeoutMsCandidate > 0 ? Math.floor(timeoutMsCandidate) : 3e4;
545
+ const maxRetries = Number.isFinite(maxRetriesCandidate) && maxRetriesCandidate >= 0 ? Math.floor(maxRetriesCandidate) : 0;
546
+ return {
547
+ batchSize,
548
+ timeoutMs,
549
+ maxRetries,
550
+ maxBatchInputCharacters: Number.POSITIVE_INFINITY,
551
+ maxInputCharacters
552
+ };
553
+ }
554
+ function createBatches(inputs, batchSize, maxBatchInputCharacters) {
555
+ const batches = [];
556
+ let currentBatch = [];
557
+ let currentCharacters = 0;
558
+ for (const input of inputs) {
559
+ const wouldExceedCount = currentBatch.length >= batchSize;
560
+ const wouldExceedCharacters = currentBatch.length > 0 && Number.isFinite(maxBatchInputCharacters) && currentCharacters + input.length > maxBatchInputCharacters;
561
+ if (wouldExceedCount || wouldExceedCharacters) {
562
+ batches.push(currentBatch);
563
+ currentBatch = [];
564
+ currentCharacters = 0;
565
+ }
566
+ currentBatch.push(input);
567
+ currentCharacters += input.length;
568
+ }
569
+ batches.push(currentBatch);
570
+ return batches;
571
+ }
572
+ function resolveProviderBatchRuntime(provider, runtime) {
573
+ if (provider.name !== "ollama") {
574
+ return runtime;
575
+ }
576
+ return {
577
+ ...runtime,
578
+ maxBatchInputCharacters: OLLAMA_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS
579
+ };
580
+ }
581
+ function truncateInputForRuntime(input, maxInputCharacters) {
582
+ if (!Number.isFinite(maxInputCharacters) || maxInputCharacters <= 0 || input.length <= maxInputCharacters) {
583
+ return input;
584
+ }
585
+ const keepLength = Math.max(0, maxInputCharacters - SEMANTIC_CORPUS_TRUNCATION_SUFFIX.length);
586
+ return `${input.slice(0, keepLength)}${SEMANTIC_CORPUS_TRUNCATION_SUFFIX}`.slice(0, maxInputCharacters);
587
+ }
588
+ function isEmbeddingTimeoutError(error) {
589
+ const message = toErrorMessage(error).toLowerCase();
590
+ return message.includes("timed out") || message.includes("timeout");
591
+ }
592
+ function buildEmbeddingFailureMessage(provider, batchLabel, batchSize, timeoutMs, attempts, error) {
593
+ const base = `Embedding batch ${batchLabel} failed after ${attempts} attempt(s): ${toErrorMessage(error)}`;
594
+ const details = `provider=${provider.name} model=${provider.model} batch_size=${batchSize} timeout_ms=${timeoutMs}`;
595
+ if (!isEmbeddingTimeoutError(error)) {
596
+ return `${base} (${details})`;
597
+ }
598
+ return `${base} (${details}; guidance=check provider availability or lower search.embedding_batch_size, raise search.embedding_timeout_ms, or run keyword search while semantic indexing catches up)`;
599
+ }
600
+ async function executeBatchWithAdaptiveSplit(provider, batch, batchLabel, timeoutMs, maxRetries, warnings) {
601
+ let lastError = null;
602
+ for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
603
+ try {
604
+ const batchVectors = await executeEmbeddingRequest(provider, batch, { timeout_ms: timeoutMs });
605
+ if (attempt > 0) {
606
+ warnings.push(`search_embedding_batch_retry_succeeded:batch=${batchLabel}:attempt=${attempt + 1}:size=${batch.length}`);
607
+ }
608
+ return batchVectors;
609
+ } catch (error) {
610
+ lastError = error;
611
+ if (isEmbeddingTimeoutError(error) && batch.length > 1) {
612
+ const midpoint = Math.ceil(batch.length / 2);
613
+ const left = batch.slice(0, midpoint);
614
+ const right = batch.slice(midpoint);
615
+ warnings.push(`search_embedding_batch_split_after_timeout:batch=${batchLabel}:size=${batch.length}:parts=${left.length}|${right.length}`);
616
+ return [
617
+ ...await executeBatchWithAdaptiveSplit(provider, left, `${batchLabel}.1`, timeoutMs, maxRetries, warnings),
618
+ ...await executeBatchWithAdaptiveSplit(provider, right, `${batchLabel}.2`, timeoutMs, maxRetries, warnings)
619
+ ];
620
+ }
621
+ if (attempt < maxRetries) {
622
+ const delayMs = Math.min(1e3 * 2 ** attempt, 8e3);
623
+ await new Promise((resolve2) => setTimeout(resolve2, delayMs));
624
+ }
625
+ }
626
+ }
627
+ throw new Error(buildEmbeddingFailureMessage(provider, batchLabel, batch.length, timeoutMs, maxRetries + 1, lastError));
628
+ }
629
+ async function executeEmbeddingBatchesWithRetry(provider, settings, inputs, options = {}) {
630
+ if (inputs.length === 0) {
631
+ return {
632
+ vectors: [],
633
+ warnings: []
634
+ };
635
+ }
636
+ const warnings = [];
637
+ const corpusLimitResolution = resolveSemanticCorpusCharacterLimit(provider.name, settings.search.embedding_corpus_max_characters);
638
+ if (corpusLimitResolution.warning) {
639
+ warnings.push(corpusLimitResolution.warning);
640
+ }
641
+ const runtime = resolveProviderBatchRuntime(provider, resolveBatchRuntime(settings, corpusLimitResolution.maxCharacters));
642
+ let truncatedInputCount = 0;
643
+ const normalizedInputs = inputs.map((input) => {
644
+ const normalized = truncateInputForRuntime(input, runtime.maxInputCharacters);
645
+ if (normalized.length < input.length) {
646
+ truncatedInputCount += 1;
647
+ }
648
+ return normalized;
649
+ });
650
+ if (truncatedInputCount > 0) {
651
+ warnings.push(`search_embedding_input_truncated:count=${truncatedInputCount}:max_characters=${runtime.maxInputCharacters}`);
652
+ }
653
+ const batches = createBatches(normalizedInputs, runtime.batchSize, runtime.maxBatchInputCharacters);
654
+ const vectors = [];
655
+ let completedInputs = 0;
656
+ for (let batchIndex = 0; batchIndex < batches.length; batchIndex += 1) {
657
+ const batch = batches[batchIndex];
658
+ options.onProgress?.({
659
+ batch_index: batchIndex + 1,
660
+ batch_total: batches.length,
661
+ batch_size: batch.length,
662
+ completed_inputs: completedInputs,
663
+ total_inputs: normalizedInputs.length,
664
+ phase: "start"
665
+ });
666
+ vectors.push(...await executeBatchWithAdaptiveSplit(provider, batch, String(batchIndex + 1), runtime.timeoutMs, runtime.maxRetries, warnings));
667
+ completedInputs += batch.length;
668
+ options.onProgress?.({
669
+ batch_index: batchIndex + 1,
670
+ batch_total: batches.length,
671
+ batch_size: batch.length,
672
+ completed_inputs: completedInputs,
673
+ total_inputs: normalizedInputs.length,
674
+ phase: "complete"
675
+ });
676
+ }
677
+ return {
678
+ vectors,
679
+ warnings
680
+ };
681
+ }
682
+
514
683
  // dist/core/search/semantic-defaults.js
515
684
  import { spawnSync } from "node:child_process";
516
685
  var DISABLE_AUTO_DEFAULTS_ENV = "PM_DISABLE_OLLAMA_AUTO_DEFAULTS";
517
686
  var OLLAMA_MODEL_ENV = "PM_OLLAMA_MODEL";
518
687
  var DEFAULT_OLLAMA_BASE_URL = "http://localhost:11434";
519
- var DEFAULT_OLLAMA_MODEL = "qwen3-embedding:0.6b";
688
+ var RECOMMENDED_OLLAMA_EMBEDDING_MODEL = "qwen3-embedding:0.6b";
520
689
  var DEFAULT_LANCEDB_PATH = ".agents/pm/search/lancedb/";
521
690
  var OLLAMA_VERSION_TIMEOUT_MS = 1500;
522
691
  var OLLAMA_LIST_TIMEOUT_MS = 2500;
@@ -606,7 +775,7 @@ function resolveAutoOllamaModel(settings) {
606
775
  return listedModel;
607
776
  }
608
777
  }
609
- return DEFAULT_OLLAMA_MODEL;
778
+ return null;
610
779
  }
611
780
  function resolveSemanticDefaultNeeds(settings) {
612
781
  return {
@@ -667,6 +836,13 @@ function resolveSettingsWithSemanticRuntimeDefaults(settings) {
667
836
  }
668
837
  const nextSettings = structuredClone(settings);
669
838
  const resolvedModel = resolveAutoOllamaModel(nextSettings);
839
+ if (!resolvedModel) {
840
+ return {
841
+ ...unchanged,
842
+ auto_ollama_defaults_skipped_reason: "no_installed_embedding_model",
843
+ auto_ollama_defaults_remediation: `Run ollama pull ${RECOMMENDED_OLLAMA_EMBEDDING_MODEL} or configure providers.ollama.model explicitly (and search.embedding_model if you need an override).`
844
+ };
845
+ }
670
846
  applyOllamaProviderDefaults(nextSettings, needs, resolvedModel);
671
847
  applyVectorStoreDefaults(nextSettings, needs);
672
848
  applySearchEmbeddingDefaults(nextSettings, needs, resolvedModel);
@@ -676,90 +852,226 @@ function resolveSettingsWithSemanticRuntimeDefaults(settings) {
676
852
  };
677
853
  }
678
854
 
679
- // dist/core/search/vector-stores.js
680
- import { mkdir, readFile, stat, unlink } from "node:fs/promises";
681
- import { dirname, join, resolve } from "node:path";
682
- var DEFAULT_COLLECTION = "pm_items";
683
- var COLLECTION_SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
684
- var MAX_COLLECTION_NAME_LENGTH = 128;
685
- var LANCE_DB_LOCAL_SNAPSHOT_DIR = ".pm-cli-local-vectors";
686
- var LANCE_DB_LOCAL_SNAPSHOT_VERSION = 1;
687
- var lanceDbLocalTables = /* @__PURE__ */ new Map();
688
- function resolveStoreCollectionName(store) {
689
- const candidate = toNonEmptyString(store.collection_name) ?? DEFAULT_COLLECTION;
690
- return candidate.replaceAll(COLLECTION_SANITIZE_PATTERN, "_").slice(0, MAX_COLLECTION_NAME_LENGTH);
691
- }
692
- function normalizeVector(value) {
693
- if (!isFiniteNumberArray(value) || value.length === 0) {
694
- throw new Error("Vector values must be a non-empty numeric array");
855
+ // dist/core/search/background-refresh.js
856
+ import { spawn } from "node:child_process";
857
+ import { mkdirSync, rmSync, statSync } from "node:fs";
858
+ import path from "node:path";
859
+ var REINDEX_LOCK_ID = "reindex";
860
+ var PENDING_QUEUE_REL_PATH = "search/pending-refresh.json";
861
+ var PENDING_QUEUE_GATE_REL_PATH = "search/pending-refresh.gate.lock";
862
+ var PENDING_QUEUE_GATE_STALE_MS = 3e4;
863
+ var SEARCH_REFRESH_INLINE_ENV = "PM_SEARCH_REFRESH_INLINE";
864
+ var SEARCH_REFRESH_CHILD_ENV = "PM_SEARCH_REFRESH_CHILD";
865
+ function parseBooleanTrueLike(value) {
866
+ if (typeof value !== "string") {
867
+ return false;
695
868
  }
696
- return [...value];
869
+ const normalized = value.trim().toLowerCase();
870
+ return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "on";
697
871
  }
698
- function normalizeLimit(value) {
699
- if (!Number.isFinite(value) || value <= 0) {
700
- throw new Error("Vector query limit must be a positive number");
872
+ function shouldRunSearchRefreshInForeground() {
873
+ if (parseBooleanTrueLike(process.env[SEARCH_REFRESH_INLINE_ENV])) {
874
+ return true;
701
875
  }
702
- return Math.floor(value);
703
- }
704
- function normalizeQdrantQueryResponse(payload) {
705
- const result = payload.result;
706
- if (!Array.isArray(result)) {
707
- throw new TypeError("Qdrant query response must include a result array");
876
+ if (parseBooleanTrueLike(process.env[SEARCH_REFRESH_CHILD_ENV])) {
877
+ return true;
708
878
  }
709
- const hits = result.map((entry, index) => {
710
- const idValue = entry.id;
711
- const idCandidate = typeof idValue === "number" ? String(idValue) : idValue;
712
- const id = toNonEmptyString(idCandidate);
713
- if (!id) {
714
- throw new Error(`Qdrant query response entry at index ${index} is missing a non-empty id`);
715
- }
716
- const score = entry.score;
717
- if (typeof score !== "number" || !Number.isFinite(score)) {
718
- throw new TypeError(`Qdrant query response entry at index ${index} is missing a finite numeric score`);
719
- }
720
- const payloadValue = entry.payload;
721
- if (payloadValue !== void 0 && (typeof payloadValue !== "object" || payloadValue === null || Array.isArray(payloadValue))) {
722
- throw new Error(`Qdrant query response entry at index ${index} must provide payload as an object when set`);
723
- }
724
- return {
725
- id,
726
- score,
727
- ...payloadValue ? { payload: payloadValue } : {}
728
- };
729
- });
730
- hits.sort((left, right) => {
731
- if (left.score !== right.score) {
732
- return right.score - left.score;
733
- }
734
- return left.id.localeCompare(right.id);
735
- });
736
- return hits;
879
+ const nodeEnv = (process.env.NODE_ENV ?? "").trim().toLowerCase();
880
+ return typeof process.env.VITEST === "string" || typeof process.env.VITEST_WORKER_ID === "string" || nodeEnv === "test";
737
881
  }
738
- function normalizeQdrantUpsertResponse(payload) {
739
- const nestedStatus = toNonEmptyString(payload.result?.status);
740
- if (nestedStatus) {
741
- return { status: nestedStatus };
742
- }
743
- const topLevelStatus = toNonEmptyString(payload.status);
744
- if (topLevelStatus) {
745
- return { status: topLevelStatus };
746
- }
747
- throw new Error("Qdrant upsert response must include status metadata");
882
+ function pendingQueuePath(pmRoot) {
883
+ return path.join(pmRoot, PENDING_QUEUE_REL_PATH);
748
884
  }
749
- async function executeRemoteVectorPlan(endpoint, plan, timeoutMs, fetcher, requestKind) {
750
- return await executeSearchJsonRequest({
751
- endpoint,
752
- method: plan.method,
753
- headers: plan.headers,
754
- body: plan.body,
755
- timeoutMs,
756
- fetcher,
757
- requestLabel: `Vector ${requestKind} request`,
758
- responseLabel: `Vector ${requestKind} response`
759
- });
885
+ function pendingQueueGatePath(pmRoot) {
886
+ return path.join(pmRoot, PENDING_QUEUE_GATE_REL_PATH);
760
887
  }
761
- function resolveQdrantStore(settings) {
762
- const url = toNonEmptyString(settings.vector_store?.qdrant?.url);
888
+ function acquireQueueGate(pmRoot) {
889
+ const gatePath = pendingQueueGatePath(pmRoot);
890
+ try {
891
+ if (Date.now() - statSync(gatePath).mtimeMs < PENDING_QUEUE_GATE_STALE_MS) {
892
+ return false;
893
+ }
894
+ rmSync(gatePath, { recursive: true, force: true });
895
+ } catch {
896
+ }
897
+ try {
898
+ mkdirSync(path.dirname(gatePath), { recursive: true });
899
+ mkdirSync(gatePath);
900
+ return true;
901
+ } catch {
902
+ return false;
903
+ }
904
+ }
905
+ function releaseQueueGate(pmRoot) {
906
+ try {
907
+ rmSync(pendingQueueGatePath(pmRoot), { recursive: true, force: true });
908
+ } catch {
909
+ }
910
+ }
911
+ async function withQueueGate(pmRoot, fn, fallback) {
912
+ for (let attempt = 0; attempt < 50; attempt += 1) {
913
+ if (acquireQueueGate(pmRoot)) {
914
+ try {
915
+ return await fn();
916
+ } finally {
917
+ releaseQueueGate(pmRoot);
918
+ }
919
+ }
920
+ await delay(20);
921
+ }
922
+ return fallback;
923
+ }
924
+ function delay(ms) {
925
+ return new Promise((resolve2) => {
926
+ setTimeout(resolve2, ms);
927
+ });
928
+ }
929
+ async function readPendingQueueIds(pmRoot) {
930
+ const raw = await readFileIfExists(pendingQueuePath(pmRoot));
931
+ if (!raw || raw.trim().length === 0) {
932
+ return [];
933
+ }
934
+ try {
935
+ const parsed = JSON.parse(raw);
936
+ if (!Array.isArray(parsed.ids)) {
937
+ return [];
938
+ }
939
+ return parsed.ids.filter((id) => typeof id === "string" && id.length > 0);
940
+ } catch {
941
+ return [];
942
+ }
943
+ }
944
+ async function writePendingQueueIds(pmRoot, ids) {
945
+ await writeFileAtomic(pendingQueuePath(pmRoot), `${JSON.stringify({ ids })}
946
+ `);
947
+ }
948
+ async function enqueuePendingRefreshIds(pmRoot, itemIds) {
949
+ const incoming = itemIds.filter((id) => typeof id === "string" && id.trim().length > 0);
950
+ if (incoming.length === 0) {
951
+ return;
952
+ }
953
+ const mergeIncoming = async () => {
954
+ const existing = await readPendingQueueIds(pmRoot);
955
+ const merged = [.../* @__PURE__ */ new Set([...existing, ...incoming])].sort((left, right) => left.localeCompare(right));
956
+ await writePendingQueueIds(pmRoot, merged);
957
+ };
958
+ const gated = await withQueueGate(pmRoot, async () => {
959
+ await mergeIncoming();
960
+ return true;
961
+ }, false);
962
+ if (!gated) {
963
+ await mergeIncoming();
964
+ }
965
+ }
966
+ function searchRefreshRunnerPath() {
967
+ return path.join(resolvePmPackageRootFromModule(import.meta.url, ["../../.."]), "dist", "cli", "search-refresh.js");
968
+ }
969
+ function dispatchRefreshChild(pmRoot) {
970
+ try {
971
+ const child = spawn(process.execPath, [searchRefreshRunnerPath()], {
972
+ detached: true,
973
+ stdio: "ignore",
974
+ env: {
975
+ ...process.env,
976
+ PM_PATH: pmRoot,
977
+ [SEARCH_REFRESH_CHILD_ENV]: "1"
978
+ }
979
+ });
980
+ child.on("error", () => {
981
+ });
982
+ child.unref();
983
+ } catch {
984
+ }
985
+ }
986
+ async function scheduleBackgroundSemanticRefresh(pmRoot, itemIds) {
987
+ await enqueuePendingRefreshIds(pmRoot, itemIds);
988
+ dispatchRefreshChild(pmRoot);
989
+ }
990
+
991
+ // dist/core/search/vector-stores.js
992
+ import { mkdir, readFile, stat, unlink } from "node:fs/promises";
993
+ import { basename, dirname, isAbsolute, join, resolve } from "node:path";
994
+ var DEFAULT_COLLECTION = "pm_items";
995
+ var COLLECTION_SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
996
+ var MAX_COLLECTION_NAME_LENGTH = 128;
997
+ var LANCE_DB_LOCAL_SNAPSHOT_DIR = ".pm-cli-local-vectors";
998
+ var LANCE_DB_LOCAL_SNAPSHOT_VERSION = 1;
999
+ var lanceDbLocalTables = /* @__PURE__ */ new Map();
1000
+ function resolveStoreCollectionName(store) {
1001
+ const candidate = toNonEmptyString(store.collection_name) ?? DEFAULT_COLLECTION;
1002
+ return candidate.replaceAll(COLLECTION_SANITIZE_PATTERN, "_").slice(0, MAX_COLLECTION_NAME_LENGTH);
1003
+ }
1004
+ function normalizeVector(value) {
1005
+ if (!isFiniteNumberArray(value) || value.length === 0) {
1006
+ throw new Error("Vector values must be a non-empty numeric array");
1007
+ }
1008
+ return [...value];
1009
+ }
1010
+ function normalizeLimit(value) {
1011
+ if (!Number.isFinite(value) || value <= 0) {
1012
+ throw new Error("Vector query limit must be a positive number");
1013
+ }
1014
+ return Math.floor(value);
1015
+ }
1016
+ function normalizeQdrantQueryResponse(payload) {
1017
+ const result = payload.result;
1018
+ if (!Array.isArray(result)) {
1019
+ throw new TypeError("Qdrant query response must include a result array");
1020
+ }
1021
+ const hits = result.map((entry, index) => {
1022
+ const idValue = entry.id;
1023
+ const idCandidate = typeof idValue === "number" ? String(idValue) : idValue;
1024
+ const id = toNonEmptyString(idCandidate);
1025
+ if (!id) {
1026
+ throw new Error(`Qdrant query response entry at index ${index} is missing a non-empty id`);
1027
+ }
1028
+ const score = entry.score;
1029
+ if (typeof score !== "number" || !Number.isFinite(score)) {
1030
+ throw new TypeError(`Qdrant query response entry at index ${index} is missing a finite numeric score`);
1031
+ }
1032
+ const payloadValue = entry.payload;
1033
+ if (payloadValue !== void 0 && (typeof payloadValue !== "object" || payloadValue === null || Array.isArray(payloadValue))) {
1034
+ throw new Error(`Qdrant query response entry at index ${index} must provide payload as an object when set`);
1035
+ }
1036
+ return {
1037
+ id,
1038
+ score,
1039
+ ...payloadValue ? { payload: payloadValue } : {}
1040
+ };
1041
+ });
1042
+ hits.sort((left, right) => {
1043
+ if (left.score !== right.score) {
1044
+ return right.score - left.score;
1045
+ }
1046
+ return left.id.localeCompare(right.id);
1047
+ });
1048
+ return hits;
1049
+ }
1050
+ function normalizeQdrantUpsertResponse(payload) {
1051
+ const nestedStatus = toNonEmptyString(payload.result?.status);
1052
+ if (nestedStatus) {
1053
+ return { status: nestedStatus };
1054
+ }
1055
+ const topLevelStatus = toNonEmptyString(payload.status);
1056
+ if (topLevelStatus) {
1057
+ return { status: topLevelStatus };
1058
+ }
1059
+ throw new Error("Qdrant upsert response must include status metadata");
1060
+ }
1061
+ async function executeRemoteVectorPlan(endpoint, plan, timeoutMs, fetcher, requestKind) {
1062
+ return await executeSearchJsonRequest({
1063
+ endpoint,
1064
+ method: plan.method,
1065
+ headers: plan.headers,
1066
+ body: plan.body,
1067
+ timeoutMs,
1068
+ fetcher,
1069
+ requestLabel: `Vector ${requestKind} request`,
1070
+ responseLabel: `Vector ${requestKind} response`
1071
+ });
1072
+ }
1073
+ function resolveQdrantStore(settings) {
1074
+ const url = toNonEmptyString(settings.vector_store?.qdrant?.url);
763
1075
  if (!url) {
764
1076
  return null;
765
1077
  }
@@ -772,7 +1084,21 @@ function resolveQdrantStore(settings) {
772
1084
  ...apiKey ? { api_key: apiKey } : {}
773
1085
  };
774
1086
  }
775
- function resolveLanceDbStore(settings) {
1087
+ function resolveWorkspaceRootFromPmRoot(pmRoot) {
1088
+ const resolved = resolve(pmRoot);
1089
+ const parent = dirname(resolved);
1090
+ if (basename(resolved) === "pm" && basename(parent) === ".agents") {
1091
+ return dirname(parent);
1092
+ }
1093
+ return resolved;
1094
+ }
1095
+ function anchorLanceDbStorePath(storePath, pmRoot) {
1096
+ if (!pmRoot || isAbsolute(storePath)) {
1097
+ return storePath;
1098
+ }
1099
+ return resolve(resolveWorkspaceRootFromPmRoot(pmRoot), storePath);
1100
+ }
1101
+ function resolveLanceDbStore(settings, pmRoot) {
776
1102
  const lancedbPath = toNonEmptyString(settings.vector_store?.lancedb?.path);
777
1103
  if (!lancedbPath) {
778
1104
  return null;
@@ -780,7 +1106,7 @@ function resolveLanceDbStore(settings) {
780
1106
  const collectionName = toNonEmptyString(settings.vector_store?.collection_name);
781
1107
  return {
782
1108
  name: "lancedb",
783
- path: lancedbPath,
1109
+ path: anchorLanceDbStorePath(lancedbPath, pmRoot),
784
1110
  ...collectionName && collectionName !== DEFAULT_COLLECTION ? { collection_name: collectionName } : {}
785
1111
  };
786
1112
  }
@@ -1015,9 +1341,9 @@ function cosineSimilarity(left, right) {
1015
1341
  }
1016
1342
  return dotProd / (leftNorm * rightNorm);
1017
1343
  }
1018
- function resolveVectorStores(settings) {
1344
+ function resolveVectorStores(settings, pmRoot) {
1019
1345
  const qdrant = resolveQdrantStore(settings);
1020
- const lancedb = resolveLanceDbStore(settings);
1346
+ const lancedb = resolveLanceDbStore(settings, pmRoot);
1021
1347
  const available = [qdrant, lancedb].filter((entry) => entry !== null);
1022
1348
  const preferredName = toNonEmptyString(settings.vector_store?.adapter);
1023
1349
  const preferredKey = preferredName ? preferredName.toLowerCase() : null;
@@ -1335,311 +1661,27 @@ function inferConsistentVectorDimension(vectors, context) {
1335
1661
  }
1336
1662
 
1337
1663
  // dist/core/search/cache.js
1338
- import path2 from "node:path";
1339
-
1340
- // dist/core/search/embedding-batches.js
1341
- function resolveBatchRuntime(settings, maxInputCharacters) {
1342
- const batchSizeCandidate = settings.search.embedding_batch_size;
1343
- const timeoutMsCandidate = settings.search.embedding_timeout_ms;
1344
- const maxRetriesCandidate = settings.search.scanner_max_batch_retries;
1345
- const batchSize = Number.isFinite(batchSizeCandidate) && batchSizeCandidate > 0 ? Math.floor(batchSizeCandidate) : 1;
1346
- const timeoutMs = Number.isFinite(timeoutMsCandidate) && timeoutMsCandidate > 0 ? Math.floor(timeoutMsCandidate) : 3e4;
1347
- const maxRetries = Number.isFinite(maxRetriesCandidate) && maxRetriesCandidate >= 0 ? Math.floor(maxRetriesCandidate) : 0;
1348
- return {
1349
- batchSize,
1350
- timeoutMs,
1351
- maxRetries,
1352
- maxBatchInputCharacters: Number.POSITIVE_INFINITY,
1353
- maxInputCharacters
1354
- };
1664
+ var SEARCH_CACHE_ARTIFACT_PATHS = ["index/manifest.json", "search/embeddings.jsonl"];
1665
+ var VECTORIZATION_STATUS_LEDGER_PATH = "search/vectorization-status.json";
1666
+ function formatInvalidationWarning(relativePath, error) {
1667
+ return `search_cache_invalidation_failed:${relativePath}:${String(error)}`;
1355
1668
  }
1356
- function createBatches(inputs, batchSize, maxBatchInputCharacters) {
1357
- const batches = [];
1358
- let currentBatch = [];
1359
- let currentCharacters = 0;
1360
- for (const input of inputs) {
1361
- const wouldExceedCount = currentBatch.length >= batchSize;
1362
- const wouldExceedCharacters = currentBatch.length > 0 && Number.isFinite(maxBatchInputCharacters) && currentCharacters + input.length > maxBatchInputCharacters;
1363
- if (wouldExceedCount || wouldExceedCharacters) {
1364
- batches.push(currentBatch);
1365
- currentBatch = [];
1366
- currentCharacters = 0;
1367
- }
1368
- currentBatch.push(input);
1369
- currentCharacters += input.length;
1370
- }
1371
- batches.push(currentBatch);
1372
- return batches;
1669
+ function toUniqueSorted(values) {
1670
+ return [...new Set([...values].map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
1373
1671
  }
1374
- function resolveProviderBatchRuntime(provider, runtime) {
1375
- if (provider.name !== "ollama") {
1376
- return runtime;
1377
- }
1378
- return {
1379
- ...runtime,
1380
- maxBatchInputCharacters: OLLAMA_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS
1381
- };
1672
+ function isValidUpdatedAt(value) {
1673
+ return typeof value === "string" && value.trim().length > 0 && Number.isFinite(Date.parse(value));
1382
1674
  }
1383
- function truncateInputForRuntime(input, maxInputCharacters) {
1384
- if (!Number.isFinite(maxInputCharacters) || maxInputCharacters <= 0 || input.length <= maxInputCharacters) {
1385
- return input;
1675
+ function normalizeVectorizationLedgerEntries(entries) {
1676
+ const normalized = /* @__PURE__ */ new Map();
1677
+ for (const [rawId, rawUpdatedAt] of Object.entries(entries)) {
1678
+ const id = rawId.trim();
1679
+ if (id.length === 0 || !isValidUpdatedAt(rawUpdatedAt)) {
1680
+ continue;
1681
+ }
1682
+ normalized.set(id, rawUpdatedAt);
1386
1683
  }
1387
- const keepLength = Math.max(0, maxInputCharacters - SEMANTIC_CORPUS_TRUNCATION_SUFFIX.length);
1388
- return `${input.slice(0, keepLength)}${SEMANTIC_CORPUS_TRUNCATION_SUFFIX}`.slice(0, maxInputCharacters);
1389
- }
1390
- function isEmbeddingTimeoutError(error) {
1391
- const message = toErrorMessage(error).toLowerCase();
1392
- return message.includes("timed out") || message.includes("timeout");
1393
- }
1394
- function buildEmbeddingFailureMessage(provider, batchLabel, batchSize, timeoutMs, attempts, error) {
1395
- const base = `Embedding batch ${batchLabel} failed after ${attempts} attempt(s): ${toErrorMessage(error)}`;
1396
- const details = `provider=${provider.name} model=${provider.model} batch_size=${batchSize} timeout_ms=${timeoutMs}`;
1397
- if (!isEmbeddingTimeoutError(error)) {
1398
- return `${base} (${details})`;
1399
- }
1400
- return `${base} (${details}; guidance=check provider availability or lower search.embedding_batch_size, raise search.embedding_timeout_ms, or run keyword search while semantic indexing catches up)`;
1401
- }
1402
- async function executeBatchWithAdaptiveSplit(provider, batch, batchLabel, timeoutMs, maxRetries, warnings) {
1403
- let lastError = null;
1404
- for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
1405
- try {
1406
- const batchVectors = await executeEmbeddingRequest(provider, batch, { timeout_ms: timeoutMs });
1407
- if (attempt > 0) {
1408
- warnings.push(`search_embedding_batch_retry_succeeded:batch=${batchLabel}:attempt=${attempt + 1}:size=${batch.length}`);
1409
- }
1410
- return batchVectors;
1411
- } catch (error) {
1412
- lastError = error;
1413
- if (isEmbeddingTimeoutError(error) && batch.length > 1) {
1414
- const midpoint = Math.ceil(batch.length / 2);
1415
- const left = batch.slice(0, midpoint);
1416
- const right = batch.slice(midpoint);
1417
- warnings.push(`search_embedding_batch_split_after_timeout:batch=${batchLabel}:size=${batch.length}:parts=${left.length}|${right.length}`);
1418
- return [
1419
- ...await executeBatchWithAdaptiveSplit(provider, left, `${batchLabel}.1`, timeoutMs, maxRetries, warnings),
1420
- ...await executeBatchWithAdaptiveSplit(provider, right, `${batchLabel}.2`, timeoutMs, maxRetries, warnings)
1421
- ];
1422
- }
1423
- if (attempt < maxRetries) {
1424
- const delayMs = Math.min(1e3 * 2 ** attempt, 8e3);
1425
- await new Promise((resolve2) => setTimeout(resolve2, delayMs));
1426
- }
1427
- }
1428
- }
1429
- throw new Error(buildEmbeddingFailureMessage(provider, batchLabel, batch.length, timeoutMs, maxRetries + 1, lastError));
1430
- }
1431
- async function executeEmbeddingBatchesWithRetry(provider, settings, inputs, options = {}) {
1432
- if (inputs.length === 0) {
1433
- return {
1434
- vectors: [],
1435
- warnings: []
1436
- };
1437
- }
1438
- const warnings = [];
1439
- const corpusLimitResolution = resolveSemanticCorpusCharacterLimit(provider.name, settings.search.embedding_corpus_max_characters);
1440
- if (corpusLimitResolution.warning) {
1441
- warnings.push(corpusLimitResolution.warning);
1442
- }
1443
- const runtime = resolveProviderBatchRuntime(provider, resolveBatchRuntime(settings, corpusLimitResolution.maxCharacters));
1444
- let truncatedInputCount = 0;
1445
- const normalizedInputs = inputs.map((input) => {
1446
- const normalized = truncateInputForRuntime(input, runtime.maxInputCharacters);
1447
- if (normalized.length < input.length) {
1448
- truncatedInputCount += 1;
1449
- }
1450
- return normalized;
1451
- });
1452
- if (truncatedInputCount > 0) {
1453
- warnings.push(`search_embedding_input_truncated:count=${truncatedInputCount}:max_characters=${runtime.maxInputCharacters}`);
1454
- }
1455
- const batches = createBatches(normalizedInputs, runtime.batchSize, runtime.maxBatchInputCharacters);
1456
- const vectors = [];
1457
- let completedInputs = 0;
1458
- for (let batchIndex = 0; batchIndex < batches.length; batchIndex += 1) {
1459
- const batch = batches[batchIndex];
1460
- options.onProgress?.({
1461
- batch_index: batchIndex + 1,
1462
- batch_total: batches.length,
1463
- batch_size: batch.length,
1464
- completed_inputs: completedInputs,
1465
- total_inputs: normalizedInputs.length,
1466
- phase: "start"
1467
- });
1468
- vectors.push(...await executeBatchWithAdaptiveSplit(provider, batch, String(batchIndex + 1), runtime.timeoutMs, runtime.maxRetries, warnings));
1469
- completedInputs += batch.length;
1470
- options.onProgress?.({
1471
- batch_index: batchIndex + 1,
1472
- batch_total: batches.length,
1473
- batch_size: batch.length,
1474
- completed_inputs: completedInputs,
1475
- total_inputs: normalizedInputs.length,
1476
- phase: "complete"
1477
- });
1478
- }
1479
- return {
1480
- vectors,
1481
- warnings
1482
- };
1483
- }
1484
-
1485
- // dist/core/search/background-refresh.js
1486
- import { spawn } from "node:child_process";
1487
- import { mkdirSync, rmSync, statSync } from "node:fs";
1488
- import path from "node:path";
1489
- var REINDEX_LOCK_ID = "reindex";
1490
- var PENDING_QUEUE_REL_PATH = "search/pending-refresh.json";
1491
- var PENDING_QUEUE_GATE_REL_PATH = "search/pending-refresh.gate.lock";
1492
- var PENDING_QUEUE_GATE_STALE_MS = 3e4;
1493
- var SEARCH_REFRESH_INLINE_ENV = "PM_SEARCH_REFRESH_INLINE";
1494
- var SEARCH_REFRESH_CHILD_ENV = "PM_SEARCH_REFRESH_CHILD";
1495
- function parseBooleanTrueLike(value) {
1496
- if (typeof value !== "string") {
1497
- return false;
1498
- }
1499
- const normalized = value.trim().toLowerCase();
1500
- return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "on";
1501
- }
1502
- function shouldRunSearchRefreshInForeground() {
1503
- if (parseBooleanTrueLike(process.env[SEARCH_REFRESH_INLINE_ENV])) {
1504
- return true;
1505
- }
1506
- if (parseBooleanTrueLike(process.env[SEARCH_REFRESH_CHILD_ENV])) {
1507
- return true;
1508
- }
1509
- const nodeEnv = (process.env.NODE_ENV ?? "").trim().toLowerCase();
1510
- return typeof process.env.VITEST === "string" || typeof process.env.VITEST_WORKER_ID === "string" || nodeEnv === "test";
1511
- }
1512
- function pendingQueuePath(pmRoot) {
1513
- return path.join(pmRoot, PENDING_QUEUE_REL_PATH);
1514
- }
1515
- function pendingQueueGatePath(pmRoot) {
1516
- return path.join(pmRoot, PENDING_QUEUE_GATE_REL_PATH);
1517
- }
1518
- function acquireQueueGate(pmRoot) {
1519
- const gatePath = pendingQueueGatePath(pmRoot);
1520
- try {
1521
- if (Date.now() - statSync(gatePath).mtimeMs < PENDING_QUEUE_GATE_STALE_MS) {
1522
- return false;
1523
- }
1524
- rmSync(gatePath, { recursive: true, force: true });
1525
- } catch {
1526
- }
1527
- try {
1528
- mkdirSync(path.dirname(gatePath), { recursive: true });
1529
- mkdirSync(gatePath);
1530
- return true;
1531
- } catch {
1532
- return false;
1533
- }
1534
- }
1535
- function releaseQueueGate(pmRoot) {
1536
- try {
1537
- rmSync(pendingQueueGatePath(pmRoot), { recursive: true, force: true });
1538
- } catch {
1539
- }
1540
- }
1541
- async function withQueueGate(pmRoot, fn, fallback) {
1542
- for (let attempt = 0; attempt < 50; attempt += 1) {
1543
- if (acquireQueueGate(pmRoot)) {
1544
- try {
1545
- return await fn();
1546
- } finally {
1547
- releaseQueueGate(pmRoot);
1548
- }
1549
- }
1550
- await delay(20);
1551
- }
1552
- return fallback;
1553
- }
1554
- function delay(ms) {
1555
- return new Promise((resolve2) => {
1556
- setTimeout(resolve2, ms);
1557
- });
1558
- }
1559
- async function readPendingQueueIds(pmRoot) {
1560
- const raw = await readFileIfExists(pendingQueuePath(pmRoot));
1561
- if (!raw || raw.trim().length === 0) {
1562
- return [];
1563
- }
1564
- try {
1565
- const parsed = JSON.parse(raw);
1566
- if (!Array.isArray(parsed.ids)) {
1567
- return [];
1568
- }
1569
- return parsed.ids.filter((id) => typeof id === "string" && id.length > 0);
1570
- } catch {
1571
- return [];
1572
- }
1573
- }
1574
- async function writePendingQueueIds(pmRoot, ids) {
1575
- await writeFileAtomic(pendingQueuePath(pmRoot), `${JSON.stringify({ ids })}
1576
- `);
1577
- }
1578
- async function enqueuePendingRefreshIds(pmRoot, itemIds) {
1579
- const incoming = itemIds.filter((id) => typeof id === "string" && id.trim().length > 0);
1580
- if (incoming.length === 0) {
1581
- return;
1582
- }
1583
- const mergeIncoming = async () => {
1584
- const existing = await readPendingQueueIds(pmRoot);
1585
- const merged = [.../* @__PURE__ */ new Set([...existing, ...incoming])].sort((left, right) => left.localeCompare(right));
1586
- await writePendingQueueIds(pmRoot, merged);
1587
- };
1588
- const gated = await withQueueGate(pmRoot, async () => {
1589
- await mergeIncoming();
1590
- return true;
1591
- }, false);
1592
- if (!gated) {
1593
- await mergeIncoming();
1594
- }
1595
- }
1596
- function searchRefreshRunnerPath() {
1597
- return path.join(resolvePmPackageRootFromModule(import.meta.url, ["../../.."]), "dist", "cli", "search-refresh.js");
1598
- }
1599
- function dispatchRefreshChild(pmRoot) {
1600
- try {
1601
- const child = spawn(process.execPath, [searchRefreshRunnerPath()], {
1602
- detached: true,
1603
- stdio: "ignore",
1604
- env: {
1605
- ...process.env,
1606
- PM_PATH: pmRoot,
1607
- [SEARCH_REFRESH_CHILD_ENV]: "1"
1608
- }
1609
- });
1610
- child.on("error", () => {
1611
- });
1612
- child.unref();
1613
- } catch {
1614
- }
1615
- }
1616
- async function scheduleBackgroundSemanticRefresh(pmRoot, itemIds) {
1617
- await enqueuePendingRefreshIds(pmRoot, itemIds);
1618
- dispatchRefreshChild(pmRoot);
1619
- }
1620
-
1621
- // dist/core/search/cache.js
1622
- var SEARCH_CACHE_ARTIFACT_PATHS = ["index/manifest.json", "search/embeddings.jsonl"];
1623
- var VECTORIZATION_STATUS_LEDGER_PATH = "search/vectorization-status.json";
1624
- function formatInvalidationWarning(relativePath, error) {
1625
- return `search_cache_invalidation_failed:${relativePath}:${String(error)}`;
1626
- }
1627
- function toUniqueSorted(values) {
1628
- return [...new Set([...values].map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
1629
- }
1630
- function isValidUpdatedAt(value) {
1631
- return typeof value === "string" && value.trim().length > 0 && Number.isFinite(Date.parse(value));
1632
- }
1633
- function normalizeVectorizationLedgerEntries(entries) {
1634
- const normalized = /* @__PURE__ */ new Map();
1635
- for (const [rawId, rawUpdatedAt] of Object.entries(entries)) {
1636
- const id = rawId.trim();
1637
- if (id.length === 0 || !isValidUpdatedAt(rawUpdatedAt)) {
1638
- continue;
1639
- }
1640
- normalized.set(id, rawUpdatedAt);
1641
- }
1642
- return Object.fromEntries([...normalized.entries()].sort((left, right) => left[0].localeCompare(right[0])));
1684
+ return Object.fromEntries([...normalized.entries()].sort((left, right) => left[0].localeCompare(right[0])));
1643
1685
  }
1644
1686
  async function readVectorizationStatusLedger(pmRoot) {
1645
1687
  const ledgerPath = path2.join(pmRoot, VECTORIZATION_STATUS_LEDGER_PATH);
@@ -1757,7 +1799,7 @@ async function resolveSemanticRefreshRuntimeContext(pmRoot, normalizedItemIds, o
1757
1799
  if (!provider) {
1758
1800
  return buildSkippedSemanticRefreshResult(normalizedItemIds, "search_semantic_refresh_skipped:provider_unconfigured");
1759
1801
  }
1760
- const vectorStore = resolveVectorStores(effectiveSettings).active;
1802
+ const vectorStore = resolveVectorStores(effectiveSettings, pmRoot).active;
1761
1803
  if (!vectorStore) {
1762
1804
  return buildSkippedSemanticRefreshResult(normalizedItemIds, "search_semantic_refresh_skipped:vector_store_unconfigured");
1763
1805
  }
@@ -2011,6 +2053,763 @@ async function refreshSearchArtifactsForMutation(pmRoot, itemIds, options = {})
2011
2053
  };
2012
2054
  }
2013
2055
 
2056
+ // dist/cli/registration-helpers.js
2057
+ var RESOLVED_GLOBAL_OPTIONS = /* @__PURE__ */ Symbol("pm.resolvedGlobalOptions");
2058
+ function commandOptionsReader(command) {
2059
+ return typeof command === "object" && command !== null ? command : {};
2060
+ }
2061
+ function resolveCommanderContract(contracts, target) {
2062
+ const contract = contracts.find((entry) => entry.target === target);
2063
+ return contract ?? { target, keys: [target] };
2064
+ }
2065
+ function setResolvedGlobalOptions(command, globalOptions) {
2066
+ command[RESOLVED_GLOBAL_OPTIONS] = { ...globalOptions };
2067
+ }
2068
+ function clearResolvedGlobalOptions(command) {
2069
+ delete command[RESOLVED_GLOBAL_OPTIONS];
2070
+ }
2071
+ function getGlobalOptions(command) {
2072
+ const resolved = command[RESOLVED_GLOBAL_OPTIONS];
2073
+ if (resolved) {
2074
+ return { ...resolved };
2075
+ }
2076
+ const reader = commandOptionsReader(command);
2077
+ const opts = typeof reader.optsWithGlobals === "function" ? reader.optsWithGlobals() : typeof reader.opts === "function" ? reader.opts() : {};
2078
+ return {
2079
+ json: opts.json === true ? true : void 0,
2080
+ quiet: Boolean(opts.quiet),
2081
+ noChangedFields: opts.changedFields === false,
2082
+ idOnly: opts.idOnly === true,
2083
+ path: typeof opts.pmPath === "string" ? opts.pmPath : typeof opts.path === "string" ? opts.path : void 0,
2084
+ noExtensions: opts.extensions === false,
2085
+ noPager: Boolean(opts.noPager),
2086
+ profile: Boolean(opts.profile)
2087
+ };
2088
+ }
2089
+ function getCommandPath(command) {
2090
+ const parts = [];
2091
+ let current = command;
2092
+ while (current?.parent) {
2093
+ parts.unshift(current.name());
2094
+ current = current.parent;
2095
+ }
2096
+ return parts.join(" ");
2097
+ }
2098
+ async function applyDefaultOutputFormat(globalOptions) {
2099
+ if (globalOptions.json === true) {
2100
+ return globalOptions;
2101
+ }
2102
+ const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);
2103
+ if (!await pathExists(getSettingsPath(pmRoot))) {
2104
+ return globalOptions;
2105
+ }
2106
+ const settings = await readSettings(pmRoot);
2107
+ return {
2108
+ ...globalOptions,
2109
+ defaultOutputFormat: settings.output.default_format
2110
+ };
2111
+ }
2112
+ function collect(value, previous) {
2113
+ const next = previous ?? [];
2114
+ next.push(value);
2115
+ return next;
2116
+ }
2117
+ function pushOptionalValueFlag(args, flag, value) {
2118
+ if (typeof value !== "string") {
2119
+ return;
2120
+ }
2121
+ const trimmed = value.trim();
2122
+ if (trimmed.length === 0) {
2123
+ return;
2124
+ }
2125
+ args.push(flag, trimmed);
2126
+ }
2127
+ function pushOptionalBooleanFlag(args, flag, value) {
2128
+ if (value === true) {
2129
+ args.push(flag);
2130
+ }
2131
+ }
2132
+ function pushRepeatableValueFlag(args, flag, values) {
2133
+ if (!Array.isArray(values)) {
2134
+ return;
2135
+ }
2136
+ for (const value of values) {
2137
+ if (typeof value !== "string") {
2138
+ continue;
2139
+ }
2140
+ const trimmed = value.trim();
2141
+ if (trimmed.length === 0) {
2142
+ continue;
2143
+ }
2144
+ args.push(flag, trimmed);
2145
+ }
2146
+ }
2147
+ function optionTrue(options, key) {
2148
+ return options[key] === true ? true : void 0;
2149
+ }
2150
+ function optionFalse(options, key) {
2151
+ return options[key] === false ? true : void 0;
2152
+ }
2153
+ function readOptionString(options, key) {
2154
+ return typeof options[key] === "string" ? options[key] : void 0;
2155
+ }
2156
+ function addHiddenOption(command, flags, description) {
2157
+ command.addOption(new Option(flags, description).hideHelp());
2158
+ }
2159
+ function anyOptionTrue(options, keys) {
2160
+ return keys.some((key) => options[key] === true) ? true : void 0;
2161
+ }
2162
+ function copyUnknownOptions(target, source) {
2163
+ for (const [key, value] of Object.entries(source)) {
2164
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
2165
+ continue;
2166
+ }
2167
+ if (Object.hasOwn(target, key)) {
2168
+ continue;
2169
+ }
2170
+ target[key] = value;
2171
+ }
2172
+ }
2173
+ function buildBackgroundTestCommandArgs(id, options) {
2174
+ const args = ["test", id, "--run", "--json", "--progress"];
2175
+ pushRepeatableValueFlag(args, "--add", options.add);
2176
+ pushRepeatableValueFlag(args, "--add-json", options.addJson);
2177
+ pushRepeatableValueFlag(args, "--remove", options.remove);
2178
+ pushOptionalValueFlag(args, "--match", options.match);
2179
+ pushOptionalValueFlag(args, "--only-index", options.onlyIndex);
2180
+ pushOptionalBooleanFlag(args, "--only-last", options.onlyLast);
2181
+ pushOptionalValueFlag(args, "--timeout", options.timeout);
2182
+ pushRepeatableValueFlag(args, "--env-set", options.envSet);
2183
+ pushRepeatableValueFlag(args, "--env-clear", options.envClear);
2184
+ pushOptionalBooleanFlag(args, "--shared-host-safe", options.sharedHostSafe);
2185
+ pushOptionalValueFlag(args, "--pm-context", options.pmContext);
2186
+ pushOptionalBooleanFlag(args, "--override-linked-pm-context", options.overrideLinkedPmContext);
2187
+ pushOptionalBooleanFlag(args, "--fail-on-context-mismatch", options.failOnContextMismatch);
2188
+ pushOptionalBooleanFlag(args, "--fail-on-skipped", options.failOnSkipped);
2189
+ pushOptionalBooleanFlag(args, "--fail-on-empty-test-run", options.failOnEmptyTestRun);
2190
+ pushOptionalBooleanFlag(args, "--require-assertions-for-pm", options.requireAssertionsForPm);
2191
+ pushOptionalBooleanFlag(args, "--check-context", options.checkContext);
2192
+ pushOptionalBooleanFlag(args, "--auto-pm-context", options.autoPmContext);
2193
+ pushOptionalValueFlag(args, "--author", options.author);
2194
+ pushOptionalValueFlag(args, "--message", options.message);
2195
+ pushOptionalBooleanFlag(args, "--force", options.force);
2196
+ return args;
2197
+ }
2198
+ function buildBackgroundTestAllCommandArgs(options) {
2199
+ const args = ["test-all", "--json", "--progress"];
2200
+ pushOptionalValueFlag(args, "--status", options.status);
2201
+ pushOptionalValueFlag(args, "--limit", options.limit);
2202
+ pushOptionalValueFlag(args, "--offset", options.offset);
2203
+ pushOptionalValueFlag(args, "--timeout", options.timeout);
2204
+ pushRepeatableValueFlag(args, "--env-set", options.envSet);
2205
+ pushRepeatableValueFlag(args, "--env-clear", options.envClear);
2206
+ pushOptionalBooleanFlag(args, "--shared-host-safe", options.sharedHostSafe);
2207
+ pushOptionalValueFlag(args, "--pm-context", options.pmContext);
2208
+ pushOptionalBooleanFlag(args, "--override-linked-pm-context", options.overrideLinkedPmContext);
2209
+ pushOptionalBooleanFlag(args, "--fail-on-context-mismatch", options.failOnContextMismatch);
2210
+ pushOptionalBooleanFlag(args, "--fail-on-skipped", options.failOnSkipped);
2211
+ pushOptionalBooleanFlag(args, "--fail-on-empty-test-run", options.failOnEmptyTestRun);
2212
+ pushOptionalBooleanFlag(args, "--require-assertions-for-pm", options.requireAssertionsForPm);
2213
+ pushOptionalBooleanFlag(args, "--check-context", options.checkContext);
2214
+ pushOptionalBooleanFlag(args, "--auto-pm-context", options.autoPmContext);
2215
+ return args;
2216
+ }
2217
+ function formatHookWarnings(warnings) {
2218
+ return warnings.join(",");
2219
+ }
2220
+ function normalizeCreateOptions(commandOptions, options = {}) {
2221
+ const readCreateString = (target) => readFirstStringFromCommanderOptions(commandOptions, resolveCommanderContract(CREATE_COMMANDER_STRING_OPTION_CONTRACTS, target));
2222
+ const readCreateList = (target) => readStringArrayFromCommanderOptions(commandOptions, resolveCommanderContract(CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, target));
2223
+ const type = readCreateString("type");
2224
+ if (options.requireType !== false && type === void 0) {
2225
+ throw new PmCliError("Missing required option --type <value>. Why required: create resolves runtime schema fields/workflow from item type. Retry: add --type <built-in or configured custom type> (example: --type Task).", EXIT_CODE.USAGE);
2226
+ }
2227
+ const normalized = {
2228
+ title: readCreateString("title"),
2229
+ description: readCreateString("description"),
2230
+ type,
2231
+ template: readCreateString("template"),
2232
+ createMode: readCreateString("createMode"),
2233
+ schedulePreset: readCreateString("schedulePreset"),
2234
+ status: readCreateString("status"),
2235
+ priority: readCreateString("priority"),
2236
+ tags: readCreateString("tags"),
2237
+ addTags: readCreateList("addTags"),
2238
+ body: readCreateString("body"),
2239
+ deadline: readCreateString("deadline"),
2240
+ estimatedMinutes: readCreateString("estimatedMinutes"),
2241
+ acceptanceCriteria: readCreateString("acceptanceCriteria"),
2242
+ definitionOfReady: readCreateString("definitionOfReady"),
2243
+ order: readCreateString("order"),
2244
+ rank: readCreateString("rank"),
2245
+ goal: readCreateString("goal"),
2246
+ objective: readCreateString("objective"),
2247
+ value: readCreateString("value"),
2248
+ impact: readCreateString("impact"),
2249
+ outcome: readCreateString("outcome"),
2250
+ whyNow: readCreateString("whyNow"),
2251
+ author: readCreateString("author"),
2252
+ message: readCreateString("message"),
2253
+ assignee: readCreateString("assignee"),
2254
+ parent: readCreateString("parent"),
2255
+ allowMissingParent: optionTrue(commandOptions, "allowMissingParent") === true,
2256
+ reviewer: readCreateString("reviewer"),
2257
+ risk: readCreateString("risk"),
2258
+ confidence: readCreateString("confidence"),
2259
+ sprint: readCreateString("sprint"),
2260
+ release: readCreateString("release"),
2261
+ blockedBy: readCreateString("blockedBy"),
2262
+ blockedReason: readCreateString("blockedReason"),
2263
+ unblockNote: readCreateString("unblockNote"),
2264
+ reporter: readCreateString("reporter"),
2265
+ severity: readCreateString("severity"),
2266
+ environment: readCreateString("environment"),
2267
+ reproSteps: readCreateString("reproSteps"),
2268
+ resolution: readCreateString("resolution"),
2269
+ expectedResult: readCreateString("expectedResult"),
2270
+ actualResult: readCreateString("actualResult"),
2271
+ affectedVersion: readCreateString("affectedVersion"),
2272
+ fixedVersion: readCreateString("fixedVersion"),
2273
+ component: readCreateString("component"),
2274
+ regression: readCreateString("regression"),
2275
+ customerImpact: readCreateString("customerImpact"),
2276
+ dep: readCreateList("dep"),
2277
+ comment: readCreateList("comment"),
2278
+ note: readCreateList("note"),
2279
+ learning: readCreateList("learning"),
2280
+ file: readCreateList("file"),
2281
+ test: readCreateList("test"),
2282
+ doc: readCreateList("doc"),
2283
+ reminder: readCreateList("reminder"),
2284
+ event: readCreateList("event"),
2285
+ typeOption: readCreateList("typeOption"),
2286
+ field: readCreateList("field"),
2287
+ unset: readCreateList("unset"),
2288
+ clearDeps: optionTrue(commandOptions, "clearDeps"),
2289
+ clearComments: optionTrue(commandOptions, "clearComments"),
2290
+ clearNotes: optionTrue(commandOptions, "clearNotes"),
2291
+ clearLearnings: optionTrue(commandOptions, "clearLearnings"),
2292
+ clearFiles: optionTrue(commandOptions, "clearFiles"),
2293
+ clearTests: optionTrue(commandOptions, "clearTests"),
2294
+ clearDocs: optionTrue(commandOptions, "clearDocs"),
2295
+ clearReminders: optionTrue(commandOptions, "clearReminders"),
2296
+ clearEvents: optionTrue(commandOptions, "clearEvents"),
2297
+ clearTypeOptions: optionTrue(commandOptions, "clearTypeOptions")
2298
+ };
2299
+ copyUnknownOptions(normalized, commandOptions);
2300
+ return normalized;
2301
+ }
2302
+ function normalizeUpdateOptions(commandOptions) {
2303
+ const readUpdateString = (target) => readFirstStringFromCommanderOptions(commandOptions, resolveCommanderContract(UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, target));
2304
+ const readUpdateList = (target) => readStringArrayFromCommanderOptions(commandOptions, resolveCommanderContract(UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, target));
2305
+ const normalized = {
2306
+ title: readUpdateString("title"),
2307
+ description: readUpdateString("description"),
2308
+ body: readUpdateString("body"),
2309
+ status: readUpdateString("status"),
2310
+ closeReason: readUpdateString("closeReason"),
2311
+ priority: readUpdateString("priority"),
2312
+ type: readUpdateString("type"),
2313
+ tags: readUpdateString("tags"),
2314
+ addTags: readUpdateList("addTags"),
2315
+ removeTags: readUpdateList("removeTags"),
2316
+ deadline: readUpdateString("deadline"),
2317
+ estimatedMinutes: readUpdateString("estimatedMinutes"),
2318
+ acceptanceCriteria: readUpdateString("acceptanceCriteria"),
2319
+ definitionOfReady: readUpdateString("definitionOfReady"),
2320
+ order: readUpdateString("order"),
2321
+ rank: readUpdateString("rank"),
2322
+ goal: readUpdateString("goal"),
2323
+ objective: readUpdateString("objective"),
2324
+ value: readUpdateString("value"),
2325
+ impact: readUpdateString("impact"),
2326
+ outcome: readUpdateString("outcome"),
2327
+ whyNow: readUpdateString("whyNow"),
2328
+ author: readUpdateString("author"),
2329
+ message: readUpdateString("message"),
2330
+ force: Boolean(commandOptions.force),
2331
+ allowAuditUpdate: anyOptionTrue(commandOptions, ["allowAuditUpdate", "allow_audit_update"]),
2332
+ allowAuditDepUpdate: anyOptionTrue(commandOptions, ["allowAuditDepUpdate", "allow_audit_dep_update"]),
2333
+ assignee: readUpdateString("assignee"),
2334
+ parent: readUpdateString("parent"),
2335
+ reviewer: readUpdateString("reviewer"),
2336
+ risk: readUpdateString("risk"),
2337
+ confidence: readUpdateString("confidence"),
2338
+ sprint: readUpdateString("sprint"),
2339
+ release: readUpdateString("release"),
2340
+ blockedBy: readUpdateString("blockedBy"),
2341
+ blockedReason: readUpdateString("blockedReason"),
2342
+ unblockNote: readUpdateString("unblockNote"),
2343
+ reporter: readUpdateString("reporter"),
2344
+ severity: readUpdateString("severity"),
2345
+ environment: readUpdateString("environment"),
2346
+ reproSteps: readUpdateString("reproSteps"),
2347
+ resolution: readUpdateString("resolution"),
2348
+ expectedResult: readUpdateString("expectedResult"),
2349
+ actualResult: readUpdateString("actualResult"),
2350
+ affectedVersion: readUpdateString("affectedVersion"),
2351
+ fixedVersion: readUpdateString("fixedVersion"),
2352
+ component: readUpdateString("component"),
2353
+ regression: readUpdateString("regression"),
2354
+ customerImpact: readUpdateString("customerImpact"),
2355
+ dep: readUpdateList("dep"),
2356
+ depRemove: readUpdateList("depRemove"),
2357
+ replaceDeps: optionTrue(commandOptions, "replaceDeps"),
2358
+ replaceTests: optionTrue(commandOptions, "replaceTests"),
2359
+ comment: readUpdateList("comment"),
2360
+ note: readUpdateList("note"),
2361
+ learning: readUpdateList("learning"),
2362
+ file: readUpdateList("file"),
2363
+ test: readUpdateList("test"),
2364
+ doc: readUpdateList("doc"),
2365
+ reminder: readUpdateList("reminder"),
2366
+ event: readUpdateList("event"),
2367
+ typeOption: readUpdateList("typeOption"),
2368
+ field: readUpdateList("field"),
2369
+ unset: readUpdateList("unset"),
2370
+ clearDeps: optionTrue(commandOptions, "clearDeps"),
2371
+ clearComments: optionTrue(commandOptions, "clearComments"),
2372
+ clearNotes: optionTrue(commandOptions, "clearNotes"),
2373
+ clearLearnings: optionTrue(commandOptions, "clearLearnings"),
2374
+ clearFiles: optionTrue(commandOptions, "clearFiles"),
2375
+ clearTests: optionTrue(commandOptions, "clearTests"),
2376
+ clearDocs: optionTrue(commandOptions, "clearDocs"),
2377
+ clearReminders: optionTrue(commandOptions, "clearReminders"),
2378
+ clearEvents: optionTrue(commandOptions, "clearEvents"),
2379
+ clearTypeOptions: optionTrue(commandOptions, "clearTypeOptions")
2380
+ };
2381
+ copyUnknownOptions(normalized, commandOptions);
2382
+ return normalized;
2383
+ }
2384
+ var UPDATE_MANY_CONTROL_OPTION_KEYS = /* @__PURE__ */ new Set([
2385
+ "filterStatus",
2386
+ "filterType",
2387
+ "filterTag",
2388
+ "filterPriority",
2389
+ "filterDeadlineBefore",
2390
+ "filterDeadlineAfter",
2391
+ "filterUpdatedAfter",
2392
+ "filterUpdatedBefore",
2393
+ "filterCreatedAfter",
2394
+ "filterCreatedBefore",
2395
+ "filterAssignee",
2396
+ "filterAssigneeFilter",
2397
+ "filterAssignee_filter",
2398
+ "filterParent",
2399
+ "filterSprint",
2400
+ "filterRelease",
2401
+ "filterAcMissing",
2402
+ "filterEstimatesMissing",
2403
+ "filterEstimateMissing",
2404
+ "filterResolutionMissing",
2405
+ "filterMetadataMissing",
2406
+ "filterReviewerMissing",
2407
+ "filterRiskMissing",
2408
+ "filterConfidenceMissing",
2409
+ "filterSprintMissing",
2410
+ "filterReleaseMissing",
2411
+ "filterHasNotes",
2412
+ "filterNoNotes",
2413
+ "filterHasLearnings",
2414
+ "filterNoLearnings",
2415
+ "filterHasFiles",
2416
+ "filterNoFiles",
2417
+ "filterHasDocs",
2418
+ "filterNoDocs",
2419
+ "filterHasTests",
2420
+ "filterNoTests",
2421
+ "filterHasComments",
2422
+ "filterNoComments",
2423
+ "filterHasDeps",
2424
+ "filterNoDeps",
2425
+ "filterHasBody",
2426
+ "filterEmptyBody",
2427
+ "filterHasLinkedCommand",
2428
+ "filterNoLinkedCommand",
2429
+ "ids",
2430
+ "limit",
2431
+ "offset",
2432
+ "dryRun",
2433
+ "rollback",
2434
+ "checkpoint"
2435
+ ]);
2436
+ function extractUpdateManyMutationOptionSource(commandOptions) {
2437
+ const mutationOptions = {};
2438
+ for (const [key, value] of Object.entries(commandOptions)) {
2439
+ if (UPDATE_MANY_CONTROL_OPTION_KEYS.has(key)) {
2440
+ continue;
2441
+ }
2442
+ mutationOptions[key] = value;
2443
+ }
2444
+ return mutationOptions;
2445
+ }
2446
+ function readListOptionString(options, target) {
2447
+ const contract = resolveCommanderContract(LIST_COMMANDER_STRING_OPTION_CONTRACTS, target);
2448
+ const stringValue = readFirstStringFromCommanderOptions(options, contract);
2449
+ if (stringValue !== void 0) {
2450
+ return stringValue;
2451
+ }
2452
+ for (const key of contract.keys) {
2453
+ const value = options[key];
2454
+ if (target === "ids" && typeof value === "string") {
2455
+ return value;
2456
+ }
2457
+ if (typeof value === "number" && Number.isFinite(value)) {
2458
+ return String(value);
2459
+ }
2460
+ }
2461
+ return void 0;
2462
+ }
2463
+ function readSelectionFilterOptionFields(options) {
2464
+ const filterFilesMissing = optionTrue(options, "filterFilesMissing");
2465
+ const filterDocsMissing = optionTrue(options, "filterDocsMissing");
2466
+ return {
2467
+ filterReviewerMissing: optionTrue(options, "filterReviewerMissing"),
2468
+ filterRiskMissing: optionTrue(options, "filterRiskMissing"),
2469
+ filterConfidenceMissing: optionTrue(options, "filterConfidenceMissing"),
2470
+ filterSprintMissing: optionTrue(options, "filterSprintMissing"),
2471
+ filterReleaseMissing: optionTrue(options, "filterReleaseMissing"),
2472
+ hasNotes: optionTrue(options, "hasNotes"),
2473
+ hasLearnings: optionTrue(options, "hasLearnings"),
2474
+ hasFiles: optionTrue(options, "hasFiles"),
2475
+ hasDocs: optionTrue(options, "hasDocs"),
2476
+ hasTests: optionTrue(options, "hasTests"),
2477
+ hasComments: optionTrue(options, "hasComments"),
2478
+ hasDeps: optionTrue(options, "hasDeps"),
2479
+ hasBody: optionTrue(options, "hasBody"),
2480
+ hasLinkedCommand: optionTrue(options, "hasLinkedCommand"),
2481
+ noNotes: optionFalse(options, "notes"),
2482
+ noLearnings: optionFalse(options, "learnings"),
2483
+ noFiles: optionFalse(options, "files") ?? filterFilesMissing,
2484
+ filterFilesMissing,
2485
+ noDocs: optionFalse(options, "docs") ?? filterDocsMissing,
2486
+ filterDocsMissing,
2487
+ noTests: optionFalse(options, "tests"),
2488
+ noComments: optionFalse(options, "comments"),
2489
+ noDeps: optionFalse(options, "deps"),
2490
+ emptyBody: optionTrue(options, "emptyBody"),
2491
+ noLinkedCommand: optionFalse(options, "linkedCommand")
2492
+ };
2493
+ }
2494
+ function normalizeListOptions(options) {
2495
+ const normalized = {
2496
+ status: readListOptionString(options, "status"),
2497
+ type: readListOptionString(options, "type"),
2498
+ tag: readListOptionString(options, "tag"),
2499
+ priority: readListOptionString(options, "priority"),
2500
+ deadlineBefore: readListOptionString(options, "deadlineBefore"),
2501
+ deadlineAfter: readListOptionString(options, "deadlineAfter"),
2502
+ updatedAfter: readListOptionString(options, "updatedAfter"),
2503
+ updatedBefore: readListOptionString(options, "updatedBefore"),
2504
+ createdAfter: readListOptionString(options, "createdAfter"),
2505
+ createdBefore: readListOptionString(options, "createdBefore"),
2506
+ ids: readListOptionString(options, "ids"),
2507
+ assignee: readListOptionString(options, "assignee"),
2508
+ assigneeFilter: readListOptionString(options, "assigneeFilter"),
2509
+ parent: readListOptionString(options, "parent"),
2510
+ sprint: readListOptionString(options, "sprint"),
2511
+ release: readListOptionString(options, "release"),
2512
+ limit: readListOptionString(options, "limit"),
2513
+ offset: readListOptionString(options, "offset"),
2514
+ // Commander stores --no-truncate as truncate=false; --all is the positive alias.
2515
+ noTruncate: optionFalse(options, "truncate") ?? optionTrue(options, "all"),
2516
+ includeBody: optionTrue(options, "includeBody"),
2517
+ compact: optionTrue(options, "compact"),
2518
+ brief: optionTrue(options, "brief"),
2519
+ full: optionTrue(options, "full"),
2520
+ fields: readListOptionString(options, "fields"),
2521
+ sort: readListOptionString(options, "sort"),
2522
+ order: readListOptionString(options, "order"),
2523
+ tree: optionTrue(options, "tree"),
2524
+ treeDepth: readListOptionString(options, "treeDepth"),
2525
+ filterAcMissing: optionTrue(options, "filterAcMissing"),
2526
+ filterEstimatesMissing: anyOptionTrue(options, ["filterEstimatesMissing", "filterEstimateMissing"]),
2527
+ filterResolutionMissing: optionTrue(options, "filterResolutionMissing"),
2528
+ filterMetadataMissing: optionTrue(options, "filterMetadataMissing"),
2529
+ // Governance-missing (GH-236) + content presence/absence (GH-242) filters.
2530
+ ...readSelectionFilterOptionFields(options)
2531
+ };
2532
+ copyUnknownOptions(normalized, options);
2533
+ return normalized;
2534
+ }
2535
+ function normalizeAggregateOptions(options) {
2536
+ return {
2537
+ groupBy: typeof options.groupBy === "string" ? options.groupBy : void 0,
2538
+ count: options.count === true ? true : void 0,
2539
+ completion: options.completion === true ? true : void 0,
2540
+ sum: typeof options.sum === "string" ? options.sum : void 0,
2541
+ avg: typeof options.avg === "string" ? options.avg : void 0,
2542
+ includeUnparented: options.includeUnparented === true || options.include_unparented === true,
2543
+ status: typeof options.status === "string" ? options.status : void 0,
2544
+ type: readListOptionString(options, "type"),
2545
+ tag: readListOptionString(options, "tag"),
2546
+ priority: readListOptionString(options, "priority"),
2547
+ deadlineBefore: readListOptionString(options, "deadlineBefore"),
2548
+ deadlineAfter: readListOptionString(options, "deadlineAfter"),
2549
+ assignee: readListOptionString(options, "assignee"),
2550
+ assigneeFilter: readListOptionString(options, "assigneeFilter"),
2551
+ parent: readListOptionString(options, "parent"),
2552
+ sprint: readListOptionString(options, "sprint"),
2553
+ release: readListOptionString(options, "release")
2554
+ };
2555
+ }
2556
+ function printListJsonStream(commandName, result, globalOptions) {
2557
+ setActiveCommandResult(result);
2558
+ if (globalOptions.quiet) {
2559
+ return;
2560
+ }
2561
+ const warnings = Array.isArray(result.warnings) ? result.warnings : [];
2562
+ const metaPayload = {
2563
+ type: "meta",
2564
+ command: commandName,
2565
+ count: result.count,
2566
+ now: result.now,
2567
+ filters: result.filters
2568
+ };
2569
+ if (warnings.length > 0) {
2570
+ metaPayload.warnings = warnings;
2571
+ }
2572
+ if (!writeStdout(`${JSON.stringify(metaPayload)}
2573
+ `)) {
2574
+ return;
2575
+ }
2576
+ for (const item of result.items) {
2577
+ if (!writeStdout(`${JSON.stringify({ type: "item", command: commandName, item })}
2578
+ `)) {
2579
+ return;
2580
+ }
2581
+ }
2582
+ writeStdout(`${JSON.stringify({ type: "end", command: commandName, count: result.count })}
2583
+ `);
2584
+ }
2585
+ function printActivityJsonStream(result, options, globalOptions) {
2586
+ setActiveCommandResult(result);
2587
+ if (globalOptions.quiet) {
2588
+ return;
2589
+ }
2590
+ const metaPayload = {
2591
+ type: "meta",
2592
+ command: "activity",
2593
+ count: result.count,
2594
+ filters: {
2595
+ id: options.id ?? null,
2596
+ op: options.op ?? null,
2597
+ author: options.author ?? null,
2598
+ from: options.from ?? null,
2599
+ to: options.to ?? null,
2600
+ limit: options.limit ?? null
2601
+ }
2602
+ };
2603
+ if (!writeStdout(`${JSON.stringify(metaPayload)}
2604
+ `)) {
2605
+ return;
2606
+ }
2607
+ const entries = result.compact && result.compact_activity ? result.compact_activity : result.activity;
2608
+ for (const entry of entries) {
2609
+ if (!writeStdout(`${JSON.stringify({ type: "entry", command: "activity", entry })}
2610
+ `)) {
2611
+ return;
2612
+ }
2613
+ }
2614
+ writeStdout(`${JSON.stringify({ type: "end", command: "activity", count: result.count })}
2615
+ `);
2616
+ }
2617
+ function normalizeSearchOptions(options) {
2618
+ const readSearchString = (target) => readFirstStringFromCommanderOptions(options, resolveCommanderContract(SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, target));
2619
+ const readSearchStringOrNumber = (target) => {
2620
+ const candidate = readFirstValueFromCommanderOptions(options, resolveCommanderContract(SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, target));
2621
+ if (typeof candidate === "string") {
2622
+ return candidate;
2623
+ }
2624
+ if (typeof candidate === "number" && Number.isFinite(candidate)) {
2625
+ return candidate;
2626
+ }
2627
+ return void 0;
2628
+ };
2629
+ const fields = readSearchString("fields");
2630
+ const compactRequested = options.compact === true;
2631
+ const fullRequested = options.full === true;
2632
+ const defaultCompact = !compactRequested && !fullRequested && fields === void 0;
2633
+ const mode = options.semantic === true ? "semantic" : options.hybrid === true ? "hybrid" : readSearchString("mode");
2634
+ const normalized = {
2635
+ mode,
2636
+ matchMode: readSearchString("matchMode"),
2637
+ minScore: readSearchStringOrNumber("minScore"),
2638
+ count: optionTrue(options, "count"),
2639
+ semanticWeight: readSearchStringOrNumber("semanticWeight"),
2640
+ includeLinked: optionTrue(options, "includeLinked"),
2641
+ titleExact: optionTrue(options, "titleExact"),
2642
+ phraseExact: optionTrue(options, "phraseExact"),
2643
+ highlight: optionTrue(options, "highlight"),
2644
+ status: readSearchString("status"),
2645
+ type: readSearchString("type"),
2646
+ tag: readSearchString("tag"),
2647
+ priority: readSearchString("priority"),
2648
+ deadlineBefore: readSearchString("deadlineBefore"),
2649
+ deadlineAfter: readSearchString("deadlineAfter"),
2650
+ updatedAfter: readSearchString("updatedAfter"),
2651
+ updatedBefore: readSearchString("updatedBefore"),
2652
+ createdAfter: readSearchString("createdAfter"),
2653
+ createdBefore: readSearchString("createdBefore"),
2654
+ assignee: readSearchString("assignee"),
2655
+ sprint: readSearchString("sprint"),
2656
+ release: readSearchString("release"),
2657
+ parent: readSearchString("parent"),
2658
+ limit: readSearchString("limit"),
2659
+ fields,
2660
+ compact: compactRequested || defaultCompact ? true : void 0,
2661
+ full: optionTrue(options, "full"),
2662
+ // Governance-missing (GH-236) + content presence/absence (GH-242) filters,
2663
+ // mirroring normalizeListOptions via the shared field slice.
2664
+ ...readSelectionFilterOptionFields(options)
2665
+ };
2666
+ copyUnknownOptions(normalized, options);
2667
+ return normalized;
2668
+ }
2669
+ function normalizeSearchKeywordsInput(keywords) {
2670
+ const query = keywords.map((entry) => entry.trim()).filter((entry) => entry.length > 0).join(" ");
2671
+ if (query.length === 0) {
2672
+ throw new PmCliError("Search query must not be empty", EXIT_CODE.USAGE);
2673
+ }
2674
+ return query;
2675
+ }
2676
+ function normalizeActivityOptions(options) {
2677
+ const readActivityString = (target) => readFirstStringFromCommanderOptions(options, resolveCommanderContract(ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, target));
2678
+ return {
2679
+ id: readActivityString("id"),
2680
+ op: readActivityString("op"),
2681
+ author: readActivityString("author"),
2682
+ from: readActivityString("from"),
2683
+ to: readActivityString("to"),
2684
+ limit: readActivityString("limit"),
2685
+ compact: options.full === true ? false : options.compact === false ? false : true
2686
+ };
2687
+ }
2688
+ var ACTIVITY_STREAM_ENABLED_VALUES = /* @__PURE__ */ new Set(["", "rows", "ndjson", "jsonl", "true", "1", "yes", "on"]);
2689
+ var ACTIVITY_STREAM_DISABLED_VALUES = /* @__PURE__ */ new Set(["false", "off", "none", "0"]);
2690
+ function resolveActivityStreamMode(raw) {
2691
+ if (raw === true) {
2692
+ return true;
2693
+ }
2694
+ if (raw === false || raw === void 0 || raw === null) {
2695
+ return false;
2696
+ }
2697
+ if (typeof raw === "string") {
2698
+ const normalized = raw.trim().toLowerCase();
2699
+ if (ACTIVITY_STREAM_ENABLED_VALUES.has(normalized)) {
2700
+ return true;
2701
+ }
2702
+ if (ACTIVITY_STREAM_DISABLED_VALUES.has(normalized)) {
2703
+ return false;
2704
+ }
2705
+ }
2706
+ throw new PmCliError("Activity --stream accepts rows|ndjson|jsonl (or no value)", EXIT_CODE.USAGE);
2707
+ }
2708
+ function normalizeContextOptions(options) {
2709
+ const readContextString = (target) => readFirstStringFromCommanderOptions(options, resolveCommanderContract(CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, target));
2710
+ const sectionRaw = options.section;
2711
+ const section = Array.isArray(sectionRaw) ? sectionRaw.filter((v) => typeof v === "string" && v.trim().length > 0) : typeof sectionRaw === "string" && sectionRaw.trim().length > 0 ? [sectionRaw] : void 0;
2712
+ const normalized = {
2713
+ date: readContextString("date"),
2714
+ from: readContextString("from"),
2715
+ to: readContextString("to"),
2716
+ past: options.past === true ? true : void 0,
2717
+ type: readContextString("type"),
2718
+ tag: readContextString("tag"),
2719
+ priority: readContextString("priority"),
2720
+ assignee: readContextString("assignee"),
2721
+ assigneeFilter: readContextString("assigneeFilter"),
2722
+ sprint: readContextString("sprint"),
2723
+ release: readContextString("release"),
2724
+ parent: readContextString("parent"),
2725
+ limit: readContextString("limit"),
2726
+ format: readContextString("format"),
2727
+ depth: readContextString("depth"),
2728
+ fields: readContextString("fields"),
2729
+ section: section && section.length > 0 ? section : void 0,
2730
+ activityLimit: readContextString("activityLimit"),
2731
+ staleThreshold: readContextString("staleThreshold")
2732
+ };
2733
+ for (const [key, value] of Object.entries(options)) {
2734
+ if (Object.hasOwn(normalized, key)) {
2735
+ continue;
2736
+ }
2737
+ normalized[key] = value;
2738
+ }
2739
+ return normalized;
2740
+ }
2741
+ function normalizeNextOptions(options) {
2742
+ const readNextString = (target) => readFirstStringFromCommanderOptions(options, resolveCommanderContract(NEXT_COMMANDER_STRING_OPTION_CONTRACTS, target));
2743
+ const normalized = {
2744
+ type: readNextString("type"),
2745
+ tag: readNextString("tag"),
2746
+ priority: readNextString("priority"),
2747
+ assignee: readNextString("assignee"),
2748
+ assigneeFilter: readNextString("assigneeFilter"),
2749
+ sprint: readNextString("sprint"),
2750
+ release: readNextString("release"),
2751
+ parent: readNextString("parent"),
2752
+ limit: readNextString("limit"),
2753
+ blockedLimit: readNextString("blockedLimit"),
2754
+ readyOnly: options.readyOnly === true || options.ready_only === true ? true : void 0,
2755
+ format: readNextString("format")
2756
+ };
2757
+ for (const [key, value] of Object.entries(options)) {
2758
+ if (Object.hasOwn(normalized, key)) {
2759
+ continue;
2760
+ }
2761
+ normalized[key] = value;
2762
+ }
2763
+ return normalized;
2764
+ }
2765
+ function collectMutationItemIds(result) {
2766
+ if (!result || typeof result !== "object") {
2767
+ return [];
2768
+ }
2769
+ const record = result;
2770
+ const ids = /* @__PURE__ */ new Set();
2771
+ const pushId = (value) => {
2772
+ if (typeof value !== "string") {
2773
+ return;
2774
+ }
2775
+ const normalized = value.trim();
2776
+ if (normalized.length === 0) {
2777
+ return;
2778
+ }
2779
+ ids.add(normalized);
2780
+ };
2781
+ pushId(record.id);
2782
+ const item = record.item;
2783
+ if (item && typeof item === "object") {
2784
+ pushId(item.id);
2785
+ }
2786
+ const explicitIds = record.ids;
2787
+ if (Array.isArray(explicitIds)) {
2788
+ for (const candidate of explicitIds) {
2789
+ pushId(candidate);
2790
+ }
2791
+ }
2792
+ const items = record.items;
2793
+ if (Array.isArray(items)) {
2794
+ for (const candidate of items) {
2795
+ if (!candidate || typeof candidate !== "object") {
2796
+ continue;
2797
+ }
2798
+ pushId(candidate.id);
2799
+ }
2800
+ }
2801
+ return [...ids].sort((left, right) => left.localeCompare(right));
2802
+ }
2803
+ async function invalidateSearchCachesForMutation(globalOptions, result) {
2804
+ const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);
2805
+ const refreshResult = await refreshSearchArtifactsForMutation(pmRoot, collectMutationItemIds(result), {
2806
+ background: !shouldRunSearchRefreshInForeground()
2807
+ });
2808
+ if (globalOptions.profile && refreshResult.warnings.length > 0) {
2809
+ printError(`profile:search_refresh_warnings=${formatHookWarnings(refreshResult.warnings)}`);
2810
+ }
2811
+ }
2812
+
2014
2813
  export {
2015
2814
  resolveProviderConfigSource,
2016
2815
  resolveEmbeddingProviders,
@@ -2025,7 +2824,6 @@ export {
2025
2824
  executeEmbeddingBatchesWithRetry,
2026
2825
  resolveSettingsWithSemanticRuntimeDefaults,
2027
2826
  REINDEX_LOCK_ID,
2028
- shouldRunSearchRefreshInForeground,
2029
2827
  resolveVectorStores,
2030
2828
  executeVectorQuery,
2031
2829
  executeVectorUpsert,
@@ -2039,8 +2837,32 @@ export {
2039
2837
  readVectorizationStatusLedger,
2040
2838
  writeVectorizationStatusLedger,
2041
2839
  refreshSemanticEmbeddingsForMutatedItems,
2042
- refreshSearchArtifactsForMutation
2840
+ setResolvedGlobalOptions,
2841
+ clearResolvedGlobalOptions,
2842
+ getGlobalOptions,
2843
+ getCommandPath,
2844
+ applyDefaultOutputFormat,
2845
+ collect,
2846
+ readOptionString,
2847
+ addHiddenOption,
2848
+ buildBackgroundTestCommandArgs,
2849
+ buildBackgroundTestAllCommandArgs,
2850
+ formatHookWarnings,
2851
+ normalizeCreateOptions,
2852
+ normalizeUpdateOptions,
2853
+ extractUpdateManyMutationOptionSource,
2854
+ normalizeListOptions,
2855
+ normalizeAggregateOptions,
2856
+ printListJsonStream,
2857
+ printActivityJsonStream,
2858
+ normalizeSearchOptions,
2859
+ normalizeSearchKeywordsInput,
2860
+ normalizeActivityOptions,
2861
+ resolveActivityStreamMode,
2862
+ normalizeContextOptions,
2863
+ normalizeNextOptions,
2864
+ invalidateSearchCachesForMutation
2043
2865
  };
2044
- //# sourceMappingURL=chunk-7QH7DHUB.js.map
2866
+ //# sourceMappingURL=chunk-XZWL7VNE.js.map
2045
2867
 
2046
- //# debugId=c63a3843-4fe5-59f1-a28c-51139dae3ccd
2868
+ //# debugId=143ba130-1e4a-555a-ad5a-281c82c7f363