@unbrained/pm-cli 2026.9.29 → 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 (96) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +21 -0
  3. package/dist/cli/main.js +1 -1
  4. package/dist/cli/register-list-query.d.ts +8 -5
  5. package/dist/cli/register-list-query.js +2 -2
  6. package/dist/cli-bundle/bundle-manifest.json +153 -153
  7. package/dist/cli-bundle/chunks/{chunk-4DOL43PF.js → chunk-7E2EBJLY.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-SC6JHXFT.js → chunk-A2UPOCSW.js} +27 -27
  9. package/dist/cli-bundle/chunks/{chunk-OTLIM22J.js → chunk-AYHLUJKD.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-5KEPG36D.js → chunk-BNAT4EYR.js} +9 -9
  11. package/dist/cli-bundle/chunks/{chunk-S5A2UIRV.js → chunk-DGOIXJZJ.js} +46 -46
  12. package/dist/cli-bundle/chunks/{chunk-SJI55O65.js → chunk-HGJLVN56.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-U3QJGJYN.js → chunk-JAVO3Z42.js} +3 -3
  14. package/dist/cli-bundle/chunks/{chunk-GP6QTYSD.js → chunk-SCZMJ5DC.js} +2 -2
  15. package/dist/cli-bundle/chunks/chunk-TV3YDE36.js +2 -0
  16. package/dist/cli-bundle/chunks/{chunk-SEJ53XDN.js → chunk-UIAH7UFK.js} +65 -65
  17. package/dist/cli-bundle/chunks/{chunk-2AQKVJMW.js → chunk-USTAFHIM.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-PJSQAWWQ.js → chunk-VWVFKPLX.js} +73 -73
  19. package/dist/cli-bundle/chunks/{chunk-P75SO5HO.js → chunk-YM342ELM.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-list-query-R3ELWWPY.js → register-list-query-L6HAHW7V.js} +6 -6
  21. package/dist/cli-bundle/chunks/{register-mutation-WHXJXIHJ.js → register-mutation-6OCZVTW5.js} +2 -2
  22. package/dist/cli-bundle/chunks/{register-operations-7ASWBYQG.js → register-operations-3E5U4TOE.js} +2 -2
  23. package/dist/cli-bundle/chunks/{register-setup-FDRTUG54.js → register-setup-VUD37N4A.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-MRH4A542.js → chunk-3CAZ7Z4R.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-5MC57KRC.js → chunk-4AORVUT4.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-NY6FLQTN.js → chunk-6275G2AN.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/{chunk-T4H6Q44B.js → chunk-DJPP2HAK.js} +3 -3
  28. package/dist/cli-bundle/focused-chunks/{chunk-NXQZMKW5.js → chunk-EVMH4SKN.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-6OXJVE74.js → chunk-IDB6E3ZV.js} +27 -27
  30. package/dist/cli-bundle/focused-chunks/{chunk-2O3QFI3G.js → chunk-IQBFYQF2.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-KLKKCHWM.js → chunk-MOUCTR72.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-7URX7FMY.js → chunk-OMBDUJWZ.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-AZE7KUHG.js → chunk-RIJQQOEZ.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-IFBA3ZAT.js → chunk-T4PZJQG4.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-DZVOCJFY.js → chunk-UPOMLSW7.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-AVP5C674.js → chunk-XB5Q2P7Z.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-K3AIMRIK.js → chunk-XUCXRZZZ.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-FBIRNSYP.js → chunk-YBQ27KG7.js} +49 -49
  39. package/dist/cli-bundle/focused-chunks/{chunk-4A4DO5ZT.js → chunk-ZJ3CLTV4.js} +2 -2
  40. package/dist/cli-bundle/main.js +2 -2
  41. package/dist/cli-bundle/sdk-authoring.js +1 -1
  42. package/dist/cli-bundle/sdk-contracts.js +1 -1
  43. package/dist/cli-bundle/sdk-core.js +22 -22
  44. package/dist/cli-bundle/sdk-governance.js +1 -1
  45. package/dist/cli-bundle/sdk-graph.js +1 -1
  46. package/dist/cli-bundle/sdk-merge.js +37 -37
  47. package/dist/cli-bundle/sdk-query.js +1 -1
  48. package/dist/cli-bundle/sdk-runtime.js +1 -1
  49. package/dist/cli-bundle/sdk-testing.js +1 -1
  50. package/dist/cli-bundle/sdk.js +2 -2
  51. package/dist/core/extensions/extension-types.d.ts +13 -0
  52. package/dist/core/extensions/extension-types.js +1 -1
  53. package/dist/core/history/workspace-history.d.ts +17 -0
  54. package/dist/core/history/workspace-history.js +1 -1
  55. package/dist/sdk/extension-command-context.d.ts +1 -7
  56. package/dist/sdk/extension-command-context.js +1 -1
  57. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  58. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  59. package/dist/sdk/lifecycle/update.d.ts +2 -0
  60. package/dist/sdk/lifecycle/update.js +1 -1
  61. package/dist/sdk/merge/install.d.ts +2 -2
  62. package/dist/sdk/merge/install.js +1 -1
  63. package/dist/sdk/public-surface.json +1 -1
  64. package/dist/sdk/query/get.d.ts +19 -15
  65. package/dist/sdk/query/get.js +1 -1
  66. package/dist/sdk/runtime.js +1 -1
  67. package/dist/sdk/structured-mutations.js +1 -1
  68. package/dist/sdk/testing.js +1 -1
  69. package/docs/BOUNDED_CONTEXT_READS.md +10 -7
  70. package/docs/COMMANDS.md +1 -1
  71. package/docs/MERGE_SAFETY.md +17 -6
  72. package/docs/README.md +1 -0
  73. package/docs/RELEASE_RELIABILITY.md +26 -4
  74. package/docs/SDK_AUDITED_MUTATIONS.md +52 -0
  75. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +5 -3
  76. package/marketplace.json +2 -2
  77. package/package.json +1 -1
  78. package/packages/pm-beads/package.json +1 -1
  79. package/packages/pm-calendar/package.json +1 -1
  80. package/packages/pm-command-kit/package.json +1 -1
  81. package/packages/pm-digital-twin/package.json +1 -1
  82. package/packages/pm-governance-audit/package.json +1 -1
  83. package/packages/pm-guide-shell/package.json +1 -1
  84. package/packages/pm-kanban/package.json +1 -1
  85. package/packages/pm-lifecycle-hooks/package.json +1 -1
  86. package/packages/pm-linked-test-adapters/package.json +1 -1
  87. package/packages/pm-search-advanced/package.json +1 -1
  88. package/packages/pm-templates/package.json +1 -1
  89. package/packages/pm-todos/package.json +1 -1
  90. package/packages/pm-vcs/package.json +1 -1
  91. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  92. package/plugins/pm-claude/package.json +2 -2
  93. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  94. package/plugins/pm-codex/package.json +2 -2
  95. package/plugins/pm-codex/plugin.json +1 -1
  96. package/dist/cli-bundle/chunks/chunk-D32HVIB2.js +0 -2
@@ -1,4 +1,4 @@
1
- import{a as pt,b as _t,d as yt}from"./chunk-7URX7FMY.js";import{t as Tr}from"./chunk-AVP5C674.js";import{$ as me,$a as zr,Ab as oe,Ba as Pr,Bb as qr,Ca as St,G as Mr,I as Dr,J as Or,Nb as Hr,Pa as $r,Ra as De,S as fe,Sa as v,Ta as Oe,Tb as Br,U as H,Ub as Gr,X as gt,Xb as Yr,Y as ht,Ya as Ne,Za as re,ab as Ur,cb as Vr,db as jr,lb as Tt,na as wt,nb as vt,oa as Nr,pa as bt,pb as Kr,rb as pe,ua as Fr,vb as ne,wb as _e,xb as It,ya as Et,zb as At}from"./chunk-6OXJVE74.js";import{f as vr,n as ee,p as ft}from"./chunk-4A4DO5ZT.js";import{$ as f,$a as dt,Ac as Ar,Ca as w,Da as T,Ea as de,Fa as Z,Ga as E,Ia as Er,Jc as P,Mc as ke,Pb as Ir,Pc as Cr,Sa as A,Ta as le,Td as M,V as ct,Xd as te,Ya as R,Yd as Lr,Zd as Le,_a as xe,aa as m,ab as lt,ae as Me,bb as Sr,bd as Rr,cb as ue,cd as xr,dd as mt,hd as kr,i as at,rb as ut,sa as V,ua as J,va as S,wa as I,ya as Re}from"./chunk-MRH4A542.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]="df9abedd-6e84-5712-8e5e-4e510ec3ed60")}catch{}})();function Wr(e,t="--limit"){if(e===void 0)return;let r=Number(e);if(!Number.isFinite(r)||r<0)throw new m(`${t} must be a non-negative number`,f.USAGE);return Math.floor(r)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="01b280e5-31b5-532d-b569-67aab828358a")}catch{}})();var hi=3e4,ye=class extends Error{status;constructor(t,r){super(t),this.name="SearchHttpError",this.status=r}};function B(e,t,r=hi){let n=e??r;if(!Number.isFinite(n)||n<=0)throw new Error(`${t} timeout must be a positive finite number`);return Math.floor(n)}function G(e,t){if(e)return e;if(typeof globalThis.fetch=="function")return globalThis.fetch.bind(globalThis);throw new Error(`${t} execution requires a fetch implementation`)}async function wi(e){try{return(await e.text()).replaceAll(/\s+/g," ").trim()}catch(t){return`(failed to read response body: ${E(t)})`}}async function Fe(e){let t=new AbortController,r=setTimeout(()=>{t.abort()},e.timeoutMs);try{let n;try{n=await e.fetcher(e.endpoint,{method:e.method,headers:e.headers,body:JSON.stringify(e.body),signal:t.signal})}catch(o){throw o instanceof Error&&o.name==="AbortError"?new Error(`${e.requestLabel} timed out after ${e.timeoutMs}ms`):new Error(`${e.requestLabel} execution failed: ${E(o)}`)}if(!n.ok){let o=await wi(n),i=o.length>0?`: ${o}`:"";throw new ye(`${e.requestLabel} failed with status ${n.status} ${n.statusText}${i}`,n.status)}try{return await n.json()}catch(o){throw new Error(`${e.responseLabel} JSON parse failed: ${E(o)}`)}}finally{clearTimeout(r)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2c36f008-53c4-5ee7-bc87-6bfb7aeb8f42")}catch{}})();function bl(e,t){let r=w(e);if(!r)return"unconfigured";let n=w(t);return n&&n.toLowerCase()===r.toLowerCase()?"configured":"auto-detected"}function bi(e){let t=de(e),r=t.toLowerCase();return r.endsWith("/embeddings")?t:r.endsWith("/v1")?`${t}/embeddings`:`${t}/v1/embeddings`}function Qr(e){let t=e.search?.embedding_model;return w(t)||null}function Ei(e){let t=w(e.providers?.openai?.base_url),r=w(e.providers?.openai?.model);if(!t||!r)return null;let n=Qr(e),o=w(e.providers?.openai?.api_key);return{name:"openai",base_url:t,model:n??r,...o?{api_key:o}:{}}}function Si(e){let t=w(e.providers?.ollama?.base_url),r=w(e.providers?.ollama?.model);if(!t||!r)return null;let n=Qr(e);return{name:"ollama",base_url:t,model:n??r}}function Jr(e){let t=(Array.isArray(e)?e:[e]).map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("Embedding input must include at least one non-empty string");return t}function Ti(e){let t=[],r=[],n=new Map;for(let o of e){let i=n.get(o);if(i===void 0){let s=t.length;t.push(o),n.set(o,s),r.push(s);continue}r.push(i)}return{uniqueInputs:t,originalToUniqueIndex:r}}function vi(e){let t=e.map((n,o)=>({embedding:n.embedding,index:n.index,position:o}));if(t.some(n=>n.index!==void 0)){for(let n of t)if(!Number.isInteger(n.index))throw new TypeError(`OpenAI embedding response entry at position ${n.position} is missing a valid integer index`);return[...t].sort((n,o)=>{let i=n.index-o.index;return i!==0?i:n.position-o.position})}return t}function Ct(e){let t=Ei(e),r=Si(e),n=[t,r].filter(a=>a!==null),o=w(e.search?.provider),i=o?o.toLowerCase():null;return{active:(i?n.find(a=>a.name===i):void 0)??n[0]??null,available:n}}function Xr(e){let t=de(e.base_url);return e.name==="openai"?{provider:"openai",endpoint:bi(t),model:e.model}:{provider:"ollama",endpoint:`${t}/api/embed`,model:e.model}}function Ii(e,t){let r=Jr(t);return e.name==="openai"?{target:Xr(e),method:"POST",headers:{"content-type":"application/json",...e.api_key?{authorization:`Bearer ${e.api_key}`}:{}},body:{model:e.model,input:r.length===1?r[0]:r}}:{target:Xr(e),method:"POST",headers:{"content-type":"application/json"},body:{model:e.model,input:r}}}function Ai(e,t){if(e.name==="openai"){let o=t.data;if(!Array.isArray(o)||o.length===0)throw new Error("OpenAI embedding response must include a non-empty data array");return vi(o).map((s,a)=>{let c=s.embedding;if(!Z(c))throw new Error(`OpenAI embedding response entry at index ${a} is missing a numeric embedding vector`);return[...c]})}let r=t.embedding;if(Z(r))return[[...r]];let n=t.embeddings;if(Array.isArray(n)&&n.length>0)return n.map((o,i)=>{if(!Z(o))throw new Error(`Ollama embedding response entry at index ${i} is missing a numeric embedding vector`);return[...o]});throw new Error("Ollama embedding response must include embedding or embeddings vectors")}async function Zr(e,t,r={}){let n=B(r.timeout_ms,"Embedding request"),o=G(r.fetcher,"Embedding request"),i=Jr(t),s=Ti(i),a=Ii(e,s.uniqueInputs),c=await Fe({endpoint:a.target.endpoint,method:a.method,headers:a.headers,body:a.body,timeoutMs:n,fetcher:o,requestLabel:"Embedding request",responseLabel:"Embedding response"}),d=Ai(e,c);if(d.length!==s.uniqueInputs.length)throw new Error(`Embedding response cardinality mismatch: expected ${s.uniqueInputs.length} vector(s), received ${d.length}`);return s.originalToUniqueIndex.map(l=>[...d[l]])}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="16c567d7-0065-5401-a768-0913cec6d5f4")}catch{}})();var Pe=["title","description","tags","status","type","priority","assignee","parent","goal","value","why_now","risk","confidence","estimated_minutes","acceptance_criteria","resolution","expected_result","actual_result","body","comments","notes","learnings","reminders","events","dependencies","plan"];function Rt(e){let t=e?.search?.corpus_fields;if(!Array.isArray(t))return[...Pe];let r=new Set(Pe),n=Array.from(new Set(t.filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>o.length>0&&r.has(o))));return n.length>0?n:[...Pe]}var Ci=8e3,Ri=3200,Y="...[semantic corpus truncated]",xi="search_embedding_corpus_max_characters_invalid:using_provider_default";function O(e){return e.map(t=>t==null?"":String(t).trim()).filter(t=>t.length>0).join(" ")}function ki(e){return(e.reminders??[]).map(t=>O([t.at,t.text]))}function Li(e){return(e.events??[]).map(t=>O([t.start_at,t.end_at,t.title,t.description,t.location,t.all_day===!0?"all day":void 0,t.timezone,t.recurrence?.freq,t.recurrence?.interval,t.recurrence?.count,t.recurrence?.until,t.recurrence?.by_weekday?.join(" "),t.recurrence?.by_month_day?.join(" "),t.recurrence?.exdates?.join(" ")]))}function Mi(e,t){e.push(t.title,t.body,t.status,t.owner,t.evidence,t.blocked_reason,t.superseded_by);for(let r of t.linked_items??[])e.push(`${r.kind} ${r.id}`,r.note);for(let r of t.files??[])e.push(r.path,r.note);for(let r of t.tests??[])e.push(r.command,r.path,r.note);for(let r of t.docs??[])e.push(r.path,r.note)}function Di(e,t){for(let r of t.plan_decisions??[])e.push(r.decision,r.rationale,r.evidence);for(let r of t.plan_discoveries??[])e.push(r.text);for(let r of t.plan_validation??[])e.push(r.text,r.command,r.expected)}function Tl(e){let t=[];t.push(e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context);for(let r of e.plan_steps??[])Mi(t,r);return Di(t,e),t.filter(r=>typeof r=="string"&&r.length>0).join(" ")}function Oi(e){let t=(e.plan_steps??[]).map(s=>O([s.order,s.id,s.title,s.body,s.status,s.owner,s.evidence,s.blocked_reason,s.superseded_by,(s.linked_items??[]).map(a=>O([a.kind,a.id,a.note])).join(" "),(s.files??[]).map(a=>O([a.path,a.note])).join(" "),(s.tests??[]).map(a=>O([a.command,a.path,a.note])).join(" "),(s.docs??[]).map(a=>O([a.path,a.note])).join(" ")])),r=(e.plan_decisions??[]).map(s=>O([s.decision,s.rationale,s.evidence,s.step_id])),n=(e.plan_discoveries??[]).map(s=>O([s.text,s.step_id])),o=(e.plan_validation??[]).map(s=>O([s.text,s.command,s.expected]));if([e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context,...t,...r,...n,...o].some(s=>s!==void 0))return{mode:e.plan_mode,scope:e.plan_scope,harness:e.plan_harness,resume_context:e.plan_resume_context,steps:t,decisions:r,discoveries:n,validation:o}}function D(e){return typeof e=="string"&&e.trim().length>0}var Ni={title:e=>e.metadata.title,description:e=>e.metadata.description,tags:e=>e.metadata.tags,status:e=>e.metadata.status,type:e=>e.metadata.type,priority:e=>typeof e.metadata.priority=="number"?e.metadata.priority:void 0,assignee:e=>D(e.metadata.assignee)?e.metadata.assignee:void 0,parent:e=>D(e.metadata.parent)?e.metadata.parent:void 0,goal:e=>D(e.metadata.goal)?e.metadata.goal:void 0,value:e=>D(e.metadata.value)?e.metadata.value:void 0,why_now:e=>D(e.metadata.why_now)?e.metadata.why_now:void 0,risk:e=>D(e.metadata.risk)?e.metadata.risk:void 0,confidence:e=>e.metadata.confidence!==void 0&&e.metadata.confidence!==null?e.metadata.confidence:void 0,estimated_minutes:e=>typeof e.metadata.estimated_minutes=="number"?e.metadata.estimated_minutes:void 0,acceptance_criteria:e=>D(e.metadata.acceptance_criteria)?e.metadata.acceptance_criteria:void 0,resolution:e=>D(e.metadata.resolution)?e.metadata.resolution:void 0,expected_result:e=>D(e.metadata.expected_result)?e.metadata.expected_result:void 0,actual_result:e=>D(e.metadata.actual_result)?e.metadata.actual_result:void 0,body:e=>e.body,comments:e=>(e.metadata.comments??[]).map(t=>t.text),notes:e=>(e.metadata.notes??[]).map(t=>t.text),learnings:e=>(e.metadata.learnings??[]).map(t=>t.text),reminders:e=>ki(e.metadata),events:e=>Li(e.metadata),dependencies:e=>(e.metadata.dependencies??[]).map(t=>({id:t.id,kind:t.kind})),plan:e=>Oi(e.metadata)};function en(e,t={}){let r=t.fields??Pe,n={};for(let o of r){let i=Ni[o];if(!i)continue;let s=i(e);s!==void 0&&(n[o]=s)}return n}function Fi(e){return e?.trim().toLowerCase()==="ollama"?Ri:Ci}function ie(e,t){let r=Fi(e),n=Er(t);return n!==null?{maxCharacters:n,warning:null}:{maxCharacters:r,warning:t==null?null:xi}}function xt(e,t={}){let r=JSON.stringify(en(e,{fields:t.fields})),n=ie(t.providerName,t.maxCharacters).maxCharacters;if(r.length<=n)return r;if(n<=Y.length)return Y.slice(0,n);let o=Math.max(0,n-Y.length);return`${r.slice(0,o)}${Y}`}(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]="dff1d04a-bad4-51d7-ab46-41e49387a44d")}catch{}})();function Pi(e,t,r){let n=e.search.embedding_batch_size,o=e.search.embedding_timeout_ms,i=e.search.scanner_max_batch_retries,s=Number.isFinite(n)&&n>0?Math.max(1,Math.floor(n)):1,a=Number.isFinite(o)&&o>0?Math.max(1,Math.floor(o)):3e4,c=Number.isFinite(i)&&i>=0?Math.floor(i):0;return{batchSize:s,timeoutMs:a,maxRetries:c,maxRequestBytes:r,maxInputCharacters:t}}function $i(e,t,r,n){let o=[],i=[],s=Buffer.byteLength(JSON.stringify({model:e.model,input:[]})),a=s;for(let c of t){let d=Buffer.byteLength(JSON.stringify(c.trim()));if(s+d>n)throw new RangeError(`Embedding input exceeds request byte ceiling ${n}; lower search.embedding_corpus_max_characters or raise maxRequestBytes`);let l=i.length>0?1:0;(i.length>=r||a+l+d>n)&&(o.push(i),i=[],a=s),a+=d+(i.length>0?1:0),i.push(c)}return o.push(i),o}function zi(e,t){if(!Number.isFinite(t)||t<=0||e.length<=t)return e;let r=Math.max(0,t-Y.length);return`${e.slice(0,r)}${Y}`.slice(0,t)}function tn(e){let t=E(e).toLowerCase();return t.includes("timed out")||t.includes("timeout")}function Ui(e,t,r,n,o,i){let s=`Embedding batch ${t} failed after ${o} attempt(s): ${E(i)}`,a=`provider=${e.name} model=${e.model} batch_size=${r} timeout_ms=${n}`;return tn(i)?`${s} (${a}; guidance=check provider availability or lower search.embedding_batch_size, raise search.embedding_timeout_ms, or run keyword search while semantic indexing catches up)`:`${s} (${a})`}function Vi(e){return e instanceof ye?e.status===413?"payload_too_large":null:tn(e)?"timeout":null}async function kt(e,t,r,n,o,i,s){let a=null;for(let c=0;c<=o;c+=1)try{s.requests+=1;let d=await Zr(e,t,{timeout_ms:n});return c>0&&i.push(`search_embedding_batch_retry_succeeded:batch=${r}:attempt=${c+1}:size=${t.length}`),s.successful_batches+=1,s.batch_size_histogram[t.length]=(s.batch_size_histogram[t.length]??0)+1,d}catch(d){a=d;let l=Vi(d);if(l!==null&&t.length>1){s.split_batches+=1;let u=Math.ceil(t.length/2),p=t.slice(0,u),_=t.slice(u);return i.push(`search_embedding_batch_split_after_${l}:batch=${r}:size=${t.length}:parts=${p.length}|${_.length}`),[...await kt(e,p,`${r}.1`,n,o,i,s),...await kt(e,_,`${r}.2`,n,o,i,s)]}if(c<o){s.retries+=1;let u=Math.min(1e3*2**c,8e3);await new Promise(p=>setTimeout(p,u))}}throw new Error(Ui(e,r,t.length,n,o+1,a))}async function Lt(e,t,r,n={}){if(r.length===0)return{vectors:[],warnings:[]};let o=performance.now(),i=n.maxRequestBytes??262144;if(!Number.isSafeInteger(i)||i<=0)throw new RangeError("maxRequestBytes must be a positive safe integer");let s={provider:e.name,model:e.model,max_request_bytes:i,limit_source:n.maxRequestBytes===void 0?"default":"caller",planned_batches:0,requests:0,successful_batches:0,split_batches:0,retries:0,batch_size_histogram:{},elapsed_ms:0,inputs_per_second:0},a=[],c=ie(e.name,t.search.embedding_corpus_max_characters);c.warning&&a.push(c.warning);let d=Pi(t,c.maxCharacters,i),l=0,u=r.map(y=>{if(y.trim().length===0)throw new TypeError("Embedding inputs must be non-empty strings");let h=zi(y,d.maxInputCharacters);return h.length<y.length&&(l+=1),h});l>0&&a.push(`search_embedding_input_truncated:count=${l}:max_characters=${d.maxInputCharacters}`);let p=$i(e,u,d.batchSize,d.maxRequestBytes);s.planned_batches=p.length;let _=[],g=0;for(let y=0;y<p.length;y+=1){let h=p[y];n.onProgress?.({batch_index:y+1,batch_total:p.length,batch_size:h.length,completed_inputs:g,total_inputs:u.length,phase:"start"}),_.push(...await kt(e,h,String(y+1),d.timeoutMs,d.maxRetries,a,s)),g+=h.length,n.onProgress?.({batch_index:y+1,batch_total:p.length,batch_size:h.length,completed_inputs:g,total_inputs:u.length,phase:"complete"})}return s.elapsed_ms=Math.max(1,performance.now()-o),s.inputs_per_second=r.length*1e3/s.elapsed_ms,{vectors:_,warnings:a,receipt:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d7a68072-168d-509a-95ec-145635d71d46")}catch{}})();var rn=[{name:"private-key",mutationRule:"private_key",regex:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/g},{name:"github-token",mutationRule:"github_token",regex:/\b(?:gh[opsru]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g},{name:"npm-token",mutationRule:"npm_token",regex:/\bnpm_[A-Za-z0-9]{20,}\b/g},{name:"aws-access-key",mutationRule:"aws_access_key",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g},{name:"google-api-key",mutationRule:"google_api_key",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g},{name:"slack-token",mutationRule:"slack_token",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{name:"anthropic-api-key",mutationRule:"anthropic_api_key",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g},{name:"openai-api-key",mutationRule:"openai_api_key",regex:/\bsk-(?!ant-)[A-Za-z0-9_-]{20,}\b/g},{name:"gitlab-token",mutationRule:"gitlab_token",regex:/\bglpat-[A-Za-z0-9_.-]{20,}\b/g},{name:"jwt-like-token",mutationRule:"jwt_like_token",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g},{name:"npm-auth-token-assignment",mutationRule:"npm_auth_token_assignment",regex:/_authToken\s*=\s*\S+/g},{name:"sentry-user-token",mutationRule:"sentry_user_token",regex:/\bsntryu_[A-Za-z0-9]{20,}\b/g},{name:"sentry-org-token",mutationRule:"sentry_org_token",regex:/\bsntrys_[A-Za-z0-9_-]{20,}\b/g},{name:"private-ip",mutationRule:"private_ip",regex:/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"private-ssh-target",mutationRule:"private_ssh_target",regex:/\b(?:ssh|scp|rsync)\s+[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"sshpass-inline-password",mutationRule:"sshpass_inline_password",regex:/\bsshpass\s+-p\s+["'][^"']{6,}["']/g},{name:"password-assignment",mutationRule:"password_assignment",regex:/\b(?:password|passphrase)\s*[:=]\s*(?:(?!<|\$\{|\$\()[A-Za-z0-9!@#$%^&*._+\-=]{8,}|"(?!<|\$\{|\$\()[^"]{8,}"|'(?!<|\$\{|\$\()[^']{8,}')/gi},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:/(?:^|[\s"'`(=])\/home\/[A-Za-z0-9._-]+\/[^\s"'`),;]+/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",regex:/\b[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"high-entropy-assignment",mutationRule:"high_entropy_assignment",regex:/\b(?:token|secret|password|passwd|api[_-]?key)\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{24,})/gi,mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5}];function nn(e,t){if(e.minimumEntropy===void 0)return!0;let r=t[1],n=new Map;for(let i of r)n.set(i,(n.get(i)??0)+1);let o=0;for(let i of n.values()){let s=i/r.length;o-=s*Math.log2(s)}return o>=e.minimumEntropy}(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]="eed441f0-e2b5-51e9-b9bf-0f4882a9eeea")}catch{}})();var ji=[{action:"append",history_scope:"item"},{action:"claim",history_scope:"item"},{action:"close",history_scope:"item"},{action:"close-many",history_scope:"item"},{action:"close-task",history_scope:"item"},{action:"comments",history_scope:"conditional"},{action:"config",history_scope:"conditional"},{action:"copy",history_scope:"item"},{action:"create",history_scope:"item"},{action:"delete",history_scope:"item"},{action:"deps",history_scope:"conditional"},{action:"discover",history_scope:"item"},{action:"docs",history_scope:"conditional"},{action:"files",history_scope:"conditional"},{action:"focus",history_scope:"conditional"},{action:"gc",history_scope:"conditional"},{action:"history-compact",history_scope:"history"},{action:"history-author-acknowledge",history_scope:"workspace"},{action:"history-redact",history_scope:"history"},{action:"history-repair",history_scope:"history"},{action:"init",history_scope:"workspace"},{action:"install",history_scope:"conditional"},{action:"learnings",history_scope:"conditional"},{action:"notes",history_scope:"conditional"},{action:"package",history_scope:"conditional"},{action:"pause-task",history_scope:"item"},{action:"plan",history_scope:"conditional"},{action:"profile",history_scope:"conditional"},{action:"release",history_scope:"item"},{action:"restore",history_scope:"item"},{action:"schema",history_scope:"conditional"},{action:"start-task",history_scope:"item"},{action:"templates",history_scope:"conditional"},{action:"test",history_scope:"conditional"},{action:"test-all",history_scope:"conditional"},{action:"update",history_scope:"item"},{action:"update-many",history_scope:"item"},{action:"upgrade",history_scope:"conditional"}],Dt=new Map(ji.map(e=>[e.action,e]));function Mt(e,t="$",r=new WeakSet){return typeof e=="string"?[{path:t,value:e}]:typeof e!="object"||e===null?[]:r.has(e)?[]:(r.add(e),Array.isArray(e)?e.flatMap((n,o)=>Mt(n,`${t}[${o}]`,r)):Object.entries(e).flatMap(([n,o])=>Mt(o,`${t}.${n}`,r)))}function on(e){let t=[];for(let r of Mt(e))for(let n of rn){n.regex.lastIndex=0;for(let o of r.value.matchAll(n.regex))if(nn(n,o)){t.push({rule:n.mutationRule,path:r.path});break}}return t.filter((r,n,o)=>o.findIndex(i=>i.rule===r.rule&&i.path===r.path)===n)}function Ki(e){let t=e.author.trim()||"unknown";if(e.settings.require_attributed_author&&t.toLowerCase()==="unknown")throw new m("Mutation author is required by workspace policy.",f.USAGE,{code:"mutation_author_required",required:"Pass --author <id>, set PM_AUTHOR, or configure author_default.",nextSteps:["Retry with --author <stable-agent-id>.","Set PM_AUTHOR for this agent session."]});if(e.settings.secret_guard==="off")return{author:t,findings:[],warnings:[],override_applied:!1};let r;try{r=on(e.payload)}catch{return{author:t,findings:[],warnings:["secret_guard_scan_failed_open"],override_applied:!1}}if(r.length===0)return{author:t,findings:r,warnings:[],override_applied:!1};let n=[...new Set(r.map(o=>o.rule))].sort().join(",");if(e.settings.secret_guard==="block"&&e.force!==!0)throw new m(`Mutation blocked by secret guard (${n}). No detected value was logged.`,f.CONFLICT,{code:"mutation_secret_guard_blocked",required:"Remove the credential-shaped content or retry with --force after explicit review.",nextSteps:["Replace the value with a secret-manager reference.","Use pm history-redact if equivalent content already entered history."],recovery:{recovery_mode:"compact",attempted_command:"pm <mutation> [REDACTED]",normalized_args:["[REDACTED]"],suggested_retry:"Remove credential-shaped content, then retry the mutation."}});return{author:t,findings:r,warnings:[`secret_guard_detected:${r.length}:rules=${n}`,...e.settings.secret_guard==="block"&&e.force===!0?["secret_guard_force_override"]:[]],override_applied:e.settings.secret_guard==="block"&&e.force===!0}}function qi(e){return Dt.has(e.trim().toLowerCase())}function Hi(){return[...Dt.keys()].sort((e,t)=>e.localeCompare(t))}function Ol(e){return Dt.get(e.trim().toLowerCase())}(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]="c18e4dfc-d3e3-5185-9470-9d46b4dca893")}catch{}})();function Bi(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function Fl(e){return Bi(e).split(/[^a-z0-9]+/).filter(t=>t.length>0)}function ge(e,t){if(e.length===0&&t.length===0)return 1;if(e.length===0||t.length===0)return 0;let r=new Set(e),n=new Set(t),o=0;for(let s of r)n.has(s)&&(o+=1);let i=new Set([...r,...n]).size;return o/i}(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]="bff806e7-b1c7-5064-bdd4-6d6dd1a24100")}catch{}})();var Gi=/\b([a-z][a-z0-9]*)-(\d+)(?:-[a-z0-9]+)*\b/giu,Yi=/^(?:utf|iso|sha|tls|http|covid|match)$/iu;function $e(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function we(e){return[...new Set($e(e).match(/[\p{L}\p{N}]+/gu)??[])]}function he(e){let t=$e(e);return{normalized:t,tokens:we(t),issueCodes:[...new Set([...e.matchAll(Gi)].filter(r=>{let n=r[1],o=r.index,i=e.slice(o+r[0].length);return!Yi.test(n)&&(n===n.toUpperCase()||n.length<=2||o===0&&/^\s*(?::|—|–|\])/u.test(i))}).map(r=>r[0].toLowerCase()))]}}function ze(e,t){return Ue(he(e),he(t))}function Ue(e,t){if(e.normalized===t.normalized)return{score:1,reason:"exact_title"};let r=new Set(e.issueCodes);return t.issueCodes.some(n=>r.has(n))?{score:.99,reason:"issue_code"}:{score:ge(e.tokens,t.tokens),reason:"title_token_jaccard"}}import Wi 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]="cdae67c6-8316-5e97-84ca-0be4460ffd57")}catch{}})();function Ve(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function Xi(e,t){return[e.updated_at,t].map(n=>({value:n,time:Date.parse(n??"")})).filter(n=>typeof n.value=="string"&&Number.isFinite(n.time)).sort((n,o)=>o.time-n.time)[0]?.value??e.updated_at}function sn(e,t){let r=Math.max(1,Math.trunc(t.threshold_hours)),n=(t.now??new Date).getTime(),o=Ve(t.in_progress_status),i=[];for(let s of e){if(Ve(String(s.status))!==o||(s.assignee?.trim().length??0)>0)continue;let a=Xi(s,t.last_history_activity?.(s)),c=Date.parse(a);if(!Number.isFinite(c))continue;let d=Math.max(0,Math.floor((n-c)/36e5));d>=r&&i.push({id:s.id,last_activity_at:a,age_hours:d})}return i.sort((s,a)=>a.age_hours-s.age_hours||s.id.localeCompare(a.id)),{threshold_hours:r,count:i.length,items:i,remediation:"Claim active work with `pm claim <id>` or return abandoned work to open with `pm update <id> --status open`."}}async function Qi(e,t,r){let n=new Map;return await Promise.all(t.filter(o=>Ve(String(o.status))===Ve(r.in_progress_status)&&(o.assignee?.trim().length??0)===0).map(async o=>{let i;try{i=await me(Wi.join(e,"history",`${o.id}.jsonl`),o.id)}catch{return}let s=i.map(a=>a.ts).filter(a=>Number.isFinite(Date.parse(a))).sort((a,c)=>Date.parse(c)-Date.parse(a))[0];s&&n.set(o.id,s)})),sn(t,{...r,last_history_activity:o=>n.get(o.id)})}(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]="09f9d531-8ebf-51bf-9ee6-5a3351d96c7a")}catch{}})();var Ji=new Set(["rename-type","rename-field","remap-status",...Ir]);function Zi(e,t){if(t&&!Ji.has(e))throw new m(`schema ${e} does not support --dry-run. Preview is supported for rename-type, rename-field, remap-status and workflow-policy actions. Remove --dry-run only when you intend to apply changes.`,f.USAGE,{code:"invalid_argument_value",examples:["pm schema rename-type Spike --to Experiment --dry-run"]})}import{readFile as es}from"node:fs/promises";import an 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]="93b04081-a71a-5987-8fb6-09a8d045c1da")}catch{}})();function ts(e){let t=e.trim();if(!t)throw new m("--rollback requires a non-empty checkpoint ID",f.USAGE);if(!/^[a-zA-Z0-9._-]+$/.test(t))throw new m("--rollback checkpoint ID must match [a-zA-Z0-9._-]+",f.USAGE);return t}function rs(e,t){let r=t.replace(/[-:.TZ]/g,"").slice(0,14),n=Math.random().toString(36).slice(2,8);return`${e}-${r}-${n}`}function ns(e,t){return an.join(e,"checkpoints",t)}function cn(e,t,r){return an.join(ns(e,t),`${r}.json`)}async function os(e,t,r,n){let o=cn(e,t,r),i=`${JSON.stringify(n,null,2)}
1
+ import{a as pt,b as _t,d as yt}from"./chunk-OMBDUJWZ.js";import{t as Tr}from"./chunk-XB5Q2P7Z.js";import{$a as re,Bb as At,Ca as Pr,Cb as oe,Da as St,Db as qr,H as Mr,J as Dr,K as Or,Pb as Hr,Qa as $r,T as fe,Ta as De,Ua as v,V as H,Va as Oe,Vb as Br,Wb as Gr,Y as gt,Z as ht,Zb as Yr,_a as Ne,aa as me,bb as zr,cb as Ur,eb as Vr,fb as jr,nb as Tt,oa as wt,pa as Nr,pb as vt,qa as bt,rb as Kr,tb as pe,va as Fr,xb as ne,yb as _e,za as Et,zb as It}from"./chunk-IDB6E3ZV.js";import{f as vr,n as ee,p as ft}from"./chunk-ZJ3CLTV4.js";import{$ as f,$a as dt,Ac as Ar,Ca as w,Da as T,Ea as de,Fa as Z,Ga as E,Ia as Er,Jc as P,Mc as ke,Pb as Ir,Pc as Cr,Sa as A,Ta as le,Td as M,V as ct,Xd as te,Ya as R,Yd as Lr,Zd as Le,_a as xe,aa as m,ab as lt,ae as Me,bb as Sr,bd as Rr,cb as ue,cd as xr,dd as mt,hd as kr,i as at,rb as ut,sa as V,ua as J,va as S,wa as I,ya as Re}from"./chunk-3CAZ7Z4R.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]="df9abedd-6e84-5712-8e5e-4e510ec3ed60")}catch{}})();function Wr(e,t="--limit"){if(e===void 0)return;let r=Number(e);if(!Number.isFinite(r)||r<0)throw new m(`${t} must be a non-negative number`,f.USAGE);return Math.floor(r)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="01b280e5-31b5-532d-b569-67aab828358a")}catch{}})();var hi=3e4,ye=class extends Error{status;constructor(t,r){super(t),this.name="SearchHttpError",this.status=r}};function B(e,t,r=hi){let n=e??r;if(!Number.isFinite(n)||n<=0)throw new Error(`${t} timeout must be a positive finite number`);return Math.floor(n)}function G(e,t){if(e)return e;if(typeof globalThis.fetch=="function")return globalThis.fetch.bind(globalThis);throw new Error(`${t} execution requires a fetch implementation`)}async function wi(e){try{return(await e.text()).replaceAll(/\s+/g," ").trim()}catch(t){return`(failed to read response body: ${E(t)})`}}async function Fe(e){let t=new AbortController,r=setTimeout(()=>{t.abort()},e.timeoutMs);try{let n;try{n=await e.fetcher(e.endpoint,{method:e.method,headers:e.headers,body:JSON.stringify(e.body),signal:t.signal})}catch(o){throw o instanceof Error&&o.name==="AbortError"?new Error(`${e.requestLabel} timed out after ${e.timeoutMs}ms`):new Error(`${e.requestLabel} execution failed: ${E(o)}`)}if(!n.ok){let o=await wi(n),i=o.length>0?`: ${o}`:"";throw new ye(`${e.requestLabel} failed with status ${n.status} ${n.statusText}${i}`,n.status)}try{return await n.json()}catch(o){throw new Error(`${e.responseLabel} JSON parse failed: ${E(o)}`)}}finally{clearTimeout(r)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2c36f008-53c4-5ee7-bc87-6bfb7aeb8f42")}catch{}})();function bl(e,t){let r=w(e);if(!r)return"unconfigured";let n=w(t);return n&&n.toLowerCase()===r.toLowerCase()?"configured":"auto-detected"}function bi(e){let t=de(e),r=t.toLowerCase();return r.endsWith("/embeddings")?t:r.endsWith("/v1")?`${t}/embeddings`:`${t}/v1/embeddings`}function Qr(e){let t=e.search?.embedding_model;return w(t)||null}function Ei(e){let t=w(e.providers?.openai?.base_url),r=w(e.providers?.openai?.model);if(!t||!r)return null;let n=Qr(e),o=w(e.providers?.openai?.api_key);return{name:"openai",base_url:t,model:n??r,...o?{api_key:o}:{}}}function Si(e){let t=w(e.providers?.ollama?.base_url),r=w(e.providers?.ollama?.model);if(!t||!r)return null;let n=Qr(e);return{name:"ollama",base_url:t,model:n??r}}function Jr(e){let t=(Array.isArray(e)?e:[e]).map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("Embedding input must include at least one non-empty string");return t}function Ti(e){let t=[],r=[],n=new Map;for(let o of e){let i=n.get(o);if(i===void 0){let s=t.length;t.push(o),n.set(o,s),r.push(s);continue}r.push(i)}return{uniqueInputs:t,originalToUniqueIndex:r}}function vi(e){let t=e.map((n,o)=>({embedding:n.embedding,index:n.index,position:o}));if(t.some(n=>n.index!==void 0)){for(let n of t)if(!Number.isInteger(n.index))throw new TypeError(`OpenAI embedding response entry at position ${n.position} is missing a valid integer index`);return[...t].sort((n,o)=>{let i=n.index-o.index;return i!==0?i:n.position-o.position})}return t}function Ct(e){let t=Ei(e),r=Si(e),n=[t,r].filter(a=>a!==null),o=w(e.search?.provider),i=o?o.toLowerCase():null;return{active:(i?n.find(a=>a.name===i):void 0)??n[0]??null,available:n}}function Xr(e){let t=de(e.base_url);return e.name==="openai"?{provider:"openai",endpoint:bi(t),model:e.model}:{provider:"ollama",endpoint:`${t}/api/embed`,model:e.model}}function Ii(e,t){let r=Jr(t);return e.name==="openai"?{target:Xr(e),method:"POST",headers:{"content-type":"application/json",...e.api_key?{authorization:`Bearer ${e.api_key}`}:{}},body:{model:e.model,input:r.length===1?r[0]:r}}:{target:Xr(e),method:"POST",headers:{"content-type":"application/json"},body:{model:e.model,input:r}}}function Ai(e,t){if(e.name==="openai"){let o=t.data;if(!Array.isArray(o)||o.length===0)throw new Error("OpenAI embedding response must include a non-empty data array");return vi(o).map((s,a)=>{let c=s.embedding;if(!Z(c))throw new Error(`OpenAI embedding response entry at index ${a} is missing a numeric embedding vector`);return[...c]})}let r=t.embedding;if(Z(r))return[[...r]];let n=t.embeddings;if(Array.isArray(n)&&n.length>0)return n.map((o,i)=>{if(!Z(o))throw new Error(`Ollama embedding response entry at index ${i} is missing a numeric embedding vector`);return[...o]});throw new Error("Ollama embedding response must include embedding or embeddings vectors")}async function Zr(e,t,r={}){let n=B(r.timeout_ms,"Embedding request"),o=G(r.fetcher,"Embedding request"),i=Jr(t),s=Ti(i),a=Ii(e,s.uniqueInputs),c=await Fe({endpoint:a.target.endpoint,method:a.method,headers:a.headers,body:a.body,timeoutMs:n,fetcher:o,requestLabel:"Embedding request",responseLabel:"Embedding response"}),d=Ai(e,c);if(d.length!==s.uniqueInputs.length)throw new Error(`Embedding response cardinality mismatch: expected ${s.uniqueInputs.length} vector(s), received ${d.length}`);return s.originalToUniqueIndex.map(l=>[...d[l]])}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="16c567d7-0065-5401-a768-0913cec6d5f4")}catch{}})();var Pe=["title","description","tags","status","type","priority","assignee","parent","goal","value","why_now","risk","confidence","estimated_minutes","acceptance_criteria","resolution","expected_result","actual_result","body","comments","notes","learnings","reminders","events","dependencies","plan"];function Rt(e){let t=e?.search?.corpus_fields;if(!Array.isArray(t))return[...Pe];let r=new Set(Pe),n=Array.from(new Set(t.filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>o.length>0&&r.has(o))));return n.length>0?n:[...Pe]}var Ci=8e3,Ri=3200,Y="...[semantic corpus truncated]",xi="search_embedding_corpus_max_characters_invalid:using_provider_default";function O(e){return e.map(t=>t==null?"":String(t).trim()).filter(t=>t.length>0).join(" ")}function ki(e){return(e.reminders??[]).map(t=>O([t.at,t.text]))}function Li(e){return(e.events??[]).map(t=>O([t.start_at,t.end_at,t.title,t.description,t.location,t.all_day===!0?"all day":void 0,t.timezone,t.recurrence?.freq,t.recurrence?.interval,t.recurrence?.count,t.recurrence?.until,t.recurrence?.by_weekday?.join(" "),t.recurrence?.by_month_day?.join(" "),t.recurrence?.exdates?.join(" ")]))}function Mi(e,t){e.push(t.title,t.body,t.status,t.owner,t.evidence,t.blocked_reason,t.superseded_by);for(let r of t.linked_items??[])e.push(`${r.kind} ${r.id}`,r.note);for(let r of t.files??[])e.push(r.path,r.note);for(let r of t.tests??[])e.push(r.command,r.path,r.note);for(let r of t.docs??[])e.push(r.path,r.note)}function Di(e,t){for(let r of t.plan_decisions??[])e.push(r.decision,r.rationale,r.evidence);for(let r of t.plan_discoveries??[])e.push(r.text);for(let r of t.plan_validation??[])e.push(r.text,r.command,r.expected)}function Tl(e){let t=[];t.push(e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context);for(let r of e.plan_steps??[])Mi(t,r);return Di(t,e),t.filter(r=>typeof r=="string"&&r.length>0).join(" ")}function Oi(e){let t=(e.plan_steps??[]).map(s=>O([s.order,s.id,s.title,s.body,s.status,s.owner,s.evidence,s.blocked_reason,s.superseded_by,(s.linked_items??[]).map(a=>O([a.kind,a.id,a.note])).join(" "),(s.files??[]).map(a=>O([a.path,a.note])).join(" "),(s.tests??[]).map(a=>O([a.command,a.path,a.note])).join(" "),(s.docs??[]).map(a=>O([a.path,a.note])).join(" ")])),r=(e.plan_decisions??[]).map(s=>O([s.decision,s.rationale,s.evidence,s.step_id])),n=(e.plan_discoveries??[]).map(s=>O([s.text,s.step_id])),o=(e.plan_validation??[]).map(s=>O([s.text,s.command,s.expected]));if([e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context,...t,...r,...n,...o].some(s=>s!==void 0))return{mode:e.plan_mode,scope:e.plan_scope,harness:e.plan_harness,resume_context:e.plan_resume_context,steps:t,decisions:r,discoveries:n,validation:o}}function D(e){return typeof e=="string"&&e.trim().length>0}var Ni={title:e=>e.metadata.title,description:e=>e.metadata.description,tags:e=>e.metadata.tags,status:e=>e.metadata.status,type:e=>e.metadata.type,priority:e=>typeof e.metadata.priority=="number"?e.metadata.priority:void 0,assignee:e=>D(e.metadata.assignee)?e.metadata.assignee:void 0,parent:e=>D(e.metadata.parent)?e.metadata.parent:void 0,goal:e=>D(e.metadata.goal)?e.metadata.goal:void 0,value:e=>D(e.metadata.value)?e.metadata.value:void 0,why_now:e=>D(e.metadata.why_now)?e.metadata.why_now:void 0,risk:e=>D(e.metadata.risk)?e.metadata.risk:void 0,confidence:e=>e.metadata.confidence!==void 0&&e.metadata.confidence!==null?e.metadata.confidence:void 0,estimated_minutes:e=>typeof e.metadata.estimated_minutes=="number"?e.metadata.estimated_minutes:void 0,acceptance_criteria:e=>D(e.metadata.acceptance_criteria)?e.metadata.acceptance_criteria:void 0,resolution:e=>D(e.metadata.resolution)?e.metadata.resolution:void 0,expected_result:e=>D(e.metadata.expected_result)?e.metadata.expected_result:void 0,actual_result:e=>D(e.metadata.actual_result)?e.metadata.actual_result:void 0,body:e=>e.body,comments:e=>(e.metadata.comments??[]).map(t=>t.text),notes:e=>(e.metadata.notes??[]).map(t=>t.text),learnings:e=>(e.metadata.learnings??[]).map(t=>t.text),reminders:e=>ki(e.metadata),events:e=>Li(e.metadata),dependencies:e=>(e.metadata.dependencies??[]).map(t=>({id:t.id,kind:t.kind})),plan:e=>Oi(e.metadata)};function en(e,t={}){let r=t.fields??Pe,n={};for(let o of r){let i=Ni[o];if(!i)continue;let s=i(e);s!==void 0&&(n[o]=s)}return n}function Fi(e){return e?.trim().toLowerCase()==="ollama"?Ri:Ci}function ie(e,t){let r=Fi(e),n=Er(t);return n!==null?{maxCharacters:n,warning:null}:{maxCharacters:r,warning:t==null?null:xi}}function xt(e,t={}){let r=JSON.stringify(en(e,{fields:t.fields})),n=ie(t.providerName,t.maxCharacters).maxCharacters;if(r.length<=n)return r;if(n<=Y.length)return Y.slice(0,n);let o=Math.max(0,n-Y.length);return`${r.slice(0,o)}${Y}`}(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]="dff1d04a-bad4-51d7-ab46-41e49387a44d")}catch{}})();function Pi(e,t,r){let n=e.search.embedding_batch_size,o=e.search.embedding_timeout_ms,i=e.search.scanner_max_batch_retries,s=Number.isFinite(n)&&n>0?Math.max(1,Math.floor(n)):1,a=Number.isFinite(o)&&o>0?Math.max(1,Math.floor(o)):3e4,c=Number.isFinite(i)&&i>=0?Math.floor(i):0;return{batchSize:s,timeoutMs:a,maxRetries:c,maxRequestBytes:r,maxInputCharacters:t}}function $i(e,t,r,n){let o=[],i=[],s=Buffer.byteLength(JSON.stringify({model:e.model,input:[]})),a=s;for(let c of t){let d=Buffer.byteLength(JSON.stringify(c.trim()));if(s+d>n)throw new RangeError(`Embedding input exceeds request byte ceiling ${n}; lower search.embedding_corpus_max_characters or raise maxRequestBytes`);let l=i.length>0?1:0;(i.length>=r||a+l+d>n)&&(o.push(i),i=[],a=s),a+=d+(i.length>0?1:0),i.push(c)}return o.push(i),o}function zi(e,t){if(!Number.isFinite(t)||t<=0||e.length<=t)return e;let r=Math.max(0,t-Y.length);return`${e.slice(0,r)}${Y}`.slice(0,t)}function tn(e){let t=E(e).toLowerCase();return t.includes("timed out")||t.includes("timeout")}function Ui(e,t,r,n,o,i){let s=`Embedding batch ${t} failed after ${o} attempt(s): ${E(i)}`,a=`provider=${e.name} model=${e.model} batch_size=${r} timeout_ms=${n}`;return tn(i)?`${s} (${a}; guidance=check provider availability or lower search.embedding_batch_size, raise search.embedding_timeout_ms, or run keyword search while semantic indexing catches up)`:`${s} (${a})`}function Vi(e){return e instanceof ye?e.status===413?"payload_too_large":null:tn(e)?"timeout":null}async function kt(e,t,r,n,o,i,s){let a=null;for(let c=0;c<=o;c+=1)try{s.requests+=1;let d=await Zr(e,t,{timeout_ms:n});return c>0&&i.push(`search_embedding_batch_retry_succeeded:batch=${r}:attempt=${c+1}:size=${t.length}`),s.successful_batches+=1,s.batch_size_histogram[t.length]=(s.batch_size_histogram[t.length]??0)+1,d}catch(d){a=d;let l=Vi(d);if(l!==null&&t.length>1){s.split_batches+=1;let u=Math.ceil(t.length/2),p=t.slice(0,u),_=t.slice(u);return i.push(`search_embedding_batch_split_after_${l}:batch=${r}:size=${t.length}:parts=${p.length}|${_.length}`),[...await kt(e,p,`${r}.1`,n,o,i,s),...await kt(e,_,`${r}.2`,n,o,i,s)]}if(c<o){s.retries+=1;let u=Math.min(1e3*2**c,8e3);await new Promise(p=>setTimeout(p,u))}}throw new Error(Ui(e,r,t.length,n,o+1,a))}async function Lt(e,t,r,n={}){if(r.length===0)return{vectors:[],warnings:[]};let o=performance.now(),i=n.maxRequestBytes??262144;if(!Number.isSafeInteger(i)||i<=0)throw new RangeError("maxRequestBytes must be a positive safe integer");let s={provider:e.name,model:e.model,max_request_bytes:i,limit_source:n.maxRequestBytes===void 0?"default":"caller",planned_batches:0,requests:0,successful_batches:0,split_batches:0,retries:0,batch_size_histogram:{},elapsed_ms:0,inputs_per_second:0},a=[],c=ie(e.name,t.search.embedding_corpus_max_characters);c.warning&&a.push(c.warning);let d=Pi(t,c.maxCharacters,i),l=0,u=r.map(y=>{if(y.trim().length===0)throw new TypeError("Embedding inputs must be non-empty strings");let h=zi(y,d.maxInputCharacters);return h.length<y.length&&(l+=1),h});l>0&&a.push(`search_embedding_input_truncated:count=${l}:max_characters=${d.maxInputCharacters}`);let p=$i(e,u,d.batchSize,d.maxRequestBytes);s.planned_batches=p.length;let _=[],g=0;for(let y=0;y<p.length;y+=1){let h=p[y];n.onProgress?.({batch_index:y+1,batch_total:p.length,batch_size:h.length,completed_inputs:g,total_inputs:u.length,phase:"start"}),_.push(...await kt(e,h,String(y+1),d.timeoutMs,d.maxRetries,a,s)),g+=h.length,n.onProgress?.({batch_index:y+1,batch_total:p.length,batch_size:h.length,completed_inputs:g,total_inputs:u.length,phase:"complete"})}return s.elapsed_ms=Math.max(1,performance.now()-o),s.inputs_per_second=r.length*1e3/s.elapsed_ms,{vectors:_,warnings:a,receipt:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d7a68072-168d-509a-95ec-145635d71d46")}catch{}})();var rn=[{name:"private-key",mutationRule:"private_key",regex:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/g},{name:"github-token",mutationRule:"github_token",regex:/\b(?:gh[opsru]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g},{name:"npm-token",mutationRule:"npm_token",regex:/\bnpm_[A-Za-z0-9]{20,}\b/g},{name:"aws-access-key",mutationRule:"aws_access_key",regex:/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g},{name:"google-api-key",mutationRule:"google_api_key",regex:/\bAIza[0-9A-Za-z_-]{35}\b/g},{name:"slack-token",mutationRule:"slack_token",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{name:"anthropic-api-key",mutationRule:"anthropic_api_key",regex:/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g},{name:"openai-api-key",mutationRule:"openai_api_key",regex:/\bsk-(?!ant-)[A-Za-z0-9_-]{20,}\b/g},{name:"gitlab-token",mutationRule:"gitlab_token",regex:/\bglpat-[A-Za-z0-9_.-]{20,}\b/g},{name:"jwt-like-token",mutationRule:"jwt_like_token",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g},{name:"npm-auth-token-assignment",mutationRule:"npm_auth_token_assignment",regex:/_authToken\s*=\s*\S+/g},{name:"sentry-user-token",mutationRule:"sentry_user_token",regex:/\bsntryu_[A-Za-z0-9]{20,}\b/g},{name:"sentry-org-token",mutationRule:"sentry_org_token",regex:/\bsntrys_[A-Za-z0-9_-]{20,}\b/g},{name:"private-ip",mutationRule:"private_ip",regex:/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"private-ssh-target",mutationRule:"private_ssh_target",regex:/\b(?:ssh|scp|rsync)\s+[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g},{name:"sshpass-inline-password",mutationRule:"sshpass_inline_password",regex:/\bsshpass\s+-p\s+["'][^"']{6,}["']/g},{name:"password-assignment",mutationRule:"password_assignment",regex:/\b(?:password|passphrase)\s*[:=]\s*(?:(?!<|\$\{|\$\()[A-Za-z0-9!@#$%^&*._+\-=]{8,}|"(?!<|\$\{|\$\()[^"]{8,}"|'(?!<|\$\{|\$\()[^']{8,}')/gi},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:/(?:^|[\s"'`(=])\/home\/[A-Za-z0-9._-]+\/[^\s"'`),;]+/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"user-at-private-host",mutationRule:"user_at_private_host",regex:/\b[A-Za-z0-9._-]+@(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,excludeFiles:/^(?:tests\/|examples\/)/},{name:"high-entropy-assignment",mutationRule:"high_entropy_assignment",regex:/\b(?:token|secret|password|passwd|api[_-]?key)\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{24,})/gi,mutationOnlyReason:"Generic assignments in source code are not credentials; preserve the existing mutation heuristic without treating source identifiers as secrets.",minimumEntropy:3.5}];function nn(e,t){if(e.minimumEntropy===void 0)return!0;let r=t[1],n=new Map;for(let i of r)n.set(i,(n.get(i)??0)+1);let o=0;for(let i of n.values()){let s=i/r.length;o-=s*Math.log2(s)}return o>=e.minimumEntropy}(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]="eed441f0-e2b5-51e9-b9bf-0f4882a9eeea")}catch{}})();var ji=[{action:"append",history_scope:"item"},{action:"claim",history_scope:"item"},{action:"close",history_scope:"item"},{action:"close-many",history_scope:"item"},{action:"close-task",history_scope:"item"},{action:"comments",history_scope:"conditional"},{action:"config",history_scope:"conditional"},{action:"copy",history_scope:"item"},{action:"create",history_scope:"item"},{action:"delete",history_scope:"item"},{action:"deps",history_scope:"conditional"},{action:"discover",history_scope:"item"},{action:"docs",history_scope:"conditional"},{action:"files",history_scope:"conditional"},{action:"focus",history_scope:"conditional"},{action:"gc",history_scope:"conditional"},{action:"history-compact",history_scope:"history"},{action:"history-author-acknowledge",history_scope:"workspace"},{action:"history-redact",history_scope:"history"},{action:"history-repair",history_scope:"history"},{action:"init",history_scope:"workspace"},{action:"install",history_scope:"conditional"},{action:"learnings",history_scope:"conditional"},{action:"notes",history_scope:"conditional"},{action:"package",history_scope:"conditional"},{action:"pause-task",history_scope:"item"},{action:"plan",history_scope:"conditional"},{action:"profile",history_scope:"conditional"},{action:"release",history_scope:"item"},{action:"restore",history_scope:"item"},{action:"schema",history_scope:"conditional"},{action:"start-task",history_scope:"item"},{action:"templates",history_scope:"conditional"},{action:"test",history_scope:"conditional"},{action:"test-all",history_scope:"conditional"},{action:"update",history_scope:"item"},{action:"update-many",history_scope:"item"},{action:"upgrade",history_scope:"conditional"}],Dt=new Map(ji.map(e=>[e.action,e]));function Mt(e,t="$",r=new WeakSet){return typeof e=="string"?[{path:t,value:e}]:typeof e!="object"||e===null?[]:r.has(e)?[]:(r.add(e),Array.isArray(e)?e.flatMap((n,o)=>Mt(n,`${t}[${o}]`,r)):Object.entries(e).flatMap(([n,o])=>Mt(o,`${t}.${n}`,r)))}function on(e){let t=[];for(let r of Mt(e))for(let n of rn){n.regex.lastIndex=0;for(let o of r.value.matchAll(n.regex))if(nn(n,o)){t.push({rule:n.mutationRule,path:r.path});break}}return t.filter((r,n,o)=>o.findIndex(i=>i.rule===r.rule&&i.path===r.path)===n)}function Ki(e){let t=e.author.trim()||"unknown";if(e.settings.require_attributed_author&&t.toLowerCase()==="unknown")throw new m("Mutation author is required by workspace policy.",f.USAGE,{code:"mutation_author_required",required:"Pass --author <id>, set PM_AUTHOR, or configure author_default.",nextSteps:["Retry with --author <stable-agent-id>.","Set PM_AUTHOR for this agent session."]});if(e.settings.secret_guard==="off")return{author:t,findings:[],warnings:[],override_applied:!1};let r;try{r=on(e.payload)}catch{return{author:t,findings:[],warnings:["secret_guard_scan_failed_open"],override_applied:!1}}if(r.length===0)return{author:t,findings:r,warnings:[],override_applied:!1};let n=[...new Set(r.map(o=>o.rule))].sort().join(",");if(e.settings.secret_guard==="block"&&e.force!==!0)throw new m(`Mutation blocked by secret guard (${n}). No detected value was logged.`,f.CONFLICT,{code:"mutation_secret_guard_blocked",required:"Remove the credential-shaped content or retry with --force after explicit review.",nextSteps:["Replace the value with a secret-manager reference.","Use pm history-redact if equivalent content already entered history."],recovery:{recovery_mode:"compact",attempted_command:"pm <mutation> [REDACTED]",normalized_args:["[REDACTED]"],suggested_retry:"Remove credential-shaped content, then retry the mutation."}});return{author:t,findings:r,warnings:[`secret_guard_detected:${r.length}:rules=${n}`,...e.settings.secret_guard==="block"&&e.force===!0?["secret_guard_force_override"]:[]],override_applied:e.settings.secret_guard==="block"&&e.force===!0}}function qi(e){return Dt.has(e.trim().toLowerCase())}function Hi(){return[...Dt.keys()].sort((e,t)=>e.localeCompare(t))}function Ol(e){return Dt.get(e.trim().toLowerCase())}(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]="c18e4dfc-d3e3-5185-9470-9d46b4dca893")}catch{}})();function Bi(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function Fl(e){return Bi(e).split(/[^a-z0-9]+/).filter(t=>t.length>0)}function ge(e,t){if(e.length===0&&t.length===0)return 1;if(e.length===0||t.length===0)return 0;let r=new Set(e),n=new Set(t),o=0;for(let s of r)n.has(s)&&(o+=1);let i=new Set([...r,...n]).size;return o/i}(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]="bff806e7-b1c7-5064-bdd4-6d6dd1a24100")}catch{}})();var Gi=/\b([a-z][a-z0-9]*)-(\d+)(?:-[a-z0-9]+)*\b/giu,Yi=/^(?:utf|iso|sha|tls|http|covid|match)$/iu;function $e(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function we(e){return[...new Set($e(e).match(/[\p{L}\p{N}]+/gu)??[])]}function he(e){let t=$e(e);return{normalized:t,tokens:we(t),issueCodes:[...new Set([...e.matchAll(Gi)].filter(r=>{let n=r[1],o=r.index,i=e.slice(o+r[0].length);return!Yi.test(n)&&(n===n.toUpperCase()||n.length<=2||o===0&&/^\s*(?::|—|–|\])/u.test(i))}).map(r=>r[0].toLowerCase()))]}}function ze(e,t){return Ue(he(e),he(t))}function Ue(e,t){if(e.normalized===t.normalized)return{score:1,reason:"exact_title"};let r=new Set(e.issueCodes);return t.issueCodes.some(n=>r.has(n))?{score:.99,reason:"issue_code"}:{score:ge(e.tokens,t.tokens),reason:"title_token_jaccard"}}import Wi 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]="cdae67c6-8316-5e97-84ca-0be4460ffd57")}catch{}})();function Ve(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function Xi(e,t){return[e.updated_at,t].map(n=>({value:n,time:Date.parse(n??"")})).filter(n=>typeof n.value=="string"&&Number.isFinite(n.time)).sort((n,o)=>o.time-n.time)[0]?.value??e.updated_at}function sn(e,t){let r=Math.max(1,Math.trunc(t.threshold_hours)),n=(t.now??new Date).getTime(),o=Ve(t.in_progress_status),i=[];for(let s of e){if(Ve(String(s.status))!==o||(s.assignee?.trim().length??0)>0)continue;let a=Xi(s,t.last_history_activity?.(s)),c=Date.parse(a);if(!Number.isFinite(c))continue;let d=Math.max(0,Math.floor((n-c)/36e5));d>=r&&i.push({id:s.id,last_activity_at:a,age_hours:d})}return i.sort((s,a)=>a.age_hours-s.age_hours||s.id.localeCompare(a.id)),{threshold_hours:r,count:i.length,items:i,remediation:"Claim active work with `pm claim <id>` or return abandoned work to open with `pm update <id> --status open`."}}async function Qi(e,t,r){let n=new Map;return await Promise.all(t.filter(o=>Ve(String(o.status))===Ve(r.in_progress_status)&&(o.assignee?.trim().length??0)===0).map(async o=>{let i;try{i=await me(Wi.join(e,"history",`${o.id}.jsonl`),o.id)}catch{return}let s=i.map(a=>a.ts).filter(a=>Number.isFinite(Date.parse(a))).sort((a,c)=>Date.parse(c)-Date.parse(a))[0];s&&n.set(o.id,s)})),sn(t,{...r,last_history_activity:o=>n.get(o.id)})}(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]="09f9d531-8ebf-51bf-9ee6-5a3351d96c7a")}catch{}})();var Ji=new Set(["rename-type","rename-field","remap-status",...Ir]);function Zi(e,t){if(t&&!Ji.has(e))throw new m(`schema ${e} does not support --dry-run. Preview is supported for rename-type, rename-field, remap-status and workflow-policy actions. Remove --dry-run only when you intend to apply changes.`,f.USAGE,{code:"invalid_argument_value",examples:["pm schema rename-type Spike --to Experiment --dry-run"]})}import{readFile as es}from"node:fs/promises";import an 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]="93b04081-a71a-5987-8fb6-09a8d045c1da")}catch{}})();function ts(e){let t=e.trim();if(!t)throw new m("--rollback requires a non-empty checkpoint ID",f.USAGE);if(!/^[a-zA-Z0-9._-]+$/.test(t))throw new m("--rollback checkpoint ID must match [a-zA-Z0-9._-]+",f.USAGE);return t}function rs(e,t){let r=t.replace(/[-:.TZ]/g,"").slice(0,14),n=Math.random().toString(36).slice(2,8);return`${e}-${r}-${n}`}function ns(e,t){return an.join(e,"checkpoints",t)}function cn(e,t,r){return an.join(ns(e,t),`${r}.json`)}async function os(e,t,r,n){let o=cn(e,t,r),i=`${JSON.stringify(n,null,2)}
2
2
  `;if(!await vr(o,i)&&await S(o)!==i)throw new m(`Checkpoint ${r} already exists with different contents; use a new checkpoint ID.`,f.CONFLICT);return o}function is(e,t){if(!Array.isArray(e.items))throw new m(`Checkpoint ${t} is missing items`,f.GENERIC_FAILURE);return e.items.map(r=>{if(!r||typeof r!="object")throw new m(`Checkpoint ${t} contains an invalid item entry`,f.GENERIC_FAILURE);let n=r;if(typeof n.id!="string"||n.id.trim().length===0)throw new m(`Checkpoint ${t} contains an item entry without ID`,f.GENERIC_FAILURE);if(typeof n.target_updated_at!="string"||n.target_updated_at.trim().length===0)throw new m(`Checkpoint ${t} contains an item entry without target_updated_at`,f.GENERIC_FAILURE);return{id:n.id.trim(),target_updated_at:n.target_updated_at.trim()}})}async function ss(e,t,r,n){let o=ts(r),i=cn(e,t,o);if(!await V(i))throw new m(`Checkpoint ${o} not found`,f.NOT_FOUND);let s=await es(i,"utf8"),a;try{a=JSON.parse(s)}catch(l){throw new m(`Checkpoint ${o} contains invalid JSON: ${E(l)}`,f.GENERIC_FAILURE)}if(!a||typeof a!="object")throw new m(`Checkpoint ${o} is invalid`,f.GENERIC_FAILURE);let c=a;if(c.schema_version!==n)throw new m(`Checkpoint ${o} has unsupported schema version`,f.GENERIC_FAILURE);let d=is(c,o);return{record:c,items:d,path:i,id:typeof c.id=="string"?c.id:o,created_at:typeof c.created_at=="string"?c.created_at:M(),author:typeof c.author=="string"?c.author:"unknown"}}async function as(e,t){let r=[],n=[];for(let o of e)try{let i=await t(o.id,o.target_updated_at);r.push({id:o.id,status:"restored",changed_fields:i.changed_fields,warnings:i.warnings}),n.push(o.id)}catch(i){r.push({id:o.id,status:"failed",error:E(i)})}return{rows:r,restored_ids:n,failed_count:r.filter(o=>o.status==="failed").length}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fdacd8ac-787a-5639-84d5-a32b6ce79d41")}catch{}})();function j(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t.length>0?t:null}function nu(e,t){let r=j(t);return!e||!r?null:[...e.assurance_providers??[]].reverse().find(n=>j(n.definition.id)===r)??null}function cs(e,t){let r=j(t);return!e||!r?null:[...e.search_providers].reverse().find(o=>(j(o.runtime_definition?.name)??j(o.definition?.name))===r)??null}function ds(e,t){let r=j(t);return!e||!r?null:[...e.vector_store_adapters].reverse().find(o=>(j(o.runtime_definition?.name)??j(o.definition?.name))===r)??null}(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]="74ce3524-6c25-5646-b1a0-5ca8a3759034")}catch{}})();var $="-",ln=new Set(["actual_result","body","cmd","command","customer_impact","description","environment","expected_result","impact","location","message","note","outcome","repro_steps","resolution","text","title","unblock_note","value","why_now"]);function au(e,t){if(e.startsWith("```")||e.includes(`
3
3
  `))return!0;let r=t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");return new RegExp(`^(?:[-*+]\\s+)?(?:${r})\\s*[:=]`,"i").test(e)}function un(e){let t=e.trim();if(t==="")return[];let n=(ps(t)??t.split(",")).map(o=>o.trim()).filter(Boolean).map(o=>o.toLowerCase());return Array.from(new Set(n)).sort((o,i)=>o.localeCompare(i))}function fn(e){if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let r of e)if(typeof r=="string")for(let n of un(r))t.push(n);return Array.from(new Set(t)).sort((r,n)=>r.localeCompare(n))}function mn(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").map(t=>t.trim().toLowerCase()).filter(Boolean):[]}function ls(e){return typeof e!="string"?[]:e.split(";").map(t=>t.trim()).filter(Boolean)}function us(e,t,r){let n=e.map(s=>s.trim()).filter(Boolean);for(let s of t??[]){let a=s.trim();if(a.includes(";"))throw new m('Acceptance criteria added with --add-ac cannot contain ";" because semicolons delimit stored criteria',f.USAGE,{code:"acceptance_criteria_semicolon_forbidden",required:"Pass one semicolon-free criterion per --add-ac value",why:"A semicolon inside one criterion would be re-read as multiple criteria",nextSteps:["Split the text into repeated --add-ac values, or replace the semicolon with punctuation that is not the storage delimiter"]});a.length>0&&!n.includes(a)&&n.push(a)}let o=[],i=n;for(let s of r??[]){let a=s.trim();if(a.length!==0){if(!i.includes(a)){o.push(a);continue}i=i.filter(c=>c!==a)}}return{criteria:i,unmatchedRemovals:o}}function fs(e,t){let r=mn(e);if(!t||t.length===0)return Array.from(new Set(r)).sort((o,i)=>o.localeCompare(i));let n=new Set(r);for(let o of fn(t))n.add(o);return Array.from(n).sort((o,i)=>o.localeCompare(i))}function ms(e,t){let r=Array.from(new Set(mn(e))).sort((o,i)=>o.localeCompare(i));if(!t||t.length===0)return r;let n=new Set(fn(t));return n.size===0?r:r.filter(o=>!n.has(o))}function ps(e){if(!e.startsWith("["))return null;let t;try{t=JSON.parse(e)}catch{return null}return t.map(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean"?String(n):"").filter(n=>n.length>0)}function Ot(e){return e.replace(/\r\n/g,`
4
4
  `)}function pn(e){let t=Ot(e).trim();if(!t.startsWith("```"))return e;let r=t.split(`
@@ -17,4 +17,4 @@ ${i}`;continue}return null}return r}function ws(e,t){let r=pn(e).trim();if(!r)th
17
17
  `)){let n=r.trim();if(n.length!==0)try{let o=JSON.parse(n);o&&typeof o=="object"&&typeof o.endpoint=="string"&&o.endpoint.trim().length>0&&"payload"in o&&typeof o.attempts=="number"&&Number.isFinite(o.attempts)&&((typeof o.id!="string"||o.id.length===0)&&(o.id=Wc(o)),t.push(o))}catch{}}return t}function Xc(e,t){if(typeof e.enqueued_at!="string"||e.enqueued_at.trim().length===0)return!1;let r=Date.parse(e.enqueued_at);return Number.isNaN(r)?!1:r<t}function yo(e,t){let r=uo(t),n=[],o=0;for(let i of e){if(JSON.stringify(i).length>Yn||Xc(i,r)||i.attempts>=Wn){o+=1;continue}n.push(i)}if(n.length>jn){let i=n.length-jn;return o+=i,{entries:n.slice(i),prunedCount:o}}return{entries:n,prunedCount:o}}async function Qc(e,t){let r=t.map(o=>JSON.stringify(o)).join(`
18
18
  `),n=r.length>0?`${r}
19
19
  `:"";for(let o=0;;o+=1)try{await I(ir(e),n);return}catch(i){let s=Xn[o];if(s===void 0||!mo(i))throw i;await po(s)}}async function Bn(e,t,r,n){return Ie(async()=>{let o=await S(ir(e)),i=o===null?[]:_o(o),s=[];for(let c of i){if(r.has(c.id))continue;let d=n.get(c.id);s.push(d?{...c,attempts:d.attempts,next_attempt_after:d.next_attempt_after}:c)}let{entries:a}=yo(s,t);return await Qc(e,a),a.length},e)}async function Jc(e,t){let r=await S(ir(e));if(r===null||r.trim().length===0){await F(e,{pending_otel_spans:0});return}let n=_o(r),{entries:o,prunedCount:i}=yo(n,t),s=o.filter(g=>lo(g.next_attempt_after)).slice(0,Ec);if(s.length===0){let g=i>0?await Bn(e,t,new Set,new Map):o.length;await F(e,{pending_otel_spans:g});return}let a=M(),c=new Set,d=new Map,l=0,u;await Promise.all(s.map(async g=>{try{let y=await so(g.endpoint,{"content-type":"application/json"},JSON.stringify(g.payload));if(y<200||y>=300)throw new Error(`local_otel_export_http_${y}`);c.add(g.id),l+=1}catch(y){u=y instanceof Error?rr(y.message,"redacted"):"local_otel_export_failed";let h=g.attempts+1;d.set(g.id,{attempts:h,next_attempt_after:co(h)})}}));let p=await Bn(e,t,c,d),_={pending_otel_spans:p,last_otel_attempt_at:a};l>0&&(_.last_otel_success_at=a),u!==void 0?(_.last_otel_failure_at=a,_.last_otel_failure_error=u):p===0&&(_.last_otel_failure_at=void 0,_.last_otel_failure_error=void 0),await F(e,_)}async function Zc(e,t,r){try{await rd(e,t,r)}catch{}try{await Jc(e,r)}catch{}}async function ed(e,t=xc){try{let r=$c(e),n=await _c(r,{withFileTypes:!0}),o=Date.now()-Math.max(0,t);await Promise.all(n.filter(i=>i.isFile()&&/^\.events\.jsonl\.\d+\.\d+\.[a-f0-9]+\.tmp$/.test(i.name)).map(async i=>{let s=k.join(r,i.name);(await Gn(s)).mtimeMs<o&&await or(s,{force:!0})}))}catch{}}async function Ie(e,t=xe(process.cwd()),r=5e3){let n=qn.catch(()=>{}).then(()=>Ar(async()=>{let o=await Me(t,"telemetry-queue",60,"telemetry",!1,!1,r);try{return $r(t),await e()}finally{await o()}}));return qn=n.catch(()=>{}),n}async function ar(e){let t=await S(rt(e));return t===null||t.trim().length===0?[]:ao(t)}async function tr(e,t,r){return Ie(async()=>{let n=await ar(e),{entries:o}=sr(n,r),i=o.filter(s=>!t.has(s.event.event_id));return await fo(e,i),i},e)}async function td(e,t,r,n){return Ie(async()=>{let o=await ar(e),{entries:i}=sr(o,n),s=i.map(a=>{if(!t.has(a.event.event_id))return a;let c=a.attempts+1;return{...a,attempts:c,last_attempt_at:r,next_attempt_after:co(c)}});return await fo(e,s),s},e)}async function rd(e,t,r){await ed(e);let n=t.trim();if(n.length===0)return;let o=await S(rt(e));if(o===null||o.trim().length===0){await F(e,{endpoint:n,queue_entries:0});return}let i=ao(o);if(i.length===0){await F(e,{endpoint:n,queue_entries:0});return}let{entries:s,prunedCount:a}=sr(i,r);if(s.length===0){let _=await tr(e,new Set,r);await F(e,{endpoint:n,queue_entries:_.length});return}let c=s.filter(_=>Gc(_)).slice(0,Tc);if(c.length===0){let _=a>0?await tr(e,new Set,r):s;await F(e,{endpoint:n,queue_entries:_.length});return}let d=new Set(c.map(_=>_.event.event_id)),l=M(),u={"content-type":"application/json"},p=process.env.PM_TELEMETRY_INGEST_KEY?.trim();p&&(u["x-pm-telemetry-key"]=p);try{let _=await so(n,u,JSON.stringify({schema_version:Sc,events:c.map(g=>g.event)}));if(_<200||_>=300)throw new Error(`telemetry_flush_http_${_}`)}catch(_){let g=await td(e,d,l,r),y=_ instanceof Error?rr(_.message,"redacted"):"telemetry_flush_failed";await F(e,{endpoint:n,queue_entries:g.length,last_attempted_flush_at:l,last_failed_flush_at:l,last_failed_flush_error:y});return}try{let _=await tr(e,d,r);await F(e,{endpoint:n,queue_entries:_.length,last_attempted_flush_at:l,last_successful_flush_at:l,last_failed_flush_at:void 0,last_failed_flush_error:void 0})}catch(_){let g=_ instanceof Error?rr(_.message,"redacted"):"telemetry_flush_failed",y=await ar(e).catch(()=>s);await F(e,{endpoint:n,queue_entries:y.length,last_attempted_flush_at:l,last_failed_flush_at:l,last_failed_flush_error:g})}}async function nd(e){let t=Zn(e);await er(k.dirname(t),{recursive:!0});try{return await er(t),!0}catch(r){if(typeof r!="object"||r===null||!("code"in r)||r.code!=="EEXIST")throw r}try{let r=await Gn(t);return Date.now()-r.mtimeMs<kc?!1:(await or(t,{recursive:!0,force:!0}),await er(t),!0)}catch{return!1}}function od(e){try{pc(e,{recursive:!0,force:!0})}catch{}}function id(e){od(zc(e))}async function sd(e,t,r){let n=await nd(e);if(id(e),!!n)try{await Zc(e,t,r)}finally{try{await or(Zn(e),{recursive:!0,force:!0})}catch{}}}async function Gm(e=xe(process.cwd())){if(!ve().telemetry_disabled)try{if(!(await v(e)).telemetry.enabled)return;let r=await Ie(()=>Bc(e),e);if(!r)return;await sd(e,r.endpoint,r.retentionDays)}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]="7b64ac69-240e-504c-adc4-d5f3170d3de7")}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]="fdc16f69-f63f-5e17-9139-35d54db7bab5")}catch{}})();function nt(e,t="--limit"){if(e===void 0)return;let r=String(e).trim(),n=r.length===0?Number.NaN:Number(r);if(!Number.isInteger(n)||n<0)throw new m(`${t} must be a non-negative integer`,f.USAGE);return n}function go(e,t="--priority"){if(e===void 0)return;let r=String(e).trim(),n=r.length===0?Number.NaN:Number(r);if(!Number.isInteger(n)||n<0||n>4)throw new m(`${t} filter must be 0..4`,f.USAGE);return n}function eh(e,t,r="--type"){if(e===void 0)return;let n=le(e,t);if(!n)throw new m(`${r} filter must be one of ${t.types.join("|")}`,f.USAGE);return n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b03f0596-8c1f-59ec-a20e-8919cf8bbb98")}catch{}})();function cr(e,t){if(e===void 0)return;let r=[],n="";for(let s=0;s<e.length;s+=1){let a=e[s];if(a==="\\"){let c=e[s+1];if(c===","||c==="\\"){n+=c,s+=1;continue}n+=a;continue}if(a===","){r.push(n),n="";continue}n+=a}r.push(n);let o=r.map(s=>s.trim());if(o.some(s=>s.length===0))throw new m(`${t.label} requires at least one non-empty value`,f.USAGE);let i=o.map(s=>t.normalize?.(s)??s);return[...new Set(i)]}function Ae(e,t){let r=cr(e,t);return r===void 0?void 0:new Set(r)}function ho(e,t,r="--type"){let n=cr(e,{label:r});if(n===void 0)return;let o=n.map(i=>{let s=le(i,t);if(!s)throw new m(`${r} filter token "${i}" must be one of ${t.types.join("|")}`,f.USAGE);return s});return new Set(o)}function wo(e,t="--priority"){let r=cr(e,{label:t});if(r!==void 0)return new Set(r.map(n=>go(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]="81a10252-4fa3-5c14-878d-7d78717419a4")}catch{}})();function bo(e,t){let r=e.trim().toLowerCase();return t.alias_to_id.get(r)??r}function vo(e){return{isTerminal(t){return e.terminal_statuses.has(bo(t,e))},classify(t){let r=bo(t,e);return e.terminal_canceled_statuses.has(r)?"canceled":e.terminal_statuses.has(r)?"closed":e.blocked_statuses.has(r)?"blocked":e.draft_statuses.has(r)?"draft":r===e.open_status?"open":e.active_statuses.has(r)?"in_progress":"other"}}}function dr(e){return T(e.acceptance_criteria)===void 0}function lr(e){return!Number.isFinite(e.estimated_minutes)}function Io(e,t){return t.isTerminal(e.status)?T(e.resolution)===void 0:!1}function cd(e){return T(e.reviewer)===void 0}function dd(e){return T(e.risk)===void 0}function ld(e){return typeof e.confidence=="number"?!Number.isFinite(e.confidence):T(e.confidence)===void 0}function ud(e){return T(e.sprint)===void 0}function fd(e){return T(e.release)===void 0}function ur(e){return!!(e.acMissing||e.estimatesMissing||e.resolutionMissing||e.reviewerMissing||e.riskMissing||e.confidenceMissing||e.sprintMissing||e.releaseMissing||e.metadataMissing)}function md(e,t,r){return[[t.acMissing,dr(e)],[t.estimatesMissing,lr(e)],[t.resolutionMissing,Io(e,r)],[t.reviewerMissing,cd(e)],[t.riskMissing,dd(e)],[t.confidenceMissing,ld(e)],[t.sprintMissing,ud(e)],[t.releaseMissing,fd(e)]].every(([o,i])=>o!==!0||i)}function pd(e,t){return dr(e)||lr(e)||Io(e,t)}function Ao(e,t,r){return ur(t)?!(!md(e,t,r)||t.metadataMissing&&!pd(e,r)):!0}var fr=["acceptance_criteria","estimated_minutes","resolution","tags","parent"];function _d(e,t){switch(t){case"acceptance_criteria":return!dr(e);case"estimated_minutes":return!lr(e);case"resolution":return T(e.resolution)!==void 0;case"tags":return Array.isArray(e.tags)&&e.tags.length>0;default:return T(e.parent)!==void 0}}function yd(e,t,r){return t==="resolution"?r.isTerminal(e.status):!0}function gd(e,t){return t===0?100:Math.round(e/t*1e3)/10}function Eo(){let e={};for(let t of fr)e[t]={present:0,applicable:0,percent:100};return e}function So(e,t,r){for(let n of fr){if(!yd(t,n,r))continue;let o=e[n];o.applicable+=1,_d(t,n)&&(o.present+=1)}}function To(e){for(let t of fr){let r=e[t];r.percent=gd(r.present,r.applicable)}}function ch(e,t){let r=Eo(),n={};for(let o of e){So(r,o,t);let i=n[o.type]??(n[o.type]=Eo());So(i,o,t)}To(r);for(let o of Object.values(n))To(o);return{overall:r,by_type:n}}var hd={assignee:"(unassigned)",priority:"(no priority)",tag:"(untagged)",parent:"(unparented)",type:"(untyped)",status:"(no status)"};function wd(e){return hd[e]}function bd(){return{open:0,in_progress:0,blocked:0,draft:0,closed:0,canceled:0,other:0}}function Ed(e,t,r){switch(t){case"assignee":return[T(e.assignee)??null];case"parent":return[T(e.parent)??null];case"type":return[T(e.type)??null];case"status":return[T(e.status)??null];case"priority":return[typeof e.priority=="number"?`P${e.priority}`:null];default:{let n=r.tagPrefix?.trim(),i=(Array.isArray(e.tags)?e.tags:[]).filter(s=>typeof s=="string"&&s.length>0&&(!n||s.startsWith(n)));return i.length>0?i:[null]}}}function dh(e,t,r,n={}){let o=new Map,i=0;for(let a of e){i+=1;let c=r.classify(a.status);for(let d of Ed(a,t,n)){let l=d??"\0empty",u=o.get(l);u||(u={label:d??wd(t),key:d,buckets:bd(),total:0},o.set(l,u)),u.buckets[c]+=1,u.total+=1}}let s=[...o.values()].sort((a,c)=>c.total!==a.total?c.total-a.total:a.key===null?1:c.key===null?-1:a.label.localeCompare(c.label));return{dimension:t,rows:s,total_items:i}}(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]="2e200f74-0e6c-58ac-ab8c-da49071465ff")}catch{}})();var ae=["notes","learnings","files","docs","tests","comments","deps","body","linked_command"];function Q(e){return Array.isArray(e)&&e.length>0}function Sd(e){return typeof e=="string"&&e.trim().length>0}function Td(e){return Array.isArray(e)?e.some(t=>{if(typeof t!="object"||t===null)return!1;let r=t.command;return typeof r=="string"&&r.trim().length>0}):!1}function Ro(e,t){switch(t){case"notes":return Q(e.notes);case"learnings":return Q(e.learnings);case"files":return Q(e.files);case"docs":return Q(e.docs);case"tests":return Q(e.tests);case"comments":return Q(e.comments);case"deps":return Q(e.dependencies);case"body":return Sd(e.body);case"linked_command":return Td(e.tests)}}function xo(e){return ae.some(t=>e[t]!==void 0)}function ko(e,t){for(let r of ae){let n=t[r];if(n===void 0)continue;let o=Ro(e,r);if(n==="present"&&!o||n==="absent"&&o)return!1}return!0}function Lo(e){return ae.some(t=>t!=="body"&&e[t]!==void 0)}function Mo(e){return e.body!==void 0}function Co(e,t){return t===0?100:Math.round(e/t*1e3)/10}function vd(){let e={};for(let t of ae)e[t]={present:0,total:0,percent:100};return e}function uh(e){let t=vd(),r=e.length;for(let s of e)for(let a of ae)Ro(s,a)&&(t[a].present+=1);for(let s of ae)t[s].total=r,t[s].percent=Co(t[s].present,r);let n=t.body,o=r-n.present,i={present:o,total:r,percent:Co(o,r)};return{total_items:r,fields:t,body_populated:n,empty_body:i}}(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]="9957767d-cc97-58ad-a46e-3f88a18a3c8c")}catch{}})();var $o=e=>({acMissing:e.filterAcMissing===!0,estimatesMissing:e.filterEstimatesMissing===!0,resolutionMissing:e.filterResolutionMissing===!0,metadataMissing:e.filterMetadataMissing===!0,reviewerMissing:e.filterReviewerMissing===!0,riskMissing:e.filterRiskMissing===!0,confidenceMissing:e.filterConfidenceMissing===!0,sprintMissing:e.filterSprintMissing===!0,releaseMissing:e.filterReleaseMissing===!0}),Do=[{field:"notes",presentKey:"hasNotes",absentKey:"noNotes",presentFlag:"--has-notes",absentFlag:"--no-notes"},{field:"learnings",presentKey:"hasLearnings",absentKey:"noLearnings",presentFlag:"--has-learnings",absentFlag:"--no-learnings"},{field:"files",presentKey:"hasFiles",absentKey:"noFiles",presentFlag:"--has-files",absentFlag:"--no-files"},{field:"docs",presentKey:"hasDocs",absentKey:"noDocs",presentFlag:"--has-docs",absentFlag:"--no-docs"},{field:"tests",presentKey:"hasTests",absentKey:"noTests",presentFlag:"--has-tests",absentFlag:"--no-tests"},{field:"comments",presentKey:"hasComments",absentKey:"noComments",presentFlag:"--has-comments",absentFlag:"--no-comments"},{field:"deps",presentKey:"hasDeps",absentKey:"noDeps",presentFlag:"--has-deps",absentFlag:"--no-deps"},{field:"body",presentKey:"hasBody",absentKey:"emptyBody",presentFlag:"--has-body",absentFlag:"--empty-body"},{field:"linked_command",presentKey:"hasLinkedCommand",absentKey:"noLinkedCommand",presentFlag:"--has-linked-command",absentFlag:"--no-linked-command"}],pr=e=>{let t=Do.find(r=>e[r.presentKey]===!0&&e[r.absentKey]===!0);if(t)throw new m(`Cannot combine ${t.presentFlag} with ${t.absentFlag} for the same field.`,f.USAGE);return Object.fromEntries(Do.flatMap(r=>e[r.presentKey]===!0?[[r.field,"present"]]:e[r.absentKey]===!0?[[r.field,"absent"]]:[]))},Oo=["priority","deadline","updated_at","created_at","title","parent"],No=["asc","desc"],zo=new Set(Kr);function Id(e,t,r){let n=e.filter(s=>s.startsWith("item_list_item_read_failed:")).length,o=e.filter(s=>s.startsWith("item_list_directory_read_failed:")).length,i={status:t?"unchecked":n+o>0?"partial":"complete",unreadable_item_count:n,unreadable_directory_count:o};if(r&&i.status==="partial")throw new m(`List source is incomplete: ${n} item document(s) and ${o} item directory/directories could not be read.`,f.GENERIC_FAILURE,{code:"list_source_incomplete",why:"Strict list reads fail closed so agents and SDK consumers never treat an omitted item as a complete workspace.",nextSteps:["Run pm validate --check-storage-integrity to locate unreadable tracker artifacts.","Repair the reported files or align the installed decoder version, then retry."]});return i}function Ad(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length>0}var Cd=[{key:"hasNotes",summaryKey:"has_notes"},{key:"hasLearnings",summaryKey:"has_learnings"},{key:"hasFiles",summaryKey:"has_files"},{key:"hasDocs",summaryKey:"has_docs"},{key:"hasTests",summaryKey:"has_tests"},{key:"hasComments",summaryKey:"has_comments"},{key:"hasDeps",summaryKey:"has_deps"},{key:"hasBody",summaryKey:"has_body"},{key:"hasLinkedCommand",summaryKey:"has_linked_command"},{key:"noNotes",summaryKey:"no_notes"},{key:"noLearnings",summaryKey:"no_learnings"},{key:"noFiles",summaryKey:"no_files"},{key:"noDocs",summaryKey:"no_docs"},{key:"noTests",summaryKey:"no_tests"},{key:"noComments",summaryKey:"no_comments"},{key:"noDeps",summaryKey:"no_deps"},{key:"emptyBody",summaryKey:"empty_body"},{key:"noLinkedCommand",summaryKey:"no_linked_command"}],Rd=[{key:"filterReviewerMissing",summaryKey:"filter_reviewer_missing"},{key:"filterRiskMissing",summaryKey:"filter_risk_missing"},{key:"filterConfidenceMissing",summaryKey:"filter_confidence_missing"},{key:"filterSprintMissing",summaryKey:"filter_sprint_missing"},{key:"filterReleaseMissing",summaryKey:"filter_release_missing"}];function Uo(e,t){for(let r of Cd)t[r.key]===!0&&(e[r.summaryKey]=!0)}function Vo(e,t){for(let r of Rd)t[r.key]===!0&&(e[r.summaryKey]=!0)}function xd(e,t,r){for(let n of r){let o=t[n.optionKey];o!==void 0&&(e[n.summaryKey]=n.normalize?n.normalize(o):o)}}function jo(e){let t={};return Uo(t,e),t}function Ko(e){let t={};return Vo(t,e),t}var kd=[{optionKey:"type",summaryKey:"type"},{optionKey:"tag",summaryKey:"tag"},{optionKey:"priority",summaryKey:"priority"},{optionKey:"deadlineBefore",summaryKey:"deadline_before"},{optionKey:"deadlineAfter",summaryKey:"deadline_after"},{optionKey:"updatedAfter",summaryKey:"updated_after"},{optionKey:"updatedBefore",summaryKey:"updated_before"},{optionKey:"createdAfter",summaryKey:"created_after"},{optionKey:"createdBefore",summaryKey:"created_before"},{optionKey:"ids",summaryKey:"ids"},{optionKey:"assignee",summaryKey:"assignee"},{optionKey:"assigneeFilter",summaryKey:"assignee_filter"},{optionKey:"parent",summaryKey:"parent"},{optionKey:"sprint",summaryKey:"sprint"},{optionKey:"release",summaryKey:"release"}],Ld=[{optionKey:"type",summaryKey:"type"},{optionKey:"tag",summaryKey:"tag"},{optionKey:"priority",summaryKey:"priority"},{optionKey:"deadlineBefore",summaryKey:"deadline_before"},{optionKey:"deadlineAfter",summaryKey:"deadline_after"},{optionKey:"updatedAfter",summaryKey:"updated_after"},{optionKey:"updatedBefore",summaryKey:"updated_before"},{optionKey:"createdAfter",summaryKey:"created_after"},{optionKey:"createdBefore",summaryKey:"created_before"},{optionKey:"ids",summaryKey:"ids"},{optionKey:"assignee",summaryKey:"assignee"},{optionKey:"assigneeFilter",summaryKey:"assignee_filter"},{optionKey:"parent",summaryKey:"parent"},{optionKey:"sprint",summaryKey:"sprint"},{optionKey:"release",summaryKey:"release"},{optionKey:"limit",summaryKey:"limit"},{optionKey:"offset",summaryKey:"offset"},{optionKey:"includeBody",summaryKey:"include_body"},{optionKey:"compact",summaryKey:"compact"},{optionKey:"fields",summaryKey:"fields"}],Md=[{key:"filterAcMissing",summaryKey:"filter_ac_missing"},{key:"filterEstimatesMissing",summaryKey:"filter_estimates_missing"},{key:"filterResolutionMissing",summaryKey:"filter_resolution_missing"},{key:"filterMetadataMissing",summaryKey:"filter_metadata_missing"}],Dd="-7d";function qo(e){let{filtersStatus:t,options:r,treeEnabled:n,treeDepth:o,sortField:i,sortOrder:s,runtimeFieldFilters:a}=e,c={};return t!==null&&(c.status=t),r.dependencyBlocked===!0&&(c.blocked_semantics="status_or_dependency"),xd(c,r,kd),Bo(c,r),r.filterAcMissing===!0&&(c.filter_ac_missing=!0),r.filterEstimatesMissing===!0&&(c.filter_estimates_missing=!0),r.filterResolutionMissing===!0&&(c.filter_resolution_missing=!0),r.filterMetadataMissing===!0&&(c.filter_metadata_missing=!0),Vo(c,r),Uo(c,r),r.limit!==void 0&&(c.limit=r.limit),r.offset!==void 0&&(c.offset=r.offset),r.includeBody===!0&&(c.include_body=!0),r.fields!==void 0&&(c.fields=r.fields),n&&(c.tree=!0,o!==void 0&&(c.tree_depth=o)),i!==void 0&&(c.sort=i,c.order=s),Ad(a)&&(c.runtime_filters=a),c}function _r(e,t,r){let n=H(e.status,r),o=H(t.status,r);if(n!==o)return n?1:-1;let i=e.priority-t.priority;if(i!==0)return i;let s=te(t.updated_at,e.updated_at);return s!==0?s:(e.id??"").localeCompare(t.id??"")}function Od(e,t){return[...e].sort((r,n)=>_r(r,n,t))}function Fo(e,t){if(e!==void 0)return Le(e,new Date,t)}function Ce(e,t){if(e==null)return;let r=String(e).trim();if(r.length!==0)return Le(r,new Date,t)}function Ho(e){let t=e.updatedAfter!=null&&String(e.updatedAfter).trim().length>0;if([e.today===!0,e.recent===!0,t].filter(n=>n).length>1)throw new m("Choose only one updated_at window: --today, --recent, or --updated-after.",f.USAGE);if(e.today===!0){let n=new Date;return n.setHours(0,0,0,0),n.toISOString()}return e.recent===!0?Ce(Dd,"recent"):Ce(e.updatedAfter,"updated-after")}function Bo(e,t){t.today===!0&&(e.today=!0),t.recent===!0&&(e.recent=!0)}function Go(e){if(e==null)return;let t=String(e).trim();if(t.length===0)throw new m("--ids requires at least one non-empty item ID",f.USAGE);let r=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);if(r.length===0)throw new m("--ids requires at least one non-empty item ID",f.USAGE);return new Set(r)}function yr(e){if(e===void 0)return;let t=String(e).trim(),r=t.length===0?Number.NaN:Number(t);if(!Number.isInteger(r)||r<0)throw new m("Offset filter must be a non-negative integer",f.USAGE);return r}function Yo(e){if(e===void 0)return;let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new m("List --fields requires a comma-separated list of field names",f.USAGE);return[...new Set(t)]}function Wo(e,t=e.projectionCommand??"list"){let r=e.compact===!0,n=e.brief===!0,o=e.full===!0,i=Yo(e.fields);if(Number(r)+Number(n)+Number(o)+ +(i!==void 0)>1)throw new m("List projection options are mutually exclusive. Use one of --compact, --brief, --full, or --fields.",f.USAGE,{code:"projection_options_mutually_exclusive",recovery:{suggested_retry:`pm ${t} --brief`,suggested_retry_args:[t,"--brief"]}});return o?{mode:"full",fields:[]}:n?{mode:"brief",fields:[..._t]}:r?{mode:"compact",fields:[...pt]}:i?{mode:"fields",fields:[...new Set(i.map(a=>K(a)))]}:{mode:"full",fields:[]}}function K(e){return e.startsWith("item.")?e.slice(5):e}function Nd(e,t,r){if(e.mode!=="fields")return;let n=yt(t),o=new Set(n.map(s=>K(s))),i=e.fields.filter(s=>!o.has(K(s)));if(i.length>0)throw new m(`Unknown list --fields value(s): ${i.join(", ")}`,f.USAGE,{code:"unknown_field_projection",examples:["pm list-open --fields id,title,status,type,updated_at","pm list --fields id,title,parent,priority --limit 10","pm list-all --fields id,title,body --limit 5"],recovery:{allowed_values:n,suggested_retry:`pm ${r} --fields id,title,status --limit 10`,suggested_retry_args:[r,"--fields","id,title,status","--limit","10"]}})}var Fd=new Map([["updated","updated_at"],["update","updated_at"],["modified","updated_at"],["created","created_at"],["create","created_at"]]);function Xo(e){if(e===void 0)return;let t=e.trim().toLowerCase(),r=Fd.get(t);if(r)return r;if(!Oo.includes(t))throw new m(`Sort field must be one of ${Oo.join("|")} (aliases: updated->updated_at, created->created_at)`,f.USAGE);return t}function Qo(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!No.includes(t))throw new m(`Sort order must be one of ${No.join("|")}`,f.USAGE);return t}function Pd(e){return nt(e,"--tree-depth")}function Jo(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!t)throw new m("Assignee filter must be one of assigned|unassigned",f.USAGE);if(t!=="assigned"&&t!=="unassigned")throw new m(`Invalid assignee filter "${e}". Allowed: assigned|unassigned`,f.USAGE);return t}function Po(e,t){return $t(e,t,{strict:!0})}function Zo(e){return Ae(e,{label:"--tag",normalize:t=>t.toLowerCase()})}function $d(e,t,r){let n=Zo(t);if(n===void 0)return;let o=new Set(e.flatMap(s=>s.tags.map(a=>a.trim().toLowerCase()))),i=[...n].filter(s=>!o.has(s));i.length>0&&r.push(`unknown_tags:${i.join(",")}`)}function zd(e,t){if(e&&[...e].some(r=>r.toLowerCase()==="none"||r.toLowerCase()==="null"))throw new m('--assignee no longer accepts "none" or "null". Use --assignee-filter unassigned.',f.USAGE);if(e!==void 0&&t==="unassigned")throw new m("Cannot combine --assignee with --assignee-filter unassigned",f.USAGE)}function Ud(e,t,r,n){let o=Ae(t.assignee,{label:"--assignee"}),i=Jo(t.assigneeFilter);zd(o,i);let s=$o(t),a=pr(t);return{idsFilter:Go(t.ids),statusSet:e&&e.length>0?new Set(e):void 0,excludeTerminal:t.excludeTerminal===!0,typeFilter:ho(t.type,r),tagFilters:Zo(t.tag),priorityFilter:wo(t.priority),deadlineBefore:Fo(t.deadlineBefore,"deadline-before"),deadlineAfter:Fo(t.deadlineAfter,"deadline-after"),updatedAfter:Ho(t),updatedBefore:Ce(t.updatedBefore,"updated-before"),createdAfter:Ce(t.createdAfter,"created-after"),createdBefore:Ce(t.createdBefore,"created-before"),assigneeFilter:o,assigneeModeFilter:i,parentFilter:t.parent?.trim(),treeEnabled:t.tree===!0,sprintFilter:Ae(t.sprint,{label:"--sprint"}),releaseFilter:Ae(t.release,{label:"--release"}),missingMetadataFilters:s,missingMetadataActive:ur(s),lifecycleClassifier:vo(n),contentFieldFilters:a,contentFiltersActive:xo(a)}}function Vd(e,t,r){return t.idsFilter&&!t.idsFilter.has(e.id)||t.statusSet&&!t.statusSet.has(e.status)||t.excludeTerminal&&H(e.status,r)||t.typeFilter&&!t.typeFilter.has(e.type)||t.tagFilters&&![...t.tagFilters].some(n=>(e.tags??[]).some(o=>o.trim().toLowerCase()===n))?!1:t.priorityFilter===void 0||t.priorityFilter.has(e.priority)}function jd(e,t){return Lr(e,t)}function Kd(e,t){return t.assigneeModeFilter==="assigned"&&!e.assignee||t.assigneeModeFilter==="unassigned"&&e.assignee?!1:t.assigneeFilter===void 0||e.assignee!==void 0&&t.assigneeFilter.has(e.assignee)}function qd(e,t,r){let n=e.parent?.trim().toLowerCase(),o=[...new Set([...r?.get(e.id.trim().toLowerCase())??[],...n?[n]:[]])];return t.parentFilter!==void 0&&!t.treeEnabled&&!o.includes(t.parentFilter.trim().toLowerCase())||t.sprintFilter!==void 0&&(e.sprint===void 0||!t.sprintFilter.has(e.sprint))?!1:t.releaseFilter===void 0||e.release!==void 0&&t.releaseFilter.has(e.release)}function Hd(e,t,r,n,o){return!(!Vd(e,t,r)||!jd(e,t)||!Kd(e,t)||!qd(e,t,o)||t.missingMetadataActive&&!Ao(e,t.missingMetadataFilters,t.lifecycleClassifier)||t.contentFiltersActive&&!ko(e,t.contentFieldFilters)||!Ut(e,n))}function ei(e,t,r,n,o,i,s){let a=Ud(t,r,n,o);return e.filter(c=>Hd(c,a,o,i,s))}function ce(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function mr(e,t,r,n){let o=e,i=typeof o.title=="string"?o.title:"",s=n??ce(typeof o.parent=="string"?o.parent:void 0)??null;return{...e,tree_depth:t,tree_parent:s,tree_children:r,tree_title:`${" ".repeat(t)}${i}`}}function Bd(e,t){let r=new Map,n=new Map;for(let o of e){let i=o.id.trim().toLowerCase();r.set(i,o);let s=t?t.parents_by_child.get(i)??[]:[ce(o.parent)?.toLowerCase()].filter(a=>a!==void 0);for(let a of s){let c=n.get(a)??[];c.push(o),n.set(a,c)}}return{byId:r,childrenByParent:n}}function Gd(e,t,r,n,o){return t?[...n.get(t.toLowerCase())??[]]:e.filter(i=>(o?o.parents_by_child.get(i.id.trim().toLowerCase())??[]:[ce(i.parent)?.toLowerCase()].filter(a=>a!==void 0)).every(a=>!r.has(a)))}function ti(e,t,r,n,o=e){let{byId:i,childrenByParent:s}=Bd(e,n),a=Gd(e,t,i,s,n),c=[],d=new Set,l=new Map(o.map(p=>[p.id.trim().toLowerCase(),p.id.trim()])),u=[...a].reverse().map(p=>({node:p,depth:0,parentId:t===void 0?void 0:l.get(t.trim().toLowerCase())??t.trim()}));for(;u.length>0;){let{node:p,depth:_,parentId:g}=u.pop(),y=p.id.trim().toLowerCase();if(d.has(y))continue;d.add(y);let h=s.get(y)??[];if(c.push(mr(p,_,h.length,g)),!(r!==void 0&&_>=r))for(let b of[...h].reverse())u.push({node:b,depth:_+1,parentId:l.get(y)})}if(t===void 0&&r===void 0)for(let p of e){let _=p.id.trim().toLowerCase();d.has(_)||(d.add(_),c.push(mr(p,0,s.get(_)?.length??0)))}return c}function ri(e,t){return e===t?0:e===null?1:t===null?-1:e.localeCompare(t)}function ni(e,t){return e===t?0:e===null?1:t===null?-1:te(e,t)}function oi(e,t,r){switch(r){case"priority":return e.priority-t.priority;case"deadline":return ni(e.deadline??null,t.deadline??null);case"updated_at":return te(e.updated_at,t.updated_at);case"created_at":return te(e.created_at,t.created_at);case"title":return(e.title??"").localeCompare(t.title??"");case"parent":return ri(e.parent??null,t.parent??null);default:return 0}}function ii(e,t,r,n){return t?[...e].sort((o,i)=>{let s=oi(o,i,t);if(s!==0)return r==="desc"?-s:s;let a=_r(o,i,n);return r==="desc"?-a:a}):Od(e,n)}function si(e,t,r=!1){let n=K(t.trim());if(n.length===0)return null;let o=e;return r&&n==="title"&&typeof o.tree_title=="string"?o.tree_title:Object.prototype.hasOwnProperty.call(o,n)?o[n]??null:null}function gr(e,t,r=!1){return t.mode==="full"?e:e.map(n=>{let o={};for(let i of t.fields)o[i]=si(n,i,r);return o})}function ai(e){let t=[];for(let r of e)t.push(r.metadata_key);return t}function ci(e,t){if(e.noTruncate!==!0)return nt(e.limit)??(t>=1e4?20:void 0)}function Yd(e,t,r){return t.after===void 0?yr(t.offset)??0:kr(e,t.after,r,n=>n.id)}function di(e,t,r){return{...e!==void 0?{applied_limit:e}:{},has_more:t,truncated:t,next_cursor:r??null}}async function Wd(e,t){let r=R(process.cwd(),t.path);await ne(r);let n=await v(r),o=ee(n.schema),i=ft(n.schema),s=e.projectionCommand??"list",a=Wo(e,s);return Nd(a,ai(i.definitions),s),{pmRoot:r,settings:n,statusRegistry:o,runtimeFieldFilters:zt(e,i,"list"),typeRegistry:A(n,P()),projection:a}}async function Xd(e,t,r){let n=t.projection.fields.some(c=>K(c)==="body"),o=t.projection.mode==="full"||t.projection.fields.some(c=>zo.has(K(c))),i=pr(e),s=Lo(i),a=Mo(i);return e.includeBody||n||a?await qr(t.pmRoot,t.settings.item_format,t.typeRegistry.type_to_folder,r,t.settings.schema):o||s?await At(t.pmRoot,t.settings.item_format,t.typeRegistry.type_to_folder,r,t.settings.schema):await oe(t.pmRoot,t.settings.item_format,t.typeRegistry.type_to_folder,r,t.settings.schema)}function Qd(e){let t=Xo(e.sort),r=Qo(e.order)??"asc",n=e.tree===!0;if(!n&&e.treeDepth!==void 0)throw new m("List --tree-depth requires --tree",f.USAGE);if(!t&&e.order!==void 0)throw new m("List --order requires --sort",f.USAGE);return{sortField:t,sortOrder:r,treeEnabled:n,treeDepth:n?Pd(e.treeDepth):void 0,parentRoot:n?ce(e.parent):void 0}}function Jd(e,t,r){let n=Po(t.status,r),o;t.lifecycleBucket==="in_progress"?o=[r.in_progress_status]:t.lifecycleBucket==="open"&&(o=[...r.active_statuses].filter(d=>d!==r.in_progress_status).sort((d,l)=>d.localeCompare(l)));let i=n??o??Po(e,r),s=En(t.status),a=n||s?{...t,excludeTerminal:!1}:t,c="all";return s?c="all":n!==void 0?c=n.length===1?n[0]:n:t.lifecycleBucket!==void 0?c=t.lifecycleBucket:i!==void 0?c=i.length===1?i[0]:i:a.excludeTerminal===!0&&(c=null),{resolvedStatus:i,explicitAllStatuses:s,effectiveOptions:a,filtersStatus:c}}function Zd(e,t,r,n,o){if(t.after!==void 0&&t.offset!==void 0)throw new m("List --after cannot be combined with --offset.",f.USAGE);let i=ci(t,e.length),s=Yd(e,t,o),a=i===void 0?e.slice(s):e.slice(s,s+i),c=gr(a,r,n),d=e.length,l=a.length>0&&s+a.length<d,u=l&&a.length>0?mt(o,a[a.length-1].id,s+a.length-1):void 0;return{projected:c,totalMatched:d,pageExtras:di(i,l,u)}}function li(e,t,r){return xr("list",{status:e,options:Rr(t,Tr),sort:r.sortField??"default",order:r.sortOrder,tree:r.treeEnabled,tree_depth:r.treeDepth??null})}async function el(e){let{options:t,runtime:r,statusSelection:n,ordering:o}=e,i=new Set(["status","limit","offset","compact","brief","full","fields","format","stream","includeBody","excludeTerminal","dependencyBlocked","lifecycleBucket","noTruncate","projectionCommand","truncate","notes","learnings","files","docs","tests","comments","deps","linkedCommand"]),s=[r.projection.mode==="full",r.projection.fields.some(g=>{let y=K(g);return y==="body"||zo.has(y)})].includes(!0);if([t.limit===void 0,t.after!==void 0,t.noTruncate===!0,t.includeBody===!0,t.dependencyBlocked===!0,t.strictRead===!0,o.treeEnabled,o.sortField!==void 0,s,Cr(),Object.keys(r.runtimeFieldFilters).length>0,Object.entries(t).some(([g,y])=>y!==void 0&&!i.has(g))].includes(!0))return null;let c=await pe(r.pmRoot,[...new Set(Object.values(r.typeRegistry.type_to_folder))]);if(!c)return null;let d=nt(t.limit),l=yr(t.offset)??0,u=await Tt({pmRoot:r.pmRoot,expectedSourceCursor:c.source_cursor,query:{statuses:n.resolvedStatus,excludeStatuses:n.resolvedStatus===void 0&&n.effectiveOptions.excludeTerminal===!0?[...r.statusRegistry.terminal_statuses]:void 0,terminalStatuses:[...r.statusRegistry.terminal_statuses],limit:d,offset:l}});if(!u)return null;let p=u.items.length>0&&l+u.items.length<u.total,_=p?mt(li(n.filtersStatus,t,o),u.items.at(-1).id,l+u.items.length-1):void 0;return{projected:gr(u.items,r.projection,!1),totalMatched:u.total,pageExtras:di(d,p,_)}}function tl(e){let{filtersStatus:t,options:r,noTruncate:n,treeEnabled:o,treeDepth:i,sortField:s,sortOrder:a,runtimeFieldFilters:c}=e,d={};t!==null&&(d.status=t),r.dependencyBlocked===!0&&(d.blocked_semantics="status_or_dependency");let l=r;for(let u of Ld){let p=l[u.optionKey];p!=null&&(d[u.summaryKey]=p)}for(let u of Md)l[u.key]===!0&&(d[u.summaryKey]=!0);return Object.assign(d,Ko(r),jo(r)),Bo(d,r),n&&(d.no_truncate=!0),r.strictRead===!0&&(d.strict_read=!0),o&&(d.tree=!0,i!==void 0&&(d.tree_depth=i)),s!==void 0&&(d.sort=s,d.order=a),d.runtime_filters=c,d}async function Vh(e,t,r){let n=await Wd(t,r),o=[],i=Qd(t),s=Jd(e,t,n.statusRegistry),a=t.noTruncate===!0,c=await el({options:t,runtime:n,statusSelection:s,ordering:i}),d=c;if(!d){let y=await Xd(t,n,o),b=i.treeEnabled||ce(t.parent)!==void 0?Yr(Gr(y,Br())):void 0;$d(y,t.tag,o);let C=ei(y,s.resolvedStatus,s.effectiveOptions,n.typeRegistry,n.statusRegistry,n.runtimeFieldFilters,b?.parents_by_child),L=t.dependencyBlocked===!0?(()=>{let U=Hr(y,n.statusRegistry);return C.filter(it=>U.has(it.id.trim().toLowerCase()))})():C,z=ii(L,i.sortField,i.sortOrder,n.statusRegistry),q=i.treeEnabled?ti(z,i.parentRoot,i.treeDepth,b,y):z;d=Zd(q,t,n.projection,i.treeEnabled,li(s.filtersStatus,t,i))}let l=M(),u=[...new Set(o)].sort((y,h)=>y.localeCompare(h)),p=Id(u,c!==null,t.strictRead===!0),_=n.projection.mode==="full"?null:[...n.projection.fields];if(n.projection.mode==="compact"&&t.compact===!0){let y=qo({filtersStatus:s.filtersStatus,options:t,treeEnabled:i.treeEnabled,treeDepth:i.treeDepth,sortField:i.sortField,sortOrder:i.sortOrder,runtimeFieldFilters:n.runtimeFieldFilters});return{items:d.projected,count:d.projected.length,total:d.totalMatched,...d.pageExtras,completeness:p,filters:y,projection:{mode:"compact",fields:_},...u.length>0?{warnings:u}:{}}}return{items:d.projected,count:d.projected.length,total:d.totalMatched,...d.pageExtras,completeness:p,filters:tl({filtersStatus:s.filtersStatus,options:t,noTruncate:a,treeEnabled:i.treeEnabled,treeDepth:i.treeDepth,sortField:i.sortField,sortOrder:i.sortOrder,runtimeFieldFilters:n.runtimeFieldFilters}),projection:{mode:n.projection.mode,fields:_},sorting:{sort:i.sortField??"default",order:i.sortField?i.sortOrder:"asc"},now:l,...u.length>0?{warnings:u}:{}}}var jh={applyFilters:ei,buildCompactListFilterSummary:qo,buildContentFilterEcho:jo,buildGovernanceMissingFilterEcho:Ko,resolveContentFieldFilters:pr,resolveMissingMetadataFilters:$o,compareBySortField:oi,compareDefaultSort:_r,compareNullableString:ri,compareNullableTimestamp:ni,normalizeProjectionField:K,parseAssigneeFilter:Jo,parseFieldSelectors:Yo,parseIdsFilter:Go,parseOffset:yr,parseProjectionConfig:Wo,resolveListUpdatedAfter:Ho,resolveListPageLimit:ci,parseSortField:Xo,parseSortOrder:Qo,orderItemsAsTree:ti,projectListItems:gr,readListFieldValue:si,runtimeMetadataKeysForProjection:ai,sortItems:ii,trimNonEmpty:ce,withTreeMetadata:mr};(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]="e252abd5-9585-56f7-9fc2-7b20459a2238")}catch{}})();async function tw(e){let t=R(process.cwd(),e);await ne(t);let r=await v(t),n=A(r,P());return{pmRoot:t,settings:r,typeRegistry:n}}async function ui(e,t,r,n){ue(e,Ne(t));let o=await _e(e,t,r.id_prefix,r.item_format,n);if(o)return{id:o.id,historyPath:ue(e,o.id),located:o};let i=re(t,r.id_prefix),s=Ne(t),a=i===s?[i]:[i,s];for(let c of a){let d=ue(e,c);if(await V(d))return{id:c,historyPath:d,located:null}}throw new m(`Item ${t} not found`,f.NOT_FOUND)}(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]="b6ef0b23-e861-50ec-b7b3-751863936631")}catch{}})();function Ew(e,t){let r=St(e),n=e.length>0?e[e.length-1].after_hash:bt(),o=t===void 0||r.item_hash_version===void 0?void 0:Nr(t,r.item_hash_version,Mr(e.at(-1)?.hash_algorithm)),i=t===void 0?void 0:o===void 0?wt(t):o[Math.max(0,o.indexOf(n))],s=i===void 0?void 0:i===n,a=[...r.errors];return s===!1&&a.push("verify_failed:current_item_hash_mismatch"),{ok:a.length===0,entries:e.length,errors:a,latest_after_hash:e.length>0?e[e.length-1].after_hash:void 0,current_item_hash:i,current_matches_latest:s}}async function Sw(e,t,r={}){let n=R(r.cwd??process.cwd(),r.pmRoot);await ne(n);let o=await v(n),i=A(o,P()),s=await ui(n,e,o,i.type_to_folder),a=await me(s.historyPath,s.id);if(a.length===0)throw new m(`No history exists for ${s.id}; point-in-time reads are unavailable.`,f.NOT_FOUND);let c=Ur(t,a),d=jr(Vr(a,c.historyIndex),c),l=Et(d,{schema:o.schema});if(l.metadata.id!==s.id)throw new m(`History target resolved to item ${l.metadata.id}, expected ${s.id}.`,f.GENERIC_FAILURE);let u=a[c.historyIndex],p=zr(a,!0);return{document:l,reconstructed:!0,as_of_version:p===null?null:p+c.historyIndex+1,as_of_timestamp:u.ts,target:c,history_length:a.length}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e524f0ad-faad-5d89-b8f5-1283979919ad")}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]="4e54ed7b-3bab-51a2-912b-1284eaf8187a")}catch{}})();var ot=1e6;function hr(e,t=ot,r=.8,n=!1){let o=new Set,i=(l,u)=>{if(o.add(`${l}:${u}`),o.size>t)throw new m(`Duplicate sweep exceeded ${t} candidate pairs; narrow it with statuses or since.`,f.CONFLICT,{code:"duplicate_sweep_cost_limit",required:"Narrow the duplicate query or increase its similarity threshold. No partial result was returned."})};if(n||r===0){for(let l=0;l<e.length;l+=1)for(let u=0;u<l;u+=1)i(u,l);return o}let s=new Map;for(let{prepared:l}of e)for(let u of l.tokens)s.set(u,(s.get(u)??0)+1);let a=new Map,c=new Map,d=new Map;for(let[l,{prepared:u}]of e.entries()){let p=[...u.tokens].sort((y,h)=>s.get(y)-s.get(h)||y.localeCompare(h)),_=p.length-Math.ceil(r*p.length-1e-12)+1,g=[{index:a,keys:[u.normalized],lengthFilter:!1},{index:c,keys:r<=.99?u.issueCodes:[],lengthFilter:!1},{index:d,keys:p.length===0?[""]:p.slice(0,_),lengthFilter:!0}];for(let y of g)rl(e,l,y,r,i)}return o}function rl(e,t,r,n,o){let i=e[t].prepared.tokens.length;for(let s of r.keys){let a=r.index.get(s)??[];for(let c of a){let d=e[c].prepared.tokens.length;r.lengthFilter&&Math.min(d,i)/Math.max(d,i)+1e-12<n||o(c,t)}a.push(t),r.index.set(s,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]="8d07624c-8663-5aba-8018-1b2c47997bef")}catch{}})();var nl=3,fi=20,ol=.8,il=100,mi=1e3;function Gw(e){return e===void 0?[]:[`likely_duplicates:${e.result.items.map(t=>t.id).join(",")}`,`likely_duplicate_recovery:${e.recovery.action}:${e.recovery.item_id}`]}async function sl(e,t){let r=e.items[0],n=R(t.cwd??process.cwd(),t.pmRoot),o=ee((await v(n)).schema);return H(r.status,o)?{action:"reopen",item_id:r.id,command:`pm item reopen ${r.id} "<recurrence reason>"`,args:["item","reopen",r.id,"<recurrence reason>"]}:{action:"reuse",item_id:r.id,command:`pm get ${r.id} --full`,args:["get",r.id,"--full"]}}function wr(e){let t=e.limit??nl,r=e.threshold??ol;if(!Number.isSafeInteger(t)||t<0||t>fi)throw new m(`Similarity limit must be an integer from 0 to ${fi}.`,f.USAGE);if(!Number.isFinite(r)||r<0||r>1)throw new m("Similarity threshold must be a number from 0 to 1.",f.USAGE);return{limit:t,threshold:r}}function pi(e){let t=e.limit??il;if(!Number.isSafeInteger(t)||t<0||t>mi)throw new m(`Duplicate cluster limit must be an integer from 0 to ${mi}.`,f.USAGE);let r=e.since===void 0?void 0:new Date(e.since);if(r&&Number.isNaN(r.getTime()))throw new m("Duplicate cluster --since must be a valid ISO timestamp.",f.USAGE);return{limit:t,since:r}}async function al(e,t){let r=R(e.cwd??process.cwd(),e.pmRoot),n=await v(r),o=A(n),i=e.statuses?.map(u=>u.trim().toLowerCase()).filter(Boolean);if(e.statuses!==void 0&&i?.length===0)throw new m("Duplicate cluster statuses must include at least one lifecycle status or all.",f.USAGE);let s=ee(n.schema),a=i?.map(u=>{if(u==="all")return u;let p=fe(u,s);if(!p)throw new m(`Unknown duplicate-cluster status "${u}". Allowed: all, ${s.definitions.map(_=>_.id).join(", ")}.`,f.USAGE);return p}),c=a?.includes("all")===!0;if(c&&a?.some(u=>u!=="all"))throw new m('The "all" status cannot be combined with other statuses.',f.USAGE);let d=c?void 0:a,l=d?new Set(d):void 0;return{items:(await oe(r,n.item_format,o.type_to_folder,void 0,n.schema)).filter(u=>(!l||l.has(u.status))&&(!t||new Date(u.created_at).getTime()>=t.getTime())),statuses:d}}var Yw={buildDuplicateClusters:yi,collectDuplicateCandidatePairs:hr,createDuplicateUnionFind:_i};function _i(e){let t=Array.from({length:e},(n,o)=>o);return{parent:t,findRoot:n=>{let o=n;for(;t[o]!==o;)o=t[o];for(;t[n]!==n;){let i=t[n];t[n]=o,n=i}return o}}}function cl(e,t,r,n){let o=[];for(let i of t){let[s,a]=i.split(":").map(u=>Number.parseInt(u,10)),c=Ue(e[s].prepared,e[a].prepared);if(c.score<r)continue;let d=n.findRoot(s),l=n.findRoot(a);d!==l&&(n.parent[l]=d),o.push({left_id:e[s].item.id,right_id:e[a].item.id,...c})}return o}function yi(e,t,r,n){let o=new Map;for(let a of e.keys()){let c=r.findRoot(a),d=o.get(c)??[];d.push(a),o.set(c,d)}let i=new Map(e.map(({item:a},c)=>[a.id,r.findRoot(c)])),s=new Map;for(let a of t){let c=i.get(a.left_id),d=s.get(c)??[];d.push(a),s.set(c,d)}return[...o.values()].filter(a=>a.length>1).map(a=>{let c=(s.get(r.findRoot(a[0]))??[]).sort((d,l)=>l.score-d.score||d.left_id.localeCompare(l.left_id)||d.right_id.localeCompare(l.right_id));return{id:e[a[0]].item.id,items:a.map(d=>{let l=e[d].item;return{id:l.id,title:l.title,status:l.status,type:l.type}}),matches:c,max_score:c[0]?.score??0}}).sort((a,c)=>c.max_score-a.max_score||a.id.localeCompare(c.id)).slice(0,n)}function dl(e,t,r,n,o){return t.filter(i=>!r.has(i.id)).map(i=>({id:i.id,title:i.title,status:i.status,type:i.type,...ze(e,i.title)})).filter(i=>i.score>=n).sort((i,s)=>s.score-i.score||i.id.localeCompare(s.id)).slice(0,o)}async function ll(e,t={}){let r=e.title.trim();if(r.length===0)throw new m("Similarity candidate title must not be empty.",f.USAGE);let{limit:n,threshold:o}=wr(t),i=R(t.cwd??process.cwd(),t.pmRoot),s=await v(i),a=A(s),c=await pe(i,Object.values(a.type_to_folder)),d=we(r),l=c&&d.length>0?await vt({pmRoot:i,expectedSourceCursor:c.source_cursor,query:d.map(_=>`"${_.replaceAll('"','""')}"`).join(" OR "),limit:Math.max(n*10,50)}):null,u=l===null?await oe(i,s.item_format,a.type_to_folder,void 0,s.schema):l.items,p=dl(r,u,new Set(e.excludeIds??[]),o,n);return{items:p,count:p.length,threshold:o,source:l?"persistent_index":"metadata_fallback"}}function ul(e,t={}){let{threshold:r}=wr({...t,limit:void 0}),{limit:n}=pi(t),o=new Set;for(let l of e){if(!l.id.trim()||o.has(l.id))throw new m("Duplicate analysis requires unique non-empty item ids.",f.USAGE);o.add(l.id)}let i=[...e].sort((l,u)=>l.id.localeCompare(u.id)).map(l=>({item:l,prepared:he(l.title)})),s=hr(i,ot,r,t.exhaustive===!0),a=_i(i.length),c=cl(i,s,r,a),d=yi(i,c,a,n);return{clusters:d,count:d.length,threshold:r,cost:{item_count:i.length,algorithm:t.exhaustive===!0||r===0?"exhaustive":"prefix_exact",possible_pairs:i.length*(i.length-1)/2,pair_limit:ot,recall_guarantee:"exact",candidate_pairs:s.size,scored_pairs:s.size}}}async function Ww(e={}){wr({...e,limit:void 0});let{since:t}=pi(e),{items:r,statuses:n}=await al(e,t);return{...ul(r,e),source:"metadata_scan",filters:{statuses:n??null,since:e.since??null}}}async function Xw(e,t){if(t.mode==="off")return;let r=await ll(e,t);if(r.count===0)return;let n=await sl(r,t),o=t.mode==="strict"&&t.allowDuplicate===!0;if(t.mode==="strict"&&!o){let i=r.items.map(a=>`${a.id} (${a.status}): ${a.title}`).join("; "),s=n.action==="reopen"?"Reopen the canonical item":"Reuse the canonical item";throw new m(`Likely duplicate item(s) found: ${i}. ${s} or pass --allow-duplicate with explicit intent.`,f.CONFLICT,{code:"likely_duplicate",required:`${s}, or explicitly acknowledge the duplicate with --allow-duplicate.`,recovery:{suggested_flags:["--allow-duplicate"],suggested_retry:n.command,suggested_retry_args:n.args}})}return{mode:t.mode,bypassed:o,result:r,recovery:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e15abc24-c46a-512b-b859-015186c960df")}catch{}})();function Jw(e,t){let r=t??{};return e.filter(n=>r[n.id]!==n.updated_at).map(n=>n.id).sort((n,o)=>n.localeCompare(o))}export{Zi as a,rs as b,os as c,ss as d,as as e,nu as f,cs as g,ds as h,au as i,un as j,ls as k,us as l,fs as m,ms as n,ws as o,Ss as p,cu as q,Ts as r,yn as s,Is as t,As as u,du as v,Cs as w,je as x,lu as y,Ke as z,xs as A,ks as B,Nt as C,Ms as D,Ft as E,Ds as F,Iu as G,Ns as H,hn as I,Fs as J,Ps as K,Us as L,Mu as M,Ks as N,$t as O,Ys as P,Wr as Q,zt as R,Ut as S,Be as T,ga as U,bl as V,Ct as W,Zr as X,Rt as Y,ki as Z,Li as _,Tl as $,en as aa,ie as ba,xt as ca,Lt as da,Yt as ea,af as fa,Wt as ga,Qe as ha,Ln as ia,Je as ja,Xt as ka,Qt as la,Jt as ma,Zt as na,Pn as oa,$n as pa,Rf as qa,et as ra,ve as sa,ji as ta,on as ua,Ki as va,qi as wa,Hi as xa,Ol as ya,Fl as za,ge as Aa,$e as Ba,we as Ca,he as Da,ze as Ea,Ue as Fa,sn as Ga,Qi as Ha,ic as Ia,cc as Ja,lc as Ka,uc as La,Sc as Ma,Wn as Na,Ie as Oa,Gm as Pa,nt as Qa,go as Ra,eh as Sa,cr as Ta,Ae as Ua,ho as Va,wo as Wa,vo as Xa,ur as Ya,Ao as Za,ch as _a,dh as $a,xo as ab,ko as bb,uh as cb,$o as db,pr as eb,Oo as fb,No as gb,xd as hb,jo as ib,Ko as jb,Vh as kb,jh as lb,tw as mb,ui as nb,Ew as ob,Sw as pb,Gw as qb,Yw as rb,ll as sb,ul as tb,Ww as ub,Xw as vb,Jw as wb};
20
- //# sourceMappingURL=chunk-DZVOCJFY.js.map
20
+ //# sourceMappingURL=chunk-UPOMLSW7.js.map