@unbrained/pm-cli 2026.8.11 → 2026.8.12

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 (184) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +52 -21
  3. package/dist/cli/commander-usage.js +37 -11
  4. package/dist/cli/error-guidance.d.ts +2 -0
  5. package/dist/cli/error-guidance.js +80 -13
  6. package/dist/cli/main.js +34 -19
  7. package/dist/cli/register-annotations.js +56 -3
  8. package/dist/cli/register-list-query.js +10 -7
  9. package/dist/cli/register-operations.js +16 -6
  10. package/dist/cli-bundle/bundle-manifest.json +157 -157
  11. package/dist/cli-bundle/chunks/{chunk-2OOU2AFH.js → chunk-3PS7X6GS.js} +2 -2
  12. package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +13 -0
  13. package/dist/cli-bundle/chunks/{chunk-WMEZHCFI.js → chunk-BM5YJ2UW.js} +51 -43
  14. package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +33 -0
  15. package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +196 -0
  16. package/dist/cli-bundle/chunks/{chunk-ZU34C3LH.js → chunk-KOQMGCTA.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-R76342NV.js +2 -0
  18. package/dist/cli-bundle/chunks/chunk-RBTK5EZV.js +5 -0
  19. package/dist/cli-bundle/chunks/{chunk-IUNRVDAI.js → chunk-VLUQOIDT.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-A2SJGHSI.js → chunk-WLAHPSOX.js} +2 -2
  21. package/dist/cli-bundle/chunks/register-list-query-XPCJRUUD.js +10 -0
  22. package/dist/cli-bundle/chunks/register-mutation-4RJCBKRS.js +20 -0
  23. package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +2 -0
  24. package/dist/cli-bundle/chunks/{register-setup-NOCOOWQY.js → register-setup-LLHAKP2V.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/chunk-2DALMVF7.js +5 -0
  26. package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +155 -0
  27. package/dist/cli-bundle/focused-chunks/chunk-5TAGTDRE.js +2 -0
  28. package/dist/cli-bundle/focused-chunks/{chunk-FPSYO5ZG.js → chunk-ECADZMVC.js} +11 -11
  29. package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +2 -0
  30. package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +16 -0
  31. package/dist/cli-bundle/focused-chunks/{chunk-BKPIY34S.js → chunk-GQW4BPUT.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-UDAZWT25.js → chunk-JAFRIWVF.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-2DL3MRTD.js → chunk-KHM2CS2C.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-J5EKAIVD.js → chunk-KPSXVBDV.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-23FTGO3W.js → chunk-KTLOKKCQ.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +8 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-KDH5OX3D.js → chunk-NBLUKITQ.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-55BIB6DV.js → chunk-NYLOUPOB.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-DPO7TEFX.js → chunk-Q4T463SD.js} +28 -28
  41. package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-TL5M2PAY.js → chunk-RWPAWUOT.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +17 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-4H5IA6AV.js → chunk-YIAXMC3T.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-ZMGWAYH7.js +2 -0
  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 +1 -1
  49. package/dist/cli-bundle/sdk-core.js +40 -40
  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 +1 -1
  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 +2 -2
  57. package/dist/core/extensions/reserved-host-flags.js +3 -2
  58. package/dist/core/history/drift-scan.js +13 -8
  59. package/dist/core/history/history.d.ts +8 -0
  60. package/dist/core/history/history.js +57 -7
  61. package/dist/core/history/replay.d.ts +9 -1
  62. package/dist/core/history/replay.js +48 -13
  63. package/dist/core/output/output.d.ts +2 -0
  64. package/dist/core/output/output.js +46 -14
  65. package/dist/core/shared/command-types.d.ts +2 -0
  66. package/dist/core/shared/command-types.js +2 -2
  67. package/dist/core/shared/errors.d.ts +5 -0
  68. package/dist/core/shared/errors.js +2 -2
  69. package/dist/core/store/item-metadata-cache.d.ts +1 -1
  70. package/dist/core/store/item-metadata-cache.js +14 -7
  71. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  72. package/dist/sdk/cli-bootstrap.js +6 -2
  73. package/dist/sdk/cli-contracts/completeness.js +3 -2
  74. package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
  75. package/dist/sdk/cli-contracts/registration-helpers.d.ts +20 -3
  76. package/dist/sdk/cli-contracts/registration-helpers.js +18 -12
  77. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +8 -6
  78. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +4 -3
  79. package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
  80. package/dist/sdk/cli-contracts/tool-parameter-tables.js +22 -2
  81. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  82. package/dist/sdk/cli-contracts/tool-schema.js +7 -4
  83. package/dist/sdk/cli-program.js +3 -2
  84. package/dist/sdk/completion.js +16 -7
  85. package/dist/sdk/context-intent-contracts.js +45 -4
  86. package/dist/sdk/core.d.ts +1 -0
  87. package/dist/sdk/core.js +3 -2
  88. package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +8 -0
  89. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1585 -0
  90. package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +8 -0
  91. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1608 -0
  92. package/dist/sdk/generated-error-code-catalog.js +6 -3140
  93. package/dist/sdk/governance/assurance-action.js +9 -7
  94. package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
  95. package/dist/sdk/governance/assurance-mutation-error.js +35 -0
  96. package/dist/sdk/governance/assurance-runtime.js +11 -8
  97. package/dist/sdk/governance/assurance.d.ts +12 -6
  98. package/dist/sdk/governance/assurance.js +181 -66
  99. package/dist/sdk/governance/health.d.ts +3 -1
  100. package/dist/sdk/governance/health.js +21 -4
  101. package/dist/sdk/governance/validate-item-reader.js +3 -3
  102. package/dist/sdk/governance/validate.d.ts +2 -0
  103. package/dist/sdk/governance/validate.js +13 -3
  104. package/dist/sdk/graph/durable-cache.d.ts +1 -1
  105. package/dist/sdk/graph/durable-cache.js +98 -29
  106. package/dist/sdk/graph/governance.d.ts +14 -0
  107. package/dist/sdk/graph/governance.js +34 -9
  108. package/dist/sdk/index.d.ts +1 -1
  109. package/dist/sdk/index.js +3 -3
  110. package/dist/sdk/lifecycle/claim.js +10 -3
  111. package/dist/sdk/merge/driver.d.ts +2 -2
  112. package/dist/sdk/merge/driver.js +3 -3
  113. package/dist/sdk/merge/receipts.d.ts +6 -4
  114. package/dist/sdk/merge/receipts.js +7 -5
  115. package/dist/sdk/merge/three-way.d.ts +2 -2
  116. package/dist/sdk/merge/three-way.js +3 -3
  117. package/dist/sdk/output-projection.d.ts +9 -1
  118. package/dist/sdk/output-projection.js +45 -9
  119. package/dist/sdk/query/activity.d.ts +49 -2
  120. package/dist/sdk/query/activity.js +183 -37
  121. package/dist/sdk/query/get.js +19 -2
  122. package/dist/sdk/read-output-contracts.d.ts +5 -1
  123. package/dist/sdk/read-output-contracts.js +17 -2
  124. package/dist/sdk/read-output-session.d.ts +2 -0
  125. package/dist/sdk/read-output-session.js +12 -5
  126. package/dist/sdk/runtime-primitives.d.ts +3 -3
  127. package/dist/sdk/runtime-primitives.js +5 -5
  128. package/dist/sdk/runtime-stats-options.js +3 -2
  129. package/dist/sdk/runtime.js +5 -9
  130. package/dist/sdk/stats.d.ts +36 -3
  131. package/dist/sdk/stats.js +55 -15
  132. package/dist/sdk/test/execution.d.ts +4 -0
  133. package/dist/sdk/test/execution.js +86 -21
  134. package/dist/types.d.ts +2 -0
  135. package/dist/types.js +2 -2
  136. package/docs/ASSURANCE.md +17 -12
  137. package/docs/COMMANDS.md +29 -8
  138. package/docs/CONFIGURATION.md +7 -0
  139. package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
  140. package/docs/MERGE_SAFETY.md +3 -1
  141. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
  142. package/docs/README.md +2 -0
  143. package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
  144. package/docs/SDK_AGENT_SESSION_CONTEXT.md +12 -1
  145. package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
  146. package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
  147. package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
  148. package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
  149. package/marketplace.json +2 -2
  150. package/package.json +5 -5
  151. package/packages/pm-beads/package.json +1 -1
  152. package/packages/pm-calendar/package.json +1 -1
  153. package/packages/pm-command-kit/package.json +1 -1
  154. package/packages/pm-digital-twin/package.json +1 -1
  155. package/packages/pm-governance-audit/package.json +1 -1
  156. package/packages/pm-guide-shell/package.json +1 -1
  157. package/packages/pm-kanban/package.json +1 -1
  158. package/packages/pm-lifecycle-hooks/package.json +1 -1
  159. package/packages/pm-linked-test-adapters/package.json +1 -1
  160. package/packages/pm-search-advanced/package.json +1 -1
  161. package/packages/pm-templates/package.json +1 -1
  162. package/packages/pm-todos/package.json +1 -1
  163. package/packages/pm-vcs/package.json +1 -1
  164. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  165. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  166. package/sdk/public-surface.json +203 -52
  167. package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +0 -33
  168. package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +0 -13
  169. package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +0 -194
  170. package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +0 -2
  171. package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +0 -5
  172. package/dist/cli-bundle/chunks/register-list-query-HAUXVUPY.js +0 -10
  173. package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +0 -20
  174. package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +0 -2
  175. package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +0 -2
  176. package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +0 -2
  177. package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +0 -16
  178. package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +0 -8
  179. package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +0 -2
  180. package/dist/cli-bundle/focused-chunks/chunk-E3KCL7AY.js +0 -5
  181. package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +0 -153
  182. package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +0 -2
  183. package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.js +0 -17
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]="80e9dea8-2bb3-50e7-b21e-50ec328c3d3d")}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]="6eb8f2a6-6096-54af-a3dc-eb15fdbe5999")}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";
@@ -846,15 +846,29 @@ function activationCommandMatchesProbe(command, probe) {
846
846
  return false;
847
847
  }
848
848
  function extensionActivationCommands(extension) {
849
- return (extension.activation?.commands ??
850
- [
851
- ...(extension.contributions?.commands ?? []),
852
- ...(extension.contributions?.command_handlers ?? []),
853
- ...(extension.contributions?.command_overrides ?? []),
854
- ...(extension.contributions?.flag_commands ?? []),
855
- ...(extension.contributions?.parser_overrides ?? []),
856
- ...(extension.contributions?.renderer_ownership?.flatMap((entry) => entry.commands) ?? []),
857
- ]);
849
+ const explicitCommands = extension.activation?.commands;
850
+ if (explicitCommands) {
851
+ return explicitCommands;
852
+ }
853
+ const contributions = extension.contributions;
854
+ if (!contributions) {
855
+ return [];
856
+ }
857
+ return [
858
+ ...entriesOrEmpty(contributions.commands),
859
+ ...entriesOrEmpty(contributions.command_handlers),
860
+ ...entriesOrEmpty(contributions.command_overrides),
861
+ ...entriesOrEmpty(contributions.flag_commands),
862
+ ...entriesOrEmpty(contributions.parser_overrides),
863
+ ...ownershipCommands(contributions.preflight_ownership),
864
+ ...ownershipCommands(contributions.renderer_ownership),
865
+ ];
866
+ }
867
+ function entriesOrEmpty(entries) {
868
+ return entries ?? [];
869
+ }
870
+ function ownershipCommands(entries) {
871
+ return entriesOrEmpty(entries).flatMap((entry) => entry.commands);
858
872
  }
859
873
  function extensionCapabilities(extension) {
860
874
  /* c8 ignore next */
@@ -917,14 +931,15 @@ function matchesStaticExtensionCommand(commands, probe) {
917
931
  /** Identify contribution surfaces that participate in global runtime behavior. */
918
932
  function hasGlobalExtensionContributions(contributions) {
919
933
  const contributionCounts = [
920
- contributions.hooks?.length ?? 0,
921
- contributions.preflight_overrides ?? 0,
922
- contributions.item_types?.length ?? 0,
923
- contributions.item_fields?.length ?? 0,
924
- contributions.relationship_kinds?.length ?? 0,
925
- contributions.service_overrides?.length ?? 0,
926
- (contributions.renderer_overrides?.length ?? 0) -
927
- (contributions.renderer_ownership?.length ?? 0),
934
+ entriesOrEmpty(contributions.hooks).length,
935
+ (contributions.preflight_overrides ?? 0) -
936
+ entriesOrEmpty(contributions.preflight_ownership).length,
937
+ entriesOrEmpty(contributions.item_types).length,
938
+ entriesOrEmpty(contributions.item_fields).length,
939
+ entriesOrEmpty(contributions.relationship_kinds).length,
940
+ entriesOrEmpty(contributions.service_overrides).length,
941
+ entriesOrEmpty(contributions.renderer_overrides).length -
942
+ entriesOrEmpty(contributions.renderer_ownership).length,
928
943
  ];
929
944
  return contributionCounts.some((count) => count > 0);
930
945
  }
@@ -2459,4 +2474,4 @@ export const _testOnly = {
2459
2474
  wrapThrownErrorForSentry,
2460
2475
  };
2461
2476
  //# sourceMappingURL=main.js.map
2462
- //# debugId=80e9dea8-2bb3-50e7-b21e-50ec328c3d3d
2477
+ //# debugId=6eb8f2a6-6096-54af-a3dc-eb15fdbe5999
@@ -1,10 +1,52 @@
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]="0977d72e-6e4d-5ece-bfaf-eb24a4e9982c")}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]="616fff4b-f86e-54e5-b569-0b9894da5221")}catch(e){}}();
3
3
  import { EXIT_CODE, PmCliError, } from "../sdk/runtime-primitives.js";
4
+ import { renderPmCommand } from "../sdk/command-line.js";
4
5
  import { runComments } from "./commands/comments.js";
5
6
  import { runLearnings } from "./commands/learnings.js";
6
7
  import { runNotes } from "./commands/notes.js";
7
8
  import { addHiddenOption, getGlobalOptions, invalidateSearchCachesForMutation, printError, printResult, readOptionString, } from "./registration-helpers.js";
9
+ function assertNoTransposedAnnotationAction(collection, id, text, options) {
10
+ if (id.trim().toLowerCase() !== "add" || !text?.trim()) {
11
+ return;
12
+ }
13
+ const suppliedText = readOptionString(options, "add") ??
14
+ readOptionString(options, "note") ??
15
+ readOptionString(options, "body") ??
16
+ readOptionString(options, "comment");
17
+ const file = readOptionString(options, "file");
18
+ const retryArgs = [collection, text.trim()];
19
+ if (suppliedText !== undefined)
20
+ retryArgs.push("--add", suppliedText);
21
+ else if (options.stdin === true)
22
+ retryArgs.push("--stdin");
23
+ else if (file !== undefined)
24
+ retryArgs.push("--file", file);
25
+ else
26
+ retryArgs.push("--add", "-");
27
+ const suggestedRetry = renderPmCommand(retryArgs);
28
+ const stdinRetry = renderPmCommand([
29
+ collection,
30
+ text.trim(),
31
+ "--add",
32
+ "-",
33
+ ]);
34
+ throw new PmCliError(`The positional token "add" was parsed as the item id, while "${text.trim()}" was parsed as annotation text. ${collection} does not use an add subcommand.`, EXIT_CODE.USAGE, {
35
+ code: "annotation_transposed_subcommand",
36
+ reason: "noun_verb_object_transposition",
37
+ required: `Place the item id immediately after ${collection}, then use --add for annotation text.`,
38
+ examples: [...new Set([suggestedRetry, stdinRetry])],
39
+ recovery: {
40
+ attempted_command: `pm ${collection} add ${text.trim()}`,
41
+ normalized_args: [collection, "add", text.trim()],
42
+ parsed_positionals: [
43
+ { role: "transposed_subcommand", value: "add" },
44
+ { role: "item_id", value: text.trim() },
45
+ ],
46
+ suggested_retry: suggestedRetry,
47
+ },
48
+ });
49
+ }
8
50
  function resolveCommentSources(text, options) {
9
51
  const editIndex = typeof options.edit === "number" ? options.edit : undefined;
10
52
  const deleteIndex = typeof options.delete === "number" ? options.delete : undefined;
@@ -42,7 +84,14 @@ function resolveCommentSources(text, options) {
42
84
  };
43
85
  }
44
86
  function resolveSingleTextSource(label, positional, options) {
45
- const addFromOption = readOptionString(options, "add");
87
+ const canonicalAdd = readOptionString(options, "add");
88
+ const aliasAdd = label === "note" ? readOptionString(options, "note") : undefined;
89
+ if (canonicalAdd !== undefined &&
90
+ aliasAdd !== undefined &&
91
+ canonicalAdd !== aliasAdd) {
92
+ throw new PmCliError("Specify note text with either --add or --note, not conflicting values for both aliases", EXIT_CODE.USAGE, { code: "annotation_alias_conflict" });
93
+ }
94
+ const addFromOption = canonicalAdd ?? aliasAdd;
46
95
  const addFromPositional = typeof positional === "string" ? positional : undefined;
47
96
  if (addFromOption !== undefined && addFromPositional !== undefined) {
48
97
  throw new PmCliError(`Specify ${label} text either as positional [text] or with --add, not both`, EXIT_CODE.USAGE);
@@ -52,6 +101,7 @@ function resolveSingleTextSource(label, positional, options) {
52
101
  async function runCommentsAction(id, text, options, command) {
53
102
  const globalOptions = getGlobalOptions(command);
54
103
  const startedAt = Date.now();
104
+ assertNoTransposedAnnotationAction("comments", id, text, options);
55
105
  const sources = resolveCommentSources(text, options);
56
106
  const result = await runComments(id, {
57
107
  add: sources.add,
@@ -74,6 +124,7 @@ async function runCommentsAction(id, text, options, command) {
74
124
  async function runNotesAction(id, text, options, command) {
75
125
  const globalOptions = getGlobalOptions(command);
76
126
  const startedAt = Date.now();
127
+ assertNoTransposedAnnotationAction("notes", id, text, options);
77
128
  const add = resolveSingleTextSource("note", text, options);
78
129
  const result = await runNotes(id, {
79
130
  add,
@@ -105,6 +156,7 @@ async function runNotesAction(id, text, options, command) {
105
156
  async function runLearningsAction(id, text, options, command) {
106
157
  const globalOptions = getGlobalOptions(command);
107
158
  const startedAt = Date.now();
159
+ assertNoTransposedAnnotationAction("learnings", id, text, options);
108
160
  const add = resolveSingleTextSource("learning", text, options);
109
161
  const result = await runLearnings(id, {
110
162
  add,
@@ -159,6 +211,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
159
211
  .argument("<id>", "Item id")
160
212
  .argument("[text]", "Optional note text shorthand (equivalent to --add; use - for stdin)")
161
213
  .option("--add <text>", "Add a text note (- reads stdin)")
214
+ .option("--note <text>", "Alias for --add")
162
215
  .option("--add-json <json>", "Append a merge-safe JSON event")
163
216
  .option("--stdin", "Read note text from stdin")
164
217
  .option("--file <path>", "Read note text from a UTF-8 file")
@@ -192,4 +245,4 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
192
245
  .action(runLearningsAction);
193
246
  }
194
247
  //# sourceMappingURL=register-annotations.js.map
195
- //# debugId=0977d72e-6e4d-5ece-bfaf-eb24a4e9982c
248
+ //# debugId=616fff4b-f86e-54e5-b569-0b9894da5221
@@ -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]="6a380419-3ed6-5e3d-a66f-40a6d5408b6b")}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]="0bcbdc33-3145-54cc-b4b6-10df50aef57a")}catch(e){}}();
3
3
  import { EXIT_CODE, PmCliError, renderRowsAsCsv, renderRowsAsTable, } from "../sdk/runtime-primitives.js";
4
4
  import { EVAL_QUERY_SET_SCHEMA_ID } from "../sdk/eval.js";
5
5
  import { applyContextIntentProjection } from "../sdk/context-intent-contracts.js";
@@ -372,7 +372,7 @@ async function runGetAction(id, options, command) {
372
372
  async function runHistoryAction(id, options, command) {
373
373
  const globalOptions = getGlobalOptions(command);
374
374
  const startedAt = Date.now();
375
- if ([options.compact, options.full, options.provenance].filter((value) => value === true).length > 1) {
375
+ if ([options.compact, options.raw, options.full, options.provenance].filter((value) => value === true).length > 1) {
376
376
  throw new PmCliError("History projection options are mutually exclusive. Use --compact, --provenance, or --full.", EXIT_CODE.USAGE);
377
377
  }
378
378
  const field = typeof options.field === "string" ? options.field : undefined;
@@ -472,15 +472,17 @@ async function runEventsAction(options, command) {
472
472
  async function runActivityAction(options, command) {
473
473
  const globalOptions = getGlobalOptions(command);
474
474
  const startedAt = Date.now();
475
- if ([options.compact, options.full, options.provenance].filter((value) => value === true).length > 1) {
476
- throw new PmCliError("Activity projection options are mutually exclusive. Use --compact, --provenance, or --full.", EXIT_CODE.USAGE);
475
+ if ([options.raw, options.compact, options.full, options.provenance].filter((value) => value === true).length > 1) {
476
+ throw new PmCliError("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.", EXIT_CODE.USAGE);
477
477
  }
478
- const normalized = normalizeActivityOptions(options);
479
- const result = await runActivity(normalized, globalOptions);
480
478
  const streamMode = resolveActivityStreamMode(options.stream);
481
479
  if (streamMode && !globalOptions.json) {
482
480
  throw new PmCliError("--stream requires --json output mode.", EXIT_CODE.USAGE);
483
481
  }
482
+ const normalized = normalizeActivityOptions(options);
483
+ const result = await runActivity(streamMode && options.full !== true && options.provenance !== true
484
+ ? { ...normalized, raw: true, compact: true }
485
+ : normalized, globalOptions);
484
486
  if (streamMode) {
485
487
  printActivityJsonStream(result, normalized, globalOptions);
486
488
  }
@@ -795,6 +797,7 @@ export function registerListQueryCommands(program, options) {
795
797
  .option("--limit <n>", "Return only the latest n activity entries")
796
798
  .option("--unbounded", "Explicitly return every matching activity entry (disables the default bound)")
797
799
  .option("--compact", "Condensed output: show only id, op, ts, author, msg per entry")
800
+ .option("--raw", "Show the legacy compact per-event stream instead of the item digest")
798
801
  .option("--full", "Show full activity entries with JSON Patch payloads")
799
802
  .option("--provenance", "Show patch-free author, harness, instance, and extensible provenance")
800
803
  .option("--provenance-summary", "Include bounded provenance completeness counts")
@@ -835,4 +838,4 @@ export const _testOnlyRegisterListQuery = {
835
838
  parseListFormat,
836
839
  };
837
840
  //# sourceMappingURL=register-list-query.js.map
838
- //# debugId=6a380419-3ed6-5e3d-a66f-40a6d5408b6b
841
+ //# debugId=0bcbdc33-3145-54cc-b4b6-10df50aef57a
@@ -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]="8bd1cf90-5ac8-5470-903d-b9b61d62bb85")}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]="7796ea07-0de7-5db8-a3b5-a8021ceebc69")}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";
@@ -54,6 +54,9 @@ function collectTestMutationValues(options) {
54
54
  removeValues: Array.isArray(options.remove)
55
55
  ? options.remove
56
56
  : [],
57
+ removeIndexValues: Array.isArray(options.removeIndex)
58
+ ? options.removeIndex
59
+ : [],
57
60
  };
58
61
  }
59
62
  function validateBackgroundTestOptions(options, values) {
@@ -65,8 +68,9 @@ function validateBackgroundTestOptions(options, values) {
65
68
  }
66
69
  if (values.addValues.length > 0 ||
67
70
  values.addJsonValues.length > 0 ||
68
- values.removeValues.length > 0) {
69
- throw new PmCliError("--background does not support --add/--add-json/--remove; update linked tests first, then run in background", EXIT_CODE.USAGE);
71
+ values.removeValues.length > 0 ||
72
+ values.removeIndexValues.length > 0) {
73
+ throw new PmCliError("--background does not support --add/--add-json/--remove/--remove-index; update linked tests first, then run in background", EXIT_CODE.USAGE);
70
74
  }
71
75
  }
72
76
  async function runBackgroundLinkedTests(id, options, globalOptions, values) {
@@ -77,6 +81,7 @@ async function runBackgroundLinkedTests(id, options, globalOptions, values) {
77
81
  add: values.addValues,
78
82
  addJson: values.addJsonValues,
79
83
  remove: values.removeValues,
84
+ removeIndex: values.removeIndexValues,
80
85
  }),
81
86
  targetId: id,
82
87
  author: typeof options.author === "string" ? options.author : undefined,
@@ -89,6 +94,7 @@ function buildRunTestOptions(options, values) {
89
94
  add: values.addValues,
90
95
  addJson: values.addJsonValues,
91
96
  remove: values.removeValues,
97
+ removeIndex: values.removeIndexValues,
92
98
  list: Boolean(options.list),
93
99
  run: Boolean(options.run),
94
100
  match: typeof options.match === "string" ? options.match : undefined,
@@ -127,7 +133,8 @@ async function runForegroundLinkedTests(id, options, globalOptions, values) {
127
133
  if (values.addValues.length > 0 ||
128
134
  values.addJsonValues.length > 0 ||
129
135
  values.removeValues.length > 0 ||
130
- options.run === true) {
136
+ options.run === true ||
137
+ values.removeIndexValues.length > 0) {
131
138
  await invalidateSearchCachesForMutation(globalOptions, result);
132
139
  }
133
140
  printResult(result, globalOptions);
@@ -236,6 +243,7 @@ async function runStatsAction(options, command) {
236
243
  const startedAt = Date.now();
237
244
  const analytics = parseStatsAnalyticsJson(readOptionString(options, "analytics"));
238
245
  const result = await runStats(globalOptions, {
246
+ includeEmpty: options.includeEmpty === true,
239
247
  storage: options.storage === true,
240
248
  metadataCoverage: options.metadataCoverage === true,
241
249
  byAssignee: options.byAssignee === true,
@@ -565,7 +573,8 @@ export function registerOperationCommands(program) {
565
573
  .argument("<id>", "Item id")
566
574
  .option("--add <value>", "Add linked test entry (CSV/markdown pairs or - for stdin)", collect)
567
575
  .option("--add-json <value>", "Add linked test entry from JSON object/array (or - for stdin)", collect)
568
- .option("--remove <value>", "Remove linked test entry by command/path (command=<value>, path=<value>, markdown pairs, plain value, or - for stdin)", collect)
576
+ .option("--remove <value>", "Remove linked test entry by exact command/path (command=<value> and path=<value> preserve commas and equals signs; or - for stdin)", collect)
577
+ .option("--remove-index <n>", "Remove the 1-based linked-test index from --list order (repeatable)", collect)
569
578
  .option("--list", "List linked tests without mutating")
570
579
  .option("--run", "Run linked test commands")
571
580
  .option("--match <value>", "Run only linked tests whose command/path contains this substring")
@@ -613,6 +622,7 @@ export function registerOperationCommands(program) {
613
622
  program
614
623
  .command("stats")
615
624
  .description("Show project tracker statistics.")
625
+ .option("--include-empty", "Restore zero-count registered item-type and lifecycle-status buckets")
616
626
  .option("--storage", "Include aggregate history-stream storage metrics (total streams/lines/bytes, largest + deepest streams, oldest/newest entries)")
617
627
  .option("--metadata-coverage", "Include metadata coverage % (acceptance_criteria, estimated_minutes, resolution, tags, parent) overall and by type")
618
628
  .option("--by-assignee", "Include a lifecycle-bucketed item breakdown grouped by assignee")
@@ -863,4 +873,4 @@ function registerSchedulingShortcutCommands(program) {
863
873
  });
864
874
  }
865
875
  //# sourceMappingURL=register-operations.js.map
866
- //# debugId=8bd1cf90-5ac8-5470-903d-b9b61d62bb85
876
+ //# debugId=7796ea07-0de7-5db8-a3b5-a8021ceebc69