@unbrained/pm-cli 2026.11.14 → 2026.11.16

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 (281) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +1 -1
  3. package/dist/cli/error-guidance.js +2 -2
  4. package/dist/cli/extension-command-help.js +2 -2
  5. package/dist/cli/help-content.js +2 -2
  6. package/dist/cli/register-operations.js +1 -1
  7. package/dist/cli-bundle/bundle-manifest.json +1 -1
  8. package/dist/cli-bundle/chunks/{chunk-UJMQP2HP.js → chunk-2D26HRXB.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-EXO4PM5J.js → chunk-2WNORBVN.js} +86 -71
  10. package/dist/cli-bundle/chunks/chunk-4I7YG3VZ.js +3 -0
  11. package/dist/cli-bundle/chunks/chunk-4WIVCOA7.js +2 -0
  12. package/dist/cli-bundle/chunks/chunk-A3WCP4TU.js +6 -0
  13. package/dist/cli-bundle/chunks/chunk-AB5S6TWE.js +124 -0
  14. package/dist/cli-bundle/chunks/chunk-BV7J3LRH.js +114 -0
  15. package/dist/cli-bundle/chunks/{chunk-AXTUB74T.js → chunk-DZWRNL6R.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-E4BQRZF2.js +10 -0
  17. package/dist/cli-bundle/chunks/chunk-ERD2RYWM.js +31 -0
  18. package/dist/cli-bundle/chunks/chunk-F7P42FL5.js +9 -0
  19. package/dist/cli-bundle/chunks/{chunk-547OEGDR.js → chunk-FZ4XWWLO.js} +25 -25
  20. package/dist/cli-bundle/chunks/{chunk-65SBMIK6.js → chunk-I3T2FVUA.js} +2 -2
  21. package/dist/cli-bundle/chunks/chunk-IGEBFNWE.js +2 -0
  22. package/dist/cli-bundle/chunks/chunk-IYICNCK2.js +2 -0
  23. package/dist/cli-bundle/chunks/chunk-J257NZRD.js +20 -0
  24. package/dist/cli-bundle/chunks/chunk-JD3XWF66.js +3 -0
  25. package/dist/cli-bundle/chunks/chunk-JLHD7OQ2.js +2 -0
  26. package/dist/cli-bundle/chunks/{chunk-V2OAXGHK.js → chunk-KGOGLKL2.js} +2 -2
  27. package/dist/cli-bundle/chunks/chunk-LC4DJVXR.js +2 -0
  28. package/dist/cli-bundle/chunks/chunk-NHNM3GIP.js +3 -0
  29. package/dist/cli-bundle/chunks/{chunk-RSAN2YUU.js → chunk-NYN5OR2T.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-OFZQEQ6X.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-QGL5IAP4.js +8 -0
  32. package/dist/cli-bundle/chunks/chunk-R24NZ2TB.js +8 -0
  33. package/dist/cli-bundle/chunks/chunk-VJLZHOTP.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-VO2HSB5F.js +2 -0
  35. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-I6RQGD6Y.js → indexed-receipt-blobs-HNLN6UXH.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-revision-PSOL5I4H.js +2 -0
  37. package/dist/cli-bundle/chunks/item-transaction-55QTCU2M.js +2 -0
  38. package/dist/cli-bundle/chunks/mutation-actor-BDBBH3ZS.js +2 -0
  39. package/dist/cli-bundle/chunks/mutation-admission-WUN7JYVJ.js +2 -0
  40. package/dist/cli-bundle/chunks/{register-list-query-MCNOV6ML.js → register-list-query-AESCVO6H.js} +2 -2
  41. package/dist/cli-bundle/chunks/{register-mutation-KYXLYHOK.js → register-mutation-SKCEP5QU.js} +3 -3
  42. package/dist/cli-bundle/chunks/register-operations-ZT4OYCF3.js +2 -0
  43. package/dist/cli-bundle/chunks/register-setup-JVWNS2TY.js +2 -0
  44. package/dist/cli-bundle/chunks/{settlement-hook-JHXLUBEN.js → settlement-hook-MVVVUIVZ.js} +2 -2
  45. package/dist/cli-bundle/chunks/stage-RMU3JAWM.js +2 -0
  46. package/dist/cli-bundle/focused-chunks/chunk-3WVMEA2A.js +6 -0
  47. package/dist/cli-bundle/focused-chunks/chunk-5UVJOAUP.js +91 -0
  48. package/dist/cli-bundle/focused-chunks/chunk-5WQ3LNUK.js +78 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-6E4X7MQA.js +26 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-IDAYTYNN.js → chunk-7SEPCQV2.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-EXCVUBAE.js → chunk-7XHE335U.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-BEHIMEV2.js +2 -0
  53. package/dist/cli-bundle/focused-chunks/chunk-CZFZCSOX.js +2 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-TA4EGVE6.js → chunk-DFBHW7HP.js} +3 -3
  55. package/dist/cli-bundle/focused-chunks/chunk-DZMP3VYQ.js +26 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-HHMMIHZP.js +2 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-HPC2M6JD.js +6 -0
  58. package/dist/cli-bundle/focused-chunks/{chunk-EAYRYXA6.js → chunk-HR5FEUUL.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/chunk-J7ESCE7M.js +24 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-KRNF3WTC.js +3 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-KWZLY35A.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/chunk-M4IA4LC6.js +8 -0
  63. package/dist/cli-bundle/focused-chunks/{chunk-3SUKWYR2.js → chunk-NASE6JC2.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/chunk-ONM2R32I.js +65 -0
  65. package/dist/cli-bundle/focused-chunks/chunk-PDXSMSO5.js +3 -0
  66. package/dist/cli-bundle/focused-chunks/chunk-PEL4SQXV.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/chunk-QJ647CQE.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-SFATIM77.js +12 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-EH7JKGDH.js → chunk-UBBTBNUY.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/chunk-ZCN35TCK.js +2 -0
  71. package/dist/cli-bundle/focused-chunks/chunk-ZSQ2FT22.js +44 -0
  72. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-7XGVHYAO.js → indexed-receipt-blobs-ADMQXF3N.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/item-revision-GNKYO6GZ.js +2 -0
  74. package/dist/cli-bundle/focused-chunks/item-transaction-AUUQHR5Z.js +2 -0
  75. package/dist/cli-bundle/focused-chunks/mutation-actor-OBRD7HFZ.js +2 -0
  76. package/dist/cli-bundle/focused-chunks/mutation-admission-6TX3EOJX.js +2 -0
  77. package/dist/cli-bundle/focused-chunks/{settlement-hook-H56537UV.js → settlement-hook-5U2M75BY.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/stage-LERF2YJU.js +2 -0
  79. package/dist/cli-bundle/main.js +10 -10
  80. package/dist/cli-bundle/sdk-authoring.js +1 -1
  81. package/dist/cli-bundle/sdk-contracts.js +3 -3
  82. package/dist/cli-bundle/sdk-core.js +1 -1
  83. package/dist/cli-bundle/sdk-governance.js +1 -1
  84. package/dist/cli-bundle/sdk-graph.js +1 -1
  85. package/dist/cli-bundle/sdk-merge.js +57 -57
  86. package/dist/cli-bundle/sdk-query.js +1 -1
  87. package/dist/cli-bundle/sdk-runtime.js +1 -1
  88. package/dist/cli-bundle/sdk-testing.js +1 -1
  89. package/dist/cli-bundle/sdk.js +11 -11
  90. package/dist/core/diagnostics/remediation.js +1 -1
  91. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  92. package/dist/core/extensions/extension-types.d.ts +30 -0
  93. package/dist/core/extensions/extension-types.js +1 -1
  94. package/dist/core/extensions/index.d.ts +21 -1
  95. package/dist/core/extensions/index.js +1 -1
  96. package/dist/core/extensions/mutation-actor-snapshot.js +2 -0
  97. package/dist/core/extensions/mutation-actor.js +2 -0
  98. package/dist/core/item/deferred-fields.js +2 -0
  99. package/dist/core/item/item-format-version.d.ts +8 -7
  100. package/dist/core/item/item-format-version.js +1 -1
  101. package/dist/core/item/item-format.js +2 -2
  102. package/dist/core/output/mutation-projection.js +1 -1
  103. package/dist/core/output/output.d.ts +7 -0
  104. package/dist/core/output/output.js +3 -3
  105. package/dist/core/schema/runtime-field-values.d.ts +4 -0
  106. package/dist/core/schema/runtime-field-values.js +1 -1
  107. package/dist/core/shared/errors.d.ts +22 -0
  108. package/dist/core/shared/errors.js +1 -1
  109. package/dist/core/shared/item-metadata-contract.js +1 -1
  110. package/dist/core/store/item-store.d.ts +15 -4
  111. package/dist/core/store/item-store.js +1 -1
  112. package/dist/core/telemetry/policy.d.ts +21 -2
  113. package/dist/core/telemetry/policy.js +1 -1
  114. package/dist/sdk/agent/closed-domain-contracts.js +1 -1
  115. package/dist/sdk/authoring.d.ts +1 -1
  116. package/dist/sdk/authoring.js +1 -1
  117. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  118. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  119. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  120. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  121. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +1 -1
  122. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  123. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -1
  124. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  125. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  126. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  127. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  128. package/dist/sdk/completion/bash.js +1 -1
  129. package/dist/sdk/completion/fish.js +4 -1
  130. package/dist/sdk/completion/zsh.js +14 -2
  131. package/dist/sdk/extension/command-options.d.ts +23 -4
  132. package/dist/sdk/extension/command-options.js +1 -1
  133. package/dist/sdk/extension/native-command-options.js +2 -0
  134. package/dist/sdk/flag-invocation-contracts.js +1 -1
  135. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  136. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  137. package/dist/sdk/governance/health.js +2 -2
  138. package/dist/sdk/governance/in-progress-work-health.d.ts +49 -0
  139. package/dist/sdk/governance/in-progress-work-health.js +2 -0
  140. package/dist/sdk/governance/lifecycle-dependency-cycles.d.ts +12 -0
  141. package/dist/sdk/governance/lifecycle-dependency-cycles.js +2 -0
  142. package/dist/sdk/governance/stale-work.d.ts +143 -2
  143. package/dist/sdk/governance/stale-work.js +1 -1
  144. package/dist/sdk/governance/validate-deferred-fields.js +2 -0
  145. package/dist/sdk/governance/validate.d.ts +2 -2
  146. package/dist/sdk/governance/validate.js +1 -1
  147. package/dist/sdk/governance.d.ts +1 -1
  148. package/dist/sdk/governance.js +1 -1
  149. package/dist/sdk/history-compact.js +1 -1
  150. package/dist/sdk/index.d.ts +1 -1
  151. package/dist/sdk/index.js +1 -1
  152. package/dist/sdk/item-transaction.d.ts +2 -2
  153. package/dist/sdk/item-transaction.js +1 -1
  154. package/dist/sdk/lifecycle/claim.d.ts +46 -3
  155. package/dist/sdk/lifecycle/claim.js +1 -1
  156. package/dist/sdk/lifecycle/close.js +1 -1
  157. package/dist/sdk/lifecycle/copy.js +1 -1
  158. package/dist/sdk/lifecycle/create-deferrals.js +2 -0
  159. package/dist/sdk/lifecycle/create.d.ts +6 -2
  160. package/dist/sdk/lifecycle/create.js +1 -1
  161. package/dist/sdk/lifecycle/restore.js +1 -1
  162. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +7 -1
  163. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  164. package/dist/sdk/lifecycle/task-composition.js +1 -1
  165. package/dist/sdk/merge/three-way.d.ts +1 -1
  166. package/dist/sdk/merge/three-way.js +2 -2
  167. package/dist/sdk/ownership-source.d.ts +32 -0
  168. package/dist/sdk/ownership-source.js +1 -1
  169. package/dist/sdk/package-import-adapters.d.ts +9 -1
  170. package/dist/sdk/package-import-adapters.js +1 -1
  171. package/dist/sdk/public-surface.json +1 -1
  172. package/dist/sdk/query/complete-list.d.ts +14 -5
  173. package/dist/sdk/query/complete-list.js +1 -1
  174. package/dist/sdk/query/context.d.ts +5 -1
  175. package/dist/sdk/query/context.js +2 -2
  176. package/dist/sdk/query/list.js +1 -1
  177. package/dist/sdk/query/next.d.ts +19 -3
  178. package/dist/sdk/query/next.js +1 -1
  179. package/dist/sdk/query/projection-contracts.d.ts +6 -0
  180. package/dist/sdk/query/projection-contracts.js +1 -1
  181. package/dist/sdk/read-output/extension.js +1 -1
  182. package/dist/sdk/runtime-input.d.ts +6 -2
  183. package/dist/sdk/runtime-input.js +1 -1
  184. package/dist/sdk/runtime-primitives.d.ts +2 -2
  185. package/dist/sdk/runtime-primitives.js +1 -1
  186. package/dist/sdk/runtime.d.ts +2 -2
  187. package/dist/sdk/runtime.js +1 -1
  188. package/dist/sdk/structured-mutations.js +1 -1
  189. package/dist/sdk/testing.d.ts +15 -2
  190. package/dist/sdk/testing.js +1 -1
  191. package/dist/types.d.ts +8 -0
  192. package/dist/types.js +1 -1
  193. package/docs/AGENT_GUIDE.md +2 -0
  194. package/docs/COMMANDS.md +31 -0
  195. package/docs/CONFIGURATION.md +20 -7
  196. package/docs/EXTENSIONS.md +1 -1
  197. package/docs/LIFECYCLE_COMMANDS.md +8 -1
  198. package/docs/MUTATION_INTEGRITY.md +79 -1
  199. package/docs/SDK.md +139 -5
  200. package/docs/generated/FLAG_LEXICON_BUDGETS.md +3 -3
  201. package/marketplace.json +1 -1
  202. package/node_modules/commander/Readme.md +6 -32
  203. package/node_modules/commander/index.js +1 -1
  204. package/node_modules/commander/lib/command.js +22 -9
  205. package/node_modules/commander/lib/help.js +6 -2
  206. package/node_modules/commander/lib/option.js +1 -1
  207. package/node_modules/commander/package.json +2 -1
  208. package/node_modules/commander/typings/index.d.ts +6 -3
  209. package/node_modules/semver/classes/range.js +2 -2
  210. package/node_modules/semver/internal/constants.js +30 -0
  211. package/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
  212. package/node_modules/semver/package.json +1 -1
  213. package/package.json +8 -5
  214. package/packages/pm-beads/package.json +1 -1
  215. package/packages/pm-calendar/extensions/calendar/command-definitions.ts +2 -0
  216. package/packages/pm-calendar/package.json +1 -1
  217. package/packages/pm-command-kit/package.json +1 -1
  218. package/packages/pm-digital-twin/package.json +1 -1
  219. package/packages/pm-governance-audit/package.json +1 -1
  220. package/packages/pm-guide-shell/package.json +1 -1
  221. package/packages/pm-kanban/package.json +1 -1
  222. package/packages/pm-lifecycle-hooks/package.json +1 -1
  223. package/packages/pm-linked-test-adapters/package.json +1 -1
  224. package/packages/pm-search-advanced/package.json +1 -1
  225. package/packages/pm-templates/package.json +1 -1
  226. package/packages/pm-todos/extensions/todos/runtime.ts +3 -0
  227. package/packages/pm-todos/package.json +1 -1
  228. package/packages/pm-vcs/package.json +1 -1
  229. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  230. package/plugins/pm-claude/package.json +1 -1
  231. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  232. package/plugins/pm-codex/package.json +1 -1
  233. package/plugins/pm-codex/plugin.json +1 -1
  234. package/runtime-dependencies.json +1 -1
  235. package/dist/cli-bundle/chunks/chunk-25BUKX4W.js +0 -2
  236. package/dist/cli-bundle/chunks/chunk-27FG6ROB.js +0 -2
  237. package/dist/cli-bundle/chunks/chunk-5TGFB34A.js +0 -2
  238. package/dist/cli-bundle/chunks/chunk-BHH65KLL.js +0 -2
  239. package/dist/cli-bundle/chunks/chunk-C7M54YV6.js +0 -122
  240. package/dist/cli-bundle/chunks/chunk-DMWL3K4A.js +0 -20
  241. package/dist/cli-bundle/chunks/chunk-DVN7CD5B.js +0 -2
  242. package/dist/cli-bundle/chunks/chunk-DZ7CWUVM.js +0 -8
  243. package/dist/cli-bundle/chunks/chunk-FRCNYOTG.js +0 -9
  244. package/dist/cli-bundle/chunks/chunk-HXECILIE.js +0 -31
  245. package/dist/cli-bundle/chunks/chunk-IDFRGH4X.js +0 -3
  246. package/dist/cli-bundle/chunks/chunk-JSTBYDLL.js +0 -3
  247. package/dist/cli-bundle/chunks/chunk-MELSYAFE.js +0 -124
  248. package/dist/cli-bundle/chunks/chunk-O4ZLEN4T.js +0 -3
  249. package/dist/cli-bundle/chunks/chunk-OTM6PXZQ.js +0 -8
  250. package/dist/cli-bundle/chunks/chunk-PC5DGK3C.js +0 -6
  251. package/dist/cli-bundle/chunks/chunk-PF3V443A.js +0 -2
  252. package/dist/cli-bundle/chunks/chunk-U2HVJVA5.js +0 -2
  253. package/dist/cli-bundle/chunks/chunk-VERRDW3Q.js +0 -2
  254. package/dist/cli-bundle/chunks/item-revision-VGIHIWZM.js +0 -2
  255. package/dist/cli-bundle/chunks/item-transaction-6OB6BGTD.js +0 -2
  256. package/dist/cli-bundle/chunks/mutation-admission-LL6SGQYU.js +0 -2
  257. package/dist/cli-bundle/chunks/register-operations-6RQF6IAE.js +0 -2
  258. package/dist/cli-bundle/chunks/register-setup-XGPOFFD3.js +0 -2
  259. package/dist/cli-bundle/chunks/stage-ZS7WNUD4.js +0 -2
  260. package/dist/cli-bundle/focused-chunks/chunk-2A4JCFMI.js +0 -2
  261. package/dist/cli-bundle/focused-chunks/chunk-2T6MQ7NP.js +0 -3
  262. package/dist/cli-bundle/focused-chunks/chunk-32QYILXW.js +0 -82
  263. package/dist/cli-bundle/focused-chunks/chunk-4WOF3Q6R.js +0 -2
  264. package/dist/cli-bundle/focused-chunks/chunk-5IQPFV4Y.js +0 -2
  265. package/dist/cli-bundle/focused-chunks/chunk-6C7NBJ7A.js +0 -26
  266. package/dist/cli-bundle/focused-chunks/chunk-7KNF6RCV.js +0 -12
  267. package/dist/cli-bundle/focused-chunks/chunk-FNLOLNPQ.js +0 -2
  268. package/dist/cli-bundle/focused-chunks/chunk-G6ERMFJ5.js +0 -3
  269. package/dist/cli-bundle/focused-chunks/chunk-HRLGC3P7.js +0 -28
  270. package/dist/cli-bundle/focused-chunks/chunk-I7A5VP5E.js +0 -65
  271. package/dist/cli-bundle/focused-chunks/chunk-JHC3X43E.js +0 -2
  272. package/dist/cli-bundle/focused-chunks/chunk-MKYNDWT3.js +0 -91
  273. package/dist/cli-bundle/focused-chunks/chunk-RDTHL44U.js +0 -2
  274. package/dist/cli-bundle/focused-chunks/chunk-UCCLV5GJ.js +0 -8
  275. package/dist/cli-bundle/focused-chunks/chunk-W3RWCLEU.js +0 -2
  276. package/dist/cli-bundle/focused-chunks/chunk-W57DSFSU.js +0 -44
  277. package/dist/cli-bundle/focused-chunks/chunk-YNYO7PMT.js +0 -26
  278. package/dist/cli-bundle/focused-chunks/item-revision-7J7WSCPC.js +0 -2
  279. package/dist/cli-bundle/focused-chunks/item-transaction-F5YMCPRB.js +0 -2
  280. package/dist/cli-bundle/focused-chunks/mutation-admission-2NRQEAOG.js +0 -2
  281. package/dist/cli-bundle/focused-chunks/stage-2KVCKOGC.js +0 -2
package/docs/SDK.md CHANGED
@@ -1270,6 +1270,34 @@ filters, and bound the race-loss candidate walk with `maxAttempts` (1 through
1270
1270
  100 inclusive), so custom SDK
1271
1271
  tools do not need to reproduce CLI concurrency policy.
1272
1272
 
1273
+ Stale work uses one activity clock and one threshold
1274
+ (`mutation_guard.stale_in_progress_hours`, exported as
1275
+ `STALE_WORK_THRESHOLD_SETTING`) everywhere. Advisory results (`pm health`,
1276
+ `pm context`, `inspectInProgressWork`/`scanInProgressWork`, `held_by_others`)
1277
+ can still call an item idle when the takeover would refuse it: advisory reads
1278
+ degrade an unreadable history stream to metadata activity, while the ownership
1279
+ evaluation fails closed (`claim_activity.history_unreadable`, never stale).
1280
+ The takeover anchors on the holder's own claim record. A readable stream that
1281
+ cannot prove the holder's idleness from that record onward also fails closed
1282
+ (`claim_activity.unproven_activity`, never stale). The reasons are
1283
+ `claim_record_unavailable`, `discarded_history_tail`, `rewritten_history` and
1284
+ `workspace_restored`. `unprovenClaimActivity()` returns the reason a stream
1285
+ gives, and `UNPROVEN_ACTIVITY_REASONS` lists all of them. Establish takeover eligibility only through `resolveItemOwnershipActivity()` or
1286
+ the locked `pm claim --takeover-stale` decision, never from an advisory row. Each `held_by_others` row is a
1287
+ `NextHeldRow` with `claimed_at`, `idle_hours` and `stale`.
1288
+ `runClaim(id, false, global, { takeoverStale: true })` takes over only an idle
1289
+ claim and returns a `StaleClaimTakeoverReceipt` as `takeover`; an active claim
1290
+ throws `STALE_CLAIM_TAKEOVER_REFUSED_CODE` (`stale_claim_takeover_refused`) with
1291
+ `context.claim_activity`. `evaluateClaimActivity()` returns that evidence
1292
+ directly; `resolveItemOwnershipActivity()` returns an `ItemOwnershipActivity`
1293
+ (holder, `source` and `since`) that carries it as `.activity`, so read
1294
+ `.activity.history_unreadable`, `.activity.unproven_activity` and
1295
+ `.activity.stale_policy` there. `inspectInProgressWork()`
1296
+ and `scanInProgressWork()` classify in-progress work into `unowned`, `idle` and
1297
+ `stale` groups (pass `status_registry` so stored status aliases resolve the way
1298
+ the `in_progress` counters resolve them), and `buildInProgressSweepCommands()` returns the exact list
1299
+ sweeps `pm health` prints.
1300
+
1273
1301
  Lifecycle convenience methods and the matching top-level functions (`create`,
1274
1302
  `update`, `reopen`, `close`, `claim`, `release`, `copy`, `deleteItem`, `restore`,
1275
1303
  `focus`, `startTask`, `pauseTask`, and `closeTask`) use the same mutation paths
@@ -2106,9 +2134,33 @@ executes the staged plan. An already committed journal instead returns
2106
2134
  without freshly executing or validating the supplied lifecycle steps. Both
2107
2135
  results disclose
2108
2136
  `unresolved_commit_constraints: ["concurrent_tracker_changes",
2109
- "extension_mutation_guards_and_hooks"]`. Newly staged validation proves core
2137
+ "extension_write_hooks", ...]`. Newly staged validation proves core
2110
2138
  semantic validity at that snapshot; commit still checks current state and runs
2111
- extension guards and hooks. Preview cost is proportional to the tracker data
2139
+ every extension hook. The caller's `beforeMutation` guards are the exception
2140
+ (GH-1719): a newly staged preview evaluates them against the staged plan with
2141
+ `dry_run: true` and the same `actor` the commit presents, so a guard denial
2142
+ surfaces at preview time. Inside a preview, the guard's `pm_root` and `sdk`
2143
+ read the disposable staged tracker. Every other hook kind stays suppressed.
2144
+
2145
+ ### Actor-aware mutation guards
2146
+
2147
+ Every `beforeMutation` context carries a frozen `actor` (GH-1719). Its
2148
+ `author`, `author_source` and `agent` provenance are exactly what the
2149
+ mutation's history entry records, and `principal` is the ownership identity the
2150
+ claim check compares. A package can therefore enforce actor-aware policy, such
2151
+ as letting only the claimant close an item:
2152
+
2153
+ ```ts
2154
+ api.hooks.beforeMutation(({ operation, before, actor }) => {
2155
+ const holder = before?.metadata.claim_principal ?? before?.metadata.assignee;
2156
+ if (operation !== "close" || !holder || holder === actor.principal) return { allow: true };
2157
+ return { allow: false, code: "close_requires_claimant", remediation: `Ask ${holder} to close it, or claim it first.` };
2158
+ });
2159
+ ```
2160
+
2161
+ Hosts never supply a placeholder: an unattributed write reports
2162
+ `author: "unknown"` with `author_source: "unknown"`. `runRegisteredMutationGuardForTest`
2163
+ resolves an omitted test `actor` from the context's `author` the same way. Preview cost is proportional to the tracker data
2112
2164
  staged, rather than unrelated root-layout project content.
2113
2165
 
2114
2166
  `itemDocumentToMutationOptions` is the companion full-document adapter. It
@@ -2365,7 +2417,16 @@ const certified = certifyCompleteListResult(candidate);
2365
2417
 
2366
2418
  `PmCompleteListValidationError.receipt` lists every failed invariant and carries
2367
2419
  the exact recovery command
2368
- `pm list --all --full --strict-read --no-truncate --output-budget unbounded --json`.
2420
+ `pm list --all --output-include full --strict-read --no-truncate --output-budget unbounded --output-limit unbounded --json`
2421
+ with its SDK equivalent `await client.listAllComplete()`. `--no-truncate` is
2422
+ load-bearing here: it lifts `pm list`'s own page limit and is the flag that
2423
+ echoes `filters.no_truncate`, which certification requires. A refused request that
2424
+ asked for bodies gets a recovery that asks for them too (`--include-body` and
2425
+ `listAllComplete({ includeBody: true })`): pass the request's options as
2426
+ `certifyCompleteListResult(candidate, { includeBody: true })`, or let the
2427
+ certifier read the `filters.include_body` record the list envelope carries
2428
+ ([pm-gh1728](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1728.toon),
2429
+ tracker record excluded from npm).
2369
2430
  The helper never infers completeness from a large limit: derived-index reads,
2370
2431
  terminal-state filtering, duplicate ids, cursor/session projection, compaction,
2371
2432
  and any omission receipt all prevent certification.
@@ -2873,7 +2934,24 @@ api.registerCommand({
2873
2934
  The handler must return a structured object. Each declared path must contain
2874
2935
  an array or object map; paths may be nested, unique and non-overlapping. Use
2875
2936
  `row_keys: []` for a singleton result. Activation snapshots the declaration,
2876
- and the host validates the returned collections before projecting them. Avoid
2937
+ and the host validates the collections of the result it delivers before
2938
+ projecting them or rendering them. That result is the handler's own unless an
2939
+ `output_format` service returns a structured replacement: the replacement is
2940
+ then validated in its place, so a replacement that supplies the declared rows
2941
+ is admitted even when the handler's result lacks them, while a string rendering
2942
+ replaces nothing and the handler's result is validated. A command that
2943
+ delivers a compact receipt (for example `{ ok: true, output: "report.md" }`
2944
+ after writing a file) keeps returning its rows, or an empty collection, and
2945
+ lets its `output_format` service render the receipt; a receipt-only result is
2946
+ refused with `extension_read_output_invalid`. `runRegisteredCommandForTest`
2947
+ and `createExtensionTestHarness().runCommand()` run a handled read-output
2948
+ result through native `formatOutput` itself, inside an isolated runtime that
2949
+ holds the activation's commands, services and registrations: the
2950
+ mutation-receipt projection, command-result overrides, suppressed host
2951
+ output, `output_format` services and encoding resolution apply as they do
2952
+ natively, so a package test fails exactly where the native CLI would
2953
+ ([pm-gh1729](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1729.toon),
2954
+ tracker record excluded from npm). Avoid
2877
2955
  reserved metadata and prototype property names. The declaration promises a
2878
2956
  read-only handler; writers and undeclared commands keep refusing read controls,
2879
2957
  and native commands/actions retain their existing contracts. A declaration
@@ -3162,7 +3240,7 @@ definition-driven normalizer
3162
3240
  ([pm-gh1665](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1665.toon),
3163
3241
  tracker record excluded from npm). A direct caller should pass the handler key.
3164
3242
  The flag's own spellings (`status-filter`, `--status-filter`, or its short
3165
- letter) fold into the same key, and undeclared keys pass through unchanged. Two
3243
+ letter) fold into the same key. Two
3166
3244
  spellings of one flag with different values are refused with
3167
3245
  `extension_option_spelling_conflict` (exit 2) instead of silently picking one.
3168
3246
  CLI argv gets the same refusal: `pm demo-brief --status-filter open -s closed`
@@ -3178,6 +3256,46 @@ await client.run("demo-brief", { options: { statusFilter: "closed" } }); // hand
3178
3256
  await client.run("demo-brief", { options: { "status-filter": "closed" } }); // same result
3179
3257
  ```
3180
3258
 
3259
+ Direct callers get the refusals CLI argv gets, with the same codes and exit 2,
3260
+ before the handler runs
3261
+ ([pm-gh1726](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1726.toon),
3262
+ [pm-gh1727](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1727.toon),
3263
+ tracker records excluded from npm). Match on the code, never the message:
3264
+
3265
+ | Condition | Code | Structured fields |
3266
+ |---|---|---|
3267
+ | A required flag is missing (an empty array counts as missing for a `list` flag) | `missing_required_option` | `flag`, `field` (the handler key), `recovery.missing` |
3268
+ | A key is neither a declared spelling nor host-owned | `unknown_option` | `flag` (dashed form of the key) |
3269
+ | A disabled flag is supplied | `extension_option_disabled` | `flag` |
3270
+ | An array is passed to a flag that is not `list`/`repeatable`, or a strict value is malformed | `extension_flag_value_invalid` | `flag` |
3271
+
3272
+ Host-owned keys pass through untouched: every reserved host flag in camel case,
3273
+ snake_case or dashed form (`json`, `outputBudget`, `output_budget`, `pmPath`,
3274
+ `--json`), the positive key of each `--no-*` switch, and the action-transport
3275
+ keys `force`, `subcommand`, `inputResponses` and `requestState`. The
3276
+ unknown-key refusal applies to extension-created commands only: on a command
3277
+ path core itself registers that an extension extends or overrides (`list`;
3278
+ package-owned compatibility paths such as `calendar` or `guide` stay strict),
3279
+ the native contract
3280
+ (its aliases, negated flags and settings-dependent runtime fields) owns every
3281
+ key the extension does not declare, so those keys keep passing through. A
3282
+ command that declares no flags still receives every key (pm-4of199, below).
3283
+ A `repeatable` declaration counts as `list` for these checks, as the loader
3284
+ expands it, also when `normalizeDirectExtensionCommandOptions` is called
3285
+ directly. An
3286
+ extension action also keeps the caller's values as given: the native
3287
+ `tags`-to-CSV and `dep`-to-array rewrites of core commands do not apply to it.
3288
+ On the CLI, each bare occurrence of a repeatable boolean switch reaches the
3289
+ handler as `true` (`--many --many` is `[true, true]`). A direct caller's negated
3290
+ spelling of a declared boolean (`no-many`, `--no-many`) inverts token by token
3291
+ and is then judged exactly as the canonical spelling: on a `list` boolean,
3292
+ `{ "no-many": "true,false" }` is `{ many: [false, true] }`, a blank segment is
3293
+ refused under `value_validation: "strict"` and dropped otherwise, and
3294
+ `{ many: false, "no-many": true }` is one value, not a spelling conflict. A
3295
+ `repeatable` boolean keeps each occurrence atomic, so `"true,false"` is one
3296
+ malformed token under either spelling. A value that is not a boolean token
3297
+ (`"bogus"`) cannot be inverted and is refused with `extension_flag_value_invalid`.
3298
+
3181
3299
  `pm contracts --command <command> --flags-only --json` publishes the key as
3182
3300
  `sdk_option` on every extension-declared row, and marks the row `owner:
3183
3301
  "extension"`. The same entry lists the host flags the command inherits under
@@ -4138,6 +4256,22 @@ the host-bound `sdk` service bundle). Importers can therefore compose native PM
4138
4256
  actions and relationship stores without spawning the CLI or recursively
4139
4257
  activating packages.
4140
4258
 
4259
+ Strict trackers need no invented values from an importer
4260
+ ([pm-gh1713](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-gh1713.toon)). When the source system
4261
+ does not know a strict-required scalar, the create step can defer it with a
4262
+ reason: `create({ ..., defer: ["deadline", "assignee"], deferReason:
4263
+ "Imported from GitHub issue 42" })`. The same options work in a
4264
+ `commitItemMutations` create step and through MCP `pm_create`. Deferrable
4265
+ fields are `deadline`, `assignee`, `acceptance_criteria` and
4266
+ `estimated_minutes`. The item stores `deferred_fields` (format 4), and any
4267
+ later write that supplies a value resolves that entry. Validate lists open
4268
+ deferrals as curation work, and strict close refuses the item with
4269
+ `close_validation_deferred_fields` until every deferred field has a value.
4270
+ Package import adapters (`commitImportedItem`) now run the tracker's
4271
+ `beforeMutation` guards as operation `import`, with the importer's actor. A
4272
+ guard denial propagates as a refusal; only a held item lock returns the
4273
+ skippable `conflictWarning`.
4274
+
4141
4275
  By default the auto-created command only has a handler. Pass an optional third
4142
4276
  `ImportExportRegistrationOptions` argument to make it a first-class command with a
4143
4277
  description, flags, intent, examples, failure hints, and positional arguments —
@@ -12,7 +12,7 @@ This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not co
12
12
  | `packages` | extensions | 57 | 57 |
13
13
  | `install` | extensions | 28 | 28 |
14
14
  | `upgrade` | extensions | 30 | 30 |
15
- | `create` | intake | 103 | 103 |
15
+ | `create` | intake | 105 | 105 |
16
16
  | `copy` | intake | 25 | 25 |
17
17
  | `focus` | intake | 23 | 23 |
18
18
  | `list` | context | 87 | 87 |
@@ -67,9 +67,9 @@ This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not co
67
67
  | `gc` | workspace | 23 | 23 |
68
68
  | `workspace` | workspace | 24 | 24 |
69
69
  | `contracts` | quality | 30 | 30 |
70
- | `claim` | lifecycle | 40 | 40 |
70
+ | `claim` | lifecycle | 41 | 41 |
71
71
  | `release` | lifecycle | 26 | 26 |
72
- | `start-task` | lifecycle | 24 | 24 |
72
+ | `start-task` | lifecycle | 25 | 25 |
73
73
  | `pause-task` | lifecycle | 24 | 24 |
74
74
  | `close-task` | lifecycle | 25 | 25 |
75
75
  | `meet` | automation | 34 | 34 |
package/marketplace.json CHANGED
@@ -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.11.14","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.11.14","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.11.16","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.11.16","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"}]}
@@ -44,7 +44,6 @@ Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
44
44
  - [Bits and pieces](#bits-and-pieces)
45
45
  - [.parse() and .parseAsync()](#parse-and-parseasync)
46
46
  - [Parsing Configuration](#parsing-configuration)
47
- - [Legacy options as properties](#legacy-options-as-properties)
48
47
  - [TypeScript](#typescript)
49
48
  - [createCommand()](#createcommand)
50
49
  - [Node options such as `--harmony`](#node-options-such-as---harmony)
@@ -54,7 +53,6 @@ Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
54
53
  - [Override exit and output handling](#override-exit-and-output-handling)
55
54
  - [Additional documentation](#additional-documentation)
56
55
  - [Support](#support)
57
- - [Commander for enterprise](#commander-for-enterprise)
58
56
 
59
57
  For information about terms used in this document see: [terminology](./docs/terminology.md)
60
58
 
@@ -367,7 +365,8 @@ Example file: [options-variadic.js](./examples/options-variadic.js)
367
365
  ```js
368
366
  program
369
367
  .option('-n, --number <numbers...>', 'specify numbers')
370
- .option('-l, --letter [letters...]', 'specify letters');
368
+ .option('-l, --letter [letters...]', 'specify letters')
369
+ .argument('[operand]');
371
370
 
372
371
  program.parse();
373
372
 
@@ -380,10 +379,10 @@ $ collect -n 1 2 3 --letter a b c
380
379
  Options: { number: [ '1', '2', '3' ], letter: [ 'a', 'b', 'c' ] }
381
380
  Remaining arguments: []
382
381
  $ collect --letter=A -n80 operand
383
- Options: { number: [ '80' ], letter: [ 'A' ] }
382
+ Options: { letter: [ 'A' ], number: [ '80' ] }
384
383
  Remaining arguments: [ 'operand' ]
385
384
  $ collect --letter -n 1 -n 2 3 -- operand
386
- Options: { number: [ '1', '2', '3' ], letter: true }
385
+ Options: { letter: true, number: [ '1', '2', '3' ] }
387
386
  Remaining arguments: [ 'operand' ]
388
387
  ```
389
388
 
@@ -670,7 +669,7 @@ Example file: [action-this.js](./examples/action-this.js)
670
669
  program
671
670
  .command('serve')
672
671
  .argument('<script>')
673
- .option('-p, --port <number>', 'port number', 80)
672
+ .option('-p, --port <number>', 'port number', '80')
674
673
  .action(function() {
675
674
  console.error('Run script %s on port %s', this.args[0], this.opts().port);
676
675
  });
@@ -1016,25 +1015,6 @@ By default, the option processing shows an error for an unknown option. To have
1016
1015
  By default, the argument processing displays an error for more command-arguments than expected.
1017
1016
  To suppress the error for excess arguments, use `.allowExcessArguments()`.
1018
1017
 
1019
- ### Legacy options as properties
1020
-
1021
- Before Commander 7, the option values were stored as properties on the command.
1022
- This was convenient to code, but the downside was possible clashes with
1023
- existing properties of `Command`.
1024
-
1025
- You can revert to the old behaviour to run unmodified legacy code by using `.storeOptionsAsProperties()`.
1026
-
1027
- ```js
1028
- program
1029
- .storeOptionsAsProperties()
1030
- .option('-d, --debug')
1031
- .action((commandAndOptions) => {
1032
- if (commandAndOptions.debug) {
1033
- console.error(`Called ${commandAndOptions.name()}`);
1034
- }
1035
- });
1036
- ```
1037
-
1038
1018
  ### TypeScript
1039
1019
 
1040
1020
  **extra-typings:** There is an optional project to infer extra type information from the option and argument definitions.
@@ -1075,7 +1055,7 @@ You can enable `--harmony` option in two ways:
1075
1055
 
1076
1056
  An executable subcommand is launched as a separate child process.
1077
1057
 
1078
- If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al.,
1058
+ If you are using the node inspector for [debugging](https://nodejs.org/en/learn/getting-started/debugging) executable subcommands using `node --inspect` et al.,
1079
1059
  the inspector port is incremented by 1 for the spawned subcommand.
1080
1060
 
1081
1061
  If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your `launch.json` configuration.
@@ -1164,9 +1144,3 @@ The current version of Commander is fully supported on Long Term Support version
1164
1144
  Older major versions of Commander receive security updates for 12 months. For more see: [Release Policy](./docs/release-policy.md).
1165
1145
 
1166
1146
  The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.
1167
-
1168
- ### Commander for enterprise
1169
-
1170
- Available as part of the Tidelift Subscription
1171
-
1172
- The maintainers of Commander and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
@@ -18,4 +18,4 @@ export const createArgument = (name, description) =>
18
18
 
19
19
  export { Command, Option, Argument, Help };
20
20
  export { CommanderError, InvalidArgumentError };
21
- export { InvalidArgumentError as InvalidOptionArgumentError }; // Deprecated
21
+ export { InvalidArgumentError as InvalidOptionArgumentError };
@@ -975,7 +975,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
975
975
  // global overwrites local, like optsWithGlobals
976
976
  let source;
977
977
  this._getCommandAndAncestors().forEach((cmd) => {
978
- if (cmd.getOptionValueSource(key) !== undefined) {
978
+ if (Object.hasOwn(cmd._optionValueSources, key)) {
979
979
  source = cmd.getOptionValueSource(key);
980
980
  }
981
981
  });
@@ -1768,7 +1768,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1768
1768
 
1769
1769
  const negativeNumberArg = (arg) => {
1770
1770
  // return false if not a negative number
1771
- if (!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg)) return false;
1771
+ if (!/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(arg)) return false;
1772
1772
  // negative number is ok unless digit used as an option in command hierarchy
1773
1773
  return !this._getCommandAndAncestors().some((cmd) =>
1774
1774
  cmd.options
@@ -2366,7 +2366,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2366
2366
  * (This does not override a group set directly on the subcommand using .helpGroup().)
2367
2367
  *
2368
2368
  * @example
2369
- * program.commandsGroup('Development Commands:);
2369
+ * program.commandsGroup('Development Commands:');
2370
2370
  * program.command('watch')...
2371
2371
  * program.command('lint')...
2372
2372
  * ...
@@ -2562,7 +2562,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2562
2562
  * Pass in false to disable the built-in help option.
2563
2563
  *
2564
2564
  * @example
2565
- * program.helpOption('-?, --help' 'show help'); // customise
2565
+ * program.helpOption('-?, --help', 'show help'); // customise
2566
2566
  * program.helpOption(false); // disable
2567
2567
  *
2568
2568
  * @param {(string | boolean)} flags
@@ -2720,7 +2720,12 @@ function incrementNodeInspectorPort(args) {
2720
2720
  // Testing for these options:
2721
2721
  // --inspect[=[host:]port]
2722
2722
  // --inspect-brk[=[host:]port]
2723
+ // --inspect-wait[=[host:]port]
2723
2724
  // --inspect-port=[host:]port
2725
+ //
2726
+ // Host can be an IP literal encapsulated within square brackets (e.g. [::1]),
2727
+ // an IPv4 address in dotted-decimal form (e.g. 192.168.0.1), or a registered name.
2728
+ // https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.2
2724
2729
  return args.map((arg) => {
2725
2730
  if (!arg.startsWith('--inspect')) {
2726
2731
  return arg;
@@ -2729,24 +2734,32 @@ function incrementNodeInspectorPort(args) {
2729
2734
  let debugHost = '127.0.0.1';
2730
2735
  let debugPort = '9229';
2731
2736
  let match;
2732
- if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
2737
+ if ((match = arg.match(/^(--inspect(-brk|-wait)?)$/)) !== null) {
2733
2738
  // e.g. --inspect
2734
2739
  debugOption = match[1];
2735
2740
  } else if (
2736
- (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null
2741
+ (match = arg.match(
2742
+ /^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/,
2743
+ )) !== null
2737
2744
  ) {
2745
+ // Matches a host or a port, but not both. No colon to separate them.
2738
2746
  debugOption = match[1];
2739
2747
  if (/^\d+$/.test(match[3])) {
2748
+ // Plain digits so a port number.
2740
2749
  // e.g. --inspect=1234
2741
2750
  debugPort = match[3];
2742
2751
  } else {
2743
- // e.g. --inspect=localhost
2752
+ // Assume a host.
2753
+ // e.g. --inspect=localhost, --inspect=[::1], --inspect=192.168.0.1
2744
2754
  debugHost = match[3];
2745
2755
  }
2746
2756
  } else if (
2747
- (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null
2757
+ (match = arg.match(
2758
+ /^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/,
2759
+ )) !== null
2748
2760
  ) {
2749
- // e.g. --inspect=localhost:1234
2761
+ // Matched host:port pattern.
2762
+ // e.g. --inspect=localhost:1234, --inspect=[::1]:1234, --inspect=192.168.0.1:1234
2750
2763
  debugOption = match[1];
2751
2764
  debugHost = match[3];
2752
2765
  debugPort = match[4];
@@ -89,11 +89,15 @@ export class Help {
89
89
  visibleOptions.push(helpOption); // no changes needed
90
90
  } else if (helpOption.long && !removeLong) {
91
91
  visibleOptions.push(
92
- cmd.createOption(helpOption.long, helpOption.description),
92
+ cmd
93
+ .createOption(helpOption.long, helpOption.description)
94
+ .helpGroup(helpOption.helpGroupHeading),
93
95
  );
94
96
  } else if (helpOption.short && !removeShort) {
95
97
  visibleOptions.push(
96
- cmd.createOption(helpOption.short, helpOption.description),
98
+ cmd
99
+ .createOption(helpOption.short, helpOption.description)
100
+ .helpGroup(helpOption.helpGroupHeading),
97
101
  );
98
102
  }
99
103
  }
@@ -15,7 +15,7 @@ export class Option {
15
15
  this.required = flags.includes('<'); // A value must be supplied when the option is specified.
16
16
  this.optional = flags.includes('['); // A value is optional when the option is specified.
17
17
  // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument
18
- this.variadic = /\w\.\.\.[>\]]$/.test(flags); // The option can take multiple values.
18
+ this.variadic = /\p{ID_Continue}\.\.\.[>\]]$/u.test(flags); // The option can take multiple values.
19
19
  this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.
20
20
  const optionFlags = splitOptionFlags(flags);
21
21
  this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commander",
3
- "version": "15.0.0",
3
+ "version": "15.1.0",
4
4
  "description": "the complete solution for node.js command-line programs",
5
5
  "keywords": [
6
6
  "commander",
@@ -50,6 +50,7 @@
50
50
  "@types/node": "^22.7.4",
51
51
  "eslint": "^10.0.2",
52
52
  "eslint-config-prettier": "^10.0.1",
53
+ "eslint-node-test": "^1.0.0",
53
54
  "globals": "^17.3.0",
54
55
  "prettier": "^3.2.5",
55
56
  "tsd": "^0.33.0",
@@ -10,8 +10,7 @@
10
10
  // - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
11
11
  // - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
12
12
  type LiteralUnion<LiteralType, BaseType extends string | number> =
13
- | LiteralType
14
- | (BaseType & Record<never, never>);
13
+ LiteralType | (BaseType & Record<never, never>);
15
14
 
16
15
  export class CommanderError extends Error {
17
16
  code: string;
@@ -35,7 +34,7 @@ export class InvalidArgumentError extends CommanderError {
35
34
  */
36
35
  constructor(message: string);
37
36
  }
38
- export { InvalidArgumentError as InvalidOptionArgumentError }; // deprecated old name
37
+ export { InvalidArgumentError as InvalidOptionArgumentError };
39
38
 
40
39
  export interface ErrorOptions {
41
40
  // optional parameter for error()
@@ -711,10 +710,13 @@ export class Command {
711
710
  *
712
711
  * @returns `this` command for chaining
713
712
  */
713
+ /** @deprecated since v15 */
714
714
  storeOptionsAsProperties<T extends OptionValues>(): this & T;
715
+ /** @deprecated since v15 */
715
716
  storeOptionsAsProperties<T extends OptionValues>(
716
717
  storeAsProperties: true,
717
718
  ): this & T;
719
+ /** @deprecated since v15 */
718
720
  storeOptionsAsProperties(storeAsProperties?: boolean): this;
719
721
 
720
722
  /**
@@ -758,6 +760,7 @@ export class Command {
758
760
  *
759
761
  * @returns `this` command for chaining
760
762
  */
763
+ /** @deprecated since v15 */
761
764
  combineFlagAndOptionalValue(combine?: boolean): this;
762
765
 
763
766
  /**
@@ -119,7 +119,7 @@ class Range {
119
119
  debug('hyphen replace', range)
120
120
 
121
121
  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
122
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
122
+ range = trimComparatorWhitespace(range)
123
123
  debug('comparator trim', range)
124
124
 
125
125
  // `~ 1.2.3` => `~1.2.3`
@@ -224,11 +224,11 @@ const parseOptions = require('../internal/parse-options')
224
224
  const Comparator = require('./comparator')
225
225
  const debug = require('../internal/debug')
226
226
  const SemVer = require('./semver')
227
+ const trimComparatorWhitespace = require('../internal/trim-comparator-whitespace')
227
228
  const {
228
229
  safeRe: re,
229
230
  src,
230
231
  t,
231
- comparatorTrimReplace,
232
232
  tildeTrimReplace,
233
233
  caretTrimReplace,
234
234
  } = require('../internal/re')
@@ -15,6 +15,35 @@ const MAX_SAFE_COMPONENT_LENGTH = 16
15
15
  // the shortest version with a build 0.0.0+BUILD.
16
16
  const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
17
17
 
18
+ // ECMAScript whitespace and line terminators matched by \s.
19
+ const WHITESPACE_CHARACTERS = [
20
+ '\t',
21
+ '\n',
22
+ '\v',
23
+ '\f',
24
+ '\r',
25
+ ' ',
26
+ '\u00a0',
27
+ '\u1680',
28
+ '\u2000',
29
+ '\u2001',
30
+ '\u2002',
31
+ '\u2003',
32
+ '\u2004',
33
+ '\u2005',
34
+ '\u2006',
35
+ '\u2007',
36
+ '\u2008',
37
+ '\u2009',
38
+ '\u200a',
39
+ '\u2028',
40
+ '\u2029',
41
+ '\u202f',
42
+ '\u205f',
43
+ '\u3000',
44
+ '\ufeff',
45
+ ]
46
+
18
47
  const RELEASE_TYPES = [
19
48
  'major',
20
49
  'premajor',
@@ -30,6 +59,7 @@ module.exports = {
30
59
  MAX_SAFE_COMPONENT_LENGTH,
31
60
  MAX_SAFE_BUILD_LENGTH,
32
61
  MAX_SAFE_INTEGER,
62
+ WHITESPACE_CHARACTERS,
33
63
  RELEASE_TYPES,
34
64
  SEMVER_SPEC_VERSION,
35
65
  FLAG_INCLUDE_PRERELEASE: 0b001,