@unbrained/pm-cli 2026.10.28 → 2026.10.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +50 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/commands/lifecycle/append.d.ts +4 -0
  5. package/dist/cli/commands/lifecycle/append.js +1 -1
  6. package/dist/cli/commands/lifecycle/create.d.ts +4 -0
  7. package/dist/cli/commands/lifecycle/create.js +1 -1
  8. package/dist/cli/commands/lifecycle/plan.d.ts +3 -0
  9. package/dist/cli/commands/lifecycle/plan.js +1 -1
  10. package/dist/cli/commands/lifecycle/update-many.d.ts +4 -0
  11. package/dist/cli/commands/lifecycle/update-many.js +1 -1
  12. package/dist/cli/commands/lifecycle/update.d.ts +4 -0
  13. package/dist/cli/commands/lifecycle/update.js +1 -1
  14. package/dist/cli/error-guidance.d.ts +45 -5
  15. package/dist/cli/error-guidance.js +5 -3
  16. package/dist/cli/extension-command-help.d.ts +1 -0
  17. package/dist/cli/extension-command-help.js +2 -2
  18. package/dist/cli/help-content.js +2 -2
  19. package/dist/cli/main.d.ts +1 -5
  20. package/dist/cli/main.js +5 -5
  21. package/dist/cli/migration-gates.d.ts +1 -1
  22. package/dist/cli/migration-gates.js +1 -1
  23. package/dist/cli/preflight-warnings.d.ts +11 -0
  24. package/dist/cli/preflight-warnings.js +4 -0
  25. package/dist/cli/register-list-query.js +3 -3
  26. package/dist/cli/register-mutation.js +2 -2
  27. package/dist/cli-bundle/bundle-manifest.json +1 -1
  28. package/dist/cli-bundle/chunks/chunk-24J6TNYE.js +8 -0
  29. package/dist/cli-bundle/chunks/{chunk-YYD5MNAV.js → chunk-2AHSPMKJ.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-35Q2B2GJ.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-43R7UTWV.js +2 -0
  32. package/dist/cli-bundle/chunks/chunk-6PSDQ7T7.js +8 -0
  33. package/dist/cli-bundle/chunks/{chunk-YUBUNECD.js → chunk-BS2KXT24.js} +84 -84
  34. package/dist/cli-bundle/chunks/{chunk-D3AIQZXF.js → chunk-GMBDZID5.js} +3 -3
  35. package/dist/cli-bundle/chunks/chunk-HSBTITO4.js +3 -0
  36. package/dist/cli-bundle/chunks/{chunk-LWW4F4G2.js → chunk-MRUA2Z43.js} +2 -2
  37. package/dist/cli-bundle/chunks/chunk-P3LNMWL2.js +2 -0
  38. package/dist/cli-bundle/chunks/chunk-PT7TS6E7.js +2 -0
  39. package/dist/cli-bundle/chunks/{chunk-TH5KPAN4.js → chunk-SBVX5CMV.js} +2 -2
  40. package/dist/cli-bundle/chunks/{chunk-D6P6IBPN.js → chunk-TL3O5GZA.js} +45 -45
  41. package/dist/cli-bundle/chunks/chunk-U7JXZMU5.js +6 -0
  42. package/dist/cli-bundle/chunks/{chunk-DM3PICGU.js → chunk-V6EWBTNH.js} +2 -2
  43. package/dist/cli-bundle/chunks/chunk-VC7TA67O.js +20 -0
  44. package/dist/cli-bundle/chunks/chunk-WNF6FOL7.js +31 -0
  45. package/dist/cli-bundle/chunks/chunk-WRXQAW7Q.js +114 -0
  46. package/dist/cli-bundle/chunks/{chunk-RZQNFHXO.js → chunk-WX25MU4N.js} +3 -3
  47. package/dist/cli-bundle/chunks/chunk-XDDPSWIW.js +2 -0
  48. package/dist/cli-bundle/chunks/chunk-YT5D5HNG.js +2 -0
  49. package/dist/cli-bundle/chunks/chunk-ZTJVOBDU.js +128 -0
  50. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-LHLE7PSG.js → indexed-receipt-blobs-KGMJVFH2.js} +2 -2
  51. package/dist/cli-bundle/chunks/item-transaction-UWV6UNSV.js +2 -0
  52. package/dist/cli-bundle/chunks/{mutation-admission-GKDKHRTZ.js → mutation-admission-I4RHIT3Q.js} +2 -2
  53. package/dist/cli-bundle/chunks/{register-list-query-MHJJUM6M.js → register-list-query-MVDL5EXG.js} +6 -6
  54. package/dist/cli-bundle/chunks/register-mutation-GAF7LXRB.js +20 -0
  55. package/dist/cli-bundle/chunks/register-operations-JLFRL36Q.js +2 -0
  56. package/dist/cli-bundle/chunks/{register-setup-WUZ2ZSMY.js → register-setup-MZN6ONB3.js} +2 -2
  57. package/dist/cli-bundle/chunks/{settlement-hook-MN3Y7LVX.js → settlement-hook-YWSWFOZY.js} +2 -2
  58. package/dist/cli-bundle/chunks/{stage-2FYJGGG3.js → stage-2ZORTOF6.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-4GN2ZPT5.js → chunk-2J7T2UCH.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-YLVHHWHN.js → chunk-4PW5XWVI.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/chunk-4QPGJO2G.js +26 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-IQKLJFJE.js → chunk-57HPXGOQ.js} +18 -18
  63. package/dist/cli-bundle/focused-chunks/chunk-5MCGYBOQ.js +91 -0
  64. package/dist/cli-bundle/focused-chunks/chunk-6F6APBCX.js +3 -0
  65. package/dist/cli-bundle/focused-chunks/chunk-AFVN2KCP.js +44 -0
  66. package/dist/cli-bundle/focused-chunks/{chunk-ON5WFDCG.js → chunk-DFUTCKUF.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/chunk-EA65HVBO.js +12 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-GP2WU43K.js +26 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-C2GLO7HU.js → chunk-HPWT3RBG.js} +54 -54
  70. package/dist/cli-bundle/focused-chunks/chunk-HSAEEWSI.js +2 -0
  71. package/dist/cli-bundle/focused-chunks/{chunk-7SZPZOIC.js → chunk-JLXGRDTG.js} +3 -3
  72. package/dist/cli-bundle/focused-chunks/chunk-JNKRUCVZ.js +2 -0
  73. package/dist/cli-bundle/focused-chunks/{chunk-JTCGDODH.js → chunk-KH5QJXY7.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/chunk-KKRIFBSL.js +2 -0
  75. package/dist/cli-bundle/focused-chunks/{chunk-TUN4M757.js → chunk-MW77Q3AQ.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/chunk-NOKG4RFN.js +22 -0
  77. package/dist/cli-bundle/focused-chunks/{chunk-DRN4W3YJ.js → chunk-NRBUMDLF.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{chunk-ML5JIUM6.js → chunk-PC3R5CJV.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/chunk-PFBQOZPK.js +2 -0
  80. package/dist/cli-bundle/focused-chunks/{chunk-R3EA3SDW.js → chunk-QFMJGQGO.js} +3 -3
  81. package/dist/cli-bundle/focused-chunks/{chunk-I4X6AKOO.js → chunk-SFQKCA5K.js} +2 -2
  82. package/dist/cli-bundle/focused-chunks/chunk-WHIE2C6Q.js +2 -0
  83. package/dist/cli-bundle/focused-chunks/chunk-Y6UYRMVG.js +6 -0
  84. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-5H6RMRTK.js → indexed-receipt-blobs-KHWT44EK.js} +2 -2
  85. package/dist/cli-bundle/focused-chunks/item-transaction-LU75EG7D.js +2 -0
  86. package/dist/cli-bundle/focused-chunks/{mutation-admission-TM3SVU2O.js → mutation-admission-KDJ7SCPA.js} +2 -2
  87. package/dist/cli-bundle/focused-chunks/{settlement-hook-LBVWWSCF.js → settlement-hook-SJV52ZTV.js} +2 -2
  88. package/dist/cli-bundle/focused-chunks/{stage-7ZBRX2Q2.js → stage-R4KEBO37.js} +2 -2
  89. package/dist/cli-bundle/main.js +26 -22
  90. package/dist/cli-bundle/sdk-authoring.js +1 -1
  91. package/dist/cli-bundle/sdk-contracts.js +4 -4
  92. package/dist/cli-bundle/sdk-core.js +1 -43
  93. package/dist/cli-bundle/sdk-governance.js +1 -1
  94. package/dist/cli-bundle/sdk-graph.js +1 -1
  95. package/dist/cli-bundle/sdk-merge.js +61 -61
  96. package/dist/cli-bundle/sdk-query.js +1 -1
  97. package/dist/cli-bundle/sdk-runtime.js +1 -1
  98. package/dist/cli-bundle/sdk-testing.js +1 -1
  99. package/dist/cli-bundle/sdk.js +11 -11
  100. package/dist/core/config/nested-settings.js +1 -1
  101. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  102. package/dist/core/extensions/extension-types.d.ts +4 -0
  103. package/dist/core/extensions/extension-types.js +1 -1
  104. package/dist/core/extensions/loader.js +1 -1
  105. package/dist/core/history/operation-contract.d.ts +2 -2
  106. package/dist/core/history/operation-contract.js +1 -1
  107. package/dist/core/item/literal-mutation-input.d.ts +12 -0
  108. package/dist/core/item/literal-mutation-input.js +2 -0
  109. package/dist/core/item/parse.d.ts +2 -0
  110. package/dist/core/item/parse.js +2 -2
  111. package/dist/core/lock/lock.js +4 -4
  112. package/dist/core/output/output.js +3 -3
  113. package/dist/core/schema/fields-file.js +1 -1
  114. package/dist/core/sentry/helpers.d.ts +6 -0
  115. package/dist/core/sentry/helpers.js +1 -1
  116. package/dist/core/sentry/instrument.d.ts +1 -1
  117. package/dist/core/sentry/instrument.js +1 -1
  118. package/dist/core/shared/constants.js +1 -1
  119. package/dist/core/shared/errors.d.ts +6 -0
  120. package/dist/core/shared/errors.js +1 -1
  121. package/dist/core/shared/output-unicode.d.ts +10 -0
  122. package/dist/core/shared/output-unicode.js +2 -0
  123. package/dist/core/store/item-store.js +1 -1
  124. package/dist/core/store/settings-validator.d.ts +1 -0
  125. package/dist/core/store/settings-validator.js +1 -1
  126. package/dist/core/store/settings.js +1 -1
  127. package/dist/core/telemetry/policy.d.ts +8 -0
  128. package/dist/core/telemetry/policy.js +1 -1
  129. package/dist/core/telemetry/runtime.js +3 -3
  130. package/dist/sdk/agent/command-recovery.d.ts +15 -0
  131. package/dist/sdk/agent/command-recovery.js +1 -1
  132. package/dist/sdk/cli-bootstrap.js +1 -1
  133. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +28 -0
  134. package/dist/sdk/cli-contracts/agent-output-contracts.js +2 -2
  135. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  136. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  137. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  138. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  139. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  140. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  141. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  142. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  143. package/dist/sdk/cli-contracts.d.ts +1 -1
  144. package/dist/sdk/cli-contracts.js +1 -1
  145. package/dist/sdk/completion/fish.js +4 -4
  146. package/dist/sdk/completion/zsh.js +3 -3
  147. package/dist/sdk/config.d.ts +1 -0
  148. package/dist/sdk/config.js +1 -1
  149. package/dist/sdk/core.d.ts +1 -0
  150. package/dist/sdk/core.js +1 -1
  151. package/dist/sdk/error-runtime.d.ts +9 -0
  152. package/dist/sdk/error-runtime.js +1 -1
  153. package/dist/sdk/errors.js +1 -1
  154. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  155. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  156. package/dist/sdk/index.d.ts +2 -2
  157. package/dist/sdk/index.js +1 -1
  158. package/dist/sdk/item-transaction.d.ts +33 -2
  159. package/dist/sdk/item-transaction.js +1 -1
  160. package/dist/sdk/lifecycle/append.js +1 -1
  161. package/dist/sdk/lifecycle/claim.js +1 -1
  162. package/dist/sdk/lifecycle/cli-input.d.ts +4 -0
  163. package/dist/sdk/lifecycle/cli-input.js +2 -0
  164. package/dist/sdk/lifecycle/close.js +1 -1
  165. package/dist/sdk/lifecycle/create.js +1 -1
  166. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
  167. package/dist/sdk/lifecycle/plan.d.ts +2 -3
  168. package/dist/sdk/lifecycle/plan.js +1 -1
  169. package/dist/sdk/lifecycle/reopen.js +1 -1
  170. package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +45 -0
  171. package/dist/sdk/lifecycle/repeated-terminal-state.js +2 -0
  172. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +9 -0
  173. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  174. package/dist/sdk/lifecycle/update-many.d.ts +0 -1
  175. package/dist/sdk/lifecycle/update-many.js +1 -1
  176. package/dist/sdk/lifecycle/update.d.ts +29 -1
  177. package/dist/sdk/lifecycle/update.js +2 -2
  178. package/dist/sdk/output/table-rows.d.ts +15 -1
  179. package/dist/sdk/output/table-rows.js +1 -1
  180. package/dist/sdk/output.d.ts +1 -0
  181. package/dist/sdk/output.js +2 -2
  182. package/dist/sdk/ownership-source.d.ts +18 -0
  183. package/dist/sdk/ownership-source.js +1 -1
  184. package/dist/sdk/public-surface.json +1 -1
  185. package/dist/sdk/query/get.d.ts +1 -1
  186. package/dist/sdk/query/get.js +1 -1
  187. package/dist/sdk/query/history.d.ts +2 -0
  188. package/dist/sdk/query/history.js +1 -1
  189. package/dist/sdk/query/next-ranking-policy.d.ts +35 -0
  190. package/dist/sdk/query/next-ranking-policy.js +2 -0
  191. package/dist/sdk/query/next.d.ts +12 -2
  192. package/dist/sdk/query/next.js +2 -2
  193. package/dist/sdk/query/projection-contracts.d.ts +4 -0
  194. package/dist/sdk/query/projection-contracts.js +1 -1
  195. package/dist/sdk/read-output/surfaces.d.ts +27 -0
  196. package/dist/sdk/read-output/surfaces.js +2 -0
  197. package/dist/sdk/read-output-contracts.js +1 -1
  198. package/dist/sdk/runtime/mutation-value-validation.d.ts +16 -0
  199. package/dist/sdk/runtime/mutation-value-validation.js +2 -0
  200. package/dist/sdk/runtime-input.js +1 -1
  201. package/dist/sdk/runtime-primitives.d.ts +2 -0
  202. package/dist/sdk/runtime-primitives.js +1 -1
  203. package/dist/sdk/runtime.d.ts +14 -0
  204. package/dist/sdk/runtime.js +1 -1
  205. package/dist/sdk/structured-mutations.js +1 -1
  206. package/dist/sdk/test/execution-receipts.d.ts +25 -0
  207. package/dist/sdk/test/execution-receipts.js +2 -2
  208. package/dist/sdk/test/execution.d.ts +5 -0
  209. package/dist/sdk/test/execution.js +2 -2
  210. package/dist/sdk/workspace-transaction-gc.js +1 -1
  211. package/dist/sdk/workspace-transaction.d.ts +54 -0
  212. package/dist/sdk/workspace-transaction.js +2 -2
  213. package/dist/types.d.ts +2 -0
  214. package/dist/types.js +1 -1
  215. package/docs/AGENT_GUIDE.md +1 -1
  216. package/docs/AGENT_OUTPUT_ENCODINGS.md +12 -0
  217. package/docs/AGENT_UX_CONTRACTS.md +2 -1
  218. package/docs/COMMANDS.md +73 -15
  219. package/docs/CONFIGURATION.md +48 -1
  220. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +26 -0
  221. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +24 -2
  222. package/docs/PACKED_FIRST_RUN.md +2 -1
  223. package/docs/READ_OUTPUT_CONTRACTS.md +24 -6
  224. package/docs/SDK.md +207 -11
  225. package/docs/TESTING.md +46 -2
  226. package/docs/agent-task-token-baseline.json +1 -1
  227. package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -1
  228. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +6 -3
  229. package/marketplace.json +1 -1
  230. package/package.json +1 -1
  231. package/packages/pm-beads/package.json +1 -1
  232. package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
  233. package/packages/pm-calendar/package.json +1 -1
  234. package/packages/pm-command-kit/package.json +1 -1
  235. package/packages/pm-digital-twin/package.json +1 -1
  236. package/packages/pm-governance-audit/package.json +1 -1
  237. package/packages/pm-guide-shell/package.json +1 -1
  238. package/packages/pm-kanban/package.json +1 -1
  239. package/packages/pm-lifecycle-hooks/package.json +1 -1
  240. package/packages/pm-linked-test-adapters/package.json +1 -1
  241. package/packages/pm-search-advanced/package.json +1 -1
  242. package/packages/pm-templates/package.json +1 -1
  243. package/packages/pm-todos/package.json +1 -1
  244. package/packages/pm-vcs/package.json +1 -1
  245. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  246. package/plugins/pm-claude/package.json +1 -1
  247. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  248. package/plugins/pm-codex/package.json +1 -1
  249. package/plugins/pm-codex/plugin.json +1 -1
  250. package/runtime-dependencies.json +1 -1
  251. package/dist/cli-bundle/chunks/chunk-2J7I54MQ.js +0 -2
  252. package/dist/cli-bundle/chunks/chunk-3KMYHYJV.js +0 -2
  253. package/dist/cli-bundle/chunks/chunk-4D25HF3V.js +0 -2
  254. package/dist/cli-bundle/chunks/chunk-7V37RC2L.js +0 -114
  255. package/dist/cli-bundle/chunks/chunk-AHVN4GHF.js +0 -31
  256. package/dist/cli-bundle/chunks/chunk-CS7QDSUX.js +0 -128
  257. package/dist/cli-bundle/chunks/chunk-CXUQEZDX.js +0 -8
  258. package/dist/cli-bundle/chunks/chunk-DKLEDWVW.js +0 -3
  259. package/dist/cli-bundle/chunks/chunk-E5QBZ4HI.js +0 -8
  260. package/dist/cli-bundle/chunks/chunk-JESLOJD7.js +0 -2
  261. package/dist/cli-bundle/chunks/chunk-PQLRKFPZ.js +0 -20
  262. package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +0 -2
  263. package/dist/cli-bundle/chunks/chunk-XHONSCLJ.js +0 -6
  264. package/dist/cli-bundle/chunks/chunk-ZX3XMTZG.js +0 -2
  265. package/dist/cli-bundle/chunks/register-mutation-SN425O3R.js +0 -20
  266. package/dist/cli-bundle/chunks/register-operations-EYUIUGPW.js +0 -2
  267. package/dist/cli-bundle/focused-chunks/chunk-3EHVI673.js +0 -2
  268. package/dist/cli-bundle/focused-chunks/chunk-46WLWK73.js +0 -2
  269. package/dist/cli-bundle/focused-chunks/chunk-6L4KKRK7.js +0 -26
  270. package/dist/cli-bundle/focused-chunks/chunk-6VDRAJYX.js +0 -2
  271. package/dist/cli-bundle/focused-chunks/chunk-B4ZQJEMT.js +0 -6
  272. package/dist/cli-bundle/focused-chunks/chunk-BZSACRVX.js +0 -91
  273. package/dist/cli-bundle/focused-chunks/chunk-F6UQJJYB.js +0 -2
  274. package/dist/cli-bundle/focused-chunks/chunk-L5GX2FGZ.js +0 -2
  275. package/dist/cli-bundle/focused-chunks/chunk-LPWZERVD.js +0 -12
  276. package/dist/cli-bundle/focused-chunks/chunk-OASYSUOH.js +0 -22
  277. package/dist/cli-bundle/focused-chunks/chunk-QUPGBO2L.js +0 -26
  278. package/dist/cli-bundle/focused-chunks/chunk-Z26ZPQH6.js +0 -3
@@ -1 +1 @@
1
- {"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.10.28","plugins":[{"name":"pm-claude","source":"./plugins/pm-claude","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.","version":"2026.10.28","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"],"category":"productivity"}]}
1
+ {"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.10.31","plugins":[{"name":"pm-claude","source":"./plugins/pm-claude","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.","version":"2026.10.31","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"],"category":"productivity"}]}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,55 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026.10.31 - 2026-10-31
4
+
5
+ ### Changed
6
+
7
+ - Update Sentry CLI to 3.8.2 after seven-day cooldown ([pm-sentry-cli-382](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/chores/pm-sentry-cli-382.toon))
8
+
9
+ ### Fixed
10
+
11
+ - Successful linked-test receipts carry non-actionable execution_context and all-zero failure_categories, even under --lean ([pm-covpax](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-covpax.toon))
12
+ - Unknown-option recovery drops a dash-leading prose value: the advertised replay closes, comments or creates without the user's text ([pm-stq61b](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-stq61b.toon))
13
+ - GH-1633: accept comma-separated --unset field lists with per-field validation ([pm-gh1633](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1633.toon))
14
+ - GH-1630: bound selective linked-test receipts to the selected collection ([pm-gh1630](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1630.toon))
15
+ - GH-1626: offer same-command replay corrections for brief completeness spellings ([pm-gh1626](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1626.toon))
16
+ - GH-1609: recover killed commit owners and bound lock waits with a monotonic clock ([pm-gh1609](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1609.toon))
17
+ - GH-1624: define typed Unicode handling for extension output across JSON and TOON ([pm-gh1624](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1624.toon))
18
+ - GH-1625: align extension-refusal Sentry capture with declared contracts and telemetry source context ([pm-gh1625](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1625.toon))
19
+ - GH-1602: keep preflight warnings inside JSON error envelopes ([pm-gh1602](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1602.toon))
20
+ - Bound independent native receipt regression cases ([pm-native-index-proof](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-native-index-proof.toon))
21
+ - GH-1558: Settle Windows generation-fixture rename rejections without weakening lock assertions ([pm-gh1558](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1558.toon))
22
+ - pm close clears the assignee but leaves claim_principal, so closed claimed items keep an active owner ([pm-8xgg7i](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-8xgg7i.toon))
23
+ - GH-1618: prevent automated comment churn from misleading next-work priority ([pm-gh1618](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1618.toon))
24
+ - GH-1610: compact lean refusals and expose structured claim context ([pm-gh1610](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1610.toon))
25
+ - GH-1627: bound the entire next response and compact optional TOON sections losslessly ([pm-gh1627](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1627.toon))
26
+ - GH-1628: preserve terminal timestamps for identical forced SDK updates ([pm-gh1628](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1628.toon))
27
+ - Pull-request CI requests 33 hosted-runner jobs per push against the account's 20-job concurrency cap, so required checks wait hours before they start ([pm-m6ig79](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-m6ig79.toon))
28
+ - Text refusals drop the specific What happened detail when an echoed argv overflows the diagnostic ceiling ([pm-4oc353](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-4oc353.toon))
29
+ - GH-1622: investigate pm-presets SDK-loading fault blocking daily release ([pm-gh1622](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1622.toon))
30
+
31
+ ### Security
32
+
33
+ - Registry advisories GHSA-mrwp-f3q8-3g9p (follow-redirects 1.16.1, high) and GHSA-g3hv-75wg-m249 (minimatch 10.2.6, moderate) block the static gate on main and every PR ([pm-irviv0](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-irviv0.toon))
34
+
35
+ ## 2026.10.30 - 2026-10-30
36
+
37
+ ### Added
38
+
39
+ - GH-1597: expose host-bound item transaction status and safe abandonment or supersession ([pm-gh1597](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-gh1597.toon))
40
+ - GH-1598: bind batch mutation APIs to PmClient and expose canonical staged preview records ([pm-gh1598](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-gh1598.toon))
41
+
42
+ ### Fixed
43
+
44
+ - GH-1617: make history display order explicit and consistent across projections ([pm-gh1617](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1617.toon))
45
+ - GH-1603: Reduce null agenda fields and escaped tag overhead in bounded context output ([pm-gh1603](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1603.toon))
46
+ - GH-1606: Validate public SDK runtime operand values before mutation internals ([pm-gh1606](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1606.toon))
47
+ - GH-1614: keep typed SDK data literal across CLI sentinel inputs ([pm-gh1614](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1614.toon))
48
+
49
+ ### Other
50
+
51
+ - Serialize cold transport and executable refusal gate fixtures during full validation ([pm-serial-cold-gates](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-serial-cold-gates.toon))
52
+
3
53
  ## 2026.10.28 - 2026-10-28
4
54
 
5
55
  ### Fixed
@@ -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]="f07b9b70-b22d-5a5b-aec4-e1011286fb77")}catch{}})();import{pathExists,resolveItemTypeRegistry,EXIT_CODE,getSettingsPath,resolvePmRoot,readSettings,getActiveExtensionRegistrations,locateItem,runActiveServiceOverride,levenshteinDistanceWithinLimit}from"../sdk/runtime-primitives.js";import{BUILTIN_ITEM_TYPE_VALUES}from"../types/index.js";import{PM_CORE_COMMAND_NAMES,resolveSubcommandFlagContractsForCommand}from"../sdk/cli-contracts.js";import{formatCommanderErrorForDisplay,formatCommanderErrorForJson,projectLeanErrorEnvelope}from"./error-guidance.js";import{normalizeHelpCommandPath}from"./help-content.js";import{getCommandPath}from"./registration-helpers.js";import{EXECUTABLE_COMMAND_ALIASES,findBootstrapCommandTokenIndex,normalizeBootstrapInvocation,parseBootstrapHelpRequest,parseBootstrapGlobalOptions,parseBootstrapCommandName}from"./bootstrap-args.js";import{extractProvidedOptionFlags,normalizeLongFlag,renderPmCommand}from"./argv-utils.js";import{normalizeExtensionNameForMatch}from"./commands/extension/shared.js";import{canonicalizeCommandSuggestions,rankCommandPaths,resolveMisnestedCommandPath}from"../sdk/agent/command-suggestions.js";import{isCompatibleRecoveryFlag,renderMissingOptionRetry,resolveLifecycleVerbRecovery}from"../sdk/agent/command-recovery.js";import{resolvePmCommandScopeArgs}from"../sdk/command-line.js";import{attachOutputTokenAccounting}from"../sdk/output-token-accounting.js";import{findPmNamespacedCommand,resolvePmCommandAlias}from"../sdk/cli-contracts/command-aliases.js";const BUILTIN_TYPE_HELP_VALUES=BUILTIN_ITEM_TYPE_VALUES.join("|"),OPTIONAL_PACKAGE_INSTALL_HINTS={calendar:"calendar",cal:"calendar",reindex:"search-advanced","search-advanced":"search-advanced",guide:"guide-shell",completion:"guide-shell",templates:"templates","test-runs":"linked-test-adapters",beads:"beads",todos:"todos"},SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS={comments:{"--body":["--add"],"--text":["--add"],"--comment":["--add"]},notes:{"--body":["--add"],"--text":["--add"],"--note":["--add"]},learnings:{"--body":["--add"],"--text":["--add"],"--learning":["--add"]},update:{"--add-tag":["--add-tags"],"--remove-tag":["--remove-tags"],"--tag":["--tags"]},create:{"--add-tag":["--add-tags"],"--tag":["--tags"]}},SCHEMA_SUBCOMMAND_VALUES=["add-field","add-status","add-type","apply-preset","list","list-fields","remap-status","remove-field","remove-status","remove-type","rename-field","rename-type","show","show-field","show-status"];function getSemanticUnknownOptionSuggestions(commandName,unknownOption){const commandSuggestions=SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS[commandName];if(!commandSuggestions)return[];const normalizedUnknown=normalizeLongFlag(unknownOption);for(const[flag,suggestions]of Object.entries(commandSuggestions))if(normalizeLongFlag(flag)===normalizedUnknown)return suggestions;return[]}function appendCommanderExtensionFailures(renderedUsage,json,failures){if(failures.length===0)return renderedUsage;if(json){const primaryFailure2=failures.find(entry=>entry.declared_command_match===!0),{token_accounting:priorAccounting,...usage}=JSON.parse(renderedUsage),enriched={...usage,...primaryFailure2?{extension_command_failure:{code:"extension_command_activation_failed",extension:primaryFailure2.name,layer:primaryFailure2.layer,error:primaryFailure2.error,recovery_commands:primaryFailure2.recovery_commands??[]}}:{},failed_extensions:failures};return JSON.stringify(priorAccounting===void 0?enriched:attachOutputTokenAccounting(enriched,value=>`${JSON.stringify(value,null,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]="e860a827-39e1-5d6c-b76e-0d77365ba202")}catch{}})();import{pathExists,resolveItemTypeRegistry,EXIT_CODE,getSettingsPath,resolvePmRoot,readSettings,getActiveExtensionRegistrations,locateItem,runActiveServiceOverride,levenshteinDistanceWithinLimit}from"../sdk/runtime-primitives.js";import{BUILTIN_ITEM_TYPE_VALUES}from"../types/index.js";import{PM_CORE_COMMAND_NAMES,resolveSubcommandFlagContractsForCommand}from"../sdk/cli-contracts.js";import{formatCommanderErrorForDisplay,formatCommanderErrorForJson,projectLeanErrorEnvelope}from"./error-guidance.js";import{normalizeHelpCommandPath}from"./help-content.js";import{getCommandPath}from"./registration-helpers.js";import{EXECUTABLE_COMMAND_ALIASES,findBootstrapCommandTokenIndex,normalizeBootstrapInvocation,parseBootstrapHelpRequest,parseBootstrapGlobalOptions,parseBootstrapCommandName}from"./bootstrap-args.js";import{extractProvidedOptionFlags,normalizeLongFlag,renderPmCommand}from"./argv-utils.js";import{normalizeExtensionNameForMatch}from"./commands/extension/shared.js";import{canonicalizeCommandSuggestions,rankCommandPaths,resolveMisnestedCommandPath}from"../sdk/agent/command-suggestions.js";import{isCompatibleRecoveryFlag,renderMissingOptionRetry,resolveLifecycleVerbRecovery}from"../sdk/agent/command-recovery.js";import{resolvePmCommandScopeArgs}from"../sdk/command-line.js";import{attachOutputTokenAccounting}from"../sdk/output-token-accounting.js";import{findPmNamespacedCommand,resolvePmCommandAlias}from"../sdk/cli-contracts/command-aliases.js";const BUILTIN_TYPE_HELP_VALUES=BUILTIN_ITEM_TYPE_VALUES.join("|"),OPTIONAL_PACKAGE_INSTALL_HINTS={calendar:"calendar",cal:"calendar",reindex:"search-advanced","search-advanced":"search-advanced",guide:"guide-shell",completion:"guide-shell",templates:"templates","test-runs":"linked-test-adapters",beads:"beads",todos:"todos"},SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS={comments:{"--body":["--add"],"--text":["--add"],"--comment":["--add"]},notes:{"--body":["--add"],"--text":["--add"],"--note":["--add"]},learnings:{"--body":["--add"],"--text":["--add"],"--learning":["--add"]},update:{"--add-tag":["--add-tags"],"--remove-tag":["--remove-tags"],"--tag":["--tags"]},create:{"--add-tag":["--add-tags"],"--tag":["--tags"]}},SCHEMA_SUBCOMMAND_VALUES=["add-field","add-status","add-type","apply-preset","list","list-fields","remap-status","remove-field","remove-status","remove-type","rename-field","rename-type","show","show-field","show-status"];function getSemanticUnknownOptionSuggestions(commandName,unknownOption){const commandSuggestions=SEMANTIC_UNKNOWN_OPTION_SUGGESTIONS[commandName];if(!commandSuggestions)return[];const normalizedUnknown=normalizeLongFlag(unknownOption);for(const[flag,suggestions]of Object.entries(commandSuggestions))if(normalizeLongFlag(flag)===normalizedUnknown)return suggestions;return[]}function appendCommanderExtensionFailures(renderedUsage,json,failures){if(failures.length===0)return renderedUsage;if(json){const primaryFailure2=failures.find(entry=>entry.declared_command_match===!0),{token_accounting:priorAccounting,...usage}=JSON.parse(renderedUsage),enriched={...usage,...primaryFailure2?{extension_command_failure:{code:"extension_command_activation_failed",extension:primaryFailure2.name,layer:primaryFailure2.layer,error:primaryFailure2.error,recovery_commands:primaryFailure2.recovery_commands??[]}}:{},failed_extensions:failures};return JSON.stringify(priorAccounting===void 0?enriched:attachOutputTokenAccounting(enriched,value=>`${JSON.stringify(value,null,2)}
2
2
  `),null,2)}const details=failures.map(entry=>`- ${entry.layer}:${entry.name}: ${entry.error}`).join(`
3
3
  `),primaryFailure=failures.find(entry=>entry.declared_command_match===!0);if(!primaryFailure)return`${renderedUsage}
4
4
  Extension activation failures:
@@ -11,6 +11,6 @@ ${recovery}`:""}
11
11
  ${renderedUsage}
12
12
  Extension activation failures:
13
13
  ${details}`}function resolveUnknownCommanderToken(invocationArgv){return parseBootstrapHelpRequest(invocationArgv).commandPathTokens[0]??parseBootstrapCommandName(invocationArgv)??"<command>"}function collectRuntimeCommandPaths(root,extensionDescriptors){const commandPaths=new Set,queue=[...root.commands];for(;queue.length>0;){const current=queue.shift();if(!current)continue;const normalizedPath=normalizeHelpCommandPath(getCommandPath(current)),hasInternalSegment=normalizedPath.split(" ").some(segment=>segment.startsWith("_"));normalizedPath.length>0&&!hasInternalSegment&&commandPaths.add(normalizedPath),queue.push(...current.commands)}for(const descriptorPath of extensionDescriptors.keys()){const normalizedPath=normalizeHelpCommandPath(descriptorPath),hasInternalSegment=normalizedPath.split(" ").some(segment=>segment.startsWith("_"));normalizedPath.length>0&&!hasInternalSegment&&commandPaths.add(normalizedPath)}return[...commandPaths].sort((left,right)=>left.localeCompare(right))}function scoreCommandPathMatch(commandPath,queryToken){const normalizedPath=commandPath.trim().toLowerCase(),normalizedToken=queryToken.trim().toLowerCase();if(normalizedToken.length===0)return Number.POSITIVE_INFINITY;const pathSegments=normalizedPath.split(" ");if(normalizedPath===normalizedToken)return 0;if(pathSegments.includes(normalizedToken))return 1;if(pathSegments.some(segment=>segment.startsWith(normalizedToken)))return 2;if(normalizedPath.includes(normalizedToken))return 3;const maxDistance=normalizedToken.length>=5?2:1;let bestDistance=Number.POSITIVE_INFINITY;for(const segment of pathSegments){const distance=levenshteinDistanceWithinLimit(segment,normalizedToken,maxDistance);distance!==null&&(bestDistance=Math.min(bestDistance,distance))}return Number.isFinite(bestDistance)?4+bestDistance:Number.POSITIVE_INFINITY}function toComparableFlag(flag){return normalizeLongFlag(flag).slice(2).replace(/-/g,"")}function renderAttemptedCommand(argv){return renderPmCommand(argv)}function resolveOptionalPackageInstallHint(commandPath){const canonicalPath=resolvePmCommandAlias(commandPath)?.canonical??EXECUTABLE_COMMAND_ALIASES[commandPath]??commandPath,topLevel=canonicalPath.split(" ")[0]?.trim().toLowerCase();if(!topLevel)return null;const packageAlias=OPTIONAL_PACKAGE_INSTALL_HINTS[topLevel];return packageAlias?{packageAlias,canonicalPath,installCommand:`pm package install ${packageAlias} --project`}:null}function normalizePackageCommandAliasToken(value){let normalized=normalizeExtensionNameForMatch(value);for(const prefix of["@unbrained/","builtin-","pm-"])normalized.startsWith(prefix)&&(normalized=normalized.slice(prefix.length));return normalized}function collectInstalledPackageCommandPathHints(unknownToken,extensionDescriptors){const normalizedUnknown=normalizePackageCommandAliasToken(unknownToken);if(normalizedUnknown.length===0)return[];const hints=[];for(const descriptor of extensionDescriptors.values()){const identifiers=new Set,source=descriptor.source;if(source)for(const identifier of[source.name,source.package]){const normalizedIdentifier=normalizePackageCommandAliasToken(identifier??"");normalizedIdentifier.length>0&&identifiers.add(normalizedIdentifier)}identifiers.size!==0&&[...identifiers].some(identifier=>identifier===normalizedUnknown||identifier.includes(normalizedUnknown)||normalizedUnknown.includes(identifier))&&hints.push(descriptor.command)}return[...new Set(hints)].sort((left,right)=>left.localeCompare(right))}function collectKnownLongFlags(commandName,contractsOverride){const flags=new Set,contracts=contractsOverride??resolveSubcommandFlagContractsForCommand(commandName);for(const contract of contracts){contract.flag.startsWith("--")&&flags.add(normalizeLongFlag(contract.flag));for(const alias of contract.aliases??[])alias.startsWith("--")&&flags.add(normalizeLongFlag(alias))}return[...flags].sort((left,right)=>left.localeCompare(right))}function suggestNearestLongFlags(unknownOption,knownFlags){if(!unknownOption.startsWith("--"))return[];const unknownComparable=toComparableFlag(unknownOption);if(unknownComparable.length===0)return[];const maxDistance=unknownComparable.length>=8?2:1,candidates=[];for(const flag of knownFlags){const flagComparable=toComparableFlag(flag);if(flagComparable===unknownComparable)continue;if(unknownComparable.length>=3&&flagComparable.startsWith(unknownComparable)){candidates.push({flag,rank:0,distance:flagComparable.length-unknownComparable.length});continue}const distance=levenshteinDistanceWithinLimit(unknownComparable,flagComparable,maxDistance);distance===null||distance<=0||candidates.push({flag,rank:1,distance})}return candidates.sort((left,right)=>left.rank!==right.rank?left.rank-right.rank:left.distance!==right.distance?left.distance-right.distance:left.flag.localeCompare(right.flag)).map(entry=>entry.flag).slice(0,3)}let crossCommandFlagIndexCache;const CROSS_COMMAND_FLAG_EXCLUSIONS=new Set(["ctx","packages","list-draft","list-open","list-in-progress","list-blocked","list-closed","list-canceled","start-task","pause-task","close-task","help"]);function getCrossCommandFlagIndex(){if(crossCommandFlagIndexCache)return crossCommandFlagIndexCache;const index=new Map;for(const command of PM_CORE_COMMAND_NAMES)if(!CROSS_COMMAND_FLAG_EXCLUSIONS.has(command))for(const flag of collectKnownLongFlags(command)){const commands=index.get(flag)??[];commands.push(command),index.set(flag,commands)}return crossCommandFlagIndexCache=index,crossCommandFlagIndexCache}function findOtherCommandsForFlag(unknownOption,currentCommand){if(!unknownOption.startsWith("--"))return[];const commands=getCrossCommandFlagIndex().get(normalizeLongFlag(unknownOption));if(!commands)return[];const normalizedCurrent=currentCommand?.trim().toLowerCase(),currentFlags=new Set(collectKnownLongFlags(normalizedCurrent));return[...new Set(commands.filter(command=>command!==normalizedCurrent).map(command=>({command,sharedFlagCount:collectKnownLongFlags(command).filter(flag=>currentFlags.has(flag)).length})).sort((left,right)=>left.sharedFlagCount!==right.sharedFlagCount?right.sharedFlagCount-left.sharedFlagCount:left.command.localeCompare(right.command)).map(({command})=>resolvePmCommandAlias(command)?.canonical??command))]}function rewriteUnknownOptionArgv(argv,unknownOption,replacementFlag){for(let index=0;index<argv.length;index+=1){const token=argv[index];if(!token.startsWith("--"))continue;const equalsIndex=token.indexOf("="),key=equalsIndex>=0?token.slice(0,equalsIndex):token;if(normalizeLongFlag(key)!==normalizeLongFlag(unknownOption))continue;const next=[...argv];return next[index]=equalsIndex>=0?`${replacementFlag}${token.slice(equalsIndex)}`:replacementFlag,next}}function scoreRuntimeCommandCandidates(params){const commandPathSet=new Set(params.commandPaths),scoreAgainstUnknown=candidatePath=>Math.min(scoreCommandPathMatch(candidatePath,params.normalizedUnknown),params.primaryToken!==params.normalizedUnknown?scoreCommandPathMatch(candidatePath,params.primaryToken):Number.POSITIVE_INFINITY),scoresByCommandPath=new Map,recordCandidateScore=(commandPath,score)=>{if(!Number.isFinite(score)||!commandPathSet.has(commandPath))return;const existing=scoresByCommandPath.get(commandPath);(existing===void 0||score<existing)&&scoresByCommandPath.set(commandPath,score)};for(const commandPath of params.commandPaths)recordCandidateScore(commandPath,scoreAgainstUnknown(commandPath));for(const[aliasToken,canonicalPath]of Object.entries(EXECUTABLE_COMMAND_ALIASES))aliasToken!=="read"&&recordCandidateScore(canonicalPath,scoreAgainstUnknown(aliasToken));return[...scoresByCommandPath.entries()].sort(([leftPath,leftScore],[rightPath,rightScore])=>leftScore!==rightScore?leftScore-rightScore:leftPath.localeCompare(rightPath)).map(([commandPath])=>commandPath)}function resolveUnknownCommandCandidates(params){const exactAlias=resolvePmCommandAlias(params.normalizedUnknown),semanticCandidates=rankCommandPaths(params.commandPaths,params.primaryToken),rankedCandidates=scoreRuntimeCommandCandidates(params),installedPackageCandidates=collectInstalledPackageCommandPathHints(params.primaryToken,params.extensionDescriptors).filter(commandPath=>params.commandPaths.includes(commandPath));return canonicalizeCommandSuggestions([...exactAlias&&params.commandPaths.includes(exactAlias.canonical)?[exactAlias.canonical_argv.join(" ")]:[],...semanticCandidates,...rankedCandidates,...installedPackageCandidates],params.commandPaths,params.primaryToken).filter(path=>!params.normalizedUnknown.includes(" ")||path!==params.normalizedUnknown)}function resolveUnknownCommandFallbacks(commandPaths){return[...new Set(commandPaths.map(commandPath=>commandPath.split(" ")[0]).filter(segment=>segment.length>0))].sort((left,right)=>left.localeCompare(right))}function buildUnknownCommandExamples(suggestedPaths,hasConcreteCandidates){const suggestedExamples=suggestedPaths.map(path=>`pm ${path} --help`);return hasConcreteCandidates?[...new Set([...suggestedExamples,"pm --help --all"])]:[...new Set(["pm --help --all",...suggestedExamples])]}function resolveUnknownCommandPath(token,invocationArgv,commandPaths){let commandIndex=findBootstrapCommandTokenIndex([...invocationArgv]);const path=[];for(;commandIndex!==void 0;){if(path.push(invocationArgv[commandIndex]),invocationArgv[commandIndex]===token)return path.join(" ");if(!commandPaths.includes(path.join(" ")))return token;const offset=findBootstrapCommandTokenIndex(invocationArgv.slice(commandIndex+1));commandIndex=offset===void 0?void 0:commandIndex+1+offset}return token}function buildCanonicalHelpRetryArgs(canonicalPath,invocationArgv){if(!canonicalPath)return;const bootstrapGlobal=parseBootstrapGlobalOptions([...invocationArgv]);return[...resolvePmCommandScopeArgs(bootstrapGlobal),...canonicalPath.split(" "),"--help"]}function buildUnknownCommandGuidanceFromRuntime(rawMessage,root,extensionDescriptors,invocationArgv=[]){const unknownCommandMatch=rawMessage.match(/unknown command '([^']+)'/i);if(!unknownCommandMatch||typeof unknownCommandMatch[1]!="string")return;const commandPaths=collectRuntimeCommandPaths(root,extensionDescriptors),unknownPath=resolveUnknownCommandPath(unknownCommandMatch[1],invocationArgv,commandPaths),normalizedUnknown=normalizeHelpCommandPath(unknownPath);if(normalizedUnknown.length===0||commandPaths.length===0)return;const lifecycleRecovery=resolveLifecycleVerbRecovery(normalizedUnknown,commandPaths);if(lifecycleRecovery){const retryArgs2=buildCanonicalHelpRetryArgs("update",invocationArgv),bootstrapArgs=retryArgs2.slice(0,-2);return{suggestedRetryCommand:renderPmCommand(retryArgs2),suggestedRetryArgs:retryArgs2,unknownCommandExamples:[renderPmCommand(retryArgs2),...lifecycleRecovery.examples.map(args=>renderPmCommand([...bootstrapArgs,...args]))],unknownCommandNextSteps:lifecycleRecovery.nextSteps}}const optionalPackageHint=resolveOptionalPackageInstallHint(normalizedUnknown);if(optionalPackageHint&&!commandPaths.includes(optionalPackageHint.canonicalPath.split(" ")[0]))return{unknownCommandExamples:[optionalPackageHint.installCommand,`pm ${optionalPackageHint.canonicalPath} --help`,"pm --help --all"],unknownCommandNextSteps:[`"${normalizedUnknown}" is provided by the "${optionalPackageHint.packageAlias}" package. Install it with: ${optionalPackageHint.installCommand}. Command after installation: pm ${optionalPackageHint.canonicalPath}.`],suggestedRetryCommand:optionalPackageHint.installCommand};const primaryToken=normalizedUnknown.split(" ")[0],combinedCandidates=resolveUnknownCommandCandidates({commandPaths,normalizedUnknown,primaryToken,extensionDescriptors}),fallbackTopLevel=resolveUnknownCommandFallbacks(commandPaths),misnestedPath=resolveMisnestedCommandPath(normalizedUnknown,commandPaths),retryArgs=buildCanonicalHelpRetryArgs(misnestedPath,invocationArgv),suggestedPaths=[...new Set([...misnestedPath?[misnestedPath]:[],...combinedCandidates.length>0?combinedCandidates:canonicalizeCommandSuggestions(fallbackTopLevel,commandPaths)])].slice(0,3),examples=buildUnknownCommandExamples(suggestedPaths,combinedCandidates.length>0),didYouMean=combinedCandidates.length>0?`Did you mean: ${suggestedPaths.join(", ")}?`:null;return{...retryArgs?{suggestedRetryCommand:renderPmCommand(retryArgs),suggestedRetryArgs:retryArgs}:{},unknownCommandExamples:retryArgs?[renderPmCommand(retryArgs),...examples.slice(1)]:examples,unknownCommandNextSteps:[...didYouMean?[didYouMean]:[],'Run "pm --help --all" to list every command available in this runtime, including active extensions.',...didYouMean?["Use one of the suggested command paths above with --help to inspect valid flags and usage."]:[]]}}function dedupeStrings(values){return Array.from(new Set(values))}function firstWhitespaceSeparatedToken(input){let token="";for(const character of input){if(character===" "||character===" "||character===`
14
- `||character==="\r"||character==="\f"||character==="\v")break;token+=character}return token}function trimTrailingPunctuationToken(token){let end=token.length;for(;end>0;){const character=token[end-1];if(character!==","&&character!==":"&&character!==";")break;end-=1}return token.slice(0,end)}function resolveChildCommandByToken(parent,token){const normalizedToken=token.trim().toLowerCase();return parent.commands.find(candidate=>candidate.name().trim().toLowerCase()===normalizedToken?!0:(typeof candidate.aliases=="function"?candidate.aliases():[]).some(alias=>alias.trim().toLowerCase()===normalizedToken))}function isKnownHelpCommandPath(root,commandPathTokens){if(commandPathTokens.length===0)return!0;let current=root;for(const[tokenIndex,token]of commandPathTokens.entries()){const next=resolveChildCommandByToken(current,token);if(!next){const declaredArguments=current.registeredArguments;return declaredArguments.length>0&&(current.commands.length===0||declaredArguments[0]?.required===!0)&&(declaredArguments.at(-1)?.variadic===!0||commandPathTokens.length-tokenIndex<=declaredArguments.length)}current=next}return!0}async function resolveWorkspaceUsageContext(bootstrapGlobal,message,invocationArgv,commandName){try{const pmRoot=resolvePmRoot(process.cwd(),bootstrapGlobal.path);if(!await pathExists(getSettingsPath(pmRoot)))return{allowedTypes:BUILTIN_TYPE_HELP_VALUES};const settings=await readSettings(pmRoot),extensionRegistrations=bootstrapGlobal.noExtensions?void 0:getActiveExtensionRegistrations(),typeRegistry=resolveItemTypeRegistry(settings,extensionRegistrations);let verifiedCollectionItemId;if(/too many arguments/i.test(message)&&["comments","docs","files","learnings","notes","test"].includes(commandName??"")){const commandIndex=invocationArgv.findIndex(token=>token===commandName),candidate=invocationArgv[commandIndex+2];if(invocationArgv[commandIndex+1]?.toLowerCase()==="add"&&candidate!==void 0&&!candidate.startsWith("-"))try{verifiedCollectionItemId=(await locateItem(pmRoot,candidate,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder))?.id}catch{}}return{allowedTypes:typeRegistry.types.length>0?typeRegistry.types.join("|"):BUILTIN_TYPE_HELP_VALUES,pmRoot,settings,typeToFolder:typeRegistry.type_to_folder,verifiedCollectionItemId}}catch{return{allowedTypes:BUILTIN_TYPE_HELP_VALUES}}}function resolveUnknownOptionSuggestions(message,commandName){const match=message.match(/unknown option '([^']+)'/i),suggestions=match&&commandName?dedupeStrings([...getSemanticUnknownOptionSuggestions(commandName,match[1]),...suggestNearestLongFlags(match[1],collectKnownLongFlags(commandName))]).filter(candidate=>isCompatibleRecoveryFlag(match[1],candidate)):void 0,otherCommands=match?findOtherCommandsForFlag(match[1],commandName):[],declaredOnPath=match!==null&&collectKnownLongFlags(commandName).includes(normalizeLongFlag(match[1]));return{match,suggestions,otherCommands,scope:declaredOnPath?"declared_on_path":otherCommands.length>0?"declared_elsewhere":"declared_nowhere"}}function resolveSuggestedRetryForUnknownOption(invocationArgv,unknownOptionMatch,unknownOptionSuggestions){if(!unknownOptionMatch||!unknownOptionSuggestions||unknownOptionSuggestions.length===0)return;const rewritten=rewriteUnknownOptionArgv(invocationArgv,unknownOptionMatch[1],unknownOptionSuggestions[0]);return rewritten?renderAttemptedCommand(rewritten):void 0}function resolveSuggestedRetryForMissingOption(message,invocationArgv){const missingRequiredOption=message.match(/required option '([^']+)' not specified/i),requiredOptionToken=missingRequiredOption?.[1]?trimTrailingPunctuationToken(firstWhitespaceSeparatedToken(missingRequiredOption[1].trim())):void 0;if(!requiredOptionToken?.startsWith("--"))return;const commandName=parseBootstrapCommandName(invocationArgv);if(commandName)return renderMissingOptionRetry(invocationArgv,commandName,[requiredOptionToken])}function resolveSplitSchemaSubcommand(message,invocationArgv){if(!/too many arguments/i.test(message))return;const commandIndex=findBootstrapCommandTokenIndex(invocationArgv),namespaced=findPmNamespacedCommand(invocationArgv.slice(commandIndex));if(namespaced?.alias!=="schema")return;const schemaIndex=commandIndex+namespaced.canonical_argv.length-1,verb=invocationArgv[schemaIndex+1]?.trim().toLowerCase(),noun=invocationArgv[schemaIndex+2]?.trim().toLowerCase();if(!verb||!noun)return;const joined=`${verb}-${noun}`;if(!SCHEMA_SUBCOMMAND_VALUES.includes(joined))return;const rewritten=[...invocationArgv.slice(0,schemaIndex+1),joined,...invocationArgv.slice(schemaIndex+3)];return{unknownSubcommandPath:"schema",unknownSubcommandToken:`${verb} ${noun}`,unknownSubcommandAllowedValues:[...SCHEMA_SUBCOMMAND_VALUES],suggestedRetryCommand:renderAttemptedCommand(rewritten)}}function resolveRecoveryCommandName(message,invocationArgv,rootProgram,extensionDescriptors){const commandIndex=findBootstrapCommandTokenIndex(invocationArgv),inferred=findPmNamespacedCommand(invocationArgv.slice(commandIndex))?.alias??parseBootstrapCommandName(invocationArgv);if(!/unknown option /i.test(message)||inferred===void 0)return inferred;const canonical=resolvePmCommandAlias(inferred)?.canonical??inferred;return PM_CORE_COMMAND_NAMES.some(name=>name===inferred)||collectRuntimeCommandPaths(rootProgram,extensionDescriptors).includes(canonical)?inferred:void 0}async function resolveCommanderUsageContext(error,rootProgram,extensionDescriptors,guidanceOverrides={},invocationArgs=process.argv.slice(2)){const message=(typeof error=="object"&&error!==null?error.message:void 0)??"Invalid command usage",invocationArgv=normalizeBootstrapInvocation([...invocationArgs]).argv,bootstrapGlobal=parseBootstrapGlobalOptions(invocationArgv),commandName=resolveRecoveryCommandName(message,invocationArgv,rootProgram,extensionDescriptors),attemptedCommand=renderAttemptedCommand(invocationArgv),providedOptionFlags=extractProvidedOptionFlags(invocationArgv),workspaceUsage=await resolveWorkspaceUsageContext(bootstrapGlobal,message,invocationArgv,commandName),allowedTypes=workspaceUsage.allowedTypes,unknownCommandGuidance=buildUnknownCommandGuidanceFromRuntime(message,rootProgram,extensionDescriptors,invocationArgv),unknownOption=resolveUnknownOptionSuggestions(message,commandName),splitSchemaSubcommand=resolveSplitSchemaSubcommand(message,invocationArgv),suggestedRetryCommand=splitSchemaSubcommand?.suggestedRetryCommand??resolveSuggestedRetryForUnknownOption(invocationArgv,unknownOption.match,unknownOption.suggestions)??resolveSuggestedRetryForMissingOption(message,invocationArgv);return{message,commandName,allowedTypes,attemptedCommand,normalizedInvocationArgs:[...invocationArgv],providedOptionFlags,unknownOptionSuggestions:unknownOption.suggestions,unknownOptionOtherCommands:unknownOption.otherCommands.length>0?unknownOption.otherCommands.slice(0,12):void 0,unknownOptionOtherCommandsTotal:unknownOption.otherCommands.length>0?unknownOption.otherCommands.length:void 0,unknownOptionOtherCommandsTruncated:unknownOption.otherCommands.length>12||void 0,unknownOptionScope:unknownOption.scope,suggestedRetryCommand,verifiedCollectionItemId:workspaceUsage.verifiedCollectionItemId,...splitSchemaSubcommand,...unknownCommandGuidance,...guidanceOverrides}}async function formatCommanderUsageMessage(error,rootProgram,extensionDescriptors,guidanceOverrides={},invocationArgs=process.argv.slice(2)){const usageContext=await resolveCommanderUsageContext(error,rootProgram,extensionDescriptors,guidanceOverrides,invocationArgs),{message,commandName,allowedTypes,...guidance}=usageContext,formatted=formatCommanderErrorForDisplay(message,commandName,allowedTypes,guidance),serviceOverride=await runActiveServiceOverride("help_format",{message:formatted,command:commandName,allowed_types:allowedTypes});return serviceOverride.handled&&typeof serviceOverride.result=="string"?serviceOverride.result:formatted}async function formatCommanderUsageJson(error,rootProgram,extensionDescriptors,lean=!1,guidanceOverrides={},invocationArgs=process.argv.slice(2)){const usageContext=await resolveCommanderUsageContext(error,rootProgram,extensionDescriptors,guidanceOverrides,invocationArgs),envelope=formatCommanderErrorForJson(usageContext.message,usageContext.commandName,usageContext.allowedTypes,EXIT_CODE.USAGE,usageContext),projected=lean?projectLeanErrorEnvelope(envelope):envelope,accountingRequested=parseBootstrapGlobalOptions(usageContext.normalizedInvocationArgs).tokenAccounting===!0;return JSON.stringify(accountingRequested?attachOutputTokenAccounting(projected,value=>`${JSON.stringify(value,null,2)}
14
+ `||character==="\r"||character==="\f"||character==="\v")break;token+=character}return token}function trimTrailingPunctuationToken(token){let end=token.length;for(;end>0;){const character=token[end-1];if(character!==","&&character!==":"&&character!==";")break;end-=1}return token.slice(0,end)}function resolveChildCommandByToken(parent,token){const normalizedToken=token.trim().toLowerCase();return parent.commands.find(candidate=>candidate.name().trim().toLowerCase()===normalizedToken?!0:(typeof candidate.aliases=="function"?candidate.aliases():[]).some(alias=>alias.trim().toLowerCase()===normalizedToken))}function isKnownHelpCommandPath(root,commandPathTokens){if(commandPathTokens.length===0)return!0;let current=root;for(const[tokenIndex,token]of commandPathTokens.entries()){const next=resolveChildCommandByToken(current,token);if(!next){const declaredArguments=current.registeredArguments;return declaredArguments.length>0&&(current.commands.length===0||declaredArguments[0]?.required===!0)&&(declaredArguments.at(-1)?.variadic===!0||commandPathTokens.length-tokenIndex<=declaredArguments.length)}current=next}return!0}async function resolveWorkspaceUsageContext(bootstrapGlobal,message,invocationArgv,commandName){try{const pmRoot=resolvePmRoot(process.cwd(),bootstrapGlobal.path);if(!await pathExists(getSettingsPath(pmRoot)))return{allowedTypes:BUILTIN_TYPE_HELP_VALUES};const settings=await readSettings(pmRoot),extensionRegistrations=bootstrapGlobal.noExtensions?void 0:getActiveExtensionRegistrations(),typeRegistry=resolveItemTypeRegistry(settings,extensionRegistrations);let verifiedCollectionItemId;if(/too many arguments/i.test(message)&&["comments","docs","files","learnings","notes","test"].includes(commandName??"")){const commandIndex=invocationArgv.findIndex(token=>token===commandName),candidate=invocationArgv[commandIndex+2];if(invocationArgv[commandIndex+1]?.toLowerCase()==="add"&&candidate!==void 0&&!candidate.startsWith("-"))try{verifiedCollectionItemId=(await locateItem(pmRoot,candidate,settings.id_prefix,settings.item_format,typeRegistry.type_to_folder))?.id}catch{}}return{allowedTypes:typeRegistry.types.length>0?typeRegistry.types.join("|"):BUILTIN_TYPE_HELP_VALUES,pmRoot,settings,typeToFolder:typeRegistry.type_to_folder,verifiedCollectionItemId}}catch{return{allowedTypes:BUILTIN_TYPE_HELP_VALUES}}}function resolveUnknownOptionSuggestions(message,commandName){const match=message.match(/unknown option '([^']+)'/i),suggestions=match&&commandName?dedupeStrings([...getSemanticUnknownOptionSuggestions(commandName,match[1]),...suggestNearestLongFlags(match[1],collectKnownLongFlags(commandName))]).filter(candidate=>isCompatibleRecoveryFlag(match[1],candidate)):void 0,otherCommands=match?findOtherCommandsForFlag(match[1],commandName):[],declaredOnPath=match!==null&&collectKnownLongFlags(commandName).includes(normalizeLongFlag(match[1]));return{match,suggestions,otherCommands,scope:declaredOnPath?"declared_on_path":otherCommands.length>0?"declared_elsewhere":"declared_nowhere"}}function resolveSuggestedRetryForUnknownOption(invocationArgv,unknownOptionMatch,unknownOptionSuggestions){if(!unknownOptionMatch||!unknownOptionSuggestions||unknownOptionSuggestions.length===0)return;const rewritten=rewriteUnknownOptionArgv(invocationArgv,unknownOptionMatch[1],unknownOptionSuggestions[0]);return rewritten?renderAttemptedCommand(rewritten):void 0}function resolveSuggestedRetryForMissingOption(message,invocationArgv){const missingRequiredOption=message.match(/required option '([^']+)' not specified/i),requiredOptionToken=missingRequiredOption?.[1]?trimTrailingPunctuationToken(firstWhitespaceSeparatedToken(missingRequiredOption[1].trim())):void 0;if(!requiredOptionToken?.startsWith("--"))return;const commandName=parseBootstrapCommandName(invocationArgv);if(commandName)return renderMissingOptionRetry(invocationArgv,commandName,[requiredOptionToken])}function resolveSplitSchemaSubcommand(message,invocationArgv){if(!/too many arguments/i.test(message))return;const commandIndex=findBootstrapCommandTokenIndex(invocationArgv),namespaced=findPmNamespacedCommand(invocationArgv.slice(commandIndex));if(namespaced?.alias!=="schema")return;const schemaIndex=commandIndex+namespaced.canonical_argv.length-1,verb=invocationArgv[schemaIndex+1]?.trim().toLowerCase(),noun=invocationArgv[schemaIndex+2]?.trim().toLowerCase();if(!verb||!noun)return;const joined=`${verb}-${noun}`;if(!SCHEMA_SUBCOMMAND_VALUES.includes(joined))return;const rewritten=[...invocationArgv.slice(0,schemaIndex+1),joined,...invocationArgv.slice(schemaIndex+3)];return{unknownSubcommandPath:"schema",unknownSubcommandToken:`${verb} ${noun}`,unknownSubcommandAllowedValues:[...SCHEMA_SUBCOMMAND_VALUES],suggestedRetryCommand:renderAttemptedCommand(rewritten)}}function resolveRecoveryCommandName(message,invocationArgv,rootProgram,extensionDescriptors){const commandIndex=findBootstrapCommandTokenIndex(invocationArgv),inferred=findPmNamespacedCommand(invocationArgv.slice(commandIndex))?.alias??parseBootstrapCommandName(invocationArgv);if(!/unknown option /i.test(message)||inferred===void 0)return inferred;const canonical=resolvePmCommandAlias(inferred)?.canonical??inferred;return PM_CORE_COMMAND_NAMES.some(name=>name===inferred)||collectRuntimeCommandPaths(rootProgram,extensionDescriptors).includes(canonical)?inferred:void 0}async function resolveCommanderUsageContext(error,rootProgram,extensionDescriptors,guidanceOverrides={},invocationArgs=process.argv.slice(2)){const message=(typeof error=="object"&&error!==null?error.message:void 0)??"Invalid command usage",invocationArgv=normalizeBootstrapInvocation([...invocationArgs]).argv,bootstrapGlobal=parseBootstrapGlobalOptions(invocationArgv),commandName=resolveRecoveryCommandName(message,invocationArgv,rootProgram,extensionDescriptors),attemptedCommand=renderAttemptedCommand(invocationArgv),providedOptionFlags=extractProvidedOptionFlags(invocationArgv),workspaceUsage=await resolveWorkspaceUsageContext(bootstrapGlobal,message,invocationArgv,commandName),allowedTypes=workspaceUsage.allowedTypes,unknownCommandGuidance=buildUnknownCommandGuidanceFromRuntime(message,rootProgram,extensionDescriptors,invocationArgv),unknownOption=resolveUnknownOptionSuggestions(message,commandName),splitSchemaSubcommand=resolveSplitSchemaSubcommand(message,invocationArgv),suggestedRetryCommand=splitSchemaSubcommand?.suggestedRetryCommand??resolveSuggestedRetryForUnknownOption(invocationArgv,unknownOption.match,unknownOption.suggestions)??resolveSuggestedRetryForMissingOption(message,invocationArgv);return{message,commandName,allowedTypes,attemptedCommand,normalizedInvocationArgs:[...invocationArgv],providedOptionFlags,unknownOptionSuggestions:unknownOption.suggestions,unknownOptionOtherCommands:unknownOption.otherCommands.length>0?unknownOption.otherCommands.slice(0,12):void 0,unknownOptionOtherCommandsTotal:unknownOption.otherCommands.length>0?unknownOption.otherCommands.length:void 0,unknownOptionOtherCommandsTruncated:unknownOption.otherCommands.length>12||void 0,unknownOptionScope:unknownOption.scope,suggestedRetryCommand,verifiedCollectionItemId:workspaceUsage.verifiedCollectionItemId,...splitSchemaSubcommand,...unknownCommandGuidance,...guidanceOverrides}}async function formatCommanderUsageMessage(error,rootProgram,extensionDescriptors,guidanceOverrides={},invocationArgs=process.argv.slice(2)){const usageContext=await resolveCommanderUsageContext(error,rootProgram,extensionDescriptors,guidanceOverrides,invocationArgs),{message,commandName,allowedTypes,...guidance}=usageContext,lean=parseBootstrapGlobalOptions(usageContext.normalizedInvocationArgs).lean,formatted=formatCommanderErrorForDisplay(message,commandName,allowedTypes,guidance,{lean}),serviceOverride=await runActiveServiceOverride("help_format",{message:formatted,command:commandName,allowed_types:allowedTypes});return serviceOverride.handled&&typeof serviceOverride.result=="string"?serviceOverride.result:formatted}async function formatCommanderUsageJson(error,rootProgram,extensionDescriptors,lean=!1,guidanceOverrides={},invocationArgs=process.argv.slice(2)){const usageContext=await resolveCommanderUsageContext(error,rootProgram,extensionDescriptors,guidanceOverrides,invocationArgs),envelope=formatCommanderErrorForJson(usageContext.message,usageContext.commandName,usageContext.allowedTypes,EXIT_CODE.USAGE,usageContext),projected=lean?projectLeanErrorEnvelope(envelope):envelope,accountingRequested=parseBootstrapGlobalOptions(usageContext.normalizedInvocationArgs).tokenAccounting===!0;return JSON.stringify(accountingRequested?attachOutputTokenAccounting(projected,value=>`${JSON.stringify(value,null,2)}
15
15
  `):projected,null,2)}const _testOnly={collectKnownLongFlags,collectInstalledPackageCommandPathHints,resolveOptionalPackageInstallHint,resolveSuggestedRetryForMissingOption,suggestNearestLongFlags};export{BUILTIN_TYPE_HELP_VALUES,_testOnly,appendCommanderExtensionFailures,buildUnknownCommandGuidanceFromRuntime,collectRuntimeCommandPaths,formatCommanderUsageJson,formatCommanderUsageMessage,isKnownHelpCommandPath,resolveChildCommandByToken,resolveCommanderUsageContext,resolveUnknownCommanderToken,scoreCommandPathMatch};
16
16
  //# sourceMappingURL=commander-usage.js.map
@@ -1,2 +1,6 @@
1
1
  /** @module cli/commands/lifecycle/append Compatibility export for the SDK-owned append lifecycle operation. */
2
2
  export * from "../../../sdk/lifecycle/append.js";
3
+ import { type AppendCommandOptions } from "../../../sdk/lifecycle/append.js";
4
+ import { type GlobalOptions } from "../../../sdk/runtime-primitives.js";
5
+ /** Decode CLI sentinel syntax only for command-adapter calls. */
6
+ export declare function runAppend(id:string,options:AppendCommandOptions,global:GlobalOptions):Promise<import("../../../sdk/lifecycle/append.js").AppendResult>;
@@ -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]="f111051f-3880-5ff0-9138-5166cd8a93a9")}catch{}})();export*from"../../../sdk/lifecycle/append.js";
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]="1249a9e6-fd70-5a0b-a457-3ef260c78c39")}catch{}})();export*from"../../../sdk/lifecycle/append.js";import{runAppend as runSdkAppend}from"../../../sdk/lifecycle/append.js";import{withCliMutationInput}from"../../../sdk/runtime-primitives.js";function runAppend(id,options,global2){return runSdkAppend(id,withCliMutationInput(options),global2)}export{runAppend};
2
2
  //# sourceMappingURL=append.js.map
@@ -4,3 +4,7 @@
4
4
  * Compatibility export for the SDK-owned create lifecycle operation.
5
5
  */
6
6
  export * from "../../../sdk/lifecycle/create.js";
7
+ import { type CreateCommandOptions } from "../../../sdk/lifecycle/create.js";
8
+ import { type GlobalOptions } from "../../../sdk/runtime-primitives.js";
9
+ /** Decode CLI sentinel syntax only for command-adapter calls. */
10
+ export declare function runCreate(options:CreateCommandOptions,global:GlobalOptions):Promise<import("../../../sdk/lifecycle/create.js").CreateResult>;
@@ -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]="a310e747-0cd7-5dff-b8a0-29d3c4ded9f3")}catch{}})();export*from"../../../sdk/lifecycle/create.js";
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]="34816863-a748-527d-8885-777812365ec7")}catch{}})();export*from"../../../sdk/lifecycle/create.js";import{runCreate as runSdkCreate}from"../../../sdk/lifecycle/create.js";import{withCliMutationInput}from"../../../sdk/runtime-primitives.js";function runCreate(options,global2){return runSdkCreate(withCliMutationInput(options),global2)}export{runCreate};
2
2
  //# sourceMappingURL=create.js.map
@@ -4,3 +4,6 @@
4
4
  * Compatibility export for the SDK-owned planning lifecycle operation.
5
5
  */
6
6
  export * from "../../../sdk/lifecycle/plan.js";
7
+ import { type PlanDispatchInput } from "../../../sdk/lifecycle/plan.js";
8
+ /** Retain CLI sentinel compatibility when plans compose the SDK create operation. */
9
+ export declare function runPlan(input:PlanDispatchInput):Promise<import("../../../sdk/lifecycle/plan.js").PlanCommandResult>;
@@ -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]="53ca90df-8382-5cc2-8906-8491afe5101a")}catch{}})();export*from"../../../sdk/lifecycle/plan.js";
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]="1308ca6f-9404-5fda-9726-f72364c45d02")}catch{}})();export*from"../../../sdk/lifecycle/plan.js";import{runPlan as runSdkPlan}from"../../../sdk/lifecycle/plan.js";import{withCliMutationInput}from"../../../sdk/runtime-primitives.js";function runPlan(input){const options=withCliMutationInput(input.options);return runSdkPlan({...input,options})}export{runPlan};
2
2
  //# sourceMappingURL=plan.js.map
@@ -1,2 +1,6 @@
1
1
  /** @module cli/commands/lifecycle/update-many Compatibility export for the SDK-owned bulk update operation. */
2
2
  export * from "../../../sdk/lifecycle/update-many.js";
3
+ import { type UpdateManyCommandOptions } from "../../../sdk/lifecycle/update-many.js";
4
+ import { type GlobalOptions } from "../../../sdk/runtime-primitives.js";
5
+ /** Retain the CLI mutation grammar for each bulk update's shared options. */
6
+ export declare function runUpdateMany(options:UpdateManyCommandOptions,global:GlobalOptions):Promise<import("../../../sdk/lifecycle/update-many.js").UpdateManyResult>;
@@ -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]="e8448334-e87d-5984-9e89-04e506e0a2a7")}catch{}})();export*from"../../../sdk/lifecycle/update-many.js";
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]="711dc797-d43c-5ab5-962b-51d88b08614c")}catch{}})();export*from"../../../sdk/lifecycle/update-many.js";import{runUpdateMany as runSdkUpdateMany}from"../../../sdk/lifecycle/update-many.js";import{withCliMutationInput}from"../../../sdk/runtime-primitives.js";function runUpdateMany(options,global2){const update=withCliMutationInput(options.update);return runSdkUpdateMany({...options,update},global2)}export{runUpdateMany};
2
2
  //# sourceMappingURL=update-many.js.map
@@ -4,3 +4,7 @@
4
4
  * Compatibility export for the SDK-owned update lifecycle operation.
5
5
  */
6
6
  export * from "../../../sdk/lifecycle/update.js";
7
+ import { type UpdateCommandOptions } from "../../../sdk/lifecycle/update.js";
8
+ import { type GlobalOptions } from "../../../sdk/runtime-primitives.js";
9
+ /** Decode CLI sentinel syntax only for command-adapter calls. */
10
+ export declare function runUpdate(id:string,options:UpdateCommandOptions,global:GlobalOptions):Promise<import("../../../sdk/lifecycle/update.js").UpdateResult>;
@@ -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]="841f6791-c2b4-51ea-8047-d27f51ffafb5")}catch{}})();export*from"../../../sdk/lifecycle/update.js";
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]="41b0b451-a696-5d06-a19d-df1d6b28963c")}catch{}})();export*from"../../../sdk/lifecycle/update.js";import{runUpdate as runSdkUpdate}from"../../../sdk/lifecycle/update.js";import{withCliMutationInput}from"../../../sdk/runtime-primitives.js";function runUpdate(id,options,global2){return runSdkUpdate(id,withCliMutationInput(options),global2)}export{runUpdate};
2
2
  //# sourceMappingURL=update.js.map
@@ -14,6 +14,12 @@ tombstone?:PmCliErrorContext["tombstone"];
14
14
  lease?:PmCliErrorContext["lease"];
15
15
  /** Lock generation observed at a refused lock_lost commit. */
16
16
  currentOwner?:PmCliErrorContext["current_owner"];
17
+ /** Principal holding the item behind an already_claimed_by refusal. */
18
+ claimedBy?:string;
19
+ /** When that holder took the item; null when history was silent. */
20
+ claimedAt?:string | null;
21
+ /** Whether the holder arrived through a claim or an assignment. */
22
+ claimSource?:PmCliErrorContext["claim_source"];
17
23
  code:string;
18
24
  type:string;
19
25
  title:string;
@@ -46,8 +52,20 @@ policy_violation_count?:number;
46
52
  /** Process exit code paired with the refusal. */
47
53
  exit_code:number;
48
54
  }
55
+ /** Structured preflight advisories retained alongside a machine-readable outcome. */
56
+ export interface PreflightWarningDiagnostics {
57
+ /** Stable advisory codes emitted before command execution. */
58
+ warnings?:string[];
59
+ /** Additional actionable guidance that accompanies an advisory code. */
60
+ warning_details?:Array<{
61
+ /** Stable code identifying the advisory. */
62
+ code:string;
63
+ /** Human-readable remediation retained for this code. */
64
+ message:string;
65
+ }>;
66
+ }
49
67
  /** Documents the json error envelope payload exchanged by command, SDK, and package integrations. */
50
- export interface JsonErrorEnvelope {
68
+ export interface JsonErrorEnvelope extends PreflightWarningDiagnostics {
51
69
  /** Completed durable writes, with paths relative to the selected tracker. */
52
70
  side_effects?:PmCliErrorContext["side_effects"];
53
71
  /** Verified admission refusal before any mutation. */
@@ -64,6 +82,12 @@ tombstone?:PmCliErrorContext["tombstone"];
64
82
  lease?:PmCliErrorContext["lease"];
65
83
  /** Lock generation observed at a refused lock_lost commit, or null when none exists. */
66
84
  current_owner?:PmCliErrorContext["current_owner"];
85
+ /** Principal holding the item behind an already_claimed_by refusal. */
86
+ claimed_by?:string;
87
+ /** When that holder took the item, or null when history was silent. */
88
+ claimed_at?:string | null;
89
+ /** Whether the holder arrived through an explicit claim or a metadata assignment. */
90
+ claim_source?:PmCliErrorContext["claim_source"];
67
91
  /** Schema type that determines the shape and validation rules for this value. */
68
92
  type:string;
69
93
  /** Value that configures or reports code for this contract. */
@@ -101,7 +125,12 @@ diagnostic_output?:PmDiagnosticOutputReceipt;
101
125
  }
102
126
  /** Error envelope after deterministic budget projection. */
103
127
  export type ProjectedJsonErrorEnvelope = PmProjectedDiagnostic<JsonErrorEnvelope>;
104
- /** Compact an error envelope to fields that change the caller's next action. */
128
+ /**
129
+ * Compact an error envelope to fields that change the caller's next action:
130
+ * the duplicated title, generic `required`/`why`/examples and the invocation
131
+ * echo go; code-specific rationale, examples, recovery and typed holder
132
+ * evidence stay (GH-1610).
133
+ */
105
134
  export declare function projectLeanErrorEnvelope(envelope:ProjectedJsonErrorEnvelope):ProjectedJsonErrorEnvelope;
106
135
  /** Documents the error classification payload exchanged by command, SDK, and package integrations. */
107
136
  export interface ErrorClassification {
@@ -121,6 +150,12 @@ tombstone?:PmCliErrorContext["tombstone"];
121
150
  lease?:PmCliErrorContext["lease"];
122
151
  /** Lock generation observed at a refused lock_lost commit, or null when none exists. */
123
152
  current_owner?:PmCliErrorContext["current_owner"];
153
+ /** Principal holding the item behind an already_claimed_by refusal. */
154
+ claimed_by?:string;
155
+ /** When that holder took the item, or null when history was silent. */
156
+ claimed_at?:string | null;
157
+ /** Whether the holder arrived through an explicit claim or a metadata assignment. */
158
+ claim_source?:PmCliErrorContext["claim_source"];
124
159
  /** Schema type that determines the shape and validation rules for this value. */
125
160
  type:string;
126
161
  /** Value that configures or reports code for this contract. */
@@ -199,8 +234,13 @@ declare function resolveKnownPackageCommandHint(commandToken:string):PackageComm
199
234
  declare function renderList(title:string,entries:string[]):string[];
200
235
  /** Whitelist valid recovery fields before exposing them in public CLI diagnostics. */
201
236
  declare function normalizeRecoveryPayload(payload:PmCliErrorRecoveryPayload | undefined):PmCliErrorRecoveryPayload | undefined;
237
+ /** Presentation controls for text refusals. */
238
+ export interface RenderGuidanceOptions {
239
+ /** Omit constant boilerplate and the invocation echo; keep code-specific recovery (GH-1610). */
240
+ lean?:boolean;
241
+ }
202
242
  /** Implements render guidance message for the public runtime surface of this module. */
203
- export declare function renderGuidanceMessage(message:GuidanceMessage):string;
243
+ export declare function renderGuidanceMessage(message:GuidanceMessage,options?:RenderGuidanceOptions):string;
204
244
  /** Project guidance into JSON, preserving no-write evidence only when explicitly verified. */
205
245
  declare function guidanceToJsonEnvelope(message:GuidanceMessage,exitCode:number):JsonErrorEnvelope;
206
246
  /** Classify guidance with the same optional refusal evidence as the JSON envelope. */
@@ -216,13 +256,13 @@ declare function appendIfMissing(entries:string[],value:string | undefined):stri
216
256
  /** Synthesize a copy-pasteable retry for the unquoted linked-test value shape `pm test <id> --add command npm test -- parser` by re-joining the shell-split value tokens into the documented quoted `key=value` form. Only fires when the item id already precedes the flag (so trailing tokens unambiguously belong to the value) and the token after `--add`/`--remove` is an entry-identity key. */
217
257
  export declare function buildLinkedTestQuotedRetryCommand(argv:string[] | undefined):string | undefined;
218
258
  /** Render concise initialization recovery or the bounded diagnostic for other failures. */
219
- export declare function formatPmCliErrorForDisplay(rawMessage:string,context?:PmCliErrorContext):string;
259
+ export declare function formatPmCliErrorForDisplay(rawMessage:string,context?:PmCliErrorContext,options?:RenderGuidanceOptions):string;
220
260
  /** Implements classify pm cli error for the public runtime surface of this module. */
221
261
  export declare function classifyPmCliError(rawMessage:string,context?:PmCliErrorContext):ErrorClassification;
222
262
  /** Implements format pm cli error for json for the public runtime surface of this module. */
223
263
  export declare function formatPmCliErrorForJson(rawMessage:string,exitCode:number,context?:PmCliErrorContext):ProjectedJsonErrorEnvelope;
224
264
  /** Implements format commander error for display for the public runtime surface of this module. */
225
- export declare function formatCommanderErrorForDisplay(rawMessage:string,commandName:string | undefined,allowedTypes:string,context?:CommanderGuidanceContext):string;
265
+ export declare function formatCommanderErrorForDisplay(rawMessage:string,commandName:string | undefined,allowedTypes:string,context?:CommanderGuidanceContext,options?:RenderGuidanceOptions):string;
226
266
  /** Implements classify commander error for the public runtime surface of this module. */
227
267
  export declare function classifyCommanderError(rawMessage:string,commandName:string | undefined,allowedTypes:string,context?:CommanderGuidanceContext):ErrorClassification;
228
268
  /** Implements format commander error for json for the public runtime surface of this module. */