@unbrained/pm-cli 2026.9.15 → 2026.9.17

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 (85) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +58 -0
  3. package/dist/cli/error-guidance.d.ts +1 -1
  4. package/dist/cli/error-guidance.js +1 -1
  5. package/dist/cli/register-setup.js +1 -1
  6. package/dist/cli-bundle/bundle-manifest.json +149 -149
  7. package/dist/cli-bundle/chunks/{chunk-3RB6Z7XE.js → chunk-5ZY4WE3F.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-UKLOSZV6.js → chunk-C3MFMGCR.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-WLJJ4MAU.js → chunk-CPFBDM53.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-YMMLKKEP.js → chunk-DN2RIHRN.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-5P5PYCZX.js → chunk-E67MIO3Z.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-3AHONKLL.js → chunk-G2IJF244.js} +48 -48
  13. package/dist/cli-bundle/chunks/{chunk-RM2OGG65.js → chunk-LD2FH2YE.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-RKPUO75B.js → chunk-Q6KPZGMP.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-Y2P3DSSO.js → chunk-T526C5DX.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-BOZ4HVYL.js → chunk-UF75LUAK.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-J4DRE3WN.js → chunk-UJSB6NO6.js} +76 -76
  18. package/dist/cli-bundle/chunks/{chunk-WDF7PP4P.js → chunk-YZXB4XGA.js} +4 -4
  19. package/dist/cli-bundle/chunks/{register-list-query-IWSPNFFD.js → register-list-query-ISM35VIX.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-mutation-3DVF4R64.js → register-mutation-KHMBJJS6.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-operations-LXP3MECQ.js → register-operations-HHDROJD6.js} +2 -2
  22. package/dist/cli-bundle/chunks/{register-setup-KFQSNBDX.js → register-setup-YAURJMY5.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/{chunk-533DCWPY.js → chunk-267N774W.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-ZHX3433X.js → chunk-5FSGN4MP.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-BMATJLPT.js → chunk-5KYHDFDN.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-SHF57M2H.js → chunk-7S7XWMXC.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/{chunk-AXDAIBT3.js → chunk-7ZC4CKOX.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-JKJYXCT6.js → chunk-BFUXTNZU.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-PBJC2ZNA.js → chunk-G4TKJZ4A.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-ZOE2NSJB.js → chunk-GKSAMNBG.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-63YRRGKX.js → chunk-IVWUQE7T.js} +51 -51
  32. package/dist/cli-bundle/focused-chunks/{chunk-6C3CUU2G.js → chunk-JZSLDLR4.js} +20 -20
  33. package/dist/cli-bundle/focused-chunks/{chunk-YBQTVE5S.js → chunk-LNM3BS45.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-5SBU4QDC.js → chunk-NOK652OP.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-OGGF2RBL.js → chunk-OCTTDZOU.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-MD7ADLME.js → chunk-OWDDVMAP.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-UACMCSCC.js → chunk-WUMGGQYN.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-4YTDKIPF.js → chunk-Z4PWEIMX.js} +21 -21
  39. package/dist/cli-bundle/main.js +11 -10
  40. package/dist/cli-bundle/sdk-authoring.js +1 -1
  41. package/dist/cli-bundle/sdk-contracts.js +1 -1
  42. package/dist/cli-bundle/sdk-core.js +2 -2
  43. package/dist/cli-bundle/sdk-governance.js +1 -1
  44. package/dist/cli-bundle/sdk-graph.js +1 -1
  45. package/dist/cli-bundle/sdk-merge.js +40 -40
  46. package/dist/cli-bundle/sdk-query.js +1 -1
  47. package/dist/cli-bundle/sdk-runtime.js +1 -1
  48. package/dist/cli-bundle/sdk-testing.js +1 -1
  49. package/dist/cli-bundle/sdk.js +2 -2
  50. package/dist/core/diagnostics/remediation.js +1 -1
  51. package/dist/core/store/tracker-preflight.js +1 -1
  52. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  53. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  54. package/dist/sdk/index.d.ts +1 -1
  55. package/dist/sdk/index.js +1 -1
  56. package/dist/sdk/init.d.ts +22 -1
  57. package/dist/sdk/init.js +1 -1
  58. package/dist/sdk/merge/install.js +2 -2
  59. package/dist/sdk/public-surface.json +1 -1
  60. package/dist/sdk/read-output-budget.d.ts +2 -0
  61. package/dist/sdk/read-output-budget.js +1 -1
  62. package/dist/sdk/read-output-contracts.d.ts +4 -0
  63. package/dist/sdk/read-output-contracts.js +1 -1
  64. package/docs/MERGE_SAFETY.md +13 -2
  65. package/docs/PACKED_FIRST_RUN.md +46 -0
  66. package/docs/QUICKSTART.md +16 -0
  67. package/docs/READ_OUTPUT_CONTRACTS.md +14 -0
  68. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +6 -3
  69. package/marketplace.json +2 -2
  70. package/package.json +1 -1
  71. package/packages/pm-beads/package.json +1 -1
  72. package/packages/pm-calendar/package.json +1 -1
  73. package/packages/pm-command-kit/package.json +1 -1
  74. package/packages/pm-digital-twin/package.json +1 -1
  75. package/packages/pm-governance-audit/package.json +1 -1
  76. package/packages/pm-guide-shell/package.json +1 -1
  77. package/packages/pm-kanban/package.json +1 -1
  78. package/packages/pm-lifecycle-hooks/package.json +1 -1
  79. package/packages/pm-linked-test-adapters/package.json +1 -1
  80. package/packages/pm-search-advanced/package.json +1 -1
  81. package/packages/pm-templates/package.json +1 -1
  82. package/packages/pm-todos/package.json +1 -1
  83. package/packages/pm-vcs/package.json +1 -1
  84. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  85. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
@@ -1,4 +1,4 @@
1
- import{a as gc,b as Ye,c as an,d as bc,e as wc,h as vc}from"./chunk-YMMLKKEP.js";import{J as vo,L as Ic,M as Lc,O as Dc,Q as Nc,R as jc,a as kt,b as co,d as $e,e as _c,j as hc,p as wo}from"./chunk-Y2P3DSSO.js";import{$ as io,Bc as Tc,Cc as xc,Dc as Oc,Eb as St,Ec as $c,Ed as Io,F as bt,Fb as fo,Fc as Pc,Fd as Eo,G as g,H as ca,Hb as dc,Hc as Fc,Hd as zc,I as la,Ic as Mc,K as Z,L as da,M as Yt,Ma as tc,Mb as _o,Mc as ko,N as ma,Na as so,O as eo,Od as Hc,P as Jt,Pa as nc,Pd as Wc,Q as to,Qa as oc,R as Ce,Ra as ao,S as pa,T as no,Tc as Uc,U as V,Uc as Gc,V as oo,W as G,Wc as qc,X as ua,Y as fa,Z as ro,_ as _a,bb as on,cc as It,dc as ho,ec as mc,fc as pc,gc as Ke,ha,hc as uc,ib as rc,ic as fc,ja as Xa,jb as rn,jc as go,kb as ic,kc as yo,lc as bo,ld as So,ma as Za,mb as Ve,na as Qa,nb as sc,ob as lo,pb as sn,rb as Be,sa as vt,tc as Pe,vb as ac,vc as yc,wb as cc,wc as Ac,xb as lc,xc as Rc,yc as Cc}from"./chunk-WDF7PP4P.js";import{$ as Ma,A as Xt,B as wa,C as xe,D as va,E as Zt,F as ka,G as Qt,Ga as Ua,M as Sa,P as Ia,Qa as en,R as Ea,S as Aa,T as Ra,U as Ca,Ua as kc,V as Ta,W as xa,X as Oa,Xa as Sc,Y as $a,Z as Pa,_ as Fa,aa as La,b as oa,ba as Da,ca as Na,da as ja,q as ga,w as ya,y as Te,z as ba,za as wt}from"./chunk-3AHONKLL.js";import{Ac as mo,Ia as Ga,Ja as qa,Ka as za,Na as Ha,Oa as Wa,Ob as me,Pa as Va,Qa as Ba,Sa as Oe,Ta as Ka,U as sa,Ua as Ya,Uc as po,Xa as tn,Za as Ja,Zc as uo,ad as Ec,bb as ve,cb as ec,d as ta,db as nn,f as na,s as ra,t as ia,za as aa}from"./chunk-UKLOSZV6.js";import{$b as si,$d as pt,$j as de,$n as we,A as Br,Aa as xn,Ac as jt,Ad as wi,Ak as fs,Am as Es,B as Kr,Bd as mt,Bk as yt,Cc as ci,Ck as _s,Cn as js,Dd as vi,Dk as Vt,E as Yr,Ed as ki,Ek as hs,Em as As,Fk as Jn,Gd as Ut,Gh as zi,Gk as Xn,Gn as Us,Hk as gs,Hl as ws,Hn as Gs,Ic as li,Id as Si,Ii as We,In as qs,Jd as Ii,Jh as He,Jm as Rs,Jn as zs,Kb as Lt,Kc as Ln,Kd as Ei,Km as Cs,Kn as Hs,Lc as Dn,Le as Oi,Lf as Fi,Mc as Nn,Me as $i,Mm as Ts,Mn as Ws,Nc as jn,Ne as Pi,Nh as Hi,Nj as ts,Nn as Vs,O as p,Oc as Un,Of as Mi,Oi as Vn,On as Bs,Pb as Ue,Pc as Gn,Pi as Bn,Pm as xs,Pn as Ks,Q as m,Qa as On,Qc as qn,Qn as Ys,Ra as $n,Rc as $,Rf as Li,Rn as Js,S as Jr,Sa as Pn,Sd as qe,T as ye,Ta as Fn,Td as Ee,Ud as Ai,Uj as ns,Un as Xs,Vb as ei,Vd as Ri,Vi as Wi,Vn as Kt,Wb as ti,Wc as di,Wd as Ae,Wj as os,Wn as Zs,Xb as ni,Xc as mi,Xd as Ci,Xj as rs,Xn as Qs,Yb as oi,Z as Tn,Zb as ri,Zd as H,Zi as Vi,Zj as is,_b as ii,_c as z,_j as P,ab as F,ae as Ti,ak as be,ao as A,ba as S,bb as Mt,bf as Wn,bg as zt,bj as Bi,cd as pi,cf as C,dd as ui,de as xi,df as te,dk as ht,dn as Os,ec as lt,ej as le,f as oe,fa as Xr,fc as ai,gk as Wt,gn as $s,h as Rn,ha as Zr,hj as Ki,hm as vs,hn as Ps,ia as Ot,ib as E,id as Ge,ij as Yi,j as zr,ja as $t,ji as ft,jk as gt,ka as Pt,ke as Re,kh as Ui,ki as _t,kj as Ht,kk as ss,kl as Zn,la as Ft,lb as ct,mb as Mn,md as fi,me as ze,mj as Ji,mk as Kn,ml as Qn,nd as _i,nh as Gi,o as ge,ob as Ie,of as W,ok as Yn,oo as ea,p as je,pf as qt,pn as Fs,q as Cn,qa as ce,qd as dt,qe as Gt,qm as ks,r as ae,rd as hi,re as ut,rn as Ms,s as re,sd as gi,se as Hn,sk as as,sm as Ss,t as st,td as yi,tj as Xi,tk as cs,tm as Bt,u as Hr,ud as bi,uk as ls,um as Is,vg as Di,vk as ds,wg as Ni,wj as R,wk as ms,wl as ys,xa as Qr,xj as Zi,xl as bs,xn as Ls,y as Wr,ya as at,yc as Dt,yh as qi,yj as Qi,yk as ps,yn as Ds,z as Vr,zc as Nt,zd as zn,zg as ji,zj as es,zk as us,zn as Ns}from"./chunk-J4DRE3WN.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]="cde4f476-6821-53be-b70e-62794fa2ae52")}catch{}})();var Cg=Hr,Tg=Wr,xg=Kr,Og=Vr,$g=Br;function Vc(e,t,n,o){let r=e.flag.slice(2).replace(/[-_]([a-z])/gu,(s,a)=>a.toUpperCase()),i=n.has(r);return{long:t,...o?{short:o}:{},description:e.description??`Standard pm ${e.flag} option.`,...e.required===!0?{required:!0}:{},...e.list===!0?{list:!0}:{},...e.repeatable===!0?{repeatable:!0}:{},value_type:i?"string":"boolean",...i?{value_name:e.value_name??"value"}:{}}}function Bc(e,t=[]){let n=new Set(t.flatMap(r=>r.keys)),o=[];for(let r of ks(e.map(i=>({...i})))){o.push(Vc(r,r.flag,n,r.short));for(let i of r.aliases??[])o.push(Vc(r,i,n))}return o}var Pg=Bc(Bt,ys),sm=Bc(Kt,bs);import{AsyncLocalStorage as qh}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]="176b4ac2-2c47-50d6-beee-62e1d3dc9281")}catch{}})();function Kc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function am(e){return e.brief===!0?"brief":typeof e.fields=="string"&&e.fields.trim().length>0||Array.isArray(e.fields)&&e.fields.length>0?"fields":e.compact===!0?"compact":"full"}function Ao(e,t){let n=am(t),o=n==="brief"?n:Kc(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:Kc(e.filters)?e.filters:{},projection: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]="3046466c-614c-5e2b-a156-df96fba8c483")}catch{}})();async function Yc(e,t){let n=E(t??process.cwd(),e),o=await R(n);return ht(n,o.item_format,F(o,null).type_to_folder,void 0,o.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]="f6e02611-4b44-5aa3-b762-9fd984aa12bc")}catch{}})();var cm=["invalid_envelope","source_incomplete","source_unchecked","filtered_corpus","terminal_items_excluded","strict_read_unproven","page_incomplete","count_mismatch","projection_incomplete","field_omission","omission_receipt_missing","omission_receipt_invalid","read_output_missing","read_output_invalid","read_output_dimensions_incomplete","budget_compaction","budget_omission","session_projection","invalid_item_id","duplicate_item_id"],cn=class extends Error{receipt;constructor(t){super(`Complete-list certification failed: ${t.map(n=>n.code).join(", ")}.`),this.name="PmCompleteListValidationError",this.receipt={contract_version:1,contract:"complete_list",findings:t,recovery:{suggested_retry:"pm list --all --output-include full --strict-read --no-truncate --output-budget unbounded --output-limit unbounded --json",sdk:"await client.listAllComplete()"}}}};function Ro(e={}){return{excludeTerminal:!1,full:!0,...e.includeBody===void 0?{}:{includeBody:e.includeBody},noTruncate:!0,outputBudget:"unbounded",outputLimit:"unbounded",strictRead:!0}}function pe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M(e,t,n,o){t&&e.push({code:n,message:o})}function lm(e,t){let n=pe(e.completeness)?e.completeness:{};M(t,n.status==="partial","source_incomplete","The source scan reported unreadable tracker artifacts."),M(t,n.status!=="complete"&&n.status!=="partial","source_unchecked","The source scan did not prove completeness.");let o=n.unreadable_item_count,r=n.unreadable_directory_count;M(t,n.status==="complete"&&(o!==0||r!==0)&&Number.isSafeInteger(o)&&Number.isSafeInteger(r),"source_incomplete","The source scan reports unreadable tracker artifacts despite a complete status."),M(t,n.status==="complete"&&(!Number.isSafeInteger(o)||!Number.isSafeInteger(r)||Number(o)<0||Number(r)<0),"source_unchecked","The source scan did not report safe non-negative unreadable counts.");let i=pe(e.filters)?e.filters:{},s=pe(i.runtime_filters)?i.runtime_filters:{},a=new Set(["exclude_terminal","include_body","no_truncate","runtime_filters","status","strict_read"]);return M(t,i.status!=="all"||Object.keys(s).length>0||Object.keys(i).some(c=>!a.has(c)),"filtered_corpus","The list did not explicitly select every lifecycle status."),M(t,i.exclude_terminal===!0,"terminal_items_excluded","Terminal lifecycle states were explicitly excluded."),M(t,i.strict_read!==!0,"strict_read_unproven","The result does not echo strict source-read enforcement."),i}function dm(e,t,n){M(n,e.has_more!==!1||e.next_cursor!==null||e.truncated!==!1||e.applied_limit!==void 0||t.no_truncate!==!0,"page_incomplete","Pagination or a row ceiling may have withheld items."),M(n,e.count!==e.items.length||e.total!==e.items.length,"count_mismatch","Envelope counts do not equal the returned item count.");let o=pe(e.projection)?e.projection:{};M(n,o.mode!=="full"||o.fields!==null,"projection_incomplete","The result is not the full metadata projection.");let r=pe(e.omission_receipt)?e.omission_receipt:void 0;M(n,r===void 0,"omission_receipt_missing","The result carries no field-omission receipt."),M(n,r!==void 0&&(r.has_omissions!==!1||r.omitted_field_group_count!==0||!Number.isSafeInteger(r.omitted_field_group_count)||!Array.isArray(r.omitted_field_groups)||r.omitted_field_groups.length!==0),"omission_receipt_invalid","The field-omission receipt is malformed or contradicts its no-omission claim."),M(n,r?.has_omissions===!0,"field_omission","The omission receipt reports withheld field groups.")}function mm(e){return e.contract_version!==1||e.command!=="list"||e.within_budget!==!0||e.strings_compacted!==!1||e.rows_compacted!==!1||e.result_omitted!==!1}function pm(e){if(!Array.isArray(e.requested_dimensions))return!1;let t=new Set(e.requested_dimensions);return["include","amount","cost"].every(n=>t.has(n))}function um(e,t){let n=pe(e.read_output)?e.read_output:void 0;M(t,n===void 0,"read_output_missing","The result carries no universal read-output receipt."),M(t,n!==void 0&&mm(n),"read_output_invalid","The universal read-output receipt does not prove an intact list result."),M(t,n!==void 0&&!pm(n),"read_output_dimensions_incomplete","The universal read-output receipt does not prove full, unbounded include, amount, and cost dimensions."),M(t,n?.strings_compacted===!0||n?.rows_compacted===!0||e.output_budget_truncation!==void 0,"budget_compaction","Universal output shaping compacted the result.");let o=pe(e.output_budget_exceeded)?e.output_budget_exceeded:void 0;M(t,n?.result_omitted===!0||o?.omitted_result===!0,"budget_omission","Universal output shaping omitted the useful result."),M(t,e.read_session!==void 0,"session_projection","A cross-call read session can suppress previously served facts.")}function fm(e,t){let n=e.map(o=>pe(o)&&typeof o.id=="string"?o.id.trim():"");M(t,n.some(o=>o.length===0),"invalid_item_id","Every full item row must carry a non-empty string id."),M(t,new Set(n).size!==n.length,"duplicate_item_id","Every item id must occur exactly once.")}function Jc(e){if(!pe(e)||!Array.isArray(e.items))return{ok:!1,findings:[{code:cm[0],message:"The result must be an object with an items array."}]};let t=e,n=[],o=lm(t,n);return dm(t,o,n),um(t,n),fm(t.items,n),{ok:n.length===0,findings:n}}function ln(e){let t=Jc(e);if(!t.ok)throw new cn(t.findings);let n=e;return{...n,complete_list:{contract_version:1,item_count:n.items.length,unique_item_id_count:new Set(n.items.map(o=>o.id)).size,terminal_items_included:!0,source_complete:!0,full_projection:!0,no_omissions:!0,unbounded:!0}}}function _m(e){ln(e)}import el from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0c84b11c-502f-5c33-a757-5757402357b4")}catch{}})();function Xc(e){return e.map(t=>({key:t.key,optionName:Ti(t),metadataKey:t.metadata_key,type:t.type,commands:[...t.commands],repeatable:t.repeatable,requiredOnCreate:t.required_on_create,...t.description?{description:t.description}:{}}))}function Zc(e){return e.map(t=>({command:t.command,action:t.action,arguments:t.arguments.map(n=>({name:n.name,required:n.required===!0,variadic:n.variadic===!0,description:n.description})),description:t.description,tier:t.tier??"standard",family:t.family??"extensions"}))}(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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var hm=50,ke=new Map;function Co(){ke.clear()}function Qc(e,t){let n=ke.get(e);if(n!==void 0)return n;if(ke.size>=hm){let r=ke.keys().next().value;ke.delete(r)}let o=t().catch(r=>{throw ke.get(e)===o&&ke.delete(e),r});return ke.set(e,o),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]="b841f903-6276-5067-842f-6a6bff114cec")}catch{}})();function gm(e,t,n){return JSON.stringify([el.resolve(e),el.resolve(n??process.cwd()),t.extensions.enabled,t.extensions.disabled,t.extensions.policy])}async function ym(e,t,n){let o=gm(e,t,n);return Qc(o,()=>wm(e,t,n))}async function bm(e,t={}){let n=await R(e),o=t.extensionRegistrations??(t.noExtensions===!0?null:await ym(e,n,t.cwd)),r=F(n,o),i=H(n.schema),s=pt(n.schema);return{types:[...r.types],statuses:i.definitions.map(a=>a.id),openStatus:i.open_status,closeStatus:i.close_status,canceledStatus:i.canceled_status,fields:Xc(s.definitions),extensionCommands:Zc(o?.commands??[])}}async function wm(e,t,n){let o=await Dt({pmRoot:e,settings:t,cwd:n??process.cwd(),noExtensions:!1}),r=await jt(o);try{return r.registrations}finally{try{await Nt(o,r)}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]="0c7a926a-46a2-560c-ae95-33b92b8c820e")}catch{}})();var vm={"list-all":{action:"list",options:{excludeTerminal:!1}},"list-draft":{action:"list",options:{status:"draft",excludeTerminal:!1}},"list-open":{action:"list",options:{status:"open",excludeTerminal:!1}},"list-in-progress":{action:"list",options:{status:"in_progress",excludeTerminal:!1}},"list-blocked":{action:"list",options:{status:"blocked",excludeTerminal:!1}},"list-closed":{action:"list",options:{status:"closed",excludeTerminal:!1}},"list-canceled":{action:"list",options:{status:"canceled",excludeTerminal:!1}}};function tl(e){return Object.fromEntries(Di.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var To={ctx:{action:"context"},...vm,...tl("extension"),...tl("package"),...Object.fromEntries(Ni.map(e=>[`package-${e}`,{action:e}]))};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var nl="PmCliError";function km(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=p.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function Sm(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new m(e,km(t.exitCode??p.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function xo(e){if(!(e instanceof Error)||e.name!==nl)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}import{constants as Et}from"node:fs";import{lstat as ol,mkdir as $o,open as rl}from"node:fs/promises";import ue from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function Oo(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship event ${t} must be non-empty`);return e.trim()}function Po(e,t){let n=t.require(e.kind),o=n.direction==="undirected"?[e.source,e.target].sort().join("\0"):`${e.source}\0${e.target}`;return`${n.kind}\0${o}`}function Im(e){return Object.freeze({...e,...e.payload===void 0?{}:{payload:Object.freeze(structuredClone(e.payload))}})}function Em(e,t,n,o){let r=n.require(e.kind),i=o.outgoingOne.get(`${r.kind}\0${e.source}`);if(i!==void 0&&i!==t)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=o.incomingOne.get(`${r.kind}\0${e.target}`);if(s!==void 0&&s!==t)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let a=Po(e,n),c=o.identities.get(a);if(c!==void 0&&c!==t)throw new TypeError(`Relationship edge already active: ${a}`)}function Am(e){let t=new Map;for(let n of e)n.action==="remove"?t.delete(n.relationshipId):t.set(n.relationshipId,n.edge);return t}function Rm(e,t,n){if(e.expectedVersion!==void 0&&e.expectedVersion!==t)throw new TypeError(`Relationship event version conflict: expected ${e.expectedVersion}, current ${t}`);let o=Oo(e.eventId,"eventId");if(n.has(o))throw new TypeError(`Relationship event already exists: ${o}`);if(e.action!=="add"&&e.action!=="remove"&&e.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${e.action}`);if(!Number.isFinite(Date.parse(e.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:o,relationshipId:Oo(e.relationshipId,"relationshipId"),author:Oo(e.author,"author"),timestamp:new Date(e.timestamp).toISOString()}}function Cm(e,t,n,o,r,i){let s=n.has(t);if(e.action==="add"&&s)throw new TypeError(`Relationship is already active: ${t}`);if(e.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${t}`);if(e.action==="remove")return;if(!e.edge)throw new TypeError(`Relationship ${e.action} event requires an edge`);let a=typeof e.edge.source=="string"?e.edge.source.trim():"",c=typeof e.edge.target=="string"?e.edge.target.trim():"";if(!o.has(a)||!o.has(c))throw new TypeError(`Relationship endpoint not found: ${a} -> ${c}`);let l=new Ue([a,c],[e.edge],r).edges()[0];return Em(l,t,r,i),Im(l)}var At=class{#t;#n;#o=[];#i=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(t,n={}){this.#t=new Set([...t].filter(o=>typeof o=="string").map(o=>o.trim()).filter(Boolean)),this.#n=n.registry??Lt()}get version(){return this.#o.length}events(){return Object.freeze([...this.#o])}*stream(t={}){let n=t.fromVersion??1,o=t.toVersion??this.version,r=t.batchSize??100;if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${o}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(n>o+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let i=n-1;i<o;i+=r)yield Object.freeze(this.#o.slice(i,Math.min(i+r,o)))}project(t,n,o={}){if(typeof n!="function")throw new TypeError("Relationship event projection requires a reducer");let r=t,i=0,s;for(let a of this.stream({...o,batchSize:256}))for(let c of a)r=n(r,c),i+=1,s=c;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(o.fromVersion??1)-1),processed:i,...s===void 0?{}:{asOf:s.timestamp}})}#s(t,n){let o=this.#n.require(n.kind);this.#r.identities.set(Po(n,this.#n),t),o.outgoing==="one"&&this.#r.outgoingOne.set(`${o.kind}\0${n.source}`,t),o.incoming==="one"&&this.#r.incomingOne.set(`${o.kind}\0${n.target}`,t)}#a(t){let n=this.#n.require(t.kind);this.#r.identities.delete(Po(t,this.#n)),n.outgoing==="one"&&this.#r.outgoingOne.delete(`${n.kind}\0${t.source}`),n.incoming==="one"&&this.#r.incomingOne.delete(`${n.kind}\0${t.target}`)}append(t){let n=Rm(t,this.version,this.#i),o=this.#e.get(n.relationshipId),r=Cm(t,n.relationshipId,this.#e,this.#t,this.#n,this.#r),i=Object.freeze({eventId:n.eventId,relationshipId:n.relationshipId,action:t.action,...r===void 0?{}:{edge:r},author:n.author,timestamp:n.timestamp,...t.reason?.trim()?{reason:t.reason.trim()}:{},sequence:this.version+1});return this.#o.push(i),this.#i.add(n.eventId),o&&this.#a(o),t.action==="remove"?this.#e.delete(n.relationshipId):(this.#e.set(n.relationshipId,r),this.#s(n.relationshipId,r)),i}snapshot(t={}){if(t.atVersion!==void 0&&t.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let n;if(t.atTimestamp!==void 0){let i=Date.parse(t.atTimestamp);if(!Number.isFinite(i))throw new TypeError("Relationship snapshot timestamp must be valid");n=this.#o.filter(s=>Date.parse(s.timestamp)<=i)}else{let i=t.atVersion??this.version;if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship snapshot version out of range: ${i}`);n=this.#o.slice(0,i)}let o=Am(n),r=new Ue(this.#t,o.values(),this.#n);return Object.freeze({version:n.at(-1)?.sequence??0,...n.at(-1)?{asOf:n.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(t){if(!Number.isInteger(t.limit)||t.limit<1)throw new TypeError("Relationship event page limit must be positive");let n=Fi("relationship-events",{order:"append-sequence"}),o=t.cursor===void 0?this.version:Number(Mi(t.cursor,n).snapshot);if(!Number.isSafeInteger(o)||o<0||o>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=Li(this.#o.slice(0,o),{cursor:t.cursor,fingerprint:n,limit:t.limit,readId:i=>i.eventId,snapshot:String(o)});return{version:o,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},Tm="relationship-event-store",il=Et.O_NOFOLLOW;function dn(e){return te(e,Tm,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function Fe(e,t="relationships/events.jsonl"){let n=ue.resolve(e),o=ue.resolve(n,t),r=ue.relative(n,o);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${ue.sep}`)||ue.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await $o(n,{recursive:!0}),(await ol(n)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=n;for(let a of r.split(ue.sep)){s=ue.join(s,a);try{if((await ol(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(Cn(c))break;throw c}}return o}async function mn(e,t,n){let o=new At(t,{registry:n}),r,i;try{i=await rl(e,Et.O_RDONLY|il),r=await i.readFile("utf8")}catch(a){if(Cn(a))return{log:o,raw:""};throw a}finally{await i?.close()}let s=r.split(`
1
+ import{a as gc,b as Ye,c as an,d as bc,e as wc,h as vc}from"./chunk-DN2RIHRN.js";import{J as vo,L as Ic,M as Lc,O as Dc,Q as Nc,R as jc,a as kt,b as co,d as $e,e as _c,j as hc,p as wo}from"./chunk-T526C5DX.js";import{$ as io,Bc as Tc,Cc as xc,Dc as Oc,Eb as St,Ec as $c,Ed as Io,F as bt,Fb as fo,Fc as Pc,Fd as Eo,G as g,H as ca,Hb as dc,Hc as Fc,Hd as zc,I as la,Ic as Mc,K as Z,L as da,M as Yt,Ma as tc,Mb as _o,Mc as ko,N as ma,Na as so,O as eo,Od as Hc,P as Jt,Pa as nc,Pd as Wc,Q as to,Qa as oc,R as Ce,Ra as ao,S as pa,T as no,Tc as Uc,U as V,Uc as Gc,V as oo,W as G,Wc as qc,X as ua,Y as fa,Z as ro,_ as _a,bb as on,cc as It,dc as ho,ec as mc,fc as pc,gc as Ke,ha,hc as uc,ib as rc,ic as fc,ja as Xa,jb as rn,jc as go,kb as ic,kc as yo,lc as bo,ld as So,ma as Za,mb as Ve,na as Qa,nb as sc,ob as lo,pb as sn,rb as Be,sa as vt,tc as Pe,vb as ac,vc as yc,wb as cc,wc as Ac,xb as lc,xc as Rc,yc as Cc}from"./chunk-YZXB4XGA.js";import{$ as Ma,A as Xt,B as wa,C as xe,D as va,E as Zt,F as ka,G as Qt,Ga as Ua,M as Sa,P as Ia,Qa as en,R as Ea,S as Aa,T as Ra,U as Ca,Ua as kc,V as Ta,W as xa,X as Oa,Xa as Sc,Y as $a,Z as Pa,_ as Fa,aa as La,b as oa,ba as Da,ca as Na,da as ja,q as ga,w as ya,y as Te,z as ba,za as wt}from"./chunk-G2IJF244.js";import{Ac as mo,Ia as Ga,Ja as qa,Ka as za,Na as Ha,Oa as Wa,Ob as me,Pa as Va,Qa as Ba,Sa as Oe,Ta as Ka,U as sa,Ua as Ya,Uc as po,Xa as tn,Za as Ja,Zc as uo,ad as Ec,bb as ve,cb as ec,d as ta,db as nn,f as na,s as ra,t as ia,za as aa}from"./chunk-C3MFMGCR.js";import{$b as si,$d as pt,$j as de,$n as we,A as Br,Aa as xn,Ac as jt,Ad as wi,Ak as fs,Am as Es,B as Kr,Bd as mt,Bk as yt,Cc as ci,Ck as _s,Cn as js,Dd as vi,Dk as Vt,E as Yr,Ed as ki,Ek as hs,Em as As,Fk as Jn,Gd as Ut,Gh as zi,Gk as Xn,Gn as Us,Hk as gs,Hl as ws,Hn as Gs,Ic as li,Id as Si,Ii as We,In as qs,Jd as Ii,Jh as He,Jm as Rs,Jn as zs,Kb as Lt,Kc as Ln,Kd as Ei,Km as Cs,Kn as Hs,Lc as Dn,Le as Oi,Lf as Fi,Mc as Nn,Me as $i,Mm as Ts,Mn as Ws,Nc as jn,Ne as Pi,Nh as Hi,Nj as ts,Nn as Vs,O as p,Oc as Un,Of as Mi,Oi as Vn,On as Bs,Pb as Ue,Pc as Gn,Pi as Bn,Pm as xs,Pn as Ks,Q as m,Qa as On,Qc as qn,Qn as Ys,Ra as $n,Rc as $,Rf as Li,Rn as Js,S as Jr,Sa as Pn,Sd as qe,T as ye,Ta as Fn,Td as Ee,Ud as Ai,Uj as ns,Un as Xs,Vb as ei,Vd as Ri,Vi as Wi,Vn as Kt,Wb as ti,Wc as di,Wd as Ae,Wj as os,Wn as Zs,Xb as ni,Xc as mi,Xd as Ci,Xj as rs,Xn as Qs,Yb as oi,Z as Tn,Zb as ri,Zd as H,Zi as Vi,Zj as is,_b as ii,_c as z,_j as P,ab as F,ae as Ti,ak as be,ao as A,ba as S,bb as Mt,bf as Wn,bg as zt,bj as Bi,cd as pi,cf as C,dd as ui,de as xi,df as te,dk as ht,dn as Os,ec as lt,ej as le,f as oe,fa as Xr,fc as ai,gk as Wt,gn as $s,h as Rn,ha as Zr,hj as Ki,hm as vs,hn as Ps,ia as Ot,ib as E,id as Ge,ij as Yi,j as zr,ja as $t,ji as ft,jk as gt,ka as Pt,ke as Re,kh as Ui,ki as _t,kj as Ht,kk as ss,kl as Zn,la as Ft,lb as ct,mb as Mn,md as fi,me as ze,mj as Ji,mk as Kn,ml as Qn,nd as _i,nh as Gi,o as ge,ob as Ie,of as W,ok as Yn,oo as ea,p as je,pf as qt,pn as Fs,q as Cn,qa as ce,qd as dt,qe as Gt,qm as ks,r as ae,rd as hi,re as ut,rn as Ms,s as re,sd as gi,se as Hn,sk as as,sm as Ss,t as st,td as yi,tj as Xi,tk as cs,tm as Bt,u as Hr,ud as bi,uk as ls,um as Is,vg as Di,vk as ds,wg as Ni,wj as R,wk as ms,wl as ys,xa as Qr,xj as Zi,xl as bs,xn as Ls,y as Wr,ya as at,yc as Dt,yh as qi,yj as Qi,yk as ps,yn as Ds,z as Vr,zc as Nt,zd as zn,zg as ji,zj as es,zk as us,zn as Ns}from"./chunk-UJSB6NO6.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]="cde4f476-6821-53be-b70e-62794fa2ae52")}catch{}})();var Cg=Hr,Tg=Wr,xg=Kr,Og=Vr,$g=Br;function Vc(e,t,n,o){let r=e.flag.slice(2).replace(/[-_]([a-z])/gu,(s,a)=>a.toUpperCase()),i=n.has(r);return{long:t,...o?{short:o}:{},description:e.description??`Standard pm ${e.flag} option.`,...e.required===!0?{required:!0}:{},...e.list===!0?{list:!0}:{},...e.repeatable===!0?{repeatable:!0}:{},value_type:i?"string":"boolean",...i?{value_name:e.value_name??"value"}:{}}}function Bc(e,t=[]){let n=new Set(t.flatMap(r=>r.keys)),o=[];for(let r of ks(e.map(i=>({...i})))){o.push(Vc(r,r.flag,n,r.short));for(let i of r.aliases??[])o.push(Vc(r,i,n))}return o}var Pg=Bc(Bt,ys),sm=Bc(Kt,bs);import{AsyncLocalStorage as qh}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]="176b4ac2-2c47-50d6-beee-62e1d3dc9281")}catch{}})();function Kc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function am(e){return e.brief===!0?"brief":typeof e.fields=="string"&&e.fields.trim().length>0||Array.isArray(e.fields)&&e.fields.length>0?"fields":e.compact===!0?"compact":"full"}function Ao(e,t){let n=am(t),o=n==="brief"?n:Kc(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:Kc(e.filters)?e.filters:{},projection: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]="3046466c-614c-5e2b-a156-df96fba8c483")}catch{}})();async function Yc(e,t){let n=E(t??process.cwd(),e),o=await R(n);return ht(n,o.item_format,F(o,null).type_to_folder,void 0,o.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]="f6e02611-4b44-5aa3-b762-9fd984aa12bc")}catch{}})();var cm=["invalid_envelope","source_incomplete","source_unchecked","filtered_corpus","terminal_items_excluded","strict_read_unproven","page_incomplete","count_mismatch","projection_incomplete","field_omission","omission_receipt_missing","omission_receipt_invalid","read_output_missing","read_output_invalid","read_output_dimensions_incomplete","budget_compaction","budget_omission","session_projection","invalid_item_id","duplicate_item_id"],cn=class extends Error{receipt;constructor(t){super(`Complete-list certification failed: ${t.map(n=>n.code).join(", ")}.`),this.name="PmCompleteListValidationError",this.receipt={contract_version:1,contract:"complete_list",findings:t,recovery:{suggested_retry:"pm list --all --output-include full --strict-read --no-truncate --output-budget unbounded --output-limit unbounded --json",sdk:"await client.listAllComplete()"}}}};function Ro(e={}){return{excludeTerminal:!1,full:!0,...e.includeBody===void 0?{}:{includeBody:e.includeBody},noTruncate:!0,outputBudget:"unbounded",outputLimit:"unbounded",strictRead:!0}}function pe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M(e,t,n,o){t&&e.push({code:n,message:o})}function lm(e,t){let n=pe(e.completeness)?e.completeness:{};M(t,n.status==="partial","source_incomplete","The source scan reported unreadable tracker artifacts."),M(t,n.status!=="complete"&&n.status!=="partial","source_unchecked","The source scan did not prove completeness.");let o=n.unreadable_item_count,r=n.unreadable_directory_count;M(t,n.status==="complete"&&(o!==0||r!==0)&&Number.isSafeInteger(o)&&Number.isSafeInteger(r),"source_incomplete","The source scan reports unreadable tracker artifacts despite a complete status."),M(t,n.status==="complete"&&(!Number.isSafeInteger(o)||!Number.isSafeInteger(r)||Number(o)<0||Number(r)<0),"source_unchecked","The source scan did not report safe non-negative unreadable counts.");let i=pe(e.filters)?e.filters:{},s=pe(i.runtime_filters)?i.runtime_filters:{},a=new Set(["exclude_terminal","include_body","no_truncate","runtime_filters","status","strict_read"]);return M(t,i.status!=="all"||Object.keys(s).length>0||Object.keys(i).some(c=>!a.has(c)),"filtered_corpus","The list did not explicitly select every lifecycle status."),M(t,i.exclude_terminal===!0,"terminal_items_excluded","Terminal lifecycle states were explicitly excluded."),M(t,i.strict_read!==!0,"strict_read_unproven","The result does not echo strict source-read enforcement."),i}function dm(e,t,n){M(n,e.has_more!==!1||e.next_cursor!==null||e.truncated!==!1||e.applied_limit!==void 0||t.no_truncate!==!0,"page_incomplete","Pagination or a row ceiling may have withheld items."),M(n,e.count!==e.items.length||e.total!==e.items.length,"count_mismatch","Envelope counts do not equal the returned item count.");let o=pe(e.projection)?e.projection:{};M(n,o.mode!=="full"||o.fields!==null,"projection_incomplete","The result is not the full metadata projection.");let r=pe(e.omission_receipt)?e.omission_receipt:void 0;M(n,r===void 0,"omission_receipt_missing","The result carries no field-omission receipt."),M(n,r!==void 0&&(r.has_omissions!==!1||r.omitted_field_group_count!==0||!Number.isSafeInteger(r.omitted_field_group_count)||!Array.isArray(r.omitted_field_groups)||r.omitted_field_groups.length!==0),"omission_receipt_invalid","The field-omission receipt is malformed or contradicts its no-omission claim."),M(n,r?.has_omissions===!0,"field_omission","The omission receipt reports withheld field groups.")}function mm(e){return e.contract_version!==1||e.command!=="list"||e.within_budget!==!0||e.strings_compacted!==!1||e.rows_compacted!==!1||e.result_omitted!==!1}function pm(e){if(!Array.isArray(e.requested_dimensions))return!1;let t=new Set(e.requested_dimensions);return["include","amount","cost"].every(n=>t.has(n))}function um(e,t){let n=pe(e.read_output)?e.read_output:void 0;M(t,n===void 0,"read_output_missing","The result carries no universal read-output receipt."),M(t,n!==void 0&&mm(n),"read_output_invalid","The universal read-output receipt does not prove an intact list result."),M(t,n!==void 0&&!pm(n),"read_output_dimensions_incomplete","The universal read-output receipt does not prove full, unbounded include, amount, and cost dimensions."),M(t,n?.strings_compacted===!0||n?.rows_compacted===!0||e.output_budget_truncation!==void 0,"budget_compaction","Universal output shaping compacted the result.");let o=pe(e.output_budget_exceeded)?e.output_budget_exceeded:void 0;M(t,n?.result_omitted===!0||o?.omitted_result===!0,"budget_omission","Universal output shaping omitted the useful result."),M(t,e.read_session!==void 0,"session_projection","A cross-call read session can suppress previously served facts.")}function fm(e,t){let n=e.map(o=>pe(o)&&typeof o.id=="string"?o.id.trim():"");M(t,n.some(o=>o.length===0),"invalid_item_id","Every full item row must carry a non-empty string id."),M(t,new Set(n).size!==n.length,"duplicate_item_id","Every item id must occur exactly once.")}function Jc(e){if(!pe(e)||!Array.isArray(e.items))return{ok:!1,findings:[{code:cm[0],message:"The result must be an object with an items array."}]};let t=e,n=[],o=lm(t,n);return dm(t,o,n),um(t,n),fm(t.items,n),{ok:n.length===0,findings:n}}function ln(e){let t=Jc(e);if(!t.ok)throw new cn(t.findings);let n=e;return{...n,complete_list:{contract_version:1,item_count:n.items.length,unique_item_id_count:new Set(n.items.map(o=>o.id)).size,terminal_items_included:!0,source_complete:!0,full_projection:!0,no_omissions:!0,unbounded:!0}}}function _m(e){ln(e)}import el from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0c84b11c-502f-5c33-a757-5757402357b4")}catch{}})();function Xc(e){return e.map(t=>({key:t.key,optionName:Ti(t),metadataKey:t.metadata_key,type:t.type,commands:[...t.commands],repeatable:t.repeatable,requiredOnCreate:t.required_on_create,...t.description?{description:t.description}:{}}))}function Zc(e){return e.map(t=>({command:t.command,action:t.action,arguments:t.arguments.map(n=>({name:n.name,required:n.required===!0,variadic:n.variadic===!0,description:n.description})),description:t.description,tier:t.tier??"standard",family:t.family??"extensions"}))}(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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var hm=50,ke=new Map;function Co(){ke.clear()}function Qc(e,t){let n=ke.get(e);if(n!==void 0)return n;if(ke.size>=hm){let r=ke.keys().next().value;ke.delete(r)}let o=t().catch(r=>{throw ke.get(e)===o&&ke.delete(e),r});return ke.set(e,o),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]="b841f903-6276-5067-842f-6a6bff114cec")}catch{}})();function gm(e,t,n){return JSON.stringify([el.resolve(e),el.resolve(n??process.cwd()),t.extensions.enabled,t.extensions.disabled,t.extensions.policy])}async function ym(e,t,n){let o=gm(e,t,n);return Qc(o,()=>wm(e,t,n))}async function bm(e,t={}){let n=await R(e),o=t.extensionRegistrations??(t.noExtensions===!0?null:await ym(e,n,t.cwd)),r=F(n,o),i=H(n.schema),s=pt(n.schema);return{types:[...r.types],statuses:i.definitions.map(a=>a.id),openStatus:i.open_status,closeStatus:i.close_status,canceledStatus:i.canceled_status,fields:Xc(s.definitions),extensionCommands:Zc(o?.commands??[])}}async function wm(e,t,n){let o=await Dt({pmRoot:e,settings:t,cwd:n??process.cwd(),noExtensions:!1}),r=await jt(o);try{return r.registrations}finally{try{await Nt(o,r)}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]="0c7a926a-46a2-560c-ae95-33b92b8c820e")}catch{}})();var vm={"list-all":{action:"list",options:{excludeTerminal:!1}},"list-draft":{action:"list",options:{status:"draft",excludeTerminal:!1}},"list-open":{action:"list",options:{status:"open",excludeTerminal:!1}},"list-in-progress":{action:"list",options:{status:"in_progress",excludeTerminal:!1}},"list-blocked":{action:"list",options:{status:"blocked",excludeTerminal:!1}},"list-closed":{action:"list",options:{status:"closed",excludeTerminal:!1}},"list-canceled":{action:"list",options:{status:"canceled",excludeTerminal:!1}}};function tl(e){return Object.fromEntries(Di.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var To={ctx:{action:"context"},...vm,...tl("extension"),...tl("package"),...Object.fromEntries(Ni.map(e=>[`package-${e}`,{action:e}]))};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var nl="PmCliError";function km(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=p.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function Sm(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new m(e,km(t.exitCode??p.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function xo(e){if(!(e instanceof Error)||e.name!==nl)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}import{constants as Et}from"node:fs";import{lstat as ol,mkdir as $o,open as rl}from"node:fs/promises";import ue from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function Oo(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship event ${t} must be non-empty`);return e.trim()}function Po(e,t){let n=t.require(e.kind),o=n.direction==="undirected"?[e.source,e.target].sort().join("\0"):`${e.source}\0${e.target}`;return`${n.kind}\0${o}`}function Im(e){return Object.freeze({...e,...e.payload===void 0?{}:{payload:Object.freeze(structuredClone(e.payload))}})}function Em(e,t,n,o){let r=n.require(e.kind),i=o.outgoingOne.get(`${r.kind}\0${e.source}`);if(i!==void 0&&i!==t)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=o.incomingOne.get(`${r.kind}\0${e.target}`);if(s!==void 0&&s!==t)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let a=Po(e,n),c=o.identities.get(a);if(c!==void 0&&c!==t)throw new TypeError(`Relationship edge already active: ${a}`)}function Am(e){let t=new Map;for(let n of e)n.action==="remove"?t.delete(n.relationshipId):t.set(n.relationshipId,n.edge);return t}function Rm(e,t,n){if(e.expectedVersion!==void 0&&e.expectedVersion!==t)throw new TypeError(`Relationship event version conflict: expected ${e.expectedVersion}, current ${t}`);let o=Oo(e.eventId,"eventId");if(n.has(o))throw new TypeError(`Relationship event already exists: ${o}`);if(e.action!=="add"&&e.action!=="remove"&&e.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${e.action}`);if(!Number.isFinite(Date.parse(e.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:o,relationshipId:Oo(e.relationshipId,"relationshipId"),author:Oo(e.author,"author"),timestamp:new Date(e.timestamp).toISOString()}}function Cm(e,t,n,o,r,i){let s=n.has(t);if(e.action==="add"&&s)throw new TypeError(`Relationship is already active: ${t}`);if(e.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${t}`);if(e.action==="remove")return;if(!e.edge)throw new TypeError(`Relationship ${e.action} event requires an edge`);let a=typeof e.edge.source=="string"?e.edge.source.trim():"",c=typeof e.edge.target=="string"?e.edge.target.trim():"";if(!o.has(a)||!o.has(c))throw new TypeError(`Relationship endpoint not found: ${a} -> ${c}`);let l=new Ue([a,c],[e.edge],r).edges()[0];return Em(l,t,r,i),Im(l)}var At=class{#t;#n;#o=[];#i=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(t,n={}){this.#t=new Set([...t].filter(o=>typeof o=="string").map(o=>o.trim()).filter(Boolean)),this.#n=n.registry??Lt()}get version(){return this.#o.length}events(){return Object.freeze([...this.#o])}*stream(t={}){let n=t.fromVersion??1,o=t.toVersion??this.version,r=t.batchSize??100;if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${o}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(n>o+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let i=n-1;i<o;i+=r)yield Object.freeze(this.#o.slice(i,Math.min(i+r,o)))}project(t,n,o={}){if(typeof n!="function")throw new TypeError("Relationship event projection requires a reducer");let r=t,i=0,s;for(let a of this.stream({...o,batchSize:256}))for(let c of a)r=n(r,c),i+=1,s=c;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(o.fromVersion??1)-1),processed:i,...s===void 0?{}:{asOf:s.timestamp}})}#s(t,n){let o=this.#n.require(n.kind);this.#r.identities.set(Po(n,this.#n),t),o.outgoing==="one"&&this.#r.outgoingOne.set(`${o.kind}\0${n.source}`,t),o.incoming==="one"&&this.#r.incomingOne.set(`${o.kind}\0${n.target}`,t)}#a(t){let n=this.#n.require(t.kind);this.#r.identities.delete(Po(t,this.#n)),n.outgoing==="one"&&this.#r.outgoingOne.delete(`${n.kind}\0${t.source}`),n.incoming==="one"&&this.#r.incomingOne.delete(`${n.kind}\0${t.target}`)}append(t){let n=Rm(t,this.version,this.#i),o=this.#e.get(n.relationshipId),r=Cm(t,n.relationshipId,this.#e,this.#t,this.#n,this.#r),i=Object.freeze({eventId:n.eventId,relationshipId:n.relationshipId,action:t.action,...r===void 0?{}:{edge:r},author:n.author,timestamp:n.timestamp,...t.reason?.trim()?{reason:t.reason.trim()}:{},sequence:this.version+1});return this.#o.push(i),this.#i.add(n.eventId),o&&this.#a(o),t.action==="remove"?this.#e.delete(n.relationshipId):(this.#e.set(n.relationshipId,r),this.#s(n.relationshipId,r)),i}snapshot(t={}){if(t.atVersion!==void 0&&t.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let n;if(t.atTimestamp!==void 0){let i=Date.parse(t.atTimestamp);if(!Number.isFinite(i))throw new TypeError("Relationship snapshot timestamp must be valid");n=this.#o.filter(s=>Date.parse(s.timestamp)<=i)}else{let i=t.atVersion??this.version;if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship snapshot version out of range: ${i}`);n=this.#o.slice(0,i)}let o=Am(n),r=new Ue(this.#t,o.values(),this.#n);return Object.freeze({version:n.at(-1)?.sequence??0,...n.at(-1)?{asOf:n.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(t){if(!Number.isInteger(t.limit)||t.limit<1)throw new TypeError("Relationship event page limit must be positive");let n=Fi("relationship-events",{order:"append-sequence"}),o=t.cursor===void 0?this.version:Number(Mi(t.cursor,n).snapshot);if(!Number.isSafeInteger(o)||o<0||o>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=Li(this.#o.slice(0,o),{cursor:t.cursor,fingerprint:n,limit:t.limit,readId:i=>i.eventId,snapshot:String(o)});return{version:o,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},Tm="relationship-event-store",il=Et.O_NOFOLLOW;function dn(e){return te(e,Tm,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function Fe(e,t="relationships/events.jsonl"){let n=ue.resolve(e),o=ue.resolve(n,t),r=ue.relative(n,o);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${ue.sep}`)||ue.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await $o(n,{recursive:!0}),(await ol(n)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=n;for(let a of r.split(ue.sep)){s=ue.join(s,a);try{if((await ol(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(Cn(c))break;throw c}}return o}async function mn(e,t,n){let o=new At(t,{registry:n}),r,i;try{i=await rl(e,Et.O_RDONLY|il),r=await i.readFile("utf8")}catch(a){if(Cn(a))return{log:o,raw:""};throw a}finally{await i?.close()}let s=r.split(`
2
2
  `);for(let a=0;a<s.length;a+=1){let c=s[a].trim();if(!c)continue;let l;try{l=JSON.parse(c)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${a+1}`)}if(l.sequence!==o.version+1)throw new TypeError(`Invalid relationship event sequence at line ${a+1}`);o.append({eventId:l.eventId,relationshipId:l.relationshipId,action:l.action,...l.edge===void 0?{}:{edge:l.edge},author:l.author,timestamp:l.timestamp,...l.reason===void 0?{}:{reason:l.reason},expectedVersion:o.version})}return{log:o,raw:r}}function xm(e,t,n,o){let r=Date.parse(t.timestamp),i;return t.action!=="remove"&&t.edge!==void 0&&(i=new Ue(n,[t.edge],o).edges()[0]),e.eventId===t.eventId.trim()&&e.relationshipId===t.relationshipId.trim()&&e.action===t.action&&e.author===t.author.trim()&&Number.isFinite(r)&&e.timestamp===new Date(r).toISOString()&&e.reason===(t.reason?.trim()||void 0)&&lt(e.edge)===lt(i)}var pn=class e{#t;#n;#o;#i;#e;constructor(t,n,o,r){this.#t=t.pmRoot,this.#n=n,this.#o=t.registry,this.#i=o,this.#e=r}static async open(t){let n=Object.freeze([...t.nodes]),o=await Fe(t.pmRoot,t.relativePath),r=await dn(t.pmRoot);try{await Fe(t.pmRoot,o);let{log:i}=await mn(o,n,t.registry);return new e(t,n,o,i)}finally{await r()}}get path(){return this.#i}async currentVersion(){return this.#e=await this.#r(),this.#e.version}async append(t){let n=await dn(this.#t);try{let o=await Fe(this.#t,this.#i),{log:r}=await mn(o,this.#n,this.#o),i=r.append(t);await $o(ue.dirname(o),{recursive:!0}),await Fe(this.#t,o);let s=await rl(o,Et.O_APPEND|Et.O_CREAT|Et.O_WRONLY|il);try{await s.appendFile(`${JSON.stringify(i)}
3
3
  `,"utf8")}finally{await s.close()}return this.#e=r,i}finally{await n()}}async appendBatch(t,n={}){let o=await dn(this.#t);try{let r=await Fe(this.#t,this.#i),{log:i,raw:s}=await mn(r,this.#n,this.#o),a=i.version,c=new Map(i.events().map(d=>[d.eventId,d])),l=[],u=[];for(let d of t){let f=d.eventId.trim(),h=c.get(f);if(h!==void 0){if(n.existingEventPolicy==="skip_identical"&&xm(h,d,this.#n,this.#o)){u.push(h.eventId);continue}if(n.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${f}`)}let w=i.append(d);c.set(w.eventId,w),l.push(w)}if(l.length>0){let d=s.length===0||s.endsWith(`
4
4
  `)?s:`${s}
@@ -2244,4 +2244,4 @@ end`}var _h={bash:'Add to ~/.bashrc or ~/.bash_profile: eval "$(pm completion ba
2244
2244
  `);N(e.progressEnabled,"writing keyword artifacts"),await re(t,`${JSON.stringify(e.manifest,null,2)}
2245
2245
  `),await re(n,`${r}
2246
2246
  `);let i=[];if(e.mode!=="keyword")try{N(e.progressEnabled,"writing vectorization status ledger"),await gs(e.pmRoot,e.vectorizationLedgerEntries,e.vectorizationEmbeddingMetadata)}catch(s){i.push(`search_vectorization_status_ledger_write_failed:${s instanceof Error?s.message:String(s)}`)}return i}async function Gh(e,t){let n=wh(e.mode),o=bh(e),r=e.full===!0;N(o,`start mode=${n}`);let i=E(process.cwd(),t.path);await P(i);let s=Qi(await R(i)).settings,a=null;try{a=await te(i,es,s.locks.ttl_seconds,C(void 0,"pm-reindex"),!1,s.governance.force_required_for_stale_lock,s.locks.wait_ms)}catch(c){throw c instanceof m&&c.exitCode===p.CONFLICT?new m("Another pm reindex run is already active for this project. Wait for it to finish before starting a new keyword, semantic, or hybrid reindex.",p.CONFLICT,{code:"reindex_already_running",type:"urn:pm-cli:error:reindex_already_running",why:"Semantic reindex can be expensive and duplicate runs compete for the same local embedding model and vector store.",nextSteps:["Check active pm reindex processes before starting another reindex.","Rerun with --progress when you need non-interactive visibility."]}):c}try{let c=Sh(s),l=Ih(s),u=xh({requestedMode:n,pmRoot:i,settings:s,extensionEmbedding:c,extensionVectorAdapter:l}),d=n;N(o,"loading item corpus");let f=await Oh({pmRoot:i,settings:s}),h=f.warnings,{documentCandidates:w,metadataDocuments:k}=f;N(o,`loaded_items=${k.length}`);let y=S(),v=Th(d,y,k),_=xt.join(i,Dr),I=xt.join(i,Nr),x=d==="keyword"?await Ur(i,w,s.schema,h):k,L=[],q={},O=null,K=Ch(d);if(d==="keyword"&&await $h({pmRoot:i,settings:s,forceFullSemantic:r,extensionEmbedding:c,reindexWarnings:h}),d!=="keyword"){let ne=await jh({pmRoot:i,settings:s,requestedMode:n,activeEmbeddingProvider:u.activeEmbeddingProvider,activeVectorStore:u.activeVectorStore,extensionEmbedding:c,extensionVectorAdapter:l,documentCandidates:w,metadataDocuments:k,documentsForKeywordArtifacts:x,forceFullSemantic:r,reindexWarnings:h,semanticWarnings:L,semanticSummary:K,progressEnabled:o});x=ne.documentsForKeywordArtifacts,q=ne.vectorizationLedgerEntries,O=ne.vectorizationEmbeddingMetadata}let T=await Uh({pmRoot:i,mode:d,manifest:v,documentsForKeywordArtifacts:x,settings:s,vectorizationLedgerEntries:q,vectorizationEmbeddingMetadata:O,progressEnabled:o}),ee=[...await z({path:_,scope:"project",op:"reindex:manifest"}),...await z({path:I,scope:"project",op:"reindex:embeddings"}),...await pi({mode:d,total_items:k.length})];return N(o,"done"),{ok:!0,mode:d,total_items:k.length,semantic:K,artifacts:{manifest:Dr,embeddings:Nr},warnings:[...h,...L,...T,...ee],generated_at:y}}finally{await 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]="2a537d27-e794-5aa6-946f-4b2a3102b0ab")}catch{}})();var em=Symbol("pm.active-extension-host-context");function X(e){return{fullChangedFields:!0,options:e}}var b=class e{defaults;constructor(t={}){this.defaults={...t.pmRoot===void 0?{}:{path:t.pmRoot},...t.cwd===void 0?{}:{cwd:t.cwd},...t.author===void 0?{}:{author:t.author},...t.noExtensions===void 0?{}:{noExtensions:t.noExtensions}}}static forActiveExtensionHost(t){let n=new e({...t,noExtensions:!0});return n.defaults[em]=!0,n}run(t,n={}){return Vh({...this.defaults,...n,action:t})}runTyped(t,n={}){return this.run(t,n)}context(t={}){return this.runTyped("context",{options:t})}listAllItemMetadataLight(){return Yc(this.defaults.path,this.defaults.cwd)}list(t={}){return this.runTyped("list",{options:t})}async listAllComplete(t={}){return ln(await this.list(Ro(t)))}search(t,n={}){return this.runTyped("search",{query:t,options:n})}get(t,n={}){return this.runTyped("get",{id:t,options:n})}next(t={}){return this.runTyped("next",{options:t})}aggregate(t={}){return this.runTyped("aggregate",{options:t})}stats(t={}){return this.runTyped("stats",{options:t})}duplicates(t={}){return this.runTyped("duplicates",{options:t})}comments(t,n={}){return this.runTyped("comments",{id:t,options:n})}notes(t,n={}){return this.runTyped("notes",{id:t,options:n})}learnings(t,n={}){return this.runTyped("learnings",{id:t,options:n})}files(t,n={}){return this.runTyped("files",{id:t,options:n})}filesDiscover(t,n={}){return this.runTyped("files-discover",{id:t,options:n})}filesLookup(t){return this.runTyped("files-lookup",{options:t})}docs(t,n={}){return this.runTyped("docs",{id:t,options:n})}deps(t,n={}){return this.runTyped("deps",{id:t,options:n})}graph(t,n={},o={}){return this.runTyped("graph",{subcommand:t,...n,options:o})}append(t,n,o={}){return this.runTyped("append",{id:t,...X(bt(o,{body:n}))})}init(t,n={}){return this.runTyped("init",{...t===void 0?{}:{prefix:t},options:n})}config(t,n,o,r,i={}){return this.runTyped("config",{scope:t,configAction:n,...o===void 0?{}:{key:o},...r===void 0?{}:{value:r},options:i})}schema(t,n={}){return this.runTyped("schema",{options:{...n,subcommand:t}})}workflowPolicy(t,n,o={}){return this.runTyped("schema",{name:n,options:{...o,subcommand:t}})}schemaList(){return this.runTyped("schema",{options:{subcommand:"list"}})}schemaShow(t){return this.runTyped("schema",{name:t,options:{subcommand:"show"}})}schemaAddType(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-type"}})}schemaRemoveType(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-type"}})}schemaAddStatus(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-status"}})}schemaRemoveStatus(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-status"}})}schemaAddField(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-field"}})}schemaRemoveField(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-field"}})}schemaListFields(){return this.runTyped("schema",{options:{subcommand:"list-fields"}})}schemaShowField(t){return this.runTyped("schema",{name:t,options:{subcommand:"show-field"}})}schemaApplyPreset(t,n={}){return this.runTyped("schema",{typePreset:t,options:{...n,subcommand:"apply-preset"}})}schemaInferTypes(t={}){return this.runTyped("schema",{options:{...t,subcommand:"add-type",infer:!0}})}schemaRenameType(t,n,o){return this.runTyped("schema",{name:t,options:{...o,subcommand:"rename-type",to:n}})}schemaRenameField(t,n,o,r){return this.runTyped("schema",{name:t,options:{...o,subcommand:"rename-field",to:n,...r?{fieldTypeScope:r}:{}}})}schemaRemapStatus(t,n,o){return this.runTyped("schema",{name:t,options:{...o,subcommand:"remap-status",to:n}})}schemaShowStatus(t){return this.runTyped("schema",{name:t,options:{subcommand:"show-status"}})}profile(t,n={}){return this.runTyped("profile",{options:{...n,subcommand:t}})}profileList(){return this.runTyped("profile",{options:{subcommand:"list"}})}profileShow(t){return this.runTyped("profile",{name:t,options:{subcommand:"show"}})}profileApply(t,n={}){return this.runTyped("profile",{name:t,options:{...n,subcommand:"apply"}})}profileLint(t){return this.runTyped("profile",{name:t,options:{subcommand:"lint"}})}validate(t={}){return this.runTyped("validate",{options:t})}health(t={}){return this.runTyped("health",{options:t})}gc(t={}){return this.runTyped("gc",{options:t})}assurance(t){return this.runTyped("assurance",{options:{...t,subcommand:t.action}})}historyRedact(t,n){return this.runTyped("history-redact",{id:t,options:n})}historyRepair(t,n={}){return this.runTyped("history-repair",{id:t,options:n})}historyRepairAll(t={}){return this.runTyped("history-repair",{options:{...t,all:!0}})}historyAttest(t={}){return this.runTyped("history-attest",{options:t})}historyCompact(t,n={}){return this.runTyped("history-compact",{id:t,options:n})}historyCompactBulk(t){return this.runTyped("history-compact",{options:t})}historyAuthorAcknowledge(t){return this.runTyped("history-author-acknowledge",{historyEvent:(t.events??[]).map(n=>`${n.item_id}:${String(n.line)}`),allActionable:t.all_actionable===!0,dryRun:t.dry_run===!0,planFingerprint:t.plan_fingerprint,limit:t.coordinate_limit,attributedAuthor:t.attributed_author,reviewer:t.reviewer,reason:t.reason})}plan(t,n,o={},r,i){return this.runTyped("plan",{...n===void 0?{}:{id:n},...r===void 0?{}:{stepRef:r},...i===void 0?{}:{reorderTo:i},options:bt(o,{subcommand:t})})}planCreate(t){return this.plan("create",void 0,t)}planShow(t,n={}){return this.plan("show",t,n)}planAddStep(t,n){return this.plan("add-step",t,n)}planUpdateStep(t,n,o){return this.plan("update-step",t,o,n)}planCompleteStep(t,n,o={}){return this.plan("complete-step",t,o,n)}planBlockStep(t,n,o){return this.plan("block-step",t,o,n)}planReorderStep(t,n,o,r={}){return this.plan("reorder-step",t,r,n,o)}planRemoveStep(t,n,o={}){return this.plan("remove-step",t,o,n)}planLink(t,n,o){return this.plan("link",t,o,n)}planUnlink(t,n,o){return this.plan("unlink",t,o,n)}planDecision(t,n){return this.plan("decision",t,n)}planDiscovery(t,n){return this.plan("discovery",t,n)}planValidation(t,n){return this.plan("validation",t,n)}planResume(t,n){return this.plan("resume",t,n)}planApprove(t,n={}){return this.plan("approve",t,n)}planMaterialize(t,n){return this.plan("materialize",t,n)}create(t={}){return this.runTyped("create",X(t))}update(t,n={}){return this.runTyped("update",{id:t,...X(n)})}reopen(t,n,o={}){return this.runTyped("item-reopen",{id:t,reason:n,fullChangedFields:!0,options:o})}close(t,n,o={}){return this.runTyped("close",{id:t,reason:n,...X(o)})}claim(t,n={}){return this.runTyped("claim",{id:t,...X(n)})}claimNext(t={}){return this.runTyped("claim",{next:!0,...X(t)})}release(t,n={}){return this.runTyped("release",{id:t,...X(n)})}copy(t,n={}){return this.runTyped("copy",{id:t,...X(n)})}delete(t,n={}){return this.runTyped("delete",{id:t,...X(n)})}restore(t,n,o={}){return this.runTyped("restore",{fullChangedFields:!0,id:t,options:{...o,target:n}})}focus(t,n={}){return this.runTyped("focus",{...t===void 0?{}:{id:t},...X(n)})}startTask(t,n={}){return this.runTyped("start-task",{id:t,...X(n)})}pauseTask(t,n={}){return this.runTyped("pause-task",{id:t,...X(n)})}closeTask(t,n,o={}){return this.runTyped("close-task",{id:t,reason:n,...X(o)})}extension(t,n={}){return this.runTyped("extension",{...t===void 0?{}:{target:t},options:n})}extensionList(t={}){return this.extension("list",t)}extensionActivate(t,n={}){return this.runTyped("extension-activate",{target:t,options:n})}extensionDeactivate(t,n={}){return this.runTyped("extension-deactivate",{target:t,options:n})}package(t,n={}){return this.runTyped("package",{...t===void 0?{}:{target:t},options:{...n,vocabulary:"package"}})}packageList(t={}){return this.package("list",t)}packageInstall(t,n={}){return this.runTyped("package-install",{target:t,options:n})}packageUninstall(t,n={}){return this.runTyped("package-uninstall",{target:t,options:n})}packageDoctor(t={}){return this.runTyped("package-doctor",{options:t})}packageManage(t,n={}){return this.runTyped("package-manage",{...t===void 0?{}:{target:t},options:n})}packageDescribe(t,n={}){return this.runTyped("package-describe",{...t===void 0?{}:{target:t},options:n})}packageReload(t={}){return this.runTyped("package-reload",{options:t})}packageCatalog(t={}){return this.runTyped("package-catalog",{options:t})}packageActivate(t,n={}){return this.runTyped("package-activate",{target:t,options:n})}packageDeactivate(t,n={}){return this.runTyped("package-deactivate",{target:t,options:n})}packageMigrate(t={}){return this.package(void 0,{...t,migrate:!0})}upgrade(t,n={}){return this.runTyped("upgrade",{...t===void 0?{}:{target:t},options:n})}};function rA(e={},t={}){return new b(t).context(e)}function iA(e={},t={}){return new b(t).list(e)}function sA(e={},t={}){return new b(t).listAllComplete(e)}function aA(e,t={},n={}){return new b(n).search(e,t)}function cA(e,t={},n={}){return new b(n).get(e,t)}function lA(e={},t={}){return new b(t).next(e)}function dA(e={},t={}){return new b(t).aggregate(e)}function mA(e={},t={}){return new b(t).stats(e)}function pA(e={},t={}){return new b(t).duplicates(e)}function uA(e,t={},n={}){return new b(n).comments(e,t)}function fA(e,t={},n={}){return new b(n).notes(e,t)}function _A(e,t={},n={}){return new b(n).learnings(e,t)}function hA(e,t={},n={}){return new b(n).files(e,t)}function gA(e,t={},n={}){return new b(n).filesDiscover(e,t)}function yA(e,t={}){return new b(t).filesLookup(e)}function bA(e,t={},n={}){return new b(n).docs(e,t)}function wA(e,t={},n={}){return new b(n).deps(e,t)}function vA(e,t={},n={},o={}){return new b(o).graph(e,t,n)}function kA(e,t,n={},o={}){return new b(o).append(e,t,n)}function SA(e,t={},n={}){return new b(n).init(e,t)}function IA(e,t,n,o,r={},i={}){return new b(i).config(e,t,n,o,r)}function EA(e,t={},n={}){return new b(n).schema(e,t)}function AA(e={}){return new b(e).schemaList()}function RA(e,t={}){return new b(t).schemaShow(e)}function CA(e,t={},n={}){return new b(n).schemaAddType(e,t)}function TA(e,t={},n={}){return new b(n).schemaRemoveType(e,t)}function xA(e,t={},n={}){return new b(n).schemaAddStatus(e,t)}function OA(e,t={},n={}){return new b(n).schemaRemoveStatus(e,t)}function $A(e,t={},n={}){return new b(n).schemaAddField(e,t)}function PA(e,t={},n={}){return new b(n).schemaRemoveField(e,t)}function FA(e={}){return new b(e).schemaListFields()}function MA(e,t={}){return new b(t).schemaShowField(e)}function LA(e,t={},n={}){return new b(n).schemaApplyPreset(e,t)}function DA(e={},t={}){return new b(t).schemaInferTypes(e)}function NA(e,t,n,o={}){return new b(o).schemaRenameType(e,t,n)}function jA(e,t,n,o,r={}){return new b(r).schemaRenameField(e,t,n,o)}function UA(e,t,n,o={}){return new b(o).schemaRemapStatus(e,t,n)}function GA(e,t={}){return new b(t).schemaShowStatus(e)}function qA(e,t={},n={}){return new b(n).profile(e,t)}function zA(e={}){return new b(e).profileList()}function HA(e,t={}){return new b(t).profileShow(e)}function WA(e,t={},n={}){return new b(n).profileApply(e,t)}function VA(e,t={}){return new b(t).profileLint(e)}function BA(e={},t={}){return new b(t).validate(e)}function KA(e={},t={}){return new b(t).health(e)}function YA(e={},t={}){return new b(t).gc(e)}function JA(e,t,n={}){return new b(n).historyRedact(e,t)}function XA(e,t={},n={}){return new b(n).historyRepair(e,t)}function ZA(e={},t={}){return new b(t).historyRepairAll(e)}function QA(e,t={},n={}){return new b(n).historyCompact(e,t)}function eR(e,t={}){return new b(t).historyCompactBulk(e)}function tR(e={},t={}){return new b(t).create(e)}function nR(e,t={},n={}){return new b(n).update(e,t)}function oR(e,t,n={},o={}){return new b(o).reopen(e,t,n)}function rR(e,t,n={},o={}){return new b(o).close(e,t,n)}function iR(e,t={},n={}){return new b(n).claim(e,t)}function sR(e={},t={}){return new b(t).claimNext(e)}function aR(e,t={},n={}){return new b(n).release(e,t)}function cR(e,t={},n={}){return new b(n).copy(e,t)}function lR(e,t={},n={}){return new b(n).delete(e,t)}function dR(e,t,n={},o={}){return new b(o).restore(e,t,n)}function mR(e,t={},n={}){return new b(n).focus(e,t)}function pR(e,t={},n={}){return new b(n).startTask(e,t)}function uR(e,t={},n={}){return new b(n).pauseTask(e,t)}function fR(e,t,n={},o={}){return new b(o).closeTask(e,t,n)}function _R(e,t={},n={}){return new b(n).extension(e,t)}function hR(e={},t={}){return new b(t).extensionList(e)}function gR(e,t={},n={}){return new b(n).extensionActivate(e,t)}function yR(e,t={},n={}){return new b(n).extensionDeactivate(e,t)}function bR(e,t={},n={}){return new b(n).package(e,t)}function wR(e={},t={}){return new b(t).packageList(e)}function vR(e,t={},n={}){return new b(n).packageInstall(e,t)}function kR(e,t={},n={}){return new b(n).packageUninstall(e,t)}function SR(e={},t={}){return new b(t).packageDoctor(e)}function IR(e,t={},n={}){return new b(n).packageManage(e,t)}function ER(e,t={},n={}){return new b(n).packageDescribe(e,t)}function AR(e={},t={}){return new b(t).packageReload(e)}function RR(e={},t={}){return new b(t).packageCatalog(e)}function CR(e,t={},n={}){return new b(n).packageActivate(e,t)}function TR(e,t={},n={}){return new b(n).packageDeactivate(e,t)}function xR(e,t={},n={}){return new b(n).upgrade(e,t)}async function OR(e,t={}){let n=typeof e=="string"?{...t,pmRoot:e}:e??t,o={json:!0,quiet:n.quiet??!0,noExtensions:n.noExtensions??!1,noPager:!0,profile:n.profile??!1,path:n.pmRoot};return So(n,o)}function se(e,t){let n=g(e,t);if(!n)throw new m(`Missing required argument: ${t}`,64);return n}var Zd=ci(),tm=new qh;function En(){Ln(ei()),Dn(ti()),Nn(ni()),jn(oi()),Un(ri()),Gn(ii()),qn(si())}async function nm(e,t,n,o){return li(()=>t===void 0?Zd.read(()=>Qd(e,n,o)):Zd.write(()=>Hh(t,()=>Qd(e,n,o))))}async function $R(e,t){let n=e.cwd,o=n??process.cwd();return nm(Yt({path:e.path,noExtensions:e.noExtensions}),n,o,()=>tm.run(!0,t))}async function Qd(e,t,n){let o=E(t,e.path);if(e.noExtensions)return En(),Lo({pmRoot:o},()=>n(null));if(!await ge(ct(o)))return En(),n(null);let r=null,i;try{let s=await R(o),a=await Dt({pmRoot:o,settings:s,cwd:t,noExtensions:!1}),c=await jt({...a,loaded:a.loaded});i={loadResult:a,activationResult:c},Ln(c.hooks),Dn(c.commands),Nn(c.parsers),jn(c.preflight),Un(c.services),Gn(c.renderers),qn(c.registrations),r={registrations:c.registrations,commands:c.commands,pmRoot:o,packages:a.loaded}}catch(s){En(),console.error("[pm-sdk] extension activation failed; continuing without active extensions:",s)}try{return await Lo({pmRoot:o,packages:r?.packages},()=>n(r))}finally{En(),i&&await Nt(i.loadResult,i.activationResult).catch(()=>{})}}async function zh(e,t,n,o,r){if(!r)throw new m(`Unsupported native pm action: ${e}`,p.USAGE);let i=Ce(e),a=r.registrations.commands.find(l=>Ce(l.action)===i)?.command??r.commands.handlers.find(l=>Ce(l.command)===i)?.command;if(!a)throw new m(`Unsupported native pm action: ${e}`,p.USAGE);let c=await ui({command:no(a),args:V(n.args??t.args),options:oo(t,n),global:o,pm_root:r.pmRoot,sdk:sl(r.pmRoot,b.forActiveExtensionHost({pmRoot:r.pmRoot,author:typeof o.author=="string"&&o.author.trim()?o.author.trim():"pm-extension"}))});if(!c.handled){let l=c.warnings.length>0?` (${c.warnings.join(", ")})`:"";throw new m(`Unsupported native pm action: ${e}${l}`,p.USAGE)}return c.result}async function Hh(e,t){let n=process.cwd();process.chdir(e);try{return await t()}finally{process.chdir(n)}}function Wh(e){let t=se(e,"action"),n=Ce(t),o=it(To,n),r=o?.action??n,i={...e,action:r};return o?.options!==void 0&&(i.options={...o.options,...Tn(e.options)}),r==="package"&&(i.options={...Tn(i.options),vocabulary:"package"}),{action:r,args:i}}async function Vh(e){let t=Wh(e),n=Yt(t.args),o=pa(t.action),r=g(t.args,"cwd"),i=r??process.cwd();t.action==="init"&&(n[kc]=i),(t.action!=="init"||n.path!==void 0||(process.env.PM_PATH?.trim().length??0)>0)&&(n.path=E(i,n.path));try{return t.action==="history-attest"?await Gr(t.action,t.args,n,null):e[em]===!0||tm.getStore()===!0?await Gr(t.action,t.args,n,null):await nm(n,r,i,s=>Gr(t.action,t.args,n,s))}finally{o&&Co()}}function it(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function An(e){return g(e.args,"target")??g(e.options,"target")}function U(e,t=e.options){return e.id??se(t,"id")}async function Bh(e){let t=He("list",e.options);return t.compact===void 0&&t.brief===void 0&&t.full===void 0&&t.fields===void 0&&t.includeBody===void 0&&(t.compact=!0),Ao(await me(g(e.args,"status")??g(t,"status"),t,e.global),t)}async function Kh(e){let t=se(e.args,"query"),n=He("search",e.options,[t]);return n.compact===void 0&&n.full===void 0&&n.fields===void 0&&(n.compact=!0),Ao(await vo(t,n,e.global),n)}async function Yh(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options);return W(await It(o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}async function Jh(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options),r={...o,...o.title===void 0&&typeof e.args.title=="string"?{title:e.args.title}:{},...o.message===void 0&&typeof e.args.message=="string"?{message:e.args.message}:{}};return W(await er(U(e,r),r,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}async function Xh(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options);return W(await Ke(U(e,o),o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}function Zh(e){let t=rn(e.options);return t.add===void 0&&t.stdin===void 0&&t.file===void 0&&t.edit===void 0&&t.delete===void 0&&(t.includeMeta=!0,t.limit===void 0&&t.fullHistory!==!0&&(t.limit="20")),_l(U(e),t,e.global)}function om(e,t){return oc(kd(e.options,t,Z),e.global)}function Qh(e){let t=V(e.options.lookupPath);if(t&&t.length>0)return om(e,t);let n=U(e);return e.options.discover===!0?ao(n,to(e.options),e.global):nc(n,Jt(e.options),e.global)}function eg(e){return zc({subcommand:g(e.args,"subcommand")??g(e.options,"subcommand"),limit:da(e.args,e.options)},e.global)}function tg(e){let t={...e.options};return t.brief===void 0&&t.summary===void 0&&t.full===void 0&&(t.summary=!0),vt(e.global,t)}function ng(e){let t=g(e.args,"configAction")??g(e.options,"configAction")??g(e.options,"action");if(t===void 0)throw new m("Missing required argument: configAction",64);let n=g(e.args,"value")??g(e.options,"value"),o=g(e.options,"policy")!==void 0&&n!==void 0?{...e.options,value:n}:e.options;return vc(g(e.args,"scope")??g(e.options,"scope")??"project",t,g(e.args,"key")??g(e.options,"key"),o,e.global,g(e.options,"policy")===void 0?n:void 0)}function og(e){let t=e.options;return ia(ra(t),e.global)}function rg(e,t){if(typeof e=="number"){if(!Number.isFinite(e)||!Number.isInteger(e))throw new m(`${t} must be a finite integer.`,64);return e}if(typeof e=="string"&&e.trim().length>0){let n=e.trim();if(!/^[+-]?\d+(?:st|nd|rd|th)?$/i.test(n))throw new m(`${t} must be a finite integer.`,64);let o=Number.parseInt(n,10);if(!Number.isInteger(o))throw new m(`${t} must be a finite integer.`,64);return o}}function ig(e){let t=g(e.args,"subcommand")??se(e.options,"subcommand"),n=e.options;return Ml({subcommand:t,id:typeof e.id=="string"?e.id:typeof n.id=="string"?n.id:void 0,stepRef:sg(e),reorderTo:rg(n.reorderTo??e.args.reorderTo,"plan reorderTo"),options:e.options,global:e.global})}function sg(e){return typeof e.options.stepRef=="string"?e.options.stepRef:typeof e.args.stepRef=="string"?e.args.stepRef:void 0}function ag(e){let t=g(e.args,"subcommand")??se(e.options,"subcommand"),n=e.args.alias??e.options.alias;return{ctx:e,subcommand:t.trim().toLowerCase(),name:g(e.args,"name")??g(e.options,"name"),author:g(e.args,"author")??g(e.options,"author"),force:e.args.force===!0||e.options.force===!0,aliases:n===void 0?void 0:V(n)}}function cg(e){let{ctx:t,subcommand:n,name:o,author:r,force:i}=e,a=it({list:()=>Oa(t.global),show:()=>$a(o,t.global),"show-status":()=>Pa(o,t.global),"list-fields":()=>La(t.global),"show-field":()=>Da(o,t.global),"remove-type":()=>Ra(o,{author:r,force:i},t.global),"remove-field":()=>Ma(o,{author:r,force:i},t.global),"remove-status":()=>xa(o,{author:r,force:i},t.global),"apply-preset":()=>Na(g(t.args,"typePreset")??g(t.options,"typePreset"),{author:r,force:i},t.global)},n);return a?a():null}function lg(e){let{ctx:t,name:n,author:o,force:r,aliases:i}=e,s=t.args.commands??t.options.commands,a=t.args.requiredTypes??t.options.requiredTypes;return Fa(n,{type:g(t.args,"fieldType")??g(t.options,"fieldType"),commands:s===void 0?void 0:V(s),description:g(t.args,"description")??g(t.options,"description"),cliFlag:g(t.args,"cliFlag")??g(t.options,"cliFlag"),alias:i,required:t.args.required===!0||t.options.required===!0,requiredOnCreate:t.args.requiredOnCreate===!0||t.options.requiredOnCreate===!0,allowUnset:!(t.args.allowUnset===!1||t.options.allowUnset===!1),requiredTypes:a===void 0?void 0:V(a),author:o,force:r},t.global)}function dg(e){let{ctx:t,name:n,author:o,force:r,aliases:i}=e,s=t.args.role??t.options.role;return Ta(n,{role:s===void 0?void 0:V(s),alias:i,description:g(t.args,"description")??g(t.options,"description"),order:Z(t.args.order??t.options.order,"schema add-status order"),author:o,force:r},t.global)}function mg(e){let{ctx:t,name:n,author:o,force:r,aliases:i}=e;return Aa(n,{description:g(t.args,"description")??g(t.options,"description"),defaultStatus:g(t.args,"defaultStatus")??g(t.args,"default_status")??g(t.options,"defaultStatus")??g(t.options,"default_status"),folder:g(t.args,"folder")??g(t.options,"folder"),alias:i,author:o,force:r},t.global)}function pg(e){let{ctx:t,subcommand:n,name:o,author:r,force:i}=e,s=g(t.args,"to")??se(t.options,"to"),a=g(t.args,"migrationId")??g(t.args,"migration_id")??g(t.options,"migrationId")??g(t.options,"migration_id"),c=g(t.args,"fieldTypeScope")??g(t.options,"fieldTypeScope")??g(t.args,"type")??g(t.options,"type"),l=n==="rename-type"?{kind:"rename-type",from:o??"",to:s}:n==="rename-field"?{kind:"rename-field",from:o??"",to:s,...c===void 0?{}:{type:c}}:{kind:"remap-status",from:o??"",to:s};return Ia(l,{migrationId:a,dryRun:t.args.dryRun===!0||t.options.dryRun===!0,author:r,force:i},t.global)}function ug(e){let t=ag(e),n=zt.find(r=>r===t.subcommand);if(n)return Sa(n,t.name,{definition:e.args.definition??e.options.definition,policy:g(e.args,"policy")??g(e.options,"policy"),message:g(e.args,"message")??g(e.options,"message"),author:t.author,dryRun:e.args.dryRun===!0||e.options.dryRun===!0},e.global);let o=cg(t);if(o!==null)return o;if(["rename-type","rename-field","remap-status"].includes(t.subcommand))return pg(t);if(t.subcommand==="add-field")return lg(t);if(t.subcommand==="add-status")return dg(t);if(t.subcommand==="add-type")return e.args.infer===!0||e.options.infer===!0?ja({minCount:Z(e.args.minCount??e.options.minCount,"schema infer minCount"),apply:e.args.apply===!0||e.options.apply===!0,author:t.author,force:t.force},e.global):mg(t);throw ce({command_path:"schema",token:t.subcommand,allowed:Ea,exit_code:64})}function fg(e){let t=g(e.args,"subcommand")??se(e.options,"subcommand"),n=t.trim().toLowerCase(),o=g(e.args,"name")??g(e.options,"name"),i=it({list:()=>pd(),show:()=>ud(o),lint:()=>fd(o),apply:()=>_d(o,{dryRun:e.args.dryRun===!0||e.options.dryRun===!0,author:g(e.args,"author")??g(e.options,"author"),force:e.args.force===!0||e.options.force===!0},e.global)},n);if(!i)throw ce({command_path:"profile",token:t,allowed:md,exit_code:64});return i()}async function _g(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options);return W(await dl(U(e,o),o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}async function hg(e){let{changedFields:t,runnerOptions:n}=G(e.args,e.options);return W(await kl(io(n),e.global),{changedFields:t})}async function gg(e){let{changedFields:t,runnerOptions:n}=G(e.args,e.options),o=g(e.args,"reason"),r=o!==void 0&&n.reason===void 0?{...n,reason:o}:{...n};return e.force&&r.force===void 0&&(r.force=!0),W(await fl(ro(r),e.global),{changedFields:t})}async function yg(e){let{changedFields:t,idOnly:n,runnerOptions:o}=G(e.args,e.options),r=g(o,"target")??se(e.args,"target");return W(await $e(U(e,o),r,o,e.global),{changedFields:t,compactEnvelope:t==="compact"&&!n,idOnly:n})}function bg(e){let t={...e.args,...e.options};return aa(se(t,"subcommand"),g(t,"id")??e.id,g(t,"target"),fa(t),e.global)}function wg(e){return ha(E(process.cwd(),e.global.path),{...e.args,...e.options})}var rm={init:e=>Sc(g(e.args,"prefix"),e.global,e.options),context:e=>po(He("context",e.options),e.global),next:e=>uo(He("next",e.options),e.global),eval:ql,events:zl,merge:Hl,workspace:Wl,meet:hn,event:hn,remind:hn,list:Bh,get:e=>{let t=U(e);return wo(t,e.global,He("get",e.options,[t]))},search:Kh,duplicates:e=>{let t=typeof e.options.status=="string"?[e.options.status]:V(e.options.status);return Eo(e.global,{exhaustive:e.options.exhaustive===!0,...t.length===0?{}:{status:t},since:g(e.options,"since"),threshold:typeof e.options.threshold=="number"?e.options.threshold:void 0,limit:e.options.limit==="default"?void 0:Z(e.options.limit,"limit")})},create:Yh,copy:Jh,focus:e=>nr(e.id,{clear:e.options.clear===!0||e.args.clear===!0},e.global),update:Xh,"item-reopen":vd,restore:yg,claim:yd,release:wd,"start-task":e=>Le(e,"start_task"),"pause-task":e=>Le(e,"pause_task"),"close-task":e=>Le(e,"close_task"),close:bd,comments:Zh,notes:e=>gl(U(e),rn(e.options),e.global),learnings:e=>hl(U(e),rn(e.options),e.global),files:Qh,docs:e=>tc(U(e),Jt(e.options),e.global),test:e=>Hc(U(e),e.options,e.global),"test-all":e=>Wc(e.options,e.global),telemetry:eg,validate:e=>on(e.options,e.global,{runUpdate:(t,n,o)=>Ke(t,n,o)}),health:tg,assurance:e=>rc(e.args,e.options,e.global),contracts:e=>So(e.options,e.global),config:ng,activity:og,aggregate:e=>co(e.options,e.global),extension:e=>en(An(e),e.options,e.global),package:e=>en(An(e),e.options,e.global),install:e=>en(An(e),{...e.options,install:!0},e.global),upgrade:e=>gc(An(e),e.options,e.global),delete:e=>tr(U(e),e.options,e.global),deps:e=>sa(U(e),e.options,e.global),graph:bg,"files-discover":e=>ao(U(e),e.options,e.global),"files-lookup":e=>om(e,V(e.options.paths)),history:e=>_c(U(e),e.options,e.global),"history-redact":e=>Lc(U(e),e.options,e.global),"history-repair":hd,"history-compact":gd,"history-attest":e=>hc(e.options,e.global),"history-author-acknowledge":wg,plan:ig,schema:ug,profile:fg,stats:e=>Io(e.global,Sd(e.options)),append:_g,"update-many":hg,"close-many":gg,gc:e=>yc(e.global,e.options)};function PR(e=ji){return e.map(t=>{let n=Ce(t),o=it(To,n),r=o?.action??n,i=it(rm,r)!==void 0;return{action:t,resolved_action:r,covered:i,route:i?o?"alias":"native":"missing"}})}async function Gr(e,t,n,o){let r=eo(t,e);Ui(e,r),Gi(e,r);let i={action:e,args:t,options:r,id:g(t,"id"),force:t.force===!0||r.force===!0,global:n,activeExtensions:o},s=it(rm,e),a=s?await s(i):await zh(e,t,r,n,o);if(e==="history-attest")return a;{r.resolvedOutputFormat="json";let c=Hi(e,r,a);return await al(E(process.cwd(),n.path),c),c}}var vg={closeManyOptionsFromFlat:ro,extensionOptionsFromArgs:oo,globalOptions:Yt,mutationListOptions:ua,normalizeActionName:Ce,normalizeCommandPath:no,normalizeMcpUpdateOptions:_a,normalizeMcpOptionsArrays:ma,optionsWithAuthor:eo,readRequiredString:se,readScalarString:ca,readScalarStringAllowBlank:la,readStringArray:V,updateManyOptionsFromFlat:io,withAddNoteOption:Jt,withFilesDiscoveryOptions:to,withMutationCompaction:G};(process.env.NODE_ENV==="test"||process.env.VITEST!==void 0||process.env.VITEST_WORKER_ID!==void 0)&&(globalThis.__pmCliActionRunnerTestHooks=vg);export{nl as a,Sm as b,xo as c,At as d,pn as e,sl as f,Cg as g,Tg as h,xg as i,Og as j,$g as k,Bc as l,Pg as m,sm as n,cm as o,cn as p,Ro as q,Jc as r,ln as s,_m as t,Co as u,bm as v,Mo as w,cl as x,Fm as y,Lm as z,Dm as A,Lo as B,dl as C,fl as D,_l as E,hl as F,gl as G,kl as H,Wp as I,Sl as J,Vo as K,Ml as L,er as M,tr as N,nr as O,Dl as P,Nl as Q,Gl as R,Qe as S,rr as T,tf as U,kw as V,Sw as W,ar as X,Bl as Y,jw as Z,Uw as _,Yl as $,Zl as aa,iv as ba,bf as ca,fr as da,vf as ea,kf as fa,md as ga,pd as ha,ud as ia,fd as ja,_d as ka,xv as la,Ov as ma,$v as na,Pv as oa,_r as pa,Ff as qa,Mf as ra,Lf as sa,j as ta,Df as ua,Nf as va,jf as wa,Uf as xa,yr as ya,Id as za,tt as Aa,gr as Ba,Ed as Ca,Gf as Da,Ad as Ea,qf as Fa,zf as Ga,Hf as Ha,Wf as Ia,Vf as Ja,Qf as Ka,xd as La,e_ as Ma,a_ as Na,f_ as Oa,h_ as Pa,hh as Qa,Gh as Ra,b as Sa,rA as Ta,iA as Ua,sA as Va,aA as Wa,cA as Xa,lA as Ya,dA as Za,mA as _a,pA as $a,uA as ab,fA as bb,_A as cb,hA as db,gA as eb,yA as fb,bA as gb,wA as hb,vA as ib,kA as jb,SA as kb,IA as lb,EA as mb,AA as nb,RA as ob,CA as pb,TA as qb,xA as rb,OA as sb,$A as tb,PA as ub,FA as vb,MA as wb,LA as xb,DA as yb,NA as zb,jA as Ab,UA as Bb,GA as Cb,qA as Db,zA as Eb,HA as Fb,WA as Gb,VA as Hb,BA as Ib,KA as Jb,YA as Kb,JA as Lb,XA as Mb,ZA as Nb,QA as Ob,eR as Pb,tR as Qb,nR as Rb,oR as Sb,rR as Tb,iR as Ub,sR as Vb,aR as Wb,cR as Xb,lR as Yb,dR as Zb,mR as _b,pR as $b,uR as ac,fR as bc,_R as cc,hR as dc,gR as ec,yR as fc,bR as gc,wR as hc,vR as ic,kR as jc,SR as kc,IR as lc,ER as mc,AR as nc,RR as oc,CR as pc,TR as qc,xR as rc,OR as sc,se as tc,$R as uc,Vh as vc,PR as wc};
2247
- //# sourceMappingURL=chunk-BOZ4HVYL.js.map
2247
+ //# sourceMappingURL=chunk-UF75LUAK.js.map