@unbrained/pm-cli 2026.8.14 → 2026.8.15

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 (145) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +25 -2
  3. package/dist/cli/commander-usage.js +17 -4
  4. package/dist/cli/error-guidance.d.ts +2 -0
  5. package/dist/cli/error-guidance.js +52 -25
  6. package/dist/cli/main.js +3 -2
  7. package/dist/cli/register-mutation.js +4 -2
  8. package/dist/cli/register-operations.js +5 -5
  9. package/dist/cli-bundle/bundle-manifest.json +150 -150
  10. package/dist/cli-bundle/chunks/{chunk-TXMEUUUY.js → chunk-24GAV7XL.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-TMJ7URWS.js → chunk-AIM6VT2N.js} +9 -9
  12. package/dist/cli-bundle/chunks/chunk-DSWDLTDR.js +197 -0
  13. package/dist/cli-bundle/chunks/{chunk-FIW4P64F.js → chunk-J42EGKDK.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-KIEGUBYQ.js +2 -0
  15. package/dist/cli-bundle/chunks/{chunk-SBRKH6OR.js → chunk-KLKYLSDX.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-G5JUB66K.js → chunk-LJHOAVGI.js} +59 -59
  17. package/dist/cli-bundle/chunks/{chunk-BFALV3YP.js → chunk-MEM2ZS3O.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-QHPCJWEJ.js +35 -0
  19. package/dist/cli-bundle/chunks/{chunk-XAVMOK6B.js → chunk-WLPDLNEZ.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-list-query-T3EHHNNV.js → register-list-query-CT3LFDDN.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-mutation-E27WCLSZ.js → register-mutation-NWEVA5YS.js} +3 -3
  22. package/dist/cli-bundle/chunks/register-operations-AHIAG5KM.js +2 -0
  23. package/dist/cli-bundle/chunks/{register-setup-3YXZ444E.js → register-setup-ZJZFVAKE.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/chunk-4X57RE4U.js +2 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-XDNAW5OI.js → chunk-6XKF3PGV.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-7NJ4QYQ2.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-WCVE2NIG.js → chunk-EXZA4257.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-ITAUHSO6.js +50 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-4DQ2YERC.js → chunk-KLVUMNXJ.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-K7RWWOAG.js → chunk-KT5XMYSX.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-PPFGQDSI.js → chunk-KTKH4IMG.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-M67F5AIN.js +8 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-KSEDUWVZ.js → chunk-NSPYTG6G.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-OKA6ELTL.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-PUISBOPP.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/chunk-QLNMCESQ.js +155 -0
  37. package/dist/cli-bundle/focused-chunks/{chunk-LZ4MV3RH.js → chunk-SLKC6QLJ.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-U65UC4G3.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-KFSZ3BP6.js → chunk-WTSER4WJ.js} +6 -6
  40. package/dist/cli-bundle/focused-chunks/{chunk-YOOI3UZX.js → chunk-ZMFXQ7VF.js} +2 -2
  41. package/dist/cli-bundle/main.js +13 -13
  42. package/dist/cli-bundle/sdk-authoring.js +1 -1
  43. package/dist/cli-bundle/sdk-contracts.js +1 -1
  44. package/dist/cli-bundle/sdk-core.js +32 -35
  45. package/dist/cli-bundle/sdk-governance.js +1 -1
  46. package/dist/cli-bundle/sdk-graph.js +1 -1
  47. package/dist/cli-bundle/sdk-merge.js +32 -31
  48. package/dist/cli-bundle/sdk-query.js +1 -1
  49. package/dist/cli-bundle/sdk-runtime.js +1 -1
  50. package/dist/cli-bundle/sdk-testing.js +1 -1
  51. package/dist/cli-bundle/sdk.js +2 -2
  52. package/dist/core/diagnostics/remediation.js +7 -2
  53. package/dist/core/extensions/reserved-host-flags.js +3 -2
  54. package/dist/core/history/replay.d.ts +14 -1
  55. package/dist/core/history/replay.js +45 -8
  56. package/dist/core/output/output.d.ts +2 -0
  57. package/dist/core/output/output.js +3 -2
  58. package/dist/core/shared/command-types.d.ts +2 -0
  59. package/dist/core/shared/command-types.js +2 -2
  60. package/dist/core/shared/errors.d.ts +12 -0
  61. package/dist/core/shared/errors.js +2 -2
  62. package/dist/mcp/tool-definitions.js +9 -5
  63. package/dist/sdk/agent/refusal-reachability.d.ts +61 -0
  64. package/dist/sdk/agent/refusal-reachability.js +91 -3
  65. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  66. package/dist/sdk/cli-bootstrap.js +7 -2
  67. package/dist/sdk/cli-contracts/completeness.js +3 -2
  68. package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
  69. package/dist/sdk/cli-contracts/registration-helpers.js +3 -2
  70. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
  71. package/dist/sdk/cli-contracts/runtime-contracts.js +23 -7
  72. package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -5
  73. package/dist/sdk/cli-contracts/tool-schema.js +10 -3
  74. package/dist/sdk/cli-program.js +3 -2
  75. package/dist/sdk/core.d.ts +2 -2
  76. package/dist/sdk/core.js +3 -3
  77. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +26 -2
  78. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -26
  79. package/dist/sdk/governance/assurance-action.d.ts +7 -1
  80. package/dist/sdk/governance/assurance-action.js +7 -6
  81. package/dist/sdk/governance/assurance-mutation-error.d.ts +42 -1
  82. package/dist/sdk/governance/assurance-mutation-error.js +27 -3
  83. package/dist/sdk/governance/assurance-runtime.js +12 -11
  84. package/dist/sdk/governance/assurance.d.ts +9 -0
  85. package/dist/sdk/governance/assurance.js +80 -14
  86. package/dist/sdk/governance/extension-host-version.d.ts +25 -0
  87. package/dist/sdk/governance/extension-host-version.js +105 -0
  88. package/dist/sdk/governance/health.d.ts +32 -1
  89. package/dist/sdk/governance/health.js +119 -27
  90. package/dist/sdk/governance/provenance-health.d.ts +27 -0
  91. package/dist/sdk/governance/provenance-health.js +95 -3
  92. package/dist/sdk/governance/validate.js +7 -8
  93. package/dist/sdk/governance.d.ts +6 -0
  94. package/dist/sdk/governance.js +8 -2
  95. package/dist/sdk/history-repair.d.ts +13 -1
  96. package/dist/sdk/history-repair.js +62 -18
  97. package/dist/sdk/linked-artifacts.js +16 -5
  98. package/dist/sdk/pagination.d.ts +15 -0
  99. package/dist/sdk/pagination.js +9 -5
  100. package/dist/sdk/query/context.d.ts +5 -1
  101. package/dist/sdk/query/context.js +14 -5
  102. package/dist/sdk/read-output/continuation.d.ts +11 -0
  103. package/dist/sdk/read-output/continuation.js +132 -0
  104. package/dist/sdk/read-output-budget.d.ts +1 -1
  105. package/dist/sdk/read-output-budget.js +14 -10
  106. package/dist/sdk/read-output-contracts.d.ts +66 -2
  107. package/dist/sdk/read-output-contracts.js +183 -19
  108. package/dist/sdk/read-output-rows.d.ts +2 -0
  109. package/dist/sdk/read-output-rows.js +15 -2
  110. package/dist/sdk/runtime-input.js +4 -2
  111. package/docs/ASSURANCE.md +59 -2
  112. package/docs/COMMANDS.md +8 -2
  113. package/docs/READ_OUTPUT_CONTRACTS.md +49 -8
  114. package/docs/RELEASING.md +42 -5
  115. package/docs/SDK_CONTEXT_INTEGRITY.md +64 -2
  116. package/marketplace.json +2 -2
  117. package/package.json +3 -3
  118. package/packages/pm-beads/package.json +1 -1
  119. package/packages/pm-calendar/package.json +1 -1
  120. package/packages/pm-command-kit/package.json +1 -1
  121. package/packages/pm-digital-twin/package.json +1 -1
  122. package/packages/pm-governance-audit/package.json +1 -1
  123. package/packages/pm-guide-shell/package.json +1 -1
  124. package/packages/pm-kanban/package.json +1 -1
  125. package/packages/pm-lifecycle-hooks/package.json +1 -1
  126. package/packages/pm-linked-test-adapters/package.json +1 -1
  127. package/packages/pm-search-advanced/package.json +1 -1
  128. package/packages/pm-templates/package.json +1 -1
  129. package/packages/pm-todos/package.json +1 -1
  130. package/packages/pm-vcs/package.json +1 -1
  131. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  132. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  133. package/sdk/public-surface.json +1133 -187
  134. package/dist/cli-bundle/chunks/chunk-BBOFSVAK.js +0 -197
  135. package/dist/cli-bundle/chunks/chunk-YAMTJL6Y.js +0 -34
  136. package/dist/cli-bundle/chunks/chunk-YSVSMJ2B.js +0 -2
  137. package/dist/cli-bundle/chunks/register-operations-4R6I7CPY.js +0 -2
  138. package/dist/cli-bundle/focused-chunks/chunk-F43TT2QQ.js +0 -8
  139. package/dist/cli-bundle/focused-chunks/chunk-KYUQGTSB.js +0 -2
  140. package/dist/cli-bundle/focused-chunks/chunk-PGXJQLCT.js +0 -155
  141. package/dist/cli-bundle/focused-chunks/chunk-Q4YY3XNF.js +0 -2
  142. package/dist/cli-bundle/focused-chunks/chunk-QK753U3U.js +0 -46
  143. package/dist/cli-bundle/focused-chunks/chunk-QUMB2J27.js +0 -2
  144. package/dist/cli-bundle/focused-chunks/chunk-SM7MTG27.js +0 -2
  145. package/dist/cli-bundle/focused-chunks/chunk-ZM6TZVHC.js +0 -2
@@ -1,2 +0,0 @@
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]="294f3a0c-e74d-5963-b966-8a4443855ce3")}catch{}})();var M=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],ke=2,we=Object.freeze({migration:"schema",validation:"schema"}),zt=Object.freeze({version:ke,capabilities:[...M],legacy_aliases:{...we}}),$=["off","warn","enforce"],q=["off","warn","enforce"],W=["none","restricted","strict"],Yt=["block","warn"],H=["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"],J=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function Z(){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]="8b39bc01-0325-5dc6-8492-585c98608076")}catch{}})();var Ne=["Epic","Feature","Task","Chore","Issue","Decision","Event","Reminder","Milestone","Meeting","Plan"],$t=Ne,qt=["draft","open","in_progress","blocked","closed","canceled"],Wt=["draft","active","blocked","terminal","terminal_done","terminal_canceled","default_open","default_close","default_cancel"],Ht=["string","number","boolean","string_array","array","object"],Jt=["create","update","update_many","list","search","calendar","context"],Zt=["allow","warn","reject"],Qt=["blocks","parent","child","parent_child","child_of","related","related_to","discovered_from","blocked_by","incident_from","epic","implements","supersedes","task","verifies"],en=["project","global"],tn=["low","medium","high","critical"],nn=["low","medium","high","critical"],on=["low","medium","high"];var sn=["minimal","default","strict","custom"],rn=["none","warn","strict"],an=["progressive","strict"],cn=["off","warn","strict"],un=["off","warn","strict"];var dn=["daily","weekly","monthly","yearly"],Ie=["mon","tue","wed","thu","fri","sat","sun"];function ln(e){return Ie.indexOf(e)}var _n=["draft","research","review","approved","executing","paused","completed","superseded"],fn=["pending","in_progress","completed","blocked","skipped","superseded"],pn=["codex","claude-code","cursor","generic"],mn=["related","blocks","blocked_by","depends_on","discovered_from","implements","verifies","supersedes"],gn=["brief","standard","deep","full"],En=["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]="36b908f0-ea19-5adc-8ccd-320ad3c3b1fe")}catch{}})();var Re=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"]}]),xe=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),hn=".agents/pm",On="settings.json";var ve=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],Ce=["decisions","events","reminders","milestones","meetings","plans"],Sn=[...ve,...Ce],An={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},De=["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"],Tn=["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",...De,"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"],Me={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}},Le=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],L={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 Q(e){return e?[...e]:void 0}var kn={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"},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:[...Le],lifecycle_closure_like_blocked_reason_patterns:[...L.blocked_reason],lifecycle_closure_like_resolution_patterns:[...L.resolution],lifecycle_closure_like_actual_result_patterns:[...L.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...Me.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!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:Re.map(e=>({...e,aliases:Q(e.aliases),roles:Q(e.roles)})),fields:[],workflow:{...xe},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:Z()},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:"",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:""}}},wn={metadata:{},body:""},m={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},Nn=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]="62fb0ba7-643f-5b33-870b-df875559610a")}catch{}})();var f=class extends Error{exitCode;code;context;constructor(t,n,o={}){super(t),this.name="PmCliError",this.exitCode=n,this.context=o,this.code=o.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]="818ca284-2aaa-5d35-b280-8c963d443b0c")}catch{}})();var Ue=[...M],Pe=[...J],je=[...$],vn=[...q],Cn=[...W],Ve=[...H],k=["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-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"],Dn=["ancestors","descendants","predecessors","successors","paths","impact","analyze","audit","communities","redundancy","dominators","slack","centrality","articulation","plan","index"],Fe=["init","install","uninstall","explore","manage","describe","reload","doctor","catalog","adopt","adopt-all","activate","deactivate"],ee={help:"Commander help rendering has no SDK operation result.",item:"The item namespace only groups lifecycle subcommands already exposed as actions.",packages:"The plural package alias only renders package-oriented help."},te=Object.freeze(k.flatMap(e=>e in ee?[]:e==="extension"||e==="package"?[...Fe.map(t=>`${e}-${t}`),e]:[e]));function Mn(e=k,t=te,n=ee){let o=new Set(t),s=new Set(e);return{missing_cli_actions:e.filter(r=>!o.has(r)&&n[r]===void 0),waived_cli_actions:e.filter(r=>!o.has(r)&&n[r]!==void 0),stale_waivers:Object.keys(n).filter(r=>!s.has(r)||o.has(r))}}function Ln(e){return te.includes(e)}function Un(e){return Ue.includes(e)}function Pn(e){return Pe.includes(e)}function jn(e){return je.includes(e)}function Vn(e){return Ve.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]="03e25a43-f05c-5bc6-a42a-140914e522d5")}catch{}})();var Be=new Set(["applied_bound","completeness","continuation_contract","filters","omission_receipt","output_budget_truncation","projection","read_output","read_session","row_contract","sorting"]);function w(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ge(e,t){let n=e;for(let o of t.split(".")){if(!w(n))return;n=n[o]}return n}function ne(e,t,n){let o=t.split("."),s={...e},r=e,i=s;for(let a of o.slice(0,-1)){let c=r[a],d={...c};i[a]=d,r=c,i=d}return i[o.at(-1)]=n,s}function U(e){let t=e.row_contract;return w(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 y(e){return U(e).flatMap(t=>{let n=Ge(e,t);return Array.isArray(n)||w(n)?[{path:t,value:n}]:[]})}function oe(e){let t=y(e),n=new Set(t.map(s=>s.path)),o=(s,r)=>{if(Array.isArray(s)){n.has(r)||t.push({path:r,value:s}),s.forEach((i,a)=>o(i,`${r}.${a}`));return}if(w(s))for(let[i,a]of Object.entries(s))r.length===0&&Be.has(i)||o(a,r.length===0?i:`${r}.${i}`)};return o(e,""),t}function N(e){return y(e).reduce((t,n)=>t+(Array.isArray(n.value)?n.value.length:Object.keys(n.value).length),0)}function A(e,t){let n=e;for(let o of y(n)){let s=Array.isArray(o.value)?o.value.map((r,i)=>t(r,o.path,i)):Object.fromEntries(Object.entries(o.value).map(([r,i],a)=>[r,t(i,o.path,a)]));n=ne(n,o.path,s)}return n}function se(e,t){let n=e,o=!1;for(let s of y(n)){let r=Array.isArray(s.value)?s.value:Object.entries(s.value);if(r.length<=t)continue;o=!0;let i=Array.isArray(s.value)?r.slice(0,t):Object.fromEntries(r.slice(0,t));n=ne(n,s.path,i)}return{result:n,truncated: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]="642f6dec-c0b2-5377-a401-dfa4f8ef6a2a")}catch{}})();var P=256,j=1e4,Ke=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/u,ze=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u,Ye=new Set(["version","id","token_budget","spent_tokens","seen_item_ids"]),Xe=[{valid:e=>e.version===1,reason:"version must equal 1."},{valid:e=>typeof e.id=="string"&&Ke.test(e.id),reason:"id must be 1-64 portable identifier characters."},{valid:e=>Number.isSafeInteger(e.token_budget)&&e.token_budget>=P,reason:`token_budget must be a safe integer of at least ${P}.`},{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<=j&&e.seen_item_ids.every(t=>typeof t=="string"&&ze.test(t)),reason:`seen_item_ids must contain at most ${j} portable item identifiers.`}];function R(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function I(e){throw new f(`--output-session ${e}`,m.USAGE,{code:"invalid_read_output_session",field:"outputSession"})}function x(e){if(e===void 0)return;let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch{I("must be a valid JSON object.")}R(t)||I("must be a JSON object.");let n=Object.keys(t).filter(r=>!Ye.has(r));n.length>0&&I(`contains unknown field "${n.sort()[0]}".`);let o=Xe.find(r=>!r.valid(t));o!==void 0&&I(o.reason);let s=[...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:s}}function re(e){if(R(e))return typeof e.id=="string"?e.id:typeof e.item_id=="string"?e.item_id:R(e.item)&&typeof e.item.id=="string"?e.item.id:void 0}function $e(e){let t=new Set,n=0;for(let o of y(e)){let s=Array.isArray(o.value)?o.value:Object.values(o.value);for(let r of s){if(!R(r))continue;if(typeof r.context_ref=="string"){n+=1;continue}let i=re(r);i!==void 0&&t.add(i)}}return{deliveredIds:t,suppressedRepeatCount:n}}function ie(e,t){let n=new Set(t.seen_item_ids);return A(e,o=>{let s=re(o);return s!==void 0&&n.has(s)?{id:s,context_ref:`session:${t.id}:${s}`}:o})}function V(e,t){let{deliveredIds:n,suppressedRepeatCount:o}=$e(e),s=new Set(t.seen_item_ids),r=[...n].filter(g=>!s.has(g)).sort(),i=r.slice(0,j-t.seen_item_ids.length),a=[...t.seen_item_ids,...i].sort(),c=r.length-i.length,d={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:n.size,...c===0?{}:{seen_item_overflow_count:c},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:a}},p={...e,read_session:d},u=g=>{d.spent_this_call_tokens=g,d.charged_this_call_tokens=Math.min(t.token_budget-t.spent_tokens,g),d.spent_total_tokens=Math.min(t.token_budget,t.spent_tokens+d.charged_this_call_tokens),d.remaining_tokens=Math.max(0,t.token_budget-d.spent_total_tokens),d.exhausted=d.remaining_tokens<P,d.next_state.spent_tokens=d.spent_total_tokens},l=0,_=0;for(let g=0;g<8;g+=1){u(l);let S=Math.ceil(Buffer.byteLength(JSON.stringify(p),"utf8")/4);if(S===l)return p;_=Math.max(_,S),l=S}return u(_),p}function ae(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]="23b3a820-f205-506b-9507-dbd60087f62e")}catch{}})();var qe=["full","compact","brief","summary","counts"],$n=["mutation","read","discovery","governance"],We=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"]),He=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),Je=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),Ze={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},Qe=3,et=2;function tt(e){let[t=""]=e.trim().split(/\s+/u);return We.has(t)?"mutation":He.has(t)?"discovery":Je.has(t)?"governance":"read"}function ce(e,t=tt(e)){let n=e.trim().replace(/\s+/gu," ");if(n.length===0)throw new TypeError("command must be a non-empty command path");let o=Ze[t];return nt({command:n,budget_class:t,default_max_estimated_tokens:o,default_max_estimated_tokens_by_format:{toon:o,json:Math.ceil(o*Qe/et)},degradation_ladder:qe,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function nt(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 ot=k.map(e=>ce(e)),st=new Map(ot.map(e=>[e.command,e]));function ue(e,t={}){let n=e.trim().replace(/\s+/gu," "),[o]=n.split(" "),s=st.get(o);return s?{...s,command:n}:t.generateFallback?ce(n):null}function qn(e){return Math.ceil(Math.max(0,e)/4)}(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]="cc595424-0176-5920-8f4c-d935e6a546ce")}catch{}})();var rt=8,it=64;function B(e){return Math.ceil(Buffer.byteLength(JSON.stringify(e),"utf8")/4)}function at(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function F(e,t){return typeof e=="string"?e.length<=240?e:(t.compacted=!0,`${e.slice(0,240)}\u2026`):Array.isArray(e)?e.map(n=>F(n,t)):at(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>[n,F(o,t)])):e}function E(e,t){let n=t.estimated_tokens;for(let o=0;o<rt;o+=1){t.estimated_tokens=n;let s=B(e);if(s===n)return;n=s}t.estimated_tokens=n}function ct(e,t,n){for(let o=0;o<it;o+=1){if(E(e,t),t.estimated_tokens<=n)return;let s=oe(e).filter(r=>(Array.isArray(r.value)?r.value.length:Object.keys(r.value).length)>1).map(r=>({collection:r,length:Array.isArray(r.value)?r.value.length:Object.keys(r.value).length})).sort((r,i)=>i.length-r.length||r.collection.path.localeCompare(i.collection.path))[0]?.collection;if(!s)return;if(Array.isArray(s.value))s.value.splice(-Math.max(1,Math.ceil(s.value.length/2)));else{let r=Object.keys(s.value);for(let i of r.slice(-Math.max(1,Math.ceil(r.length/2))))delete s.value[i]}t.rows_compacted=!0,t.compacted_row_paths=[...new Set([...t.compacted_row_paths??[],s.path])].sort((r,i)=>r.localeCompare(i)),e.has_more=!0,e.truncated=!0,typeof e.count=="number"&&(e.count=N(e))}}function de(e,t,n){let o={compacted:!1},s=F(e,o);return t.strings_compacted=o.compacted,s.read_output=t,ct(s,t,n),E(s,t),s}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c78ba845-78ae-5b16-b486-c279f834d601")}catch{}})();var h=["include","amount","cost","encoding"],ge=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","files","docs","stats","aggregate","package-manage","comments-audit","assurance"],Ee=["canonical","legacy","intent","default"],G={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},so=Object.freeze(h.map(e=>G[e])),ro=Object.freeze(["--output-session","--output-row-contract"]),be={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:{},"package-manage":{},"comments-audit":{},assurance:{}},ye=new Set(["--collapse","--fields","--section"]),K=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 z(e){return e.slice(2).replaceAll("-","_")}function ut(e,t){let n=K[e];if(n!==void 0)return n;let o=t==="include"?ye.has(e)?"<csv>":z(e):t==="amount"?"<n>":t==="cost"?"<tokens>":"<toon|json>";return`${e} is a compatibility alias; prefer ${G[t]} ${o}.`}function dt(e){let t=be[e],n=Object.freeze(Object.fromEntries(h.map(o=>[o,Object.freeze({dimension:o,canonical_option:G[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((t[o]??[]).map(s=>Object.freeze({flag:s,semantics:K[s]===void 0?"replacement":"behavior_preserving",migration_hint:ut(s,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:e,dimensions:n,precedence:Ee})}var lt=Object.freeze(ge.map(dt)),_t=new Map(lt.map(e=>[e.command,e]));function Y(e){let t=e.trim().toLowerCase().replaceAll(/\s+/gu," "),n=t==="package manage"||t==="package-manage"?"package-manage":t.split(" ")[0],o=n.startsWith("list-")?"list":n==="ctx"?"context":n;return ge.includes(o)?o:void 0}var ft=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputRowContract","output_row_contract"],pt={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"]};function mt(e){return ft.some(t=>e[t]!==void 0)}var gt=[{keys:["outputInclude","output_include"],valid:e=>v(e)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:e=>e==="unbounded"||O(e)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:e=>e==="unbounded"||O(e)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputFormat","output_format"],valid:e=>e==="toon"||e==="json",message:"--output-format must be toon or json."},{keys:["outputSession","output_session"],valid:e=>(x(e),!0),message:"--output-session must be a valid session-state object."}];function io(e,t){if(!mt(t))return;let n=Y(e);if(!n)throw new f(`Universal output controls apply only to read commands; ${e||"this command"} is not a read surface.`,m.USAGE);if((pt[n]??[]).some(o=>t[o]!==void 0&&t[o]!==!1))throw new f(`Universal output controls cannot be combined with a ${n} mutation.`,m.USAGE);for(let o of gt){let s=o.keys.map(r=>t[r]).find(r=>r!==void 0);if(s!==void 0&&!o.valid(s))throw new f(o.message,m.USAGE)}}function he(e){let t=Y(e);return t?new Map((be[t].include??[]).filter(n=>!ye.has(n)&&K[n]===void 0).map(n=>[z(n),Oe(n)])):new Map}function Et(e,t,n){let o=v(t)??[],s=he(e),r=[],i=[];for(let a of o){let c=s.get(a);if(c===void 0){r.push(a);continue}n[c]=!0,i.push(a)}return{selectors:r,modes:i}}function ao(e,t){let n=t.outputInclude??t.output_include;if(n===void 0)return;let{selectors:o,modes:s}=Et(e,n,t);if(s.length===0)return;let r=o.length>0?o.join(","):void 0;t.outputInclude=r,Object.hasOwn(t,"output_include")&&(t.output_include=r)}function Oe(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}function bt(e,t){let n=Oe(t);if(Object.hasOwn(e,n))return e[n];let o=t.slice(2).replaceAll("-","_");if(Object.hasOwn(e,o))return e[o];if(t==="--no-truncate"&&e.truncate===!1)return!0}function yt(e){return e!==void 0&&e!==!1&&e!==null}function v(e){let n=(Array.isArray(e)?e:[e]).flatMap(o=>typeof o=="string"?o.split(","):[]).map(o=>o.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function O(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 ht(e,t,n){for(let o of e.legacy_aliases){let s=bt(t,o.flag),r={value:s,flag:o.flag};if(yt(s)&&n(r))return r}}function le(e,t){let n=v(e);if(n)return{source:"canonical",value:n};if(t)return{source:"legacy",value:v(t.value)??[z(t.flag)]}}function _e(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=O(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 o=O(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function fe(e,t){if(e==="unbounded")return{source:"canonical",value:"unbounded"};let n=O(e);if(n!==void 0)return{source:"canonical",value:n};if(!t)return;let o=O(t.value);return o===void 0?void 0:{source:"legacy",value:o}}function pe(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 Se(e,t){let n=Y(e);if(!n)return;let o=_t.get(n),s={include:l=>le(void 0,l),amount:l=>_e(void 0,l),cost:l=>fe(void 0,l),encoding:l=>pe(void 0,l)},r=Object.fromEntries(h.map(l=>[l,ht(o.dimensions[l],t,_=>s[l](_)!==void 0)])),i=h.flatMap(l=>{let _=r[l];return _?[_.flag]:[]}),a=h.flatMap(l=>{let _=r[l];return _?[o.dimensions[l].legacy_aliases.find(S=>S.flag===_.flag).migration_hint]:[]}),c=pe(t.outputFormat??t.output_format,r.encoding),d=fe(t.outputBudget??t.output_budget,r.cost),p=ue(e,{generateFallback:!0}),u=c?.value==="json"||t.resolvedOutputFormat==="json"?"json":"toon";return{command:n,include:le(t.outputInclude??t.output_include,r.include),amount:_e(t.outputLimit??t.output_limit,r.amount),cost:d??{source:"default",value:p.default_max_estimated_tokens_by_format[u]},encoding:c,legacy_aliases_used:i,migration_hints:a,precedence:Ee}}function b(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var X=new Set(["applied_bound","applied_limit","completeness","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","row_contract","sorting","total","truncated"]),Ot=["collection_counts","notes_count","tests_count"];function Ae(e,t){let n=new Set(t.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(e).filter(([o])=>n.has(o)))}function St(e){let t=b(e.item)?e.item:{},n=[...new Set([...Object.keys(t),...Ot.filter(s=>Object.hasOwn(t,s))])].sort((s,r)=>s.localeCompare(r)),o=Object.keys(e).filter(s=>s!=="item"&&s!=="read_output"&&!X.has(s)).sort((s,r)=>s.localeCompare(r));return{item:t,itemFields:n,sections:o,valid:[...n,"item",...n.map(s=>`item.${s}`),...o]}}function At(e,t){let n=St(e),o=t.filter(u=>!n.valid.includes(u));if(o.length>0)throw new f(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,m.USAGE);let s=t.includes("item"),r=t.flatMap(u=>u.startsWith("item.")?[u.slice(5)]:n.itemFields.includes(u)?[u]:[]).filter((u,l,_)=>_.indexOf(u)===l);if(s&&r.length>0)throw new f("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",m.USAGE);let i=new Set(t.filter(u=>n.sections.includes(u))),a=Object.fromEntries(Object.entries(e).filter(([u])=>X.has(u)||i.has(u)));s?a.item=n.item:r.length>0&&(a.item=Ae(n.item,r));let c=[...s?[]:r.length>0?n.itemFields.filter(u=>!r.includes(u)).map(u=>({name:`item.${u}`,restore_with:`--output-include item.${u}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(u=>!i.has(u)).map(u=>({name:u,restore_with:`--output-include ${u}`}))],p=[...b(a.omission_receipt)&&Array.isArray(a.omission_receipt.omitted_field_groups)?a.omission_receipt.omitted_field_groups:[],...c];return a.omission_receipt={has_omissions:p.length>0,omitted_field_group_count:p.length,omitted_field_groups:p},a}function me(e){let t=0;return A({...e},n=>(b(n)&&Object.keys(n).length>0&&(t+=1),n)),t}function Tt(e,t,n,o){if(me(t)===0||me(n)>0)return;let s=[...he(e).keys()],r=s.length>0?` Declared ${e} projection modes: ${s.join(", ")}.`:` The ${e} surface declares no projection modes; name row fields instead.`;throw new f(`Unknown --output-include selector(s) for ${e}: ${o.join(", ")}. No selector matched any returned row field.${r}`,m.USAGE)}function kt(e,t,n){if(e==="get")return At(t,n);let o=U(t),s=n.flatMap(i=>o.flatMap(a=>i.startsWith(`${a}.`)?[i.slice(a.length+1)]:[])),r=n.some(i=>Object.hasOwn(t,i.split(".")[0])&&!o.some(a=>i.startsWith(`${a}.`)));if(o.length>0&&(!r||s.length>0)){let i={...t},a=s.length>0?s:n,c=A(i,d=>b(d)?Ae(d,a):d);return Tt(e,t,c,a),c}return Object.fromEntries(Object.entries(t).filter(([i])=>n.some(a=>a.split(".")[0]===i)||X.has(i)))}function wt(e,t){if(t==="unbounded")return e;let{result:n,truncated:o}=se(e,t);return o&&(n.has_more=!0,n.truncated=!0,typeof n.count=="number"&&(n.count=N(n)),n.applied_bound={kind:"output_limit",source:"explicit",value:t}),n}function Nt(e){return h.filter(t=>e[t]!==void 0&&e[t]?.source!=="default")}function C(e,t,n){let o=V(e,t);for(let s=0;s<8;s+=1){let r=n.estimated_tokens,i=o.read_session.spent_this_call_tokens;E(o,n),o=V(o,t);let a=o.read_session.spent_this_call_tokens;if(n.estimated_tokens===r&&a===i)return o}return o}function co(e,t){if(!b(e.read_output))return e;let n=e.read_output,o=x(t.outputSession??t.output_session);return o===void 0?(E(e,n),e):C(e,o,n)}function It(e,t,n){let o={...e};return t.include?.source==="canonical"&&(o=kt(t.command,o,t.include.value)),t.amount?.source==="canonical"&&(o=wt(o,t.amount.value)),n===void 0?o:ie(o,n)}function Rt(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:ae(t)}]].sort((o,s)=>o.tokens-s.tokens)[0]}function xt(e,t,n,o,s){let r={contract_version:1,command:e.command,requested_dimensions:t,...o.source==="default"?{budget_source:o.source,budget_tokens:o.tokens}:{},precedence:e.precedence,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:s}:{}},i={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Increase --output-budget or narrow the read."},read_output:r},a=n===void 0?i:C(i,n,r);if(n===void 0&&E(a,r),n!==void 0&&r.estimated_tokens>o.tokens)throw new f("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",m.USAGE);return a}function vt(e,t,n,o){if(n!==void 0)return!1;let s=t.filter(r=>e[r]?.source==="canonical").length;return e.cost?.value==="unbounded"?s===1:e.cost?.source==="legacy"&&s===0?!0:s===0&&(e.cost===void 0||B(o)<=e.cost.value)}function Ct(e,t,n,o){if(!n.rows_compacted)return;let s=t.amount?.value==="unbounded"?["amount"]:[];e.output_budget_truncation={reason:"output_budget_reached",budget_source:o.source,budget_tokens:o.tokens,overridden_dimensions:s,compacted_row_paths:n.compacted_row_paths,restore_with:"Re-run with --output-budget unbounded for the complete result."}}function uo(e,t,n){let o=Se(e,t);if(!o)return n;let s=x(t.outputSession??t.output_session),r=Nt(o);if(vt(o,r,s,n))return n;let i=Rt(o,s),a=It(n,o,s),c={contract_version:1,command:o.command,requested_dimensions:r,...i?.source==="default"?{budget_source:i.source,budget_tokens:i.tokens}:{},precedence:o.precedence,legacy_aliases_used:o.legacy_aliases_used,migration_hints:o.migration_hints,estimated_tokens:0,within_budget:!0,strings_compacted:!1,rows_compacted:!1,result_omitted:!1};return a.read_output=c,a=s===void 0?a:C(a,s,c),E(a,c),i!==void 0&&c.estimated_tokens>i.tokens&&(a=de(a,c,i.tokens),Ct(a,o,c,i),s!==void 0&&(a=C(a,s,c))),i!==void 0&&c.estimated_tokens>i.tokens?xt(o,r,s,i,c.estimated_tokens):a}function lo(e){return b(e)&&b(e.output_budget_exceeded)&&e.output_budget_exceeded.omitted_result===!0&&e.output_budget_exceeded.reason==="requested_budget_infeasible"}function _o(e,t){let n=Se(e,t)?.encoding;return n?.value==="json"||n?.value==="toon"?n.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]="f6e82c93-54e8-53a7-94df-10a573aae933")}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]="d4493313-8f07-585b-84c7-4141e1d0cba4")}catch{}})();var Dt=Object.freeze([{flag:"--json"},{flag:"--lean"},{flag:"--token-accounting"},{flag:"--output-include",value_name:"fields"},{flag:"--output-limit",value_name:"count"},{flag:"--output-budget",value_name:"tokens"},{flag:"--output-format",value_name:"toon|json"},{flag:"--output-session",value_name:"state"},{flag:"--output-row-contract"},{flag:"--quiet"},{flag:"--no-changed-fields"},{flag:"--full-changed-fields"},{flag:"--id-only"},{flag:"--pm-path",aliases:["--path"]},{flag:"--no-extensions"},{flag:"--no-pager"},{flag:"--profile"},{flag:"--help"},{flag:"--author",value_name:"id"}]),go=new Set(Dt.flatMap(e=>[e.flag,...e.aliases??[]]));import Mt 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]="83232698-197a-5aef-be7c-aa37f3c56822")}catch{}})();function Lt(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 Ut(e){let t=Object.keys(e).sort(),n={};for(let o of t){let s=e[o];s!==void 0&&(n[o]=D(s))}return n}function D(e){let t=Lt(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(o=>D(o));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let o=n.toJSON();if(o!==e)return D(o)}return Ut(e)}function yo(e){return JSON.stringify(D(e))}function Te(e,t,n,o){for(let s=0;s<t.length;s+=1)if(!n.has(s)&&o(e,t[s]))return n.add(s),!0;return!1}function Pt(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function jt(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function Vt(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],o=new Set;for(let s of e)if(!Te(s,n,o,T))return!1;return!0}function Ft(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()],o=new Set;for(let[s,r]of e.entries())if(!Te([s,r],n,o,([a,c],[d,p])=>T(a,d)&&T(c,p)))return!1;return!0}function Bt(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,o)=>T(n,t[o]))}function Gt(e,t){let n=Object.keys(e).sort((s,r)=>s.localeCompare(r)),o=Object.keys(t).sort((s,r)=>s.localeCompare(r));if(n.length!==o.length)return!1;for(let s=0;s<n.length;s+=1){let r=n[s];if(r!==o[s]||!T(e[r],t[r]))return!1}return!0}var Kt=[Pt,jt,Vt,Ft,Bt];function T(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 Kt){let o=n(e,t);if(o!==void 0)return o}return Gt(e,t)}function ho(e){return Mt.createHash("sha256").update(e,"utf8").digest("hex")}function Oo(e,t){let n={};for(let s of t){let r=e[s];r!==void 0&&(n[s]=r)}let o=Object.keys(e).filter(s=>!t.includes(s)).sort((s,r)=>s.localeCompare(r));for(let s of o){let r=e[s];r!==void 0&&(n[s]=r)}return n}export{M as a,ke as b,we as c,zt as d,$ as e,q as f,W as g,Yt as h,H as i,J as j,Z as k,Ne as l,$t as m,qt as n,Wt as o,Ht as p,Jt as q,Zt as r,Qt as s,en as t,tn as u,nn as v,on as w,sn as x,rn as y,an as z,cn as A,un as B,dn as C,Ie as D,ln as E,_n as F,fn as G,pn as H,mn as I,gn as J,En as K,Re as L,xe as M,hn as N,On as O,ve as P,Sn as Q,An as R,Tn as S,Me as T,Le as U,L as V,kn as W,wn as X,m as Y,f as Z,Dt as _,go as $,yo as aa,T as ba,ho as ca,Oo as da,Ue as ea,Pe as fa,je as ga,vn as ha,Cn as ia,Ve as ja,k as ka,Dn as la,Fe as ma,ee as na,te as oa,Mn as pa,Ln as qa,Un as ra,Pn as sa,jn as ta,Vn as ua,j as va,x as wa,ie as xa,V as ya,ae as za,qe as Aa,$n as Ba,tt as Ca,ce as Da,nt as Ea,ot as Fa,ue as Ga,qn as Ha,h as Ia,ge as Ja,so as Ka,ro as La,lt as Ma,Y as Na,io as Oa,he as Pa,Et as Qa,ao as Ra,Se as Sa,co as Ta,uo as Ua,lo as Va,_o as Wa};
2
- //# sourceMappingURL=chunk-Q4YY3XNF.js.map