@unbrained/pm-cli 2026.8.11 → 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.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +74 -21
- package/dist/cli/commander-usage.js +37 -11
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +82 -19
- package/dist/cli/main.js +35 -19
- package/dist/cli/register-annotations.js +56 -3
- package/dist/cli/register-assurance.js +28 -17
- package/dist/cli/register-list-query.js +10 -7
- package/dist/cli/register-operations.js +16 -6
- package/dist/cli-bundle/bundle-manifest.json +163 -163
- package/dist/cli-bundle/chunks/chunk-3ZMOWAFM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-DEDU3DG7.js +196 -0
- package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +13 -0
- package/dist/cli-bundle/chunks/chunk-F7FJYGK3.js +8 -0
- package/dist/cli-bundle/chunks/chunk-HIUZVCMN.js +5 -0
- package/dist/cli-bundle/chunks/chunk-IMGIN7R6.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-A2SJGHSI.js → chunk-Q47C67TQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WMEZHCFI.js → chunk-QGTUPEU5.js} +62 -54
- package/dist/cli-bundle/chunks/chunk-TF3TPKPR.js +34 -0
- package/dist/cli-bundle/chunks/{chunk-ZU34C3LH.js → chunk-YLBAPY22.js} +50 -50
- package/dist/cli-bundle/chunks/register-list-query-4HIZ7EA3.js +10 -0
- package/dist/cli-bundle/chunks/register-mutation-W64FZ5HN.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-C44ET7R5.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-NOCOOWQY.js → register-setup-634MFRXU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +31 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4H5IA6AV.js → chunk-2JP7W7GO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2RI2FESN.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2DL3MRTD.js → chunk-3DJSGWVB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-6MLIRBLV.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TL5M2PAY.js → chunk-E3AVJ655.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EBTNSFYE.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-J5EKAIVD.js → chunk-HC2OL2H2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BKPIY34S.js → chunk-I75MANL7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-IIS2FRKL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-NFHFZH2Z.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +17 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UDAZWT25.js → chunk-OOYYKQWX.js} +4 -4
- package/dist/cli-bundle/focused-chunks/{chunk-23FTGO3W.js → chunk-PKPOZXLL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QDZUABWL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-55BIB6DV.js → chunk-TEZIXMTH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +18 -0
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +42 -41
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +1 -1
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -2
- package/dist/core/checkpoint/checkpoint-gc.js +7 -12
- package/dist/core/extensions/activation-summary-markdown.js +5 -4
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +6 -2
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +4 -3
- package/dist/core/extensions/contribution-inventory.d.ts +1 -0
- package/dist/core/extensions/contribution-inventory.js +6 -2
- package/dist/core/extensions/extension-registries.js +3 -2
- package/dist/core/extensions/extension-types.d.ts +83 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/loader.d.ts +2 -8
- package/dist/core/extensions/loader.js +53 -144
- package/dist/core/extensions/registration-values.d.ts +43 -0
- package/dist/core/extensions/registration-values.js +210 -0
- package/dist/core/extensions/reserved-host-flags.js +3 -2
- package/dist/core/extensions/runtime-registrations.d.ts +3 -1
- package/dist/core/extensions/runtime-registrations.js +12 -2
- package/dist/core/fs/fs-utils.d.ts +2 -0
- package/dist/core/fs/fs-utils.js +7 -3
- package/dist/core/history/drift-cache.js +4 -3
- package/dist/core/history/drift-scan.js +16 -17
- package/dist/core/history/history.d.ts +8 -0
- package/dist/core/history/history.js +57 -7
- package/dist/core/history/replay.d.ts +9 -1
- package/dist/core/history/replay.js +48 -13
- package/dist/core/lock/lock-gc.js +8 -13
- package/dist/core/lock/lock.js +5 -4
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +46 -14
- package/dist/core/search/vector-stores.js +6 -11
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/errors.d.ts +5 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/store/item-metadata-cache.d.ts +1 -1
- package/dist/core/store/item-metadata-cache.js +16 -9
- package/dist/core/telemetry/runtime.d.ts +6 -0
- package/dist/core/telemetry/runtime.js +101 -30
- package/dist/sdk/agent/command-recovery.d.ts +2 -0
- package/dist/sdk/agent/command-recovery.js +10 -2
- package/dist/sdk/annotations.js +4 -4
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +6 -2
- package/dist/sdk/cli-contracts/completeness.js +10 -3
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +9 -3
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +20 -3
- package/dist/sdk/cli-contracts/registration-helpers.js +18 -12
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +40 -6
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +27 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +55 -5
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +22 -4
- package/dist/sdk/cli-program.js +3 -2
- package/dist/sdk/comments.js +4 -3
- package/dist/sdk/compile-cache.js +4 -3
- package/dist/sdk/completion.js +16 -7
- package/dist/sdk/compose.d.ts +3 -1
- package/dist/sdk/compose.js +16 -2
- package/dist/sdk/context-intent-contracts.js +45 -4
- package/dist/sdk/context-signal-store.js +4 -3
- package/dist/sdk/core.d.ts +1 -0
- package/dist/sdk/core.js +3 -2
- package/dist/sdk/extension/install-runtime.js +4 -4
- package/dist/sdk/extension/managed-state.js +4 -3
- package/dist/sdk/extension-contracts.d.ts +1 -1
- package/dist/sdk/flag-invocation-contracts.js +5 -6
- package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1597 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1608 -0
- package/dist/sdk/generated-error-code-catalog.js +6 -3140
- package/dist/sdk/governance/assurance-action.d.ts +27 -3
- package/dist/sdk/governance/assurance-action.js +117 -31
- package/dist/sdk/governance/assurance-mutation-error.d.ts +14 -0
- package/dist/sdk/governance/assurance-mutation-error.js +58 -0
- package/dist/sdk/governance/assurance-presets.d.ts +54 -0
- package/dist/sdk/governance/assurance-presets.js +136 -0
- package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
- package/dist/sdk/governance/assurance-runtime.js +118 -14
- package/dist/sdk/governance/assurance.d.ts +51 -6
- package/dist/sdk/governance/assurance.js +321 -67
- package/dist/sdk/governance/gc.js +5 -11
- package/dist/sdk/governance/health.d.ts +3 -1
- package/dist/sdk/governance/health.js +24 -7
- package/dist/sdk/governance/validate-item-reader.js +3 -3
- package/dist/sdk/governance/validate.d.ts +2 -0
- package/dist/sdk/governance/validate.js +15 -5
- package/dist/sdk/graph/durable-cache.d.ts +1 -1
- package/dist/sdk/graph/durable-cache.js +156 -29
- package/dist/sdk/graph/governance-contracts.d.ts +12 -0
- package/dist/sdk/graph/governance-contracts.js +27 -0
- package/dist/sdk/graph/governance.d.ts +44 -2
- package/dist/sdk/graph/governance.js +156 -12
- package/dist/sdk/guide.js +4 -4
- package/dist/sdk/index.d.ts +3 -2
- package/dist/sdk/index.js +5 -4
- package/dist/sdk/lifecycle/claim.js +10 -3
- package/dist/sdk/linked-artifacts.d.ts +2 -0
- package/dist/sdk/linked-artifacts.js +29 -4
- package/dist/sdk/merge/driver.d.ts +2 -2
- package/dist/sdk/merge/driver.js +3 -3
- package/dist/sdk/merge/install.js +5 -4
- package/dist/sdk/merge/receipts.d.ts +6 -4
- package/dist/sdk/merge/receipts.js +7 -5
- package/dist/sdk/merge/three-way.d.ts +2 -2
- package/dist/sdk/merge/three-way.js +3 -3
- package/dist/sdk/output-projection.d.ts +9 -1
- package/dist/sdk/output-projection.js +45 -9
- package/dist/sdk/query/activity.d.ts +49 -2
- package/dist/sdk/query/activity.js +185 -38
- package/dist/sdk/query/get.js +19 -2
- package/dist/sdk/read-output-contracts.d.ts +5 -1
- package/dist/sdk/read-output-contracts.js +17 -2
- package/dist/sdk/read-output-session.d.ts +2 -0
- package/dist/sdk/read-output-session.js +12 -5
- package/dist/sdk/relationship-history.js +5 -5
- package/dist/sdk/runtime-primitives.d.ts +3 -3
- package/dist/sdk/runtime-primitives.js +5 -5
- package/dist/sdk/runtime-stats-options.js +3 -2
- package/dist/sdk/runtime.js +5 -9
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/stats.d.ts +36 -3
- package/dist/sdk/stats.js +55 -15
- package/dist/sdk/test/execution.d.ts +4 -0
- package/dist/sdk/test/execution.js +88 -23
- package/dist/sdk/workspace-memory.js +4 -4
- package/dist/sdk/workspace-snapshot.js +8 -14
- package/dist/sdk/workspace-transaction-gc.js +4 -9
- package/dist/sdk/workspace-transaction.js +4 -4
- package/dist/sdk/workspace.js +4 -3
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -2
- package/docs/ASSURANCE.md +170 -14
- package/docs/COMMANDS.md +29 -8
- package/docs/CONFIGURATION.md +9 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
- package/docs/EXTENSIONS.md +11 -12
- package/docs/MERGE_SAFETY.md +3 -1
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
- package/docs/README.md +2 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
- package/docs/RELATIONSHIP_GRAPH.md +15 -0
- package/docs/SDK.md +17 -3
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +12 -1
- package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
- package/docs/TESTING.md +24 -15
- package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
- package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
- package/marketplace.json +2 -2
- package/package.json +6 -6
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +384 -83
- package/dist/cli-bundle/chunks/chunk-2OOU2AFH.js +0 -8
- package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +0 -33
- package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +0 -13
- package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +0 -194
- package/dist/cli-bundle/chunks/chunk-IUNRVDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +0 -5
- package/dist/cli-bundle/chunks/register-list-query-HAUXVUPY.js +0 -10
- package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DPO7TEFX.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-E3KCL7AY.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FPSYO5ZG.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-KDH5OX3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.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]="
|
|
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=
|
|
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]="
|
|
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=
|
|
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]="
|
|
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=
|
|
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
|
|
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]="
|
|
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 =
|
|
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
|
-
|
|
1222
|
-
const fieldType =
|
|
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
|
-
|
|
1245
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1355
|
-
|
|
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(
|
|
1666
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
1913
|
-
|
|
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(
|
|
1948
|
-
|
|
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 &&
|
|
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,
|
|
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=
|
|
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;
|