@unbrained/pm-cli 2026.8.22 → 2026.8.24

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 (229) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +42 -1
  3. package/dist/cli/description-stdin.js +5 -4
  4. package/dist/cli/error-guidance.d.ts +13 -0
  5. package/dist/cli/error-guidance.js +62 -6
  6. package/dist/cli/extension-command-help.d.ts +5 -0
  7. package/dist/cli/extension-command-help.js +6 -2
  8. package/dist/cli/help-content.d.ts +5 -0
  9. package/dist/cli/help-content.js +56 -3
  10. package/dist/cli/help-json-payload.d.ts +5 -2
  11. package/dist/cli/help-json-payload.js +57 -17
  12. package/dist/cli/main.d.ts +3 -0
  13. package/dist/cli/main.js +39 -5
  14. package/dist/cli/register-annotations.js +5 -5
  15. package/dist/cli/register-mutation.js +77 -31
  16. package/dist/cli/register-operations.d.ts +73 -0
  17. package/dist/cli/register-operations.js +39 -14
  18. package/dist/cli/register-setup.js +3 -3
  19. package/dist/cli/schema-registration-helpers.d.ts +8 -1
  20. package/dist/cli/schema-registration-helpers.js +14 -5
  21. package/dist/cli-bundle/bundle-manifest.json +155 -155
  22. package/dist/cli-bundle/chunks/chunk-AGUL3HUT.js +3 -0
  23. package/dist/cli-bundle/chunks/{chunk-WG4STC36.js → chunk-DJNJBWAQ.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-MYYI3ZOA.js → chunk-I5Q7QSZX.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-IW72J5FW.js +2 -0
  26. package/dist/cli-bundle/chunks/{chunk-BWX4SK46.js → chunk-L22NP5MA.js} +66 -66
  27. package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +36 -0
  28. package/dist/cli-bundle/chunks/{chunk-MZTZQTMS.js → chunk-NXBFO63A.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-TEQDR5KI.js +202 -0
  30. package/dist/cli-bundle/chunks/chunk-X7WWQDYQ.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-YOLLRCLY.js +13 -0
  32. package/dist/cli-bundle/chunks/{chunk-U6GQ4VMV.js → chunk-ZAVCS2GH.js} +4 -4
  33. package/dist/cli-bundle/chunks/{register-list-query-HZKBQNWW.js → register-list-query-37A4P6O4.js} +2 -2
  34. package/dist/cli-bundle/chunks/register-mutation-TBJDHYIT.js +20 -0
  35. package/dist/cli-bundle/chunks/register-operations-WRZNEBUM.js +2 -0
  36. package/dist/cli-bundle/chunks/{register-setup-QK4OTOXN.js → register-setup-H4PDLACD.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-GMYPD4FX.js → chunk-4WP7LNE3.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-6MUTDXMP.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-6Z24ZMU3.js +2 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-2ARQGDDW.js → chunk-BFA6KKCI.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-CWCN5RLO.js +26 -0
  42. package/dist/cli-bundle/focused-chunks/chunk-FCTT4CZU.js +5 -0
  43. package/dist/cli-bundle/focused-chunks/chunk-GJR6YEMR.js +156 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-2POVTNLY.js → chunk-IMWTYKII.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-D6RBZEJJ.js → chunk-IZNRRCU3.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-PMGJUFNQ.js → chunk-MNPECIRL.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-A2BC5PQL.js → chunk-O4ZXNJMT.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +2 -0
  49. package/dist/cli-bundle/focused-chunks/chunk-QBP5FSBX.js +4 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-R6SR45XU.js → chunk-QV5UP27O.js} +48 -47
  51. package/dist/cli-bundle/focused-chunks/chunk-RASVBJX5.js +8 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-E2EWYPY6.js → chunk-RPRLENVA.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +19 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-6S2MO3Q3.js → chunk-WZLSSGEU.js} +2 -2
  55. package/dist/cli-bundle/main.js +18 -17
  56. package/dist/cli-bundle/sdk-authoring.js +1 -1
  57. package/dist/cli-bundle/sdk-contracts.js +2 -2
  58. package/dist/cli-bundle/sdk-core.js +41 -41
  59. package/dist/cli-bundle/sdk-governance.js +1 -1
  60. package/dist/cli-bundle/sdk-graph.js +1 -1
  61. package/dist/cli-bundle/sdk-merge.js +33 -32
  62. package/dist/cli-bundle/sdk-query.js +1 -1
  63. package/dist/cli-bundle/sdk-runtime.js +1 -1
  64. package/dist/cli-bundle/sdk-testing.js +1 -1
  65. package/dist/cli-bundle/sdk.js +6 -5
  66. package/dist/core/config/nested-settings.js +8 -2
  67. package/dist/core/config/positional-value.d.ts +1 -1
  68. package/dist/core/config/positional-value.js +5 -2
  69. package/dist/core/extensions/command-metadata-contract.d.ts +10 -0
  70. package/dist/core/extensions/command-metadata-contract.js +23 -0
  71. package/dist/core/extensions/command-visibility-tier.js +12 -2
  72. package/dist/core/extensions/extension-types.d.ts +6 -0
  73. package/dist/core/extensions/extension-types.js +2 -2
  74. package/dist/core/extensions/loader.js +4 -3
  75. package/dist/core/history/history.js +3 -3
  76. package/dist/core/io/body-file.js +7 -2
  77. package/dist/core/io/bulk-ids-input.d.ts +24 -0
  78. package/dist/core/io/bulk-ids-input.js +113 -0
  79. package/dist/core/item/item-format.js +66 -12
  80. package/dist/core/item/parse.d.ts +22 -2
  81. package/dist/core/item/parse.js +97 -4
  82. package/dist/core/reproducibility/context.d.ts +4 -0
  83. package/dist/core/reproducibility/context.js +14 -8
  84. package/dist/core/shared/author.d.ts +55 -1
  85. package/dist/core/shared/author.js +333 -16
  86. package/dist/core/shared/constants.js +3 -2
  87. package/dist/core/store/settings-validator.d.ts +1 -0
  88. package/dist/core/store/settings-validator.js +6 -3
  89. package/dist/core/store/settings.js +5 -2
  90. package/dist/mcp/server.d.ts +4 -3
  91. package/dist/mcp/server.js +44 -16
  92. package/dist/sdk/agent/identity-config.d.ts +63 -0
  93. package/dist/sdk/agent/identity-config.js +107 -0
  94. package/dist/sdk/agent/refusal-closure-census.d.ts +66 -0
  95. package/dist/sdk/agent/refusal-closure-census.js +144 -0
  96. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +76 -0
  97. package/dist/sdk/agent/refusal-corpus-contracts.js +194 -0
  98. package/dist/sdk/agent-capability-contracts.d.ts +34 -1
  99. package/dist/sdk/agent-capability-contracts.js +104 -6
  100. package/dist/sdk/annotations.d.ts +2 -0
  101. package/dist/sdk/annotations.js +25 -7
  102. package/dist/sdk/cli-contracts/agent-output-contracts.js +6 -4
  103. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  104. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  105. package/dist/sdk/cli-contracts/flag-contracts.js +9 -2
  106. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +4 -4
  107. package/dist/sdk/cli-contracts/registration-helpers.js +5 -2
  108. package/dist/sdk/cli-contracts/tool-parameter-tables.js +58 -2
  109. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  110. package/dist/sdk/cli-contracts/tool-schema.js +14 -3
  111. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +4 -1
  112. package/dist/sdk/cli-contracts/typed-action-inputs.js +2 -2
  113. package/dist/sdk/cli-contracts.d.ts +3 -3
  114. package/dist/sdk/cli-contracts.js +4 -4
  115. package/dist/sdk/comments.js +15 -7
  116. package/dist/sdk/config.d.ts +6 -1
  117. package/dist/sdk/config.js +119 -14
  118. package/dist/sdk/context-intent-contracts.js +4 -2
  119. package/dist/sdk/core-governance.d.ts +1 -1
  120. package/dist/sdk/core-governance.js +3 -3
  121. package/dist/sdk/extension/scaffold.js +11 -5
  122. package/dist/sdk/flag-invocation-contracts.d.ts +2 -0
  123. package/dist/sdk/flag-invocation-contracts.js +30 -3
  124. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +83 -2
  125. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +87 -2
  126. package/dist/sdk/governance/assurance-action.js +30 -10
  127. package/dist/sdk/governance/validate.d.ts +2 -2
  128. package/dist/sdk/governance/validate.js +39 -14
  129. package/dist/sdk/guide-topics.d.ts +0 -5
  130. package/dist/sdk/guide-topics.js +28 -2
  131. package/dist/sdk/history-compact.d.ts +2 -1
  132. package/dist/sdk/history-compact.js +24 -5
  133. package/dist/sdk/history-mcp.js +11 -10
  134. package/dist/sdk/index.d.ts +8 -2
  135. package/dist/sdk/index.js +9 -3
  136. package/dist/sdk/item-transaction.js +19 -12
  137. package/dist/sdk/lifecycle/append.js +4 -4
  138. package/dist/sdk/lifecycle/close-many.js +16 -7
  139. package/dist/sdk/lifecycle/create.js +33 -22
  140. package/dist/sdk/lifecycle/plan.js +24 -6
  141. package/dist/sdk/lifecycle/update-many.js +15 -8
  142. package/dist/sdk/lifecycle/update.d.ts +2 -0
  143. package/dist/sdk/lifecycle/update.js +37 -25
  144. package/dist/sdk/merge/three-way.js +105 -26
  145. package/dist/sdk/read-output-budget.d.ts +21 -0
  146. package/dist/sdk/read-output-budget.js +39 -2
  147. package/dist/sdk/read-output-contracts.d.ts +5 -3
  148. package/dist/sdk/read-output-contracts.js +20 -12
  149. package/dist/sdk/reproducibility/process.d.ts +19 -0
  150. package/dist/sdk/reproducibility/process.js +88 -0
  151. package/dist/sdk/runtime-extended-actions.js +5 -3
  152. package/dist/sdk/runtime-input.d.ts +4 -0
  153. package/dist/sdk/runtime-input.js +98 -23
  154. package/dist/sdk/runtime-primitives.d.ts +3 -2
  155. package/dist/sdk/runtime-primitives.js +5 -4
  156. package/dist/sdk/runtime.js +11 -23
  157. package/dist/sdk/scheduling-shortcuts.js +5 -3
  158. package/dist/sdk/structured-mutations.js +10 -3
  159. package/dist/sdk/test/batch.d.ts +6 -0
  160. package/dist/sdk/test/batch.js +15 -3
  161. package/dist/sdk/test/entry.d.ts +1 -1
  162. package/dist/sdk/test/entry.js +3 -2
  163. package/dist/sdk/test/execution.d.ts +28 -3
  164. package/dist/sdk/test/execution.js +193 -34
  165. package/dist/sdk/test/parsers.d.ts +6 -0
  166. package/dist/sdk/test/parsers.js +21 -2
  167. package/dist/sdk/test/trust.d.ts +33 -0
  168. package/dist/sdk/test/trust.js +207 -0
  169. package/dist/sdk/workspace-contracts.d.ts +3 -0
  170. package/dist/sdk/workspace-contracts.js +3 -2
  171. package/dist/types.d.ts +23 -0
  172. package/dist/types.js +2 -2
  173. package/docs/AGENT_PROVENANCE_ADR.md +41 -5
  174. package/docs/CONFIGURATION.md +4 -0
  175. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +19 -2
  176. package/docs/MERGE_SAFETY.md +15 -1
  177. package/docs/README.md +2 -0
  178. package/docs/READ_OUTPUT_CONTRACTS.md +11 -1
  179. package/docs/RELEASING.md +40 -21
  180. package/docs/REPRODUCIBLE_WORKSPACES.md +42 -8
  181. package/docs/SCRIPTING.md +62 -3
  182. package/docs/SDK.md +17 -0
  183. package/docs/SDK_AGENT_SESSION_CONTEXT.md +6 -4
  184. package/docs/SDK_EVIDENCE_TRACEABILITY.md +1 -1
  185. package/docs/TESTING.md +75 -8
  186. package/docs/agent-task-token-baseline.json +2 -2
  187. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +17 -0
  188. package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
  189. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  190. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +355 -0
  191. package/marketplace.json +2 -2
  192. package/package.json +2 -2
  193. package/packages/pm-beads/package.json +1 -1
  194. package/packages/pm-calendar/package.json +1 -1
  195. package/packages/pm-command-kit/README.md +9 -11
  196. package/packages/pm-command-kit/extensions/command-kit/index.ts +3 -1
  197. package/packages/pm-command-kit/package.json +1 -1
  198. package/packages/pm-digital-twin/package.json +1 -1
  199. package/packages/pm-governance-audit/package.json +1 -1
  200. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +10 -0
  201. package/packages/pm-guide-shell/package.json +1 -1
  202. package/packages/pm-kanban/package.json +1 -1
  203. package/packages/pm-lifecycle-hooks/package.json +1 -1
  204. package/packages/pm-linked-test-adapters/package.json +1 -1
  205. package/packages/pm-search-advanced/package.json +1 -1
  206. package/packages/pm-templates/package.json +1 -1
  207. package/packages/pm-todos/package.json +1 -1
  208. package/packages/pm-vcs/package.json +1 -1
  209. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  210. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  211. package/scripts/generate-agent-capability-surfaces.mjs +27 -1
  212. package/sdk/public-surface.json +642 -28
  213. package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +0 -13
  214. package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +0 -200
  215. package/dist/cli-bundle/chunks/chunk-QI2CT3IX.js +0 -2
  216. package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +0 -35
  217. package/dist/cli-bundle/chunks/chunk-VMMIL3SI.js +0 -2
  218. package/dist/cli-bundle/chunks/chunk-YBPJAOQQ.js +0 -3
  219. package/dist/cli-bundle/chunks/register-mutation-HTKEEGRD.js +0 -20
  220. package/dist/cli-bundle/chunks/register-operations-6EMRWJJY.js +0 -2
  221. package/dist/cli-bundle/focused-chunks/chunk-2AZT5WXZ.js +0 -2
  222. package/dist/cli-bundle/focused-chunks/chunk-3LKU6PTJ.js +0 -4
  223. package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +0 -2
  224. package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +0 -5
  225. package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +0 -155
  226. package/dist/cli-bundle/focused-chunks/chunk-MB37AYN6.js +0 -26
  227. package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +0 -2
  228. package/dist/cli-bundle/focused-chunks/chunk-PH2OXXVZ.js +0 -18
  229. package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +0 -8
package/dist/cli/main.js CHANGED
@@ -3,14 +3,15 @@
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]="5a349bce-a08d-5ff6-870a-3ec38843b512")}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]="ffd55bde-cc30-529f-a6f9-ec43abe4efba")}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
+ import { runWithReproducibleProcessEnvironment } from "../sdk/reproducibility/process.js";
9
10
  import { resolveSubcommandFlagContractsForCommand } from "../sdk/cli-contracts.js";
10
11
  import { createExtensionCommandSdk } from "../sdk/extension-command-context.js";
11
12
  import { PmClient } from "../sdk/runtime.js";
12
13
  import { coerceLooseCommandOptionsWithFlagDefinitions, collectLooseCommandOptionKeysForDefinitions, collectLoosePositionalArgs, parseLooseCommandOptions, stripLooseCommandOptionTokens, validateLooseCommandOptionsWithFlagDefinitions, } from "./extension-command-options.js";
13
- import { attachRichHelpText } from "./help-content.js";
14
+ import { attachRichHelpText, setPmCommandHelpVisibilityTier, } from "./help-content.js";
14
15
  import { finishActiveTelemetryCommand, recordAfterCommandContextUsage } from "./after-command-context-usage.js";
15
16
  import { extractProvidedOptionFlags, normalizeLongOptionFlag, redactSensitiveCommandArgs, renderPmCommand, } from "./argv-utils.js";
16
17
  import { classifyCommanderError, classifyPmCliError, classifyUnknownError, formatPmCliErrorForDisplay, formatPmCliErrorForJson, formatUnknownErrorForJson, projectLeanErrorEnvelope, } from "./error-guidance.js";
@@ -1507,6 +1508,28 @@ function attachDynamicExtensionHelp(command, descriptor, flagHelp, metadataHelp)
1507
1508
  }
1508
1509
  /* v8 ignore stop */
1509
1510
  /* c8 ignore start */
1511
+ /** Apply descendant-derived visibility to every generated extension namespace. */
1512
+ function applyDynamicExtensionRootHelpVisibility(rootProgram, preexistingTopLevelCommands, descriptors) {
1513
+ const tierRank = { core: 0, standard: 1, full: 2, internal: 3 };
1514
+ const applyVisibility = (command, pathParts) => {
1515
+ const commandPath = pathParts.join(" ");
1516
+ const matchingDescriptors = [...descriptors.entries()]
1517
+ .filter(([path]) => path === commandPath || path.startsWith(`${commandPath} `))
1518
+ .map(([, descriptor]) => descriptor);
1519
+ const tier = matchingDescriptors.length === 0
1520
+ ? "standard"
1521
+ : matchingDescriptors.reduce((selected, descriptor) => tierRank[descriptor.tier] < tierRank[selected] ? descriptor.tier : selected, "internal");
1522
+ setPmCommandHelpVisibilityTier(command, tier);
1523
+ for (const child of command.commands) {
1524
+ applyVisibility(child, [...pathParts, child.name()]);
1525
+ }
1526
+ };
1527
+ for (const command of rootProgram.commands) {
1528
+ if (!preexistingTopLevelCommands.has(command.name())) {
1529
+ applyVisibility(command, [command.name()]);
1530
+ }
1531
+ }
1532
+ }
1510
1533
  async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv) {
1511
1534
  const bootstrapGlobalOptions = parseBootstrapGlobalOptions(invocationArgv);
1512
1535
  const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
@@ -1551,6 +1574,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
1551
1574
  activeRuntimeExtensionCommandDescriptors = new Map(snapshot.commandDescriptors);
1552
1575
  await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, snapshot.registrations, snapshot.settings);
1553
1576
  const commandPaths = collectSafeExtensionCommandPaths(rootProgram, snapshot.commandHandlers, snapshot.commandDescriptors, snapshot.commandAliases, (warning) => reportExtensionCommandCollision(snapshot.activationWarnings, printError, warning));
1577
+ const preexistingTopLevelCommands = new Set(rootProgram.commands.map((command) => command.name()));
1554
1578
  const registerCommandPath = (commandPath) => {
1555
1579
  const pathParts = commandPath.split(" ").filter((part) => part.length > 0);
1556
1580
  const descriptor = snapshot.commandDescriptors.get(commandPath);
@@ -1608,6 +1632,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
1608
1632
  for (const commandPath of commandPaths) {
1609
1633
  registerCommandPath(commandPath);
1610
1634
  }
1635
+ applyDynamicExtensionRootHelpVisibility(rootProgram, preexistingTopLevelCommands, snapshot.commandDescriptors);
1611
1636
  }
1612
1637
  /* c8 ignore stop */
1613
1638
  /* c8 ignore start */
@@ -2387,8 +2412,7 @@ async function handleRunPmCliError(params) {
2387
2412
  emitTelemetryCommandError: context.emitTelemetryCommandError,
2388
2413
  });
2389
2414
  }
2390
- /** Implements run pm cli for the public runtime surface of this module. */
2391
- export async function runPmCli(rawArgv = process.argv.slice(2)) {
2415
+ async function runPmCliInReproducibleContext(rawArgv) {
2392
2416
  program = createPmCliProgram(CLI_VERSION);
2393
2417
  attachProgramLifecycleHooks(program);
2394
2418
  // The runtime-extension snapshot caches dedupe discovery work within a
@@ -2458,9 +2482,19 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
2458
2482
  restorePmAuthor?.();
2459
2483
  }
2460
2484
  }
2485
+ /** Implements run pm cli for the public runtime surface of this module. */
2486
+ export async function runPmCli(rawArgv = process.argv.slice(2)) {
2487
+ try {
2488
+ await runWithReproducibleProcessEnvironment(process.env, () => runPmCliInReproducibleContext(rawArgv));
2489
+ }
2490
+ catch (error) {
2491
+ await handleRunPmCliError({ error, invocationArgv: [...rawArgv] });
2492
+ }
2493
+ }
2461
2494
  /** Public contract for test only, shared by SDK and presentation-layer consumers. */
2462
2495
  export const _testOnly = {
2463
2496
  activationCommandMatchesProbe,
2497
+ applyDynamicExtensionRootHelpVisibility,
2464
2498
  bootstrapProfileEnabled,
2465
2499
  buildBootstrapActivationProbe,
2466
2500
  buildPostActionTelemetryOutcome,
@@ -2549,4 +2583,4 @@ export const _testOnly = {
2549
2583
  wrapThrownErrorForSentry,
2550
2584
  };
2551
2585
  //# sourceMappingURL=main.js.map
2552
- //# debugId=5a349bce-a08d-5ff6-870a-3ec38843b512
2586
+ //# debugId=ffd55bde-cc30-529f-a6f9-ec43abe4efba
@@ -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]="616fff4b-f86e-54e5-b569-0b9894da5221")}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]="79bf0b3f-ad63-5d9f-9911-d5a142214ac1")}catch(e){}}();
3
3
  import { EXIT_CODE, PmCliError, } from "../sdk/runtime-primitives.js";
4
4
  import { renderPmCommand } from "../sdk/command-line.js";
5
5
  import { runComments } from "./commands/comments.js";
@@ -194,7 +194,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
194
194
  .argument("[text]", "Optional comment text shorthand (equivalent to --add)")
195
195
  .option("--add <text>", "Add one comment entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)")
196
196
  .option("--stdin", "Read comment text from stdin (supports multiline markdown)")
197
- .option("--file <path>", "Read comment text from file (supports multiline markdown)")
197
+ .option("--file <path>", "Read comment text from a file or stdin (-)")
198
198
  .option("--edit <index>", "Replace the comment at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveInteger("--edit"))
199
199
  .option("--delete <index>", "Delete the comment at 1-based <index>", parsePositiveInteger("--delete"))
200
200
  .option("--limit <n>", "Return only latest n comments")
@@ -214,7 +214,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
214
214
  .option("--note <text>", "Alias for --add")
215
215
  .option("--add-json <json>", "Append a merge-safe JSON event")
216
216
  .option("--stdin", "Read note text from stdin")
217
- .option("--file <path>", "Read note text from a UTF-8 file")
217
+ .option("--file <path>", "Read note from file or stdin (-)")
218
218
  .option("--edit <index>", "Replace a 1-based note using the selected text input", parsePositiveInteger("--edit"))
219
219
  .option("--delete <index>", "Delete the note at 1-based <index>", parsePositiveInteger("--delete"))
220
220
  .option("--limit <n>", "Return only latest n notes")
@@ -233,7 +233,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
233
233
  .argument("[text]", "Optional learning text shorthand (equivalent to --add; use - for stdin)")
234
234
  .option("--add <text>", "Add one learning entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)")
235
235
  .option("--stdin", "Read learning text from stdin (supports multiline markdown)")
236
- .option("--file <path>", "Read learning text from file (supports multiline markdown)")
236
+ .option("--file <path>", "Read learning text from a file or stdin (-)")
237
237
  .option("--edit <index>", "Replace the learning at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveInteger("--edit"))
238
238
  .option("--delete <index>", "Delete the learning at 1-based <index>", parsePositiveInteger("--delete"))
239
239
  .option("--limit <n>", "Return only latest n learnings")
@@ -245,4 +245,4 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
245
245
  .action(runLearningsAction);
246
246
  }
247
247
  //# sourceMappingURL=register-annotations.js.map
248
- //# debugId=616fff4b-f86e-54e5-b569-0b9894da5221
248
+ //# debugId=79bf0b3f-ad63-5d9f-9911-d5a142214ac1
@@ -1,7 +1,7 @@
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]="07f3212f-c6d3-534e-8273-fae43a8fca18")}catch(e){}}();
3
- import { resolveBodyFileContent, EXIT_CODE, splitCommaList, PmCliError, createUnknownSubcommandError, } from "../sdk/runtime-primitives.js";
4
- import { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, } from "../sdk/cli-contracts.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]="28a59fb9-80bc-5e2a-b926-1bb227c103c6")}catch(e){}}();
3
+ import { resolveBodyFileContent, resolveCliBulkIdsInput, EXIT_CODE, splitCommaList, PmCliError, createUnknownSubcommandError, } from "../sdk/runtime-primitives.js";
4
+ import { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, MERGE_SUBCOMMAND_VALUES, 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";
6
6
  import { MERGE_DRIVER_ARTIFACT_VALUES, runMergeDriver, runMergeInstall, runMergeReconcile, runMergeReceiptReport, } from "./commands/merge.js";
7
7
  import { runAppend } from "./commands/append.js";
@@ -22,7 +22,7 @@ import { runRestore } from "./commands/restore.js";
22
22
  import * as schemaModule from "./commands/schema.js";
23
23
  import { runUpdate } from "./commands/update.js";
24
24
  import { runUpdateMany } from "./commands/update-many.js";
25
- import { createStdinTokenResolver } from "../sdk/runtime-primitives.js";
25
+ import { createStdinTokenResolver, preserveMutationStdinTokenFields, preserveMutationStdinTokenLiterals, } from "../sdk/runtime-primitives.js";
26
26
  import { resolveDescriptionStdin } from "./description-stdin.js";
27
27
  import { itemDocumentToMutationOptions } from "../sdk/structured-mutations.js";
28
28
  import { registerStructuredMutationCommands } from "./register-structured-mutation.js";
@@ -484,6 +484,7 @@ function assertCreatePositionalTypeHasTitle(positionalType, positionalTitle, opt
484
484
  }
485
485
  const STRUCTURED_STDIN_CONFLICT_KEYS = [
486
486
  "body",
487
+ "bodyFile",
487
488
  "description",
488
489
  "dep",
489
490
  "depRemove",
@@ -497,21 +498,45 @@ const STRUCTURED_STDIN_CONFLICT_KEYS = [
497
498
  "event",
498
499
  "typeOption",
499
500
  "field",
501
+ "ids",
500
502
  ];
501
- function assertExclusiveStructuredStdin(options) {
502
- const conflictingFlags = STRUCTURED_STDIN_CONFLICT_KEYS.filter((key) => {
503
+ function assertSingleMutationStdinConsumer(options) {
504
+ const stdinFlags = STRUCTURED_STDIN_CONFLICT_KEYS.flatMap((key) => {
503
505
  const value = options[key];
504
- return value === "-" || (Array.isArray(value) && value.includes("-"));
505
- }).map((key) => `--${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`);
506
- if (conflictingFlags.length > 0) {
507
- throw new PmCliError(`--stdin-json cannot be combined with other stdin consumers: ${conflictingFlags.join(", ")}`, EXIT_CODE.USAGE);
506
+ const count = typeof value === "string" && value.trim() === "-"
507
+ ? 1
508
+ : Array.isArray(value)
509
+ ? value.filter((entry) => typeof entry === "string" && entry.trim() === "-").length
510
+ : 0;
511
+ const flag = `--${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
512
+ return Array.from({ length: count }, () => flag);
513
+ });
514
+ if (options.stdinJson === true) {
515
+ stdinFlags.unshift("--stdin-json");
516
+ }
517
+ if (stdinFlags.length > 1) {
518
+ throw new PmCliError(`Only one option may consume stdin per command invocation. Found: ${stdinFlags.join(", ")}.`, EXIT_CODE.USAGE);
508
519
  }
509
520
  }
521
+ function preserveResolvedMutationStdinFields(options, bodyFileResolved, descriptionStdinResolved) {
522
+ const fields = [];
523
+ if (bodyFileResolved)
524
+ fields.push("body");
525
+ if (descriptionStdinResolved)
526
+ fields.push("description");
527
+ preserveMutationStdinTokenFields(options, fields);
528
+ }
529
+ function isDescriptionStdinConsumer(options, stdinJsonConsumed) {
530
+ return (!stdinJsonConsumed &&
531
+ typeof options.description === "string" &&
532
+ options.description.trim() === "-");
533
+ }
510
534
  async function runCreateAction(typeOrTitle, secondTitle, options, command) {
511
535
  const globalOptions = getGlobalOptions(command);
512
536
  const startedAt = Date.now();
513
- if (options.stdinJson === true) {
514
- assertExclusiveStructuredStdin(options);
537
+ assertSingleMutationStdinConsumer(options);
538
+ const stdinJsonConsumed = options.stdinJson === true;
539
+ if (stdinJsonConsumed) {
515
540
  const input = await createStdinTokenResolver().resolveValue("-", "--stdin-json");
516
541
  options = itemDocumentToMutationOptions(input ?? "", "create", options);
517
542
  }
@@ -526,12 +551,19 @@ async function runCreateAction(typeOrTitle, secondTitle, options, command) {
526
551
  positionals.positionalTitle.length > 0 &&
527
552
  options.title === undefined)
528
553
  options.title = positionals.positionalTitle;
529
- await resolveDescriptionStdin(options);
530
- if (typeof options.bodyFile === "string") {
531
- options.body = await resolveBodyFileContent(options.bodyFile, options.body !== undefined ? String(options.body) : undefined);
554
+ const descriptionStdinResolved = isDescriptionStdinConsumer(options, stdinJsonConsumed);
555
+ if (!stdinJsonConsumed) {
556
+ await resolveDescriptionStdin(options);
557
+ }
558
+ const bodyFileResolved = typeof options.bodyFile === "string";
559
+ if (bodyFileResolved) {
560
+ options.body = await resolveBodyFileContent(String(options.bodyFile), options.body !== undefined ? String(options.body) : undefined);
532
561
  delete options.bodyFile;
533
562
  }
534
563
  const normalized = normalizeCreateOptions(options, { requireType: false });
564
+ preserveResolvedMutationStdinFields(normalized, bodyFileResolved, descriptionStdinResolved);
565
+ if (stdinJsonConsumed)
566
+ preserveMutationStdinTokenLiterals(normalized);
535
567
  const result = await runCreate(normalized, globalOptions);
536
568
  await invalidateSearchCachesForMutation(globalOptions, result);
537
569
  printResult(result, globalOptions);
@@ -564,6 +596,8 @@ function buildCloseManyListOptions(options) {
564
596
  async function runCloseManyAction(options, command) {
565
597
  const globalOptions = getGlobalOptions(command);
566
598
  const startedAt = Date.now();
599
+ assertSingleMutationStdinConsumer(options);
600
+ options.ids = await resolveCliBulkIdsInput(readOptionString(options, "ids"));
567
601
  const result = await runCloseMany({
568
602
  status: readOptionString(options, "filterStatus"),
569
603
  list: buildCloseManyListOptions(options),
@@ -591,6 +625,8 @@ async function runCloseManyAction(options, command) {
591
625
  async function runUpdateManyAction(options, command) {
592
626
  const globalOptions = getGlobalOptions(command);
593
627
  const startedAt = Date.now();
628
+ assertSingleMutationStdinConsumer(options);
629
+ options.ids = await resolveCliBulkIdsInput(readOptionString(options, "ids"));
594
630
  const result = await runUpdateMany({
595
631
  status: readOptionString(options, "filterStatus"),
596
632
  list: buildUpdateManyListOptions(options),
@@ -823,7 +859,7 @@ async function runMergeAction(subcommand, artifact, base, ours, theirs, options,
823
859
  throw createUnknownSubcommandError({
824
860
  command_path: "merge",
825
861
  token: subcommand,
826
- allowed: ["install", "reconcile", "report", "driver"],
862
+ allowed: MERGE_SUBCOMMAND_VALUES,
827
863
  display_name: "merge",
828
864
  });
829
865
  }
@@ -834,7 +870,8 @@ async function runMergeAction(subcommand, artifact, base, ours, theirs, options,
834
870
  async function runHistoryCompactAction(id, options, command) {
835
871
  const globalOptions = getGlobalOptions(command);
836
872
  const startedAt = Date.now();
837
- const ids = typeof options.ids === "string" ? splitCommaList(options.ids) : undefined;
873
+ const idsValue = await resolveCliBulkIdsInput(readOptionString(options, "ids"));
874
+ const ids = idsValue === undefined ? undefined : splitCommaList(idsValue);
838
875
  const allOver = parseNonNegativeIntFlag(options.allOver, "--all-over");
839
876
  const minEntries = parseNonNegativeIntFlag(options.minEntries, "--min-entries");
840
877
  if (options.closed === true && options.allStreams === true) {
@@ -898,7 +935,7 @@ async function runSchemaAction(subcommand, name, options, command) {
898
935
  assertSchemaSubcommandPresent(normalizedSubcommand, SCHEMA_SUBCOMMANDS);
899
936
  if (!SCHEMA_SUBCOMMANDS.includes(normalizedSubcommand) &&
900
937
  typeName === undefined &&
901
- !looksLikeSchemaSubcommandTypo(normalizedSubcommand)) {
938
+ !looksLikeSchemaSubcommandTypo(subcommand)) {
902
939
  typeName = subcommand;
903
940
  normalizedSubcommand = "add-type";
904
941
  }
@@ -987,19 +1024,28 @@ async function runFocusAction(id, options, command) {
987
1024
  async function runUpdateAction(id, options, command) {
988
1025
  const globalOptions = getGlobalOptions(command);
989
1026
  const startedAt = Date.now();
990
- if (options.stdinJson === true) {
991
- assertExclusiveStructuredStdin(options);
1027
+ assertSingleMutationStdinConsumer(options);
1028
+ const stdinJsonConsumed = options.stdinJson === true;
1029
+ if (stdinJsonConsumed) {
992
1030
  const input = await createStdinTokenResolver().resolveValue("-", "--stdin-json");
993
1031
  options = itemDocumentToMutationOptions(input ?? "", "update", options);
994
1032
  }
995
- await resolveDescriptionStdin(options);
1033
+ const descriptionStdinResolved = isDescriptionStdinConsumer(options, stdinJsonConsumed);
1034
+ if (!stdinJsonConsumed) {
1035
+ await resolveDescriptionStdin(options);
1036
+ }
996
1037
  // GH-214: resolve --body-file into the existing body field before
997
1038
  // normalization so the rest of update is unchanged. CLI-only input alias.
998
- if (typeof options.bodyFile === "string") {
999
- options.body = await resolveBodyFileContent(options.bodyFile, options.body !== undefined ? String(options.body) : undefined);
1039
+ const bodyFileResolved = typeof options.bodyFile === "string";
1040
+ if (bodyFileResolved) {
1041
+ options.body = await resolveBodyFileContent(String(options.bodyFile), options.body !== undefined ? String(options.body) : undefined);
1000
1042
  delete options.bodyFile;
1001
1043
  }
1002
- const result = await runUpdate(id, normalizeUpdateOptions(options), globalOptions);
1044
+ const normalized = normalizeUpdateOptions(options);
1045
+ preserveResolvedMutationStdinFields(normalized, bodyFileResolved, descriptionStdinResolved);
1046
+ if (stdinJsonConsumed)
1047
+ preserveMutationStdinTokenLiterals(normalized);
1048
+ const result = await runUpdate(id, normalized, globalOptions);
1003
1049
  await invalidateSearchCachesForMutation(globalOptions, result);
1004
1050
  printResult(await applyActiveCommandResultService("update", [id], options, globalOptions, result), globalOptions);
1005
1051
  if (globalOptions.profile) {
@@ -1239,7 +1285,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1239
1285
  registerCommanderOptionContracts(createCommand, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);
1240
1286
  createCommand
1241
1287
  .option("--stdin-json", "Read a full item JSON document from stdin; explicit flags override document values")
1242
- .option("--body-file <path>", "Load the item markdown body from a file (mutually exclusive with --body)")
1288
+ .option("--body-file <path>", "Load body from a file or stdin (-); conflicts with --body")
1243
1289
  .option("--clear-deps", "Clear dependency entries")
1244
1290
  .option("--clear-comments", "Clear comments")
1245
1291
  .option("--clear-notes", "Clear notes")
@@ -1277,7 +1323,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1277
1323
  registerCommanderOptionContracts(updateCommand, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);
1278
1324
  updateCommand
1279
1325
  .option("--stdin-json", "Read a full item JSON document from stdin; explicit flags override document values")
1280
- .option("--body-file <path>", "Load the item markdown body from a file (mutually exclusive with --body)")
1326
+ .option("--body-file <path>", "Load body from a file or stdin (-); conflicts with --body")
1281
1327
  .option("--replace-deps", "Atomically replace dependency entries with the provided --dep values")
1282
1328
  .option("--replace-tests", "Atomically replace linked test entries with the provided --test values")
1283
1329
  .option("--replace-files", "Atomically replace linked file entries with the provided --file values")
@@ -1319,7 +1365,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1319
1365
  .option("--filter-metadata-missing", "Select only items missing any tracked metadata (AC, estimate, or resolution)");
1320
1366
  registerBulkContentAndGovernanceFilters(updateManyCommand, "applying updates");
1321
1367
  updateManyCommand
1322
- .option("--ids <value>", "Restrict to an explicit comma-separated ID allowlist (intersected with other filters)")
1368
+ .option("--ids <value>", "Explicit ID allowlist: comma/newline text, - stdin, or @path file")
1323
1369
  .option("--limit <n>", "Limit matched item count before apply/preview")
1324
1370
  .option("--offset <n>", "Skip first n matched rows before apply/preview")
1325
1371
  .option("--dry-run", "Preview per-item diffs and checkpoint intent without mutating")
@@ -1477,7 +1523,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1477
1523
  .option("--filter-release <value>", "Filter by release before closing");
1478
1524
  registerBulkContentAndGovernanceFilters(closeManyCommand, "closing");
1479
1525
  closeManyCommand
1480
- .option("--ids <value>", "Restrict to an explicit comma-separated ID allowlist (intersected with other filters)")
1526
+ .option("--ids <value>", "Explicit ID allowlist: comma/newline text, - stdin, or @path file")
1481
1527
  .option("--limit <n>", "Limit matched item count before apply/preview")
1482
1528
  .option("--offset <n>", "Skip first n matched rows before apply/preview")
1483
1529
  .option("--reason <value>", "Shared close reason applied to matched items (required when governance.require_close_reason is enabled)")
@@ -1711,7 +1757,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1711
1757
  .command("history-compact")
1712
1758
  .argument("[id]", "Item id (omit when using a bulk selector)")
1713
1759
  .option("--before <value>", "Compact entries strictly before this version number or ISO timestamp (single-id mode only)")
1714
- .option("--ids <value>", "Bulk: compact an explicit comma-separated list of item ids")
1760
+ .option("--ids <value>", "Bulk IDs: comma/newline text, - stdin, or @path file")
1715
1761
  .option("--all-over <n>", "Bulk: compact every stream with more than N entries")
1716
1762
  .option("--closed", "Bulk: compact only closed (terminal) items' streams")
1717
1763
  .option("--all-streams", "Bulk: compact every history stream regardless of lifecycle state")
@@ -1724,7 +1770,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1724
1770
  .action(runHistoryCompactAction);
1725
1771
  program
1726
1772
  .command("merge")
1727
- .argument("<subcommand>", "Merge subcommand: install, reconcile, report, driver")
1773
+ .argument("<subcommand>", `Merge subcommand: ${MERGE_SUBCOMMAND_VALUES.join(", ")}`)
1728
1774
  .argument("[artifact]", `driver only: artifact class to merge (${MERGE_DRIVER_ARTIFACT_VALUES.join(", ")})`)
1729
1775
  .argument("[base]", "driver only: common-ancestor file path (git %O)")
1730
1776
  .argument("[ours]", "driver only: current-branch file path (git %A)")
@@ -1840,4 +1886,4 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1840
1886
  .action(runDepsAction);
1841
1887
  }
1842
1888
  //# sourceMappingURL=register-mutation.js.map
1843
- //# debugId=07f3212f-c6d3-534e-8273-fae43a8fca18
1889
+ //# debugId=28a59fb9-80bc-5e2a-b926-1bb227c103c6
@@ -4,7 +4,80 @@
4
4
  * Provides CLI runtime support for Register Operations.
5
5
  */
6
6
  import type { Command } from "commander";
7
+ declare function validateBackgroundTestOptions(options: Record<string, unknown>, values: {
8
+ addValues: string[];
9
+ addJsonValues: string[];
10
+ removeValues: string[];
11
+ removeIndexValues: string[];
12
+ }): void;
13
+ declare function buildRunTestOptions(options: Record<string, unknown>, values: {
14
+ addValues: string[];
15
+ addJsonValues: string[];
16
+ removeValues: string[];
17
+ removeIndexValues: string[];
18
+ }): {
19
+ add: string[];
20
+ addJson: string[];
21
+ remove: string[];
22
+ removeIndex: string[];
23
+ list: boolean;
24
+ run: boolean;
25
+ match: string | undefined;
26
+ onlyIndex: string | number | undefined;
27
+ onlyLast: boolean;
28
+ timeout: string | undefined;
29
+ progress: boolean;
30
+ envSet: string[];
31
+ envClear: string[];
32
+ sharedHostSafe: boolean;
33
+ pmContext: string | undefined;
34
+ overrideLinkedPmContext: boolean;
35
+ workspaceContext: string | undefined;
36
+ overrideLinkedWorkspaceContext: boolean;
37
+ allowUntrustedLinkedTests: boolean;
38
+ acknowledgeLinkedTests: boolean;
39
+ failOnContextMismatch: boolean;
40
+ failOnSkipped: boolean;
41
+ failOnEmptyTestRun: boolean;
42
+ requireAssertionsForPm: boolean;
43
+ checkContext: boolean;
44
+ autoPmContext: boolean;
45
+ author: string | undefined;
46
+ message: string | undefined;
47
+ force: boolean;
48
+ measure: string[];
49
+ metricBelow: string | undefined;
50
+ metricDiff: string | undefined;
51
+ };
52
+ /** Public contract for test-only operation adapter coverage. */
53
+ export declare const _testOnlyRegisterOperations: {
54
+ buildRunTestOptions: typeof buildRunTestOptions;
55
+ buildRunTestAllOptions: typeof buildRunTestAllOptions;
56
+ validateBackgroundTestOptions: typeof validateBackgroundTestOptions;
57
+ };
58
+ declare function buildRunTestAllOptions(options: Record<string, unknown>): {
59
+ status: string | undefined;
60
+ limit: string | undefined;
61
+ offset: string | undefined;
62
+ timeout: string | undefined;
63
+ progress: boolean;
64
+ envSet: string[];
65
+ envClear: string[];
66
+ sharedHostSafe: boolean;
67
+ pmContext: string | undefined;
68
+ overrideLinkedPmContext: boolean;
69
+ workspaceContext: string | undefined;
70
+ overrideLinkedWorkspaceContext: boolean;
71
+ allowUntrustedLinkedTests: boolean;
72
+ failOnContextMismatch: boolean;
73
+ failOnSkipped: boolean;
74
+ failOnEmptyTestRun: boolean;
75
+ requireAssertionsForPm: boolean;
76
+ checkContext: boolean;
77
+ autoPmContext: boolean;
78
+ };
7
79
  /** Enforces the claim target XOR selection contract before dispatch. */
8
80
  export declare function requireClaimTarget(id: string | undefined, next: boolean): void;
9
81
  /** Implements register operation commands for the public runtime surface of this module. */
10
82
  export declare function registerOperationCommands(program: Command): void;
83
+ export {};
@@ -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]="975321a1-0375-5829-a012-f23e32e9c6bf")}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]="7377fa65-aaa9-5d28-b3fb-a8becaf0d484")}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";
@@ -66,6 +66,9 @@ function validateBackgroundTestOptions(options, values) {
66
66
  if (options.run !== true) {
67
67
  throw new PmCliError("--background requires --run", EXIT_CODE.USAGE);
68
68
  }
69
+ if (options.acknowledgeLinkedTests === true) {
70
+ throw new PmCliError("--background cannot be combined with --acknowledge-linked-tests; acknowledgement is a non-executing foreground operation", EXIT_CODE.USAGE);
71
+ }
69
72
  if (values.addValues.length > 0 ||
70
73
  values.addJsonValues.length > 0 ||
71
74
  values.removeValues.length > 0 ||
@@ -112,6 +115,12 @@ function buildRunTestOptions(options, values) {
112
115
  sharedHostSafe: Boolean(options.sharedHostSafe),
113
116
  pmContext: typeof options.pmContext === "string" ? options.pmContext : undefined,
114
117
  overrideLinkedPmContext: Boolean(options.overrideLinkedPmContext),
118
+ workspaceContext: typeof options.workspaceContext === "string"
119
+ ? options.workspaceContext
120
+ : undefined,
121
+ overrideLinkedWorkspaceContext: Boolean(options.overrideLinkedWorkspaceContext),
122
+ allowUntrustedLinkedTests: Boolean(options.allowUntrustedLinkedTests),
123
+ acknowledgeLinkedTests: Boolean(options.acknowledgeLinkedTests),
115
124
  failOnContextMismatch: Boolean(options.failOnContextMismatch),
116
125
  failOnSkipped: Boolean(options.failOnSkipped),
117
126
  failOnEmptyTestRun: Boolean(options.failOnEmptyTestRun),
@@ -128,6 +137,12 @@ function buildRunTestOptions(options, values) {
128
137
  metricDiff: typeof options.metricDiff === "string" ? options.metricDiff : undefined,
129
138
  };
130
139
  }
140
+ /** Public contract for test-only operation adapter coverage. */
141
+ export const _testOnlyRegisterOperations = {
142
+ buildRunTestOptions,
143
+ buildRunTestAllOptions,
144
+ validateBackgroundTestOptions,
145
+ };
131
146
  async function runForegroundLinkedTests(id, options, globalOptions, values) {
132
147
  const result = await runTest(id, buildRunTestOptions(options, values), globalOptions);
133
148
  if (values.addValues.length > 0 ||
@@ -193,7 +208,20 @@ async function runTestAllAction(options, command) {
193
208
  }
194
209
  return;
195
210
  }
196
- const result = await runTestAll({
211
+ const result = await runTestAll(buildRunTestAllOptions(options), globalOptions);
212
+ await invalidateSearchCachesForMutation(globalOptions, {
213
+ ids: result.results.map((entry) => entry.id),
214
+ });
215
+ printResult(result, globalOptions);
216
+ if (result.failed > 0 || result.fail_on_skipped_triggered === true) {
217
+ process.exitCode = EXIT_CODE.DEPENDENCY_FAILED;
218
+ }
219
+ if (globalOptions.profile) {
220
+ printError(`profile:command=test-all took_ms=${Date.now() - startedAt}`);
221
+ }
222
+ }
223
+ function buildRunTestAllOptions(options) {
224
+ return {
197
225
  status: readOptionString(options, "status"),
198
226
  limit: readOptionString(options, "limit"),
199
227
  offset: readOptionString(options, "offset"),
@@ -206,23 +234,16 @@ async function runTestAllAction(options, command) {
206
234
  sharedHostSafe: Boolean(options.sharedHostSafe),
207
235
  pmContext: readOptionString(options, "pmContext"),
208
236
  overrideLinkedPmContext: Boolean(options.overrideLinkedPmContext),
237
+ workspaceContext: readOptionString(options, "workspaceContext"),
238
+ overrideLinkedWorkspaceContext: Boolean(options.overrideLinkedWorkspaceContext),
239
+ allowUntrustedLinkedTests: Boolean(options.allowUntrustedLinkedTests),
209
240
  failOnContextMismatch: Boolean(options.failOnContextMismatch),
210
241
  failOnSkipped: Boolean(options.failOnSkipped),
211
242
  failOnEmptyTestRun: Boolean(options.failOnEmptyTestRun),
212
243
  requireAssertionsForPm: Boolean(options.requireAssertionsForPm),
213
244
  checkContext: Boolean(options.checkContext),
214
245
  autoPmContext: Boolean(options.autoPmContext),
215
- }, globalOptions);
216
- await invalidateSearchCachesForMutation(globalOptions, {
217
- ids: result.results.map((entry) => entry.id),
218
- });
219
- printResult(result, globalOptions);
220
- if (result.failed > 0 || result.fail_on_skipped_triggered === true) {
221
- process.exitCode = EXIT_CODE.DEPENDENCY_FAILED;
222
- }
223
- if (globalOptions.profile) {
224
- printError(`profile:command=test-all took_ms=${Date.now() - startedAt}`);
225
- }
246
+ };
226
247
  }
227
248
  async function runTelemetryAction(namespaceOrSubcommand, subcommand, options, command) {
228
249
  const globalOptions = getGlobalOptions(command);
@@ -558,6 +579,9 @@ function addLinkedTestExecutionOptions(command) {
558
579
  .option("--shared-host-safe", "Apply additive shared-host-safe runtime defaults for linked-test runs")
559
580
  .option("--pm-context <mode>", "PM linked-test context mode: schema|tracker|auto (default: schema)")
560
581
  .option("--override-linked-pm-context", "Force run-level --pm-context to override per-linked-test pm_context_mode metadata")
582
+ .option("--workspace-context <mode>", "Source-workspace mode: source|isolated|snapshot (default: source)")
583
+ .option("--override-linked-workspace-context", "Force run-level --workspace-context over per-linked-test metadata")
584
+ .option("--allow-untrusted-linked-tests", "Execute untrusted linked commands when project policy also permits it")
561
585
  .option("--fail-on-context-mismatch", "Fail linked PM commands when context item counts differ")
562
586
  .option("--fail-on-skipped", "Treat skipped linked tests as dependency failures")
563
587
  .option("--fail-on-empty-test-run", "Treat successful linked-test commands that report zero executed tests as failures")
@@ -580,6 +604,7 @@ export function registerOperationCommands(program) {
580
604
  .option("--match <value>", "Run only linked tests whose command/path contains this substring")
581
605
  .option("--only-index <n>", "Run only the 1-based linked-test index from --list order")
582
606
  .option("--only-last", "Run only the most recently added linked test");
607
+ testCommand.option("--acknowledge-linked-tests", "Trust the item's current linked commands in this clone without executing them");
583
608
  addLinkedTestExecutionOptions(testCommand)
584
609
  .option("--measure <value>", "Record name=value[,unit=...][,threshold=...] evidence; repeatable", collect)
585
610
  .option("--metric-below <value>", "Return evidence below name=value")
@@ -873,4 +898,4 @@ function registerSchedulingShortcutCommands(program) {
873
898
  });
874
899
  }
875
900
  //# sourceMappingURL=register-operations.js.map
876
- //# debugId=975321a1-0375-5829-a012-f23e32e9c6bf
901
+ //# debugId=7377fa65-aaa9-5d28-b3fb-a8becaf0d484
@@ -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]="d498a64c-9680-52a9-981d-4ce86949784d")}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]="2a7939ad-52a6-5d9c-b7cf-2bc59a6b3d32")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { EXIT_CODE, PmCliError, } from "../sdk/runtime-primitives.js";
@@ -622,7 +622,7 @@ export function registerSetupCommands(program) {
622
622
  .option("--criterion <text>", "Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)", collect)
623
623
  .option("--clear-criteria", "Clear criteria-list keys for config set operations")
624
624
  .option("--format <value>", "Item format for item-format key: toon")
625
- .option("--policy <value>", "Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; telemetry-tracking=enabled|disabled")
625
+ .option("--policy <value>", "Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; untrusted-linked-test-execution=enabled|disabled; telemetry-tracking=enabled|disabled")
626
626
  .option("--value <value>", "Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.")
627
627
  .option("--default-depth <value>", "Context default depth: brief|standard|deep")
628
628
  .option("--activity-limit <n>", "Context default activity limit")
@@ -673,4 +673,4 @@ export function registerSetupCommands(program) {
673
673
  });
674
674
  }
675
675
  //# sourceMappingURL=register-setup.js.map
676
- //# debugId=d498a64c-9680-52a9-981d-4ce86949784d
676
+ //# debugId=2a7939ad-52a6-5d9c-b7cf-2bc59a6b3d32
@@ -5,7 +5,14 @@
5
5
  * registration and its focused contract tests.
6
6
  */
7
7
  import { isPureSnakeCaseAlias } from "../sdk/runtime-primitives.js";
8
- /** Return whether a shorthand token resembles a misspelled schema subcommand. */
8
+ /**
9
+ * Return whether a token must remain on the schema-action refusal path.
10
+ *
11
+ * Bare custom-type shorthand is intentionally limited to PascalCase names.
12
+ * Lowercase tokens occupy the action namespace, so a misspelling such as
13
+ * `pm schema nonsense` cannot silently register a new type. Explicit
14
+ * `pm schema add-type <name>` remains available for every valid type name.
15
+ */
9
16
  export declare function looksLikeSchemaSubcommandTypo(value: string): boolean;
10
17
  /**
11
18
  * Parse the integer `--order` value accepted by `pm schema add-status`.