@unbrained/pm-cli 2026.10.20 → 2026.10.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.
Files changed (196) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +142 -77
  3. package/dist/cli/error-guidance.d.ts +8 -0
  4. package/dist/cli/error-guidance.js +2 -2
  5. package/dist/cli/main.js +1 -1
  6. package/dist/cli/register-list-query.js +2 -2
  7. package/dist/cli/register-operations.js +1 -1
  8. package/dist/cli-bundle/bundle-manifest.json +1 -1
  9. package/dist/cli-bundle/chunks/{chunk-QMZ73FCW.js → chunk-2B5HAZFK.js} +2 -2
  10. package/dist/cli-bundle/chunks/chunk-35ISFIPC.js +113 -0
  11. package/dist/cli-bundle/chunks/chunk-4D25HF3V.js +2 -0
  12. package/dist/cli-bundle/chunks/chunk-5LSN7K4N.js +2 -0
  13. package/dist/cli-bundle/chunks/chunk-7OTYULIJ.js +30 -0
  14. package/dist/cli-bundle/chunks/{chunk-GHJOMRSF.js → chunk-AOAQDCXX.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-ZA3XXHEE.js → chunk-BAIVTLJM.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-LS55VKRK.js → chunk-C37RDYZI.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-YT2Z3JPC.js → chunk-E3JC3WQL.js} +47 -47
  18. package/dist/cli-bundle/chunks/{chunk-YECCKB4E.js → chunk-GWIGZDRS.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-YTHI5DTH.js → chunk-HC2DCGFA.js} +2 -2
  20. package/dist/cli-bundle/chunks/chunk-IB7UB5TE.js +2 -0
  21. package/dist/cli-bundle/chunks/chunk-J444ZX23.js +126 -0
  22. package/dist/cli-bundle/chunks/{chunk-VLJLWZBO.js → chunk-LIC5EUQS.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-KU4Q3MSI.js → chunk-MV3KYY2A.js} +6 -6
  24. package/dist/cli-bundle/chunks/chunk-O67N62DT.js +2 -0
  25. package/dist/cli-bundle/chunks/{chunk-TZU6U5ZE.js → chunk-PCPOTFJP.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-TNU3XVPC.js +20 -0
  27. package/dist/cli-bundle/chunks/{chunk-7ZOIZ2AZ.js → chunk-URV4VHQ4.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-YW6SIKYP.js → chunk-UYYTV2TX.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-VO3KDIU7.js +9 -0
  30. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-U7VGKIYC.js → indexed-receipt-blobs-L3BOTMZN.js} +2 -2
  31. package/dist/cli-bundle/chunks/mutation-admission-TATOFEXF.js +2 -0
  32. package/dist/cli-bundle/chunks/{register-list-query-NNDV6F6I.js → register-list-query-GULR2IYO.js} +5 -5
  33. package/dist/cli-bundle/chunks/{register-mutation-3GCBSNQS.js → register-mutation-HLSQ4WVW.js} +4 -4
  34. package/dist/cli-bundle/chunks/register-operations-FE3GGA7O.js +2 -0
  35. package/dist/cli-bundle/chunks/register-setup-XUIKAIZA.js +2 -0
  36. package/dist/cli-bundle/chunks/{settlement-hook-CLRGA6O7.js → settlement-hook-UVFYSBMU.js} +2 -2
  37. package/dist/cli-bundle/chunks/stage-QCPZBZRC.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-25L3L2PF.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-25NQRZ7J.js +8 -0
  40. package/dist/cli-bundle/focused-chunks/chunk-2GFTVXKZ.js +8 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-HUZAXSIJ.js → chunk-3LWH2RJC.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-46HBJC6J.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-A52W6GLA.js +2 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-CB7TSZ7P.js +3 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-VLSER3XW.js → chunk-CX5FNEFC.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-DVNUHTVK.js +9 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-LJPUJ2KK.js → chunk-EHPRSWJE.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-GC4VMLXL.js +20 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-GHQVM6K6.js +2 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-KKRFSI2N.js → chunk-GVKYTDOH.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-NI6NS44Q.js → chunk-KM77WU5U.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-QGDKWULS.js +2 -0
  53. package/dist/cli-bundle/focused-chunks/chunk-QWKCQ5PW.js +91 -0
  54. package/dist/cli-bundle/focused-chunks/chunk-SOVXHW6Z.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-SVOOGGAK.js +2 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-SXVJRLLP.js +2 -0
  57. package/dist/cli-bundle/focused-chunks/{chunk-E4II2D2B.js → chunk-TMN3RAXZ.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-F7FD25TG.js → chunk-UQ5JPBY2.js} +11 -11
  59. package/dist/cli-bundle/focused-chunks/chunk-UUPJ6OZL.js +26 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-VYAZND5Q.js +78 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-W2CND3BD.js +65 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-ZGEK57KD.js → chunk-XX5JQCLF.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-H2G6CCGO.js → indexed-receipt-blobs-AAQOKO5B.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/mutation-admission-TBKR4KRM.js +2 -0
  65. package/dist/cli-bundle/focused-chunks/{settlement-hook-5SNBBT7C.js → settlement-hook-MNCHFCAX.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/stage-RM6MJIMT.js +2 -0
  67. package/dist/cli-bundle/main.js +21 -21
  68. package/dist/cli-bundle/sdk-authoring.js +1 -1
  69. package/dist/cli-bundle/sdk-contracts.js +2 -2
  70. package/dist/cli-bundle/sdk-core.js +23 -23
  71. package/dist/cli-bundle/sdk-governance.js +1 -1
  72. package/dist/cli-bundle/sdk-graph.js +1 -1
  73. package/dist/cli-bundle/sdk-merge.js +58 -57
  74. package/dist/cli-bundle/sdk-query.js +1 -1
  75. package/dist/cli-bundle/sdk-runtime.js +1 -1
  76. package/dist/cli-bundle/sdk-testing.js +1 -1
  77. package/dist/cli-bundle/sdk.js +7 -7
  78. package/dist/core/item/actionability.js +1 -1
  79. package/dist/core/lock/lock-gc.d.ts +12 -5
  80. package/dist/core/lock/lock-gc.js +1 -1
  81. package/dist/core/lock/lock-owner.d.ts +33 -0
  82. package/dist/core/lock/lock-owner.js +2 -0
  83. package/dist/core/lock/lock.d.ts +11 -22
  84. package/dist/core/lock/lock.js +4 -3
  85. package/dist/core/output/output.js +3 -3
  86. package/dist/core/shared/errors.d.ts +2 -0
  87. package/dist/core/shared/errors.js +1 -1
  88. package/dist/mcp/server.d.ts +2 -2
  89. package/dist/mcp/server.js +1 -1
  90. package/dist/sdk/agent/command-recovery.d.ts +2 -0
  91. package/dist/sdk/agent/command-recovery.js +1 -1
  92. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  93. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +6 -0
  94. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  95. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  96. package/dist/sdk/context-intent-contracts.d.ts +13 -0
  97. package/dist/sdk/context-intent-contracts.js +1 -1
  98. package/dist/sdk/contracts.d.ts +1 -1
  99. package/dist/sdk/contracts.js +1 -1
  100. package/dist/sdk/core.d.ts +2 -2
  101. package/dist/sdk/core.js +1 -1
  102. package/dist/sdk/define.d.ts +15 -16
  103. package/dist/sdk/define.js +1 -1
  104. package/dist/sdk/dependencies.js +1 -1
  105. package/dist/sdk/extension-command-context.js +2 -2
  106. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  107. package/dist/sdk/governance/assurance-action.js +1 -1
  108. package/dist/sdk/governance/assurance.js +1 -1
  109. package/dist/sdk/governance/health.js +2 -2
  110. package/dist/sdk/merge/install.js +2 -2
  111. package/dist/sdk/output/list-envelope.js +1 -1
  112. package/dist/sdk/pagination.d.ts +3 -3
  113. package/dist/sdk/pagination.js +1 -1
  114. package/dist/sdk/public-surface.json +1 -1
  115. package/dist/sdk/query/context.d.ts +5 -0
  116. package/dist/sdk/query/context.js +2 -2
  117. package/dist/sdk/query/list.d.ts +2 -0
  118. package/dist/sdk/query/list.js +1 -1
  119. package/dist/sdk/query/projection-contracts.d.ts +1 -1
  120. package/dist/sdk/query/projection-contracts.js +1 -1
  121. package/dist/sdk/read-output/session-result.d.ts +39 -0
  122. package/dist/sdk/read-output/session-result.js +2 -0
  123. package/dist/sdk/read-output-contracts.d.ts +18 -5
  124. package/dist/sdk/read-output-contracts.js +1 -1
  125. package/dist/sdk/read-output-session.d.ts +2 -0
  126. package/dist/sdk/read-output-session.js +1 -1
  127. package/dist/sdk/relationship-context.js +1 -1
  128. package/dist/sdk/runtime/mutation-admission.d.ts +2 -0
  129. package/dist/sdk/runtime/mutation-admission.js +2 -0
  130. package/dist/sdk/runtime-input.d.ts +2 -0
  131. package/dist/sdk/runtime-input.js +1 -1
  132. package/dist/sdk/runtime-primitives.d.ts +6 -0
  133. package/dist/sdk/runtime-primitives.js +1 -1
  134. package/dist/sdk/runtime.d.ts +10 -8
  135. package/dist/sdk/runtime.js +1 -1
  136. package/dist/sdk/test/execution.d.ts +1 -0
  137. package/dist/sdk/test/execution.js +2 -2
  138. package/dist/sdk/workspace.d.ts +3 -1
  139. package/dist/sdk/workspace.js +8 -5
  140. package/docs/AGENT_RUNTIME_PRIMITIVES.md +9 -0
  141. package/docs/ASSURANCE.md +17 -2
  142. package/docs/COMMANDS.md +17 -3
  143. package/docs/CONFIGURATION.md +38 -0
  144. package/docs/CONTEXT_RELEVANCE.md +15 -0
  145. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +56 -3
  146. package/docs/MCP_OPTION_CONFORMANCE.md +27 -1
  147. package/docs/MERGE_SAFETY.md +8 -0
  148. package/docs/READ_OUTPUT_CONTRACTS.md +79 -0
  149. package/docs/RELATIONSHIP_GRAPH.md +15 -0
  150. package/docs/RELEASING.md +8 -0
  151. package/docs/SDK.md +104 -7
  152. package/docs/TESTING.md +23 -0
  153. package/docs/agent-task-token-baseline.json +1 -1
  154. package/marketplace.json +1 -1
  155. package/package.json +1 -1
  156. package/packages/pm-beads/package.json +1 -1
  157. package/packages/pm-calendar/package.json +1 -1
  158. package/packages/pm-command-kit/package.json +1 -1
  159. package/packages/pm-digital-twin/package.json +1 -1
  160. package/packages/pm-governance-audit/package.json +1 -1
  161. package/packages/pm-guide-shell/package.json +1 -1
  162. package/packages/pm-kanban/package.json +1 -1
  163. package/packages/pm-lifecycle-hooks/package.json +1 -1
  164. package/packages/pm-linked-test-adapters/package.json +1 -1
  165. package/packages/pm-search-advanced/package.json +1 -1
  166. package/packages/pm-templates/package.json +1 -1
  167. package/packages/pm-todos/package.json +1 -1
  168. package/packages/pm-vcs/package.json +1 -1
  169. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  170. package/plugins/pm-claude/package.json +1 -1
  171. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  172. package/plugins/pm-codex/package.json +1 -1
  173. package/plugins/pm-codex/plugin.json +1 -1
  174. package/runtime-dependencies.json +1 -1
  175. package/dist/cli-bundle/chunks/chunk-2GGGOD7P.js +0 -30
  176. package/dist/cli-bundle/chunks/chunk-7NHA5K77.js +0 -126
  177. package/dist/cli-bundle/chunks/chunk-PNPE2OVJ.js +0 -112
  178. package/dist/cli-bundle/chunks/chunk-PTL3TBT6.js +0 -20
  179. package/dist/cli-bundle/chunks/chunk-QETMESEB.js +0 -6
  180. package/dist/cli-bundle/chunks/chunk-QQYCB2LO.js +0 -2
  181. package/dist/cli-bundle/chunks/register-operations-YKDGNKUL.js +0 -2
  182. package/dist/cli-bundle/chunks/register-setup-AOUZQQWB.js +0 -2
  183. package/dist/cli-bundle/chunks/stage-6QXYRMSU.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-37SU7BZI.js +0 -3
  185. package/dist/cli-bundle/focused-chunks/chunk-6IU7BESB.js +0 -65
  186. package/dist/cli-bundle/focused-chunks/chunk-AS3MOBO3.js +0 -25
  187. package/dist/cli-bundle/focused-chunks/chunk-AW35RDKA.js +0 -78
  188. package/dist/cli-bundle/focused-chunks/chunk-GYHZ7W6O.js +0 -2
  189. package/dist/cli-bundle/focused-chunks/chunk-H5Q2HUU6.js +0 -8
  190. package/dist/cli-bundle/focused-chunks/chunk-J6EYUGAR.js +0 -6
  191. package/dist/cli-bundle/focused-chunks/chunk-JEXZEIAX.js +0 -91
  192. package/dist/cli-bundle/focused-chunks/chunk-KDGUIIRU.js +0 -20
  193. package/dist/cli-bundle/focused-chunks/chunk-MQ42BFGX.js +0 -2
  194. package/dist/cli-bundle/focused-chunks/chunk-VAYS754X.js +0 -2
  195. package/dist/cli-bundle/focused-chunks/chunk-VS6VTWTZ.js +0 -8
  196. package/dist/cli-bundle/focused-chunks/stage-EMTISXR7.js +0 -2
@@ -1,3 +1,3 @@
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]="826dab45-600c-58df-a150-eacecfb6ef95")}catch{}})();var b=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],F=2,v=Object.freeze({migration:"schema",validation:"schema"}),M=Object.freeze({version:2,capabilities:[...b],legacy_aliases:{...v}}),P=["off","warn","enforce"],U=["off","warn","enforce"],Y=["none","restricted","strict"],q=["block","warn"],W=["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"],X=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function m(){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]="3d6df465-e82e-57d8-a687-6c2e720c99c1")}catch{}})();var E=["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"],T=["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",...E,"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"],k=T;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a92abe3-1900-5a69-a35d-6aa592c83da0")}catch{}})();var I=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"]}]),O=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),z=".agents/pm",$="settings.json",V="Closed at creation via pm create",N=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],A=["decisions","events","reminders","milestones","meetings","plans"],J=[...N,...A],Q={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},D={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}},S=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],f={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 h(e){return e?[...e]:void 0}var Z={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:[...S],lifecycle_closure_like_blocked_reason_patterns:[...f.blocked_reason],lifecycle_closure_like_resolution_patterns:[...f.resolution],lifecycle_closure_like_actual_result_patterns:[...f.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...D.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:I.map(e=>({...e,aliases:h(e.aliases),roles:h(e.roles)})),fields:[],workflow:{...O},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:m()},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:""}}},H={metadata:{},body:""},w={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},R=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 ee(e){let t=(e??"").trim().toLowerCase();if(t.length===0)return"unknown";let o=R[t];return typeof o=="string"?o:t.includes("conflict")||t.includes("locked")?"conflict":t.startsWith("unknown_")||t.startsWith("missing_required_")?"usage":t.startsWith("invalid_")||t.endsWith("_not_found")||t.includes("validation")?"validation":t.endsWith("_error")||t.endsWith("_failed")?"runtime":"unknown"}(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]="1e7d4217-da18-5bfc-a00b-67bba61f57c2")}catch{}})();var u=class extends Error{exitCode;code;context;constructor(t,o,i={}){super(t),this.name="PmCliError",this.exitCode=o,this.context=i,this.code=i.code}};import*as r from"node:fs/promises";import{constants as p}from"node:fs";import c from"node:path";import C 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]="3792f1fd-ed9d-5252-887d-e4517a55fb9c")}catch{}})();var L=[10,25,50,100];async function y(e){await r.mkdir(e,{recursive:!0})}async function le(e){try{return await r.access(e),!0}catch{return!1}}function g(e){return x(e)||l(e,"ENOTDIR")}function x(e){return l(e,"ENOENT")}async function ce(e){try{return await r.readFile(e,"utf8")}catch(t){if(g(t))return null;throw t}}async function de(e,t){let o=await r.open(e,p.O_RDONLY|p.O_NOFOLLOW|p.O_NONBLOCK);try{if(!(await o.stat()).isFile())throw t;return await o.readFile("utf8")}finally{await o.close()}}function _e(e){let t=e?.replaceAll(c.sep,"/"),o=t!==void 0&&!c.posix.isAbsolute(t)&&!c.win32.isAbsolute(t)&&!t.split("/").includes(".."),i=o?t.split("/")[0]:void 0,s={"settings.json":"settings",runtime:"runtime",schema:"schema",history:"history",transactions:"transactions"},n=i===void 0?"tracker_storage":Object.hasOwn(s,i)?s[i]:"tracker_storage",d=o&&t.length>0&&t.length<=160&&t.split("/").every(a=>a!=="."&&/^[a-zA-Z0-9_.-]+$/u.test(a)),_=d?t:`${n} (entry name redacted)`;return new u(`Transaction preview requires regular files and directories. Inspect ${_} relative to the selected tracker root.`,w.USAGE,{code:"transaction_preview_non_regular_file",preview_storage:{storage_area:n,...d?{relative_entry:t}:{},entry_redacted:!d},required:"regular files and directories within the configured tracker storage",why:"Preview does not follow linked entries or read special files.",nextSteps:[`Inspect ${_} within the selected tracker for links, directories used as files, or special files; do not follow link targets.`,"Restore the intended regular files and directories, then retry the original dry-run command."]})}async function ue(e,t,o={}){let i=c.dirname(e);o.createParentDirectories!==!1&&await y(i);let s=c.join(i,`.${c.basename(e)}.${process.pid}.${Date.now()}.${C.randomBytes(4).toString("hex")}.tmp`);await r.writeFile(s,t,"utf8");try{await r.rename(s,e)}catch(n){if(process.platform==="win32"&&(l(n,"EPERM")||l(n,"EBUSY"))){let d=n;for(let _ of L){await new Promise(a=>setTimeout(a,_));try{await r.rename(s,e);return}catch(a){if(d=a,!l(a,"EPERM")&&!l(a,"EBUSY"))break}}try{await r.unlink(s)}catch{}throw d}if(l(n,"EXDEV")){try{await r.copyFile(s,e)}finally{try{await r.unlink(s)}catch{}}return}try{await r.unlink(s)}catch{}throw n}}async function fe(e,t){let o=c.dirname(e);await y(o);let i=await r.open(e,"a");try{await i.writeFile(`${t}
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]="826dab45-600c-58df-a150-eacecfb6ef95")}catch{}})();var b=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],F=2,v=Object.freeze({migration:"schema",validation:"schema"}),M=Object.freeze({version:2,capabilities:[...b],legacy_aliases:{...v}}),P=["off","warn","enforce"],U=["off","warn","enforce"],Y=["none","restricted","strict"],q=["block","warn"],W=["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"],X=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function m(){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]="3d6df465-e82e-57d8-a687-6c2e720c99c1")}catch{}})();var E=["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"],T=["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",...E,"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"],k=T;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a92abe3-1900-5a69-a35d-6aa592c83da0")}catch{}})();var I=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"]}]),O=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),z=".agents/pm",$="settings.json",V="Closed at creation via pm create",N=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],A=["decisions","events","reminders","milestones","meetings","plans"],J=[...N,...A],Q={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},D={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}},S=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],f={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 h(e){return e?[...e]:void 0}var Z={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:[...S],lifecycle_closure_like_blocked_reason_patterns:[...f.blocked_reason],lifecycle_closure_like_resolution_patterns:[...f.resolution],lifecycle_closure_like_actual_result_patterns:[...f.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...D.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:I.map(e=>({...e,aliases:h(e.aliases),roles:h(e.roles)})),fields:[],workflow:{...O},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:m()},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:""}}},H={metadata:{},body:""},w={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},R=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 ee(e){let t=(e??"").trim().toLowerCase();if(t.length===0)return"unknown";let o=R[t];return typeof o=="string"?o:t.includes("conflict")||t.includes("locked")?"conflict":t.startsWith("unknown_")||t.startsWith("missing_required_")?"usage":t.startsWith("invalid_")||t.endsWith("_not_found")||t.includes("validation")?"validation":t.endsWith("_error")||t.endsWith("_failed")?"runtime":"unknown"}(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]="3399082a-aeaf-5235-9524-d0e86253ee95")}catch{}})();var u=class extends Error{exitCode;code;context;constructor(t,o,i={}){super(t),this.name="PmCliError",this.exitCode=o,this.context=i,this.code=i.code}};import*as r from"node:fs/promises";import{constants as p}from"node:fs";import c from"node:path";import C 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]="3792f1fd-ed9d-5252-887d-e4517a55fb9c")}catch{}})();var L=[10,25,50,100];async function y(e){await r.mkdir(e,{recursive:!0})}async function le(e){try{return await r.access(e),!0}catch{return!1}}function g(e){return x(e)||l(e,"ENOTDIR")}function x(e){return l(e,"ENOENT")}async function ce(e){try{return await r.readFile(e,"utf8")}catch(t){if(g(t))return null;throw t}}async function de(e,t){let o=await r.open(e,p.O_RDONLY|p.O_NOFOLLOW|p.O_NONBLOCK);try{if(!(await o.stat()).isFile())throw t;return await o.readFile("utf8")}finally{await o.close()}}function _e(e){let t=e?.replaceAll(c.sep,"/"),o=t!==void 0&&!c.posix.isAbsolute(t)&&!c.win32.isAbsolute(t)&&!t.split("/").includes(".."),i=o?t.split("/")[0]:void 0,s={"settings.json":"settings",runtime:"runtime",schema:"schema",history:"history",transactions:"transactions"},n=i===void 0?"tracker_storage":Object.hasOwn(s,i)?s[i]:"tracker_storage",d=o&&t.length>0&&t.length<=160&&t.split("/").every(a=>a!=="."&&/^[a-zA-Z0-9_.-]+$/u.test(a)),_=d?t:`${n} (entry name redacted)`;return new u(`Transaction preview requires regular files and directories. Inspect ${_} relative to the selected tracker root.`,w.USAGE,{code:"transaction_preview_non_regular_file",preview_storage:{storage_area:n,...d?{relative_entry:t}:{},entry_redacted:!d},required:"regular files and directories within the configured tracker storage",why:"Preview does not follow linked entries or read special files.",nextSteps:[`Inspect ${_} within the selected tracker for links, directories used as files, or special files; do not follow link targets.`,"Restore the intended regular files and directories, then retry the original dry-run command."]})}async function ue(e,t,o={}){let i=c.dirname(e);o.createParentDirectories!==!1&&await y(i);let s=c.join(i,`.${c.basename(e)}.${process.pid}.${Date.now()}.${C.randomBytes(4).toString("hex")}.tmp`);await r.writeFile(s,t,"utf8");try{await r.rename(s,e)}catch(n){if(process.platform==="win32"&&(l(n,"EPERM")||l(n,"EBUSY"))){let d=n;for(let _ of L){await new Promise(a=>setTimeout(a,_));try{await r.rename(s,e);return}catch(a){if(d=a,!l(a,"EPERM")&&!l(a,"EBUSY"))break}}try{await r.unlink(s)}catch{}throw d}if(l(n,"EXDEV")){try{await r.copyFile(s,e)}finally{try{await r.unlink(s)}catch{}}return}try{await r.unlink(s)}catch{}throw n}}async function fe(e,t){let o=c.dirname(e);await y(o);let i=await r.open(e,"a");try{await i.writeFile(`${t}
2
2
  `,"utf8")}finally{await i.close()}}async function pe(e){try{await r.unlink(e)}catch(t){if(!g(t))throw t}}function l(e,t){return typeof e=="object"&&e!==null&&"code"in e&&e.code===t}export{b as a,F as b,v as c,M as d,P as e,U as f,Y as g,q as h,W as i,X as j,m as k,E as l,k as m,I as n,O as o,z as p,$ as q,V as r,N as s,J as t,Q as u,D as v,S as w,f as x,Z as y,H as z,w as A,ee as B,u as C,y as D,le as E,g as F,x as G,ce as H,de as I,_e as J,ue as K,fe as L,pe as M};
3
- //# sourceMappingURL=chunk-YECCKB4E.js.map
3
+ //# sourceMappingURL=chunk-GWIGZDRS.js.map
@@ -1,2 +1,2 @@
1
- import{Sb as y}from"./chunk-7NHA5K77.js";import{Cd as V,Db as v,Ef as z,Ne as $,Oe as R,Te as B,dh as G,eh as T,f as N,g as p,i as E,j as L,k as w,ud as I,vd as k,wd as D,xb as M,xd as O,yb as F,yd as _,zd as C}from"./chunk-PNPE2OVJ.js";import{A as g,C as b}from"./chunk-YECCKB4E.js";import{Command as se}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="df7f766c-1121-5712-b562-423d2cda95ce")}catch{}})();function Ke(e){return new se().name("pm").description("Universal, flexible, extensible, agent-optimized project management CLI for any project or programming language.").version(e).showHelpAfterError(!1).allowExcessArguments(!1).allowUnknownOption(!1).configureOutput({writeOut:t=>{z(t)},writeErr:()=>{}}).option("--json","Output JSON instead of TOON; mutations emit a flat receipt with top-level id/status/changed_field_count while reads use documented entity or collection envelopes").option("--lean","Omit null and empty containers from JSON output").option("--token-accounting","Attach a bounded per-section token-cost receipt to command output").option("--output-include <fields>","Retain comma-separated fields or sections in read output").option("--output-limit <count>","Bound rows in read output").option("--output-budget <tokens|unbounded>","Bound estimated tokens in read output or explicitly disable the default ceiling").option("--output-format <toon|json>","Select the result encoding for reads and mutations").option("--output-session <state>","Carry a JSON session budget and served-item ledger across read calls").option("--output-cursor <cursor>","Resume continuation_kind=output_cursor").option("--output-row-contract","Include row selectors, encoding metadata, and read-output receipts").option("--quiet","Suppress stdout output").option("--no-changed-fields","Omit the changed_fields array from mutation output (keeps changed_field_count)").option("--full-changed-fields","Restore the legacy full mutation envelope and changed_fields array").option("--id-only","Print only id and status for single-item mutation output").option("--pm-path <dir>","Explicit tracker storage path for this command (preferred over --path)").option("--path <dir>","Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd").option("--no-extensions","Disable extension loading").option("--no-pager","Disable pager integration for help and long output").option("--explain","Render extended rationale and examples in help output").option("--all","Reveal every public command and compatibility alias").option("--profile","Print deterministic timing diagnostics").option("--author <id>","Override mutation author for this invocation").exitOverride()}(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]="8efedca0-725e-520f-ad06-825a0cccddaa")}catch{}})();var U=new Set(["append","claim","close","close-task","comments","copy","delete","deps","docs","files","focus","get","history","history-compact","history-redact","history-repair","learnings","notes","pause-task","release","restore","start-task","test","update"]),W=new Map([["files","discover"],["item","complete"]]),re=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function j(e){let t=p(e?.trim().toLowerCase()??"");return U.has(t)||W.has(t)}function ae(e,t,n){let o=U.has(n)?t+1:void 0,i=_(e.slice(t+1));if(i===void 0)return o;let r=t+1+i,a=`${n} ${e[r]}`,s=p(a);return s===a?n==="item"&&e[r]==="complete"?r+1:o:j(s)?P(e,r,s):void 0}function P(e,t,n){if(["history","context","ctx","update","close","item"].includes(n))return ae(e,t,n);let o=W.get(n);if(o===void 0)return t+1;let i=e[t+1]?.toLowerCase()===o;return t+(i?2:1)}function le(e){let t=new Map;for(let n of y(e))for(let o of[n.flag,n.short,...n.aliases??[]])o&&t.set(o,n);return t}function ce(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--")break;o==="--id"?(t.push({index:n,consumed:2,value:e[n+1]}),n+=1):o.startsWith("--id=")&&t.push({index:n,consumed:1,value:o.slice(5)})}return t}function ue(e,t,n){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let o=n.get(e);return o!==void 0&&o.value_type!=="boolean"}function de(e,t,n,o,i){let r=0;for(let a=t;a<e.length;a+=1){let s=e[a];if(s==="--")break;if(s==="--id"){a+=1;continue}if(!s.startsWith("--id=")){if(!s.startsWith("-")){if(a<o)return!0;r+=1;continue}ue(s,e[a+1],i)&&(a+=1)}}return r>(re.get(p(n))??0)}function q(e){let t=_(e),n=t===void 0?void 0:e[t]?.toLowerCase();if(n!=="context"&&n!=="ctx"&&!j(n))return{argv:[...e],changed:!1,conflict:!1};let o=P(e,t,n);if(o===void 0)return{argv:[...e],changed:!1,conflict:!1};let i=o>t+1?`${p(e.slice(t,o-1).join(" "))} ${e[o-1]}`:n,r=le(i),a=ce(e),s=a[0];if(!s||!s.value?.trim())return{argv:[...e],changed:!1,conflict:!1};if(a.length>1||de(e,o,i,s.index,r))return{argv:[...e],changed:!1,conflict:!0,itemId:s.value};let l=[...e.slice(0,s.index),...e.slice(s.index+s.consumed)],c=_(l),u=P(l,c,n);return l.splice(u,0,s.value),{argv:l,changed:!0,conflict:!1,itemId:s.value}}(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]="f05cec18-5e48-5151-8ada-577c9df5885d")}catch{}})();var fe=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),pe=new Set(["toon","json"]);function me(e,t,n){let o=e[t];if(k.has(o))return n.booleanFlags.add(o),1;let i=o.indexOf("="),r=i>0?o.slice(0,i):o;if(!I.has(r))return 1;let a=i>0?o.slice(i+1):void 0,s=a===void 0&&O(r,e[t+1]),l=a??(s?e[t+1]:void 0);return r==="--author"?n.author=l??"":typeof l=="string"&&l.length>0&&(fe.has(r)?n.outputValues:n.pathValues).set(r,l),s?2:1}function he(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=me(e,n,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(J(e)??""),noPager:t.booleanFlags.has("--no-pager"),json:t.booleanFlags.has("--json")?t.outputValues.get("--output-format")!=="toon":t.outputValues.get("--output-format")==="json",quiet:t.booleanFlags.has("--quiet"),lean:t.booleanFlags.has("--lean"),tokenAccounting:t.booleanFlags.has("--token-accounting"),...t.booleanFlags.has("--output-row-contract")?{outputRowContract:!0}:{},...t.outputValues.get("--output-include")===void 0?{}:{outputInclude:t.outputValues.get("--output-include")},...t.outputValues.get("--output-limit")===void 0?{}:{outputLimit:t.outputValues.get("--output-limit")},...t.outputValues.get("--output-budget")===void 0?{}:{outputBudget:t.outputValues.get("--output-budget")},...pe.has(t.outputValues.get("--output-format"))?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:t.outputValues.get("--output-cursor")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function X(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(k.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(I.has(o)){n+=O(o,e[n+1])?2:1;continue}if(D(o)){n+=1;continue}t.push(o),n+=1}return t}function ge(e){let t=X(e);if(t[0]?.trim().toLowerCase()==="help"){let o=[];for(let i=1;i<t.length;i+=1){let r=t[i];if(r.startsWith("-"))break;o.push(r.trim().toLowerCase())}return{requested:!0,commandPathTokens:o}}if(t.findIndex(o=>o==="--help"||o==="-h")<0)return{requested:!1,commandPathTokens:[]};let n=[];for(let o of t){if(o.startsWith("-"))break;n.push(o.trim().toLowerCase())}return{requested:!0,commandPathTokens:n}}function S(e){return _(e)}function be(e){return C(e)}function ye(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:ge(e).requested}function lt(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(r=>process.env[r]),o=()=>{for(let[r,a]of t.entries()){let s=n[r];s===void 0?delete process.env[a]:process.env[a]=s}},i=he(e);return ye(e,i)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),o}var _e=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function Ie(e){let t=S(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!_e.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}var we=new Set(["pm","pm-cli"]);function ve(e,t){let n=S(e);if(n===void 0)return e;let o=e[n];return we.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function ke(e,t){let n=S(e);if(n!==void 0&&e[n]==="help"){let s=S(e.slice(n+1));n=s===void 0?void 0:n+1+s}if(n===void 0)return e;let o=e[n],i=L[o.trim().toLowerCase()];if(!i)return e;let r=i.split(" "),a=[...e.slice(0,n),...r,...e.slice(n+1)];return t.push({from:o,to:r,reason:"command_alias",confidence:"high"}),a}function x(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function K(e){return x(e).replace(/-/g,"")}function Y(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function Ce(e){let t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(let o of e.aliases??[])n(o);return t}function Te(e,t){let n=t??y(e),o=new Map,i=new Map,r=new Map,a=new Set;for(let s of n){let l=Ce(s);if(l.length===0)continue;let c=`--${x(l[0])}`;for(let f of l)Y(o,x(f),c),Y(i,K(f),c);let u=K(c);r.has(c)||r.set(c,u),s.list===!0&&a.add(c)}return{canonicalByNormalized:o,canonicalByCompact:i,canonicalComparables:[...r.entries()].map(([s,l])=>({canonicalFlag:s,comparable:l})),listCanonicalFlags:a}}function Z(e,t){let n=x(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let i=n.replace(/-/g,""),r=t.canonicalByCompact.get(i);if(typeof r=="string")return{flag:r,reason:"flag_alias",confidence:"high"};let a=i.length>=8?2:1,s=Number.POSITIVE_INFINITY,l,c=!1;for(let u of t.canonicalComparables){let f=v(i,u.comparable,a);if(f!==null){if(f<s){s=f,l=u.canonicalFlag,c=!1;continue}f===s&&l!==u.canonicalFlag&&(c=!0)}}return!l||c||!Number.isFinite(s)||s<=0?null:{flag:l,reason:"flag_typo",confidence:s>=2?"medium":"high"}}function ct(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function Se(e,t=!1){if(t||e.includes("://"))return null;let n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;let o=n[1],i=n[3];return i.length===0?null:{key:o,value:i}}function xe(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),i=o>=0?e.slice(0,o):e,r=o>=0?e.slice(o+1):void 0,a=Z(i,t);if(!a)return{tokens:[e]};let s=r===void 0?a.flag:`${a.flag}=${r}`;return s===e?{tokens:[e]}:{tokens:[s],event:{from:e,to:[s],reason:a.reason,confidence:a.confidence}}}function Ae(e){let t=new Set,n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}let i=e[o];n=i==="--path"||i==="--pm-path"}return t}function Ee(e){if(!e.startsWith("--"))return null;let t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function Oe(e,t,n){n.push(e[t]);let o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function Pe(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let i=[],r=t+1;for(;r<e.length&&e[r]!=="--"&&!e[r].startsWith("-")&&(i.length===0||o.has(n.flag));)i.push(e[r]),r+=1;let a=i.length===0?1:1+i.length;return{originalTokens:e.slice(t,t+a),value:i.length===0?void 0:i.join(","),consumed:a}}function Ne(e,t,n,o){let i=e.get(n);if(i){i.values.push(o.value),i.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function Le(e,t){let n=[],o=[];for(let[i,r]of e){if(!(r.occurrences>=2||t.has(i)&&r.originalTokens.length>2)){o.push({outputIndex:r.outputIndex,tokens:r.originalTokens});continue}let a=`${i}=${r.values.join(",")}`;o.push({outputIndex:r.outputIndex,tokens:[a]}),n.push({from:`${i} (x${r.occurrences})`,to:[a],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function Me(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function Fe(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],r=new Map,a=0;for(;a<e.length;){let c=e[a];if(c==="--"){i.push(...e.slice(a));break}if(n.has(c)){a=Oe(e,a,i);continue}let u=Ee(c);if(!u||!t.has(u.flag)){i.push(c),a+=1;continue}let f=Pe(e,a,u,o);if(f.value===void 0){i.push(c),a+=f.consumed;continue}Ne(r,i,u.flag,{originalTokens:f.originalTokens,value:f.value}),a+=f.consumed}let{events:s,splices:l}=Le(r,o);return Me(i,l),{argv:i,events:s}}var H=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function De(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],i=H.get(o);return i!==void 0&&i.has(n)}function Ve(e,t,n){if(t!=="test")return e;let o=[],i=0;for(;i<e.length;){let r=e[i];if(r==="--")return o.push(...e.slice(i)),o;let a=H.get(r),s=a?e[i+1]:void 0;if(!a||typeof s!="string"||!a.has(s)){o.push(r),i+=1;continue}let l=i+2;for(;l<e.length&&!e[l].startsWith("-");)l+=1;if(l-(i+2)!==1){o.push(r),i+=1;continue}let c=e[i+2],u=`${s}=${c}`;o.push(r,u),n.push({from:`${r} ${s} ${c}`,to:[r,u],reason:"bare_key_value",confidence:"high"}),i+=3}return o}function $e(e,t,n,o){let i=[],r=Ae(e);for(let a=0;a<e.length;a+=1){let s=e[a];if(s==="--"){i.push(...e.slice(a));break}let l=r.has(a),c=i[i.length-1];if(s.startsWith("--")){let h=xe(s,t,l);i.push(...h.tokens),h.event&&o.push(h.event);continue}let u=Se(s,l);if(!u||typeof c=="string"&&c.startsWith("-")&&!c.includes("=")||["search","comments","notes","learnings"].includes(n)||De(n,i)){i.push(s);continue}let f=Z(u.key,t);if(!f){i.push(s);continue}let m=u.value.startsWith("-")?[`${f.flag}=${u.value}`]:[f.flag,u.value];i.push(...m),o.push({from:s,to:m,reason:"bare_key_value",confidence:f.confidence})}return i}function Re(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--verify"){let o=e[t+1];if(o===void 0||o==="--")throw new b("history attest --verify requires a bundle file.",g.USAGE);e.splice(t,2,`--verify=${o}`)}else(I.has(n)||n==="--output"||n==="--hash-algorithm")&&(t+=1)}}function Be(e,t){if(!e.some(o=>o==="--help"||o==="-h"))return;let n=new Set(y(t).flatMap(o=>[o.flag,...o.aliases??[],...o.short===void 0?[]:[o.short]]));for(let o=0;o<e.length;o+=1){let i=e[o];if(i==="--")break;i!=="--help"&&i!=="-h"||n.has(e[o-1])&&!k.has(e[o-1])&&(e[o-1]=i)}}function ut(e){let t=[],n=ve(e,t),o=Ie(n);(o.length!==n.length||o.some((h,ie)=>h!==n[ie]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let i=ke(o,t),r=q(i);if(r.conflict)throw new b("Provide the item id either positionally or with --id, not both.",g.USAGE);r.changed&&t.push({from:`--id ${r.itemId}`,to:[r.itemId],reason:"item_id_alias",confidence:"high"});let a=be(r.argv),s=J(r.argv),l=p(s??a??""),c=Te(s??a),u=$e(r.argv,c,l,t),f=Ve(u,l,t),m=Fe(f,c.listCanonicalFlags,I,a==="create"?new Set(["--tags"]):new Set);for(let h of m.events)t.push(h);return Be(m.argv,s??a),s==="history attest"&&Re(m.argv),{argv:m.argv,commandName:a,trace:t}}function J(e){let t=X(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase(),i=N(t);return i?i.canonical:(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function dt(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--type"){let o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){let o=n.slice(7).trim();if(o.length>0)return o}}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fb625cd9-f8a8-56cf-88ab-abef64051497")}catch{}})();function gt(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new b("--author requires a non-empty value.",g.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let n=G();T(t);let o=!1;return()=>{o||(o=!0,n===void 0?T(void 0):T(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]="d0e60f7e-e0a8-5ef4-9af7-4a1f102ccb7d")}catch{}})();var d=Object.freeze({clock:"PM_CLOCK",tickMs:"PM_CLOCK_TICK_MS",seed:"PM_SEED"});function A(e,t,n,o){return new b(e,g.USAGE,{code:"invalid_reproducible_process_environment",reason:t,field:n,required:`${d.clock} and ${d.seed}; ${d.tickMs} is optional`,nextSteps:[`Set ${d.clock} to an ISO-8601 instant with Z or a numeric UTC offset and ${d.seed} to a non-empty reproducibility seed.`,`Optionally set ${d.tickMs} to a non-negative integer; it defaults to 1.`,"Unset all three variables to retain normal wall-clock and cryptographic-random behavior."],recovery:{recovery_mode:"compact",provided_fields:o,missing_required_fields:t==="incomplete"?[d.clock,d.seed].filter(i=>!o.includes(i)):void 0}})}function ze(e){let t=e[d.clock],n=e[d.tickMs],o=e[d.seed],i=[[d.clock,t],[d.tickMs,n],[d.seed,o]].filter(a=>a[1]!==void 0).map(([a])=>a);if(i.length===0)return;if(t===void 0||o===void 0)throw A("Reproducible process execution requires PM_CLOCK and PM_SEED together.","incomplete",t===void 0?d.clock:d.seed,i);if(o.trim().length===0)throw A(`${d.seed} must not be empty.`,"invalid_value",d.seed,i);if(!B(t))throw A(`${d.clock} must be a valid ISO-8601 instant with Z or a numeric UTC offset.`,"invalid_value",d.clock,i);let r=n===void 0?1:Number(n);if(n?.trim().length===0||!Number.isSafeInteger(r)||r<0)throw A(`${d.tickMs} must be a non-negative integer.`,"invalid_value",d.tickMs,i);return $({clock:t,seed:o,tickMs:r})}function Ge(e){let t=ze(e);return t===void 0?n=>n():R(t)}async function vt(e,t){return Ge(e)(t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7249e95a-4744-55b8-8b83-2d84f3e48805")}catch{}})();var Q=new Set([...Object.values(M),...F,"--full","--brief","--compact","--summary","--fields","--section","--token-budget"]),ee=new Set(["--full-changed-fields","--no-changed-fields","--id-only"]);function te(e){let t=e.split("=",1)[0].replaceAll("_","-");return Q.has(t)||t.length>=5&&[...Q].some(n=>n.startsWith(t))}function At(e,t){let n=e.split("=",1)[0].replaceAll("_","-");return te(n)?!ee.has(t):ee.has(n)?!te(t):!0}function ne(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function Et(e){if(!(!Array.isArray(e)||e.length===0))return C(e)}function Ue(e,t){let n=ne(t);if(!n)return;let o=y(e).find(i=>i.flag===n||i.aliases?.includes(n));return o?o.value_type==="boolean"?null:`<${o.value_name??"value"}>`:"<value>"}function Ot(e,t,n){let o=[...e],i=o.indexOf("--"),r=i<0?o.length:i;for(let a of n){let s=ne(a);if(!s||o.slice(0,r).some(u=>u===s||u.startsWith(`${s}=`)))continue;let l=Ue(t,s),c=l?[s,l]:[s];o.splice(r,0,...c),r+=c.length}return o.length===e.length?void 0:V(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]="bd9a8d3b-bc6f-5309-a3fb-7e5f41ef9dab")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="12066389-daef-5fce-b7a6-0ecffa926d66")}catch{}})();function Vt(e,t){let n=e.trim().split(/\s+/u);if(!(n.length<2||t.includes(n.join(" "))))for(let o=1;o<n.length;o+=1){if(!t.includes(n.slice(0,o).join(" ")))return;let i=n.slice(o).join(" "),r=w(i),a=new Set(t.filter(s=>s===i||s.endsWith(` ${i}`)||s===r?.canonical).map(s=>w(s)?.canonical??s).filter(s=>t.includes(s)));if(a.size>0)return a.size===1?[...a][0]:void 0}}var We={add:["create","append"],fetch:["get"],inspect:["get","health"],log:["history","comments","notes"],ls:["list"],pause:["release"],read:["get"],remove:["delete"],rm:["delete"],show:["get"],start:["start-task"]};function oe(e,t){let n=e.trim().toLowerCase(),o=t.trim().toLowerCase();if(o.length===0)return Number.POSITIVE_INFINITY;let i=n.split(" "),r=We[o]?.indexOf(p(n));if(r!==void 0&&r>=0)return r;if(n===o)return 10;if(i.includes(o))return 11;if(i.some(l=>l.startsWith(o)))return 12;let a=o.length>=5?2:1,s=Number.POSITIVE_INFINITY;for(let l of i){let c=v(l,o,a);c!==null&&(s=Math.min(s,c))}return Number.isFinite(s)?20+s:n.includes(o)?30:Number.POSITIVE_INFINITY}function $t(e,t){return e.map(n=>({path:n,score:oe(n,t)})).filter(n=>Number.isFinite(n.score)).sort((n,o)=>n.score!==o.score?n.score-o.score:n.path===o.path?0:n.path<o.path?-1:1).map(n=>n.path)}function Rt(e,t,n){let o=new Set(t),i=E.filter(s=>s.lifecycle==="deprecated").slice().sort((s,l)=>l.alias.length-s.alias.length),r=[],a=e.flatMap(s=>{let l=i.find(u=>s===u.alias||s.startsWith(`${u.alias} `)),c=s;if(l){let u=s.slice(l.alias.length);if(!o.has(`${l.canonical}${u}`))return[];c=`${l.canonical_argv.join(" ")}${u}`}return n!==void 0&&oe(s,n)<10&&r.push(c),[c]});return[...new Set(r.length>0?r:a)]}export{Ke as a,j as b,q as c,he as d,X as e,ge as f,S as g,be as h,lt as i,Ie as j,ct as k,Fe as l,Ve as m,ut as n,dt as o,gt as p,d as q,ze as r,Ge as s,vt as t,te as u,At as v,Et as w,Ue as x,Ot as y,Vt as z,oe as A,$t as B,Rt as C};
2
- //# sourceMappingURL=chunk-YTHI5DTH.js.map
1
+ import{Sb as y}from"./chunk-J444ZX23.js";import{Cd as V,Db as T,If as z,Oe as $,Pe as R,Ue as B,f as N,g as m,hh as G,i as E,ih as v,j as L,k as C,ud as I,vd as k,wd as D,xb as M,xd as A,yb as F,yd as _,zd as w}from"./chunk-35ISFIPC.js";import{A as g,C as b}from"./chunk-GWIGZDRS.js";import{Command as se}from"commander";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="df7f766c-1121-5712-b562-423d2cda95ce")}catch{}})();function Ye(e){return new se().name("pm").description("Universal, flexible, extensible, agent-optimized project management CLI for any project or programming language.").version(e).showHelpAfterError(!1).allowExcessArguments(!1).allowUnknownOption(!1).configureOutput({writeOut:t=>{z(t)},writeErr:()=>{}}).option("--json","Output JSON instead of TOON; mutations emit a flat receipt with top-level id/status/changed_field_count while reads use documented entity or collection envelopes").option("--lean","Omit null and empty containers from JSON output").option("--token-accounting","Attach a bounded per-section token-cost receipt to command output").option("--output-include <fields>","Retain comma-separated fields or sections in read output").option("--output-limit <count>","Bound rows in read output").option("--output-budget <tokens|unbounded>","Bound estimated tokens in read output or explicitly disable the default ceiling").option("--output-format <toon|json>","Select the result encoding for reads and mutations").option("--output-session <state>","Carry a JSON session budget and served-item ledger across read calls").option("--output-cursor <cursor>","Resume continuation_kind=output_cursor").option("--output-row-contract","Include row selectors, encoding metadata, and read-output receipts").option("--quiet","Suppress stdout output").option("--no-changed-fields","Omit the changed_fields array from mutation output (keeps changed_field_count)").option("--full-changed-fields","Restore the legacy full mutation envelope and changed_fields array").option("--id-only","Print only id and status for single-item mutation output").option("--pm-path <dir>","Explicit tracker storage path for this command (preferred over --path)").option("--path <dir>","Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd").option("--no-extensions","Disable extension loading").option("--no-pager","Disable pager integration for help and long output").option("--explain","Render extended rationale and examples in help output").option("--all","Reveal every public command and compatibility alias").option("--profile","Print deterministic timing diagnostics").option("--author <id>","Override mutation author for this invocation").exitOverride()}(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]="8efedca0-725e-520f-ad06-825a0cccddaa")}catch{}})();var W=new Set(["append","claim","close","close-task","comments","copy","delete","deps","docs","files","focus","get","history","history-compact","history-redact","history-repair","learnings","notes","pause-task","release","restore","start-task","test","update"]),U=new Map([["files","discover"],["item","complete"]]),re=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function j(e){let t=m(e?.trim().toLowerCase()??"");return W.has(t)||U.has(t)}function ae(e,t,n){let o=W.has(n)?t+1:void 0,i=_(e.slice(t+1));if(i===void 0)return o;let r=t+1+i,a=`${n} ${e[r]}`,s=m(a);return s===a?n==="item"&&e[r]==="complete"?r+1:o:j(s)?P(e,r,s):void 0}function P(e,t,n){if(["history","context","ctx","update","close","item"].includes(n))return ae(e,t,n);let o=U.get(n);if(o===void 0)return t+1;let i=e[t+1]?.toLowerCase()===o;return t+(i?2:1)}function le(e){let t=new Map;for(let n of y(e))for(let o of[n.flag,n.short,...n.aliases??[]])o&&t.set(o,n);return t}function ce(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--")break;o==="--id"?(t.push({index:n,consumed:2,value:e[n+1]}),n+=1):o.startsWith("--id=")&&t.push({index:n,consumed:1,value:o.slice(5)})}return t}function ue(e,t,n){if(e.indexOf("=")>=0||t===void 0||t.startsWith("-"))return!1;let o=n.get(e);return o!==void 0&&o.value_type!=="boolean"}function de(e,t,n,o,i){let r=0;for(let a=t;a<e.length;a+=1){let s=e[a];if(s==="--")break;if(s==="--id"){a+=1;continue}if(!s.startsWith("--id=")){if(!s.startsWith("-")){if(a<o)return!0;r+=1;continue}ue(s,e[a+1],i)&&(a+=1)}}return r>(re.get(m(n))??0)}function q(e){let t=_(e),n=t===void 0?void 0:e[t]?.toLowerCase();if(n!=="context"&&n!=="ctx"&&!j(n))return{argv:[...e],changed:!1,conflict:!1};let o=P(e,t,n);if(o===void 0)return{argv:[...e],changed:!1,conflict:!1};let i=o>t+1?`${m(e.slice(t,o-1).join(" "))} ${e[o-1]}`:n,r=le(i),a=ce(e),s=a[0];if(!s||!s.value?.trim())return{argv:[...e],changed:!1,conflict:!1};if(a.length>1||de(e,o,i,s.index,r))return{argv:[...e],changed:!1,conflict:!0,itemId:s.value};let l=[...e.slice(0,s.index),...e.slice(s.index+s.consumed)],c=_(l),u=P(l,c,n);return l.splice(u,0,s.value),{argv:l,changed:!0,conflict:!1,itemId:s.value}}(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]="f05cec18-5e48-5151-8ada-577c9df5885d")}catch{}})();var fe=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),pe=new Set(["toon","json"]);function me(e,t,n){let o=e[t];if(k.has(o))return n.booleanFlags.add(o),1;let i=o.indexOf("="),r=i>0?o.slice(0,i):o;if(!I.has(r))return 1;let a=i>0?o.slice(i+1):void 0,s=a===void 0&&A(r,e[t+1]),l=a??(s?e[t+1]:void 0);return r==="--author"?n.author=l??"":typeof l=="string"&&l.length>0&&(fe.has(r)?n.outputValues:n.pathValues).set(r,l),s?2:1}function he(e){let t={booleanFlags:new Set,outputValues:new Map,pathValues:new Map},n=0;for(;n<e.length&&e[n]!=="--";)n+=me(e,n,t);return{path:t.pathValues.get("--pm-path")??t.pathValues.get("--path"),noExtensions:t.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(J(e)??""),noPager:t.booleanFlags.has("--no-pager"),json:t.booleanFlags.has("--json")?t.outputValues.get("--output-format")!=="toon":t.outputValues.get("--output-format")==="json",quiet:t.booleanFlags.has("--quiet"),lean:t.booleanFlags.has("--lean"),tokenAccounting:t.booleanFlags.has("--token-accounting"),...t.booleanFlags.has("--output-row-contract")?{outputRowContract:!0}:{},...t.outputValues.get("--output-include")===void 0?{}:{outputInclude:t.outputValues.get("--output-include")},...t.outputValues.get("--output-limit")===void 0?{}:{outputLimit:t.outputValues.get("--output-limit")},...t.outputValues.get("--output-budget")===void 0?{}:{outputBudget:t.outputValues.get("--output-budget")},...pe.has(t.outputValues.get("--output-format"))?{outputFormat:t.outputValues.get("--output-format")}:{},...t.outputValues.get("--output-session")===void 0?{}:{outputSession:t.outputValues.get("--output-session")},...t.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:t.outputValues.get("--output-cursor")},...t.author===""?{authorMissingValue:!0}:t.author!==void 0?{author:t.author}:{}}}function X(e){let t=[],n=0;for(;n<e.length;){let o=e[n];if(o==="--")break;if(k.has(o)||o==="--profile"||o==="--id-only"||o==="--full-changed-fields"||o==="--explain"){n+=1;continue}if(I.has(o)){n+=A(o,e[n+1])?2:1;continue}if(D(o)){n+=1;continue}t.push(o),n+=1}return t}function ge(e){let t=X(e);if(t[0]?.trim().toLowerCase()==="help"){let o=[];for(let i=1;i<t.length;i+=1){let r=t[i];if(r.startsWith("-"))break;o.push(r.trim().toLowerCase())}return{requested:!0,commandPathTokens:o}}if(t.findIndex(o=>o==="--help"||o==="-h")<0)return{requested:!1,commandPathTokens:[]};let n=[];for(let o of t){if(o.startsWith("-"))break;n.push(o.trim().toLowerCase())}return{requested:!0,commandPathTokens:n}}function S(e){return _(e)}function be(e){return w(e)}function ye(e,t){return t.noPager?!0:process.stdout.isTTY===!0?!1:ge(e).requested}function ct(e){let t=["PAGER","MANPAGER","GIT_PAGER","LESS"],n=t.map(r=>process.env[r]),o=()=>{for(let[r,a]of t.entries()){let s=n[r];s===void 0?delete process.env[a]:process.env[a]=s}},i=he(e);return ye(e,i)&&(process.env.PAGER="cat",process.env.MANPAGER="cat",process.env.GIT_PAGER="cat",(typeof process.env.LESS!="string"||process.env.LESS.trim().length===0)&&(process.env.LESS="FRX")),o}var _e=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function Ie(e){let t=S(e);if(t===void 0||e[t]!=="extension")return[...e];let n=e[t+1];if(!n||n.startsWith("-"))return[...e];if(!_e.has(n))return[...e];if(e.includes("--help")||e.includes("-h"))return[...e];let o=`--${n}`;return e.includes(o)?[...e]:[...e.slice(0,t+1),o,...e.slice(t+2)]}var we=new Set(["pm","pm-cli"]);function Ce(e,t){let n=S(e);if(n===void 0)return e;let o=e[n];return we.has(o.trim().toLowerCase())?(t.push({from:o,to:[],reason:"executable_alias",confidence:"high"}),[...e.slice(0,n),...e.slice(n+1)]):e}function Te(e,t){let n=S(e);if(n!==void 0&&e[n]==="help"){let s=S(e.slice(n+1));n=s===void 0?void 0:n+1+s}if(n===void 0)return e;let o=e[n],i=L[o.trim().toLowerCase()];if(!i)return e;let r=i.split(" "),a=[...e.slice(0,n),...r,...e.slice(n+1)];return t.push({from:o,to:r,reason:"command_alias",confidence:"high"}),a}function x(e){return e.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function K(e){return x(e).replace(/-/g,"")}function Y(e,t,n){let o=e.get(t);if(o===void 0){e.set(t,n);return}o!==n&&e.set(t,null)}function ke(e){let t=[],n=o=>{typeof o=="string"&&o.startsWith("--")&&t.push(o)};n(e.flag);for(let o of e.aliases??[])n(o);return t}function ve(e,t){let n=t??y(e),o=new Map,i=new Map,r=new Map,a=new Set;for(let s of n){let l=ke(s);if(l.length===0)continue;let c=`--${x(l[0])}`;for(let d of l)Y(o,x(d),c),Y(i,K(d),c);let u=K(c);r.has(c)||r.set(c,u),s.list===!0&&a.add(c)}return{canonicalByNormalized:o,canonicalByCompact:i,canonicalComparables:[...r.entries()].map(([s,l])=>({canonicalFlag:s,comparable:l})),listCanonicalFlags:a}}function Z(e,t){let n=x(e),o=t.canonicalByNormalized.get(n);if(typeof o=="string")return{flag:o,reason:"flag_alias",confidence:"high"};let i=n.replace(/-/g,""),r=t.canonicalByCompact.get(i);if(typeof r=="string")return{flag:r,reason:"flag_alias",confidence:"high"};let a=i.length>=8?2:1,s=Number.POSITIVE_INFINITY,l,c=!1;for(let u of t.canonicalComparables){let d=T(i,u.comparable,a);if(d!==null){if(d<s){s=d,l=u.canonicalFlag,c=!1;continue}d===s&&l!==u.canonicalFlag&&(c=!0)}}return!l||c||!Number.isFinite(s)||s<=0?null:{flag:l,reason:"flag_typo",confidence:s>=2?"medium":"high"}}function ut(e){let t=[`${e}s`];return e.endsWith("y")&&e.length>1&&t.push(`${e.slice(0,-1)}ies`),t}function Se(e,t=!1){if(t||e.includes("://"))return null;let n=e.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!n)return null;let o=n[1],i=n[3];return i.length===0?null:{key:o,value:i}}function xe(e,t,n=!1){if(n||!e.startsWith("--"))return{tokens:[e]};let o=e.indexOf("="),i=o>=0?e.slice(0,o):e,r=o>=0?e.slice(o+1):void 0,a=Z(i,t);if(!a)return{tokens:[e]};let s=r===void 0?a.flag:`${a.flag}=${r}`;return s===e?{tokens:[e]}:{tokens:[s],event:{from:e,to:[s],reason:a.reason,confidence:a.confidence}}}function Oe(e){let t=new Set,n=!1;for(let o=0;o<e.length;o+=1){if(n){t.add(o),n=!1;continue}let i=e[o];n=i==="--path"||i==="--pm-path"}return t}function Ee(e){if(!e.startsWith("--"))return null;let t=e.indexOf("=");return t<0?{flag:e}:{flag:e.slice(0,t),inlineValue:e.slice(t+1)}}function Ae(e,t,n){n.push(e[t]);let o=e[t+1];return typeof o=="string"&&o!=="--"?(n.push(o),t+2):t+1}function Pe(e,t,n,o){if(n.inlineValue!==void 0)return{originalTokens:[e[t]],value:n.inlineValue,consumed:1};let i=[],r=t+1;for(;r<e.length&&e[r]!=="--"&&!e[r].startsWith("-")&&(i.length===0||o.has(n.flag));)i.push(e[r]),r+=1;let a=i.length===0?1:1+i.length;return{originalTokens:e.slice(t,t+a),value:i.length===0?void 0:i.join(","),consumed:a}}function Ne(e,t,n,o){let i=e.get(n);if(i){i.values.push(o.value),i.occurrences+=1;return}e.set(n,{outputIndex:t.length,originalTokens:o.originalTokens,values:[o.value],occurrences:1}),t.push(null)}function Le(e,t){let n=[],o=[];for(let[i,r]of e){if(!(r.occurrences>=2||t.has(i)&&r.originalTokens.length>2)){o.push({outputIndex:r.outputIndex,tokens:r.originalTokens});continue}let a=`${i}=${r.values.join(",")}`;o.push({outputIndex:r.outputIndex,tokens:[a]}),n.push({from:`${i} (x${r.occurrences})`,to:[a],reason:"list_merge",confidence:"high"})}return{events:n,splices:o}}function Me(e,t){t.sort((n,o)=>o.outputIndex-n.outputIndex);for(let n of t)e.splice(n.outputIndex,1,...n.tokens)}function Fe(e,t,n=new Set,o=new Set){if(t.size===0)return{argv:[...e],events:[]};let i=[],r=new Map,a=0;for(;a<e.length;){let c=e[a];if(c==="--"){i.push(...e.slice(a));break}if(n.has(c)){a=Ae(e,a,i);continue}let u=Ee(c);if(!u||!t.has(u.flag)){i.push(c),a+=1;continue}let d=Pe(e,a,u,o);if(d.value===void 0){i.push(c),a+=d.consumed;continue}Ne(r,i,u.flag,{originalTokens:d.originalTokens,value:d.value}),a+=d.consumed}let{events:s,splices:l}=Le(r,o);return Me(i,l),{argv:i,events:s}}var H=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function De(e,t){if(e!=="test"||t.length<2)return!1;let n=t[t.length-1],o=t[t.length-2],i=H.get(o);return i!==void 0&&i.has(n)}function Ve(e,t,n){if(t!=="test")return e;let o=[],i=0;for(;i<e.length;){let r=e[i];if(r==="--")return o.push(...e.slice(i)),o;let a=H.get(r),s=a?e[i+1]:void 0;if(!a||typeof s!="string"||!a.has(s)){o.push(r),i+=1;continue}let l=i+2;for(;l<e.length&&!e[l].startsWith("-");)l+=1;if(l-(i+2)!==1){o.push(r),i+=1;continue}let c=e[i+2],u=`${s}=${c}`;o.push(r,u),n.push({from:`${r} ${s} ${c}`,to:[r,u],reason:"bare_key_value",confidence:"high"}),i+=3}return o}function $e(e,t,n,o){let i=[],r=Oe(e);for(let a=0;a<e.length;a+=1){let s=e[a];if(s==="--"){i.push(...e.slice(a));break}let l=r.has(a),c=i[i.length-1];if(s.startsWith("--")){let h=xe(s,t,l);i.push(...h.tokens),h.event&&o.push(h.event);continue}let u=Se(s,l);if(!u||typeof c=="string"&&c.startsWith("-")&&!c.includes("=")||["search","comments","notes","learnings"].includes(n)||De(n,i)){i.push(s);continue}let d=Z(u.key,t);if(!d){i.push(s);continue}let p=u.value.startsWith("-")?[`${d.flag}=${u.value}`]:[d.flag,u.value];i.push(...p),o.push({from:s,to:p,reason:"bare_key_value",confidence:d.confidence})}return i}function Re(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--verify"){let o=e[t+1];if(o===void 0||o==="--")throw new b("history attest --verify requires a bundle file.",g.USAGE);e.splice(t,2,`--verify=${o}`)}else(I.has(n)||n==="--output"||n==="--hash-algorithm")&&(t+=1)}}function Be(e,t){if(!e.some(o=>o==="--help"||o==="-h"))return;let n=new Set(y(t).flatMap(o=>[o.flag,...o.aliases??[],...o.short===void 0?[]:[o.short]]));for(let o=0;o<e.length;o+=1){let i=e[o];if(i==="--")break;i!=="--help"&&i!=="-h"||n.has(e[o-1])&&!k.has(e[o-1])&&(e[o-1]=i)}}function dt(e){let t=[],n=Ce(e,t),o=Ie(n);(o.length!==n.length||o.some((h,ie)=>h!==n[ie]))&&t.push({from:n.join(" "),to:[...o],reason:"legacy_extension_action",confidence:"high"});let i=Te(o,t),r=q(i);if(r.conflict)throw new b("Provide the item id either positionally or with --id, not both.",g.USAGE);r.changed&&t.push({from:`--id ${r.itemId}`,to:[r.itemId],reason:"item_id_alias",confidence:"high"});let a=be(r.argv),s=J(r.argv),l=m(s??a??""),c=ve(s??a),u=$e(r.argv,c,l,t),d=Ve(u,l,t),p=Fe(d,c.listCanonicalFlags,I,a==="create"?new Set(["--tags"]):new Set);for(let h of p.events)t.push(h);return Be(p.argv,s??a),s==="history attest"&&Re(p.argv),{argv:p.argv,commandName:a,trace:t}}function J(e){let t=X(e),n=t[0]?.trim().toLowerCase(),o=t[1]?.trim().toLowerCase(),i=N(t);return i?i.canonical:(n==="extension"||n==="package"||n==="packages")&&typeof o=="string"&&o.length>0&&!o.startsWith("-")?`${n} ${o}`:n}function ft(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n==="--")break;if(n==="--type"){let o=e[t+1];if(typeof o=="string"&&o.trim().length>0)return o.trim();continue}if(n.startsWith("--type=")){let o=n.slice(7).trim();if(o.length>0)return o}}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fb625cd9-f8a8-56cf-88ab-abef64051497")}catch{}})();function bt(e){if(e===void 0)return()=>{};let t=e.trim();if(t.length===0)throw new b("--author requires a non-empty value.",g.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});let n=G();v(t);let o=!1;return()=>{o||(o=!0,n===void 0?v(void 0):v(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]="d0e60f7e-e0a8-5ef4-9af7-4a1f102ccb7d")}catch{}})();var f=Object.freeze({clock:"PM_CLOCK",tickMs:"PM_CLOCK_TICK_MS",seed:"PM_SEED"});function O(e,t,n,o){return new b(e,g.USAGE,{code:"invalid_reproducible_process_environment",reason:t,field:n,required:`${f.clock} and ${f.seed}; ${f.tickMs} is optional`,nextSteps:[`Set ${f.clock} to an ISO-8601 instant with Z or a numeric UTC offset and ${f.seed} to a non-empty reproducibility seed.`,`Optionally set ${f.tickMs} to a non-negative integer; it defaults to 1.`,"Unset all three variables to retain normal wall-clock and cryptographic-random behavior."],recovery:{recovery_mode:"compact",provided_fields:o,missing_required_fields:t==="incomplete"?[f.clock,f.seed].filter(i=>!o.includes(i)):void 0}})}function ze(e){let t=e[f.clock],n=e[f.tickMs],o=e[f.seed],i=[[f.clock,t],[f.tickMs,n],[f.seed,o]].filter(a=>a[1]!==void 0).map(([a])=>a);if(i.length===0)return;if(t===void 0||o===void 0)throw O("Reproducible process execution requires PM_CLOCK and PM_SEED together.","incomplete",t===void 0?f.clock:f.seed,i);if(o.trim().length===0)throw O(`${f.seed} must not be empty.`,"invalid_value",f.seed,i);if(!B(t))throw O(`${f.clock} must be a valid ISO-8601 instant with Z or a numeric UTC offset.`,"invalid_value",f.clock,i);let r=n===void 0?1:Number(n);if(n?.trim().length===0||!Number.isSafeInteger(r)||r<0)throw O(`${f.tickMs} must be a non-negative integer.`,"invalid_value",f.tickMs,i);return $({clock:t,seed:o,tickMs:r})}function Ge(e){let t=ze(e);return t===void 0?n=>n():R(t)}async function Tt(e,t){return Ge(e)(t)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="54d81daa-9e2e-5b4d-b9f2-93f8d11f9fbc")}catch{}})();var Q=new Set([...Object.values(M),...F,"--full","--brief","--compact","--summary","--fields","--section","--token-budget"]),ee=new Set(["--full-changed-fields","--no-changed-fields","--id-only"]);function We(e,t,n,o){if(t==="--full"&&e==="context"&&n===t)return{consumed:1,replacement:["--depth","full"],conflicts:["--depth","--output-include","--fields","--section","--for"]};if(t==="--depth"&&["list","search"].includes(e)){let i=n.includes("=");return(i?n.slice(n.indexOf("=")+1):o)!=="full"?void 0:{consumed:i?1:2,replacement:["--full"],conflicts:["--full","--brief","--compact","--output-include","--fields","--for"]}}return t==="--toon"&&n===t?{consumed:1,replacement:["--output-format","toon"],conflicts:["--json","--format","--output-format","--stream"]}:void 0}function At(e,t,n){let o=e==="ctx"?"context":m(e);if(!["context","list","search","get"].includes(o)||t.includes("--"))return;let i=w(t);if((i==="ctx"?"context":i)!==o)return;let r=n.split("=",1)[0],a=t.flatMap((p,h)=>p===r||p.startsWith(`${r}=`)?[h]:[]);if(a.length!==1)return;let s=a[0],l=We(o,r,t[s],t[s+1]);if(!l)return;let{replacement:c,consumed:u,conflicts:d}=l;if(!t.some(p=>d.includes(p.split("=",1)[0])))return[...t.slice(0,s),...c,...t.slice(s+u)]}function te(e){let t=e.split("=",1)[0].replaceAll("_","-");return Q.has(t)||t.length>=5&&[...Q].some(n=>n.startsWith(t))}function Pt(e,t){let n=e.split("=",1)[0].replaceAll("_","-");return te(n)?!ee.has(t):ee.has(n)?!te(t):!0}function ne(e){return e.trim().match(/--[a-z0-9][a-z0-9_-]*/i)?.[0]?.replaceAll("_","-").toLowerCase()}function Nt(e){if(!(!Array.isArray(e)||e.length===0))return w(e)}function Ue(e,t){let n=ne(t);if(!n)return;let o=y(e).find(i=>i.flag===n||i.aliases?.includes(n));return o?o.value_type==="boolean"?null:`<${o.value_name??"value"}>`:"<value>"}function Lt(e,t,n){let o=[...e],i=o.indexOf("--"),r=i<0?o.length:i;for(let a of n){let s=ne(a);if(!s||o.slice(0,r).some(u=>u===s||u.startsWith(`${s}=`)))continue;let l=Ue(t,s),c=l?[s,l]:[s];o.splice(r,0,...c),r+=c.length}return o.length===e.length?void 0:V(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]="bd9a8d3b-bc6f-5309-a3fb-7e5f41ef9dab")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="12066389-daef-5fce-b7a6-0ecffa926d66")}catch{}})();function Bt(e,t){let n=e.trim().split(/\s+/u);if(!(n.length<2||t.includes(n.join(" "))))for(let o=1;o<n.length;o+=1){if(!t.includes(n.slice(0,o).join(" ")))return;let i=n.slice(o).join(" "),r=C(i),a=new Set(t.filter(s=>s===i||s.endsWith(` ${i}`)||s===r?.canonical).map(s=>C(s)?.canonical??s).filter(s=>t.includes(s)));if(a.size>0)return a.size===1?[...a][0]:void 0}}var je={add:["create","append"],fetch:["get"],inspect:["get","health"],log:["history","comments","notes"],ls:["list"],pause:["release"],read:["get"],remove:["delete"],rm:["delete"],show:["get"],start:["start-task"]};function oe(e,t){let n=e.trim().toLowerCase(),o=t.trim().toLowerCase();if(o.length===0)return Number.POSITIVE_INFINITY;let i=n.split(" "),r=je[o]?.indexOf(m(n));if(r!==void 0&&r>=0)return r;if(n===o)return 10;if(i.includes(o))return 11;if(i.some(l=>l.startsWith(o)))return 12;let a=o.length>=5?2:1,s=Number.POSITIVE_INFINITY;for(let l of i){let c=T(l,o,a);c!==null&&(s=Math.min(s,c))}return Number.isFinite(s)?20+s:n.includes(o)?30:Number.POSITIVE_INFINITY}function zt(e,t){return e.map(n=>({path:n,score:oe(n,t)})).filter(n=>Number.isFinite(n.score)).sort((n,o)=>n.score!==o.score?n.score-o.score:n.path===o.path?0:n.path<o.path?-1:1).map(n=>n.path)}function Gt(e,t,n){let o=new Set(t),i=E.filter(s=>s.lifecycle==="deprecated").slice().sort((s,l)=>l.alias.length-s.alias.length),r=[],a=e.flatMap(s=>{let l=i.find(u=>s===u.alias||s.startsWith(`${u.alias} `)),c=s;if(l){let u=s.slice(l.alias.length);if(!o.has(`${l.canonical}${u}`))return[];c=`${l.canonical_argv.join(" ")}${u}`}return n!==void 0&&oe(s,n)<10&&r.push(c),[c]});return[...new Set(r.length>0?r:a)]}export{Ye as a,j as b,q as c,he as d,X as e,ge as f,S as g,be as h,ct as i,Ie as j,ut as k,Fe as l,Ve as m,dt as n,ft as o,bt as p,f as q,ze as r,Ge as s,Tt as t,At as u,te as v,Pt as w,Nt as x,Ue as y,Lt as z,Bt as A,oe as B,zt as C,Gt as D};
2
+ //# sourceMappingURL=chunk-HC2DCGFA.js.map
@@ -0,0 +1,2 @@
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="5c8194ff-d877-51b8-bd54-d206f85a979c")}catch{}})();
2
+ //# sourceMappingURL=chunk-IB7UB5TE.js.map