@unbrained/pm-cli 2026.11.23 → 2026.11.25

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 (209) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/error-guidance.js +5 -5
  3. package/dist/cli/main.js +5 -5
  4. package/dist/cli/register-annotations.js +1 -1
  5. package/dist/cli/runtime/invocation-options.js +1 -1
  6. package/dist/cli-bundle/bundle-manifest.json +1 -1
  7. package/dist/cli-bundle/chunks/chunk-4FZH5BTV.js +2 -0
  8. package/dist/cli-bundle/chunks/{chunk-YYT3MIRF.js → chunk-6OIHST4I.js} +1 -1
  9. package/dist/cli-bundle/chunks/chunk-7EPYCU7U.js +9 -0
  10. package/dist/cli-bundle/chunks/{chunk-AEOHUSUI.js → chunk-BVJMVU4Z.js} +68 -68
  11. package/dist/cli-bundle/chunks/{chunk-2UQU7HRR.js → chunk-C4KIZQHW.js} +2 -2
  12. package/dist/cli-bundle/chunks/chunk-CNUFU454.js +113 -0
  13. package/dist/cli-bundle/chunks/chunk-CONBVY2O.js +2 -0
  14. package/dist/cli-bundle/chunks/{chunk-BSRIVYTM.js → chunk-CZEMEPPQ.js} +3 -3
  15. package/dist/cli-bundle/chunks/chunk-DF6A7C32.js +2 -0
  16. package/dist/cli-bundle/chunks/chunk-FHLOGAGA.js +8 -0
  17. package/dist/cli-bundle/chunks/chunk-FVY7U3SU.js +125 -0
  18. package/dist/cli-bundle/chunks/{chunk-F2Z6XLZB.js → chunk-GBVF2ZB3.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-GZI7ZAB7.js +2 -0
  20. package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +2 -0
  21. package/dist/cli-bundle/chunks/chunk-K34FR5CO.js +3 -0
  22. package/dist/cli-bundle/chunks/{chunk-D6PDUKUG.js → chunk-KHFUHGL3.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-L6VS7F3R.js +2 -0
  24. package/dist/cli-bundle/chunks/chunk-LOX3VY4T.js +2 -0
  25. package/dist/cli-bundle/chunks/{chunk-H7JEXRIN.js → chunk-LPW7S5KA.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-5DUP4AZA.js → chunk-MGJMQSN4.js} +2 -2
  27. package/dist/cli-bundle/chunks/chunk-OS5W4ZG2.js +31 -0
  28. package/dist/cli-bundle/chunks/{chunk-O7JHS64G.js → chunk-OWK2JL4I.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-SCIPT7WF.js +2 -0
  30. package/dist/cli-bundle/chunks/chunk-SX76UGEY.js +3 -0
  31. package/dist/cli-bundle/chunks/{chunk-CFWLQFJM.js → chunk-VA4T37Q4.js} +50 -51
  32. package/dist/cli-bundle/chunks/chunk-WQOEVGLQ.js +2 -0
  33. package/dist/cli-bundle/chunks/chunk-XHCIOLJP.js +3 -0
  34. package/dist/cli-bundle/chunks/{chunk-J2PDAVBC.js → chunk-XKWJONAO.js} +2 -2
  35. package/dist/cli-bundle/chunks/chunk-YIGBEY7K.js +2 -0
  36. package/dist/cli-bundle/chunks/chunk-ZBOQEZ2H.js +33 -0
  37. package/dist/cli-bundle/chunks/chunk-ZLICQPRG.js +3 -0
  38. package/dist/cli-bundle/chunks/field-option-collisions-QE65APSD.js +2 -0
  39. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-BPYKN5Q7.js → indexed-receipt-blobs-H3MMNXXG.js} +2 -2
  40. package/dist/cli-bundle/{focused-chunks/item-revision-YDACCDVY.js → chunks/item-revision-INDHJV6X.js} +2 -2
  41. package/dist/cli-bundle/chunks/item-transaction-LCKK4XXB.js +2 -0
  42. package/dist/cli-bundle/chunks/mutation-actor-KU7BMLUN.js +2 -0
  43. package/dist/cli-bundle/chunks/mutation-admission-3OMCTQD4.js +2 -0
  44. package/dist/cli-bundle/chunks/{register-list-query-L4IBU64P.js → register-list-query-3GV3LBOT.js} +2 -2
  45. package/dist/cli-bundle/chunks/register-mutation-GZLF47SX.js +21 -0
  46. package/dist/cli-bundle/chunks/register-operations-PBJZGCAL.js +2 -0
  47. package/dist/cli-bundle/chunks/register-setup-ZLJEF6NZ.js +2 -0
  48. package/dist/cli-bundle/chunks/runtime-schema-Y4SHTEXL.js +2 -0
  49. package/dist/cli-bundle/chunks/{settlement-hook-6MR32OOC.js → settlement-hook-ESAAEBRM.js} +2 -2
  50. package/dist/cli-bundle/chunks/stage-3WIZBD4N.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/chunk-3Y5PTQ2F.js +27 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-Y2ESLKCF.js → chunk-4LQL4EO6.js} +3 -3
  53. package/dist/cli-bundle/focused-chunks/{chunk-RIE3SJSE.js → chunk-4SX2BN4V.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-ZHWPCVQL.js → chunk-5RBC4WSE.js} +39 -39
  55. package/dist/cli-bundle/focused-chunks/chunk-7SSGTGZO.js +91 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-A4R57E4K.js +2 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-BOIMP2AR.js +5 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-BYQK5DGH.js +2 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-C3FEDTSD.js +44 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-IAOKVKWW.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-JOKRDFMQ.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/chunk-MB56Y4M6.js +8 -0
  63. package/dist/cli-bundle/focused-chunks/{chunk-A6VEMCRR.js → chunk-NGFDPEP7.js} +1 -1
  64. package/dist/cli-bundle/focused-chunks/chunk-OCKKIECS.js +3 -0
  65. package/dist/cli-bundle/focused-chunks/chunk-PKX2EHE3.js +26 -0
  66. package/dist/cli-bundle/focused-chunks/chunk-SXC2EO3E.js +3 -0
  67. package/dist/cli-bundle/focused-chunks/chunk-TQIKDFOD.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-TRL4JDWX.js +8 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-IROZDIDX.js → chunk-UWWAVXG4.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/chunk-VMYVN36N.js +13 -0
  71. package/dist/cli-bundle/focused-chunks/chunk-VU2PH4PF.js +2 -0
  72. package/dist/cli-bundle/focused-chunks/chunk-WL2R7T5G.js +2 -0
  73. package/dist/cli-bundle/focused-chunks/chunk-WVA5KOXF.js +3 -0
  74. package/dist/cli-bundle/focused-chunks/{chunk-QQIIMMFU.js → chunk-X4EWD6TL.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/chunk-XKLBTDJ7.js +100 -0
  76. package/dist/cli-bundle/focused-chunks/chunk-YYEWIKNI.js +2 -0
  77. package/dist/cli-bundle/focused-chunks/chunk-ZLRRII55.js +2 -0
  78. package/dist/cli-bundle/focused-chunks/field-option-collisions-5ROXGUME.js +2 -0
  79. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-EGEJMG3G.js → indexed-receipt-blobs-PG2VJ3MB.js} +2 -2
  80. package/dist/cli-bundle/focused-chunks/item-revision-KYMSQVZE.js +2 -0
  81. package/dist/cli-bundle/focused-chunks/item-transaction-I4HLVHEJ.js +2 -0
  82. package/dist/cli-bundle/focused-chunks/mutation-actor-GGOQKAE6.js +2 -0
  83. package/dist/cli-bundle/focused-chunks/mutation-admission-OS36ZCMH.js +2 -0
  84. package/dist/cli-bundle/focused-chunks/runtime-schema-YXPYDD2C.js +2 -0
  85. package/dist/cli-bundle/focused-chunks/{settlement-hook-FMLGKG7J.js → settlement-hook-4MGRERCT.js} +2 -2
  86. package/dist/cli-bundle/focused-chunks/stage-4ZFWJUKO.js +2 -0
  87. package/dist/cli-bundle/main.js +26 -26
  88. package/dist/cli-bundle/sdk-authoring.js +1 -1
  89. package/dist/cli-bundle/sdk-contracts.js +4 -4
  90. package/dist/cli-bundle/sdk-core.js +1 -1
  91. package/dist/cli-bundle/sdk-governance.js +1 -1
  92. package/dist/cli-bundle/sdk-graph.js +1 -1
  93. package/dist/cli-bundle/sdk-merge.js +63 -63
  94. package/dist/cli-bundle/sdk-query.js +1 -1
  95. package/dist/cli-bundle/sdk-runtime.js +1 -1
  96. package/dist/cli-bundle/sdk-testing.js +1 -1
  97. package/dist/cli-bundle/sdk.js +12 -12
  98. package/dist/core/profile/profile-lint.d.ts +1 -1
  99. package/dist/core/profile/profile-lint.js +1 -1
  100. package/dist/core/schema/fields-file.js +2 -2
  101. package/dist/core/schema/runtime-field-values.js +1 -1
  102. package/dist/core/schema/runtime-schema.d.ts +2 -0
  103. package/dist/core/schema/runtime-schema.js +1 -1
  104. package/dist/core/shared/command-line.d.ts +54 -4
  105. package/dist/core/shared/command-line.js +1 -1
  106. package/dist/core/shared/errors.d.ts +9 -0
  107. package/dist/core/shared/secret-rules.js +5 -5
  108. package/dist/core/shared/url-credentials.d.ts +16 -3
  109. package/dist/core/shared/url-credentials.js +1 -1
  110. package/dist/core/store/item-store.d.ts +26 -4
  111. package/dist/core/store/item-store.js +1 -1
  112. package/dist/sdk/command-line.d.ts +1 -1
  113. package/dist/sdk/command-line.js +1 -1
  114. package/dist/sdk/context-intent-contracts.js +1 -1
  115. package/dist/sdk/extension/command-options.d.ts +26 -1
  116. package/dist/sdk/extension/command-options.js +1 -1
  117. package/dist/sdk/extension-command-context.js +2 -2
  118. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  119. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  120. package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
  121. package/dist/sdk/index.d.ts +1 -1
  122. package/dist/sdk/lifecycle/claim.d.ts +21 -1
  123. package/dist/sdk/lifecycle/claim.js +1 -1
  124. package/dist/sdk/lifecycle/task-composition.js +1 -1
  125. package/dist/sdk/ownership-source.d.ts +15 -1
  126. package/dist/sdk/ownership-source.js +1 -1
  127. package/dist/sdk/public-surface.json +1 -1
  128. package/dist/sdk/read-output-contracts.d.ts +11 -0
  129. package/dist/sdk/read-output-contracts.js +1 -1
  130. package/dist/sdk/runtime-primitives.d.ts +1 -1
  131. package/dist/sdk/schema/field-flag-spelling.d.ts +22 -0
  132. package/dist/sdk/schema/field-flag-spelling.js +2 -0
  133. package/dist/sdk/schema/field-option-collisions.js +1 -1
  134. package/docs/AGENT_GUIDE.md +2 -2
  135. package/docs/COMMANDS.md +1 -1
  136. package/docs/CONFIGURATION.md +1 -0
  137. package/docs/EXTENSIONS.md +1 -1
  138. package/docs/MUTATION_INTEGRITY.md +97 -8
  139. package/docs/READ_OUTPUT_CONTRACTS.md +2 -0
  140. package/docs/SDK.md +60 -4
  141. package/docs/SDK_AUDITED_MUTATIONS.md +11 -0
  142. package/docs/WORKSPACE_POSITION_AND_LIFECYCLE.md +17 -4
  143. package/marketplace.json +1 -1
  144. package/package.json +1 -1
  145. package/packages/pm-beads/package.json +1 -1
  146. package/packages/pm-calendar/package.json +1 -1
  147. package/packages/pm-command-kit/package.json +1 -1
  148. package/packages/pm-digital-twin/package.json +1 -1
  149. package/packages/pm-governance-audit/package.json +1 -1
  150. package/packages/pm-guide-shell/package.json +1 -1
  151. package/packages/pm-kanban/package.json +1 -1
  152. package/packages/pm-lifecycle-hooks/package.json +1 -1
  153. package/packages/pm-linked-test-adapters/package.json +1 -1
  154. package/packages/pm-search-advanced/package.json +1 -1
  155. package/packages/pm-templates/package.json +1 -1
  156. package/packages/pm-todos/package.json +1 -1
  157. package/packages/pm-vcs/package.json +1 -1
  158. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  159. package/plugins/pm-claude/package.json +1 -1
  160. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  161. package/plugins/pm-codex/package.json +1 -1
  162. package/plugins/pm-codex/plugin.json +1 -1
  163. package/runtime-dependencies.json +1 -1
  164. package/dist/cli-bundle/chunks/chunk-5WZZ5XEN.js +0 -3
  165. package/dist/cli-bundle/chunks/chunk-6MYJLOSG.js +0 -2
  166. package/dist/cli-bundle/chunks/chunk-ENKXRSFZ.js +0 -31
  167. package/dist/cli-bundle/chunks/chunk-FJOEL75F.js +0 -2
  168. package/dist/cli-bundle/chunks/chunk-GDXCAC52.js +0 -2
  169. package/dist/cli-bundle/chunks/chunk-KE7HMBEW.js +0 -2
  170. package/dist/cli-bundle/chunks/chunk-KZHIBEJL.js +0 -33
  171. package/dist/cli-bundle/chunks/chunk-NGJ5ERBF.js +0 -115
  172. package/dist/cli-bundle/chunks/chunk-NQ54T7T2.js +0 -2
  173. package/dist/cli-bundle/chunks/chunk-OKEZF7HU.js +0 -2
  174. package/dist/cli-bundle/chunks/chunk-OKIKF4FD.js +0 -2
  175. package/dist/cli-bundle/chunks/chunk-OPJF254V.js +0 -9
  176. package/dist/cli-bundle/chunks/chunk-RWA5YZ5X.js +0 -2
  177. package/dist/cli-bundle/chunks/chunk-S32NGRQM.js +0 -2
  178. package/dist/cli-bundle/chunks/chunk-TZY5MVJF.js +0 -125
  179. package/dist/cli-bundle/chunks/chunk-ZPS4B6SI.js +0 -8
  180. package/dist/cli-bundle/chunks/item-revision-FMD4KWBB.js +0 -2
  181. package/dist/cli-bundle/chunks/item-transaction-SEHTH7N2.js +0 -2
  182. package/dist/cli-bundle/chunks/mutation-actor-SFGYIRPW.js +0 -2
  183. package/dist/cli-bundle/chunks/mutation-admission-57LBSKQI.js +0 -2
  184. package/dist/cli-bundle/chunks/register-mutation-6NUOPHZ3.js +0 -21
  185. package/dist/cli-bundle/chunks/register-operations-JGYVORNN.js +0 -2
  186. package/dist/cli-bundle/chunks/register-setup-C44SIXEH.js +0 -2
  187. package/dist/cli-bundle/chunks/stage-PQ7AB63N.js +0 -2
  188. package/dist/cli-bundle/focused-chunks/chunk-6LKTEKHS.js +0 -6
  189. package/dist/cli-bundle/focused-chunks/chunk-6LPXMFLM.js +0 -2
  190. package/dist/cli-bundle/focused-chunks/chunk-HMDQDRV2.js +0 -8
  191. package/dist/cli-bundle/focused-chunks/chunk-I66IKYKP.js +0 -2
  192. package/dist/cli-bundle/focused-chunks/chunk-IR2J3NOT.js +0 -2
  193. package/dist/cli-bundle/focused-chunks/chunk-ITKDHSBR.js +0 -2
  194. package/dist/cli-bundle/focused-chunks/chunk-LQYYPXUK.js +0 -26
  195. package/dist/cli-bundle/focused-chunks/chunk-NQTEE66P.js +0 -13
  196. package/dist/cli-bundle/focused-chunks/chunk-O7Z73ALG.js +0 -2
  197. package/dist/cli-bundle/focused-chunks/chunk-OTMMOKPM.js +0 -91
  198. package/dist/cli-bundle/focused-chunks/chunk-OXOCZJC6.js +0 -2
  199. package/dist/cli-bundle/focused-chunks/chunk-QLAHEDT6.js +0 -2
  200. package/dist/cli-bundle/focused-chunks/chunk-TD544C74.js +0 -8
  201. package/dist/cli-bundle/focused-chunks/chunk-UFTUNBMY.js +0 -27
  202. package/dist/cli-bundle/focused-chunks/chunk-XRS3VNC6.js +0 -44
  203. package/dist/cli-bundle/focused-chunks/chunk-XYPEZGTR.js +0 -2
  204. package/dist/cli-bundle/focused-chunks/chunk-YSJKQLFR.js +0 -2
  205. package/dist/cli-bundle/focused-chunks/chunk-Z2X7HH3C.js +0 -102
  206. package/dist/cli-bundle/focused-chunks/item-transaction-UKEQCTKB.js +0 -2
  207. package/dist/cli-bundle/focused-chunks/mutation-actor-AS465LRX.js +0 -2
  208. package/dist/cli-bundle/focused-chunks/mutation-admission-E5UHJZFE.js +0 -2
  209. package/dist/cli-bundle/focused-chunks/stage-36J7YLGI.js +0 -2
@@ -1,8 +1,8 @@
1
- import{a as Ng}from"./chunks/chunk-J2PDAVBC.js";import{a as EN,b as AN,c as xN,d as bN}from"./chunks/chunk-O7JHS64G.js";import{a as wN,b as ON}from"./chunks/chunk-KE7HMBEW.js";import{b as Vk,c as Kk,d as Wk,e as Yk,f as Xk,g as Jk,h as Qk,i as Zk,j as eN,k as tN,l as rN,m as nN,n as oN,o as iN,p as sN,q as aN,r as cN}from"./chunks/chunk-OKIKF4FD.js";import{A as _N,B as hN,C as gN,D as CN,E as yN,F as SN,G as TN,a as zs,b as JR,c as QR,d as kc,e as Nc,f as Lc,h as $c,i as Dc,j as Fc,k as Gc,l as Uc,m as jc,n as Bc,o as zc,p as Vd,q as Kd,r as Wd,s as Yd,t as Xd,u as dN,v as pN,w as lN,x as uN,y as mN,z as fN}from"./chunks/chunk-RWA5YZ5X.js";import{A as e0,B as t0,C as r0,D as n0,E as o0,F as i0,G as s0,H as a0,I as c0,J as d0,K as p0,L as l0,M as u0,N as m0,O as f0,P as _0,Q as h0,R as g0,S as C0,T as y0,U as S0,V as T0,W as E0,X as A0,Y as x0,Z as b0,_ as w0,a as RN,b as PN,c as MN,d as IN,e as vN,f as kN,g as NN,h as LN,i as $N,j as DN,k as FN,l as GN,m as UN,n as jN,o as BN,p as zN,q as qN,r as HN,s as VN,t as KN,u as WN,v as YN,w as XN,x as JN,y as QN,z as ZN}from"./chunks/chunk-ZPS4B6SI.js";import{$ as _f,$a as sh,$b as sg,A as fv,Aa as R_,Ab as kh,Ac as kg,B as Ke,Ba as P_,Bb as Nh,C as ef,Ca as M_,Cb as Lh,D as tf,Da as I_,Db as $h,E as nf,Ea as v_,Eb as Dh,F as Ht,Fa as k_,Fb as Fh,G as Vt,Ga as N_,Gb as Gh,H as Kt,Ha as L_,Hb as Uh,I as Wt,Ia as $_,Ib as jh,J as Yt,Ja as D_,Jb as Bh,K as Xt,Ka as F_,Kb as zh,L as Jt,La as G_,Lb as qh,M as Qt,Ma as U_,Mb as Hh,N as Zt,Na as j_,Nb as Vh,O as er,Oa as B_,Ob as Kh,P as tr,Pa as z_,Pb as Wh,Q as of,Qa as q_,Qb as Yh,R as sf,Ra as H_,Rb as Xh,S as af,Sa as V_,Sb as Jh,T as cf,Ta as K_,Tb as Qh,U as df,Ua as W_,Ub as Zh,V as We,Va as rr,Vb as eg,W as pf,Wa as _e,Wb as tg,X as lf,Xa as rh,Xb as rg,Y as uf,Ya as nh,Yb as ng,Z as mf,Za as oh,Zb as og,_ as ff,_a as ih,_b as ig,a as pR,aa as hf,ab as ah,ac as ag,b as lR,ba as gf,bb as ch,bc as cg,c as uR,ca as Ok,cb as dh,cc as dg,d as mR,da as Rk,db as ph,dc as pg,e as fR,ea as Pk,eb as lh,ec as lg,f as _R,fa as Mf,fb as uh,fc as ug,g as CR,ga as If,gb as mh,gc as mg,h as yR,ha as vf,hb as fh,hc as fg,i as SR,ia as C_,ib as _h,ic as _g,j as TR,ja as y_,jb as hh,jc as hg,k as qs,ka as Fk,kb as gh,kc as gg,l as cd,la as Gk,lb as Ch,lc as Cg,m as dd,ma as Uk,mb as yh,mc as yg,n as pd,na as jk,nb as Sh,nc as Sg,oa as Bk,ob as Th,oc as Tg,p as $M,pa as zk,pb as Eh,pc as Eg,q as DM,qa as qk,qb as Ah,qc as Ag,r as FM,ra as Hk,rb as xh,rc as xg,s as GM,sa as S_,sb as bh,sc as bg,t as UM,ta as T_,tb as wh,tc as wg,u as jM,ua as E_,ub as Oh,uc as Og,v as Nu,va as A_,vb as Rh,vc as Rg,w as Du,wa as x_,wb as Ph,wc as Pg,x as Fu,xa as b_,xb as Mh,xc as Mg,y as om,ya as w_,yb as Ih,yc as Ig,z as lm,za as O_,zb as vh,zc as vg}from"./chunks/chunk-AEOHUSUI.js";import{e as qM,f as HM,g as el,h as tl,i as Bt}from"./chunks/chunk-5WZZ5XEN.js";import{A as hk,B as gk,C as Ck,D as yk,E as Sk,F as Tk,G as Ek,H as Ak,I as xk,J as bk,K as wk,L as Sf,M as Tf,N as Ef,O as Af,P as xf,Q as bf,R as wf,S as Of,T as Rf,U as Pf,a as JI,b as QI,c as ZI,d as ev,e as tv,f as ku,g as rv,h as nv,i as ov,j as iv,k as sv,m as rf,n as Cf,o as ik,p as sk,q as ak,r as ck,s as dk,t as pk,u as yf,v as lk,w as uk,x as mk,y as fk,z as _k}from"./chunks/chunk-H7JEXRIN.js";import{$ as WP,$a as Sl,$b as Ru,$d as X_,A as qe,Aa as yM,Ab as sI,Ac as qu,Ad as Kf,B as ee,Ba as SM,Bb as gu,Bc as Hu,Bd as Wf,C as pp,Ca as TM,Cb as aI,Cc as Vu,Cd as Yf,Db as xI,Dc as Ku,Dd as Xf,Eb as bI,Ec as Wu,Ed as Jf,F as He,Fa as BM,Fb as wI,Fc as Yu,Fd as Qf,G as lp,Ga as zM,Gb as OI,Gc as Xu,Gd as Zf,H as up,Ha as Kp,Hb as RI,Hc as Ju,Hd as e_,Ia as Wp,Ib as PI,Ic as Qu,Id as t_,J as fe,Ja as Yp,Jb as MI,Jc as Zu,Jd as r_,K as mp,Ka as Xp,Kb as $I,Kc as em,Kd as n_,L as fp,La as Jp,Lb as DI,Lc as tm,Ld as o_,M as _p,Ma as Qp,Mb as Cu,Mc as rm,Md as i_,N as hp,Na as Zp,Nb as yu,Nd as s_,O as DP,Oa as al,Ob as FI,Oc as uv,Od as a_,P as FP,Pa as cl,Pb as GI,Pc as mv,Q as GP,Qa as dl,Qb as UI,Qc as nm,Qd as c_,R as UP,Ra as pl,Rb as jI,Rc as um,Rd as d_,S as jP,Sa as ll,Sb as BI,Sc as mm,Sd as p_,T as Nt,Ta as ul,Tb as Su,Tc as fm,Td as l_,U as BP,Ua as ml,Ub as Tu,Uc as _m,Ud as u_,V as zP,Va as fl,Vb as Eu,Vc as hm,Vd as m_,W as Lt,Wa as _l,Wb as Au,Wd as f_,X as qP,Xa as hl,Xb as xu,Xd as __,Y as HP,Ya as gl,Yb as bu,Yd as h_,Z as VP,Za as Cl,Zb as wu,Zd as g_,_ as KP,_a as yl,_b as Ou,_c as gm,_d as Y_,a as ZR,aa as Ve,ab as Tl,ac as Pu,ad as Vm,ae as J_,b as Mt,ba as YP,bb as El,bc as Mu,bd as Km,be as Q_,c as eP,ca as $t,cb as Al,cc as Iu,cd as Wm,ce as Z_,d as Zc,da as XP,db as xl,dc as zI,de as eh,e as ed,ea as JP,eb as bl,ec as qI,ed as Ym,ee as th,f as td,fa as QP,fb as wl,fc as HI,fd as Xm,g as rd,ga as ZP,gb as Ol,gc as VI,gd as Jm,h as nd,ha as eM,hb as Rl,hc as KI,hd as Qm,ia as tM,ib as WM,ic as WI,id as Zm,j as od,ja as rM,jb as Pl,jc as YI,jd as kf,k as id,ka as nM,kb as Ml,kc as XI,kd as Nf,la as oM,lb as Il,lc as vu,ld as Lf,ma as iM,mb as vl,mc as av,md as $f,na as sM,nb as YM,nc as cv,nd as Df,o as sd,oa as aM,ob as kl,oc as dv,od as Ff,p as ad,pa as cM,pb as Nl,pc as pv,pd as Gf,qa as dM,qb as Ll,qc as lv,qd as Uf,ra as pM,rb as $l,rd as jf,sa as lM,sb as Dl,sc as Lu,sd as Lk,ta as uM,tb as XM,tc as $u,td as $k,ua as mM,ub as JM,uc as Gu,ud as Dk,va as fM,vb as QM,vc as Uu,vd as Bf,w as vt,wa as _M,wb as ZM,wd as zf,xa as hM,xb as eI,xc as ju,xd as qf,y as kt,ya as gM,yb as tI,yc as Bu,yd as Hf,za as CM,zb as rI,zc as zu,zd as Vf}from"./chunks/chunk-ENKXRSFZ.js";import"./chunks/chunk-5DUP4AZA.js";import{x as Jd}from"./chunks/chunk-FJOEL75F.js";import{A as IM,B as vM,D as kM,E as NM,Ea as Dp,F as LM,Fa as Fp,G as Pp,H as Mp,Ha as Gp,I as Ip,Ia as Up,J as vp,Ja as jp,K as Dt,Ka as Bp,La as zp,Na as qp,Oa as Hp,Pa as Vp,b as wR,c as OR,d as RR,e as PR,f as MR,g as IR,h as Hs,i as Vs,j as Ks,k as Ws,l as Ys,n as EM,qa as Ft,ra as Gt,sa as Ut,ta as jt,ua as kp,wa as Np,xa as Lp,ya as $p}from"./chunks/chunk-CFWLQFJM.js";import{a as AM,b as xM,c as bM,d as wM,e as OM,f as RM,g as PM,h as Tp,i as Ep,j as Ap,k as xp,l as bp,m as MM,n as wp,o as Op,p as Rp}from"./chunks/chunk-BSRIVYTM.js";import{a as gp,b as Cp,e as yp,f as Sp}from"./chunks/chunk-D6PDUKUG.js";import{$a as CI,$b as Dv,A as PP,Aa as du,Ab as Am,Ac as $m,B as Qd,Ba as pu,Bb as xm,Bc as Dm,C as Zd,Ca as lu,Cb as bm,Cc as Fm,D as ep,Da as uu,Db as hv,Dc as Gm,E as tp,Ea as mu,Eb as gv,Ec as Um,F as rp,Fa as fu,Fb as Cv,Fc as jm,G as np,Ga as _u,Gb as yv,Gc as Bm,H as op,Ha as hu,Hb as Sv,Hc as zm,I as ip,Ib as Tv,Ic as qt,J as sp,Jb as Ev,Jc as qm,K as ap,Kc as tk,L as cp,La as nI,Lb as wm,Lc as rk,M as ze,Ma as oI,Mb as Om,Mc as nk,N as MP,Na as iI,Nb as Av,Nc as Hm,O as IP,Oa as cI,Ob as xv,Oc as ok,P as vP,Pa as dI,Pb as bv,Pc as Mk,Q as kP,Qa as pI,Qb as wv,Qc as Ik,R as NP,Ra as lI,Rb as Ov,Rc as vk,S as LP,Sa as uI,Sb as Rv,Sc as kk,T as $P,Ta as mI,Tb as Pv,Tc as Nk,U as dp,Ua as fI,Ub as Mv,V as rl,Va as _I,Vb as Iv,W as nl,Wa as hI,Wb as vv,X as ol,Xa as gI,Xb as kv,Y as il,Yb as Nv,Z as VM,Zb as Lv,_ as KM,_b as $v,a as ER,aa as sl,ac as Fv,b as AR,ba as Fl,bb as yI,bc as Gv,c as xR,ca as Gl,cb as SI,cc as Uv,d as bR,da as Ul,dc as jv,e as _P,ea as jl,ec as Bv,f as hP,fa as Bl,fb as TI,fc as zv,g as gP,ga as zl,gb as EI,gc as qv,h as CP,ha as ql,hb as AI,hc as Hv,i as yP,ia as Hl,ic as Vv,j as SP,ja as Vl,jb as II,jc as Kv,k as TP,ka as Kl,kb as vI,kc as Wv,la as Wl,lb as kI,lc as Yv,ma as Yl,mb as NI,mc as Xv,na as Xl,nb as LI,nc as Jv,oa as Jl,ob as im,oc as Qv,pa as Ql,pb as sm,pc as Zv,qa as Zl,qb as am,qc as ek,ra as eu,rb as cm,rc as zt,sa as tu,sb as dm,sc as Rm,t as EP,ta as ru,tb as pm,tc as Pm,u as AP,ua as nu,ub as Cm,uc as Mm,v as xP,va as ou,vb as ym,vc as Im,w as bP,wa as iu,wb as Sm,wc as vm,x as wP,xa as su,xb as Tm,xc as km,y as OP,ya as au,yb as _v,yc as Nm,z as RP,za as cu,zb as Em,zc as Lm}from"./chunks/chunk-KZHIBEJL.js";import{a as hR,b as gR}from"./chunks/chunk-S32NGRQM.js";import{$ as Ea,$a as Ec,A as Js,Aa as Ya,Ab as _d,B as Qs,Ba as Xa,Bb as hd,C as Zs,Ca as Ja,Cb as gd,Da as Qa,Db as Cd,E as ea,Ea as Za,Eb as yd,F as ta,Fa as ec,Fb as Sd,G as ra,Ga as tc,Gb as Td,H as na,Ha as rc,Hb as Ed,I as oa,Ia as nc,Ib as Ad,J as ia,Ja as oc,Jb as xd,K as sa,Ka as ic,Kb as bd,L as aa,La as sc,Lb as wd,M as ca,Ma as ac,Mb as Od,N as da,Na as cc,Nb as Rd,O as pa,Oa as dc,Ob as Pd,P as la,Pa as pc,Pb as Md,Q as ua,Qa as lc,Qb as Id,R as ma,Ra as uc,Rb as vd,Sa as mc,Sb as kd,T as fa,Ta as fc,Tb as Nd,U as _a,Ua as _c,Ub as tP,V as ha,Va as hc,Vb as rP,W as ga,Wa as gc,Wb as nP,X as Ca,Xa as Cc,Xb as oP,Y as ya,Ya as yc,Yb as iP,Z as Sa,Za as Sc,Zb as sP,_ as Ta,_a as Tc,a as vR,aa as Aa,ab as Ac,b as kR,ba as xa,bb as xc,bc as aP,c as NR,ca as ba,cb as bc,cc as cP,d as LR,da as wa,db as wc,dc as dP,e as $R,ea as Oa,eb as Oc,ec as pP,fa as Ra,fb as Rc,fc as lP,g as DR,ga as Pa,gb as Pc,gc as uP,h as FR,ha as Ma,hb as Mc,hc as mP,i as Xs,ia as Ia,ib as Ic,ic as fP,j as GR,ja as va,ka,kb as Be,kc as Ld,la as Na,lb as Z,lc as $d,m as UR,ma as La,mb as vc,mc as Dd,n as jR,na as $a,nb as qc,nc as Fd,o as Ue,oa as Da,ob as Hc,oc as Gd,p as BR,pa as Fa,pb as Vc,pc as Ud,q as zR,qa as Ga,qb as Kc,qc as jd,r as qR,ra as Ua,rb as Wc,rc as Bd,s as Pt,sa as ja,sb as Yc,sc as zd,t as je,ta as Ba,tb as Xc,tc as qd,u as HR,ua as za,ub as Jc,uc as Hd,v as VR,va as qa,vb as Qc,vc as It,w as KR,wa as Ha,wb as ld,x as WR,xa as Va,xb as ud,y as YR,ya as Ka,yb as md,z as XR,za as Wa,zb as fd}from"./chunks/chunk-OPJF254V.js";import{a as tR,b as rR,c as nR,d as oR,e as iR,f as sR,g as aR,h as cR,i as dR,j as Ns,k as Ls,l as $s,m as Ds,n as Fs,o as Gs,q as Us,s as js,y as Bs}from"./chunks/chunk-6MYJLOSG.js";import{b as QO}from"./chunks/chunk-NQ54T7T2.js";import"./chunks/chunk-PZA7QECY.js";import{$b as dO,$c as MO,A as uT,Aa as rw,Ab as Hw,Ac as SO,Ad as YO,B as mT,Ba as nw,Bc as TO,Bd as XO,C as fT,Cc as EO,Cd as JO,Db as Vw,Dc as AO,Dd as ZO,Ec as xO,Ed as eR,Fb as Kw,Fc as bO,Gc as wO,Hc as fs,Ic as _s,Jb as Ww,Jc as hs,K as xT,Kb as Yw,Kc as gs,La as ow,Lb as Xw,Lc as Cs,M as kT,Ma as iw,Mb as ns,Mc as ys,N as NT,Na as sw,Nb as Jw,Nc as Ss,O as LT,Oa as aw,Oc as Ts,P as $T,Pa as cw,Pb as Qw,Pc as Es,Q as BT,Qa as dw,Qb as Zw,Qc as As,R as zT,Ra as _w,Rb as eO,Rc as xs,S as bt,Sa as hw,Sb as tO,Sc as bs,T as Eb,Ta as gw,Tb as rO,Tc as ws,U as Ab,Ua as wt,Ub as nO,Uc as Os,V as xb,Vb as oO,Wa as Cw,Wb as iO,Wc as Rs,X as bb,Xa as yw,Xb as sO,Xc as OO,Ya as Sw,Yb as aO,Yc as RO,Z as wb,Za as Tw,Zb as Ot,Zc as Ps,_ as Ob,_a as Ew,_b as cO,_c as PO,a as ZS,aa as Rb,ad as Ms,ba as Pb,bb as Aw,bd as Is,ca as Mb,cd as IO,da as Ib,dd as vO,ea as vb,ed as kO,fa as kb,fb as Xi,fc as os,fd as NO,ga as Nb,gc as is,gd as LO,ha as qb,hb as kw,hc as ss,hd as $O,i as io,ib as Nw,ic as as,id as DO,j as eT,ja as Vi,jb as Lw,jd as vs,k as tT,ka as Ki,kb as $w,kc as cs,kd as ks,l as rT,la as Wi,lc as ds,ld as FO,m as nT,mb as Dw,mc as ps,md as GO,na as Hb,nb as Fw,nc as ls,nd as UO,o as oT,oa as Vb,ob as Gw,oc as us,od as jO,p as iT,pa as Kb,pb as Uw,pc as ms,pd as BO,qa as Wb,qb as es,qc as pO,qd as zO,r as sT,ra as Yb,rb as ts,rc as lO,rd as qO,sa as Xb,sc as uO,sd as HO,t as aT,ta as Jb,tb as rs,tc as mO,td as VO,u as cT,ub as jw,uc as fO,ud as KO,v as dT,va as Qb,vc as _O,vd as WO,wb as Bw,wc as hO,x as pT,xa as Zb,xb as zw,xc as gO,y as lT,ya as ew,yb as qw,yc as CO,za as tw,zc as yO,zd as Rt}from"./chunks/chunk-TZY5MVJF.js";import{A as Ow,B as Rw,C as Pw,D as Mw,E as Iw,F as vw,G as Ji,H as Qi,I as Zi,a as Lb,b as $b,c as Db,d as Fb,e as Gb,f as Ub,g as jb,h as Bb,i as zb,n as pw,q as lw,r as uw,u as mw,v as Yi,w as fw,x as xw,y as bw,z as ww}from"./chunks/chunk-2UQU7HRR.js";import{$c as pE,$e as NE,$f as dA,$h as vx,$i as Zx,A as Fn,Ac as nE,Ad as Fe,Af as Si,Ag as $A,Ah as Rx,Ai as Bx,Aj as qi,B as Gn,Bd as Wo,Bf as Ti,Bg as DA,Bh as Px,Bi as zx,C as Un,Cb as bT,Ce as wE,Cf as Ei,Cg as FA,Ch as Mx,Ci as qx,D as jn,Db as wT,Dc as vo,Df as Ai,Dg as GA,Di as Hx,Dj as hb,E as Bn,Ec as oE,Ee as li,Ef as xi,Eg as UA,Eh as Ix,Ei as Vx,Ej as Hi,F as zn,Fa as _T,Fc as ko,Fe as ui,Ff as bi,Fg as jA,Fh as $i,G as qn,Ga as hT,Ge as mi,Gf as wi,Gg as BA,Gh as Di,H as Hn,Ha as gT,Hc as iE,He as fi,Hf as Oi,Hg as zA,Hj as gb,I as Ne,Id as mE,If as Ri,Ig as qA,Ii as Kx,Ij as Cb,J as Le,Jb as OT,Jd as fE,Jf as Pi,Jg as HA,Jj as yb,K as Vn,Ka as go,Kd as _E,Kf as Mi,Kg as VA,Ki as Wx,Kj as Sb,L as Kn,La as CT,Ld as Yo,Lf as Ii,Lg as KA,Lj as Tb,M as Wn,Ma as yT,Mb as RT,Md as Xo,Mf as vi,Mg as WA,N as Yn,Na as ST,Nc as sE,Nd as Jo,Ne as OE,Nf as ki,Ng as YA,O as Xn,Oa as TT,Od as Qo,Oe as RE,Of as Ni,Og as XA,P as Jn,Pb as PT,Pd as Zo,Pe as PE,Pf as Li,Pg as JA,Q as Qn,Qa as Co,Qc as aE,Qd as ei,Qf as eA,Qg as QA,R as Zn,Ra as yo,Rc as cE,Rd as ti,Rf as tA,Rg as ZA,S as eo,Sa as De,Sb as MT,Sc as No,Sd as ri,Sf as rA,Sg as ex,T as to,Ta as ET,Tc as Lo,Td as ni,Te as _i,Tf as nA,Tg as tx,U as ro,Ua as AT,Ub as Tt,Ud as oi,Uf as oA,Ug as rx,V as no,Va as So,Vc as $o,Vd as ii,Vf as iA,Vg as nx,W as oo,Wa as To,Wb as Et,Wc as Do,Wd as si,Wf as sA,Wg as ox,Wi as Yx,Xc as Fo,Xd as ai,Xe as ME,Xf as aA,Xg as ix,Xi as Xx,Ya as Eo,Yb as Mo,Yc as Go,Yd as ci,Ye as IE,Yf as cA,Yg as sx,Yi as Jx,Zb as Io,Zc as Uo,Zd as di,Ze as vE,Zg as ax,_b as At,_c as dE,_e as kE,_i as Qx,a as R,aa as Ct,ac as IT,ae as hE,af as LE,ag as pA,ah as cx,ai as Ge,b as jS,ba as yt,be as gE,bf as $E,bg as lA,bh as dx,bi as xt,bj as eb,c as gt,ca as po,cc as vT,ce as pi,cf as DE,cg as uA,ch as px,ci as kx,cj as Ui,da as lo,dc as DT,df as FE,dg as mA,dh as lx,di as Nx,e as BS,ea as uo,ec as FT,ef as GE,eg as fA,eh as ux,ei as Lx,ej as ji,f as zS,fc as GT,ff as UE,fg as _A,fh as mx,fi as $x,fj as Bi,g as qS,gc as UT,ge as CE,gf as jE,gg as hA,gh as fx,gi as z,h as HS,hc as jT,he as yE,hg as gA,hh as _x,hi as Dx,i as VS,ic as qT,ig as CA,ii as Fx,ij as tb,j as KS,ja as mo,jb as Ao,jc as HT,jf as BE,jg as yA,ji as Gx,jj as rb,k as WS,kb as xo,kc as VT,kf as zE,kg as SA,ki as Ux,kj as nb,l as YS,la as fo,lb as bo,lc as KT,ld as jo,lf as qE,lg as TA,lh as hx,lj as ob,m as XS,ma as _o,mb as wo,mc as WT,md as Bo,mf as HE,mg as EA,mh as gx,mi as Fi,mj as ib,n as JS,na as ho,nb as Oo,nc as YT,nd as lE,nf as VE,ng as AA,ni as Gi,nj as sb,o as QS,oc as XT,od as zo,of as KE,og as xA,oj as ab,p as Mn,pc as JT,pd as qo,pf as WE,pg as bA,ph as Cx,pj as zi,q as In,qc as QT,qd as uE,qe as SE,qf as YE,qg as wA,qh as yx,qj as cb,r as vn,rc as ZT,rd as Ho,re as TE,rf as XE,rg as OA,rh as Sx,rj as db,s as kn,sc as eE,sd as Vo,se as EE,sf as JE,sg as RA,sh as Tx,t as ve,tc as tE,td as L,te as AE,tf as QE,tg as PA,th as Ex,u as Nn,uc as rE,ud as Ko,uf as ZE,ug as MA,uh as Ax,uj as pb,v as N,ve as xE,vg as IA,vh as xx,vj as lb,w as ke,wb as Ro,we as bE,wf as hi,wg as vA,wh as bx,wj as ub,x as Ln,xf as gi,xg as kA,xj as mb,y as $n,yb as Po,yf as Ci,yg as NA,yh as wx,yi as jx,yj as fb,z as Dn,zf as yi,zg as LA,zh as Ox,zj as _b}from"./chunks/chunk-NGJ5ERBF.js";import"./chunks/chunk-AA52P34H.js";import"./chunks/chunk-6H36ZHMI.js";import{A as ue,B as US,C as S,E as so,F as St,G as me,H as ao,K as $e,M as co,b as kS,c as NS,d as LS,m as $S,r as DS,u as FS,y as GS}from"./chunks/chunk-YYT3MIRF.js";import"./chunks/chunk-XAWE4EAK.js";var q="2026-07-28",or=["2025-11-25","2025-06-18"],te=[q],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function $g(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=Lg(t[x.clientInfo]),i=$g(t[x.logLevel]);return{protocolVersion:q,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function O0(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function R0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function P0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function Dg(e,t){return Xe({...e,resultType:"complete"},t)}function M0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Dg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function I0(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}var Fg=new Set(["--help","-h","--version","-V"]);function Gg(e,t){let n=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&n.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),n.join(`
2
- `)}function N0(e,t,r){if(e.length===0)return{kind:"serve"};let n=e.find(i=>!Fg.has(i));if(n!==void 0){let i=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(n)}. Run ${i} --help.
3
- `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Gg(t,r):`${r}
4
- `,stderr:""}}import{createHash as ar,createHmac as cr,timingSafeEqual as Ug}from"node:crypto";var jg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},dr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Bg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Ce(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let n={};for(let[o,i]of r){if(!dr.test(o)||!h(i))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!jg.includes(s))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Bg(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(i.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Ce(n,Qe,"inputRequests"),n}function pr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[n,o]of t){if(!dr.test(n)||!h(o))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Ce(r,Qe,"inputResponses"),r}function F0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[x.serverInfo]:{...e.serverInfo}}}}function lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function G0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let n=r.toString("base64url"),o=cr("sha256",lr(t)).update(n).digest("base64url");return`${n}.${o}`}function zg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function U0(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=cr("sha256",lr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Ug(s,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=zg(c),{expiresAt:p,method:l,parameterDigest:f,principal:g}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:p});if(l!==r.method||f!==r.parameterDigest||g!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function j0(e){return Ce(e,Qe,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ar("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function qg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function B0(e,t){return{...e,...qg(t)}}function Hg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Vg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Hg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function Kg(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,n=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function Wg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Yg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Vg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function z0(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=Kg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Ce(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:n,maximumNodes:o});Yg(e,a.value),Wg(a,i)}return structuredClone(e)}import{randomUUID as Xg}from"node:crypto";import{readFile as Jg}from"node:fs/promises";import ur from"node:path";var J0="io.modelcontextprotocol/tasks",Qg=["working","input_required","completed","failed","cancelled"],Zg=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,eC=3600*1e3,tC=1e3,Se=1024,rC=30,nC=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!Zg.test(t))throw et("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function fr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function oC(e){if(!Qg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function iC(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function sC(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function aC(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function cC(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function dC(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function pC(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=oC(e.status),n=iC(e.principal),o=sC(e.workerPid),i=aC(e.ttlMs),s=cC(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:dC(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=fr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function re(e){return e==="completed"||e==="failed"||e==="cancelled"}function lC(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${Xg()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return pC(JSON.parse(await Jg(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
- `)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,rC,this.#t,!1,!1,nC);try{let s=await this.#c(o);if(s.principal!==r)throw et("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ye(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?eC:t.ttlMs,i=t.pollIntervalMs??tC;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new u("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#o(t,r,n=>{if(re(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!lC(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#o(t.taskId,t.principal,n=>{if(re(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=pr(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[p,l]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,p)&&(d[p]=l,delete c[p],i.push(p));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return H(await this.#o(t,r,o=>re(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=fr(n);return H(await this.#o(t,r,i=>re(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#o(t,r,n=>re(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function Q0(e){return new tt(e)}var Te="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,uC=5e3;function mC(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),uC);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function rt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function fC(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),n=rt(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function _C(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var gr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=_C(fC(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Te]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[Te]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Te]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await mC(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Te]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};var Cr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,hC=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,Sr=new Set(["prompts/get","resources/read","tools/call"]);function gC(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function b(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!Cr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=Cr.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?b("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?b("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function CC(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!hC.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Ar(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!h(s))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!h(c))continue;let d=[...i,a],p=CC(c,d,r);p&&t.push(p);for(let[l,f]of Object.entries(c))if(l!=="properties"&&l!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:l});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Ee(i))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function xr(e,t){let r=e;for(let n of t){if(!h(r))return;r=r[n]}return r}function br(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function yC(e,t){let r=h(e.arguments)?e.arguments:{},n={};for(let o of Ar(t)){let i=xr(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=Tr(i)}return n}function nL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),n=e.request.method;if(typeof n!="string"||n.length===0)return b("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=br(n,t);if(Sr.has(n)){if(i===void 0)return b("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=Tr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,yC(t,e.toolSchema)),o}function SC(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&b("Missing MCP request method","Mcp-Method");let n=h(t.params)?t.params:void 0,o=Ye(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&b("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&b("MCP method header does not match request body","Mcp-Method"),Sr.has(r)){let i=e.get("mcp-name"),s=br(r,n);(i===void 0||s===void 0||Er(i,"Mcp-Name")!==s)&&b("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&b("MCP SSE resumability is not supported","Last-Event-ID")}function TC(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function EC(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Ar(e.toolSchema)){let n=xr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&b("Unexpected MCP parameter header",o);continue}i===void 0&&b("Missing MCP parameter header",o),TC(r,n,Er(i,o))||b("MCP parameter header does not match request body",o)}}function oL(e){let t=gC(e.headers),r=typeof e.request.method=="string"?e.request.method:"";SC(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&EC({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var iL=q;import{AsyncLocalStorage as AC}from"node:async_hooks";import{createHash as wr,timingSafeEqual as xC}from"node:crypto";var C=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},bC=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,wC=/^[a-z][a-z0-9_*/-]{0,255}$/u,OC=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,RC=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Pr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,PC=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,MC=/%(?![0-9A-Fa-f]{2})/u,IC=512,vC=32,kC=180,NC=8192,LC=8192,Mr=new AC;function A(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new C(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new C(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new C(`Invalid ${t}`,401);return n}function $C(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function pL(e){let t=A(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new C("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>A(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Rr.test(o)))throw new C("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function lL(e){let t=A(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function uL(e,t){if(!h(e)||typeof e.issuer!="string")throw new C("Invalid authorization server metadata",401);let r=A(t,"expected issuer").href.replace(/\/$/u,"");if(A(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new C("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new C("Authorization server does not support required S256 PKCE",401);let o=d=>{let p=e[d];if(typeof p!="string")throw new C(`Authorization server metadata requires ${d}`,401);return A(p,d).href},i=d=>{let p=e[d];return typeof p=="string"?A(p,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function mL(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function fL(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new C("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new C("Authorization response issuer mismatch",401)}function _L(e,t){let r=A(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new C("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new C("Invalid client redirect URI",401);A(n,"client redirect URI",!0)}return structuredClone(e)}function hL(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new C("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>A(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let n=A(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=A(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=A(t,"credential issuer").href;return this.#e.delete(r)}};function DC(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?bC.exec(t):null;if(!n)throw new C("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new C("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!GC(r)))throw new C("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function FC(e){return wC.test(e)||OC.test(e)}function GC(e){if(Buffer.byteLength(e,"utf8")>IC)return!1;let t=e.split(",");if(t.length>vC)return!1;let r=new Set;for(let n of t){let o=$(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!FC(s)||!RC.test(a)||r.has(s))return!1;r.add(s)}return!0}function Ir(e){return PC.test(e)&&!MC.test(e)}function UC(e){let t=$(e),r=t.indexOf("="),n=$(r>=0?t.slice(0,r):t),o=r>=0?$(t.slice(r+1)):void 0;return Pr.test(n)&&(o===void 0||Ir(o))}function jC(e){let t=$(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=$(i>0?n.slice(0,i):""),a=i>0?$(n.slice(i+1)):"";if(!(!Pr.test(s)||!Ir(a)||!o.every(UC)))return{key:s,serialized:t}}function BC(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>NC)throw new C("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>kC)throw new C("Invalid MCP baggage",403);let o=[];for(let i of n){let s=jC(i);if(!s)throw new C("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function gL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},n=BC(r.baggage,t.baggageAllowlist??[]);return{...DC(r),...n?{baggage:n}:{}}}function CL(e,t){return Mr.run(structuredClone(e),t)}function yL(){let e=Mr.getStore();return e?{...e}:void 0}async function SL(e){let t=A(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(l=>!Rr.test(l)))throw new C("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new C("Access tokens must not appear in URI query parameters",401,n);let s=$C(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new C("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>LC)throw new C("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new C("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new C("Bearer token issuer or audience mismatch",401,n);let p=r.filter(l=>!c.scopes.includes(l));if(p.length>0)throw new C("Bearer token has insufficient scope",403,`${n}, scope="${p.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function TL(e){let t=wr("sha256").update(e.token).digest();return r=>{let n=wr("sha256").update(r).digest();if(!xC(t,n))throw new C("Invalid bearer token",401);return structuredClone(e.claims)}}var nt="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",vr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function xL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[nt];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Nr)||o!==void 0&&o!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});return!0}var zC={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Lr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:zC})));function bL(e){return Lr.find(t=>t.uri===e)}function wL(e){let t=new Map(Lr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function kr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function OL(e){let t=kr(e.name),r=kr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),o=JSON.stringify(Ae);return`<!doctype html>
1
+ import{a as LN,b as $N}from"./chunks/chunk-SCIPT7WF.js";import{b as tN,c as rN,d as nN,e as oN,f as iN,g as sN,h as aN,i as cN,j as dN,k as pN,l as lN,m as uN,n as mN,o as fN,p as _N,q as hN,r as gN}from"./chunks/chunk-YIGBEY7K.js";import{a as jg}from"./chunks/chunk-XKWJONAO.js";import{a as IN,b as vN,c as kN,d as NN}from"./chunks/chunk-OWK2JL4I.js";import{A as xN,B as bN,C as wN,D as ON,E as RN,F as PN,G as MN,a as Ys,b as sP,c as aP,d as Gc,e as Uc,f as jc,h as Bc,i as qc,j as zc,k as Hc,l as Vc,m as Kc,n as Wc,o as Yc,p as fd,q as _d,r as hd,s as gd,t as Cd,u as CN,v as yN,w as SN,x as TN,y as EN,z as AN}from"./chunks/chunk-GZI7ZAB7.js";import{A as d0,B as p0,C as l0,D as u0,E as m0,F as f0,G as _0,H as h0,I as g0,J as C0,K as y0,L as S0,M as T0,N as E0,O as A0,P as x0,Q as b0,R as w0,S as O0,T as R0,U as P0,V as M0,W as I0,X as v0,Y as k0,Z as N0,_ as L0,a as DN,b as FN,c as GN,d as UN,e as jN,f as BN,g as qN,h as zN,i as HN,j as VN,k as KN,l as WN,m as YN,n as XN,o as JN,p as QN,q as ZN,r as e0,s as t0,t as r0,u as n0,v as o0,w as i0,x as s0,y as a0,z as c0}from"./chunks/chunk-FHLOGAGA.js";import{$ as Ef,$a as mh,$b as mg,A as Ke,Aa as L_,Ab as Uh,Ac as Ug,B as af,Ba as $_,Bb as jh,C as cf,Ca as D_,Cb as Bh,D as pf,Da as F_,Db as qh,E as lf,Ea as G_,Eb as zh,F as Ht,Fa as U_,Fb as Hh,G as Vt,Ga as j_,Gb as Vh,H as Kt,Ha as B_,Hb as Kh,I as Wt,Ia as q_,Ib as Wh,J as Yt,Ja as z_,Jb as Yh,K as Xt,Ka as H_,Kb as Xh,L as Jt,La as V_,Lb as Jh,M as Qt,Ma as K_,Mb as Qh,N as Zt,Na as W_,Nb as Zh,O as er,Oa as Y_,Ob as eg,P as tr,Pa as X_,Pb as tg,Q as uf,Qa as J_,Qb as rg,R as mf,Ra as Q_,Rb as ng,S as ff,Sa as Z_,Sb as og,T as _f,Ta as eh,Tb as ig,U as hf,Ua as th,Ub as sg,V as We,Va as rr,Vb as ag,W as gf,Wa as _e,Wb as cg,X as Cf,Xa as dh,Xb as dg,Y as yf,Ya as ph,Yb as pg,Z as Sf,Za as lh,Zb as lg,_ as Tf,_a as uh,_b as ug,a as yR,aa as Af,ab as fh,ac as fg,b as SR,ba as xf,bb as _h,bc as _g,c as TR,ca as $k,cb as hh,cc as hg,d as ER,da as Dk,db as gh,dc as gg,e as AR,ea as Fk,eb as Ch,ec as Cg,f as xR,fa as Df,fb as yh,fc as yg,g as OR,ga as Ff,gb as Sh,gc as Sg,h as RR,ha as Gf,hb as Th,hc as Tg,i as PR,ia as b_,ib as Eh,ic as Eg,j as MR,ja as w_,jb as Ah,jc as Ag,k as kc,ka as Kk,kb as xh,kc as xg,la as Wk,lb as bh,lc as bg,m as HM,ma as Yk,mb as wh,mc as wg,n as VM,na as Xk,nb as Oh,nc as Og,o as KM,oa as Jk,ob as Rh,oc as Rg,p as WM,pa as Qk,pb as Ph,pc as Pg,q as YM,qa as Zk,qb as Mh,qc as Mg,r as XM,ra as eN,rb as Ih,rc as Ig,s as nl,sa as O_,sb as vh,sc as vg,t as Fu,ta as R_,tb as kh,tc as kg,u as Gu,ua as P_,ub as Nh,uc as Ng,v as Bu,va as M_,vb as Lh,vc as Lg,w as qu,wa as I_,wb as $h,wc as $g,x as dm,xa as v_,xb as Dh,xc as Dg,y as hm,ya as k_,yb as Fh,yc as Fg,z as Av,za as N_,zb as Gh,zc as Gg}from"./chunks/chunk-BVJMVU4Z.js";import{$ as tM,$a as El,$b as Mu,$d as x_,Aa as wM,Ab as pI,Ac as Ku,Ad as Qf,Ba as OM,Bb as lI,Bc as Wu,Bd as Zf,C as ze,Ca as RM,Cb as _I,Cc as Yu,Cd as e_,D as ee,Da as PM,Db as Tu,Dc as Xu,Dd as t_,E as mp,Ea as MM,Eb as hI,Ec as Ju,Ed as r_,Fb as kI,Fc as Qu,Fd as n_,Gb as NI,Gc as Zu,Gd as o_,H as He,Ha as JM,Hb as LI,Hc as em,Hd as i_,I as fp,Ia as QM,Ib as $I,Ic as tm,Id as s_,J as _p,Ja as Xp,Jb as DI,Jc as rm,Jd as a_,Ka as Jp,Kb as FI,Kc as nm,Kd as c_,L as fe,La as Qp,Lb as GI,Lc as om,Ld as d_,M as hp,Ma as Zp,Mb as HI,Mc as im,Md as p_,N as gp,Na as el,Nb as VI,Nc as sm,Nd as l_,O as Cp,Oa as tl,Ob as Eu,Oc as am,Od as u_,P as yp,Pa as rl,Pb as Au,Pd as m_,Q as VP,Qa as ll,Qb as KI,Qc as Tv,Qd as f_,R as KP,Ra as ul,Rb as WI,Rc as Ev,S as WP,Sa as ml,Sb as YI,Sc as cm,Sd as __,T as YP,Ta as fl,Tb as XI,Tc as gm,Td as h_,U as XP,Ua as _l,Ub as JI,Uc as Cm,Ud as g_,V as Nt,Va as hl,Vb as xu,Vc as ym,Vd as C_,W as JP,Wa as gl,Wb as bu,Wc as Sm,Wd as y_,X as QP,Xa as Cl,Xb as wu,Xc as Tm,Xd as S_,Y as Lt,Ya as yl,Yb as Ou,Yd as T_,Z as ZP,Za as Sl,Zb as Ru,Zd as E_,_ as eM,_a as Tl,_b as Pu,_d as A_,a as cP,aa as rM,ab as Al,ac as Iu,ad as Em,ae as rh,b as Mt,ba as nM,bb as xl,bc as vu,be as nh,c as dP,ca as Ve,cb as bl,cc as ku,cd as Qm,ce as oh,d as id,da as oM,db as wl,dc as Nu,dd as Zm,de as ih,e as sd,ea as $t,eb as Ol,ec as Lu,ed as ef,ee as sh,f as ad,fa as iM,fb as Rl,fc as QI,fe as ah,g as cd,ga as sM,gb as Pl,gc as ZI,gd as tf,ge as ch,h as dd,ha as aM,hb as Ml,hc as ev,hd as rf,ia as cM,ib as Il,ic as tv,id as nf,j as pd,ja as dM,jb as vl,jc as rv,jd as of,k as ld,ka as pM,kb as nI,kc as nv,kd as sf,la as lM,lb as kl,lc as ov,ld as Uf,ma as uM,mb as Nl,mc as iv,md as jf,na as mM,nb as Ll,nc as $u,nd as Bf,o as ud,oa as fM,ob as $l,oc as hv,od as qf,p as md,pa as _M,pb as oI,pc as gv,pd as zf,qa as hM,qb as Dl,qc as Cv,qd as Hf,ra as gM,rb as Fl,rc as yv,rd as Vf,sa as CM,sb as Gl,sc as Sv,sd as Kf,ta as yM,tb as Ul,td as Wf,ua as SM,ub as jl,uc as Uu,ud as zk,va as TM,vb as iI,vc as ju,vd as Hk,wa as EM,wb as sI,wc as zu,wd as Vk,x as vt,xa as AM,xb as aI,xc as Hu,xd as Yf,ya as xM,yb as cI,yd as Xf,z as kt,za as bM,zb as dI,zc as Vu,zd as Jf}from"./chunks/chunk-OS5W4ZG2.js";import"./chunks/chunk-MGJMQSN4.js";import{x as ep}from"./chunks/chunk-L6VS7F3R.js";import{e as ZM,f as eI,g as ol,h as il,i as Bt}from"./chunks/chunk-ZLICQPRG.js";import{A as Np,Aa as qp,B as Lp,Ba as zp,C as Dt,Ca as Hp,Da as Vp,Fa as Kp,Ga as Wp,Ha as Yp,b as LR,c as $R,d as DR,e as FR,f as GR,g as UR,h as Nc,i as Lc,ia as Ft,j as $c,ja as Gt,k as Dc,ka as Ut,l as Fc,la as jt,ma as $p,n as IM,oa as Dp,pa as Fp,qa as Gp,s as UM,t as jM,v as BM,w as qM,wa as Up,x as zM,xa as jp,y as vp,z as kp,za as Bp}from"./chunks/chunk-VA4T37Q4.js";import{a as vM,b as kM,c as NM,d as LM,e as $M,f as DM,g as FM,h as xp,i as bp,j as wp,k as Op,l as Rp,m as GM,n as Pp,o as Mp,p as Ip}from"./chunks/chunk-CZEMEPPQ.js";import{a as Sp,b as Tp,e as Ep,f as Ap}from"./chunks/chunk-KHFUHGL3.js";import"./chunks/chunk-AA52P34H.js";import{A as bk,B as wk,C as Ok,D as Rk,E as Pk,F as Mk,G as Ik,H as vk,I as kk,J as Nk,K as Lk,L as Of,M as Rf,N as Pf,O as Mf,P as If,Q as vf,R as kf,S as Nf,T as Lf,U as $f,a as sv,b as av,c as cv,d as dv,e as pv,f as Du,g as lv,h as uv,i as mv,j as fv,k as _v,m as df,n as bf,o as fk,p as _k,q as hk,r as gk,s as Ck,t as yk,u as wf,v as Sk,w as Tk,x as Ek,y as Ak,z as xk}from"./chunks/chunk-LPW7S5KA.js";import{$a as OI,$b as Hv,A as FP,Aa as mu,Ab as Rm,Ac as jm,B as tp,Ba as fu,Bb as Pm,Bc as Bm,C as rp,Ca as _u,Cb as Mm,Cc as qm,D as np,Da as hu,Db as Im,Dc as zm,E as op,Ea as gu,Eb as bv,Ec as Hm,F as ip,Fa as Cu,Fb as wv,Fc as Vm,G as sp,Ga as yu,Gb as Ov,Gc as Km,H as ap,Ha as Su,Hb as Rv,Hc as Wm,I as cp,Ib as Pv,Ic as Ym,J as dp,Jb as Mv,Jc as zt,K as pp,Kb as Iv,Kc as Xm,L as lp,La as uI,Lc as pk,M as qe,Ma as mI,Mb as vm,Mc as lk,N as GP,Na as fI,Nb as km,Nc as uk,O as UP,Oa as gI,Ob as vv,Oc as Jm,P as jP,Pa as CI,Pb as kv,Pc as mk,Q as BP,Qa as yI,Qb as Nv,Qc as Gk,R as qP,Ra as SI,Rb as Lv,Rc as Uk,S as zP,Sa as TI,Sb as $v,Sc as jk,T as HP,Ta as EI,Tb as Dv,Tc as Bk,U as up,Ua as AI,Ub as Fv,Uc as qk,V as sl,Va as xI,Vb as Gv,W as al,Wa as bI,Wb as Uv,X as cl,Xa as wI,Xb as jv,Y as dl,Yb as Bv,Z as tI,Zb as qv,_ as rI,_b as zv,a as IR,aa as pl,ac as Vv,b as vR,ba as Bl,bb as RI,bc as Kv,c as kR,ca as ql,cb as PI,cc as Wv,d as NR,da as zl,dc as Yv,e as xP,ea as Hl,ec as Xv,f as bP,fa as Vl,fb as MI,fc as Jv,g as wP,ga as Kl,gb as II,gc as Qv,h as OP,ha as Wl,hb as vI,hc as Zv,i as RP,ia as Yl,ic as ek,j as PP,ja as Xl,jb as UI,jc as tk,k as MP,ka as Jl,kb as jI,kc as rk,la as Ql,lb as BI,lc as nk,ma as Zl,mb as qI,mc as ok,na as eu,nb as zI,nc as ik,oa as tu,ob as pm,oc as sk,pa as ru,pb as lm,pc as ak,qa as nu,qb as um,qc as ck,ra as ou,rb as mm,rc as dk,sa as iu,sb as fm,sc as qt,t as IP,ta as su,tb as _m,tc as Nm,u as vP,ua as au,ub as Am,uc as Lm,v as kP,va as cu,vb as xm,vc as $m,w as NP,wa as du,wb as bm,wc as Dm,x as LP,xa as pu,xb as wm,xc as Fm,y as $P,ya as lu,yb as Om,yc as Gm,z as DP,za as uu,zb as xv,zc as Um}from"./chunks/chunk-ZBOQEZ2H.js";import"./chunks/chunk-6H36ZHMI.js";import{a as bR,b as wR}from"./chunks/chunk-WQOEVGLQ.js";import{$ as Hd,A as $d,B as Dd,C as Fd,D as Gd,E as Ud,F as jd,G as Bd,H as pP,I as lP,J as uP,K as mP,L as fP,M as _P,Q as hP,R as gP,S as CP,T as yP,U as SP,V as TP,W as EP,X as AP,Z as qd,_ as zd,a as Xc,aa as Vd,b as Jc,ba as Kd,c as Qc,ca as Wd,d as Zc,da as Yd,e as ed,ea as Xd,f as td,fa as Jd,g as rd,ga as Qd,h as nd,ha as Zd,i as od,ia as It,j as yd,k as Sd,l as Td,m as Ed,n as Ad,o as xd,p as bd,q as wd,r as Od,s as Rd,t as Pd,u as Md,v as Id,w as vd,x as kd,y as Nd,z as Ld}from"./chunks/chunk-7EPYCU7U.js";import{a as pR,b as lR,c as uR,d as mR,e as fR,f as _R,g as hR,h as gR,i as CR,j as Us,k as js,l as Bs,m as qs,n as zs,o as Hs,q as Vs,s as Ks,y as Ws}from"./chunks/chunk-DF6A7C32.js";import{b as aR}from"./chunks/chunk-CONBVY2O.js";import"./chunks/chunk-PZA7QECY.js";import{$b as CO,$c as GO,A as yT,Aa as lw,Ab as eO,Ac as PO,Ad as oR,B as ST,Ba as uw,Bc as MO,Bd as iR,C as TT,Cc as IO,Cd as sR,Db as tO,Dc as vO,Dd as cR,Ec as kO,Ed as dR,Fb as rO,Fc as NO,Gc as LO,Hc as Ss,Ic as Ts,Jb as nO,Jc as Es,K as IT,Kb as oO,Kc as As,La as mw,Lb as iO,Lc as xs,M as UT,Ma as fw,Mb as ds,Mc as bs,N as jT,Na as _w,Nb as sO,Nc as ws,O as BT,Oa as hw,Oc as Os,P as qT,Pa as gw,Pb as aO,Pc as Rs,Q as YT,Qa as Cw,Qb as cO,Qc as Ps,R as XT,Ra as xw,Rb as dO,Rc as Ms,S as bt,Sa as bw,Sb as pO,Sc as Is,T as Ib,Ta as ww,Tb as lO,Tc as vs,U as vb,Ua as wt,Ub as uO,Uc as ks,V as kb,Vb as mO,Wa as Ow,Wb as fO,Wc as Ns,X as Nb,Xa as Rw,Xb as _O,Xc as $O,Ya as Pw,Yb as hO,Yc as DO,Z as Lb,Za as Mw,Zb as Ot,Zc as Ls,_ as $b,_a as Iw,_b as gO,_c as FO,a as sT,aa as Db,ad as $s,ba as Fb,bb as vw,bd as Ds,ca as Gb,cd as UO,da as Ub,dd as jO,ea as jb,ed as BO,fa as Bb,fb as rs,fc as ps,fd as qO,ga as qb,gc as ls,gd as zO,ha as Zb,hb as Bw,hc as us,hd as HO,i as io,ib as qw,ic as ms,id as VO,j as aT,ja as Qi,jb as zw,jd as Fs,k as cT,ka as Zi,kb as Hw,kc as fs,kd as Gs,l as dT,la as es,lc as _s,ld as KO,m as pT,mb as Vw,mc as hs,md as WO,na as ew,nb as Kw,nc as gs,nd as YO,o as lT,oa as tw,ob as Ww,oc as Cs,od as XO,p as uT,pa as rw,pb as Yw,pc as ys,pd as JO,qa as nw,qb as ss,qc as yO,qd as QO,r as mT,ra as ow,rb as as,rc as SO,rd as ZO,sa as iw,sc as TO,sd as eR,t as fT,ta as sw,tb as cs,tc as EO,td as tR,u as _T,ub as Xw,uc as AO,ud as rR,v as hT,va as aw,vc as xO,vd as nR,wb as Jw,wc as bO,x as gT,xa as cw,xb as Qw,xc as wO,y as CT,ya as dw,yb as Zw,yc as OO,za as pw,zc as RO,zd as Rt}from"./chunks/chunk-FVY7U3SU.js";import{A as $w,B as Dw,C as Fw,D as Gw,E as Uw,F as jw,G as ns,H as os,I as is,a as zb,b as Hb,c as Vb,d as Kb,e as Wb,f as Yb,g as Xb,h as Jb,i as Qb,n as yw,q as Sw,r as Tw,u as Ew,v as ts,w as Aw,x as kw,y as Nw,z as Lw}from"./chunks/chunk-C4KIZQHW.js";import{$ as Co,$a as aE,$b as ii,$c as $E,$d as ji,$e as ox,A as Qn,Ab as Yo,Ad as eA,Ae as IA,Af as wx,Ag as zi,Ah as fb,B as Zn,Bb as Xo,Bd as tA,Be as vA,Bg as Hi,Bh as _b,C as eo,Ca as NT,Cb as yE,Cc as OE,Cd as rA,Ce as kA,Ch as hb,D as to,Db as Jo,Dc as RE,Dd as nA,De as NA,Df as Ox,Dh as Yi,E as ro,Eb as Qo,Ec as PE,Ed as oA,Ee as LA,Ef as Rx,Eh as gb,F as no,Fa as LT,Fb as L,Fc as ME,Fd as iA,Fe as $A,Ff as Px,Fh as Cb,G as oo,Gb as Zo,Gd as sA,Ge as DA,Gf as Mx,Hc as IE,He as FA,Hf as Ix,Ia as $T,Ic as vE,Id as Ei,Ie as GA,If as vx,Ih as yb,Jd as Ai,Je as UA,Jf as kx,Jh as Sb,Kd as xi,Ke as jA,Kf as Nx,Kh as Tb,La as DT,Ld as bi,Le as BA,Lh as Eb,M as Ct,Ma as zT,Mb as Fe,Md as wi,Me as qA,Mf as Lx,Mg as Xx,Mh as Ab,N as yt,Na as HT,Nb as ei,Nd as Oi,Ne as zA,Nf as $x,Nh as xb,Oa as VT,Oc as kE,Od as Ri,Oe as HA,Of as Dx,Og as Jx,Oh as Xi,Pa as KT,Pd as Pi,Pe as VA,Pf as Fx,Pg as Qx,Q as ET,Qa as WT,Qc as gi,Qd as Mi,Qe as KA,Qf as Gx,Qg as Zx,R as AT,Ra as JT,Rc as Ci,Rd as Ii,Re as WA,Rg as eb,Rh as bb,S as xT,Sa as QT,Sc as yi,Sd as vi,Se as YA,Sf as Ux,Sg as tb,Sh as Ji,Ta as ZT,Tc as Si,Td as ki,Te as XA,Tf as Bi,Ua as eE,Ub as SE,Ud as Ni,Ue as JA,Uf as qi,V as go,Va as tE,Vb as TE,Vd as Li,Ve as QA,Vh as wb,W as bT,Wa as rE,Wb as EE,Wd as $i,We as ZA,Wg as rb,Wh as Ob,X as wT,Xa as nE,Xb as ti,Xd as Di,Xe as ex,Xh as Rb,Y as OT,Ya as oE,Yb as ri,Yd as Fi,Ye as tx,Yg as nb,Yh as Pb,Z as RT,Za as iE,Zb as ni,Zc as NE,Zd as Gi,Ze as rx,Zh as Mb,_a as sE,_b as oi,_c as LE,_d as Ui,_e as nx,a as YS,aa as yo,ab as cE,ac as si,ae as aA,af as ix,b as XS,ba as De,bb as dE,bc as ai,be as cA,bf as sx,c as JS,ca as PT,cb as Uo,cc as ci,ce as dA,cf as ax,d as QS,da as MT,db as jo,dc as di,dd as Ti,de as pA,df as cx,e as ZS,ea as So,ec as pi,ee as lA,ef as dx,f as eT,fa as To,fb as Bo,fc as li,fe as uA,ff as px,g as tT,gb as qo,gc as ui,ge as mA,gf as lx,h as rT,ha as Eo,hb as zo,hc as mi,hd as DE,he as fA,hf as ux,i as nT,ib as Ho,ic as fi,id as FE,ie as _A,if as mx,ih as ob,j as oT,jb as Vo,jc as _i,jd as GE,jf as fx,jh as ib,k as iT,kb as hE,kd as UE,kf as _x,kh as sb,l as Gn,lb as gE,ld as jE,le as hA,lf as hx,m as Un,mc as AE,md as BE,me as gA,mh as ab,n as jn,nc as xE,nd as qE,ne as CA,ng as jx,nh as cb,o as Bn,oc as hi,od as zE,oe as yA,of as gx,og as Ge,p as qn,pd as HE,pe as SA,pf as Cx,pg as xt,ph as db,q as zn,qd as VE,qe as TA,qf as yx,qg as Bx,qh as Vi,r as Hn,rd as KE,re as EA,rf as Sx,rg as qx,s as Ne,sc as bE,sd as WE,se as AA,sf as Tx,sg as zx,sh as Ki,t as Le,tc as wE,te as xA,tf as Ex,tg as Hx,th as Wi,u as Vn,ue as bA,uf as Ax,ug as q,v as Kn,va as No,vd as YE,ve as wA,vf as xx,vg as Vx,w as Wn,wd as XE,we as OA,wg as Kx,wh as pb,x as Yn,xa as vT,xb as Ko,xd as JE,xe as RA,xg as Wx,xh as lb,y as Xn,ya as kT,yb as Wo,yd as QE,ye as PA,yg as Yx,yh as ub,z as Jn,zb as CE,zd as ZE,ze as MA,zf as bx,zh as mb}from"./chunks/chunk-CNUFU454.js";import"./chunks/chunk-K34FR5CO.js";import{$ as Ta,$a as Tc,A as iP,Aa as Wa,B as Js,Ba as Ya,C as Qs,Ca as Xa,D as Zs,Da as Ja,Ea as Qa,F as ea,Fa as Za,G as ta,Ga as ec,H as ra,Ha as tc,I as na,Ia as rc,J as oa,Ja as nc,K as ia,Ka as oc,L as sa,La as ic,M as aa,Ma as sc,N as ca,Na as ac,O as da,Oa as cc,P as pa,Pa as dc,Q as la,Qa as pc,R as ua,Ra as lc,S as ma,Sa as uc,Ta as mc,U as fa,Ua as fc,V as _a,Va as _c,W as ha,Wa as hc,X as ga,Xa as gc,Y as Ca,Ya as Cc,Z as ya,Za as yc,_ as Sa,_a as Sc,aa as Ea,ab as Ec,b as jR,ba as Aa,bb as Ac,c as BR,ca as xa,cb as xc,d as qR,da as ba,db as bc,e as zR,ea as wa,eb as wc,f as HR,fa as Oa,fb as Oc,ga as Ra,gb as Rc,h as VR,ha as Pa,hb as Pc,i as KR,ia as Ma,ib as Mc,j as Xs,ja as Ia,jb as Ic,k as WR,ka as va,la as ka,lb as Be,ma as Na,mb as Z,n as YR,na as La,nb as vc,o as XR,oa as $a,p as Ue,pa as Da,q as JR,qa as Fa,r as QR,ra as Ga,s as ZR,sa as Ua,t as Pt,ta as ja,u as je,ua as Ba,v as eP,va as qa,w as tP,wa as za,x as rP,xa as Ha,y as nP,ya as Va,z as oP,za as Ka}from"./chunks/chunk-4FZH5BTV.js";import{I as ko,L as Tt,N as Et,P as Lo,Q as $o,R as At,T as FT,V as GT,X as Go,a as R,b as WS,c as gt,ca as mE,e as Mn,f as In,fa as fE,g as vn,ga as _E,h as kn,i as ve,j as Nn,k as N,l as ke,m as Ln,n as $n,o as Dn,p as Fn,q as Ao,r as xo,s as bo,t as wo,u as Oo,v as Ro,w as Po,x as Mo,y as Io,z as vo}from"./chunks/chunk-XHCIOLJP.js";import{L as pE,O as Do,P as lE,Q as Fo,S as uE,a as po,b as lo,c as uo,h as mo,j as fo,k as _o,l as ho}from"./chunks/chunk-SX76UGEY.js";import{A as ue,B as KS,C as S,E as so,F as St,G as me,H as ao,K as $e,M as co,b as US,c as jS,d as BS,m as qS,r as zS,u as HS,y as VS}from"./chunks/chunk-6OIHST4I.js";import"./chunks/chunk-XAWE4EAK.js";var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function qg(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=Bg(t[x.clientInfo]),i=qg(t[x.logLevel]);return{protocolVersion:z,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function $0(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function D0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function F0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function zg(e,t){return Xe({...e,resultType:"complete"},t)}function G0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return zg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function U0(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}var Hg=new Set(["--help","-h","--version","-V"]);function Vg(e,t){let n=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&n.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),n.join(`
2
+ `)}function q0(e,t,r){if(e.length===0)return{kind:"serve"};let n=e.find(i=>!Hg.has(i));if(n!==void 0){let i=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(n)}. Run ${i} --help.
3
+ `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Vg(t,r):`${r}
4
+ `,stderr:""}}import{createHash as ar,createHmac as cr,timingSafeEqual as Kg}from"node:crypto";var Wg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},dr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Yg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Ce(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let n={};for(let[o,i]of r){if(!dr.test(o)||!h(i))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!Wg.includes(s))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Yg(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(i.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Ce(n,Qe,"inputRequests"),n}function pr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[n,o]of t){if(!dr.test(n)||!h(o))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Ce(r,Qe,"inputResponses"),r}function K0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[x.serverInfo]:{...e.serverInfo}}}}function lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function W0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let n=r.toString("base64url"),o=cr("sha256",lr(t)).update(n).digest("base64url");return`${n}.${o}`}function Xg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function Y0(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=cr("sha256",lr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Kg(s,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=Xg(c),{expiresAt:p,method:l,parameterDigest:f,principal:g}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:p});if(l!==r.method||f!==r.parameterDigest||g!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function X0(e){return Ce(e,Qe,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ar("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Jg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function J0(e,t){return{...e,...Jg(t)}}function Qg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Zg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Qg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function eC(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,n=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function tC(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function rC(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Zg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function Q0(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=eC(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Ce(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:n,maximumNodes:o});rC(e,a.value),tC(a,i)}return structuredClone(e)}import{randomUUID as nC}from"node:crypto";import{readFile as oC}from"node:fs/promises";import ur from"node:path";var sL="io.modelcontextprotocol/tasks",iC=["working","input_required","completed","failed","cancelled"],sC=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,aC=3600*1e3,cC=1e3,Se=1024,dC=30,pC=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!sC.test(t))throw et("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function fr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function lC(e){if(!iC.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function uC(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function mC(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function fC(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function _C(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function hC(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function gC(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=lC(e.status),n=uC(e.principal),o=mC(e.workerPid),i=fC(e.ttlMs),s=_C(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:hC(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=fr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function re(e){return e==="completed"||e==="failed"||e==="cancelled"}function CC(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${nC()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return gC(JSON.parse(await oC(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
+ `)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,dC,this.#t,!1,!1,pC);try{let s=await this.#c(o);if(s.principal!==r)throw et("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ye(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?aC:t.ttlMs,i=t.pollIntervalMs??cC;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new u("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Se)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#o(t,r,n=>{if(re(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!CC(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#o(t.taskId,t.principal,n=>{if(re(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=pr(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[p,l]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,p)&&(d[p]=l,delete c[p],i.push(p));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return H(await this.#o(t,r,o=>re(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=fr(n);return H(await this.#o(t,r,i=>re(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#o(t,r,n=>re(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function aL(e){return new tt(e)}var Te="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,yC=5e3;function SC(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),yC);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function rt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function TC(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),n=rt(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function EC(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var gr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=EC(TC(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Te]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[Te]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Te]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await SC(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Te]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}return t}};var Cr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,AC=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,Sr=new Set(["prompts/get","resources/read","tools/call"]);function xC(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function b(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!Cr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=Cr.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?b("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?b("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function bC(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!AC.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Ar(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!h(s))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!h(c))continue;let d=[...i,a],p=bC(c,d,r);p&&t.push(p);for(let[l,f]of Object.entries(c))if(l!=="properties"&&l!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:l});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Ee(i))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function xr(e,t){let r=e;for(let n of t){if(!h(r))return;r=r[n]}return r}function br(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function wC(e,t){let r=h(e.arguments)?e.arguments:{},n={};for(let o of Ar(t)){let i=xr(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=Tr(i)}return n}function uL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),n=e.request.method;if(typeof n!="string"||n.length===0)return b("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=br(n,t);if(Sr.has(n)){if(i===void 0)return b("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=Tr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,wC(t,e.toolSchema)),o}function OC(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&b("Missing MCP request method","Mcp-Method");let n=h(t.params)?t.params:void 0,o=Ye(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&b("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&b("MCP method header does not match request body","Mcp-Method"),Sr.has(r)){let i=e.get("mcp-name"),s=br(r,n);(i===void 0||s===void 0||Er(i,"Mcp-Name")!==s)&&b("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&b("MCP SSE resumability is not supported","Last-Event-ID")}function RC(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function PC(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Ar(e.toolSchema)){let n=xr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&b("Unexpected MCP parameter header",o);continue}i===void 0&&b("Missing MCP parameter header",o),RC(r,n,Er(i,o))||b("MCP parameter header does not match request body",o)}}function mL(e){let t=xC(e.headers),r=typeof e.request.method=="string"?e.request.method:"";OC(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&PC({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var fL=z;import{AsyncLocalStorage as MC}from"node:async_hooks";import{createHash as wr,timingSafeEqual as IC}from"node:crypto";var C=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},vC=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,kC=/^[a-z][a-z0-9_*/-]{0,255}$/u,NC=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,LC=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Pr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,$C=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,DC=/%(?![0-9A-Fa-f]{2})/u,FC=512,GC=32,UC=180,jC=8192,BC=8192,Mr=new MC;function A(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new C(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new C(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new C(`Invalid ${t}`,401);return n}function qC(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function yL(e){let t=A(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new C("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>A(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Rr.test(o)))throw new C("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function SL(e){let t=A(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function TL(e,t){if(!h(e)||typeof e.issuer!="string")throw new C("Invalid authorization server metadata",401);let r=A(t,"expected issuer").href.replace(/\/$/u,"");if(A(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new C("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new C("Authorization server does not support required S256 PKCE",401);let o=d=>{let p=e[d];if(typeof p!="string")throw new C(`Authorization server metadata requires ${d}`,401);return A(p,d).href},i=d=>{let p=e[d];return typeof p=="string"?A(p,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...c?{registration_endpoint:c}:{}}}function EL(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function AL(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new C("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new C("Authorization response issuer mismatch",401)}function xL(e,t){let r=A(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new C("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new C("Invalid client redirect URI",401);A(n,"client redirect URI",!0)}return structuredClone(e)}function bL(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new C("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>A(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let n=A(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=A(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=A(t,"credential issuer").href;return this.#e.delete(r)}};function zC(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?vC.exec(t):null;if(!n)throw new C("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new C("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!VC(r)))throw new C("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function HC(e){return kC.test(e)||NC.test(e)}function VC(e){if(Buffer.byteLength(e,"utf8")>FC)return!1;let t=e.split(",");if(t.length>GC)return!1;let r=new Set;for(let n of t){let o=$(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!HC(s)||!LC.test(a)||r.has(s))return!1;r.add(s)}return!0}function Ir(e){return $C.test(e)&&!DC.test(e)}function KC(e){let t=$(e),r=t.indexOf("="),n=$(r>=0?t.slice(0,r):t),o=r>=0?$(t.slice(r+1)):void 0;return Pr.test(n)&&(o===void 0||Ir(o))}function WC(e){let t=$(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=$(i>0?n.slice(0,i):""),a=i>0?$(n.slice(i+1)):"";if(!(!Pr.test(s)||!Ir(a)||!o.every(KC)))return{key:s,serialized:t}}function YC(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>jC)throw new C("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>UC)throw new C("Invalid MCP baggage",403);let o=[];for(let i of n){let s=WC(i);if(!s)throw new C("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function wL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},n=YC(r.baggage,t.baggageAllowlist??[]);return{...zC(r),...n?{baggage:n}:{}}}function OL(e,t){return Mr.run(structuredClone(e),t)}function RL(){let e=Mr.getStore();return e?{...e}:void 0}async function PL(e){let t=A(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(l=>!Rr.test(l)))throw new C("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new C("Access tokens must not appear in URI query parameters",401,n);let s=qC(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new C("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>BC)throw new C("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new C("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new C("Bearer token issuer or audience mismatch",401,n);let p=r.filter(l=>!c.scopes.includes(l));if(p.length>0)throw new C("Bearer token has insufficient scope",403,`${n}, scope="${p.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function ML(e){let t=wr("sha256").update(e.token).digest();return r=>{let n=wr("sha256").update(r).digest();if(!IC(t,n))throw new C("Invalid bearer token",401);return structuredClone(e.claims)}}var nt="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",vr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function kL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[nt];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Nr)||o!==void 0&&o!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});return!0}var XC={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Lr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:XC})));function NL(e){return Lr.find(t=>t.uri===e)}function LL(e){let t=new Map(Lr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function kr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function $L(e){let t=kr(e.name),r=kr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),o=JSON.stringify(Ae);return`<!doctype html>
6
6
  <html lang="en">
7
7
  <head>
8
8
  <meta charset="utf-8">
@@ -25,11 +25,11 @@ import{a as Ng}from"./chunks/chunk-J2PDAVBC.js";import{a as EN,b as AN,c as xN,d
25
25
  (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${n},appCapabilities:{},protocolVersion:${o}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
26
26
  </script>
27
27
  </body>
28
- </html>`}import{createHash as ot}from"node:crypto";import{lstat as qC,readdir as zr,readFile as HC}from"node:fs/promises";import M from"node:path";import{parseDocument as VC}from"yaml";var $r="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",KC=Object.freeze({revision:it,status:"draft",directoryRead:!0});function LL(e,t=!1){let r=e.clientCapabilities.extensions,n=h(r)?r[$r]:void 0;if(!h(n)||n.revision!==it||t&&n.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:KC}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,WC=32*1024*1024,YC=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new u(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function XC(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let n=VC(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&T(`Skill ${t} frontmatter must be an object.`),o}async function JC(e,t,r,n){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>WC&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),HC(e)}async function qr(e,t,r){let n=M.join(e,t),o=await zr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await qC(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await qr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await JC(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Ur(e,t,r){let n=new Map,o;try{o=await zr(e,{withFileTypes:!0})}catch(a){if(St(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&YC.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Dr&&T(`Skill origin exceeds ${Dr} directories.`);let s={value:0};for(let a of i){let c=await qr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((_,y)=>_+y.bytes.byteLength,0),p=c.find(_=>_.relative==="SKILL.md");if(!p)continue;let l=XC(p.bytes.toString("utf8"),a.name);l.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:l.name??null,expected:a.name}),(typeof l.description!="string"||l.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(_=>({uri:`skill://${a.name}/${_.relative}`,digest:`sha256:${ot("sha256").update(_.bytes).digest("hex")}`,size:_.bytes.byteLength})),g=ot("sha256").update(f.map(_=>`${_.uri}:${_.digest}`).join(`
29
- `)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:l,resources:f,_meta:{contractVersion:1,extensionRevision:it,origin:t,packageVersion:r,protocolVersion:q,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(_=>[_.relative,_.bytes])),fingerprint:g})}return n}function jr(e){let{files:t,fingerprint:r,...n}=e;return n}var Br=class e{#e;#t;constructor(t){this.#e=t,this.#t=ot("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
30
- `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&T("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof u)throw n;return T("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=M.resolve(t.packageRoot,".agents","skills"),o=M.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await Ur(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Fr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(jr),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),jr(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Gr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let y of o.resources){let E=y.uri.slice(`${a}/`.length);if(!E.startsWith(s))continue;let B=E.slice(s.length),[O,...ht]=B.split("/"),Rn=`${a}/${s}${O}`,Pn=o.files.get(`${s}${O}`);c.set(O,{uri:Rn,name:O,mimeType:ht.length>0?"inode/directory":Gr(O,Pn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Fr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let p=this.#r(r.cursor,t),l=[...c.values()].sort((y,E)=>y.uri.localeCompare(E.uri)),f=l.slice(p,p+d),g=p+f.length,_=g<l.length;return{resources:f,hasMore:_,..._?{nextCursor:this.#n(g,t)}:{}}}};var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>st(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,st(n,`${t}.${r}`)])))}function xe(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:st(r.input,`operations[${n}].input`)})))})}async function Vr(e,t){let r=xe(e);return Et(r,t)}async function QC(e,t){return Vr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function w(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function I(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function ZC(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(I(r.command,"observation.reads.command"),w(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function ey(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(w(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,n)=>r+n,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function ty(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let n of e){if(I(n.id,"observation.tiers.id"),w(n.max_tokens,"observation.tiers.max_tokens"),t.has(n.id))throw new Error(`Duplicate observation tier: ${n.id}.`);if(t.add(n.id),n.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=n.max_tokens;let o=new Set;for(let i of n.fields){if(D(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function ry(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return I(e.id,"observation.id"),w(e.version,"observation.version"),ZC(e.reads),ey(e.calibration),e.corpus_dependence.kind==="bounded"&&(I(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),w(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),ty(e.tiers),ne(structuredClone(e))}function qL(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function ny(e,t,r){w(r.budget_tokens,"observation request budget_tokens");let n=[];for(let[o,i]of e.tiers.entries()){n.push(i.id);let s=await t(i),a=Buffer.byteLength(R(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:o>0,attempted_tiers:n,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:n,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function D(e,t){let r=e.split(".");if(r.some(n=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Xr(e,t){let r=e;for(let n of D(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function oy(e){return`/${D(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function iy(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function sy(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);I(e.id,"verdict.id"),w(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){I(n.id,"verdict.predicates.id"),D(n.path,"verdict.predicates.path");let o=n.kind;if(o!=="field_equals"&&o!=="field_present"&&o!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${n.id}.`);if(t.has(n.id))throw new Error(`Duplicate verdict predicate: ${n.id}.`);iy(n),t.add(n.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(n=>!t.has(n)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function ay(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),n=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Xr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${oy(a.path)}`,evidence_digest:gt(R(c))}}),o=n.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?o===n.length:o>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:o/n.length,policy:"verdict_only_no_reward",predicates:n}}function HL(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(I(e.id,"episode.id"),w(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)I(t,"episode.task_item_ids");w(e.limits.max_actions,"episode.limits.max_actions"),w(e.limits.max_observations,"episode.limits.max_observations"),w(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)D(t,"episode.observable_fields");for(let t of e.withheld_fields)D(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(n=>t===n||t.startsWith(`${n}.`)||n.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return ry(e.observation),sy(e.verdict),xe(e.recipe),ne(structuredClone(e))}function cy(e,t,r){let n=D(t,"observation projection field"),o=e;for(let[i,s]of n.entries()){if(i===n.length-1){r!==void 0&&(o[s]=structuredClone(r));return}let a=o[s];(a===null||typeof a!="object"||Array.isArray(a))&&(o[s]={}),o=o[s]}}function dy(e,t){let r={};for(let n of t)cy(r,n,Xr(e,n));return r}async function VL(e,t){let r=[],n=0,o=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let l=await t.readRecordedState(),f=await ny(e.observation,async g=>dy(l.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??l.snapshot_id}),f},p=async(l=!1)=>{if(i&&!l)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let f=await t.readRecordedState(),g=ay(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async l=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");n+=1;let f=await L(a,()=>t.execute(l));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,p),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>p(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Qr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Qr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Qr(t),t}var be=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:be,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:be,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:be,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:be,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function py(){return Object.keys(W).sort().map(e=>W[e])}function ly(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Jr=new WeakMap;function Zr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Jr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function uy(e,t,r,n=42){if(oe(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,p=s-d,l=d===0?void 0:i+(p+Math.floor((d-1)/e.hierarchy_fanout))*o,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,_=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),y=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...l===void 0?{}:{parent:`pm-s${l.toString(36).padStart(7,"0")}`},component:i,timestamp:_,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Zr(t,e),has_comment:y<e.comments_per_100_items,has_note:y<e.notes_per_100_items,has_learning:y<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var at=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Zr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,p=c*a+Math.max(0,a+d-100),l=c*a+Math.min(a,d),f=this.annotations[s];(f<p||f>l)&&n.push(`${s}:${f}!in[${p},${l}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function en(e){return new at(e)}function my(e,t){let r=en(e);for(let n of t)r.add(n);return r.finish()}async function fy(){let e=De(process.cwd(),process.env.PM_PATH);await wt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}async function _y(){await Rt()}var tn=["lines","branches","functions","statements"];function hy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function gy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function Cy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){hy(r,n);for(let o of tn){let i=gy(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}import Y from"node:fs";import ct from"node:path";var rn=300*1e3,yy=3;function l$(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function u$(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");Y.mkdirSync(e,{recursive:!0});let n=ct.join(e,r);Y.mkdirSync(n,{recursive:!0});let o=new Date;Y.utimesSync(n,o,o);let i=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(p){if(p instanceof Error&&"code"in p&&me(p))return[];throw p}}).sort((d,p)=>p.mtimeMs-d.mtimeMs||d.name.localeCompare(p.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<rn),a=Math.max(0,yy-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=rn).slice(a).map(d=>d.name).sort((d,p)=>d.localeCompare(p));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Sy}from"node:crypto";var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:dt,fingerprint:Sy("sha256").update(R({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Ty(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Ty(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ge([]);for(let o of e.kinds)t.register(o);let r=new z(e.nodes,e.edges,t),n=J(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function v(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let n=await e.read({...t,workspace:r});return X(t.signal),n===null?null:se(n)}async function we(e,t){let r=G(t.workspace,"workspace"),n=se(t.snapshot).snapshot,o=await v(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await v(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ey(e,t={}){let r=e.map(se),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Ge([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new z(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return J(i,o,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};function nn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ay(e){let t=nn(e.nodeCount,"nodeCount"),r=nn(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function on(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=xt(),o=J(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new z(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];U(await v(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:o});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await v(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),U((await v(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return U(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),U(await v(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xy(e){return on(new ie,e?{workspace:e}:{})}var pt=2,by=["self_reported","independent_transport"];function Oe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function sn(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,o)=>{let i=ae(n,`${t}[${String(o)}]`);return r?n:i})}function lt(e,t){return e===void 0?void 0:ae(e,t)}function wy(e,t){if(e===void 0)return;if(!Oe(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function Oy(e,t,r,n,o,i){if(n==="refusal"){if(Ve(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=Ct(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let p=yt(t.slice(s+1));p!==void 0&&(a=ke(`history ${p}`))}let c=$t(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(p=>p===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Lt(a).kind;if(n!==d)throw new TypeError(`${e} expected ${n}, but ${a} declares ${d}`)}function Ry(e,t,r){if(!Oe(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=ae(e.id,`${n}.id`),i=sn(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Nt.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!by.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let p=d;if(p==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let l=sn(e.required_fields,`${n}.required_fields`);if(l.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let f=wy(e.expected_field_values,`${n}.expected_field_values`),g=lt(e.expected_error_code,`${n}.expected_error_code`),_=lt(e.expected_refusal_surface,`${n}.expected_refusal_surface`),y=lt(e.recovery_for,`${n}.recovery_for`);return Oy(n,i,s,c,g,_),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:p,required_fields:l,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},..._?{expected_refusal_surface:_}:{},...y?{recovery_for:y}:{}}}function Py(e,t){if(!Oe(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),n=ae(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let o=e.steps.map((s,a)=>Ry(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function z$(e){if(!Oe(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==pt)throw new TypeError(`agent-task transcript corpus version must be ${String(pt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,o)=>Py(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:pt,tasks:t}}import{createHash as an}from"node:crypto";function cn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function K$(e,t){let r=cn(t.migrationId,"migrationId"),n=cn(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=ze(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=an("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=an("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),p=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),l=c.filter(f=>!p.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(l),edge_count:c.length,skipped_existing_count:c.length-l.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as dn from"node:module";var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},Y$=Object.freeze(Object.keys(ut));function pn(e){if(Object.hasOwn(ut,e))return ut[e]}var My=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Iy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function vy(e){return e===void 0||e.kind==="punctuator"&&My.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function ky(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Ny(e,t,r){if(e[t]!=="/"||!vy(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function Ly(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Iy(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function $y(e){let t=[],r=0;for(;r<e.length;){let n=ky(e,r);if(n!==void 0){r=n;continue}let o=Ny(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=Ly(e,r);i.token&&t.push(i.token),r=i.next}return t}var Dy=new Set(["object","block","pattern"]),Fy=new Set(["const","let","var"]),Gy=new Set(["}",")","]"]),Uy=new Set(["=","(","[",",",":","?","return"]);function jy(e,t,r){if([...r].reverse().find(i=>Dy.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Fy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Uy.has(o.value)?"object":"block"}function By(e,t,r){let n=e[t];if(n.value==="{"){let a=jy(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function zy(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function qy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Hy(e){let t=$y(dn.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=zy(s,i,t[o+1]);a&&s.candidates.push(a);let c=By(t,o,n);if(c)n.push(c);else if(Gy.has(i.value)){let d=n.pop();d?.kind==="object"&&!qy(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function Vy(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
- `&&t.push(r+1);return t}function Ky(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function X$(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>Q(i.path,s.path))){let i=Vy(o.content),s;try{s=Hy(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=Ky(i,a.offset),p=pn(c);p?t.push({path:o.path,line:d,field:c,kind:p.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(ce.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of ce)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?Q(o.path,i.path):o.line!==i.line?o.line-i.line:Q(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?Q(o.subject,i.subject):Q(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function J$(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>Q(c,d))){let c=pn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,p=[a].flat();d!==void 0&&p.forEach((l,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,_=g&&typeof l=="object"&&l!==null&&!Array.isArray(l)?l[g]:l;if(typeof _!="string"||_.trim().length===0)return;let y=[...i,s,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${y}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:_})}),n(a,[...i,s])}};return n(t,[]),r}function Q$(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function Z$(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=ce.map(c=>{let d=e.filter(l=>l.kind===c),p=d.filter(l=>!o.has(l.id)).map(l=>i.get(l.id)).filter(l=>l!==void 0);return{kind:c,declared:d.length,observed:p.length,passed:d.filter(l=>{let f=i.get(l.id);return!o.has(l.id)&&f?.reachable===!0&&f.semantics===l.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function Wy(e,t){let r=new Map(ce.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=ce.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var eD=Wy;var rD=16,Yy=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),ln=18,un=Object.freeze([...Yy,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function nD(e,t=ln){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function oD(e,t=un){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function mt(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function iD(e,t,r){let n=new Map(e.map(p=>[p.code,p.canonical_code??p.code])),o=new Map,i=0,s=0;for(let p of e){let l=mt(o,p.canonical_code??p.code);for(let f of p.owned_states??[])l.kinds.add("owned_state"),l.probeIds.add(f.probe_id)}for(let p of t){let l=n.get(p.error_code);if(l===void 0)continue;i+=1;let f=mt(o,l);f.kinds.add("closed_domain"),f.probeIds.add(p.probe_id)}for(let p of r){let l=n.get(p.error_code);if(l===void 0)continue;s+=1;let f=mt(o,l);f.kinds.add("grammar"),f.probeIds.add(p.probe_id)}let a=e.map(p=>{let l=p.canonical_code??p.code,f=o.get(l),g=[...f.probeIds].sort();return{code:p.code,canonical_code:l,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((p,l)=>p.code<l.code?-1:1),c=a.filter(({disposition:p})=>p==="uncovered").map(({code:p})=>p),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function sD(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${ln}`,`- Required executable canonical codes: ${un.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
- `)}function Xy(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function Jy(e){return[e.exit_code!==ue.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${ue.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...Xy(e)]}function dD(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of Jy(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}var mn="not-a-declared-action";function Qy(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function CD(e=je.filter(t=>Pt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((n,o)=>{if(!n.required)return[];let i=r.command.split(" "),s=de(r.command),a=i.length>1&&t.has(s)?i.map(de).join("--"):s,c=Z(r.command).flatMap(p=>p.required?[p.flag,...p.value_name?["example"]:[]]:[]),d=Ue.some(p=>p.command===r.command);return[{probe_id:`required-argument-${a}-${de(n.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,o).map(p=>Qy(r.command,p)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:n.name,missing_argument_index:o}]})).sort((r,n)=>r.probe_id.localeCompare(n.probe_id))}function Zy(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function yD(e=je){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${de(t)}`,command:t,refusal_args:[...r,mn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mn,allowed_values:[...Zy(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function eS(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function tS(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!eS(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function SD(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>tS(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}var ft=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function ED(){return ft.map(e=>({...e}))}function rS(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function AD(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of ft){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=rS(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:ft.length,closed_probe_count:n,findings:r}}var Re,nS=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function oS(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=nS[N(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Pe(){if(Re!==void 0)return Re;let t=ee.filter(({command:i})=>Be(i)).flatMap(({command:i,family:s})=>Mt(i,Z(i)).map(a=>({command:i,family:s,concept:oS(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Re=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Re}function PD(){return Object.freeze(Pe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fn=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":28,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),iS=1,_n=Object.freeze(Object.fromEntries(Object.entries({...fn,...Object.fromEntries(ve.flatMap(({alias:e,canonical:t})=>{let r=fn[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+iS])));function hn(){let e=new Map(Object.keys(_n).map(t=>[t,0]));for(let{command:t}of Pe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_n).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function sS(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function aS(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function cS(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function MD(e=Pe(),t=hn(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let p=i.get(c.concept);p!==void 0&&p!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${p} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let l=s.get(c.concept);l!==void 0&&l!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${l} and ${c.flag}.`}):s.set(c.concept,c.flag)}return sS(e,o,n),aS(a,t,n),cS(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function ID(){let e=Pe(),t=hn(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
34
- `)}function kD(e){return e}function ND(e){return e}function LD(e){return e}function $D(e){return e}function DD(e){return e}function FD(e){return e}function GD(e){return e}function UD(e){return e}function jD(e){return e}function BD(e){return e}function zD(e){return e}function qD(e){return e}function HD(e){return e}function VD(e){return{handled:!0,result:e}}function KD(){return{handled:!1}}function WD(e){return e}function YD(e){return e}function XD(e){return e}function JD(e){return e}function QD(e){return e}function ZD(e){return e}function eF(e){return e}function tF(e){return e}function rF(e){return e}function dS(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function pS(e={},t={}){return new _e(t).packageMigrate(e)}function k(e){if(typeof e!="string"||!At(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function lS(e){let t=k(e.window_start),r=k(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(n=>typeof n!="string"||n.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function uS(e,t,r,n){let o=new Map(t.map(s=>[s,[]])),i=new Set;for(let s of e){if(typeof s.id!="string"||s.id.trim().length===0||i.has(s.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");i.add(s.id);let a=o.get(s.family);if(!a||!["success","failure","pending"].includes(s.outcome)||s.cause!==void 0&&(!["product","infrastructure","unknown"].includes(s.cause)||s.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=k(s.started_at);if(s.repaired_at!==void 0&&(k(s.repaired_at)<c||s.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<n&&a.push(s)}return o}function TF(e,t){let{start:r,end:n}=lS(t),i=[...uS(e,t.families,r,n)].map(([s,a])=>{let c=a.filter(_=>_.outcome==="failure"),d=a.filter(_=>_.outcome!=="pending").length,p=d===0?null:c.length/d,l=c.filter(_=>_.repaired_at!==void 0&&k(_.repaired_at)<n),f={product:0,infrastructure:0,unknown:0};for(let _ of c)f[_.cause??"unknown"]+=1;let g=[];return d<t.min_completed_attempts&&g.push("insufficient_completed_attempts"),p!==null&&p>t.max_failure_rate&&g.push("failure_rate"),{family:s,attempts:a.length,completed:d,failed:c.length,pending:a.length-d,failure_rate:p,affected_days:[...new Set(c.map(_=>new Date(k(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(k(_.repaired_at)-k(_.started_at))/6e4).sort((_,y)=>_-y),unresolved:c.length-l.length,causes:f,violations:g,ok:g.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(n).toISOString(),ok:i.every(s=>s.ok),families:i}}function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function mS(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let n=new Set(r.identities);if(n.size!==r.identities.length||[...n].some(o=>!pe(o)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,n)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function fS(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let n of e){if(n===null||typeof n!="object"||!pe(n.identity)||r.has(n.identity)||!pe(n.reason)||!pe(n.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let o=n.missing_from;if(!Array.isArray(o)||o.length===0||o.length>=t.length||new Set(o).size!==o.length||[...o].some(i=>!t.includes(i)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(n.identity,n)}return r}function AF(e,t=[]){let r=mS(e),n=[...r.keys()].sort(),o=fS(t,n),i=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),s=[],a=new Set;for(let d of i){let p=n.filter(g=>!r.get(g).has(d));if(p.length===0)continue;let l=o.get(d),f=l!==void 0&&JSON.stringify([...l.missing_from].sort())===JSON.stringify(p);f&&a.add(d),s.push({identity:d,present_in:n.filter(g=>r.get(g).has(d)),missing_from:p,disposition:f?{reason:l.reason,evidence:l.evidence}:null})}let c=[...o.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:s.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(n.map(d=>[d,r.get(d).size])),findings:s,stale_exceptions:c}}import{createHash as Cn,createHmac as _S,randomBytes as hS,timingSafeEqual as gS}from"node:crypto";var a1="dev.unbrained.pm/progressive-tool-discovery",c1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),CS=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),yS=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),SS=new Set(["core","standard","full","custom"]),Tn=new Set(ee.map(({family:e})=>e)),TS=hS(32);function Ie(e,t){if(typeof e!="string")throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function En(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new S("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function An(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new S("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function xn(e){if(e!==void 0&&typeof e!="boolean")throw new S("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function bn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new S("pm tool discovery options must be an object.",64)}function ES(e){if(!Array.isArray(e))throw new S("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new S(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new S(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new S(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new S(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new S(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function d1(e){if(bn(e),e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:En(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xn(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:An(e.outputBudget)}:{}}}function AS(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function le(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function xS(e,t){let r=le(e);if(r.length===0)return 0;let n=new Set(le(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function bS(e,t){let r=le(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=le(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function gn(e){return Cn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function wn(e,t,r){return _S("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function wS(e,t,r){let n={version:1,offset:t,signature:wn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function OS(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),i=o.offset;if(o.version!==1||typeof i!="number"||!Number.isInteger(i)||i<0||i>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(wn(t,i,n),"base64url"),a=Buffer.from(o.signature,"base64url");if(a.length!==s.length||!gS(a,s))throw new Error("cursor signature does not match the request");return i}catch(o){throw new S("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function _t(e,t,r){return{value:AS(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function RS(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=qe(n),i=`${e.name} ${e.description} ${n} ${o}`,s=xS(t,i),a=new Set(le(t)),c={lexical:_t(s,j.lexical,"computed"),semantic:Me(e.signals?.semantic,bS(t,i),j.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Me(e.signals?.freshness,1,j.freshness),usage:Me(e.signals?.usage,CS.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((p,l)=>p+l.value*l.weight,0);return{name:e.name,description:e.description,command:n,tier:He(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function PS(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new S("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!SS.has(e.profile)))throw new S("pm tool discovery profile must be core, standard, full, or custom.",64)}function MS(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let n=En(e.limit===void 0?10:e.limit),o=An(e.outputBudget===void 0?1200:e.outputBudget);return PS(e),{query:r,includeSchema:xn(e.includeSchema),limit:n,budget:o,maximumTier:yn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function On(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function IS(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>RS(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&yn[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function vS(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(On(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function p1(e,t={}){ES(e),bn(t);let r=MS(t),n=t.cursorIntegrityKey??TS,o=IS(e,t,r),i=gn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=OS(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:gn({fingerprint:i,cursorIntegrityKey:Cn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:yS}},p=(_,y=_.length)=>{let E=s+y,B=E<o.length,O=[...c];return y<a.length&&O.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[..._],returned:y,has_more:B,...B?{next_cursor:wS(i,E,n)}:{},omission_receipt:{has_omissions:O.length>0,omitted:O}}},l=_=>{let y=p(_),E=On(y,r.budget);return{...y,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=vS(a,r.budget,_=>p([],_)),g=l(f);if(a.length>0&&f.length===0){let _=l([a[0]]).token_cost.estimated_tokens;throw new S(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${_}.`,64,{required:String(_)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new S(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}export{rR as ACTIONABILITY_ORDERING_KINDS,Yc as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Cc as ACTIVITY_FLAG_CONTRACTS,Yo as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,VI as ASSURANCE_ACTIONS,KI as ASSURANCE_DECLARATION_KINDS,nM as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,oM as ASSURANCE_GATE_TRIGGERS,iM as ASSURANCE_MEASUREMENT_SOURCE_KINDS,XM as ASSURANCE_PRESET_IDS,ZP as AssuranceEvaluationRefusalError,QP as AssuranceMutationRefusalError,eM as AssuranceSourceResolutionError,No as BASELINE_ITEM_FORMAT_VERSION,tP as BOUNDARY_FIXTURE_CAPTURE_SOURCES,NR as BRIEF_LIST_FIELDS,Jo as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,Xo as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,po as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,vx as BUILTIN_RELATIONSHIP_KINDS,Vc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,za as CLAIM_FLAG_CONTRACTS,Fd as CLOSE_ACTION_OPTION_KEYS,Ua as CLOSE_FLAG_CONTRACTS,ja as CLOSE_MANY_FLAG_CONTRACTS,Ya as CLOSE_TASK_FLAG_CONTRACTS,na as COMMENTS_FLAG_CONTRACTS,_T as COMMON_MUTATION_COMMAND_OPTION_KEYS,Mc as COMPLETION_FLAG_CONTRACTS,ho as CONFIDENCE_TEXT_VALUES,Ca as CONFIG_FLAG_CONTRACTS,Kc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,Iv as CONTEXT_EVALUATION_METRIC_NAMES,Sc as CONTEXT_FLAG_CONTRACTS,XA as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,zt as CONTEXT_OUTPUT_VALUES,$v as CONTEXT_PACKING_PROFILES,Av as CONTEXT_RECENCY_EPOCH,Ov as CONTEXT_RELEVANCE_SERVICE,bv as CONTEXT_RELEVANCE_SIGNAL_NAMES,Gv as CONTEXT_SIGNAL_SET_VERSION,Fv as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,Uv as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,GA as CONTEXT_USAGE_LIMITS,Pc as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,ld as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,md as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,ud as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,DS as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,eE as CURRENT_HISTORY_HASH_ALGORITHM,Cx as CURRENT_HISTORY_ITEM_HASH_VERSION,Sx as CURRENT_HISTORY_RECORD_HASH_VERSION,Lo as CURRENT_ITEM_FORMAT_VERSION,qv as ContextSignalStore,UA as ContextUsageValidationError,hv as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,ak as DEFAULT_CHILD_SAMPLE_LIMIT,kR as DEFAULT_COMPACT_LIST_FIELDS,$w as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Rf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,VM as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,av as DEFAULT_TERMINAL_TRANSITION_POLICY,Wv as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,aP as DEFECT_ESCAPE_CLASSES,cP as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ha as DELETE_FLAG_CONTRACTS,mo as DEPENDENCY_KIND_VALUES,Ac as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,xI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,uP as DefectRecurrencePolicyParseError,bc as EVAL_FLAG_CONTRACTS,Tf as EVAL_METRIC_NAMES,bf as EVAL_QUERY_SET_CONTRACT,wf as EVAL_QUERY_SET_EXAMPLE,xf as EVAL_QUERY_SET_SCHEMA_ID,yc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,$n as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Pa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ra as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,$a as EXTENSION_ADOPT_FLAG_CONTRACTS,Fk as EXTENSION_CAPABILITIES,LS as EXTENSION_CAPABILITY_CONTRACT,kS as EXTENSION_CAPABILITY_CONTRACT_VERSION,NS as EXTENSION_CAPABILITY_LEGACY_ALIASES,Ui as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Ma as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Oa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,wa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ya as EXTENSION_FLAG_CONTRACTS,Ta as EXTENSION_INIT_FLAG_CONTRACTS,xa as EXTENSION_INSTALL_FLAG_CONTRACTS,va as EXTENSION_MANAGE_FLAG_CONTRACTS,Ia as EXTENSION_MIGRATE_FLAG_CONTRACTS,Gk as EXTENSION_POLICY_MODES,Uk as EXTENSION_POLICY_SURFACES,ka as EXTENSION_RELOAD_FLAG_CONTRACTS,Bk as EXTENSION_SANDBOX_PROFILES,Sa as EXTENSION_SCOPE_FLAG_CONTRACTS,jk as EXTENSION_TRUST_MODES,ba as EXTENSION_UNINSTALL_FLAG_CONTRACTS,xP as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,EP as EXTERNAL_DEPENDENCY_SOURCE_KIND,AP as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,uO as ExtensionCommandError,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,nc as GC_FLAG_CONTRACTS,FR as GET_DEPTH_INPUT_VALUES,DR as GET_DEPTH_VALUES,Tc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,ou as GRAPH_DURABLE_CACHE_MIN_ITEMS,nu as GRAPH_DURABLE_CACHE_VERSION,xc as GRAPH_FLAG_CONTRACTS,vR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,Ec as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,ua as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,BM as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,QI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,li as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,QT as HISTORY_HASH_ALGORITHMS,xw as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,pa as HISTORY_REDACT_FLAG_CONTRACTS,la as HISTORY_REPAIR_FLAG_CONTRACTS,jp as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,Da as INSTALL_FLAG_CONTRACTS,sI as IN_PROGRESS_WORK_DETAIL_LIMIT,_o as ISSUE_SEVERITY_VALUES,lc as ITEM_COMPLETE_FLAG_CONTRACTS,_I as ITEM_LATEST_TIMESTAMP_FIELDS,$S as ITEM_METADATA_KEY_ORDER,pc as ITEM_MUTATE_FLAG_CONTRACTS,uc as ITEM_REOPEN_FLAG_CONTRACTS,$s as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,Ls as ITEM_REVISION_CONFLICT_CODE,cI as ITEM_SCALAR_MISSING_VALUE,lo as ITEM_TYPE_VALUES,fI as ITEM_UNION_COLLECTION_FIELDS,zv as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,ZT as LEGACY_HISTORY_HASH_ALGORITHM,al as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,zu as LINKED_TEST_ENV_NAME_PATTERN,qu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Bu as LINKED_TEST_PROTECTED_ENV_KEYS,Hu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,qc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,LR as LIST_COMMAND_DEFAULT_PROJECTIONS,qk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,vP as LIST_SORT_FIELDS,kP as LIST_SORT_ORDER_VALUES,ui as MAINTENANCE_HISTORY_OPERATIONS,sk as MAX_CHILD_PROJECTION_ITEMS,rP as MAX_WAIVER_NOTICE_DAYS,zS as MAX_WORKFLOW_POLICIES,qS as MAX_WORKFLOW_POLICY_TERMS,Xa as MEET_FLAG_CONTRACTS,Ok as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,Mk as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,Wc as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Oc as NEXT_FLAG_CONTRACTS,qm as NEXT_OUTPUT_VALUES,_v as NEXT_RANKING_POLICIES,oa as NOTES_FLAG_CONTRACTS,CR as OutputEnvelopeFitError,Ea as PACKAGE_FLAG_CONTRACTS,Aa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,Dd as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,Xs as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,ef as PLAN_TEMPLATE_NAMES,by as PM_AGENT_TASK_ACCOUNTING_MODES,pt as PM_AGENT_TASK_TRANSCRIPT_VERSION,vn as PM_BULK_LIFECYCLE_COMMAND_ALIASES,os as PM_CLI_ERROR_DETAILS_LIMITS,ps as PM_CLI_EXPECTED_ERROR_NAME,HR as PM_CLI_GRAMMAR_CONTRACT,UR as PM_CLI_GRAMMAR_NOUNS,Yn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,jR as PM_CLI_SHARED_VERBS,Ln as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Pt as PM_COMMAND_DESTINATION_CONTRACTS,KP as PM_COMMAND_EXIT_CONTRACTS,VP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,xi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,zP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,pp as PM_COMMAND_VISIBILITY_CONTRACTS,$M as PM_COMPLETE_LIST_FINDING_CODES,pR as PM_CONTEXT_INTENTS_FILE,JA as PM_CONTEXT_INTENT_CONTRACTS,In as PM_CONTEXT_OPS_COMMAND_ALIASES,Hn as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jn as PM_DEPRECATED_TOOL_ACTIONS,yi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Si as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ci as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qn as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,jP as PM_ERROR_CODE_CATALOG,DP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,tn as PM_EXACT_COVERAGE_METRICS,Gn as PM_EXTENSION_CAPABILITY_CONTRACTS,Vn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jn as PM_EXTENSION_POLICY_MODE_CONTRACTS,qn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,zn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Un as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bn as PM_EXTENSION_TRUST_MODE_CONTRACTS,Mi as PM_GENERIC_REFUSAL_GUIDANCE,OM as PM_GITATTRIBUTES_END,wM as PM_GITATTRIBUTES_START,PM as PM_GITATTRIBUTES_V2_END,RM as PM_GITATTRIBUTES_V2_START,Cp as PM_GITIGNORE_END,gp as PM_GITIGNORE_START,rv as PM_HISTORY_ATTESTATION_CONTRACT,Mn as PM_HISTORY_COMMAND_ALIASES,VT as PM_HISTORY_OPERATION_ALIASES,WT as PM_HISTORY_OPERATION_CONTRACT,KT as PM_HISTORY_OPERATION_PATTERNS,Wn as PM_ITEM_ACTION_SUBCOMMANDS,qT as PM_ITEM_HISTORY_OPERATIONS,nt as PM_MCP_APPS_EXTENSION,vr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,Lr as PM_MCP_APP_CONTRACTS,Nr as PM_MCP_APP_MIME_TYPE,CS as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,iL as PM_MCP_HTTP_PROTOCOL_VERSION,jg as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,nr as PM_MCP_LOG_LEVELS,x as PM_MCP_META_KEYS,a1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,c1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,_p as PM_MCP_PROMPT_CONTRACTS,q as PM_MCP_PROTOCOL_VERSION,fp as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,KC as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,J0 as PM_MCP_TASKS_EXTENSION,Qg as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,NE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,fs as PM_MUTATION_ACTION_CONTRACTS,ve as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,gi as PM_OUTPUT_BUDGET_CLASSES,hi as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Kn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Hd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,zd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,lA as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,wA as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,dA as PM_READ_OUTPUT_DIMENSIONS,pA as PM_READ_OUTPUT_OPTION_FLAGS,oA as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,nA as PM_READ_OUTPUT_SESSION_MIN_TOKENS,ME as PM_READ_OUTPUT_SURFACES,uA as PM_READ_OUTPUT_SURFACE_CONTRACTS,eA as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,kE as PM_READ_ROW_CONTRACTS,vE as PM_READ_ROW_JQ_SELECTOR,Ni as PM_RECOVERY_ECHO_FIELDS,Y$ as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,Yy as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,un as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,rD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,ln as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,kn as PM_RELOCATED_COMMAND_ALIASES,Kd as PM_REPRODUCIBLE_PROCESS_ENV,WP as PM_SUCCESS_EXIT_CODES,Xn as PM_TOOL_ACTIONS,Gd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,qd as PM_TOOL_PARAMETERS_SCHEMA,Bd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,jd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Ld as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,HT as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,_a as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Qt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,S as PmCliError,_e as PmClient,DM as PmCompleteListValidationError,C as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,FA as QUERY_CURSOR_CONTRACT,fA as READ_OUTPUT_MUTATION_CONFLICT_CODE,_A as READ_OUTPUT_SHAPING_CONTROL_FLAGS,Ga as REINDEX_FLAG_CONTRACTS,hw as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Va as RELEASE_FLAG_CONTRACTS,Qa as REMIND_FLAG_CONTRACTS,bt as RESERVED_ITEM_FIELD_NAMES,qa as RESTORE_FLAG_CONTRACTS,fo as RISK_VALUES,SR as RelationshipEventLog,TR as RelationshipEventStore,z as RelationshipGraph,Ge as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,Hc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,Hk as SEARCH_EXTENSION_FLAG_DEFINITIONS,Rc as SEARCH_FLAG_CONTRACTS,gs as SECRET_GUARD_RULE_CATEGORIES,dm as SEMANTIC_ATTRIBUTION_LIMITS,GS as SETTINGS_DEFAULTS,kf as SNAPSHOT_SCHEMA,AM as SOURCE_CONTEXT_ACCESS_ENV,xM as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Vm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Rs as STALE_WORK_THRESHOLD_SETTING,fm as START_BLOCKED_REFUSAL_CODE,mm as START_BLOCKER_ENFORCEMENT_DEFAULT,Ka as START_TASK_FLAG_CONTRACTS,oc as STATS_FLAG_CONTRACTS,uo as STATUS_VALUES,Zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,mi as SUBSTANTIVE_HISTORY_OPERATIONS,yx as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Tx as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,OE as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,a_ as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Za as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,r_ as TEST_RUN_MEASUREMENT_LIMIT,Id as TOOL_ACTIVITY_OPTION_CONTRACTS,yd as TOOL_AGGREGATE_OPTION_CONTRACTS,Od as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Md as TOOL_CALENDAR_OPTION_CONTRACTS,Pd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,vd as TOOL_CONTEXT_OPTION_CONTRACTS,xd as TOOL_CREATE_OPTION_CONTRACTS,Ad as TOOL_CREATE_OPTION_CONTRACT_SOURCE,kd as TOOL_DEPS_OPTION_CONTRACTS,Nd as TOOL_GRAPH_OPTION_CONTRACTS,Cd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Sd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Ed as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Td as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Rd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,wd as TOOL_UPDATE_OPTION_CONTRACTS,bd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,FS as TYPE_TO_FOLDER,BT as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,OO as UNPROVEN_ACTIVITY_REASONS,fd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,hd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,_d as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,wo as URL_CREDENTIAL_PLACEHOLDER,ac as VALIDATE_FLAG_CONTRACTS,BS as WORKFLOW_POLICY_ACTIONS,vM as WORKFLOW_POLICY_DOCUMENT_SCHEMA,IM as WORKFLOW_POLICY_SCHEMA,wc as WORKSPACE_FLAG_CONTRACTS,Lb as WORKSPACE_HISTORY_ID,Nf as WORKSPACE_SNAPSHOT_ACTIONS,nl as WorkspaceGraphCache,wR as WorkspaceTransactionInterruptedError,ku as _testOnly,ik as _testOnlyAggregateCommand,tl as _testOnlyConfigCommand,lk as _testOnlyGetCommand,yu as _testOnlyHealthCommand,Hp as _testOnlyInit,Bp as _testOnlyInitAgentGuidance,sN as _testOnlyItemTransaction,Nk as _testOnlyMutationEvents,rk as _testOnlyNextCommand,wk as _testOnlySearchCommand,WM as _testOnlySimilarity,of as _testOnlyTemplates,Mu as _testOnlyValidateCommand,Dk as _testOnlyWorkspacePosition,cN as abandonItemTransaction,IR as abandonWorkspaceTransaction,eI as acceptAssuranceProposals,Ru as acknowledgeLinkedTests,Zp as acknowledgeUnknownAuthorHistoryEvents,Qp as acknowledgeUnknownAuthorHistoryEventsFromTransport,Dw as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,Wo as acquireLockLease,GN as activateExtensionForTest,Qx as activateExtensions,hm as admitStartWithOpenBlockers,Ko as agentSessionEnvironment,ch as aggregate,Hf as analyzeAgentProvenanceDescriptorCoverage,pP as analyzeDefectChangeRisk,HI as analyzeDefectRecurrenceCoverage,Ml as analyzeDuplicateItems,AR as analyzeGraphImpact,ep as analyzeHierarchyIntegrity,xR as analyzeKnowledgeGraph,XP as analyzePmCommandExitConformance,Zn as analyzePmToolActionParity,vI as analyzeReconciliationDiscard,ER as analyzeRelationshipExecution,Yl as analyzeRelationshipSchedule,kg as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,Sh as append,Di as appendHistoryEntry,Gb as appendWorkspaceAuditEvent,Fb as appendWorkspaceHistoryChange,tT as applyAcceptanceCriteriaMutations,QM as applyAssurancePreset,Dc as applyBootstrapPagerPolicy,UI as applyClosureTimestampFix,rx as applyContextIntentProjection,zm as applyContextTagProjection,NP as applyFilterValueEcho,Sw as applyHistoryPatch,Vd as applyInvocationAuthorOverride,hl as applyPathMigrations,EA as applyReadOutputDimensions,CA as applyReadOutputIncludeModes,sA as applyReadOutputSessionReferences,xb as applyRegisteredItemFieldDefaultsAndValidation,Sl as applyStandaloneNote,Ks as applyStoredExtensionMigrationState,nT as applyTagRemovals,lv as applyTerminalOrderingPolicy,Tl as artifactKey,MT as asRecordClone,PT as asRecordOrNull,ze as assembleWorkspaceRelationshipGraph,jM as assertCompleteListResult,y0 as assertExtensionBlueprint,C0 as assertExtensionCapabilityUsage,e0 as assertExtensionDeactivated,E0 as assertExtensionManifestCompatible,T0 as assertExtensionManifestMatchesBlueprint,A0 as assertExtensionPreflight,np as assertHierarchyMutationAllowed,ZI as assertHistoryCompactTarget,NI as assertHistoryRepairTarget,Zi as assertInitializedTracker,gl as assertLinkedArtifactMutationIsUnambiguous,R0 as assertMcpClientCapabilities,O0 as assertMcpProtocolHeader,xy as assertMemoryRelationshipGraphAdapterConformance,sT as assertNoUnknownCsvKeys,Uu as assertNonHierarchyCardinalityMutationAllowed,t0 as assertPackageManifest,Wb as assertParentReferenceIsNotSelf,LL as assertPmMcpSkillsCapability,S0 as assertProjectProfile,vw as assertProjectRuntimeCompatibility,Rw as assertProjectRuntimeFormatGuard,LE as assertProjectionModeChoice,Qi as assertReadableTrackerRoot,r0 as assertRegisteredCommandContract,u0 as assertRegisteredCommandOverride,c0 as assertRegisteredExporter,n0 as assertRegisteredFlags,o0 as assertRegisteredHook,a0 as assertRegisteredImporter,d0 as assertRegisteredItemField,p0 as assertRegisteredItemType,g0 as assertRegisteredMigration,m0 as assertRegisteredParserOverride,f0 as assertRegisteredPreflightOverride,l0 as assertRegisteredProfile,_0 as assertRegisteredRendererOverride,i0 as assertRegisteredSearchProvider,h0 as assertRegisteredServiceOverride,s0 as assertRegisteredVectorStoreAdapter,$x as assertRelationshipEdgeAllowed,on as assertRelationshipGraphAdapterConformance,ZS as assertSchemaPreviewSupported,p_ as assertTestMeasurementRun,mx as assertWellFormedOutputText,sM as assuranceAssertionUpdateIsLoosening,ix as attachContextIntentReceipt,jA as attachContextUsageServingReceipt,xu as attachLinkedTestMutationProvenance,Au as attachLinkedTestProvenance,Xe as attachMcpServerInfo,jE as attachOutputOmissionReceipt,ax as attachOutputTokenAccounting,sx as attachReadOutputContracts,aA as attachReadOutputSessionReceipt,bp as auditMergeAttributeFence,MM as auditMergeDriverConfiguration,tu as auditWorkspaceRelationshipGraph,SL as authorizeMcpHttpRequest,Ho as boundAgentEpisodeIdentity,XE as boundReadOutputRows,Gm as buildChildrenByParent,Sk as buildCompactSearchFilterSummary,LP as buildContentFilterEcho,Bv as buildContextSignalSnapshot,uy as buildCorpusShapeItemPlan,dP as buildDefectRecurrenceIndex,Lp as buildExtensionDescribeResult,Dp as buildExtensionInstallPlan,$P as buildGovernanceMissingFilterEcho,gu as buildInProgressSweepCommands,aI as buildInProgressWorkHealthSummary,ow as buildInvalidTypeError,ck as buildItemChildrenRollup,oN as buildItemCompletionMutations,wv as buildItemContextRelevanceCandidates,zw as buildItemNotFoundError,pk as buildItemSchedule,jI as buildLinkedFileRepairReport,lL as buildMcpAuthorizationDiscoveryUrls,Dg as buildMcpCompleteResult,M0 as buildMcpDiscoverResult,hL as buildMcpDynamicRegistrationMetadata,nL as buildMcpHttpRequestHeaders,F0 as buildMcpInputRequiredResult,pL as buildMcpProtectedResourceMetadata,Ap as buildMergeAttributePatterns,Ud as buildPmActionToolInputSchema,iD as buildPmRefusalClosureCensus,KM as buildRelationshipContext,Ww as buildSearchCorpus,Xw as buildSemanticCorpusInput,DI as buildStatusRoleWarnings,Ji as buildTrackerInitializationRecovery,tO as buildVectorizationEmbeddingIdentity,rO as buildVectorizationEmbeddingMetadata,Tk as buildVerboseSearchFilters,kM as buildWorkflowCompletenessCheck,Yv as buildWorkspaceMemorySnapshot,qo as canonicalDocument,hT as canonicalizeCommandOptionKey,TN as canonicalizeCommandSuggestions,xv as canonicalizeContextRecencyCoordinate,kx as canonicalizeRelationshipKind,X$ as censusPmRecoveryReferenceProducers,UM as certifyCompleteListResult,DN as checkExtensionManifestCompatibility,ng as claim,og as claimNext,zM as classifyHistoryAuthorEvent,fi as classifyHistoryEvent,MI as classifyHistoryMergeReceiptReferences,qx as classifyHostEnvironmentFault,Ak as classifyImplicitSemanticFallbackReason,Fo as classifyItemFormatVersion,u_ as classifyLinkedTestCommandSafety,m_ as classifyLinkedTestFailure,_b as clearActiveExtensionHooks,du as clearDurableGraphCache,_E as clearFocusedItem,y_ as clearWorkspaceContractsCache,rg as close,Lu as closeItem,ug as closeTask,Uc as coalesceRepeatedListFlags,nR as collectBlockedByIds,iR as collectBlockedByIdsFromCorpus,zA as collectContextUsageDeliveredItemIds,ap as collectDanglingDependencyReferences,aR as collectDependencyBlockedIds,ip as collectDuplicateDependencyRows,eu as collectDuplicateRelationshipEdgeGroups,Ek as collectErrorCauseCodes,Zd as collectHierarchyRelations,Ar as collectMcpHeaderAnnotations,cp as collectMissingDependencyTargetIds,Gu as collectNewOrderingCycleWarnings,Jl as collectOrderingCycles,sp as collectOrderingStorageContradictions,mR as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,Eb as collectRegisteredItemFieldNames,aE as collectRuntimeCreateFieldValues,iw as collectRuntimeFilterValues,cE as collectRuntimeUpdateFieldValues,Nm as collectSubtreeIds,ji as collectUsedExtensionCapabilities,gT as commandOptionFlagLabel,lh as comments,q_ as commitImportedItem,iN as commitItemCompletion,nN as commitItemMutations,RR as commitWorkspaceTransaction,Qs as compactFlagAliasContracts,Lm as compareCriticalItems,bw as comparePmDateVersions,bR as compareRelationshipSnapshots,IT as compareTimestampStrings,Tv as compileHistoryProvenanceMatcher,ex as composeContextIntentContracts,MN as composeExtension,$N as composeExtensionPackage,dR as computeActionabilityReport,vb as computeHistoryDiff,Kl as computeRelationshipCentrality,Vl as computeRelationshipDominators,rl as computeWorkspaceGraphFingerprint,Eh as config,fb as consumeAfterCommandAffectedItems,rh as context,ox as contextIntentRowId,sg as copy,ju as countFailureCategories,WE as countReadOutputRows,Zh as create,JM as createAssurancePreset,zI as createAssuranceWorkspaceContext,kT as createCheckpointId,FM as createCompleteListOptions,Zx as createCoreCommandHookContext,en as createCorpusShapeMeasurement,lM as createEmptyAssuranceDocument,jx as createEmptyExtensionRegistrationRegistry,mO as createExtensionCommandError,qs as createExtensionCommandSdk,Gi as createExtensionContributionInventory,x0 as createExtensionTestHarness,$i as createHistoryEntry,GO as createLazyModule,NM as createLifecycleCompletenessPolicies,TL as createMcpStaticBearerVerifier,Q0 as createMcpTaskStore,Bw as createMutationGuardSdk,$E as createOutputOmissionReceipt,us as createPmCliExpectedError,zs as createPmCliProgram,Ei as createPmCommandOutputBudget,IA as createQueryFingerprint,Ay as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,xt as createRelationshipKindRegistry,Yd as createReproducibleProcessRunner,Ck as createSearchCursorFingerprint,eb as createSerialQueue,uT as createStdinTokenResolver,zT as createUnknownSubcommandError,QS as createWorkflowPolicyEvaluator,Lf as createWorkspaceSnapshot,UN as deactivateExtensionForTest,ys as decideSecretGuardFinding,KD as declineServiceOverride,nx as decodeContextIntentCursor,FO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,dx as decodePmTableRows,LA as decodeQueryCursor,kA as decodeQueryCursorEnvelope,NA as decodeQueryCursorState,PA as decodeReadOutputContinuationCursor,b0 as decodeToon,wL as decoratePmMcpToolsWithApps,Al as dedupeLinkedArtifacts,bb as defaultConfigScope,Rv as defaultScoreContextCandidates,ZD as defineAfterCommandHook,JD as defineBeforeCommandHook,QD as defineBeforeMutationHook,LD as defineCommand,BD as defineCommandOverride,K as defineCorpusShape,HL as defineEpisodeSpecification,XD as defineExporter,RN as defineExtension,PN as defineExtensionBlueprint,kD as defineExtensionManifest,$D as defineFlag,YD as defineImporter,FD as defineItemField,DD as defineItemType,GD as defineMigration,ry as defineObservationContract,rF as defineOnIndexHook,tF as defineOnReadHook,eF as defineOnWriteHook,zD as defineParserOverride,Ai as definePmCommandOutputBudget,BP as definePmCommandOutputEnvelope,FP as definePmErrorCodeCatalog,qD as definePreflightOverride,ND as defineProjectProfile,WD as defineRendererOverride,UD as defineSearchProvider,HD as defineServiceOverride,jD as defineVectorStoreAdapter,sy as defineVerdictContract,xe as defineWorkspaceRecipe,ag as deleteItem,jf as deleteWorkspaceSnapshot,Dx as dependencyToRelationship,Ch as deps,ZM as deriveAssuranceProposals,FI as deriveClosureTimestamp,vN as deriveExtensionCapabilities,Vk as deriveMutationTransactionId,JP as derivePmBulkMutationEffect,J$ as derivePmRecoveryReferenceObligations,Xl as deriveRelationshipDeadlines,Pp as deriveSchemaEvolutionMigrationId,yO as deriveTelemetryCommandResolution,dw as describeAllowedTransitions,EM as describeExtensionActivation,kN as describeExtensionBlueprint,UT as describeFlagScalarValueFailure,Tm as describeItemOwnershipConflict,Us as describeItemRevisionChanges,qL as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,lN as describeReadCompletenessControls,fO as describeUnknownError,oi as detectAgentIdentity,ci as detectHarnessIdentity,ql as detectRelationshipCommunities,ii as diagnoseAgentIdentity,ru as diffRelationshipAuditSnapshots,i_ as diffTestRunMeasurements,j0 as digestMcpRequestParameters,Xx as discoverExtensions,yo as discoverNearbyPmRoot,p1 as discoverPmTools,Ow as discoverProjectRuntimeVersionPins,gh as docs,ph as duplicates,iu as durableGraphCachePath,pu as durableGraphCacheStatus,$o as effectiveItemFormatVersion,JO as emitTelemetryErrorEvent,z_ as emptyImportedDocument,pI as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,cx as encodePmTableRows,vA as encodeQueryCursor,RA as encodeReadOutputContinuationCursor,w0 as encodeToon,kb as enforceHistoryStreamPolicyForItem,Nb as enforceHistoryStreamPolicyForItems,ZR as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,Ew as ensureMaterializedHistoryTarget,Sp as ensurePmGitignore,ll as ensureScope,lO as ensureSentryCommandTracing,pO as ensureSentryInit,B_ as ensureTrackerInitialized,Bl as enumerateRelationshipPaths,wi as estimatePmOutputTokens,mM as evaluateAssuranceAssertion,fM as evaluateAssuranceGate,sP as evaluateBoundaryFixtures,Cm as evaluateClaimActivity,vv as evaluateContextRanking,lP as evaluateDefectGateEvidence,uM as evaluateMeasurement,Af as evaluateMetricFloors,hs as evaluateMutationGuard,Jf as evaluateProvenanceCoverage,TF as evaluateReliabilityWindow,Wf as evaluateSemanticAttributionCoverage,vl as evaluateSimilarityGovernance,cw as evaluateTransition,ay as evaluateVerdictContract,JS as evaluateWorkflowPolicies,ns as executeEmbeddingBatchesWithRetry,Zw as executeVectorDelete,eO as executeVectorReset,Qw as executeVectorUpsert,QC as executeWorkspaceRecipe,yl as expandAddGlobEntries,Nl as explainSourceTraceability,ov as exportAttestation,mg as extension,_g as extensionActivate,hg as extensionDeactivate,fg as extensionList,dS as extensionMigrate,PI as extractHistoryMergeReceiptDispositions,RI as extractHistoryMergeReceiptReferences,gL as extractMcpTraceContext,Cw as extractPatchFailureContext,Su as extractReferencedPmItemIdsFromCommand,Ey as federateRelationshipGraphSnapshots,fh as files,_h as filesDiscover,hh as filesLookup,qA as finalizeContextUsageDelivery,Cy as findCoverageDeficits,Il as findDuplicateClusters,Ep as findGitWorkspaceRoot,yE as findHistoryIdentityDiscontinuities,kp as findInstalledNpmPackageCandidate,bL as findPmMcpAppByUri,Nn as findPmNamespacedCommand,Hl as findRedundantRelationshipEdges,Wl as findRelationshipCutStructure,Pl as findSimilarItems,XO as finishTelemetryCommand,yR as fitOutputEnvelope,GT as flattenFlagListValue,_y as flushTelemetryQueue,dg as focus,zl as forEachMatchedRelationshipEdge,Zl as formatDuplicateEdgeGroup,tp as formatHierarchyRelation,Ql as formatOrderingStorageContradiction,qR as formatPmPositionalActionFlagTip,gf as formatProfileApplyHuman,hf as formatProfileLintHuman,ff as formatProfileListHuman,_f as formatProfileShowHuman,vp as formatSchemaEvolutionMigrationHuman,bk as formatVectorIndexRecoveryWarnings,$k as formatWorkspacePositionHuman,Kh as gc,Wi as generateItemId,sh as get,lb as getActiveCommandResult,QA as getActiveContextIntentContracts,zi as getActiveExtensionRegistrations,yL as getActiveMcpTraceContext,hM as getAssuranceDeclaration,Pg as getContracts,mE as getFocusedItem,Eo as getHistoryPath,gR as getItemAt,To as getItemPath,Es as getMutationActionContract,yp as getPmGitignoreBlock,So as getSettingsPath,S_ as getWorkspaceContracts,$b as getWorkspaceHistoryPath,yh as graph,su as graphAuditBaselinePath,Yf as groupHistoryByEpisode,VD as handleServiceOverride,P0 as hasMcpClientExtension,xL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,nO as hasVectorizationEmbeddingIdentityChanged,oO as hasVectorizationVectorDimensionChanged,Px as hashDocument,Mx as hashDocumentForVersion,Ix as hashEmptyDocument,Ax as hashHistoryPatch,Ex as hashHistoryRecord,xx as hashHistoryStream,lI as hashItemScalarDecisionValue,Vh as health,Fl as hierarchyAncestors,Gl as hierarchyDescendants,Jh as historyCompact,Qh as historyCompactBulk,rE as historyDigest,Sv as historyEntryMatchesProvenance,ww as historyItemHashVersionForRuntime,Wh as historyRedact,Yh as historyRepair,Xh as historyRepairAll,oR as indexBlockedByIds,rp as indexHierarchyRelations,iO as inferConsistentVectorDimension,Ti as inferPmOutputBudgetClass,Th as init,GM as inspectCompleteListResult,Bx as inspectExtensionManifestSchema,Kp as inspectHistoryAuthorStream,Ms as inspectInProgressWork,yI as inspectMergeReceiptEvidence,Iw as inspectProjectRuntimeCompatibility,Is as inspectStaleInProgressItems,Ng as inspectStaticExtensionInventory,$I as inspectStatusRoleAssignments,Db as inspectWorkspaceHistoryState,$f as inspectWorkspaceSnapshot,Rp as installMergeFence,I0 as interpretMcpResultType,Km as isAlreadyClaimedError,gO as isCommanderError,fN as isCompatibleRecoveryFlag,nd as isErrnoError,ZO as isExternalDependencyReference,eR as isExternalDependencySourceKind,me as isFileMissingError,Ii as isGenericRefusalRequired,vi as isGenericRefusalWhy,PE as isHostOutputSuppressed,ls as isItemAlreadyExistsError,js as isItemRevisionConflict,dI as isItemScalarMissingValue,vO as isJudgeableHistoryRecord,bI as isLegacyMergeReceiptSummary,h as isMcpRecord,Ss as isMutationAction,Lx as isOrderingRelationshipKind,Vb as isPlaceholderReferenceToken,is as isPmCliErrorDetails,ms as isPmCliExpectedError,to as isPmExtensionCapabilityContract,no as isPmExtensionPolicyModeContract,oo as isPmExtensionPolicySurfaceContract,ro as isPmExtensionServiceNameContract,YP as isPmKnownExitCode,qP as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,ds as isPmTokenBudgetRecovery,eo as isPmToolAction,wI as isPreDurableCloneLocalReceiptSummary,OI as isPreDurableDispositionEligibleReference,Mw as isProjectMutatingInvocation,UO as isPureSnakeCaseAlias,xA as isReadOutputBudgetExceeded,rA as isReadOutputSessionReference,mN as isReadProjectionRecoveryFlag,AA as isReadResultOmittedForBudget,FE as isReadRowContract,Jd as isRuntimeRecord,uw as isSettingsReadFallback,_m as isStartTransition,zO as isTerminalPlanMode,pE as isTerminalStatus,Io as isTimestampLiteral,nP as isWaiverNoticeDays,IO as isWellFormedHistoryRecord,Jk as itemDocumentToMutationOptions,dk as itemHasSchedule,_i as jaccardSimilarity,LO as latestHistoryTimestamp,mh as learnings,jT as levenshteinDistanceWithinLimit,ed as limitAnnotationEntries,bu as linkedTestTrustFingerprint,NN as lintExtensionBlueprint,zx as lintExtensionManifestSchema,er as lintProjectProfile,nh as list,Zo as listAgentProvenanceAdapters,Gc as listAliasPluralKeys,oh as listAllComplete,Uw as listAllDocumentCandidatesCached,rs as listAllItemMetadata,jw as listAllItemMetadataLight,_M as listAssuranceDeclarations,TM as listAssuranceVerdicts,py as listBuiltinCorpusShapes,EN as listCoreClosedDomainContracts,GR as listGetProjectionFields,oI as listInvalidProvenanceHistoryStreamIds,$R as listListProjectionFields,SI as listMergeReceipts,Ts as listMutationActions,Ik as listMutationEvents,hn as listPmCommandFlagBudgets,up as listPmCommandsForFamily,lp as listPmCommandsForTier,Pe as listPmFlagLexicon,PD as listPmFlagSpellingInventory,mp as listPmMcpToolsForProfile,CD as listPmRequiredArgumentRefusalContracts,yD as listPmSubcommandRefusalContracts,Yt as listProfiles,ED as listTrackerPreflightRecoveryContracts,eN as listUpsertKeyCandidates,Df as listWorkspaceSnapshots,fR as loadContextIntentRuntimeLayers,sf as loadCreateTemplateOptions,Jx as loadExtensions,uu as loadGraphAuditBaseline,tN as loadGuardedRuntimeSchema,LT as loadMutationCheckpoint,v as loadRelationshipGraphAdapter,es as locateItem,iT as looksLikeGenericKeyValueEntry,YE as mapReadOutputRows,TI as markMergeReceiptReconciled,sw as matchesRuntimeFilters,WO as maybeRunFirstUseTelemetryPrompt,my as measureCorpusShapePlan,Xi as measureItemMetadataReadWork,rT as mergeAdditiveTags,IN as mergeExtensionBlueprints,uI as mergeHistoryStreams,hI as mergeItemDocuments,gI as mergeJsonDocuments,jc as mergeLinkedTestTwoTokenEntries,mI as mergeRelationshipEventStreams,jm as mergeSortedWarnings,BO as migrateItemFilesToFormat,Hw as mutateItem,qw as mutateItemWithHistoryContext,Ub as mutateWorkspaceJsonWithHistory,ah as next,ti as normalizeAgentProvenanceAdapterValue,Zc as normalizeAnnotationTransportOptions,rM as normalizeAssuranceEvaluation,tM as normalizeAssuranceMutation,Bc as normalizeBootstrapInvocation,Pb as normalizeBulkIdsValue,op as normalizeDependencyGraphTarget,RP as normalizeDependencySeedId,OP as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,Ds as normalizeExpectedItemHash,Fi as normalizeExtensionContributionInventory,JT as normalizeHistoryOperationForWrite,nI as normalizeInvalidHistoryProvenance,QR as normalizeItemAddressInvocation,Do as normalizeItemFormatVersion,Ki as normalizeItemId,jo as normalizeItemMetadata,PP as normalizeItemReference,Fc as normalizeLegacyExtensionActionSyntax,Cl as normalizeLinkedPath,Hb as normalizeParentReferenceValue,Kt as normalizeProfileName,Vi as normalizeRawItemId,yA as normalizeReadOutputIncludeModeOptions,AE as normalizeReplayPatchOps,As as normalizeSimilarityText,RO as normalizeStaleWorkThresholdHours,dE as normalizeStatusForRegistry,Uo as normalizeStatusInput,oE as normalizeStatusInputWithRegistry,hO as normalizeThrownExitCode,uh as notes,Mo as nowIso,au as openDurableGraphCache,U0 as openMcpRequestState,VL as openPmEpisode,Ul as orderingPredecessors,jl as orderingSuccessors,Dv as packContextCandidates,$m as packRankedContextItems,wg as packageActivate,bg as packageCatalog,Og as packageDeactivate,Ag as packageDescribe,Tg as packageDoctor,yg as packageInstall,gg as packageLifecycle,Cg as packageList,Eg as packageManage,pS as packageMigrate,xg as packageReload,Sg as packageUninstall,DA as paginateQueryRows,ul as parseAddEntries,ml as parseAddGlobEntries,rd as parseAnnotationTextInput,Kk as parseAtomicMutationControls,$c as parseBootstrapCommandName,kc as parseBootstrapGlobalOptions,Lc as parseBootstrapHelpRequest,zc as parseBootstrapTypeValue,Rb as parseBulkIdsText,vm as parseContextDepth,Rm as parseContextFocusFields,lR as parseContextIntentDeclarations,km as parseContextSections,jv as parseContextSignalSnapshot,oT as parseCsvKv,fP as parseDefectChangeRiskRequest,qI as parseDefectRecurrenceCoverageRequest,mP as parseDefectRecurrencePolicy,Ef as parseEvalMetricFloors,Of as parseEvalQuerySet,Fs as parseExpectHashSpecs,bT as parseExtensionLongFlagToken,_u as parseGraphSubcommand,nv as parseHistoryAttestation,Cv as parseHistoryProvenanceFilters,_P as parseIntegerLimit,lE as parseItemDocument,Wk as parseItemMutationBatch,nw as parseLimit,em as parseLinkedTestAssertionEqualsMap,tm as parseLinkedTestAssertionGteMap,Wu as parseLinkedTestBoolean,Yu as parseLinkedTestContextMode,Ku as parseLinkedTestEnvClear,Vu as parseLinkedTestEnvSet,rm as parseLinkedTestJsonEntries,Zu as parseLinkedTestMinLines,Qu as parseLinkedTestRegexList,Ju as parseLinkedTestStringList,Xu as parseLinkedTestWorkspaceContextMode,qg as parseMcpCachePolicy,Lg as parseMcpImplementation,Ze as parseMcpInputRequests,pr as parseMcpInputResponses,fC as parseMcpSubscriptionFilter,_l as parseMigrateEntries,CP as parseMultiValueFilter,HP as parseMutationReceipt,fT as parseOptionalNonNegativeInteger,mT as parseOptionalNumber,z$ as parsePmAgentTaskTranscriptCorpus,d1 as parsePmToolDiscoveryOptions,hP as parsePriority,TP as parsePriorityFilterSet,iA as parseReadOutputSession,Ab as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,fl as parseRemoveEntries,kl as parseSourceLineRange,Zb as parseStatusFilterCsv,yP as parseStringFilterSet,io as parseTags,n_ as parseTestRunMeasurements,gP as parseType,SP as parseTypeFilterSet,Jp as parseUnknownAuthorHistoryEventCoordinates,HS as parseWorkflowPolicy,VS as parseWorkflowPolicyDocument,nk as partitionDecisionEntries,Ib as patchPathToChangedField,so as pathExists,lg as pauseTask,cu as persistDurableGraphResult,lw as persistSelectedItemFormat,HM as planAgentIdentityVocabularyMutation,Kv as planCompletedAtBackfill,Fp as planExtensionDirectoryCopy,ON as planItemMutationDocument,tr as planProfileApplication,K$ as planRelationshipEventBackfill,fu as planRelationshipRemediation,Mp as planSchemaEvolutionMigration,Yp as planUnknownAuthorHistoryAcknowledgment,Ff as planWorkspaceSnapshotRestore,KR as positionalShapeKey,WR as positionalSignatureKey,FN as preflightExtension,bs as prepareSimilarityText,cT as preserveMutationStdinTokenFields,aT as preserveMutationStdinTokenLiterals,wN as previewItemMutationDocument,rN as previewItemMutations,gx as printError,hx as printResult,Uh as profile,zh as profileApply,qh as profileLint,jh as profileList,Bh as profileShow,mb as projectAfterCommandItemSnapshot,Pm as projectContextFocusRows,t_ as projectFleetAttributionAnalytics,yv as projectHistoryProvenance,Li as projectLeanRecoveryPayload,pl as projectLinkedCollectionMutation,px as projectPmBriefListEnvelope,lx as projectPmBriefSearchEnvelope,cs as projectPmCliErrorContextDetails,ss as projectPmCliErrorDetails,Ri as projectPmDiagnosticOutput,Pi as projectPmDiagnosticText,Zf as projectProvenanceCoverageAnalytics,Pu as projectValidateCounts,tI as promoteAssuranceAssertion,BA as propagateContextUsageServingReceipt,u$ as pruneCompileCacheGenerations,gM as putAssuranceDeclaration,CM as putAssuranceDeclarationBundle,kw as queryItemMetadataIndex,Nw as queryLinkedFileMetadataIndex,Lw as querySimilarItemMetadataIndex,o_ as queryTestRunMeasurementsBelow,xo as quoteCommandArg,Ao as quoteWindowsCommandArg,SN as rankCommandPaths,td as readAnnotationEntries,si as readAuthorEnvironment,E_ as readBooleanOption,YA as readContextUsageAffinity,A_ as readCsvListOption,Vs as readExtensionMigrationState,ao as readFileIfExists,Xc as readFirstStringFromCommanderOptions,Jc as readFirstValueFromCommanderOptions,Xf as readHistoryAnalyticsWindow,CE as readHistoryEntries,pi as readHistorySnapshot,zf as readImprovementLedger,Fw as readItemMetadataDerivedIndexState,Gs as readItemRevision,aN as readItemTransaction,DO as readLatestHistoryActivity,ts as readLocatedItem,KE as readOutputBudgetCollections,OA as readOutputCollectionFingerprint,VE as readOutputContinuationRowCollections,qE as readOutputContinuationRowPaths,gA as readOutputIncludeModeOptions,tA as readOutputRetainsTail,HE as readOutputRowCollections,zE as readOutputRowPaths,cA as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,Om as readRecentActivity,C_ as readRequiredString,sE as readRuntimeFieldOptionValue,Yi as readSettings,VO as readSettingsSection,mw as readSettingsWithMetadata,Qc as readStringArrayFromCommanderOptions,T_ as readStringOption,_O as readThrownExitCode,sO as readVectorizationStatusLedger,Aw as readWorkflowPolicies,KS as readWorkflowPolicyField,uR as readWorkspaceContextIntentContracts,Hv as readWorkspaceContextSignals,Xv as readWorkspaceMemory,Lk as readWorkspacePosition,PR as readWorkspaceTransaction,wE as reanchorHistoryEntries,AF as reconcileArtifactLedgers,Bi as reconcileExtensionCapabilityUsage,Bb as reconcileWorkspaceJsonHistory,ub as recordAfterCommandAffectedItem,SM as recordAssuranceVerdict,sm as recordClaimSemanticAttribution,VA as recordContextUsageDelivery,HA as recordContextUsageServing,KA as recordContextUsageTouch,WA as recordContextUsageTouches,cm as recordFocusSemanticAttribution,Bf as recordImprovementObservation,am as recordReleaseSemanticAttribution,NO as recordedBaselineActivity,$O as recordedPrefixActivity,Ro as redactUrlCredentialsInText,Oo as redactUrlCredentialsInToken,Gw as refreshItemMetadataDerivedIndex,wp as refreshMergeAttributeFenceIfInstalled,QE as refreshReadOutputDeliveredCounts,cO as refreshSearchArtifactsForMutation,ei as registerAgentProvenanceAdapters,bP as registerExternalDependencyResolver,Qo as registerHarnessSignalDescriptors,IE as registerOutputMaterialFieldGroups,ig as release,JE as rememberReadOutputFocusRows,yM as removeAssuranceDeclaration,co as removeFileIfExists,wl as renameArtifactsResultKey,Am as renderCalendarMarkdown,xm as renderCalendarToon,Bm as renderContextMarkdown,$p as renderExtensionDescribeMarkdown,Np as renderExtensionSurfaceMarkdown,K_ as renderGuideMarkdown,gN as renderMissingOptionRetry,ok as renderNextMarkdown,AN as renderPmClosedDomainHelp,bo as renderPmCommand,Fn as renderPmCommandAliasMigrationHint,hp as renderPmCommandVisibilityMarkdown,ID as renderPmFlagLexiconMarkdown,OL as renderPmMcpAppHtml,sD as renderPmRefusalClosureCensusMarkdown,tw as renderRowsAsCsv,rw as renderRowsAsTable,tg as reopen,Tw as replayHistoryToTarget,TE as replayToCanonicalItemDocument,SE as replayToItemDocument,XT as requireHistoryOperation,dv as requireTerminalReason,pv as requireTerminalReasonWithRecovery,Ox as resealHistoryRewrite,cb as resetActiveExtensionRuntimeState,il as resetWorkspaceGraphCache,Vo as resolveAgentSessionContextFromSignals,ad as resolveAnnotationIndex,od as resolveAnnotationInput,gE as resolveAuthor,di as resolveAuthorIdentity,qb as resolveBodyFileContent,ly as resolveBuiltinCorpusShape,Em as resolveCalendarOutputFormat,GP as resolveCanonicalPmErrorCodeContract,Nx as resolveCanonicalRelationshipKind,hE as resolveClaimPrincipal,Mb as resolveCliBulkIdsInput,ST as resolveCommandOptionPolicyState,l$ as resolveCompileCacheGeneration,Vv as resolveCompletionTimestamp,Ux as resolveConfiguredPmPackageRoot,IP as resolveContentFieldFilters,tx as resolveContextIntentContract,Mm as resolveContextOutputFormat,Im as resolveContextTokenBudget,uv as resolveCreateExplicitEmptyFlag,Ns as resolveDeclaredBlockers,fk as resolveEffectiveSearchMode,Vw as resolveEmbeddingProviders,vt as resolveExtensionFlagOptionKey,FT as resolveExtensionFlagValueContract,Gp as resolveExtensionInstallSourceIdentity,wT as resolveExtensionLongFlagName,Hs as resolveExtensionMigrationStatePath,Yx as resolveExtensionRoots,wP as resolveExternalDependencyReference,DT as resolveFlagValueKind,AT as resolveGlobalPmRoot,H_ as resolveGuideOutputFormat,qf as resolveHistoryEpisodeGroupIdentity,tE as resolveHistoryHashAlgorithm,YT as resolveHistoryOperation,gv as resolveHistoryProvenanceDimensions,QO as resolveHistorySubject,yw as resolveHistoryTarget,hk as resolveHybridSemanticWeight,Co as resolveImplicitPmRoot,vT as resolveIsoOrRelative,sR as resolveItemBlockers,tR as resolveItemExecutionRole,Xk as resolveItemMutationDocument,Sm as resolveItemOwnershipActivity,ym as resolveItemOwnershipConflict,go as resolveItemTypeRegistry,nE as resolveItemTypesFilePath,Ps as resolveLastActivityAt,dN as resolveLifecycleVerbRecovery,xT as resolveLinkedResourcePositionalRecovery,f_ as resolveLinkedTestFailureExitCode,Tu as resolveLinkedTestSourceRef,Eu as resolveLinkedTestSourceWorkspaceRoot,wu as resolveLinkedTestTrust,Ou as resolveLinkedTestTrustBatch,_C as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,Tp as resolveMergeInstallContext,CN as resolveMisnestedCommandPath,MP as resolveMissingMetadataFilters,hN as resolveMissingOptionPlaceholder,DE as resolveModePairedOutputOmissionReceipt,tk as resolveNextOutputFormat,UE as resolveOutputOmissionReceipt,Gx as resolvePmCliVersion,Dn as resolvePmCommandAlias,qe as resolvePmCommandCapabilityFamily,$t as resolvePmCommandExitContract,N as resolvePmCommandOperation,bi as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,BR as resolvePmCommandPositionalContract,Po as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,Oi as resolvePmDiagnosticOutputBudget,UP as resolvePmErrorCodeContract,oS as resolvePmFlagSemanticConcept,ke as resolvePmHistoryOperation,N0 as resolvePmMcpExecutableInvocation,Fx as resolvePmPackageRootFromModule,zR as resolvePmPositionalActionContract,Ic as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,$d as resolvePmToolCustomFieldCollision,Yb as resolvePriority,Wt as resolveProfile,xp as resolveProjectMergeTypeFolders,$A as resolveQueryCursorStart,pN as resolveReadCompletenessControls,uN as resolveReadOptionRetryArgs,SA as resolveReadOutputDimensions,bA as resolveReadOutputEncoding,ZE as resolveReadOutputRecoveryBudget,mA as resolveReadOutputSurface,GE as resolveReadRowContract,_N as resolveRecoveryCommandName,wb as resolveRegisteredSearchProvider,Ob as resolveRegisteredVectorStoreAdapter,Wd as resolveReproducibleProcessEnvironment,ko as resolveRuntimeFieldRegistry,vo as resolveRuntimeStatusRegistry,Kw as resolveSearchCorpusFields,mk as resolveSearchMaxResults,yk as resolveSearchPage,_k as resolveSearchScoreThreshold,gk as resolveSearchTuning,Yw as resolveSemanticCorpusCharacterLimit,im as resolveSemanticLineageIds,_w as resolveSettingsWithSemanticRuntimeDefaults,bM as resolveSourceContextWritePolicy,um as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,US as resolveTelemetryErrorCategory,dO as resolveTelemetrySourceAttribution,cv as resolveTerminalReason,Zk as resolveTransactionSchema,yT as resolveTypeDefinition,CT as resolveTypeName,ew as resolveTypeSynonym,aw as resolveTypeWorkflows,Xp as resolveUnknownAuthorAcknowledgmentSelector,xk as resolveVectorIndexRecovery,Jw as resolveVectorStores,Qd as resolveWorkspaceRelationshipKindRegistry,ET as resolveWorkspaceRoot,cg as restore,$T as restoreCheckpointItems,zb as restoreWorkspaceJsonFromHistory,Uf as restoreWorkspaceSnapshot,Gf as restoreWorkspaceSnapshotWithRecovery,cl as reviseLinkedNote,vg as runAction,hb as runActiveBeforeMutationHooks,Cb as runActiveCommandHandler,gb as runActiveOnIndexHooks,Hi as runActiveOnReadHooks,qi as runActiveOnWriteHooks,yb as runActiveParserOverride,Sb as runActivePreflightOverride,Tb as runActiveServiceOverride,wm as runActivity,Wx as runAfterCommandHooks,Cf as runAggregate,sd as runAnnotationCommand,Nu as runAppend,WI as runAssuranceAction,YI as runAssuranceDispatch,Kx as runBeforeCommandHooks,bm as runCalendar,Wm as runClaim,Ym as runClaimNext,$u as runClose,Du as runCloseMany,Zm as runCloseTask,cd as runComments,W_ as runCompletion,el as runConfig,qt as runContext,Lv as runContextEvaluationCorpus,kv as runContextEvaluationScenario,Fu as runCopy,nm as runCreate,om as runDelete,sl as runDeps,Ol as runDocs,YM as runDuplicates,Pf as runEval,If as runEvent,Up as runExtension,Ys as runExtensionMigrateAction,Ws as runExtensionMigrations,Ll as runFiles,Dl as runFilesDiscover,$l as runFilesLookup,e_ as runFleetAttributionAnalytics,lm as runFocus,vu as runGc,yf as runGet,hu as runGraph,V_ as runGuide,Cu as runHealth,uk as runHistory,sv as runHistoryAttest,JI as runHistoryCompact,ev as runHistoryCompactBulk,II as runHistoryMaintenance,tv as runHistoryRedact,kI as runHistoryRepair,LI as runHistoryRepairAll,Ig as runInActiveExtensionScope,Vp as runInit,zp as runInitAgentGuidance,dd as runLearnings,bl as runLinkedArtifacts,__ as runLinkedTests,dp as runList,Mf as runMeet,Rk as runMergeDriver,Op as runMergeInstall,AI as runMergeReceiptEvidenceReport,EI as runMergeReceiptReport,Pk as runMergeReconcile,Hm as runNext,pd as runNotes,Qm as runPauseTask,tf as runPlan,mf as runProfileApply,uf as runProfileLint,pf as runProfileList,lf as runProfileShow,Qf as runProvenanceCoverageAnalytics,jN as runRegisteredCommandForTest,VN as runRegisteredCommandOverrideForTest,ZN as runRegisteredExporterForTest,zN as runRegisteredHookForTest,QN as runRegisteredImporterForTest,JN as runRegisteredMigrationForTest,BN as runRegisteredMutationGuardForTest,qN as runRegisteredParserOverrideForTest,HN as runRegisteredPreflightOverrideForTest,KN as runRegisteredRendererOverrideForTest,YN as runRegisteredSearchProviderForTest,WN as runRegisteredServiceOverrideForTest,XN as runRegisteredVectorStoreAdapterForTest,rr as runReindex,Xm as runRelease,vf as runRemind,fv as runReopen,rf as runRestore,Ip as runSchemaEvolutionMigration,Sf as runSearch,fy as runSearchRefreshWorkerEntrypoint,Y_ as runStartBackgroundRun,Jm as runStartTask,s_ as runStats,c_ as runTelemetry,cf as runTemplatesList,af as runTemplatesSave,df as runTemplatesShow,h_ as runTest,g_ as runTestAll,X_ as runTestRunsList,Q_ as runTestRunsLogs,eh as runTestRunsResume,J_ as runTestRunsStatus,Z_ as runTestRunsStop,th as runTestRunsWorker,gm as runUpdate,nf as runUpdateMany,Bt as runUpgrade,Iu as runValidate,Mg as runWithActiveExtensions,L as runWithAgentSessionContext,pw as runWithConfigurationOnlySettings,ZA as runWithContextIntentContracts,_R as runWithDiscoveredContextIntentContracts,ri as runWithHarnessDetectionSignals,CL as runWithMcpTraceContext,Xd as runWithReproducibleProcessEnvironment,ni as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,LM as runWorkflowPolicyAction,XI as runWorkspaceTransactionGc,mu as saveGraphAuditBaseline,GI as scanClosureTimestamps,rI as scanExtensionHostVersions,Wp as scanHistoryAuthorAttribution,vs as scanInProgressWork,Go as scanItemFormatVersions,_s as scanMutationSecrets,iI as scanProvenanceResolverHealth,ks as scanStaleInProgressItems,BI as scanStorageIntegrity,Ah as schema,Mh as schemaAddField,Rh as schemaAddStatus,wh as schemaAddType,Nh as schemaApplyPreset,Lh as schemaInferTypes,xh as schemaList,vh as schemaListFields,Fh as schemaRemapStatus,Ih as schemaRemoveField,Ph as schemaRemoveStatus,Oh as schemaRemoveType,Dh as schemaRenameField,$h as schemaRenameType,bh as schemaShow,kh as schemaShowField,Gh as schemaShowStatus,yN as scoreCommandPathMatch,Pv as scoreContextCandidates,Mv as scoreContextCandidatesWithActiveExtensions,ws as scoreItemSimilarity,SD as scorePmGrammarRefusalClosure,dD as scorePmRefusalClosure,Os as scorePreparedItemSimilarity,AD as scoreTrackerPreflightRecoveryClosure,bx as sealHistoryRecord,G0 as sealMcpRequestState,ih as search,Zv as searchWorkspaceMemory,ek as searchWorkspaceMemoryReadResult,Cs as secretGuardRuleCategory,cR as selectActionableEntries,MA as selectCursorSemanticOptions,j_ as selectImportAuthor,mL as selectMcpClientRegistrationMode,Qv as selectWorkspaceMemory,Jv as selectWorkspaceMemoryRollups,pm as semanticAttributionAffinity,xO as sentryCaptureCliError,EO as sentryDiscardCommandSpan,AO as sentryFinishCommandSpan,wO as sentryFlush,bO as sentryLogCliUsageError,SO as sentrySetCommandContext,TO as sentryStartCommandSpan,zo as serializeItemDocument,xN as serializeNdjsonRows,bN as serializeNdjsonStream,ny as serveDeclaredObservation,db as setActiveCommandContext,pb as setActiveCommandResult,rb as setActiveExtensionCommands,tb as setActiveExtensionHooks,nb as setActiveExtensionParsers,ob as setActiveExtensionPreflight,ab as setActiveExtensionRegistrations,sb as setActiveExtensionRenderers,ib as setActiveExtensionServices,fE as setFocusedItem,HO as settingsSectionRevision,qO as shouldCompletePlanOnClose,lu as shouldPersistDurableGraphCache,lT as shouldResolveMutationStdinTokenField,pT as shouldResolveMutationStdinTokens,gw as shouldRunSearchRefreshInForeground,Rl as similarityAdvisoryWarnings,BE as sliceReadOutputRowCollection,as as snapshotPmCliErrorContext,El as sortLinkedArtifacts,iP as sortWaiverNotices,eT as splitAcceptanceCriteria,jO as splitCommaList,Bo as splitFrontMatter,TA as stabilizeReadOutputReceiptEstimates,R as stableStringify,Yk as stableUpsertValue,jS as stableValueEquals,MO as staleEligibleAt,Pw as stampRequiredItemFormat,pg as startTask,YO as startTelemetryCommand,dh as stats,iE as statusIsTerminal,Nc as stripGlobalBootstrapTokens,vk as subscribeMutationEventBatches,kk as subscribeMutationEvents,qM as summarizeAgentIdentityVocabulary,Vf as summarizeAgentModelProvenance,Kf as summarizeAgentProvenance,Nv as summarizeContextEvaluationReports,l_ as summarizeContextPreflight,Ev as summarizeHistoryProvenance,qp as summarizeInitResult,CI as summarizeMergeReceipt,mv as supportsCreateExplicitEmpty,JR as supportsItemIdAlias,RE as suppressHostOutput,we as syncRelationshipGraphAdapter,LN as synthesizeExtensionManifest,vc as toCompletionFlagString,Um as toContextFocusItem,Dm as toContextPackingSummary,Fm as toContextRankingSummary,RT as toErrorMessage,b_ as toEstimatedMinutesValue,zk as toExtensionFlagDefinitions,M_ as toImportBoolean,N_ as toImportConfidence,G_ as toImportDeferredFields,P_ as toImportInteger,F_ as toImportLinkedDocs,D_ as toImportLinkedFiles,U_ as toImportLinkedTests,$_ as toImportLogEntries,L_ as toImportNormalizedEnum,k_ as toImportNumberMap,w_ as toImportPriority,R_ as toImportStatus,I_ as toImportStringList,v_ as toImportStringMap,O_ as toImportTags,uE as toItemRecord,x_ as toNonEmptyImportString,OT as toNonEmptyStringOrUndefined,EE as toReplayDocument,ux as toWellFormedText,xs as tokenizeSimilarityText,dT as transferMutationStdinTokenPolicy,Hx as translateHostEnvironmentFault,kO as unprovenClaimActivity,eg as update,d_ as updateLinkedTest,Rg as upgrade,Hh as validate,cM as validateAssertionDefinition,pM as validateAssuranceDocument,dM as validateGateDefinition,Qk as validateItemMutationRows,xl as validateLinkedPaths,fL as validateMcpAuthorizationResponseIssuer,uL as validateMcpAuthorizationServerMetadata,_L as validateMcpClientMetadataDocument,oL as validateMcpHttpRequestHeaders,z0 as validateMcpJsonSchema,aM as validateMeasurementDefinition,Kb as validateMissingParentReference,hA as validateReadOutputOptions,Qb as validateSprintOrReleaseValue,TT as validateTypeOptions,OR as validateWorkspaceTransactionIdentity,iv as verifyAttestation,eP as verifyCliFlagInvocationParity,VR as verifyExplicitPositionalSlotCensus,bE as verifyHistoryChain,xE as verifyHistoryChainWithVersion,hR as verifyHistoryEntries,wx as verifyHistoryRecordHash,Rx as verifyHistoryRewriteEvidence,XR as verifyPmCliGrammar,YR as verifyPmCommandPositionalContracts,MD as verifyPmFlagLexicon,eD as verifyPmRecoveryKindRuntimeCoverage,Wy as verifyPmRecoveryProducerRuntimeCoverage,Z$ as verifyPmRecoveryReferences,oD as verifyPmRefusalClosureIdentityRatchet,nD as verifyPmRefusalClosureRatchet,Q$ as verifyPmRefusalReachability,gd as verifyToolOptionCliParity,oP as waiverNoticeFor,PO as wholeHoursSince,Xb as withCliMutationInput,Bs as withExpectedItemRevisions,Js as withFlagAliasMetadata,Vx as withHostEnvironmentBoundary,Jb as withLiteralMutationInput,B0 as withMcpCachePolicy,ki as withoutGenericRefusalExamples,YS as workflowApprovalFingerprint,XS as workflowPolicyApplies,WS as workflowPolicyFingerprint,ol as workspaceGraphCache,MR as workspaceTransactionPlanDigest,id as wrapOwnershipConflict,CO as wrapThrownErrorForSentry,ai as writeAuthorEnvironment,$e as writeFileAtomic,NT as writeMutationCheckpoint,fw as writeSettings,KO as writeSettingsSection,_x as writeStderr,fx as writeStdout,aO as writeVectorizationStatusLedger,jb as writeWorkspaceJsonWithHistory,dl as writtenLinkedEntries};
28
+ </html>`}import{createHash as ot}from"node:crypto";import{lstat as JC,readdir as qr,readFile as QC}from"node:fs/promises";import M from"node:path";import{parseDocument as ZC}from"yaml";var $r="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",ey=Object.freeze({revision:it,status:"draft",directoryRead:!0});function zL(e,t=!1){let r=e.clientCapabilities.extensions,n=h(r)?r[$r]:void 0;if(!h(n)||n.revision!==it||t&&n.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:ey}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,ty=32*1024*1024,ry=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new u(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function ny(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let n=ZC(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&T(`Skill ${t} frontmatter must be an object.`),o}async function oy(e,t,r,n){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>ty&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),QC(e)}async function zr(e,t,r){let n=M.join(e,t),o=await qr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await JC(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await zr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await oy(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Ur(e,t,r){let n=new Map,o;try{o=await qr(e,{withFileTypes:!0})}catch(a){if(St(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&ry.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Dr&&T(`Skill origin exceeds ${Dr} directories.`);let s={value:0};for(let a of i){let c=await zr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((_,y)=>_+y.bytes.byteLength,0),p=c.find(_=>_.relative==="SKILL.md");if(!p)continue;let l=ny(p.bytes.toString("utf8"),a.name);l.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:l.name??null,expected:a.name}),(typeof l.description!="string"||l.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(_=>({uri:`skill://${a.name}/${_.relative}`,digest:`sha256:${ot("sha256").update(_.bytes).digest("hex")}`,size:_.bytes.byteLength})),g=ot("sha256").update(f.map(_=>`${_.uri}:${_.digest}`).join(`
29
+ `)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:l,resources:f,_meta:{contractVersion:1,extensionRevision:it,origin:t,packageVersion:r,protocolVersion:z,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(_=>[_.relative,_.bytes])),fingerprint:g})}return n}function jr(e){let{files:t,fingerprint:r,...n}=e;return n}var Br=class e{#e;#t;constructor(t){this.#e=t,this.#t=ot("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
30
+ `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&T("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof u)throw n;return T("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=M.resolve(t.packageRoot,".agents","skills"),o=M.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await Ur(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Fr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(jr),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),jr(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Gr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let y of o.resources){let E=y.uri.slice(`${a}/`.length);if(!E.startsWith(s))continue;let B=E.slice(s.length),[O,...ht]=B.split("/"),Rn=`${a}/${s}${O}`,Pn=o.files.get(`${s}${O}`);c.set(O,{uri:Rn,name:O,mimeType:ht.length>0?"inode/directory":Gr(O,Pn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Fr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let p=this.#r(r.cursor,t),l=[...c.values()].sort((y,E)=>y.uri.localeCompare(E.uri)),f=l.slice(p,p+d),g=p+f.length,_=g<l.length;return{resources:f,hasMore:_,..._?{nextCursor:this.#n(g,t)}:{}}}};var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,n)=>st(r,`${t}[${n}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,n])=>[r,st(n,`${t}.${r}`)])))}function xe(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,n)=>Object.freeze({action:r.action,input:st(r.input,`operations[${n}].input`)})))})}async function Vr(e,t){let r=xe(e);return Et(r,t)}async function iy(e,t){return Vr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function w(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function I(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function sy(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(I(r.command,"observation.reads.command"),w(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function ay(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(w(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,n)=>r+n,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function cy(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let n of e){if(I(n.id,"observation.tiers.id"),w(n.max_tokens,"observation.tiers.max_tokens"),t.has(n.id))throw new Error(`Duplicate observation tier: ${n.id}.`);if(t.add(n.id),n.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=n.max_tokens;let o=new Set;for(let i of n.fields){if(D(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function dy(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return I(e.id,"observation.id"),w(e.version,"observation.version"),sy(e.reads),ay(e.calibration),e.corpus_dependence.kind==="bounded"&&(I(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),w(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),cy(e.tiers),ne(structuredClone(e))}function ZL(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function py(e,t,r){w(r.budget_tokens,"observation request budget_tokens");let n=[];for(let[o,i]of e.tiers.entries()){n.push(i.id);let s=await t(i),a=Buffer.byteLength(R(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:o>0,attempted_tiers:n,emitted_bytes:a,estimated_tokens:c,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:n,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function D(e,t){let r=e.split(".");if(r.some(n=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Xr(e,t){let r=e;for(let n of D(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function ly(e){return`/${D(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function uy(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function my(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);I(e.id,"verdict.id"),w(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){I(n.id,"verdict.predicates.id"),D(n.path,"verdict.predicates.path");let o=n.kind;if(o!=="field_equals"&&o!=="field_present"&&o!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${n.id}.`);if(t.has(n.id))throw new Error(`Duplicate verdict predicate: ${n.id}.`);uy(n),t.add(n.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(n=>!t.has(n)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function fy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(s=>[s.id,s])),n=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Xr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${ly(a.path)}`,evidence_digest:gt(R(c))}}),o=n.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?o===n.length:o>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:o/n.length,policy:"verdict_only_no_reward",predicates:n}}function e$(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(I(e.id,"episode.id"),w(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)I(t,"episode.task_item_ids");w(e.limits.max_actions,"episode.limits.max_actions"),w(e.limits.max_observations,"episode.limits.max_observations"),w(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)D(t,"episode.observable_fields");for(let t of e.withheld_fields)D(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(n=>t===n||t.startsWith(`${n}.`)||n.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return dy(e.observation),my(e.verdict),xe(e.recipe),ne(structuredClone(e))}function _y(e,t,r){let n=D(t,"observation projection field"),o=e;for(let[i,s]of n.entries()){if(i===n.length-1){r!==void 0&&(o[s]=structuredClone(r));return}let a=o[s];(a===null||typeof a!="object"||Array.isArray(a))&&(o[s]={}),o=o[s]}}function hy(e,t){let r={};for(let n of t)_y(r,n,Xr(e,n));return r}async function t$(e,t){let r=[],n=0,o=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let l=await t.readRecordedState(),f=await py(e.observation,async g=>hy(l.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??l.snapshot_id}),f},p=async(l=!1)=>{if(i&&!l)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let f=await t.readRecordedState(),g=fy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async l=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");n+=1;let f=await L(a,()=>t.execute(l));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,p),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>p(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Qr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Qr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Qr(t),t}var be=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],W=Object.freeze({scratch:K({schema:F,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:K({schema:F,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:be,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:be,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:be,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:be,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function gy(){return Object.keys(W).sort().map(e=>W[e])}function Cy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Jr=new WeakMap;function Zr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Jr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function yy(e,t,r,n=42){if(oe(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,p=s-d,l=d===0?void 0:i+(p+Math.floor((d-1)/e.hierarchy_fanout))*o,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,_=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),y=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...l===void 0?{}:{parent:`pm-s${l.toString(36).padStart(7,"0")}`},component:i,timestamp:_,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Zr(t,e),has_comment:y<e.comments_per_100_items,has_note:y<e.notes_per_100_items,has_learning:y<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var at=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let n of r)t[n]=(t[n]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Zr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,p=c*a+Math.max(0,a+d-100),l=c*a+Math.min(a,d),f=this.annotations[s];(f<p||f>l)&&n.push(`${s}:${f}!in[${p},${l}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:i.length===0,mismatches:i}}};function en(e){return new at(e)}function Sy(e,t){let r=en(e);for(let n of t)r.add(n);return r.finish()}async function Ty(){let e=De(process.cwd(),process.env.PM_PATH);await wt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}async function Ey(){await Rt()}var tn=["lines","branches","functions","statements"];function Ay(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function xy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function by(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,n]of Object.entries(e)){Ay(r,n);for(let o of tn){let i=xy(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}import Y from"node:fs";import ct from"node:path";var rn=300*1e3,wy=3;function S$(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function T$(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");Y.mkdirSync(e,{recursive:!0});let n=ct.join(e,r);Y.mkdirSync(n,{recursive:!0});let o=new Date;Y.utimesSync(n,o,o);let i=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(p){if(p instanceof Error&&"code"in p&&me(p))return[];throw p}}).sort((d,p)=>p.mtimeMs-d.mtimeMs||d.name.localeCompare(p.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<rn),a=Math.max(0,wy-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=rn).slice(a).map(d=>d.name).sort((d,p)=>d.localeCompare(p));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Oy}from"node:crypto";var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:dt,fingerprint:Oy("sha256").update(R({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Ry(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Ry(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ge([]);for(let o of e.kinds)t.register(o);let r=new q(e.nodes,e.edges,t),n=J(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function v(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let n=await e.read({...t,workspace:r});return X(t.signal),n===null?null:se(n)}async function we(e,t){let r=G(t.workspace,"workspace"),n=se(t.snapshot).snapshot,o=await v(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await v(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Py(e,t={}){let r=e.map(se),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Ge([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new q(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return J(i,o,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};function nn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function My(e){let t=nn(e.nodeCount,"nodeCount"),r=nn(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function on(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=xt(),o=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];U(await v(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:o});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await v(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),U((await v(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return U(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),U(await v(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function Iy(e){return on(new ie,e?{workspace:e}:{})}var pt=2,vy=["self_reported","independent_transport"];function Oe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function sn(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((n,o)=>{let i=ae(n,`${t}[${String(o)}]`);return r?n:i})}function lt(e,t){return e===void 0?void 0:ae(e,t)}function ky(e,t){if(e===void 0)return;if(!Oe(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function Ny(e,t,r,n,o,i){if(n==="refusal"){if(Ve(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=Ct(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let p=yt(t.slice(s+1));p!==void 0&&(a=ke(`history ${p}`))}let c=$t(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(p=>p===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Lt(a).kind;if(n!==d)throw new TypeError(`${e} expected ${n}, but ${a} declares ${d}`)}function Ly(e,t,r){if(!Oe(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=ae(e.id,`${n}.id`),i=sn(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Nt.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!vy.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let p=d;if(p==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let l=sn(e.required_fields,`${n}.required_fields`);if(l.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let f=ky(e.expected_field_values,`${n}.expected_field_values`),g=lt(e.expected_error_code,`${n}.expected_error_code`),_=lt(e.expected_refusal_surface,`${n}.expected_refusal_surface`),y=lt(e.recovery_for,`${n}.recovery_for`);return Ny(n,i,s,c,g,_),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:p,required_fields:l,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},..._?{expected_refusal_surface:_}:{},...y?{recovery_for:y}:{}}}function $y(e,t){if(!Oe(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),n=ae(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let o=e.steps.map((s,a)=>Ly(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function Q$(e){if(!Oe(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==pt)throw new TypeError(`agent-task transcript corpus version must be ${String(pt)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((n,o)=>$y(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:pt,tasks:t}}import{createHash as an}from"node:crypto";function cn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function rD(e,t){let r=cn(t.migrationId,"migrationId"),n=cn(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=qe(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=an("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=an("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),p=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),l=c.filter(f=>!p.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(l),edge_count:c.length,skipped_existing_count:c.length-l.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as dn from"node:module";var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},oD=Object.freeze(Object.keys(ut));function pn(e){if(Object.hasOwn(ut,e))return ut[e]}var Dy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Fy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function Gy(e){return e===void 0||e.kind==="punctuator"&&Dy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Uy(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function jy(e,t,r){if(e[t]!=="/"||!Gy(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function By(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Fy(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function qy(e){let t=[],r=0;for(;r<e.length;){let n=Uy(e,r);if(n!==void 0){r=n;continue}let o=jy(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=By(e,r);i.token&&t.push(i.token),r=i.next}return t}var zy=new Set(["object","block","pattern"]),Hy=new Set(["const","let","var"]),Vy=new Set(["}",")","]"]),Ky=new Set(["=","(","[",",",":","?","return"]);function Wy(e,t,r){if([...r].reverse().find(i=>zy.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Hy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Ky.has(o.value)?"object":"block"}function Yy(e,t,r){let n=e[t];if(n.value==="{"){let a=Wy(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function Xy(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function Jy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Qy(e){let t=qy(dn.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=Xy(s,i,t[o+1]);a&&s.candidates.push(a);let c=Yy(t,o,n);if(c)n.push(c);else if(Vy.has(i.value)){let d=n.pop();d?.kind==="object"&&!Jy(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function Zy(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
+ `&&t.push(r+1);return t}function eS(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function iD(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>Q(i.path,s.path))){let i=Zy(o.content),s;try{s=Qy(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=eS(i,a.offset),p=pn(c);p?t.push({path:o.path,line:d,field:c,kind:p.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(ce.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of ce)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?Q(o.path,i.path):o.line!==i.line?o.line-i.line:Q(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?Q(o.subject,i.subject):Q(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function sD(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>Q(c,d))){let c=pn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,p=[a].flat();d!==void 0&&p.forEach((l,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,_=g&&typeof l=="object"&&l!==null&&!Array.isArray(l)?l[g]:l;if(typeof _!="string"||_.trim().length===0)return;let y=[...i,s,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${y}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:_})}),n(a,[...i,s])}};return n(t,[]),r}function aD(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function cD(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=ce.map(c=>{let d=e.filter(l=>l.kind===c),p=d.filter(l=>!o.has(l.id)).map(l=>i.get(l.id)).filter(l=>l!==void 0);return{kind:c,declared:d.length,observed:p.length,passed:d.filter(l=>{let f=i.get(l.id);return!o.has(l.id)&&f?.reachable===!0&&f.semantics===l.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function tS(e,t){let r=new Map(ce.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=ce.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var dD=tS;var lD=16,rS=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),ln=18,un=Object.freeze([...rS,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function uD(e,t=ln){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function mD(e,t=un){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function mt(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function fD(e,t,r){let n=new Map(e.map(p=>[p.code,p.canonical_code??p.code])),o=new Map,i=0,s=0;for(let p of e){let l=mt(o,p.canonical_code??p.code);for(let f of p.owned_states??[])l.kinds.add("owned_state"),l.probeIds.add(f.probe_id)}for(let p of t){let l=n.get(p.error_code);if(l===void 0)continue;i+=1;let f=mt(o,l);f.kinds.add("closed_domain"),f.probeIds.add(p.probe_id)}for(let p of r){let l=n.get(p.error_code);if(l===void 0)continue;s+=1;let f=mt(o,l);f.kinds.add("grammar"),f.probeIds.add(p.probe_id)}let a=e.map(p=>{let l=p.canonical_code??p.code,f=o.get(l),g=[...f.probeIds].sort();return{code:p.code,canonical_code:l,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((p,l)=>p.code<l.code?-1:1),c=a.filter(({disposition:p})=>p==="uncovered").map(({code:p})=>p),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function _D(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${ln}`,`- Required executable canonical codes: ${un.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
+ `)}function nS(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function oS(e){return[e.exit_code!==ue.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${ue.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...nS(e)]}function CD(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of oS(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/r.size,findings:t}}var mn="not-a-declared-action";function iS(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function OD(e=je.filter(t=>Pt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((n,o)=>{if(!n.required)return[];let i=r.command.split(" "),s=de(r.command),a=i.length>1&&t.has(s)?i.map(de).join("--"):s,c=Z(r.command).flatMap(p=>p.required?[p.flag,...p.value_name?["example"]:[]]:[]),d=Ue.some(p=>p.command===r.command);return[{probe_id:`required-argument-${a}-${de(n.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,o).map(p=>iS(r.command,p)),...c],recovery_args:[...i,"--help"],error_code:d&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:n.name,missing_argument_index:o}]})).sort((r,n)=>r.probe_id.localeCompare(n.probe_id))}function sS(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function RD(e=je){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${de(t)}`,command:t,refusal_args:[...r,mn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mn,allowed_values:[...sS(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function aS(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function cS(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!aS(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function PD(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>cS(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}var ft=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function ID(){return ft.map(e=>({...e}))}function dS(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function vD(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of ft){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=dS(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:ft.length,closed_probe_count:n,findings:r}}var Re,pS=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function lS(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=pS[N(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Pe(){if(Re!==void 0)return Re;let t=ee.filter(({command:i})=>Be(i)).flatMap(({command:i,family:s})=>Mt(i,Z(i)).map(a=>({command:i,family:s,concept:lS(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Re=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Re}function FD(){return Object.freeze(Pe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fn=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":28,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),uS=1,_n=Object.freeze(Object.fromEntries(Object.entries({...fn,...Object.fromEntries(ve.flatMap(({alias:e,canonical:t})=>{let r=fn[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+uS])));function hn(){let e=new Map(Object.keys(_n).map(t=>[t,0]));for(let{command:t}of Pe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_n).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function mS(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function fS(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function _S(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function GD(e=Pe(),t=hn(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let p=i.get(c.concept);p!==void 0&&p!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${p} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let l=s.get(c.concept);l!==void 0&&l!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${l} and ${c.flag}.`}):s.set(c.concept,c.flag)}return mS(e,o,n),fS(a,t,n),_S(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function UD(){let e=Pe(),t=hn(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
34
+ `)}function BD(e){return e}function qD(e){return e}function zD(e){return e}function HD(e){return e}function VD(e){return e}function KD(e){return e}function WD(e){return e}function YD(e){return e}function XD(e){return e}function JD(e){return e}function QD(e){return e}function ZD(e){return e}function eF(e){return e}function tF(e){return{handled:!0,result:e}}function rF(){return{handled:!1}}function nF(e){return e}function oF(e){return e}function iF(e){return e}function sF(e){return e}function aF(e){return e}function cF(e){return e}function dF(e){return e}function pF(e){return e}function lF(e){return e}function hS(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function gS(e={},t={}){return new _e(t).packageMigrate(e)}function k(e){if(typeof e!="string"||!At(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function CS(e){let t=k(e.window_start),r=k(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(n=>typeof n!="string"||n.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function yS(e,t,r,n){let o=new Map(t.map(s=>[s,[]])),i=new Set;for(let s of e){if(typeof s.id!="string"||s.id.trim().length===0||i.has(s.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");i.add(s.id);let a=o.get(s.family);if(!a||!["success","failure","pending"].includes(s.outcome)||s.cause!==void 0&&(!["product","infrastructure","unknown"].includes(s.cause)||s.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=k(s.started_at);if(s.repaired_at!==void 0&&(k(s.repaired_at)<c||s.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<n&&a.push(s)}return o}function MF(e,t){let{start:r,end:n}=CS(t),i=[...yS(e,t.families,r,n)].map(([s,a])=>{let c=a.filter(_=>_.outcome==="failure"),d=a.filter(_=>_.outcome!=="pending").length,p=d===0?null:c.length/d,l=c.filter(_=>_.repaired_at!==void 0&&k(_.repaired_at)<n),f={product:0,infrastructure:0,unknown:0};for(let _ of c)f[_.cause??"unknown"]+=1;let g=[];return d<t.min_completed_attempts&&g.push("insufficient_completed_attempts"),p!==null&&p>t.max_failure_rate&&g.push("failure_rate"),{family:s,attempts:a.length,completed:d,failed:c.length,pending:a.length-d,failure_rate:p,affected_days:[...new Set(c.map(_=>new Date(k(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(k(_.repaired_at)-k(_.started_at))/6e4).sort((_,y)=>_-y),unresolved:c.length-l.length,causes:f,violations:g,ok:g.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(n).toISOString(),ok:i.every(s=>s.ok),families:i}}function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function SS(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let n=new Set(r.identities);if(n.size!==r.identities.length||[...n].some(o=>!pe(o)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,n)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function TS(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let n of e){if(n===null||typeof n!="object"||!pe(n.identity)||r.has(n.identity)||!pe(n.reason)||!pe(n.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let o=n.missing_from;if(!Array.isArray(o)||o.length===0||o.length>=t.length||new Set(o).size!==o.length||[...o].some(i=>!t.includes(i)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(n.identity,n)}return r}function vF(e,t=[]){let r=SS(e),n=[...r.keys()].sort(),o=TS(t,n),i=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),s=[],a=new Set;for(let d of i){let p=n.filter(g=>!r.get(g).has(d));if(p.length===0)continue;let l=o.get(d),f=l!==void 0&&JSON.stringify([...l.missing_from].sort())===JSON.stringify(p);f&&a.add(d),s.push({identity:d,present_in:n.filter(g=>r.get(g).has(d)),missing_from:p,disposition:f?{reason:l.reason,evidence:l.evidence}:null})}let c=[...o.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:s.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(n.map(d=>[d,r.get(d).size])),findings:s,stale_exceptions:c}}import{createHash as Cn,createHmac as ES,randomBytes as AS,timingSafeEqual as xS}from"node:crypto";var h1="dev.unbrained.pm/progressive-tool-discovery",g1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),bS=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),wS=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),OS=new Set(["core","standard","full","custom"]),Tn=new Set(ee.map(({family:e})=>e)),RS=AS(32);function Ie(e,t){if(typeof e!="string")throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function En(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new S("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function An(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new S("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function xn(e){if(e!==void 0&&typeof e!="boolean")throw new S("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function bn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new S("pm tool discovery options must be an object.",64)}function PS(e){if(!Array.isArray(e))throw new S("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new S(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new S(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new S(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new S(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new S(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function C1(e){if(bn(e),e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:En(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xn(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:An(e.outputBudget)}:{}}}function MS(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function le(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function IS(e,t){let r=le(e);if(r.length===0)return 0;let n=new Set(le(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function vS(e,t){let r=le(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=le(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function gn(e){return Cn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function wn(e,t,r){return ES("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function kS(e,t,r){let n={version:1,offset:t,signature:wn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function NS(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),i=o.offset;if(o.version!==1||typeof i!="number"||!Number.isInteger(i)||i<0||i>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(wn(t,i,n),"base64url"),a=Buffer.from(o.signature,"base64url");if(a.length!==s.length||!xS(a,s))throw new Error("cursor signature does not match the request");return i}catch(o){throw new S("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function _t(e,t,r){return{value:MS(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function LS(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=ze(n),i=`${e.name} ${e.description} ${n} ${o}`,s=IS(t,i),a=new Set(le(t)),c={lexical:_t(s,j.lexical,"computed"),semantic:Me(e.signals?.semantic,vS(t,i),j.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Me(e.signals?.freshness,1,j.freshness),usage:Me(e.signals?.usage,bS.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((p,l)=>p+l.value*l.weight,0);return{name:e.name,description:e.description,command:n,tier:He(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function $S(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new S("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!Sn.includes(e.tier)))throw new S("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!OS.has(e.profile)))throw new S("pm tool discovery profile must be core, standard, full, or custom.",64)}function DS(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let n=En(e.limit===void 0?10:e.limit),o=An(e.outputBudget===void 0?1200:e.outputBudget);return $S(e),{query:r,includeSchema:xn(e.includeSchema),limit:n,budget:o,maximumTier:yn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function On(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function FS(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>LS(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&yn[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function GS(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(On(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function y1(e,t={}){PS(e),bn(t);let r=DS(t),n=t.cursorIntegrityKey??RS,o=FS(e,t,r),i=gn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=NS(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:j},cache:{key:gn({fingerprint:i,cursorIntegrityKey:Cn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:wS}},p=(_,y=_.length)=>{let E=s+y,B=E<o.length,O=[...c];return y<a.length&&O.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[..._],returned:y,has_more:B,...B?{next_cursor:kS(i,E,n)}:{},omission_receipt:{has_omissions:O.length>0,omitted:O}}},l=_=>{let y=p(_),E=On(y,r.budget);return{...y,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=GS(a,r.budget,_=>p([],_)),g=l(f);if(a.length>0&&f.length===0){let _=l([a[0]]).token_cost.estimated_tokens;throw new S(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${_}.`,64,{required:String(_)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new S(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}export{lR as ACTIONABILITY_ORDERING_KINDS,td as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Cc as ACTIVITY_FLAG_CONTRACTS,ti as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,tv as ASSURANCE_ACTIONS,rv as ASSURANCE_DECLARATION_KINDS,uM as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,mM as ASSURANCE_GATE_TRIGGERS,fM as ASSURANCE_MEASUREMENT_SOURCE_KINDS,iI as ASSURANCE_PRESET_IDS,cM as AssuranceEvaluationRefusalError,aM as AssuranceMutationRefusalError,dM as AssuranceSourceResolutionError,Uo as BASELINE_ITEM_FORMAT_VERSION,pP as BOUNDARY_FIXTURE_CAPTURE_SOURCES,qR as BRIEF_LIST_FIELDS,ni as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,ri as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,po as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,jx as BUILTIN_RELATIONSHIP_KINDS,Qc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,qa as CLAIM_FLAG_CONTRACTS,Vd as CLOSE_ACTION_OPTION_KEYS,Ua as CLOSE_FLAG_CONTRACTS,ja as CLOSE_MANY_FLAG_CONTRACTS,Ya as CLOSE_TASK_FLAG_CONTRACTS,Ao as COMMAND_SHELL_ENV,na as COMMENTS_FLAG_CONTRACTS,ET as COMMON_MUTATION_COMMAND_OPTION_KEYS,Mc as COMPLETION_FLAG_CONTRACTS,ho as CONFIDENCE_TEXT_VALUES,Ca as CONFIG_FLAG_CONTRACTS,Zc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,Uv as CONTEXT_EVALUATION_METRIC_NAMES,Sc as CONTEXT_FLAG_CONTRACTS,ix as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,qt as CONTEXT_OUTPUT_VALUES,Hv as CONTEXT_PACKING_PROFILES,vv as CONTEXT_RECENCY_EPOCH,$v as CONTEXT_RELEVANCE_SERVICE,Nv as CONTEXT_RELEVANCE_SIGNAL_NAMES,Wv as CONTEXT_SIGNAL_SET_VERSION,Kv as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,Yv as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,WA as CONTEXT_USAGE_LIMITS,Pc as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,yd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Td as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Sd as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,zS as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,aE as CURRENT_HISTORY_HASH_ALGORITHM,Ox as CURRENT_HISTORY_ITEM_HASH_VERSION,Px as CURRENT_HISTORY_RECORD_HASH_VERSION,jo as CURRENT_ITEM_FORMAT_VERSION,Zv as ContextSignalStore,YA as ContextUsageValidationError,bv as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,hk as DEFAULT_CHILD_SAMPLE_LIMIT,BR as DEFAULT_COMPACT_LIST_FIELDS,Hw as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Lf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,tI as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,hv as DEFAULT_TERMINAL_TRANSITION_POLICY,nk as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,hP as DEFECT_ESCAPE_CLASSES,gP as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ha as DELETE_FLAG_CONTRACTS,mo as DEPENDENCY_KIND_VALUES,Ac as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,kI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,TP as DefectRecurrencePolicyParseError,bc as EVAL_FLAG_CONTRACTS,Rf as EVAL_METRIC_NAMES,vf as EVAL_QUERY_SET_CONTRACT,kf as EVAL_QUERY_SET_EXAMPLE,If as EVAL_QUERY_SET_SCHEMA_ID,yc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,$n as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Pa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ra as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,$a as EXTENSION_ADOPT_FLAG_CONTRACTS,Kk as EXTENSION_CAPABILITIES,BS as EXTENSION_CAPABILITY_CONTRACT,US as EXTENSION_CAPABILITY_CONTRACT_VERSION,jS as EXTENSION_CAPABILITY_LEGACY_ALIASES,Vi as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Ma as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Oa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,wa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ya as EXTENSION_FLAG_CONTRACTS,Ta as EXTENSION_INIT_FLAG_CONTRACTS,xa as EXTENSION_INSTALL_FLAG_CONTRACTS,va as EXTENSION_MANAGE_FLAG_CONTRACTS,Ia as EXTENSION_MIGRATE_FLAG_CONTRACTS,Wk as EXTENSION_POLICY_MODES,Yk as EXTENSION_POLICY_SURFACES,ka as EXTENSION_RELOAD_FLAG_CONTRACTS,Jk as EXTENSION_SANDBOX_PROFILES,Sa as EXTENSION_SCOPE_FLAG_CONTRACTS,Xk as EXTENSION_TRUST_MODES,ba as EXTENSION_UNINSTALL_FLAG_CONTRACTS,kP as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,IP as EXTERNAL_DEPENDENCY_SOURCE_KIND,vP as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,TO as ExtensionCommandError,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,nc as GC_FLAG_CONTRACTS,KR as GET_DEPTH_INPUT_VALUES,VR as GET_DEPTH_VALUES,Tc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,cu as GRAPH_DURABLE_CACHE_MIN_ITEMS,au as GRAPH_DURABLE_CACHE_VERSION,xc as GRAPH_FLAG_CONTRACTS,jR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,Ec as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,ua as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,JM as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,av as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,gi as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,iE as HISTORY_HASH_ALGORITHMS,kw as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,pa as HISTORY_REDACT_FLAG_CONTRACTS,la as HISTORY_REPAIR_FLAG_CONTRACTS,zp as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,Da as INSTALL_FLAG_CONTRACTS,_I as IN_PROGRESS_WORK_DETAIL_LIMIT,_o as ISSUE_SEVERITY_VALUES,lc as ITEM_COMPLETE_FLAG_CONTRACTS,xI as ITEM_LATEST_TIMESTAMP_FIELDS,qS as ITEM_METADATA_KEY_ORDER,pc as ITEM_MUTATE_FLAG_CONTRACTS,uc as ITEM_REOPEN_FLAG_CONTRACTS,Bs as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,js as ITEM_REVISION_CONFLICT_CODE,gI as ITEM_SCALAR_MISSING_VALUE,lo as ITEM_TYPE_VALUES,AI as ITEM_UNION_COLLECTION_FIELDS,Qv as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,sE as LEGACY_HISTORY_HASH_ALGORITHM,ll as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,Wu as LINKED_TEST_ENV_NAME_PATTERN,Yu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Ku as LINKED_TEST_PROTECTED_ENV_KEYS,Xu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Xc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,zR as LIST_COMMAND_DEFAULT_PROJECTIONS,Zk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,jP as LIST_SORT_FIELDS,BP as LIST_SORT_ORDER_VALUES,Ci as MAINTENANCE_HISTORY_OPERATIONS,_k as MAX_CHILD_PROJECTION_ITEMS,lP as MAX_WAIVER_NOTICE_DAYS,XS as MAX_WORKFLOW_POLICIES,JS as MAX_WORKFLOW_POLICY_TERMS,Xa as MEET_FLAG_CONTRACTS,$k as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,Gk as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,ed as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Oc as NEXT_FLAG_CONTRACTS,Xm as NEXT_OUTPUT_VALUES,xv as NEXT_RANKING_POLICIES,oa as NOTES_FLAG_CONTRACTS,OR as OutputEnvelopeFitError,Ea as PACKAGE_FLAG_CONTRACTS,Aa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,Hd as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,Xs as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,af as PLAN_TEMPLATE_NAMES,vy as PM_AGENT_TASK_ACCOUNTING_MODES,pt as PM_AGENT_TASK_TRANSCRIPT_VERSION,vn as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ps as PM_CLI_ERROR_DETAILS_LIMITS,hs as PM_CLI_EXPECTED_ERROR_NAME,eP as PM_CLI_GRAMMAR_CONTRACT,YR as PM_CLI_GRAMMAR_NOUNS,Yn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,XR as PM_CLI_SHARED_VERBS,Ln as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Pt as PM_COMMAND_DESTINATION_CONTRACTS,rM as PM_COMMAND_EXIT_CONTRACTS,tM as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Mi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,QP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,mp as PM_COMMAND_VISIBILITY_CONTRACTS,HM as PM_COMPLETE_LIST_FINDING_CODES,yR as PM_CONTEXT_INTENTS_FILE,sx as PM_CONTEXT_INTENT_CONTRACTS,In as PM_CONTEXT_OPS_COMMAND_ALIASES,Hn as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jn as PM_DEPRECATED_TOOL_ACTIONS,bi as PM_DIAGNOSTIC_DEGRADATION_STEPS,wi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,xi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qn as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,XP as PM_ERROR_CODE_CATALOG,VP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,tn as PM_EXACT_COVERAGE_METRICS,Gn as PM_EXTENSION_CAPABILITY_CONTRACTS,Vn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jn as PM_EXTENSION_POLICY_MODE_CONTRACTS,zn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,qn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Un as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bn as PM_EXTENSION_TRUST_MODE_CONTRACTS,$i as PM_GENERIC_REFUSAL_GUIDANCE,$M as PM_GITATTRIBUTES_END,LM as PM_GITATTRIBUTES_START,FM as PM_GITATTRIBUTES_V2_END,DM as PM_GITATTRIBUTES_V2_START,Tp as PM_GITIGNORE_END,Sp as PM_GITIGNORE_START,lv as PM_HISTORY_ATTESTATION_CONTRACT,Mn as PM_HISTORY_COMMAND_ALIASES,ZT as PM_HISTORY_OPERATION_ALIASES,tE as PM_HISTORY_OPERATION_CONTRACT,eE as PM_HISTORY_OPERATION_PATTERNS,Wn as PM_ITEM_ACTION_SUBCOMMANDS,JT as PM_ITEM_HISTORY_OPERATIONS,nt as PM_MCP_APPS_EXTENSION,vr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,Lr as PM_MCP_APP_CONTRACTS,Nr as PM_MCP_APP_MIME_TYPE,bS as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,fL as PM_MCP_HTTP_PROTOCOL_VERSION,Wg as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,nr as PM_MCP_LOG_LEVELS,x as PM_MCP_META_KEYS,h1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,g1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Cp as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,gp as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,ey as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,sL as PM_MCP_TASKS_EXTENSION,iC as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,jE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Ss as PM_MUTATION_ACTION_CONTRACTS,ve as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,Ai as PM_OUTPUT_BUDGET_CLASSES,Ei as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Kn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Zd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Jd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,CA as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,LA as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,hA as PM_READ_OUTPUT_DIMENSIONS,gA as PM_READ_OUTPUT_OPTION_FLAGS,lA as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,pA as PM_READ_OUTPUT_SESSION_MIN_TOKENS,DE as PM_READ_OUTPUT_SURFACES,yA as PM_READ_OUTPUT_SURFACE_CONTRACTS,aA as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,UE as PM_READ_ROW_CONTRACTS,GE as PM_READ_ROW_JQ_SELECTOR,Ui as PM_RECOVERY_ECHO_FIELDS,oD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,rS as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,un as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,lD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,ln as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,kn as PM_RELOCATED_COMMAND_ALIASES,_d as PM_REPRODUCIBLE_PROCESS_ENV,nM as PM_SUCCESS_EXIT_CODES,Xn as PM_TOOL_ACTIONS,Kd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Qd as PM_TOOL_PARAMETERS_SCHEMA,Xd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Yd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,qd as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,QT as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,_a as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Qt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,S as PmCliError,_e as PmClient,VM as PmCompleteListValidationError,C as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,KA as QUERY_CURSOR_CONTRACT,EA as READ_OUTPUT_MUTATION_CONFLICT_CODE,AA as READ_OUTPUT_SHAPING_CONTROL_FLAGS,TA as READ_OUTPUT_SURFACE_UNSUPPORTED_CODE,Ga as REINDEX_FLAG_CONTRACTS,bw as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Va as RELEASE_FLAG_CONTRACTS,Qa as REMIND_FLAG_CONTRACTS,bt as RESERVED_ITEM_FIELD_NAMES,za as RESTORE_FLAG_CONTRACTS,fo as RISK_VALUES,PR as RelationshipEventLog,MR as RelationshipEventStore,q as RelationshipGraph,Ge as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,Jc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,eN as SEARCH_EXTENSION_FLAG_DEFINITIONS,Rc as SEARCH_FLAG_CONTRACTS,As as SECRET_GUARD_RULE_CATEGORIES,fm as SEMANTIC_ATTRIBUTION_LIMITS,VS as SETTINGS_DEFAULTS,Uf as SNAPSHOT_SCHEMA,vM as SOURCE_CONTEXT_ACCESS_ENV,kM as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Qm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Ns as STALE_WORK_THRESHOLD_SETTING,ym as START_BLOCKED_REFUSAL_CODE,Cm as START_BLOCKER_ENFORCEMENT_DEFAULT,Ka as START_TASK_FLAG_CONTRACTS,oc as STATS_FLAG_CONTRACTS,uo as STATUS_VALUES,Zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,yi as SUBSTANTIVE_HISTORY_OPERATIONS,Rx as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Mx as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,NE as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,f_ as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Za as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,d_ as TEST_RUN_MEASUREMENT_LIMIT,Gd as TOOL_ACTIVITY_OPTION_CONTRACTS,Od as TOOL_AGGREGATE_OPTION_CONTRACTS,Ld as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Fd as TOOL_CALENDAR_OPTION_CONTRACTS,Dd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ud as TOOL_CONTEXT_OPTION_CONTRACTS,vd as TOOL_CREATE_OPTION_CONTRACTS,Id as TOOL_CREATE_OPTION_CONTRACT_SOURCE,jd as TOOL_DEPS_OPTION_CONTRACTS,Bd as TOOL_GRAPH_OPTION_CONTRACTS,wd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Rd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Md as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Pd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,$d as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Nd as TOOL_UPDATE_OPTION_CONTRACTS,kd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,HS as TYPE_TO_FOLDER,YT as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,$O as UNPROVEN_ACTIVITY_REASONS,Ed as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,xd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ad as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,Io as URL_CREDENTIAL_PLACEHOLDER,ac as VALIDATE_FLAG_CONTRACTS,YS as WORKFLOW_POLICY_ACTIONS,jM as WORKFLOW_POLICY_DOCUMENT_SCHEMA,UM as WORKFLOW_POLICY_SCHEMA,wc as WORKSPACE_FLAG_CONTRACTS,zb as WORKSPACE_HISTORY_ID,jf as WORKSPACE_SNAPSHOT_ACTIONS,al as WorkspaceGraphCache,LR as WorkspaceTransactionInterruptedError,Du as _testOnly,fk as _testOnlyAggregateCommand,il as _testOnlyConfigCommand,Sk as _testOnlyGetCommand,Au as _testOnlyHealthCommand,Wp as _testOnlyInit,Hp as _testOnlyInitAgentGuidance,_N as _testOnlyItemTransaction,qk as _testOnlyMutationEvents,lk as _testOnlyNextCommand,Lk as _testOnlySearchCommand,nI as _testOnlySimilarity,uf as _testOnlyTemplates,Nu as _testOnlyValidateCommand,Vk as _testOnlyWorkspacePosition,gN as abandonItemTransaction,UR as abandonWorkspaceTransaction,dI as acceptAssuranceProposals,vu as acknowledgeLinkedTests,rl as acknowledgeUnknownAuthorHistoryEvents,tl as acknowledgeUnknownAuthorHistoryEventsFromTransport,Vw as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,ei as acquireLockLease,WN as activateExtensionForTest,ab as activateExtensions,Tm as admitStartWithOpenBlockers,Zo as agentSessionEnvironment,_h as aggregate,Qf as analyzeAgentProvenanceDescriptorCoverage,yP as analyzeDefectChangeRisk,ev as analyzeDefectRecurrenceCoverage,Nl as analyzeDuplicateItems,vR as analyzeGraphImpact,np as analyzeHierarchyIntegrity,kR as analyzeKnowledgeGraph,iM as analyzePmCommandExitConformance,Zn as analyzePmToolActionParity,jI as analyzeReconciliationDiscard,IR as analyzeRelationshipExecution,Zl as analyzeRelationshipSchedule,Ug as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,xA as annotationPositionalMutationOptions,Oh as append,qi as appendHistoryEntry,Wb as appendWorkspaceAuditEvent,Kb as appendWorkspaceHistoryChange,cT as applyAcceptanceCriteriaMutations,aI as applyAssurancePreset,qc as applyBootstrapPagerPolicy,YI as applyClosureTimestampFix,lx as applyContextIntentProjection,Ym as applyContextTagProjection,qP as applyFilterValueEcho,Pw as applyHistoryPatch,fd as applyInvocationAuthorOverride,Sl as applyPathMigrations,IA as applyReadOutputDimensions,OA as applyReadOutputIncludeModes,mA as applyReadOutputSessionReferences,kb as applyRegisteredItemFieldDefaultsAndValidation,xl as applyStandaloneNote,$c as applyStoredExtensionMigrationState,pT as applyTagRemovals,Sv as applyTerminalOrderingPolicy,bl as artifactKey,DT as asRecordClone,$T as asRecordOrNull,qe as assembleWorkspaceRelationshipGraph,XM as assertCompleteListResult,R0 as assertExtensionBlueprint,O0 as assertExtensionCapabilityUsage,d0 as assertExtensionDeactivated,I0 as assertExtensionManifestCompatible,M0 as assertExtensionManifestMatchesBlueprint,v0 as assertExtensionPreflight,sp as assertHierarchyMutationAllowed,cv as assertHistoryCompactTarget,qI as assertHistoryRepairTarget,is as assertInitializedTracker,Tl as assertLinkedArtifactMutationIsUnambiguous,D0 as assertMcpClientCapabilities,$0 as assertMcpProtocolHeader,Iy as assertMemoryRelationshipGraphAdapterConformance,mT as assertNoUnknownCsvKeys,Hu as assertNonHierarchyCardinalityMutationAllowed,p0 as assertPackageManifest,nw as assertParentReferenceIsNotSelf,zL as assertPmMcpSkillsCapability,P0 as assertProjectProfile,jw as assertProjectRuntimeCompatibility,Dw as assertProjectRuntimeFormatGuard,BE as assertProjectionModeChoice,os as assertReadableTrackerRoot,l0 as assertRegisteredCommandContract,T0 as assertRegisteredCommandOverride,g0 as assertRegisteredExporter,u0 as assertRegisteredFlags,m0 as assertRegisteredHook,h0 as assertRegisteredImporter,C0 as assertRegisteredItemField,y0 as assertRegisteredItemType,w0 as assertRegisteredMigration,E0 as assertRegisteredParserOverride,A0 as assertRegisteredPreflightOverride,S0 as assertRegisteredProfile,x0 as assertRegisteredRendererOverride,f0 as assertRegisteredSearchProvider,b0 as assertRegisteredServiceOverride,_0 as assertRegisteredVectorStoreAdapter,Hx as assertRelationshipEdgeAllowed,on as assertRelationshipGraphAdapterConformance,sT as assertSchemaPreviewSupported,g_ as assertTestMeasurementRun,Ex as assertWellFormedOutputText,_M as assuranceAssertionUpdateIsLoosening,fx as attachContextIntentReceipt,XA as attachContextUsageServingReceipt,Ru as attachLinkedTestMutationProvenance,Ou as attachLinkedTestProvenance,Xe as attachMcpServerInfo,WE as attachOutputOmissionReceipt,hx as attachOutputTokenAccounting,_x as attachReadOutputContracts,fA as attachReadOutputSessionReceipt,Rp as auditMergeAttributeFence,GM as auditMergeDriverConfiguration,iu as auditWorkspaceRelationshipGraph,PL as authorizeMcpHttpRequest,Jo as boundAgentEpisodeIdentity,nA as boundReadOutputRows,Hm as buildChildrenByParent,Pk as buildCompactSearchFilterSummary,zP as buildContentFilterEcho,Jv as buildContextSignalSnapshot,yy as buildCorpusShapeItemPlan,CP as buildDefectRecurrenceIndex,Fp as buildExtensionDescribeResult,Up as buildExtensionInstallPlan,HP as buildGovernanceMissingFilterEcho,Tu as buildInProgressSweepCommands,hI as buildInProgressWorkHealthSummary,mw as buildInvalidTypeError,gk as buildItemChildrenRollup,mN as buildItemCompletionMutations,Lv as buildItemContextRelevanceCandidates,Qw as buildItemNotFoundError,yk as buildItemSchedule,XI as buildLinkedFileRepairReport,SL as buildMcpAuthorizationDiscoveryUrls,zg as buildMcpCompleteResult,G0 as buildMcpDiscoverResult,bL as buildMcpDynamicRegistrationMetadata,uL as buildMcpHttpRequestHeaders,K0 as buildMcpInputRequiredResult,yL as buildMcpProtectedResourceMetadata,wp as buildMergeAttributePatterns,Wd as buildPmActionToolInputSchema,fD as buildPmRefusalClosureCensus,rI as buildRelationshipContext,nO as buildSearchCorpus,iO as buildSemanticCorpusInput,VI as buildStatusRoleWarnings,ns as buildTrackerInitializationRecovery,pO as buildVectorizationEmbeddingIdentity,lO as buildVectorizationEmbeddingMetadata,Mk as buildVerboseSearchFilters,BM as buildWorkflowCompletenessCheck,ok as buildWorkspaceMemorySnapshot,Om as callerClaimEndedByClose,Xo as canonicalDocument,AT as canonicalizeCommandOptionKey,MN as canonicalizeCommandSuggestions,kv as canonicalizeContextRecencyCoordinate,Bx as canonicalizeRelationshipKind,iD as censusPmRecoveryReferenceProducers,YM as certifyCompleteListResult,VN as checkExtensionManifestCompatibility,pg as claim,lg as claimNext,QM as classifyHistoryAuthorEvent,Si as classifyHistoryEvent,GI as classifyHistoryMergeReceiptReferences,Zx as classifyHostEnvironmentFault,vk as classifyImplicitSemanticFallbackReason,zo as classifyItemFormatVersion,y_ as classifyLinkedTestCommandSafety,S_ as classifyLinkedTestFailure,xb as clearActiveExtensionHooks,mu as clearDurableGraphCache,EE as clearFocusedItem,w_ as clearWorkspaceContractsCache,dg as close,Uu as closeItem,yg as closeTask,Vc as coalesceRepeatedListFlags,uR as collectBlockedByIds,fR as collectBlockedByIdsFromCorpus,QA as collectContextUsageDeliveredItemIds,pp as collectDanglingDependencyReferences,hR as collectDependencyBlockedIds,cp as collectDuplicateDependencyRows,ou as collectDuplicateRelationshipEdgeGroups,Ik as collectErrorCauseCodes,rp as collectHierarchyRelations,Ar as collectMcpHeaderAnnotations,lp as collectMissingDependencyTargetIds,zu as collectNewOrderingCycleWarnings,tu as collectOrderingCycles,dp as collectOrderingStorageContradictions,ER as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,Ib as collectRegisteredItemFieldNames,fE as collectRuntimeCreateFieldValues,fw as collectRuntimeFilterValues,_E as collectRuntimeUpdateFieldValues,Um as collectSubtreeIds,Ki as collectUsedExtensionCapabilities,xT as commandOptionFlagLabel,Ch as comments,J_ as commitImportedItem,fN as commitItemCompletion,uN as commitItemMutations,DR as commitWorkspaceTransaction,Qs as compactFlagAliasContracts,jm as compareCriticalItems,Nw as comparePmDateVersions,NR as compareRelationshipSnapshots,FT as compareTimestampStrings,Mv as compileHistoryProvenanceMatcher,dx as composeContextIntentContracts,GN as composeExtension,HN as composeExtensionPackage,CR as computeActionabilityReport,jb as computeHistoryDiff,Jl as computeRelationshipCentrality,Xl as computeRelationshipDominators,sl as computeWorkspaceGraphFingerprint,Ph as config,Ab as consumeAfterCommandAffectedItems,dh as context,mx as contextIntentRowId,mg as copy,Vu as countFailureCategories,tA as countReadOutputRows,sg as create,sI as createAssurancePreset,QI as createAssuranceWorkspaceContext,UT as createCheckpointId,KM as createCompleteListOptions,cb as createCoreCommandHookContext,en as createCorpusShapeMeasurement,SM as createEmptyAssuranceDocument,Xx as createEmptyExtensionRegistrationRegistry,EO as createExtensionCommandError,kc as createExtensionCommandSdk,Hi as createExtensionContributionInventory,k0 as createExtensionTestHarness,Bi as createHistoryEntry,WO as createLazyModule,qM as createLifecycleCompletenessPolicies,ML as createMcpStaticBearerVerifier,aL as createMcpTaskStore,Jw as createMutationGuardSdk,qE as createOutputOmissionReceipt,Cs as createPmCliExpectedError,Ys as createPmCliProgram,Ri as createPmCommandOutputBudget,UA as createQueryFingerprint,My as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,xt as createRelationshipKindRegistry,gd as createReproducibleProcessRunner,Ok as createSearchCursorFingerprint,db as createSerialQueue,yT as createStdinTokenResolver,XT as createUnknownSubcommandError,iT as createWorkflowPolicyEvaluator,Bf as createWorkspaceSnapshot,YN as deactivateExtensionForTest,bs as decideSecretGuardFinding,rF as declineServiceOverride,ux as decodeContextIntentCursor,KO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,Cx as decodePmTableRows,zA as decodeQueryCursor,BA as decodeQueryCursorEnvelope,qA as decodeQueryCursorState,FA as decodeReadOutputContinuationCursor,N0 as decodeToon,LL as decoratePmMcpToolsWithApps,Ol as dedupeLinkedArtifacts,Nb as defaultConfigScope,Dv as defaultScoreContextCandidates,cF as defineAfterCommandHook,sF as defineBeforeCommandHook,aF as defineBeforeMutationHook,zD as defineCommand,JD as defineCommandOverride,K as defineCorpusShape,e$ as defineEpisodeSpecification,iF as defineExporter,DN as defineExtension,FN as defineExtensionBlueprint,BD as defineExtensionManifest,HD as defineFlag,oF as defineImporter,KD as defineItemField,VD as defineItemType,WD as defineMigration,dy as defineObservationContract,lF as defineOnIndexHook,pF as defineOnReadHook,dF as defineOnWriteHook,QD as defineParserOverride,Pi as definePmCommandOutputBudget,JP as definePmCommandOutputEnvelope,KP as definePmErrorCodeCatalog,ZD as definePreflightOverride,qD as defineProjectProfile,nF as defineRendererOverride,YD as defineSearchProvider,eF as defineServiceOverride,XD as defineVectorStoreAdapter,my as defineVerdictContract,xe as defineWorkspaceRecipe,fg as deleteItem,Wf as deleteWorkspaceSnapshot,Vx as dependencyToRelationship,bh as deps,cI as deriveAssuranceProposals,KI as deriveClosureTimestamp,jN as deriveExtensionCapabilities,tN as deriveMutationTransactionId,sM as derivePmBulkMutationEffect,sD as derivePmRecoveryReferenceObligations,eu as deriveRelationshipDeadlines,vp as deriveSchemaEvolutionMigrationId,RO as deriveTelemetryCommandResolution,Cw as describeAllowedTransitions,IM as describeExtensionActivation,BN as describeExtensionBlueprint,Go as describeFieldFlagSpellingDefect,KT as describeFlagScalarValueFailure,wm as describeItemOwnershipConflict,Vs as describeItemRevisionChanges,ZL as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,SN as describeReadCompletenessControls,AO as describeUnknownError,pi as detectAgentIdentity,fi as detectHarnessIdentity,Wl as detectRelationshipCommunities,li as diagnoseAgentIdentity,su as diffRelationshipAuditSnapshots,u_ as diffTestRunMeasurements,X0 as digestMcpRequestParameters,ib as discoverExtensions,yo as discoverNearbyPmRoot,y1 as discoverPmTools,$w as discoverProjectRuntimeVersionPins,xh as docs,gh as duplicates,du as durableGraphCachePath,fu as durableGraphCacheStatus,Bo as effectiveItemFormatVersion,sR as emitTelemetryErrorEvent,X_ as emptyImportedDocument,yI as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,gx as encodePmTableRows,jA as encodeQueryCursor,DA as encodeReadOutputContinuationCursor,L0 as encodeToon,Bb as enforceHistoryStreamPolicyForItem,qb as enforceHistoryStreamPolicyForItems,cP as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,Iw as ensureMaterializedHistoryTarget,Ap as ensurePmGitignore,_l as ensureScope,SO as ensureSentryCommandTracing,yO as ensureSentryInit,Y_ as ensureTrackerInitialized,Vl as enumerateRelationshipPaths,vi as estimatePmOutputTokens,EM as evaluateAssuranceAssertion,AM as evaluateAssuranceGate,_P as evaluateBoundaryFixtures,Am as evaluateClaimActivity,jv as evaluateContextRanking,SP as evaluateDefectGateEvidence,TM as evaluateMeasurement,Mf as evaluateMetricFloors,Es as evaluateMutationGuard,o_ as evaluateProvenanceCoverage,MF as evaluateReliabilityWindow,t_ as evaluateSemanticAttributionCoverage,$l as evaluateSimilarityGovernance,gw as evaluateTransition,fy as evaluateVerdictContract,oT as evaluateWorkflowPolicies,ds as executeEmbeddingBatchesWithRetry,cO as executeVectorDelete,dO as executeVectorReset,aO as executeVectorUpsert,iy as executeWorkspaceRecipe,Al as expandAddGlobEntries,Fl as explainSourceTraceability,mv as exportAttestation,Sg as extension,Eg as extensionActivate,Ag as extensionDeactivate,Tg as extensionList,hS as extensionMigrate,FI as extractHistoryMergeReceiptDispositions,DI as extractHistoryMergeReceiptReferences,wL as extractMcpTraceContext,Ow as extractPatchFailureContext,xu as extractReferencedPmItemIdsFromCommand,Py as federateRelationshipGraphSnapshots,Th as files,Eh as filesDiscover,Ah as filesLookup,ZA as finalizeContextUsageDelivery,by as findCoverageDeficits,Ll as findDuplicateClusters,bp as findGitWorkspaceRoot,wE as findHistoryIdentityDiscontinuities,$p as findInstalledNpmPackageCandidate,NL as findPmMcpAppByUri,Nn as findPmNamespacedCommand,Yl as findRedundantRelationshipEdges,Ql as findRelationshipCutStructure,kl as findSimilarItems,iR as finishTelemetryCommand,RR as fitOutputEnvelope,VT as flattenFlagListValue,Ey as flushTelemetryQueue,hg as focus,Kl as forEachMatchedRelationshipEdge,nu as formatDuplicateEdgeGroup,op as formatHierarchyRelation,ru as formatOrderingStorageContradiction,ZR as formatPmPositionalActionFlagTip,xf as formatProfileApplyHuman,Af as formatProfileLintHuman,Tf as formatProfileListHuman,Ef as formatProfileShowHuman,Lp as formatSchemaEvolutionMigrationHuman,Nk as formatVectorIndexRecoveryWarnings,Hk as formatWorkspacePositionHuman,eg as gc,es as generateItemId,mh as get,Sb as getActiveCommandResult,ax as getActiveContextIntentContracts,Yi as getActiveExtensionRegistrations,RL as getActiveMcpTraceContext,bM as getAssuranceDeclaration,$g as getContracts,SE as getFocusedItem,Eo as getHistoryPath,wR as getItemAt,To as getItemPath,Rs as getMutationActionContract,Ep as getPmGitignoreBlock,So as getSettingsPath,O_ as getWorkspaceContracts,Hb as getWorkspaceHistoryPath,wh as graph,pu as graphAuditBaselinePath,r_ as groupHistoryByEpisode,tF as handleServiceOverride,F0 as hasMcpClientExtension,kL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,uO as hasVectorizationEmbeddingIdentityChanged,mO as hasVectorizationVectorDimensionChanged,Fx as hashDocument,Gx as hashDocumentForVersion,Ux as hashEmptyDocument,vx as hashHistoryPatch,Ix as hashHistoryRecord,kx as hashHistoryStream,SI as hashItemScalarDecisionValue,Zh as health,Bl as hierarchyAncestors,ql as hierarchyDescendants,og as historyCompact,ig as historyCompactBulk,dE as historyDigest,Pv as historyEntryMatchesProvenance,Lw as historyItemHashVersionForRuntime,tg as historyRedact,rg as historyRepair,ng as historyRepairAll,mR as indexBlockedByIds,ip as indexHierarchyRelations,fO as inferConsistentVectorDimension,Oi as inferPmOutputBudgetClass,Rh as init,WM as inspectCompleteListResult,Jx as inspectExtensionManifestSchema,Xp as inspectHistoryAuthorStream,$s as inspectInProgressWork,RI as inspectMergeReceiptEvidence,Uw as inspectProjectRuntimeCompatibility,Ds as inspectStaleInProgressItems,jg as inspectStaticExtensionInventory,HI as inspectStatusRoleAssignments,Vb as inspectWorkspaceHistoryState,qf as inspectWorkspaceSnapshot,Ip as installMergeFence,U0 as interpretMcpResultType,Zm as isAlreadyClaimedError,wO as isCommanderError,AN as isCompatibleRecoveryFlag,dd as isErrnoError,cR as isExternalDependencyReference,dR as isExternalDependencySourceKind,me as isFileMissingError,Di as isGenericRefusalRequired,Fi as isGenericRefusalWhy,$E as isHostOutputSuppressed,gs as isItemAlreadyExistsError,Ks as isItemRevisionConflict,CI as isItemScalarMissingValue,jO as isJudgeableHistoryRecord,NI as isLegacyMergeReceiptSummary,h as isMcpRecord,ws as isMutationAction,zx as isOrderingRelationshipKind,tw as isPlaceholderReferenceToken,ls as isPmCliErrorDetails,ys as isPmCliExpectedError,to as isPmExtensionCapabilityContract,no as isPmExtensionPolicyModeContract,oo as isPmExtensionPolicySurfaceContract,ro as isPmExtensionServiceNameContract,oM as isPmKnownExitCode,ZP as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,_s as isPmTokenBudgetRecovery,eo as isPmToolAction,LI as isPreDurableCloneLocalReceiptSummary,$I as isPreDurableDispositionEligibleReference,Gw as isProjectMutatingInvocation,YO as isPureSnakeCaseAlias,kA as isReadOutputBudgetExceeded,dA as isReadOutputSessionReference,EN as isReadProjectionRecoveryFlag,vA as isReadResultOmittedForBudget,HE as isReadRowContract,ep as isRuntimeRecord,Tw as isSettingsReadFallback,Sm as isStartTransition,QO as isTerminalPlanMode,gE as isTerminalStatus,$o as isTimestampLiteral,uP as isWaiverNoticeDays,UO as isWellFormedHistoryRecord,sN as itemDocumentToMutationOptions,Ck as itemHasSchedule,Ti as jaccardSimilarity,zO as latestHistoryTimestamp,Sh as learnings,WT as levenshteinDistanceWithinLimit,sd as limitAnnotationEntries,Pu as linkedTestTrustFingerprint,qN as lintExtensionBlueprint,Qx as lintExtensionManifestSchema,er as lintProjectProfile,ph as list,ii as listAgentProvenanceAdapters,Hc as listAliasPluralKeys,lh as listAllComplete,Yw as listAllDocumentCandidatesCached,cs as listAllItemMetadata,Xw as listAllItemMetadataLight,xM as listAssuranceDeclarations,MM as listAssuranceVerdicts,gy as listBuiltinCorpusShapes,IN as listCoreClosedDomainContracts,WR as listGetProjectionFields,mI as listInvalidProvenanceHistoryStreamIds,HR as listListProjectionFields,PI as listMergeReceipts,Os as listMutationActions,Uk as listMutationEvents,hn as listPmCommandFlagBudgets,_p as listPmCommandsForFamily,fp as listPmCommandsForTier,Pe as listPmFlagLexicon,FD as listPmFlagSpellingInventory,hp as listPmMcpToolsForProfile,OD as listPmRequiredArgumentRefusalContracts,RD as listPmSubcommandRefusalContracts,Yt as listProfiles,ID as listTrackerPreflightRecoveryContracts,dN as listUpsertKeyCandidates,zf as listWorkspaceSnapshots,AR as loadContextIntentRuntimeLayers,mf as loadCreateTemplateOptions,sb as loadExtensions,hu as loadGraphAuditBaseline,pN as loadGuardedRuntimeSchema,BT as loadMutationCheckpoint,v as loadRelationshipGraphAdapter,ss as locateItem,uT as looksLikeGenericKeyValueEntry,rA as mapReadOutputRows,MI as markMergeReceiptReconciled,_w as matchesRuntimeFilters,nR as maybeRunFirstUseTelemetryPrompt,Sy as measureCorpusShapePlan,rs as measureItemMetadataReadWork,dT as mergeAdditiveTags,UN as mergeExtensionBlueprints,TI as mergeHistoryStreams,bI as mergeItemDocuments,wI as mergeJsonDocuments,Kc as mergeLinkedTestTwoTokenEntries,EI as mergeRelationshipEventStreams,Km as mergeSortedWarnings,JO as migrateItemFilesToFormat,eO as mutateItem,Zw as mutateItemWithHistoryContext,Yb as mutateWorkspaceJsonWithHistory,fh as next,ai as normalizeAgentProvenanceAdapterValue,id as normalizeAnnotationTransportOptions,lM as normalizeAssuranceEvaluation,pM as normalizeAssuranceMutation,Wc as normalizeBootstrapInvocation,Fb as normalizeBulkIdsValue,ap as normalizeDependencyGraphTarget,DP as normalizeDependencySeedId,$P as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,qs as normalizeExpectedItemHash,zi as normalizeExtensionContributionInventory,oE as normalizeHistoryOperationForWrite,uI as normalizeInvalidHistoryProvenance,aP as normalizeItemAddressInvocation,qo as normalizeItemFormatVersion,Zi as normalizeItemId,Ko as normalizeItemMetadata,FP as normalizeItemReference,zc as normalizeLegacyExtensionActionSyntax,El as normalizeLinkedPath,ew as normalizeParentReferenceValue,Kt as normalizeProfileName,Qi as normalizeRawItemId,RA as normalizeReadOutputIncludeModeOptions,ME as normalizeReplayPatchOps,Ps as normalizeSimilarityText,DO as normalizeStaleWorkThresholdHours,hE as normalizeStatusForRegistry,Vo as normalizeStatusInput,lE as normalizeStatusInputWithRegistry,bO as normalizeThrownExitCode,yh as notes,Lo as nowIso,lu as openDurableGraphCache,Y0 as openMcpRequestState,t$ as openPmEpisode,zl as orderingPredecessors,Hl as orderingSuccessors,Vv as packContextCandidates,Bm as packRankedContextItems,kg as packageActivate,vg as packageCatalog,Ng as packageDeactivate,Mg as packageDescribe,Rg as packageDoctor,wg as packageInstall,xg as packageLifecycle,bg as packageList,Pg as packageManage,gS as packageMigrate,Ig as packageReload,Og as packageUninstall,VA as paginateQueryRows,hl as parseAddEntries,gl as parseAddGlobEntries,cd as parseAnnotationTextInput,rN as parseAtomicMutationControls,Bc as parseBootstrapCommandName,Gc as parseBootstrapGlobalOptions,jc as parseBootstrapHelpRequest,Yc as parseBootstrapTypeValue,Db as parseBulkIdsText,Fm as parseContextDepth,Nm as parseContextFocusFields,SR as parseContextIntentDeclarations,Gm as parseContextSections,Xv as parseContextSignalSnapshot,lT as parseCsvKv,AP as parseDefectChangeRiskRequest,ZI as parseDefectRecurrenceCoverageRequest,EP as parseDefectRecurrencePolicy,Pf as parseEvalMetricFloors,Nf as parseEvalQuerySet,zs as parseExpectHashSpecs,vT as parseExtensionLongFlagToken,yu as parseGraphSubcommand,uv as parseHistoryAttestation,Ov as parseHistoryProvenanceFilters,xP as parseIntegerLimit,CE as parseItemDocument,nN as parseItemMutationBatch,uw as parseLimit,im as parseLinkedTestAssertionEqualsMap,sm as parseLinkedTestAssertionGteMap,Zu as parseLinkedTestBoolean,em as parseLinkedTestContextMode,Qu as parseLinkedTestEnvClear,Ju as parseLinkedTestEnvSet,am as parseLinkedTestJsonEntries,om as parseLinkedTestMinLines,nm as parseLinkedTestRegexList,rm as parseLinkedTestStringList,tm as parseLinkedTestWorkspaceContextMode,Jg as parseMcpCachePolicy,Bg as parseMcpImplementation,Ze as parseMcpInputRequests,pr as parseMcpInputResponses,TC as parseMcpSubscriptionFilter,yl as parseMigrateEntries,OP as parseMultiValueFilter,eM as parseMutationReceipt,TT as parseOptionalNonNegativeInteger,ST as parseOptionalNumber,Q$ as parsePmAgentTaskTranscriptCorpus,C1 as parsePmToolDiscoveryOptions,bP as parsePriority,MP as parsePriorityFilterSet,uA as parseReadOutputSession,vb as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,Cl as parseRemoveEntries,Dl as parseSourceLineRange,cw as parseStatusFilterCsv,RP as parseStringFilterSet,io as parseTags,p_ as parseTestRunMeasurements,wP as parseType,PP as parseTypeFilterSet,el as parseUnknownAuthorHistoryEventCoordinates,QS as parseWorkflowPolicy,ZS as parseWorkflowPolicyDocument,uk as partitionDecisionEntries,Ub as patchPathToChangedField,so as pathExists,Cg as pauseTask,uu as persistDurableGraphResult,Sw as persistSelectedItemFormat,eI as planAgentIdentityVocabularyMutation,rk as planCompletedAtBackfill,jp as planExtensionDirectoryCopy,$N as planItemMutationDocument,tr as planProfileApplication,rD as planRelationshipEventBackfill,Cu as planRelationshipRemediation,kp as planSchemaEvolutionMigration,Qp as planUnknownAuthorHistoryAcknowledgment,Hf as planWorkspaceSnapshotRestore,rP as positionalShapeKey,nP as positionalSignatureKey,KN as preflightExtension,Is as prepareSimilarityText,_T as preserveMutationStdinTokenFields,fT as preserveMutationStdinTokenLiterals,LN as previewItemMutationDocument,lN as previewItemMutations,wx as printError,bx as printResult,Kh as profile,Xh as profileApply,Jh as profileLint,Wh as profileList,Yh as profileShow,Eb as projectAfterCommandItemSnapshot,Lm as projectContextFocusRows,c_ as projectFleetAttributionAnalytics,Rv as projectHistoryProvenance,ji as projectLeanRecoveryPayload,fl as projectLinkedCollectionMutation,yx as projectPmBriefListEnvelope,Sx as projectPmBriefSearchEnvelope,fs as projectPmCliErrorContextDetails,us as projectPmCliErrorDetails,Ni as projectPmDiagnosticOutput,Li as projectPmDiagnosticText,s_ as projectProvenanceCoverageAnalytics,ku as projectValidateCounts,pI as promoteAssuranceAssertion,JA as propagateContextUsageServingReceipt,T$ as pruneCompileCacheGenerations,wM as putAssuranceDeclaration,OM as putAssuranceDeclarationBundle,Bw as queryItemMetadataIndex,qw as queryLinkedFileMetadataIndex,zw as querySimilarItemMetadataIndex,l_ as queryTestRunMeasurementsBelow,wo as quoteCmdCommandArg,Ro as quoteCommandArg,Po as quotePosixCommandArg,Oo as quotePowerShellCommandArg,bo as quoteWindowsCommandArg,PN as rankCommandPaths,ad as readAnnotationEntries,ui as readAuthorEnvironment,P_ as readBooleanOption,ox as readContextUsageAffinity,M_ as readCsvListOption,Lc as readExtensionMigrationState,ao as readFileIfExists,rd as readFirstStringFromCommanderOptions,nd as readFirstValueFromCommanderOptions,n_ as readHistoryAnalyticsWindow,bE as readHistoryEntries,hi as readHistorySnapshot,Xf as readImprovementLedger,Kw as readItemMetadataDerivedIndexState,Hs as readItemRevision,hN as readItemTransaction,VO as readLatestHistoryActivity,as as readLocatedItem,eA as readOutputBudgetCollections,$A as readOutputCollectionFingerprint,ZE as readOutputContinuationRowCollections,JE as readOutputContinuationRowPaths,wA as readOutputIncludeModeOptions,cA as readOutputRetainsTail,QE as readOutputRowCollections,XE as readOutputRowPaths,_A as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,km as readRecentActivity,b_ as readRequiredString,mE as readRuntimeFieldOptionValue,ts as readSettings,tR as readSettingsSection,Ew as readSettingsWithMetadata,od as readStringArrayFromCommanderOptions,R_ as readStringOption,xO as readThrownExitCode,_O as readVectorizationStatusLedger,vw as readWorkflowPolicies,eT as readWorkflowPolicyField,TR as readWorkspaceContextIntentContracts,ek as readWorkspaceContextSignals,ik as readWorkspaceMemory,zk as readWorkspacePosition,FR as readWorkspaceTransaction,kE as reanchorHistoryEntries,vF as reconcileArtifactLedgers,Wi as reconcileExtensionCapabilityUsage,Jb as reconcileWorkspaceJsonHistory,Tb as recordAfterCommandAffectedItem,PM as recordAssuranceVerdict,lm as recordClaimSemanticAttribution,tx as recordContextUsageDelivery,ex as recordContextUsageServing,rx as recordContextUsageTouch,nx as recordContextUsageTouches,mm as recordFocusSemanticAttribution,Yf as recordImprovementObservation,um as recordReleaseSemanticAttribution,qO as recordedBaselineActivity,HO as recordedPrefixActivity,ko as redactUrlCredentialsInText,vo as redactUrlCredentialsInToken,Ww as refreshItemMetadataDerivedIndex,Pp as refreshMergeAttributeFenceIfInstalled,iA as refreshReadOutputDeliveredCounts,gO as refreshSearchArtifactsForMutation,si as registerAgentProvenanceAdapters,NP as registerExternalDependencyResolver,oi as registerHarnessSignalDescriptors,FE as registerOutputMaterialFieldGroups,ug as release,oA as rememberReadOutputFocusRows,RM as removeAssuranceDeclaration,co as removeFileIfExists,Ml as renameArtifactsResultKey,Pm as renderCalendarMarkdown,Mm as renderCalendarToon,Wm as renderContextMarkdown,Gp as renderExtensionDescribeMarkdown,Dp as renderExtensionSurfaceMarkdown,eh as renderGuideMarkdown,wN as renderMissingOptionRetry,mk as renderNextMarkdown,vN as renderPmClosedDomainHelp,Mo as renderPmCommand,Fn as renderPmCommandAliasMigrationHint,yp as renderPmCommandVisibilityMarkdown,UD as renderPmFlagLexiconMarkdown,$L as renderPmMcpAppHtml,_D as renderPmRefusalClosureCensusMarkdown,pw as renderRowsAsCsv,lw as renderRowsAsTable,cg as reopen,Mw as replayHistoryToTarget,RE as replayToCanonicalItemDocument,OE as replayToItemDocument,nE as requireHistoryOperation,Cv as requireTerminalReason,yv as requireTerminalReasonWithRecovery,$x as resealHistoryRewrite,gb as resetActiveExtensionRuntimeState,dl as resetWorkspaceGraphCache,Qo as resolveAgentSessionContextFromSignals,md as resolveAnnotationIndex,pd as resolveAnnotationInput,xE as resolveAuthor,_i as resolveAuthorIdentity,Zb as resolveBodyFileContent,Cy as resolveBuiltinCorpusShape,Rm as resolveCalendarOutputFormat,WP as resolveCanonicalPmErrorCodeContract,qx as resolveCanonicalRelationshipKind,AE as resolveClaimPrincipal,Gb as resolveCliBulkIdsInput,OT as resolveCommandOptionPolicyState,xo as resolveCommandShellDialect,S$ as resolveCompileCacheGeneration,tk as resolveCompletionTimestamp,Yx as resolveConfiguredPmPackageRoot,UP as resolveContentFieldFilters,px as resolveContextIntentContract,$m as resolveContextOutputFormat,Dm as resolveContextTokenBudget,Tv as resolveCreateExplicitEmptyFlag,Us as resolveDeclaredBlockers,Ak as resolveEffectiveSearchMode,tO as resolveEmbeddingProviders,vt as resolveExtensionFlagOptionKey,HT as resolveExtensionFlagValueContract,Bp as resolveExtensionInstallSourceIdentity,kT as resolveExtensionLongFlagName,Nc as resolveExtensionMigrationStatePath,ob as resolveExtensionRoots,LP as resolveExternalDependencyReference,zT as resolveFlagValueKind,MT as resolveGlobalPmRoot,Q_ as resolveGuideOutputFormat,Jf as resolveHistoryEpisodeGroupIdentity,cE as resolveHistoryHashAlgorithm,rE as resolveHistoryOperation,wv as resolveHistoryProvenanceDimensions,aR as resolveHistorySubject,Rw as resolveHistoryTarget,bk as resolveHybridSemanticWeight,Co as resolveImplicitPmRoot,GT as resolveIsoOrRelative,_R as resolveItemBlockers,pR as resolveItemExecutionRole,iN as resolveItemMutationDocument,bm as resolveItemOwnershipActivity,xm as resolveItemOwnershipConflict,go as resolveItemTypeRegistry,pE as resolveItemTypesFilePath,Ls as resolveLastActivityAt,CN as resolveLifecycleVerbRecovery,IT as resolveLinkedResourcePositionalRecovery,T_ as resolveLinkedTestFailureExitCode,bu as resolveLinkedTestSourceRef,wu as resolveLinkedTestSourceWorkspaceRoot,Mu as resolveLinkedTestTrust,Iu as resolveLinkedTestTrustBatch,EC as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,xp as resolveMergeInstallContext,ON as resolveMisnestedCommandPath,GP as resolveMissingMetadataFilters,bN as resolveMissingOptionPlaceholder,zE as resolveModePairedOutputOmissionReceipt,pk as resolveNextOutputFormat,KE as resolveOutputOmissionReceipt,Wx as resolvePmCliVersion,Dn as resolvePmCommandAlias,ze as resolvePmCommandCapabilityFamily,$t as resolvePmCommandExitContract,N as resolvePmCommandOperation,Ii as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,JR as resolvePmCommandPositionalContract,No as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,ki as resolvePmDiagnosticOutputBudget,YP as resolvePmErrorCodeContract,lS as resolvePmFlagSemanticConcept,ke as resolvePmHistoryOperation,q0 as resolvePmMcpExecutableInvocation,Kx as resolvePmPackageRootFromModule,QR as resolvePmPositionalActionContract,Ic as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,zd as resolvePmToolCustomFieldCollision,ow as resolvePriority,Wt as resolveProfile,Op as resolveProjectMergeTypeFolders,HA as resolveQueryCursorStart,yN as resolveReadCompletenessControls,TN as resolveReadOptionRetryArgs,PA as resolveReadOutputDimensions,NA as resolveReadOutputEncoding,sA as resolveReadOutputRecoveryBudget,SA as resolveReadOutputSurface,VE as resolveReadRowContract,xN as resolveRecoveryCommandName,Lb as resolveRegisteredSearchProvider,$b as resolveRegisteredVectorStoreAdapter,hd as resolveReproducibleProcessEnvironment,Fo as resolveRuntimeFieldRegistry,Do as resolveRuntimeStatusRegistry,rO as resolveSearchCorpusFields,Ek as resolveSearchMaxResults,Rk as resolveSearchPage,xk as resolveSearchScoreThreshold,wk as resolveSearchTuning,oO as resolveSemanticCorpusCharacterLimit,pm as resolveSemanticLineageIds,xw as resolveSettingsWithSemanticRuntimeDefaults,NM as resolveSourceContextWritePolicy,gm as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,KS as resolveTelemetryErrorCategory,CO as resolveTelemetrySourceAttribution,gv as resolveTerminalReason,cN as resolveTransactionSchema,wT as resolveTypeDefinition,bT as resolveTypeName,dw as resolveTypeSynonym,hw as resolveTypeWorkflows,Zp as resolveUnknownAuthorAcknowledgmentSelector,kk as resolveVectorIndexRecovery,sO as resolveVectorStores,tp as resolveWorkspaceRelationshipKindRegistry,PT as resolveWorkspaceRoot,_g as restore,qT as restoreCheckpointItems,Qb as restoreWorkspaceJsonFromHistory,Kf as restoreWorkspaceSnapshot,Vf as restoreWorkspaceSnapshotWithRecovery,ul as reviseLinkedNote,Gg as runAction,bb as runActiveBeforeMutationHooks,Ob as runActiveCommandHandler,wb as runActiveOnIndexHooks,Ji as runActiveOnReadHooks,Xi as runActiveOnWriteHooks,Rb as runActiveParserOverride,Pb as runActivePreflightOverride,Mb as runActiveServiceOverride,vm as runActivity,nb as runAfterCommandHooks,bf as runAggregate,ud as runAnnotationCommand,Gu as runAppend,nv as runAssuranceAction,ov as runAssuranceDispatch,rb as runBeforeCommandHooks,Im as runCalendar,ef as runClaim,tf as runClaimNext,ju as runClose,Bu as runCloseMany,sf as runCloseTask,nl as runComments,th as runCompletion,ol as runConfig,zt as runContext,zv as runContextEvaluationCorpus,Bv as runContextEvaluationScenario,qu as runCopy,cm as runCreate,dm as runDelete,pl as runDeps,Il as runDocs,oI as runDuplicates,$f as runEval,Ff as runEvent,qp as runExtension,Fc as runExtensionMigrateAction,Dc as runExtensionMigrations,Gl as runFiles,jl as runFilesDiscover,Ul as runFilesLookup,a_ as runFleetAttributionAnalytics,hm as runFocus,$u as runGc,wf as runGet,Su as runGraph,Z_ as runGuide,Eu as runHealth,Tk as runHistory,_v as runHistoryAttest,sv as runHistoryCompact,dv as runHistoryCompactBulk,UI as runHistoryMaintenance,pv as runHistoryRedact,BI as runHistoryRepair,zI as runHistoryRepairAll,Fg as runInActiveExtensionScope,Yp as runInit,Vp as runInitAgentGuidance,Fu as runLearnings,Pl as runLinkedArtifacts,E_ as runLinkedTests,up as runList,Df as runMeet,Dk as runMergeDriver,Mp as runMergeInstall,vI as runMergeReceiptEvidenceReport,II as runMergeReceiptReport,Fk as runMergeReconcile,Jm as runNext,lf as runNotes,of as runPauseTask,cf as runPlan,Sf as runProfileApply,yf as runProfileLint,gf as runProfileList,Cf as runProfileShow,i_ as runProvenanceCoverageAnalytics,XN as runRegisteredCommandForTest,t0 as runRegisteredCommandOverrideForTest,c0 as runRegisteredExporterForTest,QN as runRegisteredHookForTest,a0 as runRegisteredImporterForTest,s0 as runRegisteredMigrationForTest,JN as runRegisteredMutationGuardForTest,ZN as runRegisteredParserOverrideForTest,e0 as runRegisteredPreflightOverrideForTest,r0 as runRegisteredRendererOverrideForTest,o0 as runRegisteredSearchProviderForTest,n0 as runRegisteredServiceOverrideForTest,i0 as runRegisteredVectorStoreAdapterForTest,rr as runReindex,rf as runRelease,Gf as runRemind,Av as runReopen,df as runRestore,Np as runSchemaEvolutionMigration,Of as runSearch,Ty as runSearchRefreshWorkerEntrypoint,rh as runStartBackgroundRun,nf as runStartTask,m_ as runStats,__ as runTelemetry,_f as runTemplatesList,ff as runTemplatesSave,hf as runTemplatesShow,A_ as runTest,x_ as runTestAll,nh as runTestRunsList,ih as runTestRunsLogs,ah as runTestRunsResume,oh as runTestRunsStatus,sh as runTestRunsStop,ch as runTestRunsWorker,Em as runUpdate,pf as runUpdateMany,Bt as runUpgrade,Lu as runValidate,Dg as runWithActiveExtensions,L as runWithAgentSessionContext,yw as runWithConfigurationOnlySettings,cx as runWithContextIntentContracts,xR as runWithDiscoveredContextIntentContracts,ci as runWithHarnessDetectionSignals,OL as runWithMcpTraceContext,Cd as runWithReproducibleProcessEnvironment,di as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,zM as runWorkflowPolicyAction,iv as runWorkspaceTransactionGc,gu as saveGraphAuditBaseline,WI as scanClosureTimestamps,lI as scanExtensionHostVersions,Jp as scanHistoryAuthorAttribution,Fs as scanInProgressWork,Ho as scanItemFormatVersions,Ts as scanMutationSecrets,fI as scanProvenanceResolverHealth,Gs as scanStaleInProgressItems,JI as scanStorageIntegrity,Mh as schema,Dh as schemaAddField,Lh as schemaAddStatus,kh as schemaAddType,jh as schemaApplyPreset,Bh as schemaInferTypes,Ih as schemaList,Gh as schemaListFields,Hh as schemaRemapStatus,Fh as schemaRemoveField,$h as schemaRemoveStatus,Nh as schemaRemoveType,zh as schemaRenameField,qh as schemaRenameType,vh as schemaShow,Uh as schemaShowField,Vh as schemaShowStatus,RN as scoreCommandPathMatch,Fv as scoreContextCandidates,Gv as scoreContextCandidatesWithActiveExtensions,vs as scoreItemSimilarity,PD as scorePmGrammarRefusalClosure,CD as scorePmRefusalClosure,ks as scorePreparedItemSimilarity,vD as scoreTrackerPreflightRecoveryClosure,Nx as sealHistoryRecord,W0 as sealMcpRequestState,uh as search,ck as searchWorkspaceMemory,dk as searchWorkspaceMemoryReadResult,xs as secretGuardRuleCategory,gR as selectActionableEntries,GA as selectCursorSemanticOptions,W_ as selectImportAuthor,EL as selectMcpClientRegistrationMode,ak as selectWorkspaceMemory,sk as selectWorkspaceMemoryRollups,_m as semanticAttributionAffinity,kO as sentryCaptureCliError,IO as sentryDiscardCommandSpan,vO as sentryFinishCommandSpan,LO as sentryFlush,NO as sentryLogCliUsageError,PO as sentrySetCommandContext,MO as sentryStartCommandSpan,Yo as serializeItemDocument,kN as serializeNdjsonRows,NN as serializeNdjsonStream,py as serveDeclaredObservation,Cb as setActiveCommandContext,yb as setActiveCommandResult,lb as setActiveExtensionCommands,pb as setActiveExtensionHooks,ub as setActiveExtensionParsers,mb as setActiveExtensionPreflight,hb as setActiveExtensionRegistrations,_b as setActiveExtensionRenderers,fb as setActiveExtensionServices,TE as setFocusedItem,eR as settingsSectionRevision,ZO as shouldCompletePlanOnClose,_u as shouldPersistDurableGraphCache,CT as shouldResolveMutationStdinTokenField,gT as shouldResolveMutationStdinTokens,ww as shouldRunSearchRefreshInForeground,vl as similarityAdvisoryWarnings,YE as sliceReadOutputRowCollection,ms as snapshotPmCliErrorContext,wl as sortLinkedArtifacts,fP as sortWaiverNotices,aT as splitAcceptanceCriteria,XO as splitCommaList,Wo as splitFrontMatter,MA as stabilizeReadOutputReceiptEstimates,R as stableStringify,oN as stableUpsertValue,WS as stableValueEquals,GO as staleEligibleAt,Fw as stampRequiredItemFormat,gg as startTask,oR as startTelemetryCommand,hh as stats,uE as statusIsTerminal,Uc as stripGlobalBootstrapTokens,jk as subscribeMutationEventBatches,Bk as subscribeMutationEvents,ZM as summarizeAgentIdentityVocabulary,Zf as summarizeAgentModelProvenance,e_ as summarizeAgentProvenance,qv as summarizeContextEvaluationReports,C_ as summarizeContextPreflight,Iv as summarizeHistoryProvenance,Kp as summarizeInitResult,OI as summarizeMergeReceipt,Ev as supportsCreateExplicitEmpty,sP as supportsItemIdAlias,LE as suppressHostOutput,we as syncRelationshipGraphAdapter,zN as synthesizeExtensionManifest,vc as toCompletionFlagString,Vm as toContextFocusItem,qm as toContextPackingSummary,zm as toContextRankingSummary,LT as toErrorMessage,v_ as toEstimatedMinutesValue,Qk as toExtensionFlagDefinitions,D_ as toImportBoolean,j_ as toImportConfidence,V_ as toImportDeferredFields,$_ as toImportInteger,H_ as toImportLinkedDocs,z_ as toImportLinkedFiles,K_ as toImportLinkedTests,q_ as toImportLogEntries,B_ as toImportNormalizedEnum,U_ as toImportNumberMap,k_ as toImportPriority,L_ as toImportStatus,F_ as toImportStringList,G_ as toImportStringMap,N_ as toImportTags,yE as toItemRecord,I_ as toNonEmptyImportString,NT as toNonEmptyStringOrUndefined,PE as toReplayDocument,Tx as toWellFormedText,Ms as tokenizeSimilarityText,hT as transferMutationStdinTokenPolicy,eb as translateHostEnvironmentFault,BO as unprovenClaimActivity,ag as update,h_ as updateLinkedTest,Lg as upgrade,Qh as validate,gM as validateAssertionDefinition,yM as validateAssuranceDocument,CM as validateGateDefinition,aN as validateItemMutationRows,Rl as validateLinkedPaths,AL as validateMcpAuthorizationResponseIssuer,TL as validateMcpAuthorizationServerMetadata,xL as validateMcpClientMetadataDocument,mL as validateMcpHttpRequestHeaders,Q0 as validateMcpJsonSchema,hM as validateMeasurementDefinition,rw as validateMissingParentReference,bA as validateReadOutputOptions,aw as validateSprintOrReleaseValue,RT as validateTypeOptions,$R as validateWorkspaceTransactionIdentity,fv as verifyAttestation,dP as verifyCliFlagInvocationParity,tP as verifyExplicitPositionalSlotCensus,vE as verifyHistoryChain,IE as verifyHistoryChainWithVersion,bR as verifyHistoryEntries,Lx as verifyHistoryRecordHash,Dx as verifyHistoryRewriteEvidence,iP as verifyPmCliGrammar,oP as verifyPmCommandPositionalContracts,GD as verifyPmFlagLexicon,dD as verifyPmRecoveryKindRuntimeCoverage,tS as verifyPmRecoveryProducerRuntimeCoverage,cD as verifyPmRecoveryReferences,mD as verifyPmRefusalClosureIdentityRatchet,uD as verifyPmRefusalClosureRatchet,aD as verifyPmRefusalReachability,bd as verifyToolOptionCliParity,mP as waiverNoticeFor,FO as wholeHoursSince,iw as withCliMutationInput,Ws as withExpectedItemRevisions,Js as withFlagAliasMetadata,tb as withHostEnvironmentBoundary,sw as withLiteralMutationInput,J0 as withMcpCachePolicy,Gi as withoutGenericRefusalExamples,rT as workflowApprovalFingerprint,nT as workflowPolicyApplies,tT as workflowPolicyFingerprint,cl as workspaceGraphCache,GR as workspaceTransactionPlanDigest,ld as wrapOwnershipConflict,OO as wrapThrownErrorForSentry,mi as writeAuthorEnvironment,$e as writeFileAtomic,jT as writeMutationCheckpoint,Aw as writeSettings,rR as writeSettingsSection,xx as writeStderr,Ax as writeStdout,hO as writeVectorizationStatusLedger,Xb as writeWorkspaceJsonWithHistory,ml as writtenLinkedEntries};
35
35
  //# sourceMappingURL=sdk.js.map