@unbrained/pm-cli 2026.7.19 → 2026.7.20

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 (600) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +2 -0
  3. package/CHANGELOG.md +36 -0
  4. package/dist/cli/commands/append.js +13 -6
  5. package/dist/cli/commands/append.js.map +1 -1
  6. package/dist/cli/commands/calendar.d.ts +1 -1
  7. package/dist/cli/commands/calendar.js +2 -2
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/comments.js +2 -5
  10. package/dist/cli/commands/comments.js.map +1 -1
  11. package/dist/cli/commands/completion.js +11 -3
  12. package/dist/cli/commands/completion.js.map +1 -1
  13. package/dist/cli/commands/context.d.ts +1 -1
  14. package/dist/cli/commands/context.js +2 -2
  15. package/dist/cli/commands/context.js.map +1 -1
  16. package/dist/cli/commands/contracts.js +4 -3
  17. package/dist/cli/commands/contracts.js.map +1 -1
  18. package/dist/cli/commands/copy.js +5 -3
  19. package/dist/cli/commands/copy.js.map +1 -1
  20. package/dist/cli/commands/create.d.ts +3 -1
  21. package/dist/cli/commands/create.js +5 -3
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/merge.d.ts +8 -0
  24. package/dist/cli/commands/merge.js +12 -0
  25. package/dist/cli/commands/merge.js.map +1 -0
  26. package/dist/cli/commands/plan.d.ts +1 -1
  27. package/dist/cli/commands/plan.js +2 -2
  28. package/dist/cli/commands/plan.js.map +1 -1
  29. package/dist/cli/commands/update-many.d.ts +5 -0
  30. package/dist/cli/commands/update-many.js +81 -6
  31. package/dist/cli/commands/update-many.js.map +1 -1
  32. package/dist/cli/commands/update.d.ts +5 -1
  33. package/dist/cli/commands/update.js +50 -4
  34. package/dist/cli/commands/update.js.map +1 -1
  35. package/dist/cli/register-list-query.js +14 -2
  36. package/dist/cli/register-list-query.js.map +1 -1
  37. package/dist/cli/register-mutation.js +61 -2
  38. package/dist/cli/register-mutation.js.map +1 -1
  39. package/dist/cli/register-operations.js +5 -3
  40. package/dist/cli/register-operations.js.map +1 -1
  41. package/dist/cli/registration-helpers.js +4 -2
  42. package/dist/cli/registration-helpers.js.map +1 -1
  43. package/dist/cli-bundle/bundle-manifest.json +365 -333
  44. package/dist/cli-bundle/chunks/{append-MBXHNWSX.js → append-E6V54WOQ.js} +5 -5
  45. package/dist/cli-bundle/chunks/append-NNJ3EFIT.js +11 -0
  46. package/dist/cli-bundle/chunks/{chunk-M4B4RK4J.js → chunk-2BO4CA46.js} +14 -238
  47. package/dist/cli-bundle/chunks/{chunk-M4B4RK4J.js.map → chunk-2BO4CA46.js.map} +1 -1
  48. package/dist/cli-bundle/chunks/{chunk-MQOSMBWV.js → chunk-3AO5VSDR.js} +25 -6
  49. package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +7 -0
  50. package/dist/cli-bundle/chunks/{chunk-ODEIDKGW.js → chunk-3LPFHE3P.js} +596 -154
  51. package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +1 -0
  52. package/dist/cli-bundle/chunks/{chunk-YGEA4CLH.js → chunk-3MCTMJXI.js} +4 -4
  53. package/dist/cli-bundle/chunks/{chunk-N7FCFJ76.js → chunk-3P7UJQOX.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-7B7IHMLH.js → chunk-3VY6MIEO.js} +3 -3
  55. package/dist/cli-bundle/chunks/{chunk-3EZZTFL2.js → chunk-4F6BWJ4J.js} +51 -43
  56. package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +7 -0
  57. package/dist/cli-bundle/chunks/{chunk-VA3H7VVC.js → chunk-4L23AGQ7.js} +9 -7
  58. package/dist/cli-bundle/chunks/chunk-4L23AGQ7.js.map +1 -0
  59. package/dist/cli-bundle/chunks/{chunk-5S6IZXK7.js → chunk-4U4Z6AHI.js} +7 -7
  60. package/dist/cli-bundle/chunks/{chunk-UOIFZ66L.js → chunk-4XGJLADW.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-SUNZKVAH.js → chunk-5IZJWSDB.js} +5 -5
  62. package/dist/cli-bundle/chunks/{chunk-QQ77W23U.js → chunk-5NTE36LD.js} +4 -4
  63. package/dist/cli-bundle/chunks/{chunk-EVAN5VJA.js → chunk-5OK4UGFV.js} +5 -8
  64. package/dist/cli-bundle/chunks/{chunk-EVAN5VJA.js.map → chunk-5OK4UGFV.js.map} +2 -2
  65. package/dist/cli-bundle/chunks/{chunk-H3YKUVDR.js → chunk-5UX66S6U.js} +26 -7
  66. package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +1 -0
  67. package/dist/cli-bundle/chunks/{chunk-KGPLSHJD.js → chunk-6C2ZZX5Z.js} +2 -2
  68. package/dist/cli-bundle/chunks/{chunk-Q5NHJ6RO.js → chunk-6JUTHVQS.js} +2 -2
  69. package/dist/cli-bundle/chunks/{chunk-NTS2RKHN.js → chunk-6VIJ7UA5.js} +15 -15
  70. package/dist/cli-bundle/chunks/{chunk-BBGR4FKQ.js → chunk-6XMUURSS.js} +6 -6
  71. package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-XVB6BATY.js → chunk-72LQ4TKV.js} +3 -3
  73. package/dist/cli-bundle/chunks/{chunk-WCBB6VI3.js → chunk-7AVEY74G.js} +8 -5
  74. package/dist/cli-bundle/chunks/chunk-7AVEY74G.js.map +7 -0
  75. package/dist/cli-bundle/chunks/{chunk-YG56M3NE.js → chunk-7DOJC3HS.js} +8 -8
  76. package/dist/cli-bundle/chunks/chunk-7DOJC3HS.js.map +1 -0
  77. package/dist/cli-bundle/chunks/{chunk-KZ5AC6B5.js → chunk-7WCE6Y64.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-VQOG2ETB.js → chunk-AF2CCM5U.js} +4 -4
  79. package/dist/cli-bundle/chunks/{chunk-P24ZU5QV.js → chunk-AOEOYL3S.js} +49 -12
  80. package/dist/cli-bundle/chunks/chunk-AOEOYL3S.js.map +7 -0
  81. package/dist/cli-bundle/chunks/{chunk-BZKE2O5V.js → chunk-BKIAH72N.js} +8 -6
  82. package/dist/cli-bundle/chunks/chunk-BKIAH72N.js.map +1 -0
  83. package/dist/cli-bundle/chunks/{chunk-RWAIRGBC.js → chunk-C3KD7U3T.js} +12 -243
  84. package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +7 -0
  85. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +334 -0
  86. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{chunk-TELI67UP.js → chunk-CQTQKUUV.js} +6 -9
  88. package/dist/cli-bundle/chunks/{chunk-TELI67UP.js.map → chunk-CQTQKUUV.js.map} +1 -1
  89. package/dist/cli-bundle/chunks/{chunk-ZUCBPXNA.js → chunk-D6NXDNP3.js} +5 -5
  90. package/dist/cli-bundle/chunks/chunk-D6NXDNP3.js.map +7 -0
  91. package/dist/cli-bundle/chunks/{chunk-EAV3P54W.js → chunk-DAQ45GCS.js} +5 -5
  92. package/dist/cli-bundle/chunks/{chunk-6V4T4RD3.js → chunk-DVDBQA3B.js} +79 -22
  93. package/dist/cli-bundle/chunks/chunk-DVDBQA3B.js.map +1 -0
  94. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +249 -0
  95. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +7 -0
  96. package/dist/cli-bundle/chunks/{chunk-ZF52NVRT.js → chunk-E7ICD63T.js} +131 -179
  97. package/dist/cli-bundle/chunks/chunk-E7ICD63T.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-RX53WHFI.js → chunk-EJDGV4GR.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-IXG5CMBR.js → chunk-FDHPAVVB.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-KAE727L2.js → chunk-FSRHYUDA.js} +2 -2
  101. package/dist/cli-bundle/chunks/chunk-FSRHYUDA.js.map +7 -0
  102. package/dist/cli-bundle/chunks/{chunk-46Z6FAVP.js → chunk-G3COA6GS.js} +51 -43
  103. package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-A4FVWFZY.js → chunk-GFQP7HAZ.js} +8 -6
  105. package/dist/cli-bundle/chunks/chunk-GFQP7HAZ.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-2XPDCXK5.js → chunk-GIQSU6S2.js} +6 -6
  107. package/dist/cli-bundle/chunks/chunk-GIQSU6S2.js.map +1 -0
  108. package/dist/cli-bundle/chunks/{chunk-V4QHAMI5.js → chunk-GROYI4RB.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-77XFQRTD.js → chunk-GSJSM5BJ.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-QYGK2XQ3.js → chunk-GTLCVJOE.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-VSQE43NO.js → chunk-GV2262OF.js} +4 -4
  112. package/dist/cli-bundle/chunks/{chunk-N2TEEOXJ.js → chunk-GVI6FAFG.js} +8 -6
  113. package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-A5EQPNV7.js → chunk-GVT754PX.js} +44 -3
  115. package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-Y2VSGFT4.js → chunk-HB3P4M52.js} +22 -7
  117. package/dist/cli-bundle/chunks/chunk-HB3P4M52.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-STBCBDKF.js → chunk-HCEBZNC3.js} +6 -6
  119. package/dist/cli-bundle/chunks/{chunk-EEECAV5M.js → chunk-HEWM6CEN.js} +80 -25
  120. package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +7 -0
  121. package/dist/cli-bundle/chunks/{chunk-GKCEEXMA.js → chunk-HQ3SB4CN.js} +21 -6
  122. package/dist/cli-bundle/chunks/{chunk-GKCEEXMA.js.map → chunk-HQ3SB4CN.js.map} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-U6RYD446.js → chunk-HRW7GF6T.js} +7 -7
  124. package/dist/cli-bundle/chunks/{chunk-D35WYXWC.js → chunk-HYW67VJ5.js} +6 -3
  125. package/dist/cli-bundle/chunks/chunk-HYW67VJ5.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-OKWJUL6F.js → chunk-I577UHC7.js} +16 -9
  127. package/dist/cli-bundle/chunks/{chunk-OKWJUL6F.js.map → chunk-I577UHC7.js.map} +2 -2
  128. package/dist/cli-bundle/chunks/{chunk-XDWXPG2E.js → chunk-IAQE32BI.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-66SRNEBK.js → chunk-IJNK6WW2.js} +3 -3
  130. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js +623 -0
  131. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-A3GAQLBH.js → chunk-IX677TRO.js} +75 -12
  133. package/dist/cli-bundle/chunks/chunk-IX677TRO.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-RLLOZAM2.js → chunk-IY6VZ3IW.js} +29 -8
  135. package/dist/cli-bundle/chunks/chunk-IY6VZ3IW.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-SVAWG7EE.js → chunk-J4FBIFU6.js} +45 -4
  137. package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-AGEBQRBG.js → chunk-JAPE62Y5.js} +9 -9
  139. package/dist/cli-bundle/chunks/{chunk-UWAQI3B7.js → chunk-JGUKMMRS.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-UU6EP25G.js → chunk-JH2ZSLO3.js} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-GRDK25BN.js → chunk-JHJSFOAM.js} +6 -6
  142. package/dist/cli-bundle/chunks/{chunk-FQO5THHM.js → chunk-JM6YAXTR.js} +2 -2
  143. package/dist/cli-bundle/chunks/{chunk-E7KBMWEF.js → chunk-JSLT7WVE.js} +2 -2
  144. package/dist/cli-bundle/chunks/{chunk-FIUTBFC6.js → chunk-K4CI6Y45.js} +2 -2
  145. package/dist/cli-bundle/chunks/{chunk-IEMXESIS.js → chunk-KSPWRNVP.js} +7 -7
  146. package/dist/cli-bundle/chunks/{chunk-3QNUDDY2.js → chunk-KZEANWJS.js} +14 -12
  147. package/dist/cli-bundle/chunks/{chunk-3QNUDDY2.js.map → chunk-KZEANWJS.js.map} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-BFJP4VYC.js → chunk-L7BH7IWU.js} +4 -4
  149. package/dist/cli-bundle/chunks/{chunk-2UCG5H6B.js → chunk-LPEYZRUR.js} +3 -3
  150. package/dist/cli-bundle/chunks/{chunk-FQF6VVPH.js → chunk-MYSS5H2A.js} +9 -7
  151. package/dist/cli-bundle/chunks/{chunk-FQF6VVPH.js.map → chunk-MYSS5H2A.js.map} +1 -1
  152. package/dist/cli-bundle/chunks/{chunk-IR3GOO6E.js → chunk-NHT3F4WZ.js} +15 -15
  153. package/dist/cli-bundle/chunks/{chunk-6BNV3G6C.js → chunk-NLR32VFS.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-BDC4TW4B.js → chunk-OV7MSW3I.js} +15 -13
  155. package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +1 -0
  156. package/dist/cli-bundle/chunks/{chunk-EI3UIMZM.js → chunk-OWXOPDHD.js} +4 -4
  157. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +246 -0
  158. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-AQUNTB7G.js → chunk-PEQGTJ5Q.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-QFG4MB7P.js → chunk-POG76WWZ.js} +28 -7
  161. package/dist/cli-bundle/chunks/chunk-POG76WWZ.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-MI3346YW.js → chunk-QANSTTC7.js} +129 -170
  163. package/dist/cli-bundle/chunks/chunk-QANSTTC7.js.map +1 -0
  164. package/dist/cli-bundle/chunks/{chunk-T6MOTLOJ.js → chunk-QJKL5PHS.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-SBW7EQC4.js → chunk-QLZ643FM.js} +76 -13
  166. package/dist/cli-bundle/chunks/chunk-QLZ643FM.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-XKVHL3MB.js → chunk-QWRVBJ4D.js} +2 -2
  168. package/dist/cli-bundle/chunks/chunk-R3EWPG4A.js +106 -0
  169. package/dist/cli-bundle/chunks/chunk-R3EWPG4A.js.map +1 -0
  170. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +344 -0
  171. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{chunk-VFA5EIEN.js → chunk-R7QV7ICM.js} +4 -4
  173. package/dist/cli-bundle/chunks/{chunk-NPEYH6CE.js → chunk-RDV4ZFYS.js} +12 -10
  174. package/dist/cli-bundle/chunks/{chunk-NPEYH6CE.js.map → chunk-RDV4ZFYS.js.map} +1 -1
  175. package/dist/cli-bundle/chunks/{chunk-K2L6FZBX.js → chunk-RJO3YAFM.js} +4 -4
  176. package/dist/cli-bundle/chunks/{chunk-YIC5NGXF.js → chunk-RMF7LMBS.js} +7 -7
  177. package/dist/cli-bundle/chunks/{chunk-YIC5NGXF.js.map → chunk-RMF7LMBS.js.map} +2 -2
  178. package/dist/cli-bundle/chunks/{chunk-MRXAHR4B.js → chunk-RZJLNXFG.js} +50 -13
  179. package/dist/cli-bundle/chunks/chunk-RZJLNXFG.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-DJAGYYCQ.js → chunk-SC2HMDGB.js} +19 -3
  181. package/dist/cli-bundle/chunks/chunk-SC2HMDGB.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-SGJB6PXA.js → chunk-SF3DT5HJ.js} +3 -3
  183. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js +604 -0
  184. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +1 -0
  185. package/dist/cli-bundle/chunks/{chunk-Q3K5XPAQ.js → chunk-SR3JOATZ.js} +18 -2
  186. package/dist/cli-bundle/chunks/chunk-SR3JOATZ.js.map +7 -0
  187. package/dist/cli-bundle/chunks/{chunk-DUDLSQFG.js → chunk-SSKOQNMS.js} +14 -12
  188. package/dist/cli-bundle/chunks/{chunk-DUDLSQFG.js.map → chunk-SSKOQNMS.js.map} +1 -1
  189. package/dist/cli-bundle/chunks/{chunk-UNNCT5QY.js → chunk-SZVB53Y3.js} +3 -3
  190. package/dist/cli-bundle/chunks/{chunk-JBW2S2C6.js → chunk-T44FMVRL.js} +613 -157
  191. package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +7 -0
  192. package/dist/cli-bundle/chunks/{chunk-GFZB5CLP.js → chunk-T6PPNM7V.js} +4 -4
  193. package/dist/cli-bundle/chunks/{chunk-UE7LK3RE.js → chunk-THAOZG4U.js} +9 -7
  194. package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +1 -0
  195. package/dist/cli-bundle/chunks/{chunk-IGBBTPM5.js → chunk-TOBGV45Y.js} +4 -4
  196. package/dist/cli-bundle/chunks/chunk-TOBGV45Y.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-W6IEJXNC.js → chunk-TVYYO5A7.js} +2 -2
  198. package/dist/cli-bundle/chunks/chunk-TYHJDFYW.js +109 -0
  199. package/dist/cli-bundle/chunks/chunk-TYHJDFYW.js.map +7 -0
  200. package/dist/cli-bundle/chunks/{chunk-DOASIOQR.js → chunk-UQLXSG72.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-IDUTGRDM.js → chunk-URXVHN3L.js} +3 -3
  202. package/dist/cli-bundle/chunks/chunk-URXVHN3L.js.map +1 -0
  203. package/dist/cli-bundle/chunks/{chunk-7CHWLT2J.js → chunk-UVN66B3M.js} +2 -2
  204. package/dist/cli-bundle/chunks/{chunk-Q6JPYR7I.js → chunk-UX6SSO2I.js} +2 -2
  205. package/dist/cli-bundle/chunks/{chunk-JPWUZOMR.js → chunk-UZDQXNUB.js} +75 -20
  206. package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-OK7VSX3N.js → chunk-UZLJOEAC.js} +3 -3
  208. package/dist/cli-bundle/chunks/{chunk-4PSJVGRE.js → chunk-VDO2JMD4.js} +7 -7
  209. package/dist/cli-bundle/chunks/{chunk-IRJ6F23W.js → chunk-VQIHNHMJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-FQODDTE7.js → chunk-WUVEBQW6.js} +7 -5
  211. package/dist/cli-bundle/chunks/{chunk-FQODDTE7.js.map → chunk-WUVEBQW6.js.map} +1 -1
  212. package/dist/cli-bundle/chunks/{chunk-Q4PSG2GV.js → chunk-WVA4DVNV.js} +5 -5
  213. package/dist/cli-bundle/chunks/{chunk-Q4PSG2GV.js.map → chunk-WVA4DVNV.js.map} +1 -1
  214. package/dist/cli-bundle/chunks/{chunk-4M6RZJXF.js → chunk-WWNL6WMH.js} +3 -3
  215. package/dist/cli-bundle/chunks/chunk-WWNL6WMH.js.map +7 -0
  216. package/dist/cli-bundle/chunks/{chunk-3KPNOZOH.js → chunk-X6K5XTTN.js} +78 -21
  217. package/dist/cli-bundle/chunks/chunk-X6K5XTTN.js.map +7 -0
  218. package/dist/cli-bundle/chunks/{chunk-G33XIMRT.js → chunk-XJF7CDNH.js} +17 -10
  219. package/dist/cli-bundle/chunks/{chunk-G33XIMRT.js.map → chunk-XJF7CDNH.js.map} +1 -1
  220. package/dist/cli-bundle/chunks/{chunk-AR24KW26.js → chunk-YBT7O4KT.js} +17 -112
  221. package/dist/cli-bundle/chunks/chunk-YBT7O4KT.js.map +7 -0
  222. package/dist/cli-bundle/chunks/{chunk-CZA2DXCV.js → chunk-YQQNAKW3.js} +17 -105
  223. package/dist/cli-bundle/chunks/chunk-YQQNAKW3.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-OKPZDH43.js → chunk-YQWCZ5AC.js} +7 -5
  225. package/dist/cli-bundle/chunks/{chunk-OKPZDH43.js.map → chunk-YQWCZ5AC.js.map} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-LT5UWU7H.js → chunk-ZOJ3LR7O.js} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-3HSRP6T2.js → chunk-ZOY5K4D3.js} +2 -2
  228. package/dist/cli-bundle/chunks/{chunk-XXWDEQ6O.js → chunk-ZV2NTVMJ.js} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-UW6HCMP2.js → chunk-ZYPFOO3L.js} +9 -9
  230. package/dist/cli-bundle/chunks/close-O5QVZ6ET.js +12 -0
  231. package/dist/cli-bundle/chunks/{close-7NWA3GLA.js → close-QEMOYZN3.js} +5 -5
  232. package/dist/cli-bundle/chunks/close-many-SDA426VT.js +24 -0
  233. package/dist/cli-bundle/chunks/{close-many-YALQ7AXS.js → close-many-UTZANOCQ.js} +15 -14
  234. package/dist/cli-bundle/chunks/{comments-SQIQ5WYR.js → comments-LZN6FXXC.js} +7 -7
  235. package/dist/cli-bundle/chunks/comments-VBQ345ND.js +13 -0
  236. package/dist/cli-bundle/chunks/{copy-YDAMENCP.js → copy-DKTSSCK7.js} +4 -4
  237. package/dist/cli-bundle/chunks/copy-M7DDI6LS.js +9 -0
  238. package/dist/cli-bundle/chunks/{create-JSL6CXU3.js → create-GG4RBCGC.js} +11 -11
  239. package/dist/cli-bundle/chunks/create-JBC5KUW6.js +29 -0
  240. package/dist/cli-bundle/chunks/{delete-IGVOZEU2.js → delete-LCS3VPDH.js} +4 -4
  241. package/dist/cli-bundle/chunks/delete-MD7YXQLH.js +10 -0
  242. package/dist/cli-bundle/chunks/{deps-BQAXUQAK.js → deps-DELOO4TL.js} +6 -6
  243. package/dist/cli-bundle/chunks/{deps-CBPPSS6J.js → deps-FI4O6NQS.js} +6 -6
  244. package/dist/cli-bundle/chunks/docs-2UYBP5D6.js +14 -0
  245. package/dist/cli-bundle/chunks/{docs-NS2AZWCN.js → docs-6Z2MP526.js} +6 -6
  246. package/dist/cli-bundle/chunks/{files-XUUBQ76I.js → files-HEUGSJZL.js} +6 -6
  247. package/dist/cli-bundle/chunks/{files-PVWEPT5J.js → files-HKEAN5MA.js} +6 -6
  248. package/dist/cli-bundle/chunks/{focus-DHBHKK3E.js → focus-7SOUT5PZ.js} +5 -5
  249. package/dist/cli-bundle/chunks/focus-DRQ6FQH6.js +10 -0
  250. package/dist/cli-bundle/chunks/history-compact-65YVN5DB.js +17 -0
  251. package/dist/cli-bundle/chunks/{history-compact-3TNPYVFG.js → history-compact-7NDVP3PT.js} +7 -6
  252. package/dist/cli-bundle/chunks/{history-redact-KKFDICCF.js → history-redact-7YBL4XSG.js} +5 -4
  253. package/dist/cli-bundle/chunks/{history-redact-ELRL73XN.js → history-redact-IZGNJBU4.js} +5 -4
  254. package/dist/cli-bundle/chunks/{history-repair-J7WKZFAG.js → history-repair-7M4PYQUH.js} +8 -6
  255. package/dist/cli-bundle/chunks/history-repair-GNGETJLI.js +18 -0
  256. package/dist/cli-bundle/chunks/learnings-3YXDRWFT.js +13 -0
  257. package/dist/cli-bundle/chunks/{learnings-X4D6JCCG.js → learnings-ALC6IMNL.js} +7 -7
  258. package/dist/cli-bundle/chunks/notes-7JMLQ447.js +13 -0
  259. package/dist/cli-bundle/chunks/{notes-UQC6VS6N.js → notes-JFCLTC5C.js} +7 -7
  260. package/dist/cli-bundle/chunks/plan-KOIPWVOZ.js +26 -0
  261. package/dist/cli-bundle/chunks/{plan-5GKRBJJO.js → plan-T3XB3WTK.js} +12 -12
  262. package/dist/cli-bundle/chunks/{profile-5PQAPCLF.js → profile-OILJHKUW.js} +12 -11
  263. package/dist/cli-bundle/chunks/{profile-CW4BD3FO.js → profile-RJXA7PGS.js} +12 -11
  264. package/dist/cli-bundle/chunks/{register-list-query-PHIPDFP2.js → register-list-query-CFVG75P3.js} +30 -21
  265. package/dist/cli-bundle/chunks/{register-list-query-PHIPDFP2.js.map → register-list-query-CFVG75P3.js.map} +1 -1
  266. package/dist/cli-bundle/chunks/{register-list-query-HTDQE6VI.js → register-list-query-E7UVY4TN.js} +29 -20
  267. package/dist/cli-bundle/chunks/{register-list-query-HTDQE6VI.js.map → register-list-query-E7UVY4TN.js.map} +2 -2
  268. package/dist/cli-bundle/chunks/{register-mutation-BLEWM5I6.js → register-mutation-4VJTXBZW.js} +86 -32
  269. package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-mutation-OTYHR7J6.js → register-mutation-IQ55E25C.js} +78 -33
  271. package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{register-operations-AMCUFYEW.js → register-operations-AR7RMX4W.js} +42 -38
  273. package/dist/cli-bundle/chunks/register-operations-AR7RMX4W.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-operations-MRLHOZYR.js → register-operations-NOLZGORC.js} +41 -37
  275. package/dist/cli-bundle/chunks/register-operations-NOLZGORC.js.map +7 -0
  276. package/dist/cli-bundle/chunks/{register-setup-ZVKTDL4G.js → register-setup-BB77VUEE.js} +17 -16
  277. package/dist/cli-bundle/chunks/{register-setup-ZVKTDL4G.js.map → register-setup-BB77VUEE.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{register-setup-N2FOSWAG.js → register-setup-EYZ7VTPZ.js} +15 -14
  279. package/dist/cli-bundle/chunks/{register-setup-N2FOSWAG.js.map → register-setup-EYZ7VTPZ.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/restore-L6IAGOD7.js +15 -0
  281. package/dist/cli-bundle/chunks/{restore-HEQAG6EK.js → restore-ZH65GZFB.js} +7 -6
  282. package/dist/cli-bundle/chunks/{schema-Q5DAWJ2S.js → schema-4ERWM5QJ.js} +7 -6
  283. package/dist/cli-bundle/chunks/{schema-MAXAIHEC.js → schema-55DL3Q52.js} +7 -6
  284. package/dist/cli-bundle/chunks/{update-DWFXXJKP.js → update-FW6FKDOP.js} +15 -15
  285. package/dist/cli-bundle/chunks/update-TJHSPRPT.js +23 -0
  286. package/dist/cli-bundle/chunks/update-many-NNALYQCN.js +35 -0
  287. package/dist/cli-bundle/chunks/update-many-PWXX5WHO.js +39 -0
  288. package/dist/cli-bundle/main.js +62 -59
  289. package/dist/cli-bundle/main.js.map +1 -1
  290. package/dist/cli-bundle/sdk-runtime.js +62 -59
  291. package/dist/cli-bundle/sdk-testing.js +8 -8
  292. package/dist/cli-bundle/sdk.js +327 -57
  293. package/dist/cli-bundle/sdk.js.map +4 -4
  294. package/dist/core/config/nested-settings.d.ts +2 -0
  295. package/dist/core/config/nested-settings.js +18 -2
  296. package/dist/core/config/nested-settings.js.map +1 -1
  297. package/dist/core/diagnostics/remediation.js +38 -2
  298. package/dist/core/diagnostics/remediation.js.map +1 -1
  299. package/dist/core/extensions/extension-types.d.ts +1 -1
  300. package/dist/core/extensions/extension-types.js +2 -2
  301. package/dist/core/extensions/extension-types.js.map +1 -1
  302. package/dist/core/item/id.d.ts +19 -2
  303. package/dist/core/item/id.js +27 -6
  304. package/dist/core/item/id.js.map +1 -1
  305. package/dist/core/item/parse.d.ts +7 -0
  306. package/dist/core/item/parse.js +48 -2
  307. package/dist/core/item/parse.js.map +1 -1
  308. package/dist/core/schema/item-types-file.d.ts +2 -2
  309. package/dist/core/schema/item-types-file.js +2 -2
  310. package/dist/core/schema/item-types-file.js.map +1 -1
  311. package/dist/core/schema/runtime-schema.d.ts +3 -3
  312. package/dist/core/schema/runtime-schema.js +2 -2
  313. package/dist/core/schema/runtime-schema.js.map +1 -1
  314. package/dist/core/schema/type-workflows.d.ts +2 -2
  315. package/dist/core/schema/type-workflows.js +2 -2
  316. package/dist/core/schema/type-workflows.js.map +1 -1
  317. package/dist/core/shared/constants.js +5 -2
  318. package/dist/core/shared/constants.js.map +1 -1
  319. package/dist/core/store/settings-validator.d.ts +4 -0
  320. package/dist/core/store/settings-validator.js +8 -2
  321. package/dist/core/store/settings-validator.js.map +1 -1
  322. package/dist/core/store/settings.js +8 -2
  323. package/dist/core/store/settings.js.map +1 -1
  324. package/dist/sdk/annotations.js +24 -2
  325. package/dist/sdk/annotations.js.map +1 -1
  326. package/dist/sdk/cli-bootstrap.d.ts +1 -1
  327. package/dist/sdk/cli-bootstrap.js +3 -3
  328. package/dist/sdk/cli-bootstrap.js.map +1 -1
  329. package/dist/sdk/cli-contracts/commander-mutation-options.js +22 -2
  330. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  331. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  332. package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
  333. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  334. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  335. package/dist/sdk/cli-contracts/flag-contracts.js +17 -2
  336. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  337. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +512 -0
  338. package/dist/sdk/cli-contracts/tool-option-contracts.js +21 -11
  339. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  340. package/dist/sdk/cli-contracts/tool-parameter-tables.js +13 -3
  341. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  342. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -0
  343. package/dist/sdk/cli-contracts/tool-schema.js +14 -10
  344. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  345. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +69 -0
  346. package/dist/sdk/cli-contracts/typed-action-inputs.js +5 -0
  347. package/dist/sdk/cli-contracts/typed-action-inputs.js.map +1 -0
  348. package/dist/sdk/cli-contracts.d.ts +4 -3
  349. package/dist/sdk/cli-contracts.js +5 -5
  350. package/dist/sdk/cli-contracts.js.map +1 -1
  351. package/dist/sdk/extension/describe.d.ts +1 -1
  352. package/dist/sdk/extension/describe.js +2 -2
  353. package/dist/sdk/extension/describe.js.map +1 -1
  354. package/dist/sdk/extension/install-runtime.js +5 -3
  355. package/dist/sdk/extension/install-runtime.js.map +1 -1
  356. package/dist/sdk/extension.d.ts +2 -2
  357. package/dist/sdk/extension.js +2 -2
  358. package/dist/sdk/extension.js.map +1 -1
  359. package/dist/sdk/governance/gc.d.ts +14 -1
  360. package/dist/sdk/governance/gc.js +38 -2
  361. package/dist/sdk/governance/gc.js.map +1 -1
  362. package/dist/sdk/governance/storage-integrity.d.ts +84 -0
  363. package/dist/sdk/governance/storage-integrity.js +240 -0
  364. package/dist/sdk/governance/storage-integrity.js.map +1 -0
  365. package/dist/sdk/governance/validate.d.ts +3 -1
  366. package/dist/sdk/governance/validate.js +56 -2
  367. package/dist/sdk/governance/validate.js.map +1 -1
  368. package/dist/sdk/history-read.d.ts +1 -1
  369. package/dist/sdk/history-read.js +2 -2
  370. package/dist/sdk/history-read.js.map +1 -1
  371. package/dist/sdk/history-repair.d.ts +36 -0
  372. package/dist/sdk/history-repair.js +69 -4
  373. package/dist/sdk/history-repair.js.map +1 -1
  374. package/dist/sdk/index.d.ts +5 -2
  375. package/dist/sdk/index.js +5 -2
  376. package/dist/sdk/index.js.map +1 -1
  377. package/dist/sdk/init.js +3 -3
  378. package/dist/sdk/init.js.map +1 -1
  379. package/dist/sdk/item-transaction.d.ts +131 -0
  380. package/dist/sdk/item-transaction.js +280 -0
  381. package/dist/sdk/item-transaction.js.map +1 -0
  382. package/dist/sdk/merge/driver.d.ts +75 -0
  383. package/dist/sdk/merge/driver.js +166 -0
  384. package/dist/sdk/merge/driver.js.map +1 -0
  385. package/dist/sdk/merge/index.d.ts +11 -0
  386. package/dist/sdk/merge/index.js +15 -0
  387. package/dist/sdk/merge/index.js.map +1 -0
  388. package/dist/sdk/merge/install.d.ts +90 -0
  389. package/dist/sdk/merge/install.js +318 -0
  390. package/dist/sdk/merge/install.js.map +1 -0
  391. package/dist/sdk/merge/three-way.d.ts +126 -0
  392. package/dist/sdk/merge/three-way.js +545 -0
  393. package/dist/sdk/merge/three-way.js.map +1 -0
  394. package/dist/sdk/query/list.d.ts +19 -2
  395. package/dist/sdk/query/list.js +5 -2
  396. package/dist/sdk/query/list.js.map +1 -1
  397. package/dist/sdk/runtime.d.ts +17 -14
  398. package/dist/sdk/runtime.js +5 -5
  399. package/dist/sdk/runtime.js.map +1 -1
  400. package/dist/sdk/schema.d.ts +2 -2
  401. package/dist/sdk/schema.js +29 -2
  402. package/dist/sdk/schema.js.map +1 -1
  403. package/dist/sdk/stats.d.ts +1 -1
  404. package/dist/sdk/stats.js +2 -2
  405. package/dist/sdk/stats.js.map +1 -1
  406. package/dist/sdk/workspace-transaction-gc.d.ts +46 -0
  407. package/dist/sdk/workspace-transaction-gc.js +155 -0
  408. package/dist/sdk/workspace-transaction-gc.js.map +1 -0
  409. package/dist/sdk/workspace.d.ts +28 -4
  410. package/dist/sdk/workspace.js +61 -15
  411. package/dist/sdk/workspace.js.map +1 -1
  412. package/dist/types.d.ts +11 -7
  413. package/dist/types.js +2 -2
  414. package/dist/types.js.map +1 -1
  415. package/docs/AGENT_GUIDE.md +58 -47
  416. package/docs/COMMANDS.md +7 -0
  417. package/docs/CONFIGURATION.md +2 -0
  418. package/docs/MERGE_SAFETY.md +99 -0
  419. package/docs/README.md +1 -0
  420. package/docs/SDK.md +56 -0
  421. package/marketplace.json +2 -2
  422. package/package.json +3 -2
  423. package/packages/pm-beads/package.json +1 -1
  424. package/packages/pm-calendar/package.json +1 -1
  425. package/packages/pm-command-kit/package.json +1 -1
  426. package/packages/pm-governance-audit/package.json +1 -1
  427. package/packages/pm-guide-shell/package.json +1 -1
  428. package/packages/pm-kanban/package.json +1 -1
  429. package/packages/pm-lifecycle-hooks/package.json +1 -1
  430. package/packages/pm-linked-test-adapters/package.json +1 -1
  431. package/packages/pm-search-advanced/package.json +1 -1
  432. package/packages/pm-templates/package.json +1 -1
  433. package/packages/pm-todos/package.json +1 -1
  434. package/packages/pm-vcs/package.json +1 -1
  435. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  436. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  437. package/dist/cli-bundle/chunks/append-XUYF7NON.js +0 -11
  438. package/dist/cli-bundle/chunks/chunk-2XPDCXK5.js.map +0 -1
  439. package/dist/cli-bundle/chunks/chunk-3EZZTFL2.js.map +0 -7
  440. package/dist/cli-bundle/chunks/chunk-3KPNOZOH.js.map +0 -7
  441. package/dist/cli-bundle/chunks/chunk-46Z6FAVP.js.map +0 -1
  442. package/dist/cli-bundle/chunks/chunk-4M6RZJXF.js.map +0 -7
  443. package/dist/cli-bundle/chunks/chunk-6V4T4RD3.js.map +0 -1
  444. package/dist/cli-bundle/chunks/chunk-A3GAQLBH.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-A4FVWFZY.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-A5EQPNV7.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-AR24KW26.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-BBGR4FKQ.js.map +0 -1
  449. package/dist/cli-bundle/chunks/chunk-BDC4TW4B.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-BZKE2O5V.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-CZA2DXCV.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-D35WYXWC.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-DJAGYYCQ.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-EEECAV5M.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-H3YKUVDR.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-IDUTGRDM.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-IGBBTPM5.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-JBW2S2C6.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-JPWUZOMR.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-KAE727L2.js.map +0 -7
  461. package/dist/cli-bundle/chunks/chunk-MI3346YW.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-MQOSMBWV.js.map +0 -7
  463. package/dist/cli-bundle/chunks/chunk-MRXAHR4B.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-N2TEEOXJ.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-ODEIDKGW.js.map +0 -1
  466. package/dist/cli-bundle/chunks/chunk-P24ZU5QV.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-Q3K5XPAQ.js.map +0 -7
  468. package/dist/cli-bundle/chunks/chunk-QFG4MB7P.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-RLLOZAM2.js.map +0 -7
  470. package/dist/cli-bundle/chunks/chunk-RWAIRGBC.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-SBW7EQC4.js.map +0 -1
  472. package/dist/cli-bundle/chunks/chunk-SVAWG7EE.js.map +0 -1
  473. package/dist/cli-bundle/chunks/chunk-UE7LK3RE.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-VA3H7VVC.js.map +0 -1
  475. package/dist/cli-bundle/chunks/chunk-WCBB6VI3.js.map +0 -7
  476. package/dist/cli-bundle/chunks/chunk-Y2VSGFT4.js.map +0 -1
  477. package/dist/cli-bundle/chunks/chunk-YG56M3NE.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-ZF52NVRT.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-ZUCBPXNA.js.map +0 -7
  480. package/dist/cli-bundle/chunks/close-ZZCDDWJT.js +0 -12
  481. package/dist/cli-bundle/chunks/close-many-QCZHFCON.js +0 -23
  482. package/dist/cli-bundle/chunks/comments-FMQNYPSZ.js +0 -13
  483. package/dist/cli-bundle/chunks/copy-GI3RCVZP.js +0 -9
  484. package/dist/cli-bundle/chunks/create-LXMLYJNM.js +0 -29
  485. package/dist/cli-bundle/chunks/delete-5DFAXJNI.js +0 -10
  486. package/dist/cli-bundle/chunks/docs-KCWPLQOV.js +0 -14
  487. package/dist/cli-bundle/chunks/focus-3EJVFI3D.js +0 -10
  488. package/dist/cli-bundle/chunks/history-compact-JHYVDYLW.js +0 -16
  489. package/dist/cli-bundle/chunks/history-repair-REMI7DDI.js +0 -16
  490. package/dist/cli-bundle/chunks/learnings-O6V5WDCV.js +0 -13
  491. package/dist/cli-bundle/chunks/notes-ZSZREWZA.js +0 -13
  492. package/dist/cli-bundle/chunks/plan-EZW2YDDY.js +0 -26
  493. package/dist/cli-bundle/chunks/register-mutation-BLEWM5I6.js.map +0 -7
  494. package/dist/cli-bundle/chunks/register-mutation-OTYHR7J6.js.map +0 -1
  495. package/dist/cli-bundle/chunks/register-operations-AMCUFYEW.js.map +0 -1
  496. package/dist/cli-bundle/chunks/register-operations-MRLHOZYR.js.map +0 -7
  497. package/dist/cli-bundle/chunks/restore-A55MLFAI.js +0 -14
  498. package/dist/cli-bundle/chunks/update-5DTSCWVF.js +0 -23
  499. package/dist/cli-bundle/chunks/update-many-6T4ZLZS7.js +0 -34
  500. package/dist/cli-bundle/chunks/update-many-MYRK6VBJ.js +0 -38
  501. /package/dist/cli-bundle/chunks/{append-MBXHNWSX.js.map → append-E6V54WOQ.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{append-XUYF7NON.js.map → append-NNJ3EFIT.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{chunk-YGEA4CLH.js.map → chunk-3MCTMJXI.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{chunk-N7FCFJ76.js.map → chunk-3P7UJQOX.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{chunk-7B7IHMLH.js.map → chunk-3VY6MIEO.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{chunk-5S6IZXK7.js.map → chunk-4U4Z6AHI.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{chunk-UOIFZ66L.js.map → chunk-4XGJLADW.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{chunk-SUNZKVAH.js.map → chunk-5IZJWSDB.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{chunk-QQ77W23U.js.map → chunk-5NTE36LD.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{chunk-KGPLSHJD.js.map → chunk-6C2ZZX5Z.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{chunk-Q5NHJ6RO.js.map → chunk-6JUTHVQS.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{chunk-NTS2RKHN.js.map → chunk-6VIJ7UA5.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-XVB6BATY.js.map → chunk-72LQ4TKV.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-KZ5AC6B5.js.map → chunk-7WCE6Y64.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-VQOG2ETB.js.map → chunk-AF2CCM5U.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-EAV3P54W.js.map → chunk-DAQ45GCS.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-RX53WHFI.js.map → chunk-EJDGV4GR.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-IXG5CMBR.js.map → chunk-FDHPAVVB.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-V4QHAMI5.js.map → chunk-GROYI4RB.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-77XFQRTD.js.map → chunk-GSJSM5BJ.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-QYGK2XQ3.js.map → chunk-GTLCVJOE.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-VSQE43NO.js.map → chunk-GV2262OF.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-STBCBDKF.js.map → chunk-HCEBZNC3.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-U6RYD446.js.map → chunk-HRW7GF6T.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-XDWXPG2E.js.map → chunk-IAQE32BI.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-66SRNEBK.js.map → chunk-IJNK6WW2.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-AGEBQRBG.js.map → chunk-JAPE62Y5.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-UWAQI3B7.js.map → chunk-JGUKMMRS.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-UU6EP25G.js.map → chunk-JH2ZSLO3.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-GRDK25BN.js.map → chunk-JHJSFOAM.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-FQO5THHM.js.map → chunk-JM6YAXTR.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-E7KBMWEF.js.map → chunk-JSLT7WVE.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-FIUTBFC6.js.map → chunk-K4CI6Y45.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-IEMXESIS.js.map → chunk-KSPWRNVP.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-BFJP4VYC.js.map → chunk-L7BH7IWU.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-2UCG5H6B.js.map → chunk-LPEYZRUR.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-IR3GOO6E.js.map → chunk-NHT3F4WZ.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-6BNV3G6C.js.map → chunk-NLR32VFS.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-EI3UIMZM.js.map → chunk-OWXOPDHD.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-AQUNTB7G.js.map → chunk-PEQGTJ5Q.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-T6MOTLOJ.js.map → chunk-QJKL5PHS.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-XKVHL3MB.js.map → chunk-QWRVBJ4D.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-VFA5EIEN.js.map → chunk-R7QV7ICM.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-K2L6FZBX.js.map → chunk-RJO3YAFM.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-SGJB6PXA.js.map → chunk-SF3DT5HJ.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-UNNCT5QY.js.map → chunk-SZVB53Y3.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-GFZB5CLP.js.map → chunk-T6PPNM7V.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-W6IEJXNC.js.map → chunk-TVYYO5A7.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-DOASIOQR.js.map → chunk-UQLXSG72.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-7CHWLT2J.js.map → chunk-UVN66B3M.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-Q6JPYR7I.js.map → chunk-UX6SSO2I.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-OK7VSX3N.js.map → chunk-UZLJOEAC.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-4PSJVGRE.js.map → chunk-VDO2JMD4.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IRJ6F23W.js.map → chunk-VQIHNHMJ.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-LT5UWU7H.js.map → chunk-ZOJ3LR7O.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-3HSRP6T2.js.map → chunk-ZOY5K4D3.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-XXWDEQ6O.js.map → chunk-ZV2NTVMJ.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-UW6HCMP2.js.map → chunk-ZYPFOO3L.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{close-ZZCDDWJT.js.map → close-O5QVZ6ET.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{close-7NWA3GLA.js.map → close-QEMOYZN3.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{close-many-QCZHFCON.js.map → close-many-SDA426VT.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{close-many-YALQ7AXS.js.map → close-many-UTZANOCQ.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{comments-SQIQ5WYR.js.map → comments-LZN6FXXC.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{comments-FMQNYPSZ.js.map → comments-VBQ345ND.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{copy-YDAMENCP.js.map → copy-DKTSSCK7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{copy-GI3RCVZP.js.map → copy-M7DDI6LS.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{create-JSL6CXU3.js.map → create-GG4RBCGC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{create-LXMLYJNM.js.map → create-JBC5KUW6.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{delete-IGVOZEU2.js.map → delete-LCS3VPDH.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{delete-5DFAXJNI.js.map → delete-MD7YXQLH.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{deps-BQAXUQAK.js.map → deps-DELOO4TL.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{deps-CBPPSS6J.js.map → deps-FI4O6NQS.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{docs-KCWPLQOV.js.map → docs-2UYBP5D6.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{docs-NS2AZWCN.js.map → docs-6Z2MP526.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{files-XUUBQ76I.js.map → files-HEUGSJZL.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{files-PVWEPT5J.js.map → files-HKEAN5MA.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{focus-DHBHKK3E.js.map → focus-7SOUT5PZ.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{focus-3EJVFI3D.js.map → focus-DRQ6FQH6.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-compact-JHYVDYLW.js.map → history-compact-65YVN5DB.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-compact-3TNPYVFG.js.map → history-compact-7NDVP3PT.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{history-redact-KKFDICCF.js.map → history-redact-7YBL4XSG.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{history-redact-ELRL73XN.js.map → history-redact-IZGNJBU4.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{history-repair-J7WKZFAG.js.map → history-repair-7M4PYQUH.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{history-repair-REMI7DDI.js.map → history-repair-GNGETJLI.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{learnings-O6V5WDCV.js.map → learnings-3YXDRWFT.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{learnings-X4D6JCCG.js.map → learnings-ALC6IMNL.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{notes-ZSZREWZA.js.map → notes-7JMLQ447.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{notes-UQC6VS6N.js.map → notes-JFCLTC5C.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{plan-EZW2YDDY.js.map → plan-KOIPWVOZ.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{plan-5GKRBJJO.js.map → plan-T3XB3WTK.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{profile-5PQAPCLF.js.map → profile-OILJHKUW.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{profile-CW4BD3FO.js.map → profile-RJXA7PGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{restore-A55MLFAI.js.map → restore-L6IAGOD7.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{restore-HEQAG6EK.js.map → restore-ZH65GZFB.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{schema-Q5DAWJ2S.js.map → schema-4ERWM5QJ.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{schema-MAXAIHEC.js.map → schema-55DL3Q52.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-DWFXXJKP.js.map → update-FW6FKDOP.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{update-5DTSCWVF.js.map → update-TJHSPRPT.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{update-many-6T4ZLZS7.js.map → update-many-NNALYQCN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{update-many-MYRK6VBJ.js.map → update-many-PWXX5WHO.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"extension-types.js","sources":["core/extensions/extension-types.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/extensions/extension-types\n *\n * Implements extension runtime contracts and governance for Extension Types.\n */\nimport type {\n ExtensionPolicyOverrideSettings,\n ExtensionPolicySettings,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n PmSettings,\n} from \"../../types/index.js\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\nimport type {\n ProjectProfileDefinition,\n ProjectProfileRegistrationInput,\n} from \"../profile/profile-presets.js\";\nimport type { RelationshipKindDefinition } from \"../../sdk/relationships.js\";\nimport type { PmClient } from \"../../sdk/runtime.js\";\nimport type {\n GetItemAtResult,\n} from \"../../sdk/history-read.js\";\nimport type {\n RelationshipEventStore,\n} from \"../../sdk/relationship-history.js\";\nimport type {\n CommitWorkspaceTransactionOptions,\n WorkspaceTransactionCommitResult,\n} from \"../../sdk/workspace-transaction.js\";\n\n/** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_CAPABILITIES = [\n \"commands\",\n \"renderers\",\n \"hooks\",\n \"schema\",\n \"importers\",\n \"search\",\n \"parser\",\n \"preflight\",\n \"services\",\n] as const;\n/** Restricts extension capability values accepted by command, SDK, and storage contracts. */\nexport type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];\n/** Public contract for extension capability contract version, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_CAPABILITY_CONTRACT_VERSION = 2;\n/** Public contract for extension capability legacy aliases, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_CAPABILITY_LEGACY_ALIASES: Readonly<\n Record<string, ExtensionCapability>\n> = Object.freeze({\n migration: \"schema\",\n validation: \"schema\",\n});\n/** Public contract for extension capability contract, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_CAPABILITY_CONTRACT = Object.freeze({\n version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n capabilities: [...KNOWN_EXTENSION_CAPABILITIES],\n legacy_aliases: { ...EXTENSION_CAPABILITY_LEGACY_ALIASES },\n});\n\n/** Public contract for known extension policy modes, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_POLICY_MODES = [\"off\", \"warn\", \"enforce\"] as const;\n/** Restricts extension policy mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyMode = (typeof KNOWN_EXTENSION_POLICY_MODES)[number];\n/** Public contract for known extension trust modes, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_TRUST_MODES = [\"off\", \"warn\", \"enforce\"] as const;\n/** Restricts extension trust mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionTrustMode = (typeof KNOWN_EXTENSION_TRUST_MODES)[number];\n/** Public contract for known extension sandbox profiles, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_SANDBOX_PROFILES = [\n \"none\",\n \"restricted\",\n \"strict\",\n] as const;\n/** Restricts extension sandbox profile values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSandboxProfile =\n (typeof KNOWN_EXTENSION_SANDBOX_PROFILES)[number];\n\n/** Public contract for known pm max version exceeded modes, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_PM_MAX_VERSION_EXCEEDED_MODES = [\"block\", \"warn\"] as const;\n/** How a `pm_max_version` violation is handled for an extension layer. */\nexport type PmMaxVersionExceededMode =\n (typeof KNOWN_PM_MAX_VERSION_EXCEEDED_MODES)[number];\n/** Optional per-layer override map for `extensions.policy.pm_max_version_exceeded_mode`. */\nexport interface PmMaxVersionExceededModeByLayer {\n /** Value that configures or reports global for this contract. */\n global?: PmMaxVersionExceededMode;\n /** Value that configures or reports project for this contract. */\n project?: PmMaxVersionExceededMode;\n}\n/** Settings value for `extensions.policy.pm_max_version_exceeded_mode`: either a single mode applied to both layers, or a per-layer override map. Unset (and any unset layer key) defaults to `\"block\"`. */\nexport type PmMaxVersionExceededModeSetting =\n | PmMaxVersionExceededMode\n | PmMaxVersionExceededModeByLayer;\n\n/** Public contract for known extension policy surfaces, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_POLICY_SURFACES = [\n \"commands.override\",\n \"commands.handler\",\n \"hooks.beforecommand\",\n \"hooks.aftercommand\",\n \"hooks.onwrite\",\n \"hooks.onread\",\n \"hooks.onindex\",\n \"schema.flags\",\n \"schema.itemfields\",\n \"schema.itemtypes\",\n \"schema.relationshipkinds\",\n \"schema.migrations\",\n \"schema.profiles\",\n \"parser.override\",\n \"preflight.override\",\n \"services.override\",\n \"renderers.override\",\n \"importers.importer\",\n \"importers.exporter\",\n \"search.provider\",\n \"search.vectorstore\",\n] as const;\n/** Restricts extension policy surface values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicySurface =\n (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];\n\n/** Public contract for known extension service names, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_SERVICE_NAMES = [\n \"output_format\",\n \"error_format\",\n \"help_format\",\n \"lock_acquire\",\n \"lock_release\",\n \"history_append\",\n \"item_store_write\",\n \"item_store_delete\",\n \"context_relevance\",\n \"command_result\",\n] as const;\n/** Restricts extension service name values accepted by command, SDK, and storage contracts. */\nexport type ExtensionServiceName =\n (typeof KNOWN_EXTENSION_SERVICE_NAMES)[number];\n\n/** Documents the extension provenance metadata payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionProvenanceMetadata {\n /** Value that configures or reports source for this contract. */\n source?: string;\n /** Value that configures or reports signature for this contract. */\n signature?: string;\n /** Value that configures or reports attestation for this contract. */\n attestation?: string;\n /** Value that configures or reports verified for this contract. */\n verified?: boolean;\n}\n\n/** Documents the extension runtime permission declaration payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRuntimePermissionDeclaration {\n /** Value that configures or reports fs read for this contract. */\n fs_read?: boolean;\n /** Value that configures or reports fs write for this contract. */\n fs_write?: boolean;\n /** Value that configures or reports network for this contract. */\n network?: boolean;\n /** Value that configures or reports env read for this contract. */\n env_read?: boolean;\n /** Value that configures or reports env write for this contract. */\n env_write?: boolean;\n /** Value that configures or reports process spawn for this contract. */\n process_spawn?: boolean;\n}\n\n/** Documents the extension activation metadata payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionActivationMetadata {\n /** Value that configures or reports commands for this contract. */\n commands?: string[];\n}\n\n/** Restricts extension policy override values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyOverride = ExtensionPolicyOverrideSettings;\n/** Extension governance policy as read from / serialized to settings. Extends the stored settings shape with `pm_max_version_exceeded_mode` (pm-k5e8), which relaxes the default-BLOCK on `pm_max_version` violations to warn-only — globally or per extension layer. */\nexport type ExtensionGovernancePolicy = ExtensionPolicySettings & {\n pm_max_version_exceeded_mode?: PmMaxVersionExceededModeSetting;\n};\n\n/** Documents the extension manifest engines payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionManifestEngines {\n /** Value that configures or reports pm for this contract. */\n pm?: string;\n /** Value that configures or reports node for this contract. */\n node?: string;\n [engine: string]: string | undefined;\n}\n\n/** Implements create default extension governance policy for the public runtime surface of this module. */\nexport function createDefaultExtensionGovernancePolicy(): ExtensionGovernancePolicy {\n return {\n mode: \"off\",\n trust_mode: \"off\",\n require_provenance: false,\n trusted_extensions: [],\n default_sandbox_profile: \"none\",\n allowed_extensions: [],\n blocked_extensions: [],\n allowed_capabilities: [],\n blocked_capabilities: [],\n allowed_surfaces: [],\n blocked_surfaces: [],\n allowed_commands: [],\n blocked_commands: [],\n allowed_actions: [],\n blocked_actions: [],\n allowed_services: [],\n blocked_services: [],\n extension_overrides: [],\n };\n}\n\n/** Restricts extension layer values accepted by command, SDK, and storage contracts. */\nexport type ExtensionLayer = \"global\" | \"project\";\n/** Restricts extension status values accepted by command, SDK, and storage contracts. */\nexport type ExtensionStatus = \"ok\" | \"warn\";\n\n/** Documents the extension manifest payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionManifest {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports version for this contract. */\n version: string;\n /** Value that configures or reports entry for this contract. */\n entry: string;\n /** Value that configures or reports priority for this contract. */\n priority: number;\n /** Value that configures or reports capabilities for this contract. */\n capabilities: string[];\n /** Value that configures or reports manifest version for this contract. */\n manifest_version?: number;\n /** Value that configures or reports pm min version for this contract. */\n pm_min_version?: string;\n /** Value that configures or reports pm max version for this contract. */\n pm_max_version?: string;\n /** Value that configures or reports engines for this contract. */\n engines?: ExtensionManifestEngines;\n /** Value that configures or reports trusted for this contract. */\n trusted?: boolean;\n /** Value that configures or reports provenance for this contract. */\n provenance?: ExtensionProvenanceMetadata;\n /** Value that configures or reports sandbox profile for this contract. */\n sandbox_profile?: ExtensionSandboxProfile;\n /** Value that configures or reports permissions for this contract. */\n permissions?: ExtensionRuntimePermissionDeclaration;\n /** Value that configures or reports activation for this contract. */\n activation?: ExtensionActivationMetadata;\n /** Value that configures or reports legacy capability aliases for this contract. */\n legacy_capability_aliases?: LegacyExtensionCapabilityAliasMapping[];\n}\n\n/** Documents the extension diagnostic payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDiagnostic {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports directory for this contract. */\n directory: string;\n /** Filesystem path used for manifest resolution. */\n manifest_path: string;\n /** Value that configures or reports name for this contract. */\n name: string | null;\n /** Value that configures or reports version for this contract. */\n version: string | null;\n /** Value that configures or reports entry for this contract. */\n entry: string | null;\n /** Value that configures or reports priority for this contract. */\n priority: number | null;\n /** Filesystem path used for entry resolution. */\n entry_path: string | null;\n /** Whether enabled applies to this operation. */\n enabled: boolean | null;\n /** Lifecycle state reported for status. */\n status: ExtensionStatus;\n}\n\n/** Documents the effective extension payload exchanged by command, SDK, and package integrations. */\nexport interface EffectiveExtension {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports directory for this contract. */\n directory: string;\n /** Filesystem path used for manifest resolution. */\n manifest_path: string;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports source package for this contract. */\n source_package?: string;\n /** Value that configures or reports version for this contract. */\n version: string;\n /** Value that configures or reports entry for this contract. */\n entry: string;\n /** Value that configures or reports priority for this contract. */\n priority: number;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Value that configures or reports manifest version for this contract. */\n manifest_version?: number;\n /** Value that configures or reports pm min version for this contract. */\n pm_min_version?: string;\n /** Value that configures or reports pm max version for this contract. */\n pm_max_version?: string;\n /** Value that configures or reports engines for this contract. */\n engines?: ExtensionManifestEngines;\n /** Value that configures or reports trusted for this contract. */\n trusted?: boolean;\n /** Value that configures or reports provenance for this contract. */\n provenance?: ExtensionProvenanceMetadata;\n /** Value that configures or reports sandbox profile for this contract. */\n sandbox_profile?: ExtensionSandboxProfile;\n /** Value that configures or reports permissions for this contract. */\n permissions?: ExtensionRuntimePermissionDeclaration;\n /** Value that configures or reports capabilities for this contract. */\n capabilities?: string[];\n /** Value that configures or reports activation for this contract. */\n activation?: ExtensionActivationMetadata;\n}\n\n/** Documents the extension discovery result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDiscoveryResult {\n /** Value that configures or reports disabled by flag for this contract. */\n disabled_by_flag: boolean;\n /** Value that configures or reports roots for this contract. */\n roots: {\n global: string;\n project: string;\n };\n /** Value that configures or reports configured enabled for this contract. */\n configured_enabled: string[];\n /** Value that configures or reports configured disabled for this contract. */\n configured_disabled: string[];\n /** Value that configures or reports discovered for this contract. */\n discovered: ExtensionDiagnostic[];\n /** Value that configures or reports effective for this contract. */\n effective: EffectiveExtension[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports policy for this contract. */\n policy: ExtensionGovernancePolicy;\n}\n\n/** Documents the loaded extension payload exchanged by command, SDK, and package integrations. */\nexport interface LoadedExtension extends EffectiveExtension {\n /** Value that configures or reports module for this contract. */\n module: unknown;\n}\n\n/** Documents the failed extension load payload exchanged by command, SDK, and package integrations. */\nexport interface FailedExtensionLoad {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Value that configures or reports error for this contract. */\n error: string;\n}\n\n/** Documents the extension load result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionLoadResult extends ExtensionDiscoveryResult {\n /** Value that configures or reports loaded for this contract. */\n loaded: LoadedExtension[];\n /** Value that configures or reports failed for this contract. */\n failed: FailedExtensionLoad[];\n}\n\n/** Documents the before command hook context payload exchanged by command, SDK, and package integrations. */\nexport interface BeforeCommandHookContext {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n}\n\n/** Documents the after command hook context payload exchanged by command, SDK, and package integrations. */\nexport interface AfterCommandHookContext extends BeforeCommandHookContext {\n /** Whether the operation completed without a blocking failure. */\n ok: boolean;\n /** Value that configures or reports error for this contract. */\n error?: string;\n /** Value that configures or reports result for this contract. */\n result?: unknown;\n /** Value that configures or reports affected for this contract. */\n affected?: AfterCommandAffectedItem[];\n}\n\n/** Documents the after command affected item payload exchanged by command, SDK, and package integrations. */\nexport interface AfterCommandAffectedItem {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports op for this contract. */\n op?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n item_type?: string;\n /** Lifecycle state reported for previousthe record. */\n previous_status?: ItemStatus;\n /** Lifecycle state reported for status. */\n status?: ItemStatus;\n /** Value that configures or reports previous for this contract. */\n previous?: Partial<ItemMetadata>;\n /** Value that configures or reports current for this contract. */\n current?: Partial<ItemMetadata>;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields?: string[];\n}\n\n/** Documents the on write hook context payload exchanged by command, SDK, and package integrations. */\nexport interface OnWriteHookContext {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports scope for this contract. */\n scope: \"project\" | \"global\";\n /** Value that configures or reports op for this contract. */\n op: string;\n /** Value that configures or reports item id for this contract. */\n item_id?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n item_type?: string;\n /** Value that configures or reports before for this contract. */\n before?: ItemDocument;\n /** Value that configures or reports after for this contract. */\n after?: ItemDocument;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields?: string[];\n}\n\n/** Documents the on read hook context payload exchanged by command, SDK, and package integrations. */\nexport interface OnReadHookContext {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports scope for this contract. */\n scope: \"project\" | \"global\";\n}\n\n/** Documents the on index hook context payload exchanged by command, SDK, and package integrations. */\nexport interface OnIndexHookContext {\n /** Value that configures or reports mode for this contract. */\n mode: string;\n /** Value that configures or reports total items for this contract. */\n total_items?: number;\n}\n\n/** Restricts before command hook values accepted by command, SDK, and storage contracts. */\nexport type BeforeCommandHook = (\n context: BeforeCommandHookContext,\n) => Promise<void> | void;\n/** Restricts after command hook values accepted by command, SDK, and storage contracts. */\nexport type AfterCommandHook = (\n context: AfterCommandHookContext,\n) => Promise<void> | void;\n/** Restricts on write hook values accepted by command, SDK, and storage contracts. */\nexport type OnWriteHook = (context: OnWriteHookContext) => Promise<void> | void;\n/** Restricts on read hook values accepted by command, SDK, and storage contracts. */\nexport type OnReadHook = (context: OnReadHookContext) => Promise<void> | void;\n/** Restricts on index hook values accepted by command, SDK, and storage contracts. */\nexport type OnIndexHook = (context: OnIndexHookContext) => Promise<void> | void;\n/** Restricts output renderer format values accepted by command, SDK, and storage contracts. */\nexport type OutputRendererFormat = \"toon\" | \"json\";\n/** Restricts command override values accepted by command, SDK, and storage contracts. */\nexport type CommandOverride = (context: CommandOverrideContext) => unknown;\n/** Restricts renderer override values accepted by command, SDK, and storage contracts. */\nexport type RendererOverride = (\n context: RendererOverrideContext,\n) => string | null | undefined;\n/** Restricts command handler values accepted by command, SDK, and storage contracts. */\nexport type CommandHandler = (context: CommandHandlerContext) => unknown;\n/** Restricts parser override values accepted by command, SDK, and storage contracts. */\nexport type ParserOverride = (\n context: ParserOverrideContext,\n) => ParserOverrideDelta | Promise<ParserOverrideDelta>;\n/** Restricts preflight override values accepted by command, SDK, and storage contracts. */\nexport type PreflightOverride = (\n context: PreflightOverrideContext,\n) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;\n/** Restricts service override values accepted by command, SDK, and storage contracts. */\nexport type ServiceOverride = (context: ServiceOverrideContext) => unknown;\n\n/** Documents the registered extension hook payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionHook<THook> {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports run for this contract. */\n run: THook;\n}\n\n/** Documents the extension hook registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionHookRegistry {\n /** Value that configures or reports before command for this contract. */\n beforeCommand: Array<RegisteredExtensionHook<BeforeCommandHook>>;\n /** Value that configures or reports after command for this contract. */\n afterCommand: Array<RegisteredExtensionHook<AfterCommandHook>>;\n /** Value that configures or reports on write for this contract. */\n onWrite: Array<RegisteredExtensionHook<OnWriteHook>>;\n /** Value that configures or reports on read for this contract. */\n onRead: Array<RegisteredExtensionHook<OnReadHook>>;\n /** Value that configures or reports on index for this contract. */\n onIndex: Array<RegisteredExtensionHook<OnIndexHook>>;\n}\n\n/** Documents the command override context payload exchanged by command, SDK, and package integrations. */\nexport interface CommandOverrideContext {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n}\n\n/** Documents the renderer override context payload exchanged by command, SDK, and package integrations. */\nexport interface RendererOverrideContext {\n /** Value that configures or reports format for this contract. */\n format: OutputRendererFormat;\n /** Value that configures or reports command for this contract. */\n command?: string;\n /** Value that configures or reports args for this contract. */\n args?: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root?: string;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n}\n\n/** Documents the command handler context payload exchanged by command, SDK, and package integrations. */\nexport interface CommandHandlerContext {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n /** Host-bound SDK runtime that avoids package-resolution and private-import coupling. */\n sdk?: ExtensionCommandSdk;\n}\n\n/** Runtime SDK services injected into every extension command invocation. */\nexport interface ExtensionCommandSdk {\n /** Tracker-bound client using the invocation author and workspace. */\n client: PmClient;\n /** Reconstruct one item at a history version or timestamp. */\n getItemAt(id: string, target: string): Promise<GetItemAtResult>;\n /** Open a durable event store with package-contributed relationship semantics. */\n openRelationshipEventStore(options: {\n nodes: Iterable<string>;\n definitions: readonly RelationshipKindDefinition[];\n relativePath?: string;\n }): Promise<RelationshipEventStore>;\n /** Commit idempotent item and relationship mutations under one durable journal. */\n commitWorkspaceTransaction(\n options: Omit<CommitWorkspaceTransactionOptions, \"pmRoot\">,\n ): Promise<WorkspaceTransactionCommitResult>;\n}\n\n/** Documents the parser override context payload exchanged by command, SDK, and package integrations. */\nexport type ParserOverrideContext = CommandHandlerContext;\n\n/** Documents the parser override delta payload exchanged by command, SDK, and package integrations. */\nexport interface ParserOverrideDelta {\n /** Value that configures or reports args for this contract. */\n args?: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n}\n\n/** Documents the preflight override context payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightOverrideContext extends CommandHandlerContext {\n /** Value that configures or reports decision for this contract. */\n decision: PreflightRuntimeDecision;\n}\n\n/** Documents the preflight runtime decision payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightRuntimeDecision {\n /** Value that configures or reports enforce item format gate for this contract. */\n enforce_item_format_gate: boolean;\n /** Executes the preflight item format sync operation through the package runtime. */\n run_preflight_item_format_sync: boolean;\n /** Executes the extension migrations operation through the package runtime. */\n run_extension_migrations: boolean;\n /** Value that configures or reports enforce mandatory migration gate for this contract. */\n enforce_mandatory_migration_gate: boolean;\n}\n\n/** Documents the preflight override delta payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightOverrideDelta extends ParserOverrideDelta {\n /** Value that configures or reports enforce item format gate for this contract. */\n enforce_item_format_gate?: boolean;\n /** Executes the preflight item format sync operation through the package runtime. */\n run_preflight_item_format_sync?: boolean;\n /** Executes the extension migrations operation through the package runtime. */\n run_extension_migrations?: boolean;\n /** Value that configures or reports enforce mandatory migration gate for this contract. */\n enforce_mandatory_migration_gate?: boolean;\n}\n\n/** Documents the service override context payload exchanged by command, SDK, and package integrations. */\nexport interface ServiceOverrideContext {\n /** Value that configures or reports service for this contract. */\n service: ExtensionServiceName;\n /** Value that configures or reports command for this contract. */\n command?: string;\n /** Value that configures or reports args for this contract. */\n args?: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root?: string;\n /** Value that configures or reports payload for this contract. */\n payload: unknown;\n}\n\n/** Documents the extension command argument definition payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionCommandArgumentDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports variadic for this contract. */\n variadic?: boolean;\n /** Value that configures or reports description for this contract. */\n description?: string;\n}\n\n/** Documents the command definition payload exchanged by command, SDK, and package integrations. */\nexport interface CommandDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports run for this contract. */\n run?: CommandHandler;\n /**\n * @deprecated Use `run` instead. This alias remains for backward compatibility.\n */\n handler?: CommandHandler;\n /** Value that configures or reports action for this contract. */\n action?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports intent for this contract. */\n intent?: string;\n /** Value that configures or reports examples for this contract. */\n examples?: string[];\n /** Value that configures or reports failure hints for this contract. */\n failure_hints?: string[];\n /** Value that configures or reports arguments for this contract. */\n arguments?: ExtensionCommandArgumentDefinition[];\n /** Value that configures or reports flags for this contract. */\n flags?: FlagDefinition[];\n}\n\n/**\n * Optional command-definition metadata for first-class importer/exporter\n * registration.\n *\n * `registerImporter`/`registerExporter` always create a `<name> import` /\n * `<name> export` command path. By default that path only has a handler. When\n * these options are supplied, the auto-created command also gains a full command\n * definition (description, flags, intent, examples, failure hints, positional\n * arguments) — surfaced in help and runtime contracts exactly like\n * `registerCommand`. The registration `name` and `run` handler are implicit, so\n * they are not part of this options object.\n */\nexport interface ImportExportRegistrationOptions {\n /** Value that configures or reports action for this contract. */\n action?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports intent for this contract. */\n intent?: string;\n /** Value that configures or reports examples for this contract. */\n examples?: string[];\n /** Value that configures or reports failure hints for this contract. */\n failure_hints?: string[];\n /** Value that configures or reports arguments for this contract. */\n arguments?: ExtensionCommandArgumentDefinition[];\n /** Value that configures or reports flags for this contract. */\n flags?: FlagDefinition[];\n}\n\n/** Restricts flag value type values accepted by command, SDK, and storage contracts. */\nexport type FlagValueType = \"string\" | \"number\" | \"boolean\";\n\n/** Documents the flag definition payload exchanged by command, SDK, and package integrations. */\nexport interface FlagDefinition {\n /** Value that configures or reports long for this contract. */\n long?: string;\n /** Value that configures or reports short for this contract. */\n short?: string;\n /** Value that configures or reports value name for this contract. */\n value_name?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Whether enabled applies to this operation. */\n enabled?: boolean;\n /** Value that configures or reports visible for this contract. */\n visible?: boolean;\n /** Canonical flag value type. Prefer this field; it is the one runtime contracts and help output read first. */\n value_type?: FlagValueType;\n /**\n * @deprecated Use `value_type`. Retained for backward compatibility: when\n * both are present `value_type` wins, and `type` resolves only when\n * `value_type` is absent (`value_type ?? type`).\n */\n type?: FlagValueType;\n /** When true, a repeated comma-list flag accumulates values across repeats — parity with core list flags such as `--tags` — instead of the last value winning. Mirrors the core `CliFlagContract.list` field so extension-registered list flags coalesce through the same bootstrap path. */\n list?: boolean;\n /** Default value applied when the flag is omitted. Surfaced to runtime contracts and help output. A `list` flag may default to an array of scalars (e.g. `[\"a\", \"b\"]`); the array is flattened/coerced like any list value. */\n default?: string | number | boolean | Array<string | number | boolean>;\n [key: string]: unknown;\n}\n\n/** Documents the schema field definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaFieldDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Value that configures or reports optional for this contract. */\n optional?: boolean;\n [key: string]: unknown;\n}\n\n/** Documents the schema item type command option policy definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaItemTypeCommandOptionPolicyDefinition {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports option for this contract. */\n option: string;\n /** Whether enabled applies to this operation. */\n enabled?: boolean;\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports visible for this contract. */\n visible?: boolean;\n [key: string]: unknown;\n}\n\n/** Documents the schema item type option definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaItemTypeOptionDefinition {\n /** Value that configures or reports key for this contract. */\n key: string;\n /** Value that configures or reports values for this contract. */\n values?: string[];\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n [key: string]: unknown;\n}\n\n/** Documents the schema item type definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaItemTypeDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports folder for this contract. */\n folder?: string;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports required create fields for this contract. */\n required_create_fields?: string[];\n /** Value that configures or reports required create repeatables for this contract. */\n required_create_repeatables?: string[];\n /** Value that configures or reports command option policies for this contract. */\n command_option_policies?: SchemaItemTypeCommandOptionPolicyDefinition[];\n /** Value that configures or reports options for this contract. */\n options?: SchemaItemTypeOptionDefinition[];\n [key: string]: unknown;\n}\n\n/** Documents the schema migration run context payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaMigrationRunContext {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports command for this contract. */\n command: \"migration\";\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports extension for this contract. */\n extension: string;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n /** Lifecycle state reported for status. */\n status: string;\n}\n\n/** Restricts schema migration runner values accepted by command, SDK, and storage contracts. */\nexport type SchemaMigrationRunner = (\n context: SchemaMigrationRunContext,\n) => unknown | Promise<unknown>;\n\n/** Documents the schema migration definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaMigrationDefinition {\n /** Stable identifier used to reference this record across commands and storage. */\n id?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Lifecycle state reported for status. */\n status?: string;\n /** Value that configures or reports mandatory for this contract. */\n mandatory?: boolean;\n /** Value that configures or reports run for this contract. */\n run?: SchemaMigrationRunner;\n [key: string]: unknown;\n}\n\n/** Documents the import export context payload exchanged by command, SDK, and package integrations. */\nexport interface ImportExportContext {\n /** Value that configures or reports registration for this contract. */\n registration: string;\n /** Value that configures or reports action for this contract. */\n action: \"import\" | \"export\";\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n}\n\n/** Restricts importer values accepted by command, SDK, and storage contracts. */\nexport type Importer = (\n context: ImportExportContext,\n) => unknown | Promise<unknown>;\n/** Restricts exporter values accepted by command, SDK, and storage contracts. */\nexport type Exporter = (\n context: ImportExportContext,\n) => unknown | Promise<unknown>;\n\n/** Restricts extension search mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\n/** Documents the search provider query context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderQueryContext {\n /** Value that configures or reports query for this contract. */\n query: string;\n /** Value that configures or reports mode for this contract. */\n mode: ExtensionSearchMode;\n /** Value that configures or reports tokens for this contract. */\n tokens: string[];\n /** Value that configures or reports options for this contract. */\n options: Record<string, unknown>;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports documents for this contract. */\n documents: ItemDocument[];\n [key: string]: unknown;\n}\n\n/** Documents the search provider hit payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderHit {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n /** Value that configures or reports matched fields for this contract. */\n matched_fields?: string[];\n [key: string]: unknown;\n}\n\n/** Restricts search provider query result values accepted by command, SDK, and storage contracts. */\nexport type SearchProviderQueryResult =\n | SearchProviderHit[]\n | { hits?: SearchProviderHit[] };\n\n/** Documents the search provider query expansion context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderQueryExpansionContext {\n /** Value that configures or reports query for this contract. */\n query: string;\n /** Value that configures or reports mode for this contract. */\n mode: Exclude<ExtensionSearchMode, \"keyword\">;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Restricts search provider query expansion result values accepted by command, SDK, and storage contracts. */\nexport type SearchProviderQueryExpansionResult =\n | string[]\n | { queries?: string[] };\n\n/** Documents the search provider rerank candidate payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderRerankCandidate {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports text for this contract. */\n text: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n}\n\n/** Documents the search provider rerank hit payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderRerankHit {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n}\n\n/** Restricts search provider rerank result values accepted by command, SDK, and storage contracts. */\nexport type SearchProviderRerankResult =\n | SearchProviderRerankHit[]\n | { hits?: SearchProviderRerankHit[] };\n\n/** Documents the search provider rerank context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderRerankContext {\n /** Value that configures or reports query for this contract. */\n query: string;\n /** Value that configures or reports mode for this contract. */\n mode: \"hybrid\";\n /** Value that configures or reports model for this contract. */\n model: string;\n /** Value that configures or reports top k for this contract. */\n top_k: number;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports candidates for this contract. */\n candidates: SearchProviderRerankCandidate[];\n [key: string]: unknown;\n}\n\n/** Documents the search provider embed batch context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderEmbedBatchContext {\n /** Value that configures or reports inputs for this contract. */\n inputs: string[];\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports model for this contract. */\n model: string;\n [key: string]: unknown;\n}\n\n/** Documents the search provider embed context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderEmbedContext {\n /** Value that configures or reports input for this contract. */\n input: string;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports model for this contract. */\n model: string;\n [key: string]: unknown;\n}\n\n/** Documents the search provider definition payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports query for this contract. */\n query?: (\n context: SearchProviderQueryContext,\n ) => SearchProviderQueryResult | Promise<SearchProviderQueryResult>;\n /** Value that configures or reports query expansion for this contract. */\n queryExpansion?: (\n context: SearchProviderQueryExpansionContext,\n ) =>\n | SearchProviderQueryExpansionResult\n | Promise<SearchProviderQueryExpansionResult>;\n /** Value that configures or reports query expansion for this contract. */\n query_expansion?: (\n context: SearchProviderQueryExpansionContext,\n ) =>\n | SearchProviderQueryExpansionResult\n | Promise<SearchProviderQueryExpansionResult>;\n /** Value that configures or reports rerank for this contract. */\n rerank?: (\n context: SearchProviderRerankContext,\n ) => SearchProviderRerankResult | Promise<SearchProviderRerankResult>;\n /** Value that configures or reports embed batch for this contract. */\n embedBatch?: (\n context: SearchProviderEmbedBatchContext,\n ) => number[][] | Promise<number[][]>;\n /** Value that configures or reports embed batch for this contract. */\n embed_batch?: (\n context: SearchProviderEmbedBatchContext,\n ) => number[][] | Promise<number[][]>;\n /** Value that configures or reports embed for this contract. */\n embed?: (context: SearchProviderEmbedContext) => number[] | Promise<number[]>;\n [key: string]: unknown;\n}\n\n/** Documents the vector store query hit payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreQueryHit {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n /** Value that configures or reports payload for this contract. */\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\n/** Documents the vector store query context payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreQueryContext {\n /** Value that configures or reports vector for this contract. */\n vector: number[];\n /** Value that configures or reports limit for this contract. */\n limit: number;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Documents the vector store upsert point payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreUpsertPoint {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports vector for this contract. */\n vector: number[];\n /** Value that configures or reports payload for this contract. */\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\n/** Documents the vector store upsert context payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreUpsertContext {\n /** Value that configures or reports points for this contract. */\n points: VectorStoreUpsertPoint[];\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Documents the vector store delete context payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreDeleteContext {\n /** Value that configures or reports ids for this contract. */\n ids: string[];\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Documents the vector store adapter definition payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreAdapterDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports query for this contract. */\n query?: (\n context: VectorStoreQueryContext,\n ) => VectorStoreQueryHit[] | Promise<VectorStoreQueryHit[]>;\n /** Value that configures or reports upsert for this contract. */\n upsert?: (context: VectorStoreUpsertContext) => unknown | Promise<unknown>;\n /** Value that configures or reports delete for this contract. */\n delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;\n [key: string]: unknown;\n}\n\n/** Documents the registered extension command override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionCommandOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports run for this contract. */\n run: CommandOverride;\n}\n\n/** Documents the registered extension command handler payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionCommandHandler {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports run for this contract. */\n run: CommandHandler;\n}\n\n/** Documents the registered extension parser override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionParserOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports run for this contract. */\n run: ParserOverride;\n}\n\n/** Documents the registered extension preflight override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionPreflightOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports run for this contract. */\n run: PreflightOverride;\n}\n\n/** Documents the registered extension service override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionServiceOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports service for this contract. */\n service: ExtensionServiceName;\n /** Value that configures or reports run for this contract. */\n run: ServiceOverride;\n}\n\n/** Documents the registered extension renderer override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionRendererOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports format for this contract. */\n format: OutputRendererFormat;\n /** Value that configures or reports run for this contract. */\n run: RendererOverride;\n}\n\n/** Documents the extension command registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionCommandRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionCommandOverride[];\n /** Value that configures or reports handlers for this contract. */\n handlers: RegisteredExtensionCommandHandler[];\n}\n\n/** Documents the extension parser registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionParserRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionParserOverride[];\n}\n\n/** Documents the extension preflight registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionPreflightRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionPreflightOverride[];\n}\n\n/** Documents the extension service registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionServiceRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionServiceOverride[];\n}\n\n/** Documents the extension renderer registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRendererRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionRendererOverride[];\n}\n\n/** Documents the registered extension flag definitions payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionFlagDefinitions {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports target command for this contract. */\n target_command: string;\n /** Value that configures or reports flags for this contract. */\n flags: FlagDefinition[];\n}\n\n/** Documents the registered extension command definition payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionCommandDefinition {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports source package for this contract. */\n source_package?: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports action for this contract. */\n action: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports intent for this contract. */\n intent?: string;\n /** Value that configures or reports examples for this contract. */\n examples: string[];\n /** Value that configures or reports failure hints for this contract. */\n failure_hints: string[];\n /** Value that configures or reports arguments for this contract. */\n arguments: ExtensionCommandArgumentDefinition[];\n}\n\n/** Documents the registered extension schema field definitions payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSchemaFieldDefinitions {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports fields for this contract. */\n fields: SchemaFieldDefinition[];\n}\n\n/** Documents the registered extension schema item type definitions payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSchemaItemTypeDefinitions {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports types for this contract. */\n types: SchemaItemTypeDefinition[];\n}\n\n/** Relationship ontology definitions contributed by one active extension. */\nexport interface RegisteredExtensionRelationshipKindDefinitions {\n /** Extension layer that owns these definitions. */\n layer: ExtensionLayer;\n /** Extension name that owns these definitions. */\n name: string;\n /** Validated immutable relationship-kind definitions. */\n definitions: RelationshipKindDefinition[];\n}\n\n/** Documents the registered extension schema migration definition payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSchemaMigrationDefinition {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports definition for this contract. */\n definition: SchemaMigrationDefinition;\n /** Value that configures or reports runtime definition for this contract. */\n runtime_definition: SchemaMigrationDefinition;\n}\n\n/** Documents the registered extension importer payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionImporter {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports importer for this contract. */\n importer: string;\n}\n\n/** Documents the registered extension exporter payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionExporter {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports exporter for this contract. */\n exporter: string;\n}\n\n/** Documents the registered extension search provider payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSearchProvider {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports definition for this contract. */\n definition: SearchProviderDefinition;\n /** Value that configures or reports runtime definition for this contract. */\n runtime_definition: SearchProviderDefinition;\n}\n\n/** Documents the registered extension vector store adapter payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionVectorStoreAdapter {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports definition for this contract. */\n definition: VectorStoreAdapterDefinition;\n /** Value that configures or reports runtime definition for this contract. */\n runtime_definition: VectorStoreAdapterDefinition;\n}\n\n/**\n * Documents a project profile contributed by an extension via\n * `api.registerProfile(profile)`.\n *\n * A profile is the broadest customization primitive an extension can ship: it\n * bundles item types, custom statuses, fields, per-type workflows, config knobs,\n * create templates, and package recommendations into one declarative archetype\n * that `pm profile apply` stages idempotently — the same shape as the\n * core-baked archetypes. Registering one makes it resolvable by name through\n * `pm profile list/show/apply` for as long as the owning package is active.\n */\nexport interface RegisteredExtensionProjectProfile {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports profile for this contract. */\n profile: ProjectProfileDefinition;\n}\n\n/** Documents the extension registration registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRegistrationRegistry {\n /** Value that configures or reports commands for this contract. */\n commands: RegisteredExtensionCommandDefinition[];\n /** Value that configures or reports flags for this contract. */\n flags: RegisteredExtensionFlagDefinitions[];\n /** Value that configures or reports item fields for this contract. */\n item_fields: RegisteredExtensionSchemaFieldDefinitions[];\n /** Value that configures or reports item types for this contract. */\n item_types: RegisteredExtensionSchemaItemTypeDefinitions[];\n /** Value that configures application-defined relationship semantics. */\n relationship_kinds: RegisteredExtensionRelationshipKindDefinitions[];\n /** Value that configures or reports migrations for this contract. */\n migrations: RegisteredExtensionSchemaMigrationDefinition[];\n /** Value that configures or reports profiles for this contract. */\n profiles: RegisteredExtensionProjectProfile[];\n /** Value that configures or reports importers for this contract. */\n importers: RegisteredExtensionImporter[];\n /** Value that configures or reports exporters for this contract. */\n exporters: RegisteredExtensionExporter[];\n /** Value that configures or reports search providers for this contract. */\n search_providers: RegisteredExtensionSearchProvider[];\n /** Value that configures or reports vector store adapters for this contract. */\n vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];\n}\n\n/** Documents the extension registration counts payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRegistrationCounts {\n /** Value that configures or reports commands for this contract. */\n commands: number;\n /** Value that configures or reports flags for this contract. */\n flags: number;\n /** Value that configures or reports item fields for this contract. */\n item_fields: number;\n /** Value that configures or reports item types for this contract. */\n item_types: number;\n /** Number of application-defined relationship kinds. */\n relationship_kinds?: number;\n /** Value that configures or reports migrations for this contract. */\n migrations: number;\n /** Value that configures or reports profiles for this contract. */\n profiles: number;\n /** Value that configures or reports importers for this contract. */\n importers: number;\n /** Value that configures or reports exporters for this contract. */\n exporters: number;\n /** Value that configures or reports search providers for this contract. */\n search_providers: number;\n /** Value that configures or reports vector store adapters for this contract. */\n vector_store_adapters: number;\n}\n\n/** Read-only identity an extension's `activate(api)` receives about itself, so authors can emit self-identifying logs, gate on their own version, and build better error messages without re-reading the on-disk manifest or duplicating metadata in-module. Exposed as `api.extension`. */\nexport interface ExtensionSelfIdentity {\n /** Value that configures or reports name for this contract. */\n readonly name: string;\n /** Value that configures or reports layer for this contract. */\n readonly layer: ExtensionLayer;\n /** Value that configures or reports version for this contract. */\n readonly version: string;\n /** Value that configures or reports capabilities for this contract. */\n readonly capabilities: readonly ExtensionCapability[];\n /** Value that configures or reports pm min version for this contract. */\n readonly pm_min_version?: string;\n /** Value that configures or reports pm max version for this contract. */\n readonly pm_max_version?: string;\n /** Value that configures or reports source package for this contract. */\n readonly source_package?: string;\n}\n\n/** Documents the extension api payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionApi {\n /** Read-only identity of the extension this `api` was created for. */\n readonly extension: ExtensionSelfIdentity;\n /** Value that configures or reports register command for this contract. */\n registerCommand(command: string, override: CommandOverride): void;\n /** Value that configures or reports register command for this contract. */\n registerCommand(definition: CommandDefinition): void;\n /** Value that configures or reports register parser for this contract. */\n registerParser(command: string, override: ParserOverride): void;\n /** Value that configures or reports register preflight for this contract. */\n registerPreflight(override: PreflightOverride): void;\n /** Value that configures or reports register service for this contract. */\n registerService(\n service: ExtensionServiceName,\n override: ServiceOverride,\n ): void;\n /** Value that configures or reports register flags for this contract. */\n registerFlags(targetCommand: string, flags: FlagDefinition[]): void;\n /** Value that configures or reports register item fields for this contract. */\n registerItemFields(fields: SchemaFieldDefinition[]): void;\n /** Value that configures or reports register item types for this contract. */\n registerItemTypes(types: SchemaItemTypeDefinition[]): void;\n /** Register versioned relationship semantics consumed by every graph surface. */\n registerRelationshipKinds(definitions: RelationshipKindDefinition[]): void;\n /** Value that configures or reports register migration for this contract. */\n registerMigration(definition: SchemaMigrationDefinition): void;\n /** Value that configures or reports register profile for this contract. */\n registerProfile(profile: ProjectProfileRegistrationInput): void;\n /** Value that configures or reports register renderer for this contract. */\n registerRenderer(\n format: OutputRendererFormat,\n renderer: RendererOverride,\n ): void;\n /** Value that configures or reports register importer for this contract. */\n registerImporter(\n name: string,\n importer: Importer,\n options?: ImportExportRegistrationOptions,\n ): void;\n /** Value that configures or reports register exporter for this contract. */\n registerExporter(\n name: string,\n exporter: Exporter,\n options?: ImportExportRegistrationOptions,\n ): void;\n /** Value that configures or reports register search provider for this contract. */\n registerSearchProvider(provider: SearchProviderDefinition): void;\n /** Value that configures or reports register vector store adapter for this contract. */\n registerVectorStoreAdapter(adapter: VectorStoreAdapterDefinition): void;\n /** Value that configures or reports hooks for this contract. */\n hooks: {\n beforeCommand(hook: BeforeCommandHook): void;\n afterCommand(hook: AfterCommandHook): void;\n onWrite(hook: OnWriteHook): void;\n onRead(hook: OnReadHook): void;\n onIndex(hook: OnIndexHook): void;\n };\n}\n\n/** Documents the failed extension activation payload exchanged by command, SDK, and package integrations. */\nexport interface FailedExtensionActivation {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Value that configures or reports error for this contract. */\n error: string;\n /** Value that configures or reports trace for this contract. */\n trace?: ExtensionActivationFailureTrace;\n}\n\n/** Documents the extension activation failure trace payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionActivationFailureTrace {\n /** Value that configures or reports method for this contract. */\n method: string;\n /** `-1` means the failure happened before a numbered registration was accepted. */\n registration_index: number;\n /** Value that configures or reports command for this contract. */\n command?: string;\n /** Value that configures or reports capability for this contract. */\n capability?: ExtensionCapability;\n /** Value that configures or reports missing capability for this contract. */\n missing_capability?: ExtensionCapability;\n /** Value that configures or reports expected schema for this contract. */\n expected_schema: string;\n /** Value that configures or reports received for this contract. */\n received?: unknown;\n /** Value that configures or reports hint for this contract. */\n hint?: string;\n}\n\n/** Documents the extension activation result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionActivationResult {\n /** Value that configures or reports hooks for this contract. */\n hooks: ExtensionHookRegistry;\n /** Value that configures or reports commands for this contract. */\n commands: ExtensionCommandRegistry;\n /** Value that configures or reports parsers for this contract. */\n parsers: ExtensionParserRegistry;\n /** Value that configures or reports preflight for this contract. */\n preflight: ExtensionPreflightRegistry;\n /** Value that configures or reports services for this contract. */\n services: ExtensionServiceRegistry;\n /** Value that configures or reports renderers for this contract. */\n renderers: ExtensionRendererRegistry;\n /** Value that configures or reports registrations for this contract. */\n registrations: ExtensionRegistrationRegistry;\n /** Value that configures or reports failed for this contract. */\n failed: FailedExtensionActivation[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports hook counts for this contract. */\n hook_counts: {\n before_command: number;\n after_command: number;\n on_write: number;\n on_read: number;\n on_index: number;\n };\n /** Number of command override entries represented by this result. */\n command_override_count: number;\n /** Number of command handler entries represented by this result. */\n command_handler_count: number;\n /** Number of parser override entries represented by this result. */\n parser_override_count: number;\n /** Number of preflight override entries represented by this result. */\n preflight_override_count: number;\n /** Number of service override entries represented by this result. */\n service_override_count: number;\n /** Number of renderer override entries represented by this result. */\n renderer_override_count: number;\n /** Value that configures or reports registration counts for this contract. */\n registration_counts: ExtensionRegistrationCounts;\n}\n\n/** Documents the extension candidate payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionCandidate {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports directory for this contract. */\n directory: string;\n /** Filesystem path used for manifest resolution. */\n manifest_path: string;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Declarative package manifest consumed by the extension loader. */\n manifest: ExtensionManifest;\n /** Value that configures or reports source package for this contract. */\n source_package?: string;\n}\n\n/** Documents the extension layer scan result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionLayerScanResult {\n /** Value that configures or reports diagnostics for this contract. */\n diagnostics: ExtensionDiagnostic[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports candidates for this contract. */\n candidates: ExtensionCandidate[];\n}\n\n/** Documents the scanned extension directory payload exchanged by command, SDK, and package integrations. */\nexport interface ScannedExtensionDirectory {\n /** Value that configures or reports diagnostic for this contract. */\n diagnostic: ExtensionDiagnostic;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports candidate for this contract. */\n candidate: ExtensionCandidate | null;\n}\n\n/** Documents the legacy extension capability alias mapping payload exchanged by command, SDK, and package integrations. */\nexport interface LegacyExtensionCapabilityAliasMapping {\n /** Value that configures or reports alias for this contract. */\n alias: string;\n /** Value that configures or reports target for this contract. */\n target: ExtensionCapability;\n}\n\n/** Documents the discover extensions options payload exchanged by command, SDK, and package integrations. */\nexport interface DiscoverExtensionsOptions {\n /** Value that configures or reports pm root for this contract. */\n pmRoot: string;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports cwd for this contract. */\n cwd?: string;\n /** Value that configures or reports no extensions for this contract. */\n noExtensions?: boolean;\n /** Value that configures or reports ignore global extensions for this contract. */\n ignoreGlobalExtensions?: boolean;\n /** Value that configures or reports reload token for this contract. */\n reload_token?: string;\n /** Value that configures or reports cache bust for this contract. */\n cache_bust?: boolean;\n /** Optional import-stage filter. Discovery still reports the full effective set, but `loadExtensions` imports only entries accepted by this predicate. */\n extensionFilter?: (extension: EffectiveExtension) => boolean;\n}\n\n/** Documents the activatable extension payload exchanged by command, SDK, and package integrations. */\nexport interface ActivatableExtension {\n /** Registers this package's commands, actions, and runtime hooks with the host. */\n activate: (api: ExtensionApi) => void | Promise<void>;\n /** Optional teardown lifecycle hook, analogous to VS Code's `deactivate` export. Invoked when the host tears the extension down — on long-running MCP-server reload between requests, or via the `deactivateExtensions` primitive — so an extension can close connections, clear timers, and release buffers it opened during `activate`. */\n deactivate?: () => void | Promise<void>;\n}\n\n/** Documents the extension deactivation failure payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDeactivationFailure {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports error for this contract. */\n error: string;\n}\n\n/** Documents the extension deactivation options payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDeactivationOptions {\n /** Maximum time to wait for each extension's `deactivate` hook. Defaults to 5000ms so a hanging teardown cannot block host shutdown or reload. Set to 0 or Infinity only when the host intentionally wants to wait indefinitely. */\n deactivate_timeout_ms?: number;\n}\n\n/** Documents the extension deactivation result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDeactivationResult {\n /** Count of loaded extensions whose `deactivate` hook ran without throwing. */\n deactivated: number;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports failed for this contract. */\n failed: ExtensionDeactivationFailure[];\n}\n\n/** Documents the service override result payload exchanged by command, SDK, and package integrations. */\nexport interface ServiceOverrideResult {\n /** Value that configures or reports handled for this contract. */\n handled: boolean;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the command override result payload exchanged by command, SDK, and package integrations. */\nexport interface CommandOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the command handler result payload exchanged by command, SDK, and package integrations. */\nexport interface CommandHandlerResult {\n /** Value that configures or reports handled for this contract. */\n handled: boolean;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Human-readable, single-line, length-bounded message describing why an extension command handler failed. Surfaced to the user/CI so the real cause (e.g. \"Changelog is out of date: CHANGELOG.md\") is visible instead of only the opaque `extension_command_handler_failed` warning code. */\n errorMessage?: string;\n}\n\n/** Documents the parser override result payload exchanged by command, SDK, and package integrations. */\nexport interface ParserOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports context for this contract. */\n context: CommandHandlerContext;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the preflight override result payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports context for this contract. */\n context: CommandHandlerContext;\n /** Value that configures or reports decision for this contract. */\n decision: PreflightRuntimeDecision;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the renderer override result payload exchanged by command, SDK, and package integrations. */\nexport interface RendererOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports rendered for this contract. */\n rendered: string | null;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the unknown extension capability warning details payload exchanged by command, SDK, and package integrations. */\nexport interface UnknownExtensionCapabilityWarningDetails {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports capability for this contract. */\n capability: string;\n /** Value that configures or reports allowed capabilities for this contract. */\n allowed_capabilities: string[];\n /** Value that configures or reports capability contract version for this contract. */\n capability_contract_version: number;\n /** Value that configures or reports suggested capability for this contract. */\n suggested_capability?: string;\n /** Value that configures or reports suggestion source for this contract. */\n suggestion_source?: \"legacy_alias\" | \"nearest_match\";\n /** Value that configures or reports legacy alias target for this contract. */\n legacy_alias_target?: string;\n}\n"],"names":[],"mappings":"AA+BA,wGAAwG;;;AACxG,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,UAAU;IACV,WAAW;IACX,OAAO;IACP,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;CACF,CAAC;AAGX,iHAAiH;AACjH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,+GAA+G;AAC/G,MAAM,CAAC,MAAM,mCAAmC,GAE5C,MAAM,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC;AACH,yGAAyG;AACzG,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,qCAAqC;IAC9C,YAAY,EAAE,CAAC,GAAG,4BAA4B,CAAC;IAC/C,cAAc,EAAE,EAAE,GAAG,mCAAmC,EAAE;CAC3D,CAAC,CAAC;AAEH,wGAAwG;AACxG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAGhF,uGAAuG;AACvG,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAG/E,4GAA4G;AAC5G,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,MAAM;IACN,YAAY;IACZ,QAAQ;CACA,CAAC;AAKX,+GAA+G;AAC/G,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAgB9E,2GAA2G;AAC3G,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,eAAe;IACf,cAAc;IACd,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,0BAA0B;IAC1B,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;CACZ,CAAC;AAKX,yGAAyG;AACzG,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,eAAe;IACf,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;CACR,CAAC;AAuDX,2GAA2G;AAC3G,MAAM,UAAU,sCAAsC;IACpD,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,kBAAkB,EAAE,EAAE;QACtB,uBAAuB,EAAE,MAAM;QAC/B,kBAAkB,EAAE,EAAE;QACtB,kBAAkB,EAAE,EAAE;QACtB,oBAAoB,EAAE,EAAE;QACxB,oBAAoB,EAAE,EAAE;QACxB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,mBAAmB,EAAE,EAAE;KACxB,CAAC;AACJ,CAAC","debugId":"765cc85b-c5c2-5021-8237-60235d3726df"}
1
+ {"version":3,"file":"extension-types.js","sources":["core/extensions/extension-types.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/extensions/extension-types\n *\n * Implements extension runtime contracts and governance for Extension Types.\n */\nimport type {\n ExtensionPolicyOverrideSettings,\n ExtensionPolicySettings,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n PmSettings,\n} from \"../../types/index.js\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\nimport type {\n ProjectProfileDefinition,\n ProjectProfileRegistrationInput,\n} from \"../profile/profile-presets.js\";\nimport type { RelationshipKindDefinition } from \"../../sdk/relationships.js\";\nimport type { PmClient } from \"../../sdk/runtime.js\";\nimport type {\n GetItemAtResult,\n} from \"../../sdk/history-read.js\";\nimport type {\n RelationshipEventStore,\n} from \"../../sdk/relationship-history.js\";\nimport type {\n CommitWorkspaceTransactionOptions,\n WorkspaceTransactionCommitResult,\n} from \"../../sdk/workspace-transaction.js\";\n\n/** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_CAPABILITIES = [\n \"commands\",\n \"renderers\",\n \"hooks\",\n \"schema\",\n \"importers\",\n \"search\",\n \"parser\",\n \"preflight\",\n \"services\",\n] as const;\n/** Restricts extension capability values accepted by command, SDK, and storage contracts. */\nexport type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];\n/** Public contract for extension capability contract version, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_CAPABILITY_CONTRACT_VERSION = 2;\n/** Public contract for extension capability legacy aliases, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_CAPABILITY_LEGACY_ALIASES: Readonly<\n Record<string, ExtensionCapability>\n> = Object.freeze({\n migration: \"schema\",\n validation: \"schema\",\n});\n/** Public contract for extension capability contract, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_CAPABILITY_CONTRACT = Object.freeze({\n version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n capabilities: [...KNOWN_EXTENSION_CAPABILITIES],\n legacy_aliases: { ...EXTENSION_CAPABILITY_LEGACY_ALIASES },\n});\n\n/** Public contract for known extension policy modes, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_POLICY_MODES = [\"off\", \"warn\", \"enforce\"] as const;\n/** Restricts extension policy mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyMode = (typeof KNOWN_EXTENSION_POLICY_MODES)[number];\n/** Public contract for known extension trust modes, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_TRUST_MODES = [\"off\", \"warn\", \"enforce\"] as const;\n/** Restricts extension trust mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionTrustMode = (typeof KNOWN_EXTENSION_TRUST_MODES)[number];\n/** Public contract for known extension sandbox profiles, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_SANDBOX_PROFILES = [\n \"none\",\n \"restricted\",\n \"strict\",\n] as const;\n/** Restricts extension sandbox profile values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSandboxProfile =\n (typeof KNOWN_EXTENSION_SANDBOX_PROFILES)[number];\n\n/** Public contract for known pm max version exceeded modes, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_PM_MAX_VERSION_EXCEEDED_MODES = [\"block\", \"warn\"] as const;\n/** How a `pm_max_version` violation is handled for an extension layer. */\nexport type PmMaxVersionExceededMode =\n (typeof KNOWN_PM_MAX_VERSION_EXCEEDED_MODES)[number];\n/** Optional per-layer override map for `extensions.policy.pm_max_version_exceeded_mode`. */\nexport interface PmMaxVersionExceededModeByLayer {\n /** Value that configures or reports global for this contract. */\n global?: PmMaxVersionExceededMode;\n /** Value that configures or reports project for this contract. */\n project?: PmMaxVersionExceededMode;\n}\n/** Settings value for `extensions.policy.pm_max_version_exceeded_mode`: either a single mode applied to both layers, or a per-layer override map. Unset (and any unset layer key) defaults to `\"block\"`. */\nexport type PmMaxVersionExceededModeSetting =\n | PmMaxVersionExceededMode\n | PmMaxVersionExceededModeByLayer;\n\n/** Public contract for known extension policy surfaces, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_POLICY_SURFACES = [\n \"commands.override\",\n \"commands.handler\",\n \"hooks.beforecommand\",\n \"hooks.aftercommand\",\n \"hooks.onwrite\",\n \"hooks.onread\",\n \"hooks.onindex\",\n \"schema.flags\",\n \"schema.itemfields\",\n \"schema.itemtypes\",\n \"schema.relationshipkinds\",\n \"schema.migrations\",\n \"schema.profiles\",\n \"parser.override\",\n \"preflight.override\",\n \"services.override\",\n \"renderers.override\",\n \"importers.importer\",\n \"importers.exporter\",\n \"search.provider\",\n \"search.vectorstore\",\n] as const;\n/** Restricts extension policy surface values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicySurface =\n (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];\n\n/** Public contract for known extension service names, shared by SDK and presentation-layer consumers. */\nexport const KNOWN_EXTENSION_SERVICE_NAMES = [\n \"output_format\",\n \"error_format\",\n \"help_format\",\n \"lock_acquire\",\n \"lock_release\",\n \"history_append\",\n \"item_store_write\",\n \"item_store_delete\",\n \"context_relevance\",\n \"command_result\",\n] as const;\n/** Restricts extension service name values accepted by command, SDK, and storage contracts. */\nexport type ExtensionServiceName =\n (typeof KNOWN_EXTENSION_SERVICE_NAMES)[number];\n\n/** Documents the extension provenance metadata payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionProvenanceMetadata {\n /** Value that configures or reports source for this contract. */\n source?: string;\n /** Value that configures or reports signature for this contract. */\n signature?: string;\n /** Value that configures or reports attestation for this contract. */\n attestation?: string;\n /** Value that configures or reports verified for this contract. */\n verified?: boolean;\n}\n\n/** Documents the extension runtime permission declaration payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRuntimePermissionDeclaration {\n /** Value that configures or reports fs read for this contract. */\n fs_read?: boolean;\n /** Value that configures or reports fs write for this contract. */\n fs_write?: boolean;\n /** Value that configures or reports network for this contract. */\n network?: boolean;\n /** Value that configures or reports env read for this contract. */\n env_read?: boolean;\n /** Value that configures or reports env write for this contract. */\n env_write?: boolean;\n /** Value that configures or reports process spawn for this contract. */\n process_spawn?: boolean;\n}\n\n/** Documents the extension activation metadata payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionActivationMetadata {\n /** Value that configures or reports commands for this contract. */\n commands?: string[];\n}\n\n/** Restricts extension policy override values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyOverride = ExtensionPolicyOverrideSettings;\n/** Extension governance policy as read from / serialized to settings. Extends the stored settings shape with `pm_max_version_exceeded_mode` (pm-k5e8), which relaxes the default-BLOCK on `pm_max_version` violations to warn-only — globally or per extension layer. */\nexport type ExtensionGovernancePolicy = ExtensionPolicySettings & {\n pm_max_version_exceeded_mode?: PmMaxVersionExceededModeSetting;\n};\n\n/** Documents the extension manifest engines payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionManifestEngines {\n /** Value that configures or reports pm for this contract. */\n pm?: string;\n /** Value that configures or reports node for this contract. */\n node?: string;\n [engine: string]: string | undefined;\n}\n\n/** Implements create default extension governance policy for the public runtime surface of this module. */\nexport function createDefaultExtensionGovernancePolicy(): ExtensionGovernancePolicy {\n return {\n mode: \"off\",\n trust_mode: \"off\",\n require_provenance: false,\n trusted_extensions: [],\n default_sandbox_profile: \"none\",\n allowed_extensions: [],\n blocked_extensions: [],\n allowed_capabilities: [],\n blocked_capabilities: [],\n allowed_surfaces: [],\n blocked_surfaces: [],\n allowed_commands: [],\n blocked_commands: [],\n allowed_actions: [],\n blocked_actions: [],\n allowed_services: [],\n blocked_services: [],\n extension_overrides: [],\n };\n}\n\n/** Restricts extension layer values accepted by command, SDK, and storage contracts. */\nexport type ExtensionLayer = \"global\" | \"project\";\n/** Restricts extension status values accepted by command, SDK, and storage contracts. */\nexport type ExtensionStatus = \"ok\" | \"warn\";\n\n/** Documents the extension manifest payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionManifest {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports version for this contract. */\n version: string;\n /** Value that configures or reports entry for this contract. */\n entry: string;\n /** Value that configures or reports priority for this contract. */\n priority: number;\n /** Value that configures or reports capabilities for this contract. */\n capabilities: string[];\n /** Value that configures or reports manifest version for this contract. */\n manifest_version?: number;\n /** Value that configures or reports pm min version for this contract. */\n pm_min_version?: string;\n /** Value that configures or reports pm max version for this contract. */\n pm_max_version?: string;\n /** Value that configures or reports engines for this contract. */\n engines?: ExtensionManifestEngines;\n /** Value that configures or reports trusted for this contract. */\n trusted?: boolean;\n /** Value that configures or reports provenance for this contract. */\n provenance?: ExtensionProvenanceMetadata;\n /** Value that configures or reports sandbox profile for this contract. */\n sandbox_profile?: ExtensionSandboxProfile;\n /** Value that configures or reports permissions for this contract. */\n permissions?: ExtensionRuntimePermissionDeclaration;\n /** Value that configures or reports activation for this contract. */\n activation?: ExtensionActivationMetadata;\n /** Value that configures or reports legacy capability aliases for this contract. */\n legacy_capability_aliases?: LegacyExtensionCapabilityAliasMapping[];\n}\n\n/** Documents the extension diagnostic payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDiagnostic {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports directory for this contract. */\n directory: string;\n /** Filesystem path used for manifest resolution. */\n manifest_path: string;\n /** Value that configures or reports name for this contract. */\n name: string | null;\n /** Value that configures or reports version for this contract. */\n version: string | null;\n /** Value that configures or reports entry for this contract. */\n entry: string | null;\n /** Value that configures or reports priority for this contract. */\n priority: number | null;\n /** Filesystem path used for entry resolution. */\n entry_path: string | null;\n /** Whether enabled applies to this operation. */\n enabled: boolean | null;\n /** Lifecycle state reported for status. */\n status: ExtensionStatus;\n}\n\n/** Documents the effective extension payload exchanged by command, SDK, and package integrations. */\nexport interface EffectiveExtension {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports directory for this contract. */\n directory: string;\n /** Filesystem path used for manifest resolution. */\n manifest_path: string;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports source package for this contract. */\n source_package?: string;\n /** Value that configures or reports version for this contract. */\n version: string;\n /** Value that configures or reports entry for this contract. */\n entry: string;\n /** Value that configures or reports priority for this contract. */\n priority: number;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Value that configures or reports manifest version for this contract. */\n manifest_version?: number;\n /** Value that configures or reports pm min version for this contract. */\n pm_min_version?: string;\n /** Value that configures or reports pm max version for this contract. */\n pm_max_version?: string;\n /** Value that configures or reports engines for this contract. */\n engines?: ExtensionManifestEngines;\n /** Value that configures or reports trusted for this contract. */\n trusted?: boolean;\n /** Value that configures or reports provenance for this contract. */\n provenance?: ExtensionProvenanceMetadata;\n /** Value that configures or reports sandbox profile for this contract. */\n sandbox_profile?: ExtensionSandboxProfile;\n /** Value that configures or reports permissions for this contract. */\n permissions?: ExtensionRuntimePermissionDeclaration;\n /** Value that configures or reports capabilities for this contract. */\n capabilities?: string[];\n /** Value that configures or reports activation for this contract. */\n activation?: ExtensionActivationMetadata;\n}\n\n/** Documents the extension discovery result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDiscoveryResult {\n /** Value that configures or reports disabled by flag for this contract. */\n disabled_by_flag: boolean;\n /** Value that configures or reports roots for this contract. */\n roots: {\n global: string;\n project: string;\n };\n /** Value that configures or reports configured enabled for this contract. */\n configured_enabled: string[];\n /** Value that configures or reports configured disabled for this contract. */\n configured_disabled: string[];\n /** Value that configures or reports discovered for this contract. */\n discovered: ExtensionDiagnostic[];\n /** Value that configures or reports effective for this contract. */\n effective: EffectiveExtension[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports policy for this contract. */\n policy: ExtensionGovernancePolicy;\n}\n\n/** Documents the loaded extension payload exchanged by command, SDK, and package integrations. */\nexport interface LoadedExtension extends EffectiveExtension {\n /** Value that configures or reports module for this contract. */\n module: unknown;\n}\n\n/** Documents the failed extension load payload exchanged by command, SDK, and package integrations. */\nexport interface FailedExtensionLoad {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Value that configures or reports error for this contract. */\n error: string;\n}\n\n/** Documents the extension load result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionLoadResult extends ExtensionDiscoveryResult {\n /** Value that configures or reports loaded for this contract. */\n loaded: LoadedExtension[];\n /** Value that configures or reports failed for this contract. */\n failed: FailedExtensionLoad[];\n}\n\n/** Documents the before command hook context payload exchanged by command, SDK, and package integrations. */\nexport interface BeforeCommandHookContext {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n}\n\n/** Documents the after command hook context payload exchanged by command, SDK, and package integrations. */\nexport interface AfterCommandHookContext extends BeforeCommandHookContext {\n /** Whether the operation completed without a blocking failure. */\n ok: boolean;\n /** Value that configures or reports error for this contract. */\n error?: string;\n /** Value that configures or reports result for this contract. */\n result?: unknown;\n /** Value that configures or reports affected for this contract. */\n affected?: AfterCommandAffectedItem[];\n}\n\n/** Documents the after command affected item payload exchanged by command, SDK, and package integrations. */\nexport interface AfterCommandAffectedItem {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports op for this contract. */\n op?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n item_type?: string;\n /** Status id the item held before this mutation. */\n previous_status?: ItemStatus;\n /** Lifecycle state reported for status. */\n status?: ItemStatus;\n /** Value that configures or reports previous for this contract. */\n previous?: Partial<ItemMetadata>;\n /** Value that configures or reports current for this contract. */\n current?: Partial<ItemMetadata>;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields?: string[];\n}\n\n/** Documents the on write hook context payload exchanged by command, SDK, and package integrations. */\nexport interface OnWriteHookContext {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports scope for this contract. */\n scope: \"project\" | \"global\";\n /** Value that configures or reports op for this contract. */\n op: string;\n /** Value that configures or reports item id for this contract. */\n item_id?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n item_type?: string;\n /** Value that configures or reports before for this contract. */\n before?: ItemDocument;\n /** Value that configures or reports after for this contract. */\n after?: ItemDocument;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields?: string[];\n}\n\n/** Documents the on read hook context payload exchanged by command, SDK, and package integrations. */\nexport interface OnReadHookContext {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports scope for this contract. */\n scope: \"project\" | \"global\";\n}\n\n/** Documents the on index hook context payload exchanged by command, SDK, and package integrations. */\nexport interface OnIndexHookContext {\n /** Value that configures or reports mode for this contract. */\n mode: string;\n /** Value that configures or reports total items for this contract. */\n total_items?: number;\n}\n\n/** Restricts before command hook values accepted by command, SDK, and storage contracts. */\nexport type BeforeCommandHook = (\n context: BeforeCommandHookContext,\n) => Promise<void> | void;\n/** Restricts after command hook values accepted by command, SDK, and storage contracts. */\nexport type AfterCommandHook = (\n context: AfterCommandHookContext,\n) => Promise<void> | void;\n/** Restricts on write hook values accepted by command, SDK, and storage contracts. */\nexport type OnWriteHook = (context: OnWriteHookContext) => Promise<void> | void;\n/** Restricts on read hook values accepted by command, SDK, and storage contracts. */\nexport type OnReadHook = (context: OnReadHookContext) => Promise<void> | void;\n/** Restricts on index hook values accepted by command, SDK, and storage contracts. */\nexport type OnIndexHook = (context: OnIndexHookContext) => Promise<void> | void;\n/** Restricts output renderer format values accepted by command, SDK, and storage contracts. */\nexport type OutputRendererFormat = \"toon\" | \"json\";\n/** Restricts command override values accepted by command, SDK, and storage contracts. */\nexport type CommandOverride = (context: CommandOverrideContext) => unknown;\n/** Restricts renderer override values accepted by command, SDK, and storage contracts. */\nexport type RendererOverride = (\n context: RendererOverrideContext,\n) => string | null | undefined;\n/** Restricts command handler values accepted by command, SDK, and storage contracts. */\nexport type CommandHandler = (context: CommandHandlerContext) => unknown;\n/** Restricts parser override values accepted by command, SDK, and storage contracts. */\nexport type ParserOverride = (\n context: ParserOverrideContext,\n) => ParserOverrideDelta | Promise<ParserOverrideDelta>;\n/** Restricts preflight override values accepted by command, SDK, and storage contracts. */\nexport type PreflightOverride = (\n context: PreflightOverrideContext,\n) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;\n/** Restricts service override values accepted by command, SDK, and storage contracts. */\nexport type ServiceOverride = (context: ServiceOverrideContext) => unknown;\n\n/** Documents the registered extension hook payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionHook<THook> {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports run for this contract. */\n run: THook;\n}\n\n/** Documents the extension hook registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionHookRegistry {\n /** Value that configures or reports before command for this contract. */\n beforeCommand: Array<RegisteredExtensionHook<BeforeCommandHook>>;\n /** Value that configures or reports after command for this contract. */\n afterCommand: Array<RegisteredExtensionHook<AfterCommandHook>>;\n /** Value that configures or reports on write for this contract. */\n onWrite: Array<RegisteredExtensionHook<OnWriteHook>>;\n /** Value that configures or reports on read for this contract. */\n onRead: Array<RegisteredExtensionHook<OnReadHook>>;\n /** Value that configures or reports on index for this contract. */\n onIndex: Array<RegisteredExtensionHook<OnIndexHook>>;\n}\n\n/** Documents the command override context payload exchanged by command, SDK, and package integrations. */\nexport interface CommandOverrideContext {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n}\n\n/** Documents the renderer override context payload exchanged by command, SDK, and package integrations. */\nexport interface RendererOverrideContext {\n /** Value that configures or reports format for this contract. */\n format: OutputRendererFormat;\n /** Value that configures or reports command for this contract. */\n command?: string;\n /** Value that configures or reports args for this contract. */\n args?: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root?: string;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n}\n\n/** Documents the command handler context payload exchanged by command, SDK, and package integrations. */\nexport interface CommandHandlerContext {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n /** Host-bound SDK runtime that avoids package-resolution and private-import coupling. */\n sdk?: ExtensionCommandSdk;\n}\n\n/** Runtime SDK services injected into every extension command invocation. */\nexport interface ExtensionCommandSdk {\n /** Tracker-bound client using the invocation author and workspace. */\n client: PmClient;\n /** Reconstruct one item at a history version or timestamp. */\n getItemAt(id: string, target: string): Promise<GetItemAtResult>;\n /** Open a durable event store with package-contributed relationship semantics. */\n openRelationshipEventStore(options: {\n nodes: Iterable<string>;\n definitions: readonly RelationshipKindDefinition[];\n relativePath?: string;\n }): Promise<RelationshipEventStore>;\n /** Commit idempotent item and relationship mutations under one durable journal. */\n commitWorkspaceTransaction(\n options: Omit<CommitWorkspaceTransactionOptions, \"pmRoot\">,\n ): Promise<WorkspaceTransactionCommitResult>;\n}\n\n/** Documents the parser override context payload exchanged by command, SDK, and package integrations. */\nexport type ParserOverrideContext = CommandHandlerContext;\n\n/** Documents the parser override delta payload exchanged by command, SDK, and package integrations. */\nexport interface ParserOverrideDelta {\n /** Value that configures or reports args for this contract. */\n args?: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n}\n\n/** Documents the preflight override context payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightOverrideContext extends CommandHandlerContext {\n /** Value that configures or reports decision for this contract. */\n decision: PreflightRuntimeDecision;\n}\n\n/** Documents the preflight runtime decision payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightRuntimeDecision {\n /** Value that configures or reports enforce item format gate for this contract. */\n enforce_item_format_gate: boolean;\n /** Executes the preflight item format sync operation through the package runtime. */\n run_preflight_item_format_sync: boolean;\n /** Executes the extension migrations operation through the package runtime. */\n run_extension_migrations: boolean;\n /** Value that configures or reports enforce mandatory migration gate for this contract. */\n enforce_mandatory_migration_gate: boolean;\n}\n\n/** Documents the preflight override delta payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightOverrideDelta extends ParserOverrideDelta {\n /** Value that configures or reports enforce item format gate for this contract. */\n enforce_item_format_gate?: boolean;\n /** Executes the preflight item format sync operation through the package runtime. */\n run_preflight_item_format_sync?: boolean;\n /** Executes the extension migrations operation through the package runtime. */\n run_extension_migrations?: boolean;\n /** Value that configures or reports enforce mandatory migration gate for this contract. */\n enforce_mandatory_migration_gate?: boolean;\n}\n\n/** Documents the service override context payload exchanged by command, SDK, and package integrations. */\nexport interface ServiceOverrideContext {\n /** Value that configures or reports service for this contract. */\n service: ExtensionServiceName;\n /** Value that configures or reports command for this contract. */\n command?: string;\n /** Value that configures or reports args for this contract. */\n args?: string[];\n /** Value that configures or reports options for this contract. */\n options?: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global?: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root?: string;\n /** Value that configures or reports payload for this contract. */\n payload: unknown;\n}\n\n/** Documents the extension command argument definition payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionCommandArgumentDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports variadic for this contract. */\n variadic?: boolean;\n /** Value that configures or reports description for this contract. */\n description?: string;\n}\n\n/** Documents the command definition payload exchanged by command, SDK, and package integrations. */\nexport interface CommandDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports run for this contract. */\n run?: CommandHandler;\n /**\n * @deprecated Use `run` instead. This alias remains for backward compatibility.\n */\n handler?: CommandHandler;\n /** Value that configures or reports action for this contract. */\n action?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports intent for this contract. */\n intent?: string;\n /** Value that configures or reports examples for this contract. */\n examples?: string[];\n /** Value that configures or reports failure hints for this contract. */\n failure_hints?: string[];\n /** Value that configures or reports arguments for this contract. */\n arguments?: ExtensionCommandArgumentDefinition[];\n /** Value that configures or reports flags for this contract. */\n flags?: FlagDefinition[];\n}\n\n/**\n * Optional command-definition metadata for first-class importer/exporter\n * registration.\n *\n * `registerImporter`/`registerExporter` always create a `<name> import` /\n * `<name> export` command path. By default that path only has a handler. When\n * these options are supplied, the auto-created command also gains a full command\n * definition (description, flags, intent, examples, failure hints, positional\n * arguments) — surfaced in help and runtime contracts exactly like\n * `registerCommand`. The registration `name` and `run` handler are implicit, so\n * they are not part of this options object.\n */\nexport interface ImportExportRegistrationOptions {\n /** Value that configures or reports action for this contract. */\n action?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports intent for this contract. */\n intent?: string;\n /** Value that configures or reports examples for this contract. */\n examples?: string[];\n /** Value that configures or reports failure hints for this contract. */\n failure_hints?: string[];\n /** Value that configures or reports arguments for this contract. */\n arguments?: ExtensionCommandArgumentDefinition[];\n /** Value that configures or reports flags for this contract. */\n flags?: FlagDefinition[];\n}\n\n/** Restricts flag value type values accepted by command, SDK, and storage contracts. */\nexport type FlagValueType = \"string\" | \"number\" | \"boolean\";\n\n/** Documents the flag definition payload exchanged by command, SDK, and package integrations. */\nexport interface FlagDefinition {\n /** Value that configures or reports long for this contract. */\n long?: string;\n /** Value that configures or reports short for this contract. */\n short?: string;\n /** Value that configures or reports value name for this contract. */\n value_name?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Whether enabled applies to this operation. */\n enabled?: boolean;\n /** Value that configures or reports visible for this contract. */\n visible?: boolean;\n /** Canonical flag value type. Prefer this field; it is the one runtime contracts and help output read first. */\n value_type?: FlagValueType;\n /**\n * @deprecated Use `value_type`. Retained for backward compatibility: when\n * both are present `value_type` wins, and `type` resolves only when\n * `value_type` is absent (`value_type ?? type`).\n */\n type?: FlagValueType;\n /** When true, a repeated comma-list flag accumulates values across repeats — parity with core list flags such as `--tags` — instead of the last value winning. Mirrors the core `CliFlagContract.list` field so extension-registered list flags coalesce through the same bootstrap path. */\n list?: boolean;\n /** Default value applied when the flag is omitted. Surfaced to runtime contracts and help output. A `list` flag may default to an array of scalars (e.g. `[\"a\", \"b\"]`); the array is flattened/coerced like any list value. */\n default?: string | number | boolean | Array<string | number | boolean>;\n [key: string]: unknown;\n}\n\n/** Documents the schema field definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaFieldDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: string;\n /** Value that configures or reports optional for this contract. */\n optional?: boolean;\n [key: string]: unknown;\n}\n\n/** Documents the schema item type command option policy definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaItemTypeCommandOptionPolicyDefinition {\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports option for this contract. */\n option: string;\n /** Whether enabled applies to this operation. */\n enabled?: boolean;\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports visible for this contract. */\n visible?: boolean;\n [key: string]: unknown;\n}\n\n/** Documents the schema item type option definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaItemTypeOptionDefinition {\n /** Value that configures or reports key for this contract. */\n key: string;\n /** Value that configures or reports values for this contract. */\n values?: string[];\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n [key: string]: unknown;\n}\n\n/** Documents the schema item type definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaItemTypeDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports folder for this contract. */\n folder?: string;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports required create fields for this contract. */\n required_create_fields?: string[];\n /** Value that configures or reports required create repeatables for this contract. */\n required_create_repeatables?: string[];\n /** Value that configures or reports command option policies for this contract. */\n command_option_policies?: SchemaItemTypeCommandOptionPolicyDefinition[];\n /** Value that configures or reports options for this contract. */\n options?: SchemaItemTypeOptionDefinition[];\n [key: string]: unknown;\n}\n\n/** Documents the schema migration run context payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaMigrationRunContext {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports command for this contract. */\n command: \"migration\";\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports extension for this contract. */\n extension: string;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n /** Lifecycle state reported for status. */\n status: string;\n}\n\n/** Restricts schema migration runner values accepted by command, SDK, and storage contracts. */\nexport type SchemaMigrationRunner = (\n context: SchemaMigrationRunContext,\n) => unknown | Promise<unknown>;\n\n/** Documents the schema migration definition payload exchanged by command, SDK, and package integrations. */\nexport interface SchemaMigrationDefinition {\n /** Stable identifier used to reference this record across commands and storage. */\n id?: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Lifecycle state reported for status. */\n status?: string;\n /** Value that configures or reports mandatory for this contract. */\n mandatory?: boolean;\n /** Value that configures or reports run for this contract. */\n run?: SchemaMigrationRunner;\n [key: string]: unknown;\n}\n\n/** Documents the import export context payload exchanged by command, SDK, and package integrations. */\nexport interface ImportExportContext {\n /** Value that configures or reports registration for this contract. */\n registration: string;\n /** Value that configures or reports action for this contract. */\n action: \"import\" | \"export\";\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports args for this contract. */\n args: string[];\n /** Value that configures or reports options for this contract. */\n options: Record<string, unknown>;\n /** Value that configures or reports global for this contract. */\n global: GlobalOptions;\n /** Value that configures or reports pm root for this contract. */\n pm_root: string;\n}\n\n/** Restricts importer values accepted by command, SDK, and storage contracts. */\nexport type Importer = (\n context: ImportExportContext,\n) => unknown | Promise<unknown>;\n/** Restricts exporter values accepted by command, SDK, and storage contracts. */\nexport type Exporter = (\n context: ImportExportContext,\n) => unknown | Promise<unknown>;\n\n/** Restricts extension search mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\n/** Documents the search provider query context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderQueryContext {\n /** Value that configures or reports query for this contract. */\n query: string;\n /** Value that configures or reports mode for this contract. */\n mode: ExtensionSearchMode;\n /** Value that configures or reports tokens for this contract. */\n tokens: string[];\n /** Value that configures or reports options for this contract. */\n options: Record<string, unknown>;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports documents for this contract. */\n documents: ItemDocument[];\n [key: string]: unknown;\n}\n\n/** Documents the search provider hit payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderHit {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n /** Value that configures or reports matched fields for this contract. */\n matched_fields?: string[];\n [key: string]: unknown;\n}\n\n/** Restricts search provider query result values accepted by command, SDK, and storage contracts. */\nexport type SearchProviderQueryResult =\n | SearchProviderHit[]\n | { hits?: SearchProviderHit[] };\n\n/** Documents the search provider query expansion context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderQueryExpansionContext {\n /** Value that configures or reports query for this contract. */\n query: string;\n /** Value that configures or reports mode for this contract. */\n mode: Exclude<ExtensionSearchMode, \"keyword\">;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Restricts search provider query expansion result values accepted by command, SDK, and storage contracts. */\nexport type SearchProviderQueryExpansionResult =\n | string[]\n | { queries?: string[] };\n\n/** Documents the search provider rerank candidate payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderRerankCandidate {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports text for this contract. */\n text: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n}\n\n/** Documents the search provider rerank hit payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderRerankHit {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n}\n\n/** Restricts search provider rerank result values accepted by command, SDK, and storage contracts. */\nexport type SearchProviderRerankResult =\n | SearchProviderRerankHit[]\n | { hits?: SearchProviderRerankHit[] };\n\n/** Documents the search provider rerank context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderRerankContext {\n /** Value that configures or reports query for this contract. */\n query: string;\n /** Value that configures or reports mode for this contract. */\n mode: \"hybrid\";\n /** Value that configures or reports model for this contract. */\n model: string;\n /** Value that configures or reports top k for this contract. */\n top_k: number;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports candidates for this contract. */\n candidates: SearchProviderRerankCandidate[];\n [key: string]: unknown;\n}\n\n/** Documents the search provider embed batch context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderEmbedBatchContext {\n /** Value that configures or reports inputs for this contract. */\n inputs: string[];\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports model for this contract. */\n model: string;\n [key: string]: unknown;\n}\n\n/** Documents the search provider embed context payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderEmbedContext {\n /** Value that configures or reports input for this contract. */\n input: string;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports model for this contract. */\n model: string;\n [key: string]: unknown;\n}\n\n/** Documents the search provider definition payload exchanged by command, SDK, and package integrations. */\nexport interface SearchProviderDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports query for this contract. */\n query?: (\n context: SearchProviderQueryContext,\n ) => SearchProviderQueryResult | Promise<SearchProviderQueryResult>;\n /** Value that configures or reports query expansion for this contract. */\n queryExpansion?: (\n context: SearchProviderQueryExpansionContext,\n ) =>\n | SearchProviderQueryExpansionResult\n | Promise<SearchProviderQueryExpansionResult>;\n /** Value that configures or reports query expansion for this contract. */\n query_expansion?: (\n context: SearchProviderQueryExpansionContext,\n ) =>\n | SearchProviderQueryExpansionResult\n | Promise<SearchProviderQueryExpansionResult>;\n /** Value that configures or reports rerank for this contract. */\n rerank?: (\n context: SearchProviderRerankContext,\n ) => SearchProviderRerankResult | Promise<SearchProviderRerankResult>;\n /** Value that configures or reports embed batch for this contract. */\n embedBatch?: (\n context: SearchProviderEmbedBatchContext,\n ) => number[][] | Promise<number[][]>;\n /** Value that configures or reports embed batch for this contract. */\n embed_batch?: (\n context: SearchProviderEmbedBatchContext,\n ) => number[][] | Promise<number[][]>;\n /** Value that configures or reports embed for this contract. */\n embed?: (context: SearchProviderEmbedContext) => number[] | Promise<number[]>;\n [key: string]: unknown;\n}\n\n/** Documents the vector store query hit payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreQueryHit {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports score for this contract. */\n score: number;\n /** Value that configures or reports payload for this contract. */\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\n/** Documents the vector store query context payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreQueryContext {\n /** Value that configures or reports vector for this contract. */\n vector: number[];\n /** Value that configures or reports limit for this contract. */\n limit: number;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Documents the vector store upsert point payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreUpsertPoint {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports vector for this contract. */\n vector: number[];\n /** Value that configures or reports payload for this contract. */\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\n/** Documents the vector store upsert context payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreUpsertContext {\n /** Value that configures or reports points for this contract. */\n points: VectorStoreUpsertPoint[];\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Documents the vector store delete context payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreDeleteContext {\n /** Value that configures or reports ids for this contract. */\n ids: string[];\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n [key: string]: unknown;\n}\n\n/** Documents the vector store adapter definition payload exchanged by command, SDK, and package integrations. */\nexport interface VectorStoreAdapterDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports query for this contract. */\n query?: (\n context: VectorStoreQueryContext,\n ) => VectorStoreQueryHit[] | Promise<VectorStoreQueryHit[]>;\n /** Value that configures or reports upsert for this contract. */\n upsert?: (context: VectorStoreUpsertContext) => unknown | Promise<unknown>;\n /** Value that configures or reports delete for this contract. */\n delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;\n [key: string]: unknown;\n}\n\n/** Documents the registered extension command override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionCommandOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports run for this contract. */\n run: CommandOverride;\n}\n\n/** Documents the registered extension command handler payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionCommandHandler {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports run for this contract. */\n run: CommandHandler;\n}\n\n/** Documents the registered extension parser override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionParserOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports run for this contract. */\n run: ParserOverride;\n}\n\n/** Documents the registered extension preflight override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionPreflightOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports run for this contract. */\n run: PreflightOverride;\n}\n\n/** Documents the registered extension service override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionServiceOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports service for this contract. */\n service: ExtensionServiceName;\n /** Value that configures or reports run for this contract. */\n run: ServiceOverride;\n}\n\n/** Documents the registered extension renderer override payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionRendererOverride {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports format for this contract. */\n format: OutputRendererFormat;\n /** Value that configures or reports run for this contract. */\n run: RendererOverride;\n}\n\n/** Documents the extension command registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionCommandRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionCommandOverride[];\n /** Value that configures or reports handlers for this contract. */\n handlers: RegisteredExtensionCommandHandler[];\n}\n\n/** Documents the extension parser registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionParserRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionParserOverride[];\n}\n\n/** Documents the extension preflight registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionPreflightRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionPreflightOverride[];\n}\n\n/** Documents the extension service registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionServiceRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionServiceOverride[];\n}\n\n/** Documents the extension renderer registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRendererRegistry {\n /** Value that configures or reports overrides for this contract. */\n overrides: RegisteredExtensionRendererOverride[];\n}\n\n/** Documents the registered extension flag definitions payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionFlagDefinitions {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports target command for this contract. */\n target_command: string;\n /** Value that configures or reports flags for this contract. */\n flags: FlagDefinition[];\n}\n\n/** Documents the registered extension command definition payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionCommandDefinition {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports source package for this contract. */\n source_package?: string;\n /** Value that configures or reports command for this contract. */\n command: string;\n /** Value that configures or reports action for this contract. */\n action: string;\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports intent for this contract. */\n intent?: string;\n /** Value that configures or reports examples for this contract. */\n examples: string[];\n /** Value that configures or reports failure hints for this contract. */\n failure_hints: string[];\n /** Value that configures or reports arguments for this contract. */\n arguments: ExtensionCommandArgumentDefinition[];\n}\n\n/** Documents the registered extension schema field definitions payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSchemaFieldDefinitions {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports fields for this contract. */\n fields: SchemaFieldDefinition[];\n}\n\n/** Documents the registered extension schema item type definitions payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSchemaItemTypeDefinitions {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports types for this contract. */\n types: SchemaItemTypeDefinition[];\n}\n\n/** Relationship ontology definitions contributed by one active extension. */\nexport interface RegisteredExtensionRelationshipKindDefinitions {\n /** Extension layer that owns these definitions. */\n layer: ExtensionLayer;\n /** Extension name that owns these definitions. */\n name: string;\n /** Validated immutable relationship-kind definitions. */\n definitions: RelationshipKindDefinition[];\n}\n\n/** Documents the registered extension schema migration definition payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSchemaMigrationDefinition {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports definition for this contract. */\n definition: SchemaMigrationDefinition;\n /** Value that configures or reports runtime definition for this contract. */\n runtime_definition: SchemaMigrationDefinition;\n}\n\n/** Documents the registered extension importer payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionImporter {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports importer for this contract. */\n importer: string;\n}\n\n/** Documents the registered extension exporter payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionExporter {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports exporter for this contract. */\n exporter: string;\n}\n\n/** Documents the registered extension search provider payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionSearchProvider {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports definition for this contract. */\n definition: SearchProviderDefinition;\n /** Value that configures or reports runtime definition for this contract. */\n runtime_definition: SearchProviderDefinition;\n}\n\n/** Documents the registered extension vector store adapter payload exchanged by command, SDK, and package integrations. */\nexport interface RegisteredExtensionVectorStoreAdapter {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports definition for this contract. */\n definition: VectorStoreAdapterDefinition;\n /** Value that configures or reports runtime definition for this contract. */\n runtime_definition: VectorStoreAdapterDefinition;\n}\n\n/**\n * Documents a project profile contributed by an extension via\n * `api.registerProfile(profile)`.\n *\n * A profile is the broadest customization primitive an extension can ship: it\n * bundles item types, custom statuses, fields, per-type workflows, config knobs,\n * create templates, and package recommendations into one declarative archetype\n * that `pm profile apply` stages idempotently — the same shape as the\n * core-baked archetypes. Registering one makes it resolvable by name through\n * `pm profile list/show/apply` for as long as the owning package is active.\n */\nexport interface RegisteredExtensionProjectProfile {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports profile for this contract. */\n profile: ProjectProfileDefinition;\n}\n\n/** Documents the extension registration registry payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRegistrationRegistry {\n /** Value that configures or reports commands for this contract. */\n commands: RegisteredExtensionCommandDefinition[];\n /** Value that configures or reports flags for this contract. */\n flags: RegisteredExtensionFlagDefinitions[];\n /** Value that configures or reports item fields for this contract. */\n item_fields: RegisteredExtensionSchemaFieldDefinitions[];\n /** Value that configures or reports item types for this contract. */\n item_types: RegisteredExtensionSchemaItemTypeDefinitions[];\n /** Value that configures application-defined relationship semantics. */\n relationship_kinds: RegisteredExtensionRelationshipKindDefinitions[];\n /** Value that configures or reports migrations for this contract. */\n migrations: RegisteredExtensionSchemaMigrationDefinition[];\n /** Value that configures or reports profiles for this contract. */\n profiles: RegisteredExtensionProjectProfile[];\n /** Value that configures or reports importers for this contract. */\n importers: RegisteredExtensionImporter[];\n /** Value that configures or reports exporters for this contract. */\n exporters: RegisteredExtensionExporter[];\n /** Value that configures or reports search providers for this contract. */\n search_providers: RegisteredExtensionSearchProvider[];\n /** Value that configures or reports vector store adapters for this contract. */\n vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];\n}\n\n/** Documents the extension registration counts payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionRegistrationCounts {\n /** Value that configures or reports commands for this contract. */\n commands: number;\n /** Value that configures or reports flags for this contract. */\n flags: number;\n /** Value that configures or reports item fields for this contract. */\n item_fields: number;\n /** Value that configures or reports item types for this contract. */\n item_types: number;\n /** Number of application-defined relationship kinds. */\n relationship_kinds?: number;\n /** Value that configures or reports migrations for this contract. */\n migrations: number;\n /** Value that configures or reports profiles for this contract. */\n profiles: number;\n /** Value that configures or reports importers for this contract. */\n importers: number;\n /** Value that configures or reports exporters for this contract. */\n exporters: number;\n /** Value that configures or reports search providers for this contract. */\n search_providers: number;\n /** Value that configures or reports vector store adapters for this contract. */\n vector_store_adapters: number;\n}\n\n/** Read-only identity an extension's `activate(api)` receives about itself, so authors can emit self-identifying logs, gate on their own version, and build better error messages without re-reading the on-disk manifest or duplicating metadata in-module. Exposed as `api.extension`. */\nexport interface ExtensionSelfIdentity {\n /** Value that configures or reports name for this contract. */\n readonly name: string;\n /** Value that configures or reports layer for this contract. */\n readonly layer: ExtensionLayer;\n /** Value that configures or reports version for this contract. */\n readonly version: string;\n /** Value that configures or reports capabilities for this contract. */\n readonly capabilities: readonly ExtensionCapability[];\n /** Value that configures or reports pm min version for this contract. */\n readonly pm_min_version?: string;\n /** Value that configures or reports pm max version for this contract. */\n readonly pm_max_version?: string;\n /** Value that configures or reports source package for this contract. */\n readonly source_package?: string;\n}\n\n/** Documents the extension api payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionApi {\n /** Read-only identity of the extension this `api` was created for. */\n readonly extension: ExtensionSelfIdentity;\n /** Value that configures or reports register command for this contract. */\n registerCommand(command: string, override: CommandOverride): void;\n /** Value that configures or reports register command for this contract. */\n registerCommand(definition: CommandDefinition): void;\n /** Value that configures or reports register parser for this contract. */\n registerParser(command: string, override: ParserOverride): void;\n /** Value that configures or reports register preflight for this contract. */\n registerPreflight(override: PreflightOverride): void;\n /** Value that configures or reports register service for this contract. */\n registerService(\n service: ExtensionServiceName,\n override: ServiceOverride,\n ): void;\n /** Value that configures or reports register flags for this contract. */\n registerFlags(targetCommand: string, flags: FlagDefinition[]): void;\n /** Value that configures or reports register item fields for this contract. */\n registerItemFields(fields: SchemaFieldDefinition[]): void;\n /** Value that configures or reports register item types for this contract. */\n registerItemTypes(types: SchemaItemTypeDefinition[]): void;\n /** Register versioned relationship semantics consumed by every graph surface. */\n registerRelationshipKinds(definitions: RelationshipKindDefinition[]): void;\n /** Value that configures or reports register migration for this contract. */\n registerMigration(definition: SchemaMigrationDefinition): void;\n /** Value that configures or reports register profile for this contract. */\n registerProfile(profile: ProjectProfileRegistrationInput): void;\n /** Value that configures or reports register renderer for this contract. */\n registerRenderer(\n format: OutputRendererFormat,\n renderer: RendererOverride,\n ): void;\n /** Value that configures or reports register importer for this contract. */\n registerImporter(\n name: string,\n importer: Importer,\n options?: ImportExportRegistrationOptions,\n ): void;\n /** Value that configures or reports register exporter for this contract. */\n registerExporter(\n name: string,\n exporter: Exporter,\n options?: ImportExportRegistrationOptions,\n ): void;\n /** Value that configures or reports register search provider for this contract. */\n registerSearchProvider(provider: SearchProviderDefinition): void;\n /** Value that configures or reports register vector store adapter for this contract. */\n registerVectorStoreAdapter(adapter: VectorStoreAdapterDefinition): void;\n /** Value that configures or reports hooks for this contract. */\n hooks: {\n beforeCommand(hook: BeforeCommandHook): void;\n afterCommand(hook: AfterCommandHook): void;\n onWrite(hook: OnWriteHook): void;\n onRead(hook: OnReadHook): void;\n onIndex(hook: OnIndexHook): void;\n };\n}\n\n/** Documents the failed extension activation payload exchanged by command, SDK, and package integrations. */\nexport interface FailedExtensionActivation {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Value that configures or reports error for this contract. */\n error: string;\n /** Value that configures or reports trace for this contract. */\n trace?: ExtensionActivationFailureTrace;\n}\n\n/** Documents the extension activation failure trace payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionActivationFailureTrace {\n /** Value that configures or reports method for this contract. */\n method: string;\n /** `-1` means the failure happened before a numbered registration was accepted. */\n registration_index: number;\n /** Value that configures or reports command for this contract. */\n command?: string;\n /** Value that configures or reports capability for this contract. */\n capability?: ExtensionCapability;\n /** Value that configures or reports missing capability for this contract. */\n missing_capability?: ExtensionCapability;\n /** Value that configures or reports expected schema for this contract. */\n expected_schema: string;\n /** Value that configures or reports received for this contract. */\n received?: unknown;\n /** Value that configures or reports hint for this contract. */\n hint?: string;\n}\n\n/** Documents the extension activation result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionActivationResult {\n /** Value that configures or reports hooks for this contract. */\n hooks: ExtensionHookRegistry;\n /** Value that configures or reports commands for this contract. */\n commands: ExtensionCommandRegistry;\n /** Value that configures or reports parsers for this contract. */\n parsers: ExtensionParserRegistry;\n /** Value that configures or reports preflight for this contract. */\n preflight: ExtensionPreflightRegistry;\n /** Value that configures or reports services for this contract. */\n services: ExtensionServiceRegistry;\n /** Value that configures or reports renderers for this contract. */\n renderers: ExtensionRendererRegistry;\n /** Value that configures or reports registrations for this contract. */\n registrations: ExtensionRegistrationRegistry;\n /** Value that configures or reports failed for this contract. */\n failed: FailedExtensionActivation[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports hook counts for this contract. */\n hook_counts: {\n before_command: number;\n after_command: number;\n on_write: number;\n on_read: number;\n on_index: number;\n };\n /** Number of command override entries represented by this result. */\n command_override_count: number;\n /** Number of command handler entries represented by this result. */\n command_handler_count: number;\n /** Number of parser override entries represented by this result. */\n parser_override_count: number;\n /** Number of preflight override entries represented by this result. */\n preflight_override_count: number;\n /** Number of service override entries represented by this result. */\n service_override_count: number;\n /** Number of renderer override entries represented by this result. */\n renderer_override_count: number;\n /** Value that configures or reports registration counts for this contract. */\n registration_counts: ExtensionRegistrationCounts;\n}\n\n/** Documents the extension candidate payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionCandidate {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports directory for this contract. */\n directory: string;\n /** Filesystem path used for manifest resolution. */\n manifest_path: string;\n /** Filesystem path used for entry resolution. */\n entry_path: string;\n /** Declarative package manifest consumed by the extension loader. */\n manifest: ExtensionManifest;\n /** Value that configures or reports source package for this contract. */\n source_package?: string;\n}\n\n/** Documents the extension layer scan result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionLayerScanResult {\n /** Value that configures or reports diagnostics for this contract. */\n diagnostics: ExtensionDiagnostic[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports candidates for this contract. */\n candidates: ExtensionCandidate[];\n}\n\n/** Documents the scanned extension directory payload exchanged by command, SDK, and package integrations. */\nexport interface ScannedExtensionDirectory {\n /** Value that configures or reports diagnostic for this contract. */\n diagnostic: ExtensionDiagnostic;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports candidate for this contract. */\n candidate: ExtensionCandidate | null;\n}\n\n/** Documents the legacy extension capability alias mapping payload exchanged by command, SDK, and package integrations. */\nexport interface LegacyExtensionCapabilityAliasMapping {\n /** Value that configures or reports alias for this contract. */\n alias: string;\n /** Value that configures or reports target for this contract. */\n target: ExtensionCapability;\n}\n\n/** Documents the discover extensions options payload exchanged by command, SDK, and package integrations. */\nexport interface DiscoverExtensionsOptions {\n /** Value that configures or reports pm root for this contract. */\n pmRoot: string;\n /** Value that configures or reports settings for this contract. */\n settings: PmSettings;\n /** Value that configures or reports cwd for this contract. */\n cwd?: string;\n /** Value that configures or reports no extensions for this contract. */\n noExtensions?: boolean;\n /** Value that configures or reports ignore global extensions for this contract. */\n ignoreGlobalExtensions?: boolean;\n /** Value that configures or reports reload token for this contract. */\n reload_token?: string;\n /** Value that configures or reports cache bust for this contract. */\n cache_bust?: boolean;\n /** Optional import-stage filter. Discovery still reports the full effective set, but `loadExtensions` imports only entries accepted by this predicate. */\n extensionFilter?: (extension: EffectiveExtension) => boolean;\n}\n\n/** Documents the activatable extension payload exchanged by command, SDK, and package integrations. */\nexport interface ActivatableExtension {\n /** Registers this package's commands, actions, and runtime hooks with the host. */\n activate: (api: ExtensionApi) => void | Promise<void>;\n /** Optional teardown lifecycle hook, analogous to VS Code's `deactivate` export. Invoked when the host tears the extension down — on long-running MCP-server reload between requests, or via the `deactivateExtensions` primitive — so an extension can close connections, clear timers, and release buffers it opened during `activate`. */\n deactivate?: () => void | Promise<void>;\n}\n\n/** Documents the extension deactivation failure payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDeactivationFailure {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports error for this contract. */\n error: string;\n}\n\n/** Documents the extension deactivation options payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDeactivationOptions {\n /** Maximum time to wait for each extension's `deactivate` hook. Defaults to 5000ms so a hanging teardown cannot block host shutdown or reload. Set to 0 or Infinity only when the host intentionally wants to wait indefinitely. */\n deactivate_timeout_ms?: number;\n}\n\n/** Documents the extension deactivation result payload exchanged by command, SDK, and package integrations. */\nexport interface ExtensionDeactivationResult {\n /** Count of loaded extensions whose `deactivate` hook ran without throwing. */\n deactivated: number;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Value that configures or reports failed for this contract. */\n failed: ExtensionDeactivationFailure[];\n}\n\n/** Documents the service override result payload exchanged by command, SDK, and package integrations. */\nexport interface ServiceOverrideResult {\n /** Value that configures or reports handled for this contract. */\n handled: boolean;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the command override result payload exchanged by command, SDK, and package integrations. */\nexport interface CommandOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the command handler result payload exchanged by command, SDK, and package integrations. */\nexport interface CommandHandlerResult {\n /** Value that configures or reports handled for this contract. */\n handled: boolean;\n /** Value that configures or reports result for this contract. */\n result: unknown;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n /** Human-readable, single-line, length-bounded message describing why an extension command handler failed. Surfaced to the user/CI so the real cause (e.g. \"Changelog is out of date: CHANGELOG.md\") is visible instead of only the opaque `extension_command_handler_failed` warning code. */\n errorMessage?: string;\n}\n\n/** Documents the parser override result payload exchanged by command, SDK, and package integrations. */\nexport interface ParserOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports context for this contract. */\n context: CommandHandlerContext;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the preflight override result payload exchanged by command, SDK, and package integrations. */\nexport interface PreflightOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports context for this contract. */\n context: CommandHandlerContext;\n /** Value that configures or reports decision for this contract. */\n decision: PreflightRuntimeDecision;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the renderer override result payload exchanged by command, SDK, and package integrations. */\nexport interface RendererOverrideResult {\n /** Value that configures or reports overridden for this contract. */\n overridden: boolean;\n /** Value that configures or reports rendered for this contract. */\n rendered: string | null;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Documents the unknown extension capability warning details payload exchanged by command, SDK, and package integrations. */\nexport interface UnknownExtensionCapabilityWarningDetails {\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports capability for this contract. */\n capability: string;\n /** Value that configures or reports allowed capabilities for this contract. */\n allowed_capabilities: string[];\n /** Value that configures or reports capability contract version for this contract. */\n capability_contract_version: number;\n /** Value that configures or reports suggested capability for this contract. */\n suggested_capability?: string;\n /** Value that configures or reports suggestion source for this contract. */\n suggestion_source?: \"legacy_alias\" | \"nearest_match\";\n /** Value that configures or reports legacy alias target for this contract. */\n legacy_alias_target?: string;\n}\n"],"names":[],"mappings":"AA+BA,wGAAwG;;;AACxG,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,UAAU;IACV,WAAW;IACX,OAAO;IACP,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;CACF,CAAC;AAGX,iHAAiH;AACjH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,+GAA+G;AAC/G,MAAM,CAAC,MAAM,mCAAmC,GAE5C,MAAM,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC;AACH,yGAAyG;AACzG,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,qCAAqC;IAC9C,YAAY,EAAE,CAAC,GAAG,4BAA4B,CAAC;IAC/C,cAAc,EAAE,EAAE,GAAG,mCAAmC,EAAE;CAC3D,CAAC,CAAC;AAEH,wGAAwG;AACxG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAGhF,uGAAuG;AACvG,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAG/E,4GAA4G;AAC5G,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,MAAM;IACN,YAAY;IACZ,QAAQ;CACA,CAAC;AAKX,+GAA+G;AAC/G,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAgB9E,2GAA2G;AAC3G,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,eAAe;IACf,cAAc;IACd,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,0BAA0B;IAC1B,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;CACZ,CAAC;AAKX,yGAAyG;AACzG,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,eAAe;IACf,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;CACR,CAAC;AAuDX,2GAA2G;AAC3G,MAAM,UAAU,sCAAsC;IACpD,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,kBAAkB,EAAE,EAAE;QACtB,uBAAuB,EAAE,MAAM;QAC/B,kBAAkB,EAAE,EAAE;QACtB,kBAAkB,EAAE,EAAE;QACtB,oBAAoB,EAAE,EAAE;QACxB,oBAAoB,EAAE,EAAE;QACxB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,mBAAmB,EAAE,EAAE;KACxB,CAAC;AACJ,CAAC","debugId":"15bbc696-5001-58e2-8b5c-dd09860d5a29"}
@@ -4,5 +4,22 @@ export declare function normalizePrefix(input: string | undefined): string;
4
4
  export declare function normalizeRawItemId(input: string): string;
5
5
  /** Implements normalize item id for the public runtime surface of this module. */
6
6
  export declare function normalizeItemId(input: string, prefix: string): string;
7
- /** Implements generate item id for the public runtime surface of this module. */
8
- export declare function generateItemId(pmRoot: string, prefix: string): Promise<string>;
7
+ /** Bounds accepted for the configurable random id token length (`ids.token_length`). */
8
+ export declare const ID_TOKEN_LENGTH_MIN = 4;
9
+ /** Upper bound for `ids.token_length`; longer tokens stop improving ergonomics without meaningfully improving uniqueness. */
10
+ export declare const ID_TOKEN_LENGTH_MAX = 12;
11
+ /** Clamp a configured id token length into the supported bounds, falling back to the 4-character default for non-finite input. */
12
+ export declare function clampIdTokenLength(value: number | undefined): number;
13
+ /**
14
+ * Mint a new item id as `<prefix><random base36 token>`. The starting token
15
+ * length comes from the workspace `ids.token_length` setting (default 4) and
16
+ * escalates automatically when the local uniqueness probe keeps colliding.
17
+ * Uniqueness is only verifiable against the local working tree: concurrent
18
+ * branches can still mint the same id independently, which is why longer
19
+ * configured tokens matter for multi-agent workflows and why
20
+ * `pm validate --check-storage-integrity` detects post-merge duplicate-id
21
+ * collisions (GH-600).
22
+ */
23
+ export declare function generateItemId(pmRoot: string, prefix: string, options?: {
24
+ tokenLength?: number;
25
+ }): Promise<string>;
@@ -4,7 +4,7 @@
4
4
  * Defines item parsing, formatting, and lifecycle helpers for Id.
5
5
  */
6
6
 
7
- !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]="900d99bf-095b-5dcf-9a33-b04c9b440969")}catch(e){}}();
7
+ !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]="ee13ce1e-8508-5eb1-be0b-6e49f4280e87")}catch(e){}}();
8
8
  import crypto from "node:crypto";
9
9
  import path from "node:path";
10
10
  import { TYPE_TO_FOLDER } from "../shared/constants.js";
@@ -52,11 +52,32 @@ async function idExists(pmRoot, id) {
52
52
  }
53
53
  return false;
54
54
  }
55
- /** Implements generate item id for the public runtime surface of this module. */
56
- export async function generateItemId(pmRoot, prefix) {
57
- let tokenLength = 4;
55
+ /** Bounds accepted for the configurable random id token length (`ids.token_length`). */
56
+ export const ID_TOKEN_LENGTH_MIN = 4;
57
+ /** Upper bound for `ids.token_length`; longer tokens stop improving ergonomics without meaningfully improving uniqueness. */
58
+ export const ID_TOKEN_LENGTH_MAX = 12;
59
+ /** Clamp a configured id token length into the supported bounds, falling back to the 4-character default for non-finite input. */
60
+ export function clampIdTokenLength(value) {
61
+ if (typeof value !== "number" || !Number.isFinite(value)) {
62
+ return ID_TOKEN_LENGTH_MIN;
63
+ }
64
+ return Math.min(ID_TOKEN_LENGTH_MAX, Math.max(ID_TOKEN_LENGTH_MIN, Math.trunc(value)));
65
+ }
66
+ /**
67
+ * Mint a new item id as `<prefix><random base36 token>`. The starting token
68
+ * length comes from the workspace `ids.token_length` setting (default 4) and
69
+ * escalates automatically when the local uniqueness probe keeps colliding.
70
+ * Uniqueness is only verifiable against the local working tree: concurrent
71
+ * branches can still mint the same id independently, which is why longer
72
+ * configured tokens matter for multi-agent workflows and why
73
+ * `pm validate --check-storage-integrity` detects post-merge duplicate-id
74
+ * collisions (GH-600).
75
+ */
76
+ export async function generateItemId(pmRoot, prefix, options = {}) {
77
+ let tokenLength = clampIdTokenLength(options.tokenLength);
78
+ const maxTokenLength = Math.min(tokenLength + 6, ID_TOKEN_LENGTH_MAX);
58
79
  let attempts = 0;
59
- while (tokenLength <= 10) {
80
+ while (tokenLength <= maxTokenLength) {
60
81
  for (let i = 0; i < 32; i += 1) {
61
82
  const id = `${normalizePrefix(prefix)}${randomToken(tokenLength)}`;
62
83
  if (!(await idExists(pmRoot, id))) {
@@ -69,4 +90,4 @@ export async function generateItemId(pmRoot, prefix) {
69
90
  throw new Error(`Unable to generate unique id after ${attempts} attempts`);
70
91
  }
71
92
  //# sourceMappingURL=id.js.map
72
- //# debugId=900d99bf-095b-5dcf-9a33-b04c9b440969
93
+ //# debugId=ee13ce1e-8508-5eb1-be0b-6e49f4280e87
@@ -1 +1 @@
1
- {"version":3,"file":"id.js","sources":["core/item/id.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/item/id\n *\n * Defines item parsing, formatting, and lifecycle helpers for Id.\n */\nimport crypto from \"node:crypto\";\nimport path from \"node:path\";\nimport { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport { pathExists } from \"../fs/fs-utils.js\";\n\n/** Implements normalize prefix for the public runtime surface of this module. */\nexport function normalizePrefix(input: string | undefined): string {\n const normalized = (input ?? \"\").trim().toLowerCase();\n if (!normalized) return \"pm-\";\n return normalized.endsWith(\"-\") ? normalized : `${normalized}-`;\n}\n\n/** Implements normalize raw item id for the public runtime surface of this module. */\nexport function normalizeRawItemId(input: string): string {\n let normalized = input.trim().toLowerCase();\n if (normalized.startsWith(\"#\")) {\n normalized = normalized.slice(1);\n }\n return normalized;\n}\n\n/** Implements normalize item id for the public runtime surface of this module. */\nexport function normalizeItemId(input: string, prefix: string): string {\n const canonicalPrefix = normalizePrefix(prefix);\n const normalized = normalizeRawItemId(input);\n if (normalized.startsWith(canonicalPrefix)) {\n return normalized;\n }\n return `${canonicalPrefix}${normalized}`;\n}\n\nfunction randomToken(length: number): string {\n let token = \"\";\n for (let index = 0; index < length; index += 1) {\n token += crypto.randomInt(0, 36).toString(36);\n }\n return token;\n}\n\nasync function idExists(pmRoot: string, id: string): Promise<boolean> {\n const checks = Object.values(TYPE_TO_FOLDER).flatMap((folder) => [\n path.join(pmRoot, folder, `${id}.md`),\n path.join(pmRoot, folder, `${id}.toon`),\n ]);\n for (const target of checks) {\n if (await pathExists(target)) {\n return true;\n }\n }\n return false;\n}\n\n/** Implements generate item id for the public runtime surface of this module. */\nexport async function generateItemId(\n pmRoot: string,\n prefix: string,\n): Promise<string> {\n let tokenLength = 4;\n let attempts = 0;\n\n while (tokenLength <= 10) {\n for (let i = 0; i < 32; i += 1) {\n const id = `${normalizePrefix(prefix)}${randomToken(tokenLength)}`;\n if (!(await idExists(pmRoot, id))) {\n return id;\n }\n attempts += 1;\n }\n tokenLength += 1;\n }\n\n throw new Error(`Unable to generate unique id after ${attempts} attempts`);\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAAC,KAAyB;IACvD,MAAM,UAAU,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACtD,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC;AAClE,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,IAAI,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,MAAc;IAC3D,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,eAAe,GAAG,UAAU,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CAAC,MAAc;IACjC,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC/C,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,MAAc,EAAE,EAAU;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;KACxC,CAAC,CAAC;IACH,KAAK,MAAM,MAAM,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,MAAc;IAEd,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,OAAO,WAAW,IAAI,EAAE,EAAE,CAAC;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,MAAM,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;YACnE,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;gBAClC,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,QAAQ,IAAI,CAAC,CAAC;QAChB,CAAC;QACD,WAAW,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,WAAW,CAAC,CAAC;AAC7E,CAAC","debugId":"900d99bf-095b-5dcf-9a33-b04c9b440969"}
1
+ {"version":3,"file":"id.js","sources":["core/item/id.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/item/id\n *\n * Defines item parsing, formatting, and lifecycle helpers for Id.\n */\nimport crypto from \"node:crypto\";\nimport path from \"node:path\";\nimport { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport { pathExists } from \"../fs/fs-utils.js\";\n\n/** Implements normalize prefix for the public runtime surface of this module. */\nexport function normalizePrefix(input: string | undefined): string {\n const normalized = (input ?? \"\").trim().toLowerCase();\n if (!normalized) return \"pm-\";\n return normalized.endsWith(\"-\") ? normalized : `${normalized}-`;\n}\n\n/** Implements normalize raw item id for the public runtime surface of this module. */\nexport function normalizeRawItemId(input: string): string {\n let normalized = input.trim().toLowerCase();\n if (normalized.startsWith(\"#\")) {\n normalized = normalized.slice(1);\n }\n return normalized;\n}\n\n/** Implements normalize item id for the public runtime surface of this module. */\nexport function normalizeItemId(input: string, prefix: string): string {\n const canonicalPrefix = normalizePrefix(prefix);\n const normalized = normalizeRawItemId(input);\n if (normalized.startsWith(canonicalPrefix)) {\n return normalized;\n }\n return `${canonicalPrefix}${normalized}`;\n}\n\nfunction randomToken(length: number): string {\n let token = \"\";\n for (let index = 0; index < length; index += 1) {\n token += crypto.randomInt(0, 36).toString(36);\n }\n return token;\n}\n\nasync function idExists(pmRoot: string, id: string): Promise<boolean> {\n const checks = Object.values(TYPE_TO_FOLDER).flatMap((folder) => [\n path.join(pmRoot, folder, `${id}.md`),\n path.join(pmRoot, folder, `${id}.toon`),\n ]);\n for (const target of checks) {\n if (await pathExists(target)) {\n return true;\n }\n }\n return false;\n}\n\n/** Bounds accepted for the configurable random id token length (`ids.token_length`). */\nexport const ID_TOKEN_LENGTH_MIN = 4;\n/** Upper bound for `ids.token_length`; longer tokens stop improving ergonomics without meaningfully improving uniqueness. */\nexport const ID_TOKEN_LENGTH_MAX = 12;\n\n/** Clamp a configured id token length into the supported bounds, falling back to the 4-character default for non-finite input. */\nexport function clampIdTokenLength(value: number | undefined): number {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n return ID_TOKEN_LENGTH_MIN;\n }\n return Math.min(\n ID_TOKEN_LENGTH_MAX,\n Math.max(ID_TOKEN_LENGTH_MIN, Math.trunc(value)),\n );\n}\n\n/**\n * Mint a new item id as `<prefix><random base36 token>`. The starting token\n * length comes from the workspace `ids.token_length` setting (default 4) and\n * escalates automatically when the local uniqueness probe keeps colliding.\n * Uniqueness is only verifiable against the local working tree: concurrent\n * branches can still mint the same id independently, which is why longer\n * configured tokens matter for multi-agent workflows and why\n * `pm validate --check-storage-integrity` detects post-merge duplicate-id\n * collisions (GH-600).\n */\nexport async function generateItemId(\n pmRoot: string,\n prefix: string,\n options: { tokenLength?: number } = {},\n): Promise<string> {\n let tokenLength = clampIdTokenLength(options.tokenLength);\n const maxTokenLength = Math.min(\n tokenLength + 6,\n ID_TOKEN_LENGTH_MAX,\n );\n let attempts = 0;\n\n while (tokenLength <= maxTokenLength) {\n for (let i = 0; i < 32; i += 1) {\n const id = `${normalizePrefix(prefix)}${randomToken(tokenLength)}`;\n if (!(await idExists(pmRoot, id))) {\n return id;\n }\n attempts += 1;\n }\n tokenLength += 1;\n }\n\n throw new Error(`Unable to generate unique id after ${attempts} attempts`);\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAAC,KAAyB;IACvD,MAAM,UAAU,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACtD,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC;AAClE,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,IAAI,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,MAAc;IAC3D,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,eAAe,GAAG,UAAU,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CAAC,MAAc;IACjC,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC/C,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,MAAc,EAAE,EAAU;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC;KACxC,CAAC,CAAC;IACH,KAAK,MAAM,MAAM,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,wFAAwF;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,6HAA6H;AAC7H,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,kIAAkI;AAClI,MAAM,UAAU,kBAAkB,CAAC,KAAyB;IAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CACb,mBAAmB,EACnB,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACjD,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,MAAc,EACd,UAAoC,EAAE;IAEtC,IAAI,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1D,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAC7B,WAAW,GAAG,CAAC,EACf,mBAAmB,CACpB,CAAC;IACF,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,OAAO,WAAW,IAAI,cAAc,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,MAAM,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;YACnE,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;gBAClC,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,QAAQ,IAAI,CAAC,CAAC;QAChB,CAAC;QACD,WAAW,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,WAAW,CAAC,CAAC;AAC7E,CAAC","debugId":"ee13ce1e-8508-5eb1-be0b-6e49f4280e87"}
@@ -2,6 +2,13 @@
2
2
  export declare function parseTags(raw: string): string[];
3
3
  /** Merge repeated `--add-tags` / `--remove-tags` values into a single normalized tag list. Each entry can itself be CSV or a JSON array, mirroring the format accepted by `--tags`. Returns a deterministically sorted, deduped list. */
4
4
  export declare function collectTagFlagValues(values: readonly string[] | undefined): string[];
5
+ /** Split a stored `acceptance_criteria` value into its individual criteria. Criteria are stored as one string joined with `"; "` (repeated `--ac` values accumulate that way), so the semicolon is the criterion boundary and cannot appear inside one criterion; entries are trimmed and blanks dropped. Non-string/absent values yield an empty list. */
6
+ export declare function splitAcceptanceCriteria(value: unknown): string[];
7
+ /** Apply additive/subtractive acceptance-criteria mutations to a base criteria list. Used by `pm update --add-ac/--remove-ac` so individual semicolon-free criteria can be edited without replacing the whole `acceptance_criteria` value (tag-API parity; disjoint additions merge cleanly across branches). Additions append in argv order and dedupe on exact trimmed text; removals match exact trimmed text and report unmatched selectors so a typo never becomes a silent no-op. */
8
+ export declare function applyAcceptanceCriteriaMutations(baseCriteria: readonly string[], add: readonly string[] | undefined, remove: readonly string[] | undefined): {
9
+ criteria: string[];
10
+ unmatchedRemovals: string[];
11
+ };
5
12
  /** Apply an additive tag mutation to a base tag list. Used by `pm create` and `pm update` so `--add-tags` extends `--tags` (or the existing tags) without replacing them. Output is sorted + deduped lowercase, matching `parseTags`. */
6
13
  export declare function mergeAdditiveTags(baseTags: readonly string[], add: readonly string[] | undefined): string[];
7
14
  /** Apply a subtractive tag mutation to a base tag list. Used by `pm update` so `--remove-tags x,y` prunes those entries without rewriting the full set. Removal is case-insensitive: both the base list and the removal selectors are normalized to canonical lowercase before matching. */