@unbrained/pm-cli 2026.8.12 → 2026.8.14

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 (218) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +162 -111
  3. package/dist/cli/error-guidance.js +4 -8
  4. package/dist/cli/main.js +40 -3
  5. package/dist/cli/register-assurance.js +28 -17
  6. package/dist/cli-bundle/bundle-manifest.json +141 -173
  7. package/dist/cli-bundle/chunks/chunk-BBOFSVAK.js +197 -0
  8. package/dist/cli-bundle/chunks/chunk-BFALV3YP.js +5 -0
  9. package/dist/cli-bundle/chunks/{chunk-WLAHPSOX.js → chunk-FIW4P64F.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-BM5YJ2UW.js → chunk-G5JUB66K.js} +52 -52
  11. package/dist/cli-bundle/chunks/chunk-SBRKH6OR.js +2 -0
  12. package/dist/cli-bundle/chunks/chunk-TMJ7URWS.js +13 -0
  13. package/dist/cli-bundle/chunks/chunk-TXMEUUUY.js +8 -0
  14. package/dist/cli-bundle/chunks/{chunk-KOQMGCTA.js → chunk-XAVMOK6B.js} +50 -50
  15. package/dist/cli-bundle/chunks/chunk-YAMTJL6Y.js +34 -0
  16. package/dist/cli-bundle/chunks/chunk-YSVSMJ2B.js +2 -0
  17. package/dist/cli-bundle/chunks/{register-list-query-XPCJRUUD.js → register-list-query-T3EHHNNV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-mutation-4RJCBKRS.js → register-mutation-E27WCLSZ.js} +2 -2
  19. package/dist/cli-bundle/chunks/register-operations-4R6I7CPY.js +2 -0
  20. package/dist/cli-bundle/chunks/{register-setup-LLHAKP2V.js → register-setup-3YXZ444E.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-JAFRIWVF.js → chunk-4DQ2YERC.js} +4 -4
  22. package/dist/cli-bundle/focused-chunks/chunk-F43TT2QQ.js +8 -0
  23. package/dist/cli-bundle/focused-chunks/chunk-K7RWWOAG.js +4 -0
  24. package/dist/cli-bundle/focused-chunks/chunk-KFSZ3BP6.js +16 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-KHM2CS2C.js → chunk-KSEDUWVZ.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-KYUQGTSB.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-ZMGWAYH7.js → chunk-LZ4MV3RH.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-PGXJQLCT.js +155 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-RWPAWUOT.js → chunk-PPFGQDSI.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/chunk-Q4YY3XNF.js +2 -0
  31. package/dist/cli-bundle/focused-chunks/chunk-QK753U3U.js +46 -0
  32. package/dist/cli-bundle/focused-chunks/chunk-QUMB2J27.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/chunk-SM7MTG27.js +2 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-GQW4BPUT.js → chunk-WCVE2NIG.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-XDNAW5OI.js +18 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-YIAXMC3T.js → chunk-YOOI3UZX.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/chunk-ZM6TZVHC.js +2 -0
  38. package/dist/cli-bundle/main.js +13 -13
  39. package/dist/cli-bundle/sdk-authoring.js +1 -1
  40. package/dist/cli-bundle/sdk-contracts.js +1 -1
  41. package/dist/cli-bundle/sdk-core.js +45 -41
  42. package/dist/cli-bundle/sdk-governance.js +1 -1
  43. package/dist/cli-bundle/sdk-graph.js +1 -1
  44. package/dist/cli-bundle/sdk-merge.js +109 -1
  45. package/dist/cli-bundle/sdk-query.js +1 -1
  46. package/dist/cli-bundle/sdk-runtime.js +1 -1
  47. package/dist/cli-bundle/sdk-testing.js +1 -1
  48. package/dist/cli-bundle/sdk.js +2 -2
  49. package/dist/core/checkpoint/checkpoint-gc.js +7 -12
  50. package/dist/core/extensions/activation-summary-markdown.js +5 -4
  51. package/dist/core/extensions/activation-summary.d.ts +2 -0
  52. package/dist/core/extensions/activation-summary.js +6 -2
  53. package/dist/core/extensions/capability-usage.d.ts +1 -1
  54. package/dist/core/extensions/capability-usage.js +4 -3
  55. package/dist/core/extensions/contribution-inventory.d.ts +1 -0
  56. package/dist/core/extensions/contribution-inventory.js +6 -2
  57. package/dist/core/extensions/extension-registries.js +3 -2
  58. package/dist/core/extensions/extension-types.d.ts +83 -1
  59. package/dist/core/extensions/extension-types.js +3 -2
  60. package/dist/core/extensions/loader.d.ts +2 -8
  61. package/dist/core/extensions/loader.js +53 -144
  62. package/dist/core/extensions/registration-values.d.ts +43 -0
  63. package/dist/core/extensions/registration-values.js +210 -0
  64. package/dist/core/extensions/runtime-registrations.d.ts +3 -1
  65. package/dist/core/extensions/runtime-registrations.js +12 -2
  66. package/dist/core/fs/fs-utils.d.ts +2 -0
  67. package/dist/core/fs/fs-utils.js +7 -3
  68. package/dist/core/history/drift-cache.js +4 -3
  69. package/dist/core/history/drift-scan.d.ts +6 -0
  70. package/dist/core/history/drift-scan.js +76 -58
  71. package/dist/core/history/workspace-history.d.ts +59 -0
  72. package/dist/core/history/workspace-history.js +197 -10
  73. package/dist/core/lock/lock-gc.js +8 -13
  74. package/dist/core/lock/lock.js +5 -4
  75. package/dist/core/output/output.js +12 -4
  76. package/dist/core/search/vector-stores.js +6 -11
  77. package/dist/core/store/item-metadata-cache.js +4 -4
  78. package/dist/core/telemetry/runtime.d.ts +6 -0
  79. package/dist/core/telemetry/runtime.js +101 -30
  80. package/dist/sdk/agent/command-recovery.d.ts +2 -0
  81. package/dist/sdk/agent/command-recovery.js +10 -2
  82. package/dist/sdk/annotations.js +4 -4
  83. package/dist/sdk/cli-contracts/completeness.js +9 -3
  84. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  85. package/dist/sdk/cli-contracts/flag-contracts.js +6 -3
  86. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -1
  87. package/dist/sdk/cli-contracts/runtime-contracts.js +155 -60
  88. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +32 -0
  89. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +25 -2
  90. package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -5
  91. package/dist/sdk/cli-contracts/tool-schema.js +17 -2
  92. package/dist/sdk/cli-program.js +3 -3
  93. package/dist/sdk/comments.js +4 -3
  94. package/dist/sdk/compile-cache.js +4 -3
  95. package/dist/sdk/compose.d.ts +3 -1
  96. package/dist/sdk/compose.js +16 -2
  97. package/dist/sdk/context-relevance.js +12 -4
  98. package/dist/sdk/context-signal-store.js +4 -3
  99. package/dist/sdk/extension/install-runtime.js +4 -4
  100. package/dist/sdk/extension/managed-state.js +4 -3
  101. package/dist/sdk/extension-contracts.d.ts +1 -1
  102. package/dist/sdk/flag-invocation-contracts.js +5 -6
  103. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +14 -2
  104. package/dist/sdk/governance/assurance-action.d.ts +27 -3
  105. package/dist/sdk/governance/assurance-action.js +112 -28
  106. package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
  107. package/dist/sdk/governance/assurance-mutation-error.js +25 -2
  108. package/dist/sdk/governance/assurance-presets.d.ts +54 -0
  109. package/dist/sdk/governance/assurance-presets.js +136 -0
  110. package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
  111. package/dist/sdk/governance/assurance-runtime.js +109 -8
  112. package/dist/sdk/governance/assurance.d.ts +39 -0
  113. package/dist/sdk/governance/assurance.js +145 -6
  114. package/dist/sdk/governance/gc.js +5 -11
  115. package/dist/sdk/governance/health.js +18 -6
  116. package/dist/sdk/governance/validate-history-drift.d.ts +7 -0
  117. package/dist/sdk/governance/validate-history-drift.js +68 -0
  118. package/dist/sdk/governance/validate.js +6 -48
  119. package/dist/sdk/graph/assembly.d.ts +23 -0
  120. package/dist/sdk/graph/assembly.js +54 -2
  121. package/dist/sdk/graph/durable-cache.js +91 -3
  122. package/dist/sdk/graph/governance-contracts.d.ts +12 -0
  123. package/dist/sdk/graph/governance-contracts.js +29 -0
  124. package/dist/sdk/graph/governance.d.ts +51 -3
  125. package/dist/sdk/graph/governance.js +216 -35
  126. package/dist/sdk/graph/index.d.ts +2 -2
  127. package/dist/sdk/graph/index.js +4 -4
  128. package/dist/sdk/graph/mutation-advisory.js +15 -7
  129. package/dist/sdk/graph/remediation.js +12 -2
  130. package/dist/sdk/guide.js +4 -4
  131. package/dist/sdk/history-read.d.ts +8 -0
  132. package/dist/sdk/history-read.js +2 -2
  133. package/dist/sdk/index.d.ts +3 -2
  134. package/dist/sdk/index.js +5 -4
  135. package/dist/sdk/linked-artifacts.d.ts +2 -0
  136. package/dist/sdk/linked-artifacts.js +29 -4
  137. package/dist/sdk/merge/install.js +5 -4
  138. package/dist/sdk/query/activity.js +4 -3
  139. package/dist/sdk/query/history.js +20 -3
  140. package/dist/sdk/read-output-budget.d.ts +2 -0
  141. package/dist/sdk/read-output-budget.js +12 -5
  142. package/dist/sdk/read-output-contracts.d.ts +61 -5
  143. package/dist/sdk/read-output-contracts.js +210 -28
  144. package/dist/sdk/read-output-rows.d.ts +11 -0
  145. package/dist/sdk/read-output-rows.js +47 -2
  146. package/dist/sdk/relationship-history.js +5 -5
  147. package/dist/sdk/runtime-primitives.d.ts +1 -1
  148. package/dist/sdk/runtime-primitives.js +3 -3
  149. package/dist/sdk/runtime.js +5 -3
  150. package/dist/sdk/schema-migration.js +4 -4
  151. package/dist/sdk/test/execution.js +4 -4
  152. package/dist/sdk/workspace-memory.js +4 -4
  153. package/dist/sdk/workspace-snapshot.js +8 -14
  154. package/dist/sdk/workspace-transaction-gc.js +4 -9
  155. package/dist/sdk/workspace-transaction.js +4 -4
  156. package/dist/sdk/workspace.js +4 -3
  157. package/docs/ASSURANCE.md +163 -3
  158. package/docs/COMMANDS.md +31 -2
  159. package/docs/CONFIGURATION.md +2 -0
  160. package/docs/EXTENSIONS.md +11 -12
  161. package/docs/READ_OUTPUT_CONTRACTS.md +44 -8
  162. package/docs/RELATIONSHIP_GRAPH.md +34 -4
  163. package/docs/SDK.md +29 -8
  164. package/docs/SDK_CONTEXT_INTEGRITY.md +32 -1
  165. package/docs/TESTING.md +47 -16
  166. package/docs/performance/sdk-entrypoint-import-costs.md +20 -13
  167. package/marketplace.json +2 -2
  168. package/package.json +6 -6
  169. package/packages/pm-beads/extensions/beads/index.ts +1 -0
  170. package/packages/pm-beads/package.json +1 -1
  171. package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
  172. package/packages/pm-calendar/package.json +1 -1
  173. package/packages/pm-command-kit/package.json +1 -1
  174. package/packages/pm-digital-twin/extensions/digital-twin/index.ts +7 -0
  175. package/packages/pm-digital-twin/package.json +1 -1
  176. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +4 -0
  177. package/packages/pm-governance-audit/package.json +1 -1
  178. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +5 -0
  179. package/packages/pm-guide-shell/package.json +1 -1
  180. package/packages/pm-kanban/package.json +1 -1
  181. package/packages/pm-lifecycle-hooks/package.json +1 -1
  182. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +6 -0
  183. package/packages/pm-linked-test-adapters/package.json +1 -1
  184. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -0
  185. package/packages/pm-search-advanced/package.json +1 -1
  186. package/packages/pm-templates/extensions/templates/index.ts +4 -0
  187. package/packages/pm-templates/package.json +1 -1
  188. package/packages/pm-todos/extensions/todos/index.ts +2 -0
  189. package/packages/pm-todos/package.json +1 -1
  190. package/packages/pm-vcs/extensions/vcs/index.ts +7 -0
  191. package/packages/pm-vcs/package.json +1 -1
  192. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  193. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  194. package/scripts/bundle-cli.mjs +17 -4
  195. package/sdk/public-surface.json +390 -60
  196. package/dist/cli-bundle/chunks/chunk-3PS7X6GS.js +0 -8
  197. package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +0 -13
  198. package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +0 -33
  199. package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +0 -196
  200. package/dist/cli-bundle/chunks/chunk-R76342NV.js +0 -2
  201. package/dist/cli-bundle/chunks/chunk-RBTK5EZV.js +0 -5
  202. package/dist/cli-bundle/chunks/chunk-VLUQOIDT.js +0 -2
  203. package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +0 -2
  204. package/dist/cli-bundle/focused-chunks/chunk-2DALMVF7.js +0 -5
  205. package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +0 -155
  206. package/dist/cli-bundle/focused-chunks/chunk-5TAGTDRE.js +0 -2
  207. package/dist/cli-bundle/focused-chunks/chunk-ECADZMVC.js +0 -18
  208. package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +0 -2
  209. package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +0 -16
  210. package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +0 -2
  211. package/dist/cli-bundle/focused-chunks/chunk-KPSXVBDV.js +0 -2
  212. package/dist/cli-bundle/focused-chunks/chunk-KTLOKKCQ.js +0 -2
  213. package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +0 -8
  214. package/dist/cli-bundle/focused-chunks/chunk-NBLUKITQ.js +0 -4
  215. package/dist/cli-bundle/focused-chunks/chunk-NYLOUPOB.js +0 -2
  216. package/dist/cli-bundle/focused-chunks/chunk-Q4T463SD.js +0 -31
  217. package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +0 -2
  218. package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +0 -17
@@ -1,5 +1,6 @@
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]="0203943b-16ea-5c3a-a2d3-56a0c4d2848f")}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]="9ec35c35-f2dc-5f86-a166-cf0c80eab1bd")}catch(e){}}();
3
+ import { resolveRecoveryCommandName } from "../sdk/agent/command-recovery.js";
3
4
  import { renderPmCommand } from "./argv-utils.js";
4
5
  import { discoverNearbyPmRoot } from "../sdk/tracker-root-discovery.js";
5
6
  /** Compact an error envelope to fields that change the caller's next action. */
@@ -341,12 +342,7 @@ function dedupeStrings(values) {
341
342
  return result;
342
343
  }
343
344
  function inferCommandNameFromRecovery(recovery) {
344
- const args = recovery?.normalized_args;
345
- if (!Array.isArray(args) || args.length === 0) {
346
- return undefined;
347
- }
348
- const firstCommandArg = args.find((arg) => arg.trim().length > 0 && !arg.startsWith("-"));
349
- return firstCommandArg?.trim();
345
+ return resolveRecoveryCommandName(recovery?.normalized_args);
350
346
  }
351
347
  function inferAllowedValuesFromMessage(message) {
352
348
  const match = message.match(/\bmust be one of:?\s+([A-Za-z0-9_.|,\- ]+)/i);
@@ -1201,4 +1197,4 @@ export const _testOnly = {
1201
1197
  resolveKnownPackageCommandHint,
1202
1198
  };
1203
1199
  //# sourceMappingURL=error-guidance.js.map
1204
- //# debugId=0203943b-16ea-5c3a-a2d3-56a0c4d2848f
1200
+ //# debugId=9ec35c35-f2dc-5f86-a166-cf0c80eab1bd
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]="6eb8f2a6-6096-54af-a3dc-eb15fdbe5999")}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]="c8924d43-556d-5041-9fe3-7c5c944531ae")}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";
@@ -27,7 +27,7 @@ import { loadExtensionRecoveryFailures, loadUnknownCommandRecoveryFailures } fro
27
27
  import { maybeRenderBootstrapJsonHelp, attachCreateUpdatePolicyHelpText } from "./help-json-payload.js";
28
28
  import { attachOutputTokenAccounting } from "../sdk/output-token-accounting.js";
29
29
  import { runWithDiscoveredContextIntentContracts } from "../sdk/context-intent-runtime.js";
30
- import { validateReadOutputOptions } from "../sdk/read-output-contracts.js";
30
+ import { applyReadOutputIncludeModes, validateReadOutputOptions } from "../sdk/read-output-contracts.js";
31
31
  import { loadContextIntentSnapshotForInvocation } from "./context-intent-invocation.js";
32
32
  import { isPmSuccessfulExitCode } from "../sdk/cli-contracts/command-exit-contracts.js";
33
33
  const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
@@ -499,6 +499,40 @@ async function handleGenericRunPmCliError(params) {
499
499
  }
500
500
  }
501
501
  }
502
+ /**
503
+ * Hand canonical `--output-include` projection modes to the command that owns
504
+ * them, leaving only field selectors for post-execution projection.
505
+ *
506
+ * `--output-include brief` must be the exact behaviour of `--brief`, which the
507
+ * emitted migration hint promises; a mode can only be honoured before the
508
+ * command computes its rows, so it cannot be resolved by the output layer.
509
+ */
510
+ function forwardReadOutputIncludeModes(actionCommand, commandPath, globalOptions, commandOptions) {
511
+ const requested = globalOptions.outputInclude;
512
+ if (requested === undefined)
513
+ return;
514
+ const modeOptions = {};
515
+ const { selectors, modes } = applyReadOutputIncludeModes(commandPath, requested, modeOptions);
516
+ if (modes.length === 0)
517
+ return;
518
+ for (const [key, value] of Object.entries(modeOptions)) {
519
+ commandOptions[key] = value;
520
+ actionCommand.setOptionValueWithSource(key, value, "cli");
521
+ }
522
+ const residual = selectors.length > 0 ? selectors.join(",") : undefined;
523
+ if (residual === undefined) {
524
+ delete globalOptions.outputInclude;
525
+ }
526
+ else {
527
+ globalOptions.outputInclude = residual;
528
+ }
529
+ // The resolved-global cache is cleared and re-read from Commander before the
530
+ // handler runs, so the consumed modes have to leave the parsed option too.
531
+ for (let scope = actionCommand; scope; scope = scope.parent) {
532
+ scope.setOptionValueWithSource("outputInclude", residual, "cli");
533
+ }
534
+ setResolvedGlobalOptions(actionCommand, globalOptions);
535
+ }
502
536
  function extractCommandScopedOptions(command, commandArgs, extensionFlagDefinitions = []) {
503
537
  const allOptions = command.optsWithGlobals();
504
538
  const scoped = { ...allOptions };
@@ -938,6 +972,7 @@ function hasGlobalExtensionContributions(contributions) {
938
972
  entriesOrEmpty(contributions.item_fields).length,
939
973
  entriesOrEmpty(contributions.relationship_kinds).length,
940
974
  entriesOrEmpty(contributions.service_overrides).length,
975
+ entriesOrEmpty(contributions.assurance_providers).length,
941
976
  entriesOrEmpty(contributions.renderer_overrides).length -
942
977
  entriesOrEmpty(contributions.renderer_ownership).length,
943
978
  ];
@@ -1564,6 +1599,7 @@ function attachProgramLifecycleHooks(rootProgram) {
1564
1599
  outputFormat: rawGlobalOptions.outputFormat,
1565
1600
  outputSession: rawGlobalOptions.outputSession,
1566
1601
  });
1602
+ forwardReadOutputIncludeModes(actionCommand, commandPath, globalOptions, commandOptions);
1567
1603
  await maybeRunFirstUseTelemetryPrompt(commandPath, globalOptions);
1568
1604
  const fallbackPmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
1569
1605
  const runtimeExtensions = await maybeLoadRuntimeExtensions(actionCommand);
@@ -1601,6 +1637,7 @@ function attachProgramLifecycleHooks(rootProgram) {
1601
1637
  setActiveExtensionRegistrations(runtimeExtensions.registrations);
1602
1638
  const extensionFlagDefinitions = collectExtensionFlagDefinitionsForInvocation(runtimeExtensions.registrations, commandPath, commandArgs);
1603
1639
  commandOptions = extractCommandScopedOptions(actionCommand, commandArgs, extensionFlagDefinitions);
1640
+ forwardReadOutputIncludeModes(actionCommand, commandPath, globalOptions, commandOptions);
1604
1641
  const parserOverride = await runActiveParserOverride({
1605
1642
  command: commandPath,
1606
1643
  args: commandArgs,
@@ -2474,4 +2511,4 @@ export const _testOnly = {
2474
2511
  wrapThrownErrorForSentry,
2475
2512
  };
2476
2513
  //# sourceMappingURL=main.js.map
2477
- //# debugId=6eb8f2a6-6096-54af-a3dc-eb15fdbe5999
2514
+ //# debugId=c8924d43-556d-5041-9fe3-7c5c944531ae
@@ -1,16 +1,21 @@
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]="1adbac08-0950-55be-82bf-cc4dc7b6ad18")}catch(e){}}();
3
- import { ASSURANCE_ACTIONS, ASSURANCE_DECLARATION_KINDS, runAssuranceAction, } from "../sdk/governance/assurance-action.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]="41d01430-1e95-5f09-9a2f-7e7f8fad8184")}catch(e){}}();
3
+ import { runAssuranceAction } from "../sdk/governance/assurance-action.js";
4
4
  import { printResult } from "../sdk/runtime-primitives.js";
5
5
  import { getGlobalOptions, readOptionString } from "./registration-helpers.js";
6
6
  async function runAssuranceCliAction(action, kindOrGate, id, options, command) {
7
7
  const global = getGlobalOptions(command);
8
8
  const isRun = action === "run";
9
9
  const isVerdicts = action === "verdicts";
10
+ const isPresetAction = action === "presets" || action === "apply";
11
+ const isPromote = action === "promote";
10
12
  const result = await runAssuranceAction({
11
13
  action,
12
- ...(isRun || isVerdicts ? {} : { kind: kindOrGate }),
13
- id: isRun || isVerdicts ? (id ?? kindOrGate) : id,
14
+ ...(isRun || isVerdicts || isPresetAction || isPromote
15
+ ? {}
16
+ : { kind: kindOrGate }),
17
+ id: isRun || isVerdicts || isPromote ? (id ?? kindOrGate) : id,
18
+ preset: isPresetAction ? (id ?? kindOrGate) : undefined,
14
19
  definition: readOptionString(options, "definition"),
15
20
  trigger: readOptionString(options, "trigger"),
16
21
  tree: readOptionString(options, "tree"),
@@ -21,6 +26,9 @@ async function runAssuranceCliAction(action, kindOrGate, id, options, command) {
21
26
  idOnly: global.idOnly,
22
27
  author: readOptionString(options, "author"),
23
28
  message: readOptionString(options, "message"),
29
+ owner: readOptionString(options, "owner"),
30
+ apply: options.apply === true,
31
+ enforcement: readOptionString(options, "enforcement"),
24
32
  }, global);
25
33
  printResult(result, global);
26
34
  if (typeof result === "object" &&
@@ -34,19 +42,22 @@ async function runAssuranceCliAction(action, kindOrGate, id, options, command) {
34
42
  export function registerAssuranceCommand(program) {
35
43
  program
36
44
  .command("assurance")
37
- .argument("<action>", `Action: ${ASSURANCE_ACTIONS.join(", ")}`)
38
- .argument("[kind]", `Declaration kind: ${ASSURANCE_DECLARATION_KINDS.join(", ")}; for run this may be the gate id`)
39
- .argument("[id]", "Declaration or gate id")
40
- .description("Declare and evaluate SDK-owned project assurance contracts.")
41
- .option("--definition <json>", "JSON declaration for put")
42
- .option("--trigger <value>", "Gate lifecycle trigger")
43
- .option("--tree <value>", "Commit, tree, or snapshot identity being judged")
44
- .option("--gate <id>", "Filter verdict history by gate id")
45
- .option("--limit <number>", "Maximum newest verdicts returned")
46
- .option("--dry-run", "Evaluate a gate without appending a verdict")
47
- .option("--author <value>", "Mutation author override")
48
- .option("--message <value>", "Audited mutation rationale")
45
+ .argument("<action>", "Action; inspect `pm contracts --command assurance`")
46
+ .argument("[kind]", "Declaration kind or run gate id")
47
+ .argument("[id]", "Declaration/gate id")
48
+ .description("Manage SDK-owned assurance contracts.")
49
+ .option("--definition <json>", "Put declaration JSON")
50
+ .option("--trigger <value>", "Gate trigger")
51
+ .option("--tree <value>", "Revision identity")
52
+ .option("--gate <id>", "Verdict gate filter")
53
+ .option("--limit <number>", "Verdict limit")
54
+ .option("--dry-run", "Evaluate without recording")
55
+ .option("--author <value>", "Mutation author")
56
+ .option("--message <value>", "Mutation rationale")
57
+ .option("--owner <item-id>", "Preset/derivation owner")
58
+ .option("--apply", "Persist derived proposals")
59
+ .option("--enforcement <level>", "Promote to warn or block")
49
60
  .action(runAssuranceCliAction);
50
61
  }
51
62
  //# sourceMappingURL=register-assurance.js.map
52
- //# debugId=1adbac08-0950-55be-82bf-cc4dc7b6ad18
63
+ //# debugId=41d01430-1e95-5f09-9a2f-7e7f8fad8184