@unbrained/pm-cli 2026.6.30 → 2026.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (628) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +26 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +58 -47
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/aggregate.js +102 -79
  9. package/dist/cli/commands/aggregate.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +339 -303
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/close-many.js +89 -68
  13. package/dist/cli/commands/close-many.js.map +1 -1
  14. package/dist/cli/commands/close.js +157 -129
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments-audit.js +50 -42
  17. package/dist/cli/commands/comments-audit.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +2 -0
  19. package/dist/cli/commands/config.js +443 -879
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.js +365 -287
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +352 -238
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +483 -434
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +46 -39
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/dedupe-merge.js +88 -69
  30. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  31. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  32. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +129 -78
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/managed-state.js +101 -57
  36. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  38. package/dist/cli/commands/extension/scaffold.js +214 -186
  39. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  40. package/dist/cli/commands/extension.d.ts +6 -1
  41. package/dist/cli/commands/extension.js +1034 -902
  42. package/dist/cli/commands/extension.js.map +1 -1
  43. package/dist/cli/commands/get.js +114 -81
  44. package/dist/cli/commands/get.js.map +1 -1
  45. package/dist/cli/commands/health.d.ts +17 -0
  46. package/dist/cli/commands/health.js +446 -307
  47. package/dist/cli/commands/health.js.map +1 -1
  48. package/dist/cli/commands/history-compact.js +209 -140
  49. package/dist/cli/commands/history-compact.js.map +1 -1
  50. package/dist/cli/commands/history-redact.js +162 -119
  51. package/dist/cli/commands/history-redact.js.map +1 -1
  52. package/dist/cli/commands/history-repair.js +120 -85
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts +8 -2
  55. package/dist/cli/commands/init.js +263 -162
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/list-filter-shared.js +55 -48
  58. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  59. package/dist/cli/commands/list.js +152 -102
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/next.js +49 -32
  62. package/dist/cli/commands/next.js.map +1 -1
  63. package/dist/cli/commands/plan.js +373 -298
  64. package/dist/cli/commands/plan.js.map +1 -1
  65. package/dist/cli/commands/recurrence-parsers.js +43 -25
  66. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  67. package/dist/cli/commands/reindex.d.ts +21 -5
  68. package/dist/cli/commands/reindex.js +345 -205
  69. package/dist/cli/commands/reindex.js.map +1 -1
  70. package/dist/cli/commands/restore.d.ts +8 -7
  71. package/dist/cli/commands/restore.js +105 -69
  72. package/dist/cli/commands/restore.js.map +1 -1
  73. package/dist/cli/commands/schema.js +33 -30
  74. package/dist/cli/commands/schema.js.map +1 -1
  75. package/dist/cli/commands/search.d.ts +10 -2
  76. package/dist/cli/commands/search.js +595 -536
  77. package/dist/cli/commands/search.js.map +1 -1
  78. package/dist/cli/commands/telemetry.js +98 -87
  79. package/dist/cli/commands/telemetry.js.map +1 -1
  80. package/dist/cli/commands/test-all.js +237 -168
  81. package/dist/cli/commands/test-all.js.map +1 -1
  82. package/dist/cli/commands/test.d.ts +6 -5
  83. package/dist/cli/commands/test.js +530 -464
  84. package/dist/cli/commands/test.js.map +1 -1
  85. package/dist/cli/commands/update-many.js +57 -42
  86. package/dist/cli/commands/update-many.js.map +1 -1
  87. package/dist/cli/commands/update.d.ts +1 -1
  88. package/dist/cli/commands/update.js +764 -747
  89. package/dist/cli/commands/update.js.map +1 -1
  90. package/dist/cli/commands/validate.d.ts +18 -1
  91. package/dist/cli/commands/validate.js +466 -343
  92. package/dist/cli/commands/validate.js.map +1 -1
  93. package/dist/cli/error-guidance.js +399 -357
  94. package/dist/cli/error-guidance.js.map +1 -1
  95. package/dist/cli/extension-command-options.js +48 -21
  96. package/dist/cli/extension-command-options.js.map +1 -1
  97. package/dist/cli/main.d.ts +47 -0
  98. package/dist/cli/main.js +428 -341
  99. package/dist/cli/main.js.map +1 -1
  100. package/dist/cli/migration-gates.js +22 -45
  101. package/dist/cli/migration-gates.js.map +1 -1
  102. package/dist/cli/register-list-query.js +94 -105
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +400 -416
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +86 -66
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +120 -101
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +117 -122
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
  113. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  114. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
  115. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
  117. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  118. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
  119. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
  120. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
  121. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
  125. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
  127. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
  129. package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
  132. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  133. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
  135. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
  137. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
  138. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
  140. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
  142. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
  144. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
  146. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
  148. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
  150. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
  152. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
  154. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
  156. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
  158. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
  160. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  162. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
  164. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
  165. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
  168. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
  169. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
  172. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
  173. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
  174. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
  178. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
  180. package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
  182. package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
  185. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
  187. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
  189. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
  192. package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
  196. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
  199. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
  200. package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
  202. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  203. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
  204. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
  206. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
  208. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
  211. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
  213. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
  214. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
  216. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
  218. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
  220. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
  222. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
  224. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
  225. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
  227. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
  229. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  230. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  231. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
  233. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
  235. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  236. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
  237. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
  239. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
  241. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
  243. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
  246. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
  248. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  249. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  250. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
  252. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
  253. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
  254. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
  255. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  256. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
  257. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  258. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
  259. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  260. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
  261. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
  262. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  263. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  265. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
  267. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
  268. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
  269. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
  271. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
  273. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
  274. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
  275. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  276. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
  277. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
  278. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
  279. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
  280. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
  281. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
  282. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
  283. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
  284. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
  285. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
  286. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
  287. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
  288. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
  289. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
  290. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
  291. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
  292. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
  293. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
  295. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  296. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
  297. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
  299. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  300. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  301. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
  302. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
  303. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  304. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
  305. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  306. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  307. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
  308. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
  309. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
  311. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  312. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
  313. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  314. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
  315. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
  316. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
  317. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
  318. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
  319. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
  321. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  322. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
  323. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
  324. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
  325. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  326. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
  327. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  328. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
  329. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
  330. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
  331. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  332. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
  333. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  334. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
  335. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
  337. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  338. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
  339. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
  341. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
  343. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
  345. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
  347. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  348. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  349. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  350. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
  351. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
  352. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
  353. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
  354. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
  355. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
  356. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
  357. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
  359. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
  361. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
  362. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  363. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  364. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  365. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  366. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
  367. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
  369. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  370. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  371. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
  372. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
  373. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
  374. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
  375. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
  377. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
  379. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
  381. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
  383. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  384. package/dist/cli-bundle/main.js +986 -1500
  385. package/dist/cli-bundle/main.js.map +4 -4
  386. package/dist/core/config/nested-settings.js +89 -67
  387. package/dist/core/config/nested-settings.js.map +1 -1
  388. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  389. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  390. package/dist/core/extensions/extension-policy.d.ts +18 -3
  391. package/dist/core/extensions/extension-policy.js +116 -106
  392. package/dist/core/extensions/extension-policy.js.map +1 -1
  393. package/dist/core/extensions/loader.js +310 -232
  394. package/dist/core/extensions/loader.js.map +1 -1
  395. package/dist/core/governance/metadata-coverage.js +20 -28
  396. package/dist/core/governance/metadata-coverage.js.map +1 -1
  397. package/dist/core/history/drift-scan.js +93 -81
  398. package/dist/core/history/drift-scan.js.map +1 -1
  399. package/dist/core/item/item-format.js +523 -410
  400. package/dist/core/item/item-format.js.map +1 -1
  401. package/dist/core/item/item-type-definition.js +14 -14
  402. package/dist/core/item/item-type-definition.js.map +1 -1
  403. package/dist/core/item/type-registry.js +87 -82
  404. package/dist/core/item/type-registry.js.map +1 -1
  405. package/dist/core/output/mutation-projection.js +42 -26
  406. package/dist/core/output/mutation-projection.js.map +1 -1
  407. package/dist/core/schema/runtime-schema.js +34 -28
  408. package/dist/core/schema/runtime-schema.js.map +1 -1
  409. package/dist/core/search/semantic-defaults.js +64 -37
  410. package/dist/core/search/semantic-defaults.js.map +1 -1
  411. package/dist/core/search/vector-stores.js +32 -17
  412. package/dist/core/search/vector-stores.js.map +1 -1
  413. package/dist/core/sentry/helpers.js +31 -28
  414. package/dist/core/sentry/helpers.js.map +1 -1
  415. package/dist/core/sentry/instrument.js +54 -43
  416. package/dist/core/sentry/instrument.js.map +1 -1
  417. package/dist/core/store/front-matter-cache.js +239 -153
  418. package/dist/core/store/front-matter-cache.js.map +1 -1
  419. package/dist/core/store/item-store.js +33 -26
  420. package/dist/core/store/item-store.js.map +1 -1
  421. package/dist/core/store/settings.js +247 -203
  422. package/dist/core/store/settings.js.map +1 -1
  423. package/dist/core/test/background-runs.js +189 -160
  424. package/dist/core/test/background-runs.js.map +1 -1
  425. package/dist/mcp/server.js +387 -367
  426. package/dist/mcp/server.js.map +1 -1
  427. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  428. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  429. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  430. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  431. package/dist/sdk/compose.d.ts +4 -1
  432. package/dist/sdk/compose.js +181 -115
  433. package/dist/sdk/compose.js.map +1 -1
  434. package/docs/RELEASING.md +2 -3
  435. package/package.json +2 -2
  436. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  437. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  438. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  439. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  440. package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  443. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  444. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  451. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  459. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  465. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
  471. package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  484. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  485. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  486. package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
  488. package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
  489. package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
  490. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  491. package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
  492. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  493. package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
  494. package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
  495. package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
  496. package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
  497. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
  498. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
  499. package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
  500. package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
  501. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  502. package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
  503. package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
  504. package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
  505. package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
  506. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  507. package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
  508. package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
  509. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  510. package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
  512. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  513. package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
  514. package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
  515. package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
  516. package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
  517. package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
  518. package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
  522. package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
  523. package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
  524. package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
  525. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  526. package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
  527. package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
  529. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
  531. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
  533. package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
  534. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  535. package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
  536. package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
  537. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  // dist/core/fs/fs-utils.js
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b452df4b-661b-5f08-9d20-dff37c4bfb2f")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a360c40f-2d95-561b-8d26-69af3a10c107")}catch(e){}}();
4
4
  import * as fs from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import crypto from "node:crypto";
@@ -787,6 +787,13 @@ function normalizeItemTypeCommandOptionPolicies(policies, resolvePolicyCommand)
787
787
  }
788
788
  return [...dedupedByKey.values()].sort((left, right) => left.command === right.command ? left.option.localeCompare(right.option) : left.command.localeCompare(right.command));
789
789
  }
790
+ function normalizeOptionalStringList(values, preservePresence) {
791
+ return preservePresence ? normalizeItemTypeStringList(values) : void 0;
792
+ }
793
+ function optionalNonEmptyString(value) {
794
+ const normalized = value?.trim();
795
+ return normalized && normalized.length > 0 ? normalized : void 0;
796
+ }
790
797
  function normalizeItemTypeDefinition(definition, options = {}) {
791
798
  const resolvePolicyCommand = options.resolvePolicyCommand ?? keepPolicyCommand;
792
799
  const name = definition.name.trim();
@@ -797,20 +804,17 @@ function normalizeItemTypeDefinition(definition, options = {}) {
797
804
  const hasRequiredCreateRepeatables = definition.required_create_repeatables !== void 0;
798
805
  const hasOptions = definition.options !== void 0;
799
806
  const hasCommandOptionPolicies = definition.command_option_policies !== void 0;
800
- const folder = definition.folder?.trim();
801
- const description = definition.description?.trim();
802
- const defaultStatus = definition.default_status?.trim();
803
807
  const aliases = normalizeItemTypeStringList(definition.aliases);
804
808
  const normalizedOptions = (definition.options ?? []).map((option) => normalizeItemTypeOption(option)).filter((option) => option !== null).sort((left, right) => left.key.localeCompare(right.key));
805
809
  const commandOptionPolicies = normalizeItemTypeCommandOptionPolicies(definition.command_option_policies, resolvePolicyCommand);
806
810
  return {
807
811
  name,
808
- description: description && description.length > 0 ? description : void 0,
809
- default_status: defaultStatus && defaultStatus.length > 0 ? defaultStatus : void 0,
810
- folder: folder && folder.length > 0 ? folder : void 0,
812
+ description: optionalNonEmptyString(definition.description),
813
+ default_status: optionalNonEmptyString(definition.default_status),
814
+ folder: optionalNonEmptyString(definition.folder),
811
815
  aliases: aliases.length > 0 ? aliases : void 0,
812
- required_create_fields: hasRequiredCreateFields ? normalizeItemTypeStringList(definition.required_create_fields) : void 0,
813
- required_create_repeatables: hasRequiredCreateRepeatables ? normalizeItemTypeStringList(definition.required_create_repeatables) : void 0,
816
+ required_create_fields: normalizeOptionalStringList(definition.required_create_fields, hasRequiredCreateFields),
817
+ required_create_repeatables: normalizeOptionalStringList(definition.required_create_repeatables, hasRequiredCreateRepeatables),
814
818
  options: hasOptions ? normalizedOptions : void 0,
815
819
  command_option_policies: hasCommandOptionPolicies ? commandOptionPolicies : void 0
816
820
  };
@@ -1125,6 +1129,58 @@ function toSlugToken(value) {
1125
1129
  function normalizeTypeDefinition(definition) {
1126
1130
  return normalizeItemTypeDefinition(definition, { resolvePolicyCommand: strictPolicyCommand });
1127
1131
  }
1132
+ function readStringArray(record, key) {
1133
+ const value = record[key];
1134
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
1135
+ }
1136
+ function coerceOptionDefinitionFromUnknown(raw) {
1137
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
1138
+ return null;
1139
+ }
1140
+ const optionRecord = raw;
1141
+ if (typeof optionRecord.key !== "string") {
1142
+ return null;
1143
+ }
1144
+ return {
1145
+ key: optionRecord.key,
1146
+ values: readStringArray(optionRecord, "values") ?? [],
1147
+ required: optionRecord.required === void 0 ? void 0 : Boolean(optionRecord.required),
1148
+ aliases: readStringArray(optionRecord, "aliases"),
1149
+ description: typeof optionRecord.description === "string" ? optionRecord.description : void 0
1150
+ };
1151
+ }
1152
+ function coerceCommandOptionPolicyFromUnknown(raw) {
1153
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
1154
+ return null;
1155
+ }
1156
+ const policyRecord = raw;
1157
+ if (typeof policyRecord.command !== "string" || typeof policyRecord.option !== "string") {
1158
+ return null;
1159
+ }
1160
+ const normalizedCommand = policyRecord.command.trim().toLowerCase();
1161
+ if (normalizedCommand !== "create" && normalizedCommand !== "update") {
1162
+ return null;
1163
+ }
1164
+ return {
1165
+ command: normalizedCommand,
1166
+ option: policyRecord.option,
1167
+ required: policyRecord.required === void 0 ? void 0 : Boolean(policyRecord.required),
1168
+ visible: policyRecord.visible === void 0 ? void 0 : Boolean(policyRecord.visible),
1169
+ enabled: policyRecord.enabled === void 0 ? void 0 : Boolean(policyRecord.enabled)
1170
+ };
1171
+ }
1172
+ function coerceOptionDefinitionsFromRecord(record) {
1173
+ if (!Array.isArray(record.options)) {
1174
+ return void 0;
1175
+ }
1176
+ return record.options.map((entry) => coerceOptionDefinitionFromUnknown(entry)).filter((entry) => entry !== null);
1177
+ }
1178
+ function coerceCommandOptionPoliciesFromRecord(record) {
1179
+ if (!Array.isArray(record.command_option_policies)) {
1180
+ return void 0;
1181
+ }
1182
+ return record.command_option_policies.map((entry) => coerceCommandOptionPolicyFromUnknown(entry)).filter((entry) => entry !== null);
1183
+ }
1128
1184
  function coerceTypeDefinitionFromUnknown(raw) {
1129
1185
  if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
1130
1186
  return null;
@@ -1137,65 +1193,30 @@ function coerceTypeDefinitionFromUnknown(raw) {
1137
1193
  const folder = typeof record.folder === "string" ? record.folder : void 0;
1138
1194
  const description = typeof record.description === "string" ? record.description : void 0;
1139
1195
  const defaultStatus = typeof record.default_status === "string" ? record.default_status : void 0;
1140
- const aliases = Array.isArray(record.aliases) ? record.aliases.filter((value) => typeof value === "string") : void 0;
1141
- const requiredCreateFields = Array.isArray(record.required_create_fields) ? record.required_create_fields.filter((value) => typeof value === "string") : void 0;
1142
- const requiredCreateRepeatables = Array.isArray(record.required_create_repeatables) ? record.required_create_repeatables.filter((value) => typeof value === "string") : void 0;
1143
- let options;
1144
- if (Array.isArray(record.options)) {
1145
- options = [];
1146
- for (const entry of record.options) {
1147
- if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
1148
- continue;
1149
- }
1150
- const optionRecord = entry;
1151
- if (typeof optionRecord.key !== "string") {
1152
- continue;
1153
- }
1154
- options.push({
1155
- key: optionRecord.key,
1156
- values: Array.isArray(optionRecord.values) ? optionRecord.values.filter((value) => typeof value === "string") : [],
1157
- required: optionRecord.required === void 0 ? void 0 : Boolean(optionRecord.required),
1158
- aliases: Array.isArray(optionRecord.aliases) ? optionRecord.aliases.filter((value) => typeof value === "string") : void 0,
1159
- description: typeof optionRecord.description === "string" ? optionRecord.description : void 0
1160
- });
1161
- }
1162
- }
1163
- let commandOptionPolicies;
1164
- if (Array.isArray(record.command_option_policies)) {
1165
- commandOptionPolicies = [];
1166
- for (const entry of record.command_option_policies) {
1167
- if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
1168
- continue;
1169
- }
1170
- const policyRecord = entry;
1171
- if (typeof policyRecord.command !== "string" || typeof policyRecord.option !== "string") {
1172
- continue;
1173
- }
1174
- const normalizedCommand = policyRecord.command.trim().toLowerCase();
1175
- if (normalizedCommand !== "create" && normalizedCommand !== "update") {
1176
- continue;
1177
- }
1178
- commandOptionPolicies.push({
1179
- command: normalizedCommand,
1180
- option: policyRecord.option,
1181
- required: policyRecord.required === void 0 ? void 0 : Boolean(policyRecord.required),
1182
- visible: policyRecord.visible === void 0 ? void 0 : Boolean(policyRecord.visible),
1183
- enabled: policyRecord.enabled === void 0 ? void 0 : Boolean(policyRecord.enabled)
1184
- });
1185
- }
1186
- }
1187
1196
  return {
1188
1197
  name,
1189
1198
  description,
1190
1199
  default_status: defaultStatus,
1191
1200
  folder,
1192
- aliases,
1193
- required_create_fields: requiredCreateFields,
1194
- required_create_repeatables: requiredCreateRepeatables,
1195
- options,
1196
- command_option_policies: commandOptionPolicies
1201
+ aliases: readStringArray(record, "aliases"),
1202
+ required_create_fields: readStringArray(record, "required_create_fields"),
1203
+ required_create_repeatables: readStringArray(record, "required_create_repeatables"),
1204
+ options: coerceOptionDefinitionsFromRecord(record),
1205
+ command_option_policies: coerceCommandOptionPoliciesFromRecord(record)
1197
1206
  };
1198
1207
  }
1208
+ function resolveDefinitionRequiredCreateFields(normalizedDefinition, existing) {
1209
+ return normalizedDefinition.required_create_fields ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields) : existing?.required_create_fields ?? [];
1210
+ }
1211
+ function resolveDefinitionRequiredCreateRepeatables(normalizedDefinition, existing) {
1212
+ return normalizedDefinition.required_create_repeatables ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables) : existing?.required_create_repeatables ?? [];
1213
+ }
1214
+ function resolveDefinitionOptions(normalizedDefinition, existing) {
1215
+ return normalizedDefinition.options ? normalizedDefinition.options : existing?.options ? [...existing.options] : [];
1216
+ }
1217
+ function resolveDefinitionCommandOptionPolicies(normalizedDefinition, existing) {
1218
+ return normalizedDefinition.command_option_policies ? normalizedDefinition.command_option_policies : existing?.command_option_policies ? [...existing.command_option_policies] : [];
1219
+ }
1199
1220
  function applyTypeDefinitions(source, target) {
1200
1221
  for (const rawDefinition of source) {
1201
1222
  const normalizedDefinition = normalizeTypeDefinition(rawDefinition);
@@ -1210,10 +1231,6 @@ function applyTypeDefinitions(source, target) {
1210
1231
  ...existing?.aliases ?? [],
1211
1232
  ...normalizedDefinition.aliases ?? []
1212
1233
  ]);
1213
- const requiredCreateFields = normalizedDefinition.required_create_fields ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields) : existing?.required_create_fields ?? [];
1214
- const requiredCreateRepeatables = normalizedDefinition.required_create_repeatables ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables) : existing?.required_create_repeatables ?? [];
1215
- const options = normalizedDefinition.options ? normalizedDefinition.options : existing?.options ? [...existing.options] : [];
1216
- const commandOptionPolicies = normalizedDefinition.command_option_policies ? normalizedDefinition.command_option_policies : existing?.command_option_policies ? [...existing.command_option_policies] : [];
1217
1234
  const defaultStatus = normalizedDefinition.default_status ?? existing?.default_status;
1218
1235
  const description = normalizedDefinition.description ?? existing?.description;
1219
1236
  target.set(lowerName, {
@@ -1222,10 +1239,10 @@ function applyTypeDefinitions(source, target) {
1222
1239
  ...defaultStatus ? { default_status: defaultStatus } : {},
1223
1240
  folder,
1224
1241
  aliases,
1225
- required_create_fields: requiredCreateFields,
1226
- required_create_repeatables: requiredCreateRepeatables,
1227
- options,
1228
- command_option_policies: commandOptionPolicies
1242
+ required_create_fields: resolveDefinitionRequiredCreateFields(normalizedDefinition, existing),
1243
+ required_create_repeatables: resolveDefinitionRequiredCreateRepeatables(normalizedDefinition, existing),
1244
+ options: resolveDefinitionOptions(normalizedDefinition, existing),
1245
+ command_option_policies: resolveDefinitionCommandOptionPolicies(normalizedDefinition, existing)
1229
1246
  });
1230
1247
  }
1231
1248
  }
@@ -2499,34 +2516,15 @@ function collectExtensionPolicyOverrides(rawOverrides) {
2499
2516
  }
2500
2517
  return overridesByName;
2501
2518
  }
2502
- function normalizeExtensionPolicy(settings) {
2503
- const policy = settings.extensions.policy;
2504
- const mode = normalizePolicyMode(policy?.mode);
2505
- const trustMode = normalizePolicyTrustMode(policy?.trust_mode);
2506
- const pmMaxVersionExceededMode2 = normalizePmMaxVersionExceededMode(policy?.pm_max_version_exceeded_mode);
2507
- const requireProvenance = policy?.require_provenance === true;
2508
- const trustedExtensions = normalizePolicyStringSet(policy?.trusted_extensions);
2509
- const defaultSandboxProfile = normalizePolicySandboxProfile(policy?.default_sandbox_profile);
2510
- const allowedExtensions = normalizePolicyStringSet(policy?.allowed_extensions);
2511
- const blockedExtensions = normalizePolicyStringSet(policy?.blocked_extensions);
2512
- const allowedCapabilities = normalizePolicyStringSet(policy?.allowed_capabilities);
2513
- const blockedCapabilities = normalizePolicyStringSet(policy?.blocked_capabilities);
2514
- const allowedSurfaces = normalizePolicySurfaceSet(policy?.allowed_surfaces);
2515
- const blockedSurfaces = normalizePolicySurfaceSet(policy?.blocked_surfaces);
2516
- const allowedCommands = normalizePolicyStringSet(policy?.allowed_commands);
2517
- const blockedCommands = normalizePolicyStringSet(policy?.blocked_commands);
2518
- const allowedActions = normalizePolicyStringSet(policy?.allowed_actions);
2519
- const blockedActions = normalizePolicyStringSet(policy?.blocked_actions);
2520
- const allowedServices = normalizePolicyStringSet(policy?.allowed_services);
2521
- const blockedServices = normalizePolicyStringSet(policy?.blocked_services);
2522
- const overridesByName = collectExtensionPolicyOverrides(policy?.extension_overrides);
2519
+ function collectExtensionPolicyWarnings(normalized) {
2523
2520
  const warnings = [];
2524
- for (const capability of toSortedList([...allowedCapabilities, ...blockedCapabilities])) {
2521
+ const sortedOverrides = [...normalized.overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name));
2522
+ for (const capability of toSortedList([...normalized.allowedCapabilities, ...normalized.blockedCapabilities])) {
2525
2523
  if (!isKnownExtensionCapability(capability)) {
2526
2524
  warnings.push(`extension_policy_unknown_capability:${capability}`);
2527
2525
  }
2528
2526
  }
2529
- for (const override of [...overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name))) {
2527
+ for (const override of sortedOverrides) {
2530
2528
  for (const capability of toSortedList([...override.allowedCapabilities, ...override.blockedCapabilities])) {
2531
2529
  if (!isKnownExtensionCapability(capability)) {
2532
2530
  warnings.push(`extension_policy_unknown_capability:${override.name}:${capability}`);
@@ -2534,39 +2532,54 @@ function normalizeExtensionPolicy(settings) {
2534
2532
  }
2535
2533
  }
2536
2534
  const knownSurfaces = new Set(KNOWN_EXTENSION_POLICY_SURFACES);
2537
- for (const surface of toSortedList([...allowedSurfaces, ...blockedSurfaces])) {
2535
+ for (const surface of toSortedList([...normalized.allowedSurfaces, ...normalized.blockedSurfaces])) {
2538
2536
  if (!knownSurfaces.has(surface)) {
2539
2537
  warnings.push(`extension_policy_unknown_surface:${surface}`);
2540
2538
  }
2541
2539
  }
2542
- for (const override of [...overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name))) {
2540
+ for (const override of sortedOverrides) {
2543
2541
  for (const surface of toSortedList([...override.allowedSurfaces, ...override.blockedSurfaces])) {
2544
2542
  if (!knownSurfaces.has(surface)) {
2545
2543
  warnings.push(`extension_policy_unknown_surface:${override.name}:${surface}`);
2546
2544
  }
2547
2545
  }
2548
2546
  }
2547
+ return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
2548
+ }
2549
+ function normalizeExtensionPolicy(settings) {
2550
+ const policy = settings.extensions?.policy ?? {};
2551
+ const allowedCapabilities = normalizePolicyStringSet(policy.allowed_capabilities);
2552
+ const blockedCapabilities = normalizePolicyStringSet(policy.blocked_capabilities);
2553
+ const allowedSurfaces = normalizePolicySurfaceSet(policy.allowed_surfaces);
2554
+ const blockedSurfaces = normalizePolicySurfaceSet(policy.blocked_surfaces);
2555
+ const overridesByName = collectExtensionPolicyOverrides(policy.extension_overrides);
2549
2556
  return {
2550
- mode,
2551
- trustMode,
2552
- pmMaxVersionExceededMode: pmMaxVersionExceededMode2,
2553
- requireProvenance,
2554
- trustedExtensions,
2555
- defaultSandboxProfile,
2556
- allowedExtensions,
2557
- blockedExtensions,
2557
+ mode: normalizePolicyMode(policy.mode),
2558
+ trustMode: normalizePolicyTrustMode(policy.trust_mode),
2559
+ pmMaxVersionExceededMode: normalizePmMaxVersionExceededMode(policy.pm_max_version_exceeded_mode),
2560
+ requireProvenance: policy.require_provenance === true,
2561
+ trustedExtensions: normalizePolicyStringSet(policy.trusted_extensions),
2562
+ defaultSandboxProfile: normalizePolicySandboxProfile(policy.default_sandbox_profile),
2563
+ allowedExtensions: normalizePolicyStringSet(policy.allowed_extensions),
2564
+ blockedExtensions: normalizePolicyStringSet(policy.blocked_extensions),
2558
2565
  allowedCapabilities,
2559
2566
  blockedCapabilities,
2560
2567
  allowedSurfaces,
2561
2568
  blockedSurfaces,
2562
- allowedCommands,
2563
- blockedCommands,
2564
- allowedActions,
2565
- blockedActions,
2566
- allowedServices,
2567
- blockedServices,
2569
+ allowedCommands: normalizePolicyStringSet(policy.allowed_commands),
2570
+ blockedCommands: normalizePolicyStringSet(policy.blocked_commands),
2571
+ allowedActions: normalizePolicyStringSet(policy.allowed_actions),
2572
+ blockedActions: normalizePolicyStringSet(policy.blocked_actions),
2573
+ allowedServices: normalizePolicyStringSet(policy.allowed_services),
2574
+ blockedServices: normalizePolicyStringSet(policy.blocked_services),
2568
2575
  overridesByName,
2569
- warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right))
2576
+ warnings: collectExtensionPolicyWarnings({
2577
+ allowedCapabilities,
2578
+ blockedCapabilities,
2579
+ allowedSurfaces,
2580
+ blockedSurfaces,
2581
+ overridesByName
2582
+ })
2570
2583
  };
2571
2584
  }
2572
2585
  function serializeExtensionPolicy(policy) {
@@ -2777,55 +2790,28 @@ function evaluateExtensionPolicyForExtension(policy, extension) {
2777
2790
  if (policy.mode === "off" && policy.trustMode === "off") {
2778
2791
  return { allowed: true, warning: null };
2779
2792
  }
2793
+ const violations = [];
2780
2794
  const reason = resolvePolicyExtensionReason(policy, extension);
2781
- const trustReason = resolvePolicyTrustReason(policy, extension);
2782
- const sandboxReason = resolvePolicySandboxReason(policy, extension);
2783
- const extensionEnforced = reason && policy.mode === "enforce";
2784
- const trustEnforced = trustReason && policy.trustMode === "enforce";
2785
- const sandboxEnforced = sandboxReason && policy.mode === "enforce";
2786
- if (!reason && !trustReason && !sandboxReason) {
2787
- return { allowed: true, warning: null };
2795
+ if (reason) {
2796
+ violations.push({ reason, scope: "extension", mode: policy.mode });
2788
2797
  }
2789
- if (extensionEnforced) {
2790
- return {
2791
- allowed: false,
2792
- warning: buildPolicyWarning("blocked", "extension", extension, reason)
2793
- };
2794
- }
2795
- if (trustEnforced) {
2796
- return {
2797
- allowed: false,
2798
- warning: buildPolicyWarning("blocked", "trust", extension, trustReason)
2799
- };
2798
+ const trustReason = resolvePolicyTrustReason(policy, extension);
2799
+ if (trustReason) {
2800
+ violations.push({ reason: trustReason, scope: "trust", mode: policy.trustMode });
2800
2801
  }
2801
- if (sandboxEnforced) {
2802
- return {
2803
- allowed: false,
2804
- warning: buildPolicyWarning("blocked", "extension", extension, sandboxReason)
2805
- };
2802
+ const sandboxReason = resolvePolicySandboxReason(policy, extension);
2803
+ if (sandboxReason) {
2804
+ violations.push({ reason: sandboxReason, scope: "extension", mode: policy.mode });
2806
2805
  }
2807
- if (reason && policy.mode === "warn") {
2808
- return {
2809
- allowed: true,
2810
- warning: buildPolicyWarning("violation", "extension", extension, reason)
2811
- };
2806
+ const enforced = violations.find((violation) => violation.mode === "enforce");
2807
+ if (enforced) {
2808
+ return { allowed: false, warning: buildPolicyWarning("blocked", enforced.scope, extension, enforced.reason) };
2812
2809
  }
2813
- if (trustReason && policy.trustMode === "warn") {
2814
- return {
2815
- allowed: true,
2816
- warning: buildPolicyWarning("violation", "trust", extension, trustReason)
2817
- };
2810
+ const warned = violations.find((violation) => violation.mode === "warn");
2811
+ if (warned) {
2812
+ return { allowed: true, warning: buildPolicyWarning("violation", warned.scope, extension, warned.reason) };
2818
2813
  }
2819
- if (sandboxReason && policy.mode === "warn") {
2820
- return {
2821
- allowed: true,
2822
- warning: buildPolicyWarning("violation", "extension", extension, sandboxReason)
2823
- };
2824
- }
2825
- return {
2826
- allowed: true,
2827
- warning: null
2828
- };
2814
+ return { allowed: true, warning: null };
2829
2815
  }
2830
2816
  function evaluateExtensionPolicyForCapability(policy, extension, capability) {
2831
2817
  if (policy.mode === "off") {
@@ -2840,19 +2826,15 @@ function evaluateExtensionPolicyForCapability(policy, extension, capability) {
2840
2826
  warning: buildPolicyWarning(policy.mode === "warn" ? "violation" : "blocked", "capability", extension, reason, { capability: capability.trim().toLowerCase() })
2841
2827
  };
2842
2828
  }
2843
- function evaluateExtensionPolicyForRegistration(policy, extension, surface, method, capability, details) {
2844
- if (policy.mode === "off") {
2845
- return { allowed: true, warning: null };
2846
- }
2829
+ function resolveRegistrationPolicyReason(policy, extension, surface, capability, detail) {
2847
2830
  const capabilityReason = typeof capability === "string" ? resolvePolicyCapabilityReason(policy, extension, capability) : null;
2848
2831
  const surfaceReason = resolvePolicySurfaceReason(policy, extension, surface);
2849
- const commandReason = details?.command ? resolvePolicyCommandReason(policy, extension, details.command) : null;
2850
- const actionReason = details?.action ? resolvePolicyActionReason(policy, extension, details.action) : null;
2851
- const serviceReason = details?.service ? resolvePolicyServiceReason(policy, extension, details.service) : null;
2852
- const reason = capabilityReason ?? surfaceReason ?? commandReason ?? actionReason ?? serviceReason;
2853
- if (!reason) {
2854
- return { allowed: true, warning: null };
2855
- }
2832
+ const commandReason = detail.command ? resolvePolicyCommandReason(policy, extension, detail.command) : null;
2833
+ const actionReason = detail.action ? resolvePolicyActionReason(policy, extension, detail.action) : null;
2834
+ const serviceReason = detail.service ? resolvePolicyServiceReason(policy, extension, detail.service) : null;
2835
+ return capabilityReason ?? surfaceReason ?? commandReason ?? actionReason ?? serviceReason;
2836
+ }
2837
+ function buildRegistrationPolicyWarningDetails(method, surface, capability, detail) {
2856
2838
  const warningDetails = {
2857
2839
  method: normalizePolicyName(method).replace(/\s+/g, "_"),
2858
2840
  surface
@@ -2860,16 +2842,27 @@ function evaluateExtensionPolicyForRegistration(policy, extension, surface, meth
2860
2842
  if (capability) {
2861
2843
  warningDetails.capability = capability;
2862
2844
  }
2863
- if (details?.command) {
2864
- warningDetails.command = normalizeCommandName(details.command);
2845
+ if (detail.command) {
2846
+ warningDetails.command = normalizeCommandName(detail.command);
2847
+ }
2848
+ if (detail.action) {
2849
+ warningDetails.action = normalizePolicyName(detail.action).replace(/\s+/g, "-");
2850
+ }
2851
+ if (detail.service) {
2852
+ warningDetails.service = normalizePolicyName(detail.service);
2865
2853
  }
2866
- if (details?.action) {
2867
- warningDetails.action = normalizePolicyName(details.action).replace(/\s+/g, "-");
2854
+ return warningDetails;
2855
+ }
2856
+ function evaluateExtensionPolicyForRegistration(policy, extension, surface, method, capability, details) {
2857
+ if (policy.mode === "off") {
2858
+ return { allowed: true, warning: null };
2868
2859
  }
2869
- if (details?.service) {
2870
- warningDetails.service = normalizePolicyName(details.service);
2860
+ const detail = details ?? {};
2861
+ const reason = resolveRegistrationPolicyReason(policy, extension, surface, capability, detail);
2862
+ if (!reason) {
2863
+ return { allowed: true, warning: null };
2871
2864
  }
2872
- const warning = buildPolicyWarning(policy.mode === "warn" ? "violation" : "blocked", "registration", extension, reason, warningDetails);
2865
+ const warning = buildPolicyWarning(policy.mode === "warn" ? "violation" : "blocked", "registration", extension, reason, buildRegistrationPolicyWarningDetails(method, surface, capability, detail));
2873
2866
  return {
2874
2867
  allowed: policy.mode === "warn",
2875
2868
  warning
@@ -2916,33 +2909,134 @@ function parseManifestEngines(value) {
2916
2909
  }
2917
2910
  return Object.keys(engines).length > 0 ? engines : void 0;
2918
2911
  }
2919
- function parseManifest(raw) {
2920
- if (typeof raw !== "object" || raw === null) {
2912
+ function parseRequiredManifestString(candidate, field) {
2913
+ const value = candidate[field];
2914
+ if (typeof value !== "string" || value.trim().length === 0) {
2921
2915
  return null;
2922
2916
  }
2923
- const candidate = raw;
2924
- if (typeof candidate.name !== "string" || candidate.name.trim().length === 0) {
2917
+ return value.trim();
2918
+ }
2919
+ function parseOptionalIntegerValue(value) {
2920
+ if (value === void 0 || value === null) {
2921
+ return void 0;
2922
+ }
2923
+ if (typeof value !== "number" || !Number.isInteger(value)) {
2925
2924
  return null;
2926
2925
  }
2927
- if (typeof candidate.version !== "string" || candidate.version.trim().length === 0) {
2926
+ return value;
2927
+ }
2928
+ function parseOptionalBooleanValue(value) {
2929
+ if (value === void 0 || value === null) {
2930
+ return void 0;
2931
+ }
2932
+ if (typeof value !== "boolean") {
2928
2933
  return null;
2929
2934
  }
2930
- if (typeof candidate.entry !== "string" || candidate.entry.trim().length === 0) {
2935
+ return value;
2936
+ }
2937
+ function parseManifestPriority(candidate) {
2938
+ const value = parseOptionalIntegerValue(candidate.priority);
2939
+ return value === void 0 ? DEFAULT_EXTENSION_PRIORITY : value;
2940
+ }
2941
+ function parseManifestSandboxProfile(candidate) {
2942
+ const value = candidate.sandbox_profile;
2943
+ if (value === void 0 || value === null) {
2944
+ return void 0;
2945
+ }
2946
+ if (typeof value !== "string") {
2931
2947
  return null;
2932
2948
  }
2933
- let priority = DEFAULT_EXTENSION_PRIORITY;
2934
- if ("priority" in candidate && candidate.priority !== void 0 && candidate.priority !== null) {
2935
- if (typeof candidate.priority !== "number" || !Number.isInteger(candidate.priority)) {
2936
- return null;
2937
- }
2938
- priority = candidate.priority;
2949
+ const normalizedProfile = normalizePolicySandboxProfile(value);
2950
+ if (normalizedProfile !== value.trim().toLowerCase()) {
2951
+ return null;
2939
2952
  }
2940
- let manifestVersion;
2941
- if ("manifest_version" in candidate && candidate.manifest_version !== void 0 && candidate.manifest_version !== null) {
2942
- if (typeof candidate.manifest_version !== "number" || !Number.isInteger(candidate.manifest_version)) {
2943
- return null;
2944
- }
2945
- manifestVersion = candidate.manifest_version;
2953
+ return normalizedProfile;
2954
+ }
2955
+ function optionalTrimmedString(value) {
2956
+ return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
2957
+ }
2958
+ function parseManifestProvenance(value) {
2959
+ if (value === void 0 || value === null) {
2960
+ return void 0;
2961
+ }
2962
+ const provenanceRecord = asRecordLoose(value);
2963
+ if (!provenanceRecord) {
2964
+ return null;
2965
+ }
2966
+ const source = optionalTrimmedString(provenanceRecord.source);
2967
+ const signature = optionalTrimmedString(provenanceRecord.signature);
2968
+ const attestation = optionalTrimmedString(provenanceRecord.attestation);
2969
+ const verified = provenanceRecord.verified === void 0 || provenanceRecord.verified === null ? void 0 : typeof provenanceRecord.verified === "boolean" ? provenanceRecord.verified : null;
2970
+ if (verified === null) {
2971
+ return null;
2972
+ }
2973
+ return {
2974
+ ...source ? { source } : {},
2975
+ ...signature ? { signature } : {},
2976
+ ...attestation ? { attestation } : {},
2977
+ ...typeof verified === "boolean" ? { verified } : {}
2978
+ };
2979
+ }
2980
+ function parseManifestPermissions(value) {
2981
+ if (value === void 0 || value === null) {
2982
+ return void 0;
2983
+ }
2984
+ const permissionsRecord = asRecordLoose(value);
2985
+ if (!permissionsRecord) {
2986
+ return null;
2987
+ }
2988
+ const fsRead = parseOptionalBooleanValue(permissionsRecord.fs_read);
2989
+ const fsWrite = parseOptionalBooleanValue(permissionsRecord.fs_write);
2990
+ const network = parseOptionalBooleanValue(permissionsRecord.network);
2991
+ const envRead = parseOptionalBooleanValue(permissionsRecord.env_read);
2992
+ const envWrite = parseOptionalBooleanValue(permissionsRecord.env_write);
2993
+ const processSpawn = parseOptionalBooleanValue(permissionsRecord.process_spawn);
2994
+ if ([fsRead, fsWrite, network, envRead, envWrite, processSpawn].includes(null)) {
2995
+ return null;
2996
+ }
2997
+ return {
2998
+ ...typeof fsRead === "boolean" ? { fs_read: fsRead } : {},
2999
+ ...typeof fsWrite === "boolean" ? { fs_write: fsWrite } : {},
3000
+ ...typeof network === "boolean" ? { network } : {},
3001
+ ...typeof envRead === "boolean" ? { env_read: envRead } : {},
3002
+ ...typeof envWrite === "boolean" ? { env_write: envWrite } : {},
3003
+ ...typeof processSpawn === "boolean" ? { process_spawn: processSpawn } : {}
3004
+ };
3005
+ }
3006
+ function parseManifestCapabilities(value) {
3007
+ if (value === void 0 || value === null) {
3008
+ return { capabilities: [], legacy_aliases: [] };
3009
+ }
3010
+ if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
3011
+ return null;
3012
+ }
3013
+ const normalizedCapabilities = normalizeManifestCapabilities(value);
3014
+ return { capabilities: normalizedCapabilities.capabilities, legacy_aliases: normalizedCapabilities.legacy_aliases };
3015
+ }
3016
+ function parseManifestActivation(value) {
3017
+ if (value === void 0 || value === null) {
3018
+ return void 0;
3019
+ }
3020
+ const activationRecord = asRecordLoose(value);
3021
+ if (!activationRecord) {
3022
+ return null;
3023
+ }
3024
+ const rawCommands = activationRecord.commands;
3025
+ if (rawCommands === void 0 || rawCommands === null) {
3026
+ return void 0;
3027
+ }
3028
+ if (!Array.isArray(rawCommands) || rawCommands.some((entry) => typeof entry !== "string")) {
3029
+ return null;
3030
+ }
3031
+ const commands = [
3032
+ ...new Set(rawCommands.map((entry) => normalizeCommandName(entry)).filter((entry) => entry.length > 0))
3033
+ ].sort((left, right) => left.localeCompare(right));
3034
+ return commands.length > 0 ? { commands } : void 0;
3035
+ }
3036
+ function parseManifestMetadata(candidate) {
3037
+ const manifestVersion = parseOptionalIntegerValue(candidate.manifest_version);
3038
+ if (manifestVersion === null) {
3039
+ return null;
2946
3040
  }
2947
3041
  const pmMinVersion = parseOptionalManifestString(candidate, "pm_min_version");
2948
3042
  if (pmMinVersion === null) {
@@ -2956,124 +3050,85 @@ function parseManifest(raw) {
2956
3050
  if (engines === null) {
2957
3051
  return null;
2958
3052
  }
2959
- let trusted;
2960
- if ("trusted" in candidate && candidate.trusted !== void 0 && candidate.trusted !== null) {
2961
- if (typeof candidate.trusted !== "boolean") {
2962
- return null;
2963
- }
2964
- trusted = candidate.trusted;
3053
+ const trusted = parseOptionalBooleanValue(candidate.trusted);
3054
+ if (trusted === null) {
3055
+ return null;
2965
3056
  }
2966
- let sandboxProfile;
2967
- if ("sandbox_profile" in candidate && candidate.sandbox_profile !== void 0 && candidate.sandbox_profile !== null) {
2968
- if (typeof candidate.sandbox_profile !== "string") {
2969
- return null;
2970
- }
2971
- const normalizedProfile = normalizePolicySandboxProfile(candidate.sandbox_profile);
2972
- if (normalizedProfile !== candidate.sandbox_profile.trim().toLowerCase()) {
2973
- return null;
2974
- }
2975
- sandboxProfile = normalizedProfile;
3057
+ const sandboxProfile = parseManifestSandboxProfile(candidate);
3058
+ if (sandboxProfile === null) {
3059
+ return null;
2976
3060
  }
2977
- let provenance;
2978
- if ("provenance" in candidate && candidate.provenance !== void 0 && candidate.provenance !== null) {
2979
- const provenanceRecord = asRecordLoose(candidate.provenance);
2980
- if (!provenanceRecord) {
2981
- return null;
2982
- }
2983
- const source = typeof provenanceRecord.source === "string" && provenanceRecord.source.trim().length > 0 ? provenanceRecord.source.trim() : void 0;
2984
- const signature = typeof provenanceRecord.signature === "string" && provenanceRecord.signature.trim().length > 0 ? provenanceRecord.signature.trim() : void 0;
2985
- const attestation = typeof provenanceRecord.attestation === "string" && provenanceRecord.attestation.trim().length > 0 ? provenanceRecord.attestation.trim() : void 0;
2986
- const verified = provenanceRecord.verified === void 0 || provenanceRecord.verified === null ? void 0 : typeof provenanceRecord.verified === "boolean" ? provenanceRecord.verified : null;
2987
- if (verified === null) {
2988
- return null;
2989
- }
2990
- provenance = {
2991
- ...source ? { source } : {},
2992
- ...signature ? { signature } : {},
2993
- ...attestation ? { attestation } : {},
2994
- ...typeof verified === "boolean" ? { verified } : {}
2995
- };
3061
+ const provenance = parseManifestProvenance(candidate.provenance);
3062
+ if (provenance === null) {
3063
+ return null;
2996
3064
  }
2997
- let permissions;
2998
- if ("permissions" in candidate && candidate.permissions !== void 0 && candidate.permissions !== null) {
2999
- const permissionsRecord = asRecordLoose(candidate.permissions);
3000
- if (!permissionsRecord) {
3001
- return null;
3002
- }
3003
- const parseOptionalBoolean = (value) => {
3004
- if (value === void 0 || value === null) {
3005
- return void 0;
3006
- }
3007
- if (typeof value !== "boolean") {
3008
- return null;
3009
- }
3010
- return value;
3011
- };
3012
- const fsRead = parseOptionalBoolean(permissionsRecord.fs_read);
3013
- const fsWrite = parseOptionalBoolean(permissionsRecord.fs_write);
3014
- const network = parseOptionalBoolean(permissionsRecord.network);
3015
- const envRead = parseOptionalBoolean(permissionsRecord.env_read);
3016
- const envWrite = parseOptionalBoolean(permissionsRecord.env_write);
3017
- const processSpawn = parseOptionalBoolean(permissionsRecord.process_spawn);
3018
- if ([fsRead, fsWrite, network, envRead, envWrite, processSpawn].includes(null)) {
3019
- return null;
3020
- }
3021
- permissions = {
3022
- ...typeof fsRead === "boolean" ? { fs_read: fsRead } : {},
3023
- ...typeof fsWrite === "boolean" ? { fs_write: fsWrite } : {},
3024
- ...typeof network === "boolean" ? { network } : {},
3025
- ...typeof envRead === "boolean" ? { env_read: envRead } : {},
3026
- ...typeof envWrite === "boolean" ? { env_write: envWrite } : {},
3027
- ...typeof processSpawn === "boolean" ? { process_spawn: processSpawn } : {}
3028
- };
3065
+ const permissions = parseManifestPermissions(candidate.permissions);
3066
+ if (permissions === null) {
3067
+ return null;
3029
3068
  }
3030
- let capabilities = [];
3031
- let legacyCapabilityAliases = [];
3032
- if ("capabilities" in candidate && candidate.capabilities !== void 0 && candidate.capabilities !== null) {
3033
- if (!Array.isArray(candidate.capabilities) || candidate.capabilities.some((value) => typeof value !== "string")) {
3034
- return null;
3035
- }
3036
- const normalizedCapabilities = normalizeManifestCapabilities(candidate.capabilities);
3037
- capabilities = normalizedCapabilities.capabilities;
3038
- legacyCapabilityAliases = normalizedCapabilities.legacy_aliases;
3069
+ const capabilities = parseManifestCapabilities(candidate.capabilities);
3070
+ if (capabilities === null) {
3071
+ return null;
3039
3072
  }
3040
- let activation;
3041
- if ("activation" in candidate && candidate.activation !== void 0 && candidate.activation !== null) {
3042
- const activationRecord = asRecordLoose(candidate.activation);
3043
- if (!activationRecord) {
3044
- return null;
3045
- }
3046
- const rawCommands = activationRecord.commands;
3047
- if (rawCommands !== void 0 && rawCommands !== null) {
3048
- if (!Array.isArray(rawCommands) || rawCommands.some((value) => typeof value !== "string")) {
3049
- return null;
3050
- }
3051
- const commands = [
3052
- ...new Set(rawCommands.map((value) => normalizeCommandName(value)).filter((value) => value.length > 0))
3053
- ].sort((left, right) => left.localeCompare(right));
3054
- if (commands.length > 0) {
3055
- activation = {
3056
- commands
3057
- };
3058
- }
3059
- }
3073
+ const activation = parseManifestActivation(candidate.activation);
3074
+ if (activation === null) {
3075
+ return null;
3060
3076
  }
3061
3077
  return {
3062
- name: candidate.name.trim(),
3063
- version: candidate.version.trim(),
3064
- entry: candidate.entry.trim(),
3065
- priority,
3066
3078
  manifest_version: manifestVersion,
3067
3079
  pm_min_version: pmMinVersion,
3068
3080
  pm_max_version: pmMaxVersion,
3069
3081
  engines,
3070
3082
  trusted,
3071
- provenance,
3072
3083
  sandbox_profile: sandboxProfile,
3084
+ provenance,
3073
3085
  permissions,
3074
- activation,
3075
- capabilities,
3076
- legacy_capability_aliases: legacyCapabilityAliases.length > 0 ? legacyCapabilityAliases : void 0
3086
+ capabilities: capabilities.capabilities,
3087
+ legacy_capability_aliases: capabilities.legacy_aliases,
3088
+ activation
3089
+ };
3090
+ }
3091
+ function parseManifest(raw) {
3092
+ if (typeof raw !== "object" || raw === null) {
3093
+ return null;
3094
+ }
3095
+ const candidate = raw;
3096
+ const name = parseRequiredManifestString(candidate, "name");
3097
+ if (name === null) {
3098
+ return null;
3099
+ }
3100
+ const version = parseRequiredManifestString(candidate, "version");
3101
+ if (version === null) {
3102
+ return null;
3103
+ }
3104
+ const entry = parseRequiredManifestString(candidate, "entry");
3105
+ if (entry === null) {
3106
+ return null;
3107
+ }
3108
+ const priority = parseManifestPriority(candidate);
3109
+ if (priority === null) {
3110
+ return null;
3111
+ }
3112
+ const metadata = parseManifestMetadata(candidate);
3113
+ if (metadata === null) {
3114
+ return null;
3115
+ }
3116
+ return {
3117
+ name,
3118
+ version,
3119
+ entry,
3120
+ priority,
3121
+ manifest_version: metadata.manifest_version,
3122
+ pm_min_version: metadata.pm_min_version,
3123
+ pm_max_version: metadata.pm_max_version,
3124
+ engines: metadata.engines,
3125
+ trusted: metadata.trusted,
3126
+ provenance: metadata.provenance,
3127
+ sandbox_profile: metadata.sandbox_profile,
3128
+ permissions: metadata.permissions,
3129
+ activation: metadata.activation,
3130
+ capabilities: metadata.capabilities,
3131
+ legacy_capability_aliases: metadata.legacy_capability_aliases.length > 0 ? metadata.legacy_capability_aliases : void 0
3077
3132
  };
3078
3133
  }
3079
3134
  function shouldEnable(name, enabled, disabled) {
@@ -3202,26 +3257,50 @@ async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled, pmMa
3202
3257
  }
3203
3258
  return { diagnostics, warnings, candidates };
3204
3259
  }
3260
+ function buildUnavailableExtensionScan(layer, directory, manifestPath, warning) {
3261
+ return {
3262
+ diagnostic: {
3263
+ layer,
3264
+ directory,
3265
+ manifest_path: manifestPath,
3266
+ name: null,
3267
+ version: null,
3268
+ entry: null,
3269
+ priority: null,
3270
+ entry_path: null,
3271
+ enabled: null,
3272
+ status: "warn"
3273
+ },
3274
+ warnings: [warning],
3275
+ candidate: null
3276
+ };
3277
+ }
3278
+ function collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility) {
3279
+ const extensionWarnings = [];
3280
+ if (Array.isArray(manifest.legacy_capability_aliases) && manifest.legacy_capability_aliases.length > 0) {
3281
+ extensionWarnings.push(formatLegacyExtensionCapabilityAliasWarning(layer, manifest.name, manifest.legacy_capability_aliases));
3282
+ }
3283
+ for (const capability of collectUnknownExtensionCapabilities(manifest.capabilities)) {
3284
+ extensionWarnings.push(formatUnknownExtensionCapabilityWarning(layer, manifest.name, capability));
3285
+ }
3286
+ if (!entryWithinDirectory) {
3287
+ extensionWarnings.push(`extension_entry_outside_extension:${layer}:${manifest.name}`);
3288
+ } else if (!entryExists) {
3289
+ extensionWarnings.push(`extension_entry_missing:${layer}:${manifest.name}`);
3290
+ }
3291
+ if (pmVersionCompatibility.warning) {
3292
+ extensionWarnings.push(pmVersionCompatibility.warning);
3293
+ }
3294
+ if (pmMaxVersionCompatibility.warning) {
3295
+ extensionWarnings.push(pmMaxVersionCompatibility.warning);
3296
+ }
3297
+ return extensionWarnings;
3298
+ }
3205
3299
  async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode2) {
3206
3300
  const extensionDir = path5.join(extensionsRoot, directory);
3207
3301
  const manifestPath = path5.join(extensionDir, "manifest.json");
3208
3302
  if (!await pathExists(manifestPath)) {
3209
- return {
3210
- diagnostic: {
3211
- layer,
3212
- directory,
3213
- manifest_path: manifestPath,
3214
- name: null,
3215
- version: null,
3216
- entry: null,
3217
- priority: null,
3218
- entry_path: null,
3219
- enabled: null,
3220
- status: "warn"
3221
- },
3222
- warnings: [`extension_manifest_missing:${layer}:${directory}`],
3223
- candidate: null
3224
- };
3303
+ return buildUnavailableExtensionScan(layer, directory, manifestPath, `extension_manifest_missing:${layer}:${directory}`);
3225
3304
  }
3226
3305
  let manifest = null;
3227
3306
  try {
@@ -3231,48 +3310,16 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
3231
3310
  manifest = null;
3232
3311
  }
3233
3312
  if (!manifest) {
3234
- return {
3235
- diagnostic: {
3236
- layer,
3237
- directory,
3238
- manifest_path: manifestPath,
3239
- name: null,
3240
- version: null,
3241
- entry: null,
3242
- priority: null,
3243
- entry_path: null,
3244
- enabled: null,
3245
- status: "warn"
3246
- },
3247
- warnings: [`extension_manifest_invalid:${layer}:${directory}`],
3248
- candidate: null
3249
- };
3313
+ return buildUnavailableExtensionScan(layer, directory, manifestPath, `extension_manifest_invalid:${layer}:${directory}`);
3250
3314
  }
3251
3315
  const entryPath = path5.resolve(extensionDir, manifest.entry);
3252
3316
  const entryWithinDirectoryByPath = isPathWithinDirectory(extensionDir, entryPath);
3253
3317
  const entryExists = entryWithinDirectoryByPath ? await pathExists(entryPath) : false;
3254
3318
  const entryWithinDirectory = entryWithinDirectoryByPath && entryExists ? await isCanonicalPathWithinDirectory(extensionDir, entryPath) : entryWithinDirectoryByPath;
3255
3319
  const enabledForLoad = shouldEnable(manifest.name, enabled, disabled);
3256
- const extensionWarnings = [];
3257
- if (Array.isArray(manifest.legacy_capability_aliases) && manifest.legacy_capability_aliases.length > 0) {
3258
- extensionWarnings.push(formatLegacyExtensionCapabilityAliasWarning(layer, manifest.name, manifest.legacy_capability_aliases));
3259
- }
3260
- for (const capability of collectUnknownExtensionCapabilities(manifest.capabilities)) {
3261
- extensionWarnings.push(formatUnknownExtensionCapabilityWarning(layer, manifest.name, capability));
3262
- }
3263
- if (!entryWithinDirectory) {
3264
- extensionWarnings.push(`extension_entry_outside_extension:${layer}:${manifest.name}`);
3265
- } else if (!entryExists) {
3266
- extensionWarnings.push(`extension_entry_missing:${layer}:${manifest.name}`);
3267
- }
3268
3320
  const pmVersionCompatibility = await evaluatePmMinVersionCompatibility(layer, manifest);
3269
- if (pmVersionCompatibility.warning) {
3270
- extensionWarnings.push(pmVersionCompatibility.warning);
3271
- }
3272
3321
  const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest, pmMaxVersionExceededMode2);
3273
- if (pmMaxVersionCompatibility.warning) {
3274
- extensionWarnings.push(pmMaxVersionCompatibility.warning);
3275
- }
3322
+ const extensionWarnings = collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility);
3276
3323
  const extensionReady = entryWithinDirectory && entryExists && pmVersionCompatibility.allowed && pmMaxVersionCompatibility.allowed;
3277
3324
  const sourcePackage = managedSourcePackages.get(`directory:${directory}`) ?? managedSourcePackages.get(`name:${manifest.name}`);
3278
3325
  return {
@@ -4022,69 +4069,70 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
4022
4069
  received: sanitizeRegistrationValue(received),
4023
4070
  hint
4024
4071
  });
4025
- const registerCommand = (commandOrDefinition, override) => {
4026
- assertExtensionCapability(extension, "commands", "registerCommand");
4027
- if (typeof commandOrDefinition === "string") {
4028
- const normalizedCommand2 = normalizeCommandName(commandOrDefinition);
4029
- if (normalizedCommand2.length === 0) {
4030
- 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."));
4031
- }
4032
- if (typeof override !== "function") {
4033
- const trace = registerCommandTrace("override", normalizedCommand2, 'registerCommand("<command>", (context) => unknown)', { command: commandOrDefinition, override }, "Provide a function as the second registerCommand argument.");
4034
- throw createRegistrationValidationError(`registerCommand requires an override function when command name is provided (command="${normalizedCommand2}", registration_index=${trace.registration_index})`, trace);
4035
- }
4036
- if (!allowRegistration("commands.override", "registerCommand", "commands", { command: normalizedCommand2 })) {
4037
- return;
4038
- }
4039
- commands.overrides.push({
4040
- layer: extension.layer,
4041
- name: extension.name,
4042
- command: normalizedCommand2,
4043
- run: override
4044
- });
4045
- return;
4046
- }
4047
- if (typeof commandOrDefinition !== "object" || commandOrDefinition === null) {
4048
- 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) => ... }).'));
4072
+ const registerCommandOverride = (command, override) => {
4073
+ const normalizedCommand = normalizeCommandName(command);
4074
+ if (normalizedCommand.length === 0) {
4075
+ 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."));
4049
4076
  }
4050
- if (typeof commandOrDefinition.name !== "string") {
4051
- 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."));
4077
+ if (typeof override !== "function") {
4078
+ const trace = registerCommandTrace("override", normalizedCommand, 'registerCommand("<command>", (context) => unknown)', { command, override }, "Provide a function as the second registerCommand argument.");
4079
+ throw createRegistrationValidationError(`registerCommand requires an override function when command name is provided (command="${normalizedCommand}", registration_index=${trace.registration_index})`, trace);
4052
4080
  }
4053
- const normalizedCommand = normalizeCommandName(commandOrDefinition.name);
4054
- if (normalizedCommand.length === 0) {
4055
- 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."));
4081
+ if (!allowRegistration("commands.override", "registerCommand", "commands", { command: normalizedCommand })) {
4082
+ return;
4056
4083
  }
4057
- const runHandler = typeof commandOrDefinition.run === "function" ? commandOrDefinition.run : void 0;
4058
- const legacyHandler = typeof commandOrDefinition.handler === "function" ? commandOrDefinition.handler : void 0;
4084
+ commands.overrides.push({
4085
+ layer: extension.layer,
4086
+ name: extension.name,
4087
+ command: normalizedCommand,
4088
+ run: override
4089
+ });
4090
+ };
4091
+ const resolveCommandDefinitionRunHandler = (definition, normalizedCommand) => {
4092
+ const runHandler = typeof definition.run === "function" ? definition.run : void 0;
4093
+ const legacyHandler = typeof definition.handler === "function" ? definition.handler : void 0;
4059
4094
  if (!runHandler && legacyHandler) {
4060
4095
  activationWarnings.push(`extension_command_definition_legacy_handler_alias:${extension.layer}:${extension.name}:${normalizedCommand}`);
4061
4096
  }
4062
- const resolvedHandler = runHandler ?? legacyHandler;
4097
+ return runHandler ?? legacyHandler;
4098
+ };
4099
+ const registerCommandDefinition = (definition) => {
4100
+ if (typeof definition !== "object" || definition === null) {
4101
+ 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) => ... }).'));
4102
+ }
4103
+ if (typeof definition.name !== "string") {
4104
+ 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."));
4105
+ }
4106
+ const normalizedCommand = normalizeCommandName(definition.name);
4107
+ if (normalizedCommand.length === 0) {
4108
+ 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."));
4109
+ }
4110
+ const resolvedHandler = resolveCommandDefinitionRunHandler(definition, normalizedCommand);
4063
4111
  if (typeof resolvedHandler !== "function") {
4064
- const trace = registerCommandTrace("definition", normalizedCommand, "{ name: string; run: (context) => unknown; }", commandOrDefinition, "Define command definition.run as a function.");
4112
+ const trace = registerCommandTrace("definition", normalizedCommand, "{ name: string; run: (context) => unknown; }", definition, "Define command definition.run as a function.");
4065
4113
  throw createRegistrationValidationError(`registerCommand requires a command definition run handler (command="${normalizedCommand}", registration_index=${trace.registration_index})`, trace);
4066
4114
  }
4067
4115
  try {
4068
- assertOptionalStringField("registerCommand definition.action", commandOrDefinition.action);
4069
- assertOptionalStringField("registerCommand definition.description", commandOrDefinition.description);
4070
- assertOptionalStringField("registerCommand definition.intent", commandOrDefinition.intent);
4071
- const action = resolveCommandDefinitionAction(normalizedCommand, commandOrDefinition.action);
4116
+ assertOptionalStringField("registerCommand definition.action", definition.action);
4117
+ assertOptionalStringField("registerCommand definition.description", definition.description);
4118
+ assertOptionalStringField("registerCommand definition.intent", definition.intent);
4119
+ const action = resolveCommandDefinitionAction(normalizedCommand, definition.action);
4072
4120
  if (!allowRegistration("commands.handler", "registerCommand", "commands", { command: normalizedCommand, action })) {
4073
4121
  return;
4074
4122
  }
4075
- const description = commandOrDefinition.description?.trim();
4076
- const intent = commandOrDefinition.intent?.trim();
4077
- const examples = normalizeOptionalStringArrayField("registerCommand definition.examples", commandOrDefinition.examples);
4078
- const failureHints = normalizeOptionalStringArrayField("registerCommand definition.failure_hints", commandOrDefinition.failure_hints);
4079
- const argumentsDefinition = normalizeCommandDefinitionArguments(commandOrDefinition.arguments);
4080
- if (commandOrDefinition.flags !== void 0) {
4123
+ const description = definition.description?.trim();
4124
+ const intent = definition.intent?.trim();
4125
+ const examples = normalizeOptionalStringArrayField("registerCommand definition.examples", definition.examples);
4126
+ const failureHints = normalizeOptionalStringArrayField("registerCommand definition.failure_hints", definition.failure_hints);
4127
+ const argumentsDefinition = normalizeCommandDefinitionArguments(definition.arguments);
4128
+ if (definition.flags !== void 0) {
4081
4129
  assertExtensionCapability(extension, "schema", "registerCommand flags");
4082
- validateFlagDefinitions(commandOrDefinition.flags);
4130
+ validateFlagDefinitions(definition.flags);
4083
4131
  registrations.flags.push({
4084
4132
  layer: extension.layer,
4085
4133
  name: extension.name,
4086
4134
  target_command: normalizedCommand,
4087
- flags: normalizeRegistrationRecordList("registerCommand definition.flags", commandOrDefinition.flags)
4135
+ flags: normalizeRegistrationRecordList("registerCommand definition.flags", definition.flags)
4088
4136
  });
4089
4137
  }
4090
4138
  const registration = {
@@ -4106,7 +4154,7 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
4106
4154
  registrations.commands.push(registration);
4107
4155
  } catch (error) {
4108
4156
  const reason = formatUnknownError(error);
4109
- 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.");
4157
+ 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.");
4110
4158
  throw createRegistrationValidationError(`registerCommand definition metadata invalid (command="${normalizedCommand}", registration_index=${trace.registration_index}): ${reason}`, trace);
4111
4159
  }
4112
4160
  commands.handlers.push({
@@ -4116,6 +4164,14 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
4116
4164
  run: resolvedHandler
4117
4165
  });
4118
4166
  };
4167
+ const registerCommand = (commandOrDefinition, override) => {
4168
+ assertExtensionCapability(extension, "commands", "registerCommand");
4169
+ if (typeof commandOrDefinition === "string") {
4170
+ registerCommandOverride(commandOrDefinition, override);
4171
+ return;
4172
+ }
4173
+ registerCommandDefinition(commandOrDefinition);
4174
+ };
4119
4175
  const registerParser = (command, override) => {
4120
4176
  assertExtensionCapability(extension, "parser", "registerParser");
4121
4177
  if (!allowRegistration("parser.override", "registerParser", "parser")) {
@@ -5064,40 +5120,47 @@ function normalizeRuntimeWorkflow(workflow) {
5064
5120
  canceled_status: normalizeStatusId(workflow?.canceled_status)
5065
5121
  };
5066
5122
  }
5123
+ function appendTypeWorkflowPair(record, pair) {
5124
+ if (!Array.isArray(pair) || pair.length !== 2) {
5125
+ return;
5126
+ }
5127
+ const from = normalizeStatusToken(pair[0]);
5128
+ const to = normalizeStatusToken(pair[1]);
5129
+ if (from.length === 0 || to.length === 0) {
5130
+ return;
5131
+ }
5132
+ if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {
5133
+ return;
5134
+ }
5135
+ record.pairs.push([from, to]);
5136
+ }
5137
+ function normalizedTypeWorkflowEntry(entry) {
5138
+ const rawType = typeof entry?.type === "string" ? entry.type.trim() : "";
5139
+ if (rawType.length === 0 || !Array.isArray(entry?.allowed_transitions)) {
5140
+ return null;
5141
+ }
5142
+ const record = { type: rawType, pairs: [], denyAll: entry.allowed_transitions.length === 0 };
5143
+ for (const pair of entry.allowed_transitions) {
5144
+ appendTypeWorkflowPair(record, pair);
5145
+ }
5146
+ return { typeKey: rawType.toLowerCase(), record };
5147
+ }
5067
5148
  function normalizeTypeWorkflowDefinitions(workflows) {
5068
5149
  if (!Array.isArray(workflows) || workflows.length === 0) {
5069
5150
  return void 0;
5070
5151
  }
5071
5152
  const byTypeKey = /* @__PURE__ */ new Map();
5072
5153
  for (const entry of workflows) {
5073
- const rawType = typeof entry?.type === "string" ? entry.type.trim() : "";
5074
- if (rawType.length === 0) {
5075
- continue;
5076
- }
5077
- if (!Array.isArray(entry?.allowed_transitions)) {
5154
+ const normalized2 = normalizedTypeWorkflowEntry(entry);
5155
+ if (normalized2 === null) {
5078
5156
  continue;
5079
5157
  }
5080
- const typeKey = rawType.toLowerCase();
5081
- const pairs = entry.allowed_transitions;
5082
- const record = byTypeKey.get(typeKey) ?? { type: rawType, pairs: [], denyAll: false };
5083
- if (pairs.length === 0) {
5084
- record.denyAll = true;
5085
- }
5086
- for (const pair of pairs) {
5087
- if (!Array.isArray(pair) || pair.length !== 2) {
5088
- continue;
5089
- }
5090
- const from = normalizeStatusToken(pair[0]);
5091
- const to = normalizeStatusToken(pair[1]);
5092
- if (from.length === 0 || to.length === 0) {
5093
- continue;
5094
- }
5095
- if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {
5096
- continue;
5097
- }
5098
- record.pairs.push([from, to]);
5158
+ const record = byTypeKey.get(normalized2.typeKey) ?? normalized2.record;
5159
+ record.denyAll ||= normalized2.record.denyAll;
5160
+ for (const pair of normalized2.record.pairs) {
5161
+ appendTypeWorkflowPair(record, pair);
5099
5162
  }
5100
- byTypeKey.set(typeKey, record);
5163
+ byTypeKey.set(normalized2.typeKey, record);
5101
5164
  }
5102
5165
  const normalized = [];
5103
5166
  for (const record of byTypeKey.values()) {
@@ -6601,29 +6664,31 @@ function normalizePmMaxVersionExceededModeSetting(value) {
6601
6664
  }
6602
6665
  return void 0;
6603
6666
  }
6667
+ function normalizeExtensionPolicyList(policy, key) {
6668
+ return normalizeLowerStringList(policy?.[key] ?? SETTINGS_DEFAULTS.extensions.policy[key]);
6669
+ }
6604
6670
  function normalizeExtensionPolicySettings(policy) {
6605
- const defaults = SETTINGS_DEFAULTS.extensions.policy;
6606
6671
  const pmMaxVersionExceededMode2 = normalizePmMaxVersionExceededModeSetting(policy?.pm_max_version_exceeded_mode);
6607
6672
  return {
6608
6673
  mode: normalizeExtensionPolicyMode(policy?.mode),
6609
6674
  trust_mode: normalizeExtensionTrustMode(policy?.trust_mode),
6610
6675
  ...pmMaxVersionExceededMode2 !== void 0 ? { pm_max_version_exceeded_mode: pmMaxVersionExceededMode2 } : {},
6611
6676
  require_provenance: policy?.require_provenance === true,
6612
- trusted_extensions: normalizeLowerStringList(policy?.trusted_extensions ?? defaults.trusted_extensions),
6677
+ trusted_extensions: normalizeExtensionPolicyList(policy, "trusted_extensions"),
6613
6678
  default_sandbox_profile: normalizeExtensionSandboxProfile(policy?.default_sandbox_profile),
6614
- allowed_extensions: normalizeLowerStringList(policy?.allowed_extensions ?? defaults.allowed_extensions),
6615
- blocked_extensions: normalizeLowerStringList(policy?.blocked_extensions ?? defaults.blocked_extensions),
6616
- allowed_capabilities: normalizeLowerStringList(policy?.allowed_capabilities ?? defaults.allowed_capabilities),
6617
- blocked_capabilities: normalizeLowerStringList(policy?.blocked_capabilities ?? defaults.blocked_capabilities),
6618
- allowed_surfaces: normalizeLowerStringList(policy?.allowed_surfaces ?? defaults.allowed_surfaces),
6619
- blocked_surfaces: normalizeLowerStringList(policy?.blocked_surfaces ?? defaults.blocked_surfaces),
6620
- allowed_commands: normalizeLowerStringList(policy?.allowed_commands ?? defaults.allowed_commands),
6621
- blocked_commands: normalizeLowerStringList(policy?.blocked_commands ?? defaults.blocked_commands),
6622
- allowed_actions: normalizeLowerStringList(policy?.allowed_actions ?? defaults.allowed_actions),
6623
- blocked_actions: normalizeLowerStringList(policy?.blocked_actions ?? defaults.blocked_actions),
6624
- allowed_services: normalizeLowerStringList(policy?.allowed_services ?? defaults.allowed_services),
6625
- blocked_services: normalizeLowerStringList(policy?.blocked_services ?? defaults.blocked_services),
6626
- extension_overrides: normalizeExtensionPolicyOverrides(policy?.extension_overrides ?? defaults.extension_overrides)
6679
+ allowed_extensions: normalizeExtensionPolicyList(policy, "allowed_extensions"),
6680
+ blocked_extensions: normalizeExtensionPolicyList(policy, "blocked_extensions"),
6681
+ allowed_capabilities: normalizeExtensionPolicyList(policy, "allowed_capabilities"),
6682
+ blocked_capabilities: normalizeExtensionPolicyList(policy, "blocked_capabilities"),
6683
+ allowed_surfaces: normalizeExtensionPolicyList(policy, "allowed_surfaces"),
6684
+ blocked_surfaces: normalizeExtensionPolicyList(policy, "blocked_surfaces"),
6685
+ allowed_commands: normalizeExtensionPolicyList(policy, "allowed_commands"),
6686
+ blocked_commands: normalizeExtensionPolicyList(policy, "blocked_commands"),
6687
+ allowed_actions: normalizeExtensionPolicyList(policy, "allowed_actions"),
6688
+ blocked_actions: normalizeExtensionPolicyList(policy, "blocked_actions"),
6689
+ allowed_services: normalizeExtensionPolicyList(policy, "allowed_services"),
6690
+ blocked_services: normalizeExtensionPolicyList(policy, "blocked_services"),
6691
+ extension_overrides: normalizeExtensionPolicyOverrides(policy?.extension_overrides ?? SETTINGS_DEFAULTS.extensions.policy.extension_overrides)
6627
6692
  };
6628
6693
  }
6629
6694
  function normalizeValidationMetadataRequiredFields(values) {
@@ -6652,6 +6717,81 @@ function recordOrEmpty(value) {
6652
6717
  function arrayOrEmpty(value) {
6653
6718
  return Array.isArray(value) ? value : [];
6654
6719
  }
6720
+ function buildValidationSettings(settings, defaults, governance) {
6721
+ return {
6722
+ ...defaults.validation,
6723
+ ...settings.validation,
6724
+ parent_reference: governance.parent_reference,
6725
+ metadata_profile: governance.metadata_profile,
6726
+ metadata_required_fields: normalizeValidationMetadataRequiredFields(settings.validation?.metadata_required_fields),
6727
+ lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_stale_blocker_reason_patterns ?? defaults.validation.lifecycle_stale_blocker_reason_patterns),
6728
+ lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? defaults.validation.lifecycle_closure_like_blocked_reason_patterns),
6729
+ lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_resolution_patterns ?? defaults.validation.lifecycle_closure_like_resolution_patterns),
6730
+ lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_actual_result_patterns ?? defaults.validation.lifecycle_closure_like_actual_result_patterns),
6731
+ estimate_defaults_by_type: normalizeEstimateDefaultOverrides(settings.validation?.estimate_defaults_by_type)
6732
+ };
6733
+ }
6734
+ function buildTelemetrySettings(settings, defaults) {
6735
+ return {
6736
+ enabled: settings.telemetry?.enabled ?? defaults.telemetry.enabled,
6737
+ first_run_prompt_completed: settings.telemetry?.first_run_prompt_completed ?? defaults.telemetry.first_run_prompt_completed,
6738
+ capture_level: settings.telemetry?.capture_level ?? defaults.telemetry.capture_level,
6739
+ endpoint: settings.telemetry?.endpoint ?? defaults.telemetry.endpoint,
6740
+ installation_id: settings.telemetry?.installation_id ?? defaults.telemetry.installation_id,
6741
+ retention_days: settings.telemetry?.retention_days ?? defaults.telemetry.retention_days
6742
+ };
6743
+ }
6744
+ function buildSearchSettings(settings, defaults) {
6745
+ return {
6746
+ ...defaults.search,
6747
+ ...settings.search,
6748
+ mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(settings.search?.mutation_refresh_policy),
6749
+ query_expansion: {
6750
+ ...defaults.search.query_expansion,
6751
+ ...settings.search?.query_expansion,
6752
+ enabled: normalizeSearchQueryExpansionEnabled(settings.search?.query_expansion?.enabled),
6753
+ provider: normalizeSearchQueryExpansionProvider(settings.search?.query_expansion?.provider)
6754
+ },
6755
+ rerank: {
6756
+ ...defaults.search.rerank,
6757
+ ...settings.search?.rerank,
6758
+ enabled: normalizeSearchRerankEnabled(settings.search?.rerank?.enabled),
6759
+ model: normalizeSearchRerankModel(settings.search?.rerank?.model),
6760
+ top_k: normalizeSearchRerankTopK(settings.search?.rerank?.top_k)
6761
+ }
6762
+ };
6763
+ }
6764
+ function buildVectorStoreSettings(settings, defaults) {
6765
+ return {
6766
+ adapter: settings.vector_store.adapter ?? defaults.vector_store.adapter,
6767
+ collection_name: normalizeVectorStoreCollectionName(settings.vector_store.collection_name),
6768
+ qdrant: { ...defaults.vector_store.qdrant, ...settings.vector_store.qdrant },
6769
+ lancedb: { ...defaults.vector_store.lancedb, ...settings.vector_store.lancedb }
6770
+ };
6771
+ }
6772
+ function normalizeSettingsItemFormat(settings, defaults) {
6773
+ if (settings.item_format === "json_markdown") {
6774
+ return "toon";
6775
+ }
6776
+ return settings.item_format ?? defaults.item_format;
6777
+ }
6778
+ function buildContextSettings(settings, defaults) {
6779
+ return {
6780
+ default_depth: settings.context?.default_depth ?? defaults.context.default_depth,
6781
+ activity_limit: settings.context?.activity_limit ?? defaults.context.activity_limit,
6782
+ stale_threshold_days: settings.context?.stale_threshold_days ?? defaults.context.stale_threshold_days,
6783
+ sections: {
6784
+ ...defaults.context.sections,
6785
+ ...settings.context?.sections
6786
+ }
6787
+ };
6788
+ }
6789
+ function buildProviderSettings(settings, defaults) {
6790
+ return {
6791
+ openai: { ...defaults.providers.openai, ...settings.providers.openai },
6792
+ ollama: { ...defaults.providers.ollama, ...settings.providers.ollama }
6793
+ };
6794
+ }
6655
6795
  function normalizeItemTypeDefinitions(definitions) {
6656
6796
  const normalized = (definitions ?? []).map((definition) => normalizeItemTypeDefinition(definition)).filter((definition) => definition !== null);
6657
6797
  const dedupedByName = /* @__PURE__ */ new Map();
@@ -6668,7 +6808,7 @@ function mergeSettings(settings) {
6668
6808
  return {
6669
6809
  ...defaults,
6670
6810
  ...settings,
6671
- item_format: settings.item_format === "json_markdown" ? "toon" : settings.item_format ?? defaults.item_format,
6811
+ item_format: normalizeSettingsItemFormat(settings, defaults),
6672
6812
  locks: { ...defaults.locks, ...settings.locks },
6673
6813
  checkpoints: { ...defaults.checkpoints, ...settings.checkpoints },
6674
6814
  output: { ...defaults.output, ...settings.output },
@@ -6680,18 +6820,7 @@ function mergeSettings(settings) {
6680
6820
  ...settings.history?.compact_policy
6681
6821
  }
6682
6822
  },
6683
- validation: {
6684
- ...defaults.validation,
6685
- ...settings.validation,
6686
- parent_reference: governance.parent_reference,
6687
- metadata_profile: governance.metadata_profile,
6688
- metadata_required_fields: normalizeValidationMetadataRequiredFields(settings.validation?.metadata_required_fields),
6689
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_stale_blocker_reason_patterns ?? defaults.validation.lifecycle_stale_blocker_reason_patterns),
6690
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? defaults.validation.lifecycle_closure_like_blocked_reason_patterns),
6691
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_resolution_patterns ?? defaults.validation.lifecycle_closure_like_resolution_patterns),
6692
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_actual_result_patterns ?? defaults.validation.lifecycle_closure_like_actual_result_patterns),
6693
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(settings.validation?.estimate_defaults_by_type)
6694
- },
6823
+ validation: buildValidationSettings(settings, defaults, governance),
6695
6824
  governance,
6696
6825
  workflow: {
6697
6826
  definition_of_done: [...settings.workflow?.definition_of_done ?? defaults.workflow.definition_of_done]
@@ -6699,177 +6828,24 @@ function mergeSettings(settings) {
6699
6828
  testing: {
6700
6829
  record_results_to_items: settings.testing?.record_results_to_items ?? defaults.testing.record_results_to_items
6701
6830
  },
6702
- telemetry: {
6703
- enabled: settings.telemetry?.enabled ?? defaults.telemetry.enabled,
6704
- first_run_prompt_completed: settings.telemetry?.first_run_prompt_completed ?? defaults.telemetry.first_run_prompt_completed,
6705
- capture_level: settings.telemetry?.capture_level ?? defaults.telemetry.capture_level,
6706
- endpoint: settings.telemetry?.endpoint ?? defaults.telemetry.endpoint,
6707
- installation_id: settings.telemetry?.installation_id ?? defaults.telemetry.installation_id,
6708
- retention_days: settings.telemetry?.retention_days ?? defaults.telemetry.retention_days
6709
- },
6831
+ telemetry: buildTelemetrySettings(settings, defaults),
6710
6832
  agent_guidance: normalizeAgentGuidanceSettings(settings.agent_guidance ?? defaults.agent_guidance),
6711
6833
  item_types: {
6712
6834
  definitions: normalizeItemTypeDefinitions(settings.item_types?.definitions)
6713
6835
  },
6714
6836
  schema: normalizeRuntimeSchemaSettings(settings.schema ?? defaults.schema),
6715
- context: {
6716
- default_depth: settings.context?.default_depth ?? defaults.context.default_depth,
6717
- activity_limit: settings.context?.activity_limit ?? defaults.context.activity_limit,
6718
- stale_threshold_days: settings.context?.stale_threshold_days ?? defaults.context.stale_threshold_days,
6719
- sections: {
6720
- ...defaults.context.sections,
6721
- ...settings.context?.sections
6722
- }
6723
- },
6837
+ context: buildContextSettings(settings, defaults),
6724
6838
  extensions: {
6725
6839
  enabled: [...settings.extensions.enabled],
6726
6840
  disabled: [...settings.extensions.disabled],
6727
6841
  policy: normalizeExtensionPolicySettings(settings.extensions.policy ?? defaults.extensions.policy)
6728
6842
  },
6729
- search: {
6730
- ...defaults.search,
6731
- ...settings.search,
6732
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(settings.search?.mutation_refresh_policy),
6733
- query_expansion: {
6734
- ...defaults.search.query_expansion,
6735
- ...settings.search?.query_expansion,
6736
- enabled: normalizeSearchQueryExpansionEnabled(settings.search?.query_expansion?.enabled),
6737
- provider: normalizeSearchQueryExpansionProvider(settings.search?.query_expansion?.provider)
6738
- },
6739
- rerank: {
6740
- ...defaults.search.rerank,
6741
- ...settings.search?.rerank,
6742
- enabled: normalizeSearchRerankEnabled(settings.search?.rerank?.enabled),
6743
- model: normalizeSearchRerankModel(settings.search?.rerank?.model),
6744
- top_k: normalizeSearchRerankTopK(settings.search?.rerank?.top_k)
6745
- }
6746
- },
6747
- providers: {
6748
- openai: { ...defaults.providers.openai, ...settings.providers.openai },
6749
- ollama: { ...defaults.providers.ollama, ...settings.providers.ollama }
6750
- },
6751
- vector_store: {
6752
- adapter: settings.vector_store.adapter ?? defaults.vector_store.adapter,
6753
- collection_name: normalizeVectorStoreCollectionName(settings.vector_store.collection_name),
6754
- qdrant: { ...defaults.vector_store.qdrant, ...settings.vector_store.qdrant },
6755
- lancedb: { ...defaults.vector_store.lancedb, ...settings.vector_store.lancedb }
6756
- }
6843
+ search: buildSearchSettings(settings, defaults),
6844
+ providers: buildProviderSettings(settings, defaults),
6845
+ vector_store: buildVectorStoreSettings(settings, defaults)
6757
6846
  };
6758
6847
  }
6759
- function serializeSettings(settings, options = {}) {
6760
- const baseSettings = {
6761
- ...settings,
6762
- locks: valueOrDefault(settings.locks, SETTINGS_DEFAULTS.locks),
6763
- checkpoints: valueOrDefault(settings.checkpoints, SETTINGS_DEFAULTS.checkpoints),
6764
- output: valueOrDefault(settings.output, SETTINGS_DEFAULTS.output),
6765
- history: valueOrDefault(settings.history, SETTINGS_DEFAULTS.history),
6766
- validation: valueOrDefault(settings.validation, SETTINGS_DEFAULTS.validation),
6767
- workflow: valueOrDefault(settings.workflow, SETTINGS_DEFAULTS.workflow),
6768
- testing: valueOrDefault(settings.testing, SETTINGS_DEFAULTS.testing),
6769
- telemetry: valueOrDefault(settings.telemetry, SETTINGS_DEFAULTS.telemetry),
6770
- agent_guidance: valueOrDefault(settings.agent_guidance, SETTINGS_DEFAULTS.agent_guidance),
6771
- item_types: valueOrDefault(settings.item_types, SETTINGS_DEFAULTS.item_types),
6772
- schema: valueOrDefault(settings.schema, SETTINGS_DEFAULTS.schema),
6773
- context: valueOrDefault(settings.context, SETTINGS_DEFAULTS.context),
6774
- extensions: valueOrDefault(settings.extensions, SETTINGS_DEFAULTS.extensions),
6775
- search: valueOrDefault(settings.search, SETTINGS_DEFAULTS.search),
6776
- providers: valueOrDefault(settings.providers, SETTINGS_DEFAULTS.providers),
6777
- vector_store: valueOrDefault(settings.vector_store, SETTINGS_DEFAULTS.vector_store)
6778
- };
6779
- const governance = resolveGovernanceKnobs(baseSettings);
6780
- const normalizedSchema = normalizeRuntimeSchemaSettings(baseSettings.schema);
6781
- const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(baseSettings, options.persist_source);
6782
- const normalizedSettings = {
6783
- ...baseSettings,
6784
- item_format: "toon",
6785
- validation: {
6786
- ...baseSettings.validation,
6787
- parent_reference: governance.parent_reference,
6788
- metadata_profile: governance.metadata_profile,
6789
- metadata_required_fields: normalizeValidationMetadataRequiredFields(baseSettings.validation?.metadata_required_fields),
6790
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_stale_blocker_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_stale_blocker_reason_patterns),
6791
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_blocked_reason_patterns),
6792
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_resolution_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_resolution_patterns),
6793
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_actual_result_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_actual_result_patterns),
6794
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(baseSettings.validation?.estimate_defaults_by_type)
6795
- },
6796
- governance,
6797
- agent_guidance: normalizeAgentGuidanceSettings(baseSettings.agent_guidance),
6798
- item_types: {
6799
- definitions: persistedFileBackedSections.item_type_definitions
6800
- },
6801
- schema: {
6802
- ...normalizedSchema,
6803
- statuses: persistedFileBackedSections.schema_statuses,
6804
- fields: persistedFileBackedSections.schema_fields,
6805
- type_workflows: persistedFileBackedSections.schema_type_workflows
6806
- },
6807
- search: {
6808
- ...SETTINGS_DEFAULTS.search,
6809
- ...baseSettings.search,
6810
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(baseSettings.search?.mutation_refresh_policy),
6811
- query_expansion: {
6812
- ...SETTINGS_DEFAULTS.search.query_expansion,
6813
- ...baseSettings.search?.query_expansion,
6814
- enabled: normalizeSearchQueryExpansionEnabled(baseSettings.search?.query_expansion?.enabled),
6815
- provider: normalizeSearchQueryExpansionProvider(baseSettings.search?.query_expansion?.provider)
6816
- },
6817
- rerank: {
6818
- ...SETTINGS_DEFAULTS.search.rerank,
6819
- ...baseSettings.search?.rerank,
6820
- enabled: normalizeSearchRerankEnabled(baseSettings.search?.rerank?.enabled),
6821
- model: normalizeSearchRerankModel(baseSettings.search?.rerank?.model),
6822
- top_k: normalizeSearchRerankTopK(baseSettings.search?.rerank?.top_k)
6823
- }
6824
- },
6825
- context: {
6826
- default_depth: baseSettings.context?.default_depth ?? SETTINGS_DEFAULTS.context.default_depth,
6827
- activity_limit: baseSettings.context?.activity_limit ?? SETTINGS_DEFAULTS.context.activity_limit,
6828
- stale_threshold_days: baseSettings.context?.stale_threshold_days ?? SETTINGS_DEFAULTS.context.stale_threshold_days,
6829
- sections: {
6830
- ...SETTINGS_DEFAULTS.context.sections,
6831
- ...baseSettings.context?.sections
6832
- }
6833
- },
6834
- extensions: {
6835
- enabled: normalizeStringList2(baseSettings.extensions?.enabled),
6836
- disabled: normalizeStringList2(baseSettings.extensions?.disabled),
6837
- policy: normalizeExtensionPolicySettings(baseSettings.extensions?.policy)
6838
- },
6839
- vector_store: {
6840
- ...baseSettings.vector_store,
6841
- adapter: baseSettings.vector_store?.adapter ?? SETTINGS_DEFAULTS.vector_store.adapter,
6842
- collection_name: normalizeVectorStoreCollectionName(baseSettings.vector_store?.collection_name),
6843
- qdrant: { ...baseSettings.vector_store?.qdrant },
6844
- lancedb: { ...baseSettings.vector_store?.lancedb }
6845
- }
6846
- };
6847
- const ordered = orderObject({
6848
- ...normalizedSettings,
6849
- governance: normalizeGovernanceForPersist(governance)
6850
- }, [
6851
- "version",
6852
- "id_prefix",
6853
- "author_default",
6854
- "item_format",
6855
- "locks",
6856
- "checkpoints",
6857
- "output",
6858
- "history",
6859
- "validation",
6860
- "governance",
6861
- "workflow",
6862
- "testing",
6863
- "telemetry",
6864
- "agent_guidance",
6865
- "item_types",
6866
- "schema",
6867
- "context",
6868
- "extensions",
6869
- "search",
6870
- "providers",
6871
- "vector_store"
6872
- ]);
6848
+ function orderSerializedSettingsSections(ordered) {
6873
6849
  ordered.locks = orderObject(ordered.locks, ["ttl_seconds"]);
6874
6850
  ordered.checkpoints = orderObject(ordered.checkpoints, ["retention_days"]);
6875
6851
  ordered.output = orderObject(ordered.output, ["default_format"]);
@@ -6999,6 +6975,140 @@ function serializeSettings(settings, options = {}) {
6999
6975
  ]);
7000
6976
  ordered.vector_store.qdrant = orderObject(recordOrEmpty(ordered.vector_store.qdrant), ["url", "api_key"]);
7001
6977
  ordered.vector_store.lancedb = orderObject(recordOrEmpty(ordered.vector_store.lancedb), ["path"]);
6978
+ }
6979
+ function buildSerializeBaseSettings(settings) {
6980
+ return {
6981
+ ...settings,
6982
+ locks: valueOrDefault(settings.locks, SETTINGS_DEFAULTS.locks),
6983
+ checkpoints: valueOrDefault(settings.checkpoints, SETTINGS_DEFAULTS.checkpoints),
6984
+ output: valueOrDefault(settings.output, SETTINGS_DEFAULTS.output),
6985
+ history: valueOrDefault(settings.history, SETTINGS_DEFAULTS.history),
6986
+ validation: valueOrDefault(settings.validation, SETTINGS_DEFAULTS.validation),
6987
+ workflow: valueOrDefault(settings.workflow, SETTINGS_DEFAULTS.workflow),
6988
+ testing: valueOrDefault(settings.testing, SETTINGS_DEFAULTS.testing),
6989
+ telemetry: valueOrDefault(settings.telemetry, SETTINGS_DEFAULTS.telemetry),
6990
+ agent_guidance: valueOrDefault(settings.agent_guidance, SETTINGS_DEFAULTS.agent_guidance),
6991
+ item_types: valueOrDefault(settings.item_types, SETTINGS_DEFAULTS.item_types),
6992
+ schema: valueOrDefault(settings.schema, SETTINGS_DEFAULTS.schema),
6993
+ context: valueOrDefault(settings.context, SETTINGS_DEFAULTS.context),
6994
+ extensions: valueOrDefault(settings.extensions, SETTINGS_DEFAULTS.extensions),
6995
+ search: valueOrDefault(settings.search, SETTINGS_DEFAULTS.search),
6996
+ providers: valueOrDefault(settings.providers, SETTINGS_DEFAULTS.providers),
6997
+ vector_store: valueOrDefault(settings.vector_store, SETTINGS_DEFAULTS.vector_store)
6998
+ };
6999
+ }
7000
+ function buildSerializedValidationSettings(baseSettings, governance) {
7001
+ return {
7002
+ ...baseSettings.validation,
7003
+ parent_reference: governance.parent_reference,
7004
+ metadata_profile: governance.metadata_profile,
7005
+ metadata_required_fields: normalizeValidationMetadataRequiredFields(baseSettings.validation?.metadata_required_fields),
7006
+ lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_stale_blocker_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_stale_blocker_reason_patterns),
7007
+ lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_blocked_reason_patterns),
7008
+ lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_resolution_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_resolution_patterns),
7009
+ lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_actual_result_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_actual_result_patterns),
7010
+ estimate_defaults_by_type: normalizeEstimateDefaultOverrides(baseSettings.validation?.estimate_defaults_by_type)
7011
+ };
7012
+ }
7013
+ function buildSerializedSearchSettings(baseSettings) {
7014
+ return {
7015
+ ...SETTINGS_DEFAULTS.search,
7016
+ ...baseSettings.search,
7017
+ mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(baseSettings.search?.mutation_refresh_policy),
7018
+ query_expansion: {
7019
+ ...SETTINGS_DEFAULTS.search.query_expansion,
7020
+ ...baseSettings.search?.query_expansion,
7021
+ enabled: normalizeSearchQueryExpansionEnabled(baseSettings.search?.query_expansion?.enabled),
7022
+ provider: normalizeSearchQueryExpansionProvider(baseSettings.search?.query_expansion?.provider)
7023
+ },
7024
+ rerank: {
7025
+ ...SETTINGS_DEFAULTS.search.rerank,
7026
+ ...baseSettings.search?.rerank,
7027
+ enabled: normalizeSearchRerankEnabled(baseSettings.search?.rerank?.enabled),
7028
+ model: normalizeSearchRerankModel(baseSettings.search?.rerank?.model),
7029
+ top_k: normalizeSearchRerankTopK(baseSettings.search?.rerank?.top_k)
7030
+ }
7031
+ };
7032
+ }
7033
+ function buildSerializedContextSettings(baseSettings) {
7034
+ return {
7035
+ default_depth: baseSettings.context?.default_depth ?? SETTINGS_DEFAULTS.context.default_depth,
7036
+ activity_limit: baseSettings.context?.activity_limit ?? SETTINGS_DEFAULTS.context.activity_limit,
7037
+ stale_threshold_days: baseSettings.context?.stale_threshold_days ?? SETTINGS_DEFAULTS.context.stale_threshold_days,
7038
+ sections: {
7039
+ ...SETTINGS_DEFAULTS.context.sections,
7040
+ ...baseSettings.context?.sections
7041
+ }
7042
+ };
7043
+ }
7044
+ function buildSerializedVectorStoreSettings(baseSettings) {
7045
+ return {
7046
+ ...baseSettings.vector_store,
7047
+ adapter: baseSettings.vector_store?.adapter ?? SETTINGS_DEFAULTS.vector_store.adapter,
7048
+ collection_name: normalizeVectorStoreCollectionName(baseSettings.vector_store?.collection_name),
7049
+ qdrant: { ...baseSettings.vector_store?.qdrant },
7050
+ lancedb: { ...baseSettings.vector_store?.lancedb }
7051
+ };
7052
+ }
7053
+ function buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections) {
7054
+ return {
7055
+ ...baseSettings,
7056
+ item_format: "toon",
7057
+ validation: buildSerializedValidationSettings(baseSettings, governance),
7058
+ governance,
7059
+ agent_guidance: normalizeAgentGuidanceSettings(baseSettings.agent_guidance),
7060
+ item_types: {
7061
+ definitions: persistedFileBackedSections.item_type_definitions
7062
+ },
7063
+ schema: {
7064
+ ...normalizedSchema,
7065
+ statuses: persistedFileBackedSections.schema_statuses,
7066
+ fields: persistedFileBackedSections.schema_fields,
7067
+ type_workflows: persistedFileBackedSections.schema_type_workflows
7068
+ },
7069
+ search: buildSerializedSearchSettings(baseSettings),
7070
+ context: buildSerializedContextSettings(baseSettings),
7071
+ extensions: {
7072
+ enabled: normalizeStringList2(baseSettings.extensions?.enabled),
7073
+ disabled: normalizeStringList2(baseSettings.extensions?.disabled),
7074
+ policy: normalizeExtensionPolicySettings(baseSettings.extensions?.policy)
7075
+ },
7076
+ vector_store: buildSerializedVectorStoreSettings(baseSettings)
7077
+ };
7078
+ }
7079
+ function serializeSettings(settings, options = {}) {
7080
+ const baseSettings = buildSerializeBaseSettings(settings);
7081
+ const governance = resolveGovernanceKnobs(baseSettings);
7082
+ const normalizedSchema = normalizeRuntimeSchemaSettings(baseSettings.schema);
7083
+ const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(baseSettings, options.persist_source);
7084
+ const normalizedSettings = buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections);
7085
+ const ordered = orderObject({
7086
+ ...normalizedSettings,
7087
+ governance: normalizeGovernanceForPersist(governance)
7088
+ }, [
7089
+ "version",
7090
+ "id_prefix",
7091
+ "author_default",
7092
+ "item_format",
7093
+ "locks",
7094
+ "checkpoints",
7095
+ "output",
7096
+ "history",
7097
+ "validation",
7098
+ "governance",
7099
+ "workflow",
7100
+ "testing",
7101
+ "telemetry",
7102
+ "agent_guidance",
7103
+ "item_types",
7104
+ "schema",
7105
+ "context",
7106
+ "extensions",
7107
+ "search",
7108
+ "providers",
7109
+ "vector_store"
7110
+ ]);
7111
+ orderSerializedSettingsSections(ordered);
7002
7112
  return `${JSON.stringify(ordered, null, 2)}
7003
7113
  `;
7004
7114
  }
@@ -7260,6 +7370,6 @@ export {
7260
7370
  readSettings,
7261
7371
  writeSettings
7262
7372
  };
7263
- //# sourceMappingURL=chunk-CY5IJMUM.js.map
7373
+ //# sourceMappingURL=chunk-I66WE2HE.js.map
7264
7374
 
7265
- //# debugId=b452df4b-661b-5f08-9d20-dff37c4bfb2f
7375
+ //# debugId=a360c40f-2d95-561b-8d26-69af3a10c107