@unbrained/pm-cli 2026.9.9 → 2026.9.10

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 (124) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +17 -0
  3. package/dist/cli/command-namespaces.d.ts +9 -0
  4. package/dist/cli/command-namespaces.js +2 -0
  5. package/dist/cli/help-content.js +1 -1
  6. package/dist/cli/help-json-payload.d.ts +5 -1
  7. package/dist/cli/help-json-payload.js +2 -2
  8. package/dist/cli/main.d.ts +1 -0
  9. package/dist/cli/main.js +3 -3
  10. package/dist/cli/register-mutation.js +2 -2
  11. package/dist/cli/register-operations.d.ts +0 -5
  12. package/dist/cli/register-operations.js +1 -1
  13. package/dist/cli-bundle/bundle-manifest.json +154 -154
  14. package/dist/cli-bundle/chunks/chunk-4SFBH77G.js +2233 -0
  15. package/dist/cli-bundle/chunks/{chunk-4VL5P22L.js → chunk-74RGSPLL.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-WQKMSFBV.js → chunk-7WIHZI2M.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-L5RCDKQ2.js → chunk-EOCKPCEY.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-GLQMKUGP.js +2 -0
  19. package/dist/cli-bundle/chunks/{chunk-OHNLSGGV.js → chunk-I6XT3DLQ.js} +2 -2
  20. package/dist/cli-bundle/chunks/chunk-MACGGTLQ.js +29 -0
  21. package/dist/cli-bundle/chunks/{chunk-ECBLPN7B.js → chunk-NKOYVKFM.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-Z3XVXUVF.js → chunk-P6BEYAON.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-3IPRM75M.js → chunk-PYUITRSV.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-T3AMFUCN.js +2 -0
  25. package/dist/cli-bundle/chunks/{chunk-D3YVILJJ.js → chunk-TSWEX72T.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-J6ERHBV2.js → chunk-YKQTETJI.js} +71 -71
  27. package/dist/cli-bundle/chunks/{register-list-query-UIHRCS6D.js → register-list-query-CUIW7SSE.js} +2 -2
  28. package/dist/cli-bundle/chunks/register-mutation-5F5CYUWZ.js +20 -0
  29. package/dist/cli-bundle/chunks/register-operations-XIZPLPQY.js +2 -0
  30. package/dist/cli-bundle/chunks/{register-setup-PERI45EM.js → register-setup-JVGPCAIL.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-OQUGRHKV.js → chunk-26O2WB73.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-5YU75QLV.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-QQQ4SAUO.js → chunk-7N5MRONP.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-B2CMFYRZ.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-PNKIANFZ.js → chunk-CRY5MHEI.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-YCDQ2N23.js → chunk-F6WKFXBT.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-BUCJUZVG.js → chunk-FHUARRMA.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-5FHTCOHS.js → chunk-M36SF4GE.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-TTYXF5YD.js → chunk-OROZM37I.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-XNR3DM6J.js → chunk-PNGYYQY7.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-ZTCE4UO6.js → chunk-SL5YVVPV.js} +3 -3
  42. package/dist/cli-bundle/focused-chunks/{chunk-XSS3APUF.js → chunk-TPOL4TWE.js} +5 -5
  43. package/dist/cli-bundle/focused-chunks/{chunk-7PC4R5QB.js → chunk-U5SHHU7E.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-2WSBXIGF.js → chunk-XSMA2W6Q.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-ZAWAL2CG.js +2 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-7N6DOREF.js → chunk-ZDNAWWQI.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-YJUXGS57.js → chunk-ZJHYQOTM.js} +2 -2
  48. package/dist/cli-bundle/main.js +26 -26
  49. package/dist/cli-bundle/sdk-authoring.js +1 -1
  50. package/dist/cli-bundle/sdk-contracts.js +2 -2
  51. package/dist/cli-bundle/sdk-core.js +37 -37
  52. package/dist/cli-bundle/sdk-governance.js +1 -1
  53. package/dist/cli-bundle/sdk-graph.js +1 -1
  54. package/dist/cli-bundle/sdk-merge.js +42 -42
  55. package/dist/cli-bundle/sdk-query.js +1 -1
  56. package/dist/cli-bundle/sdk-runtime.js +1 -1
  57. package/dist/cli-bundle/sdk-testing.js +1 -1
  58. package/dist/cli-bundle/sdk.js +10 -10
  59. package/dist/sdk/agent/item-addressing.js +1 -1
  60. package/dist/sdk/agent-capability-contracts.js +1 -1
  61. package/dist/sdk/cli-bootstrap.js +1 -1
  62. package/dist/sdk/cli-contracts/command-aliases.d.ts +11 -1
  63. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  64. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  65. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  66. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  67. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +4 -1
  68. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  69. package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -3
  70. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  71. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +2 -0
  72. package/dist/sdk/cli-contracts.d.ts +1 -1
  73. package/dist/sdk/cli-contracts.js +1 -1
  74. package/dist/sdk/completion.js +359 -346
  75. package/dist/sdk/index.d.ts +2 -1
  76. package/dist/sdk/index.js +1 -1
  77. package/dist/sdk/lifecycle/claim.js +1 -1
  78. package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +1 -1
  79. package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
  80. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  81. package/dist/sdk/lifecycle/task-composition.d.ts +17 -0
  82. package/dist/sdk/lifecycle/task-composition.js +2 -0
  83. package/dist/sdk/public-surface.json +1 -1
  84. package/dist/sdk/query/workspace-contracts.d.ts +3 -0
  85. package/dist/sdk/query/workspace-contracts.js +2 -0
  86. package/dist/sdk/runtime-input.js +1 -1
  87. package/dist/sdk/runtime.d.ts +69 -9
  88. package/dist/sdk/runtime.js +1 -1
  89. package/docs/COMMANDS.md +26 -24
  90. package/docs/COMMAND_NAMESPACES.md +65 -0
  91. package/docs/LIFECYCLE_COMMANDS.md +77 -0
  92. package/docs/README.md +2 -0
  93. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +6 -6
  94. package/docs/generated/AGENT_COMMAND_SURFACE.md +19 -0
  95. package/docs/generated/FLAG_LEXICON_BUDGETS.md +21 -3
  96. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +2 -2
  97. package/marketplace.json +2 -2
  98. package/package.json +1 -1
  99. package/packages/pm-beads/package.json +1 -1
  100. package/packages/pm-calendar/package.json +1 -1
  101. package/packages/pm-command-kit/package.json +1 -1
  102. package/packages/pm-digital-twin/package.json +1 -1
  103. package/packages/pm-governance-audit/README.md +4 -2
  104. package/packages/pm-governance-audit/package.json +1 -1
  105. package/packages/pm-guide-shell/package.json +1 -1
  106. package/packages/pm-kanban/package.json +1 -1
  107. package/packages/pm-lifecycle-hooks/package.json +1 -1
  108. package/packages/pm-linked-test-adapters/package.json +1 -1
  109. package/packages/pm-search-advanced/README.md +6 -4
  110. package/packages/pm-search-advanced/package.json +1 -1
  111. package/packages/pm-templates/package.json +1 -1
  112. package/packages/pm-todos/package.json +1 -1
  113. package/packages/pm-vcs/package.json +1 -1
  114. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  115. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  116. package/dist/cli-bundle/chunks/chunk-AAFBV3U3.js +0 -29
  117. package/dist/cli-bundle/chunks/chunk-JUNJ5EKI.js +0 -2
  118. package/dist/cli-bundle/chunks/chunk-NSAPNEYH.js +0 -2
  119. package/dist/cli-bundle/chunks/chunk-XZ6T7YPP.js +0 -2217
  120. package/dist/cli-bundle/chunks/register-mutation-WHWMGRVX.js +0 -20
  121. package/dist/cli-bundle/chunks/register-operations-64YZYTC5.js +0 -2
  122. package/dist/cli-bundle/focused-chunks/chunk-2W4XIYOB.js +0 -2
  123. package/dist/cli-bundle/focused-chunks/chunk-FE3BABLJ.js +0 -2
  124. package/dist/cli-bundle/focused-chunks/chunk-IWITF53W.js +0 -2
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="beeb59ac-0136-5821-bf6b-fefc68212b8a")}catch(e2){}})();import{findBootstrapCommandTokenIndex}from"../cli-contracts/bootstrap-command-scanner.js";import{resolvePmHistoryOperation}from"../cli-contracts/command-aliases.js";import{resolveSubcommandFlagContractsForCommand}from"../cli-contracts.js";const ITEM_ID_ALIAS_COMMANDS=new Set(["append","claim","close","close-task","comments","copy","delete","deps","docs","files","focus","get","history","history-compact","history-redact","history-repair","learnings","notes","pause-task","release","restore","start-task","test","update"]);const ITEM_ID_ALIAS_SUBCOMMANDS=new Map([["files","discover"],["item","complete"]]);const TRAILING_POSITIONAL_COUNTS=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function supportsItemIdAlias(commandName){const normalized=resolvePmHistoryOperation(commandName?.trim().toLowerCase()??"");return ITEM_ID_ALIAS_COMMANDS.has(normalized)||ITEM_ID_ALIAS_SUBCOMMANDS.has(normalized)}function resolveItemAddressIndex(argv,commandIndex,commandName){if(commandName==="history"){const leafOffset=findBootstrapCommandTokenIndex(argv.slice(commandIndex+1));const leafIndex=leafOffset===void 0?void 0:commandIndex+1+leafOffset;if(leafIndex===void 0)return commandIndex+1;const candidate=`${commandName} ${argv[leafIndex]}`;const operation=resolvePmHistoryOperation(candidate);if(operation!==candidate)return operation==="activity"?void 0:leafIndex+1}const declaredSubcommand=ITEM_ID_ALIAS_SUBCOMMANDS.get(commandName);if(declaredSubcommand===void 0)return commandIndex+1;const usesDeclaredSubcommand=argv[commandIndex+1]?.toLowerCase()===declaredSubcommand;if(!usesDeclaredSubcommand&&!ITEM_ID_ALIAS_COMMANDS.has(commandName)){return void 0}return commandIndex+(usesDeclaredSubcommand?2:1)}function buildFlagContractMap(commandPath){const contractsByFlag=new Map;for(const contract of resolveSubcommandFlagContractsForCommand(commandPath)){for(const flag of[contract.flag,contract.short,...contract.aliases??[]]){if(flag)contractsByFlag.set(flag,contract)}}return contractsByFlag}function collectNamedItemIds(argv){const namedIds=[];for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--id"){namedIds.push({index,consumed:2,value:argv[index+1]});index+=1}else if(token.startsWith("--id=")){namedIds.push({index,consumed:1,value:token.slice("--id=".length)})}}return namedIds}function consumesSeparateFlagValue(token,nextToken,contractsByFlag){const separatorIndex=token.indexOf("=");if(separatorIndex>=0||nextToken===void 0||nextToken.startsWith("-")){return false}const contract=contractsByFlag.get(token);return contract!==void 0&&contract.value_type!=="boolean"}function hasPositionalItemId(argv,addressIndex,commandPath,namedIndex,contractsByFlag){let trailingPositionals=0;for(let index=addressIndex;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--id"){index+=1;continue}if(token.startsWith("--id="))continue;if(!token.startsWith("-")){if(index<namedIndex)return true;trailingPositionals+=1;continue}if(consumesSeparateFlagValue(token,argv[index+1],contractsByFlag)){index+=1}}return trailingPositionals>(TRAILING_POSITIONAL_COUNTS.get(resolvePmHistoryOperation(commandPath))??0)}function normalizeItemAddressInvocation(argv){const commandIndex=findBootstrapCommandTokenIndex(argv);const commandName=commandIndex===void 0?void 0:argv[commandIndex]?.toLowerCase();if(!supportsItemIdAlias(commandName)){return{argv:[...argv],changed:false,conflict:false}}const addressIndex=resolveItemAddressIndex(argv,commandIndex,commandName);if(addressIndex===void 0){return{argv:[...argv],changed:false,conflict:false}}const commandPath=addressIndex>commandIndex+1?`${commandName} ${argv[addressIndex-1]}`:commandName;const contractsByFlag=buildFlagContractMap(commandPath);const namedIds=collectNamedItemIds(argv);const named=namedIds[0];if(!named||!named.value?.trim()){return{argv:[...argv],changed:false,conflict:false}}if(namedIds.length>1||hasPositionalItemId(argv,addressIndex,commandPath,named.index,contractsByFlag)){return{argv:[...argv],changed:false,conflict:true,itemId:named.value}}const withoutNamed=[...argv.slice(0,named.index),...argv.slice(named.index+named.consumed)];const normalizedCommandIndex=findBootstrapCommandTokenIndex(withoutNamed);const normalizedAddressIndex=resolveItemAddressIndex(withoutNamed,normalizedCommandIndex,commandName);withoutNamed.splice(normalizedAddressIndex,0,named.value);return{argv:withoutNamed,changed:true,conflict:false,itemId:named.value}}export{normalizeItemAddressInvocation,supportsItemIdAlias};
1
+ !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7f321c80-d72d-5c89-9686-4d09d2be0d55")}catch(e2){}})();import{findBootstrapCommandTokenIndex}from"../cli-contracts/bootstrap-command-scanner.js";import{resolvePmCommandOperation}from"../cli-contracts/command-aliases.js";import{resolveSubcommandFlagContractsForCommand}from"../cli-contracts.js";const ITEM_ID_ALIAS_COMMANDS=new Set(["append","claim","close","close-task","comments","copy","delete","deps","docs","files","focus","get","history","history-compact","history-redact","history-repair","learnings","notes","pause-task","release","restore","start-task","test","update"]);const ITEM_ID_ALIAS_SUBCOMMANDS=new Map([["files","discover"],["item","complete"]]);const TRAILING_POSITIONAL_COUNTS=new Map([["append",1],["close",1],["close-task",1],["comments",1],["item complete",1],["learnings",1],["notes",1],["restore",1]]);function supportsItemIdAlias(commandName){const normalized=resolvePmCommandOperation(commandName?.trim().toLowerCase()??"");return ITEM_ID_ALIAS_COMMANDS.has(normalized)||ITEM_ID_ALIAS_SUBCOMMANDS.has(normalized)}function resolveNamespacedItemAddressIndex(argv,commandIndex,commandName){const fallback=ITEM_ID_ALIAS_COMMANDS.has(commandName)?commandIndex+1:void 0;const leafOffset=findBootstrapCommandTokenIndex(argv.slice(commandIndex+1));if(leafOffset===void 0)return fallback;const leafIndex=commandIndex+1+leafOffset;const candidate=`${commandName} ${argv[leafIndex]}`;const operation=resolvePmCommandOperation(candidate);if(operation===candidate)return fallback;return supportsItemIdAlias(operation)?leafIndex+1:void 0}function resolveItemAddressIndex(argv,commandIndex,commandName){if(["history","context","ctx","update","close"].includes(commandName)){return resolveNamespacedItemAddressIndex(argv,commandIndex,commandName)}const declaredSubcommand=ITEM_ID_ALIAS_SUBCOMMANDS.get(commandName);if(declaredSubcommand===void 0)return commandIndex+1;const usesDeclaredSubcommand=argv[commandIndex+1]?.toLowerCase()===declaredSubcommand;if(!usesDeclaredSubcommand&&!ITEM_ID_ALIAS_COMMANDS.has(commandName)){return void 0}return commandIndex+(usesDeclaredSubcommand?2:1)}function buildFlagContractMap(commandPath){const contractsByFlag=new Map;for(const contract of resolveSubcommandFlagContractsForCommand(commandPath)){for(const flag of[contract.flag,contract.short,...contract.aliases??[]]){if(flag)contractsByFlag.set(flag,contract)}}return contractsByFlag}function collectNamedItemIds(argv){const namedIds=[];for(let index=0;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--id"){namedIds.push({index,consumed:2,value:argv[index+1]});index+=1}else if(token.startsWith("--id=")){namedIds.push({index,consumed:1,value:token.slice("--id=".length)})}}return namedIds}function consumesSeparateFlagValue(token,nextToken,contractsByFlag){const separatorIndex=token.indexOf("=");if(separatorIndex>=0||nextToken===void 0||nextToken.startsWith("-")){return false}const contract=contractsByFlag.get(token);return contract!==void 0&&contract.value_type!=="boolean"}function hasPositionalItemId(argv,addressIndex,commandPath,namedIndex,contractsByFlag){let trailingPositionals=0;for(let index=addressIndex;index<argv.length;index+=1){const token=argv[index];if(token==="--")break;if(token==="--id"){index+=1;continue}if(token.startsWith("--id="))continue;if(!token.startsWith("-")){if(index<namedIndex)return true;trailingPositionals+=1;continue}if(consumesSeparateFlagValue(token,argv[index+1],contractsByFlag)){index+=1}}return trailingPositionals>(TRAILING_POSITIONAL_COUNTS.get(resolvePmCommandOperation(commandPath))??0)}function normalizeItemAddressInvocation(argv){const commandIndex=findBootstrapCommandTokenIndex(argv);const commandName=commandIndex===void 0?void 0:argv[commandIndex]?.toLowerCase();if(commandName!=="context"&&commandName!=="ctx"&&!supportsItemIdAlias(commandName)){return{argv:[...argv],changed:false,conflict:false}}const addressIndex=resolveItemAddressIndex(argv,commandIndex,commandName);if(addressIndex===void 0){return{argv:[...argv],changed:false,conflict:false}}const commandPath=addressIndex>commandIndex+1?`${commandName} ${argv[addressIndex-1]}`:commandName;const contractsByFlag=buildFlagContractMap(commandPath);const namedIds=collectNamedItemIds(argv);const named=namedIds[0];if(!named||!named.value?.trim()){return{argv:[...argv],changed:false,conflict:false}}if(namedIds.length>1||hasPositionalItemId(argv,addressIndex,commandPath,named.index,contractsByFlag)){return{argv:[...argv],changed:false,conflict:true,itemId:named.value}}const withoutNamed=[...argv.slice(0,named.index),...argv.slice(named.index+named.consumed)];const normalizedCommandIndex=findBootstrapCommandTokenIndex(withoutNamed);const normalizedAddressIndex=resolveItemAddressIndex(withoutNamed,normalizedCommandIndex,commandName);withoutNamed.splice(normalizedAddressIndex,0,named.value);return{argv:withoutNamed,changed:true,conflict:false,itemId:named.value}}export{normalizeItemAddressInvocation,supportsItemIdAlias};
2
2
  //# sourceMappingURL=item-addressing.js.map
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0d5fa28d-33f0-53c7-b92f-82df22bd0c9a")}catch(e2){}})();import{PM_CORE_COMMAND_NAMES}from"./cli-contracts/enum-contracts.js";const CORE_COMMANDS=new Set(["claim","close","context","create","get","help","init","list","next","plan","release","search","update","validate"]);const STANDARD_COMMANDS=new Set(["append","comments","config","contracts","deps","docs","events","files","focus","graph","health","history","learnings","list-all","list-blocked","list-closed","list-in-progress","list-open","notes","profile","schema","test"]);const COMMANDS_BY_FAMILY=Object.freeze({workspace:new Set(["config","gc","health","init","merge","profile","schema","telemetry","workspace"]),intake:new Set(["copy","create","focus","item","restore"]),context:new Set(["activity","aggregate","context","ctx","duplicates","eval","get","help","list","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","next","search","stats"]),lifecycle:new Set(["claim","close","close-many","close-task","delete","pause-task","item-reopen","release","start-task","update","update-many"]),evidence:new Set(["append","comments","docs","events","files","history","history-author-acknowledge","history-compact","history-redact","history-repair","learnings","notes"]),graph:new Set(["deps","graph","plan"]),quality:new Set(["assurance","contracts","test","test-all","validate"]),automation:new Set(["event","meet","remind"])});const EXTENSION_COMMANDS=new Set(["extension","install","package","packages","upgrade"]);function resolvePmCommandCapabilityFamily(command){const normalized=command.trim().toLowerCase();for(const[family,commands]of Object.entries(COMMANDS_BY_FAMILY)){if(commands.has(normalized))return family}return EXTENSION_COMMANDS.has(normalized)?"extensions":"internal"}const PM_COMMAND_CAPABILITY_CONTRACTS=Object.freeze([...PM_CORE_COMMAND_NAMES.flatMap(command=>command==="item"?["item-reopen"]:[command]).map(command=>({command,tier:CORE_COMMANDS.has(command)?"core":STANDARD_COMMANDS.has(command)?"standard":"full",family:resolvePmCommandCapabilityFamily(command)})),{command:"completion-statuses",tier:"internal",family:"internal"},{command:"completion-tags",tier:"internal",family:"internal"},{command:"completion-types",tier:"internal",family:"internal"},{command:"test-runs-worker",tier:"internal",family:"internal"}]);const PM_COMMAND_VISIBILITY_CONTRACTS=PM_COMMAND_CAPABILITY_CONTRACTS;const PM_CORE_HELP_BUDGET=Object.freeze({max_lines:50,max_utf8_bytes:6e3});const PM_CORE_HELP_OPTION_FLAGS=Object.freeze(["-V, --version","--all","--json","--output-include <fields>","--output-limit <count>","--output-budget <tokens|unbounded>","--output-cursor <cursor>","--pm-path <dir>","--no-extensions","--no-pager","--explain","-h, --help"]);function measurePmCoreHelp(text){const lines=text===""?0:text.split(/\r?\n/).length;const utf8Bytes=Buffer.byteLength(text,"utf8");return{lines,utf8_bytes:utf8Bytes,within_budget:lines<=PM_CORE_HELP_BUDGET.max_lines&&utf8Bytes<=PM_CORE_HELP_BUDGET.max_utf8_bytes}}const TIER_ORDER={core:0,standard:1,full:2,internal:3};const COMMAND_TIER_BY_NAME=new Map(PM_COMMAND_VISIBILITY_CONTRACTS.map(({command,tier})=>[command,tier]));function resolvePmCommandVisibilityTier(command,extensionTier="standard"){return COMMAND_TIER_BY_NAME.get(command.trim().toLowerCase())??extensionTier}function listPmCommandsForTier(tier){return listPmCommandsForTierFromContracts(tier,PM_COMMAND_CAPABILITY_CONTRACTS)}function listPmCommandsForTierFromContracts(tier,contracts){const maximum=TIER_ORDER[tier];return contracts.filter(entry=>entry.tier!=="internal"&&TIER_ORDER[entry.tier]<=maximum).map(entry=>entry.command)}function listPmCommandsForFamily(family){return listPmCommandsForFamilyFromContracts(family,PM_COMMAND_CAPABILITY_CONTRACTS)}function listPmCommandsForFamilyFromContracts(family,contracts){return contracts.filter(entry=>entry.family===family).map(entry=>entry.command)}const CAPABILITY_FAMILY_ORDER=["workspace","intake","context","lifecycle","evidence","graph","quality","automation","extensions","internal"];const CAPABILITY_ROUTING_EXCLUDED_ALIASES=new Set(["ctx","extension","install","item-reopen","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","packages","upgrade"]);function listPmCommandCapabilityGroups(contracts=PM_COMMAND_CAPABILITY_CONTRACTS){return CAPABILITY_FAMILY_ORDER.map(family=>({family,commands:listPmCommandsForFamilyFromContracts(family,contracts).filter(command=>contracts.find(entry=>entry.command===command)?.tier!=="internal"&&!CAPABILITY_ROUTING_EXCLUDED_ALIASES.has(command))})).filter(({commands})=>commands.length>0)}const PM_MCP_TOOL_COMMAND_CONTRACTS=Object.freeze({pm_append:"append",pm_claim:"claim",pm_close:"close",pm_comments:"comments",pm_config:"config",pm_context:"context",pm_contracts:"contracts",pm_copy:"copy",pm_create:"create",pm_deps:"deps",pm_discover:"help",pm_docs:"docs",pm_events:"history",pm_files:"files",pm_focus:"focus",pm_get:"get",pm_graph:"graph",pm_health:"health",pm_learnings:"learnings",pm_list:"list",pm_mutate:"update",pm_next:"next",pm_notes:"notes",pm_plan:"plan",pm_profile:"profile",pm_release:"release",pm_run:"package",pm_schema:"schema",pm_search:"search",pm_test:"test",pm_update:"update",pm_validate:"validate"});function listPmMcpToolsForProfile(availableTools,profile){return listPmMcpToolsForProfileFromContracts(availableTools,profile,PM_COMMAND_CAPABILITY_CONTRACTS)}function listPmMcpToolsForProfileFromContracts(availableTools,profile,contracts){if(profile==="full")return[...availableTools];const visibleCommands=new Set(listPmCommandsForTierFromContracts(profile,contracts));return availableTools.filter(tool=>{const command=PM_MCP_TOOL_COMMAND_CONTRACTS[tool];return command!==void 0&&visibleCommands.has(command)})}const PM_MCP_RESOURCE_CONTRACTS=Object.freeze([{uri:"pm://workspace/context",name:"Workspace context",description:"Bounded project context for orientation, including active hierarchy and progress.",mimeType:"application/json"},{uri:"pm://workspace/focus",name:"Active focus",description:"The session focus that supplies the default create parent.",mimeType:"application/json"},{uri:"pm://workspace/claims",name:"Active claims",description:"Bounded in-progress work and active ownership context.",mimeType:"application/json"},{uri:"pm://workspace/agent-guide",name:"Agent guidance",description:"Repository-local AGENTS.md instructions, bounded for safe host attachment.",mimeType:"text/markdown"}]);const PM_MCP_PROMPT_CONTRACTS=Object.freeze([{name:"orient",description:"Build bounded live context, search all statuses, and select canonical work without creating duplicates.",arguments:[{name:"request",description:"The user's requested outcome or topic.",required:true},{name:"scope",description:"Optional bounded workspace or subsystem scope.",required:false}],template:"Orient to the live pm workspace for: {{request}}. Scope hint: {{scope}}. Read context, search all statuses, inspect full metadata for relevant items, and select canonical lineage before any mutation."},{name:"claim-and-start",description:"Claim one canonical item and begin implementation with linked context.",arguments:[{name:"id",description:"Canonical pm item id.",required:true}],template:"Read {{id}} in full, claim it, set it in_progress, then implement only its acceptance scope while linking files, docs, tests, and evidence."},{name:"record-evidence-and-close",description:"Record exact verification evidence, close the item, and release ownership.",arguments:[{name:"id",description:"Canonical pm item id.",required:true},{name:"evidence",description:"Exact verification and outcome evidence.",required:true}],template:"For {{id}}, record this evidence: {{evidence}}. Verify linked tests, close only if acceptance is met, then release the claim."}]);function renderPmCommandVisibilityMarkdown(){return renderPmCommandVisibilityMarkdownFromContracts(PM_COMMAND_CAPABILITY_CONTRACTS)}function renderPmCommandVisibilityMarkdownFromContracts(contracts){const rows=contracts.map(({command,tier,family})=>`| \`${command}\` | ${tier} | ${family} |`);return["# Generated agent command surface","","This file is generated from `PM_COMMAND_CAPABILITY_CONTRACTS`. Do not edit it manually.","","| Command | Minimum visibility tier | Capability family |","| --- | --- | --- |",...rows,""].join("\n")}function renderPmCapabilityRoutingMarkdown(contracts=PM_COMMAND_CAPABILITY_CONTRACTS){const rows=listPmCommandCapabilityGroups(contracts).map(({family,commands})=>`| ${family} | ${commands.map(command=>`\`${command}\``).join(", ")} |`);return["# Generated agent capability routing","","Tracker: `pm-kxci8x`.","","This file is generated from `PM_COMMAND_CAPABILITY_CONTRACTS`. Do not edit it manually.","","| Capability family | Commands |","| --- | --- |",...rows,""].join("\n")}export{PM_COMMAND_CAPABILITY_CONTRACTS,PM_COMMAND_VISIBILITY_CONTRACTS,PM_CORE_HELP_BUDGET,PM_CORE_HELP_OPTION_FLAGS,PM_MCP_PROMPT_CONTRACTS,PM_MCP_RESOURCE_CONTRACTS,PM_MCP_TOOL_COMMAND_CONTRACTS,listPmCommandCapabilityGroups,listPmCommandsForFamily,listPmCommandsForFamilyFromContracts,listPmCommandsForTier,listPmCommandsForTierFromContracts,listPmMcpToolsForProfile,listPmMcpToolsForProfileFromContracts,measurePmCoreHelp,renderPmCapabilityRoutingMarkdown,renderPmCommandVisibilityMarkdown,renderPmCommandVisibilityMarkdownFromContracts,resolvePmCommandCapabilityFamily,resolvePmCommandVisibilityTier};
1
+ !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="498f7dad-b360-5494-ab5e-7ed5cd319207")}catch(e2){}})();import{PM_CORE_COMMAND_NAMES}from"./cli-contracts/enum-contracts.js";import{PM_COMMAND_ALIAS_CONTRACTS,PM_NAMESPACED_COMMAND_ALIASES,resolvePmCommandOperation}from"./cli-contracts/command-aliases.js";const CORE_COMMANDS=new Set(["claim","close","context","create","get","help","init","list","next","plan","release","search","update","validate"]);const STANDARD_COMMANDS=new Set(["append","comments","config","contracts","deps","docs","events","files","focus","graph","health","history","learnings","list-all","list-blocked","list-closed","list-in-progress","list-open","notes","profile","schema","test"]);const COMMANDS_BY_FAMILY=Object.freeze({workspace:new Set(["config","gc","health","init","merge","profile","schema","telemetry","workspace"]),intake:new Set(["copy","create","focus","item","restore"]),context:new Set(["activity","aggregate","context","ctx","duplicates","eval","get","help","list","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","next","search","stats"]),lifecycle:new Set(["claim","close","close-many","close-task","delete","pause-task","item-reopen","release","start-task","update","update-many"]),evidence:new Set(["append","comments","docs","events","files","history","history-author-acknowledge","history-compact","history-redact","history-repair","learnings","notes"]),graph:new Set(["deps","graph","plan"]),quality:new Set(["assurance","contracts","test","test-all","validate"]),automation:new Set(["event","meet","remind"])});const EXTENSION_COMMANDS=new Set(["extension","install","package","packages","upgrade"]);function resolvePmCommandCapabilityFamily(command){const normalized=resolvePmCommandOperation(command.trim().toLowerCase());if(normalized==="ops")return"quality";for(const[family,commands]of Object.entries(COMMANDS_BY_FAMILY)){if(commands.has(normalized))return family}return EXTENSION_COMMANDS.has(normalized)?"extensions":"internal"}const PM_COMMAND_CAPABILITY_CONTRACTS=Object.freeze([...PM_CORE_COMMAND_NAMES.flatMap(command=>command==="item"?["item-reopen"]:[command,...PM_NAMESPACED_COMMAND_ALIASES.filter(alias=>alias.alias===command).map(alias=>alias.canonical)]).map(command=>({command,tier:CORE_COMMANDS.has(resolvePmCommandOperation(command))?"core":STANDARD_COMMANDS.has(resolvePmCommandOperation(command))?"standard":"full",family:resolvePmCommandCapabilityFamily(command)})),{command:"ops",tier:"core",family:"quality"},{command:"completion-statuses",tier:"internal",family:"internal"},{command:"completion-tags",tier:"internal",family:"internal"},{command:"completion-types",tier:"internal",family:"internal"},{command:"test-runs-worker",tier:"internal",family:"internal"}]);const PM_COMMAND_VISIBILITY_CONTRACTS=PM_COMMAND_CAPABILITY_CONTRACTS;const PM_CORE_HELP_BUDGET=Object.freeze({max_lines:50,max_utf8_bytes:6e3});const PM_CORE_HELP_OPTION_FLAGS=Object.freeze(["-V, --version","--all","--json","--output-include <fields>","--output-limit <count>","--output-budget <tokens|unbounded>","--output-cursor <cursor>","--pm-path <dir>","--no-extensions","--no-pager","--explain","-h, --help"]);function measurePmCoreHelp(text){const lines=text===""?0:text.split(/\r?\n/).length;const utf8Bytes=Buffer.byteLength(text,"utf8");return{lines,utf8_bytes:utf8Bytes,within_budget:lines<=PM_CORE_HELP_BUDGET.max_lines&&utf8Bytes<=PM_CORE_HELP_BUDGET.max_utf8_bytes}}const TIER_ORDER={core:0,standard:1,full:2,internal:3};const COMMAND_TIER_BY_NAME=new Map(PM_COMMAND_VISIBILITY_CONTRACTS.map(({command,tier})=>[command,tier]));function resolvePmCommandVisibilityTier(command,extensionTier="standard"){return COMMAND_TIER_BY_NAME.get(command.trim().toLowerCase())??extensionTier}function listPmCommandsForTier(tier){return listPmCommandsForTierFromContracts(tier,PM_COMMAND_CAPABILITY_CONTRACTS)}function listPmCommandsForTierFromContracts(tier,contracts){const maximum=TIER_ORDER[tier];return contracts.filter(entry=>entry.tier!=="internal"&&TIER_ORDER[entry.tier]<=maximum).map(entry=>entry.command)}function listPmCommandsForFamily(family){return listPmCommandsForFamilyFromContracts(family,PM_COMMAND_CAPABILITY_CONTRACTS)}function listPmCommandsForFamilyFromContracts(family,contracts){return contracts.filter(entry=>entry.family===family).map(entry=>entry.command)}const CAPABILITY_FAMILY_ORDER=["workspace","intake","context","lifecycle","evidence","graph","quality","automation","extensions","internal"];const CAPABILITY_ROUTING_EXCLUDED_ALIASES=new Set([...PM_COMMAND_ALIAS_CONTRACTS.filter(alias=>alias.hidden).map(alias=>alias.alias),"ctx","extension","install","item-reopen","list-all","list-blocked","list-canceled","list-closed","list-draft","list-in-progress","list-open","packages","upgrade"]);function listPmCommandCapabilityGroups(contracts=PM_COMMAND_CAPABILITY_CONTRACTS){return CAPABILITY_FAMILY_ORDER.map(family=>({family,commands:listPmCommandsForFamilyFromContracts(family,contracts).filter(command=>contracts.find(entry=>entry.command===command)?.tier!=="internal"&&!CAPABILITY_ROUTING_EXCLUDED_ALIASES.has(command))})).filter(({commands})=>commands.length>0)}const PM_MCP_TOOL_COMMAND_CONTRACTS=Object.freeze({pm_append:"append",pm_claim:"claim",pm_close:"close",pm_comments:"comments",pm_config:"config",pm_context:"context",pm_contracts:"contracts",pm_copy:"copy",pm_create:"create",pm_deps:"deps",pm_discover:"help",pm_docs:"docs",pm_events:"history",pm_files:"files",pm_focus:"focus",pm_get:"get",pm_graph:"graph",pm_health:"health",pm_learnings:"learnings",pm_list:"list",pm_mutate:"update",pm_next:"next",pm_notes:"notes",pm_plan:"plan",pm_profile:"profile",pm_release:"release",pm_run:"package",pm_schema:"schema",pm_search:"search",pm_test:"test",pm_update:"update",pm_validate:"validate"});function listPmMcpToolsForProfile(availableTools,profile){return listPmMcpToolsForProfileFromContracts(availableTools,profile,PM_COMMAND_CAPABILITY_CONTRACTS)}function listPmMcpToolsForProfileFromContracts(availableTools,profile,contracts){if(profile==="full")return[...availableTools];const visibleCommands=new Set(listPmCommandsForTierFromContracts(profile,contracts));return availableTools.filter(tool=>{const command=PM_MCP_TOOL_COMMAND_CONTRACTS[tool];return command!==void 0&&visibleCommands.has(command)})}const PM_MCP_RESOURCE_CONTRACTS=Object.freeze([{uri:"pm://workspace/context",name:"Workspace context",description:"Bounded project context for orientation, including active hierarchy and progress.",mimeType:"application/json"},{uri:"pm://workspace/focus",name:"Active focus",description:"The session focus that supplies the default create parent.",mimeType:"application/json"},{uri:"pm://workspace/claims",name:"Active claims",description:"Bounded in-progress work and active ownership context.",mimeType:"application/json"},{uri:"pm://workspace/agent-guide",name:"Agent guidance",description:"Repository-local AGENTS.md instructions, bounded for safe host attachment.",mimeType:"text/markdown"}]);const PM_MCP_PROMPT_CONTRACTS=Object.freeze([{name:"orient",description:"Build bounded live context, search all statuses, and select canonical work without creating duplicates.",arguments:[{name:"request",description:"The user's requested outcome or topic.",required:true},{name:"scope",description:"Optional bounded workspace or subsystem scope.",required:false}],template:"Orient to the live pm workspace for: {{request}}. Scope hint: {{scope}}. Read context, search all statuses, inspect full metadata for relevant items, and select canonical lineage before any mutation."},{name:"claim-and-start",description:"Claim one canonical item and begin implementation with linked context.",arguments:[{name:"id",description:"Canonical pm item id.",required:true}],template:"Read {{id}} in full, claim it, set it in_progress, then implement only its acceptance scope while linking files, docs, tests, and evidence."},{name:"record-evidence-and-close",description:"Record exact verification evidence, close the item, and release ownership.",arguments:[{name:"id",description:"Canonical pm item id.",required:true},{name:"evidence",description:"Exact verification and outcome evidence.",required:true}],template:"For {{id}}, record this evidence: {{evidence}}. Verify linked tests, close only if acceptance is met, then release the claim."}]);function renderPmCommandVisibilityMarkdown(){return renderPmCommandVisibilityMarkdownFromContracts(PM_COMMAND_CAPABILITY_CONTRACTS)}function renderPmCommandVisibilityMarkdownFromContracts(contracts){const rows=contracts.map(({command,tier,family})=>`| \`${command}\` | ${tier} | ${family} |`);return["# Generated agent command surface","","This file is generated from `PM_COMMAND_CAPABILITY_CONTRACTS`. Do not edit it manually.","","| Command | Minimum visibility tier | Capability family |","| --- | --- | --- |",...rows,""].join("\n")}function renderPmCapabilityRoutingMarkdown(contracts=PM_COMMAND_CAPABILITY_CONTRACTS){const rows=listPmCommandCapabilityGroups(contracts).map(({family,commands})=>`| ${family} | ${commands.map(command=>`\`${command}\``).join(", ")} |`);return["# Generated agent capability routing","","Tracker: `pm-kxci8x`.","","This file is generated from `PM_COMMAND_CAPABILITY_CONTRACTS`. Do not edit it manually.","","| Capability family | Commands |","| --- | --- |",...rows,""].join("\n")}export{PM_COMMAND_CAPABILITY_CONTRACTS,PM_COMMAND_VISIBILITY_CONTRACTS,PM_CORE_HELP_BUDGET,PM_CORE_HELP_OPTION_FLAGS,PM_MCP_PROMPT_CONTRACTS,PM_MCP_RESOURCE_CONTRACTS,PM_MCP_TOOL_COMMAND_CONTRACTS,listPmCommandCapabilityGroups,listPmCommandsForFamily,listPmCommandsForFamilyFromContracts,listPmCommandsForTier,listPmCommandsForTierFromContracts,listPmMcpToolsForProfile,listPmMcpToolsForProfileFromContracts,measurePmCoreHelp,renderPmCapabilityRoutingMarkdown,renderPmCommandVisibilityMarkdown,renderPmCommandVisibilityMarkdownFromContracts,resolvePmCommandCapabilityFamily,resolvePmCommandVisibilityTier};
2
2
  //# sourceMappingURL=agent-capability-contracts.js.map
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fcffdf9d-a396-5ee2-b170-31cba062fee4")}catch(e2){}})();import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,resolveSubcommandFlagContractsForCommand}from"./cli-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{resolvePmHistoryOperation}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"]);function consumeBootstrapGlobalToken(argv,index,state){const token=argv[index];if(BOOTSTRAP_BOOLEAN_FLAGS.has(token)){state.booleanFlags.add(token);return 1}const equalsIndex=token.indexOf("=");const 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;const consumesValue=inlineValue===void 0&&consumesBootstrapValue(canonicalFlag,argv[index+1]);const value=inlineValue??(consumesValue?argv[index+1]:void 0);if(canonicalFlag==="--author"){state.author=value??""}else if(typeof value==="string"&&value.length>0){const target=OUTPUT_VALUE_FLAGS.has(canonicalFlag)?state.outputValues:state.pathValues;target.set(canonicalFlag,value)}return consumesValue?2:1}function parseBootstrapGlobalOptions(argv){const state={booleanFlags:new Set,outputValues:new Map,pathValues:new Map};let index=0;while(index<argv.length){if(argv[index]==="--")break;index+=consumeBootstrapGlobalToken(argv,index,state)}return{path:state.pathValues.get("--pm-path")??state.pathValues.get("--path"),noExtensions:state.booleanFlags.has("--no-extensions"),noPager:state.booleanFlags.has("--no-pager"),json:state.booleanFlags.has("--json"),quiet:state.booleanFlags.has("--quiet"),lean:state.booleanFlags.has("--lean"),tokenAccounting:state.booleanFlags.has("--token-accounting"),...state.booleanFlags.has("--output-row-contract")?{outputRowContract:true}:{},...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")},...state.outputValues.get("--output-format")==="toon"||state.outputValues.get("--output-format")==="json"?{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:true}:state.author!==void 0?{author:state.author}:{}}}function stripGlobalBootstrapTokens(argv){const remaining=[];let index=0;while(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);const first=stripped[0]?.trim().toLowerCase();if(first==="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:true,commandPathTokens:commandPathTokens2}}const helpFlagIndex=stripped.findIndex(token=>token==="--help"||token==="-h");if(helpFlagIndex<0){return{requested:false,commandPathTokens:[]}}const commandPathTokens=[];for(const token of stripped){if(token.startsWith("-")){break}commandPathTokens.push(token.trim().toLowerCase())}return{requested:true,commandPathTokens}}function findBootstrapCommandTokenIndex(argv){return findContractBootstrapCommandTokenIndex(argv)}function parseBootstrapCommandName(argv){return parseContractBootstrapCommandName(argv)}function shouldDisablePagerForInvocation(argv,bootstrapGlobal){if(bootstrapGlobal.noPager){return true}if(process.stdout.isTTY===true){return false}const helpRequest=parseBootstrapHelpRequest(argv);return helpRequest.requested}function applyBootstrapPagerPolicy(argv){const pagerEnvironmentKeys=["PAGER","MANPAGER","GIT_PAGER","LESS"];const previousValues=pagerEnvironmentKeys.map(key=>process.env[key]);const restore=()=>{for(const[index,key]of pagerEnvironmentKeys.entries()){const value=previousValues[index];if(value===void 0){delete process.env[key]}else{process.env[key]=value}}};const bootstrapGlobal=parseBootstrapGlobalOptions(argv);if(!shouldDisablePagerForInvocation(argv,bootstrapGlobal)){return restore}process.env.PAGER="cat";process.env.MANPAGER="cat";process.env.GIT_PAGER="cat";if(typeof process.env.LESS!=="string"||process.env.LESS.trim().length===0){process.env.LESS="FRX"}return 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}`;if(argv.includes(forcedActionFlag)){return[...argv]}return[...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];if(!CLI_EXECUTABLE_ALIASES.has(token.trim().toLowerCase())){return argv}trace.push({from:token,to:[],reason:"executable_alias",confidence:"high"});return[...argv.slice(0,index),...argv.slice(index+1)]}function rewriteCommandAlias(argv,trace){const index=findBootstrapCommandTokenIndex(argv);if(index===void 0){return argv}const token=argv[index];const canonical=EXECUTABLE_COMMAND_ALIASES[token.trim().toLowerCase()];if(!canonical){return argv}const rewritten=[...argv];rewritten[index]=canonical;trace.push({from:token,to:[canonical],reason:"command_alias",confidence:"high"});return rewritten}function normalizeFlagKeyToken(raw){const withoutPrefix=raw.replace(/^--?/,"");return withoutPrefix.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}if(existing!==canonicalFlag){map.set(key,null)}}function collectLongFlagCandidates(contract){const candidates=[];const pushLongFlag=value=>{if(typeof value!=="string"){return}if(!value.startsWith("--")){return}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);const canonicalByNormalized=new Map;const canonicalByCompact=new Map;const canonicalComparablesMap=new Map;const 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);if(!canonicalComparablesMap.has(canonicalFlag)){canonicalComparablesMap.set(canonicalFlag,comparable)}if(contract.list===true){listCanonicalFlags.add(canonicalFlag)}}return{canonicalByNormalized,canonicalByCompact,canonicalComparables:[...canonicalComparablesMap.entries()].map(([canonicalFlag,comparable])=>({canonicalFlag,comparable})),listCanonicalFlags}}function resolveCanonicalFlag(rawKey,lookup){const normalizedKey=normalizeFlagKeyToken(rawKey);const direct=lookup.canonicalByNormalized.get(normalizedKey);if(typeof direct==="string"){return{flag:direct,reason:"flag_alias",confidence:"high"}}const comparableKey=normalizedKey.replace(/-/g,"");const 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;let bestFlag;let tied=false;for(const candidate of lookup.canonicalComparables){const distance=levenshteinDistanceWithinLimit(comparableKey,candidate.comparable,maxDistance);if(distance===null){continue}if(distance<bestDistance){bestDistance=distance;bestFlag=candidate.canonicalFlag;tied=false;continue}if(distance===bestDistance&&bestFlag!==candidate.canonicalFlag){tied=true}}if(!bestFlag||tied||!Number.isFinite(bestDistance)||bestDistance<=0){return null}return{flag:bestFlag,reason:"flag_typo",confidence:bestDistance>=2?"medium":"high"}}function listAliasPluralKeys(normalizedKey){const candidates=[`${normalizedKey}s`];if(normalizedKey.endsWith("y")&&normalizedKey.length>1){candidates.push(`${normalizedKey.slice(0,-1)}ies`)}return candidates}function parseBareKeyValueToken(token,preserve=false){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];const value=match[3];if(value.length===0){return null}return{key,value}}function normalizeLongOptionToken(token,lookup,preserve=false){if(preserve||!token.startsWith("--")){return{tokens:[token]}}const equalsIndex=token.indexOf("=");const key=equalsIndex>=0?token.slice(0,equalsIndex):token;const inlineValue=equalsIndex>=0?token.slice(equalsIndex+1):void 0;const resolution=resolveCanonicalFlag(key,lookup);if(!resolution){return{tokens:[token]}}const normalizedToken=inlineValue===void 0?resolution.flag:`${resolution.flag}=${inlineValue}`;if(normalizedToken===token){return{tokens:[token]}}return{tokens:[normalizedToken],event:{from:token,to:[normalizedToken],reason:resolution.reason,confidence:resolution.confidence}}}function collectBootstrapPathValueIndices(argv){const indices=new Set;let expectsValue=false;for(let index=0;index<argv.length;index+=1){if(expectsValue){indices.add(index);expectsValue=false;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("=");if(equalsIndex<0){return{flag:token}}return{flag:token.slice(0,equalsIndex),inlineValue:token.slice(equalsIndex+1)}}function copyValueConsumingFlag(argv,index,result){result.push(argv[index]);const next=argv[index+1];if(typeof next==="string"&&next!=="--"){result.push(next);return index+2}return 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;while(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=[];const splices=[];for(const[flag,slot]of slots){const shouldMerge=slot.occurrences>=2||multiValueListFlags.has(flag)&&slot.originalTokens.length>2;if(!shouldMerge){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=[];const slots=new Map;let index=0;while(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);applyListFlagSplices(result,splices);return{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 false}const key=emittedTokens[emittedTokens.length-1];const flag=emittedTokens[emittedTokens.length-2];const keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(flag);return keys!==void 0&&keys.has(key)}function shouldPreserveBareKeyValueToken(commandName,emittedTokens){return commandName==="search"||isLinkedTestTwoTokenValuePosition(commandName,emittedTokens)}function mergeLinkedTestTwoTokenEntries(argv,commandName,trace){if(commandName!=="test"){return argv}const result=[];let index=0;while(index<argv.length){const token=argv[index];if(token==="--"){result.push(...argv.slice(index));return result}const keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(token);const 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;while(runEnd<argv.length&&!argv[runEnd].startsWith("-")){runEnd+=1}if(runEnd-(index+2)!==1){result.push(token);index+=1;continue}const value=argv[index+2];const 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=[];const 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);const previous=normalizedArgv[normalizedArgv.length-1];if(token.startsWith("--")){const normalizedToken=normalizeLongOptionToken(token,lookup,preserveCurrentToken);normalizedArgv.push(...normalizedToken.tokens);if(normalizedToken.event)trace.push(normalizedToken.event);continue}const bareKeyValue=parseBareKeyValueToken(token,preserveCurrentToken);if(bareKeyValue&&!(typeof previous==="string"&&previous.startsWith("-"))&&!shouldPreserveBareKeyValueToken(commandName,normalizedArgv)){const resolution=resolveCanonicalFlag(bareKeyValue.key,lookup);if(resolution){const replacement=[resolution.flag,bareKeyValue.value];normalizedArgv.push(...replacement);trace.push({from:token,to:replacement,reason:"bare_key_value",confidence:resolution.confidence});continue}}normalizedArgv.push(token)}return normalizedArgv}function normalizeBootstrapInvocation(argv){const trace=[];const executableNormalized=stripLeadingExecutableAlias(argv,trace);const legacyNormalized=normalizeLegacyExtensionActionSyntax(executableNormalized);if(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);const itemAddress=normalizeItemAddressInvocation(aliasNormalized);if(itemAddress.conflict){throw new PmCliError("Provide the item id either positionally or with --id, not both.",EXIT_CODE.USAGE)}if(itemAddress.changed){trace.push({from:`--id ${itemAddress.itemId}`,to:[itemAddress.itemId],reason:"item_id_alias",confidence:"high"})}const commandName=parseBootstrapCommandName(itemAddress.argv);const commandPathName=parseBootstrapCommandPathName(itemAddress.argv);const lookup=buildFlagLookup(commandPathName??commandName);const normalizedArgv=normalizeBootstrapTokens(itemAddress.argv,lookup,commandName,trace);const linkedTestNormalized=mergeLinkedTestTwoTokenEntries(normalizedArgv,commandName,trace);const 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{argv:coalesced.argv,commandName,trace}}function parseBootstrapCommandPathName(argv){const stripped=stripGlobalBootstrapTokens(argv);const first=stripped[0]?.trim().toLowerCase();const second=stripped[1]?.trim().toLowerCase();const historyPath=`${first} ${second}`;if(first==="history"&&resolvePmHistoryOperation(historyPath)!==historyPath)return historyPath;if((first==="extension"||first==="package"||first==="packages")&&typeof second==="string"&&second.length>0&&!second.startsWith("-")){return`${first} ${second}`}return 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("--type=".length).trim();if(candidate.length>0){return candidate}}}return void 0}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="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c07ec39c-9ec9-5e62-aed5-d5b6910fd18a")}catch(e2){}})();import{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,resolveSubcommandFlagContractsForCommand}from"./cli-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{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"]);function consumeBootstrapGlobalToken(argv,index,state){const token=argv[index];if(BOOTSTRAP_BOOLEAN_FLAGS.has(token)){state.booleanFlags.add(token);return 1}const equalsIndex=token.indexOf("=");const 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;const consumesValue=inlineValue===void 0&&consumesBootstrapValue(canonicalFlag,argv[index+1]);const value=inlineValue??(consumesValue?argv[index+1]:void 0);if(canonicalFlag==="--author"){state.author=value??""}else if(typeof value==="string"&&value.length>0){const target=OUTPUT_VALUE_FLAGS.has(canonicalFlag)?state.outputValues:state.pathValues;target.set(canonicalFlag,value)}return consumesValue?2:1}function parseBootstrapGlobalOptions(argv){const state={booleanFlags:new Set,outputValues:new Map,pathValues:new Map};let index=0;while(index<argv.length){if(argv[index]==="--")break;index+=consumeBootstrapGlobalToken(argv,index,state)}return{path:state.pathValues.get("--pm-path")??state.pathValues.get("--path"),noExtensions:state.booleanFlags.has("--no-extensions"),noPager:state.booleanFlags.has("--no-pager"),json:state.booleanFlags.has("--json"),quiet:state.booleanFlags.has("--quiet"),lean:state.booleanFlags.has("--lean"),tokenAccounting:state.booleanFlags.has("--token-accounting"),...state.booleanFlags.has("--output-row-contract")?{outputRowContract:true}:{},...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")},...state.outputValues.get("--output-format")==="toon"||state.outputValues.get("--output-format")==="json"?{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:true}:state.author!==void 0?{author:state.author}:{}}}function stripGlobalBootstrapTokens(argv){const remaining=[];let index=0;while(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);const first=stripped[0]?.trim().toLowerCase();if(first==="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:true,commandPathTokens:commandPathTokens2}}const helpFlagIndex=stripped.findIndex(token=>token==="--help"||token==="-h");if(helpFlagIndex<0){return{requested:false,commandPathTokens:[]}}const commandPathTokens=[];for(const token of stripped){if(token.startsWith("-")){break}commandPathTokens.push(token.trim().toLowerCase())}return{requested:true,commandPathTokens}}function findBootstrapCommandTokenIndex(argv){return findContractBootstrapCommandTokenIndex(argv)}function parseBootstrapCommandName(argv){return parseContractBootstrapCommandName(argv)}function shouldDisablePagerForInvocation(argv,bootstrapGlobal){if(bootstrapGlobal.noPager){return true}if(process.stdout.isTTY===true){return false}const helpRequest=parseBootstrapHelpRequest(argv);return helpRequest.requested}function applyBootstrapPagerPolicy(argv){const pagerEnvironmentKeys=["PAGER","MANPAGER","GIT_PAGER","LESS"];const previousValues=pagerEnvironmentKeys.map(key=>process.env[key]);const restore=()=>{for(const[index,key]of pagerEnvironmentKeys.entries()){const value=previousValues[index];if(value===void 0){delete process.env[key]}else{process.env[key]=value}}};const bootstrapGlobal=parseBootstrapGlobalOptions(argv);if(!shouldDisablePagerForInvocation(argv,bootstrapGlobal)){return restore}process.env.PAGER="cat";process.env.MANPAGER="cat";process.env.GIT_PAGER="cat";if(typeof process.env.LESS!=="string"||process.env.LESS.trim().length===0){process.env.LESS="FRX"}return 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}`;if(argv.includes(forcedActionFlag)){return[...argv]}return[...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];if(!CLI_EXECUTABLE_ALIASES.has(token.trim().toLowerCase())){return argv}trace.push({from:token,to:[],reason:"executable_alias",confidence:"high"});return[...argv.slice(0,index),...argv.slice(index+1)]}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];const canonical=EXECUTABLE_COMMAND_ALIASES[token.trim().toLowerCase()];if(!canonical){return argv}const canonicalTokens=canonical.split(" ");const rewritten=[...argv.slice(0,index),...canonicalTokens,...argv.slice(index+1)];trace.push({from:token,to:canonicalTokens,reason:"command_alias",confidence:"high"});return rewritten}function normalizeFlagKeyToken(raw){const withoutPrefix=raw.replace(/^--?/,"");return withoutPrefix.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}if(existing!==canonicalFlag){map.set(key,null)}}function collectLongFlagCandidates(contract){const candidates=[];const pushLongFlag=value=>{if(typeof value!=="string"){return}if(!value.startsWith("--")){return}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);const canonicalByNormalized=new Map;const canonicalByCompact=new Map;const canonicalComparablesMap=new Map;const 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);if(!canonicalComparablesMap.has(canonicalFlag)){canonicalComparablesMap.set(canonicalFlag,comparable)}if(contract.list===true){listCanonicalFlags.add(canonicalFlag)}}return{canonicalByNormalized,canonicalByCompact,canonicalComparables:[...canonicalComparablesMap.entries()].map(([canonicalFlag,comparable])=>({canonicalFlag,comparable})),listCanonicalFlags}}function resolveCanonicalFlag(rawKey,lookup){const normalizedKey=normalizeFlagKeyToken(rawKey);const direct=lookup.canonicalByNormalized.get(normalizedKey);if(typeof direct==="string"){return{flag:direct,reason:"flag_alias",confidence:"high"}}const comparableKey=normalizedKey.replace(/-/g,"");const 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;let bestFlag;let tied=false;for(const candidate of lookup.canonicalComparables){const distance=levenshteinDistanceWithinLimit(comparableKey,candidate.comparable,maxDistance);if(distance===null){continue}if(distance<bestDistance){bestDistance=distance;bestFlag=candidate.canonicalFlag;tied=false;continue}if(distance===bestDistance&&bestFlag!==candidate.canonicalFlag){tied=true}}if(!bestFlag||tied||!Number.isFinite(bestDistance)||bestDistance<=0){return null}return{flag:bestFlag,reason:"flag_typo",confidence:bestDistance>=2?"medium":"high"}}function listAliasPluralKeys(normalizedKey){const candidates=[`${normalizedKey}s`];if(normalizedKey.endsWith("y")&&normalizedKey.length>1){candidates.push(`${normalizedKey.slice(0,-1)}ies`)}return candidates}function parseBareKeyValueToken(token,preserve=false){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];const value=match[3];if(value.length===0){return null}return{key,value}}function normalizeLongOptionToken(token,lookup,preserve=false){if(preserve||!token.startsWith("--")){return{tokens:[token]}}const equalsIndex=token.indexOf("=");const key=equalsIndex>=0?token.slice(0,equalsIndex):token;const inlineValue=equalsIndex>=0?token.slice(equalsIndex+1):void 0;const resolution=resolveCanonicalFlag(key,lookup);if(!resolution){return{tokens:[token]}}const normalizedToken=inlineValue===void 0?resolution.flag:`${resolution.flag}=${inlineValue}`;if(normalizedToken===token){return{tokens:[token]}}return{tokens:[normalizedToken],event:{from:token,to:[normalizedToken],reason:resolution.reason,confidence:resolution.confidence}}}function collectBootstrapPathValueIndices(argv){const indices=new Set;let expectsValue=false;for(let index=0;index<argv.length;index+=1){if(expectsValue){indices.add(index);expectsValue=false;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("=");if(equalsIndex<0){return{flag:token}}return{flag:token.slice(0,equalsIndex),inlineValue:token.slice(equalsIndex+1)}}function copyValueConsumingFlag(argv,index,result){result.push(argv[index]);const next=argv[index+1];if(typeof next==="string"&&next!=="--"){result.push(next);return index+2}return 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;while(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=[];const splices=[];for(const[flag,slot]of slots){const shouldMerge=slot.occurrences>=2||multiValueListFlags.has(flag)&&slot.originalTokens.length>2;if(!shouldMerge){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=[];const slots=new Map;let index=0;while(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);applyListFlagSplices(result,splices);return{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 false}const key=emittedTokens[emittedTokens.length-1];const flag=emittedTokens[emittedTokens.length-2];const keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(flag);return keys!==void 0&&keys.has(key)}function shouldPreserveBareKeyValueToken(commandName,emittedTokens){return commandName==="search"||isLinkedTestTwoTokenValuePosition(commandName,emittedTokens)}function mergeLinkedTestTwoTokenEntries(argv,commandName,trace){if(commandName!=="test"){return argv}const result=[];let index=0;while(index<argv.length){const token=argv[index];if(token==="--"){result.push(...argv.slice(index));return result}const keys=LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG.get(token);const 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;while(runEnd<argv.length&&!argv[runEnd].startsWith("-")){runEnd+=1}if(runEnd-(index+2)!==1){result.push(token);index+=1;continue}const value=argv[index+2];const 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=[];const 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);const previous=normalizedArgv[normalizedArgv.length-1];if(token.startsWith("--")){const normalizedToken=normalizeLongOptionToken(token,lookup,preserveCurrentToken);normalizedArgv.push(...normalizedToken.tokens);if(normalizedToken.event)trace.push(normalizedToken.event);continue}const bareKeyValue=parseBareKeyValueToken(token,preserveCurrentToken);if(bareKeyValue&&!(typeof previous==="string"&&previous.startsWith("-"))&&!shouldPreserveBareKeyValueToken(commandName,normalizedArgv)){const resolution=resolveCanonicalFlag(bareKeyValue.key,lookup);if(resolution){const replacement=[resolution.flag,bareKeyValue.value];normalizedArgv.push(...replacement);trace.push({from:token,to:replacement,reason:"bare_key_value",confidence:resolution.confidence});continue}}normalizedArgv.push(token)}return normalizedArgv}function normalizeBootstrapInvocation(argv){const trace=[];const executableNormalized=stripLeadingExecutableAlias(argv,trace);const legacyNormalized=normalizeLegacyExtensionActionSyntax(executableNormalized);if(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);const itemAddress=normalizeItemAddressInvocation(aliasNormalized);if(itemAddress.conflict){throw new PmCliError("Provide the item id either positionally or with --id, not both.",EXIT_CODE.USAGE)}if(itemAddress.changed){trace.push({from:`--id ${itemAddress.itemId}`,to:[itemAddress.itemId],reason:"item_id_alias",confidence:"high"})}const commandName=parseBootstrapCommandName(itemAddress.argv);const commandPathName=parseBootstrapCommandPathName(itemAddress.argv);const lookup=buildFlagLookup(commandPathName??commandName);const normalizedArgv=normalizeBootstrapTokens(itemAddress.argv,lookup,commandName,trace);const linkedTestNormalized=mergeLinkedTestTwoTokenEntries(normalizedArgv,commandName,trace);const 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{argv:coalesced.argv,commandName,trace}}function parseBootstrapCommandPathName(argv){const stripped=stripGlobalBootstrapTokens(argv);const first=stripped[0]?.trim().toLowerCase();const second=stripped[1]?.trim().toLowerCase();const commandPath=`${first} ${second}`;if(resolvePmCommandOperation(commandPath)!==commandPath)return commandPath;if((first==="extension"||first==="package"||first==="packages")&&typeof second==="string"&&second.length>0&&!second.startsWith("-")){return`${first} ${second}`}return 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("--type=".length).trim();if(candidate.length>0){return candidate}}}return void 0}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
@@ -28,7 +28,17 @@ export interface PmCommandAliasContract {
28
28
  }
29
29
  /** History namespace aliases preserve the existing SDK and MCP operation identities. */
30
30
  export declare const PM_HISTORY_COMMAND_ALIASES: readonly PmCommandAliasContract[];
31
- /** Resolve a native history leaf to its stable SDK operation; other paths retain their identity. */
31
+ /** Navigation, maintenance, and event aliases share native handlers and stable SDK identities. */
32
+ export declare const PM_CONTEXT_OPS_COMMAND_ALIASES: readonly PmCommandAliasContract[];
33
+ /** Bulk lifecycle operations retain their published SDK identities under canonical verbs. */
34
+ export declare const PM_BULK_LIFECYCLE_COMMAND_ALIASES: readonly PmCommandAliasContract[];
35
+ /** Native handlers relocated into parent commands after core and package registration. */
36
+ export declare const PM_RELOCATED_COMMAND_ALIASES: readonly PmCommandAliasContract[];
37
+ /** Native noun-verb paths whose stable operation identities survive grammar consolidation. */
38
+ export declare const PM_NAMESPACED_COMMAND_ALIASES: readonly PmCommandAliasContract[];
39
+ /** Resolve a native command leaf to its stable SDK operation without changing unknown paths. */
40
+ export declare function resolvePmCommandOperation(command: string): string;
41
+ /** Compatibility entrypoint for hosts that adopted namespace resolution with history. */
32
42
  export declare function resolvePmHistoryOperation(command: string): string;
33
43
  /**
34
44
  * Public command-alias table. Deprecated aliases must remain executable but
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4f5e4655-b263-5ad7-80c6-536ab242dd98")}catch(e2){}})();const PM_HISTORY_COMMAND_ALIASES=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:canonical.split(" "),lifecycle:"permanent",hidden:true,registration:"commander",owner:"pm-tqel"}));function resolvePmHistoryOperation(command){const normalized=command.trim().replace(/\s+/gu," ");return PM_HISTORY_COMMAND_ALIASES.find(alias=>alias.canonical===normalized)?.alias??normalized}const PM_COMMAND_ALIAS_CONTRACTS=[...PM_HISTORY_COMMAND_ALIASES,{alias:"tests",canonical:"test",canonical_argv:["test"],lifecycle:"permanent",hidden:false,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:[canonical],lifecycle:"permanent",hidden:false,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension list","extension catalog"],["extension scaffold","extension init"],["package list","package catalog"],["package scaffold","package init"],["packages list","packages catalog"],["packages scaffold","packages init"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:canonical.split(" "),lifecycle:"permanent",hidden:false,registration:"commander",owner:"pm-ya7x55"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:true,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([alias,status])=>({alias,canonical:"list",canonical_argv:["list","--status",status],lifecycle:"deprecated",hidden:true,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:canonical.split(" "),lifecycle:"deprecated",hidden:true,registration:"commander",owner:"pm-tnud"}))];const EXECUTABLE_COMMAND_ALIASES=Object.fromEntries(PM_COMMAND_ALIAS_CONTRACTS.filter(contract=>contract.registration==="bootstrap").map(contract=>[contract.alias,contract.canonical]));function resolvePmCommandAlias(alias){const normalized=alias.trim().toLowerCase();return PM_COMMAND_ALIAS_CONTRACTS.find(contract=>contract.alias===normalized)}function renderPmCommandAliasMigrationHint(contract){return`Deprecated command \`${contract.alias}\`; use \`pm ${contract.canonical_argv.join(" ")}\`.`}export{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,resolvePmHistoryOperation};
1
+ !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="661c65f5-0cf3-5dff-954a-77a360ae928b")}catch(e2){}})();const PM_HISTORY_COMMAND_ALIASES=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:canonical.split(" "),lifecycle:"permanent",hidden:true,registration:"commander",owner:"pm-tqel"}));const PM_CONTEXT_OPS_COMMAND_ALIASES=[...["next","focus"].map(alias=>({alias,canonical:`context ${alias}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(alias=>({alias,canonical:`ops ${alias}`,owner:"pm-6apl"})),...["normalize","reindex"].map(alias=>({alias,canonical:`ops ${alias}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(entry=>({...entry,canonical_argv:entry.canonical.split(" "),lifecycle:"permanent",hidden:true,registration:"bootstrap"}));const PM_BULK_LIFECYCLE_COMMAND_ALIASES=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:canonical.split(" "),lifecycle:"permanent",hidden:true,registration:"bootstrap",owner:"pm-ik19"}));const PM_RELOCATED_COMMAND_ALIASES=[...PM_CONTEXT_OPS_COMMAND_ALIASES,...PM_BULK_LIFECYCLE_COMMAND_ALIASES];const PM_NAMESPACED_COMMAND_ALIASES=[...PM_HISTORY_COMMAND_ALIASES,...PM_RELOCATED_COMMAND_ALIASES];function resolvePmCommandOperation(command){const normalized=command.trim().replace(/\s+/gu," ");return PM_NAMESPACED_COMMAND_ALIASES.find(alias=>alias.canonical===normalized.replace(/^ctx /u,"context "))?.alias??normalized}function resolvePmHistoryOperation(command){return resolvePmCommandOperation(command)}const PM_COMMAND_ALIAS_CONTRACTS=[...PM_NAMESPACED_COMMAND_ALIASES,...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([alias,canonical,flag])=>({alias,canonical,canonical_argv:[canonical,flag],lifecycle:"deprecated",hidden:true,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"test",canonical_argv:["test"],lifecycle:"permanent",hidden:false,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:[canonical],lifecycle:"permanent",hidden:false,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension list","extension catalog"],["extension scaffold","extension init"],["package list","package catalog"],["package scaffold","package init"],["packages list","packages catalog"],["packages scaffold","packages init"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:canonical.split(" "),lifecycle:"permanent",hidden:false,registration:"commander",owner:"pm-ya7x55"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:true,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([alias,status])=>({alias,canonical:"list",canonical_argv:["list","--status",status],lifecycle:"deprecated",hidden:true,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([alias,canonical])=>({alias,canonical,canonical_argv:canonical.split(" "),lifecycle:"deprecated",hidden:true,registration:"commander",owner:"pm-tnud"}))];const EXECUTABLE_COMMAND_ALIASES=Object.fromEntries(PM_COMMAND_ALIAS_CONTRACTS.filter(contract=>contract.registration==="bootstrap").map(contract=>[contract.alias,contract.canonical]));function resolvePmCommandAlias(alias){const normalized=alias.trim().toLowerCase();return PM_COMMAND_ALIAS_CONTRACTS.find(contract=>contract.alias===normalized)}function renderPmCommandAliasMigrationHint(contract){return`Deprecated command \`${contract.alias}\`; use \`pm ${contract.canonical_argv.join(" ")}\`.`}export{EXECUTABLE_COMMAND_ALIASES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_HISTORY_COMMAND_ALIASES,PM_NAMESPACED_COMMAND_ALIASES,PM_RELOCATED_COMMAND_ALIASES,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,resolvePmCommandOperation,resolvePmHistoryOperation};
2
2
  //# sourceMappingURL=command-aliases.js.map
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7eeb96a4-cd47-581b-a788-f943671836d6")}catch(e2){}})();import{resolvePmHistoryOperation}from"./command-aliases.js";import{normalizeUniqueStringList}from"./string-lists.js";import{RESERVED_EXTENSION_HOST_FLAGS}from"../../core/extensions/reserved-host-flags.js";import{PM_POSITIONAL_ACTION_CONTRACTS}from"./grammar-contracts.js";function normalizeFlagAliasKey(flag){if(!flag.startsWith("--")){return flag}return`--${flag.slice(2).replaceAll("_","-")}`}function withFlagAliasMetadata(flagContracts){const aliasesByCanonical=new Map;for(const contract of flagContracts){const canonical=normalizeFlagAliasKey(contract.flag);const bucket=aliasesByCanonical.get(canonical)??new Set;if(contract.flag!==canonical){bucket.add(contract.flag)}for(const alias of contract.aliases??[]){if(alias!==canonical){bucket.add(alias)}}aliasesByCanonical.set(canonical,bucket)}return flagContracts.map(contract=>{const canonical=normalizeFlagAliasKey(contract.flag);if(contract.flag!==canonical){return contract}const aliases=normalizeUniqueStringList([...contract.aliases??[],...aliasesByCanonical.get(canonical)]).filter(alias=>alias!==canonical);if(aliases.length===0){return contract}return{...contract,aliases}})}function compactFlagAliasContracts(flagContracts){const withAliases=withFlagAliasMetadata(flagContracts);const canonicalFlags=new Set(withAliases.map(contract=>contract.flag));return withAliases.filter(contract=>{const canonical=normalizeFlagAliasKey(contract.flag);return contract.flag===canonical||!canonicalFlags.has(canonical)})}const SUBCOMMAND_GLOBAL_FLAG_CONTRACTS=RESERVED_EXTENSION_HOST_FLAGS.map(definition=>({flag:definition.flag,reservation_scope:"inherited",...definition.aliases?{aliases:[...definition.aliases]}:{},...definition.value_name?{value_name:definition.value_name}:{}}));const GLOBAL_FLAG_CONTRACTS=[...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,{flag:"--version",value_type:"boolean",reservation_scope:"root_only"},{flag:"--all",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help to every command."},{flag:"--explain",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help with command guidance."}];const GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--has-notes"},{flag:"--no-notes"},{flag:"--has-learnings"},{flag:"--no-learnings"},{flag:"--has-files"},{flag:"--no-files"},{flag:"--filter-files-missing"},{flag:"--has-docs"},{flag:"--no-docs"},{flag:"--filter-docs-missing"},{flag:"--has-tests"},{flag:"--no-tests"},{flag:"--has-comments"},{flag:"--no-comments"},{flag:"--has-deps"},{flag:"--no-deps"},{flag:"--has-body"},{flag:"--empty-body"},{flag:"--has-linked-command"},{flag:"--no-linked-command"}];const MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--filter-has-notes"},{flag:"--filter-no-notes"},{flag:"--filter-has-learnings"},{flag:"--filter-no-learnings"},{flag:"--filter-has-files"},{flag:"--filter-no-files"},{flag:"--filter-has-docs"},{flag:"--filter-no-docs"},{flag:"--filter-has-tests"},{flag:"--filter-no-tests"},{flag:"--filter-has-comments"},{flag:"--filter-no-comments"},{flag:"--filter-has-deps"},{flag:"--filter-no-deps"},{flag:"--filter-has-body"},{flag:"--filter-empty-body"},{flag:"--filter-has-linked-command"},{flag:"--filter-no-linked-command"},{flag:"--ids",list:true},{flag:"--limit"},{flag:"--offset"}];const LIST_FILTER_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--status",list:true},{flag:"--all",value_type:"boolean"},{flag:"--type",list:true},{flag:"--tag",aliases:["--tags"],list:true},{flag:"--priority",list:true},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--today"},{flag:"--recent"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--ids",list:true},{flag:"--assignee",list:true},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:true},{flag:"--release",list:true},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,{flag:"--limit"},{flag:"--offset"},{flag:"--after"},{flag:"--no-truncate"},{flag:"--compact"},{flag:"--brief"},{flag:"--full"},{flag:"--fields",list:true},{flag:"--sort"},{flag:"--order"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--include-body"},{flag:"--strict-read"},{flag:"--format"},{flag:"--stream"}],new Set(["--limit","--token-budget","--offset","--after","--no-truncate","--compact","--brief","--full","--fields","--include-body","--strict-read"]));const AGGREGATE_FLAG_CONTRACTS=[{flag:"--group-by",list:true},{flag:"--set-mode"},{flag:"--limit"},{flag:"--after"},{flag:"--count"},{flag:"--completion"},{flag:"--sum"},{flag:"--avg"},{flag:"--include-unparented"},{flag:"--include_unparented"},{flag:"--status",list:true},{flag:"--type",list:true},{flag:"--tag",list:true},{flag:"--priority",list:true},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--assignee",list:true},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:true},{flag:"--release",list:true}];const COMMENTS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--comment","--body","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];function withCursorSemantics(contracts,presentationFlags){return contracts.map(contract=>presentationFlags.has(contract.flag)?{...contract,cursor_semantics:"presentation"}:contract)}const NOTES_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--note","--text"]},{flag:"--add-json"},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--since"},{flag:"--event-type"},{flag:"--include-meta"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const LEARNINGS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--learning","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const FILES_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--append-stable"},{flag:"--validate-paths"},{flag:"--scope"},{flag:"--limit"},{flag:"--offset"},{flag:"--no-truncate"},{flag:"--strict-read"},{flag:"--explain"},{flag:"--lines",value_name:"start:end"},{flag:"--decision-depth",value_name:"n",value_type:"number"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const DOCS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--validate-paths"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const HISTORY_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--limit"},{flag:"--compact"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:true},{flag:"--agent-instance",repeatable:true},{flag:"--provenance-filter",repeatable:true},{flag:"--diff"},{flag:"--field"},{flag:"--verify"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--format"}];const MERGE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--message"},{flag:"--force"},{flag:"--include-reconciled"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}];const HISTORY_REDACT_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--literal"},{flag:"--regex"},{flag:"--replacement"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const HISTORY_REPAIR_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--all"},{flag:"--dry-run"},{flag:"--normalize-provenance"},{flag:"--salvage-tail",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS=[{flag:"--event",repeatable:true},{flag:"--all-actionable"},{flag:"--dry-run"},{flag:"--plan-fingerprint"},{flag:"--limit",value_type:"number"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}];const HISTORY_COMPACT_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--before"},{flag:"--ids",list:true},{flag:"--all-over",value_type:"number"},{flag:"--closed"},{flag:"--all-streams"},{flag:"--min-entries",value_type:"number"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const SCHEMA_FLAG_CONTRACTS=[{flag:"--definition",value_name:"json"},{flag:"--policy",value_name:"id"},{flag:"--message",value_name:"value"},{flag:"--description"},{flag:"--default-status",aliases:["--default_status"]},{flag:"--folder"},{flag:"--alias"},{flag:"--role"},{flag:"--order"},{flag:"--type"},{flag:"--commands"},{flag:"--cli-flag"},{flag:"--required"},{flag:"--required-on-create"},{flag:"--no-allow-unset"},{flag:"--required-types"},{flag:"--infer"},{flag:"--min-count"},{flag:"--apply",value_type:"boolean"},{flag:"--to"},{flag:"--migration-id",aliases:["--migration_id"]},{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}];const PROFILE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}];const PLAN_FLAG_CONTRACTS=[{flag:"--title"},{flag:"--description"},{flag:"--scope"},{flag:"--parent"},{flag:"--related"},{flag:"--blocks"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--harness"},{flag:"--mode"},{flag:"--resume-context",aliases:["--resume_context"]},{flag:"--tags",aliases:["--tag"],list:true},{flag:"--priority"},{flag:"--status",short:"-s"},{flag:"--create-mode",aliases:["--create_mode"]},{flag:"--deadline"},{flag:"--estimate",aliases:["--estimated-minutes","--estimated_minutes"]},{flag:"--acceptance-criteria",aliases:["--acceptance_criteria","--ac"],repeatable:true},{flag:"--definition-of-ready",aliases:["--definition_of_ready"]},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now",aliases:["--why_now"]},{flag:"--assignee"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps",aliases:["--repro_steps"]},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--affected-version",aliases:["--affected_version"]},{flag:"--fixed-version",aliases:["--fixed_version"]},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact",aliases:["--customer_impact"]},{flag:"--comment",repeatable:true},{flag:"--note",repeatable:true},{flag:"--learning",repeatable:true},{flag:"--reminder",repeatable:true},{flag:"--event",repeatable:true},{flag:"--type-option",aliases:["--type_option"],repeatable:true},{flag:"--body"},{flag:"--claim"},{flag:"--from-search",aliases:["--from_search"]},{flag:"--template"},{flag:"--step-title",aliases:["--step_title"]},{flag:"--step"},{flag:"--step-body",aliases:["--step_body"]},{flag:"--step-owner",aliases:["--step_owner"]},{flag:"--step-status",aliases:["--step_status"]},{flag:"--step-evidence",aliases:["--step_evidence"]},{flag:"--step-blocked-reason",aliases:["--step_blocked_reason"]},{flag:"--step-replacement",aliases:["--step_replacement"]},{flag:"--depends-on",aliases:["--depends_on"]},{flag:"--link"},{flag:"--link-kind",aliases:["--link_kind"]},{flag:"--link-note",aliases:["--link_note"]},{flag:"--promote-to-item-dep",aliases:["--promote_to_item_dep"]},{flag:"--allow-multiple-active",aliases:["--allow_multiple_active"]},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--decision-text",aliases:["--decision_text","--decision"]},{flag:"--decision-rationale",aliases:["--decision_rationale"]},{flag:"--decision-evidence",aliases:["--decision_evidence"]},{flag:"--discovery-text",aliases:["--discovery_text","--discovery"]},{flag:"--validation-text",aliases:["--validation_text","--validation"]},{flag:"--validation-command",aliases:["--validation_command"]},{flag:"--validation-expected",aliases:["--validation_expected"]},{flag:"--depth"},{flag:"--field"},{flag:"--fields",list:true},{flag:"--steps"},{flag:"--materialize-type",aliases:["--materialize_type"]},{flag:"--materialize-parent",aliases:["--materialize_parent"]},{flag:"--materialize-tags",aliases:["--materialize_tags"]},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const INIT_FLAG_CONTRACTS=[{flag:"--id-prefix",aliases:["--prefix"]},{flag:"--preset"},{flag:"--type-preset"},{flag:"--defaults",short:"-y",aliases:["--yes"]},{flag:"--author"},{flag:"--agent-guidance"},{flag:"--with-packages"},{flag:"--no-merge-fence"},{flag:"--workspace"},{flag:"--force"},{flag:"--verbose"}];const CONFIG_FLAG_CONTRACTS=[{flag:"--value",value_name:"value"},{flag:"--criterion"},{flag:"--clear-criteria"},{flag:"--format"},{flag:"--policy"},{flag:"--default-depth"},{flag:"--activity-limit"},{flag:"--stale-threshold-days"},{flag:"--section-hierarchy"},{flag:"--section-activity"},{flag:"--section-progress"},{flag:"--section-blockers"},{flag:"--section-files"},{flag:"--section-workload"},{flag:"--section-staleness"},{flag:"--section-tests"}];const EXTENSION_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{flag:"--describe"},{flag:"--markdown"},{flag:"--output"},{flag:"--reload"},{flag:"--watch"},{flag:"--doctor"},{flag:"--catalog"},{flag:"--adopt"},{flag:"--adopt-all"},{flag:"--activate"},{flag:"--deactivate"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"},{flag:"--detail"},{flag:"--trace"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}];const EXTENSION_SCOPE_FLAG_CONTRACTS=[{flag:"--project"},{flag:"--local"},{flag:"--global"}];const EXTENSION_INIT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--capability"}];const PACKAGE_FLAG_CONTRACTS=[...EXTENSION_FLAG_CONTRACTS,{flag:"--declarative"}];const PACKAGE_INIT_FLAG_CONTRACTS=[...EXTENSION_INIT_FLAG_CONTRACTS,{flag:"--declarative"}];const EXTENSION_INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}];const EXTENSION_UNINSTALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_EXPLORE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_DESCRIBE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--markdown"},{flag:"--output"}];const EXTENSION_ADOPT_ALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_ACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_DEACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_MIGRATE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--dry-run"}];const EXTENSION_MANAGE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--runtime-probe"},{flag:"--fix-managed-state"}];const EXTENSION_RELOAD_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--watch"}];const EXTENSION_DOCTOR_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--detail"},{flag:"--trace"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}];const EXTENSION_CATALOG_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--fields",list:true}];const EXTENSION_ADOPT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}];const INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}];const UPGRADE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--cli-only"},{flag:"--packages-only"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--repair"},{flag:"--tag"},{flag:"--package-name"}];const REINDEX_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--progress"}];const CLOSE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--reason",value_name:"value"},{flag:"--close-reason",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--duplicate-of",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",aliases:["--expected_result","--expected"],value_name:"value"},{flag:"--actual-result",aliases:["--actual_result","--actual"],value_name:"value"},{flag:"--force",value_type:"boolean"}];const CLOSE_MANY_FLAG_CONTRACTS=[{flag:"--filter-status",list:true},{flag:"--filter-type"},{flag:"--filter-tag"},{flag:"--filter-priority"},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee"},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint"},{flag:"--filter-release"},...MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,{flag:"--reason"},{flag:"--completed-at"},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--validate-close"},{flag:"--author"},{flag:"--message"},{flag:"--force"},{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"}];const APPEND_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--body",short:"-b"},{flag:"--text"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const CLAIM_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"},{flag:"--if-available"},{flag:"--next"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee-filter"},{flag:"--parent"},{flag:"--sprint"},{flag:"--release"},{flag:"--max-attempts"},{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--explain-ranking",aliases:["--explain_ranking"]}];const RESTORE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const DELETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const RELEASE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}];const START_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}];const PAUSE_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}];const CLOSE_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--force"}];const SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}];const MEET_FLAG_CONTRACTS=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS];const EVENT_FLAG_CONTRACTS=MEET_FLAG_CONTRACTS;const REMIND_FLAG_CONTRACTS=[{flag:"--at"},{flag:"--text"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS];const TEST_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{flag:"--remove-index",repeatable:true},{flag:"--run"},{flag:"--match"},{flag:"--only-index"},{flag:"--only-last"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--acknowledge-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--auto-pm-context"},{flag:"--measure",list:true},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const TEST_ALL_FLAG_CONTRACTS=[{flag:"--status"},{flag:"--limit"},{flag:"--offset"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--auto-pm-context"}];const TELEMETRY_FLAG_CONTRACTS=[{flag:"--limit"}];const TEST_RUNS_FLAG_CONTRACTS=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}];const GC_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--scope"}];const STATS_FLAG_CONTRACTS=[{flag:"--include-empty"},{flag:"--storage"},{flag:"--metadata-coverage"},{flag:"--field-utilization"},{flag:"--by-assignee"},{flag:"--by-tag"},{flag:"--by-priority"},{flag:"--tag-prefix"},{flag:"--analytics"}];const DUPLICATES_FLAG_CONTRACTS=[{flag:"--exhaustive",value_type:"boolean"},{flag:"--status",repeatable:true,list:true},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}];const HEALTH_FLAG_CONTRACTS=[{flag:"--strict-directories"},{flag:"--require-merge-drivers"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--check-only"},{flag:"--check-telemetry"},{flag:"--no-refresh"},{flag:"--refresh-vectors"},{flag:"--verbose-stale-items"},{flag:"--verbose-author-events"},{flag:"--brief"},{flag:"--summary"},{flag:"--skip-vectors"},{flag:"--skip-integrity"},{flag:"--skip-drift"},{flag:"--full"}];const VALIDATE_FLAG_CONTRACTS=[{flag:"--check-completeness",value_type:"boolean"},{flag:"--check-metadata"},{flag:"--metadata-profile"},{flag:"--check-resolution"},{flag:"--check-lifecycle"},{flag:"--check-stale-blockers"},{flag:"--dependency-cycle-severity"},{flag:"--parent-cycle-severity"},{flag:"--check-files"},{flag:"--scan-mode"},{flag:"--include-pm-internals"},{flag:"--verbose-file-lists"},{flag:"--verbose-diagnostics"},{flag:"--all-affected-ids"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--fix-hints"},{flag:"--auto-fix"},{flag:"--dry-run"},{flag:"--fix-scope"},{flag:"--prune-missing"},{flag:"--check-history-drift"},{flag:"--check-command-references"},{flag:"--check-storage-integrity"},{flag:"--counts"},{flag:"--full"}];const ASSURANCE_FLAG_CONTRACTS=[{flag:"--definition",value_name:"json"},{flag:"--trigger",value_name:"value"},{flag:"--tree",value_name:"value"},{flag:"--gate",value_name:"id"},{flag:"--limit",value_name:"number"},{flag:"--dry-run"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--owner",value_name:"item-id"},{flag:"--apply",value_type:"boolean"},{flag:"--enforcement",value_name:"level"}];const ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS=[{flag:"--assignee"},{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--allow-unresolved-deps"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-by"},{flag:"--blocked-reason"},{flag:"--unblock-note"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--actual-result"},{flag:"--affected-version"},{flag:"--fixed-version"}];const ITEM_PORTFOLIO_FLAG_CONTRACTS=[{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"}];const ITEM_CONTENT_METADATA_FLAG_CONTRACTS=[{short:"-p",flag:"--priority"},{flag:"--type"},{flag:"--tags",aliases:["--tag"],list:true},{flag:"--add-tags",aliases:["--add_tags"]},{flag:"--remove-tags",aliases:["--remove_tags"]},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--add-ac",aliases:["--add_ac"]},{flag:"--remove-ac",aliases:["--remove_ac"]}];const CREATE_FLAG_CONTRACTS=[{flag:"--stdin-json"},{short:"-t",flag:"--title"},{flag:"--id"},{short:"-d",flag:"--description"},{flag:"--type"},{flag:"--template"},{flag:"--create-mode"},{flag:"--create_mode"},{flag:"--schedule-preset"},{flag:"--schedule_preset"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},{flag:"--completed_at"},{short:"-p",flag:"--priority"},{flag:"--tags",aliases:["--tag"],list:true},{flag:"--add-tags",aliases:["--add_tags"]},{short:"-b",flag:"--body"},{flag:"--body-file"},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--author"},{flag:"--message"},...ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS,...ITEM_PORTFOLIO_FLAG_CONTRACTS,{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--fixed_version"},{flag:"--dep"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--reminder"},{flag:"--event"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--allow-duplicate",value_type:"boolean"}];const ITEM_MUTATE_FLAG_CONTRACTS=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{flag:"--dry-run"},{flag:"--create-compensation",value_name:"mode"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--author",value_name:"value"}];const ITEM_COMPLETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--transaction-id",value_name:"value",required:true},{flag:"--reason",value_name:"value"},{flag:"--file",value_name:"value",repeatable:true},{flag:"--doc",value_name:"value",repeatable:true},{flag:"--test",value_name:"value",repeatable:true},{flag:"--comment",value_name:"value",repeatable:true},{flag:"--note",value_name:"value",repeatable:true},{flag:"--learning",value_name:"value",repeatable:true},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",value_name:"value"},{flag:"--actual-result",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--dry-run"},{flag:"--force"},{flag:"--author",value_name:"value"}];const ITEM_REOPEN_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--status",value_name:"open|in_progress"},{flag:"--message",value_name:"value"},{flag:"--force"},{flag:"--author",value_name:"value"}];const COPY_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--title",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--allow-duplicate",value_type:"boolean"}];const FOCUS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--clear"}];const UPDATE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--stdin-json"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},{flag:"--body-file"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},...ITEM_CONTENT_METADATA_FLAG_CONTRACTS,...ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS,{flag:"--fixed_version"},...ITEM_PORTFOLIO_FLAG_CONTRACTS,{flag:"--author"},{flag:"--message"},{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--force"}];const UPDATE_MANY_FLAG_CONTRACTS=[{flag:"--status",short:"-s"},{flag:"--assignee"},{flag:"--parent"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--filter-status",list:true},{flag:"--filter-type",list:true},{flag:"--filter-tag",list:true},{flag:"--filter-priority",list:true},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee",list:true},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint",list:true},{flag:"--filter-release",list:true},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},...ITEM_CONTENT_METADATA_FLAG_CONTRACTS,{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--repro_steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--expected_result"},{flag:"--expected"},{flag:"--actual-result"},{flag:"--actual_result"},{flag:"--actual"},{flag:"--affected-version"},{flag:"--affected_version"},{flag:"--fixed-version"},{flag:"--fixed_version"},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--allow-unresolved-deps"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const CALENDAR_FLAG_CONTRACTS=[{flag:"--view"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--full-period"},{flag:"--full_period"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--status"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--include"},{flag:"--recurrence-lookahead-days"},{flag:"--recurrence-lookback-days"},{flag:"--occurrence-limit"},{flag:"--limit"},{flag:"--format"}];const ACTIVITY_FLAG_CONTRACTS=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--unbounded"},{flag:"--compact"},{flag:"--raw"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:true},{flag:"--agent-instance",repeatable:true},{flag:"--provenance-filter",repeatable:true},{flag:"--stream"}];const EVENTS_FLAG_CONTRACTS=[{flag:"--since"},{flag:"--type",repeatable:true},{flag:"--author",repeatable:true},{flag:"--item",repeatable:true},{flag:"--limit",value_type:"number"},{flag:"--cursor-mode",value_name:"batch|row"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:true},{flag:"--agent-instance",repeatable:true},{flag:"--provenance-filter",repeatable:true},{flag:"--follow"},{flag:"--interval-ms",value_type:"number"}];const CONTEXT_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit",aliases:["--max-items"]},{flag:"--after"},{flag:"--format"},{flag:"--depth"},{flag:"--fields",list:true},{flag:"--section"},{flag:"--activity-limit"},{flag:"--stale-threshold"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--no-extension-health"},{flag:"--no-tags"}],new Set(["--limit","--after","--format","--fields","--section","--activity-limit","--stale-threshold","--explain-ranking","--explain_ranking","--no-extension-health","--no-tags"]));const GET_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth"},{flag:"--full",value_type:"boolean"},{flag:"--fields",list:true},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}];const GUIDE_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}];const DEPS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--format"},{flag:"--max-depth"},{flag:"--collapse"},{flag:"--summary"},{flag:"--full"},{flag:"--node-limit"},{flag:"--edge-limit"},{flag:"--token-budget"},{flag:"--cursor"},{flag:"--direction"},{flag:"--kind",list:true}];const GRAPH_FLAG_CONTRACTS=[{flag:"--kind",list:true},{flag:"--max-depth"},{flag:"--limit"},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths"},{flag:"--sample"},{flag:"--exempt-isolate",list:true},{flag:"--exempt-isolate-type",list:true},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}];const EVAL_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}];const WORKSPACE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}];const WORKSPACE_POSITION_FLAG_CONTRACTS=[];const NEXT_FLAG_CONTRACTS=[{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--for",value_name:"intent"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit"},{flag:"--blocked-limit"},{flag:"--blocked_limit"},{flag:"--ready-only"},{flag:"--ready_only"},{flag:"--format"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]}];const SEARCH_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--mode"},{flag:"--semantic"},{flag:"--hybrid"},{flag:"--match-mode"},{flag:"--min-score"},{flag:"--count"},{flag:"--semantic-weight"},{flag:"--include-linked"},{flag:"--title-exact"},{flag:"--phrase-exact"},{flag:"--highlight"},{flag:"--compact"},{flag:"--full"},{flag:"--fields",list:true},{flag:"--format"},{flag:"--limit"},{flag:"--after"},{flag:"--status",list:true},{flag:"--type",list:true},{flag:"--tag",aliases:["--tags"],list:true},{flag:"--priority",list:true},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--assignee",list:true},{flag:"--sprint",list:true},{flag:"--release",list:true},{flag:"--parent"},...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"]));const CONTRACTS_FLAG_CONTRACTS=[{flag:"--action"},{flag:"--command"},{flag:"--summary"},{flag:"--schema-only"},{flag:"--flags-only"},{flag:"--availability-only"},{flag:"--runtime-only"},{flag:"--active-only"},{flag:"--full"}];const COMPLETION_FLAG_CONTRACTS=[{flag:"--eager-tags"}];function toUniqueFlagContracts(contracts){const seen=new Set;const unique=[];for(const contract of contracts){const aliasKey=(contract.aliases??[]).join(",");const key=`${contract.flag}|${contract.short??""}|${aliasKey}`;if(seen.has(key)){continue}seen.add(key);unique.push(contract)}return unique}function withSubcommandGlobalFlags(contracts){const byCanonicalFlag=new Map;for(const contract of[...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,...contracts]){const canonicalFlag=normalizeFlagAliasKey(contract.flag);const prior=byCanonicalFlag.get(canonicalFlag);const{aliases:declaredAliases,...contractWithoutAliases}=contract;const aliases=normalizeUniqueStringList([...declaredAliases??[],...contract.flag===canonicalFlag?[]:[contract.flag]]).filter(alias=>alias!==canonicalFlag);const normalizedContract={...contractWithoutAliases,flag:canonicalFlag,...aliases.length>0?{aliases}:{}};const mergedAliases=normalizeUniqueStringList([...prior?.aliases??[],...normalizedContract.aliases??[]]);byCanonicalFlag.set(canonicalFlag,prior===void 0?normalizedContract:{...prior,...normalizedContract,...mergedAliases.length>0?{aliases:mergedAliases}:{}})}return withFlagAliasMetadata([...byCanonicalFlag.values()])}const FIXED_STATUS_LIST_COMMAND_ALIASES=["list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"];const FIXED_STATUS_LIST_FLAG_CONTRACTS=LIST_FILTER_FLAG_CONTRACTS.filter(contract=>contract.flag!=="--status"&&contract.flag!=="--all");function indexCliFlagContracts(contracts){const index=new Map;for(const contract of contracts){for(const spelling of[contract.flag,...contract.aliases??[]]){const matches=index.get(spelling)??[];matches.push(contract);index.set(spelling,matches)}}return index}const PLAN_FLAG_CONTRACT_INDEX=indexCliFlagContracts(PLAN_FLAG_CONTRACTS);const ASSURANCE_FLAG_CONTRACT_INDEX=indexCliFlagContracts(ASSURANCE_FLAG_CONTRACTS);const POSITIONAL_ACTION_FLAG_INDEX_BY_PARENT=new Map([["assurance",ASSURANCE_FLAG_CONTRACT_INDEX],["plan",PLAN_FLAG_CONTRACT_INDEX],["workspace",indexCliFlagContracts(WORKSPACE_POSITION_FLAG_CONTRACTS)],["workspace snapshot",indexCliFlagContracts(WORKSPACE_FLAG_CONTRACTS)]]);function resolvePmPositionalActionFlagContracts(actions=PM_POSITIONAL_ACTION_CONTRACTS){return actions.map(({command,parent,accepted_flags:acceptedFlags})=>{const parentFlagIndex=POSITIONAL_ACTION_FLAG_INDEX_BY_PARENT.get(parent);if(!parentFlagIndex){throw new Error(`Positional action ${command} has no flag-contract index for ${parent}.`)}const selected=acceptedFlags.map(acceptedFlag=>{const matches=parentFlagIndex.get(acceptedFlag)??[];if(matches.length!==1){throw new Error(`Positional action ${command} accepted flag ${acceptedFlag} does not resolve to exactly one ${parent} flag contract.`)}return matches[0]});return[command,selected]})}const PM_POSITIONAL_ACTION_FLAG_CONTRACTS=resolvePmPositionalActionFlagContracts();const SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND=new Map([["list",LIST_FILTER_FLAG_CONTRACTS],["list-all",LIST_FILTER_FLAG_CONTRACTS],...FIXED_STATUS_LIST_COMMAND_ALIASES.map(command=>[command,FIXED_STATUS_LIST_FLAG_CONTRACTS]),["templates",CREATE_FLAG_CONTRACTS],["cal",CALENDAR_FLAG_CONTRACTS],["ctx",CONTEXT_FLAG_CONTRACTS],["test-runs-worker",TEST_RUNS_FLAG_CONTRACTS],["init",INIT_FLAG_CONTRACTS],["config",CONFIG_FLAG_CONTRACTS],["extension",EXTENSION_FLAG_CONTRACTS],["package",PACKAGE_FLAG_CONTRACTS],["packages",PACKAGE_FLAG_CONTRACTS],["install",INSTALL_FLAG_CONTRACTS],["upgrade",UPGRADE_FLAG_CONTRACTS],["create",CREATE_FLAG_CONTRACTS],["item",[]],["item mutate",ITEM_MUTATE_FLAG_CONTRACTS],["item complete",ITEM_COMPLETE_FLAG_CONTRACTS],["item reopen",ITEM_REOPEN_FLAG_CONTRACTS],["copy",COPY_FLAG_CONTRACTS],["focus",FOCUS_FLAG_CONTRACTS],["aggregate",AGGREGATE_FLAG_CONTRACTS],["calendar",CALENDAR_FLAG_CONTRACTS],["context",CONTEXT_FLAG_CONTRACTS],["get",GET_FLAG_CONTRACTS],["guide",GUIDE_FLAG_CONTRACTS],["search",SEARCH_FLAG_CONTRACTS],["next",NEXT_FLAG_CONTRACTS],["eval",EVAL_FLAG_CONTRACTS],["workspace",WORKSPACE_FLAG_CONTRACTS],["workspace position",WORKSPACE_POSITION_FLAG_CONTRACTS],["workspace snapshot",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot create",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot list",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot inspect",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot restore",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot delete",WORKSPACE_FLAG_CONTRACTS],["history",HISTORY_FLAG_CONTRACTS],["history-redact",HISTORY_REDACT_FLAG_CONTRACTS],["history-repair",HISTORY_REPAIR_FLAG_CONTRACTS],["history-author-acknowledge",HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS],["history-compact",HISTORY_COMPACT_FLAG_CONTRACTS],["merge",MERGE_FLAG_CONTRACTS],["schema",SCHEMA_FLAG_CONTRACTS],["profile",PROFILE_FLAG_CONTRACTS],["plan",PLAN_FLAG_CONTRACTS],["activity",ACTIVITY_FLAG_CONTRACTS],["events",EVENTS_FLAG_CONTRACTS],["restore",RESTORE_FLAG_CONTRACTS],["update",UPDATE_FLAG_CONTRACTS],["update-many",UPDATE_MANY_FLAG_CONTRACTS],["close",CLOSE_FLAG_CONTRACTS],["close-many",CLOSE_MANY_FLAG_CONTRACTS],["delete",DELETE_FLAG_CONTRACTS],["append",APPEND_FLAG_CONTRACTS],["comments",COMMENTS_FLAG_CONTRACTS],["notes",NOTES_FLAG_CONTRACTS],["learnings",LEARNINGS_FLAG_CONTRACTS],["files",FILES_FLAG_CONTRACTS],["docs",DOCS_FLAG_CONTRACTS],["deps",DEPS_FLAG_CONTRACTS],["graph",GRAPH_FLAG_CONTRACTS],["test",TEST_FLAG_CONTRACTS],["test-all",TEST_ALL_FLAG_CONTRACTS],["telemetry",TELEMETRY_FLAG_CONTRACTS],["health",HEALTH_FLAG_CONTRACTS],["assurance",ASSURANCE_FLAG_CONTRACTS],...PM_POSITIONAL_ACTION_FLAG_CONTRACTS,["validate",VALIDATE_FLAG_CONTRACTS],["gc",GC_FLAG_CONTRACTS],["stats",STATS_FLAG_CONTRACTS],["duplicates",DUPLICATES_FLAG_CONTRACTS],["contracts",CONTRACTS_FLAG_CONTRACTS],["completion",COMPLETION_FLAG_CONTRACTS],["claim",CLAIM_FLAG_CONTRACTS],["release",RELEASE_FLAG_CONTRACTS],["start-task",START_TASK_FLAG_CONTRACTS],["pause-task",PAUSE_TASK_FLAG_CONTRACTS],["close-task",CLOSE_TASK_FLAG_CONTRACTS],["meet",MEET_FLAG_CONTRACTS],["event",EVENT_FLAG_CONTRACTS],["remind",REMIND_FLAG_CONTRACTS]]);const EXTENSION_LIFECYCLE_FLAG_CONTRACTS_BY_SUBCOMMAND=new Map([["install",EXTENSION_INSTALL_FLAG_CONTRACTS],["uninstall",EXTENSION_UNINSTALL_FLAG_CONTRACTS],["explore",EXTENSION_EXPLORE_FLAG_CONTRACTS],["manage",EXTENSION_MANAGE_FLAG_CONTRACTS],["describe",EXTENSION_DESCRIBE_FLAG_CONTRACTS],["reload",EXTENSION_RELOAD_FLAG_CONTRACTS],["doctor",EXTENSION_DOCTOR_FLAG_CONTRACTS],["catalog",EXTENSION_CATALOG_FLAG_CONTRACTS],["list",EXTENSION_CATALOG_FLAG_CONTRACTS],["adopt",EXTENSION_ADOPT_FLAG_CONTRACTS],["adopt-all",EXTENSION_ADOPT_ALL_FLAG_CONTRACTS],["activate",EXTENSION_ACTIVATE_FLAG_CONTRACTS],["deactivate",EXTENSION_DEACTIVATE_FLAG_CONTRACTS],["migrate",EXTENSION_MIGRATE_FLAG_CONTRACTS]]);function normalizeCommandNameForContracts(commandName){if(typeof commandName!=="string"){return""}return resolvePmHistoryOperation(commandName.trim().toLowerCase())}function hasSubcommandFlagContractsForCommand(commandName){const normalized=normalizeCommandNameForContracts(commandName);if(SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.has(normalized)){return true}const[rootCommand,lifecycleSubcommand,...extraParts]=normalized.split(/\s+/);return(rootCommand==="extension"||rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand!==void 0&&extraParts.length===0&&(lifecycleSubcommand==="init"||lifecycleSubcommand==="scaffold"||EXTENSION_LIFECYCLE_FLAG_CONTRACTS_BY_SUBCOMMAND.has(lifecycleSubcommand))}function resolveExtensionLifecycleFlagContracts(rootCommand,lifecycleSubcommand){if(lifecycleSubcommand==="init"||lifecycleSubcommand==="scaffold"){return rootCommand==="extension"?EXTENSION_INIT_FLAG_CONTRACTS:PACKAGE_INIT_FLAG_CONTRACTS}return EXTENSION_LIFECYCLE_FLAG_CONTRACTS_BY_SUBCOMMAND.get(lifecycleSubcommand)??[]}function resolveSubcommandFlagContractsForCommand(commandName){const normalized=normalizeCommandNameForContracts(commandName);if(normalized.length===0){return withSubcommandGlobalFlags([])}const[rootCommand,lifecycleSubcommand,...extraParts]=normalized.split(/\s+/);if((rootCommand==="extension"||rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand!==void 0&&extraParts.length===0){if((rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand==="upgrade"){return withSubcommandGlobalFlags(UPGRADE_FLAG_CONTRACTS)}return withSubcommandGlobalFlags(resolveExtensionLifecycleFlagContracts(rootCommand,lifecycleSubcommand))}const contracts=SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.get(normalized)??[];return withSubcommandGlobalFlags(contracts)}function toCompletionFlagString(flagContracts,includeGlobal=true){const aliasAwareContracts=withFlagAliasMetadata(flagContracts);const scoped=aliasAwareContracts.flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>Boolean(value));const all=includeGlobal?[...scoped,...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS.flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>Boolean(value))]:scoped;return normalizeUniqueStringList(all).join(" ")}export{ACTIVITY_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,NEXT_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_FLAG_CONTRACTS,PM_POSITIONAL_ACTION_FLAG_CONTRACTS,PROFILE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,SEARCH_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,WORKSPACE_POSITION_FLAG_CONTRACTS,compactFlagAliasContracts,hasSubcommandFlagContractsForCommand,resolvePmPositionalActionFlagContracts,resolveSubcommandFlagContractsForCommand,toCompletionFlagString,toUniqueFlagContracts,withFlagAliasMetadata};
1
+ !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="80032ee8-b588-5e16-8114-57f16e421c84")}catch(e2){}})();import{resolvePmHistoryOperation}from"./command-aliases.js";import{normalizeUniqueStringList}from"./string-lists.js";import{RESERVED_EXTENSION_HOST_FLAGS}from"../../core/extensions/reserved-host-flags.js";import{PM_POSITIONAL_ACTION_CONTRACTS}from"./grammar-contracts.js";function normalizeFlagAliasKey(flag){if(!flag.startsWith("--")){return flag}return`--${flag.slice(2).replaceAll("_","-")}`}function withFlagAliasMetadata(flagContracts){const aliasesByCanonical=new Map;for(const contract of flagContracts){const canonical=normalizeFlagAliasKey(contract.flag);const bucket=aliasesByCanonical.get(canonical)??new Set;if(contract.flag!==canonical){bucket.add(contract.flag)}for(const alias of contract.aliases??[]){if(alias!==canonical){bucket.add(alias)}}aliasesByCanonical.set(canonical,bucket)}return flagContracts.map(contract=>{const canonical=normalizeFlagAliasKey(contract.flag);if(contract.flag!==canonical){return contract}const aliases=normalizeUniqueStringList([...contract.aliases??[],...aliasesByCanonical.get(canonical)]).filter(alias=>alias!==canonical);if(aliases.length===0){return contract}return{...contract,aliases}})}function compactFlagAliasContracts(flagContracts){const withAliases=withFlagAliasMetadata(flagContracts);const canonicalFlags=new Set(withAliases.map(contract=>contract.flag));return withAliases.filter(contract=>{const canonical=normalizeFlagAliasKey(contract.flag);return contract.flag===canonical||!canonicalFlags.has(canonical)})}const SUBCOMMAND_GLOBAL_FLAG_CONTRACTS=RESERVED_EXTENSION_HOST_FLAGS.map(definition=>({flag:definition.flag,reservation_scope:"inherited",...definition.aliases?{aliases:[...definition.aliases]}:{},...definition.value_name?{value_name:definition.value_name}:{}}));const GLOBAL_FLAG_CONTRACTS=[...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,{flag:"--version",value_type:"boolean",reservation_scope:"root_only"},{flag:"--all",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help to every command."},{flag:"--explain",value_type:"boolean",reservation_scope:"root_only",description:"Expand root help with command guidance."}];const GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--has-notes"},{flag:"--no-notes"},{flag:"--has-learnings"},{flag:"--no-learnings"},{flag:"--has-files"},{flag:"--no-files"},{flag:"--filter-files-missing"},{flag:"--has-docs"},{flag:"--no-docs"},{flag:"--filter-docs-missing"},{flag:"--has-tests"},{flag:"--no-tests"},{flag:"--has-comments"},{flag:"--no-comments"},{flag:"--has-deps"},{flag:"--no-deps"},{flag:"--has-body"},{flag:"--empty-body"},{flag:"--has-linked-command"},{flag:"--no-linked-command"}];const MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS=[{flag:"--filter-reviewer-missing"},{flag:"--filter-risk-missing"},{flag:"--filter-confidence-missing"},{flag:"--filter-sprint-missing"},{flag:"--filter-release-missing"},{flag:"--filter-has-notes"},{flag:"--filter-no-notes"},{flag:"--filter-has-learnings"},{flag:"--filter-no-learnings"},{flag:"--filter-has-files"},{flag:"--filter-no-files"},{flag:"--filter-has-docs"},{flag:"--filter-no-docs"},{flag:"--filter-has-tests"},{flag:"--filter-no-tests"},{flag:"--filter-has-comments"},{flag:"--filter-no-comments"},{flag:"--filter-has-deps"},{flag:"--filter-no-deps"},{flag:"--filter-has-body"},{flag:"--filter-empty-body"},{flag:"--filter-has-linked-command"},{flag:"--filter-no-linked-command"},{flag:"--ids",list:true},{flag:"--limit"},{flag:"--offset"}];const LIST_FILTER_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--status",list:true},{flag:"--all",value_type:"boolean"},{flag:"--type",list:true},{flag:"--tag",aliases:["--tags"],list:true},{flag:"--priority",list:true},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--today"},{flag:"--recent"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--ids",list:true},{flag:"--assignee",list:true},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:true},{flag:"--release",list:true},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,{flag:"--limit"},{flag:"--offset"},{flag:"--after"},{flag:"--no-truncate"},{flag:"--compact"},{flag:"--brief"},{flag:"--full"},{flag:"--fields",list:true},{flag:"--sort"},{flag:"--order"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--include-body"},{flag:"--strict-read"},{flag:"--format"},{flag:"--stream"}],new Set(["--limit","--token-budget","--offset","--after","--no-truncate","--compact","--brief","--full","--fields","--include-body","--strict-read"]));const AGGREGATE_FLAG_CONTRACTS=[{flag:"--group-by",list:true},{flag:"--set-mode"},{flag:"--limit"},{flag:"--after"},{flag:"--count"},{flag:"--completion"},{flag:"--sum"},{flag:"--avg"},{flag:"--include-unparented"},{flag:"--include_unparented"},{flag:"--status",list:true},{flag:"--type",list:true},{flag:"--tag",list:true},{flag:"--priority",list:true},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--assignee",list:true},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:true},{flag:"--release",list:true}];const COMMENTS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--comment","--body","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];function withCursorSemantics(contracts,presentationFlags){return contracts.map(contract=>presentationFlags.has(contract.flag)?{...contract,cursor_semantics:"presentation"}:contract)}const NOTES_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--note","--text"]},{flag:"--add-json"},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--since"},{flag:"--event-type"},{flag:"--include-meta"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const LEARNINGS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--learning","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const FILES_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--append-stable"},{flag:"--validate-paths"},{flag:"--scope"},{flag:"--limit"},{flag:"--offset"},{flag:"--no-truncate"},{flag:"--strict-read"},{flag:"--explain"},{flag:"--lines",value_name:"start:end"},{flag:"--decision-depth",value_name:"n",value_type:"number"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const DOCS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-glob"},{flag:"--remove"},{flag:"--migrate"},{flag:"--note"},{flag:"--list"},{flag:"--validate-paths"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const HISTORY_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--limit"},{flag:"--compact"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:true},{flag:"--agent-instance",repeatable:true},{flag:"--provenance-filter",repeatable:true},{flag:"--diff"},{flag:"--field"},{flag:"--verify"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--format"}];const MERGE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--message"},{flag:"--force"},{flag:"--include-reconciled"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}];const HISTORY_REDACT_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--literal"},{flag:"--regex"},{flag:"--replacement"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const HISTORY_REPAIR_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--all"},{flag:"--dry-run"},{flag:"--normalize-provenance"},{flag:"--salvage-tail",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS=[{flag:"--event",repeatable:true},{flag:"--all-actionable"},{flag:"--dry-run"},{flag:"--plan-fingerprint"},{flag:"--limit",value_type:"number"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}];const HISTORY_COMPACT_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--before"},{flag:"--ids",list:true},{flag:"--all-over",value_type:"number"},{flag:"--closed"},{flag:"--all-streams"},{flag:"--min-entries",value_type:"number"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const SCHEMA_FLAG_CONTRACTS=[{flag:"--definition",value_name:"json"},{flag:"--policy",value_name:"id"},{flag:"--message",value_name:"value"},{flag:"--description"},{flag:"--default-status",aliases:["--default_status"]},{flag:"--folder"},{flag:"--alias"},{flag:"--role"},{flag:"--order"},{flag:"--type"},{flag:"--commands"},{flag:"--cli-flag"},{flag:"--required"},{flag:"--required-on-create"},{flag:"--no-allow-unset"},{flag:"--required-types"},{flag:"--infer"},{flag:"--min-count"},{flag:"--apply",value_type:"boolean"},{flag:"--to"},{flag:"--migration-id",aliases:["--migration_id"]},{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}];const PROFILE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}];const PLAN_FLAG_CONTRACTS=[{flag:"--title"},{flag:"--description"},{flag:"--scope"},{flag:"--parent"},{flag:"--related"},{flag:"--blocks"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--harness"},{flag:"--mode"},{flag:"--resume-context",aliases:["--resume_context"]},{flag:"--tags",aliases:["--tag"],list:true},{flag:"--priority"},{flag:"--status",short:"-s"},{flag:"--create-mode",aliases:["--create_mode"]},{flag:"--deadline"},{flag:"--estimate",aliases:["--estimated-minutes","--estimated_minutes"]},{flag:"--acceptance-criteria",aliases:["--acceptance_criteria","--ac"],repeatable:true},{flag:"--definition-of-ready",aliases:["--definition_of_ready"]},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now",aliases:["--why_now"]},{flag:"--assignee"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps",aliases:["--repro_steps"]},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--affected-version",aliases:["--affected_version"]},{flag:"--fixed-version",aliases:["--fixed_version"]},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact",aliases:["--customer_impact"]},{flag:"--comment",repeatable:true},{flag:"--note",repeatable:true},{flag:"--learning",repeatable:true},{flag:"--reminder",repeatable:true},{flag:"--event",repeatable:true},{flag:"--type-option",aliases:["--type_option"],repeatable:true},{flag:"--body"},{flag:"--claim"},{flag:"--from-search",aliases:["--from_search"]},{flag:"--template"},{flag:"--step-title",aliases:["--step_title"]},{flag:"--step"},{flag:"--step-body",aliases:["--step_body"]},{flag:"--step-owner",aliases:["--step_owner"]},{flag:"--step-status",aliases:["--step_status"]},{flag:"--step-evidence",aliases:["--step_evidence"]},{flag:"--step-blocked-reason",aliases:["--step_blocked_reason"]},{flag:"--step-replacement",aliases:["--step_replacement"]},{flag:"--depends-on",aliases:["--depends_on"]},{flag:"--link"},{flag:"--link-kind",aliases:["--link_kind"]},{flag:"--link-note",aliases:["--link_note"]},{flag:"--promote-to-item-dep",aliases:["--promote_to_item_dep"]},{flag:"--allow-multiple-active",aliases:["--allow_multiple_active"]},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--decision-text",aliases:["--decision_text","--decision"]},{flag:"--decision-rationale",aliases:["--decision_rationale"]},{flag:"--decision-evidence",aliases:["--decision_evidence"]},{flag:"--discovery-text",aliases:["--discovery_text","--discovery"]},{flag:"--validation-text",aliases:["--validation_text","--validation"]},{flag:"--validation-command",aliases:["--validation_command"]},{flag:"--validation-expected",aliases:["--validation_expected"]},{flag:"--depth"},{flag:"--field"},{flag:"--fields",list:true},{flag:"--steps"},{flag:"--materialize-type",aliases:["--materialize_type"]},{flag:"--materialize-parent",aliases:["--materialize_parent"]},{flag:"--materialize-tags",aliases:["--materialize_tags"]},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const INIT_FLAG_CONTRACTS=[{flag:"--id-prefix",aliases:["--prefix"]},{flag:"--preset"},{flag:"--type-preset"},{flag:"--defaults",short:"-y",aliases:["--yes"]},{flag:"--author"},{flag:"--agent-guidance"},{flag:"--with-packages"},{flag:"--no-merge-fence"},{flag:"--workspace"},{flag:"--force"},{flag:"--verbose"}];const CONFIG_FLAG_CONTRACTS=[{flag:"--value",value_name:"value"},{flag:"--criterion"},{flag:"--clear-criteria"},{flag:"--format"},{flag:"--policy"},{flag:"--default-depth"},{flag:"--activity-limit"},{flag:"--stale-threshold-days"},{flag:"--section-hierarchy"},{flag:"--section-activity"},{flag:"--section-progress"},{flag:"--section-blockers"},{flag:"--section-files"},{flag:"--section-workload"},{flag:"--section-staleness"},{flag:"--section-tests"}];const EXTENSION_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{flag:"--describe"},{flag:"--markdown"},{flag:"--output"},{flag:"--reload"},{flag:"--watch"},{flag:"--doctor"},{flag:"--catalog"},{flag:"--adopt"},{flag:"--adopt-all"},{flag:"--activate"},{flag:"--deactivate"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"},{flag:"--detail"},{flag:"--trace"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}];const EXTENSION_SCOPE_FLAG_CONTRACTS=[{flag:"--project"},{flag:"--local"},{flag:"--global"}];const EXTENSION_INIT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--capability"}];const PACKAGE_FLAG_CONTRACTS=[...EXTENSION_FLAG_CONTRACTS,{flag:"--declarative"}];const PACKAGE_INIT_FLAG_CONTRACTS=[...EXTENSION_INIT_FLAG_CONTRACTS,{flag:"--declarative"}];const EXTENSION_INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}];const EXTENSION_UNINSTALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_EXPLORE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_DESCRIBE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--markdown"},{flag:"--output"}];const EXTENSION_ADOPT_ALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_ACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_DEACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS;const EXTENSION_MIGRATE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--dry-run"}];const EXTENSION_MANAGE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--runtime-probe"},{flag:"--fix-managed-state"}];const EXTENSION_RELOAD_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--watch"}];const EXTENSION_DOCTOR_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--detail"},{flag:"--trace"},{flag:"--fix-managed-state"},{flag:"--isolated"},{flag:"--ignore-global"},{flag:"--strict-exit"},{flag:"--fail-on-warn"}];const EXTENSION_CATALOG_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--fields",list:true}];const EXTENSION_ADOPT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}];const INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}];const UPGRADE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--cli-only"},{flag:"--packages-only"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--repair"},{flag:"--tag"},{flag:"--package-name"}];const REINDEX_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--progress"}];const CLOSE_FLAG_CONTRACTS=[{flag:"--release-assignment",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--reason",value_name:"value"},{flag:"--close-reason",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--duplicate-of",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",aliases:["--expected_result","--expected"],value_name:"value"},{flag:"--actual-result",aliases:["--actual_result","--actual"],value_name:"value"},{flag:"--force",value_type:"boolean"}];const CLOSE_MANY_FLAG_CONTRACTS=[{flag:"--filter-status",list:true},{flag:"--filter-type"},{flag:"--filter-tag"},{flag:"--filter-priority"},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee"},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint"},{flag:"--filter-release"},...MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,{flag:"--reason"},{flag:"--completed-at"},{flag:"--resolution"},{flag:"--expected-result",aliases:["--expected_result","--expected"]},{flag:"--actual-result",aliases:["--actual_result","--actual"]},{flag:"--validate-close"},{flag:"--author"},{flag:"--message"},{flag:"--force"},{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"}];const APPEND_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--body",short:"-b"},{flag:"--text"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const CLAIM_FLAG_CONTRACTS=[{flag:"--start",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"},{flag:"--if-available"},{flag:"--next"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee-filter"},{flag:"--parent"},{flag:"--sprint"},{flag:"--release"},{flag:"--max-attempts"},{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--explain-ranking",aliases:["--explain_ranking"]}];const RESTORE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const DELETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const RELEASE_FLAG_CONTRACTS=[{flag:"--pause",value_type:"boolean"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}];const START_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}];const PAUSE_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}];const CLOSE_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--force"}];const SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}];const MEET_FLAG_CONTRACTS=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS];const EVENT_FLAG_CONTRACTS=MEET_FLAG_CONTRACTS;const REMIND_FLAG_CONTRACTS=[{flag:"--at"},{flag:"--text"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS];const TEST_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{flag:"--remove-index",repeatable:true},{flag:"--run"},{flag:"--match"},{flag:"--only-index"},{flag:"--only-last"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--acknowledge-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--auto-pm-context"},{flag:"--measure",list:true},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const TEST_ALL_FLAG_CONTRACTS=[{flag:"--status"},{flag:"--limit"},{flag:"--offset"},{flag:"--background"},{flag:"--timeout"},{flag:"--progress"},{flag:"--env-set"},{flag:"--env-clear"},{flag:"--shared-host-safe"},{flag:"--pm-context"},{flag:"--override-linked-pm-context"},{flag:"--workspace-context"},{flag:"--override-linked-workspace-context"},{flag:"--allow-untrusted-linked-tests"},{flag:"--fail-on-context-mismatch"},{flag:"--fail-on-skipped"},{flag:"--fail-on-empty-test-run"},{flag:"--require-assertions-for-pm"},{flag:"--check-context"},{flag:"--auto-pm-context"}];const TELEMETRY_FLAG_CONTRACTS=[{flag:"--limit"}];const TEST_RUNS_FLAG_CONTRACTS=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}];const GC_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--scope"}];const STATS_FLAG_CONTRACTS=[{flag:"--include-empty"},{flag:"--storage"},{flag:"--metadata-coverage"},{flag:"--field-utilization"},{flag:"--by-assignee"},{flag:"--by-tag"},{flag:"--by-priority"},{flag:"--tag-prefix"},{flag:"--analytics"}];const DUPLICATES_FLAG_CONTRACTS=[{flag:"--exhaustive",value_type:"boolean"},{flag:"--status",repeatable:true,list:true},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}];const HEALTH_FLAG_CONTRACTS=[{flag:"--strict-directories"},{flag:"--require-merge-drivers"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--check-only"},{flag:"--check-telemetry"},{flag:"--no-refresh"},{flag:"--refresh-vectors"},{flag:"--verbose-stale-items"},{flag:"--verbose-author-events"},{flag:"--brief"},{flag:"--summary"},{flag:"--skip-vectors"},{flag:"--skip-integrity"},{flag:"--skip-drift"},{flag:"--full"}];const VALIDATE_FLAG_CONTRACTS=[{flag:"--check-completeness",value_type:"boolean"},{flag:"--check-metadata"},{flag:"--metadata-profile"},{flag:"--check-resolution"},{flag:"--check-lifecycle"},{flag:"--check-stale-blockers"},{flag:"--dependency-cycle-severity"},{flag:"--parent-cycle-severity"},{flag:"--check-files"},{flag:"--scan-mode"},{flag:"--include-pm-internals"},{flag:"--verbose-file-lists"},{flag:"--verbose-diagnostics"},{flag:"--all-affected-ids"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--fix-hints"},{flag:"--auto-fix"},{flag:"--dry-run"},{flag:"--fix-scope"},{flag:"--prune-missing"},{flag:"--check-history-drift"},{flag:"--check-command-references"},{flag:"--check-storage-integrity"},{flag:"--counts"},{flag:"--full"}];const ASSURANCE_FLAG_CONTRACTS=[{flag:"--definition",value_name:"json"},{flag:"--trigger",value_name:"value"},{flag:"--tree",value_name:"value"},{flag:"--gate",value_name:"id"},{flag:"--limit",value_name:"number"},{flag:"--dry-run"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--owner",value_name:"item-id"},{flag:"--apply",value_type:"boolean"},{flag:"--enforcement",value_name:"level"}];const ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS=[{flag:"--assignee"},{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--allow-unresolved-deps"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--blocked-by"},{flag:"--blocked-reason"},{flag:"--unblock-note"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--actual-result"},{flag:"--affected-version"},{flag:"--fixed-version"}];const ITEM_PORTFOLIO_FLAG_CONTRACTS=[{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"}];const ITEM_CONTENT_METADATA_FLAG_CONTRACTS=[{short:"-p",flag:"--priority"},{flag:"--type"},{flag:"--tags",aliases:["--tag"],list:true},{flag:"--add-tags",aliases:["--add_tags"]},{flag:"--remove-tags",aliases:["--remove_tags"]},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--add-ac",aliases:["--add_ac"]},{flag:"--remove-ac",aliases:["--remove_ac"]}];const CREATE_FLAG_CONTRACTS=[{flag:"--stdin-json"},{short:"-t",flag:"--title"},{flag:"--id"},{short:"-d",flag:"--description"},{flag:"--type"},{flag:"--template"},{flag:"--create-mode"},{flag:"--create_mode"},{flag:"--schedule-preset"},{flag:"--schedule_preset"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},{flag:"--completed_at"},{short:"-p",flag:"--priority"},{flag:"--tags",aliases:["--tag"],list:true},{flag:"--add-tags",aliases:["--add_tags"]},{short:"-b",flag:"--body"},{flag:"--body-file"},{flag:"--deadline"},{flag:"--estimate"},{flag:"--estimated-minutes"},{flag:"--estimated_minutes"},{flag:"--acceptance-criteria"},{flag:"--acceptance_criteria"},{flag:"--ac"},{flag:"--author"},{flag:"--message"},...ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS,...ITEM_PORTFOLIO_FLAG_CONTRACTS,{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--fixed_version"},{flag:"--dep"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--reminder"},{flag:"--event"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--allow-duplicate",value_type:"boolean"}];const ITEM_MUTATE_FLAG_CONTRACTS=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{flag:"--dry-run"},{flag:"--create-compensation",value_name:"mode"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--author",value_name:"value"}];const ITEM_COMPLETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--transaction-id",value_name:"value",required:true},{flag:"--reason",value_name:"value"},{flag:"--file",value_name:"value",repeatable:true},{flag:"--doc",value_name:"value",repeatable:true},{flag:"--test",value_name:"value",repeatable:true},{flag:"--comment",value_name:"value",repeatable:true},{flag:"--note",value_name:"value",repeatable:true},{flag:"--learning",value_name:"value",repeatable:true},{flag:"--resolution",value_name:"value"},{flag:"--expected-result",value_name:"value"},{flag:"--actual-result",value_name:"value"},{flag:"--completed-at",value_name:"value"},{flag:"--validate-close",value_name:"off|warn|strict"},{flag:"--lock-ttl-seconds",value_name:"n"},{flag:"--lock-wait-ms",value_name:"n"},{flag:"--dry-run"},{flag:"--force"},{flag:"--author",value_name:"value"}];const ITEM_REOPEN_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--status",value_name:"open|in_progress"},{flag:"--message",value_name:"value"},{flag:"--force"},{flag:"--author",value_name:"value"}];const COPY_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--title",value_name:"value"},{flag:"--author",value_name:"value"},{flag:"--message",value_name:"value"},{flag:"--allow-duplicate",value_type:"boolean"}];const FOCUS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--clear"}];const UPDATE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--stdin-json"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},{flag:"--body-file"},{short:"-s",flag:"--status"},{flag:"--close-reason"},{flag:"--close_reason"},{flag:"--completed-at"},...ITEM_CONTENT_METADATA_FLAG_CONTRACTS,...ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS,{flag:"--fixed_version"},...ITEM_PORTFOLIO_FLAG_CONTRACTS,{flag:"--author"},{flag:"--message"},{flag:"--blocked_by"},{flag:"--blocked_reason"},{flag:"--unblock_note"},{flag:"--repro_steps"},{flag:"--expected_result"},{flag:"--actual_result"},{flag:"--expected"},{flag:"--actual"},{flag:"--affected_version"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file",aliases:["--linked-file"]},{flag:"--test",aliases:["--linked-test"]},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--field"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--force"}];const UPDATE_MANY_FLAG_CONTRACTS=[{flag:"--status",short:"-s"},{flag:"--assignee"},{flag:"--parent"},{flag:"--blocked-by",aliases:["--blocked_by"]},{flag:"--blocked-reason",aliases:["--blocked_reason"]},{flag:"--unblock-note",aliases:["--unblock_note"]},{flag:"--filter-status",list:true},{flag:"--filter-type",list:true},{flag:"--filter-tag",list:true},{flag:"--filter-priority",list:true},{flag:"--filter-deadline-before"},{flag:"--filter-deadline-after"},{flag:"--filter-updated-after"},{flag:"--filter-updated-before"},{flag:"--filter-created-after"},{flag:"--filter-created-before"},{flag:"--filter-assignee",list:true},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint",list:true},{flag:"--filter-release",list:true},{flag:"--filter-ac-missing"},{flag:"--filter-estimates-missing",aliases:["--filter-estimate-missing"]},{flag:"--filter-resolution-missing"},{flag:"--filter-metadata-missing"},...MANY_GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS,{flag:"--dry-run"},{flag:"--rollback"},{flag:"--no-checkpoint"},{short:"-t",flag:"--title"},{short:"-d",flag:"--description"},{short:"-b",flag:"--body"},...ITEM_CONTENT_METADATA_FLAG_CONTRACTS,{flag:"--definition-of-ready"},{flag:"--definition_of_ready"},{flag:"--order"},{flag:"--rank"},{flag:"--goal"},{flag:"--objective"},{flag:"--value"},{flag:"--impact"},{flag:"--outcome"},{flag:"--why-now"},{flag:"--why_now"},{flag:"--reviewer"},{flag:"--risk"},{flag:"--confidence"},{flag:"--sprint"},{flag:"--release"},{flag:"--reporter"},{flag:"--severity"},{flag:"--environment"},{flag:"--repro-steps"},{flag:"--repro_steps"},{flag:"--resolution"},{flag:"--expected-result"},{flag:"--expected_result"},{flag:"--expected"},{flag:"--actual-result"},{flag:"--actual_result"},{flag:"--actual"},{flag:"--affected-version"},{flag:"--affected_version"},{flag:"--fixed-version"},{flag:"--fixed_version"},{flag:"--component"},{flag:"--regression"},{flag:"--customer-impact"},{flag:"--customer_impact"},{flag:"--allow-unresolved-deps"},{flag:"--dep"},{flag:"--dep-remove"},{flag:"--dep_remove"},{flag:"--replace-deps"},{flag:"--replace-tests"},{flag:"--replace-files"},{flag:"--replace-docs"},{flag:"--comment"},{flag:"--note"},{flag:"--learning"},{flag:"--file"},{flag:"--test"},{flag:"--doc"},{flag:"--reminder"},{flag:"--event"},{flag:"--type-option"},{flag:"--type_option"},{flag:"--unset"},{flag:"--clear-deps"},{flag:"--clear-comments"},{flag:"--clear-notes"},{flag:"--clear-learnings"},{flag:"--clear-files"},{flag:"--clear-tests"},{flag:"--clear-docs"},{flag:"--clear-reminders"},{flag:"--clear-events"},{flag:"--clear-type-options"},{flag:"--author"},{flag:"--message"},{flag:"--force"}];const CALENDAR_FLAG_CONTRACTS=[{flag:"--view"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--full-period"},{flag:"--full_period"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--status"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--include"},{flag:"--recurrence-lookahead-days"},{flag:"--recurrence-lookback-days"},{flag:"--occurrence-limit"},{flag:"--limit"},{flag:"--format"}];const ACTIVITY_FLAG_CONTRACTS=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--unbounded"},{flag:"--compact"},{flag:"--raw"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:true},{flag:"--agent-instance",repeatable:true},{flag:"--provenance-filter",repeatable:true},{flag:"--stream"}];const EVENTS_FLAG_CONTRACTS=[{flag:"--since"},{flag:"--type",repeatable:true},{flag:"--author",repeatable:true},{flag:"--item",repeatable:true},{flag:"--limit",value_type:"number"},{flag:"--cursor-mode",value_name:"batch|row"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:true},{flag:"--agent-instance",repeatable:true},{flag:"--provenance-filter",repeatable:true},{flag:"--follow"},{flag:"--interval-ms",value_type:"number"}];const CONTEXT_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--date"},{flag:"--from"},{flag:"--to"},{flag:"--past"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit",aliases:["--max-items"]},{flag:"--after"},{flag:"--format"},{flag:"--depth"},{flag:"--fields",list:true},{flag:"--section"},{flag:"--activity-limit"},{flag:"--stale-threshold"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--no-extension-health"},{flag:"--no-tags"}],new Set(["--limit","--after","--format","--fields","--section","--activity-limit","--stale-threshold","--explain-ranking","--explain_ranking","--no-extension-health","--no-tags"]));const GET_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth"},{flag:"--full",value_type:"boolean"},{flag:"--fields",list:true},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}];const GUIDE_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}];const DEPS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--format"},{flag:"--max-depth"},{flag:"--collapse"},{flag:"--summary"},{flag:"--full"},{flag:"--node-limit"},{flag:"--edge-limit"},{flag:"--token-budget"},{flag:"--cursor"},{flag:"--direction"},{flag:"--kind",list:true}];const GRAPH_FLAG_CONTRACTS=[{flag:"--kind",list:true},{flag:"--max-depth"},{flag:"--limit"},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths"},{flag:"--sample"},{flag:"--exempt-isolate",list:true},{flag:"--exempt-isolate-type",list:true},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}];const EVAL_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}];const WORKSPACE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}];const WORKSPACE_POSITION_FLAG_CONTRACTS=[];const NEXT_FLAG_CONTRACTS=[{flag:"--include-decisions"},{flag:"--include-gates"},{flag:"--include-containers"},{flag:"--for",value_name:"intent"},{flag:"--type"},{flag:"--tag"},{flag:"--priority"},{flag:"--assignee"},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--sprint"},{flag:"--release"},{flag:"--parent"},{flag:"--limit"},{flag:"--blocked-limit"},{flag:"--blocked_limit"},{flag:"--ready-only"},{flag:"--ready_only"},{flag:"--format"},{flag:"--explain-ranking"},{flag:"--explain_ranking"},{flag:"--token-budget",aliases:["--token_budget"]}];const SEARCH_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--mode"},{flag:"--semantic"},{flag:"--hybrid"},{flag:"--match-mode"},{flag:"--min-score"},{flag:"--count"},{flag:"--semantic-weight"},{flag:"--include-linked"},{flag:"--title-exact"},{flag:"--phrase-exact"},{flag:"--highlight"},{flag:"--compact"},{flag:"--full"},{flag:"--fields",list:true},{flag:"--format"},{flag:"--limit"},{flag:"--after"},{flag:"--status",list:true},{flag:"--type",list:true},{flag:"--tag",aliases:["--tags"],list:true},{flag:"--priority",list:true},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--assignee",list:true},{flag:"--sprint",list:true},{flag:"--release",list:true},{flag:"--parent"},...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"]));const CONTRACTS_FLAG_CONTRACTS=[{flag:"--action"},{flag:"--command"},{flag:"--summary"},{flag:"--schema-only"},{flag:"--flags-only"},{flag:"--availability-only"},{flag:"--runtime-only"},{flag:"--active-only"},{flag:"--full"}];const COMPLETION_FLAG_CONTRACTS=[{flag:"--eager-tags"}];function toUniqueFlagContracts(contracts){const seen=new Set;const unique=[];for(const contract of contracts){const aliasKey=(contract.aliases??[]).join(",");const key=`${contract.flag}|${contract.short??""}|${aliasKey}`;if(seen.has(key)){continue}seen.add(key);unique.push(contract)}return unique}function withSubcommandGlobalFlags(contracts){const byCanonicalFlag=new Map;for(const contract of[...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,...contracts]){const canonicalFlag=normalizeFlagAliasKey(contract.flag);const prior=byCanonicalFlag.get(canonicalFlag);const{aliases:declaredAliases,...contractWithoutAliases}=contract;const aliases=normalizeUniqueStringList([...declaredAliases??[],...contract.flag===canonicalFlag?[]:[contract.flag]]).filter(alias=>alias!==canonicalFlag);const normalizedContract={...contractWithoutAliases,flag:canonicalFlag,...aliases.length>0?{aliases}:{}};const mergedAliases=normalizeUniqueStringList([...prior?.aliases??[],...normalizedContract.aliases??[]]);byCanonicalFlag.set(canonicalFlag,prior===void 0?normalizedContract:{...prior,...normalizedContract,...mergedAliases.length>0?{aliases:mergedAliases}:{}})}return withFlagAliasMetadata([...byCanonicalFlag.values()])}const FIXED_STATUS_LIST_COMMAND_ALIASES=["list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"];const FIXED_STATUS_LIST_FLAG_CONTRACTS=LIST_FILTER_FLAG_CONTRACTS.filter(contract=>contract.flag!=="--status"&&contract.flag!=="--all");function indexCliFlagContracts(contracts){const index=new Map;for(const contract of contracts){for(const spelling of[contract.flag,...contract.aliases??[]]){const matches=index.get(spelling)??[];matches.push(contract);index.set(spelling,matches)}}return index}const PLAN_FLAG_CONTRACT_INDEX=indexCliFlagContracts(PLAN_FLAG_CONTRACTS);const ASSURANCE_FLAG_CONTRACT_INDEX=indexCliFlagContracts(ASSURANCE_FLAG_CONTRACTS);const POSITIONAL_ACTION_FLAG_INDEX_BY_PARENT=new Map([["assurance",ASSURANCE_FLAG_CONTRACT_INDEX],["plan",PLAN_FLAG_CONTRACT_INDEX],["workspace",indexCliFlagContracts(WORKSPACE_POSITION_FLAG_CONTRACTS)],["workspace snapshot",indexCliFlagContracts(WORKSPACE_FLAG_CONTRACTS)]]);function resolvePmPositionalActionFlagContracts(actions=PM_POSITIONAL_ACTION_CONTRACTS){return actions.map(({command,parent,accepted_flags:acceptedFlags})=>{const parentFlagIndex=POSITIONAL_ACTION_FLAG_INDEX_BY_PARENT.get(parent);if(!parentFlagIndex){throw new Error(`Positional action ${command} has no flag-contract index for ${parent}.`)}const selected=acceptedFlags.map(acceptedFlag=>{const matches=parentFlagIndex.get(acceptedFlag)??[];if(matches.length!==1){throw new Error(`Positional action ${command} accepted flag ${acceptedFlag} does not resolve to exactly one ${parent} flag contract.`)}return matches[0]});return[command,selected]})}const PM_POSITIONAL_ACTION_FLAG_CONTRACTS=resolvePmPositionalActionFlagContracts();const SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND=new Map([["list",LIST_FILTER_FLAG_CONTRACTS],["list-all",LIST_FILTER_FLAG_CONTRACTS],...FIXED_STATUS_LIST_COMMAND_ALIASES.map(command=>[command,FIXED_STATUS_LIST_FLAG_CONTRACTS]),["templates",CREATE_FLAG_CONTRACTS],["cal",CALENDAR_FLAG_CONTRACTS],["ctx",CONTEXT_FLAG_CONTRACTS],["test-runs-worker",TEST_RUNS_FLAG_CONTRACTS],["init",INIT_FLAG_CONTRACTS],["config",CONFIG_FLAG_CONTRACTS],["extension",EXTENSION_FLAG_CONTRACTS],["package",PACKAGE_FLAG_CONTRACTS],["packages",PACKAGE_FLAG_CONTRACTS],["install",INSTALL_FLAG_CONTRACTS],["upgrade",UPGRADE_FLAG_CONTRACTS],["create",CREATE_FLAG_CONTRACTS],["item",[]],["item mutate",ITEM_MUTATE_FLAG_CONTRACTS],["item complete",ITEM_COMPLETE_FLAG_CONTRACTS],["item reopen",ITEM_REOPEN_FLAG_CONTRACTS],["copy",COPY_FLAG_CONTRACTS],["focus",FOCUS_FLAG_CONTRACTS],["aggregate",AGGREGATE_FLAG_CONTRACTS],["calendar",CALENDAR_FLAG_CONTRACTS],["context",CONTEXT_FLAG_CONTRACTS],["get",GET_FLAG_CONTRACTS],["guide",GUIDE_FLAG_CONTRACTS],["search",SEARCH_FLAG_CONTRACTS],["next",NEXT_FLAG_CONTRACTS],["eval",EVAL_FLAG_CONTRACTS],["workspace",WORKSPACE_FLAG_CONTRACTS],["workspace position",WORKSPACE_POSITION_FLAG_CONTRACTS],["workspace snapshot",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot create",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot list",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot inspect",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot restore",WORKSPACE_FLAG_CONTRACTS],["workspace snapshot delete",WORKSPACE_FLAG_CONTRACTS],["history",HISTORY_FLAG_CONTRACTS],["history-redact",HISTORY_REDACT_FLAG_CONTRACTS],["history-repair",HISTORY_REPAIR_FLAG_CONTRACTS],["history-author-acknowledge",HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS],["history-compact",HISTORY_COMPACT_FLAG_CONTRACTS],["merge",MERGE_FLAG_CONTRACTS],["schema",SCHEMA_FLAG_CONTRACTS],["profile",PROFILE_FLAG_CONTRACTS],["plan",PLAN_FLAG_CONTRACTS],["activity",ACTIVITY_FLAG_CONTRACTS],["events",EVENTS_FLAG_CONTRACTS],["restore",RESTORE_FLAG_CONTRACTS],["update",UPDATE_FLAG_CONTRACTS],["update-many",UPDATE_MANY_FLAG_CONTRACTS],["close",CLOSE_FLAG_CONTRACTS],["close-many",CLOSE_MANY_FLAG_CONTRACTS],["delete",DELETE_FLAG_CONTRACTS],["append",APPEND_FLAG_CONTRACTS],["comments",COMMENTS_FLAG_CONTRACTS],["notes",NOTES_FLAG_CONTRACTS],["learnings",LEARNINGS_FLAG_CONTRACTS],["files",FILES_FLAG_CONTRACTS],["docs",DOCS_FLAG_CONTRACTS],["deps",DEPS_FLAG_CONTRACTS],["graph",GRAPH_FLAG_CONTRACTS],["test",TEST_FLAG_CONTRACTS],["test-all",TEST_ALL_FLAG_CONTRACTS],["telemetry",TELEMETRY_FLAG_CONTRACTS],["health",HEALTH_FLAG_CONTRACTS],["assurance",ASSURANCE_FLAG_CONTRACTS],...PM_POSITIONAL_ACTION_FLAG_CONTRACTS,["validate",VALIDATE_FLAG_CONTRACTS],["gc",GC_FLAG_CONTRACTS],["stats",STATS_FLAG_CONTRACTS],["duplicates",DUPLICATES_FLAG_CONTRACTS],["contracts",CONTRACTS_FLAG_CONTRACTS],["completion",COMPLETION_FLAG_CONTRACTS],["claim",CLAIM_FLAG_CONTRACTS],["release",RELEASE_FLAG_CONTRACTS],["start-task",START_TASK_FLAG_CONTRACTS],["pause-task",PAUSE_TASK_FLAG_CONTRACTS],["close-task",CLOSE_TASK_FLAG_CONTRACTS],["meet",MEET_FLAG_CONTRACTS],["event",EVENT_FLAG_CONTRACTS],["remind",REMIND_FLAG_CONTRACTS]]);const EXTENSION_LIFECYCLE_FLAG_CONTRACTS_BY_SUBCOMMAND=new Map([["install",EXTENSION_INSTALL_FLAG_CONTRACTS],["uninstall",EXTENSION_UNINSTALL_FLAG_CONTRACTS],["explore",EXTENSION_EXPLORE_FLAG_CONTRACTS],["manage",EXTENSION_MANAGE_FLAG_CONTRACTS],["describe",EXTENSION_DESCRIBE_FLAG_CONTRACTS],["reload",EXTENSION_RELOAD_FLAG_CONTRACTS],["doctor",EXTENSION_DOCTOR_FLAG_CONTRACTS],["catalog",EXTENSION_CATALOG_FLAG_CONTRACTS],["list",EXTENSION_CATALOG_FLAG_CONTRACTS],["adopt",EXTENSION_ADOPT_FLAG_CONTRACTS],["adopt-all",EXTENSION_ADOPT_ALL_FLAG_CONTRACTS],["activate",EXTENSION_ACTIVATE_FLAG_CONTRACTS],["deactivate",EXTENSION_DEACTIVATE_FLAG_CONTRACTS],["migrate",EXTENSION_MIGRATE_FLAG_CONTRACTS]]);function normalizeCommandNameForContracts(commandName){if(typeof commandName!=="string"){return""}return resolvePmHistoryOperation(commandName.trim().toLowerCase())}function hasSubcommandFlagContractsForCommand(commandName){const normalized=normalizeCommandNameForContracts(commandName);if(SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.has(normalized)){return true}const[rootCommand,lifecycleSubcommand,...extraParts]=normalized.split(/\s+/);return(rootCommand==="extension"||rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand!==void 0&&extraParts.length===0&&(lifecycleSubcommand==="init"||lifecycleSubcommand==="scaffold"||EXTENSION_LIFECYCLE_FLAG_CONTRACTS_BY_SUBCOMMAND.has(lifecycleSubcommand))}function resolveExtensionLifecycleFlagContracts(rootCommand,lifecycleSubcommand){if(lifecycleSubcommand==="init"||lifecycleSubcommand==="scaffold"){return rootCommand==="extension"?EXTENSION_INIT_FLAG_CONTRACTS:PACKAGE_INIT_FLAG_CONTRACTS}return EXTENSION_LIFECYCLE_FLAG_CONTRACTS_BY_SUBCOMMAND.get(lifecycleSubcommand)??[]}function resolveSubcommandFlagContractsForCommand(commandName){const normalized=normalizeCommandNameForContracts(commandName);if(normalized.length===0){return withSubcommandGlobalFlags([])}const[rootCommand,lifecycleSubcommand,...extraParts]=normalized.split(/\s+/);if((rootCommand==="extension"||rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand!==void 0&&extraParts.length===0){if((rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand==="upgrade"){return withSubcommandGlobalFlags(UPGRADE_FLAG_CONTRACTS)}return withSubcommandGlobalFlags(resolveExtensionLifecycleFlagContracts(rootCommand,lifecycleSubcommand))}const contracts=SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.get(normalized)??[];return withSubcommandGlobalFlags(contracts)}function toCompletionFlagString(flagContracts,includeGlobal=true){const aliasAwareContracts=withFlagAliasMetadata(flagContracts);const scoped=aliasAwareContracts.flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>Boolean(value));const all=includeGlobal?[...scoped,...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS.flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>Boolean(value))]:scoped;return normalizeUniqueStringList(all).join(" ")}export{ACTIVITY_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CALENDAR_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,CONTEXT_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,CREATE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,NEXT_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,PLAN_FLAG_CONTRACTS,PM_POSITIONAL_ACTION_FLAG_CONTRACTS,PROFILE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,SEARCH_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,WORKSPACE_POSITION_FLAG_CONTRACTS,compactFlagAliasContracts,hasSubcommandFlagContractsForCommand,resolvePmPositionalActionFlagContracts,resolveSubcommandFlagContractsForCommand,toCompletionFlagString,toUniqueFlagContracts,withFlagAliasMetadata};
2
2
  //# sourceMappingURL=flag-contracts.js.map