@unbrained/pm-cli 2026.9.30 → 2026.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +12 -0
  3. package/dist/cli/register-list-query.d.ts +8 -5
  4. package/dist/cli/register-list-query.js +2 -2
  5. package/dist/cli-bundle/bundle-manifest.json +82 -82
  6. package/dist/cli-bundle/chunks/{chunk-6XTJLOKW.js → chunk-7E2EBJLY.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-O23CQ5T4.js → chunk-A2UPOCSW.js} +7 -7
  8. package/dist/cli-bundle/chunks/{chunk-BTCE36JS.js → chunk-AYHLUJKD.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-6YEET7XI.js → chunk-DGOIXJZJ.js} +42 -42
  10. package/dist/cli-bundle/chunks/{chunk-BX4LEJX4.js → chunk-HGJLVN56.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-A6NDNRCK.js → chunk-JAVO3Z42.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-EGAIIWI3.js → chunk-SCZMJ5DC.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-FYTXVVZG.js → chunk-TV3YDE36.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-XRN3JYNN.js → chunk-VWVFKPLX.js} +2 -2
  15. package/dist/cli-bundle/chunks/{register-list-query-SYNBVMNG.js → register-list-query-L6HAHW7V.js} +6 -6
  16. package/dist/cli-bundle/chunks/{register-mutation-4GSUK23D.js → register-mutation-6OCZVTW5.js} +2 -2
  17. package/dist/cli-bundle/chunks/{register-operations-7FCJUC4Z.js → register-operations-3E5U4TOE.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-setup-YTWW2KL5.js → register-setup-VUD37N4A.js} +2 -2
  19. package/dist/cli-bundle/focused-chunks/{chunk-KZULQIAG.js → chunk-6275G2AN.js} +2 -2
  20. package/dist/cli-bundle/focused-chunks/{chunk-EFD4ATS7.js → chunk-DJPP2HAK.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-AKB3JN57.js → chunk-YBQ27KG7.js} +45 -45
  22. package/dist/cli-bundle/main.js +2 -2
  23. package/dist/cli-bundle/sdk-contracts.js +1 -1
  24. package/dist/cli-bundle/sdk-core.js +1 -1
  25. package/dist/cli-bundle/sdk-governance.js +1 -1
  26. package/dist/cli-bundle/sdk-merge.js +22 -22
  27. package/dist/cli-bundle/sdk-query.js +1 -1
  28. package/dist/cli-bundle/sdk-runtime.js +1 -1
  29. package/dist/cli-bundle/sdk-testing.js +1 -1
  30. package/dist/cli-bundle/sdk.js +1 -1
  31. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  32. package/dist/sdk/merge/install.d.ts +2 -2
  33. package/dist/sdk/merge/install.js +1 -1
  34. package/dist/sdk/public-surface.json +1 -1
  35. package/dist/sdk/query/get.d.ts +19 -15
  36. package/dist/sdk/query/get.js +1 -1
  37. package/docs/BOUNDED_CONTEXT_READS.md +10 -7
  38. package/docs/COMMANDS.md +1 -1
  39. package/docs/MERGE_SAFETY.md +12 -6
  40. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
  41. package/marketplace.json +2 -2
  42. package/package.json +1 -1
  43. package/packages/pm-beads/package.json +1 -1
  44. package/packages/pm-calendar/package.json +1 -1
  45. package/packages/pm-command-kit/package.json +1 -1
  46. package/packages/pm-digital-twin/package.json +1 -1
  47. package/packages/pm-governance-audit/package.json +1 -1
  48. package/packages/pm-guide-shell/package.json +1 -1
  49. package/packages/pm-kanban/package.json +1 -1
  50. package/packages/pm-lifecycle-hooks/package.json +1 -1
  51. package/packages/pm-linked-test-adapters/package.json +1 -1
  52. package/packages/pm-search-advanced/package.json +1 -1
  53. package/packages/pm-templates/package.json +1 -1
  54. package/packages/pm-todos/package.json +1 -1
  55. package/packages/pm-vcs/package.json +1 -1
  56. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  57. package/plugins/pm-claude/package.json +2 -2
  58. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  59. package/plugins/pm-codex/package.json +2 -2
  60. package/plugins/pm-codex/plugin.json +1 -1
@@ -1,4 +1,4 @@
1
- import{a as nt,b as En,c as uc,d as fc,g as _c,i as Mc}from"./chunk-6XTJLOKW.js";import{L as Bo,U as el,a as jc,c as Gc,d as Uc,e as qc,k as zc,l as Dt,m as Ge,n as Wo,u as Vo,w as Qc}from"./chunk-A6NDNRCK.js";import{$c as qo,Aa as ac,Ba as cc,Ca as kn,Da as lc,Ea as Sn,Fa as In,Ga as dc,Gb as $c,Gd as Ko,Ia as et,J as Le,Ja as mc,Jb as Fc,Jd as ll,Ka as $o,Kb as Pc,La as An,Mc as Do,Na as tt,Pb as Lt,Pc as Ie,Qc as Hc,Qd as dl,Rc as jo,Rd as ml,Sc as Wc,Tc as Vc,Uc as ot,Vc as Bc,Wa as pc,Yc as Jc,Zc as Xc,_c as Zc,ad as zo,b as Ro,bd as Ho,ed as nl,fc as Rn,fd as ol,ga as fn,gd as rl,ha as tc,hd as il,i as Ea,ia as Ft,id as sl,j as Ta,ja as h,ka as nc,kd as al,l as Ca,la as oc,ld as cl,mb as gc,mc as Nc,na as J,nb as yc,oa as rc,oc as Dc,pa as bn,qa as ic,ra as xo,sa as Pt,sb as Fo,ta as wn,tb as Po,ua as Me,ub as Lo,va as sc,vc as Nt,wa as vn,wb as bc,xa as U,xb as wc,ya as Oo,yb as No,za as j}from"./chunk-O23CQ5T4.js";import{$ as Na,D as Ra,J as xa,L as Ne,M as Oa,N as hn,O as $a,Oa as Qe,P as De,Q as Fa,R as gn,S as Pa,Va as Za,Y as La,_a as yn,b as ds,ba as Da,ca as Ma,cb as Qa,da as ja,ea as Ga,fa as Ua,fb as ec,ga as qa,h as _n,ha as za,ia as Ha,ja as Wa,ka as Va,la as Ba,ma as Ka,na as Ya,oa as Ja,pa as Xa}from"./chunk-6YEET7XI.js";import{$a as vc,Db as Se,Eb as Lc,Fb as Cn,Jb as Mo,Uc as Go,Xb as Kc,Yb as Yc,Zc as Uo,ad as tl,d as cs,f as ls,ib as kc,jb as Sc,kb as Ic,na as de,nb as Ac,ob as Ec,pb as Tc,qb as Cc,sb as je,tb as Rc,ua as hc,ub as xc,xb as Tn,zb as Oc}from"./chunk-BNAT4EYR.js";import{$c as Ti,$d as $i,$f as Oe,$i as as,$j as le,A as ae,Ab as hi,Ac as ho,Ag as go,Aj as ws,Ak as Ls,An as ra,Ao as Aa,B as oe,Bb as gi,Bc as $,Bk as Ns,Bn as ia,C as kt,Cb as yi,Ci as Ze,Cj as ln,Cn as sa,Db as bi,Df as qi,Dk as Ds,Dm as Bs,Eb as wi,Eh as Tt,Ej as vs,Ek as Ms,Fh as Ct,Fj as ks,Fk as js,Fn as aa,Ga as ro,Gc as Si,Gj as Ss,Gk as $t,Ha as io,Hc as Ii,Hd as tn,Hk as Gs,Hm as Ks,Ia as so,Ik as mn,J as si,Ja as ao,Jk as Us,Jn as ca,Kc as G,Ke as Li,Kk as Ao,Kn as la,L as ai,Lf as zi,Lg as Yi,Lk as Eo,Ln as da,M as be,Mf as F,Mg as Ji,Mi as rs,Mk as qs,Mm as Ys,Mn as ma,Ng as Xi,Nm as Js,Nn as pa,Oc as Ai,Oi as is,Pc as Ei,Pi as ss,Pm as Xs,Pn as ua,Qi as ce,Qj as Is,Qn as fa,Rb as It,Re as Ni,Ri as ve,Rn as _a,S as no,Sa as P,Sb as Jt,Sm as Zs,Sn as ha,T as ci,Ta as Yt,Tc as H,Tn as ga,Uc as en,Ue as Di,Ui as Rt,Uj as As,Un as ya,X as li,Xi as on,Xn as ba,Y as di,Yj as Es,Yn as un,Z as mi,Zh as Zi,Zn as wa,_ as pi,_a as A,_f as Ye,_h as Xe,_i as xt,_n as va,ad as Ci,ae as Fi,ag as Hi,aj as ms,ba as ui,bb as we,bf as S,bg as Wi,bh as yo,bi as bo,bj as rn,cb as co,cg as $e,ch as R,cj as sn,ck as Ts,co as ke,de as Pi,dg as Vi,di as Qi,dj as an,dk as Cs,do as E,eb as xe,ei as es,ej as cn,f as Y,ff as Mi,fg as V,fk as dn,fo as ka,gi as ts,gj as re,gk as Rs,gn as Qs,h as eo,hf as ji,hg as At,ic as Xt,if as te,ig as Bi,ii as T,ij as ps,j as ii,jc as Zt,ji as ns,jj as us,jn as ea,kc as Qt,km as zs,kn as ta,la as u,lg as Ki,mc as vi,mj as Ot,mk as xs,na as m,nj as fs,nk as Os,oa as St,od as Ri,of as Gi,oj as _s,p as Kt,pj as hs,pl as To,po as Sa,qa as oo,qj as gs,qo as Ia,rd as xi,rk as So,rl as Co,sc as ki,sg as Fe,si as wo,sn as na,ti as vo,tk as Io,tm as Hs,u as Ve,uc as lo,ud as Oi,ug as Je,un as oa,vc as mo,vj as ko,vm as Ws,wc as po,wf as Ui,wj as ys,wm as pn,x as ye,xc as uo,xj as Pe,xk as $s,xm as Vs,y as Be,yb as fi,yc as fo,yg as nn,yk as Fs,z as to,zb as _i,zc as _o,zf as Ke,zg as Et,zi as os,zj as bs,zk as Ps}from"./chunk-UIAH7UFK.js";import{AsyncLocalStorage as Dg}from"node:async_hooks";import{readFile as pp}from"node:fs/promises";import up 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 Yo="context-intents.json";function xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fp(e,t,n){if(!xn(e))throw new TypeError(`${t} context intent at index ${String(n)} must be an object`);let o=e.included_field_groups;if(typeof e.command!="string"||typeof e.intent!="string"||typeof e.description!="string"||!Array.isArray(o)||!o.every(r=>typeof r=="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:o,token_budget:e.token_budget}}function pl(e,t){let n=Array.isArray(e)?e:xn(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((o,r)=>fp(o,t,r))}async function _p(e){let t=up.join(e,Yo),n;try{n=await pp(t,"utf8")}catch(r){if(Be(r))return[];throw await zi(e),r}let o;try{o=JSON.parse(n)}catch(r){let i=r instanceof Error?r.message:String(r);throw new TypeError(`Invalid ${Yo}: ${i}`,{cause:r})}return pl(o,Yo)}function hp(e){if(!xn(e))return;let t=e.contextIntents??e.context_intents;if(t!==void 0)return t;let n=e.default;return xn(n)?n.contextIntents??n.context_intents:void 0}function gp(e){return e.flatMap(t=>{let n=hp(t.module);return n===void 0?[]:pl(n,`package ${t.name}`)})}async function yp(e){let t=await _p(e.pmRoot),n=gp(e.packages??[]);return{workspaceContracts:t,packageContracts:n}}async function Jo(e,t){let n=await yp(e);return await Ui(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]="c2766f4e-6354-55bb-9e40-676273ee901f")}catch{}})();async function ul(e,t,n=Gi){try{await n({pmRoot:e,result:t})}catch{if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=t,r=Array.isArray(o.warnings)?o.warnings.filter(i=>typeof i=="string"):[];o.warnings=[...new Set([...r,"context_usage_feedback_write_failed"])].sort()}}}import{createHash as Cp}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]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var fl="PmCliError";function bp(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=u.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function wp(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new m(e,bp(t.exitCode??u.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function Xo(e){if(!(e instanceof Error)||e.name!==fl)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}import{constants as Mt}from"node:fs";import{lstat as _l,mkdir as Qo,open as hl}from"node:fs/promises";import me from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function Zo(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship event ${t} must be non-empty`);return e.trim()}function er(e,t){let n=t.require(e.kind),o=n.direction==="undirected"?[e.source,e.target].sort().join("\0"):`${e.source}\0${e.target}`;return`${n.kind}\0${o}`}function vp(e){return Object.freeze({...e,...e.payload===void 0?{}:{payload:Object.freeze(structuredClone(e.payload))}})}function kp(e,t,n,o){let r=n.require(e.kind),i=o.outgoingOne.get(`${r.kind}\0${e.source}`);if(i!==void 0&&i!==t)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=o.incomingOne.get(`${r.kind}\0${e.target}`);if(s!==void 0&&s!==t)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let a=er(e,n),c=o.identities.get(a);if(c!==void 0&&c!==t)throw new TypeError(`Relationship edge already active: ${a}`)}function Sp(e){let t=new Map;for(let n of e)n.action==="remove"?t.delete(n.relationshipId):t.set(n.relationshipId,n.edge);return t}function Ip(e,t,n){if(e.expectedVersion!==void 0&&e.expectedVersion!==t)throw new TypeError(`Relationship event version conflict: expected ${e.expectedVersion}, current ${t}`);let o=Zo(e.eventId,"eventId");if(n.has(o))throw new TypeError(`Relationship event already exists: ${o}`);if(e.action!=="add"&&e.action!=="remove"&&e.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${e.action}`);if(!Number.isFinite(Date.parse(e.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:o,relationshipId:Zo(e.relationshipId,"relationshipId"),author:Zo(e.author,"author"),timestamp:new Date(e.timestamp).toISOString()}}function Ap(e,t,n,o,r,i){let s=n.has(t);if(e.action==="add"&&s)throw new TypeError(`Relationship is already active: ${t}`);if(e.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${t}`);if(e.action==="remove")return;if(!e.edge)throw new TypeError(`Relationship ${e.action} event requires an edge`);let a=typeof e.edge.source=="string"?e.edge.source.trim():"",c=typeof e.edge.target=="string"?e.edge.target.trim():"";if(!o.has(a)||!o.has(c))throw new TypeError(`Relationship endpoint not found: ${a} -> ${c}`);let l=new Ve([a,c],[e.edge],r).edges()[0];return kp(l,t,r,i),vp(l)}var jt=class{#t;#n;#o=[];#i=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(t,n={}){this.#t=new Set([...t].filter(o=>typeof o=="string").map(o=>o.trim()).filter(Boolean)),this.#n=n.registry??Kt()}get version(){return this.#o.length}events(){return Object.freeze([...this.#o])}*stream(t={}){let n=t.fromVersion??1,o=t.toVersion??this.version,r=t.batchSize??100;if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${o}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(n>o+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let i=n-1;i<o;i+=r)yield Object.freeze(this.#o.slice(i,Math.min(i+r,o)))}project(t,n,o={}){if(typeof n!="function")throw new TypeError("Relationship event projection requires a reducer");let r=t,i=0,s;for(let a of this.stream({...o,batchSize:256}))for(let c of a)r=n(r,c),i+=1,s=c;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(o.fromVersion??1)-1),processed:i,...s===void 0?{}:{asOf:s.timestamp}})}#s(t,n){let o=this.#n.require(n.kind);this.#r.identities.set(er(n,this.#n),t),o.outgoing==="one"&&this.#r.outgoingOne.set(`${o.kind}\0${n.source}`,t),o.incoming==="one"&&this.#r.incomingOne.set(`${o.kind}\0${n.target}`,t)}#a(t){let n=this.#n.require(t.kind);this.#r.identities.delete(er(t,this.#n)),n.outgoing==="one"&&this.#r.outgoingOne.delete(`${n.kind}\0${t.source}`),n.incoming==="one"&&this.#r.incomingOne.delete(`${n.kind}\0${t.target}`)}append(t){let n=Ip(t,this.version,this.#i),o=this.#e.get(n.relationshipId),r=Ap(t,n.relationshipId,this.#e,this.#t,this.#n,this.#r),i=Object.freeze({eventId:n.eventId,relationshipId:n.relationshipId,action:t.action,...r===void 0?{}:{edge:r},author:n.author,timestamp:n.timestamp,...t.reason?.trim()?{reason:t.reason.trim()}:{},sequence:this.version+1});return this.#o.push(i),this.#i.add(n.eventId),o&&this.#a(o),t.action==="remove"?this.#e.delete(n.relationshipId):(this.#e.set(n.relationshipId,r),this.#s(n.relationshipId,r)),i}snapshot(t={}){if(t.atVersion!==void 0&&t.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let n;if(t.atTimestamp!==void 0){let i=Date.parse(t.atTimestamp);if(!Number.isFinite(i))throw new TypeError("Relationship snapshot timestamp must be valid");n=this.#o.filter(s=>Date.parse(s.timestamp)<=i)}else{let i=t.atVersion??this.version;if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship snapshot version out of range: ${i}`);n=this.#o.slice(0,i)}let o=Sp(n),r=new Ve(this.#t,o.values(),this.#n);return Object.freeze({version:n.at(-1)?.sequence??0,...n.at(-1)?{asOf:n.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(t){if(!Number.isInteger(t.limit)||t.limit<1)throw new TypeError("Relationship event page limit must be positive");let n=Ri("relationship-events",{order:"append-sequence"}),o=t.cursor===void 0?this.version:Number(xi(t.cursor,n).snapshot);if(!Number.isSafeInteger(o)||o<0||o>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=Oi(this.#o.slice(0,o),{cursor:t.cursor,fingerprint:n,limit:t.limit,readId:i=>i.eventId,snapshot:String(o)});return{version:o,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},Ep="relationship-event-store",gl=Mt.O_NOFOLLOW;function On(e){return te(e,Ep,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function Ue(e,t="relationships/events.jsonl"){let n=me.resolve(e),o=me.resolve(n,t),r=me.relative(n,o);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${me.sep}`)||me.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await Qo(n,{recursive:!0}),(await _l(n)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=n;for(let a of r.split(me.sep)){s=me.join(s,a);try{if((await _l(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(to(c))break;throw c}}return o}async function $n(e,t,n){let o=new jt(t,{registry:n}),r,i;try{i=await hl(e,Mt.O_RDONLY|gl),r=await i.readFile("utf8")}catch(a){if(to(a))return{log:o,raw:""};throw a}finally{await i?.close()}let s=r.split(`
1
+ import{a as nt,b as En,c as uc,d as fc,g as _c,i as Mc}from"./chunk-7E2EBJLY.js";import{L as Bo,U as el,a as jc,c as Gc,d as Uc,e as qc,k as zc,l as Dt,m as Ge,n as Wo,u as Vo,w as Qc}from"./chunk-JAVO3Z42.js";import{$c as qo,Aa as ac,Ba as cc,Ca as kn,Da as lc,Ea as Sn,Fa as In,Ga as dc,Gb as $c,Gd as Ko,Ia as et,J as Le,Ja as mc,Jb as Fc,Jd as ll,Ka as $o,Kb as Pc,La as An,Mc as Do,Na as tt,Pb as Lt,Pc as Ie,Qc as Hc,Qd as dl,Rc as jo,Rd as ml,Sc as Wc,Tc as Vc,Uc as ot,Vc as Bc,Wa as pc,Yc as Jc,Zc as Xc,_c as Zc,ad as zo,b as Ro,bd as Ho,ed as nl,fc as Rn,fd as ol,ga as fn,gd as rl,ha as tc,hd as il,i as Ea,ia as Ft,id as sl,j as Ta,ja as h,ka as nc,kd as al,l as Ca,la as oc,ld as cl,mb as gc,mc as Nc,na as J,nb as yc,oa as rc,oc as Dc,pa as bn,qa as ic,ra as xo,sa as Pt,sb as Fo,ta as wn,tb as Po,ua as Me,ub as Lo,va as sc,vc as Nt,wa as vn,wb as bc,xa as U,xb as wc,ya as Oo,yb as No,za as j}from"./chunk-A2UPOCSW.js";import{$ as Na,D as Ra,J as xa,L as Ne,M as Oa,N as hn,O as $a,Oa as Qe,P as De,Q as Fa,R as gn,S as Pa,Va as Za,Y as La,_a as yn,b as ds,ba as Da,ca as Ma,cb as Qa,da as ja,ea as Ga,fa as Ua,fb as ec,ga as qa,h as _n,ha as za,ia as Ha,ja as Wa,ka as Va,la as Ba,ma as Ka,na as Ya,oa as Ja,pa as Xa}from"./chunk-DGOIXJZJ.js";import{$a as vc,Db as Se,Eb as Lc,Fb as Cn,Jb as Mo,Uc as Go,Xb as Kc,Yb as Yc,Zc as Uo,ad as tl,d as cs,f as ls,ib as kc,jb as Sc,kb as Ic,na as de,nb as Ac,ob as Ec,pb as Tc,qb as Cc,sb as je,tb as Rc,ua as hc,ub as xc,xb as Tn,zb as Oc}from"./chunk-BNAT4EYR.js";import{$c as Ti,$d as $i,$f as Oe,$i as as,$j as le,A as ae,Ab as hi,Ac as ho,Ag as go,Aj as ws,Ak as Ls,An as ra,Ao as Aa,B as oe,Bb as gi,Bc as $,Bk as Ns,Bn as ia,C as kt,Cb as yi,Ci as Ze,Cj as ln,Cn as sa,Db as bi,Df as qi,Dk as Ds,Dm as Bs,Eb as wi,Eh as Tt,Ej as vs,Ek as Ms,Fh as Ct,Fj as ks,Fk as js,Fn as aa,Ga as ro,Gc as Si,Gj as Ss,Gk as $t,Ha as io,Hc as Ii,Hd as tn,Hk as Gs,Hm as Ks,Ia as so,Ik as mn,J as si,Ja as ao,Jk as Us,Jn as ca,Kc as G,Ke as Li,Kk as Ao,Kn as la,L as ai,Lf as zi,Lg as Yi,Lk as Eo,Ln as da,M as be,Mf as F,Mg as Ji,Mi as rs,Mk as qs,Mm as Ys,Mn as ma,Ng as Xi,Nm as Js,Nn as pa,Oc as Ai,Oi as is,Pc as Ei,Pi as ss,Pm as Xs,Pn as ua,Qi as ce,Qj as Is,Qn as fa,Rb as It,Re as Ni,Ri as ve,Rn as _a,S as no,Sa as P,Sb as Jt,Sm as Zs,Sn as ha,T as ci,Ta as Yt,Tc as H,Tn as ga,Uc as en,Ue as Di,Ui as Rt,Uj as As,Un as ya,X as li,Xi as on,Xn as ba,Y as di,Yj as Es,Yn as un,Z as mi,Zh as Zi,Zn as wa,_ as pi,_a as A,_f as Ye,_h as Xe,_i as xt,_n as va,ad as Ci,ae as Fi,ag as Hi,aj as ms,ba as ui,bb as we,bf as S,bg as Wi,bh as yo,bi as bo,bj as rn,cb as co,cg as $e,ch as R,cj as sn,ck as Ts,co as ke,de as Pi,dg as Vi,di as Qi,dj as an,dk as Cs,do as E,eb as xe,ei as es,ej as cn,f as Y,ff as Mi,fg as V,fk as dn,fo as ka,gi as ts,gj as re,gk as Rs,gn as Qs,h as eo,hf as ji,hg as At,ic as Xt,if as te,ig as Bi,ii as T,ij as ps,j as ii,jc as Zt,ji as ns,jj as us,jn as ea,kc as Qt,km as zs,kn as ta,la as u,lg as Ki,mc as vi,mj as Ot,mk as xs,na as m,nj as fs,nk as Os,oa as St,od as Ri,of as Gi,oj as _s,p as Kt,pj as hs,pl as To,po as Sa,qa as oo,qj as gs,qo as Ia,rd as xi,rk as So,rl as Co,sc as ki,sg as Fe,si as wo,sn as na,ti as vo,tk as Io,tm as Hs,u as Ve,uc as lo,ud as Oi,ug as Je,un as oa,vc as mo,vj as ko,vm as Ws,wc as po,wf as Ui,wj as ys,wm as pn,x as ye,xc as uo,xj as Pe,xk as $s,xm as Vs,y as Be,yb as fi,yc as fo,yg as nn,yk as Fs,z as to,zb as _i,zc as _o,zf as Ke,zg as Et,zi as os,zj as bs,zk as Ps}from"./chunk-UIAH7UFK.js";import{AsyncLocalStorage as Dg}from"node:async_hooks";import{readFile as pp}from"node:fs/promises";import up 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 Yo="context-intents.json";function xn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fp(e,t,n){if(!xn(e))throw new TypeError(`${t} context intent at index ${String(n)} must be an object`);let o=e.included_field_groups;if(typeof e.command!="string"||typeof e.intent!="string"||typeof e.description!="string"||!Array.isArray(o)||!o.every(r=>typeof r=="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:o,token_budget:e.token_budget}}function pl(e,t){let n=Array.isArray(e)?e:xn(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((o,r)=>fp(o,t,r))}async function _p(e){let t=up.join(e,Yo),n;try{n=await pp(t,"utf8")}catch(r){if(Be(r))return[];throw await zi(e),r}let o;try{o=JSON.parse(n)}catch(r){let i=r instanceof Error?r.message:String(r);throw new TypeError(`Invalid ${Yo}: ${i}`,{cause:r})}return pl(o,Yo)}function hp(e){if(!xn(e))return;let t=e.contextIntents??e.context_intents;if(t!==void 0)return t;let n=e.default;return xn(n)?n.contextIntents??n.context_intents:void 0}function gp(e){return e.flatMap(t=>{let n=hp(t.module);return n===void 0?[]:pl(n,`package ${t.name}`)})}async function yp(e){let t=await _p(e.pmRoot),n=gp(e.packages??[]);return{workspaceContracts:t,packageContracts:n}}async function Jo(e,t){let n=await yp(e);return await Ui(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]="c2766f4e-6354-55bb-9e40-676273ee901f")}catch{}})();async function ul(e,t,n=Gi){try{await n({pmRoot:e,result:t})}catch{if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=t,r=Array.isArray(o.warnings)?o.warnings.filter(i=>typeof i=="string"):[];o.warnings=[...new Set([...r,"context_usage_feedback_write_failed"])].sort()}}}import{createHash as Cp}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]="9133d39d-b2fb-5f99-8fd3-87a7d2f8df6d")}catch{}})();var fl="PmCliError";function bp(e){if(!Number.isFinite(e))throw new TypeError("createPmCliExpectedError options.exitCode must be a finite number");let t=Math.trunc(e);if(t<=u.SUCCESS)throw new TypeError("createPmCliExpectedError options.exitCode must be a positive exit code");return t}function wp(e,t={}){if(typeof e!="string"||e.trim().length===0)throw new TypeError("createPmCliExpectedError message must be a non-empty string");let n=new m(e,bp(t.exitCode??u.USAGE),t.context??{});return"cause"in t&&Object.defineProperty(n,"cause",{value:t.cause,enumerable:!1,configurable:!0,writable:!0}),n}function Xo(e){if(!(e instanceof Error)||e.name!==fl)return!1;let t=e;return typeof t.exitCode=="number"&&Number.isFinite(t.exitCode)}import{constants as Mt}from"node:fs";import{lstat as _l,mkdir as Qo,open as hl}from"node:fs/promises";import me from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function Zo(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship event ${t} must be non-empty`);return e.trim()}function er(e,t){let n=t.require(e.kind),o=n.direction==="undirected"?[e.source,e.target].sort().join("\0"):`${e.source}\0${e.target}`;return`${n.kind}\0${o}`}function vp(e){return Object.freeze({...e,...e.payload===void 0?{}:{payload:Object.freeze(structuredClone(e.payload))}})}function kp(e,t,n,o){let r=n.require(e.kind),i=o.outgoingOne.get(`${r.kind}\0${e.source}`);if(i!==void 0&&i!==t)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=o.incomingOne.get(`${r.kind}\0${e.target}`);if(s!==void 0&&s!==t)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let a=er(e,n),c=o.identities.get(a);if(c!==void 0&&c!==t)throw new TypeError(`Relationship edge already active: ${a}`)}function Sp(e){let t=new Map;for(let n of e)n.action==="remove"?t.delete(n.relationshipId):t.set(n.relationshipId,n.edge);return t}function Ip(e,t,n){if(e.expectedVersion!==void 0&&e.expectedVersion!==t)throw new TypeError(`Relationship event version conflict: expected ${e.expectedVersion}, current ${t}`);let o=Zo(e.eventId,"eventId");if(n.has(o))throw new TypeError(`Relationship event already exists: ${o}`);if(e.action!=="add"&&e.action!=="remove"&&e.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${e.action}`);if(!Number.isFinite(Date.parse(e.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:o,relationshipId:Zo(e.relationshipId,"relationshipId"),author:Zo(e.author,"author"),timestamp:new Date(e.timestamp).toISOString()}}function Ap(e,t,n,o,r,i){let s=n.has(t);if(e.action==="add"&&s)throw new TypeError(`Relationship is already active: ${t}`);if(e.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${t}`);if(e.action==="remove")return;if(!e.edge)throw new TypeError(`Relationship ${e.action} event requires an edge`);let a=typeof e.edge.source=="string"?e.edge.source.trim():"",c=typeof e.edge.target=="string"?e.edge.target.trim():"";if(!o.has(a)||!o.has(c))throw new TypeError(`Relationship endpoint not found: ${a} -> ${c}`);let l=new Ve([a,c],[e.edge],r).edges()[0];return kp(l,t,r,i),vp(l)}var jt=class{#t;#n;#o=[];#i=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(t,n={}){this.#t=new Set([...t].filter(o=>typeof o=="string").map(o=>o.trim()).filter(Boolean)),this.#n=n.registry??Kt()}get version(){return this.#o.length}events(){return Object.freeze([...this.#o])}*stream(t={}){let n=t.fromVersion??1,o=t.toVersion??this.version,r=t.batchSize??100;if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${o}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(n>o+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let i=n-1;i<o;i+=r)yield Object.freeze(this.#o.slice(i,Math.min(i+r,o)))}project(t,n,o={}){if(typeof n!="function")throw new TypeError("Relationship event projection requires a reducer");let r=t,i=0,s;for(let a of this.stream({...o,batchSize:256}))for(let c of a)r=n(r,c),i+=1,s=c;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(o.fromVersion??1)-1),processed:i,...s===void 0?{}:{asOf:s.timestamp}})}#s(t,n){let o=this.#n.require(n.kind);this.#r.identities.set(er(n,this.#n),t),o.outgoing==="one"&&this.#r.outgoingOne.set(`${o.kind}\0${n.source}`,t),o.incoming==="one"&&this.#r.incomingOne.set(`${o.kind}\0${n.target}`,t)}#a(t){let n=this.#n.require(t.kind);this.#r.identities.delete(er(t,this.#n)),n.outgoing==="one"&&this.#r.outgoingOne.delete(`${n.kind}\0${t.source}`),n.incoming==="one"&&this.#r.incomingOne.delete(`${n.kind}\0${t.target}`)}append(t){let n=Ip(t,this.version,this.#i),o=this.#e.get(n.relationshipId),r=Ap(t,n.relationshipId,this.#e,this.#t,this.#n,this.#r),i=Object.freeze({eventId:n.eventId,relationshipId:n.relationshipId,action:t.action,...r===void 0?{}:{edge:r},author:n.author,timestamp:n.timestamp,...t.reason?.trim()?{reason:t.reason.trim()}:{},sequence:this.version+1});return this.#o.push(i),this.#i.add(n.eventId),o&&this.#a(o),t.action==="remove"?this.#e.delete(n.relationshipId):(this.#e.set(n.relationshipId,r),this.#s(n.relationshipId,r)),i}snapshot(t={}){if(t.atVersion!==void 0&&t.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let n;if(t.atTimestamp!==void 0){let i=Date.parse(t.atTimestamp);if(!Number.isFinite(i))throw new TypeError("Relationship snapshot timestamp must be valid");n=this.#o.filter(s=>Date.parse(s.timestamp)<=i)}else{let i=t.atVersion??this.version;if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship snapshot version out of range: ${i}`);n=this.#o.slice(0,i)}let o=Sp(n),r=new Ve(this.#t,o.values(),this.#n);return Object.freeze({version:n.at(-1)?.sequence??0,...n.at(-1)?{asOf:n.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(t){if(!Number.isInteger(t.limit)||t.limit<1)throw new TypeError("Relationship event page limit must be positive");let n=Ri("relationship-events",{order:"append-sequence"}),o=t.cursor===void 0?this.version:Number(xi(t.cursor,n).snapshot);if(!Number.isSafeInteger(o)||o<0||o>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=Oi(this.#o.slice(0,o),{cursor:t.cursor,fingerprint:n,limit:t.limit,readId:i=>i.eventId,snapshot:String(o)});return{version:o,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},Ep="relationship-event-store",gl=Mt.O_NOFOLLOW;function On(e){return te(e,Ep,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function Ue(e,t="relationships/events.jsonl"){let n=me.resolve(e),o=me.resolve(n,t),r=me.relative(n,o);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${me.sep}`)||me.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await Qo(n,{recursive:!0}),(await _l(n)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=n;for(let a of r.split(me.sep)){s=me.join(s,a);try{if((await _l(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(to(c))break;throw c}}return o}async function $n(e,t,n){let o=new jt(t,{registry:n}),r,i;try{i=await hl(e,Mt.O_RDONLY|gl),r=await i.readFile("utf8")}catch(a){if(to(a))return{log:o,raw:""};throw a}finally{await i?.close()}let s=r.split(`
2
2
  `);for(let a=0;a<s.length;a+=1){let c=s[a].trim();if(!c)continue;let l;try{l=JSON.parse(c)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${a+1}`)}if(l.sequence!==o.version+1)throw new TypeError(`Invalid relationship event sequence at line ${a+1}`);o.append({eventId:l.eventId,relationshipId:l.relationshipId,action:l.action,...l.edge===void 0?{}:{edge:l.edge},author:l.author,timestamp:l.timestamp,...l.reason===void 0?{}:{reason:l.reason},expectedVersion:o.version})}return{log:o,raw:r}}function Tp(e,t,n,o){let r=Date.parse(t.timestamp),i;return t.action!=="remove"&&t.edge!==void 0&&(i=new Ve(n,[t.edge],o).edges()[0]),e.eventId===t.eventId.trim()&&e.relationshipId===t.relationshipId.trim()&&e.action===t.action&&e.author===t.author.trim()&&Number.isFinite(r)&&e.timestamp===new Date(r).toISOString()&&e.reason===(t.reason?.trim()||void 0)&&It(e.edge)===It(i)}var Fn=class e{#t;#n;#o;#i;#e;constructor(t,n,o,r){this.#t=t.pmRoot,this.#n=n,this.#o=t.registry,this.#i=o,this.#e=r}static async open(t){let n=Object.freeze([...t.nodes]),o=await Ue(t.pmRoot,t.relativePath),r=await On(t.pmRoot);try{await Ue(t.pmRoot,o);let{log:i}=await $n(o,n,t.registry);return new e(t,n,o,i)}finally{await r()}}get path(){return this.#i}async currentVersion(){return this.#e=await this.#r(),this.#e.version}async append(t){let n=await On(this.#t);try{let o=await Ue(this.#t,this.#i),{log:r}=await $n(o,this.#n,this.#o),i=r.append(t);await Qo(me.dirname(o),{recursive:!0}),await Ue(this.#t,o);let s=await hl(o,Mt.O_APPEND|Mt.O_CREAT|Mt.O_WRONLY|gl);try{await s.appendFile(`${JSON.stringify(i)}
3
3
  `,"utf8")}finally{await s.close()}return this.#e=r,i}finally{await n()}}async appendBatch(t,n={}){let o=await On(this.#t);try{let r=await Ue(this.#t,this.#i),{log:i,raw:s}=await $n(r,this.#n,this.#o),a=i.version,c=new Map(i.events().map(d=>[d.eventId,d])),l=[],p=[];for(let d of t){let f=d.eventId.trim(),_=c.get(f);if(_!==void 0){if(n.existingEventPolicy==="skip_identical"&&Tp(_,d,this.#n,this.#o)){p.push(_.eventId);continue}if(n.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${f}`)}let w=i.append(d);c.set(w.eventId,w),l.push(w)}if(l.length>0){let d=s.length===0||s.endsWith(`
4
4
  `)?s:`${s}
@@ -2244,4 +2244,4 @@ compdef _pm pm`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"
2244
2244
  `);M(e.progressEnabled,"writing keyword artifacts"),await oe(t,`${JSON.stringify(e.manifest,null,2)}
2245
2245
  `),await oe(n,`${r}
2246
2246
  `);let i=[];if(e.mode!=="keyword")try{M(e.progressEnabled,"writing vectorization status ledger"),await qs(e.pmRoot,e.vectorizationLedgerEntries,e.vectorizationEmbeddingMetadata)}catch(s){i.push(`search_vectorization_status_ledger_write_failed:${s instanceof Error?s.message:String(s)}`)}return i}async function Ng(e,t){let n=_g(e.mode),o=fg(e),r=e.full===!0;M(o,`start mode=${n}`);let i=A(process.cwd(),t.path);await F(i);let s=xs(await T(i)).settings,a=null;try{a=await te(i,Os,s.locks.ttl_seconds,R(void 0,"pm-reindex"),!1,s.governance.force_required_for_stale_lock,s.locks.wait_ms)}catch(c){throw c instanceof m&&c.exitCode===u.CONFLICT?new m("Another pm reindex run is already active for this project. Wait for it to finish before starting a new keyword, semantic, or hybrid reindex.",u.CONFLICT,{code:"reindex_already_running",type:"urn:pm-cli:error:reindex_already_running",why:"Semantic reindex can be expensive and duplicate runs compete for the same local embedding model and vector store.",nextSteps:["Check active pm reindex processes before starting another reindex.","Rerun with --progress when you need non-interactive visibility."]}):c}try{let c=yg(s),l=bg(s),p=Ag({requestedMode:n,pmRoot:i,settings:s,extensionEmbedding:c,extensionVectorAdapter:l}),d=n;M(o,"loading item corpus");let f=await Eg({pmRoot:i,settings:s}),_=f.warnings,{documentCandidates:w,metadataDocuments:k}=f;M(o,`loaded_items=${k.length}`);let y=S(),v=Ig(d,y,k),g=Bt.join(i,Qr),I=Bt.join(i,ei),x=d==="keyword"?await ni(i,w,s.schema,_):k,N=[],W={},O=null,C=Sg(d);if(d==="keyword"&&await Tg({pmRoot:i,settings:s,forceFullSemantic:r,extensionEmbedding:c,reindexWarnings:_}),d!=="keyword"){let ne=await Pg({pmRoot:i,settings:s,requestedMode:n,activeEmbeddingProvider:p.activeEmbeddingProvider,activeVectorStore:p.activeVectorStore,extensionEmbedding:c,extensionVectorAdapter:l,documentCandidates:w,metadataDocuments:k,documentsForKeywordArtifacts:x,forceFullSemantic:r,reindexWarnings:_,semanticWarnings:N,semanticSummary:C,progressEnabled:o});x=ne.documentsForKeywordArtifacts,W=ne.vectorizationLedgerEntries,O=ne.vectorizationEmbeddingMetadata}let se=await Lg({pmRoot:i,mode:d,manifest:v,documentsForKeywordArtifacts:x,settings:s,vectorizationLedgerEntries:W,vectorizationEmbeddingMetadata:O,progressEnabled:o}),Re=[...await G({path:g,scope:"project",op:"reindex:manifest"}),...await G({path:I,scope:"project",op:"reindex:embeddings"}),...await Ai({mode:d,total_items:k.length})];return M(o,"done"),{ok:!0,mode:d,total_items:k.length,semantic:C,artifacts:{manifest:Qr,embeddings:ei},warnings:[..._,...N,...se,...Re],generated_at:y}}finally{await a?.()}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f42d8a66-b4c0-5281-b5ef-fdc0ea503f58")}catch{}})();var cp=Symbol("pm.active-extension-host-context");function Q(e){return{fullChangedFields:!0,options:e}}var b=class e{defaults;constructor(t={}){this.defaults={...t.pmRoot===void 0?{}:{path:t.pmRoot},...t.cwd===void 0?{}:{cwd:t.cwd},...t.author===void 0?{}:{author:t.author},...t.noExtensions===void 0?{}:{noExtensions:t.noExtensions}}}static forActiveExtensionHost(t){let n=new e({...t,noExtensions:!0});return n.defaults[cp]=!0,n}run(t,n={}){return Ug({...this.defaults,...n,action:t})}runTyped(t,n={}){return this.run(t,n)}context(t={}){return this.runTyped("context",{options:t})}listAllItemMetadataLight(){return wl(this.defaults.path,this.defaults.cwd)}list(t={}){return this.runTyped("list",{options:t})}async listAllComplete(t={}){return Ln(await this.list(nr(t)))}search(t,n={}){return this.runTyped("search",{query:t,options:n})}get(t,n={}){return this.runTyped("get",{id:t,options:n})}next(t={}){return this.runTyped("next",{options:t})}aggregate(t={}){return this.runTyped("aggregate",{options:t})}stats(t={}){return this.runTyped("stats",{options:t})}duplicates(t={}){return this.runTyped("duplicates",{options:t})}comments(t,n={}){return this.runTyped("comments",{id:t,options:n})}notes(t,n={}){return this.runTyped("notes",{id:t,options:n})}learnings(t,n={}){return this.runTyped("learnings",{id:t,options:n})}files(t,n={}){return this.runTyped("files",{id:t,options:n})}filesDiscover(t,n={}){return this.runTyped("files-discover",{id:t,options:n})}filesLookup(t){return this.runTyped("files-lookup",{options:t})}docs(t,n={}){return this.runTyped("docs",{id:t,options:n})}deps(t,n={}){return this.runTyped("deps",{id:t,options:n})}graph(t,n={},o={}){return this.runTyped("graph",{subcommand:t,...n,options:o})}append(t,n,o={}){return this.runTyped("append",{id:t,...Q(Ft(o,{body:n}))})}init(t,n={}){return this.runTyped("init",{...t===void 0?{}:{prefix:t},options:n})}config(t,n,o,r,i={}){return this.runTyped("config",{scope:t,configAction:n,...o===void 0?{}:{key:o},...r===void 0?{}:{value:r},options:i})}schema(t,n={}){return this.runTyped("schema",{options:{...n,subcommand:t}})}workflowPolicy(t,n,o={}){return this.runTyped("schema",{name:n,options:{...o,subcommand:t}})}schemaList(){return this.runTyped("schema",{options:{subcommand:"list"}})}schemaShow(t){return this.runTyped("schema",{name:t,options:{subcommand:"show"}})}schemaAddType(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-type"}})}schemaRemoveType(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-type"}})}schemaAddStatus(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-status"}})}schemaRemoveStatus(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-status"}})}schemaAddField(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"add-field"}})}schemaRemoveField(t,n={}){return this.runTyped("schema",{name:t,options:{...n,subcommand:"remove-field"}})}schemaListFields(){return this.runTyped("schema",{options:{subcommand:"list-fields"}})}schemaShowField(t){return this.runTyped("schema",{name:t,options:{subcommand:"show-field"}})}schemaApplyPreset(t,n={}){return this.runTyped("schema",{typePreset:t,options:{...n,subcommand:"apply-preset"}})}schemaInferTypes(t={}){return this.runTyped("schema",{options:{...t,subcommand:"add-type",infer:!0}})}schemaRenameType(t,n,o){return this.runTyped("schema",{name:t,options:{...o,subcommand:"rename-type",to:n}})}schemaRenameField(t,n,o,r){return this.runTyped("schema",{name:t,options:{...o,subcommand:"rename-field",to:n,...r?{fieldTypeScope:r}:{}}})}schemaRemapStatus(t,n,o){return this.runTyped("schema",{name:t,options:{...o,subcommand:"remap-status",to:n}})}schemaShowStatus(t){return this.runTyped("schema",{name:t,options:{subcommand:"show-status"}})}profile(t,n={}){return this.runTyped("profile",{options:{...n,subcommand:t}})}profileList(){return this.runTyped("profile",{options:{subcommand:"list"}})}profileShow(t){return this.runTyped("profile",{name:t,options:{subcommand:"show"}})}profileApply(t,n={}){return this.runTyped("profile",{name:t,options:{...n,subcommand:"apply"}})}profileLint(t){return this.runTyped("profile",{name:t,options:{subcommand:"lint"}})}validate(t={}){return this.runTyped("validate",{options:t})}health(t={}){return this.runTyped("health",{options:t})}gc(t={}){return this.runTyped("gc",{options:t})}assurance(t){return this.runTyped("assurance",{options:{...t,subcommand:t.action}})}historyRedact(t,n){return this.runTyped("history-redact",{id:t,options:n})}historyRepair(t,n={}){return this.runTyped("history-repair",{id:t,options:n})}historyRepairAll(t={}){return this.runTyped("history-repair",{options:{...t,all:!0}})}historyAttest(t={}){return this.runTyped("history-attest",{options:t})}historyCompact(t,n={}){return this.runTyped("history-compact",{id:t,options:n})}historyCompactBulk(t){return this.runTyped("history-compact",{options:t})}historyAuthorAcknowledge(t){return this.runTyped("history-author-acknowledge",{historyEvent:(t.events??[]).map(n=>`${n.item_id}:${String(n.line)}`),allActionable:t.all_actionable===!0,dryRun:t.dry_run===!0,planFingerprint:t.plan_fingerprint,limit:t.coordinate_limit,attributedAuthor:t.attributed_author,reviewer:t.reviewer,reason:t.reason})}plan(t,n,o={},r,i){return this.runTyped("plan",{fullChangedFields:!0,...n===void 0?{}:{id:n},...r===void 0?{}:{stepRef:r},...i===void 0?{}:{reorderTo:i},options:Ft(o,{subcommand:t})})}planCreate(t){return this.plan("create",void 0,t)}planShow(t,n={}){return this.plan("show",t,n)}planAddStep(t,n){return this.plan("add-step",t,n)}planUpdateStep(t,n,o){return this.plan("update-step",t,o,n)}planCompleteStep(t,n,o={}){return this.plan("complete-step",t,o,n)}planBlockStep(t,n,o){return this.plan("block-step",t,o,n)}planReorderStep(t,n,o,r={}){return this.plan("reorder-step",t,r,n,o)}planRemoveStep(t,n,o={}){return this.plan("remove-step",t,o,n)}planLink(t,n,o){return this.plan("link",t,o,n)}planUnlink(t,n,o){return this.plan("unlink",t,o,n)}planDecision(t,n){return this.plan("decision",t,n)}planDiscovery(t,n){return this.plan("discovery",t,n)}planValidation(t,n){return this.plan("validation",t,n)}planResume(t,n){return this.plan("resume",t,n)}planApprove(t,n={}){return this.plan("approve",t,n)}planMaterialize(t,n){return this.plan("materialize",t,n)}create(t={}){return this.runTyped("create",Q(t))}update(t,n={}){return this.runTyped("update",{id:t,...Q(n)})}reopen(t,n,o={}){return this.runTyped("item-reopen",{id:t,reason:n,fullChangedFields:!0,options:o})}close(t,n,o={}){return this.runTyped("close",{id:t,reason:n,...Q(o)})}claim(t,n={}){return this.runTyped("claim",{id:t,...Q(n)})}claimNext(t={}){return this.runTyped("claim",{next:!0,...Q(t)})}release(t,n={}){return this.runTyped("release",{id:t,...Q(n)})}copy(t,n={}){return this.runTyped("copy",{id:t,...Q(n)})}delete(t,n={}){return this.runTyped("delete",{id:t,...Q(n)})}restore(t,n,o={}){return this.runTyped("restore",{fullChangedFields:!0,id:t,options:{...o,target:n}})}focus(t,n={}){return this.runTyped("focus",{...t===void 0?{}:{id:t},...Q(n)})}startTask(t,n={}){return this.runTyped("start-task",{id:t,...Q(n)})}pauseTask(t,n={}){return this.runTyped("pause-task",{id:t,...Q(n)})}closeTask(t,n,o={}){return this.runTyped("close-task",{id:t,reason:n,...Q(o)})}extension(t,n={}){return this.runTyped("extension",{...t===void 0?{}:{target:t},options:n})}extensionList(t={}){return this.extension("list",t)}extensionActivate(t,n={}){return this.runTyped("extension-activate",{target:t,options:n})}extensionDeactivate(t,n={}){return this.runTyped("extension-deactivate",{target:t,options:n})}package(t,n={}){return this.runTyped("package",{...t===void 0?{}:{target:t},options:{...n,vocabulary:"package"}})}packageList(t={}){return this.package("list",t)}packageInstall(t,n={}){return this.runTyped("package-install",{target:t,options:n})}packageUninstall(t,n={}){return this.runTyped("package-uninstall",{target:t,options:n})}packageDoctor(t={}){return this.runTyped("package-doctor",{options:t})}packageManage(t,n={}){return this.runTyped("package-manage",{...t===void 0?{}:{target:t},options:n})}packageDescribe(t,n={}){return this.runTyped("package-describe",{...t===void 0?{}:{target:t},options:n})}packageReload(t={}){return this.runTyped("package-reload",{options:t})}packageCatalog(t={}){return this.runTyped("package-catalog",{options:t})}packageActivate(t,n={}){return this.runTyped("package-activate",{target:t,options:n})}packageDeactivate(t,n={}){return this.runTyped("package-deactivate",{target:t,options:n})}packageMigrate(t={}){return this.package(void 0,{...t,migrate:!0})}upgrade(t,n={}){return this.runTyped("upgrade",{...t===void 0?{}:{target:t},options:n})}};function AT(e={},t={}){return new b(t).context(e)}function ET(e={},t={}){return new b(t).list(e)}function TT(e={},t={}){return new b(t).listAllComplete(e)}function CT(e,t={},n={}){return new b(n).search(e,t)}function RT(e,t={},n={}){return new b(n).get(e,t)}function xT(e={},t={}){return new b(t).next(e)}function OT(e={},t={}){return new b(t).aggregate(e)}function $T(e={},t={}){return new b(t).stats(e)}function FT(e={},t={}){return new b(t).duplicates(e)}function PT(e,t={},n={}){return new b(n).comments(e,t)}function LT(e,t={},n={}){return new b(n).notes(e,t)}function NT(e,t={},n={}){return new b(n).learnings(e,t)}function DT(e,t={},n={}){return new b(n).files(e,t)}function MT(e,t={},n={}){return new b(n).filesDiscover(e,t)}function jT(e,t={}){return new b(t).filesLookup(e)}function GT(e,t={},n={}){return new b(n).docs(e,t)}function UT(e,t={},n={}){return new b(n).deps(e,t)}function qT(e,t={},n={},o={}){return new b(o).graph(e,t,n)}function zT(e,t,n={},o={}){return new b(o).append(e,t,n)}function HT(e,t={},n={}){return new b(n).init(e,t)}function WT(e,t,n,o,r={},i={}){return new b(i).config(e,t,n,o,r)}function VT(e,t={},n={}){return new b(n).schema(e,t)}function BT(e={}){return new b(e).schemaList()}function KT(e,t={}){return new b(t).schemaShow(e)}function YT(e,t={},n={}){return new b(n).schemaAddType(e,t)}function JT(e,t={},n={}){return new b(n).schemaRemoveType(e,t)}function XT(e,t={},n={}){return new b(n).schemaAddStatus(e,t)}function ZT(e,t={},n={}){return new b(n).schemaRemoveStatus(e,t)}function QT(e,t={},n={}){return new b(n).schemaAddField(e,t)}function eC(e,t={},n={}){return new b(n).schemaRemoveField(e,t)}function tC(e={}){return new b(e).schemaListFields()}function nC(e,t={}){return new b(t).schemaShowField(e)}function oC(e,t={},n={}){return new b(n).schemaApplyPreset(e,t)}function rC(e={},t={}){return new b(t).schemaInferTypes(e)}function iC(e,t,n,o={}){return new b(o).schemaRenameType(e,t,n)}function sC(e,t,n,o,r={}){return new b(r).schemaRenameField(e,t,n,o)}function aC(e,t,n,o={}){return new b(o).schemaRemapStatus(e,t,n)}function cC(e,t={}){return new b(t).schemaShowStatus(e)}function lC(e,t={},n={}){return new b(n).profile(e,t)}function dC(e={}){return new b(e).profileList()}function mC(e,t={}){return new b(t).profileShow(e)}function pC(e,t={},n={}){return new b(n).profileApply(e,t)}function uC(e,t={}){return new b(t).profileLint(e)}function fC(e={},t={}){return new b(t).validate(e)}function _C(e={},t={}){return new b(t).health(e)}function hC(e={},t={}){return new b(t).gc(e)}function gC(e,t,n={}){return new b(n).historyRedact(e,t)}function yC(e,t={},n={}){return new b(n).historyRepair(e,t)}function bC(e={},t={}){return new b(t).historyRepairAll(e)}function wC(e,t={},n={}){return new b(n).historyCompact(e,t)}function vC(e,t={}){return new b(t).historyCompactBulk(e)}function kC(e={},t={}){return new b(t).create(e)}function SC(e,t={},n={}){return new b(n).update(e,t)}function IC(e,t,n={},o={}){return new b(o).reopen(e,t,n)}function AC(e,t,n={},o={}){return new b(o).close(e,t,n)}function EC(e,t={},n={}){return new b(n).claim(e,t)}function TC(e={},t={}){return new b(t).claimNext(e)}function CC(e,t={},n={}){return new b(n).release(e,t)}function RC(e,t={},n={}){return new b(n).copy(e,t)}function xC(e,t={},n={}){return new b(n).delete(e,t)}function OC(e,t,n={},o={}){return new b(o).restore(e,t,n)}function $C(e,t={},n={}){return new b(n).focus(e,t)}function FC(e,t={},n={}){return new b(n).startTask(e,t)}function PC(e,t={},n={}){return new b(n).pauseTask(e,t)}function LC(e,t,n={},o={}){return new b(o).closeTask(e,t,n)}function NC(e,t={},n={}){return new b(n).extension(e,t)}function DC(e={},t={}){return new b(t).extensionList(e)}function MC(e,t={},n={}){return new b(n).extensionActivate(e,t)}function jC(e,t={},n={}){return new b(n).extensionDeactivate(e,t)}function GC(e,t={},n={}){return new b(n).package(e,t)}function UC(e={},t={}){return new b(t).packageList(e)}function qC(e,t={},n={}){return new b(n).packageInstall(e,t)}function zC(e,t={},n={}){return new b(n).packageUninstall(e,t)}function HC(e={},t={}){return new b(t).packageDoctor(e)}function WC(e,t={},n={}){return new b(n).packageManage(e,t)}function VC(e,t={},n={}){return new b(n).packageDescribe(e,t)}function BC(e={},t={}){return new b(t).packageReload(e)}function KC(e={},t={}){return new b(t).packageCatalog(e)}function YC(e,t={},n={}){return new b(n).packageActivate(e,t)}function JC(e,t={},n={}){return new b(n).packageDeactivate(e,t)}function XC(e,t={},n={}){return new b(n).upgrade(e,t)}async function ZC(e,t={}){let n=typeof e=="string"?{...t,pmRoot:e}:e??t,o={json:!0,quiet:n.quiet??!0,noExtensions:n.noExtensions??!1,noPager:!0,profile:n.profile??!1,path:n.pmRoot};return fn(n,o)}var sp=vi(),lp=new Dg;function Qn(){lo(fi()),mo(_i()),po(hi()),uo(gi()),fo(yi()),_o(bi()),ho(wi())}async function dp(e,t,n,o){return ki(()=>t===void 0?sp.read(()=>ap(e,n,o)):sp.write(()=>jg(t,()=>ap(e,n,o))))}async function QC(e,t){let n=e.cwd,o=n??process.cwd();return dp(bn({path:e.path,noExtensions:e.noExtensions}),n,o,()=>lp.run(!0,t))}async function ap(e,t,n){let o=A(t,e.path);if(e.noExtensions)return Qn(),Jo({pmRoot:o},()=>n(null));if(!await ye(we(o)))return Qn(),n(null);let r=null,i;try{let s=await T(o),a=await Xt({pmRoot:o,settings:s,cwd:t,noExtensions:!1}),c=await Qt({...a,loaded:a.loaded});i={loadResult:a,activationResult:c},lo(c.hooks),mo(c.commands),po(c.parsers),uo(c.preflight),fo(c.services),_o(c.renderers),ho(c.registrations),r={registrations:c.registrations,commands:c.commands,pmRoot:o,packages:a.loaded}}catch(s){Qn(),console.error("[pm-sdk] extension activation failed; continuing without active extensions:",s)}try{return await Jo({pmRoot:o,packages:r?.packages},()=>n(r))}finally{Qn(),i&&await Zt(i.loadResult,i.activationResult).catch(()=>{})}}async function Mg(e,t,n,o,r){if(!r)throw new m(`Unsupported native pm action: ${e}`,u.USAGE);let i=Me(e),a=r.registrations.commands.find(p=>Me(p.action)===i)?.command??r.commands.handlers.find(p=>Me(p.command)===i)?.command;if(!a)throw new m(`Unsupported native pm action: ${e}`,u.USAGE);let c=typeof o.author=="string"&&o.author.trim()?o.author.trim():"pm-extension",l=await Ei({command:vn(a),args:U(n.args??t.args),options:Oo(t,n),global:o,pm_root:r.pmRoot,sdk:yl(r.pmRoot,b.forActiveExtensionHost({pmRoot:r.pmRoot,author:c}),c,vn(a))});if(!l.handled){let p=l.warnings.length>0?` (${l.warnings.join(", ")})`:"";throw new m(`Unsupported native pm action: ${e}${p}`,u.USAGE)}return l.result}async function jg(e,t){let n=process.cwd();process.chdir(e);try{return await t()}finally{process.chdir(n)}}function Gg(e){let t=K(e,"action"),n=Me(t),o=_e(or,n),r=o?.action??n,i={...e,action:r};return o?.options!==void 0&&(i.options={...o.options,...no(e.options)}),r==="package"&&(i.options={...no(i.options),vocabulary:"package"}),{action:r,args:i}}async function Ug(e){let t=Gg(e),n=bn(t.args),o=sc(t.action),r=h(t.args,"cwd"),i=r??process.cwd();t.action==="init"&&(n[Qa]=i),(t.action!=="init"||n.path!==void 0||(process.env.PM_PATH?.trim().length??0)>0)&&(n.path=A(i,n.path));try{return t.action==="history-attest"?await oi(t.action,t.args,n,null):e[cp]===!0||lp.getStore()===!0?await oi(t.action,t.args,n,null):await dp(n,r,i,s=>oi(t.action,t.args,n,s))}finally{o&&Gr()}}function eR(e=Pi){return e.map(t=>{let n=Me(t),o=_e(or,n),r=o?.action??n,i=_e(jr,r)!==void 0;return{action:t,resolved_action:r,covered:i,route:i?o?"alias":"native":"missing"}})}async function oi(e,t,n,o){let r=xo(t,e);Ni(e,r),Di(e,r);let i={action:e,args:t,options:r,id:h(t,"id"),force:t.force===!0||r.force===!0,global:n,activeExtensions:o},s=_e(jr,e),a=s?await s(i):await Mg(e,t,r,n,o);if(e==="history-attest")return a;{r.resolvedOutputFormat="json";let c=qi(e,r,a);return await ul(A(process.cwd(),n.path),c),c}}var qg={closeManyOptionsFromFlat:kn,extensionOptionsFromArgs:Oo,globalOptions:bn,mutationListOptions:ac,normalizeActionName:Me,normalizeCommandPath:vn,normalizeMcpUpdateOptions:lc,normalizeMcpOptionsArrays:ic,optionsWithAuthor:xo,readRequiredString:K,readScalarString:nc,readScalarStringAllowBlank:oc,readStringArray:U,updateManyOptionsFromFlat:Sn,withAddNoteOption:Pt,withFilesDiscoveryOptions:wn,withMutationCompaction:j};(process.env.NODE_ENV==="test"||process.env.VITEST!==void 0||process.env.VITEST_WORKER_ID!==void 0)&&(globalThis.__pmCliActionRunnerTestHooks=qg);export{Yo as a,pl as b,_p as c,gp as d,yp as e,Jo as f,fl as g,wp as h,Xo as i,jt as j,Fn as k,yl as l,Rp as m,Pn as n,nr as o,bl as p,Ln as q,Np as r,Sl as s,El as t,Cl as u,$l as v,ar as w,cr as x,lr as y,dr as z,du as A,Ml as B,hr as C,Jl as D,td as E,nd as F,st as G,Tr as H,qf as I,aw as J,cw as K,xr as L,rd as M,Iw as N,Aw as O,sd as P,ld as Q,Hw as R,i_ as S,Dr as T,a_ as U,c_ as V,kd as W,Sd as X,Id as Y,Ad as Z,Ed as _,_v as $,hv as aa,gv as ba,yv as ca,Td as da,Cd as ea,Od as fa,Pd as ga,Ld as ha,Nd as ia,K as ja,Gr as ka,VS as la,BS as ma,KS as na,YS as oa,JS as pa,Bd as qa,XS as ra,dh as sa,uh as ta,gh as ua,yh as va,bh as wa,z as xa,wh as ya,vh as za,kh as Aa,Sh as Ba,qr as Ca,Xd as Da,lt as Ea,Ur as Fa,Zd as Ga,Ih as Ha,Qd as Ia,Ah as Ja,Eh as Ka,Th as La,Ch as Ma,Rh as Na,Nh as Oa,om as Pa,Dh as Qa,Hh as Ra,Xh as Sa,Qh as Ta,mg as Ua,Ng as Va,b as Wa,AT as Xa,ET as Ya,TT as Za,CT as _a,RT as $a,xT as ab,OT as bb,$T as cb,FT as db,PT as eb,LT as fb,NT as gb,DT as hb,MT as ib,jT as jb,GT as kb,UT as lb,qT as mb,zT as nb,HT as ob,WT as pb,VT as qb,BT as rb,KT as sb,YT as tb,JT as ub,XT as vb,ZT as wb,QT as xb,eC as yb,tC as zb,nC as Ab,oC as Bb,rC as Cb,iC as Db,sC as Eb,aC as Fb,cC as Gb,lC as Hb,dC as Ib,mC as Jb,pC as Kb,uC as Lb,fC as Mb,_C as Nb,hC as Ob,gC as Pb,yC as Qb,bC as Rb,wC as Sb,vC as Tb,kC as Ub,SC as Vb,IC as Wb,AC as Xb,EC as Yb,TC as Zb,CC as _b,RC as $b,xC as ac,OC as bc,$C as cc,FC as dc,PC as ec,LC as fc,NC as gc,DC as hc,MC as ic,jC as jc,GC as kc,UC as lc,qC as mc,zC as nc,HC as oc,WC as pc,VC as qc,BC as rc,KC as sc,YC as tc,JC as uc,XC as vc,ZC as wc,QC as xc,Ug as yc,eR as zc};
2247
- //# sourceMappingURL=chunk-XRN3JYNN.js.map
2247
+ //# sourceMappingURL=chunk-VWVFKPLX.js.map
@@ -1,11 +1,11 @@
1
- import{b as g,c as I,d as D}from"./chunk-YM342ELM.js";import{a as de}from"./chunk-EGAIIWI3.js";import{L as ne,P as ie,U as ae,n as te,u as A,w as oe}from"./chunk-A6NDNRCK.js";import{$a as Q,Gc as K,Sc as W,Uc as X,Wc as Y,Yb as V,Zc as Z,_c as ee,aa as q,ad as re,bd as se,cd as le,na as L}from"./chunk-BNAT4EYR.js";import"./chunk-DEZPZOQ7.js";import{$o as N,Ec as k,Ff as v,If as f,Jf as m,Jo as y,Mo as s,Oo as d,Wj as R,Wo as G,Xj as T,Xo as M,Yo as $,Zo as B,_a as O,_o as U,ap as z,bp as P,cp as H,dp as J,ii as j,l as E,la as c,m as C,na as u,zf as S}from"./chunk-UIAH7UFK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="19d28e23-5337-5ec0-83e6-6e43b462ece7")}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]="10ce695f-65e7-5ea4-bdd8-472ad9527506")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(l=>l===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=P(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=z(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function F(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Lower timestamp bound (ISO/date string or relative)").option("--to <value>","Upper timestamp bound (ISO/date string or relative)").option("--limit <n>","Return only the latest n activity entries").option("--unbounded","Explicitly return every matching activity entry (disables the default bound)").option("--compact","Condensed output: show only id, op, ts, author, msg per entry").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl").description("Show recent activity across items.").action(fe)}(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]="1a62fe05-4407-5e76-87fa-5109dcca5640")}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]="25c5349b-60d7-505b-98b0-3ed19e44b791")}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]="b40cde4c-ca5a-522d-a731-52503c7e4fe0")}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]="9212f45c-798d-5774-87ce-bb7d6ff5514a")}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]="deee1339-ac17-5ae9-8add-a9dd766d182e")}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]="de0fbee0-0bcf-5a46-9013-f7f883d3d0a3")}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]="b662e21b-a163-5834-8789-65243f4c7c9c")}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]="5cc1722c-b797-5b95-a493-3925003ba72e")}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]="35c679a2-9d47-51fa-8bd2-175a4ec48d6b")}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]="507df40e-86e4-532b-8e84-3c5a3baad385")}catch{}})();function ye(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ce(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){q[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function ue(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ve={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function ge(e,t){let o=e.stream===!0,i=ce(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function be(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?R(i):T(i);!o.effectiveGlobal.quiet&&a.length>0&&v(`${a}
1
+ import{b as g,c as I,d as F}from"./chunk-YM342ELM.js";import{a as de}from"./chunk-SCZMJ5DC.js";import{L as ne,P as ie,U as ae,n as te,u as A,w as oe}from"./chunk-JAVO3Z42.js";import{$a as Q,Gc as K,Sc as W,Uc as X,Wc as Y,Yb as V,Zc as Z,_c as ee,aa as q,ad as re,bd as se,cd as le,na as L}from"./chunk-BNAT4EYR.js";import"./chunk-DEZPZOQ7.js";import{$o as N,Ec as k,Ff as v,If as f,Jf as m,Jo as y,Mo as s,Oo as d,Wj as R,Wo as G,Xj as T,Xo as M,Yo as $,Zo as B,_a as O,_o as U,ap as z,bp as P,cp as H,dp as J,ii as j,l as E,la as c,m as C,na as u,zf as S}from"./chunk-UIAH7UFK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="19d28e23-5337-5ec0-83e6-6e43b462ece7")}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]="10ce695f-65e7-5ea4-bdd8-472ad9527506")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(l=>l===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=P(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=z(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function D(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Lower timestamp bound (ISO/date string or relative)").option("--to <value>","Upper timestamp bound (ISO/date string or relative)").option("--limit <n>","Return only the latest n activity entries").option("--unbounded","Explicitly return every matching activity entry (disables the default bound)").option("--compact","Condensed output: show only id, op, ts, author, msg per entry").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl").description("Show recent activity across items.").action(fe)}(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]="1a62fe05-4407-5e76-87fa-5109dcca5640")}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]="25c5349b-60d7-505b-98b0-3ed19e44b791")}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]="b40cde4c-ca5a-522d-a731-52503c7e4fe0")}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]="9212f45c-798d-5774-87ce-bb7d6ff5514a")}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]="deee1339-ac17-5ae9-8add-a9dd766d182e")}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]="de0fbee0-0bcf-5a46-9013-f7f883d3d0a3")}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]="b662e21b-a163-5834-8789-65243f4c7c9c")}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]="5cc1722c-b797-5b95-a493-3925003ba72e")}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]="35c679a2-9d47-51fa-8bd2-175a4ec48d6b")}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]="b87b0c47-74ba-5095-b6b5-a10061d6d45a")}catch{}})();function ye(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ce(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){q[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function ue(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ve={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function ge(e,t){let o=e.stream===!0,i=ce(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function be(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?R(i):T(i);!o.effectiveGlobal.quiet&&a.length>0&&v(`${a}
2
2
  `)}else if(o.listFormat==="ndjson"){k(t);let i=I(t.items);!o.effectiveGlobal.quiet&&i.length>0&&v(`${i}
3
3
  `)}else o.streamMode?$(e,t,o.effectiveGlobal):f(t,o.effectiveGlobal)}async function we(e){let t=y(e.actionCommand),o=e.aliasContract?{...t,command:e.aliasContract.canonical}:t,i=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await j(O(process.cwd(),o.path)).then(me=>me.ux.deprecation_hints)&&m(C(e.aliasContract));let a=S("list",e.options),n=G(a),r=xe(e,n),{effectiveName:l,effectiveStatus:h,effectiveDependencyBlocked:p,effectiveExcludeTerminal:w}=r;he(n,l),Object.assign(n,{projectionCommand:l}),w&&(n.excludeTerminal=!0),n.dependencyBlocked=p;let x=ge(a,o),pe=await L(p?void 0:h,n,o);be("list",pe,x),o.profile&&m(`profile:command=list took_ms=${Date.now()-i}`)}function xe(e,t){let o=e.name,i=e.status,a=e.dependencyBlocked===!0,n=e.excludeTerminal===!0,r=t.status?.trim().toLowerCase(),l=e.name==="list"&&r!==void 0?ve[r]:void 0;return e.name==="list"&&(e.options.all===!0||r==="all"?(o="list-all",n=!1,t.status=void 0):r!==void 0&&l!==void 0&&(o=l.name,i=r,a=l.dependencyBlocked,n=!1,t.status=void 0)),(o==="list-open"||o==="list-in-progress")&&(t.lifecycleBucket=o==="list-open"?"open":"in_progress",i=void 0),{effectiveName:o,effectiveStatus:i,effectiveDependencyBlocked:a,effectiveExcludeTerminal:n}}function ke(e,t){let{name:o,description:i,status:a,excludeTerminal:n,allowStatusFilter:r,dependencyBlocked:l,aliasContract:h}=t,p=e.command(o,{hidden:h?.hidden===!0}).description(i);r&&p.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),o==="list"&&p.option("--all","Include every lifecycle status"),p.option("--for <intent>",`Apply a declared context intent projection. ${g("list","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--type <value>","Filter by item type (repeatable or comma-separated; matches any)",s).option("--tag <value>","Filter by tag (repeatable or comma-separated; matches any)",s).option("--priority <value>","Filter by priority (repeatable or comma-separated; matches any)",s).option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--today","Filter to items updated since local midnight today").option("--recent","Filter to items updated in the last 7 days").option("--updated-after <value>","Updated since ISO timestamp or signed relative (-2h/-7d for past); use last-window ISO").option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--ids <value>","Filter by explicit item IDs (comma-separated or repeatable)").option("--assignee <value>","Filter by assignee",s).option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint",s).option("--release <value>","Filter by release",s).option("--filter-ac-missing","Show only items missing acceptance_criteria").option("--filter-estimates-missing","Show only items missing estimated_minutes").option("--filter-resolution-missing","Show only terminal items missing resolution").option("--filter-metadata-missing","Show only items missing any tracked metadata (AC, estimate, or resolution)").option("--limit <n>","Alias for --output-limit; --output-budget may cap rows").option("--offset <n>","Skip the first n matching rows before limit is applied").option("--after <cursor>","Continue after an opaque next_cursor from a previous list response").option("--no-truncate","Return every matched row after the explicit status and field filters").option("--include-body","Include item body in each returned list row").option("--strict-read","Fail closed if any item document or item directory cannot be read").option("--compact","Render compact list projection fields (mutually exclusive with --brief/--full/--fields)").option("--brief","Ultra-compact output: id, status, type, title only (agent-optimized, mutually exclusive with --compact/--full/--fields)").option("--full","Render full list projection fields (mutually exclusive with --compact/--brief/--fields)").option("--fields <value>",`Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${g(o,"--fields")}`).option("--sort <value>","Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)").option("--order <value>","Sort order: asc|desc (requires --sort)").option("--tree","Render rows in parent/child tree order").option("--tree-depth <n>","Maximum recursion depth with --tree (0 keeps root rows only)").option("--format <value>","Output render mode: csv|table (human export) or json|ndjson|toon (machine output override)").option("--stream","Emit line-delimited JSON rows (requires --json)"),ue(p),p.action(async(w,x)=>{await we({name:o,status:a,excludeTerminal:n,dependencyBlocked:l,options:w,actionCommand:x,aliasContract:h})}),d(p,"--tags <value>","Alias for --tag"),d(p,"--assignee_filter <value>","Alias for --assignee-filter"),d(p,"--tree_depth <n>","Alias for --tree-depth"),d(p,"--token_budget <n>","Alias for --token-budget"),d(p,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function Se(e,t){let o=y(t),i=Date.now(),a=await te(M(e),o);f(a,o),o.profile&&m(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function _e(e,t){let o=y(t),i=Date.now(),a=H(S("context",e)),n=await X(a,o),r=K(a,o);if(r==="markdown")o.quiet||v(`${W(n)}
4
4
  `);else if(r==="ndjson"){k(n);let l=I([...n.high_level,...n.low_level,...n.blocked_fallback]);!o.quiet&&l.length>0&&v(`${l}
5
5
  `)}else f(n,{...o,json:r==="json"});o.profile&&m(`profile:command=context took_ms=${Date.now()-i}`)}async function Ie(e,t){let o=y(t),i=Date.now(),a=J(S("next",e)),n=await Z(a,o),r=Y(a,o);r==="markdown"?o.quiet||v(`${ee(n)}
6
6
  `):f(n,{...o,json:r==="json"}),o.profile&&m(`profile:command=next took_ms=${Date.now()-i}`)}async function Ae(e,t,o){let i=y(o),a=Date.now(),n=N(e),r=S("search",t,[n]),l=U(r),h=await ne(n,l,i),p=typeof r.format=="string"?r.format.trim().toLowerCase():void 0,w=_("Search",r.format,i,!0);if(p==="ndjson"){k(h);let x=I(h.items);!w.quiet&&x.length>0&&v(`${x}
7
- `)}else f(h,w);i.profile&&m(`profile:command=search took_ms=${Date.now()-a}`)}async function De(e,t){let o=y(t),i=Date.now(),a=await ae({mode:typeof e.mode=="string"?e.mode:void 0,k:typeof e.k=="string"?e.k:void 0,failUnder:typeof e.failUnder=="string"?e.failUnder:void 0,queries:typeof e.queries=="string"?e.queries:void 0,format:typeof e.format=="string"?e.format:void 0},o);if(f(a,_("Eval",e.format,o)),o.profile&&m(`profile:command=eval took_ms=${Date.now()-i}`),!a.passed)throw new u("Eval gate failed: one or more aggregate or per-query thresholds were not met; inspect the metric report",c.GENERIC_FAILURE)}async function Fe(e,t,o){let i=y(o),a=Date.now(),n=S("get",t,[e]),r=await A(e,i,{depth:typeof n.depth=="string"?n.depth:void 0,fields:typeof n.fields=="string"?n.fields:void 0,full:!!n.full,tree:n.tree===!0,treeDepth:typeof n.treeDepth=="string"?n.treeDepth:typeof n.tree_depth=="string"?n.tree_depth:void 0,at:typeof n.at=="string"?n.at:void 0});f(r,_("Get",n.format,i)),i.profile&&m(`profile:command=get took_ms=${Date.now()-a}`)}async function Ee(e,t,o){let i=y(o),a=Date.now();if([t.compact,t.raw,t.full,t.provenance].filter(h=>h===!0).length>1)throw new u("History projection options are mutually exclusive. Use --compact, --provenance, or --full.",c.USAGE);let n=typeof t.field=="string"?t.field:void 0,r=!!t.strictExit||!!t.failOnWarn;if(r&&!t.verify)throw new u("--strict-exit requires --verify (it gates on the verification result).",c.USAGE);let l=await oe(e,{limit:typeof t.limit=="string"?t.limit:void 0,compact:!(t.full===!0||t.provenance===!0),provenance:t.provenance===!0,provenanceSummary:t.provenanceSummary===!0,harness:b(t,"harness"),agentInstance:b(t,"agentInstance"),provenanceFilter:b(t,"provenanceFilter"),diff:!!t.diff||n!==void 0,field:n,verify:!!t.verify},i);f(l,_("History",t.format,i)),r&&l.verification&&!l.verification.ok&&(process.exitCode=c.GENERIC_FAILURE),i.profile&&m(`profile:command=history took_ms=${Date.now()-a}`)}function b(e,t){let o=e[t];return Array.isArray(o)?o:void 0}function Ce(e,t){let o=b(e,"harness"),i=b(e,"agentInstance"),a=b(e,"provenanceFilter"),n=typeof e.cursorMode=="string"?e.cursorMode:void 0;if(n!==void 0&&n!=="batch"&&n!=="row")throw new u("Events --cursor-mode must be batch or row.",c.USAGE,{code:"invalid_event_cursor_mode"});let r=n;return{pmRoot:t,since:typeof e.since=="string"?e.since:void 0,type:b(e,"type"),author:b(e,"author"),item:b(e,"item"),limit:typeof e.limit=="string"?Number(e.limit):void 0,full:e.full===!0,...e.provenance===!0?{provenance:!0}:{},...e.provenanceSummary===!0?{provenanceSummary:!0}:{},...o===void 0?{}:{harness:o},...i===void 0?{}:{agentInstance:i},...a===void 0?{}:{provenanceFilter:a},cursorMode:r}}async function Oe(e,t,o){if(t.provenanceSummary===!0)throw new u("Events --provenance-summary is bounded to one page and cannot be combined with --follow.",c.USAGE);let i=typeof t.intervalMs=="string"?Number(t.intervalMs):void 0;if(e.cursorMode==="row"){for await(let a of le({...e,intervalMs:i}))o||v(`${JSON.stringify(a)}
8
- `);return}for await(let a of se({...e,intervalMs:i}))o||v(`${D(a.events,{count:a.count,has_more:a.has_more,next_cursor:a.next_cursor??null,source:a.source,heartbeat:a.count===0})}
9
- `)}function je(e){return e.cursor_mode==="row"?I(e.events):D(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function Re(e,t){let o=y(t),i=Date.now(),a=Ce(e,o.path);if(e.follow===!0){await Oe(a,e,o.quiet===!0);return}let n=await re(a);if(k(n),o.json){f(n,o),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`);return}let r=je(n);!o.quiet&&r.length>0&&v(`${r}
10
- `),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`)}async function Te(e,t,o,i,a){let n=y(a),r=Date.now(),l=await Q(e,t,o,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},n);f(l,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function Dt(e,t){let o=t?.commandFilter,i=n=>ye(n,o),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let n of a)if(i(n.name)){let r=E(n.name);ke(e,{...n,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let n=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");d(n,"--include_unparented","Alias for --include-unparented"),d(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Continue ranked focus after a next_cursor from a previous context response").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Maximum estimated tokens spent on ranked focus rows").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--max-items <n>","Alias for --limit"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(_e)}if(i("next")){let n=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--blocked_limit <n>","Alias for --blocked-limit"),d(n,"--ready_only","Alias for --ready-only"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ie)}if(i("search")){let n=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Continue after an opaque next_cursor from a previous search response");ue(n),n.action(Ae),d(n,"--tags <value>","Alias for --tag"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ie}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(De),i("get")){let n=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","Detail depth: brief|standard|deep|full (full aliases deep; default: standard)").option("--full","Explicit full item read; equivalent to --depth deep (mutually exclusive with --depth/--fields)").option("--fields <value>",`Render custom comma-separated item metadata fields. ${g("get","--fields")}`).option("--tree","Include descendants rooted at the requested item").option("--tree-depth <n>","Maximum subtree depth for --tree descendants").option("--at <version-or-timestamp>","Reconstruct a verified historical item state without mutating it").option("--format <value>","Get output format override: json|toon").description("Show item details by ID.").action(Fe);d(n,"--tree_depth <n>","Alias for --tree-depth"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("history")){let n=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest n entries").option("--compact","Index, time, op, author, patch count, fields").option("--full","Full entries with JSON Patches").option("--provenance","Authors and provenance; no patches").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Recorded/resolved harness (repeatable)",s).option("--agent-instance <value>","Agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Exact provenance match (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Show item history entries.").action(Ee);de(n,!0),F(n.command("activity"))}i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event").option("--full","Include each complete authoritative history entry").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Continue emitting committed events as newline-delimited JSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Emit cursor-resumable committed mutation facts as newline-delimited JSON.").action(Re),i("activity")&&F(e.command("activity",{hidden:!0})),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(Te)}var Ft={resolveReadCommandOutputFormat:_,parseListFormat:ce};export{Ft as _testOnlyRegisterListQuery,Dt as registerListQueryCommands};
11
- //# sourceMappingURL=register-list-query-SYNBVMNG.js.map
7
+ `)}else f(h,w);i.profile&&m(`profile:command=search took_ms=${Date.now()-a}`)}async function Fe(e,t){let o=y(t),i=Date.now(),a=await ae({mode:typeof e.mode=="string"?e.mode:void 0,k:typeof e.k=="string"?e.k:void 0,failUnder:typeof e.failUnder=="string"?e.failUnder:void 0,queries:typeof e.queries=="string"?e.queries:void 0,format:typeof e.format=="string"?e.format:void 0},o);if(f(a,_("Eval",e.format,o)),o.profile&&m(`profile:command=eval took_ms=${Date.now()-i}`),!a.passed)throw new u("Eval gate failed: one or more aggregate or per-query thresholds were not met; inspect the metric report",c.GENERIC_FAILURE)}async function De(e,t,o){let i=y(o),a=Date.now(),n=S("get",t,[e]),r=await A(e,i,{depth:typeof n.depth=="string"?n.depth:void 0,fields:typeof n.fields=="string"?n.fields:void 0,full:!!n.full,tree:n.tree===!0,treeDepth:typeof n.treeDepth=="string"?n.treeDepth:typeof n.tree_depth=="string"?n.tree_depth:void 0,at:typeof n.at=="string"?n.at:void 0});f(r,_("Get",n.format,i)),i.profile&&m(`profile:command=get took_ms=${Date.now()-a}`)}async function Ee(e,t,o){let i=y(o),a=Date.now();if([t.compact,t.raw,t.full,t.provenance].filter(h=>h===!0).length>1)throw new u("History projection options are mutually exclusive. Use --compact, --provenance, or --full.",c.USAGE);let n=typeof t.field=="string"?t.field:void 0,r=!!t.strictExit||!!t.failOnWarn;if(r&&!t.verify)throw new u("--strict-exit requires --verify (it gates on the verification result).",c.USAGE);let l=await oe(e,{limit:typeof t.limit=="string"?t.limit:void 0,compact:!(t.full===!0||t.provenance===!0),provenance:t.provenance===!0,provenanceSummary:t.provenanceSummary===!0,harness:b(t,"harness"),agentInstance:b(t,"agentInstance"),provenanceFilter:b(t,"provenanceFilter"),diff:!!t.diff||n!==void 0,field:n,verify:!!t.verify},i);f(l,_("History",t.format,i)),r&&l.verification&&!l.verification.ok&&(process.exitCode=c.GENERIC_FAILURE),i.profile&&m(`profile:command=history took_ms=${Date.now()-a}`)}function b(e,t){let o=e[t];return Array.isArray(o)?o:void 0}function Ce(e,t){let o=b(e,"harness"),i=b(e,"agentInstance"),a=b(e,"provenanceFilter"),n=typeof e.cursorMode=="string"?e.cursorMode:void 0;if(n!==void 0&&n!=="batch"&&n!=="row")throw new u("Events --cursor-mode must be batch or row.",c.USAGE,{code:"invalid_event_cursor_mode"});let r=n;return{pmRoot:t,since:typeof e.since=="string"?e.since:void 0,type:b(e,"type"),author:b(e,"author"),item:b(e,"item"),limit:typeof e.limit=="string"?Number(e.limit):void 0,full:e.full===!0,...e.provenance===!0?{provenance:!0}:{},...e.provenanceSummary===!0?{provenanceSummary:!0}:{},...o===void 0?{}:{harness:o},...i===void 0?{}:{agentInstance:i},...a===void 0?{}:{provenanceFilter:a},cursorMode:r}}async function Oe(e,t,o){if(t.provenanceSummary===!0)throw new u("Events --provenance-summary is bounded to one page and cannot be combined with --follow.",c.USAGE);let i=typeof t.intervalMs=="string"?Number(t.intervalMs):void 0;if(e.cursorMode==="row"){for await(let a of le({...e,intervalMs:i}))o||v(`${JSON.stringify(a)}
8
+ `);return}for await(let a of se({...e,intervalMs:i}))o||v(`${F(a.events,{count:a.count,has_more:a.has_more,next_cursor:a.next_cursor??null,source:a.source,heartbeat:a.count===0})}
9
+ `)}function je(e){return e.cursor_mode==="row"?I(e.events):F(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function Re(e,t){let o=y(t),i=Date.now(),a=Ce(e,o.path);if(e.follow===!0){await Oe(a,e,o.quiet===!0);return}let n=await re(a);if(k(n),o.json){f(n,o),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`);return}let r=je(n);!o.quiet&&r.length>0&&v(`${r}
10
+ `),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`)}async function Te(e,t,o,i,a){let n=y(a),r=Date.now(),l=await Q(e,t,o,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},n);f(l,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function Ft(e,t){let o=t?.commandFilter,i=n=>ye(n,o),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let n of a)if(i(n.name)){let r=E(n.name);ke(e,{...n,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let n=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");d(n,"--include_unparented","Alias for --include-unparented"),d(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Continue ranked focus after a next_cursor from a previous context response").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Maximum estimated tokens spent on ranked focus rows").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--max-items <n>","Alias for --limit"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(_e)}if(i("next")){let n=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--blocked_limit <n>","Alias for --blocked-limit"),d(n,"--ready_only","Alias for --ready-only"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ie)}if(i("search")){let n=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Continue after an opaque next_cursor from a previous search response");ue(n),n.action(Ae),d(n,"--tags <value>","Alias for --tag"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ie}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(Fe),i("get")){let n=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","brief|standard|deep|full (default: standard)").option("--full","Full details and children for any type; excludes --depth/--fields").option("--fields <value>",`Render custom comma-separated item metadata fields. ${g("get","--fields")}`).option("--tree","Include descendants rooted at the requested item").option("--tree-depth <n>","Maximum subtree depth for --tree descendants").option("--at <version-or-timestamp>","Reconstruct a verified historical item state without mutating it").option("--format <value>","Get output format override: json|toon").description("Show item details by ID.").action(De);d(n,"--tree_depth <n>","Alias for --tree-depth"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("history")){let n=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest n entries").option("--compact","Index, time, op, author, patch count, fields").option("--full","Full entries with JSON Patches").option("--provenance","Authors and provenance; no patches").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Recorded/resolved harness (repeatable)",s).option("--agent-instance <value>","Agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Exact provenance match (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Show item history entries.").action(Ee);de(n,!0),D(n.command("activity"))}i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event").option("--full","Include each complete authoritative history entry").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Continue emitting committed events as newline-delimited JSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Emit cursor-resumable committed mutation facts as newline-delimited JSON.").action(Re),i("activity")&&D(e.command("activity",{hidden:!0})),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(Te)}var Dt={resolveReadCommandOutputFormat:_,parseListFormat:ce};export{Dt as _testOnlyRegisterListQuery,Ft as registerListQueryCommands};
11
+ //# sourceMappingURL=register-list-query-L6HAHW7V.js.map