@unbrained/pm-cli 2026.8.18 → 2026.8.19

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 (139) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +16 -2
  3. package/dist/cli/error-guidance.js +3 -2
  4. package/dist/cli/help-content.js +32 -13
  5. package/dist/cli/help-json-payload.d.ts +15 -0
  6. package/dist/cli/help-json-payload.js +101 -23
  7. package/dist/cli/main.js +6 -2
  8. package/dist/cli/register-list-query.js +8 -5
  9. package/dist/cli/register-mutation.js +8 -8
  10. package/dist/cli/register-operations.js +6 -6
  11. package/dist/cli-bundle/bundle-manifest.json +139 -139
  12. package/dist/cli-bundle/chunks/chunk-4NRRH7AM.js +2 -0
  13. package/dist/cli-bundle/chunks/{chunk-UYCLQVL2.js → chunk-4THEB6PD.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-BSK2IN3C.js → chunk-BHYMXLAE.js} +2 -2
  15. package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +197 -0
  16. package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +35 -0
  17. package/dist/cli-bundle/chunks/chunk-OI4XI562.js +5 -0
  18. package/dist/cli-bundle/chunks/{chunk-YRGOLZA7.js → chunk-OIOKV6NO.js} +3 -3
  19. package/dist/cli-bundle/chunks/{chunk-5UZZAJKR.js → chunk-QXSH7BLM.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-RZQTVMRQ.js → chunk-TOXJM4WA.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-GNFAFIJI.js → chunk-YBMRWW4E.js} +44 -44
  22. package/dist/cli-bundle/chunks/{register-list-query-I23LALEE.js → register-list-query-Y56KINDU.js} +11 -11
  23. package/dist/cli-bundle/chunks/register-mutation-AUWVCW4M.js +20 -0
  24. package/dist/cli-bundle/chunks/register-operations-PZQPHXW5.js +2 -0
  25. package/dist/cli-bundle/chunks/{register-setup-PPPEF3SN.js → register-setup-I4LUHGVW.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-5AF3ZBNB.js → chunk-34QBIYZI.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/{chunk-V5XTGLK7.js → chunk-BJRYFVSH.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-DKPLYW3L.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-ODOVCP45.js → chunk-EF6ZS5GH.js} +44 -44
  30. package/dist/cli-bundle/focused-chunks/{chunk-EX6MKP2X.js → chunk-ESISGDAY.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-EUEGXZ2A.js → chunk-EXBCLIBU.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-UI6AJ5TD.js → chunk-JDOMQ7VQ.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-MCZXYZAF.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-ODHQEECS.js +2 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-3TKWMNKF.js → chunk-PRHY2IMX.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-M62NO7EI.js → chunk-US7VEYZG.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-TN4AE665.js → chunk-VXDSU5MC.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +16 -0
  41. package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-K43KKAFS.js → chunk-ZBIQQYMI.js} +2 -2
  43. package/dist/cli-bundle/main.js +13 -13
  44. package/dist/cli-bundle/sdk-authoring.js +1 -1
  45. package/dist/cli-bundle/sdk-contracts.js +2 -1
  46. package/dist/cli-bundle/sdk-core.js +31 -31
  47. package/dist/cli-bundle/sdk-governance.js +1 -1
  48. package/dist/cli-bundle/sdk-graph.js +1 -1
  49. package/dist/cli-bundle/sdk-merge.js +32 -32
  50. package/dist/cli-bundle/sdk-query.js +1 -1
  51. package/dist/cli-bundle/sdk-runtime.js +1 -1
  52. package/dist/cli-bundle/sdk-testing.js +1 -1
  53. package/dist/cli-bundle/sdk.js +5 -4
  54. package/dist/core/shared/errors.d.ts +2 -0
  55. package/dist/core/shared/errors.js +2 -2
  56. package/dist/sdk/agent/refusal-closure.d.ts +41 -0
  57. package/dist/sdk/agent/refusal-closure.js +92 -0
  58. package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
  59. package/dist/sdk/agent-capability-contracts.d.ts +13 -0
  60. package/dist/sdk/agent-capability-contracts.js +104 -7
  61. package/dist/sdk/cli-contracts/command-aliases.js +18 -2
  62. package/dist/sdk/cli-contracts/commander-mutation-options.js +30 -6
  63. package/dist/sdk/cli-contracts/commander-types.js +5 -4
  64. package/dist/sdk/cli-contracts/flag-contracts.d.ts +5 -0
  65. package/dist/sdk/cli-contracts/flag-contracts.js +75 -8
  66. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +55 -0
  67. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +240 -0
  68. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +81 -0
  69. package/dist/sdk/cli-contracts/grammar-contracts.js +615 -2
  70. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +15 -4
  71. package/dist/sdk/cli-contracts/runtime-contracts.js +42 -12
  72. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +28 -1
  73. package/dist/sdk/cli-contracts/tool-option-contracts.js +38 -3
  74. package/dist/sdk/cli-contracts.d.ts +3 -2
  75. package/dist/sdk/cli-contracts.js +5 -4
  76. package/dist/sdk/context-intent-contracts.d.ts +2 -2
  77. package/dist/sdk/context-intent-contracts.js +22 -7
  78. package/dist/sdk/contracts.d.ts +2 -0
  79. package/dist/sdk/contracts.js +4 -2
  80. package/dist/sdk/flag-invocation-contracts.d.ts +37 -0
  81. package/dist/sdk/flag-invocation-contracts.js +218 -9
  82. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +134 -2
  83. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +154 -22
  84. package/dist/sdk/index.d.ts +7 -5
  85. package/dist/sdk/index.js +7 -5
  86. package/dist/sdk/output-projection.d.ts +2 -0
  87. package/dist/sdk/output-projection.js +11 -5
  88. package/dist/sdk/query/get.js +25 -6
  89. package/dist/sdk/query/list.js +16 -2
  90. package/dist/sdk/query/search-contracts.d.ts +1 -1
  91. package/dist/sdk/query/search-contracts.js +23 -9
  92. package/dist/sdk/query/search.js +3 -3
  93. package/dist/sdk/read-output/continuation.d.ts +1 -1
  94. package/dist/sdk/read-output/continuation.js +7 -24
  95. package/dist/sdk/read-output-contracts.js +55 -6
  96. package/dist/sdk/read-output-rows.d.ts +4 -0
  97. package/dist/sdk/read-output-rows.js +47 -18
  98. package/dist/sdk/runtime.js +9 -5
  99. package/dist/sdk/workspace-snapshot.d.ts +2 -0
  100. package/dist/sdk/workspace-snapshot.js +10 -2
  101. package/docs/COMMANDS.md +16 -4
  102. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +11 -2
  103. package/docs/READ_OUTPUT_CONTRACTS.md +10 -6
  104. package/docs/SDK.md +6 -0
  105. package/docs/TESTING.md +14 -1
  106. package/docs/generated/AGENT_COMMAND_SURFACE.md +78 -78
  107. package/docs/generated/FLAG_LEXICON_BUDGETS.md +76 -0
  108. package/marketplace.json +2 -2
  109. package/package.json +5 -3
  110. package/packages/pm-beads/package.json +1 -1
  111. package/packages/pm-calendar/package.json +1 -1
  112. package/packages/pm-command-kit/package.json +1 -1
  113. package/packages/pm-digital-twin/package.json +1 -1
  114. package/packages/pm-governance-audit/package.json +1 -1
  115. package/packages/pm-guide-shell/package.json +1 -1
  116. package/packages/pm-kanban/package.json +1 -1
  117. package/packages/pm-lifecycle-hooks/package.json +1 -1
  118. package/packages/pm-linked-test-adapters/package.json +1 -1
  119. package/packages/pm-search-advanced/package.json +1 -1
  120. package/packages/pm-templates/package.json +1 -1
  121. package/packages/pm-todos/package.json +1 -1
  122. package/packages/pm-vcs/package.json +1 -1
  123. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  124. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  125. package/scripts/generate-agent-capability-surfaces.mjs +20 -14
  126. package/sdk/public-surface.json +576 -12
  127. package/dist/cli-bundle/chunks/chunk-ALDJGKAK.js +0 -2
  128. package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +0 -197
  129. package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +0 -35
  130. package/dist/cli-bundle/chunks/chunk-PVRUN5ZS.js +0 -5
  131. package/dist/cli-bundle/chunks/register-mutation-6YGU3GPH.js +0 -20
  132. package/dist/cli-bundle/chunks/register-operations-4HTFC6J7.js +0 -2
  133. package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +0 -2
  134. package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +0 -2
  135. package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +0 -16
  136. package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +0 -2
  137. package/dist/cli-bundle/focused-chunks/chunk-WGHQVU6P.js +0 -2
  138. package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +0 -2
  139. package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +0 -2
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
9
- "version": "2026.8.18"
9
+ "version": "2026.8.19"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "pm-claude",
14
14
  "source": "./plugins/pm-claude",
15
15
  "description": "Native pm CLI integration for Claude Code — 28 MCP tools, 5 workflow skills, 14 slash commands, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
16
- "version": "2026.8.18",
16
+ "version": "2026.8.19",
17
17
  "author": {
18
18
  "name": "unbrained",
19
19
  "url": "https://github.com/unbraind/pm-cli"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026.8.19 - 2026-08-19
4
+
5
+ ### Fixed
6
+
7
+ - The writer-lease renewal test decides from wall-clock progress instead of the lease record, so correct behaviour is reported as a failure whenever the restore finishes first ([pm-15qgul](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-15qgul.toon))
8
+ - Core command flag_invocations misclassify valueless booleans as required string values ([pm-pcy92t](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-pcy92t.toon))
9
+ - A budget-truncated read is resumable on one surface and terminal on five, and the only recovery the envelope names is to abandon the budget that truncated it ([pm-8nev0o](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-8nev0o.toon))
10
+ - Both token gates are structurally unable to fail: one measures only help payloads, the other measures command output against a three-item fixture, so no check anywhere compares real output to the ceiling the contract declares ([pm-9sui7t](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-9sui7t.toon))
11
+ - Plan positional-action help is undiscoverable: pm plan create --help is rejected as an unknown command ([pm-2tan](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-2tan.toon))
12
+ - MCP update keys and CLI update flags diverge in name (linkedFile/linkedTest vs --file/--test), so an agent that reads the MCP contract and writes a CLI command produces a guaranteed unknown-option refusal ([pm-y0htkd](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-y0htkd.toon))
13
+ - Context calibration recovery names a nonexistent package script ([pm-xa3t0o](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-xa3t0o.toon))
14
+
15
+ ### Other
16
+
17
+ - Every executable command and positional action publishes a typed, validated argument contract ([pm-ya7x55](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-ya7x55.toon))
18
+
3
19
  ## 2026.8.18 - 2026-08-18
4
20
 
5
21
  ### Added
@@ -88,7 +104,6 @@
88
104
  - Make every failing health verdict self-indexing and attach gate severity to findings ([pm-larv4r](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-larv4r.toon))
89
105
  - GH-1004: history-repair remains writer-version-specific across 2026.8.7 and 2026.8.13 ([pm-igdvfq](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-igdvfq.toon))
90
106
  - Assurance gates preserve zero-valued counts and report actionable source failures ([pm-xmmafu](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-xmmafu.toon))
91
- - A budget-truncated read is resumable on one surface and terminal on five, and the only recovery the envelope names is to abandon the budget that truncated it ([pm-8nev0o](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-8nev0o.toon))
92
107
  - Ranking explanation is sized by the workspace rather than by the answer: explaining two returned rows emits one entry per active item and ignores the token budget entirely ([pm-okgxwa](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-okgxwa.toon))
93
108
  - The unknown-option refusal asserts the option belongs on another command path without checking, so a spelling that exists nowhere sends the reader on an unbounded search ([pm-in23qu](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-in23qu.toon))
94
109
  - The gate verdict withholds its evidence as a declaration-order prefix, so the assertion that produced a blocking verdict can be the row the default read drops ([pm-e5gl05](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-e5gl05.toon))
@@ -551,7 +566,6 @@
551
566
  - GH-790/GH-791: pm merge install reports workspace_root in a different canonical form depending on which channel resolved it, so the same repository has two non-equal spellings on macOS and Windows ([pm-ihmfs6](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-ihmfs6.toon))
552
567
  - The dependency token budget is enforced against a different representation than the one emitted, so a command that reports staying inside 16k tokens delivers about 45k ([pm-t2t709](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-t2t709.toon))
553
568
  - pm activity has no default bound: a bare invocation returns all 40,446 history entries at 1.59M tokens, 397x the ceiling its own contract declares ([pm-z2j1qt](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-z2j1qt.toon))
554
- - Both token gates are structurally unable to fail: one measures only help payloads, the other measures command output against a three-item fixture, so no check anywhere compares real output to the ceiling the contract declares ([pm-9sui7t](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-9sui7t.toon))
555
569
  - Sentry PM-CLI-2N: malformed missing tags crash normalizeItemMetadata before search can report the item ([pm-89neyq](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-89neyq.toon))
556
570
  - pm-governance-audit comments-audit limit contract contradicts runtime alias semantics ([pm-v657](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-v657.toon))
557
571
  - pm-governance-audit dedupe-audit rejects --status all, breaking explicit all-lifecycle duplicate sweeps ([pm-mp49](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-mp49.toon))
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="763daf66-1309-50bc-8783-8c232e4d690d")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="367d9302-9e1e-5813-a913-e4e87f34d8b9")}catch(e){}}();
3
3
  import { resolveRecoveryCommandName } from "../sdk/agent/command-recovery.js";
4
4
  import { renderPmCommand } from "./argv-utils.js";
5
5
  import { discoverNearbyPmRoot } from "../sdk/tracker-root-discovery.js";
@@ -177,6 +177,7 @@ function normalizeRecoveryPayload(payload) {
177
177
  normalized.option_scope = payload.option_scope;
178
178
  }
179
179
  assignRecoveryString(normalized, "suggested_retry", payload.suggested_retry);
180
+ assignRecoveryCollection(normalized, "suggested_retry_args", payload.suggested_retry_args);
180
181
  if (typeof payload.retry_after_ms === "number" &&
181
182
  Number.isSafeInteger(payload.retry_after_ms) &&
182
183
  payload.retry_after_ms >= 0) {
@@ -1240,4 +1241,4 @@ export const _testOnly = {
1240
1241
  resolveKnownPackageCommandHint,
1241
1242
  };
1242
1243
  //# sourceMappingURL=error-guidance.js.map
1243
- //# debugId=763daf66-1309-50bc-8783-8c232e4d690d
1244
+ //# debugId=367d9302-9e1e-5813-a913-e4e87f34d8b9
@@ -1,9 +1,11 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9cf83881-9464-5c18-b196-ee669057a873")}catch(e){}}();
3
+ import { parseBootstrapHelpRequest } from "./bootstrap-args.js";
4
+ import { formatPmPositionalActionFlagTip, PM_POSITIONAL_ACTION_CONTRACTS, resolvePmPositionalActionContract, } from "../sdk/cli-contracts/grammar-contracts.js";
1
5
  // Compact help/narrative surfaces show at most the first example. Centralizing this
2
6
  // keeps the empty-examples guard in one place for renderCompactHelpBundle and
3
7
  // resolveHelpNarrative (both must degrade to an empty list rather than [undefined]).
4
8
  /** Implements first example or empty for the public runtime surface of this module. */
5
-
6
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a97a61f2-df10-5c2b-8497-f8de17a6222d")}catch(e){}}();
7
9
  export function firstExampleOrEmpty(examples) {
8
10
  return examples.length > 0 ? [examples[0]] : [];
9
11
  }
@@ -596,9 +598,7 @@ const HELP_BY_COMMAND_PATH = {
596
598
  },
597
599
  delete: {
598
600
  why: "Removes an item while preserving history evidence and lock/ownership checks.",
599
- examples: [
600
- 'pm delete pm-a1b2 --message "Remove duplicate item"',
601
- ],
601
+ examples: ['pm delete pm-a1b2 --message "Remove duplicate item"'],
602
602
  },
603
603
  append: {
604
604
  why: "Adds implementation notes to body without replacing existing content.",
@@ -641,7 +641,7 @@ const HELP_BY_COMMAND_PATH = {
641
641
  examples: [
642
642
  'pm learnings pm-a1b2 --add "Avoid direct test-runner commands in linked tests; use sandbox runner."',
643
643
  'pm learnings pm-a1b2 --add "text: lesson with commas, key-like words, and punctuation-safe context"',
644
- 'pm learnings pm-a1b2 --edit 1 --file docs/corrected-learning.md',
644
+ "pm learnings pm-a1b2 --edit 1 --file docs/corrected-learning.md",
645
645
  "pm learnings pm-a1b2 --delete 2",
646
646
  "pm learnings pm-a1b2 --limit 10",
647
647
  ],
@@ -753,15 +753,11 @@ const HELP_BY_COMMAND_PATH = {
753
753
  },
754
754
  release: {
755
755
  why: "Releases an active claim when paused, handed off, or completed.",
756
- examples: [
757
- 'pm release pm-a1b2 --message "Release after closure"',
758
- ],
756
+ examples: ['pm release pm-a1b2 --message "Release after closure"'],
759
757
  },
760
758
  "start-task": {
761
759
  why: "Lifecycle alias that claims an item and sets status to in_progress.",
762
- examples: [
763
- 'pm start-task pm-a1b2 --message "Start implementation"',
764
- ],
760
+ examples: ['pm start-task pm-a1b2 --message "Start implementation"'],
765
761
  },
766
762
  "pause-task": {
767
763
  why: "Lifecycle alias that sets status to open and releases active assignment.",
@@ -884,6 +880,29 @@ export function attachRichHelpText(program, argv = process.argv.slice(2)) {
884
880
  for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {
885
881
  attachBundleByPath(program, commandPath, bundle, detailMode);
886
882
  }
883
+ const requestedPath = normalizeHelpCommandPath(parseBootstrapHelpRequest(argv).commandPathTokens.join(" "));
884
+ const positionalAction = resolvePmPositionalActionContract(requestedPath);
885
+ if (positionalAction) {
886
+ attachBundleByPath(program, positionalAction.parent, {
887
+ why: positionalAction.description,
888
+ examples: [positionalAction.example],
889
+ tips: [
890
+ `Action path: pm ${positionalAction.command}`,
891
+ formatPmPositionalActionFlagTip(positionalAction.accepted_flags),
892
+ ],
893
+ }, detailMode);
894
+ return;
895
+ }
896
+ const positionalActions = PM_POSITIONAL_ACTION_CONTRACTS.filter(({ parent }) => parent === requestedPath);
897
+ if (positionalActions.length > 0) {
898
+ attachBundleByPath(program, requestedPath, {
899
+ why: `Dispatches one declared positional action: ${positionalActions.map(({ action }) => action).join("|")}.`,
900
+ examples: positionalActions.map(({ example }) => example),
901
+ tips: [
902
+ `Inspect one action directly with pm ${requestedPath} <action> --help --json.`,
903
+ ],
904
+ }, detailMode);
905
+ }
887
906
  }
888
907
  /** Public contract for test only, shared by SDK and presentation-layer consumers. */
889
908
  export const _testOnly = {
@@ -891,4 +910,4 @@ export const _testOnly = {
891
910
  renderDetailedHelpBundle,
892
911
  };
893
912
  //# sourceMappingURL=help-content.js.map
894
- //# debugId=a97a61f2-df10-5c2b-8497-f8de17a6222d
913
+ //# debugId=9cf83881-9464-5c18-b196-ee669057a873
@@ -6,6 +6,8 @@
6
6
  import { Command } from "commander";
7
7
  import { resolveItemTypeRegistry } from "../sdk/runtime-primitives.js";
8
8
  import { type HelpOptionSummary, type ExtensionCommandHelpDescriptor } from "./extension-command-help.js";
9
+ import { type PmPositionalActionContract } from "../sdk/cli-contracts/grammar-contracts.js";
10
+ import { type PmCommandCapabilityFamily, type PmCommandVisibilityTier } from "../sdk/agent-capability-contracts.js";
9
11
  /** Documents the help argument summary payload exchanged by command, SDK, and package integrations. */
10
12
  export interface HelpArgumentSummary {
11
13
  /** Value that configures or reports name for this contract. */
@@ -25,6 +27,10 @@ export interface HelpSubcommandSummary {
25
27
  aliases: string[];
26
28
  /** Value that configures or reports description for this contract. */
27
29
  description: string;
30
+ /** Shared command visibility tier. */
31
+ tier: PmCommandVisibilityTier;
32
+ /** Shared command capability family. */
33
+ family: PmCommandCapabilityFamily;
28
34
  }
29
35
  declare function resolveCommandFromPathTokens(root: Command, pathTokens: string[]): Command | null;
30
36
  declare function readOptionAttributeName(option: unknown): string | null;
@@ -33,6 +39,14 @@ declare function buildHelpOptionSummaries(command: Command): HelpOptionSummary[]
33
39
  declare function compactHelpOptionAliases(options: HelpOptionSummary[]): HelpOptionSummary[];
34
40
  declare function buildHelpArgumentSummaries(command: Command): HelpArgumentSummary[];
35
41
  declare function buildHelpSubcommandSummaries(command: Command): HelpSubcommandSummary[];
42
+ interface PositionalActionHelpProjection {
43
+ arguments: HelpArgumentSummary[];
44
+ options: HelpOptionSummary[];
45
+ subcommands: HelpSubcommandSummary[];
46
+ usage: string;
47
+ }
48
+ /** Build the command/action structural view shared by every JSON help field. */
49
+ declare function buildPositionalActionHelpProjection(action: PmPositionalActionContract | undefined, targetCommand: Command, resolvedPath: string, allOptions: HelpOptionSummary[]): PositionalActionHelpProjection;
36
50
  declare function buildJsonHelpPayload(rootProgram: Command, targetCommand: Command, argv: string[], requestedPath: string[], extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): Record<string, unknown>;
37
51
  /** Implements maybe render bootstrap json help for the public runtime surface of this module. */
38
52
  export declare function maybeRenderBootstrapJsonHelp(rootProgram: Command, argv: string[], extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): Promise<boolean>;
@@ -44,6 +58,7 @@ export declare const _testOnly: {
44
58
  attachCreateUpdatePolicyHelpText: typeof attachCreateUpdatePolicyHelpText;
45
59
  buildCreateUpdatePolicyHelpText: typeof buildCreateUpdatePolicyHelpText;
46
60
  buildJsonHelpPayload: typeof buildJsonHelpPayload;
61
+ buildPositionalActionHelpProjection: typeof buildPositionalActionHelpProjection;
47
62
  buildHelpArgumentSummaries: typeof buildHelpArgumentSummaries;
48
63
  buildHelpOptionSummaries: typeof buildHelpOptionSummaries;
49
64
  buildHelpSubcommandSummaries: typeof buildHelpSubcommandSummaries;
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="42b9782e-2151-54b0-98ce-8c5ae810c424")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="abdb8d3e-8c1b-511e-b25b-220d5a40ae3f")}catch(e){}}();
3
3
  import { hasSubcommandFlagContractsForCommand, PM_CORE_COMMAND_NAMES, } from "../sdk/cli-contracts.js";
4
4
  import { commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveTypeDefinition, EXIT_CODE, printError, writeStdout, } from "../sdk/runtime-primitives.js";
5
5
  import { buildDynamicExtensionHelpOptionSummaries, mergeHelpOptionSummaries, findCommandByPath, findDirectChildCommand, commandAliases, } from "./extension-command-help.js";
@@ -10,6 +10,8 @@ import { extractProvidedOptionFlags, renderPmCommand } from "./argv-utils.js";
10
10
  import { formatCommanderErrorForJson } from "./error-guidance.js";
11
11
  import { BUILTIN_TYPE_HELP_VALUES, buildUnknownCommandGuidanceFromRuntime, } from "./commander-usage.js";
12
12
  import { resolveCreateExplicitEmptyFlag } from "../sdk/agent/create-option-policy.js";
13
+ import { formatPmPositionalActionFlagTip, PM_POSITIONAL_ACTION_CONTRACTS, resolvePmPositionalActionContract, } from "../sdk/cli-contracts/grammar-contracts.js";
14
+ import { resolvePmCommandCapabilityFamily, resolvePmCommandVisibilityTier, } from "../sdk/agent-capability-contracts.js";
13
15
  function resolveCommandFromPathTokens(root, pathTokens) {
14
16
  if (pathTokens.length === 0) {
15
17
  return root;
@@ -20,7 +22,8 @@ function resolveCommandFromPathTokens(root, pathTokens) {
20
22
  }
21
23
  const requestedPath = pathTokens.join(" ");
22
24
  if (!PM_CORE_COMMAND_NAMES.some((commandName) => commandName === requestedPath) &&
23
- !hasSubcommandFlagContractsForCommand(requestedPath)) {
25
+ !hasSubcommandFlagContractsForCommand(requestedPath) &&
26
+ !resolvePmPositionalActionContract(requestedPath)) {
24
27
  return null;
25
28
  }
26
29
  for (let length = pathTokens.length - 1; length > 0; length -= 1) {
@@ -170,19 +173,29 @@ function buildHelpArgumentSummaries(command) {
170
173
  : null;
171
174
  return {
172
175
  name: rawName.trim(),
173
- required: argument.required === true,
176
+ required: argument.required === true ||
177
+ description?.toLowerCase().startsWith("required;") === true,
174
178
  variadic: argument.variadic === true,
175
179
  description,
176
180
  };
177
181
  });
178
182
  }
179
183
  function buildHelpSubcommandSummaries(command) {
180
- return command.commands
181
- .map((entry) => ({
182
- name: entry.name().trim(),
183
- aliases: commandAliases(entry),
184
- description: entry.description().trim(),
185
- }))
184
+ return command
185
+ .createHelp()
186
+ .visibleCommands(command)
187
+ .filter((entry) => entry.name() !== "help" || command.parent === null)
188
+ .map((entry) => {
189
+ const rootCommand = normalizeHelpCommandPath(getCommandPath(entry))
190
+ .split(" ")[0];
191
+ return {
192
+ name: entry.name().trim(),
193
+ aliases: commandAliases(entry),
194
+ description: entry.description().trim(),
195
+ tier: resolvePmCommandVisibilityTier(rootCommand),
196
+ family: resolvePmCommandCapabilityFamily(rootCommand),
197
+ };
198
+ })
186
199
  .sort((left, right) => left.name.localeCompare(right.name));
187
200
  }
188
201
  function buildJsonHelpNarrative(detailMode, fallbackNarrative, extensionDescriptor) {
@@ -210,6 +223,57 @@ function buildJsonHelpNarrative(detailMode, fallbackNarrative, extensionDescript
210
223
  detail_mode: detailMode,
211
224
  };
212
225
  }
226
+ /** Build the command/action structural view shared by every JSON help field. */
227
+ function buildPositionalActionHelpProjection(action, targetCommand, resolvedPath, allOptions) {
228
+ if (!action) {
229
+ const argumentsList = buildHelpArgumentSummaries(targetCommand);
230
+ const registeredSubcommands = buildHelpSubcommandSummaries(targetCommand);
231
+ const registeredSubcommandNames = new Set(registeredSubcommands.map(({ name }) => name));
232
+ return {
233
+ arguments: argumentsList,
234
+ options: allOptions,
235
+ subcommands: [
236
+ ...registeredSubcommands,
237
+ ...PM_POSITIONAL_ACTION_CONTRACTS.filter(({ parent, action: name }) => parent === resolvedPath && !registeredSubcommandNames.has(name)).map(({ action: name, description }) => ({
238
+ name,
239
+ aliases: [],
240
+ description,
241
+ tier: resolvePmCommandVisibilityTier(resolvedPath.split(" ")[0]),
242
+ family: resolvePmCommandCapabilityFamily(resolvedPath.split(" ")[0]),
243
+ })),
244
+ ].sort((left, right) => left.name.localeCompare(right.name)),
245
+ usage: [
246
+ resolvedPath,
247
+ argumentsList.reduce((usage, argument) => argument.required
248
+ ? usage.replace(`[${argument.name}${argument.variadic ? "..." : ""}]`, `<${argument.name}${argument.variadic ? "..." : ""}>`)
249
+ : usage, targetCommand.usage()),
250
+ ]
251
+ .filter((token) => token.length > 0)
252
+ .join(" "),
253
+ };
254
+ }
255
+ const acceptedFlags = new Set(action.accepted_flags);
256
+ return {
257
+ arguments: action.slots.map(({ name, required, variadic, value_kind: valueKind, polymorphic }) => ({
258
+ name,
259
+ required,
260
+ variadic,
261
+ description: polymorphic
262
+ ? `Polymorphic ${valueKind} value; inspect the action contract before mutation.`
263
+ : `${valueKind.replaceAll("_", " ")} value.`,
264
+ })),
265
+ options: allOptions.filter(({ long, aliases }) => (long !== null && acceptedFlags.has(long)) ||
266
+ aliases.some((alias) => acceptedFlags.has(alias))),
267
+ subcommands: [],
268
+ usage: [
269
+ action.command,
270
+ ...action.slots.map(({ name, required, variadic }) => {
271
+ const token = variadic ? `${name}...` : name;
272
+ return required ? `<${token}>` : `[${token}]`;
273
+ }),
274
+ ].join(" "),
275
+ };
276
+ }
213
277
  function buildJsonHelpPayload(rootProgram, targetCommand, argv, requestedPath, extensionDescriptors) {
214
278
  const detailMode = resolveHelpDetailMode(argv);
215
279
  const commanderPath = normalizeHelpCommandPath(getCommandPath(targetCommand));
@@ -217,29 +281,42 @@ function buildJsonHelpPayload(rootProgram, targetCommand, argv, requestedPath, e
217
281
  const resolvedPath = requestedCommandPath.length > commanderPath.length
218
282
  ? requestedCommandPath
219
283
  : commanderPath;
220
- const commandPath = resolvedPath.length > 0 ? resolvedPath : undefined;
284
+ const positionalAction = resolvePmPositionalActionContract(resolvedPath);
285
+ const projectedPath = positionalAction?.command ?? resolvedPath;
286
+ const commandPath = projectedPath.length > 0 ? projectedPath : undefined;
287
+ const rootCommandPath = commandPath?.split(" ")[0];
221
288
  const fallbackNarrative = resolveHelpNarrative(commandPath, detailMode);
222
289
  const extensionDescriptor = commandPath
223
290
  ? extensionDescriptors.get(commandPath)
224
291
  : undefined;
225
292
  const narrative = buildJsonHelpNarrative(detailMode, fallbackNarrative, extensionDescriptor);
226
- const optionSummaries = compactHelpOptionAliases(mergeHelpOptionSummaries(buildHelpOptionSummaries(targetCommand), buildDynamicExtensionHelpOptionSummaries(extensionDescriptor)));
227
- const subcommands = buildHelpSubcommandSummaries(targetCommand);
293
+ const allOptionSummaries = compactHelpOptionAliases(mergeHelpOptionSummaries(buildHelpOptionSummaries(targetCommand), buildDynamicExtensionHelpOptionSummaries(extensionDescriptor)));
294
+ const projection = buildPositionalActionHelpProjection(positionalAction, targetCommand, projectedPath, allOptionSummaries);
228
295
  return {
229
296
  format: "pm_help_v1",
230
297
  detail_mode: detailMode,
231
298
  root_command: rootProgram.name(),
232
299
  requested_path: requestedPath,
233
- resolved_path: resolvedPath.length > 0 ? resolvedPath : rootProgram.name(),
234
- description: targetCommand.description(),
235
- usage: targetCommand.usage(),
236
- intent: narrative.intent,
237
- examples: narrative.examples,
238
- tips: narrative.tips,
239
- arguments: buildHelpArgumentSummaries(targetCommand),
240
- options: optionSummaries,
241
- subcommands,
242
- has_subcommands: subcommands.length > 0,
300
+ resolved_path: projectedPath.length > 0 ? projectedPath : rootProgram.name(),
301
+ visibility_tier: rootCommandPath === undefined
302
+ ? null
303
+ : resolvePmCommandVisibilityTier(rootCommandPath),
304
+ capability_family: rootCommandPath === undefined
305
+ ? null
306
+ : resolvePmCommandCapabilityFamily(rootCommandPath),
307
+ description: positionalAction?.description ?? targetCommand.description(),
308
+ usage: projection.usage,
309
+ intent: positionalAction?.description ?? narrative.intent,
310
+ examples: positionalAction
311
+ ? [positionalAction.example]
312
+ : narrative.examples,
313
+ tips: positionalAction
314
+ ? [formatPmPositionalActionFlagTip(positionalAction.accepted_flags)]
315
+ : narrative.tips,
316
+ arguments: projection.arguments,
317
+ options: projection.options,
318
+ subcommands: projection.subcommands,
319
+ has_subcommands: projection.subcommands.length > 0,
243
320
  };
244
321
  }
245
322
  /** Implements maybe render bootstrap json help for the public runtime surface of this module. */
@@ -402,6 +479,7 @@ export const _testOnly = {
402
479
  attachCreateUpdatePolicyHelpText,
403
480
  buildCreateUpdatePolicyHelpText,
404
481
  buildJsonHelpPayload,
482
+ buildPositionalActionHelpProjection,
405
483
  buildHelpArgumentSummaries,
406
484
  buildHelpOptionSummaries,
407
485
  buildHelpSubcommandSummaries,
@@ -411,4 +489,4 @@ export const _testOnly = {
411
489
  resolveCommandFromPathTokens,
412
490
  };
413
491
  //# sourceMappingURL=help-json-payload.js.map
414
- //# debugId=42b9782e-2151-54b0-98ce-8c5ae810c424
492
+ //# debugId=abdb8d3e-8c1b-511e-b25b-220d5a40ae3f
package/dist/cli/main.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * @module cli/main
4
4
  */
5
5
 
6
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cf9d1c78-06f0-5330-8562-ac863c95ee86")}catch(e){}}();
6
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="27eeca2d-756c-539b-a0d4-d64516ee4aa6")}catch(e){}}();
7
7
  import { Command } from "commander";
8
8
  import { activateExtensions, clearActiveExtensionHooks, createCoreCommandHookContext, resetActiveExtensionRuntimeState, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, consumeAfterCommandAffectedItems, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, pathExists, resolvePmCliVersion, resolvePmPackageRootFromModule, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, EXIT_CODE, resolveTelemetryErrorCategory, PmCliError, asRecordOrNull, printError, printResult, maybeRunFirstUseTelemetryPrompt, emitTelemetryErrorEvent, startTelemetryCommand, deriveTelemetryCommandResolution, sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, ensureSentryInit, getSettingsPath, resolvePmRoot, readSettings, readSettingsWithMetadata, runWithWorkspaceHarnessSignalDescriptors, createLazyModule, } from "../sdk/runtime-primitives.js";
9
9
  import { resolveSubcommandFlagContractsForCommand } from "../sdk/cli-contracts.js";
@@ -138,6 +138,7 @@ function projectExistingRecoveryOptionalFields(existingRecovery) {
138
138
  "recovery_mode",
139
139
  "missing_required_fields",
140
140
  "suggested_flags",
141
+ "suggested_retry_args",
141
142
  "allowed_values",
142
143
  "candidate_commands",
143
144
  "candidate_commands_total",
@@ -182,6 +183,9 @@ function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
182
183
  ...(rawExistingRecovery.suggested_retry
183
184
  ? { suggested_retry: renderAttemptedCommand(safeInvocationArgv) }
184
185
  : {}),
186
+ ...(rawExistingRecovery.suggested_retry_args
187
+ ? { suggested_retry_args: [...safeInvocationArgv] }
188
+ : {}),
185
189
  }
186
190
  : rawExistingRecovery;
187
191
  if (existingRecovery?.recovery_mode === "compact" && !explainRequested) {
@@ -2512,4 +2516,4 @@ export const _testOnly = {
2512
2516
  wrapThrownErrorForSentry,
2513
2517
  };
2514
2518
  //# sourceMappingURL=main.js.map
2515
- //# debugId=cf9d1c78-06f0-5330-8562-ac863c95ee86
2519
+ //# debugId=27eeca2d-756c-539b-a0d4-d64516ee4aa6
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7bcf441b-e211-535f-9502-5624add292e5")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d3206ea9-3bf7-5e23-8b95-2a9078942b6f")}catch(e){}}();
3
3
  import { EXIT_CODE, PmCliError, readSettings, renderRowsAsCsv, renderRowsAsTable, resolvePmRoot, } from "../sdk/runtime-primitives.js";
4
4
  import { renderPmCommandAliasMigrationHint, resolvePmCommandAlias, } from "../sdk/cli-contracts.js";
5
5
  import { EVAL_QUERY_SET_SCHEMA_ID } from "../sdk/eval.js";
@@ -334,9 +334,12 @@ async function runNextAction(options, actionCommand) {
334
334
  async function runSearchAction(keywords, options, command) {
335
335
  const globalOptions = getGlobalOptions(command);
336
336
  const startedAt = Date.now();
337
- const intentOptions = applyContextIntentProjection("search", options);
337
+ const query = normalizeSearchKeywordsInput(keywords);
338
+ const intentOptions = applyContextIntentProjection("search", options, [
339
+ query,
340
+ ]);
338
341
  const searchOptions = normalizeSearchOptions(intentOptions);
339
- const result = await runSearch(normalizeSearchKeywordsInput(keywords), {
342
+ const result = await runSearch(query, {
340
343
  ...searchOptions,
341
344
  mode: typeof searchOptions.mode === "string" &&
342
345
  searchOptions.mode.trim().length > 0
@@ -382,7 +385,7 @@ async function runEvalAction(options, command) {
382
385
  async function runGetAction(id, options, command) {
383
386
  const globalOptions = getGlobalOptions(command);
384
387
  const startedAt = Date.now();
385
- const intentOptions = applyContextIntentProjection("get", options);
388
+ const intentOptions = applyContextIntentProjection("get", options, [id]);
386
389
  const result = await runGet(id, globalOptions, {
387
390
  depth: typeof intentOptions.depth === "string" ? intentOptions.depth : undefined,
388
391
  fields: typeof intentOptions.fields === "string"
@@ -919,4 +922,4 @@ export const _testOnlyRegisterListQuery = {
919
922
  parseListFormat,
920
923
  };
921
924
  //# sourceMappingURL=register-list-query.js.map
922
- //# debugId=7bcf441b-e211-535f-9502-5624add292e5
925
+ //# debugId=d3206ea9-3bf7-5e23-8b95-2a9078942b6f
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7feb0fe0-386c-56dc-afe1-e7b4ce1bc95a")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="07f3212f-c6d3-534e-8273-fae43a8fca18")}catch(e){}}();
3
3
  import { resolveBodyFileContent, EXIT_CODE, splitCommaList, PmCliError, createUnknownSubcommandError, } from "../sdk/runtime-primitives.js";
4
4
  import { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, } from "../sdk/cli-contracts.js";
5
5
  import { BUILTIN_ITEM_TYPE_VALUES, PLAN_STEP_LINK_KIND_VALUES, } from "../types/index.js";
@@ -1233,7 +1233,7 @@ async function runDepsAction(id, options, command) {
1233
1233
  export function registerMutationCommands(program, registrationOptions = {}) {
1234
1234
  const createCommand = program
1235
1235
  .command("create")
1236
- .argument("[typeOrTitle]", 'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)')
1236
+ .argument("[type-or-title]", 'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)')
1237
1237
  .argument("[title]", "Item title when the first argument is an item type")
1238
1238
  .description("Create a new project management item.");
1239
1239
  registerCommanderOptionContracts(createCommand, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);
@@ -1530,10 +1530,10 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1530
1530
  const planCommand = program
1531
1531
  .command("plan")
1532
1532
  .description("Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.")
1533
- .argument("[subcommand]", "Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize")
1533
+ .argument("[subcommand]", "Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize")
1534
1534
  .argument("[id]", "Plan id (required for non-create subcommands); for create this may be the positional title")
1535
- .argument("[stepRef]", "Step reference: stable id (plan-step-001) or order integer")
1536
- .argument("[reorderTo]", "New order integer for reorder-step")
1535
+ .argument("[step]", "Step reference: stable id (plan-step-001) or order integer")
1536
+ .argument("[new-order]", "New order integer for reorder-step")
1537
1537
  .option("--title <value>", "Plan title")
1538
1538
  .option("--description <value>", "Plan description")
1539
1539
  .option("--scope <value>", "Short scope statement of the target change or investigation")
@@ -1740,7 +1740,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1740
1740
  .action(runMergeAction);
1741
1741
  const schemaCommand = program
1742
1742
  .command("schema")
1743
- .argument("[subcommand]", "Schema subcommand: list, show, show-status, add/remove type/status/field, rename-type, rename-field, remap-status, or a custom item type name shorthand")
1743
+ .argument("[subcommand]", "Required; Schema subcommand: list, show, show-status, add/remove type/status/field, rename-type, rename-field, remap-status, or a custom item type name shorthand")
1744
1744
  .argument("[name]", "Definition name, or source name for rename/remap migrations")
1745
1745
  .option("--description <text>", "Human description for the custom item type, status, or field")
1746
1746
  .option("--default-status <status>", "Default status hint recorded for the custom item type")
@@ -1770,7 +1770,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1770
1770
  schemaCommand.action(runSchemaAction);
1771
1771
  const profileCommand = program
1772
1772
  .command("profile")
1773
- .argument("[subcommand]", "Profile subcommand: list, show, apply, or lint")
1773
+ .argument("[subcommand]", "Required; Profile subcommand: list, show, apply, or lint")
1774
1774
  .argument("[name]", "Profile name for show/apply/lint: agile, ops, or research")
1775
1775
  .option("--dry-run", "Preview the apply diff without writing any files (apply)")
1776
1776
  .option("--author <value>", "Mutation author")
@@ -1840,4 +1840,4 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1840
1840
  .action(runDepsAction);
1841
1841
  }
1842
1842
  //# sourceMappingURL=register-mutation.js.map
1843
- //# debugId=7feb0fe0-386c-56dc-afe1-e7b4ce1bc95a
1843
+ //# debugId=07f3212f-c6d3-534e-8273-fae43a8fca18
@@ -1,9 +1,9 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="dec5fb7d-416f-5da6-bd97-c05c25dbf769")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="975321a1-0375-5829-a012-f23e32e9c6bf")}catch(e){}}();
3
3
  import { resolveRuntimeStatusRegistry, setActiveCommandResult, EXIT_CODE, PmCliError, createUnknownSubcommandError, resolveAuthor, resolvePmRoot, readSettings, } from "../sdk/runtime-primitives.js";
4
4
  import { resolveStartTaskInProgressStatus } from "../sdk/start-task-status.js";
5
5
  import { parseStatsAnalyticsJson } from "./stats-analytics-json.js";
6
- import { createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshotWithRecovery, } from "../sdk/workspace-snapshot.js";
6
+ import { createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshotWithRecovery, WORKSPACE_SNAPSHOT_ACTIONS, } from "../sdk/workspace-snapshot.js";
7
7
  import { runClaim, runClaimNext, runRelease } from "./commands/claim.js";
8
8
  import { runClose } from "./commands/close.js";
9
9
  import { runContracts } from "./commands/contracts.js";
@@ -380,11 +380,11 @@ async function runWorkspaceSnapshotAction(action, target, options, command) {
380
380
  const globalOptions = getGlobalOptions(command);
381
381
  const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);
382
382
  const normalizedAction = action.trim().toLowerCase();
383
- if (!["create", "list", "inspect", "restore", "delete"].includes(normalizedAction)) {
383
+ if (!WORKSPACE_SNAPSHOT_ACTIONS.some((entry) => entry === normalizedAction)) {
384
384
  throw createUnknownSubcommandError({
385
385
  command_path: "workspace snapshot",
386
386
  token: action,
387
- allowed: ["create", "list", "inspect", "restore", "delete"],
387
+ allowed: WORKSPACE_SNAPSHOT_ACTIONS,
388
388
  display_name: "workspace snapshot",
389
389
  token_kind: "action",
390
390
  examples: [
@@ -606,7 +606,7 @@ export function registerOperationCommands(program) {
606
606
  });
607
607
  program
608
608
  .command("telemetry")
609
- .argument("[namespaceOrSubcommand]", "Telemetry subcommand: status, flush, stats, clear (default: status)")
609
+ .argument("[namespace-or-subcommand]", "Telemetry subcommand: status, flush, stats, clear (default: status)")
610
610
  .argument("[subcommand]", "Compatibility alias target for local-analytics: status, flush, stats, clear")
611
611
  .option("--limit <n>", "Maximum command groups returned by telemetry stats")
612
612
  .description("Inspect and manage local telemetry queue/runtime state.")
@@ -873,4 +873,4 @@ function registerSchedulingShortcutCommands(program) {
873
873
  });
874
874
  }
875
875
  //# sourceMappingURL=register-operations.js.map
876
- //# debugId=dec5fb7d-416f-5da6-bd97-c05c25dbf769
876
+ //# debugId=975321a1-0375-5829-a012-f23e32e9c6bf