@unbrained/pm-cli 2026.8.5 → 2026.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +14 -0
- package/dist/cli/main.js +12 -37
- package/dist/cli/register-setup.d.ts +1 -1
- package/dist/cli/register-setup.js +46 -20
- package/dist/cli-bundle/bundle-manifest.json +391 -391
- package/dist/cli-bundle/chunks/append-XAJ5Z4XS.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-2WFXWAYX.js → chunk-343QETLI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RKAVWO3O.js → chunk-3KFVGGRE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VCKLFEUN.js → chunk-3ZJRFYY2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UZBWIUYD.js → chunk-4AVFKHHC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BPELKUQD.js → chunk-4OVGQW22.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-54FNT7U2.js → chunk-5PBP2ZP3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NY4T3JWN.js → chunk-5ZKQPA44.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YUBDMQM.js → chunk-A3XQ7VPU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OPVH7SKD.js → chunk-AJE3AHPD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3774P7D.js → chunk-AOBDLU4T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VN5VITU3.js → chunk-AYRUGRNS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HWRRMBJO.js → chunk-BP6EMEDP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZYHOB3SN.js → chunk-C3YABSJK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-43HQQI6S.js → chunk-CA3BURYF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-E2RKBKWB.js → chunk-D7I3TUGV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4VN6GS4U.js → chunk-DQGJ2RWT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YSO3YFZ4.js → chunk-DWOAOZHZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q35VBGOQ.js → chunk-E7BFPLUZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LKDGK44W.js → chunk-F4NREH3G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OMXVBQ2N.js → chunk-FDBRXV25.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3FTILRJ2.js → chunk-GU3TSEHD.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-HS7OVAUN.js +164 -0
- package/dist/cli-bundle/chunks/{chunk-OTHLDSFP.js → chunk-JFZIS6JF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7A5OT5J2.js → chunk-JQ4NZ5EB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BXQLRKWF.js → chunk-L6LGKJX3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CSI3WS5I.js → chunk-M357ZCOR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5ZBOIPGP.js → chunk-M4VEE3FK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7C4PTJG6.js → chunk-MCS73BKB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A62CYISG.js → chunk-MDTH7SAE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HNFD72UK.js → chunk-OXY3SJ3N.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L3AZOELJ.js → chunk-PECV7L5T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DXDREUXT.js → chunk-Q3VOP62W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UP7DTVMD.js → chunk-QJ7C3JIW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-42E7YPLG.js → chunk-R6LSRGPS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MHK6LIWE.js → chunk-R6RKEYYW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UN66FZRO.js → chunk-RAFUN7IX.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-RUAU5OSH.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SD3YXU2U.js +56 -0
- package/dist/cli-bundle/chunks/{chunk-SSF4PIUR.js → chunk-SV3YQ4RY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3EUXXOF.js → chunk-SVV3DQES.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-45G53IU4.js → chunk-SXECIECW.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-T45OHXDW.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-PMXJEU3F.js → chunk-TPKDJ5WL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-M72BKL5Q.js → chunk-UVVXHGYS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WRL4KNDL.js → chunk-V663653R.js} +19 -19
- package/dist/cli-bundle/chunks/{chunk-R546TPDE.js → chunk-WSI5KZQJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6MSQJOTG.js → chunk-XPOQQJTX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XCEZYMNI.js → chunk-YCCDXBNU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LN2WFEU4.js → chunk-ZFBWCKYF.js} +2 -2
- package/dist/cli-bundle/chunks/close-DI66JMSB.js +2 -0
- package/dist/cli-bundle/chunks/close-many-VFKT6U3O.js +2 -0
- package/dist/cli-bundle/chunks/comments-E73HIEZJ.js +2 -0
- package/dist/cli-bundle/chunks/copy-WBYVLCPC.js +2 -0
- package/dist/cli-bundle/chunks/{create-XLKTXTUF.js → create-TG67IVFI.js} +2 -2
- package/dist/cli-bundle/chunks/delete-6XKUVVQN.js +2 -0
- package/dist/cli-bundle/chunks/{deps-ITTY3GIC.js → deps-AJUGP2OH.js} +2 -2
- package/dist/cli-bundle/chunks/{docs-W4OSRTYR.js → docs-QOCLDRKJ.js} +2 -2
- package/dist/cli-bundle/chunks/{files-EOK4AZI4.js → files-3ST5TY64.js} +2 -2
- package/dist/cli-bundle/chunks/focus-R2AWS63Y.js +2 -0
- package/dist/cli-bundle/chunks/{history-compact-7UGTMLL3.js → history-compact-7BJFML4S.js} +2 -2
- package/dist/cli-bundle/chunks/{history-redact-4DZRMD6Z.js → history-redact-WJN3HYXR.js} +2 -2
- package/dist/cli-bundle/chunks/{history-repair-UPOSZW5R.js → history-repair-XDNZUB7F.js} +2 -2
- package/dist/cli-bundle/chunks/{learnings-GMRNCBS3.js → learnings-SZMUPVNA.js} +2 -2
- package/dist/cli-bundle/chunks/{profile-2MUUMHRE.js → profile-KL53JIAC.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-LR3SQ5ZF.js → register-list-query-QH7ONPKU.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-SUOHFVWM.js → register-mutation-OCRQNZK4.js} +3 -3
- package/dist/cli-bundle/chunks/{register-operations-ARRRKOVN.js → register-operations-HIBJXRGB.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-QWBQ6HBS.js +2 -0
- package/dist/cli-bundle/chunks/restore-FXA5QPM7.js +2 -0
- package/dist/cli-bundle/chunks/{schema-FJ4EA3XF.js → schema-QJ27OTRV.js} +2 -2
- package/dist/cli-bundle/chunks/update-7GBO4SXG.js +2 -0
- package/dist/cli-bundle/chunks/update-many-VF6ZKQUO.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-B7LJWAZE.js → chunk-27DK4A5O.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SV3O7TSH.js → chunk-4JC3AOGS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-G6ETT4QK.js → chunk-6KDHXURF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PG2RIZBX.js → chunk-74CWP3A4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Y4LDYLLT.js → chunk-7AZDTGPA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-7YTZ7A4E.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-A7BJ5SS6.js → chunk-CL3NB7VW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EAXXF2HW.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UIL2M2NA.js → chunk-EYO4F74Z.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7J5TUBUJ.js → chunk-GEYU23YS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-WEM2E2PE.js → chunk-GIERI4YU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-WVIVUWVL.js → chunk-GSW2Y7VZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VLYOEYML.js → chunk-LKQXXO62.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MJ7HWSFK.js → chunk-MBBMTDD3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PIMMYG7Q.js → chunk-ME4XVOBJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IPWSFADF.js → chunk-N7QN3NE6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-W7BJEWHX.js → chunk-QL5H3AQH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-TQMFQYXR.js +29 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RUR5I3TK.js → chunk-XNVXIQ4B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FGKY4MBE.js → chunk-YHDCGUIW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QVHKCI4T.js → chunk-YLPZHWX7.js} +2 -2
- package/dist/cli-bundle/main.js +13 -13
- 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 +25 -25
- 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 +1 -1
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +1 -1
- package/dist/core/extensions/activation-summary.d.ts +4 -0
- package/dist/core/extensions/activation-summary.js +5 -2
- package/dist/core/extensions/contribution-inventory.d.ts +1 -0
- package/dist/core/extensions/contribution-inventory.js +35 -2
- package/dist/core/extensions/extension-hook-runtime.js +5 -3
- package/dist/core/extensions/extension-types.d.ts +18 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +5 -13
- package/dist/core/extensions/preflight-ownership.d.ts +5 -0
- package/dist/core/extensions/preflight-ownership.js +42 -0
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +8 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/compose.d.ts +2 -2
- package/dist/sdk/compose.js +7 -2
- package/dist/sdk/define.d.ts +3 -1
- package/dist/sdk/define.js +3 -8
- package/dist/sdk/extension/install-sources.d.ts +43 -5
- package/dist/sdk/extension/install-sources.js +36 -2
- package/dist/sdk/extension/migrations.d.ts +114 -0
- package/dist/sdk/extension/migrations.js +175 -0
- package/dist/sdk/extension/scaffold.js +14 -9
- package/dist/sdk/extension/source-resolution.d.ts +50 -0
- package/dist/sdk/extension/source-resolution.js +66 -0
- package/dist/sdk/extension.d.ts +5 -1
- package/dist/sdk/extension.js +24 -26
- package/dist/sdk/governance/health.js +11 -2
- package/dist/sdk/index.d.ts +6 -2
- package/dist/sdk/index.js +8 -4
- package/dist/sdk/package-migrations.d.ts +10 -0
- package/dist/sdk/package-migrations.js +21 -0
- package/dist/sdk/runtime.d.ts +2 -0
- package/dist/sdk/runtime.js +6 -2
- package/docs/COMMANDS.md +9 -0
- package/docs/EXTENSIONS.md +2 -2
- package/docs/EXTENSION_LIFECYCLE.md +46 -0
- package/docs/README.md +1 -0
- package/docs/RELEASING.md +33 -20
- package/docs/SDK.md +31 -3
- package/marketplace.json +2 -2
- package/package.json +3 -3
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +218 -20
- package/dist/cli-bundle/chunks/append-VXXGOXSG.js +0 -2
- package/dist/cli-bundle/chunks/chunk-EGJ4JTUG.js +0 -55
- package/dist/cli-bundle/chunks/chunk-FPBQHMFT.js +0 -8
- package/dist/cli-bundle/chunks/chunk-GE4KCSZP.js +0 -164
- package/dist/cli-bundle/chunks/chunk-YEWNL576.js +0 -2
- package/dist/cli-bundle/chunks/close-VZ3OQPN5.js +0 -2
- package/dist/cli-bundle/chunks/close-many-SB4TI27P.js +0 -2
- package/dist/cli-bundle/chunks/comments-BIF3Q4KY.js +0 -2
- package/dist/cli-bundle/chunks/copy-6AI5Z57X.js +0 -2
- package/dist/cli-bundle/chunks/delete-ZY2VHQTP.js +0 -2
- package/dist/cli-bundle/chunks/focus-DLBNWL7L.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-O6AYP6NP.js +0 -2
- package/dist/cli-bundle/chunks/restore-ZVCVHTB5.js +0 -2
- package/dist/cli-bundle/chunks/update-YHV52CSS.js +0 -2
- package/dist/cli-bundle/chunks/update-many-M6YHVNXM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BIMTMOS7.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-GJ2TG2CW.js +0 -28
- package/dist/cli-bundle/focused-chunks/chunk-N5XU5UVK.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{B as w,C as u}from"./chunk-
|
|
1
|
+
import{B as w,C as u}from"./chunk-EAXXF2HW.js";import{l as d}from"./chunk-7AZDTGPA.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]="989b570c-112e-5ee3-8731-ab34f215ba45")}catch{}})();var x=new Map(d.map(e=>[e.toLowerCase(),e])),$=/^[A-Za-z][A-Za-z0-9_-]*$/;function g(e,t){if(!$.test(e))throw new Error(`${t} "${e}" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. "Spike" or "code-review").`)}function m(e){return x.get(e.trim().toLowerCase())}function b(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function I(e){return e.replace(/[\\"`$]/g,t=>`\\${t}`)}function T(e){let t=new Map;for(let o of e){let n=o.trim();if(n.length===0)continue;let r=n.toLowerCase();t.has(r)||t.set(r,n)}return[...t.values()].sort((o,n)=>o.localeCompare(n))}function k(e){let t=(e.name??"").trim();if(t.length===0)throw new Error("Type name must not be empty.");g(t,"Type name");let o=m(t);if(o)throw new Error(`Cannot redefine built-in item type "${o}". Built-in types are reserved: ${d.join(", ")}.`);let n=e.description?.trim(),r=e.defaultStatus?.trim(),a=e.folder?.trim(),i=a&&a.length>0?u(a):void 0,s=T(e.aliases??[]);for(let l of s){g(l,"Alias");let f=m(l);if(f)throw new Error(`Alias "${l}" collides with built-in item type "${f}". Built-in types are reserved: ${d.join(", ")}.`)}return{name:t,description:n&&n.length>0?n:void 0,defaultStatus:r&&r.length>0?r:void 0,folder:i,aliases:s}}function S(e,t){let o=e.name.toLowerCase(),n=new Map;for(let a of t.definitions){if(typeof a.name!="string")continue;let i=a.name.trim();if(!(i.length===0||i.toLowerCase()===o)){n.set(i.toLowerCase(),i);for(let s of b(a.aliases))s.trim().length>0&&n.set(s.trim().toLowerCase(),i)}}let r=n.get(o);if(r)throw new Error(`Type name "${e.name}" collides with an alias of existing item type "${r}".`);for(let a of e.aliases){let i=n.get(a.toLowerCase());if(i)throw new Error(`Alias "${a}" already maps to existing item type "${i}".`)}}function h(e,t){return typeof t=="string"&&t.trim().length>0?u(t).toLowerCase():w(e).toLowerCase()}function D(e,t,o){let n=e.name.toLowerCase(),r=h(e.name,e.folder),a=s=>{throw new Error(`Item type "${e.name}" would store items in folder "${r}", which already belongs to existing item type "${s}". Pass a distinct --folder to keep their storage separate.`)};for(let s of t.definitions){if(typeof s.name!="string")continue;let l=s.name.trim();l.length===0||l.toLowerCase()===n||h(l,s.folder)===r&&a(l)}let i=o?.get(r);i!==void 0&&i.toLowerCase()!==n&&a(i)}function j(e){if(e==null||e.trim().length===0)return{definitions:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/types.json contains invalid JSON.")}return{definitions:L(t)}}function L(e){let t=C(e);if(!t)return[];let o=[];for(let n of t){if(typeof n!="object"||n===null||Array.isArray(n))continue;let r=n;typeof r.name!="string"||r.name.trim().length===0||o.push(r)}return o}function C(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let o=t.item_types;if(Array.isArray(o.definitions))return o.definitions}}function F(e,t){let o=t.name.toLowerCase(),n=e.definitions.slice(),r=n.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===o),a=r>=0?n[r]:void 0,i=T([...b(a?.aliases),...t.aliases]),s={...a,name:t.name};return t.folder!==void 0&&(s.folder=t.folder),i.length>0?s.aliases=i:s.aliases!==void 0&&delete s.aliases,A(s,"description",t.description),A(s,"default_status",t.defaultStatus),r>=0?n[r]=s:n.push(s),n.sort((l,f)=>l.name.localeCompare(f.name)),{file:{definitions:n},definition:s,replaced:r>=0,...a&&typeof a.name=="string"?{previousName:a.name}:{}}}function M(e,t){let o=(t??"").trim();if(o.length===0)throw new Error("Type name must not be empty.");let n=m(o);if(n)throw new Error(`Cannot remove built-in item type "${n}". Built-in types are reserved: ${d.join(", ")}.`);let r=o.toLowerCase(),a=e.definitions.slice(),i=a.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===r);if(i<0)return{file:{definitions:a},removed:!1};let[s]=a.splice(i,1);return{file:{definitions:a},removed:!0,definition:s}}function A(e,t,o){let n=e;o!==void 0&&(n[t]=o)}function O(e){return`${JSON.stringify({definitions:e.definitions},null,2)}
|
|
2
2
|
`}function v(e,t){let o=e.trim().length>0?e.trim():e,n=t?.trim()||".agents/pm/schema/types.json";return`To register a custom type, run: pm schema add-type "${I(o)}" (writes ${n}).`}function R(e,t,o){return`Invalid type value "${e}". Allowed: ${t.join(", ")}. ${v(e,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]="8370105a-2103-5425-8dd8-b621107f3bd8")}catch{}})();function y(e){return typeof e=="string"?e.trim().toLowerCase().replaceAll(/[\s-]+/g,"_"):""}function _(e){return typeof e=="string"?e.trim().toLowerCase():""}function c(e,t){let o=y(e);return o.length===0?"":t?.alias_to_id?.get(o)??o}function B(e){let t=Array.isArray(e?.type_workflows)?e.type_workflows:[],o=new Map;for(let n of t){let r=_(n?.type);if(r.length===0||!Array.isArray(n?.allowed_transitions))continue;let a=n.allowed_transitions,i=o.get(r)??{pairs:[],denyAll:!1};a.length===0&&(i.denyAll=!0);for(let s of a){if(!Array.isArray(s)||s.length!==2)continue;let l=y(s[0]),f=y(s[1]);l.length===0||f.length===0||i.pairs.some(p=>p[0]===l&&p[1]===f)||i.pairs.push([l,f])}o.set(r,i)}return[...o.entries()].filter(([,n])=>n.pairs.length>0||n.denyAll).map(([n,r])=>({type:n,allowed_transitions:r.pairs})).sort((n,r)=>n.type.localeCompare(r.type))}function P(e){let t=_(e.typeName),o=e.typeWorkflows.find(i=>i.type===t);if(!o)return{allowed:!0,hasRule:!1,allowedTransitions:[]};let n=c(e.fromStatus,e.statusRegistry),r=c(e.toStatus,e.statusRegistry);return n.length>0&&n===r?{allowed:!0,hasRule:!0,allowedTransitions:o.allowed_transitions}:{allowed:o.allowed_transitions.some(i=>{let s=c(i[0],e.statusRegistry),l=c(i[1],e.statusRegistry);return s===n&&l===r}),hasRule:!0,allowedTransitions:o.allowed_transitions}}function U(e){return e.length===0?"(no transitions allowed)":e.map(t=>`${t[0]} -> ${t[1]}`).join(", ")}export{m as a,I as b,k as c,S as d,D as e,j as f,F as g,M as h,O as i,R as j,y as k,B as l,P as m,U as n};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-XNVXIQ4B.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as Jt}from"./chunk-
|
|
1
|
+
import{f as Jt}from"./chunk-6KDHXURF.js";import{h as de,i as Kt,j as ue,k as Vt,n as Yt}from"./chunk-ME4XVOBJ.js";import{$a as ke,Ca as ie,Da as jt,Fa as Ut,Ha as zt,Ia as Bt,K as ne,Ka as $,L as V,P as Pt,Ta as Gt,V as Ft,W as Lt,Ya as Wt,Z as $t,_ as Dt,ab as ve,ba as ze,bb as qt,da as Mt,db as Ht,gb as be,k as W,na as Ot,q as Tt,za as Nt}from"./chunk-GEYU23YS.js";import{D as z,I as It,J as B,K as le,Ka as Ct,M as O,P as Rt,T as P,aa as Ne,h as vt,o as bt,p as L,q as Et,r as ce,u as Oe,v as St}from"./chunk-EAXXF2HW.js";import{i as At}from"./chunk-27DK4A5O.js";import{N as wt,U as kt,V as we,Y as g,Z as y,aa as je,ba as xt,ca as Ue,t as Me}from"./chunk-7AZDTGPA.js";import{readFile as Ee,realpath as qe,writeFile as Hi}from"node:fs/promises";import{execFile as Ki}from"node:child_process";import x from"node:path";import{promisify as Vi}from"node:util";import{readFile as Bi,writeFile as Gi}from"node:fs/promises";import me from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bbfa5b19-d801-582a-98e8-0c4925dd57c0")}catch{}})();var Zt="# pm-cli:runtime-cache:start",Be="# pm-cli:runtime-cache:end",Qt=".agents/pm",Ge=["runtime/","search/","locks/","transactions/","checkpoints/"],Wi=["search/eval-queries.json"];async function Xt(e){try{return await e()}catch(t){throw t instanceof Error&&"code"in t&&typeof t.code=="string"&&["EACCES","EPERM","EROFS"].includes(t.code)?new y("The workspace .gitignore is not writable.",g.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:t.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):t}}function en(e){return e.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/\/+$/,"")}function We(e){let t=e.replaceAll("\\","/");return me.isAbsolute(e)||t===".."||t.startsWith("../")}function qi(e=Qt){let t=en(e);return[Zt,...Ge.map(n=>n==="search/"?`${t}/${n}*`:`${t}/${n}`),...Wi.map(n=>`!${t}/${n}`),Be].join(`
|
|
2
2
|
`)}async function Lo(e,t={}){let n=me.join(e,".gitignore"),i=Qt;if(t.pmRoot!==void 0){let d=en(me.relative(me.resolve(e),me.resolve(t.pmRoot)));if(We(d))return{path:n,changed:!1};d.length>0&&(i=d)}let r="";try{r=await Xt(()=>Bi(n,"utf8"))}catch(d){if(!(d instanceof Error&&"code"in d&&d.code==="ENOENT"))throw d}let s=r.indexOf(Zt),o=r.indexOf(Be),c=(s>=0&&o>=s?`${r.slice(0,s)}${r.slice(o+Be.length)}`:r).trimEnd(),l=`${c.length>0?`${c}
|
|
3
3
|
|
|
4
4
|
`:""}${qi(i)}
|
|
@@ -11,4 +11,4 @@ import{f as Jt}from"./chunk-G6ETT4QK.js";import{h as de,i as Kt,j as ue,k as Vt,
|
|
|
11
11
|
`),s}async function Xe(e,t={}){let n=await Je(e);if(n===null||!await L(n))return[];let i=[],r;try{r=await rr(n)}catch{return[]}for(let s of r.sort((o,a)=>o.localeCompare(a)))if(s.endsWith(".json"))try{let o=JSON.parse(await sr(_e.join(n,s),"utf8"));o.version===1&&(t.includeReconciled||o.state==="pending")&&i.push(o)}catch{}return i.sort((s,o)=>s.created_at.localeCompare(o.created_at))}async function ha(e,t){let n=await Je(e);n!==null&&await ce(_e.join(n,fn(t.id)),`${JSON.stringify({...t,state:"reconciled",reconciled_at:V()},null,2)}
|
|
12
12
|
`)}async function ga(e){let t=await Xe(e.cwd??process.cwd(),e);return{ok:!0,count:t.length,receipts:t,generated_at:V()}}import re from"node:fs/promises";import se 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]="59b566d5-1d4f-500b-98e3-004e6f57d2b4")}catch{}})();async function cr(e,t){let n=[...new Set(Object.values(t))],i=[];return await Promise.all(n.map(async r=>{let s;try{s=await re.readdir(se.join(e,r))}catch{return}for(let o of s)for(let a of It)if(o.toLowerCase().endsWith(a)){i.push({relativePath:`${r}/${o}`,id:o.slice(0,-a.length)});break}})),i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath))}function lr(e,t){let{id:n,relativePath:i,liveItemIds:r,out:s}=e,o=ze(t);if(o){s.conflictMarkers.push({id:n,path:i,line:o.line,detail:`unresolved merge conflict marker ${o.marker}`});return}let a=null,c=t.split(/\r?\n/).map((l,d)=>({content:l.trim(),number:d+1})).filter(l=>l.content.length>0);for(let l of c)try{let d=JSON.parse(l.content);if(typeof d!="object"||d===null||Array.isArray(d))throw new TypeError("history entry must be an object");a=d}catch{s.unparseable.push({id:n,path:i,line:l.number,detail:"history line is not a valid JSON object"});return}a!==null&&(a.op==="delete"&&r.has(n)&&s.resurrected.push({id:n,deleted_at:typeof a.ts=="string"?a.ts:"",deleted_by:typeof a.author=="string"?a.author:""}),a.op==="history_repair"&&Array.isArray(a.patch)&&a.patch.length>0&&(s.repairReconciliations+=1))}function Ze(e,t){let n=typeof t=="object"&&t!==null&&"code"in t&&typeof t.code=="string"?t.code:"UNKNOWN";return`${e} could not be read (error code: ${n})`}async function dr(e,t){let n={conflictMarkers:[],unparseable:[],resurrected:[],repairReconciliations:0,scanned:0},i;try{i=await re.readdir(se.join(e,"history"))}catch{return n}for(let r of i.sort((s,o)=>s.localeCompare(o))){if(!r.endsWith(".jsonl"))continue;n.scanned+=1;let s;try{s=await re.readFile(se.join(e,"history",r),"utf8")}catch(o){n.unparseable.push({id:r.slice(0,-6),path:`history/${r}`,detail:Ze("history stream",o)});continue}lr({id:r.slice(0,-6),relativePath:`history/${r}`,liveItemIds:t,out:n},s)}return n}function pn(e){let t=ze(e);if(t)return`unresolved merge conflict marker ${t.marker} at line ${t.line}`;try{return JSON.parse(e),null}catch(n){return`invalid JSON (${String(n)})`}}async function ur(e){let t=[],n=0,i=null;try{i=await Et(O(e))}catch(s){n+=1,t.push({path:"settings.json",detail:Ze("configuration file",s)})}if(i!==null){n+=1;let s=pn(i);s!==null&&t.push({path:"settings.json",detail:s})}let r;try{r=await re.readdir(se.join(e,"schema"))}catch{return{scanned:n,unparseable:t}}for(let s of r.sort((o,a)=>o.localeCompare(a))){if(!s.endsWith(".json"))continue;n+=1;let o;try{o=await re.readFile(se.join(e,"schema",s),"utf8")}catch(c){t.push({path:`schema/${s}`,detail:Ze("configuration file",c)});continue}let a=pn(o);a!==null&&t.push({path:`schema/${s}`,detail:a})}return{scanned:n,unparseable:t}}async function _n(e,t,n,i={}){let r=await cr(e,n),s=new Set(r.map(u=>u.id)),o=new Map;for(let u of r){let m=o.get(u.id);m===void 0?o.set(u.id,[u.relativePath]):m.push(u.relativePath)}let a=[...o.entries()].filter(([,u])=>u.length>1).map(([u,m])=>({id:u,paths:[...m].sort((f,w)=>f.localeCompare(w))})).sort((u,m)=>u.id.localeCompare(m.id)),c=(await Promise.all(r.map(async u=>{if(!t.has(u.id))return{path:u.relativePath,id:u.id};try{let m=se.join(e,u.relativePath);return Mt(await re.readFile(m,"utf8"),{format:m.toLowerCase().endsWith(".md")?"json_markdown":"toon",schema:i.schema,extensionFieldNames:i.extensionFieldNames}),null}catch{return{path:u.relativePath,id:u.id}}}))).filter(u=>u!==null),l=await dr(e,s),d=await ur(e);return{item_files_on_disk:r.length,item_ids_on_disk:s.size,parsed_items:t.size,unreadable_item_files:c,duplicate_item_ids:a,history_streams_scanned:l.scanned,history_conflict_marker_streams:l.conflictMarkers,history_unparseable_streams:l.unparseable,resurrected_items:l.resurrected,history_repair_reconciliations:l.repairReconciliations,config_files_scanned:d.scanned,unparseable_config_files:d.unparseable}}import ft from"node:fs/promises";import{realpathSync as Cs}from"node:fs";import{execFile as As}from"node:child_process";import F from"node:path";import{promisify as Ts}from"node:util";(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]="6a350683-275b-5d4d-ae02-45798b115f89")}catch{}})();var mr=Object.freeze([{code:"missing_directory",command:"pm init",summary:"Recreate missing tracker directories (pm init is idempotent and restores the scaffold)."},{code:"settings_read_fs_error",command:"pm config list --json",summary:"settings.json could not be read as a regular file and pm fell back to defaults; repair the reported path or permissions, then re-run."},{code:"settings_read_invalid_json",command:"pm config list --json",summary:"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run."},{code:"settings_read_invalid_schema",command:"pm config list --json",summary:"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run."},{code:"settings_read_merge_failed",command:"pm config list --json",summary:"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files."},{code:"settings:id_prefix_empty",command:"pm config list --json",summary:'id_prefix is empty; set a non-empty "id_prefix" in settings.json so generated item ids are well-formed.'},{code:"settings:locks_ttl_non_positive",command:"pm config list --json",summary:'locks.ttl_seconds must be positive; set a positive "locks.ttl_seconds" in settings.json.'},{code:"telemetry_state_invalid_json",command:"pm health --check-telemetry",summary:"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only."},{code:"telemetry_queue_invalid_rows",command:"pm health --check-telemetry",summary:"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only."},{code:"telemetry_queue_pending",command:"pm health --check-telemetry",summary:"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only."},{code:"telemetry_queue_high_retries",command:"pm telemetry flush",summary:"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped."},{code:"telemetry_endpoint_probe_failed",command:"pm health --check-telemetry",summary:"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only."},{code:"telemetry_endpoint_probe_http_status",command:"pm health --check-telemetry",summary:"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only."},{code:"telemetry_schema_version_behind",command:"pm health --check-telemetry",summary:"Client schema is behind server; upgrade pm-cli to emit the latest event shape."},{code:"telemetry_otel_export_failing",command:"pm health --check-telemetry",summary:"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. Advisory only."},{code:"integrity_item_unreadable",command:"pm validate --check-files --verbose-diagnostics",summary:"An item file could not be read; restore or repair the file at the reported path."},{code:"integrity_item_parse_failed",command:"pm validate --check-files --verbose-diagnostics",summary:"An item file failed to parse; fix the malformed item metadata at the reported path."},{code:"integrity_item_conflict_marker",command:"pm validate --check-files --verbose-diagnostics",summary:"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line."},{code:"integrity_history_unreadable",command:"pm history-repair <id>",summary:"A history stream could not be read; re-anchor the affected item's history chain."},{code:"integrity_history_invalid_json",command:"pm history-repair <id>",summary:"A history stream contains invalid JSON; re-anchor the affected item's history chain."},{code:"integrity_history_conflict_marker",command:"pm history-repair <id>",summary:"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain."},{code:"validate_storage_unreadable_items",command:"pm validate --check-storage-integrity --verbose-diagnostics",summary:"An on-disk item file cannot be parsed (for example a botched merge resolution with stale TOON count headers); repair or restore the file at the reported path \u2014 list commands silently skip it while pm get hard-errors."},{code:"validate_storage_duplicate_item_ids",command:"pm validate --check-storage-integrity --verbose-diagnostics",summary:"One item id is claimed by multiple item documents \u2014 usually two branches minting the same id for different items before merging (GH-600). Keep one document, recreate the other item under a fresh id (pm copy, then delete the colliding file), and consider raising ids.token_length for concurrent multi-agent work."},{code:"validate_storage_history_conflict_markers",command:"pm merge driver history <base> <ours> <theirs>",summary:"A history stream contains unresolved Git conflict markers; re-merge it with the pm history merge driver (or resolve the markers by hand), then run pm history-repair for the item."},{code:"validate_storage_unparseable_history",command:"pm history-repair <id>",summary:"A history stream's newest line is not valid JSONL; repair or restore the stream before further mutations."},{code:"validate_storage_resurrected_items",command:"pm delete <id>",summary:"A live item's newest history operation is a delete: a delete/modify merge silently resurrected it. Decide the winner \u2014 re-delete the item, or keep it and append a mutation documenting the revival."},{code:"validate_storage_unparseable_config",command:"pm merge driver json <base> <ours> <theirs>",summary:"settings.json or a schema file cannot be parsed, so pm silently falls back to defaults; re-merge it with the pm JSON merge driver or fix the file by hand, then rerun pm validate."},{code:"validate_merge_fence_drift",command:"pm merge install",summary:"The committed .gitattributes merge fence no longer matches the active schema's type folders or tracker JSONL stores; rerun pm merge install (and commit .gitattributes) so every tracker artifact keeps its field-aware merge driver."},{code:"validate_storage_tracked_runtime_cache_files",command:"git rm --cached -r -- <tracked-runtime-directories>",summary:"Clone-local tracker runtime artifacts are committed. Run the exact tracked_runtime_cache.remediation_command, commit the index-only removals and managed .gitignore fence, then rerun validation."},{code:"integrity_item_outdated_format_version",command:"pm validate --verbose-diagnostics",summary:"An item predates the current storage format version; a pm storage migration rewrites it. Use --verbose-diagnostics to list the affected items."},{code:"integrity_item_ahead_format_version",command:"npm install -g @unbrained/pm-cli@latest",summary:"An item was written by a newer pm format version than this runtime supports; upgrade pm to read and validate it safely."},{code:"tracked_runtime_cache_files",command:"git rm --cached -r -- <tracked-runtime-directories>",summary:"Clone-local tracker runtime artifacts are committed. Run the exact tracked_runtime_cache.remediation_command from the integrity check, commit the index-only removals, and keep the managed .gitignore fence."},{code:"history_drift_missing_stream",command:"pm history-repair <id>",summary:"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass)."},{code:"history_drift_unreadable_stream",command:"pm history-repair <id>",summary:"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass)."},{code:"history_drift_hash_mismatch",command:"pm history-repair <id>",summary:"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass)."},{code:"history_drift_chain_mismatch",command:"pm history-repair <id>",summary:"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass)."},{code:"history_stream_over_compact_threshold",command:"pm history-compact <id>",summary:"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass)."},{code:"history_unknown_author_events",command:"pm validate --check-history-drift --fix-hints",summary:"Historical mutations lack attributable authorship. Configure PM_AUTHOR, pass global --author, or set author_default so future audit events are attributable."},{code:"locks_stale_count",command:"pm gc --scope locks",summary:"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them \u2014 gc retains active and unparseable locks."},{code:"locks_unreadable",command:"pm gc --scope locks --dry-run",summary:"Some lock files could not be read; preview the sweep and inspect the unreadable files manually \u2014 gc never deletes what it cannot read."},{code:"extension_update_health_partial_coverage",command:"pm extension --adopt-all --project",summary:"Update-health coverage is partial because unmanaged extensions were skipped; adopt the existing installs into managed metadata so the update scan covers them (use --global for global-scope extensions, or pm package --adopt-all when working with packages)."},{code:"vectorization_stale_items_remaining",command:"pm health --refresh-vectors",summary:"Some items have stale embeddings; refresh vectors so semantic search results stay current."},{code:"vectorization_embedding_identity_changed",command:"pm reindex --mode semantic",summary:"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors."},{code:"validate_metadata_missing_acceptance_criteria",command:'pm update <id> --acceptance-criteria "<criteria>"',summary:"Backfill the missing acceptance criteria on the reported item(s)."},{code:"validate_metadata_missing_estimate",command:'pm update <id> --estimate "<estimate>"',summary:"Backfill the missing estimate on the reported item(s)."},{code:"validate_metadata_missing_close_reason",command:'pm update <id> --close-reason "<reason>"',summary:"Backfill the missing close reason on the reported closed item(s)."},{code:"validate_metadata_missing_reviewer",command:'pm update <id> --reviewer "<name>"',summary:"Backfill the missing reviewer on the reported item(s)."},{code:"validate_metadata_missing_risk",command:'pm update <id> --risk "<level>"',summary:"Backfill the missing risk on the reported item(s)."},{code:"validate_metadata_missing_confidence",command:'pm update <id> --confidence "<level>"',summary:"Backfill the missing confidence on the reported item(s)."},{code:"validate_metadata_missing_sprint",command:'pm update <id> --sprint "<sprint>"',summary:"Backfill the missing sprint on the reported item(s)."},{code:"validate_metadata_missing_release",command:'pm update <id> --release "<release>"',summary:"Backfill the missing release on the reported item(s)."},{code:"validate_metadata_custom_profile_missing_required_fields",command:'pm config set metadata-required-fields --criterion "<field>"',summary:"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items."},{code:"validate_metadata_duplicate_issue_codes",command:'pm update <id> --title "<distinct title>"',summary:"Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <canonical-id> (closed-as-duplicate items are excluded from the check)."},{code:"validate_resolution_missing_fields",command:'pm update <id> --resolution "<how resolved>"',summary:"Backfill resolution / expected_result / actual_result on the reported closed item(s)."},{code:"validate_lifecycle_active_closure_like_metadata",command:"pm update <id> --unset <closure-like-field>",summary:"Clear the closure-like field the validator flags on this active item \u2014 the detail row names it (resolution / actual-result / blocked-reason) \u2014 or close the item if it is actually done."},{code:"validate_lifecycle_active_terminal_parent",command:"pm update <id> --parent <active-parent-id>",summary:"Reopen the terminal parent or move the active child under a non-terminal parent."},{code:"validate_lifecycle_stale_blockers",command:"pm update <id> --unset blocked-by --unset blocked-reason",summary:"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status."},{code:"validate_lifecycle_dependency_cycles_error",command:"pm update <id> --dep-remove <dep-id>",summary:"Break the dependency cycle by removing one edge from the reported cycle."},{code:"validate_lifecycle_dependency_cycles",command:"pm update <id> --dep-remove <dep-id>",summary:"Break the dependency cycle by removing one edge from the reported cycle."},{code:"validate_hierarchy_parent_cycle_error",command:"pm update <id> --parent <other-id>",summary:"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent)."},{code:"validate_hierarchy_parent_cycle",command:"pm update <id> --parent <other-id>",summary:"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent)."},{code:"validate_files_missing_linked_paths",command:"pm <files|docs> <id> --remove <path>",summary:"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc)."},{code:"validate_files_orphaned_paths",command:"pm <files|docs> <id> --add <path>",summary:"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace."},{code:"validate_files_tracked_all_strict_forces_pm_internals",command:"pm validate --check-files --include-pm-internals",summary:"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode."},{code:"validate_history_drift_missing_streams",command:"pm history-repair <id>",summary:"Re-anchor the history chains of the items missing a history stream."},{code:"validate_history_drift_unreadable_streams",command:"pm history-repair <id>",summary:"Re-anchor the history chains of the items with an unreadable history stream."},{code:"validate_history_drift_hash_mismatches",command:"pm history-repair <id>",summary:"Re-anchor the history chains of the items whose content hash drifted."},{code:"validate_history_drift_chain_mismatches",command:"pm history-repair <id>",summary:"Re-anchor the history chains of the items with a broken history chain."},{code:"validate_history_unknown_author_events",command:"pm config project set author_default <stable-agent-id>",summary:"Historical mutations lack attributable authorship. Set a stable default or use invocation-wide --author for future events; existing audit history remains append-only."},{code:"validate_command_references_stale_pm_ids",command:'pm update <id> --replace-tests --test "command=<corrected-command>" [--test ...]',summary:"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call."},{code:"validate_format_version_outdated_items",command:"pm validate --verbose-diagnostics",summary:"One or more items predate the current storage format version; a pm storage migration rewrites them. Use --verbose-diagnostics to list the affected items."},{code:"validate_format_version_ahead_items",command:"npm install -g @unbrained/pm-cli@latest",summary:"One or more items were written by a newer pm format version than this runtime supports; upgrade pm to read and validate them safely."}]);function fr(e){if(typeof e!="string")return;let t=e.trim();for(let n of mr)if(t===n.code||t.startsWith(`${n.code}:`))return n}function pr(e){let t={};for(let n of e){let i=fr(n);i!==void 0&&!Object.prototype.hasOwnProperty.call(t,i.code)&&(t[i.code]=i.command)}return t}function hn(e){return Object.values(pr(e))}import oe from"node:fs/promises";import{createHash as _r}from"node:crypto";import yn 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]="90364096-b94c-591c-9024-e697fa9322a5")}catch{}})();var wn=3,hr="history-drift-cache.json";function kn(e){return yn.join(e,"runtime",hr)}async function gr(e){try{let t=await oe.readFile(kn(e),"utf8"),n=JSON.parse(t);return n.version!==wn||typeof n.entries!="object"||n.entries===null?null:n}catch{return null}}function vn(e,t){return typeof e=="object"&&e!==null&&"code"in e&&e.code===t}async function yr(e,t,n,i,r){let s=jt(e),o;try{o=await oe.stat(s)}catch(l){return vn(l,"ENOENT")||r.unreadableStreams.push(ie),!1}let a=r.missingStreams.length,c=await En({itemId:ie,historyPath:s,stat:o,cached:t[ie],verifyCacheHitByContent:i,accumulator:r});return c.verification?(c.verification.chainOk||r.chainMismatches.push(ie),n[ie]={mtime_ms:o.mtimeMs,ctime_ms:o.ctimeMs,size:o.size,content_hash:c.verification.contentHash,latest_after_hash:c.verification.latestAfterHash,chain_ok:c.verification.chainOk},c.cacheDirty):(r.missingStreams.splice(a),c.cacheDirty)}function bn(e){return _r("sha256").update(e).digest("hex")}async function wr(e){let t=await oe.readFile(e,"utf8");return bn(t)}async function kr(e){let t=await oe.readFile(e,"utf8"),n=bn(t);if(t.trim().length===0)return null;let i=[],r=null;for(let s of t.split(/\r?\n/)){let o=s.trim();if(o.length===0)continue;let a=JSON.parse(o);if(typeof a.after_hash!="string"||a.after_hash.trim().length===0)throw new Error("missing after_hash");i.push(a),r=a.after_hash}return r?{latestAfterHash:r,chainOk:Nt(i).ok,contentHash:n}:null}function vr(e,t){return e!==void 0&&e.mtime_ms===t.mtimeMs&&e.ctime_ms===t.ctimeMs&&e.size===t.size}async function gn(e,t,n){try{let i=await kr(t);return i||(n.missingStreams.push(e),null)}catch{return n.unreadableStreams.push(e),null}}async function En(e){let t=typeof e.cached?.content_hash=="string"&&e.cached.content_hash.length>0?e.cached.content_hash:void 0;if(!(vr(e.cached,e.stat)&&t!==void 0&&e.cached!==void 0)||!e.cached)return{verification:await gn(e.itemId,e.historyPath,e.accumulator),cacheDirty:!0};let i;if(e.verifyCacheHitByContent)try{i=await wr(e.historyPath)}catch{return e.accumulator.unreadableStreams.push(e.itemId),{verification:null,cacheDirty:!1}}else i=t;return!e.verifyCacheHitByContent||i===t?{verification:{latestAfterHash:e.cached.latest_after_hash,chainOk:e.cached.chain_ok,contentHash:i},cacheDirty:!1}:{verification:await gn(e.itemId,e.historyPath,e.accumulator),cacheDirty:!0}}async function Sn(e,t,n={}){let i={missingStreams:[],unreadableStreams:[],hashMismatches:[],chainMismatches:[]},s=(await gr(e))?.entries??{},o={},a=!1,c=n.cacheHitVerification!=="metadata";for(let u of t){let m=Rt(e,u.id),f;try{f=await oe.stat(m)}catch(E){vn(E,"ENOENT")?i.missingStreams.push(u.id):i.unreadableStreams.push(u.id);continue}let w=s[u.id],p=await En({itemId:u.id,historyPath:m,stat:f,cached:w,verifyCacheHitByContent:c,accumulator:i});if(a||=p.cacheDirty,!p.verification)continue;p.verification.chainOk||i.chainMismatches.push(u.id),o[u.id]={mtime_ms:f.mtimeMs,ctime_ms:f.ctimeMs,size:f.size,content_hash:p.verification.contentHash,latest_after_hash:p.verification.latestAfterHash,chain_ok:p.verification.chainOk};let{body:_,...h}=u;Ot({metadata:h,body:_})!==p.verification.latestAfterHash&&i.hashMismatches.push(u.id)}let l=await yr(e,s,o,c,i);if(a||=l,a||Object.keys(s).length!==Object.keys(o).length){let u=kn(e);try{await oe.mkdir(yn.dirname(u),{recursive:!0}),await ce(u,JSON.stringify({version:wn,entries:o}))}catch{}}let d=[...new Set([...i.missingStreams,...i.unreadableStreams,...i.hashMismatches,...i.chainMismatches])].sort((u,m)=>u.localeCompare(m));return{...i,driftedItems:d}}(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]="ab236f47-a866-5236-b8da-f7f23140b978")}catch{}})();var br=["metadata","resolution"],Qe=["metadata","resolution","estimates","lifecycle"],Er="completed";function et(e){return`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}function In(e){let t=e?.trim();return t!==void 0&&t.length>0?t:void 0}function Rn(e){let t=[];for(let n of e){if(!n.missing_fields.includes("resolution"))continue;let i=In(n.close_reason)??Er;t.push({item_id:n.id,check:"resolution",field:"resolution",kind:"set_resolution",value:i,command:`pm update ${n.id} --resolution ${et(i)}`,gate:"resolution"})}return t}function xn(e){let t=[];for(let n of e){let i=In(n.resolution);i!==void 0&&t.push({item_id:n.id,check:"metadata",field:"close_reason",kind:"set_close_reason",value:i,command:`pm update ${n.id} --close-reason ${et(i)}`,gate:"metadata"})}return t}function Cn(e,t){return e.map(n=>{let i=zt(n.type,t);return{item_id:n.id,check:"metadata",field:"estimated_minutes",kind:"set_estimate",value:String(i),command:`pm update ${n.id} --estimate ${i}`,gate:"estimates"}})}function An(e){return e.map(t=>t.grandparent_id!==void 0&&t.grandparent_active===!0?{item_id:t.id,check:"lifecycle",field:"parent",kind:"reparent",parent_id:t.grandparent_id,command:`pm update ${t.id} --parent ${t.grandparent_id}`,gate:"lifecycle"}:{item_id:t.id,check:"lifecycle",field:"parent",kind:"unset_parent",command:`pm update ${t.id} --unset parent`,gate:"lifecycle"})}function Tn(e){let t=[];for(let n of e){if(n.classification!=="deleted")continue;let i=n.link_kind==="files"?"files":"docs";t.push({item_id:n.item_id,check:"files",field:n.link_kind,kind:n.link_kind==="files"?"prune_file_link":"prune_doc_link",path:n.path,command:`pm ${i} ${n.item_id} --remove ${et(n.path)}`})}return t}function Pn(e){let t=(e??[]).flatMap(i=>i.split(",")).map(i=>i.trim()).filter(i=>i.length>0);if(t.length===0){if(e!==void 0&&e.length>0)throw new y(`--fix-scope values must not be empty. Supported values: ${Qe.join(", ")}.`,g.USAGE);return new Set(br)}let n=new Set;for(let i of t){let r=i.toLowerCase().replaceAll("-","_");if(Qe.includes(r)){n.add(r);continue}throw new y(`Unknown --fix-scope value "${i}". Supported values: ${Qe.join(", ")}.`,g.USAGE)}return n}function Fn(e,t){let n=[],i=[];for(let r of e)r.gate!==void 0&&!t.has(r.gate)?i.push(r):n.push(r);return{applicable:n,gated:i}}function he(e){return{item_id:e.item_id,check:e.check,field:e.field,command:e.command,...e.gate!==void 0?{gate:e.gate}:{}}}(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]="087bac58-e32d-5cb8-8fda-0e09075c3f35")}catch{}})();var Sr=/^([A-Z][A-Z0-9]*-\d+)\b/;function Ir(e){if(typeof e!="string")return null;let t=e.trim().toUpperCase();if(t.length===0)return null;let n=Sr.exec(t);return n?n[1]:null}function Ln(e){return typeof e=="string"&&e.trim().length>0}function $n(e){let t=new Map;for(let i of e){if(typeof i.title!="string"||Ln(i.duplicate_of))continue;let r=Ir(i.title);if(r===null)continue;let s=t.get(r);s||(s=[],t.set(r,s)),s.some(o=>o.id===i.id)||s.push({id:i.id,title:i.title,parent:Ln(i.parent)?i.parent.trim():null})}let n=[];for(let[i,r]of t){if(r.length<2)continue;let s=new Set(r.map(c=>c.id.toLowerCase())),o=r.filter(c=>c.parent===null||!s.has(c.parent.toLowerCase()));if(o.length<2)continue;let a=[...o].sort((c,l)=>c.id.localeCompare(l.id));n.push({code:i,count:a.length,ids:a.map(c=>c.id),titles:a.map(c=>c.title)})}return n.sort((i,r)=>i.code.localeCompare(r.code))}(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]="1951b0f1-11fa-5728-b516-7458a55b1e29")}catch{}})();function Dn(e){let t=new Map;for(let i of e){let r=t.get(i.item_type);r||(r=new Map,t.set(i.item_type,r)),r.set(i.field,(r.get(i.field)??0)+1)}let n={};for(let i of[...t.keys()].sort((r,s)=>r.localeCompare(s))){let r=t.get(i),s={};for(let o of[...r.keys()].sort((a,c)=>a.localeCompare(c)))s[o]=r.get(o);n[i]=s}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]="5a5b0bd8-d99b-52fb-82ae-52ba48c54c30")}catch{}})();var Mn=3;function On(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)}function Nn(e,t,n=Mn){let i=Number.isFinite(n)&&n>=1?Math.floor(n):Mn,r=new Map;for(let s of t){let o=On(s);if(o.length===0)continue;let a=r.get(o);a?a.push(s):r.set(o,[s])}return e.map(s=>{let o=(r.get(On(s))??[]).filter(a=>a!==s).sort((a,c)=>a.localeCompare(c));return o.length===0?{path:s,classification:"deleted",candidates:[],candidates_truncated:!1}:{path:s,classification:"moved",candidates:o.slice(0,i),candidates_truncated:o.length>i}})}function jn(e){return e.map(t=>t.classification==="moved"?`${t.path}:moved:${t.candidates[0]}`:`${t.path}:deleted`)}(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]="2b9ba0a4-396f-5870-bc89-e7fc789bb49d")}catch{}})();var Rr=/^[a-z][a-z0-9+.-]+:\/\//i;function ge(e){return Rr.test(e.trim())}(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]="e063d634-4306-5725-927a-5f2af1722458")}catch{}})();function xr(e,t){return e==="moved"||t==="moved"?"moved":"deleted"}function Un(e){return`${e.item_id} ${e.link_kind}`}function zn(e,t){let n=new Map;for(let i of e){let r=n.get(i.path);r?(r.classification=xr(r.classification,i.classification),r.owners.set(Un(i),i)):n.set(i.path,{classification:i.classification,owners:new Map([[Un(i),i]])})}return[...n.entries()].sort(([i],[r])=>i.localeCompare(r)).map(([i,r])=>({path:i,classification:r.classification,items:[...r.owners.values()].map(s=>{let o=t(s.item_id);return{id:s.item_id,type:o?.type??"Unknown",title:o?.title??"",status:o?.status??"",field:s.link_kind}}).sort((s,o)=>{let a=s.id.localeCompare(o.id);return a!==0?a:s.field.localeCompare(o.field)})}))}function Cr(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Bn(e){let t=[];for(let n of e)for(let i of n.items)t.push(`${n.path}:${n.classification} owner=${i.id} status=${i.status} field=${i.field} title="${Cr(i.title)}"`);return t}import{execFile as Ar}from"node:child_process";import{realpath as Tr}from"node:fs/promises";import Gn from"node:path";import{promisify as Pr}from"node:util";(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]="d18b51d7-294a-52da-b1cf-a10f24aefbc9")}catch{}})();var Fr=Pr(Ar),Lr=32*1024*1024,$r=1e4,Dr=["search/eval-queries.json"];function tt(e){return e.replaceAll("\\","/").replace(/\/+$/,"")}function Mr(e){return`'${e.replaceAll("'","'\\''")}'`}async function Or(e,t=Tr){return t(e).catch(()=>Gn.resolve(e))}async function Wn(e){let t=await pe(e);if(t===null)return{git_workspace_root:null,tracker_relative_root:null,tracked_paths:[],tracked_path_count:0,remediation_command:null};let n=await Or(e),i=tt(Gn.relative(t,n));if(i.length===0)return{git_workspace_root:t,tracker_relative_root:null,tracked_paths:[],tracked_path_count:0,remediation_command:null};let r=Ge.map(s=>`${i}/${tt(s)}`);try{let{stdout:s}=await Fr("git",["ls-files","-z","--",...r.map(l=>`:(literal)${l}`)],{cwd:t,encoding:"utf8",maxBuffer:Lr,windowsHide:!0,timeout:$r}),o=new Set(Dr.map(l=>`${i}/${l}`)),a=[...new Set(s.split("\0").filter(l=>l.length>0&&!o.has(tt(l))))].sort((l,d)=>l.localeCompare(d)),c=r.filter(l=>a.some(d=>d===l||d.startsWith(`${l}/`)));return{git_workspace_root:t,tracker_relative_root:i,tracked_paths:a,tracked_path_count:a.length,remediation_command:a.length===0?null:`git rm --cached -r -- ${c.map(l=>Mr(`:(literal)${l}`)).join(" ")}`}}catch{return{git_workspace_root:t,tracker_relative_root:i,tracked_paths:[],tracked_path_count:0,remediation_command:null}}}import Nr from"node:fs/promises";import D from"node:path";import jr from"fast-glob";(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]="3fe80124-596b-591c-9f0d-fbbc129c6bb4")}catch{}})();var Ur=["path","scope","note"],zr=["pattern","glob","path","scope","note"],Br=["path"],Gr=["from","to"],Wr=new Set(["note","scope"]);function Hn(e){let t=e??"project";if(!Me.includes(t))throw new y(`Invalid scope "${e}". Valid scopes: ${Me.join(", ")} (default: project).`,g.USAGE);return t}function Kn(e){return e.startsWith("```")||e.includes(`
|
|
13
13
|
`)||/^(?:[-*+]\s+)?(?:path|scope|note)\s*[:=]/i.test(e)?!0:Kt(e)}function qr(e){return e.flatMap(t=>{let n=t.trim();return n.length===0||Kn(n)||!n.includes(",")?[t]:Yt(n)})}function Hr(e,t){return e?qr(e).map(n=>{let i=n.trim(),r=Kn(i)?de(n,"--add"):{path:i};if(ue(r,"--add",Ur),!r.path)throw new y(`--add requires path=<value> or a bare ${t} path`,g.USAGE);return{path:r.path,scope:Hn(r.scope),note:r.note?.trim()||void 0}}):[]}function Kr(e){return e?e.map(t=>{let n=t.trim();if(!n)throw new y("--add-glob requires a glob pattern value",g.USAGE);if(n.includes("=")||/^(?:[-*+]\s+)?(?:pattern|glob|path)\s*[:=]/i.test(n)||n.startsWith("```")){let i=de(n,"--add-glob");ue(i,"--add-glob",zr);let r=i.pattern?.trim()||i.glob?.trim()||i.path?.trim();if(!r)throw new y("--add-glob key/value form requires pattern=<glob>",g.USAGE);return{pattern:r,scope:Hn(i.scope),note:i.note?.trim()||void 0}}return{pattern:n,scope:"project"}}):[]}function Vr(e){return e?e.map(t=>{let n=t.trim();if(!n)throw new y("--remove requires a path value",g.USAGE);if(n.includes("=")||/^(?:[-*+]\s+)?path\s*[:=]/i.test(n)||n.startsWith("```")){let i=de(n,"--remove"),r=Object.keys(i).filter(s=>Wr.has(s.toLowerCase()));if(r.length>0)throw new y(`--remove identifies a linked artifact by path only and does not accept ${r.map(s=>`"${s}"`).join(", ")}. Pass just the path (path=<value>, path:<value>, or a bare path); record removal context with --message "<why removed>".`,g.USAGE);if(ue(i,"--remove",Br),!i.path)throw new y("--remove key/value form requires path=<value>",g.USAGE);return i.path}return n}):[]}function Yr(e){return e?e.map(t=>{let n=de(t,"--migrate");ue(n,"--migrate",Gr);let i=n.from?.trim(),r=n.to?.trim();if(!i||!r)throw new y("--migrate requires from=<value> and to=<value>",g.USAGE);return{from:i,to:r}}):[]}function nt(e,t){let n=e;for(let i of t)n.startsWith(i.from)&&(n=`${i.to}${n.slice(i.from.length)}`);return n}function q(e){return e.split(D.sep).join("/")}function it(e,t,n=process.cwd()){let i=e.trim();if(ge(i))return i;if(D.isAbsolute(i)||/^[A-Za-z]:[\\/]/.test(i))return q(i.replaceAll("\\",D.sep));let r=D.relative(t,n);return r.startsWith(`..${D.sep}`)||r===".."||D.isAbsolute(r)?q(D.normalize(i)):q(D.relative(t,D.resolve(n,i)))}async function Jr(e,t=process.cwd(),n=process.cwd()){let i=[];for(let r of e){let s=D.isAbsolute(r.pattern),o=await jr(r.pattern,{cwd:n,absolute:s,onlyFiles:!0,dot:!0,unique:!0,followSymbolicLinks:!0}),a=[...new Set(o.map(c=>it(c,t,n)))].sort((c,l)=>c.localeCompare(l));for(let c of a)i.push({path:c,scope:r.scope,note:r.note})}return i}function Xr(e,t,n){if(t===void 0)return e;if(!n)throw new y("--note requires --add or --add-glob in the same invocation (the note annotates the links being added)",g.USAGE);let i=t.trim();return i.length===0?e:e.map(r=>r.note===void 0?{...r,note:i}:r)}function Zr(e){return`${e.path}::${e.scope}`}function rt(e){return[...e].sort((t,n)=>{let i=t.path.localeCompare(n.path);return i!==0?i:t.scope.localeCompare(n.scope)})}function st(e){return[...new Map(e.map(t=>[Zr(t),t])).values()].map(t=>({...t,note:t.note?.trim()||void 0}))}async function Qr(e,t=process.cwd()){let n=[...new Set(e)].sort((a,c)=>a.localeCompare(c)),i=[],r=[],s=[],o=[];for(let a of n){if(ge(a)){o.push(a.trim());continue}let c=D.isAbsolute(a)?a:D.resolve(t,a);try{(await Nr.stat(c)).isFile()?i.push(a):s.push(a)}catch(l){if(typeof l=="object"&&l!==null&&"code"in l&&l.code==="ENOENT"){r.push(a);continue}s.push(a)}}return{checked:n.length,existing_files:i,missing_paths:r,non_file_paths:s,remote_references:o}}function es(e,t,n,i){let r=0;for(let o=0;o<e.length;o+=1){let a=nt(e[o].path,i);a!==e[o].path&&(e[o]={...e[o],path:a},r+=1)}return{adds:t.map(o=>{let a=nt(o.path,i);return a!==o.path&&(r+=1),{...o,path:a}}),removes:n.map(o=>nt(o,i)),count:r}}function ts(e,t,n,i){for(let s of t)e.some(o=>o.path===s.path&&o.scope===s.scope)||e.push(s);if(n.length>0)for(let s=e.length-1;s>=0;s-=1)n.includes(e[s].path)&&e.splice(s,1);let r=st(e);return i?r:rt(r)}async function qn(e){let t=e.artifacts.map(n=>n.path);return{id:e.id,artifacts:e.artifacts,changed:e.changed,count:e.artifacts.length,migrations_applied:e.migrationsApplied&&e.migrationsApplied>0?e.migrationsApplied:void 0,validation:e.options.validatePaths?await Qr(t,e.workspaceRoot):void 0}}async function xe(e,t,n,i){let{metadataKey:r}=i,s=Vt(),o=B(process.cwd(),n.path),a=le(o),c=process.cwd();if(!await L(O(o)))throw new y(`Tracker is not initialized at ${o}. Run pm init first.`,g.NOT_FOUND);let l=await $(o),d=z(l,W()),u=await s.resolveList(t.add,"--add"),m=await s.resolveList(t.addGlob,"--add-glob"),f=await s.resolveList(t.remove,"--remove"),w=await s.resolveList(t.migrate,"--migrate"),p=Hr(u,i.bareNoun).map(T=>({...T,path:it(T.path,a,c)})),_=Kr(m),h=await Jr(_,a,c),v=Xr([...p,...h],t.note,p.length>0||_.length>0),E=Vr(f).map(T=>it(T,a,c)),S=Yr(w);if(!(v.length>0||E.length>0||S.length>0)){let T=await ke(o,e,l.id_prefix,l.item_format,d.type_to_folder);if(!T)throw new y(`Item ${e} not found`,g.NOT_FOUND);let R=(await ve(T,{schema:l.schema})).document.metadata[r]??[];return qn({id:T.id,artifacts:R,changed:!1,options:t,workspaceRoot:a})}let G=ne(t.author,l.author_default),j=await be({pmRoot:o,settings:l,id:e,op:i.op,author:G,message:t.message,force:t.force,skipNoop:!0,mutate(T){let k=T.metadata,R=k[r]??[],te=[...R],Z=es(te,v,E,S),De=ts(te,Z.adds,Z.removes,i.supportsAppendStable&&t.appendStable===!0);De.length>0?k[r]=De:delete k[r];let yt=!xt(R,De);return{changedFields:yt?[r]:[],warnings:yt&&Z.count>0?[`path_migrations_applied:${Z.count}`]:[]}}}),b=j.item[r]??[],A=j.warnings.find(T=>T.startsWith("path_migrations_applied:")),U=A?Number(A.slice(24)):0;return qn({id:j.item.id,artifacts:b,changed:j.changedFields.includes(r),migrationsApplied:U,options:t,workspaceRoot:a})}function Ce(e,t){let n={};for(let[i,r]of Object.entries(e))n[i==="artifacts"?t:i]=r;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]="c4c82f8f-7890-5ed2-8f0f-a82ba42cf807")}catch{}})();async function Vn(e,t,n){let i=await xe(e,t,n,{metadataKey:"docs",op:"docs_add",bareNoun:"doc",supportsAppendStable:!1});return Ce(i,"docs")}import Yn from"node:fs/promises";import M 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]="5e45d0f1-a1a7-50ea-a9a3-ec6283d3471d")}catch{}})();var ns=32768;function ot(e){return q(M.normalize(e))}async function Ae(e){try{return await Yn.realpath(e)}catch{return M.resolve(e)}}function ae(e,t){let n=M.isAbsolute(e.path)?M.resolve(e.path):M.resolve(t,e.path);return`${ot(n)}::${e.scope}`}function Te(e,t,n){if(typeof e=="string"){let i=e.trim();i.length>0&&n.push({field:t,value:i});return}if(Array.isArray(e)){e.forEach((i,r)=>Te(i,`${t}[${r}]`,n));return}if(typeof e=="object"&&e!==null)for(let[i,r]of Object.entries(e))Te(r,t?`${t}.${i}`:i,n)}function is(e){let t=[];return Te(e.metadata,"metadata",t),Te(e.body,"body",t),t}function rs(e){let t=e.trim();return t=t.replace(/^[`"'<([{]+/u,""),t=t.replace(/[`"'>)\]},;!?]+$/u,""),t=t.replace(/[.]+$/u,""),t=t.replace(/:(?:\d+)(?::\d+)?$/u,""),t=t.replace(/[.]+$/u,""),t}function ss(e){let t=[],n=/(?:[A-Za-z]:[\\/]|\/)[^\s"'`<>()[\]{},;]+/gu,i=/(?:\.{1,2}[\\/])?(?:(?:[A-Za-z0-9_.@-]+[\\/])+[A-Za-z0-9_.@-]+|[A-Za-z0-9_.@-]+\.[A-Za-z0-9][A-Za-z0-9._-]*)/gu;for(let r of e){let s=new Set,o=r.value.slice(0,ns);for(let[a,c]of[[n,r.value],[i,o]]){a.lastIndex=0;for(let l of c.matchAll(a)){let d=rs(l[0]);!d||s.has(d)||(s.add(d),t.push({field:r.field,value:d}))}}}return t}async function os(e,t,n=t){let i=M.isAbsolute(e)?M.resolve(e):M.resolve(n,e),r;try{r=await Yn.stat(i)}catch{return}if(!r.isFile())return;let[s,o]=await Promise.all([Ae(t),Ae(i)]);if(Oe(s,o)){let a=M.relative(s,o);return!a||a.startsWith("..")||M.isAbsolute(a)?void 0:{path:ot(a),scope:"project"}}return{path:ot(i),scope:"global"}}async function as(e,t,n=t){let i=new Set((e.metadata.files??[]).map(c=>ae(c,t))),r=new Map,s=ss(is(e)),o=new Map;await Promise.all([...new Set(s.map(c=>c.value))].map(async c=>{o.set(c,await os(c,t,n))}));let a=s.map(c=>({reference:c,resolved:o.get(c.value)}));for(let{reference:c,resolved:l}of a){if(!l)continue;let d=ae(l,t),u=r.get(d)??{path:l.path,scope:l.scope,sourceFields:new Set,originalPaths:new Set,sourceCount:0};u.sourceFields.add(c.field),u.originalPaths.add(c.value),u.sourceCount+=1,r.set(d,u)}return[...r.entries()].map(([c,l])=>({path:l.path,scope:l.scope,status:i.has(c)?"already_linked":"addable",source_count:l.sourceCount,source_fields:[...l.sourceFields].sort((d,u)=>d.localeCompare(u)),original_paths:[...l.originalPaths].sort((d,u)=>d.localeCompare(u))})).sort((c,l)=>{let d=c.status.localeCompare(l.status);if(d!==0)return d;let u=c.path.localeCompare(l.path);return u!==0?u:c.scope.localeCompare(l.scope)})}async function Jn(e,t,n){let i=await xe(e,t,n,{metadataKey:"files",op:"files_add",bareNoun:"file",supportsAppendStable:!0});return Ce(i,"files")}async function cs(e,t){let n=await Ae(t),i=await Promise.all(e.map(async s=>{let o=s.trim();if(!o)throw new y("Files lookup paths must not be empty.",g.USAGE);if(!M.isAbsolute(o))return q(o);let a=await Ae(o);return Oe(n,a)?q(M.relative(n,a)):q(a)})),r=[...new Set(i)].sort((s,o)=>s.localeCompare(o));if(r.length===0)throw new y("Files lookup requires at least one path.",g.USAGE);return r}function ls(e){for(let[i,r]of[["limit",e.limit],["offset",e.offset]])if(r!==void 0&&(!Number.isInteger(r)||r<0))throw new y(`Files lookup ${i} must be a non-negative integer.`,g.USAGE);let{offset:t=0,limit:n=50}=e;return{offset:Math.max(0,Math.floor(t)),limit:e.noTruncate?void 0:Math.max(0,Math.floor(n))}}function Xn(e){return{id:e.id,title:e.title,type:e.type,status:e.status,priority:e.priority,updated_at:e.updated_at}}async function ds(e){if([e.strictRead,e.noTruncate,Tt()].includes(!0))return null;let t=await Wt(e.pmRoot,[...new Set(Object.values(e.typeToFolder))]);return t?Gt({pmRoot:e.pmRoot,expectedSourceCursor:t.source_cursor,paths:e.paths,scope:e.scope,limit:e.limit,offset:e.offset}):null}async function us(e){let t=[],i=(await qt(e.pmRoot,e.settings.item_format,e.typeToFolder,t,e.settings.schema)).map(o=>({item:o,files:(o.files??[]).filter(a=>e.paths.includes(q(a.path))&&(e.scope===void 0||a.scope===e.scope)).sort((a,c)=>{let l=a.path.localeCompare(c.path);return l===0?a.scope.localeCompare(c.scope):l})})).filter(o=>o.files.length>0).sort((o,a)=>{let c=o.item.priority-a.item.priority;if(c!==0)return c;let l=a.item.updated_at.localeCompare(o.item.updated_at);return l===0?o.item.id.localeCompare(a.item.id):l}),r=t.filter(o=>/^item_list_(?:item|directory)_read_failed:/u.test(o));if(e.strictRead&&r.length>0)throw new y(`Files lookup could not read every item: ${r.join("; ")}`,g.GENERIC_FAILURE);let s=i.slice(e.offset,e.limit===void 0?void 0:e.offset+e.limit);return{paths:e.paths,total:i.length,count:s.length,offset:e.offset,limit:e.limit??null,has_more:e.offset+s.length<i.length,truncated:e.offset+s.length<i.length,completeness:{status:r.length===0?"complete":"partial",source:"source_scan"},warnings:t,matches:s.map(o=>({item:Xn(o.item),files:o.files}))}}async function Lc(e,t){let n=B(process.cwd(),t.path),i=le(n);if(!await L(O(n)))throw new y(`Tracker is not initialized at ${n}. Run pm init first.`,g.NOT_FOUND);let r=await cs(e.paths,i),s=await $(n),o=z(s,W()),{offset:a,limit:c}=ls(e),l=await ds({pmRoot:n,typeToFolder:o.type_to_folder,paths:r,scope:e.scope,limit:c,offset:a,strictRead:e.strictRead===!0,noTruncate:e.noTruncate===!0});return l?{paths:r,total:l.total,count:l.matches.length,offset:a,limit:c,has_more:a+l.matches.length<l.total,truncated:a+l.matches.length<l.total,completeness:{status:"unchecked",source:"index"},warnings:[],matches:l.matches.map(d=>({item:Xn(d.item),files:d.files}))}:us({pmRoot:n,settings:s,typeToFolder:o.type_to_folder,paths:r,scope:e.scope,limit:c,offset:a,strictRead:e.strictRead===!0})}async function $c(e,t,n){let i=B(process.cwd(),n.path),r=le(i);if(!await L(O(i)))throw new y(`Tracker is not initialized at ${i}. Run pm init first.`,g.NOT_FOUND);let s=await $(i),o=z(s,W()),a=await ke(i,e,s.id_prefix,s.item_format,o.type_to_folder);if(!a)throw new y(`Item ${e} not found`,g.NOT_FOUND);let c=await ve(a,{schema:s.schema}),l=await as(c.document,r,process.cwd()),d=l.filter(b=>b.status==="addable"),u=l.filter(b=>b.status==="already_linked"),m=t.apply===!0,f=t.note?.trim()||"discovered from item text";if(!m||d.length===0){let b=c.document.metadata.files??[];return{id:a.id,files:b,changed:!1,apply:m,count:b.length,candidate_count:l.length,addable_count:d.length,added_count:0,skipped_existing_count:u.length,candidates:l,added:[],skipped_existing:u}}let w=ne(t.author,s.author_default),p=d.map(b=>({path:b.path,scope:b.scope,note:f})),_=[],h=new Set,v=await be({pmRoot:i,settings:s,id:e,op:"files_discover",author:w,message:t.message??"Discover referenced file links",force:t.force,mutate(b){let A=[...b.metadata.files??[]],U=new Set(A.map(R=>ae(R,r)));_=[],h.clear();for(let[R,te]of p.entries()){let Z=ae(te,r);U.has(Z)||(A.push(te),U.add(Z),_.push(te),h.add(R))}let T=st(A),k=t.appendStable?T:rt(T);return k.length>0?b.metadata.files=k:delete b.metadata.files,{changedFields:_.length>0?["files"]:[],warnings:_.length!==p.length?[`files_discover_skipped_existing:${p.length-_.length}`]:[]}}}),E=v.item.files??[],S=new Set(_.map(b=>ae(b,r))),I=E.filter(b=>S.has(ae(b,r))),G=d.filter((b,A)=>!h.has(A)),j=[...u,...G];return{id:v.item.id,files:E,changed:I.length>0,apply:!0,count:E.length,candidate_count:l.length,addable_count:d.length,added_count:I.length,skipped_existing_count:j.length,candidates:l,added:I,skipped_existing:j}}(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]="8c4d45cf-6b97-5151-a325-db09d31962a7")}catch{}})();var ms=new Set(["get","history","restore","update","close","delete","append","claim","release","comments","notes","learnings","files","docs","deps","test"]),at=new Set(["--pm-path","--path","--author"]),fs={get:new Set(["--depth","--fields","--tree-depth","--tree_depth","--at","--format"]),history:new Set(["--limit","--field","--format"]),restore:new Set(["--message"]),update:new Set(["--title","-t","--description","-d","--body","-b","--status","-s","--close-reason","--close_reason","--priority","-p","--type","--tags","--add-tags","--add_tags","--remove-tags","--remove_tags","--deadline","--estimated-minutes","--estimate","--estimated_minutes","--acceptance-criteria","--ac","--acceptance_criteria","--definition-of-ready","--definition_of_ready","--order","--rank","--goal","--objective","--value","--impact","--outcome","--why-now","--why_now","--message","--assignee","--parent","--reviewer","--risk","--confidence","--sprint","--release","--blocked-by","--blocked_by","--blocked-reason","--blocked_reason","--unblock-note","--unblock_note","--reporter","--severity","--environment","--repro-steps","--repro_steps","--resolution","--expected-result","--expected_result","--expected","--actual-result","--actual_result","--actual","--affected-version","--affected_version","--fixed-version","--fixed_version","--component","--regression","--customer-impact","--customer_impact","--dep","--dep-remove","--dep_remove","--comment","--note","--learning","--file","--test","--doc","--reminder","--event","--type-option","--type_option","--field","--unset","--body-file"]),close:new Set(["--reason","-r","--close-reason","--duplicate-of","-d","--message","-m","--validate-close","--resolution","--expected-result","--expected_result","--expected","--actual-result","--actual_result","--actual"]),delete:new Set(["--message"]),append:new Set(["--body","--text","--message"]),claim:new Set(["--assignee","--message","--type","--tag","--priority","--assignee-filter","--parent","--sprint","--release","--max-attempts"]),release:new Set(["--assignee","--message"]),comments:new Set(["--add","--body","--comment","--file","--edit","--delete","--limit","--message"]),notes:new Set(["--add","--file","--edit","--delete","--limit","--message"]),learnings:new Set(["--add","--file","--edit","--delete","--limit","--message"]),files:new Set(["--add","--add-glob","--remove","--migrate","--note","--message"]),docs:new Set(["--add","--add-glob","--remove","--migrate","--note","--message"]),deps:new Set(["--format","--max-depth","--collapse","--node-limit","--edge-limit","--token-budget","--cursor","--direction","--kind"]),test:new Set(["--add","--add-json","--remove","--match","--only-index","--timeout","--env-set","--env-clear","--pm-context","--message"])},ps=new Set(["-p","--package"]),_s=new Set(["-c","--call"]),hs=new Set(["-c","-C","--config","--dir","--filter","--workspace-dir"]),gs=new Set(["-C","--prefix","--userconfig","--cache"]),Mc=new Set(["--cwd"]),Oc=new Set(["--cwd"]),ys=new Set(["exec","x"]),Nc=new Set(["run","run-script"]),jc=new Set(["-C","--dir","--cwd","-w","--workspace","--filter"]);function ws(e){return e.split(/&&|\|\||\||;/).map(t=>t.trim()).filter(t=>t.length>0)}function ks(e){let t=vs(e.split(" ").filter(s=>s.length>0));if(t.length===0)return null;let[n,...i]=t;if(Zn(n)||Qn(n))return i;if(n==="node"&&i[0]&&Qn(i[0]))return i.slice(1);let r=n==="npx"||n==="bunx"?ct(i):n==="pnpm"?Ss(i):n==="npm"?Is(i):null;return r&&(Zn(r.command)||Es(r.command))?r.args:null}var ei=(e,t="pm")=>{let n=t.trim().toLowerCase(),i=n.length;for(;i>0&&n[i-1]==="-";)i-=1;let r=n.slice(0,i);if(r.length===0)return[];let s=e.trim().replaceAll("\\","/").replaceAll('"',"").replaceAll("'","").replaceAll(/\s+/g," ").toLowerCase(),o=new Set;for(let a of ws(s)){let c=ks(a),l=c?Rs(c):null,d=l&&ms.has(l.subcommand)?xs(l.remaining,fs[l.subcommand]):void 0,u=d?.trim().toLowerCase();u?.startsWith(`${r}-`)===!0&&u.length>r.length+1&&o.add(d)}return[...o].sort((a,c)=>a.localeCompare(c))};function vs(e){let t=0;for(e[t]==="env"&&(t+=1);t<e.length;){let n=e[t];if(/^(?:[a-z_][a-z0-9_]*|\$env:[a-z_][a-z0-9_]*)=.*/.test(n)){t+=1;continue}break}return e.slice(t)}function Uc(e){let t=0;for(;t<e.length;){let n=e[t];if(n==="--"){t+=1;continue}if(n.startsWith("-")){if(at.has(n)){t+=2;continue}t+=1;continue}return n}}function Zn(e){return e==="pm"||e==="pm.cmd"||e==="pm.exe"||e.endsWith("/pm")||e.endsWith("/pm.cmd")||e.endsWith("/pm.exe")}function bs(e){let t=e.trim();if(!t.startsWith("@")){let r=t.indexOf("@");return r===-1?t:t.slice(0,r)}let n=t.indexOf("/");if(n===-1)return t;let i=t.indexOf("@",n+1);return i===-1?t:t.slice(0,i)}function Es(e){let t=bs(e);return t==="pm-cli"||t.endsWith("/pm-cli")||e==="pm-cli"||e.endsWith("/pm-cli")}function Qn(e){return e==="dist/cli.js"||e==="./dist/cli.js"||e.endsWith("/dist/cli.js")}function ct(e){let t=0;for(;t<e.length;){let i=e[t];if(i==="--"){t+=1;break}if(!i.startsWith("-"))break;let r=/^(?:-c|--call)=(.*)$/.exec(i);if(r){let s=r[1];return s?{command:s,args:e.slice(t+1)}:null}if(_s.has(i)){t+=1;break}t+=ps.has(i)&&!i.includes("=")?2:1}let n=e[t];return n?{command:n,args:e.slice(t+1)}:null}function ti(e,t){let n=0;for(;n<e.length;){let i=e[n];if(i==="--"){n+=1;continue}if(i.startsWith("-")){if(i.includes("=")){n+=1;continue}if(t.has(i)){n+=2;continue}n+=1;continue}return{subcommand:i,args:e.slice(n+1)}}return null}function Ss(e){let t=ti(e,hs);return t?.subcommand!=="dlx"?null:ct(t.args)}function Is(e){let t=ti(e,gs);return!t||!ys.has(t.subcommand)?null:ct(t.args)}function Rs(e){let t=0;for(;t<e.length;){let n=e[t];if(n==="--"){t+=1;continue}if(n.startsWith("-")){if(at.has(n)){t+=2;continue}t+=1;continue}return{subcommand:n,remaining:e.slice(t+1)}}return null}function xs(e,t=new Set){for(let n=0;n<e.length;n+=1){let i=e[n];if(i==="--")return e[n+1];if(!i.startsWith("-"))return i;!i.includes("=")&&(at.has(i)||t.has(i))&&(n+=1)}}(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]="f8048210-9e9f-585b-b0df-a34eca521cc3")}catch{}})();var Ps=["src","tests","docs"],Fs=["README.md","PRD.md","CHANGELOG.md","AGENTS.md","CONTRIBUTING.md","SECURITY.md","CODE_OF_CONDUCT.md","LICENSE"],Ls=new Set(["node_modules",".git",".cursor",".agents","dist","coverage"]),$s=["resolution","expected_result","actual_result"],Ds=["default","tracked-all","tracked-all-strict"],ni=["core","strict","custom"],Fe=["off","warn","error"];var dt=["author","acceptance_criteria","estimated_minutes","close_reason"],ai=[...dt,"reviewer","risk","confidence","sprint","release"],pt=Array.from(new Set(ai)),Ms={author:"author",acceptance_criteria:"acceptance_criteria","acceptance-criteria":"acceptance_criteria",estimated_minutes:"estimated_minutes","estimated-minutes":"estimated_minutes",estimate:"estimated_minutes",close_reason:"close_reason","close-reason":"close_reason",reviewer:"reviewer",risk:"risk",confidence:"confidence",sprint:"sprint",release:"release"},Os={author:"validate_metadata_missing_author",acceptance_criteria:"validate_metadata_missing_acceptance_criteria",estimated_minutes:"validate_metadata_missing_estimate",close_reason:"validate_metadata_missing_close_reason",reviewer:"validate_metadata_missing_reviewer",risk:"validate_metadata_missing_risk",confidence:"validate_metadata_missing_confidence",sprint:"validate_metadata_missing_sprint",release:"validate_metadata_missing_release"},Ns={author:"missing_author",acceptance_criteria:"missing_acceptance_criteria",estimated_minutes:"missing_estimated_minutes",close_reason:"closed_missing_close_reason",reviewer:"missing_reviewer",risk:"missing_risk",confidence:"missing_confidence",sprint:"missing_sprint",release:"missing_release"},js={author:"missing_author_item_ids",acceptance_criteria:"missing_acceptance_criteria_item_ids",estimated_minutes:"missing_estimated_minutes_item_ids",close_reason:"closed_missing_close_reason_item_ids",reviewer:"missing_reviewer_item_ids",risk:"missing_risk_item_ids",confidence:"missing_confidence_item_ids",sprint:"missing_sprint_item_ids",release:"missing_release_item_ids"},Us={author:"missing_author_truncated",acceptance_criteria:"missing_acceptance_criteria_truncated",estimated_minutes:"missing_estimated_minutes_truncated",close_reason:"closed_missing_close_reason_truncated",reviewer:"missing_reviewer_truncated",risk:"missing_risk_truncated",confidence:"missing_confidence_truncated",sprint:"missing_sprint_truncated",release:"missing_release_truncated"},zs=32*1024*1024,Bs=1e4,ci=40,K=5,Gs=4096,Ws=255,qs=Ts(As);function li(e){let t={};for(let[n,i]of Object.entries(e))Array.isArray(i)||(t[n]=typeof i=="object"&&i!==null?li(i):i);return t}function Hs(e){return{...e,checks:e.checks.map(t=>({...t,details:li(t.details)})),...e.fixes?{fixes:{mode:e.fixes.mode,auto_fix:e.fixes.auto_fix,prune_missing:e.fixes.prune_missing,planned_count:e.fixes.planned_count,applied_count:e.fixes.applied_count,gated_count:e.fixes.gated_count,failed_count:e.fixes.failed_count}}:{}}}function ee(e){return e.replaceAll("\\","/").replace(/^\.\/+/,"").replace(/^\/+/,"")}function ii(e){return ee(e).replace(/\/+$/,"")}function N(e){let t=P(e);if(!t)return;let n=t.toLowerCase();if(!(n==="none"||n==="null"||n==="n/a"||n==="na"))return t}function $e(e,t){return Dt(e,t)??e}function ye(e,t){return t.terminal_statuses.has($e(e,t))}function J(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Pe(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Ks(e){let t=J(kt),n={blocked_reason:J(we.blocked_reason),resolution:J(we.resolution),actual_result:J(we.actual_result)},i=J(e.validation.lifecycle_stale_blocker_reason_patterns),r={blocked_reason:J(e.validation.lifecycle_closure_like_blocked_reason_patterns),resolution:J(e.validation.lifecycle_closure_like_resolution_patterns),actual_result:J(e.validation.lifecycle_closure_like_actual_result_patterns)};return{stale_blocker_reason_patterns:i,stale_blocker_reason_pattern_source:Pe(i,t)?"default":"settings",closure_like_metadata_field_patterns:r,closure_like_metadata_field_pattern_sources:{blocked_reason:Pe(r.blocked_reason,n.blocked_reason)?"default":"settings",resolution:Pe(r.resolution,n.resolution)?"default":"settings",actual_result:Pe(r.actual_result,n.actual_result)?"default":"settings"}}}function di(e){let t=e?.trim().toLowerCase();if(!t||t.length===0)return"core";if(ni.includes(t))return t;throw new y(`Unknown --metadata-profile value "${e}". Supported values: ${ni.join(", ")}.`,g.USAGE)}function ui(e){let t=e?.trim().toLowerCase();if(!t||t.length===0)return"warn";if(Fe.includes(t))return t;throw new y(`Unknown --dependency-cycle-severity value "${e}". Supported values: ${Fe.join(", ")}.`,g.USAGE)}function mi(e){let t=e?.trim().toLowerCase();if(!t||t.length===0)return"warn";if(Fe.includes(t))return t;throw new y(`Unknown --parent-cycle-severity value "${e}". Supported values: ${Fe.join(", ")}.`,g.USAGE)}function Vs(e){return[...new Set((e??[]).map(n=>n.trim().toLowerCase().replaceAll("-","_")))].map(n=>Ms[n]).filter(n=>n!==void 0).sort((n,i)=>n.localeCompare(i))}function Ys(e,t,n){let i=Vs(n);return e==="core"?{profile:e,profile_source:t,required_fields:[...dt],configured_custom_fields:i,fallback_to_core:!1,warnings:[]}:e==="strict"?{profile:e,profile_source:t,required_fields:[...ai],configured_custom_fields:i,fallback_to_core:!1,warnings:[]}:i.length>0?{profile:e,profile_source:t,required_fields:i,configured_custom_fields:i,fallback_to_core:!1,warnings:[]}:{profile:e,profile_source:t,required_fields:[...dt],configured_custom_fields:i,fallback_to_core:!0,warnings:["validate_metadata_custom_profile_missing_required_fields:0"]}}var Js=new Set(["acceptance_criteria","estimated_minutes"]);function fi(e,t,n,i){return!i&&Js.has(t)&&ye(e.status,n)?!1:t==="author"?!P(e.author):t==="acceptance_criteria"?!P(e.acceptance_criteria):t==="estimated_minutes"?!Number.isFinite(e.estimated_minutes):t==="close_reason"?$e(e.status,n)===n.close_status&&!P(e.close_reason):t==="reviewer"?!P(e.reviewer):t==="risk"?!P(e.risk):t==="confidence"?typeof e.confidence=="number"?!Number.isFinite(e.confidence):!P(e.confidence):t==="sprint"?!P(e.sprint):!P(e.release)}function pi(e){if(e===void 0)return"default";let t=e.trim().toLowerCase();if(t.length===0||t==="default")return"default";if(t==="tracked-all"||t==="tracked_all")return"tracked-all";if(t==="tracked-all-strict"||t==="tracked_all_strict")return"tracked-all-strict";throw new y(`Unknown --scan-mode value "${e}". Supported values: ${Ds.join(", ")}.`,g.USAGE)}function _i(e){let t=process.env.PM_SOURCE_WORKSPACE_ROOT?.trim();if(t)return F.resolve(t);let n=F.resolve(e);if(n.replaceAll("\\","/").endsWith("/.agents/pm"))return F.dirname(F.dirname(n));let r=F.resolve(process.cwd()),s=ri(n),o=ri(r),a=F.relative(s,o);return a.length===0||!a.startsWith("..")&&!F.isAbsolute(a)?n:r}function ri(e){try{return Cs.native(e)}catch{return F.resolve(e)}}function hi(e,t){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"&&t.includes(e.code)}async function _t(e,t,n){let i=t.length>0?F.join(e,t):e,r;try{r=await ft.readdir(i,{withFileTypes:!0})}catch(s){if(hi(s,["ENOENT"]))return;throw s}for(let s of r){if(s.name.startsWith("."))continue;let o=t.length>0?F.join(t,s.name):s.name;if(s.isDirectory()){if(Ls.has(s.name))continue;await _t(e,o,n);continue}s.isFile()&&n.push(ee(o))}}async function ut(e){let t=[];for(let n of Ps)await _t(e,n,t);for(let n of Fs){let i=F.join(e,n);try{(await ft.stat(i)).isFile()&&t.push(ee(n))}catch{}}return[...new Set(t)].sort((n,i)=>n.localeCompare(i))}async function gi(e){try{let{stdout:t}=await qs("git",["ls-files","-z"],{cwd:e,encoding:"utf8",maxBuffer:zs,windowsHide:!0,timeout:Bs}),n=t.split("\0").map(i=>ee(i)).filter(i=>i.length>0);return[...new Set(n)].sort((i,r)=>i.localeCompare(r))}catch{return null}}function Xs(e,t){let n=new Set,i=ii(wt);i.length>0&&n.add(i);let r=ii(F.relative(t,e));return r.length>0&&!r.startsWith("..")&&n.add(r),[...n].sort((s,o)=>s.localeCompare(o))}function si(e,t){for(let n of t)if(e===n||e.startsWith(`${n}/`))return!0;return!1}async function Zs(e,t){if(t==="tracked-all"||t==="tracked-all-strict"){let i=await gi(e);if(i)return{requestedMode:t,appliedMode:t,source:"tracked-git",candidateFiles:i,candidateTotal:i.length,candidateScanned:i.length};let r=await ut(e);return{requestedMode:t,appliedMode:"default",source:"tracked-all-fallback-default",candidateFiles:r,candidateTotal:r.length,candidateScanned:r.length}}let n=await ut(e);return{requestedMode:t,appliedMode:"default",source:"default-curated",candidateFiles:n,candidateTotal:n.length,candidateScanned:n.length}}function C(e,t=K){return e.length<=t?{values:e,truncated:!1}:{values:e.slice(0,t),truncated:!0}}function X(e,t){if(t)return{values:e,truncated:!1,total:e.length};let n=C(e,ci);return{values:n.values,truncated:n.truncated,total:e.length}}var Qs={resolution:"--resolution",expected_result:"--expected-result",actual_result:"--actual-result"},eo={resolution:"Describe how this item was resolved",expected_result:"Describe the expected result",actual_result:"Describe the actual result"};function to(e){let t=e.missing_fields.map(n=>`${Qs[n]} "${eo[n]}"`).join(" ");return`pm update ${e.id} ${t} --message "Backfill resolution metadata"`}function yi(e,t){let n=e.details?.missing_resolution_remediation_hints,i=Array.isArray(n)&&n.length>0,r=i?n.filter(o=>typeof o=="string"):hn(t);if(r.length===0)return;let s=i&&e.details?.missing_resolution_remediation_hints_truncated===!0;e.details={...e.details,fix_hints:r,...s?{fix_hints_truncated:!0}:{}}}function wi(e){let t=new Set;return e.checkMetadata&&t.add("metadata"),e.checkResolution&&t.add("resolution"),(e.checkLifecycle||e.checkStaleBlockers)&&t.add("lifecycle"),e.checkFiles&&t.add("files"),e.checkHistoryDrift&&t.add("history_drift"),e.checkCommandReferences&&t.add("command_references"),e.checkStorageIntegrity&&t.add("storage_integrity"),t.size===0?(e.autoFix&&(t.add("metadata"),t.add("resolution"),t.add("lifecycle")),e.pruneMissing&&t.add("files"),t.size===0&&(t.add("metadata"),t.add("resolution"),t.add("lifecycle"),t.add("files"),t.add("command_references"),t.add("history_drift"),t.add("format_version"),t.add("storage_integrity")),t):(e.pruneMissing&&t.add("files"),t)}var no="validate_metadata_duplicate_issue_codes";function ki(e,t){if(e.length===0)return{rows:[],truncated:!1,warnings:[]};let n=t?e.length:K,i=e.slice(0,n);return{rows:i.map(s=>({code:s.code,count:s.count,ids:s.ids,titles:s.titles,remediation_hint:`Items ${s.ids.join(", ")} share issue code "${s.code}"; rename or merge so each logical code maps to one item.`})),truncated:i.length<e.length,warnings:[`${no}:${e.length}`]}}function io(){return Object.fromEntries(pt.map(e=>[e,[]]))}function ro(e,t,n){let i=io();for(let r of e)for(let s of pt)fi(r,s,t,n)&&i[s].push(r.id);return i}function so(e,t,n){let i=[...e.warnings];for(let r of e.required_fields){let s=t[r];s.length>0&&i.push(`${Os[r]}:${s.length}`)}return i.push(...n),i}function vi(e,t){let n={};for(let i of e.required_fields){let r=t[i],s=r?r.length:0,o=Ns[i];s>0&&o&&(n[o]=s)}return n}function bi(e,t,n){let i=[];for(let r of e.required_fields){let s=t[r];if(s)for(let o of s){let a=n.get(o)?.type,c=typeof a=="string"&&a.length>0?a:"Unknown";i.push({item_type:c,field:r})}}return i}function oo(e,t,n,i){for(let r of t.required_fields){let s=n[r];if(!s||s.length===0)continue;let o=js[r],a=Us[r];if(!o||!a)continue;let c=C(s,i?s.length:K);e[o]=c.values,e[a]=c.truncated}}function Ei(e,t,n){if(!e.required_fields.includes("close_reason"))return[];let i=t.close_reason;return i?i.map(r=>({id:r,resolution:P(n.get(r)?.resolution)})):[]}function Si(e,t,n){if(!e.required_fields.includes("estimated_minutes"))return[];let i=t.estimated_minutes;return i?i.map(r=>({id:r,type:P(n.get(r)?.type)})):[]}function ao(e,t,n,i){let r=new Map(e.map(_=>[_.id,_])),s=t.profile==="strict",o=ro(e,n,s),a=$n(e),c=ki(a,i),l=so(t,o,c.warnings),d=vi(t,o),u=bi(t,o,r),m=Dn(u),f={checked_items:e.length,metadata_profile:t.profile,metadata_profile_source:t.profile_source,metadata_profile_fallback_to_core:t.fallback_to_core,required_fields:[...t.required_fields],supported_required_fields:[...pt],counts:d,missing_by_type:m,duplicate_issue_codes_count:a.length,duplicate_issue_codes:c.rows,duplicate_issue_codes_truncated:c.truncated};t.configured_custom_fields.length>0&&(f.configured_custom_required_fields=[...t.configured_custom_fields]),oo(f,t,o,i);let w=Ei(t,o,r),p=Si(t,o,r);return{check:{name:"metadata",status:l.length===0?"ok":"warn",details:f},warnings:l,closeReasonBackfillRows:w,estimateBackfillRows:p}}function co(e,t,n){let i=new Set(t.terminal_done_statuses);i.add(t.close_status);let r=e.filter(m=>i.has($e(m.status,t))),s=[],o=[];for(let m of r){let f=$s.filter(w=>!P(m[w]));f.length!==0&&(s.push({id:m.id,missing_fields:f}),o.push({id:m.id,missing_fields:f,close_reason:P(m.close_reason)}))}let a=s.length>0?[`validate_resolution_missing_fields:${s.length}`]:[],c=n?Number.POSITIVE_INFINITY:K,l=C(s.map(m=>`${m.id}:${m.missing_fields.join(",")}`),c),d=s.map(m=>to(m)),u=C(d,c);return{check:{name:"resolution",status:a.length===0?"ok":"warn",details:{checked_closed_items:r.length,missing_resolution_items:s.length,missing_resolution_rows:l.values,missing_resolution_rows_truncated:l.truncated,missing_resolution_remediation_hints:u.values,missing_resolution_remediation_hints_truncated:u.truncated}},warnings:a,resolutionBackfillRows:o}}function Ii(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ri(e,t="pm",n=Ne()){let i=new Set(e.map(s=>s.id)),r=[...e].sort((s,o)=>s.id.localeCompare(o.id));return new Map(r.map(s=>{let o=new Set,a=N(s.blocked_by);a&&i.has(a)&&o.add(a),(s.dependencies??[]).filter(l=>{let d=N(l.kind);return d!==void 0&&n.resolve(d)?.ordering===!0}).map(l=>N(l.id)).filter(l=>l!==void 0&&i.has(l)).forEach(l=>o.add(l));let c=N(s.definition_of_ready);return Ci(c??"",t).filter(l=>i.has(l)).forEach(l=>o.add(l)),[s.id,[...o].sort((l,d)=>l.localeCompare(d))]}))}function xi(e,t,n){let i=Jt(e,n?d=>ye(d,n):void 0),r=i.active.map(d=>`${d.holder_id}:${d.target_id}:${d.kind}`),s=i.legacy_terminal.map(d=>`${d.holder_id}:${d.target_id}:${d.kind}:${d.holder_status}`),o=t?Number.POSITIVE_INFINITY:K,a=C(r,o),c=C(s,o),l=C(i.active.map(d=>d.source==="parent"?`pm update ${d.holder_id} --unset parent`:d.source==="blocked_by"?`pm update ${d.holder_id} --unset blocked_by`:`pm update ${d.holder_id} --replace-deps '<correct dependency edges>'`),o);return{check:{name:"dependency_references",status:r.length===0?"ok":"warn",details:{checked_items:e.length,dangling_reference_count:r.length+s.length,active_dangling_reference_count:r.length,dangling_reference_rows:a.values,dangling_reference_rows_truncated:a.truncated,legacy_terminal_dangling_reference_count:s.length,legacy_closed_dangling_reference_count:i.legacy_terminal.filter(d=>d.holder_status==="closed").length,legacy_terminal_dangling_reference_rows:c.values,legacy_terminal_dangling_reference_rows_truncated:c.truncated,no_active_blocker_sentinel_count:i.no_active_blocker_sentinels.length,remediation_hints:l.values,remediation_hints_truncated:l.truncated}},warnings:r.length>0?[`validate_dangling_dependency_references:${r.length}`]:[]}}function Ci(e,t="pm"){let n=(t.trim().toLowerCase()||"pm").replace(/-+$/g,""),i=new RegExp(`(?:^|[^a-z0-9-])(${Ii(n)}-[a-z0-9][a-z0-9-]*)`,"gi");return[...new Set([...e.matchAll(i)].map(r=>r[1].toLowerCase()))].sort((r,s)=>r.localeCompare(s))}function ht(e){let t=0,n=new Map,i=new Map,r=[],s=new Set,o=[],a=d=>{n.set(d,t),i.set(d,t),t+=1,r.push(d),s.add(d);for(let m of e.get(d)??[])n.has(m)?s.has(m)&&i.set(d,Math.min(i.get(d),n.get(m))):(a(m),i.set(d,Math.min(i.get(d),i.get(m))));if(i.get(d)!==n.get(d))return;let u=[];for(;r.length>0;){let m=r.pop();if(s.delete(m),u.push(m),m===d)break}u.sort((m,f)=>m.localeCompare(f)),o.push(u)},c=[...e.keys()].sort((d,u)=>d.localeCompare(u));for(let d of c)n.has(d)||a(d);return o.filter(d=>{if(d.length>1)return!0;let u=d[0];return(e.get(u)??[]).includes(u)}).sort((d,u)=>d[0].localeCompare(u[0])||d.length-u.length||d.join(",").localeCompare(u.join(",")))}function gt(e,t){let n=e[0];if(e.length===1)return[n,n];let i=new Set(e),r=[n],s=new Set([n]),o=a=>{let c=(t.get(a)??[]).filter(l=>i.has(l));for(let l of c){if(l===n&&r.length>1)return r.push(n),!0;if(!s.has(l)){if(s.add(l),r.push(l),o(l))return!0;r.pop(),s.delete(l)}}return!1};return o(n)?[...r]:[...e,n]}function Ai(e,t="pm"){let n=Ri(e,t),i=ht(n),r=[...new Set(i.flat())].sort((o,a)=>o.localeCompare(a)),s=i.map(o=>gt(o,n).join("->"));return{cycle_count:i.length,cycle_item_ids:r,cycle_sample_paths:s}}function Ti(e,t=Ne()){let n=new Map(e.map(s=>[s.id.toLowerCase(),s.id])),i=new Map(e.map(s=>[s.id,[]]));return[...e].sort((s,o)=>s.id.localeCompare(o.id)).forEach(s=>{let o=i.get(s.id),a=N(s.parent),c=a?n.get(a.toLowerCase()):void 0;c&&o.push(c),(s.dependencies??[]).forEach(l=>{let d=t.resolve(l.kind);if(!d?.hierarchy)return;let u=n.get(l.id.toLowerCase());u&&(d.hierarchyDirection==="source_parent"?i.get(u).push(s.id):o.push(u))})}),i.forEach((s,o)=>{i.set(o,[...new Set(s)].sort((a,c)=>a.localeCompare(c)))}),i}function Pi(e){let t=Ti(e),n=ht(t),i=[...new Set(n.flat())].sort((s,o)=>s.localeCompare(o)),r=n.map(s=>gt(s,t).join("->"));return{cycle_count:n.length,cycle_item_ids:i,cycle_sample_paths:r}}function Fi(e){return e.startsWith("docs/")?"docs_unowned":e.startsWith("tests/")?"tests_unowned":e.startsWith("src/")?"source_unowned":e.endsWith(".md")?"docs_unowned":"unlinked_existing"}function Le(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function Li(e,t){let n=Le(e).split("/").filter(Boolean),i=Le(t).split("/").filter(Boolean),r=0;for(;r<n.length&&r<i.length&&n[r]===i[r];)r+=1;return r}function lo(e,t){let n=Le(t),i=Le(e),r=t.endsWith("/")?t:`${t}/`,s=e.startsWith(r),o=n.length>0&&n===i,a=Li(e,t);return!s&&!o&&a===0?null:s?{score:t.length+1e3,confidence:"path_prefix"}:o?{score:a+500,confidence:"same_directory"}:{score:a,confidence:"shared_directory"}}function uo(e,t,n){return e===void 0||n>e.score||n===e.score&&t.id.localeCompare(e.item.id)<0}function mo(e,t,n){let i=t==="docs_unowned"?"docs":"files",r;return n.flatMap(s=>(i==="docs"?s.docs??[]:s.files??[]).map(o=>({item:s,link:o}))).forEach(({item:s,link:o})=>{if(o.scope!=="project")return;let a=ee(o.path);if(a.length===0||a===e)return;let c=lo(e,a);c!==null&&uo(r,s,c.score)&&(r={item:s,score:c.score,confidence:c.confidence})}),r?{id:r.item.id,type:r.item.type,title:r.item.title,status:r.item.status,confidence:r.confidence}:null}function $i(e,t){return e.map(n=>{let i=Fi(n),r=i==="docs_unowned"?"docs":"files",s=mo(n,i,t),o=s?.id??"<id>";return{path:n,classification:i,owner_candidate:s,remediation_hint:`pm ${r} ${o} --add path=${n},scope=project,note="<why this artifact belongs to the item>"`}})}function Di(e){return e.map(t=>`${t.path}:${t.classification} owner_candidate=${t.owner_candidate?.id??"unowned"} hint=${JSON.stringify(t.remediation_hint)}`)}function fo(e,t){return Object.entries(t.closure_like_metadata_field_patterns).filter(([n,i])=>{let r=N(e[n]);return r?i.some(s=>r.toLowerCase().includes(s)):!1}).map(([n])=>n).sort((n,i)=>n.localeCompare(i))}function po(e,t,n,i,r){let s=N(t.parent),o=s?n.get(i.get(s.toLowerCase())??s):void 0;return{id:e.id,parent_id:t.id,grandparent_id:o?.id,grandparent_active:o!==void 0&&!ye(o.status,r)}}function _o(e,t,n,i){let r=N(e.blocked_by),s=N(e.blocked_reason),o=s?.toLowerCase(),a=$e(e.status,n),c=[];return t.has(a)?(!r&&!s&&c.push("blocked_status_missing_blocker_context"),o?.includes("no active blocker")&&c.push("blocked_status_reason_reports_no_active_blocker"),o&&i.stale_blocker_reason_patterns.some(l=>o.includes(l))&&c.push("blocked_status_reason_matches_stale_pattern"),c):(r&&c.push("non_blocked_status_has_blocked_by"),s&&c.push("non_blocked_status_has_blocked_reason"),c)}function ho(e,t,n,i){let r=new Map(e.map(c=>[c.id,c])),s=new Map(e.map(c=>[c.id.toLowerCase(),c.id])),o=n.blocked_statuses.size>0?n.blocked_statuses:new Set(["blocked"]),a={activeItems:e.filter(c=>!ye(c.status,n)),closureLikeRows:[],terminalParentRows:[],terminalParentFixRows:[],staleBlockerRows:[]};for(let c of a.activeItems){let l=fo(c,i);l.length>0&&a.closureLikeRows.push({id:c.id,fields:l});let d=N(c.parent),u=d?r.get(s.get(d.toLowerCase())??d):void 0;if(u&&ye(u.status,n)&&(a.terminalParentRows.push({id:c.id,parent_id:u.id,parent_status:u.status}),a.terminalParentFixRows.push(po(c,u,r,s,n))),t){let m=_o(c,o,n,i);m.length>0&&a.staleBlockerRows.push({id:c.id,status:c.status,reasons:[...new Set(m)].sort((f,w)=>f.localeCompare(w))})}}return a}function go(e){e.closureLikeRows.sort((t,n)=>t.id.localeCompare(n.id)),e.terminalParentRows.sort((t,n)=>t.id.localeCompare(n.id)||t.parent_id.localeCompare(n.parent_id)),e.terminalParentFixRows.sort((t,n)=>t.id.localeCompare(n.id)||t.parent_id.localeCompare(n.parent_id)),e.staleBlockerRows.sort((t,n)=>t.id.localeCompare(n.id))}function oi(e,t,n){return n<=0||t==="off"?null:`${t==="error"?`${e}_error`:e}:${n}`}function yo(e,t,n,i,r,s){let o=[];e.closureLikeRows.length>0&&o.push(`validate_lifecycle_active_closure_like_metadata:${e.closureLikeRows.length}`),e.terminalParentRows.length>0&&o.push(`validate_lifecycle_active_terminal_parent:${e.terminalParentRows.length}`),t&&e.staleBlockerRows.length>0&&o.push(`validate_lifecycle_stale_blockers:${e.staleBlockerRows.length}`);let a=oi("validate_lifecycle_dependency_cycles",n,r),c=oi("validate_hierarchy_parent_cycle",i,s);return[...o,...a?[a]:[],...c?[c]:[]]}function Mi(e){let t=ee(e);return t.length>Gs||t.split(/[\\/]/).some(n=>n.length>Ws)}async function wo(e,t){let n=F.isAbsolute(t)?t:F.resolve(e,t);if(Mi(n))return!1;try{let i=await ft.stat(n);return!i.isFile()&&!i.isDirectory()}catch(i){return hi(i,["ENOENT","ENOTDIR"])}}async function ko(e,t){let n={linkedProjectPaths:new Set,remoteLinkedPaths:new Set,missingLinkedPaths:[],staleLinkRows:[]},i=e.flatMap(r=>[...(r.files??[]).map(s=>({item:r,artifact:s,link_kind:"files"})),...(r.docs??[]).map(s=>({item:r,artifact:s,link_kind:"docs"}))]);for(let{item:r,artifact:s,link_kind:o}of i){if(s.scope!=="project")continue;if(ge(s.path)){n.remoteLinkedPaths.add(s.path.trim());continue}let a=ee(s.path);a.length!==0&&(n.linkedProjectPaths.add(a),await wo(t,s.path)&&(n.missingLinkedPaths.push(a),n.staleLinkRows.push({item_id:r.id,path:a,link_kind:o})))}return n}function vo(e,t,n,i,r,s){let o=i==="tracked-all-strict",a=o&&!r,c=r||o,l=c?[]:Xs(t,n),d=l.length===0?[]:e.candidateFiles.filter(f=>si(f,l)),u=l.length===0?e.candidateFiles:e.candidateFiles.filter(f=>!si(f,l)),m={};if(d.length>0){let f=X(d,s);m.pm_internals={count:d.length,paths:f.values,paths_truncated:f.truncated,paths_total:f.total}}return{strictTrackedAllMode:o,strictModeForcesPmInternals:a,includePmInternalsEffective:c,pmInternalCandidatePrefixes:l,excludedPmInternalPaths:d,candidateFiles:u,excludedByReason:m}}function Oi(e,t,n,i,r,s,o,a="pm"){let c=ho(e,t,r,s);go(c);let l=Ai(c.activeItems,a),d=Pi(e),u=yo(c,t,n,i,l.cycle_count,d.cycle_count),m=o?Number.POSITIVE_INFINITY:K,f=C(c.closureLikeRows.map(I=>`${I.id}:${I.fields.join(",")}`),m),w=C(c.terminalParentRows.map(I=>`${I.id}:${I.parent_id}:${I.parent_status}`),m),p=C(c.staleBlockerRows.map(I=>`${I.id}:${I.status}:${I.reasons.join(",")}`),m),_=C(l.cycle_item_ids,m),h=C(l.cycle_sample_paths,m),v=C(d.cycle_item_ids,m),E=C(d.cycle_sample_paths,m);return{check:{name:"lifecycle",status:l.cycle_count>0&&n==="error"||d.cycle_count>0&&i==="error"?"error":u.length===0?"ok":"warn",details:{checked_active_items:c.activeItems.length,active_closure_like_metadata_items:c.closureLikeRows.length,active_closure_like_metadata_rows:f.values,active_closure_like_metadata_rows_truncated:f.truncated,active_terminal_parent_items:c.terminalParentRows.length,active_terminal_parent_rows:w.values,active_terminal_parent_rows_truncated:w.truncated,stale_blocker_checks_enabled:t,stale_blocker_items:c.staleBlockerRows.length,stale_blocker_rows:p.values,stale_blocker_rows_truncated:p.truncated,dependency_cycle_severity_policy:n,dependency_cycle_count:l.cycle_count,dependency_cycle_item_count:l.cycle_item_ids.length,dependency_cycle_item_ids:_.values,dependency_cycle_item_ids_truncated:_.truncated,dependency_cycle_sample_paths:h.values,dependency_cycle_sample_paths_truncated:h.truncated,parent_cycle_severity_policy:i,parent_cycle_count:d.cycle_count,parent_cycle_item_count:d.cycle_item_ids.length,parent_cycle_item_ids:v.values,parent_cycle_item_ids_truncated:v.truncated,parent_cycle_sample_paths:E.values,parent_cycle_sample_paths_truncated:E.truncated,stale_blocker_reason_patterns:[...s.stale_blocker_reason_patterns],stale_blocker_reason_pattern_source:s.stale_blocker_reason_pattern_source,closure_like_blocked_reason_patterns:[...s.closure_like_metadata_field_patterns.blocked_reason],closure_like_blocked_reason_pattern_source:s.closure_like_metadata_field_pattern_sources.blocked_reason,closure_like_resolution_patterns:[...s.closure_like_metadata_field_patterns.resolution],closure_like_resolution_pattern_source:s.closure_like_metadata_field_pattern_sources.resolution,closure_like_actual_result_patterns:[...s.closure_like_metadata_field_patterns.actual_result],closure_like_actual_result_pattern_source:s.closure_like_metadata_field_pattern_sources.actual_result}},warnings:u,terminalParentFixRows:c.terminalParentFixRows}}async function Ni(e,t,n,i,r,s){let o=await ko(e,t),a=new Map(e.map(k=>[k.id,k])),c=[...new Set(o.missingLinkedPaths)].sort((k,R)=>k.localeCompare(R)),l=await Zs(t,i),d=vo(l,n,t,i,r,s),u=d.candidateFiles.filter(k=>!o.linkedProjectPaths.has(k)),m=$i(u,e),f=Nn(c,d.candidateFiles),w=new Map(f.map(k=>[k.path,k.classification])),p=f.filter(k=>k.classification==="moved").length,_=o.staleLinkRows.map(k=>({...k,classification:w.get(k.path)??"deleted"})).sort((k,R)=>k.item_id.localeCompare(R.item_id)||k.path.localeCompare(R.path)||k.link_kind.localeCompare(R.link_kind)),h=[];d.strictModeForcesPmInternals&&h.push("validate_files_tracked_all_strict_forces_pm_internals"),c.length>0&&h.push(`validate_files_missing_linked_paths:${c.length}`),u.length>0&&h.push(`validate_files_orphaned_paths:${u.length}`);let v=[...o.remoteLinkedPaths].sort((k,R)=>k.localeCompare(R)),E=X(v,s),S=X(c,s),I=X(u,s),G=X(m.map(k=>`${k.path}:${k.classification}:owner_candidate=${k.owner_candidate?.id??"unowned"}`),s),j=s?m:X(Di(m),!1).values,b=X(jn(f),s),A=_.map(k=>({item_id:k.item_id,path:k.path,link_kind:k.link_kind,classification:k.classification})),U=zn(A,k=>{let R=a.get(k);return R?{type:R.type,title:R.title,status:R.status}:void 0}),T=s?U:X(Bn(U),!1).values;return{check:{name:"files",status:h.length===0?"ok":"warn",details:{workspace_root:t,scan_mode_requested:l.requestedMode,scan_mode_applied:l.appliedMode,strict_tracked_all_mode:d.strictTrackedAllMode,strict_mode_forces_pm_internals:d.strictModeForcesPmInternals,strict_mode_forces_pm_internals_notice:d.strictModeForcesPmInternals?"tracked-all-strict force-enables PM internals; pass --include-pm-internals to make inclusion explicit.":null,file_list_detail_mode:s?"full":"summary",file_list_summary_limit:ci,candidate_scan_source:l.source,include_pm_internals:d.includePmInternalsEffective,include_pm_internals_requested:r,pm_internal_candidate_prefixes:d.pmInternalCandidatePrefixes,pm_internal_excluded_count:d.excludedPmInternalPaths.length,excluded_total:d.excludedPmInternalPaths.length,excluded_by_reason:d.excludedByReason,linked_project_paths:o.linkedProjectPaths.size,remote_linked_paths_count:v.length,remote_linked_paths_total:E.total,remote_linked_paths:E.values,remote_linked_paths_truncated:E.truncated,candidate_total_raw:l.candidateTotal,candidate_scanned_raw:l.candidateScanned,candidate_total:d.candidateFiles.length,candidate_scanned:d.candidateFiles.length,scanned_candidate_files:d.candidateFiles.length,missing_linked_paths_count:c.length,missing_linked_paths_total:S.total,missing_linked_paths:S.values,missing_linked_paths_truncated:S.truncated,missing_linked_paths_moved_count:p,missing_linked_paths_deleted_count:c.length-p,missing_linked_path_classifications:b.values,missing_linked_path_classifications_truncated:b.truncated,missing_linked_path_rows_count:U.length,missing_linked_path_rows:T,orphaned_paths_count:u.length,orphaned_paths_total:I.total,orphaned_paths:I.values,orphaned_paths_truncated:I.truncated,orphaned_path_classifications:G.values,orphaned_path_classifications_truncated:G.truncated,orphaned_path_rows_count:m.length,orphaned_path_rows:j}},warnings:h,staleLinkPruneRows:_}}async function bo(e,t,n){let{missingStreams:i,unreadableStreams:r,hashMismatches:s,chainMismatches:o,driftedItems:a}=await Sn(e,t),c=[];i.length>0&&c.push(`validate_history_drift_missing_streams:${i.length}`),r.length>0&&c.push(`validate_history_drift_unreadable_streams:${r.length}`),s.length>0&&c.push(`validate_history_drift_hash_mismatches:${s.length}`),o.length>0&&c.push(`validate_history_drift_chain_mismatches:${o.length}`);let l=n?Number.POSITIVE_INFINITY:K,d=C(a,l);return{check:{name:"history_drift",status:c.length===0?"ok":"warn",details:{checked_items:t.length,drifted_items_count:a.length,drifted_items:d.values,drifted_items_truncated:d.truncated,counts:{missing_streams:i.length,unreadable_streams:r.length,hash_mismatches:s.length,chain_mismatches:o.length}}},warnings:c}}function Eo(e,t,n){let i=n.trim().replaceAll(/\s+/g," "),r=i.length>120?`${i.slice(0,117)}...`:i;return`${e}:${t}:${r}`}function ji(e,t,n){let i=new Set(e.map(_=>_.id.toLowerCase())),r=0,s=0,o=new Set,a=[],c=e.flatMap(_=>(_.tests??[]).map(h=>({item:_,linkedTest:h})));for(let{item:_,linkedTest:h}of c){if(typeof h.command!="string"||h.command.trim().length===0)continue;r+=1;let v=ei(h.command,t);if(v.length!==0){s+=v.length;for(let E of v)o.add(E),i.has(E.toLowerCase())||a.push(Eo(_.id,E,h.command))}}let l=[...new Set(a)].sort((_,h)=>_.localeCompare(h)),d=[...new Set(l.map(_=>_.split(":")[1]??""))].filter(_=>_.length>0).sort((_,h)=>_.localeCompare(h)),u=l.length>0?[`validate_command_references_stale_pm_ids:${l.length}`]:[],m=n?Number.POSITIVE_INFINITY:K,f=C(l,m),w=C(d,m),p=C([...o].sort((_,h)=>_.localeCompare(h)),m);return{check:{name:"command_references",status:u.length===0?"ok":"warn",details:{checked_items:e.length,linked_commands_scanned:r,referenced_pm_ids_count:s,unique_referenced_pm_ids_count:o.size,unique_referenced_pm_ids:p.values,unique_referenced_pm_ids_truncated:p.truncated,stale_pm_id_references_count:l.length,stale_pm_ids_count:d.length,stale_pm_ids:w.values,stale_pm_ids_truncated:w.truncated,stale_pm_id_reference_rows:f.values,stale_pm_id_reference_rows_truncated:f.truncated}},warnings:u}}function So(e,t){let n=$t(e.map(c=>({ref:c.id,version:Lt(c)}))),i=[];n.outdated.length>0&&i.push(`validate_format_version_outdated_items:${n.outdated.length}`),n.ahead.length>0&&i.push(`validate_format_version_ahead_items:${n.ahead.length}`);let r=t?Number.POSITIVE_INFINITY:K,s=C(n.outdated,r),o=C(n.ahead,r);return{check:{name:"format_version",status:n.ahead.length>0?"error":n.outdated.length>0?"warn":"ok",details:{checked_items:e.length,current_format_version:Ft,outdated_items_count:n.outdated.length,outdated_items:s.values,outdated_items_truncated:s.truncated,ahead_items_count:n.ahead.length,ahead_items:o.values,ahead_items_truncated:o.truncated}},warnings:i}}var mt="pm validate auto-fix";async function Ui(e,t,n){switch(e.kind){case"set_resolution":case"set_close_reason":case"set_estimate":case"reparent":case"unset_parent":{let i={message:mt};if(e.kind==="set_resolution"?i.resolution=e.value:e.kind==="set_close_reason"?i.closeReason=e.value:e.kind==="set_estimate"?i.estimatedMinutes=e.value:e.kind==="reparent"?i.parent=e.parent_id:i.unset=["parent"],!n.runUpdate)throw new y("Applying validate metadata/lifecycle fixes requires a runUpdate mutation service.",g.USAGE);await n.runUpdate(e.item_id,i,t);return}case"prune_file_link":throw new Error(`Unsupported non-batched fix kind: ${e.kind}`);case"prune_doc_link":throw new Error(`Unsupported non-batched fix kind: ${e.kind}`)}}function lt(e){return e.kind!=="prune_file_link"&&e.kind!=="prune_doc_link"?null:`${e.kind}:${e.item_id}`}async function zi(e,t,n){let i=[],r=[],s=new Map;for(let o of e.filter(a=>lt(a)===null))try{await Ui(o,t,n),i.push(o)}catch(a){r.push({fix:o,error:a})}for(let o of e.filter(a=>lt(a)!==null)){let a=lt(o),c=s.get(a);c?c.push(o):s.set(a,[o])}for(let o of s.values()){let a=o[0];if(!a)continue;let c=o.map(l=>l.path).filter(l=>typeof l=="string"&&l.length>0);try{a.kind==="prune_file_link"?await Jn(a.item_id,{remove:c,message:mt},t):await Vn(a.item_id,{remove:c,message:mt},t),i.push(...o)}catch(l){r.push(...o.map(d=>({fix:d,error:l})))}}return{applied:i,failed:r}}var Rl={applyValidateFix:Ui,applyValidateFixes:zi,attachValidateFixHints:yi,buildCommandReferencesCheck:ji,buildDependencyReferencesCheck:xi,buildCloseReasonBackfillRows:Ei,buildFilesCheck:Ni,buildLifecycleCheck:Oi,buildLifecycleDependencyGraph:Ri,buildLifecycleParentGraph:Ti,buildEstimateBackfillRows:Si,buildMetadataCounts:vi,buildMissingFieldOccurrences:bi,buildOrphanedPathRows:$i,classifyOrphanedPath:Fi,collectDefaultProjectFileCandidates:ut,collectTrackedGitFileCandidates:gi,detectLifecycleDependencyCycles:Ai,detectLifecycleParentCycles:Pi,escapeRegExp:Ii,extractItemIds:Ci,findLifecycleDependencyCycleComponents:ht,isMetadataFieldMissing:fi,linkedArtifactPathExceedsFilesystemLimits:Mi,listFilesRecursive:_t,resolveDependencyCycleSeverity:ui,resolveParentCycleSeverity:mi,resolveFileScanMode:pi,resolveLifecycleDependencyCycleSamplePath:gt,resolveRequestedChecks:wi,resolveValidateMetadataProfile:di,resolveWorkspaceRoot:_i,sharedDirectoryPrefixLength:Li,summarizeOrphanedPathRows:Di,summarizeDuplicateIssueCodes:ki,toMeaningfulString:N};async function Io(e,t,n,i){let r=await _n(e,new Set(t.map(m=>m.id)),n,{schema:i.schema,extensionFieldNames:vt(W())}),s=[];r.unreadable_item_files.length>0&&s.push(`validate_storage_unreadable_items:${r.unreadable_item_files.length}`),r.duplicate_item_ids.length>0&&s.push(`validate_storage_duplicate_item_ids:${r.duplicate_item_ids.length}`),r.history_conflict_marker_streams.length>0&&s.push(`validate_storage_history_conflict_markers:${r.history_conflict_marker_streams.length}`),r.history_unparseable_streams.length>0&&s.push(`validate_storage_unparseable_history:${r.history_unparseable_streams.length}`),r.resurrected_items.length>0&&s.push(`validate_storage_resurrected_items:${r.resurrected_items.length}`),r.unparseable_config_files.length>0&&s.push(`validate_storage_unparseable_config:${r.unparseable_config_files.length}`);let o=s.length,a=await Wn(e);a.tracked_path_count>0&&s.push(`validate_storage_tracked_runtime_cache_files:${a.tracked_path_count}`);let c=await cn(e,Se(i));c.status==="drift"&&s.push(`validate_merge_fence_drift:${c.missing_patterns.length+c.stale_patterns.length}`);let l=await pe(e),d=l===null?null:await ln(l);d!==null&&d.status!=="ok"&&s.push(`validate_merge_driver_configuration:${d.missing_keys.length+d.drifted_keys.length}`);let u=l===null?[]:await Xe(l);return u.length>0&&s.push(`validate_merge_decisions_unreviewed:${u.length}`),{check:{name:"storage_integrity",status:o>0?"error":s.length>0?"warn":"ok",details:{...r,merge_fence:c,merge_driver_configuration:d,pending_merge_decision_count:u.length,pending_merge_decision_items:[...new Set(u.map(m=>m.item_id))].sort((m,f)=>m.localeCompare(f)),tracked_runtime_cache:{tracker_relative_root:a.tracker_relative_root,tracked_paths:a.tracked_paths,tracked_path_count:a.tracked_path_count,remediation_command:a.remediation_command}}},warnings:s}}function H(e,t,n){n&&yi(t.check,t.warnings),e.checks.push(t.check),e.warnings.push(...t.warnings)}async function Ro(e){let t={checks:[],warnings:[...e.initialWarnings],closeReasonBackfillRows:[],estimateBackfillRows:[],resolutionBackfillRows:[],terminalParentFixRows:[],staleLinkPruneRows:[]},n=e.options.fixHints===!0,i=e.options.verboseDiagnostics===!0||e.options.allAffectedIds===!0||e.global.json===!0;if(e.requestedChecks.has("metadata")){let r=ao(e.items,e.metadataPolicy,e.statusRegistry,i);t.closeReasonBackfillRows=r.closeReasonBackfillRows,t.estimateBackfillRows=r.estimateBackfillRows,H(t,r,n)}if(e.requestedChecks.has("resolution")){let r=co(e.items,e.statusRegistry,i);t.resolutionBackfillRows=r.resolutionBackfillRows,H(t,r,n)}if(e.requestedChecks.has("lifecycle")){let r=Oi(e.items,!!e.options.checkStaleBlockers,e.dependencyCycleSeverity,e.parentCycleSeverity,e.statusRegistry,e.lifecyclePatternPolicy,i,e.settings.id_prefix);t.terminalParentFixRows=r.terminalParentFixRows,H(t,r,n),H(t,xi(e.items,i,e.statusRegistry),n)}if(e.requestedChecks.has("files")){let r=await Ni(e.items,e.workspaceRoot,e.pmRoot,e.fileScanMode,!!e.options.includePmInternals,!!e.options.verboseFileLists);t.staleLinkPruneRows=r.staleLinkPruneRows,H(t,r,n)}return e.requestedChecks.has("command_references")&&H(t,ji(e.items,e.settings.id_prefix,i),n),e.requestedChecks.has("history_drift")&&H(t,await bo(e.pmRoot,e.items,i),n),e.requestedChecks.has("format_version")&&H(t,So(e.items,i),n),e.requestedChecks.has("storage_integrity")&&H(t,await Io(e.pmRoot,e.items,z(e.settings,W()).type_to_folder,e.settings),n),t}function xo(e,t,n){let i=[];return e.autoFix===!0&&(i.push(...xn(t.closeReasonBackfillRows)),i.push(...Rn(t.resolutionBackfillRows)),i.push(...Cn(t.estimateBackfillRows,n.validation.estimate_defaults_by_type)),i.push(...An(t.terminalParentFixRows))),e.pruneMissing===!0&&i.push(...Tn(t.staleLinkPruneRows)),i}async function Co(e,t,n,i,r,s){if(e.autoFix!==!0&&e.pruneMissing!==!0)return;let o=xo(e,t,n),{applicable:a,gated:c}=Fn(o,i),l=e.dryRun===!0,d=[],u=[];if(!l){let m=await zi(a,r,s);d.push(...m.applied.map(he)),u.push(...m.failed.map(({fix:f,error:w})=>({...he(f),error:w instanceof Error?w.message:String(w)})))}return{mode:l?"dry_run":"apply",auto_fix:e.autoFix===!0,prune_missing:e.pruneMissing===!0,granted_fix_scopes:[...i].sort((m,f)=>m.localeCompare(f)),planned_count:o.length,applied_count:d.length,gated_count:c.length,failed_count:u.length,planned_fixes:o.map(he),applied_fixes:d,gated_fixes:c.map(m=>({...he(m),gate_hint:`Withheld: re-run with --fix-scope ${m.gate} to apply.`})),failed_fixes:u}}async function xl(e,t,n={}){At(e.counts===!0,e.full===!0,"--counts");let i=e.autoFix===!0||e.pruneMissing===!0;if(e.dryRun===!0&&!i)throw new y("--dry-run requires --auto-fix or --prune-missing (there is nothing to preview otherwise).",g.USAGE);if(e.fixScope!==void 0&&e.fixScope.length>0&&e.autoFix!==!0)throw new y("--fix-scope requires --auto-fix.",g.USAGE);let r=Pn(e.fixScope),s=B(process.cwd(),t.path);if(!await L(O(s)))throw new y(`Tracker is not initialized at ${s}. Run pm init first.`,g.NOT_FOUND);let o=await $(s),a=Ct(o.schema),c=z(o,W()),l=[],d=await Ht(s,o.item_format,c.type_to_folder,l,o.schema),u=wi(e);if(u.has("history_drift")){let A=await Ye(s);A.actionable_unknown_event_count>0&&l.push(`validate_history_unknown_author_events:${A.actionable_unknown_event_count}`)}let m=typeof e.metadataProfile=="string"?"option":"settings",f=di(typeof e.metadataProfile=="string"?e.metadataProfile:o.validation.metadata_profile),w=Ys(f,m,o.validation.metadata_required_fields),p=Ks(o),_=ui(e.dependencyCycleSeverity),h=mi(e.parentCycleSeverity),v=pi(e.scanMode),E=_i(s),S=await Ro({requestedChecks:u,options:e,global:t,pmRoot:s,workspaceRoot:E,settings:o,items:d,statusRegistry:a,metadataPolicy:w,lifecyclePatternPolicy:p,dependencyCycleSeverity:_,parentCycleSeverity:h,fileScanMode:v,initialWarnings:[...new Set(l)]}),I=i?await Co(e,S,o,r,t,n):void 0,G=[...new Set(S.warnings)].sort((A,U)=>A.localeCompare(U)),b={ok:!S.checks.some(A=>A.status==="error"),has_warnings:G.length>0,checks:S.checks,warnings:G,...I!==void 0?{fixes:I}:{},generated_at:V(),projection:{mode:"full",declared_field_groups:[{name:"diagnostic_rows",restore_with:"--full"}],included_field_groups:["diagnostic_rows"]}};return e.counts!==!0?b:{...Hs(b),projection:{mode:"counts",declared_field_groups:[{name:"diagnostic_rows",restore_with:"--full"}],included_field_groups:[]}}}export{Lo as a,Q as b,fe as c,pe as d,Ve as e,Se as f,cn as g,ln as h,Jo as i,Xo as j,Xi as k,Sn as l,pr as m,Zi as n,un as o,ia as p,Ye as q,ra as r,Wn as s,pa as t,_a as u,Xe as v,ha as w,ga as x,_n as y,Vn as z,Jn as A,Lc as B,$c as C,hs as D,gs as E,Mc as F,Oc as G,Nc as H,jc as I,ws as J,ks as K,vs as L,Uc as M,Zn as N,Es as O,Qn as P,ct as Q,ti as R,Ss as S,Is as T,Rs as U,Hs as V,Rl as W,xl as X};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-YHDCGUIW.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as w,j as f,k as B,l as j,m as U,q as y,r as X,s as W,t as Y}from"./chunk-
|
|
1
|
+
import{f as w,j as f,k as B,l as j,m as U,q as y,r as X,s as W,t as Y}from"./chunk-EYO4F74Z.js";import{B as H,a as P,b as D}from"./chunk-LKQXXO62.js";import{c as u,f as M,g as z,i as q,k as g}from"./chunk-XNVXIQ4B.js";import{Ea as F,c as L,f as R}from"./chunk-7YTZ7A4E.js";import{Ea as K,W as k}from"./chunk-EAXXF2HW.js";import{a as N,e as x,f as O,g as A,i as C,l as $}from"./chunk-7AZDTGPA.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]="bb16b445-3bd4-520d-becf-c55621bfa186")}catch{}})();var Ce=N,$e=x,Pe=C,De=O,Le=A;function G(e,t,n,s){let r=e.flag.slice(2).replace(/[-_]([a-z])/gu,(i,a)=>a.toUpperCase()),o=n.has(r);return{long:t,...s?{short:s}:{},description:e.description??`Standard pm ${e.flag} option.`,...e.required===!0?{required:!0}:{},...e.list===!0?{list:!0}:{},...e.repeatable===!0?{repeatable:!0}:{},value_type:o?"string":"boolean",...o?{value_name:e.value_name??"value"}:{}}}function Q(e,t=[]){let n=new Set(t.flatMap(r=>r.keys)),s=[];for(let r of L(e.map(o=>({...o})))){s.push(G(r,r.flag,n,r.short));for(let o of r.aliases??[])s.push(G(r,o,n))}return s}var Re=Q(R,P),Fe=Q(F,D);(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]="bed1d1d4-0c1d-59e5-8267-fbe800dfd83b")}catch{}})();var _=["agile","ops","research"],I={agile:{name:"agile",title:"Agile delivery",summary:"Story/Spike delivery with a review stage, story points, and acceptance ownership.",types:w.agile,statuses:[{id:"review",roles:["active"],aliases:["in-review"],description:"Work is implementation-complete and awaiting peer review."}],fields:[{key:"story_points",type:"number",commands:["create","update","list"],description:"Relative estimation size for a story or spike.",aliases:["points"]},{key:"acceptance_owner",type:"string",commands:["create","update","list"],description:"Stakeholder accountable for accepting the delivered story.",aliases:["acceptor"]}],workflows:[{type:"Story",allowed_transitions:[["open","in_progress"],["in_progress","review"],["review","in_progress"],["review","closed"],["in_progress","blocked"],["blocked","in_progress"]]}],config:[{key:"search_provider",value:"bm25",summary:"Offline BM25 lexical search works without an embedding service."},{key:"search_max_results",value:"20",summary:"Sprint-sized result cap for quick triage."}],templates:[{name:"story",options:{type:"Story",priority:"2",tags:"story",acceptanceCriteria:"Story delivers the stated user outcome with tests and docs updated.",body:`## As a
|
|
2
2
|
|
|
3
3
|
## I want
|
|
4
4
|
|
|
@@ -23,4 +23,4 @@ import{f as w,j as f,k as B,l as j,m as U,q as y,r as X,s as W,t as Y}from"./chu
|
|
|
23
23
|
|
|
24
24
|
## Conclusion
|
|
25
25
|
`}}],packages:[{spec:"search-advanced",reason:"Semantic retrieval over experiments and findings."},{spec:"templates",reason:"Consistent experiment and hypothesis scaffolds."},{spec:"beads",reason:"Import structured prior work into the tracker."}]}};function ne(e){if(e===void 0)return;let t=p(e);if(t.length===0)throw new Error("Profile name must not be empty.");if(_.includes(t))return t;throw new Error(`Invalid profile "${e}". Allowed: ${_.join(", ")}.`)}function qe(e){let t=ne(e);if(t===void 0)throw new Error(`Profile name is required. Allowed: ${_.join(", ")}.`);return I[t]}function Be(){return _.map(e=>I[e])}function p(e){return e.trim().toLowerCase().replaceAll("-","_")}function J(e){return e.map(t=>t.definition.name).join(", ")}function se(e=[]){let t=_.map(o=>({definition:I[o],source:"builtin"})),n=new Set(_.map(o=>p(o))),s=new Set(n),r=[];for(let o of e){let i=p(o.profile.name);if(n.has(i)){r.push(`Extension "${o.name}" profile "${o.profile.name}" uses a name reserved by a built-in archetype and was ignored.`);continue}if(s.has(i)){r.push(`Profile "${o.profile.name}" from extension "${o.name}" duplicates an already-registered profile and was ignored.`);continue}s.add(i),t.push({definition:o.profile,source:"extension",package:o.name})}return{profiles:t,warnings:r}}function je(e,t=[]){let{profiles:n,warnings:s}=se(t);if(typeof e!="string"||e.trim().length===0)throw new Error(`Profile name is required. Allowed: ${J(n)}.`);let r=p(e),o=n.find(i=>p(i.definition.name)===r);if(o===void 0)throw new Error(`Invalid profile "${e}". Allowed: ${J(n)}.`);return{resolved:o,warnings: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]="933d8f74-c4aa-58d0-bd3b-8932a35d3702")}catch{}})();function re(e){return{types:e.types.length,statuses:e.statuses.length,fields:e.fields.length,workflows:e.workflows.length,config:e.config.length,templates:e.templates.length,packages:e.packages.length}}function Ye(e){return{name:e.name,title:e.title,summary:e.summary,composition:re(e),types:e.types.map(t=>S(()=>u(t).name,()=>String(t.name??""))),statuses:e.statuses.map(t=>S(()=>y(t).id,()=>String(t.id??""))),fields:e.fields.map(t=>S(()=>f(t).key,()=>String(t.key??""))),workflows:e.workflows.map(t=>t.type),config:e.config.map(t=>`${t.key}=${t.value}`),templates:e.templates.map(t=>t.name),packages:e.packages.map(t=>({spec:t.spec,reason:t.reason}))}}function S(e,t){try{return e()}catch{return 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]="b4af534e-32f9-5271-b6f1-7d901c282de0")}catch{}})();var oe=[{key:"search_provider",path:"search.provider",kind:"string",summary:"Search embedding provider name (e.g. openai, ollama, or an extension provider)."},{key:"search_mutation_refresh_policy",path:"search.mutation_refresh_policy",kind:"string",choices:["cache_only","semantic_configured","semantic_auto"],summary:"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto."},{key:"search_query_expansion_enabled",path:"search.query_expansion.enabled",kind:"boolean",summary:"Enable or disable query expansion for semantic/hybrid search."},{key:"search_query_expansion_provider",path:"search.query_expansion.provider",kind:"string",summary:"Query expansion provider name (built-in openai/ollama or extension provider)."},{key:"search_rerank_enabled",path:"search.rerank.enabled",kind:"boolean",summary:"Enable or disable post-retrieval reranking for hybrid search."},{key:"search_rerank_model",path:"search.rerank.model",kind:"string",summary:"Rerank model name override used by built-in providers."},{key:"search_rerank_top_k",path:"search.rerank.top_k",kind:"integer",min:1,summary:"Number of top hybrid candidates to rerank when rerank is enabled."},{key:"search_embedding_model",path:"search.embedding_model",kind:"string",summary:"Default embedding model name (overrides provider-specific model when set)."},{key:"search_embedding_corpus_max_characters",path:"search.embedding_corpus_max_characters",kind:"integer",min:1,summary:"Maximum semantic corpus characters per item before truncation."},{key:"search_embedding_batch_size",path:"search.embedding_batch_size",kind:"integer",min:1,summary:"Number of items embedded per request batch."},{key:"search_embedding_timeout_ms",path:"search.embedding_timeout_ms",kind:"integer",min:1,summary:"Per-request embedding timeout in milliseconds."},{key:"search_score_threshold",path:"search.score_threshold",kind:"number",summary:"Minimum score for a hit to be returned (0 keeps all matches)."},{key:"search_hybrid_semantic_weight",path:"search.hybrid_semantic_weight",kind:"ratio",summary:"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword)."},{key:"search_max_results",path:"search.max_results",kind:"integer",min:1,summary:"Default upper bound on search hits when --limit is not supplied."},{key:"search_bm25_k1",path:"search.bm25.k1",kind:"number",min:0,summary:"Offline BM25 term-frequency saturation (k1); higher saturates repeated terms slower (default 1.2)."},{key:"search_bm25_b",path:"search.bm25.b",kind:"ratio",summary:"Offline BM25 document-length normalization (b) in [0, 1]; 0 disables, 1 fully normalizes (default 0.75)."},{key:"openai_base_url",path:"providers.openai.base_url",kind:"string",summary:"OpenAI-compatible API base URL (LM Studio/vLLM also use this)."},{key:"openai_api_key",path:"providers.openai.api_key",kind:"string",summary:"OpenAI-compatible API key."},{key:"openai_model",path:"providers.openai.model",kind:"string",summary:"OpenAI-compatible embedding model name."},{key:"ollama_base_url",path:"providers.ollama.base_url",kind:"string",summary:"Ollama API base URL (typically http://localhost:11434)."},{key:"ollama_model",path:"providers.ollama.model",kind:"string",summary:"Ollama embedding model name (e.g. nomic-embed-text)."},{key:"vector_store_adapter",path:"vector_store.adapter",kind:"string",summary:"Vector store adapter name (lancedb, qdrant, or an extension adapter)."},{key:"vector_store_collection_name",path:"vector_store.collection_name",kind:"string",non_empty:!0,summary:"Vector collection/table name shared by Qdrant and LanceDB adapters."},{key:"qdrant_url",path:"vector_store.qdrant.url",kind:"string",summary:"Qdrant HTTP API URL."},{key:"qdrant_api_key",path:"vector_store.qdrant.api_key",kind:"string",summary:"Qdrant API key (empty if running unauthenticated)."},{key:"lancedb_path",path:"vector_store.lancedb.path",kind:"string",summary:"LanceDB storage path (relative to pm root or absolute)."},{key:"id_prefix",path:"id_prefix",kind:"string",non_empty:!0,summary:'Prefix for generated item IDs (e.g. "pm" produces pm-xxxx).'},{key:"author_default",path:"author_default",kind:"string",non_empty:!0,summary:"Default author recorded on mutations when --author is not supplied."},{key:"mutation_guard_require_attributed_author",path:"mutation_guard.require_attributed_author",kind:"boolean",summary:"Reject mutations whose effective author resolves to unknown."},{key:"mutation_guard_secret_guard",path:"mutation_guard.secret_guard",kind:"string",choices:["off","advise","block"],summary:"Detect credential-shaped mutation content: off, advise, or block."},{key:"mutation_guard_stale_in_progress_hours",path:"mutation_guard.stale_in_progress_hours",kind:"integer",min:1,summary:"Age threshold for unclaimed in-progress work surfaced by health."},{key:"governance_duplicate_detection_mode",path:"governance.duplicate_detection_mode",kind:"string",choices:["off","advisory","strict"],summary:"Create/copy duplicate governance: off, advisory, or strict explicit-bypass enforcement."},{key:"governance_duplicate_detection_threshold",path:"governance.duplicate_detection_threshold",kind:"ratio",summary:"Minimum shared similarity score in [0, 1] for create/copy duplicate governance."},{key:"governance_duplicate_detection_limit",path:"governance.duplicate_detection_limit",kind:"integer",min:0,max:20,summary:"Maximum likely duplicates returned by create/copy governance (0-20)."},{key:"output_default_format",path:"output.default_format",kind:"string",choices:["toon","json"],summary:"Default output format for commands that support it: toon or json."},{key:"locks_ttl_seconds",path:"locks.ttl_seconds",kind:"integer",min:1,summary:"Claim/lock time-to-live in seconds before a stale lock can be reclaimed."},{key:"locks_wait_ms",path:"locks.wait_ms",kind:"integer",min:0,summary:"Bounded jittered wait in milliseconds before a contended item mutation fails with lock_conflict; 0 fails fast. PM_LOCK_WAIT_MS overrides per invocation."},{key:"ids_token_length",path:"ids.token_length",kind:"integer",min:4,max:12,summary:"Random base36 token length for newly minted item ids (4-12, default 4). Raise it to shrink cross-branch id collision odds in concurrent multi-agent workflows (pm-pibw)."},{key:"checkpoints_retention_days",path:"checkpoints.retention_days",kind:"integer",min:1,summary:"Age in days above which pm gc --scope checkpoints prunes bulk-mutation rollback checkpoints."},{key:"schema_unknown_field_policy",path:"schema.unknown_field_policy",kind:"string",choices:["allow","warn","reject"],summary:"How item I/O handles metadata keys not in the field registry: allow, warn, or reject."},{key:"history_compact_policy_enabled",path:"history.compact_policy.enabled",kind:"boolean",summary:"Enable the history-compaction advisory: pm health warns on over-threshold streams."},{key:"history_compact_policy_max_entries",path:"history.compact_policy.max_entries",kind:"integer",min:1,summary:"Entry count above which a history stream is flagged (and the default pm history-compact --all-over threshold)."},{key:"history_compact_policy_trigger",path:"history.compact_policy.trigger",kind:"string",choices:["health_warn","auto"],summary:"History-compaction policy intent: health_warn (advisory only) or auto (scheduled sweeps expected)."}],ie=new Map(oe.flatMap(e=>[[e.key,e],[e.path.toLowerCase().replaceAll("-","_"),e]]));function b(e){if(typeof e!="string")return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length!==0)return ie.get(t)}function ae(e,t){let n=t.trim().toLowerCase();return n==="true"||n==="1"||n==="yes"||n==="on"?{ok:!0,parsed:{descriptor:e,value:!0}}:n==="false"||n==="0"||n==="no"||n==="off"?{ok:!0,parsed:{descriptor:e,value:!1}}:{ok:!1,error:{message:`Config set ${e.key} requires a boolean value (true|false), got "${t}"`}}}function le(e,t,n){return e.non_empty===!0&&n.length===0?{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}}:e.choices&&!e.choices.includes(n)?{ok:!1,error:{message:`Config set ${e.key} must be one of ${e.choices.join("|")}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function de(e,t,n){if(n.length===0)return{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}};let s=Number(n);return Number.isFinite(s)?{ok:!0,value:s}:{ok:!1,error:{message:`Config set ${e.key} requires a finite number, got "${t}"`}}}function ce(e,t,n){return!Number.isInteger(n)||n<0?{ok:!1,error:{message:`Config set ${e.key} requires a non-negative integer, got "${t}"`}}:e.min!==void 0&&n<e.min?{ok:!1,error:{message:`Config set ${e.key} requires an integer >= ${e.min}, got "${t}" (the runtime silently ignores 0 here and falls back to the default)`}}:e.max!==void 0&&n>e.max?{ok:!1,error:{message:`Config set ${e.key} requires an integer <= ${e.max}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function me(e,t,n){return n<0||n>1?{ok:!1,error:{message:`Config set ${e.key} requires a number in [0, 1], got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function pe(e,t,n){return e.min!==void 0&&n<e.min?{ok:!1,error:{message:`Config set ${e.key} requires a number >= ${e.min}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function v(e,t){if(typeof t!="string")return{ok:!1,error:{message:`Config set ${e.key} requires a string value`}};let n=t.trim();if(e.kind==="boolean")return ae(e,t);if(e.kind==="string")return le(e,t,n);let s=de(e,t,n);return s.ok?e.kind==="integer"?ce(e,t,s.value):e.kind==="ratio"?me(e,t,s.value):pe(e,t,s.value):{ok:!1,error:s.error}}function V(e,t){let n=t.path.split("."),s=e;for(let r of n){if(typeof s!="object"||s===null)return null;s=s[r]}return typeof s=="string"||typeof s=="number"||typeof s=="boolean"?s:null}function Ge(e,t,n){let s=t.path.split("."),r=e;for(let a=0;a<s.length-1;a+=1){let c=s[a],d=r[c];if(typeof d!="object"||d===null||Array.isArray(d)){let l={};r[c]=l,r=l}else r=d}let o=s[s.length-1];return r[o]===n?!1:(r[o]=n,!0)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f9b22df0-7ec2-5d72-bc88-3eb7201a6051")}catch{}})();var at=["profile","types","statuses","fields","workflows","config","templates","packages"],lt=["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"],ue=new Set(K.flatMap(e=>[g(e.id),...(e.aliases??[]).map(t=>g(t))]).filter(e=>e.length>0)),Z=new Set($.map(e=>e.toLowerCase()));function fe(e,t){e.name.trim().length===0?t.push({severity:"error",code:"profile_name_empty",dimension:"profile",message:"Profile name must not be empty; profile resolution requires a non-blank name."}):e.name!==p(e.name)&&t.push({severity:"warning",code:"profile_name_not_normalized",dimension:"profile",target:e.name,message:`Profile name "${e.name}" is not in canonical form; resolution folds it to "${p(e.name)}" (lowercase, hyphens as underscores).`}),e.title.trim().length===0&&t.push({severity:"warning",code:"profile_title_empty",dimension:"profile",message:"Profile title is empty; list and show surfaces will render a blank title."}),e.summary.trim().length===0&&t.push({severity:"warning",code:"profile_summary_empty",dimension:"profile",message:"Profile summary is empty; list and show surfaces will render a blank archetype description."})}function ye(e,t){let n=new Set,s=new Set;for(let[r,o]of e.types.entries()){let i;try{i=u(o).name}catch(c){t.push({severity:"error",code:"type_invalid",dimension:"types",target:typeof o.name=="string"?o.name:`#${r}`,message:k(c)});continue}let a=i.toLowerCase();if(s.has(a)){t.push({severity:"error",code:"type_duplicate",dimension:"types",target:i,message:`Item type "${i}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}s.add(a),n.add(a)}return n}function he(e,t){let n=new Set,s=new Set;for(let[r,o]of e.statuses.entries()){let i;try{i=y(o)}catch(a){t.push({severity:"error",code:"status_invalid",dimension:"statuses",target:typeof o.id=="string"?o.id:`#${r}`,message:k(a)});continue}if(s.has(i.id)){t.push({severity:"error",code:"status_duplicate",dimension:"statuses",target:i.id,message:`Status "${i.id}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}s.add(i.id),n.add(i.id);for(let a of i.aliases??[])n.add(g(a))}return n}function ge(e,t){let n=new Set;for(let[s,r]of e.fields.entries()){let o;try{o=f(r).key}catch(a){t.push({severity:"error",code:"field_invalid",dimension:"fields",target:typeof r.key=="string"?r.key:`#${s}`,message:k(a)});continue}if(n.has(o)){t.push({severity:"error",code:"field_duplicate",dimension:"fields",target:o,message:`Field "${o}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}n.add(o);let i=H(o);i&&t.push({severity:"warning",code:"field_mcp_input_collision",dimension:"fields",target:o,message:`Field "${o}" collides with canonical MCP property "${i.property}" owned by ${i.owner}; callers must pass the custom value through ${i.nested_path}.`})}}function _e(e,t,n,s){let r=new Set;for(let[o,i]of e.workflows.entries()){let a=i.type.trim().toLowerCase();if(a.length===0){s.push({severity:"error",code:"workflow_type_empty",dimension:"workflows",target:`#${o}`,message:"Workflow has an empty type; the workflow resolver drops entries without a type."});continue}let c=r.has(a);r.add(a),c?s.push({severity:"warning",code:"workflow_duplicate_type",dimension:"workflows",target:i.type,message:`Workflow type "${i.type}" is declared more than once; the later transition set wins.`}):!Z.has(a)&&!t.has(a)&&s.push({severity:"warning",code:"workflow_type_unknown",dimension:"workflows",target:i.type,message:`Workflow governs type "${i.type}" which is neither a built-in type nor declared by this profile; it has no effect unless that type already exists.`});let d=new Set;for(let l of i.allowed_transitions){let m=g(l[0]),E=g(l[1]);if(m.length===0||E.length===0){s.push({severity:"error",code:"workflow_transition_malformed",dimension:"workflows",target:i.type,message:`Workflow "${i.type}" has a transition with an empty status; the workflow resolver silently drops it.`});continue}for(let h of[m,E])ue.has(h)||n.has(h)||d.has(h)||(d.add(h),s.push({severity:"warning",code:"workflow_status_unknown",dimension:"workflows",target:h,message:`Workflow "${i.type}" references status "${h}" which is neither a built-in status nor declared by this profile; transitions to or from it are unreachable.`}))}}}function ke(e,t){let n=new Set;for(let s of e.config){let r=b(s.key);if(r===void 0){t.push({severity:"error",code:"config_key_unknown",dimension:"config",target:s.key,message:`Config knob "${s.key}" is not a recognized setting; apply rejects it with a usage error.`});continue}n.has(r.key)?t.push({severity:"error",code:"config_duplicate",dimension:"config",target:r.key,message:`Config knob "${r.key}" is set more than once; the later value silently overwrites the earlier one.`}):n.add(r.key);let o=v(r,s.value);o.ok||t.push({severity:"error",code:"config_value_invalid",dimension:"config",target:s.key,message:o.error.message})}}function we(e,t,n){for(let s of e.templates){let r=s.options.type;if(typeof r!="string"||r.trim().length===0)continue;let o=r.trim().toLowerCase();!Z.has(o)&&!t.has(o)&&n.push({severity:"warning",code:"template_type_unknown",dimension:"templates",target:s.name,message:`Template "${s.name}" creates type "${r}" which is neither a built-in type nor declared by this profile.`})}}function be(e,t){for(let[n,s]of e.packages.entries())s.spec.trim().length===0&&t.push({severity:"warning",code:"package_spec_empty",dimension:"packages",target:`#${n}`,message:"Package recommendation has an empty spec; it cannot be surfaced as an install hint."})}function dt(e){let t=[];fe(e,t);let n=ye(e,t),s=he(e,t);ge(e,t),_e(e,n,s,t),ke(e,t),we(e,n,t),be(e,t);let r=t.filter(i=>i.severity==="error").length,o=t.length-r;return{profile:e.name,ok:r===0,findings:t,errorCount:r,warningCount: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]="ead1caea-8e8b-5208-9fba-23fb114044b5")}catch{}})();function T(e,t,n,s,r){let o=e,i=[];for(let a of t){let c=s(o),d=r(o,a),l=s(d.file);o=d.file;let m=c===l?"unchanged":d.replaced?"update":"add";i.push({key:n(a),status:m})}return{file:o,changes:i,changed:i.some(a=>a.status!=="unchanged")}}function ee(e){return JSON.stringify(e.map(t=>t.join("\0")).sort())}function ve(e,t){let n=e.map(r=>({...r})),s=[];for(let r of t){let o=n.findIndex(a=>a.type===r.type),i={type:r.type,allowed_transitions:r.allowed_transitions};o<0?(n.push(i),s.push({type:r.type,status:"add"})):ee(n[o].allowed_transitions)===ee(r.allowed_transitions)?s.push({type:r.type,status:"unchanged"}):(n[o]=i,s.push({type:r.type,status:"update"}))}return{changes:s,result:n,changed:s.some(r=>r.status!=="unchanged")}}function Ie(e,t){let n=[];for(let s of e.config){let r=b(s.key);if(r===void 0)throw new Error(`Profile "${e.name}" references unknown config key "${s.key}".`);let o=v(r,s.value);if(!o.ok)throw new Error(`Profile "${e.name}" config ${s.key}: ${o.error.message}`);let i=V(t,r),a=i===null?"add":i===o.parsed.value?"unchanged":"update";n.push({key:r.key,path:r.path,value:o.parsed.value,status:a})}return{changes:n,changed:n.some(s=>s.status!=="unchanged")}}function te(e){let t=Object.entries(e).sort(([n],[s])=>n.localeCompare(s));return JSON.stringify(t)}function Se(e,t){let n=[];for(let s of e.templates){let r=t.get(s.name),o;r===void 0?o="add":te(r)===te(s.options)?o="unchanged":o="update",n.push({name:s.name,options:s.options,status:o})}return{changes:n,changed:n.some(s=>s.status!=="unchanged")}}function yt(e,t){let n=T(M(t.typesRaw),e.types,l=>u(l).name,q,(l,m)=>z(l,u(m))),s=T(X(t.statusesRaw),e.statuses,l=>y(l).id,W,(l,m)=>Y(l,y(m))),r=T(B(t.fieldsRaw),e.fields,l=>f(l).key,j,(l,m)=>U(l,f(m))),o=ve(t.workflows,e.workflows),i=Ie(e,t.settings),a=Se(e,t.templates),c=e.packages.map(l=>({spec:l.spec,reason:l.reason,status:t.installedPackages.has(l.spec)?"installed":"recommended"})),d=n.changed||s.changed||r.changed||o.changed||i.changed||a.changed;return{profile:{name:e.name,title:e.title,summary:e.summary},types:n,statuses:s,fields:r,workflows:o,config:i,templates:a,packages:c,changed:d}}export{Ce as a,$e as b,Pe as c,De as d,Le as e,Q as f,Re as g,Fe as h,_ as i,I as j,ne as k,qe as l,Be as m,se as n,je as o,re as p,Ye as q,oe as r,b as s,v as t,V as u,Ge as v,at as w,lt as x,dt as y,yt as z};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-YLPZHWX7.js.map
|