@unbrained/pm-cli 2026.8.17 → 2026.8.18

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 (157) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +4 -3
  3. package/CHANGELOG.md +35 -3
  4. package/README.md +3 -3
  5. package/dist/cli/error-guidance.js +7 -4
  6. package/dist/cli/register-list-query.js +132 -51
  7. package/dist/cli-bundle/bundle-manifest.json +146 -146
  8. package/dist/cli-bundle/chunks/chunk-5UZZAJKR.js +3 -0
  9. package/dist/cli-bundle/chunks/{chunk-YM2YAMF7.js → chunk-ALDJGKAK.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-HBJAS566.js → chunk-BSK2IN3C.js} +2 -2
  11. package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +197 -0
  12. package/dist/cli-bundle/chunks/{chunk-JOKATURE.js → chunk-GNFAFIJI.js} +9 -9
  13. package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +35 -0
  14. package/dist/cli-bundle/chunks/{chunk-TPXZIBIV.js → chunk-PVRUN5ZS.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-7IBRGCHX.js → chunk-RZQTVMRQ.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +3 -0
  17. package/dist/cli-bundle/chunks/chunk-UYCLQVL2.js +13 -0
  18. package/dist/cli-bundle/chunks/{chunk-3UEGXBMR.js → chunk-YRGOLZA7.js} +58 -54
  19. package/dist/cli-bundle/chunks/register-list-query-I23LALEE.js +11 -0
  20. package/dist/cli-bundle/chunks/{register-mutation-4WBRPXLV.js → register-mutation-6YGU3GPH.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-operations-SSENDH5B.js → register-operations-4HTFC6J7.js} +2 -2
  22. package/dist/cli-bundle/chunks/{register-setup-DOSFBGKE.js → register-setup-PPPEF3SN.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +2 -0
  24. package/dist/cli-bundle/focused-chunks/{chunk-ZQPGZZWQ.js → chunk-3TKWMNKF.js} +3 -3
  25. package/dist/cli-bundle/focused-chunks/chunk-5AF3ZBNB.js +155 -0
  26. package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +2 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-SYZENPIT.js → chunk-EUEGXZ2A.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-XKAMP5OU.js → chunk-EX6MKP2X.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-CYFK5UPB.js → chunk-K43KKAFS.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-ATEY76SX.js → chunk-M62NO7EI.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-SALH6B6K.js → chunk-ODOVCP45.js} +5 -5
  32. package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +16 -0
  33. package/dist/cli-bundle/focused-chunks/chunk-TN4AE665.js +26 -0
  34. package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-UI6AJ5TD.js +4 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-MHPIL773.js → chunk-V5XTGLK7.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-KP2VQQVQ.js → chunk-WGHQVU6P.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +2 -0
  40. package/dist/cli-bundle/main.js +7 -7
  41. package/dist/cli-bundle/sdk-authoring.js +1 -1
  42. package/dist/cli-bundle/sdk-contracts.js +1 -1
  43. package/dist/cli-bundle/sdk-core.js +31 -31
  44. package/dist/cli-bundle/sdk-governance.js +1 -1
  45. package/dist/cli-bundle/sdk-graph.js +1 -1
  46. package/dist/cli-bundle/sdk-merge.js +32 -32
  47. package/dist/cli-bundle/sdk-query.js +1 -1
  48. package/dist/cli-bundle/sdk-runtime.js +1 -1
  49. package/dist/cli-bundle/sdk-testing.js +1 -1
  50. package/dist/cli-bundle/sdk.js +4 -4
  51. package/dist/core/config/nested-settings.js +8 -2
  52. package/dist/core/extensions/exporter-output-contract.d.ts +12 -0
  53. package/dist/core/extensions/exporter-output-contract.js +67 -0
  54. package/dist/core/extensions/extension-types.d.ts +36 -1
  55. package/dist/core/extensions/extension-types.js +2 -2
  56. package/dist/core/extensions/loader.js +35 -44
  57. package/dist/core/history/event-index.d.ts +5 -0
  58. package/dist/core/history/event-index.js +133 -27
  59. package/dist/core/sentry/helpers.js +3 -3
  60. package/dist/core/shared/constants.js +5 -2
  61. package/dist/core/store/settings-validator.d.ts +4 -0
  62. package/dist/core/store/settings-validator.js +3 -2
  63. package/dist/core/store/settings.js +8 -2
  64. package/dist/mcp/tool-definitions.js +12 -7
  65. package/dist/sdk/agent/refusal-reachability.js +4 -4
  66. package/dist/sdk/authoring.d.ts +1 -1
  67. package/dist/sdk/authoring.js +2 -2
  68. package/dist/sdk/cli-bootstrap.d.ts +2 -2
  69. package/dist/sdk/cli-bootstrap.js +4 -4
  70. package/dist/sdk/cli-contracts/command-aliases.d.ts +34 -2
  71. package/dist/sdk/cli-contracts/command-aliases.js +64 -13
  72. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
  73. package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
  74. package/dist/sdk/cli-contracts/flag-contracts.js +11 -7
  75. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +70 -0
  76. package/dist/sdk/cli-contracts/grammar-contracts.js +345 -0
  77. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -2
  78. package/dist/sdk/cli-contracts/runtime-contracts.js +61 -14
  79. package/dist/sdk/cli-contracts/tool-parameter-tables.js +7 -2
  80. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
  81. package/dist/sdk/cli-contracts/tool-schema.js +20 -11
  82. package/dist/sdk/cli-contracts.d.ts +2 -2
  83. package/dist/sdk/cli-contracts.js +4 -4
  84. package/dist/sdk/completion.js +13 -15
  85. package/dist/sdk/compose.d.ts +3 -3
  86. package/dist/sdk/compose.js +2 -2
  87. package/dist/sdk/contracts.d.ts +1 -0
  88. package/dist/sdk/contracts.js +3 -2
  89. package/dist/sdk/core.d.ts +1 -1
  90. package/dist/sdk/core.js +3 -3
  91. package/dist/sdk/environment/host-environment-errors.js +3 -3
  92. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +54 -14
  93. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +50 -14
  94. package/dist/sdk/guide-topics.js +5 -5
  95. package/dist/sdk/index.d.ts +4 -3
  96. package/dist/sdk/index.js +6 -5
  97. package/dist/sdk/init-agent-guidance.js +3 -3
  98. package/dist/sdk/mutation-events.d.ts +18 -2
  99. package/dist/sdk/mutation-events.js +59 -16
  100. package/dist/sdk/output.d.ts +44 -0
  101. package/dist/sdk/output.js +28 -2
  102. package/dist/sdk/query/complete-list.d.ts +94 -0
  103. package/dist/sdk/query/complete-list.js +173 -0
  104. package/dist/sdk/query/list.js +5 -2
  105. package/dist/sdk/query.d.ts +1 -0
  106. package/dist/sdk/query.js +3 -2
  107. package/dist/sdk/read-output-contracts.d.ts +2 -2
  108. package/dist/sdk/read-output-contracts.js +36 -9
  109. package/dist/sdk/runtime-extended-actions.js +10 -2
  110. package/dist/sdk/runtime.d.ts +8 -2
  111. package/dist/sdk/runtime.js +11 -8
  112. package/dist/types.d.ts +5 -0
  113. package/dist/types.js +2 -2
  114. package/docs/AGENT_GUIDE.md +25 -9
  115. package/docs/CLI_GRAMMAR.md +106 -0
  116. package/docs/COMMANDS.md +23 -23
  117. package/docs/ONBOARDING.md +4 -4
  118. package/docs/QUICKSTART.md +1 -1
  119. package/docs/README.md +2 -0
  120. package/docs/RELEASING.md +30 -6
  121. package/docs/SDK.md +36 -2
  122. package/docs/SDK_ARTIFACT_OUTPUT.md +72 -0
  123. package/docs/SDK_CONTEXT_COORDINATION.md +46 -12
  124. package/docs/agent-task-token-baseline.json +5 -5
  125. package/marketplace.json +2 -2
  126. package/package.json +3 -2
  127. package/packages/pm-beads/package.json +1 -1
  128. package/packages/pm-calendar/package.json +1 -1
  129. package/packages/pm-command-kit/package.json +1 -1
  130. package/packages/pm-digital-twin/package.json +1 -1
  131. package/packages/pm-governance-audit/package.json +1 -1
  132. package/packages/pm-guide-shell/package.json +1 -1
  133. package/packages/pm-kanban/package.json +1 -1
  134. package/packages/pm-lifecycle-hooks/package.json +1 -1
  135. package/packages/pm-linked-test-adapters/package.json +1 -1
  136. package/packages/pm-search-advanced/package.json +1 -1
  137. package/packages/pm-templates/package.json +1 -1
  138. package/packages/pm-todos/package.json +1 -1
  139. package/packages/pm-vcs/package.json +1 -1
  140. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  141. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  142. package/sdk/public-surface.json +652 -31
  143. package/dist/cli-bundle/chunks/chunk-2QLOXC3V.js +0 -3
  144. package/dist/cli-bundle/chunks/chunk-4JPYF536.js +0 -35
  145. package/dist/cli-bundle/chunks/chunk-6VDLG2FC.js +0 -13
  146. package/dist/cli-bundle/chunks/chunk-ION3E43Q.js +0 -197
  147. package/dist/cli-bundle/chunks/chunk-OAC5NIV4.js +0 -3
  148. package/dist/cli-bundle/chunks/register-list-query-Q7KII4G5.js +0 -10
  149. package/dist/cli-bundle/focused-chunks/chunk-267MUUS6.js +0 -16
  150. package/dist/cli-bundle/focused-chunks/chunk-2NNFLLNG.js +0 -2
  151. package/dist/cli-bundle/focused-chunks/chunk-2QSAKMIH.js +0 -2
  152. package/dist/cli-bundle/focused-chunks/chunk-BUCG4ZI2.js +0 -2
  153. package/dist/cli-bundle/focused-chunks/chunk-EHXIKD6K.js +0 -2
  154. package/dist/cli-bundle/focused-chunks/chunk-KGEXTMPG.js +0 -2
  155. package/dist/cli-bundle/focused-chunks/chunk-POEEAD2V.js +0 -4
  156. package/dist/cli-bundle/focused-chunks/chunk-XPIC53VA.js +0 -26
  157. package/dist/cli-bundle/focused-chunks/chunk-ZT2DJS27.js +0 -155
@@ -715,6 +715,39 @@ export interface ImportExportRegistrationOptions {
715
715
  /** Value that configures or reports flags for this contract. */
716
716
  flags?: FlagDefinition[];
717
717
  }
718
+ /**
719
+ * Declares where an exporter writes its artifact and whether the host may
720
+ * render the returned structured receipt after the exporter completes.
721
+ */
722
+ export type ExporterArtifactOutputContract = {
723
+ /** Stdout exclusively carries artifact bytes. */
724
+ channel: "stdout";
725
+ /** Stdout artifacts cannot opt back into host rendering. */
726
+ receipt?: "suppress";
727
+ /** Optional IANA media type describing the emitted artifact. */
728
+ media_type?: string;
729
+ } | {
730
+ /** The exporter writes its artifact to a file. */
731
+ channel: "file";
732
+ /** File exporters may render or suppress their bounded receipt. */
733
+ receipt?: "suppress" | "render";
734
+ /** Optional IANA media type describing the emitted artifact. */
735
+ media_type?: string;
736
+ };
737
+ /** Exporter command metadata plus its optional artifact-delivery contract. */
738
+ export interface ExporterRegistrationOptions extends ImportExportRegistrationOptions {
739
+ /** Declaration for artifact bytes and the host receipt. */
740
+ output?: ExporterArtifactOutputContract;
741
+ }
742
+ /** Fully normalized exporter artifact contract stored in inventories. */
743
+ export interface RegisteredExporterArtifactOutputContract {
744
+ /** Destination carrying the artifact bytes. */
745
+ channel: "stdout" | "file";
746
+ /** Explicit host receipt policy after normalization. */
747
+ receipt: "suppress" | "render";
748
+ /** Optional IANA media type describing the emitted artifact. */
749
+ media_type?: string;
750
+ }
718
751
  /** Restricts flag value type values accepted by command, SDK, and storage contracts. */
719
752
  export type FlagValueType = "string" | "number" | "boolean";
720
753
  /** Documents the flag definition payload exchanged by command, SDK, and package integrations. */
@@ -1288,6 +1321,8 @@ export interface RegisteredExtensionExporter {
1288
1321
  name: string;
1289
1322
  /** Value that configures or reports exporter for this contract. */
1290
1323
  exporter: string;
1324
+ /** Declared artifact channel and normalized receipt policy. */
1325
+ output?: RegisteredExporterArtifactOutputContract;
1291
1326
  }
1292
1327
  /** Documents the registered extension search provider payload exchanged by command, SDK, and package integrations. */
1293
1328
  export interface RegisteredExtensionSearchProvider {
@@ -1447,7 +1482,7 @@ export interface ExtensionApi {
1447
1482
  /** Value that configures or reports register importer for this contract. */
1448
1483
  registerImporter(name: string, importer: Importer, options?: ImportExportRegistrationOptions): void;
1449
1484
  /** Value that configures or reports register exporter for this contract. */
1450
- registerExporter(name: string, exporter: Exporter, options?: ImportExportRegistrationOptions): void;
1485
+ registerExporter(name: string, exporter: Exporter, options?: ExporterRegistrationOptions): void;
1451
1486
  /** Value that configures or reports register search provider for this contract. */
1452
1487
  registerSearchProvider(provider: SearchProviderDefinition): void;
1453
1488
  /** Value that configures or reports register vector store adapter for this contract. */
@@ -1,6 +1,6 @@
1
1
  /** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */
2
2
 
3
- !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]="294f3a0c-e74d-5963-b966-8a4443855ce3")}catch(e){}}();
3
+ !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]="a54549aa-2f6c-5092-a3eb-5b36ee698ea4")}catch(e){}}();
4
4
  export const KNOWN_EXTENSION_CAPABILITIES = [
5
5
  "commands",
6
6
  "renderers",
@@ -100,4 +100,4 @@ export function createDefaultExtensionGovernancePolicy() {
100
100
  };
101
101
  }
102
102
  //# sourceMappingURL=extension-types.js.map
103
- //# debugId=294f3a0c-e74d-5963-b966-8a4443855ce3
103
+ //# debugId=a54549aa-2f6c-5092-a3eb-5b36ee698ea4
@@ -4,12 +4,13 @@
4
4
  * Implements extension runtime contracts and governance for Loader.
5
5
  */
6
6
 
7
- !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]="c88047fc-2bbd-5781-96a8-01685c06fb33")}catch(e){}}();
7
+ !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]="cccce7c1-dd08-5c9f-a74e-e639536b9a6a")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { pathToFileURL } from "node:url";
11
11
  import { pathExists } from "../fs/fs-utils.js";
12
12
  import { isPathWithinDirectory } from "../fs/path-utils.js";
13
+ import { isHostOutputSuppressed, suppressHostOutput, } from "../output/output-control.js";
13
14
  import { resolvePmPackageRootFromModule } from "../packages/root.js";
14
15
  import { resolveGlobalPmRoot } from "../store/paths.js";
15
16
  import { asRecordLoose, resolveActivatablePropertyRecord, } from "../shared/primitives.js";
@@ -19,6 +20,7 @@ import { snapshotExtensionModuleGraph } from "./module-graph-snapshot.js";
19
20
  import { captureExtensionActivationRollback } from "./activation-transaction.js";
20
21
  import { collectPreflightCollisionWarnings, normalizePreflightOverride, } from "./preflight-ownership.js";
21
22
  import { assertCommandDefinitionMetadataStrings } from "./command-visibility-tier.js";
23
+ import { buildImportExportContext, resolveImportExportArtifactOutput, } from "./exporter-output-contract.js";
22
24
  import { asRegistrationRecord, assertOptionalBooleanField, assertOptionalFlagDefaultField, assertOptionalStringArrayField, assertOptionalStringField, normalizeOptionalStringArrayField, } from "./registration-validation.js";
23
25
  import { describeExtensionLongFlagFailure, findExtensionFlagTokenFailure, } from "./flag-definition-validation.js";
24
26
  import { compareComparableVersions, evaluatePmMaxVersionBound, evaluatePmMinVersionBound, parseComparableVersion, } from "./version-compat.js";
@@ -26,7 +28,7 @@ import { createRelationshipKindRegistry, } from "../../sdk/relationships.js";
26
28
  import { normalizeNames, isKnownExtensionCapability, collectUnknownExtensionCapabilities, normalizeManifestCapabilities, formatUnknownExtensionCapabilityWarning, formatLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
27
29
  import { normalizeExtensionPolicy, serializeExtensionPolicy, hydrateExtensionPolicy, normalizePolicySandboxProfile, evaluateExtensionPolicyForExtension, evaluateExtensionPolicyForCapability, evaluateExtensionPolicyForRegistration, } from "./extension-policy.js";
28
30
  import { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
29
- import { normalizeCommandName, cloneContextSnapshot, } from "./extension-runtime-helpers.js";
31
+ import { normalizeCommandName } from "./extension-runtime-helpers.js";
30
32
  import { normalizeExtensionContributionInventory } from "./contribution-inventory.js";
31
33
  import { formatExtensionManifestSchemaWarnings } from "./manifest-schema.js";
32
34
  import { attachRuntimeDefinition, assertHookHandler, assertNonEmptyRegistrationString, assertRegistrationFunction, cloneRuntimeRegistrationValue, createRegistrationValidationError, extractRegistrationValidationTrace, isExtensionServiceName, isOutputRendererFormat, normalizeRegistrationRecord, normalizeRegistrationRecordList, normalizeRuntimeRegistrationRecord, normalizeRegistrationName, sanitizeRegistrationValue, toRegistrationCommandPath, validateAssuranceMeasurementProviderDefinition, } from "./registration-values.js";
@@ -1727,6 +1729,23 @@ class ExtensionApiRegistrar {
1727
1729
  profile: applyProjectProfileDefaults(snapshot),
1728
1730
  });
1729
1731
  }
1732
+ /** Validates and records optional importer/exporter flag metadata through the schema policy gate. */
1733
+ registerImportExportCommandFlags(method, commandPath, resolvedOptions) {
1734
+ if (resolvedOptions.flags === undefined) {
1735
+ return;
1736
+ }
1737
+ assertExtensionCapability(this.#loadedExtension, "schema", `${method} options.flags`);
1738
+ if (!this.allowRegistration("schema.flags", `${method} options.flags`, "schema")) {
1739
+ return;
1740
+ }
1741
+ validateFlagDefinitions(resolvedOptions.flags);
1742
+ this.#registrationRegistry.flags.push({
1743
+ layer: this.#loadedExtension.layer,
1744
+ name: this.#loadedExtension.name,
1745
+ target_command: commandPath,
1746
+ flags: normalizeFlagDefinitions(`${method} options.flags`, resolvedOptions.flags),
1747
+ });
1748
+ }
1730
1749
  applyImportExportCommandMetadata(method, commandPath, options) {
1731
1750
  if (options !== undefined &&
1732
1751
  (typeof options !== "object" ||
@@ -1747,6 +1766,7 @@ class ExtensionApiRegistrar {
1747
1766
  description: options?.description ?? defaultDescription,
1748
1767
  arguments: options?.arguments ?? defaultArguments,
1749
1768
  };
1769
+ const output = resolveImportExportArtifactOutput(method, resolvedOptions, options?.description !== undefined);
1750
1770
  assertOptionalStringField(`${method} options.action`, resolvedOptions.action);
1751
1771
  assertOptionalStringField(`${method} options.description`, resolvedOptions.description);
1752
1772
  assertOptionalStringField(`${method} options.intent`, resolvedOptions.intent);
@@ -1754,20 +1774,7 @@ class ExtensionApiRegistrar {
1754
1774
  const examples = normalizeOptionalStringArrayField(`${method} options.examples`, resolvedOptions.examples);
1755
1775
  const failureHints = normalizeOptionalStringArrayField(`${method} options.failure_hints`, resolvedOptions.failure_hints);
1756
1776
  const argumentsDefinition = normalizeCommandDefinitionArguments(resolvedOptions.arguments);
1757
- if (resolvedOptions.flags !== undefined) {
1758
- assertExtensionCapability(this.#loadedExtension, "schema", `${method} options.flags`);
1759
- // Route metadata flags through the same surface-policy gate as registerFlags so
1760
- // enforce-mode policies blocking schema.flags are honored even when importers are allowed.
1761
- if (this.allowRegistration("schema.flags", `${method} options.flags`, "schema")) {
1762
- validateFlagDefinitions(resolvedOptions.flags);
1763
- this.#registrationRegistry.flags.push({
1764
- layer: this.#loadedExtension.layer,
1765
- name: this.#loadedExtension.name,
1766
- target_command: commandPath,
1767
- flags: normalizeFlagDefinitions(`${method} options.flags`, resolvedOptions.flags),
1768
- });
1769
- }
1770
- }
1777
+ this.registerImportExportCommandFlags(method, commandPath, resolvedOptions);
1771
1778
  const registration = {
1772
1779
  layer: this.#loadedExtension.layer,
1773
1780
  name: this.#loadedExtension.name,
@@ -1787,6 +1794,7 @@ class ExtensionApiRegistrar {
1787
1794
  registration.intent = intent;
1788
1795
  }
1789
1796
  this.#registrationRegistry.commands.push(registration);
1797
+ return output;
1790
1798
  }
1791
1799
  registerImporter(name, importer, options) {
1792
1800
  assertExtensionCapability(this.#loadedExtension, "importers", "registerImporter");
@@ -1808,19 +1816,7 @@ class ExtensionApiRegistrar {
1808
1816
  layer: this.#loadedExtension.layer,
1809
1817
  name: this.#loadedExtension.name,
1810
1818
  command: commandPath,
1811
- run: async (context) => importer({
1812
- registration: normalizedName,
1813
- action: "import",
1814
- command: context.command,
1815
- args: cloneContextSnapshot(context.args),
1816
- options: cloneContextSnapshot(context.options),
1817
- global: cloneContextSnapshot(context.global),
1818
- pm_root: context.pm_root,
1819
- source_workspace_root: context.source_workspace_root,
1820
- repo_root: context.repo_root,
1821
- pm_root_rel: context.pm_root_rel,
1822
- ...(context.sdk === undefined ? {} : { sdk: context.sdk }),
1823
- }),
1819
+ run: async (context) => importer(buildImportExportContext(context, normalizedName, "import")),
1824
1820
  });
1825
1821
  }
1826
1822
  registerExporter(name, exporter, options) {
@@ -1833,29 +1829,24 @@ class ExtensionApiRegistrar {
1833
1829
  const commandPath = toRegistrationCommandPath(normalizedName, "export");
1834
1830
  // Validate and register optional command metadata before mutating the registry
1835
1831
  // so an invalid options object leaves no partial exporter registration.
1836
- this.applyImportExportCommandMetadata("registerExporter", commandPath, options);
1832
+ const output = this.applyImportExportCommandMetadata("registerExporter", commandPath, options);
1837
1833
  this.#registrationRegistry.exporters.push({
1838
1834
  layer: this.#loadedExtension.layer,
1839
1835
  name: this.#loadedExtension.name,
1840
1836
  exporter: normalizedName,
1837
+ ...(output === undefined ? {} : { output }),
1841
1838
  });
1842
1839
  this.#commandRegistry.handlers.push({
1843
1840
  layer: this.#loadedExtension.layer,
1844
1841
  name: this.#loadedExtension.name,
1845
1842
  command: commandPath,
1846
- run: async (context) => exporter({
1847
- registration: normalizedName,
1848
- action: "export",
1849
- command: context.command,
1850
- args: cloneContextSnapshot(context.args),
1851
- options: cloneContextSnapshot(context.options),
1852
- global: cloneContextSnapshot(context.global),
1853
- pm_root: context.pm_root,
1854
- source_workspace_root: context.source_workspace_root,
1855
- repo_root: context.repo_root,
1856
- pm_root_rel: context.pm_root_rel,
1857
- ...(context.sdk === undefined ? {} : { sdk: context.sdk }),
1858
- }),
1843
+ run: async (context) => {
1844
+ const result = await exporter(buildImportExportContext(context, normalizedName, "export"));
1845
+ return output?.receipt === "suppress" &&
1846
+ !isHostOutputSuppressed(result)
1847
+ ? suppressHostOutput(result)
1848
+ : result;
1849
+ },
1859
1850
  });
1860
1851
  }
1861
1852
  registerSearchProvider(provider) {
@@ -2225,4 +2216,4 @@ export const _testOnlyLoader = {
2225
2216
  },
2226
2217
  };
2227
2218
  //# sourceMappingURL=loader.js.map
2228
- //# debugId=c88047fc-2bbd-5781-96a8-01685c06fb33
2219
+ //# debugId=cccce7c1-dd08-5c9f-a74e-e639536b9a6a
@@ -51,6 +51,11 @@ declare function loadDatabaseSync(loadModule: (specifier: string) => unknown): D
51
51
  declare function loadStableDatabaseSync(nodeVersion: string, loadModule: (specifier: string) => unknown): DatabaseSyncConstructor | null;
52
52
  /** Rebuild the complete optional event projection from authoritative streams. */
53
53
  export declare function rebuildHistoryEventIndex(pmRoot: string): Promise<boolean>;
54
+ /**
55
+ * Query authoritative history streams when the optional SQLite accelerator is
56
+ * unavailable. The result preserves the index contract at higher read cost.
57
+ */
58
+ export declare function queryHistoryEventStreams(pmRoot: string, query: HistoryEventIndexQuery): Promise<HistoryEventIndexQueryResult>;
54
59
  /**
55
60
  * Update an already-built event projection after one authoritative append.
56
61
  * Absence is a cheap no-op; corrupt projections are removed for lazy rebuild.
@@ -5,7 +5,7 @@
5
5
  * for cursor-resumable cross-item mutation event reads.
6
6
  */
7
7
 
8
- !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]="f1205949-16d8-51ce-98e8-04abc4c78ee8")}catch(e){}}();
8
+ !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]="a84b308f-7eef-535c-9531-b33b0775c651")}catch(e){}}();
9
9
  import fs from "node:fs/promises";
10
10
  import path from "node:path";
11
11
  import { randomUUID } from "node:crypto";
@@ -13,9 +13,76 @@ import { createRequire } from "node:module";
13
13
  import { readHistoryEntries } from "./read.js";
14
14
  const EVENT_INDEX_FILENAME = "history-event-index.sqlite";
15
15
  const EVENT_INDEX_VERSION = "2";
16
+ const AUTHORITATIVE_HISTORY_CACHE_LIMIT = 8;
17
+ const authoritativeHistoryCaches = new Map();
16
18
  function eventIndexPath(pmRoot) {
17
19
  return path.join(pmRoot, "runtime", EVENT_INDEX_FILENAME);
18
20
  }
21
+ async function readAuthoritativeHistoryEvents(pmRoot) {
22
+ const historyRoot = path.join(pmRoot, "history");
23
+ const entries = await fs
24
+ .readdir(historyRoot, { withFileTypes: true })
25
+ .catch((error) => {
26
+ if (typeof error === "object" &&
27
+ error !== null &&
28
+ "code" in error &&
29
+ error.code === "ENOENT") {
30
+ return [];
31
+ }
32
+ throw error;
33
+ });
34
+ const cached = authoritativeHistoryCaches.get(pmRoot) ?? {
35
+ streams: new Map(),
36
+ ordered_events: [],
37
+ };
38
+ const presentStreams = new Set();
39
+ let changed = !authoritativeHistoryCaches.has(pmRoot);
40
+ for (const historyFile of entries
41
+ .filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl"))
42
+ .sort((left, right) => left.name.localeCompare(right.name))) {
43
+ const streamId = historyFile.name.slice(0, -".jsonl".length);
44
+ presentStreams.add(streamId);
45
+ const historyPath = path.join(historyRoot, historyFile.name);
46
+ const stats = await fs.stat(historyPath, { bigint: true });
47
+ const signature = [
48
+ stats.dev,
49
+ stats.ino,
50
+ stats.size,
51
+ stats.mtimeNs,
52
+ stats.ctimeNs,
53
+ ].join(":");
54
+ if (cached.streams.get(streamId)?.signature === signature)
55
+ continue;
56
+ const history = await readHistoryEntries(historyPath, streamId);
57
+ cached.streams.set(streamId, {
58
+ signature,
59
+ events: history.map((entry, streamOffset) => ({
60
+ stream_id: streamId,
61
+ stream_offset: streamOffset,
62
+ entry,
63
+ })),
64
+ });
65
+ changed = true;
66
+ }
67
+ for (const streamId of cached.streams.keys()) {
68
+ if (!presentStreams.has(streamId)) {
69
+ cached.streams.delete(streamId);
70
+ changed = true;
71
+ }
72
+ }
73
+ if (changed) {
74
+ cached.ordered_events = [...cached.streams.values()]
75
+ .flatMap((stream) => stream.events)
76
+ .sort(compareHistoryEventPosition);
77
+ }
78
+ authoritativeHistoryCaches.delete(pmRoot);
79
+ authoritativeHistoryCaches.set(pmRoot, cached);
80
+ if (authoritativeHistoryCaches.size > AUTHORITATIVE_HISTORY_CACHE_LIMIT) {
81
+ const oldestRoot = authoritativeHistoryCaches.keys().next().value;
82
+ authoritativeHistoryCaches.delete(oldestRoot);
83
+ }
84
+ return cached.ordered_events;
85
+ }
19
86
  function loadDatabaseSync(loadModule) {
20
87
  try {
21
88
  const loaded = loadModule(["node", "sqlite"].join(":"));
@@ -85,21 +152,6 @@ export async function rebuildHistoryEventIndex(pmRoot) {
85
152
  const Database = resolveDatabaseSync();
86
153
  if (!Database)
87
154
  return false;
88
- const historyRoot = path.join(pmRoot, "history");
89
- const entries = await fs
90
- .readdir(historyRoot, { withFileTypes: true })
91
- .catch((error) => {
92
- if (typeof error === "object" &&
93
- error !== null &&
94
- "code" in error &&
95
- error.code === "ENOENT") {
96
- return [];
97
- }
98
- throw error;
99
- });
100
- const historyFiles = entries
101
- .filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl"))
102
- .sort((left, right) => left.name.localeCompare(right.name));
103
155
  const targetPath = eventIndexPath(pmRoot);
104
156
  await fs.mkdir(path.dirname(targetPath), { recursive: true });
105
157
  const temporaryPath = `${targetPath}.${randomUUID()}.tmp`;
@@ -108,16 +160,8 @@ export async function rebuildHistoryEventIndex(pmRoot) {
108
160
  database = new Database(temporaryPath);
109
161
  createSchema(database);
110
162
  database.exec("BEGIN IMMEDIATE");
111
- for (const historyFile of historyFiles) {
112
- const streamId = historyFile.name.slice(0, -".jsonl".length);
113
- const history = await readHistoryEntries(path.join(historyRoot, historyFile.name), streamId);
114
- for (const [streamOffset, entry] of history.entries()) {
115
- insertEvent(database, {
116
- stream_id: streamId,
117
- stream_offset: streamOffset,
118
- entry,
119
- });
120
- }
163
+ for (const event of await readAuthoritativeHistoryEvents(pmRoot)) {
164
+ insertEvent(database, event);
121
165
  }
122
166
  database.exec("COMMIT");
123
167
  database.close();
@@ -132,6 +176,68 @@ export async function rebuildHistoryEventIndex(pmRoot) {
132
176
  throw error;
133
177
  }
134
178
  }
179
+ function matchesSet(value, accepted) {
180
+ return !accepted || accepted.length === 0 || accepted.includes(value);
181
+ }
182
+ function compareHistoryEventPosition(left, right) {
183
+ return (left.entry.ts.localeCompare(right.entry.ts) ||
184
+ left.stream_id.localeCompare(right.stream_id) ||
185
+ left.stream_offset - right.stream_offset);
186
+ }
187
+ function isInsideHistoryEventWindow(event, query) {
188
+ if (query.after_ts !== undefined &&
189
+ query.after_stream_id !== undefined &&
190
+ query.after_stream_offset !== undefined) {
191
+ if (compareHistoryEventPosition(event, {
192
+ stream_id: query.after_stream_id,
193
+ stream_offset: query.after_stream_offset,
194
+ entry: { ...event.entry, ts: query.after_ts },
195
+ }) <= 0) {
196
+ return false;
197
+ }
198
+ }
199
+ else if (query.since_ts !== undefined &&
200
+ event.entry.ts < query.since_ts) {
201
+ return false;
202
+ }
203
+ return true;
204
+ }
205
+ function matchesHistoryEventHarness(event, query) {
206
+ if (!query.harnesses || query.harnesses.length === 0)
207
+ return true;
208
+ if (query.harnesses.includes(event.entry.agent_harness ?? ""))
209
+ return true;
210
+ return (event.entry.agent_harness === undefined &&
211
+ (query.harness_alias_authors ?? []).includes(event.entry.author));
212
+ }
213
+ function matchesHistoryEventQuery(event, query) {
214
+ if (!isInsideHistoryEventWindow(event, query) ||
215
+ !matchesSet(event.entry.op, query.ops) ||
216
+ !matchesSet(event.entry.author, query.authors) ||
217
+ !matchesSet(event.entry.agent_instance ?? "", query.agent_instances) ||
218
+ !matchesSet(event.stream_id, query.stream_ids) ||
219
+ !matchesHistoryEventHarness(event, query)) {
220
+ return false;
221
+ }
222
+ return (query.provenance ?? []).every((predicate) => {
223
+ const value = event.entry.agent_provenance?.[predicate.dimension]?.value;
224
+ return value !== undefined && predicate.values.includes(value);
225
+ });
226
+ }
227
+ /**
228
+ * Query authoritative history streams when the optional SQLite accelerator is
229
+ * unavailable. The result preserves the index contract at higher read cost.
230
+ */
231
+ export async function queryHistoryEventStreams(pmRoot, query) {
232
+ const limit = Math.max(0, Math.floor(query.limit));
233
+ const rows = (await readAuthoritativeHistoryEvents(pmRoot))
234
+ .filter((event) => matchesHistoryEventQuery(event, query))
235
+ .slice(0, limit + 1);
236
+ return {
237
+ events: rows.slice(0, query.limit),
238
+ has_more: rows.length > query.limit,
239
+ };
240
+ }
135
241
  /**
136
242
  * Update an already-built event projection after one authoritative append.
137
243
  * Absence is a cheap no-op; corrupt projections are removed for lazy rebuild.
@@ -268,4 +374,4 @@ export const _testOnly = {
268
374
  },
269
375
  };
270
376
  //# sourceMappingURL=event-index.js.map
271
- //# debugId=f1205949-16d8-51ce-98e8-04abc4c78ee8
377
+ //# debugId=a84b308f-7eef-535c-9531-b33b0775c651
@@ -4,7 +4,7 @@
4
4
  * Integrates Sentry instrumentation and release diagnostics for Helpers.
5
5
  */
6
6
 
7
- !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]="ffe56aed-b794-5bf4-99fd-e3c5fe065163")}catch(e){}}();
7
+ !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]="5e6ba316-b067-51df-abeb-c3e3488a504d")}catch(e){}}();
8
8
  import { getSentry } from "./instrument.js";
9
9
  import { PmCliError } from "../shared/errors.js";
10
10
  import { EXIT_CODE } from "../shared/constants.js";
@@ -236,7 +236,7 @@ export function shouldCaptureCliError(error) {
236
236
  }
237
237
  if (error instanceof Error &&
238
238
  error.name === "AbortError" &&
239
- /(?:ctrl\+c|sigint|user[- ]initiated)/i.test(error.message)) {
239
+ /(?:ctrl\+[cd]|sigint|user[- ]initiated)/i.test(error.message)) {
240
240
  return false;
241
241
  }
242
242
  if (typeof error === "object" &&
@@ -270,4 +270,4 @@ export async function sentryFlush(timeoutMs = 3000) {
270
270
  }
271
271
  }
272
272
  //# sourceMappingURL=helpers.js.map
273
- //# debugId=ffe56aed-b794-5bf4-99fd-e3c5fe065163
273
+ //# debugId=5e6ba316-b067-51df-abeb-c3e3488a504d
@@ -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]="36b908f0-ea19-5adc-8ccd-320ad3c3b1fe")}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]="45e1dcb9-d2d6-52d7-b0b0-a57556a3fb03")}catch(e){}}();
3
3
  import { createDefaultExtensionGovernancePolicy } from "../extensions/extension-types.js";
4
4
  /**
5
5
  * Canonical default lifecycle status model and workflow role mapping.
@@ -271,6 +271,9 @@ export const SETTINGS_DEFAULTS = {
271
271
  output: {
272
272
  default_format: "toon",
273
273
  },
274
+ ux: {
275
+ deprecation_hints: true,
276
+ },
274
277
  history: {
275
278
  missing_stream: "auto_create",
276
279
  compact_policy: {
@@ -477,4 +480,4 @@ export function resolveTelemetryErrorCategory(errorCode) {
477
480
  return "unknown";
478
481
  }
479
482
  //# sourceMappingURL=constants.js.map
480
- //# debugId=36b908f0-ea19-5adc-8ccd-320ad3c3b1fe
483
+ //# debugId=45e1dcb9-d2d6-52d7-b0b0-a57556a3fb03
@@ -35,6 +35,10 @@ export interface ParsedSettings {
35
35
  output: {
36
36
  default_format: "toon" | "json";
37
37
  };
38
+ /** Agent and human interaction preferences. */
39
+ ux?: {
40
+ deprecation_hints?: boolean;
41
+ };
38
42
  /** Value that configures or reports history for this contract. */
39
43
  history?: {
40
44
  missing_stream: "auto_create" | "strict_error";
@@ -12,7 +12,7 @@
12
12
  * byte-identical to the previous implementation.
13
13
  */
14
14
 
15
- !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]="027f6acb-15cc-5707-85ed-b5298b6b6abe")}catch(e){}}();
15
+ !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]="8883f930-193e-5133-835a-f15b1b62f6be")}catch(e){}}();
16
16
  import { GOVERNANCE_PRESET_VALUES, RUNTIME_FIELD_COMMAND_VALUES, RUNTIME_FIELD_TYPE_VALUES, RUNTIME_STATUS_ROLE_VALUES, RUNTIME_UNKNOWN_FIELD_POLICY_VALUES, } from "../../types.js";
17
17
  // Generic over `never` so it is assignable to every `Outcome<T>`.
18
18
  const FAIL = { ok: false };
@@ -304,6 +304,7 @@ const settingsCheck = vObject({
304
304
  retention_days: vOptional(vNumber({ int: true, positive: true })),
305
305
  })),
306
306
  output: vObject({ default_format: vLiteral("toon", "json") }),
307
+ ux: vOptional(vObject({ deprecation_hints: vOptional(vBoolean) })),
307
308
  history: vOptional(vObject({
308
309
  missing_stream: vLiteral("auto_create", "strict_error"),
309
310
  compact_policy: vOptional(vObject({
@@ -414,4 +415,4 @@ export function validateSettings(raw) {
414
415
  return { success: true, data: result.value };
415
416
  }
416
417
  //# sourceMappingURL=settings-validator.js.map
417
- //# debugId=027f6acb-15cc-5707-85ed-b5298b6b6abe
418
+ //# debugId=8883f930-193e-5133-835a-f15b1b62f6be
@@ -4,7 +4,7 @@
4
4
  * Reads and writes tracker storage with format-aware helpers for Settings.
5
5
  */
6
6
 
7
- !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]="a434b9ea-4692-51c5-8761-0f1759fff394")}catch(e){}}();
7
+ !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]="67bf189e-e816-536d-9051-589a2e468423")}catch(e){}}();
8
8
  import { validateSettings } from "./settings-validator.js";
9
9
  import { runActiveOnReadHooks, runActiveOnWriteHooks, } from "../extensions/index.js";
10
10
  import { GOVERNANCE_PRESET_DEFAULTS, SETTINGS_DEFAULTS, } from "../shared/constants.js";
@@ -710,6 +710,7 @@ function mergeSettings(settings) {
710
710
  },
711
711
  checkpoints: { ...defaults.checkpoints, ...settings.checkpoints },
712
712
  output: { ...defaults.output, ...settings.output },
713
+ ux: { ...defaults.ux, ...settings.ux },
713
714
  history: {
714
715
  ...defaults.history,
715
716
  ...settings.history,
@@ -777,6 +778,9 @@ function orderSerializedSettingsSections(ordered) {
777
778
  ordered.output = orderObject(ordered.output, [
778
779
  "default_format",
779
780
  ]);
781
+ ordered.ux = orderObject(ordered.ux, [
782
+ "deprecation_hints",
783
+ ]);
780
784
  ordered.history = orderObject(ordered.history, [
781
785
  "missing_stream",
782
786
  "compact_policy",
@@ -934,6 +938,7 @@ function buildSerializeBaseSettings(settings) {
934
938
  mutation_guard: valueOrDefault(settings.mutation_guard, SETTINGS_DEFAULTS.mutation_guard),
935
939
  checkpoints: valueOrDefault(settings.checkpoints, SETTINGS_DEFAULTS.checkpoints),
936
940
  output: valueOrDefault(settings.output, SETTINGS_DEFAULTS.output),
941
+ ux: valueOrDefault(settings.ux, SETTINGS_DEFAULTS.ux),
937
942
  history: valueOrDefault(settings.history, SETTINGS_DEFAULTS.history),
938
943
  validation: valueOrDefault(settings.validation, SETTINGS_DEFAULTS.validation),
939
944
  workflow: valueOrDefault(settings.workflow, SETTINGS_DEFAULTS.workflow),
@@ -1084,6 +1089,7 @@ const SETTINGS_TOP_LEVEL_KEY_ORDER = [
1084
1089
  "locks",
1085
1090
  "checkpoints",
1086
1091
  "output",
1092
+ "ux",
1087
1093
  "history",
1088
1094
  "validation",
1089
1095
  "governance",
@@ -1298,4 +1304,4 @@ export const settingsStoreTestOnly = {
1298
1304
  selectedSettingsReadCacheSignaturesEqual,
1299
1305
  };
1300
1306
  //# sourceMappingURL=settings.js.map
1301
- //# debugId=a434b9ea-4692-51c5-8761-0f1759fff394
1307
+ //# debugId=67bf189e-e816-536d-9051-589a2e468423
@@ -4,8 +4,8 @@
4
4
  * Defines the Tool Definitions module for pm CLI source.
5
5
  */
6
6
 
7
- !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]="d440a41a-ae54-55fd-b939-5404a1edcdd7")}catch(e){}}();
8
- import { GRAPH_SUBCOMMAND_VALUES, PM_TOOL_ACTIONS, } from "../sdk/cli-contracts/enum-contracts.js";
7
+ !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]="90896fb6-ee3e-575d-b103-bbc1a83c6672")}catch(e){}}();
8
+ import { GRAPH_SUBCOMMAND_VALUES, PM_DISCOVERABLE_TOOL_ACTIONS, } from "../sdk/cli-contracts/enum-contracts.js";
9
9
  import { buildPmActionToolInputSchema } from "../sdk/cli-contracts/tool-schema.js";
10
10
  import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
11
11
  const CANONICAL_OUTPUT_SESSION_TOOL_PROPERTY = buildPmActionToolInputSchema("list").properties.outputSession;
@@ -65,9 +65,9 @@ const idSchema = {
65
65
  description: "pm item id, for example pm-abc1.",
66
66
  };
67
67
  // pm-fd8n: derive the pm_run action enumeration from the canonical
68
- // PM_TOOL_ACTIONS contract instead of a hand-maintained prose list, so the
68
+ // PM_DISCOVERABLE_TOOL_ACTIONS contract instead of a hand-maintained prose list, so the
69
69
  // MCP-facing description can never drift from the actual supported actions.
70
- const PM_RUN_ACTION_DESCRIPTION = `Operation name (one of): ${PM_TOOL_ACTIONS.join(", ")}. ` +
70
+ const PM_RUN_ACTION_DESCRIPTION = `Operation name (one of): ${PM_DISCOVERABLE_TOOL_ACTIONS.join(", ")}. ` +
71
71
  "Package-owned actions are available dynamically when their provider package is installed.";
72
72
  const LIST_TOP_LEVEL_OPTION_PROPERTIES = {
73
73
  status: { type: "string", description: "Alias for options.status." },
@@ -111,7 +111,7 @@ const RAW_TOOLS = [
111
111
  inputSchema: objectSchema({
112
112
  action: {
113
113
  type: "string",
114
- enum: [...PM_TOOL_ACTIONS],
114
+ enum: [...PM_DISCOVERABLE_TOOL_ACTIONS],
115
115
  description: PM_RUN_ACTION_DESCRIPTION,
116
116
  },
117
117
  id: idSchema,
@@ -209,7 +209,7 @@ const RAW_TOOLS = [
209
209
  },
210
210
  {
211
211
  name: "pm_events",
212
- description: "Read a bounded, cursor-resumable page of committed mutation events across item history streams.",
212
+ description: "Read a bounded, cursor-resumable page of committed mutation events across item history streams. Batch cursors are the token-efficient default; pass cursorMode=row for per-event checkpoints.",
213
213
  inputSchema: objectSchema({
214
214
  since: {
215
215
  type: "string",
@@ -235,6 +235,11 @@ const RAW_TOOLS = [
235
235
  },
236
236
  limit: { type: "integer", minimum: 0, maximum: 1000 },
237
237
  full: { type: "boolean" },
238
+ cursorMode: {
239
+ type: "string",
240
+ enum: ["batch", "row"],
241
+ description: "Cursor framing: batch returns one terminal next_cursor (default); row also adds a cursor to every event.",
242
+ },
238
243
  }),
239
244
  },
240
245
  {
@@ -743,4 +748,4 @@ export function buildMcpToolContracts() {
743
748
  }).sort((left, right) => left.name.localeCompare(right.name));
744
749
  }
745
750
  //# sourceMappingURL=tool-definitions.js.map
746
- //# debugId=d440a41a-ae54-55fd-b939-5404a1edcdd7
751
+ //# debugId=90896fb6-ee3e-575d-b103-bbc1a83c6672