@unbrained/pm-cli 2026.9.14 → 2026.9.15
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.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +12 -0
- package/dist/cli-bundle/bundle-manifest.json +148 -148
- package/dist/cli-bundle/chunks/{chunk-5JIJAWIF.js → chunk-3AHONKLL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DBHQIS6Z.js → chunk-3RB6Z7XE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZYRN2OG3.js → chunk-5P5PYCZX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-B6W5LIXK.js → chunk-BOZ4HVYL.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-J4DRE3WN.js +237 -0
- package/dist/cli-bundle/chunks/{chunk-GQMILIC5.js → chunk-RKPUO75B.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-O7SRS7Y3.js → chunk-RM2OGG65.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D5AJQU7F.js → chunk-UKLOSZV6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XEV7BHH3.js → chunk-WDF7PP4P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A2Q64TGR.js → chunk-WLJJ4MAU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BY3ID7QI.js → chunk-Y2P3DSSO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NYE6EREL.js → chunk-YMMLKKEP.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-B2U36YWL.js → register-list-query-IWSPNFFD.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-GX42CQYR.js → register-mutation-3DVF4R64.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-ZV34KX5E.js → register-operations-LXP3MECQ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-W4OS7IZW.js → register-setup-KFQSNBDX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-GGDO6VBT.js → chunk-4YTDKIPF.js} +17 -17
- package/dist/cli-bundle/focused-chunks/{chunk-ZFNRD7EN.js → chunk-533DCWPY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FNLAQJES.js → chunk-5SBU4QDC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-KWP3QTN7.js → chunk-63YRRGKX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-N23WTRCC.js → chunk-6C3CUU2G.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-ENJH7CBZ.js → chunk-AXDAIBT3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6WZBO4VQ.js → chunk-BMATJLPT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FHQLQOUZ.js → chunk-JKJYXCT6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-D4FQV6TY.js → chunk-MD7ADLME.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7BUJABHB.js → chunk-OGGF2RBL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CPQQIVDL.js → chunk-PBJC2ZNA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UFSMYVZF.js → chunk-SHF57M2H.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-C5NQVXKE.js → chunk-UACMCSCC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LFGTCEHX.js → chunk-YBQTVE5S.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-O4EROPO3.js → chunk-ZHX3433X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZOE2NSJB.js +20 -0
- package/dist/cli-bundle/main.js +2 -2
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +40 -40
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +1 -1
- package/dist/core/extensions/index.d.ts +7 -0
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/lock/lock.js +2 -2
- package/dist/core/telemetry/policy.d.ts +2 -0
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/read-sampling.d.ts +8 -0
- package/dist/core/telemetry/read-sampling.js +3 -0
- package/dist/core/telemetry/runtime.js +2 -2
- package/docs/CONFIGURATION.md +6 -2
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-33PER336.js +0 -236
- package/dist/cli-bundle/focused-chunks/chunk-CMCSUANO.js +0 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as au,o as Ko,p as uu,q as pu,r as ga,s as Ho,t as fu,u as ya,v as Vo,y as ju,z as qu}from"./focused-chunks/chunk-6WZBO4VQ.js";import{a as Hu,f as Vu,h as Zt,m as Wu,o as mr,r as ei,s as Yu,t as Ju,x as Xu}from"./focused-chunks/chunk-ENJH7CBZ.js";import{$ as ff,$a as Vf,Aa as Tf,Ab as rc,Ba as Cf,Bb as oc,Ca as Rf,Cb as Ii,Da as If,Db as ic,Ea as Of,Eb as a_,Fa as xf,Fb as sc,Ga as Pf,Gb as Oi,H as Gt,Ha as Lf,Hb as Dn,I as w,Ia as Nf,Ib as ac,J as af,Ja as Mf,Jb as cc,K as cf,Ka as $f,Kb as c_,L as qe,La as Fn,Lb as l_,M as lf,Mb as d_,N as Ya,Nb as Un,O as df,Ob as lc,P as Ja,Pa as Ff,Pb as m_,Q as Si,Qa as Df,R as Xa,Ra as Uf,S as $n,Sa as Gf,Sb as xi,T as mf,Ta as jf,U as Qa,Ua as qf,V as Te,Va as Kf,W as Za,Wa as tn,X as be,Xa as zf,Y as uf,Ya as Bf,Z as pf,Za as Ai,Zb as __,_ as ec,_a as Hf,a as Na,aa as tc,ab as Wf,b as Up,bb as Yf,bc as g_,cb as Jf,cc as y_,db as Ti,dc as v_,eb as jt,ec as w_,fb as Xf,gb as Ci,i as nf,ia as _f,j as rf,jb as Sr,ka as kr,la as hf,ma as Ei,na as gf,nb as Qf,oa as yf,ob as Ri,pb as Jb,qb as Zf,rb as e_,sb as nc,ta as vf,tb as t_,ua as wf,ub as n_,va as bf,vb as r_,wa as kf,wb as o_,xa as Sf,xb as i_,ya as Ef,yb as s_,za as Af,zb as Er}from"./focused-chunks/chunk-KWP3QTN7.js";import{e as ou,g as iu,h as su,k as cu,q as mu}from"./focused-chunks/chunk-LFGTCEHX.js";import{b as Ku,c as Zo,e as zu,f as Bu,g as Lb}from"./focused-chunks/chunk-CPQQIVDL.js";import{R as La,V as Gu,a as Yd,b as Jd,c as Xd,d as Qd,f as Zd}from"./focused-chunks/chunk-C5NQVXKE.js";import{a as $p,b as Fp,c as Ni}from"./focused-chunks/chunk-FHQLQOUZ.js";import{K as sf,b as Dp}from"./focused-chunks/chunk-D4FQV6TY.js";import{$ as Zb,Ca as fc,Sa as Rr,Ta as _c,W as Xb,X as mc,Y as uc,Z as Li,_ as Qb,c as Ka,e as za,g as Mp,h as Jp,i as Xp,j as Qp,k as Zp,l as ef,m as tf,n as Tr,o as dc,ra as pc,wa as Cr,ya as h_}from"./focused-chunks/chunk-O4EROPO3.js";import{A as Dt,B as _e,C as Ln,D as fi,E as _i,H as hi,I as gi,J as qp,Ja as Mn,K as yi,Ka as Hp,L as vi,La as Wa,M as Nn,Ma as Vp,N as Va,O as wi,P as Kp,Pa as Wp,Q as zp,Qa as Yp,R as vr,Za as Pi,a as yr,ab as p_,b as en,bb as Ar,c as ii,d as si,e as ai,eb as f_,f as ci,j as li,k as Ft,l as xn,m as di,mb as gt,n as Pn,o as mi,ob as Mi,p as le,q as ui,r as Ba,s as He,t as Ha,ta as Bp,tb as Gn,u as Gp,v as Ae,x as ht,y as jp,z as pi}from"./focused-chunks/chunk-CMCSUANO.js";import{c as tu,f as nu,g as ru,i as qo,j as xt,k as _u,l as hu,m as gu}from"./focused-chunks/chunk-FNLAQJES.js";import{a as Zu,b as ep,c as tp}from"./focused-chunks/chunk-ZFNRD7EN.js";import{$ as Cm,A as yo,Aa as Vm,B as am,Ba as Wm,C as cm,Ca as Ro,D as lm,Da as Ym,E as vo,Ea as Jm,F as dm,Fa as Xm,G as mm,Ga as Io,H as um,Ha as Oo,I as pm,Ia as xo,J as wo,Ja as Po,K as bo,Ka as cr,L as fm,La as Qm,M as ko,Ma as Lo,Na as lr,O as _m,Oa as No,P as sr,Pa as Mo,Q as hm,Qa as $o,R as gm,Ra as Fo,S as ym,Sa as Zm,T as vm,Ta as It,U as wm,Ua as Do,V as bm,Va as Uo,W as km,Wa as Go,X as Sm,Xa as jo,Y as Em,Z as Am,_ as Tm,_a as eu,aa as Rm,ab as Ot,ba as Im,bb as N,ca as Om,d as fa,da as ar,e as em,ea as xm,fa as Pm,ga as So,h as fo,ha as Eo,i as _a,ia as Lm,j as Xt,ja as Nm,ka as Mm,l as tm,la as $m,ma as Fm,na as Dm,oa as Um,pa as Gm,q as ha,ra as jm,s as _o,sa as qm,t as ho,ta as Km,u as go,ua as zm,v as nm,va as Bm,w as rm,wa as Hm,x as om,xa as Ao,y as im,ya as To,z as sm,za as Co}from"./focused-chunks/chunk-UFSMYVZF.js";import{$ as up,$a as Cp,A as Yb,Ab as oi,B as Rn,Bb as _t,C,Cb as Lp,Db as se,Eb as Np,Fb as Ne,G as ft,Ga as bp,Gb as wr,Hb as br,Ia as ja,Ib as bi,Jb as Ut,K as op,L as ri,La as kp,M as ip,Ma as Sp,N as sp,Na as nt,O as ap,Ob as ki,P as cp,Pa as Ep,Q as lp,Qa as Ap,Ra as A,S as ee,Sa as Le,T as Ma,Ta as Nt,U as ne,Va as je,W as $a,Wa as hr,X as dp,Xa as In,Y as Be,Ya as Tp,Z as et,Za as On,_ as mp,_a as qa,a as Nb,b as Mb,ba as pp,c as $b,ca as fp,d as Fb,da as Fa,dc as of,fb as gr,ga as Da,hb as Rp,hc as u_,ia as _p,ib as Ip,j as ti,ja as hp,k as np,ka as gp,l as rp,la as yp,m as Cn,ma as vp,n as ur,o as Db,ob as Mt,p as Ub,q as Gb,qa as Pe,qb as $t,r as jb,ra as Lt,s as qb,sb as Op,t as Kb,ta as Ua,tb as R,u as zb,ua as pr,ub as q,v as Bb,va as fr,vb as ie,w as Hb,wa as Ga,wb as xp,x as ni,xa as tt,y as Vb,ya as wp,yb as fe,z as Wb,za as _r,zb as Pp}from"./focused-chunks/chunk-N23WTRCC.js";import{b as Ct,c as co,d as lo,f as ut,h as zo,i as pt,j as Pt,k as lu,m as F,n as Bo,o as Ze,q as du}from"./focused-chunks/chunk-7BUJABHB.js";import{e as Qu}from"./focused-chunks/chunk-HFAW3FJQ.js";import{$ as l,$a as Ud,$b as wu,Aa as x,Ab as or,Ad as bb,Ae as Ib,B as Rd,Ba as we,Bc as ka,Bd as kb,Be as Ob,C as Id,Ca as mo,Cc as Sa,Ce as xb,D as Od,Da as bn,Dc as Ea,Dd as Sb,De as Pb,E as xd,Ea as tr,Ec as Aa,Ed as Eb,Ee as Qo,F as Pd,Fa as Md,Fb as Ge,Fc as Ta,Fd as Oa,Fe as Uu,G as Ld,Ga as E,Gc as Ca,Gd as xa,H as oa,Ha as $d,Hb as Y,Hc as Ra,Hd as Pa,I as ia,Ia as lt,Ic as O,Id as Pu,J as sa,Ja as pe,Jb as ir,Jc as En,K as aa,Ka as dt,Kc as Qt,Kd as Lu,L as ca,Lc as J,Ld as Ab,M as la,Ma as Qe,Mc as Wo,Na as uo,Nc as An,Nd as Tb,Ob as Sn,Od as Cb,P as ao,Pd as Rb,Qc as Yo,Rd as S,Sc as Se,Ta as kn,Tc as Jo,U as da,Va as Fd,Vd as Xo,W as Nd,Xa as ua,Xc as dr,Xd as oe,Ya as nr,Z as Tt,Za as Dd,Zb as yu,_b as vu,_d as Ee,aa as d,ac as bu,bb as po,bc as ku,cc as Su,db as Gd,dc as va,eb as jd,ec as Eu,ee as Nu,gb as qd,gc as Au,hb as Kd,hc as Tu,ib as zd,ja as L,jb as Bd,jd as Ou,ka as Yt,kb as Hd,kc as wa,la as Rt,lb as Vd,lc as Cu,le as Mu,ma as Z,mb as Wd,mc as ba,me as $u,na as te,nd as xu,o as oo,p as Cd,pa as wn,pb as Jt,pe as Tn,q as io,qb as mt,r as ra,sd as Ia,tc as Ru,te as Fu,v as Wt,va as ma,w as ct,wa as er,x as yn,xa as ke,xe as Du,y as vn,yb as rr,z as so,zb as pa,zc as Iu,zd as wb}from"./focused-chunks/chunk-GGDO6VBT.js";import{AsyncLocalStorage as YM}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 b_(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ek(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 hc(e,t){let n=ek(t),r=n==="brief"?n:b_(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:b_(e.filters)?e.filters:{},projection:r}}}(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 k_(e,t){let n=E(t??process.cwd(),e),r=await A(n);return fe(n,r.item_format,x(r,null).type_to_folder,void 0,r.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]="0c84b11c-502f-5c33-a757-5757402357b4")}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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var tk=new Map;function gc(){tk.clear()}(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(){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 nk={"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 S_(e){return Object.fromEntries(Au.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var E_={ctx:{action:"context"},...nk,...S_("extension"),...S_("package"),...Object.fromEntries(Tu.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 yc="PmCliError";function rk(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=l.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function A_(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new d(e,rk(t.exitCode??l.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function $i(e){if(!(e instanceof Error)||e.name!==yc)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}(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]="3113ad4b-282a-50af-a836-8e9abfde7d7e")}catch{}})();function vc(e){let t=Ud();for(let n of e)t.register(n);return t}function T_(e,t){return{client:t,isItemNotFoundError:n=>$i(n)&&n.exitCode===l.NOT_FOUND,getItemAt:(n,r)=>Mp(n,r,{pmRoot:e}),openRelationshipEventStore:n=>Fp.open({pmRoot:e,nodes:n.nodes,registry:vc(n.definitions),...n.relativePath===void 0?{}:{relativePath:n.relativePath}}),createRelationshipGraph:n=>new jd(n.nodes,n.edges,vc(n.definitions)),analyzeRelationshipImpact:(n,r,o)=>Dp(n,r,o),validateRelationshipEvents:n=>{let r=new $p(n.nodes,{registry:vc(n.definitions)});return n.events.map(o=>r.append({...o,expectedVersion:r.version}))},commitWorkspaceTransaction:n=>Up({...n,pmRoot: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]="c2766f4e-6354-55bb-9e40-676273ee901f")}catch{}})();async function C_(e,t,n=Nu){try{await n({pmRoot:e,result:t})}catch{if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t,o=Array.isArray(r.warnings)?r.warnings.filter(i=>typeof i=="string"):[];r.warnings=[...new Set([...o,"context_usage_feedback_write_failed"])].sort()}}}import{readFile as ok}from"node:fs/promises";import ik 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]="c64f304d-9081-5bad-8187-7bf6b65e4a07")}catch{}})();var wc="context-intents.json";function Fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sk(e,t,n){if(!Fi(e))throw new TypeError(`${t} context intent at index ${String(n)} must be an object`);let r=e.included_field_groups;if(typeof e.command!="string"||typeof e.intent!="string"||typeof e.description!="string"||!Array.isArray(r)||!r.every(o=>typeof o=="string")||typeof e.token_budget!="number")throw new TypeError(`${t} context intent at index ${String(n)} has an invalid contract shape`);return{command:e.command,intent:e.intent,description:e.description,included_field_groups:r,token_budget:e.token_budget}}function R_(e,t){let n=Array.isArray(e)?e:Fi(e)&&Array.isArray(e.intents)?e.intents:void 0;if(!n)throw new TypeError(`${t} context intents must be an array or an object with an intents array`);return n.map((r,o)=>sk(r,t,o))}async function ak(e){let t=ik.join(e,wc),n;try{n=await ok(t,"utf8")}catch(o){if(Yt(o))return[];throw await Op(e),o}let r;try{r=JSON.parse(n)}catch(o){let i=o instanceof Error?o.message:String(o);throw new TypeError(`Invalid ${wc}: ${i}`,{cause:o})}return R_(r,wc)}function ck(e){if(!Fi(e))return;let t=e.contextIntents??e.context_intents;if(t!==void 0)return t;let n=e.default;return Fi(n)?n.contextIntents??n.context_intents:void 0}function lk(e){return e.flatMap(t=>{let n=ck(t.module);return n===void 0?[]:R_(n,`package ${t.name}`)})}async function dk(e){let t=await ak(e.pmRoot),n=lk(e.packages??[]);return{workspaceContracts:t,packageContracts:n}}async function bc(e,t){let n=await dk(e);return await $u(n,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]="663579ae-aebb-524c-81c9-9aed44e40f35")}catch{}})();async function I_(e,t,n){if(t.body===void 0)throw new d("Missing required --body text",l.USAGE);let r=Dt(),o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=C(t.author,i.author_default),c=(await r.resolveValue(t.body,"--body",jp(t,"body"))).trim();if(c.length===0)throw new d("--body text cannot be empty; append requires non-blank content and empty appends would only rewrite updated_at.",l.USAGE,{code:"append_empty_body",required:"Provide non-empty body text positionally, via --body, or with - for stdin.",examples:['pm append pm-a1b2 --body "Progress note"',"pm append pm-a1b2 --body -"]});let m=await se({pmRoot:o,settings:i,id:e,op:"append",author:s,message:t.message,force:t.force,mutate(u){let p=u.body.trim().length>0?`
|
|
1
|
+
import{n as au,o as Ko,p as uu,q as pu,r as ga,s as Ho,t as fu,u as ya,v as Vo,y as ju,z as qu}from"./focused-chunks/chunk-BMATJLPT.js";import{a as Hu,f as Vu,h as Zt,m as Wu,o as mr,r as ei,s as Yu,t as Ju,x as Xu}from"./focused-chunks/chunk-AXDAIBT3.js";import{$ as ff,$a as Vf,Aa as Tf,Ab as rc,Ba as Cf,Bb as oc,Ca as Rf,Cb as Ii,Da as If,Db as ic,Ea as Of,Eb as a_,Fa as xf,Fb as sc,Ga as Pf,Gb as Oi,H as Gt,Ha as Lf,Hb as Dn,I as w,Ia as Nf,Ib as ac,J as af,Ja as Mf,Jb as cc,K as cf,Ka as $f,Kb as c_,L as qe,La as Fn,Lb as l_,M as lf,Mb as d_,N as Ya,Nb as Un,O as df,Ob as lc,P as Ja,Pa as Ff,Pb as m_,Q as Si,Qa as Df,R as Xa,Ra as Uf,S as $n,Sa as Gf,Sb as xi,T as mf,Ta as jf,U as Qa,Ua as qf,V as Te,Va as Kf,W as Za,Wa as tn,X as be,Xa as zf,Y as uf,Ya as Bf,Z as pf,Za as Ai,Zb as __,_ as ec,_a as Hf,a as Na,aa as tc,ab as Wf,b as Up,bb as Yf,bc as g_,cb as Jf,cc as y_,db as Ti,dc as v_,eb as jt,ec as w_,fb as Xf,gb as Ci,i as nf,ia as _f,j as rf,jb as Sr,ka as kr,la as hf,ma as Ei,na as gf,nb as Qf,oa as yf,ob as Ri,pb as Jb,qb as Zf,rb as e_,sb as nc,ta as vf,tb as t_,ua as wf,ub as n_,va as bf,vb as r_,wa as kf,wb as o_,xa as Sf,xb as i_,ya as Ef,yb as s_,za as Af,zb as Er}from"./focused-chunks/chunk-63YRRGKX.js";import{e as ou,g as iu,h as su,k as cu,q as mu}from"./focused-chunks/chunk-YBQTVE5S.js";import{b as Ku,c as Zo,e as zu,f as Bu,g as Lb}from"./focused-chunks/chunk-PBJC2ZNA.js";import{R as La,V as Gu,a as Yd,b as Jd,c as Xd,d as Qd,f as Zd}from"./focused-chunks/chunk-UACMCSCC.js";import{a as $p,b as Fp,c as Ni}from"./focused-chunks/chunk-JKJYXCT6.js";import{K as sf,b as Dp}from"./focused-chunks/chunk-MD7ADLME.js";import{$ as Zb,Ca as fc,Sa as Rr,Ta as _c,W as Xb,X as mc,Y as uc,Z as Li,_ as Qb,c as Ka,e as za,g as Mp,h as Jp,i as Xp,j as Qp,k as Zp,l as ef,m as tf,n as Tr,o as dc,ra as pc,wa as Cr,ya as h_}from"./focused-chunks/chunk-ZHX3433X.js";import{A as Dt,B as _e,C as Ln,D as fi,E as _i,H as hi,I as gi,J as qp,Ja as Mn,K as yi,Ka as Hp,L as vi,La as Wa,M as Nn,Ma as Vp,N as Va,O as wi,P as Kp,Pa as Wp,Q as zp,Qa as Yp,R as vr,Za as Pi,a as yr,ab as p_,b as en,bb as Ar,c as ii,d as si,e as ai,eb as f_,f as ci,j as li,k as Ft,l as xn,m as di,mb as gt,n as Pn,o as mi,ob as Mi,p as le,q as ui,r as Ba,s as He,t as Ha,ta as Bp,tb as Gn,u as Gp,v as Ae,x as ht,y as jp,z as pi}from"./focused-chunks/chunk-ZOE2NSJB.js";import{c as tu,f as nu,g as ru,i as qo,j as xt,k as _u,l as hu,m as gu}from"./focused-chunks/chunk-5SBU4QDC.js";import{a as Zu,b as ep,c as tp}from"./focused-chunks/chunk-533DCWPY.js";import{$ as Cm,A as yo,Aa as Vm,B as am,Ba as Wm,C as cm,Ca as Ro,D as lm,Da as Ym,E as vo,Ea as Jm,F as dm,Fa as Xm,G as mm,Ga as Io,H as um,Ha as Oo,I as pm,Ia as xo,J as wo,Ja as Po,K as bo,Ka as cr,L as fm,La as Qm,M as ko,Ma as Lo,Na as lr,O as _m,Oa as No,P as sr,Pa as Mo,Q as hm,Qa as $o,R as gm,Ra as Fo,S as ym,Sa as Zm,T as vm,Ta as It,U as wm,Ua as Do,V as bm,Va as Uo,W as km,Wa as Go,X as Sm,Xa as jo,Y as Em,Z as Am,_ as Tm,_a as eu,aa as Rm,ab as Ot,ba as Im,bb as N,ca as Om,d as fa,da as ar,e as em,ea as xm,fa as Pm,ga as So,h as fo,ha as Eo,i as _a,ia as Lm,j as Xt,ja as Nm,ka as Mm,l as tm,la as $m,ma as Fm,na as Dm,oa as Um,pa as Gm,q as ha,ra as jm,s as _o,sa as qm,t as ho,ta as Km,u as go,ua as zm,v as nm,va as Bm,w as rm,wa as Hm,x as om,xa as Ao,y as im,ya as To,z as sm,za as Co}from"./focused-chunks/chunk-SHF57M2H.js";import{$ as up,$a as qa,A as Yb,Ab as Pp,B as Rn,Bb as oi,C,Cb as _t,Db as Lp,Eb as se,Fb as Np,G as ft,Ga as bp,Gb as Ne,Hb as wr,Ia as ja,Ib as br,Jb as bi,K as op,Kb as Ut,L as ri,La as kp,M as ip,Ma as Sp,N as sp,Na as nt,O as ap,P as cp,Pb as ki,Q as lp,Qa as Ep,Ra as Ap,S as ee,Sa as A,T as Ma,Ta as Le,U as ne,Ua as Nt,W as $a,Wa as je,X as dp,Xa as hr,Y as Be,Ya as In,Z as et,Za as Tp,_ as mp,_a as On,a as Nb,ab as Cp,b as Mb,ba as pp,c as $b,ca as fp,d as Fb,da as Fa,ec as of,ga as Da,gb as gr,ia as _p,ib as Rp,ic as u_,j as ti,ja as hp,jb as Ip,k as np,ka as gp,l as rp,la as yp,m as Cn,ma as vp,n as ur,o as Db,p as Ub,pb as Mt,q as Gb,qa as Pe,r as jb,ra as Lt,rb as $t,s as qb,t as Kb,ta as Ua,tb as Op,u as zb,ua as pr,ub as R,v as Bb,va as fr,vb as q,w as Hb,wa as Ga,wb as ie,x as ni,xa as tt,xb as xp,y as Vb,ya as wp,z as Wb,za as _r,zb as fe}from"./focused-chunks/chunk-6C3CUU2G.js";import{b as Ct,c as co,d as lo,f as ut,h as zo,i as pt,j as Pt,k as lu,m as F,n as Bo,o as Ze,q as du}from"./focused-chunks/chunk-OGGF2RBL.js";import{e as Qu}from"./focused-chunks/chunk-HFAW3FJQ.js";import{$ as l,$a as Ud,$b as wu,Aa as x,Ab as or,Ad as bb,Ae as Ib,B as Rd,Ba as we,Bc as ka,Bd as kb,Be as Ob,C as Id,Ca as mo,Cc as Sa,Ce as xb,D as Od,Da as bn,Dc as Ea,Dd as Sb,De as Pb,E as xd,Ea as tr,Ec as Aa,Ed as Eb,Ee as Qo,F as Pd,Fa as Md,Fb as Ge,Fc as Ta,Fd as Oa,Fe as Uu,G as Ld,Ga as E,Gc as Ca,Gd as xa,H as oa,Ha as $d,Hb as Y,Hc as Ra,Hd as Pa,I as ia,Ia as lt,Ic as O,Id as Pu,J as sa,Ja as pe,Jb as ir,Jc as En,K as aa,Ka as dt,Kc as Qt,Kd as Lu,L as ca,Lc as J,Ld as Ab,M as la,Ma as Qe,Mc as Wo,Na as uo,Nc as An,Nd as Tb,Ob as Sn,Od as Cb,P as ao,Pd as Rb,Qc as Yo,Rd as S,Sc as Se,Ta as kn,Tc as Jo,U as da,Va as Fd,Vd as Xo,W as Nd,Xa as ua,Xc as dr,Xd as oe,Ya as nr,Z as Tt,Za as Dd,Zb as yu,_b as vu,_d as Ee,aa as d,ac as bu,bb as po,bc as ku,cc as Su,db as Gd,dc as va,eb as jd,ec as Eu,ee as Nu,gb as qd,gc as Au,hb as Kd,hc as Tu,ib as zd,ja as L,jb as Bd,jd as Ou,ka as Yt,kb as Hd,kc as wa,la as Rt,lb as Vd,lc as Cu,le as Mu,ma as Z,mb as Wd,mc as ba,me as $u,na as te,nd as xu,o as oo,p as Cd,pa as wn,pb as Jt,pe as Tn,q as io,qb as mt,r as ra,sd as Ia,tc as Ru,te as Fu,v as Wt,va as ma,w as ct,wa as er,x as yn,xa as ke,xe as Du,y as vn,yb as rr,z as so,zb as pa,zc as Iu,zd as wb}from"./focused-chunks/chunk-4YTDKIPF.js";import{AsyncLocalStorage as YM}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 b_(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ek(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 hc(e,t){let n=ek(t),r=n==="brief"?n:b_(e.projection)&&typeof e.projection.mode=="string"?e.projection.mode:n;return{...e,query_summary:{filters:b_(e.filters)?e.filters:{},projection:r}}}(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 k_(e,t){let n=E(t??process.cwd(),e),r=await A(n);return fe(n,r.item_format,x(r,null).type_to_folder,void 0,r.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]="0c84b11c-502f-5c33-a757-5757402357b4")}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]="e8137f8b-745a-5ef5-9e7e-14b7d032c1ea")}catch{}})();var tk=new Map;function gc(){tk.clear()}(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(){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 nk={"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 S_(e){return Object.fromEntries(Au.map(t=>[`${e}-${t}`,{action:e,options:{[t==="adopt-all"?"adoptAll":t]:!0,...e==="package"?{vocabulary:"package"}:{}}}]))}var E_={ctx:{action:"context"},...nk,...S_("extension"),...S_("package"),...Object.fromEntries(Tu.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 yc="PmCliError";function rk(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=l.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function A_(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new d(e,rk(t.exitCode??l.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function $i(e){if(!(e instanceof Error)||e.name!==yc)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}(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]="3113ad4b-282a-50af-a836-8e9abfde7d7e")}catch{}})();function vc(e){let t=Ud();for(let n of e)t.register(n);return t}function T_(e,t){return{client:t,isItemNotFoundError:n=>$i(n)&&n.exitCode===l.NOT_FOUND,getItemAt:(n,r)=>Mp(n,r,{pmRoot:e}),openRelationshipEventStore:n=>Fp.open({pmRoot:e,nodes:n.nodes,registry:vc(n.definitions),...n.relativePath===void 0?{}:{relativePath:n.relativePath}}),createRelationshipGraph:n=>new jd(n.nodes,n.edges,vc(n.definitions)),analyzeRelationshipImpact:(n,r,o)=>Dp(n,r,o),validateRelationshipEvents:n=>{let r=new $p(n.nodes,{registry:vc(n.definitions)});return n.events.map(o=>r.append({...o,expectedVersion:r.version}))},commitWorkspaceTransaction:n=>Up({...n,pmRoot: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]="c2766f4e-6354-55bb-9e40-676273ee901f")}catch{}})();async function C_(e,t,n=Nu){try{await n({pmRoot:e,result:t})}catch{if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t,o=Array.isArray(r.warnings)?r.warnings.filter(i=>typeof i=="string"):[];r.warnings=[...new Set([...o,"context_usage_feedback_write_failed"])].sort()}}}import{readFile as ok}from"node:fs/promises";import ik 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]="c64f304d-9081-5bad-8187-7bf6b65e4a07")}catch{}})();var wc="context-intents.json";function Fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sk(e,t,n){if(!Fi(e))throw new TypeError(`${t} context intent at index ${String(n)} must be an object`);let r=e.included_field_groups;if(typeof e.command!="string"||typeof e.intent!="string"||typeof e.description!="string"||!Array.isArray(r)||!r.every(o=>typeof o=="string")||typeof e.token_budget!="number")throw new TypeError(`${t} context intent at index ${String(n)} has an invalid contract shape`);return{command:e.command,intent:e.intent,description:e.description,included_field_groups:r,token_budget:e.token_budget}}function R_(e,t){let n=Array.isArray(e)?e:Fi(e)&&Array.isArray(e.intents)?e.intents:void 0;if(!n)throw new TypeError(`${t} context intents must be an array or an object with an intents array`);return n.map((r,o)=>sk(r,t,o))}async function ak(e){let t=ik.join(e,wc),n;try{n=await ok(t,"utf8")}catch(o){if(Yt(o))return[];throw await Op(e),o}let r;try{r=JSON.parse(n)}catch(o){let i=o instanceof Error?o.message:String(o);throw new TypeError(`Invalid ${wc}: ${i}`,{cause:o})}return R_(r,wc)}function ck(e){if(!Fi(e))return;let t=e.contextIntents??e.context_intents;if(t!==void 0)return t;let n=e.default;return Fi(n)?n.contextIntents??n.context_intents:void 0}function lk(e){return e.flatMap(t=>{let n=ck(t.module);return n===void 0?[]:R_(n,`package ${t.name}`)})}async function dk(e){let t=await ak(e.pmRoot),n=lk(e.packages??[]);return{workspaceContracts:t,packageContracts:n}}async function bc(e,t){let n=await dk(e);return await $u(n,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]="663579ae-aebb-524c-81c9-9aed44e40f35")}catch{}})();async function I_(e,t,n){if(t.body===void 0)throw new d("Missing required --body text",l.USAGE);let r=Dt(),o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=C(t.author,i.author_default),c=(await r.resolveValue(t.body,"--body",jp(t,"body"))).trim();if(c.length===0)throw new d("--body text cannot be empty; append requires non-blank content and empty appends would only rewrite updated_at.",l.USAGE,{code:"append_empty_body",required:"Provide non-empty body text positionally, via --body, or with - for stdin.",examples:['pm append pm-a1b2 --body "Progress note"',"pm append pm-a1b2 --body -"]});let m=await se({pmRoot:o,settings:i,id:e,op:"append",author:s,message:t.message,force:t.force,mutate(u){let p=u.body.trim().length>0?`
|
|
2
2
|
|
|
3
3
|
`:"";return u.body=`${u.body.trimEnd()}${p}${c}
|
|
4
4
|
`,{changedFields:["body"]}}});return{item:m.item,appended:c,changed_fields:m.changedFields}}import{readFile as mk}from"node:fs/promises";(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]="0a5fc27e-3f5a-59e0-998e-be5da72913dd")}catch{}})();function Ui(e){let t={...e,...e.full===!0?{fullHistory:!0}:{}};return delete t.full,Ae(e,t)}function O_(e,t){if(typeof e=="object"&&e!==null&&"format"in e&&e.format==="json")throw new d(`Structured context events are append-only and cannot be ${t}.`,l.USAGE,{code:"structured_event_immutable"})}function kc(e,t){return t===void 0?e:t===0?[]:e.slice(Math.max(0,e.length-t))}function nn(e,t){let n=e[t];return Array.isArray(n)?n:[]}function jn(e,t={}){let n=e.trim();if(!n)return"";let r=/^(?:[-*+]\s*)?text\s*[:=]/i.exec(n);if(t.stripPlainTextPrefix===!0&&r&&!n.startsWith("```"))return n.slice(r[0].length).trim()||n;if(!(/^(?:[-*+]\s*)?text\s*[:=]/im.test(n)||n.startsWith("```")))return n;try{let i=le(n,"--add");return Object.keys(i).map(c=>c.trim().toLowerCase()).some(c=>c!=="text")?n:i.text?.trim()||n}catch{return n}}function Sc(e){return typeof e=="object"&&e!==null&&"code"in e}function xr(e,t){if(!ht(e))throw new d(`${t} cannot read process stdin through the MCP JSON-RPC transport. Pass annotation text in options.add instead.`,l.USAGE,{code:"mcp_stdin_unavailable",required:"Pass annotation text as JSON data; the MCP protocol already owns process stdin."})}async function uk(e,t){if(+(e.add!==void 0)+ +(e.stdin===!0)+ +(typeof e.file=="string")>1)throw new d(`Specify ${t} text using only one input source: --add, --stdin, or --file`,l.USAGE);let r=Dt(),o=ht(e);if(e.add!==void 0)return{value:await r.resolveValue(e.add,"--add",o)??"",rawValue:e.add,emptyFlag:"--add"};if(e.stdin===!0)return xr(e,"--stdin"),{value:await r.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};if(typeof e.file!="string")return;let i=e.file.trim();if(!i)throw new d("--file path cannot be empty",l.USAGE);if(i==="-")return xr(e,"--file -"),{value:await r.resolveValue("-","--file")??"",emptyFlag:"--file"};try{return{value:await mk(i,"utf8"),emptyFlag:"--file"}}catch(s){if(Sc(s)&&Yt(s))throw new d(`--file path not found: ${i}. Use --file - to read stdin.`,l.USAGE);let a=s instanceof Error?s.message:String(s);throw new d(`Failed to read --file path "${i}": ${a}. Use --file - to read stdin.`,l.USAGE)}}async function Gi(e,t){if(e.edit!==void 0&&e.delete!==void 0)throw new d("Specify only one of --edit or --delete",l.USAGE);if(e.delete!==void 0){if(e.add!==void 0||e.stdin===!0||typeof e.file=="string")throw new d("--delete cannot be combined with replacement text",l.USAGE);if(!Number.isInteger(e.delete)||e.delete<1)throw new d("--delete must be a positive integer",l.USAGE);return{mode:"delete",index:e.delete}}if(e.edit!==void 0&&(!Number.isInteger(e.edit)||e.edit<1))throw new d("--edit must be a positive integer",l.USAGE);let n=await uk(e,t);if(e.edit!==void 0){if(!n)throw new d("--edit requires replacement text from --add, --stdin, or --file",l.USAGE);return{mode:"edit",index:e.edit,...n}}return n?{mode:"add",...n}:{mode:"list"}}function Or(e,t){throw e instanceof d&&e.exitCode===l.CONFLICT&&e.message.includes("is assigned to")&&e.message.includes("Use --force to override")?new d(e.message,e.exitCode,{code:"ownership_conflict",required:t.required,examples:t.examples,nextSteps:t.nextSteps}):e}function P_(e){return e==="comments"?"--stdin":"--add -"}function pk(e,t){if((t.input.emptyFlag??"--add")!=="--add")return;let r=e.trim();if(!/^-{1,2}[A-Za-z][\w-]*(?:=.*)?$/.test(r))return;let o=P_(t.collectionKey),i=t.input.mode==="edit"?`pm ${t.collectionKey} <id> --edit <index>`:`pm ${t.collectionKey} <id>`;throw new d(`--add value "${r}" looks like an option, not annotation text. Use ${o} to read stdin, or use text=${r} for literal dash-leading text.`,l.USAGE,{code:"annotation_flag_like_value",required:`Use ${o} for stdin input, pass plain text, or use text=${r} when the text really starts with "-".`,examples:[`${i} ${o}`,`${i} --add text=${r}`]})}function fk(e,t){if(t.ifAbsent===!0&&!["add","stdin","file"].includes(e.input.mode))throw new d(`--if-absent requires a ${e.collectionKey.replace(/s$/,"")} append`,l.USAGE,{code:"annotation_if_absent_without_append",required:"Combine --if-absent with one append text source; omit it for list, edit, and delete operations."});if(e.input.mode!=="list"||t.message===void 0)return;let n=e.collectionKey.replace(/s$/,"");throw new d(`--message labels a ${n} mutation but does not provide ${n} text. Pass text positionally or with --add, --stdin, or --file.`,l.USAGE,{code:"annotation_message_without_text",required:`Provide ${n} text through a content source; --message only annotates the history entry of a mutation.`,examples:[`pm ${e.collectionKey} <id> --add "text" --message "why"`,`pm ${e.collectionKey} <id> ${P_(e.collectionKey)}`]})}function _k(e,t,n,r,o,i){let s=nn(e.metadata,t),a=o?s.findIndex(c=>c.author===n&&c.text===r):-1;return a>=0?{changedFields:[],entryIndex:a+1}:(s.push(i({created_at:S(),author:n,text:r})),e.metadata[t]=s,{changedFields:[t],entryIndex:s.length})}async function qn(e,t,n,r){fk(r,t);let o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=x(i,O()),a=vr(t.limit);if(r.input.mode==="list"){let h=await q(o,e,i.id_prefix,i.item_format,s.type_to_folder);if(!h)throw new d(`Item ${e} not found`,l.NOT_FOUND);let y=await ie(h,{schema:i.schema}),g=nn(y.document.metadata,r.collectionKey);return Di(h.id,r.collectionKey,g,a,t.includeMeta===!0)}let c=C(t.author,i.author_default);if(r.input.mode==="delete"){let h=r.deleteOp??r.op,y;try{y=await se({pmRoot:o,settings:i,id:e,op:h,author:c,message:t.message,force:t.force,bypassAssigneeConflict:r.bypassOwnershipConflict,mutate(v){let b=nn(v.metadata,r.collectionKey),k=x_(r.input.index,b.length,r.collectionKey);return O_(b[k],"deleted"),b.splice(k,1),v.metadata[r.collectionKey]=b,{changedFields:[r.collectionKey]}}})}catch(v){Or(v,r.conflictGuidance)}let g=nn(y.item,r.collectionKey);return Di(y.item.id,r.collectionKey,g,a,t.includeMeta===!0,{action:"delete",entryIndex:r.input.index},t.fullHistory===!0)}let m=r.input.rawValue??r.input.value??"";pk(m,r);let u=r.parseText(r.input.value??"");if(!u.trim())throw new d(`${r.input.emptyFlag??"--add"} text cannot be empty`,l.USAGE);if(r.input.mode==="edit"){let h=r.editOp??r.op,y;try{y=await se({pmRoot:o,settings:i,id:e,op:h,author:c,message:t.message,force:t.force,bypassAssigneeConflict:r.bypassOwnershipConflict,mutate(v){let b=nn(v.metadata,r.collectionKey),k=x_(r.input.index,b.length,r.collectionKey),T=b[k];return O_(T,"edited"),b[k]={...T,text:u,edited_at:S()},v.metadata[r.collectionKey]=b,{changedFields:[r.collectionKey]}}})}catch(v){Or(v,r.conflictGuidance)}let g=nn(y.item,r.collectionKey);return Di(y.item.id,r.collectionKey,g,a,t.includeMeta===!0,{action:"edit",entryIndex:r.input.index,entry:g[r.input.index-1]},t.fullHistory===!0)}let p,f=0;try{p=await se({pmRoot:o,settings:i,id:e,op:r.op,author:c,message:t.message,force:t.force,bypassAssigneeConflict:r.bypassOwnershipConflict,skipNoop:t.ifAbsent===!0,mutate(h){let y=_k(h,r.collectionKey,c,u,t.ifAbsent===!0,r.createEntry);return f=y.entryIndex,{changedFields:y.changedFields}}})}catch(h){Or(h,r.conflictGuidance)}let _=nn(p.item,r.collectionKey);return Di(p.item.id,r.collectionKey,_,a,t.includeMeta===!0,{action:"add",entryIndex:f,entry:_[f-1],changedCount:t.ifAbsent===!0?Math.min(p.changedFields.length,1):void 0},t.fullHistory===!0)}function x_(e,t,n){if(e===void 0||!Number.isInteger(e)||e<1||e>t){let r=n.replace(/s$/,""),o=`${r.charAt(0).toUpperCase()}${r.slice(1)}`,i=t===1?`1 ${r}`:`${t} ${n}`;throw new d(`${o} index ${e??"(missing)"} out of range (item has ${i})`,l.USAGE)}return e-1}function hk(e,t,n){return t===void 0?{}:{mutation_receipt:{action:t.action,entry_index:t.entryIndex,changed_count:t.changedCount??1,full_history_included:!n},omission_receipt:{has_omissions:n,omitted_field_group_count:n?1:0,omitted_field_groups:n?[{name:`${e}_history`,restore_with:{selector:"full_history",cli_flag:"--full-history",sdk_option:"fullHistory",mcp_option:"full"}}]:[]}}}function Di(e,t,n,r,o,i,s=!1){let a=i===void 0||s?kc(n,i!==void 0&&s?void 0:r):i.entry===void 0?[]:[i.entry],c=i!==void 0&&a.length<n.length;return{id:e,[t]:a,count:a.length,...i?.changedCount===void 0?{}:{changed:i.changedCount===1},...[o,i!==void 0].includes(!0)?{total_count:n.length,returned_count:a.length,has_more:c||a.length<n.length,...r!==void 0?{limit:r}:{}}:{},...hk(t,i,c)}}(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]="f366dd76-73b4-55c4-8c63-2913d0a0c380")}catch{}})();async function L_(e,t,n){return[...await Promise.resolve().then(()=>up(Qe(e,t),t)).catch(()=>[])].reverse().find(i=>i.patch.some(s=>s.path==="/metadata/assignee"))?.op==="claim"?`claimed by ${n}`:`assigned to ${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]="f2901314-4044-5a91-ad72-6b4bebde16c2")}catch{}})();var N_="no_available_next_item";function M_(e){if(!(e instanceof Error)||e.name!=="PmCliError")return!1;let t=e.context;return typeof t=="object"&&t!==null&&"code"in t&&t.code==="already_claimed_by"}async function Pr(e,t,n,r={}){let o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=F(i.schema),a=C(r.author,i.author_default),c=Rn(a),m=null,u=!1,p=[],f=await se({pmRoot:o,settings:i,id:e,op:"claim",author:a,message:r.message,force:t,skipNoop:!0,async mutate(_){let y=_.metadata.assignee??"",g=_.metadata.claim_principal?.trim()||y;if(m=y.trim().length>0?y:null,du(_.metadata.status,s)&&!t)throw new d(`Cannot claim terminal item ${_.metadata.id} without --force`,l.CONFLICT);if(m!==null&&g!==c){if(r.ifAvailable===!0)return u=!0,p.push(`claim_skipped_held_by:${m}`),{changedFields:[]};if(!t){let T=await L_(o,_.metadata.id,y);throw new d(`Item ${_.metadata.id} is already ${T}. Use --force to take over, or --if-available to skip without failing.`,l.CONFLICT,{code:"already_claimed_by",why:"Claim is an atomic test-and-set so parallel agents never proceed believing they own the same item.",nextSteps:["Run pm next to pick a different unclaimed item.","Re-run with --if-available to treat a held item as a no-op skip.","Re-run with --force only when taking over the item is coordinated."]})}p.push(`claim_takeover:${m}->${a}`)}let b={assignee:a,claim_principal:c},k=["assignee","claim_principal"].filter(T=>_.metadata[T]!==b[T]);return Object.assign(_.metadata,b),{changedFields:k,warnings:p}}});return u||await mc({pmRoot:o,settings:i,principal:c,itemId:f.item.id}),{item:f.item,changed_fields:f.changedFields,claimed_by:u&&m!==null?m:a,previous_assignee:m,forced:t,...u?{skipped:!0}:{},...p.length>0?{warnings:p}:{}}}async function $_(e,t,n={},r={}){let o=gk(n.maxAttempts),i=await A(E(process.cwd(),t.path)),s={...n,author:C(n.author,i.author_default)},a=await Cr({...r,callerAuthor:s.author,limit:String(o)},t),c=[a.recommended,...a.ready].filter(m=>m!==null).map(m=>({...m,reasons:"reasons"in m?m.reasons:["ranked ready candidate"]}));return yk(c.slice(0,o),e,t,s)}function gk(e){if(e===void 0)return 10;let t=Number(e);if(!Number.isSafeInteger(t)||t<1||t>100)throw new d("--max-attempts must be an integer from 1 to 100",l.USAGE);return t}async function yk(e,t,n,r={},o=Pr){let i=0;for(let a of e){i+=1;try{let c=await o(a.id,t,n,r),m={...c,recommendation:a,attempts:i,available:!0};if(!c.skipped)return m}catch(c){if(!M_(c))throw c}}if(r.ifAvailable===!0)return{available:!1,item:null,claimed_by:C(r.author,""),previous_assignee:null,forced:t,skipped:!0,recommendation:null,attempts:i,warnings:[N_]};let s=i===0;throw new d(s?"No actionable items matched the selection filters":"No actionable item remained available to claim",s?l.NOT_FOUND:l.CONFLICT,{code:N_,why:s?"No ready items matched the specified filters or selection criteria.":"Every ranked candidate was claimed by another agent before this atomic selection completed.",nextSteps:[s?"Verify the filters or run pm next to inspect all ready work.":"Run pm claim --next again to refresh the ranked candidate set."]})}async function Lr(e,t,n,r={}){let o=E(process.cwd(),n.path);await R(o);let i=await A(o),s=C(r.author,i.author_default),a=Rn(s),c=r.ownershipReleaseBypass===!0,m=null,u;try{u=await se({pmRoot:o,settings:i,id:e,op:"release",author:s,message:r.message,force:t,bypassAssigneeConflict:c,mutate(_){return m=_.metadata.assignee??null,!m&&!_.metadata.claim_principal?{changedFields:[]}:(delete _.metadata.assignee,delete _.metadata.claim_principal,{changedFields:["assignee","claim_principal"]})}})}catch(_){Or(_,{required:"For approved non-owner handoffs, prefer the ownership-release bypass before considering --force.",examples:['pm release pm-a1b2 --author "reviewer" --force'],nextSteps:["Use the package-provided ownership-release bypass for handoffs that only clear assignee metadata.","Use --force only when an explicit override is approved for broader ownership conflicts."]})}await uc({pmRoot:o,principal:a,itemId:u.item.id});let p=F(i.schema),f=Ma(u.item.status,p)===Ma(p.in_progress_status,p);return{item:u.item,released_by:s,changed_fields:u.changedFields,previous_assignee:m,forced:t,...f?{warnings:["released_unclaimed_in_progress"],suggestions:[`${u.item.id} remains ${u.item.status} and unclaimed. If work is paused, run pm release ${u.item.id} --pause to move it to ${p.open_status}.`]}:{}}}(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]="e63a8049-309b-57f2-ba48-cd0a550c11ab")}catch{}})();var vk=Object.freeze({requireCloseReason:!0,orderingEdges:"preserve"});function F_(e){let t=[{source:"explicit",value:e.explicit},{source:"duplicate",value:e.duplicateOf===void 0?void 0:`Duplicate of ${e.duplicateOf}`},{source:"resolution",value:e.resolution},{source:"message",value:e.message}];for(let n of t){let r=n.value?.trim();if(r)return{closeReason:r,source:n.source}}return{source:"none"}}function Ec(e,t){return Ac(e,t,{operation:"close"})}function Ac(e,t,n){let r=F_(e);if(!t||r.closeReason!==void 0)return r;let o=n.operation==="create"?[`pm create --title "<title>" --type <type> --status ${n.status??"closed"} --close-reason "<closing summary>"`,`pm create --title "<title>" --type <type> --status ${n.status??"closed"} --resolution "<resolution summary>"`,"pm create --stdin-json < item.json"]:['pm close <id> "Done: <what changed and why>"','pm close <id> --reason "<closing summary>"','pm close <id> -m "<closing summary>"',"pm close <id> --duplicate-of <canonical-id>"];throw new d("Close reason text is required because governance.require_close_reason is enabled",l.USAGE,{code:"close_reason_required",required:"Provide an author-controlled closing summary as the reason, message, resolution, or duplicate target.",why:"governance.require_close_reason is enabled, so tools must not invent immutable closure evidence.",examples:o,nextSteps:[`Re-run the ${n.operation} operation with a closing summary.`,"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled"]})}function Tc(e,t){let n=typeof e.blocked_by=="string"?e.blocked_by.trim():"",r=e.blocked_by!==void 0,o=e.dependencies??[],i=o.filter(m=>m.kind==="blocked_by"),s=e.blocked_reason!==void 0,a=[];if(r&&(delete e.blocked_by,a.push("blocked_by")),s&&(delete e.blocked_reason,a.push("blocked_reason")),t.orderingEdges==="remove"&&i.length>0){let m=o.filter(u=>u.kind!=="blocked_by");m.length>0?e.dependencies=m:delete e.dependencies,a.push("dependencies")}let c=[...new Set([...n?[n]:[],...i.map(m=>m.id)])];return c.length===0?{changedFields:a,warnings:[]}:{changedFields:a,warnings:[t.orderingEdges==="preserve"?`closed_preserved_predecessors:${e.id}:${c.join(",")}`:`closed_removed_predecessors:${e.id}:${c.join(",")}`]}}(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]="49e375b7-49a8-5b6f-89c8-be70d334b78f")}catch{}})();var wk=[{key:"resolution",label:"resolution (--resolution)"},{key:"expected_result",label:"expected_result (--expected-result)"},{key:"actual_result",label:"actual_result (--actual-result)"}];function bk(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t.length===0||t==="warn")return"warn";if(t==="off"||t==="none"||t==="disabled")return"off";if(t==="strict")return"strict";throw new d(`Invalid --validate-close mode "${e}" (expected "off", "warn", or "strict")`,l.USAGE)}function D_(e){let t=[];for(let n of wk){let r=e[n.key];(typeof r!="string"||r.trim().length===0)&&t.push(n)}return t}function U_(e,t,n={}){let r=D_(e);if(r.length===0)return;let o={resolution:n.resolution,expected_result:n.expectedResult,actual_result:n.actualResult},i=r.map(a=>`--${a.key.replaceAll("_","-")}`),s=["--pm-path",t,"update",e.id,...r.flatMap((a,c)=>[i[c],o[a.key]?.trim()||"<value>"])];return{missing:i,suggested_retry:dr(s),suggested_retry_args:s}}async function kk(e,t,n){let r=new Set,o=t;for(;typeof o=="string"&&o.trim().length>0;){let i=o.trim();if(i===n)return!0;if(r.has(i))return!1;r.add(i),o=(await e(i))?.duplicate_of}return!1}function Sk(e){return typeof e!="string"||e.trim().length===0}async function Ek(e,t,n,r){let o=n?.trim();if(!o)return;if(o===r)throw new d("An item cannot be closed as a duplicate of itself.",l.USAGE,{code:"duplicate_target_self",why:"--duplicate-of must identify the canonical item that should remain open or already represent the work."});let i=x(t,O()),s=new Map,a=async m=>{if(s.has(m))return s.get(m)??null;let u=await q(e,m,t.id_prefix,t.item_format,i.type_to_folder);if(!u)return s.set(m,null),null;let{document:p}=await ie(u,{schema:t.schema});return s.set(m,p.metadata),p.metadata},c=await a(o);if(!c)throw new d(`Duplicate target "${o}" was not found. Create or locate the canonical item first.`,l.USAGE,{code:"duplicate_target_missing",why:"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.",examples:[`pm close ${r} "Duplicate of ${o}" --duplicate-of ${o}`],nextSteps:["Run pm search/list to find the canonical item, then retry with --duplicate-of <id>."]});if(await kk(a,c.duplicate_of,r))throw new d(`Circular duplicate reference detected. Target "${o}" points back to "${r}".`,l.USAGE,{code:"duplicate_target_circular",why:"Circular duplicate relationships create loops for dedupe and status propagation tooling.",nextSteps:["Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate."]});if(typeof c.duplicate_of=="string"&&c.duplicate_of.trim().length>0)throw new d(`Duplicate target "${o}" is already marked as a duplicate of "${c.duplicate_of.trim()}".`,l.USAGE,{code:"duplicate_target_is_duplicate",why:"Duplicate closure should point directly at the canonical item, not another duplicate.",examples:[`pm close ${r} "Duplicate of ${c.duplicate_of.trim()}" --duplicate-of ${c.duplicate_of.trim()}`],nextSteps:["Use the canonical item referenced by duplicate_of as the --duplicate-of target."]});return c.id}function Ak(e,t,n){return e.filter(r=>r.parent===t&&!ne(r.status,n)).map(r=>r.id).sort((r,o)=>r.localeCompare(o))}function Tk(e,t,n){let r=new Map(e.map(a=>[a.id.trim().toLowerCase(),a])),o=u_(e),i=t.trim().toLowerCase(),s=n.blocked_statuses;return e.filter(a=>s.has(a.status)).map(a=>({item:a,blockerIds:o.get(a.id.trim().toLowerCase())})).filter(({blockerIds:a})=>a.includes(i)).filter(({blockerIds:a})=>a.every(c=>{if(c===i)return!0;let m=r.get(c);return m!==void 0&&ne(m.status,n)})).map(({item:a,blockerIds:c})=>({id:a.id,blocker_ids:c})).sort((a,c)=>a.id.localeCompare(c.id))}async function Ck(e,t,n,r,o,i){let s=Tk(n,r,i),a=[];for(let c of s)try{let m=await se({pmRoot:e,settings:t,id:c.id,op:"update",author:o,message:`Auto-unblocked after blocker ${r} closed`,mutate(u){let p=u.metadata.dependencies??[],f=p.filter(h=>{let y=h.id.trim().toLowerCase();return h.kind!=="blocked_by"||!c.blocker_ids.includes(y)});u.metadata.status=i.open_status,delete u.metadata.blocked_by,delete u.metadata.blocked_reason,u.metadata.unblock_note=`Auto-unblocked after blocker ${r} closed; all blockers resolved (${c.blocker_ids.join(", ")}).`,f.length>0?u.metadata.dependencies=f:delete u.metadata.dependencies;let _=["status","blocked_by","blocked_reason","unblock_note"];return f.length!==p.length&&_.push("dependencies"),{changedFields:_}}});a.push(`auto_unblocked:${m.item.id}:resolved_blockers=${c.blocker_ids.join(",")}`)}catch(m){let u=m instanceof Error?m.message.replace(/\s+/g," ").trim():"unknown";a.push(`auto_unblock_failed:${c.id}:${u}`)}return a}function Rk(e,t){let n=[],r=[{option:t.resolution,key:"resolution"},{option:t.expectedResult,key:"expected_result"},{option:t.actualResult,key:"actual_result"}];for(let{option:o,key:i}of r){if(typeof o!="string")continue;let s=o.trim();s.length!==0&&(e[i]=s,n.push(i))}return n}function Ik(e,t){if(t===void 0)return[];e.duplicate_of=t;let n=[],r=[{key:"resolution",value:`Duplicate of ${t}`},{key:"expected_result",value:`Canonical item ${t} tracks the work.`},{key:"actual_result",value:`Closed as duplicate of ${t}.`}];for(let{key:o,value:i}of r)Sk(e[o])&&(e[o]=i,n.push(o));return n}function Ok(e,t,n,r){let o=[];if(t!=="off"){let i=D_(e);if(i.length>0){let s=i.map(a=>a.label);if(t==="strict"){let a=i.map(m=>`--${m.key.replaceAll("_","-")}`),c=["--pm-path",r,"update",e.id,...a.flatMap(m=>[m,"<value>"])];throw new d(`Cannot close item ${e.id}: missing ${s.join(", ")}. Populate fields or use --validate-close warn.`,l.USAGE,{code:"close_validation_missing_fields",recovery:{missing:a,suggested_retry:dr(c)},nextSteps:["Run the suggested pm update, then retry the original pm close invocation.","Use --validate-close warn only when governance permits an evidenced exception."]})}o.push(`close_validation_missing_fields:${e.id}:${s.join(",")}`)}if(n.length>0){if(t==="strict")throw new d(`Cannot close item ${e.id}: active child items remain open (${n.join(", ")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,l.USAGE);o.push(`close_validation_active_children:${e.id}:${n.join(",")}`)}return o}return n.length>0&&o.push(`closed_with_active_children:${e.id}:${n.join(",")}`),o}function xk(e,t){return t!==void 0?(e.close_reason=t,["close_reason"]):[]}function Pk(e){return e.assignee===void 0?[]:(delete e.assignee,["assignee"])}function Lk(e,t){if(ne(e.status,t.statusRegistry)&&!t.force)throw new d(`Item ${e.id} is already terminal; use pm update to append acceptance evidence, or --force only for an intentional repeat closure.`,l.CONFLICT,{recovery:U_(e,t.pmRoot,t.options)});let n=Rk(e,t.options),r=Ik(e,t.duplicateOf),o=Ok(e,t.validateCloseMode,t.activeChildIds,t.pmRoot);e.status=t.statusRegistry.close_status,e.closed_at=t.closedAt;let i=t.options.completedAt!==void 0||e.completed_at===void 0;i&&(e.completed_at=t.completedAt);let s=["status","closed_at",...i?["completed_at"]:[],...xk(e,t.closeReason),...n];if(Vp(e)&&(e.plan_mode="completed",s.push("plan_mode")),t.duplicateOf!==void 0){s.push("duplicate_of");for(let c of r)s.includes(c)||s.push(c)}s.push(...Pk(e));let a=Tc(e,t.lifecyclePolicy);return s.push(...a.changedFields),o.push(...a.warnings),{changedFields:s,...o.length>0?{warnings:o}:{}}}async function G_(e,t,n,r){let o=E(process.cwd(),r.path);await R(o);let i=await A(o),s=F(i.schema),a=C(n.author,i.author_default),c=x(i,O()).type_to_folder,m=await q(o,e,i.id_prefix,i.item_format,c);if(!m)throw await _t(o,e,i.id_prefix,c);let u=await Ek(o,i,n.duplicateOf,m.id),p={requireCloseReason:n.lifecyclePolicy?.requireCloseReason??i.governance.require_close_reason,orderingEdges:n.lifecyclePolicy?.orderingEdges??"preserve"},f=Ec({explicit:t,duplicateOf:u,resolution:n.resolution,message:n.message},p.requireCloseReason).closeReason,_=bk(n.validateClose)??i.governance.close_validation_default,h=await fe(o,i.item_format,c,void 0,i.schema),y=Ak(h,m.id,s),g=S(),v=n.completedAt===void 0?g:oe(n.completedAt,new Date(g),"completed-at"),b=await se({pmRoot:o,settings:i,id:m.id,op:"close",author:a,message:n.message,force:n.force,mutate(T){return Lk(T.metadata,{pmRoot:o,statusRegistry:s,force:n.force,options:n,duplicateOf:u,validateCloseMode:_,activeChildIds:y,closeReason:f,closedAt:g,completedAt:v,lifecyclePolicy:p})}}),k=_==="warn"?U_(b.item,o):void 0;return{item:b.item,changed_fields:b.changedFields,...k?{recovery:k}:{},warnings:[...b.warnings,...await Ck(o,i,h,m.id,a,s)]}}function yt(e,t,n,r){return G_(e,t,n,r)}(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]="c45ead8e-c9ed-5b59-84e5-b8e077e84010")}catch{}})();function ji(e){let t=e.trim();return t.toLowerCase()==="med"?"medium":t}function qi(e){let t=e.trim();return t.toLowerCase()==="med"?"medium":t}function Ki(e){let t=e.trim().toLowerCase();if(t==="med")return"medium";if(so.includes(t))return t;let n=_e(e,"confidence");if(!Number.isInteger(n)||n<0||n>100)throw new d("Confidence must be an integer 0..100 or one of low|med|medium|high",l.USAGE);return n}function zi(e){let t=e.trim().toLowerCase();if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1;throw new d("Regression must be one of true|false|1|0",l.USAGE)}(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]="add1928e-08d1-5ead-9a4e-0f1a9b6580fc")}catch{}})();var Nk=new Set(["none","null"]);function Bi(e={}){return[{optionKey:"dep",clearFlagKey:"clearDeps",valueFlag:"--dep",clearFlag:"--clear-deps",...e.depDisableFlagKey===void 0?{}:{disableFlagKey:e.depDisableFlagKey}},{optionKey:"comment",clearFlagKey:"clearComments",valueFlag:"--comment",clearFlag:"--clear-comments"},{optionKey:"note",clearFlagKey:"clearNotes",valueFlag:"--note",clearFlag:"--clear-notes"},{optionKey:"learning",clearFlagKey:"clearLearnings",valueFlag:"--learning",clearFlag:"--clear-learnings"},{optionKey:"file",clearFlagKey:"clearFiles",valueFlag:"--file",clearFlag:"--clear-files",...e.fileDisableFlagKey===void 0?{}:{disableFlagKey:e.fileDisableFlagKey}},{optionKey:"test",clearFlagKey:"clearTests",valueFlag:"--test",clearFlag:"--clear-tests",...e.testDisableFlagKey===void 0?{}:{disableFlagKey:e.testDisableFlagKey}},{optionKey:"doc",clearFlagKey:"clearDocs",valueFlag:"--doc",clearFlag:"--clear-docs",...e.docDisableFlagKey===void 0?{}:{disableFlagKey:e.docDisableFlagKey}},{optionKey:"reminder",clearFlagKey:"clearReminders",valueFlag:"--reminder",clearFlag:"--clear-reminders"},{optionKey:"event",clearFlagKey:"clearEvents",valueFlag:"--event",clearFlag:"--clear-events"},{optionKey:"typeOption",clearFlagKey:"clearTypeOptions",valueFlag:"--type-option",clearFlag:"--clear-type-options"}]}function Ve(e){return e===void 0?!1:Nk.has(e.trim().toLowerCase())}function Hi(e,t,n){if(!Ve(e))return;let r=n?` ${n}`:"";throw new d(`${t} no longer accepts "none" or "null".${r}`.trim(),l.USAGE)}function Ce(e,t,n){if(!e||e.length===0||!e.some(i=>Ve(i)))return;let o=n?` ${n}`:"";throw new d(`${t} no longer accepts "none" or "null".${o}`.trim(),l.USAGE)}function Vi(e,t){for(let n of t){let r=e[n.optionKey];if(!Array.isArray(r)||r.length===0)continue;if(!r.every(a=>typeof a=="string"))throw new d(`${n.valueFlag} entries must be strings.`,l.USAGE);let o=r;if(!o.some(a=>Ve(a)))continue;if(o.filter(a=>!Ve(a)).length>0)throw new d(`Cannot mix legacy clear token "none"/"null" with concrete ${n.valueFlag} entries. Use ${n.clearFlag} to clear or provide explicit entries.`,l.USAGE);e[n.optionKey]=void 0,e[n.clearFlagKey]=!0,n.disableFlagKey&&(e[n.disableFlagKey]=!1)}return 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]="49f970c3-e408-52d5-bb4d-8cea0c7f8ef4")}catch{}})();function q_(e,t){let n=e.trim().toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no")return!1;throw new d(`${t} must be one of true|false|1|0|yes|no`,l.USAGE)}function Cc(e){return e?e.split("|").map(t=>t.trim()).filter(t=>t.length>0):[]}function Re(e,t,n,r=n){if(!t.includes(e))throw new d(`Invalid ${n} value "${e}". Allowed: ${t.join(", ")}`,l.USAGE,{field:r,required:`${n} must be one of: ${t.join(", ")}.`,nextSteps:[`Choose an allowed ${n} and retry the mutation.`]});return e}var K_=["recur_freq","recur_interval","recur_count","recur_until","recur_by_weekday","recur_by_month_day","recur_exdates"];function Mk(e,t){return t==="defined"?e!==void 0:!!e}function j_(e,t,n){if(!Mk(e,n))return;let r=_e(e,`event ${t}`);if(!Number.isInteger(r)||r<1)throw new d(`--event ${t} must be an integer >= 1`,l.USAGE);return r}function $k(e,t,n){let r=e?oe(e,n,"event.recur_until"):void 0;if(r&&r<t)throw new d("--event recur_until must be at or after start",l.USAGE);return r}function Fk(e){return Array.from(new Set(Cc(e).map(t=>Re(t.toLowerCase(),Ld,"event weekday")))).sort((t,n)=>oa(t)-oa(n))}function Dk(e){return Array.from(new Set(Cc(e).map(t=>{let n=_e(t,"event recur_by_month_day");if(!Number.isInteger(n)||n<1||n>31)throw new d("--event recur_by_month_day values must be integers 1..31",l.USAGE);return n}))).sort((t,n)=>t-n)}function Uk(e,t){return Array.from(new Set(Cc(e).map(n=>oe(n,t,"event.recur_exdates")))).sort((n,r)=>n.localeCompare(r))}function z_(e,t,n,r){let o=e.recur_freq?.trim(),i=e.recur_interval?.trim(),s=e.recur_count?.trim(),a=e.recur_until?.trim(),c=e.recur_by_weekday?.trim(),m=e.recur_by_month_day?.trim(),u=e.recur_exdates?.trim();if(![o,i,s,a,c,m,u].some(k=>k!==void 0))return;if(!o)throw new d("--event recurrence fields require recur_freq=<daily|weekly|monthly|yearly>",l.USAGE);let f=Re(o.toLowerCase(),Pd,"event recurrence frequency"),_=j_(i,"recur_interval",r),h=j_(s,"recur_count",r),y=$k(a,t,n),g=Fk(c),v=Dk(m),b=Uk(u,n);return{freq:f,interval:_,count:h,until:y,by_weekday:g.length>0?g:void 0,by_month_day:v.length>0?v:void 0,exdates:b.length>0?b:void 0}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae7fdf9b-e2d5-511e-90db-cf0bc121628d")}catch{}})();var B_="--event end must be strictly after start. Equal start/end timestamps are treated as an instant event (end is dropped); an end earlier than start is rejected. Omit end for an instant event or set end later than start.",Gk="--event end and duration are mutually exclusive; provide only one (use duration=<relative> like duration=2h, duration=30min, or duration=PT30M, or set an explicit end).",jk=/^([+-]?)(\d+)(min|mins|minute|minutes)$/i,qk=/^([+-]?)[Pp][Tt](?:(\d+)[Hh])?(?:(\d+)[Mm])?(?:(\d+)[Ss])?$/,V_=1e3,Rc=60*V_,Kk=60*Rc;function H_(e,t){let n=new Date(e);if(!Number.isFinite(n.getTime()))throw new d(`Invalid event.duration value "${t}". Duration is out of supported timestamp range.`,l.USAGE);return n.toISOString()}function zk(e,t){let n=new Date(e),r=t.trim(),o=jk.exec(r);if(o){let a=o[1]==="-"?-1:1,c=Number.parseInt(o[2],10)*a;return H_(n.getTime()+c*Rc,r)}let i=qk.exec(r);if(i){let[,a,c,m,u]=i;if(c||m||u){let f=a==="-"?-1:1,_=Number.parseInt(c??"0",10),h=Number.parseInt(m??"0",10),y=Number.parseInt(u??"0",10),g=_*Kk+h*Rc+y*V_;return H_(n.getTime()+f*g,r)}}let s=r.startsWith("+")||r.startsWith("-")?r:`+${r}`;return oe(s,n,"event.duration")}function W_(e,t,n,r){if(t&&n)throw new d(Gk,l.USAGE);if(n){let i=zk(e,n);if(i<e)throw new d(B_,l.USAGE);return i===e?void 0:i}if(!t)return;let o=oe(t,r,"event.end");if(o<e)throw new d(B_,l.USAGE);if(o!==e)return 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]="dfce9924-8453-5ded-a5df-47477caa9fe7")}catch{}})();var Bk=["at","date","text","title"],Hk=["start","date","end","duration","title","description","location","timezone","all_day",...K_],Vk=["key","value"];function Y_(e,t){return t==="trimmed"?e?.trim():e}function Wk(e,t){return t==="defined"?e!==void 0:!!e}function Wi(e,t,n){return e.map(r=>{let o=le(r,"--reminder");He(o,"--reminder",Bk);let i=Y_(o.at??o.date,n.valueMode),s=Y_(o.text??o.title,n.valueMode);if(!i||!s)throw new d("--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>",l.USAGE);let a=s.trim();if(!a)throw new d("--reminder text must not be empty",l.USAGE);return{at:oe(i,t,"reminder.at"),text:a}})}function Yi(e,t,n){return e.map(r=>{let o=le(r,"--event");He(o,"--event",Hk);let i=(o.start??o.date)?.trim();if(!i)throw new d("--event requires start=<iso|relative> or date=<iso|relative>",l.USAGE);let s=oe(i,t,"event.start"),a=o.end?.trim(),c=o.duration?.trim(),m=W_(s,a,c,t),u=o.title,p=o.description,f=o.location,_=o.timezone,h=u?.trim(),y=p?.trim(),g=f?.trim(),v=_?.trim(),b=[["title",u,h],["description",p,y],["location",f,g],["timezone",_,v]];for(let[M,$,K]of b)if($!==void 0&&!K)throw new d(`--event ${M} must not be empty`,l.USAGE);let k=o.all_day?.trim(),T=z_(o,s,t,n.recurrenceEmptyNumericGuard),I=Wk(k,n.allDayEmptyGuard)?q_(k,"--event all_day"):void 0;return{start_at:s,end_at:m,title:h,description:y,location:g,all_day:I,timezone:v,recurrence:T}})}function Ji(e){let t={};for(let n of e){let r=n.trim();if(r.length===0)throw new d("--type-option values must not be empty",l.USAGE);let o,i;if(r.includes(",")||r.includes(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$b as ki,A as Ie,B as $e,C as Be,D as Ce,E as De,F as Ne,G as Oe,Ma as Xe,Na as Le,Oa as Qe,Qb as ai,Rb as di,Sb as ui,Tb as si,Ub as fi,Vb as pi,Wb as ci,Xb as _i,Yb as li,Zb as mi,_b as gi,ac as Ai,ba as Ue,bc as Ei,c as oe,ca as Pe,cc as _,d as ae,da as je,db as Me,dc as Ri,e as de,ea as Fe,ec as Si,f as ue,fa as qe,fc as Ti,g as se,ga as ze,gc as Ii,h as fe,ha as Je,hb as ei,hc as l,i as pe,ia as We,ib as ii,j as ce,ja as Ze,jb as ri,k as _e,kb as ti,l as le,lb as ni,m as me,mb as oi,n as xe,o as ve,p as be,pa as Ge,q as ye,qa as He,r as he,ra as Ve,s as we,sa as Ye,t as ge,ta as Ke,u as ke,v as Ae,w as Ee,x as Re,y as Se,z as Te}from"./focused-chunks/chunk-
|
|
1
|
+
import{$b as ki,A as Ie,B as $e,C as Be,D as Ce,E as De,F as Ne,G as Oe,Ma as Xe,Na as Le,Oa as Qe,Qb as ai,Rb as di,Sb as ui,Tb as si,Ub as fi,Vb as pi,Wb as ci,Xb as _i,Yb as li,Zb as mi,_b as gi,ac as Ai,ba as Ue,bc as Ei,c as oe,ca as Pe,cc as _,d as ae,da as je,db as Me,dc as Ri,e as de,ea as Fe,ec as Si,f as ue,fa as qe,fc as Ti,g as se,ga as ze,gc as Ii,h as fe,ha as Je,hb as ei,hc as l,i as pe,ia as We,ib as ii,j as ce,ja as Ze,jb as ri,k as _e,kb as ti,l as le,lb as ni,m as me,mb as oi,n as xe,o as ve,p as be,pa as Ge,q as ye,qa as He,r as he,ra as Ve,s as we,sa as Ye,t as ge,ta as Ke,u as ke,v as Ae,w as Ee,x as Re,y as Se,z as Te}from"./focused-chunks/chunk-63YRRGKX.js";import"./focused-chunks/chunk-YBQTVE5S.js";import{h as j}from"./focused-chunks/chunk-PBJC2ZNA.js";import{E as B,F as C,G as D,H as N,I as O,J as U,K as P}from"./focused-chunks/chunk-UACMCSCC.js";import"./focused-chunks/chunk-MD7ADLME.js";import{Ba as L,Ca as Q,Da as M,Ea as ee,Fa as ie,Ga as re,Ha as te,Ia as ne,ob as xi,pb as vi,qb as bi,rb as yi,sb as hi,tb as wi,ua as G,va as H,wa as V,xa as Y,ya as K,za as X}from"./focused-chunks/chunk-ZOE2NSJB.js";import"./focused-chunks/chunk-5SBU4QDC.js";import"./focused-chunks/chunk-533DCWPY.js";import"./focused-chunks/chunk-SHF57M2H.js";import{D as F,E as q,F as z,G as J,H as W,db as Z}from"./focused-chunks/chunk-6C3CUU2G.js";import"./focused-chunks/chunk-OGGF2RBL.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{Ob as h,Pb as w,Qb as g,Rb as k,Sb as A,Tb as E,Td as c,Ub as R,Vb as S,Wb as T,Xb as I,Yb as $}from"./focused-chunks/chunk-4YTDKIPF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var m=["captured_redacted","captured_verbatim"],x=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function n(e){return typeof e=="string"&&e.trim().length>0}function v(e,i){if(typeof i!="object"||i===null||Array.isArray(i))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=i,t=[];r.boundary_id!==e.id&&t.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!m.includes(r.capture_source)||!n(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(n)||!("input"in r)||!("observed"in r))&&t.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let a=JSON.stringify(i);for(let s of x)s.pattern.test(a)&&t.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return t}function b(e,i){let r=Date.parse(e.waiver_expires_at),t=n(e.waiver_reason)&&n(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&c(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:t&&r>=i?1:0,findings:t?r<i?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function y(e,i,r){if(!n(e.id)||!n(e.producer)||!n(e.consumer)||!n(e.format))return{captured:0,waived:0,findings:[{boundary_id:n(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let t=i[e.fixture_path],a=n(e.fixture_path)&&e.fixture_path in i?v(e,t):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:a.length===0?1:0,waived:0,findings:a}}return b(e,r)}function Bi(e,i,r=new Date){let t=[];if(e.version!==1||!n(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let a=new Set,s=0,p=0;for(let o of e.boundaries){if(typeof o!="object"||o===null||Array.isArray(o)){t.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=o,u=n(d.id)?d.id:void 0;if(u!==void 0&&a.has(u)){t.push({boundary_id:u,kind:"duplicate_boundary",detail:`Boundary ${u} is inventoried more than once.`});continue}u!==void 0&&a.add(u);let f=y(d,i,r.getTime());s+=f.captured,p+=f.waived,t.push(...f.findings)}return t.sort((o,d)=>o.boundary_id!==d.boundary_id?o.boundary_id.localeCompare(d.boundary_id):o.kind.localeCompare(d.kind)),{ok:t.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:p,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="ae8f06a0-a2e6-5f91-99f7-e822270b491d")}catch{}})();export{ci as ASSURANCE_ACTIONS,_i as ASSURANCE_DECLARATION_KINDS,fe as ASSURANCE_DOCUMENT_VERSION,pe as ASSURANCE_GATE_TRIGGERS,ce as ASSURANCE_MEASUREMENT_SOURCE_KINDS,Ie as ASSURANCE_PRESET_IDS,ae as AssuranceEvaluationRefusalError,oe as AssuranceMutationRefusalError,de as AssuranceSourceResolutionError,m as BOUNDARY_FIXTURE_CAPTURE_SOURCES,z as CURRENT_HISTORY_HASH_ALGORITHM,B as DEFECT_ESCAPE_CLASSES,C as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ue as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,F as HISTORY_HASH_ALGORITHMS,q as LEGACY_HISTORY_HASH_ALGORITHM,w as MAX_WORKFLOW_POLICIES,g as MAX_WORKFLOW_POLICY_TERMS,j as PM_HISTORY_ATTESTATION_CONTRACT,G as PM_MUTATION_ACTION_CONTRACTS,h as WORKFLOW_POLICY_ACTIONS,He as WORKFLOW_POLICY_DOCUMENT_SCHEMA,Ge as WORKFLOW_POLICY_SCHEMA,ti as _testOnlyHealthCommand,vi as _testOnlySimilarity,di as _testOnlyValidateCommand,Ii as _testOnlyWorkspacePosition,De as acceptAssuranceProposals,Ze as acknowledgeUnknownAuthorHistoryEvents,We as acknowledgeUnknownAuthorHistoryEventsFromTransport,N as analyzeDefectChangeRisk,pi as analyzeDefectRecurrenceCoverage,yi as analyzeDuplicateItems,Be as applyAssurancePreset,_e as assuranceAssertionUpdateIsLoosening,D as buildDefectRecurrenceIndex,ni as buildLinkedFileRepairReport,ii as buildStatusRoleWarnings,Ve as buildWorkflowCompletenessCheck,Pe as classifyHistoryAuthorEvent,$e as createAssurancePreset,si as createAssuranceWorkspaceContext,be as createEmptyAssuranceDocument,Ye as createLifecycleCompletenessPolicies,$ as createWorkflowPolicyEvaluator,Ce as deriveAssuranceProposals,he as evaluateAssuranceAssertion,we as evaluateAssuranceGate,Bi as evaluateBoundaryFixtures,O as evaluateDefectGateEvidence,ye as evaluateMeasurement,V as evaluateMutationGuard,wi as evaluateSimilarityGovernance,I as evaluateWorkflowPolicies,ki as exportAttestation,hi as findDuplicateClusters,bi as findSimilarItems,Ti as formatWorkspacePositionHuman,ke as getAssuranceDeclaration,X as getMutationActionContract,W as historyDigest,je as inspectHistoryAuthorStream,te as inspectStaleInProgressItems,ei as inspectStatusRoleAssignments,Y as isMutationAction,L as jaccardSimilarity,ge as listAssuranceDeclarations,Te as listAssuranceVerdicts,Le as listInvalidProvenanceHistoryStreamIds,K as listMutationActions,se as normalizeAssuranceEvaluation,ue as normalizeAssuranceMutation,Xe as normalizeInvalidHistoryProvenance,Q as normalizeSimilarityText,P as parseDefectChangeRiskRequest,fi as parseDefectRecurrenceCoverageRequest,U as parseDefectRecurrencePolicy,gi as parseHistoryAttestation,Je as parseUnknownAuthorHistoryEventCoordinates,k as parseWorkflowPolicy,A as parseWorkflowPolicyDocument,qe as planUnknownAuthorHistoryAcknowledgment,ee as prepareSimilarityText,ai as projectValidateCounts,Ne as promoteAssuranceAssertion,Ae as putAssuranceDeclaration,Ee as putAssuranceDeclarationBundle,Z as readWorkflowPolicies,E as readWorkflowPolicyField,Si as readWorkspacePosition,Se as recordAssuranceVerdict,Re as removeAssuranceDeclaration,J as resolveHistoryHashAlgorithm,ze as resolveUnknownAuthorAcknowledgmentSelector,li as runAssuranceAction,mi as runAssuranceDispatch,Ri as runGc,ri as runHealth,Ei as runHistoryAttest,Me as runHistoryMaintenance,l as runReindex,_ as runUpgrade,ui as runValidate,Ke as runWorkflowPolicyAction,Oe as scanExtensionHostVersions,Fe as scanHistoryAuthorAttribution,H as scanMutationSecrets,Qe as scanProvenanceResolverHealth,ne as scanStaleInProgressItems,oi as scanStorageIntegrity,ie as scoreItemSimilarity,re as scorePreparedItemSimilarity,xi as similarityAdvisoryWarnings,M as tokenizeSimilarityText,me as validateAssertionDefinition,ve as validateAssuranceDocument,xe as validateGateDefinition,le as validateMeasurementDefinition,Ai as verifyAttestation,S as workflowApprovalFingerprint,T as workflowPolicyApplies,R as workflowPolicyFingerprint};
|
|
2
2
|
//# sourceMappingURL=sdk-governance.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Be,b as ze,c as Ie}from"./focused-chunks/chunk-FHQLQOUZ.js";import{A as me,B as ye,C as we,D as be,E as Re,F as _e,G as ke,H as Ae,I as Ge,J as Se,K as Ee,a as We,b as je,c as Fe,d as Ue,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as te,m as re,n as ne,o as ie,p as se,q as oe,r as ae,s as pe,t as ce,u as de,v as le,w as he,x as fe,y as ge,z as ue}from"./focused-chunks/chunk-D4FQV6TY.js";import{Jb as $,Kb as v,Lb as H,Mb as P,Nb as M,Ob as N,Pb as B,Qb as z,Rb as W,Sb as j,Tb as F,Vb as k,Wb as U,Xb as L,Yb as V,Zb as K,_b as Le,ec as Ve,fc as Ke,gc as qe,hc as Je,ic as Ze,jc as Qe,kc as Xe,lc as Ye,mc as et}from"./focused-chunks/chunk-N23WTRCC.js";import"./focused-chunks/chunk-7BUJABHB.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{$a as E,Za as $e,_a as _,ab as ve,bb as He,cb as Pe,db as Me,eb as f,ec as x,fb as Ne,pb as b}from"./focused-chunks/chunk-GGDO6VBT.js";import{createHash as De}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:De("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Te(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function d(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await d(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await d(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ce(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let c=n.get(o.kind);if(c&&b(c)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){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]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function I(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Oe(e){let t=I(e.nodeCount,"nodeCount"),r=I(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function D(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=E(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await d(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await d(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await d(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await d(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xe(e){return D(new m,e?{workspace: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]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();import{createHash as T}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function C(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Et(e,t){let r=C(t.migrationId,"migrationId"),n=C(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),c=s.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${S}`,relationshipId:`migration:${r}:${S}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:c})).digest("hex"),O=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!O.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(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]="3160880c-9d85-52c5-ae1d-ada213f56ce6")}catch{}})();export{Ke as ACTIONABILITY_ORDERING_KINDS,$e as BUILTIN_RELATIONSHIP_KINDS,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,x as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Be as RelationshipEventLog,ze as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,L as WorkspaceGraphCache,je as analyzeGraphImpact,H as analyzeHierarchyIntegrity,Fe as analyzeKnowledgeGraph,We as analyzeRelationshipExecution,se as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,N as assertHierarchyMutationAllowed,xe as assertMemoryRelationshipGraphAdapterConformance,Me as assertRelationshipEdgeAllowed,D as assertRelationshipGraphAdapterConformance,le as auditWorkspaceRelationshipGraph,Le as buildRelationshipContext,ve as canonicalizeRelationshipKind,be as clearDurableGraphCache,qe as collectBlockedByIds,Ze as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Xe as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,de as collectDuplicateRelationshipEdgeGroups,v as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ie as collectNewOrderingCycleWarnings,ae as collectOrderingCycles,W as collectOrderingStorageContradictions,Ue as compareRelationshipSnapshots,et as computeActionabilityReport,ne as computeRelationshipCentrality,re as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,E as createRelationshipKindRegistry,Ne as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,he as diffRelationshipAuditSnapshots,ue as durableGraphCachePath,Re as durableGraphCacheStatus,X as enumerateRelationshipPaths,Ce as federateRelationshipGraphSnapshots,te as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,P as formatHierarchyRelation,pe as formatOrderingStorageContradiction,me as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Je as indexBlockedByIds,M as indexHierarchyRelations,Pe as isOrderingRelationshipKind,ke as loadGraphAuditBaseline,d as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Et as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,He as resolveCanonicalRelationshipKind,Qe as resolveItemBlockers,Ve as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,Ee as runGraph,Ae as saveGraphAuditBaseline,Ye as selectActionableEntries,_e as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,V as workspaceGraphCache};
|
|
1
|
+
import{a as Be,b as ze,c as Ie}from"./focused-chunks/chunk-JKJYXCT6.js";import{A as me,B as ye,C as we,D as be,E as Re,F as _e,G as ke,H as Ae,I as Ge,J as Se,K as Ee,a as We,b as je,c as Fe,d as Ue,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as te,m as re,n as ne,o as ie,p as se,q as oe,r as ae,s as pe,t as ce,u as de,v as le,w as he,x as fe,y as ge,z as ue}from"./focused-chunks/chunk-MD7ADLME.js";import{$b as Le,Kb as $,Lb as v,Mb as H,Nb as P,Ob as M,Pb as N,Qb as B,Rb as z,Sb as W,Tb as j,Ub as F,Wb as k,Xb as U,Yb as L,Zb as V,_b as K,fc as Ve,gc as Ke,hc as qe,ic as Je,jc as Ze,kc as Qe,lc as Xe,mc as Ye,nc as et}from"./focused-chunks/chunk-6C3CUU2G.js";import"./focused-chunks/chunk-OGGF2RBL.js";import"./focused-chunks/chunk-HFAW3FJQ.js";import{$a as E,Za as $e,_a as _,ab as ve,bb as He,cb as Pe,db as Me,eb as f,ec as x,fb as Ne,pb as b}from"./focused-chunks/chunk-4YTDKIPF.js";import{createHash as De}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:De("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Te(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function d(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await d(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await d(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ce(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let c=n.get(o.kind);if(c&&b(c)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){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]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function I(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Oe(e){let t=I(e.nodeCount,"nodeCount"),r=I(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function D(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=E(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await d(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await d(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await d(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await d(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xe(e){return D(new m,e?{workspace: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]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}catch{}})();import{createHash as T}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function C(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Et(e,t){let r=C(t.migrationId,"migrationId"),n=C(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),c=s.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${S}`,relationshipId:`migration:${r}:${S}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:c})).digest("hex"),O=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!O.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(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]="3160880c-9d85-52c5-ae1d-ada213f56ce6")}catch{}})();export{Ke as ACTIONABILITY_ORDERING_KINDS,$e as BUILTIN_RELATIONSHIP_KINDS,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,x as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Be as RelationshipEventLog,ze as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,L as WorkspaceGraphCache,je as analyzeGraphImpact,H as analyzeHierarchyIntegrity,Fe as analyzeKnowledgeGraph,We as analyzeRelationshipExecution,se as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,N as assertHierarchyMutationAllowed,xe as assertMemoryRelationshipGraphAdapterConformance,Me as assertRelationshipEdgeAllowed,D as assertRelationshipGraphAdapterConformance,le as auditWorkspaceRelationshipGraph,Le as buildRelationshipContext,ve as canonicalizeRelationshipKind,be as clearDurableGraphCache,qe as collectBlockedByIds,Ze as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Xe as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,de as collectDuplicateRelationshipEdgeGroups,v as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ie as collectNewOrderingCycleWarnings,ae as collectOrderingCycles,W as collectOrderingStorageContradictions,Ue as compareRelationshipSnapshots,et as computeActionabilityReport,ne as computeRelationshipCentrality,re as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,E as createRelationshipKindRegistry,Ne as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,he as diffRelationshipAuditSnapshots,ue as durableGraphCachePath,Re as durableGraphCacheStatus,X as enumerateRelationshipPaths,Ce as federateRelationshipGraphSnapshots,te as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,P as formatHierarchyRelation,pe as formatOrderingStorageContradiction,me as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Je as indexBlockedByIds,M as indexHierarchyRelations,Pe as isOrderingRelationshipKind,ke as loadGraphAuditBaseline,d as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Et as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,He as resolveCanonicalRelationshipKind,Qe as resolveItemBlockers,Ve as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,Ee as runGraph,Ae as saveGraphAuditBaseline,Ye as selectActionableEntries,_e as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,V as workspaceGraphCache};
|
|
2
2
|
//# sourceMappingURL=sdk-graph.js.map
|