@unbrained/pm-cli 2026.11.6 → 2026.11.8

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 (474) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +82 -48
  3. package/dist/cli/expected-revisions.js +1 -1
  4. package/dist/cli/extension-command-help.js +4 -3
  5. package/dist/cli/help-json-payload.js +1 -1
  6. package/dist/cli/main.js +1 -1
  7. package/dist/cli/register-annotations.js +1 -1
  8. package/dist/cli/register-list-query.js +5 -5
  9. package/dist/cli/runtime/annotation-option-retry.js +2 -0
  10. package/dist/cli/runtime/close-fields-retry.js +2 -0
  11. package/dist/cli/runtime/invocation-options.js +1 -1
  12. package/dist/cli-bundle/bundle-manifest.json +1 -1
  13. package/dist/cli-bundle/chunks/chunk-3A5DJZCC.js +116 -0
  14. package/dist/cli-bundle/chunks/chunk-4BMPGUTG.js +9 -0
  15. package/dist/cli-bundle/chunks/{chunk-D7KYPRK4.js → chunk-7GC6WIDR.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-DAX3AOFI.js → chunk-7V6I6X4G.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-OH6WQ7VT.js → chunk-AFZS6WFV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-PE3ASURT.js → chunk-C4MQFWCM.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-CP43BHX3.js +31 -0
  20. package/dist/cli-bundle/chunks/{chunk-S4LPZ4TN.js → chunk-DOHZKPPC.js} +7 -7
  21. package/dist/cli-bundle/chunks/{chunk-LS3GI3H4.js → chunk-HESIRIVX.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-JAE5MWLX.js +2 -0
  23. package/dist/cli-bundle/chunks/{chunk-335BZ75D.js → chunk-L5BU5FYN.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-LI2HP5OX.js +3 -0
  25. package/dist/cli-bundle/chunks/chunk-LLTRUVKK.js +6 -0
  26. package/dist/cli-bundle/chunks/{chunk-X3URBPMV.js → chunk-MKW5LGVQ.js} +66 -62
  27. package/dist/cli-bundle/chunks/chunk-NH7QX2M2.js +8 -0
  28. package/dist/cli-bundle/chunks/{chunk-HRFGFIYU.js → chunk-NKO42JMT.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-7DEKAXVA.js → chunk-PE6CZ3PE.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-RC6SSFOF.js +2 -0
  31. package/dist/cli-bundle/chunks/{chunk-TSQCUBUX.js → chunk-S4IZIMAO.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-UEGXWXUZ.js → chunk-XBUZENP4.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-YGUUJHSR.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-YUTFMHSG.js +122 -0
  35. package/dist/cli-bundle/chunks/{chunk-SLC5UWCM.js → chunk-Z3LWNF7C.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-revision-TUGZYYXX.js +2 -0
  37. package/dist/cli-bundle/chunks/item-transaction-2RRBAQN3.js +2 -0
  38. package/dist/cli-bundle/chunks/{mutation-admission-INMM3HHG.js → mutation-admission-FJ3D66PV.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-list-query-5Y5JKWU5.js → register-list-query-GXP77CX7.js} +11 -11
  40. package/dist/cli-bundle/chunks/register-mutation-XJ2DROUM.js +20 -0
  41. package/dist/cli-bundle/chunks/{register-operations-WJHZJFK2.js → register-operations-O5LERXM7.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-setup-RRFOS7IT.js → register-setup-4VOTYLL2.js} +2 -2
  43. package/dist/cli-bundle/chunks/{stage-E3MMV4TV.js → stage-ZDJL3FGL.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-2A3QZELL.js +26 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-MC7IE7D7.js → chunk-3HFENALW.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-4UOXVFJZ.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-7KK66ISG.js → chunk-5YPX3QKU.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-CPMSL4HS.js → chunk-6U5HP6L3.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-DIEBSC76.js +3 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-WSOAASCY.js → chunk-I4YUZW3J.js} +8 -8
  51. package/dist/cli-bundle/focused-chunks/chunk-KBRSA4OK.js +44 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-AHWJPZSJ.js → chunk-KNF2QTEZ.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-LTPT5TE7.js +24 -0
  54. package/dist/cli-bundle/focused-chunks/chunk-O7K3X4LH.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-P4EHEH4C.js +2 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-P6TG33FV.js +82 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-PL6EO4GJ.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-PSLDGAEY.js +12 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-SZ2BKK3M.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-TSHRBPTI.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-ULTSMJYF.js +91 -0
  62. package/dist/cli-bundle/focused-chunks/chunk-UNNLBJRI.js +2 -0
  63. package/dist/cli-bundle/focused-chunks/chunk-UUVRYIKA.js +2 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-F62XGAAY.js → chunk-WPXMPGTY.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-Z2QWZRSL.js +26 -0
  66. package/dist/cli-bundle/focused-chunks/item-revision-XNSRDTFB.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/item-transaction-Q2Z7DDCR.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/mutation-admission-QWC6MLTZ.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/stage-NKH5SKSZ.js +2 -0
  70. package/dist/cli-bundle/main.js +27 -26
  71. package/dist/cli-bundle/sdk-authoring.js +1 -1
  72. package/dist/cli-bundle/sdk-contracts.js +4 -4
  73. package/dist/cli-bundle/sdk-core.js +1 -1
  74. package/dist/cli-bundle/sdk-governance.js +1 -1
  75. package/dist/cli-bundle/sdk-graph.js +1 -1
  76. package/dist/cli-bundle/sdk-merge.js +57 -57
  77. package/dist/cli-bundle/sdk-query.js +1 -1
  78. package/dist/cli-bundle/sdk-runtime.js +1 -1
  79. package/dist/cli-bundle/sdk-testing.js +1 -1
  80. package/dist/cli-bundle/sdk.js +12 -12
  81. package/dist/core/extensions/flag-definition-validation.js +1 -1
  82. package/dist/core/extensions/reserved-host-flags.js +1 -1
  83. package/dist/core/history/history-stream-policy.d.ts +12 -3
  84. package/dist/core/history/history-stream-policy.js +1 -1
  85. package/dist/core/history/projection.d.ts +7 -2
  86. package/dist/core/history/projection.js +1 -1
  87. package/dist/core/item/item-format.d.ts +5 -1
  88. package/dist/core/item/item-format.js +2 -2
  89. package/dist/core/lock/lock.d.ts +1 -1
  90. package/dist/core/lock/lock.js +1 -1
  91. package/dist/core/output/output.d.ts +10 -1
  92. package/dist/core/output/output.js +7 -7
  93. package/dist/core/search/providers.d.ts +3 -2
  94. package/dist/core/search/providers.js +1 -1
  95. package/dist/core/search/vector-stores.d.ts +3 -2
  96. package/dist/core/search/vector-stores.js +1 -1
  97. package/dist/core/sentry/instrument.d.ts +2 -1
  98. package/dist/core/sentry/instrument.js +1 -1
  99. package/dist/core/store/item-mutation-precondition.d.ts +58 -0
  100. package/dist/core/store/item-mutation-precondition.js +1 -1
  101. package/dist/mcp/tool-definitions.js +1 -1
  102. package/dist/sdk/annotations.d.ts +44 -1
  103. package/dist/sdk/annotations.js +1 -1
  104. package/dist/sdk/authoring.d.ts +6 -0
  105. package/dist/sdk/authoring.js +1 -1
  106. package/dist/sdk/cli-contracts/flag-contracts.d.ts +15 -0
  107. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  108. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  109. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -0
  110. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  111. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  112. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  113. package/dist/sdk/command-line.d.ts +7 -2
  114. package/dist/sdk/command-line.js +1 -1
  115. package/dist/sdk/comments.d.ts +4 -2
  116. package/dist/sdk/comments.js +1 -1
  117. package/dist/sdk/completion/bash.js +1 -1
  118. package/dist/sdk/completion/fish.js +2 -1
  119. package/dist/sdk/completion/zsh.js +4 -1
  120. package/dist/sdk/context-intent-contracts.d.ts +5 -1
  121. package/dist/sdk/context-intent-contracts.js +1 -1
  122. package/dist/sdk/contracts.d.ts +3 -0
  123. package/dist/sdk/contracts.js +1 -1
  124. package/dist/sdk/core.d.ts +14 -0
  125. package/dist/sdk/core.js +1 -1
  126. package/dist/sdk/corpus-shape.d.ts +2 -2
  127. package/dist/sdk/corpus-shape.js +1 -1
  128. package/dist/sdk/define.d.ts +14 -8
  129. package/dist/sdk/define.js +1 -1
  130. package/dist/sdk/extension/command-options.d.ts +123 -0
  131. package/dist/sdk/extension/command-options.js +2 -0
  132. package/dist/sdk/extension-contracts.d.ts +1 -2
  133. package/dist/sdk/extension-contracts.js +1 -1
  134. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  135. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  136. package/dist/sdk/governance.d.ts +8 -0
  137. package/dist/sdk/governance.js +1 -1
  138. package/dist/sdk/graph.d.ts +5 -0
  139. package/dist/sdk/graph.js +1 -1
  140. package/dist/sdk/index.d.ts +61 -1
  141. package/dist/sdk/index.js +1 -1
  142. package/dist/sdk/learnings.d.ts +4 -2
  143. package/dist/sdk/learnings.js +1 -1
  144. package/dist/sdk/lifecycle/close.js +1 -1
  145. package/dist/sdk/lifecycle/item-revision.d.ts +15 -4
  146. package/dist/sdk/lifecycle/item-revision.js +1 -1
  147. package/dist/sdk/lifecycle/restore.d.ts +1 -1
  148. package/dist/sdk/merge.d.ts +3 -0
  149. package/dist/sdk/merge.js +1 -1
  150. package/dist/sdk/notes.d.ts +4 -2
  151. package/dist/sdk/notes.js +1 -1
  152. package/dist/sdk/output/list-envelope.d.ts +18 -7
  153. package/dist/sdk/output/list-envelope.js +1 -1
  154. package/dist/sdk/output-projection.js +1 -1
  155. package/dist/sdk/public-surface.json +1 -1
  156. package/dist/sdk/query/get.d.ts +16 -6
  157. package/dist/sdk/query/get.js +1 -1
  158. package/dist/sdk/query/list.d.ts +5 -1
  159. package/dist/sdk/query/list.js +1 -1
  160. package/dist/sdk/query/search/response.js +1 -1
  161. package/dist/sdk/query/search/semantic.d.ts +11 -3
  162. package/dist/sdk/query/search/semantic.js +1 -1
  163. package/dist/sdk/query/search-rendering.d.ts +9 -3
  164. package/dist/sdk/query/search-rendering.js +1 -1
  165. package/dist/sdk/query.d.ts +11 -0
  166. package/dist/sdk/query.js +1 -1
  167. package/dist/sdk/read-output/continuation.d.ts +8 -0
  168. package/dist/sdk/read-output/continuation.js +1 -1
  169. package/dist/sdk/read-output/options.d.ts +1 -1
  170. package/dist/sdk/read-output/options.js +1 -1
  171. package/dist/sdk/read-output/surfaces.js +1 -1
  172. package/dist/sdk/read-output/tail-retention.d.ts +34 -0
  173. package/dist/sdk/read-output/tail-retention.js +2 -0
  174. package/dist/sdk/read-output-budget.d.ts +14 -2
  175. package/dist/sdk/read-output-budget.js +1 -1
  176. package/dist/sdk/read-output-contracts.d.ts +20 -4
  177. package/dist/sdk/read-output-contracts.js +1 -1
  178. package/dist/sdk/read-output-rows.d.ts +7 -3
  179. package/dist/sdk/read-output-rows.js +1 -1
  180. package/dist/sdk/runtime-input.js +1 -1
  181. package/dist/sdk/runtime.d.ts +26 -3
  182. package/dist/sdk/runtime.js +1 -1
  183. package/dist/sdk/test/execution.d.ts +29 -2
  184. package/dist/sdk/test/execution.js +1 -1
  185. package/dist/sdk/testing.d.ts +14 -1
  186. package/dist/sdk/testing.js +1 -1
  187. package/dist/sdk/traceability/source-traceability.d.ts +4 -1
  188. package/dist/sdk/traceability/source-traceability.js +1 -1
  189. package/dist/sdk/workspace-recipe.d.ts +2 -2
  190. package/dist/sdk/workspace-recipe.js +1 -1
  191. package/docs/ARCHITECTURE.md +2 -1
  192. package/docs/CLOSE_EVIDENCE_RECOVERY.md +36 -2
  193. package/docs/COMMANDS.md +14 -2
  194. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +1 -1
  195. package/docs/EXTENSIONS.md +1 -1
  196. package/docs/GET_READ_EVIDENCE.md +24 -3
  197. package/docs/MCP_OPTION_CONFORMANCE.md +13 -0
  198. package/docs/README.md +1 -1
  199. package/docs/READ_OUTPUT_CONTRACTS.md +78 -0
  200. package/docs/RELEASING.md +17 -0
  201. package/docs/SDK.md +124 -9
  202. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  203. package/docs/agent-task-token-baseline.json +1 -1
  204. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  205. package/marketplace.json +1 -1
  206. package/package.json +2 -1
  207. package/packages/pm-beads/package.json +1 -1
  208. package/packages/pm-calendar/package.json +1 -1
  209. package/packages/pm-command-kit/package.json +1 -1
  210. package/packages/pm-digital-twin/package.json +1 -1
  211. package/packages/pm-governance-audit/package.json +1 -1
  212. package/packages/pm-guide-shell/package.json +1 -1
  213. package/packages/pm-kanban/package.json +1 -1
  214. package/packages/pm-lifecycle-hooks/package.json +1 -1
  215. package/packages/pm-linked-test-adapters/package.json +1 -1
  216. package/packages/pm-search-advanced/package.json +1 -1
  217. package/packages/pm-templates/package.json +1 -1
  218. package/packages/pm-todos/package.json +1 -1
  219. package/packages/pm-vcs/package.json +1 -1
  220. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  221. package/plugins/pm-claude/package.json +1 -1
  222. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  223. package/plugins/pm-codex/package.json +1 -1
  224. package/plugins/pm-codex/plugin.json +1 -1
  225. package/runtime-dependencies.json +1 -1
  226. package/dist/cli/after-command-context-usage.d.ts +0 -21
  227. package/dist/cli/argv-utils.d.ts +0 -12
  228. package/dist/cli/bootstrap-args.d.ts +0 -6
  229. package/dist/cli/bundle-integrity.d.ts +0 -49
  230. package/dist/cli/command-namespaces.d.ts +0 -9
  231. package/dist/cli/commander-usage.d.ts +0 -73
  232. package/dist/cli/commands/annotations/comments.d.ts +0 -2
  233. package/dist/cli/commands/annotations/docs.d.ts +0 -6
  234. package/dist/cli/commands/annotations/files.d.ts +0 -6
  235. package/dist/cli/commands/annotations/learnings.d.ts +0 -2
  236. package/dist/cli/commands/annotations/notes.d.ts +0 -2
  237. package/dist/cli/commands/extension/describe.d.ts +0 -2
  238. package/dist/cli/commands/extension/extension.d.ts +0 -6
  239. package/dist/cli/commands/extension/scaffold.d.ts +0 -2
  240. package/dist/cli/commands/extension/shared.d.ts +0 -2
  241. package/dist/cli/commands/governance/gc.d.ts +0 -6
  242. package/dist/cli/commands/governance/health.d.ts +0 -6
  243. package/dist/cli/commands/governance/telemetry.d.ts +0 -6
  244. package/dist/cli/commands/governance/validate.d.ts +0 -9
  245. package/dist/cli/commands/history/activity.d.ts +0 -6
  246. package/dist/cli/commands/history/history-compact.d.ts +0 -7
  247. package/dist/cli/commands/history/history-redact.d.ts +0 -8
  248. package/dist/cli/commands/history/history-repair.d.ts +0 -7
  249. package/dist/cli/commands/history/history.d.ts +0 -2
  250. package/dist/cli/commands/history/restore.d.ts +0 -6
  251. package/dist/cli/commands/lifecycle/append.d.ts +0 -6
  252. package/dist/cli/commands/lifecycle/claim.d.ts +0 -2
  253. package/dist/cli/commands/lifecycle/close-many.d.ts +0 -2
  254. package/dist/cli/commands/lifecycle/close.d.ts +0 -6
  255. package/dist/cli/commands/lifecycle/copy.d.ts +0 -6
  256. package/dist/cli/commands/lifecycle/create.d.ts +0 -10
  257. package/dist/cli/commands/lifecycle/delete.d.ts +0 -6
  258. package/dist/cli/commands/lifecycle/focus.d.ts +0 -6
  259. package/dist/cli/commands/lifecycle/plan.d.ts +0 -9
  260. package/dist/cli/commands/lifecycle/update-many.d.ts +0 -6
  261. package/dist/cli/commands/lifecycle/update.d.ts +0 -10
  262. package/dist/cli/commands/query/aggregate.d.ts +0 -2
  263. package/dist/cli/commands/query/context.d.ts +0 -6
  264. package/dist/cli/commands/query/deps.d.ts +0 -6
  265. package/dist/cli/commands/query/duplicates.d.ts +0 -6
  266. package/dist/cli/commands/query/eval.d.ts +0 -6
  267. package/dist/cli/commands/query/get.d.ts +0 -6
  268. package/dist/cli/commands/query/graph.d.ts +0 -7
  269. package/dist/cli/commands/query/list.d.ts +0 -6
  270. package/dist/cli/commands/query/next.d.ts +0 -6
  271. package/dist/cli/commands/query/search.d.ts +0 -6
  272. package/dist/cli/commands/query/stats.d.ts +0 -6
  273. package/dist/cli/commands/test/test-all.d.ts +0 -6
  274. package/dist/cli/commands/test/test-runs.d.ts +0 -6
  275. package/dist/cli/commands/test/test.d.ts +0 -6
  276. package/dist/cli/commands/workspace/config.d.ts +0 -6
  277. package/dist/cli/commands/workspace/contracts.d.ts +0 -2
  278. package/dist/cli/commands/workspace/init.d.ts +0 -6
  279. package/dist/cli/commands/workspace/merge.d.ts +0 -8
  280. package/dist/cli/commands/workspace/profile.d.ts +0 -6
  281. package/dist/cli/commands/workspace/schema.d.ts +0 -7
  282. package/dist/cli/commands/workspace/upgrade.d.ts +0 -2
  283. package/dist/cli/context-intent-invocation.d.ts +0 -2
  284. package/dist/cli/description-stdin.d.ts +0 -2
  285. package/dist/cli/error-guidance.d.ts +0 -276
  286. package/dist/cli/expected-revisions.d.ts +0 -55
  287. package/dist/cli/extension-command-help.d.ts +0 -137
  288. package/dist/cli/extension-command-options.d.ts +0 -37
  289. package/dist/cli/extension-command-options.js +0 -2
  290. package/dist/cli/extension-recovery.d.ts +0 -31
  291. package/dist/cli/help-content.d.ts +0 -57
  292. package/dist/cli/help-json-payload.d.ts +0 -83
  293. package/dist/cli/invocation-profile.d.ts +0 -26
  294. package/dist/cli/main.d.ts +0 -263
  295. package/dist/cli/migration-gates.d.ts +0 -55
  296. package/dist/cli/option-values.d.ts +0 -3
  297. package/dist/cli/preflight-warnings.d.ts +0 -11
  298. package/dist/cli/register-annotations.d.ts +0 -11
  299. package/dist/cli/register-assurance.d.ts +0 -8
  300. package/dist/cli/register-files-lookup.d.ts +0 -9
  301. package/dist/cli/register-history-activity.d.ts +0 -8
  302. package/dist/cli/register-history-author.d.ts +0 -8
  303. package/dist/cli/register-history-maintenance.d.ts +0 -9
  304. package/dist/cli/register-list-query.d.ts +0 -27
  305. package/dist/cli/register-mutation-options.d.ts +0 -10
  306. package/dist/cli/register-mutation.d.ts +0 -16
  307. package/dist/cli/register-operations.d.ts +0 -85
  308. package/dist/cli/register-setup.d.ts +0 -16
  309. package/dist/cli/register-structured-mutation.d.ts +0 -15
  310. package/dist/cli/registration-helpers.d.ts +0 -2
  311. package/dist/cli/runtime/activation.d.ts +0 -51
  312. package/dist/cli/runtime/field-route-retry.d.ts +0 -15
  313. package/dist/cli/runtime/invocation-options.d.ts +0 -43
  314. package/dist/cli/runtime/projection-retry.d.ts +0 -9
  315. package/dist/cli/runtime/selection.d.ts +0 -35
  316. package/dist/cli/runtime/telemetry-outcome.d.ts +0 -20
  317. package/dist/cli/runtime-compatibility-boundary.d.ts +0 -17
  318. package/dist/cli/schema/registration.d.ts +0 -4
  319. package/dist/cli/schema-registration-helpers.d.ts +0 -24
  320. package/dist/cli/search-refresh.d.ts +0 -2
  321. package/dist/cli/stats-analytics-json.d.ts +0 -9
  322. package/dist/cli/telemetry-flush.d.ts +0 -2
  323. package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +0 -122
  324. package/dist/cli-bundle/chunks/chunk-6VRX2CM7.js +0 -2
  325. package/dist/cli-bundle/chunks/chunk-7ZRCYESH.js +0 -116
  326. package/dist/cli-bundle/chunks/chunk-AUEKTX7V.js +0 -6
  327. package/dist/cli-bundle/chunks/chunk-FRNMQM45.js +0 -2
  328. package/dist/cli-bundle/chunks/chunk-HNGLDMSZ.js +0 -9
  329. package/dist/cli-bundle/chunks/chunk-QNWUIPBO.js +0 -31
  330. package/dist/cli-bundle/chunks/chunk-WC4M2H6R.js +0 -8
  331. package/dist/cli-bundle/chunks/chunk-YKXATU2G.js +0 -3
  332. package/dist/cli-bundle/chunks/item-revision-OJJVPQY7.js +0 -2
  333. package/dist/cli-bundle/chunks/item-transaction-TBKEATN6.js +0 -2
  334. package/dist/cli-bundle/chunks/register-mutation-MDSUU3G7.js +0 -20
  335. package/dist/cli-bundle/focused-chunks/chunk-2KTJY7BV.js +0 -44
  336. package/dist/cli-bundle/focused-chunks/chunk-4PW5XWVI.js +0 -2
  337. package/dist/cli-bundle/focused-chunks/chunk-C6P6HPCX.js +0 -2
  338. package/dist/cli-bundle/focused-chunks/chunk-CZM75DE3.js +0 -2
  339. package/dist/cli-bundle/focused-chunks/chunk-D2TBEBNW.js +0 -3
  340. package/dist/cli-bundle/focused-chunks/chunk-E56OXRYH.js +0 -2
  341. package/dist/cli-bundle/focused-chunks/chunk-G4QP365K.js +0 -2
  342. package/dist/cli-bundle/focused-chunks/chunk-G5PJCR7R.js +0 -2
  343. package/dist/cli-bundle/focused-chunks/chunk-GS3JC5UU.js +0 -23
  344. package/dist/cli-bundle/focused-chunks/chunk-LW64TINU.js +0 -3
  345. package/dist/cli-bundle/focused-chunks/chunk-M6V7UMWL.js +0 -26
  346. package/dist/cli-bundle/focused-chunks/chunk-MG7C3JUY.js +0 -2
  347. package/dist/cli-bundle/focused-chunks/chunk-MK4HV4JO.js +0 -2
  348. package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +0 -91
  349. package/dist/cli-bundle/focused-chunks/chunk-RFTJZ5VB.js +0 -2
  350. package/dist/cli-bundle/focused-chunks/chunk-SNOXXRSJ.js +0 -2
  351. package/dist/cli-bundle/focused-chunks/chunk-UPJUTP2V.js +0 -12
  352. package/dist/cli-bundle/focused-chunks/chunk-VWWTIX5L.js +0 -3
  353. package/dist/cli-bundle/focused-chunks/chunk-XHOBYCVE.js +0 -26
  354. package/dist/cli-bundle/focused-chunks/chunk-YMGB2O4E.js +0 -81
  355. package/dist/cli-bundle/focused-chunks/item-revision-CTDO4H3I.js +0 -2
  356. package/dist/cli-bundle/focused-chunks/item-transaction-H2XACBOP.js +0 -2
  357. package/dist/cli-bundle/focused-chunks/mutation-admission-4WM7TNHZ.js +0 -2
  358. package/dist/cli-bundle/focused-chunks/stage-WV7QXR4C.js +0 -2
  359. package/dist/cli.d.ts +0 -13
  360. package/dist/core/checkpoint/checkpoint-gc.d.ts +0 -61
  361. package/dist/core/checkpoint/mutation-context.d.ts +0 -10
  362. package/dist/core/diagnostics/remediation.d.ts +0 -52
  363. package/dist/core/extensions/activation-transaction.d.ts +0 -22
  364. package/dist/core/extensions/command-visibility-tier.d.ts +0 -8
  365. package/dist/core/extensions/exporter-output-contract.d.ts +0 -12
  366. package/dist/core/extensions/extension-candidate.d.ts +0 -26
  367. package/dist/core/extensions/extension-runtime-helpers.d.ts +0 -16
  368. package/dist/core/extensions/module-graph-snapshot.d.ts +0 -19
  369. package/dist/core/extensions/preflight-ownership.d.ts +0 -5
  370. package/dist/core/extensions/read-output-contract.d.ts +0 -5
  371. package/dist/core/extensions/reserved-host-flags.d.ts +0 -18
  372. package/dist/core/extensions/service-ownership.d.ts +0 -8
  373. package/dist/core/extensions/version-diagnostics.d.ts +0 -2
  374. package/dist/core/fs/atomic-create.d.ts +0 -7
  375. package/dist/core/fs/index.d.ts +0 -6
  376. package/dist/core/fs/path-utils.d.ts +0 -2
  377. package/dist/core/history/drift-cache.d.ts +0 -4
  378. package/dist/core/history/drift-scan.d.ts +0 -51
  379. package/dist/core/history/index.d.ts +0 -6
  380. package/dist/core/history/tombstone.d.ts +0 -3
  381. package/dist/core/history/version-address.d.ts +0 -13
  382. package/dist/core/item/index.d.ts +0 -9
  383. package/dist/core/item/item-type-definition.d.ts +0 -51
  384. package/dist/core/item/toon-decode.d.ts +0 -25
  385. package/dist/core/lock/index.d.ts +0 -6
  386. package/dist/core/lock/lock-confinement.d.ts +0 -55
  387. package/dist/core/lock/lock-gc.d.ts +0 -93
  388. package/dist/core/output/mutation-projection.d.ts +0 -13
  389. package/dist/core/output/query-summary.d.ts +0 -30
  390. package/dist/core/search/staleness.d.ts +0 -23
  391. package/dist/core/sentry/sensitive-assignments.d.ts +0 -9
  392. package/dist/core/shared/conflict-markers.d.ts +0 -18
  393. package/dist/core/shared/index.d.ts +0 -9
  394. package/dist/core/shared/memo.d.ts +0 -7
  395. package/dist/core/store/index.d.ts +0 -9
  396. package/dist/core/store/settings-concurrency.d.ts +0 -7
  397. package/dist/core/telemetry/read-sampling.d.ts +0 -8
  398. package/dist/core/test/item-test-run-tracking.d.ts +0 -12
  399. package/dist/core/validate/estimate-defaults.d.ts +0 -21
  400. package/dist/core/validate/linked-artifact-reference.d.ts +0 -20
  401. package/dist/mcp/http-server.d.ts +0 -60
  402. package/dist/mcp/legacy-adapter.d.ts +0 -59
  403. package/dist/mcp/runtime-capabilities.d.ts +0 -57
  404. package/dist/mcp/server.d.ts +0 -101
  405. package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +0 -23
  406. package/dist/sdk/cli-contracts/registration-helpers.d.ts +0 -123
  407. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +0 -796
  408. package/dist/sdk/cli-contracts/string-lists.d.ts +0 -9
  409. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +0 -35
  410. package/dist/sdk/context/usage-egress.d.ts +0 -9
  411. package/dist/sdk/dependencies/context-budget-recovery.d.ts +0 -21
  412. package/dist/sdk/dependency-flag-validation.d.ts +0 -32
  413. package/dist/sdk/extension/author-manifest.d.ts +0 -22
  414. package/dist/sdk/extension/bundled-catalog.d.ts +0 -35
  415. package/dist/sdk/extension/concurrency.d.ts +0 -7
  416. package/dist/sdk/extension/copy-scope.d.ts +0 -2
  417. package/dist/sdk/extension/custom-field-collisions.d.ts +0 -6
  418. package/dist/sdk/extension/install-receipts.d.ts +0 -7
  419. package/dist/sdk/extension/install-snapshot.d.ts +0 -34
  420. package/dist/sdk/extension/managed-update-status.d.ts +0 -3
  421. package/dist/sdk/extension/runtime-summary.d.ts +0 -9
  422. package/dist/sdk/extension/scaffold.d.ts +0 -38
  423. package/dist/sdk/generated/error-code-catalog-rows.d.ts +0 -39
  424. package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +0 -8
  425. package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +0 -8
  426. package/dist/sdk/governance/assurance-limits.d.ts +0 -7
  427. package/dist/sdk/governance/defect-recurrence-signals.d.ts +0 -10
  428. package/dist/sdk/governance/health-merge-evidence.d.ts +0 -23
  429. package/dist/sdk/governance/tracked-runtime-cache.d.ts +0 -24
  430. package/dist/sdk/governance/validate-history-drift.d.ts +0 -7
  431. package/dist/sdk/history/attestation-scan.d.ts +0 -16
  432. package/dist/sdk/history-mcp.d.ts +0 -17
  433. package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +0 -15
  434. package/dist/sdk/lifecycle/core-field-recovery.d.ts +0 -33
  435. package/dist/sdk/lifecycle/core-item-fields.d.ts +0 -6
  436. package/dist/sdk/lifecycle/event-validation-messages.d.ts +0 -6
  437. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +0 -15
  438. package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +0 -71
  439. package/dist/sdk/lifecycle/mcp-actions.d.ts +0 -24
  440. package/dist/sdk/lifecycle/metadata-normalizers.d.ts +0 -8
  441. package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +0 -6
  442. package/dist/sdk/lifecycle/mutation-option-validation.d.ts +0 -2
  443. package/dist/sdk/lifecycle/recurrence-parsers.d.ts +0 -34
  444. package/dist/sdk/lifecycle/release-handoff.d.ts +0 -12
  445. package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +0 -18
  446. package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +0 -45
  447. package/dist/sdk/merge/abandoned-receipts.d.ts +0 -15
  448. package/dist/sdk/merge/history-scalar-rebase.d.ts +0 -9
  449. package/dist/sdk/merge/ignored-artifacts.d.ts +0 -13
  450. package/dist/sdk/merge/indexed-receipt-blobs.d.ts +0 -4
  451. package/dist/sdk/merge/receipt-file-boundary.d.ts +0 -23
  452. package/dist/sdk/merge/settlement-hook.d.ts +0 -12
  453. package/dist/sdk/merge/stage.d.ts +0 -13
  454. package/dist/sdk/merge/worktree-config.d.ts +0 -11
  455. package/dist/sdk/query/light-metadata.d.ts +0 -3
  456. package/dist/sdk/query/window-pagination.d.ts +0 -20
  457. package/dist/sdk/read-output/extension.d.ts +0 -7
  458. package/dist/sdk/read-output/provenance.d.ts +0 -20
  459. package/dist/sdk/read-output/surfaces.d.ts +0 -27
  460. package/dist/sdk/runtime/actions.d.ts +0 -4
  461. package/dist/sdk/runtime/mutation-admission.d.ts +0 -2
  462. package/dist/sdk/runtime/mutation-value-validation.d.ts +0 -16
  463. package/dist/sdk/runtime/schema.d.ts +0 -4
  464. package/dist/sdk/runtime-action-aliases.d.ts +0 -7
  465. package/dist/sdk/runtime-extended-actions.d.ts +0 -27
  466. package/dist/sdk/runtime-stats-options.d.ts +0 -9
  467. package/dist/sdk/test/command-args.d.ts +0 -4
  468. package/dist/sdk/test/command-resolution.d.ts +0 -5
  469. package/dist/sdk/test/entry.d.ts +0 -18
  470. package/dist/sdk/test/execution-receipts.d.ts +0 -34
  471. package/dist/sdk/test/receipt-index-snapshot.d.ts +0 -2
  472. package/dist/sdk/test/workspace-snapshot.d.ts +0 -11
  473. package/dist/sdk/traceability/runtime-files-lookup.d.ts +0 -8
  474. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +0 -472
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="35773218-9c35-51d9-a19b-e9094bd23b66")}catch{}})();import{assertInitializedTracker}from"./environment/tracker-preflight.js";import{readFile}from"node:fs/promises";import{isFileAbsentError}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations}from"../core/extensions/index.js";import{resolveItemTypeRegistry}from"../core/item/type-registry.js";import{createStdinTokenResolver,parseCsvKv,shouldResolveMutationStdinTokens,transferMutationStdinTokenPolicy}from"../core/item/parse.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{parseLimit}from"../core/shared/numeric-parsers.js";import{nowIso}from"../core/shared/time.js";import{resolveAuthor}from"../core/shared/author.js";import{locateItem,mutateItem,readLocatedItem}from"../core/store/item-store.js";import{resolvePmRoot}from"../core/store/paths.js";import{readSettings}from"../core/store/settings.js";function normalizeAnnotationTransportOptions(options){const normalized={...options,...options.full===!0?{fullHistory:!0}:{}};return delete normalized.full,transferMutationStdinTokenPolicy(options,normalized)}function assertAnnotationEntryMutable(entry,operation){if(typeof entry=="object"&&entry!==null&&"format"in entry&&entry.format==="json")throw new PmCliError(`Structured context events are append-only and cannot be ${operation}.`,EXIT_CODE.USAGE,{code:"structured_event_immutable"})}function limitAnnotationEntries(values,limit){return limit===void 0?values:limit===0?[]:values.slice(Math.max(0,values.length-limit))}function readAnnotationEntries(source,collectionKey){const value=source[collectionKey];return Array.isArray(value)?value:[]}function parseAnnotationTextInput(raw,options={}){const trimmed=raw.trim();if(!trimmed)return"";const textPrefixMatch=/^(?:[-*+]\s*)?text\s*[:=]/i.exec(trimmed);if(options.stripPlainTextPrefix===!0&&textPrefixMatch&&!trimmed.startsWith("```"))return trimmed.slice(textPrefixMatch[0].length).trim()||trimmed;if(!(/^(?:[-*+]\s*)?text\s*[:=]/im.test(trimmed)||trimmed.startsWith("```")))return trimmed;try{const kv=parseCsvKv(trimmed,"--add");return Object.keys(kv).map(key=>key.trim().toLowerCase()).some(key=>key!=="text")?trimmed:kv.text?.trim()||trimmed}catch{return trimmed}}function isErrnoError(error){return typeof error=="object"&&error!==null&&"code"in error}function assertAnnotationStdinTransportAvailable(options,optionName){if(!shouldResolveMutationStdinTokens(options))throw new PmCliError(`${optionName} cannot read process stdin through the MCP JSON-RPC transport. Pass annotation text in options.add instead.`,EXIT_CODE.USAGE,{code:"mcp_stdin_unavailable",required:"Pass annotation text as JSON data; the MCP protocol already owns process stdin."})}async function resolveAnnotationTextSource(options,noun){if(+(options.add!==void 0)+ +(options.stdin===!0)+ +(typeof options.file=="string")>1)throw new PmCliError(`Specify ${noun} text using only one input source: --add, --stdin, or --file`,EXIT_CODE.USAGE);const stdinResolver=createStdinTokenResolver(),resolveStdinTokens=shouldResolveMutationStdinTokens(options);if(options.add!==void 0)return{value:await stdinResolver.resolveValue(options.add,"--add",resolveStdinTokens)??"",rawValue:options.add,emptyFlag:"--add"};if(options.stdin===!0)return assertAnnotationStdinTransportAvailable(options,"--stdin"),{value:await stdinResolver.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};if(typeof options.file!="string")return;const filePath=options.file.trim();if(!filePath)throw new PmCliError("--file path cannot be empty",EXIT_CODE.USAGE);if(filePath==="-")return assertAnnotationStdinTransportAvailable(options,"--file -"),{value:await stdinResolver.resolveValue("-","--file")??"",emptyFlag:"--file"};try{return{value:await readFile(filePath,"utf8"),emptyFlag:"--file"}}catch(error){if(isErrnoError(error)&&isFileAbsentError(error))throw new PmCliError(`--file path not found: ${filePath}. Use --file - to read stdin.`,EXIT_CODE.USAGE);const detail=error instanceof Error?error.message:String(error);throw new PmCliError(`Failed to read --file path "${filePath}": ${detail}. Use --file - to read stdin.`,EXIT_CODE.USAGE)}}async function resolveAnnotationInput(options,noun){if(options.edit!==void 0&&options.delete!==void 0)throw new PmCliError("Specify only one of --edit or --delete",EXIT_CODE.USAGE);if(options.delete!==void 0){if(options.add!==void 0||options.stdin===!0||typeof options.file=="string")throw new PmCliError("--delete cannot be combined with replacement text",EXIT_CODE.USAGE);if(!Number.isInteger(options.delete)||options.delete<1)throw new PmCliError("--delete must be a positive integer",EXIT_CODE.USAGE);return{mode:"delete",index:options.delete}}if(options.edit!==void 0&&(!Number.isInteger(options.edit)||options.edit<1))throw new PmCliError("--edit must be a positive integer",EXIT_CODE.USAGE);const resolved=await resolveAnnotationTextSource(options,noun);if(options.edit!==void 0){if(!resolved)throw new PmCliError("--edit requires replacement text from --add, --stdin, or --file",EXIT_CODE.USAGE);return{mode:"edit",index:options.edit,...resolved}}return resolved?{mode:"add",...resolved}:{mode:"list"}}function wrapOwnershipConflict(error,guidance){throw error instanceof PmCliError&&error.exitCode===EXIT_CODE.CONFLICT&&error.message.includes("is assigned to")&&error.message.includes("Use --force to override")?new PmCliError(error.message,error.exitCode,{code:"ownership_conflict",required:guidance.required,examples:guidance.examples,nextSteps:guidance.nextSteps}):error}function annotationStdinHint(collectionKey){return collectionKey==="comments"?"--stdin":"--add -"}function assertAnnotationAddValueIsNotFlagLike(raw,config){if((config.input.emptyFlag??"--add")!=="--add")return;const trimmed=raw.trim();if(!/^-{1,2}[A-Za-z][\w-]*(?:=.*)?$/.test(trimmed))return;const stdinHint=annotationStdinHint(config.collectionKey),commandPrefix=config.input.mode==="edit"?`pm ${config.collectionKey} <id> --edit <index>`:`pm ${config.collectionKey} <id>`;throw new PmCliError(`--add value "${trimmed}" looks like an option, not annotation text. Use ${stdinHint} to read stdin, or use text=${trimmed} for literal dash-leading text.`,EXIT_CODE.USAGE,{code:"annotation_flag_like_value",required:`Use ${stdinHint} for stdin input, pass plain text, or use text=${trimmed} when the text really starts with "-".`,examples:[`${commandPrefix} ${stdinHint}`,`${commandPrefix} --add text=${trimmed}`]})}function assertAnnotationMessageHasTextSource(config,options){if(options.ifAbsent===!0&&!["add","stdin","file"].includes(config.input.mode))throw new PmCliError(`--if-absent requires a ${config.collectionKey.replace(/s$/,"")} append`,EXIT_CODE.USAGE,{code:"annotation_if_absent_without_append",required:"Combine --if-absent with one append text source; omit it for list, edit, and delete operations."});if(config.input.mode!=="list"||options.message===void 0)return;const noun=config.collectionKey.replace(/s$/,"");throw new PmCliError(`--message labels a ${noun} mutation but does not provide ${noun} text. Pass text positionally or with --add, --stdin, or --file.`,EXIT_CODE.USAGE,{code:"annotation_message_without_text",required:`Provide ${noun} text through a content source; --message only annotates the history entry of a mutation.`,examples:[`pm ${config.collectionKey} <id> --add "text" --message "why"`,`pm ${config.collectionKey} <id> ${annotationStdinHint(config.collectionKey)}`]})}function appendAnnotationEntry(document,collectionKey,author,text,ifAbsent,createEntry){const entries=readAnnotationEntries(document.metadata,collectionKey),existingIndex=ifAbsent?entries.findIndex(entry=>entry.author===author&&entry.text===text):-1;return existingIndex>=0?{changedFields:[],entryIndex:existingIndex+1}:(entries.push(createEntry({created_at:nowIso(),author,text})),document.metadata[collectionKey]=entries,{changedFields:[collectionKey],entryIndex:entries.length})}async function runAnnotationCommand(id,options,global2,config){assertAnnotationMessageHasTextSource(config,options);const pmRoot=resolvePmRoot(process.cwd(),global2.path);await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot),typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()),limit=parseLimit(options.limit);if(config.input.mode==="list"){const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located)throw new PmCliError(`Item ${id} not found`,EXIT_CODE.NOT_FOUND);const loaded=await readLocatedItem(located,{schema:settings.schema}),allEntries2=readAnnotationEntries(loaded.document.metadata,config.collectionKey);return renderAnnotationResult(located.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0)}const author=resolveAuthor(options.author,settings.author_default);if(config.input.mode==="delete"){const op=config.deleteOp??config.op;let result2;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey);return assertAnnotationEntryMutable(entries[arrayIndex],"deleted"),entries.splice(arrayIndex,1),document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey);return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"delete",entryIndex:config.input.index},options.fullHistory===!0)}const rawText=config.input.rawValue??config.input.value??"";assertAnnotationAddValueIsNotFlagLike(rawText,config);const text=config.parseText(config.input.value??"");if(!text.trim())throw new PmCliError(`${config.input.emptyFlag??"--add"} text cannot be empty`,EXIT_CODE.USAGE);if(config.input.mode==="edit"){const op=config.editOp??config.op;let result2;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey),existing=entries[arrayIndex];return assertAnnotationEntryMutable(existing,"edited"),entries[arrayIndex]={...existing,text,edited_at:nowIso()},document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey);return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"edit",entryIndex:config.input.index,entry:allEntries2[config.input.index-1]},options.fullHistory===!0)}let result,entryIndex=0;try{result=await mutateItem({pmRoot,settings,id,op:config.op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,skipNoop:options.ifAbsent===!0,mutate(document){const appended=appendAnnotationEntry(document,config.collectionKey,author,text,options.ifAbsent===!0,config.createEntry);return entryIndex=appended.entryIndex,{changedFields:appended.changedFields}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries=readAnnotationEntries(result.item,config.collectionKey);return renderAnnotationResult(result.item.id,config.collectionKey,allEntries,limit,options.includeMeta===!0,{action:"add",entryIndex,entry:allEntries[entryIndex-1],changedCount:options.ifAbsent===!0?Math.min(result.changedFields.length,1):void 0},options.fullHistory===!0)}function resolveAnnotationIndex(oneBasedIndex,count,collectionKey){if(oneBasedIndex===void 0||!Number.isInteger(oneBasedIndex)||oneBasedIndex<1||oneBasedIndex>count){const singular=collectionKey.replace(/s$/,""),label=`${singular.charAt(0).toUpperCase()}${singular.slice(1)}`,noun=count===1?`1 ${singular}`:`${count} ${collectionKey}`;throw new PmCliError(`${label} index ${oneBasedIndex??"(missing)"} out of range (item has ${noun})`,EXIT_CODE.USAGE)}return oneBasedIndex-1}function renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted){return mutation===void 0?{}:{mutation_receipt:{action:mutation.action,entry_index:mutation.entryIndex,changed_count:mutation.changedCount??1,full_history_included:!historyOmitted},omission_receipt:{has_omissions:historyOmitted,omitted_field_group_count:historyOmitted?1:0,omitted_field_groups:historyOmitted?[{name:`${collectionKey}_history`,restore_with:{selector:"full_history",cli_flag:"--full-history",sdk_option:"fullHistory",mcp_option:"full"}}]:[]}}}function renderAnnotationResult(id,collectionKey,allEntries,limit,includeMeta,mutation,fullHistory=!1){const entries=mutation===void 0||fullHistory?limitAnnotationEntries(allEntries,mutation!==void 0&&fullHistory?void 0:limit):mutation.entry===void 0?[]:[mutation.entry],historyOmitted=mutation!==void 0&&entries.length<allEntries.length;return{id,[collectionKey]:entries,count:entries.length,...mutation?.changedCount===void 0?{}:{changed:mutation.changedCount===1},...[includeMeta,mutation!==void 0].includes(!0)?{total_count:allEntries.length,returned_count:entries.length,has_more:historyOmitted||entries.length<allEntries.length,...limit!==void 0?{limit}:{}}:{},...renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted)}}export{assertAnnotationStdinTransportAvailable,isErrnoError,limitAnnotationEntries,normalizeAnnotationTransportOptions,parseAnnotationTextInput,readAnnotationEntries,resolveAnnotationIndex,resolveAnnotationInput,runAnnotationCommand,wrapOwnershipConflict};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3f833046-5961-57e6-a680-c1f23abf26c3")}catch{}})();import{assertInitializedTracker}from"./environment/tracker-preflight.js";import{readFile}from"node:fs/promises";import{isFileAbsentError}from"../core/fs/fs-utils.js";import{getActiveExtensionRegistrations}from"../core/extensions/index.js";import{resolveItemTypeRegistry}from"../core/item/type-registry.js";import{createStdinTokenResolver,parseCsvKv,shouldResolveMutationStdinTokens,transferMutationStdinTokenPolicy}from"../core/item/parse.js";import{renderPmCommand}from"../core/shared/command-line.js";import{EXIT_CODE}from"../core/shared/constants.js";import{PmCliError}from"../core/shared/errors.js";import{parseLimit}from"../core/shared/numeric-parsers.js";import{nowIso}from"../core/shared/time.js";import{resolveAuthor}from"../core/shared/author.js";import{locateItem,mutateItem,readLocatedItem}from"../core/store/item-store.js";import{resolvePmRoot}from"../core/store/paths.js";import{readSettings}from"../core/store/settings.js";import{CANONICALLY_ORDERED_LOG_COLLECTIONS,compareLogValues}from"../core/item/item-format.js";function normalizeAnnotationTransportOptions(options){const normalized={...options,...options.full===!0?{fullHistory:!0}:{}};return delete normalized.full,transferMutationStdinTokenPolicy(options,normalized)}function assertAnnotationEntryMutable(entry,operation){if(typeof entry=="object"&&entry!==null&&"format"in entry&&entry.format==="json")throw new PmCliError(`Structured context events are append-only and cannot be ${operation}.`,EXIT_CODE.USAGE,{code:"structured_event_immutable"})}function limitAnnotationEntries(values,limit){return limit===void 0?values:limit===0?[]:values.slice(Math.max(0,values.length-limit))}function readAnnotationEntries(source,collectionKey){const value=source[collectionKey];return Array.isArray(value)?value:[]}function parseAnnotationTextInput(raw,options={}){const trimmed=raw.trim();if(!trimmed)return"";const textPrefixMatch=/^(?:[-*+]\s*)?text\s*[:=]/i.exec(trimmed);if(options.stripPlainTextPrefix===!0&&textPrefixMatch&&!trimmed.startsWith("```"))return trimmed.slice(textPrefixMatch[0].length).trim()||trimmed;if(!(/^(?:[-*+]\s*)?text\s*[:=]/im.test(trimmed)||trimmed.startsWith("```")))return trimmed;try{const kv=parseCsvKv(trimmed,"--add");return Object.keys(kv).map(key=>key.trim().toLowerCase()).some(key=>key!=="text")?trimmed:kv.text?.trim()||trimmed}catch{return trimmed}}function isErrnoError(error){return typeof error=="object"&&error!==null&&"code"in error}function assertAnnotationStdinTransportAvailable(options,optionName){if(!shouldResolveMutationStdinTokens(options))throw new PmCliError(`${optionName} cannot read process stdin through the MCP JSON-RPC transport. Pass annotation text in options.add instead.`,EXIT_CODE.USAGE,{code:"mcp_stdin_unavailable",required:"Pass annotation text as JSON data; the MCP protocol already owns process stdin."})}async function resolveAnnotationTextSource(options,noun){if(+(options.add!==void 0)+ +(options.stdin===!0)+ +(typeof options.file=="string")>1)throw new PmCliError(`Specify ${noun} text using only one input source: --add, --stdin, or --file`,EXIT_CODE.USAGE);const stdinResolver=createStdinTokenResolver(),resolveStdinTokens=shouldResolveMutationStdinTokens(options);if(options.add!==void 0)return{value:await stdinResolver.resolveValue(options.add,"--add",resolveStdinTokens)??"",rawValue:options.add,emptyFlag:"--add"};if(options.stdin===!0)return assertAnnotationStdinTransportAvailable(options,"--stdin"),{value:await stdinResolver.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};if(typeof options.file!="string")return;const filePath=options.file.trim();if(!filePath)throw new PmCliError("--file path cannot be empty",EXIT_CODE.USAGE);if(filePath==="-")return assertAnnotationStdinTransportAvailable(options,"--file -"),{value:await stdinResolver.resolveValue("-","--file")??"",emptyFlag:"--file"};try{return{value:await readFile(filePath,"utf8"),emptyFlag:"--file"}}catch(error){if(isErrnoError(error)&&isFileAbsentError(error))throw new PmCliError(`--file path not found: ${filePath}. Use --file - to read stdin.`,EXIT_CODE.USAGE);const detail=error instanceof Error?error.message:String(error);throw new PmCliError(`Failed to read --file path "${filePath}": ${detail}. Use --file - to read stdin.`,EXIT_CODE.USAGE)}}async function resolveAnnotationInput(options,noun){if(options.edit!==void 0&&options.delete!==void 0)throw new PmCliError("Specify only one of --edit or --delete",EXIT_CODE.USAGE);if(options.delete!==void 0){if(options.add!==void 0||options.stdin===!0||typeof options.file=="string")throw new PmCliError("--delete cannot be combined with replacement text",EXIT_CODE.USAGE);if(!Number.isInteger(options.delete)||options.delete<1)throw new PmCliError("--delete must be a positive integer",EXIT_CODE.USAGE);return{mode:"delete",index:options.delete}}if(options.edit!==void 0&&(!Number.isInteger(options.edit)||options.edit<1))throw new PmCliError("--edit must be a positive integer",EXIT_CODE.USAGE);const resolved=await resolveAnnotationTextSource(options,noun);if(options.edit!==void 0){if(!resolved)throw new PmCliError("--edit requires replacement text from --add, --stdin, or --file",EXIT_CODE.USAGE);return{mode:"edit",index:options.edit,...resolved}}return resolved?{mode:"add",...resolved}:{mode:"list"}}function wrapOwnershipConflict(error,guidance){throw error instanceof PmCliError&&error.exitCode===EXIT_CODE.CONFLICT&&error.message.includes("is assigned to")&&error.message.includes("Use --force to override")?new PmCliError(error.message,error.exitCode,{code:"ownership_conflict",required:guidance.required,examples:guidance.examples,nextSteps:guidance.nextSteps}):error}function annotationStdinHint(collectionKey){return collectionKey==="comments"?"--stdin":"--add -"}const ANNOTATION_FLAG_LIKE_VALUE_CODE="annotation_flag_like_value";function isFlagLikeAnnotationValue(raw){return/^-{1,2}[A-Za-z][\w-]*(?:=.*)?$/.test(raw.trim())}function annotationSourceOptionForm(token){return token==="--file"?"--file <path>":token.startsWith("--file=")?token:token==="--stdin"?"--stdin":void 0}function createFlagLikeAnnotationValueRefusal(input){const trimmed=input.value.trim(),noun=input.collectionKey.replace(/s$/,""),sourceForm=annotationSourceOptionForm(trimmed),stdinHint=annotationStdinHint(input.collectionKey),retry=input.retryArgs===void 0?{}:{field:input.textFlag,recovery:{suggested_flags:[trimmed],suggested_retry:renderPmCommand(input.retryArgs),suggested_retry_args:[...input.retryArgs]}};if(sourceForm!==void 0){const sourceFlag=sourceForm.split(/[ =]/,1)[0],source=sourceFlag==="--file"?"that file":"stdin",operandNote=input.conflictingOperand===void 0?"":` "${input.conflictingOperand}" was read as positional text, which ${sourceFlag} cannot be combined with: drop it, or pass it as the text without ${sourceFlag}.`;return new PmCliError(`${input.textFlag} value "${trimmed}" looks like an option, not annotation text: ${input.textFlag} took ${sourceFlag} as its value. Drop ${input.textFlag} and pass ${sourceForm} on its own.${operandNote}`,EXIT_CODE.USAGE,{code:"annotation_flag_like_value",required:`Drop ${input.textFlag}: ${sourceForm} reads the ${noun} text from ${source} by itself. Use ${input.textFlag} text=${trimmed} only when the text really is "${trimmed}".`,examples:[`${input.commandPrefix} ${sourceForm}`,`${input.commandPrefix} ${input.textFlag} text=${trimmed}`],...retry})}return new PmCliError(`${input.textFlag} value "${trimmed}" looks like an option, not annotation text. Use ${stdinHint} to read stdin, or use text=${trimmed} for literal dash-leading text.`,EXIT_CODE.USAGE,{code:"annotation_flag_like_value",required:`Use ${stdinHint} for stdin input, pass plain text, or use text=${trimmed} when the text really starts with "-".`,examples:[`${input.commandPrefix} ${stdinHint}`,`${input.commandPrefix} ${input.textFlag} text=${trimmed}`],...retry})}function assertAnnotationAddValueIsNotFlagLike(raw,config){if(!((config.input.emptyFlag??"--add")!=="--add"||!isFlagLikeAnnotationValue(raw)))throw createFlagLikeAnnotationValueRefusal({collectionKey:config.collectionKey,textFlag:"--add",value:raw,commandPrefix:config.input.mode==="edit"?`pm ${config.collectionKey} <id> --edit <index>`:`pm ${config.collectionKey} <id>`})}function assertAnnotationMessageHasTextSource(config,options){if(options.ifAbsent===!0&&!["add","stdin","file"].includes(config.input.mode))throw new PmCliError(`--if-absent requires a ${config.collectionKey.replace(/s$/,"")} append`,EXIT_CODE.USAGE,{code:"annotation_if_absent_without_append",required:"Combine --if-absent with one append text source; omit it for list, edit, and delete operations."});if(assertAnnotationExpectationTargetsEntry(config,options),config.input.mode!=="list"||options.message===void 0)return;const noun=config.collectionKey.replace(/s$/,"");throw new PmCliError(`--message labels a ${noun} mutation but does not provide ${noun} text. Pass text positionally or with --add, --stdin, or --file.`,EXIT_CODE.USAGE,{code:"annotation_message_without_text",required:`Provide ${noun} text through a content source; --message only annotates the history entry of a mutation.`,examples:[`pm ${config.collectionKey} <id> --add "text" --message "why"`,`pm ${config.collectionKey} <id> ${annotationStdinHint(config.collectionKey)}`]})}function assertAnnotationExpectationTargetsEntry(config,options){if(options.expectAt!==void 0){if(config.input.mode!=="edit"&&config.input.mode!=="delete")throw new PmCliError(`--expect-at guards an --edit or --delete of one ${config.collectionKey.replace(/s$/,"")}`,EXIT_CODE.USAGE,{code:"annotation_expectation_without_target",required:"Combine --expect-at with --edit <index> or --delete <index>; omit it for list and append operations.",examples:[`pm ${config.collectionKey} <id> --edit <index> --expect-at <created_at> --add "<text>"`,`pm ${config.collectionKey} <id> --delete <index> --expect-at <created_at>`]});if(typeof options.expectAt!="string"||options.expectAt.trim().length===0)throw new PmCliError("--expect-at must be the non-empty created_at timestamp of the entry you read",EXIT_CODE.USAGE,{code:"annotation_expectation_invalid",required:"Pass the created_at value of the row you read at that index, as a string."})}}function assertExpectedAnnotationEntry(id,entries,arrayIndex,config,expectAt){if(expectAt===void 0)return;const actual=entries[arrayIndex].created_at;if(actual===expectAt)return;const matchingIndexes=entries.flatMap((entry,position)=>entry.created_at===expectAt?[position+1]:[]),noun=config.collectionKey.replace(/s$/,""),action=config.input.mode==="delete"?"--delete":"--edit",entryIndex=arrayIndex+1,retarget=matchingIndexes.length===1?` The ${noun} created at ${expectAt} is at index ${matchingIndexes[0]}.`:matchingIndexes.length>1?` ${matchingIndexes.length} ${config.collectionKey} were created at ${expectAt}: indexes ${matchingIndexes.join(", ")}.`:` No ${noun} on ${id} was created at ${expectAt}.`;throw new PmCliError(`${noun.charAt(0).toUpperCase()}${noun.slice(1)} ${entryIndex} on ${id} was created at ${actual}, not ${expectAt}; refusing ${action} of an entry the caller did not read. Nothing was written.${retarget}`,EXIT_CODE.CONFLICT,{code:"annotation_entry_mismatch",item_id:id,details:{collection:config.collectionKey,entry_index:entryIndex,expected_created_at:expectAt,actual_created_at:actual,matching_indexes:matchingIndexes},required:`Address the ${noun} by the index its listing row reports and keep --expect-at set to that row's created_at. When several indexes share the timestamp, inspect those rows before retrying, because the guard compares timestamps, not entry identities.`,why:"A listing page's position or count is not an entry address; only the row's index is, and the expectation checks that the entry at that index still carries the created_at that was read.",examples:[`pm ${config.collectionKey} ${id} --limit 5`,`pm ${config.collectionKey} ${id} ${action} ${matchingIndexes.length===1?matchingIndexes[0]:"<index>"} --expect-at ${expectAt}${action==="--edit"?' --add "<text>"':""}`]})}function appendAnnotationEntry(document,collectionKey,author,text,ifAbsent,createEntry){const entries=readAnnotationEntries(document.metadata,collectionKey),existingIndex=ifAbsent?entries.findIndex(entry=>entry.author===author&&entry.text===text):-1;return existingIndex>=0?{changedFields:[],written:entries,position:existingIndex}:(entries.push(createEntry({created_at:nowIso(),author,text})),document.metadata[collectionKey]=entries,{changedFields:[collectionKey],written:entries,position:entries.length-1})}function canonicalAnnotationAddress(collectionKey,written,position){return CANONICALLY_ORDERED_LOG_COLLECTIONS.has(collectionKey)?written.map((_entry,index)=>index).sort((left,right)=>compareLogValues(written[left],written[right])||left-right).indexOf(position)+1:position+1}async function runAnnotationCommand(id,options,global2,config){assertAnnotationMessageHasTextSource(config,options);const pmRoot=resolvePmRoot(process.cwd(),global2.path);await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot),typeRegistry=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()),limit=parseLimit(options.limit);if(config.input.mode==="list"){const located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder);if(!located)throw new PmCliError(`Item ${id} not found`,EXIT_CODE.NOT_FOUND);const loaded=await readLocatedItem(located,{schema:settings.schema}),allEntries2=readAnnotationEntries(loaded.document.metadata,config.collectionKey);return renderAnnotationResult(located.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0)}const author=resolveAuthor(options.author,settings.author_default);if(config.input.mode==="delete"){const op=config.deleteOp??config.op;let result2;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey);return assertExpectedAnnotationEntry(id,entries,arrayIndex,config,options.expectAt),assertAnnotationEntryMutable(entries[arrayIndex],"deleted"),entries.splice(arrayIndex,1),document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey);return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"delete",entryIndex:config.input.index},options.fullHistory===!0)}const rawText=config.input.rawValue??config.input.value??"";assertAnnotationAddValueIsNotFlagLike(rawText,config);const text=config.parseText(config.input.value??"");if(!text.trim())throw new PmCliError(`${config.input.emptyFlag??"--add"} text cannot be empty`,EXIT_CODE.USAGE);if(config.input.mode==="edit"){const op=config.editOp??config.op;let result2,editedAddress=0;try{result2=await mutateItem({pmRoot,settings,id,op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,mutate(document){const entries=readAnnotationEntries(document.metadata,config.collectionKey),arrayIndex=resolveAnnotationIndex(config.input.index,entries.length,config.collectionKey);assertExpectedAnnotationEntry(id,entries,arrayIndex,config,options.expectAt);const existing=entries[arrayIndex];return assertAnnotationEntryMutable(existing,"edited"),entries[arrayIndex]={...existing,text,edited_at:nowIso()},editedAddress=canonicalAnnotationAddress(config.collectionKey,entries,arrayIndex),document.metadata[config.collectionKey]=entries,{changedFields:[config.collectionKey]}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries2=readAnnotationEntries(result2.item,config.collectionKey),editedIndex=editedAddress;return renderAnnotationResult(result2.item.id,config.collectionKey,allEntries2,limit,options.includeMeta===!0,{action:"edit",entryIndex:editedIndex,entry:allEntries2[editedIndex-1]},options.fullHistory===!0)}let result,entryIndex=0;try{result=await mutateItem({pmRoot,settings,id,op:config.op,author,message:options.message,force:options.force,bypassAssigneeConflict:config.bypassOwnershipConflict,skipNoop:options.ifAbsent===!0,mutate(document){const appended=appendAnnotationEntry(document,config.collectionKey,author,text,options.ifAbsent===!0,config.createEntry);return entryIndex=canonicalAnnotationAddress(config.collectionKey,appended.written,appended.position),{changedFields:appended.changedFields}}})}catch(error){wrapOwnershipConflict(error,config.conflictGuidance)}const allEntries=readAnnotationEntries(result.item,config.collectionKey);return renderAnnotationResult(result.item.id,config.collectionKey,allEntries,limit,options.includeMeta===!0,{action:"add",entryIndex,entry:allEntries[entryIndex-1],changedCount:options.ifAbsent===!0?Math.min(result.changedFields.length,1):void 0},options.fullHistory===!0)}function resolveAnnotationIndex(oneBasedIndex,count,collectionKey){if(oneBasedIndex===void 0||!Number.isInteger(oneBasedIndex)||oneBasedIndex<1||oneBasedIndex>count){const singular=collectionKey.replace(/s$/,""),label=`${singular.charAt(0).toUpperCase()}${singular.slice(1)}`,noun=count===1?`1 ${singular}`:`${count} ${collectionKey}`;throw new PmCliError(`${label} index ${oneBasedIndex??"(missing)"} out of range (item has ${noun})`,EXIT_CODE.USAGE)}return oneBasedIndex-1}function renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted){return mutation===void 0?{}:{mutation_receipt:{action:mutation.action,entry_index:mutation.entryIndex,changed_count:mutation.changedCount??1,full_history_included:!historyOmitted},omission_receipt:{has_omissions:historyOmitted,omitted_field_group_count:historyOmitted?1:0,omitted_field_groups:historyOmitted?[{name:`${collectionKey}_history`,restore_with:{selector:"full_history",cli_flag:"--full-history",sdk_option:"fullHistory",mcp_option:"full"}}]:[]}}}function indexAnnotationEntry(entry,index){if(Object.prototype.toString.call(entry)!=="[object Object]")return entry;const indexed={index,...entry};return indexed.index=index,indexed}function indexRetainedAnnotationEntries(allEntries,retained){const offset=allEntries.length-retained.length;return retained.map((entry,position)=>indexAnnotationEntry(entry,offset+position+1))}function renderAnnotationResult(id,collectionKey,allEntries,limit,includeMeta,mutation,fullHistory=!1){const entries=mutation===void 0||fullHistory?indexRetainedAnnotationEntries(allEntries,limitAnnotationEntries(allEntries,mutation!==void 0&&fullHistory?void 0:limit)):mutation.entry===void 0?[]:[indexAnnotationEntry(mutation.entry,mutation.entryIndex)],historyOmitted=mutation!==void 0&&entries.length<allEntries.length;return{id,[collectionKey]:entries,count:entries.length,...mutation?.changedCount===void 0?{}:{changed:mutation.changedCount===1},...[includeMeta,mutation!==void 0].includes(!0)?{total_count:allEntries.length,returned_count:entries.length,has_more:historyOmitted||entries.length<allEntries.length,...limit!==void 0?{limit}:{}}:{},...renderAnnotationMutationReceipts(collectionKey,mutation,historyOmitted)}}export{ANNOTATION_FLAG_LIKE_VALUE_CODE,assertAnnotationStdinTransportAvailable,createFlagLikeAnnotationValueRefusal,isErrnoError,isFlagLikeAnnotationValue,limitAnnotationEntries,normalizeAnnotationTransportOptions,parseAnnotationTextInput,readAnnotationEntries,resolveAnnotationIndex,resolveAnnotationInput,runAnnotationCommand,wrapOwnershipConflict};
2
2
  //# sourceMappingURL=annotations.js.map
@@ -16,3 +16,9 @@ export { EXTENSION_CAPABILITY_REGISTRATION_SURFACES,collectUsedExtensionCapabili
16
16
  export { renderExtensionSurfaceMarkdown,type ExtensionSurfaceMarkdownOptions,} from "../core/extensions/activation-summary-markdown.js";
17
17
  export { createExtensionContributionInventory,normalizeExtensionContributionInventory,} from "../core/extensions/contribution-inventory.js";
18
18
  export type { AfterCommandAffectedItem,AfterCommandHook,AfterCommandHookContext,BeforeCommandHook,BeforeCommandHookContext,BeforeMutationHook,BeforeMutationHookContext,BeforeMutationHookDecision,CommandDefinition,ExtensionCommandReadOutput,ExtensionCommandArgumentDefinition,CommandHandler,CommandHandlerContext,CommandHandlerResult,ExtensionCommandSdk,CommandOverride,CommandOverrideContext,ExtensionServiceName,Exporter,ExporterArtifactOutputContract,ExporterRegistrationOptions,ExtensionActivationResult,ExtensionApi,ExtensionCommandRegistry,ExtensionDeactivationFailure,ExtensionDeactivationOptions,ExtensionDeactivationResult,ExtensionDiagnostic,ExtensionContributionInventory,ExtensionDiscoveryResult,ExtensionHookRegistry,ExtensionSelfIdentity,ExtensionLoadResult,ExtensionManifest,ExtensionManifestEngines,ExtensionMutationGuardSdk,ExtensionGovernancePolicy,ExtensionPolicyOverride,ExtensionProvenanceMetadata,ExtensionRuntimePermissionDeclaration,ExtensionSearchMode,ExtensionParserRegistry,ExtensionPreflightRegistry,ExtensionRegistrationRegistry,ExtensionRendererRegistry,ExtensionServiceRegistry,FlagValueType,FlagDefinition,ImportExportContext,ImportExportRegistrationOptions,Importer,OnIndexHook,OnIndexHookContext,OnReadHook,OnReadHookContext,OnWriteHook,OnWriteHookContext,OutputRendererFormat,ParserOverride,ParserOverrideContext,ParserOverrideDelta,PreflightOverride,PreflightOverrideContext,PreflightOverrideDelta,PreflightRuntimeDecision,RegisteredExtensionExporter,RegisteredExporterArtifactOutputContract,RegisteredExtensionFlagDefinitions,RegisteredExtensionHook,RegisteredExtensionImporter,RegisteredExtensionProjectProfile,RegisteredExtensionSchemaMigrationDefinition,RegisteredExtensionSearchProvider,RegisteredExtensionServiceOverride,RegisteredExtensionVectorStoreAdapter,RendererOverride,RendererOverrideContext,SchemaFieldDefinition,SchemaItemTypeCommandOptionPolicyDefinition,SchemaItemTypeOptionDefinition,SchemaItemTypeDefinition,SchemaMigrationDefinition,SchemaMigrationRunContext,SchemaMigrationRunner,SearchProviderEmbedBatchContext,SearchProviderEmbedContext,SearchProviderDefinition,SearchProviderHit,SearchProviderQueryContext,SearchProviderQueryResult,ServiceOverride,ServiceOverrideContext,ServiceOverrideDecision,ServiceOverrideOwnership,VectorStoreAdapterDefinition,VectorStoreDeleteContext,VectorStoreQueryContext,VectorStoreQueryHit,VectorStoreUpsertContext,VectorStoreUpsertPoint,} from "../core/extensions/loader.js";
19
+ export { normalizeDirectExtensionCommandOptions,resolveExtensionFlagOptionKey,type LooseCommandFlagDefinition,} from "./extension/command-options.js";
20
+ export type { ExtensionActivationSummary } from "../core/extensions/activation-summary.js";
21
+ export type { ExtensionLayer,ScopedPreflightOverrideDefinition,ScopedRendererOverrideDefinition } from "../core/extensions/extension-types.js";
22
+ export type { CommanderOptionAliasContract } from "./cli-contracts/commander-types.js";
23
+ export type { CliFlagContract } from "./cli-contracts/flag-contracts.js";
24
+ export type { ExactDefinition,FlagAuthoringDefinition,ItemFieldAuthoringDefinition,ItemTypeAuthoringDefinition,MigrationAuthoringDefinition,SearchProviderAuthoringDefinition,VectorStoreAdapterAuthoringDefinition } from "./define.js";
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d0b86c6a-67f0-52f2-90b8-d1058e8f2284")}catch{}})();export*from"./compose.js";export*from"./define.js";export*from"./extension-contracts.js";import{RESERVED_ITEM_FIELD_NAMES}from"../core/extensions/item-fields.js";import{PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_RESOURCE_KINDS,collectPackageExtensionDirectories,readPmPackageManifest}from"../core/packages/manifest.js";import{BUILTIN_PROFILES,listProfiles,normalizeProfileName,PROFILE_NAMES,resolveProfile}from"../core/profile/profile-presets.js";import{describeProfileComposition,describeProjectProfile}from"../core/profile/profile-describe.js";import{lintProjectProfile,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS}from"../core/profile/profile-lint.js";import{planProfileApplication}from"../core/profile/profile-plan.js";import{EXTENSION_CAPABILITY_REGISTRATION_SURFACES,collectUsedExtensionCapabilities,reconcileExtensionCapabilityUsage}from"../core/extensions/capability-usage.js";import{renderExtensionSurfaceMarkdown}from"../core/extensions/activation-summary-markdown.js";import{createExtensionContributionInventory,normalizeExtensionContributionInventory}from"../core/extensions/contribution-inventory.js";export{BUILTIN_PROFILES,EXTENSION_CAPABILITY_REGISTRATION_SURFACES,PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_RESOURCE_KINDS,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS,PROFILE_NAMES,RESERVED_ITEM_FIELD_NAMES,collectPackageExtensionDirectories,collectUsedExtensionCapabilities,createExtensionContributionInventory,describeProfileComposition,describeProjectProfile,lintProjectProfile,listProfiles,normalizeExtensionContributionInventory,normalizeProfileName,planProfileApplication,readPmPackageManifest,reconcileExtensionCapabilityUsage,renderExtensionSurfaceMarkdown,resolveProfile};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c96e4de9-16ef-581a-aa4b-6450917c2c65")}catch{}})();export*from"./compose.js";export*from"./define.js";export*from"./extension-contracts.js";import{RESERVED_ITEM_FIELD_NAMES}from"../core/extensions/item-fields.js";import{PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_RESOURCE_KINDS,collectPackageExtensionDirectories,readPmPackageManifest}from"../core/packages/manifest.js";import{BUILTIN_PROFILES,listProfiles,normalizeProfileName,PROFILE_NAMES,resolveProfile}from"../core/profile/profile-presets.js";import{describeProfileComposition,describeProjectProfile}from"../core/profile/profile-describe.js";import{lintProjectProfile,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS}from"../core/profile/profile-lint.js";import{planProfileApplication}from"../core/profile/profile-plan.js";import{EXTENSION_CAPABILITY_REGISTRATION_SURFACES,collectUsedExtensionCapabilities,reconcileExtensionCapabilityUsage}from"../core/extensions/capability-usage.js";import{renderExtensionSurfaceMarkdown}from"../core/extensions/activation-summary-markdown.js";import{createExtensionContributionInventory,normalizeExtensionContributionInventory}from"../core/extensions/contribution-inventory.js";import{normalizeDirectExtensionCommandOptions,resolveExtensionFlagOptionKey}from"./extension/command-options.js";export{BUILTIN_PROFILES,EXTENSION_CAPABILITY_REGISTRATION_SURFACES,PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,PM_PACKAGE_RESOURCE_KINDS,PROFILE_LINT_CODES,PROFILE_LINT_DIMENSIONS,PROFILE_NAMES,RESERVED_ITEM_FIELD_NAMES,collectPackageExtensionDirectories,collectUsedExtensionCapabilities,createExtensionContributionInventory,describeProfileComposition,describeProjectProfile,lintProjectProfile,listProfiles,normalizeDirectExtensionCommandOptions,normalizeExtensionContributionInventory,normalizeProfileName,planProfileApplication,readPmPackageManifest,reconcileExtensionCapabilityUsage,renderExtensionSurfaceMarkdown,resolveExtensionFlagOptionKey,resolveProfile};
2
2
  //# sourceMappingURL=authoring.js.map
@@ -29,6 +29,10 @@ values?:readonly string[];
29
29
  cursor_semantics?:"presentation";
30
30
  /** Host reservation boundary: inherited flags are forbidden on extensions; root-only flags may have command-local meanings. */
31
31
  reservation_scope?:"inherited" | "root_only";
32
+ /** Runtime that owns the flag on an extension command: `host` flags reach the handler through `context.global`, `extension` flags through `context.options` (pm-gh1666). */
33
+ owner?:"host" | "extension";
34
+ /** Handler key an extension flag is delivered under in `context.options`, and the key a direct `PmClient.run` or test-harness caller passes (pm-gh1665). */
35
+ sdk_option?:string;
32
36
  }
33
37
  /** Maps an MCP tool option `param` to the CLI `flag` it forwards to, plus the value semantics (`allowEmpty`, `repeatable`, `booleanish`) the bridge needs to translate a structured tool call into argv. */
34
38
  export interface ToolOptionFlagContract {
@@ -53,6 +57,17 @@ export declare function withFlagAliasMetadata(flagContracts:CliFlagContract[]):C
53
57
  export declare function compactFlagAliasContracts(flagContracts:CliFlagContract[]):CliFlagContract[];
54
58
  /** Public contract for subcommand global flag contracts, shared by SDK and presentation-layer consumers. */
55
59
  export declare const SUBCOMMAND_GLOBAL_FLAG_CONTRACTS:CliFlagContract[];
60
+ /**
61
+ * Host-owned flags an extension command accepts, marked `owner: "host"` because
62
+ * they reach the handler through `context.global` (pm-gh1666). Read-output
63
+ * controls apply only when the command declares structured read output, and
64
+ * `--no-extensions` is never listed because it removes the command itself.
65
+ * The availability is declared beside each reserved flag, so a new host flag
66
+ * is classified where it is reserved.
67
+ */
68
+ export declare function resolveExtensionCommandInheritedFlagContracts(options?:{
69
+ readOutput?:boolean;
70
+ }):CliFlagContract[];
56
71
  /** Public contract for global flag contracts, shared by SDK and presentation-layer consumers. */
57
72
  export declare const GLOBAL_FLAG_CONTRACTS:CliFlagContract[];
58
73
  /** Public contract for list filter flag contracts, shared by SDK and presentation-layer consumers. */
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6e49e7f6-16c9-5b93-bde6-6854c11d83cc")}catch{}})();import{resolvePmHistoryOperation}from"./command-aliases.js";import{normalizeUniqueStringList}from"./string-lists.js";import{GRAPH_QUERY_DEFAULTS}from"../graph/query-contracts.js";import{RESERVED_EXTENSION_HOST_FLAGS}from"../../core/extensions/reserved-host-flags.js";import{CONTEXT_DEPTH_VALUES}from"../../types.js";import{GET_DEPTH_INPUT_VALUES,PLAN_SHOW_DEPTH_VALUES}from"../query/projection-contracts.js";import{PM_POSITIONAL_ACTION_CONTRACTS}from"./grammar-contracts.js";function normalizeFlagAliasKey(flag){return flag.startsWith("--")?`--${flag.slice(2).replaceAll("_","-")}`:flag}function withFlagAliasMetadata(flagContracts){const aliasesByCanonical=new Map;for(const contract of flagContracts){const canonical=normalizeFlagAliasKey(contract.flag),bucket=aliasesByCanonical.get(canonical)??new Set;contract.flag!==canonical&&bucket.add(contract.flag);for(const alias of contract.aliases??[])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);return aliases.length===0?contract:{...contract,aliases}})}function compactFlagAliasContracts(flagContracts){const withAliases=withFlagAliasMetadata(flagContracts),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}:{}})),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."}],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"}],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:!0},{flag:"--limit"},{flag:"--offset"}],LIST_FILTER_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--status",list:!0},{flag:"--all",value_type:"boolean"},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{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:!0},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{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:!0},{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"])),AGGREGATE_FLAG_CONTRACTS=[{flag:"--group-by",list:!0},{flag:"--set-mode"},{flag:"--limit"},{flag:"--after"},{flag:"--count"},{flag:"--completion"},{flag:"--sum"},{flag:"--avg"},{flag:"--include-unparented"},{flag:"--include_unparented"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0}],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"}],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"}],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"}],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"}],HISTORY_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--limit"},{flag:"--order",value_name:"value",value_type:"string"},{flag:"--compact"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--diff"},{flag:"--field"},{flag:"--verify"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--format"}],MERGE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--pre-commit-hook",value_type:"boolean"},{flag:"--stage",value_type:"boolean"},{flag:"--message"},{flag:"--force"},{flag:"--include-reconciled"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}],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"}],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"}],HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS=[{flag:"--event",repeatable:!0},{flag:"--all-actionable"},{flag:"--dry-run"},{flag:"--plan-fingerprint"},{flag:"--limit",value_type:"number"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}],HISTORY_COMPACT_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--before"},{flag:"--ids",list:!0},{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"}],HISTORY_ATTEST_FLAG_CONTRACTS=[{flag:"--verify",value_name:"file",value_type:"string"},{flag:"--output",value_name:"file",value_type:"string"},{flag:"--hash-algorithm",value_name:"name",value_type:"string"}],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"}],PROFILE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],PLAN_FLAG_CONTRACTS=[{flag:"--title"},{flag:"--description"},{flag:"--scope"},{flag:"--parent"},{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{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:!0},{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:!0},{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:!0},{flag:"--note",repeatable:!0},{flag:"--learning",repeatable:!0},{flag:"--reminder",repeatable:!0},{flag:"--event",repeatable:!0},{flag:"--type-option",aliases:["--type_option"],repeatable:!0},{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",values:PLAN_SHOW_DEPTH_VALUES},{flag:"--field"},{flag:"--fields",list:!0},{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"}],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"}],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"}],EXTENSION_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{flag:"--offline",value_type:"boolean"},{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"}],EXTENSION_SCOPE_FLAG_CONTRACTS=[{flag:"--project"},{flag:"--local"},{flag:"--global"}],EXTENSION_INIT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--capability"}],PACKAGE_FLAG_CONTRACTS=[...EXTENSION_FLAG_CONTRACTS,{flag:"--declarative"}],PACKAGE_INIT_FLAG_CONTRACTS=[...EXTENSION_INIT_FLAG_CONTRACTS,{flag:"--declarative"}],EXTENSION_INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],EXTENSION_UNINSTALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--markdown"},{flag:"--output"}],EXTENSION_ADOPT_ALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--dry-run"}],EXTENSION_MANAGE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--offline",value_type:"boolean"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"}],EXTENSION_RELOAD_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--watch"}],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"}],EXTENSION_CATALOG_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--fields",list:!0}],EXTENSION_ADOPT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],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"}],REINDEX_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--progress"}],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"}],CLOSE_MANY_FLAG_CONTRACTS=[{flag:"--filter-status",list:!0},{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"}],APPEND_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--body",short:"-b"},{flag:"--text"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],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"]}],RESTORE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],DELETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],RELEASE_FLAG_CONTRACTS=[{flag:"--pause",value_type:"boolean"},{flag:"--handoff",value_name:"status"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],START_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],PAUSE_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],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"}],SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}],MEET_FLAG_CONTRACTS=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS],EVENT_FLAG_CONTRACTS=MEET_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS=[{flag:"--at"},{flag:"--text"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS],TEST_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{flag:"--remove-index",repeatable:!0},{flag:"--update"},{flag:"--update-index"},{flag:"--set-json"},{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:!0,description:"Record numeric measurement evidence; requires --run and an executed linked command."},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],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"}],TELEMETRY_FLAG_CONTRACTS=[{flag:"--limit"}],TEST_RUNS_FLAG_CONTRACTS=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}],GC_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--scope"}],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"}],DUPLICATES_FLAG_CONTRACTS=[{flag:"--exhaustive",value_type:"boolean"},{flag:"--status",repeatable:!0,list:!0},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}],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"}],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"}],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"}],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"}],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"}],ITEM_CONTENT_METADATA_FLAG_CONTRACTS=[{short:"-p",flag:"--priority"},{flag:"--type"},{flag:"--tags",aliases:["--tag"],list:!0},{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"]}],CREATE_FLAG_CONTRACTS=[{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{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:!0},{flag:"--add-tags",aliases:["--add_tags"]},{short:"-b",flag:"--body",value_name:"value"},{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",repeatable:!0},{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"}],ITEM_MUTATE_FLAG_CONTRACTS=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{flag:"--from",value_name:"path"},{flag:"--upsert-key",value_name:"field"},{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"}],ITEM_COMPLETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--transaction-id",value_name:"value",required:!0},{flag:"--reason",value_name:"value"},{flag:"--file",value_name:"value",repeatable:!0},{flag:"--doc",value_name:"value",repeatable:!0},{flag:"--test",value_name:"value",repeatable:!0},{flag:"--comment",value_name:"value",repeatable:!0},{flag:"--note",value_name:"value",repeatable:!0},{flag:"--learning",value_name:"value",repeatable:!0},{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"}],ITEM_REOPEN_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--status",value_name:"open|in_progress"},{flag:"--expected-result",value_name:"value",aliases:["--expected"]},{flag:"--message",value_name:"value"},{flag:"--force"},{flag:"--author",value_name:"value"}],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"}],FOCUS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--clear"}],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",repeatable:!0},{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"}],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:!0},{flag:"--filter-type",list:!0},{flag:"--filter-tag",list:!0},{flag:"--filter-priority",list:!0},{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:!0},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint",list:!0},{flag:"--filter-release",list:!0},{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",repeatable:!0},{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"}],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:"--after",cursor_semantics:"presentation"},{flag:"--format"}],ACTIVITY_FLAG_CONTRACTS=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--after",cursor_semantics:"presentation"},{flag:"--unbounded"},{flag:"--compact"},{flag:"--raw"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--stream"}],EVENTS_FLAG_CONTRACTS=[{flag:"--verify"},{flag:"--since"},{flag:"--type",repeatable:!0},{flag:"--author",repeatable:!0},{flag:"--item",repeatable:!0},{flag:"--limit",value_type:"number"},{flag:"--cursor-mode",value_name:"batch|row"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--follow"},{flag:"--interval-ms",value_type:"number"}],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",values:CONTEXT_DEPTH_VALUES},{flag:"--fields",list:!0},{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"])),GET_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth",values:GET_DEPTH_INPUT_VALUES},{flag:"--full",value_type:"boolean"},{flag:"--fields",list:!0},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}],GUIDE_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}],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:!0}],GRAPH_FLAG_CONTRACTS=[{flag:"--kind",list:!0},{flag:"--max-depth",description:`Maximum traversal depth; paths default to ${GRAPH_QUERY_DEFAULTS.path_depth}.`},{flag:"--limit",description:`Maximum rows per collection; default ${GRAPH_QUERY_DEFAULTS.rows}. Use --full to remove the row cap.`},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths",description:`Maximum enumerated paths; default ${GRAPH_QUERY_DEFAULTS.paths}.`},{flag:"--sample",description:`Maximum evidence examples per audit finding; default ${GRAPH_QUERY_DEFAULTS.samples}.`},{flag:"--exempt-isolate",list:!0},{flag:"--exempt-isolate-type",list:!0},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}],EVAL_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}],WORKSPACE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}],WORKSPACE_POSITION_FLAG_CONTRACTS=[],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"]}],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:!0},{flag:"--format"},{flag:"--limit"},{flag:"--after"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--assignee",list:!0},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{flag:"--parent"},...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"])),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"}],COMPLETION_FLAG_CONTRACTS=[{flag:"--eager-tags"}];function toUniqueFlagContracts(contracts){const seen=new Set,unique=[];for(const contract of contracts){const aliasKey=(contract.aliases??[]).join(","),key=`${contract.flag}|${contract.short??""}|${aliasKey}`;seen.has(key)||(seen.add(key),unique.push(contract))}return unique}function withSubcommandGlobalFlags(contracts,allowOutputFormatAlias=!1){const byCanonicalFlag=new Map;for(const contract of[...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,...contracts]){const canonicalFlag=normalizeFlagAliasKey(contract.flag),prior=byCanonicalFlag.get(canonicalFlag),{aliases:declaredAliases,...contractWithoutAliases}=contract,aliases=normalizeUniqueStringList([...declaredAliases??[],...contract.flag===canonicalFlag?[]:[contract.flag]]).filter(alias=>alias!==canonicalFlag),normalizedContract={...contractWithoutAliases,flag:canonicalFlag,...aliases.length>0?{aliases}:{}},mergedAliases=normalizeUniqueStringList([...prior?.aliases??[],...normalizedContract.aliases??[]]);byCanonicalFlag.set(canonicalFlag,prior===void 0?normalizedContract:{...prior,...normalizedContract,...mergedAliases.length>0?{aliases:mergedAliases}:{}})}if(allowOutputFormatAlias&&contracts.length>0&&!byCanonicalFlag.has("--format")){const encoding=byCanonicalFlag.get("--output-format");byCanonicalFlag.set("--output-format",{...encoding,aliases:[...encoding.aliases??[],"--format"]})}return withFlagAliasMetadata([...byCanonicalFlag.values()])}const FIXED_STATUS_LIST_COMMAND_ALIASES=["list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"],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),ASSURANCE_FLAG_CONTRACT_INDEX=indexCliFlagContracts(ASSURANCE_FLAG_CONTRACTS),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(),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",[]],["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],["history-attest",HISTORY_ATTEST_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]]),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){return typeof commandName!="string"?"":resolvePmHistoryOperation(commandName.trim().toLowerCase())}function hasSubcommandFlagContractsForCommand(commandName){const normalized=normalizeCommandNameForContracts(commandName);if(SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.has(normalized))return!0;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){return lifecycleSubcommand==="init"||lifecycleSubcommand==="scaffold"?rootCommand==="extension"?EXTENSION_INIT_FLAG_CONTRACTS:PACKAGE_INIT_FLAG_CONTRACTS: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)return(rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand==="upgrade"?withSubcommandGlobalFlags(UPGRADE_FLAG_CONTRACTS,!0):withSubcommandGlobalFlags(resolveExtensionLifecycleFlagContracts(rootCommand,lifecycleSubcommand),hasSubcommandFlagContractsForCommand(normalized));const contracts=SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.get(normalized)??[];return withSubcommandGlobalFlags(contracts,hasSubcommandFlagContractsForCommand(normalized))}function toCompletionFlagString(flagContracts,includeGlobal=!0){const scoped=withFlagAliasMetadata(flagContracts).flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>!!value),all=includeGlobal?[...scoped,...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS.flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>!!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_ATTEST_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=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f56bea0b-dabc-5c4f-b546-708364ac4eb7")}catch{}})();import{resolvePmHistoryOperation}from"./command-aliases.js";import{normalizeUniqueStringList}from"./string-lists.js";import{GRAPH_QUERY_DEFAULTS}from"../graph/query-contracts.js";import{RESERVED_EXTENSION_HOST_FLAGS}from"../../core/extensions/reserved-host-flags.js";import{CONTEXT_DEPTH_VALUES}from"../../types.js";import{GET_DEPTH_INPUT_VALUES,PLAN_SHOW_DEPTH_VALUES}from"../query/projection-contracts.js";import{PM_POSITIONAL_ACTION_CONTRACTS}from"./grammar-contracts.js";function normalizeFlagAliasKey(flag){return flag.startsWith("--")?`--${flag.slice(2).replaceAll("_","-")}`:flag}function withFlagAliasMetadata(flagContracts){const aliasesByCanonical=new Map;for(const contract of flagContracts){const canonical=normalizeFlagAliasKey(contract.flag),bucket=aliasesByCanonical.get(canonical)??new Set;contract.flag!==canonical&&bucket.add(contract.flag);for(const alias of contract.aliases??[])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);return aliases.length===0?contract:{...contract,aliases}})}function compactFlagAliasContracts(flagContracts){const withAliases=withFlagAliasMetadata(flagContracts),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}:{}}));function resolveExtensionCommandInheritedFlagContracts(options={}){return RESERVED_EXTENSION_HOST_FLAGS.filter(definition=>definition.extension_command_availability===void 0||definition.extension_command_availability==="read_output"&&options.readOutput===!0).map(definition=>{const valueName=definition.value_name??definition.discovery_value_name;return{flag:definition.flag,reservation_scope:"inherited",owner:"host",...definition.aliases?{aliases:[...definition.aliases]}:{},value_arity:valueName===void 0?"none":"required",...valueName===void 0?{}:{value_name:valueName}}})}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."}],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"}],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:!0},{flag:"--limit"},{flag:"--offset"}],LIST_FILTER_FLAG_CONTRACTS=withCursorSemantics([{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--status",list:!0},{flag:"--all",value_type:"boolean"},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{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:!0},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{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:!0},{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"])),AGGREGATE_FLAG_CONTRACTS=[{flag:"--group-by",list:!0},{flag:"--set-mode"},{flag:"--limit"},{flag:"--after"},{flag:"--count"},{flag:"--completion"},{flag:"--sum"},{flag:"--avg"},{flag:"--include-unparented"},{flag:"--include_unparented"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--assignee",list:!0},{flag:"--assignee-filter"},{flag:"--assignee_filter"},{flag:"--parent"},{flag:"--sprint",list:!0},{flag:"--release",list:!0}],COMMENTS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--comment","--body","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--expect-at"},{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:"--expect-at"},{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"}],LEARNINGS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--add",aliases:["--learning","--text"]},{flag:"--stdin"},{flag:"--file"},{flag:"--edit"},{flag:"--delete"},{flag:"--expect-at"},{flag:"--limit"},{flag:"--full-history"},{flag:"--if-absent",value_type:"boolean"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],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"}],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"}],HISTORY_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--limit"},{flag:"--order",value_name:"value",value_type:"string"},{flag:"--compact"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--diff"},{flag:"--field"},{flag:"--verify"},{flag:"--strict-exit"},{flag:"--fail-on-warn"},{flag:"--format"}],MERGE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--pre-commit-hook",value_type:"boolean"},{flag:"--stage",value_type:"boolean"},{flag:"--message"},{flag:"--force"},{flag:"--include-reconciled"},{flag:"--output"},{flag:"--item-path"},{flag:"--prefer"}],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"}],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"}],HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS=[{flag:"--event",repeatable:!0},{flag:"--all-actionable"},{flag:"--dry-run"},{flag:"--plan-fingerprint"},{flag:"--limit",value_type:"number"},{flag:"--attributed-author",aliases:["--attributed_author"]},{flag:"--reviewer"},{flag:"--reason"}],HISTORY_COMPACT_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--before"},{flag:"--ids",list:!0},{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"}],HISTORY_ATTEST_FLAG_CONTRACTS=[{flag:"--verify",value_name:"file",value_type:"string"},{flag:"--output",value_name:"file",value_type:"string"},{flag:"--hash-algorithm",value_name:"name",value_type:"string"}],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"}],PROFILE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--author"},{flag:"--force"}],PLAN_FLAG_CONTRACTS=[{flag:"--title"},{flag:"--description"},{flag:"--scope"},{flag:"--parent"},{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{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:!0},{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:!0},{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:!0},{flag:"--note",repeatable:!0},{flag:"--learning",repeatable:!0},{flag:"--reminder",repeatable:!0},{flag:"--event",repeatable:!0},{flag:"--type-option",aliases:["--type_option"],repeatable:!0},{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",values:PLAN_SHOW_DEPTH_VALUES},{flag:"--field"},{flag:"--fields",list:!0},{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"}],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"}],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"}],EXTENSION_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--init"},{flag:"--scaffold"},{flag:"--capability"},{flag:"--install"},{flag:"--uninstall"},{flag:"--explore"},{flag:"--list"},{flag:"--manage"},{flag:"--offline",value_type:"boolean"},{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"}],EXTENSION_SCOPE_FLAG_CONTRACTS=[{flag:"--project"},{flag:"--local"},{flag:"--global"}],EXTENSION_INIT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--capability"}],PACKAGE_FLAG_CONTRACTS=[...EXTENSION_FLAG_CONTRACTS,{flag:"--declarative"}],PACKAGE_INIT_FLAG_CONTRACTS=[...EXTENSION_INIT_FLAG_CONTRACTS,{flag:"--declarative"}],EXTENSION_INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],EXTENSION_UNINSTALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--markdown"},{flag:"--output"}],EXTENSION_ADOPT_ALL_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS=EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--dry-run"}],EXTENSION_MANAGE_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--offline",value_type:"boolean"},{flag:"--runtime-probe"},{flag:"--fix-managed-state"}],EXTENSION_RELOAD_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--watch"}],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"}],EXTENSION_CATALOG_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--fields",list:!0}],EXTENSION_ADOPT_FLAG_CONTRACTS=[...EXTENSION_SCOPE_FLAG_CONTRACTS,{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],INSTALL_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--project"},{flag:"--local"},{flag:"--global"},{flag:"--gh"},{flag:"--github"},{flag:"--ref"}],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"}],REINDEX_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--progress"}],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"}],CLOSE_MANY_FLAG_CONTRACTS=[{flag:"--filter-status",list:!0},{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"}],APPEND_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--body",short:"-b"},{flag:"--text"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],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"]}],RESTORE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],DELETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--dry-run"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],RELEASE_FLAG_CONTRACTS=[{flag:"--pause",value_type:"boolean"},{flag:"--handoff",value_name:"status"},{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],START_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],PAUSE_TASK_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--author",aliases:["--assignee"]},{flag:"--message"},{flag:"--force"}],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"}],SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS=[{flag:"--parent"},{flag:"--allow-missing-parent"},{flag:"--tags"},{flag:"--priority"},{flag:"--body"},{flag:"--description"},{flag:"--author"},{flag:"--message"}],MEET_FLAG_CONTRACTS=[{flag:"--start"},{flag:"--duration"},{flag:"--end"},{flag:"--location"},{flag:"--timezone"},{flag:"--all-day"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS],EVENT_FLAG_CONTRACTS=MEET_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS=[{flag:"--at"},{flag:"--text"},...SCHEDULING_SHORTCUT_COMMON_FLAG_CONTRACTS],TEST_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--id",value_name:"item-id"},{flag:"--add"},{flag:"--add-json"},{flag:"--remove"},{flag:"--remove-index",repeatable:!0},{flag:"--update"},{flag:"--update-index"},{flag:"--set-json"},{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:!0,description:"Record numeric measurement evidence; requires --run and an executed linked command."},{flag:"--metric-below"},{flag:"--metric-diff"},{flag:"--author"},{flag:"--message"},{flag:"--force"}],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"}],TELEMETRY_FLAG_CONTRACTS=[{flag:"--limit"}],TEST_RUNS_FLAG_CONTRACTS=[{flag:"--status"},{flag:"--limit"},{flag:"--stream"},{flag:"--tail"},{flag:"--force"},{flag:"--author"}],GC_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--scope"}],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"}],DUPLICATES_FLAG_CONTRACTS=[{flag:"--exhaustive",value_type:"boolean"},{flag:"--status",repeatable:!0,list:!0},{flag:"--since"},{flag:"--threshold"},{flag:"--limit"}],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"}],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"}],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"}],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"}],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"}],ITEM_CONTENT_METADATA_FLAG_CONTRACTS=[{short:"-p",flag:"--priority"},{flag:"--type"},{flag:"--tags",aliases:["--tag"],list:!0},{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"]}],CREATE_FLAG_CONTRACTS=[{flag:"--inherit-focus",value_type:"boolean",default:!0},{flag:"--no-inherit-focus",value_type:"boolean"},{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:!0},{flag:"--add-tags",aliases:["--add_tags"]},{short:"-b",flag:"--body",value_name:"value"},{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",repeatable:!0},{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"}],ITEM_MUTATE_FLAG_CONTRACTS=[{flag:"--transaction-id",value_name:"value"},{flag:"--stdin-json"},{flag:"--from",value_name:"path"},{flag:"--upsert-key",value_name:"field"},{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"}],ITEM_COMPLETE_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--transaction-id",value_name:"value",required:!0},{flag:"--reason",value_name:"value"},{flag:"--file",value_name:"value",repeatable:!0},{flag:"--doc",value_name:"value",repeatable:!0},{flag:"--test",value_name:"value",repeatable:!0},{flag:"--comment",value_name:"value",repeatable:!0},{flag:"--note",value_name:"value",repeatable:!0},{flag:"--learning",value_name:"value",repeatable:!0},{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"}],ITEM_REOPEN_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--status",value_name:"open|in_progress"},{flag:"--expected-result",value_name:"value",aliases:["--expected"]},{flag:"--message",value_name:"value"},{flag:"--force"},{flag:"--author",value_name:"value"}],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"}],FOCUS_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--clear"}],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",repeatable:!0},{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"}],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:!0},{flag:"--filter-type",list:!0},{flag:"--filter-tag",list:!0},{flag:"--filter-priority",list:!0},{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:!0},{flag:"--filter-assignee-filter"},{flag:"--filter-assignee_filter"},{flag:"--filter-parent"},{flag:"--filter-sprint",list:!0},{flag:"--filter-release",list:!0},{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",repeatable:!0},{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"}],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:"--after",cursor_semantics:"presentation"},{flag:"--format"}],ACTIVITY_FLAG_CONTRACTS=[{flag:"--id"},{flag:"--op"},{flag:"--author"},{flag:"--from"},{flag:"--to"},{flag:"--limit"},{flag:"--after",cursor_semantics:"presentation"},{flag:"--unbounded"},{flag:"--compact"},{flag:"--raw"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--stream"}],EVENTS_FLAG_CONTRACTS=[{flag:"--verify"},{flag:"--since"},{flag:"--type",repeatable:!0},{flag:"--author",repeatable:!0},{flag:"--item",repeatable:!0},{flag:"--limit",value_type:"number"},{flag:"--cursor-mode",value_name:"batch|row"},{flag:"--full"},{flag:"--provenance"},{flag:"--provenance-summary"},{flag:"--harness",repeatable:!0},{flag:"--agent-instance",repeatable:!0},{flag:"--provenance-filter",repeatable:!0},{flag:"--follow"},{flag:"--interval-ms",value_type:"number"}],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",values:CONTEXT_DEPTH_VALUES},{flag:"--fields",list:!0},{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"])),GET_FLAG_CONTRACTS=[{flag:"--id",value_name:"item-id"},{flag:"--for",value_name:"intent"},{flag:"--token-budget",aliases:["--token_budget"]},{flag:"--depth",values:GET_DEPTH_INPUT_VALUES},{flag:"--full",value_type:"boolean"},{flag:"--fields",list:!0},{flag:"--at"},{flag:"--tree"},{flag:"--tree-depth"},{flag:"--tree_depth"},{flag:"--format"}],GUIDE_FLAG_CONTRACTS=[{flag:"--list"},{flag:"--format"},{flag:"--depth"}],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:!0}],GRAPH_FLAG_CONTRACTS=[{flag:"--kind",list:!0},{flag:"--max-depth",description:`Maximum traversal depth; paths default to ${GRAPH_QUERY_DEFAULTS.path_depth}.`},{flag:"--limit",description:`Maximum rows per collection; default ${GRAPH_QUERY_DEFAULTS.rows}. Use --full to remove the row cap.`},{flag:"--after"},{flag:"--direction"},{flag:"--max-paths",description:`Maximum enumerated paths; default ${GRAPH_QUERY_DEFAULTS.paths}.`},{flag:"--sample",description:`Maximum evidence examples per audit finding; default ${GRAPH_QUERY_DEFAULTS.samples}.`},{flag:"--exempt-isolate",list:!0},{flag:"--exempt-isolate-type",list:!0},{flag:"--save-baseline"},{flag:"--rebuild"},{flag:"--clear"},{flag:"--summary"},{flag:"--full"}],EVAL_FLAG_CONTRACTS=[{flag:"--mode"},{flag:"--k"},{flag:"--fail-under"},{flag:"--queries"},{flag:"--format"}],WORKSPACE_FLAG_CONTRACTS=[{flag:"--dry-run"},{flag:"--force"},{flag:"--author"},{flag:"--message"}],WORKSPACE_POSITION_FLAG_CONTRACTS=[],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"]}],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:!0},{flag:"--format"},{flag:"--limit"},{flag:"--after"},{flag:"--status",list:!0},{flag:"--type",list:!0},{flag:"--tag",aliases:["--tags"],list:!0},{flag:"--priority",list:!0},{flag:"--deadline-before"},{flag:"--deadline-after"},{flag:"--updated-after"},{flag:"--updated-before"},{flag:"--created-after"},{flag:"--created-before"},{flag:"--assignee",list:!0},{flag:"--sprint",list:!0},{flag:"--release",list:!0},{flag:"--parent"},...GOVERNANCE_AND_CONTENT_FILTER_FLAG_CONTRACTS],new Set(["--highlight","--compact","--full","--fields","--format","--limit","--token-budget","--after"])),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"}],COMPLETION_FLAG_CONTRACTS=[{flag:"--eager-tags"}];function toUniqueFlagContracts(contracts){const seen=new Set,unique=[];for(const contract of contracts){const aliasKey=(contract.aliases??[]).join(","),key=`${contract.flag}|${contract.short??""}|${aliasKey}`;seen.has(key)||(seen.add(key),unique.push(contract))}return unique}function withSubcommandGlobalFlags(contracts,allowOutputFormatAlias=!1){const byCanonicalFlag=new Map;for(const contract of[...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,...contracts]){const canonicalFlag=normalizeFlagAliasKey(contract.flag),prior=byCanonicalFlag.get(canonicalFlag),{aliases:declaredAliases,...contractWithoutAliases}=contract,aliases=normalizeUniqueStringList([...declaredAliases??[],...contract.flag===canonicalFlag?[]:[contract.flag]]).filter(alias=>alias!==canonicalFlag),normalizedContract={...contractWithoutAliases,flag:canonicalFlag,...aliases.length>0?{aliases}:{}},mergedAliases=normalizeUniqueStringList([...prior?.aliases??[],...normalizedContract.aliases??[]]);byCanonicalFlag.set(canonicalFlag,prior===void 0?normalizedContract:{...prior,...normalizedContract,...mergedAliases.length>0?{aliases:mergedAliases}:{}})}if(allowOutputFormatAlias&&contracts.length>0&&!byCanonicalFlag.has("--format")){const encoding=byCanonicalFlag.get("--output-format");byCanonicalFlag.set("--output-format",{...encoding,aliases:[...encoding.aliases??[],"--format"]})}return withFlagAliasMetadata([...byCanonicalFlag.values()])}const FIXED_STATUS_LIST_COMMAND_ALIASES=["list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled"],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),ASSURANCE_FLAG_CONTRACT_INDEX=indexCliFlagContracts(ASSURANCE_FLAG_CONTRACTS),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(),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",[]],["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],["history-attest",HISTORY_ATTEST_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]]),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){return typeof commandName!="string"?"":resolvePmHistoryOperation(commandName.trim().toLowerCase())}function hasSubcommandFlagContractsForCommand(commandName){const normalized=normalizeCommandNameForContracts(commandName);if(SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.has(normalized))return!0;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){return lifecycleSubcommand==="init"||lifecycleSubcommand==="scaffold"?rootCommand==="extension"?EXTENSION_INIT_FLAG_CONTRACTS:PACKAGE_INIT_FLAG_CONTRACTS: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)return(rootCommand==="package"||rootCommand==="packages")&&lifecycleSubcommand==="upgrade"?withSubcommandGlobalFlags(UPGRADE_FLAG_CONTRACTS,!0):withSubcommandGlobalFlags(resolveExtensionLifecycleFlagContracts(rootCommand,lifecycleSubcommand),hasSubcommandFlagContractsForCommand(normalized));const contracts=SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND.get(normalized)??[];return withSubcommandGlobalFlags(contracts,hasSubcommandFlagContractsForCommand(normalized))}function toCompletionFlagString(flagContracts,includeGlobal=!0){const scoped=withFlagAliasMetadata(flagContracts).flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>!!value),all=includeGlobal?[...scoped,...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS.flatMap(entry=>[entry.short,entry.flag,...entry.aliases??[]]).filter(value=>!!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_ATTEST_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,resolveExtensionCommandInheritedFlagContracts,resolvePmPositionalActionFlagContracts,resolveSubcommandFlagContractsForCommand,toCompletionFlagString,toUniqueFlagContracts,withFlagAliasMetadata};
2
2
  //# sourceMappingURL=flag-contracts.js.map
@@ -1,3 +1,3 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="29c6ca01-4b1b-56fb-9bcc-5e1c26f17aff")}catch{}})();import{hasSubcommandFlagContractsForCommand,resolveSubcommandFlagContractsForCommand}from"./flag-contracts.js";import{PM_COMMAND_CAPABILITY_CONTRACTS}from"../agent-capability-contracts.js";import{PM_NAMESPACED_COMMAND_ALIASES,resolvePmCommandOperation}from"./command-aliases.js";import{enrichCliFlagInvocationContracts}from"../flag-invocation-contracts.js";let cachedPmFlagLexicon;const FULL_PROJECTION_CONCEPT_BY_COMMAND=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function resolvePmFlagSemanticConcept(command,flag){if(flag==="--limit")return"result-row-limit";if(flag==="--node-limit")return"graph-node-limit";if(flag==="--edge-limit")return"graph-edge-limit";if(flag==="--output-limit")return"rendered-output-row-limit";if(flag==="--output-budget")return"rendered-output-byte-budget";if(flag==="--token-budget")return"context-intent-token-budget";if(flag==="--full"){const concept=FULL_PROJECTION_CONCEPT_BY_COMMAND[resolvePmCommandOperation(command)];if(concept===void 0)throw new Error(`Command ${command} exposes --full without a registered projection concept.`);return concept}return flag!=="--file"?flag.slice(2):["create","update","update-many"].includes(resolvePmCommandOperation(command))?"linked-file-path":["comments","notes","learnings"].includes(resolvePmCommandOperation(command))?"entry-file-input":"plan-definition-file"}function listPmFlagLexicon(){if(cachedPmFlagLexicon!==void 0)return cachedPmFlagLexicon;const provisionalEntries=PM_COMMAND_CAPABILITY_CONTRACTS.filter(({command})=>hasSubcommandFlagContractsForCommand(command)).flatMap(({command,family})=>enrichCliFlagInvocationContracts(command,resolveSubcommandFlagContractsForCommand(command)).map(contract=>({command,family,concept:resolvePmFlagSemanticConcept(command,contract.flag),flag:contract.flag,aliases:Object.freeze([...contract.aliases??[]]),value_kind:contract.repeatable?"list":contract.flag==="--limit"?"number":contract.value_type}))),compatibilityAliasFlags=new Set(provisionalEntries.flatMap(entry=>entry.aliases.map(alias=>`${entry.command}:${alias}`))),canonicalEntries=provisionalEntries.filter(entry=>!compatibilityAliasFlags.has(`${entry.command}:${entry.flag}`)),kindsByConcept=new Map;for(const entry of canonicalEntries){const kinds=kindsByConcept.get(entry.concept)??new Set;kinds.add(entry.value_kind),kindsByConcept.set(entry.concept,kinds)}return cachedPmFlagLexicon=Object.freeze(canonicalEntries.map(entry=>Object.freeze({...entry,concept:kindsByConcept.get(entry.concept)?.size===1?entry.concept:`${entry.concept}@${entry.command}`}))),cachedPmFlagLexicon}function listPmFlagSpellingInventory(){return Object.freeze(listPmFlagLexicon().map(entry=>Object.freeze({command:entry.command,canonical_flag:entry.flag,accepted_spellings:Object.freeze([...new Set([entry.flag,...entry.aliases])].sort())})))}const LEGACY_COMMAND_FLAG_BUDGET_MAXIMUMS=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:111,test:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),SHARED_HOST_FLAG_GROWTH=1,PM_COMMAND_FLAG_BUDGET_MAXIMUMS=Object.freeze(Object.fromEntries(Object.entries({...LEGACY_COMMAND_FLAG_BUDGET_MAXIMUMS,...Object.fromEntries(PM_NAMESPACED_COMMAND_ALIASES.flatMap(({alias,canonical})=>{const maximum=LEGACY_COMMAND_FLAG_BUDGET_MAXIMUMS[alias];return maximum===void 0?[]:[[canonical,maximum]]}))}).map(([command,maximum])=>[command,maximum+SHARED_HOST_FLAG_GROWTH])));function listPmCommandFlagBudgets(){const currentByCommand=new Map(Object.keys(PM_COMMAND_FLAG_BUDGET_MAXIMUMS).map(command=>[command,0]));for(const{command}of listPmFlagLexicon())currentByCommand.set(command,Number(currentByCommand.get(command))+1);return Object.freeze(Object.entries(PM_COMMAND_FLAG_BUDGET_MAXIMUMS).map(([command,maximum])=>Object.freeze({command,current:Number(currentByCommand.get(command)),maximum})))}function appendAliasCollisionFindings(entries,canonicalOwners,findings){for(const entry of entries)for(const alias of entry.aliases){const owner=canonicalOwners.get(`${entry.command}:${alias}`);owner===void 0||owner.flag===entry.flag||findings.push({code:"alias_collision",command:entry.command,detail:`${alias} aliases ${entry.flag} but is canonical for ${owner.flag}.`})}}function appendBudgetFindings(counts,budgets,findings){const budgetedCommands=new Set(budgets.map(({command})=>command));for(const command of counts.keys())budgetedCommands.has(command)||findings.push({code:"missing_budget",command,detail:`${command} has canonical flags but no persisted budget.`});for(const budget of budgets){const actual=counts.get(budget.command)??0;actual===0&&findings.push({code:"stale_budget",command:budget.command,detail:`${budget.command} has a persisted budget but no canonical flags.`}),!(actual<=budget.maximum)&&findings.push({code:"budget_exceeded",command:budget.command,detail:`${actual} canonical flags exceed the ratcheted maximum ${budget.maximum}.`})}}function appendSpellingCompatibilityFindings(entries,baseline,findings){const current=new Map(entries.map(entry=>[`${entry.command}:${entry.flag}`,entry]));for(const historical of baseline){const key=`${historical.command}:${historical.canonical_flag}`,entry=current.get(key);if(!entry){findings.push({code:"removed_canonical_spelling",command:historical.command,detail:`${historical.canonical_flag} disappeared from the executable spelling inventory.`});continue}const accepted=new Set([entry.flag,...entry.aliases]);for(const spelling of historical.accepted_spellings)accepted.has(spelling)||findings.push({code:"removed_compatibility_spelling",command:historical.command,detail:`${spelling} no longer resolves to ${historical.canonical_flag}.`})}}function verifyPmFlagLexicon(entries=listPmFlagLexicon(),budgets=listPmCommandFlagBudgets(),baseline=[]){const findings=[],canonicalOwners=new Map,conceptKinds=new Map,conceptSpellings=new Map,counts=new Map;for(const entry of entries){const commandFlag=`${entry.command}:${entry.flag}`;canonicalOwners.has(commandFlag)?findings.push({code:"duplicate_canonical_flag",command:entry.command,detail:`${entry.flag} has more than one canonical row.`}):canonicalOwners.set(commandFlag,entry),counts.set(entry.command,(counts.get(entry.command)??0)+1);const priorKind=conceptKinds.get(entry.concept);priorKind!==void 0&&priorKind!==entry.value_kind?findings.push({code:"inconsistent_concept_kind",command:entry.command,detail:`${entry.concept} uses both ${priorKind} and ${entry.value_kind}.`}):conceptKinds.set(entry.concept,entry.value_kind);const priorSpelling=conceptSpellings.get(entry.concept);priorSpelling!==void 0&&priorSpelling!==entry.flag?findings.push({code:"semantic_spelling_collision",command:entry.command,detail:`${entry.concept} is canonicalized by both ${priorSpelling} and ${entry.flag}.`}):conceptSpellings.set(entry.concept,entry.flag)}return appendAliasCollisionFindings(entries,canonicalOwners,findings),appendBudgetFindings(counts,budgets,findings),appendSpellingCompatibilityFindings(entries,baseline,findings),findings.sort((left,right)=>left.command.localeCompare(right.command)||left.code.localeCompare(right.code)||left.detail.localeCompare(right.detail)),{ok:findings.length===0,entry_count:entries.length,budget_count:budgets.length,concept_count:new Set(entries.map(({concept})=>concept)).size,baseline_entry_count:baseline.length,findings}}function renderPmFlagLexiconMarkdown(){const lexicon=listPmFlagLexicon(),budgets=listPmCommandFlagBudgets(),familyByCommand=new Map(budgets.map(({command})=>[command,"unknown"]));for(const{command,family}of lexicon)familyByCommand.set(command,family);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...budgets.map(({command,current,maximum})=>{const family=familyByCommand.get(command);return`| \`${command}\` | ${family} | ${current} | ${maximum} |`}),""].join(`
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="41419a34-fcd7-5d1a-a427-4e9e634f9379")}catch{}})();import{hasSubcommandFlagContractsForCommand,resolveSubcommandFlagContractsForCommand}from"./flag-contracts.js";import{PM_COMMAND_CAPABILITY_CONTRACTS}from"../agent-capability-contracts.js";import{PM_NAMESPACED_COMMAND_ALIASES,resolvePmCommandOperation}from"./command-aliases.js";import{enrichCliFlagInvocationContracts}from"../flag-invocation-contracts.js";let cachedPmFlagLexicon;const FULL_PROJECTION_CONCEPT_BY_COMMAND=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function resolvePmFlagSemanticConcept(command,flag){if(flag==="--limit")return"result-row-limit";if(flag==="--node-limit")return"graph-node-limit";if(flag==="--edge-limit")return"graph-edge-limit";if(flag==="--output-limit")return"rendered-output-row-limit";if(flag==="--output-budget")return"rendered-output-byte-budget";if(flag==="--token-budget")return"context-intent-token-budget";if(flag==="--full"){const concept=FULL_PROJECTION_CONCEPT_BY_COMMAND[resolvePmCommandOperation(command)];if(concept===void 0)throw new Error(`Command ${command} exposes --full without a registered projection concept.`);return concept}return flag!=="--file"?flag.slice(2):["create","update","update-many"].includes(resolvePmCommandOperation(command))?"linked-file-path":["comments","notes","learnings"].includes(resolvePmCommandOperation(command))?"entry-file-input":"plan-definition-file"}function listPmFlagLexicon(){if(cachedPmFlagLexicon!==void 0)return cachedPmFlagLexicon;const provisionalEntries=PM_COMMAND_CAPABILITY_CONTRACTS.filter(({command})=>hasSubcommandFlagContractsForCommand(command)).flatMap(({command,family})=>enrichCliFlagInvocationContracts(command,resolveSubcommandFlagContractsForCommand(command)).map(contract=>({command,family,concept:resolvePmFlagSemanticConcept(command,contract.flag),flag:contract.flag,aliases:Object.freeze([...contract.aliases??[]]),value_kind:contract.repeatable?"list":contract.flag==="--limit"?"number":contract.value_type}))),compatibilityAliasFlags=new Set(provisionalEntries.flatMap(entry=>entry.aliases.map(alias=>`${entry.command}:${alias}`))),canonicalEntries=provisionalEntries.filter(entry=>!compatibilityAliasFlags.has(`${entry.command}:${entry.flag}`)),kindsByConcept=new Map;for(const entry of canonicalEntries){const kinds=kindsByConcept.get(entry.concept)??new Set;kinds.add(entry.value_kind),kindsByConcept.set(entry.concept,kinds)}return cachedPmFlagLexicon=Object.freeze(canonicalEntries.map(entry=>Object.freeze({...entry,concept:kindsByConcept.get(entry.concept)?.size===1?entry.concept:`${entry.concept}@${entry.command}`}))),cachedPmFlagLexicon}function listPmFlagSpellingInventory(){return Object.freeze(listPmFlagLexicon().map(entry=>Object.freeze({command:entry.command,canonical_flag:entry.flag,accepted_spellings:Object.freeze([...new Set([entry.flag,...entry.aliases])].sort())})))}const LEGACY_COMMAND_FLAG_BUDGET_MAXIMUMS=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:39,docs:30,deps:32,plan:111,test:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),SHARED_HOST_FLAG_GROWTH=1,PM_COMMAND_FLAG_BUDGET_MAXIMUMS=Object.freeze(Object.fromEntries(Object.entries({...LEGACY_COMMAND_FLAG_BUDGET_MAXIMUMS,...Object.fromEntries(PM_NAMESPACED_COMMAND_ALIASES.flatMap(({alias,canonical})=>{const maximum=LEGACY_COMMAND_FLAG_BUDGET_MAXIMUMS[alias];return maximum===void 0?[]:[[canonical,maximum]]}))}).map(([command,maximum])=>[command,maximum+SHARED_HOST_FLAG_GROWTH])));function listPmCommandFlagBudgets(){const currentByCommand=new Map(Object.keys(PM_COMMAND_FLAG_BUDGET_MAXIMUMS).map(command=>[command,0]));for(const{command}of listPmFlagLexicon())currentByCommand.set(command,Number(currentByCommand.get(command))+1);return Object.freeze(Object.entries(PM_COMMAND_FLAG_BUDGET_MAXIMUMS).map(([command,maximum])=>Object.freeze({command,current:Number(currentByCommand.get(command)),maximum})))}function appendAliasCollisionFindings(entries,canonicalOwners,findings){for(const entry of entries)for(const alias of entry.aliases){const owner=canonicalOwners.get(`${entry.command}:${alias}`);owner===void 0||owner.flag===entry.flag||findings.push({code:"alias_collision",command:entry.command,detail:`${alias} aliases ${entry.flag} but is canonical for ${owner.flag}.`})}}function appendBudgetFindings(counts,budgets,findings){const budgetedCommands=new Set(budgets.map(({command})=>command));for(const command of counts.keys())budgetedCommands.has(command)||findings.push({code:"missing_budget",command,detail:`${command} has canonical flags but no persisted budget.`});for(const budget of budgets){const actual=counts.get(budget.command)??0;actual===0&&findings.push({code:"stale_budget",command:budget.command,detail:`${budget.command} has a persisted budget but no canonical flags.`}),!(actual<=budget.maximum)&&findings.push({code:"budget_exceeded",command:budget.command,detail:`${actual} canonical flags exceed the ratcheted maximum ${budget.maximum}.`})}}function appendSpellingCompatibilityFindings(entries,baseline,findings){const current=new Map(entries.map(entry=>[`${entry.command}:${entry.flag}`,entry]));for(const historical of baseline){const key=`${historical.command}:${historical.canonical_flag}`,entry=current.get(key);if(!entry){findings.push({code:"removed_canonical_spelling",command:historical.command,detail:`${historical.canonical_flag} disappeared from the executable spelling inventory.`});continue}const accepted=new Set([entry.flag,...entry.aliases]);for(const spelling of historical.accepted_spellings)accepted.has(spelling)||findings.push({code:"removed_compatibility_spelling",command:historical.command,detail:`${spelling} no longer resolves to ${historical.canonical_flag}.`})}}function verifyPmFlagLexicon(entries=listPmFlagLexicon(),budgets=listPmCommandFlagBudgets(),baseline=[]){const findings=[],canonicalOwners=new Map,conceptKinds=new Map,conceptSpellings=new Map,counts=new Map;for(const entry of entries){const commandFlag=`${entry.command}:${entry.flag}`;canonicalOwners.has(commandFlag)?findings.push({code:"duplicate_canonical_flag",command:entry.command,detail:`${entry.flag} has more than one canonical row.`}):canonicalOwners.set(commandFlag,entry),counts.set(entry.command,(counts.get(entry.command)??0)+1);const priorKind=conceptKinds.get(entry.concept);priorKind!==void 0&&priorKind!==entry.value_kind?findings.push({code:"inconsistent_concept_kind",command:entry.command,detail:`${entry.concept} uses both ${priorKind} and ${entry.value_kind}.`}):conceptKinds.set(entry.concept,entry.value_kind);const priorSpelling=conceptSpellings.get(entry.concept);priorSpelling!==void 0&&priorSpelling!==entry.flag?findings.push({code:"semantic_spelling_collision",command:entry.command,detail:`${entry.concept} is canonicalized by both ${priorSpelling} and ${entry.flag}.`}):conceptSpellings.set(entry.concept,entry.flag)}return appendAliasCollisionFindings(entries,canonicalOwners,findings),appendBudgetFindings(counts,budgets,findings),appendSpellingCompatibilityFindings(entries,baseline,findings),findings.sort((left,right)=>left.command.localeCompare(right.command)||left.code.localeCompare(right.code)||left.detail.localeCompare(right.detail)),{ok:findings.length===0,entry_count:entries.length,budget_count:budgets.length,concept_count:new Set(entries.map(({concept})=>concept)).size,baseline_entry_count:baseline.length,findings}}function renderPmFlagLexiconMarkdown(){const lexicon=listPmFlagLexicon(),budgets=listPmCommandFlagBudgets(),familyByCommand=new Map(budgets.map(({command})=>[command,"unknown"]));for(const{command,family}of lexicon)familyByCommand.set(command,family);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...budgets.map(({command,current,maximum})=>{const family=familyByCommand.get(command);return`| \`${command}\` | ${family} | ${current} | ${maximum} |`}),""].join(`
2
2
  `)}export{listPmCommandFlagBudgets,listPmFlagLexicon,listPmFlagSpellingInventory,renderPmFlagLexiconMarkdown,resolvePmFlagSemanticConcept,verifyPmFlagLexicon};
3
3
  //# sourceMappingURL=flag-lexicon-contracts.js.map
@@ -37,6 +37,8 @@ visibility?:PmCommandVisibilityTier;
37
37
  flags:CliFlagContract[];
38
38
  positionals?:PmCommandPositionalContract["slots"];
39
39
  flag_invocations?:CliFlagInvocationContract[];
40
+ /** Host-owned flags an extension command accepts through `context.global`; present only for extension-provided commands (pm-gh1666). */
41
+ inherited_flags?:CliFlagContract[];
40
42
  provider?:"core" | "extension" | "mixed";
41
43
  extension_sources?:Array<{
42
44
  layer:"global" | "project";
@@ -305,6 +307,7 @@ name:string;
305
307
  }>;
306
308
  /** Preserve registered package metadata and combine handler, argument, and flag contributions by command path. */
307
309
  declare function collectExtensionCommandContracts(runtimeProbe:RuntimeExtensionActionProbe):ExtensionCommandContract[];
310
+ /** Name a flag's MCP tool property after the handler key, so a structured call reaches the handler under the key it reads (pm-gh1665). */
308
311
  declare function extensionSchemaPropertyNameFromFlag(flag:CliFlagContract):string | null;
309
312
  declare function buildExtensionActionSchemaBranch(contract:ExtensionCommandContract):Record<string,unknown>;
310
313
  declare function mergeExtensionContractsByAction(contracts:ExtensionCommandContract[]):ExtensionCommandContract[];
@@ -329,6 +332,8 @@ declare function normalizeCommandForRuntimeFieldFlags(command:string):string;
329
332
  declare function toRuntimeLongFlagToken(token:string):string | null;
330
333
  declare function toRuntimeShortFlagToken(token:string):string | null;
331
334
  declare function buildRuntimeFieldFlagContracts(fieldRegistry:RuntimeFieldRegistry):Map<string,CliFlagContract[]>;
335
+ /** Mark a package-declared flag as extension-owned and publish the `context.options` key its handler reads (pm-gh1665). */
336
+ declare function withExtensionFlagOwnership(contract:CliFlagContract):CliFlagContract;
332
337
  /** Build the executable alias projection from a command catalog and alias table. */
333
338
  export declare function buildCommandAliasSurface(commands:string[],aliasContracts?:readonly PmCommandAliasContract[]):CommandAliasSurface[];
334
339
  declare function attachCreateRequiredOptionContracts(schema:Record<string,unknown>,metadata:Record<string,unknown>):Record<string,unknown>;
@@ -356,6 +361,7 @@ collectExtensionCommandContracts:typeof collectExtensionCommandContracts;
356
361
  collectExtensionFlagContractsByCommand:typeof collectExtensionFlagContractsByCommand;
357
362
  extractActionBranches:typeof extractActionBranches;
358
363
  extensionSchemaPropertyNameFromFlag:typeof extensionSchemaPropertyNameFromFlag;
364
+ withExtensionFlagOwnership:typeof withExtensionFlagOwnership;
359
365
  filterSchemaByAction:typeof filterSchemaByAction;
360
366
  filterSchemaByActions:typeof filterSchemaByActions;
361
367
  isCoreCommandPath:typeof isCoreCommandPath;