@pie-players/pie-assessment-toolkit 0.3.43 → 0.3.45
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 +54 -69
- package/dist/attempt/AssessmentSession.d.ts +0 -1
- package/dist/attempt/AssessmentSession.js.map +1 -1
- package/dist/attempt/TestSession.d.ts +0 -1
- package/dist/attempt/TestSession.js.map +1 -1
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts +0 -1
- package/dist/attempt/adapters/activity-to-test-attempt-session.js.map +1 -1
- package/dist/components/ItemToolBar.custom-element.js +1607 -428
- package/dist/components/PieAssessmentToolkit.custom-element.js +19498 -3590
- package/dist/components/SectionToolBar.custom-element.js +1887 -611
- package/dist/components/item-toolbar-element.d.ts +0 -1
- package/dist/components/item-toolbar-element.js.map +1 -1
- package/dist/components/pie-assessment-toolkit-element.d.ts +0 -1
- package/dist/components/pie-assessment-toolkit-element.js.map +1 -1
- package/dist/components/section-toolbar-element.d.ts +0 -1
- package/dist/components/section-toolbar-element.js.map +1 -1
- package/dist/components/vendor/nds/README.md +110 -0
- package/dist/components/vendor/nds/nds-icon-button.js +826 -0
- package/dist/context/assessment-toolkit-context.d.ts +0 -1
- package/dist/context/assessment-toolkit-context.js.map +1 -1
- package/dist/context/runtime-context-consumer.d.ts +0 -1
- package/dist/context/runtime-context-consumer.js.map +1 -1
- package/dist/index.d.ts +3 -7
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/item-loader.d.ts +0 -1
- package/dist/item-loader.js.map +1 -1
- package/dist/policy/core/PolicySource.d.ts +0 -1
- package/dist/policy/core/PolicySource.js.map +1 -1
- package/dist/policy/core/ToolPolicyEngine.d.ts +1 -3
- package/dist/policy/core/ToolPolicyEngine.js +1 -2
- package/dist/policy/core/ToolPolicyEngine.js.map +1 -1
- package/dist/policy/core/compose-decision.d.ts +0 -1
- package/dist/policy/core/compose-decision.js.map +1 -1
- package/dist/policy/core/decision-types.d.ts +0 -1
- package/dist/policy/core/decision-types.js.map +1 -1
- package/dist/policy/core/engine-context.d.ts +0 -1
- package/dist/policy/core/engine-context.js.map +1 -1
- package/dist/policy/core/pnp-policy-inputs.d.ts +2 -4
- package/dist/policy/core/pnp-policy-inputs.js +2 -3
- package/dist/policy/core/pnp-policy-inputs.js.map +1 -1
- package/dist/policy/core/policy-source-tag.d.ts +0 -1
- package/dist/policy/core/policy-source-tag.js.map +1 -1
- package/dist/policy/core/provenance.d.ts +7 -35
- package/dist/policy/core/provenance.js +4 -21
- package/dist/policy/core/provenance.js.map +1 -1
- package/dist/policy/engine.d.ts +0 -1
- package/dist/policy/engine.js.map +1 -1
- package/dist/policy/internal.d.ts +0 -1
- package/dist/policy/internal.js.map +1 -1
- package/dist/policy/sources/PnpPolicySource.d.ts +6 -20
- package/dist/policy/sources/PnpPolicySource.js +6 -19
- package/dist/policy/sources/PnpPolicySource.js.map +1 -1
- package/dist/runtime/RuntimeRegistry.d.ts +0 -1
- package/dist/runtime/RuntimeRegistry.js.map +1 -1
- package/dist/runtime/SectionRuntimeEngine.d.ts +13 -29
- package/dist/runtime/SectionRuntimeEngine.js +13 -27
- package/dist/runtime/SectionRuntimeEngine.js.map +1 -1
- package/dist/runtime/adapter/SectionEngineAdapter.d.ts +2 -3
- package/dist/runtime/adapter/SectionEngineAdapter.js +2 -2
- package/dist/runtime/adapter/SectionEngineAdapter.js.map +1 -1
- package/dist/runtime/adapter/coordinator-bridge.d.ts +1 -2
- package/dist/runtime/adapter/coordinator-bridge.js +1 -1
- package/dist/runtime/adapter/coordinator-bridge.js.map +1 -1
- package/dist/runtime/adapter/dom-event-bridge.d.ts +1 -2
- package/dist/runtime/adapter/dom-event-bridge.js +1 -1
- package/dist/runtime/adapter/dom-event-bridge.js.map +1 -1
- package/dist/runtime/adapter/framework-error-bridge.d.ts +0 -1
- package/dist/runtime/adapter/framework-error-bridge.js.map +1 -1
- package/dist/runtime/adapter/instrumentation-bridge.d.ts +0 -1
- package/dist/runtime/adapter/instrumentation-bridge.js.map +1 -1
- package/dist/runtime/adapter/subscriber-fanout.d.ts +0 -1
- package/dist/runtime/adapter/subscriber-fanout.js.map +1 -1
- package/dist/runtime/catalog-registration.d.ts +12 -0
- package/dist/runtime/catalog-registration.js +54 -0
- package/dist/runtime/catalog-registration.js.map +1 -0
- package/dist/runtime/core/SectionEngineCore.d.ts +0 -1
- package/dist/runtime/core/SectionEngineCore.js.map +1 -1
- package/dist/runtime/core/cohort.d.ts +0 -1
- package/dist/runtime/core/cohort.js.map +1 -1
- package/dist/runtime/core/engine-input.d.ts +0 -1
- package/dist/runtime/core/engine-input.js.map +1 -1
- package/dist/runtime/core/engine-output.d.ts +2 -3
- package/dist/runtime/core/engine-output.js +2 -2
- package/dist/runtime/core/engine-output.js.map +1 -1
- package/dist/runtime/core/engine-readiness.d.ts +2 -3
- package/dist/runtime/core/engine-readiness.js.map +1 -1
- package/dist/runtime/core/engine-resolver.d.ts +13 -42
- package/dist/runtime/core/engine-resolver.js +19 -76
- package/dist/runtime/core/engine-resolver.js.map +1 -1
- package/dist/runtime/core/engine-stage-derivation.d.ts +0 -1
- package/dist/runtime/core/engine-stage-derivation.js.map +1 -1
- package/dist/runtime/core/engine-state.d.ts +0 -1
- package/dist/runtime/core/engine-state.js.map +1 -1
- package/dist/runtime/core/engine-transition.d.ts +1 -2
- package/dist/runtime/core/engine-transition.js +1 -1
- package/dist/runtime/core/engine-transition.js.map +1 -1
- package/dist/runtime/engine-context.d.ts +0 -1
- package/dist/runtime/engine-context.js.map +1 -1
- package/dist/runtime/engine.d.ts +1 -2
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/internal.d.ts +0 -1
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/registration-events.d.ts +0 -1
- package/dist/runtime/registration-events.js.map +1 -1
- package/dist/runtime/runtime-id.d.ts +0 -1
- package/dist/runtime/runtime-id.js.map +1 -1
- package/dist/runtime/section-runtime-engine-host-context.d.ts +22 -16
- package/dist/runtime/section-runtime-engine-host-context.js +10 -10
- package/dist/runtime/section-runtime-engine-host-context.js.map +1 -1
- package/dist/runtime/session-event-emitter-policy.d.ts +0 -1
- package/dist/runtime/session-event-emitter-policy.js.map +1 -1
- package/dist/runtime/stage-emit-gate.d.ts +4 -5
- package/dist/runtime/stage-emit-gate.js +3 -3
- package/dist/runtime/stage-emit-gate.js.map +1 -1
- package/dist/runtime/tool-host-contract.d.ts +0 -1
- package/dist/runtime/tool-host-contract.js.map +1 -1
- package/dist/services/AccessibilityCatalogResolver.d.ts +23 -1
- package/dist/services/AccessibilityCatalogResolver.js +200 -28
- package/dist/services/AccessibilityCatalogResolver.js.map +1 -1
- package/dist/services/ContextVariableStore.d.ts +0 -1
- package/dist/services/ContextVariableStore.js.map +1 -1
- package/dist/services/ElementToolStateStore.d.ts +0 -1
- package/dist/services/ElementToolStateStore.js.map +1 -1
- package/dist/services/HighlightCoordinator.d.ts +25 -1
- package/dist/services/HighlightCoordinator.js +125 -0
- package/dist/services/HighlightCoordinator.js.map +1 -1
- package/dist/services/I18nService.d.ts +0 -1
- package/dist/services/I18nService.js.map +1 -1
- package/dist/services/RangeSerializer.d.ts +0 -1
- package/dist/services/RangeSerializer.js.map +1 -1
- package/dist/services/SSMLExtractor.d.ts +16 -2
- package/dist/services/SSMLExtractor.js +86 -7
- package/dist/services/SSMLExtractor.js.map +1 -1
- package/dist/services/TTSService.d.ts +30 -5
- package/dist/services/TTSService.js +652 -159
- package/dist/services/TTSService.js.map +1 -1
- package/dist/services/ThemeProvider.d.ts +0 -1
- package/dist/services/ThemeProvider.js.map +1 -1
- package/dist/services/ToolConfigResolver.d.ts +0 -1
- package/dist/services/ToolConfigResolver.js.map +1 -1
- package/dist/services/ToolCoordinator.d.ts +0 -1
- package/dist/services/ToolCoordinator.js.map +1 -1
- package/dist/services/ToolRegistry.d.ts +2 -3
- package/dist/services/ToolRegistry.js +1 -1
- package/dist/services/ToolRegistry.js.map +1 -1
- package/dist/services/ToolkitCoordinator.d.ts +16 -74
- package/dist/services/ToolkitCoordinator.js +34 -113
- package/dist/services/ToolkitCoordinator.js.map +1 -1
- package/dist/services/create-tools-config.d.ts +0 -1
- package/dist/services/create-tools-config.js.map +1 -1
- package/dist/services/createDefaultToolRegistry.d.ts +0 -1
- package/dist/services/createDefaultToolRegistry.js.map +1 -1
- package/dist/services/defaultPersonalNeedsProfile.d.ts +0 -1
- package/dist/services/defaultPersonalNeedsProfile.js.map +1 -1
- package/dist/services/framework-error-bus.d.ts +0 -1
- package/dist/services/framework-error-bus.js.map +1 -1
- package/dist/services/framework-error.d.ts +0 -1
- package/dist/services/framework-error.js.map +1 -1
- package/dist/services/interfaces.d.ts +20 -3
- package/dist/services/interfaces.js.map +1 -1
- package/dist/services/pnp-standard-features.d.ts +0 -1
- package/dist/services/pnp-standard-features.js.map +1 -1
- package/dist/services/section-controller-types.d.ts +0 -1
- package/dist/services/section-controller-types.js.map +1 -1
- package/dist/services/tool-config-defaults.d.ts +0 -1
- package/dist/services/tool-config-defaults.js.map +1 -1
- package/dist/services/tool-config-validation.d.ts +1 -2
- package/dist/services/tool-config-validation.js +7 -7
- package/dist/services/tool-config-validation.js.map +1 -1
- package/dist/services/tool-context.d.ts +0 -1
- package/dist/services/tool-context.js.map +1 -1
- package/dist/services/tool-instance-id.d.ts +0 -1
- package/dist/services/tool-instance-id.js +1 -1
- package/dist/services/tool-instance-id.js.map +1 -1
- package/dist/services/tool-providers/DesmosToolProvider.d.ts +0 -1
- package/dist/services/tool-providers/DesmosToolProvider.js.map +1 -1
- package/dist/services/tool-providers/TTSToolProvider.d.ts +0 -1
- package/dist/services/tool-providers/TTSToolProvider.js +3 -3
- package/dist/services/tool-providers/TTSToolProvider.js.map +1 -1
- package/dist/services/tool-providers/ToolProviderApi.d.ts +0 -1
- package/dist/services/tool-providers/ToolProviderApi.js.map +1 -1
- package/dist/services/tool-providers/ToolProviderRegistry.d.ts +0 -1
- package/dist/services/tool-providers/ToolProviderRegistry.js.map +1 -1
- package/dist/services/tool-providers/index.d.ts +0 -1
- package/dist/services/tool-providers/index.js.map +1 -1
- package/dist/services/toolbar-items.d.ts +0 -1
- package/dist/services/toolbar-items.js.map +1 -1
- package/dist/services/tools-config-normalizer.d.ts +13 -3
- package/dist/services/tools-config-normalizer.js +3 -8
- package/dist/services/tools-config-normalizer.js.map +1 -1
- package/dist/services/tts/browser-provider.d.ts +0 -1
- package/dist/services/tts/browser-provider.js +2 -0
- package/dist/services/tts/browser-provider.js.map +1 -1
- package/dist/services/tts/catalog-span-alignment.d.ts +39 -0
- package/dist/services/tts/catalog-span-alignment.js +300 -0
- package/dist/services/tts/catalog-span-alignment.js.map +1 -0
- package/dist/services/tts/generated-speech/assemble-plan.d.ts +33 -0
- package/dist/services/tts/generated-speech/assemble-plan.js +111 -0
- package/dist/services/tts/generated-speech/assemble-plan.js.map +1 -0
- package/dist/services/tts/generated-speech/dom/build-dom-plan.d.ts +25 -0
- package/dist/services/tts/generated-speech/dom/build-dom-plan.js +66 -0
- package/dist/services/tts/generated-speech/dom/build-dom-plan.js.map +1 -0
- package/dist/services/tts/generated-speech/dom/to-chunk-inputs.d.ts +19 -0
- package/dist/services/tts/generated-speech/dom/to-chunk-inputs.js +71 -0
- package/dist/services/tts/generated-speech/dom/to-chunk-inputs.js.map +1 -0
- package/dist/services/tts/generated-speech/dom/types.d.ts +37 -0
- package/dist/services/tts/generated-speech/dom/types.js +2 -0
- package/dist/services/tts/generated-speech/dom/types.js.map +1 -0
- package/dist/services/tts/generated-speech/index.d.ts +17 -0
- package/dist/services/tts/generated-speech/index.js +17 -0
- package/dist/services/tts/generated-speech/index.js.map +1 -0
- package/dist/services/tts/generated-speech/math-speech-cache.d.ts +15 -0
- package/dist/services/tts/generated-speech/math-speech-cache.js +78 -0
- package/dist/services/tts/generated-speech/math-speech-cache.js.map +1 -0
- package/dist/services/tts/generated-speech/types.d.ts +104 -0
- package/dist/services/tts/generated-speech/types.js +18 -0
- package/dist/services/tts/generated-speech/types.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/boundary-normalizer.d.ts +2 -0
- package/dist/services/tts/highlight-pipeline/boundary-normalizer.js +106 -0
- package/dist/services/tts/highlight-pipeline/boundary-normalizer.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/create-highlight-plan.d.ts +6 -0
- package/dist/services/tts/highlight-pipeline/create-highlight-plan.js +217 -0
- package/dist/services/tts/highlight-pipeline/create-highlight-plan.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/highlight-policy.d.ts +2 -0
- package/dist/services/tts/highlight-pipeline/highlight-policy.js +32 -0
- package/dist/services/tts/highlight-pipeline/highlight-policy.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/index.d.ts +9 -0
- package/dist/services/tts/highlight-pipeline/index.js +9 -0
- package/dist/services/tts/highlight-pipeline/index.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/math-semantic-resolver.d.ts +3 -0
- package/dist/services/tts/highlight-pipeline/math-semantic-resolver.js +32 -0
- package/dist/services/tts/highlight-pipeline/math-semantic-resolver.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.d.ts +29 -0
- package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.js +44 -0
- package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.d.ts +2 -0
- package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.js +20 -0
- package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/readable-region.d.ts +1 -0
- package/dist/services/tts/highlight-pipeline/readable-region.js +19 -0
- package/dist/services/tts/highlight-pipeline/readable-region.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/rendered-math-target-resolver.d.ts +6 -0
- package/dist/services/tts/highlight-pipeline/rendered-math-target-resolver.js +198 -0
- package/dist/services/tts/highlight-pipeline/rendered-math-target-resolver.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/types.d.ts +72 -0
- package/dist/services/tts/highlight-pipeline/types.js +2 -0
- package/dist/services/tts/highlight-pipeline/types.js.map +1 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.d.ts +2 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.js +22 -0
- package/dist/services/tts/highlight-pipeline/visible-map-range.js.map +1 -0
- package/dist/services/tts/math-alignment/index.d.ts +30 -0
- package/dist/services/tts/math-alignment/index.js +66 -0
- package/dist/services/tts/math-alignment/index.js.map +1 -0
- package/dist/services/tts/math-alignment/mathml-tokenizer.d.ts +2 -0
- package/dist/services/tts/math-alignment/mathml-tokenizer.js +317 -0
- package/dist/services/tts/math-alignment/mathml-tokenizer.js.map +1 -0
- package/dist/services/tts/math-alignment/range-resolver.d.ts +10 -0
- package/dist/services/tts/math-alignment/range-resolver.js +13 -0
- package/dist/services/tts/math-alignment/range-resolver.js.map +1 -0
- package/dist/services/tts/math-alignment/sequence-aligner.d.ts +7 -0
- package/dist/services/tts/math-alignment/sequence-aligner.js +119 -0
- package/dist/services/tts/math-alignment/sequence-aligner.js.map +1 -0
- package/dist/services/tts/math-alignment/speech-tokenizer.d.ts +31 -0
- package/dist/services/tts/math-alignment/speech-tokenizer.js +143 -0
- package/dist/services/tts/math-alignment/speech-tokenizer.js.map +1 -0
- package/dist/services/tts/math-alignment/types.d.ts +58 -0
- package/dist/services/tts/math-alignment/types.js +2 -0
- package/dist/services/tts/math-alignment/types.js.map +1 -0
- package/dist/services/tts/math-aware-text-processing.d.ts +18 -0
- package/dist/services/tts/math-aware-text-processing.js +348 -0
- package/dist/services/tts/math-aware-text-processing.js.map +1 -0
- package/dist/services/tts/math-speech.d.ts +44 -0
- package/dist/services/tts/math-speech.js +147 -0
- package/dist/services/tts/math-speech.js.map +1 -0
- package/dist/services/tts/mathml-sanitization.d.ts +1 -0
- package/dist/services/tts/mathml-sanitization.js +170 -0
- package/dist/services/tts/mathml-sanitization.js.map +1 -0
- package/dist/services/tts/ssml/spoken-text.d.ts +33 -0
- package/dist/services/tts/ssml/spoken-text.js +159 -0
- package/dist/services/tts/ssml/spoken-text.js.map +1 -0
- package/dist/services/tts/text-processing.d.ts +3 -1
- package/dist/services/tts/text-processing.js +30 -4
- package/dist/services/tts/text-processing.js.map +1 -1
- package/dist/services/tts/text-segmentation.d.ts +0 -1
- package/dist/services/tts/text-segmentation.js.map +1 -1
- package/dist/services/tts/visual-line-ranges.d.ts +0 -1
- package/dist/services/tts/visual-line-ranges.js.map +1 -1
- package/dist/services/tts-control-events.d.ts +0 -1
- package/dist/services/tts-control-events.js.map +1 -1
- package/dist/services/tts-runtime-config.d.ts +17 -2
- package/dist/services/tts-runtime-config.js +11 -1
- package/dist/services/tts-runtime-config.js.map +1 -1
- package/dist/tools/calculators/desmos-provider.d.ts +0 -1
- package/dist/tools/calculators/desmos-provider.js.map +1 -1
- package/dist/tools/client.d.ts +0 -1
- package/dist/tools/client.js.map +1 -1
- package/dist/tools/default-tool-module-loaders.d.ts +0 -1
- package/dist/tools/default-tool-module-loaders.js.map +1 -1
- package/dist/tools/index.d.ts +0 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/library-loader.d.ts +0 -1
- package/dist/tools/library-loader.js.map +1 -1
- package/dist/tools/registrations/accessibility-tools.d.ts +0 -1
- package/dist/tools/registrations/accessibility-tools.js +0 -1
- package/dist/tools/registrations/accessibility-tools.js.map +1 -1
- package/dist/tools/registrations/calculator.d.ts +0 -1
- package/dist/tools/registrations/calculator.js +41 -2
- package/dist/tools/registrations/calculator.js.map +1 -1
- package/dist/tools/registrations/interaction-tools.d.ts +0 -1
- package/dist/tools/registrations/interaction-tools.js.map +1 -1
- package/dist/tools/registrations/measurement-tools.d.ts +0 -1
- package/dist/tools/registrations/measurement-tools.js.map +1 -1
- package/dist/tools/registrations/subject-specific-tools.d.ts +0 -1
- package/dist/tools/registrations/subject-specific-tools.js.map +1 -1
- package/dist/tools/registrations/toolbar-registration-helpers.d.ts +0 -1
- package/dist/tools/registrations/toolbar-registration-helpers.js.map +1 -1
- package/dist/tools/registrations/tts.d.ts +0 -1
- package/dist/tools/registrations/tts.js.map +1 -1
- package/dist/tools/response-discovery.d.ts +0 -1
- package/dist/tools/response-discovery.js.map +1 -1
- package/dist/tools/tool-tag-map.d.ts +0 -1
- package/dist/tools/tool-tag-map.js +0 -1
- package/dist/tools/tool-tag-map.js.map +1 -1
- package/dist/tools/types.d.ts +0 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/variant-resolver.d.ts +0 -1
- package/dist/tools/variant-resolver.js.map +1 -1
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js.map +1 -1
- package/package.json +8 -11
- package/dist/attempt/AssessmentSession.d.ts.map +0 -1
- package/dist/attempt/TestSession.d.ts.map +0 -1
- package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts.map +0 -1
- package/dist/components/item-toolbar-element.d.ts.map +0 -1
- package/dist/components/pie-assessment-toolkit-element.d.ts.map +0 -1
- package/dist/components/section-toolbar-element.d.ts.map +0 -1
- package/dist/context/assessment-toolkit-context.d.ts.map +0 -1
- package/dist/context/runtime-context-consumer.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/item-loader.d.ts.map +0 -1
- package/dist/policy/core/PolicySource.d.ts.map +0 -1
- package/dist/policy/core/ToolPolicyEngine.d.ts.map +0 -1
- package/dist/policy/core/compose-decision.d.ts.map +0 -1
- package/dist/policy/core/decision-types.d.ts.map +0 -1
- package/dist/policy/core/engine-context.d.ts.map +0 -1
- package/dist/policy/core/pnp-policy-inputs.d.ts.map +0 -1
- package/dist/policy/core/policy-source-tag.d.ts.map +0 -1
- package/dist/policy/core/provenance.d.ts.map +0 -1
- package/dist/policy/engine.d.ts.map +0 -1
- package/dist/policy/internal.d.ts.map +0 -1
- package/dist/policy/sources/PnpPolicySource.d.ts.map +0 -1
- package/dist/runtime/RuntimeRegistry.d.ts.map +0 -1
- package/dist/runtime/SectionRuntimeEngine.d.ts.map +0 -1
- package/dist/runtime/adapter/SectionEngineAdapter.d.ts.map +0 -1
- package/dist/runtime/adapter/coordinator-bridge.d.ts.map +0 -1
- package/dist/runtime/adapter/dom-event-bridge.d.ts.map +0 -1
- package/dist/runtime/adapter/framework-error-bridge.d.ts.map +0 -1
- package/dist/runtime/adapter/instrumentation-bridge.d.ts.map +0 -1
- package/dist/runtime/adapter/subscriber-fanout.d.ts.map +0 -1
- package/dist/runtime/core/SectionEngineCore.d.ts.map +0 -1
- package/dist/runtime/core/cohort.d.ts.map +0 -1
- package/dist/runtime/core/engine-input.d.ts.map +0 -1
- package/dist/runtime/core/engine-output.d.ts.map +0 -1
- package/dist/runtime/core/engine-readiness.d.ts.map +0 -1
- package/dist/runtime/core/engine-resolver.d.ts.map +0 -1
- package/dist/runtime/core/engine-stage-derivation.d.ts.map +0 -1
- package/dist/runtime/core/engine-state.d.ts.map +0 -1
- package/dist/runtime/core/engine-transition.d.ts.map +0 -1
- package/dist/runtime/engine-context.d.ts.map +0 -1
- package/dist/runtime/engine.d.ts.map +0 -1
- package/dist/runtime/internal.d.ts.map +0 -1
- package/dist/runtime/registration-events.d.ts.map +0 -1
- package/dist/runtime/runtime-id.d.ts.map +0 -1
- package/dist/runtime/section-runtime-engine-host-context.d.ts.map +0 -1
- package/dist/runtime/session-event-emitter-policy.d.ts.map +0 -1
- package/dist/runtime/stage-emit-gate.d.ts.map +0 -1
- package/dist/runtime/tool-host-contract.d.ts.map +0 -1
- package/dist/services/AccessibilityCatalogResolver.d.ts.map +0 -1
- package/dist/services/ContextVariableStore.d.ts.map +0 -1
- package/dist/services/ElementToolStateStore.d.ts.map +0 -1
- package/dist/services/HighlightCoordinator.d.ts.map +0 -1
- package/dist/services/I18nService.d.ts.map +0 -1
- package/dist/services/PNPToolResolver.d.ts +0 -281
- package/dist/services/PNPToolResolver.d.ts.map +0 -1
- package/dist/services/PNPToolResolver.js +0 -514
- package/dist/services/PNPToolResolver.js.map +0 -1
- package/dist/services/RangeSerializer.d.ts.map +0 -1
- package/dist/services/SSMLExtractor.d.ts.map +0 -1
- package/dist/services/TTSService.d.ts.map +0 -1
- package/dist/services/ThemeProvider.d.ts.map +0 -1
- package/dist/services/ToolConfigResolver.d.ts.map +0 -1
- package/dist/services/ToolCoordinator.d.ts.map +0 -1
- package/dist/services/ToolRegistry.d.ts.map +0 -1
- package/dist/services/ToolkitCoordinator.d.ts.map +0 -1
- package/dist/services/create-tools-config.d.ts.map +0 -1
- package/dist/services/createDefaultToolRegistry.d.ts.map +0 -1
- package/dist/services/defaultPersonalNeedsProfile.d.ts.map +0 -1
- package/dist/services/framework-error-bus.d.ts.map +0 -1
- package/dist/services/framework-error.d.ts.map +0 -1
- package/dist/services/interfaces.d.ts.map +0 -1
- package/dist/services/pnp-provenance.d.ts +0 -167
- package/dist/services/pnp-provenance.d.ts.map +0 -1
- package/dist/services/pnp-provenance.js +0 -231
- package/dist/services/pnp-provenance.js.map +0 -1
- package/dist/services/pnp-standard-features.d.ts.map +0 -1
- package/dist/services/section-controller-types.d.ts.map +0 -1
- package/dist/services/tool-config-defaults.d.ts.map +0 -1
- package/dist/services/tool-config-validation.d.ts.map +0 -1
- package/dist/services/tool-context.d.ts.map +0 -1
- package/dist/services/tool-instance-id.d.ts.map +0 -1
- package/dist/services/tool-providers/DesmosToolProvider.d.ts.map +0 -1
- package/dist/services/tool-providers/TTSToolProvider.d.ts.map +0 -1
- package/dist/services/tool-providers/ToolProviderApi.d.ts.map +0 -1
- package/dist/services/tool-providers/ToolProviderRegistry.d.ts.map +0 -1
- package/dist/services/tool-providers/index.d.ts.map +0 -1
- package/dist/services/toolbar-items.d.ts.map +0 -1
- package/dist/services/tools-config-normalizer.d.ts.map +0 -1
- package/dist/services/tts/browser-provider.d.ts.map +0 -1
- package/dist/services/tts/text-processing.d.ts.map +0 -1
- package/dist/services/tts/text-segmentation.d.ts.map +0 -1
- package/dist/services/tts/visual-line-ranges.d.ts.map +0 -1
- package/dist/services/tts-control-events.d.ts.map +0 -1
- package/dist/services/tts-runtime-config.d.ts.map +0 -1
- package/dist/tools/calculators/desmos-provider.d.ts.map +0 -1
- package/dist/tools/client.d.ts.map +0 -1
- package/dist/tools/default-tool-module-loaders.d.ts.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/library-loader.d.ts.map +0 -1
- package/dist/tools/registrations/accessibility-tools.d.ts.map +0 -1
- package/dist/tools/registrations/calculator.d.ts.map +0 -1
- package/dist/tools/registrations/interaction-tools.d.ts.map +0 -1
- package/dist/tools/registrations/measurement-tools.d.ts.map +0 -1
- package/dist/tools/registrations/subject-specific-tools.d.ts.map +0 -1
- package/dist/tools/registrations/toolbar-registration-helpers.d.ts.map +0 -1
- package/dist/tools/registrations/tts.d.ts.map +0 -1
- package/dist/tools/response-discovery.d.ts.map +0 -1
- package/dist/tools/tool-tag-map.d.ts.map +0 -1
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/variant-resolver.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
|
@@ -18,11 +18,9 @@
|
|
|
18
18
|
* `packages/section-player/src/components/shared/section-player-host-runtime.ts`)
|
|
19
19
|
* hands its local implementation in.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* `engine-resolver.test.ts` is the guardrail.
|
|
21
|
+
* Runtime-owned configuration flows through `runtime.<key>`. Layout-only
|
|
22
|
+
* inputs stay on the section-player host elements.
|
|
24
23
|
*/
|
|
25
|
-
import { parseToolList } from "../../services/tools-config-normalizer.js";
|
|
26
24
|
export const DEFAULT_ASSESSMENT_ID = "section-demo-direct";
|
|
27
25
|
export const DEFAULT_PLAYER_TYPE = "iife";
|
|
28
26
|
export const DEFAULT_LAZY_INIT = true;
|
|
@@ -49,108 +47,53 @@ export function resolveOnFrameworkError(args) {
|
|
|
49
47
|
return args.onFrameworkError;
|
|
50
48
|
}
|
|
51
49
|
export function resolveToolsConfig(args) {
|
|
52
|
-
const runtimeTools = (args.runtime?.tools ||
|
|
53
|
-
// `runtime.enabledTools` is the canonical mirror; the kebab attribute is
|
|
54
|
-
// the easy-tier alias. Per Decision B1, it merges into
|
|
55
|
-
// `tools.placement.section`. The object form (`runtime.tools`) keeps
|
|
56
|
-
// precedence over both — that lock lives in the merge below.
|
|
57
|
-
//
|
|
58
|
-
// The deprecated `item-toolbar-tools` / `passage-toolbar-tools`
|
|
59
|
-
// per-region aliases were removed in the broad architecture review
|
|
60
|
-
// compat sweep; hosts must populate `tools.placement.item` /
|
|
61
|
-
// `tools.placement.passage` (object form) or
|
|
62
|
-
// `runtime.tools.placement.{item,passage}` directly.
|
|
63
|
-
const effectiveEnabledTools = pick(args.runtime?.enabledTools, args.enabledTools) ?? "";
|
|
64
|
-
const sectionTools = parseToolList(effectiveEnabledTools);
|
|
50
|
+
const runtimeTools = (args.runtime?.tools || {});
|
|
65
51
|
const placement = (runtimeTools.placement || {});
|
|
66
|
-
const overlayToolsConfig = {
|
|
67
|
-
...runtimeTools,
|
|
68
|
-
placement: {
|
|
69
|
-
...placement,
|
|
70
|
-
...(sectionTools.length > 0 ? { section: sectionTools } : {}),
|
|
71
|
-
},
|
|
72
|
-
};
|
|
52
|
+
const overlayToolsConfig = { ...runtimeTools, placement: { ...placement } };
|
|
73
53
|
// Keep host-provided shape intact; framework-owned validation surfaces malformed config.
|
|
74
54
|
return overlayToolsConfig;
|
|
75
55
|
}
|
|
76
56
|
export function resolveRuntime(args) {
|
|
77
57
|
const r = args.runtime || {};
|
|
78
|
-
const
|
|
79
|
-
const runtimePlayer = (r.player || {});
|
|
80
|
-
const mergedPlayerCandidate = {
|
|
81
|
-
...topLevelPlayer,
|
|
82
|
-
...runtimePlayer,
|
|
83
|
-
loaderOptions: {
|
|
84
|
-
...(topLevelPlayer.loaderOptions || {}),
|
|
85
|
-
...(runtimePlayer.loaderOptions || {}),
|
|
86
|
-
},
|
|
87
|
-
loaderConfig: {
|
|
88
|
-
...(topLevelPlayer.loaderConfig || {}),
|
|
89
|
-
...(runtimePlayer.loaderConfig || {}),
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
const mergedPlayer = Object.keys(mergedPlayerCandidate).length > 0
|
|
93
|
-
? mergedPlayerCandidate
|
|
94
|
-
: null;
|
|
58
|
+
const runtimePlayer = r.player ? { ...r.player } : null;
|
|
95
59
|
return {
|
|
96
60
|
...r,
|
|
97
61
|
assessmentId: pick(r.assessmentId, args.assessmentId),
|
|
98
|
-
playerType:
|
|
99
|
-
player:
|
|
100
|
-
lazyInit:
|
|
101
|
-
accessibility:
|
|
102
|
-
coordinator:
|
|
62
|
+
playerType: r.playerType ?? DEFAULT_PLAYER_TYPE,
|
|
63
|
+
player: runtimePlayer,
|
|
64
|
+
lazyInit: r.lazyInit ?? DEFAULT_LAZY_INIT,
|
|
65
|
+
accessibility: r.accessibility ?? null,
|
|
66
|
+
coordinator: r.coordinator ?? null,
|
|
103
67
|
createSectionController: r.createSectionController,
|
|
104
68
|
isolation: r.isolation ?? DEFAULT_ISOLATION,
|
|
105
|
-
env:
|
|
69
|
+
env: r.env ?? DEFAULT_ENV,
|
|
106
70
|
toolConfigStrictness: pick(r.toolConfigStrictness, args.toolConfigStrictness) ?? "error",
|
|
107
|
-
//
|
|
108
|
-
//
|
|
71
|
+
// Runtime callback wins; top-level callback remains a layout CE event
|
|
72
|
+
// convenience for hosts that do not use DOM listeners.
|
|
109
73
|
onFrameworkError: resolveOnFrameworkError({
|
|
110
74
|
runtime: args.runtime,
|
|
111
75
|
onFrameworkError: args.onFrameworkError,
|
|
112
76
|
}),
|
|
113
|
-
//
|
|
114
|
-
// other tier-1 surface: `runtime.onStageChange` wins over the
|
|
115
|
-
// top-level prop.
|
|
77
|
+
// Runtime callback wins over the top-level callback prop.
|
|
116
78
|
onStageChange: pick(r.onStageChange, args.onStageChange),
|
|
117
|
-
//
|
|
118
|
-
// rule.
|
|
79
|
+
// Runtime callback wins over the top-level callback prop.
|
|
119
80
|
onLoadingComplete: pick(r.onLoadingComplete, args.onLoadingComplete),
|
|
120
81
|
tools: args.effectiveToolsConfig,
|
|
121
82
|
};
|
|
122
83
|
}
|
|
123
84
|
/**
|
|
124
|
-
* Engine-side orchestrator that
|
|
125
|
-
*
|
|
85
|
+
* Engine-side orchestrator that powers `resolveSectionPlayerRuntimeState`
|
|
86
|
+
* from section-player and takes
|
|
126
87
|
* `resolvePlayerRuntime` as an injected callable so the toolkit core
|
|
127
88
|
* stays free of host-coupled defaults (`DEFAULT_PLAYER_DEFINITIONS`).
|
|
128
|
-
*
|
|
129
|
-
* The legacy section-player wrapper passes its local `resolvePlayerRuntime`
|
|
130
|
-
* here in M7 PR 5 when the kernel switches onto the engine.
|
|
131
89
|
*/
|
|
132
90
|
export function resolveSectionEngineRuntimeState(args, deps) {
|
|
133
91
|
const assessmentId = args.assessmentId ?? DEFAULT_ASSESSMENT_ID;
|
|
134
|
-
const playerType = args.playerType ?? DEFAULT_PLAYER_TYPE;
|
|
135
|
-
const player = args.player ?? null;
|
|
136
|
-
const lazyInit = args.lazyInit ?? DEFAULT_LAZY_INIT;
|
|
137
|
-
const accessibility = args.accessibility ?? null;
|
|
138
|
-
const coordinator = args.coordinator ?? null;
|
|
139
|
-
const env = args.env ?? null;
|
|
140
|
-
const tools = args.tools ?? null;
|
|
141
92
|
const effectiveToolsConfig = resolveToolsConfig({
|
|
142
93
|
runtime: args.runtime,
|
|
143
|
-
tools,
|
|
144
|
-
enabledTools: args.enabledTools,
|
|
145
94
|
});
|
|
146
95
|
const effectiveRuntime = resolveRuntime({
|
|
147
96
|
assessmentId,
|
|
148
|
-
playerType,
|
|
149
|
-
player,
|
|
150
|
-
lazyInit,
|
|
151
|
-
accessibility,
|
|
152
|
-
coordinator,
|
|
153
|
-
env,
|
|
154
97
|
runtime: args.runtime,
|
|
155
98
|
effectiveToolsConfig,
|
|
156
99
|
toolConfigStrictness: args.toolConfigStrictness,
|
|
@@ -160,8 +103,8 @@ export function resolveSectionEngineRuntimeState(args, deps) {
|
|
|
160
103
|
});
|
|
161
104
|
const playerRuntime = deps.resolvePlayerRuntime({
|
|
162
105
|
effectiveRuntime: effectiveRuntime,
|
|
163
|
-
playerType,
|
|
164
|
-
env,
|
|
106
|
+
playerType: String(effectiveRuntime.playerType ?? DEFAULT_PLAYER_TYPE),
|
|
107
|
+
env: effectiveRuntime.env ?? null,
|
|
165
108
|
});
|
|
166
109
|
return {
|
|
167
110
|
effectiveToolsConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-resolver.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AASH,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAC1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAG3D,CAAC;AA2EF;;;;GAIG;AACH,SAAS,IAAI,CACZ,UAAyB,EACzB,OAAsB;IAEtB,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;AACxD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAGvC;IACA,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,CAAC,gBAAgB,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC,gBAAgB,CAAC;IAChE,OAAO,IAAI,CAAC,gBAAgB,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAIlC;IACA,MAAM,YAAY,GAAG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0DAA0D;QAC1D,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC;QAEpE,KAAK,EAAE,IAAI,CAAC,oBAAoB;KAChC,CAAC;AACH,CAAC;AAUD;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC/C,IAAmB,EACnB,IAMC;IAMD,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,qBAAqB,CAAC;IAEhE,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;QAC/C,OAAO,EAAE,IAAI,CAAC,OAAO;KACrB,CAAC,CAAC;IACH,MAAM,gBAAgB,GAAG,cAAc,CAAC;QACvC,YAAY;QACZ,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,oBAAoB;QACpB,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;QAC/C,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KACzC,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC;QAC/C,gBAAgB,EAAE,gBAA2C;QAC7D,UAAU,EAAE,MAAM,CAAC,gBAAgB,CAAC,UAAU,IAAI,mBAAmB,CAAC;QACtE,GAAG,EAAG,gBAAgB,CAAC,GAAsC,IAAI,IAAI;KACrE,CAAC,CAAC;IACH,OAAO;QACN,oBAAoB;QACpB,gBAAgB;QAChB,aAAa;KACb,CAAC;AACH,CAAC","sourcesContent":["/**\n * Section runtime engine resolver (M7).\n *\n * Canonical home of `resolveRuntime`, `resolveToolsConfig`, and their\n * supporting helpers/types. As of M7 PR 7 the previous duplicates in\n * `packages/section-player/src/components/shared/section-player-runtime.ts`\n * have been deleted; section-player now consumes these helpers via\n * `@pie-players/pie-assessment-toolkit/runtime/internal`.\n *\n * What is NOT absorbed in this module:\n * - `resolvePlayerRuntime` stays in section-player because it depends on\n * `DEFAULT_PLAYER_DEFINITIONS` (which side-effect-imports the\n * item-player package). The toolkit core stays free of that\n * dependency by exposing a parametrized orchestrator —\n * `resolveSectionEngineRuntimeState` — that takes a `resolvePlayerRuntime`\n * callable. The section-player wrapper\n * (`resolveSectionPlayerRuntimeState` in\n * `packages/section-player/src/components/shared/section-player-host-runtime.ts`)\n * hands its local implementation in.\n *\n * Runtime-owned configuration flows through `runtime.<key>`. Layout-only\n * inputs stay on the section-player host elements.\n */\n\nimport type { LoaderConfig } from \"@pie-players/pie-players-shared/loader-config\";\nimport type {\n\tLoadingCompleteDetail,\n\tStageChangeDetail,\n} from \"@pie-players/pie-players-shared/pie\";\nimport type { FrameworkErrorModel } from \"../../services/framework-error.js\";\nimport type { ToolConfigStrictness } from \"../../services/tool-config-validation.js\";\n\nexport const DEFAULT_ASSESSMENT_ID = \"section-demo-direct\";\nexport const DEFAULT_PLAYER_TYPE = \"iife\";\nexport const DEFAULT_LAZY_INIT = true;\nexport const DEFAULT_ISOLATION = \"inherit\";\nexport const DEFAULT_ENV = { mode: \"gather\", role: \"student\" } as Record<\n\tstring,\n\tunknown\n>;\n\nexport type PlayerOverrides = {\n\tloaderConfig?: LoaderConfig;\n\tloaderOptions?: Record<string, unknown>;\n\t[key: string]: unknown;\n};\n\nexport type FrameworkErrorHandler = (model: FrameworkErrorModel) => void;\nexport type StageChangeHandler = (detail: StageChangeDetail) => void;\nexport type LoadingCompleteHandler = (detail: LoadingCompleteDetail) => void;\n\n/**\n * Section runtime config.\n *\n * Documented exceptions (no runtime mirror, by design): identity\n * (`section-id`, `attempt-id`, `section`); layout-only shell knobs\n * (`show-toolbar`, `toolbar-position`, etc.); and layout-shell host\n * data (`policies`, `hooks`, `toolRegistry`, `*HostButtons`). Those\n * surfaces are layout-shell concerns; the runtime engine does not see\n * them. See section-player's ARCHITECTURE.md for the full policy.\n */\nexport type RuntimeConfig = {\n\tassessmentId?: string;\n\tplayerType?: string;\n\tplayer?: PlayerOverrides | null;\n\tlazyInit?: boolean;\n\ttools?: Record<string, unknown> | null;\n\ttoolContextResolvers?: Record<string, unknown> | null;\n\taccessibility?: Record<string, unknown> | null;\n\tcoordinator?: unknown;\n\tcreateSectionController?: unknown;\n\tisolation?: string;\n\tenv?: Record<string, unknown>;\n\ttoolConfigStrictness?: ToolConfigStrictness;\n\n\t// Canonical framework-error callback.\n\tonFrameworkError?: FrameworkErrorHandler;\n\n\t// Canonical stage-change callback. The DOM event\n\t// `pie-stage-change` remains the primary channel; this callback is\n\t// the convenience surface that mirrors the event one-to-one.\n\tonStageChange?: StageChangeHandler;\n\n\t// Canonical loading-complete callback. Mirrors the\n\t// `pie-loading-complete` DOM event, which the engine dispatches\n\t// once per cohort when every item has finished loading.\n\tonLoadingComplete?: LoadingCompleteHandler;\n};\n\nexport type RuntimeInputs = {\n\tassessmentId?: string;\n\ttoolConfigStrictness?: ToolConfigStrictness;\n\tonFrameworkError?: FrameworkErrorHandler;\n\tonStageChange?: StageChangeHandler;\n\tonLoadingComplete?: LoadingCompleteHandler;\n\truntime: RuntimeConfig | null;\n};\n\n/**\n * Pick the runtime-tier value when defined, otherwise the prop/attribute\n * value. The strict mirror rule means every tier-1 surface is resolved\n * with this single helper; per-feature special-casing is forbidden.\n */\nfunction pick<T>(\n\truntimeVal: T | undefined,\n\tattrVal: T | undefined,\n): T | undefined {\n\treturn runtimeVal !== undefined ? runtimeVal : attrVal;\n}\n\n/**\n * Resolve the canonical `onFrameworkError` handler from the two-tier\n * surface. Precedence (highest first): `runtime.onFrameworkError`,\n * then top-level `onFrameworkError`. Layout CEs and the kernel call\n * this so every entry point converges on the same handler.\n */\nexport function resolveOnFrameworkError(args: {\n\truntime: RuntimeConfig | null;\n\tonFrameworkError?: FrameworkErrorHandler;\n}): FrameworkErrorHandler | undefined {\n\tconst r = args.runtime ?? {};\n\tif (r.onFrameworkError !== undefined) return r.onFrameworkError;\n\treturn args.onFrameworkError;\n}\n\nexport function resolveToolsConfig(args: {\n\truntime: RuntimeConfig | null;\n}) {\n\tconst runtimeTools = (args.runtime?.tools || {}) as Record<string, unknown>;\n\tconst placement = (runtimeTools.placement || {}) as Record<string, unknown>;\n\tconst overlayToolsConfig = { ...runtimeTools, placement: { ...placement } };\n\t// Keep host-provided shape intact; framework-owned validation surfaces malformed config.\n\treturn overlayToolsConfig;\n}\n\nexport function resolveRuntime(args: {\n\tassessmentId: string;\n\truntime: RuntimeConfig | null;\n\teffectiveToolsConfig: unknown;\n\ttoolConfigStrictness?: ToolConfigStrictness;\n\tonFrameworkError?: FrameworkErrorHandler;\n\tonStageChange?: StageChangeHandler;\n\tonLoadingComplete?: LoadingCompleteHandler;\n}) {\n\tconst r = args.runtime || {};\n\tconst runtimePlayer = r.player ? { ...r.player } : null;\n\treturn {\n\t\t...r,\n\t\tassessmentId: pick(r.assessmentId, args.assessmentId),\n\t\tplayerType: r.playerType ?? DEFAULT_PLAYER_TYPE,\n\t\tplayer: runtimePlayer,\n\t\tlazyInit: r.lazyInit ?? DEFAULT_LAZY_INIT,\n\t\taccessibility: r.accessibility ?? null,\n\t\tcoordinator: r.coordinator ?? null,\n\t\tcreateSectionController: r.createSectionController,\n\t\tisolation: r.isolation ?? DEFAULT_ISOLATION,\n\t\tenv: r.env ?? DEFAULT_ENV,\n\t\ttoolConfigStrictness:\n\t\t\tpick(r.toolConfigStrictness, args.toolConfigStrictness) ?? \"error\",\n\n\t\t// Runtime callback wins; top-level callback remains a layout CE event\n\t\t// convenience for hosts that do not use DOM listeners.\n\t\tonFrameworkError: resolveOnFrameworkError({\n\t\t\truntime: args.runtime,\n\t\t\tonFrameworkError: args.onFrameworkError,\n\t\t}),\n\n\t\t// Runtime callback wins over the top-level callback prop.\n\t\tonStageChange: pick(r.onStageChange, args.onStageChange),\n\n\t\t// Runtime callback wins over the top-level callback prop.\n\t\tonLoadingComplete: pick(r.onLoadingComplete, args.onLoadingComplete),\n\n\t\ttools: args.effectiveToolsConfig,\n\t};\n}\n\n/**\n * Effective runtime returned by `resolveRuntime`. The shape is exposed\n * as `unknown` at the public boundary because consumers spread it into\n * arbitrary host props; downstream call sites narrow with the specific\n * keys they need.\n */\nexport type EffectiveRuntime = ReturnType<typeof resolveRuntime>;\n\n/**\n * Engine-side orchestrator that powers `resolveSectionPlayerRuntimeState`\n * from section-player and takes\n * `resolvePlayerRuntime` as an injected callable so the toolkit core\n * stays free of host-coupled defaults (`DEFAULT_PLAYER_DEFINITIONS`).\n */\nexport function resolveSectionEngineRuntimeState<P>(\n\targs: RuntimeInputs,\n\tdeps: {\n\t\tresolvePlayerRuntime: (resolverArgs: {\n\t\t\teffectiveRuntime: Record<string, unknown>;\n\t\t\tplayerType: string;\n\t\t\tenv: Record<string, unknown> | null;\n\t\t}) => P;\n\t},\n): {\n\teffectiveToolsConfig: unknown;\n\teffectiveRuntime: EffectiveRuntime;\n\tplayerRuntime: P;\n} {\n\tconst assessmentId = args.assessmentId ?? DEFAULT_ASSESSMENT_ID;\n\n\tconst effectiveToolsConfig = resolveToolsConfig({\n\t\truntime: args.runtime,\n\t});\n\tconst effectiveRuntime = resolveRuntime({\n\t\tassessmentId,\n\t\truntime: args.runtime,\n\t\teffectiveToolsConfig,\n\t\ttoolConfigStrictness: args.toolConfigStrictness,\n\t\tonFrameworkError: args.onFrameworkError,\n\t\tonStageChange: args.onStageChange,\n\t\tonLoadingComplete: args.onLoadingComplete,\n\t});\n\tconst playerRuntime = deps.resolvePlayerRuntime({\n\t\teffectiveRuntime: effectiveRuntime as Record<string, unknown>,\n\t\tplayerType: String(effectiveRuntime.playerType ?? DEFAULT_PLAYER_TYPE),\n\t\tenv: (effectiveRuntime.env as Record<string, unknown> | null) ?? null,\n\t});\n\treturn {\n\t\teffectiveToolsConfig,\n\t\teffectiveRuntime,\n\t\tplayerRuntime,\n\t};\n}\n"]}
|
|
@@ -16,4 +16,3 @@
|
|
|
16
16
|
import type { Stage } from "@pie-players/pie-players-shared/pie";
|
|
17
17
|
import type { SectionEnginePhase } from "./engine-state.js";
|
|
18
18
|
export declare function phaseToStage(phase: SectionEnginePhase): Stage | null;
|
|
19
|
-
//# sourceMappingURL=engine-stage-derivation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-stage-derivation.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-stage-derivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,UAAU,YAAY,CAAC,KAAyB;IACrD,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,MAAM;YACV,OAAO,IAAI,CAAC;QACb,KAAK,iBAAiB;YACrB,OAAO,UAAU,CAAC;QACnB,KAAK,cAAc;YAClB,OAAO,cAAc,CAAC;QACvB,KAAK,aAAa;YACjB,OAAO,aAAa,CAAC;QACtB,KAAK,UAAU;YACd,OAAO,UAAU,CAAC;IACpB,CAAC;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"engine-stage-derivation.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-stage-derivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,UAAU,YAAY,CAAC,KAAyB;IACrD,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,MAAM;YACV,OAAO,IAAI,CAAC;QACb,KAAK,iBAAiB;YACrB,OAAO,UAAU,CAAC;QACnB,KAAK,cAAc;YAClB,OAAO,cAAc,CAAC;QACvB,KAAK,aAAa;YACjB,OAAO,aAAa,CAAC;QACtB,KAAK,UAAU;YACd,OAAO,UAAU,CAAC;IACpB,CAAC;AACF,CAAC","sourcesContent":["/**\n * Stage derivation for the section runtime engine (M7).\n *\n * Maps the FSM phase onto the canonical M6 stage vocabulary\n * (`composed`, `engine-ready`, `interactive`, `disposed`). The phase\n * `idle` is the engine's \"no cohort yet\" state and has no stage; it\n * returns `null`.\n *\n * This module exists as a one-line indirection because:\n * - The adapter uses it to guard `pie-stage-change` emit calls.\n * - The transition uses it (via the pure helper below) to decide\n * when to emit `stage-change` outputs as the phase advances.\n * - Future shape-specific stages (e.g. layout-only `paginated`) can\n * be wired in here without rewriting callers.\n */\n\nimport type { Stage } from \"@pie-players/pie-players-shared/pie\";\nimport type { SectionEnginePhase } from \"./engine-state.js\";\n\nexport function phaseToStage(phase: SectionEnginePhase): Stage | null {\n\tswitch (phase) {\n\t\tcase \"idle\":\n\t\t\treturn null;\n\t\tcase \"booting-section\":\n\t\t\treturn \"composed\";\n\t\tcase \"engine-ready\":\n\t\t\treturn \"engine-ready\";\n\t\tcase \"interactive\":\n\t\t\treturn \"interactive\";\n\t\tcase \"disposed\":\n\t\t\treturn \"disposed\";\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-state.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAuEH;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACvC,OAAO;QACN,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,IAAI;QACZ,kBAAkB,EAAE,KAAK;QACzB,gBAAgB,EAAE;YACjB,YAAY,EAAE,KAAK;YACnB,gBAAgB,EAAE,KAAK;YACvB,kBAAkB,EAAE,KAAK;YACzB,YAAY,EAAE,KAAK;SACnB;QACD,gBAAgB,EAAE,IAAI;QACtB,oBAAoB,EAAE,IAAI;QAC1B,sBAAsB,EAAE,KAAK;QAC7B,kBAAkB,EAAE,IAAI;QACxB,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;KACd,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"engine-state.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAuEH;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACvC,OAAO;QACN,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,IAAI;QACZ,kBAAkB,EAAE,KAAK;QACzB,gBAAgB,EAAE;YACjB,YAAY,EAAE,KAAK;YACnB,gBAAgB,EAAE,KAAK;YACvB,kBAAkB,EAAE,KAAK;YACzB,YAAY,EAAE,KAAK;SACnB;QACD,gBAAgB,EAAE,IAAI;QACtB,oBAAoB,EAAE,IAAI;QAC1B,sBAAsB,EAAE,KAAK;QAC7B,kBAAkB,EAAE,IAAI;QACxB,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;KACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * Section runtime engine state (M7 — Variant C, layered core).\n *\n * The state object is the single source of truth for stage, cohort,\n * readiness signals, and the resolved coordinator/controller handles\n * across one engine instance. The transition function in\n * `engine-transition.ts` is the only legal mutator; the adapter (M7\n * PR 2) reads the state via `SectionEngineCore.getState()` and emits\n * the bundled `SectionEngineOutput[]` to its bridges.\n *\n * Phases (the FSM). Adjustment A2 of the M7 implementation plan locks\n * this list to four phases that map 1:1 onto the M6 canonical stages:\n *\n * `idle` → no cohort yet (before `initialize`).\n * `booting-section` → cohort known, controller resolution pending. Maps to stage `composed`.\n * `engine-ready` → controller resolved. Maps to stage `engine-ready`.\n * `interactive` → readiness gate satisfied. Maps to stage `interactive`.\n * `disposed` → engine torn down. Maps to stage `disposed`.\n *\n * `loading-complete` is intentionally **not** an FSM phase — it is a\n * `SectionEngineOutput` emitted from the `interactive` phase when the\n * readiness signals satisfy `allLoadingComplete`. See\n * `engine-output.ts` for the output shape and the implementation\n * plan's Adjustment A2 fence.\n */\n\nimport type { CohortKey } from \"./cohort.js\";\nimport type { EffectiveRuntime } from \"./engine-resolver.js\";\nimport type { EngineReadinessSignals } from \"./engine-readiness.js\";\nimport type { FrameworkErrorModel } from \"../../services/framework-error.js\";\n\nexport type SectionEnginePhase =\n\t| \"idle\"\n\t| \"booting-section\"\n\t| \"engine-ready\"\n\t| \"interactive\"\n\t| \"disposed\";\n\nexport type SectionEngineState = {\n\t/** Current FSM phase. The single source of truth for stage derivation. */\n\tphase: SectionEnginePhase;\n\n\t/**\n\t * Active cohort, or `null` when the engine is `idle` or `disposed`.\n\t * `phase === \"idle\"` always implies `cohort === null`. A non-idle,\n\t * non-disposed phase always has a cohort.\n\t */\n\tcohort: CohortKey | null;\n\n\t/**\n\t * Whether the host has reported the section controller is resolved.\n\t * Latched by the `section-controller-resolved` input; the\n\t * transition uses it (along with `phase >= booting-section`) to\n\t * advance into `engine-ready`.\n\t */\n\tcontrollerResolved: boolean;\n\n\t/**\n\t * Readiness signal snapshot. Updated by `update-readiness-signals`\n\t * inputs from the host (kernel) — the engine itself does not\n\t * compute these from scratch in PR 1. Strict-mode gating is\n\t * applied at derivation time via `createReadinessDetail`, not by\n\t * mutating the signals.\n\t */\n\treadinessSignals: EngineReadinessSignals;\n\n\t/** Last resolved effective runtime (output of `resolveRuntime`). */\n\teffectiveRuntime: EffectiveRuntime | null;\n\n\t/** Last resolved tools config. */\n\teffectiveToolsConfig: unknown;\n\n\t/**\n\t * `true` once the engine has emitted `loading-complete` for the\n\t * current cohort. Re-armed on cohort change. The single-shot\n\t * semantics of the canonical `pie-loading-complete` event are\n\t * preserved by gating emission on this flag in the transition.\n\t */\n\tloadingCompleteEmitted: boolean;\n\n\t/**\n\t * Most recent framework error, if any. The engine routes errors\n\t * through outputs, not through state — this field is kept so\n\t * subscribers asking for the latest snapshot (e.g. error banners)\n\t * can read it without replaying the output stream.\n\t */\n\tlastFrameworkError: FrameworkErrorModel | null;\n\n\t/** Number of items the host has registered for the current cohort. */\n\titemCount: number;\n\n\t/** Number of items reported as loaded. */\n\tloadedCount: number;\n};\n\n/**\n * Initial state. Kept as a function so callers cannot mutate a shared\n * default by reference.\n */\nexport function createInitialEngineState(): SectionEngineState {\n\treturn {\n\t\tphase: \"idle\",\n\t\tcohort: null,\n\t\tcontrollerResolved: false,\n\t\treadinessSignals: {\n\t\t\tsectionReady: false,\n\t\t\tinteractionReady: false,\n\t\t\tallLoadingComplete: false,\n\t\t\truntimeError: false,\n\t\t},\n\t\teffectiveRuntime: null,\n\t\teffectiveToolsConfig: null,\n\t\tloadingCompleteEmitted: false,\n\t\tlastFrameworkError: null,\n\t\titemCount: 0,\n\t\tloadedCount: 0,\n\t};\n}\n"]}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* 3. `framework-error` outputs are independent of the stage chain
|
|
27
27
|
* and do not move the phase.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* Readiness alias output kinds (`readiness-change`,
|
|
30
30
|
* `interaction-ready`, `ready`) and their DOM-event bridge were
|
|
31
31
|
* removed in the broad architecture review compat sweep. Hosts that
|
|
32
32
|
* need the readiness detail read it via the kernel's `selectReadiness`
|
|
@@ -46,4 +46,3 @@ export interface TransitionResult {
|
|
|
46
46
|
* core stays safe by design).
|
|
47
47
|
*/
|
|
48
48
|
export declare function transition(state: SectionEngineState, input: SectionEngineInput): TransitionResult;
|
|
49
|
-
//# sourceMappingURL=engine-transition.d.ts.map
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* 3. `framework-error` outputs are independent of the stage chain
|
|
27
27
|
* and do not move the phase.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* Readiness alias output kinds (`readiness-change`,
|
|
30
30
|
* `interaction-ready`, `ready`) and their DOM-event bridge were
|
|
31
31
|
* removed in the broad architecture review compat sweep. Hosts that
|
|
32
32
|
* need the readiness detail read it via the kernel's `selectReadiness`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-transition.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAG3D,OAAO,EACN,qBAAqB,GAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACN,wBAAwB,GAGxB,MAAM,mBAAmB,CAAC;AAO3B,SAAS,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;YACD,OAAO;gBACN,KAAK,EAAE;oBACN,GAAG,KAAK;oBACR,KAAK,EAAE,UAAU;iBACjB;gBACD,OAAO;aACP,CAAC;QACH,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACT,MAAM,UAAU,GAAU,KAAK,CAAC;YAChC,KAAK,UAAU,CAAC;YAChB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAC/B,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"engine-transition.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-transition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAG3D,OAAO,EACN,qBAAqB,GAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACN,wBAAwB,GAGxB,MAAM,mBAAmB,CAAC;AAO3B,SAAS,eAAe,CACvB,OAA8B,EAC9B,KAAyB,EACzB,MAAwB,EACxB,SAA2C,SAAS;IAEpD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAMpB;IACA,MAAM,IAAI,GAAuB;QAChC,GAAG,wBAAwB,EAAE;QAC7B,KAAK,EAAE,iBAAiB;QACxB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;QAC/C,SAAS,EAAE,IAAI,CAAC,SAAS;KACzB,CAAC;IACF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C,CAAC,CAAC;YACxB,OAAO;gBACN,KAAK,EAAE;oBACN,GAAG,KAAK;oBACR,kBAAkB,EAAE,KAAK,CAAC,KAAK;oBAC/B,gBAAgB,EAAE;wBACjB,GAAG,KAAK,CAAC,gBAAgB;wBACzB,YAAY,EAAE,IAAI;qBAClB;iBACD;gBACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;aAC1D,CAAC;QACH,CAAC;QAED,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,IAAI,KAAK,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;gBAChC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;YAC/B,CAAC;YACD,MAAM,OAAO,GAA0B,EAAE,CAAC;YAC1C,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;gBAC5B,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACpD,CAAC;YACD,OAAO;gBACN,KAAK,EAAE;oBACN,GAAG,KAAK;oBACR,KAAK,EAAE,UAAU;iBACjB;gBACD,OAAO;aACP,CAAC;QACH,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACT,MAAM,UAAU,GAAU,KAAK,CAAC;YAChC,KAAK,UAAU,CAAC;YAChB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAC/B,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/**\n * Pure transition function for the section runtime engine (M7 — Variant\n * C, layered core).\n *\n * `transition(state, input)` is total over `(state, input)` pairs and\n * returns:\n * - the next `SectionEngineState` (immutable; the input state object\n * is never mutated);\n * - the ordered list of `SectionEngineOutput`s the adapter must\n * dispatch (DOM events, framework-error fan-out, etc.).\n *\n * The function imports nothing from Svelte, the DOM, or the\n * coordinator. The `core/` constraint is enforced by the per-PR audit\n * step in the M7 implementation plan.\n *\n * Phase machine (per `engine-state.ts`):\n * idle → booting-section → engine-ready → interactive → disposed\n * (cohort-change rolls back to booting-section for the new cohort\n * after emitting `disposed` for the outgoing cohort)\n *\n * Output ordering invariants:\n * 1. `stage-change` for stage advancement fires before any\n * `loading-complete` triggered by the same input.\n * 2. `loading-complete` fires once per cohort, gated on\n * `state.loadingCompleteEmitted`.\n * 3. `framework-error` outputs are independent of the stage chain\n * and do not move the phase.\n *\n * Readiness alias output kinds (`readiness-change`,\n * `interaction-ready`, `ready`) and their DOM-event bridge were\n * removed in the broad architecture review compat sweep. Hosts that\n * need the readiness detail read it via the kernel's `selectReadiness`\n * / `getSnapshot` selectors or via `SectionEngineCore.getState()`.\n */\n\nimport { cohortsEqual, type CohortKey } from \"./cohort.js\";\nimport type { SectionEngineInput } from \"./engine-input.js\";\nimport type { SectionEngineOutput } from \"./engine-output.js\";\nimport {\n\tcreateReadinessDetail,\n\ttype EngineReadinessSignals,\n} from \"./engine-readiness.js\";\nimport { phaseToStage } from \"./engine-stage-derivation.js\";\nimport {\n\tcreateInitialEngineState,\n\ttype SectionEnginePhase,\n\ttype SectionEngineState,\n} from \"./engine-state.js\";\n\nexport interface TransitionResult {\n\tstate: SectionEngineState;\n\toutputs: SectionEngineOutput[];\n}\n\nfunction emitStageChange(\n\toutputs: SectionEngineOutput[],\n\tphase: SectionEnginePhase,\n\tcohort: CohortKey | null,\n\tstatus: \"entered\" | \"skipped\" | \"failed\" = \"entered\",\n): void {\n\tconst stage = phaseToStage(phase);\n\tif (!stage) return;\n\toutputs.push({ kind: \"stage-change\", stage, status, cohort });\n}\n\n/**\n * Transition the engine after `initialize` / `cohort-change`. Sets\n * the new cohort, resets latches, stores the resolved runtime/tools,\n * and emits the `composed` stage.\n */\nfunction startCohort(args: {\n\tstate: SectionEngineState;\n\tcohort: CohortKey;\n\teffectiveRuntime: SectionEngineState[\"effectiveRuntime\"];\n\teffectiveToolsConfig: unknown;\n\titemCount: number;\n}): { state: SectionEngineState; outputs: SectionEngineOutput[] } {\n\tconst next: SectionEngineState = {\n\t\t...createInitialEngineState(),\n\t\tphase: \"booting-section\",\n\t\tcohort: args.cohort,\n\t\teffectiveRuntime: args.effectiveRuntime,\n\t\teffectiveToolsConfig: args.effectiveToolsConfig,\n\t\titemCount: args.itemCount,\n\t};\n\tconst outputs: SectionEngineOutput[] = [];\n\temitStageChange(outputs, \"booting-section\", args.cohort);\n\treturn { state: next, outputs };\n}\n\n/**\n * Apply a readiness update: store new signals, derive the detail in\n * the requested mode, advance the phase to `interactive` when gated,\n * and emit `loading-complete` once per cohort.\n */\nfunction applyReadinessUpdate(\n\tstate: SectionEngineState,\n\targs: {\n\t\tsignals: EngineReadinessSignals;\n\t\tmode: \"progressive\" | \"strict\";\n\t\tloadedCount: number;\n\t\titemCount: number;\n\t},\n): TransitionResult {\n\tif (state.phase === \"idle\" || state.phase === \"disposed\") {\n\t\t// No cohort to update; ignore.\n\t\treturn { state, outputs: [] };\n\t}\n\n\tconst detail = createReadinessDetail({\n\t\tmode: args.mode,\n\t\tsignals: args.signals,\n\t});\n\tconst outputs: SectionEngineOutput[] = [];\n\n\tlet phase = state.phase;\n\tlet loadingCompleteEmitted = state.loadingCompleteEmitted;\n\n\t// Stage advancement: engine-ready → interactive when readiness\n\t// satisfies `interactionReady` (mode-aware via `createReadinessDetail`).\n\tif (phase === \"engine-ready\" && detail.interactionReady) {\n\t\tphase = \"interactive\";\n\t\temitStageChange(outputs, phase, state.cohort);\n\t}\n\n\t// Canonical `loading-complete` emission. One-shot per cohort, gated\n\t// on the readiness signals indicating every item has finished\n\t// loading.\n\tif (\n\t\tdetail.allLoadingComplete &&\n\t\tstate.cohort &&\n\t\t!loadingCompleteEmitted\n\t) {\n\t\tloadingCompleteEmitted = true;\n\t\toutputs.push({\n\t\t\tkind: \"loading-complete\",\n\t\t\tcohort: state.cohort,\n\t\t\titemCount: args.itemCount,\n\t\t\tloadedCount: args.loadedCount,\n\t\t});\n\t}\n\n\tconst nextState: SectionEngineState = {\n\t\t...state,\n\t\tphase,\n\t\treadinessSignals: args.signals,\n\t\tloadedCount: args.loadedCount,\n\t\titemCount: args.itemCount,\n\t\tloadingCompleteEmitted,\n\t};\n\treturn { state: nextState, outputs };\n}\n\n/**\n * Pure transition. Total over `(state, input)`; never mutates inputs;\n * never throws. Unhandled inputs after `disposed` fall through to a\n * no-op (the adapter is responsible for not feeding them in, but the\n * core stays safe by design).\n */\nexport function transition(\n\tstate: SectionEngineState,\n\tinput: SectionEngineInput,\n): TransitionResult {\n\tswitch (input.kind) {\n\t\tcase \"initialize\": {\n\t\t\tif (state.phase === \"disposed\") {\n\t\t\t\t// The engine has been disposed; ignore.\n\t\t\t\treturn { state, outputs: [] };\n\t\t\t}\n\t\t\tif (state.phase !== \"idle\") {\n\t\t\t\t// Already initialized. Treat as `update-runtime` for the\n\t\t\t\t// current cohort if the cohort matches; otherwise treat as\n\t\t\t\t// a `cohort-change`.\n\t\t\t\tif (cohortsEqual(state.cohort, input.cohort)) {\n\t\t\t\t\treturn transition(state, {\n\t\t\t\t\t\tkind: \"update-runtime\",\n\t\t\t\t\t\teffectiveRuntime: input.effectiveRuntime,\n\t\t\t\t\t\teffectiveToolsConfig: input.effectiveToolsConfig,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn transition(state, {\n\t\t\t\t\tkind: \"cohort-change\",\n\t\t\t\t\tcohort: input.cohort,\n\t\t\t\t\teffectiveRuntime: input.effectiveRuntime,\n\t\t\t\t\teffectiveToolsConfig: input.effectiveToolsConfig,\n\t\t\t\t\titemCount: input.itemCount,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn startCohort({\n\t\t\t\tstate,\n\t\t\t\tcohort: input.cohort,\n\t\t\t\teffectiveRuntime: input.effectiveRuntime,\n\t\t\t\teffectiveToolsConfig: input.effectiveToolsConfig,\n\t\t\t\titemCount: input.itemCount,\n\t\t\t});\n\t\t}\n\n\t\tcase \"update-runtime\": {\n\t\t\tif (state.phase === \"idle\" || state.phase === \"disposed\") {\n\t\t\t\treturn { state, outputs: [] };\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstate: {\n\t\t\t\t\t...state,\n\t\t\t\t\teffectiveRuntime: input.effectiveRuntime,\n\t\t\t\t\teffectiveToolsConfig: input.effectiveToolsConfig,\n\t\t\t\t},\n\t\t\t\toutputs: [],\n\t\t\t};\n\t\t}\n\n\t\tcase \"cohort-change\": {\n\t\t\tif (state.phase === \"disposed\") {\n\t\t\t\treturn { state, outputs: [] };\n\t\t\t}\n\t\t\tif (cohortsEqual(state.cohort, input.cohort)) {\n\t\t\t\t// No-op cohort change; fall back to a runtime update.\n\t\t\t\treturn transition(state, {\n\t\t\t\t\tkind: \"update-runtime\",\n\t\t\t\t\teffectiveRuntime: input.effectiveRuntime,\n\t\t\t\t\teffectiveToolsConfig: input.effectiveToolsConfig,\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst outputs: SectionEngineOutput[] = [];\n\t\t\tif (state.phase !== \"idle\") {\n\t\t\t\t// Emit `disposed` for the outgoing cohort before we wipe state.\n\t\t\t\toutputs.push({\n\t\t\t\t\tkind: \"stage-change\",\n\t\t\t\t\tstage: \"disposed\",\n\t\t\t\t\tstatus: \"entered\",\n\t\t\t\t\tcohort: state.cohort,\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst started = startCohort({\n\t\t\t\tstate,\n\t\t\t\tcohort: input.cohort,\n\t\t\t\teffectiveRuntime: input.effectiveRuntime,\n\t\t\t\teffectiveToolsConfig: input.effectiveToolsConfig,\n\t\t\t\titemCount: input.itemCount,\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tstate: started.state,\n\t\t\t\toutputs: [...outputs, ...started.outputs],\n\t\t\t};\n\t\t}\n\n\t\tcase \"section-controller-resolved\": {\n\t\t\tif (state.phase !== \"booting-section\") {\n\t\t\t\t// Either too early (idle), too late (interactive / disposed),\n\t\t\t\t// or a duplicate notification; the FSM is monotonic.\n\t\t\t\treturn {\n\t\t\t\t\tstate: { ...state, controllerResolved: true },\n\t\t\t\t\toutputs: [],\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst outputs: SectionEngineOutput[] = [];\n\t\t\temitStageChange(outputs, \"engine-ready\", state.cohort);\n\t\t\treturn {\n\t\t\t\tstate: {\n\t\t\t\t\t...state,\n\t\t\t\t\tphase: \"engine-ready\",\n\t\t\t\t\tcontrollerResolved: true,\n\t\t\t\t},\n\t\t\t\toutputs,\n\t\t\t};\n\t\t}\n\n\t\tcase \"update-readiness-signals\": {\n\t\t\treturn applyReadinessUpdate(state, {\n\t\t\t\tsignals: input.signals,\n\t\t\t\tmode: input.mode,\n\t\t\t\tloadedCount: input.loadedCount,\n\t\t\t\titemCount: input.itemCount,\n\t\t\t});\n\t\t}\n\n\t\tcase \"framework-error\": {\n\t\t\treturn {\n\t\t\t\tstate: {\n\t\t\t\t\t...state,\n\t\t\t\t\tlastFrameworkError: input.error,\n\t\t\t\t\treadinessSignals: {\n\t\t\t\t\t\t...state.readinessSignals,\n\t\t\t\t\t\truntimeError: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toutputs: [{ kind: \"framework-error\", error: input.error }],\n\t\t\t};\n\t\t}\n\n\t\tcase \"dispose\": {\n\t\t\tif (state.phase === \"disposed\") {\n\t\t\t\treturn { state, outputs: [] };\n\t\t\t}\n\t\t\tconst outputs: SectionEngineOutput[] = [];\n\t\t\tif (state.phase !== \"idle\") {\n\t\t\t\temitStageChange(outputs, \"disposed\", state.cohort);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstate: {\n\t\t\t\t\t...state,\n\t\t\t\t\tphase: \"disposed\",\n\t\t\t\t},\n\t\t\t\toutputs,\n\t\t\t};\n\t\t}\n\n\t\tdefault: {\n\t\t\tconst exhaustive: never = input;\n\t\t\tvoid exhaustive;\n\t\t\treturn { state, outputs: [] };\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-context.js","sourceRoot":"","sources":["../../src/runtime/engine-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAkB,MAAM,CAC9D,qCAAqC,CACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"engine-context.js","sourceRoot":"","sources":["../../src/runtime/engine-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAkB,MAAM,CAC9D,qCAAqC,CACrC,CAAC","sourcesContent":["/**\n * Svelte context key for the section runtime engine (M7 PR 5).\n *\n * Components inside a section player layout consume the engine through\n * Svelte's native `getContext(SECTION_RUNTIME_ENGINE_KEY)`. The kernel\n * (`SectionPlayerLayoutKernel.svelte`) is the canonical provider — it\n * constructs the engine, attaches it to the layout CE host, and exposes\n * it to descendants via `setContext(SECTION_RUNTIME_ENGINE_KEY, engine)`.\n *\n * The contract is one-directional:\n * - Provider: the component that owns engine lifetime (kernel today;\n * in M7 PR 6 the toolkit CE will fall back to constructing its own\n * engine when no upstream provider is present).\n * - Consumers: any descendant Svelte component that needs to read\n * state, subscribe to outputs, or feed inputs (e.g. the toolkit CE\n * reaching the engine through the wrapping kernel).\n *\n * The key is a `Symbol` so it cannot collide with userland context keys\n * and so descendants are forced to import this module rather than\n * guess a string id.\n *\n * **Stability.** This export is part of the stable runtime/engine\n * surface; renaming or replacing the symbol is a major breaking\n * change. Adding adjacent context keys (e.g. for dedicated read-only\n * snapshots) is allowed.\n */\n\nimport type { SectionRuntimeEngine } from \"./SectionRuntimeEngine.js\";\n\n/**\n * Svelte context key under which a `SectionRuntimeEngine` instance is\n * provided to descendants.\n */\nexport const SECTION_RUNTIME_ENGINE_KEY: unique symbol = Symbol(\n\t\"@pie-players/section-runtime-engine\",\n);\n\n/**\n * Type-level alias for the value stored under\n * `SECTION_RUNTIME_ENGINE_KEY`. Exposed as a separate alias so\n * consumers can spell the type without importing the implementing\n * class directly.\n */\nexport type SectionRuntimeEngineContext = SectionRuntimeEngine;\n"]}
|
package/dist/runtime/engine.d.ts
CHANGED
|
@@ -20,5 +20,4 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export { SectionRuntimeEngine, type SectionRuntimeEngineHostArgs, } from "./SectionRuntimeEngine.js";
|
|
22
22
|
export { SECTION_RUNTIME_ENGINE_KEY, type SectionRuntimeEngineContext, } from "./engine-context.js";
|
|
23
|
-
export { sectionRuntimeEngineHostContext, connectSectionRuntimeEngineHostContext, type SectionRuntimeEngineHostContextValue, type SectionRuntimeEngineHostContextListener, } from "./section-runtime-engine-host-context.js";
|
|
24
|
-
//# sourceMappingURL=engine.d.ts.map
|
|
23
|
+
export { sectionRuntimeEngineHostContext, connectSectionRuntimeEngineHostContext, type SectionRuntimeLifecycleHandle, type SectionRuntimeEngineHostContextValue, type SectionRuntimeEngineHostContextListener, } from "./section-runtime-engine-host-context.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/runtime/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACN,oBAAoB,GAEpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,0BAA0B,GAE1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,+BAA+B,EAC/B,sCAAsC,
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/runtime/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACN,oBAAoB,GAEpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,0BAA0B,GAE1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,+BAA+B,EAC/B,sCAAsC,GAItC,MAAM,0CAA0C,CAAC","sourcesContent":["/**\n * Section runtime engine — facade entry point (M7 — Variant C).\n *\n * Narrow, stable public surface for hosts that want to mount, drive,\n * or dispose a section runtime via the layered engine. Re-exports the\n * `SectionRuntimeEngine` facade and its `attachHost` arg shape.\n *\n * **Pairing.** This module is the stable counterpart to\n * `./runtime/internal`, which exposes the wider, evolving surface\n * (core types, adapter bridges, cohort helpers) for advanced hosts and\n * for the engine's own tests / benchmarks. Consumers that only need to\n * mount + drive a section runtime should import from here. Consumers\n * that need to reach past the facade (e.g. construct an adapter\n * manually, inspect FSM state types, build alternate fan-out paths)\n * should import from `./runtime/internal` and accept the documented\n * stability disclaimer there.\n *\n * The package's `exports` map adds `./runtime/engine` in M7 PR 3\n * alongside the facade refactor.\n */\n\nexport {\n\tSectionRuntimeEngine,\n\ttype SectionRuntimeEngineHostArgs,\n} from \"./SectionRuntimeEngine.js\";\n\nexport {\n\tSECTION_RUNTIME_ENGINE_KEY,\n\ttype SectionRuntimeEngineContext,\n} from \"./engine-context.js\";\n\nexport {\n\tsectionRuntimeEngineHostContext,\n\tconnectSectionRuntimeEngineHostContext,\n\ttype SectionRuntimeLifecycleHandle,\n\ttype SectionRuntimeEngineHostContextValue,\n\ttype SectionRuntimeEngineHostContextListener,\n} from \"./section-runtime-engine-host-context.js\";\n"]}
|
|
@@ -41,4 +41,3 @@ export { DEFAULT_ASSESSMENT_ID, DEFAULT_ENV, DEFAULT_ISOLATION, DEFAULT_LAZY_INI
|
|
|
41
41
|
export { createReadinessDetail, resolveReadinessPhase, } from "./core/engine-readiness.js";
|
|
42
42
|
export { transition } from "./core/engine-transition.js";
|
|
43
43
|
export type { TransitionResult } from "./core/engine-transition.js";
|
|
44
|
-
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/runtime/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGzE,uEAAuE;AACvE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AAC3D,0DAA0D;AAC1D,OAAO,EACN,iBAAiB,GAIjB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACN,uBAAuB,GAKvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,oBAAoB,GAGpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACN,0BAA0B,GAG1B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACN,2BAA2B,GAI3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACN,sBAAsB,GAGtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EACN,SAAS,EACT,YAAY,EACZ,UAAU,GAEV,MAAM,kBAAkB,CAAC;AAa1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EACN,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,gCAAgC,EAChC,kBAAkB,GAQlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["/**\n * Section runtime engine — **internal** entry point (M7 — Variant C).\n *\n * Re-exports the layered core + adapter surface for advanced hosts that\n * want to construct or inspect engines directly, and for the engine's\n * own tests / benchmarks.\n *\n * **Stability posture.** This module is **not** part of the stable\n * public API. Symbols here are subject to change between minor versions\n * with only a changeset note. Hosts that need long-term stability\n * should depend on the facade (`SectionRuntimeEngine` exported from\n * `./runtime/engine`) instead.\n *\n * The split is intentional:\n * - `./runtime/engine` (PR 3) — narrow, stable facade for common\n * host wiring.\n * - `./runtime/internal` — wide, evolving surface for the kernel,\n * adapter tests, and any host that wants to reach past the facade.\n *\n * The `runtime/engine` and `runtime/internal` package `exports` map\n * entries are added in PR 3 alongside the facade refactor.\n */\n\nexport { SectionEngineAdapter } from \"./adapter/SectionEngineAdapter.js\";\nexport type { SectionEngineAdapterOptions } from \"./adapter/SectionEngineAdapter.js\";\n\n// `FrameworkErrorBus` is the package-internal multi-subscriber bus the\n// engine adapter consumes via the `FrameworkErrorReporter` write port.\n// It is re-exported here (alongside the read/write ports) so advanced\n// hosts that construct an engine instance directly — including the M7\n// PR 5 section-player kernel — can wire a bus without reaching into a\n// deep relative path. The class itself remains \"package-internal\" in\n// posture (the doc comment on the class explains why); this export is\n// a deliberate, advanced-host escape hatch on the evolving\n// `runtime/internal` surface, never on the stable facade.\nexport {\n\tFrameworkErrorBus,\n\ttype FrameworkErrorListener,\n\ttype FrameworkErrorPort,\n\ttype FrameworkErrorReporter,\n} from \"../services/framework-error-bus.js\";\n\nexport {\n\tcreateCoordinatorBridge,\n\ttype CoordinatorBridgeHandle,\n\ttype CoordinatorBridgeOptions,\n\ttype CoordinatorPort,\n\ttype ResolveSectionControllerArgs,\n} from \"./adapter/coordinator-bridge.js\";\n\nexport {\n\tcreateDomEventBridge,\n\ttype DomEventBridgeHandle,\n\ttype DomEventBridgeOptions,\n} from \"./adapter/dom-event-bridge.js\";\n\nexport {\n\tcreateFrameworkErrorBridge,\n\ttype FrameworkErrorBridgeHandle,\n\ttype FrameworkErrorBridgeOptions,\n} from \"./adapter/framework-error-bridge.js\";\n\nexport {\n\tcreateInstrumentationBridge,\n\ttype InstrumentationBridgeHandle,\n\ttype InstrumentationBridgeOptions,\n\ttype InstrumentationHook,\n} from \"./adapter/instrumentation-bridge.js\";\n\nexport {\n\tcreateSubscriberFanout,\n\ttype EngineOutputListener,\n\ttype SubscriberFanoutHandle,\n} from \"./adapter/subscriber-fanout.js\";\n\nexport { SectionEngineCore } from \"./core/SectionEngineCore.js\";\nexport type { SectionEngineCoreListener } from \"./core/SectionEngineCore.js\";\n\nexport {\n\tcohortKey,\n\tcohortsEqual,\n\tmakeCohort,\n\ttype CohortKey,\n} from \"./core/cohort.js\";\n\nexport type { SectionEngineInput } from \"./core/engine-input.js\";\nexport type { SectionEngineOutput } from \"./core/engine-output.js\";\nexport type {\n\tEngineReadinessDetail,\n\tEngineReadinessPhase,\n\tEngineReadinessSignals,\n} from \"./core/engine-readiness.js\";\nexport type {\n\tSectionEnginePhase,\n\tSectionEngineState,\n} from \"./core/engine-state.js\";\nexport { createInitialEngineState } from \"./core/engine-state.js\";\nexport { phaseToStage } from \"./core/engine-stage-derivation.js\";\nexport {\n\tDEFAULT_ASSESSMENT_ID,\n\tDEFAULT_ENV,\n\tDEFAULT_ISOLATION,\n\tDEFAULT_LAZY_INIT,\n\tDEFAULT_PLAYER_TYPE,\n\tresolveOnFrameworkError,\n\tresolveRuntime,\n\tresolveSectionEngineRuntimeState,\n\tresolveToolsConfig,\n\ttype EffectiveRuntime,\n\ttype FrameworkErrorHandler,\n\ttype LoadingCompleteHandler,\n\ttype PlayerOverrides,\n\ttype RuntimeConfig,\n\ttype RuntimeInputs,\n\ttype StageChangeHandler,\n} from \"./core/engine-resolver.js\";\nexport {\n\tcreateReadinessDetail,\n\tresolveReadinessPhase,\n} from \"./core/engine-readiness.js\";\nexport { transition } from \"./core/engine-transition.js\";\nexport type { TransitionResult } from \"./core/engine-transition.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registration-events.js","sourceRoot":"","sources":["../../src/runtime/registration-events.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AACrD,MAAM,CAAC,MAAM,uCAAuC,GAAG,0BAA0B,CAAC;AAClF,MAAM,CAAC,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AACrE,MAAM,CAAC,MAAM,iCAAiC,GAAG,oBAAoB,CAAC;AACtE,MAAM,CAAC,MAAM,oCAAoC,GAAG,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"registration-events.js","sourceRoot":"","sources":["../../src/runtime/registration-events.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AACrD,MAAM,CAAC,MAAM,uCAAuC,GAAG,0BAA0B,CAAC;AAClF,MAAM,CAAC,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AACrE,MAAM,CAAC,MAAM,iCAAiC,GAAG,oBAAoB,CAAC;AACtE,MAAM,CAAC,MAAM,oCAAoC,GAAG,uBAAuB,CAAC","sourcesContent":["export const PIE_REGISTER_EVENT = \"pie-register\";\nexport const PIE_UNREGISTER_EVENT = \"pie-unregister\";\nexport const PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT = \"pie-item-session-changed\";\nexport const PIE_ITEM_SESSION_CHANGED_EVENT = \"item-session-changed\";\nexport const PIE_INTERNAL_CONTENT_LOADED_EVENT = \"pie-content-loaded\";\nexport const PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT = \"pie-item-player-error\";\n\nexport type RuntimeRegistrationKind = \"item\" | \"passage\";\n\nexport interface RuntimeRegistrationDetail {\n\tkind: RuntimeRegistrationKind;\n\titemId: string;\n\tcanonicalItemId?: string;\n\tcontentKind?: string;\n\titem?: unknown;\n\telement: HTMLElement;\n}\n\nexport interface ItemSessionChangedDetail {\n\titemId: string;\n\tcanonicalItemId?: string;\n\tsession: unknown;\n\tsourceRuntimeId?: string;\n}\n\nexport interface InternalItemSessionChangedDetail {\n\titemId: string;\n\tsession: unknown;\n}\n\nexport interface InternalContentLoadedDetail {\n\titemId: string;\n\tcanonicalItemId?: string;\n\tcontentKind?: string;\n\tdetail?: unknown;\n}\n\nexport interface InternalItemPlayerErrorDetail {\n\titemId: string;\n\tcanonicalItemId?: string;\n\tcontentKind?: string;\n\terror: unknown;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-id.js","sourceRoot":"","sources":["../../src/runtime/runtime-id.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAM,GAAG,SAAS;IACjD,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AACzE,CAAC"}
|
|
1
|
+
{"version":3,"file":"runtime-id.js","sourceRoot":"","sources":["../../src/runtime/runtime-id.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAM,GAAG,SAAS;IACjD,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AACzE,CAAC","sourcesContent":["/**\n * Stable runtime-instance id generator.\n *\n * Produces a per-runtime id used to scope DOM attribute names and\n * telemetry tags. Single export by design — not a \"guards\" module.\n */\nexport function createRuntimeId(prefix = \"runtime\"): string {\n\treturn `${prefix}-${Math.random().toString(16).slice(2)}-${Date.now()}`;\n}\n"]}
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
*
|
|
10
10
|
* - The kernel (`SectionPlayerLayoutKernel.svelte`) installs a
|
|
11
11
|
* `ContextProvider` for `sectionRuntimeEngineHostContext` on its
|
|
12
|
-
* `host` (the layout CE). The provider value carries
|
|
13
|
-
*
|
|
12
|
+
* `host` (the layout CE). The provider value carries a narrow
|
|
13
|
+
* lifecycle handle for the engine owned by that kernel mount.
|
|
14
14
|
* - The toolkit CE installs a `ContextConsumer` on its own host. When
|
|
15
15
|
* wrapped by a section player layout, the consumer resolves to the
|
|
16
|
-
* kernel's
|
|
17
|
-
*
|
|
18
|
-
* `initialize`, etc.)
|
|
19
|
-
*
|
|
20
|
-
* responds and the toolkit keeps using
|
|
21
|
-
*
|
|
16
|
+
* kernel's lifecycle handle and suppresses its standalone lifecycle
|
|
17
|
+
* DOM emits in favor of the section-player host. Controller-side
|
|
18
|
+
* calls (`register`, `handleContent*`, `initialize`, etc.) remain
|
|
19
|
+
* owned by the toolkit's locally-constructed engine. When
|
|
20
|
+
* standalone, no host provider responds and the toolkit keeps using
|
|
21
|
+
* its standalone lifecycle path.
|
|
22
22
|
*
|
|
23
23
|
* The two engine-context surfaces (`SECTION_RUNTIME_ENGINE_KEY` and
|
|
24
24
|
* this one) are deliberately distinct:
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
* single component tree (kernel + descendants in the same shadow
|
|
27
27
|
* root) and is the right hook for in-tree consumers.
|
|
28
28
|
* - `sectionRuntimeEngineHostContext` (DOM-event context) is the
|
|
29
|
-
* bridge for cross-CE consumers and only carries data that is
|
|
30
|
-
*
|
|
29
|
+
* bridge for cross-CE consumers and only carries data that is safe
|
|
30
|
+
* to share across CE boundaries (a stable lifecycle handle).
|
|
31
31
|
*
|
|
32
32
|
* **Stability.** This export is part of the stable runtime/engine
|
|
33
33
|
* surface; the symbol identity and value shape are part of the
|
|
@@ -35,15 +35,22 @@
|
|
|
35
35
|
* breaking change. Adding optional fields to the value shape is
|
|
36
36
|
* allowed; required fields are not.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Narrow cross-CE handle published by section-player. Deliberately omits
|
|
40
|
+
* controller-facing methods (`initialize`, `register`, `handleContent*`,
|
|
41
|
+
* etc.) so the package seam cannot grow an accidental controller contract.
|
|
42
|
+
*/
|
|
43
|
+
export interface SectionRuntimeLifecycleHandle {
|
|
44
|
+
getRuntimeId(): string;
|
|
45
|
+
}
|
|
39
46
|
/**
|
|
40
47
|
* Value shape published by the kernel and consumed by the wrapped
|
|
41
|
-
* toolkit CE. Carries only the
|
|
42
|
-
*
|
|
43
|
-
*
|
|
48
|
+
* toolkit CE. Carries only the lifecycle handle today; if more cross-CE
|
|
49
|
+
* shared runtime state is needed later, fields can be added here
|
|
50
|
+
* additively.
|
|
44
51
|
*/
|
|
45
52
|
export interface SectionRuntimeEngineHostContextValue {
|
|
46
|
-
engine:
|
|
53
|
+
engine: SectionRuntimeLifecycleHandle;
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
49
56
|
* `pie-context` context key for the cross-CE engine bridge. Uses a
|
|
@@ -71,4 +78,3 @@ export type SectionRuntimeEngineHostContextListener = (value: SectionRuntimeEngi
|
|
|
71
78
|
* engine — that is by design and is not an error.
|
|
72
79
|
*/
|
|
73
80
|
export declare function connectSectionRuntimeEngineHostContext(host: HTMLElement, onValue: SectionRuntimeEngineHostContextListener): () => void;
|
|
74
|
-
//# sourceMappingURL=section-runtime-engine-host-context.d.ts.map
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
*
|
|
10
10
|
* - The kernel (`SectionPlayerLayoutKernel.svelte`) installs a
|
|
11
11
|
* `ContextProvider` for `sectionRuntimeEngineHostContext` on its
|
|
12
|
-
* `host` (the layout CE). The provider value carries
|
|
13
|
-
*
|
|
12
|
+
* `host` (the layout CE). The provider value carries a narrow
|
|
13
|
+
* lifecycle handle for the engine owned by that kernel mount.
|
|
14
14
|
* - The toolkit CE installs a `ContextConsumer` on its own host. When
|
|
15
15
|
* wrapped by a section player layout, the consumer resolves to the
|
|
16
|
-
* kernel's
|
|
17
|
-
*
|
|
18
|
-
* `initialize`, etc.)
|
|
19
|
-
*
|
|
20
|
-
* responds and the toolkit keeps using
|
|
21
|
-
*
|
|
16
|
+
* kernel's lifecycle handle and suppresses its standalone lifecycle
|
|
17
|
+
* DOM emits in favor of the section-player host. Controller-side
|
|
18
|
+
* calls (`register`, `handleContent*`, `initialize`, etc.) remain
|
|
19
|
+
* owned by the toolkit's locally-constructed engine. When
|
|
20
|
+
* standalone, no host provider responds and the toolkit keeps using
|
|
21
|
+
* its standalone lifecycle path.
|
|
22
22
|
*
|
|
23
23
|
* The two engine-context surfaces (`SECTION_RUNTIME_ENGINE_KEY` and
|
|
24
24
|
* this one) are deliberately distinct:
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
* single component tree (kernel + descendants in the same shadow
|
|
27
27
|
* root) and is the right hook for in-tree consumers.
|
|
28
28
|
* - `sectionRuntimeEngineHostContext` (DOM-event context) is the
|
|
29
|
-
* bridge for cross-CE consumers and only carries data that is
|
|
30
|
-
*
|
|
29
|
+
* bridge for cross-CE consumers and only carries data that is safe
|
|
30
|
+
* to share across CE boundaries (a stable lifecycle handle).
|
|
31
31
|
*
|
|
32
32
|
* **Stability.** This export is part of the stable runtime/engine
|
|
33
33
|
* surface; the symbol identity and value shape are part of the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-runtime-engine-host-context.js","sourceRoot":"","sources":["../../src/runtime/section-runtime-engine-host-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACN,eAAe,EACf,aAAa,GAEb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"section-runtime-engine-host-context.js","sourceRoot":"","sources":["../../src/runtime/section-runtime-engine-host-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACN,eAAe,EACf,aAAa,GAEb,MAAM,0BAA0B,CAAC;AAqBlC;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC3C,aAAa,CACZ,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CACjD,CAAC;AAUH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sCAAsC,CACrD,IAAiB,EACjB,OAAgD;IAEhD,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE;QAC1C,OAAO,EAAE,+BAA+B;QACxC,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,QAAQ,GAAG,IAAI,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC;KACD,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC;IAEnB,MAAM,iBAAiB,GAAG,CAAC,KAA+B,EAAE,EAAE;QAC7D,IACC,KAAK,CAAC,OAAO;YACZ,+BAA6D,EAC7D,CAAC;YACF,OAAO;QACR,CAAC;QACD,QAAQ,CAAC,YAAY,EAAE,CAAC;IACzB,CAAC,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;IAE7D,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,MAAM,WAAW,GAAG,GAAG,CAAC;IACxB,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE;QAC9C,IAAI,QAAQ,IAAI,QAAQ,IAAI,WAAW,EAAE,CAAC;YACzC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACrC,OAAO;QACR,CAAC;QACD,QAAQ,IAAI,CAAC,CAAC;QACd,QAAQ,CAAC,YAAY,EAAE,CAAC;IACzB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,GAAG,EAAE;QACX,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACrC,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;QAChE,QAAQ,CAAC,UAAU,EAAE,CAAC;IACvB,CAAC,CAAC;AACH,CAAC","sourcesContent":["/**\n * Cross-Custom-Element context for the section runtime engine (M7 PR 6).\n *\n * The toolkit CE renders inside its own Shadow DOM, so Svelte's native\n * `setContext`/`getContext` (used by `engine-context.ts`) cannot bridge\n * the kernel-provided engine reference to the toolkit's component tree.\n * This module exposes a `@pie-players/pie-context` based context that\n * does cross the CE boundary via DOM events:\n *\n * - The kernel (`SectionPlayerLayoutKernel.svelte`) installs a\n * `ContextProvider` for `sectionRuntimeEngineHostContext` on its\n * `host` (the layout CE). The provider value carries a narrow\n * lifecycle handle for the engine owned by that kernel mount.\n * - The toolkit CE installs a `ContextConsumer` on its own host. When\n * wrapped by a section player layout, the consumer resolves to the\n * kernel's lifecycle handle and suppresses its standalone lifecycle\n * DOM emits in favor of the section-player host. Controller-side\n * calls (`register`, `handleContent*`, `initialize`, etc.) remain\n * owned by the toolkit's locally-constructed engine. When\n * standalone, no host provider responds and the toolkit keeps using\n * its standalone lifecycle path.\n *\n * The two engine-context surfaces (`SECTION_RUNTIME_ENGINE_KEY` and\n * this one) are deliberately distinct:\n * - `SECTION_RUNTIME_ENGINE_KEY` (Svelte context) stays scoped to a\n * single component tree (kernel + descendants in the same shadow\n * root) and is the right hook for in-tree consumers.\n * - `sectionRuntimeEngineHostContext` (DOM-event context) is the\n * bridge for cross-CE consumers and only carries data that is safe\n * to share across CE boundaries (a stable lifecycle handle).\n *\n * **Stability.** This export is part of the stable runtime/engine\n * surface; the symbol identity and value shape are part of the\n * cross-CE contract. Renaming or replacing the symbol is a major\n * breaking change. Adding optional fields to the value shape is\n * allowed; required fields are not.\n */\n\nimport {\n\tContextConsumer,\n\tcreateContext,\n\ttype UnknownContext,\n} from \"@pie-players/pie-context\";\n\n/**\n * Narrow cross-CE handle published by section-player. Deliberately omits\n * controller-facing methods (`initialize`, `register`, `handleContent*`,\n * etc.) so the package seam cannot grow an accidental controller contract.\n */\nexport interface SectionRuntimeLifecycleHandle {\n\tgetRuntimeId(): string;\n}\n\n/**\n * Value shape published by the kernel and consumed by the wrapped\n * toolkit CE. Carries only the lifecycle handle today; if more cross-CE\n * shared runtime state is needed later, fields can be added here\n * additively.\n */\nexport interface SectionRuntimeEngineHostContextValue {\n\tengine: SectionRuntimeLifecycleHandle;\n}\n\n/**\n * `pie-context` context key for the cross-CE engine bridge. Uses a\n * `Symbol.for(...)` registry key so providers and consumers in\n * separately-bundled CEs see the same identity.\n */\nexport const sectionRuntimeEngineHostContext =\n\tcreateContext<SectionRuntimeEngineHostContextValue>(\n\t\tSymbol.for(\"pie.sectionRuntimeEngineHostContext\"),\n\t);\n\nexport type SectionRuntimeEngineHostContextListener = (\n\tvalue: SectionRuntimeEngineHostContextValue,\n) => void;\n\ntype ContextProviderLikeEvent = Event & {\n\tcontext?: unknown;\n};\n\n/**\n * Connect a DOM host to the cross-CE engine context with the same\n * provider-retry semantics used elsewhere in the toolkit (initial\n * synchronous request + `context-provider` re-request + 50 ms polling\n * fallback up to 200 attempts ≈ 10 s).\n *\n * The retry mirrors the existing\n * `connectAssessmentToolkitHostRuntimeContext` infrastructure so the\n * timing characteristics of cross-CE handshakes stay consistent across\n * the toolkit's contexts.\n *\n * Returns a cleanup function that disconnects the consumer and clears\n * the retry interval. Standalone toolkits naturally exhaust the retry\n * window without ever resolving and continue using their local\n * engine — that is by design and is not an error.\n */\nexport function connectSectionRuntimeEngineHostContext(\n\thost: HTMLElement,\n\tonValue: SectionRuntimeEngineHostContextListener,\n): () => void {\n\tlet hasValue = false;\n\tconst consumer = new ContextConsumer(host, {\n\t\tcontext: sectionRuntimeEngineHostContext,\n\t\tsubscribe: true,\n\t\tonValue: (value) => {\n\t\t\thasValue = true;\n\t\t\tonValue(value);\n\t\t},\n\t});\n\tconsumer.connect();\n\n\tconst onContextProvider = (event: ContextProviderLikeEvent) => {\n\t\tif (\n\t\t\tevent.context !==\n\t\t\t(sectionRuntimeEngineHostContext as unknown as UnknownContext)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconsumer.requestValue();\n\t};\n\thost.addEventListener(\"context-provider\", onContextProvider);\n\n\tlet attempts = 0;\n\tconst maxAttempts = 200;\n\tconst retryTimer = globalThis.setInterval(() => {\n\t\tif (hasValue || attempts >= maxAttempts) {\n\t\t\tglobalThis.clearInterval(retryTimer);\n\t\t\treturn;\n\t\t}\n\t\tattempts += 1;\n\t\tconsumer.requestValue();\n\t}, 50);\n\n\treturn () => {\n\t\tglobalThis.clearInterval(retryTimer);\n\t\thost.removeEventListener(\"context-provider\", onContextProvider);\n\t\tconsumer.disconnect();\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-event-emitter-policy.js","sourceRoot":"","sources":["../../src/runtime/session-event-emitter-policy.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,4BAA4B;IAC3C,OAAO;QACN,iCAAiC,EAAE,IAAI,GAAG,EAAkB;QAC5D,6BAA6B,EAAE,IAAI,GAAG,EAAkB;KACxD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,KAA6B;IACxE,KAAK,CAAC,iCAAiC,CAAC,KAAK,EAAE,CAAC;IAChD,KAAK,CAAC,6BAA6B,CAAC,KAAK,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,IAI/C;IACA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACxC,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAC5D,MAAM,yBAAyB,GAAG,KAAK,CAAC,6BAA6B,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAClF,IAAI,yBAAyB,KAAK,iBAAiB,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC;QACd,CAAC;QACD,KAAK,CAAC,6BAA6B,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,SAAS,GAAG,gCAAgC,CAAC,OAAO,CAAC,CAAC;IAC5D,MAAM,iBAAiB,GAAG,KAAK,CAAC,iCAAiC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9E,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,KAAK,CAAC,iCAAiC,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/D,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,gCAAgC,CAAC,OAAgC;IACzE,MAAM,eAAe,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;IACvC,OAAO,eAAe,CAAC,SAAS,CAAC;IACjC,OAAO,eAAe,CAAC,eAAe,CAAC;IACvC,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAgC;IAC5D,OAAO,OAAO,CAAC,MAAM,KAAK,eAAe,CAAC;AAC3C,CAAC;AAED,SAAS,wBAAwB,CAAC,OAAgC;IACjE,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI;YAClC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;SACpC,CAAC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"session-event-emitter-policy.js","sourceRoot":"","sources":["../../src/runtime/session-event-emitter-policy.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,4BAA4B;IAC3C,OAAO;QACN,iCAAiC,EAAE,IAAI,GAAG,EAAkB;QAC5D,6BAA6B,EAAE,IAAI,GAAG,EAAkB;KACxD,CAAC;AACH,CAA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AM,CAAC,eAAe,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAgC;IAC5D,OAAO,OAAO,CAAC,MAAM,KAAK,eAAe,CAAC;AAC3C,CAAC;AAED,SAAS,wBAAwB,CAAC,OAAgC;IACjE,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI;YAClC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;SACpC,CAAC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;AACF,CAAC","sourcesContent":["export type SessionEmitPolicyState = {\n\tlastSessionEventSignatureByItemId: Map<string, string>;\n\tlastMetadataSignatureByItemId: Map<string, string>;\n};\n\nexport function createSessionEmitPolicyState(): SessionEmitPolicyState {\n\treturn {\n\t\tlastSessionEventSignatureByItemId: new Map<string, string>(),\n\t\tlastMetadataSignatureByItemId: new Map<string, string>(),\n\t};\n}\n\nexport function resetSessionEmitPolicyState(state: SessionEmitPolicyState): void {\n\tstate.lastSessionEventSignatureByItemId.clear();\n\tstate.lastMetadataSignatureByItemId.clear();\n}\n\nexport function shouldEmitCanonicalSessionEvent(args: {\n\tstate: SessionEmitPolicyState;\n\titemId: string;\n\tpayload: Record<string, unknown>;\n}): boolean {\n\tconst { state, itemId, payload } = args;\n\tif (isMetadataOnlyEvent(payload)) {\n\t\tconst metadataSignature = getMetadataOnlySignature(payload);\n\t\tconst previousMetadataSignature = state.lastMetadataSignatureByItemId.get(itemId);\n\t\tif (previousMetadataSignature === metadataSignature) {\n\t\t\treturn false;\n\t\t}\n\t\tstate.lastMetadataSignatureByItemId.set(itemId, metadataSignature);\n\t}\n\tconst signature = getSessionEventSemanticSignature(payload);\n\tconst previousSignature = state.lastSessionEventSignatureByItemId.get(itemId);\n\tif (previousSignature === signature) {\n\t\treturn false;\n\t}\n\tstate.lastSessionEventSignatureByItemId.set(itemId, signature);\n\treturn true;\n}\n\nfunction getSessionEventSemanticSignature(payload: Record<string, unknown>): string {\n\tconst semanticPayload = { ...payload };\n\tdelete semanticPayload.timestamp;\n\tdelete semanticPayload.sourceRuntimeId;\n\ttry {\n\t\treturn JSON.stringify(semanticPayload);\n\t} catch {\n\t\treturn String(semanticPayload.itemId || \"\");\n\t}\n}\n\nfunction isMetadataOnlyEvent(payload: Record<string, unknown>): boolean {\n\treturn payload.intent === \"metadata-only\";\n}\n\nfunction getMetadataOnlySignature(payload: Record<string, unknown>): string {\n\ttry {\n\t\treturn JSON.stringify({\n\t\t\titemId: payload.itemId,\n\t\t\tcanonicalItemId: payload.canonicalItemId,\n\t\t\tintent: payload.intent,\n\t\t\tcomplete: payload.complete ?? null,\n\t\t\tcomponent: payload.component ?? null,\n\t\t});\n\t} catch {\n\t\treturn String(payload.itemId || \"\");\n\t}\n}\n"]}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* event and invokes the runtime-tier `onStageChange` callback. PR 6
|
|
7
7
|
* introduces the wrapped/standalone branch:
|
|
8
8
|
*
|
|
9
|
-
* - **Standalone** (no
|
|
9
|
+
* - **Standalone** (no host lifecycle provider on
|
|
10
10
|
* the layout CE host): emit + `onStageChange` fire as before.
|
|
11
|
-
* - **Wrapped** (kernel publishes its
|
|
11
|
+
* - **Wrapped** (kernel publishes its lifecycle handle via
|
|
12
12
|
* `sectionRuntimeEngineHostContext` and the toolkit consumer
|
|
13
13
|
* resolves it): emit + `onStageChange` are suppressed on the
|
|
14
14
|
* toolkit CE, because the kernel's engine already emits the
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* unit test without mounting the toolkit CE — see
|
|
33
33
|
* `tests/runtime/stage-emit-gate.test.ts`. The closure in the toolkit
|
|
34
34
|
* passes thunks for `isSuppressed` and `getOnStageChange` so the live
|
|
35
|
-
* Svelte reactive variables (`
|
|
35
|
+
* Svelte reactive variables (`hostLifecycleEngine`, `onStageChange`) are
|
|
36
36
|
* read at emit time, not captured at construction time. This keeps the
|
|
37
37
|
* pre-PR-6 behavior of always reading the latest `onStageChange` prop
|
|
38
38
|
* value (cohort change, host swap, etc.) intact.
|
|
@@ -46,7 +46,7 @@ export type StageOnChangeHandler = (detail: StageChangeDetail) => void;
|
|
|
46
46
|
export interface StageEmitGateContext {
|
|
47
47
|
/**
|
|
48
48
|
* Reads the current suppression flag. Implemented as a thunk so
|
|
49
|
-
* the reactive Svelte `$state(
|
|
49
|
+
* the reactive Svelte `$state(hostLifecycleEngine)` is read at emit
|
|
50
50
|
* time. Return `true` to suppress; `false` to fire.
|
|
51
51
|
*/
|
|
52
52
|
isSuppressed: () => boolean;
|
|
@@ -90,4 +90,3 @@ export interface StageEmitGateContext {
|
|
|
90
90
|
* effects.
|
|
91
91
|
*/
|
|
92
92
|
export declare function runStageEmitWithSuppression(context: StageEmitGateContext, detail: StageChangeDetail): boolean;
|
|
93
|
-
//# sourceMappingURL=stage-emit-gate.d.ts.map
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* event and invokes the runtime-tier `onStageChange` callback. PR 6
|
|
7
7
|
* introduces the wrapped/standalone branch:
|
|
8
8
|
*
|
|
9
|
-
* - **Standalone** (no
|
|
9
|
+
* - **Standalone** (no host lifecycle provider on
|
|
10
10
|
* the layout CE host): emit + `onStageChange` fire as before.
|
|
11
|
-
* - **Wrapped** (kernel publishes its
|
|
11
|
+
* - **Wrapped** (kernel publishes its lifecycle handle via
|
|
12
12
|
* `sectionRuntimeEngineHostContext` and the toolkit consumer
|
|
13
13
|
* resolves it): emit + `onStageChange` are suppressed on the
|
|
14
14
|
* toolkit CE, because the kernel's engine already emits the
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* unit test without mounting the toolkit CE — see
|
|
33
33
|
* `tests/runtime/stage-emit-gate.test.ts`. The closure in the toolkit
|
|
34
34
|
* passes thunks for `isSuppressed` and `getOnStageChange` so the live
|
|
35
|
-
* Svelte reactive variables (`
|
|
35
|
+
* Svelte reactive variables (`hostLifecycleEngine`, `onStageChange`) are
|
|
36
36
|
* read at emit time, not captured at construction time. This keeps the
|
|
37
37
|
* pre-PR-6 behavior of always reading the latest `onStageChange` prop
|
|
38
38
|
* value (cohort change, host swap, etc.) intact.
|