@unbrained/pm-cli 2026.8.12 → 2026.8.13

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 (173) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +22 -0
  3. package/dist/cli/error-guidance.js +4 -8
  4. package/dist/cli/main.js +3 -2
  5. package/dist/cli/register-assurance.js +28 -17
  6. package/dist/cli-bundle/bundle-manifest.json +161 -161
  7. package/dist/cli-bundle/chunks/chunk-3ZMOWAFM.js +2 -0
  8. package/dist/cli-bundle/chunks/chunk-DEDU3DG7.js +196 -0
  9. package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +13 -0
  10. package/dist/cli-bundle/chunks/chunk-F7FJYGK3.js +8 -0
  11. package/dist/cli-bundle/chunks/{chunk-RBTK5EZV.js → chunk-HIUZVCMN.js} +2 -2
  12. package/dist/cli-bundle/chunks/chunk-IMGIN7R6.js +2 -0
  13. package/dist/cli-bundle/chunks/{chunk-WLAHPSOX.js → chunk-Q47C67TQ.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-BM5YJ2UW.js → chunk-QGTUPEU5.js} +52 -52
  15. package/dist/cli-bundle/chunks/chunk-TF3TPKPR.js +34 -0
  16. package/dist/cli-bundle/chunks/{chunk-KOQMGCTA.js → chunk-YLBAPY22.js} +50 -50
  17. package/dist/cli-bundle/chunks/{register-list-query-XPCJRUUD.js → register-list-query-4HIZ7EA3.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-mutation-4RJCBKRS.js → register-mutation-W64FZ5HN.js} +2 -2
  19. package/dist/cli-bundle/chunks/register-operations-C44ET7R5.js +2 -0
  20. package/dist/cli-bundle/chunks/{register-setup-LLHAKP2V.js → register-setup-634MFRXU.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +31 -0
  22. package/dist/cli-bundle/focused-chunks/{chunk-YIAXMC3T.js → chunk-2JP7W7GO.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/chunk-2RI2FESN.js +4 -0
  24. package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +8 -0
  25. package/dist/cli-bundle/focused-chunks/{chunk-KHM2CS2C.js → chunk-3DJSGWVB.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-2DALMVF7.js → chunk-6MLIRBLV.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +155 -0
  28. package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/{chunk-RWPAWUOT.js → chunk-E3AVJ655.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-5TAGTDRE.js → chunk-EBTNSFYE.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-KPSXVBDV.js → chunk-HC2OL2H2.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-GQW4BPUT.js → chunk-I75MANL7.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-ZMGWAYH7.js → chunk-IIS2FRKL.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-NFHFZH2Z.js +2 -0
  35. package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +17 -0
  36. package/dist/cli-bundle/focused-chunks/{chunk-JAFRIWVF.js → chunk-OOYYKQWX.js} +4 -4
  37. package/dist/cli-bundle/focused-chunks/{chunk-KTLOKKCQ.js → chunk-PKPOZXLL.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/chunk-QDZUABWL.js +2 -0
  39. package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +16 -0
  40. package/dist/cli-bundle/focused-chunks/{chunk-NYLOUPOB.js → chunk-TEZIXMTH.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +18 -0
  42. package/dist/cli-bundle/main.js +13 -13
  43. package/dist/cli-bundle/sdk-authoring.js +1 -1
  44. package/dist/cli-bundle/sdk-contracts.js +1 -1
  45. package/dist/cli-bundle/sdk-core.js +42 -41
  46. package/dist/cli-bundle/sdk-governance.js +1 -1
  47. package/dist/cli-bundle/sdk-graph.js +1 -1
  48. package/dist/cli-bundle/sdk-merge.js +1 -1
  49. package/dist/cli-bundle/sdk-query.js +1 -1
  50. package/dist/cli-bundle/sdk-runtime.js +1 -1
  51. package/dist/cli-bundle/sdk-testing.js +1 -1
  52. package/dist/cli-bundle/sdk.js +2 -2
  53. package/dist/core/checkpoint/checkpoint-gc.js +7 -12
  54. package/dist/core/extensions/activation-summary-markdown.js +5 -4
  55. package/dist/core/extensions/activation-summary.d.ts +2 -0
  56. package/dist/core/extensions/activation-summary.js +6 -2
  57. package/dist/core/extensions/capability-usage.d.ts +1 -1
  58. package/dist/core/extensions/capability-usage.js +4 -3
  59. package/dist/core/extensions/contribution-inventory.d.ts +1 -0
  60. package/dist/core/extensions/contribution-inventory.js +6 -2
  61. package/dist/core/extensions/extension-registries.js +3 -2
  62. package/dist/core/extensions/extension-types.d.ts +83 -1
  63. package/dist/core/extensions/extension-types.js +3 -2
  64. package/dist/core/extensions/loader.d.ts +2 -8
  65. package/dist/core/extensions/loader.js +53 -144
  66. package/dist/core/extensions/registration-values.d.ts +43 -0
  67. package/dist/core/extensions/registration-values.js +210 -0
  68. package/dist/core/extensions/runtime-registrations.d.ts +3 -1
  69. package/dist/core/extensions/runtime-registrations.js +12 -2
  70. package/dist/core/fs/fs-utils.d.ts +2 -0
  71. package/dist/core/fs/fs-utils.js +7 -3
  72. package/dist/core/history/drift-cache.js +4 -3
  73. package/dist/core/history/drift-scan.js +5 -11
  74. package/dist/core/lock/lock-gc.js +8 -13
  75. package/dist/core/lock/lock.js +5 -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/schemas/assurance-definition.d.ts +32 -0
  87. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +25 -2
  88. package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -5
  89. package/dist/sdk/cli-contracts/tool-schema.js +17 -2
  90. package/dist/sdk/comments.js +4 -3
  91. package/dist/sdk/compile-cache.js +4 -3
  92. package/dist/sdk/compose.d.ts +3 -1
  93. package/dist/sdk/compose.js +16 -2
  94. package/dist/sdk/context-signal-store.js +4 -3
  95. package/dist/sdk/extension/install-runtime.js +4 -4
  96. package/dist/sdk/extension/managed-state.js +4 -3
  97. package/dist/sdk/extension-contracts.d.ts +1 -1
  98. package/dist/sdk/flag-invocation-contracts.js +5 -6
  99. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +14 -2
  100. package/dist/sdk/governance/assurance-action.d.ts +27 -3
  101. package/dist/sdk/governance/assurance-action.js +112 -28
  102. package/dist/sdk/governance/assurance-mutation-error.d.ts +7 -0
  103. package/dist/sdk/governance/assurance-mutation-error.js +25 -2
  104. package/dist/sdk/governance/assurance-presets.d.ts +54 -0
  105. package/dist/sdk/governance/assurance-presets.js +136 -0
  106. package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
  107. package/dist/sdk/governance/assurance-runtime.js +109 -8
  108. package/dist/sdk/governance/assurance.d.ts +39 -0
  109. package/dist/sdk/governance/assurance.js +143 -4
  110. package/dist/sdk/governance/gc.js +5 -11
  111. package/dist/sdk/governance/health.js +5 -5
  112. package/dist/sdk/governance/validate.js +4 -4
  113. package/dist/sdk/graph/durable-cache.js +61 -3
  114. package/dist/sdk/graph/governance-contracts.d.ts +12 -0
  115. package/dist/sdk/graph/governance-contracts.js +27 -0
  116. package/dist/sdk/graph/governance.d.ts +30 -2
  117. package/dist/sdk/graph/governance.js +124 -5
  118. package/dist/sdk/guide.js +4 -4
  119. package/dist/sdk/index.d.ts +2 -1
  120. package/dist/sdk/index.js +4 -3
  121. package/dist/sdk/linked-artifacts.d.ts +2 -0
  122. package/dist/sdk/linked-artifacts.js +29 -4
  123. package/dist/sdk/merge/install.js +5 -4
  124. package/dist/sdk/query/activity.js +4 -3
  125. package/dist/sdk/relationship-history.js +5 -5
  126. package/dist/sdk/schema-migration.js +4 -4
  127. package/dist/sdk/test/execution.js +4 -4
  128. package/dist/sdk/workspace-memory.js +4 -4
  129. package/dist/sdk/workspace-snapshot.js +8 -14
  130. package/dist/sdk/workspace-transaction-gc.js +4 -9
  131. package/dist/sdk/workspace-transaction.js +4 -4
  132. package/dist/sdk/workspace.js +4 -3
  133. package/docs/ASSURANCE.md +154 -3
  134. package/docs/CONFIGURATION.md +2 -0
  135. package/docs/EXTENSIONS.md +11 -12
  136. package/docs/RELATIONSHIP_GRAPH.md +15 -0
  137. package/docs/SDK.md +17 -3
  138. package/docs/TESTING.md +24 -15
  139. package/marketplace.json +2 -2
  140. package/package.json +3 -3
  141. package/packages/pm-beads/package.json +1 -1
  142. package/packages/pm-calendar/package.json +1 -1
  143. package/packages/pm-command-kit/package.json +1 -1
  144. package/packages/pm-digital-twin/package.json +1 -1
  145. package/packages/pm-governance-audit/package.json +1 -1
  146. package/packages/pm-guide-shell/package.json +1 -1
  147. package/packages/pm-kanban/package.json +1 -1
  148. package/packages/pm-lifecycle-hooks/package.json +1 -1
  149. package/packages/pm-linked-test-adapters/package.json +1 -1
  150. package/packages/pm-search-advanced/package.json +1 -1
  151. package/packages/pm-templates/package.json +1 -1
  152. package/packages/pm-todos/package.json +1 -1
  153. package/packages/pm-vcs/package.json +1 -1
  154. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  155. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  156. package/sdk/public-surface.json +183 -33
  157. package/dist/cli-bundle/chunks/chunk-3PS7X6GS.js +0 -8
  158. package/dist/cli-bundle/chunks/chunk-7KL6KMWF.js +0 -13
  159. package/dist/cli-bundle/chunks/chunk-D55A5AEN.js +0 -33
  160. package/dist/cli-bundle/chunks/chunk-KIKDWECH.js +0 -196
  161. package/dist/cli-bundle/chunks/chunk-R76342NV.js +0 -2
  162. package/dist/cli-bundle/chunks/chunk-VLUQOIDT.js +0 -2
  163. package/dist/cli-bundle/chunks/register-operations-2OGISOVR.js +0 -2
  164. package/dist/cli-bundle/focused-chunks/chunk-5OQIMELN.js +0 -155
  165. package/dist/cli-bundle/focused-chunks/chunk-ECADZMVC.js +0 -18
  166. package/dist/cli-bundle/focused-chunks/chunk-EJGXRA6B.js +0 -2
  167. package/dist/cli-bundle/focused-chunks/chunk-FFGSZCPK.js +0 -16
  168. package/dist/cli-bundle/focused-chunks/chunk-ISKOBJCM.js +0 -2
  169. package/dist/cli-bundle/focused-chunks/chunk-LGYK3NUF.js +0 -8
  170. package/dist/cli-bundle/focused-chunks/chunk-NBLUKITQ.js +0 -4
  171. package/dist/cli-bundle/focused-chunks/chunk-Q4T463SD.js +0 -31
  172. package/dist/cli-bundle/focused-chunks/chunk-QVZVY53N.js +0 -2
  173. package/dist/cli-bundle/focused-chunks/chunk-UTEWXDEQ.js +0 -17
@@ -4,7 +4,7 @@
4
4
  * Validates and canonicalizes the serializable extension surface inventory.
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]="2c4e3831-6644-5db3-a28b-1c6a131da2e1")}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]="f7c79f37-1cae-59c9-b500-eb87d0089f94")}catch(e){}}();
8
8
  import { normalizeCommandName } from "./extension-runtime-helpers.js";
9
9
  const COMMAND_PATH_FIELDS = new Set([
10
10
  "commands",
@@ -28,6 +28,7 @@ const STRING_LIST_FIELDS = [
28
28
  "exporters",
29
29
  "search_providers",
30
30
  "vector_store_adapters",
31
+ "assurance_providers",
31
32
  "parser_overrides",
32
33
  "service_overrides",
33
34
  "renderer_overrides",
@@ -154,6 +155,9 @@ export function createExtensionContributionInventory(summary) {
154
155
  exporters: summary.exporters,
155
156
  search_providers: summary.search_providers,
156
157
  vector_store_adapters: summary.vector_store_adapters,
158
+ ...(summary.assurance_providers
159
+ ? { assurance_providers: summary.assurance_providers }
160
+ : {}),
157
161
  parser_overrides: summary.parser_overrides,
158
162
  service_overrides: summary.service_overrides,
159
163
  renderer_overrides: summary.renderer_overrides,
@@ -167,4 +171,4 @@ export function createExtensionContributionInventory(summary) {
167
171
  };
168
172
  }
169
173
  //# sourceMappingURL=contribution-inventory.js.map
170
- //# debugId=2c4e3831-6644-5db3-a28b-1c6a131da2e1
174
+ //# debugId=f7c79f37-1cae-59c9-b500-eb87d0089f94
@@ -1,6 +1,6 @@
1
1
  /** Implements create empty extension hook registry for the public runtime surface of this module. */
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]="baa8b608-7f1e-5382-abe3-b1af79e46da4")}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]="48fff41d-2667-50a1-bfbb-40908804babd")}catch(e){}}();
4
4
  export function createEmptyExtensionHookRegistry() {
5
5
  return {
6
6
  beforeCommand: [],
@@ -56,7 +56,8 @@ export function createEmptyExtensionRegistrationRegistry() {
56
56
  exporters: [],
57
57
  search_providers: [],
58
58
  vector_store_adapters: [],
59
+ assurance_providers: [],
59
60
  };
60
61
  }
61
62
  //# sourceMappingURL=extension-registries.js.map
62
- //# debugId=baa8b608-7f1e-5382-abe3-b1af79e46da4
63
+ //# debugId=48fff41d-2667-50a1-bfbb-40908804babd
@@ -55,7 +55,7 @@ export interface PmMaxVersionExceededModeByLayer {
55
55
  /** Settings value for `extensions.policy.pm_max_version_exceeded_mode`: either a single mode applied to both layers, or a per-layer override map. Unset (and any unset layer key) defaults to `"block"`. */
56
56
  export type PmMaxVersionExceededModeSetting = PmMaxVersionExceededMode | PmMaxVersionExceededModeByLayer;
57
57
  /** Public contract for known extension policy surfaces, shared by SDK and presentation-layer consumers. */
58
- export declare const KNOWN_EXTENSION_POLICY_SURFACES: readonly ["commands.override", "commands.handler", "hooks.beforecommand", "hooks.beforemutation", "hooks.aftercommand", "hooks.onwrite", "hooks.onread", "hooks.onindex", "schema.flags", "schema.itemfields", "schema.itemtypes", "schema.relationshipkinds", "schema.migrations", "schema.profiles", "parser.override", "preflight.override", "services.override", "renderers.override", "importers.importer", "importers.exporter", "search.provider", "search.vectorstore"];
58
+ export declare const KNOWN_EXTENSION_POLICY_SURFACES: readonly ["commands.override", "commands.handler", "hooks.beforecommand", "hooks.beforemutation", "hooks.aftercommand", "hooks.onwrite", "hooks.onread", "hooks.onindex", "schema.flags", "schema.itemfields", "schema.itemtypes", "schema.relationshipkinds", "schema.migrations", "schema.profiles", "parser.override", "preflight.override", "services.override", "renderers.override", "importers.importer", "importers.exporter", "search.provider", "search.vectorstore", "services.assuranceprovider"];
59
59
  /** Restricts extension policy surface values accepted by command, SDK, and storage contracts. */
60
60
  export type ExtensionPolicySurface = (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];
61
61
  /** Public contract for known extension service names, shared by SDK and presentation-layer consumers. */
@@ -145,6 +145,8 @@ export interface ExtensionContributionInventory {
145
145
  search_providers?: string[];
146
146
  /** Declared vector-store adapter names. */
147
147
  vector_store_adapters?: string[];
148
+ /** Declared assurance measurement-provider ids. */
149
+ assurance_providers?: string[];
148
150
  /** Parser override command targets. */
149
151
  parser_overrides?: string[];
150
152
  /** Service override targets. */
@@ -1039,6 +1041,65 @@ export interface VectorStoreAdapterDefinition {
1039
1041
  delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;
1040
1042
  [key: string]: unknown;
1041
1043
  }
1044
+ /** Cost classes let lifecycle gates reject expensive provider work before invoking it. */
1045
+ export type AssuranceMeasurementProviderCostClass = "low" | "medium" | "high";
1046
+ /** JSON-compatible parameter contract for one provider measurement key. */
1047
+ export interface AssuranceMeasurementProviderParameterDefinition {
1048
+ /** Parameter value kind. */
1049
+ type: "string" | "number" | "boolean";
1050
+ /** Whether callers must supply the parameter. */
1051
+ required?: boolean;
1052
+ /** Human-readable parameter intent. */
1053
+ description?: string;
1054
+ }
1055
+ /** Serializable schema for one measurement key owned by a provider. */
1056
+ export interface AssuranceMeasurementProviderKeyDefinition {
1057
+ /** Value kind returned by the resolver. */
1058
+ value_type: "number" | "string_set";
1059
+ /** Human-readable metric intent. */
1060
+ description?: string;
1061
+ /** Accepted provider parameters. Unknown parameters are rejected. */
1062
+ parameters?: Record<string, AssuranceMeasurementProviderParameterDefinition>;
1063
+ }
1064
+ /** Runtime request supplied to an extension-owned assurance provider. */
1065
+ export interface AssuranceMeasurementProviderContext extends PortableWorkspaceContext {
1066
+ /** Provider id selected by the measurement declaration. */
1067
+ provider: string;
1068
+ /** Provider-owned metric key. */
1069
+ key: string;
1070
+ /** Validated provider parameters. */
1071
+ parameters: Record<string, string | number | boolean | null>;
1072
+ /** Gate trigger that authorized this invocation. */
1073
+ trigger: string;
1074
+ /** Tracker root bound to the active command or SDK request. */
1075
+ pm_root: string;
1076
+ }
1077
+ /** Result returned by an extension-owned assurance provider. */
1078
+ export interface AssuranceMeasurementProviderResult {
1079
+ /** Finite numeric value or deterministic labelled set. */
1080
+ value: number | string[];
1081
+ /** Population denominator represented by the metric. */
1082
+ population_size: number;
1083
+ /** Abstract compute units charged by the provider. */
1084
+ cost: number;
1085
+ /** Optional stable contributor ids or labels. */
1086
+ contributors?: string[];
1087
+ }
1088
+ /** Extension registration for an open assurance measurement vocabulary. */
1089
+ export interface AssuranceMeasurementProviderDefinition {
1090
+ /** Stable provider id used by measurement declarations and gate allow-lists. */
1091
+ id: string;
1092
+ /** Serializable metric-key schema. */
1093
+ keys: Record<string, AssuranceMeasurementProviderKeyDefinition>;
1094
+ /** Coarse execution cost used by trigger policy before invocation. */
1095
+ cost_class: AssuranceMeasurementProviderCostClass;
1096
+ /** Whether the resolver can access the network. */
1097
+ network: boolean;
1098
+ /** Maximum host wait for one resolver call. */
1099
+ timeout_ms?: number;
1100
+ /** Resolve one declared key. */
1101
+ resolve(context: AssuranceMeasurementProviderContext): AssuranceMeasurementProviderResult | Promise<AssuranceMeasurementProviderResult>;
1102
+ }
1042
1103
  /** Documents the registered extension command override payload exchanged by command, SDK, and package integrations. */
1043
1104
  export interface RegisteredExtensionCommandOverride {
1044
1105
  /** Value that configures or reports layer for this contract. */
@@ -1250,6 +1311,21 @@ export interface RegisteredExtensionVectorStoreAdapter {
1250
1311
  /** Value that configures or reports runtime definition for this contract. */
1251
1312
  runtime_definition: VectorStoreAdapterDefinition;
1252
1313
  }
1314
+ /** One validated assurance measurement provider registered by an active extension. */
1315
+ export interface RegisteredExtensionAssuranceMeasurementProvider {
1316
+ /** Extension layer owning the provider. */
1317
+ layer: ExtensionLayer;
1318
+ /** Extension name owning the provider. */
1319
+ name: string;
1320
+ /** Whether the owning manifest grants network access. */
1321
+ network_permission: boolean;
1322
+ /** Serializable definition used by doctor, inventory, and policy surfaces. */
1323
+ definition: Omit<AssuranceMeasurementProviderDefinition, "resolve"> & {
1324
+ resolve: "[Function]";
1325
+ };
1326
+ /** Runtime definition containing the executable resolver. */
1327
+ runtime_definition: AssuranceMeasurementProviderDefinition;
1328
+ }
1253
1329
  /**
1254
1330
  * Documents a project profile contributed by an extension via
1255
1331
  * `api.registerProfile(profile)`.
@@ -1293,6 +1369,8 @@ export interface ExtensionRegistrationRegistry {
1293
1369
  search_providers: RegisteredExtensionSearchProvider[];
1294
1370
  /** Value that configures or reports vector store adapters for this contract. */
1295
1371
  vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];
1372
+ /** Extension-owned assurance measurement providers. */
1373
+ assurance_providers: RegisteredExtensionAssuranceMeasurementProvider[];
1296
1374
  }
1297
1375
  /** Documents the extension registration counts payload exchanged by command, SDK, and package integrations. */
1298
1376
  export interface ExtensionRegistrationCounts {
@@ -1318,6 +1396,8 @@ export interface ExtensionRegistrationCounts {
1318
1396
  search_providers: number;
1319
1397
  /** Value that configures or reports vector store adapters for this contract. */
1320
1398
  vector_store_adapters: number;
1399
+ /** Number of registered assurance measurement providers. */
1400
+ assurance_providers?: number;
1321
1401
  }
1322
1402
  /** Read-only identity an extension's `activate(api)` receives about itself, so authors can emit self-identifying logs, gate on their own version, and build better error messages without re-reading the on-disk manifest or duplicating metadata in-module. Exposed as `api.extension`. */
1323
1403
  export interface ExtensionSelfIdentity {
@@ -1372,6 +1452,8 @@ export interface ExtensionApi {
1372
1452
  registerSearchProvider(provider: SearchProviderDefinition): void;
1373
1453
  /** Value that configures or reports register vector store adapter for this contract. */
1374
1454
  registerVectorStoreAdapter(adapter: VectorStoreAdapterDefinition): void;
1455
+ /** Register an assurance measurement provider through the services capability. */
1456
+ registerAssuranceMeasurementProvider(provider: AssuranceMeasurementProviderDefinition): void;
1375
1457
  /** Value that configures or reports hooks for this contract. */
1376
1458
  hooks: {
1377
1459
  beforeCommand(hook: BeforeCommandHook): void;
@@ -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]="50ad61f1-6719-541c-b4e0-4a88468725cf")}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]="294f3a0c-e74d-5963-b966-8a4443855ce3")}catch(e){}}();
4
4
  export const KNOWN_EXTENSION_CAPABILITIES = [
5
5
  "commands",
6
6
  "renderers",
@@ -61,6 +61,7 @@ export const KNOWN_EXTENSION_POLICY_SURFACES = [
61
61
  "importers.exporter",
62
62
  "search.provider",
63
63
  "search.vectorstore",
64
+ "services.assuranceprovider",
64
65
  ];
65
66
  /** Public contract for known extension service names, shared by SDK and presentation-layer consumers. */
66
67
  export const KNOWN_EXTENSION_SERVICE_NAMES = [
@@ -99,4 +100,4 @@ export function createDefaultExtensionGovernancePolicy() {
99
100
  };
100
101
  }
101
102
  //# sourceMappingURL=extension-types.js.map
102
- //# debugId=50ad61f1-6719-541c-b4e0-4a88468725cf
103
+ //# debugId=294f3a0c-e74d-5963-b966-8a4443855ce3
@@ -1,10 +1,11 @@
1
1
  import { assertOptionalStringField, normalizeOptionalStringArrayField } from "./registration-validation.js";
2
2
  import { compareComparableVersions, parseComparableVersion } from "./version-compat.js";
3
3
  import { type NormalizedExtensionPolicy } from "./extension-policy.js";
4
+ import { createRegistrationValidationError, extractRegistrationValidationTrace, normalizeRegistrationRecord, normalizeRegistrationRecordList, normalizeRuntimeRegistrationRecord, sanitizeRegistrationValue } from "./registration-values.js";
4
5
  export { parseUnknownExtensionCapabilityWarning, parseLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
5
6
  export { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
6
7
  export { runBeforeCommandHooks, runBeforeMutationHooks, runAfterCommandHooks, runOnWriteHooks, runOnReadHooks, runOnIndexHooks, runCommandHandler, runParserOverride, runPreflightOverride, runServiceOverrideSync, runServiceOverride, runCommandOverride, runRendererOverride, } from "./extension-hook-runtime.js";
7
- import { type ExtensionDeactivationOptions, type ExtensionDeactivationResult, type PmMaxVersionExceededMode, type ExtensionLayer, type ExtensionManifest, type EffectiveExtension, type ExtensionDiscoveryResult, type LoadedExtension, type ExtensionLoadResult, type ExtensionHookRegistry, type ExtensionCommandArgumentDefinition, type ExtensionCommandRegistry, type ExtensionParserRegistry, type ExtensionPreflightRegistry, type ExtensionServiceRegistry, type ExtensionRendererRegistry, type ExtensionRegistrationRegistry, type ExtensionRegistrationCounts, type ExtensionApi, type FailedExtensionActivation, type ExtensionActivationFailureTrace, type ExtensionActivationResult, type DiscoverExtensionsOptions } from "./extension-types.js";
8
+ import { type ExtensionDeactivationOptions, type ExtensionDeactivationResult, type PmMaxVersionExceededMode, type ExtensionLayer, type ExtensionManifest, type EffectiveExtension, type ExtensionDiscoveryResult, type LoadedExtension, type ExtensionLoadResult, type ExtensionHookRegistry, type ExtensionCommandArgumentDefinition, type ExtensionCommandRegistry, type ExtensionParserRegistry, type ExtensionPreflightRegistry, type ExtensionServiceRegistry, type ExtensionRendererRegistry, type ExtensionRegistrationRegistry, type ExtensionRegistrationCounts, type ExtensionApi, type FailedExtensionActivation, type ExtensionActivationResult, type DiscoverExtensionsOptions } from "./extension-types.js";
8
9
  export * from "./extension-types.js";
9
10
  /** Fallback extension priority used when callers do not provide an override. */
10
11
  export declare const DEFAULT_EXTENSION_PRIORITY = 100;
@@ -51,13 +52,6 @@ export declare function loadExtensions(options: DiscoverExtensionsOptions): Prom
51
52
  */
52
53
  export declare function deactivateExtensions(loadResult: ExtensionLoadResult, activationResult?: Pick<ExtensionActivationResult, "failed">, options?: ExtensionDeactivationOptions): Promise<ExtensionDeactivationResult>;
53
54
  declare function normalizeExtensionDeactivateTimeout(rawTimeout: unknown): number;
54
- declare function sanitizeRegistrationValue(value: unknown): unknown;
55
- declare function createRegistrationValidationError(message: string, trace: ExtensionActivationFailureTrace): TypeError;
56
- declare function extractRegistrationValidationTrace(error: unknown): ExtensionActivationFailureTrace | undefined;
57
- declare function normalizeRegistrationRecord(name: string, value: unknown): Record<string, unknown>;
58
- declare function normalizeRuntimeRegistrationRecord(name: string, value: unknown): Record<string, unknown>;
59
- declare function normalizeRegistrationRecordList<T extends object>(name: string, value: readonly T[]): T[];
60
- declare function normalizeRegistrationRecordList(name: string, value: unknown): Array<Record<string, unknown>>;
61
55
  declare function resolveCommandDefinitionAction(commandPath: string, action: unknown): string;
62
56
  declare function normalizeCommandDefinitionArguments(value: unknown): ExtensionCommandArgumentDefinition[];
63
57
  /** Reject a declared `value_type`/`type` that is not a known flag value kind, and a `default` whose value(s) would not cleanly coerce under that kind — so the typed-flag contract is enforced at registration instead of silently leaving an untyped value to surface at use time. */
@@ -4,7 +4,7 @@
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]="3d5208e5-0ea5-54a5-82a8-50294b4a0655")}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]="2b8750c3-7b19-5240-8179-f83830af1b77")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { pathToFileURL } from "node:url";
@@ -23,15 +23,12 @@ import { asRegistrationRecord, assertOptionalBooleanField, assertOptionalFlagDef
23
23
  import { describeExtensionLongFlagFailure, findExtensionFlagTokenFailure, } from "./flag-definition-validation.js";
24
24
  import { compareComparableVersions, evaluatePmMaxVersionBound, evaluatePmMinVersionBound, parseComparableVersion, } from "./version-compat.js";
25
25
  import { createRelationshipKindRegistry, } from "../../sdk/relationships.js";
26
- // Cohesive helper groups now live in sibling modules. They are imported for the
27
- // discovery/activation code that stays here and re-exported below so existing
28
- // import sites (sdk/index.ts, commands/extension.ts, health.ts, tests, …) keep
29
- // importing everything from "./loader.js" unchanged.
30
26
  import { normalizeNames, isKnownExtensionCapability, collectUnknownExtensionCapabilities, normalizeManifestCapabilities, formatUnknownExtensionCapabilityWarning, formatLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
31
27
  import { normalizeExtensionPolicy, serializeExtensionPolicy, hydrateExtensionPolicy, normalizePolicySandboxProfile, evaluateExtensionPolicyForExtension, evaluateExtensionPolicyForCapability, evaluateExtensionPolicyForRegistration, } from "./extension-policy.js";
32
28
  import { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
33
29
  import { normalizeCommandName, cloneContextSnapshot, } from "./extension-runtime-helpers.js";
34
30
  import { normalizeExtensionContributionInventory } from "./contribution-inventory.js";
31
+ import { attachRuntimeDefinition, assertHookHandler, assertNonEmptyRegistrationString, assertRegistrationFunction, cloneRuntimeRegistrationValue, createRegistrationValidationError, extractRegistrationValidationTrace, isExtensionServiceName, isOutputRendererFormat, normalizeRegistrationRecord, normalizeRegistrationRecordList, normalizeRuntimeRegistrationRecord, normalizeRegistrationName, sanitizeRegistrationValue, toRegistrationCommandPath, validateAssuranceMeasurementProviderDefinition, } from "./registration-values.js";
35
32
  import { buildReadyExtensionCandidate, } from "./extension-candidate.js";
36
33
  export { parseUnknownExtensionCapabilityWarning, parseLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
37
34
  export { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
@@ -41,7 +38,6 @@ export * from "./extension-types.js";
41
38
  /** Fallback extension priority used when callers do not provide an override. */
42
39
  export const DEFAULT_EXTENSION_PRIORITY = 100;
43
40
  let currentPmCliVersionPromise = null;
44
- /* Types now in extension-types.ts - re-exported via `export * from "./extension-types.js"` above */
45
41
  const DEFAULT_EXTENSION_POLICY = Object.freeze(createDefaultExtensionGovernancePolicy());
46
42
  let extensionReloadEpoch = 0;
47
43
  /** Implements next extension reload token for the public runtime surface of this module. */
@@ -945,115 +941,6 @@ async function runExtensionDeactivateWithTimeout(deactivate, timeoutMs) {
945
941
  clearTimeout(timeoutHandle);
946
942
  }
947
943
  }
948
- function isOutputRendererFormat(value) {
949
- return value === "toon" || value === "json";
950
- }
951
- function isExtensionServiceName(value) {
952
- return KNOWN_EXTENSION_SERVICE_NAMES.includes(value);
953
- }
954
- function assertHookHandler(hookName, hook) {
955
- if (typeof hook !== "function") {
956
- throw new TypeError(`api.hooks.${hookName} requires a function handler`);
957
- }
958
- }
959
- function assertNonEmptyString(name, value) {
960
- if (typeof value !== "string" || value.trim().length === 0) {
961
- throw new TypeError(`${name} requires a non-empty string`);
962
- }
963
- return value.trim();
964
- }
965
- function assertFunctionHandler(name, value) {
966
- if (typeof value !== "function") {
967
- throw new TypeError(`${name} requires a function handler`);
968
- }
969
- }
970
- function normalizeRegistrationName(name) {
971
- return name
972
- .trim()
973
- .toLowerCase()
974
- .split(/\s+/)
975
- .filter((part) => part.length > 0)
976
- .join(" ");
977
- }
978
- function toRegistrationCommandPath(name, action) {
979
- return normalizeCommandName(`${name} ${action}`);
980
- }
981
- function sanitizeRegistrationValue(value) {
982
- if (value === null) {
983
- return null;
984
- }
985
- if (Array.isArray(value)) {
986
- return value.map((entry) => sanitizeRegistrationValue(entry));
987
- }
988
- if (typeof value === "function") {
989
- return "[Function]";
990
- }
991
- if (typeof value === "bigint") {
992
- return value.toString();
993
- }
994
- if (typeof value === "symbol") {
995
- return value.toString();
996
- }
997
- if (typeof value === "object") {
998
- const record = value;
999
- const normalized = {};
1000
- const keys = Object.keys(record).sort((left, right) => left.localeCompare(right));
1001
- for (const key of keys) {
1002
- normalized[key] = sanitizeRegistrationValue(record[key]);
1003
- }
1004
- return normalized;
1005
- }
1006
- return value;
1007
- }
1008
- function cloneRuntimeRegistrationValue(value) {
1009
- if (Array.isArray(value)) {
1010
- return value.map((entry) => cloneRuntimeRegistrationValue(entry));
1011
- }
1012
- if (typeof value === "object" && value !== null) {
1013
- const record = value;
1014
- const cloned = {};
1015
- for (const key of Object.keys(record).sort((left, right) => left.localeCompare(right))) {
1016
- cloned[key] = cloneRuntimeRegistrationValue(record[key]);
1017
- }
1018
- return cloned;
1019
- }
1020
- return value;
1021
- }
1022
- const EXTENSION_REGISTRATION_TRACE_SYMBOL = Symbol("extension_registration_trace");
1023
- function createRegistrationValidationError(message, trace) {
1024
- const error = new TypeError(message);
1025
- Object.defineProperty(error, EXTENSION_REGISTRATION_TRACE_SYMBOL, {
1026
- value: trace,
1027
- enumerable: false,
1028
- configurable: false,
1029
- writable: false,
1030
- });
1031
- return error;
1032
- }
1033
- function extractRegistrationValidationTrace(error) {
1034
- if (!(error instanceof Error)) {
1035
- return undefined;
1036
- }
1037
- return error[EXTENSION_REGISTRATION_TRACE_SYMBOL];
1038
- }
1039
- function normalizeRegistrationRecord(name, value) {
1040
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
1041
- throw new TypeError(`${name} requires an object definition`);
1042
- }
1043
- return sanitizeRegistrationValue(value);
1044
- }
1045
- function normalizeRuntimeRegistrationRecord(name, value) {
1046
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
1047
- throw new TypeError(`${name} requires an object definition`);
1048
- }
1049
- return cloneRuntimeRegistrationValue(value);
1050
- }
1051
- function normalizeRegistrationRecordList(name, value) {
1052
- if (!Array.isArray(value)) {
1053
- throw new TypeError(`${name} requires an array of object definitions`);
1054
- }
1055
- return value.map((entry) => normalizeRegistrationRecord(name, entry));
1056
- }
1057
944
  const FLAG_DEFINITION_KEYS = new Set([
1058
945
  "default",
1059
946
  "description",
@@ -1108,7 +995,7 @@ function normalizeCommandDefinitionArguments(value) {
1108
995
  const normalized = [];
1109
996
  for (const [index, entry] of value.entries()) {
1110
997
  const record = asRegistrationRecord(`registerCommand definition.arguments[${index}]`, entry);
1111
- const name = assertNonEmptyString(`registerCommand definition.arguments[${index}].name`, record.name);
998
+ const name = assertNonEmptyRegistrationString(`registerCommand definition.arguments[${index}].name`, record.name);
1112
999
  assertOptionalBooleanField(`registerCommand definition.arguments[${index}].required`, record.required);
1113
1000
  assertOptionalBooleanField(`registerCommand definition.arguments[${index}].variadic`, record.variadic);
1114
1001
  assertOptionalStringField(`registerCommand definition.arguments[${index}].description`, record.description);
@@ -1218,8 +1105,8 @@ function validateItemFieldDefinitions(fields) {
1218
1105
  }
1219
1106
  for (const [index, raw] of fields.entries()) {
1220
1107
  const record = asRegistrationRecord(`registerItemFields fields[${index}]`, raw);
1221
- assertNonEmptyString(`registerItemFields fields[${index}].name`, record.name);
1222
- const fieldType = assertNonEmptyString(`registerItemFields fields[${index}].type`, record.type);
1108
+ assertNonEmptyRegistrationString(`registerItemFields fields[${index}].name`, record.name);
1109
+ const fieldType = assertNonEmptyRegistrationString(`registerItemFields fields[${index}].type`, record.type);
1223
1110
  if (normalizeItemFieldType(fieldType) === null) {
1224
1111
  const suggestion = suggestKnownItemFieldType(fieldType);
1225
1112
  const hint = suggestion ? ` Did you mean "${suggestion}"?` : "";
@@ -1241,8 +1128,8 @@ function validateItemTypeCommandOptionPolicies(typeIndex, value) {
1241
1128
  for (const [policyIndex, rawPolicy] of value.entries()) {
1242
1129
  const at = `${label}[${policyIndex}]`;
1243
1130
  const policy = asRegistrationRecord(at, rawPolicy);
1244
- assertNonEmptyString(`${at}.command`, policy.command);
1245
- assertNonEmptyString(`${at}.option`, policy.option);
1131
+ assertNonEmptyRegistrationString(`${at}.command`, policy.command);
1132
+ assertNonEmptyRegistrationString(`${at}.option`, policy.option);
1246
1133
  assertOptionalBooleanField(`${at}.enabled`, policy.enabled);
1247
1134
  assertOptionalBooleanField(`${at}.required`, policy.required);
1248
1135
  assertOptionalBooleanField(`${at}.visible`, policy.visible);
@@ -1260,7 +1147,7 @@ function validateItemTypeOptions(typeIndex, value) {
1260
1147
  for (const [optionIndex, rawOption] of value.entries()) {
1261
1148
  const at = `${label}[${optionIndex}]`;
1262
1149
  const option = asRegistrationRecord(at, rawOption);
1263
- assertNonEmptyString(`${at}.key`, option.key);
1150
+ assertNonEmptyRegistrationString(`${at}.key`, option.key);
1264
1151
  assertOptionalStringArrayField(`${at}.values`, option.values);
1265
1152
  assertOptionalBooleanField(`${at}.required`, option.required);
1266
1153
  assertOptionalStringArrayField(`${at}.aliases`, option.aliases);
@@ -1273,7 +1160,7 @@ function validateItemTypeDefinitions(types) {
1273
1160
  for (const [typeIndex, raw] of types.entries()) {
1274
1161
  const at = `registerItemTypes types[${typeIndex}]`;
1275
1162
  const record = asRegistrationRecord(at, raw);
1276
- assertNonEmptyString(`${at}.name`, record.name);
1163
+ assertNonEmptyRegistrationString(`${at}.name`, record.name);
1277
1164
  assertOptionalStringField(`${at}.folder`, record.folder);
1278
1165
  assertOptionalStringArrayField(`${at}.aliases`, record.aliases);
1279
1166
  assertOptionalStringArrayField(`${at}.required_create_fields`, record.required_create_fields);
@@ -1351,8 +1238,8 @@ const PROJECT_PROFILE_ENTRY_VALIDATORS = {
1351
1238
  };
1352
1239
  function validateProjectProfileDefinition(profile) {
1353
1240
  const record = asRegistrationRecord("registerProfile profile", profile);
1354
- assertNonEmptyString("registerProfile profile.name", record.name);
1355
- assertNonEmptyString("registerProfile profile.title", record.title);
1241
+ assertNonEmptyRegistrationString("registerProfile profile.name", record.name);
1242
+ assertNonEmptyRegistrationString("registerProfile profile.title", record.title);
1356
1243
  if (record.summary !== undefined && typeof record.summary !== "string") {
1357
1244
  throw new TypeError("registerProfile profile.summary must be a string when provided");
1358
1245
  }
@@ -1398,15 +1285,6 @@ function applyProjectProfileDefaults(profile) {
1398
1285
  }
1399
1286
  return profile;
1400
1287
  }
1401
- function attachRuntimeDefinition(entry, runtimeDefinition) {
1402
- Object.defineProperty(entry, "runtime_definition", {
1403
- value: runtimeDefinition,
1404
- enumerable: false,
1405
- writable: false,
1406
- configurable: false,
1407
- });
1408
- return entry;
1409
- }
1410
1288
  function getDeclaredExtensionCapabilities(extension) {
1411
1289
  if (!Array.isArray(extension.capabilities)) {
1412
1290
  return null;
@@ -1515,6 +1393,8 @@ class ExtensionApiRegistrar {
1515
1393
  this.registerSearchProvider = this.registerSearchProvider.bind(this);
1516
1394
  this.registerVectorStoreAdapter =
1517
1395
  this.registerVectorStoreAdapter.bind(this);
1396
+ this.registerAssuranceMeasurementProvider =
1397
+ this.registerAssuranceMeasurementProvider.bind(this);
1518
1398
  this.hooks = {
1519
1399
  beforeCommand: (hook) => this.registerBeforeCommand(hook),
1520
1400
  beforeMutation: (hook) => this.registerBeforeMutation(hook),
@@ -1662,8 +1542,8 @@ class ExtensionApiRegistrar {
1662
1542
  if (!this.allowRegistration("parser.override", "registerParser", "parser")) {
1663
1543
  return;
1664
1544
  }
1665
- const normalizedCommand = normalizeCommandName(assertNonEmptyString("registerParser command", command));
1666
- assertFunctionHandler("registerParser override", override);
1545
+ const normalizedCommand = normalizeCommandName(assertNonEmptyRegistrationString("registerParser command", command));
1546
+ assertRegistrationFunction("registerParser override", override);
1667
1547
  this.#parserRegistry.overrides.push({
1668
1548
  layer: this.#loadedExtension.layer,
1669
1549
  name: this.#loadedExtension.name,
@@ -1692,7 +1572,7 @@ class ExtensionApiRegistrar {
1692
1572
  if (!this.allowRegistration("services.override", "registerService", "services", { service: normalizedService })) {
1693
1573
  return;
1694
1574
  }
1695
- assertFunctionHandler("registerService override", override);
1575
+ assertRegistrationFunction("registerService override", override);
1696
1576
  this.#serviceRegistry.overrides.push({
1697
1577
  layer: this.#loadedExtension.layer,
1698
1578
  name: this.#loadedExtension.name,
@@ -1740,7 +1620,7 @@ class ExtensionApiRegistrar {
1740
1620
  if (!this.allowRegistration("schema.flags", "registerFlags", "schema")) {
1741
1621
  return;
1742
1622
  }
1743
- const normalizedTargetCommand = normalizeCommandName(assertNonEmptyString("registerFlags targetCommand", targetCommand));
1623
+ const normalizedTargetCommand = normalizeCommandName(assertNonEmptyRegistrationString("registerFlags targetCommand", targetCommand));
1744
1624
  validateFlagDefinitions(flags);
1745
1625
  const normalizedFlags = normalizeFlagDefinitions("registerFlags flags", flags);
1746
1626
  if (normalizedFlags.length === 0) {
@@ -1909,8 +1789,8 @@ class ExtensionApiRegistrar {
1909
1789
  if (!this.allowRegistration("importers.importer", "registerImporter", "importers")) {
1910
1790
  return;
1911
1791
  }
1912
- const normalizedName = normalizeRegistrationName(assertNonEmptyString("registerImporter name", name));
1913
- assertFunctionHandler("registerImporter importer", importer);
1792
+ const normalizedName = normalizeRegistrationName(assertNonEmptyRegistrationString("registerImporter name", name));
1793
+ assertRegistrationFunction("registerImporter importer", importer);
1914
1794
  const commandPath = toRegistrationCommandPath(normalizedName, "import");
1915
1795
  // Validate and register optional command metadata before mutating the registry
1916
1796
  // so an invalid options object leaves no partial importer registration.
@@ -1944,8 +1824,8 @@ class ExtensionApiRegistrar {
1944
1824
  if (!this.allowRegistration("importers.exporter", "registerExporter", "importers")) {
1945
1825
  return;
1946
1826
  }
1947
- const normalizedName = normalizeRegistrationName(assertNonEmptyString("registerExporter name", name));
1948
- assertFunctionHandler("registerExporter exporter", exporter);
1827
+ const normalizedName = normalizeRegistrationName(assertNonEmptyRegistrationString("registerExporter name", name));
1828
+ assertRegistrationFunction("registerExporter exporter", exporter);
1949
1829
  const commandPath = toRegistrationCommandPath(normalizedName, "export");
1950
1830
  // Validate and register optional command metadata before mutating the registry
1951
1831
  // so an invalid options object leaves no partial exporter registration.
@@ -1998,6 +1878,24 @@ class ExtensionApiRegistrar {
1998
1878
  definition: normalizeRegistrationRecord("registerVectorStoreAdapter adapter", adapter),
1999
1879
  }, runtimeDefinition));
2000
1880
  }
1881
+ registerAssuranceMeasurementProvider(provider) {
1882
+ assertExtensionCapability(this.#loadedExtension, "services", "registerAssuranceMeasurementProvider");
1883
+ if (!this.allowRegistration("services.assuranceprovider", "registerAssuranceMeasurementProvider", "services")) {
1884
+ return;
1885
+ }
1886
+ validateAssuranceMeasurementProviderDefinition(provider);
1887
+ if (provider.network &&
1888
+ this.#loadedExtension.permissions?.network !== true) {
1889
+ throw new TypeError("registerAssuranceMeasurementProvider network provider requires permissions.network=true");
1890
+ }
1891
+ const runtimeDefinition = normalizeRuntimeRegistrationRecord("registerAssuranceMeasurementProvider provider", provider);
1892
+ this.#registrationRegistry.assurance_providers.push(attachRuntimeDefinition({
1893
+ layer: this.#loadedExtension.layer,
1894
+ name: this.#loadedExtension.name,
1895
+ network_permission: this.#loadedExtension.permissions?.network === true,
1896
+ definition: normalizeRegistrationRecord("registerAssuranceMeasurementProvider provider", provider),
1897
+ }, runtimeDefinition));
1898
+ }
2001
1899
  registerBeforeCommand(hook) {
2002
1900
  assertExtensionCapability(this.#loadedExtension, "hooks", "api.hooks.beforeCommand");
2003
1901
  if (!this.allowRegistration("hooks.beforecommand", "api.hooks.beforeCommand", "hooks"))
@@ -2089,6 +1987,9 @@ function getRegistrationCounts(registrations) {
2089
1987
  exporters: registrations.exporters.length,
2090
1988
  search_providers: registrations.search_providers.length,
2091
1989
  vector_store_adapters: registrations.vector_store_adapters.length,
1990
+ ...((registrations.assurance_providers?.length ?? 0) > 0
1991
+ ? { assurance_providers: registrations.assurance_providers.length }
1992
+ : {}),
2092
1993
  };
2093
1994
  }
2094
1995
  function collectCommandCollisionWarnings(commands) {
@@ -2144,7 +2045,9 @@ function collectRendererCollisionWarnings(renderers) {
2144
2045
  }
2145
2046
  const winner = bucket[bucket.length - 1];
2146
2047
  for (const displaced of bucket.slice(0, -1)) {
2147
- if (winner.commands?.length && displaced.commands?.length && !displaced.commands.some((command) => winner.commands?.includes(command))) {
2048
+ if (winner.commands?.length &&
2049
+ displaced.commands?.length &&
2050
+ !displaced.commands.some((command) => winner.commands?.includes(command))) {
2148
2051
  continue;
2149
2052
  }
2150
2053
  warnings.push(`extension_renderer_collision:${format}:${winner.layer}:${winner.name}:${displaced.layer}:${displaced.name}`);
@@ -2217,7 +2120,13 @@ export async function activateExtensions(loadResult) {
2217
2120
  }
2218
2121
  const failedBeforeActivation = failed.length;
2219
2122
  const rollbackPartialActivation = captureExtensionActivationRollback({
2220
- hooks, commands, parsers, preflight, services, renderers, registrations,
2123
+ hooks,
2124
+ commands,
2125
+ parsers,
2126
+ preflight,
2127
+ services,
2128
+ renderers,
2129
+ registrations,
2221
2130
  });
2222
2131
  try {
2223
2132
  await activatable.activate(createExtensionApi(extension, hooks, commands, parsers, preflight, services, renderers, registrations, warnings, failed, policy));
@@ -2312,4 +2221,4 @@ export const _testOnlyLoader = {
2312
2221
  },
2313
2222
  };
2314
2223
  //# sourceMappingURL=loader.js.map
2315
- //# debugId=3d5208e5-0ea5-54a5-82a8-50294b4a0655
2224
+ //# debugId=2b8750c3-7b19-5240-8179-f83830af1b77
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @module core/extensions/registration-values
3
+ *
4
+ * Preserves executable extension registrations while producing deterministic,
5
+ * serializable public inventory snapshots and validates assurance providers.
6
+ */
7
+ import { type AssuranceMeasurementProviderDefinition, type ExtensionActivationFailureTrace, type ExtensionServiceName, type OutputRendererFormat } from "./extension-types.js";
8
+ /** Narrow a string to a renderer format accepted by the extension host. */
9
+ export declare function isOutputRendererFormat(value: string): value is OutputRendererFormat;
10
+ /** Narrow a string to a service name accepted by the extension host. */
11
+ export declare function isExtensionServiceName(value: string): value is ExtensionServiceName;
12
+ /** Require a callable lifecycle hook before registry mutation. */
13
+ export declare function assertHookHandler(hookName: string, hook: unknown): void;
14
+ /** Create a validation error carrying a hidden structured activation trace. */
15
+ export declare function createRegistrationValidationError(message: string, trace: ExtensionActivationFailureTrace): TypeError;
16
+ /** Recover a hidden structured activation trace from a validation error. */
17
+ export declare function extractRegistrationValidationTrace(error: unknown): ExtensionActivationFailureTrace | undefined;
18
+ /** Recursively project an arbitrary registration value into serializable data. */
19
+ export declare function sanitizeRegistrationValue(value: unknown): unknown;
20
+ /** Recursively clone registration containers while preserving function identities. */
21
+ export declare function cloneRuntimeRegistrationValue(value: unknown): unknown;
22
+ /** Create a deterministic serializable registration snapshot with functions redacted. */
23
+ export declare function normalizeRegistrationRecord(name: string, value: unknown): Record<string, unknown>;
24
+ /** Clone a registration record without stripping executable function values. */
25
+ export declare function normalizeRuntimeRegistrationRecord(name: string, value: unknown): Record<string, unknown>;
26
+ /** Normalize every object in an array into deterministic serializable snapshots. */
27
+ export declare function normalizeRegistrationRecordList<T extends object>(name: string, value: readonly T[]): T[];
28
+ /** Normalize an untyped array crossing a JavaScript or JSON boundary. */
29
+ export declare function normalizeRegistrationRecordList(name: string, value: unknown): Array<Record<string, unknown>>;
30
+ /** Require a trimmed non-empty string at an extension authoring boundary. */
31
+ export declare function assertNonEmptyRegistrationString(name: string, value: unknown): string;
32
+ /** Require an executable handler at an extension authoring boundary. */
33
+ export declare function assertRegistrationFunction(name: string, value: unknown): void;
34
+ /** Canonicalize a user-facing registration name for stable routing. */
35
+ export declare function normalizeRegistrationName(name: string): string;
36
+ /** Build the canonical command path synthesized for an importer or exporter. */
37
+ export declare function toRegistrationCommandPath(name: string, action: "import" | "export"): string;
38
+ /** Attach an executable definition as hidden immutable runtime-only state. */
39
+ export declare function attachRuntimeDefinition<TEntry extends {
40
+ definition: Record<string, unknown>;
41
+ }>(entry: TEntry, runtimeDefinition: Record<string, unknown>): TEntry;
42
+ /** Validate the closed provider schema before any activation registry mutation. */
43
+ export declare function validateAssuranceMeasurementProviderDefinition(provider: unknown): asserts provider is AssuranceMeasurementProviderDefinition;