@unbrained/pm-cli 2026.11.4 → 2026.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/HARNESS_COMPATIBILITY.md +1 -1
- package/.agents/skills/README.md +14 -14
- package/.agents/skills/pm-developer/SKILL.md +16 -16
- package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +14 -14
- package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +10 -10
- package/.agents/skills/pm-extensions/SKILL.md +13 -13
- package/.agents/skills/pm-extensions/references/AUTHORING.md +12 -12
- package/.agents/skills/pm-sdk/SKILL.md +27 -27
- package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +32 -32
- package/.agents/skills/pm-test-audit/references/AUDIT.md +1 -1
- package/.agents/skills/pm-user/SKILL.md +35 -35
- package/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +9 -9
- package/CHANGELOG.md +9 -0
- package/README.md +13 -13
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2RPORE7M.js +31 -0
- package/dist/cli-bundle/chunks/{chunk-NPEDFOVQ.js → chunk-335BZ75D.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +122 -0
- package/dist/cli-bundle/chunks/chunk-6VRX2CM7.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-7PGNAHNW.js → chunk-7DEKAXVA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3OXQGGRD.js → chunk-7ZRCYESH.js} +42 -41
- package/dist/cli-bundle/chunks/{chunk-BWAXA6S4.js → chunk-AUEKTX7V.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SRDO2NJU.js → chunk-D7KYPRK4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ODMJ3HIB.js → chunk-DAX3AOFI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L4BKTPJ6.js → chunk-F6NDMKZ4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T56MB6SF.js → chunk-FRNMQM45.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5S6RT5LX.js → chunk-HNGLDMSZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QN7VCOUU.js → chunk-HRCMORE7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BK2XAQVC.js → chunk-HRFGFIYU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CERNIZLB.js → chunk-JI2GDE4I.js} +42 -42
- package/dist/cli-bundle/chunks/{chunk-6T2V3UIK.js → chunk-LS3GI3H4.js} +53 -53
- package/dist/cli-bundle/chunks/chunk-OH6WQ7VT.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-BRIPGUAO.js → chunk-OJDMJT7Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7RCI7AAA.js → chunk-S4LPZ4TN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AQ5UHHQS.js → chunk-UEGXWXUZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5BVZ32G7.js → chunk-XLSHFYXZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2GW662DP.js → chunk-YKXATU2G.js} +2 -2
- package/dist/cli-bundle/chunks/{item-revision-UAZOBP2Q.js → item-revision-OJJVPQY7.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-QEPBUCMY.js +2 -0
- package/dist/cli-bundle/chunks/{mutation-admission-QZQI2NN5.js → mutation-admission-INMM3HHG.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-P3NOKQUA.js → register-list-query-5Y5JKWU5.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-A6I5K5N6.js → register-mutation-WC7OSQID.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-SPKB3TNM.js → register-operations-PO63DBZH.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-RRFOS7IT.js +2 -0
- package/dist/cli-bundle/chunks/{stage-L3T725DS.js → stage-E3MMV4TV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5PMJOJCZ.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TFYTTDAK.js → chunk-7KK66ISG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Y5GOUUYJ.js → chunk-AHWJPZSJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-C7UX2ZI3.js → chunk-C6P6HPCX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-Q4OIRSKL.js → chunk-CPMSL4HS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-CZM75DE3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-CO2DNPH7.js → chunk-D2TBEBNW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-E56OXRYH.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FXFDVM5O.js → chunk-F62XGAAY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-G4QP365K.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-J7M52SCZ.js → chunk-G5PJCR7R.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GS3JC5UU.js +23 -0
- package/dist/cli-bundle/focused-chunks/{chunk-W3CSX6GI.js → chunk-LW64TINU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MEJKELWC.js → chunk-M6V7UMWL.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-CXTDEQ3N.js → chunk-MC7IE7D7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MG7C3JUY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-QEVJ3Y67.js → chunk-MK4HV4JO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-A2246ZM7.js → chunk-NQ7GYFOX.js} +54 -54
- package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +91 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FFO7RBLN.js → chunk-RFTJZ5VB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PNPYQDHU.js → chunk-SNOXXRSJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JQS7TYQ6.js → chunk-UPJUTP2V.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SDLIUZEL.js → chunk-VWWTIX5L.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-J6FDCAMH.js → chunk-XHOBYCVE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-J3YOATXR.js → chunk-YMGB2O4E.js} +25 -24
- package/dist/cli-bundle/focused-chunks/{item-revision-L6GVT42D.js → item-revision-CTDO4H3I.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{item-transaction-GYGP264N.js → item-transaction-AEAYVVHA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{mutation-admission-UWTH56OD.js → mutation-admission-4WM7TNHZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{stage-WRSNJ7VI.js → stage-WV7QXR4C.js} +2 -2
- package/dist/cli-bundle/main.js +2 -2
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +57 -57
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +9 -9
- package/dist/core/config/positional-value.d.ts +6 -0
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/item/literal-mutation-input.d.ts +17 -0
- package/dist/core/item/literal-mutation-input.js +1 -1
- package/dist/core/item/parent-reference-policy.d.ts +8 -4
- package/dist/core/item/parent-reference-policy.js +1 -1
- package/dist/core/item/sprint-release-format.d.ts +2 -1
- package/dist/core/item/sprint-release-format.js +1 -1
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/store/item-mutation-precondition.d.ts +3 -1
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/settings.d.ts +14 -0
- package/dist/core/store/settings.js +5 -4
- package/dist/core/telemetry/policy.d.ts +27 -1
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/runtime.d.ts +18 -7
- package/dist/core/telemetry/runtime.js +4 -4
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +8 -5
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/config.d.ts +2 -2
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/governance/health.d.ts +2 -2
- package/dist/sdk/governance/health.js +2 -2
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/init.d.ts +4 -4
- package/dist/sdk/init.js +8 -8
- package/dist/sdk/lifecycle/claim.d.ts +4 -0
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/close.d.ts +10 -0
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/create.d.ts +7 -5
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.d.ts +628 -4
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
- package/dist/sdk/lifecycle/update.d.ts +5 -4
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime/mutation-value-validation.js +1 -1
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.d.ts +1 -0
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/telemetry.d.ts +1 -1
- package/dist/sdk/telemetry.js +2 -2
- package/docs/AGENT_GUIDE.md +48 -48
- package/docs/AGENT_OUTPUT_ENCODINGS.md +20 -20
- package/docs/ASSURANCE.md +10 -10
- package/docs/BOUNDED_CONTEXT_READS.md +3 -3
- package/docs/CLAUDE_CODE_PLUGIN.md +1 -1
- package/docs/CLI_GRAMMAR.md +2 -2
- package/docs/COMMANDS.md +56 -35
- package/docs/COMMAND_NAMESPACES.md +1 -1
- package/docs/CONFIGURATION.md +82 -71
- package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +2 -2
- package/docs/CONTEXT_INTEGRITY_CONTRACTS.md +5 -5
- package/docs/CORPUS_SHAPES.md +1 -1
- package/docs/DEPENDENCY_KIND_CONTRACT.md +6 -6
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +5 -5
- package/docs/ECOSYSTEM_PLANNING_REVIEW.md +3 -3
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +4 -4
- package/docs/HISTORY_ATTESTATION.md +1 -1
- package/docs/HISTORY_MAINTENANCE.md +1 -1
- package/docs/LIFECYCLE_COMMANDS.md +1 -1
- package/docs/MCP_2026_07_28.md +16 -16
- package/docs/MCP_2026_07_28_CONFORMANCE.md +19 -19
- package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +22 -22
- package/docs/MCP_SKILLS_AND_APPS.md +1 -1
- package/docs/MERGE_SAFETY.md +6 -6
- package/docs/MUTATION_INTEGRITY.md +5 -5
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +14 -14
- package/docs/PACKED_FIRST_RUN.md +1 -1
- package/docs/QUICKSTART.md +10 -10
- package/docs/README.md +21 -21
- package/docs/READ_OUTPUT_CONTRACTS.md +9 -9
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +1 -1
- package/docs/RELEASING.md +19 -10
- package/docs/SCRIPTING.md +10 -10
- package/docs/SDK.md +74 -38
- package/docs/SDK_ARTIFACT_OUTPUT.md +1 -1
- package/docs/SDK_PRIMITIVE_INVENTORY.md +2 -2
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +7 -7
- package/docs/TESTING.md +1 -1
- package/docs/WORKFLOW_POLICIES.md +2 -2
- package/docs/WORKSPACE_POSITION_AND_LIFECYCLE.md +8 -8
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -1
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +1 -1
- package/docs/performance/cli-transport-overhead.md +7 -7
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/README.md +5 -5
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/GAP_REPORT.md +16 -16
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/README.md +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/GAP_REPORT.md +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +6 -6
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-5Z6LWFDL.js +0 -31
- package/dist/cli-bundle/chunks/chunk-DSCFJTHB.js +0 -122
- package/dist/cli-bundle/chunks/chunk-QQHMNUZT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TX2W6G37.js +0 -3
- package/dist/cli-bundle/chunks/item-transaction-N5F4LXYV.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-ZZRHJ4IS.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5NGNO54M.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-B6U44WPW.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BAW3DGQO.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-BHNY3KPJ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CBG67HUP.js +0 -23
- package/dist/cli-bundle/focused-chunks/chunk-FEPE2CE4.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PMKR4MJI.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$a as m,Za as b,ab as f,bb as k,lb as u}from"./chunk-M6V7UMWL.js";import{z as a}from"./chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7c95b311-b408-50f7-87e8-2c2fa2323092")}catch{}})();var D=[{exit_code:a.SUCCESS,outcome:"effect",success:!0,meaning:"The requested operation completed with its intended effect."},{exit_code:a.GENERIC_FAILURE,outcome:"internal_failure",success:!1,meaning:"An unexpected runtime or internal failure prevented completion."},{exit_code:a.USAGE,outcome:"refused_input",success:!1,meaning:"The invocation was refused because its input or composition was invalid."},{exit_code:a.NOT_FOUND,outcome:"refused_tracker_state",success:!1,meaning:"The requested tracker, item, or resource was not present."},{exit_code:a.CONFLICT,outcome:"conflict",success:!1,meaning:"Current state or concurrency prevented the requested effect."},{exit_code:a.DEPENDENCY_FAILED,outcome:"dependency_failed",success:!1,meaning:"A required dependency operation failed."},{exit_code:a.NO_EFFECT,outcome:"no_effect",success:!0,meaning:"The request was valid and completed, but matched nothing to change."},{exit_code:a.PARTIAL_EFFECT,outcome:"partial_effect",success:!0,meaning:"The request completed and changed some, but not all, selected targets."}],h=[a.SUCCESS,a.GENERIC_FAILURE,a.USAGE,a.NOT_FOUND,a.CONFLICT,a.DEPENDENCY_FAILED],P=new Set(["close-many","update-many"]),w=u.map(e=>({command:e,exit_codes:P.has(e)?[...h,a.NO_EFFECT,a.PARTIAL_EFFECT]:[...h]})),v=new Map(w.map(e=>[e.command,e])),R=[a.SUCCESS,a.NO_EFFECT,a.PARTIAL_EFFECT];function Ee(e){return R.includes(e)}function Te(e){return D.some(t=>t.exit_code===e)}function Ae(e){let t=e.trim().toLowerCase().split(/\s+/u).filter(Boolean).join(" ");return v.get(t)??v.get(t.split(" ")[0])}function Oe(e,t=u,s=w){let o=new Map(s.map(c=>[c.command,c])),i=t.filter(c=>!o.has(c)),r=e.filter(c=>{let n=o.get(c.command)??o.get(c.command.split(" ")[0]);return n===void 0||!n.exit_codes.includes(c.exit_code)}),d=new Set(e.map(c=>c.exit_code)),_=[...new Set(s.flatMap(c=>c.exit_codes))].filter(c=>!d.has(c)).sort((c,n)=>c-n);return{ok:i.length===0&&r.length===0&&_.length===0,missing_commands:i,undeclared_observations:r,unreachable_exit_codes:_}}function Se(e){return e.applied===0&&e.failed>0?{outcome:"dependency_failed",exit_code:a.DEPENDENCY_FAILED}:e.applied===0?{outcome:"no_effect",exit_code:a.NO_EFFECT}:e.skipped>0||e.failed>0||e.unmatched>0?{outcome:"partial_effect",exit_code:a.PARTIAL_EFFECT}:{outcome:"effect",exit_code:a.SUCCESS}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7df4fe91-e8a4-540f-8737-c67f2efa460e")}catch{}})();var x=[{exit_code:1,class:"generic_failure"},{exit_code:2,class:"usage"},{exit_code:3,class:"not_found"},{exit_code:4,class:"conflict"},{exit_code:5,class:"dependency_failed"}],L=new Map(x.map(e=>[e.exit_code,e.class]));function g(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].sort()}function q(e){if(!e)return[];let t=new Set,s=new Set;return e.map(o=>{let i=o.state.trim(),r=o.probe_id.trim(),d=g(o.entrypoints);if(!/^[a-z][a-z0-9_]*$/.test(i)||!/^[a-z][a-z0-9-]*$/.test(r)||d.length===0||t.has(i)||s.has(r))throw new TypeError("Invalid pm refusal state contract");return t.add(i),s.add(r),{state:i,probe_id:r,entrypoints:d,expected_exit_class:o.expected_exit_class}}).sort((o,i)=>o.state.localeCompare(i.state))}function F(e,t,s,o,i){return![[1,2,3,4,5].includes(e.exit_code),e.meaning.trim().length>0,e.recovery.trim().length>0,t.length>0,s.length>0,/^[a-z][a-z0-9_]*$/.test(o),i.every(r=>/^[a-z][a-z0-9_]*$/.test(r)),L.get(e.exit_code)===e.class].includes(!1)}function j(e,t){let s=e,o=new Set;for(;s.canonical_code!==s.code;){if(o.has(s.code))throw new TypeError(`Alias cycle in pm error code catalog: ${e.code}`);o.add(s.code);let i=t.get(s.canonical_code);if(!i)throw new TypeError(`Invalid pm error code contract: ${e.code}`);s=i}return s}function $(e){let t=new Map(e.map(s=>[s.code,s]));for(let s of e){let o=j(s,t);if(o.exit_code!==s.exit_code||o.class!==s.class)throw new TypeError(`Alias transport mismatch for pm error code: ${s.code}`);let i=e.filter(r=>r.code!==o.code&&r.canonical_code===o.code).map(r=>r.code).sort();if(s.code===o.code?JSON.stringify(s.aliases)!==JSON.stringify(i):s.aliases.length>0)throw new TypeError(`Invalid pm error code contract: ${s.code}`)}}function E(e){let t=new Set,s=e.map(o=>{let i=o.code.trim();if(!/^[a-z][a-z0-9_]*$/.test(i))throw new TypeError(`Invalid pm error code: ${JSON.stringify(o.code)}`);if(t.has(i))throw new TypeError(`Duplicate pm error code: ${i}`);t.add(i);let r=g(o.sources),d=g(o.emitting_commands),_=(o.canonical_code??i).trim(),c=g(o.aliases??[]),n=q(o.owned_states);if(!F(o,r,d,_,c))throw new TypeError(`Invalid pm error code contract: ${i}`);if(n.some(l=>l.expected_exit_class!==o.class))throw new TypeError(`Invalid pm refusal state exit class: ${i}`);return Object.freeze({...o,code:i,meaning:o.meaning.trim(),recovery:o.recovery.trim(),sources:r,emitting_commands:d,canonical_code:_,aliases:c,owned_states:n})});return $(s),Object.freeze(s.sort((o,i)=>o.code.localeCompare(i.code)))}function Ne(e,t){let s=C(e,t);return C(s.canonical_code??s.code,t)}function C(e,t){let s=e.trim(),o=t.find(i=>i.code===s);if(!o)throw new TypeError(`Unknown pm error code "${s}"`);return o}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1e8c03e6-149a-5819-a000-65e7e3b12f6d")}catch{}})();var z="Inspect the structured error guidance and retry the suggested command.",U=new Map(x.map(e=>[e.exit_code,e.class]));function T(e){return e.map(t=>{let s=`${t.code.replaceAll("_"," ")} condition.`,o={code:t.code,meaning:`${s.charAt(0).toUpperCase()}${s.slice(1)}`,stability:t.stable?"stable":"provisional",exit_code:t.exit_code,class:U.get(t.exit_code),recovery:z,sources:t.sources,emitting_commands:t.emitting_commands??["*"],canonical_code:t.canonical_code??t.code,aliases:t.aliases??[]};return t.owned_states&&(o.owned_states=t.owned_states),o})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7ff182fc-44e0-5a2e-93e9-5e24ba113e67")}catch{}})();var A=[{code:"acceptance_criteria_mutation_conflict",exit_code:2,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_remove_unmatched",exit_code:3,sources:["sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_semicolon_forbidden",exit_code:2,stable:!0,sources:["core/item/parse.ts"]},{code:"accepted_rejected_value",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"alias_collision",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"alias_target_missing",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"already_claimed_by",exit_code:4,stable:!0,sources:["sdk/lifecycle/claim.ts"],emitting_commands:["claim"]},{code:"ambiguous_option_combination",exit_code:2,stable:!0,sources:["sdk/lifecycle/claim.ts","sdk/lifecycle/plan.ts"],emitting_commands:["claim","plan"]},{code:"annotation_alias_conflict",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"annotation_flag_like_value",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_if_absent_without_append",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_message_without_text",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_transposed_subcommand",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"append_empty_body",exit_code:2,stable:!0,sources:["sdk/lifecycle/append.ts"],emitting_commands:["append"]},{code:"assurance_registry_invalid",exit_code:1,sources:["sdk/governance/assurance.ts"]},{code:"bare_comma_entry_ambiguous",exit_code:2,sources:["core/item/parse.ts"]},{code:"blocker_identity_read_failed",exit_code:1,sources:["sdk/query/declared-blockers.ts"]},{code:"body_file_conflicts_with_body",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_missing_path",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_unreadable",exit_code:3,stable:!0,sources:["core/io/body-file.ts"]},{code:"budget_exceeded",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"bulk_create_route",exit_code:2,sources:["cli/register-mutation.ts"]},{code:"bulk_ids_input_empty",exit_code:2,sources:["core/io/bulk-ids-input.ts","sdk/history-compact.ts","sdk/history-mcp.ts"],owned_states:[{state:"bulk_ids_stdin_contains_no_nonempty_ids",probe_id:"bulk-ids-stdin-empty",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_missing_path",exit_code:2,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_token_omits_its_path",probe_id:"bulk-ids-file-path-missing",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_unreadable",exit_code:3,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_path_cannot_be_read",probe_id:"bulk-ids-file-unreadable",entrypoints:["update-many"],expected_exit_class:"not_found"}]},{code:"bundle_integrity_torn_install",exit_code:1,stable:!0,sources:["cli/bundle-integrity.ts"]},{code:"capability_undeclared",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"capability_unused",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"child_projection_item_bound_exceeded",exit_code:1,stable:!0,sources:["sdk/item-children.ts"]},{code:"close_reason_required",exit_code:2,stable:!0,sources:["sdk/lifecycle-policy.ts","sdk/lifecycle/close-many.ts"],emitting_commands:["*","close-many"]},{code:"close_through_update",exit_code:1,stable:!0,sources:["core/telemetry/observability.ts"]},{code:"close_validation_missing_fields",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"collected_zero_items",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"collection_transposed_subcommand",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"command_failed",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"command_namespace",exit_code:2,stable:!0,sources:["sdk/cli-contracts/runtime-contracts.ts"]},{code:"command_override_conflict",exit_code:4,stable:!0,sources:["sdk/compose.ts"]},{code:"config_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"config_key_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"config_value_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"conflicting_lifecycle_owner",exit_code:2,stable:!0,sources:["cli/register-operations.ts"]},{code:"context_evaluation_read_incomplete",exit_code:2,sources:["sdk/context-relevance.ts"]},{code:"context_signal_store_invalid",exit_code:2,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_stale",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_write_failed",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_takes_no_item_argument",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"core_item_field_requires_dedicated_flag",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"create_positional_type_without_title",exit_code:2,stable:!0,sources:["cli/register-mutation.ts"]},{code:"dependency_cardinality_created",exit_code:2,sources:["sdk/graph/cardinality-integrity.ts"]},{code:"dependency_edge_not_allowed",exit_code:2,stable:!0,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_flag_value_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_remove_no_match",exit_code:3,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"dependency_target_not_found",exit_code:3,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_temporal_order_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"duplicate_canonical_flag",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"duplicate_command",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"duplicate_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"duplicate_edge",exit_code:1,stable:!0,sources:["sdk/graph/remediation.ts"]},{code:"duplicate_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"duplicate_probe",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"duplicate_sweep_cost_limit",exit_code:4,stable:!0,sources:["sdk/query/duplicate-candidates.ts"],emitting_commands:["duplicate-candidates"]},{code:"duplicate_target_circular",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_is_duplicate",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_missing",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_self",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"empty_corpus",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"empty_surface",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"error_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-closure.ts","sdk/agent/tracker-preflight-contracts.ts"]},{code:"event_cursor_query_mismatch",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"event_history_integrity_failed",exit_code:1,sources:["core/history/event-index.ts"]},{code:"event_index_unavailable",exit_code:1,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"exit_code_mismatch",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"expect_hash_background_unsupported",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invalid",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invocation_rewritten",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_requires_mutation",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_target_required",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expected_revision_duplicate",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"expected_revision_scope_conflict",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"extension_command_activation_failed",exit_code:1,stable:!0,sources:["cli/commander-usage.ts"]},{code:"extension_dependency_name_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_spec_invalid",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_version_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_flag_value_invalid",exit_code:2,sources:["cli/extension-command-options.ts"]},{code:"extension_install_incomplete_source_scan",exit_code:2,sources:["sdk/extension/install-plan.ts"]},{code:"extension_install_rollback_failed",exit_code:1,sources:["sdk/extension/install-snapshot.ts"]},{code:"extension_install_soft_failed",exit_code:1,stable:!0,sources:["cli/register-setup.ts"]},{code:"extension_install_source_contains_destination",exit_code:2,stable:!0,sources:["sdk/extension/install-runtime.ts"]},{code:"extension_item_field_reserved",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_type_conflict",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_unknown",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_mutation_guard_failed",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_decision",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_denial",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_timed_out",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_read_output_invalid",exit_code:2,sources:["sdk/read-output/extension.ts"]},{code:"extension_update_health_partial_coverage",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"extensions_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"field_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_mcp_input_collision",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"github_source_entry_unbuilt",exit_code:2,stable:!0,sources:["sdk/extension/shared.ts"]},{code:"hierarchy_cardinality_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_cycle_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_parent_divergence_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"history_author_acknowledge_plan_conflict",exit_code:4,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_plan_fingerprint_required",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_preview_limit_invalid",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_required_values_missing",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_conflict",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_required",exit_code:2,stable:!0,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_not_actionable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_unreadable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_baseline_unavailable",exit_code:1,sources:["core/history/projection.ts"]},{code:"history_drift_chain_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_chain_mismatches"]},{code:"history_drift_hash_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_hash_mismatches"]},{code:"history_drift_merge_receipt",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_missing_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_missing_streams"]},{code:"history_drift_unreadable_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_unreadable_streams"]},{code:"history_drift_version_skew",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_version_skews"]},{code:"history_json_invalid",exit_code:1,sources:["core/history/read.ts"]},{code:"history_merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/history/read.ts"],canonical_code:"merge_conflict_markers_detected"},{code:"history_replay_invalid",exit_code:1,sources:["core/history/projection.ts","core/history/tombstone.ts"]},{code:"history_salvage_refused",exit_code:4,sources:["sdk/history/salvage.ts"]},{code:"history_stream_over_compact_threshold",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"history_target_out_of_range",exit_code:1,stable:!0,sources:["core/history/projection.ts"]},{code:"history_timestamp_invalid",exit_code:1,sources:["core/history/event-index.ts","core/history/history.ts"]},{code:"history_union_rebase_conflict",exit_code:4,sources:["sdk/merge/history-scalar-rebase.ts"]},{code:"history_unknown_author_events",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_unknown_author_events"]},{code:"history_version_mapping_unavailable",exit_code:2,sources:["core/history/version-address.ts"]},{code:"history_version_pruned",exit_code:2,sources:["core/history/projection.ts"]},{code:"host_environment_capacity_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_operation_invalid",exit_code:2,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_permission_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_resource_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"improvement_metric_contract_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"improvement_observation_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"incomplete_allowed_values",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"inconsistent_concept_kind",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"init_existing_settings_requires_force",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_gitignore_unwritable",exit_code:1,stable:!0,sources:["sdk/workspace.ts"]},{code:"init_id_prefix_conflict",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_id_prefix_path_like",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"integrity_history_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_storage_history_conflict_markers"]},{code:"integrity_history_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_history_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_ahead_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_ahead_items"]},{code:"integrity_item_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_outdated_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_outdated_items"]},{code:"integrity_item_parse_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"invalid_argument_value",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/item/priority.ts","core/telemetry/observability.ts","sdk/config.ts","sdk/context-intent-contracts.ts","sdk/dependencies.ts","sdk/governance/assurance-mutation-error.ts","sdk/lifecycle/create.ts","sdk/lifecycle/task-composition.ts","sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts","sdk/query/next.ts","sdk/runtime-input.ts","sdk/runtime/mutation-admission.ts","sdk/runtime/mutation-value-validation.ts","sdk/runtime/schema-preview.ts","sdk/workspace.ts"],emitting_commands:["*","create","next","task-composition","update","update-many"]},{code:"invalid_command_usage",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts"]},{code:"invalid_event_cursor",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_cursor_mode",exit_code:2,sources:["cli/register-list-query.ts","sdk/mutation-events.ts","sdk/runtime-extended-actions.ts"]},{code:"invalid_event_follow_interval",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_limit",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_since",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_history_analytics_limit",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_minimum_sample",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_since",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_improvement_ledger",exit_code:1,sources:["sdk/improvement-ledger-validation.ts"]},{code:"invalid_improvement_metric",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_limit",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_timestamp",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_provenance_predicate",exit_code:2,stable:!0,sources:["sdk/history-provenance.ts"]},{code:"invalid_query_cursor",exit_code:2,stable:!0,sources:["sdk/pagination.ts","sdk/query/window-pagination.ts"]},{code:"invalid_read_output_session",exit_code:2,sources:["sdk/read-output-session.ts"]},{code:"invalid_reproducible_process_environment",exit_code:2,sources:["sdk/reproducibility/process.ts"]},{code:"invalid_workspace_snapshot_target",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"item_already_active",exit_code:4,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"item_already_exists",exit_code:4,stable:!0,sources:["sdk/lifecycle/create.ts"],emitting_commands:["create"]},{code:"item_deleted",exit_code:3,sources:["core/history/tombstone.ts"]},{code:"item_document_encoding_invalid",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_document_invalid",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_document_roundtrip_failed",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_format_version_unsupported",exit_code:4,sources:["core/item/item-format.ts"]},{code:"item_id_collision",exit_code:4,stable:!0,sources:["sdk/lifecycle/copy.ts"],emitting_commands:["copy"]},{code:"item_identity_ambiguous",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_identity_conflict",exit_code:4,sources:["sdk/governance/validate-history-drift.ts","sdk/lifecycle/item-revision.ts","sdk/merge/three-way.ts","sdk/query/declared-blockers.ts"]},{code:"item_identity_reserved",exit_code:4,sources:["core/history/history.ts"]},{code:"item_not_found",exit_code:3,stable:!0,sources:["cli/error-guidance.ts","core/store/item-store.ts","core/telemetry/observability.ts","sdk/governance/validate-history-drift.ts"]},{code:"item_revision_conflict",exit_code:4,sources:["core/store/item-mutation-precondition.ts"]},{code:"likely_duplicate",exit_code:4,stable:!0,sources:["sdk/similarity.ts"]},{code:"linked_artifact_mutation_conflict",exit_code:2,sources:["sdk/linked-artifacts.ts"]},{code:"linked_resource_positional_value",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"linked_test_command_immutable",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_command_not_executable",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_context_invalid",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_patch_fields_unsupported",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_remove_no_match",exit_code:3,sources:["sdk/test/execution.ts"]},{code:"linked_test_update_ambiguous",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_update_no_match",exit_code:3,sources:["sdk/test/update.ts"]},{code:"linked_test_value_not_quoted",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"list_source_incomplete",exit_code:1,stable:!0,sources:["sdk/query/list.ts"],emitting_commands:["list"]},{code:"local_package_archive_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"local_source_not_found_bare_name",exit_code:3,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"lock_conflict",exit_code:4,stable:!0,sources:["cli/error-guidance.ts","core/lock/lock.ts","core/telemetry/observability.ts"]},{code:"lock_lost",exit_code:4,sources:["core/lock/lock.ts"]},{code:"lock_path_unsafe",exit_code:4,sources:["core/lock/lock-confinement.ts"]},{code:"locks_stale_count",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"locks_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"malformed_plan_step_evidence",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"managed_state_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"managed_state_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_capabilities_absent",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"manifest_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_unknown_key",exit_code:1,sources:["core/extensions/manifest-schema.ts"],owned_states:[{state:"author_workspace_manifest_declares_an_unknown_top_level_key",probe_id:"author-manifest-unknown-key",entrypoints:["health"],expected_exit_class:"generic_failure"}]},{code:"manifest_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"mcp_annotation_file_unavailable",exit_code:2,sources:["sdk/runtime-input.ts"]},{code:"mcp_stdin_unavailable",exit_code:2,sources:["sdk/annotations.ts"]},{code:"mcp_task_not_found_or_not_authorized",exit_code:3,sources:["sdk/mcp/tasks.ts"]},{code:"merge_artifacts_ignored",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_bun_launcher_unavailable",exit_code:5,sources:["sdk/merge/install.ts"]},{code:"merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/item/item-format.ts"],aliases:["history_merge_conflict_markers_detected"]},{code:"merge_decisions_unreviewed",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_driver_configuration_drift",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_driver_configuration_missing",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_fence_drift",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_fence_missing",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_git_config_unwritable",exit_code:5,stable:!0,sources:["sdk/merge/install.ts"]},{code:"merge_receipt_evidence_invalid",exit_code:4,sources:["core/diagnostics/remediation.ts","sdk/merge/reconcile.ts"]},{code:"merge_receipt_history_reference_missing",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_receipt_not_portable",exit_code:4,sources:["sdk/merge/receipts.ts"]},{code:"merge_receipts_pending",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_reconcile_receipt_evidence_untrusted",exit_code:4,sources:["sdk/history-repair.ts"]},{code:"merge_root_not_found",exit_code:3,stable:!0,sources:["sdk/merge/install.ts"]}];(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a831620-2973-5048-b691-f90e85f99dc2")}catch{}})();var O=[{code:"merge_settlement_hook_conflict",exit_code:4,sources:["sdk/merge/settlement-hook.ts"]},{code:"merge_settlement_review_required",exit_code:4,sources:["sdk/merge/ignored-artifacts.ts","sdk/merge/reconcile.ts","sdk/merge/stage.ts"]},{code:"missing_allowed_values",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"missing_budget",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"missing_cli_flag",exit_code:1,sources:["sdk/cli-contracts/tool-option-contracts.ts"]},{code:"missing_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"missing_directory",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"missing_init_recovery",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"missing_lifecycle_target",exit_code:2,stable:!0,sources:["sdk/extension.ts"]},{code:"missing_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"missing_observed_signature",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"missing_parameter_alias",exit_code:1,sources:["sdk/cli-contracts/tool-option-contracts.ts"]},{code:"missing_positive_execution_receipt",exit_code:1,sources:["sdk/test/execution.ts"]},{code:"missing_probe",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"missing_required_argument",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","cli/main.ts","cli/register-mutation.ts","cli/schema/registration.ts","core/telemetry/observability.ts","sdk/governance/assurance-action.ts","sdk/history-redact.ts","sdk/invocation-author.ts","sdk/lifecycle/claim.ts"],emitting_commands:["*","claim"]},{code:"missing_required_option",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/context-intent-contracts.ts","sdk/lifecycle/create.ts","sdk/lifecycle/plan.ts"],emitting_commands:["*","create","plan"]},{code:"missing_suggested_retry",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"missing_suggested_retry_args",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"module_import_failed",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"multi_target_github_install_ambiguous",exit_code:2,stable:!0,sources:["cli/register-setup.ts"]},{code:"mutation_author_required",exit_code:2,stable:!0,sources:["sdk/mutation-guard.ts"]},{code:"mutation_document_unreadable",exit_code:2,sources:["cli/register-structured-mutation.ts"]},{code:"mutation_option_value_invalid",exit_code:2,sources:["sdk/lifecycle/mutation-option-validation.ts"],emitting_commands:["item mutate"]},{code:"mutation_secret_guard_blocked",exit_code:4,stable:!0,sources:["sdk/mutation-guard.ts"]},{code:"no_matching_tests",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_projects_matched_filters",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_test_files_found",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_tests_found",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"no_update_fields",exit_code:1,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts"]},{code:"no_version_bounds_declared",exit_code:1,sources:["core/extensions/manifest-schema.ts"],owned_states:[{state:"author_workspace_manifest_omits_canonical_pm_version_bounds",probe_id:"author-manifest-version-bounds-missing",entrypoints:["health"],expected_exit_class:"generic_failure"}]},{code:"non_refusal_exit",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"npm_pack_json_shape_unsupported",exit_code:1,sources:["sdk/extension/install-sources.ts"]},{code:"npm_package_archive_missing",exit_code:1,sources:["sdk/extension/install-sources.ts"]},{code:"npm_package_archive_unsafe",exit_code:1,sources:["sdk/extension/install-sources.ts"]},{code:"npm_package_not_found",exit_code:3,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"ownership_conflict",exit_code:4,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/annotations.ts"]},{code:"ownership_dependency_bypass_restricted_options",exit_code:1,stable:!0,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"ownership_metadata_bypass_restricted_options",exit_code:1,stable:!0,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"package_spec_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"package_upgrade_modes_mutually_exclusive",exit_code:2,sources:["sdk/governance/upgrade.ts"]},{code:"positional_shape_budget_exceeded",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"positional_signature_mismatch",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"profile_name_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"profile_name_not_normalized",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"profile_summary_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"profile_title_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"project_runtime_history_epoch_incompatible",exit_code:4,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_runtime_item_format_incompatible",exit_code:4,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_runtime_stale_mutation",exit_code:4,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_runtime_stale_read",exit_code:1,sources:["sdk/environment/project-runtime-compatibility.ts"]},{code:"project_schema_field_requires_declared_flag",exit_code:2,sources:["core/extensions/item-fields.ts"]},{code:"projection_options_mutually_exclusive",exit_code:2,sources:["sdk/query/get.ts","sdk/query/list.ts","sdk/query/search-contracts.ts"],emitting_commands:["get","list","search"]},{code:"provenance_value_domain_invalid",exit_code:2,sources:["core/diagnostics/remediation.ts"]},{code:"read_output_cursor_command_mismatch",exit_code:2,sources:["sdk/read-output/continuation.ts"]},{code:"read_output_cursor_invalid",exit_code:2,sources:["sdk/read-output/continuation.ts"]},{code:"read_output_cursor_stale",exit_code:2,sources:["sdk/read-output/continuation.ts"]},{code:"recovery_kind_mismatch",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"redundant_edge",exit_code:1,stable:!0,sources:["sdk/graph/remediation.ts"]},{code:"refusal_allowed_values_mismatch",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_error_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_exit_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_mutated_state",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_probe_missing",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"refusal_recovery_failed",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"reindex_already_running",exit_code:4,stable:!0,sources:["sdk/governance/reindex.ts"]},{code:"removed_canonical_spelling",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"removed_compatibility_spelling",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"reopen_reason_required",exit_code:2,sources:["sdk/lifecycle/reopen.ts"],emitting_commands:["item reopen"]},{code:"reopen_receipt_missing",exit_code:1,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"reopen_target_status_invalid",exit_code:2,sources:["sdk/lifecycle/reopen.ts"],emitting_commands:["item reopen"]},{code:"reported_zero_passes",exit_code:1,sources:["sdk/test/execution-receipts.ts"]},{code:"reported_zero_tests",exit_code:1,sources:["sdk/test/execution-receipts.ts"]},{code:"reserved_item_field",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"retry_failed",exit_code:1,sources:["sdk/agent/refusal-closure.ts","sdk/agent/tracker-preflight-contracts.ts"]},{code:"schema_migration_input_required",exit_code:2,stable:!0,sources:["cli/migration-gates.ts"]},{code:"semantic_spelling_collision",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"settings_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"settings_read_fs_error",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_read_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_read_invalid_schema",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_read_merge_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"settings_section_document_malformed",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_document_missing",exit_code:3,sources:["core/store/settings-sections.ts"]},{code:"settings_section_invalid",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_name_invalid",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_reserved",exit_code:2,sources:["core/store/settings-sections.ts"]},{code:"settings_section_revision_conflict",exit_code:4,sources:["core/store/settings-sections.ts"]},{code:"settings_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"settings_write_assigned_path_invalid",exit_code:2,sources:["core/store/settings.ts"]},{code:"settings_write_invalid_existing_json",exit_code:2,sources:["core/store/settings.ts"]},{code:"settings_write_invalid_existing_schema",exit_code:2,sources:["core/store/settings.ts"]},{code:"stale_budget",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"stale_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"stale_observed_signature",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"stale_revision",exit_code:4,sources:["core/store/item-store.ts"]},{code:"start_blocked_by_open_dependency",exit_code:4,sources:["sdk/lifecycle/start-blockers.ts"],emitting_commands:["claim","start-task","update"]},{code:"status_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"status_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"status_lifecycle_role_required",exit_code:2,sources:["sdk/schema.ts"]},{code:"stdin_json_invalid",exit_code:2,stable:!0,sources:["sdk/structured-mutations.ts"]},{code:"stdin_json_persisted_annotation_changed",exit_code:2,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"stdin_json_unknown_key",exit_code:2,stable:!0,sources:["sdk/structured-mutations.ts"]},{code:"structured_event_immutable",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"structured_event_input_conflict",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"structured_event_json_empty",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"structured_event_json_invalid",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"structured_event_since_invalid",exit_code:2,stable:!0,sources:["sdk/notes.ts"]},{code:"suggested_retry_args_mismatch",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"telemetry_endpoint_probe_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_endpoint_probe_http_status",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_otel_export_failing",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_queue_high_retries",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_queue_invalid_rows",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_queue_pending",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_schema_version_behind",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"telemetry_state_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"template_type_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"terminal_plan_mutation",exit_code:4,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"terminal_state_conflict",exit_code:4,stable:!0,sources:["core/telemetry/observability.ts","sdk/lifecycle/claim.ts"],emitting_commands:["*","claim"]},{code:"test_measure_requires_execution",exit_code:2,sources:["sdk/test/prerequisites.ts"]},{code:"test_measure_requires_run",exit_code:2,sources:["sdk/test/prerequisites.ts"]},{code:"text_unpaired_surrogate",exit_code:2,sources:["core/item/item-format.ts","core/shared/output-unicode.ts"]},{code:"tracked_runtime_cache_files",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_storage_tracked_runtime_cache_files"]},{code:"tracker_not_initialized",exit_code:3,stable:!0,sources:["cli/error-guidance.ts","core/store/tracker-preflight.ts","core/telemetry/observability.ts"],owned_states:[{state:"selected_tracker_root_exists_without_settings",probe_id:"tracker-root-settings-missing",entrypoints:["list"],expected_exit_class:"not_found"}]},{code:"tracker_root_missing",exit_code:3,stable:!0,sources:["core/store/tracker-preflight.ts"],owned_states:[{state:"selected_tracker_root_does_not_exist",probe_id:"tracker-root-missing",entrypoints:["list"],expected_exit_class:"not_found"}]},{code:"tracker_root_not_directory",exit_code:2,stable:!0,sources:["core/store/tracker-preflight.ts"],owned_states:[{state:"selected_tracker_root_is_a_regular_file",probe_id:"tracker-root-not-directory",entrypoints:["list"],expected_exit_class:"usage"}]},{code:"tracker_root_unreadable",exit_code:1,sources:["core/store/tracker-preflight.ts"],owned_states:[{state:"selected_tracker_root_is_not_readable",probe_id:"tracker-root-unreadable",entrypoints:["list"],expected_exit_class:"generic_failure"}]},{code:"transaction_abandoned",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_committed",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_create_compensated",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"transaction_journal_invalid",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_partial_mutation",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"transaction_plan_mismatch",exit_code:4,sources:["sdk/workspace-transaction.ts"]},{code:"transaction_preview_external_schema",exit_code:2,sources:["sdk/item-transaction.ts"]},{code:"transaction_preview_non_regular_file",exit_code:2,sources:["core/fs/fs-utils.ts"]},{code:"transaction_preview_snapshot_changed",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"transaction_recovery_plan_missing",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"type_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"type_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"undeclared_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"unexpected_refusal_probe",exit_code:1,sources:["sdk/agent/refusal-corpus-contracts.ts"]},{code:"unknown_command",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts","sdk/cli-contracts/runtime-contracts.ts"]},{code:"unknown_context_intent",exit_code:2,stable:!0,sources:["sdk/context-intent-contracts.ts"]},{code:"unknown_error",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"unknown_field",exit_code:3,stable:!0,sources:["sdk/schema.ts"]},{code:"unknown_field_projection",exit_code:2,stable:!0,sources:["sdk/query/get.ts","sdk/query/list.ts","sdk/query/search-contracts.ts"],emitting_commands:["get","list","search"]},{code:"unknown_item_type",exit_code:3,stable:!0,sources:["sdk/schema.ts"]},{code:"unknown_lifecycle_action",exit_code:2,stable:!0,sources:["sdk/agent/subcommand-recovery.ts"],canonical_code:"unknown_subcommand"},{code:"unknown_noun",exit_code:2,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"unknown_option",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","cli/runtime/invocation-options.ts","core/telemetry/observability.ts"],owned_states:[{state:"declared_option_is_rejected_on_the_selected_command_path",probe_id:"cross-command-unknown-option",entrypoints:["deps"],expected_exit_class:"usage"}]},{code:"unknown_plan_template",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"unknown_provenance_dimension",exit_code:2,stable:!0,sources:["sdk/history-provenance.ts"]},{code:"unknown_status",exit_code:3,stable:!0,sources:["sdk/schema.ts"]},{code:"unknown_subcommand",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","sdk/agent/subcommand-recovery.ts"],aliases:["unknown_lifecycle_action"],owned_states:[{state:"config_action_token_is_not_declared",probe_id:"config-unknown-action",entrypoints:["config"],expected_exit_class:"usage"},{state:"graph_command_token_is_not_declared",probe_id:"graph-unknown-subcommand",entrypoints:["graph"],expected_exit_class:"usage"},{state:"nested_command_token_is_not_declared_by_its_family",probe_id:"schema-unknown-subcommand",entrypoints:["schema"],expected_exit_class:"usage"},{state:"package_lifecycle_token_is_not_declared",probe_id:"package-unknown-action",entrypoints:["package"],expected_exit_class:"usage"}]},{code:"unsafe_init_recovery",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"unsupported_update_option",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"upsert_key_ambiguous",exit_code:4,sources:["sdk/structured-mutations.ts"]},{code:"upsert_key_conflict",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"upsert_key_duplicate",exit_code:2,sources:["sdk/item-transaction.ts","sdk/structured-mutations.ts"]},{code:"upsert_key_missing",exit_code:2,sources:["sdk/structured-mutations.ts"]},{code:"upsert_match_changed",exit_code:4,sources:["sdk/item-transaction.ts"]},{code:"validate_command_references_stale_pm_ids",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_files_missing_linked_paths",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_files_orphaned_paths",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_files_tracked_all_strict_forces_pm_internals",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_format_version_ahead_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"integrity_item_ahead_format_version"},{code:"validate_format_version_outdated_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"integrity_item_outdated_format_version"},{code:"validate_hierarchy_parent_cycle",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_hierarchy_parent_cycle_error",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_history_drift_chain_mismatches",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_chain_mismatch"},{code:"validate_history_drift_hash_mismatches",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_hash_mismatch"},{code:"validate_history_drift_missing_streams",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_missing_stream"},{code:"validate_history_drift_unreadable_streams",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_unreadable_stream"},{code:"validate_history_drift_version_skews",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_drift_version_skew"},{code:"validate_history_unknown_author_events",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"history_unknown_author_events"},{code:"validate_lifecycle_active_closure_like_metadata",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_active_terminal_parent",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_dependency_cycles",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_dependency_cycles_error",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_lifecycle_stale_blockers",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_merge_decisions_unreviewed",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"validate_merge_driver_configuration",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"validate_merge_fence_drift",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_custom_profile_missing_required_fields",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_duplicate_issue_codes",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_acceptance_criteria",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_close_reason",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_closed_at",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_confidence",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_estimate",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_release",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_reviewer",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_risk",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_metadata_missing_sprint",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_resolution_missing_fields",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_duplicate_item_ids",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_history_conflict_markers",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"integrity_history_conflict_marker"},{code:"validate_storage_resurrected_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_tracked_runtime_cache_files",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],canonical_code:"tracked_runtime_cache_files"},{code:"validate_storage_unparseable_config",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_unparseable_history",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"validate_storage_unreadable_items",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"vectorization_embedding_identity_changed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"vectorization_stale_items_remaining",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"visible_surface_ceiling_exceeded",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"workflow_duplicate_type",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_policy_approval_history_invalid",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_audit_failed",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_input_unreadable",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_invalid",exit_code:2,sources:["core/policy/workflow-policy.ts"]},{code:"workflow_policy_refused",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_policy_registry_invalid",exit_code:4,sources:["core/policy/workflow-policy-store.ts"]},{code:"workflow_status_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_transition_malformed",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_type_empty",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workflow_type_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"workspace_history_chain_invalid",exit_code:4,sources:["core/history/workspace-history.ts"]},{code:"workspace_history_state_conflict",exit_code:4,stable:!0,sources:["core/history/workspace-history.ts"]},{code:"workspace_root_pm_path",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"workspace_snapshot_force_required",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_manifest_mismatch",exit_code:4,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_name_reserved_fingerprint",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_not_found",exit_code:3,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_permission_denied",exit_code:1,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_resource_exhausted",exit_code:1,sources:["sdk/workspace-snapshot.ts"]},{code:"workspace_snapshot_storage_exhausted",exit_code:1,sources:["sdk/workspace-snapshot.ts"]},{code:"wrong_item_type",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]}];(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b525d8c8-3a70-52bd-83db-c956aba0c6fb")}catch{}})();var ze=E(T([...A,...O]));(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c2e89d3c-9abc-5ca7-a290-69a54dd694ab")}catch{}})();var G=Object.freeze({"--body":"Set the item body.","--body-file":"Read the item body from a file, or from stdin when set to -.","--description":"Set the item description.","--stdin":"Read the value from stdin.","--stdin-json":"Read a complete JSON document from stdin."}),B=new Set(["--add","--body","--comment","--dep","--dep-remove","--description","--doc","--event","--field","--file","--learning","--note","--remove","--reminder","--test","--type-option"]),V=new Set(["append","comments","create","docs","files","learnings","notes","test","update","update-many"]),Y=new Set(["close-many:--ids","comments:--file","create:--body-file","history-compact:--ids","learnings:--file","notes:--file","update:--body-file","update-many:--ids"]),X=new Set(["close-many:--ids","history-compact:--ids","update-many:--ids"]),W=["--allow-","--check-","--dry-run","--explain","--fail-","--fix-","--full","--has-","--include-","--json","--no-","--prune-","--quiet","--refresh-","--require-","--runtime-only","--schema-only","--skip-","--stream","--strict-","--summary","--today","--verbose"],H=new Set(["--activate","--active-only","--adopt","--adopt-all","--all","--all-actionable","--all-affected-ids","--all-day","--all-streams","--acknowledge-linked-tests","--append-stable","--auto-fix","--auto-pm-context","--availability-only","--background","--brief","--by-assignee","--by-priority","--by-tag","--catalog","--claim","--clear","--clear-comments","--clear-criteria","--clear-deps","--clear-docs","--clear-events","--clear-files","--clear-learnings","--clear-notes","--clear-reminders","--clear-tests","--clear-type-options","--cli-only","--closed","--compact","--completion","--count","--counts","--deactivate","--declarative","--defaults","--describe","--diff","--doctor","--empty-body","--explore","--field-utilization","--filter-empty-body","--flags-only","--follow","--force","--global","--highlight","--hybrid","--id-only","--if-available","--ignore-global","--include_unparented","--infer","--init","--install","--isolated","--lean","--list","--local","--manage","--markdown","--metadata-coverage","--next","--normalize-provenance","--only","--only-last","--output-row-contract","--override-linked-pm-context","--override-linked-workspace-context","--packages-only","--past","--phrase-exact","--profile","--progress","--project","--promote-to-item-dep","--provenance","--provenance-summary","--raw","--ready-only","--ready_only","--rebuild","--recent","--reload","--repair","--replace-deps","--replace-docs","--replace-files","--replace-tests","--required","--required-on-create","--run","--runtime-probe","--save-baseline","--scaffold","--semantic","--shared-host-safe","--storage","--title-exact","--token-accounting","--trace","--tree","--unbounded","--uninstall","--validate-paths","--verify","--watch","--with-packages"]),J=new Set(["--only-index"]),K=new Set(["activity:--stream","eval:--fail-under","validate:--fix-scope"]),Q=new Set(["activity:--stream","close:--validate-close","close-many:--validate-close","comments:--author","learnings:--author","notes:--author"]),Z=new Set(["--regression"]);function ee(e,t){return t==="--stdin"||t==="--stdin-json"?["stdin"]:Y.has(`${e}:${t}`)?["argv","file","stdin"]:t.endsWith("-file")?["argv","file"]:B.has(t)&&V.has(e)?["argv","stdin"]:["argv"]}function te(e,t){let s=K.has(`${e}:${t.flag}`)||t.value_name!==void 0||t.value_type==="string"||t.value_type==="number"||t.list===!0||t.repeatable===!0,o=t.value_type==="boolean"||t.flag==="--stdin"||t.flag==="--stdin-json"||t.flag.startsWith("--filter-")&&(t.flag.endsWith("-missing")||t.flag.startsWith("--filter-has-")||t.flag.startsWith("--filter-no-"))||W.some(i=>t.flag.startsWith(i));return s||J.has(t.flag)||!H.has(t.flag)&&!o}function se(e,t){return t.value_arity!==void 0?t.value_arity:te(e,t)?Z.has(t.flag)||Q.has(`${e}:${t.flag}`)?"optional":"required":"none"}function oe(e,t){let s=f(e),o=se(s,t),i=o!=="none",r=ee(s,t.flag),d=t.description??G[t.flag]??`${i?"Set":"Enable"} ${t.flag.slice(2).replaceAll("-"," ")}.`;return{...t,description:d,takes_value:i,value_required:o==="required",...i?{value_name:t.value_name??"value"}:{},value_type:i?t.value_type??"string":"boolean",required:t.required===!0,repeatable:t.repeatable===!0||t.list===!0,input_sources:r,...r.includes("stdin")&&t.flag!=="--stdin"&&t.flag!=="--stdin-json"?{stdin_token:"-"}:{},...X.has(`${s}:${t.flag}`)?{file_token_prefix:"@"}:{}}}function Be(e,t){return t.map(s=>oe(e,s))}function Ve(e,t,s){let o=e.trim().toLowerCase(),i=[],r=new Map,d=0;for(let c of s)if(c.command.trim().toLowerCase()===o){if(d+=1,r.has(c.flag)){i.push({code:"duplicate_observation",command:o,flag:c.flag,detail:`${o} ${c.flag} was observed more than once.`});continue}r.set(c.flag,c)}let _=new Set(t.map(({flag:c})=>c));for(let c of t){let n=r.get(c.flag);if(!n){i.push({code:"missing_observation",command:o,flag:c.flag,detail:`${o} ${c.flag} has no executable option observation.`});continue}for(let[l,I]of[["takes_value","takes_value_mismatch"],["value_required","value_required_mismatch"],["repeatable","repeatable_mismatch"]])c[l]!==n[l]&&i.push({code:I,command:o,flag:c.flag,detail:`${o} ${c.flag} declares ${l}=${String(c[l])} but the executable option reports ${String(n[l])}.`})}for(let c of r.values())_.has(c.flag)||i.push({code:"undeclared_observation",command:o,flag:c.flag,detail:`${o} ${c.flag} is executable but absent from invocation contracts.`});return i.sort((c,n)=>c.flag.localeCompare(n.flag)||c.code.localeCompare(n.code)),{ok:i.length===0,declared_count:t.length,observed_count:d,findings:i}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="76c420db-b520-5fde-bd43-16a7324feb0a")}catch{}})();var ie=["mutation_receipt","entity","collection","diagnostic","stream"],ce=new Set(["append","claim","close","close-task","copy","create","delete","focus","pause-task","release","restore","start-task","update"]),re=new Set(["close-many","update-many"]),ae=new Set(["activity","comments","contracts","events","history","learnings","list","notes","search"]),ne=new Set(["aggregate","deps","graph","health","history-redact","history-repair","history-compact","stats","validate"]);function p(e){if(e.command.trim().length===0)throw new TypeError("command must be a non-empty command path");if(!ie.includes(e.kind))throw new TypeError(`Unsupported output envelope kind: ${e.kind}`);return e}function S(e){let t=e.trim().replace(/\s+/gu," "),[s=t]=t.split(" ");return re.has(s)?p({command:t,kind:"collection",wrapper_key:"rows",cardinality:"many",format_flag:"--json"}):ce.has(s)?p({command:t,kind:"mutation_receipt",wrapper_key:null,cardinality:"one",format_flag:"--json"}):ae.has(s)?p({command:t,kind:"collection",wrapper_key:s==="contracts"?null:"items",cardinality:"many",format_flag:"--json"}):ne.has(s)?p({command:t,kind:"diagnostic",wrapper_key:null,cardinality:"none",format_flag:"--json"}):p({command:t,kind:s==="get"?"entity":"diagnostic",wrapper_key:s==="get"?"item":null,cardinality:s==="get"?"one":"none",format_flag:"--json"})}var de=u.map(e=>S(e)),_e=new Map(de.map(e=>[e.command,e]));function He(e){let t=e.trim().replace(/\s+/gu," ");if(t.length===0)throw new TypeError("command must be a non-empty command path");let[s=t]=f(t).split(" "),o=_e.get(s);return o?{...o,command:t}:S(t)}function le(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(e){return le(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.status=="string"&&e.status.length>0&&Number.isSafeInteger(e.changed_field_count)&&Number(e.changed_field_count)>=0&&(e.close_reason===void 0||typeof e.close_reason=="string")&&(e.deleted===void 0||typeof e.deleted=="boolean")&&(e.previous_status===void 0||typeof e.previous_status=="string")&&(e.warnings===void 0||Array.isArray(e.warnings))}function Je(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){throw new TypeError(`Mutation receipt must be valid JSON: ${String(s)}`,{cause:s})}if(!ue(t))throw new TypeError("Mutation receipt must be a flat object with top-level id, status, and changed_field_count fields");return{id:t.id,status:t.status,changedFieldCount:t.changed_field_count,...typeof t.close_reason=="string"?{closeReason:t.close_reason}:{},...typeof t.deleted=="boolean"?{deleted:t.deleted}:{},...typeof t.previous_status=="string"?{previousStatus:t.previous_status}:{},...Array.isArray(t.warnings)?{warnings:t.warnings}:{}}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0c0bb7ab-6157-5861-ad7e-a63ae62220f4")}catch{}})();var me=new Set(["claim","close","context","create","get","help","init","list","next","plan","release","search","update","validate","workspace"]),pe=new Set(["append","comments","config","contracts","deps","docs","events","files","focus","graph","health","history","learnings","list-all","list-blocked","list-closed","list-in-progress","list-open","notes","profile","schema","test"]),fe=Object.freeze({workspace:new Set(["config","gc","health","init","merge","profile","schema","telemetry","workspace"]),intake:new Set(["copy","create","focus","item","restore"]),context:new Set(["activity","aggregate","context","ctx","duplicates","eval","get","help","list","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","next","search","stats"]),lifecycle:new Set(["claim","close","close-many","close-task","delete","pause-task","item-reopen","release","start-task","update","update-many"]),evidence:new Set(["append","comments","docs","events","files","history","history-attest","history-author-acknowledge","history-compact","history-redact","history-repair","learnings","notes"]),graph:new Set(["deps","graph","plan"]),quality:new Set(["assurance","contracts","test","test-all","validate"]),automation:new Set(["event","meet","remind"])}),ge=new Set(["extension","install","package","packages","upgrade"]);function xe(e){let t=m(e.trim().toLowerCase());if(t==="ops")return"quality";for(let[s,o]of Object.entries(fe))if(o.has(t))return s;return ge.has(t)?"extensions":"internal"}var y=Object.freeze([...u.flatMap(e=>e==="item"?["item","item-reopen"]:[e,...b.filter(t=>t.alias===e).map(t=>t.canonical)]).map(e=>({command:e,tier:me.has(m(e))?"core":pe.has(m(e))?"standard":"full",family:xe(e)})),{command:"ops",tier:"core",family:"quality"},{command:"completion-statuses",tier:"internal",family:"internal"},{command:"completion-tags",tier:"internal",family:"internal"},{command:"completion-types",tier:"internal",family:"internal"},{command:"test-runs-worker",tier:"internal",family:"internal"},{command:"item test worker",tier:"internal",family:"internal"}]),ye=y,et=Object.freeze({max_lines:50,max_utf8_bytes:6e3}),tt=Object.freeze(["-V, --version","--all","--json","--output-include <fields>","--output-limit <count>","--output-budget <tokens|unbounded>","--output-cursor <cursor>","--pm-path <dir>","--no-extensions","--no-pager","--explain","-h, --help"]);var M={core:0,standard:1,full:2,internal:3},N=new Map(ye.map(({command:e,tier:t})=>[e,t]));function st(e,t="standard"){return N.get(e.trim().toLowerCase())??N.get(m(e.trim().toLowerCase()))??t}function ot(e){return be(e,y)}function be(e,t){let s=M[e];return t.filter(o=>o.tier!=="internal"&&M[o.tier]<=s).map(o=>o.command)}function ke(e,t){return t.filter(s=>s.family===e).map(s=>s.command)}var he=["workspace","intake","context","lifecycle","evidence","graph","quality","automation","extensions","internal"],ve=new Set([...k.filter(e=>e.hidden).map(e=>e.alias),"ctx","extension","install","item-reopen","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","packages","upgrade"]);function it(e=y){return he.map(t=>({family:t,commands:ke(t,e).filter(s=>e.find(o=>o.command===s)?.tier!=="internal"&&!ve.has(s))})).filter(({commands:t})=>t.length>0)}var ct=Object.freeze({pm_append:"append",pm_claim:"claim",pm_close:"close",pm_comments:"comments",pm_config:"config",pm_context:"context",pm_contracts:"contracts",pm_copy:"copy",pm_create:"create",pm_deps:"deps",pm_discover:"help",pm_docs:"docs",pm_events:"history",pm_files:"files",pm_focus:"focus",pm_get:"get",pm_graph:"graph",pm_health:"health",pm_learnings:"learnings",pm_list:"list",pm_mutate:"update",pm_next:"next",pm_notes:"notes",pm_plan:"plan",pm_profile:"profile",pm_release:"release",pm_run:"package",pm_schema:"schema",pm_search:"search",pm_test:"test",pm_update:"update",pm_validate:"validate"});var rt=Object.freeze([{uri:"pm://workspace/context",name:"Workspace context",description:"Bounded project context for orientation, including active hierarchy and progress.",mimeType:"application/json"},{uri:"pm://workspace/focus",name:"Active focus",description:"The session focus that supplies the default create parent.",mimeType:"application/json"},{uri:"pm://workspace/claims",name:"Active claims",description:"Bounded in-progress work and active ownership context.",mimeType:"application/json"},{uri:"pm://workspace/agent-guide",name:"Agent guidance",description:"Repository-local AGENTS.md instructions, bounded for safe host attachment.",mimeType:"text/markdown"}]),at=Object.freeze([{name:"orient",description:"Build bounded live context, search all statuses, and select canonical work without creating duplicates.",arguments:[{name:"request",description:"The user's requested outcome or topic.",required:!0},{name:"scope",description:"Optional bounded workspace or subsystem scope.",required:!1}],template:"Orient to the live pm workspace for: {{request}}. Scope hint: {{scope}}. Read context, search all statuses, inspect full metadata for relevant items, and select canonical lineage before any mutation."},{name:"claim-and-start",description:"Claim one canonical item and begin implementation with linked context.",arguments:[{name:"id",description:"Canonical pm item id.",required:!0}],template:"Read {{id}} in full, claim it, set it in_progress, then implement only its acceptance scope while linking files, docs, tests, and evidence."},{name:"record-evidence-and-close",description:"Record exact verification evidence, close the item, and release ownership.",arguments:[{name:"id",description:"Canonical pm item id.",required:!0},{name:"evidence",description:"Exact verification and outcome evidence.",required:!0}],template:"For {{id}}, record this evidence: {{evidence}}. Verify linked tests, close only if acceptance is met, then release the claim."}]);export{D as a,w as b,R as c,Ee as d,Te as e,Ae as f,Oe as g,Se as h,x as i,E as j,Ne as k,C as l,ze as m,oe as n,Be as o,Ve as p,y as q,st as r,ot as s,it as t,ie as u,p as v,de as w,He as x,ue as y,Je as z};
|
|
2
|
+
//# sourceMappingURL=chunk-CZM75DE3.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-VWWTIX5L.js";import{g as d,pa as w,qa as u}from"./chunk-M6V7UMWL.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]="158d5065-075c-5355-a65c-f3edc9c5f1f0")}catch{}})();var _=new Map(d.map(e=>[e.toLowerCase(),e])),$=/^[A-Za-z][A-Za-z0-9_-]*$/;function g(e,t){if(!$.test(e))throw new Error(`${t} "${e}" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. "Spike" or "code-review").`)}function y(e){return _.get(e.trim().toLowerCase())}function A(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function I(e){return e.replace(/[\\"`$]/g,t=>`\\${t}`)}function b(e){let t=new Map;for(let o of e){let n=o.trim();if(n.length===0)continue;let i=n.toLowerCase();t.has(i)||t.set(i,n)}return[...t.values()].sort((o,n)=>o.localeCompare(n))}function S(e){let t=(e.name??"").trim();if(t.length===0)throw new Error("Type name must not be empty.");g(t,"Type name");let o=y(t);if(o)throw new Error(`Cannot redefine built-in item type "${o}". Built-in types are reserved: ${d.join(", ")}.`);let n=e.description?.trim(),i=e.defaultStatus?.trim(),r=e.folder?.trim(),a=r&&r.length>0?u(r):void 0,s=b(e.aliases??[]);for(let l of s){g(l,"Alias");let f=y(l);if(f)throw new Error(`Alias "${l}" collides with built-in item type "${f}". Built-in types are reserved: ${d.join(", ")}.`)}return{name:t,description:n&&n.length>0?n:void 0,defaultStatus:i&&i.length>0?i:void 0,folder:a,aliases:s}}function x(e,t){let o=e.name.toLowerCase(),n=new Map;for(let r of t.definitions){if(typeof r.name!="string")continue;let a=r.name.trim();if(!(a.length===0||a.toLowerCase()===o)){n.set(a.toLowerCase(),a);for(let s of A(r.aliases))s.trim().length>0&&n.set(s.trim().toLowerCase(),a)}}let i=n.get(o);if(i)throw new Error(`Type name "${e.name}" collides with an alias of existing item type "${i}".`);for(let r of e.aliases){let a=n.get(r.toLowerCase());if(a)throw new Error(`Alias "${r}" already maps to existing item type "${a}".`)}}function h(e,t){return typeof t=="string"&&t.trim().length>0?u(t).toLowerCase():w(e).toLowerCase()}function D(e,t,o){let n=e.name.toLowerCase(),i=h(e.name,e.folder),r=s=>{throw new Error(`Item type "${e.name}" would store items in folder "${i}", which already belongs to existing item type "${s}". Pass a distinct --folder to keep their storage separate.`)};for(let s of t.definitions){if(typeof s.name!="string")continue;let l=s.name.trim();l.length===0||l.toLowerCase()===n||h(l,s.folder)===i&&r(l)}let a=o?.get(i);a!==void 0&&a.toLowerCase()!==n&&r(a)}function j(e){if(e==null||e.trim().length===0)return{definitions:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/types.json contains invalid JSON.")}return{definitions:L(t)}}function L(e){let t=C(e);if(!t)return[];let o=[];for(let n of t){if(typeof n!="object"||n===null||Array.isArray(n))continue;let i=n;typeof i.name!="string"||i.name.trim().length===0||o.push(i)}return o}function C(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let o=t.item_types;if(Array.isArray(o.definitions))return o.definitions}}function z(e,t){let o=t.name.toLowerCase(),n=e.definitions.slice(),i=n.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===o),r=i>=0?n[i]:void 0,a=b([...A(r?.aliases),...t.aliases]),s={...r,name:t.name};return t.folder!==void 0&&(s.folder=t.folder),a.length>0?s.aliases=a:s.aliases!==void 0&&delete s.aliases,T(s,"description",t.description),T(s,"default_status",t.defaultStatus),i>=0?n[i]=s:n.push(s),n.sort((l,f)=>l.name.localeCompare(f.name)),{file:{definitions:n},definition:s,replaced:i>=0,...r&&typeof r.name=="string"?{previousName:r.name}:{}}}function F(e,t){let o=(t??"").trim();if(o.length===0)throw new Error("Type name must not be empty.");let n=y(o);if(n)throw new Error(`Cannot remove built-in item type "${n}". Built-in types are reserved: ${d.join(", ")}.`);let i=o.toLowerCase(),r=e.definitions.slice(),a=r.findIndex(l=>typeof l.name=="string"&&l.name.trim().toLowerCase()===i);if(a<0)return{file:{definitions:r},removed:!1};let[s]=r.splice(a,1);return{file:{definitions:r},removed:!0,definition:s}}function T(e,t,o){let n=e;o!==void 0&&(n[t]=o)}function M(e){return`${JSON.stringify({definitions:e.definitions},null,2)}
|
|
2
2
|
`}function E(e,t){let o=e.trim().length>0?e.trim():e,n=t?.trim()||".agents/pm/schema/types.json";return`To register a custom type, run: pm schema add-type "${I(o)}" (writes ${n}).`}function O(e,t,o){return`Invalid type value "${e}". Allowed: ${t.join(", ")}. ${E(e,o)}`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="77a7b77a-907c-541d-ac55-e06174dbbf11")}catch{}})();function v(e){return typeof e=="string"?e.trim().toLowerCase():""}function m(e,t){let o=c(e);return o.length===0?"":t?.alias_to_id?.get(o)??o}function U(e){let t=Array.isArray(e?.type_workflows)?e.type_workflows:[],o=new Map;for(let n of t){let i=v(n?.type);if(i.length===0||!Array.isArray(n?.allowed_transitions))continue;let r=n.allowed_transitions,a=o.get(i)??{pairs:[],denyAll:!1};r.length===0&&(a.denyAll=!0);for(let s of r){if(!Array.isArray(s)||s.length!==2)continue;let l=c(s[0]),f=c(s[1]);l.length===0||f.length===0||a.pairs.some(p=>p[0]===l&&p[1]===f)||a.pairs.push([l,f])}o.set(i,a)}return[...o.entries()].filter(([,n])=>n.pairs.length>0||n.denyAll).map(([n,i])=>({type:n,allowed_transitions:i.pairs})).sort((n,i)=>n.type.localeCompare(i.type))}function J(e){let t=v(e.typeName),o=e.typeWorkflows.find(r=>r.type===t);if(!o)return{allowed:!0,hasRule:!1,allowedTransitions:[]};let n=m(e.fromStatus,e.statusRegistry),i=m(e.toStatus,e.statusRegistry);return n.length>0&&n===i?{allowed:!0,hasRule:!0,allowedTransitions:o.allowed_transitions}:{allowed:o.allowed_transitions.some(r=>{let a=m(r[0],e.statusRegistry),s=m(r[1],e.statusRegistry);return a===n&&s===i}),hasRule:!0,allowedTransitions:o.allowed_transitions}}function W(e){return e.length===0?"(no transitions allowed)":e.map(t=>`${t[0]} -> ${t[1]}`).join(", ")}export{y as a,I as b,S as c,x as d,D as e,j as f,z as g,F as h,M as i,O as j,U as k,J as l,W as m};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-D2TBEBNW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as T,f as L}from"./chunk-7KK66ISG.js";import{M as f,N as D,aa as R,e as y,f as v}from"./chunk-O7EI33NP.js";import{fb as E,kb as x}from"./chunk-YMGB2O4E.js";import{j as I}from"./chunk-VWWTIX5L.js";import{a as k,b as C}from"./chunk-C3O6JJPO.js";import{Da as l,U as m,ra as g,xa as h,xc as _}from"./chunk-M6V7UMWL.js";import{A as s,C as w,z as a}from"./chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="59842825-3a81-53f4-845d-db2257ec6286")}catch{}})();async function X(e){let o=h(process.cwd(),e);await x(o);let i=await E(o),r=g(i,_());return{pmRoot:o,settings:i,typeRegistry:r}}async function j(e,o,i,r){l(e,y(o));let t=await f(e,o,i.id_prefix,i.item_format,r);if(t)return{id:t.id,historyPath:l(e,t.id),located:t};let n=v(o,i.id_prefix),d=y(o),c=n===d?[n]:[n,d];for(let p of c){let b=l(e,p);if(await w(b))return{id:p,historyPath:b,located:null}}throw new s(`Item ${o} not found`,a.NOT_FOUND)}import{readdir as P}from"node:fs/promises";import u from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="e9b7731d-e6f5-51a8-970b-462c0b728a9c")}catch{}})();function B(e,o){let i=new Map;for(let r of e){let t=r.external?r.id:o.get(r.id.toLowerCase())?.id??r.id;i.set(r.external?`external:${t}`:`local:${t.toLowerCase()}`,{...r,id:t})}return[...i.values()]}async function $(e,o){let i=u.basename(e),r=(await P(u.dirname(e)).catch(t=>{throw R("Cannot verify the blocker's physical file identity",{exitCode:a.GENERIC_FAILURE,context:{code:"blocker_identity_read_failed",required:"Restore access to the blocker item directory, then retry the item read."},cause:t})})).filter(t=>t.toLowerCase()===i.toLowerCase()).sort((t,n)=>+(n===i)-+(t===i)||t.localeCompare(n)).map(t=>u.parse(t).name)[0];if(r===void 0)throw new s(`Blocker canonical file disappeared during identity verification: ${o}`,a.CONFLICT,{code:"item_identity_conflict",required:"Restore the canonical blocker file and validate storage integrity before retrying the item read."});return r}async function te(e){let o=T(e.metadata);if(o.length===0)return[];let i=new Map([e.metadata.blocked_by,...(e.metadata.dependencies??[]).filter(t=>m(t.kind)==="blocked_by").map(t=>t.id)].filter(t=>typeof t=="string").map(t=>[t.trim().toLowerCase(),t.trim()])),r=new Map;for(let t of o){if(k(t)||!/^(?!\.{1,2}$)[^/\\:\0]+$/u.test(t)||e.metadata.dependencies?.some(c=>c.id.trim()===t&&m(c.kind)==="blocked_by"&&C(c.source_kind)))continue;let n=await f(e.pmRoot,i.get(t),e.settings.id_prefix,e.settings.item_format,e.typeToFolder);if(n===null)continue;let d=await D(n,{schema:e.settings.schema});if(n.id=await $(n.itemPath,n.id),d.document.metadata.id!==n.id)throw new s(`Blocker identity differs from its canonical file: ${n.id}`,a.CONFLICT,{code:"item_identity_conflict",required:"Restore the canonical blocker identity and validate storage integrity before retrying the item read."});r.set(t.toLowerCase(),d.document.metadata)}return B(L({blocked_by:e.metadata.blocked_by,dependencies:e.metadata.dependencies,updated_at:e.metadata.updated_at},r,I(e.settings.schema)),r)}export{X as a,j as b,$ as c,te as d};
|
|
2
|
+
//# sourceMappingURL=chunk-E56OXRYH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as T}from"./chunk-
|
|
1
|
+
import{c as T}from"./chunk-D2TBEBNW.js";import{a,d as I}from"./chunk-VWWTIX5L.js";import{Z as w,j as g,k as v,l as E}from"./chunk-M6V7UMWL.js";import{A as u,C as m,m as k,z as f}from"./chunk-G6ERMFJ5.js";import C from"node:fs/promises";import p 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]="74b72dd8-0877-55a4-9c80-d043f19e1f96")}catch{}})();var P=["extensions","docs","examples","assets","prompts"],U=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function R(e){return P.includes(e)}function q(e,t){if(t==null)return[];let n=Array.isArray(t)?t:[t],r=[];for(let o of n){if(typeof o!="string"||o.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);r.push(o.trim())}return[...new Set(r)].sort((o,i)=>o.localeCompare(i))}function G(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},n=e;for(let[r,o]of Object.entries(n)){if(!R(r))continue;let i=q(r,o);i.length>0&&(t[r]=i)}return t}function c(e,t){let n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}function S(e){if(!Array.isArray(e))return;let t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length>0?[...new Set(t)].sort((n,r)=>n.localeCompare(r)):void 0}function x(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function J(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={docs:c(t,"docs"),npm:c(t,"npm"),repository:c(t,"repository"),report:c(t,"report")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={image:c(t,"image"),video:c(t,"video")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={display_name:c(t,"display_name")??c(t,"displayName"),category:c(t,"category"),summary:c(t,"summary"),links:J(t.links),media:K(t.media),tags:S(t.tags)};return Object.values(n).some(r=>r!==void 0)?n:void 0}async function Y(e){let t=p.join(e,"package.json");if(!await m(t))return{source:"convention",resources:{}};let n;try{n=JSON.parse(await C.readFile(t,"utf8"))}catch(l){throw new u(`Failed to parse package manifest at "${t}": ${String(l)}`,f.USAGE)}if(typeof n!="object"||n===null||Array.isArray(n))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let r=n,o=r.pm,i=o!=null,s=typeof o=="object"&&o!==null&&!Array.isArray(o)?o:{};return{source:i?"pm":"convention",package_json_path:t,package_name:typeof r.name=="string"?r.name:void 0,package_version:typeof r.version=="string"?r.version:void 0,package_private:r.private===!0,package_description:typeof r.description=="string"?r.description:void 0,package_keywords:S(r.keywords),package_homepage:typeof r.homepage=="string"?r.homepage:void 0,package_repository_url:x(r.repository),package_bugs_url:x(r.bugs),aliases:S(s.aliases),resources:G(o),catalog:V(s.catalog)}}async function j(e){if(!await m(e))return[];let t=await C.readdir(e,{withFileTypes:!0}),n=[];for(let r of t){if(!r.isDirectory())continue;let o=p.join(e,r.name);await m(p.join(o,"manifest.json"))&&n.push(o)}return n.sort((r,o)=>r.localeCompare(o))}async function he(e){if(await m(p.join(e,"manifest.json")))return[e];let t=(await Y(e)).resources.extensions??[],n=new Set;for(let r of t){if(r.includes("*")||r.startsWith("!"))throw new u(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let o=p.resolve(e,r);if(!w(e,o))throw new u(`Package extension entry "${r}" resolves outside package root.`,f.USAGE);if(await m(p.join(o,"manifest.json"))){n.add(o);continue}for(let i of await j(o))n.add(i)}if(t.length===0)for(let r of U.extensions)for(let o of await j(p.join(e,r)))n.add(o);return[...n].sort((r,o)=>r.localeCompare(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]="3984f1ef-1703-5a83-a4fa-ec1cdc738572")}catch{}})();var D=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function A(e){return"#".repeat(e)}function $(e){if(!e.includes("`"))return`\`${e}\``;let t=0,n=0;for(let i of e)n=i==="`"?n+1:0,t=Math.max(t,n);let r="`".repeat(t+1),o=e.startsWith("`")||e.endsWith("`")?" ":"";return`${r}${o}${e}${o}${r}`}function B(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map($).join(", ")}`}function W(e,t,n){let r=[`${A(t)} ${e}`,""];return n.length===0?(r.push("_None._",""),r):(r.push(...n.map(o=>`- ${$(o)}`),""),r)}function H(e,t,n){return e===0&&!n?[]:[`${A(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function be(e,t={}){let n=t.headingLevel??2;if(!Number.isInteger(n)||n<1||n>6)throw new RangeError(`headingLevel must be an integer in [1, 6], received ${String(t.headingLevel)}`);let r=Math.min(n+1,6),o=t.includeEmpty===!0,i=t.title??"Extension surfaces",s=[`${A(n)} ${i}`,""];(o||e.capabilities.length>0)&&s.push(B(e.capabilities),"");for(let[l,d]of D){let y=e[l]??[];y.length===0&&!o||s.push(...W(d,r,y))}return s.push(...H(e.preflight_overrides,r,o)),!(e.preflight_overrides>0||D.some(([l])=>(e[l]?.length??0)>0))&&!o&&s.push("_This extension registers no surfaces._",""),`${s.join(`
|
|
2
2
|
`).trimEnd()}
|
|
3
3
|
`}(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]="abb182c9-6d6c-5be4-a2ad-c91b00a098d0")}catch{}})();var X=["agile","ops","research"],Q={agile:[{name:"Story",description:"User-facing outcome or capability slice expressed from a stakeholder perspective.",defaultStatus:"open",folder:"stories",aliases:["user-story"]},{name:"Spike",description:"Time-boxed investigation used to reduce uncertainty before implementation.",defaultStatus:"open",folder:"spikes",aliases:["research-spike"]}],ops:[{name:"Incident",description:"Operational disruption, degradation, or support escalation with recovery tracking.",defaultStatus:"open",folder:"incidents",aliases:["outage"]},{name:"Runbook",description:"Repeatable operational procedure, diagnostic path, or response playbook.",defaultStatus:"open",folder:"runbooks",aliases:["playbook"]}],research:[{name:"Experiment",description:"Validated-learning activity with hypothesis, method, and outcome tracking.",defaultStatus:"open",folder:"experiments",aliases:["study"]},{name:"Hypothesis",description:"Testable claim or assumption that should be supported, rejected, or refined.",defaultStatus:"open",folder:"hypotheses",aliases:["assumption"]}]};function Se(e){if(e===void 0)return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length===0)throw new Error("Type preset name must not be empty.");if(t==="agile"||t==="ops"||t==="research")return t;throw new Error(`Invalid type preset "${e}". Allowed: ${X.join(", ")}.`)}function Ae(e){return Q[e].map(t=>T(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]="1abceae0-299e-5fff-aa8c-46c015115571")}catch{}})();var Z=new Set(v),ee=new Set(E),F=new Set([...k.filter(e=>e!=="severity"),"id","title","type","status","priority","tags","assignee","parent","description","body","created_at","updated_at","closed_at","completed_at","author","deadline","estimate","sprint","release","risk","confidence","reviewer","resolution","expected","actual"]),te=["create","update"];function z(e){if(typeof e!="string")return"";let t=e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-");return t.startsWith("--")?t.slice(2):t}function N(e){return e.replaceAll("_","-")}function re(e,t){let n=new Set;for(let r of e){let o=z(r);o.length>0&&o!==t&&n.add(o)}return[...n].sort((r,o)=>r.localeCompare(o))}function ne(e){let t=new Set;for(let n of e??[]){let r=n.trim();r.length>0&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function oe(e){let t=new Set,n=[];for(let r of e??[]){let o=r.trim().toLowerCase();if(o.length!==0){if(!ee.has(o))throw new Error(`Invalid field command "${r}". Allowed: ${E.join(", ")}.`);t.has(o)||(t.add(o),n.push(o))}}return e===void 0||n.length===0?[...te]:n}function je(e){let t=a(e.key);if(t.length===0)throw new Error("Field key must not be empty.");if(t.includes(","))throw new Error(`Field key "${t}" must not contain commas: commas separate field names in list flags such as --unset and --fields.`);if(F.has(t))throw new Error(`Cannot define custom field "${t}": custom schema field "${t}" collides with built-in item metadata "${t}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...F].sort((b,M)=>b.localeCompare(M)).join(", ")}.`);let n=typeof e.type=="string"&&e.type.trim().length>0?e.type.trim().toLowerCase():"string";if(!Z.has(n))throw new Error(`Invalid field type "${e.type}". Allowed: ${v.join(", ")}.`);let r=n,o=oe(e.commands),i=z(e.cliFlag),s=i.length>0&&i!==N(t)?i:void 0,l=s??N(t),d=re(e.aliases??[],l),y=[l,...d].find(b=>b.includes(","));if(y!==void 0)throw new Error(`Field flag "${y}" must not contain commas.`);let _=e.description?.trim();return{key:t,type:r,commands:o,description:_&&_.length>0?_:void 0,cliFlag:s,cliAliases:d,required:e.required===!0,requiredOnCreate:e.requiredOnCreate===!0,allowUnset:e.allowUnset!==!1,requiredTypes:ne(e.requiredTypes)}}function ie(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function se(e){let t=ie(e);if(!t)return[];let n=[];for(let r of t){if(typeof r!="object"||r===null||Array.isArray(r))continue;let o=r;typeof o.key!="string"||o.key.trim().length===0||n.push(o)}return n}function Ce(e){if(e==null||e.trim().length===0)return{fields:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/fields.json contains invalid JSON.")}return{fields:se(t)}}function De(e){return`${JSON.stringify({fields:e.fields},null,2)}
|
|
4
4
|
`}function $e(e,t){let n=e.fields.find(s=>a(s.key)===t.key),r=n!==void 0,o=e.fields.filter(s=>a(s.key)!==t.key),i={...n,key:t.key,type:t.type,commands:[...t.commands]};return O(i,"description",t.description),O(i,"cli_flag",t.cliFlag),t.cliAliases.length>0?i.cli_aliases=[...t.cliAliases]:delete i.cli_aliases,L(i,"required",t.required),L(i,"required_on_create",t.requiredOnCreate),t.allowUnset===!1?i.allow_unset=!1:delete i.allow_unset,t.requiredTypes.length>0?i.required_types=[...t.requiredTypes]:delete i.required_types,o.push(i),o.sort((s,l)=>a(s.key).localeCompare(a(l.key))),{file:{fields:o},definition:i,replaced:r}}function Fe(e,t){let n=a(t);if(n.length===0)throw new Error("Field key must not be empty.");let r=[],o=e.fields.filter(i=>a(i.key)===n?(r.push(i),!1):!0);return r.length===0?{file:{fields:o},removed:!1}:{file:{fields:o},removed:!0,definition:r[0]}}function O(e,t,n){let r=e;n!==void 0&&n.length>0?r[t]=n:delete r[t]}function L(e,t,n){let r=e;n?r[t]=!0:delete r[t]}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b1e4c04e-0ade-5d24-95e3-b8dca3832c5a")}catch{}})();var ae=new Set(g),h=new Set(I.map(e=>a(e.id)).filter(e=>e.length>0));function le(e){let t=new Set;for(let n of e){let r=a(n);r.length>0&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function Pe(e){let t=a(e.id);if(t.length===0)throw new Error("Status id must not be empty.");if(h.has(t))throw new Error(`Cannot add-status the built-in status "${t}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let n;if(e.roles!==void 0){n=[];let s=new Set;for(let l of e.roles){let d=typeof l=="string"?l.trim().toLowerCase():"";if(d.length!==0){if(!ae.has(d))throw new Error(`Invalid status role "${l}". Allowed roles: ${g.join(", ")}.`);s.has(d)||(s.add(d),n.push(d))}}if(n.length===0)throw new Error(`Status role must include at least one lifecycle role. Allowed roles: ${g.join(", ")}.`)}let r=e.aliases===void 0?void 0:le(e.aliases).filter(s=>s!==t),o=e.description?.trim(),i=typeof e.order=="number"&&Number.isFinite(e.order)?Math.trunc(e.order):void 0;return{id:t,roles:n,aliases:r,description:o&&o.length>0?o:void 0,order:i}}function de(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function ce(e){let t=de(e);if(!t)return[];let n=[];for(let r of t){if(typeof r!="object"||r===null||Array.isArray(r))continue;let o=r;typeof o.id!="string"||o.id.trim().length===0||n.push(o)}return n}function Ue(e){if(e==null||e.trim().length===0)return{statuses:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/statuses.json contains invalid JSON.")}return{statuses:ce(t)}}function Re(e){return`${JSON.stringify({statuses:e.statuses},null,2)}
|
|
5
5
|
`}function qe(e,t,n){let r=e.statuses.slice(),o=r.findIndex(l=>a(l.id)===t.id),i=o>=0?r[o]:n,s={...i,id:t.id};return t.roles!==void 0&&(t.roles.length>0?s.roles=[...t.roles]:s.roles!==void 0&&delete s.roles),t.aliases!==void 0&&(t.aliases.length>0?s.aliases=[...t.aliases]:s.aliases!==void 0&&delete s.aliases),t.description!==void 0&&(s.description=t.description),t.order!==void 0&&(s.order=t.order),o>=0?r[o]=s:r.push(s),{file:{statuses:r},definition:s,replaced:i!==void 0}}function Ge(e,t){let n=a(t);if(n.length===0)throw new Error("Status id must not be empty.");if(h.has(n))throw new Error(`Cannot remove built-in status "${n}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let r=e.statuses.slice(),o=r.findIndex(s=>a(s.id)===n);if(o<0)return{file:{statuses:r},removed:!1};let[i]=r.splice(o,1);return{file:{statuses:r},removed:!0,definition:i}}function Je(e,t){let n=[e.id,...e.aliases??[]];for(let r of n){let o=a(r);if(o.length===0)continue;let i=t.get(o);if(i!==void 0&&i!==e.id)throw new Error(`Status token "${o}" already belongs to status "${i}". Choose a different id/alias to avoid shadowing it.`)}}export{P as a,U as b,Y as c,he as d,X as e,Q as f,Se as g,Ae as h,je as i,Ce as j,De as k,$e as l,Fe as m,h as n,Pe as o,Ue as p,Re as q,qe as r,Ge as s,Je as t,be as u};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-F62XGAAY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{M as Ie,N as Te,Q as De,aa as Se,f as Ce}from"./chunk-O7EI33NP.js";import{fb as xe,kb as Re,x as G}from"./chunk-YMGB2O4E.js";import{j as pe}from"./chunk-VWWTIX5L.js";import{a as A,b as R}from"./chunk-C3O6JJPO.js";import{Bd as ye,Be as be,Ce as we,Ga as ue,Ge as Ee,Id as _e,Jd as ke,Kc as Y,Nd as ve,Qc as F,S as C,X as ce,bd as O,nd as me,ra as ae,sd as ge,xa as le,xc as K,xd as he,yc as fe}from"./chunk-M6V7UMWL.js";import{A as v,z as b}from"./chunk-G6ERMFJ5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="283dfa35-9a8e-524c-b6e2-d433d51215ca")}catch{}})();function w(){let e=C();for(let t of K()?.relationship_kinds??[])for(let o of t.definitions)e.register(o);return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8b57e560-4ac4-53b6-9fb1-eebb1f30562a")}catch{}})();function N(e){if(typeof e!="string")return;let t=e.trim().toLowerCase();return t.length>0?t:void 0}function z(e){return[e.parent_id,e.child_id,e.source,e.kind,e.holder_id,e.target_id??""].join("\0")}function Qe(e,t){let o=new Set,n=[];for(let r of[...e].sort()){if(o.has(r))continue;o.add(r);let i=[{nodeId:r,children:[...t.get(r)??[]].sort(),nextChild:0}];for(;i.length>0;){let s=i.at(-1),d=s.children[s.nextChild];d===void 0?(n.push(s.nodeId),i.pop()):(s.nextChild+=1,o.has(d)||(o.add(d),i.push({nodeId:d,children:[...t.get(d)??[]].sort(),nextChild:0})))}}return n}function Ze(e,t){let o=[...e].sort(),n=Qe(o,t),r=new Set,i=et(o,t),s=[];for(let d of n.reverse()){if(r.has(d))continue;let c=tt(d,i,r);(c.length>1||t.get(c[0])?.has(c[0]))&&s.push(c)}return s.sort((d,c)=>d.join("\0").localeCompare(c.join("\0")))}function et(e,t){let o=new Map(e.map(n=>[n,new Set]));for(let[n,r]of t)for(let i of r)o.get(i)?.add(n);return o}function tt(e,t,o){let n=[],r=[e];for(o.add(e);r.length>0;){let i=r.pop();n.push(i);for(let s of[...t.get(i)].sort())o.has(s)||(o.add(s),r.push(s))}return n.sort()}function Le(e){let t=new Map;for(let o of e){let n=N(o?.id);n&&!t.has(n)&&t.set(n,o)}return t}function nt(e,t,o){let n=N(t.parent);if(!(!n||!o.has(n)))return{parent_id:n,child_id:e,source:"scalar_parent",kind:"parent",holder_id:e,child_cardinality:"one"}}function ot(e,t,o,n){let r=N(t?.id),i=n.resolve(t?.kind);if(!r||!o.has(r)||!i?.hierarchy)return;let s=i.hierarchyDirection==="source_parent";return{parent_id:s?e:r,child_id:s?r:e,source:"dependency",kind:i.kind,holder_id:e,target_id:r,child_cardinality:s?i.incoming:i.outgoing}}function Oe(e,t){let o=new Map;for(let[n,r]of e){let i=nt(n,r,e);i&&o.set(z(i),i);for(let s of r.dependencies??[]){let d=ot(n,s,e,t);d&&o.set(z(d),d)}}return[...o.values()].sort((n,r)=>z(n).localeCompare(z(r)))}function ln(e,t=w()){return Oe(Le(e),t)}function rt(e,t,o){let n=new Set(e.filter(r=>r.child_cardinality==="one").map(r=>r.child_id));return[...t].filter(([r,i])=>i.length>1&&n.has(r)).map(([r,i])=>({child_id:r,parent_ids:[...i],legacy_terminal:o.has(r)&&i.every(s=>o.has(s))})).sort((r,i)=>r.child_id.localeCompare(i.child_id))}function it(e,t,o){let n=new Map;for(let i of t){if(i.source!=="dependency")continue;let s=n.get(i.child_id)??new Set;s.add(i.parent_id),n.set(i.child_id,s)}let r=[];for(let[i,s]of e){let d=N(s.parent);if(!d||!e.has(d))continue;let c=[...n.get(i)??[]].filter(l=>l!==d).sort();c.length!==0&&r.push({child_id:i,scalar_parent_id:d,dependency_parent_ids:c,legacy_terminal:o.has(i)&&o.has(d)&&c.every(l=>o.has(l))})}return r.sort((i,s)=>i.child_id.localeCompare(s.child_id))}function H(e,t=n=>n==="closed"||n==="canceled",o=w()){let n=Le(e),r=Oe(n,o),i=st(r),s=new Set([...n].filter(([,c])=>t(c.status)).map(([c])=>c)),d=Ze([...n.keys()],new Map([...i.children_by_parent].map(([c,l])=>[c,new Set(l)]))).map(c=>({item_ids:c,legacy_terminal:c.every(l=>s.has(l))}));return{relations:r,cycles:d,cardinality_violations:rt(r,i.parents_by_child,s),divergences:it(n,r,s)}}function un(e){return e.source==="scalar_parent"?`${e.parent_id} -> ${e.child_id} (scalar parent on ${e.holder_id})`:`${e.parent_id} -> ${e.child_id} (${e.kind} dependency on ${e.holder_id})`}function st(e){let t=new Map,o=new Map;for(let n of e){let r=t.get(n.child_id)??new Set;r.add(n.parent_id),t.set(n.child_id,r);let i=o.get(n.parent_id)??new Set;i.add(n.child_id),o.set(n.parent_id,i)}return{parents_by_child:new Map([...t].map(([n,r])=>[n,[...r].sort()])),children_by_parent:new Map([...o].map(([n,r])=>[n,[...r].sort()]))}}function J(e,t){let o=new Set(t);return e.every(n=>o.has(n))}function pn(e,t,o,n,r){let i=N(o);if(!i)return;let s=H(e,n,r),d=H(t,n,r),c=d.divergences.find(a=>!s.divergences.some(p=>p.child_id===a.child_id&&p.scalar_parent_id===a.scalar_parent_id&&J(a.dependency_parent_ids,p.dependency_parent_ids)));if(c){let a=[c.scalar_parent_id,...c.dependency_parent_ids].sort();throw new v(`Hierarchy mutation would assign ${c.child_id} to multiple parents: ${a.join(", ")}.`,b.CONFLICT,{code:"hierarchy_parent_divergence_created",source_id:i,target_id:c.child_id,verification_errors:a})}let l=d.cardinality_violations.find(a=>(a.child_id===i||a.parent_ids.includes(i))&&!s.cardinality_violations.some(p=>p.child_id===a.child_id&&J(a.parent_ids,p.parent_ids)));if(l)throw new v(`Hierarchy mutation would assign ${l.child_id} to multiple parents: ${l.parent_ids.join(", ")}.`,b.CONFLICT,{code:"hierarchy_cardinality_created",source_id:i,target_id:l.child_id,verification_errors:l.parent_ids});let u=d.cycles.find(a=>a.item_ids.includes(i)&&!s.cycles.some(p=>J(a.item_ids,p.item_ids)));if(u)throw new v(`Hierarchy mutation would create a cycle: ${u.item_ids.join(" -> ")}.`,b.CONFLICT,{code:"hierarchy_cycle_created",source_id:i,verification_errors:u.item_ids})}(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]="6c580b70-76eb-51db-8587-99b73dd20875")}catch{}})();var dt="global";function yn(e){let t=e?.trim();if(t)return R(t)?dt:t}function _n(e,t,o){return ct(e,t,o)}function ct(e,t,o){let n=e.trim();return R(o)||A(n)?n:Ce(n,t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41f814be-ee87-5cae-b674-69c2e7f42655")}catch{}})();function D(e){if(typeof e!="string")return;let t=e.trim();if(!(!t||["none","null","n/a","na"].includes(t.toLowerCase())))return t}function M(e){let t=D(e);return t?.toLowerCase()==="no-active-blocker"?void 0:t}function $(e,t,o=!0){let n=D(e);return o&&(R(t)||n!==void 0&&A(n))}function Q(e,t){return $(e,t)?`external\0${e}`:`local\0${e.toLowerCase()}`}function Ae(e,t,o,n){return $(e,t)?n.get(e):o.get(e.toLowerCase())}function T(e,t){let o=e.toLowerCase(),n=t.toLowerCase();return o!==n?o<n?-1:1:e!==t?e<t?-1:1:0}function at(e){let t=new Map;for(let o of e.dependencies??[]){if(typeof o!="object"||o===null)continue;let n=o,r=D(n.id);if(!r)continue;let i=typeof n.kind=="string"?n.kind:"related",s=`${i}\0${Q(r,n.source_kind)}`,d=t.get(s);d?d.count+=1:t.set(s,{target_id:r,kind:i,count:1})}return t}function lt(e,t=o=>o==="closed"||o==="canceled"){let o=[];for(let n of e)if(!(typeof n?.id!="string"||n.id.trim().length===0))for(let r of at(n).values())r.count<2||o.push({holder_id:n.id.trim(),target_id:r.target_id,kind:r.kind,occurrences:r.count,holder_status:n.status,legacy_terminal:t(n.status)});return o.sort((n,r)=>{let i=T(n.holder_id,r.holder_id);if(i!==0)return i;let s=T(n.target_id,r.target_id);return s!==0?s:T(n.kind,r.kind)})}function ut(e,t,o,n,r){if(typeof o!="object"||o===null)return;let i=D(o.id);if(!i||Q(i,o.source_kind)!==Q(t))return;let s=r.resolve(typeof o.kind=="string"?o.kind:"related");if(!(s?.ordering!==!0||(s.precedence??"source_before_target")!=="source_before_target"))return{holder_id:e.id.trim(),target_id:i,dependency_kind:s.kind,holder_status:e.status,legacy_terminal:n(e.status)}}function pt(e,t=n=>n==="closed"||n==="canceled",o=w()){let n=new Map;for(let r of e){if(typeof r?.id!="string"||r.id.trim().length===0)continue;let i=D(r.blocked_by);if(i)for(let s of r.dependencies??[]){let d=ut(r,i,s,t,o);d&&n.set(`${d.holder_id.toLowerCase()}\0${d.target_id.toLowerCase()}\0${d.dependency_kind}`,d)}}return[...n.values()].sort((r,i)=>{let s=T(r.holder_id,i.holder_id);if(s!==0)return s;let d=T(r.target_id,i.target_id);return d!==0?d:T(r.dependency_kind,i.dependency_kind)})}function Z(e,t=o=>o==="closed"||o==="canceled"){let o=e.filter(c=>typeof c?.id=="string"&&c.id.trim().length>0),n=new Set(o.map(c=>c.id.trim().toLowerCase())),r=new Map,i=(c,l,u,a,p)=>{let m=D(l);if(!m||n.has(m.toLowerCase())||$(m,void 0,p))return;let f={holder_id:c.id.trim(),target_id:m,kind:u,source:a,holder_status:c.status,legacy_terminal:t(c.status),no_active_blocker_sentinel:m.toLowerCase()==="no-active-blocker"};r.set(`${f.holder_id}::${f.target_id}::${f.kind}::${f.source}`,f)};for(let c of o){i(c,c.parent,"parent","parent",!1),i(c,c.blocked_by,"blocked_by","blocked_by",!0);for(let l of c.dependencies??[]){if(typeof l!="object"||l===null)continue;let u=l;R(u.source_kind)||i(c,u.id,typeof u.kind=="string"?u.kind:"related","dependency",!0)}}let s=[...r.values()].sort((c,l)=>c.holder_id.localeCompare(l.holder_id)||c.target_id.localeCompare(l.target_id)||c.kind.localeCompare(l.kind)||c.source.localeCompare(l.source)),d=s.filter(c=>c.legacy_terminal);return{active:s.filter(c=>!c.legacy_terminal),legacy_terminal:d,no_active_blocker_sentinels:s.filter(c=>c.no_active_blocker_sentinel)}}function ft(e){let t=new Map;for(let o of[...e.active,...e.legacy_terminal]){if(o.no_active_blocker_sentinel)continue;let n=o.target_id.trim(),r=n.toLowerCase();t.has(r)||t.set(r,n)}return[...t.values()].sort((o,n)=>o.localeCompare(n))}function mt(e){let t=new Map;for(let o of e){let n=M(o.blocked_by);n&&$(n)&&!t.has(n)&&t.set(n,n);for(let r of o.dependencies??[]){if(typeof r!="object"||r===null||!$(r.id,r.source_kind))continue;let i=M(r.id);i&&!t.has(i)&&t.set(i,i)}}return[...t.values()].sort((o,n)=>o.localeCompare(n))}var Ne=new WeakMap;function xn(e){return e.hierarchyIntegrity??Ne.get(e)}function gt(e,t=w()){let o={};for(let n of e)for(let r of n.dependencies??[]){if(typeof r!="object"||r===null)continue;let i=r.kind;if(typeof i!="string")continue;let s=i.trim().toLowerCase().replaceAll("-","_"),d=t.resolve(i);d&&s!==d.kind&&(o[s]=(o[s]??0)+1)}return Object.fromEntries(Object.entries(o).sort(([n],[r])=>n.localeCompare(r)))}function ee(e,t,o){let n=o??w(),r=e.filter(f=>typeof f?.id=="string"&&f.id.trim().length>0),i=new Map(r.map(f=>[f.id.trim().toLowerCase(),f.id.trim()])),s=Z(r,t),d=ft(s);for(let f of d)i.set(f.toLowerCase(),f);let c=mt(r),l=new Set(i.keys()),u=new Map;for(let f of c){let y=f;for(;l.has(y.toLowerCase());)y=`external:${y}`;u.set(f,y),l.add(y.toLowerCase())}let a=r.map(f=>{let y=M(f.parent),g=M(f.blocked_by),h=(f.dependencies??[]).flatMap(_=>{if(typeof _!="object"||_===null)return[];let k=_,E=M(k.id);return E?[{id:Ae(E,k.source_kind,i,u),kind:typeof k.kind=="string"?k.kind:"related"}]:[]});return{id:f.id.trim(),...y?{parent:i.get(y.toLowerCase())}:{},...g?{blocked_by:Ae(g,void 0,i,u)}:{},dependencies:h}}),p=H(r,t,n),m={graph:ce.fromItems([...a,...d.map(f=>({id:f})),...c.map(f=>({id:u.get(f)}))],n),details:[...r.map(f=>({id:f.id.trim(),title:f.title,status:f.status,...typeof f.type=="string"&&f.type.trim().length>0?{type:f.type.trim()}:{}})),...d.map(f=>({id:f,title:`[missing] ${f}`,status:"missing"})),...c.map(f=>({id:u.get(f),title:`[external] ${f}`,status:"external"}))],missingIdSet:new Set(d.map(f=>f.toLowerCase())),dangling:s,duplicateRows:lt(r,t),orderingContradictions:pt(r,t,n),legacyAliasCounts:gt(r,n),hierarchyIntegrity:p};return Ne.set(m,p),m}import{createHash as ht}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]="e31ef0fb-e803-500b-b1e5-db9edfc880c4")}catch{}})();var yt=64,_t=8;function kt(e,t){let o=(e.dependencies??[]).map(n=>{if(typeof n!="object"||n===null)return"";let r=n;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??"",o].join("\0")}function $e(e,t=n=>n==="closed"||n==="canceled",o=C()){let n=e.filter(i=>typeof i?.id=="string"&&i.id.trim().length>0).map(i=>kt(i,t)).sort(),r=o.list().map(i=>ue(i)).sort();return ht("sha256").update(n.join("")).update("").update(r.join("")).digest("hex")}function Me(e,t,o){let n=t??o;if(!Number.isInteger(n)||n<1)throw new TypeError(`Invalid ${e} bound: ${String(t)}`);return n}var te=class{#e=new Map;#t;#n;constructor(t={}){this.#t=Me("maxResultsPerWorkspace",t.maxResultsPerWorkspace,yt),this.#n=Me("maxWorkspaces",t.maxWorkspaces,_t)}lookup(t,o,n){let r=this.#e.get(t),i=!0;(r===void 0||r.fingerprint!==o)&&(r={fingerprint:o,assembly:n(),results:new Map},i=!1,!this.#e.has(t)&&this.#e.size>=this.#n&&this.#e.delete(this.#e.keys().next().value)),this.#e.delete(t),this.#e.set(t,r);let s=r,d=this.#t;return{assembly:s.assembly,assemblyReused:i,fingerprint:o,memoize(c,l){let u=s.results.get(c);if(u!==void 0||s.results.has(c))return s.results.delete(c),s.results.set(c,u),{value:structuredClone(u),reused:!0};let a=l();return s.results.size>=d&&s.results.delete(s.results.keys().next().value),s.results.set(c,structuredClone(a)),{value:a,reused:!1}}}}clear(){this.#e.clear()}},Be=new te;function Pe(){return Be}function Sn(){Be.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]="3b494263-6359-57e9-8f34-b0bdcdeda93f")}catch{}})();var P=1200,vt=["prerequisite","dependent","ancestor","descendant","provenance","related"],bt=new TextEncoder;function ne(e,t,o){let n=e??t;if(!Number.isInteger(n)||n<1)throw new TypeError(`Relationship context ${o} must be positive`);return n}function B(e){return Math.max(1,Math.ceil(bt.encode(JSON.stringify(e)).byteLength/4))}function W(e,t,o){let n=o.resolve(e.kind);if(n?.ordering){let r=(n.precedence??"source_before_target")==="source_before_target"?e.source:e.target;return t===r?"prerequisite":"dependent"}if(n?.hierarchy){let r=n.hierarchyDirection==="source_parent"?e.source:e.target;return t===r?"ancestor":"descendant"}return e.kind==="discovered_from"||e.kind==="incident_from"?"provenance":"related"}function wt(e,t,o,n){let r=e.filter(i=>i.source===t&&i.target===o||i.target===t&&i.source===o).map(i=>W(i,o,n));return[...new Set(r)].sort()}function Et(e){return vt.find(t=>e.includes(t))}function Ct(e,t,o,n){let r=n.direction??"both",i=n.maxDepth??3;if(!Number.isInteger(i)||i<0)throw new TypeError("Relationship context maxDepth must be non-negative");let s=new Set([t]),d=[{id:t,distance:0}],c=[],l=0,u=!1;for(let a=0;a<d.length;a+=1){n.signal?.throwIfAborted();let p=d[a];if(p.distance>=i&&u)continue;let m=e.neighborEdges(p.id,{direction:r,kinds:n.kinds,signal:n.signal});if(l+=m.meta.inspectedEdges,p.distance>=i){m.value.some(f=>!s.has(f.id))&&(u=!0);continue}for(let{id:f,edge:y}of m.value){if(s.has(f))continue;s.add(f);let g={id:f,distance:p.distance+1,via:p.id,role:W(y,f,o)};c.push(g),d.push(g)}}return{rows:c,visitedNodes:d.length,inspectedEdges:l,depthTruncated:u}}function xt(e,t,o,n){let r={prerequisite:0,dependent:0,ancestor:0,descendant:0,provenance:0,related:0},i=e.neighborEdges(t,{direction:n.direction??"both",kinds:n.kinds,signal:n.signal}).value;for(let{id:s,edge:d}of i)r[W(d,s,o)]+=1;return{directEdges:r,directTotal:i.length,rootEdges:i.map(({edge:s})=>s)}}function Rt(e,t,o,n){let r=new Set;for(let i of t){let s=i.source===o?i.target:i.source,d=W(i,s,n);(d==="prerequisite"||d==="ancestor")&&r.add(s)}return[...e].sort((i,s)=>Number(r.has(s.id))-Number(r.has(i.id))||i.distance-s.distance||i.id.localeCompare(s.id))}function It(e,t){let o=e.distance===1?wt(t.rootEdges,t.rootId,e.id,t.registry):[];return{...t.details.get(e.id)??{id:e.id},distance:e.distance,role:o.length>0?Et(o):e.role,via:e.via,reasons:o.length>0?o:[`${e.role} via ${e.via} (depth ${e.distance})`]}}function Tt(e){let t=[],o=e.initialTokens,n=0;for(let r of e.candidates){if(t.length>=e.nodeLimit)break;let i=It(r,e),s=B(i);if(o+s>e.tokenBudget)break;let d=e.rootEdges.filter(c=>c.source===r.id||c.target===r.id).reduce((c,l)=>c+B(l),0);if(o+n+s+d>e.tokenBudget){if(t.length>0)break}else n+=d;t.push(i),o+=s}if(e.candidates.length>0&&t.length===0)throw new TypeError("Relationship context tokenBudget cannot fit one node");return{nodes:t,usedTokens:o}}function Dt(e){let t=e.options.kinds?new Set(e.options.kinds.map(i=>e.registry.require(i).kind)):void 0,o=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 s=e.registry.resolve(i.kind)?.inverse;return s!==void 0&&t.has(s)}).sort((i,s)=>+(s.source===e.rootId||s.target===e.rootId)-+(i.source===e.rootId||i.target===e.rootId)),n=[],r=e.initialTokens;for(let i of o){if(n.length>=e.edgeLimit)break;let s=B(i);r+s>e.tokenBudget||(n.push(i),r+=s)}return{edges:n,usedTokens:r,candidateCount:o.length}}function Ue(e,t,o,n={}){if(!e.nodes().includes(t))throw new TypeError(`Relationship node not found: ${t}`);let r=ne(n.nodeLimit,20,"nodeLimit"),i=ne(n.edgeLimit,40,"edgeLimit"),s=ne(n.tokenBudget,P,"tokenBudget"),d=n.registry??C(),c=new Map(o.map(I=>[I.id,I])),l=c.get(t)??{id:t},{evidence:u=[],...a}=l,p=[...u],m=Ct(e,t,d,n),{rootEdges:f,...y}=xt(e,t,d,n),g=Rt(m.rows,f,t,d),h=_e("relationship-context",{rootId:t,direction:n.direction??"both",kinds:[...n.kinds??[]].sort(),maxDepth:n.maxDepth??3,ordering:"required-root-evidence-first-v1"}),_=ve(g,n.cursor,h,({id:I})=>I,"--cursor"),k=g.slice(_),E=B(a)+B(p);if(E>s)throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");let U=Tt({candidates:k,details:c,rootEdges:f,rootId:t,registry:d,nodeLimit:r,tokenBudget:s,initialTokens:E}),{nodes:L}=U,Ve=new Set([t,...L.map(({id:I})=>I)]),ie=Dt({graph:e,rootId:t,included:Ve,options:n,registry:d,edgeLimit:i,tokenBudget:s,initialTokens:U.usedTokens}),{edges:X,usedTokens:Ye}=ie,j=_+L.length,q=j<g.length,se=L.at(-1),V=ie.candidateCount-X.length,de=m.depthTruncated||q||V>0,Je={rootId:t,...a.status===void 0?{}:{rootStatus:a.status},...y,discoveredNodes:g.length,returnedNodes:L.length,returnedEdges:X.length,omittedNodes:g.length-j,omittedEdges:V,evidenceCount:p.length,hasMore:q};return{root:a,summary:Je,nodes:L,edges:X,evidence:p,meta:{exact:!0,truncated:de,completeness:de?"truncated":"complete",nodeLimit:r,edgeLimit:i,tokenBudget:s,usedTokens:Ye,visitedNodes:m.visitedNodes,inspectedEdges:m.inspectedEdges,omittedNodes:g.length-j,omittedEdges:V,...q&&se?{nextCursor:ke(h,se.id,j-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]="196b7f2d-b09b-5432-b4ef-9cdf82e92731")}catch{}})();var St=["tree","graph","context"],Lt=["none","repeated"],Ot=["outgoing","incoming","both"],At=32,Nt=200,Mt=400,$t=16e3;function Bt(e){let t=e?.trim().toLowerCase()??"tree";if(St.includes(t))return t;throw new v(`Invalid --format value "${e}". Use "tree", "graph", or "context".`,b.USAGE)}function S(e,t){if(e===void 0)return;let o=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(o)||o<1)throw new v(`Invalid --${t} value "${e}". Use a positive integer.`,b.USAGE);return o}function Ke(e){if(e===void 0)return;let t=typeof e=="number"?e:Number(e.trim());if(!Number.isInteger(t)||t<0)throw new v(`Invalid --max-depth value "${e}". Use a non-negative integer.`,b.USAGE);return t}function Pt(e){let t=e?.trim().toLowerCase()??"none";if(Lt.includes(t))return t;throw new v(`Invalid --collapse value "${e}". Use "none" or "repeated".`,b.USAGE)}function Ut(e){let t=e?.trim().toLowerCase()??"both";if(Ot.includes(t))return t;throw new v(`Invalid --direction value "${e}". Use "outgoing", "incoming", or "both".`,b.USAGE)}function jt(e,t=C()){if(e===void 0)return;let o=(Array.isArray(e)?e:[e]).flatMap(r=>r.split(",")).map(r=>r.trim()).filter(r=>r.length>0);if(o.length===0)return;let n=new Set;for(let r of o){let i=t.resolve(r);if(!i){let s=t.list().map(d=>d.kind).join(", ");throw new v(`Invalid --kind value "${r}". Registered kinds: ${s}.`,b.USAGE)}n.add(i.kind)}return[...n].sort()}function Kt(e){if(!e||e.length===0)return[];let t=e.map(({id:n,kind:r})=>({id:n.trim(),kind:r.trim().toLowerCase()})).sort((n,r)=>{let i=n.kind.localeCompare(r.kind);return i!==0?i:n.id.localeCompare(r.id)}),o=new Map;for(let n of t){let r=`${n.kind.toLowerCase()}::${n.id.toLowerCase()}`;o.has(r)||o.set(r,{id:n.id,kind:n.kind})}return[...o.values()]}function Ft(e){return{id:e.id,title:e.title,type:e.type,status:e.status,dependencies:Kt(e.dependencies)}}function Gt(e){return O(new TextEncoder().encode(JSON.stringify({...e,dependencies:void 0})).byteLength)}function zt(e,t,o,n,r,i,s,d,c){for(let l of t.dependencies){let u=Math.max(1,Math.ceil(JSON.stringify({from:e.id,to:l.id,kind:l.kind}).length/3));if(d.nodes>=d.nodeLimit){e.truncated=!0,d.reasons.add("node_limit");break}if(d.edges>=d.edgeLimit){e.truncated=!0,d.reasons.add("edge_limit");break}if(d.estimatedTokens+u>=d.tokenBudget){e.truncated=!0,d.reasons.add("token_budget");break}d.edges+=1,d.estimatedTokens+=u,e.dependencies.push(Fe(l.id,o,n,r,i,s,d,c+1,l.kind))}}function Ht(e,t,o,n,r,i,s,d){return s.estimatedTokens>=s.tokenBudget&&t?.dependencies.length?(e.truncated=!0,s.reasons.add("token_budget"),!0):!t||e.cycle?!0:n!==void 0&&d>=n?(t.dependencies.length>0&&(e.truncated=!0,s.reasons.add("max_depth")),!0):r==="repeated"&&i.has(o)?(e.collapsed=!0,!0):!1}function Fe(e,t,o,n,r,i,s,d=0,c){let l=e.trim().toLowerCase(),u=t.get(l),a={id:u?.id??e,title:u?.title,type:u?.type,status:u?.status,via:c,missing:!u,cycle:o.has(l),dependencies:[]};if(s.nodes+=1,s.estimatedTokens+=Gt(a),Ht(a,u,l,n,r,i,s,d))return a;r==="repeated"&&i.add(l);let p=new Set(o);return p.add(l),zt(a,u,t,p,n,r,i,s,d),a}function je(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 Wt(e){let t=new Map,o=new Map,n=[e];for(;n.length>0;){let d=n.pop();t.set(d.id,je(t.get(d.id),{id:d.id,title:d.title,type:d.type,status:d.status,missing:d.missing}));for(let c of d.dependencies){t.set(c.id,je(t.get(c.id),{id:c.id,title:c.title,type:c.type,status:c.status,missing:c.missing}));let l=c.via??"related",u=`${d.id}::${c.id}::${l}`;o.has(u)||o.set(u,{from:d.id,to:c.id,kind:l}),c.cycle||n.push(c)}}let r=[...t.values()].sort((d,c)=>d.id.localeCompare(c.id)),i=[...o.values()].sort((d,c)=>{let l=d.from.localeCompare(c.from);if(l!==0)return l;let u=d.to.localeCompare(c.to);return u!==0?u:d.kind.localeCompare(c.kind)}),s=r.filter(d=>d.missing).map(d=>d.id);return{root_id:e.id,nodes:r,edges:i,missing_ids:s}}function Ge(e,t,o){let n=new Set,r=new Set,i=new Set,s=new Set,d=[{id:e,depth:0}],c=0;for(;c<d.length;){let l=d[c++],u=l.id.trim().toLowerCase();n.add(u);let a=t.get(u);if(!a){i.add(u);continue}if(!(o!==void 0&&l.depth>=o)&&!s.has(u)){s.add(u);for(let p of a.dependencies)r.add(`${u}::${p.id.trim().toLowerCase()}::${p.kind}`),d.push({id:p.id,depth:l.depth+1})}}return{node_count:n.size,edge_count:r.size,edge_basis:"deduplicated_directed",missing_count:i.size}}function Xt(e,t=C()){let o=Ke(e.maxDepth),n=S(e.nodeLimit,"node-limit"),r=S(e.edgeLimit,"edge-limit"),i=S(e.tokenBudget,"token-budget"),s=jt(e.kind,t);return{direction:Ut(e.direction),...s===void 0?{}:{kinds:s},...o===void 0?{}:{maxDepth:o},...n===void 0?{}:{nodeLimit:n},...r===void 0?{}:{edgeLimit:r},...i===void 0?{}:{tokenBudget:i},...e.cursor?.trim()?{cursor:e.cursor.trim()}:{}}}function qt(e,t,o,n){return Ue(e.graph,t,e.details.map(r=>r.id===t&&n.length>0?{...r,evidence:n}:r),o)}function oe(e,t,o,n){for(let r of o.slice(0,n)){let i=r?.trim();i&&e.push(`${t}:${i}`)}}async function Vt(e,t,o,n){let r=await Ie(e,t,o.id_prefix,o.item_format,n);if(!r)return[];let{document:i}=await Te(r,{schema:o.schema}),s=i.metadata,d=s.files??[],c=s.tests??[],l=s.docs??[],u=[["files",d.length],["tests",c.length],["docs",l.length],["comments",(s.comments??[]).length],["notes",(s.notes??[]).length],["learnings",(s.learnings??[]).length]];if(u.every(([,p])=>p===0))return[];let a=[`linked:${u.map(([p,m])=>`${p}=${m}`).join(",")}`];return oe(a,"file",d.map(p=>p.path),3),oe(a,"test",c.map(p=>p.command??p.path),2),oe(a,"doc",l.map(p=>p.path),2),a}function Yt(e){let{canonicalId:t,context:o,missingCount:n,missingReferences:r,referenceLimit:i,summaryOnly:s}=e;return{id:t,format:"context",node_count:o.nodes.length+1,edge_count:o.edges.length,edge_basis:"deduplicated_directed",missing_count:n,missing_scope:"traversal",missing_reference_count:r.length,...s?{}:{missing_references:r.slice(0,i),context:o}}}function Jt(e){let{row:t,missingReachableSet:o,packetIds:n,filteredKinds:r,registry:i}=e;if(t.no_active_blocker_sentinel||!o.has(t.target_id.trim().toLowerCase())||!n.has(t.holder_id))return!1;if(r===void 0)return!0;let s=i.resolve(t.kind);return s!==void 0&&(r.has(s.kind)||s.inverse!==void 0&&r.has(s.inverse))}function ze(e,t){let o=fe(),n=t.commandOptionsOverride??(o?.command==="deps"?o.options:t.commandOptions);return be("deps",{...n,...t.global,resolvedOutputFormat:t.format},e)}function re(e,t){let o=ze(e,t),n=r=>Ee(r,t.format,t.global.lean===!0);return n(t.global.tokenAccounting===!0?we(o,n):o)}function He(e,t,o){let n;for(;;){let r=O(new TextEncoder().encode(re(e,t)).byteLength);if(r===n)return r;o(r),n=r}}function We(e){return e instanceof TypeError&&e.message.startsWith("Relationship context tokenBudget cannot fit ")}function Xe(e){let{assembly:t,canonicalId:o,contextOptions:n,rootEvidence:r,summaryOnly:i,rendering:s,missingCount:d,missingReferences:c}=e,l=n.edgeLimit??40,u=Math.min(l,c.length),a=n.tokenBudget,p;for(;;){let m=qt(t,o,{...n,...a===void 0?{}:{tokenBudget:a}},r);p??=m.meta.tokenBudget,a??=p;let f=Yt({canonicalId:o,context:m,missingCount:d,missingReferences:c,referenceLimit:u,summaryOnly:i});if(i){if(O(new TextEncoder().encode(re(x(f,!0,s.legacyAliasCounts),s)).byteLength)>p)throw new TypeError("Relationship context tokenBudget cannot fit the rendered summary");return f}if(m.meta.tokenBudget=p,m.meta.usedTokens=He(x(f,!1,s.legacyAliasCounts),s,h=>{m.meta.usedTokens=h}),m.meta.usedTokens<=p)return f;if(u>0){u-=1;continue}let y=a,g=y*p/m.meta.usedTokens;a=Math.min(y-1,Math.max(1,Math.floor(g*.9)))}}function qe(e,t){let o=e.contextOptions,n={...e.rendering.global,outputFormat:e.rendering.format},r=["--pm-path",e.pmRoot,"item","deps",e.canonicalId,"--format","context","--output-format",e.rendering.format,"--token-budget"],i=r.length;r.push(String(t));let s=new Set(["--pm-path","--format","--output-format","--token-budget"]),d={format:"context",tokenBudget:t,kind:o.kinds},c=[["--max-depth","maxDepth",o.maxDepth],["--node-limit","nodeLimit",o.nodeLimit],["--edge-limit","edgeLimit",o.edgeLimit],["--direction","direction",o.direction],["--cursor","cursor",o.cursor],["--output-include","outputInclude",n.outputInclude],["--output-limit","outputLimit",n.outputLimit],["--output-budget","outputBudget",n.outputBudget],["--output-session","outputSession",n.outputSession],["--output-cursor","outputCursor",n.outputCursor]];for(let[a,p,m]of c)m!==void 0&&(r.push(a,String(m)),s.add(a),d[p]=m);for(let a of o.kinds??[])r.push("--kind",a),s.add("--kind");let l=[["--summary","summary",e.summaryOnly],["--full","full",e.rendering.commandOptions.full],["--json","json",n.json],["--lean","lean",n.lean],["--output-row-contract","outputRowContract",n.outputRowContract],["--token-accounting","tokenAccounting",n.tokenAccounting],["--no-extensions","noExtensions",n.noExtensions],["--no-pager","noPager",n.noPager]];for(let[a,p,m]of l)m===!0&&(r.push(a),s.add(a),d[p]=!0);let u=ge.find(a=>a.command==="deps");return Reflect.set(d,me,{canonical_include_modes:[],cli_invocation_observed:!0,explicit_legacy_aliases:Object.values(u.dimensions).flatMap(a=>a.legacy_aliases.flatMap(p=>s.has(p.flag)?[p.flag]:[]))}),he("deps",d),Y(d.summary===!0,d.full===!0,"--summary"),n.outputInclude=d.outputInclude,{args:r,budgetIndex:i,summaryOnly:d.summary===!0,rendering:{...e.rendering,global:n,commandOptionsOverride:d}}}function Qt(e,t,o){let n={...t.rendering,commandOptionsOverride:{...t.rendering.commandOptionsOverride,tokenBudget:o}},r;try{r=Xe({...e,contextOptions:{...e.contextOptions,tokenBudget:o},summaryOnly:t.summaryOnly,rootEvidence:t.summaryOnly?[]:e.rootEvidence,rendering:n})}catch(s){if(!We(s))throw s;return"native_floor"}let i=ze(x(r,t.summaryOnly,n.legacyAliasCounts),n);return ye(i)?"output_constraints":"fits"}async function Zt(e,t){let o=e.contextOptions.tokenBudget??P,n=qe(e,o),r=(n.summaryOnly?1:1+Math.min(e.contextOptions.edgeLimit??40,e.missingReferences.length))*(e.assembly.details.reduce((a,p)=>a+p.id.length+p.title.length+p.status.length+(p.type?.length??0),e.assembly.graph.edges().length+e.missingReferences.length)+(n.summaryOnly?[]:e.rootEvidence).reduce((a,p)=>a+p.length,0)),{findContextBudgetRecovery:i}=await import("./context-budget-recovery-5MKOCGY5.js"),s=i({requested:o,initialBudget:P,workUnits:r,probe:a=>Qt(e,n,a)}),d=["--pm-path",e.pmRoot,"item","deps",e.canonicalId,"--format","tree","--summary"],c=F(d),l=s.feasible_tokens===null?d:[...n.args];s.feasible_tokens!==null&&(l[n.budgetIndex]=String(s.feasible_tokens));let u=F(l);return Se("Relationship context tokenBudget cannot fit the required rendered packet",{exitCode:b.USAGE,cause:t,context:{code:"invalid_argument_value",field:"tokenBudget",value:String(o),required:s.feasible_tokens===null?"Inspect the compact summary and review the output constraints.":"Retry the preserved context query with --token-budget "+s.feasible_tokens+".",why:"Budget advice is verified against the current query. A minimum is reported only after every smaller positive budget is checked.",examples:[u,c],nextSteps:[u],recovery:{recovery_mode:"compact",suggested_flags:["--token-budget"],token_budget:s,suggested_retry_args:l,suggested_retry:u,next_best_command:c,fallback_candidates:[{source:"relationship_summary",command:c,reason:"Inspect bounded counts separately from context rows."}]}}})}async function en(e){let{pmRoot:t,assembly:o,canonicalId:n,options:r,rootEvidence:i,summaryOnly:s,rendering:d}=e,c=Xt(r,o.graph.registry()),l=o.graph.closure(n,{direction:c.direction,...c.kinds===void 0?{}:{kinds:c.kinds},maxDepth:c.maxDepth??3}),u=l.value.filter(h=>o.missingIdSet.has(h.toLowerCase())),a=new Set(u.map(h=>h.toLowerCase())),p=o.graph.registry(),m=c.kinds?new Set(c.kinds.map(h=>p.require(h).kind)):void 0,f=new Set([n,...l.value]),y=[...o.dangling.active,...o.dangling.legacy_terminal].filter(h=>Jt({row:h,missingReachableSet:a,packetIds:f,filteredKinds:m,registry:p})),g={pmRoot:t,assembly:o,canonicalId:n,contextOptions:c,rootEvidence:i,summaryOnly:s,rendering:d,missingCount:u.length,missingReferences:y};try{return Xe(g)}catch(h){if(h instanceof v&&h.code==="invalid_query_cursor"){let _=qe({...g,contextOptions:{...c,cursor:void 0},rendering:{...d,global:{...d.global,outputCursor:void 0}}},c.tokenBudget??P),k=F(_.args);throw new v(h.message,h.exitCode,{...h.context,nextSteps:[...h.context.nextSteps,k],recovery:{suggested_retry:k,suggested_retry_args:_.args}})}throw We(h)?await Zt(g,h):h}}function tn(e){let t=[e],o;for(;t.length>0;){let n=t.pop();n.dependencies.length>0&&(o=n,t.push(...n.dependencies))}return o?(o.dependencies.pop(),o.truncated=!0,!0):!1}function nn(e,t,o,n,r,i,s){let d=r??At,c=S(o.nodeLimit,"node-limit")??Nt,l=S(o.edgeLimit,"edge-limit")??Mt,u=S(o.tokenBudget,"token-budget")??$t,a={nodeLimit:c,edgeLimit:l,tokenBudget:u,nodes:0,edges:0,estimatedTokens:0,reasons:new Set},p=Fe(e,n,new Set,d,t==="graph"?"repeated":i,new Set,a),m=Ge(e,n,void 0),f;for(;;){let y=Wt(p),g=a.reasons.size===0?void 0:{reasons:[...a.reasons].sort(),limits:{max_depth:d,node_limit:c,edge_limit:l,token_budget:u},estimated_tokens:0,total_node_count:m.node_count,total_edge_count:m.edge_count,omitted_node_count:Math.max(0,m.node_count-y.nodes.length),omitted_edge_count:Math.max(0,m.edge_count-y.edges.length)},h={id:e,format:t,node_count:y.nodes.length,edge_count:y.edges.length,edge_basis:"deduplicated_directed",missing_count:y.missing_ids.length,...g?{truncation:g}:{}};if(f=t==="tree"?{...h,tree:p}:{...h,graph:y},(f.truncation===void 0?O(new TextEncoder().encode(re(x(f,!1,s.legacyAliasCounts),s)).byteLength):He(x(f,!1,s.legacyAliasCounts),s,_=>{f.truncation.estimated_tokens=_}))<=u)return f;if(!tn(p))return a.reasons.add("token_budget"),f;a.reasons.add("token_budget")}}function x(e,t,o={}){let n={name:e.format==="tree"?"dependency_tree":e.format==="graph"?"dependency_graph":"relationship_context",restore_with:"--full"},r=e.context?.meta.truncated?[{name:"relationship_context_bounds",restore_with:"--token-budget <n> --node-limit <n> --edge-limit <n> --max-depth <n>"}]:[];return{...e,legacy_alias_counts:o,projection:{mode:t?"summary":"full",declared_field_groups:[n,...r],included_field_groups:t?[]:[n.name]}}}async function ro(e,t,o){let n=le(process.cwd(),o.path);await Re(n);let r=Bt(t.format),i=Ke(t.maxDepth),s=Pt(t.collapse);Y(t.summary===!0,t.full===!0,"--summary");let d=t.summary===!0,c=await xe(n),l=ae(c,K()),u=await De(n,c.item_format,l.type_to_folder,void 0,c.schema),a=pe(c.schema),p=new Map(u.map(g=>[g.id.trim().toLowerCase(),Ft(g)])),m=Z(u,g=>G(g,a));for(let g of[...m.active,...m.legacy_terminal]){let h=p.get(g.holder_id.trim().toLowerCase()),_=g.kind.trim().toLowerCase();h&&!h.dependencies.some(k=>k.id.trim().toLowerCase()===g.target_id.trim().toLowerCase()&&k.kind===_)&&h.dependencies.push({id:g.target_id,kind:_})}if(!p.has(e.trim().toLowerCase()))throw new v(`Item ${e} not found`,b.NOT_FOUND);let f=o.outputFormat??(o.json===!0||o.json===void 0&&o.defaultOutputFormat==="json"?"json":"toon");if(r==="context"){let g=p.get(e.trim().toLowerCase()).id,h=d?[]:await Vt(n,g,c,l.type_to_folder),_=U=>G(U,a),k=w(),E=Pe().lookup(n,$e(u,_,k),()=>ee(u,_,k));return x(await en({pmRoot:n,assembly:E.assembly,canonicalId:g,options:t,rootEvidence:h,summaryOnly:d,rendering:{format:f,global:o,commandOptions:t,legacyAliasCounts:E.assembly.legacyAliasCounts}}),d,E.assembly.legacyAliasCounts)}let y=Object.fromEntries(Object.entries(ee(u,g=>G(g,a)).legacyAliasCounts));return d?x({id:e,format:r,...Ge(e,p,i)},!0,y):x(nn(e,r,t,p,i,s,{format:f,global:o,commandOptions:t,legacyAliasCounts:y}),!1,y)}export{yn as a,_n as b,ct as c,w as d,ln as e,H as f,un as g,st as h,pn as i,M as j,lt as k,pt as l,Z as m,ft as n,xn as o,ee as p,$e as q,te as r,Pe as s,Sn as t,P as u,Ue as v,S as w,Ke as x,Ut as y,jt as z,ro as A};
|
|
2
|
+
//# sourceMappingURL=chunk-G4QP365K.js.map
|