@unbrained/pm-cli 2026.11.15 → 2026.11.16

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 (181) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/error-guidance.js +2 -2
  3. package/dist/cli/help-content.js +2 -2
  4. package/dist/cli/register-operations.js +1 -1
  5. package/dist/cli-bundle/bundle-manifest.json +1 -1
  6. package/dist/cli-bundle/chunks/{chunk-TESRFVGF.js → chunk-2D26HRXB.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-VWKLTHYQ.js → chunk-2WNORBVN.js} +36 -25
  8. package/dist/cli-bundle/chunks/{chunk-J6L3Q5J4.js → chunk-4I7YG3VZ.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-QZNDEZYI.js → chunk-4WIVCOA7.js} +2 -2
  10. package/dist/cli-bundle/chunks/chunk-A3WCP4TU.js +6 -0
  11. package/dist/cli-bundle/chunks/chunk-AB5S6TWE.js +124 -0
  12. package/dist/cli-bundle/chunks/{chunk-KLWGIEDC.js → chunk-BV7J3LRH.js} +3 -3
  13. package/dist/cli-bundle/chunks/{chunk-GCSKHCYK.js → chunk-DZWRNL6R.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-KSLPRST2.js → chunk-E4BQRZF2.js} +3 -3
  15. package/dist/cli-bundle/chunks/chunk-ERD2RYWM.js +31 -0
  16. package/dist/cli-bundle/chunks/chunk-F7P42FL5.js +9 -0
  17. package/dist/cli-bundle/chunks/{chunk-E4B2HWH7.js → chunk-FZ4XWWLO.js} +23 -23
  18. package/dist/cli-bundle/chunks/{chunk-7AODVNHX.js → chunk-I3T2FVUA.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-PMIGRSNZ.js → chunk-IGEBFNWE.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-YLPZE2TK.js → chunk-IYICNCK2.js} +2 -2
  21. package/dist/cli-bundle/chunks/chunk-J257NZRD.js +20 -0
  22. package/dist/cli-bundle/chunks/{chunk-Q6GBRK27.js → chunk-JD3XWF66.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-FSE624WQ.js → chunk-JLHD7OQ2.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-DBUBX4DL.js → chunk-KGOGLKL2.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-ZWUS65LN.js → chunk-LC4DJVXR.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-LC6DL446.js → chunk-NHNM3GIP.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-ZVDXGAYV.js → chunk-NYN5OR2T.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-6UTBX62V.js → chunk-OFZQEQ6X.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-GAFALSR2.js → chunk-QGL5IAP4.js} +3 -3
  30. package/dist/cli-bundle/chunks/{chunk-HMVZSXB4.js → chunk-R24NZ2TB.js} +2 -2
  31. package/dist/cli-bundle/chunks/{chunk-S5UXBECQ.js → chunk-VJLZHOTP.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-YJNY5MKP.js → chunk-VO2HSB5F.js} +2 -2
  33. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-42Y2CSEQ.js → indexed-receipt-blobs-HNLN6UXH.js} +2 -2
  34. package/dist/cli-bundle/chunks/{item-revision-JCEDTAVX.js → item-revision-PSOL5I4H.js} +2 -2
  35. package/dist/cli-bundle/chunks/item-transaction-55QTCU2M.js +2 -0
  36. package/dist/cli-bundle/chunks/{mutation-actor-IQHBRFAJ.js → mutation-actor-BDBBH3ZS.js} +2 -2
  37. package/dist/cli-bundle/chunks/{mutation-admission-DF6BFGG6.js → mutation-admission-WUN7JYVJ.js} +2 -2
  38. package/dist/cli-bundle/chunks/{register-list-query-DNKPQB76.js → register-list-query-AESCVO6H.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-mutation-WVTDFLEF.js → register-mutation-SKCEP5QU.js} +2 -2
  40. package/dist/cli-bundle/chunks/register-operations-ZT4OYCF3.js +2 -0
  41. package/dist/cli-bundle/chunks/{register-setup-2RTG3LII.js → register-setup-JVWNS2TY.js} +2 -2
  42. package/dist/cli-bundle/chunks/{settlement-hook-W5ULPKIE.js → settlement-hook-MVVVUIVZ.js} +2 -2
  43. package/dist/cli-bundle/chunks/{stage-YFNK7U26.js → stage-RMU3JAWM.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-YZUBG4W2.js → chunk-3WVMEA2A.js} +3 -3
  45. package/dist/cli-bundle/focused-chunks/{chunk-CZZKAGHE.js → chunk-5UVJOAUP.js} +6 -6
  46. package/dist/cli-bundle/focused-chunks/{chunk-EALGFJRP.js → chunk-5WQ3LNUK.js} +3 -3
  47. package/dist/cli-bundle/focused-chunks/chunk-6E4X7MQA.js +26 -0
  48. package/dist/cli-bundle/focused-chunks/{chunk-JE3MFEQZ.js → chunk-7SEPCQV2.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-XQZKGTZV.js → chunk-7XHE335U.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-52H6AELE.js → chunk-BEHIMEV2.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-JXA77YIV.js → chunk-CZFZCSOX.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-W2KIQ7RF.js → chunk-DFBHW7HP.js} +3 -3
  53. package/dist/cli-bundle/focused-chunks/{chunk-WGYR3X6O.js → chunk-DZMP3VYQ.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-HHMMIHZP.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-LSWUTTE6.js → chunk-HPC2M6JD.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-2UQFFVQK.js → chunk-HR5FEUUL.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-S6GTALM4.js → chunk-J7ESCE7M.js} +3 -3
  58. package/dist/cli-bundle/focused-chunks/chunk-KRNF3WTC.js +3 -0
  59. package/dist/cli-bundle/focused-chunks/{chunk-DXMQ32EH.js → chunk-KWZLY35A.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-Z6HCQYSW.js → chunk-M4IA4LC6.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-YTNUUEY6.js → chunk-NASE6JC2.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/chunk-ONM2R32I.js +65 -0
  63. package/dist/cli-bundle/focused-chunks/{chunk-QXOFSZR6.js → chunk-PDXSMSO5.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{chunk-BSY6FZ3Y.js → chunk-PEL4SQXV.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-DRBXOAGY.js → chunk-QJ647CQE.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-SFATIM77.js +12 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-7GCAZJT4.js → chunk-UBBTBNUY.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{chunk-UPUIDGNJ.js → chunk-ZCN35TCK.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/chunk-ZSQ2FT22.js +44 -0
  70. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-LSBWMXKS.js → indexed-receipt-blobs-ADMQXF3N.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{item-revision-YO7YGQYE.js → item-revision-GNKYO6GZ.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/{item-transaction-7A3Q4CAJ.js → item-transaction-AUUQHR5Z.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/{mutation-actor-UQHBNHOF.js → mutation-actor-OBRD7HFZ.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/{mutation-admission-G565NLPE.js → mutation-admission-6TX3EOJX.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/{settlement-hook-UXN76GMA.js → settlement-hook-5U2M75BY.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/{stage-F3YJGNRK.js → stage-LERF2YJU.js} +2 -2
  77. package/dist/cli-bundle/main.js +6 -6
  78. package/dist/cli-bundle/sdk-authoring.js +1 -1
  79. package/dist/cli-bundle/sdk-contracts.js +2 -2
  80. package/dist/cli-bundle/sdk-core.js +1 -1
  81. package/dist/cli-bundle/sdk-governance.js +1 -1
  82. package/dist/cli-bundle/sdk-graph.js +1 -1
  83. package/dist/cli-bundle/sdk-merge.js +57 -57
  84. package/dist/cli-bundle/sdk-query.js +1 -1
  85. package/dist/cli-bundle/sdk-runtime.js +1 -1
  86. package/dist/cli-bundle/sdk-testing.js +1 -1
  87. package/dist/cli-bundle/sdk.js +11 -11
  88. package/dist/core/diagnostics/remediation.js +1 -1
  89. package/dist/core/output/mutation-projection.js +1 -1
  90. package/dist/core/shared/errors.d.ts +22 -0
  91. package/dist/core/shared/errors.js +1 -1
  92. package/dist/core/store/item-store.d.ts +15 -4
  93. package/dist/core/store/item-store.js +1 -1
  94. package/dist/core/telemetry/policy.d.ts +21 -2
  95. package/dist/core/telemetry/policy.js +1 -1
  96. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  97. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  98. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  99. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  100. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  101. package/dist/sdk/completion/bash.js +1 -1
  102. package/dist/sdk/completion/fish.js +2 -1
  103. package/dist/sdk/completion/zsh.js +12 -2
  104. package/dist/sdk/flag-invocation-contracts.js +1 -1
  105. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  106. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  107. package/dist/sdk/governance/health.js +2 -2
  108. package/dist/sdk/governance/in-progress-work-health.d.ts +49 -0
  109. package/dist/sdk/governance/in-progress-work-health.js +2 -0
  110. package/dist/sdk/governance/stale-work.d.ts +143 -2
  111. package/dist/sdk/governance/stale-work.js +1 -1
  112. package/dist/sdk/governance.d.ts +1 -1
  113. package/dist/sdk/governance.js +1 -1
  114. package/dist/sdk/history-compact.js +1 -1
  115. package/dist/sdk/index.d.ts +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/lifecycle/claim.d.ts +46 -3
  118. package/dist/sdk/lifecycle/claim.js +1 -1
  119. package/dist/sdk/lifecycle/task-composition.js +1 -1
  120. package/dist/sdk/ownership-source.d.ts +32 -0
  121. package/dist/sdk/ownership-source.js +1 -1
  122. package/dist/sdk/public-surface.json +1 -1
  123. package/dist/sdk/query/context.d.ts +5 -1
  124. package/dist/sdk/query/context.js +2 -2
  125. package/dist/sdk/query/next.d.ts +19 -3
  126. package/dist/sdk/query/next.js +1 -1
  127. package/dist/sdk/runtime-input.js +1 -1
  128. package/dist/sdk/runtime-primitives.d.ts +1 -1
  129. package/dist/sdk/runtime-primitives.js +1 -1
  130. package/docs/AGENT_GUIDE.md +2 -0
  131. package/docs/COMMANDS.md +22 -0
  132. package/docs/CONFIGURATION.md +20 -7
  133. package/docs/LIFECYCLE_COMMANDS.md +8 -1
  134. package/docs/MUTATION_INTEGRITY.md +79 -1
  135. package/docs/SDK.md +28 -0
  136. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  137. package/marketplace.json +1 -1
  138. package/node_modules/commander/Readme.md +6 -32
  139. package/node_modules/commander/index.js +1 -1
  140. package/node_modules/commander/lib/command.js +22 -9
  141. package/node_modules/commander/lib/help.js +6 -2
  142. package/node_modules/commander/lib/option.js +1 -1
  143. package/node_modules/commander/package.json +2 -1
  144. package/node_modules/commander/typings/index.d.ts +6 -3
  145. package/node_modules/semver/classes/range.js +2 -2
  146. package/node_modules/semver/internal/constants.js +30 -0
  147. package/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
  148. package/node_modules/semver/package.json +1 -1
  149. package/package.json +3 -3
  150. package/packages/pm-beads/package.json +1 -1
  151. package/packages/pm-calendar/package.json +1 -1
  152. package/packages/pm-command-kit/package.json +1 -1
  153. package/packages/pm-digital-twin/package.json +1 -1
  154. package/packages/pm-governance-audit/package.json +1 -1
  155. package/packages/pm-guide-shell/package.json +1 -1
  156. package/packages/pm-kanban/package.json +1 -1
  157. package/packages/pm-lifecycle-hooks/package.json +1 -1
  158. package/packages/pm-linked-test-adapters/package.json +1 -1
  159. package/packages/pm-search-advanced/package.json +1 -1
  160. package/packages/pm-templates/package.json +1 -1
  161. package/packages/pm-todos/package.json +1 -1
  162. package/packages/pm-vcs/package.json +1 -1
  163. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  164. package/plugins/pm-claude/package.json +1 -1
  165. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  166. package/plugins/pm-codex/package.json +1 -1
  167. package/plugins/pm-codex/plugin.json +1 -1
  168. package/runtime-dependencies.json +1 -1
  169. package/dist/cli-bundle/chunks/chunk-ASGAELBQ.js +0 -9
  170. package/dist/cli-bundle/chunks/chunk-E74OMFBZ.js +0 -6
  171. package/dist/cli-bundle/chunks/chunk-FYOIH56R.js +0 -20
  172. package/dist/cli-bundle/chunks/chunk-IXV5UM4U.js +0 -31
  173. package/dist/cli-bundle/chunks/chunk-NAX554KY.js +0 -124
  174. package/dist/cli-bundle/chunks/item-transaction-BSMGKZ4S.js +0 -2
  175. package/dist/cli-bundle/chunks/register-operations-NR5MTT5T.js +0 -2
  176. package/dist/cli-bundle/focused-chunks/chunk-63FM3TIG.js +0 -26
  177. package/dist/cli-bundle/focused-chunks/chunk-FK2X6MJY.js +0 -44
  178. package/dist/cli-bundle/focused-chunks/chunk-JRRHN2PZ.js +0 -12
  179. package/dist/cli-bundle/focused-chunks/chunk-LQZ5F6LE.js +0 -3
  180. package/dist/cli-bundle/focused-chunks/chunk-RMCODWHZ.js +0 -65
  181. package/dist/cli-bundle/focused-chunks/chunk-WVYXR3YX.js +0 -2
@@ -1,10 +1,10 @@
1
- import{$b as ae,Aa as $t,Eb as ke,Fb as Ee,Gb as se,Hb as Ae,Ia as ve,Jc as Gt,Xb as Re,Yb as Ft,Zb as Te,_ as Mt,ac as Se,bd as qt,cb as ie,nb as Bt,od as zt,sc as xe,ya as Ut,za as Lt}from"./chunk-YZUBG4W2.js";import{A as h,E as Pt,z as y}from"./chunk-QXOFSZR6.js";import{stripVTControlCharacters as qo}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="493a0675-0114-5b93-b3b4-5bd895ac691f")}catch{}})();var zo=["full","compact","brief","summary","counts"],Aa=["mutation","read","discovery","governance"],Kt=["error","warning","validation_summary","recovery_bundle"],Wo=["full","omit_explanation","limit_collections","compact_recovery","action_only"],Ko=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),Vo=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),Ho=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),Jo={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},Yo=3,Xo=2,Qo=192,Zo={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},er=Kt.map(e=>({diagnostic_class:e,default_max_estimated_tokens_by_format:Zo[e],minimum_max_estimated_tokens:Qo,degradation_ladder:Wo,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),tr=new Map(er.map(e=>[e.diagnostic_class,e]));function nr(e){let[t=""]=ie(e).split(/\s+/u);return Ko.has(t)?"mutation":Vo.has(t)?"discovery":Ho.has(t)?"governance":"read"}function Vt(e,t=nr(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let o=Jo[t];return or({command:n,budget_class:t,default_max_estimated_tokens:o,default_max_estimated_tokens_by_format:{toon:o,json:Math.ceil(o*Yo/Xo)},degradation_ladder:zo,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function or(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var rr=Bt.map(e=>Vt(e)),ir=new Map(rr.map(e=>[e.command,e]));function Ht(e,t={}){let n=e.trim().replace(/\s+/gu," "),[o]=ie(n).split(" "),r=ir.get(o);return r?{...r,command:n}:t.generateFallback?Vt(n):null}function $(e){return Math.ceil(Math.max(0,e)/4)}function Jt(e){let t=tr.get(e);if(t===void 0)throw new TypeError(`diagnosticClass must be one of: ${Kt.join(", ")}`);return t}function j(e){return $(Buffer.byteLength(JSON.stringify(e,null,2),"utf8"))}function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Je(e){if(!sr(e))return;let t={};for(let n of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms","waited_ms","owner_handoffs"]){let o=e[n];Array.isArray(o)?t[n]=n==="suggested_retry_args"?o:o.slice(0,3):o!==void 0&&(t[n]=o)}return Object.keys(t).length>0?t:void 0}function ar(e,t){return typeof e!="string"||e.length<=t?e:`${Re(e,Math.max(1,t-3))}...`}function L(e,t){if(Buffer.byteLength(e,"utf8")<=t)return e;let n="...",o=Array.from(e),r=0,i=o.length;for(;r<i;){let s=Math.ceil((r+i)/2),a=`${o.slice(0,s).join("")}${n}`;Buffer.byteLength(a,"utf8")<=t?r=s:i=s-1}return`${o.slice(0,r).join("")}${n}`}function Yt(e){let t={};for(let n of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(e,n)&&e[n]!==void 0&&(t[n]=e[n]);for(let[n,o]of Object.entries(e))n!=="__proto__"&&!Object.hasOwn(t,n)&&(t[n]=o);return t}var cr=new Set(["limit_collections","compact_recovery","action_only"]),ur=new Set(["compact_recovery","action_only"]);function dr(e){let t={code:typeof e.code=="string"?e.code:"diagnostic",required:ar(e.required,160)??"Inspect the diagnostic code and retry with corrected input."},n=Je(e.recovery);return n!==void 0?t.recovery=n:Array.isArray(e.next_steps)&&(t.next_steps=e.next_steps.slice(0,1)),e.exit_code!==void 0&&(t.exit_code=e.exit_code),e.type!==void 0&&(t.type=e.type),t}function lr(e,t){let n=structuredClone(e);if(t!=="full"&&(delete n.why,delete n.examples),cr.has(t))for(let[o,r]of Object.entries(n))Array.isArray(r)&&(n[o]=r.slice(0,3));if(ur.has(t)){let o=Je(n.recovery);o?n.recovery=o:delete n.recovery}return t!=="action_only"?Yt(n):dr(n)}function J(e,t){let n={...e,diagnostic_output:{...t,estimated_tokens:0}};for(let o=0;o<4;o+=1){let r=j(n),i=n.diagnostic_output;if(i.estimated_tokens===r)break;i.estimated_tokens=r}return n}function fr(e,t,n){let o=J(e,t);for(let i of["recovery","exit_code"])j(o)<=n||e[i]===void 0||(delete e[i],o=J(e,t));let r=40;for(;j(o)>n&&r>4;)r-=4,e.code=L(String(e.code),r),e.required=L(String(e.required),r),o=J(e,t);return o}function _r(e,t){let n=e.diagnostic_output,{estimated_tokens:o,...r}=n,i=r.omitted_fields.slice(0,8).map(_=>L(_,32)),s={...r,omitted_fields:i,...r.omitted_fields.length>i.length?{omitted_fields_overflow_count:r.omitted_fields.length-i.length}:{}},a=Je(e.recovery),c=a&&j(a)<=48?a:void 0,d={code:L(String(e.code),320),required:L(String(e.required),320),...c?{recovery:c}:{},...e.exit_code!==void 0?{exit_code:e.exit_code}:{}},u=J(d,s);for(;j(u)>t&&s.omitted_fields.length>0;)s.omitted_fields.pop(),s.omitted_fields_overflow_count=r.omitted_fields.length-s.omitted_fields.length,u=J(d,s);return u=fr(d,s,t),u}function Ra(e,t={}){let n=e,o=t.diagnosticClass??"error",r=Jt(o),i=t.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<r.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${r.minimum_max_estimated_tokens}`);let s=i??r.default_max_estimated_tokens_by_format.json,a=j(n),c=Object.keys(n);if(a<=s)return Yt(structuredClone(n));let d;for(let[u,_]of r.degradation_ladder.entries()){let l=lr(n,_),f=c.filter(p=>!Object.hasOwn(l,p)),m=J(l,{diagnostic_class:o,format:"json",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,truncated:u>0,degradation_steps:r.degradation_ladder.slice(0,u+1),omitted_fields:f});if(d=m,j(m)<=s)break}return j(d)>s&&(d=_r(d,s)),d}function Wt(e){return qo(e).replace(/\r\n/gu,`
1
+ import{$b as ae,Aa as $t,Eb as ke,Fb as Ee,Gb as se,Hb as Ae,Ia as ve,Jc as Gt,Xb as Re,Yb as Ft,Zb as Te,_ as Mt,ac as Se,bd as qt,cb as ie,nb as Bt,od as zt,sc as xe,ya as Ut,za as Lt}from"./chunk-3WVMEA2A.js";import{A as h,E as Pt,z as y}from"./chunk-PDXSMSO5.js";import{stripVTControlCharacters as qo}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="493a0675-0114-5b93-b3b4-5bd895ac691f")}catch{}})();var zo=["full","compact","brief","summary","counts"],Aa=["mutation","read","discovery","governance"],Kt=["error","warning","validation_summary","recovery_bundle"],Wo=["full","omit_explanation","limit_collections","compact_recovery","action_only"],Ko=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),Vo=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),Ho=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),Jo={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},Yo=3,Xo=2,Qo=192,Zo={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},er=Kt.map(e=>({diagnostic_class:e,default_max_estimated_tokens_by_format:Zo[e],minimum_max_estimated_tokens:Qo,degradation_ladder:Wo,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),tr=new Map(er.map(e=>[e.diagnostic_class,e]));function nr(e){let[t=""]=ie(e).split(/\s+/u);return Ko.has(t)?"mutation":Vo.has(t)?"discovery":Ho.has(t)?"governance":"read"}function Vt(e,t=nr(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let o=Jo[t];return or({command:n,budget_class:t,default_max_estimated_tokens:o,default_max_estimated_tokens_by_format:{toon:o,json:Math.ceil(o*Yo/Xo)},degradation_ladder:zo,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function or(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var rr=Bt.map(e=>Vt(e)),ir=new Map(rr.map(e=>[e.command,e]));function Ht(e,t={}){let n=e.trim().replace(/\s+/gu," "),[o]=ie(n).split(" "),r=ir.get(o);return r?{...r,command:n}:t.generateFallback?Vt(n):null}function $(e){return Math.ceil(Math.max(0,e)/4)}function Jt(e){let t=tr.get(e);if(t===void 0)throw new TypeError(`diagnosticClass must be one of: ${Kt.join(", ")}`);return t}function j(e){return $(Buffer.byteLength(JSON.stringify(e,null,2),"utf8"))}function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Je(e){if(!sr(e))return;let t={};for(let n of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms","waited_ms","owner_handoffs"]){let o=e[n];Array.isArray(o)?t[n]=n==="suggested_retry_args"?o:o.slice(0,3):o!==void 0&&(t[n]=o)}return Object.keys(t).length>0?t:void 0}function ar(e,t){return typeof e!="string"||e.length<=t?e:`${Re(e,Math.max(1,t-3))}...`}function L(e,t){if(Buffer.byteLength(e,"utf8")<=t)return e;let n="...",o=Array.from(e),r=0,i=o.length;for(;r<i;){let s=Math.ceil((r+i)/2),a=`${o.slice(0,s).join("")}${n}`;Buffer.byteLength(a,"utf8")<=t?r=s:i=s-1}return`${o.slice(0,r).join("")}${n}`}function Yt(e){let t={};for(let n of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(e,n)&&e[n]!==void 0&&(t[n]=e[n]);for(let[n,o]of Object.entries(e))n!=="__proto__"&&!Object.hasOwn(t,n)&&(t[n]=o);return t}var cr=new Set(["limit_collections","compact_recovery","action_only"]),ur=new Set(["compact_recovery","action_only"]);function dr(e){let t={code:typeof e.code=="string"?e.code:"diagnostic",required:ar(e.required,160)??"Inspect the diagnostic code and retry with corrected input."},n=Je(e.recovery);return n!==void 0?t.recovery=n:Array.isArray(e.next_steps)&&(t.next_steps=e.next_steps.slice(0,1)),e.exit_code!==void 0&&(t.exit_code=e.exit_code),e.type!==void 0&&(t.type=e.type),t}function lr(e,t){let n=structuredClone(e);if(t!=="full"&&(delete n.why,delete n.examples),cr.has(t))for(let[o,r]of Object.entries(n))Array.isArray(r)&&(n[o]=r.slice(0,3));if(ur.has(t)){let o=Je(n.recovery);o?n.recovery=o:delete n.recovery}return t!=="action_only"?Yt(n):dr(n)}function J(e,t){let n={...e,diagnostic_output:{...t,estimated_tokens:0}};for(let o=0;o<4;o+=1){let r=j(n),i=n.diagnostic_output;if(i.estimated_tokens===r)break;i.estimated_tokens=r}return n}function fr(e,t,n){let o=J(e,t);for(let i of["recovery","exit_code"])j(o)<=n||e[i]===void 0||(delete e[i],o=J(e,t));let r=40;for(;j(o)>n&&r>4;)r-=4,e.code=L(String(e.code),r),e.required=L(String(e.required),r),o=J(e,t);return o}function _r(e,t){let n=e.diagnostic_output,{estimated_tokens:o,...r}=n,i=r.omitted_fields.slice(0,8).map(_=>L(_,32)),s={...r,omitted_fields:i,...r.omitted_fields.length>i.length?{omitted_fields_overflow_count:r.omitted_fields.length-i.length}:{}},a=Je(e.recovery),c=a&&j(a)<=48?a:void 0,d={code:L(String(e.code),320),required:L(String(e.required),320),...c?{recovery:c}:{},...e.exit_code!==void 0?{exit_code:e.exit_code}:{}},u=J(d,s);for(;j(u)>t&&s.omitted_fields.length>0;)s.omitted_fields.pop(),s.omitted_fields_overflow_count=r.omitted_fields.length-s.omitted_fields.length,u=J(d,s);return u=fr(d,s,t),u}function Ra(e,t={}){let n=e,o=t.diagnosticClass??"error",r=Jt(o),i=t.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<r.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${r.minimum_max_estimated_tokens}`);let s=i??r.default_max_estimated_tokens_by_format.json,a=j(n),c=Object.keys(n);if(a<=s)return Yt(structuredClone(n));let d;for(let[u,_]of r.degradation_ladder.entries()){let l=lr(n,_),f=c.filter(p=>!Object.hasOwn(l,p)),m=J(l,{diagnostic_class:o,format:"json",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,truncated:u>0,degradation_steps:r.degradation_ladder.slice(0,u+1),omitted_fields:f});if(d=m,j(m)<=s)break}return j(d)>s&&(d=_r(d,s)),d}function Wt(e){return qo(e).replace(/\r\n/gu,`
2
2
  `).replace(/[^\P{Cc}\n]/gu," ")}function Ta(e,t,n={}){let o=n.diagnosticClass??"error",r=Jt(o),i=n.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<r.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${r.minimum_max_estimated_tokens}`);let s=i??r.default_max_estimated_tokens_by_format.text,a=Wt(e),c=$(Buffer.byteLength(a,"utf8")),d=c>s,u=`What is required:
3
3
  `,_=`
4
4
 
5
5
  ${L(a.trimStart().split(/\r?\n/u,1)[0].trim(),320)}
6
6
 
7
- Diagnostic output exceeded its declared ${s}-token ceiling; rerun with structured JSON for the bounded recovery envelope.`,l=Wt(t).trim()||"Inspect the diagnostic code and retry with corrected input.",f=Math.max(1,s*4-Buffer.byteLength(`${u}${_}`,"utf8")),m=d?`${u}${L(l,f)}${_}`:a;return{output:m,diagnostic_output:{diagnostic_class:o,format:"text",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:c,estimated_tokens:$(Buffer.byteLength(m,"utf8")),truncated:d,degradation_steps:d?[...r.degradation_ladder]:["full"],omitted_fields:d?["explanation","collections"]:[]}}}var Ye=Object.freeze({required:"Adjust command input or tracker state and retry.",why:Object.freeze(["pm enforces explicit, deterministic contracts for data and command semantics.","Commander validates CLI contracts before execution.","Unexpected runtime failures can occur from environment or extension-level issues.","Validation protects data consistency and deterministic behavior across commands.","Required options define command intent and enforce deterministic write contracts."]),examples:Object.freeze(["pm --help","pm <command> --help"])});function Sa(e){return e?.trim()===Ye.required}function xa(e){let t=e?.trim();return t!==void 0&&Ye.why.includes(t)}function Ca(e){return(e??[]).filter(t=>!Ye.examples.includes(t.trim()))}var Ia=Object.freeze(["attempted_command","normalized_args","provided_fields"]);function ja(e){if(!e)return;let{attempted_command:t,normalized_args:n,provided_fields:o,...r}=e;return Object.values(r).some(i=>i!==void 0)?r:void 0}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3a351971-6cfb-55eb-a266-3fec0af9eaa4")}catch{}})();var S=Object.freeze({comments:Object.freeze({paths:Object.freeze(["comments"]),total_key:"total_count"}),notes:Object.freeze({paths:Object.freeze(["notes"]),total_key:"total_count",delivered_row_counters:Object.freeze([Object.freeze({key:"structured_event_count",field:"format",equals:"json"})])}),learnings:Object.freeze({paths:Object.freeze(["learnings"]),total_key:"total_count"})});function B(e,t){return e===void 0?!1:(Object.hasOwn(S,e)?S[e]:void 0)?.paths.includes(t)===!0}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a65d6520-0e6f-5627-a4dd-bd455c2db0fa")}catch{}})();var Zt=new WeakMap;function Ua(e,t){Zt.set(e,new Set(t))}var Ce='.row_contract.row_keys[] as $key | getpath($key | split(".")) | if type == "array" then .[] else if type == "object" then to_entries[] else empty end end',mr={context:{row_keys:["high_level","low_level"],fields:"supported"},get:{row_keys:["children"],fields:"supported"},list:{row_keys:["items"],fields:"supported"},next:{row_keys:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],fields:"unsupported"},search:{row_keys:["items"],fields:"supported"},activity:{row_keys:["activity_digest","compact_activity","provenance_activity","activity"],fields:"unsupported"},history:{row_keys:["compact_history","provenance_history","history","diff"],fields:"unsupported"},deps:{row_keys:["graph.nodes","graph.edges","context.nodes","context.edges"],fields:"unsupported"},health:{row_keys:["checks"],fields:"unsupported"},aggregate:{row_keys:["groups"],fields:"unsupported"},duplicates:{row_keys:["clusters"],fields:"unsupported"},stats:{row_keys:["by_type","by_status"],fields:"unsupported"},comments:{row_keys:["comments"],fields:"unsupported"},notes:{row_keys:["notes"],fields:"unsupported"},learnings:{row_keys:["learnings"],fields:"unsupported"},files:{row_keys:["files"],fields:"unsupported"},docs:{row_keys:["docs"],fields:"unsupported"},validate:{row_keys:["checks","warnings"],fields:"unsupported"},contracts:{row_keys:["command_summaries","commands"],fields:"unsupported"}},pr=[{command:"activity",complete_mode:"full",omissions_by_mode:{digest:[{name:"event_rows",restore_with:"--raw"}],compact:[{name:"provenance",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}},{command:"history",complete_mode:"full",omissions_by_mode:{compact:[{name:"raw_history",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}}];function La(e,t,n){if(e&&t)throw new h(`${n} cannot be combined with --full`,y.USAGE)}function x(e,t=new Set){let n=e.filter(o=>!t.has(o.name)).map(o=>({...o}));return{has_omissions:n.length>0,omitted_field_group_count:n.length,omitted_field_groups:n}}function $a(e,t){let n=pr.find(r=>r.command===e);if(n===void 0)throw new TypeError(`Unknown mode-paired output command: ${e}`);if(t===n.complete_mode)return x([]);let o=n.omissions_by_mode[t];if(o===void 0)throw new TypeError(`Unknown ${e} output mode: ${t}`);return x(o)}var gr=[{name:"hierarchy",restore_with:"--section hierarchy"},{name:"activity",restore_with:"--section activity"},{name:"progress",restore_with:"--section progress"},{name:"blockers",restore_with:"--section blockers"},{name:"recently_created",restore_with:"--section recently_created"},{name:"unparented",restore_with:"--section unparented"},{name:"files",restore_with:"--section files"},{name:"workload",restore_with:"--section workload"},{name:"staleness",restore_with:"--section staleness"},{name:"tests",restore_with:"--section tests"}];function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var yr=new Set([void 0,"tabular_when_uniform"]),hr=new Set(["collection","none"]),br=new Set(["supported","unsupported"]);function Xt(e,t){return Array.isArray(e)&&(t||e.length>0)&&e.every(n=>typeof n=="string"&&n.length>0)&&new Set(e).size===e.length}function wr(e){return R(e)&&typeof e.command=="string"&&e.command.trim().length>0&&hr.has(e.row_kind)&&Xt(e.row_keys,!0)&&(e.continuation_row_keys===void 0||Xt(e.continuation_row_keys,!1))&&br.has(e.fields)&&yr.has(e.toon_encoding)&&(e.row_kind==="collection"?e.row_keys.length>0&&typeof e.jq_selector=="string"&&e.jq_selector.trim().length>0:e.row_keys.length===0&&e.jq_selector===void 0)}var Or={ancestors:["ids"],descendants:["ids"],predecessors:["ids"],successors:["ids"],paths:["paths"],impact:["affected"],audit:["findings"],communities:["communities"],redundancy:["redundant"],dominators:["bottlenecks"],slack:["rows"],centrality:["rows"],articulation:["articulation_points","bridges"],plan:["steps"]},vr={context:["sections_included","high_level","low_level"],get:["item"],list:["items","projection"],next:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items","projection"],activity:["activity_digest","compact_activity","provenance_activity","activity"],history:["compact_history","provenance_history","history","diff"],deps:["tree","graph","projection"],health:["checks"],aggregate:["groups"],duplicates:["clusters"],stats:["totals","by_type","by_status"],comments:["comments"],notes:["notes"],learnings:["learnings"],files:["files"],docs:["docs"],validate:["checks","warnings"],contracts:["command_summaries","commands","selected"]};function kr(e,t){let n=e.trim().toLowerCase().split(/\s+/u,1)[0],o=n?.startsWith("list-")?"list":n;if(o==="graph"){let s=typeof t.subcommand=="string"?t.subcommand:"";if(s.length===0)return;let a=Or[s];if(a===void 0)return;let c=a.filter(d=>Array.isArray(t[d])||R(t[d]));return{command:"graph",row_kind:c.length>0?"collection":"none",row_keys:c,fields:"unsupported",...c.length>0?{jq_selector:Ce}:{},toon_encoding:"tabular_when_uniform"}}let r=mr[o],i=vr[o];return r===void 0||i===void 0||!i.some(s=>Object.hasOwn(t,s))?void 0:(()=>{let s=r.row_keys.filter(a=>{let c=a.split(".").reduce((d,u)=>R(d)?d[u]:void 0,t);return Array.isArray(c)||R(c)});return{command:o,row_kind:s.length>0?"collection":"none",row_keys:s,fields:r.fields,...s.length>0?{jq_selector:Ce}:{},toon_encoding:"tabular_when_uniform"}})()}function Er(e){if(!R(e.projection)||typeof e.projection.mode!="string"||e.projection.mode.trim().length===0)return;let t=e.projection.declared_field_groups,n=e.projection.included_field_groups;if(!Array.isArray(t)||!Array.isArray(n))return;let o=t.filter(s=>R(s)&&typeof s.name=="string"&&s.name.trim().length>0&&typeof s.restore_with=="string"&&s.restore_with.trim().length>0),r=n.filter(s=>typeof s=="string");if(o.length!==t.length||r.length!==n.length)return;let i=new Set(o.map(s=>s.name));if(!(i.size!==o.length||new Set(r).size!==r.length||r.some(s=>!i.has(s))))return x(o,new Set(r))}function Ar(e){if(!Array.isArray(e.sections_included))return;let t=x(gr,new Set(e.sections_included.filter(n=>typeof n=="string")));return R(e.summary)&&e.summary.scope==="matching_items"&&(t.summary_scope="matching_items"),t}function Rr(e,t,n){if(e==="dependency_provenance")return!1;let o=en(e);if(o!==void 0){let r=n[o.facet];return R(r)&&Object.hasOwn(r,o.member)}return Object.hasOwn(t,e)||(e==="reminders"||e==="events")&&R(n.schedule)&&Object.hasOwn(n.schedule,e)||["files","tests","docs"].includes(e)&&R(n.linked)&&Array.isArray(n.linked[e])&&n.linked[e].length>0}function en(e){let t=e.indexOf(".");return t===-1?void 0:{facet:e.slice(0,t),member:e.slice(t+1)}}function Tr(e){if(!R(e.item))return;let t=e.item,n=["comments","notes","learnings","files","tests","docs","reminders","events"],o=["body","children","claim_state","linked","schedule"],r=Zt.get(e),i=a=>n.includes(a)||a==="body"||a==="dependency_provenance"?t:e,s=["body",...n,...o.slice(1),...r?.has("dependency_provenance")?["dependency_provenance"]:[],...r?.has("blockers")||Object.hasOwn(e,"blockers")?["blockers"]:[],...[...r??[]].filter(a=>en(a)!==void 0)].filter(a=>r===void 0||r.has(a)||Object.hasOwn(i(a),a)).map(a=>({name:a,restore_with:a==="blockers"?"--full":a==="dependency_provenance"?"--fields dependencies":`--fields ${a}`}));return x(s,new Set(s.flatMap(({name:a})=>Rr(a,i(a),e)?[a]:[])))}function Qt(e){if(R(e.projection))return x([{name:"full_item_fields",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_item_fields"]:[]))}function Sr(e){if(!R(e.projection))return x([]);if(typeof e.projection.mode=="string")return x([{name:"full_check_details",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_check_details"]:[]))}function xr(e){if(!(!R(e.selected)||typeof e.selected.summary!="boolean"))return x([{name:"full_contract_catalog",restore_with:"--full"}],new Set(e.selected.summary?[]:["full_contract_catalog"]))}function Cr(e,t){let n=Er(t);if(n!==void 0)return n;let[o]=e.split(/\s+/u,1);if(o==="context")return Ar(t);if(o==="get")return Tr(t);if(o==="list"||o.startsWith("list-"))return Qt(t);if(o==="search")return Qt(t)??x([{name:"projection_metadata",restore_with:"--full"}]);if(o==="health")return Sr(t);if(o==="contracts")return xr(t)}function tn(e,t){if(e===void 0||!R(t))return t;let n=Cr(e,t),o=t.row_contract,r=wr(o)?o:kr(e,t),i=r!==void 0?{...t,row_contract:r}:Object.hasOwn(t,"row_contract")?Object.fromEntries(Object.entries(t).filter(([s])=>s!=="row_contract")):t;return R(i.omission_receipt)||n===void 0?i:{...i,omission_receipt:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e1fd9abd-a586-5302-940e-eec2a3eb8641")}catch{}})();function Xe(e){let t=e.trim().toLowerCase().startsWith("extension:"),n=e.trim().toLowerCase().replace(/^extension:/u,"");if(Ae(n))return;let o=qt()?.commands??[],r=[...o].reverse().find(s=>s.command===n)?.command??(t?void 0:o.find(s=>s.action===n)?.command),i=[...o].reverse().find(s=>s.command===r);return i===void 0||Ae(i.command)||Ae(i.action)?void 0:i}function Ir(e){let t=Xe(e);return t?.read_output===void 0?void 0:t}function jr(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new h("Read-only extension commands must return a structured object.",y.USAGE,{code:"extension_read_output_invalid"});for(let n of e.row_keys){let o=t;for(let r of n.split("."))o=typeof o=="object"&&o!==null&&Object.hasOwn(o,r)?Reflect.get(o,r):void 0;if(o===null||typeof o!="object")throw new h(`Read-only extension result is missing declared row collection ${n}.`,y.USAGE,{code:"extension_read_output_invalid",required:`Return ${n} as an object or array (an empty collection is valid); an output_format service renders the compact receipt from it.`,why:"A command that declares read_output.row_keys promises those row collections, and pm checks them before projection, budgeting or custom formatting."})}}function nn(e,t){let n=Ir(e),o=n?.read_output;return o===void 0?t:(jr(o,t),{...t,row_contract:{command:`extension:${n.command}`,row_kind:o.row_keys.length>0?"collection":"none",row_keys:[...o.row_keys],fields:"supported",...o.row_keys.length>0?{jq_selector:Ce}:{},toon_encoding:"tabular_when_uniform"}})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="040fff2e-c66f-5091-9ea8-7dcdaf6e203b")}catch{}})();var Qe={list:{include:["--brief","--compact","--fields","--full"],amount:["--after","--limit","--no-truncate"],cost:["--token-budget"],encoding:["--format","--stream"]},context:{include:["--fields","--section"],amount:["--after","--depth","--limit"],cost:["--token-budget"],encoding:["--format"]},search:{include:["--compact","--fields","--full"],amount:["--after","--limit"],cost:["--token-budget"],encoding:["--format"]},get:{include:["--fields","--full"],amount:["--depth"],cost:["--token-budget"],encoding:["--format"]},next:{amount:["--blocked-limit","--limit"],encoding:["--format"]},health:{include:["--brief","--check-only","--full","--summary"]},deps:{include:["--collapse","--full","--summary"],amount:["--edge-limit","--max-depth","--node-limit"],cost:["--token-budget"],encoding:["--format"]},graph:{include:["--full","--summary"],amount:["--after","--limit","--max-depth","--max-paths"]},history:{include:["--compact","--full"],amount:["--limit"],encoding:["--format"]},activity:{include:["--compact","--full"],amount:["--limit","--unbounded","--after"],encoding:["--stream"]},validate:{include:["--counts","--full"]},events:{include:["--full"],amount:["--limit"],encoding:["--follow"]},contracts:{include:["--full","--summary"]},comments:{amount:["--limit"]},notes:{amount:["--limit"]},learnings:{amount:["--limit"]},files:{amount:["--limit","--no-truncate","--offset"]},docs:{},stats:{},aggregate:{},duplicates:{amount:["--limit"]},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},Ze=new Set(["--collapse","--fields","--section"]),Ie=Object.freeze({"--after":"--after retains cursor-position semantics; use --output-limit <n> separately to bound returned rows.","--check-only":"--check-only retains health side-effect semantics; --output-include does not suppress vector refresh.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--depth":"--depth retains traversal or detail-depth semantics; --output-limit does not replace it.","--follow":"--follow retains event-tail semantics; --output-format does not enable following.","--max-depth":"--max-depth retains graph traversal-depth semantics; --output-limit does not replace it.","--max-paths":"--max-paths retains graph path-search semantics; use --output-limit separately to bound returned rows.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded --output-budget unbounded.","--offset":"--offset retains positional pagination semantics; use --output-limit separately to bound returned rows.","--stream":"--stream retains command streaming semantics; --output-format selects only static result encoding.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function je(e){return e.slice(2).replaceAll("-","_")}function on(e,t={}){let n=e==="package catalog"||e==="packages catalog"||e==="package-catalog"||(e==="package"||e==="packages"||e==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":e==="package manage"||e==="package-manage"?"package-manage":e.split(" ")[0],o=n.startsWith("list-")?"list":n==="ctx"?"context":n;return se.includes(o)?o:void 0}function et(e){return new Map((Qe[e]?.include??[]).filter(t=>!Ze.has(t)&&Ie[t]===void 0).map(t=>[je(t),tt(t)]))}function tt(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2335ae7f-c7aa-5bdd-ac2e-e6d7a74be2e1")}catch{}})();var De="changed_fields",Dr="changed_field_count",nt="rows",Nr=new Set(["apply","rollback"]),cn=new Set(["deleted","would_delete"]),rn=256,sn={start_task:["claim","update"],pause_task:["update","release"],close_task:["close","release"]};function Pr(e,t){if(!T(e)||typeof e.action!="string"||typeof e.id!="string"||e.id.length===0)return null;let n=Object.hasOwn(sn,e.action)?sn[e.action]:void 0;if(!n||!n.every(i=>{let s=e[i];return T(s)&&T(s.item)&&s.item.id===e.id&&Array.isArray(s.changed_fields)&&s.changed_fields.every(a=>typeof a=="string")}))return null;let o=e[n.at(-1)],r=dn(o);return t.idOnly?r:!t.compactEnvelope&&t.changedFields!=="compact"?null:{...e,...t.compactEnvelope?{...r,changed_field_count:new Set(n.flatMap(i=>e[i].changed_fields)).size}:{},...Object.fromEntries(n.map(i=>[i,ln(e[i],t)]))}}function an(e){return typeof e!="string"||e.length<=rn?e:`${Re(e,rn-1)}\u2026`}function Mr(e){if(!T(e))return null;let t={...e};return t.reason=an(t.reason),T(t.previous_terminal)&&(t.previous_terminal=Object.fromEntries(Object.entries(t.previous_terminal).map(([n,o])=>[n,an(o)]))),t}function T(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function un(e){let t=e[De];if(!Array.isArray(t))return null;let n=Object.getPrototypeOf(e)===null?Object.create(null):{};for(let[o,r]of Object.entries(e))o!==De&&(n[o]=r);return n[Dr]=t.length,n}function Ur(e){return"item"in e&&Array.isArray(e[De])}function Lr(e){return typeof e.mode=="string"&&Nr.has(e.mode)&&Array.isArray(e[nt])}function $r(e,t){let n=Object.getPrototypeOf(e)===null?Object.create(null):{};return Object.assign(n,e),n[nt]=t,n}function dn(e){if(!T(e))return null;let t=T(e.item)?e.item:T(e.plan)?e.plan:null;if(t===null)return null;let n=typeof t.id=="string"?t.id:void 0,o=typeof e.outcome=="string"&&cn.has(e.outcome)?e.outcome:typeof t.status=="string"?t.status:void 0;return n?o?{id:n,status:o,...typeof e.deleted=="boolean"?{deleted:e.deleted}:{}}:{id:n}:null}function Br(e,t){if(!T(e))return null;if(T(e.plan)&&T(e.mutation_receipt)&&e.mutation_receipt.kind==="plan_mutation"&&e.mutation_receipt.id===e.plan.id&&e.mutation_receipt.action===e.action)return e.mutation_receipt;if(!t||!T(e.item)||typeof e.item.id!="string")return null;let n=e[De];if(!Array.isArray(n))return null;let o={id:e.item.id,...typeof e.outcome=="string"&&cn.has(e.outcome)?{status:e.outcome}:typeof e.item.status=="string"?{status:e.item.status}:{},...typeof e.deleted=="boolean"?{deleted:e.deleted}:{},...typeof e.previous_status=="string"?{previous_status:e.previous_status}:{},changed_field_count:n.length};return Fr(e,e.item,o),o}function Fr(e,t,n){let o=typeof e.close_reason=="string"?e.close_reason:typeof t.close_reason=="string"?t.close_reason:void 0;o!==void 0&&(n.close_reason=o);let r=Mr(e.recurrence);r!==null&&(n.recurrence=r),Array.isArray(e.warnings)&&e.warnings.length>0&&(n.warnings=e.warnings);for(let i of["recovery","follow_up","handoff","completion","start"])T(e[i])&&(n[i]=e[i]);if(typeof e.claimed_by=="string"||typeof e.released_by=="string")for(let i of["claimed_by","released_by","previous_assignee","forced","skipped","available","attempts","start_refused","suggestions"])Object.hasOwn(e,i)&&(n[i]=e[i])}function Gr(e){let t=Lr(e)?e[nt]:void 0;if(!Array.isArray(t))return{projected:e,changed:!1};let n=!1,o=t.map(r=>{if(!T(r))return r;let i=un(r);return i?(n=!0,i):r});return n?{projected:$r(e,o),changed:!0}:{projected:e,changed:!1}}function ln(e,t={}){let n=Pr(e,t);if(n!==null)return n;if(t.idOnly===!0){let a=dn(e);if(a!==null)return a}if(t.compactEnvelope===!0||t.changedFields==="compact"){let a=Br(e,t.compactEnvelope===!0);if(a!==null)return a}if((t.changedFields??"full")==="full"||!T(e))return e;let o=!1,r=e,i=Ur(e)?un(e):null;i!==null&&(r=i,o=!0);let s=Gr(r);return s.changed&&(r=s.projected,o=!0),o?r:e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1f8bc22d-02b9-522a-a2cd-0d34bf6e3ec3")}catch{}})();import{AsyncLocalStorage as Ai}from"node:async_hooks";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9bb3b2ed-c289-5b96-99ce-9df6e202c464")}catch{}})();var fn=new Set(["--pm-path","--path","--author","--expect-hash","--output-include","--output-limit","--output-budget","--output-format","--format","--output-session","--output-cursor"]),qr=new Set(["--no-extensions","--no-pager","--json","--quiet","--lean","--token-accounting","--output-row-contract","--all"]);function zr(e){let t=e.indexOf("=");return t>0&&fn.has(e.slice(0,t))}function Wr(e,t){return typeof t!="string"?!1:e==="--path"||e==="--pm-path"||!t.startsWith("-")}function _n(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")return;if(fn.has(n)){t+=Wr(n,e[t+1])?1:0;continue}if(!(zr(n)||qr.has(n)||n==="--profile"||n==="--id-only"||n==="--explain")&&!n.startsWith("-"))return t}}function Qa(e){let t=_n(e);return t===void 0?void 0:e[t].trim().toLowerCase()}import Kr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f08c44a-dfdf-5c23-8f68-0e3ed73582b0")}catch{}})();var ot=new WeakMap;function _c(e){ot.set(e,e.path)}function Vr(e){if(!process.env.PM_PATH?.trim())return;let t=Lt(e);return Mt($t(t),e)&&t===Ut(e)?void 0:Kr.relative(e,t)||"."}function mc(e,t=process.cwd()){let n=ot.has(e)?ot.get(e):e.path,o=n?.trim()?n:Vr(t),r=o?["--pm-path",o]:[];return e.noExtensions&&r.push("--no-extensions"),r}import{createHash as si}from"node:crypto";import{createHash as Zr}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f539ecb5-2f49-5867-96c7-48eddb81a628")}catch{}})();var Hr=new Set(["applied_bound","completeness","budget_retention_policy","continuation_contract","continuation_kind","continuation_path","filters","omission_receipt","output_budget_truncation","projection","read_output","read_session","row_contract","sorting"]);function E(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function mn(e,t){let n=e;for(let o of t.split("."))if(Array.isArray(n)){if(!/^\d+$/u.test(o))return;n=n[Number(o)]}else{if(!E(n))return;n=n[o]}return n}function rt(e,t,n){let o=t.split("."),r=(i,s)=>{if(s===o.length)return n;let a=o[s];if(Array.isArray(i)){let d=Number(a),u=[...i];return u[d]=r(i[d],s+1),u}let c=i;return{...c,[a]:r(c[a],s+1)}};return r(e,0)}function it(e,t,n,o){let r=Y(e).find(a=>a.path===t);if(!r)return e;let i=Array.isArray(r.value)?r.value.slice(n,o):Object.fromEntries(Object.entries(r.value).slice(n,o)),s=rt(e,t,i);return E(s.summary)&&E(s.summary.focus_row_states)&&typeof s.summary.focus_row_states[t]=="string"&&(s.summary={...s.summary,focus_row_states:{...s.summary.focus_row_states,[t]:s.summary.focus_row_states[t].slice(n,o)}}),de(s),s}function Pe(e){let t=e.row_contract;return E(t)&&Array.isArray(t.row_keys)?t.row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Object.entries(e).filter(([,n])=>Array.isArray(n)).map(([n])=>n)}function Jr(e){let t=e.row_contract;return E(t)&&Array.isArray(t.continuation_row_keys)?t.continuation_row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Pe(e)}function D(e){return Pe(e).flatMap(t=>{let n=mn(e,t);return Array.isArray(n)||E(n)?[{path:t,value:n}]:[]})}function Y(e){return Jr(e).flatMap(t=>{let n=mn(e,t);return Array.isArray(n)||E(n)?[{path:t,value:n}]:[]})}function ce(e){let t=D(e),n=new Set(t.map(r=>r.path)),o=(r,i)=>{if(Array.isArray(r)){n.has(i)||t.push({path:i,value:r}),r.forEach((s,a)=>o(s,`${i}.${a}`));return}if(E(r))for(let[s,a]of Object.entries(r))i.length===0&&Hr.has(s)||o(a,i.length===0?s:`${i}.${s}`)};return o(e,""),t}function X(e){return D(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function ue(e,t){let n=e;for(let o of D(n)){let r=Array.isArray(o.value)?o.value.map((i,s)=>t(i,o.path,s)):Object.fromEntries(Object.entries(o.value).map(([i,s],a)=>[i,t(s,o.path,a)]));n=rt(n,o.path,r)}return n}function pn(e,t,n=()=>!1){let o=e,r=!1;for(let i of D(o)){let s=Array.isArray(i.value)?i.value:Object.entries(i.value);if(s.length<=t)continue;r=!0;let a=n(i.path)?s.length-t:0,c=s.slice(a,a+t),d=Array.isArray(i.value)?c:Object.fromEntries(c);o=rt(o,i.path,d)}return{result:o,truncated:r}}var gn=["high_level","low_level","blocked_fallback"];function Ne(e){let t=e.status==="in_progress"?"i":"o";return e.blocked===!0?t.toUpperCase():t}function gc(e,t){if(!E(e.summary)||!E(e.summary.returned_focus))return;let n=new Map(t.map(o=>[o.id,o]));e.summary={...e.summary,focus_row_states:Object.fromEntries(gn.map(o=>[o,Array.isArray(e[o])?e[o].filter(E).map(r=>Ne(n.get(r.id)??r)).join(""):""]))}}function Yr(e,t){if(e!==void 0){if(typeof e!="string"||e.length!==t||!/^[iIoO]*$/u.test(e))throw new TypeError("Context focus classification receipt must contain one i/I/o/O code per delivered record");return e}}function Xr(e,t,n,o){let r=Array.isArray(t[n])?t[n].filter(E):[],i=Yr(o[n],r.length)??r.map(Ne).join(""),s=new Map(r.flatMap((d,u)=>d.id===void 0?[]:[[d.id,i[u]]])),a=Array.isArray(e[n])?e[n].filter(E):[],c=!1;return{states:a.map((d,u)=>{let _=s.get(d.id)??(d.id===void 0?i[u]:void 0)??Ne(d);return _!==Ne(d)&&(c=!0),_}).join(""),needsStates:c}}function Qr(e,t){typeof e.count=="number"&&(e.count_only===!0||t.count_only===!0?typeof t.count=="number"&&(e.count=t.count):Array.isArray(e.items)&&(e.count=e.items.length))}function de(e,t=e){if(Qr(e,t),!E(e.summary)||!E(e.summary.returned_focus))return;let n={...e.summary},o=E(t.summary)&&E(t.summary.focus_row_states)?t.summary.focus_row_states:{},r=gn.map(c=>({key:c,...Xr(e,t,c,o)})),i=Object.fromEntries(r.map(({key:c,states:d})=>[c,d])),s=r.some(c=>c.needsStates),a=Object.values(i).join("");typeof n.high_level=="number"&&(n.high_level=Array.isArray(e.high_level)?e.high_level.length:0),typeof n.low_level=="number"&&(n.low_level=Array.isArray(e.low_level)?e.low_level.length:0),n.returned_focus={active_items:a.length,in_progress:[...a].filter(c=>c.toLowerCase()==="i").length,open:[...a].filter(c=>c.toLowerCase()==="o").length,blocked:[...a].filter(c=>c===c.toUpperCase()).length},s?n.focus_row_states=i:delete n.focus_row_states,e.summary=n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e8cd9862-6b60-599e-9a19-b97fd7b1ce1f")}catch{}})();var ei=4096,ti=Object.freeze(["queue_draining","queue_entries","queue_exists","queue_high_retry_entries","queue_invalid_rows","queue_max_attempts","queue_rows_total","queue_size_bytes","pending_otel_spans","last_attempted_flush_at","last_failed_flush_at","last_otel_attempt_at","last_otel_failure_at","last_otel_success_at","last_successful_flush_at"]),hn=Object.freeze({health:Object.freeze({version:3,paths:Object.freeze(["checks"]),ignored_detail_field_names_by_row:Object.freeze({telemetry:ti}),guarantee:"nonvolatile_snapshot_and_stable_configuration"})});function Q(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function bn(e,t,n=e,o){let r=Object.hasOwn(S,t)?S[t]:void 0;if(r?.delivered_row_counters===void 0)return;let i=r.paths[0],s=e[i],a=n[i];if(!Array.isArray(s)||!Array.isArray(a))return;let c=o??a.length,d=a.slice(Math.max(0,c-s.length),c);for(let u of r.delivered_row_counters)typeof e[u.key]=="number"&&(e[u.key]=d.filter(_=>Q(_)&&_[u.field]===u.equals).length)}function le(e){return Array.isArray(e)?e.map(le):Q(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,le(n)])):e}function yn(e,t){if(!Q(e))return le(e);let n=typeof e.name=="string"?e.name:void 0,o=n!==void 0&&Object.hasOwn(t.ignored_detail_field_names_by_row,n)?t.ignored_detail_field_names_by_row[n]:void 0;return Object.fromEntries(Object.entries(e).map(([r,i])=>r!=="details"||!o||!Q(i)?[r,le(i)]:[r,Object.fromEntries(Object.entries(i).filter(([s])=>!o.includes(s)).map(([s,a])=>[s,le(a)]))]))}function ni(e,t){return Array.isArray(e)?e.map(n=>yn(n,t)):yn(e,t)}function Me(e,t,n){let o=n?hn[n]:void 0,r=o?.paths.includes(e)===!0;return Zr("sha256").update(ve({path:e,value:r?ni(t,o):t,...r?{fingerprint_policy_version:o.version}:{}})).digest("base64url").slice(0,16)}function st(e){return Buffer.from(JSON.stringify({v:1,c:e.command,p:e.path,o:e.offset,n:e.total_rows,f:e.fingerprint,...e.direction==="backward"?{d:"b"}:{}}),"utf8").toString("base64url")}function oi(e){return typeof e=="string"&&(F(e)===e||/^extension:\S(?:[^\r\n]*\S)?$/u.test(e))}function ri(e){return e===void 0||e==="b"}function ii(e){if(Se(e))throw new h("The read-output continuation cursor was shortened by output compaction: it contains an ellipsis, which no cursor encoder emits.",y.USAGE,{code:"read_output_cursor_invalid",reason:"cursor_compacted",required:"Pass the whole cursor the previous page emitted; a shortened cursor cannot resume the read.",nextSteps:["Re-read the previous page with a larger --output-budget (or --output-budget unbounded) and pass its whole output_cursor to --output-cursor."]})}function fe(e){if(ii(e),e.length>ei)throw new h("The read-output continuation cursor is malformed or unsupported.",y.USAGE,{code:"read_output_cursor_invalid"});let t;try{t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{t=null}if(!Q(t)||t.v!==1||!oi(t.c)||typeof t.p!="string"||t.p.length===0||!Number.isSafeInteger(t.o)||t.o<0||!Number.isSafeInteger(t.n)||t.n<1||typeof t.f!="string"||t.f.length===0||!ri(t.d))throw new h("The read-output continuation cursor is malformed or unsupported.",y.USAGE,{code:"read_output_cursor_invalid"});return{version:1,command:t.c,path:t.p,offset:t.o,total_rows:t.n,fingerprint:t.f,...t.d==="b"?{direction:"backward"}:{}}}function wn(e){if(!Array.isArray(e.assertions))return e;let t=n=>!Q(n)||n.verdict==="pass"?4:n.verdict==="retired"?3:n.enforcement==="block"?0:n.enforcement==="warn"?1:2;return{...e,assertions:e.assertions.map((n,o)=>({row:n,index:o})).sort((n,o)=>t(n.row)-t(o.row)||n.index-o.index).map(({row:n})=>n),budget_retention_policy:"verdict_priority"}}function On(e,t,n){if(!n)return e;if(n.command!==t)throw new h(`The read-output cursor belongs to ${n.command}, not ${t}.`,y.USAGE,{code:"read_output_cursor_command_mismatch"});let o=Y(e).find(c=>c.path===n.path),r=o?Array.isArray(o.value)?o.value.length:Object.keys(o.value).length:0,i=B(t,n.path);if(!o||r!==n.total_rows||n.offset>r||i!==(n.direction==="backward")||Me(n.path,o.value,t)!==n.fingerprint)throw new h("The read-output continuation no longer matches the declared row collection; restart the bounded read.",y.USAGE,{code:"read_output_cursor_stale"});if(!i)return it(e,n.path,n.offset);let s=it(e,n.path,0,n.offset);for(let c of["count","returned_count"])typeof s[c]=="number"&&(s[c]=n.offset);let a=S[t].total_key;return typeof s[a]!="number"&&(s[a]=n.total_rows),s}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9c5d8732-3e10-5224-a558-e870397090f2")}catch{}})();var ct=1,vn=4096,ai=/^[A-Za-z0-9_-]+$/;function at(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function Nc(e,t){let n=[...Object.values(ke),...Ee],o=new Set(n.flatMap(r=>[at(r),r.slice(2).replaceAll("-","_")]));for(let r of t)if(r.cursor_semantics==="presentation"){o.add(at(r.flag));for(let i of r.aliases??[])o.add(at(i))}return Object.fromEntries(Object.entries(e).filter(([r])=>!o.has(r)))}function Pc(e,t){return si("sha256").update(e).update("\0").update(ve(t)).digest("hex").slice(0,24)}function _e(e,t,n,o){return Buffer.from(JSON.stringify({version:ct,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...o===void 0?{}:{snapshot:o}})).toString("base64url")}function G(e,t){return new h(e,y.USAGE,{code:"invalid_query_cursor",nextSteps:[`Repeat the original query without ${t} to obtain a fresh cursor.`]})}function ci(e){return new h("Query cursor was shortened by output compaction: it contains an ellipsis, which no cursor encoder emits.",y.USAGE,{code:"invalid_query_cursor",reason:"cursor_compacted",required:"Pass the whole cursor the previous page emitted; a shortened cursor cannot resume the query.",nextSteps:[`Re-read the previous page with a larger --output-budget (or --output-budget unbounded) and pass its whole next_cursor to ${e}.`,`Or repeat the original query without ${e} to obtain a fresh cursor.`]})}function ui(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===ct&&typeof t.fingerprint=="string"&&typeof t.after_id=="string"&&t.after_id.length>0&&(t.after_index===void 0||Number.isSafeInteger(t.after_index)&&t.after_index>=0)&&(t.snapshot===void 0||typeof t.snapshot=="string"&&t.snapshot.length>0)}function ut(e,t="--after"){if(typeof e!="string")throw G("Query cursor is malformed.",t);let n=e.trim();if(Se(n))throw ci(t);if(n.length===0||n.length>vn||!ai.test(n))throw G("Query cursor is malformed.",t);let o;try{o=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{throw G("Query cursor is malformed.",t)}if(!ui(o)){let r=!1;try{fe(n),r=!0}catch{}throw r?new h(`An output cursor must be continued with --output-cursor, not ${t}.`,y.USAGE,{code:"invalid_query_cursor",nextSteps:[`Repeat the same query, replacing ${t} with --output-cursor ${n}; retain any producer ${t} cursor from the original page.`]}):G("Query cursor version or payload is unsupported.",t)}return o}function dt(e,t,n="--after"){let o=ut(e,n);if(o.fingerprint!==t)throw G(`Query cursor does not match the current filters, sort, or query (${o.fingerprint} != ${t}).`,n);return{after_id:o.after_id,...o.after_index===void 0?{}:{after_index:o.after_index},...o.snapshot===void 0?{}:{snapshot:o.snapshot}}}function Mc(e,t){return dt(e,t).after_id}function di(e,t,n,o,r="--after"){if(t===void 0)return 0;let i=dt(t,n,r),s=e.findIndex(a=>o(a)===i.after_id);if(s<0){if(i.after_index!==void 0)return Math.min(i.after_index,e.length);throw G(`Query cursor item ${i.after_id} is no longer present in this result set.`,r)}return s+1}function Uc(e,t){if(t.cursor!==void 0&&dt(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw G("Query cursor does not match the requested snapshot.","--after");let n=di(e,t.cursor,t.fingerprint,t.readId),o=e.slice(n,n+t.limit),r=o.length>0&&n+o.length<e.length,i=o.at(-1);return{rows:o,has_more:r,...r&&i!==void 0?{next_cursor:_e(t.fingerprint,t.readId(i),n+o.length-1,t.snapshot)}:{}}}var Lc=Object.freeze({version:ct,max_length:vn});import{randomUUID as pi}from"node:crypto";import{randomUUID as li}from"node:crypto";import{constants as Z}from"node:fs";import{lstat as kn,mkdir as fi,open as An,rename as _i,rm as mi}from"node:fs/promises";import Ue from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="71b65888-baa5-5c5f-a02c-4a0fd818fadb")}catch{}})();var I={max_serving_rows:256,max_bytes:262144,max_event_bytes:32768,retained_byte_fraction:.5,max_events:2048,retention_days:30},k=class extends TypeError{code="context_usage_validation_failed";constructor(t){super(t),this.name="ContextUsageValidationError"}};function q(e){let t=Date.parse(e.now??new Date().toISOString());if(!Number.isFinite(t))throw new k("Context usage now must be a valid timestamp");return{iso:new Date(t).toISOString(),ms:t}}function Rn(e){let t=e.maxBytes??I.max_bytes,n=e.maxEvents??I.max_events,o=e.retentionDays??I.retention_days;if(!Number.isSafeInteger(t)||t<1024||t>I.max_bytes||!Number.isSafeInteger(n)||n<1||!Number.isFinite(o)||o<=0)throw new k("Context usage retention requires positive maxEvents and retentionDays, and maxBytes from 1024 through 262144");return{maxBytes:t,maxEvents:n,cutoff:q(e).ms-o*864e5}}async function Tn(e,t){if(!(await kn(Ue.dirname(e))).isDirectory())throw new k("Context usage runtime must be a real directory");try{if((await kn(e)).isSymbolicLink())throw new k("Context usage ledger must not be a symbolic link")}catch(o){if(!Pt(o))throw o}let n=await An(e,t|Z.O_NOFOLLOW|Z.O_NONBLOCK,384);try{let o=await n.stat();if(!o.isFile()||o.nlink!==1)throw new k("Context usage ledger must be an unshared regular file");return n}catch(o){throw await n.close(),o}}async function Le(e){let t=Rn(e);try{let n=await Tn(Ue.join(e.pmRoot,"runtime","context-usage.jsonl"),Z.O_RDONLY);try{let o=(await n.stat()).size,r=Math.max(0,o-t.maxBytes),i=Buffer.alloc(Math.min(o,t.maxBytes)),{bytesRead:s}=await n.read(i,0,i.length,r),a=i.subarray(0,s).toString("utf8");return(r>0?a.includes(`
7
+ Diagnostic output exceeded its declared ${s}-token ceiling; rerun with structured JSON for the bounded recovery envelope.`,l=Wt(t).trim()||"Inspect the diagnostic code and retry with corrected input.",f=Math.max(1,s*4-Buffer.byteLength(`${u}${_}`,"utf8")),m=d?`${u}${L(l,f)}${_}`:a;return{output:m,diagnostic_output:{diagnostic_class:o,format:"text",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:c,estimated_tokens:$(Buffer.byteLength(m,"utf8")),truncated:d,degradation_steps:d?[...r.degradation_ladder]:["full"],omitted_fields:d?["explanation","collections"]:[]}}}var Ye=Object.freeze({required:"Adjust command input or tracker state and retry.",why:Object.freeze(["pm enforces explicit, deterministic contracts for data and command semantics.","Commander validates CLI contracts before execution.","Unexpected runtime failures can occur from environment or extension-level issues.","Validation protects data consistency and deterministic behavior across commands.","Required options define command intent and enforce deterministic write contracts."]),examples:Object.freeze(["pm --help","pm <command> --help"])});function Sa(e){return e?.trim()===Ye.required}function xa(e){let t=e?.trim();return t!==void 0&&Ye.why.includes(t)}function Ca(e){return(e??[]).filter(t=>!Ye.examples.includes(t.trim()))}var Ia=Object.freeze(["attempted_command","normalized_args","provided_fields"]);function ja(e){if(!e)return;let{attempted_command:t,normalized_args:n,provided_fields:o,...r}=e;return Object.values(r).some(i=>i!==void 0)?r:void 0}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3a351971-6cfb-55eb-a266-3fec0af9eaa4")}catch{}})();var S=Object.freeze({comments:Object.freeze({paths:Object.freeze(["comments"]),total_key:"total_count"}),notes:Object.freeze({paths:Object.freeze(["notes"]),total_key:"total_count",delivered_row_counters:Object.freeze([Object.freeze({key:"structured_event_count",field:"format",equals:"json"})])}),learnings:Object.freeze({paths:Object.freeze(["learnings"]),total_key:"total_count"})});function B(e,t){return e===void 0?!1:(Object.hasOwn(S,e)?S[e]:void 0)?.paths.includes(t)===!0}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a65d6520-0e6f-5627-a4dd-bd455c2db0fa")}catch{}})();var Zt=new WeakMap;function Ua(e,t){Zt.set(e,new Set(t))}var Ce='.row_contract.row_keys[] as $key | getpath($key | split(".")) | if type == "array" then .[] else if type == "object" then to_entries[] else empty end end',mr={context:{row_keys:["high_level","low_level"],fields:"supported"},get:{row_keys:["children"],fields:"supported"},list:{row_keys:["items"],fields:"supported"},next:{row_keys:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],fields:"unsupported"},search:{row_keys:["items"],fields:"supported"},activity:{row_keys:["activity_digest","compact_activity","provenance_activity","activity"],fields:"unsupported"},history:{row_keys:["compact_history","provenance_history","history","diff"],fields:"unsupported"},deps:{row_keys:["graph.nodes","graph.edges","context.nodes","context.edges"],fields:"unsupported"},health:{row_keys:["checks"],fields:"unsupported"},aggregate:{row_keys:["groups"],fields:"unsupported"},duplicates:{row_keys:["clusters"],fields:"unsupported"},stats:{row_keys:["by_type","by_status"],fields:"unsupported"},comments:{row_keys:["comments"],fields:"unsupported"},notes:{row_keys:["notes"],fields:"unsupported"},learnings:{row_keys:["learnings"],fields:"unsupported"},files:{row_keys:["files"],fields:"unsupported"},docs:{row_keys:["docs"],fields:"unsupported"},validate:{row_keys:["checks","warnings"],fields:"unsupported"},contracts:{row_keys:["command_summaries","commands"],fields:"unsupported"}},pr=[{command:"activity",complete_mode:"full",omissions_by_mode:{digest:[{name:"event_rows",restore_with:"--raw"}],compact:[{name:"provenance",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}},{command:"history",complete_mode:"full",omissions_by_mode:{compact:[{name:"raw_history",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}}];function La(e,t,n){if(e&&t)throw new h(`${n} cannot be combined with --full`,y.USAGE)}function x(e,t=new Set){let n=e.filter(o=>!t.has(o.name)).map(o=>({...o}));return{has_omissions:n.length>0,omitted_field_group_count:n.length,omitted_field_groups:n}}function $a(e,t){let n=pr.find(r=>r.command===e);if(n===void 0)throw new TypeError(`Unknown mode-paired output command: ${e}`);if(t===n.complete_mode)return x([]);let o=n.omissions_by_mode[t];if(o===void 0)throw new TypeError(`Unknown ${e} output mode: ${t}`);return x(o)}var gr=[{name:"hierarchy",restore_with:"--section hierarchy"},{name:"activity",restore_with:"--section activity"},{name:"progress",restore_with:"--section progress"},{name:"blockers",restore_with:"--section blockers"},{name:"recently_created",restore_with:"--section recently_created"},{name:"unparented",restore_with:"--section unparented"},{name:"files",restore_with:"--section files"},{name:"workload",restore_with:"--section workload"},{name:"staleness",restore_with:"--section staleness"},{name:"tests",restore_with:"--section tests"}];function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var yr=new Set([void 0,"tabular_when_uniform"]),hr=new Set(["collection","none"]),br=new Set(["supported","unsupported"]);function Xt(e,t){return Array.isArray(e)&&(t||e.length>0)&&e.every(n=>typeof n=="string"&&n.length>0)&&new Set(e).size===e.length}function wr(e){return R(e)&&typeof e.command=="string"&&e.command.trim().length>0&&hr.has(e.row_kind)&&Xt(e.row_keys,!0)&&(e.continuation_row_keys===void 0||Xt(e.continuation_row_keys,!1))&&br.has(e.fields)&&yr.has(e.toon_encoding)&&(e.row_kind==="collection"?e.row_keys.length>0&&typeof e.jq_selector=="string"&&e.jq_selector.trim().length>0:e.row_keys.length===0&&e.jq_selector===void 0)}var Or={ancestors:["ids"],descendants:["ids"],predecessors:["ids"],successors:["ids"],paths:["paths"],impact:["affected"],audit:["findings"],communities:["communities"],redundancy:["redundant"],dominators:["bottlenecks"],slack:["rows"],centrality:["rows"],articulation:["articulation_points","bridges"],plan:["steps"]},vr={context:["sections_included","high_level","low_level"],get:["item"],list:["items","projection"],next:["recommended","ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items","projection"],activity:["activity_digest","compact_activity","provenance_activity","activity"],history:["compact_history","provenance_history","history","diff"],deps:["tree","graph","projection"],health:["checks"],aggregate:["groups"],duplicates:["clusters"],stats:["totals","by_type","by_status"],comments:["comments"],notes:["notes"],learnings:["learnings"],files:["files"],docs:["docs"],validate:["checks","warnings"],contracts:["command_summaries","commands","selected"]};function kr(e,t){let n=e.trim().toLowerCase().split(/\s+/u,1)[0],o=n?.startsWith("list-")?"list":n;if(o==="graph"){let s=typeof t.subcommand=="string"?t.subcommand:"";if(s.length===0)return;let a=Or[s];if(a===void 0)return;let c=a.filter(d=>Array.isArray(t[d])||R(t[d]));return{command:"graph",row_kind:c.length>0?"collection":"none",row_keys:c,fields:"unsupported",...c.length>0?{jq_selector:Ce}:{},toon_encoding:"tabular_when_uniform"}}let r=mr[o],i=vr[o];return r===void 0||i===void 0||!i.some(s=>Object.hasOwn(t,s))?void 0:(()=>{let s=r.row_keys.filter(a=>{let c=a.split(".").reduce((d,u)=>R(d)?d[u]:void 0,t);return Array.isArray(c)||R(c)});return{command:o,row_kind:s.length>0?"collection":"none",row_keys:s,fields:r.fields,...s.length>0?{jq_selector:Ce}:{},toon_encoding:"tabular_when_uniform"}})()}function Er(e){if(!R(e.projection)||typeof e.projection.mode!="string"||e.projection.mode.trim().length===0)return;let t=e.projection.declared_field_groups,n=e.projection.included_field_groups;if(!Array.isArray(t)||!Array.isArray(n))return;let o=t.filter(s=>R(s)&&typeof s.name=="string"&&s.name.trim().length>0&&typeof s.restore_with=="string"&&s.restore_with.trim().length>0),r=n.filter(s=>typeof s=="string");if(o.length!==t.length||r.length!==n.length)return;let i=new Set(o.map(s=>s.name));if(!(i.size!==o.length||new Set(r).size!==r.length||r.some(s=>!i.has(s))))return x(o,new Set(r))}function Ar(e){if(!Array.isArray(e.sections_included))return;let t=x(gr,new Set(e.sections_included.filter(n=>typeof n=="string")));return R(e.summary)&&e.summary.scope==="matching_items"&&(t.summary_scope="matching_items"),t}function Rr(e,t,n){if(e==="dependency_provenance")return!1;let o=en(e);if(o!==void 0){let r=n[o.facet];return R(r)&&Object.hasOwn(r,o.member)}return Object.hasOwn(t,e)||(e==="reminders"||e==="events")&&R(n.schedule)&&Object.hasOwn(n.schedule,e)||["files","tests","docs"].includes(e)&&R(n.linked)&&Array.isArray(n.linked[e])&&n.linked[e].length>0}function en(e){let t=e.indexOf(".");return t===-1?void 0:{facet:e.slice(0,t),member:e.slice(t+1)}}function Tr(e){if(!R(e.item))return;let t=e.item,n=["comments","notes","learnings","files","tests","docs","reminders","events"],o=["body","children","claim_state","linked","schedule"],r=Zt.get(e),i=a=>n.includes(a)||a==="body"||a==="dependency_provenance"?t:e,s=["body",...n,...o.slice(1),...r?.has("dependency_provenance")?["dependency_provenance"]:[],...r?.has("blockers")||Object.hasOwn(e,"blockers")?["blockers"]:[],...[...r??[]].filter(a=>en(a)!==void 0)].filter(a=>r===void 0||r.has(a)||Object.hasOwn(i(a),a)).map(a=>({name:a,restore_with:a==="blockers"?"--full":a==="dependency_provenance"?"--fields dependencies":`--fields ${a}`}));return x(s,new Set(s.flatMap(({name:a})=>Rr(a,i(a),e)?[a]:[])))}function Qt(e){if(R(e.projection))return x([{name:"full_item_fields",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_item_fields"]:[]))}function Sr(e){if(!R(e.projection))return x([]);if(typeof e.projection.mode=="string")return x([{name:"full_check_details",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_check_details"]:[]))}function xr(e){if(!(!R(e.selected)||typeof e.selected.summary!="boolean"))return x([{name:"full_contract_catalog",restore_with:"--full"}],new Set(e.selected.summary?[]:["full_contract_catalog"]))}function Cr(e,t){let n=Er(t);if(n!==void 0)return n;let[o]=e.split(/\s+/u,1);if(o==="context")return Ar(t);if(o==="get")return Tr(t);if(o==="list"||o.startsWith("list-"))return Qt(t);if(o==="search")return Qt(t)??x([{name:"projection_metadata",restore_with:"--full"}]);if(o==="health")return Sr(t);if(o==="contracts")return xr(t)}function tn(e,t){if(e===void 0||!R(t))return t;let n=Cr(e,t),o=t.row_contract,r=wr(o)?o:kr(e,t),i=r!==void 0?{...t,row_contract:r}:Object.hasOwn(t,"row_contract")?Object.fromEntries(Object.entries(t).filter(([s])=>s!=="row_contract")):t;return R(i.omission_receipt)||n===void 0?i:{...i,omission_receipt:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e1fd9abd-a586-5302-940e-eec2a3eb8641")}catch{}})();function Xe(e){let t=e.trim().toLowerCase().startsWith("extension:"),n=e.trim().toLowerCase().replace(/^extension:/u,"");if(Ae(n))return;let o=qt()?.commands??[],r=[...o].reverse().find(s=>s.command===n)?.command??(t?void 0:o.find(s=>s.action===n)?.command),i=[...o].reverse().find(s=>s.command===r);return i===void 0||Ae(i.command)||Ae(i.action)?void 0:i}function Ir(e){let t=Xe(e);return t?.read_output===void 0?void 0:t}function jr(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new h("Read-only extension commands must return a structured object.",y.USAGE,{code:"extension_read_output_invalid"});for(let n of e.row_keys){let o=t;for(let r of n.split("."))o=typeof o=="object"&&o!==null&&Object.hasOwn(o,r)?Reflect.get(o,r):void 0;if(o===null||typeof o!="object")throw new h(`Read-only extension result is missing declared row collection ${n}.`,y.USAGE,{code:"extension_read_output_invalid",required:`Return ${n} as an object or array (an empty collection is valid); an output_format service renders the compact receipt from it.`,why:"A command that declares read_output.row_keys promises those row collections, and pm checks them before projection, budgeting or custom formatting."})}}function nn(e,t){let n=Ir(e),o=n?.read_output;return o===void 0?t:(jr(o,t),{...t,row_contract:{command:`extension:${n.command}`,row_kind:o.row_keys.length>0?"collection":"none",row_keys:[...o.row_keys],fields:"supported",...o.row_keys.length>0?{jq_selector:Ce}:{},toon_encoding:"tabular_when_uniform"}})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="040fff2e-c66f-5091-9ea8-7dcdaf6e203b")}catch{}})();var Qe={list:{include:["--brief","--compact","--fields","--full"],amount:["--after","--limit","--no-truncate"],cost:["--token-budget"],encoding:["--format","--stream"]},context:{include:["--fields","--section"],amount:["--after","--depth","--limit"],cost:["--token-budget"],encoding:["--format"]},search:{include:["--compact","--fields","--full"],amount:["--after","--limit"],cost:["--token-budget"],encoding:["--format"]},get:{include:["--fields","--full"],amount:["--depth"],cost:["--token-budget"],encoding:["--format"]},next:{amount:["--blocked-limit","--limit"],encoding:["--format"]},health:{include:["--brief","--check-only","--full","--summary"]},deps:{include:["--collapse","--full","--summary"],amount:["--edge-limit","--max-depth","--node-limit"],cost:["--token-budget"],encoding:["--format"]},graph:{include:["--full","--summary"],amount:["--after","--limit","--max-depth","--max-paths"]},history:{include:["--compact","--full"],amount:["--limit"],encoding:["--format"]},activity:{include:["--compact","--full"],amount:["--limit","--unbounded","--after"],encoding:["--stream"]},validate:{include:["--counts","--full"]},events:{include:["--full"],amount:["--limit"],encoding:["--follow"]},contracts:{include:["--full","--summary"]},comments:{amount:["--limit"]},notes:{amount:["--limit"]},learnings:{amount:["--limit"]},files:{amount:["--limit","--no-truncate","--offset"]},docs:{},stats:{},aggregate:{},duplicates:{amount:["--limit"]},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},Ze=new Set(["--collapse","--fields","--section"]),Ie=Object.freeze({"--after":"--after retains cursor-position semantics; use --output-limit <n> separately to bound returned rows.","--check-only":"--check-only retains health side-effect semantics; --output-include does not suppress vector refresh.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--depth":"--depth retains traversal or detail-depth semantics; --output-limit does not replace it.","--follow":"--follow retains event-tail semantics; --output-format does not enable following.","--max-depth":"--max-depth retains graph traversal-depth semantics; --output-limit does not replace it.","--max-paths":"--max-paths retains graph path-search semantics; use --output-limit separately to bound returned rows.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded --output-budget unbounded.","--offset":"--offset retains positional pagination semantics; use --output-limit separately to bound returned rows.","--stream":"--stream retains command streaming semantics; --output-format selects only static result encoding.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function je(e){return e.slice(2).replaceAll("-","_")}function on(e,t={}){let n=e==="package catalog"||e==="packages catalog"||e==="package-catalog"||(e==="package"||e==="packages"||e==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":e==="package manage"||e==="package-manage"?"package-manage":e.split(" ")[0],o=n.startsWith("list-")?"list":n==="ctx"?"context":n;return se.includes(o)?o:void 0}function et(e){return new Map((Qe[e]?.include??[]).filter(t=>!Ze.has(t)&&Ie[t]===void 0).map(t=>[je(t),tt(t)]))}function tt(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="975b7c1d-e398-586a-bd50-b3bf0528d24a")}catch{}})();var De="changed_fields",Dr="changed_field_count",nt="rows",Nr=new Set(["apply","rollback"]),cn=new Set(["deleted","would_delete"]),rn=256,sn={start_task:["claim","update"],pause_task:["update","release"],close_task:["close","release"]};function Pr(e,t){if(!T(e)||typeof e.action!="string"||typeof e.id!="string"||e.id.length===0)return null;let n=Object.hasOwn(sn,e.action)?sn[e.action]:void 0;if(!n||!n.every(i=>{let s=e[i];return T(s)&&T(s.item)&&s.item.id===e.id&&Array.isArray(s.changed_fields)&&s.changed_fields.every(a=>typeof a=="string")}))return null;let o=e[n.at(-1)],r=dn(o);return t.idOnly?r:!t.compactEnvelope&&t.changedFields!=="compact"?null:{...e,...t.compactEnvelope?{...r,changed_field_count:new Set(n.flatMap(i=>e[i].changed_fields)).size}:{},...Object.fromEntries(n.map(i=>[i,ln(e[i],t)]))}}function an(e){return typeof e!="string"||e.length<=rn?e:`${Re(e,rn-1)}\u2026`}function Mr(e){if(!T(e))return null;let t={...e};return t.reason=an(t.reason),T(t.previous_terminal)&&(t.previous_terminal=Object.fromEntries(Object.entries(t.previous_terminal).map(([n,o])=>[n,an(o)]))),t}function T(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function un(e){let t=e[De];if(!Array.isArray(t))return null;let n=Object.getPrototypeOf(e)===null?Object.create(null):{};for(let[o,r]of Object.entries(e))o!==De&&(n[o]=r);return n[Dr]=t.length,n}function Ur(e){return"item"in e&&Array.isArray(e[De])}function Lr(e){return typeof e.mode=="string"&&Nr.has(e.mode)&&Array.isArray(e[nt])}function $r(e,t){let n=Object.getPrototypeOf(e)===null?Object.create(null):{};return Object.assign(n,e),n[nt]=t,n}function dn(e){if(!T(e))return null;let t=T(e.item)?e.item:T(e.plan)?e.plan:null;if(t===null)return null;let n=typeof t.id=="string"?t.id:void 0,o=typeof e.outcome=="string"&&cn.has(e.outcome)?e.outcome:typeof t.status=="string"?t.status:void 0;return n?o?{id:n,status:o,...typeof e.deleted=="boolean"?{deleted:e.deleted}:{}}:{id:n}:null}function Br(e,t){if(!T(e))return null;if(T(e.plan)&&T(e.mutation_receipt)&&e.mutation_receipt.kind==="plan_mutation"&&e.mutation_receipt.id===e.plan.id&&e.mutation_receipt.action===e.action)return e.mutation_receipt;if(!t||!T(e.item)||typeof e.item.id!="string")return null;let n=e[De];if(!Array.isArray(n))return null;let o={id:e.item.id,...typeof e.outcome=="string"&&cn.has(e.outcome)?{status:e.outcome}:typeof e.item.status=="string"?{status:e.item.status}:{},...typeof e.deleted=="boolean"?{deleted:e.deleted}:{},...typeof e.previous_status=="string"?{previous_status:e.previous_status}:{},changed_field_count:n.length};return Fr(e,e.item,o),o}function Fr(e,t,n){let o=typeof e.close_reason=="string"?e.close_reason:typeof t.close_reason=="string"?t.close_reason:void 0;o!==void 0&&(n.close_reason=o);let r=Mr(e.recurrence);r!==null&&(n.recurrence=r),Array.isArray(e.warnings)&&e.warnings.length>0&&(n.warnings=e.warnings);for(let i of["recovery","follow_up","handoff","completion","start","takeover"])T(e[i])&&(n[i]=e[i]);if(typeof e.claimed_by=="string"||typeof e.released_by=="string")for(let i of["claimed_by","released_by","previous_assignee","forced","skipped","available","attempts","start_refused","suggestions"])Object.hasOwn(e,i)&&(n[i]=e[i])}function Gr(e){let t=Lr(e)?e[nt]:void 0;if(!Array.isArray(t))return{projected:e,changed:!1};let n=!1,o=t.map(r=>{if(!T(r))return r;let i=un(r);return i?(n=!0,i):r});return n?{projected:$r(e,o),changed:!0}:{projected:e,changed:!1}}function ln(e,t={}){let n=Pr(e,t);if(n!==null)return n;if(t.idOnly===!0){let a=dn(e);if(a!==null)return a}if(t.compactEnvelope===!0||t.changedFields==="compact"){let a=Br(e,t.compactEnvelope===!0);if(a!==null)return a}if((t.changedFields??"full")==="full"||!T(e))return e;let o=!1,r=e,i=Ur(e)?un(e):null;i!==null&&(r=i,o=!0);let s=Gr(r);return s.changed&&(r=s.projected,o=!0),o?r:e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1f8bc22d-02b9-522a-a2cd-0d34bf6e3ec3")}catch{}})();import{AsyncLocalStorage as Ai}from"node:async_hooks";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9bb3b2ed-c289-5b96-99ce-9df6e202c464")}catch{}})();var fn=new Set(["--pm-path","--path","--author","--expect-hash","--output-include","--output-limit","--output-budget","--output-format","--format","--output-session","--output-cursor"]),qr=new Set(["--no-extensions","--no-pager","--json","--quiet","--lean","--token-accounting","--output-row-contract","--all"]);function zr(e){let t=e.indexOf("=");return t>0&&fn.has(e.slice(0,t))}function Wr(e,t){return typeof t!="string"?!1:e==="--path"||e==="--pm-path"||!t.startsWith("-")}function _n(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")return;if(fn.has(n)){t+=Wr(n,e[t+1])?1:0;continue}if(!(zr(n)||qr.has(n)||n==="--profile"||n==="--id-only"||n==="--explain")&&!n.startsWith("-"))return t}}function Qa(e){let t=_n(e);return t===void 0?void 0:e[t].trim().toLowerCase()}import Kr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f08c44a-dfdf-5c23-8f68-0e3ed73582b0")}catch{}})();var ot=new WeakMap;function _c(e){ot.set(e,e.path)}function Vr(e){if(!process.env.PM_PATH?.trim())return;let t=Lt(e);return Mt($t(t),e)&&t===Ut(e)?void 0:Kr.relative(e,t)||"."}function mc(e,t=process.cwd()){let n=ot.has(e)?ot.get(e):e.path,o=n?.trim()?n:Vr(t),r=o?["--pm-path",o]:[];return e.noExtensions&&r.push("--no-extensions"),r}import{createHash as si}from"node:crypto";import{createHash as Zr}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f539ecb5-2f49-5867-96c7-48eddb81a628")}catch{}})();var Hr=new Set(["applied_bound","completeness","budget_retention_policy","continuation_contract","continuation_kind","continuation_path","filters","omission_receipt","output_budget_truncation","projection","read_output","read_session","row_contract","sorting"]);function E(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function mn(e,t){let n=e;for(let o of t.split("."))if(Array.isArray(n)){if(!/^\d+$/u.test(o))return;n=n[Number(o)]}else{if(!E(n))return;n=n[o]}return n}function rt(e,t,n){let o=t.split("."),r=(i,s)=>{if(s===o.length)return n;let a=o[s];if(Array.isArray(i)){let d=Number(a),u=[...i];return u[d]=r(i[d],s+1),u}let c=i;return{...c,[a]:r(c[a],s+1)}};return r(e,0)}function it(e,t,n,o){let r=Y(e).find(a=>a.path===t);if(!r)return e;let i=Array.isArray(r.value)?r.value.slice(n,o):Object.fromEntries(Object.entries(r.value).slice(n,o)),s=rt(e,t,i);return E(s.summary)&&E(s.summary.focus_row_states)&&typeof s.summary.focus_row_states[t]=="string"&&(s.summary={...s.summary,focus_row_states:{...s.summary.focus_row_states,[t]:s.summary.focus_row_states[t].slice(n,o)}}),de(s),s}function Pe(e){let t=e.row_contract;return E(t)&&Array.isArray(t.row_keys)?t.row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Object.entries(e).filter(([,n])=>Array.isArray(n)).map(([n])=>n)}function Jr(e){let t=e.row_contract;return E(t)&&Array.isArray(t.continuation_row_keys)?t.continuation_row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Pe(e)}function D(e){return Pe(e).flatMap(t=>{let n=mn(e,t);return Array.isArray(n)||E(n)?[{path:t,value:n}]:[]})}function Y(e){return Jr(e).flatMap(t=>{let n=mn(e,t);return Array.isArray(n)||E(n)?[{path:t,value:n}]:[]})}function ce(e){let t=D(e),n=new Set(t.map(r=>r.path)),o=(r,i)=>{if(Array.isArray(r)){n.has(i)||t.push({path:i,value:r}),r.forEach((s,a)=>o(s,`${i}.${a}`));return}if(E(r))for(let[s,a]of Object.entries(r))i.length===0&&Hr.has(s)||o(a,i.length===0?s:`${i}.${s}`)};return o(e,""),t}function X(e){return D(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function ue(e,t){let n=e;for(let o of D(n)){let r=Array.isArray(o.value)?o.value.map((i,s)=>t(i,o.path,s)):Object.fromEntries(Object.entries(o.value).map(([i,s],a)=>[i,t(s,o.path,a)]));n=rt(n,o.path,r)}return n}function pn(e,t,n=()=>!1){let o=e,r=!1;for(let i of D(o)){let s=Array.isArray(i.value)?i.value:Object.entries(i.value);if(s.length<=t)continue;r=!0;let a=n(i.path)?s.length-t:0,c=s.slice(a,a+t),d=Array.isArray(i.value)?c:Object.fromEntries(c);o=rt(o,i.path,d)}return{result:o,truncated:r}}var gn=["high_level","low_level","blocked_fallback"];function Ne(e){let t=e.status==="in_progress"?"i":"o";return e.blocked===!0?t.toUpperCase():t}function gc(e,t){if(!E(e.summary)||!E(e.summary.returned_focus))return;let n=new Map(t.map(o=>[o.id,o]));e.summary={...e.summary,focus_row_states:Object.fromEntries(gn.map(o=>[o,Array.isArray(e[o])?e[o].filter(E).map(r=>Ne(n.get(r.id)??r)).join(""):""]))}}function Yr(e,t){if(e!==void 0){if(typeof e!="string"||e.length!==t||!/^[iIoO]*$/u.test(e))throw new TypeError("Context focus classification receipt must contain one i/I/o/O code per delivered record");return e}}function Xr(e,t,n,o){let r=Array.isArray(t[n])?t[n].filter(E):[],i=Yr(o[n],r.length)??r.map(Ne).join(""),s=new Map(r.flatMap((d,u)=>d.id===void 0?[]:[[d.id,i[u]]])),a=Array.isArray(e[n])?e[n].filter(E):[],c=!1;return{states:a.map((d,u)=>{let _=s.get(d.id)??(d.id===void 0?i[u]:void 0)??Ne(d);return _!==Ne(d)&&(c=!0),_}).join(""),needsStates:c}}function Qr(e,t){typeof e.count=="number"&&(e.count_only===!0||t.count_only===!0?typeof t.count=="number"&&(e.count=t.count):Array.isArray(e.items)&&(e.count=e.items.length))}function de(e,t=e){if(Qr(e,t),!E(e.summary)||!E(e.summary.returned_focus))return;let n={...e.summary},o=E(t.summary)&&E(t.summary.focus_row_states)?t.summary.focus_row_states:{},r=gn.map(c=>({key:c,...Xr(e,t,c,o)})),i=Object.fromEntries(r.map(({key:c,states:d})=>[c,d])),s=r.some(c=>c.needsStates),a=Object.values(i).join("");typeof n.high_level=="number"&&(n.high_level=Array.isArray(e.high_level)?e.high_level.length:0),typeof n.low_level=="number"&&(n.low_level=Array.isArray(e.low_level)?e.low_level.length:0),n.returned_focus={active_items:a.length,in_progress:[...a].filter(c=>c.toLowerCase()==="i").length,open:[...a].filter(c=>c.toLowerCase()==="o").length,blocked:[...a].filter(c=>c===c.toUpperCase()).length},s?n.focus_row_states=i:delete n.focus_row_states,e.summary=n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e8cd9862-6b60-599e-9a19-b97fd7b1ce1f")}catch{}})();var ei=4096,ti=Object.freeze(["queue_draining","queue_entries","queue_exists","queue_high_retry_entries","queue_invalid_rows","queue_max_attempts","queue_rows_total","queue_size_bytes","pending_otel_spans","last_attempted_flush_at","last_failed_flush_at","last_otel_attempt_at","last_otel_failure_at","last_otel_success_at","last_successful_flush_at"]),hn=Object.freeze({health:Object.freeze({version:3,paths:Object.freeze(["checks"]),ignored_detail_field_names_by_row:Object.freeze({telemetry:ti}),guarantee:"nonvolatile_snapshot_and_stable_configuration"})});function Q(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function bn(e,t,n=e,o){let r=Object.hasOwn(S,t)?S[t]:void 0;if(r?.delivered_row_counters===void 0)return;let i=r.paths[0],s=e[i],a=n[i];if(!Array.isArray(s)||!Array.isArray(a))return;let c=o??a.length,d=a.slice(Math.max(0,c-s.length),c);for(let u of r.delivered_row_counters)typeof e[u.key]=="number"&&(e[u.key]=d.filter(_=>Q(_)&&_[u.field]===u.equals).length)}function le(e){return Array.isArray(e)?e.map(le):Q(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,le(n)])):e}function yn(e,t){if(!Q(e))return le(e);let n=typeof e.name=="string"?e.name:void 0,o=n!==void 0&&Object.hasOwn(t.ignored_detail_field_names_by_row,n)?t.ignored_detail_field_names_by_row[n]:void 0;return Object.fromEntries(Object.entries(e).map(([r,i])=>r!=="details"||!o||!Q(i)?[r,le(i)]:[r,Object.fromEntries(Object.entries(i).filter(([s])=>!o.includes(s)).map(([s,a])=>[s,le(a)]))]))}function ni(e,t){return Array.isArray(e)?e.map(n=>yn(n,t)):yn(e,t)}function Me(e,t,n){let o=n?hn[n]:void 0,r=o?.paths.includes(e)===!0;return Zr("sha256").update(ve({path:e,value:r?ni(t,o):t,...r?{fingerprint_policy_version:o.version}:{}})).digest("base64url").slice(0,16)}function st(e){return Buffer.from(JSON.stringify({v:1,c:e.command,p:e.path,o:e.offset,n:e.total_rows,f:e.fingerprint,...e.direction==="backward"?{d:"b"}:{}}),"utf8").toString("base64url")}function oi(e){return typeof e=="string"&&(F(e)===e||/^extension:\S(?:[^\r\n]*\S)?$/u.test(e))}function ri(e){return e===void 0||e==="b"}function ii(e){if(Se(e))throw new h("The read-output continuation cursor was shortened by output compaction: it contains an ellipsis, which no cursor encoder emits.",y.USAGE,{code:"read_output_cursor_invalid",reason:"cursor_compacted",required:"Pass the whole cursor the previous page emitted; a shortened cursor cannot resume the read.",nextSteps:["Re-read the previous page with a larger --output-budget (or --output-budget unbounded) and pass its whole output_cursor to --output-cursor."]})}function fe(e){if(ii(e),e.length>ei)throw new h("The read-output continuation cursor is malformed or unsupported.",y.USAGE,{code:"read_output_cursor_invalid"});let t;try{t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{t=null}if(!Q(t)||t.v!==1||!oi(t.c)||typeof t.p!="string"||t.p.length===0||!Number.isSafeInteger(t.o)||t.o<0||!Number.isSafeInteger(t.n)||t.n<1||typeof t.f!="string"||t.f.length===0||!ri(t.d))throw new h("The read-output continuation cursor is malformed or unsupported.",y.USAGE,{code:"read_output_cursor_invalid"});return{version:1,command:t.c,path:t.p,offset:t.o,total_rows:t.n,fingerprint:t.f,...t.d==="b"?{direction:"backward"}:{}}}function wn(e){if(!Array.isArray(e.assertions))return e;let t=n=>!Q(n)||n.verdict==="pass"?4:n.verdict==="retired"?3:n.enforcement==="block"?0:n.enforcement==="warn"?1:2;return{...e,assertions:e.assertions.map((n,o)=>({row:n,index:o})).sort((n,o)=>t(n.row)-t(o.row)||n.index-o.index).map(({row:n})=>n),budget_retention_policy:"verdict_priority"}}function On(e,t,n){if(!n)return e;if(n.command!==t)throw new h(`The read-output cursor belongs to ${n.command}, not ${t}.`,y.USAGE,{code:"read_output_cursor_command_mismatch"});let o=Y(e).find(c=>c.path===n.path),r=o?Array.isArray(o.value)?o.value.length:Object.keys(o.value).length:0,i=B(t,n.path);if(!o||r!==n.total_rows||n.offset>r||i!==(n.direction==="backward")||Me(n.path,o.value,t)!==n.fingerprint)throw new h("The read-output continuation no longer matches the declared row collection; restart the bounded read.",y.USAGE,{code:"read_output_cursor_stale"});if(!i)return it(e,n.path,n.offset);let s=it(e,n.path,0,n.offset);for(let c of["count","returned_count"])typeof s[c]=="number"&&(s[c]=n.offset);let a=S[t].total_key;return typeof s[a]!="number"&&(s[a]=n.total_rows),s}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9c5d8732-3e10-5224-a558-e870397090f2")}catch{}})();var ct=1,vn=4096,ai=/^[A-Za-z0-9_-]+$/;function at(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function Nc(e,t){let n=[...Object.values(ke),...Ee],o=new Set(n.flatMap(r=>[at(r),r.slice(2).replaceAll("-","_")]));for(let r of t)if(r.cursor_semantics==="presentation"){o.add(at(r.flag));for(let i of r.aliases??[])o.add(at(i))}return Object.fromEntries(Object.entries(e).filter(([r])=>!o.has(r)))}function Pc(e,t){return si("sha256").update(e).update("\0").update(ve(t)).digest("hex").slice(0,24)}function _e(e,t,n,o){return Buffer.from(JSON.stringify({version:ct,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...o===void 0?{}:{snapshot:o}})).toString("base64url")}function G(e,t){return new h(e,y.USAGE,{code:"invalid_query_cursor",nextSteps:[`Repeat the original query without ${t} to obtain a fresh cursor.`]})}function ci(e){return new h("Query cursor was shortened by output compaction: it contains an ellipsis, which no cursor encoder emits.",y.USAGE,{code:"invalid_query_cursor",reason:"cursor_compacted",required:"Pass the whole cursor the previous page emitted; a shortened cursor cannot resume the query.",nextSteps:[`Re-read the previous page with a larger --output-budget (or --output-budget unbounded) and pass its whole next_cursor to ${e}.`,`Or repeat the original query without ${e} to obtain a fresh cursor.`]})}function ui(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===ct&&typeof t.fingerprint=="string"&&typeof t.after_id=="string"&&t.after_id.length>0&&(t.after_index===void 0||Number.isSafeInteger(t.after_index)&&t.after_index>=0)&&(t.snapshot===void 0||typeof t.snapshot=="string"&&t.snapshot.length>0)}function ut(e,t="--after"){if(typeof e!="string")throw G("Query cursor is malformed.",t);let n=e.trim();if(Se(n))throw ci(t);if(n.length===0||n.length>vn||!ai.test(n))throw G("Query cursor is malformed.",t);let o;try{o=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{throw G("Query cursor is malformed.",t)}if(!ui(o)){let r=!1;try{fe(n),r=!0}catch{}throw r?new h(`An output cursor must be continued with --output-cursor, not ${t}.`,y.USAGE,{code:"invalid_query_cursor",nextSteps:[`Repeat the same query, replacing ${t} with --output-cursor ${n}; retain any producer ${t} cursor from the original page.`]}):G("Query cursor version or payload is unsupported.",t)}return o}function dt(e,t,n="--after"){let o=ut(e,n);if(o.fingerprint!==t)throw G(`Query cursor does not match the current filters, sort, or query (${o.fingerprint} != ${t}).`,n);return{after_id:o.after_id,...o.after_index===void 0?{}:{after_index:o.after_index},...o.snapshot===void 0?{}:{snapshot:o.snapshot}}}function Mc(e,t){return dt(e,t).after_id}function di(e,t,n,o,r="--after"){if(t===void 0)return 0;let i=dt(t,n,r),s=e.findIndex(a=>o(a)===i.after_id);if(s<0){if(i.after_index!==void 0)return Math.min(i.after_index,e.length);throw G(`Query cursor item ${i.after_id} is no longer present in this result set.`,r)}return s+1}function Uc(e,t){if(t.cursor!==void 0&&dt(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw G("Query cursor does not match the requested snapshot.","--after");let n=di(e,t.cursor,t.fingerprint,t.readId),o=e.slice(n,n+t.limit),r=o.length>0&&n+o.length<e.length,i=o.at(-1);return{rows:o,has_more:r,...r&&i!==void 0?{next_cursor:_e(t.fingerprint,t.readId(i),n+o.length-1,t.snapshot)}:{}}}var Lc=Object.freeze({version:ct,max_length:vn});import{randomUUID as pi}from"node:crypto";import{randomUUID as li}from"node:crypto";import{constants as Z}from"node:fs";import{lstat as kn,mkdir as fi,open as An,rename as _i,rm as mi}from"node:fs/promises";import Ue from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="71b65888-baa5-5c5f-a02c-4a0fd818fadb")}catch{}})();var I={max_serving_rows:256,max_bytes:262144,max_event_bytes:32768,retained_byte_fraction:.5,max_events:2048,retention_days:30},k=class extends TypeError{code="context_usage_validation_failed";constructor(t){super(t),this.name="ContextUsageValidationError"}};function q(e){let t=Date.parse(e.now??new Date().toISOString());if(!Number.isFinite(t))throw new k("Context usage now must be a valid timestamp");return{iso:new Date(t).toISOString(),ms:t}}function Rn(e){let t=e.maxBytes??I.max_bytes,n=e.maxEvents??I.max_events,o=e.retentionDays??I.retention_days;if(!Number.isSafeInteger(t)||t<1024||t>I.max_bytes||!Number.isSafeInteger(n)||n<1||!Number.isFinite(o)||o<=0)throw new k("Context usage retention requires positive maxEvents and retentionDays, and maxBytes from 1024 through 262144");return{maxBytes:t,maxEvents:n,cutoff:q(e).ms-o*864e5}}async function Tn(e,t){if(!(await kn(Ue.dirname(e))).isDirectory())throw new k("Context usage runtime must be a real directory");try{if((await kn(e)).isSymbolicLink())throw new k("Context usage ledger must not be a symbolic link")}catch(o){if(!Pt(o))throw o}let n=await An(e,t|Z.O_NOFOLLOW|Z.O_NONBLOCK,384);try{let o=await n.stat();if(!o.isFile()||o.nlink!==1)throw new k("Context usage ledger must be an unshared regular file");return n}catch(o){throw await n.close(),o}}async function Le(e){let t=Rn(e);try{let n=await Tn(Ue.join(e.pmRoot,"runtime","context-usage.jsonl"),Z.O_RDONLY);try{let o=(await n.stat()).size,r=Math.max(0,o-t.maxBytes),i=Buffer.alloc(Math.min(o,t.maxBytes)),{bytesRead:s}=await n.read(i,0,i.length,r),a=i.subarray(0,s).toString("utf8");return(r>0?a.includes(`
8
8
  `)?a.slice(a.indexOf(`
9
9
  `)+1):"":a).split(`
10
10
  `).flatMap(c=>{try{let d=JSON.parse(c);return d&&Date.parse(d.at)>=t.cutoff?[d]:[]}catch{return[]}}).slice(-t.maxEvents)}finally{await n.close()}}catch{return[]}}function En(e,t,n){let o=[],r=0;for(let i=e.length-1;i>=0&&o.length<n;i-=1){let s=`${JSON.stringify(e[i])}
@@ -21,4 +21,4 @@ ${qe(o,t+1)}`;return Buffer.byteLength(i)<Buffer.byteLength(r)?i:r}function ws(e
21
21
  `}var ze={omitDuplicateCountAliases:!0,preserveRowFacts:!0};function At(e,t,n=!1){if(Array.isArray(e)){if(e.length===0)return[];let i=Array.isArray(t)?t:[],s=i.length===e.length,a=0,c=e.flatMap(d=>{let u=n||w(d),_=!s&&V(d,ze,u)===void 0,l=At(d,_?void 0:i[a++],u);return l===void 0?[]:[l]});return c.length>0?c:t}if(!w(e))return t;let o=w(t)?t:{},r=Object.entries(e).flatMap(([i,s])=>{let a=At(s,Object.hasOwn(o,i)?o[i]:void 0,n);return a===void 0?[]:[[i,a]]});return r.length>0||Object.keys(e).length===0?Object.fromEntries(r):t}function Rs(e,t,n){if(!n||!w(e))return t;let o=w(t)?t:{},r=new Map(Object.keys(e).filter(i=>i==="item"||Hn.has(i)).map(i=>[i,At(e[i],o[i])]));return lo(e,o,r)}function lo(e,t,n){let o=Object.entries(t).map(([i,s])=>[i,n.has(i)?n.get(i):s]),r=Object.keys(e);for(let[i,s]of n){if(Object.hasOwn(t,i)||s===void 0)continue;let a=new Set(r.slice(r.indexOf(i)+1)),c=o.findIndex(([d])=>a.has(d));o.splice(c===-1?o.length:c,0,[i,s])}return Object.fromEntries(o)}function Ts(e,t,n){if(!w(e))return t;let o=n.filter(s=>{let a=e[s];return Array.isArray(a)&&a.some(c=>V(c,ze,w(c))===void 0)});if(o.length===0)return t;let r=w(t)?t:{},i=new Map(o.map(s=>[s,e[s].map(a=>V(a,ze,!0))]));return lo(e,r,i)}var Ss=JSON.stringify({has_omissions:!1,omitted_field_group_count:0,omitted_field_groups:[]});function xs(e){let t=Object.entries(Object(e)).sort(([n],[o])=>n.localeCompare(o));return JSON.stringify(Object.fromEntries(t))===Ss}function td(e){let t=zt("error_format",{message:e}),n=t.handled&&typeof t.result=="string"?t.result:e;gs(n.endsWith(`
22
22
  `)?n:`${n}
23
23
  `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="21a8bc0d-7750-5528-9893-f13d295424fb")}catch{}})();var gt=8,Cs=64,Is=5,js=4,fo=100;function _o(e,t,n){if(e!=="get"||!Rt(n.item)||["fields","outputInclude","output_include","outputCursor","output_cursor"].some(c=>t[c]!==void 0)||t.full===!0||t.tree===!0||t.depth!==void 0&&t.depth!=="standard")return;let o=n.item,r=["linked","claim_state","schedule"],i=r.filter(c=>Object.hasOwn(n,c)),s=Object.fromEntries(Object.entries(n).filter(([c])=>!r.includes(c)));s.item=Object.fromEntries(Object.entries(o).filter(([c])=>c!=="body")),Object.hasOwn(o,"body")&&i.push("body");let a=[...Rt(n.omission_receipt)&&Array.isArray(n.omission_receipt.omitted_field_groups)?n.omission_receipt.omitted_field_groups:[],...i.map(c=>({name:c,restore_with:`--fields ${c}`}))];return s.omission_receipt={has_omissions:a.length>0,omitted_field_group_count:a.length,omitted_field_groups:a},s}function ye(e){let t=Math.trunc(e.effective_budget_tokens),n=Math.trunc(e.measured_result_tokens);if(!Number.isSafeInteger(t)||t<=0||!Number.isSafeInteger(n)||n<=0)return{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"};let o=Math.max(t+1,n),r=Math.ceil(o*Is/js),i=Math.ceil(r/fo)*fo;return Number.isSafeInteger(i)?{output_budget:i,recovery_budget_multiplier:i/t,rule_version:"v1"}:{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"}}function oe(e,t,n=!1){let o=Object.getOwnPropertyDescriptor(e,"row_contract");o&&(n||o.enumerable===!1)&&Object.defineProperty(t,"row_contract",{...o,enumerable:!1})}function te(e){let t=e.resolvedOutputFormat??e.outputFormat??e.output_format??e.format;return t==="json"||t==="toon"?t:void 0}var he;function M(e,t){let n=t===void 0?JSON.stringify(e):he!==void 0&&he.format===t?Ds(he,e):uo(e,t);return Math.ceil(Buffer.byteLength(n,"utf8")/4)}function Ds(e,t){he=void 0;try{return e.render(t)}finally{he=e}}function Rt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Tt(e,t,n=!1){return typeof e=="string"?n?e:(e.length>Ft&&(t.compacted=!0),Te(e)):Array.isArray(e)?e.map(o=>Tt(o,t,n)):Rt(e)?Object.fromEntries(Object.entries(e).map(([o,r])=>[o,Tt(r,t,n||o==="focus_row_states"||typeof r=="string"&&ae(o))])):e}function U(e,t,n){let o=t.estimated_tokens;for(let r=0;r<gt;r+=1){t.estimated_tokens=o;let i=M(e,n);if(i===o)return;o=i}t.estimated_tokens=o}function Ns(e,t){return ce(e).filter(n=>(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length)>Math.max(1,t.get(n.path)??0)).map(n=>({collection:n,length:Array.isArray(n.value)?n.value.length:Object.keys(n.value).length})).sort((n,o)=>o.length-n.length||n.collection.path.localeCompare(o.collection.path))[0]?.collection}function Ps(e,t,n,o,r,i,s){for(let a=0;a<Cs;a+=1){if(i?.(e),U(e,t,r),t.estimated_tokens<=n)return;let c=Ns(e,o);if(!c)return;let d=Math.max(1,o.get(c.path)??0),u=Array.isArray(c.value)?[...c.value]:Object.entries(c.value),_=s(c.path),l=g=>{let b=_?u.length-g:0;if(Array.isArray(c.value)){c.value.length=g;for(let O=0;O<g;O+=1)c.value[O]=u[b+O]}else{for(let O of Object.keys(c.value))delete c.value[O];Object.defineProperties(c.value,Object.getOwnPropertyDescriptors(Object.fromEntries(u.slice(b,b+g))))}typeof e.count=="number"&&(e.count=X(e)),typeof e.returned_count=="number"&&(e.returned_count=X(e)),c.path==="items"&&(e.applied_limit=g),i?.(e),U(e,t,r)};t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],c.path])].sort((g,b)=>g.localeCompare(b)),e.has_more=!0,e.truncated=!0;let f=d,m=u.length-1,p=d;for(;f<=m;){let g=Math.floor((f+m)/2);l(g),t.estimated_tokens<=n?(p=g,f=g+1):m=g-1}l(p)}}function mo(e,t,n,o=new Map,r,i,s=!1,a=()=>!1){let c={compacted:!1},d=Object.fromEntries(Object.entries(e).map(([u,_])=>[u,Tt(_,c,s&&u==="diff"||typeof _=="string"&&ae(u))]));return oe(e,d),t.strings_compacted=c.compacted,d.read_output=t,Ps(d,t,n,o,r,i,a),U(d,t,r),d}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="24a8de41-54f9-5b59-8e58-7ac924ba6e08")}catch{}})();function fd(e){return typeof e=="object"&&e!==null&&"id"in e&&typeof e.id=="string"&&"context_ref"in e&&typeof e.context_ref=="string"&&e.context_ref.startsWith("session:")&&e.context_ref.endsWith(`:${e.id}`)}var St=256,xt=1e4,Ms=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,po=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,Us=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),Ls=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&Ms.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=St,reason:`token_budget must be a safe integer of at least ${St}.`},{valid:e=>Number.isSafeInteger(e.spent_tokens)&&e.spent_tokens>=0&&e.spent_tokens<=e.token_budget,reason:"spent_tokens must be a non-negative safe integer no larger than token_budget."},{valid:e=>Array.isArray(e.seen_item_ids)&&e.seen_item_ids.length<=xt&&e.seen_item_ids.every(t=>typeof t=="string"&&po.test(t)),reason:`seen_item_ids must contain at most ${xt} portable item identifiers.`}];function Ke(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function We(e){throw new h(`--output-session ${e}`,y.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function Ve(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{We("must be a valid JSON object.")}Ke(t)||We("must be a JSON object.");let n=Object.keys(t).filter(i=>!Us.has(i));n.length>0&&We(`contains unknown field "${n.sort()[0]}".`);let o=Ls.find(i=>!i.valid(t));o!==void 0&&We(o.reason);let r=[...new Set(t.seen_item_ids)].sort();return{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:r}}function go(e){if(Ke(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:Ke(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function $s(e){let t=new Set,n=0,o=D(e),r=new Set(o.map(({path:s})=>s)),i=Object.entries(e).flatMap(([s,a])=>Array.isArray(a)&&!r.has(s)?[{path:s,value:a}]:[]);for(let s of[...o,...i]){let a=Array.isArray(s.value)?s.value:Object.values(s.value);for(let c of a){if(!Ke(c))continue;if(typeof c.context_ref=="string"){n+=1;continue}let d=go(c);d!==void 0&&po.test(d)&&t.add(d)}}return{deliveredIds:t,suppressedRepeatCount:n}}function yo(e,t){let n=new Set(t.seen_item_ids);return ue(e,o=>{let r=go(o);return r!==void 0&&n.has(r)?{id:r,context_ref:`session:${t.id}:${r}`}:o})}function Ct(e,t,n){let{deliveredIds:o,suppressedRepeatCount:r}=$s(e),i=new Set(t.seen_item_ids),s=[...o].filter(p=>!i.has(p)).sort(),a=s.slice(0,xt-t.seen_item_ids.length),c=[...t.seen_item_ids,...a].sort(),d=s.length-a.length,u={contract_version:1,id:t.id,measurement_scope:"complete_read_envelope",estimator:"ceil(utf8_bytes / 4)",token_budget:t.token_budget,spent_before_tokens:t.spent_tokens,spent_this_call_tokens:0,charged_this_call_tokens:0,spent_total_tokens:t.spent_tokens,remaining_tokens:t.token_budget-t.spent_tokens,exhausted:!1,seen_before_count:t.seen_item_ids.length,new_item_count:o.size,...d===0?{}:{seen_item_overflow_count:d},suppressed_repeat_count:r,reference_format:"session:<session-id>:<item-id>",restore_reference_with:"pm get <item-id> --depth brief",next_state:{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:c}},_={...e,read_session:u},l=p=>{u.spent_this_call_tokens=p,u.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,p),u.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+u.charged_this_call_tokens),u.remaining_tokens=Math.max(0,t.token_budget-u.spent_total_tokens),u.exhausted=u.remaining_tokens<St,u.next_state.spent_tokens=u.spent_total_tokens},f=0,m=0;for(let p=0;p<8;p+=1){l(f);let g=M(_,n);if(g===f)return _;m=Math.max(m,g),f=g}return l(m),_}function ho(e){return Math.max(0,e.token_budget-e.spent_tokens)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1cc0fcb7-2aaa-5233-bdfd-4b4d0fb3e9c1")}catch{}})();var be=Symbol.for("pm.readOutputInvocationProvenance");function md(e,t){return Reflect.set(e,be,{canonical_include_modes:[...t],explicit_legacy_aliases:[],sdk_invocation_observed:!0}),e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2a596392-747a-5b55-854d-1e80964468d3")}catch{}})();var H=["include","amount","cost","encoding"],Ao=["canonical","legacy","intent","default"],Oe=ke,Nd=Object.freeze(H.map(e=>Oe[e])),Pd=Ee;function Bs(e,t){let n=Ie[e];if(n!==void 0)return n;let o=t==="include"?Ze.has(e)?"<csv>":je(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${Oe[t]} ${o}.`}function Ro(e){let t=Qe[e]??{},n=Object.freeze(Object.fromEntries(H.map(o=>[o,Object.freeze({dimension:o,canonical_option:Oe[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[o]??[]).map(r=>Object.freeze({flag:r,semantics:Ie[r]===void 0?"replacement":"behavior_preserving",migration_hint:Bs(r,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:Ao,budget_retention_policy:e==="assurance"?"verdict_priority":Object.hasOwn(S,e)?"ordered_suffix":"ordered_prefix",projection_modes:Object.freeze([...et(e).keys()])})}var Fs=Object.freeze(se.map(Ro)),Gs=new Map(Fs.map(e=>[e.command,e]));function F(e,t={}){let n=ie(e.trim().toLowerCase()),o=Xe(n);return o!==void 0?o.read_output===void 0?void 0:`extension:${o.command}`:on(n,t)}var qs=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],bo={comments:["add","body","comment","text","stdin","file","edit","delete"],notes:["add","note","text","addJson","stdin","file","edit","delete"],learnings:["add","learning","text","stdin","file","edit","delete"],files:["add","addGlob","remove","migrate","apply","note"],docs:["add","addGlob","remove","migrate","note"],"package-catalog":["activate","adopt","adoptAll","deactivate","doctor","init","install","manage","migrate","reload","scaffold","uninstall"]};function zs(e){return qs.some(t=>t!=="outputFormat"&&t!=="output_format"&&e[t]!==void 0)}var Ws=[{keys:["outputInclude","output_include"],valid:e=>we(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||re(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||re(e)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputSession","output_session"],valid:e=>(Ve(e),!0),message:"--output-session must be a valid session-state object."},{keys:["outputCursor","output_cursor"],valid:e=>typeof e=="string"&&e.trim().length>0,message:"--output-cursor requires a non-empty continuation cursor."}],Md="read_output_mutation_conflict",To=[{flag:"--output-include",keys:["outputInclude","output_include"]},{flag:"--output-limit",keys:["outputLimit","output_limit"]},{flag:"--output-budget",keys:["outputBudget","output_budget"]},{flag:"--output-session",keys:["outputSession","output_session"]},{flag:"--output-cursor",keys:["outputCursor","output_cursor"]},{flag:"--output-row-contract",keys:["outputRowContract","output_row_contract"]}],Ud=To.map(({flag:e})=>e);function Ks(e,t,n){let o=To.filter(({keys:a})=>a.some(c=>t[c]!==void 0)),r=o.map(({flag:a})=>a),i=o.flatMap(({keys:a})=>a.filter(c=>t[c]!==void 0)),s=r.join(", ");return new h(`Universal output controls (${s}) cannot be combined with a ${e} mutation; nothing was written.`,y.USAGE,{code:"read_output_mutation_conflict",field:r[0],details:{surface:e,output_controls:r,output_option_keys:i,mutation_options:[...n]},required:`Retry the ${e} mutation without ${s}. To bound or page the result, read it with those controls in a separate call after the write.`,why:"Universal output controls shape a read. A mutation returns its own bounded receipt, so the controls have nothing to shape and the write is refused before it runs.",examples:[...Vs[e]]})}var Vs={comments:['pm comments <id> --add "<text>"',"pm comments <id> --output-limit 5"],notes:['pm notes <id> --add "<text>"',"pm notes <id> --output-limit 5"],learnings:['pm learnings <id> --add "<text>"',"pm learnings <id> --output-limit 5"],files:["pm files <id> --add path=<path>","pm files <id> --output-limit 5"],docs:["pm docs <id> --add path=<path>","pm docs <id> --output-limit 5"],"package-catalog":["pm package install <source> --project","pm package catalog --output-limit 5"]};function Ld(e,t){let n=t.outputFormat??t.output_format;if(n!==void 0&&n!=="json"&&n!=="toon")throw new h("--output-format must be toon or json.",y.USAGE);if(!zs(t))return;let o=F(e,t);if(!o)throw new h(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,y.USAGE);if(Object.hasOwn(bo,o)){let r=o,i=bo[r].filter(s=>t[s]!==void 0&&t[s]!==!1);if(i.length>0)throw Ks(r,t,i)}for(let r of Ws){let i=r.keys.map(s=>t[s]).find(s=>s!==void 0);if(i!==void 0&&!r.valid(i))throw new h(r.message,y.USAGE)}}function So(e){let t=F(e);return t?et(t):new Map}function Hs(e,t,n){let o=we(t)??[],r=So(e),i=[],s=[],a=n,c=a[be],d=new Set(c?.canonical_include_modes??[]),u=new Set(c?.explicit_legacy_aliases??[]);for(let f of o){let m=r.get(f);if(m===void 0){i.push(f);continue}let p=`--${f.replaceAll("_","-")}`;jt(It(n,p))&&u.add(p),n[m]=!0,s.push(f),d.add(f)}let _=F(e)==="get"?i.filter(f=>f!=="item"):[],l=_.length>0;return l&&(n.fields=[...new Set([...we(n.fields)??[],..._])].join(","),d.add("fields")),(s.length>0||l)&&(a[be]={canonical_include_modes:[...d],explicit_legacy_aliases:[...u],...c?.cli_invocation_observed===!0?{cli_invocation_observed:!0}:{}}),{selectors:i,modes:s}}function $d(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:o,modes:r}=Hs(e,n,t);if(r.length===0)return;let i=o.length>0?o.join(","):void 0;t.outputInclude=i,Object.hasOwn(t,"output_include")&&(t.output_include=i)}function It(e,t){let n=tt(t);if(Object.hasOwn(e,n))return e[n];let o=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,o))return e[o];if(t==="--no-truncate"&&e.truncate===!1)return!0}function jt(e){return e!==void 0&&e!==!1&&e!==null}function we(e){let t=(Array.isArray(e)?e:[e]).flatMap(n=>typeof n=="string"?n.split(","):[]).map(n=>n.trim()).filter(Boolean);return t.length>0?[...new Set(t)]:void 0}function re(e){let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e):Number.NaN;return Number.isSafeInteger(t)&&t>0?t:void 0}function Js(e,t,n,o){for(let r of e.legacy_aliases){if(o(r.flag))continue;let i=It(t,r.flag),s={value:i,flag:r.flag};if(jt(i)&&n(s))return s}}function wo(e,t){let n=we(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:we(t.value)??[je(t.flag)]}}function Oo(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=re(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;if(t.flag==="--no-truncate"||t.flag==="--unbounded")return{source:"legacy",value:"unbounded"};let o=re(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function vo(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=re(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let o=re(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function ko(e,t){if(e==="json"||e==="toon")return{source:"canonical",value:e};if(t)return t.flag==="--stream"||t.flag==="--follow"?{source:"legacy",value:"stream"}:t.value==="json"||t.value==="toon"?{source:"legacy",value:t.value}:void 0}function xo(e,t,n){if(!e)return!1;let o=new Set(e.explicit_legacy_aliases);if(e.cli_invocation_observed===!0||e.sdk_invocation_observed===!0)return!o.has(n);let r=new Set(e.canonical_include_modes.map(i=>`--${i.replaceAll("_","-")}`));return t==="include"&&r.has(n)&&!o.has(n)}function Ys(e,t,n,o){return e.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||jt(It(o,"--no-truncate"))&&!xo(n,"amount","--no-truncate")||t.amount?.flag==="--no-truncate"||t.include?.flag==="--full"||n?.canonical_include_modes.includes("full")===!0}function Xs(e,t){return H.flatMap(n=>e[n]?.source==="canonical"||n==="include"&&(t?.canonical_include_modes.length??0)>0?[Oe[n]]:[])}function Co(e,t){let n=F(e,t);if(!n)return;let o=Gs.get(n)??Ro(n),r=t[be],i={include:b=>wo(void 0,b),amount:b=>Oo(void 0,b),cost:b=>vo(void 0,b),encoding:b=>ko(void 0,b)},s=Object.fromEntries(H.map(b=>[b,Js(o.dimensions[b],t,O=>i[b](O)!==void 0,O=>xo(r,b,O))])),a=H.flatMap(b=>{let O=s[b];return O?[O.flag]:[]}),c=H.flatMap(b=>{let O=s[b];return O?[o.dimensions[b].legacy_aliases.find(Go=>Go.flag===O.flag).migration_hint]:[]}),d=ko(t.outputFormat??t.output_format,s.encoding),u=wo(t.outputInclude??t.output_include,s.include),_=Oo(t.outputLimit??t.output_limit,s.amount),l=vo(t.outputBudget??t.output_budget,s.cost),f=Ys(e,s,r,t),m=Ht(e,{generateFallback:!0}),p=d?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon",g=l??(f?{source:"intent",value:"unbounded"}:{source:"default",value:m.default_max_estimated_tokens_by_format[p]});return{command:n,include:u,amount:_,cost:g,encoding:d,canonical_options_used:Xs({include:u,amount:_,cost:g,encoding:d},r),legacy_aliases_used:a,migration_hints:c,precedence:Ao}}function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Dt=new Set(["applied_bound","applied_limit","completeness","continuation_kind","continuation_path","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","budget_retention_policy","row_contract","sorting","total","truncated"]),Qs=["collection_counts","notes_count","tests_count"];function Io(e,t){let n=new Set(t.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([o])=>n.has(o)))}function Zs(e){let t=v(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...Qs.filter(r=>Object.hasOwn(t,r))])].sort((r,i)=>r.localeCompare(i)),o=Object.keys(e).filter(r=>r!=="item"&&r!=="read_output"&&!Dt.has(r)).sort((r,i)=>r.localeCompare(i));return{item:t,itemFields:n,sections:o,valid:[...n,"item",...n.map(r=>`item.${r}`),...o]}}function ea(e,t){let n=Zs(e),o=t.filter(u=>!n.valid.includes(u));if(o.length>0)throw new h(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,y.USAGE);let r=t.includes("item"),i=t.flatMap(u=>u.startsWith("item.")?[u.slice(5)]:n.itemFields.includes(u)?[u]:[]).filter((u,_,l)=>l.indexOf(u)===_);if(r&&i.length>0)throw new h("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",y.USAGE);let s=new Set(t.filter(u=>n.sections.includes(u))),a=Object.fromEntries(Object.entries(e).filter(([u])=>Dt.has(u)||s.has(u)));r?a.item=n.item:i.length>0&&(a.item=Io(n.item,i));let c=[...r?[]:i.length>0?n.itemFields.filter(u=>!i.includes(u)).map(u=>({name:`item.${u}`,restore_with:`--output-include item.${u}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(u=>!s.has(u)).map(u=>({name:u,restore_with:`--output-include ${u}`}))],d=[...v(a.omission_receipt)&&Array.isArray(a.omission_receipt.omitted_field_groups)?a.omission_receipt.omitted_field_groups:[],...c];return a.omission_receipt={has_omissions:d.length>0,omitted_field_group_count:d.length,omitted_field_groups:d},a}function Eo(e){let t=0;return ue({...e},n=>(v(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function ta(e,t,n,o){if(Eo(t)===0||Eo(n)>0)return;let r=[...So(e).keys()],i=r.length>0?` Declared ${e} projection modes: ${r.join(", ")}.`:` The ${e} surface declares no projection modes; name row fields instead.`;throw new h(`Unknown --output-include selector(s) for ${e}: ${o.join(", ")}. No selector matched any returned row field.${i}`,y.USAGE)}function na(e,t,n){if(e==="get")return ea(t,n);let o=Pe(t),r=n.flatMap(s=>o.flatMap(a=>s.startsWith(`${a}.`)?[s.slice(a.length+1)]:[])),i=n.some(s=>Object.hasOwn(t,s.split(".")[0])&&!o.some(a=>s.startsWith(`${a}.`)));if(o.length>0&&(!i||r.length>0)){let s={...t},a=r.length>0?r:n,c=ue(s,d=>v(d)?Io(d,a):d);return ta(e,t,c,a),c}return Object.fromEntries(Object.entries(t).filter(([s])=>n.some(a=>a.split(".")[0]===s)||Dt.has(s)))}function oa(e,t,n,o){if(t==="unbounded")return e;let{result:r,truncated:i}=pn(e,t,s=>B(n,s));if(!i)return r;if(r.has_more=!0,r.truncated=!0,Po(r,n,[...o.entries()].flatMap(([s,a])=>a.rows>t?[{path:s,total_rows:a.totalRows}]:[])),typeof r.count=="number"){let s=v(r.projection)?r.projection.row_key:void 0;r.count=typeof s=="string"&&Array.isArray(r[s])?r[s].length:X(r)}return typeof r.returned_count=="number"&&(r.returned_count=X(r)),r.applied_bound={kind:"output_limit",source:"explicit",value:t},r}function ra(e){return H.filter(t=>e[t]!==void 0&&e[t]?.source!=="default"||e.canonical_options_used.includes(Oe[t]))}function He(e,t,n,o){let r=Ct(e,t,o);oe(e,r);for(let i=0;i<8;i+=1){let s=n.estimated_tokens,a=r.read_session.spent_this_call_tokens;U(r,n,o);let c=r;r=Ct(r,t,o),oe(c,r);let d=r.read_session.spent_this_call_tokens;if(n.estimated_tokens===s&&d===a)return r}return r}function pt(e,t){if(!v(e.read_output))return e;let n=te(t),o=e.read_output,r=Ve(t.outputSession??t.output_session);return r===void 0?(U(e,o,n),e):He(e,r,o,n)}function ia(e,t){if(e!=="validate")return t;let n=v(t.projection)?t.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(u=>v(u)&&u.name==="diagnostic_rows"))return t;let o=[...new Set(ce(t).map(({path:u})=>u).filter(u=>/^checks\.\d+\.details\./u.test(u)))],r=o.filter(u=>!o.some(_=>_!==u&&u.startsWith(`${_}.`)));if(r.length===0)return t;let i=v(t.row_contract)?t.row_contract:{},s=Array.isArray(i.row_keys)?i.row_keys.filter(u=>typeof u=="string"):[],a=Array.isArray(i.continuation_row_keys)?i.continuation_row_keys.filter(u=>typeof u=="string"):[],c=s.length>0?s:r,d=[...new Set(r)];return JSON.stringify(c)===JSON.stringify(s)&&JSON.stringify(d)===JSON.stringify(a)?t:{...t,row_contract:{...i,row_keys:c,continuation_row_keys:d,jq_selector:typeof i.jq_selector=="string"?i.jq_selector:".checks[].details"}}}function sa(e,t){return e.include?.source==="canonical"&&!ee(t)}function aa(e,t,n,o,r){let i={...e};if(sa(t,e)&&(i=na(t.command,i,t.include.value)),t.command==="assurance"&&(i=wn(i)),de(i,e),i=On(i,t.command,o),t.command==="history"&&o){let c=["compact_history","provenance_history","history","diff"];if(i=Object.fromEntries(Object.entries(i).filter(([d])=>!c.includes(d)||d===o.path)),v(i.projection)&&(i.projection={...i.projection,row_key:o.path}),v(i.row_contract)){let d=i.row_contract;i.row_contract={...d,row_keys:[o.path],...Array.isArray(d.continuation_row_keys)?{continuation_row_keys:[o.path]}:{}}}i.count=Object.keys(i[o.path]).length}let s=e.count_only===!0?{...i,count_only:!0,count:e.count}:i,a=pa(i,e,t.command,o,r);return t.amount?.source==="canonical"&&(i=oa(i,t.amount.value,t.command,a.collectionsBeforeBudget),a.cursorContinuesExistingPage&&Uo(i,a.originalItems,a.cursorSource,!0,a.originalItemOffset)),de(i,s),Mo(i,t.command,a),{projected:n===void 0?i:yo(i,n),continuationState:a}}function ca(e,t){return[...e.cost!==void 0&&e.cost.value!=="unbounded"&&(e.cost.source==="canonical"||e.cost.source==="default"||e.command==="context"&&e.cost.source==="legacy")?[{source:e.cost.source,tokens:e.cost.value}]:[],...t===void 0?[]:[{source:"session",tokens:ho(t)}]].sort((n,o)=>n.tokens-o.tokens)[0]}function jo(e){let t=e.canonical_options_used;return t&&t.length>0?{canonical_options_used:t}:{}}function Do(e,t){return v(e.context_intent)&&e.context_intent.command==="context"&&e.context_intent.token_budget===t&&e.context_intent.within_budget===!0}function ua(e,t,n){return e.command!=="next"||(t.tokenBudget??t.token_budget)===void 0?!1:!(v(n.context_intent)&&n.context_intent.command==="next"&&n.context_intent.within_budget===!0)}function No(e,t={}){return e?.source==="default"||e?.source==="legacy"&&!Do(t,e.tokens)?{budget_source:e.source,budget_tokens:e.tokens}:{}}function da(e,t,n,o,r,i){let s={contract_version:1,command:e.command,requested_dimensions:t,...No(o),precedence:e.precedence,...jo(e),legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0,...n===void 0?{omitted_result_estimated_tokens:r}:{}},a={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:s},c=n===void 0?a:He(a,n,s,i);if(n===void 0&&U(c,s,i),n!==void 0&&s.estimated_tokens>o.tokens)throw new h("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",y.USAGE);return c}function la(e,t,n){return e.command==="context"&&e.cost?.source==="legacy"&&!Do(n,e.cost.value)||ua(e,t,n)||t.outputRowContract===!0||t.output_row_contract===!0||e.canonical_options_used.includes("--output-include")||e.command==="list"&&e.canonical_options_used.length>0&&e.include?.value.includes("full")===!0}function fa(e,t,n,o,r){if(t!==void 0||ee(n)||la(e,r,n))return!1;if(e.amount?.source==="canonical"&&e.amount.value!=="unbounded"){let i=e.amount.value;if(D(n).some(({value:s})=>(Array.isArray(s)?s.length:Object.keys(s).length)>i))return!1}return e.cost===void 0||e.cost.value==="unbounded"||e.cost.source==="legacy"&&e.command!=="context"||M(r.outputRowContract===!1?Object.fromEntries(Object.entries(n).filter(([i])=>i!=="row_contract")):n,o)<=e.cost.value}function Po(e,t,n){let o=Object.hasOwn(S,t)?S[t]:void 0,r=n.find(i=>o?.paths.includes(i.path));o!==void 0&&r!==void 0&&typeof e[o.total_key]!="number"&&(e[o.total_key]=r.total_rows)}function Mo(e,t,n){let o=S[t]?.paths[0];o!==void 0&&bn(e,t,n.producer,n.collectionsBeforeBudget.get(o)?.rows)}function _a(e,t,n,o){let r=n.backward?n.rows-o:n.baseOffset+o;return{path:t,cursor:st({command:e,path:t,offset:r,total_rows:n.totalRows,fingerprint:n.fingerprint,...n.backward?{direction:"backward"}:{}}),retained_rows:o,remaining_rows:n.backward?r:n.totalRows-r,total_rows:n.totalRows}}function ma(e,t,n,o,r,i,s){if(!n.rows_compacted)return;let a=t.amount?.value==="unbounded"?["amount"]:[],c=new Map(Y(e).map(m=>[m.path,Array.isArray(m.value)?m.value.length:Object.keys(m.value).length])),d=[...s.entries()].flatMap(([m,p])=>{let g=c.get(m);return g>=p.rows?[]:[_a(t.command,m,p,g)]}),u=d[0];Po(e,t.command,d);let _=u?"; page --output-cursor":"",l=o.source==="session"?`Truncated by the remaining ${o.tokens}-token session budget; start a new output session with a larger token_budget${_}.`:`${o.tokens}-token: raise --output-budget${_}`;n.migration_hints=[l,...t.migration_hints];let f=ye({effective_budget_tokens:o.tokens,measured_result_tokens:i});u&&!r&&(typeof e.next_cursor!="string"||e.continuation_kind==="output_cursor")&&(e.next_cursor=u.cursor),e.continuation_kind=r?"producer_cursor":u?"output_cursor":"none",e.output_budget_truncation={reason:"output_budget_reached",budget_source:o.source,budget_tokens:o.tokens,overridden_dimensions:a,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:r,continuation_available:d.length>0,recovery_budget_multiplier:u?1:f.recovery_budget_multiplier,continuations:d,restore_with:u?"recovery":`Retry with --output-budget ${f.output_budget} because no declared row collection can be continued.`,recovery:u?{cursor:u.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:`--output-budget ${f.output_budget}`,sdk:{outputBudget:f.output_budget},mcp:{outputBudget:f.output_budget}}}}function Uo(e,t,n,o,r){if(typeof n!="string"||!Array.isArray(e.items))return!1;let i=e.items.length,s=t.length;if(i===0||i>=s)return!1;let a;try{a=ut(n)}catch{return!1}let c=a.after_index;if(c===void 0)return!1;let d=t[i-1];if(Object.prototype.toString.call(d)!=="[object Object]")return!1;let u=Reflect.get(d,"id");if(typeof u!="string"||u.length===0)return!1;let _=o?c-(s-i):c+r+i;return _<0?!1:(e.next_cursor=_e(a.fingerprint,u,_,a.snapshot),!0)}function pa(e,t,n,o,r){let i=new Map(Y(e).map(c=>{let d=Array.isArray(c.value)?c.value.length:Object.keys(c.value).length,u=o?.path===c.path,_=B(n,c.path);return[c.path,{rows:d,totalRows:u?o.total_rows:d,baseOffset:u&&!_?o.offset:0,backward:_,fingerprint:u?o.fingerprint:Me(c.path,c.value,n)}]})),s=typeof e.next_cursor=="string",a=o?.path==="items"?o.offset:0;return{collectionsBeforeBudget:i,originalItems:Array.isArray(t.items)?a>0?t.items.slice(a):t.items:[],originalItemOffset:a,cursorContinuesExistingPage:s,cursorSource:s?e.next_cursor:r.after,producer:t}}function ga(e,t,n,o,r,i,s,a,c,d){let u={...t,count_only:n},_=o.command==="assurance"&&Array.isArray(e.assertions)?e.assertions.filter(f=>v(f)&&f.verdict!=="pass").length:0,l=new Map;if(_>0&&l.set("assertions",_),o.command==="history"&&Array.isArray(e.diff))for(let f of ce(e))f.path.startsWith("diff.")&&l.set(f.path,Object.keys(f.value).length);return mo(e,r,i.tokens,l,d,f=>{de(f,u),Mo(f,o.command,a);let m=Uo(f,a.originalItems,a.cursorSource,a.cursorContinuesExistingPage,a.originalItemOffset);if(ma(f,o,r,i,m,c,a.collectionsBeforeBudget),o.command==="history"&&v(f.projection)){f.has_more=typeof f.next_cursor=="string"||f.applied_bound?.kind==="output_limit";let p=f.projection.row_key;typeof p=="string"&&Array.isArray(f[p])&&(f.count=f[p].length)}s!==void 0&&Object.assign(f,He(f,s,r,d))},o.command==="history"&&Array.isArray(e.diff),f=>B(o.command,f))}function Pn(e,t,n){let o=Co(e,t);if(!o)return n;let r=te(t),i=Ve(t.outputSession??t.output_session),s=t.outputCursor??t.output_cursor,a=typeof s=="string"?fe(s):void 0,c=ra(o),d=ia(o.command,n);if(a===void 0&&fa(o,i,d,r,t))return d;let u=ca(o,i),_=aa(d,o,i,a,t),l=_.projected;oe(l,l,t.outputRowContract===!1);let f=ee(l),m={contract_version:1,command:o.command,requested_dimensions:c,...No(u,l),precedence:o.precedence,...jo(o),legacy_aliases_used:o.legacy_aliases_used,migration_hints:o.migration_hints,estimated_tokens:0,within_budget:!f,strings_compacted:!1,rows_compacted:!1,result_omitted:f};if(l.read_output=m,l=i===void 0?l:He(l,i,m,r),U(l,m,r),u!==void 0&&m.estimated_tokens>u.tokens){let p=_o(o.command,t,l);p!==void 0&&(m.applied_depth="brief",m.degradation_reason="output_budget_reached",oe(l,p),l=pt(p,t)),m.estimated_tokens>u.tokens&&(l=ga(l,l,d.count_only===!0,o,m,u,i,_.continuationState,m.estimated_tokens,r))}return u!==void 0&&m.estimated_tokens>u.tokens?da(o,c,i,u,m.estimated_tokens,r):l}function ya(e){return v(e)&&v(e.context_intent)&&e.context_intent.result_omitted===!0}function ee(e){return ha(e)||ya(e)}function ha(e){return v(e)&&v(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function ds(e,t){let n=t.outputFormat??t.output_format;if(n==="json"||n==="toon")return n;let o=Co(e,t)?.encoding;return o?.value==="json"||o?.value==="toon"?o.value:void 0}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7e894d1f-fe1a-53f2-9a29-4e9846a9f986")}catch{}})();var Lo=["append","cancel","claim","close","comment_add","comment_edit","comment_delete","create","delete","docs_add","docs_remove","files_add","files_remove","files_discover","history_author_acknowledge","history_compact","history_compact_baseline","history_redact","history_repair","history_salvage","import","improvement_observe","learning_add","learning_edit","learning_delete","normalize","note_add","note_edit","note_delete","plan_create_metadata","plan_create_initial_step","plan_add_step","plan_reorder_step","plan_remove_step","plan_link_step","plan_unlink_step","plan_append_decision","plan_append_discovery","plan_append_validation","plan_resume","plan_approve","plan_materialize","plan_update_step","plan_complete_step","plan_block_step","policy_approve","policy_refused","release","reopen","restore","schema_migration","schema_migration_reference","test_run_track","tests_add","tests_remove","tests_update","update","update_audit","update_ownership_bypass","workspace_snapshot_restore","extension_migrations_apply","merge_reconcile"],$o=["history:author-acknowledge","settings:write","init:type_preset","templates:save","profile:apply-types","profile:apply-statuses","profile:apply-fields","profile:apply-config","schema:add-type","schema:remove-type","schema:add-status","schema:remove-status","schema:add-field","schema:remove-field","schema:apply-preset","schema:infer-types","schema:policy-put","schema:policy-remove","schema:policy-mode","assurance:bundle:apply","assurance:gate:verdict","telemetry:install_id","telemetry:first_run_prompt","telemetry:clear","item_format:auto_select_default","transaction_abandon"],Nt={"init:type-preset":"init:type_preset"},Bo=["^config:(?:set|unset):[a-z][a-z0-9_.:-]*$","^assurance:(?:measurement|invariant|gate):(?:put|remove)$","^schema_(?:rename_type|rename_status|remap_status|rename_field|remove_type|remove_status|remove_field)(?:_compensate)?$","^extension:[a-z][a-z0-9_-]*:[a-z][a-z0-9_]*$"],Fd={version:1,item:Lo,workspace:$o,aliases:Nt,patterns:Bo,read_policy:"preserve_original_operation",custom_operation_grammar:"extension:<package_name>:<snake_case_operation>",legacy_custom_operation_grammar:"lowercase segments separated by underscore, hyphen, colon, or dot; optional opaque colon-suffixed retry key",excluded_surfaces:["json_patch","on_write_hook","telemetry_span"]},ba=new Set([...Lo,...$o]),wa=Bo.map(e=>new RegExp(e,"u"));function Fo(e){return Object.hasOwn(Nt,e)?Nt[e]:e}function Gd(e){let t=Fo(e);if(ba.has(t)||wa.some(n=>n.test(t)))return t;throw new TypeError("Undeclared history operation; use a native contract identity or extension:<package_name>:<snake_case_operation>.")}function qd(e){let t=Fo(e),n=t.indexOf(":"),o=n<0?t:t.slice(0,n),r=n<0||n<t.length-1&&!/[\s\p{C}]/u.test(t.slice(n+1));if(/^[a-z][a-z0-9]*(?:[_.-][a-z0-9]+)*$/u.test(o)&&r)return t;throw new TypeError("History operation must use lowercase alphanumeric segments with an optional non-whitespace colon-suffixed retry key.")}export{ln as a,Ua as b,La as c,$a as d,fn as e,_n as f,Qa as g,_c as h,mc as i,zo as j,Aa as k,Kt as l,Wo as m,er as n,nr as o,Vt as p,or as q,rr as r,Ht as s,$ as t,Jt as u,Ra as v,Ta as w,Ye as x,Sa as y,xa as z,Ca as A,Ia as B,ja as C,gc as D,de as E,S as F,B as G,be as H,md as I,H as J,Nd as K,Pd as L,Fs as M,F as N,Md as O,Ud as P,Ld as Q,So as R,Hs as S,$d as T,Co as U,pt as V,Pn as W,ee as X,ha as Y,ds as Z,hn as _,Me as $,st as aa,fe as ba,Nc as ca,Pc as da,_e as ea,ut as fa,dt as ga,Mc as ha,di as ia,Uc as ja,Lc as ka,I as la,k as ma,Yc as na,pe as oa,Oi as pa,Xc as qa,Qc as ra,vi as sa,Zc as ta,eu as ua,tu as va,Ri as wa,Mn as xa,Ti as ya,mu as za,xi as Aa,Ln as Ba,pu as Ca,Fn as Da,Di as Ea,jn as Fa,zi as Ga,Qi as Ha,Hn as Ia,Ou as Ja,Su as Ka,xu as La,gs as Ma,uo as Na,td as Oa,ye as Pa,M as Qa,fd as Ra,xt as Sa,Ve as Ta,yo as Ua,Ct as Va,ho as Wa,Lo as Xa,$o as Ya,Nt as Za,Bo as _a,Fd as $a,Fo as ab,Gd as bb,qd as cb};
24
- //# sourceMappingURL=chunk-S6GTALM4.js.map
24
+ //# sourceMappingURL=chunk-J7ESCE7M.js.map