@unbrained/pm-cli 2026.9.20 → 2026.9.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +32 -1
- package/dist/cli/commander-usage.d.ts +5 -1
- package/dist/cli/commander-usage.js +2 -2
- package/dist/cli/commands/annotations/comments.d.ts +2 -0
- package/dist/cli/commands/{comments.js → annotations/comments.js} +1 -1
- package/dist/cli/commands/{docs.d.ts → annotations/docs.d.ts} +2 -2
- package/dist/cli/commands/{docs.js → annotations/docs.js} +1 -1
- package/dist/cli/commands/{files.d.ts → annotations/files.d.ts} +2 -2
- package/dist/cli/commands/{files.js → annotations/files.js} +1 -1
- package/dist/cli/commands/annotations/learnings.d.ts +2 -0
- package/dist/cli/commands/{learnings.js → annotations/learnings.js} +1 -1
- package/dist/cli/commands/annotations/notes.d.ts +2 -0
- package/dist/cli/commands/{notes.js → annotations/notes.js} +1 -1
- package/dist/cli/commands/extension/extension.d.ts +6 -0
- package/dist/cli/commands/{extension.js → extension/extension.js} +1 -1
- package/dist/cli/commands/{gc.d.ts → governance/gc.d.ts} +2 -2
- package/dist/cli/commands/{gc.js → governance/gc.js} +1 -1
- package/dist/cli/commands/governance/health.d.ts +6 -0
- package/dist/cli/commands/{deps.js → governance/health.js} +2 -2
- package/dist/cli/commands/governance/telemetry.d.ts +6 -0
- package/dist/cli/commands/{telemetry.js → governance/telemetry.js} +1 -1
- package/dist/cli/commands/governance/validate.d.ts +9 -0
- package/dist/cli/commands/governance/validate.js +2 -0
- package/dist/cli/commands/history/activity.d.ts +6 -0
- package/dist/cli/commands/{activity.js → history/activity.js} +1 -1
- package/dist/cli/commands/history/history-compact.d.ts +7 -0
- package/dist/cli/commands/{history-compact.js → history/history-compact.js} +1 -1
- package/dist/cli/commands/{history-redact.d.ts → history/history-redact.d.ts} +2 -2
- package/dist/cli/commands/history/history-redact.js +2 -0
- package/dist/cli/commands/{history-repair.d.ts → history/history-repair.d.ts} +2 -2
- package/dist/cli/commands/{history-repair.js → history/history-repair.js} +1 -1
- package/dist/cli/commands/history/history.d.ts +2 -0
- package/dist/cli/commands/{history.js → history/history.js} +1 -1
- package/dist/cli/commands/history/restore.d.ts +6 -0
- package/dist/cli/commands/history/restore.js +2 -0
- package/dist/cli/commands/lifecycle/append.d.ts +2 -0
- package/dist/cli/commands/{append.js → lifecycle/append.js} +1 -1
- package/dist/cli/commands/lifecycle/claim.d.ts +2 -0
- package/dist/cli/commands/{claim.js → lifecycle/claim.js} +1 -1
- package/dist/cli/commands/lifecycle/close-many.d.ts +2 -0
- package/dist/cli/commands/{close-many.js → lifecycle/close-many.js} +1 -1
- package/dist/cli/commands/lifecycle/close.d.ts +6 -0
- package/dist/cli/commands/lifecycle/close.js +2 -0
- package/dist/cli/commands/lifecycle/copy.d.ts +6 -0
- package/dist/cli/commands/lifecycle/copy.js +2 -0
- package/dist/cli/commands/lifecycle/create.d.ts +6 -0
- package/dist/cli/commands/{create.js → lifecycle/create.js} +1 -1
- package/dist/cli/commands/lifecycle/delete.d.ts +6 -0
- package/dist/cli/commands/{delete.js → lifecycle/delete.js} +1 -1
- package/dist/cli/commands/lifecycle/focus.d.ts +6 -0
- package/dist/cli/commands/lifecycle/focus.js +2 -0
- package/dist/cli/commands/lifecycle/plan.d.ts +6 -0
- package/dist/cli/commands/{plan.js → lifecycle/plan.js} +1 -1
- package/dist/cli/commands/lifecycle/update-many.d.ts +2 -0
- package/dist/cli/commands/lifecycle/update-many.js +2 -0
- package/dist/cli/commands/lifecycle/update.d.ts +6 -0
- package/dist/cli/commands/{copy.js → lifecycle/update.js} +2 -2
- package/dist/cli/commands/query/aggregate.d.ts +2 -0
- package/dist/cli/commands/{aggregate.js → query/aggregate.js} +1 -1
- package/dist/cli/commands/query/context.d.ts +6 -0
- package/dist/cli/commands/{focus.js → query/context.js} +2 -2
- package/dist/cli/commands/{deps.d.ts → query/deps.d.ts} +2 -2
- package/dist/cli/commands/query/deps.js +2 -0
- package/dist/cli/commands/query/duplicates.d.ts +6 -0
- package/dist/cli/commands/{duplicates.js → query/duplicates.js} +1 -1
- package/dist/cli/commands/{eval.d.ts → query/eval.d.ts} +2 -2
- package/dist/cli/commands/{eval.js → query/eval.js} +1 -1
- package/dist/cli/commands/query/get.d.ts +6 -0
- package/dist/cli/commands/{get.js → query/get.js} +1 -1
- package/dist/cli/commands/{graph.d.ts → query/graph.d.ts} +2 -2
- package/dist/cli/commands/{graph.js → query/graph.js} +1 -1
- package/dist/cli/commands/{list.d.ts → query/list.d.ts} +2 -2
- package/dist/cli/commands/{list.js → query/list.js} +1 -1
- package/dist/cli/commands/{next.d.ts → query/next.d.ts} +2 -2
- package/dist/cli/commands/{next.js → query/next.js} +1 -1
- package/dist/cli/commands/query/search.d.ts +6 -0
- package/dist/cli/commands/{search.js → query/search.js} +1 -1
- package/dist/cli/commands/query/stats.d.ts +6 -0
- package/dist/cli/commands/{stats.js → query/stats.js} +1 -1
- package/dist/cli/commands/{test-all.d.ts → test/test-all.d.ts} +2 -2
- package/dist/cli/commands/{test-all.js → test/test-all.js} +1 -1
- package/dist/cli/commands/{test-runs.d.ts → test/test-runs.d.ts} +2 -2
- package/dist/cli/commands/{test-runs.js → test/test-runs.js} +1 -1
- package/dist/cli/commands/{test.d.ts → test/test.d.ts} +2 -2
- package/dist/cli/commands/{test.js → test/test.js} +1 -1
- package/dist/cli/commands/{config.d.ts → workspace/config.d.ts} +2 -2
- package/dist/cli/commands/{config.js → workspace/config.js} +1 -1
- package/dist/cli/commands/workspace/contracts.d.ts +2 -0
- package/dist/cli/commands/{contracts.js → workspace/contracts.js} +1 -1
- package/dist/cli/commands/{init.d.ts → workspace/init.d.ts} +2 -2
- package/dist/cli/commands/{update.js → workspace/init.js} +2 -2
- package/dist/cli/commands/workspace/merge.d.ts +8 -0
- package/dist/cli/commands/workspace/merge.js +2 -0
- package/dist/cli/commands/{profile.d.ts → workspace/profile.d.ts} +2 -2
- package/dist/cli/commands/{profile.js → workspace/profile.js} +1 -1
- package/dist/cli/commands/workspace/schema.d.ts +7 -0
- package/dist/cli/commands/workspace/schema.js +2 -0
- package/dist/cli/commands/workspace/upgrade.d.ts +2 -0
- package/dist/cli/commands/{update-many.js → workspace/upgrade.js} +2 -2
- package/dist/cli/register-annotations.js +1 -1
- package/dist/cli/register-history-activity.js +1 -1
- package/dist/cli/register-history-maintenance.js +1 -1
- package/dist/cli/register-list-query.js +1 -1
- package/dist/cli/register-mutation.js +1 -1
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/schema/registration.js +1 -1
- package/dist/cli/stats-analytics-json.d.ts +1 -1
- package/dist/cli/stats-analytics-json.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +152 -152
- package/dist/cli-bundle/chunks/{chunk-GRHSNUQO.js → chunk-3OFFMS2N.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QZTS23BV.js → chunk-4XOV7Q5R.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2QLXN6HZ.js → chunk-AVWHZUNC.js} +26 -26
- package/dist/cli-bundle/chunks/{chunk-2UNYUB4A.js → chunk-BJBBOUYQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JBJUOOJI.js → chunk-CM57QHVK.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-TTFVQB4S.js → chunk-D2OV2UBV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-33R5PEKI.js → chunk-GFTN5OS4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HAFSMFJK.js → chunk-JSW33Q6R.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FBWAECBI.js → chunk-ML42DLI3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2FEKKSLN.js → chunk-SBTT42A4.js} +43 -43
- package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-7YUYLYJQ.js → chunk-UDNYAMCM.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-K7RWRJLT.js → chunk-ZSPZJOMK.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-5V43MYPN.js → register-list-query-VOS5CBX4.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-LWZH6UFJ.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-LJU5H2CU.js → register-operations-YJK4DNFZ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-HJUNGYBB.js → register-setup-Q3CYF67Q.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-L6L4XCLY.js → chunk-AO5FR7PN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-K5ZCBC6Y.js → chunk-CASXNCNQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FXAZPSU6.js → chunk-FKYUTTFL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-DPBTIFW7.js → chunk-IOL25GKH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-N6KI3LWF.js → chunk-JCD5YESL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6MNKQKT6.js → chunk-LH24XUPJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IA5CCSBB.js → chunk-MXESHALQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-3XPBKIV6.js → chunk-PRMQTT7X.js} +12 -12
- package/dist/cli-bundle/focused-chunks/{chunk-ISEOBALS.js → chunk-QFEDRPPI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UIS5FVHH.js → chunk-QYN77MQP.js} +49 -49
- package/dist/cli-bundle/focused-chunks/{chunk-5BLRMUMK.js → chunk-TSI73EEM.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-PC6ZZVNP.js → chunk-UAU4DJSR.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-RQL5WLNZ.js → chunk-URH727T5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-U2SB2BMM.js → chunk-UT7VS4X2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-HYPK5OPA.js → chunk-V2NARGRH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-DRNXMOSV.js → chunk-XR5EBU3B.js} +2 -2
- package/dist/cli-bundle/main.js +18 -18
- 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 +21 -21
- 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 +38 -38
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +1 -1
- package/dist/core/config/positional-value.d.ts +0 -2
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/history/history-diff.js +1 -1
- package/dist/core/schema/type-workflows.d.ts +1 -1
- package/dist/core/schema/type-workflows.js +1 -1
- package/dist/core/search/eval.d.ts +1 -1
- package/dist/core/search/eval.js +1 -1
- package/dist/core/shared/item-metadata-contract.d.ts +0 -4
- package/dist/core/shared/item-metadata-contract.js +1 -1
- package/dist/sdk/completion/bash.d.ts +1 -1
- package/dist/sdk/completion/bash.js +1 -1
- package/dist/sdk/extension/shared.d.ts +2 -2
- package/dist/sdk/extension/shared.js +1 -1
- package/dist/sdk/governance/upgrade.d.ts +2 -0
- package/dist/sdk/governance/upgrade.js +2 -2
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/search-contracts.d.ts +0 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/schema.d.ts +8 -4
- package/dist/sdk/schema.js +1 -1
- package/docs/ARCHITECTURE.md +31 -4
- package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +50 -1
- package/docs/COMMANDS.md +1 -1
- package/docs/EXTENSIONS.md +1 -1
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +1 -1
- package/docs/RELEASING.md +7 -1
- package/docs/SDK_CONTEXT_INTEGRITY_PRIMITIVES.md +1 -1
- package/docs/VALIDATION_PORTABILITY.md +82 -0
- package/marketplace.json +2 -2
- package/package.json +10 -8
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +23 -17
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/build-lease.mjs +27 -0
- package/dist/cli/commands/activity.d.ts +0 -6
- package/dist/cli/commands/aggregate.d.ts +0 -2
- package/dist/cli/commands/append.d.ts +0 -2
- package/dist/cli/commands/claim.d.ts +0 -2
- package/dist/cli/commands/close-many.d.ts +0 -2
- package/dist/cli/commands/close.d.ts +0 -6
- package/dist/cli/commands/close.js +0 -2
- package/dist/cli/commands/comments.d.ts +0 -2
- package/dist/cli/commands/context.d.ts +0 -6
- package/dist/cli/commands/context.js +0 -2
- package/dist/cli/commands/contracts.d.ts +0 -2
- package/dist/cli/commands/copy.d.ts +0 -6
- package/dist/cli/commands/create.d.ts +0 -6
- package/dist/cli/commands/delete.d.ts +0 -6
- package/dist/cli/commands/duplicates.d.ts +0 -6
- package/dist/cli/commands/extension.d.ts +0 -6
- package/dist/cli/commands/focus.d.ts +0 -6
- package/dist/cli/commands/get.d.ts +0 -6
- package/dist/cli/commands/health.d.ts +0 -6
- package/dist/cli/commands/health.js +0 -2
- package/dist/cli/commands/history-compact.d.ts +0 -7
- package/dist/cli/commands/history-redact.js +0 -2
- package/dist/cli/commands/history.d.ts +0 -2
- package/dist/cli/commands/index.d.ts +0 -55
- package/dist/cli/commands/index.js +0 -2
- package/dist/cli/commands/init-agent-guidance.d.ts +0 -6
- package/dist/cli/commands/init-agent-guidance.js +0 -2
- package/dist/cli/commands/init.js +0 -2
- package/dist/cli/commands/learnings.d.ts +0 -2
- package/dist/cli/commands/lifecycle-transitions.d.ts +0 -2
- package/dist/cli/commands/lifecycle-transitions.js +0 -2
- package/dist/cli/commands/merge.d.ts +0 -8
- package/dist/cli/commands/merge.js +0 -2
- package/dist/cli/commands/notes.d.ts +0 -2
- package/dist/cli/commands/plan.d.ts +0 -6
- package/dist/cli/commands/restore.d.ts +0 -6
- package/dist/cli/commands/restore.js +0 -2
- package/dist/cli/commands/scheduling-shortcuts.d.ts +0 -6
- package/dist/cli/commands/scheduling-shortcuts.js +0 -2
- package/dist/cli/commands/schema.d.ts +0 -7
- package/dist/cli/commands/schema.js +0 -2
- package/dist/cli/commands/search.d.ts +0 -6
- package/dist/cli/commands/stats.d.ts +0 -6
- package/dist/cli/commands/telemetry.d.ts +0 -6
- package/dist/cli/commands/update-many.d.ts +0 -2
- package/dist/cli/commands/update.d.ts +0 -6
- package/dist/cli/commands/upgrade.d.ts +0 -2
- package/dist/cli/commands/upgrade.js +0 -2
- package/dist/cli/commands/validate.d.ts +0 -9
- package/dist/cli/commands/validate.js +0 -2
- package/dist/cli-bundle/chunks/chunk-T3AMFUCN.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-EVRYSU72.js +0 -20
|
@@ -1,4 +1,4 @@
|
|
|
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]="9ddd9ea4-8586-5d3d-9ed8-0bf9da49b9a5")}catch{}})();var B=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],ut=2,sn=Object.freeze({migration:"schema",validation:"schema"}),E_=Object.freeze({version:ut,capabilities:[...B],legacy_aliases:{...sn}}),ft=["off","warn","enforce"],mt=["off","warn","enforce"],pt=["none","restricted","strict"],Lr=["block","warn"],_t=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],Oe=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function gt(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(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]="a966bb77-c4be-593b-93f5-b6277072160e")}catch{}})();var La=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],jr=La,O_=["draft","open","in_progress","blocked","closed","canceled"],S_=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],Fr=["string","number","boolean","string_array","array","object"],A_=["create","update","update_many","list","search","calendar","context"],C_=["allow","warn","reject"],T_=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],I_=["project","global"],R_=["low","medium","high","critical"],x_=["low","medium","high","critical"],N_=["low","medium","high"];var D_=["minimal","default","strict","custom"],P_=["none","warn","strict"],M_=["progressive","strict"],$_=["off","warn","strict"],L_=["off","warn","strict"];var j_=["daily","weekly","monthly","yearly"],ja=["mon","tue","wed","thu","fri","sat","sun"];function F_(e){return ja.indexOf(e)}var U_=["draft","research","review","approved","executing","paused","completed","superseded"],z_=["pending","in_progress","completed","blocked","skipped","superseded"],q_=["codex","claude-code","cursor","generic"],B_=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],V_=["brief","standard","deep","full"],W_=["hierarchy","activity","progress","recently_created","unparented","blockers","files","workload","staleness","tests"];(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]="0d16c1b3-1bc5-5973-a20d-78ada79d4c9b")}catch{}})();var Ur=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],Fa=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...Ur,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],Ua=Fa;(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]="6e329ab1-f22d-5749-b8a4-0a6e7a1c8023")}catch{}})();var za=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),qa=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),yt=".agents/pm",ht="settings.json";var Ba=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],Va=["decisions","events","reminders","milestones","meetings","plans"],X_=[...Ba,...Va],Ue={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},Wa={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},Ga=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],an={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function zr(e){return e?[...e]:void 0}var J_={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...Ga],lifecycle_closure_like_blocked_reason_patterns:[...an.blocked_reason],lifecycle_closure_like_resolution_patterns:[...an.resolution],lifecycle_closure_like_actual_result_patterns:[...an.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...Wa.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:za.map(e=>({...e,aliases:zr(e.aliases),roles:zr(e.roles)})),fields:[],workflow:{...qa},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:gt()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",default_mode:"auto",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},Q_={metadata:{},body:""},y={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},Z_=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});(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]="0f7e5fb3-86d2-5af5-a189-a40dd223ef26")}catch{}})();var h=class extends Error{exitCode;code;context;constructor(t,n,r={}){super(t),this.name="PmCliError",this.exitCode=n,this.context=r,this.code=r.code}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9961b408-ad70-5556-84dd-5ca1b1497c27")}catch{}})();var Ka=new Set(["name","version","entry","priority","description","author","capabilities","manifest_version","pm_min_version","pm_max_version","engines","trusted","provenance","sandbox_profile","permissions","activation","contributions","legacy_capability_aliases"]);function Ha(e){return{unknownKeys:Object.keys(e).filter(t=>!Ka.has(t)).sort((t,n)=>t>n?1:-1),missingVersionBounds:e.pm_min_version===void 0&&e.pm_max_version===void 0}}function Ya(e){let t=Ha(e),n=t.unknownKeys.map(r=>({code:"manifest_unknown_key",path:r,...r==="compatibility"?{suggested_key:"pm_min_version"}:{},message:r==="compatibility"?'Manifest key "compatibility" is ignored; declare the canonical pm_min_version and optional pm_max_version fields instead.':`Manifest key "${r}" is not part of the extension manifest contract and will be ignored.`}));return t.missingVersionBounds&&n.push({code:"no_version_bounds_declared",path:"$",suggested_key:"pm_min_version",message:"No canonical pm version bounds are declared; add pm_min_version so compatibility intent is explicit."}),{ok:n.length===0,findings:n}}function qr(e,t,n){return Ya(n).findings.map(r=>r.code==="manifest_unknown_key"?`extension_manifest_unknown_key:${e}:${t.name}:key=${r.path}${r.suggested_key?`:suggested=${r.suggested_key}`:""}`:`extension_manifest_no_version_bounds:${e}:${t.name}:suggested=pm_min_version`)}(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]="4c00e38a-27df-5315-91e8-d35c03ed6bf3")}catch{}})();var cn=[{kind:"blocked_by",direction:"directed",traversal:"ordering",inverse:"blocks",ordering:!0,precedence:"target_before_source",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["depends_on"],compatibilityVersion:1,allowSelf:!1},{kind:"blocks",direction:"directed",traversal:"ordering",inverse:"blocked_by",ordering:!0,precedence:"source_before_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"parent",direction:"directed",traversal:"hierarchy",outcomeTraversal:"source_to_target",inverse:"child",ordering:!1,hierarchy:!0,hierarchyDirection:"target_parent",outgoing:"one",incoming:"many",lifecycle:"supersedable",aliases:["child_of","epic"],compatibilityVersion:1,allowSelf:!1},{kind:"child",direction:"directed",traversal:"hierarchy",outcomeTraversal:"target_to_source",inverse:"parent",ordering:!1,hierarchy:!0,hierarchyDirection:"source_parent",outgoing:"many",incoming:"one",lifecycle:"supersedable",aliases:["parent_child","task"],compatibilityVersion:1,allowSelf:!1},{kind:"related",direction:"undirected",traversal:"association",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["related_to"],compatibilityVersion:1,allowSelf:!1},{kind:"discovered_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"incident_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"implements",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"recurs_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,temporalOrder:"source_after_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"verifies",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"supersedes",direction:"directed",traversal:"semantic",outcomeTraversal:"both",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"supersedable",compatibilityVersion:1,allowSelf:!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]="b658dc99-fdbb-5d10-9dd6-5f5c263bf48b")}catch{}})();function vt(e){return e.trim().toLowerCase().replaceAll("-","_")}function Xa(e){if(e===void 0)return;let t=vt(e);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid inverse relationship kind: ${e}`);return t}function ln(e,t=new Set){if(e===null||typeof e!="object"||t.has(e))return e;if(t.add(e),Array.isArray(e)){for(let n of e)ln(n,t);return Object.freeze(e)}for(let n of Object.values(e))ln(n,t);return Object.freeze(e)}function Ja(e,t){if(e.precedence!==void 0&&e.precedence!=="source_before_target"&&e.precedence!=="target_before_source")throw new TypeError(`Invalid relationship precedence for ${t}`);if(!e.ordering&&e.precedence!==void 0)throw new TypeError(`Non-ordering relationship kind cannot declare precedence: ${t}`)}function Qa(e,t){if(e.temporalOrder!==void 0&&e.temporalOrder!=="source_after_target")throw new TypeError(`Invalid relationship temporal order for ${t}`);if(e.direction!=="directed"&&e.temporalOrder!==void 0)throw new TypeError(`Undirected relationship kind cannot declare temporal order: ${t}`)}function Za(e,t){if(e.hierarchyDirection!==void 0&&e.hierarchyDirection!=="source_parent"&&e.hierarchyDirection!=="target_parent")throw new TypeError(`Invalid relationship hierarchy direction for ${t}`);if(!e.hierarchy&&e.hierarchyDirection!==void 0)throw new TypeError(`Non-hierarchy relationship kind cannot declare hierarchy direction: ${t}`)}function ec(e){if(typeof e!="object"||e===null)throw new TypeError("Relationship kind definition requires an object");if(typeof e.kind!="string")throw new TypeError("Relationship kind requires a string identifier");let t=vt(e.kind);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid relationship kind: ${e.kind}`);if(!Number.isInteger(e.compatibilityVersion)||e.compatibilityVersion<1)throw new TypeError(`Invalid compatibility version for ${t}`);return t}function tc(e,t){if(!["directed","undirected"].includes(e.direction))throw new TypeError(`Invalid relationship direction for ${t}`);if(typeof e.ordering!="boolean")throw new TypeError(`Invalid relationship ordering flag for ${t}`);if(![void 0,!0,!1].includes(e.hierarchy))throw new TypeError(`Invalid relationship hierarchy flag for ${t}`);if(!["one","many"].includes(e.outgoing))throw new TypeError(`Invalid outgoing relationship cardinality for ${t}`);if(!["one","many"].includes(e.incoming))throw new TypeError(`Invalid incoming relationship cardinality for ${t}`);if(!["persistent","supersedable","ephemeral"].includes(e.lifecycle))throw new TypeError(`Invalid relationship lifecycle for ${t}`);if(typeof e.allowSelf!="boolean")throw new TypeError(`Invalid relationship self-edge flag for ${t}`);if(e.traversal!==void 0&&!["hierarchy","ordering","semantic","association"].includes(e.traversal))throw new TypeError(`Invalid relationship traversal family for ${t}`);if(e.outcomeTraversal!==void 0&&!["source_to_target","target_to_source","both"].includes(e.outcomeTraversal))throw new TypeError(`Invalid outcome traversal for ${t}`);if(e.direction==="undirected"&&e.outcomeTraversal!==void 0&&e.outcomeTraversal!=="both")throw new TypeError(`Undirected relationship kind cannot declare directional outcome traversal: ${t}`)}function nc(e,t){if(e.payloadSchema!==void 0&&(typeof e.payloadSchema!="object"||e.payloadSchema===null||Array.isArray(e.payloadSchema)))throw new TypeError(`Invalid relationship payload schema for ${t}`);if(e.aliases!==void 0&&(!Array.isArray(e.aliases)||e.aliases.some(n=>typeof n!="string")))throw new TypeError(`Invalid relationship aliases for ${t}`)}function rc(e){return e.traversal?e.traversal:e.ordering?"ordering":e.hierarchy?"hierarchy":e.direction==="undirected"?"association":"semantic"}var un=class{#e=new Map;#n=new Map;constructor(t=cn){for(let n of t)this.register(n)}register(t){let n=ec(t);if(tc(t,n),nc(t,n),Ja(t,n),Qa(t,n),Za(t,n),this.#e.has(n)||this.#n.has(n))throw new TypeError(`Relationship kind already registered: ${n}`);let r=Xa(t.inverse),o=[...new Set((t.aliases??[]).map(vt))].sort();for(let s of o){if(!/^[a-z][a-z0-9_]*$/.test(s))throw new TypeError(`Invalid relationship alias: ${s}`);if(s===n||this.#e.has(s)||this.#n.has(s))throw new TypeError(`Relationship alias already registered: ${s}`)}let i=Object.freeze({...t,kind:n,traversal:rc(t),hierarchy:t.hierarchy??!1,hierarchyDirection:t.hierarchy?t.hierarchyDirection??"source_parent":void 0,inverse:r,aliases:Object.freeze(o),payloadSchema:t.payloadSchema?ln(structuredClone(t.payloadSchema)):void 0});this.#e.set(n,i);for(let s of o)this.#n.set(s,n);return this}resolve(t){if(typeof t!="string")return;let n=vt(t);return this.#e.get(this.#n.get(n)??n)}require(t){let n=this.resolve(t);if(!n)throw new TypeError(`Unknown relationship kind: ${t}`);return n}list(){return Object.freeze([...this.#e.values()].sort((t,n)=>t.kind.localeCompare(n.kind)))}};function fn(){return new un}var ce=fn();function sg(e){return ce.require(e).kind}function ag(e){return ce.resolve(e)?.kind}function cg(e,t=ce){return t.resolve(e)?.ordering===!0}function oc(e,t,n,r=ce){let o=ze(e),i=ze(t);if(!o||!i)throw new TypeError("Relationship endpoint must not be empty");let s=r.require(n);if(o===i&&!s.allowSelf)throw new TypeError(`Self relationship is not allowed for ${s.kind}`);return s}function bt(e,t){return e.source.localeCompare(t.source)||e.target.localeCompare(t.target)||e.kind.localeCompare(t.kind)}function ic(e,t,n){let r=typeof e.source=="string"?e.source.trim():"",o=typeof e.target=="string"?e.target.trim():"";if(!t.has(r)||!t.has(o))throw new TypeError(`Relationship endpoint not found: ${r} -> ${o}`);let i=oc(r,o,e.kind,n),s=Object.freeze({...e,source:r,target:o,kind:i.kind}),a=i.direction==="undirected"?[r,o].sort().join("\0"):`${r}\0${o}`;return{edge:s,identity:`${i.kind}\0${a}`}}function wt(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function ze(e){return typeof e=="string"?e.trim():""}function dn(e,t){let n=ze(e);return n&&t.has(n)?n:void 0}function sc(e,t,n){let r=[t],o=t;for(;o!==e;)o=n.get(o),r.push(o);return r.reverse()}var Br=class e{#e;#n;#o;#r;#s=new Map;#a=new Map;constructor(t,n,r=ce){this.#e=r,this.#n=new Set([...t].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#o=Object.freeze([...this.#n].sort());let o=new Map;for(let i of n){let{edge:s,identity:a}=ic(i,this.#n,r);o.set(a,s)}this.#r=Object.freeze([...o.values()].sort(bt));for(let i of this.#r)wt(this.#s,i.source,i),wt(this.#a,i.target,i),r.require(i.kind).direction==="undirected"&&(wt(this.#s,i.target,i),wt(this.#a,i.source,i))}static fromItems(t,n=ce){let r=new Set(t.map(i=>ze(i.id)).filter(Boolean)),o=[];for(let i of t){let s=ze(i.id);if(!s)continue;let a=dn(i.parent,r);a&&o.push({source:s,target:a,kind:"parent"});let c=dn(i.blocked_by,r);c&&o.push({source:s,target:c,kind:"blocked_by"});for(let d of i.dependencies??[]){let l=dn(d.id,r);l&&n.resolve(d.kind)&&o.push({source:s,target:l,kind:d.kind,createdAt:d.created_at,author:d.author})}}return new e(r,o,n)}edges(){return this.#r}incidentEdges(t){this.#i(t);let n=this.#s.get(t)??[],r=this.#a.get(t)??[];if(n.length===0)return Object.freeze([...r]);if(r.length===0)return Object.freeze([...n]);let o=[],i=0,s=0;for(;i<n.length||s<r.length;){let a=n[i],c=r[s],d=a===void 0?c:c===void 0||bt(a,c)<=0?a:c;o.at(-1)!==d&&o.push(d),a===d&&(i+=1),c===d&&(s+=1)}return Object.freeze(o)}nodes(){return this.#o}hasNode(t){return this.#n.has(t)}registry(){return this.#e}#i(t){if(!this.#n.has(t))throw new TypeError(`Relationship node not found: ${t}`)}#c(t,n){if(!n)return!0;let r=this.#e.require(t.kind);return n.has(t.kind)||r.inverse!==void 0&&n.has(r.inverse)}#t(t,n,r){let o=[...n==="incoming"?[]:this.#s.get(t)??[],...n==="outgoing"?[]:this.#a.get(t)??[]];return[...new Set(o)].filter(i=>this.#c(i,r)).map(i=>({id:i.source===t?i.target:i.source,edge:i})).sort((i,s)=>i.id.localeCompare(s.id)||bt(i.edge,s.edge))}adjacency(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=[...new Set(o.map(c=>c.id))],a=s.slice(0,i);return{value:a,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:a.length<s.length,nextCursor:a.at(-1)}}}neighborEdges(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(a=>this.#e.require(a).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=o.slice(0,i);return{value:s,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:s.length<o.length,nextCursor:s.at(-1)?.id}}}closure(t,n={}){this.#i(t);let r=n.kinds?new Set(n.kinds.map(m=>this.#e.require(m).kind)):void 0,o=n.direction??"outgoing",i=n.limit??Number.POSITIVE_INFINITY,s=n.maxDepth??Number.POSITIVE_INFINITY,a=new Set([t]),c=[],d=[{id:t,depth:0}],l=0,u=0,f=!1;e:for(let m=0;m<d.length;m+=1){n.signal?.throwIfAborted();let p=d[m];l+=1;let _=this.#t(p.id,o,r);if(u+=_.length,p.depth>=s){_.some(g=>!a.has(g.id))&&(f=!0);continue}for(let g of _)if(!a.has(g.id)){if(c.length>=i){f=!0;break e}a.add(g.id),c.push(g.id),d.push({id:g.id,depth:p.depth+1})}}return{value:c,meta:{visitedNodes:l,inspectedEdges:u,truncated:f,nextCursor:c.at(-1)}}}shortestPath(t,n,r={}){if(this.#i(t),this.#i(n),t===n)return{value:[t],meta:{visitedNodes:1,inspectedEdges:0,truncated:!1}};let o=r.kinds?new Set(r.kinds.map(m=>this.#e.require(m).kind)):void 0,i=r.direction??"outgoing",s=r.maxDepth??Number.POSITIVE_INFINITY,a=[{id:t,depth:0}],c=new Map,d=new Set([t]),l=0,u=0,f=!1;for(let m=0;m<a.length;m+=1){r.signal?.throwIfAborted();let p=a[m];l+=1;let _=this.#t(p.id,i,o);if(u+=_.length,p.depth>=s){_.some(g=>!d.has(g.id))&&(f=!0);continue}for(let g of _)if(!d.has(g.id)){if(c.set(g.id,p.id),g.id===n)return{value:sc(t,n,c),meta:{visitedNodes:l,inspectedEdges:u,truncated:!1}};d.add(g.id),a.push({id:g.id,depth:p.depth+1})}}return{value:[],meta:{visitedNodes:l,inspectedEdges:u,truncated:f}}}subgraph(t,n={}){let r=this.closure(t,n),o=[t,...r.value].sort(),i=new Set(o),s=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,a=new Set;for(let c of o)for(let d of this.#s.get(c)??[])i.has(d.source)&&i.has(d.target)&&this.#c(d,s)&&a.add(d);return{value:{nodes:o,edges:[...a].sort(bt)},meta:r.meta}}};function dg(e,t,n=ce){return{source:e,target:t.id,kind:n.require(t.kind).kind,createdAt:t.created_at,author:t.author}}(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]="720821b8-d18d-5a10-a8b9-f16073dc1fc4")}catch{}})();function O(e){return e.trim().toLowerCase().split(/\s+/).filter(t=>t.length>0).join(" ")}function ac(){return{json:!1,quiet:!1,noExtensions:!1,profile:!1}}function Vr(e){return e?P(e):{}}function Wr(e){return e?P(e):ac()}function P(e){return structuredClone(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]="7d96fda0-1f2f-5e34-99da-c3c5ad0f53f6")}catch{}})();var cc=new Set(["commands","command_overrides","command_handlers","flag_commands","parser_overrides"]),dc=["commands","command_overrides","command_handlers","hooks","flag_commands","item_types","item_fields","relationship_kinds","migrations","profiles","importers","exporters","search_providers","vector_store_adapters","assurance_providers","parser_overrides","service_overrides","renderer_overrides"];function lc(e,t){for(let n of dc){let r=e[n];if(r===void 0)continue;if(!Array.isArray(r)||r.some(i=>typeof i!="string"))return!1;let o=r.map(i=>cc.has(n)?O(i):i.trim()).filter(i=>i.length>0);t[n]=[...new Set(o)].sort((i,s)=>i.localeCompare(s))}return!0}function uc(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n;if(r.format!=="json"&&r.format!=="toon"||!Array.isArray(r.commands)||r.commands.some(o=>typeof o!="string")||typeof r.result_discriminator!="boolean")return null;t.push({format:r.format,commands:[...new Set(r.commands.map(o=>O(o)))].sort((o,i)=>o.localeCompare(i)),result_discriminator:r.result_discriminator})}return t.sort((n,r)=>n.format.localeCompare(r.format))}function fc(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n.commands;if(!Array.isArray(r)||r.some(o=>typeof o!="string"))return null;t.push({commands:[...new Set(r.map(o=>O(o)))].filter(o=>o.length>0).sort((o,i)=>o.localeCompare(i))})}return t}function Et(e){if(e==null)return;if(typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.schema_version!==1)return null;let n={schema_version:1};if(!lc(t,n))return null;let r=t.preflight_overrides;if(r!==void 0&&(!Number.isInteger(r)||r<0))return null;typeof r=="number"&&(n.preflight_overrides=r);let o=t.renderer_ownership;if(o!==void 0){let s=uc(o);if(s===null)return null;n.renderer_ownership=s}let i=t.preflight_ownership;if(i!==void 0){let s=fc(i);if(s===null)return null;n.preflight_ownership=s}return n}function mg(e){return{schema_version:1,commands:e.commands,command_overrides:e.command_overrides,command_handlers:e.command_handlers,hooks:e.hooks,flag_commands:e.flag_commands,item_types:e.item_types,item_fields:e.item_fields,...e.relationship_kinds?{relationship_kinds:e.relationship_kinds}:{},migrations:e.migrations,profiles:e.profiles,importers:e.importers,exporters:e.exporters,search_providers:e.search_providers,vector_store_adapters:e.vector_store_adapters,...e.assurance_providers?{assurance_providers:e.assurance_providers}:{},parser_overrides:e.parser_overrides,service_overrides:e.service_overrides,renderer_overrides:e.renderer_overrides,...e.renderer_ownership?{renderer_ownership:e.renderer_ownership}:{},preflight_overrides:e.preflight_overrides,...e.preflight_ownership?{preflight_ownership:e.preflight_ownership}:{}}}(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]="c7018240-2680-597f-9e71-e4b3f46ef91d")}catch{}})();var mc=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-tqel"})),pc=[...["next","focus"].map(e=>({alias:e,canonical:`context ${e}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-6apl"})),...["normalize","reindex"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(e=>({...e,canonical_argv:e.canonical.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap"})),_c=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-ik19"})),gc=[...pc,..._c,...[...["comments","notes","learnings","files","docs","deps","append","test"].map(e=>[e,`item ${e}`,"pm-yql1"]),["test-runs-worker","item test worker","pm-lp4j"],...["statuses","tags","types"].map(e=>[`completion-${e}`,`completion ${e}`,"pm-szdc"]),["history-author-acknowledge","history acknowledge","pm-djyvbk"],["copy","item copy","pm-m6g87m"],["merge","workspace merge","pm-m6g87m"],["duplicates","item duplicates","pm-fmy9ih"],["dedupe-audit","item duplicates audit","pm-fmy9ih"],["dedupe-merge","item duplicates merge","pm-fmy9ih"],["comments-audit","item audit-comments","pm-fmy9ih"],["search-advanced","search advanced","pm-wfskfn"],...["meet","event","remind"].map(e=>[e,`calendar ${e}`,"pm-o3fh"])].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:n}))],mn=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...mc,...gc,...["discover","lookup"].map(e=>({alias:`files ${e}`,canonical:`item files ${e}`,canonical_argv:["item","files",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-yql1"}))];function _g(e){let t;for(let n of mn)n.canonical_argv.length<=(t?.canonical_argv.length??0)||n.canonical_argv.every((r,o)=>r===(o===0&&e[o]==="ctx"?"context":e[o]))&&(t=n);return t}function yc(e){let t=e.trim().replace(/\s+/gu," ");return mn.find(n=>n.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function qe(e){return yc(e)}var kt=[...mn,...[["ctx","context"],["packages","package"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-pbyu"})),...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:[t,n],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"item test",canonical_argv:["item","test"],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:["comments","notes","learnings"].includes(t)?`item ${t}`:t,canonical_argv:["comments","notes","learnings"].includes(t)?["item",t]:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension list","extension catalog"],["extension scaffold","extension init"],["package list","package catalog"],["package scaffold","package init"],["packages list","packages catalog"],["packages scaffold","packages init"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-ya7x55"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-tnud"}))],gg=Object.fromEntries(kt.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function yg(e){let t=e.trim().toLowerCase();return kt.find(n=>n.alias===t)}function hg(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bfaa3455-3237-5c98-8ef4-b353ce9530fe")}catch{}})();var wg=Object.freeze({rows:10,paths:5,samples:10,path_depth:8,visited_paths:1e4});import{createHash as Hr}from"node:crypto";import hc 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]="c036d6cf-6a10-5c74-9e2f-e7c953339e2c")}catch{}})();function bc(e){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e===void 0)return"undefined";if(typeof e=="symbol")return e.toString();if(typeof e=="function")return`[function:${e.name||"anonymous"}]`}function wc(e){let t=Object.keys(e).sort(),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=Ot(o))}return n}function Ot(e){let t=bc(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(r=>Ot(r));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let r=n.toJSON();if(r!==e)return Ot(r)}return wc(e)}function de(e){return JSON.stringify(Ot(e))}function Gr(e,t,n,r){for(let o=0;o<t.length;o+=1)if(!n.has(o)&&r(e,t[o]))return n.add(o),!0;return!1}function vc(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function Ec(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function kc(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],r=new Set;for(let o of e)if(!Gr(o,n,r,V))return!1;return!0}function Oc(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],r=new Set;for(let[o,i]of e.entries())if(!Gr([o,i],n,r,([a,c],[d,l])=>V(a,d)&&V(c,l)))return!1;return!0}function Sc(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>V(n,t[r]))}function Ac(e,t){let n=Object.keys(e).sort((o,i)=>o.localeCompare(i)),r=Object.keys(t).sort((o,i)=>o.localeCompare(i));if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){let i=n[o];if(i!==r[o]||!V(e[i],t[i]))return!1}return!0}var Cc=[vc,Ec,kc,Oc,Sc];function V(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;for(let n of Cc){let r=n(e,t);if(r!==void 0)return r}return Ac(e,t)}function kg(e){return hc.createHash("sha256").update(e,"utf8").digest("hex")}function Og(e,t){let n={};for(let o of t){let i=e[o];i!==void 0&&(n[o]=i)}let r=Object.keys(e).filter(o=>!t.includes(o)).sort((o,i)=>o.localeCompare(i));for(let o of r){let i=e[o];i!==void 0&&(n[o]=i)}return n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8b0d8654-211b-57bf-852f-8a153849e8fd")}catch{}})();var Tc=["policies","policy-put","policy-remove","policy-mode","policy-check","policy-approve","policy-presets"],Kr=256,pn=64;function $(e){throw new h(`Invalid workflow policy: ${e}`,y.USAGE,{code:"workflow_policy_invalid",nextSteps:["Inspect pm schema policies and correct the declaration using pm schema policy-put."]})}function G(e,t,n){if(typeof e!="object"||e===null||Array.isArray(e))return $(`${n} must be an object`);let r=e;return Object.keys(r).some(o=>!t.includes(o))?$(`${n} contains an unknown key`):r}function le(e,t,n=128){return typeof e!="string"||!e.trim()||e.length>n?$(`${t} must be nonempty text of at most ${n} characters`):e.trim()}function Be(e,t){if(!Array.isArray(e)||e.length===0||e.length>pn)return $(`${t} requires 1-${pn} terms`);let n=e.map(r=>le(r,t));return t==="fields"&&n.some(r=>!/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$/.test(r)||r.split(".").some(o=>["__proto__","constructor","prototype"].includes(o)))?$("fields must be safe metadata paths of at most eight segments"):[...new Set(n)]}function Ic(e){let t=G(e,["kind","fields","authors","allowed"],"rule");return t.kind==="transition"?(G(t,["kind","allowed"],"transition rule"),!Array.isArray(t.allowed)||t.allowed.length>pn?$("transition.allowed must be a bounded array"):{kind:"transition",allowed:t.allowed.map(n=>!Array.isArray(n)||n.length!==2?$("transition pairs need two statuses"):[le(n[0],"from"),le(n[1],"to")])}):t.kind==="authors"?(G(t,["kind","authors"],"authors rule"),{kind:"authors",authors:Be(t.authors,"authors")}):t.kind==="require_fields"?(G(t,["kind","fields"],"require_fields rule"),{kind:"require_fields",fields:Be(t.fields,"fields")}):t.kind==="field_writers"||t.kind==="approval"?(G(t,["kind","fields","authors"],"field rule"),{kind:t.kind,fields:Be(t.fields,"fields"),authors:Be(t.authors,"authors")}):$("unknown rule kind")}function Rc(e){let t={},n=G(e,["types","tags","statuses","operations","parents","dependency"],"subject");for(let r of["types","tags","statuses","operations","parents"])n[r]!==void 0&&(t[r]=Be(n[r],r));if(n.dependency!==void 0){let r=G(n.dependency,["kind","id"],"dependency");t.dependency={kind:le(r.kind,"dependency kind"),...r.id===void 0?{}:{id:le(r.id,"dependency id")}}}return t}function xc(e){let t=G(e,["id","description","subject","effect","rule"],"policy"),n=le(t.id,"id");return/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(n)?t.effect!==void 0&&(typeof t.effect!="string"||!["advise","warn","refuse"].includes(t.effect))?$("effect must be advise, warn, or refuse"):{id:n,rule:Ic(t.rule),...t.subject===void 0?{}:{subject:Rc(t.subject)},...t.description===void 0?{}:{description:le(t.description,"description",500)},...t.effect===void 0?{}:{effect:t.effect}}:$("id must be a stable token")}function Nc(e){let t=G(e,["version","enforcement","policies"],"document");if(t.version!==1)return $("unsupported version");if(t.enforcement!==void 0&&t.enforcement!=="advise"&&t.enforcement!=="refuse")return $("enforcement must be advise or refuse");if(!Array.isArray(t.policies)||t.policies.length>Kr)return $(`policies must contain at most ${Kr} declarations`);let n=t.policies.map(xc);return new Set(n.map(r=>r.id)).size!==n.length?$("duplicate policy id"):{version:1,enforcement:t.enforcement??"advise",policies:n}}function St(e,t){let n=e;for(let r of t.split(".")){if(typeof n!="object"||n===null||!Object.hasOwn(n,r))return;n=n[r]}return n}function Dc(e){return e==null?!1:typeof e=="string"?e.trim().length>0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.length>0:typeof e=="object"?Object.keys(e).length>0:!0}function Yr(e){return Hr("sha256").update(de(e)).digest("hex")}function Pc(e,t){let n=e.rule.kind==="approval"?e.rule.fields:[];return Hr("sha256").update(de({id:t.id,fields:n.map(r=>[r,St(t,r)])})).digest("hex")}function Mc(e,t){return Array.isArray(t)&&t.some(n=>typeof n=="object"&&n!==null&&"kind"in n&&n.kind===e.kind&&(e.id===void 0||"id"in n&&n.id===e.id))}function $c(e,t,n){return!(e.types&&!e.types.some(r=>r.toLowerCase()===String(t.type).toLowerCase())||e.statuses&&!e.statuses.includes(String(t.status))||e.operations&&!e.operations.includes(n)||e.parents&&!e.parents.includes(String(t.parent))||e.tags&&(!Array.isArray(t.tags)||!e.tags.some(r=>t.tags.includes(r)))||e.dependency&&!Mc(e.dependency,t.dependencies))}function Lc(e,t){if(t.completeness_only&&(e.rule.kind!=="require_fields"||e.subject?.operations!==void 0)||e.rule.kind==="approval"&&t.before===null)return!1;let n=e.subject??{},r=t.after?.status??t.before?.status;return[t.before,t.after].some(o=>o!==null&&$c(n,{...o,status:r},t.operation))}function jc(e,t,n,r){let o=["type","tags","parent","dependencies"].some(s=>!V(t.before?.[s],t.after?.[s]));return t.after&&(t.completeness_only||n||r||o)?e.filter(s=>!Dc(St(t.after,s))):[]}function Fc(e,t,n,r){let o=t.after??t.before,i=Pc(e,o);return t.approvals?.some(s=>s.policy_fingerprint===r&&s.content_fingerprint===i&&s.author!==t.author&&n.includes(s.author))??!1}function Uc(e,t,n){let r=e.rule,o=t.before?.status!==t.after?.status,i="fields"in r&&r.fields.some(s=>!V(St(t.before,s),St(t.after,s)));switch(r.kind){case"require_fields":{let s=jc(r.fields,t,o,i);return{satisfied:s.length===0,missing_fields:s,remediation:"Supply the declared required fields before this lifecycle transition."}}case"transition":return{satisfied:!o||r.allowed.some(([s,a])=>s===String(t.before?.status??"$create")&&a===String(t.after?.status??"$delete")),missing_fields:[],remediation:"Choose a declared allowed transition; inspect pm schema policies."};case"authors":return{satisfied:r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared workflow actor perform this operation."};case"field_writers":return{satisfied:!i||r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared field writer change the protected fields."};case"approval":return{satisfied:!o||Fc(e,t,r.authors,n),missing_fields:[],remediation:`Record an independent approval with pm schema policy-approve <item-id> --policy ${e.id} after preparing the reviewed fields.`}}}function Xr(e,t,n){let r=e.policies.filter(o=>Lc(o,t)).map(o=>{let i=o.effect??"advise",s=n(o);return{policy_id:o.id,policy_fingerprint:s,rule:o.rule.kind,effect:i==="refuse"&&e.enforcement!=="refuse"?"warn":i,...Uc(o,t,s)}});return{allowed:!r.some(o=>!o.satisfied&&o.effect==="refuse"),decisions:r,warnings:r.filter(o=>!o.satisfied).map(o=>`workflow_policy:${o.effect}:${o.policy_id}:${o.rule}`)}}function Rg(e,t){return Xr(e,t,Yr)}function xg(e){let t=Nc(e),n=new Map(t.policies.map(r=>[r,Yr(r)]));return r=>Xr(t,r,o=>n.get(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]="1dd71b26-fc38-5304-9156-f32b57cc1cc0")}catch{}})();var zc=[...B],qc=[...Oe],Bc=[...ft],$g=[...mt],Lg=[...pt],Vc=[..._t],At=["init","config","extension","package","packages","install","upgrade","create","item","copy","focus","list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","aggregate","context","ctx","get","graph","search","duplicates","eval","next","history","events","history-redact","history-repair","history-compact","history-attest","history-author-acknowledge","merge","schema","profile","activity","restore","update","update-many","close","close-many","delete","append","comments","notes","learnings","files","docs","deps","plan","test","test-all","telemetry","stats","health","validate","assurance","gc","workspace","contracts","claim","release","start-task","pause-task","close-task","meet","event","remind","help"],jg=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],Fg=["install","reconcile","report","driver"],Wc=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],Gc=["upgrade"],Kc=["reopen"],Jr={help:"Commander help rendering has no SDK operation result.",packages:"The plural package alias only renders package-oriented help."},Ct=Object.freeze(At.flatMap(e=>e in Jr?[]:e==="extension"||e==="package"?[...Wc.map(t=>`${e}-${t}`),...e==="package"?Gc.map(t=>`package-${t}`):[],e]:e==="item"?Kc.map(t=>`item-${t}`):[e])),Hc=Object.freeze(kt.filter(e=>e.lifecycle==="deprecated"&&e.registration==="commander"&&Ct.includes(e.alias)).map(e=>e.alias)),Ug=Object.freeze(Ct.filter(e=>!Hc.includes(e)));function zg(e=At,t=Ct,n=Jr){let r=new Set(t),o=new Set(e);return{missing_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]===void 0),waived_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]!==void 0),stale_waivers:Object.keys(n).filter(i=>!o.has(i)||r.has(i)||t.some(s=>s.startsWith(`${i}-`)))}}function qg(e){return Ct.includes(e)}function Bg(e){return zc.includes(e)}function Vg(e){return qc.includes(e)}function Wg(e){return Bc.includes(e)}function Gg(e){return Vc.includes(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]="de2a2a0e-8a39-5569-9af9-cbf557bce2a9")}catch{}})();function Tt(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return null;let r=t.length+1,o=new Array(r),i=new Array(r),s=new Array(r);for(let c=0;c<r;c+=1)o[c]=0,i[c]=c;for(let c=1;c<=e.length;c+=1){s[0]=c;let d=s[0];for(let l=1;l<=t.length;l+=1){let u=e[c-1]===t[l-1]?0:1,f=i[l-1]+u,m=s[l-1]+1,p=i[l]+1,_=Math.min(f,m,p);c>1&&l>1&&e[c-1]===t[l-2]&&e[c-2]===t[l-1]&&(_=Math.min(_,o[l-2]+1)),s[l]=_,_<d&&(d=_)}if(d>n)return null;for(let l=0;l<r;l+=1)o[l]=i[l],i[l]=s[l]}let a=i[t.length];return a<=n?a:null}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1ddb0411-5fdd-56af-a524-0f6830c288a5")}catch{}})();function Ve(e){return[...new Set(e.map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function J(e){return B.includes(e)}function Qr(e){let t=e.trim().toLowerCase();return J(t)?t:null}function Zr(e){return e.filter(t=>!J(t))}function _n(e){let t=e.trim().toLowerCase();return t.length===0?null:sn[t]??null}function eo(e){let t=Ve([...e].map(i=>i.toLowerCase())),n=[],r=[];for(let i of t){let s=_n(i);if(s){n.push(s),r.push({alias:i,target:s});continue}n.push(i)}let o=[...new Map(r.map(i=>[`${i.alias}>${i.target}`,i])).values()].sort((i,s)=>i.alias.localeCompare(s.alias));return{capabilities:Ve(n),legacy_aliases:o}}function Yc(e){let t=e.trim().toLowerCase();if(t.length===0)return null;let n=_n(t);if(n)return n;let r=Math.max(1,Math.floor(t.length*.34)),o=null,i=Number.POSITIVE_INFINITY;for(let s of B){let a=Tt(t,s,r);a!==null&&a<i&&(i=a,o=s)}return o}function to(e,t,n){let r=B.join(","),o=Yc(n)??"none";return`extension_capability_unknown:${e}:${t}:${n}:allowed=${r}:suggested=${o}`}function no(e,t,n){let r=n.map(o=>`${o.alias}>${o.target}`).join(",");return`extension_capability_legacy_alias:${e}:${t}:aliases=${r}`}function Xc(e){let t=/^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(e.trim());if(!t)return null;let[,n,r,o,i,s]=t,a=n,c=i.split(",").map(m=>m.trim()).filter(m=>m.length>0),d=_n(o),u=(s==="none"?void 0:s)??d??void 0;return{layer:a,name:r,capability:o,allowed_capabilities:c,capability_contract_version:ut,suggested_capability:u,suggestion_source:u?d===u?"legacy_alias":"nearest_match":void 0,legacy_alias_target:d??void 0}}function Jc(e){let t=/^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(e.trim());if(!t)return[];let[,n,r,o]=t,i=n,s=[...B],a=[];for(let c of o.split(",")){let[d,l]=c.split(">"),u=d?.trim(),f=l?.trim().toLowerCase();!u||!f||!J(f)||a.push({layer:i,name:r,capability:u,allowed_capabilities:s,capability_contract_version:ut,suggested_capability:f,suggestion_source:"legacy_alias",legacy_alias_target:f})}return a}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="71c44385-0182-50f8-8e05-3aeebfe57ad9")}catch{}})();var Qc={commands:["registerCommand","command override","command handler"],renderers:["registerRenderer"],hooks:["hooks.beforeCommand","hooks.beforeMutation","hooks.afterCommand","hooks.onWrite","hooks.onRead","hooks.onIndex"],schema:["registerFlags","registerItemFields","registerItemTypes","registerRelationshipKinds","registerMigration","registerProfile"],importers:["registerImporter","registerExporter"],search:["registerSearchProvider","registerVectorStoreAdapter"],parser:["registerParser"],preflight:["registerPreflight"],services:["registerService","registerAssuranceMeasurementProvider"]},ro=":";function oo(e,t){return`${e}${ro}${gn(t)}`}function Zc(e){return e.slice(e.indexOf(ro)+1)}function gn(e){return e.trim().toLowerCase()}function ed(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let r=Qr(n);r!==null&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function io(e){let t=new Map,n=(l,u)=>{for(let f of l){let m=oo(f.layer,f.name),p=t.get(m);p===void 0&&(p=new Set,t.set(m,p)),p.add(u)}},{registrations:r,commands:o,parsers:i,preflight:s,services:a,renderers:c,hooks:d}=e;return n(r.commands,"commands"),n(o.overrides,"commands"),n(o.handlers,"commands"),n(r.flags,"schema"),n(r.item_fields,"schema"),n(r.item_types,"schema"),n(r.relationship_kinds??[],"schema"),n(r.migrations,"schema"),n(r.profiles,"schema"),n(r.importers,"importers"),n(r.exporters,"importers"),n(r.search_providers,"search"),n(r.vector_store_adapters,"search"),n(i.overrides,"parser"),n(s.overrides,"preflight"),n(a.overrides,"services"),n(r.assurance_providers??[],"services"),n(c.overrides,"renderers"),n(d.beforeCommand,"hooks"),n(d.beforeMutation,"hooks"),n(d.afterCommand,"hooks"),n(d.onWrite,"hooks"),n(d.onRead,"hooks"),n(d.onIndex,"hooks"),t}function td(e,t={}){let n=io(e),r=new Set;t.extensionName!==void 0&&r.add(gn(t.extensionName));for(let i of t.extensionNames??[])r.add(gn(i));let o=new Set;for(let[i,s]of n)if(!(r.size>0&&!r.has(Zc(i))))for(let a of s)o.add(a);return[...o].sort((i,s)=>i.localeCompare(s))}function nd(e,t){let n=io(t),r=[];for(let o of e){let i=ed(o.capabilities);if(i.length===0)continue;let s=n.get(oo(o.layer,o.name))??new Set,a=[...s].sort((d,l)=>d.localeCompare(l)),c=i.filter(d=>!s.has(d));r.push({layer:o.layer,name:o.name,declared:i,used:a,unused:c})}return r}import{createHash as rd}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]="15037266-75b7-5f8d-9565-e7848e720a49")}catch{}})();var yn=1,ao=4096,od=/^[A-Za-z0-9_-]+$/;function so(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function oy(e,t){let n=new Set;for(let r of t)if(r.cursor_semantics==="presentation"){n.add(so(r.flag));for(let o of r.aliases??[])n.add(so(o))}return Object.fromEntries(Object.entries(e).filter(([r])=>!n.has(r)))}function iy(e,t){return rd("sha256").update(e).update("\0").update(de(t)).digest("hex").slice(0,24)}function We(e,t,n,r){return Buffer.from(JSON.stringify({version:yn,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...r===void 0?{}:{snapshot:r}})).toString("base64url")}function ue(e){return new h(e,y.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function id(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===yn&&typeof t.fingerprint=="string"&&typeof t.after_id=="string"&&t.after_id.length>0&&(t.after_index===void 0||Number.isSafeInteger(t.after_index)&&t.after_index>=0)&&(t.snapshot===void 0||typeof t.snapshot=="string"&&t.snapshot.length>0)}function hn(e){if(typeof e!="string")throw ue("Query cursor is malformed.");let t=e.trim();if(t.length===0||t.length>ao||!od.test(t))throw ue("Query cursor is malformed.");let n;try{n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw ue("Query cursor is malformed.")}if(!id(n))throw ue("Query cursor version or payload is unsupported.");return n}function bn(e,t){let n=hn(e);if(n.fingerprint!==t)throw ue(`Query cursor does not match the current filters, sort, or query (${n.fingerprint} != ${t}).`);return{after_id:n.after_id,...n.after_index===void 0?{}:{after_index:n.after_index},...n.snapshot===void 0?{}:{snapshot:n.snapshot}}}function sy(e,t){return bn(e,t).after_id}function sd(e,t,n,r){if(t===void 0)return 0;let o=bn(t,n),i=e.findIndex(s=>r(s)===o.after_id);if(i<0){if(o.after_index!==void 0)return Math.min(o.after_index,e.length);throw ue(`Query cursor item ${o.after_id} is no longer present in this result set.`)}return i+1}function ay(e,t){if(t.cursor!==void 0&&bn(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw ue("Query cursor does not match the requested snapshot.");let n=sd(e,t.cursor,t.fingerprint,t.readId),r=e.slice(n,n+t.limit),o=r.length>0&&n+r.length<e.length,i=r.at(-1);return{rows:r,has_more:o,...o&&i!==void 0?{next_cursor:We(t.fingerprint,t.readId(i),n+r.length-1,t.snapshot)}:{}}}var cy=Object.freeze({version:yn,max_length:ao});import{stripVTControlCharacters as ad}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b4036040-c0b8-5d01-b490-3405722fd1c5")}catch{}})();var cd=["full","compact","brief","summary","counts"],my=["mutation","read","discovery","governance"],lo=["error","warning","validation_summary","recovery_bundle"],dd=["full","omit_explanation","limit_collections","compact_recovery","action_only"],ld=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),ud=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),fd=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),md={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},pd=3,_d=2,gd=192,yd={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},hd=lo.map(e=>({diagnostic_class:e,default_max_estimated_tokens_by_format:yd[e],minimum_max_estimated_tokens:gd,degradation_ladder:dd,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),bd=new Map(hd.map(e=>[e.diagnostic_class,e]));function wd(e){let[t=""]=qe(e).split(/\s+/u);return ld.has(t)?"mutation":ud.has(t)?"discovery":fd.has(t)?"governance":"read"}function uo(e,t=wd(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let r=md[t];return vd({command:n,budget_class:t,default_max_estimated_tokens:r,default_max_estimated_tokens_by_format:{toon:r,json:Math.ceil(r*pd/_d)},degradation_ladder:cd,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function vd(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var Ed=At.map(e=>uo(e)),kd=new Map(Ed.map(e=>[e.command,e]));function fo(e,t={}){let n=e.trim().replace(/\s+/gu," "),[r]=qe(n).split(" "),o=kd.get(r);return o?{...o,command:n}:t.generateFallback?uo(n):null}function me(e){return Math.ceil(Math.max(0,e)/4)}function mo(e){let t=bd.get(e);if(t===void 0)throw new TypeError(`diagnosticClass must be one of: ${lo.join(", ")}`);return t}function Q(e){return me(Buffer.byteLength(JSON.stringify(e,null,2),"utf8"))}function Od(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wn(e){if(!Od(e))return;let t={};for(let n of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms"]){let r=e[n];Array.isArray(r)?t[n]=n==="suggested_retry_args"?r:r.slice(0,3):r!==void 0&&(t[n]=r)}return Object.keys(t).length>0?t:void 0}function Sd(e,t){return typeof e!="string"||e.length<=t?e:`${e.slice(0,Math.max(1,t-3))}...`}function fe(e,t){if(Buffer.byteLength(e,"utf8")<=t)return e;let n="...",r=Array.from(e),o=0,i=r.length;for(;o<i;){let s=Math.ceil((o+i)/2),a=`${r.slice(0,s).join("")}${n}`;Buffer.byteLength(a,"utf8")<=t?o=s:i=s-1}return`${r.slice(0,o).join("")}${n}`}function po(e){let t={};for(let n of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(e,n)&&e[n]!==void 0&&(t[n]=e[n]);for(let[n,r]of Object.entries(e))n!=="__proto__"&&!Object.hasOwn(t,n)&&(t[n]=r);return t}var Ad=new Set(["limit_collections","compact_recovery","action_only"]),Cd=new Set(["compact_recovery","action_only"]);function Td(e){let t={code:typeof e.code=="string"?e.code:"diagnostic",required:Sd(e.required,160)??"Inspect the diagnostic code and retry with corrected input."},n=wn(e.recovery);return n!==void 0?t.recovery=n:Array.isArray(e.next_steps)&&(t.next_steps=e.next_steps.slice(0,1)),e.exit_code!==void 0&&(t.exit_code=e.exit_code),e.type!==void 0&&(t.type=e.type),t}function Id(e,t){let n=structuredClone(e);if(t!=="full"&&(delete n.why,delete n.examples),Ad.has(t))for(let[r,o]of Object.entries(n))Array.isArray(o)&&(n[r]=o.slice(0,3));if(Cd.has(t)){let r=wn(n.recovery);r?n.recovery=r:delete n.recovery}return t!=="action_only"?po(n):Td(n)}function Se(e,t){let n={...e,diagnostic_output:{...t,estimated_tokens:0}};for(let r=0;r<4;r+=1){let o=Q(n),i=n.diagnostic_output;if(i.estimated_tokens===o)break;i.estimated_tokens=o}return n}function Rd(e,t,n){let r=Se(e,t);for(let i of["recovery","exit_code"])Q(r)<=n||e[i]===void 0||(delete e[i],r=Se(e,t));let o=40;for(;Q(r)>n&&o>4;)o-=4,e.code=fe(String(e.code),o),e.required=fe(String(e.required),o),r=Se(e,t);return r}function xd(e,t){let n=e.diagnostic_output,{estimated_tokens:r,...o}=n,i=o.omitted_fields.slice(0,8).map(u=>fe(u,32)),s={...o,omitted_fields:i,...o.omitted_fields.length>i.length?{omitted_fields_overflow_count:o.omitted_fields.length-i.length}:{}},a=wn(e.recovery),c=a&&Q(a)<=48?a:void 0,d={code:fe(String(e.code),320),required:fe(String(e.required),320),...c?{recovery:c}:{},...e.exit_code!==void 0?{exit_code:e.exit_code}:{}},l=Se(d,s);for(;Q(l)>t&&s.omitted_fields.length>0;)s.omitted_fields.pop(),s.omitted_fields_overflow_count=o.omitted_fields.length-s.omitted_fields.length,l=Se(d,s);return l=Rd(d,s,t),l}function py(e,t={}){let n=e,r=t.diagnosticClass??"error",o=mo(r),i=t.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<o.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${o.minimum_max_estimated_tokens}`);let s=i??o.default_max_estimated_tokens_by_format.json,a=Q(n),c=Object.keys(n);if(a<=s)return po(structuredClone(n));let d;for(let[l,u]of o.degradation_ladder.entries()){let f=Id(n,u),m=c.filter(_=>!Object.hasOwn(f,_)),p=Se(f,{diagnostic_class:r,format:"json",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,truncated:l>0,degradation_steps:o.degradation_ladder.slice(0,l+1),omitted_fields:m});if(d=p,Q(p)<=s)break}return Q(d)>s&&(d=xd(d,s)),d}function co(e){return ad(e).replace(/\r\n/gu,`
|
|
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]="9ddd9ea4-8586-5d3d-9ed8-0bf9da49b9a5")}catch{}})();var B=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],ut=2,sn=Object.freeze({migration:"schema",validation:"schema"}),E_=Object.freeze({version:ut,capabilities:[...B],legacy_aliases:{...sn}}),ft=["off","warn","enforce"],mt=["off","warn","enforce"],pt=["none","restricted","strict"],Lr=["block","warn"],_t=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],Oe=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function gt(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(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]="a966bb77-c4be-593b-93f5-b6277072160e")}catch{}})();var La=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],jr=La,O_=["draft","open","in_progress","blocked","closed","canceled"],S_=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],Fr=["string","number","boolean","string_array","array","object"],A_=["create","update","update_many","list","search","calendar","context"],C_=["allow","warn","reject"],T_=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","recurs_from","supersedes","task","verifies"],I_=["project","global"],R_=["low","medium","high","critical"],x_=["low","medium","high","critical"],N_=["low","medium","high"];var D_=["minimal","default","strict","custom"],P_=["none","warn","strict"],M_=["progressive","strict"],$_=["off","warn","strict"],L_=["off","warn","strict"];var j_=["daily","weekly","monthly","yearly"],ja=["mon","tue","wed","thu","fri","sat","sun"];function F_(e){return ja.indexOf(e)}var U_=["draft","research","review","approved","executing","paused","completed","superseded"],z_=["pending","in_progress","completed","blocked","skipped","superseded"],q_=["codex","claude-code","cursor","generic"],B_=["related","blocks","blocked_by","depends_on","discovered_from","implements","recurs_from","verifies","supersedes"],V_=["brief","standard","deep","full"],W_=["hierarchy","activity","progress","recently_created","unparented","blockers","files","workload","staleness","tests"];(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]="89d6c349-10d7-596d-90a1-65afcc65eb91")}catch{}})();var Ur=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],Fa=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...Ur,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],Ua=Fa;(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]="6e329ab1-f22d-5749-b8a4-0a6e7a1c8023")}catch{}})();var za=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),qa=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),yt=".agents/pm",ht="settings.json";var Ba=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],Va=["decisions","events","reminders","milestones","meetings","plans"],X_=[...Ba,...Va],Ue={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},Wa={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},Ga=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],an={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function zr(e){return e?[...e]:void 0}var J_={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...Ga],lifecycle_closure_like_blocked_reason_patterns:[...an.blocked_reason],lifecycle_closure_like_resolution_patterns:[...an.resolution],lifecycle_closure_like_actual_result_patterns:[...an.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...Wa.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:za.map(e=>({...e,aliases:zr(e.aliases),roles:zr(e.roles)})),fields:[],workflow:{...qa},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:gt()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",default_mode:"auto",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},Q_={metadata:{},body:""},y={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},Z_=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});(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]="0f7e5fb3-86d2-5af5-a189-a40dd223ef26")}catch{}})();var h=class extends Error{exitCode;code;context;constructor(t,n,r={}){super(t),this.name="PmCliError",this.exitCode=n,this.context=r,this.code=r.code}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9961b408-ad70-5556-84dd-5ca1b1497c27")}catch{}})();var Ka=new Set(["name","version","entry","priority","description","author","capabilities","manifest_version","pm_min_version","pm_max_version","engines","trusted","provenance","sandbox_profile","permissions","activation","contributions","legacy_capability_aliases"]);function Ha(e){return{unknownKeys:Object.keys(e).filter(t=>!Ka.has(t)).sort((t,n)=>t>n?1:-1),missingVersionBounds:e.pm_min_version===void 0&&e.pm_max_version===void 0}}function Ya(e){let t=Ha(e),n=t.unknownKeys.map(r=>({code:"manifest_unknown_key",path:r,...r==="compatibility"?{suggested_key:"pm_min_version"}:{},message:r==="compatibility"?'Manifest key "compatibility" is ignored; declare the canonical pm_min_version and optional pm_max_version fields instead.':`Manifest key "${r}" is not part of the extension manifest contract and will be ignored.`}));return t.missingVersionBounds&&n.push({code:"no_version_bounds_declared",path:"$",suggested_key:"pm_min_version",message:"No canonical pm version bounds are declared; add pm_min_version so compatibility intent is explicit."}),{ok:n.length===0,findings:n}}function qr(e,t,n){return Ya(n).findings.map(r=>r.code==="manifest_unknown_key"?`extension_manifest_unknown_key:${e}:${t.name}:key=${r.path}${r.suggested_key?`:suggested=${r.suggested_key}`:""}`:`extension_manifest_no_version_bounds:${e}:${t.name}:suggested=pm_min_version`)}(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]="4c00e38a-27df-5315-91e8-d35c03ed6bf3")}catch{}})();var cn=[{kind:"blocked_by",direction:"directed",traversal:"ordering",inverse:"blocks",ordering:!0,precedence:"target_before_source",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["depends_on"],compatibilityVersion:1,allowSelf:!1},{kind:"blocks",direction:"directed",traversal:"ordering",inverse:"blocked_by",ordering:!0,precedence:"source_before_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"parent",direction:"directed",traversal:"hierarchy",outcomeTraversal:"source_to_target",inverse:"child",ordering:!1,hierarchy:!0,hierarchyDirection:"target_parent",outgoing:"one",incoming:"many",lifecycle:"supersedable",aliases:["child_of","epic"],compatibilityVersion:1,allowSelf:!1},{kind:"child",direction:"directed",traversal:"hierarchy",outcomeTraversal:"target_to_source",inverse:"parent",ordering:!1,hierarchy:!0,hierarchyDirection:"source_parent",outgoing:"many",incoming:"one",lifecycle:"supersedable",aliases:["parent_child","task"],compatibilityVersion:1,allowSelf:!1},{kind:"related",direction:"undirected",traversal:"association",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",aliases:["related_to"],compatibilityVersion:1,allowSelf:!1},{kind:"discovered_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"incident_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"implements",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"recurs_from",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,temporalOrder:"source_after_target",hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"verifies",direction:"directed",traversal:"semantic",outcomeTraversal:"source_to_target",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"persistent",compatibilityVersion:1,allowSelf:!1},{kind:"supersedes",direction:"directed",traversal:"semantic",outcomeTraversal:"both",ordering:!1,hierarchy:!1,outgoing:"many",incoming:"many",lifecycle:"supersedable",compatibilityVersion:1,allowSelf:!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]="b658dc99-fdbb-5d10-9dd6-5f5c263bf48b")}catch{}})();function vt(e){return e.trim().toLowerCase().replaceAll("-","_")}function Xa(e){if(e===void 0)return;let t=vt(e);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid inverse relationship kind: ${e}`);return t}function ln(e,t=new Set){if(e===null||typeof e!="object"||t.has(e))return e;if(t.add(e),Array.isArray(e)){for(let n of e)ln(n,t);return Object.freeze(e)}for(let n of Object.values(e))ln(n,t);return Object.freeze(e)}function Ja(e,t){if(e.precedence!==void 0&&e.precedence!=="source_before_target"&&e.precedence!=="target_before_source")throw new TypeError(`Invalid relationship precedence for ${t}`);if(!e.ordering&&e.precedence!==void 0)throw new TypeError(`Non-ordering relationship kind cannot declare precedence: ${t}`)}function Qa(e,t){if(e.temporalOrder!==void 0&&e.temporalOrder!=="source_after_target")throw new TypeError(`Invalid relationship temporal order for ${t}`);if(e.direction!=="directed"&&e.temporalOrder!==void 0)throw new TypeError(`Undirected relationship kind cannot declare temporal order: ${t}`)}function Za(e,t){if(e.hierarchyDirection!==void 0&&e.hierarchyDirection!=="source_parent"&&e.hierarchyDirection!=="target_parent")throw new TypeError(`Invalid relationship hierarchy direction for ${t}`);if(!e.hierarchy&&e.hierarchyDirection!==void 0)throw new TypeError(`Non-hierarchy relationship kind cannot declare hierarchy direction: ${t}`)}function ec(e){if(typeof e!="object"||e===null)throw new TypeError("Relationship kind definition requires an object");if(typeof e.kind!="string")throw new TypeError("Relationship kind requires a string identifier");let t=vt(e.kind);if(!/^[a-z][a-z0-9_]*$/.test(t))throw new TypeError(`Invalid relationship kind: ${e.kind}`);if(!Number.isInteger(e.compatibilityVersion)||e.compatibilityVersion<1)throw new TypeError(`Invalid compatibility version for ${t}`);return t}function tc(e,t){if(!["directed","undirected"].includes(e.direction))throw new TypeError(`Invalid relationship direction for ${t}`);if(typeof e.ordering!="boolean")throw new TypeError(`Invalid relationship ordering flag for ${t}`);if(![void 0,!0,!1].includes(e.hierarchy))throw new TypeError(`Invalid relationship hierarchy flag for ${t}`);if(!["one","many"].includes(e.outgoing))throw new TypeError(`Invalid outgoing relationship cardinality for ${t}`);if(!["one","many"].includes(e.incoming))throw new TypeError(`Invalid incoming relationship cardinality for ${t}`);if(!["persistent","supersedable","ephemeral"].includes(e.lifecycle))throw new TypeError(`Invalid relationship lifecycle for ${t}`);if(typeof e.allowSelf!="boolean")throw new TypeError(`Invalid relationship self-edge flag for ${t}`);if(e.traversal!==void 0&&!["hierarchy","ordering","semantic","association"].includes(e.traversal))throw new TypeError(`Invalid relationship traversal family for ${t}`);if(e.outcomeTraversal!==void 0&&!["source_to_target","target_to_source","both"].includes(e.outcomeTraversal))throw new TypeError(`Invalid outcome traversal for ${t}`);if(e.direction==="undirected"&&e.outcomeTraversal!==void 0&&e.outcomeTraversal!=="both")throw new TypeError(`Undirected relationship kind cannot declare directional outcome traversal: ${t}`)}function nc(e,t){if(e.payloadSchema!==void 0&&(typeof e.payloadSchema!="object"||e.payloadSchema===null||Array.isArray(e.payloadSchema)))throw new TypeError(`Invalid relationship payload schema for ${t}`);if(e.aliases!==void 0&&(!Array.isArray(e.aliases)||e.aliases.some(n=>typeof n!="string")))throw new TypeError(`Invalid relationship aliases for ${t}`)}function rc(e){return e.traversal?e.traversal:e.ordering?"ordering":e.hierarchy?"hierarchy":e.direction==="undirected"?"association":"semantic"}var un=class{#e=new Map;#n=new Map;constructor(t=cn){for(let n of t)this.register(n)}register(t){let n=ec(t);if(tc(t,n),nc(t,n),Ja(t,n),Qa(t,n),Za(t,n),this.#e.has(n)||this.#n.has(n))throw new TypeError(`Relationship kind already registered: ${n}`);let r=Xa(t.inverse),o=[...new Set((t.aliases??[]).map(vt))].sort();for(let s of o){if(!/^[a-z][a-z0-9_]*$/.test(s))throw new TypeError(`Invalid relationship alias: ${s}`);if(s===n||this.#e.has(s)||this.#n.has(s))throw new TypeError(`Relationship alias already registered: ${s}`)}let i=Object.freeze({...t,kind:n,traversal:rc(t),hierarchy:t.hierarchy??!1,hierarchyDirection:t.hierarchy?t.hierarchyDirection??"source_parent":void 0,inverse:r,aliases:Object.freeze(o),payloadSchema:t.payloadSchema?ln(structuredClone(t.payloadSchema)):void 0});this.#e.set(n,i);for(let s of o)this.#n.set(s,n);return this}resolve(t){if(typeof t!="string")return;let n=vt(t);return this.#e.get(this.#n.get(n)??n)}require(t){let n=this.resolve(t);if(!n)throw new TypeError(`Unknown relationship kind: ${t}`);return n}list(){return Object.freeze([...this.#e.values()].sort((t,n)=>t.kind.localeCompare(n.kind)))}};function fn(){return new un}var ce=fn();function sg(e){return ce.require(e).kind}function ag(e){return ce.resolve(e)?.kind}function cg(e,t=ce){return t.resolve(e)?.ordering===!0}function oc(e,t,n,r=ce){let o=ze(e),i=ze(t);if(!o||!i)throw new TypeError("Relationship endpoint must not be empty");let s=r.require(n);if(o===i&&!s.allowSelf)throw new TypeError(`Self relationship is not allowed for ${s.kind}`);return s}function bt(e,t){return e.source.localeCompare(t.source)||e.target.localeCompare(t.target)||e.kind.localeCompare(t.kind)}function ic(e,t,n){let r=typeof e.source=="string"?e.source.trim():"",o=typeof e.target=="string"?e.target.trim():"";if(!t.has(r)||!t.has(o))throw new TypeError(`Relationship endpoint not found: ${r} -> ${o}`);let i=oc(r,o,e.kind,n),s=Object.freeze({...e,source:r,target:o,kind:i.kind}),a=i.direction==="undirected"?[r,o].sort().join("\0"):`${r}\0${o}`;return{edge:s,identity:`${i.kind}\0${a}`}}function wt(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function ze(e){return typeof e=="string"?e.trim():""}function dn(e,t){let n=ze(e);return n&&t.has(n)?n:void 0}function sc(e,t,n){let r=[t],o=t;for(;o!==e;)o=n.get(o),r.push(o);return r.reverse()}var Br=class e{#e;#n;#o;#r;#s=new Map;#a=new Map;constructor(t,n,r=ce){this.#e=r,this.#n=new Set([...t].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#o=Object.freeze([...this.#n].sort());let o=new Map;for(let i of n){let{edge:s,identity:a}=ic(i,this.#n,r);o.set(a,s)}this.#r=Object.freeze([...o.values()].sort(bt));for(let i of this.#r)wt(this.#s,i.source,i),wt(this.#a,i.target,i),r.require(i.kind).direction==="undirected"&&(wt(this.#s,i.target,i),wt(this.#a,i.source,i))}static fromItems(t,n=ce){let r=new Set(t.map(i=>ze(i.id)).filter(Boolean)),o=[];for(let i of t){let s=ze(i.id);if(!s)continue;let a=dn(i.parent,r);a&&o.push({source:s,target:a,kind:"parent"});let c=dn(i.blocked_by,r);c&&o.push({source:s,target:c,kind:"blocked_by"});for(let d of i.dependencies??[]){let l=dn(d.id,r);l&&n.resolve(d.kind)&&o.push({source:s,target:l,kind:d.kind,createdAt:d.created_at,author:d.author})}}return new e(r,o,n)}edges(){return this.#r}incidentEdges(t){this.#i(t);let n=this.#s.get(t)??[],r=this.#a.get(t)??[];if(n.length===0)return Object.freeze([...r]);if(r.length===0)return Object.freeze([...n]);let o=[],i=0,s=0;for(;i<n.length||s<r.length;){let a=n[i],c=r[s],d=a===void 0?c:c===void 0||bt(a,c)<=0?a:c;o.at(-1)!==d&&o.push(d),a===d&&(i+=1),c===d&&(s+=1)}return Object.freeze(o)}nodes(){return this.#o}hasNode(t){return this.#n.has(t)}registry(){return this.#e}#i(t){if(!this.#n.has(t))throw new TypeError(`Relationship node not found: ${t}`)}#c(t,n){if(!n)return!0;let r=this.#e.require(t.kind);return n.has(t.kind)||r.inverse!==void 0&&n.has(r.inverse)}#t(t,n,r){let o=[...n==="incoming"?[]:this.#s.get(t)??[],...n==="outgoing"?[]:this.#a.get(t)??[]];return[...new Set(o)].filter(i=>this.#c(i,r)).map(i=>({id:i.source===t?i.target:i.source,edge:i})).sort((i,s)=>i.id.localeCompare(s.id)||bt(i.edge,s.edge))}adjacency(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=[...new Set(o.map(c=>c.id))],a=s.slice(0,i);return{value:a,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:a.length<s.length,nextCursor:a.at(-1)}}}neighborEdges(t,n={}){this.#i(t),n.signal?.throwIfAborted();let r=n.kinds?new Set(n.kinds.map(a=>this.#e.require(a).kind)):void 0,o=this.#t(t,n.direction??"outgoing",r),i=n.limit??Number.POSITIVE_INFINITY,s=o.slice(0,i);return{value:s,meta:{visitedNodes:1,inspectedEdges:o.length,truncated:s.length<o.length,nextCursor:s.at(-1)?.id}}}closure(t,n={}){this.#i(t);let r=n.kinds?new Set(n.kinds.map(m=>this.#e.require(m).kind)):void 0,o=n.direction??"outgoing",i=n.limit??Number.POSITIVE_INFINITY,s=n.maxDepth??Number.POSITIVE_INFINITY,a=new Set([t]),c=[],d=[{id:t,depth:0}],l=0,u=0,f=!1;e:for(let m=0;m<d.length;m+=1){n.signal?.throwIfAborted();let p=d[m];l+=1;let _=this.#t(p.id,o,r);if(u+=_.length,p.depth>=s){_.some(g=>!a.has(g.id))&&(f=!0);continue}for(let g of _)if(!a.has(g.id)){if(c.length>=i){f=!0;break e}a.add(g.id),c.push(g.id),d.push({id:g.id,depth:p.depth+1})}}return{value:c,meta:{visitedNodes:l,inspectedEdges:u,truncated:f,nextCursor:c.at(-1)}}}shortestPath(t,n,r={}){if(this.#i(t),this.#i(n),t===n)return{value:[t],meta:{visitedNodes:1,inspectedEdges:0,truncated:!1}};let o=r.kinds?new Set(r.kinds.map(m=>this.#e.require(m).kind)):void 0,i=r.direction??"outgoing",s=r.maxDepth??Number.POSITIVE_INFINITY,a=[{id:t,depth:0}],c=new Map,d=new Set([t]),l=0,u=0,f=!1;for(let m=0;m<a.length;m+=1){r.signal?.throwIfAborted();let p=a[m];l+=1;let _=this.#t(p.id,i,o);if(u+=_.length,p.depth>=s){_.some(g=>!d.has(g.id))&&(f=!0);continue}for(let g of _)if(!d.has(g.id)){if(c.set(g.id,p.id),g.id===n)return{value:sc(t,n,c),meta:{visitedNodes:l,inspectedEdges:u,truncated:!1}};d.add(g.id),a.push({id:g.id,depth:p.depth+1})}}return{value:[],meta:{visitedNodes:l,inspectedEdges:u,truncated:f}}}subgraph(t,n={}){let r=this.closure(t,n),o=[t,...r.value].sort(),i=new Set(o),s=n.kinds?new Set(n.kinds.map(c=>this.#e.require(c).kind)):void 0,a=new Set;for(let c of o)for(let d of this.#s.get(c)??[])i.has(d.source)&&i.has(d.target)&&this.#c(d,s)&&a.add(d);return{value:{nodes:o,edges:[...a].sort(bt)},meta:r.meta}}};function dg(e,t,n=ce){return{source:e,target:t.id,kind:n.require(t.kind).kind,createdAt:t.created_at,author:t.author}}(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]="720821b8-d18d-5a10-a8b9-f16073dc1fc4")}catch{}})();function O(e){return e.trim().toLowerCase().split(/\s+/).filter(t=>t.length>0).join(" ")}function ac(){return{json:!1,quiet:!1,noExtensions:!1,profile:!1}}function Vr(e){return e?P(e):{}}function Wr(e){return e?P(e):ac()}function P(e){return structuredClone(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]="7d96fda0-1f2f-5e34-99da-c3c5ad0f53f6")}catch{}})();var cc=new Set(["commands","command_overrides","command_handlers","flag_commands","parser_overrides"]),dc=["commands","command_overrides","command_handlers","hooks","flag_commands","item_types","item_fields","relationship_kinds","migrations","profiles","importers","exporters","search_providers","vector_store_adapters","assurance_providers","parser_overrides","service_overrides","renderer_overrides"];function lc(e,t){for(let n of dc){let r=e[n];if(r===void 0)continue;if(!Array.isArray(r)||r.some(i=>typeof i!="string"))return!1;let o=r.map(i=>cc.has(n)?O(i):i.trim()).filter(i=>i.length>0);t[n]=[...new Set(o)].sort((i,s)=>i.localeCompare(s))}return!0}function uc(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n;if(r.format!=="json"&&r.format!=="toon"||!Array.isArray(r.commands)||r.commands.some(o=>typeof o!="string")||typeof r.result_discriminator!="boolean")return null;t.push({format:r.format,commands:[...new Set(r.commands.map(o=>O(o)))].sort((o,i)=>o.localeCompare(i)),result_discriminator:r.result_discriminator})}return t.sort((n,r)=>n.format.localeCompare(r.format))}function fc(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!="object"||n===null)return null;let r=n.commands;if(!Array.isArray(r)||r.some(o=>typeof o!="string"))return null;t.push({commands:[...new Set(r.map(o=>O(o)))].filter(o=>o.length>0).sort((o,i)=>o.localeCompare(i))})}return t}function Et(e){if(e==null)return;if(typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.schema_version!==1)return null;let n={schema_version:1};if(!lc(t,n))return null;let r=t.preflight_overrides;if(r!==void 0&&(!Number.isInteger(r)||r<0))return null;typeof r=="number"&&(n.preflight_overrides=r);let o=t.renderer_ownership;if(o!==void 0){let s=uc(o);if(s===null)return null;n.renderer_ownership=s}let i=t.preflight_ownership;if(i!==void 0){let s=fc(i);if(s===null)return null;n.preflight_ownership=s}return n}function mg(e){return{schema_version:1,commands:e.commands,command_overrides:e.command_overrides,command_handlers:e.command_handlers,hooks:e.hooks,flag_commands:e.flag_commands,item_types:e.item_types,item_fields:e.item_fields,...e.relationship_kinds?{relationship_kinds:e.relationship_kinds}:{},migrations:e.migrations,profiles:e.profiles,importers:e.importers,exporters:e.exporters,search_providers:e.search_providers,vector_store_adapters:e.vector_store_adapters,...e.assurance_providers?{assurance_providers:e.assurance_providers}:{},parser_overrides:e.parser_overrides,service_overrides:e.service_overrides,renderer_overrides:e.renderer_overrides,...e.renderer_ownership?{renderer_ownership:e.renderer_ownership}:{},preflight_overrides:e.preflight_overrides,...e.preflight_ownership?{preflight_ownership:e.preflight_ownership}:{}}}(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]="c7018240-2680-597f-9e71-e4b3f46ef91d")}catch{}})();var mc=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-tqel"})),pc=[...["next","focus"].map(e=>({alias:e,canonical:`context ${e}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-6apl"})),...["normalize","reindex"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(e=>({...e,canonical_argv:e.canonical.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap"})),_c=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-ik19"})),gc=[...pc,..._c,...[...["comments","notes","learnings","files","docs","deps","append","test"].map(e=>[e,`item ${e}`,"pm-yql1"]),["test-runs-worker","item test worker","pm-lp4j"],...["statuses","tags","types"].map(e=>[`completion-${e}`,`completion ${e}`,"pm-szdc"]),["history-author-acknowledge","history acknowledge","pm-djyvbk"],["copy","item copy","pm-m6g87m"],["merge","workspace merge","pm-m6g87m"],["duplicates","item duplicates","pm-fmy9ih"],["dedupe-audit","item duplicates audit","pm-fmy9ih"],["dedupe-merge","item duplicates merge","pm-fmy9ih"],["comments-audit","item audit-comments","pm-fmy9ih"],["search-advanced","search advanced","pm-wfskfn"],...["meet","event","remind"].map(e=>[e,`calendar ${e}`,"pm-o3fh"])].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:n}))],mn=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...mc,...gc,...["discover","lookup"].map(e=>({alias:`files ${e}`,canonical:`item files ${e}`,canonical_argv:["item","files",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-yql1"}))];function _g(e){let t;for(let n of mn)n.canonical_argv.length<=(t?.canonical_argv.length??0)||n.canonical_argv.every((r,o)=>r===(o===0&&e[o]==="ctx"?"context":e[o]))&&(t=n);return t}function yc(e){let t=e.trim().replace(/\s+/gu," ");return mn.find(n=>n.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function qe(e){return yc(e)}var kt=[...mn,...[["ctx","context"],["packages","package"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-pbyu"})),...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:[t,n],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"item test",canonical_argv:["item","test"],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:["comments","notes","learnings"].includes(t)?`item ${t}`:t,canonical_argv:["comments","notes","learnings"].includes(t)?["item",t]:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension list","extension catalog"],["extension scaffold","extension init"],["package list","package catalog"],["package scaffold","package init"],["packages list","packages catalog"],["packages scaffold","packages init"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-ya7x55"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-tnud"}))],gg=Object.fromEntries(kt.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function yg(e){let t=e.trim().toLowerCase();return kt.find(n=>n.alias===t)}function hg(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bfaa3455-3237-5c98-8ef4-b353ce9530fe")}catch{}})();var wg=Object.freeze({rows:10,paths:5,samples:10,path_depth:8,visited_paths:1e4});import{createHash as Hr}from"node:crypto";import hc 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]="c036d6cf-6a10-5c74-9e2f-e7c953339e2c")}catch{}})();function bc(e){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e===void 0)return"undefined";if(typeof e=="symbol")return e.toString();if(typeof e=="function")return`[function:${e.name||"anonymous"}]`}function wc(e){let t=Object.keys(e).sort(),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=Ot(o))}return n}function Ot(e){let t=bc(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(r=>Ot(r));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let r=n.toJSON();if(r!==e)return Ot(r)}return wc(e)}function de(e){return JSON.stringify(Ot(e))}function Gr(e,t,n,r){for(let o=0;o<t.length;o+=1)if(!n.has(o)&&r(e,t[o]))return n.add(o),!0;return!1}function vc(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function Ec(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function kc(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],r=new Set;for(let o of e)if(!Gr(o,n,r,V))return!1;return!0}function Oc(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],r=new Set;for(let[o,i]of e.entries())if(!Gr([o,i],n,r,([a,c],[d,l])=>V(a,d)&&V(c,l)))return!1;return!0}function Sc(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>V(n,t[r]))}function Ac(e,t){let n=Object.keys(e).sort((o,i)=>o.localeCompare(i)),r=Object.keys(t).sort((o,i)=>o.localeCompare(i));if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){let i=n[o];if(i!==r[o]||!V(e[i],t[i]))return!1}return!0}var Cc=[vc,Ec,kc,Oc,Sc];function V(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;for(let n of Cc){let r=n(e,t);if(r!==void 0)return r}return Ac(e,t)}function kg(e){return hc.createHash("sha256").update(e,"utf8").digest("hex")}function Og(e,t){let n={};for(let o of t){let i=e[o];i!==void 0&&(n[o]=i)}let r=Object.keys(e).filter(o=>!t.includes(o)).sort((o,i)=>o.localeCompare(i));for(let o of r){let i=e[o];i!==void 0&&(n[o]=i)}return n}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8b0d8654-211b-57bf-852f-8a153849e8fd")}catch{}})();var Tc=["policies","policy-put","policy-remove","policy-mode","policy-check","policy-approve","policy-presets"],Kr=256,pn=64;function $(e){throw new h(`Invalid workflow policy: ${e}`,y.USAGE,{code:"workflow_policy_invalid",nextSteps:["Inspect pm schema policies and correct the declaration using pm schema policy-put."]})}function G(e,t,n){if(typeof e!="object"||e===null||Array.isArray(e))return $(`${n} must be an object`);let r=e;return Object.keys(r).some(o=>!t.includes(o))?$(`${n} contains an unknown key`):r}function le(e,t,n=128){return typeof e!="string"||!e.trim()||e.length>n?$(`${t} must be nonempty text of at most ${n} characters`):e.trim()}function Be(e,t){if(!Array.isArray(e)||e.length===0||e.length>pn)return $(`${t} requires 1-${pn} terms`);let n=e.map(r=>le(r,t));return t==="fields"&&n.some(r=>!/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*){0,7}$/.test(r)||r.split(".").some(o=>["__proto__","constructor","prototype"].includes(o)))?$("fields must be safe metadata paths of at most eight segments"):[...new Set(n)]}function Ic(e){let t=G(e,["kind","fields","authors","allowed"],"rule");return t.kind==="transition"?(G(t,["kind","allowed"],"transition rule"),!Array.isArray(t.allowed)||t.allowed.length>pn?$("transition.allowed must be a bounded array"):{kind:"transition",allowed:t.allowed.map(n=>!Array.isArray(n)||n.length!==2?$("transition pairs need two statuses"):[le(n[0],"from"),le(n[1],"to")])}):t.kind==="authors"?(G(t,["kind","authors"],"authors rule"),{kind:"authors",authors:Be(t.authors,"authors")}):t.kind==="require_fields"?(G(t,["kind","fields"],"require_fields rule"),{kind:"require_fields",fields:Be(t.fields,"fields")}):t.kind==="field_writers"||t.kind==="approval"?(G(t,["kind","fields","authors"],"field rule"),{kind:t.kind,fields:Be(t.fields,"fields"),authors:Be(t.authors,"authors")}):$("unknown rule kind")}function Rc(e){let t={},n=G(e,["types","tags","statuses","operations","parents","dependency"],"subject");for(let r of["types","tags","statuses","operations","parents"])n[r]!==void 0&&(t[r]=Be(n[r],r));if(n.dependency!==void 0){let r=G(n.dependency,["kind","id"],"dependency");t.dependency={kind:le(r.kind,"dependency kind"),...r.id===void 0?{}:{id:le(r.id,"dependency id")}}}return t}function xc(e){let t=G(e,["id","description","subject","effect","rule"],"policy"),n=le(t.id,"id");return/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(n)?t.effect!==void 0&&(typeof t.effect!="string"||!["advise","warn","refuse"].includes(t.effect))?$("effect must be advise, warn, or refuse"):{id:n,rule:Ic(t.rule),...t.subject===void 0?{}:{subject:Rc(t.subject)},...t.description===void 0?{}:{description:le(t.description,"description",500)},...t.effect===void 0?{}:{effect:t.effect}}:$("id must be a stable token")}function Nc(e){let t=G(e,["version","enforcement","policies"],"document");if(t.version!==1)return $("unsupported version");if(t.enforcement!==void 0&&t.enforcement!=="advise"&&t.enforcement!=="refuse")return $("enforcement must be advise or refuse");if(!Array.isArray(t.policies)||t.policies.length>Kr)return $(`policies must contain at most ${Kr} declarations`);let n=t.policies.map(xc);return new Set(n.map(r=>r.id)).size!==n.length?$("duplicate policy id"):{version:1,enforcement:t.enforcement??"advise",policies:n}}function St(e,t){let n=e;for(let r of t.split(".")){if(typeof n!="object"||n===null||!Object.hasOwn(n,r))return;n=n[r]}return n}function Dc(e){return e==null?!1:typeof e=="string"?e.trim().length>0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.length>0:typeof e=="object"?Object.keys(e).length>0:!0}function Yr(e){return Hr("sha256").update(de(e)).digest("hex")}function Pc(e,t){let n=e.rule.kind==="approval"?e.rule.fields:[];return Hr("sha256").update(de({id:t.id,fields:n.map(r=>[r,St(t,r)])})).digest("hex")}function Mc(e,t){return Array.isArray(t)&&t.some(n=>typeof n=="object"&&n!==null&&"kind"in n&&n.kind===e.kind&&(e.id===void 0||"id"in n&&n.id===e.id))}function $c(e,t,n){return!(e.types&&!e.types.some(r=>r.toLowerCase()===String(t.type).toLowerCase())||e.statuses&&!e.statuses.includes(String(t.status))||e.operations&&!e.operations.includes(n)||e.parents&&!e.parents.includes(String(t.parent))||e.tags&&(!Array.isArray(t.tags)||!e.tags.some(r=>t.tags.includes(r)))||e.dependency&&!Mc(e.dependency,t.dependencies))}function Lc(e,t){if(t.completeness_only&&(e.rule.kind!=="require_fields"||e.subject?.operations!==void 0)||e.rule.kind==="approval"&&t.before===null)return!1;let n=e.subject??{},r=t.after?.status??t.before?.status;return[t.before,t.after].some(o=>o!==null&&$c(n,{...o,status:r},t.operation))}function jc(e,t,n,r){let o=["type","tags","parent","dependencies"].some(s=>!V(t.before?.[s],t.after?.[s]));return t.after&&(t.completeness_only||n||r||o)?e.filter(s=>!Dc(St(t.after,s))):[]}function Fc(e,t,n,r){let o=t.after??t.before,i=Pc(e,o);return t.approvals?.some(s=>s.policy_fingerprint===r&&s.content_fingerprint===i&&s.author!==t.author&&n.includes(s.author))??!1}function Uc(e,t,n){let r=e.rule,o=t.before?.status!==t.after?.status,i="fields"in r&&r.fields.some(s=>!V(St(t.before,s),St(t.after,s)));switch(r.kind){case"require_fields":{let s=jc(r.fields,t,o,i);return{satisfied:s.length===0,missing_fields:s,remediation:"Supply the declared required fields before this lifecycle transition."}}case"transition":return{satisfied:!o||r.allowed.some(([s,a])=>s===String(t.before?.status??"$create")&&a===String(t.after?.status??"$delete")),missing_fields:[],remediation:"Choose a declared allowed transition; inspect pm schema policies."};case"authors":return{satisfied:r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared workflow actor perform this operation."};case"field_writers":return{satisfied:!i||r.authors.includes(t.author),missing_fields:[],remediation:"Have a declared field writer change the protected fields."};case"approval":return{satisfied:!o||Fc(e,t,r.authors,n),missing_fields:[],remediation:`Record an independent approval with pm schema policy-approve <item-id> --policy ${e.id} after preparing the reviewed fields.`}}}function Xr(e,t,n){let r=e.policies.filter(o=>Lc(o,t)).map(o=>{let i=o.effect??"advise",s=n(o);return{policy_id:o.id,policy_fingerprint:s,rule:o.rule.kind,effect:i==="refuse"&&e.enforcement!=="refuse"?"warn":i,...Uc(o,t,s)}});return{allowed:!r.some(o=>!o.satisfied&&o.effect==="refuse"),decisions:r,warnings:r.filter(o=>!o.satisfied).map(o=>`workflow_policy:${o.effect}:${o.policy_id}:${o.rule}`)}}function Rg(e,t){return Xr(e,t,Yr)}function xg(e){let t=Nc(e),n=new Map(t.policies.map(r=>[r,Yr(r)]));return r=>Xr(t,r,o=>n.get(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]="1dd71b26-fc38-5304-9156-f32b57cc1cc0")}catch{}})();var zc=[...B],qc=[...Oe],Bc=[...ft],$g=[...mt],Lg=[...pt],Vc=[..._t],At=["init","config","extension","package","packages","install","upgrade","create","item","copy","focus","list","list-all","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","aggregate","context","ctx","get","graph","search","duplicates","eval","next","history","events","history-redact","history-repair","history-compact","history-attest","history-author-acknowledge","merge","schema","profile","activity","restore","update","update-many","close","close-many","delete","append","comments","notes","learnings","files","docs","deps","plan","test","test-all","telemetry","stats","health","validate","assurance","gc","workspace","contracts","claim","release","start-task","pause-task","close-task","meet","event","remind","help"],jg=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],Fg=["install","reconcile","report","driver"],Wc=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],Gc=["upgrade"],Kc=["reopen"],Jr={help:"Commander help rendering has no SDK operation result.",packages:"The plural package alias only renders package-oriented help."},Ct=Object.freeze(At.flatMap(e=>e in Jr?[]:e==="extension"||e==="package"?[...Wc.map(t=>`${e}-${t}`),...e==="package"?Gc.map(t=>`package-${t}`):[],e]:e==="item"?Kc.map(t=>`item-${t}`):[e])),Hc=Object.freeze(kt.filter(e=>e.lifecycle==="deprecated"&&e.registration==="commander"&&Ct.includes(e.alias)).map(e=>e.alias)),Ug=Object.freeze(Ct.filter(e=>!Hc.includes(e)));function zg(e=At,t=Ct,n=Jr){let r=new Set(t),o=new Set(e);return{missing_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]===void 0),waived_cli_actions:e.filter(i=>!r.has(i)&&!t.some(s=>s.startsWith(`${i}-`))&&n[i]!==void 0),stale_waivers:Object.keys(n).filter(i=>!o.has(i)||r.has(i)||t.some(s=>s.startsWith(`${i}-`)))}}function qg(e){return Ct.includes(e)}function Bg(e){return zc.includes(e)}function Vg(e){return qc.includes(e)}function Wg(e){return Bc.includes(e)}function Gg(e){return Vc.includes(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]="de2a2a0e-8a39-5569-9af9-cbf557bce2a9")}catch{}})();function Tt(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return null;let r=t.length+1,o=new Array(r),i=new Array(r),s=new Array(r);for(let c=0;c<r;c+=1)o[c]=0,i[c]=c;for(let c=1;c<=e.length;c+=1){s[0]=c;let d=s[0];for(let l=1;l<=t.length;l+=1){let u=e[c-1]===t[l-1]?0:1,f=i[l-1]+u,m=s[l-1]+1,p=i[l]+1,_=Math.min(f,m,p);c>1&&l>1&&e[c-1]===t[l-2]&&e[c-2]===t[l-1]&&(_=Math.min(_,o[l-2]+1)),s[l]=_,_<d&&(d=_)}if(d>n)return null;for(let l=0;l<r;l+=1)o[l]=i[l],i[l]=s[l]}let a=i[t.length];return a<=n?a:null}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1ddb0411-5fdd-56af-a524-0f6830c288a5")}catch{}})();function Ve(e){return[...new Set(e.map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function J(e){return B.includes(e)}function Qr(e){let t=e.trim().toLowerCase();return J(t)?t:null}function Zr(e){return e.filter(t=>!J(t))}function _n(e){let t=e.trim().toLowerCase();return t.length===0?null:sn[t]??null}function eo(e){let t=Ve([...e].map(i=>i.toLowerCase())),n=[],r=[];for(let i of t){let s=_n(i);if(s){n.push(s),r.push({alias:i,target:s});continue}n.push(i)}let o=[...new Map(r.map(i=>[`${i.alias}>${i.target}`,i])).values()].sort((i,s)=>i.alias.localeCompare(s.alias));return{capabilities:Ve(n),legacy_aliases:o}}function Yc(e){let t=e.trim().toLowerCase();if(t.length===0)return null;let n=_n(t);if(n)return n;let r=Math.max(1,Math.floor(t.length*.34)),o=null,i=Number.POSITIVE_INFINITY;for(let s of B){let a=Tt(t,s,r);a!==null&&a<i&&(i=a,o=s)}return o}function to(e,t,n){let r=B.join(","),o=Yc(n)??"none";return`extension_capability_unknown:${e}:${t}:${n}:allowed=${r}:suggested=${o}`}function no(e,t,n){let r=n.map(o=>`${o.alias}>${o.target}`).join(",");return`extension_capability_legacy_alias:${e}:${t}:aliases=${r}`}function Xc(e){let t=/^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(e.trim());if(!t)return null;let[,n,r,o,i,s]=t,a=n,c=i.split(",").map(m=>m.trim()).filter(m=>m.length>0),d=_n(o),u=(s==="none"?void 0:s)??d??void 0;return{layer:a,name:r,capability:o,allowed_capabilities:c,capability_contract_version:ut,suggested_capability:u,suggestion_source:u?d===u?"legacy_alias":"nearest_match":void 0,legacy_alias_target:d??void 0}}function Jc(e){let t=/^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(e.trim());if(!t)return[];let[,n,r,o]=t,i=n,s=[...B],a=[];for(let c of o.split(",")){let[d,l]=c.split(">"),u=d?.trim(),f=l?.trim().toLowerCase();!u||!f||!J(f)||a.push({layer:i,name:r,capability:u,allowed_capabilities:s,capability_contract_version:ut,suggested_capability:f,suggestion_source:"legacy_alias",legacy_alias_target:f})}return a}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="71c44385-0182-50f8-8e05-3aeebfe57ad9")}catch{}})();var Qc={commands:["registerCommand","command override","command handler"],renderers:["registerRenderer"],hooks:["hooks.beforeCommand","hooks.beforeMutation","hooks.afterCommand","hooks.onWrite","hooks.onRead","hooks.onIndex"],schema:["registerFlags","registerItemFields","registerItemTypes","registerRelationshipKinds","registerMigration","registerProfile"],importers:["registerImporter","registerExporter"],search:["registerSearchProvider","registerVectorStoreAdapter"],parser:["registerParser"],preflight:["registerPreflight"],services:["registerService","registerAssuranceMeasurementProvider"]},ro=":";function oo(e,t){return`${e}${ro}${gn(t)}`}function Zc(e){return e.slice(e.indexOf(ro)+1)}function gn(e){return e.trim().toLowerCase()}function ed(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let r=Qr(n);r!==null&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function io(e){let t=new Map,n=(l,u)=>{for(let f of l){let m=oo(f.layer,f.name),p=t.get(m);p===void 0&&(p=new Set,t.set(m,p)),p.add(u)}},{registrations:r,commands:o,parsers:i,preflight:s,services:a,renderers:c,hooks:d}=e;return n(r.commands,"commands"),n(o.overrides,"commands"),n(o.handlers,"commands"),n(r.flags,"schema"),n(r.item_fields,"schema"),n(r.item_types,"schema"),n(r.relationship_kinds??[],"schema"),n(r.migrations,"schema"),n(r.profiles,"schema"),n(r.importers,"importers"),n(r.exporters,"importers"),n(r.search_providers,"search"),n(r.vector_store_adapters,"search"),n(i.overrides,"parser"),n(s.overrides,"preflight"),n(a.overrides,"services"),n(r.assurance_providers??[],"services"),n(c.overrides,"renderers"),n(d.beforeCommand,"hooks"),n(d.beforeMutation,"hooks"),n(d.afterCommand,"hooks"),n(d.onWrite,"hooks"),n(d.onRead,"hooks"),n(d.onIndex,"hooks"),t}function td(e,t={}){let n=io(e),r=new Set;t.extensionName!==void 0&&r.add(gn(t.extensionName));for(let i of t.extensionNames??[])r.add(gn(i));let o=new Set;for(let[i,s]of n)if(!(r.size>0&&!r.has(Zc(i))))for(let a of s)o.add(a);return[...o].sort((i,s)=>i.localeCompare(s))}function nd(e,t){let n=io(t),r=[];for(let o of e){let i=ed(o.capabilities);if(i.length===0)continue;let s=n.get(oo(o.layer,o.name))??new Set,a=[...s].sort((d,l)=>d.localeCompare(l)),c=i.filter(d=>!s.has(d));r.push({layer:o.layer,name:o.name,declared:i,used:a,unused:c})}return r}import{createHash as rd}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]="15037266-75b7-5f8d-9565-e7848e720a49")}catch{}})();var yn=1,ao=4096,od=/^[A-Za-z0-9_-]+$/;function so(e){return e.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(t,n)=>n.toUpperCase())}function oy(e,t){let n=new Set;for(let r of t)if(r.cursor_semantics==="presentation"){n.add(so(r.flag));for(let o of r.aliases??[])n.add(so(o))}return Object.fromEntries(Object.entries(e).filter(([r])=>!n.has(r)))}function iy(e,t){return rd("sha256").update(e).update("\0").update(de(t)).digest("hex").slice(0,24)}function We(e,t,n,r){return Buffer.from(JSON.stringify({version:yn,fingerprint:e,after_id:t,...n===void 0?{}:{after_index:n},...r===void 0?{}:{snapshot:r}})).toString("base64url")}function ue(e){return new h(e,y.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function id(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version===yn&&typeof t.fingerprint=="string"&&typeof t.after_id=="string"&&t.after_id.length>0&&(t.after_index===void 0||Number.isSafeInteger(t.after_index)&&t.after_index>=0)&&(t.snapshot===void 0||typeof t.snapshot=="string"&&t.snapshot.length>0)}function hn(e){if(typeof e!="string")throw ue("Query cursor is malformed.");let t=e.trim();if(t.length===0||t.length>ao||!od.test(t))throw ue("Query cursor is malformed.");let n;try{n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw ue("Query cursor is malformed.")}if(!id(n))throw ue("Query cursor version or payload is unsupported.");return n}function bn(e,t){let n=hn(e);if(n.fingerprint!==t)throw ue(`Query cursor does not match the current filters, sort, or query (${n.fingerprint} != ${t}).`);return{after_id:n.after_id,...n.after_index===void 0?{}:{after_index:n.after_index},...n.snapshot===void 0?{}:{snapshot:n.snapshot}}}function sy(e,t){return bn(e,t).after_id}function sd(e,t,n,r){if(t===void 0)return 0;let o=bn(t,n),i=e.findIndex(s=>r(s)===o.after_id);if(i<0){if(o.after_index!==void 0)return Math.min(o.after_index,e.length);throw ue(`Query cursor item ${o.after_id} is no longer present in this result set.`)}return i+1}function ay(e,t){if(t.cursor!==void 0&&bn(t.cursor,t.fingerprint).snapshot!==t.snapshot)throw ue("Query cursor does not match the requested snapshot.");let n=sd(e,t.cursor,t.fingerprint,t.readId),r=e.slice(n,n+t.limit),o=r.length>0&&n+r.length<e.length,i=r.at(-1);return{rows:r,has_more:o,...o&&i!==void 0?{next_cursor:We(t.fingerprint,t.readId(i),n+r.length-1,t.snapshot)}:{}}}var cy=Object.freeze({version:yn,max_length:ao});import{stripVTControlCharacters as ad}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b4036040-c0b8-5d01-b490-3405722fd1c5")}catch{}})();var cd=["full","compact","brief","summary","counts"],my=["mutation","read","discovery","governance"],lo=["error","warning","validation_summary","recovery_bundle"],dd=["full","omit_explanation","limit_collections","compact_recovery","action_only"],ld=new Set(["append","claim","close","close-many","close-task","comments","config","copy","create","delete","docs","event","files","focus","history-author-acknowledge","history-compact","history-redact","history-repair","init","item","learnings","meet","notes","pause-task","release","remind","restore","schema","start-task","update","update-many"]),ud=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),fd=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),md={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},pd=3,_d=2,gd=192,yd={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},hd=lo.map(e=>({diagnostic_class:e,default_max_estimated_tokens_by_format:yd[e],minimum_max_estimated_tokens:gd,degradation_ladder:dd,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),bd=new Map(hd.map(e=>[e.diagnostic_class,e]));function wd(e){let[t=""]=qe(e).split(/\s+/u);return ld.has(t)?"mutation":ud.has(t)?"discovery":fd.has(t)?"governance":"read"}function uo(e,t=wd(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let r=md[t];return vd({command:n,budget_class:t,default_max_estimated_tokens:r,default_max_estimated_tokens_by_format:{toon:r,json:Math.ceil(r*pd/_d)},degradation_ladder:cd,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function vd(e){if(!Number.isSafeInteger(e.default_max_estimated_tokens)||e.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(let[t,n]of Object.entries(e.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${t} must be a positive safe integer`);return e}var Ed=At.map(e=>uo(e)),kd=new Map(Ed.map(e=>[e.command,e]));function fo(e,t={}){let n=e.trim().replace(/\s+/gu," "),[r]=qe(n).split(" "),o=kd.get(r);return o?{...o,command:n}:t.generateFallback?uo(n):null}function me(e){return Math.ceil(Math.max(0,e)/4)}function mo(e){let t=bd.get(e);if(t===void 0)throw new TypeError(`diagnosticClass must be one of: ${lo.join(", ")}`);return t}function Q(e){return me(Buffer.byteLength(JSON.stringify(e,null,2),"utf8"))}function Od(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wn(e){if(!Od(e))return;let t={};for(let n of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms"]){let r=e[n];Array.isArray(r)?t[n]=n==="suggested_retry_args"?r:r.slice(0,3):r!==void 0&&(t[n]=r)}return Object.keys(t).length>0?t:void 0}function Sd(e,t){return typeof e!="string"||e.length<=t?e:`${e.slice(0,Math.max(1,t-3))}...`}function fe(e,t){if(Buffer.byteLength(e,"utf8")<=t)return e;let n="...",r=Array.from(e),o=0,i=r.length;for(;o<i;){let s=Math.ceil((o+i)/2),a=`${r.slice(0,s).join("")}${n}`;Buffer.byteLength(a,"utf8")<=t?o=s:i=s-1}return`${r.slice(0,o).join("")}${n}`}function po(e){let t={};for(let n of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(e,n)&&e[n]!==void 0&&(t[n]=e[n]);for(let[n,r]of Object.entries(e))n!=="__proto__"&&!Object.hasOwn(t,n)&&(t[n]=r);return t}var Ad=new Set(["limit_collections","compact_recovery","action_only"]),Cd=new Set(["compact_recovery","action_only"]);function Td(e){let t={code:typeof e.code=="string"?e.code:"diagnostic",required:Sd(e.required,160)??"Inspect the diagnostic code and retry with corrected input."},n=wn(e.recovery);return n!==void 0?t.recovery=n:Array.isArray(e.next_steps)&&(t.next_steps=e.next_steps.slice(0,1)),e.exit_code!==void 0&&(t.exit_code=e.exit_code),e.type!==void 0&&(t.type=e.type),t}function Id(e,t){let n=structuredClone(e);if(t!=="full"&&(delete n.why,delete n.examples),Ad.has(t))for(let[r,o]of Object.entries(n))Array.isArray(o)&&(n[r]=o.slice(0,3));if(Cd.has(t)){let r=wn(n.recovery);r?n.recovery=r:delete n.recovery}return t!=="action_only"?po(n):Td(n)}function Se(e,t){let n={...e,diagnostic_output:{...t,estimated_tokens:0}};for(let r=0;r<4;r+=1){let o=Q(n),i=n.diagnostic_output;if(i.estimated_tokens===o)break;i.estimated_tokens=o}return n}function Rd(e,t,n){let r=Se(e,t);for(let i of["recovery","exit_code"])Q(r)<=n||e[i]===void 0||(delete e[i],r=Se(e,t));let o=40;for(;Q(r)>n&&o>4;)o-=4,e.code=fe(String(e.code),o),e.required=fe(String(e.required),o),r=Se(e,t);return r}function xd(e,t){let n=e.diagnostic_output,{estimated_tokens:r,...o}=n,i=o.omitted_fields.slice(0,8).map(u=>fe(u,32)),s={...o,omitted_fields:i,...o.omitted_fields.length>i.length?{omitted_fields_overflow_count:o.omitted_fields.length-i.length}:{}},a=wn(e.recovery),c=a&&Q(a)<=48?a:void 0,d={code:fe(String(e.code),320),required:fe(String(e.required),320),...c?{recovery:c}:{},...e.exit_code!==void 0?{exit_code:e.exit_code}:{}},l=Se(d,s);for(;Q(l)>t&&s.omitted_fields.length>0;)s.omitted_fields.pop(),s.omitted_fields_overflow_count=o.omitted_fields.length-s.omitted_fields.length,l=Se(d,s);return l=Rd(d,s,t),l}function py(e,t={}){let n=e,r=t.diagnosticClass??"error",o=mo(r),i=t.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<o.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${o.minimum_max_estimated_tokens}`);let s=i??o.default_max_estimated_tokens_by_format.json,a=Q(n),c=Object.keys(n);if(a<=s)return po(structuredClone(n));let d;for(let[l,u]of o.degradation_ladder.entries()){let f=Id(n,u),m=c.filter(_=>!Object.hasOwn(f,_)),p=Se(f,{diagnostic_class:r,format:"json",budget:s,budget_source:i===void 0?"default":"explicit",original_estimated_tokens:a,truncated:l>0,degradation_steps:o.degradation_ladder.slice(0,l+1),omitted_fields:m});if(d=p,Q(p)<=s)break}return Q(d)>s&&(d=xd(d,s)),d}function co(e){return ad(e).replace(/\r\n/gu,`
|
|
2
2
|
`).replace(/[^\P{Cc}\n]/gu," ")}function _y(e,t,n={}){let r=n.diagnosticClass??"error",o=mo(r),i=n.maxEstimatedTokens;if(i!==void 0&&(!Number.isSafeInteger(i)||i<o.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${o.minimum_max_estimated_tokens}`);let s=i??o.default_max_estimated_tokens_by_format.text,a=co(e),c=me(Buffer.byteLength(a,"utf8")),d=c>s,l=`What is required:
|
|
3
3
|
`,f=`
|
|
4
4
|
|
|
@@ -27,4 +27,4 @@ ${a.join(`
|
|
|
27
27
|
`}function nE(e){let t=es("error_format",{message:e}),n=t.handled&&typeof t.result=="string"?t.result:e;Ap(n.endsWith(`
|
|
28
28
|
`)?n:`${n}
|
|
29
29
|
`)}(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]="85bc6b10-700a-5d06-970f-d544833dd059")}catch{}})();var Rp=new Set(["applied_bound","completeness","budget_retention_policy","continuation_contract","continuation_kind","continuation_path","filters","omission_receipt","output_budget_truncation","projection","read_output","read_session","row_contract","sorting"]);function Me(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function aa(e,t){let n=e;for(let r of t.split("."))if(Array.isArray(n)){if(!/^\d+$/u.test(r))return;n=n[Number(r)]}else{if(!Me(n))return;n=n[r]}return n}function Er(e,t,n){let r=t.split("."),o=(i,s)=>{if(s===r.length)return n;let a=r[s];if(Array.isArray(i)){let d=Number(a),l=[...i];return l[d]=o(i[d],s+1),l}let c=i;return{...c,[a]:o(c[a],s+1)}};return o(e,0)}function ca(e,t,n){let r=$e(e).find(i=>i.path===t);if(!r)return e;let o=Array.isArray(r.value)?r.value.slice(n):Object.fromEntries(Object.entries(r.value).slice(n));return Er(e,t,o)}function Jt(e){let t=e.row_contract;return Me(t)&&Array.isArray(t.row_keys)?t.row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Object.entries(e).filter(([,n])=>Array.isArray(n)).map(([n])=>n)}function xp(e){let t=e.row_contract;return Me(t)&&Array.isArray(t.continuation_row_keys)?t.continuation_row_keys.filter(n=>typeof n=="string"&&n.trim().length>0):Jt(e)}function se(e){return Jt(e).flatMap(t=>{let n=aa(e,t);return Array.isArray(n)||Me(n)?[{path:t,value:n}]:[]})}function $e(e){return xp(e).flatMap(t=>{let n=aa(e,t);return Array.isArray(n)||Me(n)?[{path:t,value:n}]:[]})}function Qt(e){let t=se(e),n=new Set(t.map(o=>o.path)),r=(o,i)=>{if(Array.isArray(o)){n.has(i)||t.push({path:i,value:o}),o.forEach((s,a)=>r(s,`${i}.${a}`));return}if(Me(o))for(let[s,a]of Object.entries(o))i.length===0&&Rp.has(s)||r(a,i.length===0?s:`${i}.${s}`)};return r(e,""),t}function Zt(e){return se(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function ot(e,t){let n=e;for(let r of se(n)){let o=Array.isArray(r.value)?r.value.map((i,s)=>t(i,r.path,s)):Object.fromEntries(Object.entries(r.value).map(([i,s],a)=>[i,t(s,r.path,a)]));n=Er(n,r.path,o)}return n}function da(e,t){let n=e,r=!1;for(let o of se(n)){let i=Array.isArray(o.value)?o.value:Object.entries(o.value);if(i.length<=t)continue;r=!0;let s=Array.isArray(o.value)?i.slice(0,t):Object.fromEntries(i.slice(0,t));n=Er(n,o.path,s)}return{result:n,truncated:r}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="be0a8071-52f7-56a6-9830-a60e0d2cf29d")}catch{}})();var Np=8,Dp=64,Pp=5,Mp=4,la=100;function ua(e,t,n){if(e!=="get"||!kr(n.item)||["fields","outputInclude","output_include","outputCursor","output_cursor"].some(d=>t[d]!==void 0)||t.full===!0||t.tree===!0||t.depth!==void 0&&t.depth!=="standard")return;let r=n.item,o=["linked","claim_state","schedule"],i=o.filter(d=>Object.hasOwn(n,d)),s=Object.fromEntries(Object.entries(n).filter(([d])=>!o.includes(d)));s.item=Object.fromEntries(Object.entries(r).filter(([d])=>d!=="body")),Object.hasOwn(r,"body")&&i.push("body");let c=[...kr(n.omission_receipt)&&Array.isArray(n.omission_receipt.omitted_field_groups)?n.omission_receipt.omitted_field_groups:[],...i.map(d=>({name:d,restore_with:`--fields ${d}`}))];return s.omission_receipt={has_omissions:c.length>0,omitted_field_group_count:c.length,omitted_field_groups:c},s}function Sr(e){let t=Math.trunc(e.effective_budget_tokens),n=Math.trunc(e.measured_result_tokens);if(!Number.isSafeInteger(t)||t<=0||!Number.isSafeInteger(n)||n<=0)return{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"};let r=Math.max(t+1,n),o=Math.ceil(r*Pp/Mp),i=Math.ceil(o/la)*la;return Number.isSafeInteger(i)?{output_budget:i,recovery_budget_multiplier:i/t,rule_version:"v1"}:{output_budget:"unbounded",recovery_budget_multiplier:null,rule_version:"v1"}}function Le(e,t,n=!1){let r=Object.getOwnPropertyDescriptor(e,"row_contract");r&&(n||r.enumerable===!1)&&Object.defineProperty(t,"row_contract",{...r,enumerable:!1})}function it(e,t){let n=t===void 0?JSON.stringify(e):sa(e,t);return Math.ceil(Buffer.byteLength(n,"utf8")/4)}function kr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Or(e,t){return typeof e=="string"?e.length<=240?e:(t.compacted=!0,`${e.slice(0,240)}\u2026`):Array.isArray(e)?e.map(n=>Or(n,t)):kr(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Or(r,t)])):e}function ae(e,t,n){let r=t.estimated_tokens;for(let o=0;o<Np;o+=1){t.estimated_tokens=r;let i=it(e,n);if(i===r)return;r=i}t.estimated_tokens=r}function $p(e,t){return Qt(e).filter(n=>(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length)>Math.max(1,t.get(n.path)??0)).map(n=>({collection:n,length:Array.isArray(n.value)?n.value.length:Object.keys(n.value).length})).sort((n,r)=>r.length-n.length||n.collection.path.localeCompare(r.collection.path))[0]?.collection}function Lp(e,t,n,r,o,i){for(let s=0;s<Dp;s+=1){if(i?.(e),ae(e,t,o),t.estimated_tokens<=n)return;let a=$p(e,r);if(!a)return;let c=Math.max(1,r.get(a.path)??0),d=Array.isArray(a.value)?[...a.value]:Object.entries(a.value),l=p=>{if(Array.isArray(a.value)){a.value.length=p;for(let _=0;_<p;_+=1)a.value[_]=d[_]}else{for(let _ of Object.keys(a.value))delete a.value[_];Object.defineProperties(a.value,Object.getOwnPropertyDescriptors(Object.fromEntries(d.slice(0,p))))}typeof e.count=="number"&&(e.count=Zt(e)),a.path==="items"&&(e.applied_limit=p),i?.(e),ae(e,t,o)};t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],a.path])].sort((p,_)=>p.localeCompare(_)),e.has_more=!0,e.truncated=!0;let u=c,f=d.length-1,m=c;for(;u<=f;){let p=Math.floor((u+f)/2);l(p),t.estimated_tokens<=n?(m=p,u=p+1):f=p-1}l(m)}}function fa(e,t,n,r=new Map,o,i){let s={compacted:!1},a=Or(e,s);return Le(e,a),t.strings_compacted=s.compacted,a.read_output=t,Lp(a,t,n,r,o,i),ae(a,t,o),a}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="999accf0-d4e1-5dc4-92a0-4ea7d745ac48")}catch{}})();var Ar=256,Cr=1e4,jp=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,ma=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,Fp=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),Up=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&jp.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=Ar,reason:`token_budget must be a safe integer of at least ${Ar}.`},{valid:e=>Number.isSafeInteger(e.spent_tokens)&&e.spent_tokens>=0&&e.spent_tokens<=e.token_budget,reason:"spent_tokens must be a non-negative safe integer no larger than token_budget."},{valid:e=>Array.isArray(e.seen_item_ids)&&e.seen_item_ids.length<=Cr&&e.seen_item_ids.every(t=>typeof t=="string"&&ma.test(t)),reason:`seen_item_ids must contain at most ${Cr} portable item identifiers.`}];function tn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function en(e){throw new h(`--output-session ${e}`,y.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function nn(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{en("must be a valid JSON object.")}tn(t)||en("must be a JSON object.");let n=Object.keys(t).filter(i=>!Fp.has(i));n.length>0&&en(`contains unknown field "${n.sort()[0]}".`);let r=Up.find(i=>!i.valid(t));r!==void 0&&en(r.reason);let o=[...new Set(t.seen_item_ids)].sort();return{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:o}}function pa(e){if(tn(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:tn(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function zp(e){let t=new Set,n=0,r=se(e),o=new Set(r.map(({path:s})=>s)),i=Object.entries(e).flatMap(([s,a])=>Array.isArray(a)&&!o.has(s)?[{path:s,value:a}]:[]);for(let s of[...r,...i]){let a=Array.isArray(s.value)?s.value:Object.values(s.value);for(let c of a){if(!tn(c))continue;if(typeof c.context_ref=="string"){n+=1;continue}let d=pa(c);d!==void 0&&ma.test(d)&&t.add(d)}}return{deliveredIds:t,suppressedRepeatCount:n}}function _a(e,t){let n=new Set(t.seen_item_ids);return ot(e,r=>{let o=pa(r);return o!==void 0&&n.has(o)?{id:o,context_ref:`session:${t.id}:${o}`}:r})}function Tr(e,t,n){let{deliveredIds:r,suppressedRepeatCount:o}=zp(e),i=new Set(t.seen_item_ids),s=[...r].filter(_=>!i.has(_)).sort(),a=s.slice(0,Cr-t.seen_item_ids.length),c=[...t.seen_item_ids,...a].sort(),d=s.length-a.length,l={contract_version:1,id:t.id,measurement_scope:"complete_read_envelope",estimator:"ceil(utf8_bytes / 4)",token_budget:t.token_budget,spent_before_tokens:t.spent_tokens,spent_this_call_tokens:0,charged_this_call_tokens:0,spent_total_tokens:t.spent_tokens,remaining_tokens:t.token_budget-t.spent_tokens,exhausted:!1,seen_before_count:t.seen_item_ids.length,new_item_count:r.size,...d===0?{}:{seen_item_overflow_count:d},suppressed_repeat_count:o,reference_format:"session:<session-id>:<item-id>",restore_reference_with:"pm get <item-id> --brief",next_state:{version:1,id:t.id,token_budget:t.token_budget,spent_tokens:t.spent_tokens,seen_item_ids:c}},u={...e,read_session:l},f=_=>{l.spent_this_call_tokens=_,l.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,_),l.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+l.charged_this_call_tokens),l.remaining_tokens=Math.max(0,t.token_budget-l.spent_total_tokens),l.exhausted=l.remaining_tokens<Ar,l.next_state.spent_tokens=l.spent_total_tokens},m=0,p=0;for(let _=0;_<8;_+=1){f(m);let g=it(u,n);if(g===m)return u;p=Math.max(p,g),m=g}return f(p),u}function ga(e){return Math.max(0,e.token_budget-e.spent_tokens)}(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]="8a044fa0-4028-5527-b6ff-43ec995e8830")}catch{}})();var ke=["include","amount","cost","encoding"],Sa=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","files","docs","stats","aggregate","duplicates","package-catalog","package-manage","comments-audit","assurance"],Aa=["canonical","legacy","intent","default"],at={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},Ir=Symbol.for("pm.readOutputInvocationProvenance"),OE=Object.freeze(ke.map(e=>at[e])),SE=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),Ca={list:{include:["--brief","--compact","--fields","--full"],amount:["--after","--limit","--no-truncate"],cost:["--token-budget"],encoding:["--format","--stream"]},context:{include:["--fields","--section"],amount:["--after","--depth","--limit"],cost:["--token-budget"],encoding:["--format"]},search:{include:["--compact","--fields","--full"],amount:["--after","--limit"],cost:["--token-budget"],encoding:["--format"]},get:{include:["--fields","--full"],amount:["--depth"],cost:["--token-budget"],encoding:["--format"]},next:{amount:["--blocked-limit","--limit"],cost:["--token-budget"],encoding:["--format"]},health:{include:["--brief","--check-only","--full","--summary"]},deps:{include:["--collapse","--full","--summary"],amount:["--edge-limit","--max-depth","--node-limit"],cost:["--token-budget"],encoding:["--format"]},graph:{include:["--full","--summary"],amount:["--after","--limit","--max-depth","--max-paths"]},history:{include:["--compact","--full"],amount:["--limit"],encoding:["--format"]},activity:{include:["--compact","--full"],amount:["--limit","--unbounded"],encoding:["--stream"]},validate:{include:["--counts","--full"]},events:{include:["--full"],amount:["--limit"],encoding:["--follow"]},contracts:{include:["--full","--summary"]},comments:{amount:["--limit"]},notes:{amount:["--limit"]},files:{amount:["--limit","--no-truncate","--offset"]},docs:{},stats:{},aggregate:{},duplicates:{amount:["--limit"]},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},Ta=new Set(["--collapse","--fields","--section"]),Nr=Object.freeze({"--after":"--after retains cursor-position semantics; use --output-limit <n> separately to bound returned rows.","--check-only":"--check-only retains health side-effect semantics; --output-include does not suppress vector refresh.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--depth":"--depth retains traversal or detail-depth semantics; --output-limit does not replace it.","--follow":"--follow retains event-tail semantics; --output-format does not enable following.","--max-depth":"--max-depth retains graph traversal-depth semantics; --output-limit does not replace it.","--max-paths":"--max-paths retains graph path-search semantics; use --output-limit separately to bound returned rows.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded.","--offset":"--offset retains positional pagination semantics; use --output-limit separately to bound returned rows.","--stream":"--stream retains command streaming semantics; --output-format selects only static result encoding.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function Dr(e){return e.slice(2).replaceAll("-","_")}function qp(e,t){let n=Nr[e];if(n!==void 0)return n;let r=t==="include"?Ta.has(e)?"<csv>":Dr(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${at[t]} ${r}.`}function Bp(e){let t=Ca[e],n=Object.freeze(Object.fromEntries(ke.map(r=>[r,Object.freeze({dimension:r,canonical_option:at[r],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[r]??[]).map(o=>Object.freeze({flag:o,semantics:Nr[o]===void 0?"replacement":"behavior_preserving",migration_hint:qp(o,r),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:Aa,budget_retention_policy:e==="assurance"?"verdict_priority":"ordered_prefix",projection_modes:Object.freeze([...Pr(e).keys()])})}var Vp=Object.freeze(Sa.map(Bp)),Wp=new Map(Vp.map(e=>[e.command,e]));function Fe(e,t={}){let n=qe(e.trim().toLowerCase()),o=n==="package catalog"||n==="packages catalog"||n==="package-catalog"||(n==="package"||n==="packages"||n==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":n==="package manage"||n==="package-manage"?"package-manage":n.split(" ")[0],i=o.startsWith("list-")?"list":o==="ctx"?"context":o;return Sa.includes(i)?i:void 0}var Gp=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],Kp={comments:["add","body","stdin","file","edit","delete"],notes:["add","addJson","stdin","file","edit","delete"],files:["add","addGlob","remove","migrate","apply","note"],docs:["add","addGlob","remove","migrate","note"],"package-catalog":["activate","adopt","adoptAll","deactivate","doctor","init","install","manage","migrate","reload","scaffold","uninstall"]};function Hp(e){return Gp.some(t=>t!=="outputFormat"&&t!=="output_format"&&e[t]!==void 0)}var Yp=[{keys:["outputInclude","output_include"],valid:e=>st(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||je(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||je(e)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputSession","output_session"],valid:e=>(nn(e),!0),message:"--output-session must be a valid session-state object."},{keys:["outputCursor","output_cursor"],valid:e=>typeof e=="string"&&e.trim().length>0,message:"--output-cursor requires a non-empty continuation cursor."}];function AE(e,t){let n=t.outputFormat??t.output_format;if(n!==void 0&&n!=="json"&&n!=="toon")throw new h("--output-format must be toon or json.",y.USAGE);if(!Hp(t))return;let r=Fe(e,t);if(!r)throw new h(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,y.USAGE);if((Kp[r]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new h(`Universal output controls cannot be combined with a ${r} mutation.`,y.USAGE);for(let o of Yp){let i=o.keys.map(s=>t[s]).find(s=>s!==void 0);if(i!==void 0&&!o.valid(i))throw new h(o.message,y.USAGE)}}function Pr(e){let t=Fe(e);return t?new Map((Ca[t].include??[]).filter(n=>!Ta.has(n)&&Nr[n]===void 0).map(n=>[Dr(n),Ia(n)])):new Map}function Xp(e,t,n){let r=st(t)??[],o=Pr(e),i=[],s=[],a=n,c=a[Ir],d=new Set(c?.canonical_include_modes??[]),l=new Set(c?.explicit_legacy_aliases??[]);for(let m of r){let p=o.get(m);if(p===void 0){i.push(m);continue}let _=`--${m.replaceAll("_","-")}`;xa(Ra(n,_))&&l.add(_),n[p]=!0,s.push(m),d.add(m)}let u=Fe(e)==="get"?i.filter(m=>m!=="item"):[],f=u.length>0;return f&&(n.fields=[...new Set([...st(n.fields)??[],...u])].join(","),d.add("fields")),(s.length>0||f)&&(a[Ir]={canonical_include_modes:[...d],explicit_legacy_aliases:[...l],...c?.cli_invocation_observed===!0?{cli_invocation_observed:!0}:{}}),{selectors:i,modes:s}}function CE(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:r,modes:o}=Xp(e,n,t);if(o.length===0)return;let i=r.length>0?r.join(","):void 0;t.outputInclude=i,Object.hasOwn(t,"output_include")&&(t.output_include=i)}function Ia(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function Ra(e,t){let n=Ia(t);if(Object.hasOwn(e,n))return e[n];let r=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,r))return e[r];if(t==="--no-truncate"&&e.truncate===!1)return!0}function xa(e){return e!==void 0&&e!==!1&&e!==null}function st(e){let n=(Array.isArray(e)?e:[e]).flatMap(r=>typeof r=="string"?r.split(","):[]).map(r=>r.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function je(e){let t=typeof e=="number"?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e):Number.NaN;return Number.isSafeInteger(t)&&t>0?t:void 0}function Jp(e,t,n,r){for(let o of e.legacy_aliases){if(r(o.flag))continue;let i=Ra(t,o.flag),s={value:i,flag:o.flag};if(xa(i)&&n(s))return s}}function ya(e,t){let n=st(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:st(t.value)??[Dr(t.flag)]}}function ha(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=je(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;if(t.flag==="--no-truncate"||t.flag==="--unbounded")return{source:"legacy",value:"unbounded"};let r=je(t.value);return r===void 0?void 0:{source:"legacy",value:r}}function ba(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=je(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let r=je(t.value);return r===void 0?void 0:{source:"legacy",value:r}}function wa(e,t){if(e==="json"||e==="toon")return{source:"canonical",value:e};if(t)return t.flag==="--stream"||t.flag==="--follow"?{source:"legacy",value:"stream"}:t.value==="json"||t.value==="toon"?{source:"legacy",value:t.value}:void 0}function Qp(e,t,n){if(!e)return!1;let r=new Set(e.explicit_legacy_aliases);if(e.cli_invocation_observed===!0)return!r.has(n);let o=new Set(e.canonical_include_modes.map(i=>`--${i.replaceAll("_","-")}`));return t==="include"&&o.has(n)&&!r.has(n)}function Zp(e,t,n){return e.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||t.amount?.flag==="--no-truncate"||t.include?.flag==="--full"||n?.canonical_include_modes.includes("full")===!0}function e_(e,t){return ke.flatMap(n=>e[n]?.source==="canonical"||n==="include"&&(t?.canonical_include_modes.length??0)>0?[at[n]]:[])}function Na(e,t){let n=Fe(e,t);if(!n)return;let r=Wp.get(n),o=t[Ir],i={include:v=>ya(void 0,v),amount:v=>ha(void 0,v),cost:v=>ba(void 0,v),encoding:v=>wa(void 0,v)},s=Object.fromEntries(ke.map(v=>[v,Jp(r.dimensions[v],t,R=>i[v](R)!==void 0,R=>Qp(o,v,R))])),a=ke.flatMap(v=>{let R=s[v];return R?[R.flag]:[]}),c=ke.flatMap(v=>{let R=s[v];return R?[r.dimensions[v].legacy_aliases.find(lt=>lt.flag===R.flag).migration_hint]:[]}),d=wa(t.outputFormat??t.output_format,s.encoding),l=ya(t.outputInclude??t.output_include,s.include),u=ha(t.outputLimit??t.output_limit,s.amount),f=ba(t.outputBudget??t.output_budget,s.cost),m=Zp(e,s,o),p=fo(e,{generateFallback:!0}),_=d?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon",g=f??(m?{source:"intent",value:"unbounded"}:{source:"default",value:p.default_max_estimated_tokens_by_format[_]});return{command:n,include:l,amount:u,cost:g,encoding:d,canonical_options_used:e_({include:l,amount:u,cost:g,encoding:d},o),legacy_aliases_used:a,migration_hints:c,precedence:Aa}}function q(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Mr=new Set(["applied_bound","applied_limit","completeness","continuation_kind","continuation_path","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","budget_retention_policy","row_contract","sorting","total","truncated"]),t_=["collection_counts","notes_count","tests_count"];function Da(e,t){let n=new Set(t.map(r=>r.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([r])=>n.has(r)))}function n_(e){let t=q(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...t_.filter(o=>Object.hasOwn(t,o))])].sort((o,i)=>o.localeCompare(i)),r=Object.keys(e).filter(o=>o!=="item"&&o!=="read_output"&&!Mr.has(o)).sort((o,i)=>o.localeCompare(i));return{item:t,itemFields:n,sections:r,valid:[...n,"item",...n.map(o=>`item.${o}`),...r]}}function r_(e,t){let n=n_(e),r=t.filter(u=>!n.valid.includes(u));if(r.length>0)throw new h(`Unknown --output-include selector(s) for get: ${r.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,y.USAGE);let o=t.includes("item"),i=t.flatMap(u=>u.startsWith("item.")?[u.slice(5)]:n.itemFields.includes(u)?[u]:[]).filter((u,f,m)=>m.indexOf(u)===f);if(o&&i.length>0)throw new h("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",y.USAGE);let s=new Set(t.filter(u=>n.sections.includes(u))),a=Object.fromEntries(Object.entries(e).filter(([u])=>Mr.has(u)||s.has(u)));o?a.item=n.item:i.length>0&&(a.item=Da(n.item,i));let c=[...o?[]:i.length>0?n.itemFields.filter(u=>!i.includes(u)).map(u=>({name:`item.${u}`,restore_with:`--output-include item.${u}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(u=>!s.has(u)).map(u=>({name:u,restore_with:`--output-include ${u}`}))],l=[...q(a.omission_receipt)&&Array.isArray(a.omission_receipt.omitted_field_groups)?a.omission_receipt.omitted_field_groups:[],...c];return a.omission_receipt={has_omissions:l.length>0,omitted_field_group_count:l.length,omitted_field_groups:l},a}function va(e){let t=0;return ot({...e},n=>(q(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function o_(e,t,n,r){if(va(t)===0||va(n)>0)return;let o=[...Pr(e).keys()],i=o.length>0?` Declared ${e} projection modes: ${o.join(", ")}.`:` The ${e} surface declares no projection modes; name row fields instead.`;throw new h(`Unknown --output-include selector(s) for ${e}: ${r.join(", ")}. No selector matched any returned row field.${i}`,y.USAGE)}function i_(e,t,n){if(e==="get")return r_(t,n);let r=Jt(t),o=n.flatMap(s=>r.flatMap(a=>s.startsWith(`${a}.`)?[s.slice(a.length+1)]:[])),i=n.some(s=>Object.hasOwn(t,s.split(".")[0])&&!r.some(a=>s.startsWith(`${a}.`)));if(r.length>0&&(!i||o.length>0)){let s={...t},a=o.length>0?o:n,c=ot(s,d=>q(d)?Da(d,a):d);return o_(e,t,c,a),c}return Object.fromEntries(Object.entries(t).filter(([s])=>n.some(a=>a.split(".")[0]===s)||Mr.has(s)))}function s_(e,t){if(t==="unbounded")return e;let{result:n,truncated:r}=da(e,t);return r&&(n.has_more=!0,n.truncated=!0,typeof n.count=="number"&&(n.count=Zt(n)),n.applied_bound={kind:"output_limit",source:"explicit",value:t}),n}function a_(e){return ke.filter(t=>e[t]!==void 0&&e[t]?.source!=="default"||e.canonical_options_used.includes(at[t]))}function Pa(e){let t=e.resolvedOutputFormat??e.outputFormat??e.output_format??e.format;return t==="json"||t==="toon"?t:void 0}function on(e,t,n,r){let o=Tr(e,t,r);Le(e,o);for(let i=0;i<8;i+=1){let s=n.estimated_tokens,a=o.read_session.spent_this_call_tokens;ae(o,n,r);let c=o;o=Tr(o,t,r),Le(c,o);let d=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===s&&d===a)return o}return o}function pr(e,t){if(!q(e.read_output))return e;let n=Pa(t),r=e.read_output,o=nn(t.outputSession??t.output_session);return o===void 0?(ae(e,r,n),e):on(e,o,r,n)}function c_(e,t){if(e!=="validate")return t;let n=q(t.projection)?t.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(u=>q(u)&&u.name==="diagnostic_rows"))return t;let o=[...new Set(Qt(t).map(({path:u})=>u).filter(u=>/^checks\.\d+\.details\./u.test(u)))],i=o.filter(u=>!o.some(f=>f!==u&&u.startsWith(`${f}.`)));if(i.length===0)return t;let s=q(t.row_contract)?t.row_contract:{},a=Array.isArray(s.row_keys)?s.row_keys.filter(u=>typeof u=="string"):[],c=Array.isArray(s.continuation_row_keys)?s.continuation_row_keys.filter(u=>typeof u=="string"):[],d=a.length>0?a:i,l=[...new Set(i)];return JSON.stringify(d)===JSON.stringify(a)&&JSON.stringify(l)===JSON.stringify(c)?t:{...t,row_contract:{...s,row_keys:d,continuation_row_keys:l,jq_selector:typeof s.jq_selector=="string"?s.jq_selector:".checks[].details"}}}function d_(e,t,n,r){let o={...e};return t.include?.source==="canonical"&&(o=i_(t.command,o,t.include.value)),t.command==="assurance"&&(o=ka(o)),o=Oa(o,t.command,r),t.amount?.source==="canonical"&&(o=s_(o,t.amount.value)),n===void 0?o:_a(o,n)}function l_(e,t){return[...e.cost!==void 0&&e.cost.value!=="unbounded"&&(e.cost.source==="canonical"||e.cost.source==="default")?[{source:e.cost.source,tokens:e.cost.value}]:[],...t===void 0?[]:[{source:"session",tokens:ga(t)}]].sort((r,o)=>r.tokens-o.tokens)[0]}function Ma(e){let t=e.canonical_options_used;return t&&t.length>0?{canonical_options_used:t}:{}}function u_(e,t,n,r,o,i){let s={contract_version:1,command:e.command,requested_dimensions:t,...r.source==="default"?{budget_source:r.source,budget_tokens:r.tokens}:{},precedence:e.precedence,...Ma(e),legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0,...n===void 0?{omitted_result_estimated_tokens:o}:{}},a={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:s},c=n===void 0?a:on(a,n,s,i);if(n===void 0&&ae(c,s,i),n!==void 0&&s.estimated_tokens>r.tokens)throw new h("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",y.USAGE);return c}function f_(e,t){return t.outputRowContract===!0||t.output_row_contract===!0||e.canonical_options_used.includes("--output-include")||e.command==="list"&&e.canonical_options_used.length>0&&e.include?.value.includes("full")===!0}function m_(e,t,n,r,o){if(t!==void 0||f_(e,o))return!1;if(e.amount?.source==="canonical"&&e.amount.value!=="unbounded"){let i=e.amount.value;if(se(n).some(({value:s})=>(Array.isArray(s)?s.length:Object.keys(s).length)>i))return!1}return e.cost===void 0||e.cost.value==="unbounded"||e.cost.source==="legacy"||it(o.outputRowContract===!1?Object.fromEntries(Object.entries(n).filter(([i])=>i!=="row_contract")):n,r)<=e.cost.value}function p_(e,t,n,r,o,i,s){if(!n.rows_compacted)return;let a=t.amount?.value==="unbounded"?["amount"]:[],c=new Map($e(e).map(p=>[p.path,Array.isArray(p.value)?p.value.length:Object.keys(p.value).length])),d=[...s.entries()].flatMap(([p,_])=>{let g=c.get(p);if(g>=_.rows)return[];let w=_.baseOffset+g;return[{path:p,cursor:Rr({command:t.command,path:p,offset:w,total_rows:_.totalRows,fingerprint:_.fingerprint}),retained_rows:g,remaining_rows:_.totalRows-w,total_rows:_.totalRows}]}),l=d[0],u=l?"; page --output-cursor":"",f=r.source==="session"?`Truncated by the remaining ${r.tokens}-token session budget; start a new output session with a larger token_budget${u}.`:`${r.tokens}-token: raise --output-budget${u}`;n.migration_hints=[f,...t.migration_hints];let m=Sr({effective_budget_tokens:r.tokens,measured_result_tokens:i});l&&!o&&(typeof e.next_cursor!="string"||e.continuation_kind==="output_cursor")&&(e.next_cursor=l.cursor),e.continuation_kind=o?"producer_cursor":l?"output_cursor":"none",e.output_budget_truncation={reason:"output_budget_reached",budget_source:r.source,budget_tokens:r.tokens,overridden_dimensions:a,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:o,continuation_available:d.length>0,recovery_budget_multiplier:l?1:m.recovery_budget_multiplier,continuations:d,restore_with:l?"recovery":`Retry with --output-budget ${m.output_budget} because no declared row collection can be continued.`,recovery:l?{cursor:l.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:`--output-budget ${m.output_budget}`,sdk:{outputBudget:m.output_budget},mcp:{outputBudget:m.output_budget}}}}function __(e,t,n,r){if(typeof n!="string"||!Array.isArray(e.items))return!1;let o=e.items.length;if(o===0||o>=t)return!1;let i;try{i=hn(n)}catch{return!1}let s=i.after_index;if(s===void 0)return!1;let a=e.items.at(-1);if(Object.prototype.toString.call(a)!=="[object Object]")return!1;let c=Reflect.get(a,"id");if(typeof c!="string"||c.length===0)return!1;let d=r?s-(t-o):s+o;return d<0?!1:(e.next_cursor=We(i.fingerprint,c,d,i.snapshot),!0)}function g_(e,t,n,r){let o=new Map($e(e).map(s=>{let a=Array.isArray(s.value)?s.value.length:Object.keys(s.value).length,c=n?.path===s.path;return[s.path,{rows:a,totalRows:c?n.total_rows:a,baseOffset:c?n.offset:0,fingerprint:c?n.fingerprint:rn(s.path,s.value,t)}]})),i=typeof e.next_cursor=="string";return{collectionsBeforeBudget:o,originalItemCount:Array.isArray(e.items)?e.items.length:0,cursorContinuesExistingPage:i,cursorSource:i?e.next_cursor:r.after}}function y_(e,t,n,r,o,i,s,a){let c=t.command==="assurance"&&Array.isArray(e.assertions)?e.assertions.filter(d=>q(d)&&d.verdict!=="pass").length:0;return fa(e,n,r.tokens,c>0?new Map([["assertions",c]]):new Map,a,d=>{let l=__(d,i.originalItemCount,i.cursorSource,i.cursorContinuesExistingPage);p_(d,t,n,r,l,s,i.collectionsBeforeBudget),o!==void 0&&Object.assign(d,on(d,o,n,a))})}function Ks(e,t,n){let r=Na(e,t);if(!r)return n;let o=Pa(t),i=nn(t.outputSession??t.output_session),s=t.outputCursor??t.output_cursor,a=typeof s=="string"?xr(s):void 0,c=a_(r),d=c_(r.command,n);if(a===void 0&&m_(r,i,d,o,t))return d;let l=l_(r,i),u=d_(d,r,i,a);Le(u,u,t.outputRowContract===!1);let f={contract_version:1,command:r.command,requested_dimensions:c,...l?.source==="default"?{budget_source:l.source,budget_tokens:l.tokens}:{},precedence:r.precedence,...Ma(r),legacy_aliases_used:r.legacy_aliases_used,migration_hints:r.migration_hints,estimated_tokens:0,within_budget:!0,strings_compacted:!1,rows_compacted:!1,result_omitted:!1};if(u.read_output=f,u=i===void 0?u:on(u,i,f,o),ae(u,f,o),l!==void 0&&f.estimated_tokens>l.tokens){let m=ua(r.command,t,u);m!==void 0&&(f.applied_depth="brief",f.degradation_reason="output_budget_reached",Le(u,m),u=pr(m,t)),f.estimated_tokens>l.tokens&&(u=y_(u,r,f,l,i,g_(u,r.command,a,t),f.estimated_tokens,o))}return l!==void 0&&f.estimated_tokens>l.tokens?u_(r,c,i,l,f.estimated_tokens,o):u}function wp(e){return q(e)&&q(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function vp(e,t){let n=t.outputFormat??t.output_format;if(n==="json"||n==="toon")return n;let r=Na(e,t)?.encoding;return r?.value==="json"||r?.value==="toon"?r.value:void 0}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="de370088-9285-5b33-8c7f-da8e9bb88286")}catch{}})();var b_=4096,w_=Object.freeze(["queue_draining","queue_entries","queue_exists","queue_high_retry_entries","queue_invalid_rows","queue_max_attempts","queue_rows_total","queue_size_bytes","pending_otel_spans","last_attempted_flush_at","last_failed_flush_at","last_otel_attempt_at","last_otel_failure_at","last_otel_success_at","last_successful_flush_at"]),Ea=Object.freeze({health:Object.freeze({version:3,paths:Object.freeze(["checks"]),ignored_detail_field_names_by_row:Object.freeze({telemetry:w_}),guarantee:"nonvolatile_snapshot_and_stable_configuration"})});function dt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ct(e){return Array.isArray(e)?e.map(ct):dt(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,ct(n)])):e}function $a(e,t){if(!dt(e))return ct(e);let n=typeof e.name=="string"?e.name:void 0,r=n!==void 0&&Object.hasOwn(t.ignored_detail_field_names_by_row,n)?t.ignored_detail_field_names_by_row[n]:void 0;return Object.fromEntries(Object.entries(e).map(([o,i])=>o!=="details"||!r||!dt(i)?[o,ct(i)]:[o,Object.fromEntries(Object.entries(i).filter(([s])=>!r.includes(s)).map(([s,a])=>[s,ct(a)]))]))}function v_(e,t){return Array.isArray(e)?e.map(n=>$a(n,t)):$a(e,t)}function rn(e,t,n){let r=n?Ea[n]:void 0,o=r?.paths.includes(e)===!0;return h_("sha256").update(de({path:e,value:o?v_(t,r):t,...o?{fingerprint_policy_version:r.version}:{}})).digest("base64url").slice(0,16)}function Rr(e){return Buffer.from(JSON.stringify({v:1,c:e.command,p:e.path,o:e.offset,n:e.total_rows,f:e.fingerprint}),"utf8").toString("base64url")}function xr(e){if(e.length>b_)throw new h("The read-output continuation cursor is malformed or unsupported.",y.USAGE,{code:"read_output_cursor_invalid"});let t;try{t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{t=null}if(!dt(t)||t.v!==1||Fe(String(t.c??""))!==t.c||typeof t.p!="string"||t.p.length===0||!Number.isSafeInteger(t.o)||t.o<0||!Number.isSafeInteger(t.n)||t.n<1||typeof t.f!="string"||t.f.length===0)throw new h("The read-output continuation cursor is malformed or unsupported.",y.USAGE,{code:"read_output_cursor_invalid"});return{version:1,command:t.c,path:t.p,offset:t.o,total_rows:t.n,fingerprint:t.f}}function ka(e){if(!Array.isArray(e.assertions))return e;let t=n=>!dt(n)||n.verdict==="pass"?4:n.verdict==="retired"?3:n.enforcement==="block"?0:n.enforcement==="warn"?1:2;return{...e,assertions:e.assertions.map((n,r)=>({row:n,index:r})).sort((n,r)=>t(n.row)-t(r.row)||n.index-r.index).map(({row:n})=>n),budget_retention_policy:"verdict_priority"}}function Oa(e,t,n){if(!n)return e;if(n.command!==t)throw new h(`The read-output cursor belongs to ${n.command}, not ${t}.`,y.USAGE,{code:"read_output_cursor_command_mismatch"});let r=$e(e).find(i=>i.path===n.path),o=r?Array.isArray(r.value)?r.value.length:Object.keys(r.value).length:0;if(!r||o!==n.total_rows||n.offset>o||rn(n.path,r.value,t)!==n.fingerprint)throw new h("The read-output continuation no longer matches the declared row collection; restart the bounded read.",y.USAGE,{code:"read_output_cursor_stale"});return ca(e,n.path,n.offset)}(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]="e216fd39-09ee-5a04-b0b5-44f518db4f93")}catch{}})();function $E(e){let t=e?.trim()??"";return/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(t)||/^(?:github|gitlab|jira|linear):/iu.test(t)}function LE(e){let t=e?.trim().toLowerCase();return t==="global"||t==="external"}export{B as a,ut as b,sn as c,E_ as d,ft as e,mt as f,pt as g,_t as h,Tt as i,Qr as j,_n as k,Xc as l,Jc as m,O as n,La as o,jr as p,O_ as q,S_ as r,Fr as s,A_ as t,C_ as u,T_ as v,I_ as w,R_ as x,x_ as y,N_ as z,D_ as A,P_ as B,M_ as C,$_ as D,L_ as E,j_ as F,ja as G,F_ as H,U_ as I,z_ as J,q_ as K,B_ as L,V_ as M,W_ as N,ui as O,Ua as P,za as Q,qa as R,yt as S,Ba as T,X_ as U,Ue as V,Wa as W,Ga as X,an as Y,J_ as Z,Q_ as _,y as $,h as aa,lu as ba,si as ca,ai as da,Ti as ea,Ii as fa,Ha as ga,Ya as ha,cn as ia,un as ja,fn as ka,sg as la,ag as ma,cg as na,oc as oa,Br as pa,dg as qa,_o as ra,vn as sa,go as ta,_e as ua,by as va,wy as wa,vy as xa,Ey as ya,En as za,Sn as Aa,Ry as Ba,Fd as Ca,Ny as Da,Dy as Ea,Py as Fa,wo as Ga,vo as Ha,My as Ia,$y as Ja,Ly as Ka,So as La,Wd as Ma,Co as Na,No as Oa,Gy as Pa,In as Qa,rl as Ra,Ky as Sa,yl as Ta,hl as Ua,Hy as Va,Yy as Wa,oh as Xa,ih as Ya,sh as Za,Po as _a,Do as $a,ah as ab,ch as bb,dh as cb,Mo as db,lh as eb,Et as fb,mg as gb,Nt as hb,Dn as ib,Pn as jb,Mn as kb,$n as lb,Ln as mb,jn as nb,zn as ob,ni as pb,de as qb,V as rb,kg as sb,Og as tb,Pu as ub,$u as vb,Lu as wb,Wu as xb,Hb as yb,Yb as zb,Xb as Ab,mc as Bb,pc as Cb,_c as Db,gc as Eb,mn as Fb,_g as Gb,yc as Hb,qe as Ib,kt as Jb,gg as Kb,yg as Lb,hg as Mb,wg as Nb,ys as Ob,Tc as Pb,Kr as Qb,pn as Rb,xc as Sb,Nc as Tb,St as Ub,Yr as Vb,Pc as Wb,Lc as Xb,Rg as Yb,xg as Zb,zc as _b,qc as $b,Bc as ac,$g as bc,Lg as cc,Vc as dc,At as ec,jg as fc,Fg as gc,Wc as hc,Gc as ic,Kc as jc,Jr as kc,Ct as lc,Hc as mc,Ug as nc,zg as oc,qg as pc,Bg as qc,Vg as rc,Wg as sc,Gg as tc,tw as uc,uf as vc,Qc as wc,gn as xc,td as yc,nd as zc,aw as Ac,wf as Bc,cw as Cc,dw as Dc,lw as Ec,uw as Fc,fw as Gc,mw as Hc,pw as Ic,_w as Jc,gw as Kc,yw as Lc,Ji as Mc,hw as Nc,Qi as Oc,bw as Pc,ww as Qc,vw as Rc,jt as Sc,as as Tc,cs as Uc,ds as Vc,Tw as Wc,us as Xc,Ut as Yc,$w as Zc,Lw as _c,jw as $c,gs as ad,oy as bd,iy as cd,We as dd,hn as ed,bn as fd,sy as gd,sd as hd,ay as id,cy as jd,cd as kd,my as ld,lo as md,dd as nd,hd as od,wd as pd,uo as qd,vd as rd,Ed as sd,fo as td,me as ud,mo as vd,py as wd,_y as xd,Ea as yd,rn as zd,Rr as Ad,xr as Bd,ke as Cd,Sa as Dd,OE as Ed,SE as Fd,Vp as Gd,Fe as Hd,AE as Id,Pr as Jd,Xp as Kd,CE as Ld,Na as Md,pr as Nd,Ks as Od,wp as Pd,vp as Qd,Bw as Rd,Es as Sd,Yw as Td,im as Ud,Xw as Vd,xe as Wd,Jw as Xd,Qw as Yd,Pm as Zd,Mm as _d,Ls as $d,X as ae,I as be,Ev as ce,Kt as de,Hm as ee,kv as fe,Ov as ge,Ym as he,Sv as ie,Av as je,Cv as ke,Hs as le,Zm as me,Lv as ne,tp as oe,Xs as pe,jv as qe,Qs as re,rp as se,ap as te,up as ue,bp as ve,Ap as we,sa as xe,nE as ye,Sr as ze,it as Ae,Cr as Be,nn as Ce,_a as De,Tr as Ee,ga as Fe,$E as Ge,LE as He};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-URH727T5.js.map
|