@unbrained/pm-cli 2026.10.30 → 2026.10.31

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 (235) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +32 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/error-guidance.d.ts +45 -5
  5. package/dist/cli/error-guidance.js +5 -3
  6. package/dist/cli/extension-command-help.d.ts +1 -0
  7. package/dist/cli/extension-command-help.js +2 -2
  8. package/dist/cli/main.d.ts +1 -5
  9. package/dist/cli/main.js +5 -5
  10. package/dist/cli/migration-gates.d.ts +1 -1
  11. package/dist/cli/migration-gates.js +1 -1
  12. package/dist/cli/preflight-warnings.d.ts +11 -0
  13. package/dist/cli/preflight-warnings.js +4 -0
  14. package/dist/cli/register-mutation.js +2 -2
  15. package/dist/cli-bundle/bundle-manifest.json +1 -1
  16. package/dist/cli-bundle/chunks/chunk-24J6TNYE.js +8 -0
  17. package/dist/cli-bundle/chunks/{chunk-EHBGHX55.js → chunk-2AHSPMKJ.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-MVL27TAH.js → chunk-35Q2B2GJ.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-43R7UTWV.js +2 -0
  20. package/dist/cli-bundle/chunks/chunk-6PSDQ7T7.js +8 -0
  21. package/dist/cli-bundle/chunks/{chunk-UUQX3PFD.js → chunk-BS2KXT24.js} +70 -70
  22. package/dist/cli-bundle/chunks/{chunk-Y6NC3X3E.js → chunk-GMBDZID5.js} +3 -3
  23. package/dist/cli-bundle/chunks/chunk-HSBTITO4.js +3 -0
  24. package/dist/cli-bundle/chunks/{chunk-LWW4F4G2.js → chunk-MRUA2Z43.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-P3LNMWL2.js +2 -0
  26. package/dist/cli-bundle/chunks/{chunk-S2U7ECUJ.js → chunk-PT7TS6E7.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-TH5KPAN4.js → chunk-SBVX5CMV.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-4BQD5SW2.js → chunk-TL3O5GZA.js} +30 -30
  29. package/dist/cli-bundle/chunks/chunk-U7JXZMU5.js +6 -0
  30. package/dist/cli-bundle/chunks/{chunk-GRABKNFL.js → chunk-V6EWBTNH.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-VC7TA67O.js +20 -0
  32. package/dist/cli-bundle/chunks/chunk-WNF6FOL7.js +31 -0
  33. package/dist/cli-bundle/chunks/chunk-WRXQAW7Q.js +114 -0
  34. package/dist/cli-bundle/chunks/{chunk-RZQNFHXO.js → chunk-WX25MU4N.js} +3 -3
  35. package/dist/cli-bundle/chunks/chunk-XDDPSWIW.js +2 -0
  36. package/dist/cli-bundle/chunks/chunk-YT5D5HNG.js +2 -0
  37. package/dist/cli-bundle/chunks/chunk-ZTJVOBDU.js +128 -0
  38. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-LHLE7PSG.js → indexed-receipt-blobs-KGMJVFH2.js} +2 -2
  39. package/dist/cli-bundle/chunks/item-transaction-UWV6UNSV.js +2 -0
  40. package/dist/cli-bundle/chunks/{mutation-admission-TRGAVS7N.js → mutation-admission-I4RHIT3Q.js} +2 -2
  41. package/dist/cli-bundle/chunks/{register-list-query-BH4F6M7Z.js → register-list-query-MVDL5EXG.js} +3 -3
  42. package/dist/cli-bundle/chunks/register-mutation-GAF7LXRB.js +20 -0
  43. package/dist/cli-bundle/chunks/register-operations-JLFRL36Q.js +2 -0
  44. package/dist/cli-bundle/chunks/{register-setup-QPWSVHFZ.js → register-setup-MZN6ONB3.js} +2 -2
  45. package/dist/cli-bundle/chunks/{settlement-hook-MN3Y7LVX.js → settlement-hook-YWSWFOZY.js} +2 -2
  46. package/dist/cli-bundle/chunks/{stage-RTB6RAAO.js → stage-2ZORTOF6.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-S23ZUASN.js → chunk-2J7T2UCH.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-4QPGJO2G.js +26 -0
  49. package/dist/cli-bundle/focused-chunks/{chunk-YU7QOYYV.js → chunk-57HPXGOQ.js} +3 -3
  50. package/dist/cli-bundle/focused-chunks/chunk-5MCGYBOQ.js +91 -0
  51. package/dist/cli-bundle/focused-chunks/chunk-6F6APBCX.js +3 -0
  52. package/dist/cli-bundle/focused-chunks/chunk-AFVN2KCP.js +44 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-RKPUQDWF.js → chunk-DFUTCKUF.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-EA65HVBO.js +12 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-GP2WU43K.js +26 -0
  56. package/dist/cli-bundle/focused-chunks/{chunk-YQUZL2CK.js → chunk-HPWT3RBG.js} +3 -3
  57. package/dist/cli-bundle/focused-chunks/chunk-HSAEEWSI.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/{chunk-BPE6JTKL.js → chunk-JLXGRDTG.js} +3 -3
  59. package/dist/cli-bundle/focused-chunks/{chunk-FRFNGMAK.js → chunk-JNKRUCVZ.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-BCIUAEWX.js → chunk-KH5QJXY7.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/chunk-KKRIFBSL.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-RGQEJFXO.js → chunk-MW77Q3AQ.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-NOKG4RFN.js +22 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-POJPJX64.js → chunk-NRBUMDLF.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-3SRX77ES.js → chunk-PC3R5CJV.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{chunk-RYEZSZJ7.js → chunk-PFBQOZPK.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{chunk-SAT7IAEB.js → chunk-QFMJGQGO.js} +3 -3
  68. package/dist/cli-bundle/focused-chunks/{chunk-VFWCSQAG.js → chunk-SFQKCA5K.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/chunk-WHIE2C6Q.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/chunk-Y6UYRMVG.js +6 -0
  71. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-VK2363JB.js → indexed-receipt-blobs-KHWT44EK.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/item-transaction-LU75EG7D.js +2 -0
  73. package/dist/cli-bundle/focused-chunks/{mutation-admission-7VUODEPJ.js → mutation-admission-KDJ7SCPA.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/{settlement-hook-OK6A7PG2.js → settlement-hook-SJV52ZTV.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/{stage-S5RP5SZH.js → stage-R4KEBO37.js} +2 -2
  76. package/dist/cli-bundle/main.js +26 -22
  77. package/dist/cli-bundle/sdk-authoring.js +1 -1
  78. package/dist/cli-bundle/sdk-contracts.js +4 -4
  79. package/dist/cli-bundle/sdk-core.js +1 -1
  80. package/dist/cli-bundle/sdk-governance.js +1 -1
  81. package/dist/cli-bundle/sdk-graph.js +1 -1
  82. package/dist/cli-bundle/sdk-merge.js +57 -57
  83. package/dist/cli-bundle/sdk-query.js +1 -1
  84. package/dist/cli-bundle/sdk-runtime.js +1 -1
  85. package/dist/cli-bundle/sdk-testing.js +1 -1
  86. package/dist/cli-bundle/sdk.js +11 -11
  87. package/dist/core/config/nested-settings.js +1 -1
  88. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  89. package/dist/core/extensions/extension-types.d.ts +4 -0
  90. package/dist/core/extensions/extension-types.js +1 -1
  91. package/dist/core/extensions/loader.js +1 -1
  92. package/dist/core/lock/lock.js +4 -4
  93. package/dist/core/output/output.js +2 -2
  94. package/dist/core/schema/fields-file.js +1 -1
  95. package/dist/core/sentry/helpers.d.ts +6 -0
  96. package/dist/core/sentry/helpers.js +1 -1
  97. package/dist/core/sentry/instrument.d.ts +1 -1
  98. package/dist/core/sentry/instrument.js +1 -1
  99. package/dist/core/shared/constants.js +1 -1
  100. package/dist/core/shared/errors.d.ts +6 -0
  101. package/dist/core/shared/errors.js +1 -1
  102. package/dist/core/shared/output-unicode.d.ts +10 -0
  103. package/dist/core/shared/output-unicode.js +2 -0
  104. package/dist/core/store/settings-validator.d.ts +1 -0
  105. package/dist/core/store/settings-validator.js +1 -1
  106. package/dist/core/store/settings.js +1 -1
  107. package/dist/core/telemetry/policy.d.ts +8 -0
  108. package/dist/core/telemetry/policy.js +1 -1
  109. package/dist/core/telemetry/runtime.js +3 -3
  110. package/dist/sdk/agent/command-recovery.d.ts +15 -0
  111. package/dist/sdk/agent/command-recovery.js +1 -1
  112. package/dist/sdk/cli-bootstrap.js +1 -1
  113. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +28 -0
  114. package/dist/sdk/cli-contracts/agent-output-contracts.js +2 -2
  115. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  116. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  117. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  118. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  119. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  120. package/dist/sdk/cli-contracts.d.ts +1 -1
  121. package/dist/sdk/cli-contracts.js +1 -1
  122. package/dist/sdk/completion/fish.js +4 -4
  123. package/dist/sdk/completion/zsh.js +3 -3
  124. package/dist/sdk/config.d.ts +1 -0
  125. package/dist/sdk/config.js +1 -1
  126. package/dist/sdk/core.d.ts +1 -0
  127. package/dist/sdk/core.js +1 -1
  128. package/dist/sdk/error-runtime.d.ts +9 -0
  129. package/dist/sdk/error-runtime.js +1 -1
  130. package/dist/sdk/errors.js +1 -1
  131. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  132. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  133. package/dist/sdk/index.d.ts +2 -2
  134. package/dist/sdk/index.js +1 -1
  135. package/dist/sdk/lifecycle/claim.js +1 -1
  136. package/dist/sdk/lifecycle/close.js +1 -1
  137. package/dist/sdk/lifecycle/create.js +1 -1
  138. package/dist/sdk/lifecycle/plan.d.ts +2 -3
  139. package/dist/sdk/lifecycle/plan.js +1 -1
  140. package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +45 -0
  141. package/dist/sdk/lifecycle/repeated-terminal-state.js +2 -0
  142. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +9 -0
  143. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  144. package/dist/sdk/lifecycle/update-many.d.ts +0 -1
  145. package/dist/sdk/lifecycle/update-many.js +1 -1
  146. package/dist/sdk/lifecycle/update.d.ts +29 -1
  147. package/dist/sdk/lifecycle/update.js +2 -2
  148. package/dist/sdk/output/table-rows.d.ts +7 -1
  149. package/dist/sdk/output/table-rows.js +1 -1
  150. package/dist/sdk/output.d.ts +1 -0
  151. package/dist/sdk/output.js +2 -2
  152. package/dist/sdk/ownership-source.d.ts +18 -0
  153. package/dist/sdk/ownership-source.js +1 -1
  154. package/dist/sdk/public-surface.json +1 -1
  155. package/dist/sdk/query/get.d.ts +1 -1
  156. package/dist/sdk/query/get.js +1 -1
  157. package/dist/sdk/query/next-ranking-policy.d.ts +35 -0
  158. package/dist/sdk/query/next-ranking-policy.js +2 -0
  159. package/dist/sdk/query/next.d.ts +12 -2
  160. package/dist/sdk/query/next.js +2 -2
  161. package/dist/sdk/query/projection-contracts.d.ts +4 -0
  162. package/dist/sdk/query/projection-contracts.js +1 -1
  163. package/dist/sdk/read-output/surfaces.d.ts +27 -0
  164. package/dist/sdk/read-output/surfaces.js +2 -0
  165. package/dist/sdk/read-output-contracts.js +1 -1
  166. package/dist/sdk/runtime-primitives.d.ts +1 -0
  167. package/dist/sdk/runtime-primitives.js +1 -1
  168. package/dist/sdk/runtime.js +1 -1
  169. package/dist/sdk/test/execution-receipts.d.ts +25 -0
  170. package/dist/sdk/test/execution-receipts.js +2 -2
  171. package/dist/sdk/test/execution.d.ts +5 -0
  172. package/dist/sdk/test/execution.js +2 -2
  173. package/dist/types.d.ts +2 -0
  174. package/dist/types.js +1 -1
  175. package/docs/AGENT_GUIDE.md +1 -1
  176. package/docs/AGENT_OUTPUT_ENCODINGS.md +12 -0
  177. package/docs/AGENT_UX_CONTRACTS.md +2 -1
  178. package/docs/COMMANDS.md +58 -5
  179. package/docs/CONFIGURATION.md +48 -1
  180. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +26 -0
  181. package/docs/PACKED_FIRST_RUN.md +2 -1
  182. package/docs/READ_OUTPUT_CONTRACTS.md +24 -6
  183. package/docs/SDK.md +73 -2
  184. package/docs/TESTING.md +38 -2
  185. package/docs/agent-task-token-baseline.json +1 -1
  186. package/marketplace.json +1 -1
  187. package/package.json +1 -1
  188. package/packages/pm-beads/package.json +1 -1
  189. package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
  190. package/packages/pm-calendar/package.json +1 -1
  191. package/packages/pm-command-kit/package.json +1 -1
  192. package/packages/pm-digital-twin/package.json +1 -1
  193. package/packages/pm-governance-audit/package.json +1 -1
  194. package/packages/pm-guide-shell/package.json +1 -1
  195. package/packages/pm-kanban/package.json +1 -1
  196. package/packages/pm-lifecycle-hooks/package.json +1 -1
  197. package/packages/pm-linked-test-adapters/package.json +1 -1
  198. package/packages/pm-search-advanced/package.json +1 -1
  199. package/packages/pm-templates/package.json +1 -1
  200. package/packages/pm-todos/package.json +1 -1
  201. package/packages/pm-vcs/package.json +1 -1
  202. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  203. package/plugins/pm-claude/package.json +1 -1
  204. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  205. package/plugins/pm-codex/package.json +1 -1
  206. package/plugins/pm-codex/plugin.json +1 -1
  207. package/runtime-dependencies.json +1 -1
  208. package/dist/cli-bundle/chunks/chunk-34MP7WKK.js +0 -6
  209. package/dist/cli-bundle/chunks/chunk-3KMYHYJV.js +0 -2
  210. package/dist/cli-bundle/chunks/chunk-42BHHNTL.js +0 -128
  211. package/dist/cli-bundle/chunks/chunk-I5O3XZOA.js +0 -2
  212. package/dist/cli-bundle/chunks/chunk-LEIVUGDH.js +0 -8
  213. package/dist/cli-bundle/chunks/chunk-OH7WPD42.js +0 -114
  214. package/dist/cli-bundle/chunks/chunk-OOD2A7AF.js +0 -20
  215. package/dist/cli-bundle/chunks/chunk-Q5V7P6NM.js +0 -2
  216. package/dist/cli-bundle/chunks/chunk-QLPFYBXN.js +0 -2
  217. package/dist/cli-bundle/chunks/chunk-SA5NYLPE.js +0 -8
  218. package/dist/cli-bundle/chunks/chunk-VHLAVTJN.js +0 -31
  219. package/dist/cli-bundle/chunks/chunk-XAOVJG52.js +0 -3
  220. package/dist/cli-bundle/chunks/chunk-XPQ4RTSF.js +0 -2
  221. package/dist/cli-bundle/chunks/item-transaction-WIOBZW4E.js +0 -2
  222. package/dist/cli-bundle/chunks/register-mutation-5V2NANIS.js +0 -20
  223. package/dist/cli-bundle/chunks/register-operations-XSFRMUFX.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-2V6NMNYN.js +0 -26
  225. package/dist/cli-bundle/focused-chunks/chunk-ASHGXMX4.js +0 -3
  226. package/dist/cli-bundle/focused-chunks/chunk-CKBN2D42.js +0 -12
  227. package/dist/cli-bundle/focused-chunks/chunk-I642DXOT.js +0 -22
  228. package/dist/cli-bundle/focused-chunks/chunk-K7DKG5HM.js +0 -91
  229. package/dist/cli-bundle/focused-chunks/chunk-NMQBXU7N.js +0 -44
  230. package/dist/cli-bundle/focused-chunks/chunk-PGM3ENGZ.js +0 -2
  231. package/dist/cli-bundle/focused-chunks/chunk-QFNV4JTA.js +0 -6
  232. package/dist/cli-bundle/focused-chunks/chunk-QVJCQMZY.js +0 -26
  233. package/dist/cli-bundle/focused-chunks/chunk-R2TPPPVU.js +0 -2
  234. package/dist/cli-bundle/focused-chunks/chunk-VJVJ2ZX2.js +0 -2
  235. package/dist/cli-bundle/focused-chunks/item-transaction-ZFDKJIP7.js +0 -2
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f05cec18-5e48-5151-8ada-577c9df5885d")}catch{}})();import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,renderPmCommandAliasMigrationHint,resolvePmCommandAlias}from"./cli-contracts/command-aliases.js";import{resolveSubcommandFlagContractsForCommand}from"./cli-contracts/flag-contracts.js";import{levenshteinDistanceWithinLimit}from"../core/shared/levenshtein.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{findPmNamespacedCommand,resolvePmCommandOperation}from"./cli-contracts/command-aliases.js";import{normalizeItemAddressInvocation}from"./agent/item-addressing.js";import{BOOTSTRAP_BOOLEAN_FLAGS,GLOBAL_VALUE_CONSUMING_FLAGS,consumesBootstrapValue,findBootstrapCommandTokenIndex as findContractBootstrapCommandTokenIndex,isInlineGlobalValueToken,parseBootstrapCommandName as parseContractBootstrapCommandName}from"./cli-contracts/bootstrap-command-scanner.js";const OUTPUT_VALUE_FLAGS=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),BOOTSTRAP_OUTPUT_ENCODINGS=new Set(["toon","json"]);function consumeBootstrapGlobalToken(argv,index,state){const token=argv[index];if(BOOTSTRAP_BOOLEAN_FLAGS.has(token))return state.booleanFlags.add(token),1;const equalsIndex=token.indexOf("="),canonicalFlag=equalsIndex>0?token.slice(0,equalsIndex):token;if(!GLOBAL_VALUE_CONSUMING_FLAGS.has(canonicalFlag))return 1;const inlineValue=equalsIndex>0?token.slice(equalsIndex+1):void 0,consumesValue=inlineValue===void 0&&consumesBootstrapValue(canonicalFlag,argv[index+1]),value=inlineValue??(consumesValue?argv[index+1]:void 0);return canonicalFlag==="--author"?state.author=value??"":typeof value=="string"&&value.length>0&&(OUTPUT_VALUE_FLAGS.has(canonicalFlag)?state.outputValues:state.pathValues).set(canonicalFlag,value),consumesValue?2:1}function parseBootstrapGlobalOptions(argv){const state={booleanFlags:new Set,outputValues:new Map,pathValues:new Map};let index=0;for(;index<argv.length&&argv[index]!=="--";)index+=consumeBootstrapGlobalToken(argv,index,state);return{path:state.pathValues.get("--pm-path")??state.pathValues.get("--path"),noExtensions:state.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(parseBootstrapCommandPathName(argv)??""),noPager:state.booleanFlags.has("--no-pager"),json:state.booleanFlags.has("--json")?state.outputValues.get("--output-format")!=="toon":state.outputValues.get("--output-format")==="json",quiet:state.booleanFlags.has("--quiet"),lean:state.booleanFlags.has("--lean"),tokenAccounting:state.booleanFlags.has("--token-accounting"),...state.booleanFlags.has("--output-row-contract")?{outputRowContract:!0}:{},...state.outputValues.get("--output-include")===void 0?{}:{outputInclude:state.outputValues.get("--output-include")},...state.outputValues.get("--output-limit")===void 0?{}:{outputLimit:state.outputValues.get("--output-limit")},...state.outputValues.get("--output-budget")===void 0?{}:{outputBudget:state.outputValues.get("--output-budget")},...BOOTSTRAP_OUTPUT_ENCODINGS.has(state.outputValues.get("--output-format"))?{outputFormat:state.outputValues.get("--output-format")}:{},...state.outputValues.get("--output-session")===void 0?{}:{outputSession:state.outputValues.get("--output-session")},...state.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:state.outputValues.get("--output-cursor")},...state.author===""?{authorMissingValue:!0}:state.author!==void 0?{author:state.author}:{}}}function stripGlobalBootstrapTokens(argv){const remaining=[];let index=0;for(;index<argv.length;){const token=argv[index];if(token==="--")break;if(BOOTSTRAP_BOOLEAN_FLAGS.has(token)||token==="--profile"||token==="--id-only"||token==="--full-changed-fields"||token==="--explain"){index+=1;continue}if(GLOBAL_VALUE_CONSUMING_FLAGS.has(token)){index+=consumesBootstrapValue(token,argv[index+1])?2:1;continue}if(isInlineGlobalValueToken(token)){index+=1;continue}remaining.push(token),index+=1}return remaining}function parseBootstrapHelpRequest(argv){const stripped=stripGlobalBootstrapTokens(argv);if(stripped[0]?.trim().toLowerCase()==="help"){const commandPathTokens2=[];for(let index=1;index<stripped.length;index+=1){const token=stripped[index];if(token.startsWith("-"))break;commandPathTokens2.push(token.trim().toLowerCase())}return{requested:!0,commandPathTokens:commandPathTokens2}}if(stripped.findIndex(token=>token==="--help"||token==="-h")<0)return{requested:!1,commandPathTokens:[]};const commandPathTokens=[];for(const token of stripped){if(token.startsWith("-"))break;commandPathTokens.push(token.trim().toLowerCase())}return{requested:!0,commandPathTokens}}function findBootstrapCommandTokenIndex(argv){return findContractBootstrapCommandTokenIndex(argv)}function parseBootstrapCommandName(argv){return parseContractBootstrapCommandName(argv)}function shouldDisablePagerForInvocation(argv,bootstrapGlobal){return bootstrapGlobal.noPager?!0:process.stdout.isTTY===!0?!1:parseBootstrapHelpRequest(argv).requested}function applyBootstrapPagerPolicy(argv){const pagerEnvironmentKeys=["PAGER","MANPAGER","GIT_PAGER","LESS"],previousValues=pagerEnvironmentKeys.map(key=>process.env[key]),restore=()=>{for(const[index,key]of pagerEnvironmentKeys.entries()){const value=previousValues[index];value===void 0?delete process.env[key]:process.env[key]=value}},bootstrapGlobal=parseBootstrapGlobalOptions(argv);return shouldDisablePagerForInvocation(argv,bootstrapGlobal)&&(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")),restore}const EXTENSION_ACTION_SYNTAX_TOKENS=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function normalizeLegacyExtensionActionSyntax(argv){const extensionIndex=findBootstrapCommandTokenIndex(argv);if(extensionIndex===void 0||argv[extensionIndex]!=="extension")return[...argv];const actionToken=argv[extensionIndex+1];if(!actionToken||actionToken.startsWith("-"))return[...argv];if(!EXTENSION_ACTION_SYNTAX_TOKENS.has(actionToken))return[...argv];if(argv.includes("--help")||argv.includes("-h"))return[...argv];const forcedActionFlag=`--${actionToken}`;return argv.includes(forcedActionFlag)?[...argv]:[...argv.slice(0,extensionIndex+1),forcedActionFlag,...argv.slice(extensionIndex+2)]}const CLI_EXECUTABLE_ALIASES=new Set(["pm","pm-cli"]);function stripLeadingExecutableAlias(argv,trace){const index=findBootstrapCommandTokenIndex(argv);if(index===void 0)return argv;const token=argv[index];return CLI_EXECUTABLE_ALIASES.has(token.trim().toLowerCase())?(trace.push({from:token,to:[],reason:"executable_alias",confidence:"high"}),[...argv.slice(0,index),...argv.slice(index+1)]):argv}function rewriteCommandAlias(argv,trace){let index=findBootstrapCommandTokenIndex(argv);if(index!==void 0&&argv[index]==="help"){const offset=findBootstrapCommandTokenIndex(argv.slice(index+1));index=offset===void 0?void 0:index+1+offset}if(index===void 0)return argv;const token=argv[index],canonical=EXECUTABLE_COMMAND_ALIASES[token.trim().toLowerCase()];if(!canonical)return argv;const canonicalTokens=canonical.split(" "),rewritten=[...argv.slice(0,index),...canonicalTokens,...argv.slice(index+1)];return trace.push({from:token,to:canonicalTokens,reason:"command_alias",confidence:"high"}),rewritten}function normalizeFlagKeyToken(raw){return raw.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function toComparableFlagKey(raw){return normalizeFlagKeyToken(raw).replace(/-/g,"")}function markUnambiguousFlag(map,key,canonicalFlag){const existing=map.get(key);if(existing===void 0){map.set(key,canonicalFlag);return}existing!==canonicalFlag&&map.set(key,null)}function collectLongFlagCandidates(contract){const candidates=[],pushLongFlag=value=>{typeof value=="string"&&value.startsWith("--")&&candidates.push(value)};pushLongFlag(contract.flag);for(const alias of contract.aliases??[])pushLongFlag(alias);return candidates}function buildFlagLookup(commandName,contractsOverride){const contracts=contractsOverride??resolveSubcommandFlagContractsForCommand(commandName),canonicalByNormalized=new Map,canonicalByCompact=new Map,canonicalComparablesMap=new Map,listCanonicalFlags=new Set;for(const contract of contracts){const longCandidates=collectLongFlagCandidates(contract);if(longCandidates.length===0)continue;const canonicalFlag=`--${normalizeFlagKeyToken(longCandidates[0])}`;for(const candidate of longCandidates)markUnambiguousFlag(canonicalByNormalized,normalizeFlagKeyToken(candidate),canonicalFlag),markUnambiguousFlag(canonicalByCompact,toComparableFlagKey(candidate),canonicalFlag);const comparable=toComparableFlagKey(canonicalFlag);canonicalComparablesMap.has(canonicalFlag)||canonicalComparablesMap.set(canonicalFlag,comparable),contract.list===!0&&listCanonicalFlags.add(canonicalFlag)}return{canonicalByNormalized,canonicalByCompact,canonicalComparables:[...canonicalComparablesMap.entries()].map(([canonicalFlag,comparable])=>({canonicalFlag,comparable})),listCanonicalFlags}}function resolveCanonicalFlag(rawKey,lookup){const normalizedKey=normalizeFlagKeyToken(rawKey),direct=lookup.canonicalByNormalized.get(normalizedKey);if(typeof direct=="string")return{flag:direct,reason:"flag_alias",confidence:"high"};const comparableKey=normalizedKey.replace(/-/g,""),compactMatch=lookup.canonicalByCompact.get(comparableKey);if(typeof compactMatch=="string")return{flag:compactMatch,reason:"flag_alias",confidence:"high"};const maxDistance=comparableKey.length>=8?2:1;let bestDistance=Number.POSITIVE_INFINITY,bestFlag,tied=!1;for(const candidate of lookup.canonicalComparables){const distance=levenshteinDistanceWithinLimit(comparableKey,candidate.comparable,maxDistance);if(distance!==null){if(distance<bestDistance){bestDistance=distance,bestFlag=candidate.canonicalFlag,tied=!1;continue}distance===bestDistance&&bestFlag!==candidate.canonicalFlag&&(tied=!0)}}return!bestFlag||tied||!Number.isFinite(bestDistance)||bestDistance<=0?null:{flag:bestFlag,reason:"flag_typo",confidence:bestDistance>=2?"medium":"high"}}function listAliasPluralKeys(normalizedKey){const candidates=[`${normalizedKey}s`];return normalizedKey.endsWith("y")&&normalizedKey.length>1&&candidates.push(`${normalizedKey.slice(0,-1)}ies`),candidates}function parseBareKeyValueToken(token,preserve=!1){if(preserve||token.includes("://"))return null;const match=token.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!match)return null;const key=match[1],value=match[3];return value.length===0?null:{key,value}}function normalizeLongOptionToken(token,lookup,preserve=!1){if(preserve||!token.startsWith("--"))return{tokens:[token]};const equalsIndex=token.indexOf("="),key=equalsIndex>=0?token.slice(0,equalsIndex):token,inlineValue=equalsIndex>=0?token.slice(equalsIndex+1):void 0,resolution=resolveCanonicalFlag(key,lookup);if(!resolution)return{tokens:[token]};const normalizedToken=inlineValue===void 0?resolution.flag:`${resolution.flag}=${inlineValue}`;return normalizedToken===token?{tokens:[token]}:{tokens:[normalizedToken],event:{from:token,to:[normalizedToken],reason:resolution.reason,confidence:resolution.confidence}}}function collectBootstrapPathValueIndices(argv){const indices=new Set;let expectsValue=!1;for(let index=0;index<argv.length;index+=1){if(expectsValue){indices.add(index),expectsValue=!1;continue}const token=argv[index];expectsValue=token==="--path"||token==="--pm-path"}return indices}function splitCanonicalListToken(token){if(!token.startsWith("--"))return null;const equalsIndex=token.indexOf("=");return equalsIndex<0?{flag:token}:{flag:token.slice(0,equalsIndex),inlineValue:token.slice(equalsIndex+1)}}function copyValueConsumingFlag(argv,index,result){result.push(argv[index]);const next=argv[index+1];return typeof next=="string"&&next!=="--"?(result.push(next),index+2):index+1}function readListFlagOccurrence(argv,index,parsed,multiValueListFlags){if(parsed.inlineValue!==void 0)return{originalTokens:[argv[index]],value:parsed.inlineValue,consumed:1};const values=[];let valueIndex=index+1;for(;valueIndex<argv.length&&argv[valueIndex]!=="--"&&!argv[valueIndex].startsWith("-")&&(values.length===0||multiValueListFlags.has(parsed.flag));)values.push(argv[valueIndex]),valueIndex+=1;const consumed=values.length===0?1:1+values.length;return{originalTokens:argv.slice(index,index+consumed),value:values.length===0?void 0:values.join(","),consumed}}function recordListFlagOccurrence(slots,result,flag,occurrence){const existing=slots.get(flag);if(existing){existing.values.push(occurrence.value),existing.occurrences+=1;return}slots.set(flag,{outputIndex:result.length,originalTokens:occurrence.originalTokens,values:[occurrence.value],occurrences:1}),result.push(null)}function buildListFlagCoalescingSplices(slots,multiValueListFlags){const events=[],splices=[];for(const[flag,slot]of slots){if(!(slot.occurrences>=2||multiValueListFlags.has(flag)&&slot.originalTokens.length>2)){splices.push({outputIndex:slot.outputIndex,tokens:slot.originalTokens});continue}const mergedToken=`${flag}=${slot.values.join(",")}`;splices.push({outputIndex:slot.outputIndex,tokens:[mergedToken]}),events.push({from:`${flag} (x${slot.occurrences})`,to:[mergedToken],reason:"list_merge",confidence:"high"})}return{events,splices}}function applyListFlagSplices(result,splices){splices.sort((a,b)=>b.outputIndex-a.outputIndex);for(const splice of splices)result.splice(splice.outputIndex,1,...splice.tokens)}function coalesceRepeatedListFlags(argv,listFlags,valueConsumingFlags=new Set,multiValueListFlags=new Set){if(listFlags.size===0)return{argv:[...argv],events:[]};const result=[],slots=new Map;let index=0;for(;index<argv.length;){const token=argv[index];if(token==="--"){result.push(...argv.slice(index));break}if(valueConsumingFlags.has(token)){index=copyValueConsumingFlag(argv,index,result);continue}const parsed=splitCanonicalListToken(token);if(!parsed||!listFlags.has(parsed.flag)){result.push(token),index+=1;continue}const occurrence=readListFlagOccurrence(argv,index,parsed,multiValueListFlags);if(occurrence.value===void 0){result.push(token),index+=occurrence.consumed;continue}recordListFlagOccurrence(slots,result,parsed.flag,{originalTokens:occurrence.originalTokens,value:occurrence.value}),index+=occurrence.consumed}const{events,splices}=buildListFlagCoalescingSplices(slots,multiValueListFlags);return applyListFlagSplices(result,splices),{argv:result,events}}const LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function isLinkedTestTwoTokenValuePosition(commandName,emittedTokens){if(commandName!=="test"||emittedTokens.length<2)return!1;const key=emittedTokens[emittedTokens.length-1],flag=emittedTokens[emittedTokens.length-2],keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(flag);return keys!==void 0&&keys.has(key)}function mergeLinkedTestTwoTokenEntries(argv,commandName,trace){if(commandName!=="test")return argv;const result=[];let index=0;for(;index<argv.length;){const token=argv[index];if(token==="--")return result.push(...argv.slice(index)),result;const keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(token),key=keys?argv[index+1]:void 0;if(!keys||typeof key!="string"||!keys.has(key)){result.push(token),index+=1;continue}let runEnd=index+2;for(;runEnd<argv.length&&!argv[runEnd].startsWith("-");)runEnd+=1;if(runEnd-(index+2)!==1){result.push(token),index+=1;continue}const value=argv[index+2],mergedValue=`${key}=${value}`;result.push(token,mergedValue),trace.push({from:`${token} ${key} ${value}`,to:[token,mergedValue],reason:"bare_key_value",confidence:"high"}),index+=3}return result}function normalizeBootstrapTokens(argv,lookup,commandName,trace){const normalizedArgv=[],pathValueIndices=collectBootstrapPathValueIndices(argv);for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--"){normalizedArgv.push(...argv.slice(index));break}const preserveCurrentToken=pathValueIndices.has(index),previous=normalizedArgv[normalizedArgv.length-1];if(token.startsWith("--")){const normalizedToken=normalizeLongOptionToken(token,lookup,preserveCurrentToken);normalizedArgv.push(...normalizedToken.tokens),normalizedToken.event&&trace.push(normalizedToken.event);continue}const bareKeyValue=parseBareKeyValueToken(token,preserveCurrentToken);if(!bareKeyValue||typeof previous=="string"&&previous.startsWith("-")&&!previous.includes("=")||["search","comments","notes","learnings"].includes(commandName)||isLinkedTestTwoTokenValuePosition(commandName,normalizedArgv)){normalizedArgv.push(token);continue}const resolution=resolveCanonicalFlag(bareKeyValue.key,lookup);if(!resolution){normalizedArgv.push(token);continue}const replacement=bareKeyValue.value.startsWith("-")?[`${resolution.flag}=${bareKeyValue.value}`]:[resolution.flag,bareKeyValue.value];normalizedArgv.push(...replacement),trace.push({from:token,to:replacement,reason:"bare_key_value",confidence:resolution.confidence})}return normalizedArgv}function bindAttestationVerification(argv){for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--verify"){const value=argv[index+1];if(value===void 0||value==="--")throw new PmCliError("history attest --verify requires a bundle file.",EXIT_CODE.USAGE);argv.splice(index,2,`--verify=${value}`)}else(GLOBAL_VALUE_CONSUMING_FLAGS.has(token)||token==="--output"||token==="--hash-algorithm")&&(index+=1)}}function protectBootstrapHelpDiscovery(argv,command){if(!argv.some(token=>token==="--help"||token==="-h"))return;const declaredFlags=new Set(resolveSubcommandFlagContractsForCommand(command).flatMap(contract=>[contract.flag,...contract.aliases??[],...contract.short===void 0?[]:[contract.short]]));for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;token!=="--help"&&token!=="-h"||declaredFlags.has(argv[index-1])&&!BOOTSTRAP_BOOLEAN_FLAGS.has(argv[index-1])&&(argv[index-1]=token)}}function normalizeBootstrapInvocation(argv){const trace=[],executableNormalized=stripLeadingExecutableAlias(argv,trace),legacyNormalized=normalizeLegacyExtensionActionSyntax(executableNormalized);(legacyNormalized.length!==executableNormalized.length||legacyNormalized.some((token,index)=>token!==executableNormalized[index]))&&trace.push({from:executableNormalized.join(" "),to:[...legacyNormalized],reason:"legacy_extension_action",confidence:"high"});const aliasNormalized=rewriteCommandAlias(legacyNormalized,trace),itemAddress=normalizeItemAddressInvocation(aliasNormalized);if(itemAddress.conflict)throw new PmCliError("Provide the item id either positionally or with --id, not both.",EXIT_CODE.USAGE);itemAddress.changed&&trace.push({from:`--id ${itemAddress.itemId}`,to:[itemAddress.itemId],reason:"item_id_alias",confidence:"high"});const commandName=parseBootstrapCommandName(itemAddress.argv),commandPathName=parseBootstrapCommandPathName(itemAddress.argv),operationName=resolvePmCommandOperation(commandPathName??commandName??""),lookup=buildFlagLookup(commandPathName??commandName),normalizedArgv=normalizeBootstrapTokens(itemAddress.argv,lookup,operationName,trace),linkedTestNormalized=mergeLinkedTestTwoTokenEntries(normalizedArgv,operationName,trace),coalesced=coalesceRepeatedListFlags(linkedTestNormalized,lookup.listCanonicalFlags,GLOBAL_VALUE_CONSUMING_FLAGS,commandName==="create"?new Set(["--tags"]):new Set);for(const event of coalesced.events)trace.push(event);return protectBootstrapHelpDiscovery(coalesced.argv,commandPathName??commandName),commandPathName==="history attest"&&bindAttestationVerification(coalesced.argv),{argv:coalesced.argv,commandName,trace}}function parseBootstrapCommandPathName(argv){const stripped=stripGlobalBootstrapTokens(argv),first=stripped[0]?.trim().toLowerCase(),second=stripped[1]?.trim().toLowerCase(),namespaced=findPmNamespacedCommand(stripped);return namespaced?namespaced.canonical:(first==="extension"||first==="package"||first==="packages")&&typeof second=="string"&&second.length>0&&!second.startsWith("-")?`${first} ${second}`:first}function parseBootstrapTypeValue(argv){for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--type"){const candidate=argv[index+1];if(typeof candidate=="string"&&candidate.trim().length>0)return candidate.trim();continue}if(token.startsWith("--type=")){const candidate=token.slice(7).trim();if(candidate.length>0)return candidate}}}const _testOnly={buildFlagLookup,collectBootstrapPathValueIndices,collectLongFlagCandidates,markUnambiguousFlag,normalizeLongOptionToken,resolveCanonicalFlag};export{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,_testOnly,applyBootstrapPagerPolicy,coalesceRepeatedListFlags,findBootstrapCommandTokenIndex,listAliasPluralKeys,mergeLinkedTestTwoTokenEntries,normalizeBootstrapInvocation,normalizeLegacyExtensionActionSyntax,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,parseBootstrapTypeValue,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,stripGlobalBootstrapTokens};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7b271a35-800c-52bf-9368-0410e76b8d4e")}catch{}})();import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,renderPmCommandAliasMigrationHint,resolvePmCommandAlias}from"./cli-contracts/command-aliases.js";import{resolveSubcommandFlagContractsForCommand}from"./cli-contracts/flag-contracts.js";import{levenshteinDistanceWithinLimit}from"../core/shared/levenshtein.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{findPmNamespacedCommand,resolvePmCommandOperation}from"./cli-contracts/command-aliases.js";import{normalizeItemAddressInvocation}from"./agent/item-addressing.js";import{BOOTSTRAP_BOOLEAN_FLAGS,GLOBAL_VALUE_CONSUMING_FLAGS,consumesBootstrapValue,findBootstrapCommandTokenIndex as findContractBootstrapCommandTokenIndex,isInlineGlobalValueToken,parseBootstrapCommandName as parseContractBootstrapCommandName}from"./cli-contracts/bootstrap-command-scanner.js";const OUTPUT_VALUE_FLAGS=new Set(["--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor"]),BOOTSTRAP_OUTPUT_ENCODINGS=new Set(["toon","json"]);function consumeBootstrapGlobalToken(argv,index,state){const token=argv[index];if(BOOTSTRAP_BOOLEAN_FLAGS.has(token))return state.booleanFlags.add(token),1;const equalsIndex=token.indexOf("="),canonicalFlag=equalsIndex>0?token.slice(0,equalsIndex):token;if(!GLOBAL_VALUE_CONSUMING_FLAGS.has(canonicalFlag))return 1;const inlineValue=equalsIndex>0?token.slice(equalsIndex+1):void 0,consumesValue=inlineValue===void 0&&consumesBootstrapValue(canonicalFlag,argv[index+1]),value=inlineValue??(consumesValue?argv[index+1]:void 0);return canonicalFlag==="--author"?state.author=value??"":typeof value=="string"&&value.length>0&&(OUTPUT_VALUE_FLAGS.has(canonicalFlag)?state.outputValues:state.pathValues).set(canonicalFlag,value),consumesValue?2:1}function isBootstrapJsonOutput(state){return state.outputValues.get("--output-format")!=="toon"&&(state.booleanFlags.has("--json")||state.outputValues.get("--output-format")==="json"||state.pathValues.get("--format")?.trim().toLowerCase()==="json")}function parseBootstrapGlobalOptions(argv){const state={booleanFlags:new Set,outputValues:new Map,pathValues:new Map};let index=0;for(;index<argv.length&&argv[index]!=="--";)index+=consumeBootstrapGlobalToken(argv,index,state);return{path:state.pathValues.get("--pm-path")??state.pathValues.get("--path"),noExtensions:state.booleanFlags.has("--no-extensions")||["history attest","history-attest"].includes(parseBootstrapCommandPathName(argv)??""),noPager:state.booleanFlags.has("--no-pager"),json:isBootstrapJsonOutput(state),quiet:state.booleanFlags.has("--quiet"),lean:state.booleanFlags.has("--lean"),tokenAccounting:state.booleanFlags.has("--token-accounting"),...state.booleanFlags.has("--output-row-contract")?{outputRowContract:!0}:{},...state.outputValues.get("--output-include")===void 0?{}:{outputInclude:state.outputValues.get("--output-include")},...state.outputValues.get("--output-limit")===void 0?{}:{outputLimit:state.outputValues.get("--output-limit")},...state.outputValues.get("--output-budget")===void 0?{}:{outputBudget:state.outputValues.get("--output-budget")},...BOOTSTRAP_OUTPUT_ENCODINGS.has(state.outputValues.get("--output-format"))?{outputFormat:state.outputValues.get("--output-format")}:{},...state.outputValues.get("--output-session")===void 0?{}:{outputSession:state.outputValues.get("--output-session")},...state.outputValues.get("--output-cursor")===void 0?{}:{outputCursor:state.outputValues.get("--output-cursor")},...state.author===""?{authorMissingValue:!0}:state.author!==void 0?{author:state.author}:{}}}function stripGlobalBootstrapTokens(argv){const remaining=[];let index=0;for(;index<argv.length;){const token=argv[index];if(token==="--")break;if(BOOTSTRAP_BOOLEAN_FLAGS.has(token)||token==="--profile"||token==="--id-only"||token==="--full-changed-fields"||token==="--explain"){index+=1;continue}if(GLOBAL_VALUE_CONSUMING_FLAGS.has(token)){index+=consumesBootstrapValue(token,argv[index+1])?2:1;continue}if(isInlineGlobalValueToken(token)){index+=1;continue}remaining.push(token),index+=1}return remaining}function parseBootstrapHelpRequest(argv){const stripped=stripGlobalBootstrapTokens(argv);if(stripped[0]?.trim().toLowerCase()==="help"){const commandPathTokens2=[];for(let index=1;index<stripped.length;index+=1){const token=stripped[index];if(token.startsWith("-"))break;commandPathTokens2.push(token.trim().toLowerCase())}return{requested:!0,commandPathTokens:commandPathTokens2}}if(stripped.findIndex(token=>token==="--help"||token==="-h")<0)return{requested:!1,commandPathTokens:[]};const commandPathTokens=[];for(const token of stripped){if(token.startsWith("-"))break;commandPathTokens.push(token.trim().toLowerCase())}return{requested:!0,commandPathTokens}}function findBootstrapCommandTokenIndex(argv){return findContractBootstrapCommandTokenIndex(argv)}function parseBootstrapCommandName(argv){return parseContractBootstrapCommandName(argv)}function shouldDisablePagerForInvocation(argv,bootstrapGlobal){return bootstrapGlobal.noPager?!0:process.stdout.isTTY===!0?!1:parseBootstrapHelpRequest(argv).requested}function applyBootstrapPagerPolicy(argv){const pagerEnvironmentKeys=["PAGER","MANPAGER","GIT_PAGER","LESS"],previousValues=pagerEnvironmentKeys.map(key=>process.env[key]),restore=()=>{for(const[index,key]of pagerEnvironmentKeys.entries()){const value=previousValues[index];value===void 0?delete process.env[key]:process.env[key]=value}},bootstrapGlobal=parseBootstrapGlobalOptions(argv);return shouldDisablePagerForInvocation(argv,bootstrapGlobal)&&(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")),restore}const EXTENSION_ACTION_SYNTAX_TOKENS=new Set(["install","uninstall","explore","manage","doctor","adopt","adopt-all","activate","deactivate"]);function normalizeLegacyExtensionActionSyntax(argv){const extensionIndex=findBootstrapCommandTokenIndex(argv);if(extensionIndex===void 0||argv[extensionIndex]!=="extension")return[...argv];const actionToken=argv[extensionIndex+1];if(!actionToken||actionToken.startsWith("-"))return[...argv];if(!EXTENSION_ACTION_SYNTAX_TOKENS.has(actionToken))return[...argv];if(argv.includes("--help")||argv.includes("-h"))return[...argv];const forcedActionFlag=`--${actionToken}`;return argv.includes(forcedActionFlag)?[...argv]:[...argv.slice(0,extensionIndex+1),forcedActionFlag,...argv.slice(extensionIndex+2)]}const CLI_EXECUTABLE_ALIASES=new Set(["pm","pm-cli"]);function stripLeadingExecutableAlias(argv,trace){const index=findBootstrapCommandTokenIndex(argv);if(index===void 0)return argv;const token=argv[index];return CLI_EXECUTABLE_ALIASES.has(token.trim().toLowerCase())?(trace.push({from:token,to:[],reason:"executable_alias",confidence:"high"}),[...argv.slice(0,index),...argv.slice(index+1)]):argv}function rewriteCommandAlias(argv,trace){let index=findBootstrapCommandTokenIndex(argv);if(index!==void 0&&argv[index]==="help"){const offset=findBootstrapCommandTokenIndex(argv.slice(index+1));index=offset===void 0?void 0:index+1+offset}if(index===void 0)return argv;const token=argv[index],canonical=EXECUTABLE_COMMAND_ALIASES[token.trim().toLowerCase()];if(!canonical)return argv;const canonicalTokens=canonical.split(" "),rewritten=[...argv.slice(0,index),...canonicalTokens,...argv.slice(index+1)];return trace.push({from:token,to:canonicalTokens,reason:"command_alias",confidence:"high"}),rewritten}function normalizeFlagKeyToken(raw){return raw.replace(/^--?/,"").replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function toComparableFlagKey(raw){return normalizeFlagKeyToken(raw).replace(/-/g,"")}function markUnambiguousFlag(map,key,canonicalFlag){const existing=map.get(key);if(existing===void 0){map.set(key,canonicalFlag);return}existing!==canonicalFlag&&map.set(key,null)}function collectLongFlagCandidates(contract){const candidates=[],pushLongFlag=value=>{typeof value=="string"&&value.startsWith("--")&&candidates.push(value)};pushLongFlag(contract.flag);for(const alias of contract.aliases??[])pushLongFlag(alias);return candidates}function buildFlagLookup(commandName,contractsOverride){const contracts=contractsOverride??resolveSubcommandFlagContractsForCommand(commandName),canonicalByNormalized=new Map,canonicalByCompact=new Map,canonicalComparablesMap=new Map,listCanonicalFlags=new Set;for(const contract of contracts){const longCandidates=collectLongFlagCandidates(contract);if(longCandidates.length===0)continue;const canonicalFlag=`--${normalizeFlagKeyToken(longCandidates[0])}`;for(const candidate of longCandidates)markUnambiguousFlag(canonicalByNormalized,normalizeFlagKeyToken(candidate),canonicalFlag),markUnambiguousFlag(canonicalByCompact,toComparableFlagKey(candidate),canonicalFlag);const comparable=toComparableFlagKey(canonicalFlag);canonicalComparablesMap.has(canonicalFlag)||canonicalComparablesMap.set(canonicalFlag,comparable),contract.list===!0&&listCanonicalFlags.add(canonicalFlag)}return{canonicalByNormalized,canonicalByCompact,canonicalComparables:[...canonicalComparablesMap.entries()].map(([canonicalFlag,comparable])=>({canonicalFlag,comparable})),listCanonicalFlags}}function resolveCanonicalFlag(rawKey,lookup){const normalizedKey=normalizeFlagKeyToken(rawKey),direct=lookup.canonicalByNormalized.get(normalizedKey);if(typeof direct=="string")return{flag:direct,reason:"flag_alias",confidence:"high"};const comparableKey=normalizedKey.replace(/-/g,""),compactMatch=lookup.canonicalByCompact.get(comparableKey);if(typeof compactMatch=="string")return{flag:compactMatch,reason:"flag_alias",confidence:"high"};const maxDistance=comparableKey.length>=8?2:1;let bestDistance=Number.POSITIVE_INFINITY,bestFlag,tied=!1;for(const candidate of lookup.canonicalComparables){const distance=levenshteinDistanceWithinLimit(comparableKey,candidate.comparable,maxDistance);if(distance!==null){if(distance<bestDistance){bestDistance=distance,bestFlag=candidate.canonicalFlag,tied=!1;continue}distance===bestDistance&&bestFlag!==candidate.canonicalFlag&&(tied=!0)}}return!bestFlag||tied||!Number.isFinite(bestDistance)||bestDistance<=0?null:{flag:bestFlag,reason:"flag_typo",confidence:bestDistance>=2?"medium":"high"}}function listAliasPluralKeys(normalizedKey){const candidates=[`${normalizedKey}s`];return normalizedKey.endsWith("y")&&normalizedKey.length>1&&candidates.push(`${normalizedKey.slice(0,-1)}ies`),candidates}function parseBareKeyValueToken(token,preserve=!1){if(preserve||token.includes("://"))return null;const match=token.match(/^([A-Za-z][A-Za-z0-9_-]{1,63})([:=])(.*)$/);if(!match)return null;const key=match[1],value=match[3];return value.length===0?null:{key,value}}function normalizeLongOptionToken(token,lookup,preserve=!1){if(preserve||!token.startsWith("--"))return{tokens:[token]};const equalsIndex=token.indexOf("="),key=equalsIndex>=0?token.slice(0,equalsIndex):token,inlineValue=equalsIndex>=0?token.slice(equalsIndex+1):void 0,resolution=resolveCanonicalFlag(key,lookup);if(!resolution)return{tokens:[token]};const normalizedToken=inlineValue===void 0?resolution.flag:`${resolution.flag}=${inlineValue}`;return normalizedToken===token?{tokens:[token]}:{tokens:[normalizedToken],event:{from:token,to:[normalizedToken],reason:resolution.reason,confidence:resolution.confidence}}}function collectBootstrapPathValueIndices(argv){const indices=new Set;let expectsValue=!1;for(let index=0;index<argv.length;index+=1){if(expectsValue){indices.add(index),expectsValue=!1;continue}const token=argv[index];expectsValue=token==="--path"||token==="--pm-path"}return indices}function splitCanonicalListToken(token){if(!token.startsWith("--"))return null;const equalsIndex=token.indexOf("=");return equalsIndex<0?{flag:token}:{flag:token.slice(0,equalsIndex),inlineValue:token.slice(equalsIndex+1)}}function copyValueConsumingFlag(argv,index,result){result.push(argv[index]);const next=argv[index+1];return typeof next=="string"&&next!=="--"?(result.push(next),index+2):index+1}function readListFlagOccurrence(argv,index,parsed,multiValueListFlags){if(parsed.inlineValue!==void 0)return{originalTokens:[argv[index]],value:parsed.inlineValue,consumed:1};const values=[];let valueIndex=index+1;for(;valueIndex<argv.length&&argv[valueIndex]!=="--"&&!argv[valueIndex].startsWith("-")&&(values.length===0||multiValueListFlags.has(parsed.flag));)values.push(argv[valueIndex]),valueIndex+=1;const consumed=values.length===0?1:1+values.length;return{originalTokens:argv.slice(index,index+consumed),value:values.length===0?void 0:values.join(","),consumed}}function recordListFlagOccurrence(slots,result,flag,occurrence){const existing=slots.get(flag);if(existing){existing.values.push(occurrence.value),existing.occurrences+=1;return}slots.set(flag,{outputIndex:result.length,originalTokens:occurrence.originalTokens,values:[occurrence.value],occurrences:1}),result.push(null)}function buildListFlagCoalescingSplices(slots,multiValueListFlags){const events=[],splices=[];for(const[flag,slot]of slots){if(!(slot.occurrences>=2||multiValueListFlags.has(flag)&&slot.originalTokens.length>2)){splices.push({outputIndex:slot.outputIndex,tokens:slot.originalTokens});continue}const mergedToken=`${flag}=${slot.values.join(",")}`;splices.push({outputIndex:slot.outputIndex,tokens:[mergedToken]}),events.push({from:`${flag} (x${slot.occurrences})`,to:[mergedToken],reason:"list_merge",confidence:"high"})}return{events,splices}}function applyListFlagSplices(result,splices){splices.sort((a,b)=>b.outputIndex-a.outputIndex);for(const splice of splices)result.splice(splice.outputIndex,1,...splice.tokens)}function coalesceRepeatedListFlags(argv,listFlags,valueConsumingFlags=new Set,multiValueListFlags=new Set){if(listFlags.size===0)return{argv:[...argv],events:[]};const result=[],slots=new Map;let index=0;for(;index<argv.length;){const token=argv[index];if(token==="--"){result.push(...argv.slice(index));break}if(valueConsumingFlags.has(token)){index=copyValueConsumingFlag(argv,index,result);continue}const parsed=splitCanonicalListToken(token);if(!parsed||!listFlags.has(parsed.flag)){result.push(token),index+=1;continue}const occurrence=readListFlagOccurrence(argv,index,parsed,multiValueListFlags);if(occurrence.value===void 0){result.push(token),index+=occurrence.consumed;continue}recordListFlagOccurrence(slots,result,parsed.flag,{originalTokens:occurrence.originalTokens,value:occurrence.value}),index+=occurrence.consumed}const{events,splices}=buildListFlagCoalescingSplices(slots,multiValueListFlags);return applyListFlagSplices(result,splices),{argv:result,events}}const LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG=new Map([["--add",new Set(["command","cmd","path"])],["--remove",new Set(["command","path"])]]);function isLinkedTestTwoTokenValuePosition(commandName,emittedTokens){if(commandName!=="test"||emittedTokens.length<2)return!1;const key=emittedTokens[emittedTokens.length-1],flag=emittedTokens[emittedTokens.length-2],keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(flag);return keys!==void 0&&keys.has(key)}function mergeLinkedTestTwoTokenEntries(argv,commandName,trace){if(commandName!=="test")return argv;const result=[];let index=0;for(;index<argv.length;){const token=argv[index];if(token==="--")return result.push(...argv.slice(index)),result;const keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(token),key=keys?argv[index+1]:void 0;if(!keys||typeof key!="string"||!keys.has(key)){result.push(token),index+=1;continue}let runEnd=index+2;for(;runEnd<argv.length&&!argv[runEnd].startsWith("-");)runEnd+=1;if(runEnd-(index+2)!==1){result.push(token),index+=1;continue}const value=argv[index+2],mergedValue=`${key}=${value}`;result.push(token,mergedValue),trace.push({from:`${token} ${key} ${value}`,to:[token,mergedValue],reason:"bare_key_value",confidence:"high"}),index+=3}return result}function normalizeBootstrapTokens(argv,lookup,commandName,trace){const normalizedArgv=[],pathValueIndices=collectBootstrapPathValueIndices(argv);for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--"){normalizedArgv.push(...argv.slice(index));break}const preserveCurrentToken=pathValueIndices.has(index),previous=normalizedArgv[normalizedArgv.length-1];if(token.startsWith("--")){const normalizedToken=normalizeLongOptionToken(token,lookup,preserveCurrentToken);normalizedArgv.push(...normalizedToken.tokens),normalizedToken.event&&trace.push(normalizedToken.event);continue}const bareKeyValue=parseBareKeyValueToken(token,preserveCurrentToken);if(!bareKeyValue||typeof previous=="string"&&previous.startsWith("-")&&!previous.includes("=")||["search","comments","notes","learnings"].includes(commandName)||isLinkedTestTwoTokenValuePosition(commandName,normalizedArgv)){normalizedArgv.push(token);continue}const resolution=resolveCanonicalFlag(bareKeyValue.key,lookup);if(!resolution){normalizedArgv.push(token);continue}const replacement=bareKeyValue.value.startsWith("-")?[`${resolution.flag}=${bareKeyValue.value}`]:[resolution.flag,bareKeyValue.value];normalizedArgv.push(...replacement),trace.push({from:token,to:replacement,reason:"bare_key_value",confidence:resolution.confidence})}return normalizedArgv}function bindAttestationVerification(argv){for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--verify"){const value=argv[index+1];if(value===void 0||value==="--")throw new PmCliError("history attest --verify requires a bundle file.",EXIT_CODE.USAGE);argv.splice(index,2,`--verify=${value}`)}else(GLOBAL_VALUE_CONSUMING_FLAGS.has(token)||token==="--output"||token==="--hash-algorithm")&&(index+=1)}}function protectBootstrapHelpDiscovery(argv,command){if(!argv.some(token=>token==="--help"||token==="-h"))return;const declaredFlags=new Set(resolveSubcommandFlagContractsForCommand(command).flatMap(contract=>[contract.flag,...contract.aliases??[],...contract.short===void 0?[]:[contract.short]]));for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;token!=="--help"&&token!=="-h"||declaredFlags.has(argv[index-1])&&!BOOTSTRAP_BOOLEAN_FLAGS.has(argv[index-1])&&(argv[index-1]=token)}}function normalizeBootstrapInvocation(argv){const trace=[],executableNormalized=stripLeadingExecutableAlias(argv,trace),legacyNormalized=normalizeLegacyExtensionActionSyntax(executableNormalized);(legacyNormalized.length!==executableNormalized.length||legacyNormalized.some((token,index)=>token!==executableNormalized[index]))&&trace.push({from:executableNormalized.join(" "),to:[...legacyNormalized],reason:"legacy_extension_action",confidence:"high"});const aliasNormalized=rewriteCommandAlias(legacyNormalized,trace),itemAddress=normalizeItemAddressInvocation(aliasNormalized);if(itemAddress.conflict)throw new PmCliError("Provide the item id either positionally or with --id, not both.",EXIT_CODE.USAGE);itemAddress.changed&&trace.push({from:`--id ${itemAddress.itemId}`,to:[itemAddress.itemId],reason:"item_id_alias",confidence:"high"});const commandName=parseBootstrapCommandName(itemAddress.argv),commandPathName=parseBootstrapCommandPathName(itemAddress.argv),operationName=resolvePmCommandOperation(commandPathName??commandName??""),lookup=buildFlagLookup(commandPathName??commandName),normalizedArgv=normalizeBootstrapTokens(itemAddress.argv,lookup,operationName,trace),linkedTestNormalized=mergeLinkedTestTwoTokenEntries(normalizedArgv,operationName,trace),coalesced=coalesceRepeatedListFlags(linkedTestNormalized,lookup.listCanonicalFlags,GLOBAL_VALUE_CONSUMING_FLAGS,commandName==="create"?new Set(["--tags"]):new Set);for(const event of coalesced.events)trace.push(event);return protectBootstrapHelpDiscovery(coalesced.argv,commandPathName??commandName),commandPathName==="history attest"&&bindAttestationVerification(coalesced.argv),{argv:coalesced.argv,commandName,trace}}function parseBootstrapCommandPathName(argv){const stripped=stripGlobalBootstrapTokens(argv),first=stripped[0]?.trim().toLowerCase(),second=stripped[1]?.trim().toLowerCase(),namespaced=findPmNamespacedCommand(stripped);return namespaced?namespaced.canonical:(first==="extension"||first==="package"||first==="packages")&&typeof second=="string"&&second.length>0&&!second.startsWith("-")?`${first} ${second}`:first}function parseBootstrapTypeValue(argv){for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--type"){const candidate=argv[index+1];if(typeof candidate=="string"&&candidate.trim().length>0)return candidate.trim();continue}if(token.startsWith("--type=")){const candidate=token.slice(7).trim();if(candidate.length>0)return candidate}}}const _testOnly={buildFlagLookup,collectBootstrapPathValueIndices,collectLongFlagCandidates,markUnambiguousFlag,normalizeLongOptionToken,resolveCanonicalFlag};export{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,_testOnly,applyBootstrapPagerPolicy,coalesceRepeatedListFlags,findBootstrapCommandTokenIndex,listAliasPluralKeys,mergeLinkedTestTwoTokenEntries,normalizeBootstrapInvocation,normalizeLegacyExtensionActionSyntax,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,parseBootstrapTypeValue,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,stripGlobalBootstrapTokens};
2
2
  //# sourceMappingURL=cli-bootstrap.js.map
@@ -125,3 +125,31 @@ export declare function projectPmDiagnosticText(output:string,correctiveAction:s
125
125
  diagnosticClass?:PmDiagnosticOutputClass;
126
126
  maxEstimatedTokens?:number;
127
127
  }):PmProjectedTextDiagnostic;
128
+ /**
129
+ * Guidance that every refusal can carry regardless of its code. Lean output
130
+ * omits it because it never changes the caller's next action; default output
131
+ * keeps it for human readers (GH-1610). Declared once here so the text and
132
+ * JSON lean projections agree on what counts as boilerplate.
133
+ */
134
+ export declare const PM_GENERIC_REFUSAL_GUIDANCE:Readonly<{
135
+ required:"Adjust command input or tracker state and retry.";
136
+ why:readonly string[];
137
+ examples:readonly string[];
138
+ }>;
139
+ /** True when the `What is required` text is the generic constant. */
140
+ export declare function isGenericRefusalRequired(value:string | undefined):boolean;
141
+ /** True when the `Why` text carries no code-specific rationale. */
142
+ export declare function isGenericRefusalWhy(value:string | undefined):boolean;
143
+ /**
144
+ * Drop each generic help pointer from an example list so a mixed list keeps
145
+ * only its code-specific entries; an all-generic list becomes empty.
146
+ */
147
+ export declare function withoutGenericRefusalExamples(values:readonly string[] | undefined):string[];
148
+ /** Recovery fields that only echo the caller's own invocation. */
149
+ export declare const PM_RECOVERY_ECHO_FIELDS:readonly ["attempted_command","normalized_args","provided_fields"];
150
+ /**
151
+ * Drop the invocation echo from a recovery payload. Specific recovery such as
152
+ * `suggested_retry`, `missing`, `allowed_values` and `next_best_command`
153
+ * survives; an empty remainder is omitted entirely.
154
+ */
155
+ export declare function projectLeanRecoveryPayload<Recovery extends Partial<Record<(typeof PM_RECOVERY_ECHO_FIELDS)[number],unknown>>>(recovery:Recovery | undefined):Omit<Recovery,(typeof PM_RECOVERY_ECHO_FIELDS)[number]> | undefined;
@@ -1,8 +1,8 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1a14ce9e-1074-5434-9646-dd5e25e34814")}catch{}})();import{stripVTControlCharacters}from"node:util";import{unicodeSafePrefix}from"../../core/shared/text-normalization.js";import{resolvePmHistoryOperation}from"./command-aliases.js";import{PM_CORE_COMMAND_NAMES}from"./enum-contracts.js";const PM_OUTPUT_DEGRADATION_STEPS=["full","compact","brief","summary","counts"],PM_OUTPUT_BUDGET_CLASSES=["mutation","read","discovery","governance"],PM_DIAGNOSTIC_OUTPUT_CLASSES=["error","warning","validation_summary","recovery_bundle"],PM_DIAGNOSTIC_DEGRADATION_STEPS=["full","omit_explanation","limit_collections","compact_recovery","action_only"],MUTATION_COMMANDS=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"]),DISCOVERY_COMMANDS=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),GOVERNANCE_COMMANDS=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),DEFAULT_MAX_ESTIMATED_TOKENS={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},JSON_BUDGET_NUMERATOR=3,JSON_BUDGET_DENOMINATOR=2,MINIMUM_DIAGNOSTIC_BUDGET=192,DIAGNOSTIC_DEFAULT_BUDGETS={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS=PM_DIAGNOSTIC_OUTPUT_CLASSES.map(diagnosticClass=>({diagnostic_class:diagnosticClass,default_max_estimated_tokens_by_format:DIAGNOSTIC_DEFAULT_BUDGETS[diagnosticClass],minimum_max_estimated_tokens:MINIMUM_DIAGNOSTIC_BUDGET,degradation_ladder:PM_DIAGNOSTIC_DEGRADATION_STEPS,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),DIAGNOSTIC_BUDGET_BY_CLASS=new Map(PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS.map(contract=>[contract.diagnostic_class,contract]));function inferPmOutputBudgetClass(command){const[rootCommand=""]=resolvePmHistoryOperation(command).split(/\s+/u);return MUTATION_COMMANDS.has(rootCommand)?"mutation":DISCOVERY_COMMANDS.has(rootCommand)?"discovery":GOVERNANCE_COMMANDS.has(rootCommand)?"governance":"read"}function createPmCommandOutputBudget(command,budgetClass=inferPmOutputBudgetClass(command)){const normalizedCommand=command.trim().replace(/\s+/gu," ");if(normalizedCommand.length===0)throw new TypeError("command must be a non-empty command path");const toonBudget=DEFAULT_MAX_ESTIMATED_TOKENS[budgetClass];return definePmCommandOutputBudget({command:normalizedCommand,budget_class:budgetClass,default_max_estimated_tokens:toonBudget,default_max_estimated_tokens_by_format:{toon:toonBudget,json:Math.ceil(toonBudget*JSON_BUDGET_NUMERATOR/JSON_BUDGET_DENOMINATOR)},degradation_ladder:PM_OUTPUT_DEGRADATION_STEPS,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function definePmCommandOutputBudget(contract){if(!Number.isSafeInteger(contract.default_max_estimated_tokens)||contract.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(const[format,ceiling]of Object.entries(contract.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(ceiling)||ceiling<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${format} must be a positive safe integer`);return contract}const PM_COMMAND_OUTPUT_BUDGET_CONTRACTS=PM_CORE_COMMAND_NAMES.map(command=>createPmCommandOutputBudget(command)),OUTPUT_BUDGET_BY_COMMAND=new Map(PM_COMMAND_OUTPUT_BUDGET_CONTRACTS.map(contract=>[contract.command,contract]));function resolvePmCommandOutputBudget(command,options={}){const normalizedCommand=command.trim().replace(/\s+/gu," "),[rootCommand]=resolvePmHistoryOperation(normalizedCommand).split(" "),declared=OUTPUT_BUDGET_BY_COMMAND.get(rootCommand);return declared?{...declared,command:normalizedCommand}:options.generateFallback?createPmCommandOutputBudget(normalizedCommand):null}function estimatePmOutputTokens(utf8Bytes){return Math.ceil(Math.max(0,utf8Bytes)/4)}function resolvePmDiagnosticOutputBudget(diagnosticClass){const contract=DIAGNOSTIC_BUDGET_BY_CLASS.get(diagnosticClass);if(contract===void 0)throw new TypeError(`diagnosticClass must be one of: ${PM_DIAGNOSTIC_OUTPUT_CLASSES.join(", ")}`);return contract}function estimateJsonDiagnosticTokens(value){return estimatePmOutputTokens(Buffer.byteLength(JSON.stringify(value,null,2),"utf8"))}function isDiagnosticRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function compactDiagnosticRecovery(value){if(!isDiagnosticRecord(value))return;const compact={};for(const key of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms","waited_ms","owner_handoffs"]){const candidate=value[key];Array.isArray(candidate)?compact[key]=key==="suggested_retry_args"?candidate:candidate.slice(0,3):candidate!==void 0&&(compact[key]=candidate)}return Object.keys(compact).length>0?compact:void 0}function truncateDiagnosticString(value,maximum){return typeof value!="string"||value.length<=maximum?value:`${unicodeSafePrefix(value,Math.max(1,maximum-3))}...`}function truncateDiagnosticUtf8Text(value,maximumBytes){if(Buffer.byteLength(value,"utf8")<=maximumBytes)return value;const suffix="...",codePoints=Array.from(value);let lower=0,upper=codePoints.length;for(;lower<upper;){const middle=Math.ceil((lower+upper)/2),candidate=`${codePoints.slice(0,middle).join("")}${suffix}`;Buffer.byteLength(candidate,"utf8")<=maximumBytes?lower=middle:upper=middle-1}return`${codePoints.slice(0,lower).join("")}${suffix}`}function prioritizeDiagnosticFields(diagnostic){const prioritized={};for(const key of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(diagnostic,key)&&diagnostic[key]!==void 0&&(prioritized[key]=diagnostic[key]);for(const[key,value]of Object.entries(diagnostic))key!=="__proto__"&&!Object.hasOwn(prioritized,key)&&(prioritized[key]=value);return prioritized}const DIAGNOSTIC_COLLECTION_LIMIT_STAGES=new Set(["limit_collections","compact_recovery","action_only"]),DIAGNOSTIC_RECOVERY_COMPACTION_STAGES=new Set(["compact_recovery","action_only"]);function actionOnlyDiagnostic(candidate){const actionOnly={code:typeof candidate.code=="string"?candidate.code:"diagnostic",required:truncateDiagnosticString(candidate.required,160)??"Inspect the diagnostic code and retry with corrected input."},recovery=compactDiagnosticRecovery(candidate.recovery);return recovery!==void 0?actionOnly.recovery=recovery:Array.isArray(candidate.next_steps)&&(actionOnly.next_steps=candidate.next_steps.slice(0,1)),candidate.exit_code!==void 0&&(actionOnly.exit_code=candidate.exit_code),candidate.type!==void 0&&(actionOnly.type=candidate.type),actionOnly}function diagnosticCandidate(diagnostic,stage){const candidate=structuredClone(diagnostic);if(stage!=="full"&&(delete candidate.why,delete candidate.examples),DIAGNOSTIC_COLLECTION_LIMIT_STAGES.has(stage))for(const[key,value]of Object.entries(candidate))Array.isArray(value)&&(candidate[key]=value.slice(0,3));if(DIAGNOSTIC_RECOVERY_COMPACTION_STAGES.has(stage)){const recovery=compactDiagnosticRecovery(candidate.recovery);recovery?candidate.recovery=recovery:delete candidate.recovery}return stage!=="action_only"?prioritizeDiagnosticFields(candidate):actionOnlyDiagnostic(candidate)}function attachDiagnosticReceipt(candidate,receipt){const projected={...candidate,diagnostic_output:{...receipt,estimated_tokens:0}};for(let attempt=0;attempt<4;attempt+=1){const estimatedTokens=estimateJsonDiagnosticTokens(projected),outputReceipt=projected.diagnostic_output;if(outputReceipt.estimated_tokens===estimatedTokens)break;outputReceipt.estimated_tokens=estimatedTokens}return projected}function shrinkMinimalDiagnosticCandidate(candidate,receipt,budget){let fallback=attachDiagnosticReceipt(candidate,receipt);for(const optionalField of["recovery","exit_code"])estimateJsonDiagnosticTokens(fallback)<=budget||candidate[optionalField]===void 0||(delete candidate[optionalField],fallback=attachDiagnosticReceipt(candidate,receipt));let maximumActionBytes=40;for(;estimateJsonDiagnosticTokens(fallback)>budget&&maximumActionBytes>4;)maximumActionBytes-=4,candidate.code=truncateDiagnosticUtf8Text(String(candidate.code),maximumActionBytes),candidate.required=truncateDiagnosticUtf8Text(String(candidate.required),maximumActionBytes),fallback=attachDiagnosticReceipt(candidate,receipt);return fallback}function createMinimalDiagnosticFallback(projected,budget){const receipt=projected.diagnostic_output,{estimated_tokens:_estimatedTokens,...receiptWithoutEstimate}=receipt,boundedOmittedFields=receiptWithoutEstimate.omitted_fields.slice(0,8).map(field=>truncateDiagnosticUtf8Text(field,32)),boundedReceipt={...receiptWithoutEstimate,omitted_fields:boundedOmittedFields,...receiptWithoutEstimate.omitted_fields.length>boundedOmittedFields.length?{omitted_fields_overflow_count:receiptWithoutEstimate.omitted_fields.length-boundedOmittedFields.length}:{}},recoveryCandidate=compactDiagnosticRecovery(projected.recovery),recovery=recoveryCandidate&&estimateJsonDiagnosticTokens(recoveryCandidate)<=48?recoveryCandidate:void 0,candidate={code:truncateDiagnosticUtf8Text(String(projected.code),320),required:truncateDiagnosticUtf8Text(String(projected.required),320),...recovery?{recovery}:{},...projected.exit_code!==void 0?{exit_code:projected.exit_code}:{}};let fallback=attachDiagnosticReceipt(candidate,boundedReceipt);for(;estimateJsonDiagnosticTokens(fallback)>budget&&boundedReceipt.omitted_fields.length>0;)boundedReceipt.omitted_fields.pop(),boundedReceipt.omitted_fields_overflow_count=receiptWithoutEstimate.omitted_fields.length-boundedReceipt.omitted_fields.length,fallback=attachDiagnosticReceipt(candidate,boundedReceipt);return fallback=shrinkMinimalDiagnosticCandidate(candidate,boundedReceipt,budget),fallback}function projectPmDiagnosticOutput(diagnostic,options={}){const diagnosticRecord=diagnostic,diagnosticClass=options.diagnosticClass??"error",contract=resolvePmDiagnosticOutputBudget(diagnosticClass),explicitBudget=options.maxEstimatedTokens;if(explicitBudget!==void 0&&(!Number.isSafeInteger(explicitBudget)||explicitBudget<contract.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${contract.minimum_max_estimated_tokens}`);const budget=explicitBudget??contract.default_max_estimated_tokens_by_format.json,originalEstimatedTokens=estimateJsonDiagnosticTokens(diagnosticRecord),originalFields=Object.keys(diagnosticRecord);if(originalEstimatedTokens<=budget)return prioritizeDiagnosticFields(structuredClone(diagnosticRecord));let projected;for(const[index,stage]of contract.degradation_ladder.entries()){const candidate=diagnosticCandidate(diagnosticRecord,stage),omittedFields=originalFields.filter(field=>!Object.hasOwn(candidate,field)),withReceipt=attachDiagnosticReceipt(candidate,{diagnostic_class:diagnosticClass,format:"json",budget,budget_source:explicitBudget===void 0?"default":"explicit",original_estimated_tokens:originalEstimatedTokens,truncated:index>0,degradation_steps:contract.degradation_ladder.slice(0,index+1),omitted_fields:omittedFields});if(projected=withReceipt,estimateJsonDiagnosticTokens(withReceipt)<=budget)break}return estimateJsonDiagnosticTokens(projected)>budget&&(projected=createMinimalDiagnosticFallback(projected,budget)),projected}function sanitizeDiagnosticText(text){return stripVTControlCharacters(text).replace(/\r\n/gu,`
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="493a0675-0114-5b93-b3b4-5bd895ac691f")}catch{}})();import{stripVTControlCharacters}from"node:util";import{unicodeSafePrefix}from"../../core/shared/text-normalization.js";import{resolvePmHistoryOperation}from"./command-aliases.js";import{PM_CORE_COMMAND_NAMES}from"./enum-contracts.js";const PM_OUTPUT_DEGRADATION_STEPS=["full","compact","brief","summary","counts"],PM_OUTPUT_BUDGET_CLASSES=["mutation","read","discovery","governance"],PM_DIAGNOSTIC_OUTPUT_CLASSES=["error","warning","validation_summary","recovery_bundle"],PM_DIAGNOSTIC_DEGRADATION_STEPS=["full","omit_explanation","limit_collections","compact_recovery","action_only"],MUTATION_COMMANDS=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"]),DISCOVERY_COMMANDS=new Set(["contracts","extension","help","install","package","packages","profile","upgrade"]),GOVERNANCE_COMMANDS=new Set(["gc","health","merge","stats","telemetry","test","test-all","validate"]),DEFAULT_MAX_ESTIMATED_TOKENS={mutation:2e3,read:4e3,discovery:3e3,governance:6e3},JSON_BUDGET_NUMERATOR=3,JSON_BUDGET_DENOMINATOR=2,MINIMUM_DIAGNOSTIC_BUDGET=192,DIAGNOSTIC_DEFAULT_BUDGETS={error:{text:768,json:2e3},warning:{text:768,json:2e3},validation_summary:{text:1500,json:3e3},recovery_bundle:{text:768,json:2e3}},PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS=PM_DIAGNOSTIC_OUTPUT_CLASSES.map(diagnosticClass=>({diagnostic_class:diagnosticClass,default_max_estimated_tokens_by_format:DIAGNOSTIC_DEFAULT_BUDGETS[diagnosticClass],minimum_max_estimated_tokens:MINIMUM_DIAGNOSTIC_BUDGET,degradation_ladder:PM_DIAGNOSTIC_DEGRADATION_STEPS,corrective_action_paths:["required","recovery.suggested_retry","recovery.suggested_retry_args","recovery.next_best_command","next_steps[0]"],token_estimate:"ceil(utf8_bytes / 4)"})),DIAGNOSTIC_BUDGET_BY_CLASS=new Map(PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS.map(contract=>[contract.diagnostic_class,contract]));function inferPmOutputBudgetClass(command){const[rootCommand=""]=resolvePmHistoryOperation(command).split(/\s+/u);return MUTATION_COMMANDS.has(rootCommand)?"mutation":DISCOVERY_COMMANDS.has(rootCommand)?"discovery":GOVERNANCE_COMMANDS.has(rootCommand)?"governance":"read"}function createPmCommandOutputBudget(command,budgetClass=inferPmOutputBudgetClass(command)){const normalizedCommand=command.trim().replace(/\s+/gu," ");if(normalizedCommand.length===0)throw new TypeError("command must be a non-empty command path");const toonBudget=DEFAULT_MAX_ESTIMATED_TOKENS[budgetClass];return definePmCommandOutputBudget({command:normalizedCommand,budget_class:budgetClass,default_max_estimated_tokens:toonBudget,default_max_estimated_tokens_by_format:{toon:toonBudget,json:Math.ceil(toonBudget*JSON_BUDGET_NUMERATOR/JSON_BUDGET_DENOMINATOR)},degradation_ladder:PM_OUTPUT_DEGRADATION_STEPS,allows_unbounded_opt_out:!0,token_estimate:"ceil(utf8_bytes / 4)"})}function definePmCommandOutputBudget(contract){if(!Number.isSafeInteger(contract.default_max_estimated_tokens)||contract.default_max_estimated_tokens<=0)throw new RangeError("default_max_estimated_tokens must be a positive safe integer");for(const[format,ceiling]of Object.entries(contract.default_max_estimated_tokens_by_format))if(!Number.isSafeInteger(ceiling)||ceiling<=0)throw new RangeError(`default_max_estimated_tokens_by_format.${format} must be a positive safe integer`);return contract}const PM_COMMAND_OUTPUT_BUDGET_CONTRACTS=PM_CORE_COMMAND_NAMES.map(command=>createPmCommandOutputBudget(command)),OUTPUT_BUDGET_BY_COMMAND=new Map(PM_COMMAND_OUTPUT_BUDGET_CONTRACTS.map(contract=>[contract.command,contract]));function resolvePmCommandOutputBudget(command,options={}){const normalizedCommand=command.trim().replace(/\s+/gu," "),[rootCommand]=resolvePmHistoryOperation(normalizedCommand).split(" "),declared=OUTPUT_BUDGET_BY_COMMAND.get(rootCommand);return declared?{...declared,command:normalizedCommand}:options.generateFallback?createPmCommandOutputBudget(normalizedCommand):null}function estimatePmOutputTokens(utf8Bytes){return Math.ceil(Math.max(0,utf8Bytes)/4)}function resolvePmDiagnosticOutputBudget(diagnosticClass){const contract=DIAGNOSTIC_BUDGET_BY_CLASS.get(diagnosticClass);if(contract===void 0)throw new TypeError(`diagnosticClass must be one of: ${PM_DIAGNOSTIC_OUTPUT_CLASSES.join(", ")}`);return contract}function estimateJsonDiagnosticTokens(value){return estimatePmOutputTokens(Buffer.byteLength(JSON.stringify(value,null,2),"utf8"))}function isDiagnosticRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function compactDiagnosticRecovery(value){if(!isDiagnosticRecord(value))return;const compact={};for(const key of["suggested_retry","suggested_retry_args","next_best_command","allowed_values","candidate_commands","missing","missing_required_fields","option_scope","retry_after_ms","waited_ms","owner_handoffs"]){const candidate=value[key];Array.isArray(candidate)?compact[key]=key==="suggested_retry_args"?candidate:candidate.slice(0,3):candidate!==void 0&&(compact[key]=candidate)}return Object.keys(compact).length>0?compact:void 0}function truncateDiagnosticString(value,maximum){return typeof value!="string"||value.length<=maximum?value:`${unicodeSafePrefix(value,Math.max(1,maximum-3))}...`}function truncateDiagnosticUtf8Text(value,maximumBytes){if(Buffer.byteLength(value,"utf8")<=maximumBytes)return value;const suffix="...",codePoints=Array.from(value);let lower=0,upper=codePoints.length;for(;lower<upper;){const middle=Math.ceil((lower+upper)/2),candidate=`${codePoints.slice(0,middle).join("")}${suffix}`;Buffer.byteLength(candidate,"utf8")<=maximumBytes?lower=middle:upper=middle-1}return`${codePoints.slice(0,lower).join("")}${suffix}`}function prioritizeDiagnosticFields(diagnostic){const prioritized={};for(const key of["code","required","recovery","next_steps","exit_code","type","title","detail","why","examples"])Object.hasOwn(diagnostic,key)&&diagnostic[key]!==void 0&&(prioritized[key]=diagnostic[key]);for(const[key,value]of Object.entries(diagnostic))key!=="__proto__"&&!Object.hasOwn(prioritized,key)&&(prioritized[key]=value);return prioritized}const DIAGNOSTIC_COLLECTION_LIMIT_STAGES=new Set(["limit_collections","compact_recovery","action_only"]),DIAGNOSTIC_RECOVERY_COMPACTION_STAGES=new Set(["compact_recovery","action_only"]);function actionOnlyDiagnostic(candidate){const actionOnly={code:typeof candidate.code=="string"?candidate.code:"diagnostic",required:truncateDiagnosticString(candidate.required,160)??"Inspect the diagnostic code and retry with corrected input."},recovery=compactDiagnosticRecovery(candidate.recovery);return recovery!==void 0?actionOnly.recovery=recovery:Array.isArray(candidate.next_steps)&&(actionOnly.next_steps=candidate.next_steps.slice(0,1)),candidate.exit_code!==void 0&&(actionOnly.exit_code=candidate.exit_code),candidate.type!==void 0&&(actionOnly.type=candidate.type),actionOnly}function diagnosticCandidate(diagnostic,stage){const candidate=structuredClone(diagnostic);if(stage!=="full"&&(delete candidate.why,delete candidate.examples),DIAGNOSTIC_COLLECTION_LIMIT_STAGES.has(stage))for(const[key,value]of Object.entries(candidate))Array.isArray(value)&&(candidate[key]=value.slice(0,3));if(DIAGNOSTIC_RECOVERY_COMPACTION_STAGES.has(stage)){const recovery=compactDiagnosticRecovery(candidate.recovery);recovery?candidate.recovery=recovery:delete candidate.recovery}return stage!=="action_only"?prioritizeDiagnosticFields(candidate):actionOnlyDiagnostic(candidate)}function attachDiagnosticReceipt(candidate,receipt){const projected={...candidate,diagnostic_output:{...receipt,estimated_tokens:0}};for(let attempt=0;attempt<4;attempt+=1){const estimatedTokens=estimateJsonDiagnosticTokens(projected),outputReceipt=projected.diagnostic_output;if(outputReceipt.estimated_tokens===estimatedTokens)break;outputReceipt.estimated_tokens=estimatedTokens}return projected}function shrinkMinimalDiagnosticCandidate(candidate,receipt,budget){let fallback=attachDiagnosticReceipt(candidate,receipt);for(const optionalField of["recovery","exit_code"])estimateJsonDiagnosticTokens(fallback)<=budget||candidate[optionalField]===void 0||(delete candidate[optionalField],fallback=attachDiagnosticReceipt(candidate,receipt));let maximumActionBytes=40;for(;estimateJsonDiagnosticTokens(fallback)>budget&&maximumActionBytes>4;)maximumActionBytes-=4,candidate.code=truncateDiagnosticUtf8Text(String(candidate.code),maximumActionBytes),candidate.required=truncateDiagnosticUtf8Text(String(candidate.required),maximumActionBytes),fallback=attachDiagnosticReceipt(candidate,receipt);return fallback}function createMinimalDiagnosticFallback(projected,budget){const receipt=projected.diagnostic_output,{estimated_tokens:_estimatedTokens,...receiptWithoutEstimate}=receipt,boundedOmittedFields=receiptWithoutEstimate.omitted_fields.slice(0,8).map(field=>truncateDiagnosticUtf8Text(field,32)),boundedReceipt={...receiptWithoutEstimate,omitted_fields:boundedOmittedFields,...receiptWithoutEstimate.omitted_fields.length>boundedOmittedFields.length?{omitted_fields_overflow_count:receiptWithoutEstimate.omitted_fields.length-boundedOmittedFields.length}:{}},recoveryCandidate=compactDiagnosticRecovery(projected.recovery),recovery=recoveryCandidate&&estimateJsonDiagnosticTokens(recoveryCandidate)<=48?recoveryCandidate:void 0,candidate={code:truncateDiagnosticUtf8Text(String(projected.code),320),required:truncateDiagnosticUtf8Text(String(projected.required),320),...recovery?{recovery}:{},...projected.exit_code!==void 0?{exit_code:projected.exit_code}:{}};let fallback=attachDiagnosticReceipt(candidate,boundedReceipt);for(;estimateJsonDiagnosticTokens(fallback)>budget&&boundedReceipt.omitted_fields.length>0;)boundedReceipt.omitted_fields.pop(),boundedReceipt.omitted_fields_overflow_count=receiptWithoutEstimate.omitted_fields.length-boundedReceipt.omitted_fields.length,fallback=attachDiagnosticReceipt(candidate,boundedReceipt);return fallback=shrinkMinimalDiagnosticCandidate(candidate,boundedReceipt,budget),fallback}function projectPmDiagnosticOutput(diagnostic,options={}){const diagnosticRecord=diagnostic,diagnosticClass=options.diagnosticClass??"error",contract=resolvePmDiagnosticOutputBudget(diagnosticClass),explicitBudget=options.maxEstimatedTokens;if(explicitBudget!==void 0&&(!Number.isSafeInteger(explicitBudget)||explicitBudget<contract.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${contract.minimum_max_estimated_tokens}`);const budget=explicitBudget??contract.default_max_estimated_tokens_by_format.json,originalEstimatedTokens=estimateJsonDiagnosticTokens(diagnosticRecord),originalFields=Object.keys(diagnosticRecord);if(originalEstimatedTokens<=budget)return prioritizeDiagnosticFields(structuredClone(diagnosticRecord));let projected;for(const[index,stage]of contract.degradation_ladder.entries()){const candidate=diagnosticCandidate(diagnosticRecord,stage),omittedFields=originalFields.filter(field=>!Object.hasOwn(candidate,field)),withReceipt=attachDiagnosticReceipt(candidate,{diagnostic_class:diagnosticClass,format:"json",budget,budget_source:explicitBudget===void 0?"default":"explicit",original_estimated_tokens:originalEstimatedTokens,truncated:index>0,degradation_steps:contract.degradation_ladder.slice(0,index+1),omitted_fields:omittedFields});if(projected=withReceipt,estimateJsonDiagnosticTokens(withReceipt)<=budget)break}return estimateJsonDiagnosticTokens(projected)>budget&&(projected=createMinimalDiagnosticFallback(projected,budget)),projected}function sanitizeDiagnosticText(text){return stripVTControlCharacters(text).replace(/\r\n/gu,`
2
2
  `).replace(/[^\P{Cc}\n]/gu," ")}function projectPmDiagnosticText(output,correctiveAction,options={}){const diagnosticClass=options.diagnosticClass??"error",contract=resolvePmDiagnosticOutputBudget(diagnosticClass),explicitBudget=options.maxEstimatedTokens;if(explicitBudget!==void 0&&(!Number.isSafeInteger(explicitBudget)||explicitBudget<contract.minimum_max_estimated_tokens))throw new RangeError(`maxEstimatedTokens must be a safe integer >= ${contract.minimum_max_estimated_tokens}`);const budget=explicitBudget??contract.default_max_estimated_tokens_by_format.text,sanitizedOutput=sanitizeDiagnosticText(output),originalEstimatedTokens=estimatePmOutputTokens(Buffer.byteLength(sanitizedOutput,"utf8")),truncated=originalEstimatedTokens>budget,actionPrefix=`What is required:
3
3
  `,actionSuffix=`
4
4
 
5
5
  ${truncateDiagnosticUtf8Text(sanitizedOutput.trimStart().split(/\r?\n/u,1)[0].trim(),320)}
6
6
 
7
- Diagnostic output exceeded its declared ${budget}-token ceiling; rerun with structured JSON for the bounded recovery envelope.`,correctiveActionText=sanitizeDiagnosticText(correctiveAction).trim()||"Inspect the diagnostic code and retry with corrected input.",availableActionBytes=Math.max(1,budget*4-Buffer.byteLength(`${actionPrefix}${actionSuffix}`,"utf8")),projectedOutput=truncated?`${actionPrefix}${truncateDiagnosticUtf8Text(correctiveActionText,availableActionBytes)}${actionSuffix}`:sanitizedOutput;return{output:projectedOutput,diagnostic_output:{diagnostic_class:diagnosticClass,format:"text",budget,budget_source:explicitBudget===void 0?"default":"explicit",original_estimated_tokens:originalEstimatedTokens,estimated_tokens:estimatePmOutputTokens(Buffer.byteLength(projectedOutput,"utf8")),truncated,degradation_steps:truncated?[...contract.degradation_ladder]:["full"],omitted_fields:truncated?["explanation","collections"]:[]}}}export{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,projectPmDiagnosticOutput,projectPmDiagnosticText,resolvePmCommandOutputBudget,resolvePmDiagnosticOutputBudget};
7
+ Diagnostic output exceeded its declared ${budget}-token ceiling; rerun with structured JSON for the bounded recovery envelope.`,correctiveActionText=sanitizeDiagnosticText(correctiveAction).trim()||"Inspect the diagnostic code and retry with corrected input.",availableActionBytes=Math.max(1,budget*4-Buffer.byteLength(`${actionPrefix}${actionSuffix}`,"utf8")),projectedOutput=truncated?`${actionPrefix}${truncateDiagnosticUtf8Text(correctiveActionText,availableActionBytes)}${actionSuffix}`:sanitizedOutput;return{output:projectedOutput,diagnostic_output:{diagnostic_class:diagnosticClass,format:"text",budget,budget_source:explicitBudget===void 0?"default":"explicit",original_estimated_tokens:originalEstimatedTokens,estimated_tokens:estimatePmOutputTokens(Buffer.byteLength(projectedOutput,"utf8")),truncated,degradation_steps:truncated?[...contract.degradation_ladder]:["full"],omitted_fields:truncated?["explanation","collections"]:[]}}}const PM_GENERIC_REFUSAL_GUIDANCE=Object.freeze({required:"Adjust command input or tracker state and retry.",why:Object.freeze(["pm enforces explicit, deterministic contracts for data and command semantics.","Commander validates CLI contracts before execution.","Unexpected runtime failures can occur from environment or extension-level issues.","Validation protects data consistency and deterministic behavior across commands.","Required options define command intent and enforce deterministic write contracts."]),examples:Object.freeze(["pm --help","pm <command> --help"])});function isGenericRefusalRequired(value){return value?.trim()===PM_GENERIC_REFUSAL_GUIDANCE.required}function isGenericRefusalWhy(value){const trimmed=value?.trim();return trimmed!==void 0&&PM_GENERIC_REFUSAL_GUIDANCE.why.includes(trimmed)}function withoutGenericRefusalExamples(values){return(values??[]).filter(value=>!PM_GENERIC_REFUSAL_GUIDANCE.examples.includes(value.trim()))}const PM_RECOVERY_ECHO_FIELDS=Object.freeze(["attempted_command","normalized_args","provided_fields"]);function projectLeanRecoveryPayload(recovery){if(!recovery)return;const{attempted_command:_attempted,normalized_args:_args,provided_fields:_fields,...specific}=recovery;return Object.values(specific).some(value=>value!==void 0)?specific:void 0}export{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_GENERIC_REFUSAL_GUIDANCE,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,PM_RECOVERY_ECHO_FIELDS,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,isGenericRefusalRequired,isGenericRefusalWhy,projectLeanRecoveryPayload,projectPmDiagnosticOutput,projectPmDiagnosticText,resolvePmCommandOutputBudget,resolvePmDiagnosticOutputBudget,withoutGenericRefusalExamples};
8
8
  //# sourceMappingURL=agent-output-contracts.js.map
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5d85fa3a-0b63-5ed7-bb9c-dc33bb8c000c")}catch{}})();const CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Item title [required] (or first positional argument)"},{target:"id",keys:["id"],option:"--id <value>",description:"Explicit id (normalized with id_prefix)"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Item description (allow empty string)"},{target:"type",keys:["type"],option:"--type <value>",description:"Built-in or custom item type"},{target:"template",keys:["template"],option:"--template <value>",description:"Named template defaults; explicit flags override"},{target:"createMode",keys:["createMode","create_mode"],option:"--create-mode <value>",description:"Required fields: strict|progressive",aliasOptions:[{option:"--create_mode <value>",description:"Alias for --create-mode"}]},{target:"schedulePreset",keys:["schedulePreset","schedule_preset"],option:"--schedule-preset <value>",description:"Reminder/Meeting/Event defaults: lightweight",aliasOptions:[{option:"--schedule_preset <value>",description:"Alias for --schedule-preset"}]},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Item status"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Reason for a directly terminal item",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Actual completion time for terminal imports",aliasOptions:[{option:"--completed_at <value>",description:"Alias for --completed-at"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Priority 0..4"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Comma-separated tags"},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags additively on top of --tags (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Item markdown body (allow empty string)"},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Deadline (ISO/date string or relative +6h/+1d/+2w/+6m)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Acceptance criteria (repeatable; values join with '; '; allow empty string)",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Definition of ready (allow empty string)",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"History message (allow empty string)"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Item assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow creating with an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Seed dependency entry (key=value CSV, markdown key:value lines, or - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Type option key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar metadata field by name (repeatable)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Seed reminder entry at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Seed event entry start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Seed comment entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Seed note entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Seed learning entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Seed linked file entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Seed linked test entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Seed linked doc entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0}],CREATE_COMMANDER_STRING_OPTION_CONTRACTS=CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable!==!0).map(entry=>({target:entry.target,keys:entry.keys})),CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS=CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable===!0).map(entry=>({target:entry.target,keys:entry.keys})),UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Set title"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Set description"},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Set body (allow empty string)"},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Set status (use close command for closed)"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Set close reason",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Set priority"},{target:"type",keys:["type"],option:"--type <value>",description:"Set type"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively."},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags to the existing list without replacing it (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"removeTags",keys:["removeTags","remove_tags"],option:"--remove-tags <value>",description:"Remove tags from the existing list (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--remove_tags <value>",description:"Alias for --remove-tags"}]},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Set deadline (ISO/date string or relative)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Set estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Replace the complete acceptance-criteria list (repeatable values join with '; '); use --remove-ac plus --add-ac for one-entry repair",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"addAc",keys:["addAc","add_ac"],option:"--add-ac <value>",description:"Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",repeatable:!0,aliasOptions:[{option:"--add_ac <value>",description:"Alias for --add-ac"}]},{target:"removeAc",keys:["removeAc","remove_ac"],option:"--remove-ac <value>",description:"Remove one semicolon-free acceptance criterion by exact text match; fails if any selector is unmatched (repeatable)",repeatable:!0,aliasOptions:[{option:"--remove_ac <value>",description:"Alias for --remove-ac"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Set definition of ready",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Set planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Set goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Set objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Set business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Set business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Set expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Set why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"Mutation message"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Set assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Set parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow updating to an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Correct the actual completion timestamp on a terminal item"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Set reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Set risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Set confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Set sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Set release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Set blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Set unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Set issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Set issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Set issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Set issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Set issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Set issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Set issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Set affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Set fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Set issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Set regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Set customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Add dependency entries id=<id>,kind=<value>,author=<value>,created_at=<iso|now>,source_kind=<value> (repeatable)",repeatable:!0},{target:"depRemove",keys:["depRemove","dep_remove"],option:"--dep-remove <value>",description:"Remove by dependency id or exact row signature (repeatable)",repeatable:!0,aliasOptions:[{option:"--dep_remove <value>",description:"Alias for --dep-remove"}]},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Append comment seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Append note seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Append learning seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Append linked file path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Append test command=<value>,path=<value>,scope=<project|global>,timeout_seconds=<n>,pm_context_mode=<schema|tracker|auto|none> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Append linked doc path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Set reminders at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Set events start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Set type options key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar metadata field by name (repeatable)",repeatable:!0}],UPDATE_COMMANDER_STRING_OPTION_CONTRACTS=UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable!==!0).map(entry=>({target:entry.target,keys:entry.keys})),UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS=UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable===!0).map(entry=>({target:entry.target,keys:entry.keys}));export{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4e0502de-03c3-5416-89a6-aba7570a8b30")}catch{}})();const CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Item title [required] (or first positional argument)"},{target:"id",keys:["id"],option:"--id <value>",description:"Explicit id (normalized with id_prefix)"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Item description (allow empty string)"},{target:"type",keys:["type"],option:"--type <value>",description:"Built-in or custom item type"},{target:"template",keys:["template"],option:"--template <value>",description:"Named template defaults; explicit flags override"},{target:"createMode",keys:["createMode","create_mode"],option:"--create-mode <value>",description:"Required fields: strict|progressive",aliasOptions:[{option:"--create_mode <value>",description:"Alias for --create-mode"}]},{target:"schedulePreset",keys:["schedulePreset","schedule_preset"],option:"--schedule-preset <value>",description:"Reminder/Meeting/Event defaults: lightweight",aliasOptions:[{option:"--schedule_preset <value>",description:"Alias for --schedule-preset"}]},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Item status"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Reason for a directly terminal item",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Actual completion time for terminal imports",aliasOptions:[{option:"--completed_at <value>",description:"Alias for --completed-at"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Priority 0..4"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Comma-separated tags"},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags additively on top of --tags (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Item markdown body (allow empty string)"},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Deadline (ISO/date string or relative +6h/+1d/+2w/+6m)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Acceptance criteria (repeatable; values join with '; '; allow empty string)",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Definition of ready (allow empty string)",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"History message (allow empty string)"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Item assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow creating with an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Seed dependency entry (key=value CSV, markdown key:value lines, or - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Type option key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar fields by name (repeatable or csv)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Seed reminder entry at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Seed event entry start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Seed comment entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Seed note entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Seed learning entry (text=<value> CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Seed linked file entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Seed linked test entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Seed linked doc entry (CSV/markdown pairs or - for stdin; repeatable)",repeatable:!0}],CREATE_COMMANDER_STRING_OPTION_CONTRACTS=CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable!==!0).map(entry=>({target:entry.target,keys:entry.keys})),CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS=CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable===!0).map(entry=>({target:entry.target,keys:entry.keys})),UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS=[{target:"title",keys:["title"],option:"--title, -t <value>",description:"Set title"},{target:"description",keys:["description"],option:"--description, -d <value>",description:"Set description"},{target:"body",keys:["body"],option:"--body, -b <value>",description:"Set body (allow empty string)"},{target:"status",keys:["status"],option:"--status, -s <value>",description:"Set status (use close command for closed)"},{target:"closeReason",keys:["closeReason","close_reason"],option:"--close-reason <value>",description:"Set close reason",aliasOptions:[{option:"--close_reason <value>",description:"Alias for --close-reason"}]},{target:"priority",keys:["priority"],option:"--priority, -p <value>",description:"Set priority"},{target:"type",keys:["type"],option:"--type <value>",description:"Set type"},{target:"tags",keys:["tags"],option:"--tags <value>",description:"Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively."},{target:"addTags",keys:["addTags","add_tags"],option:"--add-tags <value>",description:"Add tags to the existing list without replacing it (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--add_tags <value>",description:"Alias for --add-tags"}]},{target:"removeTags",keys:["removeTags","remove_tags"],option:"--remove-tags <value>",description:"Remove tags from the existing list (repeatable; CSV accepted)",repeatable:!0,aliasOptions:[{option:"--remove_tags <value>",description:"Alias for --remove-tags"}]},{target:"deadline",keys:["deadline"],option:"--deadline <value>",description:"Set deadline (ISO/date string or relative)"},{target:"estimatedMinutes",keys:["estimate","estimatedMinutes","estimated_minutes"],option:"--estimate, --estimated-minutes <value>",description:"Set estimated minutes",aliasOptions:[{option:"--estimated_minutes <value>",description:"Alias for --estimated-minutes"}]},{target:"acceptanceCriteria",keys:["acceptanceCriteria","acceptance_criteria","ac"],option:"--acceptance-criteria <value>",description:"Replace the complete acceptance-criteria list (repeatable values join with '; '); use --remove-ac plus --add-ac for one-entry repair",repeatable:!0,aliasOptions:[{option:"--acceptance_criteria <value>",description:"Alias for --acceptance-criteria"},{option:"--ac <value>",description:"Alias for --acceptance-criteria"}]},{target:"addAc",keys:["addAc","add_ac"],option:"--add-ac <value>",description:"Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",repeatable:!0,aliasOptions:[{option:"--add_ac <value>",description:"Alias for --add-ac"}]},{target:"removeAc",keys:["removeAc","remove_ac"],option:"--remove-ac <value>",description:"Remove one semicolon-free acceptance criterion by exact text match; fails if any selector is unmatched (repeatable)",repeatable:!0,aliasOptions:[{option:"--remove_ac <value>",description:"Alias for --remove-ac"}]},{target:"definitionOfReady",keys:["definitionOfReady","definition_of_ready"],option:"--definition-of-ready <value>",description:"Set definition of ready",aliasOptions:[{option:"--definition_of_ready <value>",description:"Alias for --definition-of-ready"}]},{target:"order",keys:["order"],option:"--order <value>",description:"Set planning order/rank integer"},{target:"rank",keys:["rank"],option:"--rank <value>",description:"Alias for --order"},{target:"goal",keys:["goal"],option:"--goal <value>",description:"Set goal identifier"},{target:"objective",keys:["objective"],option:"--objective <value>",description:"Set objective identifier"},{target:"value",keys:["value"],option:"--value <value>",description:"Set business value summary"},{target:"impact",keys:["impact"],option:"--impact <value>",description:"Set business impact summary"},{target:"outcome",keys:["outcome"],option:"--outcome <value>",description:"Set expected outcome summary"},{target:"whyNow",keys:["whyNow","why_now"],option:"--why-now <value>",description:"Set why-now rationale",aliasOptions:[{option:"--why_now <value>",description:"Alias for --why-now"}]},{target:"author",keys:["author"],option:"--author <value>",description:"Mutation author"},{target:"message",keys:["message"],option:"--message <value>",description:"Mutation message"},{target:"assignee",keys:["assignee"],option:"--assignee <value>",description:"Set assignee"},{target:"parent",keys:["parent"],option:"--parent <value>",description:"Set parent item ID"},{target:"allowMissingParent",keys:["allowMissingParent","allow_missing_parent"],option:"--allow-missing-parent",description:"Allow updating to an unresolved parent reference and emit a validation warning"},{target:"allowUnresolvedDeps",keys:["allowUnresolvedDeps","allow_unresolved_deps"],option:"--allow-unresolved-deps",description:"Allow unresolved local dependency targets and emit explicit warning receipts"},{target:"completedAt",keys:["completedAt","completed_at"],option:"--completed-at <value>",description:"Correct the actual completion timestamp on a terminal item"},{target:"reviewer",keys:["reviewer"],option:"--reviewer <value>",description:"Set reviewer"},{target:"risk",keys:["risk"],option:"--risk <value>",description:"Set risk level: low|med|medium|high|critical (med persists as medium)"},{target:"confidence",keys:["confidence"],option:"--confidence <value>",description:"Set confidence level: 0..100|low|med|medium|high (med persists as medium)"},{target:"sprint",keys:["sprint"],option:"--sprint <value>",description:"Set sprint identifier"},{target:"release",keys:["release"],option:"--release <value>",description:"Set release identifier"},{target:"blockedBy",keys:["blockedBy","blocked_by"],option:"--blocked-by <value>",description:"Set latest blocked-by item ID or reason; resolved item IDs append a blocked_by dependency edge",aliasOptions:[{option:"--blocked_by <value>",description:"Alias for --blocked-by"}]},{target:"blockedReason",keys:["blockedReason","blocked_reason"],option:"--blocked-reason <value>",description:"Set blocked reason",aliasOptions:[{option:"--blocked_reason <value>",description:"Alias for --blocked-reason"}]},{target:"unblockNote",keys:["unblockNote","unblock_note"],option:"--unblock-note <value>",description:"Set unblock rationale note",aliasOptions:[{option:"--unblock_note <value>",description:"Alias for --unblock-note"}]},{target:"reporter",keys:["reporter"],option:"--reporter <value>",description:"Set issue reporter"},{target:"severity",keys:["severity"],option:"--severity <value>",description:"Set issue severity: low|med|medium|high|critical (med persists as medium)"},{target:"environment",keys:["environment"],option:"--environment <value>",description:"Set issue environment context"},{target:"reproSteps",keys:["reproSteps","repro_steps"],option:"--repro-steps <value>",description:"Set issue reproduction steps",aliasOptions:[{option:"--repro_steps <value>",description:"Alias for --repro-steps"}]},{target:"resolution",keys:["resolution"],option:"--resolution <value>",description:"Set issue resolution summary"},{target:"expectedResult",keys:["expectedResult","expected_result","expected"],option:"--expected-result <value>",description:"Set issue expected behavior",aliasOptions:[{option:"--expected_result <value>",description:"Alias for --expected-result"},{option:"--expected <value>",description:"Short alias for --expected-result"}]},{target:"actualResult",keys:["actualResult","actual_result","actual"],option:"--actual-result <value>",description:"Set issue observed behavior",aliasOptions:[{option:"--actual_result <value>",description:"Alias for --actual-result"},{option:"--actual <value>",description:"Short alias for --actual-result"}]},{target:"affectedVersion",keys:["affectedVersion","affected_version"],option:"--affected-version <value>",description:"Set affected version identifier",aliasOptions:[{option:"--affected_version <value>",description:"Alias for --affected-version"}]},{target:"fixedVersion",keys:["fixedVersion","fixed_version"],option:"--fixed-version <value>",description:"Set fixed version identifier",aliasOptions:[{option:"--fixed_version <value>",description:"Alias for --fixed-version"}]},{target:"component",keys:["component"],option:"--component <value>",description:"Set issue component ownership"},{target:"regression",keys:["regression"],option:"--regression [value]",description:"Set regression marker; bare flag means true, or pass true|false|1|0"},{target:"customerImpact",keys:["customerImpact","customer_impact"],option:"--customer-impact <value>",description:"Set customer impact summary",aliasOptions:[{option:"--customer_impact <value>",description:"Alias for --customer-impact"}]},{target:"dep",keys:["dep"],option:"--dep <value>",description:"Add dependency entries id=<id>,kind=<value>,author=<value>,created_at=<iso|now>,source_kind=<value> (repeatable)",repeatable:!0},{target:"depRemove",keys:["depRemove","dep_remove"],option:"--dep-remove <value>",description:"Remove by dependency id or exact row signature (repeatable)",repeatable:!0,aliasOptions:[{option:"--dep_remove <value>",description:"Alias for --dep-remove"}]},{target:"comment",keys:["comment"],option:"--comment <value>",description:"Append comment seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"note",keys:["note"],option:"--note <value>",description:"Append note seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"learning",keys:["learning"],option:"--learning <value>",description:"Append learning seed author=<value>,created_at=<iso|now>,text=<value> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"file",keys:["file","linkedFile"],option:"--file <value>",description:"Append linked file path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-file <value>",description:"Alias for --file (cross-surface name)"}]},{target:"test",keys:["test","linkedTest"],option:"--test <value>",description:"Append test command=<value>,path=<value>,scope=<project|global>,timeout_seconds=<n>,pm_context_mode=<schema|tracker|auto|none> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--linked-test <value>",description:"Alias for --test (cross-surface name)"}]},{target:"doc",keys:["doc"],option:"--doc <value>",description:"Append linked doc path=<value>,scope=<project|global>,note=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"reminder",keys:["reminder"],option:"--reminder <value>",description:"Set reminders at=<iso|relative>,text=<text> (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"event",keys:["event"],option:"--event <value>",description:"Set events start=<iso|relative>,end=<iso|relative>,duration=<relative|30min|PT30M>,title=<text>,all_day=<true|false>,recur_* fields (also accepts markdown pairs and - for stdin; repeatable)",repeatable:!0},{target:"typeOption",keys:["typeOption","type_option"],option:"--type-option <value>",description:"Set type options key=value or key=<name>,value=<value> (also accepts key:value and markdown pairs; use - for stdin; repeatable)",repeatable:!0,aliasOptions:[{option:"--type_option <value>",description:"Alias for --type-option"}]},{target:"field",keys:["field"],option:"--field <name=value>",description:"Set a field declared by an active extension registerItemFields registration (repeatable)",repeatable:!0},{target:"unset",keys:["unset"],option:"--unset <field>",description:"Clear scalar fields by name (repeatable or csv)",repeatable:!0}],UPDATE_COMMANDER_STRING_OPTION_CONTRACTS=UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable!==!0).map(entry=>({target:entry.target,keys:entry.keys})),UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS=UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS.filter(entry=>entry.repeatable===!0).map(entry=>({target:entry.target,keys:entry.keys}));export{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS};
2
2
  //# sourceMappingURL=commander-mutation-options.js.map
@@ -23,6 +23,8 @@ value_type?:"string" | "number" | "boolean";
23
23
  default?:string | number | boolean | Array<string | number | boolean>;
24
24
  /** Explicit argv value-token grammar. When absent, legacy core vocabulary inference applies. */
25
25
  value_arity?:"none" | "required" | "optional";
26
+ /** Closed value domain the flag accepts, when the command declares one (for example `--depth brief|standard|deep|full`). */
27
+ values?:readonly string[];
26
28
  /** Marks a presentation-only flag that may change paging or rendering without invalidating continuation. Omission means the flag is query-semantic. */
27
29
  cursor_semantics?:"presentation";
28
30
  /** Host reservation boundary: inherited flags are forbidden on extensions; root-only flags may have command-local meanings. */