@pie-players/pie-assessment-toolkit 0.3.73 → 0.3.75
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/README.md +469 -318
- package/dist/attempt/AssessmentSession.d.ts +1 -5
- package/dist/attempt/AssessmentSession.js +0 -29
- package/dist/attempt/TestSession.d.ts +1 -20
- package/dist/attempt/TestSession.js +8 -99
- package/dist/components/ItemScope.custom-element.d.ts +1 -0
- package/dist/components/ItemScope.custom-element.js +1 -0
- package/dist/components/ItemToolBar.custom-element.d.ts +1 -0
- package/dist/components/ItemToolBar.custom-element.js +1 -1
- package/dist/components/PieAssessmentToolkit.custom-element.d.ts +1 -0
- package/dist/components/PieAssessmentToolkit.custom-element.js +13 -13
- package/dist/components/SectionToolBar.custom-element.d.ts +1 -0
- package/dist/components/SectionToolBar.custom-element.js +1 -1
- package/dist/components/chunks/ItemToolBar-7tt7v2xp.js +4 -0
- package/dist/components/chunks/ItemToolBar-97hx60z4.js +2 -0
- package/dist/components/chunks/ItemToolBar-bxwyhr5p.js +2 -0
- package/dist/components/chunks/ItemToolBar-jx38w99s.js +2 -0
- package/dist/components/chunks/ItemToolBar-rd2bb4p6.js +40 -0
- package/dist/components/chunks/ItemToolBar-vdkyn9f3.js +2 -0
- package/dist/components/chunks/sre-engine-jd8cc08x.js +1 -0
- package/dist/components/item-scope-element.d.ts +2 -0
- package/dist/components/item-scope-element.js +2 -0
- package/dist/context/assessment-toolkit-context.d.ts +32 -6
- package/dist/index.d.ts +23 -48
- package/dist/index.js +12 -37
- package/dist/policy/core/PolicySource.d.ts +1 -1
- package/dist/policy/core/ToolPolicyEngine.d.ts +85 -34
- package/dist/policy/core/ToolPolicyEngine.js +148 -46
- package/dist/policy/core/compose-decision.d.ts +28 -7
- package/dist/policy/core/compose-decision.js +75 -54
- package/dist/policy/core/decision-types.d.ts +65 -34
- package/dist/policy/core/feature-decision.d.ts +16 -9
- package/dist/policy/core/feature-decision.js +14 -8
- package/dist/policy/core/pnp-policy-inputs.d.ts +24 -33
- package/dist/policy/core/pnp-policy-inputs.js +28 -56
- package/dist/policy/core/provenance.d.ts +9 -4
- package/dist/policy/core/provenance.js +1 -1
- package/dist/policy/engine.d.ts +7 -23
- package/dist/policy/engine.js +5 -20
- package/dist/policy/sources/PnpPolicySource.d.ts +44 -61
- package/dist/policy/sources/PnpPolicySource.js +117 -118
- package/dist/runtime/SectionControllerBinding.d.ts +279 -0
- package/dist/runtime/SectionControllerBinding.js +450 -0
- package/dist/runtime/SectionRuntimeEngine.d.ts +26 -289
- package/dist/runtime/SectionRuntimeEngine.js +30 -372
- package/dist/runtime/adapter/SectionEngineAdapter.d.ts +19 -80
- package/dist/runtime/adapter/SectionEngineAdapter.js +19 -92
- package/dist/runtime/adapter/dom-event-bridge.d.ts +15 -30
- package/dist/runtime/adapter/dom-event-bridge.js +17 -44
- package/dist/runtime/adapter/subscriber-fanout.d.ts +1 -2
- package/dist/runtime/adapter/subscriber-fanout.js +1 -2
- package/dist/runtime/catalog-context.d.ts +19 -0
- package/dist/runtime/catalog-context.js +28 -0
- package/dist/runtime/composition-emit-scheduler.d.ts +9 -15
- package/dist/runtime/composition-emit-scheduler.js +9 -15
- package/dist/runtime/content-language.d.ts +32 -0
- package/dist/runtime/content-language.js +46 -0
- package/dist/runtime/content-region.d.ts +17 -0
- package/dist/runtime/content-region.js +29 -0
- package/dist/runtime/content-registration.d.ts +13 -0
- package/dist/runtime/content-registration.js +25 -0
- package/dist/runtime/core/SectionEngineCore.d.ts +2 -2
- package/dist/runtime/core/SectionEngineCore.js +2 -2
- package/dist/runtime/core/cohort.d.ts +1 -1
- package/dist/runtime/core/cohort.js +1 -1
- package/dist/runtime/core/engine-input.d.ts +18 -30
- package/dist/runtime/core/engine-input.js +11 -12
- package/dist/runtime/core/engine-output.d.ts +16 -40
- package/dist/runtime/core/engine-output.js +9 -21
- package/dist/runtime/core/engine-readiness.d.ts +5 -37
- package/dist/runtime/core/engine-readiness.js +8 -41
- package/dist/runtime/core/engine-resolver.d.ts +46 -74
- package/dist/runtime/core/engine-resolver.js +18 -43
- package/dist/runtime/core/engine-state.d.ts +28 -36
- package/dist/runtime/core/engine-state.js +18 -21
- package/dist/runtime/core/engine-transition.d.ts +14 -19
- package/dist/runtime/core/engine-transition.js +71 -51
- package/dist/runtime/engine.d.ts +16 -19
- package/dist/runtime/engine.js +12 -19
- package/dist/runtime/page-warnings.d.ts +13 -0
- package/dist/runtime/page-warnings.js +22 -0
- package/dist/runtime/policy-input-forwarding.d.ts +25 -0
- package/dist/runtime/policy-input-forwarding.js +25 -0
- package/dist/runtime/registration-events.d.ts +14 -0
- package/dist/runtime/runtime-event-claim.d.ts +8 -0
- package/dist/runtime/runtime-event-claim.js +15 -0
- package/dist/runtime/shell-event-bridge.d.ts +45 -0
- package/dist/runtime/shell-event-bridge.js +127 -0
- package/dist/runtime/shell-registration.d.ts +73 -0
- package/dist/runtime/shell-registration.js +95 -0
- package/dist/runtime/shell-scope.d.ts +68 -0
- package/dist/runtime/shell-scope.js +188 -0
- package/dist/runtime/tool-host-contract.d.ts +28 -10
- package/dist/runtime/tool-host-contract.js +31 -10
- package/dist/runtime/unclaimed-registration-watch.d.ts +7 -0
- package/dist/runtime/unclaimed-registration-watch.js +23 -0
- package/dist/services/ElementToolStateStore.d.ts +14 -10
- package/dist/services/ElementToolStateStore.js +37 -13
- package/dist/services/HighlightCoordinator.d.ts +22 -28
- package/dist/services/HighlightCoordinator.js +431 -327
- package/dist/services/RangeSerializer.d.ts +10 -1
- package/dist/services/RangeSerializer.js +87 -14
- package/dist/services/TTSService.d.ts +130 -69
- package/dist/services/TTSService.js +713 -570
- package/dist/services/ToolCoordinator.d.ts +43 -66
- package/dist/services/ToolCoordinator.js +164 -208
- package/dist/services/ToolRegistry.d.ts +78 -54
- package/dist/services/ToolRegistry.js +107 -105
- package/dist/services/ToolkitCoordinator.d.ts +261 -175
- package/dist/services/ToolkitCoordinator.js +667 -433
- package/dist/services/audio-handoff.d.ts +6 -7
- package/dist/services/audio-handoff.js +20 -14
- package/dist/services/catalog-owner.d.ts +11 -1
- package/dist/services/catalog-owner.js +25 -0
- package/dist/services/create-tools-config.d.ts +2 -2
- package/dist/services/framework-error-bus.d.ts +3 -6
- package/dist/services/framework-error-bus.js +3 -6
- package/dist/services/framework-error.d.ts +30 -8
- package/dist/services/framework-error.js +9 -7
- package/dist/services/interfaces.d.ts +158 -129
- package/dist/services/section-controller-types.d.ts +15 -0
- package/dist/services/section-session-assignment.d.ts +21 -0
- package/dist/services/section-session-assignment.js +82 -0
- package/dist/services/spoken-audio-cards.d.ts +0 -2
- package/dist/services/spoken-audio-cards.js +1 -3
- package/dist/services/tool-config-defaults.d.ts +3 -3
- package/dist/services/tool-config-defaults.js +3 -3
- package/dist/services/tool-config-validation.d.ts +14 -4
- package/dist/services/tool-config-validation.js +63 -71
- package/dist/services/tool-context.d.ts +0 -8
- package/dist/services/tool-context.js +29 -25
- package/dist/services/tool-icons.d.ts +4 -3
- package/dist/services/tool-icons.js +4 -3
- package/dist/services/tool-instance-id.d.ts +0 -1
- package/dist/services/tool-instance-id.js +0 -6
- package/dist/services/tool-providers/TTSToolProvider.d.ts +41 -80
- package/dist/services/tool-providers/TTSToolProvider.js +81 -40
- package/dist/services/tool-providers/ToolProviderApi.d.ts +10 -4
- package/dist/services/tool-providers/ToolProviderRegistry.d.ts +32 -28
- package/dist/services/tool-providers/ToolProviderRegistry.js +121 -107
- package/dist/services/tool-providers/index.d.ts +0 -9
- package/dist/services/tool-providers/index.js +2 -4
- package/dist/services/tool-request.d.ts +27 -12
- package/dist/services/tool-request.js +24 -14
- package/dist/services/toolbar-decided-tools.d.ts +15 -0
- package/dist/services/toolbar-decided-tools.js +28 -0
- package/dist/services/tools-config-normalizer.d.ts +37 -23
- package/dist/services/tools-config-normalizer.js +2 -10
- package/dist/services/tts/browser-provider.d.ts +38 -2
- package/dist/services/tts/browser-provider.js +276 -140
- package/dist/services/tts/catalog-span-alignment.d.ts +2 -17
- package/dist/services/tts/catalog-span-alignment.js +17 -142
- package/dist/services/tts/flat-tree.d.ts +71 -0
- package/dist/services/tts/flat-tree.js +269 -0
- package/dist/services/tts/generated-speech/assemble-plan.d.ts +3 -1
- package/dist/services/tts/generated-speech/assemble-plan.js +3 -1
- package/dist/services/tts/generated-speech/dom/build-dom-plan.d.ts +2 -0
- package/dist/services/tts/generated-speech/dom/build-dom-plan.js +1 -1
- package/dist/services/tts/generated-speech/math-speech-cache.d.ts +3 -1
- package/dist/services/tts/generated-speech/math-speech-cache.js +5 -1
- package/dist/services/tts/generated-speech/types.d.ts +0 -12
- package/dist/services/tts/highlight-pipeline/boundary-normalizer.js +12 -62
- package/dist/services/tts/highlight-pipeline/create-highlight-plan.js +38 -5
- package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.js +3 -6
- package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.js +6 -4
- package/dist/services/tts/highlight-pipeline/readable-region.js +3 -2
- package/dist/services/tts/highlight-pipeline/types.d.ts +5 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.d.ts +12 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.js +73 -7
- package/dist/services/tts/math-alignment/index.d.ts +0 -5
- package/dist/services/tts/math-alignment/index.js +5 -25
- package/dist/services/tts/math-alignment/speech-tokenizer.d.ts +9 -1
- package/dist/services/tts/math-alignment/speech-tokenizer.js +38 -36
- package/dist/services/tts/math-alignment/types.d.ts +4 -2
- package/dist/services/tts/math-aware-text-processing.d.ts +5 -1
- package/dist/services/tts/math-aware-text-processing.js +74 -18
- package/dist/services/tts/math-control-names.d.ts +21 -0
- package/dist/services/tts/math-control-names.js +142 -0
- package/dist/services/tts/math-speech.d.ts +16 -1
- package/dist/services/tts/math-speech.js +55 -19
- package/dist/services/tts/provider-options.d.ts +41 -0
- package/dist/services/tts/provider-options.js +1 -0
- package/dist/services/tts/sre-engine.d.ts +7 -0
- package/dist/services/tts/sre-engine.js +11 -0
- package/dist/services/tts/sre-locales.d.ts +14 -0
- package/dist/services/tts/sre-locales.js +57 -0
- package/dist/services/tts/ssml/spoken-text.d.ts +2 -26
- package/dist/services/tts/ssml/spoken-text.js +29 -0
- package/dist/services/tts/start-failure.d.ts +11 -0
- package/dist/services/tts/start-failure.js +19 -0
- package/dist/services/tts/text-processing.d.ts +9 -1
- package/dist/services/tts/text-processing.js +46 -34
- package/dist/services/tts/text-segmentation.d.ts +7 -0
- package/dist/services/tts/text-segmentation.js +47 -0
- package/dist/services/tts-runtime-config.d.ts +44 -18
- package/dist/services/tts-runtime-config.js +22 -93
- package/dist/tools/content-capability-resolution.d.ts +7 -9
- package/dist/tools/content-capability-resolution.js +8 -45
- package/dist/tools/registration.d.ts +58 -0
- package/dist/tools/registration.js +54 -0
- package/dist/tools/registrations/toolbar-registration-helpers.js +2 -2
- package/dist/tools/tool-surface-host.d.ts +6 -10
- package/dist/tools/tool-surface-host.js +44 -42
- package/dist/tools/tool-tag-map.d.ts +5 -15
- package/dist/tools/tool-tag-map.js +6 -20
- package/dist/utils/structural-equality.d.ts +11 -0
- package/dist/utils/structural-equality.js +47 -0
- package/package.json +24 -59
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts +0 -49
- package/dist/attempt/adapters/activity-to-test-attempt-session.js +0 -138
- package/dist/components/chunks/ItemToolBar-byq80z42.js +0 -40
- package/dist/components/chunks/ItemToolBar-d36g3aw4.js +0 -49
- package/dist/context/runtime-context-consumer.d.ts +0 -13
- package/dist/context/runtime-context-consumer.js +0 -51
- package/dist/item-loader.d.ts +0 -44
- package/dist/item-loader.js +0 -61
- package/dist/policy/core/engine-context.d.ts +0 -29
- package/dist/policy/core/engine-context.js +0 -27
- package/dist/policy/core/policy-source-tag.d.ts +0 -31
- package/dist/policy/core/policy-source-tag.js +0 -28
- package/dist/policy/internal.d.ts +0 -25
- package/dist/policy/internal.js +0 -25
- package/dist/runtime/adapter/coordinator-bridge.d.ts +0 -92
- package/dist/runtime/adapter/coordinator-bridge.js +0 -126
- package/dist/runtime/adapter/framework-error-bridge.d.ts +0 -36
- package/dist/runtime/adapter/framework-error-bridge.js +0 -46
- package/dist/runtime/adapter/instrumentation-bridge.d.ts +0 -31
- package/dist/runtime/adapter/instrumentation-bridge.js +0 -38
- package/dist/runtime/core/engine-stage-derivation.d.ts +0 -18
- package/dist/runtime/core/engine-stage-derivation.js +0 -29
- package/dist/runtime/engine-context.d.ts +0 -39
- package/dist/runtime/engine-context.js +0 -31
- package/dist/runtime/internal.d.ts +0 -43
- package/dist/runtime/internal.js +0 -45
- package/dist/runtime/section-runtime-engine-host-context.d.ts +0 -80
- package/dist/runtime/section-runtime-engine-host-context.js +0 -95
- package/dist/runtime/stage-emit-gate.d.ts +0 -92
- package/dist/runtime/stage-emit-gate.js +0 -82
- package/dist/services/I18nService.d.ts +0 -47
- package/dist/services/I18nService.js +0 -84
- package/dist/services/ThemeProvider.d.ts +0 -95
- package/dist/services/ThemeProvider.js +0 -334
- package/dist/services/ToolConfigResolver.d.ts +0 -161
- package/dist/services/ToolConfigResolver.js +0 -229
- package/dist/services/catalog-media.d.ts +0 -56
- package/dist/services/catalog-media.js +0 -190
- package/dist/services/createDefaultToolRegistry.d.ts +0 -53
- package/dist/services/createDefaultToolRegistry.js +0 -45
- package/dist/services/defaultPersonalNeedsProfile.d.ts +0 -21
- package/dist/services/defaultPersonalNeedsProfile.js +0 -26
- package/dist/services/pnp-standard-features.d.ts +0 -238
- package/dist/services/pnp-standard-features.js +0 -338
- package/dist/services/tool-providers/CortexToolProvider.d.ts +0 -13
- package/dist/services/tool-providers/CortexToolProvider.js +0 -32
- package/dist/services/tool-providers/DesmosToolProvider.d.ts +0 -14
- package/dist/services/tool-providers/DesmosToolProvider.js +0 -32
- package/dist/services/tool-providers/GeoGebraToolProvider.d.ts +0 -16
- package/dist/services/tool-providers/GeoGebraToolProvider.js +0 -32
- package/dist/services/tool-providers/LazyCalculatorToolProvider.d.ts +0 -35
- package/dist/services/tool-providers/LazyCalculatorToolProvider.js +0 -95
- package/dist/services/tts/visual-line-ranges.d.ts +0 -18
- package/dist/services/tts/visual-line-ranges.js +0 -226
- package/dist/tools/client.d.ts +0 -12
- package/dist/tools/client.js +0 -14
- package/dist/tools/index.d.ts +0 -8
- package/dist/tools/index.js +0 -10
- package/dist/tools/internal.d.ts +0 -43
- package/dist/tools/internal.js +0 -41
- package/dist/tools/response-discovery.d.ts +0 -61
- package/dist/tools/response-discovery.js +0 -113
- package/dist/tools/types.d.ts +0 -337
- package/dist/tools/types.js +0 -12
- package/dist/tools/variant-resolver.d.ts +0 -41
- package/dist/tools/variant-resolver.js +0 -207
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type { I18nProvider } from "@pie-players/pie-players-shared/i18n/types";
|
|
8
8
|
import type { CatalogOwnerSnapshot } from "./AccessibilityCatalogResolver.js";
|
|
9
9
|
import type { ToolContext, ToolLevel } from "./tool-context.js";
|
|
10
|
-
import type
|
|
10
|
+
import { type ToolComponentOverrides } from "../tools/tool-tag-map.js";
|
|
11
11
|
import type { AccessibilityCatalogResolverApi, ElementToolStateStoreApi, ToolCoordinatorApi, ToolkitCoordinatorApi, TtsServiceApi } from "./interfaces.js";
|
|
12
12
|
import type { ToolProviderApi } from "./tool-providers/ToolProviderApi.js";
|
|
13
13
|
import type { ToolProviderConfig as ToolRuntimeConfig } from "./tools-config-normalizer.js";
|
|
@@ -24,8 +24,8 @@ export interface ToolToolbarButtonDefinition {
|
|
|
24
24
|
toolId: string;
|
|
25
25
|
label: string;
|
|
26
26
|
/**
|
|
27
|
-
* Optional to match what the
|
|
28
|
-
*
|
|
27
|
+
* Optional to match what the renderer already does: `ItemToolBar.svelte`
|
|
28
|
+
* guards on `button.icon`, and `ToolbarItem.icon` is
|
|
29
29
|
* already optional, so requiring it here claimed a guarantee nothing relied
|
|
30
30
|
* on. A registration that renders a button still has to declare an icon —
|
|
31
31
|
* `assertToolRegistrationShape` enforces that.
|
|
@@ -65,9 +65,10 @@ export interface ToolbarContext {
|
|
|
65
65
|
* Content-alternate language: which authored alternate the catalog resolver
|
|
66
66
|
* should select. Not the interface locale — see {@link ToolbarContext.i18n}. The
|
|
67
67
|
* two are independent by QTI 3's own statement, and conflating them is how a
|
|
68
|
-
* Spanish passage ends up forcing Spanish widget chrome.
|
|
68
|
+
* Spanish passage ends up forcing Spanish widget chrome. Absent when neither
|
|
69
|
+
* the toolbar's `language` nor the host's `content-language` names one.
|
|
69
70
|
*/
|
|
70
|
-
language
|
|
71
|
+
language?: string;
|
|
71
72
|
/**
|
|
72
73
|
* Interface-locale provider for this capability's own UI strings.
|
|
73
74
|
*
|
|
@@ -83,12 +84,19 @@ export interface ToolbarContext {
|
|
|
83
84
|
size?: string;
|
|
84
85
|
};
|
|
85
86
|
getScopeElement?: () => HTMLElement | null;
|
|
86
|
-
|
|
87
|
+
/**
|
|
88
|
+
* State key of one PIE element in this toolbar's item, by its model id, for
|
|
89
|
+
* `elementToolStateStore`. `null` until the store and the ids it needs are
|
|
90
|
+
* known.
|
|
91
|
+
*/
|
|
92
|
+
getGlobalElementId?: (elementId: string) => string | null;
|
|
87
93
|
toolCoordinator: ToolCoordinatorApi | null;
|
|
88
94
|
toolkitCoordinator: ToolkitCoordinatorApi | null;
|
|
89
95
|
ttsService: TtsServiceApi | null;
|
|
90
96
|
elementToolStateStore: ElementToolStateStoreApi | null;
|
|
97
|
+
/** Toggles this toolbar's instance of a base tool id. */
|
|
91
98
|
toggleTool: (toolId: string) => void;
|
|
99
|
+
/** Whether this toolbar's instance of a base tool id is shown. */
|
|
92
100
|
isToolVisible: (toolId: string) => boolean;
|
|
93
101
|
subscribeVisibility: ((listener: () => void) => () => void) | null;
|
|
94
102
|
componentOverrides?: ToolComponentOverrides;
|
|
@@ -207,12 +215,15 @@ export interface HostedToolSize {
|
|
|
207
215
|
width: number;
|
|
208
216
|
height: number;
|
|
209
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* How the coordinator builds a tool's provider from the tool's config. The
|
|
220
|
+
* provider registers under the tool's own id, so `ensureProviderReady(toolId)`
|
|
221
|
+
* finds it; `provider.id` in the config selects an implementation and never
|
|
222
|
+
* renames the registration.
|
|
223
|
+
*/
|
|
210
224
|
export interface ToolProviderDescriptor {
|
|
211
|
-
getProviderId?: (config: ToolRuntimeConfig | undefined) => string;
|
|
212
225
|
createProvider: (config: ToolRuntimeConfig | undefined) => ToolProviderApi;
|
|
213
226
|
getInitConfig?: (config: ToolRuntimeConfig | undefined) => Record<string, unknown>;
|
|
214
|
-
sanitizeConfig?: (config: ToolRuntimeConfig) => ToolRuntimeConfig;
|
|
215
|
-
validateConfig?: (config: ToolRuntimeConfig) => ToolConfigDiagnostic[];
|
|
216
227
|
getAuthFetcher?: (config: ToolRuntimeConfig | undefined) => (() => Promise<Record<string, unknown>>) | undefined;
|
|
217
228
|
lazy?: boolean;
|
|
218
229
|
}
|
|
@@ -230,12 +241,10 @@ export interface ToolToolbarRenderResult {
|
|
|
230
241
|
* falls back to `name` rather than rendering the key, so a catalog gap degrades
|
|
231
242
|
* to English instead of to `tools.something.name` on a toolbar button.
|
|
232
243
|
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
244
|
+
* It lives here so the toolbars, the settings panels and the PNP debugger
|
|
245
|
+
* cannot each invent their own precedence.
|
|
235
246
|
*/
|
|
236
247
|
export declare function resolveToolRegistrationName(registration: Pick<ToolRegistration, "name" | "nameKey">, i18n?: I18nProvider): string;
|
|
237
|
-
/** A registration's description in the interface locale. See the name resolver. */
|
|
238
|
-
export declare function resolveToolRegistrationDescription(registration: Pick<ToolRegistration, "description" | "descriptionKey">, i18n?: I18nProvider): string;
|
|
239
248
|
export type ToolActivation = "toolbar-toggle" | "selection-gateway" | "region";
|
|
240
249
|
export type ToolSingletonScope = "section";
|
|
241
250
|
/**
|
|
@@ -273,8 +282,14 @@ export interface ToolSurfaceServices {
|
|
|
273
282
|
*/
|
|
274
283
|
export interface ToolSurfaceRenderContext {
|
|
275
284
|
toolId: string;
|
|
276
|
-
/**
|
|
277
|
-
|
|
285
|
+
/**
|
|
286
|
+
* Whether a PNP support, a requirement or a test-administration override
|
|
287
|
+
* granted the capability. `false` for a capability rendered because it is
|
|
288
|
+
* placed with no grant, and for a
|
|
289
|
+
* {@link ToolRegistration.resolvesWithoutGrant} capability answering from
|
|
290
|
+
* content alone.
|
|
291
|
+
*/
|
|
292
|
+
granted: boolean;
|
|
278
293
|
/** Host slot being filled. */
|
|
279
294
|
surface: string;
|
|
280
295
|
/** Feature parameters from the policy decision, if any. */
|
|
@@ -289,8 +304,6 @@ export interface ToolSurfaceRenderContext {
|
|
|
289
304
|
* present.
|
|
290
305
|
*/
|
|
291
306
|
export interface ToolContentDependencyContext {
|
|
292
|
-
/** The PNP/AfA support id being resolved. */
|
|
293
|
-
featureId: string;
|
|
294
307
|
/** Feature parameters from the policy decision, if any. */
|
|
295
308
|
parameters?: unknown;
|
|
296
309
|
/**
|
|
@@ -302,7 +315,7 @@ export interface ToolContentDependencyContext {
|
|
|
302
315
|
*/
|
|
303
316
|
catalogs: CatalogOwnerSnapshot | null;
|
|
304
317
|
/**
|
|
305
|
-
* Whether policy granted
|
|
318
|
+
* Whether policy granted this capability's support id.
|
|
306
319
|
*
|
|
307
320
|
* `false` reaches `resolve` only for a capability that declares
|
|
308
321
|
* {@link ToolRegistration.resolvesWithoutGrant}, and it is the signal that the
|
|
@@ -441,12 +454,6 @@ export interface ToolRegistration {
|
|
|
441
454
|
* Optional singleton scope for activation models that mount exactly one instance.
|
|
442
455
|
*/
|
|
443
456
|
singletonScope?: ToolSingletonScope;
|
|
444
|
-
/**
|
|
445
|
-
* PNP support IDs that enable this tool (optional)
|
|
446
|
-
* Used by the tool policy engine to determine if a PNP support enables this tool.
|
|
447
|
-
* Example: ['calculator', 'basic-calculator', 'scientific-calculator']
|
|
448
|
-
*/
|
|
449
|
-
pnpSupportIds?: string[];
|
|
450
457
|
/**
|
|
451
458
|
* Authored content this capability needs before it has anything to show.
|
|
452
459
|
*
|
|
@@ -477,6 +484,16 @@ export interface ToolRegistration {
|
|
|
477
484
|
* without hardcoded tool-specific branches.
|
|
478
485
|
*/
|
|
479
486
|
provider?: ToolProviderDescriptor;
|
|
487
|
+
/**
|
|
488
|
+
* Normalize this tool's `tools.providers.<toolId>` entry. Tools-config
|
|
489
|
+
* validation runs it before {@link ToolRegistration.validateConfig}; a throw is
|
|
490
|
+
* reported as a diagnostic and the entry passes through unchanged.
|
|
491
|
+
*/
|
|
492
|
+
sanitizeConfig?: (config: ToolRuntimeConfig) => ToolRuntimeConfig;
|
|
493
|
+
/**
|
|
494
|
+
* Diagnostics for this tool's sanitized `tools.providers.<toolId>` entry.
|
|
495
|
+
*/
|
|
496
|
+
validateConfig?: (config: ToolRuntimeConfig) => ToolConfigDiagnostic[];
|
|
480
497
|
/**
|
|
481
498
|
* Optional shell-host lifecycle hooks for hosted (floating) tools.
|
|
482
499
|
*/
|
|
@@ -540,10 +557,12 @@ export interface ToolRegistration {
|
|
|
540
557
|
*/
|
|
541
558
|
export declare class ToolRegistry {
|
|
542
559
|
private tools;
|
|
543
|
-
private pnpIndex;
|
|
544
560
|
private componentOverrides;
|
|
561
|
+
private watchedUndefinedToolElements;
|
|
545
562
|
private moduleLoaders;
|
|
546
563
|
private loadedToolModules;
|
|
564
|
+
private warnedLoaderReplacements;
|
|
565
|
+
private warnedUnregisteredAllowedTools;
|
|
547
566
|
private moduleLoadPromises;
|
|
548
567
|
private changeListeners;
|
|
549
568
|
private emitChange;
|
|
@@ -553,11 +572,11 @@ export declare class ToolRegistry {
|
|
|
553
572
|
*/
|
|
554
573
|
onRegistryChange(listener: ToolRegistryChangeListener): () => void;
|
|
555
574
|
/**
|
|
556
|
-
* Normalize a single tool
|
|
575
|
+
* Normalize a single tool id (trims surrounding whitespace).
|
|
557
576
|
*/
|
|
558
577
|
normalizeToolId(toolId: string): string;
|
|
559
578
|
/**
|
|
560
|
-
* Normalize a list of tool
|
|
579
|
+
* Normalize a list of tool ids (trims surrounding whitespace).
|
|
561
580
|
*/
|
|
562
581
|
normalizeToolIds(toolIds: string[]): string[];
|
|
563
582
|
/**
|
|
@@ -605,13 +624,6 @@ export declare class ToolRegistry {
|
|
|
605
624
|
* @returns Array of tool registrations
|
|
606
625
|
*/
|
|
607
626
|
getAllTools(): ToolRegistration[];
|
|
608
|
-
/**
|
|
609
|
-
* Find tool IDs that support a given PNP support ID
|
|
610
|
-
*
|
|
611
|
-
* @param pnpSupportId - PNP support ID (e.g., 'calculator')
|
|
612
|
-
* @returns Set of tool IDs that support this PNP ID
|
|
613
|
-
*/
|
|
614
|
-
getToolsByPNPSupport(pnpSupportId: string): Set<string>;
|
|
615
627
|
/**
|
|
616
628
|
* Get tools that support a specific level
|
|
617
629
|
*
|
|
@@ -637,11 +649,12 @@ export declare class ToolRegistry {
|
|
|
637
649
|
*/
|
|
638
650
|
getToolsBySurface(surface: string): ToolRegistration[];
|
|
639
651
|
/**
|
|
640
|
-
* Support ids
|
|
652
|
+
* Support ids, which are tool ids, of the capabilities that need authored
|
|
653
|
+
* content.
|
|
641
654
|
*
|
|
642
|
-
* What a host filters a default grant list on
|
|
643
|
-
*
|
|
644
|
-
*
|
|
655
|
+
* What a host filters a default grant list on: granting one of these
|
|
656
|
+
* wholesale grants an accommodation to learners with no documented need
|
|
657
|
+
* for it.
|
|
645
658
|
*/
|
|
646
659
|
getContentDependentSupportIds(): string[];
|
|
647
660
|
/**
|
|
@@ -651,7 +664,7 @@ export declare class ToolRegistry {
|
|
|
651
664
|
/**
|
|
652
665
|
* Filter tools by visibility in a given context
|
|
653
666
|
*
|
|
654
|
-
* Pass 2 of the
|
|
667
|
+
* Pass 2 of the three-pass model: Given a list of allowed tool IDs (from Pass 1),
|
|
655
668
|
* ask each tool if it's relevant in this context.
|
|
656
669
|
*
|
|
657
670
|
* @param allowedToolIds - Tool IDs that passed Pass 1 (orchestrator approval)
|
|
@@ -677,13 +690,12 @@ export declare class ToolRegistry {
|
|
|
677
690
|
* Get tool metadata for building UIs
|
|
678
691
|
* Useful for building PNP configuration interfaces
|
|
679
692
|
*
|
|
680
|
-
* @returns Array of tool metadata (id, name, description,
|
|
693
|
+
* @returns Array of tool metadata (id, name, description, levels, activation)
|
|
681
694
|
*/
|
|
682
695
|
getToolMetadata(): Array<{
|
|
683
696
|
toolId: string;
|
|
684
697
|
name: string;
|
|
685
698
|
description: string;
|
|
686
|
-
pnpSupportIds: string[];
|
|
687
699
|
supportedLevels: ToolLevel[];
|
|
688
700
|
activation: ToolActivation;
|
|
689
701
|
singletonScope: ToolSingletonScope | null;
|
|
@@ -691,14 +703,6 @@ export declare class ToolRegistry {
|
|
|
691
703
|
requiresAuthoredContent: boolean;
|
|
692
704
|
contentDependencyDescription: string | null;
|
|
693
705
|
}>;
|
|
694
|
-
/**
|
|
695
|
-
* Generate PNP support IDs from enabled tools
|
|
696
|
-
* Useful for creating PNP profiles
|
|
697
|
-
*
|
|
698
|
-
* @param enabledToolIds - Tool IDs to enable
|
|
699
|
-
* @returns Array of unique PNP support IDs
|
|
700
|
-
*/
|
|
701
|
-
generatePNPSupportsFromTools(enabledToolIds: string[]): string[];
|
|
702
706
|
/**
|
|
703
707
|
* Clear all registrations (useful for testing)
|
|
704
708
|
*/
|
|
@@ -710,17 +714,39 @@ export declare class ToolRegistry {
|
|
|
710
714
|
/**
|
|
711
715
|
* Register lazy module loaders by toolId.
|
|
712
716
|
* Toolbars call ensureToolModuleLoaded(toolId) before instance creation.
|
|
717
|
+
* A tool whose module has loaded, or is loading, keeps its loader: its
|
|
718
|
+
* elements are already defined, so a replacement could never take effect.
|
|
713
719
|
*/
|
|
714
720
|
setToolModuleLoaders(loaders: Partial<Record<string, ToolModuleLoader>>): void;
|
|
721
|
+
private warnLoaderReplacedAfterLoad;
|
|
715
722
|
/**
|
|
716
723
|
* Ensure tool module side-effects are loaded exactly once.
|
|
717
724
|
* Safe to call repeatedly; concurrent callers share the same promise.
|
|
718
725
|
*/
|
|
719
726
|
ensureToolModuleLoaded(toolId: string): Promise<void>;
|
|
720
727
|
/**
|
|
721
|
-
*
|
|
728
|
+
* The undefined element tag a tool would render, or `null` when the tool is
|
|
729
|
+
* built by a component factory, its element is defined, or there is no DOM.
|
|
730
|
+
*/
|
|
731
|
+
private undefinedToolElementTag;
|
|
732
|
+
/**
|
|
733
|
+
* Warn when a tool's module loader finished without defining the element the
|
|
734
|
+
* tag map points the tool at, as when a host remaps the tag but keeps a
|
|
735
|
+
* loader that defines the packaged element. The tool otherwise renders blank.
|
|
736
|
+
*/
|
|
737
|
+
private warnIfLoadedToolElementUndefined;
|
|
738
|
+
/**
|
|
739
|
+
* Warn when a tool with no module loader still has no element definition
|
|
740
|
+
* after the pending-input delay. A registry built without loaders otherwise
|
|
741
|
+
* renders the tool as an unknown element with no error.
|
|
742
|
+
*/
|
|
743
|
+
private watchUndefinedToolElement;
|
|
744
|
+
/**
|
|
745
|
+
* Load a set of tool modules, each to completion, and resolve with the error
|
|
746
|
+
* of every tool whose module failed, by tool id. One failure leaves the other
|
|
747
|
+
* tools loaded and usable. A failed tool is retried on the next call.
|
|
722
748
|
*/
|
|
723
|
-
ensureToolModulesLoaded(toolIds: string[]): Promise<
|
|
749
|
+
ensureToolModulesLoaded(toolIds: string[]): Promise<Map<string, unknown>>;
|
|
724
750
|
/**
|
|
725
751
|
* Whether a tool module has already been loaded.
|
|
726
752
|
*/
|
|
@@ -738,7 +764,5 @@ export declare class ToolRegistry {
|
|
|
738
764
|
* nothing and fail on every packaged capability. Overrides passed in the
|
|
739
765
|
* context still win, matching the toolbar path's precedence.
|
|
740
766
|
*/
|
|
741
|
-
renderForSurface(toolId: string, context:
|
|
742
|
-
componentOverrides?: ToolComponentOverrides;
|
|
743
|
-
}): ToolSurfaceRenderResult | null;
|
|
767
|
+
renderForSurface(toolId: string, context: ToolSurfaceRenderContext): ToolSurfaceRenderResult | null;
|
|
744
768
|
}
|