@unbrained/pm-cli 2026.11.12 → 2026.11.13

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 (115) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +11 -0
  3. package/dist/cli-bundle/bundle-manifest.json +1 -1
  4. package/dist/cli-bundle/chunks/{chunk-3DWEBVIK.js → chunk-36E4L2R4.js} +2 -2
  5. package/dist/cli-bundle/chunks/{chunk-FJNHTBJ2.js → chunk-4WD4CHVH.js} +2 -2
  6. package/dist/cli-bundle/chunks/{chunk-OBTU2BHJ.js → chunk-5LG5YZYF.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-UY7Z3ZHQ.js → chunk-6UXBWMEM.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-OFIXSWJS.js → chunk-CO7RWLCM.js} +2 -2
  9. package/dist/cli-bundle/chunks/chunk-COTC2QOR.js +6 -0
  10. package/dist/cli-bundle/chunks/{chunk-6ESY4Y2B.js → chunk-FAYX6C7H.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-PS2YAPXC.js → chunk-GIAJX2QJ.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-GLPUIQDB.js → chunk-GWVP23RZ.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-GDS4DC5A.js → chunk-GXGMMIZN.js} +4 -4
  14. package/dist/cli-bundle/chunks/{chunk-PZI6CR24.js → chunk-HQINCDF6.js} +47 -47
  15. package/dist/cli-bundle/chunks/{chunk-U7MZIX3D.js → chunk-IYDIPXBO.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-KJL42AN5.js → chunk-L4F4ZHGR.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-T4UC3ZKL.js → chunk-LKVFPQNY.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-MR3CRLA7.js → chunk-O6PBQMD7.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-5NY6EQSX.js → chunk-O6T24Z3M.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-L3SA3354.js → chunk-OQCVU2SG.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-2DUUL53Z.js → chunk-PUU5DXSV.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-QSSENTXG.js +20 -0
  23. package/dist/cli-bundle/chunks/{chunk-UTNPDAID.js → chunk-TCYIGAQG.js} +31 -31
  24. package/dist/cli-bundle/chunks/chunk-UFZQPKQS.js +124 -0
  25. package/dist/cli-bundle/chunks/{chunk-EALO2FPM.js → chunk-URWNUZQZ.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-2K6GJUW7.js → chunk-UYARS5XF.js} +2 -2
  27. package/dist/cli-bundle/chunks/{item-revision-SYJT6TVZ.js → item-revision-G5OVYGZ5.js} +2 -2
  28. package/dist/cli-bundle/chunks/item-transaction-I2X2P4TW.js +2 -0
  29. package/dist/cli-bundle/chunks/{mutation-admission-T57TAVWI.js → mutation-admission-SET4KY73.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-list-query-5XZXTPNG.js → register-list-query-JNJY2D3N.js} +2 -2
  31. package/dist/cli-bundle/chunks/{register-mutation-V6WJFL77.js → register-mutation-WTHZHPOP.js} +2 -2
  32. package/dist/cli-bundle/chunks/{register-operations-5RAWXY2F.js → register-operations-EZP3EG6A.js} +2 -2
  33. package/dist/cli-bundle/chunks/{register-setup-HCKCSQWQ.js → register-setup-THFZP23A.js} +2 -2
  34. package/dist/cli-bundle/chunks/{stage-VIDXGF3T.js → stage-JXJILTYE.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-2ZPGEGTB.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-NSOXVVQX.js → chunk-3MB47JLT.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-5OCUNAQN.js → chunk-4LFE3FQL.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-5KTOMFLR.js +44 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-MK7UQEE5.js → chunk-5NTLNE54.js} +18 -18
  40. package/dist/cli-bundle/focused-chunks/{chunk-P6KYUJD4.js → chunk-ADBFVDTG.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-AXPRCCYM.js → chunk-CSKDIMQP.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-IPIFI4NT.js → chunk-FNIX62V6.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-VUNX6NBR.js → chunk-IYV3IPRF.js} +51 -51
  44. package/dist/cli-bundle/focused-chunks/{chunk-KN7RBRRH.js → chunk-J3LQQP3N.js} +22 -22
  45. package/dist/cli-bundle/focused-chunks/{chunk-BHYGUVAU.js → chunk-JR75B6HU.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-NP5C2TQM.js → chunk-Q3OA5OAK.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-TZO6L523.js → chunk-QGQJBQCH.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-GB2N4OM7.js → chunk-RIMNSVFA.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-GBW2EAAG.js → chunk-TVJ2PHAK.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-LAIN47EJ.js → chunk-VGFKTSGY.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-RXY6BFRW.js → chunk-VGJDKDKA.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-VGUQ4V47.js +82 -0
  53. package/dist/cli-bundle/focused-chunks/chunk-VTOTZ5UC.js +91 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-SPAEZKVA.js → chunk-WFVZ7GGR.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-3FN4ON2Z.js → chunk-ZJF6ZA7B.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-GAXO2UQX.js → chunk-ZOGEQFGH.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{item-revision-PWJNBW3F.js → item-revision-IF7E7BVY.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{item-transaction-T6HXC3NS.js → item-transaction-5TFWIOXI.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{mutation-admission-CLPOLSXZ.js → mutation-admission-KELM46JF.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{stage-EKYWEU2Y.js → stage-UAKMQTCI.js} +2 -2
  61. package/dist/cli-bundle/main.js +2 -2
  62. package/dist/cli-bundle/sdk-authoring.js +1 -1
  63. package/dist/cli-bundle/sdk-contracts.js +1 -1
  64. package/dist/cli-bundle/sdk-core.js +1 -1
  65. package/dist/cli-bundle/sdk-governance.js +1 -1
  66. package/dist/cli-bundle/sdk-graph.js +1 -1
  67. package/dist/cli-bundle/sdk-merge.js +57 -57
  68. package/dist/cli-bundle/sdk-query.js +1 -1
  69. package/dist/cli-bundle/sdk-runtime.js +1 -1
  70. package/dist/cli-bundle/sdk-testing.js +1 -1
  71. package/dist/cli-bundle/sdk.js +1 -1
  72. package/dist/core/history/history-rewrite.js +1 -1
  73. package/dist/core/schema/runtime-field-values.js +1 -1
  74. package/dist/core/shared/author.js +2 -2
  75. package/dist/core/shared/secret-rules.d.ts +8 -2
  76. package/dist/core/shared/secret-rules.js +3 -3
  77. package/dist/core/shared/url-credentials.d.ts +33 -5
  78. package/dist/core/shared/url-credentials.js +1 -1
  79. package/dist/core/store/item-store.js +1 -1
  80. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  81. package/dist/sdk/lifecycle/claim.js +1 -1
  82. package/dist/sdk/lifecycle/create.js +1 -1
  83. package/dist/sdk/lifecycle/restore.js +1 -1
  84. package/dist/sdk/lifecycle/update.js +2 -2
  85. package/dist/sdk/ownership-source.js +1 -1
  86. package/docs/MUTATION_INTEGRITY.md +56 -6
  87. package/marketplace.json +1 -1
  88. package/package.json +1 -1
  89. package/packages/pm-beads/package.json +1 -1
  90. package/packages/pm-calendar/package.json +1 -1
  91. package/packages/pm-command-kit/package.json +1 -1
  92. package/packages/pm-digital-twin/package.json +1 -1
  93. package/packages/pm-governance-audit/package.json +1 -1
  94. package/packages/pm-guide-shell/package.json +1 -1
  95. package/packages/pm-kanban/package.json +1 -1
  96. package/packages/pm-lifecycle-hooks/package.json +1 -1
  97. package/packages/pm-linked-test-adapters/package.json +1 -1
  98. package/packages/pm-search-advanced/package.json +1 -1
  99. package/packages/pm-templates/package.json +1 -1
  100. package/packages/pm-todos/package.json +1 -1
  101. package/packages/pm-vcs/package.json +1 -1
  102. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  103. package/plugins/pm-claude/package.json +1 -1
  104. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  105. package/plugins/pm-codex/package.json +1 -1
  106. package/plugins/pm-codex/plugin.json +1 -1
  107. package/runtime-dependencies.json +1 -1
  108. package/dist/cli-bundle/chunks/chunk-5NGGI7JC.js +0 -6
  109. package/dist/cli-bundle/chunks/chunk-A7L5IEYV.js +0 -20
  110. package/dist/cli-bundle/chunks/chunk-FOT5K5OM.js +0 -124
  111. package/dist/cli-bundle/chunks/item-transaction-YXZ27UC6.js +0 -2
  112. package/dist/cli-bundle/focused-chunks/chunk-AIYJHVKV.js +0 -44
  113. package/dist/cli-bundle/focused-chunks/chunk-BB2GMKRB.js +0 -2
  114. package/dist/cli-bundle/focused-chunks/chunk-HIKZYZ26.js +0 -82
  115. package/dist/cli-bundle/focused-chunks/chunk-NY65XTX7.js +0 -91
@@ -1,2 +1,2 @@
1
- import{c as w,j as y}from"./chunk-GBW2EAAG.js";import{b as g}from"./chunk-IDAYTYNN.js";import"./chunk-GHQVM6K6.js";import"./chunk-HIKZYZ26.js";import{xa as h}from"./chunk-MK7UQEE5.js";import{b as u}from"./chunk-FOA7XKWP.js";import{A as f,z as d}from"./chunk-G6ERMFJ5.js";import{execFile as _}from"node:child_process";import{realpath as b}from"node:fs/promises";import l from"node:path";import{promisify as x}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]="7f4b2fc8-c9c6-51ff-a345-b76b8abdacf4")}catch{}})();var R=x(_);function c(e){return new f(`Automatic merge settlement refused: ${e}`,d.CONFLICT,{code:"merge_settlement_review_required",recovery:{suggested_retry:"pm merge reconcile --dry-run"},nextSteps:["Inspect receipts, repair streams and Git changes. Resolve competing values or unrelated drift explicitly, then run pm merge reconcile and stage the reviewed artifacts manually."]})}async function $(e){let t=process.env.GIT_INDEX_FILE;if(t===void 0)return;let a=(await e(["rev-parse","--path-format=absolute","--git-path","index"])).stdout.trim();if(l.resolve(t)!==l.resolve(a))throw c("an alternate Git index requires explicit manual settlement")}async function I(e,t){if(t.length===0)return[];let a=t.map(s=>`:(literal)${s}`),o=new Set((await e(["ls-files","--cached","-z","--",...a])).stdout.split("\0")),i=t.filter(s=>!o.has(s)).map(s=>`:(literal)${s}`);if(i.length>0&&(await e(["diff","--cached","--name-only","--diff-filter=D","-z","--",...i])).stdout.length>0)throw c("a receipt has a staged deletion that requires explicit review");return i}async function G(e){let{git:t,preview:a,paths:o,newReceiptPathspecs:i}=e,s=!1;try{i.length>0&&(s=!0,await t(["add","--",...i]));let n=await e.apply();if(!n.ok||JSON.stringify(n.receipts.summaries)!==JSON.stringify(a.receipts.summaries)||n.repair.streams.some(p=>!a.repair.streams.some(m=>m.id===p.id)))throw c("reconciliation changed or did not finish; inspect the audit artifacts before staging");return o.length>0&&await t(["add","--",...o.map(p=>`:(literal)${p}`)]),{...n,staged_paths:o,guidance:["Lossless reconciliation artifacts are staged for the merge commit. Review git diff --cached before committing."]}}catch(n){throw s&&await t(["reset","--quiet","--",...i]),n}}function k(e){if(e.repair.totals.failed>0||e.receipts.missing_history_references_after>0||e.receipts.summaries.some(t=>t.conflict_fields.length>0)||e.repair.streams.some(t=>t.merge_receipt_proof?.trusted!==!0)||e.validation.checks.some(t=>t.name!=="history_drift"&&t.status!=="ok"))throw c("only fully authenticated receipt-backed repairs without discarded values can be staged")}async function S(e){try{return{...e,path:await b(h(process.cwd(),e.path))}}catch{throw c("the tracker root cannot be resolved")}}async function F(e){let{preview:t}=e;k(t);let{path:a}=await S(e.global),o=await w(a);if(o===null)throw c("a Git workspace is required");let i=r=>R("git",r,{cwd:o,env:u(),timeout:1e4});if(await $(i),(await i(["ls-files","--unmerged","-z"])).stdout.length>0)throw c("Git still has unresolved paths");let s=[...new Set([...[...new Set([...t.repair.streams.map(r=>r.id),...t.receipts.summaries.map(r=>r.item_id)])].map(r=>l.join(a,"history",`${r}.jsonl`)),...t.receipts.summaries.map(r=>l.join(a,"merge-receipts",`${r.receipt_id}.json`))])].map(r=>l.relative(o,r).replaceAll("\\","/"));if(s.some(g))throw c("reconciliation artifacts must belong to this Git workspace");let n=await y(o,s);if(n.length>0)throw new f(`Automatic merge settlement refused: required artifacts are ignored by Git: ${n.map(r=>`${r.path} (${r.source}:${r.line}: ${r.pattern})`).join(", ")}. Remove or narrow the owning ignore rules because merge receipts must travel with the commit.`,d.CONFLICT,{code:"merge_settlement_review_required",reason:"ignored_merge_artifacts",paths:n.map(r=>r.path),nextSteps:["Remove or narrow the named ignore rules, preserve receipt and history files, then retry pm merge reconcile --stage --dry-run before applying pm merge reconcile --stage. Do not force-add ignored proof as a substitute for fixing the shared policy."]});let p=s.map(r=>`:(literal)${r}`),m=t.receipts.summaries.map(r=>l.relative(o,l.join(a,"merge-receipts",`${r.receipt_id}.json`)).replaceAll("\\","/"));if(p.length>0)try{await i(["diff","--quiet","--",...p])}catch{throw c("reconciliation paths have unstaged edits or Git cannot verify their index state")}let v=await I(i,m);return e.dryRun?{...t,staged_paths:[]}:G({...e,git:i,paths:s,newReceiptPathspecs:v})}export{S as resolveMergeSettlementGlobal,F as stageLosslessMergeReconciliation};
2
- //# sourceMappingURL=stage-EKYWEU2Y.js.map
1
+ import{c as w,j as y}from"./chunk-TVJ2PHAK.js";import{b as g}from"./chunk-IDAYTYNN.js";import"./chunk-GHQVM6K6.js";import"./chunk-VGUQ4V47.js";import{xa as h}from"./chunk-5NTLNE54.js";import{b as u}from"./chunk-FOA7XKWP.js";import{A as f,z as d}from"./chunk-G6ERMFJ5.js";import{execFile as _}from"node:child_process";import{realpath as b}from"node:fs/promises";import l from"node:path";import{promisify as x}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]="7f4b2fc8-c9c6-51ff-a345-b76b8abdacf4")}catch{}})();var R=x(_);function c(e){return new f(`Automatic merge settlement refused: ${e}`,d.CONFLICT,{code:"merge_settlement_review_required",recovery:{suggested_retry:"pm merge reconcile --dry-run"},nextSteps:["Inspect receipts, repair streams and Git changes. Resolve competing values or unrelated drift explicitly, then run pm merge reconcile and stage the reviewed artifacts manually."]})}async function $(e){let t=process.env.GIT_INDEX_FILE;if(t===void 0)return;let a=(await e(["rev-parse","--path-format=absolute","--git-path","index"])).stdout.trim();if(l.resolve(t)!==l.resolve(a))throw c("an alternate Git index requires explicit manual settlement")}async function I(e,t){if(t.length===0)return[];let a=t.map(s=>`:(literal)${s}`),o=new Set((await e(["ls-files","--cached","-z","--",...a])).stdout.split("\0")),i=t.filter(s=>!o.has(s)).map(s=>`:(literal)${s}`);if(i.length>0&&(await e(["diff","--cached","--name-only","--diff-filter=D","-z","--",...i])).stdout.length>0)throw c("a receipt has a staged deletion that requires explicit review");return i}async function G(e){let{git:t,preview:a,paths:o,newReceiptPathspecs:i}=e,s=!1;try{i.length>0&&(s=!0,await t(["add","--",...i]));let n=await e.apply();if(!n.ok||JSON.stringify(n.receipts.summaries)!==JSON.stringify(a.receipts.summaries)||n.repair.streams.some(p=>!a.repair.streams.some(m=>m.id===p.id)))throw c("reconciliation changed or did not finish; inspect the audit artifacts before staging");return o.length>0&&await t(["add","--",...o.map(p=>`:(literal)${p}`)]),{...n,staged_paths:o,guidance:["Lossless reconciliation artifacts are staged for the merge commit. Review git diff --cached before committing."]}}catch(n){throw s&&await t(["reset","--quiet","--",...i]),n}}function k(e){if(e.repair.totals.failed>0||e.receipts.missing_history_references_after>0||e.receipts.summaries.some(t=>t.conflict_fields.length>0)||e.repair.streams.some(t=>t.merge_receipt_proof?.trusted!==!0)||e.validation.checks.some(t=>t.name!=="history_drift"&&t.status!=="ok"))throw c("only fully authenticated receipt-backed repairs without discarded values can be staged")}async function S(e){try{return{...e,path:await b(h(process.cwd(),e.path))}}catch{throw c("the tracker root cannot be resolved")}}async function F(e){let{preview:t}=e;k(t);let{path:a}=await S(e.global),o=await w(a);if(o===null)throw c("a Git workspace is required");let i=r=>R("git",r,{cwd:o,env:u(),timeout:1e4});if(await $(i),(await i(["ls-files","--unmerged","-z"])).stdout.length>0)throw c("Git still has unresolved paths");let s=[...new Set([...[...new Set([...t.repair.streams.map(r=>r.id),...t.receipts.summaries.map(r=>r.item_id)])].map(r=>l.join(a,"history",`${r}.jsonl`)),...t.receipts.summaries.map(r=>l.join(a,"merge-receipts",`${r.receipt_id}.json`))])].map(r=>l.relative(o,r).replaceAll("\\","/"));if(s.some(g))throw c("reconciliation artifacts must belong to this Git workspace");let n=await y(o,s);if(n.length>0)throw new f(`Automatic merge settlement refused: required artifacts are ignored by Git: ${n.map(r=>`${r.path} (${r.source}:${r.line}: ${r.pattern})`).join(", ")}. Remove or narrow the owning ignore rules because merge receipts must travel with the commit.`,d.CONFLICT,{code:"merge_settlement_review_required",reason:"ignored_merge_artifacts",paths:n.map(r=>r.path),nextSteps:["Remove or narrow the named ignore rules, preserve receipt and history files, then retry pm merge reconcile --stage --dry-run before applying pm merge reconcile --stage. Do not force-add ignored proof as a substitute for fixing the shared policy."]});let p=s.map(r=>`:(literal)${r}`),m=t.receipts.summaries.map(r=>l.relative(o,l.join(a,"merge-receipts",`${r.receipt_id}.json`)).replaceAll("\\","/"));if(p.length>0)try{await i(["diff","--quiet","--",...p])}catch{throw c("reconciliation paths have unstaged edits or Git cannot verify their index state")}let v=await I(i,m);return e.dryRun?{...t,staged_paths:[]}:G({...e,git:i,paths:s,newReceiptPathspecs:v})}export{S as resolveMergeSettlementGlobal,F as stageLosslessMergeReconciliation};
2
+ //# sourceMappingURL=stage-UAKMQTCI.js.map
@@ -1,4 +1,4 @@
1
- import{a as Xr}from"./chunks/chunk-6ESY4Y2B.js";import"./chunks/chunk-DEZPZOQ7.js";import{A as Gn,C as _a,D as va,F as wa,G as zn,a as Ln,d as P,e as F,f as O,g as D,h as k,i as Gr,n as Xe,o as zr,p as Zr,t as Qr,u as pa,v as ua,w as fa,x as ga,y as ha,z as ya}from"./chunks/chunk-KJL42AN5.js";import{Ua as ma,f as Ur,k as qr}from"./chunks/chunk-GDS4DC5A.js";import"./chunks/chunk-EALO2FPM.js";import"./chunks/chunk-5NGGI7JC.js";import{A as $t,D as ia,E as ra,F as Q,G as aa,Hc as ca,Jd as da,aa as sa,b as Te,l as Kr,q as Un,r as qn,s as ea,t as ta,u as na,v as Hn,w as Pt,x as Qe,z as oa}from"./chunks/chunk-UTNPDAID.js";import"./chunks/chunk-UJMQP2HP.js";import"./chunks/chunk-3DWEBVIK.js";import{ha as la,j as Hr}from"./chunks/chunk-OBTU2BHJ.js";import"./chunks/chunk-L3SA3354.js";import"./chunks/chunk-A7L5IEYV.js";import"./chunks/chunk-U7MZIX3D.js";import{Ac as Fn,Bc as Ze,C as Rt,Cc as E,D as pe,Dc as Jr,Ec as jn,Ic as z,Wc as Yr,jb as Tt,kb as H,mb as Wr,n as St,nb as Br,p as Ye,pb as Vr,q as At,yc as Ot,zc as It}from"./chunks/chunk-PS2YAPXC.js";import{A as Lr,B as Fr,C as Mn,D as jr,n as Dn,p as Nr,u as Nn,w as Mr}from"./chunks/chunk-MR3CRLA7.js";import"./chunks/chunk-OFIXSWJS.js";import"./chunks/chunk-IB7UB5TE.js";import{$c as Tr,Ac as vr,Ad as $r,Bc as wr,Bd as Dr,Dc as br,Hb as kt,Hc as Cr,Ib as yr,Ic as xr,Jc as Sn,K as $i,Lc as kr,Mc as me,Nc as An,Oc as Rn,Pc as Tn,Qc as On,Rc as Et,Sc as In,Tc as Er,Uc as Sr,Vc as Ar,Wc as Pn,Xc as Rr,Yc as Re,ad as Or,hb as ur,ib as fr,jb as gr,kb as hr,ld as Je,od as Ir,rc as En,ud as Pr,xc as _r,zd as $n}from"./chunks/chunk-FOT5K5OM.js";import{Ac as Mi,Ad as de,Bg as xn,Ca as dn,Cb as un,Dd as Vi,Ed as wt,Fa as le,G as Ge,Ha as Ai,Ia as yt,Kd as hn,La as mn,Ld as bt,Lh as Z,Ma as Ri,Md as Ki,Na as T,Nc as Li,Nd as Ji,Pa as Ti,Pc as Fi,Qa as X,Qg as er,Rg as tr,Ri as xt,Sg as nr,Tb as _t,Tg as or,Ug as ir,Uh as cr,Ui as dr,Vg as rr,Vh as ie,Vi as mr,Wb as fn,Wg as ar,Xh as kn,Yh as b,Yi as Ae,Zi as L,_i as pr,ad as ji,ba as Si,bd as Ve,ce as yn,dd as Ke,ed as Ui,gb as _,hb as Oi,hc as Di,ib as pn,ic as Ni,jb as Ii,kb as Pi,lb as K,nb as Ee,nd as qi,ob as ze,od as Hi,of as Yi,pd as Gi,pf as Xi,qd as zi,r as M,rb as We,rd as oe,sd as Wi,sg as _n,t as B,td as gn,tg as vn,u as q,ud as ce,ug as Zi,uh as sr,vd as Bi,vg as Qi,w as J,wb as Be,wd as vt,x as cn,xf as Ct,xg as wn,y as V,yg as bn,yh as lr,z as Ei,zd as Se,zg as Cn}from"./chunks/chunk-PZI6CR24.js";import"./chunks/chunk-SPPHDVZE.js";import"./chunks/chunk-RSAN2YUU.js";import"./chunks/chunk-VS565KBX.js";import{A as h,B as ht,C as R,E as Y}from"./chunks/chunk-O4ZLEN4T.js";import"./chunks/chunk-XAWE4EAK.js";import{AsyncLocalStorage as Ul}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]="0e47421c-706d-5e31-a466-6152cdeba30f")}catch{}})();var Oe=new Ul;function ba(e){let t=Oe.getStore();return t===void 0?e:t!==null}function ue(e,t=`warning:${e}`){let n=Oe.getStore();n?(!n.has(e)||t!==`warning:${e}`)&&n.set(e,t):b(t)}function et(e){let t=Oe.getStore();if(!t?.size)return e;let n=Reflect.get(e,"warnings"),o=[...t].filter(([a,s])=>s!==`warning:${a}`).map(([a,s])=>({code:a,message:s})),i=Reflect.get(e,"warning_details"),r={...e,warnings:[...Array.isArray(n)?n:[],...t.keys()],...o.length>0?{warning_details:[...Array.isArray(i)?i:[],...o]}:{}};return t.clear(),r}function Wn(e){if(!Oe.getStore()?.size)return e;let{token_accounting:t,...n}=et(JSON.parse(e));return JSON.stringify(t===void 0?n:Z(n,o=>`${JSON.stringify(o,null,2)}
1
+ import{a as Xr}from"./chunks/chunk-FAYX6C7H.js";import"./chunks/chunk-DEZPZOQ7.js";import{A as Gn,C as _a,D as va,F as wa,G as zn,a as Ln,d as P,e as F,f as O,g as D,h as k,i as Gr,n as Xe,o as zr,p as Zr,t as Qr,u as pa,v as ua,w as fa,x as ga,y as ha,z as ya}from"./chunks/chunk-L4F4ZHGR.js";import{Ua as ma,f as Ur,k as qr}from"./chunks/chunk-GXGMMIZN.js";import"./chunks/chunk-URWNUZQZ.js";import"./chunks/chunk-COTC2QOR.js";import{A as $t,D as ia,E as ra,F as Q,G as aa,Hc as ca,Jd as da,aa as sa,b as Te,l as Kr,q as Un,r as qn,s as ea,t as ta,u as na,v as Hn,w as Pt,x as Qe,z as oa}from"./chunks/chunk-TCYIGAQG.js";import"./chunks/chunk-UJMQP2HP.js";import"./chunks/chunk-36E4L2R4.js";import{ha as la,j as Hr}from"./chunks/chunk-5LG5YZYF.js";import"./chunks/chunk-OQCVU2SG.js";import"./chunks/chunk-QSSENTXG.js";import"./chunks/chunk-IYDIPXBO.js";import{Ac as Fn,Bc as Ze,C as Rt,Cc as E,D as pe,Dc as Jr,Ec as jn,Ic as z,Wc as Yr,jb as Tt,kb as H,mb as Wr,n as St,nb as Br,p as Ye,pb as Vr,q as At,yc as Ot,zc as It}from"./chunks/chunk-GIAJX2QJ.js";import{A as Lr,B as Fr,C as Mn,D as jr,n as Dn,p as Nr,u as Nn,w as Mr}from"./chunks/chunk-O6PBQMD7.js";import"./chunks/chunk-CO7RWLCM.js";import"./chunks/chunk-IB7UB5TE.js";import{$c as Tr,Ac as vr,Ad as $r,Bc as wr,Bd as Dr,Dc as br,Hb as kt,Hc as Cr,Ib as yr,Ic as xr,Jc as Sn,K as $i,Lc as kr,Mc as me,Nc as An,Oc as Rn,Pc as Tn,Qc as On,Rc as Et,Sc as In,Tc as Er,Uc as Sr,Vc as Ar,Wc as Pn,Xc as Rr,Yc as Re,ad as Or,hb as ur,ib as fr,jb as gr,kb as hr,ld as Je,od as Ir,rc as En,ud as Pr,xc as _r,zd as $n}from"./chunks/chunk-UFZQPKQS.js";import{$g as rr,$h as ie,$i as mr,Ad as ce,Ag as Zi,Ah as sr,Bd as Bi,Bg as Qi,Ca as dn,Cb as Be,Cd as vt,Df as Ct,Dg as wn,Eg as bn,Eh as lr,Fa as le,Fd as Se,Fg as Cn,G as Ge,Gc as Mi,Gd as de,Ha as Ai,Hg as xn,Ia as yt,Ib as un,Jd as Vi,Kd as wt,La as mn,Ma as Ri,Na as T,Pa as Ti,Qa as X,Qd as hn,Rd as bt,Rh as Z,Sd as Ki,Tc as Li,Td as Ji,Vc as Fi,Wg as er,Xg as tr,Xi as xt,Yg as nr,Zb as _t,Zg as or,_g as ir,_h as cr,_i as dr,ac as fn,ah as ar,ba as Si,bi as kn,ci as b,cj as Ae,dj as L,ej as pr,gb as _,gd as ji,hb as Oi,hd as Ve,ib as pn,ie as yn,jd as Ke,kd as Ui,nc as Di,oc as Ni,pb as Ii,qb as Pi,r as M,rb as K,t as B,tb as Ee,td as qi,u as q,ub as ze,ud as Hi,uf as Yi,vd as Gi,vf as Xi,w as J,wd as zi,x as cn,xb as We,xd as oe,y as V,yd as Wi,yg as _n,z as Ei,zd as gn,zg as vn}from"./chunks/chunk-HQINCDF6.js";import"./chunks/chunk-SPPHDVZE.js";import"./chunks/chunk-RSAN2YUU.js";import"./chunks/chunk-VS565KBX.js";import{A as h,B as ht,C as R,E as Y}from"./chunks/chunk-O4ZLEN4T.js";import"./chunks/chunk-XAWE4EAK.js";import{AsyncLocalStorage as Ul}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]="0e47421c-706d-5e31-a466-6152cdeba30f")}catch{}})();var Oe=new Ul;function ba(e){let t=Oe.getStore();return t===void 0?e:t!==null}function ue(e,t=`warning:${e}`){let n=Oe.getStore();n?(!n.has(e)||t!==`warning:${e}`)&&n.set(e,t):b(t)}function et(e){let t=Oe.getStore();if(!t?.size)return e;let n=Reflect.get(e,"warnings"),o=[...t].filter(([a,s])=>s!==`warning:${a}`).map(([a,s])=>({code:a,message:s})),i=Reflect.get(e,"warning_details"),r={...e,warnings:[...Array.isArray(n)?n:[],...t.keys()],...o.length>0?{warning_details:[...Array.isArray(i)?i:[],...o]}:{}};return t.clear(),r}function Wn(e){if(!Oe.getStore()?.size)return e;let{token_accounting:t,...n}=et(JSON.parse(e));return JSON.stringify(t===void 0?n:Z(n,o=>`${JSON.stringify(o,null,2)}
2
2
  `),null,2)}async function Ca(e,t){if(!e){await Oe.run(null,t);return}let n=new Map;await Oe.run(n,async()=>{await t(),n.size>0&&ie(`${JSON.stringify(et({type:"warning"}))}
3
3
  `)})}import{AsyncLocalStorage as ql}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]="ad9cd4bc-07aa-5641-a1c4-b2aea5d4700c")}catch{}})();var Bn=new ql,xa=new WeakMap;function Hl(e){let t=e.outputFormat!==void 0?["--output-format",e.outputFormat]:e.json===!0?["--json"]:[];return{scopeArgs:Ee(e),outputArgs:t}}var ka=new WeakMap;function Gl(e,t){let n=e.registeredArguments.findIndex(o=>o.name()==="id");if(!(n===-1||e.name()==="plan"&&t[0]==="create"))return t[n]}function Vn(e,t){return t.some(n=>n.path!==e.path||n.args.length!==e.args.length||n.args.some((o,i)=>o!==e.args[i]))}async function Kn(e){if(e.expectHash===void 0)return;let t=Dn(e.expectHash),n=e.commandPath.trim().toLowerCase();if(Mn(n,e.commandOptions),e.rewritten===!0)throw Nn();let o=Bn.getStore();if(o===void 0)throw new TypeError("--expect-hash was parsed outside an invocation revision scope");let i=await Nr(e.pmRoot,t,Gl(e.command,e.commandArgs));gr(o,e.pmRoot,i),ka.set(o,n),e.globalOptions!==void 0&&xa.set(o,Hl(e.globalOptions))}function Jn(e,t,n){let o=Bn.getStore(),i=o===void 0?void 0:ka.get(o);if(i!==void 0){if(Vn(e,[t]))throw Nn();Mn(i,n)}}function Ea(e,t){if(t!==void 0)throw Dn(t),jr(e)}function zl(e){for(let t of hr(e).unchecked)ue(Fr(t))}async function Wl(e,t){return e.pmRoot===void 0?t:Mr(t,e.pmRoot,xa.get(e))}async function Sa(e){let t=ur();try{await e(n=>Bn.run(t,()=>fr(t,n)))}catch(n){throw await Wl(t,n)}zl(t)}import{Command as fi,CommanderError as sl}from"commander";(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]="50318c14-8c1c-50f3-95d0-fd9ea3f0bb69")}catch{}})();function W(e){return`--${e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`}function fe(e){if(!e.startsWith("--"))return;let t=e.includes("=")?e.slice(0,e.indexOf("=")):e;return W(t)}function ee(e){let t=new Set,n=[];for(let o of e){let i=fe(o);i&&(t.has(i)||n.push(i),t.add(i))}return 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]="ceab696e-18da-519f-8df1-ae9d92e5245f")}catch{}})();var Yn=new Set(["--fields","--output-include","--depth","--for","--token-budget"]),Dt=new Set(["--full","--brief","--compact"]);function Bl(e,t){return!!(e.flag==="--pm-path"||e.value_name||e.list||e.value_type==="number"||e.value_type==="string"||t.has(e.flag))}function Xn(e,t=k([...e])){let n=H(t),o=new Set([...Wr,...Br,...Vr].flatMap(s=>s.keys.map(c=>`--${c.replace(/[A-Z]/g,l=>`-${l.toLowerCase()}`)}`))),i=new Map([...pe,...n].flatMap(s=>[s.flag,...s.aliases??[]].map(c=>[c,s.flag]))),r=new Map([...pe,...n].flatMap(s=>[s.flag,...s.aliases??[]].map(c=>[c,Bl(s,o)])));for(let s of Yn)r.set(s,!0);for(let s of Dt)r.set(s,!1);let a=new Map;for(let s=0;s<e.length;s+=1){let c=e[s];if(c==="--")break;if(!c.startsWith("-"))continue;let l=c.split("=")[0];if(!r.has(l)&&!c.includes("="))return;let d=r.get(l)===!0&&!c.includes("=");a.set(s,{flag:i.get(l)??l,consumesValue:d}),d&&(s+=1)}return a}function Vl(e){let t=Xn(e);return t===void 0?void 0:new Map([...t].map(([n,{flag:o}])=>[n,o]))}function Aa(e,t,n){let o=new Set;for(let[i,r]of t)n.has(r)&&(o.add(i),Yn.has(r)&&!e[i].includes("=")&&o.add(i+1));return e.filter((i,r)=>!o.has(r))}function Kl(e,t){let n=t.find(i=>Dt.has(i));if(n===void 0)return;let o=[...new Set(e.values())].filter(i=>Dt.has(i));return o.length===1?o[0]:n}function Ra(e,t,n){if(!n||!["unknown_field_projection","projection_options_mutually_exclusive"].includes(t??""))return n;let o=n.suggested_retry_args,i={...n,suggested_retry:void 0,suggested_retry_args:void 0};if(!o)return i;let r=Vl(e);if(!r)return i;let a;if(t==="unknown_field_projection"){let s=o.indexOf("--fields");if(s<0||o[s+1]===void 0)return i;let c=[...r].find(([l,d])=>d==="--fields")?.[0]??-1;if(c<0)return i;a=Aa(e,r,new Set(["--fields"])),a.splice(c,0,"--fields",o[s+1])}else{let s=Kl(r,o);if(s===void 0||![...r.values()].includes(s))return i;let c=new Set([...Yn,...Dt].filter(l=>l!==s));a=Aa(e,r,c)}return{...n,suggested_retry:_(a),suggested_retry_args:a}}(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]="df0b3527-6272-570d-8f41-6bcfa3bfd75d")}catch{}})();var Ta=new Set(or);function Jl(e){return e.includes("@")&&e.includes(":")}function Yl(e){let t=D([...e]);if(t===void 0)return;let n=e[t+1],o=n===void 0||n.startsWith("-")?void 0:`${e[t]} ${n}`;return o!==void 0&&Tt(o)?o:e[t]}function Xl(e){let t=Te(e??"",H(e));return new Set(t.filter(n=>n.takes_value).flatMap(n=>[n.flag,...n.aliases??[]]))}function Oa(e,t,n,o=[],i=()=>!1){if(t!==nr)return n;let r=n===void 0?void 0:{...n,suggested_retry:void 0,suggested_retry_args:void 0},a=Yl(e),s=Xn(e,a);if(s===void 0||o===null||e.some(Jl)||i())return r;let c=Zl(e,s,Xl(a));if(c===void 0||c.size===0)return r;let l=[...o,...e.filter((d,m)=>!c.has(m))];return{...n,suggested_retry:_(l),suggested_retry_args:l}}function Zl(e,t,n){let o=new Set;for(let[i,{flag:r,consumesValue:a}]of t){if(!Ta.has(r))continue;let s=e[i-1];if(s!==void 0&&!s.includes("=")&&n.has(s)||a&&e[i+1]?.startsWith("-")===!0)return;o.add(i),a&&o.add(i+1)}return e.some((i,r)=>!o.has(r)&&Ta.has(i.split("=",1)[0]))?void 0:o}(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]="fe4ae753-52f9-57d4-b85b-f6dfc106db94")}catch{}})();var Ql=new Set(["normalized_args","suggested_retry_args","provided_fields","parsed_positionals","normalizedInvocationArgs","providedOptionFlags","suggestedRetryArgs"]),ec=new Set(["code","original_code","type","recovery_mode","option_scope","diagnostic_class"]),Zn=`URL credentials in this invocation were replaced with ${Oi}; restore them before replaying any command shown here.`;function ge(e){return e.map(pn)}function tc(e,t){return e==="producer"||t==="details"?"producer":e==="schema"&&t==="recovery"?"schema":"typed"}function nc(e,t,n){let o=K(e);o!==e&&(n.changed=!0);let i=o;for(let r=2;Object.hasOwn(t,i);r+=1)i=`${o} (${r})`;return i}function oc(e,t,n){let o=K(n?pn(e):e);return o!==e&&(t.changed=!0),o}function Qn(e,t,n,o){if(e===Zn)return e;if(typeof e=="string")return oc(e,t,n);if(typeof e!="object"||e===null)return e;let i=t.copies.get(e);if(i!==void 0)return i;if(Array.isArray(e)){let a=[];t.copies.set(e,a);for(let s of e)a.push(Qn(s,t,n,o));return a}let r={};t.copies.set(e,r);for(let[a,s]of Object.entries(e)){if(o==="schema"&&ec.has(a)&&typeof s=="string"){r[a]=s;continue}let c=o==="producer"?nc(a,r,t):a;r[c]=Qn(s,t,n||Ql.has(a),tc(o,a))}return r}function Nt(e){let t={copies:new Map,changed:!1},n=Qn(e,t,!1,"schema");if(!t.changed&&!Pi())return e;n.recovery&&(n.recovery={...n.recovery,suggested_retry:void 0,suggested_retry_args:void 0});let o=(n.nextSteps??[]).filter(i=>i!==Zn);return n.nextSteps=[Zn,...o],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]="c470fd86-4218-5aed-a681-58557d759b28")}catch{}})();var ic="project_schema_field_requires_declared_flag";function rc(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--")break;o.startsWith("--field=")?t.push({index:n,width:1,assignment:o.slice(8)}):o==="--field"&&n+1<e.length&&(t.push({index:n,width:2,assignment:e[n+1]}),n+=1)}return t}function Ia(e,t,n,o){let i=o?.suggested_flags?.[0];if(t!==ic||n===void 0||i===void 0)return o;let r=rc(e).filter(({assignment:d})=>d.split("=",1)[0].trim()===n&&d.includes("="));if(r.length!==1)return o;let[a]=r,s=a.assignment.trim(),c=s.slice(s.indexOf("=")+1),l=[...e.slice(0,a.index),i,c,...e.slice(a.index+a.width)];return{...o,suggested_retry:_(l),suggested_retry_args:l}}(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]="f8935dde-8de2-508e-b910-2a603a763c48")}catch{}})();var eo=Kr;function ac(e,t,n,o,i){let r=[],a=e.indexOf(n,t);if(a<0||e.slice(t,a).some(s=>s.startsWith("-")))return r;for(let s=a+1;s<e.length;s+=1){let c=e[s];if(c==="--")break;c===`${o}=${i}`?r.push({index:s,width:1}):c===o&&e[s+1]===i&&(r.push({index:s,width:2}),s+=1)}return r}function Pa(e,t,n,o,i=[]){let r=o?.suggested_flags?.[0];if(t!==eo||n===void 0||r===void 0||o.suggested_retry_args===void 0)return o;let a={...o,suggested_retry:void 0,suggested_retry_args:void 0},s=D([...e]);if(s===void 0||i===null)return a;let c=o.suggested_retry_args,l=ac(e,s,c[0],n,r);if(l.length!==1)return a;let{index:d,width:m}=l[0],p=[...e.slice(0,d),r,...e.slice(d+m)];if(!sc(p,d,n,r,c))return a;let u=[...i,...p];return{...o,suggested_retry:_(u),suggested_retry_args:u}}function sc(e,t,n,o,i){let r=i.lastIndexOf(o);return r<0||i.slice(r).some((a,s)=>e[t+s]!==a)?!1:!e.some((a,s)=>s!==t&&(a===n||a.startsWith(`${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]="bed9cdab-5e06-5035-8d76-d9943a8e7e5f")}catch{}})();var to="close_validation_missing_fields";function lc(e,t,n,o){let i=e.slice(t+1);if(!i.includes("--"))return[...e,...o];if(!i.some(r=>n.has(r.split("=",1)[0])))return[...e.slice(0,t+1),...o,...i]}function cc(e,t){let n=e.slice(0,e.length-2*t),o=n.length;for(;o>0&&n[o-1].startsWith("--expect-hash=");)o-=1;return n.slice(o)}function $a(e,t,n,o=[]){let i=n?.missing;if(t!==to||i===void 0||i.length===0)return n;let r=n.suggested_retry_args;if(r===void 0)return n;let a={...n,suggested_retry:void 0,suggested_retry_args:void 0},s=D([...e]);if(s===void 0||o===null)return a;let c=H(e[s].trim().toLowerCase()),l=i.map(f=>c.find(g=>g.flag===f||g.aliases?.includes(f)===!0));if(l.some(f=>f===void 0))return a;let d=new Set(l.flatMap(f=>[f.flag,...f.aliases??[]])),m=cc(r,i.length),p=lc(e,s,d,[...i.flatMap(f=>[f,"<value>"]),...m]);if(p===void 0)return a;let u=[...o,...p];return{...n,suggested_retry:_(u),suggested_retry_args:u}}(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]="afa4a7a0-d9de-529d-92dd-3e9704ea00d2")}catch{}})();async function Da(e,t){await $r(e,{ok:t.ok,error:t.error,result:de(),exit_code:t.exit_code,error_code:t.error_code,error_category:t.error_category,command_resolution:t.command_resolution,resolution_stage:t.resolution_stage})}async function Na(e){if(process.env.PM_CONTEXT_USAGE_DISABLED==="1")return;let t;try{await sr({pmRoot:e.pmRoot,result:de()})}catch(o){t=o}let n=await L(e.pmRoot);if(await lr({pmRoot:e.pmRoot,author:Ct(e.author,n.author_default),itemIds:e.itemIds,intent:e.intent}),t!==void 0)throw t}(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]="dacf3952-3ae1-57fa-840a-c8a43cf855a5")}catch{}})();(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]="9490326e-507d-5b3e-9958-08c12afbc5ff")}catch{}})();var Ma=new WeakMap;function Mt(e,t){Ma.set(e,t)}function he(e){return Ma.get(e)}function La(e){return e.length>0?[e[0]]:[]}function dc(e){let t=["","Intent:",` ${e.why}`],n=La(e.examples);return n.length>0&&(t.push("","Example:"),t.push(` ${n[0]}`)),t.push("","Need deeper rationale and more examples?"),t.push(" Re-run with --explain."),t.join(`
4
4
  `)}function mc(e){let t=["","Why use this command:",` ${e.why}`,"","Examples:",...e.examples.map(n=>` ${n}`)];return e.tips&&e.tips.length>0&&(t.push("","Tips:"),t.push(...e.tips.map(n=>` - ${n}`))),t.join(`
@@ -36,7 +36,7 @@ Extension command metadata:
36
36
  `)}return process.exitCode=h.SUCCESS,!0}function jm(e,t){let n=["","Type-aware option policies:"," pass --type <value> with --help to render required/disabled/hidden option policy details for that type.",` active type values: ${t.types.join("|")}`];return e==="create"&&n.push(" scheduling shortcut: use --schedule-preset lightweight for Reminder/Meeting/Event minimal create flows."),n.join(`
37
37
  `)}function Um(e,t){if(t.options.length===0){e.push(" type options: none");return}e.push(" type options:");for(let n of t.options){let o=n.required?" (required)":"",i=n.aliases??[];e.push(` - ${n.key}${o}`),e.push(` values: ${n.values.length>0?n.values.join("|"):"any non-empty string"}`),e.push(` aliases: ${i.length>0?i.join("|"):"none"}`),n.description&&n.description.trim().length>0&&e.push(` description: ${n.description.trim()}`)}}function qm(e,t){let n=e==="create"?new Set(["title","type"]):new Set,o=new Set(n);if(e==="create")for(let i of[...t.required_create_fields,...t.required_create_repeatables])o.add(i);return{progressive:n,strict:o}}function Hm(e,t,n,o){let i=new Set(n),r=o.filter(c=>!i.has(c)),a=c=>c.length>0?c.map(l=>dn("create",l)).join(", "):"none";e.push(` required in strict mode: ${a(r)}`);let s=r.map(ca).filter(c=>c!==void 0);e.push(` explicit empty assertion: ${s.length>0?s.join(", "):"none"}`),["Reminder","Meeting","Event"].includes(t.name)&&(e.push(" schedule preset: --schedule-preset lightweight switches schedule artifacts to progressive required-option policy."),e.push(" strict parity remains available via --create-mode strict."))}function Gm(e,t,n){let o=zr(n);if(!o)return jm(e,t);let i=Ai(o,t);if(!i){let g=t.types.join("|");return["",`Type-aware option policies: type "${o}" is not in the active registry.`,` active type values: ${g}`].join(`
38
38
  `)}let r=n.indexOf("--"),a=r<0?n:n.slice(0,r),s=a.findIndex(g=>g==="--create-mode"||g.startsWith("--create-mode=")),c=s<0?void 0:a[s]?.startsWith("--create-mode=")?a[s]?.slice(14):a[s+1],l=e==="create"&&c?.toLowerCase()==="strict",d=qm(e,i),m=yt(i,e,d.progressive),p=yt(i,e,l?d.strict:d.progressive),u=g=>g.length>0?g.map(y=>dn(e,y)).join(", "):"none",f=["",`Type-aware option policies for ${i.name}:`,` required: ${u(p.required)}`,` disabled: ${u(p.disabled)}`,` hidden: ${u(p.hidden)}`];if(e==="create"){let g=yt(i,e,d.strict);Hm(f,i,m.required,g.required)}return Um(f,i),p.errors.length>0&&f.push(` config errors: ${p.errors.join("; ")}`),f.join(`
39
- `)}function Ms(e,t,n){let o=k(n);if(o!=="create"&&o!=="update")return;let i=rt(e,o);i&&i.addHelpText("after",Gm(o,t,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]="665c29cd-2a3b-5cfc-9690-6d82541fc5d9")}catch{}})();function zm(e,t){return Be(e.id)||`migration-${String(t+1).padStart(3,"0")}`}function Wm(e){return Be(e.status)?.toLowerCase()??"pending"}function Bm(e){return e.mandatory===!0}function Vm(e,t){let n=e.layer.localeCompare(t.layer);if(n!==0)return n;let o=e.name.localeCompare(t.name);return o!==0?o:e.id.localeCompare(t.id)}function js(e){let t=[];return e.forEach((n,o)=>{if(!Bm(n.definition))return;let i=Wm(n.definition);i!=="applied"&&t.push({layer:n.layer,name:n.name,id:zm(n.definition,o),status:i})}),t.sort(Vm),t}function Ls(e){return Array.isArray(e)&&e.length>0}var Km=new Set(["create","beads import","todos import"]),Jm=new Set(["restore","update","close","delete","append","claim","release"]),Ym=new Set(["comments","notes","learnings"]),Xm=new Set(["files","docs","test"]),Zm=new Set(["activate","add","add-field","add-status","add-type","apply","compact","create","deactivate","delete","disable","edit","enable","import","infer","install","materialize","migrate","redact","remove","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type","repair","run","save","set","unset","update","upgrade"]);function Po(e,t){let n=t.force===!0;return Km.has(e)?{isMutation:!0,forceCapable:!1,forceRequested:!1}:Jm.has(e)?{isMutation:!0,forceCapable:!0,forceRequested:n}:Ym.has(e)?{isMutation:typeof t.add=="string",forceCapable:!0,forceRequested:n}:Xm.has(e)?{isMutation:Ls(t.add)||Ls(t.remove),forceCapable:!0,forceRequested:n}:{isMutation:!1,forceCapable:!1,forceRequested:!1}}function Qm(e,t,n){if(Po(e,n).isMutation)return!0;let o=e.trim().toLowerCase();return Or(o)?["close-many","close-task","copy","delete","discover","focus","pause-task","start-task","update-many"].includes(o)?!0:t.some(i=>Zm.has(i.trim().toLowerCase())):!1}function Fs(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function ep(e,t,n){let o=t[0]?.trim().toLowerCase()??"";if(e.trim().toLowerCase()!=="schema"||!["rename-type","rename-field","remap-status"].includes(o))return;let i=[];if(Be(t[1])||i.push("source"),Be(n.to)||i.push("--to"),i.length!==0)throw new R(`Schema migration requires ${i.join(", ")}.`,h.USAGE,{code:"schema_migration_input_required",required:i.join(","),why:"Schema migrations require a source and target. A workspace-bound stable migration id is derived automatically when --migration-id is omitted.",recovery:{recovery_mode:"compact",missing_required_fields:i,suggested_flags:i.filter(r=>r.startsWith("--")),suggested_retry:`pm schema ${o} <source> --to <target>`}})}async function tp(e,t,n,o,i){if(e.trim().toLowerCase()!=="update"||typeof n.status!="string"||Fs(n.status)!==Fs(i.schema.workflow.in_progress_status))return;let r=t[0];if(!r)return;let a=le(i,ce()),s=await kt(o,r,i.id_prefix,i.item_format,a.type_to_folder);if(!s)return;let c=await yr(s,{schema:i.schema}),l=typeof n.assignee=="string"?n.assignee.trim():void 0;(l===void 0?c.document.metadata.assignee?.trim():!["","none","null","undefined"].includes(l.toLowerCase())&&l)||b(`warning:in_progress_item_unclaimed:${s.id}:claim_with=pm claim ${s.id}`)}async function $o(e,t,n,o,i){if(!Qm(e,t,n)||(ep(e,t,n),!await Y(X(i))))return;let r=await Ae(i);ba(o.json===!0)||await tp(e,t,n,i,r.settings);let a=Tr({author:Ct(o.author,r.settings.author_default),payload:{command:e,args:t,options:n},settings:r.settings.mutation_guard,force:o.force===!0||n.force===!0});for(let s of a.warnings)ue(s)}function Us(e,t,n){if(n.length===0)return;let o=Po(e,t);if(!o.isMutation||o.forceCapable&&o.forceRequested)return;let i=n.map(a=>`extension_migration_blocking:${a.layer}:${a.name}:${a.id}:${a.status}`),r=o.forceCapable?"Re-run this command with --force to bypass.":"This command path does not support --force bypass.";throw new R(`Write command "${e}" blocked by unresolved mandatory extension migrations (${i.join(",")}). ${r}`,h.CONFLICT)}async function Do(e,t,n,o){if(!Po(e,t).isMutation||!o.enforce_item_format_gate&&!o.run_preflight_item_format_sync||!await Y(X(n)))return;let{settings:i,metadata:r,warnings:a}=await Ae(n);for(let s of a)ue(s);if(!mr(i)&&(o.enforce_item_format_gate&&!r.has_explicit_item_format&&(dr(i),await pr(n,i,"item_format:auto_select_default")),o.run_preflight_item_format_sync)){let s=le(i,ce());await Ir(n,i.item_format,"item_format:pre_mutation_sync",s.type_to_folder,i.schema)}}(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]="c0826cb1-5181-51b3-9ad9-0cd7a3d2c4b3")}catch{}})();function No(e){let t=[];for(let n of e??[]){if(n.startsWith("-"))break;let o=w(n);o.length!==0&&t.push(o)}return t}function Le(e){let t=w(e.commandPath??"");if(t.length===0)return[];let n=[t],o=t.split(" ").filter(i=>i.length>0);for(let i of No(e.commandArgs))o.push(...i.split(" ").filter(r=>r.length>0)),n.push(o.join(" "));return[...new Set(n.flatMap(i=>[i,q(i)]))]}function Mo(e,t){let n=w(e);if(n.length===0)return!1;let o=Le(t);for(let i of o)if(i===n||i.startsWith(`${n} `))return!0;return t.allowCommandPrefixMatch===!0?o.some(i=>n.startsWith(`${i} `)):!1}function Bt(e){let t=e.activation?.commands;if(t)return t;let n=e.contributions;return n?[...N(n.commands),...N(n.command_handlers),...N(n.command_overrides),...N(n.flag_commands),...N(n.parser_overrides),...qs(n.preflight_ownership),...qs(n.renderer_ownership)]:[]}function N(e){return e??[]}function qs(e){return N(e).flatMap(t=>t.commands)}function st(e){return new Set((e.capabilities??[]).map(t=>t.trim().toLowerCase()))}var Hs=new Set(["hooks","parser","preflight","renderers"]),Gs=new Set(["commands","schema","services","importers"]),np=new Set(["reindex","search","search-advanced"]),op=new Set(["--template"]);function Me(e,t){for(let n of t)if(e.has(n))return!0;return!1}function Lo(e){let t=w(e??"");if(t.length===0)return!1;let[n]=t.split(" ");return np.has(n??t)}function Fo(e,t){for(let n of e.commandArgs??[]){if(!n.startsWith("--"))continue;let[o]=n.split("=",1);if(t.has(o))return!0}return!1}function Vt(e){return w(e.commandPath??"")==="create"&&Fo(e,op)}function jo(e){return e.some(t=>{let n=w(t);return n==="templates"||n.startsWith("templates ")})}function Wt(e,t){return e.some(n=>Mo(n,t))||Vt(t)&&jo(e)}function Uo(e){return[N(e.hooks).length,(e.preflight_overrides??0)-N(e.preflight_ownership).length,N(e.item_types).length,N(e.item_fields).length,N(e.relationship_kinds).length,N(e.service_overrides).length,N(e.assurance_providers).length,N(e.renderer_overrides).length-N(e.renderer_ownership).length].some(t=>t>0)}function qo(e,t){let n=e.activation?.commands??[];if(n.length>0)return Wt(n,t);let o=Bt(e);if(Wt(o,t)||st(e).has("search")&&Lo(t.commandPath))return!0;if(e.contributions)return Uo(e.contributions)}function Kt(e,t){let n=qo(e,t);if(n!==void 0)return n;let o=st(e);return!!(Me(o,Hs)||Me(o,Gs))}function lt(e,t){return e.effective.length===0?!1:ct(t)!=="all"?e.effective.some(n=>Kt(n,t)):e.effective.some(n=>{let o=st(n);return Bt(n).length>0||Me(o,Hs)||Me(o,Gs)||o.has("search")})}function ct(e){if(w(e.commandPath??"").split(" ")[0]==="completion")return"all";let t=Le(e).filter(o=>o.split(" ").every(i=>!i.startsWith("-"))).sort((o,i)=>i.length-o.length)[0]??w(e.commandPath??"");if(t.length===0)return"all";let n=Vt(e)?"--template":"";return`${e.allowCommandPrefixMatch===!0?"prefix":"exact"}:${t}:${n}`}function Ho(e){return ct(e)==="all"?void 0:t=>Kt(t,e)}function Fe(e){let t=O(e);if(t.requested&&t.commandPathTokens.length>0){let[i,...r]=t.commandPathTokens;return{commandPath:i,commandArgs:r,allowCommandPrefixMatch:!0}}let n=F(e),o=n.findIndex(i=>i.trim().length>0&&!i.startsWith("-"));return o<0?{}:{commandPath:n[o],commandArgs:n.slice(o+1),allowCommandPrefixMatch:t.requested}}function Go(e){let t=e.args.map(String);if(w(E(e))==="create"){let n=e.optsWithGlobals();typeof n.template=="string"&&n.template.trim().length>0&&t.push("--template")}return t}(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]="8065373f-1652-563e-9b43-f21c104f0f61")}catch{}})();var Jt=Symbol.for("pm.readOutputInvocationProvenance"),ip=new Map(pe.filter(e=>e.reservation_scope==="root_only").map(e=>[Pt({long:e.flag}),e.flag]));function se(e,t){let n=Reflect.get(e,Jt);n!==void 0&&Reflect.set(t,Jt,n)}function zo(e,t,n){let o=tr(t,n);if(!o)return;let i=e;for(;i.parent;)i=i.parent;let r=i.rawArgs,a=new Set(ee(r.slice(2))),s=er.find(d=>d.command===o),c=Object.values(s?.dimensions??{}).flatMap(d=>d.legacy_aliases.flatMap(m=>a.has(m.flag)?[m.flag]:[])),l=Reflect.get(n,Jt);Reflect.set(n,Jt,{canonical_include_modes:l?.canonical_include_modes??[],explicit_legacy_aliases:c,cli_invocation_observed:!0}),se(n,e)}function rp(e){let t=e.optsWithGlobals(),n=E(e);if(q(n)===n)return t;let o=e.opts();for(let i=e.parent;i?.parent;i=i.parent)for(let r of i.options){let a=r.attributeName(),s=i.getOptionValueSource(a)==="cli";if(s&&!e.options.some(c=>c.long===r.long))throw new R(`Unknown option '${r.long}' for ${n}`,h.USAGE,{code:"unknown_option",flag:r.long,required:`Use options declared by pm ${n} --help.`});if(s&&e.getOptionValueSource(a)!=="cli"){let c=i.getOptionValue(a);e.setOptionValueWithSource(a,c,"cli")}a in o?t[a]=o[a]:delete t[a]}return t}function Wo(e,t,n,o){zo(e,t,o);let i=n.outputInclude;if(i===void 0)return;let{selectors:r,modes:a}=ar(t,i,o);if(t==="get"&&typeof o.fields=="string"&&e.setOptionValueWithSource("fields",o.fields,"cli"),a.length===0)return;se(o,e);let s=rr(t);for(let l of a){let d=s.get(l),m=o[d];e.setOptionValueWithSource(d,m,"cli")}let c=r.length>0?r.join(","):void 0;c===void 0?delete n.outputInclude:n.outputInclude=c;for(let l=e;l;l=l.parent)l.setOptionValueWithSource("outputInclude",c,"cli");It(e,n)}function je(e,t,n=[],o){let i={...rp(e)};se(e,i),delete i.json,delete i.quiet,delete i.path,delete i.pmPath,delete i.noExtensions,delete i.extensions,delete i.profile,delete i.pager,delete i.changedFields,delete i.fullChangedFields,delete i.idOnly,delete i.lean,delete i.tokenAccounting,delete i.outputInclude,delete i.outputLimit,delete i.outputBudget,delete i.outputFormat,delete i.outputSession,delete i.expectHash;let r=ta(t);for(let[a,s]of Object.entries(r))i[a]===void 0&&(i[a]=s);if(n.length>0){let a=Un(n),s=H(E(e)).map(d=>({long:d.flag,short:d.short,aliases:d.aliases})),c={...r};for(let d of a)i[d]!==void 0&&(c[d]=i[d]);qn(c,[...s,...n],E(e),o);let l=ea(i,n,r,E(e));return se(i,l),l}return i}function Bs(e,t,n){let o=Un(t.map(({long:a})=>({long:a}))),i=[...ip].find(([a])=>e[a]!==void 0&&!o.has(a));if(i===void 0)return;let r=i[1];throw new R(`Unknown option '${r}' for extension command '${n}'. ${r} is a root-only pm flag and this command does not declare it.`,h.USAGE,{code:"unknown_option",flag:r,required:`Remove ${r}, or use it on the root command (pm --help ${r}).`,nextSteps:[`Run pm contracts --command ${n} --flags-only --json to list the flags this command accepts.`]})}function dt(e,t,n){let o=Qe(e,t),i=[t],r=[];for(let a of n){if(a.startsWith("-"))break;i.push(a);let s=Qe(e,i.join(" "));s.length>0&&(r=s)}return r.length>0?r:o}function Yt(e){return e.arguments??[]}function zs(e){let t=Yt(e).map(n=>{let o=n.variadic?`${n.name}...`:n.name;return n.required?`<${o}>`:`[${o}]`}).join(" ");return`pm ${e.command}${t?` ${t}`:""}`}function Bo(e,t){if(!e)return!1;let n=w(t);return e.importers.some(o=>w(`${o.importer} import`)===n)||e.exporters.some(o=>w(`${o.exporter} export`)===n)}var Vs=Symbol("pm.commandOptionTokens"),Ws=Symbol("pm.capturesOptionTokens");function Ks(e){if(Reflect.get(e,Ws)===!0)return;Reflect.set(e,Ws,!0);let t=e.parseOptions.bind(e);e.parseOptions=n=>(Reflect.set(e,Vs,[...n]),t(n))}function ap(e){let t=new Map;for(let n of e.options){let o={arity:n.required?"required":n.optional?"optional":"none",key:n.attributeName(),variadic:n.variadic};for(let i of[n.short,n.long])i&&t.set(i,o)}return t}function sp(e){let t=Reflect.get(e,"_passThroughOptions")===!0;return!t&&Reflect.get(e,"_enablePositionalOptions")!==!0?{}:{stop:{atSubcommand:n=>e.commands.some(o=>o.name()===n||o.aliases().includes(n)),atFirstUnrecognized:t}}}function Js(e,t,n){if(t.length===0)return;let o=[];for(let r=e;r?.parent;r=r.parent)o.unshift(r);let i=[];for(let r of o){let a=Reflect.get(r,Vs);if(a===void 0)continue;let s=ap(r),c=[];for(let l=r;l;l=l.parent)c.push(l);i.push({tokens:a,optionOf:l=>s.get(l),includesLooseFlags:r===e,negativeNumbersAreValues:!c.some(l=>l.options.some(d=>d.short!==void 0&&/^-\d$/u.test(d.short))),...sp(r)})}oa(i,t,n)}function Vo(e,t){let n=Yt(e),o=n.filter(s=>s.required).length,i=n.some(s=>s.variadic)?Number.POSITIVE_INFINITY:n.length,r=e.failure_hints??[],a=r.length>0?` ${r.join(" ")}`:"";if(t.length<o)throw new R(`Missing required argument for extension command '${e.command}'. Usage: ${zs(e)}${a}`,h.USAGE);if(t.length>i){let s=t.slice(i).join(" ");throw new R(`Too many arguments for extension command '${e.command}': ${s}. Usage: ${zs(e)}${a}`,h.USAGE)}}function lp(e){return`--${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()}`}function Xt(e,t){return{definitions:e,inheritedFlags:Rt({readOutput:t}).map(n=>n.flag)}}function cp(e,t,n){let o=Object.keys(e).filter(r=>e[r]!==void 0).sort().map(lp);if(o.length===0)return;let{inheritedFlags:i}=Xt([],n);throw new R(`Unknown option '${o.join(", ")}' for extension command '${t}'. This command declares no flags; it accepts only the host flags ${i.join(", ")}.`,h.USAGE,{code:"unknown_option",flag:o[0],required:`Remove ${o.join(", ")}, or ask the package to declare it with api.registerFlags.`,nextSteps:[`Run pm contracts --command ${t} --flags-only --json to list the flags this command accepts.`]})}function dp(e,t,n){let o=e.read_output_declared===!0;if(n.length>0){qn(t,n,e.command,Xt(n,o));return}cp(t,e.command,o)}function Ko(e,t,n,o){e&&(Vo(e,t),dp(e,n,o))}import{Command as Ys}from"commander";(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]="0503f6e5-36d9-5afb-a17f-feef2241f984")}catch{}})();var mp=new Set(["--version","-V"]);function mt(e){let t=F(e);return["package","packages","extension"].includes(t[0]??"")&&t[1]==="inventory"}function Xs(e){if(F(e)[0]!=="item"||!e.includes("--dry-run"))return;let t=new Ys().configureOutput({writeErr:()=>{}}).exitOverride(),n=new Set;for(let i of pe)for(let r of[i.flag,i.short,...i.aliases??[]]){if(r===void 0||n.has(r))continue;n.add(r);let a=i.value_name!==void 0||i.flag==="--pm-path";t.option(`${r}${a?" <value>":""}`)}try{t.parseOptions(e)}catch{}let o=t.opts();return{path:o.pmPath??o.path}}var pp=new Set(["config","extension","init","install","package","packages","templates","upgrade"]),Jo=new Set(["activity","aggregate","context","ctx","events","get","graph","history","list","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","search"]),Zs=new Set(["append","close","close-many","comments","delete","deps","discover","docs","files","history-repair","history-redact","history-compact","learnings","notes","plan","restore","update","update-many","create"]),up=new Set(["claim","close-task","contracts","duplicates","gc","health","pause-task","release","start-task","stats","test","test-all","test-runs","test-runs-worker","validate"]),fp=new Set(["claim","close-task","pause-task","release","start-task","test"]),be={setup:!0,listQuery:!0,mutation:!0,operation:!0},gp=new Set(["create","update","update-many","list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","search","calendar","context","templates"]);function pt(e){return e.some(t=>mp.has(t))}function hp(e,t){if(!M.some(o=>o.canonical_argv[0]===t))return;let n=new Ys().configureOutput({writeErr:()=>{}}).exitOverride();for(let o of Te(t,H(t))){let i=o.takes_value?o.value_required?" <value>":" [value]":"";for(let r of[o.flag,o.short,...o.aliases??[]])r!==void 0&&n.option(`${r}${i}`)}try{let o=n.parseOptions(e.slice(1));if(o.unknown.length>0)return be;let i=B([t,...o.operands])?.alias;if(M.some(r=>r.alias===i))return{...be,targetCommandName:i}}catch{return be}}function Yo(e){if(pt(e))return{setup:!1,listQuery:!1,mutation:!1,operation:!1};if(e.length===0||O(e).requested)return be;let t=k(e);if(!t)return be;let n=t.trim().toLowerCase(),o=F(e),i=B(o)?.alias;return M.some(r=>r.alias===i)?{...be,targetCommandName:i}:hp(o,n==="ctx"?"context":n)||(pp.has(n)?{setup:!0,listQuery:!1,mutation:!1,operation:!1,targetCommandName:n}:Jo.has(n)?{setup:!1,listQuery:!0,mutation:!1,operation:!1,targetCommandName:n}:Zs.has(n)?{setup:!1,listQuery:!1,mutation:!0,operation:!1,targetCommandName:n}:up.has(n)?{setup:!1,listQuery:!1,mutation:!1,operation:!0,targetCommandName:n}:be)}function Xo(e){return e.length===0||O(e).requested||e.includes("--explain")&&k(e)===void 0}function Zo(e,t){return mt(t)||pt(t)?!1:re(t)||O(t).requested?!0:!!k(t)}function Qo(e){if(pt(e))return!1;let t=k(e);return t?gp.has(t):!1}function yp(e){let t=String(e.rawFrom??""),n=t.indexOf("="),o=n>=0?t.slice(0,n):t,i=e.normalizedTokens.map(l=>{let d=l.indexOf("=");return d>=0?l.slice(0,d):l}).find(l=>l==="--literal"||l==="--regex"||l==="--replacement"),r=i?e.argv.map(l=>{let d=l.indexOf("=");return(d>=0?l.slice(0,d):l)===o?d>=0?`${i}${l.slice(d)}`:i:l}):e.argv,a=ze(r),s=i&&n>=0?`${o}=[redacted]`:t,c=i&&e.normalizedDisplay.includes("=")?`${i}=[redacted]`:e.normalizedDisplay;return{argv:a,normalizedDisplay:c,sourceDisplay:s}}function ei(e){let t=e.commandName;if(!t)return;let n=e.trace.find(l=>l.reason==="flag_typo");if(!n)return;let o=Array.isArray(n.to)?n.to:[String(n.to??"")].filter(l=>l.length>0),i=o.length>0?o.join(" "):"the canonical flag",r=Zs.has(t)||fp.has(t),a=r?"mutating_flag_typo_requires_retry":"flag_typo_requires_retry",s=r?"mutating option":"option",c=yp({argv:e.argv,normalizedDisplay:i,normalizedTokens:o,rawFrom:n.from});throw new R(`Refusing to auto-correct ${s} ${c.sourceDisplay} to ${c.normalizedDisplay}. Retry with the canonical flag so the command is explicit.`,h.USAGE,{code:a,examples:[_(c.argv)],nextSteps:["Retry the command with the canonical flag shown in examples."],recovery:{normalized_args:c.argv,suggested_retry:_(c.argv)}})}(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]="6d83c356-db56-5116-9fe7-e0c27973b36f")}catch{}})();var _p=new Set(["success","nonexistent_command","invalid_option","missing_required_option","missing_required_argument","invalid_usage","validation_failed","health_findings","validation_findings","conflict","runtime_failed","unknown_failed"]),vp=new Set(["parse","preflight","execute","unknown"]),wp=new Set(["usage","validation","conflict","runtime","unknown"]);function Ce(e,...t){if(e)for(let n of t){let o=e[n];if(typeof o=="string"){let i=o.trim();if(i.length>0)return i}}}function ti(e,...t){if(e)for(let n of t){let o=e[n];if(typeof o=="boolean")return o}}function Zt(e,...t){if(e)for(let n of t){let o=e[n];if(typeof o=="number"&&Number.isFinite(o))return Math.max(0,Math.trunc(o))}}function ni(e){if(!e)return;let t=e.trim().toLowerCase();if(_p.has(t))return t}function oi(e){if(!e)return;let t=e.trim().toLowerCase();if(vp.has(t))return t}function ii(e){if(!e)return;let t=e.trim().toLowerCase();if(wp.has(t))return t}function ri(e){let t=Ce(e,"error","message");if(t)return t;let n=e?.warnings;if(Array.isArray(n)){let r=n.find(a=>typeof a=="string"&&a.trim().length>0);if(typeof r=="string")return r.trim()}if(ti(e,"fail_on_skipped_triggered","failOnSkippedTriggered"))return"linked_test_fail_on_skipped_triggered";let o=Zt(e,"failed");if(typeof o=="number"&&o>0)return`failed_runs:${o}`;let i=e?.run_results;if(Array.isArray(i)){let r=i.filter(a=>un(a)?.status==="failed").length;if(r>0)return`failed_runs:${r}`}}function ai(e,t){if(!e)return t===h.USAGE?"invalid_command_usage":t===h.NOT_FOUND?"item_not_found":t===h.CONFLICT?"lock_conflict":t===h.DEPENDENCY_FAILED?"dependency_failed":"command_failed"}function si(){let e=un(de()),t=typeof process.exitCode=="number"&&Number.isFinite(process.exitCode)?Math.max(0,Math.trunc(process.exitCode)):void 0,n=Zt(e,"exit_code","exitCode"),o=t??n??h.SUCCESS,i=sa(o),r=Ce(e,"error_code","errorCode")??ai(i,o),a=ii(Ce(e,"error_category","errorCategory"))??(i?void 0:ht(r)),s=i?void 0:ri(e)??`command_exit_${o}`,c=ni(Ce(e,"command_resolution","commandResolution"))??Et({ok:i,errorCode:r,errorCategory:a}),l=oi(Ce(e,"resolution_stage","resolutionStage"))??"execute";return{ok:i,error:s,exit_code:o,error_code:r,error_category:a,command_resolution:c,resolution_stage:l}}(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]="df513d3f-9fef-51e0-b2cb-e43cf27db6ec")}catch{}})();var li="PM_CLI_PACKAGE_ROOT",ll=Symbol("pm.deprecatedAliasInvocation"),tn=new Map;for(let e of J){let t=e.alias.split(" ")[0],n=tn.get(t)??[];n.push(e),tn.set(t,n)}for(let e of tn.values())e.sort((t,n)=>n.alias.split(" ").length-t.alias.split(" ").length);function bp(){return Di(import.meta.url,["../.."])}(typeof process.env[li]!="string"||process.env[li]?.trim().length===0)&&(process.env[li]=bp());var ke=null,U=null,nn=null;function Cp(e){ke=e}function xp(e){A=e}var ut=null,xe=null,A=new Map,gi=250,kp=new Set([h.USAGE,h.NOT_FOUND,h.CONFLICT]),Ep=new Set(["1","true","yes","on"]),Sp=Je(()=>import("./chunks/register-setup-HCKCSQWQ.js")),Ap=Je(()=>import("./chunks/register-list-query-5XZXTPNG.js")),Rp=Je(()=>import("./chunks/register-mutation-V6WJFL77.js")),Tp=Je(()=>import("./chunks/register-operations-5RAWXY2F.js"));function en(e){return _(e)}function cl(e){let t=e.match(/--[a-zA-Z0-9][a-zA-Z0-9_-]*/g);if(!t||t.length===0)return;let n=[...new Set(t.map(o=>fe(o)??o))];return n.length>0?n:void 0}function Op(e,t,n,o){if(n?.suggested_retry||o===to||o===eo||e.includes("failed in extension handler (")||!/\b(?:missing|required|requires)\b/i.test(e))return;let i=ee(t),r=new Set(i.map(m=>fe(m)??m)),a=cl(e),s=t.find(m=>v.commands.some(p=>p.name()===m)),c=s?v.commands.find(m=>m.name()===s):void 0,l=new Set([...v.options,...c?.options??[]].flatMap(m=>m.flags.split(/[ ,|]+/).map(p=>fe(p)).filter(p=>p!==void 0))),d=a?.filter(m=>{let p=fe(m)??m;return r.has(p)?!1:l.has(p)||xo(t,s,p,A)!==void 0});return d&&d.length>0?d:void 0}function Ip(e,t,n,o){if(o?.suggested_retry)return o.suggested_retry;let i=n?.[0],r=i?fe(i):void 0,a=e.find(p=>v.commands.some(u=>u.name()===p)),s=a?v.commands.find(p=>p.name()===a):void 0,c=r?s?.options.find(p=>p.flags.split(/[ ,|]+/).includes(r)):void 0,l=xo(e,a,r,A),d=r?c?.isBoolean()===!0||l===!1?[r]:[r,"<value>"]:[],m=r?en([...e,...d]):t;return m===t?void 0:m}function Pp(e){if(!e)return{};let t=["recovery_mode","missing_required_fields","suggested_flags","suggested_retry_args","allowed_values","candidate_commands","candidate_commands_total","candidate_commands_truncated","fallback_candidates","next_best_command"],n={};for(let o of t){let i=e[o];i!==void 0&&(o==="allowed_values"||i!==null)&&(n[o]=i)}return n}function $p(e){let t=e.existingRecovery;return{attempted_command:t?.attempted_command??e.attemptedCommand,normalized_args:t?.normalized_args??[...e.invocationArgv],provided_fields:t?.provided_fields??(e.providedFields.length>0?e.providedFields:void 0),missing:t?.missing??e.inferredMissing,...Pp(t),...e.suggestedRetry?{suggested_retry:e.suggestedRetry}:{}}}function Qs(e,t){return{...e,recovery:t}}function Dp(e,t){if(t===void 0)return;let n=Ia(e,t.code,t.field,Ra(e,t.code,t.recovery)),o=Np(e),i=Pa(e,t.code,t.field,n,o),r=Oa(e,t.code,i,o,()=>Lr(T(process.cwd(),P(e).path)));return $a(e,t.code,r,o)}var el=" ";function Np(e){let t=e.map(i=>i===""?el:/^--(?:pm-)?path=$/u.test(i)?`${i}${el}`:i),n=P(t).path;if(n!==void 0&&n.trim()!=="")return[];let o=Ee({});return n!==void 0&&o.length>0?null:o}function dl(e,t,n){let o=ze(t),i=F(o),r=D(i),[a,s]=r===void 0?[]:i.slice(r,r+2),c=o.includes("--explain");e=e===void 0?void 0:vr(e);let l=Dp(o,e),d=l&&(a==="history-redact"||a==="history"&&s==="redact")?{...l,...l.attempted_command?{attempted_command:en(o)}:{},...l.normalized_args?{normalized_args:[...o]}:{},...l.suggested_retry?{suggested_retry:en(o)}:{},...l.suggested_retry_args?{suggested_retry_args:[...o]}:{}}:l;if(d?.recovery_mode==="compact"&&!c)return Qs(e,d);let m=en(o),p=ee(o),u=Op(n,o,d,e?.code),f=Ip(o,m,u,d),g=$p({invocationArgv:o,attemptedCommand:m,providedFields:p,inferredMissing:u,suggestedRetry:f,existingRecovery:d});return Qs(e,g)}async function ft(e){let t=U;U=null,await Da(t,e);let n=ke;if(ke=null,!n){wt();return}let o=[],i=Vi();try{await Na({pmRoot:n.pmRoot,author:n.globalOptions.author,itemIds:e.ok?i?.map(r=>r.id)??[]:[],intent:n.commandName})}catch{o.push("context_usage_feedback_write_failed")}try{o.push(...await Fi(n.hooks,{command:n.commandName,args:n.commandArgs,options:{...n.commandOptions},global:{...n.globalOptions},pm_root:n.pmRoot,ok:e.ok,error:e.error,result:de(),affected:i}))}catch(r){o=[`afterCommand hooks failed: ${r instanceof Error?r.message:String(r)}`]}finally{wt()}!n.globalOptions.json&&o.length>0&&b(`[pm] warning: afterCommand hook_warnings=${z(o)}`),n.profileEnabled&&o.length>0&&b(`profile:extensions hook_warnings=${z(o)}`)}async function ml(e,t){await xr();let n=U,o=ke,i=n?.command??o?.commandName??e,r=n??En(o?.globalOptions??t),a=A.get(w(i))?.source;In(i,o?.commandArgs??[],{...o?.commandOptions,...o?.globalOptions},{source_context:r.source_context,source_context_source:r.source_context_source,pm_version:n?.pm_version??qe,extension:a})}function pl(e){return Ep.has((process.env[e]??"").trim().toLowerCase())}function ul(e){return pl("PM_SENTRY_CAPTURE_EXPECTED_ERRORS")?!0:!kp.has(Math.trunc(e))}async function on(e,t){return ul(e.exit_code)?(await ml(e.command,t),Rr({...e,source_context:e.source_context??En(t).source_context}),!0):!1}async function fl(e){let t=K(me(e.error)),n=ls(t);e.bootstrapGlobal.json?b(JSON.stringify(et(as(t,h.GENERIC_FAILURE)),null,2)):b(t),process.exitCode=h.GENERIC_FAILURE;let o="runtime",i="runtime_failed";try{await ml(e.attemptedCommand,e.bootstrapGlobal),Pn(e.error);let r=await e.emitTelemetryCommandError({command:e.attemptedCommand,errorCode:n.code,errorMessage:n.detail,exitCode:h.GENERIC_FAILURE,options:{bootstrap_global_options:e.bootstrapGlobal},resolutionStage:"execute"});o=r.errorCategory,i=r.commandResolution,await sn(!1,t,{error_code:n.code,error_category:o,exit_code:h.GENERIC_FAILURE,command_resolution:i,resolution_stage:"execute"})}catch(r){e.bootstrapGlobal.json||b(`Failed to report error: ${me(r)}`)}try{await ft({ok:!1,error:t,exit_code:h.GENERIC_FAILURE,error_code:n.code,error_category:o,command_resolution:i,resolution_stage:"execute"})}catch(r){e.bootstrapGlobal.json||b(`Failed to run error hooks: ${me(r)}`)}try{await Re()}catch(r){e.bootstrapGlobal.json||b(`Failed to flush error reporting: ${me(r)}`)}}var Mp={create:"create",update:"update","update-many":"update_many",list:"list","list-all":"list","list-draft":"list","list-open":"list","list-in-progress":"list","list-blocked":"list","list-closed":"list","list-canceled":"list",search:"search",calendar:"calendar",context:"context","templates save":"create"},ci=new Map;function di(e){return e==="number"?"number":e==="boolean"?"boolean":"string"}function gl(e,t){return e.options.some(n=>n.long===t)}function hl(e,t){return e.options.some(n=>n.short===t)}function mi(e,t,n,o){let i=t.trim();if(!i)return;let r=n.length>0?n:`Runtime schema field (${t})`;if(i.startsWith("-")&&!i.startsWith("--")){if(hl(e,i))return;if(o){e.option(`${i} <value>`,`${r} (repeatable)`,jn);return}e.option(`${i} <value>`,r);return}let a=i.startsWith("--")?i:`--${i}`;if(!gl(e,a)){if(o){e.option(`${a} <value>`,`${r} (repeatable)`,jn);return}e.option(`${a} <value>`,r)}}async function yl(e,t){let n=Mp[e];if(!n)return[];let o=`${t}:${n}`,i=ci.get(o);if(i)return i;if(!await Y(X(t)))return ci.set(o,[]),[];let r=await L(t),a=(yn(r.schema).command_to_fields.get(n)??[]).flatMap(s=>[s.cli_flag,...s.cli_aliases].map(c=>({long:`--${c}`,type:di(s.type),value_type:di(s.type)})));return ci.set(o,a),a}async function _l(e,t){let n=P(t),o=T(process.cwd(),n.path);if(!await Y(X(o)))return;let i=xe?.key===_i(o)?xe.snapshot:null,r=i===null?await L(o):i.settings,a=yn(r.schema),s=[{path:"create",command:"create"},{path:"update",command:"update"},{path:"update-many",command:"update_many"},{path:"list",command:"list"},{path:"list-all",command:"list"},{path:"list-draft",command:"list"},{path:"list-open",command:"list"},{path:"list-in-progress",command:"list"},{path:"list-blocked",command:"list"},{path:"list-closed",command:"list"},{path:"list-canceled",command:"list"},{path:"search",command:"search"},{path:"calendar",command:"calendar"},{path:"context",command:"context"},{path:"templates save",command:"create"}];for(let c of s){let l=ne(e,c.path.split(" "));if(l)for(let d of a.command_to_fields.get(c.command)??[]){let m=d.description??"";mi(l,d.cli_flag,m,d.repeatable);for(let p of d.cli_aliases)mi(l,p,`Alias for --${d.cli_flag}`,d.repeatable)}}}async function hi(e,t,n,o,i){let r=k(n);if(!(r!=="create"&&r!=="update"))try{let a=i??await L(t),s=le(a,o);Ms(e,s,n)}catch{}}function pi(){return{enforce_item_format_gate:!0,run_preflight_item_format_sync:!0,run_extension_migrations:!0,enforce_mandatory_migration_gate:!0}}function vl(e,t="all"){return t==="all"?`pm-root:${e}`:`pm-root:${e}:activation:${t}`}function yi(e){return e.some(t=>t==="--profile")}function _i(e){return`pm-root:${e}`}function ui(e){for(let t of e)t.startsWith("settings_read_")&&ue(t,`[pm] warning: ${t} \u2014 settings.json could not be loaded and pm fell back to defaults; run pm health for remediation.`)}function wl(e,t){e.profile&&(b(`profile:extensions loaded=${t.loadedCount} failed=${t.loadFailedCount} warnings=${t.loadWarnings.length} activation_failed=${t.activationFailedCount} hook_counts=before:${t.hooks.beforeCommand.length}|after:${t.hooks.afterCommand.length}|write:${t.hooks.onWrite.length}|read:${t.hooks.onRead.length}|index:${t.hooks.onIndex.length} command_overrides=${t.commands.overrides.length} command_handlers=${t.commands.handlers.length} parser_overrides=${t.parsers.overrides.length} preflight_overrides=${t.preflight.overrides.length} service_overrides=${t.services.overrides.length} renderer_overrides=${t.renderers.overrides.length}`),t.activationWarnings.length>0&&b(`profile:extensions activation_warnings=${z(t.activationWarnings)}`))}function rn(e,t,n){if(!e)return;let o=w(n.commandPath??"")||"<none>";b(`profile:extensions activation=skipped command=${o} effective=${t.discovery.effective.length} warnings=${t.discovery.warnings.length} discovery_ms=${t.discoveryMs}`)}async function an(e,t=Ae){let n=_i(e);if(xe?.key===n)return xe.snapshot;try{let o=Date.now(),{settings:i,warnings:r}=await t(e),a=await ji({pmRoot:e,settings:i,cwd:process.cwd(),noExtensions:!1}),s={pmRoot:e,settings:i,discovery:a,discoveryMs:Date.now()-o,settingsReadWarnings:[...r]};return xe={key:n,snapshot:s},s}catch{return xe={key:n,snapshot:null},null}}async function He(e,t,n=L){let o=t?ct(t):"all",i=vl(e,o);if(ut?.key===i)return ut.snapshot;try{let r=await n(e),a=await Ve({pmRoot:e,settings:r,cwd:process.cwd(),noExtensions:!1,extensionFilter:t?Ho(t):void 0}),s=await Ke({...a,loaded:a.loaded}),c=[...new Set(s.commands.handlers.map(u=>w(u.command)))].filter(u=>u.length>0).sort((u,f)=>u.localeCompare(f)),l=vs(s.registrations.flags),d=ys(s.commands.handlers,s.registrations.commands),m=bs(c,s.registrations.commands,s.registrations.flags,d),p={hooks:s.hooks,commands:s.commands,parsers:s.parsers,preflight:s.preflight,services:s.services,renderers:s.renderers,registrations:s.registrations,pmRoot:e,settings:r,commandHandlers:c,commandFlagHelp:l,commandDescriptors:m,commandAliases:d,loadWarnings:[...a.warnings],activationWarnings:[...s.warnings],loadedCount:a.loaded.length,loadFailedCount:a.failed.length,activationFailedCount:s.failed.length,contextIntentPackages:a.loaded.map(({name:u,module:f})=>({name:u,module:f}))};return ut={key:i,snapshot:p},p}catch{return ut={key:i,snapshot:null},null}}async function bl(e){let t=Ze(e);if(t.noExtensions){let a=T(process.cwd(),t.path);return await Y(X(a))&&ui((await Ae(a)).warnings),null}let n=T(process.cwd(),t.path),o=await an(n);if(!o)return null;ui(o.settingsReadWarnings);let i={commandPath:E(e),commandArgs:Go(e)};if(!lt(o.discovery,i))return rn(t.profile,o,i),null;let r=await He(n,i);return r?(wl(t,r),{hooks:r.hooks,commands:r.commands,parsers:r.parsers,preflight:r.preflight,services:r.services,renderers:r.renderers,registrations:r.registrations,pmRoot:n}):null}async function vi(e){let t=await He(e);return t?new Map(t.commandDescriptors):A}async function Lp(e,t){return!e.requested||t.noExtensions||De(v,e.commandPathTokens)?A:vi(T(process.cwd(),t.path))}async function Cl(e,t){return(await Hr({pmRoot:t,migrations:e,author:"pm-extension-migration"})).migrations.filter(n=>n.outcome==="failed").map(n=>`extension_migration_failed:${n.layer}:${n.extension}:${n.id}`)}function xl(e,t,n){let o=t.author;return qr(e,ma.forActiveExtensionHost({pmRoot:e,author:o}),o,w(n))}async function kl(e,t,n,o=[]){let i=E(e),r=Hn(e.args.map(String),o),a={...t};delete a.author;let s={...n},c=T(process.cwd(),n.path),l={args:[...r],path:n.path},d=await bt({command:i,args:r,options:a,global:s,pm_root:c});n.profile&&d.warnings.length>0&&b(`profile:extensions parser_warnings=${z(d.warnings)}`),r=d.context.args,a=d.context.options,s=d.context.global,Jn(l,{args:r,path:s.path},a),Ko(A.get(w(i)),r,a,o),Se(void 0),vt({command:i,args:r,options:{...a},global:{...s},pm_root:c});let m=await hn({command:i,args:r,options:a,global:s,pm_root:c,sdk:xl(c,s,i)});if(s.profile&&m.warnings.length>0&&b(`profile:extensions command_handler_warnings=${z(m.warnings)}`),!m.handled)throw m.warnings.length>0?kr(i,m):new R(`Command "${i}" is provided by extensions and is not currently available.`,h.NOT_FOUND);return m.exitCode!==void 0&&(process.exitCode=m.exitCode),Se(m.result),m.result}var tl=Symbol("pm.wrappedActionHandler");function Fp(e,t){let n=e[e.length-1];return n instanceof fi?n:t}function nl(e,t,n){e&&n.length>0&&b(`profile:extensions ${t}=${z(n)}`)}function jp(e){let t=A.get(w(e.commandPath));if(!t||!Bo(e.activeRegistrations,e.commandPath))return;let n=Yt(t).length===0?na(e.commandArgs):Hn(e.commandArgs,e.extensionFlagDefinitions);Vo(t,n)}function Up(e,t,n){e.args=[...n],"_processArguments"in e&&typeof e._processArguments=="function"&&e._processArguments(),t.length>0&&Array.isArray(t[0])&&(t[0]=[...e.processedArgs])}function wi(e,t,n){if(!at(e))return;let o=A.get(w(t))?.read_output_declared===!0;return Xt(n,o)}function El(e){let t=n=>{let o=n;if(Ks(n),typeof o._actionHandler=="function"&&o[tl]!==!0){let i=o._actionHandler;o._actionHandler=async function(...r){let a=Fp(r,n),s=Date.now();Fn(a);let c=Ze(a),l=q(E(a));if(["package inventory","packages inventory","extension inventory"].includes(l))return Ea(l,c.expectHash),await i.apply(this,r);let d=T(process.cwd(),c.path),m=a.args.map(String),p=ce(),u=p?dt(p,l,m):[],f=await yl(l,d),g=wi(a,l,u),y=je(a,m,[...u,...f],g);Js(a,u,l),A.has(w(l))&&delete y.author,g!==void 0&&Bs(y,u,l);let I={args:[...m],path:c.path},x=await bt({command:l,args:m,options:y,global:c,pm_root:d});nl(c.profile,"parser_warnings",x.warnings),m=x.context.args,y=x.context.options,se(a,y),c=x.context.global,Jn(I,{args:m,path:c.path},y),jp({activeRegistrations:p,commandPath:l,commandArgs:m,extensionFlagDefinitions:u}),c=await Jr(c),It(a,c),Up(a,r,m),Ot(a,y),Se(void 0),vt({command:l,args:m,options:{...y},global:{...c},pm_root:d});let S=await hn({command:l,args:m,options:y,global:c,pm_root:d,sdk:xl(d,c,l)});if(nl(c.profile,"command_handler_warnings",S.warnings),S.handled){Se(S.result),kn(S.result,{...c,command:l,commandArgs:m,commandOptions:y,pmRoot:d}),c.profile&&b(`profile:command=${l} took_ms=${Date.now()-s}`);return}return await i.apply(this,r)},o[tl]=!0}for(let i of n.commands)t(i)};t(e)}async function Qt(e){A=new Map,oe({overrides:[]}),e&&await hi(e.rootProgram,e.pmRoot,e.invocationArgv,Mi(),e.settings)}function qp(e,t,n,o){if(t?.flags&&t.flags.length>0){So(e,t.flags);let i=Ao(e,t.flags);i&&e.addHelpText("after",i)}else n&&e.addHelpText("after",n);t&&at(e)&&e.addHelpText("after",To(t)),o&&e.addHelpText("after",o)}function Hp(e,t,n,o){t&&e.addHelpText("after",t),n&&e.addHelpText("after",To(n)),o&&e.addHelpText("after",o)}function Sl(e,t,n){let o={core:0,standard:1,full:2,internal:3},i=(r,a)=>{let s=a.join(" "),c=[...n.entries()].filter(([d])=>d===s||d.startsWith(`${s} `)).map(([,d])=>d),l=c.length===0?"standard":c.reduce((d,m)=>o[m.tier]<o[d]?m.tier:d,"internal");Mt(r,l);for(let d of r.commands)i(d,[...a,d.name()])};for(let r of e.commands)t.has(r.name())||i(r,[r.name()])}async function Al(e,t){let n=P(t),o=T(process.cwd(),n.path);if(n.noExtensions){await Qt({rootProgram:e,pmRoot:o,invocationArgv:t});return}let i=await an(o),r=Fe(t);if(!i){await Qt();return}if(!lt(i.discovery,r)){await Qt({rootProgram:e,pmRoot:o,invocationArgv:t,settings:i.settings}),rn(yi(t),i,r);return}let a=await He(o,r);if(!a){await Qt({rootProgram:e,pmRoot:o,invocationArgv:t,settings:i.settings});return}oe(a.services),A=new Map(a.commandDescriptors),await hi(e,o,t,a.registrations,a.settings);let s=Rs(e,a.commandHandlers,a.commandDescriptors,a.commandAliases,d=>Ts(a.activationWarnings,b,d)),c=new Set(e.commands.map(d=>d.name())),l=d=>{let m=d.split(" ").filter(x=>x.length>0),p=a.commandDescriptors.get(d),u=ne(e,m),f=a.commandFlagHelp.get(d),g=p?Ss(p):null;if(u){qp(u,p,f,g);return}let y=As(e,m);p?.description&&y.description(p.description);let I=f;p&&(Cs(y,p),p.flags.length>0&&(So(y,p.flags),I=Ao(y,p.flags)??void 0)),Hp(y,I,p,g),y.allowUnknownOption(!0).allowExcessArguments(!0).action(async(...x)=>{let S=x[x.length-1],$=S instanceof fi?S:y,gt=Ze($),jl=Date.now(),ln=dt(a.registrations,d,$.args.map(String)),xi=je($,$.args.map(String),ln,wi($,d,ln)),ki=await kl($,xi,gt,ln);await Yr(gt,ki),kn(ki,{...gt,command:d,commandArgs:$.args.map(String),commandOptions:xi,pmRoot:o}),gt.profile&&b(`profile:command=${d} took_ms=${Date.now()-jl}`)})};for(let d of s)l(d);Sl(e,c,a.commandDescriptors)}var qe=Ni(import.meta.url,["../.."])??"0.0.0",v=Ln(qe);async function ol(e){if(!U)return;let t=Reflect.get(e,ll);typeof t=="string"&&await da(t)}async function il(e,t,n){let o=E(e);return["item mutate","item complete"].includes(o)&&e.optsWithGlobals().dryRun===!0?t:n()}async function rl(e,t,n){!U||!await Sn(!0)||(In(e,t,n,{source_context:U.source_context,source_context_source:U.source_context_source}),Er(e),nn=U)}async function sn(e,t,n){let o=nn;if(!o)return;nn=null;let i=!1;try{let r=await L(o.global_pm_root);i=r.telemetry.enabled&&r.telemetry.installation_id===o.installation_id}catch{}await Sn(i)?Ar(e,t,n):Sr()}async function Gp(e){let t=await bl(e);return gn(t?.registrations??null),t}function Rl(e,t){t&&mt(t)||(e.hook("preAction",async(n,o)=>{ke=null,U=null,nn=null,wt(),Fn(o);let i=o.optsWithGlobals(),r=Ze(o),a=q(E(o)),s=o.args.map(String),c={args:[...s],path:r.path},l=je(o,s),d={...r},m=T(process.cwd(),r.path),p=await Gp(o);if(ir(a,{...l,...Xr(a,o.processedArgs),outputInclude:i.outputInclude,outputLimit:i.outputLimit,outputBudget:i.outputBudget,outputFormat:i.outputFormat,outputSession:i.outputSession,outputCursor:i.outputCursor}),Wo(o,a,d,l),await il(o,void 0,()=>Pr(a,d)),!p){ke=Ui({commandName:a,commandArgs:s,commandOptions:l,globalOptions:d,pmRoot:m}),U=await $n({command:a,pm_version:qe,args:s,options:l,global:d,pm_root:m}),await ol(e),await rl(a,s,l),await Do(a,l,m,pi()),await $o(a,s,l,d,m),await Kn({command:o,commandPath:a,commandArgs:s,commandOptions:l,expectHash:r.expectHash,pmRoot:m,globalOptions:d});return}qi(p.hooks),Hi(p.commands),Gi(p.parsers),zi(p.preflight),oe(p.services),Wi(p.renderers),gn(p.registrations);let u=dt(p.registrations,a,s);l=je(o,s,u,wi(o,a,u)),Wo(o,a,d,l);let f=await bt({command:a,args:s,options:l,global:d,pm_root:p.pmRoot});d.profile&&f.warnings.length>0&&b(`profile:extensions parser_warnings=${z(f.warnings)}`),s=f.context.args,l=f.context.options,se(o,l),d=f.context.global;let g={args:[...s],path:d.path};Ot(o,l);let y=await Ki({command:a,args:s,options:l,global:d,pm_root:p.pmRoot,decision:pi()});d.profile&&y.warnings.length>0&&b(`profile:extensions preflight_warnings=${z(y.warnings)}`),s=y.context.args,l=y.context.options,se(o,l),d=y.context.global,Ot(o,l);let I=y.decision;await Do(a,l,p.pmRoot,I),await $o(a,s,l,d,p.pmRoot),await Kn({command:o,commandPath:a,commandArgs:c.args,commandOptions:l,expectHash:r.expectHash,pmRoot:p.pmRoot,rewritten:Vn(c,[g,{args:s,path:d.path}]),globalOptions:{...d,path:r.path,noExtensions:r.noExtensions}});let x=I.run_extension_migrations?await il(o,[],()=>Cl(p.registrations.migrations,p.pmRoot)):[];d.profile&&x.length>0&&b(`profile:extensions migration_warnings=${z(x)}`);let S=js(p.registrations.migrations);ke={hooks:p.hooks,commandName:a,commandArgs:s,commandOptions:{...l},globalOptions:{...d},pmRoot:p.pmRoot,profileEnabled:!!d.profile,migrationBlockers:S},Se(void 0),vt({command:a,args:s,options:{...l},global:{...d},pm_root:p.pmRoot}),U=await $n({command:a,pm_version:qe,args:s,options:l,global:d,pm_root:p.pmRoot}),await ol(e),await rl(a,s,l);let $=await Li(p.hooks,{command:a,args:s,options:{...l},global:{...d},pm_root:p.pmRoot});d.profile&&$.length>0&&b(`profile:extensions hook_warnings=${z($)}`),I.enforce_mandatory_migration_gate&&Us(a,l,S)}),e.hook("postAction",async()=>{let n=si();await sn(n.ok,n.error,{error_code:n.error_code,error_category:n.error_category,exit_code:n.exit_code,command_resolution:n.command_resolution,resolution_stage:n.resolution_stage}),await ft(n),await Re()}))}Rl(v);var al=Symbol("pmCliIdempotentTopLevelRegistration");function Tl(e){let t=e;if(t[al])return;t[al]=!0;let n=e.command.bind(e);e.command=((o,...i)=>{let r=o.split(/\s+/u)[0];return e.commands.some(a=>a.name()===r||a.aliases().includes(r))?new fi(r):n(o,...i)})}async function zp(e,t){if(Tl(e),t.setup){let{registerSetupCommands:n}=await Sp();n(e)}if(t.listQuery){let{registerListQueryCommands:n}=await Ap(),o=typeof t.targetCommandName=="string"&&Jo.has(t.targetCommandName)?new Set([t.targetCommandName]):void 0;n(e,o?{commandFilter:o}:void 0)}if(t.mutation){let{registerMutationCommands:n}=await Rp();n(e,{targetCommandName:t.targetCommandName})}if(t.operation){let{registerOperationCommands:n}=await Tp();n(e)}}function Ue(e){return e.rawInvocationArgv??e.invocationArgv}function Wp(e){return async t=>{let n=ht(t.errorCode),o=Et({ok:!1,errorCode:t.errorCode,errorCategory:n});return await Dr({command:t.command,args:e.invocationArgv,options:t.options,global:e.bootstrapGlobal,pm_version:qe,pm_root:e.bootstrapPmRoot,error_code:t.errorCode,error_message:t.errorMessage,exit_code:t.exitCode,error_category:n,command_resolution:o,resolution_stage:t.resolutionStage}),{errorCategory:n,commandResolution:o}}}async function Ol(e){if(e.bootstrapGlobal.noExtensions||mt(e.invocationArgv))return;let t=Fe(e.invocationArgv),n=await an(e.bootstrapPmRoot);if(n&&lt(n.discovery,t)){let o=await He(e.bootstrapPmRoot,t);Il(o);return}n&&rn(yi(e.invocationArgv),n,t),oe({overrides:[]})}function Il(e){if(!e){oe({overrides:[]});return}oe(e.services)}async function bi(e){await sn(!1,e.errorMessage,{error_code:e.classificationCode,error_category:e.errorCategory,exit_code:e.exitCode,command_resolution:e.commandResolution,resolution_stage:e.resolutionStage}),await ft({ok:!1,error:e.errorMessage,exit_code:e.exitCode,error_code:e.classificationCode,error_category:e.errorCategory,command_resolution:e.commandResolution,resolution_stage:e.resolutionStage})}async function Pl(){await sn(!0,void 0,{exit_code:h.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),await ft({ok:!0,exit_code:h.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),process.exitCode=h.SUCCESS}async function $l(e,t){let n=typeof t=="number"&&Number.isFinite(t);if(!(e.error instanceof R)&&(Tn(e.error)||!n))return!1;let o=K(me(e.error)),i=e.error instanceof R?e.error.exitCode:Rn(t),r=e.error instanceof R||Cr(e.error)?e.error.context:void 0,a=dl(r,e.invocationArgv,o),s=is(o,a),c=et(e.bootstrapGlobal.lean?Ft(go(o,i,a)):go(o,i,a)),l=e.jsonErrors?JSON.stringify(e.bootstrapGlobal.tokenAccounting?Z(c,u=>`${JSON.stringify(u,null,2)}
39
+ `)}function Ms(e,t,n){let o=k(n);if(o!=="create"&&o!=="update")return;let i=rt(e,o);i&&i.addHelpText("after",Gm(o,t,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]="665c29cd-2a3b-5cfc-9690-6d82541fc5d9")}catch{}})();function zm(e,t){return Be(e.id)||`migration-${String(t+1).padStart(3,"0")}`}function Wm(e){return Be(e.status)?.toLowerCase()??"pending"}function Bm(e){return e.mandatory===!0}function Vm(e,t){let n=e.layer.localeCompare(t.layer);if(n!==0)return n;let o=e.name.localeCompare(t.name);return o!==0?o:e.id.localeCompare(t.id)}function js(e){let t=[];return e.forEach((n,o)=>{if(!Bm(n.definition))return;let i=Wm(n.definition);i!=="applied"&&t.push({layer:n.layer,name:n.name,id:zm(n.definition,o),status:i})}),t.sort(Vm),t}function Ls(e){return Array.isArray(e)&&e.length>0}var Km=new Set(["create","beads import","todos import"]),Jm=new Set(["restore","update","close","delete","append","claim","release"]),Ym=new Set(["comments","notes","learnings"]),Xm=new Set(["files","docs","test"]),Zm=new Set(["activate","add","add-field","add-status","add-type","apply","compact","create","deactivate","delete","disable","edit","enable","import","infer","install","materialize","migrate","redact","remove","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type","repair","run","save","set","unset","update","upgrade"]);function Po(e,t){let n=t.force===!0;return Km.has(e)?{isMutation:!0,forceCapable:!1,forceRequested:!1}:Jm.has(e)?{isMutation:!0,forceCapable:!0,forceRequested:n}:Ym.has(e)?{isMutation:typeof t.add=="string",forceCapable:!0,forceRequested:n}:Xm.has(e)?{isMutation:Ls(t.add)||Ls(t.remove),forceCapable:!0,forceRequested:n}:{isMutation:!1,forceCapable:!1,forceRequested:!1}}function Qm(e,t,n){if(Po(e,n).isMutation)return!0;let o=e.trim().toLowerCase();return Or(o)?["close-many","close-task","copy","delete","discover","focus","pause-task","start-task","update-many"].includes(o)?!0:t.some(i=>Zm.has(i.trim().toLowerCase())):!1}function Fs(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function ep(e,t,n){let o=t[0]?.trim().toLowerCase()??"";if(e.trim().toLowerCase()!=="schema"||!["rename-type","rename-field","remap-status"].includes(o))return;let i=[];if(Be(t[1])||i.push("source"),Be(n.to)||i.push("--to"),i.length!==0)throw new R(`Schema migration requires ${i.join(", ")}.`,h.USAGE,{code:"schema_migration_input_required",required:i.join(","),why:"Schema migrations require a source and target. A workspace-bound stable migration id is derived automatically when --migration-id is omitted.",recovery:{recovery_mode:"compact",missing_required_fields:i,suggested_flags:i.filter(r=>r.startsWith("--")),suggested_retry:`pm schema ${o} <source> --to <target>`}})}async function tp(e,t,n,o,i){if(e.trim().toLowerCase()!=="update"||typeof n.status!="string"||Fs(n.status)!==Fs(i.schema.workflow.in_progress_status))return;let r=t[0];if(!r)return;let a=le(i,ce()),s=await kt(o,r,i.id_prefix,i.item_format,a.type_to_folder);if(!s)return;let c=await yr(s,{schema:i.schema}),l=typeof n.assignee=="string"?n.assignee.trim():void 0;(l===void 0?c.document.metadata.assignee?.trim():!["","none","null","undefined"].includes(l.toLowerCase())&&l)||b(`warning:in_progress_item_unclaimed:${s.id}:claim_with=pm claim ${s.id}`)}async function $o(e,t,n,o,i){if(!Qm(e,t,n)||(ep(e,t,n),!await Y(X(i))))return;let r=await Ae(i);ba(o.json===!0)||await tp(e,t,n,i,r.settings);let a=Tr({author:Ct(o.author,r.settings.author_default),payload:{command:e,args:t,options:n},settings:r.settings.mutation_guard,force:o.force===!0||n.force===!0});for(let s of a.warnings)ue(s)}function Us(e,t,n){if(n.length===0)return;let o=Po(e,t);if(!o.isMutation||o.forceCapable&&o.forceRequested)return;let i=n.map(a=>`extension_migration_blocking:${a.layer}:${a.name}:${a.id}:${a.status}`),r=o.forceCapable?"Re-run this command with --force to bypass.":"This command path does not support --force bypass.";throw new R(`Write command "${e}" blocked by unresolved mandatory extension migrations (${i.join(",")}). ${r}`,h.CONFLICT)}async function Do(e,t,n,o){if(!Po(e,t).isMutation||!o.enforce_item_format_gate&&!o.run_preflight_item_format_sync||!await Y(X(n)))return;let{settings:i,metadata:r,warnings:a}=await Ae(n);for(let s of a)ue(s);if(!mr(i)&&(o.enforce_item_format_gate&&!r.has_explicit_item_format&&(dr(i),await pr(n,i,"item_format:auto_select_default")),o.run_preflight_item_format_sync)){let s=le(i,ce());await Ir(n,i.item_format,"item_format:pre_mutation_sync",s.type_to_folder,i.schema)}}(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]="c0826cb1-5181-51b3-9ad9-0cd7a3d2c4b3")}catch{}})();function No(e){let t=[];for(let n of e??[]){if(n.startsWith("-"))break;let o=w(n);o.length!==0&&t.push(o)}return t}function Le(e){let t=w(e.commandPath??"");if(t.length===0)return[];let n=[t],o=t.split(" ").filter(i=>i.length>0);for(let i of No(e.commandArgs))o.push(...i.split(" ").filter(r=>r.length>0)),n.push(o.join(" "));return[...new Set(n.flatMap(i=>[i,q(i)]))]}function Mo(e,t){let n=w(e);if(n.length===0)return!1;let o=Le(t);for(let i of o)if(i===n||i.startsWith(`${n} `))return!0;return t.allowCommandPrefixMatch===!0?o.some(i=>n.startsWith(`${i} `)):!1}function Bt(e){let t=e.activation?.commands;if(t)return t;let n=e.contributions;return n?[...N(n.commands),...N(n.command_handlers),...N(n.command_overrides),...N(n.flag_commands),...N(n.parser_overrides),...qs(n.preflight_ownership),...qs(n.renderer_ownership)]:[]}function N(e){return e??[]}function qs(e){return N(e).flatMap(t=>t.commands)}function st(e){return new Set((e.capabilities??[]).map(t=>t.trim().toLowerCase()))}var Hs=new Set(["hooks","parser","preflight","renderers"]),Gs=new Set(["commands","schema","services","importers"]),np=new Set(["reindex","search","search-advanced"]),op=new Set(["--template"]);function Me(e,t){for(let n of t)if(e.has(n))return!0;return!1}function Lo(e){let t=w(e??"");if(t.length===0)return!1;let[n]=t.split(" ");return np.has(n??t)}function Fo(e,t){for(let n of e.commandArgs??[]){if(!n.startsWith("--"))continue;let[o]=n.split("=",1);if(t.has(o))return!0}return!1}function Vt(e){return w(e.commandPath??"")==="create"&&Fo(e,op)}function jo(e){return e.some(t=>{let n=w(t);return n==="templates"||n.startsWith("templates ")})}function Wt(e,t){return e.some(n=>Mo(n,t))||Vt(t)&&jo(e)}function Uo(e){return[N(e.hooks).length,(e.preflight_overrides??0)-N(e.preflight_ownership).length,N(e.item_types).length,N(e.item_fields).length,N(e.relationship_kinds).length,N(e.service_overrides).length,N(e.assurance_providers).length,N(e.renderer_overrides).length-N(e.renderer_ownership).length].some(t=>t>0)}function qo(e,t){let n=e.activation?.commands??[];if(n.length>0)return Wt(n,t);let o=Bt(e);if(Wt(o,t)||st(e).has("search")&&Lo(t.commandPath))return!0;if(e.contributions)return Uo(e.contributions)}function Kt(e,t){let n=qo(e,t);if(n!==void 0)return n;let o=st(e);return!!(Me(o,Hs)||Me(o,Gs))}function lt(e,t){return e.effective.length===0?!1:ct(t)!=="all"?e.effective.some(n=>Kt(n,t)):e.effective.some(n=>{let o=st(n);return Bt(n).length>0||Me(o,Hs)||Me(o,Gs)||o.has("search")})}function ct(e){if(w(e.commandPath??"").split(" ")[0]==="completion")return"all";let t=Le(e).filter(o=>o.split(" ").every(i=>!i.startsWith("-"))).sort((o,i)=>i.length-o.length)[0]??w(e.commandPath??"");if(t.length===0)return"all";let n=Vt(e)?"--template":"";return`${e.allowCommandPrefixMatch===!0?"prefix":"exact"}:${t}:${n}`}function Ho(e){return ct(e)==="all"?void 0:t=>Kt(t,e)}function Fe(e){let t=O(e);if(t.requested&&t.commandPathTokens.length>0){let[i,...r]=t.commandPathTokens;return{commandPath:i,commandArgs:r,allowCommandPrefixMatch:!0}}let n=F(e),o=n.findIndex(i=>i.trim().length>0&&!i.startsWith("-"));return o<0?{}:{commandPath:n[o],commandArgs:n.slice(o+1),allowCommandPrefixMatch:t.requested}}function Go(e){let t=e.args.map(String);if(w(E(e))==="create"){let n=e.optsWithGlobals();typeof n.template=="string"&&n.template.trim().length>0&&t.push("--template")}return t}(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]="8065373f-1652-563e-9b43-f21c104f0f61")}catch{}})();var Jt=Symbol.for("pm.readOutputInvocationProvenance"),ip=new Map(pe.filter(e=>e.reservation_scope==="root_only").map(e=>[Pt({long:e.flag}),e.flag]));function se(e,t){let n=Reflect.get(e,Jt);n!==void 0&&Reflect.set(t,Jt,n)}function zo(e,t,n){let o=tr(t,n);if(!o)return;let i=e;for(;i.parent;)i=i.parent;let r=i.rawArgs,a=new Set(ee(r.slice(2))),s=er.find(d=>d.command===o),c=Object.values(s?.dimensions??{}).flatMap(d=>d.legacy_aliases.flatMap(m=>a.has(m.flag)?[m.flag]:[])),l=Reflect.get(n,Jt);Reflect.set(n,Jt,{canonical_include_modes:l?.canonical_include_modes??[],explicit_legacy_aliases:c,cli_invocation_observed:!0}),se(n,e)}function rp(e){let t=e.optsWithGlobals(),n=E(e);if(q(n)===n)return t;let o=e.opts();for(let i=e.parent;i?.parent;i=i.parent)for(let r of i.options){let a=r.attributeName(),s=i.getOptionValueSource(a)==="cli";if(s&&!e.options.some(c=>c.long===r.long))throw new R(`Unknown option '${r.long}' for ${n}`,h.USAGE,{code:"unknown_option",flag:r.long,required:`Use options declared by pm ${n} --help.`});if(s&&e.getOptionValueSource(a)!=="cli"){let c=i.getOptionValue(a);e.setOptionValueWithSource(a,c,"cli")}a in o?t[a]=o[a]:delete t[a]}return t}function Wo(e,t,n,o){zo(e,t,o);let i=n.outputInclude;if(i===void 0)return;let{selectors:r,modes:a}=ar(t,i,o);if(t==="get"&&typeof o.fields=="string"&&e.setOptionValueWithSource("fields",o.fields,"cli"),a.length===0)return;se(o,e);let s=rr(t);for(let l of a){let d=s.get(l),m=o[d];e.setOptionValueWithSource(d,m,"cli")}let c=r.length>0?r.join(","):void 0;c===void 0?delete n.outputInclude:n.outputInclude=c;for(let l=e;l;l=l.parent)l.setOptionValueWithSource("outputInclude",c,"cli");It(e,n)}function je(e,t,n=[],o){let i={...rp(e)};se(e,i),delete i.json,delete i.quiet,delete i.path,delete i.pmPath,delete i.noExtensions,delete i.extensions,delete i.profile,delete i.pager,delete i.changedFields,delete i.fullChangedFields,delete i.idOnly,delete i.lean,delete i.tokenAccounting,delete i.outputInclude,delete i.outputLimit,delete i.outputBudget,delete i.outputFormat,delete i.outputSession,delete i.expectHash;let r=ta(t);for(let[a,s]of Object.entries(r))i[a]===void 0&&(i[a]=s);if(n.length>0){let a=Un(n),s=H(E(e)).map(d=>({long:d.flag,short:d.short,aliases:d.aliases})),c={...r};for(let d of a)i[d]!==void 0&&(c[d]=i[d]);qn(c,[...s,...n],E(e),o);let l=ea(i,n,r,E(e));return se(i,l),l}return i}function Bs(e,t,n){let o=Un(t.map(({long:a})=>({long:a}))),i=[...ip].find(([a])=>e[a]!==void 0&&!o.has(a));if(i===void 0)return;let r=i[1];throw new R(`Unknown option '${r}' for extension command '${n}'. ${r} is a root-only pm flag and this command does not declare it.`,h.USAGE,{code:"unknown_option",flag:r,required:`Remove ${r}, or use it on the root command (pm --help ${r}).`,nextSteps:[`Run pm contracts --command ${n} --flags-only --json to list the flags this command accepts.`]})}function dt(e,t,n){let o=Qe(e,t),i=[t],r=[];for(let a of n){if(a.startsWith("-"))break;i.push(a);let s=Qe(e,i.join(" "));s.length>0&&(r=s)}return r.length>0?r:o}function Yt(e){return e.arguments??[]}function zs(e){let t=Yt(e).map(n=>{let o=n.variadic?`${n.name}...`:n.name;return n.required?`<${o}>`:`[${o}]`}).join(" ");return`pm ${e.command}${t?` ${t}`:""}`}function Bo(e,t){if(!e)return!1;let n=w(t);return e.importers.some(o=>w(`${o.importer} import`)===n)||e.exporters.some(o=>w(`${o.exporter} export`)===n)}var Vs=Symbol("pm.commandOptionTokens"),Ws=Symbol("pm.capturesOptionTokens");function Ks(e){if(Reflect.get(e,Ws)===!0)return;Reflect.set(e,Ws,!0);let t=e.parseOptions.bind(e);e.parseOptions=n=>(Reflect.set(e,Vs,[...n]),t(n))}function ap(e){let t=new Map;for(let n of e.options){let o={arity:n.required?"required":n.optional?"optional":"none",key:n.attributeName(),variadic:n.variadic};for(let i of[n.short,n.long])i&&t.set(i,o)}return t}function sp(e){let t=Reflect.get(e,"_passThroughOptions")===!0;return!t&&Reflect.get(e,"_enablePositionalOptions")!==!0?{}:{stop:{atSubcommand:n=>e.commands.some(o=>o.name()===n||o.aliases().includes(n)),atFirstUnrecognized:t}}}function Js(e,t,n){if(t.length===0)return;let o=[];for(let r=e;r?.parent;r=r.parent)o.unshift(r);let i=[];for(let r of o){let a=Reflect.get(r,Vs);if(a===void 0)continue;let s=ap(r),c=[];for(let l=r;l;l=l.parent)c.push(l);i.push({tokens:a,optionOf:l=>s.get(l),includesLooseFlags:r===e,negativeNumbersAreValues:!c.some(l=>l.options.some(d=>d.short!==void 0&&/^-\d$/u.test(d.short))),...sp(r)})}oa(i,t,n)}function Vo(e,t){let n=Yt(e),o=n.filter(s=>s.required).length,i=n.some(s=>s.variadic)?Number.POSITIVE_INFINITY:n.length,r=e.failure_hints??[],a=r.length>0?` ${r.join(" ")}`:"";if(t.length<o)throw new R(`Missing required argument for extension command '${e.command}'. Usage: ${zs(e)}${a}`,h.USAGE);if(t.length>i){let s=t.slice(i).join(" ");throw new R(`Too many arguments for extension command '${e.command}': ${s}. Usage: ${zs(e)}${a}`,h.USAGE)}}function lp(e){return`--${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()}`}function Xt(e,t){return{definitions:e,inheritedFlags:Rt({readOutput:t}).map(n=>n.flag)}}function cp(e,t,n){let o=Object.keys(e).filter(r=>e[r]!==void 0).sort().map(lp);if(o.length===0)return;let{inheritedFlags:i}=Xt([],n);throw new R(`Unknown option '${o.join(", ")}' for extension command '${t}'. This command declares no flags; it accepts only the host flags ${i.join(", ")}.`,h.USAGE,{code:"unknown_option",flag:o[0],required:`Remove ${o.join(", ")}, or ask the package to declare it with api.registerFlags.`,nextSteps:[`Run pm contracts --command ${t} --flags-only --json to list the flags this command accepts.`]})}function dp(e,t,n){let o=e.read_output_declared===!0;if(n.length>0){qn(t,n,e.command,Xt(n,o));return}cp(t,e.command,o)}function Ko(e,t,n,o){e&&(Vo(e,t),dp(e,n,o))}import{Command as Ys}from"commander";(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]="0503f6e5-36d9-5afb-a17f-feef2241f984")}catch{}})();var mp=new Set(["--version","-V"]);function mt(e){let t=F(e);return["package","packages","extension"].includes(t[0]??"")&&t[1]==="inventory"}function Xs(e){if(F(e)[0]!=="item"||!e.includes("--dry-run"))return;let t=new Ys().configureOutput({writeErr:()=>{}}).exitOverride(),n=new Set;for(let i of pe)for(let r of[i.flag,i.short,...i.aliases??[]]){if(r===void 0||n.has(r))continue;n.add(r);let a=i.value_name!==void 0||i.flag==="--pm-path";t.option(`${r}${a?" <value>":""}`)}try{t.parseOptions(e)}catch{}let o=t.opts();return{path:o.pmPath??o.path}}var pp=new Set(["config","extension","init","install","package","packages","templates","upgrade"]),Jo=new Set(["activity","aggregate","context","ctx","events","get","graph","history","list","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","search"]),Zs=new Set(["append","close","close-many","comments","delete","deps","discover","docs","files","history-repair","history-redact","history-compact","learnings","notes","plan","restore","update","update-many","create"]),up=new Set(["claim","close-task","contracts","duplicates","gc","health","pause-task","release","start-task","stats","test","test-all","test-runs","test-runs-worker","validate"]),fp=new Set(["claim","close-task","pause-task","release","start-task","test"]),be={setup:!0,listQuery:!0,mutation:!0,operation:!0},gp=new Set(["create","update","update-many","list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","search","calendar","context","templates"]);function pt(e){return e.some(t=>mp.has(t))}function hp(e,t){if(!M.some(o=>o.canonical_argv[0]===t))return;let n=new Ys().configureOutput({writeErr:()=>{}}).exitOverride();for(let o of Te(t,H(t))){let i=o.takes_value?o.value_required?" <value>":" [value]":"";for(let r of[o.flag,o.short,...o.aliases??[]])r!==void 0&&n.option(`${r}${i}`)}try{let o=n.parseOptions(e.slice(1));if(o.unknown.length>0)return be;let i=B([t,...o.operands])?.alias;if(M.some(r=>r.alias===i))return{...be,targetCommandName:i}}catch{return be}}function Yo(e){if(pt(e))return{setup:!1,listQuery:!1,mutation:!1,operation:!1};if(e.length===0||O(e).requested)return be;let t=k(e);if(!t)return be;let n=t.trim().toLowerCase(),o=F(e),i=B(o)?.alias;return M.some(r=>r.alias===i)?{...be,targetCommandName:i}:hp(o,n==="ctx"?"context":n)||(pp.has(n)?{setup:!0,listQuery:!1,mutation:!1,operation:!1,targetCommandName:n}:Jo.has(n)?{setup:!1,listQuery:!0,mutation:!1,operation:!1,targetCommandName:n}:Zs.has(n)?{setup:!1,listQuery:!1,mutation:!0,operation:!1,targetCommandName:n}:up.has(n)?{setup:!1,listQuery:!1,mutation:!1,operation:!0,targetCommandName:n}:be)}function Xo(e){return e.length===0||O(e).requested||e.includes("--explain")&&k(e)===void 0}function Zo(e,t){return mt(t)||pt(t)?!1:re(t)||O(t).requested?!0:!!k(t)}function Qo(e){if(pt(e))return!1;let t=k(e);return t?gp.has(t):!1}function yp(e){let t=String(e.rawFrom??""),n=t.indexOf("="),o=n>=0?t.slice(0,n):t,i=e.normalizedTokens.map(l=>{let d=l.indexOf("=");return d>=0?l.slice(0,d):l}).find(l=>l==="--literal"||l==="--regex"||l==="--replacement"),r=i?e.argv.map(l=>{let d=l.indexOf("=");return(d>=0?l.slice(0,d):l)===o?d>=0?`${i}${l.slice(d)}`:i:l}):e.argv,a=ze(r),s=i&&n>=0?`${o}=[redacted]`:t,c=i&&e.normalizedDisplay.includes("=")?`${i}=[redacted]`:e.normalizedDisplay;return{argv:a,normalizedDisplay:c,sourceDisplay:s}}function ei(e){let t=e.commandName;if(!t)return;let n=e.trace.find(l=>l.reason==="flag_typo");if(!n)return;let o=Array.isArray(n.to)?n.to:[String(n.to??"")].filter(l=>l.length>0),i=o.length>0?o.join(" "):"the canonical flag",r=Zs.has(t)||fp.has(t),a=r?"mutating_flag_typo_requires_retry":"flag_typo_requires_retry",s=r?"mutating option":"option",c=yp({argv:e.argv,normalizedDisplay:i,normalizedTokens:o,rawFrom:n.from});throw new R(`Refusing to auto-correct ${s} ${c.sourceDisplay} to ${c.normalizedDisplay}. Retry with the canonical flag so the command is explicit.`,h.USAGE,{code:a,examples:[_(c.argv)],nextSteps:["Retry the command with the canonical flag shown in examples."],recovery:{normalized_args:c.argv,suggested_retry:_(c.argv)}})}(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]="6d83c356-db56-5116-9fe7-e0c27973b36f")}catch{}})();var _p=new Set(["success","nonexistent_command","invalid_option","missing_required_option","missing_required_argument","invalid_usage","validation_failed","health_findings","validation_findings","conflict","runtime_failed","unknown_failed"]),vp=new Set(["parse","preflight","execute","unknown"]),wp=new Set(["usage","validation","conflict","runtime","unknown"]);function Ce(e,...t){if(e)for(let n of t){let o=e[n];if(typeof o=="string"){let i=o.trim();if(i.length>0)return i}}}function ti(e,...t){if(e)for(let n of t){let o=e[n];if(typeof o=="boolean")return o}}function Zt(e,...t){if(e)for(let n of t){let o=e[n];if(typeof o=="number"&&Number.isFinite(o))return Math.max(0,Math.trunc(o))}}function ni(e){if(!e)return;let t=e.trim().toLowerCase();if(_p.has(t))return t}function oi(e){if(!e)return;let t=e.trim().toLowerCase();if(vp.has(t))return t}function ii(e){if(!e)return;let t=e.trim().toLowerCase();if(wp.has(t))return t}function ri(e){let t=Ce(e,"error","message");if(t)return t;let n=e?.warnings;if(Array.isArray(n)){let r=n.find(a=>typeof a=="string"&&a.trim().length>0);if(typeof r=="string")return r.trim()}if(ti(e,"fail_on_skipped_triggered","failOnSkippedTriggered"))return"linked_test_fail_on_skipped_triggered";let o=Zt(e,"failed");if(typeof o=="number"&&o>0)return`failed_runs:${o}`;let i=e?.run_results;if(Array.isArray(i)){let r=i.filter(a=>un(a)?.status==="failed").length;if(r>0)return`failed_runs:${r}`}}function ai(e,t){if(!e)return t===h.USAGE?"invalid_command_usage":t===h.NOT_FOUND?"item_not_found":t===h.CONFLICT?"lock_conflict":t===h.DEPENDENCY_FAILED?"dependency_failed":"command_failed"}function si(){let e=un(de()),t=typeof process.exitCode=="number"&&Number.isFinite(process.exitCode)?Math.max(0,Math.trunc(process.exitCode)):void 0,n=Zt(e,"exit_code","exitCode"),o=t??n??h.SUCCESS,i=sa(o),r=Ce(e,"error_code","errorCode")??ai(i,o),a=ii(Ce(e,"error_category","errorCategory"))??(i?void 0:ht(r)),s=i?void 0:ri(e)??`command_exit_${o}`,c=ni(Ce(e,"command_resolution","commandResolution"))??Et({ok:i,errorCode:r,errorCategory:a}),l=oi(Ce(e,"resolution_stage","resolutionStage"))??"execute";return{ok:i,error:s,exit_code:o,error_code:r,error_category:a,command_resolution:c,resolution_stage:l}}(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]="df513d3f-9fef-51e0-b2cb-e43cf27db6ec")}catch{}})();var li="PM_CLI_PACKAGE_ROOT",ll=Symbol("pm.deprecatedAliasInvocation"),tn=new Map;for(let e of J){let t=e.alias.split(" ")[0],n=tn.get(t)??[];n.push(e),tn.set(t,n)}for(let e of tn.values())e.sort((t,n)=>n.alias.split(" ").length-t.alias.split(" ").length);function bp(){return Di(import.meta.url,["../.."])}(typeof process.env[li]!="string"||process.env[li]?.trim().length===0)&&(process.env[li]=bp());var ke=null,U=null,nn=null;function Cp(e){ke=e}function xp(e){A=e}var ut=null,xe=null,A=new Map,gi=250,kp=new Set([h.USAGE,h.NOT_FOUND,h.CONFLICT]),Ep=new Set(["1","true","yes","on"]),Sp=Je(()=>import("./chunks/register-setup-THFZP23A.js")),Ap=Je(()=>import("./chunks/register-list-query-JNJY2D3N.js")),Rp=Je(()=>import("./chunks/register-mutation-WTHZHPOP.js")),Tp=Je(()=>import("./chunks/register-operations-EZP3EG6A.js"));function en(e){return _(e)}function cl(e){let t=e.match(/--[a-zA-Z0-9][a-zA-Z0-9_-]*/g);if(!t||t.length===0)return;let n=[...new Set(t.map(o=>fe(o)??o))];return n.length>0?n:void 0}function Op(e,t,n,o){if(n?.suggested_retry||o===to||o===eo||e.includes("failed in extension handler (")||!/\b(?:missing|required|requires)\b/i.test(e))return;let i=ee(t),r=new Set(i.map(m=>fe(m)??m)),a=cl(e),s=t.find(m=>v.commands.some(p=>p.name()===m)),c=s?v.commands.find(m=>m.name()===s):void 0,l=new Set([...v.options,...c?.options??[]].flatMap(m=>m.flags.split(/[ ,|]+/).map(p=>fe(p)).filter(p=>p!==void 0))),d=a?.filter(m=>{let p=fe(m)??m;return r.has(p)?!1:l.has(p)||xo(t,s,p,A)!==void 0});return d&&d.length>0?d:void 0}function Ip(e,t,n,o){if(o?.suggested_retry)return o.suggested_retry;let i=n?.[0],r=i?fe(i):void 0,a=e.find(p=>v.commands.some(u=>u.name()===p)),s=a?v.commands.find(p=>p.name()===a):void 0,c=r?s?.options.find(p=>p.flags.split(/[ ,|]+/).includes(r)):void 0,l=xo(e,a,r,A),d=r?c?.isBoolean()===!0||l===!1?[r]:[r,"<value>"]:[],m=r?en([...e,...d]):t;return m===t?void 0:m}function Pp(e){if(!e)return{};let t=["recovery_mode","missing_required_fields","suggested_flags","suggested_retry_args","allowed_values","candidate_commands","candidate_commands_total","candidate_commands_truncated","fallback_candidates","next_best_command"],n={};for(let o of t){let i=e[o];i!==void 0&&(o==="allowed_values"||i!==null)&&(n[o]=i)}return n}function $p(e){let t=e.existingRecovery;return{attempted_command:t?.attempted_command??e.attemptedCommand,normalized_args:t?.normalized_args??[...e.invocationArgv],provided_fields:t?.provided_fields??(e.providedFields.length>0?e.providedFields:void 0),missing:t?.missing??e.inferredMissing,...Pp(t),...e.suggestedRetry?{suggested_retry:e.suggestedRetry}:{}}}function Qs(e,t){return{...e,recovery:t}}function Dp(e,t){if(t===void 0)return;let n=Ia(e,t.code,t.field,Ra(e,t.code,t.recovery)),o=Np(e),i=Pa(e,t.code,t.field,n,o),r=Oa(e,t.code,i,o,()=>Lr(T(process.cwd(),P(e).path)));return $a(e,t.code,r,o)}var el=" ";function Np(e){let t=e.map(i=>i===""?el:/^--(?:pm-)?path=$/u.test(i)?`${i}${el}`:i),n=P(t).path;if(n!==void 0&&n.trim()!=="")return[];let o=Ee({});return n!==void 0&&o.length>0?null:o}function dl(e,t,n){let o=ze(t),i=F(o),r=D(i),[a,s]=r===void 0?[]:i.slice(r,r+2),c=o.includes("--explain");e=e===void 0?void 0:vr(e);let l=Dp(o,e),d=l&&(a==="history-redact"||a==="history"&&s==="redact")?{...l,...l.attempted_command?{attempted_command:en(o)}:{},...l.normalized_args?{normalized_args:[...o]}:{},...l.suggested_retry?{suggested_retry:en(o)}:{},...l.suggested_retry_args?{suggested_retry_args:[...o]}:{}}:l;if(d?.recovery_mode==="compact"&&!c)return Qs(e,d);let m=en(o),p=ee(o),u=Op(n,o,d,e?.code),f=Ip(o,m,u,d),g=$p({invocationArgv:o,attemptedCommand:m,providedFields:p,inferredMissing:u,suggestedRetry:f,existingRecovery:d});return Qs(e,g)}async function ft(e){let t=U;U=null,await Da(t,e);let n=ke;if(ke=null,!n){wt();return}let o=[],i=Vi();try{await Na({pmRoot:n.pmRoot,author:n.globalOptions.author,itemIds:e.ok?i?.map(r=>r.id)??[]:[],intent:n.commandName})}catch{o.push("context_usage_feedback_write_failed")}try{o.push(...await Fi(n.hooks,{command:n.commandName,args:n.commandArgs,options:{...n.commandOptions},global:{...n.globalOptions},pm_root:n.pmRoot,ok:e.ok,error:e.error,result:de(),affected:i}))}catch(r){o=[`afterCommand hooks failed: ${r instanceof Error?r.message:String(r)}`]}finally{wt()}!n.globalOptions.json&&o.length>0&&b(`[pm] warning: afterCommand hook_warnings=${z(o)}`),n.profileEnabled&&o.length>0&&b(`profile:extensions hook_warnings=${z(o)}`)}async function ml(e,t){await xr();let n=U,o=ke,i=n?.command??o?.commandName??e,r=n??En(o?.globalOptions??t),a=A.get(w(i))?.source;In(i,o?.commandArgs??[],{...o?.commandOptions,...o?.globalOptions},{source_context:r.source_context,source_context_source:r.source_context_source,pm_version:n?.pm_version??qe,extension:a})}function pl(e){return Ep.has((process.env[e]??"").trim().toLowerCase())}function ul(e){return pl("PM_SENTRY_CAPTURE_EXPECTED_ERRORS")?!0:!kp.has(Math.trunc(e))}async function on(e,t){return ul(e.exit_code)?(await ml(e.command,t),Rr({...e,source_context:e.source_context??En(t).source_context}),!0):!1}async function fl(e){let t=K(me(e.error)),n=ls(t);e.bootstrapGlobal.json?b(JSON.stringify(et(as(t,h.GENERIC_FAILURE)),null,2)):b(t),process.exitCode=h.GENERIC_FAILURE;let o="runtime",i="runtime_failed";try{await ml(e.attemptedCommand,e.bootstrapGlobal),Pn(e.error);let r=await e.emitTelemetryCommandError({command:e.attemptedCommand,errorCode:n.code,errorMessage:n.detail,exitCode:h.GENERIC_FAILURE,options:{bootstrap_global_options:e.bootstrapGlobal},resolutionStage:"execute"});o=r.errorCategory,i=r.commandResolution,await sn(!1,t,{error_code:n.code,error_category:o,exit_code:h.GENERIC_FAILURE,command_resolution:i,resolution_stage:"execute"})}catch(r){e.bootstrapGlobal.json||b(`Failed to report error: ${me(r)}`)}try{await ft({ok:!1,error:t,exit_code:h.GENERIC_FAILURE,error_code:n.code,error_category:o,command_resolution:i,resolution_stage:"execute"})}catch(r){e.bootstrapGlobal.json||b(`Failed to run error hooks: ${me(r)}`)}try{await Re()}catch(r){e.bootstrapGlobal.json||b(`Failed to flush error reporting: ${me(r)}`)}}var Mp={create:"create",update:"update","update-many":"update_many",list:"list","list-all":"list","list-draft":"list","list-open":"list","list-in-progress":"list","list-blocked":"list","list-closed":"list","list-canceled":"list",search:"search",calendar:"calendar",context:"context","templates save":"create"},ci=new Map;function di(e){return e==="number"?"number":e==="boolean"?"boolean":"string"}function gl(e,t){return e.options.some(n=>n.long===t)}function hl(e,t){return e.options.some(n=>n.short===t)}function mi(e,t,n,o){let i=t.trim();if(!i)return;let r=n.length>0?n:`Runtime schema field (${t})`;if(i.startsWith("-")&&!i.startsWith("--")){if(hl(e,i))return;if(o){e.option(`${i} <value>`,`${r} (repeatable)`,jn);return}e.option(`${i} <value>`,r);return}let a=i.startsWith("--")?i:`--${i}`;if(!gl(e,a)){if(o){e.option(`${a} <value>`,`${r} (repeatable)`,jn);return}e.option(`${a} <value>`,r)}}async function yl(e,t){let n=Mp[e];if(!n)return[];let o=`${t}:${n}`,i=ci.get(o);if(i)return i;if(!await Y(X(t)))return ci.set(o,[]),[];let r=await L(t),a=(yn(r.schema).command_to_fields.get(n)??[]).flatMap(s=>[s.cli_flag,...s.cli_aliases].map(c=>({long:`--${c}`,type:di(s.type),value_type:di(s.type)})));return ci.set(o,a),a}async function _l(e,t){let n=P(t),o=T(process.cwd(),n.path);if(!await Y(X(o)))return;let i=xe?.key===_i(o)?xe.snapshot:null,r=i===null?await L(o):i.settings,a=yn(r.schema),s=[{path:"create",command:"create"},{path:"update",command:"update"},{path:"update-many",command:"update_many"},{path:"list",command:"list"},{path:"list-all",command:"list"},{path:"list-draft",command:"list"},{path:"list-open",command:"list"},{path:"list-in-progress",command:"list"},{path:"list-blocked",command:"list"},{path:"list-closed",command:"list"},{path:"list-canceled",command:"list"},{path:"search",command:"search"},{path:"calendar",command:"calendar"},{path:"context",command:"context"},{path:"templates save",command:"create"}];for(let c of s){let l=ne(e,c.path.split(" "));if(l)for(let d of a.command_to_fields.get(c.command)??[]){let m=d.description??"";mi(l,d.cli_flag,m,d.repeatable);for(let p of d.cli_aliases)mi(l,p,`Alias for --${d.cli_flag}`,d.repeatable)}}}async function hi(e,t,n,o,i){let r=k(n);if(!(r!=="create"&&r!=="update"))try{let a=i??await L(t),s=le(a,o);Ms(e,s,n)}catch{}}function pi(){return{enforce_item_format_gate:!0,run_preflight_item_format_sync:!0,run_extension_migrations:!0,enforce_mandatory_migration_gate:!0}}function vl(e,t="all"){return t==="all"?`pm-root:${e}`:`pm-root:${e}:activation:${t}`}function yi(e){return e.some(t=>t==="--profile")}function _i(e){return`pm-root:${e}`}function ui(e){for(let t of e)t.startsWith("settings_read_")&&ue(t,`[pm] warning: ${t} \u2014 settings.json could not be loaded and pm fell back to defaults; run pm health for remediation.`)}function wl(e,t){e.profile&&(b(`profile:extensions loaded=${t.loadedCount} failed=${t.loadFailedCount} warnings=${t.loadWarnings.length} activation_failed=${t.activationFailedCount} hook_counts=before:${t.hooks.beforeCommand.length}|after:${t.hooks.afterCommand.length}|write:${t.hooks.onWrite.length}|read:${t.hooks.onRead.length}|index:${t.hooks.onIndex.length} command_overrides=${t.commands.overrides.length} command_handlers=${t.commands.handlers.length} parser_overrides=${t.parsers.overrides.length} preflight_overrides=${t.preflight.overrides.length} service_overrides=${t.services.overrides.length} renderer_overrides=${t.renderers.overrides.length}`),t.activationWarnings.length>0&&b(`profile:extensions activation_warnings=${z(t.activationWarnings)}`))}function rn(e,t,n){if(!e)return;let o=w(n.commandPath??"")||"<none>";b(`profile:extensions activation=skipped command=${o} effective=${t.discovery.effective.length} warnings=${t.discovery.warnings.length} discovery_ms=${t.discoveryMs}`)}async function an(e,t=Ae){let n=_i(e);if(xe?.key===n)return xe.snapshot;try{let o=Date.now(),{settings:i,warnings:r}=await t(e),a=await ji({pmRoot:e,settings:i,cwd:process.cwd(),noExtensions:!1}),s={pmRoot:e,settings:i,discovery:a,discoveryMs:Date.now()-o,settingsReadWarnings:[...r]};return xe={key:n,snapshot:s},s}catch{return xe={key:n,snapshot:null},null}}async function He(e,t,n=L){let o=t?ct(t):"all",i=vl(e,o);if(ut?.key===i)return ut.snapshot;try{let r=await n(e),a=await Ve({pmRoot:e,settings:r,cwd:process.cwd(),noExtensions:!1,extensionFilter:t?Ho(t):void 0}),s=await Ke({...a,loaded:a.loaded}),c=[...new Set(s.commands.handlers.map(u=>w(u.command)))].filter(u=>u.length>0).sort((u,f)=>u.localeCompare(f)),l=vs(s.registrations.flags),d=ys(s.commands.handlers,s.registrations.commands),m=bs(c,s.registrations.commands,s.registrations.flags,d),p={hooks:s.hooks,commands:s.commands,parsers:s.parsers,preflight:s.preflight,services:s.services,renderers:s.renderers,registrations:s.registrations,pmRoot:e,settings:r,commandHandlers:c,commandFlagHelp:l,commandDescriptors:m,commandAliases:d,loadWarnings:[...a.warnings],activationWarnings:[...s.warnings],loadedCount:a.loaded.length,loadFailedCount:a.failed.length,activationFailedCount:s.failed.length,contextIntentPackages:a.loaded.map(({name:u,module:f})=>({name:u,module:f}))};return ut={key:i,snapshot:p},p}catch{return ut={key:i,snapshot:null},null}}async function bl(e){let t=Ze(e);if(t.noExtensions){let a=T(process.cwd(),t.path);return await Y(X(a))&&ui((await Ae(a)).warnings),null}let n=T(process.cwd(),t.path),o=await an(n);if(!o)return null;ui(o.settingsReadWarnings);let i={commandPath:E(e),commandArgs:Go(e)};if(!lt(o.discovery,i))return rn(t.profile,o,i),null;let r=await He(n,i);return r?(wl(t,r),{hooks:r.hooks,commands:r.commands,parsers:r.parsers,preflight:r.preflight,services:r.services,renderers:r.renderers,registrations:r.registrations,pmRoot:n}):null}async function vi(e){let t=await He(e);return t?new Map(t.commandDescriptors):A}async function Lp(e,t){return!e.requested||t.noExtensions||De(v,e.commandPathTokens)?A:vi(T(process.cwd(),t.path))}async function Cl(e,t){return(await Hr({pmRoot:t,migrations:e,author:"pm-extension-migration"})).migrations.filter(n=>n.outcome==="failed").map(n=>`extension_migration_failed:${n.layer}:${n.extension}:${n.id}`)}function xl(e,t,n){let o=t.author;return qr(e,ma.forActiveExtensionHost({pmRoot:e,author:o}),o,w(n))}async function kl(e,t,n,o=[]){let i=E(e),r=Hn(e.args.map(String),o),a={...t};delete a.author;let s={...n},c=T(process.cwd(),n.path),l={args:[...r],path:n.path},d=await bt({command:i,args:r,options:a,global:s,pm_root:c});n.profile&&d.warnings.length>0&&b(`profile:extensions parser_warnings=${z(d.warnings)}`),r=d.context.args,a=d.context.options,s=d.context.global,Jn(l,{args:r,path:s.path},a),Ko(A.get(w(i)),r,a,o),Se(void 0),vt({command:i,args:r,options:{...a},global:{...s},pm_root:c});let m=await hn({command:i,args:r,options:a,global:s,pm_root:c,sdk:xl(c,s,i)});if(s.profile&&m.warnings.length>0&&b(`profile:extensions command_handler_warnings=${z(m.warnings)}`),!m.handled)throw m.warnings.length>0?kr(i,m):new R(`Command "${i}" is provided by extensions and is not currently available.`,h.NOT_FOUND);return m.exitCode!==void 0&&(process.exitCode=m.exitCode),Se(m.result),m.result}var tl=Symbol("pm.wrappedActionHandler");function Fp(e,t){let n=e[e.length-1];return n instanceof fi?n:t}function nl(e,t,n){e&&n.length>0&&b(`profile:extensions ${t}=${z(n)}`)}function jp(e){let t=A.get(w(e.commandPath));if(!t||!Bo(e.activeRegistrations,e.commandPath))return;let n=Yt(t).length===0?na(e.commandArgs):Hn(e.commandArgs,e.extensionFlagDefinitions);Vo(t,n)}function Up(e,t,n){e.args=[...n],"_processArguments"in e&&typeof e._processArguments=="function"&&e._processArguments(),t.length>0&&Array.isArray(t[0])&&(t[0]=[...e.processedArgs])}function wi(e,t,n){if(!at(e))return;let o=A.get(w(t))?.read_output_declared===!0;return Xt(n,o)}function El(e){let t=n=>{let o=n;if(Ks(n),typeof o._actionHandler=="function"&&o[tl]!==!0){let i=o._actionHandler;o._actionHandler=async function(...r){let a=Fp(r,n),s=Date.now();Fn(a);let c=Ze(a),l=q(E(a));if(["package inventory","packages inventory","extension inventory"].includes(l))return Ea(l,c.expectHash),await i.apply(this,r);let d=T(process.cwd(),c.path),m=a.args.map(String),p=ce(),u=p?dt(p,l,m):[],f=await yl(l,d),g=wi(a,l,u),y=je(a,m,[...u,...f],g);Js(a,u,l),A.has(w(l))&&delete y.author,g!==void 0&&Bs(y,u,l);let I={args:[...m],path:c.path},x=await bt({command:l,args:m,options:y,global:c,pm_root:d});nl(c.profile,"parser_warnings",x.warnings),m=x.context.args,y=x.context.options,se(a,y),c=x.context.global,Jn(I,{args:m,path:c.path},y),jp({activeRegistrations:p,commandPath:l,commandArgs:m,extensionFlagDefinitions:u}),c=await Jr(c),It(a,c),Up(a,r,m),Ot(a,y),Se(void 0),vt({command:l,args:m,options:{...y},global:{...c},pm_root:d});let S=await hn({command:l,args:m,options:y,global:c,pm_root:d,sdk:xl(d,c,l)});if(nl(c.profile,"command_handler_warnings",S.warnings),S.handled){Se(S.result),kn(S.result,{...c,command:l,commandArgs:m,commandOptions:y,pmRoot:d}),c.profile&&b(`profile:command=${l} took_ms=${Date.now()-s}`);return}return await i.apply(this,r)},o[tl]=!0}for(let i of n.commands)t(i)};t(e)}async function Qt(e){A=new Map,oe({overrides:[]}),e&&await hi(e.rootProgram,e.pmRoot,e.invocationArgv,Mi(),e.settings)}function qp(e,t,n,o){if(t?.flags&&t.flags.length>0){So(e,t.flags);let i=Ao(e,t.flags);i&&e.addHelpText("after",i)}else n&&e.addHelpText("after",n);t&&at(e)&&e.addHelpText("after",To(t)),o&&e.addHelpText("after",o)}function Hp(e,t,n,o){t&&e.addHelpText("after",t),n&&e.addHelpText("after",To(n)),o&&e.addHelpText("after",o)}function Sl(e,t,n){let o={core:0,standard:1,full:2,internal:3},i=(r,a)=>{let s=a.join(" "),c=[...n.entries()].filter(([d])=>d===s||d.startsWith(`${s} `)).map(([,d])=>d),l=c.length===0?"standard":c.reduce((d,m)=>o[m.tier]<o[d]?m.tier:d,"internal");Mt(r,l);for(let d of r.commands)i(d,[...a,d.name()])};for(let r of e.commands)t.has(r.name())||i(r,[r.name()])}async function Al(e,t){let n=P(t),o=T(process.cwd(),n.path);if(n.noExtensions){await Qt({rootProgram:e,pmRoot:o,invocationArgv:t});return}let i=await an(o),r=Fe(t);if(!i){await Qt();return}if(!lt(i.discovery,r)){await Qt({rootProgram:e,pmRoot:o,invocationArgv:t,settings:i.settings}),rn(yi(t),i,r);return}let a=await He(o,r);if(!a){await Qt({rootProgram:e,pmRoot:o,invocationArgv:t,settings:i.settings});return}oe(a.services),A=new Map(a.commandDescriptors),await hi(e,o,t,a.registrations,a.settings);let s=Rs(e,a.commandHandlers,a.commandDescriptors,a.commandAliases,d=>Ts(a.activationWarnings,b,d)),c=new Set(e.commands.map(d=>d.name())),l=d=>{let m=d.split(" ").filter(x=>x.length>0),p=a.commandDescriptors.get(d),u=ne(e,m),f=a.commandFlagHelp.get(d),g=p?Ss(p):null;if(u){qp(u,p,f,g);return}let y=As(e,m);p?.description&&y.description(p.description);let I=f;p&&(Cs(y,p),p.flags.length>0&&(So(y,p.flags),I=Ao(y,p.flags)??void 0)),Hp(y,I,p,g),y.allowUnknownOption(!0).allowExcessArguments(!0).action(async(...x)=>{let S=x[x.length-1],$=S instanceof fi?S:y,gt=Ze($),jl=Date.now(),ln=dt(a.registrations,d,$.args.map(String)),xi=je($,$.args.map(String),ln,wi($,d,ln)),ki=await kl($,xi,gt,ln);await Yr(gt,ki),kn(ki,{...gt,command:d,commandArgs:$.args.map(String),commandOptions:xi,pmRoot:o}),gt.profile&&b(`profile:command=${d} took_ms=${Date.now()-jl}`)})};for(let d of s)l(d);Sl(e,c,a.commandDescriptors)}var qe=Ni(import.meta.url,["../.."])??"0.0.0",v=Ln(qe);async function ol(e){if(!U)return;let t=Reflect.get(e,ll);typeof t=="string"&&await da(t)}async function il(e,t,n){let o=E(e);return["item mutate","item complete"].includes(o)&&e.optsWithGlobals().dryRun===!0?t:n()}async function rl(e,t,n){!U||!await Sn(!0)||(In(e,t,n,{source_context:U.source_context,source_context_source:U.source_context_source}),Er(e),nn=U)}async function sn(e,t,n){let o=nn;if(!o)return;nn=null;let i=!1;try{let r=await L(o.global_pm_root);i=r.telemetry.enabled&&r.telemetry.installation_id===o.installation_id}catch{}await Sn(i)?Ar(e,t,n):Sr()}async function Gp(e){let t=await bl(e);return gn(t?.registrations??null),t}function Rl(e,t){t&&mt(t)||(e.hook("preAction",async(n,o)=>{ke=null,U=null,nn=null,wt(),Fn(o);let i=o.optsWithGlobals(),r=Ze(o),a=q(E(o)),s=o.args.map(String),c={args:[...s],path:r.path},l=je(o,s),d={...r},m=T(process.cwd(),r.path),p=await Gp(o);if(ir(a,{...l,...Xr(a,o.processedArgs),outputInclude:i.outputInclude,outputLimit:i.outputLimit,outputBudget:i.outputBudget,outputFormat:i.outputFormat,outputSession:i.outputSession,outputCursor:i.outputCursor}),Wo(o,a,d,l),await il(o,void 0,()=>Pr(a,d)),!p){ke=Ui({commandName:a,commandArgs:s,commandOptions:l,globalOptions:d,pmRoot:m}),U=await $n({command:a,pm_version:qe,args:s,options:l,global:d,pm_root:m}),await ol(e),await rl(a,s,l),await Do(a,l,m,pi()),await $o(a,s,l,d,m),await Kn({command:o,commandPath:a,commandArgs:s,commandOptions:l,expectHash:r.expectHash,pmRoot:m,globalOptions:d});return}qi(p.hooks),Hi(p.commands),Gi(p.parsers),zi(p.preflight),oe(p.services),Wi(p.renderers),gn(p.registrations);let u=dt(p.registrations,a,s);l=je(o,s,u,wi(o,a,u)),Wo(o,a,d,l);let f=await bt({command:a,args:s,options:l,global:d,pm_root:p.pmRoot});d.profile&&f.warnings.length>0&&b(`profile:extensions parser_warnings=${z(f.warnings)}`),s=f.context.args,l=f.context.options,se(o,l),d=f.context.global;let g={args:[...s],path:d.path};Ot(o,l);let y=await Ki({command:a,args:s,options:l,global:d,pm_root:p.pmRoot,decision:pi()});d.profile&&y.warnings.length>0&&b(`profile:extensions preflight_warnings=${z(y.warnings)}`),s=y.context.args,l=y.context.options,se(o,l),d=y.context.global,Ot(o,l);let I=y.decision;await Do(a,l,p.pmRoot,I),await $o(a,s,l,d,p.pmRoot),await Kn({command:o,commandPath:a,commandArgs:c.args,commandOptions:l,expectHash:r.expectHash,pmRoot:p.pmRoot,rewritten:Vn(c,[g,{args:s,path:d.path}]),globalOptions:{...d,path:r.path,noExtensions:r.noExtensions}});let x=I.run_extension_migrations?await il(o,[],()=>Cl(p.registrations.migrations,p.pmRoot)):[];d.profile&&x.length>0&&b(`profile:extensions migration_warnings=${z(x)}`);let S=js(p.registrations.migrations);ke={hooks:p.hooks,commandName:a,commandArgs:s,commandOptions:{...l},globalOptions:{...d},pmRoot:p.pmRoot,profileEnabled:!!d.profile,migrationBlockers:S},Se(void 0),vt({command:a,args:s,options:{...l},global:{...d},pm_root:p.pmRoot}),U=await $n({command:a,pm_version:qe,args:s,options:l,global:d,pm_root:p.pmRoot}),await ol(e),await rl(a,s,l);let $=await Li(p.hooks,{command:a,args:s,options:{...l},global:{...d},pm_root:p.pmRoot});d.profile&&$.length>0&&b(`profile:extensions hook_warnings=${z($)}`),I.enforce_mandatory_migration_gate&&Us(a,l,S)}),e.hook("postAction",async()=>{let n=si();await sn(n.ok,n.error,{error_code:n.error_code,error_category:n.error_category,exit_code:n.exit_code,command_resolution:n.command_resolution,resolution_stage:n.resolution_stage}),await ft(n),await Re()}))}Rl(v);var al=Symbol("pmCliIdempotentTopLevelRegistration");function Tl(e){let t=e;if(t[al])return;t[al]=!0;let n=e.command.bind(e);e.command=((o,...i)=>{let r=o.split(/\s+/u)[0];return e.commands.some(a=>a.name()===r||a.aliases().includes(r))?new fi(r):n(o,...i)})}async function zp(e,t){if(Tl(e),t.setup){let{registerSetupCommands:n}=await Sp();n(e)}if(t.listQuery){let{registerListQueryCommands:n}=await Ap(),o=typeof t.targetCommandName=="string"&&Jo.has(t.targetCommandName)?new Set([t.targetCommandName]):void 0;n(e,o?{commandFilter:o}:void 0)}if(t.mutation){let{registerMutationCommands:n}=await Rp();n(e,{targetCommandName:t.targetCommandName})}if(t.operation){let{registerOperationCommands:n}=await Tp();n(e)}}function Ue(e){return e.rawInvocationArgv??e.invocationArgv}function Wp(e){return async t=>{let n=ht(t.errorCode),o=Et({ok:!1,errorCode:t.errorCode,errorCategory:n});return await Dr({command:t.command,args:e.invocationArgv,options:t.options,global:e.bootstrapGlobal,pm_version:qe,pm_root:e.bootstrapPmRoot,error_code:t.errorCode,error_message:t.errorMessage,exit_code:t.exitCode,error_category:n,command_resolution:o,resolution_stage:t.resolutionStage}),{errorCategory:n,commandResolution:o}}}async function Ol(e){if(e.bootstrapGlobal.noExtensions||mt(e.invocationArgv))return;let t=Fe(e.invocationArgv),n=await an(e.bootstrapPmRoot);if(n&&lt(n.discovery,t)){let o=await He(e.bootstrapPmRoot,t);Il(o);return}n&&rn(yi(e.invocationArgv),n,t),oe({overrides:[]})}function Il(e){if(!e){oe({overrides:[]});return}oe(e.services)}async function bi(e){await sn(!1,e.errorMessage,{error_code:e.classificationCode,error_category:e.errorCategory,exit_code:e.exitCode,command_resolution:e.commandResolution,resolution_stage:e.resolutionStage}),await ft({ok:!1,error:e.errorMessage,exit_code:e.exitCode,error_code:e.classificationCode,error_category:e.errorCategory,command_resolution:e.commandResolution,resolution_stage:e.resolutionStage})}async function Pl(){await sn(!0,void 0,{exit_code:h.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),await ft({ok:!0,exit_code:h.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),process.exitCode=h.SUCCESS}async function $l(e,t){let n=typeof t=="number"&&Number.isFinite(t);if(!(e.error instanceof R)&&(Tn(e.error)||!n))return!1;let o=K(me(e.error)),i=e.error instanceof R?e.error.exitCode:Rn(t),r=e.error instanceof R||Cr(e.error)?e.error.context:void 0,a=dl(r,e.invocationArgv,o),s=is(o,a),c=et(e.bootstrapGlobal.lean?Ft(go(o,i,a)):go(o,i,a)),l=e.jsonErrors?JSON.stringify(e.bootstrapGlobal.tokenAccounting?Z(c,u=>`${JSON.stringify(u,null,2)}
40
40
  `):c,null,2):ns(o,a,{lean:e.bootstrapGlobal.lean===!0});e.jsonErrors?ie(`${l}
41
41
  `):b(l);let{errorCategory:d,commandResolution:m}=await e.emitTelemetryCommandError({command:e.attemptedCommand,errorCode:s.code,errorMessage:s.detail,exitCode:i,options:{bootstrap_global_options:e.bootstrapGlobal},resolutionStage:"execute"}),p=await on({command:e.attemptedCommand,error_code:s.code,error_category:d,exit_code:i,error_message:s.detail,command_resolution:m,resolution_stage:"execute",source_context:U?.source_context},e.bootstrapGlobal);return await bi({errorMessage:o,exitCode:i,classificationCode:s.code,errorCategory:d,commandResolution:m,resolutionStage:"execute"}),p&&(Pn(On(e.error,o)),await Re(gi)),process.exitCode=i,!0}async function Dl(e,t){let n=O(e.invocationArgv).commandPathTokens.join(" ")||_o(e.invocationArgv),o=q(n),i=`unknown command '${n}'`,r=T(process.cwd(),e.bootstrapGlobal.path),a=e.bootstrapGlobal.noExtensions?A:await vi(r),s=Fe(e.invocationArgv),c=e.bootstrapGlobal.noExtensions?[]:await Io(r,{},Le(s)),l=await it({message:i},v,a,{failedExtensions:c},Ue(e)),d=ho(l.message,l.commandName,l.allowedTypes,{unknownCommandExamples:l.unknownCommandExamples,unknownCommandNextSteps:l.unknownCommandNextSteps,attemptedCommand:l.attemptedCommand,normalizedInvocationArgs:l.normalizedInvocationArgs,providedOptionFlags:l.providedOptionFlags,unknownOptionSuggestions:l.unknownOptionSuggestions,suggestedRetryCommand:l.suggestedRetryCommand,failedExtensions:c}),{errorCategory:m,commandResolution:p}=await e.emitTelemetryCommandError({command:o,errorCode:d.code,errorMessage:d.detail,exitCode:h.USAGE,options:{bootstrap_global_options:e.bootstrapGlobal,commander_code:t??"commander.helpDisplayed"},resolutionStage:"parse"}),u=await on({command:o,error_code:d.code,error_category:m,exit_code:h.USAGE,error_message:d.detail,command_resolution:p,resolution_stage:"parse"},e.bootstrapGlobal),f=e.jsonErrors?await Co({message:i},v,a,e.bootstrapGlobal.lean===!0,{failedExtensions:c},Ue(e)):await bo({message:i},v,a,{failedExtensions:c},Ue(e)),g=yo(f,e.jsonErrors,c);await bi({errorMessage:i,exitCode:h.USAGE,classificationCode:d.code,errorCategory:m,commandResolution:p,resolutionStage:"parse"}),e.jsonErrors?ie(`${Wn(g)}
42
42
  `):b(g),u&&await Re(gi),process.exitCode=h.USAGE}async function Nl(e,t,n){if(!(t==="commander.helpDisplayed"||t==="commander.help"||t==="commander.helpCommand")&&!n.includes("(outputHelp)"))return!1;let o=O(e.invocationArgv);return o.requested&&!De(v,o.commandPathTokens)?(await Dl(e,t),!0):(await Pl(),!0)}async function Ml(e,t){let n=await it(e.error,v,A,{},Ue(e)),o=ho(n.message,n.commandName,n.allowedTypes,{unknownCommandExamples:n.unknownCommandExamples,unknownCommandNextSteps:n.unknownCommandNextSteps,attemptedCommand:n.attemptedCommand,normalizedInvocationArgs:n.normalizedInvocationArgs,providedOptionFlags:n.providedOptionFlags,unknownOptionSuggestions:n.unknownOptionSuggestions,suggestedRetryCommand:n.suggestedRetryCommand}),{errorCategory:i,commandResolution:r}=await e.emitTelemetryCommandError({command:e.attemptedCommand,errorCode:o.code,errorMessage:o.detail,exitCode:h.USAGE,options:{bootstrap_global_options:e.bootstrapGlobal,commander_code:t},resolutionStage:"parse"}),a=await on({command:e.attemptedCommand,error_code:o.code,error_category:i,exit_code:h.USAGE,error_message:o.detail,command_resolution:r,resolution_stage:"parse",source_context:U?.source_context},e.bootstrapGlobal),s=e.jsonErrors?await Co(e.error,v,A,e.bootstrapGlobal.lean===!0,{},Ue(e)):await bo(e.error,v,A,{},Ue(e)),c=await Os(o.code,e.bootstrapPmRoot,{},Le(Fe(e.invocationArgv))),l=yo(s,e.jsonErrors,c);await bi({errorMessage:n.message,exitCode:h.USAGE,classificationCode:o.code,errorCategory:i,commandResolution:r,resolutionStage:"parse"}),e.jsonErrors?ie(`${Wn(l)}
@@ -1,2 +1,2 @@
1
- import{A as Z,C as ee,a as Fe,b as Ae,c as Re,d as Te,e as Me,f as Be,g as Ne,h as De,i as L,j as $,k as j,l as K,m as H,p as U,q,w as G,x as Y,y as X,z as J}from"./focused-chunks/chunk-GB2N4OM7.js";import{a as M,b as B,c as N,d as D,u as Q}from"./focused-chunks/chunk-LAIN47EJ.js";import"./focused-chunks/chunk-IPIFI4NT.js";import"./focused-chunks/chunk-KN7RBRRH.js";import"./focused-chunks/chunk-GAXO2UQX.js";import{a as g}from"./focused-chunks/chunk-NY65XTX7.js";import"./focused-chunks/chunk-HIKZYZ26.js";import"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{Db as R,Eb as T,K as x,L as k,M as C,N as I,O as A,P as w,b as y,c as E,dc as V,f as m,fc as z,gc as W}from"./focused-chunks/chunk-MK7UQEE5.js";import{b as Se,c as Pe,d as be}from"./focused-chunks/chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="52f6eff3-e226-56d9-893a-f16997d11c50")}catch{}})();function qe(e){return e}function Ve(e){return e}function re(e,o){for(let r of o.commands??[])e.registerCommand(r);for(let[r,t]of Object.entries(o.commandOverrides??{}))e.registerCommand(r,t);for(let[r,t]of Object.entries(o.flags??{}))e.registerFlags(r,t);for(let[r,t]of Object.entries(o.parsers??{}))e.registerParser(r,t);for(let[r,t]of Object.entries(o.renderers??{}))if(typeof t=="function")e.registerRenderer(r,t);else{let{run:i,...s}=t;e.registerRenderer(r,i,s)}for(let[r,t]of Object.entries(o.services??{}))e.registerService(r,t)}function oe(e,o){for(let s of o.preflights??[])e.registerPreflight(s);let r=o.itemTypes??[];r.length>0&&e.registerItemTypes(r);let t=o.itemFields??[];t.length>0&&e.registerItemFields(t);let i=o.relationshipKinds??[];i.length>0&&e.registerRelationshipKinds(i);for(let s of o.migrations??[])e.registerMigration(s);for(let s of o.profiles??[])e.registerProfile(s)}function te(e,o){for(let r of o.searchProviders??[])e.registerSearchProvider(r);for(let r of o.vectorStoreAdapters??[])e.registerVectorStoreAdapter(r);for(let r of o.assuranceProviders??[])e.registerAssuranceMeasurementProvider(r);for(let r of o.importers??[])e.registerImporter(r.name,r.importer,r.options);for(let r of o.exporters??[])e.registerExporter(r.name,r.exporter,r.options)}function ne(e,o){for(let r of o.beforeCommand??[])e.hooks.beforeCommand(r);for(let r of o.beforeMutation??[])e.hooks.beforeMutation(r);for(let r of o.afterCommand??[])e.hooks.afterCommand(r);for(let r of o.onWrite??[])e.hooks.onWrite(r);for(let r of o.onRead??[])e.hooks.onRead(r);for(let r of o.onIndex??[])e.hooks.onIndex(r)}function ie(e){let o={activate:async r=>{re(r,e),oe(r,e),te(r,e),ne(r,e.hooks??{}),await e.activate?.(r)}};return e.manifest&&(o.manifest=e.manifest),e.deactivate&&(o.deactivate=e.deactivate),o}function d(e){let o=e.flatMap(r=>r??[]);return o.length>0?o:void 0}function p(e){let o=Object.assign({},...e.map(r=>r??{}));return Object.keys(o).length>0?o:void 0}function se(e){let o={};for(let r of e)for(let[t,i]of Object.entries(r??{}))o[t]=[...o[t]??[],...i];return Object.keys(o).length>0?o:void 0}var ae=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function ce(e,o,r){let t=o.map(s=>s?.[r]),i=d(t);if(i!==void 0){let s=e;s[r]=i}}function me(e){let o={};for(let r of ae)ce(o,e,r);return Object.keys(o).length>0?o:void 0}function ze(...e){let o={},r=(n,c)=>{c!==void 0&&(o[n]=c)};r("commands",d(e.map(n=>n.commands))),r("commandOverrides",p(e.map(n=>n.commandOverrides))),r("flags",se(e.map(n=>n.flags))),r("parsers",p(e.map(n=>n.parsers))),r("renderers",p(e.map(n=>n.renderers))),r("services",p(e.map(n=>n.services))),r("preflights",d(e.map(n=>n.preflights))),r("itemTypes",d(e.map(n=>n.itemTypes))),r("itemFields",d(e.map(n=>n.itemFields))),r("relationshipKinds",d(e.map(n=>n.relationshipKinds))),r("migrations",d(e.map(n=>n.migrations))),r("profiles",d(e.map(n=>n.profiles))),r("searchProviders",d(e.map(n=>n.searchProviders))),r("vectorStoreAdapters",d(e.map(n=>n.vectorStoreAdapters))),r("assuranceProviders",d(e.map(n=>n.assuranceProviders))),r("importers",d(e.map(n=>n.importers))),r("exporters",d(e.map(n=>n.exporters))),r("hooks",me(e.map(n=>n.hooks)));let t;for(let n of e)n.manifest&&(t=n.manifest);r("manifest",t);let i=e.some(n=>n.activate);r("activate",i?async n=>{for(let c of e)c.activate&&await c.activate(n)}:void 0);let s=e.some(n=>n.deactivate);return r("deactivate",s?async()=>{let n=[];for(let c of[...e].reverse())if(c.deactivate)try{await c.deactivate()}catch(f){n.push(f)}if(n.length>0)throw n.length>1?new AggregateError(n,"Multiple extension blueprint deactivate hooks failed."):n[0]}:void 0),o}var de=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function u(e){return e?Array.isArray(e)?e.length>0:Object.keys(e).length>0:!1}function h(e){let o=new Set;for(let[i,s]of de)u(e[i])&&o.add(s);(e.commands??[]).filter(l).some(i=>i.flags!==void 0)&&o.add("schema");let r=[...e.importers??[],...e.exporters??[]].filter(l);r.some(i=>i?.options?.flags!==void 0)&&o.add("schema"),r.some(i=>typeof i=="object")&&o.add("commands");let t=e.hooks??{};return[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some(u)&&o.add("hooks"),[...o].sort((i,s)=>i.localeCompare(s))}var fe=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function a(e){return[...new Set(e)].sort((o,r)=>o.localeCompare(r))}function l(e){return e!=null}function v(e){return m(`${e.name} import`)}function _(e){return m(`${e.name} export`)}function le(e,o,r){return[...e.map(t=>m(t.name)),...o.filter(t=>t.options!==void 0).map(v),...r.filter(t=>t.options!==void 0).map(_)]}function pe(e,o,r,t){return[...Object.keys(e.flags??{}).map(i=>m(i)),...o.filter(i=>i.flags!==void 0).map(i=>m(i.name)),...r.filter(i=>i.options?.flags!==void 0).map(v),...t.filter(i=>i.options?.flags!==void 0).map(_)]}function ue(e){return fe.filter(([o])=>(e[o]?.length??0)>0).map(([,o])=>o)}function ge(e){let o=Object.entries(e??{}).filter(([,r])=>typeof r!="function"&&((r.commands?.length??0)>0||r.resultDiscriminator!==void 0)).map(([r,t])=>{let i=t;return{format:r,commands:a((i.commands??[]).map(s=>m(s))),result_discriminator:i.resultDiscriminator!==void 0}}).sort((r,t)=>r.format.localeCompare(t.format));return o.length>0?{renderer_ownership:o}:{}}function he(e){return!e||e.length===0?{}:{assurance_providers:a(e.map(o=>o.id))}}function ve(e,o,r){return{item_types:a((e.itemTypes??[]).map(t=>t.name)),item_fields:a((e.itemFields??[]).map(t=>t.name)),...(e.relationshipKinds?.length??0)>0?{relationship_kinds:a(e.relationshipKinds.map(t=>t.kind))}:{},migrations:a((e.migrations??[]).flatMap(t=>typeof t.id=="string"?[t.id]:[])),profiles:a((e.profiles??[]).map(t=>t.name)),importers:a(o.map(t=>m(t.name))),exporters:a(r.map(t=>m(t.name))),search_providers:a((e.searchProviders??[]).map(t=>t.name)),vector_store_adapters:a((e.vectorStoreAdapters??[]).map(t=>t.name)),...he(e.assuranceProviders),parser_overrides:a(Object.keys(e.parsers??{}).map(t=>m(t))),service_overrides:a(Object.keys(e.services??{}).map(t=>String(t).trim().toLowerCase())),renderer_overrides:a(Object.keys(e.renderers??{}).map(t=>String(t).trim().toLowerCase())),...ge(e.renderers),preflight_overrides:(e.preflights??[]).length,preflight_ownership:(e.preflights??[]).map(t=>({commands:[...t.commands??[]]}))}}function We(e){let o=(e.commands??[]).filter(l),r=(e.importers??[]).filter(l),t=(e.exporters??[]).filter(l),i=r.map(v),s=t.map(_),n=le(o,r,t),c=pe(e,o,r,t),f=e.hooks??{},b=ve(e,r,t);return{capabilities:h(e),commands:a(n),command_overrides:a(Object.keys(e.commandOverrides??{}).map(F=>m(F))),command_handlers:a([...n,...i,...s]),hooks:ue(f),flag_commands:a(c),...b}}var _e=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function ye(e){return(e.itemFields??[]).filter(o=>typeof o?.name=="string"&&g.has(o.name.trim())).map(o=>({code:"reserved_item_field",severity:"error",message:`Item field "${o.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:o.name}))}function Ee(e){return[...Object.values(e.flags??{}).flat(),...(e.commands??[]).flatMap(o=>o.flags??[]),...(e.importers??[]).flatMap(o=>o.options?.flags??[]),...(e.exporters??[]).flatMap(o=>o.options?.flags??[])].flatMap(o=>{if(typeof o?.long!="string"&&typeof o?.short!="string")return[];let r=x(o.long,o.short);if(r===null)return[];let{token:t,failure:i}=r;return[{code:i,severity:"error",message:`Flag "${t}" ${k(t,i)}.`,field:t}]})}function S(e){let o=new Set;for(let r of e){let t=E(r)??y(r);t!==null&&o.add(t)}return[...o].sort((r,t)=>r.localeCompare(t))}function xe(e,o){let r=[];if(o===null)return e.length>0&&r.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${e.length===1?"capability":"capabilities"} [${e.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),r;let t=new Set(o),i=new Set(e);for(let s of e)t.has(s)||r.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${s}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${s}" to the manifest capabilities.`,capability:s});for(let s of o)i.has(s)||r.push({code:"capability_unused",severity:"warning",message:`Capability "${s}" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,capability:s});return r}function ke(e){let o=[],r=new Map;for(let i of e.commands??[]){let s=m(i.name);r.set(s,(r.get(s)??0)+1)}for(let[i,s]of r)s>1&&o.push({code:"duplicate_command",severity:"warning",message:`Command "${i}" is declared ${s} times in commands; the later registration shadows the earlier one at dispatch.`,command:i});let t=new Set(Object.keys(e.commandOverrides??{}).map(i=>m(i)));for(let i of r.keys())t.has(i)&&o.push({code:"command_override_conflict",severity:"warning",message:`Command "${i}" is declared both as a new command definition and as a command override; register one or the other.`,command:i});return o}function Ce(e){let o=[];for(let r of _e)r in e&&!u(e[r])&&o.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${r}" is present but empty; remove it or populate it.`,field:r});if("hooks"in e){let r=e.hooks??{};[r.beforeCommand,r.beforeMutation,r.afterCommand,r.onWrite,r.onRead,r.onIndex].some(u)||o.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return o}function Ie(e,o={}){let r=h(e),t=o.declaredCapabilities??e.manifest?.capabilities,i=Array.isArray(t)?S(t):null,s=[...xe(r,i),...ke(e),...Ee(e),...ye(e),...Ce(e)];return{ok:s.every(n=>n.severity!=="error"),findings:s,used:r,declared:i}}function P(e,o){let{additionalCapabilities:r,...t}=o,i=Array.isArray(r)?S(r):[],s=[...new Set([...h(e),...i])].sort((n,c)=>n.localeCompare(c));return{...t,capabilities:s}}function Ge(e,o){let r=P(e,o);return{module:ie({...e,manifest:r}),manifest:r}}function O(e,o){if(e.status==="absent"||e.status==="ok")return null;let r=`${e.kind}_${e.status}`,t="";switch(r){case"pm_min_version_invalid":t=`pm_min_version "${e.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":t=`pm_min_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_min_version_unmet":t=`Requires pm >= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_invalid":t=`pm_max_version "${e.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":t=`pm_max_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_max_version_exceeded":t=`Allows pm <= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":t=`Target pm ${o} is newer than pm_max_version ${e.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:r,severity:e.allowed?"warning":"error",constraint:e.kind,required:e.required,current:o,message:t}}function we(e,o){let r=C(e.pm_min_version,o.pmVersion),t=I(e.pm_max_version,o.pmVersion,o.pmMaxVersionExceededMode??"block"),i=w(e).findings.map(f=>({code:f.code,severity:"warning",constraint:"manifest",required:f.code==="manifest_unknown_key"?f.path:"pm_min_version",current:o.pmVersion,path:f.path,...f.suggested_key?{suggested_key:f.suggested_key}:{},message:f.message})),s=[],n=O(r,o.pmVersion);n!==null&&s.push(n);let c=O(t,o.pmVersion);return c!==null&&s.push(c),{compatible:r.allowed&&t.allowed,findings:[...i,...s],pmVersion:o.pmVersion}}var Oe=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function Ye(e,o={}){let r=Ie(e,{declaredCapabilities:o.declaredCapabilities}),t=o.identity?P(e,o.identity):null,i=o.target?we(t??e.manifest??{},o.target):null,s=[...(t!==null&&o.declaredCapabilities===void 0?r.findings.filter(n=>!Oe.has(n.code)):r.findings).map(n=>({source:"blueprint",severity:n.severity,code:n.code,message:n.message})),...(i?.findings??[]).map(n=>({source:"compatibility",severity:n.severity,code:n.code,message:n.message}))];return{ok:s.every(n=>n.severity!=="error"),capabilities:r.used,blueprint:r,manifest:t,compatibility:i,findings:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="3f3a5dca-8370-52d7-b279-dc6f9f0aeadf")}catch{}})();function Je(e){return e}function Qe(e){return e}function Ze(e){return e}function er(e){return e}function rr(e){return e}function or(e){return e}function tr(e){return e}function nr(e){return e}function ir(e){return e}function sr(e){return e}function ar(e){return e}function cr(e){return e}function mr(e){return e}function dr(e){return{handled:!0,result:e}}function fr(){return{handled:!1}}function lr(e){return e}function pr(e){return e}function ur(e){return e}function gr(e){return e}function hr(e){return e}function vr(e){return e}function _r(e){return e}function yr(e){return e}function Er(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c96e4de9-16ef-581a-aa4b-6450917c2c65")}catch{}})();export{$ as BUILTIN_PROFILES,Fe as EXTENSION_CAPABILITIES,be as EXTENSION_CAPABILITY_CONTRACT,Se as EXTENSION_CAPABILITY_CONTRACT_VERSION,Pe as EXTENSION_CAPABILITY_LEGACY_ALIASES,V as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ae as EXTENSION_POLICY_MODES,Re as EXTENSION_POLICY_SURFACES,Me as EXTENSION_SANDBOX_PROFILES,Te as EXTENSION_TRUST_MODES,Ne as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,B as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,M as PM_PACKAGE_RESOURCE_KINDS,Y as PROFILE_LINT_CODES,G as PROFILE_LINT_DIMENSIONS,L as PROFILE_NAMES,g as RESERVED_ITEM_FIELD_NAMES,De as SEARCH_EXTENSION_FLAG_DEFINITIONS,we as checkExtensionManifestCompatibility,D as collectPackageExtensionDirectories,z as collectUsedExtensionCapabilities,ie as composeExtension,Ge as composeExtensionPackage,T as createExtensionContributionInventory,fr as declineServiceOverride,vr as defineAfterCommandHook,gr as defineBeforeCommandHook,hr as defineBeforeMutationHook,Ze as defineCommand,sr as defineCommandOverride,ur as defineExporter,qe as defineExtension,Ve as defineExtensionBlueprint,Je as defineExtensionManifest,er as defineFlag,pr as defineImporter,or as defineItemField,rr as defineItemType,tr as defineMigration,Er as defineOnIndexHook,yr as defineOnReadHook,_r as defineOnWriteHook,ar as defineParserOverride,cr as definePreflightOverride,Qe as defineProjectProfile,lr as defineRendererOverride,nr as defineSearchProvider,mr as defineServiceOverride,ir as defineVectorStoreAdapter,h as deriveExtensionCapabilities,We as describeExtensionBlueprint,U as describeProfileComposition,q as describeProjectProfile,dr as handleServiceOverride,A as inspectExtensionManifestSchema,Ie as lintExtensionBlueprint,w as lintExtensionManifestSchema,X as lintProjectProfile,H as listProfiles,ze as mergeExtensionBlueprints,ee as normalizeDirectExtensionCommandOptions,R as normalizeExtensionContributionInventory,j as normalizeProfileName,J as planProfileApplication,Ye as preflightExtension,N as readPmPackageManifest,W as reconcileExtensionCapabilityUsage,Q as renderExtensionSurfaceMarkdown,Z as resolveExtensionFlagOptionKey,K as resolveProfile,P as synthesizeExtensionManifest,Be as toExtensionFlagDefinitions};
1
+ import{A as Z,C as ee,a as Fe,b as Ae,c as Re,d as Te,e as Me,f as Be,g as Ne,h as De,i as L,j as $,k as j,l as K,m as H,p as U,q,w as G,x as Y,y as X,z as J}from"./focused-chunks/chunk-RIMNSVFA.js";import{a as M,b as B,c as N,d as D,u as Q}from"./focused-chunks/chunk-VGFKTSGY.js";import"./focused-chunks/chunk-FNIX62V6.js";import"./focused-chunks/chunk-J3LQQP3N.js";import"./focused-chunks/chunk-ZOGEQFGH.js";import{a as g}from"./focused-chunks/chunk-VTOTZ5UC.js";import"./focused-chunks/chunk-VGUQ4V47.js";import"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{Db as R,Eb as T,K as x,L as k,M as C,N as I,O as A,P as w,b as y,c as E,dc as V,f as m,fc as z,gc as W}from"./focused-chunks/chunk-5NTLNE54.js";import{b as Se,c as Pe,d as be}from"./focused-chunks/chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="52f6eff3-e226-56d9-893a-f16997d11c50")}catch{}})();function qe(e){return e}function Ve(e){return e}function re(e,o){for(let r of o.commands??[])e.registerCommand(r);for(let[r,t]of Object.entries(o.commandOverrides??{}))e.registerCommand(r,t);for(let[r,t]of Object.entries(o.flags??{}))e.registerFlags(r,t);for(let[r,t]of Object.entries(o.parsers??{}))e.registerParser(r,t);for(let[r,t]of Object.entries(o.renderers??{}))if(typeof t=="function")e.registerRenderer(r,t);else{let{run:i,...s}=t;e.registerRenderer(r,i,s)}for(let[r,t]of Object.entries(o.services??{}))e.registerService(r,t)}function oe(e,o){for(let s of o.preflights??[])e.registerPreflight(s);let r=o.itemTypes??[];r.length>0&&e.registerItemTypes(r);let t=o.itemFields??[];t.length>0&&e.registerItemFields(t);let i=o.relationshipKinds??[];i.length>0&&e.registerRelationshipKinds(i);for(let s of o.migrations??[])e.registerMigration(s);for(let s of o.profiles??[])e.registerProfile(s)}function te(e,o){for(let r of o.searchProviders??[])e.registerSearchProvider(r);for(let r of o.vectorStoreAdapters??[])e.registerVectorStoreAdapter(r);for(let r of o.assuranceProviders??[])e.registerAssuranceMeasurementProvider(r);for(let r of o.importers??[])e.registerImporter(r.name,r.importer,r.options);for(let r of o.exporters??[])e.registerExporter(r.name,r.exporter,r.options)}function ne(e,o){for(let r of o.beforeCommand??[])e.hooks.beforeCommand(r);for(let r of o.beforeMutation??[])e.hooks.beforeMutation(r);for(let r of o.afterCommand??[])e.hooks.afterCommand(r);for(let r of o.onWrite??[])e.hooks.onWrite(r);for(let r of o.onRead??[])e.hooks.onRead(r);for(let r of o.onIndex??[])e.hooks.onIndex(r)}function ie(e){let o={activate:async r=>{re(r,e),oe(r,e),te(r,e),ne(r,e.hooks??{}),await e.activate?.(r)}};return e.manifest&&(o.manifest=e.manifest),e.deactivate&&(o.deactivate=e.deactivate),o}function d(e){let o=e.flatMap(r=>r??[]);return o.length>0?o:void 0}function p(e){let o=Object.assign({},...e.map(r=>r??{}));return Object.keys(o).length>0?o:void 0}function se(e){let o={};for(let r of e)for(let[t,i]of Object.entries(r??{}))o[t]=[...o[t]??[],...i];return Object.keys(o).length>0?o:void 0}var ae=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function ce(e,o,r){let t=o.map(s=>s?.[r]),i=d(t);if(i!==void 0){let s=e;s[r]=i}}function me(e){let o={};for(let r of ae)ce(o,e,r);return Object.keys(o).length>0?o:void 0}function ze(...e){let o={},r=(n,c)=>{c!==void 0&&(o[n]=c)};r("commands",d(e.map(n=>n.commands))),r("commandOverrides",p(e.map(n=>n.commandOverrides))),r("flags",se(e.map(n=>n.flags))),r("parsers",p(e.map(n=>n.parsers))),r("renderers",p(e.map(n=>n.renderers))),r("services",p(e.map(n=>n.services))),r("preflights",d(e.map(n=>n.preflights))),r("itemTypes",d(e.map(n=>n.itemTypes))),r("itemFields",d(e.map(n=>n.itemFields))),r("relationshipKinds",d(e.map(n=>n.relationshipKinds))),r("migrations",d(e.map(n=>n.migrations))),r("profiles",d(e.map(n=>n.profiles))),r("searchProviders",d(e.map(n=>n.searchProviders))),r("vectorStoreAdapters",d(e.map(n=>n.vectorStoreAdapters))),r("assuranceProviders",d(e.map(n=>n.assuranceProviders))),r("importers",d(e.map(n=>n.importers))),r("exporters",d(e.map(n=>n.exporters))),r("hooks",me(e.map(n=>n.hooks)));let t;for(let n of e)n.manifest&&(t=n.manifest);r("manifest",t);let i=e.some(n=>n.activate);r("activate",i?async n=>{for(let c of e)c.activate&&await c.activate(n)}:void 0);let s=e.some(n=>n.deactivate);return r("deactivate",s?async()=>{let n=[];for(let c of[...e].reverse())if(c.deactivate)try{await c.deactivate()}catch(f){n.push(f)}if(n.length>0)throw n.length>1?new AggregateError(n,"Multiple extension blueprint deactivate hooks failed."):n[0]}:void 0),o}var de=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function u(e){return e?Array.isArray(e)?e.length>0:Object.keys(e).length>0:!1}function h(e){let o=new Set;for(let[i,s]of de)u(e[i])&&o.add(s);(e.commands??[]).filter(l).some(i=>i.flags!==void 0)&&o.add("schema");let r=[...e.importers??[],...e.exporters??[]].filter(l);r.some(i=>i?.options?.flags!==void 0)&&o.add("schema"),r.some(i=>typeof i=="object")&&o.add("commands");let t=e.hooks??{};return[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some(u)&&o.add("hooks"),[...o].sort((i,s)=>i.localeCompare(s))}var fe=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function a(e){return[...new Set(e)].sort((o,r)=>o.localeCompare(r))}function l(e){return e!=null}function v(e){return m(`${e.name} import`)}function _(e){return m(`${e.name} export`)}function le(e,o,r){return[...e.map(t=>m(t.name)),...o.filter(t=>t.options!==void 0).map(v),...r.filter(t=>t.options!==void 0).map(_)]}function pe(e,o,r,t){return[...Object.keys(e.flags??{}).map(i=>m(i)),...o.filter(i=>i.flags!==void 0).map(i=>m(i.name)),...r.filter(i=>i.options?.flags!==void 0).map(v),...t.filter(i=>i.options?.flags!==void 0).map(_)]}function ue(e){return fe.filter(([o])=>(e[o]?.length??0)>0).map(([,o])=>o)}function ge(e){let o=Object.entries(e??{}).filter(([,r])=>typeof r!="function"&&((r.commands?.length??0)>0||r.resultDiscriminator!==void 0)).map(([r,t])=>{let i=t;return{format:r,commands:a((i.commands??[]).map(s=>m(s))),result_discriminator:i.resultDiscriminator!==void 0}}).sort((r,t)=>r.format.localeCompare(t.format));return o.length>0?{renderer_ownership:o}:{}}function he(e){return!e||e.length===0?{}:{assurance_providers:a(e.map(o=>o.id))}}function ve(e,o,r){return{item_types:a((e.itemTypes??[]).map(t=>t.name)),item_fields:a((e.itemFields??[]).map(t=>t.name)),...(e.relationshipKinds?.length??0)>0?{relationship_kinds:a(e.relationshipKinds.map(t=>t.kind))}:{},migrations:a((e.migrations??[]).flatMap(t=>typeof t.id=="string"?[t.id]:[])),profiles:a((e.profiles??[]).map(t=>t.name)),importers:a(o.map(t=>m(t.name))),exporters:a(r.map(t=>m(t.name))),search_providers:a((e.searchProviders??[]).map(t=>t.name)),vector_store_adapters:a((e.vectorStoreAdapters??[]).map(t=>t.name)),...he(e.assuranceProviders),parser_overrides:a(Object.keys(e.parsers??{}).map(t=>m(t))),service_overrides:a(Object.keys(e.services??{}).map(t=>String(t).trim().toLowerCase())),renderer_overrides:a(Object.keys(e.renderers??{}).map(t=>String(t).trim().toLowerCase())),...ge(e.renderers),preflight_overrides:(e.preflights??[]).length,preflight_ownership:(e.preflights??[]).map(t=>({commands:[...t.commands??[]]}))}}function We(e){let o=(e.commands??[]).filter(l),r=(e.importers??[]).filter(l),t=(e.exporters??[]).filter(l),i=r.map(v),s=t.map(_),n=le(o,r,t),c=pe(e,o,r,t),f=e.hooks??{},b=ve(e,r,t);return{capabilities:h(e),commands:a(n),command_overrides:a(Object.keys(e.commandOverrides??{}).map(F=>m(F))),command_handlers:a([...n,...i,...s]),hooks:ue(f),flag_commands:a(c),...b}}var _e=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function ye(e){return(e.itemFields??[]).filter(o=>typeof o?.name=="string"&&g.has(o.name.trim())).map(o=>({code:"reserved_item_field",severity:"error",message:`Item field "${o.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:o.name}))}function Ee(e){return[...Object.values(e.flags??{}).flat(),...(e.commands??[]).flatMap(o=>o.flags??[]),...(e.importers??[]).flatMap(o=>o.options?.flags??[]),...(e.exporters??[]).flatMap(o=>o.options?.flags??[])].flatMap(o=>{if(typeof o?.long!="string"&&typeof o?.short!="string")return[];let r=x(o.long,o.short);if(r===null)return[];let{token:t,failure:i}=r;return[{code:i,severity:"error",message:`Flag "${t}" ${k(t,i)}.`,field:t}]})}function S(e){let o=new Set;for(let r of e){let t=E(r)??y(r);t!==null&&o.add(t)}return[...o].sort((r,t)=>r.localeCompare(t))}function xe(e,o){let r=[];if(o===null)return e.length>0&&r.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${e.length===1?"capability":"capabilities"} [${e.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),r;let t=new Set(o),i=new Set(e);for(let s of e)t.has(s)||r.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${s}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${s}" to the manifest capabilities.`,capability:s});for(let s of o)i.has(s)||r.push({code:"capability_unused",severity:"warning",message:`Capability "${s}" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,capability:s});return r}function ke(e){let o=[],r=new Map;for(let i of e.commands??[]){let s=m(i.name);r.set(s,(r.get(s)??0)+1)}for(let[i,s]of r)s>1&&o.push({code:"duplicate_command",severity:"warning",message:`Command "${i}" is declared ${s} times in commands; the later registration shadows the earlier one at dispatch.`,command:i});let t=new Set(Object.keys(e.commandOverrides??{}).map(i=>m(i)));for(let i of r.keys())t.has(i)&&o.push({code:"command_override_conflict",severity:"warning",message:`Command "${i}" is declared both as a new command definition and as a command override; register one or the other.`,command:i});return o}function Ce(e){let o=[];for(let r of _e)r in e&&!u(e[r])&&o.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${r}" is present but empty; remove it or populate it.`,field:r});if("hooks"in e){let r=e.hooks??{};[r.beforeCommand,r.beforeMutation,r.afterCommand,r.onWrite,r.onRead,r.onIndex].some(u)||o.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return o}function Ie(e,o={}){let r=h(e),t=o.declaredCapabilities??e.manifest?.capabilities,i=Array.isArray(t)?S(t):null,s=[...xe(r,i),...ke(e),...Ee(e),...ye(e),...Ce(e)];return{ok:s.every(n=>n.severity!=="error"),findings:s,used:r,declared:i}}function P(e,o){let{additionalCapabilities:r,...t}=o,i=Array.isArray(r)?S(r):[],s=[...new Set([...h(e),...i])].sort((n,c)=>n.localeCompare(c));return{...t,capabilities:s}}function Ge(e,o){let r=P(e,o);return{module:ie({...e,manifest:r}),manifest:r}}function O(e,o){if(e.status==="absent"||e.status==="ok")return null;let r=`${e.kind}_${e.status}`,t="";switch(r){case"pm_min_version_invalid":t=`pm_min_version "${e.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":t=`pm_min_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_min_version_unmet":t=`Requires pm >= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_invalid":t=`pm_max_version "${e.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":t=`pm_max_version "${e.required}" could not be compared against pm ${o}; compatibility is unverified.`;break;case"pm_max_version_exceeded":t=`Allows pm <= ${e.required} but the target is pm ${o}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":t=`Target pm ${o} is newer than pm_max_version ${e.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:r,severity:e.allowed?"warning":"error",constraint:e.kind,required:e.required,current:o,message:t}}function we(e,o){let r=C(e.pm_min_version,o.pmVersion),t=I(e.pm_max_version,o.pmVersion,o.pmMaxVersionExceededMode??"block"),i=w(e).findings.map(f=>({code:f.code,severity:"warning",constraint:"manifest",required:f.code==="manifest_unknown_key"?f.path:"pm_min_version",current:o.pmVersion,path:f.path,...f.suggested_key?{suggested_key:f.suggested_key}:{},message:f.message})),s=[],n=O(r,o.pmVersion);n!==null&&s.push(n);let c=O(t,o.pmVersion);return c!==null&&s.push(c),{compatible:r.allowed&&t.allowed,findings:[...i,...s],pmVersion:o.pmVersion}}var Oe=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function Ye(e,o={}){let r=Ie(e,{declaredCapabilities:o.declaredCapabilities}),t=o.identity?P(e,o.identity):null,i=o.target?we(t??e.manifest??{},o.target):null,s=[...(t!==null&&o.declaredCapabilities===void 0?r.findings.filter(n=>!Oe.has(n.code)):r.findings).map(n=>({source:"blueprint",severity:n.severity,code:n.code,message:n.message})),...(i?.findings??[]).map(n=>({source:"compatibility",severity:n.severity,code:n.code,message:n.message}))];return{ok:s.every(n=>n.severity!=="error"),capabilities:r.used,blueprint:r,manifest:t,compatibility:i,findings:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="3f3a5dca-8370-52d7-b279-dc6f9f0aeadf")}catch{}})();function Je(e){return e}function Qe(e){return e}function Ze(e){return e}function er(e){return e}function rr(e){return e}function or(e){return e}function tr(e){return e}function nr(e){return e}function ir(e){return e}function sr(e){return e}function ar(e){return e}function cr(e){return e}function mr(e){return e}function dr(e){return{handled:!0,result:e}}function fr(){return{handled:!1}}function lr(e){return e}function pr(e){return e}function ur(e){return e}function gr(e){return e}function hr(e){return e}function vr(e){return e}function _r(e){return e}function yr(e){return e}function Er(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="c96e4de9-16ef-581a-aa4b-6450917c2c65")}catch{}})();export{$ as BUILTIN_PROFILES,Fe as EXTENSION_CAPABILITIES,be as EXTENSION_CAPABILITY_CONTRACT,Se as EXTENSION_CAPABILITY_CONTRACT_VERSION,Pe as EXTENSION_CAPABILITY_LEGACY_ALIASES,V as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ae as EXTENSION_POLICY_MODES,Re as EXTENSION_POLICY_SURFACES,Me as EXTENSION_SANDBOX_PROFILES,Te as EXTENSION_TRUST_MODES,Ne as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,B as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,M as PM_PACKAGE_RESOURCE_KINDS,Y as PROFILE_LINT_CODES,G as PROFILE_LINT_DIMENSIONS,L as PROFILE_NAMES,g as RESERVED_ITEM_FIELD_NAMES,De as SEARCH_EXTENSION_FLAG_DEFINITIONS,we as checkExtensionManifestCompatibility,D as collectPackageExtensionDirectories,z as collectUsedExtensionCapabilities,ie as composeExtension,Ge as composeExtensionPackage,T as createExtensionContributionInventory,fr as declineServiceOverride,vr as defineAfterCommandHook,gr as defineBeforeCommandHook,hr as defineBeforeMutationHook,Ze as defineCommand,sr as defineCommandOverride,ur as defineExporter,qe as defineExtension,Ve as defineExtensionBlueprint,Je as defineExtensionManifest,er as defineFlag,pr as defineImporter,or as defineItemField,rr as defineItemType,tr as defineMigration,Er as defineOnIndexHook,yr as defineOnReadHook,_r as defineOnWriteHook,ar as defineParserOverride,cr as definePreflightOverride,Qe as defineProjectProfile,lr as defineRendererOverride,nr as defineSearchProvider,mr as defineServiceOverride,ir as defineVectorStoreAdapter,h as deriveExtensionCapabilities,We as describeExtensionBlueprint,U as describeProfileComposition,q as describeProjectProfile,dr as handleServiceOverride,A as inspectExtensionManifestSchema,Ie as lintExtensionBlueprint,w as lintExtensionManifestSchema,X as lintProjectProfile,H as listProfiles,ze as mergeExtensionBlueprints,ee as normalizeDirectExtensionCommandOptions,R as normalizeExtensionContributionInventory,j as normalizeProfileName,J as planProfileApplication,Ye as preflightExtension,N as readPmPackageManifest,W as reconcileExtensionCapabilityUsage,Q as renderExtensionSurfaceMarkdown,Z as resolveExtensionFlagOptionKey,K as resolveProfile,P as synthesizeExtensionManifest,Be as toExtensionFlagDefinitions};
2
2
  //# sourceMappingURL=sdk-authoring.js.map
@@ -1,4 +1,4 @@
1
- import{a as Ji,b as Ki,c as Yi,d as T,e as Wi,f as L,g as Xi,h as Qi,i as Zi,j as en,k as tn,l as rn,m as on,n as nn,o as F,p as sn,q,u as z,v as an,w as dn,x as U,y as cn,z as ln}from"./focused-chunks/chunk-BB2GMKRB.js";import{a as pn}from"./focused-chunks/chunk-SVOOGGAK.js";import{a as Bi}from"./focused-chunks/chunk-RXY6BFRW.js";import{$ as Mi,A as bo,T as wi,U as xi,V as Ti,W as Ci,X as Pi,Y as vi,Z as ki,_ as Ei,a as Ke,aa as Oi,b as Ye,ba as $i,c as We,d as Xe,da as Si,e as Qe,ea as ji,f as Ze,fa as Ii,g as et,ga as Ai,h as tt,ha as Ri,i as rt,ia as Di,j as eo,ja as Ni,k as to,l as ro,m as oo,n as io,o as no,p as so,q as ao,r as co,s as lo,t as po,u as uo,v as _o,w as fo,x as mo,y as go,z as yo}from"./focused-chunks/chunk-IPIFI4NT.js";import{$ as Gt,$a as Gr,A as ht,Aa as yr,B as wt,Ba as br,Ca as hr,D as xt,Da as wr,E as Tt,Ea as xr,F as Ct,Fa as Tr,G as Pt,Ga as Cr,H as vt,Ha as Pr,I as kt,Ia as vr,J as Et,Ja as kr,K as Mt,Ka as Er,L as Ot,La as Mr,M as $t,Ma as Or,N as St,Na as $r,O as jt,Oa as Sr,P as It,Pa as jr,Q as At,Qa as Ir,Ra as Ar,S as Rt,Sa as Rr,T as Dt,Ta as Dr,U as Nt,Ua as Nr,V as Lt,Va as Lr,W as Ft,Wa as Fr,X as qt,Xa as qr,Y as zt,Ya as zr,Z as Ut,Za as Ur,_ as Ht,_a as Hr,aa as Vt,ab as Vr,ba as Bt,bb as Br,ca as Jt,cb as Jr,d as $,da as Kt,db as Kr,e as S,ea as Yt,eb as Yr,fa as Wt,fb as Wr,ga as Xt,gb as Xr,ha as Qt,i as j,ia as Zt,ib as Qr,ja as er,k as I,ka as tr,kb as A,l as it,la as rr,lb as R,m as nt,ma as or,mb as Zr,n as st,na as ir,o as at,oa as nr,p as dt,pa as sr,q as ct,qa as ar,r as lt,ra as dr,s as pt,sa as cr,t as ut,ta as lr,u as _t,ua as pr,v as ft,va as ur,w as mt,wa as _r,x as gt,xa as fr,y as yt,ya as mr,z as bt,za as gr}from"./focused-chunks/chunk-GAXO2UQX.js";import{a as ot}from"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{$a as f,$c as So,Ab as Be,Ad as ei,Ae as mi,Bd as ti,Be as gi,Cb as Je,Cd as ri,Ce as yi,Dd as oi,De as bi,Ed as ii,Fd as ni,Gc as D,Gd as si,Hc as N,Hd as ai,Le as hi,Pb as Q,Pc as ho,Qc as wo,Rc as xo,Sc as To,Tc as Co,Te as Li,Uc as Po,Ue as Fi,Va as ye,Vc as vo,Ve as qi,Wa as be,Wc as ko,We as zi,Xa as he,Xc as Eo,Xe as Ui,Ya as we,Yc as Mo,Ye as Hi,Za as M,Zc as Oo,Ze as Gi,_a as xe,_c as $o,_e as Vi,ab as O,ad as jo,bb as Te,bd as Io,cb as Ce,cd as Ao,db as Pe,dd as Ro,eb as ve,ed as Do,fb as ke,fd as No,gb as Ee,gd as Lo,hb as Me,ib as Oe,jb as $e,jd as Fo,kb as Se,kd as qo,lb as je,nb as Ie,nd as zo,ob as Ae,od as Uo,pb as Re,pd as Ho,qb as De,qd as Go,rb as Ne,rd as Vo,sb as Le,sd as Bo,se as di,tb as Fe,td as Jo,te as x,ub as qe,ud as Ko,ue as ci,vb as ze,vd as Yo,ve as li,wb as Ue,wd as Wo,we as pi,xb as He,xd as Xo,xe as ui,yb as Ge,yd as Qo,ye as _i,zb as Ve,zd as Zo,ze as fi}from"./focused-chunks/chunk-MK7UQEE5.js";import{z as w}from"./focused-chunks/chunk-G6ERMFJ5.js";(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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var Z="2026-07-28",H=["2025-11-25","2025-06-18"],G=[Z];(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var ee=new Set(["--help","-h","--version","-V"]);function te(e,t){let o=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&o.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),o.push("",`MCP protocol: ${G.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${H.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),o.join(`
1
+ import{a as Ji,b as Ki,c as Yi,d as T,e as Wi,f as L,g as Xi,h as Qi,i as Zi,j as en,k as tn,l as rn,m as on,n as nn,o as F,p as sn,q,u as z,v as an,w as dn,x as U,y as cn,z as ln}from"./focused-chunks/chunk-2ZPGEGTB.js";import{a as pn}from"./focused-chunks/chunk-SVOOGGAK.js";import{a as Bi}from"./focused-chunks/chunk-VGJDKDKA.js";import{$ as Mi,A as bo,T as wi,U as xi,V as Ti,W as Ci,X as Pi,Y as vi,Z as ki,_ as Ei,a as Ke,aa as Oi,b as Ye,ba as $i,c as We,d as Xe,da as Si,e as Qe,ea as ji,f as Ze,fa as Ii,g as et,ga as Ai,h as tt,ha as Ri,i as rt,ia as Di,j as eo,ja as Ni,k as to,l as ro,m as oo,n as io,o as no,p as so,q as ao,r as co,s as lo,t as po,u as uo,v as _o,w as fo,x as mo,y as go,z as yo}from"./focused-chunks/chunk-FNIX62V6.js";import{$ as Gt,$a as Gr,A as ht,Aa as yr,B as wt,Ba as br,Ca as hr,D as xt,Da as wr,E as Tt,Ea as xr,F as Ct,Fa as Tr,G as Pt,Ga as Cr,H as vt,Ha as Pr,I as kt,Ia as vr,J as Et,Ja as kr,K as Mt,Ka as Er,L as Ot,La as Mr,M as $t,Ma as Or,N as St,Na as $r,O as jt,Oa as Sr,P as It,Pa as jr,Q as At,Qa as Ir,Ra as Ar,S as Rt,Sa as Rr,T as Dt,Ta as Dr,U as Nt,Ua as Nr,V as Lt,Va as Lr,W as Ft,Wa as Fr,X as qt,Xa as qr,Y as zt,Ya as zr,Z as Ut,Za as Ur,_ as Ht,_a as Hr,aa as Vt,ab as Vr,ba as Bt,bb as Br,ca as Jt,cb as Jr,d as $,da as Kt,db as Kr,e as S,ea as Yt,eb as Yr,fa as Wt,fb as Wr,ga as Xt,gb as Xr,ha as Qt,i as j,ia as Zt,ib as Qr,ja as er,k as I,ka as tr,kb as A,l as it,la as rr,lb as R,m as nt,ma as or,mb as Zr,n as st,na as ir,o as at,oa as nr,p as dt,pa as sr,q as ct,qa as ar,r as lt,ra as dr,s as pt,sa as cr,t as ut,ta as lr,u as _t,ua as pr,v as ft,va as ur,w as mt,wa as _r,x as gt,xa as fr,y as yt,ya as mr,z as bt,za as gr}from"./focused-chunks/chunk-ZOGEQFGH.js";import{a as ot}from"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{$a as f,$c as vo,$e as qi,Ab as Be,Ad as Ko,Ae as ci,Bd as Yo,Be as li,Cb as Je,Cd as Wo,Ce as pi,Dd as Xo,De as ui,Ed as Qo,Ee as _i,Fd as Zo,Fe as fi,Gc as D,Gd as ei,Ge as mi,Hc as N,Hd as ti,He as gi,Id as ri,Ie as yi,Jd as oi,Je as bi,Kd as ii,Ld as ni,Md as si,Nd as ai,Pb as Q,Re as hi,Va as ye,Vc as ho,Wa as be,Wc as wo,Xa as he,Xc as xo,Ya as we,Yc as To,Za as M,Zc as Co,Ze as Li,_a as xe,_c as Po,_e as Fi,ab as O,ad as ko,af as zi,bb as Te,bd as Eo,bf as Ui,cb as Ce,cd as Mo,cf as Hi,db as Pe,dd as Oo,df as Gi,eb as ve,ed as $o,ef as Vi,fb as ke,fd as So,gb as Ee,gd as jo,hb as Me,hd as Io,ib as Oe,id as Ao,jb as $e,jd as Ro,kb as Se,kd as Do,lb as je,ld as No,md as Lo,nb as Ie,ob as Ae,pb as Re,pd as Fo,qb as De,qd as qo,rb as Ne,sb as Le,tb as Fe,td as zo,ub as qe,ud as Uo,vb as ze,vd as Ho,wb as Ue,wd as Go,xb as He,xd as Vo,yb as Ge,yd as Bo,ye as di,zb as Ve,zd as Jo,ze as x}from"./focused-chunks/chunk-5NTLNE54.js";import{z as w}from"./focused-chunks/chunk-G6ERMFJ5.js";(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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var Z="2026-07-28",H=["2025-11-25","2025-06-18"],G=[Z];(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var ee=new Set(["--help","-h","--version","-V"]);function te(e,t){let o=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&o.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),o.push("",`MCP protocol: ${G.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${H.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),o.join(`
2
2
  `)}function fn(e,t,o){if(e.length===0)return{kind:"serve"};let i=e.find(r=>!ee.has(r));if(i!==void 0){let r=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(i)}. Run ${r} --help.
3
3
  `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?te(t,o):`${o}
4
4
  `,stderr:""}}(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]="e6e71c2b-9315-5e03-b73e-926261338c01")}catch{}})();var m,re=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function oe(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let o=re[f(e)];if(o===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return o}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(f(e))?"linked-file-path":["comments","notes","learnings"].includes(f(e))?"entry-file-input":"plan-definition-file"}function g(){if(m!==void 0)return m;let e=q.filter(({command:r})=>A(r)).flatMap(({command:r,family:n})=>F(r,R(r)).map(s=>({command:r,family:n,concept:oe(r,s.flag),flag:s.flag,aliases:Object.freeze([...s.aliases??[]]),value_kind:s.repeatable?"list":s.flag==="--limit"?"number":s.value_type}))),t=new Set(e.flatMap(r=>r.aliases.map(n=>`${r.command}:${n}`))),o=e.filter(r=>!t.has(`${r.command}:${r.flag}`)),i=new Map;for(let r of o){let n=i.get(r.concept)??new Set;n.add(r.value_kind),i.set(r.concept,n)}return m=Object.freeze(o.map(r=>Object.freeze({...r,concept:i.get(r.concept)?.size===1?r.concept:`${r.concept}@${r.command}`}))),m}function wn(){return Object.freeze(g().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var V=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:40,docs:31,deps:32,plan:111,test:57,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),ie=1,B=Object.freeze(Object.fromEntries(Object.entries({...V,...Object.fromEntries(M.flatMap(({alias:e,canonical:t})=>{let o=V[e];return o===void 0?[]:[[t,o]]}))}).map(([e,t])=>[e,t+ie])));function J(){let e=new Map(Object.keys(B).map(t=>[t,0]));for(let{command:t}of g())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(B).map(([t,o])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:o})))}function ne(e,t,o){for(let i of e)for(let r of i.aliases){let n=t.get(`${i.command}:${r}`);n===void 0||n.flag===i.flag||o.push({code:"alias_collision",command:i.command,detail:`${r} aliases ${i.flag} but is canonical for ${n.flag}.`})}}function se(e,t,o){let i=new Set(t.map(({command:r})=>r));for(let r of e.keys())i.has(r)||o.push({code:"missing_budget",command:r,detail:`${r} has canonical flags but no persisted budget.`});for(let r of t){let n=e.get(r.command)??0;n===0&&o.push({code:"stale_budget",command:r.command,detail:`${r.command} has a persisted budget but no canonical flags.`}),!(n<=r.maximum)&&o.push({code:"budget_exceeded",command:r.command,detail:`${n} canonical flags exceed the ratcheted maximum ${r.maximum}.`})}}function ae(e,t,o){let i=new Map(e.map(r=>[`${r.command}:${r.flag}`,r]));for(let r of t){let n=`${r.command}:${r.canonical_flag}`,s=i.get(n);if(!s){o.push({code:"removed_canonical_spelling",command:r.command,detail:`${r.canonical_flag} disappeared from the executable spelling inventory.`});continue}let d=new Set([s.flag,...s.aliases]);for(let a of r.accepted_spellings)d.has(a)||o.push({code:"removed_compatibility_spelling",command:r.command,detail:`${a} no longer resolves to ${r.canonical_flag}.`})}}function xn(e=g(),t=J(),o=[]){let i=[],r=new Map,n=new Map,s=new Map,d=new Map;for(let a of e){let c=`${a.command}:${a.flag}`;r.has(c)?i.push({code:"duplicate_canonical_flag",command:a.command,detail:`${a.flag} has more than one canonical row.`}):r.set(c,a),d.set(a.command,(d.get(a.command)??0)+1);let l=n.get(a.concept);l!==void 0&&l!==a.value_kind?i.push({code:"inconsistent_concept_kind",command:a.command,detail:`${a.concept} uses both ${l} and ${a.value_kind}.`}):n.set(a.concept,a.value_kind);let p=s.get(a.concept);p!==void 0&&p!==a.flag?i.push({code:"semantic_spelling_collision",command:a.command,detail:`${a.concept} is canonicalized by both ${p} and ${a.flag}.`}):s.set(a.concept,a.flag)}return ne(e,r,i),se(d,t,i),ae(e,o,i),i.sort((a,c)=>a.command.localeCompare(c.command)||a.code.localeCompare(c.code)||a.detail.localeCompare(c.detail)),{ok:i.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:a})=>a)).size,baseline_entry_count:o.length,findings:i}}function Tn(){let e=g(),t=J(),o=new Map(t.map(({command:i})=>[i,"unknown"]));for(let{command:i,family:r}of e)o.set(i,r);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:i,current:r,maximum:n})=>{let s=o.get(i);return`| \`${i}\` | ${s} | ${r} | ${n} |`}),""].join(`
@@ -1,2 +1,2 @@
1
- import{A as Ye,B as Xe,C as Ke,D as je,E as qe,F as Je,G as Qe,H as Ze,I as $e,J as et,K as tt,L as ot,N as rt,b as Se,c as Te,d as ye,e as Re,f as Oe,g as be,h as De,i as Ce,j as Ne,k as Pe,l as ve,m as Ue,n as Le,o as he,p as Me,q as we,r as xe,s as Ve,t as Fe,u as ze,v as ke,w as Be,x as He,y as Ge,z as We}from"./focused-chunks/chunk-AIYJHVKV.js";import"./focused-chunks/chunk-GB2N4OM7.js";import"./focused-chunks/chunk-BB2GMKRB.js";import{na as pe,oa as ce}from"./focused-chunks/chunk-VUNX6NBR.js";import"./focused-chunks/chunk-5OCUNAQN.js";import"./focused-chunks/chunk-GBW2EAAG.js";import"./focused-chunks/chunk-IDAYTYNN.js";import"./focused-chunks/chunk-TZO6L523.js";import"./focused-chunks/chunk-LAIN47EJ.js";import"./focused-chunks/chunk-SVOOGGAK.js";import{a as me}from"./focused-chunks/chunk-RXY6BFRW.js";import"./focused-chunks/chunk-IPIFI4NT.js";import"./focused-chunks/chunk-P6KYUJD4.js";import"./focused-chunks/chunk-AXPRCCYM.js";import{k as Ee,l as fe,m as Ie,n as _e,o as Ae,p as ge}from"./focused-chunks/chunk-BHYGUVAU.js";import"./focused-chunks/chunk-SPAEZKVA.js";import"./focused-chunks/chunk-NP5C2TQM.js";import"./focused-chunks/chunk-KN7RBRRH.js";import"./focused-chunks/chunk-GAXO2UQX.js";import"./focused-chunks/chunk-NSOXVVQX.js";import"./focused-chunks/chunk-3FN4ON2Z.js";import"./focused-chunks/chunk-GHQVM6K6.js";import{j as ie,ja as se,ka as ae,la as de,ma as ue,na as le}from"./focused-chunks/chunk-NY65XTX7.js";import{C as L,D as h,F as M,G as w,H as x,J as V,S as F,T as z,U as k,V as B,W as H,X as G,fa as W,ga as Y,ha as X,ia as K,ja as j,ka as q,la as J,ma as Q,na as Z,oa as $,pa as ee,qa as te,ra as oe,sa as re,ta as ne}from"./focused-chunks/chunk-HIKZYZ26.js";import"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{Ad as g,Cd as S,Dd as T,Gd as y,Ge as b,Hd as R,He as D,Ne as C,Pe as N,Qe as P,Re as v,Sd as O,Se as U,g as r,h as n,i,n as s,nd as p,od as c,p as a,pd as E,q as d,qd as f,r as u,rd as I,ud as _,yd as A}from"./focused-chunks/chunk-MK7UQEE5.js";import"./focused-chunks/chunk-EGN2HFRU.js";import"./focused-chunks/chunk-FOA7XKWP.js";import{A as m,z as l}from"./focused-chunks/chunk-G6ERMFJ5.js";(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]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(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]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(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]="da93cfe5-b451-50d5-b763-a303bf1f19cc")}catch{}})();export{W as AGENT_PROVENANCE_DIMENSIONS,L as BASELINE_ITEM_FORMAT_VERSION,X as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,r as BUILTIN_ITEM_TYPE_VALUES,u as CONFIDENCE_TEXT_VALUES,h as CURRENT_ITEM_FORMAT_VERSION,s as DEPENDENCY_KIND_VALUES,l as EXIT_CODE,d as ISSUE_SEVERITY_VALUES,n as ITEM_TYPE_VALUES,ae as PM_CLI_EXPECTED_ERROR_NAME,E as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,p as PM_READ_OUTPUT_DIMENSIONS,c as PM_READ_OUTPUT_OPTION_FLAGS,f as PM_READ_OUTPUT_SURFACE_CONTRACTS,m as PmCliError,Pe as PmClient,a as RISK_VALUES,Ae as SEMANTIC_ATTRIBUTION_LIMITS,i as STATUS_VALUES,G as agentSessionEnvironment,xe as aggregate,ye as analyzeAgentProvenanceDescriptorCoverage,me as analyzeSdkCliParameterCompleteness,Ye as append,g as applyReadOutputDimensions,P as applyReadOutputSessionReferences,D as assertWellFormedOutputText,v as attachReadOutputSessionReceipt,k as boundAgentEpisodeIdentity,z as canonicalDocument,Je as claim,Qe as claimNext,x as classifyItemFormatVersion,qe as close,Ve as comments,ve as context,$e as copy,Xe as create,ue as createPmCliExpectedError,R as decodeReadOutputContinuationCursor,et as deleteItem,Ge as deps,$ as detectAgentIdentity,re as detectHarnessIdentity,ee as diagnoseAgentIdentity,He as docs,M as effectiveItemFormatVersion,Ne as emptyImportedDocument,y as encodeReadOutputContinuationCursor,be as evaluateSemanticAttributionCoverage,ce as explainSourceTraceability,ke as files,Be as filesDiscover,ot as focus,Me as get,We as graph,De as groupHistoryByEpisode,Se as isAlreadyClaimedError,de as isItemAlreadyExistsError,le as isPmCliExpectedError,se as isPmTokenBudgetRecovery,S as isReadOutputBudgetExceeded,C as isReadOutputSessionReference,ze as learnings,Ue as list,j as listAgentProvenanceAdapters,Le as listAllComplete,we as next,J as normalizeAgentProvenanceAdapterValue,w as normalizeItemFormatVersion,ie as normalizeItemId,V as normalizeStatusInput,Fe as notes,O as nowIso,N as parseReadOutputSession,pe as parseSourceLineRange,te as readAuthorEnvironment,U as readOutputSessionRemainingTokens,fe as recordClaimSemanticAttribution,_e as recordFocusSemanticAttribution,Ie as recordReleaseSemanticAttribution,q as registerAgentProvenanceAdapters,K as registerHarnessSignalDescriptors,Ze as release,je as reopen,B as resolveAgentSessionContextFromSignals,ne as resolveAuthorIdentity,Te as resolveHistoryEpisodeGroupIdentity,A as resolveReadOutputDimensions,T as resolveReadOutputEncoding,I as resolveReadOutputSurface,Ee as resolveSemanticLineageIds,tt as restore,rt as runAction,H as runWithAgentSessionContext,Q as runWithHarnessDetectionSignals,Z as runWithWorkspaceHarnessSignalDescriptors,he as search,ge as semanticAttributionAffinity,F as serializeItemDocument,Re as summarizeAgentModelProvenance,Oe as summarizeAgentProvenance,b as toWellFormedText,Ke as update,Ce as updateLinkedTest,_ as validateReadOutputOptions,oe as writeAuthorEnvironment};
1
+ import{A as Ye,B as Xe,C as Ke,D as je,E as qe,F as Je,G as Qe,H as Ze,I as $e,J as et,K as tt,L as ot,N as rt,b as Se,c as Te,d as ye,e as Re,f as Oe,g as be,h as De,i as Ce,j as Ne,k as Pe,l as ve,m as Ue,n as Le,o as he,p as Me,q as we,r as xe,s as Ve,t as Fe,u as ze,v as ke,w as Be,x as He,y as Ge,z as We}from"./focused-chunks/chunk-5KTOMFLR.js";import"./focused-chunks/chunk-RIMNSVFA.js";import"./focused-chunks/chunk-2ZPGEGTB.js";import{na as pe,oa as ce}from"./focused-chunks/chunk-IYV3IPRF.js";import"./focused-chunks/chunk-4LFE3FQL.js";import"./focused-chunks/chunk-TVJ2PHAK.js";import"./focused-chunks/chunk-IDAYTYNN.js";import"./focused-chunks/chunk-QGQJBQCH.js";import"./focused-chunks/chunk-VGFKTSGY.js";import"./focused-chunks/chunk-SVOOGGAK.js";import{a as me}from"./focused-chunks/chunk-VGJDKDKA.js";import"./focused-chunks/chunk-FNIX62V6.js";import"./focused-chunks/chunk-ADBFVDTG.js";import"./focused-chunks/chunk-CSKDIMQP.js";import{k as Ee,l as fe,m as Ie,n as _e,o as Ae,p as ge}from"./focused-chunks/chunk-JR75B6HU.js";import"./focused-chunks/chunk-WFVZ7GGR.js";import"./focused-chunks/chunk-Q3OA5OAK.js";import"./focused-chunks/chunk-J3LQQP3N.js";import"./focused-chunks/chunk-ZOGEQFGH.js";import"./focused-chunks/chunk-3MB47JLT.js";import"./focused-chunks/chunk-ZJF6ZA7B.js";import"./focused-chunks/chunk-GHQVM6K6.js";import{j as ie,ja as se,ka as ae,la as de,ma as ue,na as le}from"./focused-chunks/chunk-VTOTZ5UC.js";import{C as L,D as h,F as M,G as w,H as x,J as V,S as F,T as z,U as k,V as B,W as H,X as G,fa as W,ga as Y,ha as X,ia as K,ja as j,ka as q,la as J,ma as Q,na as Z,oa as $,pa as ee,qa as te,ra as oe,sa as re,ta as ne}from"./focused-chunks/chunk-VGUQ4V47.js";import"./focused-chunks/chunk-I5LGPUWH.js";import"./focused-chunks/chunk-C3O6JJPO.js";import{Ad as _,Ed as A,Gd as g,Id as S,Jd as T,Md as y,Me as b,Nd as R,Ne as D,Te as C,Ve as N,We as P,Xe as v,Yd as O,Ye as U,g as r,h as n,i,n as s,p as a,q as d,r as u,td as p,ud as c,vd as E,wd as f,xd as I}from"./focused-chunks/chunk-5NTLNE54.js";import"./focused-chunks/chunk-EGN2HFRU.js";import"./focused-chunks/chunk-FOA7XKWP.js";import{A as m,z as l}from"./focused-chunks/chunk-G6ERMFJ5.js";(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]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(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]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(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]="da93cfe5-b451-50d5-b763-a303bf1f19cc")}catch{}})();export{W as AGENT_PROVENANCE_DIMENSIONS,L as BASELINE_ITEM_FORMAT_VERSION,X as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,r as BUILTIN_ITEM_TYPE_VALUES,u as CONFIDENCE_TEXT_VALUES,h as CURRENT_ITEM_FORMAT_VERSION,s as DEPENDENCY_KIND_VALUES,l as EXIT_CODE,d as ISSUE_SEVERITY_VALUES,n as ITEM_TYPE_VALUES,ae as PM_CLI_EXPECTED_ERROR_NAME,E as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,p as PM_READ_OUTPUT_DIMENSIONS,c as PM_READ_OUTPUT_OPTION_FLAGS,f as PM_READ_OUTPUT_SURFACE_CONTRACTS,m as PmCliError,Pe as PmClient,a as RISK_VALUES,Ae as SEMANTIC_ATTRIBUTION_LIMITS,i as STATUS_VALUES,G as agentSessionEnvironment,xe as aggregate,ye as analyzeAgentProvenanceDescriptorCoverage,me as analyzeSdkCliParameterCompleteness,Ye as append,g as applyReadOutputDimensions,P as applyReadOutputSessionReferences,D as assertWellFormedOutputText,v as attachReadOutputSessionReceipt,k as boundAgentEpisodeIdentity,z as canonicalDocument,Je as claim,Qe as claimNext,x as classifyItemFormatVersion,qe as close,Ve as comments,ve as context,$e as copy,Xe as create,ue as createPmCliExpectedError,R as decodeReadOutputContinuationCursor,et as deleteItem,Ge as deps,$ as detectAgentIdentity,re as detectHarnessIdentity,ee as diagnoseAgentIdentity,He as docs,M as effectiveItemFormatVersion,Ne as emptyImportedDocument,y as encodeReadOutputContinuationCursor,be as evaluateSemanticAttributionCoverage,ce as explainSourceTraceability,ke as files,Be as filesDiscover,ot as focus,Me as get,We as graph,De as groupHistoryByEpisode,Se as isAlreadyClaimedError,de as isItemAlreadyExistsError,le as isPmCliExpectedError,se as isPmTokenBudgetRecovery,S as isReadOutputBudgetExceeded,C as isReadOutputSessionReference,ze as learnings,Ue as list,j as listAgentProvenanceAdapters,Le as listAllComplete,we as next,J as normalizeAgentProvenanceAdapterValue,w as normalizeItemFormatVersion,ie as normalizeItemId,V as normalizeStatusInput,Fe as notes,O as nowIso,N as parseReadOutputSession,pe as parseSourceLineRange,te as readAuthorEnvironment,U as readOutputSessionRemainingTokens,fe as recordClaimSemanticAttribution,_e as recordFocusSemanticAttribution,Ie as recordReleaseSemanticAttribution,q as registerAgentProvenanceAdapters,K as registerHarnessSignalDescriptors,Ze as release,je as reopen,B as resolveAgentSessionContextFromSignals,ne as resolveAuthorIdentity,Te as resolveHistoryEpisodeGroupIdentity,A as resolveReadOutputDimensions,T as resolveReadOutputEncoding,I as resolveReadOutputSurface,Ee as resolveSemanticLineageIds,tt as restore,rt as runAction,H as runWithAgentSessionContext,Q as runWithHarnessDetectionSignals,Z as runWithWorkspaceHarnessSignalDescriptors,he as search,ge as semanticAttributionAffinity,F as serializeItemDocument,Re as summarizeAgentModelProvenance,Oe as summarizeAgentProvenance,b as toWellFormedText,Ke as update,Ce as updateLinkedTest,_ as validateReadOutputOptions,oe as writeAuthorEnvironment};
2
2
  //# sourceMappingURL=sdk-core.js.map