@unbrained/pm-cli 2026.11.7 → 2026.11.9

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 (259) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +84 -48
  3. package/dist/cli/extension-command-help.js +4 -3
  4. package/dist/cli/help-json-payload.js +1 -1
  5. package/dist/cli/main.js +1 -1
  6. package/dist/cli/register-annotations.js +1 -1
  7. package/dist/cli/register-list-query.js +5 -5
  8. package/dist/cli/runtime/annotation-option-retry.js +2 -0
  9. package/dist/cli/runtime/invocation-options.js +1 -1
  10. package/dist/cli/runtime/projection-retry.js +1 -1
  11. package/dist/cli/runtime/read-output-mutation-retry.js +2 -0
  12. package/dist/cli-bundle/bundle-manifest.json +1 -1
  13. package/dist/cli-bundle/chunks/chunk-3BMIAI4P.js +8 -0
  14. package/dist/cli-bundle/chunks/chunk-5VRJPPUC.js +2 -0
  15. package/dist/cli-bundle/chunks/{chunk-WXVMPLBY.js → chunk-6V4PGJBZ.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-F3B2ULHB.js → chunk-ASJZMYKM.js} +33 -33
  17. package/dist/cli-bundle/chunks/chunk-BLUCQ4T4.js +2 -0
  18. package/dist/cli-bundle/chunks/chunk-ELNWRSGZ.js +9 -0
  19. package/dist/cli-bundle/chunks/{chunk-RFI4O6NU.js → chunk-EZRLW4R6.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-OJZG7Y6S.js → chunk-G6Q4VQSI.js} +2 -2
  21. package/dist/cli-bundle/chunks/chunk-GCPP37N6.js +116 -0
  22. package/dist/cli-bundle/chunks/{chunk-OIBSKKCO.js → chunk-GDQ2T2OR.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-KPAVZILX.js → chunk-GZVOOHTO.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-3DI6CEF3.js → chunk-IGT252ES.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-JK7O7MFO.js +31 -0
  26. package/dist/cli-bundle/chunks/{chunk-MQOZNGPS.js → chunk-JYQXIC6C.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-XSEDESNW.js → chunk-LVDFPGD7.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-QG6FLDM4.js → chunk-MSJ7IHMJ.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-BQ5O3CBF.js → chunk-O2M3TNFY.js} +69 -65
  30. package/dist/cli-bundle/chunks/chunk-UFIM5ZC5.js +6 -0
  31. package/dist/cli-bundle/chunks/chunk-VATZTJE3.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-WS2N4TQW.js → chunk-XKY4LUXN.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-VM6OGNQC.js → chunk-YK5GAWOT.js} +2 -2
  34. package/dist/cli-bundle/chunks/{chunk-TGQPCNAD.js → chunk-YV5ALMG2.js} +2 -2
  35. package/dist/cli-bundle/chunks/{chunk-ETHAZC3F.js → chunk-Z3QEEOAM.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-revision-Y5CE3EIN.js +2 -0
  37. package/dist/cli-bundle/chunks/item-transaction-XBIN4KYM.js +2 -0
  38. package/dist/cli-bundle/chunks/{mutation-admission-LUXUKISJ.js → mutation-admission-TAQN2AKK.js} +2 -2
  39. package/dist/cli-bundle/chunks/register-list-query-XMQYFUFI.js +11 -0
  40. package/dist/cli-bundle/chunks/register-mutation-OBVCFLDK.js +20 -0
  41. package/dist/cli-bundle/chunks/{register-operations-AHDWE2G3.js → register-operations-CGNFZ6DR.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-setup-7BGG3CI3.js → register-setup-LFB5ERXH.js} +2 -2
  43. package/dist/cli-bundle/chunks/{stage-S5BYWLGY.js → stage-NQHF6JPC.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-2SQUWQP3.js +26 -0
  45. package/dist/cli-bundle/focused-chunks/chunk-4FWMXQN3.js +12 -0
  46. package/dist/cli-bundle/focused-chunks/chunk-AH5IST3V.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-4EXRRSDS.js → chunk-ALLOWZSH.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-IYJRFJHT.js → chunk-C3DO4ZGZ.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-CUGJ2DY2.js +24 -0
  50. package/dist/cli-bundle/focused-chunks/chunk-HLQOGAWG.js +26 -0
  51. package/dist/cli-bundle/focused-chunks/chunk-HNFY3XLC.js +2 -0
  52. package/dist/cli-bundle/focused-chunks/chunk-IB6TCE7N.js +2 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-LW4TN5ZM.js → chunk-IS5FLEZW.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-J7PWHKZK.js +91 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-JU62TKJP.js +82 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-LDMBNTOG.js +2 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-LWMPQRJT.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-MYBKRV5R.js +2 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-NUFO3OR6.js +44 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-NZQYHPUN.js +3 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-JRJOFMI7.js → chunk-Q45LDP7P.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/chunk-QWUWNFQO.js +2 -0
  63. package/dist/cli-bundle/focused-chunks/chunk-RNZUORGI.js +2 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-G2VIY6XA.js → chunk-UIKLNSW3.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-BIDF4KO7.js → chunk-XLSTFUXM.js} +8 -8
  66. package/dist/cli-bundle/focused-chunks/item-revision-M6FOLME2.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/item-transaction-H6VA5JGB.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/mutation-admission-PRTQWQK6.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/stage-7T77PSJD.js +2 -0
  70. package/dist/cli-bundle/main.js +32 -31
  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 +13 -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 +17 -1
  92. package/dist/core/output/output.js +7 -7
  93. package/dist/core/search/corpus.js +1 -1
  94. package/dist/core/search/providers.d.ts +3 -2
  95. package/dist/core/search/providers.js +1 -1
  96. package/dist/core/search/vector-stores.d.ts +3 -2
  97. package/dist/core/search/vector-stores.js +1 -1
  98. package/dist/core/sentry/instrument.d.ts +2 -1
  99. package/dist/core/sentry/instrument.js +1 -1
  100. package/dist/mcp/tool-definitions.js +1 -1
  101. package/dist/sdk/annotations.d.ts +44 -1
  102. package/dist/sdk/annotations.js +1 -1
  103. package/dist/sdk/authoring.d.ts +6 -0
  104. package/dist/sdk/authoring.js +1 -1
  105. package/dist/sdk/cli-contracts/flag-contracts.d.ts +15 -0
  106. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  107. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  108. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -0
  109. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  110. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  111. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  112. package/dist/sdk/command-line.d.ts +2 -1
  113. package/dist/sdk/command-line.js +1 -1
  114. package/dist/sdk/comments.d.ts +4 -2
  115. package/dist/sdk/comments.js +1 -1
  116. package/dist/sdk/completion/bash.js +1 -1
  117. package/dist/sdk/completion/fish.js +2 -1
  118. package/dist/sdk/completion/zsh.js +4 -1
  119. package/dist/sdk/context-intent-contracts.d.ts +5 -1
  120. package/dist/sdk/context-intent-contracts.js +1 -1
  121. package/dist/sdk/contracts.d.ts +3 -0
  122. package/dist/sdk/contracts.js +1 -1
  123. package/dist/sdk/core.d.ts +14 -0
  124. package/dist/sdk/core.js +1 -1
  125. package/dist/sdk/corpus-shape.d.ts +2 -2
  126. package/dist/sdk/corpus-shape.js +1 -1
  127. package/dist/sdk/define.d.ts +14 -8
  128. package/dist/sdk/define.js +1 -1
  129. package/dist/sdk/extension/command-options.d.ts +123 -0
  130. package/dist/sdk/extension/command-options.js +2 -0
  131. package/dist/sdk/extension-contracts.d.ts +1 -2
  132. package/dist/sdk/extension-contracts.js +1 -1
  133. package/dist/sdk/generated/error-code-catalog-rows.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/item-revision.d.ts +6 -0
  145. package/dist/sdk/lifecycle/item-revision.js +1 -1
  146. package/dist/sdk/lifecycle/restore.d.ts +1 -1
  147. package/dist/sdk/merge.d.ts +3 -0
  148. package/dist/sdk/merge.js +1 -1
  149. package/dist/sdk/notes.d.ts +4 -2
  150. package/dist/sdk/notes.js +1 -1
  151. package/dist/sdk/public-surface.json +1 -1
  152. package/dist/sdk/query/get-facet-roots.js +2 -0
  153. package/dist/sdk/query/get.js +1 -1
  154. package/dist/sdk/query/list.d.ts +5 -1
  155. package/dist/sdk/query/list.js +1 -1
  156. package/dist/sdk/query/search/semantic.d.ts +11 -3
  157. package/dist/sdk/query/search/semantic.js +1 -1
  158. package/dist/sdk/query/search-rendering.d.ts +9 -3
  159. package/dist/sdk/query/search-rendering.js +1 -1
  160. package/dist/sdk/query.d.ts +11 -0
  161. package/dist/sdk/query.js +1 -1
  162. package/dist/sdk/read-output/continuation.d.ts +8 -0
  163. package/dist/sdk/read-output/continuation.js +1 -1
  164. package/dist/sdk/read-output/options.d.ts +1 -1
  165. package/dist/sdk/read-output/options.js +1 -1
  166. package/dist/sdk/read-output/positional-rows.js +2 -0
  167. package/dist/sdk/read-output/surfaces.js +1 -1
  168. package/dist/sdk/read-output/tail-retention.d.ts +34 -0
  169. package/dist/sdk/read-output/tail-retention.js +2 -0
  170. package/dist/sdk/read-output-budget.d.ts +14 -2
  171. package/dist/sdk/read-output-budget.js +1 -1
  172. package/dist/sdk/read-output-contracts.d.ts +24 -4
  173. package/dist/sdk/read-output-contracts.js +1 -1
  174. package/dist/sdk/read-output-rows.d.ts +7 -3
  175. package/dist/sdk/read-output-rows.js +1 -1
  176. package/dist/sdk/runtime/actions.js +1 -1
  177. package/dist/sdk/runtime-input.js +1 -1
  178. package/dist/sdk/runtime.d.ts +26 -3
  179. package/dist/sdk/runtime.js +1 -1
  180. package/dist/sdk/test/execution.d.ts +29 -2
  181. package/dist/sdk/test/execution.js +1 -1
  182. package/dist/sdk/testing.d.ts +14 -1
  183. package/dist/sdk/testing.js +1 -1
  184. package/dist/sdk/traceability/source-traceability.d.ts +4 -1
  185. package/dist/sdk/traceability/source-traceability.js +1 -1
  186. package/dist/sdk/workspace-recipe.d.ts +2 -2
  187. package/dist/sdk/workspace-recipe.js +1 -1
  188. package/docs/AGENT_OUTPUT_ENCODINGS.md +16 -0
  189. package/docs/ARCHITECTURE.md +2 -1
  190. package/docs/COMMANDS.md +4 -1
  191. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +1 -1
  192. package/docs/EXTENSIONS.md +1 -1
  193. package/docs/MCP_OPTION_CONFORMANCE.md +13 -0
  194. package/docs/README.md +2 -2
  195. package/docs/READ_OUTPUT_CONTRACTS.md +99 -0
  196. package/docs/RELEASING.md +27 -5
  197. package/docs/SDK.md +100 -2
  198. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  199. package/docs/agent-task-token-baseline.json +1 -1
  200. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  201. package/marketplace.json +1 -1
  202. package/package.json +3 -1
  203. package/packages/pm-beads/package.json +1 -1
  204. package/packages/pm-calendar/package.json +1 -1
  205. package/packages/pm-command-kit/package.json +1 -1
  206. package/packages/pm-digital-twin/package.json +1 -1
  207. package/packages/pm-governance-audit/package.json +1 -1
  208. package/packages/pm-guide-shell/package.json +1 -1
  209. package/packages/pm-kanban/package.json +1 -1
  210. package/packages/pm-lifecycle-hooks/package.json +1 -1
  211. package/packages/pm-linked-test-adapters/package.json +1 -1
  212. package/packages/pm-search-advanced/package.json +1 -1
  213. package/packages/pm-templates/package.json +1 -1
  214. package/packages/pm-todos/package.json +1 -1
  215. package/packages/pm-vcs/package.json +1 -1
  216. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  217. package/plugins/pm-claude/package.json +1 -1
  218. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  219. package/plugins/pm-codex/package.json +1 -1
  220. package/plugins/pm-codex/plugin.json +1 -1
  221. package/runtime-dependencies.json +1 -1
  222. package/dist/cli/extension-command-options.js +0 -2
  223. package/dist/cli-bundle/chunks/chunk-4PPWVIIT.js +0 -2
  224. package/dist/cli-bundle/chunks/chunk-5KHLV7JU.js +0 -116
  225. package/dist/cli-bundle/chunks/chunk-COKKWMSC.js +0 -8
  226. package/dist/cli-bundle/chunks/chunk-D53G3NOE.js +0 -6
  227. package/dist/cli-bundle/chunks/chunk-JZWFZH2K.js +0 -2
  228. package/dist/cli-bundle/chunks/chunk-O6TIOKCM.js +0 -9
  229. package/dist/cli-bundle/chunks/chunk-WYIDX67P.js +0 -31
  230. package/dist/cli-bundle/chunks/item-revision-SPEKTFBB.js +0 -2
  231. package/dist/cli-bundle/chunks/item-transaction-BT55TQXE.js +0 -2
  232. package/dist/cli-bundle/chunks/register-list-query-DU4W7VJU.js +0 -11
  233. package/dist/cli-bundle/chunks/register-mutation-IC2C53QK.js +0 -20
  234. package/dist/cli-bundle/focused-chunks/chunk-4LDOL6U7.js +0 -26
  235. package/dist/cli-bundle/focused-chunks/chunk-4PW5XWVI.js +0 -2
  236. package/dist/cli-bundle/focused-chunks/chunk-A46YSPRF.js +0 -2
  237. package/dist/cli-bundle/focused-chunks/chunk-AI2PYNFI.js +0 -2
  238. package/dist/cli-bundle/focused-chunks/chunk-AJ2I377F.js +0 -44
  239. package/dist/cli-bundle/focused-chunks/chunk-CWFNQQZE.js +0 -3
  240. package/dist/cli-bundle/focused-chunks/chunk-D3U7FOZR.js +0 -2
  241. package/dist/cli-bundle/focused-chunks/chunk-GFF6BITP.js +0 -2
  242. package/dist/cli-bundle/focused-chunks/chunk-IIBWXNW3.js +0 -3
  243. package/dist/cli-bundle/focused-chunks/chunk-J5N42SKC.js +0 -3
  244. package/dist/cli-bundle/focused-chunks/chunk-KL33JMPC.js +0 -2
  245. package/dist/cli-bundle/focused-chunks/chunk-LH4C7BLB.js +0 -2
  246. package/dist/cli-bundle/focused-chunks/chunk-LTQEYE2L.js +0 -81
  247. package/dist/cli-bundle/focused-chunks/chunk-LTTMERPN.js +0 -12
  248. package/dist/cli-bundle/focused-chunks/chunk-MESFDQ3H.js +0 -26
  249. package/dist/cli-bundle/focused-chunks/chunk-MWTBAI3V.js +0 -2
  250. package/dist/cli-bundle/focused-chunks/chunk-TWULNB3N.js +0 -2
  251. package/dist/cli-bundle/focused-chunks/chunk-XAC6NP7U.js +0 -2
  252. package/dist/cli-bundle/focused-chunks/chunk-XG3TBYQK.js +0 -23
  253. package/dist/cli-bundle/focused-chunks/chunk-XMZAFKVP.js +0 -91
  254. package/dist/cli-bundle/focused-chunks/item-revision-ELI6NGMY.js +0 -2
  255. package/dist/cli-bundle/focused-chunks/item-transaction-GUGAUY77.js +0 -2
  256. package/dist/cli-bundle/focused-chunks/mutation-admission-54FI37AA.js +0 -2
  257. package/dist/cli-bundle/focused-chunks/stage-OHDJ43T2.js +0 -2
  258. package/docs/ECOSYSTEM_PLANNING_REVIEW.md +0 -274
  259. 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]="d0f3cb59-fe77-5333-83f6-11247bf91e2a")}catch{}})();import{normalizeUniqueStringList}from"./string-lists.js";import{PM_EXPECT_HASH_ACTIONS,PM_TOOL_ACTIONS}from"./enum-contracts.js";import{TOOL_CREATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS}from"./tool-option-contracts.js";import{PM_TOOL_PARAMETER_PROPERTIES as BASE_TOOL_PARAMETER_PROPERTIES,PM_TOOL_PARAMETER_METADATA as BASE_TOOL_PARAMETER_METADATA,PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES as BASE_ACTION_SCOPED_PARAMETER_PROPERTIES,PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA,PLAN_ACTION_PARAMETER_PROPERTIES,PLAN_ACTION_PARAMETER_METADATA}from"./tool-parameter-tables.js";import{toUniqueFlagContracts,withFlagAliasMetadata}from"./flag-contracts.js";import{resolveReadOutputSurface}from"../read-output-contracts.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS}from"./commander-mutation-options.js";const PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES={...BASE_ACTION_SCOPED_PARAMETER_PROPERTIES,"history-attest":{verify:{type:"object",additionalProperties:!0},output:{not:{}}}},PM_TOOL_PARAMETER_PROPERTIES={...BASE_TOOL_PARAMETER_PROPERTIES,pause:{type:"boolean"},handoff:{type:"string"},releaseAssignment:{type:"boolean"},hashAlgorithm:{type:"string",enum:["sha256","sha512"]}},PM_TOOL_PARAMETER_METADATA={...BASE_TOOL_PARAMETER_METADATA,pause:{description:"Return work to its configured open status before releasing ownership."},handoff:{description:"Release into a configured non-terminal queue with a required evidence message."},releaseAssignment:{description:"Release assignment after recording closure evidence."},hashAlgorithm:{description:"Digest for detached history bundles; defaults to sha256."}},PM_TOOL_GLOBAL_PARAMETER_KEYS=["json","quiet","profile","noExtensions","noPager","tokenAccounting","path","pmExecutable","timeoutMs"],PM_TOOL_READ_OUTPUT_PARAMETER_KEYS=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor","outputRowContract"],PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES=new Set(["action","cwd","options",...Object.keys(PM_TOOL_PARAMETER_PROPERTIES).filter(property=>property!=="severity")]);function resolvePmToolCustomFieldCollision(field){const normalized=field.trim().toLowerCase();let property="";for(let index=0;index<normalized.length;index+=1){const character=normalized[index];if(character!=="-"&&character!=="_"){property+=character;continue}let nextIndex=index+1;for(;normalized[nextIndex]==="-"||normalized[nextIndex]==="_";)nextIndex+=1;const nextCharacter=normalized[nextIndex];if(nextCharacter!==void 0&&(nextCharacter>="a"&&nextCharacter<="z"||nextCharacter>="0"&&nextCharacter<="9")){property+=nextCharacter.toUpperCase(),index=nextIndex;continue}property+=normalized.slice(index,nextIndex),index=nextIndex-1}return PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES.has(property)?{field,property,owner:"mcp_tool_input",nested_path:property==="expectHash"?`options.field (${field}=<value>)`:`options.${property}`}:void 0}const PM_TOOL_ACTION_MUTATION_PARAMETER_KEYS={create:["fullChangedFields","idOnly"],copy:["fullChangedFields","idOnly"],update:["fullChangedFields","idOnly"],"item-reopen":["fullChangedFields","idOnly"],close:["fullChangedFields","idOnly"],claim:["fullChangedFields","idOnly"],release:["fullChangedFields","idOnly"],"start-task":["fullChangedFields","idOnly"],"pause-task":["fullChangedFields","idOnly"],"close-task":["fullChangedFields","idOnly"],restore:["fullChangedFields","idOnly"],append:["fullChangedFields"],"update-many":["fullChangedFields"],"close-many":["fullChangedFields"],assurance:["fullChangedFields","idOnly"]},PLAN_CREATE_METADATA_PARAMETER_KEYS=["createMode","status","deadline","estimate","acceptanceCriteria","definitionOfReady","order","rank","goal","objective","value","impact","outcome","whyNow","assignee","reviewer","risk","confidence","sprint","release","blockedReason","unblockNote","reporter","severity","environment","reproSteps","resolution","expectedResult","actualResult","affectedVersion","fixedVersion","component","regression","customerImpact","comment","note","learning","reminder","event","typeOption"],PM_TOOL_ACTION_NESTED_OPTION_COMPATIBILITY_KEYS=Object.freeze({"close-many":["list","expected_result","expected","actual_result","actual","validate_close","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],"update-many":["list","update","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],...Object.fromEntries(PM_TOOL_ACTIONS.filter(action=>action==="upgrade"||action==="install"||action==="extension"||action==="package"||action.startsWith("extension-")||action.startsWith("package-")).map(action=>[action,["project","local","global"]]))});function toSchemaKeyList(values){return normalizeUniqueStringList(values)}const CREATE_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_CREATE_OPTION_CONTRACTS.map(entry=>entry.param),...TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS.map(entry=>entry.param)]),UPDATE_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_UPDATE_OPTION_CONTRACTS.map(entry=>entry.param),...TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS.map(entry=>entry.param),"force"]),UPDATE_MANY_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS.map(entry=>entry.param),...UPDATE_CONTRACT_PARAMETER_KEYS.filter(key=>key!=="allowMissingParent"&&key!=="completedAt"),"dryRun","rollback","noCheckpoint"]),CLOSE_MANY_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS.map(entry=>entry.param),"reason","completedAt","resolution","expectedResult","actualResult","validateClose","dryRun","rollback","noCheckpoint","author","message","force"]),CONTEXT_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_CONTEXT_OPTION_CONTRACTS.map(entry=>entry.param),"past","section"]),ACTIVITY_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_ACTIVITY_OPTION_CONTRACTS.map(entry=>entry.param),"stream"]),LIST_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_LIST_FILTER_OPTION_CONTRACTS.map(entry=>entry.param),"all","includeBody","noTruncate","strictRead","compact","brief","full"]),FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS=LIST_CONTRACT_PARAMETER_KEYS.filter(parameter=>parameter!=="all"&&parameter!=="status"),LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS=[[{property:"today",schema:{const:!0}},{property:"recent",schema:{const:!0}}],[{property:"today",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}],[{property:"recent",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}]],CONTRACTS_PROJECTION_MUTUALLY_EXCLUSIVE_GROUPS=[[{property:"summary",schema:{const:!0}},{property:"schemaOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"flagsOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}]],AGGREGATE_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_AGGREGATE_OPTION_CONTRACTS.map(entry=>entry.param),"count","completion","includeUnparented"]),SEARCH_CONTRACT_PARAMETER_KEYS=toSchemaKeyList(["query","keywords","mode","semantic","hybrid","includeLinked","titleExact","phraseExact","highlight","compact","full",...TOOL_SEARCH_FILTER_OPTION_CONTRACTS.map(entry=>entry.param)]),NEXT_CONTRACT_PARAMETER_KEYS=toSchemaKeyList(["type","tag","priority","assignee","assigneeFilter","sprint","release","parent","limit","blockedLimit","readyOnly","format","includeDecisions","includeGates","includeContainers","tokenBudget","explainRanking"]),AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS=["author","message","force"],CLOSE_ACTION_OPTION_KEYS=["releaseAssignment","text","reason","closeReason","completedAt","duplicateOf","validateClose","resolution","expectedResult","actualResult"],LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS=["author","assignee","message","force"],MANAGED_EXTENSION_PACKAGE_OPTION_KEYS=["dryRun","target","scope","capability","declarative","github","ref","init","install","uninstall","explore","manage","offline","describe","markdown","output","reload","doctor","catalog","list","adopt","adoptAll","activate","deactivate","runtimeProbe","fixManagedState","isolated","ignoreGlobal","detail","trace","watch","strictExit","failOnWarn"];function managedLifecycleSchemaContracts(prefix){return{[`${prefix}-init`]:{required:["target"],optional:["scope","capability",...prefix==="package"?["declarative"]:[]]},[`${prefix}-install`]:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},[`${prefix}-uninstall`]:{required:["target"],optional:["scope"]},[`${prefix}-explore`]:{optional:["scope"]},[`${prefix}-manage`]:{optional:["scope","runtimeProbe","fixManagedState","offline"]},[`${prefix}-describe`]:{optional:["target","scope","markdown","output"]},[`${prefix}-reload`]:{optional:["scope","watch"]},[`${prefix}-doctor`]:{optional:["scope","detail","trace","fixManagedState","isolated","ignoreGlobal","strictExit","failOnWarn"]},[`${prefix}-catalog`]:{optional:["scope","fields"]},[`${prefix}-adopt`]:{required:["target"],optional:["scope","github","ref"]},[`${prefix}-adopt-all`]:{optional:["scope"]},[`${prefix}-activate`]:{required:["target"],optional:["scope"]},[`${prefix}-deactivate`]:{required:["target"],optional:["scope"]},[prefix]:{optional:MANAGED_EXTENSION_PACKAGE_OPTION_KEYS,dependentAnyOfRequired:[{property:"dryRun",value:!0,anyOfRequired:[["install","target"],["install","github"]]}],mutuallyExclusiveWhen:[[{property:"dryRun",schema:{const:!0}},{property:"install",schema:{const:!1}}]]}}}const SCHEDULING_ACTION_SCHEMA_CONTRACT={required:["title"],optional:["start","duration","end","location","timezone","allDay","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},UPGRADE_ACTION_SCHEMA_CONTRACT={optional:["target","scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"]},PM_TOOL_ACTION_SCHEMA_CONTRACTS={init:{optional:["prefix","idPrefix","workspace","preset","typePreset","defaults","author","agentGuidance","withPackages","mergeFence","force","verbose"]},config:{required:["scope","configAction"],optional:["key","value","criterion","clearCriteria","format","policy"]},...managedLifecycleSchemaContracts("extension"),...managedLifecycleSchemaContracts("package"),"package-upgrade":UPGRADE_ACTION_SCHEMA_CONTRACT,install:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},upgrade:UPGRADE_ACTION_SCHEMA_CONTRACT,create:{required:["title","description","type","status","priority","message"],optional:CREATE_CONTRACT_PARAMETER_KEYS},copy:{required:["id"],optional:["title","author","message","allowDuplicate"]},focus:{optional:["id","clear"],mutuallyExclusive:[["id","clear"]]},list:{optional:LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-all":{optional:LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-draft":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-open":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-in-progress":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-blocked":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-closed":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-canceled":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},aggregate:{optional:AGGREGATE_CONTRACT_PARAMETER_KEYS},guide:{optional:["list","format","depth"]},context:{optional:CONTEXT_CONTRACT_PARAMETER_KEYS},ctx:{optional:CONTEXT_CONTRACT_PARAMETER_KEYS},get:{required:["id"],optional:["for","tokenBudget","at","depth","full","fields","tree","treeDepth","format"]},search:{optional:SEARCH_CONTRACT_PARAMETER_KEYS,anyOfRequired:[["query"],["keywords"]]},eval:{optional:["mode","k","failUnder","queries","format"]},events:{optional:["verify","since","type","author","item","limit","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","cursorMode"]},merge:{required:["subcommand"],optional:["dryRun","preCommitHook","stage","author","message","force","includeReconciled","artifact","basePath","oursPath","theirsPath","output","outputPath","itemPath","prefer"]},workspace:{required:["subcommand"],optional:["snapshotAction","name","target","dryRun","force","author","message","lockTtlSeconds","lockWaitMs"],conditionalRequired:[{property:"subcommand",value:"snapshot",required:["snapshotAction"]}]},meet:SCHEDULING_ACTION_SCHEMA_CONTRACT,event:SCHEDULING_ACTION_SCHEMA_CONTRACT,remind:{required:["title"],optional:["at","text","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},next:{optional:[...NEXT_CONTRACT_PARAMETER_KEYS,"for"]},reindex:{optional:["mode","progress"]},history:{required:["id"],optional:["limit","order","compact","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","diff","verify","field","strictExit","failOnWarn","format"]},"history-attest":{optional:["verify","output","hashAlgorithm"],mutuallyExclusive:[["verify","hashAlgorithm"]]},"history-redact":{required:["id"],optional:["literal","regex","replacement","dryRun",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],anyOfRequired:[["literal"],["regex"]]},"history-repair":{optional:["id","all","dryRun","normalizeProvenance","salvageTail",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],oneOfRequired:[["id"],["all"]],mutuallyExclusiveWhen:[[{property:"salvageTail",schema:{const:!0}},{property:"all",schema:{const:!0}}],[{property:"salvageTail",schema:{const:!0}},{property:"normalizeProvenance",schema:{const:!0}}]]},"history-author-acknowledge":{optional:["historyEvent","allActionable","dryRun","planFingerprint","limit","attributedAuthor","reviewer","reason"],oneOfRequired:[["historyEvent"],["allActionable"]]},"history-compact":{optional:["id","before","ids","allOver","closed","allStreams","minEntries","dryRun",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},schema:{mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"policy-mode"}},{property:"name",schema:{not:{enum:["advise","refuse"]}}}]],required:["subcommand"],optional:["definition","policy","message","name","description","defaultStatus","folder","alias","role","order","fieldType","commands","cliFlag","required","requiredOnCreate","allowUnset","requiredTypes","typePreset","infer","minCount","apply","to","migrationId","fieldTypeScope","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"policy-put",required:["definition"]},{property:"subcommand",value:"policy-remove",required:["name"]},{property:"subcommand",value:"policy-mode",required:["name"]},{property:"subcommand",value:"policy-check",required:["name"]},{property:"subcommand",value:"policy-approve",required:["name","policy"]},{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"show-status",required:["name"]},{property:"subcommand",value:"add-type",required:["name"]},{property:"subcommand",value:"remove-type",required:["name"]},{property:"subcommand",value:"add-status",required:["name"]},{property:"subcommand",value:"remove-status",required:["name"]},{property:"subcommand",value:"add-field",required:["name"]},{property:"subcommand",value:"remove-field",required:["name"]},{property:"subcommand",value:"show-field",required:["name"]},{property:"subcommand",value:"rename-type",required:["name","to"]},{property:"subcommand",value:"rename-field",required:["name","to"]},{property:"subcommand",value:"remap-status",required:["name","to"]},{property:"subcommand",value:"apply-preset",required:["typePreset"]}]},profile:{required:["subcommand"],optional:["name","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"apply",required:["name"]},{property:"subcommand",value:"lint",required:["name"]}]},plan:{required:["subcommand"],optional:["id","stepRef","reorderTo","title","description","template","scope","parent","inheritFocus","related","blocks","blockedBy","harness","mode","resumeContext","tags","priority",...PLAN_CREATE_METADATA_PARAMETER_KEYS,"body","claim","fromSearch","stepTitle","step","stepBody","stepOwner","stepStatus","stepEvidence","stepBlockedReason","stepReplacement","dependsOn","link","linkKind","linkNote","promoteToItemDep","allowMultipleActive","file","test","doc","decisionText","decision","decisionRationale","decisionEvidence","discoveryText","discovery","validationText","validation","validationCommand","validationExpected","depth","fields","steps","materializeType","materializeParent","materializeTags","field",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},activity:{optional:ACTIVITY_CONTRACT_PARAMETER_KEYS},restore:{required:["id","target"],optional:AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},update:{required:["id"],optional:UPDATE_CONTRACT_PARAMETER_KEYS,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},"update-many":{optional:UPDATE_MANY_CONTRACT_PARAMETER_KEYS,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},close:{required:["id"],optional:[...CLOSE_ACTION_OPTION_KEYS,...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},"close-many":{optional:CLOSE_MANY_CONTRACT_PARAMETER_KEYS},delete:{required:["id"],optional:["dryRun",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},append:{required:["id","body"],optional:AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},comments:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"]]},notes:{required:["id"],optional:["text","add","addJson","stdin","edit","delete","limit","since","eventType","includeMeta","full","ifAbsent",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],mutuallyExclusive:[["addJson","add"],["addJson","stdin"],["addJson","file"],["addJson","edit"],["addJson","delete"],["edit","ifAbsent"],["delete","ifAbsent"]]},learnings:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"]]},files:{required:[],optional:["id","add","addGlob","remove","migrate","list","addNote","discover","apply","discoveryNote","appendStable","validatePaths","lookupPath","scope","limit","offset","noTruncate","strictRead","explain","lines","decisionDepth",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],anyOfRequired:[["id"],["lookupPath"]],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]}]},docs:{required:["id"],optional:["add","addGlob","remove","migrate","addNote","list","validatePaths",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]}]},deps:{required:["id"],optional:["format","maxDepth","collapse","summary","full","nodeLimit","edgeLimit","tokenBudget","cursor","direction","kind"]},graph:{required:["subcommand"],optional:["id","target","kind","maxDepth","limit","after","direction","maxPaths","sample","exemptIsolate","exemptIsolateType","saveBaseline","rebuild","clear","summary","full"]},test:{required:["id"],optional:["list","add","addJson","remove","removeIndex","update","updateIndex","setJson","run","match","onlyIndex","onlyLast","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","acknowledgeLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","autoPmContext","measure","metricBelow","metricDiff",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],dependentAnyOfRequired:[{property:"update",anyOfRequired:[["setJson"]]},{property:"updateIndex",anyOfRequired:[["setJson"]]},{property:"setJson",anyOfRequired:[["update"],["updateIndex"]]}],mutuallyExclusive:[["update","updateIndex"],["acknowledgeLinkedTests","run"],["acknowledgeLinkedTests","background"]]},"test-all":{optional:["status","limit","offset","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","autoPmContext"]},telemetry:{optional:["subcommand","limit"]},"test-runs-list":{optional:["status","limit"]},"test-runs-status":{required:["runId"]},"test-runs-logs":{required:["runId"],optional:["stream","tail"]},"test-runs-stop":{required:["runId"],optional:["force"]},"test-runs-resume":{required:["runId"],optional:["author"]},stats:{optional:["includeEmpty","storage","metadataCoverage","fieldUtilization","byAssignee","byTag","byPriority","tagPrefix","measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]},duplicates:{optional:["status","since","threshold","limit","exhaustive"]},health:{optional:["strictDirectories","requireMergeDrivers","strictExit","failOnWarn","checkOnly","checkTelemetry","noRefresh","refreshVectors","verboseStaleItems","verboseAuthorEvents","brief","summary","skipVectors","skipIntegrity","skipDrift","full"]},validate:{optional:["checkCompleteness","checkStorageIntegrity","checkMetadata","metadataProfile","checkResolution","checkLifecycle","checkStaleBlockers","dependencyCycleSeverity","parentCycleSeverity","checkFiles","scanMode","includePmInternals","verboseFileLists","verboseDiagnostics","allAffectedIds","strictExit","failOnWarn","fixHints","autoFix","dryRun","fixScope","pruneMissing","checkHistoryDrift","checkCommandReferences","counts","full"]},assurance:{required:["subcommand"],optional:["kind","id","definition","trigger","treeId","gate","limit","dryRun","author","message","preset","owner","apply","enforcement"],conditionalRequired:[{property:"subcommand",value:"list",required:["kind"]},{property:"subcommand",value:"show",required:["kind","id"]},{property:"subcommand",value:"put",required:["kind","id","definition"]},{property:"subcommand",value:"remove",required:["kind","id"]},{property:"subcommand",value:"run",required:["id","trigger"]},{property:"subcommand",value:"apply",required:["preset","owner"]},{property:"subcommand",value:"derive",required:["owner"]},{property:"subcommand",value:"risk",required:["definition"]},{property:"subcommand",value:"lineages",required:["definition"]},{property:"subcommand",value:"promote",required:["id","enforcement"]}],mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"risk"}},{property:"definition",schema:{not:{required:["policy","change"]}}}],[{property:"subcommand",schema:{const:"lineages"}},{property:"definition",schema:{anyOf:[{required:["change"]},{not:{required:["policy"]}}]}}]]},gc:{optional:["dryRun","gcScope"]},contracts:{optional:["contractAction","command","summary","schemaOnly","flagsOnly","availabilityOnly","runtimeOnly","activeOnly","full"],mutuallyExclusiveWhen:CONTRACTS_PROJECTION_MUTUALLY_EXCLUSIVE_GROUPS},completion:{required:["shell"],optional:["eagerTags"]},claim:{optional:["start","id","next","ifAvailable","maxAttempts","includeDecisions",...NEXT_CONTRACT_PARAMETER_KEYS,...LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],oneOfRequired:[["id"],["next"]],mutuallyExclusiveWhen:[[{property:"start",schema:{const:!0}},{property:"ifAvailable",schema:{const:!0}},{property:"id",schema:{type:"string"}}]]},release:{required:["id"],optional:["pause","handoff",...LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],dependentAnyOfRequired:[{property:"handoff",anyOfRequired:[["message"]]}],mutuallyExclusiveWhen:[[{property:"pause",schema:{const:!0}},{property:"handoff",schema:{type:"string"}}]]},"start-task":{required:["id"],optional:LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},"pause-task":{required:["id"],optional:LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},"close-task":{required:["id"],optional:["text","validateClose",...LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},"item-reopen":{required:["id","reason"],optional:["status","expectedResult","author","message","force"]}},PM_TOOL_ACTION_PARAMETER_CONTRACTS=Object.freeze(Object.fromEntries(PM_TOOL_ACTIONS.map(action=>[action,PM_TOOL_ACTION_SCHEMA_CONTRACTS[action]])));function fallbackToolParameterDescription(key){return key.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").trim().replace(/^./,value=>value.toUpperCase()).concat(".")}function decorateToolParameterDefinition(key,definition){const baseDefinition=typeof definition=="object"&&definition!==null?{...definition}:{},metadata=PM_TOOL_PARAMETER_METADATA[key];return{...baseDefinition,description:metadata?.description??fallbackToolParameterDescription(key),...metadata?.examples?{examples:metadata.examples}:{}}}function actionScopedToolParameterMetadata(action,key){if(action==="history-attest"&&key==="verify")return{description:"Compare all retained history streams with a detached JSON proof object. Server-local proof paths are not accepted over MCP."};if(action==="history-attest"&&key==="output")return{description:"Local CLI/SDK only. MCP rejects this field; save the returned JSON bundle on the client."};if(action==="claim"&&key==="start")return{description:"Move the claimed item to its configured in-progress status; with next, the selected item is claimed and started in one locked write."};if((action==="list"||action.startsWith("list-"))&&key==="all")return{description:"Return items from every lifecycle status instead of the default active-status set."};if(action==="plan"&&Object.prototype.hasOwnProperty.call(PLAN_ACTION_PARAMETER_METADATA,key))return PLAN_ACTION_PARAMETER_METADATA[key];const actionOverrides=PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA[action];return actionOverrides&&Object.prototype.hasOwnProperty.call(actionOverrides,key)?actionOverrides[key]:PM_TOOL_PARAMETER_METADATA[key]}function decorateActionScopedToolParameterDefinition(action,key,definition){const baseDefinition=typeof definition=="object"&&definition!==null?{...definition}:{},metadata=actionScopedToolParameterMetadata(action,key);return{...baseDefinition,description:metadata?.description??fallbackToolParameterDescription(key),...metadata?.examples?{examples:metadata.examples}:{}}}function actionScopedToolParameterDefinition(action,key){if(action==="claim"&&key==="start")return{type:"boolean"};const actionProperties=PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES[action];return actionProperties&&Object.prototype.hasOwnProperty.call(actionProperties,key)?actionProperties[key]:action==="plan"&&Object.prototype.hasOwnProperty.call(PLAN_ACTION_PARAMETER_PROPERTIES,key)?PLAN_ACTION_PARAMETER_PROPERTIES[key]:(action==="get"||action==="history"||action==="search")&&key==="format"?{type:"string",enum:["json","toon"]}:key==="pause"||key==="handoff"||key==="releaseAssignment"||key==="hashAlgorithm"?PM_TOOL_PARAMETER_PROPERTIES[key]:BASE_TOOL_PARAMETER_PROPERTIES[key]}function buildActionScopedSchemaProperties(action,allowedKeys){const properties={action:{const:action,description:PM_TOOL_PARAMETER_METADATA.action?.description??"Tool action to execute."}};for(const key of allowedKeys){if(key==="action")continue;const definition=actionScopedToolParameterDefinition(action,key);definition&&(properties[key]=decorateActionScopedToolParameterDefinition(action,key,definition))}return properties}function buildOneOfSchemaEntries(action,oneOfRequiredGroups){const allOneOfFields=oneOfRequiredGroups.flat();return oneOfRequiredGroups.map(requiredFields=>{const otherFields=allOneOfFields.filter(field=>!requiredFields.includes(field));return{required:[...requiredFields],...otherFields.length>0?{not:{anyOf:otherFields.map(field=>({required:[field]}))}}:{},...action==="history-repair"&&requiredFields.includes("all")?{properties:{all:{const:!0}}}:action==="claim"&&requiredFields.includes("next")?{properties:{next:{const:!0}}}:{}}})}function schemaPropertyCondition(property,value){return{...value===void 0?{}:{properties:{[property]:{const:value}}},required:[property]}}function buildActionScopedAllOf(contract){const allOf=[];if(contract.conditionalRequired&&contract.conditionalRequired.length>0)for(const entry of contract.conditionalRequired)allOf.push({if:schemaPropertyCondition(entry.property,entry.value),then:{required:entry.required}});if(contract.dependentAnyOfRequired&&contract.dependentAnyOfRequired.length>0)for(const entry of contract.dependentAnyOfRequired)allOf.push({if:schemaPropertyCondition(entry.property,entry.value),then:{anyOf:entry.anyOfRequired.map(requiredFields=>({required:[...requiredFields]}))}});if(contract.mutuallyExclusive&&contract.mutuallyExclusive.length>0)for(const group of contract.mutuallyExclusive)allOf.push({not:{required:toSchemaKeyList(group)}});if(contract.mutuallyExclusiveWhen&&contract.mutuallyExclusiveWhen.length>0)for(const group of contract.mutuallyExclusiveWhen)allOf.push({not:{allOf:group.map(condition=>({properties:{[condition.property]:condition.schema},required:[condition.property]}))}});return allOf}function pmToolActionParameterKeys(action){if(!Object.prototype.hasOwnProperty.call(PM_TOOL_ACTION_SCHEMA_CONTRACTS,action))return;const contract=PM_TOOL_ACTION_SCHEMA_CONTRACTS[action],mutationParameterKeys=PM_TOOL_ACTION_MUTATION_PARAMETER_KEYS[action]??[];return toSchemaKeyList(["action",...PM_TOOL_GLOBAL_PARAMETER_KEYS,...resolveReadOutputSurface(action)!==void 0?PM_TOOL_READ_OUTPUT_PARAMETER_KEYS:[],...mutationParameterKeys,...PM_EXPECT_HASH_ACTIONS.has(action)?["expectHash"]:[],...contract.required??[],...contract.optional??[]])}function pmToolActionNestedOptionKeys(action){const parameterKeys=pmToolActionParameterKeys(action);if(parameterKeys===void 0)return;const mutationContracts=action==="create"?CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS:action==="update"?UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS:[];return toSchemaKeyList([...parameterKeys,...mutationContracts.flatMap(({keys,target})=>[target,...keys]),...PM_TOOL_ACTION_NESTED_OPTION_COMPATIBILITY_KEYS[action]??[]])}function buildActionScopedToolSchema(action){const contract=PM_TOOL_ACTION_SCHEMA_CONTRACTS[action],required=toSchemaKeyList(contract.required??[]),allowedKeys=pmToolActionParameterKeys(action),schema={type:"object",additionalProperties:!1,required:["action",...required],title:`pm action "${action}" parameters`,properties:buildActionScopedSchemaProperties(action,allowedKeys)};contract.anyOfRequired&&contract.anyOfRequired.length>0&&(schema.anyOf=contract.anyOfRequired.map(requiredFields=>({required:[...requiredFields]}))),contract.oneOfRequired&&contract.oneOfRequired.length>0&&(schema.oneOf=buildOneOfSchemaEntries(action,contract.oneOfRequired));const allOf=buildActionScopedAllOf(contract);return allOf.length>0&&(schema.allOf=allOf),schema}function buildPmActionToolInputSchema(action,options={}){const actionSchema=buildActionScopedToolSchema(action),actionProperties={...actionSchema.properties};delete actionProperties.action;const conditionalBranches=[...actionSchema.anyOf??[],...actionSchema.oneOf??[]],required=(options.required??actionSchema.required.map(String)).filter(key=>key==="action"?!1:options.required===void 0?!0:!conditionalBranches.some(branch=>branch.required?.map(String).includes(key))),schema={type:"object",additionalProperties:options.additionalProperties??!0,properties:{...actionProperties,options:{type:"object",additionalProperties:!0,description:"Advanced command options forwarded to the selected pm action."},...options.properties},required};return actionSchema.anyOf!==void 0&&(schema.anyOf=actionSchema.anyOf),actionSchema.oneOf!==void 0&&(schema.oneOf=actionSchema.oneOf),actionSchema.allOf!==void 0&&(schema.allOf=actionSchema.allOf),schema}function createLazyContractSchema(build){let value;const resolve=()=>value??=build();return new Proxy({},{get:(_target,prop)=>resolve()[prop],has:(_target,prop)=>prop in resolve(),ownKeys:()=>Reflect.ownKeys(resolve()),getOwnPropertyDescriptor:(_target,prop)=>{const descriptor=Reflect.getOwnPropertyDescriptor(resolve(),prop);return descriptor&&(descriptor.configurable=!0),descriptor}})}const PM_TOOL_PARAMETERS_SCHEMA_VERSION="4.23.0",PM_TOOL_PARAMETERS_SCHEMA_MAJOR=PM_TOOL_PARAMETERS_SCHEMA_VERSION.split(".")[0],PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION="1.12.0",PM_TOOL_PARAMETERS_SCHEMA=createLazyContractSchema(()=>({$schema:"https://json-schema.org/draft/2020-12/schema",$id:`https://schema.unbrained.dev/pm-cli/tool-parameters-v${PM_TOOL_PARAMETERS_SCHEMA_MAJOR}.schema.json`,title:"pm-cli tool parameters (action-scoped strict schema)","x-schema-version":PM_TOOL_PARAMETERS_SCHEMA_VERSION,type:"object",oneOf:PM_TOOL_ACTIONS.map(action=>buildActionScopedToolSchema(action))}));function toProviderCompatibleParameterDefinition(key,definition){const decorated=decorateToolParameterDefinition(key,definition);if(typeof decorated.type=="string")return decorated;const firstTypedVariant=(Array.isArray(decorated.anyOf)?decorated.anyOf:[]).find(variant=>typeof variant.type=="string");if(firstTypedVariant){const{anyOf:_anyOf2,...rest2}=decorated;return{...firstTypedVariant,...rest2}}const{anyOf:_anyOf,...rest}=decorated;return{...rest,type:"string"}}function buildProviderCompatibleToolSchema(){const properties={action:{type:"string",description:PM_TOOL_PARAMETER_METADATA.action?.description??"Tool action to execute."},options:{type:"object",additionalProperties:!0,description:"Advanced command options object forwarded to the selected pm action."}};for(const key of Object.keys(PM_TOOL_PARAMETER_PROPERTIES).sort())properties[key]=toProviderCompatibleParameterDefinition(key,PM_TOOL_PARAMETER_PROPERTIES[key]);return{title:"pm-cli tool parameters (provider-compatible flat schema)","x-schema-version":PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,type:"object",additionalProperties:!1,required:["action"],properties}}const PM_PROVIDER_TOOL_PARAMETERS_SCHEMA=createLazyContractSchema(buildProviderCompatibleToolSchema),_testOnlyCliContracts={buildActionScopedToolSchema,buildProviderCompatibleToolSchema,decorateActionScopedToolParameterDefinition,decorateToolParameterDefinition,toolActionSchemaContracts:PM_TOOL_ACTION_SCHEMA_CONTRACTS,toolParameterMetadata:PM_TOOL_PARAMETER_METADATA,toProviderCompatibleParameterDefinition,toUniqueFlagContracts,withFlagAliasMetadata};export{CLOSE_ACTION_OPTION_KEYS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,_testOnlyCliContracts,buildPmActionToolInputSchema,pmToolActionNestedOptionKeys,pmToolActionParameterKeys,resolvePmToolCustomFieldCollision};
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]="d21c1722-1e9d-5091-ba42-7c283c3671cc")}catch{}})();import{normalizeUniqueStringList}from"./string-lists.js";import{PM_EXPECT_HASH_ACTIONS,PM_TOOL_ACTIONS}from"./enum-contracts.js";import{TOOL_CREATE_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS}from"./tool-option-contracts.js";import{PM_TOOL_PARAMETER_PROPERTIES as BASE_TOOL_PARAMETER_PROPERTIES,PM_TOOL_PARAMETER_METADATA as BASE_TOOL_PARAMETER_METADATA,PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES as BASE_ACTION_SCOPED_PARAMETER_PROPERTIES,PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA,PLAN_ACTION_PARAMETER_PROPERTIES,PLAN_ACTION_PARAMETER_METADATA}from"./tool-parameter-tables.js";import{toUniqueFlagContracts,withFlagAliasMetadata}from"./flag-contracts.js";import{resolveReadOutputSurface}from"../read-output-contracts.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS}from"./commander-mutation-options.js";const PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES={...BASE_ACTION_SCOPED_PARAMETER_PROPERTIES,"history-attest":{verify:{type:"object",additionalProperties:!0},output:{not:{}}}},PM_TOOL_PARAMETER_PROPERTIES={...BASE_TOOL_PARAMETER_PROPERTIES,pause:{type:"boolean"},handoff:{type:"string"},releaseAssignment:{type:"boolean"},hashAlgorithm:{type:"string",enum:["sha256","sha512"]}},PM_TOOL_PARAMETER_METADATA={...BASE_TOOL_PARAMETER_METADATA,pause:{description:"Return work to its configured open status before releasing ownership."},handoff:{description:"Release into a configured non-terminal queue with a required evidence message."},releaseAssignment:{description:"Release assignment after recording closure evidence."},hashAlgorithm:{description:"Digest for detached history bundles; defaults to sha256."}},PM_TOOL_GLOBAL_PARAMETER_KEYS=["json","quiet","profile","noExtensions","noPager","tokenAccounting","path","pmExecutable","timeoutMs"],PM_TOOL_READ_OUTPUT_PARAMETER_KEYS=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor","outputRowContract"],PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES=new Set(["action","cwd","options",...Object.keys(PM_TOOL_PARAMETER_PROPERTIES).filter(property=>property!=="severity")]);function resolvePmToolCustomFieldCollision(field){const normalized=field.trim().toLowerCase();let property="";for(let index=0;index<normalized.length;index+=1){const character=normalized[index];if(character!=="-"&&character!=="_"){property+=character;continue}let nextIndex=index+1;for(;normalized[nextIndex]==="-"||normalized[nextIndex]==="_";)nextIndex+=1;const nextCharacter=normalized[nextIndex];if(nextCharacter!==void 0&&(nextCharacter>="a"&&nextCharacter<="z"||nextCharacter>="0"&&nextCharacter<="9")){property+=nextCharacter.toUpperCase(),index=nextIndex;continue}property+=normalized.slice(index,nextIndex),index=nextIndex-1}return PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES.has(property)?{field,property,owner:"mcp_tool_input",nested_path:property==="expectHash"?`options.field (${field}=<value>)`:`options.${property}`}:void 0}const PM_TOOL_ACTION_MUTATION_PARAMETER_KEYS={create:["fullChangedFields","idOnly"],copy:["fullChangedFields","idOnly"],update:["fullChangedFields","idOnly"],"item-reopen":["fullChangedFields","idOnly"],close:["fullChangedFields","idOnly"],claim:["fullChangedFields","idOnly"],release:["fullChangedFields","idOnly"],"start-task":["fullChangedFields","idOnly"],"pause-task":["fullChangedFields","idOnly"],"close-task":["fullChangedFields","idOnly"],restore:["fullChangedFields","idOnly"],append:["fullChangedFields"],"update-many":["fullChangedFields"],"close-many":["fullChangedFields"],assurance:["fullChangedFields","idOnly"]},PLAN_CREATE_METADATA_PARAMETER_KEYS=["createMode","status","deadline","estimate","acceptanceCriteria","definitionOfReady","order","rank","goal","objective","value","impact","outcome","whyNow","assignee","reviewer","risk","confidence","sprint","release","blockedReason","unblockNote","reporter","severity","environment","reproSteps","resolution","expectedResult","actualResult","affectedVersion","fixedVersion","component","regression","customerImpact","comment","note","learning","reminder","event","typeOption"],PM_TOOL_ACTION_NESTED_OPTION_COMPATIBILITY_KEYS=Object.freeze({"close-many":["list","expected_result","expected","actual_result","actual","validate_close","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],"update-many":["list","update","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],...Object.fromEntries(PM_TOOL_ACTIONS.filter(action=>action==="upgrade"||action==="install"||action==="extension"||action==="package"||action.startsWith("extension-")||action.startsWith("package-")).map(action=>[action,["project","local","global"]]))});function toSchemaKeyList(values){return normalizeUniqueStringList(values)}const CREATE_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_CREATE_OPTION_CONTRACTS.map(entry=>entry.param),...TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS.map(entry=>entry.param)]),UPDATE_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_UPDATE_OPTION_CONTRACTS.map(entry=>entry.param),...TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS.map(entry=>entry.param),"force"]),UPDATE_MANY_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS.map(entry=>entry.param),...UPDATE_CONTRACT_PARAMETER_KEYS.filter(key=>key!=="allowMissingParent"&&key!=="completedAt"),"dryRun","rollback","noCheckpoint"]),CLOSE_MANY_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS.map(entry=>entry.param),"reason","completedAt","resolution","expectedResult","actualResult","validateClose","dryRun","rollback","noCheckpoint","author","message","force"]),CONTEXT_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_CONTEXT_OPTION_CONTRACTS.map(entry=>entry.param),"past","section"]),ACTIVITY_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_ACTIVITY_OPTION_CONTRACTS.map(entry=>entry.param),"stream"]),LIST_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_LIST_FILTER_OPTION_CONTRACTS.map(entry=>entry.param),"all","includeBody","noTruncate","strictRead","compact","brief","full"]),FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS=LIST_CONTRACT_PARAMETER_KEYS.filter(parameter=>parameter!=="all"&&parameter!=="status"),LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS=[[{property:"today",schema:{const:!0}},{property:"recent",schema:{const:!0}}],[{property:"today",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}],[{property:"recent",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}]],CONTRACTS_PROJECTION_MUTUALLY_EXCLUSIVE_GROUPS=[[{property:"summary",schema:{const:!0}},{property:"schemaOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"flagsOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}]],AGGREGATE_CONTRACT_PARAMETER_KEYS=toSchemaKeyList([...TOOL_AGGREGATE_OPTION_CONTRACTS.map(entry=>entry.param),"count","completion","includeUnparented"]),SEARCH_CONTRACT_PARAMETER_KEYS=toSchemaKeyList(["query","keywords","mode","semantic","hybrid","includeLinked","titleExact","phraseExact","highlight","compact","full",...TOOL_SEARCH_FILTER_OPTION_CONTRACTS.map(entry=>entry.param)]),NEXT_CONTRACT_PARAMETER_KEYS=toSchemaKeyList(["type","tag","priority","assignee","assigneeFilter","sprint","release","parent","limit","blockedLimit","readyOnly","format","includeDecisions","includeGates","includeContainers","tokenBudget","explainRanking"]),AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS=["author","message","force"],CLOSE_ACTION_OPTION_KEYS=["releaseAssignment","text","reason","closeReason","completedAt","duplicateOf","validateClose","resolution","expectedResult","actualResult"],LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS=["author","assignee","message","force"],MANAGED_EXTENSION_PACKAGE_OPTION_KEYS=["dryRun","target","scope","capability","declarative","github","ref","init","install","uninstall","explore","manage","offline","describe","markdown","output","reload","doctor","catalog","list","adopt","adoptAll","activate","deactivate","runtimeProbe","fixManagedState","isolated","ignoreGlobal","detail","trace","watch","strictExit","failOnWarn"];function managedLifecycleSchemaContracts(prefix){return{[`${prefix}-init`]:{required:["target"],optional:["scope","capability",...prefix==="package"?["declarative"]:[]]},[`${prefix}-install`]:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},[`${prefix}-uninstall`]:{required:["target"],optional:["scope"]},[`${prefix}-explore`]:{optional:["scope"]},[`${prefix}-manage`]:{optional:["scope","runtimeProbe","fixManagedState","offline"]},[`${prefix}-describe`]:{optional:["target","scope","markdown","output"]},[`${prefix}-reload`]:{optional:["scope","watch"]},[`${prefix}-doctor`]:{optional:["scope","detail","trace","fixManagedState","isolated","ignoreGlobal","strictExit","failOnWarn"]},[`${prefix}-catalog`]:{optional:["scope","fields"]},[`${prefix}-adopt`]:{required:["target"],optional:["scope","github","ref"]},[`${prefix}-adopt-all`]:{optional:["scope"]},[`${prefix}-activate`]:{required:["target"],optional:["scope"]},[`${prefix}-deactivate`]:{required:["target"],optional:["scope"]},[prefix]:{optional:MANAGED_EXTENSION_PACKAGE_OPTION_KEYS,dependentAnyOfRequired:[{property:"dryRun",value:!0,anyOfRequired:[["install","target"],["install","github"]]}],mutuallyExclusiveWhen:[[{property:"dryRun",schema:{const:!0}},{property:"install",schema:{const:!1}}]]}}}const SCHEDULING_ACTION_SCHEMA_CONTRACT={required:["title"],optional:["start","duration","end","location","timezone","allDay","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},UPGRADE_ACTION_SCHEMA_CONTRACT={optional:["target","scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"]},PM_TOOL_ACTION_SCHEMA_CONTRACTS={init:{optional:["prefix","idPrefix","workspace","preset","typePreset","defaults","author","agentGuidance","withPackages","mergeFence","force","verbose"]},config:{required:["scope","configAction"],optional:["key","value","criterion","clearCriteria","format","policy"]},...managedLifecycleSchemaContracts("extension"),...managedLifecycleSchemaContracts("package"),"package-upgrade":UPGRADE_ACTION_SCHEMA_CONTRACT,install:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},upgrade:UPGRADE_ACTION_SCHEMA_CONTRACT,create:{required:["title","description","type","status","priority","message"],optional:CREATE_CONTRACT_PARAMETER_KEYS},copy:{required:["id"],optional:["title","author","message","allowDuplicate"]},focus:{optional:["id","clear"],mutuallyExclusive:[["id","clear"]]},list:{optional:LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-all":{optional:LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-draft":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-open":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-in-progress":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-blocked":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-closed":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},"list-canceled":{optional:FIXED_STATUS_LIST_CONTRACT_PARAMETER_KEYS,mutuallyExclusiveWhen:LIST_WINDOW_MUTUALLY_EXCLUSIVE_GROUPS},aggregate:{optional:AGGREGATE_CONTRACT_PARAMETER_KEYS},guide:{optional:["list","format","depth"]},context:{optional:CONTEXT_CONTRACT_PARAMETER_KEYS},ctx:{optional:CONTEXT_CONTRACT_PARAMETER_KEYS},get:{required:["id"],optional:["for","tokenBudget","at","depth","full","fields","tree","treeDepth","format"]},search:{optional:SEARCH_CONTRACT_PARAMETER_KEYS,anyOfRequired:[["query"],["keywords"]]},eval:{optional:["mode","k","failUnder","queries","format"]},events:{optional:["verify","since","type","author","item","limit","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","cursorMode"]},merge:{required:["subcommand"],optional:["dryRun","preCommitHook","stage","author","message","force","includeReconciled","artifact","basePath","oursPath","theirsPath","output","outputPath","itemPath","prefer"]},workspace:{required:["subcommand"],optional:["snapshotAction","name","target","dryRun","force","author","message","lockTtlSeconds","lockWaitMs"],conditionalRequired:[{property:"subcommand",value:"snapshot",required:["snapshotAction"]}]},meet:SCHEDULING_ACTION_SCHEMA_CONTRACT,event:SCHEDULING_ACTION_SCHEMA_CONTRACT,remind:{required:["title"],optional:["at","text","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},next:{optional:[...NEXT_CONTRACT_PARAMETER_KEYS,"for"]},reindex:{optional:["mode","progress"]},history:{required:["id"],optional:["limit","order","compact","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","diff","verify","field","strictExit","failOnWarn","format"]},"history-attest":{optional:["verify","output","hashAlgorithm"],mutuallyExclusive:[["verify","hashAlgorithm"]]},"history-redact":{required:["id"],optional:["literal","regex","replacement","dryRun",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],anyOfRequired:[["literal"],["regex"]]},"history-repair":{optional:["id","all","dryRun","normalizeProvenance","salvageTail",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],oneOfRequired:[["id"],["all"]],mutuallyExclusiveWhen:[[{property:"salvageTail",schema:{const:!0}},{property:"all",schema:{const:!0}}],[{property:"salvageTail",schema:{const:!0}},{property:"normalizeProvenance",schema:{const:!0}}]]},"history-author-acknowledge":{optional:["historyEvent","allActionable","dryRun","planFingerprint","limit","attributedAuthor","reviewer","reason"],oneOfRequired:[["historyEvent"],["allActionable"]]},"history-compact":{optional:["id","before","ids","allOver","closed","allStreams","minEntries","dryRun",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},schema:{mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"policy-mode"}},{property:"name",schema:{not:{enum:["advise","refuse"]}}}]],required:["subcommand"],optional:["definition","policy","message","name","description","defaultStatus","folder","alias","role","order","fieldType","commands","cliFlag","required","requiredOnCreate","allowUnset","requiredTypes","typePreset","infer","minCount","apply","to","migrationId","fieldTypeScope","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"policy-put",required:["definition"]},{property:"subcommand",value:"policy-remove",required:["name"]},{property:"subcommand",value:"policy-mode",required:["name"]},{property:"subcommand",value:"policy-check",required:["name"]},{property:"subcommand",value:"policy-approve",required:["name","policy"]},{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"show-status",required:["name"]},{property:"subcommand",value:"add-type",required:["name"]},{property:"subcommand",value:"remove-type",required:["name"]},{property:"subcommand",value:"add-status",required:["name"]},{property:"subcommand",value:"remove-status",required:["name"]},{property:"subcommand",value:"add-field",required:["name"]},{property:"subcommand",value:"remove-field",required:["name"]},{property:"subcommand",value:"show-field",required:["name"]},{property:"subcommand",value:"rename-type",required:["name","to"]},{property:"subcommand",value:"rename-field",required:["name","to"]},{property:"subcommand",value:"remap-status",required:["name","to"]},{property:"subcommand",value:"apply-preset",required:["typePreset"]}]},profile:{required:["subcommand"],optional:["name","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"apply",required:["name"]},{property:"subcommand",value:"lint",required:["name"]}]},plan:{required:["subcommand"],optional:["id","stepRef","reorderTo","title","description","template","scope","parent","inheritFocus","related","blocks","blockedBy","harness","mode","resumeContext","tags","priority",...PLAN_CREATE_METADATA_PARAMETER_KEYS,"body","claim","fromSearch","stepTitle","step","stepBody","stepOwner","stepStatus","stepEvidence","stepBlockedReason","stepReplacement","dependsOn","link","linkKind","linkNote","promoteToItemDep","allowMultipleActive","file","test","doc","decisionText","decision","decisionRationale","decisionEvidence","discoveryText","discovery","validationText","validation","validationCommand","validationExpected","depth","fields","steps","materializeType","materializeParent","materializeTags","field",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},activity:{optional:ACTIVITY_CONTRACT_PARAMETER_KEYS},restore:{required:["id","target"],optional:AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},update:{required:["id"],optional:UPDATE_CONTRACT_PARAMETER_KEYS,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},"update-many":{optional:UPDATE_MANY_CONTRACT_PARAMETER_KEYS,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},close:{required:["id"],optional:[...CLOSE_ACTION_OPTION_KEYS,...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},"close-many":{optional:CLOSE_MANY_CONTRACT_PARAMETER_KEYS},delete:{required:["id"],optional:["dryRun",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},append:{required:["id","body"],optional:AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},comments:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent","expectAt",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},notes:{required:["id"],optional:["text","add","addJson","stdin","edit","delete","limit","since","eventType","includeMeta","full","ifAbsent","expectAt",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],mutuallyExclusive:[["addJson","add"],["addJson","stdin"],["addJson","file"],["addJson","edit"],["addJson","delete"],["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},learnings:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent","expectAt",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},files:{required:[],optional:["id","add","addGlob","remove","migrate","list","addNote","discover","apply","discoveryNote","appendStable","validatePaths","lookupPath","scope","limit","offset","noTruncate","strictRead","explain","lines","decisionDepth",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],anyOfRequired:[["id"],["lookupPath"]],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]}]},docs:{required:["id"],optional:["add","addGlob","remove","migrate","addNote","list","validatePaths",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]}]},deps:{required:["id"],optional:["format","maxDepth","collapse","summary","full","nodeLimit","edgeLimit","tokenBudget","cursor","direction","kind"]},graph:{required:["subcommand"],optional:["id","target","kind","maxDepth","limit","after","direction","maxPaths","sample","exemptIsolate","exemptIsolateType","saveBaseline","rebuild","clear","summary","full"]},test:{required:["id"],optional:["list","add","addJson","remove","removeIndex","update","updateIndex","setJson","run","match","onlyIndex","onlyLast","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","acknowledgeLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","autoPmContext","measure","metricBelow","metricDiff",...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],dependentAnyOfRequired:[{property:"update",anyOfRequired:[["setJson"]]},{property:"updateIndex",anyOfRequired:[["setJson"]]},{property:"setJson",anyOfRequired:[["update"],["updateIndex"]]}],mutuallyExclusive:[["update","updateIndex"],["acknowledgeLinkedTests","run"],["acknowledgeLinkedTests","background"]]},"test-all":{optional:["status","limit","offset","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","autoPmContext"]},telemetry:{optional:["subcommand","limit"]},"test-runs-list":{optional:["status","limit"]},"test-runs-status":{required:["runId"]},"test-runs-logs":{required:["runId"],optional:["stream","tail"]},"test-runs-stop":{required:["runId"],optional:["force"]},"test-runs-resume":{required:["runId"],optional:["author"]},stats:{optional:["includeEmpty","storage","metadataCoverage","fieldUtilization","byAssignee","byTag","byPriority","tagPrefix","measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]},duplicates:{optional:["status","since","threshold","limit","exhaustive"]},health:{optional:["strictDirectories","requireMergeDrivers","strictExit","failOnWarn","checkOnly","checkTelemetry","noRefresh","refreshVectors","verboseStaleItems","verboseAuthorEvents","brief","summary","skipVectors","skipIntegrity","skipDrift","full"]},validate:{optional:["checkCompleteness","checkStorageIntegrity","checkMetadata","metadataProfile","checkResolution","checkLifecycle","checkStaleBlockers","dependencyCycleSeverity","parentCycleSeverity","checkFiles","scanMode","includePmInternals","verboseFileLists","verboseDiagnostics","allAffectedIds","strictExit","failOnWarn","fixHints","autoFix","dryRun","fixScope","pruneMissing","checkHistoryDrift","checkCommandReferences","counts","full"]},assurance:{required:["subcommand"],optional:["kind","id","definition","trigger","treeId","gate","limit","dryRun","author","message","preset","owner","apply","enforcement"],conditionalRequired:[{property:"subcommand",value:"list",required:["kind"]},{property:"subcommand",value:"show",required:["kind","id"]},{property:"subcommand",value:"put",required:["kind","id","definition"]},{property:"subcommand",value:"remove",required:["kind","id"]},{property:"subcommand",value:"run",required:["id","trigger"]},{property:"subcommand",value:"apply",required:["preset","owner"]},{property:"subcommand",value:"derive",required:["owner"]},{property:"subcommand",value:"risk",required:["definition"]},{property:"subcommand",value:"lineages",required:["definition"]},{property:"subcommand",value:"promote",required:["id","enforcement"]}],mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"risk"}},{property:"definition",schema:{not:{required:["policy","change"]}}}],[{property:"subcommand",schema:{const:"lineages"}},{property:"definition",schema:{anyOf:[{required:["change"]},{not:{required:["policy"]}}]}}]]},gc:{optional:["dryRun","gcScope"]},contracts:{optional:["contractAction","command","summary","schemaOnly","flagsOnly","availabilityOnly","runtimeOnly","activeOnly","full"],mutuallyExclusiveWhen:CONTRACTS_PROJECTION_MUTUALLY_EXCLUSIVE_GROUPS},completion:{required:["shell"],optional:["eagerTags"]},claim:{optional:["start","id","next","ifAvailable","maxAttempts","includeDecisions",...NEXT_CONTRACT_PARAMETER_KEYS,...LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],oneOfRequired:[["id"],["next"]],mutuallyExclusiveWhen:[[{property:"start",schema:{const:!0}},{property:"ifAvailable",schema:{const:!0}},{property:"id",schema:{type:"string"}}]]},release:{required:["id"],optional:["pause","handoff",...LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],dependentAnyOfRequired:[{property:"handoff",anyOfRequired:[["message"]]}],mutuallyExclusiveWhen:[[{property:"pause",schema:{const:!0}},{property:"handoff",schema:{type:"string"}}]]},"start-task":{required:["id"],optional:LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},"pause-task":{required:["id"],optional:LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS},"close-task":{required:["id"],optional:["text","validateClose",...LIFECYCLE_AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS]},"item-reopen":{required:["id","reason"],optional:["status","expectedResult","author","message","force"]}},PM_TOOL_ACTION_PARAMETER_CONTRACTS=Object.freeze(Object.fromEntries(PM_TOOL_ACTIONS.map(action=>[action,PM_TOOL_ACTION_SCHEMA_CONTRACTS[action]])));function fallbackToolParameterDescription(key){return key.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").trim().replace(/^./,value=>value.toUpperCase()).concat(".")}function decorateToolParameterDefinition(key,definition){const baseDefinition=typeof definition=="object"&&definition!==null?{...definition}:{},metadata=PM_TOOL_PARAMETER_METADATA[key];return{...baseDefinition,description:metadata?.description??fallbackToolParameterDescription(key),...metadata?.examples?{examples:metadata.examples}:{}}}function actionScopedToolParameterMetadata(action,key){if(action==="history-attest"&&key==="verify")return{description:"Compare all retained history streams with a detached JSON proof object. Server-local proof paths are not accepted over MCP."};if(action==="history-attest"&&key==="output")return{description:"Local CLI/SDK only. MCP rejects this field; save the returned JSON bundle on the client."};if(action==="claim"&&key==="start")return{description:"Move the claimed item to its configured in-progress status; with next, the selected item is claimed and started in one locked write."};if((action==="list"||action.startsWith("list-"))&&key==="all")return{description:"Return items from every lifecycle status instead of the default active-status set."};if(action==="plan"&&Object.prototype.hasOwnProperty.call(PLAN_ACTION_PARAMETER_METADATA,key))return PLAN_ACTION_PARAMETER_METADATA[key];const actionOverrides=PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA[action];return actionOverrides&&Object.prototype.hasOwnProperty.call(actionOverrides,key)?actionOverrides[key]:PM_TOOL_PARAMETER_METADATA[key]}function decorateActionScopedToolParameterDefinition(action,key,definition){const baseDefinition=typeof definition=="object"&&definition!==null?{...definition}:{},metadata=actionScopedToolParameterMetadata(action,key);return{...baseDefinition,description:metadata?.description??fallbackToolParameterDescription(key),...metadata?.examples?{examples:metadata.examples}:{}}}function actionScopedToolParameterDefinition(action,key){if(action==="claim"&&key==="start")return{type:"boolean"};const actionProperties=PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES[action];return actionProperties&&Object.prototype.hasOwnProperty.call(actionProperties,key)?actionProperties[key]:action==="plan"&&Object.prototype.hasOwnProperty.call(PLAN_ACTION_PARAMETER_PROPERTIES,key)?PLAN_ACTION_PARAMETER_PROPERTIES[key]:(action==="get"||action==="history"||action==="search")&&key==="format"?{type:"string",enum:["json","toon"]}:key==="pause"||key==="handoff"||key==="releaseAssignment"||key==="hashAlgorithm"?PM_TOOL_PARAMETER_PROPERTIES[key]:BASE_TOOL_PARAMETER_PROPERTIES[key]}function buildActionScopedSchemaProperties(action,allowedKeys){const properties={action:{const:action,description:PM_TOOL_PARAMETER_METADATA.action?.description??"Tool action to execute."}};for(const key of allowedKeys){if(key==="action")continue;const definition=actionScopedToolParameterDefinition(action,key);definition&&(properties[key]=decorateActionScopedToolParameterDefinition(action,key,definition))}return properties}function buildOneOfSchemaEntries(action,oneOfRequiredGroups){const allOneOfFields=oneOfRequiredGroups.flat();return oneOfRequiredGroups.map(requiredFields=>{const otherFields=allOneOfFields.filter(field=>!requiredFields.includes(field));return{required:[...requiredFields],...otherFields.length>0?{not:{anyOf:otherFields.map(field=>({required:[field]}))}}:{},...action==="history-repair"&&requiredFields.includes("all")?{properties:{all:{const:!0}}}:action==="claim"&&requiredFields.includes("next")?{properties:{next:{const:!0}}}:{}}})}function schemaPropertyCondition(property,value){return{...value===void 0?{}:{properties:{[property]:{const:value}}},required:[property]}}function buildActionScopedAllOf(contract){const allOf=[];if(contract.conditionalRequired&&contract.conditionalRequired.length>0)for(const entry of contract.conditionalRequired)allOf.push({if:schemaPropertyCondition(entry.property,entry.value),then:{required:entry.required}});if(contract.dependentAnyOfRequired&&contract.dependentAnyOfRequired.length>0)for(const entry of contract.dependentAnyOfRequired)allOf.push({if:schemaPropertyCondition(entry.property,entry.value),then:{anyOf:entry.anyOfRequired.map(requiredFields=>({required:[...requiredFields]}))}});if(contract.mutuallyExclusive&&contract.mutuallyExclusive.length>0)for(const group of contract.mutuallyExclusive)allOf.push({not:{required:toSchemaKeyList(group)}});if(contract.mutuallyExclusiveWhen&&contract.mutuallyExclusiveWhen.length>0)for(const group of contract.mutuallyExclusiveWhen)allOf.push({not:{allOf:group.map(condition=>({properties:{[condition.property]:condition.schema},required:[condition.property]}))}});return allOf}function pmToolActionParameterKeys(action){if(!Object.prototype.hasOwnProperty.call(PM_TOOL_ACTION_SCHEMA_CONTRACTS,action))return;const contract=PM_TOOL_ACTION_SCHEMA_CONTRACTS[action],mutationParameterKeys=PM_TOOL_ACTION_MUTATION_PARAMETER_KEYS[action]??[];return toSchemaKeyList(["action",...PM_TOOL_GLOBAL_PARAMETER_KEYS,...resolveReadOutputSurface(action)!==void 0?PM_TOOL_READ_OUTPUT_PARAMETER_KEYS:[],...mutationParameterKeys,...PM_EXPECT_HASH_ACTIONS.has(action)?["expectHash"]:[],...contract.required??[],...contract.optional??[]])}function pmToolActionNestedOptionKeys(action){const parameterKeys=pmToolActionParameterKeys(action);if(parameterKeys===void 0)return;const mutationContracts=action==="create"?CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS:action==="update"?UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS:[];return toSchemaKeyList([...parameterKeys,...mutationContracts.flatMap(({keys,target})=>[target,...keys]),...PM_TOOL_ACTION_NESTED_OPTION_COMPATIBILITY_KEYS[action]??[]])}function buildActionScopedToolSchema(action){const contract=PM_TOOL_ACTION_SCHEMA_CONTRACTS[action],required=toSchemaKeyList(contract.required??[]),allowedKeys=pmToolActionParameterKeys(action),schema={type:"object",additionalProperties:!1,required:["action",...required],title:`pm action "${action}" parameters`,properties:buildActionScopedSchemaProperties(action,allowedKeys)};contract.anyOfRequired&&contract.anyOfRequired.length>0&&(schema.anyOf=contract.anyOfRequired.map(requiredFields=>({required:[...requiredFields]}))),contract.oneOfRequired&&contract.oneOfRequired.length>0&&(schema.oneOf=buildOneOfSchemaEntries(action,contract.oneOfRequired));const allOf=buildActionScopedAllOf(contract);return allOf.length>0&&(schema.allOf=allOf),schema}function buildPmActionToolInputSchema(action,options={}){const actionSchema=buildActionScopedToolSchema(action),actionProperties={...actionSchema.properties};delete actionProperties.action;const conditionalBranches=[...actionSchema.anyOf??[],...actionSchema.oneOf??[]],required=(options.required??actionSchema.required.map(String)).filter(key=>key==="action"?!1:options.required===void 0?!0:!conditionalBranches.some(branch=>branch.required?.map(String).includes(key))),schema={type:"object",additionalProperties:options.additionalProperties??!0,properties:{...actionProperties,options:{type:"object",additionalProperties:!0,description:"Advanced command options forwarded to the selected pm action."},...options.properties},required};return actionSchema.anyOf!==void 0&&(schema.anyOf=actionSchema.anyOf),actionSchema.oneOf!==void 0&&(schema.oneOf=actionSchema.oneOf),actionSchema.allOf!==void 0&&(schema.allOf=actionSchema.allOf),schema}function createLazyContractSchema(build){let value;const resolve=()=>value??=build();return new Proxy({},{get:(_target,prop)=>resolve()[prop],has:(_target,prop)=>prop in resolve(),ownKeys:()=>Reflect.ownKeys(resolve()),getOwnPropertyDescriptor:(_target,prop)=>{const descriptor=Reflect.getOwnPropertyDescriptor(resolve(),prop);return descriptor&&(descriptor.configurable=!0),descriptor}})}const PM_TOOL_PARAMETERS_SCHEMA_VERSION="4.23.0",PM_TOOL_PARAMETERS_SCHEMA_MAJOR=PM_TOOL_PARAMETERS_SCHEMA_VERSION.split(".")[0],PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION="1.12.0",PM_TOOL_PARAMETERS_SCHEMA=createLazyContractSchema(()=>({$schema:"https://json-schema.org/draft/2020-12/schema",$id:`https://schema.unbrained.dev/pm-cli/tool-parameters-v${PM_TOOL_PARAMETERS_SCHEMA_MAJOR}.schema.json`,title:"pm-cli tool parameters (action-scoped strict schema)","x-schema-version":PM_TOOL_PARAMETERS_SCHEMA_VERSION,type:"object",oneOf:PM_TOOL_ACTIONS.map(action=>buildActionScopedToolSchema(action))}));function toProviderCompatibleParameterDefinition(key,definition){const decorated=decorateToolParameterDefinition(key,definition);if(typeof decorated.type=="string")return decorated;const firstTypedVariant=(Array.isArray(decorated.anyOf)?decorated.anyOf:[]).find(variant=>typeof variant.type=="string");if(firstTypedVariant){const{anyOf:_anyOf2,...rest2}=decorated;return{...firstTypedVariant,...rest2}}const{anyOf:_anyOf,...rest}=decorated;return{...rest,type:"string"}}function buildProviderCompatibleToolSchema(){const properties={action:{type:"string",description:PM_TOOL_PARAMETER_METADATA.action?.description??"Tool action to execute."},options:{type:"object",additionalProperties:!0,description:"Advanced command options object forwarded to the selected pm action."}};for(const key of Object.keys(PM_TOOL_PARAMETER_PROPERTIES).sort())properties[key]=toProviderCompatibleParameterDefinition(key,PM_TOOL_PARAMETER_PROPERTIES[key]);return{title:"pm-cli tool parameters (provider-compatible flat schema)","x-schema-version":PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,type:"object",additionalProperties:!1,required:["action"],properties}}const PM_PROVIDER_TOOL_PARAMETERS_SCHEMA=createLazyContractSchema(buildProviderCompatibleToolSchema),_testOnlyCliContracts={buildActionScopedToolSchema,buildProviderCompatibleToolSchema,decorateActionScopedToolParameterDefinition,decorateToolParameterDefinition,toolActionSchemaContracts:PM_TOOL_ACTION_SCHEMA_CONTRACTS,toolParameterMetadata:PM_TOOL_PARAMETER_METADATA,toProviderCompatibleParameterDefinition,toUniqueFlagContracts,withFlagAliasMetadata};export{CLOSE_ACTION_OPTION_KEYS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,_testOnlyCliContracts,buildPmActionToolInputSchema,pmToolActionNestedOptionKeys,pmToolActionParameterKeys,resolvePmToolCustomFieldCollision};
2
2
  //# sourceMappingURL=tool-schema.js.map
@@ -1,6 +1,7 @@
1
1
  import type { GlobalOptions } from "../core/shared/command-types.js";
2
2
  export { quoteWindowsCommandArg,quoteCommandArg,renderPmCommand } from "../core/shared/command-line.js";
3
- type CommandScope = Pick<GlobalOptions,"path" | "noExtensions">;
3
+ /** Tracker selection a rendered recovery command must preserve: the requested path and extension isolation. */
4
+ export type CommandScope = Pick<GlobalOptions,"path" | "noExtensions">;
4
5
  /** Retain caller scope before runtime dispatch resolves its working storage path. */
5
6
  export declare function capturePmCommandScope(options:CommandScope):void;
6
7
  /**
@@ -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]="7710bf5a-cea2-5fc5-8017-20e8845238e4")}catch{}})();import{findBootstrapCommandTokenIndex}from"./cli-contracts/bootstrap-command-scanner.js";import path from"node:path";import{resolveImplicitPmRoot,resolvePmRoot,resolveWorkspaceRoot}from"../core/store/paths.js";import{isPathWithinDirectory}from"../core/fs/path-utils.js";import{quoteWindowsCommandArg,quoteCommandArg,renderPmCommand}from"../core/shared/command-line.js";const requestedPaths=new WeakMap;function capturePmCommandScope(options){requestedPaths.set(options,options.path)}function environmentCommandScope(cwd){if(!process.env.PM_PATH?.trim())return;const resolved=resolvePmRoot(cwd);return isPathWithinDirectory(resolveWorkspaceRoot(resolved),cwd)&&resolved===resolveImplicitPmRoot(cwd)?void 0:path.relative(cwd,resolved)||"."}function resolvePmCommandScopeArgs(options,cwd=process.cwd()){const requested=requestedPaths.has(options)?requestedPaths.get(options):options.path,selected=requested?.trim()?requested:environmentCommandScope(cwd),args=selected?["--pm-path",selected]:[];return options.noExtensions&&args.push("--no-extensions"),args}const HISTORY_REDACT_SENSITIVE_FLAGS=new Set(["--literal","--regex","--replacement"]);function isHistoryRedactInvocation(argv){const rootIndex=findBootstrapCommandTokenIndex(argv);if(rootIndex===void 0)return!1;if(argv[rootIndex]==="history-redact")return!0;if(argv[rootIndex]!=="history")return!1;const operationArgs=argv.slice(rootIndex+1),operationIndex=findBootstrapCommandTokenIndex(operationArgs);return operationIndex!==void 0&&operationArgs[operationIndex]==="redact"}function redactSensitiveCommandArgs(argv){if(!isHistoryRedactInvocation(argv))return[...argv];const redacted=[];let redactNext=!1;for(const token of argv){if(redactNext){redacted.push("[redacted]"),redactNext=!1;continue}redactNext=!1;const equalsIndex=token.indexOf("="),flag=equalsIndex>=0?token.slice(0,equalsIndex):token;if(!HISTORY_REDACT_SENSITIVE_FLAGS.has(flag)){redacted.push(token);continue}if(equalsIndex>=0){redacted.push(`${flag}=[redacted]`);continue}redacted.push(flag),redactNext=!0}return redacted}export{capturePmCommandScope,isHistoryRedactInvocation,quoteCommandArg,quoteWindowsCommandArg,redactSensitiveCommandArgs,renderPmCommand,resolvePmCommandScopeArgs};
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]="97ad2370-83bf-5a93-b893-144c87d0ae18")}catch{}})();import{findBootstrapCommandTokenIndex}from"./cli-contracts/bootstrap-command-scanner.js";import path from"node:path";import{resolveImplicitPmRoot,resolvePmRoot,resolveWorkspaceRoot}from"../core/store/paths.js";import{isPathWithinDirectory}from"../core/fs/path-utils.js";import{quoteWindowsCommandArg,quoteCommandArg,renderPmCommand}from"../core/shared/command-line.js";const requestedPaths=new WeakMap;function capturePmCommandScope(options){requestedPaths.set(options,options.path)}function environmentCommandScope(cwd){if(!process.env.PM_PATH?.trim())return;const resolved=resolvePmRoot(cwd);return isPathWithinDirectory(resolveWorkspaceRoot(resolved),cwd)&&resolved===resolveImplicitPmRoot(cwd)?void 0:path.relative(cwd,resolved)||"."}function resolvePmCommandScopeArgs(options,cwd=process.cwd()){const requested=requestedPaths.has(options)?requestedPaths.get(options):options.path,selected=requested?.trim()?requested:environmentCommandScope(cwd),args=selected?["--pm-path",selected]:[];return options.noExtensions&&args.push("--no-extensions"),args}const HISTORY_REDACT_SENSITIVE_FLAGS=new Set(["--literal","--regex","--replacement"]);function isHistoryRedactInvocation(argv){const rootIndex=findBootstrapCommandTokenIndex(argv);if(rootIndex===void 0)return!1;if(argv[rootIndex]==="history-redact")return!0;if(argv[rootIndex]!=="history")return!1;const operationArgs=argv.slice(rootIndex+1),operationIndex=findBootstrapCommandTokenIndex(operationArgs);return operationIndex!==void 0&&operationArgs[operationIndex]==="redact"}function redactSensitiveCommandArgs(argv){if(!isHistoryRedactInvocation(argv))return[...argv];const redacted=[];let redactNext=!1;for(const token of argv){if(redactNext){redacted.push("[redacted]"),redactNext=!1;continue}redactNext=!1;const equalsIndex=token.indexOf("="),flag=equalsIndex>=0?token.slice(0,equalsIndex):token;if(!HISTORY_REDACT_SENSITIVE_FLAGS.has(flag)){redacted.push(token);continue}if(equalsIndex>=0){redacted.push(`${flag}=[redacted]`);continue}redacted.push(flag),redactNext=!0}return redacted}export{capturePmCommandScope,isHistoryRedactInvocation,quoteCommandArg,quoteWindowsCommandArg,redactSensitiveCommandArgs,renderPmCommand,resolvePmCommandScopeArgs};
2
2
  //# sourceMappingURL=command-line.js.map
@@ -1,6 +1,6 @@
1
1
  import { type GlobalOptions } from "./runtime-primitives.js";
2
2
  import type { Comment } from "../types/index.js";
3
- import { type AnnotationMutationReceipt,type AnnotationOmissionReceipt } from "./annotations.js";
3
+ import { type AnnotationMutationReceipt,type IndexedAnnotationEntry,type AnnotationOmissionReceipt } from "./annotations.js";
4
4
  /** Documents the comments command options payload exchanged by command, SDK, and package integrations. */
5
5
  export interface CommentsCommandOptions {
6
6
  /** Value that configures or reports add for this contract. */
@@ -21,6 +21,8 @@ includeMeta?:boolean;
21
21
  fullHistory?:boolean;
22
22
  /** Append only when no comment has the same resolved author and text. */
23
23
  ifAbsent?:boolean;
24
+ /** For edit/delete: the created_at of the comment read at that index. Compares timestamps, not identities: an entry with a different created_at is refused, one sharing the timestamp is not. */
25
+ expectAt?:string;
24
26
  /** Value that configures or reports author for this contract. */
25
27
  author?:string;
26
28
  /** Human-readable explanation suitable for logs and agent-facing output. */
@@ -33,7 +35,7 @@ export interface CommentsResult {
33
35
  /** Stable identifier used to reference this record across commands and storage. */
34
36
  id:string;
35
37
  /** Value that configures or reports comments for this contract. */
36
- comments:Comment[];
38
+ comments:Array<IndexedAnnotationEntry<Comment>>;
37
39
  /** Value that configures or reports count for this contract. */
38
40
  count:number;
39
41
  /** Number of total entries represented by this result. */
@@ -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]="8513dce5-85a0-56aa-bb8f-c64756ac4b2e")}catch{}})();import{isFileAbsentError}from"../core/fs/fs-utils.js";import{readFile}from"node:fs/promises";import{EXIT_CODE,PmCliError,createStdinTokenResolver,shouldResolveMutationStdinTokens}from"./runtime-primitives.js";import{assertAnnotationStdinTransportAvailable,isErrnoError,parseAnnotationTextInput,runAnnotationCommand}from"./annotations.js";async function resolveCommentTextSource(options,stdinResolver){const hasAdd=options.add!==void 0,hasStdin=options.stdin===!0,hasFile=typeof options.file=="string",sourceCount=Number(hasAdd)+Number(hasStdin)+Number(hasFile);if(sourceCount===0)return;if(sourceCount>1)throw new PmCliError("Specify comment text using only one input source: --add, --stdin, or --file",EXIT_CODE.USAGE);if(hasAdd)return{value:await stdinResolver.resolveValue(options.add,"--add",shouldResolveMutationStdinTokens(options))??"",emptyFlag:"--add"};if(hasStdin)return assertAnnotationStdinTransportAvailable(options,"--stdin"),{value:await stdinResolver.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};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 resolveCommentInput(options,stdinResolver){const editIndex=options.edit,deleteIndex=options.delete,hasEdit=editIndex!==void 0,hasDelete=deleteIndex!==void 0;if(hasEdit&&hasDelete)throw new PmCliError("Specify only one of --edit or --delete",EXIT_CODE.USAGE);if(editIndex!==void 0&&(!Number.isInteger(editIndex)||editIndex<1))throw new PmCliError("--edit must be a positive integer",EXIT_CODE.USAGE);if(deleteIndex!==void 0&&(!Number.isInteger(deleteIndex)||deleteIndex<1))throw new PmCliError("--delete must be a positive integer",EXIT_CODE.USAGE);if(hasDelete){if(await resolveCommentTextSource(options,stdinResolver)!==void 0)throw new PmCliError("--delete does not take comment text",EXIT_CODE.USAGE);return{mode:"delete",index:deleteIndex}}if(hasEdit){const textSource2=await resolveCommentTextSource(options,stdinResolver);if(textSource2===void 0)throw new PmCliError("--edit requires replacement text via positional [text], --add, --stdin, or --file",EXIT_CODE.USAGE);return{mode:"edit",index:editIndex,value:textSource2.value,emptyFlag:textSource2.emptyFlag}}const textSource=await resolveCommentTextSource(options,stdinResolver);return textSource===void 0?{mode:"list"}:{mode:textSource.emptyFlag==="--add"?"add":textSource.emptyFlag==="--stdin"?"stdin":"file",value:textSource.value,emptyFlag:textSource.emptyFlag}}async function runComments(id,options,global2){const stdinResolver=createStdinTokenResolver(),commentInput=await resolveCommentInput(options,stdinResolver),shouldParseText=commentInput.mode==="add"||commentInput.mode==="edit",rawValue=commentInput.value??"";return runAnnotationCommand(id,options,global2,{input:{...commentInput,rawValue:options.add??rawValue,value:shouldParseText?parseAnnotationTextInput(rawValue,{stripPlainTextPrefix:!0}):rawValue},collectionKey:"comments",op:"comment_add",editOp:"comment_edit",deleteOp:"comment_delete",parseText:raw=>raw,createEntry:entry=>entry,bypassOwnershipConflict:!!(commentInput.mode==="add"&&options.ownershipAppendBypass),conflictGuidance:{required:"Strict ownership also protects annotations. Ask the current owner to run pm release <id>, then run pm claim <id>; use --force only for an explicitly approved override.",examples:["pm claim <id>"],nextSteps:["For an approved append without reassignment: pm package install governance-audit --project; then pm comments --help lists the package-owned append bypass. Edit/delete still require ownership.","For a non-terminal handoff, the current owner runs pm release <id>; then you run pm claim <id> before retrying. Claim refuses work still held by another owner; --force requires an explicitly approved override."]}})}export{runComments};
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]="b6e1bb2f-ac0f-500e-ba35-64f6a2f08868")}catch{}})();import{isFileAbsentError}from"../core/fs/fs-utils.js";import{readFile}from"node:fs/promises";import{EXIT_CODE,PmCliError,createStdinTokenResolver,shouldResolveMutationStdinTokens}from"./runtime-primitives.js";import{assertAnnotationStdinTransportAvailable,isErrnoError,parseAnnotationTextInput,runAnnotationCommand}from"./annotations.js";async function resolveCommentTextSource(options,stdinResolver){const hasAdd=options.add!==void 0,hasStdin=options.stdin===!0,hasFile=typeof options.file=="string",sourceCount=Number(hasAdd)+Number(hasStdin)+Number(hasFile);if(sourceCount===0)return;if(sourceCount>1)throw new PmCliError("Specify comment text using only one input source: --add, --stdin, or --file",EXIT_CODE.USAGE);if(hasAdd)return{value:await stdinResolver.resolveValue(options.add,"--add",shouldResolveMutationStdinTokens(options))??"",emptyFlag:"--add"};if(hasStdin)return assertAnnotationStdinTransportAvailable(options,"--stdin"),{value:await stdinResolver.resolveValue("-","--stdin")??"",emptyFlag:"--stdin"};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 resolveCommentInput(options,stdinResolver){const editIndex=options.edit,deleteIndex=options.delete,hasEdit=editIndex!==void 0,hasDelete=deleteIndex!==void 0;if(hasEdit&&hasDelete)throw new PmCliError("Specify only one of --edit or --delete",EXIT_CODE.USAGE);if(editIndex!==void 0&&(!Number.isInteger(editIndex)||editIndex<1))throw new PmCliError("--edit must be a positive integer",EXIT_CODE.USAGE);if(deleteIndex!==void 0&&(!Number.isInteger(deleteIndex)||deleteIndex<1))throw new PmCliError("--delete must be a positive integer",EXIT_CODE.USAGE);if(hasDelete){if(await resolveCommentTextSource(options,stdinResolver)!==void 0)throw new PmCliError("--delete does not take comment text",EXIT_CODE.USAGE);return{mode:"delete",index:deleteIndex}}if(hasEdit){const textSource2=await resolveCommentTextSource(options,stdinResolver);if(textSource2===void 0)throw new PmCliError("--edit requires replacement text via positional [text], --add, --stdin, or --file",EXIT_CODE.USAGE);return{mode:"edit",index:editIndex,value:textSource2.value,emptyFlag:textSource2.emptyFlag}}const textSource=await resolveCommentTextSource(options,stdinResolver);return textSource===void 0?{mode:"list"}:{mode:textSource.emptyFlag==="--add"?"add":textSource.emptyFlag==="--stdin"?"stdin":"file",value:textSource.value,emptyFlag:textSource.emptyFlag}}async function runComments(id,options,global2){const stdinResolver=createStdinTokenResolver(),commentInput=await resolveCommentInput(options,stdinResolver),shouldParseText=commentInput.mode==="add"||commentInput.mode==="edit",rawValue=commentInput.value??"";return runAnnotationCommand(id,options,global2,{input:{...commentInput,rawValue:options.add??rawValue,value:shouldParseText?parseAnnotationTextInput(rawValue,{stripPlainTextPrefix:!0}):rawValue},collectionKey:"comments",op:"comment_add",editOp:"comment_edit",deleteOp:"comment_delete",parseText:raw=>raw,createEntry:entry=>entry,bypassOwnershipConflict:!!(commentInput.mode==="add"&&options.ownershipAppendBypass),conflictGuidance:{required:"Strict ownership also protects annotations. Ask the current owner to run pm release <id>, then run pm claim <id>; use --force only for an explicitly approved override.",examples:["pm claim <id>"],nextSteps:["For an approved append without reassignment: pm package install governance-audit --project; then pm comments --help lists the package-owned append bypass. Edit/delete still require ownership.","For a non-terminal handoff, the current owner runs pm release <id>; then you run pm claim <id> before retrying. Claim refuses work still held by another owner; --force requires an explicitly approved override."]}})}export{runComments};
2
2
  //# sourceMappingURL=comments.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]="5cb75946-44c9-5e10-a39c-c981011b7efe")}catch{}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{AGGREGATE_FLAGS,ALL_COMMANDS,APPEND_FLAGS,CALENDAR_FLAGS,CLAIM_MUTATION_FLAGS,CLOSE_MANY_FLAGS,CLOSE_MUTATION_FLAGS,CLOSE_TASK_MUTATION_FLAGS,COMPLETION_SHELL_CHOICES,CONTEXT_FLAGS,CONTRACTS_FLAGS,COPY_FLAGS,CREATE_FLAGS,DELETE_MUTATION_FLAGS,DEPS_FLAGS,DUPLICATES_FLAGS,EVENTS_FLAGS,EXTENSION_LIFECYCLE_ACTIONS,EXTENSION_LIFECYCLE_FLAGS,FOCUS_FLAGS,GET_FLAGS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GLOBAL_FLAGS,GRAPH_FLAGS,GUIDE_FLAGS,GUIDE_TOPIC_CHOICES,HEALTH_FLAGS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS,HISTORY_FLAGS,HISTORY_LEAVES,HISTORY_OPERATION_FLAGS,INIT_FLAGS,LIST_FLAGS,MEET_FLAGS,MUTATION_FLAGS,NAMESPACE_NOUNS,NAMESPACE_PREFIXES,NEXT_FLAGS,PACKAGE_LIFECYCLE_ACTIONS,PACKAGE_LIFECYCLE_FLAGS,PLAN_FLAGS,PLAN_SUBCOMMANDS_LIST,RELEASE_MUTATION_FLAGS,REMIND_FLAGS,SCHEMA_SUBCOMMAND_CHOICES,SEARCH_FLAGS,STATS_FLAGS,UPDATE_FLAGS,UPDATE_MANY_FLAGS,UPGRADE_FLAGS,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,mergeFlagStrings,shellDoubleQuote}from"./shared.js";function renderBashDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase(),cacheVar=`PM_COMPLETION_${envKind}_CACHE`,cacheTsVar=`PM_COMPLETION_${envKind}_CACHE_TS`,ttlVar=`PM_COMPLETION_${envKind}_TTL`,escapedFallback=shellDoubleQuote(fallback);return[`_pm_completion_${kind}_choices() {`," local now ttl cache_ts resolved",' now="$(date +%s 2>/dev/null || echo 0)"',` ttl="\${${ttlVar}:-120}"`,` cache_ts="\${${cacheTsVar}:-0}"`,` if [[ -n "\${${cacheVar}:-}" && "$now" -ne 0 && $((now - cache_ts)) -lt "$ttl" ]]; then`,` printf '%s\\n' "$${cacheVar}"`," return 0"," fi",` resolved="$(pm ${command} 2>/dev/null)"`,' if [[ -z "$resolved" ]]; then',` resolved="${escapedFallback}"`," fi",` ${cacheVar}="$resolved"`,` ${cacheTsVar}="$now"`,` printf '%s\\n' "$${cacheVar}"`,"}"]}function generateBashScript(itemTypes=[],tags=[],eagerTagExpansion=!1,runtime={}){const namespaceLeaves=completionNamespaceLeaves(runtime),cmds=ALL_COMMANDS.join(" "),useDynamicTypeExpansion=itemTypes.length===0,typeValues=completionTypeValues(itemTypes,runtime),statusValues=completionStatusValues(runtime),tagValues=joinCompletionValues(tags),listFlags=mergeFlagStrings(LIST_FLAGS,runtime.command_flags?.list),createFlags=mergeFlagStrings(CREATE_FLAGS,runtime.command_flags?.create),updateFlags=mergeFlagStrings(UPDATE_FLAGS,runtime.command_flags?.update),updateManyFlags=mergeFlagStrings(UPDATE_MANY_FLAGS,runtime.command_flags?.["update-many"]),searchFlags=mergeFlagStrings(SEARCH_FLAGS,runtime.command_flags?.search),calendarFlags=mergeFlagStrings(CALENDAR_FLAGS,runtime.command_flags?.calendar),contextFlags=mergeFlagStrings(CONTEXT_FLAGS,runtime.command_flags?.context),useEagerTagExpansion=eagerTagExpansion||tags.length>0,matchWords=values=>`_pm_completion_add_matches "${shellDoubleQuote(values)}"`;return["# bash completion for pm",`# Source this file or add 'eval "$(pm completion bash)"' to ~/.bashrc`,"",...useDynamicTypeExpansion?[...renderBashDynamicChoiceResolver("type","completion-types",typeValues),""]:[],...renderBashDynamicChoiceResolver("status","completion-statuses",statusValues),"","# Treat choices as data: no eval, compgen expansion, or filename globbing.","_pm_completion_add_matches() {"," local line value quoted parse_char parse_index"," local -a values"," while IFS= read -r line; do",' read -r -a values <<< "$line"',' for value in "${values[@]}"; do',' [[ "$value" == "$cur"* ]] || continue',' case "$quote_mode" in'," single)"," quoted=${value//\\'/\\'\\\\\\'\\'}",` COMPREPLY+=("$quoted'")`," ;;"," double)"," quoted="," for (( parse_index=0; parse_index<${#value}; parse_index++ )); do",' parse_char="${value:parse_index:1}"',' case "$parse_char" in'," '\"'|'\\'|'$'|'`') quoted=\"${quoted}\\\\${parse_char}\" ;;",` '!') quoted="\${quoted}\\"'!'\\"" ;;`,' *) quoted="${quoted}${parse_char}" ;;'," esac"," done",' COMPREPLY+=("$quoted\\"")'," ;;"," *)",' case "$value" in'," *[!a-zA-Z0-9_.,:/@%+=-]*)"," quoted=${value//\\'/\\'\\\\\\'\\'}",` COMPREPLY+=("'$quoted'")`," ;;",' *) COMPREPLY+=("$value") ;;'," esac"," ;;"," esac"," done",' done <<< "$1"',"}","","_pm_completion() {"," local cur prev words cword raw_prefix quote_mode parse_char next_char parse_index quote_start escaped"," COMPREPLY=()",' raw_prefix="${COMP_WORDS[COMP_CWORD]}"'," _init_completion 2>/dev/null || {",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," cword=$COMP_CWORD"," }"," # Decode only the current Readline word. Never evaluate or expand it."," quote_mode=plain escaped=0 quote_start=0 cur="," for (( parse_index=0; parse_index<${#raw_prefix}; parse_index++ )); do",' parse_char="${raw_prefix:parse_index:1}"',' if (( escaped )); then cur="${cur}${parse_char}"; escaped=0; continue; fi',' case "$quote_mode" in'," single)",' if [[ "$parse_char" == "\'" ]]; then quote_mode=plain; else cur="${cur}${parse_char}"; fi'," ;;"," double)",' case "$parse_char" in',` '"') quote_mode=plain ;;`," '\\')",' next_char="${raw_prefix:parse_index+1:1}"',' case "$next_char" in'," '\"'|'\\'|'$'|'`') escaped=1 ;;",' *) cur="${cur}\\\\" ;;'," esac"," ;;"," '`') return 0 ;;",' *) cur="${cur}${parse_char}" ;;'," esac"," ;;"," *)",' case "$parse_char" in',` "'") quote_mode=single; quote_start=$parse_index ;;`,` '"') quote_mode=double; quote_start=$parse_index ;;`," '\\') escaped=1 ;;"," '`') return 0 ;;",' *) cur="${cur}${parse_char}" ;;'," esac"," ;;"," esac"," done"," # A mixed quoted segment has a different replacement span; keep it conservative.",' [[ "$quote_mode" != plain && $quote_start -ne 0 ]] && return 0',""," if [[ $cword -eq 1 ]]; then",` ${matchWords(cmds)}`," return 0"," fi","",' if [[ "$prev" == "--type" ]]; then',useDynamicTypeExpansion?' _pm_completion_add_matches "$(_pm_completion_type_choices)"':` ${matchWords(typeValues)}`," return 0"," fi","",' if [[ "$prev" == "--status" ]]; then',' _pm_completion_add_matches "$(_pm_completion_status_choices)"'," return 0"," fi","",...useEagerTagExpansion?[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',` ${matchWords(tagValues)}`," return 0"," fi"]:[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," local now ttl cache_ts tag_values",' now="$(date +%s 2>/dev/null || echo 0)"',' ttl="${PM_COMPLETION_TAG_TTL:-120}"',' cache_ts="${PM_COMPLETION_TAG_CACHE_TS:-0}"',' tag_values="${PM_COMPLETION_TAG_CACHE:-}"',' if [[ -z "$tag_values" || "$now" -eq 0 || $((now - cache_ts)) -ge "$ttl" ]]; then',' tag_values="$(pm completion-tags 2>/dev/null)"',' PM_COMPLETION_TAG_CACHE="$tag_values"',' PM_COMPLETION_TAG_CACHE_TS="$now"'," fi",' _pm_completion_add_matches "$tag_values"'," return 0"," fi"],"",' if [[ "$prev" == "--tag" && ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," COMPREPLY=()"," return 0"," fi","",' local cmd="" command_path="" word_index=1 word'," while (( word_index < cword )); do",' word="${COMP_WORDS[word_index]}"',' case "${word//_/-}" in',` ${GLOBAL_COMPLETION_VALUE_PATTERNS}) (( word_index += 2 )); continue ;;`,` ${GLOBAL_COMPLETION_INLINE_PATTERNS}|${GLOBAL_COMPLETION_SWITCH_PATTERNS}) (( word_index++ )); continue ;;`," --) break ;;"," esac",' if [[ -z "$cmd" ]]; then',' cmd="$word"',' [[ "$cmd" == "ctx" ]] && cmd="context"',' command_path="$cmd"',` case "$cmd" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac`," else",' case "$command_path $word" in',...PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") cmd="${entry.alias}"; command_path="${entry.canonical}" ;;`)," *) break ;;"," esac",` case "$command_path" in ${NAMESPACE_PREFIXES.map(prefix=>`"${prefix}"`).join("|")}) ;; *) (( word_index++ )); break ;; esac`," fi"," (( word_index++ ))"," done",' case "$cmd" in',...HISTORY_OPERATION_FLAGS.flatMap(entry=>[` ${entry.alias})`,` ${matchWords(entry.flags)}`," return 0"," ;;"])," list)",` ${matchWords(listFlags)}`," ;;"," aggregate)",` ${matchWords(AGGREGATE_FLAGS)}`," ;;"," duplicates)",` ${matchWords(DUPLICATES_FLAGS)}`," ;;"," create)",` ${matchWords(createFlags)}`," ;;"," copy)",` ${matchWords(COPY_FLAGS)}`," ;;"," focus)",` ${matchWords(FOCUS_FLAGS)}`," ;;"," update)",` ${matchWords(updateFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.update)}`," fi"," ;;"," update-many)",` ${matchWords(updateManyFlags)}`," ;;"," calendar|cal)",` ${matchWords(calendarFlags)}`," ;;"," context|ctx)",` ${matchWords(contextFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.context)}`," fi"," ;;"," ops)",` ${matchWords(`${GLOBAL_FLAGS} ${namespaceLeaves.ops}`)}`," ;;"," next)",` ${matchWords(NEXT_FLAGS)}`," ;;"," guide)",` ${matchWords(`${GUIDE_FLAGS} ${GUIDE_TOPIC_CHOICES}`)}`," ;;"," search)",` ${matchWords(searchFlags)}`," ;;"," reindex)",` ${matchWords("--mode --progress --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," init)",` ${matchWords(`${INIT_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," config)",` ${matchWords("--criterion --clear-criteria --format --policy --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," extension)",` ${matchWords(`${EXTENSION_LIFECYCLE_ACTIONS} ${EXTENSION_LIFECYCLE_FLAGS}`)}`," ;;"," package|packages)",` ${matchWords(`${PACKAGE_LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS} ${UPGRADE_FLAGS}`)}`," ;;"," comments)",` ${matchWords("--add --body --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," notes)",` ${matchWords("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," learnings)",` ${matchWords("--add --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," files)",` ${matchWords("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," docs)",` ${matchWords("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," append)",` ${matchWords(APPEND_FLAGS)}`," ;;"," deps)",` ${matchWords(DEPS_FLAGS)}`," ;;"," graph)",` ${matchWords(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)}`," ;;"," test)",` ${matchWords("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-all)",` ${matchWords("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-runs)",` ${matchWords("list status logs stop resume --status --limit --stream --tail --force --author --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," validate)",` ${matchWords("--check-completeness --check-metadata --metadata-profile --check-resolution --check-lifecycle --check-stale-blockers --dependency-cycle-severity --parent-cycle-severity --check-files --scan-mode --include-pm-internals --verbose-file-lists --verbose-diagnostics --all-affected-ids --strict-exit --fail-on-warn --fix-hints --auto-fix --dry-run --fix-scope --prune-missing --check-history-drift --check-command-references --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," health)",` ${matchWords(HEALTH_FLAGS)}`," ;;"," history)"," if [[ $word_index -eq $cword ]]; then",` ${matchWords(`${HISTORY_FLAGS} ${HISTORY_LEAVES}`)}`," else",` ${matchWords(HISTORY_FLAGS)}`," fi"," ;;"," events)",` ${matchWords(EVENTS_FLAGS)}`," ;;"," history-author-acknowledge)",` ${matchWords(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," get)",` ${matchWords(GET_FLAGS)}`," ;;"," schema)",' if [[ "$prev" == "policy-mode" ]]; then',` ${matchWords("advise refuse")}`," return"," fi",` ${matchWords(`${SCHEMA_SUBCOMMAND_CHOICES} --definition --policy --message --description --default-status --folder --alias --role --order --type --commands --cli-flag --required --required-on-create --no-allow-unset --required-types --infer --min-count --apply --to --migration-id --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," profile)",` ${matchWords("list show apply lint agile ops research --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," plan)",` ${matchWords(`${PLAN_SUBCOMMANDS_LIST} ${PLAN_FLAGS}`)}`," ;;"," contracts)",` ${matchWords(CONTRACTS_FLAGS)}`," ;;"," gc)",` ${matchWords("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," stats)",` ${matchWords(STATS_FLAGS)}`," ;;"," close-task)",` ${matchWords(CLOSE_TASK_MUTATION_FLAGS)}`," ;;"," close)",` ${matchWords(CLOSE_MUTATION_FLAGS)}`,' if [[ "$cmd" == "close" && $word_index -eq $cword ]]; then',` ${matchWords(namespaceLeaves.close)}`," fi"," ;;"," close-many)",` ${matchWords(CLOSE_MANY_FLAGS)}`," ;;"," release)",` ${matchWords(RELEASE_MUTATION_FLAGS)}`," ;;"," delete)",` ${matchWords(DELETE_MUTATION_FLAGS)}`," ;;"," claim)",` ${matchWords(CLAIM_MUTATION_FLAGS)}`," ;;"," start-task|pause-task)",` ${matchWords(MUTATION_FLAGS)}`," ;;"," meet|event)",` ${matchWords(MEET_FLAGS)}`," ;;"," remind)",` ${matchWords(REMIND_FLAGS)}`," ;;"," completion)",` ${matchWords(COMPLETION_SHELL_CHOICES)}`," ;;"," templates)",` ${matchWords("save list show")}`," ;;"," *)",` ${matchWords(GLOBAL_FLAGS)}`," ;;"," esac"," if [[ $word_index -eq $cword ]]; then",' case "$command_path" in',...Object.entries(namespaceLeaves).filter(([prefix])=>["item","workspace","search"].includes(prefix.split(" ")[0])).map(([prefix,leaves])=>` "${prefix}") ${matchWords(leaves)} ;;`)," esac"," fi",' if [[ "$cmd" == "comments" || "$cmd" == "notes" || "$cmd" == "learnings" ]]; then',` ${matchWords("--text")}`," fi"," return 0","}","","complete -F _pm_completion pm"].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]="dd896f8b-8a4a-54b2-854b-3a8653ed4d18")}catch{}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{AGGREGATE_FLAGS,ALL_COMMANDS,APPEND_FLAGS,CALENDAR_FLAGS,CLAIM_MUTATION_FLAGS,CLOSE_MANY_FLAGS,CLOSE_MUTATION_FLAGS,CLOSE_TASK_MUTATION_FLAGS,COMPLETION_SHELL_CHOICES,CONTEXT_FLAGS,CONTRACTS_FLAGS,COPY_FLAGS,CREATE_FLAGS,DELETE_MUTATION_FLAGS,DEPS_FLAGS,DUPLICATES_FLAGS,EVENTS_FLAGS,EXTENSION_LIFECYCLE_ACTIONS,EXTENSION_LIFECYCLE_FLAGS,FOCUS_FLAGS,GET_FLAGS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GLOBAL_FLAGS,GRAPH_FLAGS,GUIDE_FLAGS,GUIDE_TOPIC_CHOICES,HEALTH_FLAGS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS,HISTORY_FLAGS,HISTORY_LEAVES,HISTORY_OPERATION_FLAGS,INIT_FLAGS,LIST_FLAGS,MEET_FLAGS,MUTATION_FLAGS,NAMESPACE_NOUNS,NAMESPACE_PREFIXES,NEXT_FLAGS,PACKAGE_LIFECYCLE_ACTIONS,PACKAGE_LIFECYCLE_FLAGS,PLAN_FLAGS,PLAN_SUBCOMMANDS_LIST,RELEASE_MUTATION_FLAGS,REMIND_FLAGS,SCHEMA_SUBCOMMAND_CHOICES,SEARCH_FLAGS,STATS_FLAGS,UPDATE_FLAGS,UPDATE_MANY_FLAGS,UPGRADE_FLAGS,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,mergeFlagStrings,shellDoubleQuote}from"./shared.js";function renderBashDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase(),cacheVar=`PM_COMPLETION_${envKind}_CACHE`,cacheTsVar=`PM_COMPLETION_${envKind}_CACHE_TS`,ttlVar=`PM_COMPLETION_${envKind}_TTL`,escapedFallback=shellDoubleQuote(fallback);return[`_pm_completion_${kind}_choices() {`," local now ttl cache_ts resolved",' now="$(date +%s 2>/dev/null || echo 0)"',` ttl="\${${ttlVar}:-120}"`,` cache_ts="\${${cacheTsVar}:-0}"`,` if [[ -n "\${${cacheVar}:-}" && "$now" -ne 0 && $((now - cache_ts)) -lt "$ttl" ]]; then`,` printf '%s\\n' "$${cacheVar}"`," return 0"," fi",` resolved="$(pm ${command} 2>/dev/null)"`,' if [[ -z "$resolved" ]]; then',` resolved="${escapedFallback}"`," fi",` ${cacheVar}="$resolved"`,` ${cacheTsVar}="$now"`,` printf '%s\\n' "$${cacheVar}"`,"}"]}function generateBashScript(itemTypes=[],tags=[],eagerTagExpansion=!1,runtime={}){const namespaceLeaves=completionNamespaceLeaves(runtime),cmds=ALL_COMMANDS.join(" "),useDynamicTypeExpansion=itemTypes.length===0,typeValues=completionTypeValues(itemTypes,runtime),statusValues=completionStatusValues(runtime),tagValues=joinCompletionValues(tags),listFlags=mergeFlagStrings(LIST_FLAGS,runtime.command_flags?.list),createFlags=mergeFlagStrings(CREATE_FLAGS,runtime.command_flags?.create),updateFlags=mergeFlagStrings(UPDATE_FLAGS,runtime.command_flags?.update),updateManyFlags=mergeFlagStrings(UPDATE_MANY_FLAGS,runtime.command_flags?.["update-many"]),searchFlags=mergeFlagStrings(SEARCH_FLAGS,runtime.command_flags?.search),calendarFlags=mergeFlagStrings(CALENDAR_FLAGS,runtime.command_flags?.calendar),contextFlags=mergeFlagStrings(CONTEXT_FLAGS,runtime.command_flags?.context),useEagerTagExpansion=eagerTagExpansion||tags.length>0,matchWords=values=>`_pm_completion_add_matches "${shellDoubleQuote(values)}"`;return["# bash completion for pm",`# Source this file or add 'eval "$(pm completion bash)"' to ~/.bashrc`,"",...useDynamicTypeExpansion?[...renderBashDynamicChoiceResolver("type","completion-types",typeValues),""]:[],...renderBashDynamicChoiceResolver("status","completion-statuses",statusValues),"","# Treat choices as data: no eval, compgen expansion, or filename globbing.","_pm_completion_add_matches() {"," local line value quoted parse_char parse_index"," local -a values"," while IFS= read -r line; do",' read -r -a values <<< "$line"',' for value in "${values[@]}"; do',' [[ "$value" == "$cur"* ]] || continue',' case "$quote_mode" in'," single)"," quoted=${value//\\'/\\'\\\\\\'\\'}",` COMPREPLY+=("$quoted'")`," ;;"," double)"," quoted="," for (( parse_index=0; parse_index<${#value}; parse_index++ )); do",' parse_char="${value:parse_index:1}"',' case "$parse_char" in'," '\"'|'\\'|'$'|'`') quoted=\"${quoted}\\\\${parse_char}\" ;;",` '!') quoted="\${quoted}\\"'!'\\"" ;;`,' *) quoted="${quoted}${parse_char}" ;;'," esac"," done",' COMPREPLY+=("$quoted\\"")'," ;;"," *)",' case "$value" in'," *[!a-zA-Z0-9_.,:/@%+=-]*)"," quoted=${value//\\'/\\'\\\\\\'\\'}",` COMPREPLY+=("'$quoted'")`," ;;",' *) COMPREPLY+=("$value") ;;'," esac"," ;;"," esac"," done",' done <<< "$1"',"}","","_pm_completion() {"," local cur prev words cword raw_prefix quote_mode parse_char next_char parse_index quote_start escaped"," COMPREPLY=()",' raw_prefix="${COMP_WORDS[COMP_CWORD]}"'," _init_completion 2>/dev/null || {",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," cword=$COMP_CWORD"," }"," # Decode only the current Readline word. Never evaluate or expand it."," quote_mode=plain escaped=0 quote_start=0 cur="," for (( parse_index=0; parse_index<${#raw_prefix}; parse_index++ )); do",' parse_char="${raw_prefix:parse_index:1}"',' if (( escaped )); then cur="${cur}${parse_char}"; escaped=0; continue; fi',' case "$quote_mode" in'," single)",' if [[ "$parse_char" == "\'" ]]; then quote_mode=plain; else cur="${cur}${parse_char}"; fi'," ;;"," double)",' case "$parse_char" in',` '"') quote_mode=plain ;;`," '\\')",' next_char="${raw_prefix:parse_index+1:1}"',' case "$next_char" in'," '\"'|'\\'|'$'|'`') escaped=1 ;;",' *) cur="${cur}\\\\" ;;'," esac"," ;;"," '`') return 0 ;;",' *) cur="${cur}${parse_char}" ;;'," esac"," ;;"," *)",' case "$parse_char" in',` "'") quote_mode=single; quote_start=$parse_index ;;`,` '"') quote_mode=double; quote_start=$parse_index ;;`," '\\') escaped=1 ;;"," '`') return 0 ;;",' *) cur="${cur}${parse_char}" ;;'," esac"," ;;"," esac"," done"," # A mixed quoted segment has a different replacement span; keep it conservative.",' [[ "$quote_mode" != plain && $quote_start -ne 0 ]] && return 0',""," if [[ $cword -eq 1 ]]; then",` ${matchWords(cmds)}`," return 0"," fi","",' if [[ "$prev" == "--type" ]]; then',useDynamicTypeExpansion?' _pm_completion_add_matches "$(_pm_completion_type_choices)"':` ${matchWords(typeValues)}`," return 0"," fi","",' if [[ "$prev" == "--status" ]]; then',' _pm_completion_add_matches "$(_pm_completion_status_choices)"'," return 0"," fi","",...useEagerTagExpansion?[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',` ${matchWords(tagValues)}`," return 0"," fi"]:[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," local now ttl cache_ts tag_values",' now="$(date +%s 2>/dev/null || echo 0)"',' ttl="${PM_COMPLETION_TAG_TTL:-120}"',' cache_ts="${PM_COMPLETION_TAG_CACHE_TS:-0}"',' tag_values="${PM_COMPLETION_TAG_CACHE:-}"',' if [[ -z "$tag_values" || "$now" -eq 0 || $((now - cache_ts)) -ge "$ttl" ]]; then',' tag_values="$(pm completion-tags 2>/dev/null)"',' PM_COMPLETION_TAG_CACHE="$tag_values"',' PM_COMPLETION_TAG_CACHE_TS="$now"'," fi",' _pm_completion_add_matches "$tag_values"'," return 0"," fi"],"",' if [[ "$prev" == "--tag" && ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," COMPREPLY=()"," return 0"," fi","",' local cmd="" command_path="" word_index=1 word'," while (( word_index < cword )); do",' word="${COMP_WORDS[word_index]}"',' case "${word//_/-}" in',` ${GLOBAL_COMPLETION_VALUE_PATTERNS}) (( word_index += 2 )); continue ;;`,` ${GLOBAL_COMPLETION_INLINE_PATTERNS}|${GLOBAL_COMPLETION_SWITCH_PATTERNS}) (( word_index++ )); continue ;;`," --) break ;;"," esac",' if [[ -z "$cmd" ]]; then',' cmd="$word"',' [[ "$cmd" == "ctx" ]] && cmd="context"',' command_path="$cmd"',` case "$cmd" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac`," else",' case "$command_path $word" in',...PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") cmd="${entry.alias}"; command_path="${entry.canonical}" ;;`)," *) break ;;"," esac",` case "$command_path" in ${NAMESPACE_PREFIXES.map(prefix=>`"${prefix}"`).join("|")}) ;; *) (( word_index++ )); break ;; esac`," fi"," (( word_index++ ))"," done",' case "$cmd" in',...HISTORY_OPERATION_FLAGS.flatMap(entry=>[` ${entry.alias})`,` ${matchWords(entry.flags)}`," return 0"," ;;"])," list)",` ${matchWords(listFlags)}`," ;;"," aggregate)",` ${matchWords(AGGREGATE_FLAGS)}`," ;;"," duplicates)",` ${matchWords(DUPLICATES_FLAGS)}`," ;;"," create)",` ${matchWords(createFlags)}`," ;;"," copy)",` ${matchWords(COPY_FLAGS)}`," ;;"," focus)",` ${matchWords(FOCUS_FLAGS)}`," ;;"," update)",` ${matchWords(updateFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.update)}`," fi"," ;;"," update-many)",` ${matchWords(updateManyFlags)}`," ;;"," calendar|cal)",` ${matchWords(calendarFlags)}`," ;;"," context|ctx)",` ${matchWords(contextFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.context)}`," fi"," ;;"," ops)",` ${matchWords(`${GLOBAL_FLAGS} ${namespaceLeaves.ops}`)}`," ;;"," next)",` ${matchWords(NEXT_FLAGS)}`," ;;"," guide)",` ${matchWords(`${GUIDE_FLAGS} ${GUIDE_TOPIC_CHOICES}`)}`," ;;"," search)",` ${matchWords(searchFlags)}`," ;;"," reindex)",` ${matchWords("--mode --progress --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," init)",` ${matchWords(`${INIT_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," config)",` ${matchWords("--criterion --clear-criteria --format --policy --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," extension)",` ${matchWords(`${EXTENSION_LIFECYCLE_ACTIONS} ${EXTENSION_LIFECYCLE_FLAGS}`)}`," ;;"," package|packages)",` ${matchWords(`${PACKAGE_LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS} ${UPGRADE_FLAGS}`)}`," ;;"," comments)",` ${matchWords("--add --body --stdin --file --edit --delete --expect-at --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," notes)",` ${matchWords("--add --add-json --stdin --file --edit --delete --expect-at --limit --since --event-type --include-meta --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," learnings)",` ${matchWords("--add --stdin --file --edit --delete --expect-at --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," files)",` ${matchWords("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," docs)",` ${matchWords("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," append)",` ${matchWords(APPEND_FLAGS)}`," ;;"," deps)",` ${matchWords(DEPS_FLAGS)}`," ;;"," graph)",` ${matchWords(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)}`," ;;"," test)",` ${matchWords("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-all)",` ${matchWords("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-runs)",` ${matchWords("list status logs stop resume --status --limit --stream --tail --force --author --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," validate)",` ${matchWords("--check-completeness --check-metadata --metadata-profile --check-resolution --check-lifecycle --check-stale-blockers --dependency-cycle-severity --parent-cycle-severity --check-files --scan-mode --include-pm-internals --verbose-file-lists --verbose-diagnostics --all-affected-ids --strict-exit --fail-on-warn --fix-hints --auto-fix --dry-run --fix-scope --prune-missing --check-history-drift --check-command-references --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," health)",` ${matchWords(HEALTH_FLAGS)}`," ;;"," history)"," if [[ $word_index -eq $cword ]]; then",` ${matchWords(`${HISTORY_FLAGS} ${HISTORY_LEAVES}`)}`," else",` ${matchWords(HISTORY_FLAGS)}`," fi"," ;;"," events)",` ${matchWords(EVENTS_FLAGS)}`," ;;"," history-author-acknowledge)",` ${matchWords(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," get)",` ${matchWords(GET_FLAGS)}`," ;;"," schema)",' if [[ "$prev" == "policy-mode" ]]; then',` ${matchWords("advise refuse")}`," return"," fi",` ${matchWords(`${SCHEMA_SUBCOMMAND_CHOICES} --definition --policy --message --description --default-status --folder --alias --role --order --type --commands --cli-flag --required --required-on-create --no-allow-unset --required-types --infer --min-count --apply --to --migration-id --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," profile)",` ${matchWords("list show apply lint agile ops research --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," plan)",` ${matchWords(`${PLAN_SUBCOMMANDS_LIST} ${PLAN_FLAGS}`)}`," ;;"," contracts)",` ${matchWords(CONTRACTS_FLAGS)}`," ;;"," gc)",` ${matchWords("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," stats)",` ${matchWords(STATS_FLAGS)}`," ;;"," close-task)",` ${matchWords(CLOSE_TASK_MUTATION_FLAGS)}`," ;;"," close)",` ${matchWords(CLOSE_MUTATION_FLAGS)}`,' if [[ "$cmd" == "close" && $word_index -eq $cword ]]; then',` ${matchWords(namespaceLeaves.close)}`," fi"," ;;"," close-many)",` ${matchWords(CLOSE_MANY_FLAGS)}`," ;;"," release)",` ${matchWords(RELEASE_MUTATION_FLAGS)}`," ;;"," delete)",` ${matchWords(DELETE_MUTATION_FLAGS)}`," ;;"," claim)",` ${matchWords(CLAIM_MUTATION_FLAGS)}`," ;;"," start-task|pause-task)",` ${matchWords(MUTATION_FLAGS)}`," ;;"," meet|event)",` ${matchWords(MEET_FLAGS)}`," ;;"," remind)",` ${matchWords(REMIND_FLAGS)}`," ;;"," completion)",` ${matchWords(COMPLETION_SHELL_CHOICES)}`," ;;"," templates)",` ${matchWords("save list show")}`," ;;"," *)",` ${matchWords(GLOBAL_FLAGS)}`," ;;"," esac"," if [[ $word_index -eq $cword ]]; then",' case "$command_path" in',...Object.entries(namespaceLeaves).filter(([prefix])=>["item","workspace","search"].includes(prefix.split(" ")[0])).map(([prefix,leaves])=>` "${prefix}") ${matchWords(leaves)} ;;`)," esac"," fi",' if [[ "$cmd" == "comments" || "$cmd" == "notes" || "$cmd" == "learnings" ]]; then',` ${matchWords("--text")}`," fi"," return 0","}","","complete -F _pm_completion pm"].join(`
2
2
  `)}export{generateBashScript};
3
3
  //# sourceMappingURL=bash.js.map
@@ -1,4 +1,4 @@
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]="8f625fcd-badb-5483-82b8-ce4a247d2186")}catch{}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{SCAFFOLD_CAPABILITIES}from"../extension/scaffold.js";import{ALL_COMMANDS,ATTEST_INVOCATIONS,COMMAND_COMPLETION_DESCRIPTIONS,EXTENSION_LIFECYCLE_ACTIONS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GUIDE_TOPIC_CHOICES,HIDDEN_COMMAND_ALIASES,NAMESPACE_NOUNS,NAMESPACE_PREFIXES,PACKAGE_LIFECYCLE_ACTIONS,RESTORE_INVOCATIONS,SCHEMA_SUBCOMMAND_CHOICES,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,normalizeRuntimeCompletionFlags}from"./shared.js";function escapeFishSource(value){return value.replaceAll("\\","\\\\").replaceAll("'","\\'")}function escapeFishChoices(value){return escapeFishSource(value.replace(/([^a-zA-Z0-9_:./\s-])/gu,"\\$1"))}const FISH_COMMAND_DESCRIPTION_OVERRIDES=new Map([["calendar","Show deadline/reminder calendar views"],["schema","Inspect and manage runtime schema"],["profile","List, show, apply, and lint project profiles (archetype bundles)"],["plan","Agent-optimized Plan workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],["start-task","Lifecycle alias to claim and set in-progress"]]);function renderFishCommandDescriptions(){return[...COMMAND_COMPLETION_DESCRIPTIONS,["ops","Workspace maintenance and diagnostics"]].filter(([command])=>command!=="help"&&!HIDDEN_COMMAND_ALIASES.has(command)).map(([command,description])=>{const fishDescription=FISH_COMMAND_DESCRIPTION_OVERRIDES.get(command)??description;return`complete -c pm -n __pm_no_subcommand -a ${command.padEnd(16)} -d '${fishDescription}'`}).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]="c87dfc55-d79e-5210-b74b-8afb6280770c")}catch{}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{SCAFFOLD_CAPABILITIES}from"../extension/scaffold.js";import{ALL_COMMANDS,ATTEST_INVOCATIONS,COMMAND_COMPLETION_DESCRIPTIONS,EXTENSION_LIFECYCLE_ACTIONS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GUIDE_TOPIC_CHOICES,HIDDEN_COMMAND_ALIASES,NAMESPACE_NOUNS,NAMESPACE_PREFIXES,PACKAGE_LIFECYCLE_ACTIONS,RESTORE_INVOCATIONS,SCHEMA_SUBCOMMAND_CHOICES,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,normalizeRuntimeCompletionFlags}from"./shared.js";function escapeFishSource(value){return value.replaceAll("\\","\\\\").replaceAll("'","\\'")}function escapeFishChoices(value){return escapeFishSource(value.replace(/([^a-zA-Z0-9_:./\s-])/gu,"\\$1"))}const FISH_COMMAND_DESCRIPTION_OVERRIDES=new Map([["calendar","Show deadline/reminder calendar views"],["schema","Inspect and manage runtime schema"],["profile","List, show, apply, and lint project profiles (archetype bundles)"],["plan","Agent-optimized Plan workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],["start-task","Lifecycle alias to claim and set in-progress"]]);function renderFishCommandDescriptions(){return[...COMMAND_COMPLETION_DESCRIPTIONS,["ops","Workspace maintenance and diagnostics"]].filter(([command])=>command!=="help"&&!HIDDEN_COMMAND_ALIASES.has(command)).map(([command,description])=>{const fishDescription=FISH_COMMAND_DESCRIPTION_OVERRIDES.get(command)??description;return`complete -c pm -n __pm_no_subcommand -a ${command.padEnd(16)} -d '${fishDescription}'`}).join(`
2
2
  `)}function renderFishRuntimeFieldFlagSpecs(commands,runtimeFlags){const normalizedFlags=normalizeRuntimeCompletionFlags(runtimeFlags).map(flag=>flag.slice(2));if(commands.length===0||normalizedFlags.length===0)return"";const lines=[];for(const command of commands){const predicate=NAMESPACE_NOUNS.includes(command)||PM_NAMESPACED_COMMAND_ALIASES.some(entry=>entry.alias===command)?"__pm_history_operation":"__fish_seen_subcommand_from";for(const flag of normalizedFlags)lines.push(`complete -c pm -n '${predicate} ${command}' -l '${escapeFishSource(flag)}' -d 'Runtime schema field flag' -r`)}return`${lines.join(`
3
3
  `)}
4
4
  `}function renderFishDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase(),escapedFallback=escapeFishSource(fallback);return`
@@ -748,6 +748,7 @@ complete -c pm -n '__fish_seen_subcommand_from notes' -l file -d 'Read entry tex
748
748
  complete -c pm -n '__fish_seen_subcommand_from notes' -l edit -d 'Replace the entry at a 1-based index' -r
749
749
  complete -c pm -n '__fish_seen_subcommand_from notes' -l delete -d 'Delete the entry at a 1-based index' -r
750
750
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l limit -d 'Return only latest n entries' -r
751
+ complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l expect-at -d 'Edit/delete only if the entry created_at matches' -r
751
752
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l full-history -d 'Return complete post-mutation history'
752
753
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l author -d 'Entry author' -r
753
754
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l message -d 'History message' -r
@@ -1,4 +1,4 @@
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]="81d4e33a-0a99-55ee-9d41-84e6e711eb80")}catch{}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{SCAFFOLD_CAPABILITIES}from"../extension/scaffold.js";import{ATTEST_INVOCATIONS,COMMAND_COMPLETION_DESCRIPTIONS,EXTENSION_LIFECYCLE_ACTIONS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GUIDE_TOPIC_CHOICES,HIDDEN_COMMAND_ALIASES,NAMESPACE_NOUNS,PACKAGE_LIFECYCLE_ACTIONS,RESTORE_INVOCATIONS,SCHEMA_SUBCOMMAND_CHOICES,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,normalizeRuntimeCompletionFlags,shellDoubleQuote}from"./shared.js";function escapeZshStaticChoices(value){return value.replace(/([^a-zA-Z0-9_./\s-])/gu,"\\$1").replaceAll("'","'\\''")}function renderZshRuntimeFieldFlagSpecs(runtimeFlags){const normalized=normalizeRuntimeCompletionFlags(runtimeFlags);return normalized.length===0?"":`${normalized.map(flag=>` '${escapeZshStaticChoices(flag)}[Runtime schema field flag]:value' \\`).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]="bb5fead2-4f62-5056-a07b-30efc42af0dd")}catch{}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{SCAFFOLD_CAPABILITIES}from"../extension/scaffold.js";import{ATTEST_INVOCATIONS,COMMAND_COMPLETION_DESCRIPTIONS,EXTENSION_LIFECYCLE_ACTIONS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GUIDE_TOPIC_CHOICES,HIDDEN_COMMAND_ALIASES,NAMESPACE_NOUNS,PACKAGE_LIFECYCLE_ACTIONS,RESTORE_INVOCATIONS,SCHEMA_SUBCOMMAND_CHOICES,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,normalizeRuntimeCompletionFlags,shellDoubleQuote}from"./shared.js";function escapeZshStaticChoices(value){return value.replace(/([^a-zA-Z0-9_./\s-])/gu,"\\$1").replaceAll("'","'\\''")}function renderZshRuntimeFieldFlagSpecs(runtimeFlags){const normalized=normalizeRuntimeCompletionFlags(runtimeFlags);return normalized.length===0?"":`${normalized.map(flag=>` '${escapeZshStaticChoices(flag)}[Runtime schema field flag]:value' \\`).join(`
2
2
  `)}
3
3
  `}function renderZshArgumentSpecs(specs,options={}){const trailingContinuation=options.trailingContinuation??!0,lastSpecIndex=specs.length-1;return specs.map((spec,index)=>` ${spec}${trailingContinuation||index!==lastSpecIndex?" \\":""}`).join(`
4
4
  `)}function renderZshCommandDescriptions(){return[...COMMAND_COMPLETION_DESCRIPTIONS,["ops","Workspace maintenance and diagnostics"]].filter(([command])=>!HIDDEN_COMMAND_ALIASES.has(command)).map(([command,description])=>` '${command}:${description}'`).join(`
@@ -695,6 +695,7 @@ ${renderZshArgumentSpecs(ATTEST_INVOCATIONS.map(flag=>`'${flag.flag}[${flag.desc
695
695
  '--edit[Replace the comment at 1-based index (text from positional/--add/--stdin/--file)]:index' \\
696
696
  '--delete[Delete the comment at 1-based index]:index' \\
697
697
  '--limit[Return only latest n entries]:number' \\
698
+ '--expect-at[Edit/delete only if the entry created_at matches]:timestamp' \\
698
699
  '--full-history[Return complete post-mutation history]' \\
699
700
  '--if-absent[Append only when the resolved author and text are absent]' \\
700
701
  '--author[Entry author (falls back to PM_AUTHOR/settings)]:author' \\
@@ -716,6 +717,7 @@ ${renderZshArgumentSpecs(ATTEST_INVOCATIONS.map(flag=>`'${flag.flag}[${flag.desc
716
717
  '--since[Return structured events at or after an ISO timestamp]:timestamp' \\
717
718
  '--event-type[Return structured events with this top-level type]:event_type' \\
718
719
  '--include-meta[Include result counts and truncation metadata]' \\
720
+ '--expect-at[Edit/delete only if the entry created_at matches]:timestamp' \\
719
721
  '--full-history[Return complete post-mutation history]' \\
720
722
  '--if-absent[Append only when the resolved author and text are absent]' \\
721
723
  '--author[Entry author (falls back to PM_AUTHOR/settings)]:author' \\
@@ -733,6 +735,7 @@ ${renderZshArgumentSpecs(ATTEST_INVOCATIONS.map(flag=>`'${flag.flag}[${flag.desc
733
735
  '--edit[Replace the entry at a 1-based index]:index' \\
734
736
  '--delete[Delete the entry at a 1-based index]:index' \\
735
737
  '--limit[Return only latest n entries]:number' \\
738
+ '--expect-at[Edit/delete only if the entry created_at matches]:timestamp' \\
736
739
  '--full-history[Return complete post-mutation history]' \\
737
740
  '--if-absent[Append only when the resolved author and text are absent]' \\
738
741
  '--author[Entry author (falls back to PM_AUTHOR/settings)]:author' \\
@@ -86,9 +86,13 @@ export declare function composeContextIntentContracts(workspaceContracts?:readon
86
86
  export declare function resolveContextIntentContract(command:string,intent:string,contracts?:readonly PmContextIntentContract[],positionalArguments?:readonly string[]):PmContextIntentContract | undefined;
87
87
  /** Apply one declared read intent's defaults while preserving explicit caller options. */
88
88
  export declare function applyContextIntentProjection(command:"context" | "get" | "list" | "next" | "search",options:Record<string,unknown>,positionalArguments?:readonly string[]):Record<string,unknown>;
89
- interface ContextIntentCursorEnvelope {
89
+ /** Decoded continuation cursor of a row-compacted context intent read. */
90
+ export interface ContextIntentCursorEnvelope {
91
+ /** Fingerprint of the request the cursor continues, so a changed request is refused. */
90
92
  fingerprint:string;
93
+ /** Index of the last row already delivered. */
91
94
  after_index:number;
95
+ /** Snapshot identity the continuation reads from, when the producer pinned one. */
92
96
  snapshot?:string;
93
97
  }
94
98
  /** Decode the cursor fields required to preserve a row-compacted continuation. */