@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
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** GeoGebra calculator adapter for the generic tool-provider registry. */
|
|
2
|
-
import type { CalculatorToolProviderInitConfig, LazyCalculatorProviderDefinition } from "./LazyCalculatorToolProvider.js";
|
|
3
|
-
import { LazyCalculatorToolProvider } from "./LazyCalculatorToolProvider.js";
|
|
4
|
-
import type { ToolProviderCapabilities } from "./ToolProviderApi.js";
|
|
5
|
-
export interface GeoGebraToolProviderConfig extends CalculatorToolProviderInitConfig {
|
|
6
|
-
scriptUrl?: string;
|
|
7
|
-
appletTimeoutMs?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare class GeoGebraToolProvider extends LazyCalculatorToolProvider<GeoGebraToolProviderConfig> {
|
|
10
|
-
readonly providerId = "geogebra-calculator";
|
|
11
|
-
readonly providerName = "GeoGebra Calculator";
|
|
12
|
-
readonly version = "6";
|
|
13
|
-
readonly requiresAuth = false;
|
|
14
|
-
protected getDefinition(): LazyCalculatorProviderDefinition<GeoGebraToolProviderConfig>;
|
|
15
|
-
getCapabilities(): ToolProviderCapabilities;
|
|
16
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** GeoGebra calculator adapter for the generic tool-provider registry. */
|
|
2
|
-
import { LazyCalculatorToolProvider } from "./LazyCalculatorToolProvider.js";
|
|
3
|
-
export class GeoGebraToolProvider extends LazyCalculatorToolProvider {
|
|
4
|
-
providerId = "geogebra-calculator";
|
|
5
|
-
providerName = "GeoGebra Calculator";
|
|
6
|
-
version = "6";
|
|
7
|
-
requiresAuth = false;
|
|
8
|
-
getDefinition() {
|
|
9
|
-
return {
|
|
10
|
-
backend: "geogebra",
|
|
11
|
-
moduleImportOperation: "geogebra-provider-module-import",
|
|
12
|
-
loadProvider: async () => {
|
|
13
|
-
const module = await import("@pie-players/pie-calculator-geogebra");
|
|
14
|
-
return module.GeoGebraCalculatorProvider;
|
|
15
|
-
},
|
|
16
|
-
initializationErrorMessage: "Failed to initialize GeoGebra calculator provider. Confirm that the deployment may load GeoGebra and that its script URL is reachable.",
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
getCapabilities() {
|
|
20
|
-
return {
|
|
21
|
-
supportsOffline: false,
|
|
22
|
-
requiresAuth: false,
|
|
23
|
-
maxInstances: null,
|
|
24
|
-
features: {
|
|
25
|
-
basic: true,
|
|
26
|
-
scientific: true,
|
|
27
|
-
graphing: true,
|
|
28
|
-
fourFunction: false,
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { CalculatorProvider, CalculatorProviderInit } from "@pie-players/pie-calculator";
|
|
2
|
-
import type { ToolProviderApi, ToolProviderCapabilities } from "./ToolProviderApi.js";
|
|
3
|
-
export type CalculatorToolProviderInitConfig = Pick<CalculatorProviderInit, "onTelemetry">;
|
|
4
|
-
type InitializableCalculatorProvider<TConfig> = CalculatorProvider & {
|
|
5
|
-
initialize(config: TConfig): Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
export interface LazyCalculatorProviderDefinition<TConfig> {
|
|
8
|
-
backend: string;
|
|
9
|
-
moduleImportOperation: string;
|
|
10
|
-
loadProvider: () => Promise<new () => InitializableCalculatorProvider<TConfig>>;
|
|
11
|
-
initializationErrorMessage: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Shared lazy-module and lifecycle implementation for calculator tool adapters.
|
|
15
|
-
* Concrete adapters own only their metadata, capabilities and provider import.
|
|
16
|
-
*/
|
|
17
|
-
export declare abstract class LazyCalculatorToolProvider<TConfig extends CalculatorToolProviderInitConfig> implements ToolProviderApi<TConfig, CalculatorProvider> {
|
|
18
|
-
abstract readonly providerId: string;
|
|
19
|
-
abstract readonly providerName: string;
|
|
20
|
-
readonly category: "calculator";
|
|
21
|
-
abstract readonly version: string;
|
|
22
|
-
abstract readonly requiresAuth: boolean;
|
|
23
|
-
protected abstract getDefinition(): LazyCalculatorProviderDefinition<TConfig>;
|
|
24
|
-
abstract getCapabilities(): ToolProviderCapabilities;
|
|
25
|
-
private calculatorProvider;
|
|
26
|
-
private initializationPromise;
|
|
27
|
-
private lifecycleGeneration;
|
|
28
|
-
private emitTelemetry;
|
|
29
|
-
initialize(config?: TConfig): Promise<void>;
|
|
30
|
-
private initializeProvider;
|
|
31
|
-
createInstance(): Promise<CalculatorProvider>;
|
|
32
|
-
isReady(): boolean;
|
|
33
|
-
destroy(): void;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared lazy-module and lifecycle implementation for calculator tool adapters.
|
|
3
|
-
* Concrete adapters own only their metadata, capabilities and provider import.
|
|
4
|
-
*/
|
|
5
|
-
export class LazyCalculatorToolProvider {
|
|
6
|
-
category = "calculator";
|
|
7
|
-
calculatorProvider = null;
|
|
8
|
-
initializationPromise = null;
|
|
9
|
-
lifecycleGeneration = 0;
|
|
10
|
-
async emitTelemetry(config, eventName, payload) {
|
|
11
|
-
try {
|
|
12
|
-
await config.onTelemetry?.(eventName, payload);
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
console.warn(`[${this.providerName}] telemetry callback failed:`, error);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
async initialize(config = {}) {
|
|
19
|
-
if (this.calculatorProvider)
|
|
20
|
-
return;
|
|
21
|
-
if (this.initializationPromise)
|
|
22
|
-
return this.initializationPromise;
|
|
23
|
-
const generation = ++this.lifecycleGeneration;
|
|
24
|
-
const initializationPromise = this.initializeProvider(config, generation);
|
|
25
|
-
this.initializationPromise = initializationPromise;
|
|
26
|
-
try {
|
|
27
|
-
await initializationPromise;
|
|
28
|
-
}
|
|
29
|
-
finally {
|
|
30
|
-
if (this.initializationPromise === initializationPromise) {
|
|
31
|
-
this.initializationPromise = null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
async initializeProvider(config, generation) {
|
|
36
|
-
const definition = this.getDefinition();
|
|
37
|
-
const moduleLoadStartedAt = Date.now();
|
|
38
|
-
await this.emitTelemetry(config, "pie-tool-library-load-start", {
|
|
39
|
-
toolId: "calculator",
|
|
40
|
-
operation: definition.moduleImportOperation,
|
|
41
|
-
backend: definition.backend,
|
|
42
|
-
});
|
|
43
|
-
let ProviderConstructor;
|
|
44
|
-
try {
|
|
45
|
-
ProviderConstructor = await definition.loadProvider();
|
|
46
|
-
await this.emitTelemetry(config, "pie-tool-library-load-success", {
|
|
47
|
-
toolId: "calculator",
|
|
48
|
-
operation: definition.moduleImportOperation,
|
|
49
|
-
backend: definition.backend,
|
|
50
|
-
duration: Date.now() - moduleLoadStartedAt,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
await this.emitTelemetry(config, "pie-tool-library-load-error", {
|
|
55
|
-
toolId: "calculator",
|
|
56
|
-
operation: definition.moduleImportOperation,
|
|
57
|
-
backend: definition.backend,
|
|
58
|
-
duration: Date.now() - moduleLoadStartedAt,
|
|
59
|
-
errorType: "ToolLibraryLoadError",
|
|
60
|
-
message: error instanceof Error ? error.message : String(error),
|
|
61
|
-
});
|
|
62
|
-
throw new Error(definition.initializationErrorMessage, { cause: error });
|
|
63
|
-
}
|
|
64
|
-
if (generation !== this.lifecycleGeneration) {
|
|
65
|
-
throw new Error(`${this.providerName} initialization was cancelled`);
|
|
66
|
-
}
|
|
67
|
-
const candidate = new ProviderConstructor();
|
|
68
|
-
try {
|
|
69
|
-
await candidate.initialize(config);
|
|
70
|
-
if (generation !== this.lifecycleGeneration) {
|
|
71
|
-
throw new Error(`${this.providerName} initialization was cancelled`);
|
|
72
|
-
}
|
|
73
|
-
this.calculatorProvider = candidate;
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
candidate.destroy();
|
|
77
|
-
throw new Error(definition.initializationErrorMessage, { cause: error });
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
async createInstance() {
|
|
81
|
-
if (!this.calculatorProvider) {
|
|
82
|
-
throw new Error(`[${this.providerName}] Provider not initialized. Call initialize() first.`);
|
|
83
|
-
}
|
|
84
|
-
return this.calculatorProvider;
|
|
85
|
-
}
|
|
86
|
-
isReady() {
|
|
87
|
-
return this.calculatorProvider !== null;
|
|
88
|
-
}
|
|
89
|
-
destroy() {
|
|
90
|
-
this.lifecycleGeneration += 1;
|
|
91
|
-
this.initializationPromise = null;
|
|
92
|
-
this.calculatorProvider?.destroy();
|
|
93
|
-
this.calculatorProvider = null;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Derive visual line box ranges inside a root element for TTS read-along.
|
|
3
|
-
*
|
|
4
|
-
* Cloud TTS (Polly, Google, etc.) only provides word/sentence character offsets.
|
|
5
|
-
* “Lines” are layout-dependent (wrap, zoom, font size), so we compute them in
|
|
6
|
-
* the browser from the same DOM Range already used for word highlighting.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Intersect `range` with the contents of `root` (document order).
|
|
10
|
-
* Returns null if there is no non-empty intersection.
|
|
11
|
-
*/
|
|
12
|
-
export declare function intersectRangeWithElement(range: Range, root: Element): Range | null;
|
|
13
|
-
/**
|
|
14
|
-
* Returns one Range per visual line that intersects `focus`, expanded to the
|
|
15
|
-
* full width of each line within `root`. Falls back to `[intersectedFocus]`
|
|
16
|
-
* when layout or caret APIs are unavailable.
|
|
17
|
-
*/
|
|
18
|
-
export declare function visualLineRangesForFocusInRoot(root: Element, focus: Range): Range[];
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Derive visual line box ranges inside a root element for TTS read-along.
|
|
3
|
-
*
|
|
4
|
-
* Cloud TTS (Polly, Google, etc.) only provides word/sentence character offsets.
|
|
5
|
-
* “Lines” are layout-dependent (wrap, zoom, font size), so we compute them in
|
|
6
|
-
* the browser from the same DOM Range already used for word highlighting.
|
|
7
|
-
*/
|
|
8
|
-
const LINE_TOP_EPSILON = 2;
|
|
9
|
-
const CARET_INSET = 1;
|
|
10
|
-
const HORIZONTAL_PROBE_STEP = 3;
|
|
11
|
-
const MAX_HORIZONTAL_PROBES = 400;
|
|
12
|
-
const MAX_LINE_RANGES = 48;
|
|
13
|
-
function caretRangeAtPoint(doc, x, y) {
|
|
14
|
-
const d = doc;
|
|
15
|
-
if (typeof d.caretRangeFromPoint === "function") {
|
|
16
|
-
try {
|
|
17
|
-
return d.caretRangeFromPoint(x, y);
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const pos = d.caretPositionFromPoint?.(x, y);
|
|
24
|
-
if (pos?.offsetNode?.nodeType === Node.TEXT_NODE ||
|
|
25
|
-
pos?.offsetNode?.nodeType === Node.ELEMENT_NODE) {
|
|
26
|
-
const r = doc.createRange();
|
|
27
|
-
try {
|
|
28
|
-
r.setStart(pos.offsetNode, pos.offset);
|
|
29
|
-
r.collapse(true);
|
|
30
|
-
return r;
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
function collapsedRangeTop(r) {
|
|
39
|
-
const rects = r.getClientRects();
|
|
40
|
-
if (rects.length === 0)
|
|
41
|
-
return null;
|
|
42
|
-
return rects[0].top;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Intersect `range` with the contents of `root` (document order).
|
|
46
|
-
* Returns null if there is no non-empty intersection.
|
|
47
|
-
*/
|
|
48
|
-
export function intersectRangeWithElement(range, root) {
|
|
49
|
-
if (typeof document === "undefined")
|
|
50
|
-
return null;
|
|
51
|
-
if (typeof range.compareBoundaryPoints !== "function")
|
|
52
|
-
return null;
|
|
53
|
-
try {
|
|
54
|
-
const doc = range.startContainer.ownerDocument || document;
|
|
55
|
-
const rootRange = doc.createRange();
|
|
56
|
-
rootRange.selectNodeContents(root);
|
|
57
|
-
if (range.compareBoundaryPoints(Range.END_TO_START, rootRange) <= 0) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
if (range.compareBoundaryPoints(Range.START_TO_END, rootRange) >= 0) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
const out = doc.createRange();
|
|
64
|
-
if (range.compareBoundaryPoints(Range.START_TO_START, rootRange) < 0) {
|
|
65
|
-
out.setStart(rootRange.startContainer, rootRange.startOffset);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
out.setStart(range.startContainer, range.startOffset);
|
|
69
|
-
}
|
|
70
|
-
if (range.compareBoundaryPoints(Range.END_TO_END, rootRange) > 0) {
|
|
71
|
-
out.setEnd(rootRange.endContainer, rootRange.endOffset);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
out.setEnd(range.endContainer, range.endOffset);
|
|
75
|
-
}
|
|
76
|
-
if (out.collapsed)
|
|
77
|
-
return null;
|
|
78
|
-
return out;
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function lineKeyForRect(top) {
|
|
85
|
-
return Math.round(top / LINE_TOP_EPSILON);
|
|
86
|
-
}
|
|
87
|
-
function extendLineEdge(doc, root, refTop, midY, startX, rootLeft, rootRight, direction) {
|
|
88
|
-
let lastGood = null;
|
|
89
|
-
let x = startX;
|
|
90
|
-
if (direction === "left") {
|
|
91
|
-
for (let i = 0; i < MAX_HORIZONTAL_PROBES && x >= rootLeft + CARET_INSET; i++) {
|
|
92
|
-
const cr = caretRangeAtPoint(doc, x, midY);
|
|
93
|
-
if (!cr || !rootContainsNode(root, cr.startContainer))
|
|
94
|
-
break;
|
|
95
|
-
const t = collapsedRangeTop(cr);
|
|
96
|
-
if (t === null || Math.abs(t - refTop) > LINE_TOP_EPSILON)
|
|
97
|
-
break;
|
|
98
|
-
lastGood = cr.cloneRange();
|
|
99
|
-
x -= HORIZONTAL_PROBE_STEP;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
for (let i = 0; i < MAX_HORIZONTAL_PROBES && x <= rootRight - CARET_INSET; i++) {
|
|
104
|
-
const cr = caretRangeAtPoint(doc, x, midY);
|
|
105
|
-
if (!cr || !rootContainsNode(root, cr.startContainer))
|
|
106
|
-
break;
|
|
107
|
-
const t = collapsedRangeTop(cr);
|
|
108
|
-
if (t === null || Math.abs(t - refTop) > LINE_TOP_EPSILON)
|
|
109
|
-
break;
|
|
110
|
-
lastGood = cr.cloneRange();
|
|
111
|
-
x += HORIZONTAL_PROBE_STEP;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return lastGood;
|
|
115
|
-
}
|
|
116
|
-
function rootContainsNode(root, node) {
|
|
117
|
-
if (typeof root.contains !== "function")
|
|
118
|
-
return false;
|
|
119
|
-
try {
|
|
120
|
-
return root.contains(node);
|
|
121
|
-
}
|
|
122
|
-
catch {
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function fallbackSingleRangeFromFocus(focus) {
|
|
127
|
-
try {
|
|
128
|
-
const doc = focus.startContainer.ownerDocument || document;
|
|
129
|
-
const r = doc.createRange();
|
|
130
|
-
r.setStart(focus.startContainer, focus.startOffset);
|
|
131
|
-
r.setEnd(focus.endContainer, focus.endOffset);
|
|
132
|
-
return [r];
|
|
133
|
-
}
|
|
134
|
-
catch {
|
|
135
|
-
return [];
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Returns one Range per visual line that intersects `focus`, expanded to the
|
|
140
|
-
* full width of each line within `root`. Falls back to `[intersectedFocus]`
|
|
141
|
-
* when layout or caret APIs are unavailable.
|
|
142
|
-
*/
|
|
143
|
-
export function visualLineRangesForFocusInRoot(root, focus) {
|
|
144
|
-
if (typeof document === "undefined")
|
|
145
|
-
return [];
|
|
146
|
-
if (!focus.startContainer) {
|
|
147
|
-
return [];
|
|
148
|
-
}
|
|
149
|
-
const doc = focus.startContainer.ownerDocument || document;
|
|
150
|
-
const intersected = intersectRangeWithElement(focus, root);
|
|
151
|
-
if (!intersected) {
|
|
152
|
-
return fallbackSingleRangeFromFocus(focus);
|
|
153
|
-
}
|
|
154
|
-
let rects;
|
|
155
|
-
try {
|
|
156
|
-
rects = Array.from(intersected.getClientRects()).filter((r) => r.width > 0 && r.height > 0);
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
return [intersected.cloneRange()];
|
|
160
|
-
}
|
|
161
|
-
if (rects.length === 0) {
|
|
162
|
-
return [intersected.cloneRange()];
|
|
163
|
-
}
|
|
164
|
-
let rootBounds;
|
|
165
|
-
try {
|
|
166
|
-
rootBounds = root.getBoundingClientRect();
|
|
167
|
-
}
|
|
168
|
-
catch {
|
|
169
|
-
return [intersected.cloneRange()];
|
|
170
|
-
}
|
|
171
|
-
const groups = new Map();
|
|
172
|
-
for (const rect of rects) {
|
|
173
|
-
const key = lineKeyForRect(rect.top);
|
|
174
|
-
const list = groups.get(key);
|
|
175
|
-
if (list)
|
|
176
|
-
list.push(rect);
|
|
177
|
-
else
|
|
178
|
-
groups.set(key, [rect]);
|
|
179
|
-
}
|
|
180
|
-
const sortedKeys = Array.from(groups.keys()).sort((a, b) => a - b);
|
|
181
|
-
const out = [];
|
|
182
|
-
for (const key of sortedKeys) {
|
|
183
|
-
if (out.length >= MAX_LINE_RANGES)
|
|
184
|
-
break;
|
|
185
|
-
const group = groups.get(key);
|
|
186
|
-
if (!group?.length)
|
|
187
|
-
continue;
|
|
188
|
-
let sumTop = 0;
|
|
189
|
-
let sumMid = 0;
|
|
190
|
-
let minL = Infinity;
|
|
191
|
-
let maxR = -Infinity;
|
|
192
|
-
for (const r of group) {
|
|
193
|
-
sumTop += r.top;
|
|
194
|
-
sumMid += r.top + r.height / 2;
|
|
195
|
-
minL = Math.min(minL, r.left);
|
|
196
|
-
maxR = Math.max(maxR, r.right);
|
|
197
|
-
}
|
|
198
|
-
const refTop = sumTop / group.length;
|
|
199
|
-
const midY = sumMid / group.length;
|
|
200
|
-
const leftEdge = extendLineEdge(doc, root, refTop, midY, minL, rootBounds.left, rootBounds.right, "left");
|
|
201
|
-
const rightEdge = extendLineEdge(doc, root, refTop, midY, maxR, rootBounds.left, rootBounds.right, "right");
|
|
202
|
-
if (!leftEdge || !rightEdge) {
|
|
203
|
-
const fallback = intersected.cloneRange();
|
|
204
|
-
return [fallback];
|
|
205
|
-
}
|
|
206
|
-
const lineRange = doc.createRange();
|
|
207
|
-
try {
|
|
208
|
-
lineRange.setStart(leftEdge.startContainer, leftEdge.startOffset);
|
|
209
|
-
lineRange.setEnd(rightEdge.startContainer, rightEdge.startOffset);
|
|
210
|
-
}
|
|
211
|
-
catch {
|
|
212
|
-
return [intersected.cloneRange()];
|
|
213
|
-
}
|
|
214
|
-
if (lineRange.collapsed) {
|
|
215
|
-
return [intersected.cloneRange()];
|
|
216
|
-
}
|
|
217
|
-
const clipped = intersectRangeWithElement(lineRange, root);
|
|
218
|
-
if (clipped && !clipped.collapsed) {
|
|
219
|
-
out.push(clipped);
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
return [intersected.cloneRange()];
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return out.length > 0 ? out : [intersected.cloneRange()];
|
|
226
|
-
}
|
package/dist/tools/client.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-only tool system exports
|
|
3
|
-
*
|
|
4
|
-
* This entry point exports only browser-safe code for use in custom elements.
|
|
5
|
-
* It excludes server-side services like accommodationResolver, variantResolver, etc.
|
|
6
|
-
*
|
|
7
|
-
* Tools should import from '@pie-players/pie-assessment-toolkit/tools/client' instead of
|
|
8
|
-
* '@pie-players/pie-assessment-toolkit' to ensure
|
|
9
|
-
* they don't accidentally pull in server-side dependencies.
|
|
10
|
-
*/
|
|
11
|
-
export { ResponseDiscoveryServiceImpl, responseDiscovery, } from "./response-discovery.js";
|
|
12
|
-
export * from "./types.js";
|
package/dist/tools/client.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-only tool system exports
|
|
3
|
-
*
|
|
4
|
-
* This entry point exports only browser-safe code for use in custom elements.
|
|
5
|
-
* It excludes server-side services like accommodationResolver, variantResolver, etc.
|
|
6
|
-
*
|
|
7
|
-
* Tools should import from '@pie-players/pie-assessment-toolkit/tools/client' instead of
|
|
8
|
-
* '@pie-players/pie-assessment-toolkit' to ensure
|
|
9
|
-
* they don't accidentally pull in server-side dependencies.
|
|
10
|
-
*/
|
|
11
|
-
// Response discovery (client-safe, browser-only)
|
|
12
|
-
export { ResponseDiscoveryServiceImpl, responseDiscovery, } from "./response-discovery.js";
|
|
13
|
-
// Core types (client-safe)
|
|
14
|
-
export * from "./types.js";
|
package/dist/tools/index.d.ts
DELETED
package/dist/tools/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool system exports
|
|
3
|
-
*
|
|
4
|
-
* For custom elements and client-side code, use
|
|
5
|
-
* '@pie-players/pie-assessment-toolkit/tools/client' instead.
|
|
6
|
-
*/
|
|
7
|
-
// Re-export everything from client.ts (client-safe code)
|
|
8
|
-
export * from "./client.js";
|
|
9
|
-
// Variant resolver
|
|
10
|
-
export { VariantResolverImpl } from "./variant-resolver.js";
|
package/dist/tools/internal.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registration-authoring surface.
|
|
3
|
-
*
|
|
4
|
-
* What a package outside this one needs to write a `ToolRegistration`: the
|
|
5
|
-
* registration types, the context predicates a tool answers `isVisibleInContext`
|
|
6
|
-
* with, scoped-id and element-creation helpers, the toolbar button/overlay
|
|
7
|
-
* helpers, and the provider descriptors for the two capabilities that ship a
|
|
8
|
-
* provider.
|
|
9
|
-
*
|
|
10
|
-
* A separate entry point rather than additions to `.` for the same reason
|
|
11
|
-
* `runtime/internal` and `policy/internal` exist: this is a surface for sibling
|
|
12
|
-
* packages in this repo, not a contract offered to hosts. Widening `.` with two
|
|
13
|
-
* dozen registration-authoring helpers would make every one of them something a
|
|
14
|
-
* host could reasonably expect us to keep.
|
|
15
|
-
*
|
|
16
|
-
* It exists because the packaged registrations moved out to the composition layer
|
|
17
|
-
* (`@pie-players/pie-default-tool-loaders`) so core stops naming capabilities.
|
|
18
|
-
* A host writing its own capability package imports from here too, which is the
|
|
19
|
-
* point — the mechanism is the same one our own registrations use.
|
|
20
|
-
*/
|
|
21
|
-
export type { HostedToolContext, HostedToolSize, ResolvedToolContext, ToolActivation, ToolContentDependency, ToolContentDependencyContext, ToolModuleLoader, ToolProviderDescriptor, ToolRegistration, ToolRenderElement, ToolSingletonScope, ToolSurfaceRenderContext, ToolSurfaceRenderResult, ToolSurfaceServices, ToolToolbarButtonDefinition, ToolToolbarRenderResult, ToolWindowShellConfig, ToolbarContext, } from "../services/ToolRegistry.js";
|
|
22
|
-
export { ToolRegistry } from "../services/ToolRegistry.js";
|
|
23
|
-
export { resolveToolRegistrationName } from "../services/ToolRegistry.js";
|
|
24
|
-
export type { CatalogOwnerCard, CatalogOwnerSnapshot, } from "../services/AccessibilityCatalogResolver.js";
|
|
25
|
-
export type { ToolSelectionAction, ToolSelectionContext, } from "../services/selection-action.js";
|
|
26
|
-
export type { ToolOpenRequest, ToolRequestTarget, } from "../services/tool-request.js";
|
|
27
|
-
export { resolveFallbackToolIcon, TOOL_FALLBACK_ICONS, } from "../services/tool-icons.js";
|
|
28
|
-
export type { ContentCapabilityPhase, ContentCapabilityPolicy, ResolveContentCapabilitiesArgs, ResolvedContentCapability, } from "./content-capability-resolution.js";
|
|
29
|
-
export { resolveContentCapabilities } from "./content-capability-resolution.js";
|
|
30
|
-
export type { ToolSurfaceHost, ToolSurfaceHostInput, ToolSurfaceHostOptions, ToolSurfaceHostSnapshot, ToolSurfaceScope, } from "./tool-surface-host.js";
|
|
31
|
-
export { createToolSurfaceHost } from "./tool-surface-host.js";
|
|
32
|
-
export type { ToolContext, ToolLevel } from "../services/tool-context.js";
|
|
33
|
-
export { hasChoiceInteraction, hasMathContent, hasReadableText, hasScienceContent, } from "../services/tool-context.js";
|
|
34
|
-
export { createScopedToolId } from "../services/tool-instance-id.js";
|
|
35
|
-
export type { ToolComponentFactory, ToolComponentFactoryMap, ToolComponentOverrides, ToolTagMap, } from "./tool-tag-map.js";
|
|
36
|
-
export { createToolElement, resolveToolTag, toToolIdFromTag, } from "./tool-tag-map.js";
|
|
37
|
-
export { applyOverlaySurface, createScopedVisibilityBinding, syncButtonAndOverlayVisibility, } from "./registrations/toolbar-registration-helpers.js";
|
|
38
|
-
export type { ElementToolStateStoreApi, ToolCoordinatorApi, ToolkitCoordinatorApi, TtsServiceApi, } from "../services/interfaces.js";
|
|
39
|
-
export type { ToolPlacementConfig, ToolProviderConfig, } from "../services/tools-config-normalizer.js";
|
|
40
|
-
export type { ToolConfigDiagnostic } from "../services/tool-config-validation.js";
|
|
41
|
-
export { CortexToolProvider, DesmosToolProvider, GeoGebraToolProvider, TTSToolProvider, } from "../services/tool-providers/index.js";
|
|
42
|
-
export type { NormalizedTTSSpeedOption } from "../services/tts-runtime-config.js";
|
|
43
|
-
export { buildRuntimeTTSConfig, normalizeTTSLayoutMode, normalizeTTSSpeedControlOptions, resolveRuntimeProvider, resolveTTSBackend, resolveTTSHostToolbarLayout, resolveTTSLayoutMode, resolveTTSRuntimeSettings, resolveTransportMode, } from "../services/tts-runtime-config.js";
|
package/dist/tools/internal.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registration-authoring surface.
|
|
3
|
-
*
|
|
4
|
-
* What a package outside this one needs to write a `ToolRegistration`: the
|
|
5
|
-
* registration types, the context predicates a tool answers `isVisibleInContext`
|
|
6
|
-
* with, scoped-id and element-creation helpers, the toolbar button/overlay
|
|
7
|
-
* helpers, and the provider descriptors for the two capabilities that ship a
|
|
8
|
-
* provider.
|
|
9
|
-
*
|
|
10
|
-
* A separate entry point rather than additions to `.` for the same reason
|
|
11
|
-
* `runtime/internal` and `policy/internal` exist: this is a surface for sibling
|
|
12
|
-
* packages in this repo, not a contract offered to hosts. Widening `.` with two
|
|
13
|
-
* dozen registration-authoring helpers would make every one of them something a
|
|
14
|
-
* host could reasonably expect us to keep.
|
|
15
|
-
*
|
|
16
|
-
* It exists because the packaged registrations moved out to the composition layer
|
|
17
|
-
* (`@pie-players/pie-default-tool-loaders`) so core stops naming capabilities.
|
|
18
|
-
* A host writing its own capability package imports from here too, which is the
|
|
19
|
-
* point — the mechanism is the same one our own registrations use.
|
|
20
|
-
*/
|
|
21
|
-
export { ToolRegistry } from "../services/ToolRegistry.js";
|
|
22
|
-
// A registration's own display name in the interface locale. A tool window's
|
|
23
|
-
// title is the registration's name, so the shell needs the same `nameKey`-then-
|
|
24
|
-
// `name` precedence the toolbar uses rather than the raw English field.
|
|
25
|
-
export { resolveToolRegistrationName } from "../services/ToolRegistry.js";
|
|
26
|
-
// So a gateway button and the toolbar button for the same tool draw one icon.
|
|
27
|
-
export { resolveFallbackToolIcon, TOOL_FALLBACK_ICONS, } from "../services/tool-icons.js";
|
|
28
|
-
export { resolveContentCapabilities } from "./content-capability-resolution.js";
|
|
29
|
-
export { createToolSurfaceHost } from "./tool-surface-host.js";
|
|
30
|
-
export { hasChoiceInteraction, hasMathContent, hasReadableText, hasScienceContent, } from "../services/tool-context.js";
|
|
31
|
-
// Scoped tool instance ids, so two placements of one tool do not share state.
|
|
32
|
-
export { createScopedToolId } from "../services/tool-instance-id.js";
|
|
33
|
-
export { createToolElement, resolveToolTag, toToolIdFromTag, } from "./tool-tag-map.js";
|
|
34
|
-
// Toolbar button/overlay wiring shared by every toolbar-toggle registration.
|
|
35
|
-
export { applyOverlaySurface, createScopedVisibilityBinding, syncButtonAndOverlayVisibility, } from "./registrations/toolbar-registration-helpers.js";
|
|
36
|
-
// Provider descriptors for the two packaged capabilities that ship one. These
|
|
37
|
-
// stay here rather than moving with the registrations because they are written
|
|
38
|
-
// against the `pie-calculator` and `pie-tts` contract packages, which the
|
|
39
|
-
// toolkit's own `TTSService` and provider registry also depend on.
|
|
40
|
-
export { CortexToolProvider, DesmosToolProvider, GeoGebraToolProvider, TTSToolProvider, } from "../services/tool-providers/index.js";
|
|
41
|
-
export { buildRuntimeTTSConfig, normalizeTTSLayoutMode, normalizeTTSSpeedControlOptions, resolveRuntimeProvider, resolveTTSBackend, resolveTTSHostToolbarLayout, resolveTTSLayoutMode, resolveTTSRuntimeSettings, resolveTransportMode, } from "../services/tts-runtime-config.js";
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Response Discovery Service
|
|
3
|
-
* Finds and manages PIE response components for tool-to-response integration
|
|
4
|
-
*
|
|
5
|
-
* Enables tools (e.g., calculator) to insert content into response fields
|
|
6
|
-
* Based on capability-based interface pattern (inspired by VS Code extension API)
|
|
7
|
-
*/
|
|
8
|
-
import type { ContentFormat, PIEResponseComponent, ResponseDiscoveryService } from "./types.js";
|
|
9
|
-
export declare class ResponseDiscoveryServiceImpl implements ResponseDiscoveryService {
|
|
10
|
-
private responses;
|
|
11
|
-
private activeResponseId;
|
|
12
|
-
private activeResponseListeners;
|
|
13
|
-
/**
|
|
14
|
-
* Get currently active (focused) response component
|
|
15
|
-
*/
|
|
16
|
-
getActiveResponse(): PIEResponseComponent | null;
|
|
17
|
-
/**
|
|
18
|
-
* Get response by ID
|
|
19
|
-
*/
|
|
20
|
-
getResponse(responseId: string): PIEResponseComponent | null;
|
|
21
|
-
/**
|
|
22
|
-
* Get all registered responses
|
|
23
|
-
*/
|
|
24
|
-
getAllResponses(): PIEResponseComponent[];
|
|
25
|
-
/**
|
|
26
|
-
* Get responses that accept a specific content format
|
|
27
|
-
*/
|
|
28
|
-
getResponsesAccepting(format: ContentFormat): PIEResponseComponent[];
|
|
29
|
-
/**
|
|
30
|
-
* Register a response component
|
|
31
|
-
*/
|
|
32
|
-
registerResponse(response: PIEResponseComponent): void;
|
|
33
|
-
/**
|
|
34
|
-
* Unregister a response component
|
|
35
|
-
*/
|
|
36
|
-
unregisterResponse(responseId: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* Explicitly signal that a registered response is active.
|
|
39
|
-
*/
|
|
40
|
-
signalActive(responseId: string): void;
|
|
41
|
-
/**
|
|
42
|
-
* Explicitly signal that a response is no longer active.
|
|
43
|
-
*/
|
|
44
|
-
signalInactive(responseId: string): void;
|
|
45
|
-
/**
|
|
46
|
-
* Set active response (internal use)
|
|
47
|
-
*/
|
|
48
|
-
private setActiveResponse;
|
|
49
|
-
/**
|
|
50
|
-
* Listen for active response changes
|
|
51
|
-
*/
|
|
52
|
-
onActiveResponseChanged(listener: (response: PIEResponseComponent | null) => void): void;
|
|
53
|
-
/**
|
|
54
|
-
* Clear all responses (for cleanup)
|
|
55
|
-
*/
|
|
56
|
-
clear(): void;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Singleton instance
|
|
60
|
-
*/
|
|
61
|
-
export declare const responseDiscovery: ResponseDiscoveryServiceImpl;
|