@unbrained/pm-cli 2026.6.30 → 2026.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (628) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +26 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +58 -47
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/aggregate.js +102 -79
  9. package/dist/cli/commands/aggregate.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +339 -303
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/close-many.js +89 -68
  13. package/dist/cli/commands/close-many.js.map +1 -1
  14. package/dist/cli/commands/close.js +157 -129
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments-audit.js +50 -42
  17. package/dist/cli/commands/comments-audit.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +2 -0
  19. package/dist/cli/commands/config.js +443 -879
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.js +365 -287
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +352 -238
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +483 -434
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +46 -39
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/dedupe-merge.js +88 -69
  30. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  31. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  32. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +129 -78
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/managed-state.js +101 -57
  36. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  38. package/dist/cli/commands/extension/scaffold.js +214 -186
  39. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  40. package/dist/cli/commands/extension.d.ts +6 -1
  41. package/dist/cli/commands/extension.js +1034 -902
  42. package/dist/cli/commands/extension.js.map +1 -1
  43. package/dist/cli/commands/get.js +114 -81
  44. package/dist/cli/commands/get.js.map +1 -1
  45. package/dist/cli/commands/health.d.ts +17 -0
  46. package/dist/cli/commands/health.js +446 -307
  47. package/dist/cli/commands/health.js.map +1 -1
  48. package/dist/cli/commands/history-compact.js +209 -140
  49. package/dist/cli/commands/history-compact.js.map +1 -1
  50. package/dist/cli/commands/history-redact.js +162 -119
  51. package/dist/cli/commands/history-redact.js.map +1 -1
  52. package/dist/cli/commands/history-repair.js +120 -85
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts +8 -2
  55. package/dist/cli/commands/init.js +263 -162
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/list-filter-shared.js +55 -48
  58. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  59. package/dist/cli/commands/list.js +152 -102
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/next.js +49 -32
  62. package/dist/cli/commands/next.js.map +1 -1
  63. package/dist/cli/commands/plan.js +373 -298
  64. package/dist/cli/commands/plan.js.map +1 -1
  65. package/dist/cli/commands/recurrence-parsers.js +43 -25
  66. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  67. package/dist/cli/commands/reindex.d.ts +21 -5
  68. package/dist/cli/commands/reindex.js +345 -205
  69. package/dist/cli/commands/reindex.js.map +1 -1
  70. package/dist/cli/commands/restore.d.ts +8 -7
  71. package/dist/cli/commands/restore.js +105 -69
  72. package/dist/cli/commands/restore.js.map +1 -1
  73. package/dist/cli/commands/schema.js +33 -30
  74. package/dist/cli/commands/schema.js.map +1 -1
  75. package/dist/cli/commands/search.d.ts +10 -2
  76. package/dist/cli/commands/search.js +595 -536
  77. package/dist/cli/commands/search.js.map +1 -1
  78. package/dist/cli/commands/telemetry.js +98 -87
  79. package/dist/cli/commands/telemetry.js.map +1 -1
  80. package/dist/cli/commands/test-all.js +237 -168
  81. package/dist/cli/commands/test-all.js.map +1 -1
  82. package/dist/cli/commands/test.d.ts +6 -5
  83. package/dist/cli/commands/test.js +530 -464
  84. package/dist/cli/commands/test.js.map +1 -1
  85. package/dist/cli/commands/update-many.js +57 -42
  86. package/dist/cli/commands/update-many.js.map +1 -1
  87. package/dist/cli/commands/update.d.ts +1 -1
  88. package/dist/cli/commands/update.js +764 -747
  89. package/dist/cli/commands/update.js.map +1 -1
  90. package/dist/cli/commands/validate.d.ts +18 -1
  91. package/dist/cli/commands/validate.js +466 -343
  92. package/dist/cli/commands/validate.js.map +1 -1
  93. package/dist/cli/error-guidance.js +399 -357
  94. package/dist/cli/error-guidance.js.map +1 -1
  95. package/dist/cli/extension-command-options.js +48 -21
  96. package/dist/cli/extension-command-options.js.map +1 -1
  97. package/dist/cli/main.d.ts +47 -0
  98. package/dist/cli/main.js +428 -341
  99. package/dist/cli/main.js.map +1 -1
  100. package/dist/cli/migration-gates.js +22 -45
  101. package/dist/cli/migration-gates.js.map +1 -1
  102. package/dist/cli/register-list-query.js +94 -105
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +400 -416
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +86 -66
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +120 -101
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +117 -122
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
  113. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  114. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
  115. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
  117. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  118. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
  119. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
  120. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
  121. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
  125. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
  127. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
  129. package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
  132. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  133. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
  135. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
  137. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
  138. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
  140. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
  142. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
  144. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
  146. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
  148. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
  150. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
  152. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
  154. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
  156. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
  158. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
  160. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  162. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
  164. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
  165. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
  168. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
  169. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
  172. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
  173. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
  174. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
  178. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
  180. package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
  182. package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
  185. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
  187. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
  189. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
  192. package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
  196. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
  199. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
  200. package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
  202. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  203. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
  204. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
  206. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
  208. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
  211. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
  213. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
  214. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
  216. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
  218. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
  220. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
  222. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
  224. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
  225. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
  227. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
  229. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  230. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  231. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
  233. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
  235. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  236. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
  237. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
  239. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
  241. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
  243. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
  246. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
  248. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  249. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  250. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
  252. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
  253. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
  254. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
  255. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  256. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
  257. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  258. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
  259. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  260. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
  261. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
  262. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  263. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  265. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
  267. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
  268. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
  269. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
  271. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
  273. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
  274. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
  275. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  276. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
  277. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
  278. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
  279. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
  280. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
  281. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
  282. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
  283. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
  284. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
  285. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
  286. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
  287. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
  288. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
  289. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
  290. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
  291. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
  292. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
  293. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
  295. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  296. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
  297. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
  299. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  300. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  301. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
  302. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
  303. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  304. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
  305. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  306. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  307. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
  308. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
  309. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
  311. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  312. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
  313. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  314. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
  315. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
  316. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
  317. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
  318. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
  319. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
  321. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  322. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
  323. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
  324. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
  325. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  326. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
  327. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  328. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
  329. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
  330. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
  331. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  332. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
  333. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  334. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
  335. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
  337. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  338. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
  339. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
  341. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
  343. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
  345. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
  347. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  348. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  349. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  350. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
  351. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
  352. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
  353. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
  354. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
  355. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
  356. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
  357. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
  359. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
  361. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
  362. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  363. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  364. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  365. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  366. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
  367. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
  369. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  370. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  371. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
  372. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
  373. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
  374. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
  375. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
  377. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
  379. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
  381. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
  383. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  384. package/dist/cli-bundle/main.js +986 -1500
  385. package/dist/cli-bundle/main.js.map +4 -4
  386. package/dist/core/config/nested-settings.js +89 -67
  387. package/dist/core/config/nested-settings.js.map +1 -1
  388. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  389. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  390. package/dist/core/extensions/extension-policy.d.ts +18 -3
  391. package/dist/core/extensions/extension-policy.js +116 -106
  392. package/dist/core/extensions/extension-policy.js.map +1 -1
  393. package/dist/core/extensions/loader.js +310 -232
  394. package/dist/core/extensions/loader.js.map +1 -1
  395. package/dist/core/governance/metadata-coverage.js +20 -28
  396. package/dist/core/governance/metadata-coverage.js.map +1 -1
  397. package/dist/core/history/drift-scan.js +93 -81
  398. package/dist/core/history/drift-scan.js.map +1 -1
  399. package/dist/core/item/item-format.js +523 -410
  400. package/dist/core/item/item-format.js.map +1 -1
  401. package/dist/core/item/item-type-definition.js +14 -14
  402. package/dist/core/item/item-type-definition.js.map +1 -1
  403. package/dist/core/item/type-registry.js +87 -82
  404. package/dist/core/item/type-registry.js.map +1 -1
  405. package/dist/core/output/mutation-projection.js +42 -26
  406. package/dist/core/output/mutation-projection.js.map +1 -1
  407. package/dist/core/schema/runtime-schema.js +34 -28
  408. package/dist/core/schema/runtime-schema.js.map +1 -1
  409. package/dist/core/search/semantic-defaults.js +64 -37
  410. package/dist/core/search/semantic-defaults.js.map +1 -1
  411. package/dist/core/search/vector-stores.js +32 -17
  412. package/dist/core/search/vector-stores.js.map +1 -1
  413. package/dist/core/sentry/helpers.js +31 -28
  414. package/dist/core/sentry/helpers.js.map +1 -1
  415. package/dist/core/sentry/instrument.js +54 -43
  416. package/dist/core/sentry/instrument.js.map +1 -1
  417. package/dist/core/store/front-matter-cache.js +239 -153
  418. package/dist/core/store/front-matter-cache.js.map +1 -1
  419. package/dist/core/store/item-store.js +33 -26
  420. package/dist/core/store/item-store.js.map +1 -1
  421. package/dist/core/store/settings.js +247 -203
  422. package/dist/core/store/settings.js.map +1 -1
  423. package/dist/core/test/background-runs.js +189 -160
  424. package/dist/core/test/background-runs.js.map +1 -1
  425. package/dist/mcp/server.js +387 -367
  426. package/dist/mcp/server.js.map +1 -1
  427. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  428. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  429. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  430. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  431. package/dist/sdk/compose.d.ts +4 -1
  432. package/dist/sdk/compose.js +181 -115
  433. package/dist/sdk/compose.js.map +1 -1
  434. package/docs/RELEASING.md +2 -3
  435. package/package.json +2 -2
  436. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  437. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  438. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  439. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  440. package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  443. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  444. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  451. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  459. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  465. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
  471. package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  484. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  485. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  486. package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
  488. package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
  489. package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
  490. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  491. package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
  492. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  493. package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
  494. package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
  495. package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
  496. package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
  497. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
  498. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
  499. package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
  500. package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
  501. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  502. package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
  503. package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
  504. package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
  505. package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
  506. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  507. package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
  508. package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
  509. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  510. package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
  512. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  513. package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
  514. package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
  515. package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
  516. package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
  517. package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
  518. package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
  522. package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
  523. package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
  524. package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
  525. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  526. package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
  527. package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
  529. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
  531. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
  533. package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
  534. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  535. package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
  536. package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
  537. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
@@ -788,7 +788,7 @@ var CONTEXT_SECTION_VALUES = [
788
788
  !(function() {
789
789
  try {
790
790
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
791
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "257435ee-2ef3-5736-a403-57d6265cf280");
791
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a5621ca3-a40f-59d1-9bce-02c10afcc247");
792
792
  } catch (e2) {
793
793
  }
794
794
  })();
@@ -843,6 +843,13 @@ function normalizeItemTypeCommandOptionPolicies(policies, resolvePolicyCommand)
843
843
  }
844
844
  return [...dedupedByKey.values()].sort((left, right) => left.command === right.command ? left.option.localeCompare(right.option) : left.command.localeCompare(right.command));
845
845
  }
846
+ function normalizeOptionalStringList(values, preservePresence) {
847
+ return preservePresence ? normalizeItemTypeStringList(values) : void 0;
848
+ }
849
+ function optionalNonEmptyString(value) {
850
+ const normalized = value?.trim();
851
+ return normalized && normalized.length > 0 ? normalized : void 0;
852
+ }
846
853
  function normalizeItemTypeDefinition(definition, options = {}) {
847
854
  const resolvePolicyCommand = options.resolvePolicyCommand ?? keepPolicyCommand;
848
855
  const name = definition.name.trim();
@@ -853,20 +860,17 @@ function normalizeItemTypeDefinition(definition, options = {}) {
853
860
  const hasRequiredCreateRepeatables = definition.required_create_repeatables !== void 0;
854
861
  const hasOptions = definition.options !== void 0;
855
862
  const hasCommandOptionPolicies = definition.command_option_policies !== void 0;
856
- const folder = definition.folder?.trim();
857
- const description = definition.description?.trim();
858
- const defaultStatus = definition.default_status?.trim();
859
863
  const aliases = normalizeItemTypeStringList(definition.aliases);
860
864
  const normalizedOptions = (definition.options ?? []).map((option) => normalizeItemTypeOption(option)).filter((option) => option !== null).sort((left, right) => left.key.localeCompare(right.key));
861
865
  const commandOptionPolicies = normalizeItemTypeCommandOptionPolicies(definition.command_option_policies, resolvePolicyCommand);
862
866
  return {
863
867
  name,
864
- description: description && description.length > 0 ? description : void 0,
865
- default_status: defaultStatus && defaultStatus.length > 0 ? defaultStatus : void 0,
866
- folder: folder && folder.length > 0 ? folder : void 0,
868
+ description: optionalNonEmptyString(definition.description),
869
+ default_status: optionalNonEmptyString(definition.default_status),
870
+ folder: optionalNonEmptyString(definition.folder),
867
871
  aliases: aliases.length > 0 ? aliases : void 0,
868
- required_create_fields: hasRequiredCreateFields ? normalizeItemTypeStringList(definition.required_create_fields) : void 0,
869
- required_create_repeatables: hasRequiredCreateRepeatables ? normalizeItemTypeStringList(definition.required_create_repeatables) : void 0,
872
+ required_create_fields: normalizeOptionalStringList(definition.required_create_fields, hasRequiredCreateFields),
873
+ required_create_repeatables: normalizeOptionalStringList(definition.required_create_repeatables, hasRequiredCreateRepeatables),
870
874
  options: hasOptions ? normalizedOptions : void 0,
871
875
  command_option_policies: hasCommandOptionPolicies ? commandOptionPolicies : void 0
872
876
  };
@@ -876,7 +880,7 @@ function normalizeItemTypeDefinition(definition, options = {}) {
876
880
  !(function() {
877
881
  try {
878
882
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
879
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "aca609de-d881-5f34-804f-ed3daa6aab2a");
883
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5d1396d8-5493-51c2-9b51-4b57073f85da");
880
884
  } catch (e2) {
881
885
  }
882
886
  })();
@@ -1188,6 +1192,58 @@ function toSlugToken(value) {
1188
1192
  function normalizeTypeDefinition(definition) {
1189
1193
  return normalizeItemTypeDefinition(definition, { resolvePolicyCommand: strictPolicyCommand });
1190
1194
  }
1195
+ function readStringArray(record, key) {
1196
+ const value = record[key];
1197
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
1198
+ }
1199
+ function coerceOptionDefinitionFromUnknown(raw) {
1200
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
1201
+ return null;
1202
+ }
1203
+ const optionRecord = raw;
1204
+ if (typeof optionRecord.key !== "string") {
1205
+ return null;
1206
+ }
1207
+ return {
1208
+ key: optionRecord.key,
1209
+ values: readStringArray(optionRecord, "values") ?? [],
1210
+ required: optionRecord.required === void 0 ? void 0 : Boolean(optionRecord.required),
1211
+ aliases: readStringArray(optionRecord, "aliases"),
1212
+ description: typeof optionRecord.description === "string" ? optionRecord.description : void 0
1213
+ };
1214
+ }
1215
+ function coerceCommandOptionPolicyFromUnknown(raw) {
1216
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
1217
+ return null;
1218
+ }
1219
+ const policyRecord = raw;
1220
+ if (typeof policyRecord.command !== "string" || typeof policyRecord.option !== "string") {
1221
+ return null;
1222
+ }
1223
+ const normalizedCommand = policyRecord.command.trim().toLowerCase();
1224
+ if (normalizedCommand !== "create" && normalizedCommand !== "update") {
1225
+ return null;
1226
+ }
1227
+ return {
1228
+ command: normalizedCommand,
1229
+ option: policyRecord.option,
1230
+ required: policyRecord.required === void 0 ? void 0 : Boolean(policyRecord.required),
1231
+ visible: policyRecord.visible === void 0 ? void 0 : Boolean(policyRecord.visible),
1232
+ enabled: policyRecord.enabled === void 0 ? void 0 : Boolean(policyRecord.enabled)
1233
+ };
1234
+ }
1235
+ function coerceOptionDefinitionsFromRecord(record) {
1236
+ if (!Array.isArray(record.options)) {
1237
+ return void 0;
1238
+ }
1239
+ return record.options.map((entry) => coerceOptionDefinitionFromUnknown(entry)).filter((entry) => entry !== null);
1240
+ }
1241
+ function coerceCommandOptionPoliciesFromRecord(record) {
1242
+ if (!Array.isArray(record.command_option_policies)) {
1243
+ return void 0;
1244
+ }
1245
+ return record.command_option_policies.map((entry) => coerceCommandOptionPolicyFromUnknown(entry)).filter((entry) => entry !== null);
1246
+ }
1191
1247
  function coerceTypeDefinitionFromUnknown(raw) {
1192
1248
  if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
1193
1249
  return null;
@@ -1200,65 +1256,30 @@ function coerceTypeDefinitionFromUnknown(raw) {
1200
1256
  const folder = typeof record.folder === "string" ? record.folder : void 0;
1201
1257
  const description = typeof record.description === "string" ? record.description : void 0;
1202
1258
  const defaultStatus = typeof record.default_status === "string" ? record.default_status : void 0;
1203
- const aliases = Array.isArray(record.aliases) ? record.aliases.filter((value) => typeof value === "string") : void 0;
1204
- const requiredCreateFields = Array.isArray(record.required_create_fields) ? record.required_create_fields.filter((value) => typeof value === "string") : void 0;
1205
- const requiredCreateRepeatables = Array.isArray(record.required_create_repeatables) ? record.required_create_repeatables.filter((value) => typeof value === "string") : void 0;
1206
- let options;
1207
- if (Array.isArray(record.options)) {
1208
- options = [];
1209
- for (const entry of record.options) {
1210
- if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
1211
- continue;
1212
- }
1213
- const optionRecord = entry;
1214
- if (typeof optionRecord.key !== "string") {
1215
- continue;
1216
- }
1217
- options.push({
1218
- key: optionRecord.key,
1219
- values: Array.isArray(optionRecord.values) ? optionRecord.values.filter((value) => typeof value === "string") : [],
1220
- required: optionRecord.required === void 0 ? void 0 : Boolean(optionRecord.required),
1221
- aliases: Array.isArray(optionRecord.aliases) ? optionRecord.aliases.filter((value) => typeof value === "string") : void 0,
1222
- description: typeof optionRecord.description === "string" ? optionRecord.description : void 0
1223
- });
1224
- }
1225
- }
1226
- let commandOptionPolicies;
1227
- if (Array.isArray(record.command_option_policies)) {
1228
- commandOptionPolicies = [];
1229
- for (const entry of record.command_option_policies) {
1230
- if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
1231
- continue;
1232
- }
1233
- const policyRecord = entry;
1234
- if (typeof policyRecord.command !== "string" || typeof policyRecord.option !== "string") {
1235
- continue;
1236
- }
1237
- const normalizedCommand = policyRecord.command.trim().toLowerCase();
1238
- if (normalizedCommand !== "create" && normalizedCommand !== "update") {
1239
- continue;
1240
- }
1241
- commandOptionPolicies.push({
1242
- command: normalizedCommand,
1243
- option: policyRecord.option,
1244
- required: policyRecord.required === void 0 ? void 0 : Boolean(policyRecord.required),
1245
- visible: policyRecord.visible === void 0 ? void 0 : Boolean(policyRecord.visible),
1246
- enabled: policyRecord.enabled === void 0 ? void 0 : Boolean(policyRecord.enabled)
1247
- });
1248
- }
1249
- }
1250
1259
  return {
1251
1260
  name,
1252
1261
  description,
1253
1262
  default_status: defaultStatus,
1254
1263
  folder,
1255
- aliases,
1256
- required_create_fields: requiredCreateFields,
1257
- required_create_repeatables: requiredCreateRepeatables,
1258
- options,
1259
- command_option_policies: commandOptionPolicies
1264
+ aliases: readStringArray(record, "aliases"),
1265
+ required_create_fields: readStringArray(record, "required_create_fields"),
1266
+ required_create_repeatables: readStringArray(record, "required_create_repeatables"),
1267
+ options: coerceOptionDefinitionsFromRecord(record),
1268
+ command_option_policies: coerceCommandOptionPoliciesFromRecord(record)
1260
1269
  };
1261
1270
  }
1271
+ function resolveDefinitionRequiredCreateFields(normalizedDefinition, existing) {
1272
+ return normalizedDefinition.required_create_fields ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields) : existing?.required_create_fields ?? [];
1273
+ }
1274
+ function resolveDefinitionRequiredCreateRepeatables(normalizedDefinition, existing) {
1275
+ return normalizedDefinition.required_create_repeatables ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables) : existing?.required_create_repeatables ?? [];
1276
+ }
1277
+ function resolveDefinitionOptions(normalizedDefinition, existing) {
1278
+ return normalizedDefinition.options ? normalizedDefinition.options : existing?.options ? [...existing.options] : [];
1279
+ }
1280
+ function resolveDefinitionCommandOptionPolicies(normalizedDefinition, existing) {
1281
+ return normalizedDefinition.command_option_policies ? normalizedDefinition.command_option_policies : existing?.command_option_policies ? [...existing.command_option_policies] : [];
1282
+ }
1262
1283
  function applyTypeDefinitions(source, target) {
1263
1284
  for (const rawDefinition of source) {
1264
1285
  const normalizedDefinition = normalizeTypeDefinition(rawDefinition);
@@ -1273,10 +1294,6 @@ function applyTypeDefinitions(source, target) {
1273
1294
  ...existing?.aliases ?? [],
1274
1295
  ...normalizedDefinition.aliases ?? []
1275
1296
  ]);
1276
- const requiredCreateFields = normalizedDefinition.required_create_fields ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields) : existing?.required_create_fields ?? [];
1277
- const requiredCreateRepeatables = normalizedDefinition.required_create_repeatables ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables) : existing?.required_create_repeatables ?? [];
1278
- const options = normalizedDefinition.options ? normalizedDefinition.options : existing?.options ? [...existing.options] : [];
1279
- const commandOptionPolicies = normalizedDefinition.command_option_policies ? normalizedDefinition.command_option_policies : existing?.command_option_policies ? [...existing.command_option_policies] : [];
1280
1297
  const defaultStatus = normalizedDefinition.default_status ?? existing?.default_status;
1281
1298
  const description = normalizedDefinition.description ?? existing?.description;
1282
1299
  target.set(lowerName, {
@@ -1285,10 +1302,10 @@ function applyTypeDefinitions(source, target) {
1285
1302
  ...defaultStatus ? { default_status: defaultStatus } : {},
1286
1303
  folder,
1287
1304
  aliases,
1288
- required_create_fields: requiredCreateFields,
1289
- required_create_repeatables: requiredCreateRepeatables,
1290
- options,
1291
- command_option_policies: commandOptionPolicies
1305
+ required_create_fields: resolveDefinitionRequiredCreateFields(normalizedDefinition, existing),
1306
+ required_create_repeatables: resolveDefinitionRequiredCreateRepeatables(normalizedDefinition, existing),
1307
+ options: resolveDefinitionOptions(normalizedDefinition, existing),
1308
+ command_option_policies: resolveDefinitionCommandOptionPolicies(normalizedDefinition, existing)
1292
1309
  });
1293
1310
  }
1294
1311
  }
@@ -2526,7 +2543,7 @@ function parseLegacyExtensionCapabilityAliasWarning(warning) {
2526
2543
  !(function() {
2527
2544
  try {
2528
2545
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
2529
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "34b7e8e0-c42f-50c2-9ee5-093565566cd7");
2546
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "dbc43b74-6872-52c3-859a-64fe84c02b5b");
2530
2547
  } catch (e2) {
2531
2548
  }
2532
2549
  })();
@@ -2639,34 +2656,15 @@ function collectExtensionPolicyOverrides(rawOverrides) {
2639
2656
  }
2640
2657
  return overridesByName;
2641
2658
  }
2642
- function normalizeExtensionPolicy(settings) {
2643
- const policy = settings.extensions.policy;
2644
- const mode = normalizePolicyMode(policy?.mode);
2645
- const trustMode = normalizePolicyTrustMode(policy?.trust_mode);
2646
- const pmMaxVersionExceededMode2 = normalizePmMaxVersionExceededMode(policy?.pm_max_version_exceeded_mode);
2647
- const requireProvenance = policy?.require_provenance === true;
2648
- const trustedExtensions = normalizePolicyStringSet(policy?.trusted_extensions);
2649
- const defaultSandboxProfile = normalizePolicySandboxProfile(policy?.default_sandbox_profile);
2650
- const allowedExtensions = normalizePolicyStringSet(policy?.allowed_extensions);
2651
- const blockedExtensions = normalizePolicyStringSet(policy?.blocked_extensions);
2652
- const allowedCapabilities = normalizePolicyStringSet(policy?.allowed_capabilities);
2653
- const blockedCapabilities = normalizePolicyStringSet(policy?.blocked_capabilities);
2654
- const allowedSurfaces = normalizePolicySurfaceSet(policy?.allowed_surfaces);
2655
- const blockedSurfaces = normalizePolicySurfaceSet(policy?.blocked_surfaces);
2656
- const allowedCommands = normalizePolicyStringSet(policy?.allowed_commands);
2657
- const blockedCommands = normalizePolicyStringSet(policy?.blocked_commands);
2658
- const allowedActions = normalizePolicyStringSet(policy?.allowed_actions);
2659
- const blockedActions = normalizePolicyStringSet(policy?.blocked_actions);
2660
- const allowedServices = normalizePolicyStringSet(policy?.allowed_services);
2661
- const blockedServices = normalizePolicyStringSet(policy?.blocked_services);
2662
- const overridesByName = collectExtensionPolicyOverrides(policy?.extension_overrides);
2659
+ function collectExtensionPolicyWarnings(normalized) {
2663
2660
  const warnings = [];
2664
- for (const capability of toSortedList([...allowedCapabilities, ...blockedCapabilities])) {
2661
+ const sortedOverrides = [...normalized.overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name));
2662
+ for (const capability of toSortedList([...normalized.allowedCapabilities, ...normalized.blockedCapabilities])) {
2665
2663
  if (!isKnownExtensionCapability(capability)) {
2666
2664
  warnings.push(`extension_policy_unknown_capability:${capability}`);
2667
2665
  }
2668
2666
  }
2669
- for (const override of [...overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name))) {
2667
+ for (const override of sortedOverrides) {
2670
2668
  for (const capability of toSortedList([...override.allowedCapabilities, ...override.blockedCapabilities])) {
2671
2669
  if (!isKnownExtensionCapability(capability)) {
2672
2670
  warnings.push(`extension_policy_unknown_capability:${override.name}:${capability}`);
@@ -2674,39 +2672,54 @@ function normalizeExtensionPolicy(settings) {
2674
2672
  }
2675
2673
  }
2676
2674
  const knownSurfaces = new Set(KNOWN_EXTENSION_POLICY_SURFACES);
2677
- for (const surface of toSortedList([...allowedSurfaces, ...blockedSurfaces])) {
2675
+ for (const surface of toSortedList([...normalized.allowedSurfaces, ...normalized.blockedSurfaces])) {
2678
2676
  if (!knownSurfaces.has(surface)) {
2679
2677
  warnings.push(`extension_policy_unknown_surface:${surface}`);
2680
2678
  }
2681
2679
  }
2682
- for (const override of [...overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name))) {
2680
+ for (const override of sortedOverrides) {
2683
2681
  for (const surface of toSortedList([...override.allowedSurfaces, ...override.blockedSurfaces])) {
2684
2682
  if (!knownSurfaces.has(surface)) {
2685
2683
  warnings.push(`extension_policy_unknown_surface:${override.name}:${surface}`);
2686
2684
  }
2687
2685
  }
2688
2686
  }
2687
+ return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
2688
+ }
2689
+ function normalizeExtensionPolicy(settings) {
2690
+ const policy = settings.extensions?.policy ?? {};
2691
+ const allowedCapabilities = normalizePolicyStringSet(policy.allowed_capabilities);
2692
+ const blockedCapabilities = normalizePolicyStringSet(policy.blocked_capabilities);
2693
+ const allowedSurfaces = normalizePolicySurfaceSet(policy.allowed_surfaces);
2694
+ const blockedSurfaces = normalizePolicySurfaceSet(policy.blocked_surfaces);
2695
+ const overridesByName = collectExtensionPolicyOverrides(policy.extension_overrides);
2689
2696
  return {
2690
- mode,
2691
- trustMode,
2692
- pmMaxVersionExceededMode: pmMaxVersionExceededMode2,
2693
- requireProvenance,
2694
- trustedExtensions,
2695
- defaultSandboxProfile,
2696
- allowedExtensions,
2697
- blockedExtensions,
2697
+ mode: normalizePolicyMode(policy.mode),
2698
+ trustMode: normalizePolicyTrustMode(policy.trust_mode),
2699
+ pmMaxVersionExceededMode: normalizePmMaxVersionExceededMode(policy.pm_max_version_exceeded_mode),
2700
+ requireProvenance: policy.require_provenance === true,
2701
+ trustedExtensions: normalizePolicyStringSet(policy.trusted_extensions),
2702
+ defaultSandboxProfile: normalizePolicySandboxProfile(policy.default_sandbox_profile),
2703
+ allowedExtensions: normalizePolicyStringSet(policy.allowed_extensions),
2704
+ blockedExtensions: normalizePolicyStringSet(policy.blocked_extensions),
2698
2705
  allowedCapabilities,
2699
2706
  blockedCapabilities,
2700
2707
  allowedSurfaces,
2701
2708
  blockedSurfaces,
2702
- allowedCommands,
2703
- blockedCommands,
2704
- allowedActions,
2705
- blockedActions,
2706
- allowedServices,
2707
- blockedServices,
2709
+ allowedCommands: normalizePolicyStringSet(policy.allowed_commands),
2710
+ blockedCommands: normalizePolicyStringSet(policy.blocked_commands),
2711
+ allowedActions: normalizePolicyStringSet(policy.allowed_actions),
2712
+ blockedActions: normalizePolicyStringSet(policy.blocked_actions),
2713
+ allowedServices: normalizePolicyStringSet(policy.allowed_services),
2714
+ blockedServices: normalizePolicyStringSet(policy.blocked_services),
2708
2715
  overridesByName,
2709
- warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right))
2716
+ warnings: collectExtensionPolicyWarnings({
2717
+ allowedCapabilities,
2718
+ blockedCapabilities,
2719
+ allowedSurfaces,
2720
+ blockedSurfaces,
2721
+ overridesByName
2722
+ })
2710
2723
  };
2711
2724
  }
2712
2725
  function serializeExtensionPolicy(policy) {
@@ -2917,55 +2930,28 @@ function evaluateExtensionPolicyForExtension(policy, extension) {
2917
2930
  if (policy.mode === "off" && policy.trustMode === "off") {
2918
2931
  return { allowed: true, warning: null };
2919
2932
  }
2933
+ const violations = [];
2920
2934
  const reason = resolvePolicyExtensionReason(policy, extension);
2921
- const trustReason = resolvePolicyTrustReason(policy, extension);
2922
- const sandboxReason = resolvePolicySandboxReason(policy, extension);
2923
- const extensionEnforced = reason && policy.mode === "enforce";
2924
- const trustEnforced = trustReason && policy.trustMode === "enforce";
2925
- const sandboxEnforced = sandboxReason && policy.mode === "enforce";
2926
- if (!reason && !trustReason && !sandboxReason) {
2927
- return { allowed: true, warning: null };
2935
+ if (reason) {
2936
+ violations.push({ reason, scope: "extension", mode: policy.mode });
2928
2937
  }
2929
- if (extensionEnforced) {
2930
- return {
2931
- allowed: false,
2932
- warning: buildPolicyWarning("blocked", "extension", extension, reason)
2933
- };
2934
- }
2935
- if (trustEnforced) {
2936
- return {
2937
- allowed: false,
2938
- warning: buildPolicyWarning("blocked", "trust", extension, trustReason)
2939
- };
2938
+ const trustReason = resolvePolicyTrustReason(policy, extension);
2939
+ if (trustReason) {
2940
+ violations.push({ reason: trustReason, scope: "trust", mode: policy.trustMode });
2940
2941
  }
2941
- if (sandboxEnforced) {
2942
- return {
2943
- allowed: false,
2944
- warning: buildPolicyWarning("blocked", "extension", extension, sandboxReason)
2945
- };
2942
+ const sandboxReason = resolvePolicySandboxReason(policy, extension);
2943
+ if (sandboxReason) {
2944
+ violations.push({ reason: sandboxReason, scope: "extension", mode: policy.mode });
2946
2945
  }
2947
- if (reason && policy.mode === "warn") {
2948
- return {
2949
- allowed: true,
2950
- warning: buildPolicyWarning("violation", "extension", extension, reason)
2951
- };
2946
+ const enforced = violations.find((violation) => violation.mode === "enforce");
2947
+ if (enforced) {
2948
+ return { allowed: false, warning: buildPolicyWarning("blocked", enforced.scope, extension, enforced.reason) };
2952
2949
  }
2953
- if (trustReason && policy.trustMode === "warn") {
2954
- return {
2955
- allowed: true,
2956
- warning: buildPolicyWarning("violation", "trust", extension, trustReason)
2957
- };
2950
+ const warned = violations.find((violation) => violation.mode === "warn");
2951
+ if (warned) {
2952
+ return { allowed: true, warning: buildPolicyWarning("violation", warned.scope, extension, warned.reason) };
2958
2953
  }
2959
- if (sandboxReason && policy.mode === "warn") {
2960
- return {
2961
- allowed: true,
2962
- warning: buildPolicyWarning("violation", "extension", extension, sandboxReason)
2963
- };
2964
- }
2965
- return {
2966
- allowed: true,
2967
- warning: null
2968
- };
2954
+ return { allowed: true, warning: null };
2969
2955
  }
2970
2956
  function evaluateExtensionPolicyForCapability(policy, extension, capability) {
2971
2957
  if (policy.mode === "off") {
@@ -2980,19 +2966,15 @@ function evaluateExtensionPolicyForCapability(policy, extension, capability) {
2980
2966
  warning: buildPolicyWarning(policy.mode === "warn" ? "violation" : "blocked", "capability", extension, reason, { capability: capability.trim().toLowerCase() })
2981
2967
  };
2982
2968
  }
2983
- function evaluateExtensionPolicyForRegistration(policy, extension, surface, method, capability, details) {
2984
- if (policy.mode === "off") {
2985
- return { allowed: true, warning: null };
2986
- }
2969
+ function resolveRegistrationPolicyReason(policy, extension, surface, capability, detail) {
2987
2970
  const capabilityReason = typeof capability === "string" ? resolvePolicyCapabilityReason(policy, extension, capability) : null;
2988
2971
  const surfaceReason = resolvePolicySurfaceReason(policy, extension, surface);
2989
- const commandReason = details?.command ? resolvePolicyCommandReason(policy, extension, details.command) : null;
2990
- const actionReason = details?.action ? resolvePolicyActionReason(policy, extension, details.action) : null;
2991
- const serviceReason = details?.service ? resolvePolicyServiceReason(policy, extension, details.service) : null;
2992
- const reason = capabilityReason ?? surfaceReason ?? commandReason ?? actionReason ?? serviceReason;
2993
- if (!reason) {
2994
- return { allowed: true, warning: null };
2995
- }
2972
+ const commandReason = detail.command ? resolvePolicyCommandReason(policy, extension, detail.command) : null;
2973
+ const actionReason = detail.action ? resolvePolicyActionReason(policy, extension, detail.action) : null;
2974
+ const serviceReason = detail.service ? resolvePolicyServiceReason(policy, extension, detail.service) : null;
2975
+ return capabilityReason ?? surfaceReason ?? commandReason ?? actionReason ?? serviceReason;
2976
+ }
2977
+ function buildRegistrationPolicyWarningDetails(method, surface, capability, detail) {
2996
2978
  const warningDetails = {
2997
2979
  method: normalizePolicyName(method).replace(/\s+/g, "_"),
2998
2980
  surface
@@ -3000,16 +2982,27 @@ function evaluateExtensionPolicyForRegistration(policy, extension, surface, meth
3000
2982
  if (capability) {
3001
2983
  warningDetails.capability = capability;
3002
2984
  }
3003
- if (details?.command) {
3004
- warningDetails.command = normalizeCommandName(details.command);
2985
+ if (detail.command) {
2986
+ warningDetails.command = normalizeCommandName(detail.command);
2987
+ }
2988
+ if (detail.action) {
2989
+ warningDetails.action = normalizePolicyName(detail.action).replace(/\s+/g, "-");
2990
+ }
2991
+ if (detail.service) {
2992
+ warningDetails.service = normalizePolicyName(detail.service);
3005
2993
  }
3006
- if (details?.action) {
3007
- warningDetails.action = normalizePolicyName(details.action).replace(/\s+/g, "-");
2994
+ return warningDetails;
2995
+ }
2996
+ function evaluateExtensionPolicyForRegistration(policy, extension, surface, method, capability, details) {
2997
+ if (policy.mode === "off") {
2998
+ return { allowed: true, warning: null };
3008
2999
  }
3009
- if (details?.service) {
3010
- warningDetails.service = normalizePolicyName(details.service);
3000
+ const detail = details ?? {};
3001
+ const reason = resolveRegistrationPolicyReason(policy, extension, surface, capability, detail);
3002
+ if (!reason) {
3003
+ return { allowed: true, warning: null };
3011
3004
  }
3012
- const warning = buildPolicyWarning(policy.mode === "warn" ? "violation" : "blocked", "registration", extension, reason, warningDetails);
3005
+ const warning = buildPolicyWarning(policy.mode === "warn" ? "violation" : "blocked", "registration", extension, reason, buildRegistrationPolicyWarningDetails(method, surface, capability, detail));
3013
3006
  return {
3014
3007
  allowed: policy.mode === "warn",
3015
3008
  warning
@@ -3020,7 +3013,7 @@ function evaluateExtensionPolicyForRegistration(policy, extension, surface, meth
3020
3013
  !(function() {
3021
3014
  try {
3022
3015
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3023
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a323e13b-37e3-5ec6-bc21-1ab78e0b30b9");
3016
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c04aa899-5cba-5907-be3e-4db7c63b7f13");
3024
3017
  } catch (e2) {
3025
3018
  }
3026
3019
  })();
@@ -3063,33 +3056,134 @@ function parseManifestEngines(value) {
3063
3056
  }
3064
3057
  return Object.keys(engines).length > 0 ? engines : void 0;
3065
3058
  }
3066
- function parseManifest(raw) {
3067
- if (typeof raw !== "object" || raw === null) {
3059
+ function parseRequiredManifestString(candidate, field) {
3060
+ const value = candidate[field];
3061
+ if (typeof value !== "string" || value.trim().length === 0) {
3068
3062
  return null;
3069
3063
  }
3070
- const candidate = raw;
3071
- if (typeof candidate.name !== "string" || candidate.name.trim().length === 0) {
3064
+ return value.trim();
3065
+ }
3066
+ function parseOptionalIntegerValue(value) {
3067
+ if (value === void 0 || value === null) {
3068
+ return void 0;
3069
+ }
3070
+ if (typeof value !== "number" || !Number.isInteger(value)) {
3072
3071
  return null;
3073
3072
  }
3074
- if (typeof candidate.version !== "string" || candidate.version.trim().length === 0) {
3073
+ return value;
3074
+ }
3075
+ function parseOptionalBooleanValue(value) {
3076
+ if (value === void 0 || value === null) {
3077
+ return void 0;
3078
+ }
3079
+ if (typeof value !== "boolean") {
3075
3080
  return null;
3076
3081
  }
3077
- if (typeof candidate.entry !== "string" || candidate.entry.trim().length === 0) {
3082
+ return value;
3083
+ }
3084
+ function parseManifestPriority(candidate) {
3085
+ const value = parseOptionalIntegerValue(candidate.priority);
3086
+ return value === void 0 ? DEFAULT_EXTENSION_PRIORITY : value;
3087
+ }
3088
+ function parseManifestSandboxProfile(candidate) {
3089
+ const value = candidate.sandbox_profile;
3090
+ if (value === void 0 || value === null) {
3091
+ return void 0;
3092
+ }
3093
+ if (typeof value !== "string") {
3078
3094
  return null;
3079
3095
  }
3080
- let priority = DEFAULT_EXTENSION_PRIORITY;
3081
- if ("priority" in candidate && candidate.priority !== void 0 && candidate.priority !== null) {
3082
- if (typeof candidate.priority !== "number" || !Number.isInteger(candidate.priority)) {
3083
- return null;
3084
- }
3085
- priority = candidate.priority;
3096
+ const normalizedProfile = normalizePolicySandboxProfile(value);
3097
+ if (normalizedProfile !== value.trim().toLowerCase()) {
3098
+ return null;
3086
3099
  }
3087
- let manifestVersion;
3088
- if ("manifest_version" in candidate && candidate.manifest_version !== void 0 && candidate.manifest_version !== null) {
3089
- if (typeof candidate.manifest_version !== "number" || !Number.isInteger(candidate.manifest_version)) {
3090
- return null;
3091
- }
3092
- manifestVersion = candidate.manifest_version;
3100
+ return normalizedProfile;
3101
+ }
3102
+ function optionalTrimmedString(value) {
3103
+ return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
3104
+ }
3105
+ function parseManifestProvenance(value) {
3106
+ if (value === void 0 || value === null) {
3107
+ return void 0;
3108
+ }
3109
+ const provenanceRecord = asRecordLoose(value);
3110
+ if (!provenanceRecord) {
3111
+ return null;
3112
+ }
3113
+ const source = optionalTrimmedString(provenanceRecord.source);
3114
+ const signature = optionalTrimmedString(provenanceRecord.signature);
3115
+ const attestation = optionalTrimmedString(provenanceRecord.attestation);
3116
+ const verified = provenanceRecord.verified === void 0 || provenanceRecord.verified === null ? void 0 : typeof provenanceRecord.verified === "boolean" ? provenanceRecord.verified : null;
3117
+ if (verified === null) {
3118
+ return null;
3119
+ }
3120
+ return {
3121
+ ...source ? { source } : {},
3122
+ ...signature ? { signature } : {},
3123
+ ...attestation ? { attestation } : {},
3124
+ ...typeof verified === "boolean" ? { verified } : {}
3125
+ };
3126
+ }
3127
+ function parseManifestPermissions(value) {
3128
+ if (value === void 0 || value === null) {
3129
+ return void 0;
3130
+ }
3131
+ const permissionsRecord = asRecordLoose(value);
3132
+ if (!permissionsRecord) {
3133
+ return null;
3134
+ }
3135
+ const fsRead = parseOptionalBooleanValue(permissionsRecord.fs_read);
3136
+ const fsWrite = parseOptionalBooleanValue(permissionsRecord.fs_write);
3137
+ const network = parseOptionalBooleanValue(permissionsRecord.network);
3138
+ const envRead = parseOptionalBooleanValue(permissionsRecord.env_read);
3139
+ const envWrite = parseOptionalBooleanValue(permissionsRecord.env_write);
3140
+ const processSpawn = parseOptionalBooleanValue(permissionsRecord.process_spawn);
3141
+ if ([fsRead, fsWrite, network, envRead, envWrite, processSpawn].includes(null)) {
3142
+ return null;
3143
+ }
3144
+ return {
3145
+ ...typeof fsRead === "boolean" ? { fs_read: fsRead } : {},
3146
+ ...typeof fsWrite === "boolean" ? { fs_write: fsWrite } : {},
3147
+ ...typeof network === "boolean" ? { network } : {},
3148
+ ...typeof envRead === "boolean" ? { env_read: envRead } : {},
3149
+ ...typeof envWrite === "boolean" ? { env_write: envWrite } : {},
3150
+ ...typeof processSpawn === "boolean" ? { process_spawn: processSpawn } : {}
3151
+ };
3152
+ }
3153
+ function parseManifestCapabilities(value) {
3154
+ if (value === void 0 || value === null) {
3155
+ return { capabilities: [], legacy_aliases: [] };
3156
+ }
3157
+ if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
3158
+ return null;
3159
+ }
3160
+ const normalizedCapabilities = normalizeManifestCapabilities(value);
3161
+ return { capabilities: normalizedCapabilities.capabilities, legacy_aliases: normalizedCapabilities.legacy_aliases };
3162
+ }
3163
+ function parseManifestActivation(value) {
3164
+ if (value === void 0 || value === null) {
3165
+ return void 0;
3166
+ }
3167
+ const activationRecord = asRecordLoose(value);
3168
+ if (!activationRecord) {
3169
+ return null;
3170
+ }
3171
+ const rawCommands = activationRecord.commands;
3172
+ if (rawCommands === void 0 || rawCommands === null) {
3173
+ return void 0;
3174
+ }
3175
+ if (!Array.isArray(rawCommands) || rawCommands.some((entry) => typeof entry !== "string")) {
3176
+ return null;
3177
+ }
3178
+ const commands = [
3179
+ ...new Set(rawCommands.map((entry) => normalizeCommandName(entry)).filter((entry) => entry.length > 0))
3180
+ ].sort((left, right) => left.localeCompare(right));
3181
+ return commands.length > 0 ? { commands } : void 0;
3182
+ }
3183
+ function parseManifestMetadata(candidate) {
3184
+ const manifestVersion = parseOptionalIntegerValue(candidate.manifest_version);
3185
+ if (manifestVersion === null) {
3186
+ return null;
3093
3187
  }
3094
3188
  const pmMinVersion = parseOptionalManifestString(candidate, "pm_min_version");
3095
3189
  if (pmMinVersion === null) {
@@ -3103,124 +3197,85 @@ function parseManifest(raw) {
3103
3197
  if (engines === null) {
3104
3198
  return null;
3105
3199
  }
3106
- let trusted;
3107
- if ("trusted" in candidate && candidate.trusted !== void 0 && candidate.trusted !== null) {
3108
- if (typeof candidate.trusted !== "boolean") {
3109
- return null;
3110
- }
3111
- trusted = candidate.trusted;
3200
+ const trusted = parseOptionalBooleanValue(candidate.trusted);
3201
+ if (trusted === null) {
3202
+ return null;
3112
3203
  }
3113
- let sandboxProfile;
3114
- if ("sandbox_profile" in candidate && candidate.sandbox_profile !== void 0 && candidate.sandbox_profile !== null) {
3115
- if (typeof candidate.sandbox_profile !== "string") {
3116
- return null;
3117
- }
3118
- const normalizedProfile = normalizePolicySandboxProfile(candidate.sandbox_profile);
3119
- if (normalizedProfile !== candidate.sandbox_profile.trim().toLowerCase()) {
3120
- return null;
3121
- }
3122
- sandboxProfile = normalizedProfile;
3204
+ const sandboxProfile = parseManifestSandboxProfile(candidate);
3205
+ if (sandboxProfile === null) {
3206
+ return null;
3123
3207
  }
3124
- let provenance;
3125
- if ("provenance" in candidate && candidate.provenance !== void 0 && candidate.provenance !== null) {
3126
- const provenanceRecord = asRecordLoose(candidate.provenance);
3127
- if (!provenanceRecord) {
3128
- return null;
3129
- }
3130
- const source = typeof provenanceRecord.source === "string" && provenanceRecord.source.trim().length > 0 ? provenanceRecord.source.trim() : void 0;
3131
- const signature = typeof provenanceRecord.signature === "string" && provenanceRecord.signature.trim().length > 0 ? provenanceRecord.signature.trim() : void 0;
3132
- const attestation = typeof provenanceRecord.attestation === "string" && provenanceRecord.attestation.trim().length > 0 ? provenanceRecord.attestation.trim() : void 0;
3133
- const verified = provenanceRecord.verified === void 0 || provenanceRecord.verified === null ? void 0 : typeof provenanceRecord.verified === "boolean" ? provenanceRecord.verified : null;
3134
- if (verified === null) {
3135
- return null;
3136
- }
3137
- provenance = {
3138
- ...source ? { source } : {},
3139
- ...signature ? { signature } : {},
3140
- ...attestation ? { attestation } : {},
3141
- ...typeof verified === "boolean" ? { verified } : {}
3142
- };
3208
+ const provenance = parseManifestProvenance(candidate.provenance);
3209
+ if (provenance === null) {
3210
+ return null;
3143
3211
  }
3144
- let permissions;
3145
- if ("permissions" in candidate && candidate.permissions !== void 0 && candidate.permissions !== null) {
3146
- const permissionsRecord = asRecordLoose(candidate.permissions);
3147
- if (!permissionsRecord) {
3148
- return null;
3149
- }
3150
- const parseOptionalBoolean = (value) => {
3151
- if (value === void 0 || value === null) {
3152
- return void 0;
3153
- }
3154
- if (typeof value !== "boolean") {
3155
- return null;
3156
- }
3157
- return value;
3158
- };
3159
- const fsRead = parseOptionalBoolean(permissionsRecord.fs_read);
3160
- const fsWrite = parseOptionalBoolean(permissionsRecord.fs_write);
3161
- const network = parseOptionalBoolean(permissionsRecord.network);
3162
- const envRead = parseOptionalBoolean(permissionsRecord.env_read);
3163
- const envWrite = parseOptionalBoolean(permissionsRecord.env_write);
3164
- const processSpawn = parseOptionalBoolean(permissionsRecord.process_spawn);
3165
- if ([fsRead, fsWrite, network, envRead, envWrite, processSpawn].includes(null)) {
3166
- return null;
3167
- }
3168
- permissions = {
3169
- ...typeof fsRead === "boolean" ? { fs_read: fsRead } : {},
3170
- ...typeof fsWrite === "boolean" ? { fs_write: fsWrite } : {},
3171
- ...typeof network === "boolean" ? { network } : {},
3172
- ...typeof envRead === "boolean" ? { env_read: envRead } : {},
3173
- ...typeof envWrite === "boolean" ? { env_write: envWrite } : {},
3174
- ...typeof processSpawn === "boolean" ? { process_spawn: processSpawn } : {}
3175
- };
3212
+ const permissions = parseManifestPermissions(candidate.permissions);
3213
+ if (permissions === null) {
3214
+ return null;
3176
3215
  }
3177
- let capabilities = [];
3178
- let legacyCapabilityAliases = [];
3179
- if ("capabilities" in candidate && candidate.capabilities !== void 0 && candidate.capabilities !== null) {
3180
- if (!Array.isArray(candidate.capabilities) || candidate.capabilities.some((value) => typeof value !== "string")) {
3181
- return null;
3182
- }
3183
- const normalizedCapabilities = normalizeManifestCapabilities(candidate.capabilities);
3184
- capabilities = normalizedCapabilities.capabilities;
3185
- legacyCapabilityAliases = normalizedCapabilities.legacy_aliases;
3216
+ const capabilities = parseManifestCapabilities(candidate.capabilities);
3217
+ if (capabilities === null) {
3218
+ return null;
3186
3219
  }
3187
- let activation;
3188
- if ("activation" in candidate && candidate.activation !== void 0 && candidate.activation !== null) {
3189
- const activationRecord = asRecordLoose(candidate.activation);
3190
- if (!activationRecord) {
3191
- return null;
3192
- }
3193
- const rawCommands = activationRecord.commands;
3194
- if (rawCommands !== void 0 && rawCommands !== null) {
3195
- if (!Array.isArray(rawCommands) || rawCommands.some((value) => typeof value !== "string")) {
3196
- return null;
3197
- }
3198
- const commands = [
3199
- ...new Set(rawCommands.map((value) => normalizeCommandName(value)).filter((value) => value.length > 0))
3200
- ].sort((left, right) => left.localeCompare(right));
3201
- if (commands.length > 0) {
3202
- activation = {
3203
- commands
3204
- };
3205
- }
3206
- }
3220
+ const activation = parseManifestActivation(candidate.activation);
3221
+ if (activation === null) {
3222
+ return null;
3207
3223
  }
3208
3224
  return {
3209
- name: candidate.name.trim(),
3210
- version: candidate.version.trim(),
3211
- entry: candidate.entry.trim(),
3212
- priority,
3213
3225
  manifest_version: manifestVersion,
3214
3226
  pm_min_version: pmMinVersion,
3215
3227
  pm_max_version: pmMaxVersion,
3216
3228
  engines,
3217
3229
  trusted,
3218
- provenance,
3219
3230
  sandbox_profile: sandboxProfile,
3231
+ provenance,
3220
3232
  permissions,
3221
- activation,
3222
- capabilities,
3223
- legacy_capability_aliases: legacyCapabilityAliases.length > 0 ? legacyCapabilityAliases : void 0
3233
+ capabilities: capabilities.capabilities,
3234
+ legacy_capability_aliases: capabilities.legacy_aliases,
3235
+ activation
3236
+ };
3237
+ }
3238
+ function parseManifest(raw) {
3239
+ if (typeof raw !== "object" || raw === null) {
3240
+ return null;
3241
+ }
3242
+ const candidate = raw;
3243
+ const name = parseRequiredManifestString(candidate, "name");
3244
+ if (name === null) {
3245
+ return null;
3246
+ }
3247
+ const version = parseRequiredManifestString(candidate, "version");
3248
+ if (version === null) {
3249
+ return null;
3250
+ }
3251
+ const entry = parseRequiredManifestString(candidate, "entry");
3252
+ if (entry === null) {
3253
+ return null;
3254
+ }
3255
+ const priority = parseManifestPriority(candidate);
3256
+ if (priority === null) {
3257
+ return null;
3258
+ }
3259
+ const metadata = parseManifestMetadata(candidate);
3260
+ if (metadata === null) {
3261
+ return null;
3262
+ }
3263
+ return {
3264
+ name,
3265
+ version,
3266
+ entry,
3267
+ priority,
3268
+ manifest_version: metadata.manifest_version,
3269
+ pm_min_version: metadata.pm_min_version,
3270
+ pm_max_version: metadata.pm_max_version,
3271
+ engines: metadata.engines,
3272
+ trusted: metadata.trusted,
3273
+ provenance: metadata.provenance,
3274
+ sandbox_profile: metadata.sandbox_profile,
3275
+ permissions: metadata.permissions,
3276
+ activation: metadata.activation,
3277
+ capabilities: metadata.capabilities,
3278
+ legacy_capability_aliases: metadata.legacy_capability_aliases.length > 0 ? metadata.legacy_capability_aliases : void 0
3224
3279
  };
3225
3280
  }
3226
3281
  function shouldEnable(name, enabled, disabled) {
@@ -3349,26 +3404,50 @@ async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled, pmMa
3349
3404
  }
3350
3405
  return { diagnostics, warnings, candidates };
3351
3406
  }
3407
+ function buildUnavailableExtensionScan(layer, directory, manifestPath, warning) {
3408
+ return {
3409
+ diagnostic: {
3410
+ layer,
3411
+ directory,
3412
+ manifest_path: manifestPath,
3413
+ name: null,
3414
+ version: null,
3415
+ entry: null,
3416
+ priority: null,
3417
+ entry_path: null,
3418
+ enabled: null,
3419
+ status: "warn"
3420
+ },
3421
+ warnings: [warning],
3422
+ candidate: null
3423
+ };
3424
+ }
3425
+ function collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility) {
3426
+ const extensionWarnings = [];
3427
+ if (Array.isArray(manifest.legacy_capability_aliases) && manifest.legacy_capability_aliases.length > 0) {
3428
+ extensionWarnings.push(formatLegacyExtensionCapabilityAliasWarning(layer, manifest.name, manifest.legacy_capability_aliases));
3429
+ }
3430
+ for (const capability of collectUnknownExtensionCapabilities(manifest.capabilities)) {
3431
+ extensionWarnings.push(formatUnknownExtensionCapabilityWarning(layer, manifest.name, capability));
3432
+ }
3433
+ if (!entryWithinDirectory) {
3434
+ extensionWarnings.push(`extension_entry_outside_extension:${layer}:${manifest.name}`);
3435
+ } else if (!entryExists) {
3436
+ extensionWarnings.push(`extension_entry_missing:${layer}:${manifest.name}`);
3437
+ }
3438
+ if (pmVersionCompatibility.warning) {
3439
+ extensionWarnings.push(pmVersionCompatibility.warning);
3440
+ }
3441
+ if (pmMaxVersionCompatibility.warning) {
3442
+ extensionWarnings.push(pmMaxVersionCompatibility.warning);
3443
+ }
3444
+ return extensionWarnings;
3445
+ }
3352
3446
  async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode2) {
3353
3447
  const extensionDir = path5.join(extensionsRoot, directory);
3354
3448
  const manifestPath = path5.join(extensionDir, "manifest.json");
3355
3449
  if (!await pathExists(manifestPath)) {
3356
- return {
3357
- diagnostic: {
3358
- layer,
3359
- directory,
3360
- manifest_path: manifestPath,
3361
- name: null,
3362
- version: null,
3363
- entry: null,
3364
- priority: null,
3365
- entry_path: null,
3366
- enabled: null,
3367
- status: "warn"
3368
- },
3369
- warnings: [`extension_manifest_missing:${layer}:${directory}`],
3370
- candidate: null
3371
- };
3450
+ return buildUnavailableExtensionScan(layer, directory, manifestPath, `extension_manifest_missing:${layer}:${directory}`);
3372
3451
  }
3373
3452
  let manifest = null;
3374
3453
  try {
@@ -3378,48 +3457,16 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
3378
3457
  manifest = null;
3379
3458
  }
3380
3459
  if (!manifest) {
3381
- return {
3382
- diagnostic: {
3383
- layer,
3384
- directory,
3385
- manifest_path: manifestPath,
3386
- name: null,
3387
- version: null,
3388
- entry: null,
3389
- priority: null,
3390
- entry_path: null,
3391
- enabled: null,
3392
- status: "warn"
3393
- },
3394
- warnings: [`extension_manifest_invalid:${layer}:${directory}`],
3395
- candidate: null
3396
- };
3460
+ return buildUnavailableExtensionScan(layer, directory, manifestPath, `extension_manifest_invalid:${layer}:${directory}`);
3397
3461
  }
3398
3462
  const entryPath = path5.resolve(extensionDir, manifest.entry);
3399
3463
  const entryWithinDirectoryByPath = isPathWithinDirectory(extensionDir, entryPath);
3400
3464
  const entryExists = entryWithinDirectoryByPath ? await pathExists(entryPath) : false;
3401
3465
  const entryWithinDirectory = entryWithinDirectoryByPath && entryExists ? await isCanonicalPathWithinDirectory(extensionDir, entryPath) : entryWithinDirectoryByPath;
3402
3466
  const enabledForLoad = shouldEnable(manifest.name, enabled, disabled);
3403
- const extensionWarnings = [];
3404
- if (Array.isArray(manifest.legacy_capability_aliases) && manifest.legacy_capability_aliases.length > 0) {
3405
- extensionWarnings.push(formatLegacyExtensionCapabilityAliasWarning(layer, manifest.name, manifest.legacy_capability_aliases));
3406
- }
3407
- for (const capability of collectUnknownExtensionCapabilities(manifest.capabilities)) {
3408
- extensionWarnings.push(formatUnknownExtensionCapabilityWarning(layer, manifest.name, capability));
3409
- }
3410
- if (!entryWithinDirectory) {
3411
- extensionWarnings.push(`extension_entry_outside_extension:${layer}:${manifest.name}`);
3412
- } else if (!entryExists) {
3413
- extensionWarnings.push(`extension_entry_missing:${layer}:${manifest.name}`);
3414
- }
3415
3467
  const pmVersionCompatibility = await evaluatePmMinVersionCompatibility(layer, manifest);
3416
- if (pmVersionCompatibility.warning) {
3417
- extensionWarnings.push(pmVersionCompatibility.warning);
3418
- }
3419
3468
  const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest, pmMaxVersionExceededMode2);
3420
- if (pmMaxVersionCompatibility.warning) {
3421
- extensionWarnings.push(pmMaxVersionCompatibility.warning);
3422
- }
3469
+ const extensionWarnings = collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility);
3423
3470
  const extensionReady = entryWithinDirectory && entryExists && pmVersionCompatibility.allowed && pmMaxVersionCompatibility.allowed;
3424
3471
  const sourcePackage = managedSourcePackages.get(`directory:${directory}`) ?? managedSourcePackages.get(`name:${manifest.name}`);
3425
3472
  return {
@@ -4169,69 +4216,70 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
4169
4216
  received: sanitizeRegistrationValue(received),
4170
4217
  hint
4171
4218
  });
4172
- const registerCommand = (commandOrDefinition, override) => {
4173
- assertExtensionCapability(extension, "commands", "registerCommand");
4174
- if (typeof commandOrDefinition === "string") {
4175
- const normalizedCommand2 = normalizeCommandName(commandOrDefinition);
4176
- if (normalizedCommand2.length === 0) {
4177
- throw createRegistrationValidationError("registerCommand requires a non-empty command name", registerCommandTrace("override", commandOrDefinition, 'registerCommand("<command>", (context) => unknown)', commandOrDefinition, "Provide a non-empty command path as the first argument."));
4178
- }
4179
- if (typeof override !== "function") {
4180
- const trace = registerCommandTrace("override", normalizedCommand2, 'registerCommand("<command>", (context) => unknown)', { command: commandOrDefinition, override }, "Provide a function as the second registerCommand argument.");
4181
- throw createRegistrationValidationError(`registerCommand requires an override function when command name is provided (command="${normalizedCommand2}", registration_index=${trace.registration_index})`, trace);
4182
- }
4183
- if (!allowRegistration("commands.override", "registerCommand", "commands", { command: normalizedCommand2 })) {
4184
- return;
4185
- }
4186
- commands.overrides.push({
4187
- layer: extension.layer,
4188
- name: extension.name,
4189
- command: normalizedCommand2,
4190
- run: override
4191
- });
4192
- return;
4193
- }
4194
- if (typeof commandOrDefinition !== "object" || commandOrDefinition === null) {
4195
- throw createRegistrationValidationError("registerCommand requires a command definition object", registerCommandTrace("definition", void 0, "{ name: string; run: (context) => unknown; }", commandOrDefinition, 'Use registerCommand({ name: "command path", run: (context) => ... }).'));
4219
+ const registerCommandOverride = (command, override) => {
4220
+ const normalizedCommand = normalizeCommandName(command);
4221
+ if (normalizedCommand.length === 0) {
4222
+ throw createRegistrationValidationError("registerCommand requires a non-empty command name", registerCommandTrace("override", command, 'registerCommand("<command>", (context) => unknown)', command, "Provide a non-empty command path as the first argument."));
4196
4223
  }
4197
- if (typeof commandOrDefinition.name !== "string") {
4198
- throw createRegistrationValidationError("registerCommand requires a command definition name", registerCommandTrace("definition", void 0, "{ name: string; run: (context) => unknown; }", commandOrDefinition, "Set command definition.name to a non-empty string command path."));
4224
+ if (typeof override !== "function") {
4225
+ const trace = registerCommandTrace("override", normalizedCommand, 'registerCommand("<command>", (context) => unknown)', { command, override }, "Provide a function as the second registerCommand argument.");
4226
+ throw createRegistrationValidationError(`registerCommand requires an override function when command name is provided (command="${normalizedCommand}", registration_index=${trace.registration_index})`, trace);
4199
4227
  }
4200
- const normalizedCommand = normalizeCommandName(commandOrDefinition.name);
4201
- if (normalizedCommand.length === 0) {
4202
- throw createRegistrationValidationError("registerCommand requires a non-empty command definition name", registerCommandTrace("definition", commandOrDefinition.name, "{ name: string; run: (context) => unknown; }", commandOrDefinition, "Ensure command definition.name contains a non-empty command path."));
4228
+ if (!allowRegistration("commands.override", "registerCommand", "commands", { command: normalizedCommand })) {
4229
+ return;
4203
4230
  }
4204
- const runHandler = typeof commandOrDefinition.run === "function" ? commandOrDefinition.run : void 0;
4205
- const legacyHandler = typeof commandOrDefinition.handler === "function" ? commandOrDefinition.handler : void 0;
4231
+ commands.overrides.push({
4232
+ layer: extension.layer,
4233
+ name: extension.name,
4234
+ command: normalizedCommand,
4235
+ run: override
4236
+ });
4237
+ };
4238
+ const resolveCommandDefinitionRunHandler = (definition, normalizedCommand) => {
4239
+ const runHandler = typeof definition.run === "function" ? definition.run : void 0;
4240
+ const legacyHandler = typeof definition.handler === "function" ? definition.handler : void 0;
4206
4241
  if (!runHandler && legacyHandler) {
4207
4242
  activationWarnings.push(`extension_command_definition_legacy_handler_alias:${extension.layer}:${extension.name}:${normalizedCommand}`);
4208
4243
  }
4209
- const resolvedHandler = runHandler ?? legacyHandler;
4244
+ return runHandler ?? legacyHandler;
4245
+ };
4246
+ const registerCommandDefinition = (definition) => {
4247
+ if (typeof definition !== "object" || definition === null) {
4248
+ throw createRegistrationValidationError("registerCommand requires a command definition object", registerCommandTrace("definition", void 0, "{ name: string; run: (context) => unknown; }", definition, 'Use registerCommand({ name: "command path", run: (context) => ... }).'));
4249
+ }
4250
+ if (typeof definition.name !== "string") {
4251
+ throw createRegistrationValidationError("registerCommand requires a command definition name", registerCommandTrace("definition", void 0, "{ name: string; run: (context) => unknown; }", definition, "Set command definition.name to a non-empty string command path."));
4252
+ }
4253
+ const normalizedCommand = normalizeCommandName(definition.name);
4254
+ if (normalizedCommand.length === 0) {
4255
+ throw createRegistrationValidationError("registerCommand requires a non-empty command definition name", registerCommandTrace("definition", definition.name, "{ name: string; run: (context) => unknown; }", definition, "Ensure command definition.name contains a non-empty command path."));
4256
+ }
4257
+ const resolvedHandler = resolveCommandDefinitionRunHandler(definition, normalizedCommand);
4210
4258
  if (typeof resolvedHandler !== "function") {
4211
- const trace = registerCommandTrace("definition", normalizedCommand, "{ name: string; run: (context) => unknown; }", commandOrDefinition, "Define command definition.run as a function.");
4259
+ const trace = registerCommandTrace("definition", normalizedCommand, "{ name: string; run: (context) => unknown; }", definition, "Define command definition.run as a function.");
4212
4260
  throw createRegistrationValidationError(`registerCommand requires a command definition run handler (command="${normalizedCommand}", registration_index=${trace.registration_index})`, trace);
4213
4261
  }
4214
4262
  try {
4215
- assertOptionalStringField("registerCommand definition.action", commandOrDefinition.action);
4216
- assertOptionalStringField("registerCommand definition.description", commandOrDefinition.description);
4217
- assertOptionalStringField("registerCommand definition.intent", commandOrDefinition.intent);
4218
- const action = resolveCommandDefinitionAction(normalizedCommand, commandOrDefinition.action);
4263
+ assertOptionalStringField("registerCommand definition.action", definition.action);
4264
+ assertOptionalStringField("registerCommand definition.description", definition.description);
4265
+ assertOptionalStringField("registerCommand definition.intent", definition.intent);
4266
+ const action = resolveCommandDefinitionAction(normalizedCommand, definition.action);
4219
4267
  if (!allowRegistration("commands.handler", "registerCommand", "commands", { command: normalizedCommand, action })) {
4220
4268
  return;
4221
4269
  }
4222
- const description = commandOrDefinition.description?.trim();
4223
- const intent = commandOrDefinition.intent?.trim();
4224
- const examples = normalizeOptionalStringArrayField("registerCommand definition.examples", commandOrDefinition.examples);
4225
- const failureHints = normalizeOptionalStringArrayField("registerCommand definition.failure_hints", commandOrDefinition.failure_hints);
4226
- const argumentsDefinition = normalizeCommandDefinitionArguments(commandOrDefinition.arguments);
4227
- if (commandOrDefinition.flags !== void 0) {
4270
+ const description = definition.description?.trim();
4271
+ const intent = definition.intent?.trim();
4272
+ const examples = normalizeOptionalStringArrayField("registerCommand definition.examples", definition.examples);
4273
+ const failureHints = normalizeOptionalStringArrayField("registerCommand definition.failure_hints", definition.failure_hints);
4274
+ const argumentsDefinition = normalizeCommandDefinitionArguments(definition.arguments);
4275
+ if (definition.flags !== void 0) {
4228
4276
  assertExtensionCapability(extension, "schema", "registerCommand flags");
4229
- validateFlagDefinitions(commandOrDefinition.flags);
4277
+ validateFlagDefinitions(definition.flags);
4230
4278
  registrations.flags.push({
4231
4279
  layer: extension.layer,
4232
4280
  name: extension.name,
4233
4281
  target_command: normalizedCommand,
4234
- flags: normalizeRegistrationRecordList("registerCommand definition.flags", commandOrDefinition.flags)
4282
+ flags: normalizeRegistrationRecordList("registerCommand definition.flags", definition.flags)
4235
4283
  });
4236
4284
  }
4237
4285
  const registration = {
@@ -4253,7 +4301,7 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
4253
4301
  registrations.commands.push(registration);
4254
4302
  } catch (error) {
4255
4303
  const reason = formatUnknownError(error);
4256
- const trace = registerCommandTrace("definition", normalizedCommand, "{ name: string; run: (context) => unknown; action?: string; arguments?: object[]; flags?: object[]; }", commandOrDefinition, "Use schema-style metadata (action/arguments/flags/examples/intent) with valid values.");
4304
+ const trace = registerCommandTrace("definition", normalizedCommand, "{ name: string; run: (context) => unknown; action?: string; arguments?: object[]; flags?: object[]; }", definition, "Use schema-style metadata (action/arguments/flags/examples/intent) with valid values.");
4257
4305
  throw createRegistrationValidationError(`registerCommand definition metadata invalid (command="${normalizedCommand}", registration_index=${trace.registration_index}): ${reason}`, trace);
4258
4306
  }
4259
4307
  commands.handlers.push({
@@ -4263,6 +4311,14 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
4263
4311
  run: resolvedHandler
4264
4312
  });
4265
4313
  };
4314
+ const registerCommand = (commandOrDefinition, override) => {
4315
+ assertExtensionCapability(extension, "commands", "registerCommand");
4316
+ if (typeof commandOrDefinition === "string") {
4317
+ registerCommandOverride(commandOrDefinition, override);
4318
+ return;
4319
+ }
4320
+ registerCommandDefinition(commandOrDefinition);
4321
+ };
4266
4322
  const registerParser = (command, override) => {
4267
4323
  assertExtensionCapability(extension, "parser", "registerParser");
4268
4324
  if (!allowRegistration("parser.override", "registerParser", "parser")) {
@@ -5157,7 +5213,7 @@ import path6 from "node:path";
5157
5213
  !(function() {
5158
5214
  try {
5159
5215
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5160
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d3baeeb6-0912-515f-95c1-735d3849fed4");
5216
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2e0d9a45-3807-55dd-9071-2b4f4ef9207a");
5161
5217
  } catch (e2) {
5162
5218
  }
5163
5219
  })();
@@ -5232,40 +5288,47 @@ function normalizeRuntimeWorkflow(workflow) {
5232
5288
  canceled_status: normalizeStatusId(workflow?.canceled_status)
5233
5289
  };
5234
5290
  }
5291
+ function appendTypeWorkflowPair(record, pair) {
5292
+ if (!Array.isArray(pair) || pair.length !== 2) {
5293
+ return;
5294
+ }
5295
+ const from = normalizeStatusToken(pair[0]);
5296
+ const to = normalizeStatusToken(pair[1]);
5297
+ if (from.length === 0 || to.length === 0) {
5298
+ return;
5299
+ }
5300
+ if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {
5301
+ return;
5302
+ }
5303
+ record.pairs.push([from, to]);
5304
+ }
5305
+ function normalizedTypeWorkflowEntry(entry) {
5306
+ const rawType = typeof entry?.type === "string" ? entry.type.trim() : "";
5307
+ if (rawType.length === 0 || !Array.isArray(entry?.allowed_transitions)) {
5308
+ return null;
5309
+ }
5310
+ const record = { type: rawType, pairs: [], denyAll: entry.allowed_transitions.length === 0 };
5311
+ for (const pair of entry.allowed_transitions) {
5312
+ appendTypeWorkflowPair(record, pair);
5313
+ }
5314
+ return { typeKey: rawType.toLowerCase(), record };
5315
+ }
5235
5316
  function normalizeTypeWorkflowDefinitions(workflows) {
5236
5317
  if (!Array.isArray(workflows) || workflows.length === 0) {
5237
5318
  return void 0;
5238
5319
  }
5239
5320
  const byTypeKey = /* @__PURE__ */ new Map();
5240
5321
  for (const entry of workflows) {
5241
- const rawType = typeof entry?.type === "string" ? entry.type.trim() : "";
5242
- if (rawType.length === 0) {
5243
- continue;
5244
- }
5245
- if (!Array.isArray(entry?.allowed_transitions)) {
5322
+ const normalized2 = normalizedTypeWorkflowEntry(entry);
5323
+ if (normalized2 === null) {
5246
5324
  continue;
5247
5325
  }
5248
- const typeKey = rawType.toLowerCase();
5249
- const pairs = entry.allowed_transitions;
5250
- const record = byTypeKey.get(typeKey) ?? { type: rawType, pairs: [], denyAll: false };
5251
- if (pairs.length === 0) {
5252
- record.denyAll = true;
5253
- }
5254
- for (const pair of pairs) {
5255
- if (!Array.isArray(pair) || pair.length !== 2) {
5256
- continue;
5257
- }
5258
- const from = normalizeStatusToken(pair[0]);
5259
- const to = normalizeStatusToken(pair[1]);
5260
- if (from.length === 0 || to.length === 0) {
5261
- continue;
5262
- }
5263
- if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {
5264
- continue;
5265
- }
5266
- record.pairs.push([from, to]);
5326
+ const record = byTypeKey.get(normalized2.typeKey) ?? normalized2.record;
5327
+ record.denyAll ||= normalized2.record.denyAll;
5328
+ for (const pair of normalized2.record.pairs) {
5329
+ appendTypeWorkflowPair(record, pair);
5267
5330
  }
5268
- byTypeKey.set(typeKey, record);
5331
+ byTypeKey.set(normalized2.typeKey, record);
5269
5332
  }
5270
5333
  const normalized = [];
5271
5334
  for (const record of byTypeKey.values()) {
@@ -6407,7 +6470,7 @@ function clearSettingsReadCache(pmRoot) {
6407
6470
  !(function() {
6408
6471
  try {
6409
6472
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
6410
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "76965ca9-e890-5aa2-a7ca-22f8d179dd5c");
6473
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4232868d-1e9d-51a3-abbe-3d9a3d1acae1");
6411
6474
  } catch (e2) {
6412
6475
  }
6413
6476
  })();
@@ -6811,29 +6874,31 @@ function normalizePmMaxVersionExceededModeSetting(value) {
6811
6874
  }
6812
6875
  return void 0;
6813
6876
  }
6877
+ function normalizeExtensionPolicyList(policy, key) {
6878
+ return normalizeLowerStringList(policy?.[key] ?? SETTINGS_DEFAULTS.extensions.policy[key]);
6879
+ }
6814
6880
  function normalizeExtensionPolicySettings(policy) {
6815
- const defaults = SETTINGS_DEFAULTS.extensions.policy;
6816
6881
  const pmMaxVersionExceededMode2 = normalizePmMaxVersionExceededModeSetting(policy?.pm_max_version_exceeded_mode);
6817
6882
  return {
6818
6883
  mode: normalizeExtensionPolicyMode(policy?.mode),
6819
6884
  trust_mode: normalizeExtensionTrustMode(policy?.trust_mode),
6820
6885
  ...pmMaxVersionExceededMode2 !== void 0 ? { pm_max_version_exceeded_mode: pmMaxVersionExceededMode2 } : {},
6821
6886
  require_provenance: policy?.require_provenance === true,
6822
- trusted_extensions: normalizeLowerStringList(policy?.trusted_extensions ?? defaults.trusted_extensions),
6887
+ trusted_extensions: normalizeExtensionPolicyList(policy, "trusted_extensions"),
6823
6888
  default_sandbox_profile: normalizeExtensionSandboxProfile(policy?.default_sandbox_profile),
6824
- allowed_extensions: normalizeLowerStringList(policy?.allowed_extensions ?? defaults.allowed_extensions),
6825
- blocked_extensions: normalizeLowerStringList(policy?.blocked_extensions ?? defaults.blocked_extensions),
6826
- allowed_capabilities: normalizeLowerStringList(policy?.allowed_capabilities ?? defaults.allowed_capabilities),
6827
- blocked_capabilities: normalizeLowerStringList(policy?.blocked_capabilities ?? defaults.blocked_capabilities),
6828
- allowed_surfaces: normalizeLowerStringList(policy?.allowed_surfaces ?? defaults.allowed_surfaces),
6829
- blocked_surfaces: normalizeLowerStringList(policy?.blocked_surfaces ?? defaults.blocked_surfaces),
6830
- allowed_commands: normalizeLowerStringList(policy?.allowed_commands ?? defaults.allowed_commands),
6831
- blocked_commands: normalizeLowerStringList(policy?.blocked_commands ?? defaults.blocked_commands),
6832
- allowed_actions: normalizeLowerStringList(policy?.allowed_actions ?? defaults.allowed_actions),
6833
- blocked_actions: normalizeLowerStringList(policy?.blocked_actions ?? defaults.blocked_actions),
6834
- allowed_services: normalizeLowerStringList(policy?.allowed_services ?? defaults.allowed_services),
6835
- blocked_services: normalizeLowerStringList(policy?.blocked_services ?? defaults.blocked_services),
6836
- extension_overrides: normalizeExtensionPolicyOverrides(policy?.extension_overrides ?? defaults.extension_overrides)
6889
+ allowed_extensions: normalizeExtensionPolicyList(policy, "allowed_extensions"),
6890
+ blocked_extensions: normalizeExtensionPolicyList(policy, "blocked_extensions"),
6891
+ allowed_capabilities: normalizeExtensionPolicyList(policy, "allowed_capabilities"),
6892
+ blocked_capabilities: normalizeExtensionPolicyList(policy, "blocked_capabilities"),
6893
+ allowed_surfaces: normalizeExtensionPolicyList(policy, "allowed_surfaces"),
6894
+ blocked_surfaces: normalizeExtensionPolicyList(policy, "blocked_surfaces"),
6895
+ allowed_commands: normalizeExtensionPolicyList(policy, "allowed_commands"),
6896
+ blocked_commands: normalizeExtensionPolicyList(policy, "blocked_commands"),
6897
+ allowed_actions: normalizeExtensionPolicyList(policy, "allowed_actions"),
6898
+ blocked_actions: normalizeExtensionPolicyList(policy, "blocked_actions"),
6899
+ allowed_services: normalizeExtensionPolicyList(policy, "allowed_services"),
6900
+ blocked_services: normalizeExtensionPolicyList(policy, "blocked_services"),
6901
+ extension_overrides: normalizeExtensionPolicyOverrides(policy?.extension_overrides ?? SETTINGS_DEFAULTS.extensions.policy.extension_overrides)
6837
6902
  };
6838
6903
  }
6839
6904
  function normalizeValidationMetadataRequiredFields(values) {
@@ -6862,6 +6927,81 @@ function recordOrEmpty(value) {
6862
6927
  function arrayOrEmpty(value) {
6863
6928
  return Array.isArray(value) ? value : [];
6864
6929
  }
6930
+ function buildValidationSettings(settings, defaults, governance) {
6931
+ return {
6932
+ ...defaults.validation,
6933
+ ...settings.validation,
6934
+ parent_reference: governance.parent_reference,
6935
+ metadata_profile: governance.metadata_profile,
6936
+ metadata_required_fields: normalizeValidationMetadataRequiredFields(settings.validation?.metadata_required_fields),
6937
+ lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_stale_blocker_reason_patterns ?? defaults.validation.lifecycle_stale_blocker_reason_patterns),
6938
+ lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? defaults.validation.lifecycle_closure_like_blocked_reason_patterns),
6939
+ lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_resolution_patterns ?? defaults.validation.lifecycle_closure_like_resolution_patterns),
6940
+ lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_actual_result_patterns ?? defaults.validation.lifecycle_closure_like_actual_result_patterns),
6941
+ estimate_defaults_by_type: normalizeEstimateDefaultOverrides(settings.validation?.estimate_defaults_by_type)
6942
+ };
6943
+ }
6944
+ function buildTelemetrySettings(settings, defaults) {
6945
+ return {
6946
+ enabled: settings.telemetry?.enabled ?? defaults.telemetry.enabled,
6947
+ first_run_prompt_completed: settings.telemetry?.first_run_prompt_completed ?? defaults.telemetry.first_run_prompt_completed,
6948
+ capture_level: settings.telemetry?.capture_level ?? defaults.telemetry.capture_level,
6949
+ endpoint: settings.telemetry?.endpoint ?? defaults.telemetry.endpoint,
6950
+ installation_id: settings.telemetry?.installation_id ?? defaults.telemetry.installation_id,
6951
+ retention_days: settings.telemetry?.retention_days ?? defaults.telemetry.retention_days
6952
+ };
6953
+ }
6954
+ function buildSearchSettings(settings, defaults) {
6955
+ return {
6956
+ ...defaults.search,
6957
+ ...settings.search,
6958
+ mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(settings.search?.mutation_refresh_policy),
6959
+ query_expansion: {
6960
+ ...defaults.search.query_expansion,
6961
+ ...settings.search?.query_expansion,
6962
+ enabled: normalizeSearchQueryExpansionEnabled(settings.search?.query_expansion?.enabled),
6963
+ provider: normalizeSearchQueryExpansionProvider(settings.search?.query_expansion?.provider)
6964
+ },
6965
+ rerank: {
6966
+ ...defaults.search.rerank,
6967
+ ...settings.search?.rerank,
6968
+ enabled: normalizeSearchRerankEnabled(settings.search?.rerank?.enabled),
6969
+ model: normalizeSearchRerankModel(settings.search?.rerank?.model),
6970
+ top_k: normalizeSearchRerankTopK(settings.search?.rerank?.top_k)
6971
+ }
6972
+ };
6973
+ }
6974
+ function buildVectorStoreSettings(settings, defaults) {
6975
+ return {
6976
+ adapter: settings.vector_store.adapter ?? defaults.vector_store.adapter,
6977
+ collection_name: normalizeVectorStoreCollectionName(settings.vector_store.collection_name),
6978
+ qdrant: { ...defaults.vector_store.qdrant, ...settings.vector_store.qdrant },
6979
+ lancedb: { ...defaults.vector_store.lancedb, ...settings.vector_store.lancedb }
6980
+ };
6981
+ }
6982
+ function normalizeSettingsItemFormat(settings, defaults) {
6983
+ if (settings.item_format === "json_markdown") {
6984
+ return "toon";
6985
+ }
6986
+ return settings.item_format ?? defaults.item_format;
6987
+ }
6988
+ function buildContextSettings(settings, defaults) {
6989
+ return {
6990
+ default_depth: settings.context?.default_depth ?? defaults.context.default_depth,
6991
+ activity_limit: settings.context?.activity_limit ?? defaults.context.activity_limit,
6992
+ stale_threshold_days: settings.context?.stale_threshold_days ?? defaults.context.stale_threshold_days,
6993
+ sections: {
6994
+ ...defaults.context.sections,
6995
+ ...settings.context?.sections
6996
+ }
6997
+ };
6998
+ }
6999
+ function buildProviderSettings(settings, defaults) {
7000
+ return {
7001
+ openai: { ...defaults.providers.openai, ...settings.providers.openai },
7002
+ ollama: { ...defaults.providers.ollama, ...settings.providers.ollama }
7003
+ };
7004
+ }
6865
7005
  function normalizeItemTypeDefinitions(definitions) {
6866
7006
  const normalized = (definitions ?? []).map((definition) => normalizeItemTypeDefinition(definition)).filter((definition) => definition !== null);
6867
7007
  const dedupedByName = /* @__PURE__ */ new Map();
@@ -6878,7 +7018,7 @@ function mergeSettings(settings) {
6878
7018
  return {
6879
7019
  ...defaults,
6880
7020
  ...settings,
6881
- item_format: settings.item_format === "json_markdown" ? "toon" : settings.item_format ?? defaults.item_format,
7021
+ item_format: normalizeSettingsItemFormat(settings, defaults),
6882
7022
  locks: { ...defaults.locks, ...settings.locks },
6883
7023
  checkpoints: { ...defaults.checkpoints, ...settings.checkpoints },
6884
7024
  output: { ...defaults.output, ...settings.output },
@@ -6890,18 +7030,7 @@ function mergeSettings(settings) {
6890
7030
  ...settings.history?.compact_policy
6891
7031
  }
6892
7032
  },
6893
- validation: {
6894
- ...defaults.validation,
6895
- ...settings.validation,
6896
- parent_reference: governance.parent_reference,
6897
- metadata_profile: governance.metadata_profile,
6898
- metadata_required_fields: normalizeValidationMetadataRequiredFields(settings.validation?.metadata_required_fields),
6899
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_stale_blocker_reason_patterns ?? defaults.validation.lifecycle_stale_blocker_reason_patterns),
6900
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? defaults.validation.lifecycle_closure_like_blocked_reason_patterns),
6901
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_resolution_patterns ?? defaults.validation.lifecycle_closure_like_resolution_patterns),
6902
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_actual_result_patterns ?? defaults.validation.lifecycle_closure_like_actual_result_patterns),
6903
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(settings.validation?.estimate_defaults_by_type)
6904
- },
7033
+ validation: buildValidationSettings(settings, defaults, governance),
6905
7034
  governance,
6906
7035
  workflow: {
6907
7036
  definition_of_done: [...settings.workflow?.definition_of_done ?? defaults.workflow.definition_of_done]
@@ -6909,177 +7038,24 @@ function mergeSettings(settings) {
6909
7038
  testing: {
6910
7039
  record_results_to_items: settings.testing?.record_results_to_items ?? defaults.testing.record_results_to_items
6911
7040
  },
6912
- telemetry: {
6913
- enabled: settings.telemetry?.enabled ?? defaults.telemetry.enabled,
6914
- first_run_prompt_completed: settings.telemetry?.first_run_prompt_completed ?? defaults.telemetry.first_run_prompt_completed,
6915
- capture_level: settings.telemetry?.capture_level ?? defaults.telemetry.capture_level,
6916
- endpoint: settings.telemetry?.endpoint ?? defaults.telemetry.endpoint,
6917
- installation_id: settings.telemetry?.installation_id ?? defaults.telemetry.installation_id,
6918
- retention_days: settings.telemetry?.retention_days ?? defaults.telemetry.retention_days
6919
- },
7041
+ telemetry: buildTelemetrySettings(settings, defaults),
6920
7042
  agent_guidance: normalizeAgentGuidanceSettings(settings.agent_guidance ?? defaults.agent_guidance),
6921
7043
  item_types: {
6922
7044
  definitions: normalizeItemTypeDefinitions(settings.item_types?.definitions)
6923
7045
  },
6924
7046
  schema: normalizeRuntimeSchemaSettings(settings.schema ?? defaults.schema),
6925
- context: {
6926
- default_depth: settings.context?.default_depth ?? defaults.context.default_depth,
6927
- activity_limit: settings.context?.activity_limit ?? defaults.context.activity_limit,
6928
- stale_threshold_days: settings.context?.stale_threshold_days ?? defaults.context.stale_threshold_days,
6929
- sections: {
6930
- ...defaults.context.sections,
6931
- ...settings.context?.sections
6932
- }
6933
- },
7047
+ context: buildContextSettings(settings, defaults),
6934
7048
  extensions: {
6935
7049
  enabled: [...settings.extensions.enabled],
6936
7050
  disabled: [...settings.extensions.disabled],
6937
7051
  policy: normalizeExtensionPolicySettings(settings.extensions.policy ?? defaults.extensions.policy)
6938
7052
  },
6939
- search: {
6940
- ...defaults.search,
6941
- ...settings.search,
6942
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(settings.search?.mutation_refresh_policy),
6943
- query_expansion: {
6944
- ...defaults.search.query_expansion,
6945
- ...settings.search?.query_expansion,
6946
- enabled: normalizeSearchQueryExpansionEnabled(settings.search?.query_expansion?.enabled),
6947
- provider: normalizeSearchQueryExpansionProvider(settings.search?.query_expansion?.provider)
6948
- },
6949
- rerank: {
6950
- ...defaults.search.rerank,
6951
- ...settings.search?.rerank,
6952
- enabled: normalizeSearchRerankEnabled(settings.search?.rerank?.enabled),
6953
- model: normalizeSearchRerankModel(settings.search?.rerank?.model),
6954
- top_k: normalizeSearchRerankTopK(settings.search?.rerank?.top_k)
6955
- }
6956
- },
6957
- providers: {
6958
- openai: { ...defaults.providers.openai, ...settings.providers.openai },
6959
- ollama: { ...defaults.providers.ollama, ...settings.providers.ollama }
6960
- },
6961
- vector_store: {
6962
- adapter: settings.vector_store.adapter ?? defaults.vector_store.adapter,
6963
- collection_name: normalizeVectorStoreCollectionName(settings.vector_store.collection_name),
6964
- qdrant: { ...defaults.vector_store.qdrant, ...settings.vector_store.qdrant },
6965
- lancedb: { ...defaults.vector_store.lancedb, ...settings.vector_store.lancedb }
6966
- }
7053
+ search: buildSearchSettings(settings, defaults),
7054
+ providers: buildProviderSettings(settings, defaults),
7055
+ vector_store: buildVectorStoreSettings(settings, defaults)
6967
7056
  };
6968
7057
  }
6969
- function serializeSettings(settings, options = {}) {
6970
- const baseSettings = {
6971
- ...settings,
6972
- locks: valueOrDefault(settings.locks, SETTINGS_DEFAULTS.locks),
6973
- checkpoints: valueOrDefault(settings.checkpoints, SETTINGS_DEFAULTS.checkpoints),
6974
- output: valueOrDefault(settings.output, SETTINGS_DEFAULTS.output),
6975
- history: valueOrDefault(settings.history, SETTINGS_DEFAULTS.history),
6976
- validation: valueOrDefault(settings.validation, SETTINGS_DEFAULTS.validation),
6977
- workflow: valueOrDefault(settings.workflow, SETTINGS_DEFAULTS.workflow),
6978
- testing: valueOrDefault(settings.testing, SETTINGS_DEFAULTS.testing),
6979
- telemetry: valueOrDefault(settings.telemetry, SETTINGS_DEFAULTS.telemetry),
6980
- agent_guidance: valueOrDefault(settings.agent_guidance, SETTINGS_DEFAULTS.agent_guidance),
6981
- item_types: valueOrDefault(settings.item_types, SETTINGS_DEFAULTS.item_types),
6982
- schema: valueOrDefault(settings.schema, SETTINGS_DEFAULTS.schema),
6983
- context: valueOrDefault(settings.context, SETTINGS_DEFAULTS.context),
6984
- extensions: valueOrDefault(settings.extensions, SETTINGS_DEFAULTS.extensions),
6985
- search: valueOrDefault(settings.search, SETTINGS_DEFAULTS.search),
6986
- providers: valueOrDefault(settings.providers, SETTINGS_DEFAULTS.providers),
6987
- vector_store: valueOrDefault(settings.vector_store, SETTINGS_DEFAULTS.vector_store)
6988
- };
6989
- const governance = resolveGovernanceKnobs(baseSettings);
6990
- const normalizedSchema = normalizeRuntimeSchemaSettings(baseSettings.schema);
6991
- const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(baseSettings, options.persist_source);
6992
- const normalizedSettings = {
6993
- ...baseSettings,
6994
- item_format: "toon",
6995
- validation: {
6996
- ...baseSettings.validation,
6997
- parent_reference: governance.parent_reference,
6998
- metadata_profile: governance.metadata_profile,
6999
- metadata_required_fields: normalizeValidationMetadataRequiredFields(baseSettings.validation?.metadata_required_fields),
7000
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_stale_blocker_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_stale_blocker_reason_patterns),
7001
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_blocked_reason_patterns),
7002
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_resolution_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_resolution_patterns),
7003
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_actual_result_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_actual_result_patterns),
7004
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(baseSettings.validation?.estimate_defaults_by_type)
7005
- },
7006
- governance,
7007
- agent_guidance: normalizeAgentGuidanceSettings(baseSettings.agent_guidance),
7008
- item_types: {
7009
- definitions: persistedFileBackedSections.item_type_definitions
7010
- },
7011
- schema: {
7012
- ...normalizedSchema,
7013
- statuses: persistedFileBackedSections.schema_statuses,
7014
- fields: persistedFileBackedSections.schema_fields,
7015
- type_workflows: persistedFileBackedSections.schema_type_workflows
7016
- },
7017
- search: {
7018
- ...SETTINGS_DEFAULTS.search,
7019
- ...baseSettings.search,
7020
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(baseSettings.search?.mutation_refresh_policy),
7021
- query_expansion: {
7022
- ...SETTINGS_DEFAULTS.search.query_expansion,
7023
- ...baseSettings.search?.query_expansion,
7024
- enabled: normalizeSearchQueryExpansionEnabled(baseSettings.search?.query_expansion?.enabled),
7025
- provider: normalizeSearchQueryExpansionProvider(baseSettings.search?.query_expansion?.provider)
7026
- },
7027
- rerank: {
7028
- ...SETTINGS_DEFAULTS.search.rerank,
7029
- ...baseSettings.search?.rerank,
7030
- enabled: normalizeSearchRerankEnabled(baseSettings.search?.rerank?.enabled),
7031
- model: normalizeSearchRerankModel(baseSettings.search?.rerank?.model),
7032
- top_k: normalizeSearchRerankTopK(baseSettings.search?.rerank?.top_k)
7033
- }
7034
- },
7035
- context: {
7036
- default_depth: baseSettings.context?.default_depth ?? SETTINGS_DEFAULTS.context.default_depth,
7037
- activity_limit: baseSettings.context?.activity_limit ?? SETTINGS_DEFAULTS.context.activity_limit,
7038
- stale_threshold_days: baseSettings.context?.stale_threshold_days ?? SETTINGS_DEFAULTS.context.stale_threshold_days,
7039
- sections: {
7040
- ...SETTINGS_DEFAULTS.context.sections,
7041
- ...baseSettings.context?.sections
7042
- }
7043
- },
7044
- extensions: {
7045
- enabled: normalizeStringList2(baseSettings.extensions?.enabled),
7046
- disabled: normalizeStringList2(baseSettings.extensions?.disabled),
7047
- policy: normalizeExtensionPolicySettings(baseSettings.extensions?.policy)
7048
- },
7049
- vector_store: {
7050
- ...baseSettings.vector_store,
7051
- adapter: baseSettings.vector_store?.adapter ?? SETTINGS_DEFAULTS.vector_store.adapter,
7052
- collection_name: normalizeVectorStoreCollectionName(baseSettings.vector_store?.collection_name),
7053
- qdrant: { ...baseSettings.vector_store?.qdrant },
7054
- lancedb: { ...baseSettings.vector_store?.lancedb }
7055
- }
7056
- };
7057
- const ordered = orderObject({
7058
- ...normalizedSettings,
7059
- governance: normalizeGovernanceForPersist(governance)
7060
- }, [
7061
- "version",
7062
- "id_prefix",
7063
- "author_default",
7064
- "item_format",
7065
- "locks",
7066
- "checkpoints",
7067
- "output",
7068
- "history",
7069
- "validation",
7070
- "governance",
7071
- "workflow",
7072
- "testing",
7073
- "telemetry",
7074
- "agent_guidance",
7075
- "item_types",
7076
- "schema",
7077
- "context",
7078
- "extensions",
7079
- "search",
7080
- "providers",
7081
- "vector_store"
7082
- ]);
7058
+ function orderSerializedSettingsSections(ordered) {
7083
7059
  ordered.locks = orderObject(ordered.locks, ["ttl_seconds"]);
7084
7060
  ordered.checkpoints = orderObject(ordered.checkpoints, ["retention_days"]);
7085
7061
  ordered.output = orderObject(ordered.output, ["default_format"]);
@@ -7209,6 +7185,140 @@ function serializeSettings(settings, options = {}) {
7209
7185
  ]);
7210
7186
  ordered.vector_store.qdrant = orderObject(recordOrEmpty(ordered.vector_store.qdrant), ["url", "api_key"]);
7211
7187
  ordered.vector_store.lancedb = orderObject(recordOrEmpty(ordered.vector_store.lancedb), ["path"]);
7188
+ }
7189
+ function buildSerializeBaseSettings(settings) {
7190
+ return {
7191
+ ...settings,
7192
+ locks: valueOrDefault(settings.locks, SETTINGS_DEFAULTS.locks),
7193
+ checkpoints: valueOrDefault(settings.checkpoints, SETTINGS_DEFAULTS.checkpoints),
7194
+ output: valueOrDefault(settings.output, SETTINGS_DEFAULTS.output),
7195
+ history: valueOrDefault(settings.history, SETTINGS_DEFAULTS.history),
7196
+ validation: valueOrDefault(settings.validation, SETTINGS_DEFAULTS.validation),
7197
+ workflow: valueOrDefault(settings.workflow, SETTINGS_DEFAULTS.workflow),
7198
+ testing: valueOrDefault(settings.testing, SETTINGS_DEFAULTS.testing),
7199
+ telemetry: valueOrDefault(settings.telemetry, SETTINGS_DEFAULTS.telemetry),
7200
+ agent_guidance: valueOrDefault(settings.agent_guidance, SETTINGS_DEFAULTS.agent_guidance),
7201
+ item_types: valueOrDefault(settings.item_types, SETTINGS_DEFAULTS.item_types),
7202
+ schema: valueOrDefault(settings.schema, SETTINGS_DEFAULTS.schema),
7203
+ context: valueOrDefault(settings.context, SETTINGS_DEFAULTS.context),
7204
+ extensions: valueOrDefault(settings.extensions, SETTINGS_DEFAULTS.extensions),
7205
+ search: valueOrDefault(settings.search, SETTINGS_DEFAULTS.search),
7206
+ providers: valueOrDefault(settings.providers, SETTINGS_DEFAULTS.providers),
7207
+ vector_store: valueOrDefault(settings.vector_store, SETTINGS_DEFAULTS.vector_store)
7208
+ };
7209
+ }
7210
+ function buildSerializedValidationSettings(baseSettings, governance) {
7211
+ return {
7212
+ ...baseSettings.validation,
7213
+ parent_reference: governance.parent_reference,
7214
+ metadata_profile: governance.metadata_profile,
7215
+ metadata_required_fields: normalizeValidationMetadataRequiredFields(baseSettings.validation?.metadata_required_fields),
7216
+ lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_stale_blocker_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_stale_blocker_reason_patterns),
7217
+ lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_blocked_reason_patterns),
7218
+ lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_resolution_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_resolution_patterns),
7219
+ lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_actual_result_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_actual_result_patterns),
7220
+ estimate_defaults_by_type: normalizeEstimateDefaultOverrides(baseSettings.validation?.estimate_defaults_by_type)
7221
+ };
7222
+ }
7223
+ function buildSerializedSearchSettings(baseSettings) {
7224
+ return {
7225
+ ...SETTINGS_DEFAULTS.search,
7226
+ ...baseSettings.search,
7227
+ mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(baseSettings.search?.mutation_refresh_policy),
7228
+ query_expansion: {
7229
+ ...SETTINGS_DEFAULTS.search.query_expansion,
7230
+ ...baseSettings.search?.query_expansion,
7231
+ enabled: normalizeSearchQueryExpansionEnabled(baseSettings.search?.query_expansion?.enabled),
7232
+ provider: normalizeSearchQueryExpansionProvider(baseSettings.search?.query_expansion?.provider)
7233
+ },
7234
+ rerank: {
7235
+ ...SETTINGS_DEFAULTS.search.rerank,
7236
+ ...baseSettings.search?.rerank,
7237
+ enabled: normalizeSearchRerankEnabled(baseSettings.search?.rerank?.enabled),
7238
+ model: normalizeSearchRerankModel(baseSettings.search?.rerank?.model),
7239
+ top_k: normalizeSearchRerankTopK(baseSettings.search?.rerank?.top_k)
7240
+ }
7241
+ };
7242
+ }
7243
+ function buildSerializedContextSettings(baseSettings) {
7244
+ return {
7245
+ default_depth: baseSettings.context?.default_depth ?? SETTINGS_DEFAULTS.context.default_depth,
7246
+ activity_limit: baseSettings.context?.activity_limit ?? SETTINGS_DEFAULTS.context.activity_limit,
7247
+ stale_threshold_days: baseSettings.context?.stale_threshold_days ?? SETTINGS_DEFAULTS.context.stale_threshold_days,
7248
+ sections: {
7249
+ ...SETTINGS_DEFAULTS.context.sections,
7250
+ ...baseSettings.context?.sections
7251
+ }
7252
+ };
7253
+ }
7254
+ function buildSerializedVectorStoreSettings(baseSettings) {
7255
+ return {
7256
+ ...baseSettings.vector_store,
7257
+ adapter: baseSettings.vector_store?.adapter ?? SETTINGS_DEFAULTS.vector_store.adapter,
7258
+ collection_name: normalizeVectorStoreCollectionName(baseSettings.vector_store?.collection_name),
7259
+ qdrant: { ...baseSettings.vector_store?.qdrant },
7260
+ lancedb: { ...baseSettings.vector_store?.lancedb }
7261
+ };
7262
+ }
7263
+ function buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections) {
7264
+ return {
7265
+ ...baseSettings,
7266
+ item_format: "toon",
7267
+ validation: buildSerializedValidationSettings(baseSettings, governance),
7268
+ governance,
7269
+ agent_guidance: normalizeAgentGuidanceSettings(baseSettings.agent_guidance),
7270
+ item_types: {
7271
+ definitions: persistedFileBackedSections.item_type_definitions
7272
+ },
7273
+ schema: {
7274
+ ...normalizedSchema,
7275
+ statuses: persistedFileBackedSections.schema_statuses,
7276
+ fields: persistedFileBackedSections.schema_fields,
7277
+ type_workflows: persistedFileBackedSections.schema_type_workflows
7278
+ },
7279
+ search: buildSerializedSearchSettings(baseSettings),
7280
+ context: buildSerializedContextSettings(baseSettings),
7281
+ extensions: {
7282
+ enabled: normalizeStringList2(baseSettings.extensions?.enabled),
7283
+ disabled: normalizeStringList2(baseSettings.extensions?.disabled),
7284
+ policy: normalizeExtensionPolicySettings(baseSettings.extensions?.policy)
7285
+ },
7286
+ vector_store: buildSerializedVectorStoreSettings(baseSettings)
7287
+ };
7288
+ }
7289
+ function serializeSettings(settings, options = {}) {
7290
+ const baseSettings = buildSerializeBaseSettings(settings);
7291
+ const governance = resolveGovernanceKnobs(baseSettings);
7292
+ const normalizedSchema = normalizeRuntimeSchemaSettings(baseSettings.schema);
7293
+ const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(baseSettings, options.persist_source);
7294
+ const normalizedSettings = buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections);
7295
+ const ordered = orderObject({
7296
+ ...normalizedSettings,
7297
+ governance: normalizeGovernanceForPersist(governance)
7298
+ }, [
7299
+ "version",
7300
+ "id_prefix",
7301
+ "author_default",
7302
+ "item_format",
7303
+ "locks",
7304
+ "checkpoints",
7305
+ "output",
7306
+ "history",
7307
+ "validation",
7308
+ "governance",
7309
+ "workflow",
7310
+ "testing",
7311
+ "telemetry",
7312
+ "agent_guidance",
7313
+ "item_types",
7314
+ "schema",
7315
+ "context",
7316
+ "extensions",
7317
+ "search",
7318
+ "providers",
7319
+ "vector_store"
7320
+ ]);
7321
+ orderSerializedSettingsSections(ordered);
7212
7322
  return `${JSON.stringify(ordered, null, 2)}
7213
7323
  `;
7214
7324
  }
@@ -7470,4 +7580,4 @@ export {
7470
7580
  readSettings,
7471
7581
  writeSettings
7472
7582
  };
7473
- //# sourceMappingURL=chunk-SNUK7H5J.js.map
7583
+ //# sourceMappingURL=chunk-7NSPKJUS.js.map