@unbrained/pm-cli 2026.8.17 → 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 (204) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +4 -3
  3. package/CHANGELOG.md +51 -5
  4. package/README.md +3 -3
  5. package/dist/cli/error-guidance.js +8 -4
  6. package/dist/cli/help-content.js +32 -13
  7. package/dist/cli/help-json-payload.d.ts +15 -0
  8. package/dist/cli/help-json-payload.js +101 -23
  9. package/dist/cli/main.js +6 -2
  10. package/dist/cli/register-list-query.js +138 -54
  11. package/dist/cli/register-mutation.js +8 -8
  12. package/dist/cli/register-operations.js +6 -6
  13. package/dist/cli-bundle/bundle-manifest.json +149 -149
  14. package/dist/cli-bundle/chunks/chunk-4NRRH7AM.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-4THEB6PD.js +13 -0
  16. package/dist/cli-bundle/chunks/{chunk-HBJAS566.js → chunk-BHYMXLAE.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +197 -0
  18. package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +35 -0
  19. package/dist/cli-bundle/chunks/chunk-OI4XI562.js +5 -0
  20. package/dist/cli-bundle/chunks/{chunk-3UEGXBMR.js → chunk-OIOKV6NO.js} +58 -54
  21. package/dist/cli-bundle/chunks/chunk-QXSH7BLM.js +3 -0
  22. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +3 -0
  23. package/dist/cli-bundle/chunks/{chunk-7IBRGCHX.js → chunk-TOXJM4WA.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-JOKATURE.js → chunk-YBMRWW4E.js} +44 -44
  25. package/dist/cli-bundle/chunks/register-list-query-Y56KINDU.js +11 -0
  26. package/dist/cli-bundle/chunks/register-mutation-AUWVCW4M.js +20 -0
  27. package/dist/cli-bundle/chunks/register-operations-PZQPHXW5.js +2 -0
  28. package/dist/cli-bundle/chunks/{register-setup-DOSFBGKE.js → register-setup-I4LUHGVW.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-34QBIYZI.js +155 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-MHPIL773.js → chunk-BJRYFVSH.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-DKPLYW3L.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-SALH6B6K.js → chunk-EF6ZS5GH.js} +44 -44
  33. package/dist/cli-bundle/focused-chunks/{chunk-XKAMP5OU.js → chunk-ESISGDAY.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-SYZENPIT.js → chunk-EXBCLIBU.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-JDOMQ7VQ.js +4 -0
  36. package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +2 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-MCZXYZAF.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/chunk-ODHQEECS.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-ZQPGZZWQ.js → chunk-PRHY2IMX.js} +3 -3
  40. package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +2 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-ATEY76SX.js → chunk-US7VEYZG.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-VXDSU5MC.js +26 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +16 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +2 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-CYFK5UPB.js → chunk-ZBIQQYMI.js} +2 -2
  46. package/dist/cli-bundle/main.js +13 -13
  47. package/dist/cli-bundle/sdk-authoring.js +1 -1
  48. package/dist/cli-bundle/sdk-contracts.js +2 -1
  49. package/dist/cli-bundle/sdk-core.js +28 -28
  50. package/dist/cli-bundle/sdk-governance.js +1 -1
  51. package/dist/cli-bundle/sdk-graph.js +1 -1
  52. package/dist/cli-bundle/sdk-merge.js +32 -32
  53. package/dist/cli-bundle/sdk-query.js +1 -1
  54. package/dist/cli-bundle/sdk-runtime.js +1 -1
  55. package/dist/cli-bundle/sdk-testing.js +1 -1
  56. package/dist/cli-bundle/sdk.js +5 -4
  57. package/dist/core/config/nested-settings.js +8 -2
  58. package/dist/core/extensions/exporter-output-contract.d.ts +12 -0
  59. package/dist/core/extensions/exporter-output-contract.js +67 -0
  60. package/dist/core/extensions/extension-types.d.ts +36 -1
  61. package/dist/core/extensions/extension-types.js +2 -2
  62. package/dist/core/extensions/loader.js +35 -44
  63. package/dist/core/history/event-index.d.ts +5 -0
  64. package/dist/core/history/event-index.js +133 -27
  65. package/dist/core/sentry/helpers.js +3 -3
  66. package/dist/core/shared/constants.js +5 -2
  67. package/dist/core/shared/errors.d.ts +2 -0
  68. package/dist/core/shared/errors.js +2 -2
  69. package/dist/core/store/settings-validator.d.ts +4 -0
  70. package/dist/core/store/settings-validator.js +3 -2
  71. package/dist/core/store/settings.js +8 -2
  72. package/dist/mcp/tool-definitions.js +12 -7
  73. package/dist/sdk/agent/refusal-closure.d.ts +41 -0
  74. package/dist/sdk/agent/refusal-closure.js +92 -0
  75. package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
  76. package/dist/sdk/agent/refusal-reachability.js +4 -4
  77. package/dist/sdk/agent-capability-contracts.d.ts +13 -0
  78. package/dist/sdk/agent-capability-contracts.js +104 -7
  79. package/dist/sdk/authoring.d.ts +1 -1
  80. package/dist/sdk/authoring.js +2 -2
  81. package/dist/sdk/cli-bootstrap.d.ts +2 -2
  82. package/dist/sdk/cli-bootstrap.js +4 -4
  83. package/dist/sdk/cli-contracts/command-aliases.d.ts +34 -2
  84. package/dist/sdk/cli-contracts/command-aliases.js +80 -13
  85. package/dist/sdk/cli-contracts/commander-mutation-options.js +30 -6
  86. package/dist/sdk/cli-contracts/commander-types.js +5 -4
  87. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  88. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  89. package/dist/sdk/cli-contracts/flag-contracts.d.ts +5 -0
  90. package/dist/sdk/cli-contracts/flag-contracts.js +84 -13
  91. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +55 -0
  92. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +240 -0
  93. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +151 -0
  94. package/dist/sdk/cli-contracts/grammar-contracts.js +958 -0
  95. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +33 -5
  96. package/dist/sdk/cli-contracts/runtime-contracts.js +100 -23
  97. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +28 -1
  98. package/dist/sdk/cli-contracts/tool-option-contracts.js +38 -3
  99. package/dist/sdk/cli-contracts/tool-parameter-tables.js +7 -2
  100. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  101. package/dist/sdk/cli-contracts/tool-schema.js +20 -11
  102. package/dist/sdk/cli-contracts.d.ts +5 -4
  103. package/dist/sdk/cli-contracts.js +7 -6
  104. package/dist/sdk/completion.js +13 -15
  105. package/dist/sdk/compose.d.ts +3 -3
  106. package/dist/sdk/compose.js +2 -2
  107. package/dist/sdk/context-intent-contracts.d.ts +2 -2
  108. package/dist/sdk/context-intent-contracts.js +22 -7
  109. package/dist/sdk/contracts.d.ts +3 -0
  110. package/dist/sdk/contracts.js +5 -2
  111. package/dist/sdk/core.d.ts +1 -1
  112. package/dist/sdk/core.js +3 -3
  113. package/dist/sdk/environment/host-environment-errors.js +3 -3
  114. package/dist/sdk/flag-invocation-contracts.d.ts +37 -0
  115. package/dist/sdk/flag-invocation-contracts.js +218 -9
  116. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +186 -14
  117. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +194 -26
  118. package/dist/sdk/guide-topics.js +5 -5
  119. package/dist/sdk/index.d.ts +10 -7
  120. package/dist/sdk/index.js +10 -7
  121. package/dist/sdk/init-agent-guidance.js +3 -3
  122. package/dist/sdk/mutation-events.d.ts +18 -2
  123. package/dist/sdk/mutation-events.js +59 -16
  124. package/dist/sdk/output-projection.d.ts +2 -0
  125. package/dist/sdk/output-projection.js +11 -5
  126. package/dist/sdk/output.d.ts +44 -0
  127. package/dist/sdk/output.js +28 -2
  128. package/dist/sdk/query/complete-list.d.ts +94 -0
  129. package/dist/sdk/query/complete-list.js +173 -0
  130. package/dist/sdk/query/get.js +25 -6
  131. package/dist/sdk/query/list.js +19 -2
  132. package/dist/sdk/query/search-contracts.d.ts +1 -1
  133. package/dist/sdk/query/search-contracts.js +23 -9
  134. package/dist/sdk/query/search.js +3 -3
  135. package/dist/sdk/query.d.ts +1 -0
  136. package/dist/sdk/query.js +3 -2
  137. package/dist/sdk/read-output/continuation.d.ts +1 -1
  138. package/dist/sdk/read-output/continuation.js +7 -24
  139. package/dist/sdk/read-output-contracts.d.ts +2 -2
  140. package/dist/sdk/read-output-contracts.js +89 -13
  141. package/dist/sdk/read-output-rows.d.ts +4 -0
  142. package/dist/sdk/read-output-rows.js +47 -18
  143. package/dist/sdk/runtime-extended-actions.js +10 -2
  144. package/dist/sdk/runtime.d.ts +8 -2
  145. package/dist/sdk/runtime.js +18 -11
  146. package/dist/sdk/workspace-snapshot.d.ts +2 -0
  147. package/dist/sdk/workspace-snapshot.js +10 -2
  148. package/dist/types.d.ts +5 -0
  149. package/dist/types.js +2 -2
  150. package/docs/AGENT_GUIDE.md +25 -9
  151. package/docs/CLI_GRAMMAR.md +106 -0
  152. package/docs/COMMANDS.md +39 -27
  153. package/docs/ONBOARDING.md +4 -4
  154. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +11 -2
  155. package/docs/QUICKSTART.md +1 -1
  156. package/docs/README.md +2 -0
  157. package/docs/READ_OUTPUT_CONTRACTS.md +10 -6
  158. package/docs/RELEASING.md +30 -6
  159. package/docs/SDK.md +42 -2
  160. package/docs/SDK_ARTIFACT_OUTPUT.md +72 -0
  161. package/docs/SDK_CONTEXT_COORDINATION.md +46 -12
  162. package/docs/TESTING.md +14 -1
  163. package/docs/agent-task-token-baseline.json +5 -5
  164. package/docs/generated/AGENT_COMMAND_SURFACE.md +78 -78
  165. package/docs/generated/FLAG_LEXICON_BUDGETS.md +76 -0
  166. package/marketplace.json +2 -2
  167. package/package.json +5 -2
  168. package/packages/pm-beads/package.json +1 -1
  169. package/packages/pm-calendar/package.json +1 -1
  170. package/packages/pm-command-kit/package.json +1 -1
  171. package/packages/pm-digital-twin/package.json +1 -1
  172. package/packages/pm-governance-audit/package.json +1 -1
  173. package/packages/pm-guide-shell/package.json +1 -1
  174. package/packages/pm-kanban/package.json +1 -1
  175. package/packages/pm-lifecycle-hooks/package.json +1 -1
  176. package/packages/pm-linked-test-adapters/package.json +1 -1
  177. package/packages/pm-search-advanced/package.json +1 -1
  178. package/packages/pm-templates/package.json +1 -1
  179. package/packages/pm-todos/package.json +1 -1
  180. package/packages/pm-vcs/package.json +1 -1
  181. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  182. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  183. package/scripts/generate-agent-capability-surfaces.mjs +20 -14
  184. package/sdk/public-surface.json +1245 -60
  185. package/dist/cli-bundle/chunks/chunk-2QLOXC3V.js +0 -3
  186. package/dist/cli-bundle/chunks/chunk-4JPYF536.js +0 -35
  187. package/dist/cli-bundle/chunks/chunk-6VDLG2FC.js +0 -13
  188. package/dist/cli-bundle/chunks/chunk-ION3E43Q.js +0 -197
  189. package/dist/cli-bundle/chunks/chunk-OAC5NIV4.js +0 -3
  190. package/dist/cli-bundle/chunks/chunk-TPXZIBIV.js +0 -5
  191. package/dist/cli-bundle/chunks/chunk-YM2YAMF7.js +0 -2
  192. package/dist/cli-bundle/chunks/register-list-query-Q7KII4G5.js +0 -10
  193. package/dist/cli-bundle/chunks/register-mutation-4WBRPXLV.js +0 -20
  194. package/dist/cli-bundle/chunks/register-operations-SSENDH5B.js +0 -2
  195. package/dist/cli-bundle/focused-chunks/chunk-267MUUS6.js +0 -16
  196. package/dist/cli-bundle/focused-chunks/chunk-2NNFLLNG.js +0 -2
  197. package/dist/cli-bundle/focused-chunks/chunk-2QSAKMIH.js +0 -2
  198. package/dist/cli-bundle/focused-chunks/chunk-BUCG4ZI2.js +0 -2
  199. package/dist/cli-bundle/focused-chunks/chunk-EHXIKD6K.js +0 -2
  200. package/dist/cli-bundle/focused-chunks/chunk-KGEXTMPG.js +0 -2
  201. package/dist/cli-bundle/focused-chunks/chunk-KP2VQQVQ.js +0 -2
  202. package/dist/cli-bundle/focused-chunks/chunk-POEEAD2V.js +0 -4
  203. package/dist/cli-bundle/focused-chunks/chunk-XPIC53VA.js +0 -26
  204. package/dist/cli-bundle/focused-chunks/chunk-ZT2DJS27.js +0 -155
@@ -1,10 +1,11 @@
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]="0bcbdc33-3145-54cc-b4b6-10df50aef57a")}catch(e){}}();
3
- import { EXIT_CODE, PmCliError, renderRowsAsCsv, renderRowsAsTable, } from "../sdk/runtime-primitives.js";
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
+ import { EXIT_CODE, PmCliError, readSettings, renderRowsAsCsv, renderRowsAsTable, resolvePmRoot, } from "../sdk/runtime-primitives.js";
4
+ import { renderPmCommandAliasMigrationHint, resolvePmCommandAlias, } from "../sdk/cli-contracts.js";
4
5
  import { EVAL_QUERY_SET_SCHEMA_ID } from "../sdk/eval.js";
5
6
  import { applyContextIntentProjection } from "../sdk/context-intent-contracts.js";
6
- import { serializeNdjsonRows } from "../sdk/output.js";
7
- import { listMutationEvents, subscribeMutationEvents, } from "../sdk/mutation-events.js";
7
+ import { serializeNdjsonRows, serializeNdjsonStream, } from "../sdk/output.js";
8
+ import { listMutationEvents, subscribeMutationEventBatches, subscribeMutationEvents, } from "../sdk/mutation-events.js";
8
9
  import { runActivity } from "./commands/activity.js";
9
10
  import { runAggregate } from "./commands/aggregate.js";
10
11
  import { renderContextMarkdown, runContext, resolveContextOutputFormat, } from "./commands/context.js";
@@ -103,6 +104,14 @@ function registerContentAndGovernanceFilters(command) {
103
104
  .option("--filter-sprint-missing", "Show only items missing sprint")
104
105
  .option("--filter-release-missing", "Show only items missing release");
105
106
  }
107
+ const CANONICAL_LIST_STATUS_VARIANTS = {
108
+ draft: { name: "list-draft", dependencyBlocked: false },
109
+ open: { name: "list-open", dependencyBlocked: false },
110
+ in_progress: { name: "list-in-progress", dependencyBlocked: false },
111
+ blocked: { name: "list-blocked", dependencyBlocked: true },
112
+ closed: { name: "list-closed", dependencyBlocked: false },
113
+ canceled: { name: "list-canceled", dependencyBlocked: false },
114
+ };
106
115
  /** Resolve and validate the mutually exclusive list rendering modes. */
107
116
  function resolveRegisteredListOutputContext(options, globalOptions) {
108
117
  const streamMode = options.stream === true;
@@ -146,39 +155,63 @@ function renderRegisteredListResult(commandName, result, output) {
146
155
  }
147
156
  }
148
157
  async function runRegisteredListCommand(params) {
149
- const globalOptions = getGlobalOptions(params.actionCommand);
158
+ const parsedGlobalOptions = getGlobalOptions(params.actionCommand);
159
+ const globalOptions = params.aliasContract
160
+ ? { ...parsedGlobalOptions, command: params.aliasContract.canonical }
161
+ : parsedGlobalOptions;
150
162
  const startedAt = Date.now();
151
- if (params.options.all === true) {
152
- throw new PmCliError("List --all was ambiguous and is no longer an alias for --no-truncate. Use `pm list --status all --no-truncate` for every status, or `pm list-all --no-truncate` for the dedicated all-status command.", EXIT_CODE.USAGE, {
153
- code: "ambiguous_list_all",
154
- examples: [
155
- "pm list --status all --no-truncate",
156
- "pm list-all --no-truncate",
157
- ],
158
- });
163
+ if (params.aliasContract?.lifecycle === "deprecated") {
164
+ const deprecationHints = await readSettings(resolvePmRoot(process.cwd(), globalOptions.path)).then((settings) => settings.ux.deprecation_hints);
165
+ if (deprecationHints) {
166
+ printError(renderPmCommandAliasMigrationHint(params.aliasContract));
167
+ }
159
168
  }
160
169
  const intentOptions = applyContextIntentProjection("list", params.options);
161
170
  const listOptions = normalizeListOptions(intentOptions);
162
- applyDefaultListProjection(listOptions, params.name);
163
- if (params.excludeTerminal)
164
- listOptions.excludeTerminal = true;
165
- if (params.name === "list" && listOptions.status === undefined) {
166
- listOptions.status = "all";
171
+ let effectiveName = params.name;
172
+ let effectiveStatus = params.status;
173
+ let effectiveDependencyBlocked = params.dependencyBlocked === true;
174
+ let effectiveExcludeTerminal = params.excludeTerminal === true;
175
+ const requestedStatus = listOptions.status?.trim().toLowerCase();
176
+ const requestedVariant = params.name === "list" && requestedStatus !== undefined
177
+ ? CANONICAL_LIST_STATUS_VARIANTS[requestedStatus]
178
+ : undefined;
179
+ if (params.name === "list") {
180
+ if (params.options.all === true || requestedStatus === "all") {
181
+ effectiveName = "list-all";
182
+ effectiveExcludeTerminal = false;
183
+ listOptions.status = undefined;
184
+ }
185
+ else if (requestedStatus !== undefined && requestedVariant !== undefined) {
186
+ effectiveName = requestedVariant.name;
187
+ effectiveStatus = requestedStatus;
188
+ effectiveDependencyBlocked = requestedVariant.dependencyBlocked;
189
+ effectiveExcludeTerminal = false;
190
+ listOptions.status = undefined;
191
+ }
167
192
  }
168
- listOptions.dependencyBlocked = params.dependencyBlocked;
193
+ applyDefaultListProjection(listOptions, effectiveName);
194
+ if (effectiveExcludeTerminal)
195
+ listOptions.excludeTerminal = true;
196
+ listOptions.dependencyBlocked = effectiveDependencyBlocked;
169
197
  const output = resolveRegisteredListOutputContext(intentOptions, globalOptions);
170
- const result = await runList(params.dependencyBlocked ? undefined : params.status, listOptions, globalOptions);
171
- renderRegisteredListResult(params.name, result, output);
198
+ const result = await runList(effectiveDependencyBlocked ? undefined : effectiveStatus, listOptions, globalOptions);
199
+ renderRegisteredListResult("list", result, output);
172
200
  if (globalOptions.profile) {
173
- printError(`profile:command=${params.name} took_ms=${Date.now() - startedAt}`);
201
+ printError(`profile:command=list took_ms=${Date.now() - startedAt}`);
174
202
  }
175
203
  }
176
204
  function registerListCommand(program, descriptor) {
177
- const { name, description, status, excludeTerminal, allowStatusFilter, dependencyBlocked, } = descriptor;
178
- const command = program.command(name).description(description);
205
+ const { name, description, status, excludeTerminal, allowStatusFilter, dependencyBlocked, aliasContract, } = descriptor;
206
+ const command = program
207
+ .command(name, { hidden: aliasContract?.hidden === true })
208
+ .description(description);
179
209
  if (allowStatusFilter) {
180
210
  command.option("--status <value>", "Filter by status (repeatable or comma-separated; matches any; all selects every status)", collect);
181
211
  }
212
+ if (name === "list") {
213
+ command.option("--all", "Include every lifecycle status");
214
+ }
182
215
  command
183
216
  .option("--for <intent>", "Apply a declared context intent projection")
184
217
  .option("--token-budget <n>", "Override the selected intent's maximum estimated output tokens")
@@ -228,6 +261,7 @@ function registerListCommand(program, descriptor) {
228
261
  dependencyBlocked,
229
262
  options,
230
263
  actionCommand,
264
+ aliasContract,
231
265
  });
232
266
  });
233
267
  // Hidden pure snake_case underscore-duplicate alias (kept parse-functional).
@@ -235,7 +269,6 @@ function registerListCommand(program, descriptor) {
235
269
  addHiddenOption(command, "--assignee_filter <value>", "Alias for --assignee-filter");
236
270
  addHiddenOption(command, "--tree_depth <n>", "Alias for --tree-depth");
237
271
  addHiddenOption(command, "--token_budget <n>", "Alias for --token-budget");
238
- addHiddenOption(command, "--all", "Removed ambiguous alias; emits migration guidance");
239
272
  // Singular alias so `--filter-estimate-missing` works (matches update-many spelling).
240
273
  addHiddenOption(command, "--filter-estimate-missing", "Alias for --filter-estimates-missing");
241
274
  }
@@ -301,9 +334,12 @@ async function runNextAction(options, actionCommand) {
301
334
  async function runSearchAction(keywords, options, command) {
302
335
  const globalOptions = getGlobalOptions(command);
303
336
  const startedAt = Date.now();
304
- const intentOptions = applyContextIntentProjection("search", options);
337
+ const query = normalizeSearchKeywordsInput(keywords);
338
+ const intentOptions = applyContextIntentProjection("search", options, [
339
+ query,
340
+ ]);
305
341
  const searchOptions = normalizeSearchOptions(intentOptions);
306
- const result = await runSearch(normalizeSearchKeywordsInput(keywords), {
342
+ const result = await runSearch(query, {
307
343
  ...searchOptions,
308
344
  mode: typeof searchOptions.mode === "string" &&
309
345
  searchOptions.mode.trim().length > 0
@@ -349,7 +385,7 @@ async function runEvalAction(options, command) {
349
385
  async function runGetAction(id, options, command) {
350
386
  const globalOptions = getGlobalOptions(command);
351
387
  const startedAt = Date.now();
352
- const intentOptions = applyContextIntentProjection("get", options);
388
+ const intentOptions = applyContextIntentProjection("get", options, [id]);
353
389
  const result = await runGet(id, globalOptions, {
354
390
  depth: typeof intentOptions.depth === "string" ? intentOptions.depth : undefined,
355
391
  fields: typeof intentOptions.fields === "string"
@@ -411,6 +447,13 @@ function buildMutationEventOptions(options, pmRoot) {
411
447
  const harness = readRepeatableStringOption(options, "harness");
412
448
  const agentInstance = readRepeatableStringOption(options, "agentInstance");
413
449
  const provenanceFilter = readRepeatableStringOption(options, "provenanceFilter");
450
+ const rawCursorMode = typeof options.cursorMode === "string" ? options.cursorMode : undefined;
451
+ if (rawCursorMode !== undefined &&
452
+ rawCursorMode !== "batch" &&
453
+ rawCursorMode !== "row") {
454
+ throw new PmCliError("Events --cursor-mode must be batch or row.", EXIT_CODE.USAGE, { code: "invalid_event_cursor_mode" });
455
+ }
456
+ const cursorMode = rawCursorMode;
414
457
  return {
415
458
  pmRoot,
416
459
  since: typeof options.since === "string" ? options.since : undefined,
@@ -426,42 +469,76 @@ function buildMutationEventOptions(options, pmRoot) {
426
469
  ...(harness === undefined ? {} : { harness }),
427
470
  ...(agentInstance === undefined ? {} : { agentInstance }),
428
471
  ...(provenanceFilter === undefined ? {} : { provenanceFilter }),
472
+ cursorMode,
429
473
  };
430
474
  }
431
- async function runEventsAction(options, command) {
432
- const globalOptions = getGlobalOptions(command);
433
- const startedAt = Date.now();
434
- const eventOptions = buildMutationEventOptions(options, globalOptions.path);
435
- if (options.follow === true) {
436
- if (options.provenanceSummary === true) {
437
- throw new PmCliError("Events --provenance-summary is bounded to one page and cannot be combined with --follow.", EXIT_CODE.USAGE);
438
- }
439
- const intervalMs = typeof options.intervalMs === "string"
440
- ? Number(options.intervalMs)
441
- : undefined;
475
+ /** Follows mutation events using either compatibility row cursors or the default batch-boundary trailer contract. */
476
+ async function followMutationEvents(eventOptions, options, quiet) {
477
+ if (options.provenanceSummary === true) {
478
+ throw new PmCliError("Events --provenance-summary is bounded to one page and cannot be combined with --follow.", EXIT_CODE.USAGE);
479
+ }
480
+ const intervalMs = typeof options.intervalMs === "string"
481
+ ? Number(options.intervalMs)
482
+ : undefined;
483
+ if (eventOptions.cursorMode === "row") {
442
484
  for await (const event of subscribeMutationEvents({
443
485
  ...eventOptions,
444
486
  intervalMs,
445
487
  })) {
446
- if (!globalOptions.quiet) {
488
+ if (!quiet) {
447
489
  writeStdout(`${JSON.stringify(event)}\n`);
448
490
  }
449
491
  }
450
492
  return;
451
493
  }
494
+ for await (const page of subscribeMutationEventBatches({
495
+ ...eventOptions,
496
+ intervalMs,
497
+ })) {
498
+ if (!quiet) {
499
+ writeStdout(`${serializeNdjsonStream(page.events, {
500
+ count: page.count,
501
+ has_more: page.has_more,
502
+ next_cursor: page.next_cursor ?? null,
503
+ source: page.source,
504
+ heartbeat: page.count === 0,
505
+ })}\n`);
506
+ }
507
+ }
508
+ }
509
+ /** Serializes one bounded mutation-event page using its declared row or batch cursor mode. */
510
+ function renderMutationEventPage(page) {
511
+ if (page.cursor_mode === "row") {
512
+ return serializeNdjsonRows(page.events);
513
+ }
514
+ return serializeNdjsonStream(page.events, {
515
+ count: page.count,
516
+ has_more: page.has_more,
517
+ next_cursor: page.next_cursor ?? null,
518
+ source: page.source,
519
+ ...(page.provenance_summary === undefined
520
+ ? {}
521
+ : { provenance_summary: page.provenance_summary }),
522
+ });
523
+ }
524
+ async function runEventsAction(options, command) {
525
+ const globalOptions = getGlobalOptions(command);
526
+ const startedAt = Date.now();
527
+ const eventOptions = buildMutationEventOptions(options, globalOptions.path);
528
+ if (options.follow === true) {
529
+ await followMutationEvents(eventOptions, options, globalOptions.quiet === true);
530
+ return;
531
+ }
452
532
  const page = await listMutationEvents(eventOptions);
453
533
  setActiveCommandResult(page);
454
- const rendered = serializeNdjsonRows([
455
- ...page.events,
456
- ...(page.provenance_summary === undefined
457
- ? []
458
- : [
459
- {
460
- type: "provenance_summary",
461
- provenance_summary: page.provenance_summary,
462
- },
463
- ]),
464
- ]);
534
+ if (globalOptions.json) {
535
+ printResult(page, globalOptions);
536
+ if (globalOptions.profile) {
537
+ printError(`profile:command=events took_ms=${Date.now() - startedAt}`);
538
+ }
539
+ return;
540
+ }
541
+ const rendered = renderMutationEventPage(page);
465
542
  if (!globalOptions.quiet && rendered.length > 0) {
466
543
  writeStdout(`${rendered}\n`);
467
544
  }
@@ -530,7 +607,7 @@ export function registerListQueryCommands(program, options) {
530
607
  const listCommandDescriptors = [
531
608
  {
532
609
  name: "list",
533
- description: "List items across every lifecycle status with optional filters.",
610
+ description: "List active items with optional lifecycle-status and project filters.",
534
611
  excludeTerminal: true,
535
612
  allowStatusFilter: true,
536
613
  },
@@ -579,7 +656,13 @@ export function registerListQueryCommands(program, options) {
579
656
  ];
580
657
  for (const descriptor of listCommandDescriptors) {
581
658
  if (shouldRegister(descriptor.name)) {
582
- registerListCommand(program, descriptor);
659
+ const aliasContract = resolvePmCommandAlias(descriptor.name);
660
+ registerListCommand(program, {
661
+ ...descriptor,
662
+ ...(aliasContract?.registration === "commander"
663
+ ? { aliasContract }
664
+ : {}),
665
+ });
583
666
  }
584
667
  }
585
668
  if (shouldRegister("aggregate")) {
@@ -775,6 +858,7 @@ export function registerListQueryCommands(program, options) {
775
858
  .option("--author <value>", "Filter by mutation author (repeatable or comma-separated)", collect)
776
859
  .option("--item <value>", "Filter by item or workspace stream id (repeatable or comma-separated)", collect)
777
860
  .option("--limit <n>", "Return at most 1,000 events (default: 100)")
861
+ .option("--cursor-mode <mode>", "Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event")
778
862
  .option("--full", "Include each complete authoritative history entry")
779
863
  .option("--provenance", "Include patch-free author, harness, instance, and extensible provenance")
780
864
  .option("--provenance-summary", "Include bounded provenance completeness counts")
@@ -838,4 +922,4 @@ export const _testOnlyRegisterListQuery = {
838
922
  parseListFormat,
839
923
  };
840
924
  //# sourceMappingURL=register-list-query.js.map
841
- //# debugId=0bcbdc33-3145-54cc-b4b6-10df50aef57a
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