@unbrained/pm-cli 2026.11.4 → 2026.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/HARNESS_COMPATIBILITY.md +1 -1
- package/.agents/skills/README.md +14 -14
- package/.agents/skills/pm-developer/SKILL.md +16 -16
- package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +14 -14
- package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +10 -10
- package/.agents/skills/pm-extensions/SKILL.md +13 -13
- package/.agents/skills/pm-extensions/references/AUTHORING.md +12 -12
- package/.agents/skills/pm-sdk/SKILL.md +27 -27
- package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +32 -32
- package/.agents/skills/pm-test-audit/references/AUDIT.md +1 -1
- package/.agents/skills/pm-user/SKILL.md +35 -35
- package/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +9 -9
- package/CHANGELOG.md +9 -0
- package/README.md +13 -13
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2RPORE7M.js +31 -0
- package/dist/cli-bundle/chunks/{chunk-NPEDFOVQ.js → chunk-335BZ75D.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +122 -0
- package/dist/cli-bundle/chunks/chunk-6VRX2CM7.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-7PGNAHNW.js → chunk-7DEKAXVA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3OXQGGRD.js → chunk-7ZRCYESH.js} +42 -41
- package/dist/cli-bundle/chunks/{chunk-BWAXA6S4.js → chunk-AUEKTX7V.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SRDO2NJU.js → chunk-D7KYPRK4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ODMJ3HIB.js → chunk-DAX3AOFI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L4BKTPJ6.js → chunk-F6NDMKZ4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T56MB6SF.js → chunk-FRNMQM45.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5S6RT5LX.js → chunk-HNGLDMSZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QN7VCOUU.js → chunk-HRCMORE7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BK2XAQVC.js → chunk-HRFGFIYU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CERNIZLB.js → chunk-JI2GDE4I.js} +42 -42
- package/dist/cli-bundle/chunks/{chunk-6T2V3UIK.js → chunk-LS3GI3H4.js} +53 -53
- package/dist/cli-bundle/chunks/chunk-OH6WQ7VT.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-BRIPGUAO.js → chunk-OJDMJT7Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7RCI7AAA.js → chunk-S4LPZ4TN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AQ5UHHQS.js → chunk-UEGXWXUZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5BVZ32G7.js → chunk-XLSHFYXZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2GW662DP.js → chunk-YKXATU2G.js} +2 -2
- package/dist/cli-bundle/chunks/{item-revision-UAZOBP2Q.js → item-revision-OJJVPQY7.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-QEPBUCMY.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-admission-QZQI2NN5.js → mutation-admission-INMM3HHG.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-P3NOKQUA.js → register-list-query-5Y5JKWU5.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-A6I5K5N6.js → register-mutation-WC7OSQID.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-SPKB3TNM.js → register-operations-PO63DBZH.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-RRFOS7IT.js +2 -0
- package/dist/cli-bundle/chunks/{stage-L3T725DS.js → stage-E3MMV4TV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5PMJOJCZ.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TFYTTDAK.js → chunk-7KK66ISG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Y5GOUUYJ.js → chunk-AHWJPZSJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-C7UX2ZI3.js → chunk-C6P6HPCX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Q4OIRSKL.js → chunk-CPMSL4HS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-CZM75DE3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-CO2DNPH7.js → chunk-D2TBEBNW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-E56OXRYH.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FXFDVM5O.js → chunk-F62XGAAY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-G4QP365K.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-J7M52SCZ.js → chunk-G5PJCR7R.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GS3JC5UU.js +23 -0
- package/dist/cli-bundle/focused-chunks/{chunk-W3CSX6GI.js → chunk-LW64TINU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MEJKELWC.js → chunk-M6V7UMWL.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-CXTDEQ3N.js → chunk-MC7IE7D7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MG7C3JUY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-QEVJ3Y67.js → chunk-MK4HV4JO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-A2246ZM7.js → chunk-NQ7GYFOX.js} +54 -54
- package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +91 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FFO7RBLN.js → chunk-RFTJZ5VB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PNPYQDHU.js → chunk-SNOXXRSJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JQS7TYQ6.js → chunk-UPJUTP2V.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SDLIUZEL.js → chunk-VWWTIX5L.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-J6FDCAMH.js → chunk-XHOBYCVE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-J3YOATXR.js → chunk-YMGB2O4E.js} +25 -24
- package/dist/cli-bundle/focused-chunks/{item-revision-L6GVT42D.js → item-revision-CTDO4H3I.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{item-transaction-GYGP264N.js → item-transaction-AEAYVVHA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-UWTH56OD.js → mutation-admission-4WM7TNHZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-WRSNJ7VI.js → stage-WV7QXR4C.js} +2 -2
- package/dist/cli-bundle/main.js +2 -2
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +57 -57
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +9 -9
- package/dist/core/config/positional-value.d.ts +6 -0
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/item/literal-mutation-input.d.ts +17 -0
- package/dist/core/item/literal-mutation-input.js +1 -1
- package/dist/core/item/parent-reference-policy.d.ts +8 -4
- package/dist/core/item/parent-reference-policy.js +1 -1
- package/dist/core/item/sprint-release-format.d.ts +2 -1
- package/dist/core/item/sprint-release-format.js +1 -1
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/store/item-mutation-precondition.d.ts +3 -1
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/settings.d.ts +14 -0
- package/dist/core/store/settings.js +5 -4
- package/dist/core/telemetry/policy.d.ts +27 -1
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/runtime.d.ts +18 -7
- package/dist/core/telemetry/runtime.js +4 -4
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +8 -5
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/config.d.ts +2 -2
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/governance/health.d.ts +2 -2
- package/dist/sdk/governance/health.js +2 -2
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/init.d.ts +4 -4
- package/dist/sdk/init.js +8 -8
- package/dist/sdk/lifecycle/claim.d.ts +4 -0
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/close.d.ts +10 -0
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/create.d.ts +7 -5
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.d.ts +628 -4
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
- package/dist/sdk/lifecycle/update.d.ts +5 -4
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime/mutation-value-validation.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +1 -0
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/telemetry.d.ts +1 -1
- package/dist/sdk/telemetry.js +2 -2
- package/docs/AGENT_GUIDE.md +48 -48
- package/docs/AGENT_OUTPUT_ENCODINGS.md +20 -20
- package/docs/ASSURANCE.md +10 -10
- package/docs/BOUNDED_CONTEXT_READS.md +3 -3
- package/docs/CLAUDE_CODE_PLUGIN.md +1 -1
- package/docs/CLI_GRAMMAR.md +2 -2
- package/docs/COMMANDS.md +56 -35
- package/docs/COMMAND_NAMESPACES.md +1 -1
- package/docs/CONFIGURATION.md +82 -71
- package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +2 -2
- package/docs/CONTEXT_INTEGRITY_CONTRACTS.md +5 -5
- package/docs/CORPUS_SHAPES.md +1 -1
- package/docs/DEPENDENCY_KIND_CONTRACT.md +6 -6
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +5 -5
- package/docs/ECOSYSTEM_PLANNING_REVIEW.md +3 -3
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +4 -4
- package/docs/HISTORY_ATTESTATION.md +1 -1
- package/docs/HISTORY_MAINTENANCE.md +1 -1
- package/docs/LIFECYCLE_COMMANDS.md +1 -1
- package/docs/MCP_2026_07_28.md +16 -16
- package/docs/MCP_2026_07_28_CONFORMANCE.md +19 -19
- package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +22 -22
- package/docs/MCP_SKILLS_AND_APPS.md +1 -1
- package/docs/MERGE_SAFETY.md +6 -6
- package/docs/MUTATION_INTEGRITY.md +5 -5
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +14 -14
- package/docs/PACKED_FIRST_RUN.md +1 -1
- package/docs/QUICKSTART.md +10 -10
- package/docs/README.md +21 -21
- package/docs/READ_OUTPUT_CONTRACTS.md +9 -9
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +1 -1
- package/docs/RELEASING.md +19 -10
- package/docs/SCRIPTING.md +10 -10
- package/docs/SDK.md +74 -38
- package/docs/SDK_ARTIFACT_OUTPUT.md +1 -1
- package/docs/SDK_PRIMITIVE_INVENTORY.md +2 -2
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +7 -7
- package/docs/TESTING.md +1 -1
- package/docs/WORKFLOW_POLICIES.md +2 -2
- package/docs/WORKSPACE_POSITION_AND_LIFECYCLE.md +8 -8
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -1
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +1 -1
- package/docs/performance/cli-transport-overhead.md +7 -7
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/README.md +5 -5
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/GAP_REPORT.md +16 -16
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/README.md +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/GAP_REPORT.md +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +6 -6
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-5Z6LWFDL.js +0 -31
- package/dist/cli-bundle/chunks/chunk-DSCFJTHB.js +0 -122
- package/dist/cli-bundle/chunks/chunk-QQHMNUZT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TX2W6G37.js +0 -3
- package/dist/cli-bundle/chunks/item-transaction-N5F4LXYV.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-ZZRHJ4IS.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5NGNO54M.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-B6U44WPW.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BAW3DGQO.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-BHNY3KPJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CBG67HUP.js +0 -23
- package/dist/cli-bundle/focused-chunks/chunk-FEPE2CE4.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PMKR4MJI.js +0 -2
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{M as dt,N as lt,f as be}from"./chunk-BAW3DGQO.js";import{$a as ur,B as ge,C as it,Ca as cr,Ja as dr,Ua as at,Wa as lr,Za as Ee,_a as ct,bb as we,eb as Se,fa as ye,fb as P,gb as Te,ha as st,k as nt,l as ar,v as ot}from"./chunk-J3YOATXR.js";import{b as or}from"./chunk-SDLIUZEL.js";import{Aa as X,Ac as Q,Ba as et,Ca as rr,Cc as rt,Ha as oe,Ka as nr,Pc as sr,Qb as _e,Qd as M,a as Xe,aa as b,ca as re,da as J,de as he,ea as E,ga as tr,nc as ir,ra as Ze,wc as tt,za as ne}from"./chunk-MEJKELWC.js";import{A as m,C as W,E as K,F as T,I as v,K as pe,t as Qe,z as l}from"./chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cef883fa-81be-5092-a07b-7a5ca961fbc7")}catch{}})();var ve=new WeakSet,ut=new WeakMap,mr=new WeakSet;function fr(e){return mr.add(e),e}function mt(e){return mr.has(e)}function ie(e){ve.add(e);for(let[t,r]of Object.entries(e)){if(!Array.isArray(r))continue;let n=[...r];Reflect.set(e,t,n),ve.add(n)}return e}function eo(e,t){return ve.has(e)||t!==void 0&&ut.get(e)?.has(t)===!0}function to(e,t){let r=new Set(t);ut.set(e,r);for(let n of r){let o=Reflect.get(e,n);if(!Array.isArray(o))continue;let i=[...o];Reflect.set(e,n,i),ve.add(i)}return e}function pr(e,t){if(mt(e)&&fr(t),eo(e))return ie(t);let r=ut.get(e);return r?to(t,r):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]="e35626b8-0818-5b4b-8fc2-57426b51a2d1")}catch{}})();var L="-",ro=/^[A-Za-z0-9_.-]+$/u,ft=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 hr(e,t){if(e.startsWith("```")||e.includes(`
|
|
2
|
-
`))return!0;let r=t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");return new RegExp(`^(?:[-*+]\\s+)?(?:${r})\\s*[:=]`,"i").test(e)}function gr(e){let t=e.trim();if(t==="")return[];let r=(ao(t)??t.split(",")).map(n=>n.trim()).filter(Boolean).map(n=>n.toLowerCase());return Array.from(new Set(r)).sort((n,o)=>n.localeCompare(o))}function yr(e){if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let r of e)if(typeof r=="string")for(let n of gr(r))t.push(n);return Array.from(new Set(t)).sort((r,n)=>r.localeCompare(n))}function br(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").map(t=>t.trim().toLowerCase()).filter(Boolean):[]}function no(e){return typeof e!="string"?[]:e.split(";").map(t=>t.trim()).filter(Boolean)}function oo(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',l.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 io(e,t){let r=br(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 yr(t))n.add(o);return Array.from(n).sort((o,i)=>o.localeCompare(i))}function so(e,t){let r=Array.from(new Set(br(e))).sort((o,i)=>o.localeCompare(i));if(!t||t.length===0)return r;let n=new Set(yr(t));return n.size===0?r:r.filter(o=>!n.has(o))}function ao(e){if(!e.startsWith("["))return null;let t;try{t=JSON.parse(e)}catch{return null}return t.map(r=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").filter(r=>r.length>0)}function pt(e){return e.replace(/\r\n/g,`
|
|
3
|
-
`)}function Er(e){let t=pt(e).trim();if(!t.startsWith("```"))return e;let r=t.split(`
|
|
4
|
-
`);return r.length<2||r.at(-1)?.trim()!=="```"?e:r.slice(1,-1).join(`
|
|
5
|
-
`)}function co(e){let t=[],r="",n=!1;for(let o=0;o<e.length;o+=1){let i=e[o];if(i==="\\"&&e[o+1]===","){r+=",",o+=1;continue}if(i==="\\"&&e[o+1]!==void 0){r+=`${i}${e[o+1]}`,o+=1;continue}if(i==='"'){n=!n,r+=i;continue}if(i===","&&!n){t.push(r),r="";continue}r+=i}return r.trim()&&t.push(r),t}function wr(e){let t=e.trim();if(t.startsWith('"')&&t.endsWith('"')){try{let r=JSON.parse(t);if(typeof r=="string")return r}catch{}return t.slice(1,-1).replace(/\\"/g,'"')}return e}function lo(e){let t=e.indexOf("="),r=e.indexOf(":"),n=t>=0,o=r>=0;return n&&o?Math.min(t,r):n?t:o?r:-1}function uo(e,t){if((t==="--add"||t==="--add-glob")&&(/[./\\]/.test(e)||/\.[a-z]{1,6}$/i.test(e.trim())))return"For file/doc paths use: path=<file-path>[,scope=project|global]. The scope field is optional and defaults to project (example: path=src/api.ts or path=README.md,scope=project). ";if(t!=="--event")return"";let r=e.toLowerCase(),n=r.includes("recur_")||r.includes("recurrence")?' Recurrence list values must stay in one field and use "|" delimiters (for example recur_by_weekday=mon|wed or recur_by_month_day=1|15).':"",o=r.includes("recur_byweekday")?" Use recur_by_weekday (with underscores) for weekday recurrence filters.":"";return`${n}${o}`}function _r(e,t){let r=e.replaceAll(/\s+/g," ").trim(),n=r.length>160?`${r.slice(0,157)}...`:r,o=uo(e,t);return`Invalid ${t} value "${n}". Expected key=value entries separated by commas. `+o+`Also accepts markdown-style key/value lines (for example "- path: README.md"). Use ${t} ${L} to read piped stdin input.`}function mo(e){let t=Er(e).trim();if(t.length===0||!t.includes(`
|
|
6
|
-
`)&&!t.startsWith("-")&&!t.startsWith("*")&&!t.startsWith("+"))return null;let r={},n,o=pt(t).split(`
|
|
7
|
-
`).map(i=>i.trim()).filter(i=>i.length>0);for(let i of o){let s=i.match(/^(?:[-*+]\s+)?([a-zA-Z0-9_.-]+)\s*(=|:)\s*(.*)$/);if(s){let a=s[1].trim();r[a]=wr(s[3].trim()),n=a;continue}if(n&&ft.has(n.toLowerCase())){r[n]=`${r[n]}
|
|
8
|
-
${i}`;continue}return null}return r}function Sr(e,t){let r=Er(e).trim();if(!r)throw new m(`${t} cannot be empty`,l.USAGE);let n=mo(r);if(n)return n;let o={},i,s=co(r);for(let a of s){let c=lo(a),d=a.slice(0,Math.max(c,0)).trim();if(d!==""&&i!==void 0&&ft.has(i.toLowerCase())&&!ro.test(d)){o[i]=`${o[i]},${a}`;continue}if(c>=0){let u=a.slice(0,c).trim();if(!u)throw new m(_r(e,t),l.USAGE);let f=wr(a.slice(c+1).trim());o[u]=f,i=u;continue}if(i&&ft.has(i.toLowerCase())){o[i]=`${o[i]},${a}`;continue}throw new m(_r(e,t),l.USAGE)}return o}var fo=/^[A-Za-z]:[\\/]/,po=/^(?:[-*+]\s+)?[A-Za-z_][A-Za-z0-9_.-]*\s*=/;function _o(e){let t=e.trim();return fo.test(t)?!1:po.test(t)}function Nc(e,t,r,n){if(!(n||!e.includes(",")))throw new m(`${t} received an ambiguous comma-bearing bare ${r}. Repeat ${t} for multiple values, or quote or escape literal commas in a structured key=<value> entry.`,l.USAGE,{code:"bare_comma_entry_ambiguous",required:`Use one ${t} per bare ${r}, or quote or escape literal commas in a structured key=<value> entry.`})}function ho(e,t,r){let n=new Set(r.map(i=>i.toLowerCase())),o=Object.keys(e).filter(i=>!n.has(i.toLowerCase()));if(o.length>0)throw new m(`${t} does not recognize key${o.length>1?"s":""} ${o.map(i=>`"${i}"`).join(", ")}. Allowed keys: ${r.join(", ")}.`,l.USAGE);for(let i of Object.keys(e)){let s=i.toLowerCase();if(s!==i){if(Object.hasOwn(e,s))throw new m(`${t} provides key "${i}" more than once after case normalization.`,l.USAGE);e[s]=e[i],delete e[i]}}}async function go(e){if(process.stdin.isTTY===!0)throw new m(`${e} value "${L}" requires piped stdin input. Pipe content into the command, or end manual stdin with Ctrl+D (Unix/macOS) or Ctrl+Z then Enter (Windows).`,l.USAGE);return process.stdin.setEncoding("utf8"),await new Promise((t,r)=>{let n="";process.stdin.on("data",o=>{n+=o}),process.stdin.on("end",()=>{t(pt(n))}),process.stdin.on("error",o=>{r(o)})})}var $=Symbol("all-mutation-stdin-fields"),I=new WeakMap;function Pc(e){return mt(e)?e:ie(se({...e}))}function se(e){return I.set(e,$),e}function yo(e,t){let r=I.get(e);return r===$||I.set(e,new Set([...r??[],...t])),e}function Ae(e,t){pr(e,t);let r=I.get(e);return r===void 0||I.set(t,r===$?r:new Set(r)),t}function $c(e,t){let r=I.get(e),n=I.get(t);return r===void 0||n===$?t:r===$?(I.set(t,r),t):(I.set(t,new Set([...n??[],...r])),t)}function bo(e){return I.get(e)!==$}function Ie(e,t){let r=I.get(e);return r!==$&&!r?.has(t)}function Eo(e){let t;for(let r of e){if(r.resolveToken===!1||r.value===void 0)continue;let n=(Array.isArray(r.value)?r.value:[r.value]).filter(o=>o.trim()===L).length;if(n>1)throw new m(`${r.optionName} accepts "${L}" stdin token at most once per command invocation`,l.USAGE);if(n!==0){if(t!==void 0&&t!==r.optionName)throw new m(`Only one option may use "${L}" stdin token per command invocation. Already used by ${t}.`,l.USAGE);t=r.optionName}}}async function zc(e,t,r){let n=e,o=[...t,...r];Eo(o.map(([a,c])=>({value:n[a],optionName:c,resolveToken:Ie(e,a)})));let i=Ce(),s={...n};for(let[a,c]of t)s[a]=await i.resolveValue(n[a],c,Ie(e,a));for(let[a,c]of r)s[a]=await i.resolveList(n[a],c,Ie(e,a));return se(Ae(e,s))}function Ce(){let e,t,r=async n=>{if(t&&t!==n)throw new m(`Only one option may use "${L}" stdin token per command invocation. Already used by ${t}.`,l.USAGE);return t=n,e||(e=go(n)),await e};return{resolveValue:async(n,o,i=!0)=>{if(!i)return n;if(n!==void 0)return n.trim()!==L?n:await r(o)},resolveList:async(n,o,i=!0)=>{if(!i)return n;if(!n)return;let s=n.map((d,u)=>d.trim()===L?u:-1).filter(d=>d>=0);if(s.length===0)return n;if(s.length>1)throw new m(`${o} accepts "${L}" stdin token at most once per command invocation`,l.USAGE);let a=await r(o),c=[...n];return c[s[0]]=a,c}}}function wo(e,t){let r=Number(e);if(!Number.isFinite(r))throw new m(`Invalid ${t} value "${e}"`,l.USAGE);return r}function So(e,t){let r=e.trim(),n=Number(r);if(r===""||!Number.isInteger(n)||n<0)throw new m(`Invalid ${t} value "${e}". Expected a non-negative integer.`,l.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]="b84fee06-5bbd-57f9-9643-f283d6c87afa")}catch{}})();function To(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`,l.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]="9b58b44d-819c-5115-b011-f9dfa8e2ab41")}catch{}})();var vo=3e4,ae=class extends Error{status;constructor(t,r){super(t),this.name="SearchHttpError",this.status=r}};function z(e,t,r=vo){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 F(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 Io(e){try{return(await e.text()).replaceAll(/\s+/g," ").trim()}catch(t){return`(failed to read response body: ${E(t)})`}}async function xe(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 Io(n),i=o.length>0?`: ${o}`:"";throw new ae(`${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]="8e3bb919-c8f9-50b5-8e41-b6719d17bd21")}catch{}})();function Gc(e,t){let r=b(e);if(!r)return"unconfigured";let n=b(t);return n&&n.toLowerCase()===r.toLowerCase()?"configured":"auto-detected"}function Ao(e){let t=re(e),r=t.toLowerCase();return r.endsWith("/embeddings")?t:r.endsWith("/v1")?`${t}/embeddings`:`${t}/v1/embeddings`}function vr(e){let t=e.search?.embedding_model;return b(t)||null}function Co(e){let t=b(e.providers?.openai?.base_url),r=b(e.providers?.openai?.model);if(!t||!r)return null;let n=vr(e),o=b(e.providers?.openai?.api_key);return{name:"openai",base_url:t,model:n??r,...o?{api_key:o}:{}}}function xo(e){let t=b(e.providers?.ollama?.base_url),r=b(e.providers?.ollama?.model);if(!t||!r)return null;let n=vr(e);return{name:"ollama",base_url:t,model:n??r}}function Ir(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 ko(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 Ro(e){let t=e.map((r,n)=>({embedding:r.embedding,index:r.index,position:n}));if(t.some(r=>r.index!==void 0)){for(let r of t)if(!Number.isInteger(r.index))throw new TypeError(`OpenAI embedding response entry at position ${r.position} is missing a valid integer index`);return[...t].sort((r,n)=>{let o=r.index-n.index;return o!==0?o:r.position-n.position})}return t}function _t(e){let t=Co(e),r=xo(e),n=[t,r].filter(s=>s!==null),o=b(e.search?.provider),i=o?o.toLowerCase():null;return{active:(i?n.find(s=>s.name===i):void 0)??n[0]??null,available:n}}function Tr(e){let t=re(e.base_url);return e.name==="openai"?{provider:"openai",endpoint:Ao(t),model:e.model}:{provider:"ollama",endpoint:`${t}/api/embed`,model:e.model}}function Oo(e,t){let r=Ir(t);return e.name==="openai"?{target:Tr(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:Tr(e),method:"POST",headers:{"content-type":"application/json"},body:{model:e.model,input:r}}}function Lo(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 Ro(o).map((i,s)=>{let a=i.embedding;if(!J(a))throw new Error(`OpenAI embedding response entry at index ${s} is missing a numeric embedding vector`);return[...a]})}let r=t.embedding;if(J(r))return[[...r]];let n=t.embeddings;if(Array.isArray(n)&&n.length>0)return n.map((o,i)=>{if(!J(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 Ar(e,t,r={}){let n=z(r.timeout_ms,"Embedding request"),o=F(r.fetcher,"Embedding request"),i=Ir(t),s=ko(i),a=Oo(e,s.uniqueInputs),c=await xe({endpoint:a.target.endpoint,method:a.method,headers:a.headers,body:a.body,timeoutMs:n,fetcher:o,requestLabel:"Embedding request",responseLabel:"Embedding response"}),d=Lo(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(u=>[...d[u]])}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5c86afdf-6d8d-5851-82c1-ae5bcc9f0196")}catch{}})();var ke=["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 ht(e){let t=e?.search?.corpus_fields;if(!Array.isArray(t))return[...ke];let r=new Set(ke),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:[...ke]}var Do=8e3,Mo=3200,U="...[semantic corpus truncated]",No="search_embedding_corpus_max_characters_invalid:using_provider_default";function x(e){return e.map(t=>t==null?"":String(t).trim()).filter(t=>t.length>0).join(" ")}function Po(e){return(e.reminders??[]).map(t=>x([t.at,t.text]))}function $o(e){return(e.events??[]).map(t=>x([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 zo(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 Fo(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 Jc(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??[])zo(t,r);return Fo(t,e),t.filter(r=>typeof r=="string"&&r.length>0).join(" ")}function Uo(e){let t=(e.plan_steps??[]).map(i=>x([i.order,i.id,i.title,i.body,i.status,i.owner,i.evidence,i.blocked_reason,i.superseded_by,(i.linked_items??[]).map(s=>x([s.kind,s.id,s.note])).join(" "),(i.files??[]).map(s=>x([s.path,s.note])).join(" "),(i.tests??[]).map(s=>x([s.command,s.path,s.note])).join(" "),(i.docs??[]).map(s=>x([s.path,s.note])).join(" ")])),r=(e.plan_decisions??[]).map(i=>x([i.decision,i.rationale,i.evidence,i.step_id])),n=(e.plan_discoveries??[]).map(i=>x([i.text,i.step_id])),o=(e.plan_validation??[]).map(i=>x([i.text,i.command,i.expected]));if([e.plan_mode,e.plan_scope,e.plan_harness,e.plan_resume_context,...t,...r,...n,...o].some(i=>i!==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 C(e){return typeof e=="string"&&e.trim().length>0}var Vo={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=>C(e.metadata.assignee)?e.metadata.assignee:void 0,parent:e=>C(e.metadata.parent)?e.metadata.parent:void 0,goal:e=>C(e.metadata.goal)?e.metadata.goal:void 0,value:e=>C(e.metadata.value)?e.metadata.value:void 0,why_now:e=>C(e.metadata.why_now)?e.metadata.why_now:void 0,risk:e=>C(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=>C(e.metadata.acceptance_criteria)?e.metadata.acceptance_criteria:void 0,resolution:e=>C(e.metadata.resolution)?e.metadata.resolution:void 0,expected_result:e=>C(e.metadata.expected_result)?e.metadata.expected_result:void 0,actual_result:e=>C(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=>Po(e.metadata),events:e=>$o(e.metadata),dependencies:e=>(e.metadata.dependencies??[]).map(t=>({id:t.id,kind:t.kind})),plan:e=>Uo(e.metadata)};function Cr(e,t={}){let r=t.fields??ke,n={};for(let o of r){let i=Vo[o];if(!i)continue;let s=i(e);s!==void 0&&(n[o]=s)}return n}function jo(e){return e?.trim().toLowerCase()==="ollama"?Mo:Do}function Z(e,t){let r=jo(e),n=tr(t);return n!==null?{maxCharacters:n,warning:null}:{maxCharacters:r,warning:t==null?null:No}}function gt(e,t={}){let r=JSON.stringify(Cr(e,{fields:t.fields})),n=Z(t.providerName,t.maxCharacters).maxCharacters;if(r.length<=n)return r;if(n<=U.length)return U.slice(0,n);let o=Math.max(0,n-U.length);return`${r.slice(0,o)}${U}`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="67bae1a1-19d1-50ea-816f-4b68e6bb69d9")}catch{}})();function qo(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 Ho(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 u=i.length>0?1:0;(i.length>=r||a+u+d>n)&&(o.push(i),i=[],a=s),a+=d+(i.length>0?1:0),i.push(c)}return o.push(i),o}function Yo(e,t){if(!Number.isFinite(t)||t<=0||e.length<=t)return e;let r=Math.max(0,t-U.length);return`${e.slice(0,r)}${U}`.slice(0,t)}function xr(e){let t=E(e).toLowerCase();return t.includes("timed out")||t.includes("timeout")}function Bo(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 xr(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 Go(e){return e instanceof ae?e.status===413?"payload_too_large":null:xr(e)?"timeout":null}async function yt(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 Ar(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 u=Go(d);if(u!==null&&t.length>1){s.split_batches+=1;let f=Math.ceil(t.length/2),_=t.slice(0,f),p=t.slice(f);return i.push(`search_embedding_batch_split_after_${u}:batch=${r}:size=${t.length}:parts=${_.length}|${p.length}`),[...await yt(e,_,`${r}.1`,n,o,i,s),...await yt(e,p,`${r}.2`,n,o,i,s)]}if(c<o){s.retries+=1;let f=Math.min(1e3*2**c,8e3);await new Promise(_=>setTimeout(_,f))}}throw new Error(Bo(e,r,t.length,n,o+1,a))}async function bt(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=Z(e.name,t.search.embedding_corpus_max_characters);c.warning&&a.push(c.warning);let d=qo(t,c.maxCharacters,i),u=0,f=r.map(h=>{if(h.trim().length===0)throw new TypeError("Embedding inputs must be non-empty strings");let y=Yo(h,d.maxInputCharacters);return y.length<h.length&&(u+=1),y});u>0&&a.push(`search_embedding_input_truncated:count=${u}:max_characters=${d.maxInputCharacters}`);let _=Ho(e,f,d.batchSize,d.maxRequestBytes);s.planned_batches=_.length;let p=[],g=0;for(let h=0;h<_.length;h+=1){let y=_[h];n.onProgress?.({batch_index:h+1,batch_total:_.length,batch_size:y.length,completed_inputs:g,total_inputs:f.length,phase:"start"}),p.push(...await yt(e,y,String(h+1),d.timeoutMs,d.maxRetries,a,s)),g+=y.length,n.onProgress?.({batch_index:h+1,batch_total:_.length,batch_size:y.length,completed_inputs:g,total_inputs:f.length,phase:"complete"})}return s.elapsed_ms=Math.max(1,performance.now()-o),s.inputs_per_second=r.length*1e3/s.elapsed_ms,{vectors:p,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]="88eb8555-e098-5279-801e-3b76d0dd0eae")}catch{}})();var V=`[^\\s/\\\\<>"'\\x60()\\[\\]{},;?=:#*]+`,S="[/\\\\]+",Wo="[\\p{L}\\p{N}._@-]+",j=Wo+"(?:"+S+V+")*",Re="(?:(?:home|users)"+S+j+"|root"+S+j+")",Ko="[/\\\\]"+Re,Jo="[/\\\\]{2,}"+Re,Xo="/?[a-z]:"+S+"users"+S+j,Qo=V+"(?: +"+V+")*",Et="(?:"+Qo+S+")?users"+S+j,Zo="[/\\\\]{2,}"+V+S+Et,ei="(?:[a-z]:|volume\\{[a-f0-9-]+\\}|"+V+")",Rr="[/\\\\]{2}[?.]"+S+"(?:unc"+S+V+S+Et+"|"+ei+S+"users"+S+j+")",ti="file:(?:"+Rr+"|(?:[/\\\\](?![/\\\\])|[/\\\\]{3,}|[/\\\\]{2}localhost"+S+")(?:"+Re+"|[a-z]:"+S+"users"+S+j+")|[/\\\\]{2}(?:[a-z]:"+S+"users"+S+j+"|"+V+S+"(?:"+Re+"|"+Et+")))",ri=new RegExp("(?:^|[^\\p{L}\\p{N}_./\\\\~])(?:"+Ko+"|"+Xo+"|"+ti+")|(?:^|[^\\p{L}\\p{N}_:./\\\\~])(?:"+Jo+"|"+Zo+"|"+Rr+")","giu"),kr=4,ni=/%[a-f0-9]{2}|\\(?:u[a-f0-9]{4}|x[a-f0-9]{2}|\/)/iu,oi=new TextDecoder("utf-8");function ii(e){return e.replace(/(?:%[a-f0-9]{2})+/giu,t=>oi.decode(Uint8Array.from(t.matchAll(/%([a-f0-9]{2})/giu),r=>Number.parseInt(r[1],16)))).replace(/%(?![a-f0-9]{2})[a-z0-9]{0,2}/giu,"\uFFFD")}function si(e){return e.replace(/\\+(?:u([a-f0-9]{4})|x([a-f0-9]{2})|(\/))?/giu,(t,r,n,o)=>{let i=r??n;return i===void 0?o??t:String.fromCharCode(Number.parseInt(i,16))})}function ai(e){return e.normalize("NFKC").replace(/[\p{Bidi_Control}\u200b-\u200f\u2060-\u206f\ufeff]/gu,"").replace(/[\u2215\u2044]/gu,"/").replace(/[\u043e\u041e]/gu,"o").replace(/[\u0455\u0405]/gu,"s")}function ci(e,t){for(let[r,n]of[["percent_decode",ii],["json_unescape",si],["unicode_fold",ai]]){let o=n(e);o!==e&&!t.includes(r)&&t.push(r),e=o}return e}function*di(e,t,r){let n=e,o=[];for(let i=0;i<kr;i+=1){let s=n;if(n=ci(n,o),!r){t.lastIndex=0;for(let a of n.matchAll(t))r=!0,yield{index:0,normalizations:[...o]}}if(n===s)break;i===kr-1&&ni.test(n)&&(yield{index:0,normalizations:[...o],normalization_incomplete:!0})}}function*li(e,t){let r=0;for(let n of e.split(`
|
|
9
|
-
`)){t.lastIndex=0;let o=!1;for(let i of n.matchAll(t))o=!0,yield{index:r+i.index};for(let i of di(n,t,o))yield{...i,index:r};r+=n.length+1}}var Or=[{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*(?:(?!<|\$\{|\$\(|config\.auth\.password\s*(?:\|\|\s*(?:''|"")|\?\s*unescape\(encodeURIComponent\(config\.auth\.password\)\)\s*:\s*(?:''|""))(?=[ \t]*(?:\/\*(?:[^*]|\*(?!\/))*\*\/[ \t]*)*(?:;|$|\/\/[^\r\n\u2028\u2029]*(?:\r\n)?$)))[A-Za-z0-9!@#$%^&*._+\-=]{8,}|"(?!<|\$\{|\$\()[^"]{8,}"|'(?!<|\$\{|\$\()[^']{8,}')/gi},{name:"absolute-home-path",mutationRule:"absolute_home_path",regex:ri,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*Lr(e,t){if(e.mutationRule==="absolute_home_path"){yield*li(t,e.regex);return}e.regex.lastIndex=0;for(let r of t.matchAll(e.regex))ui(e,r)&&(yield{index:r.index})}function ui(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]="d6059407-bf03-5ae8-8b01-e3e7c5b28030")}catch{}})();var mi=[{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"}],St=new Map(mi.map(e=>[e.action,e]));function wt(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)=>wt(n,`${t}[${o}]`,r)):Object.entries(e).flatMap(([n,o])=>wt(o,`${t}.${n}`,r)))}function fi(e,t){let r=Lr(e,t),n=r.next().value;if(!n||e.mutationRule!=="absolute_home_path"||n.normalization_incomplete)return n;for(let o of r)if(o.normalization_incomplete)return{...n,normalizations:[...new Set([n.normalizations,o.normalizations].flatMap(i=>i??[]))],normalization_incomplete:!0};return n}function Dr(e){let t=[];for(let r of wt(e))for(let n of Or){let o=fi(n,r.value);if(o){let i={rule:n.mutationRule,path:r.path};o.normalizations&&(i.normalizations=o.normalizations),o.normalization_incomplete&&(i.normalization_incomplete=!0),t.push(i)}}return t.filter((r,n,o)=>o.findIndex(i=>i.rule===r.rule&&i.path===r.path)===n)}function pi(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.",l.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=Dr(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.`,l.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 _i(e){return St.has(e.trim().toLowerCase())}function hi(){return[...St.keys()].sort((e,t)=>e.localeCompare(t))}function ad(e){return St.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]="5767332d-8094-55cd-96e9-47c5d20cd7df")}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 Tt(e){return e.trim().toLowerCase().replace(/\s+/g," ")}function Nr(e){return[...new Set(Tt(e).match(/[\p{L}\p{N}]+/gu)??[])]}function Mr(e){let t=Tt(e);return{normalized:t,tokens:Nr(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 bi(e,t){return Ei(Mr(e),Mr(t))}function Ei(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:_e(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]="a7cd1d62-16fe-5e5b-b382-64335fc5e403")}catch{}})();function Oe(e){return(e??"in_progress").trim().toLowerCase().replaceAll("-","_")}function Si(e,t){return[e.updated_at,t].map(r=>({value:r,time:Date.parse(r??"")})).filter(r=>typeof r.value=="string"&&Number.isFinite(r.time)).sort((r,n)=>n.time-r.time)[0]?.value??e.updated_at}function Pr(e,t){let r=Math.max(1,Math.trunc(t.threshold_hours)),n=(t.now??new Date).getTime(),o=Oe(t.in_progress_status),i=[];for(let s of e){if(Oe(String(s.status))!==o||(s.assignee?.trim().length??0)>0)continue;let a=Si(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 Ti(e,t,r){let n=new Map;return await Promise.all(t.filter(o=>Oe(String(o.status))===Oe(r.in_progress_status)&&(o.assignee?.trim().length??0)===0).map(async o=>{let i;try{i=await st(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)})),Pr(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]="42b217a3-31c0-561a-b7cb-b1a584b2edd5")}catch{}})();var vi=new Set(["rename-type","rename-field","remap-status",...nr]);function Ii(e,t){if(t&&!vi.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.`,l.USAGE,{code:"invalid_argument_value",examples:["pm schema rename-type Spike --to Experiment --dry-run"]})}(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]="ccb1b39b-3dde-511b-8133-d4747bb6e55e")}catch{}})();function Td(e){try{return e()}catch(t){throw!(t instanceof m)||t.exitCode!==l.USAGE?t:new m(`${t.message} No changes were made.`,l.USAGE,{...t.context,code:t.code==="linked_test_command_not_executable"?t.code:"invalid_argument_value",reason:"test_option_invalid",changed:!1,required:t.context.required??t.message})}}function Ai(e,t){if(e[t]==="'"){let r=e.indexOf("'",t+1);return r<0?void 0:r+1}for(let r=t+1;r<e.length;r+=1){if(e[r]==='"')return r+1;if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"||e.startsWith("$(",r))return}}function Ci(e,t){let r=t;for(;r<e.length;){let n=e[r];if(/\s/u.test(n)||";&|".includes(n))return r;if(n==="\\"){r+=2;continue}if(n==="'"||n==='"'){let o=Ai(e,r);if(o===void 0)return;r=o;continue}if("<>()`".includes(n))return;r+=1}return r===e.length?r:void 0}function vt(e,t){let r=t;for(;r<e.length;){if(/\s/u.test(e[r])){r+=1;continue}if(e[r]!=="#")return r;let n=e.indexOf(`
|
|
10
|
-
`,r);if(n<0)return e.length;r=n+1}return r}function xi(e,t){let r=vt(e,t),n=e[r];return n===void 0||!";&|".includes(n)?r:(r+=1,n!==";"&&e[r]===n&&(r+=1),vt(e,r))}function ki(e){let t=e.trim(),r=vt(t,0);if(t.length===0)return!1;for(;r<t.length;){if(!/[A-Za-z_]/u.test(t[r]))return!1;let n=r+1;for(;n<t.length&&/[A-Za-z0-9_]/u.test(t[n]);)n+=1;if(t[n]!=="=")return!1;let o=Ci(t,n+1);if(o===void 0)return!1;r=xi(t,o)}return!0}function $r(e){if(!(e===void 0||!ki(e)))throw new m("Linked-test command contains only variable assignments or comments and has no executable command.",l.USAGE,{code:"linked_test_command_not_executable",required:'Supply an actual test command with --add "command=<actual command>" or --add-json. Environment assignments may precede that command.',examples:['pm test <id> --add "command=node --version"'],nextSteps:["Remove any already-stored assignment-only entry with --remove-index, then register the actual test command."]})}function vd(e){if($r(e.command),!(e.pm_context_mode!=="none"||e.workspace_context_mode==="isolated"||e.workspace_context_mode==="snapshot"))throw new m("pm_context_mode=none requires workspace_context_mode=isolated or snapshot so implicit tracker discovery cannot reach the source workspace.",l.USAGE,{code:"linked_test_context_invalid",required:"Set workspace_context_mode to isolated or snapshot when pm_context_mode is none.",examples:[sr(["test","<id>","--add-json",JSON.stringify({command:e.command,pm_context_mode:"none",workspace_context_mode:"isolated"})])]})}function Id(e,t){return e.command===t.command&&e.path===t.path&&e.scope===t.scope&&e.pm_context_mode===t.pm_context_mode&&e.workspace_context_mode===t.workspace_context_mode}var Le=["command","cmd","path","scope","timeout","timeout_seconds","pm_context_mode","workspace_context_mode","env_set","env_clear","shared_host_safe","assert_stdout_contains","assert_stdout_regex","assert_stderr_contains","assert_stderr_regex","assert_stdout_min_lines","assert_json_field_equals","assert_json_field_gte","note"],Ri=new Set(Le);function Ad(e){return hr(e,Le)}function Oi(e,t){let r={},n=[];for(let[o,i]of Object.entries(e)){let s=o.toLowerCase();if(!Ri.has(s)){n.push(o);continue}if(Object.hasOwn(r,s))throw new m(`${t} provides key "${o}" more than once after case normalization`,l.USAGE);r[s]=i}if(n.length>0)throw new m(`${t} does not recognize key${n.length>1?"s":""} ${n.map(o=>`"${o}"`).join(", ")}. Allowed keys: ${Le.join(", ")}.`,l.USAGE);if(r.cmd!==void 0){if(r.command!==void 0&&r.command.trim()!==r.cmd.trim())throw new m(`${t} command and cmd must match when both are provided`,l.USAGE);let{cmd:o,...i}=r;return{...i,command:i.command??o}}return 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]="b58016fa-9817-5421-a4a3-78d1b1d22937")}catch{}})();import{readFile as Li}from"node:fs/promises";import zr 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]="7cc00705-c03e-5a18-9bec-af2585939ed8")}catch{}})();function Yd(e){if(e!==void 0){if(typeof e!="string")throw new m("--rollback requires a non-empty checkpoint ID string",l.USAGE);return Fr(e)}}function Fr(e){let t=e.trim();if(!t)throw new m("--rollback requires a non-empty checkpoint ID",l.USAGE);if(!/^[a-zA-Z0-9._-]+$/.test(t))throw new m("--rollback checkpoint ID must match [a-zA-Z0-9._-]+",l.USAGE);return t}function Di(e,t){let r=t.replace(/[-:.TZ]/g,"").slice(0,14),n=Math.random().toString(36).slice(2,8);return`${e}-${r}-${n}`}function Mi(e,t){return zr.join(e,"checkpoints",t)}function Ur(e,t,r){return zr.join(Mi(e,t),`${r}.json`)}async function Ni(e,t,r,n){let o=Ur(e,t,r),i=`${JSON.stringify(n,null,2)}
|
|
11
|
-
`;if(!await or(o,i)&&await T(o)!==i)throw new m(`Checkpoint ${r} already exists with different contents; use a new checkpoint ID.`,l.CONFLICT);return o}function Pi(e,t){if(!Array.isArray(e.items))throw new m(`Checkpoint ${t} is missing items`,l.GENERIC_FAILURE);return e.items.map(r=>{if(!r||typeof r!="object")throw new m(`Checkpoint ${t} contains an invalid item entry`,l.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`,l.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`,l.GENERIC_FAILURE);return{id:n.id.trim(),target_updated_at:n.target_updated_at.trim()}})}async function $i(e,t,r,n){let o=Fr(r),i=Ur(e,t,o);if(!await W(i))throw new m(`Checkpoint ${o} not found`,l.NOT_FOUND);let s=await Li(i,"utf8"),a;try{a=JSON.parse(s)}catch(u){throw new m(`Checkpoint ${o} contains invalid JSON: ${E(u)}`,l.GENERIC_FAILURE)}if(!a||typeof a!="object")throw new m(`Checkpoint ${o} is invalid`,l.GENERIC_FAILURE);let c=a;if(c.schema_version!==n)throw new m(`Checkpoint ${o} has unsupported schema version. Inspect pm history and use an explicit pm restore only after reviewing later edits.`,l.GENERIC_FAILURE);let d=Pi(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 zi(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:i.skipped?"skipped":"restored",changed_fields:i.changed_fields,warnings:i.warnings}),i.skipped||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]="cb883ffc-c431-5bf9-a973-931a8a0a940c")}catch{}})();function N(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t.length>0?t:null}function Gd(e,t){let r=N(t);return!e||!r?null:[...e.assurance_providers??[]].reverse().find(n=>N(n.definition.id)===r)??null}function Fi(e,t){let r=N(t);return!e||!r?null:[...e.search_providers].reverse().find(n=>(N(n.runtime_definition?.name)??N(n.definition?.name))===r)??null}function Ui(e,t){let r=N(t);return!e||!r?null:[...e.vector_store_adapters].reverse().find(n=>(N(n.runtime_definition?.name)??N(n.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]="4441095d-0acd-5780-8758-7df94396cb8e")}catch{}})();function It(e){return[...new Set(e.split(/[,\r\n]+/).map(t=>t.trim()).filter(t=>t.length>0))]}function Vi(e){let t=[];for(let n of e)if(typeof n=="string")t.push(n);else if(typeof n=="number"&&Number.isFinite(n))t.push(String(n));else return"";let r=It(t.join(`
|
|
12
|
-
`));return r.length>0?r.join(","):""}function ji(e){if(e===void 0)return;if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(Array.isArray(e))return Vi(e);if(typeof e!="string")return"";let t=It(e);return t.length>0?t.join(","):""}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1dcf0d72-10da-51b6-b9f6-ab47bebcbf64")}catch{}})();function Vr(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function At(e){if(e==="/body"||e.startsWith("/body/"))return"body";if(e==="/metadata"||e.startsWith("/metadata/")||e==="/front_matter"||e.startsWith("/front_matter/")){let r=e.replace(/^\/(?:metadata|front_matter)\/?/,"").split("/")[0];return r?Vr(r):"metadata"}let t=e.replace(/^\//,"").split("/")[0];return t?Vr(t):"root"}function De(e,t){return t==="body"?e.body:t==="metadata"?e.metadata:t==="root"?e:e.metadata[t]}function qi(e,t){let r=t?.windowStartIndex??0,n=t?.field;if(e.length===0||r>=e.length)return[];let o=cr(),i=[];for(let s=0;s<e.length;s+=1){let a=e[s],c=o,d=dr(o,a.patch),u;d.ok?(u=d.document,o=u):u=c;let f=new Set;for(let p of a.patch)f.add(At(p.path)),p.from!==void 0&&f.add(At(p.from));let _=[...f].sort((p,g)=>p.localeCompare(g));if(s>=r)if(n!==void 0){if(!f.has(n))continue;let p={field:n,before:De(c,n),after:De(u,n)};i.push({index:s+1,ts:a.ts,op:a.op,author:a.author,patch_ops:a.patch.length,changed_fields:[n],changes:[p]})}else{let p=_.map(g=>({field:g,before:De(c,g),after:De(u,g)}));i.push({index:s+1,ts:a.ts,op:a.op,author:a.author,patch_ops:a.patch.length,changed_fields:_,changes:p})}}return 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]="80805c6b-9b9a-5dad-b94b-d7dbd365fe5e")}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]="2fd342e6-06cc-56d4-aa0e-2af269234b59")}catch{}})();var Hi=new Set(["none","null","undefined"]);function cl(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="warn"||t==="strict_error")return t;if(t==="strict")return"strict_error";throw new m("Config set parent-reference-policy requires --policy with one of: warn, strict_error (alias: strict)",l.USAGE)}function Yi(e){if(typeof e!="string")throw new m("--parent must be a string. Use --unset parent to clear this field.",l.USAGE);let t=e.trim();if(t.length===0)throw new m("--parent must not be empty. Use --parent none to unset.",l.USAGE);if(jr(t))throw new m(`--parent must not use placeholder token "${t}". Use --unset parent to clear this field.`,l.USAGE);return t}function jr(e){return Hi.has(e.trim().toLowerCase())}function Bi(e,t){if(t==="strict_error")throw new m(`Parent item "${e}" was not found. Create it first or use --parent none.`,l.USAGE);return{warnings:[`validation_warning:parent_reference_missing:${e}`]}}function Gi(e,t,r){let n=be(e,r),o=be(t,r);if(n!==o)return;let i=t!==o||e!==n?` (normalized from parent "${t}" and item "${e}")`:"";throw new m(`Parent item "${o}" cannot be the same as item "${n}"${i}. Use --unset parent to clear this field.`,l.USAGE)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a59d5b7f-9764-53c5-a014-1119868be8ea")}catch{}})();var Ct={critical:0,high:1,medium:2,low:3,minimal:4},qr=Object.keys(Ct),Wi=`numbers 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal) or names (${qr.join(", ")}), case-insensitive`;function Me(e){return new m(`Invalid priority "${e}". Accepted values: ${Wi}.`,l.USAGE,{code:"invalid_argument_value",field:"priority",value:e,allowed:["0","1","2","3","4",...qr]})}function Ki(e){if(typeof e=="number"){if(Number.isInteger(e)&&e>=0&&e<=4)return e;throw Me(String(e))}if(typeof e!="string")throw Me(String(e));let t=e.trim();if(t.length===0)throw Me(e);let r=t.toLowerCase();if(Object.prototype.hasOwnProperty.call(Ct,r))return Ct[r];if(/^[0-4]$/.test(t))return Number(t);throw Me(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e363ee89-b438-5c8e-bb06-f4d05cc814cc")}catch{}})();function Ji(e){return ie(se(Ae(e,{...e})))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b6206b0e-0cd8-5827-acbd-6ac064dbcad7")}catch{}})();var Xi=/^[A-Za-z0-9][A-Za-z0-9._/-]*$/,Qi=64;function yl(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="warn"||t==="strict_error")return t;if(t==="strict")return"strict_error";throw new m("Config set sprint-release-format-policy requires --policy with one of: warn, strict_error (alias: strict)",l.USAGE)}function Zi(e,t,r){let n=t.trim();if(n.length===0)throw new m(`--${e} must not be empty. Use --${e} none to unset.`,l.USAGE);if(n.length<=Qi&&Xi.test(n))return{value:n,warnings:[]};let o="Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._/-]* (no spaces).";if(r==="strict_error")throw new m(`Invalid --${e} value "${n}". ${o}`,l.USAGE);return{value:n,warnings:[`validation_warning:${e}_format:${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]="14e6c7b4-3161-5f82-b797-f06a879d1370")}catch{}})();var Hr={open:"open_status",closed:"close_status",canceled:"canceled_status",cancelled:"canceled_status"},Yr="all";function vl(e){if(typeof e!="string")return!1;let t=e.split(",").map(r=>r.trim().toLowerCase()).filter(r=>r.length>0);return t.length===1&&t[0]===Yr}function es(e,t){let r=e.trim().toLowerCase();if(r.length===0)return;let n=Hr[r];return n?t[n]:ot(e,t)}function ts(e){let t=new Set(Object.keys(Hr));for(let r of e.definitions){t.add(r.id);for(let n of r.aliases)t.add(n)}return[...t]}function rs(e,t){let r=e.trim().toLowerCase(),n,o=Number.POSITIVE_INFINITY;for(let i of ts(t)){let s=Xe(r,i.toLowerCase(),2);s!==null&&s<o&&(n=i,o=s)}return n}function ns(e,t,r){if(typeof e!="string")return;let n=r?.strict===!0,o=r?.flagLabel??"--status",i=e.split(",").map(a=>a.trim()).filter(a=>a.length>0);if(i.length===0)return;if(i.filter(a=>a.trim().toLowerCase()===Yr).length>0){if(i.length===1)return;throw new m(`Invalid ${o} value "all". Use it by itself, or omit ${o} to search every status.`,l.USAGE)}let s=[];for(let a of i){let c=es(a,t);if(c===void 0){if(n){let d=rs(a,t);throw new m(`Invalid ${o} value "${a}". Use open|closed|canceled or a configured status id${d?`. Did you mean "${d}"?`:"."}`,l.USAGE)}s.push(a);continue}s.push(c)}return[...new Set(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]="50f77f3f-b2b0-5ae2-b669-6ed50bbdd530")}catch{}})();var os={bug:"Issue",bugfix:"Issue",defect:"Issue",incident:"Issue",enhancement:"Feature",story:"Feature",userstory:"Feature","user-story":"Feature","user story":"Feature",change:"Chore",ticket:"Task",todo:"Task"};function is(e){if(e!==void 0)return os[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]="c628dcf9-d98f-566e-9f93-cc81e737691c")}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]="4b79bd02-51ae-5c46-be4c-2f41dd8c9486")}catch{}})();function Br(e,t){return oe(e,t)}function ss(e,t,r){let n={};for(let o of t.command_to_fields.get(r)??[]){let i=nt(e,o);i!==void 0&&(n[o.metadata_key]=ar(o,i))}return n}function as(e,t){for(let[r,n]of Object.entries(t)){let o=e[r];if(Array.isArray(n)){if(Array.isArray(o)){let i=o.map(s=>String(s));if(!n.map(s=>String(s)).every(s=>i.includes(s)))return!1;continue}if(!Br(o,n[n.length-1]))return!1;continue}if(!Br(o,n))return!1}return!0}import{spawnSync as Wr}from"node:child_process";(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]="7889f11f-36f9-5384-8429-58d951c342da")}catch{}})();var cs="PM_DISABLE_OLLAMA_AUTO_DEFAULTS",ds="PM_OLLAMA_MODEL",ls="http://localhost:11434",us="qwen3-embedding:0.6b",ms=".agents/pm/search/lancedb/",fs=1500,ps=2500,_s=/qwen.*(?:embed|embedding)|(?:embed|embedding).*qwen/i,hs=/embed|embedding/i,k=b;function gs(){let e=k(process.env[cs]);if(!e)return!1;let t=e.toLowerCase();return t==="1"||t==="true"||t==="yes"}function Gr(e){return e.some(t=>k(t)!==null)}function ys(e){let t=k(e);return!!(t&&t.toLowerCase()!=="ollama")}function bs(e){let t=k(e);return!!(t&&t.toLowerCase()!=="lancedb")}function Es(e){return ys(e.search?.provider)||bs(e.vector_store?.adapter)||Gr([e.providers?.openai?.base_url,e.providers?.openai?.model,e.providers?.openai?.api_key])?!0:Gr([e.vector_store?.qdrant?.url,e.vector_store?.qdrant?.api_key])}function ws(){let e=Wr("ollama",["--version"],{encoding:"utf8",timeout:fs});return e.error?!1:e.status===0}function Ss(e){let t=e.split(/\r?\n/).map(n=>n.trim()).filter(n=>n.length>0);if(t.length===0)return null;let r=t.map(n=>n.split(/\s+/)[0]?.trim()).filter(n=>!!(n&&n.length>0)).filter(n=>n.toUpperCase()!=="NAME");return r.length===0?null:r.find(n=>_s.test(n))||(r.find(n=>hs.test(n))??null)}function Ts(e){let t=k(e.providers?.ollama?.model);if(t)return t;let r=k(process.env[ds]);if(r)return r;let n=Wr("ollama",["list"],{encoding:"utf8",timeout:ps});if(!n.error&&n.status===0){let o=Ss(typeof n.stdout=="string"?n.stdout:"");if(o)return o}return null}function vs(e){return{baseUrl:k(e.providers?.ollama?.base_url)===null,model:k(e.providers?.ollama?.model)===null,lancedbPath:k(e.vector_store?.lancedb?.path)===null,embeddingModel:k(e.search?.embedding_model)===null}}function Is(e){return e.baseUrl||e.model||e.lancedbPath||e.embeddingModel}function As(e,t,r){if(!t.baseUrl&&!t.model)return;let n=e.providers??={},o=n.ollama??={};t.baseUrl&&(o.base_url=ls),t.model&&(o.model=r)}function Cs(e,t){if(!t.lancedbPath)return;let r=e.vector_store??={},n=r.lancedb??={};n.path=ms}function xs(e,t,r){if(!t.embeddingModel)return;let n=e.search??={};n.embedding_model=r}function Ne(e){let t={settings:e,auto_ollama_defaults_applied:!1};if(gs()||Es(e))return t;let r=vs(e);if(!Is(r)||r.model&&!ws())return t;let n=structuredClone(e),o=Ts(n);return o?(As(n,r,o),Cs(n,r),xs(n,r,o),{settings:n,auto_ollama_defaults_applied:!0}):{...t,auto_ollama_defaults_skipped_reason:"no_installed_embedding_model",auto_ollama_defaults_remediation:`Run ollama pull ${us} or configure providers.ollama.model explicitly (and search.embedding_model if you need an override).`}}(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]="9ecff496-8afa-5cfc-9178-2be8bd403978")}catch{}})();var ks="reindex";import nn from"node:path";import{mkdir as Rs,readFile as Os,stat as Rt,unlink as Ls}from"node:fs/promises";import{basename as Jr,dirname as xt,isAbsolute as Ds,join as Ms,resolve as Ot}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]="b5f2e49a-fb72-554b-b0a8-dca0adee71f4")}catch{}})();var Lt="pm_items",Ns=/[^a-zA-Z0-9_-]/g,Ps=128,$s=".pm-cli-local-vectors",kt=1,q=new Map;function de(e){return(b(e.collection_name)??Lt).replaceAll(Ns,"_").slice(0,Ps)}function Pe(e){if(!J(e)||e.length===0)throw new Error("Vector values must be a non-empty numeric array");return[...e]}function Qr(e){if(!Number.isFinite(e)||e<=0)throw new Error("Vector query limit must be a positive number");return Math.floor(e)}function zs(e){let t=e.result;if(!Array.isArray(t))throw new TypeError("Qdrant query response must include a result array");let r=t.map((n,o)=>{let i=n.id,s=typeof i=="number"?String(i):i,a=b(s);if(!a)throw new Error(`Qdrant query response entry at index ${o} is missing a non-empty id`);let c=n.score;if(typeof c!="number"||!Number.isFinite(c))throw new TypeError(`Qdrant query response entry at index ${o} is missing a finite numeric score`);let d=n.payload;if(d!==void 0&&(typeof d!="object"||d===null||Array.isArray(d)))throw new Error(`Qdrant query response entry at index ${o} must provide payload as an object when set`);return{id:a,score:c,...d?{payload:d}:{}}});return r.sort((n,o)=>n.score!==o.score?o.score-n.score:n.id.localeCompare(o.id)),r}function Dt(e){let t=b(e.result?.status);if(t)return{status:t};let r=b(e.status);if(r)return{status:r};throw new Error("Qdrant upsert response must include status metadata")}async function ce(e,t,r,n,o){return await xe({endpoint:e,method:t.method,headers:t.headers,body:t.body,timeoutMs:r,fetcher:n,requestLabel:`Vector ${o} request`,responseLabel:`Vector ${o} response`})}function Fs(e){let t=b(e.vector_store?.qdrant?.url);if(!t)return null;let r=b(e.vector_store?.collection_name),n=b(e.vector_store?.qdrant?.api_key);return{name:"qdrant",url:t,...r&&r!==Lt?{collection_name:r}:{},...n?{api_key:n}:{}}}function Us(e){let t=Ot(e),r=xt(t);return Jr(t)==="pm"&&Jr(r)===".agents"?xt(r):t}function Vs(e,t){return!t||Ds(e)?e:Ot(Us(t),e)}function js(e,t){let r=b(e.vector_store?.lancedb?.path);if(!r)return null;let n=b(e.vector_store?.collection_name);return{name:"lancedb",path:Vs(r,t),...n&&n!==Lt?{collection_name:n}:{}}}function qs(e){if(!Array.isArray(e)||e.length===0)throw new Error("Vector upsert records must include at least one entry");return e.map((t,r)=>{let n=b(t.id);if(!n)throw new Error(`Vector upsert record at index ${r} is missing a non-empty id`);let o=Pe(t.vector),i=t.payload;if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new Error(`Vector upsert record at index ${r} must provide payload as an object when set`);return{id:n,vector:o,...i?{payload:i}:{}}})}function Hs(e){if(!Array.isArray(e)||e.length===0)throw new Error("Vector delete ids must include at least one entry");let t=e.map((n,o)=>{let i=b(n);if(!i)throw new Error(`Vector delete id at index ${o} is missing a non-empty value`);return i}).sort((n,o)=>n.localeCompare(o)),r=[];for(let n of t)r.at(-1)!==n&&r.push(n);return r}function Ys(e){return e.replace(/\/points\?wait=true$/,"/points/delete?wait=true")}function Bs(e){return e.replace(/\/points\?wait=true$/,"")}function $e(e){return{"content-type":"application/json",...e.api_key?{"api-key":e.api_key}:{}}}function ze(e,t){return ee(e,t)}function ee(e,t){return Ms(Ot(e),$s,`${t}.json`)}function Gs(e,t,r){let n=b(e.id);if(!n)throw new Error(`LanceDB local snapshot '${r}' record at index ${t} is missing a non-empty id`);let o=Pe(e.vector),i=e.payload;if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new Error(`LanceDB local snapshot '${r}' record '${n}' must provide payload as an object when set`);return{id:n,vector:o,...i?{payload:i}:{}}}function Ws(e,t,r){let n;try{n=JSON.parse(r)}catch(a){throw new Error(`LanceDB local snapshot at '${e}' is not valid JSON: ${E(a)}`)}if(typeof n!="object"||n===null||Array.isArray(n))throw new Error(`LanceDB local snapshot at '${e}' must be a JSON object`);if(n.version!==kt)throw new Error(`LanceDB local snapshot at '${e}' must include version=${kt}`);let o=b(n.table);if(!o)throw new Error(`LanceDB local snapshot at '${e}' must include a non-empty table value`);if(o!==t)throw new Error(`LanceDB local snapshot at '${e}' table mismatch: expected '${t}', received '${o}'`);let i=n.records;if(!Array.isArray(i))throw new TypeError(`LanceDB local snapshot at '${e}' must include a records array`);let s=new Map;for(let a=0;a<i.length;a+=1){let c=Gs(i[a],a,e);s.set(c.id,c)}return s}async function Ks(e){try{let t=await Rt(e);return{mtimeMs:t.mtimeMs,size:t.size}}catch(t){if(!K(t))throw t;return null}}function Js(e,t){if(!t)return null;if(t.mtimeMs===null&&t.size===null&&t.records.size===0)return t.records;let r=new Map;return q.set(e,{records:r,mtimeMs:null,size:null}),r}function Xs(e,t){return e!==void 0&&t!==null&&e.mtimeMs===t.mtimeMs&&e.size===t.size}async function Mt(e,t){let r=ze(e,t),n=ee(e,t),o=await Ks(n),i=q.get(r);if(!o){let a=Js(r,i);if(a)return a}if(Xs(i,o))return i.records;let s=new Map;try{let a=await Os(n,"utf8");s=Ws(n,t,a)}catch(a){if(!K(a))throw a}return q.set(r,{records:s,mtimeMs:o?.mtimeMs??null,size:o?.size??null}),s}function Qs(e){let t=[...e.values()];return t.sort((r,n)=>r.id.localeCompare(n.id)),t.map(r=>({id:r.id,vector:[...r.vector],...r.payload?{payload:r.payload}:{}}))}async function Zr(e){try{await Ls(e)}catch(t){if(!K(t))throw new Error(`LanceDB local snapshot delete failed at '${e}': ${E(t)}`)}}async function en(e,t,r){let n=ee(e,t);if(r.size===0){await Zr(n);return}let o=xt(n);try{await Rs(o,{recursive:!0})}catch(s){throw new Error(`LanceDB local snapshot directory create failed at '${o}': ${E(s)}`)}let i=`${JSON.stringify({version:kt,table:t,records:Qs(r)})}
|
|
13
|
-
`;try{await v(n,i)}catch(s){throw new Error(`LanceDB local snapshot write failed at '${n}': ${E(s)}`)}}async function Zs(e,t){let r=ze(e,t),n=ee(e,t);await Zr(n),q.delete(r)}function Xr(e){let t=0;for(let r=0;r<e.length;r+=1)t+=e[r]*e[r];return Math.sqrt(t)}function ea(e,t){let r=0;for(let i=0;i<e.length;i+=1)r+=e[i]*t[i];let n=Xr(e),o=Xr(t);return n===0||o===0?0:r/(n*o)}function Nt(e,t){let r=Fs(e),n=js(e,t),o=[r,n].filter(a=>a!==null),i=b(e.vector_store?.adapter),s=i?i.toLowerCase():null;return{active:(s?o.find(a=>a.name===s):void 0)??o[0]??null,available:o}}function Fe(e){let t=de(e);if(e.name==="qdrant"){let o=re(e.url),i=encodeURIComponent(t);return{store:"qdrant",query_target:`${o}/collections/${i}/points/search`,upsert_target:`${o}/collections/${i}/points?wait=true`}}let r=encodeURIComponent(e.path),n=encodeURIComponent(t);return{store:"lancedb",query_target:`lancedb://${r}#${n}`,upsert_target:`lancedb://${r}#${n}`}}function ta(e,t,r){let n=Fe(e),o=Pe(t),i=Qr(r);return e.name==="qdrant"?{target:n,method:"POST",headers:$e(e),body:{vector:o,limit:i,with_payload:!0}}:{target:n,method:"LOCAL",headers:{},body:{table:de(e),vector:o,limit:i}}}function ra(e,t){let r=Fe(e),n=qs(t);return e.name==="qdrant"?{target:r,method:"POST",headers:$e(e),body:{points:n}}:{target:r,method:"LOCAL",headers:{},body:{table:de(e),records:n}}}function na(e,t){let r=Fe(e),n=Hs(t);return e.name==="qdrant"?{target:r,method:"POST",headers:$e(e),body:{points:n}}:{target:r,method:"LOCAL",headers:{},body:{table:de(e),ids:n}}}async function Gl(e,t,r,n={}){let o=ta(e,t,r);if(o.method==="LOCAL"){let c=e,d=o.body,u=await Mt(c.path,d.table);if(u.size===0)return[];let f=Pe(d.vector),_=Qr(d.limit),p=[],g=0;for(let h of u.values()){if(h.vector.length!==f.length){g++;continue}p.push({id:h.id,score:ea(f,h.vector),...h.payload?{payload:h.payload}:{}})}return g>0&&n.warnings&&n.warnings.push(`vector_dimension_mismatch:${g} records skipped (expected ${f.length} dimensions)`),p.sort((h,y)=>h.score!==y.score?y.score-h.score:h.id.localeCompare(y.id)),p.slice(0,_)}let i=z(n.timeout_ms,"Vector request"),s=F(n.fetcher,"Vector request"),a=await ce(o.target.query_target,{method:"POST",headers:o.headers,body:o.body},i,s,"query");return zs(a)}async function Pt(e,t,r={}){let n=ra(e,t);if(n.method==="LOCAL"){let a=e,c=n.body,d=ze(a.path,c.table),u=await Mt(a.path,c.table);for(let p of c.records)u.set(p.id,p);await en(a.path,c.table,u);let f=ee(a.path,c.table),_=await Rt(f);return q.set(d,{records:u,mtimeMs:_.mtimeMs,size:_.size}),{status:"ok"}}let o=z(r.timeout_ms,"Vector request"),i=F(r.fetcher,"Vector request"),s=await ce(n.target.upsert_target,{method:"POST",headers:n.headers,body:n.body},o,i,"upsert");return Dt(s)}async function Ue(e,t,r={}){let n=na(e,t);if(n.method==="LOCAL"){let a=e,c=n.body,d=ze(a.path,c.table),u=await Mt(a.path,c.table);if(u.size===0)return{status:"ok"};for(let f of c.ids)u.delete(f);if(await en(a.path,c.table,u),u.size===0)q.delete(d);else{let f=ee(a.path,c.table),_=await Rt(f);q.set(d,{records:u,mtimeMs:_.mtimeMs,size:_.size})}return{status:"ok"}}let o=z(r.timeout_ms,"Vector request"),i=F(r.fetcher,"Vector request"),s=await ce(Ys(n.target.upsert_target),{method:"POST",headers:n.headers,body:n.body},o,i,"delete");return Dt(s)}async function tn(e,t=[],r={},n){if(e.name==="lancedb")return await Zs(e.path,de(e)),{status:"ok"};if(n!==void 0){if(!Number.isInteger(n)||n<=0)throw new Error("Vector reset dimension must be a positive integer when provided");let i=Fe(e),s=Bs(i.upsert_target),a=z(r.timeout_ms,"Vector request"),c=F(r.fetcher,"Vector request"),d=$e(e);try{await ce(s,{method:"DELETE",headers:d,body:{}},a,c,"delete")}catch(f){if(!E(f).includes("failed with status 404"))throw f}let u=await ce(s,{method:"PUT",headers:d,body:{vectors:{size:n,distance:"Cosine"}}},a,c,"upsert");return Dt(u)}let o=t.map(i=>i.trim()).filter(i=>i.length>0);return o.length===0?{status:"ok"}:await Ue(e,o,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]="f8acaac5-64f7-5e22-987e-4eb12a1aa1cf")}catch{}})();function Ve(e,t){let r=b(e),n=b(t);return!r||!n?null:{provider:r,model:n}}function rn(e){if(e==null)return null;if(typeof e!="object"||Array.isArray(e))throw new Error("Vectorization embedding metadata must be an object when set");let t=Ve(e.provider,e.model),r=e.vector_dimension;if(!t||typeof r!="number"||!Number.isInteger(r)||r<=0)throw new Error("Vectorization embedding metadata must include provider, model, and positive vector_dimension");return{...t,vector_dimension:r}}function $t(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("Vectorization embedding metadata requires a positive vector dimension");return{provider:e.provider,model:e.model,vector_dimension:t}}function zt(e,t){return!e||e.provider!==t.provider||e.model!==t.model}function Ft(e,t){return!!(e&&e.vector_dimension!==t)}function Ut(e,t){if(e.length===0)throw new Error(`${t} returned no vectors`);let r=e[0].length;if(!Number.isInteger(r)||r<=0)throw new Error(`${t} returned an empty vector`);for(let n=1;n<e.length;n+=1)if(e[n]?.length!==r)throw new Error(`${t} returned mixed vector dimensions`);return 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]="7113dff5-c8e0-5ba6-b0ae-2ff849ed94df")}catch{}})();var on="search/vectorization-status.json";function ue(e){return[...new Set([...e].map(t=>t.trim()).filter(t=>t.length>0))].sort((t,r)=>t.localeCompare(r))}function sn(e){return typeof e=="string"&&e.trim().length>0&&Number.isFinite(Date.parse(e))}function an(e){let t=new Map;for(let[r,n]of Object.entries(e)){let o=r.trim();o.length===0||!sn(n)||t.set(o,n)}return Object.fromEntries([...t.entries()].sort((r,n)=>r[0].localeCompare(n[0])))}async function cn(e){let t=nn.join(e,on),r=await T(t);if(r===null||r.trim().length===0)return{entries:{},embedding:null,warnings:[]};let n;try{n=JSON.parse(r)}catch{return{entries:{},embedding:null,warnings:["search_vectorization_status_ledger_invalid"]}}if(typeof n!="object"||n===null||n.version!==1||!Array.isArray(n.items))return{entries:{},embedding:null,warnings:["search_vectorization_status_ledger_invalid"]};let o=new Map;for(let s of n.items){if(typeof s!="object"||s===null)return{entries:{},embedding:null,warnings:["search_vectorization_status_ledger_invalid"]};let a=s.id,c=s.updated_at;if(typeof a!="string"||a.trim().length===0||!sn(c))return{entries:{},embedding:null,warnings:["search_vectorization_status_ledger_invalid"]};o.set(a.trim(),c)}let i=null;try{i=rn(n.embedding)}catch{return{entries:{},embedding:null,warnings:["search_vectorization_status_ledger_invalid"]}}return{entries:Object.fromEntries([...o.entries()].sort((s,a)=>s[0].localeCompare(a[0]))),embedding:i,warnings:[]}}async function dn(e,t,r){let n=an(t),o=nn.join(e,on),i=`${JSON.stringify({version:1,generated_at:M(),...r?{embedding:r}:{},items:Object.entries(n).map(([s,a])=>({id:s,updated_at:a}))},null,2)}
|
|
14
|
-
`;await v(o,i)}function oa(e){return{id:e.id,type:e.type,status:e.status,priority:e.priority,updated_at:e.updated_at}}function ia(e){let t=Ve(e.name,e.model);if(!t)throw new Error("Embedding provider must include a provider name and model");return t}function le(e,t){return{refreshed:[],skipped:e,warnings:[t]}}async function sa(e,t,r){if(!r.settings&&!await W(X(e)))return le(t,"search_semantic_refresh_skipped:settings_not_initialized");let n;try{if(r.settings)n=r.settings;else{let a=await Se(e),c=a.warnings.find(d=>d.startsWith("settings_read_"));if(c)return le(t,`search_semantic_refresh_skipped:settings_read_failed:${c}`);n=a.settings}}catch(a){return le(t,`search_semantic_refresh_skipped:settings_read_failed:${E(a)}`)}let o=r.apply_runtime_defaults?Ne(n).settings:n,i=_t(o).active;if(!i)return le(t,"search_semantic_refresh_skipped:provider_unconfigured");let s=Nt(o,e).active;return s?{settings:o,provider:i,vectorStore:s}:le(t,"search_semantic_refresh_skipped:vector_store_unconfigured")}async function aa(e,t,r,n,o,i){let s=[],a=new Set,c=new Set,d=[];for(let u of n){let f=await dt(e,u,t,r,o);if(!f){c.add(u);continue}try{let _=await lt(f,{schema:i});d.push({id:_.document.metadata.id,document:_.document})}catch(_){a.add(f.id),s.push(`search_semantic_refresh_item_read_failed:${f.id}:${E(_)}`)}}return d.sort((u,f)=>u.id.localeCompare(f.id)),{documents:d,missingIds:ue(c),skippedIds:ue(a),warnings:s}}async function ca(e,t,r){let n=Z(t.name,e.search.embedding_corpus_max_characters).maxCharacters,o=ht(e),i=r.map(a=>gt(a.document,{providerName:t.name,maxCharacters:n,fields:o})),s=await bt(t,e,i);return{vectors:s.vectors,vector_dimension:Ut(s.vectors,"Semantic refresh embedding"),warnings:s.warnings}}async function da(e,t,r){return await Pt(e,t.map((n,o)=>({id:n.id,vector:r[o],payload:oa(n.document.metadata)}))),{refreshed:t.map(n=>n.id),skipped:[],warnings:[]}}async function la(e,t){if(t.length===0)return{refreshed:[],skipped:[],warnings:[]};try{return await Ue(e,t),{refreshed:[],skipped:[],warnings:[]}}catch(r){return{refreshed:[],skipped:t,warnings:[`search_semantic_refresh_delete_failed:${E(r)}`]}}}async function pu(e,t,r={}){let n=ue(t);if(n.length===0)return{refreshed:[],skipped:[],warnings:[]};let o=await sa(e,n,r);if(!("settings"in o))return o;let i=Ze(o.settings,tt()),s=await aa(e,o.settings.id_prefix,o.settings.item_format,n,i.type_to_folder,o.settings.schema),a=s.documents.length>0||s.missingIds.length>0?await cn(e):{entries:{},embedding:null,warnings:[]},c=ia(o.provider),d=a.entries,u={refreshed:[],skipped:[],warnings:[]},f=a.embedding;if(s.documents.length>0)if(a.embedding&&zt(a.embedding,c))u={refreshed:[],skipped:s.documents.map(y=>y.id),warnings:["search_semantic_refresh_requires_reindex:embedding_identity_changed"]};else try{let y=await ca(o.settings,o.provider,s.documents);if(Ft(a.embedding,y.vector_dimension))u={refreshed:[],skipped:s.documents.map(w=>w.id),warnings:[...y.warnings,"search_semantic_refresh_requires_reindex:vector_dimension_changed"]};else{f=$t(c,y.vector_dimension);let w=await da(o.vectorStore,s.documents,y.vectors);u={refreshed:w.refreshed,skipped:w.skipped,warnings:[...y.warnings,...w.warnings]}}}catch(y){u={refreshed:[],skipped:s.documents.map(w=>w.id),warnings:[`search_semantic_refresh_failed:${E(y)}`]}}let _=await la(o.vectorStore,s.missingIds),p=new Set(u.refreshed),g=Object.fromEntries(s.documents.filter(y=>p.has(y.id)).map(y=>[y.id,y.document.metadata.updated_at])),h=[];if(Object.keys(g).length>0||s.missingIds.length>0){let y={...d,...an(g)};for(let w of s.missingIds)delete y[w];try{await dn(e,y,f)}catch(w){h.push(`search_vectorization_status_ledger_write_failed:${E(w)}`)}h.push(...a.warnings)}return{refreshed:ue([...u.refreshed,..._.refreshed]),skipped:ue([...s.skippedIds,...u.skipped,..._.skipped]),warnings:[...s.warnings,...u.warnings,..._.warnings,...h]}}import{createRequire as ha}from"node:module";(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]="ac3b0f55-7faf-5fa6-b01d-304e87acb9a2")}catch{}})();var ua=new Set(["1","true","yes","on"]),Vt=["user","automation","test","dogfood"],ma=new Set(Vt);function ln(e=process.env){return typeof e.VITEST=="string"||typeof e.VITEST_WORKER_ID=="string"||typeof e.NODE_TEST_CONTEXT=="string"||(e.NODE_ENV??"").trim().toLowerCase()==="test"}function je(e,t){return ua.has((t[e]??"").trim().toLowerCase())}function me(e=process.env){let t=je("DO_NOT_TRACK",e),r=(e.PM_TELEMETRY_SOURCE_CONTEXT??"").trim().toLowerCase(),n=ln(e)&&!ma.has(r)&&!je("PM_TELEMETRY_SEND_TEST_EVENTS",e);return{telemetry_disabled:t||n||je("PM_TELEMETRY_DISABLED",e)||je("PM_NO_TELEMETRY",e),do_not_track:t,test_suppressed: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]="64589e00-25ef-5d74-a94a-7d40455e1929")}catch{}})();var mn=/(?:token|secret|password|passwd|api[_-]?key|apikey|authorization|cookie|credentials|bearer|dsn)/i,gu=new RegExp(`(?:\\b|(?<=_))(${mn.source})\\s*[:=]\\s*([^\\s,;]+)`,"giu");var un="(?:\\s|\\\\+u(?:0009|000a|000d|0020))*",yu=new RegExp("^"+un+"(?::|=|\\\\+u(?:003a|003d))"+un,"iu");(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]="93725298-6091-543b-969d-bac38d70be89")}catch{}})();var xu=ha(import.meta.url);(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]="9e8ad404-2f8d-5d9b-9046-60178a70e5b2")}catch{}})();var qe=class extends m{constructor(t,r,n){super(t,l.GENERIC_FAILURE,r),this.name="ExtensionCommandError",Object.defineProperty(this,"cause",{value:n,configurable:!0,writable:!0})}};function Lu(e,t){let r=t.warnings[0]??"extension_command_handler_failed",n=t.errorMessage?.trim();return new qe(`Command "${e}" failed in extension handler (${r}).${n?` ${n}`:""}`,{code:t.errorCode??"command_failed",nextSteps:t.remediation?[t.remediation]:void 0},t.cause)}function Du(e){return e instanceof m||e instanceof Error?e.message:"Unknown failure"}(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]="bd65294f-dfa5-53d2-9691-c630884f2a5f")}catch{}})();var Pu=new Map([[l.USAGE,"invalid_command_usage"],[l.NOT_FOUND,"item_not_found"],[l.CONFLICT,"lock_conflict"],[l.DEPENDENCY_FAILED,"dependency_failed"]]);(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]="10325dfb-128f-5d83-9163-061d8d8b29b6")}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]="ab644545-f072-53c0-9ebf-72a62c237a2f")}catch{}})();var Gu=Object.freeze({"<":"<",">":">",""":'"',"'":"'","&":"&"});(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]="e7deff0d-d9c9-5250-b172-ab752ddd64a4")}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]="bc9e1b59-21cb-5dda-91c0-36e123734cd3")}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]="4b566486-120f-5aed-8d92-9e62ed996210")}catch{}})();function ya(e,t){if(e==null)return[];let r=t?.separators??/,/,n=e.split(r).map(i=>i.trim()).filter(i=>i.length>0),o=t?.unique!==!1?Array.from(new Set(n)):n;return t?.sort===!0?[...o].sort():o}import jt from"node:fs/promises";import He 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]="12ee7de1-dff4-53f1-8d0d-d8b1c1ebea42")}catch{}})();function ba(e){return"json_markdown"}function _n(e,t){return He.relative(e,t).replaceAll("\\","/")}function Ea(e){return String(e).replaceAll(/[^a-zA-Z0-9._-]+/g,"_").slice(0,120)}async function wa(e,t,r){e!==t&&ge(await jt.readFile(t,"utf8"),{format:"json_markdown",requireSupportedFormat:!0,schema:r})}async function Sa(e,t,r="item_format:migrate",n=Qe,o){if(t!=="toon")throw new Error("Only toon item-format migration targets are supported. Markdown item files are legacy read-only input.");let i=new Set,s=new Set,a=[],c=0,d=ba(t),u=Object.entries(n);for(let[f,_]of u){let p=He.join(e,_),g=[];try{g=await jt.readdir(p)}catch{continue}let h=new Map;for(let w of g){let D=He.join(p,w),O=rr(D);if(!O)continue;let B=He.extname(w),te=w.slice(0,w.length-B.length).trim();if(te.length===0)continue;let G=h.get(te)??{};G[O]=D,h.set(te,G)}let y=[...h.keys()].sort((w,D)=>w.localeCompare(D));for(let w of y){let D=h.get(w);c+=1;let O=D[d];if(!O)continue;let B=D[t]??O,te=B===D[t]?t:d;try{let G=await jt.readFile(B,"utf8"),Qn=ge(G,{format:te,requireSupportedFormat:!0,schema:o,onWarning:Zn=>a.push(`item_format_migration_parse_warning:${w}:${Zn}`)});await wa(B,O,o);let Je=et(e,f,w,t,n),er=it(Qn,{format:t,schema:o});await T(Je)!==er&&(await v(Je,er),a.push(...await Q({path:Je,scope:"project",op:r})),i.add(w)),await pe(O),s.add(_n(e,O)),a.push(...await Q({path:O,scope:"project",op:`${r}:remove`})),i.add(w)}catch(G){a.push(`item_format_migration_skipped:${_n(e,B)}:${Ea(G)}`)}}}return{target_format:t,scanned:c,migrated:[...i].sort((f,_)=>f.localeCompare(_)),removed:[...s].sort((f,_)=>f.localeCompare(_)),warnings: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]="12c59406-7e00-5fe1-bd93-c1f9d8537f01")}catch{}})();var Ta=new Set(["completed","superseded"]);function va(e){return e!==void 0&&Ta.has(e)}function Ia(e){if(e.type.trim().toLowerCase()!=="plan")return!1;let t=e.plan_steps??[];return t.length>0&&t.every(r=>r.status==="completed")}import{createHash as Aa}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7cbbb50d-e9bc-5940-9ae6-6270e9c2fcbf")}catch{}})();var Ca=/^[a-z][a-z0-9_-]{0,63}$/u,xa=new Set(["constructor","prototype"]),hn="settings:section:write",ka=240;function Ye(e){return`sha256:${Aa("sha256").update(qt(e)).digest("hex")}`}function qt(e){return Array.isArray(e)?`[${e.map(t=>qt(t)).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${qt(Object.getOwnPropertyDescriptor(e,t)?.value)}`).join(",")}}`:String(JSON.stringify(e))}function yn(e){if(!Ca.test(e)||xa.has(e))throw new m(`Invalid settings section name "${e.slice(0,80)}". Use 1-64 lowercase letters, digits, underscores or hyphens, starting with a letter.`,l.USAGE,{code:"settings_section_name_invalid",field:"section",required:"Name the section after the package, for example lint or jev."});if(lr.includes(e))throw new m(`Settings section "${e}" is owned by core settings; extension sections must use another name.`,l.USAGE,{code:"settings_section_reserved",field:"section",value:e,required:"Read core settings with readSettings and change them with writeSettings or pm config."})}function bn(e){let t;try{t=JSON.parse(e)}catch{t=void 0}if(typeof t!="object"||t===null||Array.isArray(t))throw new m("settings.json is not a JSON object, so no settings section can be read or written.",l.USAGE,{code:"settings_section_document_malformed",reason:t===void 0?"settings_json_malformed":"settings_json_not_object",nextSteps:["Repair .agents/pm/settings.json so it is a JSON object, then retry.","Run pm health to confirm the settings warning has cleared."]});return t}function Ht(e,t,r){let n;try{n=r===void 0?t:r(t)}catch(o){throw new m(`Settings section "${e}" is invalid: ${E(o).slice(0,ka)}`,l.USAGE,{code:"settings_section_invalid",field:e,required:`Fix the "${e}" section of .agents/pm/settings.json so the owning package accepts it, then retry.`})}return n}function En(e){return typeof Reflect.get(e,"toJSON")=="function"}function Yt(e){return e.length===0?"the value":e.join(".")}function wn(e,t){return Object.values(Object.getOwnPropertyDescriptors(e)).every(r=>"value"in r&&(!t||r.enumerable===!0))}function Ra(e){if(Object.getPrototypeOf(e)!==Array.prototype||!wn(e,!1))return!1;let t=Object.keys(e);return t.length===e.length&&t.every((r,n)=>r===String(n))&&Object.getOwnPropertyNames(e).length===e.length+1&&Object.getOwnPropertySymbols(e).length===0&&!En(e)}function Oa(e){let t=Object.getPrototypeOf(e);return(t===Object.prototype||t===null)&&wn(e,!0)&&Object.getOwnPropertySymbols(e).length===0&&!En(e)}function La(e,t){if(e===null||typeof e=="string"||typeof e=="boolean")return null;let r=Yt(t);return typeof e=="number"?Number.isFinite(e)?null:{detail:`${r} is a non-finite number`,representable:!0}:{detail:`${r} is ${typeof e}`,representable:typeof e!="bigint"&&t.length>0}}function Sn(e,t=[],r=new Set){if(typeof e!="object"||e===null)return La(e,t);let n=Yt(t);if(r.has(e))return{detail:`${n} is a circular reference`,representable:!1};if(!(Array.isArray(e)?Ra(e):Oa(e)))return{detail:`${n} is not a plain JSON ${Array.isArray(e)?"array":"object"}`,representable:!0};r.add(e);for(let[o,i]of Object.entries(e)){let s=Sn(i,[...t,o],r);if(s!==null)return s}return r.delete(e),null}function Tn(e,t=[]){if(typeof e!="object"||e===null)return null;for(let[r,n]of Object.entries(e)){let o=[...t,r];if(r==="__proto__"||r==="prototype"&&t.at(-1)==="constructor")return Yt(o);let i=Tn(n,o);if(i!==null)return i}return null}function gn(e,t,r){return Ht(e,t,()=>{throw new Error(r)})}function Da(e,t){let r=Sn(t);if(r!==null){let o=r.representable?`the value would change when stored as JSON: ${r.detail}`:`the value is not representable as JSON: ${r.detail}`;return gn(e,t,o)}let n=Tn(t);return n!==null?gn(e,t,`${n} is a reserved key that settings history cannot record`):JSON.parse(JSON.stringify(t))}function vn(e,t){return Object.hasOwn(e,t)?e[t]:void 0}async function Ma(e,t,r={}){yn(t);let n=X(e);await rt({path:n,scope:"project"});let o=await T(n),i=o===null?void 0:vn(bn(o),t);if(i===void 0)return{section:t,source:"default",value:r.defaultValue,revision:null};let s=Ye(i);return{section:t,source:"stored",value:Ht(t,structuredClone(i),r.validate),revision:s}}async function Na(e,t,r,n={}){yn(t);let o=r===void 0?void 0:Da(t,Ht(t,r,n.validate)),i=X(e),s=await P(e);try{let a=await at({pmRoot:e,filePath:i,op:hn,author:ye(n.author,s.author_default),lockTtlSeconds:s.locks.ttl_seconds,lockWaitMs:s.locks.wait_ms,recordCreation:!1,mutate:c=>{if(c===null)throw new m("settings.json does not exist, so no settings section can be written.",l.NOT_FOUND,{code:"settings_section_document_missing",required:"Initialize the tracker with pm init, then retry."});let d=bn(c),u=vn(d,t),f=u===void 0?null:Ye(u);if(n.expectedRevision!==void 0&&n.expectedRevision!==f)throw new m(`Settings section "${t}" changed since it was read; read it again and reapply the change.`,l.CONFLICT,{code:"settings_section_revision_conflict",field:t,expected_revision:n.expectedRevision,current_revision:f,required:"Read the section again with readSettingsSection, then retry with its current revision."});let _={section:t,changed:!1,previous_revision:f,revision:o===void 0?null:Ye(o)};return oe(u,o)?{raw:c,result:_}:(o===void 0?delete d[t]:d[t]=o,{raw:`${JSON.stringify(d,null,2)}
|
|
15
|
-
`,result:{..._,changed:!0}})}});return a.changed&&await Q({path:i,scope:"project",op:hn}),a.result}finally{Ee(e)}}import Sm from"node:readline/promises";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="88db9929-8e1d-56ad-9a5f-6cc0febadfb3")}catch{}})();import Kt from"node:crypto";import{mkdirSync as Fm,rmSync as za,statSync as Um}from"node:fs";import{mkdir as Bt,readdir as Fa,rm as Jt,stat as On}from"node:fs/promises";import{request as Ua}from"node:http";import{request as Va}from"node:https";import A 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]="4f455b67-536a-59be-8f25-1dc9c9c0b917")}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]="cbcb519e-1348-5974-bd16-ea5905c468a4")}catch{}})();var ja=A.join("runtime","telemetry","events.jsonl"),qa=A.join("runtime","telemetry","state.json"),Ha=A.join("runtime","telemetry","otel-spans.jsonl"),Ya=8,In=500,Ba=1;var Ga=100,Wa=36e5,Ka=3e4,An=2e4,Ja=1e3,Xa=25e3;var Qa=864e5,Ln=65536;var Dn=15;var Mn=[25,50,100,200],Za=3600*1e3,ec=6e4;var H="PM_TELEMETRY_FLUSH_CHILD",tc="PM_TELEMETRY_HTTP_TIMEOUT_MS",rc=globalThis.fetch;var sf=Promise.resolve(),Cn=Promise.resolve();var nc=new Set(["1","true","yes","on"]);var af=Kt.randomUUID();var Nn="(?:token|secret|password|passwd|api[_-]?key|apikey|authorization|cookie|session|credentials|bearer|literals?|regex(?:es)?|replacements?)",oc=new RegExp(`\\b(${Nn})\\s*([:=])\\s*([^\\s,;]+)`,"giu"),ic=new RegExp(`(--${Nn})(=|\\s+)([^\\s,;]+)`,"giu"),sc=/(^|[\s"'`(=])\/(?:[^\s"'`),;]+)/g,ac=/bearer\s+[a-z0-9._=-]+/giu,cc=/\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;function Be(e){return A.join(e,ja)}function Ge(e){return A.join(e,Ha)}function dc(e){return A.dirname(Be(e))}function Pn(e){return A.join(e,qa)}function $n(e){return A.join(e,"runtime","telemetry","flush.lock")}function lc(e){return A.join(e,"runtime","telemetry","flush.spawn.lock")}async function uc(e){let t=await T(Pn(e));if(!t||t.trim().length===0)return{};try{let r=JSON.parse(t);return typeof r!="object"||r===null||Array.isArray(r)?{}:r}catch{return{}}}async function R(e,t){try{await fe(async()=>{let r={...await uc(e),...t},n=Object.fromEntries(Object.entries(r).filter(([,o])=>o!==void 0).sort((o,i)=>o[0].localeCompare(i[0])));await v(Pn(e),`${JSON.stringify(n,null,2)}
|
|
16
|
-
`,{createParentDirectories:!Y(process.env[H])})},e)}catch{}}function zn(e){return e.replaceAll(oc,(t,r,n)=>`${r}${n}[redacted]`).replaceAll(ic,(t,r,n)=>`${r}${n}[redacted]`)}function Fn(e){return e.replaceAll(sc,(t,r)=>`${r}[redacted_path]`)}function Un(e){let t=e>=65&&e<=90,r=e>=97&&e<=122,n=e>=48&&e<=57;return t||r||n}function Vn(e){if(!e)return!1;let t=e.charCodeAt(0);return Un(t)?!0:e==="."||e==="_"||e==="%"||e==="+"||e==="-"}function jn(e){if(!e)return!1;let t=e.charCodeAt(0);return Un(t)?!0:e==="."||e==="-"}function mc(e){let t=e.indexOf("@");if(t<=0||t!==e.lastIndexOf("@")||t===e.length-1)return!1;let r=e.slice(0,t),n=e.slice(t+1),o=n.lastIndexOf(".");if(o<=0||o===n.length-1||n.length-(o+1)<2)return!1;for(let i of r)if(!Vn(i))return!1;for(let i of n)if(!jn(i))return!1;return!0}function fc(e){let t="",r=0;for(;r<e.length;){let n=e.indexOf("@",r);if(n<0){t+=e.slice(r);break}let o=n-1;for(;o>=r&&Vn(e[o]);)o-=1;o+=1;let i=n+1;for(;i<e.length&&jn(e[i]);)i+=1;let s=e.slice(o,i);if(mc(s)){t+=e.slice(r,o),t+="[redacted_email]",r=i;continue}t+=e.slice(r,n+1),r=n+1}return t}function qn(e){return fc(e).replaceAll(ac,"bearer [redacted_token]").replaceAll(cc,"[redacted_ip]")}function pc(e){let t=qn(e),r=zn(t),n=Fn(r),o=n.trim();return o.startsWith("/")&&o.length>1?"[redacted_path]":n.length>512?`${n.slice(0,509)}...`:n}function _c(e){let t=qn(e),r=zn(t),n=Fn(r),o=n.trim();return o.startsWith("/")&&o.length>1?"[redacted_path]":n.length>2048?`${n.slice(0,2045)}...`:n}function Wt(e,t="redacted"){return t==="max"?_c(e):pc(e)}function hc(e){let t=e?.trim().toLowerCase();return t==="minimal"||t==="redacted"||t==="max"?t:"redacted"}function Y(e){return nc.has((e??"").trim().toLowerCase())}function xn(){let e=process.env[tc]?.trim();if(!e)return An;let t=Number(e);return Number.isFinite(t)?Math.min(Xa,Math.max(Ja,Math.trunc(t))):An}async function Hn(e,t,r){let n=new URL(e);if(globalThis.fetch!==rc){let i=new AbortController,s,a=new Promise((c,d)=>{s=setTimeout(()=>{i.abort(),d(new Error("telemetry_http_timeout"))},xn())});try{return(await Promise.race([globalThis.fetch(e,{method:"POST",headers:t,body:r,signal:i.signal}),a])).status}finally{clearTimeout(s)}}let o=n.protocol==="https:"?Va:n.protocol==="http:"?Ua:void 0;if(!o)throw new Error(`telemetry_http_protocol_unsupported_${n.protocol}`);return new Promise((i,s)=>{let a=xn(),c={method:"POST",headers:{...t,"content-length":Buffer.byteLength(r)},signal:AbortSignal.timeout(a),autoSelectFamilyAttemptTimeout:Math.min(5e3,a)},d=o(n,c,u=>{u.once("error",s),u.once("end",()=>i(u.statusCode)),u.resume()});d.once("error",s),d.end(r)})}async function gc(e){let t=await P(e);if(!t.telemetry.enabled||me().telemetry_disabled)return null;if(t.telemetry.installation_id.trim().length===0){if(ur(e)||we(t))return null;t.telemetry.installation_id=Kt.randomUUID(),await Te(e,t,"telemetry:install_id")}return{installationId:t.telemetry.installation_id,endpoint:t.telemetry.endpoint,retentionDays:Math.max(1,Math.trunc(t.telemetry.retention_days)),captureLevel:hc(t.telemetry.capture_level)}}function Yn(e){let t=[];for(let r of e.split(`
|
|
17
|
-
`)){let n=r.trim();if(n.length!==0)try{let o=JSON.parse(n);o&&typeof o=="object"&&o.event&&typeof o.event=="object"&&typeof o.attempts=="number"&&(o.client_schema_version===void 0||typeof o.client_schema_version=="number"&&Number.isFinite(o.client_schema_version))&&t.push(o)}catch{}}return t}function Bn(e){let t=Math.min(Ka*2**Math.max(e-1,0),Wa);return new Date(Date.now()+t).toISOString()}function Xt(e){if(typeof e!="string"||e.trim().length===0)return!0;let t=Date.parse(e);return Number.isNaN(t)?!0:t<=Date.now()}function Gn(e){return Xt(e.next_attempt_after)}function Wn(e){let t=Number.isFinite(e)?Math.max(1,Math.trunc(e)):1;return Date.now()-t*Qa}function yc(e,t){let r=e.event?.occurred_at;if(typeof r!="string"||r.trim().length===0)return!1;let n=Date.parse(r);return Number.isNaN(n)?!1:n<t}function We(e,t){let r=Wn(t),n=[],o=0;for(let i of e){if(JSON.stringify(i).length>Ln||yc(i,r)||i.attempts>=Dn){o+=1;continue}n.push(i)}return{entries:n,prunedCount:o}}async function Kn(e,t){let r=t.map(o=>JSON.stringify(o)).join(`
|
|
18
|
-
`),n=r.length>0?`${r}
|
|
19
|
-
`:"";for(let o=0;;o+=1)try{await v(Be(e),n,{createParentDirectories:!Y(process.env[H])});return}catch(i){let s=Mn[o];if(s===void 0||!Jn(i))throw i;await Xn(s)}}function Jn(e){if(typeof e!="object"||e===null||!("code"in e))return!1;let t=e.code;return t==="EACCES"||t==="EBUSY"||t==="EPERM"}function Xn(e){return new Promise(t=>{setTimeout(t,e)})}function bc(e){let t=JSON.stringify([e.endpoint,e.enqueued_at,e.payload]);return Kt.createHash("sha256").update(t).digest("hex").slice(0,32)}function Qt(e){let t=[];for(let r of e.split(`
|
|
20
|
-
`)){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=bc(o)),t.push(o))}catch{}}return t}function Ec(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 Zt(e,t){let r=Wn(t),n=[],o=0;for(let i of e){if(JSON.stringify(i).length>Ln||Ec(i,r)||i.attempts>=Dn){o+=1;continue}n.push(i)}if(n.length>In){let i=n.length-In;return o+=i,{entries:n.slice(i),prunedCount:o}}return{entries:n,prunedCount:o}}async function wc(e,t){let r=t.map(o=>JSON.stringify(o)).join(`
|
|
21
|
-
`),n=r.length>0?`${r}
|
|
22
|
-
`:"";for(let o=0;;o+=1)try{await v(Ge(e),n,{createParentDirectories:!Y(process.env[H])});return}catch(i){let s=Mn[o];if(s===void 0||!Jn(i))throw i;await Xn(s)}}async function kn(e,t,r,n){return fe(async()=>{let o=await T(Ge(e)),i=o===null?[]:Qt(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}=Zt(s,t);return await wc(e,a),a.length},e)}async function Sc(e,t){let r=await T(Ge(e));if(r===null||r.trim().length===0){await R(e,{pending_otel_spans:0});return}let n=Qt(r),{entries:o,prunedCount:i}=Zt(n,t),s=o.filter(g=>Xt(g.next_attempt_after)).slice(0,Ya);if(s.length===0){let g=i>0?await kn(e,t,new Set,new Map):o.length;await R(e,{pending_otel_spans:g});return}let a=M(),c=new Set,d=new Map,u=0,f;await Promise.all(s.map(async g=>{try{let h=await Hn(g.endpoint,{"content-type":"application/json"},JSON.stringify(g.payload));if(h<200||h>=300)throw new Error(`local_otel_export_http_${h}`);c.add(g.id),u+=1}catch(h){f=h instanceof Error?Wt(h.message,"redacted"):"local_otel_export_failed";let y=g.attempts+1;d.set(g.id,{attempts:y,next_attempt_after:Bn(y)})}}));let _=await kn(e,t,c,d),p={pending_otel_spans:_,last_otel_attempt_at:a};u>0&&(p.last_otel_success_at=a),f!==void 0?(p.last_otel_failure_at=a,p.last_otel_failure_error=f):_===0&&(p.last_otel_failure_at=void 0,p.last_otel_failure_error=void 0),await R(e,p)}async function Tc(e,t,r){try{await Ac(e,t,r)}catch{}try{await Sc(e,r)}catch{}}async function vc(e,t=Za){try{let r=dc(e),n=await Fa(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=A.join(r,i.name);(await On(s)).mtimeMs<o&&await Jt(s,{force:!0})}))}catch{}}async function fe(e,t=ne(process.cwd()),r=5e3){let n=Cn.catch(()=>{}).then(()=>ir(async()=>{let o=await he(t,"telemetry-queue",60,"telemetry",!1,!1,r,{createParentDirectories:!Y(process.env[H])});try{return Ee(t),await e()}finally{await o()}}));return Cn=n.catch(()=>{}),n}async function Ke(e){let t=await T(Be(e));return t===null||t.trim().length===0?[]:Yn(t)}async function Gt(e,t,r){return fe(async()=>{let n=await Ke(e),{entries:o}=We(n,r),i=o.filter(s=>!t.has(s.event.event_id));return await Kn(e,i),i},e)}async function Ic(e,t,r,n){return fe(async()=>{let o=await Ke(e),{entries:i}=We(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:Bn(c)}});return await Kn(e,s),s},e)}async function Ac(e,t,r){await vc(e);let n=t.trim();if(n.length===0)return;let o=await T(Be(e));if(o===null||o.trim().length===0){await R(e,{endpoint:n,queue_entries:0});return}let i=Yn(o);if(i.length===0){await R(e,{endpoint:n,queue_entries:0});return}let{entries:s,prunedCount:a}=We(i,r);if(s.length===0){let p=await Gt(e,new Set,r);await R(e,{endpoint:n,queue_entries:p.length});return}let c=s.filter(p=>Gn(p)).slice(0,Ga);if(c.length===0){let p=a>0?await Gt(e,new Set,r):s;await R(e,{endpoint:n,queue_entries:p.length});return}let d=new Set(c.map(p=>p.event.event_id)),u=M(),f={"content-type":"application/json"},_=process.env.PM_TELEMETRY_INGEST_KEY?.trim();_&&(f["x-pm-telemetry-key"]=_);try{let p=await Hn(n,f,JSON.stringify({schema_version:Ba,events:c.map(g=>g.event)}));if(p<200||p>=300)throw new Error(`telemetry_flush_http_${p}`)}catch(p){let g=await Ic(e,d,u,r),h=p instanceof Error?Wt(p.message,"redacted"):"telemetry_flush_failed";await R(e,{endpoint:n,queue_entries:g.length,last_attempted_flush_at:u,last_failed_flush_at:u,last_failed_flush_error:h});return}try{let p=await Gt(e,d,r);await R(e,{endpoint:n,queue_entries:p.length,last_attempted_flush_at:u,last_successful_flush_at:u,last_failed_flush_at:void 0,last_failed_flush_error:void 0})}catch(p){let g=p instanceof Error?Wt(p.message,"redacted"):"telemetry_flush_failed",h=await Ke(e).catch(()=>s);await R(e,{endpoint:n,queue_entries:h.length,last_attempted_flush_at:u,last_failed_flush_at:u,last_failed_flush_error:g})}}async function Cc(e){let t=$n(e);Y(process.env[H])||await Bt(A.dirname(t),{recursive:!0});try{return await Bt(t),!0}catch(r){if(typeof r!="object"||r===null||!("code"in r)||r.code!=="EEXIST")throw r}try{let r=await On(t);return Date.now()-r.mtimeMs<ec?!1:(await Jt(t,{recursive:!0,force:!0}),await Bt(t),!0)}catch{return!1}}function xc(e){try{za(e,{recursive:!0,force:!0})}catch{}}function kc(e){xc(lc(e))}async function Rc(e,t,r){let n=await Cc(e);if(kc(e),!n)return!1;try{await Tc(e,t,r)}finally{try{await Jt($n(e),{recursive:!0,force:!0})}catch{}}return!0}async function Rn(e,t){let r=new Set;try{let{entries:n}=We(await Ke(e),t);for(let o of n.filter(Gn))r.add(`event:${o.event.event_id}`)}catch{}try{let n=await T(Ge(e));if(n!==null)for(let o of Zt(Qt(n),t).entries)Xt(o.next_attempt_after)&&r.add(`span:${o.id}`)}catch{}return r}async function cf(e=ne(process.cwd())){if(!me().telemetry_disabled)try{await ct(e,async()=>{let t=Y(process.env[H]),r=!0;for(;r;){if(!(await P(e)).telemetry.enabled)return;let n=await fe(()=>gc(e),e);if(!n)return;let o=t?await Rn(e,n.retentionDays):new Set;if(!await Rc(e,n.endpoint,n.retentionDays)||!t)return;let i=await Rn(e,n.retentionDays);r=i.size>0&&(i.size!==o.size||[...i].some(s=>!o.has(s)))}},()=>Y(process.env[H]))}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]="1e571c5b-0ebf-578a-8a53-398eab70d71e")}catch{}})();export{Lu as a,Du as b,Yd as c,Di as d,Ni as e,$i as f,zi as g,mt as h,eo as i,hr as j,gr as k,no as l,oo as m,io as n,so as o,Sr as p,_o as q,Nc as r,ho as s,Pc as t,se as u,yo as v,Ae as w,$c as x,bo as y,Ie as z,zc as A,Ce as B,wo as C,So as D,Ji as E,Ii as F,Td as G,$r as H,vd as I,Id as J,Le as K,Ad as L,Oi as M,Gd as N,Fi as O,Ui as P,It as Q,ji as R,At as S,qi as T,cl as U,Yi as V,jr as W,Bi as X,Gi as Y,Ki as Z,yl as _,Zi as $,vl as aa,ns as ba,is as ca,To as da,ss as ea,as as fa,Ne as ga,ks as ha,Gc as ia,_t as ja,Ar as ka,ht as la,Po as ma,$o as na,Jc as oa,Cr as pa,Z as qa,gt as ra,bt as sa,Nt as ta,Gl as ua,Pt as va,Ue as wa,tn as xa,Ve as ya,$t as za,zt as Aa,Ft as Ba,Ut as Ca,cn as Da,dn as Ea,pu as Fa,Vt as Ga,me as Ha,mi as Ia,Dr as Ja,pi as Ka,_i as La,hi as Ma,ad as Na,Tt as Oa,Nr as Pa,Mr as Qa,bi as Ra,Ei as Sa,Pr as Ta,Ti as Ua,ya as Va,Sa as Wa,va as Xa,Ia as Ya,Ma as Za,Na as _a,Ba as $a,Dn as ab,fe as bb,cf as cb};
|
|
23
|
-
//# sourceMappingURL=chunk-CBG67HUP.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$a as m,Za as b,ab as f,bb as k,lb as u}from"./chunk-MEJKELWC.js";import{z as a}from"./chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7c95b311-b408-50f7-87e8-2c2fa2323092")}catch{}})();var D=[{exit_code:a.SUCCESS,outcome:"effect",success:!0,meaning:"The requested operation completed with its intended effect."},{exit_code:a.GENERIC_FAILURE,outcome:"internal_failure",success:!1,meaning:"An unexpected runtime or internal failure prevented completion."},{exit_code:a.USAGE,outcome:"refused_input",success:!1,meaning:"The invocation was refused because its input or composition was invalid."},{exit_code:a.NOT_FOUND,outcome:"refused_tracker_state",success:!1,meaning:"The requested tracker, item, or resource was not present."},{exit_code:a.CONFLICT,outcome:"conflict",success:!1,meaning:"Current state or concurrency prevented the requested effect."},{exit_code:a.DEPENDENCY_FAILED,outcome:"dependency_failed",success:!1,meaning:"A required dependency operation failed."},{exit_code:a.NO_EFFECT,outcome:"no_effect",success:!0,meaning:"The request was valid and completed, but matched nothing to change."},{exit_code:a.PARTIAL_EFFECT,outcome:"partial_effect",success:!0,meaning:"The request completed and changed some, but not all, selected targets."}],h=[a.SUCCESS,a.GENERIC_FAILURE,a.USAGE,a.NOT_FOUND,a.CONFLICT,a.DEPENDENCY_FAILED],P=new Set(["close-many","update-many"]),w=u.map(e=>({command:e,exit_codes:P.has(e)?[...h,a.NO_EFFECT,a.PARTIAL_EFFECT]:[...h]})),v=new Map(w.map(e=>[e.command,e])),R=[a.SUCCESS,a.NO_EFFECT,a.PARTIAL_EFFECT];function Ee(e){return R.includes(e)}function Te(e){return D.some(t=>t.exit_code===e)}function Ae(e){let t=e.trim().toLowerCase().split(/\s+/u).filter(Boolean).join(" ");return v.get(t)??v.get(t.split(" ")[0])}function Oe(e,t=u,s=w){let o=new Map(s.map(c=>[c.command,c])),i=t.filter(c=>!o.has(c)),r=e.filter(c=>{let n=o.get(c.command)??o.get(c.command.split(" ")[0]);return n===void 0||!n.exit_codes.includes(c.exit_code)}),d=new Set(e.map(c=>c.exit_code)),_=[...new Set(s.flatMap(c=>c.exit_codes))].filter(c=>!d.has(c)).sort((c,n)=>c-n);return{ok:i.length===0&&r.length===0&&_.length===0,missing_commands:i,undeclared_observations:r,unreachable_exit_codes:_}}function Se(e){return e.applied===0&&e.failed>0?{outcome:"dependency_failed",exit_code:a.DEPENDENCY_FAILED}:e.applied===0?{outcome:"no_effect",exit_code:a.NO_EFFECT}:e.skipped>0||e.failed>0||e.unmatched>0?{outcome:"partial_effect",exit_code:a.PARTIAL_EFFECT}:{outcome:"effect",exit_code:a.SUCCESS}}(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]="7df4fe91-e8a4-540f-8737-c67f2efa460e")}catch{}})();var x=[{exit_code:1,class:"generic_failure"},{exit_code:2,class:"usage"},{exit_code:3,class:"not_found"},{exit_code:4,class:"conflict"},{exit_code:5,class:"dependency_failed"}],L=new Map(x.map(e=>[e.exit_code,e.class]));function g(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort()}function q(e){if(!e)return[];let t=new Set,s=new Set;return e.map(o=>{let i=o.state.trim(),r=o.probe_id.trim(),d=g(o.entrypoints);if(!/^[a-z][a-z0-9_]*$/.test(i)||!/^[a-z][a-z0-9-]*$/.test(r)||d.length===0||t.has(i)||s.has(r))throw new TypeError("Invalid pm refusal state contract");return t.add(i),s.add(r),{state:i,probe_id:r,entrypoints:d,expected_exit_class:o.expected_exit_class}}).sort((o,i)=>o.state.localeCompare(i.state))}function F(e,t,s,o,i){return![[1,2,3,4,5].includes(e.exit_code),e.meaning.trim().length>0,e.recovery.trim().length>0,t.length>0,s.length>0,/^[a-z][a-z0-9_]*$/.test(o),i.every(r=>/^[a-z][a-z0-9_]*$/.test(r)),L.get(e.exit_code)===e.class].includes(!1)}function j(e,t){let s=e,o=new Set;for(;s.canonical_code!==s.code;){if(o.has(s.code))throw new TypeError(`Alias cycle in pm error code catalog: ${e.code}`);o.add(s.code);let i=t.get(s.canonical_code);if(!i)throw new TypeError(`Invalid pm error code contract: ${e.code}`);s=i}return s}function $(e){let t=new Map(e.map(s=>[s.code,s]));for(let s of e){let o=j(s,t);if(o.exit_code!==s.exit_code||o.class!==s.class)throw new TypeError(`Alias transport mismatch for pm error code: ${s.code}`);let i=e.filter(r=>r.code!==o.code&&r.canonical_code===o.code).map(r=>r.code).sort();if(s.code===o.code?JSON.stringify(s.aliases)!==JSON.stringify(i):s.aliases.length>0)throw new TypeError(`Invalid pm error code contract: ${s.code}`)}}function E(e){let t=new Set,s=e.map(o=>{let i=o.code.trim();if(!/^[a-z][a-z0-9_]*$/.test(i))throw new TypeError(`Invalid pm error code: ${JSON.stringify(o.code)}`);if(t.has(i))throw new TypeError(`Duplicate pm error code: ${i}`);t.add(i);let r=g(o.sources),d=g(o.emitting_commands),_=(o.canonical_code??i).trim(),c=g(o.aliases??[]),n=q(o.owned_states);if(!F(o,r,d,_,c))throw new TypeError(`Invalid pm error code contract: ${i}`);if(n.some(l=>l.expected_exit_class!==o.class))throw new TypeError(`Invalid pm refusal state exit class: ${i}`);return Object.freeze({...o,code:i,meaning:o.meaning.trim(),recovery:o.recovery.trim(),sources:r,emitting_commands:d,canonical_code:_,aliases:c,owned_states:n})});return $(s),Object.freeze(s.sort((o,i)=>o.code.localeCompare(i.code)))}function Ne(e,t){let s=C(e,t);return C(s.canonical_code??s.code,t)}function C(e,t){let s=e.trim(),o=t.find(i=>i.code===s);if(!o)throw new TypeError(`Unknown pm error code "${s}"`);return o}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1e8c03e6-149a-5819-a000-65e7e3b12f6d")}catch{}})();var z="Inspect the structured error guidance and retry the suggested command.",U=new Map(x.map(e=>[e.exit_code,e.class]));function T(e){return e.map(t=>{let s=`${t.code.replaceAll("_"," ")} condition.`,o={code:t.code,meaning:`${s.charAt(0).toUpperCase()}${s.slice(1)}`,stability:t.stable?"stable":"provisional",exit_code:t.exit_code,class:U.get(t.exit_code),recovery:z,sources:t.sources,emitting_commands:t.emitting_commands??["*"],canonical_code:t.canonical_code??t.code,aliases:t.aliases??[]};return t.owned_states&&(o.owned_states=t.owned_states),o})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ba993890-a230-521a-aac4-d873cbd184ba")}catch{}})();var A=[{code:"acceptance_criteria_mutation_conflict",exit_code:2,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_remove_unmatched",exit_code:3,sources:["sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_semicolon_forbidden",exit_code:2,stable:!0,sources:["core/item/parse.ts"]},{code:"accepted_rejected_value",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"alias_collision",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"alias_target_missing",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"already_claimed_by",exit_code:4,stable:!0,sources:["sdk/lifecycle/claim.ts"],emitting_commands:["claim"]},{code:"ambiguous_option_combination",exit_code:2,stable:!0,sources:["sdk/lifecycle/claim.ts","sdk/lifecycle/plan.ts"],emitting_commands:["claim","plan"]},{code:"annotation_alias_conflict",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"annotation_flag_like_value",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_if_absent_without_append",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_message_without_text",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_transposed_subcommand",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"append_empty_body",exit_code:2,stable:!0,sources:["sdk/lifecycle/append.ts"],emitting_commands:["append"]},{code:"assurance_registry_invalid",exit_code:1,sources:["sdk/governance/assurance.ts"]},{code:"bare_comma_entry_ambiguous",exit_code:2,sources:["core/item/parse.ts"]},{code:"blocker_identity_read_failed",exit_code:1,sources:["sdk/query/declared-blockers.ts"]},{code:"body_file_conflicts_with_body",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_missing_path",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_unreadable",exit_code:3,stable:!0,sources:["core/io/body-file.ts"]},{code:"budget_exceeded",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"bulk_create_route",exit_code:2,sources:["cli/register-mutation.ts"]},{code:"bulk_ids_input_empty",exit_code:2,sources:["core/io/bulk-ids-input.ts","sdk/history-compact.ts","sdk/history-mcp.ts"],owned_states:[{state:"bulk_ids_stdin_contains_no_nonempty_ids",probe_id:"bulk-ids-stdin-empty",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_missing_path",exit_code:2,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_token_omits_its_path",probe_id:"bulk-ids-file-path-missing",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_unreadable",exit_code:3,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_path_cannot_be_read",probe_id:"bulk-ids-file-unreadable",entrypoints:["update-many"],expected_exit_class:"not_found"}]},{code:"bundle_integrity_torn_install",exit_code:1,stable:!0,sources:["cli/bundle-integrity.ts"]},{code:"capability_undeclared",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"capability_unused",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"child_projection_item_bound_exceeded",exit_code:1,stable:!0,sources:["sdk/item-children.ts"]},{code:"close_reason_required",exit_code:2,stable:!0,sources:["sdk/lifecycle-policy.ts","sdk/lifecycle/close-many.ts"],emitting_commands:["*","close-many"]},{code:"close_through_update",exit_code:1,stable:!0,sources:["core/telemetry/observability.ts"]},{code:"close_validation_missing_fields",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"collected_zero_items",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"collection_transposed_subcommand",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"command_failed",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"command_namespace",exit_code:2,stable:!0,sources:["sdk/cli-contracts/runtime-contracts.ts"]},{code:"command_override_conflict",exit_code:4,stable:!0,sources:["sdk/compose.ts"]},{code:"config_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"config_key_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"config_value_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"conflicting_lifecycle_owner",exit_code:2,stable:!0,sources:["cli/register-operations.ts"]},{code:"context_evaluation_read_incomplete",exit_code:2,sources:["sdk/context-relevance.ts"]},{code:"context_signal_store_invalid",exit_code:2,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_stale",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_write_failed",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_takes_no_item_argument",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"core_item_field_requires_dedicated_flag",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"create_positional_type_without_title",exit_code:2,stable:!0,sources:["cli/register-mutation.ts"]},{code:"dependency_cardinality_created",exit_code:2,sources:["sdk/graph/cardinality-integrity.ts"]},{code:"dependency_edge_not_allowed",exit_code:2,stable:!0,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_flag_value_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_remove_no_match",exit_code:3,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"dependency_target_not_found",exit_code:3,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_temporal_order_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"duplicate_canonical_flag",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"duplicate_command",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"duplicate_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"duplicate_edge",exit_code:1,stable:!0,sources:["sdk/graph/remediation.ts"]},{code:"duplicate_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"duplicate_probe",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"duplicate_sweep_cost_limit",exit_code:4,stable:!0,sources:["sdk/query/duplicate-candidates.ts"],emitting_commands:["duplicate-candidates"]},{code:"duplicate_target_circular",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_is_duplicate",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_missing",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_self",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"empty_corpus",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"empty_surface",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"error_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-closure.ts","sdk/agent/tracker-preflight-contracts.ts"]},{code:"event_cursor_query_mismatch",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"event_history_integrity_failed",exit_code:1,sources:["core/history/event-index.ts"]},{code:"event_index_unavailable",exit_code:1,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"exit_code_mismatch",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"expect_hash_background_unsupported",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invalid",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invocation_rewritten",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_requires_mutation",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_target_required",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expected_revision_duplicate",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"expected_revision_scope_conflict",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"extension_command_activation_failed",exit_code:1,stable:!0,sources:["cli/commander-usage.ts"]},{code:"extension_dependency_name_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_spec_invalid",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_version_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_flag_value_invalid",exit_code:2,sources:["cli/extension-command-options.ts"]},{code:"extension_install_incomplete_source_scan",exit_code:2,sources:["sdk/extension/install-plan.ts"]},{code:"extension_install_rollback_failed",exit_code:1,sources:["sdk/extension/install-snapshot.ts"]},{code:"extension_install_soft_failed",exit_code:1,stable:!0,sources:["cli/register-setup.ts"]},{code:"extension_install_source_contains_destination",exit_code:2,stable:!0,sources:["sdk/extension/install-runtime.ts"]},{code:"extension_item_field_reserved",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_type_conflict",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_unknown",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_mutation_guard_failed",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_decision",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_denial",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_timed_out",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_read_output_invalid",exit_code:2,sources:["sdk/read-output/extension.ts"]},{code:"extension_update_health_partial_coverage",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"extensions_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"field_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_mcp_input_collision",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"github_source_entry_unbuilt",exit_code:2,stable:!0,sources:["sdk/extension/shared.ts"]},{code:"hierarchy_cardinality_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_cycle_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_parent_divergence_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"history_author_acknowledge_plan_conflict",exit_code:4,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_plan_fingerprint_required",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_preview_limit_invalid",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_required_values_missing",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_conflict",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_required",exit_code:2,stable:!0,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_not_actionable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_unreadable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_baseline_unavailable",exit_code:1,sources:["core/history/projection.ts"]},{code:"history_drift_chain_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_chain_mismatches"]},{code:"history_drift_hash_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_hash_mismatches"]},{code:"history_drift_merge_receipt",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_missing_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_missing_streams"]},{code:"history_drift_unreadable_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_unreadable_streams"]},{code:"history_drift_version_skew",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_version_skews"]},{code:"history_json_invalid",exit_code:1,sources:["core/history/read.ts"]},{code:"history_merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/history/read.ts"],canonical_code:"merge_conflict_markers_detected"},{code:"history_replay_invalid",exit_code:1,sources:["core/history/projection.ts","core/history/tombstone.ts"]},{code:"history_salvage_refused",exit_code:4,sources:["sdk/history/salvage.ts"]},{code:"history_stream_over_compact_threshold",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"history_target_out_of_range",exit_code:1,stable:!0,sources:["core/history/projection.ts"]},{code:"history_timestamp_invalid",exit_code:1,sources:["core/history/event-index.ts","core/history/history.ts"]},{code:"history_union_rebase_conflict",exit_code:4,sources:["sdk/merge/history-scalar-rebase.ts"]},{code:"history_unknown_author_events",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_unknown_author_events"]},{code:"history_version_mapping_unavailable",exit_code:2,sources:["core/history/version-address.ts"]},{code:"history_version_pruned",exit_code:2,sources:["core/history/projection.ts"]},{code:"host_environment_capacity_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_operation_invalid",exit_code:2,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_permission_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_resource_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"improvement_metric_contract_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"improvement_observation_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"incomplete_allowed_values",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"inconsistent_concept_kind",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"init_existing_settings_requires_force",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_gitignore_unwritable",exit_code:1,stable:!0,sources:["sdk/workspace.ts"]},{code:"init_id_prefix_conflict",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_id_prefix_path_like",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"integrity_history_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_storage_history_conflict_markers"]},{code:"integrity_history_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_history_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_ahead_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_ahead_items"]},{code:"integrity_item_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_outdated_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_outdated_items"]},{code:"integrity_item_parse_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"invalid_argument_value",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/item/priority.ts","core/telemetry/observability.ts","sdk/context-intent-contracts.ts","sdk/dependencies.ts","sdk/governance/assurance-mutation-error.ts","sdk/lifecycle/create.ts","sdk/lifecycle/task-composition.ts","sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts","sdk/query/next.ts","sdk/runtime-input.ts","sdk/runtime/mutation-admission.ts","sdk/runtime/mutation-value-validation.ts","sdk/runtime/schema-preview.ts","sdk/workspace.ts"],emitting_commands:["*","create","next","task-composition","update","update-many"]},{code:"invalid_command_usage",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts"]},{code:"invalid_event_cursor",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_cursor_mode",exit_code:2,sources:["cli/register-list-query.ts","sdk/mutation-events.ts","sdk/runtime-extended-actions.ts"]},{code:"invalid_event_follow_interval",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_limit",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_since",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_history_analytics_limit",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_minimum_sample",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_since",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_improvement_ledger",exit_code:1,sources:["sdk/improvement-ledger-validation.ts"]},{code:"invalid_improvement_metric",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_limit",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_timestamp",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_provenance_predicate",exit_code:2,stable:!0,sources:["sdk/history-provenance.ts"]},{code:"invalid_query_cursor",exit_code:2,stable:!0,sources:["sdk/pagination.ts","sdk/query/window-pagination.ts"]},{code:"invalid_read_output_session",exit_code:2,sources:["sdk/read-output-session.ts"]},{code:"invalid_reproducible_process_environment",exit_code:2,sources:["sdk/reproducibility/process.ts"]},{code:"invalid_workspace_snapshot_target",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"item_already_active",exit_code:4,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"item_already_exists",exit_code:4,stable:!0,sources:["sdk/lifecycle/create.ts"],emitting_commands:["create"]},{code:"item_deleted",exit_code:3,sources:["core/history/tombstone.ts"]},{code:"item_document_encoding_invalid",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_document_invalid",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_document_roundtrip_failed",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_format_version_unsupported",exit_code:4,sources:["core/item/item-format.ts"]},{code:"item_id_collision",exit_code:4,stable:!0,sources:["sdk/lifecycle/copy.ts"],emitting_commands:["copy"]},{code:"item_identity_ambiguous",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_identity_conflict",exit_code:4,sources:["sdk/governance/validate-history-drift.ts","sdk/lifecycle/item-revision.ts","sdk/merge/three-way.ts","sdk/query/declared-blockers.ts"]},{code:"item_identity_reserved",exit_code:4,sources:["core/history/history.ts"]},{code:"item_not_found",exit_code:3,stable:!0,sources:["cli/error-guidance.ts","core/store/item-store.ts","core/telemetry/observability.ts","sdk/governance/validate-history-drift.ts"]},{code:"item_revision_conflict",exit_code:4,sources:["core/store/item-mutation-precondition.ts"]},{code:"likely_duplicate",exit_code:4,stable:!0,sources:["sdk/similarity.ts"]},{code:"linked_artifact_mutation_conflict",exit_code:2,sources:["sdk/linked-artifacts.ts"]},{code:"linked_resource_positional_value",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"linked_test_command_immutable",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_command_not_executable",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_context_invalid",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_patch_fields_unsupported",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_remove_no_match",exit_code:3,sources:["sdk/test/execution.ts"]},{code:"linked_test_update_ambiguous",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_update_no_match",exit_code:3,sources:["sdk/test/update.ts"]},{code:"linked_test_value_not_quoted",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"list_source_incomplete",exit_code:1,stable:!0,sources:["sdk/query/list.ts"],emitting_commands:["list"]},{code:"local_package_archive_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"local_source_not_found_bare_name",exit_code:3,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"lock_conflict",exit_code:4,stable:!0,sources:["cli/error-guidance.ts","core/lock/lock.ts","core/telemetry/observability.ts"]},{code:"lock_lost",exit_code:4,sources:["core/lock/lock.ts"]},{code:"lock_path_unsafe",exit_code:4,sources:["core/lock/lock-confinement.ts"]},{code:"locks_stale_count",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"locks_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"malformed_plan_step_evidence",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"managed_state_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"managed_state_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_capabilities_absent",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"manifest_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_unknown_key",exit_code:1,sources:["core/extensions/manifest-schema.ts"],owned_states:[{state:"author_workspace_manifest_declares_an_unknown_top_level_key",probe_id:"author-manifest-unknown-key",entrypoints:["health"],expected_exit_class:"generic_failure"}]},{code:"manifest_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"mcp_annotation_file_unavailable",exit_code:2,sources:["sdk/runtime-input.ts"]},{code:"mcp_stdin_unavailable",exit_code:2,sources:["sdk/annotations.ts"]},{code:"mcp_task_not_found_or_not_authorized",exit_code:3,sources:["sdk/mcp/tasks.ts"]},{code:"merge_artifacts_ignored",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_bun_launcher_unavailable",exit_code:5,sources:["sdk/merge/install.ts"]},{code:"merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/item/item-format.ts"],aliases:["history_merge_conflict_markers_detected"]},{code:"merge_decisions_unreviewed",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_driver_configuration_drift",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_driver_configuration_missing",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_fence_drift",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_fence_missing",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_git_config_unwritable",exit_code:5,stable:!0,sources:["sdk/merge/install.ts"]},{code:"merge_receipt_evidence_invalid",exit_code:4,sources:["core/diagnostics/remediation.ts","sdk/merge/reconcile.ts"]},{code:"merge_receipt_history_reference_missing",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_receipt_not_portable",exit_code:4,sources:["sdk/merge/receipts.ts"]},{code:"merge_receipts_pending",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_reconcile_receipt_evidence_untrusted",exit_code:4,sources:["sdk/history-repair.ts"]},{code:"merge_root_not_found",exit_code:3,stable:!0,sources:["sdk/merge/install.ts"]}];(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]="7a831620-2973-5048-b691-f90e85f99dc2")}catch{}})();var O=[{code:"merge_settlement_hook_conflict",exit_code:4,sources:["sdk/merge/settlement-hook.ts"]},{code:"merge_settlement_review_required",exit_code:4,sources:["sdk/merge/ignored-artifacts.ts","sdk/merge/reconcile.ts","sdk/merge/stage.ts"]},{code:"missing_allowed_values",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"missing_budget",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"missing_cli_flag",exit_code:1,sources:["sdk/cli-contracts/tool-option-contracts.ts"]},{code:"missing_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"missing_directory",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"missing_init_recovery",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"missing_lifecycle_target",exit_code:2,stable:!0,sources:["sdk/extension.ts"]},{code:"missing_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"missing_observed_signature",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"missing_parameter_alias",exit_code:1,sources:["sdk/cli-contracts/tool-option-contracts.ts"]},{code:"missing_positive_execution_receipt",exit_code:1,sources:["sdk/test/execution.ts"]},{code:"missing_probe",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"missing_required_argument",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","cli/main.ts","cli/register-mutation.ts","cli/schema/registration.ts","core/telemetry/observability.ts","sdk/governance/assurance-action.ts","sdk/history-redact.ts","sdk/invocation-author.ts","sdk/lifecycle/claim.ts"],emitting_commands:["*","claim"]},{code:"missing_required_option",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/context-intent-contracts.ts","sdk/lifecycle/create.ts","sdk/lifecycle/plan.ts"],emitting_commands:["*","create","plan"]},{code:"missing_suggested_retry",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"missing_suggested_retry_args",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"module_import_failed",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"multi_target_github_install_ambiguous",exit_code:2,stable:!0,sources:["cli/register-setup.ts"]},{code:"mutation_author_required",exit_code:2,stable:!0,sources:["sdk/mutation-guard.ts"]},{code:"mutation_document_unreadable",exit_code:2,sources:["cli/register-structured-mutation.ts"]},{code:"mutation_option_value_invalid",exit_code:2,sources:["sdk/lifecycle/mutation-option-validation.ts"],emitting_commands:["item mutate"]},{code:"mutation_secret_guard_blocked",exit_code:4,stable:!0,sources:["sdk/mutation-guard.ts"]},{code:"no_matching_tests",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_projects_matched_filters",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_test_files_found",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_tests_found",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_update_fields",exit_code:1,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts"]},{code:"no_version_bounds_declared",exit_code:1,sources:["core/extensions/manifest-schema.ts"],owned_states:[{state:"author_workspace_manifest_omits_canonical_pm_version_bounds",probe_id:"author-manifest-version-bounds-missing",entrypoints:["health"],expected_exit_class:"generic_failure"}]},{code:"non_refusal_exit",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"npm_pack_json_shape_unsupported",exit_code:1,sources:["sdk/extension/install-sources.ts"]},{code:"npm_package_archive_missing",exit_code:1,sources:["sdk/extension/install-sources.ts"]},{code:"npm_package_archive_unsafe",exit_code:1,sources:["sdk/extension/install-sources.ts"]},{code:"npm_package_not_found",exit_code:3,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"ownership_conflict",exit_code:4,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/annotations.ts"]},{code:"ownership_dependency_bypass_restricted_options",exit_code:1,stable:!0,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"ownership_metadata_bypass_restricted_options",exit_code:1,stable:!0,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"package_spec_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"package_upgrade_modes_mutually_exclusive",exit_code:2,sources:["sdk/governance/upgrade.ts"]},{code:"positional_shape_budget_exceeded",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"positional_signature_mismatch",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"profile_name_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"profile_name_not_normalized",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"profile_summary_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"profile_title_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"project_runtime_history_epoch_incompatible",exit_code:4,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_runtime_item_format_incompatible",exit_code:4,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_runtime_stale_mutation",exit_code:4,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_runtime_stale_read",exit_code:1,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_schema_field_requires_declared_flag",exit_code:2,sources:["core/extensions/item-fields.ts"]},{code:"projection_options_mutually_exclusive",exit_code:2,sources:["sdk/query/get.ts","sdk/query/list.ts","sdk/query/search-contracts.ts"],emitting_commands:["get","list","search"]},{code:"provenance_value_domain_invalid",exit_code:2,sources:["core/diagnostics/remediation.ts"]},{code:"read_output_cursor_command_mismatch",exit_code:2,sources:["sdk/read-output/continuation.ts"]},{code:"read_output_cursor_invalid",exit_code:2,sources:["sdk/read-output/continuation.ts"]},{code:"read_output_cursor_stale",exit_code:2,sources:["sdk/read-output/continuation.ts"]},{code:"recovery_kind_mismatch",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"redundant_edge",exit_code:1,stable:!0,sources:["sdk/graph/remediation.ts"]},{code:"refusal_allowed_values_mismatch",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_error_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_exit_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_mutated_state",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_probe_missing",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_recovery_failed",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"reindex_already_running",exit_code:4,stable:!0,sources:["sdk/governance/reindex.ts"]},{code:"removed_canonical_spelling",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"removed_compatibility_spelling",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"reopen_reason_required",exit_code:2,sources:["sdk/lifecycle/reopen.ts"],emitting_commands:["item reopen"]},{code:"reopen_receipt_missing",exit_code:1,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"reopen_target_status_invalid",exit_code:2,sources:["sdk/lifecycle/reopen.ts"],emitting_commands:["item reopen"]},{code:"reported_zero_passes",exit_code:1,sources:["sdk/test/execution-receipts.ts"]},{code:"reported_zero_tests",exit_code:1,sources:["sdk/test/execution-receipts.ts"]},{code:"reserved_item_field",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"retry_failed",exit_code:1,sources:["sdk/agent/refusal-closure.ts","sdk/agent/tracker-preflight-contracts.ts"]},{code:"schema_migration_input_required",exit_code:2,stable:!0,sources:["cli/migration-gates.ts"]},{code:"semantic_spelling_collision",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"settings_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"settings_read_fs_error",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_read_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_read_invalid_schema",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_read_merge_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_section_document_malformed",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_document_missing",exit_code:3,sources:["core/store/settings-sections.ts"]},{code:"settings_section_invalid",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_name_invalid",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_reserved",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_revision_conflict",exit_code:4,sources:["core/store/settings-sections.ts"]},{code:"settings_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"settings_write_assigned_path_invalid",exit_code:2,sources:["core/store/settings.ts"]},{code:"settings_write_invalid_existing_json",exit_code:2,sources:["core/store/settings.ts"]},{code:"settings_write_invalid_existing_schema",exit_code:2,sources:["core/store/settings.ts"]},{code:"stale_budget",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"stale_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"stale_observed_signature",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"stale_revision",exit_code:4,sources:["core/store/item-store.ts"]},{code:"start_blocked_by_open_dependency",exit_code:4,sources:["sdk/lifecycle/start-blockers.ts"],emitting_commands:["claim","start-task","update"]},{code:"status_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"status_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"status_lifecycle_role_required",exit_code:2,sources:["sdk/schema.ts"]},{code:"stdin_json_invalid",exit_code:2,stable:!0,sources:["sdk/structured-mutations.ts"]},{code:"stdin_json_persisted_annotation_changed",exit_code:2,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"stdin_json_unknown_key",exit_code:2,stable:!0,sources:["sdk/structured-mutations.ts"]},{code:"structured_event_immutable",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"structured_event_input_conflict",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"structured_event_json_empty",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"structured_event_json_invalid",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"structured_event_since_invalid",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"suggested_retry_args_mismatch",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"telemetry_endpoint_probe_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_endpoint_probe_http_status",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_otel_export_failing",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_queue_high_retries",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_queue_invalid_rows",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_queue_pending",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_schema_version_behind",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_state_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"template_type_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"terminal_plan_mutation",exit_code:4,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"terminal_state_conflict",exit_code:4,stable:!0,sources:["core/telemetry/observability.ts","sdk/lifecycle/claim.ts"],emitting_commands:["*","claim"]},{code:"test_measure_requires_execution",exit_code:2,sources:["sdk/test/prerequisites.ts"]},{code:"test_measure_requires_run",exit_code:2,sources:["sdk/test/prerequisites.ts"]},{code:"text_unpaired_surrogate",exit_code:2,sources:["core/item/item-format.ts","core/shared/output-unicode.ts"]},{code:"tracked_runtime_cache_files",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_storage_tracked_runtime_cache_files"]},{code:"tracker_not_initialized",exit_code:3,stable:!0,sources:["cli/error-guidance.ts","core/store/tracker-preflight.ts","core/telemetry/observability.ts"],owned_states:[{state:"selected_tracker_root_exists_without_settings",probe_id:"tracker-root-settings-missing",entrypoints:["list"],expected_exit_class:"not_found"}]},{code:"tracker_root_missing",exit_code:3,stable:!0,sources:["core/store/tracker-preflight.ts"],owned_states:[{state:"selected_tracker_root_does_not_exist",probe_id:"tracker-root-missing",entrypoints:["list"],expected_exit_class:"not_found"}]},{code:"tracker_root_not_directory",exit_code:2,stable:!0,sources:["core/store/tracker-preflight.ts"],owned_states:[{state:"selected_tracker_root_is_a_regular_file",probe_id:"tracker-root-not-directory",entrypoints:["list"],expected_exit_class:"usage"}]},{code:"tracker_root_unreadable",exit_code:1,sources:["core/store/tracker-preflight.ts"],owned_states:[{state:"selected_tracker_root_is_not_readable",probe_id:"tracker-root-unreadable",entrypoints:["list"],expected_exit_class:"generic_failure"}]},{code:"transaction_abandoned",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_committed",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_create_compensated",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"transaction_journal_invalid",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_partial_mutation",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"transaction_plan_mismatch",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_preview_external_schema",exit_code:2,sources:["sdk/item-transaction.ts"]},{code:"transaction_preview_non_regular_file",exit_code:2,sources:["core/fs/fs-utils.ts"]},{code:"transaction_preview_snapshot_changed",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"transaction_recovery_plan_missing",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"type_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"type_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"undeclared_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"unexpected_refusal_probe",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"unknown_command",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/cli-contracts/runtime-contracts.ts"]},{code:"unknown_context_intent",exit_code:2,stable:!0,sources:["sdk/context-intent-contracts.ts"]},{code:"unknown_error",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"unknown_field",exit_code:3,stable:!0,sources:["sdk/schema.ts"]},{code:"unknown_field_projection",exit_code:2,stable:!0,sources:["sdk/query/get.ts","sdk/query/list.ts","sdk/query/search-contracts.ts"],emitting_commands:["get","list","search"]},{code:"unknown_item_type",exit_code:3,stable:!0,sources:["sdk/schema.ts"]},{code:"unknown_lifecycle_action",exit_code:2,stable:!0,sources:["sdk/agent/subcommand-recovery.ts"],canonical_code:"unknown_subcommand"},{code:"unknown_noun",exit_code:2,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"unknown_option",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","cli/runtime/invocation-options.ts","core/telemetry/observability.ts"],owned_states:[{state:"declared_option_is_rejected_on_the_selected_command_path",probe_id:"cross-command-unknown-option",entrypoints:["deps"],expected_exit_class:"usage"}]},{code:"unknown_plan_template",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"unknown_provenance_dimension",exit_code:2,stable:!0,sources:["sdk/history-provenance.ts"]},{code:"unknown_status",exit_code:3,stable:!0,sources:["sdk/schema.ts"]},{code:"unknown_subcommand",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","sdk/agent/subcommand-recovery.ts"],aliases:["unknown_lifecycle_action"],owned_states:[{state:"config_action_token_is_not_declared",probe_id:"config-unknown-action",entrypoints:["config"],expected_exit_class:"usage"},{state:"graph_command_token_is_not_declared",probe_id:"graph-unknown-subcommand",entrypoints:["graph"],expected_exit_class:"usage"},{state:"nested_command_token_is_not_declared_by_its_family",probe_id:"schema-unknown-subcommand",entrypoints:["schema"],expected_exit_class:"usage"},{state:"package_lifecycle_token_is_not_declared",probe_id:"package-unknown-action",entrypoints:["package"],expected_exit_class:"usage"}]},{code:"unsafe_init_recovery",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"unsupported_update_option",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"upsert_key_ambiguous",exit_code:4,sources:["sdk/structured-mutations.ts"]},{code:"upsert_key_conflict",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"upsert_key_duplicate",exit_code:2,sources:["sdk/item-transaction.ts","sdk/structured-mutations.ts"]},{code:"upsert_key_missing",exit_code:2,sources:["sdk/structured-mutations.ts"]},{code:"upsert_match_changed",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"validate_command_references_stale_pm_ids",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_files_missing_linked_paths",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_files_orphaned_paths",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_files_tracked_all_strict_forces_pm_internals",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_format_version_ahead_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"integrity_item_ahead_format_version"},{code:"validate_format_version_outdated_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"integrity_item_outdated_format_version"},{code:"validate_hierarchy_parent_cycle",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_hierarchy_parent_cycle_error",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_history_drift_chain_mismatches",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_chain_mismatch"},{code:"validate_history_drift_hash_mismatches",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_hash_mismatch"},{code:"validate_history_drift_missing_streams",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_missing_stream"},{code:"validate_history_drift_unreadable_streams",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_unreadable_stream"},{code:"validate_history_drift_version_skews",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_version_skew"},{code:"validate_history_unknown_author_events",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_unknown_author_events"},{code:"validate_lifecycle_active_closure_like_metadata",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_active_terminal_parent",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_dependency_cycles",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_dependency_cycles_error",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_stale_blockers",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_merge_decisions_unreviewed",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"validate_merge_driver_configuration",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"validate_merge_fence_drift",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_custom_profile_missing_required_fields",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_duplicate_issue_codes",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_acceptance_criteria",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_close_reason",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_closed_at",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_confidence",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_estimate",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_release",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_reviewer",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_risk",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_sprint",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_resolution_missing_fields",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_duplicate_item_ids",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_history_conflict_markers",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"integrity_history_conflict_marker"},{code:"validate_storage_resurrected_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_tracked_runtime_cache_files",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"tracked_runtime_cache_files"},{code:"validate_storage_unparseable_config",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_unparseable_history",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_unreadable_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"vectorization_embedding_identity_changed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"vectorization_stale_items_remaining",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"visible_surface_ceiling_exceeded",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"workflow_duplicate_type",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_policy_approval_history_invalid",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_audit_failed",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_input_unreadable",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_invalid",exit_code:2,sources:["core/policy/workflow-policy.ts"]},{code:"workflow_policy_refused",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_registry_invalid",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_status_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_transition_malformed",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_type_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_type_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workspace_history_chain_invalid",exit_code:4,sources:["core/history/workspace-history.ts"]},{code:"workspace_history_state_conflict",exit_code:4,stable:!0,sources:["core/history/workspace-history.ts"]},{code:"workspace_root_pm_path",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"workspace_snapshot_force_required",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_manifest_mismatch",exit_code:4,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_name_reserved_fingerprint",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_not_found",exit_code:3,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_permission_denied",exit_code:1,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_resource_exhausted",exit_code:1,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_storage_exhausted",exit_code:1,sources:["sdk/workspace-snapshot.ts"]},{code:"wrong_item_type",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]}];(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]="b525d8c8-3a70-52bd-83db-c956aba0c6fb")}catch{}})();var ze=E(T([...A,...O]));(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c2e89d3c-9abc-5ca7-a290-69a54dd694ab")}catch{}})();var G=Object.freeze({"--body":"Set the item body.","--body-file":"Read the item body from a file, or from stdin when set to -.","--description":"Set the item description.","--stdin":"Read the value from stdin.","--stdin-json":"Read a complete JSON document from stdin."}),B=new Set(["--add","--body","--comment","--dep","--dep-remove","--description","--doc","--event","--field","--file","--learning","--note","--remove","--reminder","--test","--type-option"]),V=new Set(["append","comments","create","docs","files","learnings","notes","test","update","update-many"]),Y=new Set(["close-many:--ids","comments:--file","create:--body-file","history-compact:--ids","learnings:--file","notes:--file","update:--body-file","update-many:--ids"]),X=new Set(["close-many:--ids","history-compact:--ids","update-many:--ids"]),W=["--allow-","--check-","--dry-run","--explain","--fail-","--fix-","--full","--has-","--include-","--json","--no-","--prune-","--quiet","--refresh-","--require-","--runtime-only","--schema-only","--skip-","--stream","--strict-","--summary","--today","--verbose"],H=new Set(["--activate","--active-only","--adopt","--adopt-all","--all","--all-actionable","--all-affected-ids","--all-day","--all-streams","--acknowledge-linked-tests","--append-stable","--auto-fix","--auto-pm-context","--availability-only","--background","--brief","--by-assignee","--by-priority","--by-tag","--catalog","--claim","--clear","--clear-comments","--clear-criteria","--clear-deps","--clear-docs","--clear-events","--clear-files","--clear-learnings","--clear-notes","--clear-reminders","--clear-tests","--clear-type-options","--cli-only","--closed","--compact","--completion","--count","--counts","--deactivate","--declarative","--defaults","--describe","--diff","--doctor","--empty-body","--explore","--field-utilization","--filter-empty-body","--flags-only","--follow","--force","--global","--highlight","--hybrid","--id-only","--if-available","--ignore-global","--include_unparented","--infer","--init","--install","--isolated","--lean","--list","--local","--manage","--markdown","--metadata-coverage","--next","--normalize-provenance","--only","--only-last","--output-row-contract","--override-linked-pm-context","--override-linked-workspace-context","--packages-only","--past","--phrase-exact","--profile","--progress","--project","--promote-to-item-dep","--provenance","--provenance-summary","--raw","--ready-only","--ready_only","--rebuild","--recent","--reload","--repair","--replace-deps","--replace-docs","--replace-files","--replace-tests","--required","--required-on-create","--run","--runtime-probe","--save-baseline","--scaffold","--semantic","--shared-host-safe","--storage","--title-exact","--token-accounting","--trace","--tree","--unbounded","--uninstall","--validate-paths","--verify","--watch","--with-packages"]),J=new Set(["--only-index"]),K=new Set(["activity:--stream","eval:--fail-under","validate:--fix-scope"]),Q=new Set(["activity:--stream","close:--validate-close","close-many:--validate-close","comments:--author","learnings:--author","notes:--author"]),Z=new Set(["--regression"]);function ee(e,t){return t==="--stdin"||t==="--stdin-json"?["stdin"]:Y.has(`${e}:${t}`)?["argv","file","stdin"]:t.endsWith("-file")?["argv","file"]:B.has(t)&&V.has(e)?["argv","stdin"]:["argv"]}function te(e,t){let s=K.has(`${e}:${t.flag}`)||t.value_name!==void 0||t.value_type==="string"||t.value_type==="number"||t.list===!0||t.repeatable===!0,o=t.value_type==="boolean"||t.flag==="--stdin"||t.flag==="--stdin-json"||t.flag.startsWith("--filter-")&&(t.flag.endsWith("-missing")||t.flag.startsWith("--filter-has-")||t.flag.startsWith("--filter-no-"))||W.some(i=>t.flag.startsWith(i));return s||J.has(t.flag)||!H.has(t.flag)&&!o}function se(e,t){return t.value_arity!==void 0?t.value_arity:te(e,t)?Z.has(t.flag)||Q.has(`${e}:${t.flag}`)?"optional":"required":"none"}function oe(e,t){let s=f(e),o=se(s,t),i=o!=="none",r=ee(s,t.flag),d=t.description??G[t.flag]??`${i?"Set":"Enable"} ${t.flag.slice(2).replaceAll("-"," ")}.`;return{...t,description:d,takes_value:i,value_required:o==="required",...i?{value_name:t.value_name??"value"}:{},value_type:i?t.value_type??"string":"boolean",required:t.required===!0,repeatable:t.repeatable===!0||t.list===!0,input_sources:r,...r.includes("stdin")&&t.flag!=="--stdin"&&t.flag!=="--stdin-json"?{stdin_token:"-"}:{},...X.has(`${s}:${t.flag}`)?{file_token_prefix:"@"}:{}}}function Be(e,t){return t.map(s=>oe(e,s))}function Ve(e,t,s){let o=e.trim().toLowerCase(),i=[],r=new Map,d=0;for(let c of s)if(c.command.trim().toLowerCase()===o){if(d+=1,r.has(c.flag)){i.push({code:"duplicate_observation",command:o,flag:c.flag,detail:`${o} ${c.flag} was observed more than once.`});continue}r.set(c.flag,c)}let _=new Set(t.map(({flag:c})=>c));for(let c of t){let n=r.get(c.flag);if(!n){i.push({code:"missing_observation",command:o,flag:c.flag,detail:`${o} ${c.flag} has no executable option observation.`});continue}for(let[l,I]of[["takes_value","takes_value_mismatch"],["value_required","value_required_mismatch"],["repeatable","repeatable_mismatch"]])c[l]!==n[l]&&i.push({code:I,command:o,flag:c.flag,detail:`${o} ${c.flag} declares ${l}=${String(c[l])} but the executable option reports ${String(n[l])}.`})}for(let c of r.values())_.has(c.flag)||i.push({code:"undeclared_observation",command:o,flag:c.flag,detail:`${o} ${c.flag} is executable but absent from invocation contracts.`});return i.sort((c,n)=>c.flag.localeCompare(n.flag)||c.code.localeCompare(n.code)),{ok:i.length===0,declared_count:t.length,observed_count:d,findings: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]="76c420db-b520-5fde-bd43-16a7324feb0a")}catch{}})();var ie=["mutation_receipt","entity","collection","diagnostic","stream"],ce=new Set(["append","claim","close","close-task","copy","create","delete","focus","pause-task","release","restore","start-task","update"]),re=new Set(["close-many","update-many"]),ae=new Set(["activity","comments","contracts","events","history","learnings","list","notes","search"]),ne=new Set(["aggregate","deps","graph","health","history-redact","history-repair","history-compact","stats","validate"]);function p(e){if(e.command.trim().length===0)throw new TypeError("command must be a non-empty command path");if(!ie.includes(e.kind))throw new TypeError(`Unsupported output envelope kind: ${e.kind}`);return e}function S(e){let t=e.trim().replace(/\s+/gu," "),[s=t]=t.split(" ");return re.has(s)?p({command:t,kind:"collection",wrapper_key:"rows",cardinality:"many",format_flag:"--json"}):ce.has(s)?p({command:t,kind:"mutation_receipt",wrapper_key:null,cardinality:"one",format_flag:"--json"}):ae.has(s)?p({command:t,kind:"collection",wrapper_key:s==="contracts"?null:"items",cardinality:"many",format_flag:"--json"}):ne.has(s)?p({command:t,kind:"diagnostic",wrapper_key:null,cardinality:"none",format_flag:"--json"}):p({command:t,kind:s==="get"?"entity":"diagnostic",wrapper_key:s==="get"?"item":null,cardinality:s==="get"?"one":"none",format_flag:"--json"})}var de=u.map(e=>S(e)),_e=new Map(de.map(e=>[e.command,e]));function He(e){let t=e.trim().replace(/\s+/gu," ");if(t.length===0)throw new TypeError("command must be a non-empty command path");let[s=t]=f(t).split(" "),o=_e.get(s);return o?{...o,command:t}:S(t)}function le(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(e){return le(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.status=="string"&&e.status.length>0&&Number.isSafeInteger(e.changed_field_count)&&Number(e.changed_field_count)>=0&&(e.close_reason===void 0||typeof e.close_reason=="string")&&(e.deleted===void 0||typeof e.deleted=="boolean")&&(e.previous_status===void 0||typeof e.previous_status=="string")&&(e.warnings===void 0||Array.isArray(e.warnings))}function Je(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){throw new TypeError(`Mutation receipt must be valid JSON: ${String(s)}`,{cause:s})}if(!ue(t))throw new TypeError("Mutation receipt must be a flat object with top-level id, status, and changed_field_count fields");return{id:t.id,status:t.status,changedFieldCount:t.changed_field_count,...typeof t.close_reason=="string"?{closeReason:t.close_reason}:{},...typeof t.deleted=="boolean"?{deleted:t.deleted}:{},...typeof t.previous_status=="string"?{previousStatus:t.previous_status}:{},...Array.isArray(t.warnings)?{warnings:t.warnings}:{}}}(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]="0c0bb7ab-6157-5861-ad7e-a63ae62220f4")}catch{}})();var me=new Set(["claim","close","context","create","get","help","init","list","next","plan","release","search","update","validate","workspace"]),pe=new Set(["append","comments","config","contracts","deps","docs","events","files","focus","graph","health","history","learnings","list-all","list-blocked","list-closed","list-in-progress","list-open","notes","profile","schema","test"]),fe=Object.freeze({workspace:new Set(["config","gc","health","init","merge","profile","schema","telemetry","workspace"]),intake:new Set(["copy","create","focus","item","restore"]),context:new Set(["activity","aggregate","context","ctx","duplicates","eval","get","help","list","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","next","search","stats"]),lifecycle:new Set(["claim","close","close-many","close-task","delete","pause-task","item-reopen","release","start-task","update","update-many"]),evidence:new Set(["append","comments","docs","events","files","history","history-attest","history-author-acknowledge","history-compact","history-redact","history-repair","learnings","notes"]),graph:new Set(["deps","graph","plan"]),quality:new Set(["assurance","contracts","test","test-all","validate"]),automation:new Set(["event","meet","remind"])}),ge=new Set(["extension","install","package","packages","upgrade"]);function xe(e){let t=m(e.trim().toLowerCase());if(t==="ops")return"quality";for(let[s,o]of Object.entries(fe))if(o.has(t))return s;return ge.has(t)?"extensions":"internal"}var y=Object.freeze([...u.flatMap(e=>e==="item"?["item","item-reopen"]:[e,...b.filter(t=>t.alias===e).map(t=>t.canonical)]).map(e=>({command:e,tier:me.has(m(e))?"core":pe.has(m(e))?"standard":"full",family:xe(e)})),{command:"ops",tier:"core",family:"quality"},{command:"completion-statuses",tier:"internal",family:"internal"},{command:"completion-tags",tier:"internal",family:"internal"},{command:"completion-types",tier:"internal",family:"internal"},{command:"test-runs-worker",tier:"internal",family:"internal"},{command:"item test worker",tier:"internal",family:"internal"}]),ye=y,et=Object.freeze({max_lines:50,max_utf8_bytes:6e3}),tt=Object.freeze(["-V, --version","--all","--json","--output-include <fields>","--output-limit <count>","--output-budget <tokens|unbounded>","--output-cursor <cursor>","--pm-path <dir>","--no-extensions","--no-pager","--explain","-h, --help"]);var M={core:0,standard:1,full:2,internal:3},N=new Map(ye.map(({command:e,tier:t})=>[e,t]));function st(e,t="standard"){return N.get(e.trim().toLowerCase())??N.get(m(e.trim().toLowerCase()))??t}function ot(e){return be(e,y)}function be(e,t){let s=M[e];return t.filter(o=>o.tier!=="internal"&&M[o.tier]<=s).map(o=>o.command)}function ke(e,t){return t.filter(s=>s.family===e).map(s=>s.command)}var he=["workspace","intake","context","lifecycle","evidence","graph","quality","automation","extensions","internal"],ve=new Set([...k.filter(e=>e.hidden).map(e=>e.alias),"ctx","extension","install","item-reopen","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","packages","upgrade"]);function it(e=y){return he.map(t=>({family:t,commands:ke(t,e).filter(s=>e.find(o=>o.command===s)?.tier!=="internal"&&!ve.has(s))})).filter(({commands:t})=>t.length>0)}var ct=Object.freeze({pm_append:"append",pm_claim:"claim",pm_close:"close",pm_comments:"comments",pm_config:"config",pm_context:"context",pm_contracts:"contracts",pm_copy:"copy",pm_create:"create",pm_deps:"deps",pm_discover:"help",pm_docs:"docs",pm_events:"history",pm_files:"files",pm_focus:"focus",pm_get:"get",pm_graph:"graph",pm_health:"health",pm_learnings:"learnings",pm_list:"list",pm_mutate:"update",pm_next:"next",pm_notes:"notes",pm_plan:"plan",pm_profile:"profile",pm_release:"release",pm_run:"package",pm_schema:"schema",pm_search:"search",pm_test:"test",pm_update:"update",pm_validate:"validate"});var rt=Object.freeze([{uri:"pm://workspace/context",name:"Workspace context",description:"Bounded project context for orientation, including active hierarchy and progress.",mimeType:"application/json"},{uri:"pm://workspace/focus",name:"Active focus",description:"The session focus that supplies the default create parent.",mimeType:"application/json"},{uri:"pm://workspace/claims",name:"Active claims",description:"Bounded in-progress work and active ownership context.",mimeType:"application/json"},{uri:"pm://workspace/agent-guide",name:"Agent guidance",description:"Repository-local AGENTS.md instructions, bounded for safe host attachment.",mimeType:"text/markdown"}]),at=Object.freeze([{name:"orient",description:"Build bounded live context, search all statuses, and select canonical work without creating duplicates.",arguments:[{name:"request",description:"The user's requested outcome or topic.",required:!0},{name:"scope",description:"Optional bounded workspace or subsystem scope.",required:!1}],template:"Orient to the live pm workspace for: {{request}}. Scope hint: {{scope}}. Read context, search all statuses, inspect full metadata for relevant items, and select canonical lineage before any mutation."},{name:"claim-and-start",description:"Claim one canonical item and begin implementation with linked context.",arguments:[{name:"id",description:"Canonical pm item id.",required:!0}],template:"Read {{id}} in full, claim it, set it in_progress, then implement only its acceptance scope while linking files, docs, tests, and evidence."},{name:"record-evidence-and-close",description:"Record exact verification evidence, close the item, and release ownership.",arguments:[{name:"id",description:"Canonical pm item id.",required:!0},{name:"evidence",description:"Exact verification and outcome evidence.",required:!0}],template:"For {{id}}, record this evidence: {{evidence}}. Verify linked tests, close only if acceptance is met, then release the claim."}]);export{D as a,w as b,R as c,Ee as d,Te as e,Ae as f,Oe as g,Se as h,x as i,E as j,Ne as k,C as l,ze as m,oe as n,Be as o,Ve as p,y as q,st as r,ot as s,it as t,ie as u,p as v,de as w,He as x,ue as y,Je as z};
|
|
2
|
-
//# sourceMappingURL=chunk-FEPE2CE4.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{M as S,N as L,O as B,P as M,Q as U,R as j,S as k,X as z,a as te,g as D,i as J,o as C,q as x,s as F}from"./chunk-W3CSX6GI.js";import{E as ae,R as K,c as V,h as w,t as re,u as ne,w as T,x as ie}from"./chunk-CBG67HUP.js";import{ja as v}from"./chunk-MEJKELWC.js";import{A as h,z as g}from"./chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="39aa8f48-11f9-528b-b5a2-ff4272a6b644")}catch{}})();var _e={create:'client.create({ type: "Task", title: "Example", createMode: "progressive" })',update:'client.update(id, { estimatedMinutes: "45", force: false })',append:'client.append(id, "Body text")',reopen:'client.reopen(id, "The work recurred", { expectedResult: "Verified recovery" })'};function b(e,t,r){let n=`${e} ${t} must be ${r}.`;throw new h(n,g.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",field:t,changed:!1,required:n,examples:[_e[e]]})}function I(e,t,r){typeof e!="string"&&b(t,r,"a string")}function W(e,t){(e===null||typeof e!="object"||Array.isArray(e))&&b(t,"options","an object")}function oe(e,t){(e==="append"||e==="update")&&t.id!==void 0&&I(t.id,e,"id"),e==="item-reopen"&&(t.id!==void 0&&I(t.id,"reopen","id"),t.reason!==void 0&&I(t.reason,"reopen","reason"),t.options!==void 0&&Re(t.options))}function st(e){W(e,"append");for(let t of["body","author","message"])e[t]!==void 0&&I(e[t],"append",t);e.force!==void 0&&typeof e.force!="boolean"&&b("append","force","a boolean")}function Re(e){W(e,"reopen");for(let t of z["item-reopen"].optional){let r=e[t];r!==void 0&&(v(Reflect.get(S,t)).type==="boolean"?typeof r!="boolean"&&b("reopen",t,"a boolean"):I(r,"reopen",t))}}function Ce(e,t){return e?t?"a string or string array":"a string array":"a string"}function Se(e,t,r,n,s,a){r===void 0||typeof r=="string"&&(!s||a)||n==="priority"&&typeof r=="number"&&Number.isFinite(r)||s&&Array.isArray(r)&&Array.from(r).every(i=>typeof i=="string")||b(e,t,Ce(s,a))}function be(e,t,r){let n=e==="create"?x:F;for(let{param:s}of[...n,...C,{param:"force"}]){if(v(Reflect.get(S,s)).type!=="boolean")continue;let a=r.find(i=>i.keys.includes(s))?.keys??[s];for(let i of a)t[i]!==void 0&&typeof t[i]!="boolean"&&b(e,i,"a boolean")}}function X(e,t,r=!0,n=!1){let s=e==="create"?L:U;for(let{target:a,keys:i,repeatable:l}of s)if(v(Reflect.get(S,a)).type!=="boolean")for(let f of i){let m=n&&f!==a,Y=l===!0&&(a!=="acceptanceCriteria"||m);Se(e,f,t[f],a,Y,r||m)}be(e,t,s)}function lt(e,t){W(t,e);let r=re(t);return X(e,r,!1,w(r)),r}import{Option as kt}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="201134b5-01e8-55ae-a099-137b9b6fae92")}catch{}})();function A(e,t,r){if(typeof r!="string")return;let n=r.trim();n.length!==0&&e.push(t,n)}function p(e,t,r){r===!0&&e.push(t)}function _(e,t,r){if(Array.isArray(r))for(let n of r){if(typeof n!="string")continue;let s=n.trim();s.length!==0&&e.push(t,s)}}function Ne(e,t){let r=["test",e,"--run","--json","--progress"];return _(r,"--add",t.add),_(r,"--add-json",t.addJson),_(r,"--remove",t.remove),_(r,"--remove-index",Array.isArray(t.removeIndex)?t.removeIndex.map(n=>typeof n=="number"?String(n):n):t.removeIndex),A(r,"--match",t.match),A(r,"--only-index",typeof t.onlyIndex=="number"?String(t.onlyIndex):t.onlyIndex),p(r,"--only-last",t.onlyLast),_(r,"--measure",t.measure),A(r,"--metric-below",t.metricBelow),A(r,"--metric-diff",t.metricDiff),Ee(r,t),A(r,"--author",t.author),A(r,"--message",t.message),p(r,"--force",t.force),r}function Ee(e,t){A(e,"--timeout",t.timeout),_(e,"--env-set",t.envSet),_(e,"--env-clear",t.envClear),p(e,"--shared-host-safe",t.sharedHostSafe),A(e,"--pm-context",t.pmContext),p(e,"--override-linked-pm-context",t.overrideLinkedPmContext),A(e,"--workspace-context",t.workspaceContext),p(e,"--override-linked-workspace-context",t.overrideLinkedWorkspaceContext),p(e,"--allow-untrusted-linked-tests",t.allowUntrustedLinkedTests),p(e,"--fail-on-context-mismatch",t.failOnContextMismatch),p(e,"--fail-on-skipped",t.failOnSkipped),p(e,"--fail-on-empty-test-run",t.failOnEmptyTestRun),p(e,"--require-assertions-for-pm",t.requireAssertionsForPm),p(e,"--check-context",t.checkContext),p(e,"--auto-pm-context",t.autoPmContext)}(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]="131c6816-18f9-5c50-ab4d-0ff380b513bc")}catch{}})();function se(e,t){let r=[],n=new Set;for(let s of t.keys){if(!Object.hasOwn(e,s))continue;let a=e[s];if(a!=null){if(typeof a=="string"){r.push(a);continue}if(!Array.isArray(a)||!a.every(i=>typeof i=="string"))return;n.has(a)||(n.add(a),r.push(...a))}}return r.length>0?r.join("; "):void 0}function R(e,t){return e.find(r=>r.target===t)??{target:t,keys:[t]}}function o(e,t){return e[t]===!0?!0:void 0}function O(e,t){return e[t]===!1?!0:void 0}function G(e,t){return t.some(r=>e[r]===!0)?!0:void 0}function Z(e,t){for(let[r,n]of Object.entries(t))r==="__proto__"||r==="constructor"||r==="prototype"||Object.hasOwn(e,r)||(e[r]=n)}function le(e,t={}){let r=i=>D(e,R(B,i)),n=i=>J(e,R(M,i)),s=r("type");if(t.requireType!==!1&&s===void 0)throw new h("Missing required option --type <value>. Why required: create resolves runtime schema fields/workflow from item type. Retry: add --type <built-in or configured custom type> (example: --type Task).",g.USAGE);let a={title:r("title"),description:r("description"),type:s,template:r("template"),createMode:r("createMode"),schedulePreset:r("schedulePreset"),status:r("status"),closeReason:r("closeReason"),completedAt:r("completedAt"),priority:r("priority"),tags:r("tags"),addTags:n("addTags"),body:r("body"),deadline:r("deadline"),estimatedMinutes:r("estimatedMinutes"),acceptanceCriteria:se(e,R(M,"acceptanceCriteria")),definitionOfReady:r("definitionOfReady"),order:r("order"),rank:r("rank"),goal:r("goal"),objective:r("objective"),value:r("value"),impact:r("impact"),outcome:r("outcome"),whyNow:r("whyNow"),author:r("author"),message:r("message"),assignee:r("assignee"),parent:r("parent"),inheritFocus:e.inheritFocus,allowMissingParent:G(e,["allowMissingParent","allow_missing_parent"])===!0,allowUnresolvedDeps:G(e,["allowUnresolvedDeps","allow_unresolved_deps"])===!0,allowDuplicate:o(e,"allowDuplicate")===!0,reviewer:r("reviewer"),risk:r("risk"),confidence:r("confidence"),sprint:r("sprint"),release:r("release"),blockedBy:r("blockedBy"),blockedReason:r("blockedReason"),unblockNote:r("unblockNote"),reporter:r("reporter"),severity:r("severity"),environment:r("environment"),reproSteps:r("reproSteps"),resolution:r("resolution"),expectedResult:r("expectedResult"),actualResult:r("actualResult"),affectedVersion:r("affectedVersion"),fixedVersion:r("fixedVersion"),component:r("component"),regression:e.regression===!0?"true":r("regression"),customerImpact:r("customerImpact"),dep:n("dep"),comment:n("comment"),note:n("note"),learning:n("learning"),file:n("file"),test:n("test"),doc:n("doc"),reminder:n("reminder"),event:n("event"),typeOption:n("typeOption"),field:n("field"),unset:n("unset"),clearDeps:o(e,"clearDeps"),clearComments:o(e,"clearComments"),clearNotes:o(e,"clearNotes"),clearLearnings:o(e,"clearLearnings"),clearFiles:o(e,"clearFiles"),clearTests:o(e,"clearTests"),clearDocs:o(e,"clearDocs"),clearReminders:o(e,"clearReminders"),clearEvents:o(e,"clearEvents"),clearTypeOptions:o(e,"clearTypeOptions")};return Z(a,e),T(e,a)}function ce(e){let t=s=>D(e,R(j,s)),r=s=>J(e,R(k,s)),n={title:t("title"),description:t("description"),body:t("body"),status:t("status"),closeReason:t("closeReason"),priority:t("priority"),type:t("type"),tags:t("tags"),addTags:r("addTags"),removeTags:r("removeTags"),deadline:t("deadline"),estimatedMinutes:t("estimatedMinutes"),acceptanceCriteria:se(e,R(k,"acceptanceCriteria")),addAc:r("addAc"),removeAc:r("removeAc"),definitionOfReady:t("definitionOfReady"),order:t("order"),rank:t("rank"),goal:t("goal"),objective:t("objective"),value:t("value"),impact:t("impact"),outcome:t("outcome"),whyNow:t("whyNow"),author:t("author"),message:t("message"),force:!!e.force,ownershipMetadataBypass:e.ownershipMetadataBypass===!0?!0:void 0,ownershipDependencyBypass:e.ownershipDependencyBypass===!0?!0:void 0,assignee:t("assignee"),parent:t("parent"),allowUnresolvedDeps:G(e,["allowUnresolvedDeps","allow_unresolved_deps"])===!0,reviewer:t("reviewer"),risk:t("risk"),confidence:t("confidence"),sprint:t("sprint"),release:t("release"),blockedBy:t("blockedBy"),blockedReason:t("blockedReason"),unblockNote:t("unblockNote"),reporter:t("reporter"),severity:t("severity"),environment:t("environment"),reproSteps:t("reproSteps"),resolution:t("resolution"),expectedResult:t("expectedResult"),actualResult:t("actualResult"),affectedVersion:t("affectedVersion"),fixedVersion:t("fixedVersion"),component:t("component"),regression:e.regression===!0?"true":t("regression"),customerImpact:t("customerImpact"),dep:r("dep"),depRemove:r("depRemove"),replaceDeps:o(e,"replaceDeps"),replaceTests:o(e,"replaceTests"),replaceFiles:o(e,"replaceFiles"),replaceDocs:o(e,"replaceDocs"),comment:r("comment"),note:r("note"),learning:r("learning"),file:r("file"),test:r("test"),doc:r("doc"),reminder:r("reminder"),event:r("event"),typeOption:r("typeOption"),field:r("field"),unset:r("unset"),clearDeps:o(e,"clearDeps"),clearComments:o(e,"clearComments"),clearNotes:o(e,"clearNotes"),clearLearnings:o(e,"clearLearnings"),clearFiles:o(e,"clearFiles"),clearTests:o(e,"clearTests"),clearDocs:o(e,"clearDocs"),clearReminders:o(e,"clearReminders"),clearEvents:o(e,"clearEvents"),clearTypeOptions:o(e,"clearTypeOptions")};return Z(n,e),T(e,n)}function d(e,t){let r=R(te,t),n=D(e,r);if(n!==void 0)return n;for(let s of r.keys){let a=e[s];if(Array.isArray(a)){let i=a.filter(l=>typeof l=="string");if(i.length>0)return i.join(",")}if(t==="ids"&&typeof a=="string")return a;if(typeof a=="number"&&Number.isFinite(a))return String(a)}}function Me(e){let t=o(e,"filterFilesMissing"),r=o(e,"filterDocsMissing");return{filterReviewerMissing:o(e,"filterReviewerMissing"),filterRiskMissing:o(e,"filterRiskMissing"),filterConfidenceMissing:o(e,"filterConfidenceMissing"),filterSprintMissing:o(e,"filterSprintMissing"),filterReleaseMissing:o(e,"filterReleaseMissing"),hasNotes:o(e,"hasNotes"),hasLearnings:o(e,"hasLearnings"),hasFiles:o(e,"hasFiles"),hasDocs:o(e,"hasDocs"),hasTests:o(e,"hasTests"),hasComments:o(e,"hasComments"),hasDeps:o(e,"hasDeps"),hasBody:o(e,"hasBody"),hasLinkedCommand:o(e,"hasLinkedCommand"),noNotes:O(e,"notes"),noLearnings:O(e,"learnings"),noFiles:O(e,"files")??t,filterFilesMissing:t,noDocs:O(e,"docs")??r,filterDocsMissing:r,noTests:O(e,"tests"),noComments:O(e,"comments"),noDeps:O(e,"deps"),emptyBody:o(e,"emptyBody"),noLinkedCommand:O(e,"linkedCommand")}}function de(e){let t={status:d(e,"status"),type:d(e,"type"),tag:d(e,"tag"),priority:d(e,"priority"),deadlineBefore:d(e,"deadlineBefore"),deadlineAfter:d(e,"deadlineAfter"),updatedAfter:d(e,"updatedAfter"),updatedBefore:d(e,"updatedBefore"),createdAfter:d(e,"createdAfter"),createdBefore:d(e,"createdBefore"),today:o(e,"today"),recent:o(e,"recent"),ids:d(e,"ids"),assignee:d(e,"assignee"),assigneeFilter:d(e,"assigneeFilter"),parent:d(e,"parent"),sprint:d(e,"sprint"),release:d(e,"release"),limit:d(e,"limit"),offset:d(e,"offset"),noTruncate:O(e,"truncate"),includeBody:o(e,"includeBody"),strictRead:o(e,"strictRead"),compact:o(e,"compact"),brief:o(e,"brief"),full:o(e,"full"),fields:d(e,"fields"),sort:d(e,"sort"),order:d(e,"order"),tree:o(e,"tree"),treeDepth:d(e,"treeDepth"),filterAcMissing:o(e,"filterAcMissing"),filterEstimatesMissing:G(e,["filterEstimatesMissing","filterEstimateMissing"]),filterResolutionMissing:o(e,"filterResolutionMissing"),filterMetadataMissing:o(e,"filterMetadataMissing"),...Me(e)};return Z(t,e),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]="51e47cda-0312-5439-b08f-6246414d0dc3")}catch{}})();var ke=Symbol("pm.mcp-mutation-transport"),we=new Set(["create","update","append"]),$={create:{parameters:x,aliases:L,strings:B,repeatables:M},update:{parameters:F,aliases:U,strings:j,repeatables:k}},Ie=new Set(["activity","aggregate","context","contracts","deps","files-discover","files-lookup","get","graph","health","history","history-attest","list","next","search","stats","telemetry","validate"]);function P(e){return ke in e}function q(e,t){return P(e)?ne(t):T(e,t)}function Wt(e,t,r=[]){let n=T(e,{...e,...t});for(let s of r)Reflect.deleteProperty(n,s);return n}function c(e,t){let r=e[t];return typeof r=="string"&&r.trim().length>0?r:void 0}function u(e,t){let r=e[t];return typeof r=="string"?r.trim().length>0?r:void 0:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function Xt(e,t){let r=e[t];return typeof r=="string"?r:typeof r=="number"&&Number.isFinite(r)?String(r):void 0}function y(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Zt(e,t){if(typeof e=="number"){if(!Number.isInteger(e))throw new h(`${t} must be a finite integer.`,g.USAGE);return e}if(typeof e=="string"&&e.trim().length>0){let r=Number(e);if(!Number.isInteger(r))throw new h(`${t} must be a finite integer.`,g.USAGE);return r}}function Qt(e,t){return typeof e.limit=="number"&&Number.isFinite(e.limit)?e.limit:typeof t.limit=="number"&&Number.isFinite(t.limit)?t.limit:c(e,"limit")??c(t,"limit")}function er(e){let t=c(e,"outputFormat");return{json:!0,quiet:!0,author:c(e,"author"),path:c(e,"path"),noExtensions:e.noExtensions===!0||e.no_extensions===!0,noPager:!0,outputInclude:c(e,"outputInclude"),outputLimit:u(e,"outputLimit"),outputBudget:u(e,"outputBudget"),outputSession:c(e,"outputSession"),outputCursor:c(e,"outputCursor"),outputFormat:t==="json"||t==="toon"?t:void 0}}var pe=new Set(["tags","blockedBy","blocked_by","skills","fields"]),me=new Set(["comment","note","learning","reminder","event","dep","depRemove","dep_remove","file","doc","test","unset","addGlob","add_glob","migrate","envSet","env_set","envClear","env_clear"]),Pe=new Set([...me].filter(e=>e!=="file")),De=new Set(["files","files-discover","docs","test","test-all"]),ye=new Set(["comments","notes","learnings"]);function xe(e,t){if(!(!ye.has(e)||!Object.prototype.hasOwnProperty.call(t,"file")))throw new h(`MCP ${e} does not accept options.file. Pass annotation text in options.add instead.`,g.USAGE,{code:"mcp_annotation_file_unavailable",required:"Pass annotation text as JSON data; MCP annotation actions cannot read server-local files."})}var Fe=new Set(["claim","release","start-task","pause-task","close-task"]),ge={history:["order"],"history-attest":["verify","output","hashAlgorithm"],list:["status","type","tag","priority","limit","offset"],search:["mode","status","type","tag","priority","limit"],create:["title","type","status","description","body","priority","tags","parent","createMode","create_mode","allowMissingParent","allowDuplicate","inheritFocus"],update:["parent","allowMissingParent","completedAt"],copy:["allowDuplicate"],close:["duplicateOf","completedAt","releaseAssignment"],claim:["start","next","ifAvailable"],release:["pause","handoff"],comments:["ifAbsent"],notes:["ifAbsent"],learnings:["ifAbsent"],extension:["dryRun","offline"],package:["dryRun","offline"],install:["dryRun"],upgrade:["scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"],append:["body"]},Le=new Set(["context","get","list","next","search"]),Be=new Set(["query","keywords"]);function Ue(e){return Le.has(e)?z[e].optional.filter(t=>!Be.has(t)):[]}function je(e,t){let r=t.replace(/[A-Z]/gu,n=>`_${n.toLowerCase()}`);return e[t]!==void 0||e[r]!==void 0}function ze(e){return[...ge[e]??[],...Ue(e),...he]}var he=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];function Ae(e,t=""){let r={},n=De.has(t),s=t==="files"||t==="files-discover"||t==="docs",a=ye.has(t)?Pe:me;for(let[i,l]of Object.entries(e)){if(Array.isArray(l)&&pe.has(i)){r[i]=l.join(",");continue}if(i==="note"&&s){r[i]=l;continue}if(typeof l=="string"&&a.has(i)){r[i]=[l];continue}if(typeof l=="string"&&n&&(i==="add"||i==="remove")){r[i]=[l];continue}r[i]=l}return Object.assign(r,Object.fromEntries(Object.getOwnPropertySymbols(e).map(i=>[i,Reflect.get(e,i)]))),r}function Ve(e,t,r){let n=c(e,"author");return n!==void 0?n:r!==void 0&&Fe.has(r)?c(e,"assignee")??c(t,"assignee"):void 0}function Ge(e,t){return t!==void 0&&e.author===void 0?{...e,author:t}:e}function He(e,t,r){let n={},s=$[e],a=new Set([...s.parameters.map(({param:i})=>i),...C.map(({param:i})=>i),...ge[e],...he,"force"]);for(let i of a){let l=s.aliases.find(f=>f.keys.includes(i))?.keys??[i];t[i]===void 0||l.some(f=>r[f]!==void 0)||(n[i]=t[i])}return n}function N(e,t){throw new h(`Invalid MCP ${e} value for "${t}". No changes were made.`,g.USAGE,{code:"invalid_argument_value",reason:"invalid_mutation_option_value",changed:!1,field:t,required:`Provide valid ${e} field values and an options object; inspect the pm_${e} input schema for supported types.`})}function qe(e,t,r){let n=$[e],s=[...n.parameters,...C,{param:"force"}];for(let{param:a}of s){if(v(S[a]).type!=="boolean")continue;let i=(n.aliases.find(l=>l.keys.includes(a))?.keys??[a]).find(l=>r[l]!==void 0&&typeof r[l]!="boolean");i!==void 0&&N(e,i)}for(let a of["idOnly","fullChangedFields"])t[a]!==void 0&&typeof t[a]!="boolean"&&N(e,a)}function $e(e,t,r){t.options!==void 0&&!y(t.options)&&N(e,"options"),qe(e,t,r);for(let i of pe){let l=r[i];Array.isArray(l)&&l.some(f=>typeof f!="string")&&N(e,i)}let n=ve(r,e),s=$[e];for(let{keys:i,target:l}of s.strings)i.some(f=>r[f]!==void 0)&&n[l]===void 0&&N(e,l);let a=s.repeatables.flatMap(({keys:i})=>i).find(i=>{let l=r[i];return l!==void 0&&typeof l!="string"&&(!Array.isArray(l)||l.some(f=>typeof f!="string"))});return a!==void 0&&N(e,a),n}function Ye(e,t,r,n){let s=(t==="create"||t==="update")&&P(e),a={...s?He(t,e,n):r,...n};return(t==="create"||t==="update")&&!s&&X(t,a,!0,y(e.options)&&w(e.options)),s?$e(t,e,a):Ae(a,t)}function Je(e,t){return!we.has(e??"")||w(t)?t:ae(t)}function tr(e,t){oe(t,e);let r=y(e.options)?e.options:void 0,n=v(e.options),s={},a=m=>{je(n,m)||e[m]===void 0||(s[m]=e[m])};for(let m of ze(t??""))a(m);t!==void 0&&P(e)&&xe(t,n);let i=Ye(e,t,s,n);if(t==="history-attest"&&P(e)&&(i.output!==void 0||typeof i.verify=="string"))throw new h("MCP history attest does not accept server-local proof paths. Export the returned JSON bundle and pass that JSON object as verify.",g.USAGE);let l=P(e)?e:r??e,f=q(l,Ge(i,Ve(e,i,t)));return Je(t,f)}function rr(e){if(e.addNote===void 0)return e;let t={...e};return t.note===void 0&&typeof t.addNote=="string"&&(t.note=t.addNote),delete t.addNote,t}function nr(e){let t={...e};return t.discoveryNote!==void 0&&t.note===void 0&&typeof t.discoveryNote=="string"&&(t.note=t.discoveryNote),delete t.discover,delete t.discoveryNote,t}function Ke(e){let t=[],r=!0;for(let n of e.trim().toLowerCase()){if(n>="a"&&n<="z"||n>="0"&&n<="9"){t.push(n),r=!1;continue}r||(t.push("-"),r=!0)}return t.at(-1)==="-"&&t.pop(),t.join("")}function ir(e){return!Ie.has(Ke(e))}function ar(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean).join(" ")}function We(e){return Array.isArray(e)?e.map(t=>String(t)).filter(t=>t.length>0):[]}function or(e,t){let r=new Set(["action","args","author","cwd","fullChangedFields","id","options","path","query","reason","target"]),n={};for(let[a,i]of Object.entries(e))r.has(a)||(n[a]=i);let s={...n,...t};return delete s.args,delete s.author,s}function sr(e,t){let r=q(t??{},{...t});return{changedFields:e.fullChangedFields===!0?"full":"compact",idOnly:e.idOnly===!0,runnerOptions:r}}function ee(e){return{type:u(e,"filterType"),tag:u(e,"filterTag"),priority:u(e,"filterPriority"),deadlineBefore:u(e,"filterDeadlineBefore"),deadlineAfter:u(e,"filterDeadlineAfter"),updatedAfter:u(e,"filterUpdatedAfter"),updatedBefore:u(e,"filterUpdatedBefore"),createdAfter:u(e,"filterCreatedAfter"),createdBefore:u(e,"filterCreatedBefore"),ids:K(e.ids),assignee:u(e,"filterAssignee"),assigneeFilter:u(e,"filterAssigneeFilter")??u(e,"filterAssignee_filter"),parent:u(e,"filterParent"),sprint:u(e,"filterSprint"),release:u(e,"filterRelease"),limit:u(e,"limit"),offset:u(e,"offset")}}function Q(e){if(typeof e=="string"&&e.trim().length>0)return e;if(Array.isArray(e))return We(e)}function H(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim().length>0)return e}function lr(e){let t=Q(e.kind),r=Q(e.exemptIsolate),n=Q(e.exemptIsolateType);return{...t===void 0?{}:{kind:t},maxDepth:H(e.maxDepth),limit:H(e.limit),after:c(e,"after"),direction:c(e,"direction"),maxPaths:H(e.maxPaths),sample:H(e.sample),...r===void 0?{}:{exemptIsolate:r},...n===void 0?{}:{exemptIsolateType:n},saveBaseline:e.saveBaseline===!0,rebuild:e.rebuild===!0,clear:e.clear===!0,summary:e.summary===!0,...e.full===!0?{full:!0}:{}}}function Oe(e){let t=de(e);return e.ids!==void 0&&(t.ids=K(e.ids)),t}function cr(e){return{status:c(e,"filterStatus"),list:y(e.list)?Oe(e.list):ee(e),reason:c(e,"reason"),completedAt:c(e,"completedAt")??c(e,"completed_at"),resolution:c(e,"resolution"),expectedResult:c(e,"expectedResult")??c(e,"expected_result")??c(e,"expected"),actualResult:c(e,"actualResult")??c(e,"actual_result")??c(e,"actual"),validateClose:c(e,"validateClose")??c(e,"validate_close"),author:c(e,"author"),message:c(e,"message"),force:e.force===!0?!0:void 0,dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:V(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}var Xe=new Set(["filterStatus","filterType","filterTag","filterPriority","filterDeadlineBefore","filterDeadlineAfter","filterUpdatedAfter","filterUpdatedBefore","filterCreatedAfter","filterCreatedBefore","filterAssignee","filterAssigneeFilter","filterAssignee_filter","filterParent","filterSprint","filterRelease","ids","list","update","limit","offset","dryRun","dry_run","rollback","checkpoint","noCheckpoint","no_checkpoint"]);function ue(e){let t={};for(let[r,n]of Object.entries(e))Xe.has(r)||(t[r]=n);return Te(t)}function Te(e){return ve(e,"update")}function ve(e,t){let r=Ae(e,t),n=$[t],s=new Set([...n.parameters,...C].filter(({booleanish:a})=>a===!0).map(({param:a})=>a));for(let{keys:a}of n.repeatables)for(let i of a)typeof r[i]=="string"&&(r[i]=[r[i]]);for(let a of n.strings)for(let i of a.keys){let l=r[i];(typeof l=="number"&&Number.isFinite(l)||l===!1&&s.has(i))&&(r[i]=String(l))}return t==="create"?{...le(r,{requireType:!1})}:ce(r)}function dr(e){if(y(e.list)||y(e.update)){let t=y(e.update)?e.update:ue(e),r=q(e,Te(t));return{status:u(e,"filterStatus"),list:y(e.list)?Oe(e.list):ee(e),update:ie(t,r),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:V(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}return{status:u(e,"filterStatus"),list:ee(e),update:q(e,ue(e)),dryRun:e.dryRun===!0||e.dry_run===!0?!0:void 0,rollback:V(e.rollback),checkpoint:e.checkpoint===!1||e.noCheckpoint===!0||e.no_checkpoint===!0?!1:void 0}}function fe(e){return"expectHash"in e||"expect_hash"in e}function ur(e){if(!fe(e)&&!(y(e.options)&&fe(e.options)))return{expectHash:void 0,dispatchArgs:e};let{expectHash:t,expect_hash:r,...n}=e,s=y(n.options)?n.options:{},{expectHash:a,expect_hash:i,...l}=s,f=[t,r,a,i].filter(E=>E!==void 0),m=f.length>1?f.flatMap(E=>Array.isArray(E)?E:[E]):f[0],Y=T(e,"options"in n?{...n,options:y(n.options)?T(n.options,l):n.options}:n);return{expectHash:m,dispatchArgs:Y}}export{I as a,W as b,st as c,Re as d,lt as e,Ne as f,P as g,Wt as h,c as i,u as j,Xt as k,y as l,Zt as m,Qt as n,er as o,ge as p,Ae as q,tr as r,rr as s,nr as t,Ke as u,ir as v,ar as w,We as x,or as y,sr as z,ee as A,lr as B,cr as C,Te as D,dr as E,ur as F};
|
|
2
|
-
//# sourceMappingURL=chunk-PMKR4MJI.js.map
|