@unbrained/pm-cli 2026.8.4 → 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 +53 -13
- package/dist/cli/error-guidance.js +4 -4
- 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/register-structured-mutation.d.ts +2 -0
- package/dist/cli/register-structured-mutation.js +124 -12
- package/dist/cli-bundle/bundle-manifest.json +397 -397
- package/dist/cli-bundle/chunks/append-XAJ5Z4XS.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-QVO3VTA4.js → chunk-343QETLI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q5F6OI7C.js → chunk-3KFVGGRE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6S7I3UKV.js → chunk-3ZJRFYY2.js} +19 -19
- package/dist/cli-bundle/chunks/{chunk-NFF3JAQR.js → chunk-4AVFKHHC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5H47J5FG.js → chunk-4OVGQW22.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D2MBVMVE.js → chunk-5PBP2ZP3.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-5ZKQPA44.js +2 -0
- package/dist/cli-bundle/chunks/chunk-A3XQ7VPU.js +2 -0
- package/dist/cli-bundle/chunks/chunk-AJE3AHPD.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-2POYGY53.js → chunk-AOBDLU4T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PYYPQLHC.js → chunk-AYRUGRNS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QMWUL66F.js → chunk-BP6EMEDP.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-UVZREFZU.js → chunk-C3YABSJK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RB65T4RX.js → chunk-CA3BURYF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KIKLF2W4.js → chunk-D7I3TUGV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PQXEB7W4.js → chunk-DQGJ2RWT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OB7TRZ2G.js → chunk-DWOAOZHZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SVDH5CHC.js → chunk-E7BFPLUZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CGY5I2GO.js → chunk-F4NREH3G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DCJ6CM6F.js → chunk-FDBRXV25.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NM5G7RLU.js → chunk-GU3TSEHD.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-HS7OVAUN.js +164 -0
- package/dist/cli-bundle/chunks/{chunk-CU5ENFNP.js → chunk-JFZIS6JF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GOICHIX4.js → chunk-JQ4NZ5EB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HE3DZFN4.js → chunk-L6LGKJX3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BLINBTMX.js → chunk-M357ZCOR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NRDKVOUE.js → chunk-M4VEE3FK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HTYC76A4.js → chunk-MCS73BKB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BKMZTZYL.js → chunk-MDTH7SAE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-H6FITE7D.js → chunk-NE5VRDAI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NPUJ7OLK.js → chunk-OXY3SJ3N.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-PECV7L5T.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-KH4GVBMC.js → chunk-Q3VOP62W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FQ4EFFDU.js → chunk-QJ7C3JIW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VH2EAGUG.js → chunk-R6LSRGPS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HQ2WU7OY.js → chunk-R6RKEYYW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PA5XRN2A.js → chunk-RAFUN7IX.js} +4 -4
- 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-JMKVCQSE.js → chunk-SV3YQ4RY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-B5ZLCD5Z.js → chunk-SVV3DQES.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J4EPW4GT.js → chunk-SXECIECW.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-T45OHXDW.js +8 -0
- package/dist/cli-bundle/chunks/{chunk-NH35JNK5.js → chunk-TPKDJ5WL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZSH4GNBH.js → chunk-UVVXHGYS.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-V663653R.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-5PZGZMPG.js → chunk-WSI5KZQJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3XZYTRPC.js → chunk-XPOQQJTX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UJHUR3LZ.js → chunk-YCCDXBNU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-ZFBWCKYF.js +2 -0
- 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-RLLCBCXM.js → create-TG67IVFI.js} +2 -2
- package/dist/cli-bundle/chunks/delete-6XKUVVQN.js +2 -0
- package/dist/cli-bundle/chunks/{deps-J4ONTF4X.js → deps-AJUGP2OH.js} +2 -2
- package/dist/cli-bundle/chunks/{docs-YL2DJ4WD.js → docs-QOCLDRKJ.js} +2 -2
- package/dist/cli-bundle/chunks/{files-NGNAIYKK.js → files-3ST5TY64.js} +2 -2
- package/dist/cli-bundle/chunks/focus-R2AWS63Y.js +2 -0
- package/dist/cli-bundle/chunks/{history-compact-HW62K5XP.js → history-compact-7BJFML4S.js} +2 -2
- package/dist/cli-bundle/chunks/{history-redact-HVBKUJOW.js → history-redact-WJN3HYXR.js} +2 -2
- package/dist/cli-bundle/chunks/{history-repair-OPNBH5JJ.js → history-repair-XDNZUB7F.js} +2 -2
- package/dist/cli-bundle/chunks/{learnings-F36PZXT6.js → learnings-SZMUPVNA.js} +2 -2
- package/dist/cli-bundle/chunks/{profile-N3XMWBM7.js → profile-KL53JIAC.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-BKGHBI7Y.js → register-list-query-QH7ONPKU.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-OCRQNZK4.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-HIBJXRGB.js +2 -0
- 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-4PJQMGUY.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-27DK4A5O.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-4JC3AOGS.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-6KDHXURF.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-74CWP3A4.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-7AZDTGPA.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-7YTZ7A4E.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ONIX2KKW.js → chunk-CL3NB7VW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EAXXF2HW.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-L6A4NVQC.js → chunk-EYO4F74Z.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GEYU23YS.js +153 -0
- package/dist/cli-bundle/focused-chunks/{chunk-DQ4PLKEE.js → chunk-GIERI4YU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GSW2Y7VZ.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-WVGJAD7L.js → chunk-LKQXXO62.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UFCPSWIL.js → chunk-MBBMTDD3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OYTK4VNH.js → chunk-ME4XVOBJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-RO5BQFG3.js → chunk-N7QN3NE6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QL5H3AQH.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-TQMFQYXR.js +29 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SQXVGHMH.js → chunk-XNVXIQ4B.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BOGRY7M6.js → chunk-YHDCGUIW.js} +10 -10
- package/dist/cli-bundle/focused-chunks/{chunk-K37BB4JL.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 +28 -28
- 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 +8 -13
- package/dist/core/extensions/preflight-ownership.d.ts +5 -0
- package/dist/core/extensions/preflight-ownership.js +42 -0
- package/dist/core/item/item-format.js +14 -20
- package/dist/core/shared/constants.js +3 -2
- package/dist/core/store/item-store.js +2 -2
- package/dist/core/store/settings.js +2 -2
- package/dist/mcp/server.js +12 -6
- package/dist/mcp/tool-definitions.js +14 -7
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +18 -18
- package/dist/sdk/cli-contracts/agent-output-contracts.js +51 -23
- package/dist/sdk/cli-contracts/commander-mutation-options.js +26 -2
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +4 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +34 -2
- package/dist/sdk/cli-contracts/registration-helpers.js +4 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +10 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +21 -5
- package/dist/sdk/cli-contracts/tool-schema.js +4 -2
- package/dist/sdk/cli-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts.js +4 -4
- package/dist/sdk/cli-program.js +3 -3
- package/dist/sdk/compose.d.ts +2 -2
- package/dist/sdk/compose.js +7 -2
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/define.d.ts +3 -1
- package/dist/sdk/define.js +3 -8
- package/dist/sdk/dependency-provenance.d.ts +2 -0
- package/dist/sdk/dependency-provenance.js +7 -3
- package/dist/sdk/error-code-catalog.d.ts +23 -0
- package/dist/sdk/error-code-catalog.js +25 -5
- 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/generated-error-code-catalog.js +499 -3
- package/dist/sdk/governance/health.js +11 -2
- package/dist/sdk/graph/governance.js +3 -3
- package/dist/sdk/graph/remediation.js +3 -3
- package/dist/sdk/graph/run.js +4 -8
- package/dist/sdk/index.d.ts +7 -2
- package/dist/sdk/index.js +9 -4
- package/dist/sdk/item-transaction.d.ts +51 -6
- package/dist/sdk/item-transaction.js +132 -22
- package/dist/sdk/lifecycle/create.d.ts +4 -0
- package/dist/sdk/lifecycle/create.js +26 -10
- package/dist/sdk/lifecycle-policy.d.ts +9 -0
- package/dist/sdk/lifecycle-policy.js +22 -9
- package/dist/sdk/merge/driver.js +6 -3
- package/dist/sdk/output-contracts.d.ts +67 -0
- package/dist/sdk/output-contracts.js +173 -0
- package/dist/sdk/package-import-adapters.js +2 -2
- 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/dist/sdk/structured-mutations.d.ts +23 -0
- package/dist/sdk/structured-mutations.js +219 -10
- package/dist/sdk/workspace-snapshot.js +58 -12
- package/dist/sdk/workspace.js +30 -4
- package/docs/COMMANDS.md +49 -10
- package/docs/EXTENSIONS.md +3 -3
- package/docs/EXTENSION_LIFECYCLE.md +46 -0
- package/docs/MERGE_SAFETY.md +2 -0
- package/docs/PR_REVIEW_LOOP.md +10 -4
- package/docs/README.md +23 -22
- package/docs/RELEASING.md +36 -23
- package/docs/SCRIPTING.md +32 -9
- package/docs/SDK.md +122 -14
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
- package/docs/TESTING.md +25 -0
- package/docs/examples/sdk-contract-consumer/README.md +11 -1
- package/docs/examples/sdk-contract-consumer/package.json +2 -1
- package/docs/examples/sdk-contract-consumer/parse-receipt.mjs +22 -0
- package/marketplace.json +2 -2
- package/package.json +5 -4
- 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 +508 -32
- package/dist/cli-bundle/chunks/append-DHBRLHHS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2INN52SU.js +0 -8
- package/dist/cli-bundle/chunks/chunk-377OOXUF.js +0 -55
- package/dist/cli-bundle/chunks/chunk-6RSK4IFN.js +0 -20
- package/dist/cli-bundle/chunks/chunk-ASJJKA57.js +0 -2
- package/dist/cli-bundle/chunks/chunk-IYAVULRN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-JDPKBV5P.js +0 -2
- package/dist/cli-bundle/chunks/chunk-RRQBHQOV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-SULWTPQO.js +0 -8
- package/dist/cli-bundle/chunks/chunk-V5K52PYW.js +0 -164
- package/dist/cli-bundle/chunks/chunk-XBLOD5TZ.js +0 -2
- package/dist/cli-bundle/chunks/close-VLHNN6YB.js +0 -2
- package/dist/cli-bundle/chunks/close-many-LSJNZKU6.js +0 -2
- package/dist/cli-bundle/chunks/comments-AAIA6A6X.js +0 -2
- package/dist/cli-bundle/chunks/copy-Z7YMLEHN.js +0 -2
- package/dist/cli-bundle/chunks/delete-KNOHHQJM.js +0 -2
- package/dist/cli-bundle/chunks/focus-LFRCGALV.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-GU3DCECN.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-PTWH727R.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-KWV6UD77.js +0 -2
- package/dist/cli-bundle/chunks/restore-4HZSLILR.js +0 -2
- package/dist/cli-bundle/chunks/update-E6LPS5IV.js +0 -2
- package/dist/cli-bundle/chunks/update-many-OSIC6KRO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2VIIXOAD.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5MTKO7TV.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-6GIZK7VQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-AOP2WIZZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-C2QSL62X.js +0 -28
- package/dist/cli-bundle/focused-chunks/chunk-CL75YW32.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-E7OFMWGT.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-I5F5UK3Q.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QM2BIVK7.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-T5TSY36R.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-VT6BF2IX.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Ca as M,Y as g,Z as h,aa as R,ka as I}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]="23b3a820-f205-506b-9507-dbd60087f62e")}catch{}})();var X=["full","compact","brief","summary","counts"],qe=["mutation","read","discovery","governance"],Y=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),F=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),H=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),V={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},Z=3,ee=2;function te(e){let[t=""]=e.trim().split(/\s+/u);return Y.has(t)?"mutation":F.has(t)?"discovery":H.has(t)?"governance":"read"}function N(e,t=te(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let o=V[t];return ne({command:n,budget_class:t,default_max_estimated_tokens:o,default_max_estimated_tokens_by_format:{toon:o,json:Math.ceil(o*Z/ee)},degradation_ladder:X,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function ne(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var oe=I.map(e=>N(e)),re=new Map(oe.map(e=>[e.command,e]));function ze(e,t={}){let n=e.trim().replace(/\s+/gu," "),[o]=n.split(" "),r=re.get(o);return r?{...r,command:n}:t.generateFallback?N(n):null}function k(e){return Math.ceil(Math.max(0,e)/4)}import{createHash as ie}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="83fe180b-9d95-5d19-9d3b-ba3821700e61")}catch{}})();var C=1,D=4096,se=/^[A-Za-z0-9_-]+$/;function B(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function Xe(e,t){let n=new Set;for(let o of t)if(o.cursor_semantics==="presentation"){n.add(B(o.flag));for(let r of o.aliases??[])n.add(B(r))}return Object.fromEntries(Object.entries(e).filter(([o])=>!n.has(o)))}function Ye(e,t){return ie("sha256").update(e).update("\0").update(R(t)).digest("hex").slice(0,24)}function O(e,t,n,o){return Buffer.from(JSON.stringify({version:C,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...o===void 0?{}:{snapshot:o}})).toString("base64url")}function w(e){return new h(e,g.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function ae(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===C&&typeof t.fingerprint=="string"&&typeof t.after_id=="string"&&t.after_id.length>0&&(t.after_index===void 0||Number.isSafeInteger(t.after_index)&&t.after_index>=0)&&(t.snapshot===void 0||typeof t.snapshot=="string"&&t.snapshot.length>0)}function E(e,t){if(typeof e!="string")throw w("Query cursor is malformed.");let n=e.trim();if(n.length===0||n.length>D||!se.test(n))throw w("Query cursor is malformed.");let o;try{o=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{throw w("Query cursor is malformed.")}if(!ae(o))throw w("Query cursor version or payload is unsupported.");let r=o;if(r.fingerprint!==t)throw w(`Query cursor does not match the current filters, sort, or query (${r.fingerprint} != ${t}).`);return{after_id:r.after_id,...r.after_index===void 0?{}:{after_index:r.after_index},...r.snapshot===void 0?{}:{snapshot:r.snapshot}}}function Fe(e,t){return E(e,t).after_id}function de(e,t,n,o){if(t===void 0)return 0;let r=E(t,n),s=e.findIndex(i=>o(i)===r.after_id);if(s<0){if(r.after_index!==void 0)return Math.min(r.after_index,e.length);throw w(`Query cursor item ${r.after_id} is no longer present in this result set.`)}return s+1}function He(e,t){if(t.cursor!==void 0&&E(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw w("Query cursor does not match the requested snapshot.");let n=de(e,t.cursor,t.fingerprint,t.readId),o=e.slice(n,n+t.limit),r=o.length>0&&n+o.length<e.length,s=o.at(-1);return{rows:o,has_more:r,...r&&s!==void 0?{next_cursor:O(t.fingerprint,t.readId(s),n+o.length-1,t.snapshot)}:{}}}var Ve=Object.freeze({version:C,max_length:D});import{AsyncLocalStorage as xe}from"node:async_hooks";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4a108e0e-0dfc-55c4-9f14-7395cfbac456")}catch{}})();var P='.row_contract.row_keys[] as $key | getpath($key | split(".")) | if type == "array" then .[] else if type == "object" then to_entries[] else empty end end',ce={context:{row_keys:["high_level","low_level"],fields:"supported"},get:{row_keys:["children"],fields:"supported"},list:{row_keys:["items"],fields:"supported"},next:{row_keys:["recommended","ready","decision_needed","blocked","held_by_others"],fields:"unsupported"},search:{row_keys:["items"],fields:"supported"},activity:{row_keys:["compact_activity","provenance_activity","activity"],fields:"unsupported"},history:{row_keys:["compact_history","provenance_history","history"],fields:"unsupported"},deps:{row_keys:["graph.nodes","graph.edges","context.nodes","context.edges"],fields:"unsupported"},health:{row_keys:["checks"],fields:"unsupported"},aggregate:{row_keys:["groups"],fields:"unsupported"},duplicates:{row_keys:["clusters"],fields:"unsupported"},stats:{row_keys:["by_type","by_status"],fields:"unsupported"},comments:{row_keys:["comments"],fields:"unsupported"},notes:{row_keys:["notes"],fields:"unsupported"},learnings:{row_keys:["learnings"],fields:"unsupported"},files:{row_keys:["files"],fields:"unsupported"},docs:{row_keys:["docs"],fields:"unsupported"},validate:{row_keys:["checks","warnings"],fields:"unsupported"},contracts:{row_keys:["command_summaries","commands"],fields:"unsupported"}},ue=[{command:"activity",complete_mode:"full",omissions_by_mode:{compact:[{name:"provenance",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}},{command:"history",complete_mode:"full",omissions_by_mode:{compact:[{name:"raw_history",restore_with:"--full"}],provenance:[{name:"patch_and_hashes",restore_with:"--full"}]}}];function nt(e,t,n){if(e&&t)throw new h(`${n} cannot be combined with --full`,g.USAGE)}function _(e,t=new Set){let n=e.filter(o=>!t.has(o.name)).map(o=>({...o}));return{has_omissions:n.length>0,omitted_field_group_count:n.length,omitted_field_groups:n}}function ot(e,t){let n=ue.find(r=>r.command===e);if(n===void 0)throw new TypeError(`Unknown mode-paired output command: ${e}`);if(t===n.complete_mode)return _([]);let o=n.omissions_by_mode[t];if(o===void 0)throw new TypeError(`Unknown ${e} output mode: ${t}`);return _(o)}var fe=[{name:"hierarchy",restore_with:"--depth standard"},{name:"activity",restore_with:"--depth standard"},{name:"progress",restore_with:"--depth standard"},{name:"blockers",restore_with:"--depth standard"},{name:"recently_created",restore_with:"--depth standard"},{name:"unparented",restore_with:"--depth standard"},{name:"files",restore_with:"--depth deep"},{name:"workload",restore_with:"--depth standard"},{name:"staleness",restore_with:"--depth deep"},{name:"tests",restore_with:"--depth deep"},{name:"workspace_memory",restore_with:"--depth deep"}];function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function le(e){return m(e)&&typeof e.command=="string"&&e.command.trim().length>0&&(e.row_kind==="collection"||e.row_kind==="none")&&Array.isArray(e.row_keys)&&e.row_keys.every(t=>typeof t=="string"&&t.length>0)&&new Set(e.row_keys).size===e.row_keys.length&&(e.fields==="supported"||e.fields==="unsupported")&&(e.row_kind==="collection"?e.row_keys.length>0&&typeof e.jq_selector=="string"&&e.jq_selector.trim().length>0:e.row_keys.length===0&&e.jq_selector===void 0)}var me={ancestors:["ids"],descendants:["ids"],predecessors:["ids"],successors:["ids"],paths:["paths"],impact:["affected"],audit:["findings"],communities:["communities"],redundancy:["redundant"],dominators:["bottlenecks"],slack:["rows"],centrality:["rows"],articulation:["articulation_points","bridges"],plan:["steps"]},_e={context:["sections_included","high_level","low_level"],get:["item"],list:["items","projection"],next:["recommended","ready","decision_needed","blocked","held_by_others"],search:["items","projection"],activity:["compact_activity","provenance_activity","activity"],history:["compact_history","provenance_history","history"],deps:["tree","graph","projection"],health:["checks"],aggregate:["groups"],duplicates:["clusters"],stats:["totals","by_type","by_status"],comments:["comments"],notes:["notes"],learnings:["learnings"],files:["files"],docs:["docs"],validate:["checks","warnings"],contracts:["command_summaries","commands","selected"]};function pe(e,t){let n=e.trim().toLowerCase().split(/\s+/u,1)[0],o=n?.startsWith("list-")?"list":n;if(o==="graph"){let i=typeof t.subcommand=="string"?t.subcommand:"";if(i.length===0)return;let d=me[i];if(d===void 0)return;let a=d.filter(c=>Array.isArray(t[c])||m(t[c]));return{command:"graph",row_kind:a.length>0?"collection":"none",row_keys:a,fields:"unsupported",...a.length>0?{jq_selector:P}:{}}}let r=ce[o],s=_e[o];return r===void 0||s===void 0||!s.some(i=>Object.hasOwn(t,i))?void 0:(()=>{let i=r.row_keys.filter(d=>{let a=d.split(".").reduce((c,u)=>m(c)?c[u]:void 0,t);return Array.isArray(a)||m(a)});return{command:o,row_kind:i.length>0?"collection":"none",row_keys:i,fields:r.fields,...i.length>0?{jq_selector:P}:{}}})()}function ge(e){if(!m(e.projection)||typeof e.projection.mode!="string"||e.projection.mode.trim().length===0)return;let t=e.projection.declared_field_groups,n=e.projection.included_field_groups;if(!Array.isArray(t)||!Array.isArray(n))return;let o=t.filter(i=>m(i)&&typeof i.name=="string"&&i.name.trim().length>0&&typeof i.restore_with=="string"&&i.restore_with.trim().length>0),r=n.filter(i=>typeof i=="string");if(o.length!==t.length||r.length!==n.length)return;let s=new Set(o.map(i=>i.name));if(!(s.size!==o.length||new Set(r).size!==r.length||r.some(i=>!s.has(i))))return _(o,new Set(r))}function he(e){if(Array.isArray(e.sections_included))return _(fe,new Set(e.sections_included.filter(t=>typeof t=="string")))}function ye(e){if(!m(e.item))return;let t=["children","claim_state","linked"].map(n=>({name:n,restore_with:`--fields ${n}`}));return _(t,new Set(t.flatMap(({name:n})=>e[n]===void 0?[]:[n])))}function U(e){if(m(e.projection))return _([{name:"full_item_fields",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_item_fields"]:[]))}function we(e){if(!m(e.projection))return _([]);if(typeof e.projection.mode=="string")return _([{name:"full_check_details",restore_with:"--full"}],new Set(e.projection.mode==="full"?["full_check_details"]:[]))}function be(e){if(!(!m(e.selected)||typeof e.selected.summary!="boolean"))return _([{name:"full_contract_catalog",restore_with:"--full"}],new Set(e.selected.summary?[]:["full_contract_catalog"]))}function ke(e,t){let n=ge(t);if(n!==void 0)return n;let[o]=e.split(/\s+/u,1);if(o==="context")return he(t);if(o==="get")return ye(t);if(o==="list"||o.startsWith("list-"))return U(t);if(o==="search")return U(t)??_([{name:"projection_metadata",restore_with:"--full"}]);if(o==="health")return we(t);if(o==="contracts")return be(t)}function $(e,t){if(e===void 0||!m(t))return t;let n=t.row_contract,o=le(n)?n:pe(e,t),r=o!==void 0?{...t,row_contract:o}:Object.hasOwn(t,"row_contract")?Object.fromEntries(Object.entries(t).filter(([i])=>i!=="row_contract")):t;if(m(r.omission_receipt))return r;let s=ke(e,r);return s===void 0?r:{...r,omission_receipt:s}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e48a306e-debb-5e66-ae9b-68bf17fa405f")}catch{}})();var G=Object.freeze([{command:"context",intent:"orient",description:"Bounded active hierarchy, ownership, blockers, and recent progress.",included_field_groups:["summary","focus","hierarchy","blockers","activity"],token_budget:2400,source:"core"},{command:"context",intent:"handoff",description:"Active ownership, evidence, decisions, and immediate continuation context.",included_field_groups:["summary","focus","in_progress","decisions","activity"],token_budget:2200,source:"core"},{command:"get",intent:"inspect",description:"Standard-depth item metadata, relationships, evidence, and lifecycle state.",included_field_groups:["item","children","claim_state","linked"],token_budget:3200,source:"core"},{command:"list",intent:"triage",description:"A budget-derived page of compact governance, ownership, priority, and blocker rows for triage.",included_field_groups:["identity","governance","ownership","dependencies"],token_budget:3200,source:"core"},{command:"next",intent:"execute",description:"The highest-ranked actionable work with concise ranking evidence.",included_field_groups:["recommended"],token_budget:1200,source:"core"},{command:"search",intent:"discover",description:"A budget-derived page of ranked canonical lineage candidates with compact match evidence.",included_field_groups:["identity","status","lineage","match"],token_budget:1800,source:"core"}]),q=new xe;function Te(){return q.getStore()??G}function ft(e,t){return q.run(Oe(e.workspaceContracts,e.packageContracts),t)}function Ce(e,t){let n=e.command.trim().toLowerCase(),o=e.intent.trim().toLowerCase(),r=`${n}:${o}`;if(!/^[a-z0-9][a-z0-9-]*$/.test(n)||!/^[a-z0-9][a-z0-9-]*$/.test(o))throw new TypeError(`Invalid context intent command or name: ${r}`);if(e.description.trim().length===0)throw new TypeError(`Context intent ${r} requires a non-empty description`);if(!Number.isSafeInteger(e.token_budget)||e.token_budget<=0)throw new TypeError(`Context intent ${r} requires a positive integer token_budget`);let s=[...new Set(e.included_field_groups.map(i=>i.trim()).filter(Boolean))];if(s.length===0)throw new TypeError(`Context intent ${r} requires included_field_groups`);return{command:n,intent:o,description:e.description.trim(),included_field_groups:s,token_budget:e.token_budget,source:t}}function Oe(e=[],t=[]){let n=[{source:"core",contracts:G,allowOverride:!1},{source:"package",contracts:t,allowOverride:!1},{source:"workspace",contracts:e,allowOverride:!0}],o=new Map,r=new Set;for(let s of n){r.clear();for(let i of s.contracts){let d=Ce(i,s.source),a=`${d.command}:${d.intent}`;if(r.has(a))throw new TypeError(`Duplicate context intent declaration: ${a}`);if(r.add(a),!s.allowOverride&&o.has(a))throw new TypeError(`Duplicate context intent declaration: ${a}`);o.set(a,d)}}return[...o.values()].sort((s,i)=>s.command.localeCompare(i.command)||s.intent.localeCompare(i.intent))}function z(e,t,n=Te()){let o=e.trim().toLowerCase(),r=t.trim().toLowerCase(),s=n.find(c=>c.command===o&&c.intent===r);if(s)return{...s,source:s.source??"core"};let i=n.filter(c=>c.command===o).map(c=>c.intent);if(i.length===0)return;let d=i.map(c=>{let u=Array.from({length:r.length+1},(p,f)=>f);for(let p=1;p<=c.length;p+=1){let f=u[0];u[0]=p;for(let l=1;l<=r.length;l+=1){let W=u[l];u[l]=Math.min(u[l]+1,u[l-1]+1,f+(c[p-1]===r[l-1]?0:1)),f=W}}return{candidate:c,distance:u[r.length]}}).sort((c,u)=>c.distance-u.distance||c.candidate.localeCompare(u.candidate))[0].candidate,a=`pm ${o} --for ${d}`;throw new h(`Unknown context intent "${r}" for ${o}. Did you mean "${d}"?`,g.USAGE,{code:"unknown_context_intent",reason:"unknown_intent",field:"for",required:`Use a declared ${o} intent.`,why:"Intent names are command-local contracts and cannot be inferred from output section names.",nextSteps:[a],recovery:{recovery_mode:"compact",attempted_command:`pm ${o} --for ${r}`,suggested_retry:a}})}var Q={context:(e,t,n)=>{e.depth===void 0&&(e.depth=t.intent==="handoff"?"deep":"standard"),e.section===void 0&&(e.section=t.intent==="handoff"?["activity","progress","blockers"]:["hierarchy","blockers","activity"]);let o=T(e.tokenBudget,t.token_budget),r=Math.max(1,Math.floor((o-800)/500)),s=String(n?r:Math.min(20,r));e.limit===void 0&&(e.limit=s),e.activityLimit===void 0&&(e.activityLimit=s)},get:e=>{e.depth===void 0&&e.fields===void 0&&(e.depth="standard")},list:(e,t,n)=>{if(e.brief===void 0&&e.compact===void 0&&e.full===void 0&&e.fields===void 0&&(e.fields="id,title,status,type,priority,parent,assignee,risk,blocked_by"),e.limit===void 0){let o=T(e.tokenBudget,t.token_budget),r=Math.max(2,Math.floor((o-520)/16));e.limit=String(n?r:Math.min(100,r))}},next:e=>{e.readyOnly===void 0&&(e.readyOnly=!0)},search:(e,t,n)=>{if(e.compact===void 0&&e.full===void 0&&e.fields===void 0&&(e.compact=!0),e.limit===void 0){let o=T(e.tokenBudget,t.token_budget),r=Math.max(2,Math.floor((o-480)/16));e.limit=String(n?r:Math.min(100,r))}}};function lt(e,t){let n=t.tokenBudget??t.token_budget;if(typeof t.for!="string"){if(n!==void 0&&(e==="get"||e==="list"||e==="search"))throw new h("--token-budget requires a declared context intent selected with --for",g.USAGE,{code:"missing_required_option",field:"for",required:"Select a context intent with --for when setting --token-budget.",why:"A token-budget override has no projection contract to constrain without a selected intent.",nextSteps:["Retry with --for <intent> --token-budget <n>, or omit --token-budget."]});if(t.tokenBudget!==void 0||t.token_budget===void 0)return t;let i={...t,tokenBudget:n};return delete i.token_budget,i}let o=z(e,t.for),r=v(n)!==void 0,s={...t};return s.tokenBudget===void 0&&n!==void 0&&(s.tokenBudget=n),delete s.token_budget,s.tokenBudget===void 0&&(s.tokenBudget=String(o.token_budget)),Q[e](s,o,r),s}var Ee={context:"bounded_sections",get:"standard_item",list:"bounded_fields_and_rows",next:"bounded_ranked_rows",search:"bounded_ranked_rows"},x=256;function S(e){return Array.isArray(e)?e.map(S):e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,S(n)])):typeof e=="string"&&e.length>240?`${e.slice(0,240)}\u2026`:e}function v(e){let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e):Number.NaN;return Number.isSafeInteger(t)&&t>0?t:void 0}function T(e,t){let n=v(e);if(n===void 0)return t;if(n<x)throw new h(`Context intent token budget must be at least ${x}`,g.USAGE,{code:"invalid_argument_value",reason:"below_minimum",field:"tokenBudget",required:`Use an integer token budget of at least ${x}.`,why:"Smaller ceilings cannot contain the minimum machine-readable intent receipt.",nextSteps:[`Retry with --token-budget ${x} or omit the override.`]});return n}function y(e,t){let n=t.estimated_tokens;for(;;){t.estimated_tokens=n;let o=Math.ceil(Buffer.byteLength(JSON.stringify(e),"utf8")/4);if(o===n)return;n=o}}var L={context:["high_level","low_level","blocked_fallback","recently_created","unparented","hierarchy","activity","blockers"],get:["children"],list:["items"],next:["ready","decision_needed","blocked","held_by_others"],search:["items"]};function K(e){try{let t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));return typeof t.fingerprint!="string"||!Number.isSafeInteger(t.after_index)?void 0:{fingerprint:t.fingerprint,after_index:t.after_index,...typeof t.snapshot=="string"?{snapshot:t.snapshot}:{}}}catch{return}}function Se(e){if(e===null||typeof e!="object")return;if(typeof e.id=="string")return e.id;let t=e.item?.id;return typeof t=="string"?t:void 0}function ve(e,t,n){let o=!1;for(;;){if(y(e,t),t.estimated_tokens<=t.token_budget||n.length<=1)return o;let r=Buffer.byteLength(JSON.stringify(n),"utf8"),s=(t.estimated_tokens-t.token_budget)*4;n.splice(-Math.min(n.length-1,Math.max(1,Math.ceil(s/Math.max(1,Math.ceil(r/n.length)))))),o=!0}}function Ae(e,t,n){let o=e.items,r=typeof e.next_cursor=="string",s=r?e.next_cursor:n.after;if(!Array.isArray(o)||typeof s!="string")return!1;let i=K(s);if(i===void 0)return!1;let d=o.length,a=[...o],c=!1;for(;;){if(c=ve(e,t,o)||c,!c)return!1;let u=Se(o.at(-1));if(u===void 0)return o.splice(0,o.length,...a),y(e,t),!1;if(e.next_cursor=O(i.fingerprint,u,r?i.after_index-(d-o.length):i.after_index+o.length,i.snapshot),y(e,t),t.estimated_tokens<=t.token_budget||o.length<=1)break}return typeof e.count=="number"&&(e.count=o.length),typeof e.applied_limit=="number"&&(e.applied_limit=o.length),!0}function Re(e,t,n,o){if(e==="list"||e==="search")return Ae(t,n,o);if(e!=="next"||typeof t.next_cursor=="string")return!1;let r=!1;for(;;){if(y(t,n),n.estimated_tokens<=n.token_budget)return r;let s=L[e].map(f=>({key:f,rows:Array.isArray(t[f])?t[f]:[]})).filter(({rows:f})=>f.length>0).sort((f,l)=>l.rows.length-f.rows.length||f.key.localeCompare(l.key))[0];if(s===void 0)return r;let i=L[e].reduce((f,l)=>f+(Array.isArray(t[l])?t[l].length:0),0);if(i<=1)return r;let d=Math.min(s.rows.length,i-1),a=Buffer.byteLength(JSON.stringify(s.rows),"utf8"),c=Math.max(1,Math.ceil(a/s.rows.length)),u=(n.estimated_tokens-n.token_budget)*4,p=Math.min(d,Math.max(1,Math.ceil(u/c)));s.rows.splice(-p,p),r=!0}}function Ie(e,t,n){if(typeof t.for!="string")return n;let o=e.startsWith("list-")?"list":e;if(!(o in Q))return n;let r=o,s=z(r,t.for),i={command:r,intent:s.intent,source:s.source,included_field_groups:[...s.included_field_groups],token_budget:T(t.tokenBudget??t.token_budget,s.token_budget),estimated_tokens:0,within_budget:!0,degradation:Ee[r],declaration_feasible:!0,result_omitted:!1},d={...n};if(r==="list"||r==="search"){let c=r==="list"?520:480,u=Math.max(2,Math.floor((i.token_budget-c)/16)),f=v(t.tokenBudget??t.token_budget)!==void 0?u:Math.min(100,u),l=t.limit!==void 0;i.budget_derived_limit=f,i.binding_constraint=l?"explicit_limit":"token_budget",i.limit_reason=l?"The caller supplied an explicit row limit; the budget-derived limit remains diagnostic.":"The selected intent token budget determines the row ceiling.",d.budget_derived_limit=f}let a={...d,context_intent:i};return y(a,i),i.estimated_tokens>i.token_budget&&(i.degradation="recursive_budget_compaction",a={...S(d),context_intent:i},y(a,i)),i.estimated_tokens>i.token_budget&&Re(r,a,i,t)&&(i.degradation="budget_row_compaction",y(a,i)),i.estimated_tokens>i.token_budget&&(i.degradation="budget_receipt_only",i.declaration_feasible=!1,i.result_omitted=!0,i.within_budget=!1,a={budget_exceeded:{omitted_result:!0,reason:"declared_budget_infeasible",restore_with:"Increase --token-budget or narrow the request; the unprojected command may be larger."},context_intent:i},y(a,i)),a}function Me(e,t){if(typeof e.after!="string"||e.after.length===0)return t;let n=K(e.after)?.fingerprint??"opaque_cursor",o={...t};for(let r of["applied_limit","completeness","context_intent","count","filters","has_more","now","omission_receipt","projection","row_contract","sorting","total","truncated"])delete o[r];return o.continuation_contract={fingerprint:n,metadata:"reference",restore_with:"omit --after"},o}function mt(e,t,n){let o=$(e,n);return typeof o=="object"&&o!==null&&!Array.isArray(o)?M(e??"",t,Me(t,Ie(e??"",t,o))):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]="02baf966-46eb-5e19-b7eb-2f9fe05bb263")}catch{}})();var b=["result_rows","envelope","diagnostics","hints"],Ne=/^(?:items|results|rows|ready|blocked|recommended|decision_needed|children|dependencies|events|matches|commands|tools)$/u,Be=/^(?:diagnostics|errors?|warnings?|findings|violations|failures?)$/u,De=/^(?:hints?|suggestions?|next_steps?|recovery|remediation|examples?)$/u,Pe=8;function A(e){return Buffer.byteLength(e,"utf8")}function j(e){return A(JSON.stringify(e)??"null")}function Ue(e,t){return Be.test(e)?"diagnostics":De.test(e)?"hints":Ne.test(e)||Array.isArray(t)?"result_rows":"envelope"}function $e(e){let t={result_rows:0,envelope:0,diagnostics:0,hints:0};if(typeof e!="object"||e===null||Array.isArray(e))return t[Array.isArray(e)?"result_rows":"envelope"]=j(e),t;for(let[n,o]of Object.entries(e))t[Ue(n,o)]+=j({[n]:o});return Object.values(t).every(n=>n===0)&&(t.envelope=1),t}function Le(e,t){let n=b.reduce((i,d)=>i+t[d],0),o=b.map(i=>({section:i,value:e*t[i]/n})),r={result_rows:0,envelope:0,diagnostics:0,hints:0};for(let i of o)r[i.section]=Math.floor(i.value);let s=e-b.reduce((i,d)=>i+r[d],0);for(let i of[...o].sort((d,a)=>a.value-Math.floor(a.value)-(d.value-Math.floor(d.value))||b.indexOf(d.section)-b.indexOf(a.section))){if(s===0)break;r[i.section]+=1,s-=1}return r}function J(e,t){return typeof e=="object"&&e!==null&&!Array.isArray(e)?{...e,token_accounting:t}:{result:e,token_accounting:t}}function gt(e,t){let n=A(t(e)),o=Le(n,$e(e)),r=Object.fromEntries(b.map(d=>[d,{bytes:o[d],estimated_tokens:k(o[d])}])),s={version:1,measurement_scope:"output_before_token_accounting",estimator:"ceil(utf8_bytes / 4)",total_bytes:n,total_estimated_tokens:k(n),sections:r,accounting_receipt_bytes:0,accounting_receipt_estimated_tokens:0,excluded_fields:["token_accounting"],section_allocation:"proportional_canonical_json"},i=J(e,s);for(let d=0;d<Pe;d+=1){let a=A(t(i))-n;if(a===s.accounting_receipt_bytes)return i;s={...s,accounting_receipt_bytes:a,accounting_receipt_estimated_tokens:k(a)},i=J(e,s)}return i}export{X as a,qe as b,te as c,N as d,ne as e,oe as f,ze as g,k as h,nt as i,ot as j,$ as k,Xe as l,Ye as m,O as n,E as o,Fe as p,de as q,He as r,Ve as s,G as t,Te as u,ft as v,Oe as w,z as x,lt as y,K as z,Se as A,Ie as B,mt as C,gt as D};
|
|
2
|
+
//# sourceMappingURL=chunk-27DK4A5O.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as ut,d as A,f as lt,h as ie}from"./chunk-6KDHXURF.js";import{$a as ct,Ka as se,P as ne,aa as F,ab as dt,cb as re,ja as De,k as te}from"./chunk-GEYU23YS.js";import{D as W,J as H,Ka as Y,M as J,aa as k,da as X,p as K,q as $,r as P,t as st}from"./chunk-EAXXF2HW.js";import{h as Q,i as Z,k as Re,m as L,n as ee,o as rt,p as it,q as ot,r as at}from"./chunk-27DK4A5O.js";import{Y as y,Z as w,aa as j,la as Se}from"./chunk-7AZDTGPA.js";import{constants as G}from"node:fs";import{lstat as ft,mkdir as Le,open as ht}from"node:fs/promises";import T 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]="c53bb1b7-12b9-5370-a85b-cdd8bef57936")}catch{}})();function Ce(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship event ${t} must be non-empty`);return e.trim()}function Ae(e,t){let n=t.require(e.kind),s=n.direction==="undirected"?[e.source,e.target].sort().join("\0"):`${e.source}\0${e.target}`;return`${n.kind}\0${s}`}function yn(e){return Object.freeze({...e,...e.payload===void 0?{}:{payload:Object.freeze(structuredClone(e.payload))}})}function wn(e,t,n,s){let r=n.require(e.kind),i=s.outgoingOne.get(`${r.kind}\0${e.source}`);if(i!==void 0&&i!==t)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let o=s.incomingOne.get(`${r.kind}\0${e.target}`);if(o!==void 0&&o!==t)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let a=Ae(e,n),c=s.identities.get(a);if(c!==void 0&&c!==t)throw new TypeError(`Relationship edge already active: ${a}`)}function bn(e){let t=new Map;for(let n of e)n.action==="remove"?t.delete(n.relationshipId):t.set(n.relationshipId,n.edge);return t}function _n(e,t,n){if(e.expectedVersion!==void 0&&e.expectedVersion!==t)throw new TypeError(`Relationship event version conflict: expected ${e.expectedVersion}, current ${t}`);let s=Ce(e.eventId,"eventId");if(n.has(s))throw new TypeError(`Relationship event already exists: ${s}`);if(e.action!=="add"&&e.action!=="remove"&&e.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${e.action}`);if(!Number.isFinite(Date.parse(e.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:s,relationshipId:Ce(e.relationshipId,"relationshipId"),author:Ce(e.author,"author"),timestamp:new Date(e.timestamp).toISOString()}}function vn(e,t,n,s,r,i){let o=n.has(t);if(e.action==="add"&&o)throw new TypeError(`Relationship is already active: ${t}`);if(e.action!=="add"&&!o)throw new TypeError(`Relationship is not active: ${t}`);if(e.action==="remove")return;if(!e.edge)throw new TypeError(`Relationship ${e.action} event requires an edge`);let a=typeof e.edge.source=="string"?e.edge.source.trim():"",c=typeof e.edge.target=="string"?e.edge.target.trim():"";if(!s.has(a)||!s.has(c))throw new TypeError(`Relationship endpoint not found: ${a} -> ${c}`);let d=new X([a,c],[e.edge],r).edges()[0];return wn(d,t,r,i),yn(d)}var Ne=class{#e;#n;#s=[];#i=new Set;#t=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(t,n={}){this.#e=new Set([...t].filter(s=>typeof s=="string").map(s=>s.trim()).filter(Boolean)),this.#n=n.registry??k()}get version(){return this.#s.length}events(){return Object.freeze([...this.#s])}*stream(t={}){let n=t.fromVersion??1,s=t.toVersion??this.version,r=t.batchSize??100;if(!Number.isInteger(n)||n<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(s)||s<0||s>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${s}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(n>s+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let i=n-1;i<s;i+=r)yield Object.freeze(this.#s.slice(i,Math.min(i+r,s)))}project(t,n,s={}){if(typeof n!="function")throw new TypeError("Relationship event projection requires a reducer");let r=t,i=0,o;for(let a of this.stream({...s,batchSize:256}))for(let c of a)r=n(r,c),i+=1,o=c;return Object.freeze({state:r,version:o?.sequence??Math.max(0,(s.fromVersion??1)-1),processed:i,...o===void 0?{}:{asOf:o.timestamp}})}#o(t,n){let s=this.#n.require(n.kind);this.#r.identities.set(Ae(n,this.#n),t),s.outgoing==="one"&&this.#r.outgoingOne.set(`${s.kind}\0${n.source}`,t),s.incoming==="one"&&this.#r.incomingOne.set(`${s.kind}\0${n.target}`,t)}#a(t){let n=this.#n.require(t.kind);this.#r.identities.delete(Ae(t,this.#n)),n.outgoing==="one"&&this.#r.outgoingOne.delete(`${n.kind}\0${t.source}`),n.incoming==="one"&&this.#r.incomingOne.delete(`${n.kind}\0${t.target}`)}append(t){let n=_n(t,this.version,this.#i),s=this.#t.get(n.relationshipId),r=vn(t,n.relationshipId,this.#t,this.#e,this.#n,this.#r),i=Object.freeze({eventId:n.eventId,relationshipId:n.relationshipId,action:t.action,...r===void 0?{}:{edge:r},author:n.author,timestamp:n.timestamp,...t.reason?.trim()?{reason:t.reason.trim()}:{},sequence:this.version+1});return this.#s.push(i),this.#i.add(n.eventId),s&&this.#a(s),t.action==="remove"?this.#t.delete(n.relationshipId):(this.#t.set(n.relationshipId,r),this.#o(n.relationshipId,r)),i}snapshot(t={}){if(t.atVersion!==void 0&&t.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let n;if(t.atTimestamp!==void 0){let i=Date.parse(t.atTimestamp);if(!Number.isFinite(i))throw new TypeError("Relationship snapshot timestamp must be valid");n=this.#s.filter(o=>Date.parse(o.timestamp)<=i)}else{let i=t.atVersion??this.version;if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship snapshot version out of range: ${i}`);n=this.#s.slice(0,i)}let s=bn(n),r=new X(this.#e,s.values(),this.#n);return Object.freeze({version:n.at(-1)?.sequence??0,...n.at(-1)?{asOf:n.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(t){if(!Number.isInteger(t.limit)||t.limit<1)throw new TypeError("Relationship event page limit must be positive");let n=L("relationship-events",{order:"append-sequence"}),s=t.cursor===void 0?this.version:Number(rt(t.cursor,n).snapshot);if(!Number.isSafeInteger(s)||s<0||s>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=at(this.#s.slice(0,s),{cursor:t.cursor,fingerprint:n,limit:t.limit,readId:i=>i.eventId,snapshot:String(s)});return{version:s,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},kn="relationship-event-store",gt=G.O_NOFOLLOW;function oe(e){return ne(e,kn,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function D(e,t="relationships/events.jsonl"){let n=T.resolve(e),s=T.resolve(n,t),r=T.relative(n,s);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${T.sep}`)||T.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await Le(n,{recursive:!0}),(await ft(n)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let o=n;for(let a of r.split(T.sep)){o=T.join(o,a);try{if((await ft(o)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(c){if(c.code==="ENOENT")break;throw c}}return s}async function ae(e,t,n){let s=new Ne(t,{registry:n}),r,i;try{i=await ht(e,G.O_RDONLY|gt),r=await i.readFile("utf8")}catch(a){if(a.code==="ENOENT")return{log:s,raw:""};throw a}finally{await i?.close()}let o=r.split(`
|
|
2
|
+
`);for(let a=0;a<o.length;a+=1){let c=o[a].trim();if(!c)continue;let d;try{d=JSON.parse(c)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${a+1}`)}if(d.sequence!==s.version+1)throw new TypeError(`Invalid relationship event sequence at line ${a+1}`);s.append({eventId:d.eventId,relationshipId:d.relationshipId,action:d.action,...d.edge===void 0?{}:{edge:d.edge},author:d.author,timestamp:d.timestamp,...d.reason===void 0?{}:{reason:d.reason},expectedVersion:s.version})}return{log:s,raw:r}}function xn(e,t,n,s){let r=Date.parse(t.timestamp),i;return t.action!=="remove"&&t.edge!==void 0&&(i=new X(n,[t.edge],s).edges()[0]),e.eventId===t.eventId.trim()&&e.relationshipId===t.relationshipId.trim()&&e.action===t.action&&e.author===t.author.trim()&&Number.isFinite(r)&&e.timestamp===new Date(r).toISOString()&&e.reason===(t.reason?.trim()||void 0)&&j(e.edge)===j(i)}var pt=class e{#e;#n;#s;#i;#t;constructor(t,n,s,r){this.#e=t.pmRoot,this.#n=n,this.#s=t.registry,this.#i=s,this.#t=r}static async open(t){let n=Object.freeze([...t.nodes]),s=await D(t.pmRoot,t.relativePath),r=await oe(t.pmRoot);try{await D(t.pmRoot,s);let{log:i}=await ae(s,n,t.registry);return new e(t,n,s,i)}finally{await r()}}get path(){return this.#i}async currentVersion(){return this.#t=await this.#r(),this.#t.version}async append(t){let n=await oe(this.#e);try{let s=await D(this.#e,this.#i),{log:r}=await ae(s,this.#n,this.#s),i=r.append(t);await Le(T.dirname(s),{recursive:!0}),await D(this.#e,s);let o=await ht(s,G.O_APPEND|G.O_CREAT|G.O_WRONLY|gt);try{await o.appendFile(`${JSON.stringify(i)}
|
|
3
|
+
`,"utf8")}finally{await o.close()}return this.#t=r,i}finally{await n()}}async appendBatch(t,n={}){let s=await oe(this.#e);try{let r=await D(this.#e,this.#i),{log:i,raw:o}=await ae(r,this.#n,this.#s),a=i.version,c=new Map(i.events().map(l=>[l.eventId,l])),d=[],u=[];for(let l of t){let f=l.eventId.trim(),p=c.get(f);if(p!==void 0){if(n.existingEventPolicy==="skip_identical"&&xn(p,l,this.#n,this.#s)){u.push(p.eventId);continue}if(n.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${f}`)}let h=i.append(l);c.set(h.eventId,h),d.push(h)}if(d.length>0){let l=o.length===0||o.endsWith(`
|
|
4
|
+
`)?o:`${o}
|
|
5
|
+
`;await Le(T.dirname(r),{recursive:!0}),await D(this.#e,r),await P(r,`${l}${d.map(f=>JSON.stringify(f)).join(`
|
|
6
|
+
`)}
|
|
7
|
+
`)}return this.#t=i,Object.freeze({version_before:a,version_after:i.version,appended:Object.freeze(d),skipped_event_ids:Object.freeze(u)})}finally{await s()}}async snapshot(t={}){return this.#t=await this.#r(),this.#t.snapshot(t)}async page(t){return this.#t=await this.#r(),this.#t.page(t)}async*stream(t={}){this.#t=await this.#r(),yield*this.#t.stream(t)}async project(t,n,s={}){return this.#t=await this.#r(),this.#t.project(t,n,s)}async#r(){let t=await oe(this.#e);try{let n=await D(this.#e,this.#i);return(await ae(n,this.#n,this.#s)).log}finally{await 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]="3a33af50-3d2c-57bb-884a-4d5394599ba2")}catch{}})();function En(e,t,n,s,r,i){if(e.seen.has(t))return"skip";if(e.cursorFound&&e.affected.length>=i)return"truncate";e.seen.add(t),e.parents.set(t,n.id);let o=n.depth+1;return e.queue.push({id:t,depth:o}),e.cursorFound?(e.affected.push({id:t,distance:o,path:An(s,t,e.parents)}),"continue"):(e.cursorFound=t===r,"skip")}function In(e,t,n,s){let r=L("graph impact",{root:e,direction:n,kinds:[...t.kinds??[]].sort(),max_depth:Number.isFinite(s)?s:"unbounded"});return{fingerprint:r,after:t.after===void 0?void 0:it(t.after,r)}}function B(e,t,n){e.get(t).add(n)}function de(e){return new Map(e.map(t=>[t,new Set]))}function yt(e){for(let t of e)t.sort();return e.sort((t,n)=>n.length-t.length||t[0].localeCompare(n[0]))}function ce(e){if(Array.isArray(e))return e.map(n=>ce(n));if(e===null||typeof e!="object")return e;let t=e.toJSON;return typeof t=="function"?ce(t.call(e)):Object.fromEntries(Object.entries(e).sort(([n],[s])=>n.localeCompare(s)).map(([n,s])=>[n,ce(s)]))}function mt(e){return JSON.stringify(ce(e))}function Tn(e,t,n,s){let r=[{id:e,expanded:!1}];for(;r.length>0;){let i=r.pop();if(i.expanded){s.push(i.id);continue}if(n.has(i.id))continue;n.add(i.id),r.push({id:i.id,expanded:!0});let o=[...t.get(i.id)].sort().reverse();for(let a of o)n.has(a)||r.push({id:a,expanded:!1})}}function Sn(e,t){let n=new Set,s=[];for(let r of e)n.has(r)||Tn(r,t,n,s);return s}function Rn(e,t){let n=new Set,s=[];for(let r of[...e].reverse()){if(n.has(r))continue;let i=[],o=[r];for(n.add(r);o.length>0;){let a=o.pop();i.push(a);for(let c of t.get(a))n.has(c)||(n.add(c),o.push(c))}s.push(i)}return yt(s)}function wt(e,t){let n=de(e);for(let[s,r]of t)for(let i of r)B(n,i,s);return Rn(Sn(e,t),n)}function Dn(e,t){let n=de(e.nodes());for(let s of e.edges()){let r=t.require(s.kind);if(!r.ordering)continue;let i=(r.precedence??"source_before_target")==="source_before_target";B(n,i?s.source:s.target,i?s.target:s.source)}return n}function Cn(e,t){let n=new Map(e.map(i=>[i,0]));for(let i of t.values())for(let o of i)n.set(o,n.get(o)+1);let s=e.filter(i=>n.get(i)===0).sort(),r=[];for(;s.length>0;){r.push(s);let i=[];for(let o of s)for(let a of t.get(o)){let c=n.get(a)-1;n.set(a,c),c===0&&i.push(a)}s=i.sort()}return r}function Ln(e,t){let n=new Map(e.map(o=>[o,0])),s=new Map;for(let o of e)for(let a of t.get(o)){if(!n.has(a))continue;let c=n.get(o)+1,d=s.get(a);(c>n.get(a)||c===n.get(a)&&(d===void 0||o.localeCompare(d)<0))&&(n.set(a,c),s.set(a,o))}let r=[...e].sort((o,a)=>n.get(a)-n.get(o)||o.localeCompare(a))[0],i=r===void 0?[]:[r];for(;i[0]!==void 0&&s.has(i[0]);)i.unshift(s.get(i[0]));return{depth:Object.fromEntries(n),path:i}}function An(e,t,n){let s=[t],r=t;for(;r!==e;)r=n.get(r),s.push(r);return s.reverse()}function ue(e,t={}){let n=t.registry??k(),s=[...e.nodes()],r=Dn(e,n),i=Cn(s,r),o=i.flat(),a=o.length===s.length,c=a?[]:wt(s,r).filter(u=>u.length>1||r.get(u[0]).has(u[0])),d=Ln(o,r);return{exact:!0,acyclic:a,order:o,layers:i,frontier:i[0]??[],depth:d.depth,criticalPath:d.path,criticalPathLength:Math.max(0,d.path.length-1),cycles:c,provenance:{algorithm:"kahn-longest-path",edgeFamily:"ordering"}}}function bt(e,t,n={}){let s=n.direction??"outgoing",r=n.maxDepth??Number.POSITIVE_INFINITY,i=n.limit??Number.POSITIVE_INFINITY,{fingerprint:o,after:a}=In(t,n,s,r),c={queue:[{id:t,depth:0}],seen:new Set([t]),parents:new Map,affected:[],cursorFound:a===void 0||a===t},d=0,u=0,l=!1,f=!1;e:for(let p=0;p<c.queue.length;p+=1){n.signal?.throwIfAborted();let h=c.queue[p];d+=1;let g=e.adjacency(h.id,{direction:s,kinds:n.kinds,signal:n.signal});if(u+=g.meta.inspectedEdges,h.depth>=r){g.value.some(m=>!c.seen.has(m))&&(l=!0);continue}for(let m of g.value)if(En(c,m,h,t,a,i)==="truncate"){l=!0,f=!0;break e}}if(!c.cursorFound)throw new TypeError(`Unknown impact cursor item: ${a}`);return{root:t,affected:c.affected,exact:!0,truncated:l,...f?{nextCursor:ee(o,c.affected.at(-1)?.id??t)}:{},cost:{visitedNodes:d,inspectedEdges:u}}}function _t(e){let t=[...e.nodes()],n=de(t),s=de(t);for(let c of e.edges())B(n,c.source,c.target),B(n,c.target,c.source),B(s,c.source,c.target);let r=[],i=new Set;for(let c of t){if(i.has(c))continue;let d=[],u=[c];for(i.add(c);u.length>0;){let l=u.pop();d.push(l);for(let f of n.get(l))i.has(f)||(i.add(f),u.push(f))}r.push(d)}let o=t.map(c=>({id:c,degree:n.get(c).size})),a=Math.max(0,...o.map(({degree:c})=>c));return{components:yt(r),stronglyConnected:wt(t,s),orphans:o.filter(({degree:c})=>c===0).map(({id:c})=>c),hubs:o.filter(({degree:c})=>c>0&&c===a),exact:!0,provenance:{algorithm:"component-degree",edgeFamily:"all"}}}function Zr(e,t){let n=new Map(e.edges.map(r=>[mt(r),r])),s=new Map(t.edges.map(r=>[mt(r),r]));return{fromVersion:e.version,toVersion:t.version,added:[...s].filter(([r])=>!n.has(r)).map(([,r])=>r),removed:[...n].filter(([r])=>!s.has(r)).map(([,r])=>r),unchangedCount:[...n.keys()].filter(r=>s.has(r)).length,exact:!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]="c0fb747e-1f9f-55c4-808b-b77d3a881f87")}catch{}})();var Nn=5,On=1e4,Mn=8;function Oe(e,t){if(!Number.isFinite(t)||!Number.isInteger(t)||t<0)throw new TypeError(`Invalid path ${e} bound: ${String(t)}`)}function le(e,t){return t.hierarchyDirection==="target_parent"?e.target:e.source}function q(e,t){return(t.precedence??"source_before_target")==="target_before_source"?e.target:e.source}function fe(e,t){let n=q(e,t);return{predecessor:n,successor:n===e.source?e.target:e.source}}function $n(e,t,n){if(t===void 0)return;let s=e.registry(),r=new Set;for(let i of t){let o=s.require(i);if(!o[n])throw new TypeError(`Relationship kind ${o.kind} is not a ${n} kind`);r.add(o.kind)}return r}function Pn(e,t,n,s,r){let i=e.registry(),o=e.neighborEdges(t,{direction:"both",...n===void 0?{}:{kinds:[...n]}}),a=[],c=new Set;for(let d of o.value){let u=i.require(d.edge.kind);u[s]&&r(d,u,t)&&(c.has(d.id)||(c.add(d.id),a.push(d.id)))}return{neighbors:a,inspectedEdges:o.meta.inspectedEdges}}function jn(e,t,n,s,r,i){if(t>=n)return e.neighbors.some(o=>!i.seen.has(o))&&(i.truncated=!0),!1;for(let o of e.neighbors)if(!i.seen.has(o)){if(i.seen.add(o),i.queue.push({id:o,depth:t+1}),!i.resumed){o===r&&(i.resumed=!0);continue}if(i.value.length>=s)return i.truncated=!0,!0;i.value.push(o)}return!1}function pe(e,t,n,s,r){if(!e.hasNode(t))throw new TypeError(`Relationship node not found: ${t}`);let i=$n(e,n.kinds,s),o=n.limit??Number.POSITIVE_INFINITY,a=n.maxDepth??Number.POSITIVE_INFINITY,c=n.after,d={seen:new Set([t]),value:[],queue:[{id:t,depth:0}],resumed:c===void 0,truncated:!1},u=0,l=0;for(let f=0;f<d.queue.length;f+=1){n.signal?.throwIfAborted();let p=d.queue[f];u+=1;let h=Pn(e,p.id,i,s,r);if(l+=h.inspectedEdges,jn(h,p.depth,a,o,c,d))break}if(!d.resumed)throw new TypeError(`Traversal cursor not found in sequence: ${c}`);return{value:d.value,meta:{visitedNodes:u,inspectedEdges:l,truncated:d.truncated,nextCursor:d.value.at(-1)}}}function vt(e,t){if(!e.hasNode(t))throw new TypeError(`Relationship node not found: ${t}`)}function kt(e,t,n,s,r){let i=e.neighborEdges(t.nodes.at(-1),{direction:s,...n.kinds===void 0?{}:{kinds:n.kinds}});return r.inspectedEdges+=i.meta.inspectedEdges,i.value.filter(o=>!t.nodeSet.has(o.id))}function Fn(e,t,n,s,r,i,o){for(let a of kt(e,t,s,r,o)){let c=[...t.nodes,a.id],d=new Set(t.nodeSet).add(a.id),u=[...t.edges,a.edge];if(a.id===n){if(o.value.push({nodes:c,edges:u,length:u.length}),o.value.length>=i)return!0}else o.queue.push({nodes:c,nodeSet:d,edges:u})}return!1}function xt(e,t,n={}){return pe(e,t,n,"hierarchy",(s,r)=>le(s.edge,r)===s.id)}function Et(e,t,n={}){return pe(e,t,n,"hierarchy",(s,r,i)=>le(s.edge,r)===i)}function It(e,t,n={}){return pe(e,t,n,"ordering",(s,r)=>q(s.edge,r)===s.id)}function Tt(e,t,n={}){return pe(e,t,n,"ordering",(s,r,i)=>q(s.edge,r)===i)}function Gn(e,t,n,s,r,i,o,a){let c={value:[],queue:[{nodes:[t],nodeSet:new Set([t]),edges:[]}],inspectedEdges:0},d=0,u=!1,l=r+1;for(let f=0;f<c.queue.length;f+=1){if(s.signal?.throwIfAborted(),c.value.length>=l||d>=i){u=!0;break}let p=c.queue[f];if(d+=1,p.edges.length>=o){kt(e,p,s,a,c).length>0&&(u=!0);continue}if(Fn(e,p,n,s,a,l,c)){u=!0;break}}return{value:c.value.slice(0,r),meta:{visitedNodes:d,inspectedEdges:c.inspectedEdges,truncated:u}}}function St(e,t,n,s={}){vt(e,t),vt(e,n);let r=s.maxPaths??Nn,i=s.maxVisitedPaths??On,o=s.maxDepth??Mn;Oe("maxPaths",r),Oe("maxVisitedPaths",i),Oe("maxDepth",o);let a=s.direction??"outgoing";s.signal?.throwIfAborted();for(let c of s.kinds??[])e.registry().require(c);return t===n?r===0?{value:[],meta:{visitedNodes:1,inspectedEdges:0,truncated:!0}}:{value:[{nodes:[t],edges:[],length:0}],meta:{visitedNodes:1,inspectedEdges:0,truncated:!1}}:Gn(e,t,n,s,r,i,o,a)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="24898402-1568-5b05-9072-f89dd91f25a6")}catch{}})();var Bn=16,qn=2,zn=8;function he(e,t){if(!Number.isInteger(t)||t<1)throw new TypeError(`Invalid ${e} bound: ${String(t)}`)}function ge(e,t,n){let s=e.registry(),r=t===void 0?void 0:new Set(t.map(i=>s.require(i).kind));for(let i of e.edges()){if(i.source===i.target)continue;let o=s.require(i.kind);r!==void 0&&!(r.has(o.kind)||o.inverse!==void 0&&r.has(o.inverse))||n(i,o)}}function Un(e,t){let n=new Map;ge(e,t,s=>{Rt(n,s.source,s.target),Rt(n,s.target,s.source)});for(let s of n.values())s.sort();return n}function Rt(e,t,n){let s=e.get(t);s===void 0?e.set(t,[n]):s.push(n)}function Vn(e,t){let n=new Map;for(let i of e){let o=t.get(i);n.set(o,(n.get(o)??0)+1)}let s,r=0;for(let[i,o]of n)(o>r||o===r&&i<s)&&(s=i,r=o);return s}function Kn(e,t){let n=new Map;for(let[r,i]of e){let o=n.get(i);o===void 0?n.set(i,[r]):o.push(r)}let s=[];for(let r of n.values())r.length<t||(r.sort(),s.push({representative:r[0],size:r.length,members:r}));return s.sort((r,i)=>i.size-r.size||r.representative.localeCompare(i.representative))}function Dt(e,t={}){let n=t.maxIterations??Bn,s=t.minSize??qn;he("maxIterations",n),he("minSize",s);let r=Un(e,t.kinds),i=e.nodes(),o=new Map(i.map(l=>[l,l])),a=0,c=!1,d=0,u=0;for(;a<n&&!c;){t.signal?.throwIfAborted(),a+=1,c=!0;for(let l of i){d+=1;let f=r.get(l);if(f===void 0)continue;u+=f.length;let p=Vn(f,o);p!==o.get(l)&&(o.set(l,p),c=!1)}}return{value:{communities:Kn(o,s),iterations:a,converged:c},meta:{visitedNodes:d,inspectedEdges:u,truncated:!c}}}function me(e){return e.direction==="directed"&&(e.ordering||e.hierarchy)}function ye(e){return e.inverse!==void 0&&e.inverse<e.kind?e.inverse:e.kind}function Me(e,t){return(t.hierarchy?le(e,t):e.source===q(e,t)?e.target:e.source)===e.target?{from:e.source,to:e.target}:{from:e.target,to:e.source}}function Wn(e,t){if(t===void 0)return;let n=e.registry(),s=new Set;for(let r of t){let i=n.require(r);if(!me(i))throw new TypeError(`Relationship kind ${i.kind} is not a directed ordering or hierarchy kind`);s.add(ye(i))}return s}function Hn(e,t){let n=e.registry(),s=new Map;for(let r of e.edges()){let i=n.require(r.kind);if(!me(i))continue;let o=ye(i);if(t!==void 0&&!t.has(o))continue;let a=Me(r,i);if(a.from===a.to)continue;let c=s.get(o);c===void 0&&(c={adjacency:new Map,records:[]},s.set(o,c));let d=c.adjacency.get(a.from);d===void 0?c.adjacency.set(a.from,new Set([a.to])):d.add(a.to),c.records.push({...a,edge:r})}return s}function Jn(e){let t=new Map;for(let[n,s]of e.adjacency)t.set(n,[...s].sort());return t}function Xn(e,t,n,s){let r=[s];for(let i=n;i!==t;i=e.get(i))r.push(i);return r.push(t),r.reverse()}function Yn(e,t,n,s,r,i){for(let o of e.get(n.id)??[])if(i.inspectedEdges+=1,!(n.depth===0&&o===t.to)&&!s.has(o)){if(s.set(o,n.id),o===t.to)return Xn(s,t.from,n.id,o);r.push({id:o,depth:n.depth+1})}}function Qn(e,t,n,s){let r=new Map([[t.from,t.from]]),i=[{id:t.from,depth:0}];for(let o=0;o<i.length;o+=1){let a=i[o];if(s.visitedNodes+=1,a.depth>=n)continue;let c=Yn(e,t,a,r,i,s);if(c!==void 0)return c}}function we(e,t={}){let n=t.maxDepth??zn;he("maxDepth",n),t.limit!==void 0&&he("limit",t.limit);let s=t.limit??Number.POSITIVE_INFINITY,r=Wn(e,t.kinds),i=Hn(e,r),o=[],a={visitedNodes:0,inspectedEdges:0},c=!1;e:for(let d of[...i.keys()].sort()){let u=i.get(d),l=Jn(u);for(let f of u.records){t.signal?.throwIfAborted();let p=Qn(l,f,n,a);if(p!==void 0){if(o.length>=s){c=!0;break e}o.push({edge:f.edge,witness:p})}}}return{value:o,meta:{visitedNodes:a.visitedNodes,inspectedEdges:a.inspectedEdges,truncated:c}}}function Zn(e,t,n,s,r){let i=new Set,o=[];for(let a of n){if(a.id===e||i.has(a.id))continue;if(!r.seen.has(a.id)){if(t>=s){r.truncated=!0;continue}r.seen.add(a.id),r.queue.push({id:a.id,depth:t+1})}i.add(a.id),o.push(a.id);let c=r.predecessors.get(a.id);c===void 0&&(c=new Set,r.predecessors.set(a.id,c)),c.add(e)}return o}function es(e,t,n){let s=n.direction??"outgoing",r=n.maxDepth??Number.POSITIVE_INFINITY,i=[],o=new Map,a={seen:new Set([t]),queue:[{id:t,depth:0}],predecessors:new Map,truncated:!1},c=0;for(let d=0;d<a.queue.length;d+=1){n.signal?.throwIfAborted();let{id:u,depth:l}=a.queue[d];i.push(u);let f=e.neighborEdges(u,{direction:s,...n.kinds===void 0?{}:{kinds:n.kinds}});c+=f.meta.inspectedEdges,o.set(u,Zn(u,l,f.value,r,a))}return{order:i,successors:o,predecessors:a.predecessors,inspectedEdges:c,truncated:a.truncated}}function ts(e,t){let n=[],s=new Set([t]),r=[{id:t,index:0}];for(;r.length>0;){let i=r.at(-1),o=e.successors.get(i.id);if(i.index<o.length){let a=o[i.index];i.index+=1,s.has(a)||(s.add(a),r.push({id:a,index:0}))}else n.push(i.id),r.pop()}return n.reverse()}function ns(e,t,n,s){let r=e,i=t;for(;r!==i;){for(;s.get(r)>s.get(i);)r=n.get(r);for(;s.get(i)>s.get(r);)i=n.get(i)}return r}function ss(e,t,n){let s;for(let r of[...e].sort())t.has(r)&&(s=s===void 0?r:ns(s,r,t,n));return s}function rs(e,t,n,s,r){let i=new Map([[t,t]]),o=!0;for(;o;){o=!1;for(let a of n){if(r?.throwIfAborted(),a===t)continue;let c=ss(e.predecessors.get(a),i,s);c!==void 0&&i.get(a)!==c&&(i.set(a,c),o=!0)}}return i}function Ct(e,t,n={}){if(!e.hasNode(t))throw new TypeError(`Relationship node not found: ${t}`);if(n.maxDepth!==void 0&&(!Number.isInteger(n.maxDepth)||n.maxDepth<0))throw new TypeError(`Invalid maxDepth bound: ${String(n.maxDepth)}`);let s=es(e,t,n),r=ts(s,t),i=new Map(r.map((d,u)=>[d,u])),o=rs(s,t,r,i,n.signal),a=new Map(r.map(d=>[d,1]));for(let d=r.length-1;d>=0;d-=1){let u=r[d];if(u===t)continue;let l=o.get(u);a.set(l,a.get(l)+a.get(u))}let c=r.filter(d=>d!==t).map(d=>({id:d,idom:o.get(d),dominatedCount:a.get(d)-1})).sort((d,u)=>u.dominatedCount-d.dominatedCount||d.id.localeCompare(u.id));return{value:{root:t,reachableCount:s.order.length,rows:c},meta:{visitedNodes:s.order.length,inspectedEdges:s.inspectedEdges,truncated:s.truncated}}}(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]="76fa19c7-a421-5026-8de8-450285987c4e")}catch{}})();var is=25,Lt={error:0,warning:1,info:2};function Pe(e,t,n,s,r,i,o){let a=[...r].sort((c,d)=>c.localeCompare(d));return{code:e,severity:t,policy:n,message:s(a.length),count:a.length,sample:a.slice(0,i),sample_truncated:a.length>i,remediation:o}}function os(e){let t=e.graph.registry(),n=new Map;for(let s of e.graph.edges()){let r=t.require(s.kind);if(!r.ordering)continue;let[i,o]=(r.precedence??"source_before_target")==="target_before_source"?[s.target,s.source]:[s.source,s.target],a=n.get(i);a?a.push(o):n.set(i,[o])}for(let s of n.values())s.sort((r,i)=>r.localeCompare(i));return n}function Ot(e,t){t.indexes.set(e,t.nextIndex),t.lowLinks.set(e,t.nextIndex),t.nextIndex+=1,t.stack.push(e),t.onStack.add(e)}function as(e,t,n,s){let r=n.get(e.node)??[];if(e.neighborIndex>=r.length)return!1;let i=r[e.neighborIndex];return e.neighborIndex+=1,s.indexes.has(i)?s.onStack.has(i)&&s.lowLinks.set(e.node,Math.min(s.lowLinks.get(e.node),s.indexes.get(i))):(Ot(i,s),t.push({node:i,neighborIndex:0})),!0}function cs(e,t,n,s){t.pop();let r=t.at(-1);if(r&&s.lowLinks.set(r.node,Math.min(s.lowLinks.get(r.node),s.lowLinks.get(e.node))),s.lowLinks.get(e.node)!==s.indexes.get(e.node))return;let i=[];for(;;){let o=s.stack.pop();if(s.onStack.delete(o),i.push(o),o===e.node)break}(i.length>1||i.length===1&&n.get(i[0])?.includes(i[0]))&&s.components.push(i.sort((o,a)=>o.localeCompare(a)))}function Fe(e){let t={indexes:new Map,lowLinks:new Map,onStack:new Set,stack:[],components:[],nextIndex:0},n=[...e.keys()].sort((s,r)=>s.localeCompare(r));for(let s of n){if(t.indexes.has(s))continue;let r=[{node:s,neighborIndex:0}];for(Ot(s,t);r.length>0;){let i=r.at(-1);as(i,r,e,t)||cs(i,r,e,t)}}return t.components.sort((s,r)=>s[0].localeCompare(r[0]))}function $e(e){return`${e.holder_id} -> ${e.target_id} (${e.kind})`}function E(e,t,n,s,r,i,o,a){t.length!==0&&e.push(Pe(s,r,i,o,t,n,a))}function ds(e,t,n){let s=[],r=[...e.dangling.active,...e.dangling.legacy_terminal].filter(i=>!i.no_active_blocker_sentinel);return E(s,r.filter(i=>!t(i.holder_status)).map($e),n,"missing_reference_active","error","Active items must not reference absent targets; missing prerequisites distort scheduling.",i=>`${i} active dangling reference(s) to absent items`,"Restore or re-create the referenced item, or remove/retype the reference on the holder."),E(s,r.filter(i=>t(i.holder_status)).map($e),n,"missing_reference_terminal","info","Terminal items may retain historical references, but absent targets remain unexplainable context.",i=>`${i} terminal dangling reference(s) to absent items`,"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch."),E(s,e.dangling.no_active_blocker_sentinels.map($e),n,"legacy_no_blocker_sentinel","info","The pre-structured-dependency no-active-blocker sentinel is retired; real edges carry blocker state.",i=>`${i} legacy no-active-blocker sentinel reference(s)`,"Delete the sentinel reference; blocker state is derived from blocked_by edges."),s}function je(e,t){let n=t.get(e);return n?!n.terminal:!0}function us(e,t,n,s){let r=[],i=os(e);for(let c of Fe(i)){let d=c.some(u=>je(u,t));r.push(d?Pe("ordering_cycle","error","Order-bearing relationship kinds must stay acyclic; a cycle makes every member unschedulable.",u=>`execution-order cycle across ${u} item(s)`,c,s,"Remove or retype one ordering edge inside the cycle, or split the work so precedence is linear."):Pe("legacy_ordering_cycle","info","Ordering cycles between exclusively terminal items are historical contradictions with no scheduling effect.",u=>`terminal-only execution-order cycle across ${u} item(s)`,c,s,"Leave as history debt, or clean up in a dedicated changelog-safe closed-item batch; never repair closed items ad hoc."))}let o=new Map;for(let[c,d]of i)for(let u of d){let l=o.get(u);l?l.push(c):o.set(u,[c])}let a=[...t.values()].filter(c=>!c.missing&&!c.terminal&&n(c.status)&&!(o.get(c.id)??[]).some(d=>{let u=t.get(d);return u===void 0||!u.terminal})).map(c=>c.id);return E(r,a,s,"stale_lifecycle_block","warning","A blocked lifecycle status must be backed by at least one open ordering predecessor.",c=>`${c} status-blocked item(s) with no open blocker edge`,'Add a local blocker edge, declare an external blocker with --dep "id=<external-ref>,kind=blocked_by,source_kind=external", or move the item back to an active status.'),r}function be(e){let t=e.edges.map(n=>n.kind).sort((n,s)=>n.localeCompare(s));return`${e.from} -> ${e.to} (${t.join(" + ")})`}function Ge(e){let t=e.graph.registry(),n=new Map;for(let r of e.graph.edges()){let i=t.require(r.kind);if(!me(i))continue;let o=Me(r,i);if(o.from===o.to)continue;let a=`${ye(i)}::${o.from}::${o.to}`,c=n.get(a);c?c.edges.push(r):n.set(a,{...o,edges:[r]})}let s=[...n.values()].filter(r=>r.edges.length>=2);for(let r of s)r.edges.sort((i,o)=>i.kind.localeCompare(o.kind));return s.sort((r,i)=>r.from.localeCompare(i.from)||r.to.localeCompare(i.to))}function ls(e,t,n){let s=[],r=[];for(let o of Ge(e))(je(o.from,t)||je(o.to,t)?s:r).push(be(o));let i=[];return E(i,s,n,"duplicate_edge","info","One semantic relationship should be stored once; parallel same-family spellings (reciprocal inverse pairs included) add no information and skew degree metrics.",o=>`${o} duplicated relationship(s) between active endpoints`,"Remove all but one stored spelling of the relationship; keep the canonical direction the holder declared first."),E(i,r,n,"legacy_duplicate_edge","info","Duplicated spellings between exclusively terminal items are historical noise with no scheduling effect.",o=>`${o} duplicated relationship(s) between terminal endpoints`,"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch."),i}function fs(e,t){let n=[],s=[];for(let i of e.duplicateRows??[])(i.legacy_terminal?s:n).push(`${i.holder_id} -> ${i.target_id} (${i.kind} x${i.occurrences})`);let r=[];return E(r,n,t,"duplicate_dependency_row","warning","One dependency row must be stored once per holder; identical repeated rows are a storage-layer defect invisible to the assembled graph.",i=>`${i} exactly duplicated stored dependency row(s) on active holder(s)`,"Remove the repeated rows so the dependency is stored exactly once; graph semantics are unchanged."),E(r,s,t,"legacy_duplicate_dependency_row","info","Identical repeated dependency rows on terminal holders are historical storage noise with no scheduling effect.",i=>`${i} exactly duplicated stored dependency row(s) on terminal holder(s)`,"Leave as history debt or clean up in a dedicated changelog-safe closed-item batch."),r}function ps(e,t,n,s,r){e.active+=1;let i=t.type??"(untyped)",o=e.byType.get(i);o||(o={active:0,isolated:0,degree_leq_one:0},e.byType.set(i,o)),o.active+=1,!(n>1)&&(e.degreeLeqOne+=1,o.degree_leq_one+=1,n===0&&(e.isolated+=1,o.isolated+=1),!(s.has(t.id.toLowerCase())||r.has(i.toLowerCase()))&&(n===0?e.isolates.push(t.id):e.sparse.push(t.id)))}function hs(e,t,n,s,r,i){let o={active:0,missing:0,isolated:0,degreeLeqOne:0,isolates:[],sparse:[],byType:new Map};for(let u of e.graph.nodes()){let l=t.get(u);if(l){if(l.missing){o.missing+=1;continue}l.terminal||ps(o,l,e.graph.incidentEdges(u).length,n,s)}}let{isolates:a,sparse:c}=o,d=[];return E(d,a,r,"isolated_active_node","warning","Active work should be reachable from the graph unless explicitly declared a valid isolate.",u=>`${u} active item(s) with no relationships`,"Link the item to its parent, prerequisite, or origin \u2014 or register it as an exempt isolate."),E(d,c,r,"sparse_active_node","info","Active items with a single edge often miss an honest semantic partner; sparse is not automatically defective.",u=>`${u} active item(s) with exactly one relationship`,"Investigate for an honest second edge (story->task, defect family, cross-epic complement); do not fabricate one."),{findings:d,profile:{nodes:e.graph.nodes().length,edges:e.graph.edges().length,edge_basis:"deduplicated_directed",edges_by_kind:Object.fromEntries(Object.entries(i).sort(([u],[l])=>u.localeCompare(l))),active_nodes:o.active,missing_nodes:o.missing,isolated_active_nodes:o.isolated,degree_leq_one_active_nodes:o.degreeLeqOne,coverage_by_type:Object.fromEntries([...o.byType.entries()].sort(([u],[l])=>u<l?-1:1))}}}function _e(e,t={}){let n=t.isTerminal??(l=>l==="closed"||l==="canceled"),s=t.isBlocked??(l=>l==="blocked"),r=t.maxSampleSize??is;if(!Number.isInteger(r)||r<1)throw new TypeError(`Invalid audit sample bound: ${String(t.maxSampleSize)}`);let i=new Set((t.exemptIsolates??[]).filter(l=>typeof l=="string").map(l=>l.trim().toLowerCase())),o=new Set((t.isolateExemptTypes??[]).filter(l=>typeof l=="string").map(l=>l.trim().toLowerCase())),a=new Map(e.details.map(l=>[l.id,{id:l.id,status:l.status,missing:e.missingIdSet.has(l.id.toLowerCase()),terminal:n(l.status),...l.type===void 0?{}:{type:l.type}}]));t.signal?.throwIfAborted();let c={};for(let l of e.graph.edges())c[l.kind]=(c[l.kind]??0)+1;let d=ds(e,n,r);t.signal?.throwIfAborted(),d.push(...us(e,a,s,r)),t.signal?.throwIfAborted(),d.push(...ls(e,a,r),...fs(e,r)),t.signal?.throwIfAborted();let u=hs(e,a,i,o,r,c);return d.push(...u.findings),d.sort((l,f)=>Lt[l.severity]-Lt[f.severity]||l.code.localeCompare(f.code)||l.sample[0].localeCompare(f.sample[0])),{findings:d,profile:u.profile}}function At(e,t){let n=[...new Set([...Object.keys(e),...Object.keys(t)])].sort(),s={};for(let r of n){let i=(t[r]??0)-(e[r]??0);i!==0&&(s[r]=i)}return s}function Nt(e){return e.profile.coverage_by_type??{}}function Mt(e,t){let n={},s=Nt(e),r=Nt(t),i=[...new Set([...Object.keys(s),...Object.keys(r)])].sort();for(let o of i){let a=s[o],c=r[o],d={active:(c?.active??0)-(a?.active??0),isolated:(c?.isolated??0)-(a?.isolated??0),degree_leq_one:(c?.degree_leq_one??0)-(a?.degree_leq_one??0)};Object.values(d).some(u=>u!==0)&&(n[o]=d)}return{baseline_saved_at:e.saved_at,same_snapshot:e.fingerprint===t.fingerprint,affected_subjects_by_code:At(e.affected_subjects_by_code,t.affected_subjects_by_code),profile:{nodes:t.profile.nodes-e.profile.nodes,edges:t.profile.edges-e.profile.edges,active_nodes:t.profile.active_nodes-e.profile.active_nodes,missing_nodes:t.profile.missing_nodes-e.profile.missing_nodes,isolated_active_nodes:t.profile.isolated_active_nodes-e.profile.isolated_active_nodes,degree_leq_one_active_nodes:t.profile.degree_leq_one_active_nodes-e.profile.degree_leq_one_active_nodes,edges_by_kind:At(e.profile.edges_by_kind,t.profile.edges_by_kind),coverage_by_type: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]="4198a3b2-2541-50eb-bec5-93ac58601f40")}catch{}})();function $t(e){return[...e].sort().join("\0")}function gs(e,t,n){let s=e.successors.get(t);s?s.push(n):e.successors.set(t,[n]);let r=e.predecessors.get(n);r?r.push(t):e.predecessors.set(n,[t])}function Pt(e,t,n,s,r){let i=t.resolve(r);if(i?.ordering!==!0)return;let o=ut(s),a=o===void 0?void 0:e.canonicalIds.get(o.toLowerCase());if(a===void 0)return;let c=(i.precedence??"source_before_target")==="source_before_target";gs(e,c?n:a,c?a:n)}function ms(e,t){let n={successors:new Map,predecessors:new Map,canonicalIds:new Map},s=e.filter(r=>typeof r?.id=="string"&&r.id.trim().length>0);for(let r of s){let i=r.id.trim();n.canonicalIds.set(i.toLowerCase(),i)}for(let r of s){let i=r.id.trim();Pt(n,t,i,r.blocked_by,"blocked_by");for(let o of r.dependencies??[])typeof o!="object"||o===null||Pt(n,t,i,o.id,typeof o.kind=="string"?o.kind:"related")}for(let r of[n.successors,n.predecessors])for(let i of r.values())i.sort();return n}function ys(e,t){let n=new Set([t]),s=[t];for(;s.length>0;){let r=s.pop();for(let i of[e.successors,e.predecessors])for(let o of i.get(r)??[])n.has(o)||(n.add(o),s.push(o))}return n}function ws(e,t){let n=new Map;for(let s of t){let r=(e.successors.get(s)??[]).filter(i=>t.has(i));r.length>0&&n.set(s,r)}return n}function jt(e,t,n){let s=ms(e,t),r=s.canonicalIds.get(n.trim().toLowerCase());if(r===void 0)return{cycles:[],successors:new Map,canonical:n};let i=ws(s,ys(s,r));return{cycles:Fe(i).filter(o=>o.includes(r)),successors:i,canonical:r}}function bs(e,t,n){let s=new Set(t),r=s.has(n)?n:t[0];if(e.get(r)?.includes(r))return[r,r];for(let i of e.get(r)??[]){if(!s.has(i))continue;let o=_s(e,s,r,i);if(o)return o}return[...t,t[0]]}function _s(e,t,n,s){let r=[[s]],i=new Set([n,s]);for(;r.length>0;){let o=r.shift(),a=o.at(-1);for(let c of e.get(a)??[]){if(c===n)return[n,...o,n];!t.has(c)||i.has(c)||(i.add(c),r.push([...o,c]))}}}function ci(e,t,n){let s=A(),r=jt(e,s,n),i=jt(t,s,n),o=new Set(r.cycles.map($t));return i.cycles.filter(a=>!o.has($t(a))).map(a=>`ordering_cycle_created:${bs(i.successors,a,i.canonical).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`)}import{createHash as vs}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dea35fb9-9f9f-56ce-afc0-f4dc993012c3")}catch{}})();var ks=64,xs=8;function Es(e,t){let n=(e.dependencies??[]).map(s=>{if(typeof s!="object"||s===null)return"";let r=s;return`${typeof r.kind=="string"?r.kind:"related"}:${typeof r.id=="string"?r.id:""}`}).sort().join(",");return[e.id,e.title,e.status,t(e.status)?"1":"0",typeof e.type=="string"?e.type.trim():"",e.parent??"",e.blocked_by??"",n].join("\0")}function ve(e,t=s=>s==="closed"||s==="canceled",n=k()){let s=e.filter(i=>typeof i?.id=="string"&&i.id.trim().length>0).map(i=>Es(i,t)).sort(),r=n.list().map(i=>j(i)).sort();return vs("sha256").update(s.join("")).update("").update(r.join("")).digest("hex")}function Ft(e,t,n){let s=t??n;if(!Number.isInteger(s)||s<1)throw new TypeError(`Invalid ${e} bound: ${String(t)}`);return s}var Be=class{#e=new Map;#n;#s;constructor(t={}){this.#n=Ft("maxResultsPerWorkspace",t.maxResultsPerWorkspace,ks),this.#s=Ft("maxWorkspaces",t.maxWorkspaces,xs)}lookup(t,n,s){let r=this.#e.get(t),i=!0;(r===void 0||r.fingerprint!==n)&&(r={fingerprint:n,assembly:s(),results:new Map},i=!1,!this.#e.has(t)&&this.#e.size>=this.#s&&this.#e.delete(this.#e.keys().next().value)),this.#e.delete(t),this.#e.set(t,r);let o=r,a=this.#n;return{assembly:o.assembly,assemblyReused:i,fingerprint:n,memoize(c,d){let u=o.results.get(c);if(u!==void 0||o.results.has(c))return o.results.delete(c),o.results.set(c,u),{value:structuredClone(u),reused:!0};let l=d();return o.results.size>=a&&o.results.delete(o.results.keys().next().value),o.results.set(c,structuredClone(l)),{value:l,reused:!1}}}}clear(){this.#e.clear()}},Gt=new Be;function ke(){return Gt}function pi(){Gt.clear()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="31a800f7-1374-5e7c-ad23-ae3d8ebcebe0")}catch{}})();var Is=["prerequisite","dependent","ancestor","descendant","provenance","related"],Ts=new TextEncoder;function qe(e,t,n){let s=e??t;if(!Number.isInteger(s)||s<1)throw new TypeError(`Relationship context ${n} must be positive`);return s}function xe(e){return Math.max(1,Math.ceil(Ts.encode(JSON.stringify(e)).byteLength/4))}function ze(e,t,n){let s=n.resolve(e.kind);if(s?.ordering){let i=(s.precedence??"source_before_target")==="source_before_target"?e.source:e.target;return t===i?"prerequisite":"dependent"}if(s?.hierarchy){let i=(s.hierarchyDirection??"source_parent")==="source_parent"?e.source:e.target;return t===i?"ancestor":"descendant"}return e.kind==="discovered_from"||e.kind==="incident_from"?"provenance":"related"}function Ss(e,t,n,s){let r=e.filter(i=>i.source===t&&i.target===n||i.target===t&&i.source===n).map(i=>ze(i,n,s));return[...new Set(r)].sort()}function Rs(e){return Is.find(t=>e.includes(t))}function Ds(e,t,n,s){let r=s.direction??"both",i=s.maxDepth??3;if(!Number.isInteger(i)||i<0)throw new TypeError("Relationship context maxDepth must be non-negative");let o=new Set([t]),a=[{id:t,distance:0}],c=[],d=0,u=!1;for(let l=0;l<a.length;l+=1){s.signal?.throwIfAborted();let f=a[l];if(f.distance>=i&&u)continue;let p=e.neighborEdges(f.id,{direction:r,kinds:s.kinds,signal:s.signal});if(d+=p.meta.inspectedEdges,f.distance>=i){p.value.some(h=>!o.has(h.id))&&(u=!0);continue}for(let{id:h,edge:g}of p.value){if(o.has(h))continue;o.add(h);let m={id:h,distance:f.distance+1,via:f.id,role:ze(g,h,n)};c.push(m),a.push(m)}}return c.sort((l,f)=>l.distance-f.distance||l.id.localeCompare(f.id)),{rows:c,visitedNodes:a.length,inspectedEdges:d,depthTruncated:u}}function Cs(e,t,n,s){let r={prerequisite:0,dependent:0,ancestor:0,descendant:0,provenance:0,related:0},i=e.neighborEdges(t,{direction:s.direction??"both",kinds:s.kinds,signal:s.signal}).value;for(let{id:o,edge:a}of i)r[ze(a,o,n)]+=1;return{directEdges:r,directTotal:i.length,rootEdges:i.map(({edge:o})=>o)}}function Ls(e){let t=[],n=e.initialTokens;for(let s of e.candidates){if(t.length>=e.nodeLimit)break;let r=s.distance===1?Ss(e.rootEdges,e.rootId,s.id,e.registry):[],i={...e.details.get(s.id)??{id:s.id},distance:s.distance,role:r.length>0?Rs(r):s.role,via:s.via,reasons:r.length>0?r:[`${s.role} via ${s.via} (depth ${s.distance})`]},o=xe(i);if(n+o>e.tokenBudget)break;t.push(i),n+=o}if(e.candidates.length>0&&t.length===0)throw new TypeError("Relationship context tokenBudget cannot fit one node");return{nodes:t,usedTokens:n}}function As(e){let t=e.options.kinds?new Set(e.options.kinds.map(i=>e.registry.require(i).kind)):void 0,n=e.graph.edges().filter(i=>{if(!e.included.has(i.source)||!e.included.has(i.target))return!1;if(t===void 0||t.has(i.kind))return!0;let o=e.registry.resolve(i.kind)?.inverse;return o!==void 0&&t.has(o)}),s=[],r=e.initialTokens;for(let i of n){if(s.length>=e.edgeLimit)break;let o=xe(i);if(r+o>e.tokenBudget)break;s.push(i),r+=o}return{edges:s,usedTokens:r,candidateCount:n.length}}function Bt(e,t,n,s={}){if(!e.nodes().includes(t))throw new TypeError(`Relationship node not found: ${t}`);let r=qe(s.nodeLimit,20,"nodeLimit"),i=qe(s.edgeLimit,40,"edgeLimit"),o=qe(s.tokenBudget,1200,"tokenBudget"),a=s.registry??k(),c=new Map(n.map(C=>[C.id,C])),d=c.get(t)??{id:t},{evidence:u=[],...l}=d,f=[...u],p=Ds(e,t,a,s),{rootEdges:h,...g}=Cs(e,t,a,s),m=L("relationship-context",{rootId:t,direction:s.direction??"both",kinds:[...s.kinds??[]].sort(),maxDepth:s.maxDepth??3}),b=ot(p.rows,s.cursor,m,({id:C})=>C),x=p.rows.slice(b),_=xe(l)+xe(f);if(_>o)throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");let R=Ls({candidates:x,details:c,rootEdges:h,rootId:t,registry:a,nodeLimit:r,tokenBudget:o,initialTokens:_}),{nodes:v}=R,U=new Set([t,...v.map(({id:C})=>C)]),O=As({graph:e,included:U,options:s,registry:a,edgeLimit:i,tokenBudget:o,initialTokens:R.usedTokens}),{edges:M,usedTokens:gn}=O,V=b+v.length,Ie=V<p.rows.length,tt=v.at(-1),Te=O.candidateCount-M.length,nt=p.depthTruncated||Ie||Te>0,mn={rootId:t,...l.status===void 0?{}:{rootStatus:l.status},...g,discoveredNodes:p.rows.length,returnedNodes:v.length,returnedEdges:M.length,omittedNodes:p.rows.length-V,omittedEdges:Te,evidenceCount:f.length,hasMore:Ie};return{root:l,summary:mn,nodes:v,edges:M,evidence:f,meta:{exact:!0,truncated:nt,completeness:nt?"truncated":"complete",nodeLimit:r,edgeLimit:i,tokenBudget:o,usedTokens:gn,visitedNodes:p.visitedNodes,inspectedEdges:p.inspectedEdges,omittedNodes:p.rows.length-V,omittedEdges:Te,...Ie&&tt?{nextCursor:ee(m,tt.id,V-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]="348c9246-2fb9-529e-b627-f60c901a6cf2")}catch{}})();function qt(e){return Math.round(e*1e6)/1e6}function zt(e,t,n){let s=e.get(t);s===void 0?e.set(t,new Set([n])):s.add(n)}function Ut(e,t){let n=new Map(e.nodes().map(r=>[r,new Set]));ge(e,t,r=>{n.get(r.source).add(r.target),n.get(r.target).add(r.source)});let s=new Map;for(let[r,i]of n)s.set(r,[...i].sort());return s}function Ns(e,t){let n=new Map,s=new Map;return ge(e,t,(r,i)=>{if(!i.ordering)return;let{predecessor:o,successor:a}=fe(r,i);zt(s,o,a),zt(n,a,o)}),{incoming:n,outgoing:s}}function Os(e,t,n){let s=new Map([[e,0]]),r=new Map([[e,1]]),i=new Map,o=[],a=[e],c=0,d=0;for(let u=0;u<a.length;u+=1){let l=a[u];n.visitedNodes+=1,o.push(l);let f=s.get(l);l!==e&&(c+=1,d+=f);for(let p of t.get(l))if(n.inspectedEdges+=1,s.has(p)||(s.set(p,f+1),a.push(p)),s.get(p)===f+1){r.set(p,(r.get(p)??0)+r.get(l));let h=i.get(p);h===void 0?i.set(p,[l]):h.push(l)}}return{stack:o,sigma:r,predecessors:i,reachableCount:c,distanceSum:d}}function Ms(e,t,n){let s=new Map;for(let r=e.stack.length-1;r>=0;r-=1){let i=e.stack[r],o=(1+(s.get(i)??0))/e.sigma.get(i);for(let a of e.predecessors.get(i)??[])s.set(a,(s.get(a)??0)+e.sigma.get(a)*o);i!==t&&n.set(i,(n.get(i)??0)+(s.get(i)??0))}}function $s(e,t){return t<=1||e.reachableCount===0?0:e.reachableCount/(t-1)*(e.reachableCount/e.distanceSum)}function Ps(e,t,n,s,r){return{id:e,degree:t.get(e).length,inDegree:n.incoming.get(e)?.size??0,outDegree:n.outgoing.get(e)?.size??0,betweenness:qt((s.get(e)??0)/2),closeness:qt(r.get(e))}}function Vt(e,t={}){let n=Ut(e,t.kinds),s=Ns(e,t.kinds),r=e.nodes(),i=new Map,o=new Map,a={visitedNodes:0,inspectedEdges:0};for(let u of r){t.signal?.throwIfAborted();let l=Os(u,n,a);o.set(u,$s(l,r.length)),Ms(l,u,i)}let c=0;for(let u of n.values())c+=u.length;let d=r.map(u=>Ps(u,n,s,i,o)).sort((u,l)=>l.betweenness-u.betweenness||l.degree-u.degree||u.id.localeCompare(l.id));return{value:{nodeCount:r.length,edgeCount:c/2,rows:d},meta:{visitedNodes:a.visitedNodes,inspectedEdges:a.inspectedEdges,truncated:!1}}}function js(e,t){return e<=t?{source:e,target:t}:{source:t,target:e}}function Fs(e,t,n){let r=t.get(e.node)[e.neighborIndex];if(e.neighborIndex+=1,n.inspectedEdges+=1,r!==e.parent){if(n.discovery.has(r)){n.low.set(e.node,Math.min(n.low.get(e.node),n.discovery.get(r)));return}return e.children+=1,n.discovery.set(r,n.timer),n.low.set(r,n.timer),n.timer+=1,{node:r,parent:e.node,neighborIndex:0,children:0}}}function Gs(e,t,n){if(e.parent===null){e.children>1&&n.articulation.add(e.node);return}let s=e.parent,r=n.low.get(e.node);n.low.set(s,Math.min(n.low.get(s),r)),s!==t&&r>=n.discovery.get(s)&&n.articulation.add(s),r>n.discovery.get(s)&&n.bridges.push(js(s,e.node))}function Bs(e,t,n,s){n.discovery.set(e,n.timer),n.low.set(e,n.timer),n.timer+=1;let r=[{node:e,parent:null,neighborIndex:0,children:0}];for(;r.length>0;){s?.throwIfAborted();let i=r.at(-1);if(i.neighborIndex<t.get(i.node).length){let o=Fs(i,t,n);o!==void 0&&r.push(o)}else Gs(i,e,n),r.pop()}}function Kt(e,t={}){let n=Ut(e,t.kinds),s={discovery:new Map,low:new Map,timer:0,articulation:new Set,bridges:[],inspectedEdges:0};for(let r of e.nodes())s.discovery.has(r)||Bs(r,n,s,t.signal);return{value:{articulationPoints:[...s.articulation].sort(),bridges:s.bridges.sort((r,i)=>r.source.localeCompare(i.source)||r.target.localeCompare(i.target))},meta:{visitedNodes:s.discovery.size,inspectedEdges:s.inspectedEdges,truncated:!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]="f155ac72-64eb-5316-b016-954abd48c0e7")}catch{}})();function qs(e){let t=e.registry(),n=new Map,s=new Set;for(let r of e.edges()){let i=t.require(r.kind);if(!i.ordering)continue;let{predecessor:o,successor:a}=fe(r,i);if(s.add(o),s.add(a),o===a)continue;let c=n.get(o);c===void 0?n.set(o,new Set([a])):c.add(a)}return{forward:n,participants:s}}function zs(e,t,n,s){if(e===void 0)return s;let r=s;for(let i of e)t.has(i)&&(r=Math.min(r,n.get(i)));return r}function Us(e,t,n){let s=n-t;return{id:e,earliestStart:t,earliestFinish:t+1,latestStart:n,latestFinish:n+1,slack:s,critical:s===0}}function Vs(e,t,n,s,r){let i=new Map;for(let o=e.length-1;o>=0;o-=1){let a=e[o],c=zs(t.forward.get(a),s,i,r);i.set(a,c-1)}return e.map(o=>Us(o,n[o],i.get(o))).sort((o,a)=>o.slack-a.slack||o.earliestStart-a.earliestStart||o.id.localeCompare(a.id))}function Wt(e,t={}){t.signal?.throwIfAborted();let n=ue(e,{registry:e.registry()}),s=qs(e),r=new Set(n.order),i=n.order.filter(d=>s.participants.has(d)),o=i.reduce((d,u)=>Math.max(d,n.depth[u]+1),0),a=Vs(i,s,n.depth,r,o),c=a.length>0;return{exact:!0,acyclic:n.acyclic,makespan:o,scheduledCount:a.length,criticalPath:c?n.criticalPath:[],criticalPathLength:c?n.criticalPathLength:0,cycles:n.cycles,rows:a,provenance:{algorithm:"critical-path-method",edgeFamily:"ordering",weighting:"unit"}}}import Jt 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]="ee260dcf-f4df-5997-a8d7-691c19c66a41")}catch{}})();var Xt=1,Ue=500,Ks=64,Ws="graph-durable-cache";function Yt(e){return ne(e,Ws,30,`graph-cache:${process.pid}`,!1,!1,3e3)}function z(e){return Jt.join(e,"runtime","graph-cache.json")}function Qt(e){return Jt.join(e,"runtime","graph-audit-baseline.json")}function Ve(e){if(e!==null)try{let t=JSON.parse(e);return typeof t!="object"||t===null||t.version!==Xt||typeof t.fingerprint!="string"||typeof t.saved_at!="string"||typeof t.results!="object"||t.results===null||Array.isArray(t.results)?void 0:t}catch{return}}async function Ke(e,t){let n=await $(z(e)),s=Ve(n),r=s?.fingerprint===t;return{exists:n!==null,fresh:r,results:r?s.results:{}}}async function We(e,t,n,s,r){let i=await Yt(e);try{let o=Ve(await $(z(e))),a=o?.fingerprint===t?o.results:{};delete a[s],a[s]=r;let c=Object.keys(a);for(let d of c.slice(0,Math.max(0,c.length-Ks)))delete a[d];await P(z(e),JSON.stringify({version:Xt,fingerprint:t,saved_at:new Date().toISOString(),results:a})),n.results=a}finally{await i()}}async function He(e){let t=await Yt(e);try{await st(z(e))}finally{await t()}}async function Zt(e,t){let n=z(e),s=await $(n),r=Ve(s);return r===void 0?{exists:s!==null,fresh:!1,entry_count:0}:{exists:!0,fresh:r.fingerprint===t,entry_count:Object.keys(r.results).length,fingerprint:r.fingerprint.slice(0,12),saved_at:r.saved_at,bytes:Buffer.byteLength(s,"utf8")}}function Je(e,t){return t||e>=Ue}function Ht(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.values(e).every(t=>Number.isInteger(t)&&t>=0)}function Hs(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.values(e).every(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)&&[t.active,t.isolated,t.degree_leq_one].every(n=>Number.isInteger(n)&&n>=0))}function Js(e){if(e!==null)try{let t=JSON.parse(e);if(typeof t!="object"||t===null)return;let n=t,s=n.profile;return typeof n.saved_at!="string"||typeof n.fingerprint!="string"||!Ht(n.affected_subjects_by_code)||typeof s!="object"||s===null||![s.nodes,s.edges,s.active_nodes,s.missing_nodes,s.isolated_active_nodes,s.degree_leq_one_active_nodes].every(r=>Number.isInteger(r)&&r>=0)||!Ht(s.edges_by_kind)||s.coverage_by_type!==void 0&&!Hs(s.coverage_by_type)?void 0:{...n,profile:{...s,coverage_by_type:s.coverage_by_type??{}}}}catch{return}}async function en(e){return Js(await $(Qt(e)))}async function tn(e,t){await P(Qt(e),JSON.stringify(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]="9b8e22ad-6268-515d-994e-6b98a062ba93")}catch{}})();var Xs={missing_reference_active:{op:"investigate",confidence:"medium",rationale:"Restore or re-create the referenced item, or remove/retype the reference on the active holder; the correct fix depends on why the target is absent."},missing_reference_terminal:{op:"waive",confidence:"high",rationale:"Terminal-holder reference to an absent item is historical debt; waive it or clean it up only in a dedicated changelog-safe closed-item batch."},legacy_no_blocker_sentinel:{op:"remove",confidence:"high",rationale:"The pre-structured-dependency no-active-blocker sentinel is retired and carries no information; blocker state derives from blocked_by edges."},ordering_cycle:{op:"investigate",confidence:"low",rationale:"Every cycle member is unschedulable until one ordering edge is removed or retyped; the planner never chooses which edge to cut."},legacy_ordering_cycle:{op:"waive",confidence:"high",rationale:"Terminal-only ordering cycles have no scheduling effect; repairing them would mutate closed history (changelog drag)."},duplicate_edge:{op:"remove",confidence:"high",rationale:"Parallel same-family spellings state one relationship twice; remove all but one stored spelling, keeping the holder's canonical direction."},legacy_duplicate_edge:{op:"waive",confidence:"high",rationale:"Duplicated spellings between terminal items are historical noise; waive or batch changelog-safe cleanup."},duplicate_dependency_row:{op:"remove",confidence:"high",rationale:"The identical dependency row is stored more than once on the holder; drop the repeats so the row exists exactly once \u2014 graph semantics are unchanged."},legacy_duplicate_dependency_row:{op:"waive",confidence:"high",rationale:"Repeated identical rows on terminal holders are storage noise; waive or clean up only in a changelog-safe closed-item batch."},stale_lifecycle_block:{op:"investigate",confidence:"medium",rationale:`Add a local ordering edge, declare an external blocker with --dep "id=<external-ref>,kind=blocked_by,source_kind=external", or move the item back to an active status; only the holder's owner knows which is true.`},isolated_active_node:{op:"investigate",confidence:"medium",rationale:"Link the item to its parent, prerequisite, or origin \u2014 or register it as an explicitly exempt isolate; the audit never fabricates an edge."},sparse_active_node:{op:"investigate",confidence:"low",rationale:"Investigate for an honest second edge (story-to-task, defect family, cross-epic complement); sparse is not automatically defective."}};function nn(e){return`${e.source} -${e.kind}-> ${e.target}`}function Ys(e){let[t,...n]=e.edges;return n.map(s=>({op:"remove",code:"duplicate_edge",subject:nn(s),rationale:"This stored spelling restates the kept canonical edge of the same semantic family; removing it leaves the relationship stated exactly once.",evidence:[`keep: ${nn(t)}`,`group: ${be(e)}`],confidence:"high"}))}function Qs(e,t){if(e.code==="duplicate_edge")return e.sample.flatMap(s=>Ys(t.get(s)));let n=Xs[e.code];return e.sample.map(s=>({op:n.op,code:e.code,subject:s,rationale:n.rationale,evidence:[e.policy],confidence:n.confidence}))}function sn(e,t={}){let{redundancyLimit:n,...s}=t,r=_e(e,s),i=new Map(Ge(e).map(d=>[be(d),d])),o=r.findings.flatMap(d=>Qs(d,i)),a=r.findings.some(d=>d.sample_truncated);t.signal?.throwIfAborted();let c=we(e.graph,{limit:n??t.maxSampleSize??25,...t.signal===void 0?{}:{signal:t.signal}});for(let d of c.value)o.push({op:"remove",code:"redundant_edge",subject:`${d.edge.source} -> ${d.edge.target} (${d.edge.kind})`,rationale:"The stored edge is implied by a longer same-family witness path; shortcut edges are sometimes deliberate emphasis, so confirm intent before removing.",evidence:[`witness: ${d.witness.join(" -> ")}`],confidence:"medium"});return a=a||c.meta.truncated,{steps:o,report:r,truncated:a,cost:{visitedNodes:c.meta.visitedNodes,inspectedEdges:c.meta.inspectedEdges}}}(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]="a3535267-c69a-5a44-bdf9-02925e02aaeb")}catch{}})();var Zs=["tree","graph","context"],er=["none","repeated"],tr=["outgoing","incoming","both"],nr=32,sr=200,rr=400,ir=16e3;function or(e){let t=e?.trim().toLowerCase()??"tree";if(Zs.includes(t))return t;throw new w(`Invalid --format value "${e}". Use "tree", "graph", or "context".`,y.USAGE)}function I(e,t){if(e===void 0)return;let n=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(n)||n<1)throw new w(`Invalid --${t} value "${e}". Use a positive integer.`,y.USAGE);return n}function Ee(e){if(e===void 0)return;let t=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(t)||t<0)throw new w(`Invalid --max-depth value "${e}". Use a non-negative integer.`,y.USAGE);return t}function ar(e){let t=e?.trim().toLowerCase()??"none";if(er.includes(t))return t;throw new w(`Invalid --collapse value "${e}". Use "none" or "repeated".`,y.USAGE)}function Ye(e){let t=e?.trim().toLowerCase()??"both";if(tr.includes(t))return t;throw new w(`Invalid --direction value "${e}". Use "outgoing", "incoming", or "both".`,y.USAGE)}function Qe(e,t=k()){if(e===void 0)return;let n=(Array.isArray(e)?e:[e]).flatMap(r=>r.split(",")).map(r=>r.trim()).filter(r=>r.length>0);if(n.length===0)return;let s=new Set;for(let r of n){let i=t.resolve(r);if(!i){let o=t.list().map(a=>a.kind).join(", ");throw new w(`Invalid --kind value "${r}". Registered kinds: ${o}.`,y.USAGE)}s.add(i.kind)}return[...s].sort()}function cr(e){if(!e||e.length===0)return[];let t=e.map(({id:s,kind:r})=>({id:s.trim(),kind:r.trim().toLowerCase()})).sort((s,r)=>{let i=s.kind.localeCompare(r.kind);return i!==0?i:s.id.localeCompare(r.id)}),n=new Map;for(let s of t){let r=`${s.kind.toLowerCase()}::${s.id.toLowerCase()}`;n.has(r)||n.set(r,{id:s.id,kind:s.kind})}return[...n.values()]}function dr(e){return{id:e.id,title:e.title,type:e.type,status:e.status,dependencies:cr(e.dependencies)}}function ur(e){return Q(new TextEncoder().encode(JSON.stringify({...e,dependencies:void 0})).byteLength)}function lr(e,t,n,s,r,i,o,a,c){for(let d of t.dependencies){let u=Math.max(1,Math.ceil(JSON.stringify({from:e.id,to:d.id,kind:d.kind}).length/3));if(a.nodes>=a.nodeLimit){e.truncated=!0,a.reasons.add("node_limit");break}if(a.edges>=a.edgeLimit){e.truncated=!0,a.reasons.add("edge_limit");break}if(a.estimatedTokens+u>=a.tokenBudget){e.truncated=!0,a.reasons.add("token_budget");break}a.edges+=1,a.estimatedTokens+=u,e.dependencies.push(on(d.id,n,s,r,i,o,a,c+1,d.kind))}}function fr(e,t,n,s,r,i,o,a){return o.estimatedTokens>=o.tokenBudget&&t?.dependencies.length?(e.truncated=!0,o.reasons.add("token_budget"),!0):!t||e.cycle?!0:s!==void 0&&a>=s?(t.dependencies.length>0&&(e.truncated=!0,o.reasons.add("max_depth")),!0):r==="repeated"&&i.has(n)?(e.collapsed=!0,!0):!1}function on(e,t,n,s,r,i,o,a=0,c){let d=e.trim().toLowerCase(),u=t.get(d),l={id:u?.id??e,title:u?.title,type:u?.type,status:u?.status,via:c,missing:!u,cycle:n.has(d),dependencies:[]};if(o.nodes+=1,o.estimatedTokens+=ur(l),fr(l,u,d,s,r,i,o,a))return l;r==="repeated"&&i.add(d);let f=new Set(n);return f.add(d),lr(l,u,t,f,s,r,i,o,a),l}function rn(e,t){return!e||e.missing&&!t.missing?t:{...e,title:e.title??t.title,type:e.type??t.type,status:e.status??t.status}}function pr(e){let t=new Map,n=new Map,s=[e];for(;s.length>0;){let a=s.pop();t.set(a.id,rn(t.get(a.id),{id:a.id,title:a.title,type:a.type,status:a.status,missing:a.missing}));for(let c of a.dependencies){t.set(c.id,rn(t.get(c.id),{id:c.id,title:c.title,type:c.type,status:c.status,missing:c.missing}));let d=c.via??"related",u=`${a.id}::${c.id}::${d}`;n.has(u)||n.set(u,{from:a.id,to:c.id,kind:d}),c.cycle||s.push(c)}}let r=[...t.values()].sort((a,c)=>a.id.localeCompare(c.id)),i=[...n.values()].sort((a,c)=>{let d=a.from.localeCompare(c.from);if(d!==0)return d;let u=a.to.localeCompare(c.to);return u!==0?u:a.kind.localeCompare(c.kind)}),o=r.filter(a=>a.missing).map(a=>a.id);return{root_id:e.id,nodes:r,edges:i,missing_ids:o}}function an(e,t,n){let s=new Set,r=new Set,i=new Set,o=new Set,a=[{id:e,depth:0}],c=0;for(;c<a.length;){let d=a[c++],u=d.id.trim().toLowerCase();s.add(u);let l=t.get(u);if(!l){i.add(u);continue}if(!(n!==void 0&&d.depth>=n)&&!o.has(u)){o.add(u);for(let f of l.dependencies)r.add(`${u}::${f.id.trim().toLowerCase()}::${f.kind}`),a.push({id:f.id,depth:d.depth+1})}}return{node_count:s.size,edge_count:r.size,edge_basis:"deduplicated_directed",missing_count:i.size}}function hr(e,t=k()){let n=Ee(e.maxDepth),s=I(e.nodeLimit,"node-limit"),r=I(e.edgeLimit,"edge-limit"),i=I(e.tokenBudget,"token-budget"),o=Qe(e.kind,t);return{direction:Ye(e.direction),...o===void 0?{}:{kinds:o},...n===void 0?{}:{maxDepth:n},...s===void 0?{}:{nodeLimit:s},...r===void 0?{}:{edgeLimit:r},...i===void 0?{}:{tokenBudget:i},...e.cursor?.trim()?{cursor:e.cursor.trim()}:{}}}function gr(e,t,n,s){return Bt(e.graph,t,e.details.map(r=>r.id===t&&s.length>0?{...r,evidence:s}:r),n)}function Xe(e,t,n,s){for(let r of n.slice(0,s)){let i=r?.trim();i&&e.push(`${t}:${i}`)}}async function mr(e,t,n,s){let r=await ct(e,t,n.id_prefix,n.item_format,s);if(!r)return[];let{document:i}=await dt(r,{schema:n.schema}),o=i.metadata,a=o.files??[],c=o.tests??[],d=o.docs??[],u=[["files",a.length],["tests",c.length],["docs",d.length],["comments",(o.comments??[]).length],["notes",(o.notes??[]).length],["learnings",(o.learnings??[]).length]];if(u.every(([,f])=>f===0))return[];let l=[`linked:${u.map(([f,p])=>`${f}=${p}`).join(",")}`];return Xe(l,"file",a.map(f=>f.path),3),Xe(l,"test",c.map(f=>f.command??f.path),2),Xe(l,"doc",d.map(f=>f.path),2),l}function yr(e){let{canonicalId:t,context:n,missingCount:s,missingReferences:r,referenceLimit:i,summaryOnly:o}=e;return{id:t,format:"context",node_count:n.nodes.length+1,edge_count:n.edges.length,edge_basis:"deduplicated_directed",missing_count:s,missing_scope:"traversal",missing_reference_count:r.length,...o?{}:{missing_references:r.slice(0,i),context:n}}}function wr(e){let{row:t,missingReachableSet:n,packetIds:s,filteredKinds:r,registry:i}=e;if(t.no_active_blocker_sentinel||!n.has(t.target_id.trim().toLowerCase())||!s.has(t.holder_id))return!1;if(r===void 0)return!0;let o=i.resolve(t.kind);return o!==void 0&&(r.has(o.kind)||o.inverse!==void 0&&r.has(o.inverse))}function cn(e,t,n){let s;for(;;){let r=Q(new TextEncoder().encode(De(Re("deps",e),t)).byteLength);if(r===s)return r;n(r),s=r}}function br(e){return e instanceof TypeError&&e.message.startsWith("Relationship context tokenBudget cannot fit ")}function _r(e){try{return gr(e.assembly,e.canonicalId,{...e.contextOptions,...e.internalTokenBudget===void 0?{}:{tokenBudget:e.internalTokenBudget}},e.rootEvidence)}catch(t){if(e.smallestResult!==void 0&&br(t))return e.smallestResult;throw t}}function vr(e){let{assembly:t,canonicalId:n,contextOptions:s,rootEvidence:r,summaryOnly:i,outputFormat:o,missingCount:a,missingReferences:c}=e,u=s.edgeLimit??40,l=s.tokenBudget,f,p;for(;;){let h=_r({assembly:t,canonicalId:n,contextOptions:s,internalTokenBudget:l,rootEvidence:r,smallestResult:p});if("format"in h)return h;let g=h;f??=g.meta.tokenBudget,l??=f;let m=yr({canonicalId:n,context:g,missingCount:a,missingReferences:c,referenceLimit:u,summaryOnly:i});if(p=m,i||(g.meta.tokenBudget=f,g.meta.usedTokens=cn(N(m,!1),o,_=>{g.meta.usedTokens=_}),g.meta.usedTokens<=f))return m;if(u>0){u-=1;continue}let b=l,x=b*f/g.meta.usedTokens;l=Math.min(b-1,Math.max(1,Math.floor(x*.9)))}}function kr(e){let{assembly:t,canonicalId:n,options:s,rootEvidence:r,summaryOnly:i,outputFormat:o}=e,a=hr(s,t.graph.registry()),c=t.graph.closure(n,{direction:a.direction,...a.kinds===void 0?{}:{kinds:a.kinds},maxDepth:a.maxDepth??3}),d=c.value.filter(g=>t.missingIdSet.has(g.toLowerCase())),u=new Set(d.map(g=>g.toLowerCase())),l=t.graph.registry(),f=a.kinds?new Set(a.kinds.map(g=>l.require(g).kind)):void 0,p=new Set([n,...c.value]),h=[...t.dangling.active,...t.dangling.legacy_terminal].filter(g=>wr({row:g,missingReachableSet:u,packetIds:p,filteredKinds:f,registry:l}));return vr({assembly:t,canonicalId:n,contextOptions:a,rootEvidence:r,summaryOnly:i,outputFormat:o,missingCount:d.length,missingReferences:h})}function xr(e){let t=[e],n;for(;t.length>0;){let s=t.pop();s.dependencies.length>0&&(n=s,t.push(...s.dependencies))}return n?(n.dependencies.pop(),n.truncated=!0,!0):!1}function Er(e,t,n,s,r,i,o){let a=r??nr,c=I(n.nodeLimit,"node-limit")??sr,d=I(n.edgeLimit,"edge-limit")??rr,u=I(n.tokenBudget,"token-budget")??ir,l={nodeLimit:c,edgeLimit:d,tokenBudget:u,nodes:0,edges:0,estimatedTokens:0,reasons:new Set},f=on(e,s,new Set,a,t==="graph"?"repeated":i,new Set,l),p=an(e,s,void 0),h;for(;;){let g=pr(f),m=l.reasons.size===0?void 0:{reasons:[...l.reasons].sort(),limits:{max_depth:a,node_limit:c,edge_limit:d,token_budget:u},estimated_tokens:0,total_node_count:p.node_count,total_edge_count:p.edge_count,omitted_node_count:Math.max(0,p.node_count-g.nodes.length),omitted_edge_count:Math.max(0,p.edge_count-g.edges.length)},b={id:e,format:t,node_count:g.nodes.length,edge_count:g.edges.length,edge_basis:"deduplicated_directed",missing_count:g.missing_ids.length,...m?{truncation:m}:{}};if(h=t==="tree"?{...b,tree:f}:{...b,graph:g},(h.truncation===void 0?Q(new TextEncoder().encode(De(Re("deps",N(h,!1)),o)).byteLength):cn(N(h,!1),o,_=>{h.truncation.estimated_tokens=_}))<=u)return h;if(!xr(f))return l.reasons.add("token_budget"),h;l.reasons.add("token_budget")}}function N(e,t){let n={name:e.format==="tree"?"dependency_tree":e.format==="graph"?"dependency_graph":"relationship_context",restore_with:"--full"};return{...e,projection:{mode:t?"summary":"full",declared_field_groups:[n],included_field_groups:t?[]:[n.name]}}}async function Hi(e,t,n){let s=H(process.cwd(),n.path);if(!await K(J(s)))throw new w(`Tracker is not initialized at ${s}. Run pm init first.`,y.NOT_FOUND);let r=or(t.format),i=Ee(t.maxDepth),o=ar(t.collapse);Z(t.summary===!0,t.full===!0,"--summary");let a=t.summary===!0,c=await se(s),d=W(c,te()),u=await re(s,c.item_format,d.type_to_folder,void 0,c.schema),l=Y(c.schema),f=new Map(u.map(h=>[h.id.trim().toLowerCase(),dr(h)])),p=lt(u,h=>F(h,l));for(let h of[...p.active,...p.legacy_terminal]){let g=f.get(h.holder_id.trim().toLowerCase()),m=h.kind.trim().toLowerCase();g&&!g.dependencies.some(b=>b.id.trim().toLowerCase()===h.target_id.trim().toLowerCase()&&b.kind===m)&&g.dependencies.push({id:h.target_id,kind:m})}if(!f.has(e.trim().toLowerCase()))throw new w(`Item ${e} not found`,y.NOT_FOUND);if(r==="context"){let h=f.get(e.trim().toLowerCase()).id,g=a?[]:await mr(s,h,c,d.type_to_folder),m=_=>F(_,l),b=A(),x=ke().lookup(s,ve(u,m,b),()=>ie(u,m,b));return N(kr({assembly:x.assembly,canonicalId:h,options:t,rootEvidence:g,summaryOnly:a,outputFormat:n.json===!0?"json":"toon"}),a)}return a?N({id:e,format:r,...an(e,f,i)},!0):N(Er(e,r,t,f,i,o,n.json===!0?"json":"toon"),!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]="0fbc54bf-3321-5c73-a351-5db01aab5544")}catch{}})();var fn=new Set(["ancestors","descendants","predecessors","successors","paths","impact","dominators"]),S=10;function dn(e,t,n){return{...e,projection:{mode:t?"summary":"full",declared_field_groups:n===void 0?[]:[{name:n,restore_with:"--full"}],included_field_groups:n===void 0||t?[]:[n]}}}function un(e){return e===void 0?[]:(Array.isArray(e)?e:[e]).flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t.length>0)}function Ir(e,t,n){let s=e.trim().toLowerCase();if(!Se.includes(s))throw new w(`Invalid graph subcommand "${e}". Use one of: ${Se.join(", ")}.`,y.USAGE);let r=s;if(fn.has(r)&&!t?.trim())throw new w(`graph ${r} requires an item id.`,y.USAGE);if(r==="paths"&&!n?.trim())throw new w("graph paths requires a source and a target item id.",y.USAGE);return r}function Ze(e){throw e instanceof TypeError?new w(e.message,y.USAGE):e}function et(e){return{truncated:e.truncated,cost:{visited_nodes:e.visitedNodes,inspected_edges:e.inspectedEdges}}}function ln(e,t){let n=t.trim().toLowerCase();for(let s of e.details)if(s.id.trim().toLowerCase()===n&&!e.missingIdSet.has(s.id.toLowerCase()))return s.id;throw new w(`Item ${t} not found`,y.NOT_FOUND)}function Tr(e,t,n){let s={ancestors:xt,descendants:Et,predecessors:It,successors:Tt}[e],r;try{r=s(n.assembly.graph,t,{...n.kinds===void 0?{}:{kinds:n.kinds},...n.maxDepth===void 0?{}:{maxDepth:n.maxDepth},...n.limit===void 0?{}:{limit:n.limit},...n.after===void 0?{}:{after:n.after}})}catch(o){Ze(o)}let i=et(r.meta);return{subcommand:e,root:t,count:r.value.length,...i,...r.meta.nextCursor===void 0?{}:{next_cursor:r.meta.nextCursor},...n.summary?{}:{ids:r.value}}}function Sr(e,t,n){let s=St(n.assembly.graph,e,t,{direction:n.direction,...n.kinds===void 0?{}:{kinds:n.kinds},...n.maxDepth===void 0?{}:{maxDepth:n.maxDepth},...n.maxPaths===void 0?{}:{maxPaths:n.maxPaths}});return{subcommand:"paths",root:e,target:t,direction:n.direction,count:s.value.length,...et(s.meta),...n.summary?{}:{paths:s.value.map(r=>({nodes:r.nodes,kinds:r.edges.map(i=>i.kind),length:r.length}))}}}function Rr(e,t){let n;try{n=bt(t.assembly.graph,e,{direction:t.direction,...t.kinds===void 0?{}:{kinds:t.kinds},...t.maxDepth===void 0?{}:{maxDepth:t.maxDepth},...t.unbounded?{}:{limit:t.limit??S},...t.after===void 0?{}:{after:t.after}})}catch(s){Ze(s)}return{subcommand:"impact",root:e,direction:t.direction,count:n.affected.length,truncated:n.truncated,...n.nextCursor===void 0?{}:{next_cursor:n.nextCursor},cost:{visited_nodes:n.cost.visitedNodes,inspected_edges:n.cost.inspectedEdges},...t.summary?{}:{affected:n.affected}}}function Dr(e){let t=e.assembly.graph,n=e.limit??S,s=ue(t,{registry:t.registry()}),r=_t(t);return{subcommand:"analyze",node_count:t.nodes().length,edge_count:t.edges().length,edge_basis:"deduplicated_directed",sample_limit:n,execution:{acyclic:s.acyclic,ordered_node_count:s.order.length,layer_count:s.layers.length,frontier_count:s.frontier.length,critical_path_length:s.criticalPathLength,cycle_count:s.cycles.length,...e.summary?{}:{frontier:s.frontier.slice(0,n),critical_path:s.criticalPath.slice(0,n),cycles:s.cycles.slice(0,n)}},knowledge:{component_count:r.components.length,largest_component_size:r.components[0]?.length??0,orphan_count:r.orphans.length,...e.summary?{}:{orphans:r.orphans.slice(0,n),hubs:r.hubs.slice(0,n)}}}}function Cr(e,t){let n=_e(e.assembly,{isTerminal:t,...e.sample===void 0?{}:{maxSampleSize:e.sample},...e.exemptIsolates.length===0?{}:{exemptIsolates:e.exemptIsolates},...e.exemptIsolateTypes.length===0?{}:{isolateExemptTypes:e.exemptIsolateTypes}}),s={},r={},i={},o={};for(let a of n.findings)s[a.severity]=(s[a.severity]??0)+1,r[a.code]=(r[a.code]??0)+1,i[a.severity]=(i[a.severity]??0)+a.count,o[a.code]=(o[a.code]??0)+a.count;return{subcommand:"audit",finding_count:n.findings.length,findings_by_severity:s,findings_by_code:r,affected_subjects_by_severity:i,affected_subjects_by_code:o,profile:n.profile,...e.summary?{}:{findings:n.findings}}}function Lr(e){let t=e.limit??S,n={};e.kinds!==void 0&&(n.kinds=e.kinds);let s=Dt(e.assembly.graph,n),r=s.value;return{subcommand:"communities",community_count:r.communities.length,largest_community_size:r.communities[0]?.size??0,iterations:r.iterations,converged:r.converged,truncated:!r.converged||r.communities.length>t,cost:{visited_nodes:s.meta.visitedNodes,inspected_edges:s.meta.inspectedEdges},...e.summary?{}:{communities:r.communities.slice(0,t).map(i=>({representative:i.representative,size:i.size,members:i.members.slice(0,t)}))}}}function Ar(e){let t;try{t=we(e.assembly.graph,{...e.kinds===void 0?{}:{kinds:e.kinds},...e.maxDepth===void 0?{}:{maxDepth:e.maxDepth},...e.limit===void 0?{}:{limit:e.limit}})}catch(n){Ze(n)}return{subcommand:"redundancy",redundant_count:t.value.length,...et(t.meta),...e.summary?{}:{redundant:t.value.map(n=>({source:n.edge.source,target:n.edge.target,kind:n.edge.kind,witness:n.witness}))}}}function Nr(e,t){let n=t.limit??S,s=Ct(t.assembly.graph,e,{direction:t.direction,...t.kinds===void 0?{}:{kinds:t.kinds},...t.maxDepth===void 0?{}:{maxDepth:t.maxDepth}}),r=s.value.rows.filter(i=>i.dominatedCount>0);return{subcommand:"dominators",root:e,direction:t.direction,reachable_count:s.value.reachableCount,bottleneck_count:r.length,truncated:s.meta.truncated||r.length>n,cost:{visited_nodes:s.meta.visitedNodes,inspected_edges:s.meta.inspectedEdges},...t.summary?{}:{bottlenecks:r.slice(0,n).map(i=>({id:i.id,idom:i.idom,dominated_count:i.dominatedCount}))}}}function Or(e){let t=e.limit??S,n=Wt(e.assembly.graph),s=n.rows.filter(r=>r.critical).length;return{subcommand:"slack",acyclic:n.acyclic,makespan:n.makespan,scheduled_count:n.scheduledCount,critical_count:s,critical_path_length:n.criticalPathLength,cycle_count:n.cycles.length,truncated:n.rows.length>t,...e.summary?{}:{critical_path:n.criticalPath,rows:n.rows.slice(0,t).map(r=>({id:r.id,earliest_start:r.earliestStart,latest_start:r.latestStart,slack:r.slack,critical:r.critical}))}}}function Mr(e){let t=e.limit??S,n=Vt(e.assembly.graph,e.kinds===void 0?{}:{kinds:e.kinds}),s=n.value;return{subcommand:"centrality",node_count:s.nodeCount,edge_count:s.edgeCount,edge_basis:"simple_undirected",truncated:s.rows.length>t,cost:{visited_nodes:n.meta.visitedNodes,inspected_edges:n.meta.inspectedEdges},...e.summary?{}:{rows:s.rows.slice(0,t).map(r=>({id:r.id,degree:r.degree,in_degree:r.inDegree,out_degree:r.outDegree,betweenness:r.betweenness,closeness:r.closeness}))}}}function $r(e){let t=e.limit??S,n=Kt(e.assembly.graph,e.kinds===void 0?{}:{kinds:e.kinds}),{articulationPoints:s,bridges:r}=n.value;return{subcommand:"articulation",articulation_count:s.length,bridge_count:r.length,truncated:s.length>t||r.length>t,cost:{visited_nodes:n.meta.visitedNodes,inspected_edges:n.meta.inspectedEdges},...e.summary?{}:{articulation_points:s.slice(0,t),bridges:r.slice(0,t)}}}function Pr(e,t){let n=e.limit??S,s=sn(e.assembly,{isTerminal:t,redundancyLimit:n,...e.sample===void 0?{}:{maxSampleSize:e.sample},...e.exemptIsolates.length===0?{}:{exemptIsolates:e.exemptIsolates},...e.exemptIsolateTypes.length===0?{}:{isolateExemptTypes:e.exemptIsolateTypes}}),r={},i={};for(let o of s.steps)r[o.op]=(r[o.op]??0)+1,i[o.code]=(i[o.code]??0)+1;return{subcommand:"plan",step_count:s.steps.length,steps_by_op:r,steps_by_code:i,finding_count:s.report.findings.length,truncated:s.truncated||s.steps.length>n,cost:{visited_nodes:s.cost.visitedNodes,inspected_edges:s.cost.inspectedEdges},...e.summary?{}:{steps:s.steps.slice(0,n)}}}function pn(e,t,n,s){return JSON.stringify({subcommand:e,root:t??null,target:n??null,kinds:s.kinds??null,maxDepth:s.maxDepth??null,limit:s.limit??null,after:s.after??null,direction:s.direction,maxPaths:s.maxPaths??null,sample:s.sample??null,exemptIsolates:[...new Set(s.exemptIsolates.map(r=>r.toLowerCase()))].sort(),exemptIsolateTypes:[...new Set(s.exemptIsolateTypes.map(r=>r.toLowerCase()))].sort(),summary:s.summary,unbounded:s.unbounded})}function hn(e,t,n,s,r){return e==="analyze"?Dr(s):e==="audit"?Cr(s,r):e==="plan"?Pr(s,r):e==="communities"?Lr(s):e==="redundancy"?Ar(s):e==="dominators"?Nr(t,s):e==="slack"?Or(s):e==="centrality"?Mr(s):e==="articulation"?$r(s):e==="paths"?Sr(t,n,s):e==="impact"?Rr(t,s):Tr(e,t,s)}function jr(e,t){if(e!=="index"&&(t.rebuild===!0||t.clear===!0))throw new w("--rebuild and --clear apply only to graph index.",y.USAGE);if(e!=="audit"&&t.saveBaseline===!0)throw new w("--save-baseline applies only to graph audit.",y.USAGE);if(e==="slack"&&t.kind!==void 0)throw new w("graph slack analyzes every ordering kind; --kind is not supported.",y.USAGE);if(t.rebuild===!0&&t.clear===!0)throw new w("graph index accepts either --rebuild or --clear, not both.",y.USAGE);if(e==="impact"&&t.full===!0&&t.limit!==void 0)throw new w("graph impact accepts either --full or --limit, not both.",y.USAGE)}async function Fr(e,t,n,s,r,i){let o="status";if(i.clear===!0&&(await He(e),o="cleared"),i.rebuild===!0){await He(e);let c=await Ke(e,t),d={assembly:n.assembly,direction:"both",exemptIsolates:[],exemptIsolateTypes:[],saveBaseline:!1,summary:!0,unbounded:!1};for(let u of["analyze","audit"])await We(e,t,c,pn(u,void 0,void 0,d),hn(u,void 0,void 0,d,r));o="rebuilt"}let a=await Zt(e,t);return{subcommand:"index",action:o,state:a.exists?a.fresh?"fresh":"stale":"absent",entry_count:a.entry_count,item_count:s,min_items_threshold:Ue,persist_enabled:Je(s,a.exists),current_fingerprint:t.slice(0,12),...a.saved_at===void 0?{}:{saved_at:a.saved_at},...a.bytes===void 0?{}:{bytes:a.bytes}}}async function Gr(e,t,n,s){let r={saved_at:new Date().toISOString(),fingerprint:t,affected_subjects_by_code:n.affected_subjects_by_code,profile:n.profile},i=await en(e);return s&&await tn(e,r),i===void 0?n:{...n,baseline:Mt(i,r)}}async function Br(e,t,n,s,r){try{await We(e,t,n,s,r)}catch{}}async function _o(e,t,n,s,r){let i=Ir(e,t,n);Z(s.summary===!0,s.full===!0,"--summary");let o=H(process.cwd(),r.path);if(!await K(J(o)))throw new w(`Tracker is not initialized at ${o}. Run pm init first.`,y.NOT_FOUND);let a=await se(o),c=W(a,te()),d=await re(o,a.item_format,c.type_to_folder,void 0,a.schema),u=Y(a.schema),l=M=>F(M,u);jr(i,s);let f=A(),p=Qe(s.kind,f),h=ke().lookup(o,ve(d,l,f),()=>ie(d,l,f)),g={assembly:h.assembly,...p===void 0?{}:{kinds:p},maxDepth:Ee(s.maxDepth),limit:I(s.limit,"limit"),after:s.after?.trim()||void 0,direction:Ye(s.direction),maxPaths:I(s.maxPaths,"max-paths"),sample:I(s.sample,"sample"),exemptIsolates:un(s.exemptIsolate),exemptIsolateTypes:un(s.exemptIsolateType),saveBaseline:s.saveBaseline===!0,summary:s.summary===!0,unbounded:s.full===!0};if(i==="index")return dn(await Fr(o,h.fingerprint,g,d.length,l,s),!1);let m=fn.has(i)?ln(g.assembly,t):void 0,b=i==="paths"?ln(g.assembly,n):void 0,x=pn(i,m,b,g),_=await Ke(o,h.fingerprint),R=_.results[x],v=h.memoize(x,()=>R!==void 0?structuredClone(R):hn(i,m,b,g,l)),U=Je(d.length,_.exists);!v.reused&&R===void 0&&U&&await Br(o,h.fingerprint,_,x,v.value);let O=v.value.subcommand==="audit"?await Gr(o,h.fingerprint,v.value,g.saveBaseline):v.value;return O.cache={fingerprint:h.fingerprint.slice(0,12),assembly:h.assemblyReused?"hit":"miss",result:v.reused?"hit":"miss",durable:R!==void 0?"hit":U?"miss":"off"},dn(O,g.summary,"result_rows")}export{Ne as a,pt as b,ue as c,bt as d,_t as e,Zr as f,xt as g,Et as h,It as i,Tt as j,St as k,ge as l,Dt as m,we as n,Ct as o,Fe as p,be as q,Ge as r,_e as s,Mt as t,ci as u,ve as v,Be as w,ke as x,pi as y,Bt as z,Hi as A,Vt as B,Kt as C,Wt as D,Xt as E,Ue as F,z as G,Qt as H,Ke as I,We as J,He as K,Zt as L,Je as M,en as N,tn as O,sn as P,Ir as Q,_o as R};
|
|
8
|
+
//# sourceMappingURL=chunk-4JC3AOGS.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Qa as D,k as L}from"./chunk-GEYU23YS.js";import{aa as h,da as I}from"./chunk-EAXXF2HW.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1b2f1ac3-82b3-58a2-9f40-2dd95ab1b2bc")}catch{}})();var x="global",E="external";function u(t){let e=t?.trim().toLowerCase();return e===x||e===E}function A(t){let e=t?.trim();if(e)return u(e)?x:e}function G(t,e,r){let o=t.trim();return u(r)?o:D(o,e)}(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="8368a519-4c09-540e-b0fb-f74cfdc1d7b2")}catch{}})();function y(t){if(typeof t!="string")return;let e=t.trim();if(!(!e||["none","null","n/a","na"].includes(e.toLowerCase())))return e}function b(t){let e=y(t);return e?.toLowerCase()==="no-active-blocker"?void 0:e}function v(){let t=h();for(let e of L()?.relationship_kinds??[])for(let r of e.definitions)t.register(r);return t}function k(t,e){let r=t.toLowerCase(),o=e.toLowerCase();return r!==o?r<o?-1:1:t!==e?t<e?-1:1:0}function z(t){let e=new Map;for(let r of t.dependencies??[]){if(typeof r!="object"||r===null)continue;let o=r,i=y(o.id);if(!i)continue;let c=typeof o.kind=="string"?o.kind:"related",l=`${c}\0${i.toLowerCase()}`,p=e.get(l);p?p.count+=1:e.set(l,{target_id:i,kind:c,count:1})}return e}function S(t,e=r=>r==="closed"||r==="canceled"){let r=[];for(let o of t)if(!(typeof o?.id!="string"||o.id.trim().length===0))for(let i of z(o).values())i.count<2||r.push({holder_id:o.id.trim(),target_id:i.target_id,kind:i.kind,occurrences:i.count,holder_status:o.status,legacy_terminal:e(o.status)});return r.sort((o,i)=>{let c=k(o.holder_id,i.holder_id);if(c!==0)return c;let l=k(o.target_id,i.target_id);return l!==0?l:k(o.kind,i.kind)})}function T(t,e=r=>r==="closed"||r==="canceled"){let r=t.filter(s=>typeof s?.id=="string"&&s.id.trim().length>0),o=new Set(r.map(s=>s.id.trim().toLowerCase())),i=new Map,c=(s,d,f,m)=>{let n=y(d);if(!n||o.has(n.toLowerCase()))return;let a={holder_id:s.id.trim(),target_id:n,kind:f,source:m,holder_status:s.status,legacy_terminal:e(s.status),no_active_blocker_sentinel:n.toLowerCase()==="no-active-blocker"};i.set(`${a.holder_id}::${a.target_id}::${a.kind}::${a.source}`,a)};for(let s of r){c(s,s.parent,"parent","parent"),c(s,s.blocked_by,"blocked_by","blocked_by");for(let d of s.dependencies??[]){if(typeof d!="object"||d===null)continue;let f=d;u(f.source_kind)||c(s,f.id,typeof f.kind=="string"?f.kind:"related","dependency")}}let l=[...i.values()].sort((s,d)=>s.holder_id.localeCompare(d.holder_id)||s.target_id.localeCompare(d.target_id)||s.kind.localeCompare(d.kind)||s.source.localeCompare(d.source)),p=l.filter(s=>s.legacy_terminal);return{active:l.filter(s=>!s.legacy_terminal),legacy_terminal:p,no_active_blocker_sentinels:l.filter(s=>s.no_active_blocker_sentinel)}}function $(t){let e=new Map;for(let r of[...t.active,...t.legacy_terminal]){if(r.no_active_blocker_sentinel)continue;let o=r.target_id.trim(),i=o.toLowerCase();e.has(i)||e.set(i,o)}return[...e.values()].sort((r,o)=>r.localeCompare(o))}function M(t){let e=new Map;for(let r of t)for(let o of r.dependencies??[]){if(typeof o!="object"||o===null||!u(o.source_kind))continue;let i=y(o.id);i&&!e.has(i.toLowerCase())&&e.set(i.toLowerCase(),i)}return[...e.values()].sort((r,o)=>r.localeCompare(o))}function W(t,e,r){let o=r??v(),i=t.filter(n=>typeof n?.id=="string"&&n.id.trim().length>0),c=new Map(i.map(n=>[n.id.trim().toLowerCase(),n.id.trim()])),l=T(i,e),p=$(l);for(let n of p)c.set(n.toLowerCase(),n);let s=M(i),d=new Set(c.keys()),f=new Map;for(let n of s){let a=n;for(;d.has(a.toLowerCase());)a=`external:${a}`;f.set(n.toLowerCase(),a),d.add(a.toLowerCase())}let m=i.map(n=>{let a=b(n.parent),C=b(n.blocked_by),R=(n.dependencies??[]).flatMap(_=>{if(typeof _!="object"||_===null)return[];let g=_,w=b(g.id);return w?[{id:u(g.source_kind)?f.get(w.toLowerCase()):c.get(w.toLowerCase()),kind:typeof g.kind=="string"?g.kind:"related"}]:[]});return{id:n.id.trim(),...a?{parent:c.get(a.toLowerCase())}:{},...C?{blocked_by:c.get(C.toLowerCase())}:{},dependencies:R}});return{graph:I.fromItems([...m,...p.map(n=>({id:n})),...s.map(n=>({id:f.get(n.toLowerCase())}))],o),details:[...i.map(n=>({id:n.id.trim(),title:n.title,status:n.status,...typeof n.type=="string"&&n.type.trim().length>0?{type:n.type.trim()}:{}})),...p.map(n=>({id:n,title:`[missing] ${n}`,status:"missing"})),...s.map(n=>({id:f.get(n.toLowerCase()),title:`[external] ${n}`,status:"external"}))],missingIdSet:new Set(p.map(n=>n.toLowerCase())),dangling:l,duplicateRows:S(i,e)}}export{A as a,G as b,b as c,v as d,S as e,T as f,$ as g,W as h};
|
|
2
|
+
//# sourceMappingURL=chunk-6KDHXURF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ka as a}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]="479dd590-7f54-54ae-bbaf-8f183fd6b6b4")}catch{}})();var l=[{exit_code:1,class:"generic_failure"},{exit_code:2,class:"usage"},{exit_code:3,class:"not_found"},{exit_code:4,class:"conflict"},{exit_code:5,class:"dependency_failed"}],g=new Map(l.map(e=>[e.exit_code,e.class]));function d(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort()}function m(e){let t=new Set,i=e.map(s=>{let n=s.code.trim();if(!/^[a-z][a-z0-9_]*$/.test(n))throw new TypeError(`Invalid pm error code: ${JSON.stringify(s.code)}`);if(t.has(n))throw new TypeError(`Duplicate pm error code: ${n}`);t.add(n);let c=d(s.sources),o=d(s.emitting_commands);if(![1,2,3,4,5].includes(s.exit_code)||s.meaning.trim().length===0||s.recovery.trim().length===0||c.length===0||o.length===0||g.get(s.exit_code)!==s.class)throw new TypeError(`Invalid pm error code contract: ${n}`);return Object.freeze({...s,code:n,meaning:s.meaning.trim(),recovery:s.recovery.trim(),sources:c,emitting_commands:o})});return Object.freeze(i.sort((s,n)=>s.code.localeCompare(n.code)))}function V(e,t){let i=e.trim(),s=t.find(n=>n.code===i);if(!s)throw new TypeError(`Unknown pm error code "${i}"`);return 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]="7a568064-a103-5b19-969d-6e58fc0cc5b7")}catch{}})();var A=m([{code:"acceptance_criteria_semicolon_forbidden",meaning:"Acceptance criteria semicolon forbidden condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/item/parse.ts"],emitting_commands:["*"]},{code:"already_claimed_by",meaning:"Already claimed by condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/claim.ts"],emitting_commands:["claim"]},{code:"ambiguous_list_all",meaning:"Ambiguous list all condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/register-list-query.ts"],emitting_commands:["*"]},{code:"ambiguous_option_combination",meaning:"Ambiguous option combination condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"annotation_flag_like_value",meaning:"Annotation flag like value condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/annotations.ts"],emitting_commands:["*"]},{code:"annotation_message_without_text",meaning:"Annotation message without text condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/annotations.ts"],emitting_commands:["*"]},{code:"append_empty_body",meaning:"Append empty body condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/append.ts"],emitting_commands:["append"]},{code:"body_file_conflicts_with_body",meaning:"Body file conflicts with body condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/io/body-file.ts"],emitting_commands:["*"]},{code:"body_file_missing_path",meaning:"Body file missing path condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/io/body-file.ts"],emitting_commands:["*"]},{code:"body_file_unreadable",meaning:"Body file unreadable condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/io/body-file.ts"],emitting_commands:["*"]},{code:"bundle_integrity_torn_install",meaning:"Bundle integrity torn install condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/bundle-integrity.ts"],emitting_commands:["*"]},{code:"capability_undeclared",meaning:"Capability undeclared condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/compose.ts"],emitting_commands:["*"]},{code:"capability_unused",meaning:"Capability unused condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/compose.ts"],emitting_commands:["*"]},{code:"child_projection_item_bound_exceeded",meaning:"Child projection item bound exceeded condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/item-children.ts"],emitting_commands:["*"]},{code:"close_reason_required",meaning:"Close reason required condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle-policy.ts","sdk/lifecycle/close-many.ts"],emitting_commands:["*","close-many"]},{code:"close_through_update",meaning:"Close through update condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"close_validation_missing_fields",meaning:"Close validation missing fields condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"collected_zero_items",meaning:"Collected zero items condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/test/execution.ts"],emitting_commands:["*"]},{code:"command_failed",meaning:"Command failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts"],emitting_commands:["*"]},{code:"command_namespace",meaning:"Command namespace condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/cli-contracts/runtime-contracts.ts"],emitting_commands:["*"]},{code:"command_override_conflict",meaning:"Command override conflict condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/compose.ts"],emitting_commands:["*"]},{code:"config_duplicate",meaning:"Config duplicate condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"config_key_unknown",meaning:"Config key unknown condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"config_value_invalid",meaning:"Config value invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"conflicting_lifecycle_owner",meaning:"Conflicting lifecycle owner condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/register-operations.ts"],emitting_commands:["*"]},{code:"context_takes_no_item_argument",meaning:"Context takes no item argument condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts"],emitting_commands:["*"]},{code:"core_item_field_requires_dedicated_flag",meaning:"Core item field requires dedicated flag condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/item-fields.ts"],emitting_commands:["*"]},{code:"create_positional_type_without_title",meaning:"Create positional type without title condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/register-mutation.ts"],emitting_commands:["*"]},{code:"dependency_edge_not_allowed",meaning:"Dependency edge not allowed condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/dependency-flag-validation.ts"],emitting_commands:["*"]},{code:"duplicate_command",meaning:"Duplicate command condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/compose.ts"],emitting_commands:["*"]},{code:"duplicate_edge",meaning:"Duplicate edge condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/graph/remediation.ts"],emitting_commands:["*"]},{code:"duplicate_sweep_cost_limit",meaning:"Duplicate sweep cost limit condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/similarity.ts"],emitting_commands:["*"]},{code:"duplicate_target_circular",meaning:"Duplicate target circular condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_is_duplicate",meaning:"Duplicate target is duplicate condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_missing",meaning:"Duplicate target missing condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_self",meaning:"Duplicate target self condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"empty_surface",meaning:"Empty surface condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/compose.ts"],emitting_commands:["*"]},{code:"event_cursor_query_mismatch",meaning:"Event cursor query mismatch condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-events.ts"],emitting_commands:["*"]},{code:"event_index_unavailable",meaning:"Event index unavailable condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-events.ts"],emitting_commands:["*"]},{code:"extension_command_activation_failed",meaning:"Extension command activation failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/commander-usage.ts"],emitting_commands:["*"]},{code:"extension_dependency_name_unsafe",meaning:"Extension dependency name unsafe condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/install-sources.ts"],emitting_commands:["*"]},{code:"extension_dependency_spec_invalid",meaning:"Extension dependency spec invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/install-sources.ts"],emitting_commands:["*"]},{code:"extension_dependency_version_unsafe",meaning:"Extension dependency version unsafe condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/install-sources.ts"],emitting_commands:["*"]},{code:"extension_install_soft_failed",meaning:"Extension install soft failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/register-setup.ts"],emitting_commands:["*"]},{code:"extension_install_source_contains_destination",meaning:"Extension install source contains destination condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/install-runtime.ts"],emitting_commands:["*"]},{code:"extension_item_field_reserved",meaning:"Extension item field reserved condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/item-fields.ts"],emitting_commands:["*"]},{code:"extension_item_field_type_conflict",meaning:"Extension item field type conflict condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/item-fields.ts"],emitting_commands:["*"]},{code:"extension_item_field_unknown",meaning:"Extension item field unknown condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/item-fields.ts"],emitting_commands:["*"]},{code:"extension_mutation_guard_failed",meaning:"Extension mutation guard failed condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/extension-hook-runtime.ts"],emitting_commands:["*"]},{code:"extension_mutation_guard_invalid_decision",meaning:"Extension mutation guard invalid decision condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/extension-hook-runtime.ts"],emitting_commands:["*"]},{code:"extension_mutation_guard_invalid_denial",meaning:"Extension mutation guard invalid denial condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/extension-hook-runtime.ts"],emitting_commands:["*"]},{code:"extension_mutation_guard_timed_out",meaning:"Extension mutation guard timed out condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/extensions/extension-hook-runtime.ts"],emitting_commands:["*"]},{code:"extension_update_health_partial_coverage",meaning:"Extension update health partial coverage condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"field_duplicate",meaning:"Field duplicate condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"field_invalid",meaning:"Field invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"field_mcp_input_collision",meaning:"Field mcp input collision condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"github_source_entry_unbuilt",meaning:"Github source entry unbuilt condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/shared.ts"],emitting_commands:["*"]},{code:"history_author_acknowledge_selector_required",meaning:"History author acknowledge selector required condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/register-history-author.ts"],emitting_commands:["*"]},{code:"history_drift_chain_mismatch",meaning:"History drift chain mismatch condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"history_drift_hash_mismatch",meaning:"History drift hash mismatch condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"history_drift_missing_stream",meaning:"History drift missing stream condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"history_drift_unreadable_stream",meaning:"History drift unreadable stream condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"history_merge_conflict_markers_detected",meaning:"History merge conflict markers detected condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/history/read.ts"],emitting_commands:["*"]},{code:"history_stream_over_compact_threshold",meaning:"History stream over compact threshold condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"history_target_out_of_range",meaning:"History target out of range condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/history/projection.ts"],emitting_commands:["*"]},{code:"history_unknown_author_events",meaning:"History unknown author events condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"init_existing_settings_requires_force",meaning:"Init existing settings requires force condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/init.ts"],emitting_commands:["*"]},{code:"init_gitignore_unwritable",meaning:"Init gitignore unwritable condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/workspace.ts"],emitting_commands:["*"]},{code:"init_id_prefix_conflict",meaning:"Init id prefix conflict condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/init.ts"],emitting_commands:["*"]},{code:"init_id_prefix_path_like",meaning:"Init id prefix path like condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/init.ts"],emitting_commands:["*"]},{code:"integrity_history_conflict_marker",meaning:"Integrity history conflict marker condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"integrity_history_invalid_json",meaning:"Integrity history invalid json condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"integrity_history_unreadable",meaning:"Integrity history unreadable condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"integrity_item_ahead_format_version",meaning:"Integrity item ahead format version condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"integrity_item_conflict_marker",meaning:"Integrity item conflict marker condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"integrity_item_outdated_format_version",meaning:"Integrity item outdated format version condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"integrity_item_parse_failed",meaning:"Integrity item parse failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"integrity_item_unreadable",meaning:"Integrity item unreadable condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"invalid_argument_value",meaning:"Invalid argument value condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/context-intent-contracts.ts","sdk/lifecycle/create.ts"],emitting_commands:["*","create"]},{code:"invalid_command_usage",meaning:"Invalid command usage condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"invalid_event_cursor",meaning:"Invalid event cursor condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-events.ts"],emitting_commands:["*"]},{code:"invalid_event_follow_interval",meaning:"Invalid event follow interval condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-events.ts"],emitting_commands:["*"]},{code:"invalid_event_limit",meaning:"Invalid event limit condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-events.ts"],emitting_commands:["*"]},{code:"invalid_event_since",meaning:"Invalid event since condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-events.ts"],emitting_commands:["*"]},{code:"invalid_provenance_predicate",meaning:"Invalid provenance predicate condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/history-provenance.ts"],emitting_commands:["*"]},{code:"invalid_query_cursor",meaning:"Invalid query cursor condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/pagination.ts"],emitting_commands:["*"]},{code:"invalid_workspace_snapshot_target",meaning:"Invalid workspace snapshot target condition.",stability:"provisional",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/workspace-snapshot.ts"],emitting_commands:["*"]},{code:"item_document_invalid",meaning:"Item document invalid condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/item/item-format.ts"],emitting_commands:["*"]},{code:"item_document_roundtrip_failed",meaning:"Item document roundtrip failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/item/item-format.ts"],emitting_commands:["*"]},{code:"item_id_collision",meaning:"Item id collision condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/copy.ts"],emitting_commands:["copy"]},{code:"item_not_found",meaning:"Item not found condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"likely_duplicate",meaning:"Likely duplicate condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/similarity.ts"],emitting_commands:["*"]},{code:"linked_test_value_not_quoted",meaning:"Linked test value not quoted condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts"],emitting_commands:["*"]},{code:"list_source_incomplete",meaning:"List source incomplete condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/query/list.ts"],emitting_commands:["list"]},{code:"local_package_archive_unsafe",meaning:"Local package archive unsafe condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/install-sources.ts"],emitting_commands:["*"]},{code:"local_source_not_found_bare_name",meaning:"Local source not found bare name condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/install-sources.ts"],emitting_commands:["*"]},{code:"lock_conflict",meaning:"Lock conflict condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/lock/lock.ts","core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"locks_stale_count",meaning:"Locks stale count condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"locks_unreadable",meaning:"Locks unreadable condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"malformed_plan_step_evidence",meaning:"Malformed plan step evidence condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"manifest_capabilities_absent",meaning:"Manifest capabilities absent condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/compose.ts"],emitting_commands:["*"]},{code:"merge_conflict_markers_detected",meaning:"Merge conflict markers detected condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/item/item-format.ts"],emitting_commands:["*"]},{code:"merge_git_config_unwritable",meaning:"Merge git config unwritable condition.",stability:"stable",exit_code:5,class:"dependency_failed",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/merge/install.ts"],emitting_commands:["*"]},{code:"merge_root_not_found",meaning:"Merge root not found condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/merge/install.ts"],emitting_commands:["*"]},{code:"missing_directory",meaning:"Missing directory condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"missing_lifecycle_target",meaning:"Missing lifecycle target condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension.ts"],emitting_commands:["*"]},{code:"missing_required_argument",meaning:"Missing required argument condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","cli/main.ts","cli/register-mutation.ts","core/telemetry/observability.ts","sdk/history-redact.ts","sdk/invocation-author.ts"],emitting_commands:["*"]},{code:"missing_required_option",meaning:"Missing required option condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/context-intent-contracts.ts","sdk/lifecycle/create.ts","sdk/lifecycle/plan.ts"],emitting_commands:["*","create","plan"]},{code:"module_import_failed",meaning:"Module import failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts"],emitting_commands:["*"]},{code:"multi_target_github_install_ambiguous",meaning:"Multi target github install ambiguous condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/register-setup.ts"],emitting_commands:["*"]},{code:"mutation_author_required",meaning:"Mutation author required condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-guard.ts"],emitting_commands:["*"]},{code:"mutation_secret_guard_blocked",meaning:"Mutation secret guard blocked condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/mutation-guard.ts"],emitting_commands:["*"]},{code:"no_matching_tests",meaning:"No matching tests condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/test/execution.ts"],emitting_commands:["*"]},{code:"no_projects_matched_filters",meaning:"No projects matched filters condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/test/execution.ts"],emitting_commands:["*"]},{code:"no_test_files_found",meaning:"No test files found condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/test/execution.ts"],emitting_commands:["*"]},{code:"no_tests_found",meaning:"No tests found condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/test/execution.ts"],emitting_commands:["*"]},{code:"no_update_fields",meaning:"No update fields condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"npm_package_not_found",meaning:"Npm package not found condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension/install-sources.ts"],emitting_commands:["*"]},{code:"ownership_conflict",meaning:"Ownership conflict condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/annotations.ts"],emitting_commands:["*"]},{code:"ownership_dependency_bypass_restricted_options",meaning:"Ownership dependency bypass restricted options condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"ownership_metadata_bypass_restricted_options",meaning:"Ownership metadata bypass restricted options condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"package_spec_empty",meaning:"Package spec empty condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"profile_name_empty",meaning:"Profile name empty condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"profile_name_not_normalized",meaning:"Profile name not normalized condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"profile_summary_empty",meaning:"Profile summary empty condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"profile_title_empty",meaning:"Profile title empty condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"redundant_edge",meaning:"Redundant edge condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/graph/remediation.ts"],emitting_commands:["*"]},{code:"reindex_already_running",meaning:"Reindex already running condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/governance/reindex.ts"],emitting_commands:["*"]},{code:"reserved_item_field",meaning:"Reserved item field condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/compose.ts"],emitting_commands:["*"]},{code:"schema_migration_input_required",meaning:"Schema migration input required condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/migration-gates.ts"],emitting_commands:["*"]},{code:"settings_read_fs_error",meaning:"Settings read fs error condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"settings_read_invalid_json",meaning:"Settings read invalid json condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"settings_read_invalid_schema",meaning:"Settings read invalid schema condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"settings_read_merge_failed",meaning:"Settings read merge failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"status_duplicate",meaning:"Status duplicate condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"status_invalid",meaning:"Status invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"stdin_json_invalid",meaning:"Stdin json invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/structured-mutations.ts"],emitting_commands:["*"]},{code:"stdin_json_unknown_key",meaning:"Stdin json unknown key condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/structured-mutations.ts"],emitting_commands:["*"]},{code:"structured_event_immutable",meaning:"Structured event immutable condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/annotations.ts"],emitting_commands:["*"]},{code:"structured_event_input_conflict",meaning:"Structured event input conflict condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/notes.ts"],emitting_commands:["*"]},{code:"structured_event_json_empty",meaning:"Structured event json empty condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/notes.ts"],emitting_commands:["*"]},{code:"structured_event_json_invalid",meaning:"Structured event json invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/notes.ts"],emitting_commands:["*"]},{code:"structured_event_since_invalid",meaning:"Structured event since invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/notes.ts"],emitting_commands:["*"]},{code:"telemetry_endpoint_probe_failed",meaning:"Telemetry endpoint probe failed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"telemetry_endpoint_probe_http_status",meaning:"Telemetry endpoint probe http status condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"telemetry_otel_export_failing",meaning:"Telemetry otel export failing condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"telemetry_queue_high_retries",meaning:"Telemetry queue high retries condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"telemetry_queue_invalid_rows",meaning:"Telemetry queue invalid rows condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"telemetry_queue_pending",meaning:"Telemetry queue pending condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"telemetry_schema_version_behind",meaning:"Telemetry schema version behind condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"telemetry_state_invalid_json",meaning:"Telemetry state invalid json condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"template_type_unknown",meaning:"Template type unknown condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"terminal_plan_mutation",meaning:"Terminal plan mutation condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"terminal_state_conflict",meaning:"Terminal state conflict condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"tracked_runtime_cache_files",meaning:"Tracked runtime cache files condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"tracker_not_initialized",meaning:"Tracker not initialized condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"tracker_root_missing",meaning:"Tracker root missing condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/store/item-store.ts"],emitting_commands:["*"]},{code:"tracker_root_not_directory",meaning:"Tracker root not directory condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/store/item-store.ts"],emitting_commands:["*"]},{code:"type_duplicate",meaning:"Type duplicate condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"type_invalid",meaning:"Type invalid condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"unknown_command",meaning:"Unknown command condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/cli-contracts/runtime-contracts.ts"],emitting_commands:["*"]},{code:"unknown_context_intent",meaning:"Unknown context intent condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/context-intent-contracts.ts"],emitting_commands:["*"]},{code:"unknown_error",meaning:"Unknown error condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts"],emitting_commands:["*"]},{code:"unknown_field",meaning:"Unknown field condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/schema.ts"],emitting_commands:["*"]},{code:"unknown_field_projection",meaning:"Unknown field projection condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/query/get.ts","sdk/query/list.ts"],emitting_commands:["get","list"]},{code:"unknown_item_type",meaning:"Unknown item type condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/schema.ts"],emitting_commands:["*"]},{code:"unknown_lifecycle_action",meaning:"Unknown lifecycle action condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/extension.ts"],emitting_commands:["*"]},{code:"unknown_option",meaning:"Unknown option condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts","core/telemetry/observability.ts"],emitting_commands:["*"]},{code:"unknown_plan_template",meaning:"Unknown plan template condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"unknown_provenance_dimension",meaning:"Unknown provenance dimension condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/history-provenance.ts"],emitting_commands:["*"]},{code:"unknown_status",meaning:"Unknown status condition.",stability:"stable",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/schema.ts"],emitting_commands:["*"]},{code:"unknown_subcommand",meaning:"Unknown subcommand condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/register-mutation.ts","cli/register-operations.ts","sdk/runtime-extended-actions.ts","sdk/telemetry.ts"],emitting_commands:["*"]},{code:"unsupported_update_option",meaning:"Unsupported update option condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["cli/error-guidance.ts"],emitting_commands:["*"]},{code:"validate_command_references_stale_pm_ids",meaning:"Validate command references stale pm ids condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_files_missing_linked_paths",meaning:"Validate files missing linked paths condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_files_orphaned_paths",meaning:"Validate files orphaned paths condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_files_tracked_all_strict_forces_pm_internals",meaning:"Validate files tracked all strict forces pm internals condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_format_version_ahead_items",meaning:"Validate format version ahead items condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_format_version_outdated_items",meaning:"Validate format version outdated items condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_hierarchy_parent_cycle",meaning:"Validate hierarchy parent cycle condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_hierarchy_parent_cycle_error",meaning:"Validate hierarchy parent cycle error condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_history_drift_chain_mismatches",meaning:"Validate history drift chain mismatches condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_history_drift_hash_mismatches",meaning:"Validate history drift hash mismatches condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_history_drift_missing_streams",meaning:"Validate history drift missing streams condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_history_drift_unreadable_streams",meaning:"Validate history drift unreadable streams condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_history_unknown_author_events",meaning:"Validate history unknown author events condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_lifecycle_active_closure_like_metadata",meaning:"Validate lifecycle active closure like metadata condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_lifecycle_active_terminal_parent",meaning:"Validate lifecycle active terminal parent condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_lifecycle_dependency_cycles",meaning:"Validate lifecycle dependency cycles condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_lifecycle_dependency_cycles_error",meaning:"Validate lifecycle dependency cycles error condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_lifecycle_stale_blockers",meaning:"Validate lifecycle stale blockers condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_merge_fence_drift",meaning:"Validate merge fence drift condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_custom_profile_missing_required_fields",meaning:"Validate metadata custom profile missing required fields condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_duplicate_issue_codes",meaning:"Validate metadata duplicate issue codes condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_acceptance_criteria",meaning:"Validate metadata missing acceptance criteria condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_close_reason",meaning:"Validate metadata missing close reason condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_confidence",meaning:"Validate metadata missing confidence condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_estimate",meaning:"Validate metadata missing estimate condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_release",meaning:"Validate metadata missing release condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_reviewer",meaning:"Validate metadata missing reviewer condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_risk",meaning:"Validate metadata missing risk condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_metadata_missing_sprint",meaning:"Validate metadata missing sprint condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_resolution_missing_fields",meaning:"Validate resolution missing fields condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_storage_duplicate_item_ids",meaning:"Validate storage duplicate item ids condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_storage_history_conflict_markers",meaning:"Validate storage history conflict markers condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_storage_resurrected_items",meaning:"Validate storage resurrected items condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_storage_tracked_runtime_cache_files",meaning:"Validate storage tracked runtime cache files condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_storage_unparseable_config",meaning:"Validate storage unparseable config condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_storage_unparseable_history",meaning:"Validate storage unparseable history condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"validate_storage_unreadable_items",meaning:"Validate storage unreadable items condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"vectorization_embedding_identity_changed",meaning:"Vectorization embedding identity changed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"vectorization_stale_items_remaining",meaning:"Vectorization stale items remaining condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/diagnostics/remediation.ts"],emitting_commands:["*"]},{code:"workflow_duplicate_type",meaning:"Workflow duplicate type condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"workflow_status_unknown",meaning:"Workflow status unknown condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"workflow_transition_malformed",meaning:"Workflow transition malformed condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"workflow_type_empty",meaning:"Workflow type empty condition.",stability:"stable",exit_code:1,class:"generic_failure",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"workflow_type_unknown",meaning:"Workflow type unknown condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/profile/profile-lint.ts"],emitting_commands:["*"]},{code:"workspace_history_state_conflict",meaning:"Workspace history state conflict condition.",stability:"stable",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["core/history/workspace-history.ts"],emitting_commands:["*"]},{code:"workspace_root_pm_path",meaning:"Workspace root pm path condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/init.ts"],emitting_commands:["*"]},{code:"workspace_snapshot_force_required",meaning:"Workspace snapshot force required condition.",stability:"provisional",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/workspace-snapshot.ts"],emitting_commands:["*"]},{code:"workspace_snapshot_manifest_mismatch",meaning:"Workspace snapshot manifest mismatch condition.",stability:"provisional",exit_code:4,class:"conflict",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/workspace-snapshot.ts"],emitting_commands:["*"]},{code:"workspace_snapshot_name_reserved_fingerprint",meaning:"Workspace snapshot name reserved fingerprint condition.",stability:"provisional",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/workspace-snapshot.ts"],emitting_commands:["*"]},{code:"workspace_snapshot_not_found",meaning:"Workspace snapshot not found condition.",stability:"provisional",exit_code:3,class:"not_found",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/workspace-snapshot.ts"],emitting_commands:["*"]},{code:"wrong_item_type",meaning:"Wrong item type condition.",stability:"stable",exit_code:2,class:"usage",recovery:"Inspect the structured error guidance and retry the suggested command.",sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]}]);(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3b72f4a5-9e0b-5f8e-8ee9-e45cd83d6f92")}catch{}})();var _=Object.freeze({"--body":"Set the item body.","--body-file":"Read the item body from a file.","--description":"Set the item description.","--stdin":"Read the value from stdin.","--stdin-json":"Read a complete JSON document from stdin."}),y=new Set(["--add","--body","--comment","--dep","--description","--doc","--field","--file","--learning","--note","--remove","--test","--type-option"]),p=new Set(["append","comments","create","docs","files","learnings","notes","test","update"]),h=["--allow-","--check-","--dry-run","--explain","--filter-","--full","--has-","--include-","--json","--no-","--only","--quiet","--require-","--runtime-only","--schema-only","--stream","--strict-","--summary","--today","--verbose"];function b(e,t){return t==="--stdin"||t==="--stdin-json"?["stdin"]:t.endsWith("-file")?["argv","file"]:y.has(t)&&p.has(e)?["argv","stdin"]:["argv"]}function f(e){let t=e.value_name!==void 0||e.value_type==="string"||e.value_type==="number"||e.list===!0||e.repeatable===!0,i=e.flag==="--stdin"||e.flag==="--stdin-json"||h.some(s=>e.flag.startsWith(s));return t||!i}function v(e,t){let i=f(t),s=b(e,t.flag),n=t.description??_[t.flag]??`${i?"Set":"Enable"} ${t.flag.slice(2).replaceAll("-"," ")}.`;return{...t,description:n,takes_value:i,value_required:i,...i?{value_name:t.value_name??"value"}:{},value_type:i?t.value_type??"string":"boolean",required:t.required===!0,repeatable:t.repeatable===!0||t.list===!0,input_sources:s,...s.includes("stdin")&&t.flag!=="--stdin"&&t.flag!=="--stdin-json"?{stdin_token:"-"}:{}}}function N(e,t){return t.map(i=>v(e,i))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af86d275-63a8-5205-a8b3-154efdbd8e2a")}catch{}})();var x=["mutation_receipt","entity","collection","diagnostic","stream"],I=new Set(["append","claim","close","close-task","copy","create","delete","focus","pause-task","release","restore","start-task","update"]),k=new Set(["close-many","update-many"]),w=new Set(["activity","comments","contracts","events","history","learnings","list","notes","search"]),E=new Set(["aggregate","deps","graph","health","stats","validate"]);function r(e){if(e.command.trim().length===0)throw new TypeError("command must be a non-empty command path");if(!x.includes(e.kind))throw new TypeError(`Unsupported output envelope kind: ${e.kind}`);return e}function u(e){let t=e.trim().replace(/\s+/gu," "),[i=t]=t.split(" ");return k.has(i)?r({command:t,kind:"collection",wrapper_key:"rows",cardinality:"many",format_flag:"--json"}):I.has(i)?r({command:t,kind:"mutation_receipt",wrapper_key:null,cardinality:"one",format_flag:"--json"}):w.has(i)?r({command:t,kind:"collection",wrapper_key:i==="contracts"?null:"items",cardinality:"many",format_flag:"--json"}):E.has(i)?r({command:t,kind:"diagnostic",wrapper_key:null,cardinality:"none",format_flag:"--json"}):r({command:t,kind:i==="get"?"entity":"diagnostic",wrapper_key:i==="get"?"item":null,cardinality:i==="get"?"one":"none",format_flag:"--json"})}var C=a.map(e=>u(e)),T=new Map(C.map(e=>[e.command,e]));function P(e){let t=e.trim().replace(/\s+/gu," ");if(t.length===0)throw new TypeError("command must be a non-empty command path");let[i=t]=t.split(" "),s=T.get(i);return s?{...s,command:t}:u(t)}function S(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function O(e){return S(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.status=="string"&&e.status.length>0&&Number.isSafeInteger(e.changed_field_count)&&Number(e.changed_field_count)>=0&&(e.close_reason===void 0||typeof e.close_reason=="string")&&(e.deleted===void 0||typeof e.deleted=="boolean")&&(e.previous_status===void 0||typeof e.previous_status=="string")&&(e.warnings===void 0||Array.isArray(e.warnings))}function R(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(i){throw new TypeError(`Mutation receipt must be valid JSON: ${String(i)}`,{cause:i})}if(!O(t))throw new TypeError("Mutation receipt must be a flat object with top-level id, status, and changed_field_count fields");return{id:t.id,status:t.status,changedFieldCount:t.changed_field_count,...typeof t.close_reason=="string"?{closeReason:t.close_reason}:{},...typeof t.deleted=="boolean"?{deleted:t.deleted}:{},...typeof t.previous_status=="string"?{previousStatus:t.previous_status}:{},...Array.isArray(t.warnings)?{warnings:t.warnings}:{}}}export{l as a,m as b,V as c,A as d,v as e,N as f,x as g,r as h,C as i,P as j,O as k,R as l};
|
|
2
|
+
//# sourceMappingURL=chunk-74CWP3A4.js.map
|