@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,1977 +0,0 @@
1
- import {
2
- DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
3
- GOVERNANCE_PRESET_DEFAULTS,
4
- GOVERNANCE_PRESET_VALUES,
5
- RUNTIME_FIELD_COMMAND_VALUES,
6
- RUNTIME_FIELD_TYPE_VALUES,
7
- RUNTIME_STATUS_ROLE_VALUES,
8
- RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,
9
- SETTINGS_DEFAULTS,
10
- ensureRuntimeSchemaFileScaffold,
11
- filePathForSchemaSection,
12
- getSettingsPath,
13
- loadRuntimeSchemaFromOptionalFiles,
14
- normalizeItemTypeDefinition,
15
- normalizeRuntimeSchemaSettings,
16
- readFileIfExists,
17
- runCommandHandler,
18
- runCommandOverride,
19
- runOnIndexHooks,
20
- runOnReadHooks,
21
- runOnWriteHooks,
22
- runParserOverride,
23
- runPreflightOverride,
24
- runRendererOverride,
25
- runServiceOverride,
26
- runServiceOverrideSync,
27
- writeFileAtomic
28
- } from "./chunk-5VVUKE3U.js";
29
-
30
- // dist/core/extensions/index.js
31
- !(function() {
32
- try {
33
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
34
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "abe62b94-a55a-5cdf-8f1a-34360ddc4c25");
35
- } catch (e2) {
36
- }
37
- })();
38
- var activeExtensionHooks = null;
39
- var activeExtensionCommands = null;
40
- var activeExtensionParsers = null;
41
- var activeExtensionPreflight = null;
42
- var activeExtensionServices = null;
43
- var activeExtensionRenderers = null;
44
- var activeExtensionRegistrations = null;
45
- var activeCommandContext = null;
46
- var activeCommandResult = void 0;
47
- var activeAfterCommandAffectedItems = [];
48
- var AFTER_COMMAND_SNAPSHOT_OMITTED_FIELDS = /* @__PURE__ */ new Set([
49
- "body",
50
- "comments",
51
- "dependencies",
52
- "docs",
53
- "events",
54
- "files",
55
- "learnings",
56
- "notes",
57
- "reminders",
58
- "test_runs",
59
- "tests"
60
- ]);
61
- function setActiveExtensionHooks(hooks) {
62
- activeExtensionHooks = hooks;
63
- }
64
- function setActiveExtensionCommands(commands) {
65
- activeExtensionCommands = commands;
66
- }
67
- function setActiveExtensionParsers(parsers) {
68
- activeExtensionParsers = parsers;
69
- }
70
- function setActiveExtensionPreflight(preflight) {
71
- activeExtensionPreflight = preflight;
72
- }
73
- function setActiveExtensionServices(services) {
74
- activeExtensionServices = services;
75
- }
76
- function setActiveExtensionRenderers(renderers) {
77
- activeExtensionRenderers = renderers;
78
- }
79
- function setActiveExtensionRegistrations(registrations) {
80
- activeExtensionRegistrations = registrations;
81
- }
82
- function getActiveExtensionRegistrations() {
83
- return activeExtensionRegistrations;
84
- }
85
- function setActiveCommandContext(context) {
86
- activeCommandContext = context;
87
- }
88
- function setActiveCommandResult(result) {
89
- activeCommandResult = result;
90
- }
91
- function getActiveCommandResult() {
92
- return activeCommandResult;
93
- }
94
- function recordAfterCommandAffectedItem(item) {
95
- if (!item || (activeExtensionHooks?.afterCommand?.length ?? 0) === 0) {
96
- return;
97
- }
98
- activeAfterCommandAffectedItems.push(item);
99
- }
100
- function projectAfterCommandItemSnapshot(metadata, changedFields) {
101
- if (!metadata || !metadata.id) {
102
- return {};
103
- }
104
- const snapshot = {
105
- id: metadata.id,
106
- type: metadata.type,
107
- status: metadata.status
108
- };
109
- if (!Array.isArray(changedFields)) {
110
- return snapshot;
111
- }
112
- const source = metadata;
113
- for (const field of changedFields) {
114
- if (typeof field !== "string") {
115
- continue;
116
- }
117
- const actualField = field.startsWith("unset:") ? field.slice("unset:".length) : field;
118
- if (actualField === "id" || actualField === "type" || actualField === "status" || AFTER_COMMAND_SNAPSHOT_OMITTED_FIELDS.has(actualField)) {
119
- continue;
120
- }
121
- if (Object.hasOwn(source, actualField) && source[actualField] !== void 0) {
122
- snapshot[actualField] = source[actualField];
123
- }
124
- }
125
- return snapshot;
126
- }
127
- function consumeAfterCommandAffectedItems() {
128
- if (activeAfterCommandAffectedItems.length === 0) {
129
- return void 0;
130
- }
131
- const affected = activeAfterCommandAffectedItems;
132
- activeAfterCommandAffectedItems = [];
133
- return affected;
134
- }
135
- function clearActiveExtensionHooks() {
136
- activeExtensionHooks = null;
137
- activeExtensionCommands = null;
138
- activeExtensionParsers = null;
139
- activeExtensionPreflight = null;
140
- activeExtensionServices = null;
141
- activeExtensionRenderers = null;
142
- activeExtensionRegistrations = null;
143
- activeCommandContext = null;
144
- activeCommandResult = void 0;
145
- activeAfterCommandAffectedItems = [];
146
- }
147
- async function runActiveOnWriteHooks(context) {
148
- if (!activeExtensionHooks) {
149
- return [];
150
- }
151
- return runOnWriteHooks(activeExtensionHooks, context);
152
- }
153
- async function runActiveOnReadHooks(context) {
154
- if (!activeExtensionHooks) {
155
- return [];
156
- }
157
- return runOnReadHooks(activeExtensionHooks, context);
158
- }
159
- function hasActiveOnReadHooks() {
160
- return (activeExtensionHooks?.onRead?.length ?? 0) > 0;
161
- }
162
- async function runActiveOnIndexHooks(context) {
163
- if (!activeExtensionHooks) {
164
- return [];
165
- }
166
- return runOnIndexHooks(activeExtensionHooks, context);
167
- }
168
- function runActiveCommandOverride(result) {
169
- if (!activeExtensionCommands || !activeCommandContext) {
170
- return {
171
- overridden: false,
172
- result,
173
- warnings: []
174
- };
175
- }
176
- return runCommandOverride(activeExtensionCommands, {
177
- command: activeCommandContext.command,
178
- args: [...activeCommandContext.args],
179
- options: activeCommandContext.options ? { ...activeCommandContext.options } : {},
180
- global: activeCommandContext.global ? { ...activeCommandContext.global } : void 0,
181
- pm_root: activeCommandContext.pm_root,
182
- result
183
- });
184
- }
185
- async function runActiveCommandHandler(context) {
186
- if (!activeExtensionCommands) {
187
- return {
188
- handled: false,
189
- result: null,
190
- warnings: []
191
- };
192
- }
193
- return runCommandHandler(activeExtensionCommands, context);
194
- }
195
- async function runActiveParserOverride(context) {
196
- if (!activeExtensionParsers) {
197
- return {
198
- overridden: false,
199
- context: {
200
- command: context.command,
201
- args: [...context.args],
202
- options: { ...context.options },
203
- global: { ...context.global },
204
- pm_root: context.pm_root
205
- },
206
- warnings: []
207
- };
208
- }
209
- return runParserOverride(activeExtensionParsers, context);
210
- }
211
- async function runActivePreflightOverride(context) {
212
- if (!activeExtensionPreflight) {
213
- return {
214
- overridden: false,
215
- context: {
216
- command: context.command,
217
- args: [...context.args],
218
- options: { ...context.options },
219
- global: { ...context.global },
220
- pm_root: context.pm_root
221
- },
222
- decision: { ...context.decision },
223
- warnings: []
224
- };
225
- }
226
- return runPreflightOverride(activeExtensionPreflight, context);
227
- }
228
- function runActiveRendererOverride(format, result) {
229
- if (!activeExtensionRenderers) {
230
- return {
231
- overridden: false,
232
- rendered: null,
233
- warnings: []
234
- };
235
- }
236
- return runRendererOverride(activeExtensionRenderers, {
237
- format,
238
- command: activeCommandContext?.command,
239
- args: activeCommandContext ? [...activeCommandContext.args] : [],
240
- options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},
241
- global: activeCommandContext?.global ? { ...activeCommandContext.global } : void 0,
242
- pm_root: activeCommandContext?.pm_root,
243
- result
244
- });
245
- }
246
- function buildServiceContext(service, payload) {
247
- return {
248
- service,
249
- command: activeCommandContext?.command,
250
- args: activeCommandContext ? [...activeCommandContext.args] : [],
251
- options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},
252
- global: activeCommandContext?.global ? { ...activeCommandContext.global } : void 0,
253
- pm_root: activeCommandContext?.pm_root,
254
- payload
255
- };
256
- }
257
- async function runActiveServiceOverride(service, payload) {
258
- if (!activeExtensionServices) {
259
- return {
260
- handled: false,
261
- result: payload,
262
- warnings: []
263
- };
264
- }
265
- return runServiceOverride(activeExtensionServices, buildServiceContext(service, payload));
266
- }
267
- function runActiveServiceOverrideSync(service, payload) {
268
- if (!activeExtensionServices) {
269
- return {
270
- handled: false,
271
- result: payload,
272
- warnings: []
273
- };
274
- }
275
- return runServiceOverrideSync(activeExtensionServices, buildServiceContext(service, payload));
276
- }
277
-
278
- // dist/core/shared/errors.js
279
- !(function() {
280
- try {
281
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
282
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "df607275-b332-5c1b-ba08-d5c693162530");
283
- } catch (e2) {
284
- }
285
- })();
286
- var PmCliError = class extends Error {
287
- exitCode;
288
- context;
289
- constructor(message, exitCode, context = {}) {
290
- super(message);
291
- this.name = "PmCliError";
292
- this.exitCode = exitCode;
293
- this.context = context;
294
- }
295
- };
296
-
297
- // dist/core/shared/serialization.js
298
- import crypto from "node:crypto";
299
- !(function() {
300
- try {
301
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
302
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "54cbe570-d9f5-5515-8d0c-0fce0e06fe03");
303
- } catch (e2) {
304
- }
305
- })();
306
- function sortScalarValue(value) {
307
- if (value === null)
308
- return null;
309
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
310
- return value;
311
- }
312
- if (typeof value === "bigint") {
313
- return value.toString();
314
- }
315
- if (value === void 0) {
316
- return "undefined";
317
- }
318
- if (typeof value === "symbol") {
319
- return value.toString();
320
- }
321
- if (typeof value === "function") {
322
- return `[function:${value.name || "anonymous"}]`;
323
- }
324
- return void 0;
325
- }
326
- function sortPlainObjectKeys(value) {
327
- const sortedKeys = Object.keys(value).sort();
328
- const result = {};
329
- for (const key of sortedKeys) {
330
- const nested = value[key];
331
- if (nested === void 0) {
332
- continue;
333
- }
334
- result[key] = sortObjectKeys(nested);
335
- }
336
- return result;
337
- }
338
- function sortObjectKeys(value) {
339
- const scalarValue = sortScalarValue(value);
340
- if (scalarValue !== void 0) {
341
- return scalarValue;
342
- }
343
- if (Array.isArray(value)) {
344
- return value.map((entry) => sortObjectKeys(entry));
345
- }
346
- if (value instanceof Date) {
347
- return value.toISOString();
348
- }
349
- const maybeJson = value;
350
- if (typeof maybeJson.toJSON === "function") {
351
- const normalized = maybeJson.toJSON();
352
- if (normalized !== value) {
353
- return sortObjectKeys(normalized);
354
- }
355
- }
356
- return sortPlainObjectKeys(value);
357
- }
358
- function stableStringify(value) {
359
- return JSON.stringify(sortObjectKeys(value));
360
- }
361
- function hasUnmatchedEquivalent(leftValue, rightValues, matchedIndexes, equals) {
362
- for (let index = 0; index < rightValues.length; index += 1) {
363
- if (matchedIndexes.has(index)) {
364
- continue;
365
- }
366
- if (equals(leftValue, rightValues[index])) {
367
- matchedIndexes.add(index);
368
- return true;
369
- }
370
- }
371
- return false;
372
- }
373
- function compareRegExpValues(left, right) {
374
- if (!(left instanceof RegExp || right instanceof RegExp)) {
375
- return void 0;
376
- }
377
- return left instanceof RegExp && right instanceof RegExp && left.toString() === right.toString();
378
- }
379
- function compareDateValues(left, right) {
380
- if (!(left instanceof Date || right instanceof Date)) {
381
- return void 0;
382
- }
383
- return left instanceof Date && right instanceof Date && left.getTime() === right.getTime();
384
- }
385
- function compareSetValues(left, right) {
386
- if (!(left instanceof Set || right instanceof Set)) {
387
- return void 0;
388
- }
389
- if (!(left instanceof Set && right instanceof Set) || left.size !== right.size) {
390
- return false;
391
- }
392
- const rightValues = [...right];
393
- const matched = /* @__PURE__ */ new Set();
394
- for (const leftValue of left) {
395
- if (!hasUnmatchedEquivalent(leftValue, rightValues, matched, stableValueEquals)) {
396
- return false;
397
- }
398
- }
399
- return true;
400
- }
401
- function compareMapValues(left, right) {
402
- if (!(left instanceof Map || right instanceof Map)) {
403
- return void 0;
404
- }
405
- if (!(left instanceof Map && right instanceof Map) || left.size !== right.size) {
406
- return false;
407
- }
408
- const rightEntries = [...right.entries()];
409
- const matched = /* @__PURE__ */ new Set();
410
- for (const [leftKey, leftValue] of left.entries()) {
411
- const leftEntry = [leftKey, leftValue];
412
- if (!hasUnmatchedEquivalent(leftEntry, rightEntries, matched, ([candidateKey, candidateValue], [rightKey, rightValue]) => stableValueEquals(candidateKey, rightKey) && stableValueEquals(candidateValue, rightValue))) {
413
- return false;
414
- }
415
- }
416
- return true;
417
- }
418
- function compareArrayValues(left, right) {
419
- if (!(Array.isArray(left) || Array.isArray(right))) {
420
- return void 0;
421
- }
422
- if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) {
423
- return false;
424
- }
425
- return left.every((value, index) => stableValueEquals(value, right[index]));
426
- }
427
- function comparePlainObjectValues(left, right) {
428
- const leftKeys = Object.keys(left).sort((a, b) => a.localeCompare(b));
429
- const rightKeys = Object.keys(right).sort((a, b) => a.localeCompare(b));
430
- if (leftKeys.length !== rightKeys.length) {
431
- return false;
432
- }
433
- for (let index = 0; index < leftKeys.length; index += 1) {
434
- const leftKey = leftKeys[index];
435
- if (leftKey !== rightKeys[index]) {
436
- return false;
437
- }
438
- if (!stableValueEquals(left[leftKey], right[leftKey])) {
439
- return false;
440
- }
441
- }
442
- return true;
443
- }
444
- var SPECIALIZED_STABLE_VALUE_COMPARISONS = [
445
- compareRegExpValues,
446
- compareDateValues,
447
- compareSetValues,
448
- compareMapValues,
449
- compareArrayValues
450
- ];
451
- function stableValueEquals(left, right) {
452
- if (Object.is(left, right)) {
453
- return true;
454
- }
455
- if (left === null || right === null || typeof left !== "object" || typeof right !== "object") {
456
- return false;
457
- }
458
- for (const compare of SPECIALIZED_STABLE_VALUE_COMPARISONS) {
459
- const result = compare(left, right);
460
- if (result !== void 0) {
461
- return result;
462
- }
463
- }
464
- return comparePlainObjectValues(left, right);
465
- }
466
- function sha256Hex(value) {
467
- return crypto.createHash("sha256").update(value, "utf8").digest("hex");
468
- }
469
- function orderObject(value, keyOrder) {
470
- const ordered = {};
471
- for (const key of keyOrder) {
472
- const entry = value[key];
473
- if (entry !== void 0) {
474
- ordered[key] = entry;
475
- }
476
- }
477
- const unknownKeys = Object.keys(value).filter((key) => !keyOrder.includes(key)).sort((a, b) => a.localeCompare(b));
478
- for (const key of unknownKeys) {
479
- const entry = value[key];
480
- if (entry !== void 0) {
481
- ordered[key] = entry;
482
- }
483
- }
484
- return ordered;
485
- }
486
-
487
- // dist/core/store/settings-validator.js
488
- !(function() {
489
- try {
490
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
491
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c20027d3-85fb-5483-8095-965aad854419");
492
- } catch (e2) {
493
- }
494
- })();
495
- var FAIL = { ok: false };
496
- var vString = (input) => typeof input === "string" ? { ok: true, value: input } : FAIL;
497
- var vBoolean = (input) => typeof input === "boolean" ? { ok: true, value: input } : FAIL;
498
- function vNumber(options = {}) {
499
- return (input) => {
500
- if (typeof input !== "number" || !Number.isFinite(input)) {
501
- return FAIL;
502
- }
503
- if (options.int && (!Number.isInteger(input) || !Number.isSafeInteger(input))) {
504
- return FAIL;
505
- }
506
- if (options.positive && input <= 0) {
507
- return FAIL;
508
- }
509
- if (typeof options.min === "number" && input < options.min) {
510
- return FAIL;
511
- }
512
- return { ok: true, value: input };
513
- };
514
- }
515
- function vLiteral(...allowed) {
516
- return (input) => typeof input === "string" && allowed.includes(input) ? { ok: true, value: input } : FAIL;
517
- }
518
- function vArray(item) {
519
- return (input) => {
520
- if (!Array.isArray(input)) {
521
- return FAIL;
522
- }
523
- const value = [];
524
- for (const element of input) {
525
- const result = item(element);
526
- if (!result.ok) {
527
- return FAIL;
528
- }
529
- value.push(result.value);
530
- }
531
- return { ok: true, value };
532
- };
533
- }
534
- function vOptional(inner) {
535
- return (input) => input === void 0 ? { ok: true, value: void 0 } : inner(input);
536
- }
537
- function vRecordOf(valueCheck) {
538
- return (input) => {
539
- if (typeof input !== "object" || input === null || Array.isArray(input)) {
540
- return FAIL;
541
- }
542
- const value = {};
543
- for (const [key, raw] of Object.entries(input)) {
544
- const result = valueCheck(raw);
545
- if (!result.ok) {
546
- return FAIL;
547
- }
548
- value[key] = result.value;
549
- }
550
- return { ok: true, value };
551
- };
552
- }
553
- function vObject(shape) {
554
- return (input) => {
555
- if (typeof input !== "object" || input === null || Array.isArray(input)) {
556
- return FAIL;
557
- }
558
- const record = input;
559
- const value = {};
560
- for (const [key, check] of Object.entries(shape)) {
561
- const result = check(record[key]);
562
- if (!result.ok) {
563
- return FAIL;
564
- }
565
- if (result.value !== void 0) {
566
- value[key] = result.value;
567
- }
568
- }
569
- return { ok: true, value };
570
- };
571
- }
572
- var itemTypeOption = vObject({
573
- key: vString,
574
- values: vArray(vString),
575
- required: vOptional(vBoolean),
576
- aliases: vOptional(vArray(vString)),
577
- description: vOptional(vString)
578
- });
579
- var itemTypeCommandOptionPolicy = vObject({
580
- command: vLiteral("create", "update"),
581
- option: vString,
582
- required: vOptional(vBoolean),
583
- visible: vOptional(vBoolean),
584
- enabled: vOptional(vBoolean)
585
- });
586
- var itemTypeDefinition = vObject({
587
- name: vString,
588
- description: vOptional(vString),
589
- // Per-type create-time default status (config-driven); preserved so inline
590
- // settings.item_types.definitions behave identically to schema/types.json.
591
- default_status: vOptional(vString),
592
- folder: vOptional(vString),
593
- aliases: vOptional(vArray(vString)),
594
- required_create_fields: vOptional(vArray(vString)),
595
- required_create_repeatables: vOptional(vArray(vString)),
596
- options: vOptional(vArray(itemTypeOption)),
597
- command_option_policies: vOptional(vArray(itemTypeCommandOptionPolicy))
598
- });
599
- var runtimeStatusDefinition = vObject({
600
- id: vString,
601
- aliases: vOptional(vArray(vString)),
602
- roles: vOptional(vArray(vLiteral(...RUNTIME_STATUS_ROLE_VALUES))),
603
- description: vOptional(vString),
604
- order: vOptional(vNumber())
605
- });
606
- var runtimeFieldDefinition = vObject({
607
- key: vString,
608
- metadata_key: vOptional(vString),
609
- front_matter_key: vOptional(vString),
610
- cli_flag: vOptional(vString),
611
- cli_aliases: vOptional(vArray(vString)),
612
- description: vOptional(vString),
613
- type: vOptional(vLiteral(...RUNTIME_FIELD_TYPE_VALUES)),
614
- commands: vOptional(vArray(vLiteral(...RUNTIME_FIELD_COMMAND_VALUES))),
615
- repeatable: vOptional(vBoolean),
616
- required: vOptional(vBoolean),
617
- required_on_create: vOptional(vBoolean),
618
- required_types: vOptional(vArray(vString)),
619
- allow_unset: vOptional(vBoolean)
620
- });
621
- var statusTransitionPair = (input) => {
622
- if (!Array.isArray(input) || input.length !== 2) {
623
- return FAIL;
624
- }
625
- const [from, to] = input;
626
- if (typeof from !== "string" || typeof to !== "string") {
627
- return FAIL;
628
- }
629
- return { ok: true, value: [from, to] };
630
- };
631
- var typeWorkflowDefinition = vObject({
632
- type: vString,
633
- allowed_transitions: vArray(statusTransitionPair)
634
- });
635
- var runtimeSchemaSettings = vOptional(vObject({
636
- version: vOptional(vNumber({ int: true })),
637
- files: vOptional(vObject({
638
- types: vOptional(vString),
639
- statuses: vOptional(vString),
640
- fields: vOptional(vString),
641
- workflows: vOptional(vString)
642
- })),
643
- statuses: vOptional(vArray(runtimeStatusDefinition)),
644
- fields: vOptional(vArray(runtimeFieldDefinition)),
645
- workflow: vOptional(vObject({
646
- draft_status: vOptional(vString),
647
- open_status: vOptional(vString),
648
- in_progress_status: vOptional(vString),
649
- blocked_status: vOptional(vString),
650
- close_status: vOptional(vString),
651
- canceled_status: vOptional(vString)
652
- })),
653
- type_workflows: vOptional(vArray(typeWorkflowDefinition)),
654
- unknown_field_policy: vOptional(vLiteral(...RUNTIME_UNKNOWN_FIELD_POLICY_VALUES))
655
- }));
656
- var governanceSettings = vOptional(vObject({
657
- preset: vOptional(vLiteral(...GOVERNANCE_PRESET_VALUES)),
658
- ownership_enforcement: vOptional(vLiteral("none", "warn", "strict")),
659
- create_mode_default: vOptional(vLiteral("progressive", "strict")),
660
- close_validation_default: vOptional(vLiteral("off", "warn", "strict")),
661
- require_close_reason: vOptional(vBoolean),
662
- parent_reference: vOptional(vLiteral("warn", "strict_error")),
663
- metadata_profile: vOptional(vLiteral("core", "strict", "custom")),
664
- force_required_for_stale_lock: vOptional(vBoolean),
665
- create_default_type: vOptional(vString),
666
- workflow_enforcement: vOptional(vLiteral("off", "warn", "strict"))
667
- }));
668
- var extensionPolicyOverride = vObject({
669
- name: vString,
670
- disabled: vOptional(vBoolean),
671
- require_trusted: vOptional(vBoolean),
672
- require_provenance: vOptional(vBoolean),
673
- sandbox_profile: vOptional(vLiteral("none", "restricted", "strict")),
674
- allowed_capabilities: vOptional(vArray(vString)),
675
- blocked_capabilities: vOptional(vArray(vString)),
676
- allowed_surfaces: vOptional(vArray(vString)),
677
- blocked_surfaces: vOptional(vArray(vString)),
678
- allowed_commands: vOptional(vArray(vString)),
679
- blocked_commands: vOptional(vArray(vString)),
680
- allowed_actions: vOptional(vArray(vString)),
681
- blocked_actions: vOptional(vArray(vString)),
682
- allowed_services: vOptional(vArray(vString)),
683
- blocked_services: vOptional(vArray(vString))
684
- });
685
- var pmMaxVersionExceededModeLiteral = vLiteral("block", "warn");
686
- var pmMaxVersionExceededMode = (input) => typeof input === "string" ? pmMaxVersionExceededModeLiteral(input) : vObject({
687
- global: vOptional(pmMaxVersionExceededModeLiteral),
688
- project: vOptional(pmMaxVersionExceededModeLiteral)
689
- })(input);
690
- var extensionPolicy = vOptional(vObject({
691
- mode: vOptional(vLiteral("off", "warn", "enforce")),
692
- trust_mode: vOptional(vLiteral("off", "warn", "enforce")),
693
- pm_max_version_exceeded_mode: vOptional(pmMaxVersionExceededMode),
694
- require_provenance: vOptional(vBoolean),
695
- trusted_extensions: vOptional(vArray(vString)),
696
- default_sandbox_profile: vOptional(vLiteral("none", "restricted", "strict")),
697
- allowed_extensions: vOptional(vArray(vString)),
698
- blocked_extensions: vOptional(vArray(vString)),
699
- allowed_capabilities: vOptional(vArray(vString)),
700
- blocked_capabilities: vOptional(vArray(vString)),
701
- allowed_surfaces: vOptional(vArray(vString)),
702
- blocked_surfaces: vOptional(vArray(vString)),
703
- allowed_commands: vOptional(vArray(vString)),
704
- blocked_commands: vOptional(vArray(vString)),
705
- allowed_actions: vOptional(vArray(vString)),
706
- blocked_actions: vOptional(vArray(vString)),
707
- allowed_services: vOptional(vArray(vString)),
708
- blocked_services: vOptional(vArray(vString)),
709
- extension_overrides: vOptional(vArray(extensionPolicyOverride))
710
- }));
711
- var settingsCheck = vObject({
712
- version: vNumber({ int: true }),
713
- id_prefix: vString,
714
- author_default: vString,
715
- item_format: vOptional(vLiteral("toon", "json_markdown")),
716
- locks: vObject({ ttl_seconds: vNumber({ int: true }), wait_ms: vOptional(vNumber({ int: true, min: 0 })) }),
717
- checkpoints: vOptional(vObject({ retention_days: vOptional(vNumber({ int: true, positive: true })) })),
718
- output: vObject({ default_format: vLiteral("toon", "json") }),
719
- history: vOptional(vObject({
720
- missing_stream: vLiteral("auto_create", "strict_error"),
721
- compact_policy: vOptional(vObject({
722
- enabled: vOptional(vBoolean),
723
- max_entries: vOptional(vNumber({ int: true, positive: true })),
724
- trigger: vOptional(vLiteral("health_warn", "auto"))
725
- }))
726
- })),
727
- validation: vOptional(vObject({
728
- sprint_release_format: vLiteral("warn", "strict_error"),
729
- parent_reference: vOptional(vLiteral("warn", "strict_error")),
730
- metadata_profile: vOptional(vLiteral("core", "strict", "custom")),
731
- metadata_required_fields: vOptional(vArray(vString)),
732
- lifecycle_stale_blocker_reason_patterns: vOptional(vArray(vString)),
733
- lifecycle_closure_like_blocked_reason_patterns: vOptional(vArray(vString)),
734
- lifecycle_closure_like_resolution_patterns: vOptional(vArray(vString)),
735
- lifecycle_closure_like_actual_result_patterns: vOptional(vArray(vString)),
736
- estimate_defaults_by_type: vOptional(vRecordOf(vNumber({ int: true, positive: true })))
737
- })),
738
- governance: governanceSettings,
739
- workflow: vOptional(vObject({ definition_of_done: vArray(vString) })),
740
- testing: vOptional(vObject({ record_results_to_items: vBoolean })),
741
- telemetry: vOptional(vObject({
742
- enabled: vBoolean,
743
- first_run_prompt_completed: vOptional(vBoolean),
744
- capture_level: vOptional(vLiteral("minimal", "redacted", "max")),
745
- endpoint: vOptional(vString),
746
- installation_id: vOptional(vString),
747
- retention_days: vOptional(vNumber({ int: true, positive: true }))
748
- })),
749
- agent_guidance: vOptional(vObject({
750
- prompt_completed: vOptional(vBoolean),
751
- declined: vOptional(vBoolean),
752
- declined_at: vOptional(vString),
753
- template_version: vOptional(vNumber({ int: true, positive: true })),
754
- last_checked_files: vOptional(vArray(vString))
755
- })),
756
- item_types: vOptional(vObject({ definitions: vArray(itemTypeDefinition) })),
757
- schema: runtimeSchemaSettings,
758
- context: vOptional(vObject({
759
- default_depth: vOptional(vLiteral("brief", "standard", "deep")),
760
- activity_limit: vOptional(vNumber({ int: true, positive: true })),
761
- stale_threshold_days: vOptional(vNumber({ int: true, positive: true })),
762
- sections: vOptional(vObject({
763
- hierarchy: vOptional(vBoolean),
764
- activity: vOptional(vBoolean),
765
- progress: vOptional(vBoolean),
766
- recently_created: vOptional(vBoolean),
767
- unparented: vOptional(vBoolean),
768
- blockers: vOptional(vBoolean),
769
- files: vOptional(vBoolean),
770
- workload: vOptional(vBoolean),
771
- staleness: vOptional(vBoolean),
772
- tests: vOptional(vBoolean)
773
- }))
774
- })),
775
- extensions: vObject({
776
- enabled: vArray(vString),
777
- disabled: vArray(vString),
778
- policy: extensionPolicy
779
- }),
780
- search: vObject({
781
- score_threshold: vNumber(),
782
- hybrid_semantic_weight: vOptional(vNumber()),
783
- max_results: vNumber({ int: true }),
784
- embedding_model: vString,
785
- embedding_corpus_max_characters: vOptional(vNumber()),
786
- embedding_batch_size: vNumber({ int: true }),
787
- embedding_timeout_ms: vOptional(vNumber({ int: true })),
788
- scanner_max_batch_retries: vNumber({ int: true }),
789
- provider: vOptional(vString),
790
- corpus_fields: vOptional(vArray(vString)),
791
- mutation_refresh_policy: vOptional(vLiteral("cache_only", "semantic_configured", "semantic_auto")),
792
- query_expansion: vOptional(vObject({
793
- enabled: vOptional(vBoolean),
794
- provider: vOptional(vString)
795
- })),
796
- rerank: vOptional(vObject({
797
- enabled: vOptional(vBoolean),
798
- model: vOptional(vString),
799
- top_k: vOptional(vNumber({ int: true, positive: true }))
800
- })),
801
- // pm-75k9: offline BM25 tuning. Unlike `search.tuning` (intentionally
802
- // stripped for legacy zod parity), bm25 is validated so it persists across
803
- // writeSettings round-trips — these knobs must survive to take effect.
804
- bm25: vOptional(vObject({
805
- k1: vOptional(vNumber()),
806
- b: vOptional(vNumber())
807
- }))
808
- }),
809
- providers: vObject({
810
- openai: vObject({ base_url: vString, api_key: vString, model: vString }),
811
- ollama: vObject({ base_url: vString, model: vString })
812
- }),
813
- vector_store: vObject({
814
- adapter: vOptional(vString),
815
- collection_name: vOptional(vString),
816
- qdrant: vObject({ url: vString, api_key: vString }),
817
- lancedb: vObject({ path: vString })
818
- })
819
- });
820
- function validateSettings(raw) {
821
- const result = settingsCheck(raw);
822
- if (!result.ok) {
823
- return { success: false };
824
- }
825
- return { success: true, data: result.value };
826
- }
827
-
828
- // dist/core/validate/estimate-defaults.js
829
- !(function() {
830
- try {
831
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
832
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "33f2ca4e-022c-5fc2-9938-a3fb389c1b93");
833
- } catch (e2) {
834
- }
835
- })();
836
- var DEFAULT_ESTIMATE_MINUTES_BY_TYPE = {
837
- Epic: 2880,
838
- Feature: 480,
839
- Story: 480,
840
- Milestone: 2880,
841
- Task: 120,
842
- Issue: 60,
843
- Bug: 60,
844
- Chore: 30,
845
- Decision: 15,
846
- Plan: 120
847
- };
848
- var FALLBACK_ESTIMATE_MINUTES = 120;
849
- function isHonoredMinutes(value) {
850
- return typeof value === "number" && Number.isFinite(value) && value > 0;
851
- }
852
- function toLowercasedLookup(source) {
853
- const lookup = /* @__PURE__ */ new Map();
854
- for (const [key, value] of Object.entries(source)) {
855
- lookup.set(key.toLowerCase(), value);
856
- }
857
- return lookup;
858
- }
859
- var BUILTIN_LOWERCASED_LOOKUP = toLowercasedLookup(DEFAULT_ESTIMATE_MINUTES_BY_TYPE);
860
- var OVERRIDE_LOOKUP_CACHE = /* @__PURE__ */ new WeakMap();
861
- function lowercasedOverrideLookup(overrides) {
862
- const cached = OVERRIDE_LOOKUP_CACHE.get(overrides);
863
- if (cached) {
864
- return cached;
865
- }
866
- const lookup = toLowercasedLookup(overrides);
867
- OVERRIDE_LOOKUP_CACHE.set(overrides, lookup);
868
- return lookup;
869
- }
870
- function resolveEstimateDefaultMinutes(type, overrides) {
871
- const key = (type ?? "").trim().toLowerCase();
872
- if (key.length === 0) {
873
- return FALLBACK_ESTIMATE_MINUTES;
874
- }
875
- if (overrides) {
876
- const overrideValue = lowercasedOverrideLookup(overrides).get(key);
877
- if (isHonoredMinutes(overrideValue)) {
878
- return Math.floor(overrideValue);
879
- }
880
- }
881
- const builtinValue = BUILTIN_LOWERCASED_LOOKUP.get(key);
882
- if (isHonoredMinutes(builtinValue)) {
883
- return Math.floor(builtinValue);
884
- }
885
- return FALLBACK_ESTIMATE_MINUTES;
886
- }
887
- function normalizeEstimateDefaultOverrides(raw) {
888
- const normalized = {};
889
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
890
- return normalized;
891
- }
892
- for (const [rawKey, rawValue] of Object.entries(raw)) {
893
- const key = rawKey.trim();
894
- if (key.length === 0 || !isHonoredMinutes(rawValue)) {
895
- continue;
896
- }
897
- normalized[key] = Math.floor(rawValue);
898
- }
899
- return normalized;
900
- }
901
-
902
- // dist/core/store/settings-read-cache.js
903
- import { stat } from "node:fs/promises";
904
- !(function() {
905
- try {
906
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
907
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "406f2d48-4969-5666-9e95-c71103f541c5");
908
- } catch (e2) {
909
- }
910
- })();
911
- var settingsReadCacheByRoot = /* @__PURE__ */ new Map();
912
- function normalizeTrackedPaths(paths) {
913
- return [...new Set(paths.map((pathValue) => pathValue.trim()).filter((pathValue) => pathValue.length > 0))].sort((left, right) => left.localeCompare(right));
914
- }
915
- async function readPathSignature(targetPath) {
916
- try {
917
- const targetStats = await stat(targetPath);
918
- return {
919
- path: targetPath,
920
- mtime_ms: targetStats.mtimeMs,
921
- size: targetStats.size
922
- };
923
- } catch {
924
- return {
925
- path: targetPath,
926
- mtime_ms: null,
927
- size: null
928
- };
929
- }
930
- }
931
- async function collectSettingsReadCacheSignatures(paths) {
932
- const normalizedPaths = normalizeTrackedPaths(paths);
933
- const signatures = await Promise.all(normalizedPaths.map((targetPath) => readPathSignature(targetPath)));
934
- signatures.sort((left, right) => left.path.localeCompare(right.path));
935
- return signatures;
936
- }
937
- function settingsReadCacheSignaturesEqual(left, right) {
938
- if (left.length !== right.length) {
939
- return false;
940
- }
941
- for (let index = 0; index < left.length; index += 1) {
942
- const leftEntry = left[index];
943
- const rightEntry = right[index];
944
- if (leftEntry.path !== rightEntry.path || leftEntry.mtime_ms !== rightEntry.mtime_ms || leftEntry.size !== rightEntry.size) {
945
- return false;
946
- }
947
- }
948
- return true;
949
- }
950
- function getSettingsReadCacheEntry(pmRoot) {
951
- return settingsReadCacheByRoot.get(pmRoot);
952
- }
953
- function setSettingsReadCacheEntry(pmRoot, entry) {
954
- const normalizedTrackedPaths = normalizeTrackedPaths(entry.tracked_paths);
955
- const normalizedSignatures = [...entry.signatures].map((signature) => ({
956
- path: signature.path,
957
- mtime_ms: signature.mtime_ms,
958
- size: signature.size
959
- })).sort((left, right) => left.path.localeCompare(right.path));
960
- settingsReadCacheByRoot.set(pmRoot, {
961
- tracked_paths: normalizedTrackedPaths,
962
- signatures: normalizedSignatures,
963
- value: entry.value
964
- });
965
- }
966
- function clearSettingsReadCache(pmRoot) {
967
- if (pmRoot) {
968
- settingsReadCacheByRoot.delete(pmRoot);
969
- return;
970
- }
971
- settingsReadCacheByRoot.clear();
972
- }
973
-
974
- // dist/core/store/settings.js
975
- !(function() {
976
- try {
977
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
978
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2117ea93-b9ac-5f00-931b-f56e6fdbd0d4");
979
- } catch (e2) {
980
- }
981
- })();
982
- var SETTINGS_WRITE_OP = "settings:write";
983
- var SETTINGS_PERSIST_SOURCE_SYMBOL = /* @__PURE__ */ Symbol("pm.settings.persist_source");
984
- var MAX_VECTOR_STORE_COLLECTION_NAME_LENGTH = 128;
985
- function resolveGovernanceKnobsFromPreset(preset) {
986
- return structuredClone(GOVERNANCE_PRESET_DEFAULTS[preset]);
987
- }
988
- function normalizeGovernancePreset(value) {
989
- if (value === "minimal" || value === "default" || value === "strict" || value === "custom") {
990
- return value;
991
- }
992
- return SETTINGS_DEFAULTS.governance.preset;
993
- }
994
- function withGovernanceExtras(base, governance) {
995
- const createDefaultType = typeof governance.create_default_type === "string" ? governance.create_default_type.trim() : void 0;
996
- if (createDefaultType && createDefaultType.length > 0) {
997
- base.create_default_type = createDefaultType;
998
- }
999
- if (governance.workflow_enforcement === "off" || governance.workflow_enforcement === "warn" || governance.workflow_enforcement === "strict") {
1000
- base.workflow_enforcement = governance.workflow_enforcement;
1001
- }
1002
- if (governance.require_close_reason === false) {
1003
- base.require_close_reason = false;
1004
- }
1005
- return base;
1006
- }
1007
- function normalizeGovernanceForPersist(governance) {
1008
- if (governance.preset === "custom") {
1009
- return withGovernanceExtras({
1010
- preset: "custom",
1011
- ownership_enforcement: governance.ownership_enforcement,
1012
- create_mode_default: governance.create_mode_default,
1013
- close_validation_default: governance.close_validation_default,
1014
- parent_reference: governance.parent_reference,
1015
- metadata_profile: governance.metadata_profile,
1016
- force_required_for_stale_lock: governance.force_required_for_stale_lock
1017
- }, governance);
1018
- }
1019
- return withGovernanceExtras({
1020
- preset: governance.preset
1021
- }, governance);
1022
- }
1023
- function resolveGovernanceExtras(rawGovernance) {
1024
- const createDefaultType = typeof rawGovernance.create_default_type === "string" ? rawGovernance.create_default_type.trim() : void 0;
1025
- const extras = {};
1026
- if (createDefaultType && createDefaultType.length > 0) {
1027
- extras.create_default_type = createDefaultType;
1028
- }
1029
- if (rawGovernance.workflow_enforcement === "off" || rawGovernance.workflow_enforcement === "warn" || rawGovernance.workflow_enforcement === "strict") {
1030
- extras.workflow_enforcement = rawGovernance.workflow_enforcement;
1031
- }
1032
- if (typeof rawGovernance.require_close_reason === "boolean") {
1033
- extras.require_close_reason = rawGovernance.require_close_reason;
1034
- }
1035
- return extras;
1036
- }
1037
- function resolveGovernanceKnobs(settings) {
1038
- const rawGovernance = settings.governance ?? {};
1039
- const preset = normalizeGovernancePreset(rawGovernance.preset);
1040
- const extras = resolveGovernanceExtras(rawGovernance);
1041
- if (preset === "custom") {
1042
- const baseline2 = resolveGovernanceKnobsFromPreset("default");
1043
- const requireCloseReason2 = extras.require_close_reason ?? baseline2.require_close_reason;
1044
- return {
1045
- preset,
1046
- ownership_enforcement: rawGovernance.ownership_enforcement ?? baseline2.ownership_enforcement,
1047
- create_mode_default: rawGovernance.create_mode_default ?? baseline2.create_mode_default,
1048
- close_validation_default: rawGovernance.close_validation_default ?? baseline2.close_validation_default,
1049
- parent_reference: rawGovernance.parent_reference ?? baseline2.parent_reference,
1050
- metadata_profile: rawGovernance.metadata_profile ?? baseline2.metadata_profile,
1051
- force_required_for_stale_lock: rawGovernance.force_required_for_stale_lock ?? baseline2.force_required_for_stale_lock,
1052
- ...extras,
1053
- require_close_reason: requireCloseReason2
1054
- };
1055
- }
1056
- const baseline = resolveGovernanceKnobsFromPreset(preset);
1057
- const requireCloseReason = extras.require_close_reason ?? baseline.require_close_reason;
1058
- return {
1059
- preset,
1060
- ...baseline,
1061
- ...extras,
1062
- require_close_reason: requireCloseReason
1063
- };
1064
- }
1065
- function cloneDefaults() {
1066
- return structuredClone(SETTINGS_DEFAULTS);
1067
- }
1068
- function normalizeSearchMutationRefreshPolicy(value) {
1069
- if (value === "cache_only" || value === "semantic_configured" || value === "semantic_auto") {
1070
- return value;
1071
- }
1072
- return SETTINGS_DEFAULTS.search.mutation_refresh_policy;
1073
- }
1074
- function normalizeSearchQueryExpansionEnabled(value) {
1075
- if (typeof value === "boolean") {
1076
- return value;
1077
- }
1078
- return SETTINGS_DEFAULTS.search.query_expansion.enabled;
1079
- }
1080
- function normalizeSearchQueryExpansionProvider(value) {
1081
- if (typeof value !== "string") {
1082
- return SETTINGS_DEFAULTS.search.query_expansion.provider;
1083
- }
1084
- return value.trim();
1085
- }
1086
- function normalizeSearchRerankEnabled(value) {
1087
- if (typeof value === "boolean") {
1088
- return value;
1089
- }
1090
- return SETTINGS_DEFAULTS.search.rerank.enabled;
1091
- }
1092
- function normalizeSearchRerankModel(value) {
1093
- if (typeof value !== "string") {
1094
- return SETTINGS_DEFAULTS.search.rerank.model;
1095
- }
1096
- return value.trim();
1097
- }
1098
- function normalizeSearchRerankTopK(value) {
1099
- if (typeof value === "number" && Number.isFinite(value) && Number.isInteger(value) && value > 0) {
1100
- return value;
1101
- }
1102
- return SETTINGS_DEFAULTS.search.rerank.top_k;
1103
- }
1104
- function normalizeVectorStoreCollectionName(value) {
1105
- if (typeof value !== "string") {
1106
- return SETTINGS_DEFAULTS.vector_store.collection_name;
1107
- }
1108
- const sanitized = value.trim().replaceAll(/[^a-zA-Z0-9_-]/g, "_");
1109
- const truncated = sanitized.slice(0, MAX_VECTOR_STORE_COLLECTION_NAME_LENGTH);
1110
- return truncated.length > 0 ? truncated : SETTINGS_DEFAULTS.vector_store.collection_name;
1111
- }
1112
- function buildSettingsPersistSourceSnapshot(parsedSettings, runtimeSettings) {
1113
- const sourceSchema = parsedSettings.schema;
1114
- const sourceStatuses = Array.isArray(sourceSchema?.statuses) ? sourceSchema?.statuses : void 0;
1115
- const sourceFields = Array.isArray(sourceSchema?.fields) ? sourceSchema?.fields : void 0;
1116
- const sourceTypeWorkflows = Array.isArray(sourceSchema?.type_workflows) ? sourceSchema?.type_workflows : void 0;
1117
- return {
1118
- has_source_item_type_definitions: Array.isArray(parsedSettings.item_types?.definitions),
1119
- source_item_type_definitions: normalizeItemTypeDefinitions(parsedSettings.item_types?.definitions),
1120
- has_source_schema_statuses: sourceStatuses !== void 0,
1121
- source_schema_statuses: sourceStatuses ? structuredClone(sourceStatuses) : [],
1122
- has_source_schema_fields: sourceFields !== void 0,
1123
- source_schema_fields: sourceFields ? structuredClone(sourceFields) : [],
1124
- has_source_schema_type_workflows: sourceTypeWorkflows !== void 0,
1125
- source_schema_type_workflows: sourceTypeWorkflows ? structuredClone(sourceTypeWorkflows) : [],
1126
- runtime_item_type_definitions: normalizeItemTypeDefinitions(runtimeSettings.item_types?.definitions),
1127
- runtime_schema_statuses: structuredClone(runtimeSettings.schema.statuses),
1128
- runtime_schema_fields: structuredClone(runtimeSettings.schema.fields),
1129
- runtime_schema_type_workflows: structuredClone(runtimeSettings.schema.type_workflows ?? [])
1130
- };
1131
- }
1132
- function attachSettingsPersistSourceSnapshot(settings, source) {
1133
- Object.defineProperty(settings, SETTINGS_PERSIST_SOURCE_SYMBOL, {
1134
- value: source,
1135
- writable: true,
1136
- configurable: true,
1137
- enumerable: false
1138
- });
1139
- }
1140
- function getSettingsPersistSourceSnapshot(settings) {
1141
- const candidate = settings[SETTINGS_PERSIST_SOURCE_SYMBOL];
1142
- if (!candidate || typeof candidate !== "object") {
1143
- return void 0;
1144
- }
1145
- return candidate;
1146
- }
1147
- function cloneSettingsReadResult(result) {
1148
- const clonedSettings = structuredClone(result.settings);
1149
- const persistSource = getSettingsPersistSourceSnapshot(result.settings);
1150
- if (persistSource) {
1151
- attachSettingsPersistSourceSnapshot(clonedSettings, structuredClone(persistSource));
1152
- }
1153
- return {
1154
- settings: clonedSettings,
1155
- metadata: {
1156
- has_explicit_item_format: result.metadata.has_explicit_item_format
1157
- },
1158
- warnings: [...result.warnings]
1159
- };
1160
- }
1161
- function resolveSettingsReadTrackedPaths(pmRoot, schema, settingsPath) {
1162
- const normalizedSchema = normalizeRuntimeSchemaSettings(schema);
1163
- return [
1164
- settingsPath,
1165
- filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types),
1166
- filePathForSchemaSection(pmRoot, normalizedSchema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),
1167
- filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),
1168
- filePathForSchemaSection(pmRoot, normalizedSchema.files.workflows, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows)
1169
- ];
1170
- }
1171
- async function cacheSettingsReadResult(pmRoot, trackedPaths, result) {
1172
- const signatures = await collectSettingsReadCacheSignatures(trackedPaths);
1173
- setSettingsReadCacheEntry(pmRoot, {
1174
- tracked_paths: trackedPaths,
1175
- signatures,
1176
- value: cloneSettingsReadResult(result)
1177
- });
1178
- }
1179
- async function cacheSettingsReadResultSafe(pmRoot, trackedPaths, result) {
1180
- try {
1181
- await cacheSettingsReadResult(pmRoot, trackedPaths, result);
1182
- } catch {
1183
- clearSettingsReadCache(pmRoot);
1184
- }
1185
- }
1186
- function findSettingsReadCacheSignature(signatures, targetPath) {
1187
- return signatures.find((signature) => signature.path === targetPath);
1188
- }
1189
- function selectedSettingsReadCacheSignaturesEqual(before, after, targetPaths) {
1190
- for (const targetPath of targetPaths) {
1191
- const beforeSignature = findSettingsReadCacheSignature(before, targetPath);
1192
- const afterSignature = findSettingsReadCacheSignature(after, targetPath);
1193
- if (!beforeSignature || !afterSignature || !settingsReadCacheSignaturesEqual([beforeSignature], [afterSignature])) {
1194
- return false;
1195
- }
1196
- }
1197
- return true;
1198
- }
1199
- async function cacheSettingsReadResultIfStable(pmRoot, trackedPaths, result, stableSignatures, stablePaths) {
1200
- try {
1201
- const currentSignatures = await collectSettingsReadCacheSignatures(trackedPaths);
1202
- if (!selectedSettingsReadCacheSignaturesEqual(stableSignatures, currentSignatures, stablePaths)) {
1203
- clearSettingsReadCache(pmRoot);
1204
- return;
1205
- }
1206
- setSettingsReadCacheEntry(pmRoot, {
1207
- tracked_paths: trackedPaths,
1208
- signatures: currentSignatures,
1209
- value: cloneSettingsReadResult(result)
1210
- });
1211
- } catch {
1212
- clearSettingsReadCache(pmRoot);
1213
- }
1214
- }
1215
- function resolvePersistedFileBackedSchemaSections(settings, source) {
1216
- const normalizedSchema = normalizeRuntimeSchemaSettings(settings.schema);
1217
- const currentItemTypeDefinitions = normalizeItemTypeDefinitions(settings.item_types?.definitions);
1218
- if (!source) {
1219
- return {
1220
- item_type_definitions: currentItemTypeDefinitions,
1221
- schema_statuses: normalizedSchema.statuses,
1222
- schema_fields: normalizedSchema.fields,
1223
- schema_type_workflows: normalizedSchema.type_workflows
1224
- };
1225
- }
1226
- const currentTypeWorkflows = normalizedSchema.type_workflows ?? [];
1227
- const itemTypeDefinitionsUnchanged = stableValueEquals(currentItemTypeDefinitions, source.runtime_item_type_definitions);
1228
- const schemaStatusesUnchanged = stableValueEquals(normalizedSchema.statuses, source.runtime_schema_statuses);
1229
- const schemaFieldsUnchanged = stableValueEquals(normalizedSchema.fields, source.runtime_schema_fields);
1230
- const schemaTypeWorkflowsUnchanged = stableValueEquals(currentTypeWorkflows, source.runtime_schema_type_workflows);
1231
- return {
1232
- item_type_definitions: itemTypeDefinitionsUnchanged ? source.has_source_item_type_definitions ? normalizeItemTypeDefinitions(source.source_item_type_definitions) : [] : currentItemTypeDefinitions,
1233
- schema_statuses: schemaStatusesUnchanged ? source.has_source_schema_statuses ? structuredClone(source.source_schema_statuses) : [] : normalizedSchema.statuses,
1234
- schema_fields: schemaFieldsUnchanged ? source.has_source_schema_fields ? structuredClone(source.source_schema_fields) : [] : normalizedSchema.fields,
1235
- schema_type_workflows: schemaTypeWorkflowsUnchanged ? source.has_source_schema_type_workflows ? structuredClone(source.source_schema_type_workflows) : void 0 : normalizedSchema.type_workflows
1236
- };
1237
- }
1238
- function buildFallbackSettingsReadResult(warning) {
1239
- return {
1240
- settings: cloneDefaults(),
1241
- metadata: {
1242
- has_explicit_item_format: false
1243
- },
1244
- warnings: warning ? [warning] : []
1245
- };
1246
- }
1247
- function hasExplicitItemFormat(raw) {
1248
- if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
1249
- return false;
1250
- }
1251
- const itemFormat = raw.item_format;
1252
- return itemFormat === "toon" || itemFormat === "json_markdown";
1253
- }
1254
- function normalizeStringList(values) {
1255
- return [...new Set((values ?? []).map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
1256
- }
1257
- function normalizeAgentGuidanceSettings(value) {
1258
- const defaults = SETTINGS_DEFAULTS.agent_guidance;
1259
- const templateVersion = value?.template_version;
1260
- return {
1261
- prompt_completed: value?.prompt_completed === true,
1262
- declined: value?.declined === true,
1263
- declined_at: typeof value?.declined_at === "string" ? value.declined_at : defaults.declined_at,
1264
- template_version: typeof templateVersion === "number" && Number.isInteger(templateVersion) && templateVersion > 0 ? templateVersion : defaults.template_version,
1265
- last_checked_files: normalizeStringList(value?.last_checked_files ?? defaults.last_checked_files)
1266
- };
1267
- }
1268
- function normalizeLowerStringList(values) {
1269
- return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
1270
- }
1271
- function normalizeExtensionPolicyMode(value) {
1272
- if (value === "off" || value === "warn" || value === "enforce") {
1273
- return value;
1274
- }
1275
- return SETTINGS_DEFAULTS.extensions.policy.mode;
1276
- }
1277
- function normalizeExtensionTrustMode(value) {
1278
- if (value === "off" || value === "warn" || value === "enforce") {
1279
- return value;
1280
- }
1281
- return SETTINGS_DEFAULTS.extensions.policy.trust_mode;
1282
- }
1283
- function normalizeExtensionSandboxProfile(value) {
1284
- if (value === "none" || value === "restricted" || value === "strict") {
1285
- return value;
1286
- }
1287
- return SETTINGS_DEFAULTS.extensions.policy.default_sandbox_profile;
1288
- }
1289
- function normalizeExtensionPolicyOverride(override) {
1290
- const name = override.name.trim().toLowerCase();
1291
- if (name.length === 0) {
1292
- return null;
1293
- }
1294
- const normalized = {
1295
- name
1296
- };
1297
- if (override.disabled === true) {
1298
- normalized.disabled = true;
1299
- }
1300
- if (override.require_trusted === true) {
1301
- normalized.require_trusted = true;
1302
- }
1303
- if (override.require_provenance === true) {
1304
- normalized.require_provenance = true;
1305
- }
1306
- if (override.sandbox_profile !== void 0) {
1307
- normalized.sandbox_profile = normalizeExtensionSandboxProfile(override.sandbox_profile);
1308
- }
1309
- const allowedCapabilities = normalizeLowerStringList(override.allowed_capabilities);
1310
- const blockedCapabilities = normalizeLowerStringList(override.blocked_capabilities);
1311
- const allowedSurfaces = normalizeLowerStringList(override.allowed_surfaces);
1312
- const blockedSurfaces = normalizeLowerStringList(override.blocked_surfaces);
1313
- const allowedCommands = normalizeLowerStringList(override.allowed_commands);
1314
- const blockedCommands = normalizeLowerStringList(override.blocked_commands);
1315
- const allowedActions = normalizeLowerStringList(override.allowed_actions);
1316
- const blockedActions = normalizeLowerStringList(override.blocked_actions);
1317
- const allowedServices = normalizeLowerStringList(override.allowed_services);
1318
- const blockedServices = normalizeLowerStringList(override.blocked_services);
1319
- if (allowedCapabilities.length > 0) {
1320
- normalized.allowed_capabilities = allowedCapabilities;
1321
- }
1322
- if (blockedCapabilities.length > 0) {
1323
- normalized.blocked_capabilities = blockedCapabilities;
1324
- }
1325
- if (allowedSurfaces.length > 0) {
1326
- normalized.allowed_surfaces = allowedSurfaces;
1327
- }
1328
- if (blockedSurfaces.length > 0) {
1329
- normalized.blocked_surfaces = blockedSurfaces;
1330
- }
1331
- if (allowedCommands.length > 0) {
1332
- normalized.allowed_commands = allowedCommands;
1333
- }
1334
- if (blockedCommands.length > 0) {
1335
- normalized.blocked_commands = blockedCommands;
1336
- }
1337
- if (allowedActions.length > 0) {
1338
- normalized.allowed_actions = allowedActions;
1339
- }
1340
- if (blockedActions.length > 0) {
1341
- normalized.blocked_actions = blockedActions;
1342
- }
1343
- if (allowedServices.length > 0) {
1344
- normalized.allowed_services = allowedServices;
1345
- }
1346
- if (blockedServices.length > 0) {
1347
- normalized.blocked_services = blockedServices;
1348
- }
1349
- return normalized;
1350
- }
1351
- function normalizeExtensionPolicyOverrides(overrides) {
1352
- const dedupedByName = /* @__PURE__ */ new Map();
1353
- for (const override of overrides ?? []) {
1354
- const normalized = normalizeExtensionPolicyOverride(override);
1355
- if (!normalized) {
1356
- continue;
1357
- }
1358
- dedupedByName.set(normalized.name, normalized);
1359
- }
1360
- return [...dedupedByName.values()].sort((left, right) => left.name.localeCompare(right.name));
1361
- }
1362
- function normalizePmMaxVersionExceededModeValue(value) {
1363
- return value === "block" || value === "warn" ? value : void 0;
1364
- }
1365
- function normalizePmMaxVersionExceededModeSetting(value) {
1366
- if (typeof value === "string") {
1367
- return normalizePmMaxVersionExceededModeValue(value);
1368
- }
1369
- if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1370
- const global2 = normalizePmMaxVersionExceededModeValue(value.global);
1371
- const project = normalizePmMaxVersionExceededModeValue(value.project);
1372
- if (global2 === void 0 && project === void 0) {
1373
- return void 0;
1374
- }
1375
- return {
1376
- ...global2 !== void 0 ? { global: global2 } : {},
1377
- ...project !== void 0 ? { project } : {}
1378
- };
1379
- }
1380
- return void 0;
1381
- }
1382
- function normalizeExtensionPolicyList(policy, key) {
1383
- return normalizeLowerStringList(policy?.[key] ?? SETTINGS_DEFAULTS.extensions.policy[key]);
1384
- }
1385
- function normalizeExtensionPolicySettings(policy) {
1386
- const pmMaxVersionExceededMode2 = normalizePmMaxVersionExceededModeSetting(policy?.pm_max_version_exceeded_mode);
1387
- return {
1388
- mode: normalizeExtensionPolicyMode(policy?.mode),
1389
- trust_mode: normalizeExtensionTrustMode(policy?.trust_mode),
1390
- ...pmMaxVersionExceededMode2 !== void 0 ? { pm_max_version_exceeded_mode: pmMaxVersionExceededMode2 } : {},
1391
- require_provenance: policy?.require_provenance === true,
1392
- trusted_extensions: normalizeExtensionPolicyList(policy, "trusted_extensions"),
1393
- default_sandbox_profile: normalizeExtensionSandboxProfile(policy?.default_sandbox_profile),
1394
- allowed_extensions: normalizeExtensionPolicyList(policy, "allowed_extensions"),
1395
- blocked_extensions: normalizeExtensionPolicyList(policy, "blocked_extensions"),
1396
- allowed_capabilities: normalizeExtensionPolicyList(policy, "allowed_capabilities"),
1397
- blocked_capabilities: normalizeExtensionPolicyList(policy, "blocked_capabilities"),
1398
- allowed_surfaces: normalizeExtensionPolicyList(policy, "allowed_surfaces"),
1399
- blocked_surfaces: normalizeExtensionPolicyList(policy, "blocked_surfaces"),
1400
- allowed_commands: normalizeExtensionPolicyList(policy, "allowed_commands"),
1401
- blocked_commands: normalizeExtensionPolicyList(policy, "blocked_commands"),
1402
- allowed_actions: normalizeExtensionPolicyList(policy, "allowed_actions"),
1403
- blocked_actions: normalizeExtensionPolicyList(policy, "blocked_actions"),
1404
- allowed_services: normalizeExtensionPolicyList(policy, "allowed_services"),
1405
- blocked_services: normalizeExtensionPolicyList(policy, "blocked_services"),
1406
- extension_overrides: normalizeExtensionPolicyOverrides(policy?.extension_overrides ?? SETTINGS_DEFAULTS.extensions.policy.extension_overrides)
1407
- };
1408
- }
1409
- function normalizeValidationMetadataRequiredFields(values) {
1410
- const normalized = [...new Set((values ?? []).map((value) => value.trim().toLowerCase().replaceAll("-", "_")))].filter((value) => value.length > 0).sort((left, right) => left.localeCompare(right));
1411
- return normalized.filter((value) => [
1412
- "author",
1413
- "acceptance_criteria",
1414
- "estimated_minutes",
1415
- "close_reason",
1416
- "reviewer",
1417
- "risk",
1418
- "confidence",
1419
- "sprint",
1420
- "release"
1421
- ].includes(value));
1422
- }
1423
- function normalizeValidationPatternList(values) {
1424
- return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
1425
- }
1426
- function valueOrDefault(value, fallback) {
1427
- return value === void 0 ? fallback : value;
1428
- }
1429
- function recordOrEmpty(value) {
1430
- return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
1431
- }
1432
- function arrayOrEmpty(value) {
1433
- return Array.isArray(value) ? value : [];
1434
- }
1435
- function buildValidationSettings(settings, defaults, governance) {
1436
- return {
1437
- ...defaults.validation,
1438
- ...settings.validation,
1439
- parent_reference: governance.parent_reference,
1440
- metadata_profile: governance.metadata_profile,
1441
- metadata_required_fields: normalizeValidationMetadataRequiredFields(settings.validation?.metadata_required_fields),
1442
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_stale_blocker_reason_patterns ?? defaults.validation.lifecycle_stale_blocker_reason_patterns),
1443
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? defaults.validation.lifecycle_closure_like_blocked_reason_patterns),
1444
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_resolution_patterns ?? defaults.validation.lifecycle_closure_like_resolution_patterns),
1445
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_actual_result_patterns ?? defaults.validation.lifecycle_closure_like_actual_result_patterns),
1446
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(settings.validation?.estimate_defaults_by_type)
1447
- };
1448
- }
1449
- function buildTelemetrySettings(settings, defaults) {
1450
- return {
1451
- enabled: settings.telemetry?.enabled ?? defaults.telemetry.enabled,
1452
- first_run_prompt_completed: settings.telemetry?.first_run_prompt_completed ?? defaults.telemetry.first_run_prompt_completed,
1453
- capture_level: settings.telemetry?.capture_level ?? defaults.telemetry.capture_level,
1454
- endpoint: settings.telemetry?.endpoint ?? defaults.telemetry.endpoint,
1455
- installation_id: settings.telemetry?.installation_id ?? defaults.telemetry.installation_id,
1456
- retention_days: settings.telemetry?.retention_days ?? defaults.telemetry.retention_days
1457
- };
1458
- }
1459
- function buildSearchSettings(settings, defaults) {
1460
- return {
1461
- ...defaults.search,
1462
- ...settings.search,
1463
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(settings.search?.mutation_refresh_policy),
1464
- query_expansion: {
1465
- ...defaults.search.query_expansion,
1466
- ...settings.search?.query_expansion,
1467
- enabled: normalizeSearchQueryExpansionEnabled(settings.search?.query_expansion?.enabled),
1468
- provider: normalizeSearchQueryExpansionProvider(settings.search?.query_expansion?.provider)
1469
- },
1470
- rerank: {
1471
- ...defaults.search.rerank,
1472
- ...settings.search?.rerank,
1473
- enabled: normalizeSearchRerankEnabled(settings.search?.rerank?.enabled),
1474
- model: normalizeSearchRerankModel(settings.search?.rerank?.model),
1475
- top_k: normalizeSearchRerankTopK(settings.search?.rerank?.top_k)
1476
- }
1477
- };
1478
- }
1479
- function buildVectorStoreSettings(settings, defaults) {
1480
- return {
1481
- adapter: settings.vector_store.adapter ?? defaults.vector_store.adapter,
1482
- collection_name: normalizeVectorStoreCollectionName(settings.vector_store.collection_name),
1483
- qdrant: { ...defaults.vector_store.qdrant, ...settings.vector_store.qdrant },
1484
- lancedb: { ...defaults.vector_store.lancedb, ...settings.vector_store.lancedb }
1485
- };
1486
- }
1487
- function normalizeSettingsItemFormat(settings, defaults) {
1488
- if (settings.item_format === "json_markdown") {
1489
- return "toon";
1490
- }
1491
- return settings.item_format ?? defaults.item_format;
1492
- }
1493
- function buildContextSettings(settings, defaults) {
1494
- return {
1495
- default_depth: settings.context?.default_depth ?? defaults.context.default_depth,
1496
- activity_limit: settings.context?.activity_limit ?? defaults.context.activity_limit,
1497
- stale_threshold_days: settings.context?.stale_threshold_days ?? defaults.context.stale_threshold_days,
1498
- sections: {
1499
- ...defaults.context.sections,
1500
- ...settings.context?.sections
1501
- }
1502
- };
1503
- }
1504
- function buildProviderSettings(settings, defaults) {
1505
- return {
1506
- openai: { ...defaults.providers.openai, ...settings.providers.openai },
1507
- ollama: { ...defaults.providers.ollama, ...settings.providers.ollama }
1508
- };
1509
- }
1510
- function normalizeItemTypeDefinitions(definitions) {
1511
- const normalized = (definitions ?? []).map((definition) => normalizeItemTypeDefinition(definition)).filter((definition) => definition !== null);
1512
- const dedupedByName = /* @__PURE__ */ new Map();
1513
- for (const definition of normalized) {
1514
- dedupedByName.set(definition.name.toLowerCase(), definition);
1515
- }
1516
- return [...dedupedByName.values()].sort((left, right) => left.name.localeCompare(right.name));
1517
- }
1518
- function mergeSettings(settings) {
1519
- const defaults = cloneDefaults();
1520
- const governance = resolveGovernanceKnobs({
1521
- governance: settings.governance ?? { preset: "default" }
1522
- });
1523
- return {
1524
- ...defaults,
1525
- ...settings,
1526
- item_format: normalizeSettingsItemFormat(settings, defaults),
1527
- locks: { ...defaults.locks, ...settings.locks },
1528
- checkpoints: { ...defaults.checkpoints, ...settings.checkpoints },
1529
- output: { ...defaults.output, ...settings.output },
1530
- history: {
1531
- ...defaults.history,
1532
- ...settings.history,
1533
- compact_policy: {
1534
- ...defaults.history.compact_policy,
1535
- ...settings.history?.compact_policy
1536
- }
1537
- },
1538
- validation: buildValidationSettings(settings, defaults, governance),
1539
- governance,
1540
- workflow: {
1541
- definition_of_done: [...settings.workflow?.definition_of_done ?? defaults.workflow.definition_of_done]
1542
- },
1543
- testing: {
1544
- record_results_to_items: settings.testing?.record_results_to_items ?? defaults.testing.record_results_to_items
1545
- },
1546
- telemetry: buildTelemetrySettings(settings, defaults),
1547
- agent_guidance: normalizeAgentGuidanceSettings(settings.agent_guidance ?? defaults.agent_guidance),
1548
- item_types: {
1549
- definitions: normalizeItemTypeDefinitions(settings.item_types?.definitions)
1550
- },
1551
- schema: normalizeRuntimeSchemaSettings(settings.schema ?? defaults.schema),
1552
- context: buildContextSettings(settings, defaults),
1553
- extensions: {
1554
- enabled: [...settings.extensions.enabled],
1555
- disabled: [...settings.extensions.disabled],
1556
- policy: normalizeExtensionPolicySettings(settings.extensions.policy ?? defaults.extensions.policy)
1557
- },
1558
- search: buildSearchSettings(settings, defaults),
1559
- providers: buildProviderSettings(settings, defaults),
1560
- vector_store: buildVectorStoreSettings(settings, defaults)
1561
- };
1562
- }
1563
- function orderSerializedSettingsSections(ordered) {
1564
- ordered.locks = orderObject(ordered.locks, ["ttl_seconds", "wait_ms"]);
1565
- ordered.checkpoints = orderObject(ordered.checkpoints, ["retention_days"]);
1566
- ordered.output = orderObject(ordered.output, ["default_format"]);
1567
- ordered.history = orderObject(ordered.history, ["missing_stream", "compact_policy"]);
1568
- ordered.validation = orderObject(ordered.validation, [
1569
- "sprint_release_format",
1570
- "parent_reference",
1571
- "metadata_profile",
1572
- "metadata_required_fields",
1573
- "lifecycle_stale_blocker_reason_patterns",
1574
- "lifecycle_closure_like_blocked_reason_patterns",
1575
- "lifecycle_closure_like_resolution_patterns",
1576
- "lifecycle_closure_like_actual_result_patterns",
1577
- "estimate_defaults_by_type"
1578
- ]);
1579
- ordered.governance = orderObject(ordered.governance, [
1580
- "preset",
1581
- "ownership_enforcement",
1582
- "create_mode_default",
1583
- "close_validation_default",
1584
- "require_close_reason",
1585
- "parent_reference",
1586
- "metadata_profile",
1587
- "force_required_for_stale_lock",
1588
- "create_default_type",
1589
- "workflow_enforcement"
1590
- ]);
1591
- ordered.workflow = orderObject(ordered.workflow, ["definition_of_done"]);
1592
- ordered.testing = orderObject(ordered.testing, ["record_results_to_items"]);
1593
- ordered.telemetry = orderObject(ordered.telemetry, [
1594
- "enabled",
1595
- "first_run_prompt_completed",
1596
- "capture_level",
1597
- "endpoint",
1598
- "installation_id",
1599
- "retention_days"
1600
- ]);
1601
- ordered.agent_guidance = orderObject(ordered.agent_guidance, [
1602
- "prompt_completed",
1603
- "declined",
1604
- "declined_at",
1605
- "template_version",
1606
- "last_checked_files"
1607
- ]);
1608
- ordered.item_types = orderObject(ordered.item_types, ["definitions"]);
1609
- ordered.schema = orderObject(ordered.schema, [
1610
- "version",
1611
- "files",
1612
- "statuses",
1613
- "fields",
1614
- "workflow",
1615
- "type_workflows",
1616
- "unknown_field_policy"
1617
- ]);
1618
- ordered.schema.files = orderObject(recordOrEmpty(ordered.schema.files), ["types", "statuses", "fields", "workflows"]);
1619
- ordered.schema.workflow = orderObject(recordOrEmpty(ordered.schema.workflow), ["draft_status", "open_status", "in_progress_status", "blocked_status", "close_status", "canceled_status"]);
1620
- ordered.context = orderObject(ordered.context, [
1621
- "default_depth",
1622
- "activity_limit",
1623
- "stale_threshold_days",
1624
- "sections"
1625
- ]);
1626
- ordered.context.sections = orderObject(recordOrEmpty(ordered.context.sections), ["hierarchy", "activity", "progress", "blockers", "files", "workload", "staleness", "tests"]);
1627
- ordered.extensions = orderObject(ordered.extensions, ["enabled", "disabled", "policy"]);
1628
- ordered.extensions.policy = orderObject(recordOrEmpty(ordered.extensions.policy), [
1629
- "mode",
1630
- "trust_mode",
1631
- "pm_max_version_exceeded_mode",
1632
- "require_provenance",
1633
- "trusted_extensions",
1634
- "default_sandbox_profile",
1635
- "allowed_extensions",
1636
- "blocked_extensions",
1637
- "allowed_capabilities",
1638
- "blocked_capabilities",
1639
- "allowed_surfaces",
1640
- "blocked_surfaces",
1641
- "allowed_commands",
1642
- "blocked_commands",
1643
- "allowed_actions",
1644
- "blocked_actions",
1645
- "allowed_services",
1646
- "blocked_services",
1647
- "extension_overrides"
1648
- ]);
1649
- ordered.extensions.policy.extension_overrides = arrayOrEmpty(ordered.extensions.policy.extension_overrides).map((entry) => orderObject(recordOrEmpty(entry), [
1650
- "name",
1651
- "disabled",
1652
- "require_trusted",
1653
- "require_provenance",
1654
- "sandbox_profile",
1655
- "allowed_capabilities",
1656
- "blocked_capabilities",
1657
- "allowed_surfaces",
1658
- "blocked_surfaces",
1659
- "allowed_commands",
1660
- "blocked_commands",
1661
- "allowed_actions",
1662
- "blocked_actions",
1663
- "allowed_services",
1664
- "blocked_services"
1665
- ]));
1666
- ordered.search = orderObject(ordered.search, [
1667
- "score_threshold",
1668
- "hybrid_semantic_weight",
1669
- "max_results",
1670
- "embedding_model",
1671
- "embedding_corpus_max_characters",
1672
- "embedding_batch_size",
1673
- "embedding_timeout_ms",
1674
- "scanner_max_batch_retries",
1675
- "provider",
1676
- "mutation_refresh_policy",
1677
- "query_expansion",
1678
- "rerank"
1679
- ]);
1680
- ordered.search.query_expansion = orderObject(recordOrEmpty(ordered.search.query_expansion), ["enabled", "provider"]);
1681
- ordered.search.rerank = orderObject(recordOrEmpty(ordered.search.rerank), ["enabled", "model", "top_k"]);
1682
- ordered.providers = orderObject(ordered.providers, ["openai", "ollama"]);
1683
- ordered.providers.openai = orderObject(recordOrEmpty(ordered.providers.openai), ["base_url", "api_key", "model"]);
1684
- ordered.providers.ollama = orderObject(recordOrEmpty(ordered.providers.ollama), ["base_url", "model"]);
1685
- ordered.vector_store = orderObject(ordered.vector_store, [
1686
- "adapter",
1687
- "collection_name",
1688
- "qdrant",
1689
- "lancedb"
1690
- ]);
1691
- ordered.vector_store.qdrant = orderObject(recordOrEmpty(ordered.vector_store.qdrant), ["url", "api_key"]);
1692
- ordered.vector_store.lancedb = orderObject(recordOrEmpty(ordered.vector_store.lancedb), ["path"]);
1693
- }
1694
- function buildSerializeBaseSettings(settings) {
1695
- return {
1696
- ...settings,
1697
- locks: valueOrDefault(settings.locks, SETTINGS_DEFAULTS.locks),
1698
- checkpoints: valueOrDefault(settings.checkpoints, SETTINGS_DEFAULTS.checkpoints),
1699
- output: valueOrDefault(settings.output, SETTINGS_DEFAULTS.output),
1700
- history: valueOrDefault(settings.history, SETTINGS_DEFAULTS.history),
1701
- validation: valueOrDefault(settings.validation, SETTINGS_DEFAULTS.validation),
1702
- workflow: valueOrDefault(settings.workflow, SETTINGS_DEFAULTS.workflow),
1703
- testing: valueOrDefault(settings.testing, SETTINGS_DEFAULTS.testing),
1704
- telemetry: valueOrDefault(settings.telemetry, SETTINGS_DEFAULTS.telemetry),
1705
- agent_guidance: valueOrDefault(settings.agent_guidance, SETTINGS_DEFAULTS.agent_guidance),
1706
- item_types: valueOrDefault(settings.item_types, SETTINGS_DEFAULTS.item_types),
1707
- schema: valueOrDefault(settings.schema, SETTINGS_DEFAULTS.schema),
1708
- context: valueOrDefault(settings.context, SETTINGS_DEFAULTS.context),
1709
- extensions: valueOrDefault(settings.extensions, SETTINGS_DEFAULTS.extensions),
1710
- search: valueOrDefault(settings.search, SETTINGS_DEFAULTS.search),
1711
- providers: valueOrDefault(settings.providers, SETTINGS_DEFAULTS.providers),
1712
- vector_store: valueOrDefault(settings.vector_store, SETTINGS_DEFAULTS.vector_store)
1713
- };
1714
- }
1715
- function buildSerializedValidationSettings(baseSettings, governance) {
1716
- return {
1717
- ...baseSettings.validation,
1718
- parent_reference: governance.parent_reference,
1719
- metadata_profile: governance.metadata_profile,
1720
- metadata_required_fields: normalizeValidationMetadataRequiredFields(baseSettings.validation?.metadata_required_fields),
1721
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_stale_blocker_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_stale_blocker_reason_patterns),
1722
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_blocked_reason_patterns),
1723
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_resolution_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_resolution_patterns),
1724
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_actual_result_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_actual_result_patterns),
1725
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(baseSettings.validation?.estimate_defaults_by_type)
1726
- };
1727
- }
1728
- function buildSerializedSearchSettings(baseSettings) {
1729
- return {
1730
- ...SETTINGS_DEFAULTS.search,
1731
- ...baseSettings.search,
1732
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(baseSettings.search?.mutation_refresh_policy),
1733
- query_expansion: {
1734
- ...SETTINGS_DEFAULTS.search.query_expansion,
1735
- ...baseSettings.search?.query_expansion,
1736
- enabled: normalizeSearchQueryExpansionEnabled(baseSettings.search?.query_expansion?.enabled),
1737
- provider: normalizeSearchQueryExpansionProvider(baseSettings.search?.query_expansion?.provider)
1738
- },
1739
- rerank: {
1740
- ...SETTINGS_DEFAULTS.search.rerank,
1741
- ...baseSettings.search?.rerank,
1742
- enabled: normalizeSearchRerankEnabled(baseSettings.search?.rerank?.enabled),
1743
- model: normalizeSearchRerankModel(baseSettings.search?.rerank?.model),
1744
- top_k: normalizeSearchRerankTopK(baseSettings.search?.rerank?.top_k)
1745
- }
1746
- };
1747
- }
1748
- function buildSerializedContextSettings(baseSettings) {
1749
- return {
1750
- default_depth: baseSettings.context?.default_depth ?? SETTINGS_DEFAULTS.context.default_depth,
1751
- activity_limit: baseSettings.context?.activity_limit ?? SETTINGS_DEFAULTS.context.activity_limit,
1752
- stale_threshold_days: baseSettings.context?.stale_threshold_days ?? SETTINGS_DEFAULTS.context.stale_threshold_days,
1753
- sections: {
1754
- ...SETTINGS_DEFAULTS.context.sections,
1755
- ...baseSettings.context?.sections
1756
- }
1757
- };
1758
- }
1759
- function buildSerializedVectorStoreSettings(baseSettings) {
1760
- return {
1761
- ...baseSettings.vector_store,
1762
- adapter: baseSettings.vector_store?.adapter ?? SETTINGS_DEFAULTS.vector_store.adapter,
1763
- collection_name: normalizeVectorStoreCollectionName(baseSettings.vector_store?.collection_name),
1764
- qdrant: { ...baseSettings.vector_store?.qdrant },
1765
- lancedb: { ...baseSettings.vector_store?.lancedb }
1766
- };
1767
- }
1768
- function buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections) {
1769
- return {
1770
- ...baseSettings,
1771
- item_format: "toon",
1772
- validation: buildSerializedValidationSettings(baseSettings, governance),
1773
- governance,
1774
- agent_guidance: normalizeAgentGuidanceSettings(baseSettings.agent_guidance),
1775
- item_types: {
1776
- definitions: persistedFileBackedSections.item_type_definitions
1777
- },
1778
- schema: {
1779
- ...normalizedSchema,
1780
- statuses: persistedFileBackedSections.schema_statuses,
1781
- fields: persistedFileBackedSections.schema_fields,
1782
- type_workflows: persistedFileBackedSections.schema_type_workflows
1783
- },
1784
- search: buildSerializedSearchSettings(baseSettings),
1785
- context: buildSerializedContextSettings(baseSettings),
1786
- extensions: {
1787
- enabled: normalizeStringList(baseSettings.extensions?.enabled),
1788
- disabled: normalizeStringList(baseSettings.extensions?.disabled),
1789
- policy: normalizeExtensionPolicySettings(baseSettings.extensions?.policy)
1790
- },
1791
- vector_store: buildSerializedVectorStoreSettings(baseSettings)
1792
- };
1793
- }
1794
- function serializeSettings(settings, options = {}) {
1795
- const baseSettings = buildSerializeBaseSettings(settings);
1796
- const governance = resolveGovernanceKnobs(baseSettings);
1797
- const normalizedSchema = normalizeRuntimeSchemaSettings(baseSettings.schema);
1798
- const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(baseSettings, options.persist_source);
1799
- const normalizedSettings = buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections);
1800
- const ordered = orderObject({
1801
- ...normalizedSettings,
1802
- governance: normalizeGovernanceForPersist(governance)
1803
- }, [
1804
- "version",
1805
- "id_prefix",
1806
- "author_default",
1807
- "item_format",
1808
- "locks",
1809
- "checkpoints",
1810
- "output",
1811
- "history",
1812
- "validation",
1813
- "governance",
1814
- "workflow",
1815
- "testing",
1816
- "telemetry",
1817
- "agent_guidance",
1818
- "item_types",
1819
- "schema",
1820
- "context",
1821
- "extensions",
1822
- "search",
1823
- "providers",
1824
- "vector_store"
1825
- ]);
1826
- orderSerializedSettingsSections(ordered);
1827
- return `${JSON.stringify(ordered, null, 2)}
1828
- `;
1829
- }
1830
- async function readSettingsWithMetadata(pmRoot) {
1831
- const settingsPath = getSettingsPath(pmRoot);
1832
- let trackedPathsForFailure = [settingsPath];
1833
- await runActiveOnReadHooks({
1834
- path: settingsPath,
1835
- scope: "project"
1836
- });
1837
- const cachedResult = getSettingsReadCacheEntry(pmRoot);
1838
- if (cachedResult) {
1839
- const currentSignatures = await collectSettingsReadCacheSignatures(cachedResult.tracked_paths);
1840
- if (settingsReadCacheSignaturesEqual(currentSignatures, cachedResult.signatures)) {
1841
- return cloneSettingsReadResult(cachedResult.value);
1842
- }
1843
- }
1844
- const settingsOnlySignatures = await collectSettingsReadCacheSignatures([settingsPath]);
1845
- const raw = await readFileIfExists(settingsPath);
1846
- if (raw === null) {
1847
- const fallback = buildFallbackSettingsReadResult();
1848
- await cacheSettingsReadResultIfStable(pmRoot, [settingsPath], fallback, settingsOnlySignatures, [settingsPath]);
1849
- return fallback;
1850
- }
1851
- const settingsSignaturesAfterRead = await collectSettingsReadCacheSignatures([settingsPath]);
1852
- if (!settingsReadCacheSignaturesEqual(settingsOnlySignatures, settingsSignaturesAfterRead)) {
1853
- clearSettingsReadCache(pmRoot);
1854
- return readSettingsWithMetadata(pmRoot);
1855
- }
1856
- let parsed;
1857
- try {
1858
- parsed = JSON.parse(raw);
1859
- } catch {
1860
- const fallback = buildFallbackSettingsReadResult("settings_read_invalid_json");
1861
- await cacheSettingsReadResultIfStable(pmRoot, [settingsPath], fallback, settingsSignaturesAfterRead, [settingsPath]);
1862
- return fallback;
1863
- }
1864
- const validated = validateSettings(parsed);
1865
- if (!validated.success) {
1866
- const fallback = buildFallbackSettingsReadResult("settings_read_invalid_schema");
1867
- await cacheSettingsReadResultIfStable(pmRoot, [settingsPath], fallback, settingsSignaturesAfterRead, [settingsPath]);
1868
- return fallback;
1869
- }
1870
- try {
1871
- const mergedSettings = mergeSettings(validated.data);
1872
- const trackedPaths = resolveSettingsReadTrackedPaths(pmRoot, mergedSettings.schema, settingsPath);
1873
- trackedPathsForFailure = trackedPaths;
1874
- const signaturesBeforeSchemaLoad = await collectSettingsReadCacheSignatures(trackedPaths);
1875
- const schemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, mergedSettings.schema);
1876
- const loadedSchemaSections = await loadRuntimeSchemaFromOptionalFiles(pmRoot, mergedSettings.schema);
1877
- const signaturesAfterSchemaLoad = await collectSettingsReadCacheSignatures(trackedPaths);
1878
- const settings = {
1879
- ...mergedSettings,
1880
- item_types: {
1881
- definitions: normalizeItemTypeDefinitions([
1882
- ...mergedSettings.item_types.definitions,
1883
- ...arrayOrEmpty(loadedSchemaSections.type_definitions_from_file)
1884
- ])
1885
- },
1886
- schema: loadedSchemaSections.schema
1887
- };
1888
- attachSettingsPersistSourceSnapshot(settings, buildSettingsPersistSourceSnapshot(validated.data, settings));
1889
- const result = {
1890
- settings,
1891
- metadata: {
1892
- has_explicit_item_format: hasExplicitItemFormat(parsed)
1893
- },
1894
- warnings: [
1895
- ...validated.data.item_format === "json_markdown" ? ["settings_item_format_legacy_json_markdown_coerced_to_toon"] : [],
1896
- ...schemaScaffold.created_paths.map((createdPath) => `runtime_schema_bootstrap_created:${createdPath}`),
1897
- ...loadedSchemaSections.warnings
1898
- ]
1899
- };
1900
- if (schemaScaffold.created_paths.length === 0) {
1901
- if (!settingsReadCacheSignaturesEqual(signaturesBeforeSchemaLoad, signaturesAfterSchemaLoad)) {
1902
- clearSettingsReadCache(pmRoot);
1903
- } else {
1904
- setSettingsReadCacheEntry(pmRoot, {
1905
- tracked_paths: trackedPaths,
1906
- signatures: signaturesAfterSchemaLoad,
1907
- value: cloneSettingsReadResult(result)
1908
- });
1909
- }
1910
- } else {
1911
- clearSettingsReadCache(pmRoot);
1912
- }
1913
- return result;
1914
- } catch {
1915
- const fallback = buildFallbackSettingsReadResult("settings_read_merge_failed");
1916
- await cacheSettingsReadResultSafe(pmRoot, trackedPathsForFailure, fallback);
1917
- return fallback;
1918
- }
1919
- }
1920
- async function readSettings(pmRoot) {
1921
- return (await readSettingsWithMetadata(pmRoot)).settings;
1922
- }
1923
- async function writeSettings(pmRoot, settings, op = SETTINGS_WRITE_OP) {
1924
- const settingsPath = getSettingsPath(pmRoot);
1925
- await writeFileAtomic(settingsPath, serializeSettings(settings, {
1926
- persist_source: getSettingsPersistSourceSnapshot(settings)
1927
- }));
1928
- try {
1929
- await runActiveOnWriteHooks({
1930
- path: settingsPath,
1931
- scope: "project",
1932
- op
1933
- });
1934
- } finally {
1935
- clearSettingsReadCache(pmRoot);
1936
- }
1937
- }
1938
-
1939
- export {
1940
- setActiveExtensionHooks,
1941
- setActiveExtensionCommands,
1942
- setActiveExtensionParsers,
1943
- setActiveExtensionPreflight,
1944
- setActiveExtensionServices,
1945
- setActiveExtensionRenderers,
1946
- setActiveExtensionRegistrations,
1947
- getActiveExtensionRegistrations,
1948
- setActiveCommandContext,
1949
- setActiveCommandResult,
1950
- getActiveCommandResult,
1951
- recordAfterCommandAffectedItem,
1952
- projectAfterCommandItemSnapshot,
1953
- consumeAfterCommandAffectedItems,
1954
- clearActiveExtensionHooks,
1955
- runActiveOnWriteHooks,
1956
- runActiveOnReadHooks,
1957
- hasActiveOnReadHooks,
1958
- runActiveOnIndexHooks,
1959
- runActiveCommandOverride,
1960
- runActiveCommandHandler,
1961
- runActiveParserOverride,
1962
- runActivePreflightOverride,
1963
- runActiveRendererOverride,
1964
- runActiveServiceOverride,
1965
- runActiveServiceOverrideSync,
1966
- PmCliError,
1967
- stableStringify,
1968
- stableValueEquals,
1969
- sha256Hex,
1970
- orderObject,
1971
- resolveEstimateDefaultMinutes,
1972
- resolveGovernanceKnobs,
1973
- readSettingsWithMetadata,
1974
- readSettings,
1975
- writeSettings
1976
- };
1977
- //# sourceMappingURL=chunk-P5YORJRH.js.map