@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.
Files changed (441) hide show
  1. package/README.md +54 -69
  2. package/dist/attempt/AssessmentSession.d.ts +0 -1
  3. package/dist/attempt/AssessmentSession.js.map +1 -1
  4. package/dist/attempt/TestSession.d.ts +0 -1
  5. package/dist/attempt/TestSession.js.map +1 -1
  6. package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts +0 -1
  7. package/dist/attempt/adapters/activity-to-test-attempt-session.js.map +1 -1
  8. package/dist/components/ItemToolBar.custom-element.js +1607 -428
  9. package/dist/components/PieAssessmentToolkit.custom-element.js +19498 -3590
  10. package/dist/components/SectionToolBar.custom-element.js +1887 -611
  11. package/dist/components/item-toolbar-element.d.ts +0 -1
  12. package/dist/components/item-toolbar-element.js.map +1 -1
  13. package/dist/components/pie-assessment-toolkit-element.d.ts +0 -1
  14. package/dist/components/pie-assessment-toolkit-element.js.map +1 -1
  15. package/dist/components/section-toolbar-element.d.ts +0 -1
  16. package/dist/components/section-toolbar-element.js.map +1 -1
  17. package/dist/components/vendor/nds/README.md +110 -0
  18. package/dist/components/vendor/nds/nds-icon-button.js +826 -0
  19. package/dist/context/assessment-toolkit-context.d.ts +0 -1
  20. package/dist/context/assessment-toolkit-context.js.map +1 -1
  21. package/dist/context/runtime-context-consumer.d.ts +0 -1
  22. package/dist/context/runtime-context-consumer.js.map +1 -1
  23. package/dist/index.d.ts +3 -7
  24. package/dist/index.js +1 -3
  25. package/dist/index.js.map +1 -1
  26. package/dist/item-loader.d.ts +0 -1
  27. package/dist/item-loader.js.map +1 -1
  28. package/dist/policy/core/PolicySource.d.ts +0 -1
  29. package/dist/policy/core/PolicySource.js.map +1 -1
  30. package/dist/policy/core/ToolPolicyEngine.d.ts +1 -3
  31. package/dist/policy/core/ToolPolicyEngine.js +1 -2
  32. package/dist/policy/core/ToolPolicyEngine.js.map +1 -1
  33. package/dist/policy/core/compose-decision.d.ts +0 -1
  34. package/dist/policy/core/compose-decision.js.map +1 -1
  35. package/dist/policy/core/decision-types.d.ts +0 -1
  36. package/dist/policy/core/decision-types.js.map +1 -1
  37. package/dist/policy/core/engine-context.d.ts +0 -1
  38. package/dist/policy/core/engine-context.js.map +1 -1
  39. package/dist/policy/core/pnp-policy-inputs.d.ts +2 -4
  40. package/dist/policy/core/pnp-policy-inputs.js +2 -3
  41. package/dist/policy/core/pnp-policy-inputs.js.map +1 -1
  42. package/dist/policy/core/policy-source-tag.d.ts +0 -1
  43. package/dist/policy/core/policy-source-tag.js.map +1 -1
  44. package/dist/policy/core/provenance.d.ts +7 -35
  45. package/dist/policy/core/provenance.js +4 -21
  46. package/dist/policy/core/provenance.js.map +1 -1
  47. package/dist/policy/engine.d.ts +0 -1
  48. package/dist/policy/engine.js.map +1 -1
  49. package/dist/policy/internal.d.ts +0 -1
  50. package/dist/policy/internal.js.map +1 -1
  51. package/dist/policy/sources/PnpPolicySource.d.ts +6 -20
  52. package/dist/policy/sources/PnpPolicySource.js +6 -19
  53. package/dist/policy/sources/PnpPolicySource.js.map +1 -1
  54. package/dist/runtime/RuntimeRegistry.d.ts +0 -1
  55. package/dist/runtime/RuntimeRegistry.js.map +1 -1
  56. package/dist/runtime/SectionRuntimeEngine.d.ts +13 -29
  57. package/dist/runtime/SectionRuntimeEngine.js +13 -27
  58. package/dist/runtime/SectionRuntimeEngine.js.map +1 -1
  59. package/dist/runtime/adapter/SectionEngineAdapter.d.ts +2 -3
  60. package/dist/runtime/adapter/SectionEngineAdapter.js +2 -2
  61. package/dist/runtime/adapter/SectionEngineAdapter.js.map +1 -1
  62. package/dist/runtime/adapter/coordinator-bridge.d.ts +1 -2
  63. package/dist/runtime/adapter/coordinator-bridge.js +1 -1
  64. package/dist/runtime/adapter/coordinator-bridge.js.map +1 -1
  65. package/dist/runtime/adapter/dom-event-bridge.d.ts +1 -2
  66. package/dist/runtime/adapter/dom-event-bridge.js +1 -1
  67. package/dist/runtime/adapter/dom-event-bridge.js.map +1 -1
  68. package/dist/runtime/adapter/framework-error-bridge.d.ts +0 -1
  69. package/dist/runtime/adapter/framework-error-bridge.js.map +1 -1
  70. package/dist/runtime/adapter/instrumentation-bridge.d.ts +0 -1
  71. package/dist/runtime/adapter/instrumentation-bridge.js.map +1 -1
  72. package/dist/runtime/adapter/subscriber-fanout.d.ts +0 -1
  73. package/dist/runtime/adapter/subscriber-fanout.js.map +1 -1
  74. package/dist/runtime/catalog-registration.d.ts +12 -0
  75. package/dist/runtime/catalog-registration.js +54 -0
  76. package/dist/runtime/catalog-registration.js.map +1 -0
  77. package/dist/runtime/core/SectionEngineCore.d.ts +0 -1
  78. package/dist/runtime/core/SectionEngineCore.js.map +1 -1
  79. package/dist/runtime/core/cohort.d.ts +0 -1
  80. package/dist/runtime/core/cohort.js.map +1 -1
  81. package/dist/runtime/core/engine-input.d.ts +0 -1
  82. package/dist/runtime/core/engine-input.js.map +1 -1
  83. package/dist/runtime/core/engine-output.d.ts +2 -3
  84. package/dist/runtime/core/engine-output.js +2 -2
  85. package/dist/runtime/core/engine-output.js.map +1 -1
  86. package/dist/runtime/core/engine-readiness.d.ts +2 -3
  87. package/dist/runtime/core/engine-readiness.js.map +1 -1
  88. package/dist/runtime/core/engine-resolver.d.ts +13 -42
  89. package/dist/runtime/core/engine-resolver.js +19 -76
  90. package/dist/runtime/core/engine-resolver.js.map +1 -1
  91. package/dist/runtime/core/engine-stage-derivation.d.ts +0 -1
  92. package/dist/runtime/core/engine-stage-derivation.js.map +1 -1
  93. package/dist/runtime/core/engine-state.d.ts +0 -1
  94. package/dist/runtime/core/engine-state.js.map +1 -1
  95. package/dist/runtime/core/engine-transition.d.ts +1 -2
  96. package/dist/runtime/core/engine-transition.js +1 -1
  97. package/dist/runtime/core/engine-transition.js.map +1 -1
  98. package/dist/runtime/engine-context.d.ts +0 -1
  99. package/dist/runtime/engine-context.js.map +1 -1
  100. package/dist/runtime/engine.d.ts +1 -2
  101. package/dist/runtime/engine.js.map +1 -1
  102. package/dist/runtime/internal.d.ts +0 -1
  103. package/dist/runtime/internal.js.map +1 -1
  104. package/dist/runtime/registration-events.d.ts +0 -1
  105. package/dist/runtime/registration-events.js.map +1 -1
  106. package/dist/runtime/runtime-id.d.ts +0 -1
  107. package/dist/runtime/runtime-id.js.map +1 -1
  108. package/dist/runtime/section-runtime-engine-host-context.d.ts +22 -16
  109. package/dist/runtime/section-runtime-engine-host-context.js +10 -10
  110. package/dist/runtime/section-runtime-engine-host-context.js.map +1 -1
  111. package/dist/runtime/session-event-emitter-policy.d.ts +0 -1
  112. package/dist/runtime/session-event-emitter-policy.js.map +1 -1
  113. package/dist/runtime/stage-emit-gate.d.ts +4 -5
  114. package/dist/runtime/stage-emit-gate.js +3 -3
  115. package/dist/runtime/stage-emit-gate.js.map +1 -1
  116. package/dist/runtime/tool-host-contract.d.ts +0 -1
  117. package/dist/runtime/tool-host-contract.js.map +1 -1
  118. package/dist/services/AccessibilityCatalogResolver.d.ts +23 -1
  119. package/dist/services/AccessibilityCatalogResolver.js +200 -28
  120. package/dist/services/AccessibilityCatalogResolver.js.map +1 -1
  121. package/dist/services/ContextVariableStore.d.ts +0 -1
  122. package/dist/services/ContextVariableStore.js.map +1 -1
  123. package/dist/services/ElementToolStateStore.d.ts +0 -1
  124. package/dist/services/ElementToolStateStore.js.map +1 -1
  125. package/dist/services/HighlightCoordinator.d.ts +25 -1
  126. package/dist/services/HighlightCoordinator.js +125 -0
  127. package/dist/services/HighlightCoordinator.js.map +1 -1
  128. package/dist/services/I18nService.d.ts +0 -1
  129. package/dist/services/I18nService.js.map +1 -1
  130. package/dist/services/RangeSerializer.d.ts +0 -1
  131. package/dist/services/RangeSerializer.js.map +1 -1
  132. package/dist/services/SSMLExtractor.d.ts +16 -2
  133. package/dist/services/SSMLExtractor.js +86 -7
  134. package/dist/services/SSMLExtractor.js.map +1 -1
  135. package/dist/services/TTSService.d.ts +30 -5
  136. package/dist/services/TTSService.js +652 -159
  137. package/dist/services/TTSService.js.map +1 -1
  138. package/dist/services/ThemeProvider.d.ts +0 -1
  139. package/dist/services/ThemeProvider.js.map +1 -1
  140. package/dist/services/ToolConfigResolver.d.ts +0 -1
  141. package/dist/services/ToolConfigResolver.js.map +1 -1
  142. package/dist/services/ToolCoordinator.d.ts +0 -1
  143. package/dist/services/ToolCoordinator.js.map +1 -1
  144. package/dist/services/ToolRegistry.d.ts +2 -3
  145. package/dist/services/ToolRegistry.js +1 -1
  146. package/dist/services/ToolRegistry.js.map +1 -1
  147. package/dist/services/ToolkitCoordinator.d.ts +16 -74
  148. package/dist/services/ToolkitCoordinator.js +34 -113
  149. package/dist/services/ToolkitCoordinator.js.map +1 -1
  150. package/dist/services/create-tools-config.d.ts +0 -1
  151. package/dist/services/create-tools-config.js.map +1 -1
  152. package/dist/services/createDefaultToolRegistry.d.ts +0 -1
  153. package/dist/services/createDefaultToolRegistry.js.map +1 -1
  154. package/dist/services/defaultPersonalNeedsProfile.d.ts +0 -1
  155. package/dist/services/defaultPersonalNeedsProfile.js.map +1 -1
  156. package/dist/services/framework-error-bus.d.ts +0 -1
  157. package/dist/services/framework-error-bus.js.map +1 -1
  158. package/dist/services/framework-error.d.ts +0 -1
  159. package/dist/services/framework-error.js.map +1 -1
  160. package/dist/services/interfaces.d.ts +20 -3
  161. package/dist/services/interfaces.js.map +1 -1
  162. package/dist/services/pnp-standard-features.d.ts +0 -1
  163. package/dist/services/pnp-standard-features.js.map +1 -1
  164. package/dist/services/section-controller-types.d.ts +0 -1
  165. package/dist/services/section-controller-types.js.map +1 -1
  166. package/dist/services/tool-config-defaults.d.ts +0 -1
  167. package/dist/services/tool-config-defaults.js.map +1 -1
  168. package/dist/services/tool-config-validation.d.ts +1 -2
  169. package/dist/services/tool-config-validation.js +7 -7
  170. package/dist/services/tool-config-validation.js.map +1 -1
  171. package/dist/services/tool-context.d.ts +0 -1
  172. package/dist/services/tool-context.js.map +1 -1
  173. package/dist/services/tool-instance-id.d.ts +0 -1
  174. package/dist/services/tool-instance-id.js +1 -1
  175. package/dist/services/tool-instance-id.js.map +1 -1
  176. package/dist/services/tool-providers/DesmosToolProvider.d.ts +0 -1
  177. package/dist/services/tool-providers/DesmosToolProvider.js.map +1 -1
  178. package/dist/services/tool-providers/TTSToolProvider.d.ts +0 -1
  179. package/dist/services/tool-providers/TTSToolProvider.js +3 -3
  180. package/dist/services/tool-providers/TTSToolProvider.js.map +1 -1
  181. package/dist/services/tool-providers/ToolProviderApi.d.ts +0 -1
  182. package/dist/services/tool-providers/ToolProviderApi.js.map +1 -1
  183. package/dist/services/tool-providers/ToolProviderRegistry.d.ts +0 -1
  184. package/dist/services/tool-providers/ToolProviderRegistry.js.map +1 -1
  185. package/dist/services/tool-providers/index.d.ts +0 -1
  186. package/dist/services/tool-providers/index.js.map +1 -1
  187. package/dist/services/toolbar-items.d.ts +0 -1
  188. package/dist/services/toolbar-items.js.map +1 -1
  189. package/dist/services/tools-config-normalizer.d.ts +13 -3
  190. package/dist/services/tools-config-normalizer.js +3 -8
  191. package/dist/services/tools-config-normalizer.js.map +1 -1
  192. package/dist/services/tts/browser-provider.d.ts +0 -1
  193. package/dist/services/tts/browser-provider.js +2 -0
  194. package/dist/services/tts/browser-provider.js.map +1 -1
  195. package/dist/services/tts/catalog-span-alignment.d.ts +39 -0
  196. package/dist/services/tts/catalog-span-alignment.js +300 -0
  197. package/dist/services/tts/catalog-span-alignment.js.map +1 -0
  198. package/dist/services/tts/generated-speech/assemble-plan.d.ts +33 -0
  199. package/dist/services/tts/generated-speech/assemble-plan.js +111 -0
  200. package/dist/services/tts/generated-speech/assemble-plan.js.map +1 -0
  201. package/dist/services/tts/generated-speech/dom/build-dom-plan.d.ts +25 -0
  202. package/dist/services/tts/generated-speech/dom/build-dom-plan.js +66 -0
  203. package/dist/services/tts/generated-speech/dom/build-dom-plan.js.map +1 -0
  204. package/dist/services/tts/generated-speech/dom/to-chunk-inputs.d.ts +19 -0
  205. package/dist/services/tts/generated-speech/dom/to-chunk-inputs.js +71 -0
  206. package/dist/services/tts/generated-speech/dom/to-chunk-inputs.js.map +1 -0
  207. package/dist/services/tts/generated-speech/dom/types.d.ts +37 -0
  208. package/dist/services/tts/generated-speech/dom/types.js +2 -0
  209. package/dist/services/tts/generated-speech/dom/types.js.map +1 -0
  210. package/dist/services/tts/generated-speech/index.d.ts +17 -0
  211. package/dist/services/tts/generated-speech/index.js +17 -0
  212. package/dist/services/tts/generated-speech/index.js.map +1 -0
  213. package/dist/services/tts/generated-speech/math-speech-cache.d.ts +15 -0
  214. package/dist/services/tts/generated-speech/math-speech-cache.js +78 -0
  215. package/dist/services/tts/generated-speech/math-speech-cache.js.map +1 -0
  216. package/dist/services/tts/generated-speech/types.d.ts +104 -0
  217. package/dist/services/tts/generated-speech/types.js +18 -0
  218. package/dist/services/tts/generated-speech/types.js.map +1 -0
  219. package/dist/services/tts/highlight-pipeline/boundary-normalizer.d.ts +2 -0
  220. package/dist/services/tts/highlight-pipeline/boundary-normalizer.js +106 -0
  221. package/dist/services/tts/highlight-pipeline/boundary-normalizer.js.map +1 -0
  222. package/dist/services/tts/highlight-pipeline/create-highlight-plan.d.ts +6 -0
  223. package/dist/services/tts/highlight-pipeline/create-highlight-plan.js +217 -0
  224. package/dist/services/tts/highlight-pipeline/create-highlight-plan.js.map +1 -0
  225. package/dist/services/tts/highlight-pipeline/highlight-policy.d.ts +2 -0
  226. package/dist/services/tts/highlight-pipeline/highlight-policy.js +32 -0
  227. package/dist/services/tts/highlight-pipeline/highlight-policy.js.map +1 -0
  228. package/dist/services/tts/highlight-pipeline/index.d.ts +9 -0
  229. package/dist/services/tts/highlight-pipeline/index.js +9 -0
  230. package/dist/services/tts/highlight-pipeline/index.js.map +1 -0
  231. package/dist/services/tts/highlight-pipeline/math-semantic-resolver.d.ts +3 -0
  232. package/dist/services/tts/highlight-pipeline/math-semantic-resolver.js +32 -0
  233. package/dist/services/tts/highlight-pipeline/math-semantic-resolver.js.map +1 -0
  234. package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.d.ts +29 -0
  235. package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.js +44 -0
  236. package/dist/services/tts/highlight-pipeline/normalize-speech-chunks.js.map +1 -0
  237. package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.d.ts +2 -0
  238. package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.js +20 -0
  239. package/dist/services/tts/highlight-pipeline/prose-boundary-resolver.js.map +1 -0
  240. package/dist/services/tts/highlight-pipeline/readable-region.d.ts +1 -0
  241. package/dist/services/tts/highlight-pipeline/readable-region.js +19 -0
  242. package/dist/services/tts/highlight-pipeline/readable-region.js.map +1 -0
  243. package/dist/services/tts/highlight-pipeline/rendered-math-target-resolver.d.ts +6 -0
  244. package/dist/services/tts/highlight-pipeline/rendered-math-target-resolver.js +198 -0
  245. package/dist/services/tts/highlight-pipeline/rendered-math-target-resolver.js.map +1 -0
  246. package/dist/services/tts/highlight-pipeline/types.d.ts +72 -0
  247. package/dist/services/tts/highlight-pipeline/types.js +2 -0
  248. package/dist/services/tts/highlight-pipeline/types.js.map +1 -0
  249. package/dist/services/tts/highlight-pipeline/visible-map-range.d.ts +2 -0
  250. package/dist/services/tts/highlight-pipeline/visible-map-range.js +22 -0
  251. package/dist/services/tts/highlight-pipeline/visible-map-range.js.map +1 -0
  252. package/dist/services/tts/math-alignment/index.d.ts +30 -0
  253. package/dist/services/tts/math-alignment/index.js +66 -0
  254. package/dist/services/tts/math-alignment/index.js.map +1 -0
  255. package/dist/services/tts/math-alignment/mathml-tokenizer.d.ts +2 -0
  256. package/dist/services/tts/math-alignment/mathml-tokenizer.js +317 -0
  257. package/dist/services/tts/math-alignment/mathml-tokenizer.js.map +1 -0
  258. package/dist/services/tts/math-alignment/range-resolver.d.ts +10 -0
  259. package/dist/services/tts/math-alignment/range-resolver.js +13 -0
  260. package/dist/services/tts/math-alignment/range-resolver.js.map +1 -0
  261. package/dist/services/tts/math-alignment/sequence-aligner.d.ts +7 -0
  262. package/dist/services/tts/math-alignment/sequence-aligner.js +119 -0
  263. package/dist/services/tts/math-alignment/sequence-aligner.js.map +1 -0
  264. package/dist/services/tts/math-alignment/speech-tokenizer.d.ts +31 -0
  265. package/dist/services/tts/math-alignment/speech-tokenizer.js +143 -0
  266. package/dist/services/tts/math-alignment/speech-tokenizer.js.map +1 -0
  267. package/dist/services/tts/math-alignment/types.d.ts +58 -0
  268. package/dist/services/tts/math-alignment/types.js +2 -0
  269. package/dist/services/tts/math-alignment/types.js.map +1 -0
  270. package/dist/services/tts/math-aware-text-processing.d.ts +18 -0
  271. package/dist/services/tts/math-aware-text-processing.js +348 -0
  272. package/dist/services/tts/math-aware-text-processing.js.map +1 -0
  273. package/dist/services/tts/math-speech.d.ts +44 -0
  274. package/dist/services/tts/math-speech.js +147 -0
  275. package/dist/services/tts/math-speech.js.map +1 -0
  276. package/dist/services/tts/mathml-sanitization.d.ts +1 -0
  277. package/dist/services/tts/mathml-sanitization.js +170 -0
  278. package/dist/services/tts/mathml-sanitization.js.map +1 -0
  279. package/dist/services/tts/ssml/spoken-text.d.ts +33 -0
  280. package/dist/services/tts/ssml/spoken-text.js +159 -0
  281. package/dist/services/tts/ssml/spoken-text.js.map +1 -0
  282. package/dist/services/tts/text-processing.d.ts +3 -1
  283. package/dist/services/tts/text-processing.js +30 -4
  284. package/dist/services/tts/text-processing.js.map +1 -1
  285. package/dist/services/tts/text-segmentation.d.ts +0 -1
  286. package/dist/services/tts/text-segmentation.js.map +1 -1
  287. package/dist/services/tts/visual-line-ranges.d.ts +0 -1
  288. package/dist/services/tts/visual-line-ranges.js.map +1 -1
  289. package/dist/services/tts-control-events.d.ts +0 -1
  290. package/dist/services/tts-control-events.js.map +1 -1
  291. package/dist/services/tts-runtime-config.d.ts +17 -2
  292. package/dist/services/tts-runtime-config.js +11 -1
  293. package/dist/services/tts-runtime-config.js.map +1 -1
  294. package/dist/tools/calculators/desmos-provider.d.ts +0 -1
  295. package/dist/tools/calculators/desmos-provider.js.map +1 -1
  296. package/dist/tools/client.d.ts +0 -1
  297. package/dist/tools/client.js.map +1 -1
  298. package/dist/tools/default-tool-module-loaders.d.ts +0 -1
  299. package/dist/tools/default-tool-module-loaders.js.map +1 -1
  300. package/dist/tools/index.d.ts +0 -1
  301. package/dist/tools/index.js.map +1 -1
  302. package/dist/tools/library-loader.d.ts +0 -1
  303. package/dist/tools/library-loader.js.map +1 -1
  304. package/dist/tools/registrations/accessibility-tools.d.ts +0 -1
  305. package/dist/tools/registrations/accessibility-tools.js +0 -1
  306. package/dist/tools/registrations/accessibility-tools.js.map +1 -1
  307. package/dist/tools/registrations/calculator.d.ts +0 -1
  308. package/dist/tools/registrations/calculator.js +41 -2
  309. package/dist/tools/registrations/calculator.js.map +1 -1
  310. package/dist/tools/registrations/interaction-tools.d.ts +0 -1
  311. package/dist/tools/registrations/interaction-tools.js.map +1 -1
  312. package/dist/tools/registrations/measurement-tools.d.ts +0 -1
  313. package/dist/tools/registrations/measurement-tools.js.map +1 -1
  314. package/dist/tools/registrations/subject-specific-tools.d.ts +0 -1
  315. package/dist/tools/registrations/subject-specific-tools.js.map +1 -1
  316. package/dist/tools/registrations/toolbar-registration-helpers.d.ts +0 -1
  317. package/dist/tools/registrations/toolbar-registration-helpers.js.map +1 -1
  318. package/dist/tools/registrations/tts.d.ts +0 -1
  319. package/dist/tools/registrations/tts.js.map +1 -1
  320. package/dist/tools/response-discovery.d.ts +0 -1
  321. package/dist/tools/response-discovery.js.map +1 -1
  322. package/dist/tools/tool-tag-map.d.ts +0 -1
  323. package/dist/tools/tool-tag-map.js +0 -1
  324. package/dist/tools/tool-tag-map.js.map +1 -1
  325. package/dist/tools/types.d.ts +0 -1
  326. package/dist/tools/types.js.map +1 -1
  327. package/dist/tools/variant-resolver.d.ts +0 -1
  328. package/dist/tools/variant-resolver.js.map +1 -1
  329. package/dist/utils/logger.d.ts +0 -1
  330. package/dist/utils/logger.js.map +1 -1
  331. package/package.json +8 -11
  332. package/dist/attempt/AssessmentSession.d.ts.map +0 -1
  333. package/dist/attempt/TestSession.d.ts.map +0 -1
  334. package/dist/attempt/adapters/activity-to-test-attempt-session.d.ts.map +0 -1
  335. package/dist/components/item-toolbar-element.d.ts.map +0 -1
  336. package/dist/components/pie-assessment-toolkit-element.d.ts.map +0 -1
  337. package/dist/components/section-toolbar-element.d.ts.map +0 -1
  338. package/dist/context/assessment-toolkit-context.d.ts.map +0 -1
  339. package/dist/context/runtime-context-consumer.d.ts.map +0 -1
  340. package/dist/index.d.ts.map +0 -1
  341. package/dist/item-loader.d.ts.map +0 -1
  342. package/dist/policy/core/PolicySource.d.ts.map +0 -1
  343. package/dist/policy/core/ToolPolicyEngine.d.ts.map +0 -1
  344. package/dist/policy/core/compose-decision.d.ts.map +0 -1
  345. package/dist/policy/core/decision-types.d.ts.map +0 -1
  346. package/dist/policy/core/engine-context.d.ts.map +0 -1
  347. package/dist/policy/core/pnp-policy-inputs.d.ts.map +0 -1
  348. package/dist/policy/core/policy-source-tag.d.ts.map +0 -1
  349. package/dist/policy/core/provenance.d.ts.map +0 -1
  350. package/dist/policy/engine.d.ts.map +0 -1
  351. package/dist/policy/internal.d.ts.map +0 -1
  352. package/dist/policy/sources/PnpPolicySource.d.ts.map +0 -1
  353. package/dist/runtime/RuntimeRegistry.d.ts.map +0 -1
  354. package/dist/runtime/SectionRuntimeEngine.d.ts.map +0 -1
  355. package/dist/runtime/adapter/SectionEngineAdapter.d.ts.map +0 -1
  356. package/dist/runtime/adapter/coordinator-bridge.d.ts.map +0 -1
  357. package/dist/runtime/adapter/dom-event-bridge.d.ts.map +0 -1
  358. package/dist/runtime/adapter/framework-error-bridge.d.ts.map +0 -1
  359. package/dist/runtime/adapter/instrumentation-bridge.d.ts.map +0 -1
  360. package/dist/runtime/adapter/subscriber-fanout.d.ts.map +0 -1
  361. package/dist/runtime/core/SectionEngineCore.d.ts.map +0 -1
  362. package/dist/runtime/core/cohort.d.ts.map +0 -1
  363. package/dist/runtime/core/engine-input.d.ts.map +0 -1
  364. package/dist/runtime/core/engine-output.d.ts.map +0 -1
  365. package/dist/runtime/core/engine-readiness.d.ts.map +0 -1
  366. package/dist/runtime/core/engine-resolver.d.ts.map +0 -1
  367. package/dist/runtime/core/engine-stage-derivation.d.ts.map +0 -1
  368. package/dist/runtime/core/engine-state.d.ts.map +0 -1
  369. package/dist/runtime/core/engine-transition.d.ts.map +0 -1
  370. package/dist/runtime/engine-context.d.ts.map +0 -1
  371. package/dist/runtime/engine.d.ts.map +0 -1
  372. package/dist/runtime/internal.d.ts.map +0 -1
  373. package/dist/runtime/registration-events.d.ts.map +0 -1
  374. package/dist/runtime/runtime-id.d.ts.map +0 -1
  375. package/dist/runtime/section-runtime-engine-host-context.d.ts.map +0 -1
  376. package/dist/runtime/session-event-emitter-policy.d.ts.map +0 -1
  377. package/dist/runtime/stage-emit-gate.d.ts.map +0 -1
  378. package/dist/runtime/tool-host-contract.d.ts.map +0 -1
  379. package/dist/services/AccessibilityCatalogResolver.d.ts.map +0 -1
  380. package/dist/services/ContextVariableStore.d.ts.map +0 -1
  381. package/dist/services/ElementToolStateStore.d.ts.map +0 -1
  382. package/dist/services/HighlightCoordinator.d.ts.map +0 -1
  383. package/dist/services/I18nService.d.ts.map +0 -1
  384. package/dist/services/PNPToolResolver.d.ts +0 -281
  385. package/dist/services/PNPToolResolver.d.ts.map +0 -1
  386. package/dist/services/PNPToolResolver.js +0 -514
  387. package/dist/services/PNPToolResolver.js.map +0 -1
  388. package/dist/services/RangeSerializer.d.ts.map +0 -1
  389. package/dist/services/SSMLExtractor.d.ts.map +0 -1
  390. package/dist/services/TTSService.d.ts.map +0 -1
  391. package/dist/services/ThemeProvider.d.ts.map +0 -1
  392. package/dist/services/ToolConfigResolver.d.ts.map +0 -1
  393. package/dist/services/ToolCoordinator.d.ts.map +0 -1
  394. package/dist/services/ToolRegistry.d.ts.map +0 -1
  395. package/dist/services/ToolkitCoordinator.d.ts.map +0 -1
  396. package/dist/services/create-tools-config.d.ts.map +0 -1
  397. package/dist/services/createDefaultToolRegistry.d.ts.map +0 -1
  398. package/dist/services/defaultPersonalNeedsProfile.d.ts.map +0 -1
  399. package/dist/services/framework-error-bus.d.ts.map +0 -1
  400. package/dist/services/framework-error.d.ts.map +0 -1
  401. package/dist/services/interfaces.d.ts.map +0 -1
  402. package/dist/services/pnp-provenance.d.ts +0 -167
  403. package/dist/services/pnp-provenance.d.ts.map +0 -1
  404. package/dist/services/pnp-provenance.js +0 -231
  405. package/dist/services/pnp-provenance.js.map +0 -1
  406. package/dist/services/pnp-standard-features.d.ts.map +0 -1
  407. package/dist/services/section-controller-types.d.ts.map +0 -1
  408. package/dist/services/tool-config-defaults.d.ts.map +0 -1
  409. package/dist/services/tool-config-validation.d.ts.map +0 -1
  410. package/dist/services/tool-context.d.ts.map +0 -1
  411. package/dist/services/tool-instance-id.d.ts.map +0 -1
  412. package/dist/services/tool-providers/DesmosToolProvider.d.ts.map +0 -1
  413. package/dist/services/tool-providers/TTSToolProvider.d.ts.map +0 -1
  414. package/dist/services/tool-providers/ToolProviderApi.d.ts.map +0 -1
  415. package/dist/services/tool-providers/ToolProviderRegistry.d.ts.map +0 -1
  416. package/dist/services/tool-providers/index.d.ts.map +0 -1
  417. package/dist/services/toolbar-items.d.ts.map +0 -1
  418. package/dist/services/tools-config-normalizer.d.ts.map +0 -1
  419. package/dist/services/tts/browser-provider.d.ts.map +0 -1
  420. package/dist/services/tts/text-processing.d.ts.map +0 -1
  421. package/dist/services/tts/text-segmentation.d.ts.map +0 -1
  422. package/dist/services/tts/visual-line-ranges.d.ts.map +0 -1
  423. package/dist/services/tts-control-events.d.ts.map +0 -1
  424. package/dist/services/tts-runtime-config.d.ts.map +0 -1
  425. package/dist/tools/calculators/desmos-provider.d.ts.map +0 -1
  426. package/dist/tools/client.d.ts.map +0 -1
  427. package/dist/tools/default-tool-module-loaders.d.ts.map +0 -1
  428. package/dist/tools/index.d.ts.map +0 -1
  429. package/dist/tools/library-loader.d.ts.map +0 -1
  430. package/dist/tools/registrations/accessibility-tools.d.ts.map +0 -1
  431. package/dist/tools/registrations/calculator.d.ts.map +0 -1
  432. package/dist/tools/registrations/interaction-tools.d.ts.map +0 -1
  433. package/dist/tools/registrations/measurement-tools.d.ts.map +0 -1
  434. package/dist/tools/registrations/subject-specific-tools.d.ts.map +0 -1
  435. package/dist/tools/registrations/toolbar-registration-helpers.d.ts.map +0 -1
  436. package/dist/tools/registrations/tts.d.ts.map +0 -1
  437. package/dist/tools/response-discovery.d.ts.map +0 -1
  438. package/dist/tools/tool-tag-map.d.ts.map +0 -1
  439. package/dist/tools/types.d.ts.map +0 -1
  440. package/dist/tools/variant-resolver.d.ts.map +0 -1
  441. package/dist/utils/logger.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SectionEngineAdapter.js","sourceRoot":"","sources":["../../../src/runtime/adapter/SectionEngineAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAIjE,OAAO,EACN,uBAAuB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,oBAAoB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,0BAA0B,GAE1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,2BAA2B,GAG3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,sBAAsB,GAGtB,MAAM,wBAAwB,CAAC;AAqChC,MAAM,OAAO,oBAAoB;IACf,IAAI,CAAoB;IACxB,cAAc,CAAuB;IACrC,oBAAoB,CAA6B;IACjD,qBAAqB,CAA8B;IACnD,gBAAgB,CAAyB;IACzC,iBAAiB,CAAiC;IAClD,eAAe,CAAa;IACrC,QAAQ,GAAG,KAAK,CAAC;IAEzB,YAAY,OAAoC;QAC/C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,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C,MAA2B;QAC3C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,cAAc,CAAC;YACpB,KAAK,kBAAkB;gBACtB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACrC,MAAM;YACP,KAAK,iBAAiB;gBACrB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACrC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAC3C,MAAM;YACP,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,UAAU,GAAU,MAAM,CAAC;gBACjC,KAAK,UAAU,CAAC;gBAChB,OAAO;YACR,CAAC;QACF,CAAC;QACD,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;CACD"}
1
+ {"version":3,"file":"SectionEngineAdapter.js","sourceRoot":"","sources":["../../../src/runtime/adapter/SectionEngineAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAIjE,OAAO,EACN,uBAAuB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,oBAAoB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,0BAA0B,GAE1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,2BAA2B,GAG3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,sBAAsB,GAGtB,MAAM,wBAAwB,CAAC;AAqChC,MAAM,OAAO,oBAAoB;IACf,IAAI,CAAoB;IACxB,cAAc,CAAuB;IACrC,oBAAoB,CAA6B;IACjD,qBAAqB,CAA8B;IACnD,gBAAgB,CAAyB;IACzC,iBAAiB,CAAiC;IAClD,eAAe,CAAa;IACrC,QAAQ,GAAG,KAAK,CAAC;IAEzB,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AC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAEO,QAAQ,CAAC,MAA2B;QAC3C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,cAAc,CAAC;YACpB,KAAK,kBAAkB;gBACtB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACrC,MAAM;YACP,KAAK,iBAAiB;gBACrB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACrC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAC3C,MAAM;YACP,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,UAAU,GAAU,MAAM,CAAC;gBACjC,KAAK,UAAU,CAAC;gBAChB,OAAO;YACR,CAAC;QACF,CAAC;QACD,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;CACD","sourcesContent":["/**\n * Section runtime engine adapter (M7 — Variant C, layered).\n *\n * The adapter is the single I/O seam between the pure FSM core\n * (`SectionEngineCore`) and the rest of the world (DOM, coordinator,\n * framework-error bus, host subscribers, instrumentation). It does\n * exactly two jobs:\n *\n * 1. Translate **host inputs** (from kernels, the toolkit CE, or\n * direct facade callers) into `SectionEngineInput`s and forward\n * them to the core via `core.dispatch(input)`.\n *\n * 2. Subscribe to the core's output stream and **route each output**\n * through the bridges in a deterministic order so the public DOM\n * surface, framework-error bus, instrumentation hook, and host\n * subscribers all see exactly the same fan-out with\n * byte-identical detail shapes.\n *\n * Output routing is a single exhaustive `switch` (`assertNever` on\n * the default branch) so adding a new `SectionEngineOutput` kind in\n * `engine-output.ts` is a compile error here until the adapter knows\n * what to do with it.\n *\n * **Routing order per output:**\n * - canonical DOM event (`pie-stage-change`, `pie-loading-complete`,\n * `framework-error`)\n * - framework-error bus (single fan-out for in-process subscribers)\n * - instrumentation hook\n * - public subscriber fan-out (batched, runs once per\n * `core.dispatch`)\n *\n * The `readiness-change` / `interaction-ready` / `ready`\n * DOM events and their event bridge were removed in the\n * broad architecture review compat sweep; the corresponding output\n * kinds are gone from `engine-output.ts`.\n *\n * **Layering constraint.** The adapter is plain TS. It must not\n * import `svelte` — the M7 implementation plan and\n * `scripts/check-engine-core-purity.mjs` enforce the core's purity;\n * the adapter follows the same constraint by convention so it stays\n * usable from non-Svelte hosts (Node tests, Storybook, or future\n * non-Svelte consumers). `bun run check:custom-elements` already\n * blocks `.svelte` imports in published `dist`; adding a Svelte\n * dependency here would also leak through that gate.\n */\n\nimport type { FrameworkErrorReporter } from \"../../services/framework-error-bus.js\";\nimport { SectionEngineCore } from \"../core/SectionEngineCore.js\";\nimport type { SectionEngineInput } from \"../core/engine-input.js\";\nimport type { SectionEngineOutput } from \"../core/engine-output.js\";\nimport type { SectionEngineState } from \"../core/engine-state.js\";\nimport {\n\tcreateCoordinatorBridge,\n\ttype CoordinatorBridgeHandle,\n\ttype CoordinatorPort,\n\ttype ResolveSectionControllerArgs,\n} from \"./coordinator-bridge.js\";\nimport {\n\tcreateDomEventBridge,\n\ttype DomEventBridgeHandle,\n} from \"./dom-event-bridge.js\";\nimport {\n\tcreateFrameworkErrorBridge,\n\ttype FrameworkErrorBridgeHandle,\n} from \"./framework-error-bridge.js\";\nimport {\n\tcreateInstrumentationBridge,\n\ttype InstrumentationBridgeHandle,\n\ttype InstrumentationHook,\n} from \"./instrumentation-bridge.js\";\nimport {\n\tcreateSubscriberFanout,\n\ttype EngineOutputListener,\n\ttype SubscriberFanoutHandle,\n} from \"./subscriber-fanout.js\";\n\nexport interface SectionEngineAdapterOptions {\n\t/** Element on which DOM events are dispatched. */\n\thost: EventTarget;\n\t/** Stable runtime id for this engine instance. */\n\truntimeId: string;\n\t/**\n\t * Tag name of the host CE without the `--version-<encoded>` suffix.\n\t */\n\tsourceCe: string;\n\t/**\n\t * Framework-error bus (write side). Shared with the toolkit CE so\n\t * subscribers via `coordinator.subscribeFrameworkErrors` see the\n\t * same fan-out.\n\t */\n\tframeworkErrorBus: FrameworkErrorReporter;\n\t/**\n\t * Optional toolkit coordinator. When supplied, the adapter wires\n\t * its framework-error subscription, controller resolution, and\n\t * disposal through the coordinator-bridge. Standalone callers (no\n\t * coordinator) can omit this and feed `framework-error` and\n\t * `section-controller-resolved` inputs directly.\n\t */\n\tcoordinator?: CoordinatorPort;\n\t/** Optional one-shot observability hook. */\n\tinstrumentationHook?: InstrumentationHook;\n\t/** Clock injection for the DOM bridge. Defaults to `Date.now()`. */\n\tnow?: () => string;\n\t/**\n\t * Optional pre-constructed core. Defaults to a fresh\n\t * `SectionEngineCore`. Tests pass a mocked core to assert dispatch\n\t * ordering; production callers use the default.\n\t */\n\tcore?: SectionEngineCore;\n}\n\nexport class SectionEngineAdapter {\n\tprivate readonly core: SectionEngineCore;\n\tprivate readonly domEventBridge: DomEventBridgeHandle;\n\tprivate readonly frameworkErrorBridge: FrameworkErrorBridgeHandle;\n\tprivate readonly instrumentationBridge: InstrumentationBridgeHandle;\n\tprivate readonly subscriberFanout: SubscriberFanoutHandle;\n\tprivate readonly coordinatorBridge: CoordinatorBridgeHandle | null;\n\tprivate readonly unsubscribeCore: () => void;\n\tprivate disposed = false;\n\n\tconstructor(options: SectionEngineAdapterOptions) {\n\t\tthis.core = options.core ?? new SectionEngineCore();\n\t\tthis.domEventBridge = createDomEventBridge({\n\t\t\thost: options.host,\n\t\t\truntimeId: options.runtimeId,\n\t\t\tsourceCe: options.sourceCe,\n\t\t\tnow: options.now,\n\t\t});\n\t\tthis.frameworkErrorBridge = createFrameworkErrorBridge({\n\t\t\tbus: options.frameworkErrorBus,\n\t\t});\n\t\tthis.instrumentationBridge = createInstrumentationBridge({\n\t\t\thook: options.instrumentationHook,\n\t\t});\n\t\tthis.subscriberFanout = createSubscriberFanout();\n\t\tthis.coordinatorBridge = options.coordinator\n\t\t\t? createCoordinatorBridge({\n\t\t\t\t\tcoordinator: options.coordinator,\n\t\t\t\t\tdispatchCoreInput: (input) => this.dispatchInput(input),\n\t\t\t\t})\n\t\t\t: null;\n\n\t\tthis.unsubscribeCore = this.core.subscribe((outputs) => {\n\t\t\tthis.routeOutputs(outputs);\n\t\t});\n\t}\n\n\t/**\n\t * Read-only snapshot of the FSM state. Mirrors\n\t * `SectionEngineCore.getState()`.\n\t */\n\tgetState(): Readonly<SectionEngineState> {\n\t\treturn this.core.getState();\n\t}\n\n\t/**\n\t * Forward a host-constructed input to the core. Returns the outputs\n\t * that resulted (the bridges have already received them).\n\t */\n\tdispatchInput(input: SectionEngineInput): readonly SectionEngineOutput[] {\n\t\tif (this.disposed) return [];\n\t\treturn this.core.dispatch(input);\n\t}\n\n\t/**\n\t * Subscribe to batched output streams, one batch per\n\t * `dispatchInput`.\n\t */\n\tsubscribe(listener: EngineOutputListener): () => void {\n\t\treturn this.subscriberFanout.subscribe(listener);\n\t}\n\n\t/**\n\t * Update the host element after construction (e.g. when the kernel\n\t * receives its host element via Svelte action / context).\n\t */\n\tsetHost(host: EventTarget): void {\n\t\tthis.domEventBridge.setHost(host);\n\t}\n\n\t/**\n\t * Update the instrumentation hook at runtime.\n\t */\n\tsetInstrumentationHook(hook: InstrumentationHook | undefined): void {\n\t\tthis.instrumentationBridge.setHook(hook);\n\t}\n\n\t/**\n\t * Resolve a section controller through the configured coordinator.\n\t *\n\t * Throws if the adapter was constructed without a coordinator.\n\t * Standalone callers should manually feed\n\t * `{ kind: \"section-controller-resolved\" }` after their own\n\t * controller resolution path completes.\n\t */\n\tresolveSectionController(args: ResolveSectionControllerArgs): Promise<void> {\n\t\tif (!this.coordinatorBridge) {\n\t\t\tthrow new Error(\n\t\t\t\t\"[SectionEngineAdapter] resolveSectionController called without a coordinator.\",\n\t\t\t);\n\t\t}\n\t\treturn this.coordinatorBridge.resolveSectionController(args);\n\t}\n\n\t/**\n\t * Tear the adapter down. Safe to call more than once. Disposes the\n\t * coordinator bridge (which in turn disposes the section\n\t * controller for the current cohort), detaches the core\n\t * subscription, and clears subscribers.\n\t *\n\t * Does **not** dispose the framework-error bus — its lifetime is\n\t * owned by the toolkit CE / host.\n\t */\n\tasync dispose(): Promise<void> {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\t// Dispatch the FSM `dispose` input first so the disposed-stage\n\t\t// output flows through the bridges before we tear anything down.\n\t\tthis.core.dispatch({ kind: \"dispose\" });\n\t\tthis.unsubscribeCore();\n\t\tthis.subscriberFanout.dispose();\n\t\tif (this.coordinatorBridge) {\n\t\t\tawait this.coordinatorBridge.dispose();\n\t\t}\n\t}\n\n\tprivate routeOutputs(outputs: readonly SectionEngineOutput[]): void {\n\t\tfor (const output of outputs) {\n\t\t\tthis.routeOne(output);\n\t\t}\n\t\tthis.subscriberFanout.emit(outputs);\n\t}\n\n\tprivate routeOne(output: SectionEngineOutput): void {\n\t\tswitch (output.kind) {\n\t\t\tcase \"stage-change\":\n\t\t\tcase \"loading-complete\":\n\t\t\t\tthis.domEventBridge.dispatch(output);\n\t\t\t\tbreak;\n\t\t\tcase \"framework-error\":\n\t\t\t\tthis.domEventBridge.dispatch(output);\n\t\t\t\tthis.frameworkErrorBridge.dispatch(output);\n\t\t\t\tbreak;\n\t\t\tdefault: {\n\t\t\t\tconst exhaustive: never = output;\n\t\t\t\tvoid exhaustive;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.instrumentationBridge.dispatch(output);\n\t}\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Coordinator bridge for the section runtime engine adapter (M7 —
3
3
  * Variant C, layered).
4
4
  *
5
- * Unlike the DOM / legacy / framework-error bridges (which translate
5
+ * Unlike the DOM / framework-error bridges (which translate
6
6
  * **outputs** into I/O), the coordinator bridge is an **input source**:
7
7
  * it listens to a `ToolkitCoordinator` and feeds the resulting events
8
8
  * into the core via the `dispatchCoreInput` callback supplied by the
@@ -90,4 +90,3 @@ export interface CoordinatorBridgeHandle {
90
90
  dispose(): Promise<void>;
91
91
  }
92
92
  export declare function createCoordinatorBridge(options: CoordinatorBridgeOptions): CoordinatorBridgeHandle;
93
- //# sourceMappingURL=coordinator-bridge.d.ts.map
@@ -2,7 +2,7 @@
2
2
  * Coordinator bridge for the section runtime engine adapter (M7 —
3
3
  * Variant C, layered).
4
4
  *
5
- * Unlike the DOM / legacy / framework-error bridges (which translate
5
+ * Unlike the DOM / framework-error bridges (which translate
6
6
  * **outputs** into I/O), the coordinator bridge is an **input source**:
7
7
  * it listens to a `ToolkitCoordinator` and feeds the resulting events
8
8
  * into the core via the `dispatchCoreInput` callback supplied by the
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator-bridge.js","sourceRoot":"","sources":["../../../src/runtime/adapter/coordinator-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAyEH,MAAM,UAAU,uBAAuB,CACtC,OAAiC;IAEjC,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC;IAEnD,IAAI,eAAe,GAAG,CAAC,CAAC;IACxB,IAAI,YAAY,GAAqB,IAAI,CAAC;IAC1C,IAAI,qBAAqB,GAAwB,IAAI,CAAC;IACtD,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,MAAM,0BAA0B,GAAG,WAAW,CAAC,wBAAwB,CACtE,CAAC,KAAK,EAAE,EAAE;QACT,IAAI,CAAC;YACJ,iBAAiB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CACX,sDAAsD,EACtD,KAAK,CACL,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;IAEF,SAAS,4BAA4B;QACpC,IAAI,CAAC,qBAAqB;YAAE,OAAO;QACnC,IAAI,CAAC;YACJ,qBAAqB,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAA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AE,MAAM,CAAC,SAAS,IAAI,SAAS;iBACxC,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CACX,wDAAwD,EACxD,KAAK,CACL,CAAC;YACH,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * Coordinator bridge for the section runtime engine adapter (M7 —\n * Variant C, layered).\n *\n * Unlike the DOM / framework-error bridges (which translate\n * **outputs** into I/O), the coordinator bridge is an **input source**:\n * it listens to a `ToolkitCoordinator` and feeds the resulting events\n * into the core via the `dispatchCoreInput` callback supplied by the\n * adapter.\n *\n * Responsibilities:\n * 1. **Framework-error subscription.** When the coordinator reports\n * a framework error through its bus, dispatch a\n * `{ kind: \"framework-error\" }` core input. Listener isolation\n * matches `FrameworkErrorBus`: a throwing bridge handler is\n * caught and `console.warn`-logged so the original fan-out is\n * not interrupted.\n *\n * 2. **Section-controller resolution.** When the host calls\n * `resolveSectionController({ ... })`, the bridge invokes\n * `coordinator.getOrCreateSectionController({ ... })` and, on\n * successful resolution, dispatches\n * `{ kind: \"section-controller-resolved\" }` to the core. Init\n * tokens guard against late resolutions overwriting a more\n * recent cohort (mirrors `SectionRuntimeEngine.initialize`'s\n * `activeInitToken` pattern).\n *\n * 3. **Disposal.** On `dispose()`, the bridge unsubscribes from the\n * framework-error bus and (if the engine owns the section\n * controller for the cohort) calls\n * `coordinator.disposeSectionController({ ... })`. It does\n * **not** dispose the coordinator itself — the coordinator's\n * lifetime is owned by the toolkit CE / host, not by the engine.\n *\n * Disposal is idempotent: calling `dispose()` twice is a no-op.\n *\n * The bridge **must not** import `svelte`.\n */\n\nimport type {\n\tSectionControllerEvent,\n\tSectionControllerHandle,\n} from \"../../services/section-controller-types.js\";\nimport type { CohortKey } from \"../core/cohort.js\";\nimport type { SectionEngineInput } from \"../core/engine-input.js\";\n\n/**\n * Subset of the `ToolkitCoordinator` surface the bridge consumes. Kept\n * structural so tests can pass a fake without pulling the full\n * coordinator.\n */\nexport interface CoordinatorPort {\n\tsubscribeFrameworkErrors(\n\t\tlistener: (\n\t\t\tmodel: import(\"../../services/framework-error.js\").FrameworkErrorModel,\n\t\t) => void,\n\t): () => void;\n\n\tgetOrCreateSectionController(args: {\n\t\tsectionId: string;\n\t\tattemptId?: string;\n\t\tinput?: unknown;\n\t\tupdateExisting?: boolean;\n\t\tcreateDefaultController: () =>\n\t\t\t| SectionControllerHandle\n\t\t\t| Promise<SectionControllerHandle>;\n\t}): Promise<SectionControllerHandle>;\n\n\tdisposeSectionController(args: {\n\t\tsectionId: string;\n\t\tattemptId?: string;\n\t}): Promise<void>;\n}\n\nexport interface ResolveSectionControllerArgs {\n\tcohort: CohortKey;\n\tassessmentId: string;\n\tview: string;\n\tsection: unknown;\n\tcreateDefaultController: () =>\n\t\t| SectionControllerHandle\n\t\t| Promise<SectionControllerHandle>;\n\t/**\n\t * Optional callback invoked when the controller resolves and on\n\t * every controller `subscribe` event. The kernel uses this to keep\n\t * its composition snapshot in sync with the controller's view.\n\t *\n\t * The bridge is responsible for unsubscribing on dispose / cohort\n\t * change so a stale controller doesn't keep emitting after rollover.\n\t */\n\tonCompositionChanged?: (composition: unknown) => void;\n\t/**\n\t * Optional callback invoked once with the resolved controller handle\n\t * the moment it is available. Lets the host keep a reference for\n\t * direct method calls (e.g. `navigateToItem`, `applySession`)\n\t * without re-querying the coordinator.\n\t */\n\tonControllerResolved?: (controller: SectionControllerHandle) => void;\n}\n\nexport interface CoordinatorBridgeOptions {\n\tcoordinator: CoordinatorPort;\n\tdispatchCoreInput: (input: SectionEngineInput) => void;\n}\n\nexport interface CoordinatorBridgeHandle {\n\tresolveSectionController(args: ResolveSectionControllerArgs): Promise<void>;\n\tdispose(): Promise<void>;\n}\n\nexport function createCoordinatorBridge(\n\toptions: CoordinatorBridgeOptions,\n): CoordinatorBridgeHandle {\n\tconst { coordinator, dispatchCoreInput } = options;\n\n\tlet activeInitToken = 0;\n\tlet activeCohort: CohortKey | null = null;\n\tlet unsubscribeController: (() => void) | null = null;\n\tlet disposed = false;\n\n\tconst unsubscribeFrameworkErrors = coordinator.subscribeFrameworkErrors(\n\t\t(model) => {\n\t\t\ttry {\n\t\t\t\tdispatchCoreInput({ kind: \"framework-error\", error: model });\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"[CoordinatorBridge] framework-error dispatch failed:\",\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t);\n\n\tfunction detachControllerSubscription(): void {\n\t\tif (!unsubscribeController) return;\n\t\ttry {\n\t\t\tunsubscribeController();\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"[CoordinatorBridge] controller unsubscribe failed:\", error);\n\t\t}\n\t\tunsubscribeController = null;\n\t}\n\n\tasync function resolveSectionController(\n\t\targs: ResolveSectionControllerArgs,\n\t): Promise<void> {\n\t\tif (disposed) return;\n\t\tactiveInitToken += 1;\n\t\tconst token = activeInitToken;\n\t\tactiveCohort = args.cohort;\n\n\t\tconst controller = await coordinator.getOrCreateSectionController({\n\t\t\tsectionId: args.cohort.sectionId,\n\t\t\tattemptId: args.cohort.attemptId || undefined,\n\t\t\tinput: {\n\t\t\t\tsection: args.section,\n\t\t\t\tsectionId: args.cohort.sectionId,\n\t\t\t\tassessmentId: args.assessmentId,\n\t\t\t\tview: args.view,\n\t\t\t},\n\t\t\tupdateExisting: true,\n\t\t\tcreateDefaultController: args.createDefaultController,\n\t\t});\n\n\t\t// Drop late resolutions — a cohort change or dispose may have\n\t\t// rolled the token forward while we awaited the coordinator.\n\t\tif (token !== activeInitToken || disposed) return;\n\n\t\tdetachControllerSubscription();\n\n\t\targs.onControllerResolved?.(controller);\n\n\t\tconst getCompositionModel = (\n\t\t\tcontroller as SectionControllerHandle & {\n\t\t\t\tgetCompositionModel?: () => unknown;\n\t\t\t}\n\t\t).getCompositionModel;\n\t\targs.onCompositionChanged?.(getCompositionModel?.());\n\n\t\tif (typeof controller.subscribe === \"function\") {\n\t\t\tunsubscribeController = controller.subscribe(\n\t\t\t\t(_event: SectionControllerEvent) => {\n\t\t\t\t\tif (token !== activeInitToken || disposed) return;\n\t\t\t\t\targs.onCompositionChanged?.(getCompositionModel?.());\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tdispatchCoreInput({ kind: \"section-controller-resolved\" });\n\t}\n\n\tasync function dispose(): Promise<void> {\n\t\tif (disposed) return;\n\t\tdisposed = true;\n\t\tactiveInitToken += 1;\n\t\tdetachControllerSubscription();\n\t\ttry {\n\t\t\tunsubscribeFrameworkErrors();\n\t\t} catch (error) {\n\t\t\tconsole.warn(\n\t\t\t\t\"[CoordinatorBridge] framework-error unsubscribe failed:\",\n\t\t\t\terror,\n\t\t\t);\n\t\t}\n\t\tconst cohort = activeCohort;\n\t\tactiveCohort = null;\n\t\tif (cohort) {\n\t\t\ttry {\n\t\t\t\tawait coordinator.disposeSectionController({\n\t\t\t\t\tsectionId: cohort.sectionId,\n\t\t\t\t\tattemptId: cohort.attemptId || undefined,\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t\"[CoordinatorBridge] section-controller dispose failed:\",\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { resolveSectionController, dispose };\n}\n"]}
@@ -14,7 +14,7 @@
14
14
  * outputs (`{ stage, status, cohort }`, `{ cohort, itemCount,
15
15
  * loadedCount }`). The bridge enriches them with `runtimeId`,
16
16
  * `sourceCe`, and `timestamp` so the dispatched DOM event detail
17
- * matches the legacy
17
+ * matches the canonical
18
18
  * `packages/players-shared/src/pie/stages.ts#StageChangeDetail` and
19
19
  * `LoadingCompleteDetail` shapes verbatim. `runtimeId` and `sourceCe`
20
20
  * are supplied at adapter construction time (one per engine instance);
@@ -60,4 +60,3 @@ export interface DomEventBridgeHandle {
60
60
  setHost(host: EventTarget): void;
61
61
  }
62
62
  export declare function createDomEventBridge(options: DomEventBridgeOptions): DomEventBridgeHandle;
63
- //# sourceMappingURL=dom-event-bridge.d.ts.map
@@ -14,7 +14,7 @@
14
14
  * outputs (`{ stage, status, cohort }`, `{ cohort, itemCount,
15
15
  * loadedCount }`). The bridge enriches them with `runtimeId`,
16
16
  * `sourceCe`, and `timestamp` so the dispatched DOM event detail
17
- * matches the legacy
17
+ * matches the canonical
18
18
  * `packages/players-shared/src/pie/stages.ts#StageChangeDetail` and
19
19
  * `LoadingCompleteDetail` shapes verbatim. `runtimeId` and `sourceCe`
20
20
  * are supplied at adapter construction time (one per engine instance);
@@ -1 +1 @@
1
- {"version":3,"file":"dom-event-bridge.js","sourceRoot":"","sources":["../../../src/runtime/adapter/dom-event-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAoCH,MAAM,UAAU,oBAAoB,CACnC,OAA8B;IAE9B,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACxC,IAAI,IAAI,GAAgB,OAAO,CAAC,IAAI,CAAC;IACrC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAE5D,SAAS,mBAAmB,CAC3B,MAA8D;QAE9D,MAAM,MAAM,GAAsB;YACjC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS;YACT,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS;YACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACzE,SAAS,EAAE,GAAG,EAAE;YAChB,QAAQ;SACR,CAAC;QACF,IAAI,CAAC,aAAa,CACj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,CAAC,CAAC,SAAS;YACxE,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,SAAS,EAAE,GAAG,EAAE;YAChB,QAAQ;SACR,CAAC;QACF,IAAI,CAAC,aAAa,CACjB,IAAI,WAAW,CAAwB,sBAAsB,EAAE;YAC9D,MAAM;SACN,CAAC,CACF,CAAC;IACH,CAAC;IAED,SAAS,sBAAsB,CAC9B,MAAiE;QAEjE,+DAA+D;QAC/D,qDAAqD;QACrD,6DAA6D;QAC7D,yDAAyD;QACzD,IAAI,CAAC,aAAa,CACjB,IAAI,WAAW,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAC5D,CAAC;IACH,CAAC;IAED,SAAS,QAAQ,CAAC,MAA2B;QAC5C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,cAAc;gBAClB,mBAAmB,CAAC,MAAM,CAAC,CAAC;gBAC5B,OAAO;YACR,KAAK,kBAAkB;gBACtB,uBAAuB,CAAC,MAAM,CAAC,CAAC;gBAChC,OAAO;YACR,KAAK,iBAAiB;gBACrB,sBAAsB,CAAC,MAAM,CAAC,CAAC;gBAC/B,OAAO;YACR,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,UAAU,GAAU,MAAM,CAAC;gBACjC,KAAK,UAAU,CAAC;gBAChB,OAAO;YACR,CAAC;QACF,CAAC;IACF,CAAC;IAED,SAAS,OAAO,CAAC,IAAiB;QACjC,IAAI,GAAG,IAAI,CAAC;IACb,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * DOM event bridge for the section runtime engine adapter (M7 — Variant\n * C, layered).\n *\n * Translates canonical engine outputs (`stage-change`,\n * `loading-complete`, `framework-error`) into DOM `CustomEvent`\n * dispatches on the host element. Mirrors the kernel's existing\n * `dispatch(\"pie-stage-change\", …)` / `dispatch(\"pie-loading-complete\", …)`\n * / `dispatch(\"framework-error\", …)` emit chain bit-for-bit so the M6\n * canonical event surface stays stable while the kernel migrates onto\n * the engine in PR 5.\n *\n * **Detail-shape contract.** The engine core emits structurally minimal\n * outputs (`{ stage, status, cohort }`, `{ cohort, itemCount,\n * loadedCount }`). The bridge enriches them with `runtimeId`,\n * `sourceCe`, and `timestamp` so the dispatched DOM event detail\n * matches the canonical\n * `packages/players-shared/src/pie/stages.ts#StageChangeDetail` and\n * `LoadingCompleteDetail` shapes verbatim. `runtimeId` and `sourceCe`\n * are supplied at adapter construction time (one per engine instance);\n * `timestamp` is captured per-emit via the injected `now()` clock so\n * tests can pin a deterministic value.\n *\n * **Why not import the stage tracker.** The tracker's monotonic /\n * skipped-fill enforcement now lives in the engine core's transition\n * function. The bridge is purely an output-to-DOM translator — it does\n * not gate emissions, does not re-order, does not de-duplicate. That\n * keeps the responsibility clean and matches the \"outputs are already\n * ordered correctly by the core\" contract from\n * `engine-transition.ts`.\n *\n * The bridge **must not** import `svelte`; per the M7 layering\n * constraint the adapter is plain TS.\n */\n\nimport type {\n\tLoadingCompleteDetail,\n\tStageChangeDetail,\n} from \"@pie-players/pie-players-shared/pie\";\nimport type { SectionEngineOutput } from \"../core/engine-output.js\";\n\nexport interface DomEventBridgeOptions {\n\t/** Element on which to dispatch the DOM events. */\n\thost: EventTarget;\n\t/** Stable runtime id for this engine instance. */\n\truntimeId: string;\n\t/**\n\t * Tag name of the host CE without the `--version-<encoded>` suffix.\n\t * Each layout CE that mounts the kernel passes its own canonical tag\n\t * name; the toolkit CE passes its own.\n\t */\n\tsourceCe: string;\n\t/**\n\t * Clock injection for tests. Defaults to `() => new Date().toISOString()`.\n\t */\n\tnow?: () => string;\n}\n\nexport interface DomEventBridgeHandle {\n\t/** Translate a single engine output into a DOM dispatch. */\n\tdispatch(output: SectionEngineOutput): void;\n\t/**\n\t * Update the host element after construction (e.g. when the kernel\n\t * receives its host element via Svelte action / context). The\n\t * bridge keeps the latest host; future dispatches go to that host.\n\t */\n\tsetHost(host: EventTarget): void;\n}\n\nexport function createDomEventBridge(\n\toptions: DomEventBridgeOptions,\n): DomEventBridgeHandle {\n\tconst { runtimeId, sourceCe } = options;\n\tlet host: EventTarget = options.host;\n\tconst now = options.now ?? (() => new Date().toISOString());\n\n\tfunction dispatchStageChange(\n\t\toutput: Extract<SectionEngineOutput, { kind: \"stage-change\" }>,\n\t): void {\n\t\tconst detail: StageChangeDetail = {\n\t\t\tstage: output.stage,\n\t\t\tstatus: output.status,\n\t\t\truntimeId,\n\t\t\tsectionId: output.cohort?.sectionId,\n\t\t\tattemptId: output.cohort?.attemptId ? output.cohort.attemptId : undefined,\n\t\t\ttimestamp: now(),\n\t\t\tsourceCe,\n\t\t};\n\t\thost.dispatchEvent(\n\t\t\tnew CustomEvent<StageChangeDetail>(\"pie-stage-change\", { detail }),\n\t\t);\n\t}\n\n\tfunction dispatchLoadingComplete(\n\t\toutput: Extract<SectionEngineOutput, { kind: \"loading-complete\" }>,\n\t): void {\n\t\tconst detail: LoadingCompleteDetail = {\n\t\t\truntimeId,\n\t\t\tsectionId: output.cohort.sectionId,\n\t\t\tattemptId: output.cohort.attemptId ? output.cohort.attemptId : undefined,\n\t\t\titemCount: output.itemCount,\n\t\t\tloadedCount: output.loadedCount,\n\t\t\ttimestamp: now(),\n\t\t\tsourceCe,\n\t\t};\n\t\thost.dispatchEvent(\n\t\t\tnew CustomEvent<LoadingCompleteDetail>(\"pie-loading-complete\", {\n\t\t\t\tdetail,\n\t\t\t}),\n\t\t);\n\t}\n\n\tfunction dispatchFrameworkError(\n\t\toutput: Extract<SectionEngineOutput, { kind: \"framework-error\" }>,\n\t): void {\n\t\t// Mirror the kernel's existing surface — the `framework-error`\n\t\t// DOM event detail is the framework-error model. The\n\t\t// `framework-error-bridge` separately reports the same model\n\t\t// into the bus so subscribers see one fan-out per error.\n\t\thost.dispatchEvent(\n\t\t\tnew CustomEvent(\"framework-error\", { detail: output.error }),\n\t\t);\n\t}\n\n\tfunction dispatch(output: SectionEngineOutput): void {\n\t\tswitch (output.kind) {\n\t\t\tcase \"stage-change\":\n\t\t\t\tdispatchStageChange(output);\n\t\t\t\treturn;\n\t\t\tcase \"loading-complete\":\n\t\t\t\tdispatchLoadingComplete(output);\n\t\t\t\treturn;\n\t\t\tcase \"framework-error\":\n\t\t\t\tdispatchFrameworkError(output);\n\t\t\t\treturn;\n\t\t\tdefault: {\n\t\t\t\tconst exhaustive: never = output;\n\t\t\t\tvoid exhaustive;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction setHost(next: EventTarget): void {\n\t\thost = next;\n\t}\n\n\treturn { dispatch, setHost };\n}\n"]}
@@ -34,4 +34,3 @@ export interface FrameworkErrorBridgeHandle {
34
34
  dispatch(output: SectionEngineOutput): void;
35
35
  }
36
36
  export declare function createFrameworkErrorBridge(options: FrameworkErrorBridgeOptions): FrameworkErrorBridgeHandle;
37
- //# sourceMappingURL=framework-error-bridge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"framework-error-bridge.js","sourceRoot":"","sources":["../../../src/runtime/adapter/framework-error-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAaH,MAAM,UAAU,0BAA0B,CACzC,OAAoC;IAEpC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAExB,SAAS,QAAQ,CAAC,MAA2B;QAC5C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,iBAAiB;gBACrB,GAAG,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvC,OAAO;YACR,KAAK,cAAc,CAAC;YACpB,KAAK,kBAAkB;gBACtB,OAAO;YACR,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,UAAU,GAAU,MAAM,CAAC;gBACjC,KAAK,UAAU,CAAC;gBAChB,OAAO;YACR,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"framework-error-bridge.js","sourceRoot":"","sources":["../../../src/runtime/adapter/framework-error-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAaH,MAAM,UAAU,0BAA0B,CACzC,OAAoC;IAEpC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAExB,SAAS,QAAQ,CAAC,MAA2B;QAC5C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,iBAAiB;gBACrB,GAAG,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvC,OAAO;YACR,KAAK,cAAc,CAAC;YACpB,KAAK,kBAAkB;gBACtB,OAAO;YACR,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,UAAU,GAAU,MAAM,CAAC;gBACjC,KAAK,UAAU,CAAC;gBAChB,OAAO;YACR,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACrB,CAAC","sourcesContent":["/**\n * Framework-error bridge for the section runtime engine adapter (M7 —\n * Variant C, layered).\n *\n * Routes `framework-error` engine outputs into a `FrameworkErrorBus`\n * (write side: `FrameworkErrorReporter`). The bus is the single\n * fan-out point shared with the toolkit CE's banner, the coordinator's\n * canonical `onFrameworkError` lifecycle hook, and any direct host\n * subscribers via `subscribeFrameworkErrors`. See\n * `packages/assessment-toolkit/src/services/framework-error-bus.ts`\n * for the full bus contract.\n *\n * **Why a separate bridge.** The dom-event-bridge dispatches the\n * `framework-error` DOM event on the host. The framework-error-bridge\n * routes the same model into the in-process bus so listeners that\n * subscribe via `coordinator.subscribeFrameworkErrors(...)` see the\n * same fan-out with byte-identical payloads. Splitting the\n * responsibilities lets a host opt out of either side (DOM-only or\n * bus-only) without re-implementing the other.\n *\n * **Bus ownership.** The bridge does not construct the bus; the\n * adapter receives one externally so the toolkit CE can keep sharing\n * its bus with the coordinator (matching today's\n * `PieAssessmentToolkit.svelte` lifetime model). This avoids the\n * \"second bus\" pitfall — a dual-bus topology would silently fragment\n * fan-out.\n */\n\nimport type { FrameworkErrorReporter } from \"../../services/framework-error-bus.js\";\nimport type { SectionEngineOutput } from \"../core/engine-output.js\";\n\nexport interface FrameworkErrorBridgeOptions {\n\tbus: FrameworkErrorReporter;\n}\n\nexport interface FrameworkErrorBridgeHandle {\n\tdispatch(output: SectionEngineOutput): void;\n}\n\nexport function createFrameworkErrorBridge(\n\toptions: FrameworkErrorBridgeOptions,\n): FrameworkErrorBridgeHandle {\n\tconst { bus } = options;\n\n\tfunction dispatch(output: SectionEngineOutput): void {\n\t\tswitch (output.kind) {\n\t\t\tcase \"framework-error\":\n\t\t\t\tbus.reportFrameworkError(output.error);\n\t\t\t\treturn;\n\t\t\tcase \"stage-change\":\n\t\t\tcase \"loading-complete\":\n\t\t\t\treturn;\n\t\t\tdefault: {\n\t\t\t\tconst exhaustive: never = output;\n\t\t\t\tvoid exhaustive;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { dispatch };\n}\n"]}
@@ -29,4 +29,3 @@ export interface InstrumentationBridgeHandle {
29
29
  setHook(hook: InstrumentationHook | undefined): void;
30
30
  }
31
31
  export declare function createInstrumentationBridge(options?: InstrumentationBridgeOptions): InstrumentationBridgeHandle;
32
- //# sourceMappingURL=instrumentation-bridge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation-bridge.js","sourceRoot":"","sources":["../../../src/runtime/adapter/instrumentation-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAeH,MAAM,UAAU,2BAA2B,CAC1C,UAAwC,EAAE;IAE1C,IAAI,IAAI,GAAoC,OAAO,CAAC,IAAI,CAAC;IAEzD,SAAS,QAAQ,CAAC,MAA2B;QAC5C,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,IAAI,CAAC;YACJ,IAAI,CAAC,MAAM,CAAC,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;IACF,CAAC;IAED,SAAS,OAAO,CAAC,IAAqC;QACrD,IAAI,GAAG,IAAI,CAAC;IACb,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
1
+ {"version":3,"file":"instrumentation-bridge.js","sourceRoot":"","sources":["../../../src/runtime/adapter/instrumentation-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAeH,MAAM,UAAU,2BAA2B,CAC1C,UAAwC,EAAE;IAE1C,IAAI,IAAI,GAAoC,OAAO,CAAC,IAAI,CAAC;IAEzD,SAAS,QAAQ,CAAC,MAA2B;QAC5C,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,IAAI,CAAC;YACJ,IAAI,CAAC,MAAM,CAAC,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;IACF,CAAC;IAED,SAAS,OAAO,CAAC,IAAqC;QACrD,IAAI,GAAG,IAAI,CAAC;IACb,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * Instrumentation bridge for the section runtime engine adapter (M7 —\n * Variant C, layered).\n *\n * Forwards every `SectionEngineOutput` to an optional observability\n * hook the host injects (telemetry, debug logger, e2e probe). The\n * bridge is intentionally thin: it does not buffer, transform, or\n * filter. Hosts that need a different shape can run their own subscriber\n * via the adapter's public `subscribe(...)` channel.\n *\n * **Why a dedicated bridge instead of a generic subscriber.** The\n * subscriber-fanout channel is host-shaped — listeners receive batched\n * arrays of outputs per `core.dispatch` call so they can reason about\n * \"what happened in this transition.\" The instrumentation hook is\n * per-output: telemetry pipelines want one record per stage change,\n * one record per readiness flip, etc. Splitting the channels keeps\n * both shapes ergonomic.\n *\n * The bridge **must not** import `svelte` per the M7 layering\n * constraint.\n */\n\nimport type { SectionEngineOutput } from \"../core/engine-output.js\";\n\nexport type InstrumentationHook = (output: SectionEngineOutput) => void;\n\nexport interface InstrumentationBridgeOptions {\n\thook?: InstrumentationHook;\n}\n\nexport interface InstrumentationBridgeHandle {\n\tdispatch(output: SectionEngineOutput): void;\n\tsetHook(hook: InstrumentationHook | undefined): void;\n}\n\nexport function createInstrumentationBridge(\n\toptions: InstrumentationBridgeOptions = {},\n): InstrumentationBridgeHandle {\n\tlet hook: InstrumentationHook | undefined = options.hook;\n\n\tfunction dispatch(output: SectionEngineOutput): void {\n\t\tif (!hook) return;\n\t\ttry {\n\t\t\thook(output);\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"[InstrumentationBridge] hook failed:\", error);\n\t\t}\n\t}\n\n\tfunction setHook(next: InstrumentationHook | undefined): void {\n\t\thook = next;\n\t}\n\n\treturn { dispatch, setHook };\n}\n"]}
@@ -32,4 +32,3 @@ export interface SubscriberFanoutHandle {
32
32
  getListenerCount(): number;
33
33
  }
34
34
  export declare function createSubscriberFanout(): SubscriberFanoutHandle;
35
- //# sourceMappingURL=subscriber-fanout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber-fanout.js","sourceRoot":"","sources":["../../../src/runtime/adapter/subscriber-fanout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAeH,MAAM,UAAU,sBAAsB;IACrC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;IAElD,SAAS,IAAI,CAAC,OAAuC;QACpD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QACjC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,CA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K,EAAE,CAAC,CAAC;QAC9C,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC;gBACJ,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;IACF,CAAC;IAED,SAAS,SAAS,CAAC,QAA8B;QAChD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxB,IAAI,QAAQ,GAAG,IAAI,CAAC;QACpB,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,QAAQ;gBAAE,OAAO;YACtB,QAAQ,GAAG,KAAK,CAAC;YACjB,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC,CAAC;IACH,CAAC;IAED,SAAS,OAAO;QACf,SAAS,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,SAAS,gBAAgB;QACxB,OAAO,SAAS,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AACvD,CAAC","sourcesContent":["/**\n * Subscriber fan-out for the section runtime engine adapter (M7 — Variant\n * C, layered).\n *\n * The adapter exposes a single `subscribe(listener)` channel for hosts\n * that want a synchronous stream of `SectionEngineOutput[]` batches —\n * one batch per `core.dispatch(input)` call.\n *\n * **Why not reuse `SectionEngineCore.subscribe` directly.** The core\n * channel is the engine's internal contract. The fan-out is the\n * adapter's public channel: it is the single seam every facade method\n * goes through, and the only seam that ever sees host-side errors. The\n * separation lets us swap the core implementation (or skip it for\n * tests) without changing the public subscriber shape.\n *\n * **Subscriber contract.** Mirrors `SectionEngineCore.subscribe`:\n * - Listeners are invoked synchronously, in registration order.\n * - A listener that throws is caught and `console.warn`-logged. Fan-out\n * is not interrupted — same isolation guarantee as\n * `FrameworkErrorBus`.\n * - The disposer returned from `subscribe` is idempotent.\n * - Listeners receive a frozen, defensively-copied output array.\n * - There is no replay; subscribe at adapter construction time if you\n * need every output from `idle` onward.\n */\n\nimport type { SectionEngineOutput } from \"../core/engine-output.js\";\n\nexport type EngineOutputListener = (\n\toutputs: readonly SectionEngineOutput[],\n) => void;\n\nexport interface SubscriberFanoutHandle {\n\temit(outputs: readonly SectionEngineOutput[]): void;\n\tsubscribe(listener: EngineOutputListener): () => void;\n\tdispose(): void;\n\tgetListenerCount(): number;\n}\n\nexport function createSubscriberFanout(): SubscriberFanoutHandle {\n\tconst listeners = new Set<EngineOutputListener>();\n\n\tfunction emit(outputs: readonly SectionEngineOutput[]): void {\n\t\tif (outputs.length === 0) return;\n\t\tconst snapshot = Array.from(listeners);\n\t\tconst frozen = Object.freeze(outputs.slice());\n\t\tfor (const listener of snapshot) {\n\t\t\ttry {\n\t\t\t\tlistener(frozen);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn(\"[SubscriberFanout] listener failed:\", error);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction subscribe(listener: EngineOutputListener): () => void {\n\t\tlisteners.add(listener);\n\t\tlet attached = true;\n\t\treturn () => {\n\t\t\tif (!attached) return;\n\t\t\tattached = false;\n\t\t\tlisteners.delete(listener);\n\t\t};\n\t}\n\n\tfunction dispose(): void {\n\t\tlisteners.clear();\n\t}\n\n\tfunction getListenerCount(): number {\n\t\treturn listeners.size;\n\t}\n\n\treturn { emit, subscribe, dispose, getListenerCount };\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import type { AccessibilityCatalog } from "@pie-players/pie-players-shared/types";
2
+ import type { CatalogOwnerContext } from "../services/AccessibilityCatalogResolver.js";
3
+ import type { RuntimeRegistrationDetail } from "./registration-events.js";
4
+ export interface CatalogRegistrationRuntimeContext {
5
+ assessmentId?: string;
6
+ sectionId?: string;
7
+ }
8
+ export interface CatalogRegistration {
9
+ context: CatalogOwnerContext;
10
+ catalogs: AccessibilityCatalog[];
11
+ }
12
+ export declare function collectCatalogRegistrations(detail: RuntimeRegistrationDetail, runtime?: CatalogRegistrationRuntimeContext): CatalogRegistration[];
@@ -0,0 +1,54 @@
1
+ const hasCatalogs = (catalogs) => Array.isArray(catalogs) && catalogs.length > 0;
2
+ export function collectCatalogRegistrations(detail, runtime = {}) {
3
+ const entity = detail.item;
4
+ if (!entity)
5
+ return [];
6
+ const registrations = [];
7
+ if (detail.kind === "passage") {
8
+ const context = {
9
+ ownerKind: "passage",
10
+ assessmentId: runtime.assessmentId,
11
+ sectionId: runtime.sectionId,
12
+ passageId: detail.canonicalItemId || detail.itemId,
13
+ };
14
+ if (hasCatalogs(entity.accessibilityCatalogs)) {
15
+ registrations.push({ context, catalogs: entity.accessibilityCatalogs });
16
+ }
17
+ if (hasCatalogs(entity.config?.extractedCatalogs)) {
18
+ registrations.push({
19
+ context,
20
+ catalogs: entity.config.extractedCatalogs,
21
+ });
22
+ }
23
+ return registrations;
24
+ }
25
+ const itemContext = {
26
+ ownerKind: "itemModel",
27
+ assessmentId: runtime.assessmentId,
28
+ sectionId: runtime.sectionId,
29
+ itemId: detail.itemId,
30
+ canonicalItemId: detail.canonicalItemId || detail.itemId,
31
+ };
32
+ if (hasCatalogs(entity.accessibilityCatalogs)) {
33
+ registrations.push({
34
+ context: itemContext,
35
+ catalogs: entity.accessibilityCatalogs,
36
+ });
37
+ }
38
+ if (hasCatalogs(entity.config?.extractedCatalogs)) {
39
+ registrations.push({
40
+ context: itemContext,
41
+ catalogs: entity.config.extractedCatalogs,
42
+ });
43
+ }
44
+ for (const model of entity.config?.models ?? []) {
45
+ if (!hasCatalogs(model.accessibilityCatalogs))
46
+ continue;
47
+ registrations.push({
48
+ context: { ...itemContext, modelId: model.id },
49
+ catalogs: model.accessibilityCatalogs,
50
+ });
51
+ }
52
+ return registrations;
53
+ }
54
+ //# sourceMappingURL=catalog-registration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-registration.js","source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e,IAAI,MAAM,CAAC,MAAM;KACxD,CAAC;IACF,IAAI,WAAW,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;QAC/C,aAAa,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,MAAM,CAAC,qBAAqB;SACtC,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,CAAC;QACnD,aAAa,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB;SACzC,CAAC,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,qBAAqB,CAAC;YAAE,SAAS;QACxD,aAAa,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,EAAE,GAAG,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9C,QAAQ,EAAE,KAAK,CAAC,qBAAqB;SACrC,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,aAAa,CAAC;AACtB,CAAC","sourcesContent":["import type { AccessibilityCatalog } from \"@pie-players/pie-players-shared/types\";\nimport type { CatalogOwnerContext } from \"../services/AccessibilityCatalogResolver.js\";\nimport type { RuntimeRegistrationDetail } from \"./registration-events.js\";\n\nexport interface CatalogRegistrationRuntimeContext {\n\tassessmentId?: string;\n\tsectionId?: string;\n}\n\nexport interface CatalogRegistration {\n\tcontext: CatalogOwnerContext;\n\tcatalogs: AccessibilityCatalog[];\n}\n\ntype CatalogSource = {\n\taccessibilityCatalogs?: AccessibilityCatalog[];\n\tconfig?: {\n\t\textractedCatalogs?: AccessibilityCatalog[];\n\t\tmodels?: Array<{\n\t\t\tid?: string;\n\t\t\taccessibilityCatalogs?: AccessibilityCatalog[];\n\t\t}>;\n\t};\n};\n\nconst hasCatalogs = (\n\tcatalogs: AccessibilityCatalog[] | undefined,\n): catalogs is AccessibilityCatalog[] =>\n\tArray.isArray(catalogs) && catalogs.length > 0;\n\nexport function collectCatalogRegistrations(\n\tdetail: RuntimeRegistrationDetail,\n\truntime: CatalogRegistrationRuntimeContext = {},\n): CatalogRegistration[] {\n\tconst entity = detail.item as CatalogSource | null | undefined;\n\tif (!entity) return [];\n\tconst registrations: CatalogRegistration[] = [];\n\tif (detail.kind === \"passage\") {\n\t\tconst context: CatalogOwnerContext = {\n\t\t\townerKind: \"passage\",\n\t\t\tassessmentId: runtime.assessmentId,\n\t\t\tsectionId: runtime.sectionId,\n\t\t\tpassageId: detail.canonicalItemId || detail.itemId,\n\t\t};\n\t\tif (hasCatalogs(entity.accessibilityCatalogs)) {\n\t\t\tregistrations.push({ context, catalogs: entity.accessibilityCatalogs });\n\t\t}\n\t\tif (hasCatalogs(entity.config?.extractedCatalogs)) {\n\t\t\tregistrations.push({\n\t\t\t\tcontext,\n\t\t\t\tcatalogs: entity.config.extractedCatalogs,\n\t\t\t});\n\t\t}\n\t\treturn registrations;\n\t}\n\n\tconst itemContext: CatalogOwnerContext = {\n\t\townerKind: \"itemModel\",\n\t\tassessmentId: runtime.assessmentId,\n\t\tsectionId: runtime.sectionId,\n\t\titemId: detail.itemId,\n\t\tcanonicalItemId: detail.canonicalItemId || detail.itemId,\n\t};\n\tif (hasCatalogs(entity.accessibilityCatalogs)) {\n\t\tregistrations.push({\n\t\t\tcontext: itemContext,\n\t\t\tcatalogs: entity.accessibilityCatalogs,\n\t\t});\n\t}\n\tif (hasCatalogs(entity.config?.extractedCatalogs)) {\n\t\tregistrations.push({\n\t\t\tcontext: itemContext,\n\t\t\tcatalogs: entity.config.extractedCatalogs,\n\t\t});\n\t}\n\tfor (const model of entity.config?.models ?? []) {\n\t\tif (!hasCatalogs(model.accessibilityCatalogs)) continue;\n\t\tregistrations.push({\n\t\t\tcontext: { ...itemContext, modelId: model.id },\n\t\t\tcatalogs: model.accessibilityCatalogs,\n\t\t});\n\t}\n\treturn registrations;\n}\n"]}
@@ -49,4 +49,3 @@ export declare class SectionEngineCore {
49
49
  disposeListeners(): void;
50
50
  private fanOut;
51
51
  }
52
- //# sourceMappingURL=SectionEngineCore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionEngineCore.js","sourceRoot":"","sources":["../../../src/runtime/core/SectionEngineCore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,EACN,wBAAwB,GAExB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMpD,MAAM,OAAO,iBAAiB;IACrB,KAAK,GAAuB,wBAAwB,EAAE,CAAC;IAC9C,SAAS,GAAG,IAAI,GAAG,EAA6B,CAAC;IAElE,6EAA6E;IAC7E,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,KAAyB;QACjC,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,QAAmC;QAC5C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,QAAQ,GAAG,IAAI,CAAC;QACpB,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,QAAQ;gBAAE,OAAO;YACtB,QAAQ,GAAG,KAAK,CAA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I,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,QAAmC;QAC5C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,QAAQ,GAAG,IAAI,CAAC;QACpB,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,QAAQ;gBAAE,OAAO;YACtB,QAAQ,GAAG,KAAK,CAAC;YACjB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC,CAAC;IACH,CAAC;IAED,wCAAwC;IACxC,gBAAgB;QACf,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAEO,MAAM,CAAC,OAA8B;QAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC9C,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC;gBACJ,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;YAC7D,CAAC;QACF,CAAC;IACF,CAAC;CACD","sourcesContent":["/**\n * Section runtime engine — pure core (M7 — Variant C, layered).\n *\n * `SectionEngineCore` is a thin object oriented wrapper over the pure\n * `transition()` function. It owns the current `SectionEngineState`,\n * applies inputs serially, and fans out the resulting\n * `SectionEngineOutput[]` to subscribers. There is no DOM, Svelte,\n * coordinator, or timing dependency in this module — all I/O lives in\n * the adapter layer (PR 2).\n *\n * Lifetime model:\n * - One instance per cohort logical lifetime. Cohort changes happen\n * through `dispatch({ kind: \"cohort-change\" })`, not through\n * re-construction.\n * - After a `dispose` input, additional inputs are no-ops (the\n * transition handles this), but subscribers stay attached so the\n * adapter can still deliver final cleanup outputs.\n *\n * Subscriber contract:\n * - Listeners are invoked synchronously, in registration order.\n * - A throwing listener is caught and `console.warn`-logged. Fan-out\n * is not interrupted — same isolation guarantee as\n * `FrameworkErrorBus`.\n * - The disposer returned from `subscribe` is idempotent.\n * - Listeners receive only the output array. State snapshots are\n * read via `getState()` for callers that need them.\n */\n\nimport type { SectionEngineInput } from \"./engine-input.js\";\nimport type { SectionEngineOutput } from \"./engine-output.js\";\nimport {\n\tcreateInitialEngineState,\n\ttype SectionEngineState,\n} from \"./engine-state.js\";\nimport { transition } from \"./engine-transition.js\";\n\nexport type SectionEngineCoreListener = (\n\toutputs: readonly SectionEngineOutput[],\n) => void;\n\nexport class SectionEngineCore {\n\tprivate state: SectionEngineState = createInitialEngineState();\n\tprivate readonly listeners = new Set<SectionEngineCoreListener>();\n\n\t/** Read-only state snapshot. Callers must not mutate the returned object. */\n\tgetState(): Readonly<SectionEngineState> {\n\t\treturn this.state;\n\t}\n\n\t/**\n\t * Apply one input. Returns the outputs that resulted from the\n\t * transition; subscribers also receive them.\n\t */\n\tdispatch(input: SectionEngineInput): readonly SectionEngineOutput[] {\n\t\tconst result = transition(this.state, input);\n\t\tthis.state = result.state;\n\t\tif (result.outputs.length > 0) {\n\t\t\tthis.fanOut(result.outputs);\n\t\t}\n\t\treturn result.outputs;\n\t}\n\n\t/**\n\t * Subscribe to engine outputs. Returns an idempotent disposer.\n\t * Listeners do not receive a replay of past outputs; subscribe at\n\t * construction time if you need every output from `idle` onward.\n\t */\n\tsubscribe(listener: SectionEngineCoreListener): () => void {\n\t\tthis.listeners.add(listener);\n\t\tlet attached = true;\n\t\treturn () => {\n\t\t\tif (!attached) return;\n\t\t\tattached = false;\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\n\t/** Test-only: detach every listener. */\n\tdisposeListeners(): void {\n\t\tthis.listeners.clear();\n\t}\n\n\tprivate fanOut(outputs: SectionEngineOutput[]): void {\n\t\tconst snapshot = Array.from(this.listeners);\n\t\tconst frozen = Object.freeze(outputs.slice());\n\t\tfor (const listener of snapshot) {\n\t\t\ttry {\n\t\t\t\tlistener(frozen);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn(\"[SectionEngineCore] listener failed:\", error);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -37,4 +37,3 @@ export declare function makeCohort(args: {
37
37
  sectionId: string | null | undefined;
38
38
  attemptId: string | null | undefined;
39
39
  }): CohortKey | null;
40
- //# sourceMappingURL=cohort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cohort.js","sourceRoot":"","sources":["../../../src/runtime/core/cohort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAwB;IACjD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,CAAmB,EAAE,CAAmB;IACpE,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAG1B;IACA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO;QACN,SAAS;QACT,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE;KAC/B,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"cohort.js","sourceRoot":"","sources":["../../../src/runtime/core/cohort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAwB;IACjD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,CAAmB,EAAE,CAAmB;IACpE,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAG1B;IACA,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO;QACN,SAAS;QACT,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE;KAC/B,CAAC;AACH,CAAC","sourcesContent":["/**\n * Cohort identity for the section runtime engine (M7).\n *\n * One cohort is the tuple `(sectionId, attemptId)` for the section the\n * host is currently rendering. Stage progression, readiness latches, and\n * `pie-loading-complete` emission are all gated on this tuple — when it\n * changes, the engine emits `disposed` for the outgoing cohort and\n * resets to `composed` for the new one.\n *\n * `attemptId` is optional in the public surface (per the toolkit /\n * layout-CE prop shape) but the engine carries it as the empty string\n * when absent so the cohort key is total.\n */\n\nexport interface CohortKey {\n\t/** Section identifier; required for any non-idle cohort. */\n\tsectionId: string;\n\t/** Attempt identifier; empty string if the host did not provide one. */\n\tattemptId: string;\n}\n\n/**\n * Stable string form of the cohort tuple used as a key for the\n * `loadingCompleteEmittedForCohort` latch and equality checks.\n */\nexport function cohortKey(cohort: CohortKey | null): string {\n\tif (!cohort) return \"\";\n\treturn `${cohort.sectionId}|${cohort.attemptId}`;\n}\n\n/**\n * `true` iff the two cohorts have the same `(sectionId, attemptId)` pair.\n * Treats both inputs as identifying the cohort by value, never by\n * reference.\n */\nexport function cohortsEqual(a: CohortKey | null, b: CohortKey | null): boolean {\n\tif (a === b) return true;\n\tif (!a || !b) return false;\n\treturn a.sectionId === b.sectionId && a.attemptId === b.attemptId;\n}\n\n/**\n * Normalize host-provided `(sectionId, attemptId)` into a cohort. Returns\n * `null` when the section identifier is empty — that is the engine's\n * idle state (no cohort).\n */\nexport function makeCohort(args: {\n\tsectionId: string | null | undefined;\n\tattemptId: string | null | undefined;\n}): CohortKey | null {\n\tconst sectionId = args.sectionId ?? \"\";\n\tif (!sectionId) return null;\n\treturn {\n\t\tsectionId,\n\t\tattemptId: args.attemptId ?? \"\",\n\t};\n}\n"]}
@@ -111,4 +111,3 @@ export type SectionEngineInput = EngineInputInitialize | EngineInputUpdateRuntim
111
111
  * from a single place when it constructs `initialize` inputs.
112
112
  */
113
113
  export type { RuntimeInputs };
114
- //# sourceMappingURL=engine-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"engine-input.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
1
+ {"version":3,"file":"engine-input.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG","sourcesContent":["/**\n * Section runtime engine inputs (M7 — Variant C, layered core).\n *\n * Inputs are the discriminated union of events the adapter (PR 2) feeds\n * into the pure transition function (`engine-transition.ts`). The shape\n * is closed: every field is plain data so the transition can be tested\n * without any DOM, Svelte, or coordinator wiring.\n *\n * Adapter→core boundary contract:\n * - The adapter never mutates engine state directly. It always\n * constructs an input and calls `core.dispatch(input)`.\n * - Inputs are total: an unhandled `kind` is a programming error\n * (the transition uses `assertNever` exhaustiveness).\n * - Inputs carry only data, never live host references that would\n * pin lifetime. Coordinator and controller handles live in the\n * adapter; the core only sees readiness signals derived from them.\n */\n\nimport type { CohortKey } from \"./cohort.js\";\nimport type {\n\tEffectiveRuntime,\n\tRuntimeInputs,\n} from \"./engine-resolver.js\";\nimport type { EngineReadinessSignals } from \"./engine-readiness.js\";\nimport type { FrameworkErrorModel } from \"../../services/framework-error.js\";\n\n/**\n * `initialize` is the first transition out of `idle`. It carries the\n * cohort key and the resolved runtime/tools snapshot for the cohort.\n * The adapter constructs this input after running the resolver against\n * the host's two-tier inputs.\n */\nexport type EngineInputInitialize = {\n\tkind: \"initialize\";\n\tcohort: CohortKey;\n\teffectiveRuntime: EffectiveRuntime;\n\teffectiveToolsConfig: unknown;\n\titemCount: number;\n};\n\n/**\n * `update-runtime` is sent when the host two-tier inputs change but\n * the cohort does not. The transition stores the latest resolver\n * output without changing phase; readiness gates and stage progression\n * stay where they are.\n */\nexport type EngineInputUpdateRuntime = {\n\tkind: \"update-runtime\";\n\teffectiveRuntime: EffectiveRuntime;\n\teffectiveToolsConfig: unknown;\n};\n\n/**\n * `cohort-change` is sent when `(sectionId, attemptId)` changes. The\n * transition emits `disposed` for the outgoing cohort, resets state\n * to `booting-section` for the new one, and re-arms latches.\n */\nexport type EngineInputCohortChange = {\n\tkind: \"cohort-change\";\n\tcohort: CohortKey;\n\teffectiveRuntime: EffectiveRuntime;\n\teffectiveToolsConfig: unknown;\n\titemCount: number;\n};\n\n/**\n * `section-controller-resolved` is sent when the coordinator returns\n * the controller for the current cohort. Advances the phase from\n * `booting-section` → `engine-ready` (assuming `composed` is already\n * implied by `phase >= booting-section`, which the FSM treats as\n * monotonic).\n */\nexport type EngineInputSectionControllerResolved = {\n\tkind: \"section-controller-resolved\";\n};\n\n/**\n * `update-readiness-signals` carries the latest readiness snapshot\n * from the host. The transition uses it to gate the move into\n * `interactive` and to decide whether to emit `loading-complete`.\n *\n * The full signal set is sent every time so the transition does not\n * have to reason about partial overlays.\n */\nexport type EngineInputUpdateReadinessSignals = {\n\tkind: \"update-readiness-signals\";\n\tsignals: EngineReadinessSignals;\n\tloadedCount: number;\n\titemCount: number;\n\t/**\n\t * Strict-mode gate. When `\"strict\"`, `interactive` only fires\n\t * after `allLoadingComplete`; in `\"progressive\"`, `interactionReady`\n\t * is sufficient. Carried per-input so the host can reconfigure\n\t * mode mid-cohort without re-initializing.\n\t */\n\tmode: \"progressive\" | \"strict\";\n};\n\n/**\n * `framework-error` is sent for every framework-error report (M3\n * canonical channel). The transition records the latest error in\n * state and emits a `framework-error` output so the adapter can fan\n * out to subscribers and the DOM event.\n */\nexport type EngineInputFrameworkError = {\n\tkind: \"framework-error\";\n\terror: FrameworkErrorModel;\n};\n\n/**\n * `dispose` tears the engine down. Emits `disposed` for the current\n * cohort (if any) and moves to the terminal `disposed` phase. After\n * dispose the engine accepts no further inputs (the transition logs\n * a warning and is a no-op).\n */\nexport type EngineInputDispose = {\n\tkind: \"dispose\";\n};\n\nexport type SectionEngineInput =\n\t| EngineInputInitialize\n\t| EngineInputUpdateRuntime\n\t| EngineInputCohortChange\n\t| EngineInputSectionControllerResolved\n\t| EngineInputUpdateReadinessSignals\n\t| EngineInputFrameworkError\n\t| EngineInputDispose;\n\n/**\n * Convenience re-export so the adapter can import `RuntimeInputs`\n * from a single place when it constructs `initialize` inputs.\n */\nexport type { RuntimeInputs };\n"]}
@@ -15,10 +15,10 @@
15
15
  * item has finished loading. This mirrors today's
16
16
  * `pie-loading-complete` DOM event semantics.
17
17
  *
18
- * The deprecated readiness output kinds (`readiness-change`,
18
+ * Readiness alias output kinds (`readiness-change`,
19
19
  * `interaction-ready`, `ready`) were removed in the broad
20
20
  * architecture review compat sweep along with their DOM-event bridge
21
- * (`legacy-event-bridge.ts`). Stage and readiness changes now flow
21
+ * event bridge. Stage and readiness changes now flow
22
22
  * through `stage-change` (with `EngineReadinessDetail` available via
23
23
  * `SectionEngineCore.getState()` / kernel `selectReadiness()`); the
24
24
  * "all items loaded" signal flows through `loading-complete` only.
@@ -59,4 +59,3 @@ export type EngineOutputFrameworkError = {
59
59
  error: FrameworkErrorModel;
60
60
  };
61
61
  export type SectionEngineOutput = EngineOutputStageChange | EngineOutputLoadingComplete | EngineOutputFrameworkError;
62
- //# sourceMappingURL=engine-output.d.ts.map
@@ -15,10 +15,10 @@
15
15
  * item has finished loading. This mirrors today's
16
16
  * `pie-loading-complete` DOM event semantics.
17
17
  *
18
- * The deprecated readiness output kinds (`readiness-change`,
18
+ * Readiness alias output kinds (`readiness-change`,
19
19
  * `interaction-ready`, `ready`) were removed in the broad
20
20
  * architecture review compat sweep along with their DOM-event bridge
21
- * (`legacy-event-bridge.ts`). Stage and readiness changes now flow
21
+ * event bridge. Stage and readiness changes now flow
22
22
  * through `stage-change` (with `EngineReadinessDetail` available via
23
23
  * `SectionEngineCore.getState()` / kernel `selectReadiness()`); the
24
24
  * "all items loaded" signal flows through `loading-complete` only.
@@ -1 +1 @@
1
- {"version":3,"file":"engine-output.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG"}
1
+ {"version":3,"file":"engine-output.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG","sourcesContent":["/**\n * Section runtime engine outputs (M7 — Variant C, layered core).\n *\n * Outputs are the closed discriminated union of effects the transition\n * function returns. The adapter (PR 2) takes the output array, walks\n * it in order, and dispatches each one to the right bridge (DOM\n * events, framework-error bus, subscriber fan-out).\n *\n * Outputs carry only plain data so the transition table can be tested\n * exhaustively without any DOM or coordinator wiring.\n *\n * Adjustment A2 from the M7 implementation plan: `loading-complete`\n * is an output, **not** an FSM phase. The transition emits it from\n * the `interactive` phase when the readiness signals indicate every\n * item has finished loading. This mirrors today's\n * `pie-loading-complete` DOM event semantics.\n *\n * Readiness alias output kinds (`readiness-change`,\n * `interaction-ready`, `ready`) were removed in the broad\n * architecture review compat sweep along with their DOM-event bridge\n * event bridge. Stage and readiness changes now flow\n * through `stage-change` (with `EngineReadinessDetail` available via\n * `SectionEngineCore.getState()` / kernel `selectReadiness()`); the\n * \"all items loaded\" signal flows through `loading-complete` only.\n */\n\nimport type { Stage, StageStatus } from \"@pie-players/pie-players-shared/pie\";\nimport type { CohortKey } from \"./cohort.js\";\nimport type { FrameworkErrorModel } from \"../../services/framework-error.js\";\n\n/**\n * Stage transition. The adapter dispatches a `pie-stage-change` DOM\n * event with the canonical detail and forwards to subscribers /\n * coordinator. The status indicates whether the stage was entered,\n * skipped, or recorded as failed.\n */\nexport type EngineOutputStageChange = {\n\tkind: \"stage-change\";\n\tstage: Stage;\n\tstatus: StageStatus;\n\tcohort: CohortKey | null;\n};\n\n/**\n * Canonical `pie-loading-complete` emit (M6 D1). One-shot per cohort.\n * Fires from the `interactive` phase when loaded == items count and\n * the readiness signals satisfy `allLoadingComplete`.\n */\nexport type EngineOutputLoadingComplete = {\n\tkind: \"loading-complete\";\n\tcohort: CohortKey;\n\titemCount: number;\n\tloadedCount: number;\n};\n\n/**\n * Framework error fan-out. Mirrors the M3 `framework-error` DOM event\n * and the `subscribeFrameworkErrors` listener channel. Emitted on\n * every `framework-error` input.\n */\nexport type EngineOutputFrameworkError = {\n\tkind: \"framework-error\";\n\terror: FrameworkErrorModel;\n};\n\nexport type SectionEngineOutput =\n\t| EngineOutputStageChange\n\t| EngineOutputLoadingComplete\n\t| EngineOutputFrameworkError;\n"]}
@@ -22,10 +22,10 @@
22
22
  * signals. Surfaced via the kernel's `selectReadiness()` /
23
23
  * `getSnapshot().readiness` selectors; M6 stages own the stage-level
24
24
  * transitions on `pie-stage-change` and use this phase as a
25
- * convenience label only. The deprecated `readiness-change` DOM
25
+ * convenience label only. The `readiness-change` DOM
26
26
  * event that used to surface this directly was removed in the broad
27
27
  * architecture review compat sweep alongside its
28
- * `legacy-event-bridge`.
28
+ * event bridge.
29
29
  */
30
30
  export type EngineReadinessPhase = "bootstrapping" | "interaction-ready" | "loading" | "ready" | "error";
31
31
  export type EngineReadinessSignals = {
@@ -46,4 +46,3 @@ export declare function createReadinessDetail(args: {
46
46
  signals: EngineReadinessSignals;
47
47
  reason?: string;
48
48
  }): EngineReadinessDetail;
49
- //# sourceMappingURL=engine-readiness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"engine-readiness.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAiCH,MAAM,UAAU,qBAAqB,CACpC,OAA+B;IAE/B,IAAI,OAAO,CAAC,YAAY;QAAE,OAAO,OAAO,CAAC;IACzC,IAAI,OAAO,CAAC,kBAAkB;QAAE,OAAO,OAAO,CAAC;IAC/C,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,mBAAmB,CAAC;IACzD,IAAI,OAAO,CAAC,YAAY;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,eAAe,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAIrC;IACA,8EAA8E;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAChF,MAAM,gBAAgB,GACrB,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACrE,MAAM,KAAK,GAAG,qBAAqB,CAAC;QACnC,GAAG,IAAI,CAAC,OAAO;QACf,kBAAkB,EAAE,UAAU;QAC9B,gBAAgB;KAChB,CAAC,CAAC;IAEH,OAAO;QACN,KAAK;QACL,gBAAgB;QAChB,kBAAkB,EAAE,UAAU;QAC9B,MAAM,EAAE,IAAI,CAAC,MAAM;KACnB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"engine-readiness.js","sourceRoot":"","sources":["../../../src/runtime/core/engine-readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAiCH,MAAM,UAAU,qBAAqB,CACpC,OAA+B;IAE/B,IAAI,OAAO,CAAC,YAAY;QAAE,OAAO,OAAO,CAAC;IACzC,IAAI,OAAO,CAAC,kBAAkB;QAAE,OAAO,OAAO,CAAC;IAC/C,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,mBAAmB,CAAC;IACzD,IAAI,OAAO,CAAC,YAAY;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,eAAe,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAIrC;IACA,8EAA8E;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAChF,MAAM,gBAAgB,GACrB,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACrE,MAAM,KAAK,GAAG,qBAAqB,CAAC;QACnC,GAAG,IAAI,CAAC,OAAO;QACf,kBAAkB,EAAE,UAAU;QAC9B,gBAAgB;KAChB,CAAC,CAAC;IAEH,OAAO;QACN,KAAK;QACL,gBAAgB;QAChB,kBAAkB,EAAE,UAAU;QAC9B,MAAM,EAAE,IAAI,CAAC,MAAM;KACnB,CAAC;AACH,CAAC","sourcesContent":["/**\n * Readiness derivation for the section runtime engine (M7).\n *\n * Canonical home of `createReadinessDetail` and `resolveReadinessPhase`.\n * As of M7 PR 7 the previous duplicates in\n * `packages/section-player/src/components/shared/section-player-readiness.ts`\n * have been deleted; section-player now consumes these helpers via\n * `@pie-players/pie-assessment-toolkit/runtime/internal`.\n *\n * Type duplication note: the public DOM-event detail aliases\n * (`SectionPlayerReadinessChangeDetail` /\n * `SectionPlayerReadinessPhase`) still live in section-player's\n * `contracts/public-events.ts` because that file is part of section-\n * player's published custom-element contract. The toolkit core defines\n * `EngineReadinessPhase` independently so it has zero section-player\n * imports. The two definitions must stay structurally identical;\n * that invariant is covered by the readiness assertions in this\n * package's tests, which mirror the section-player suite.\n */\n\n/**\n * Coarse readiness phase label, derived from the four readiness\n * signals. Surfaced via the kernel's `selectReadiness()` /\n * `getSnapshot().readiness` selectors; M6 stages own the stage-level\n * transitions on `pie-stage-change` and use this phase as a\n * convenience label only. The `readiness-change` DOM\n * event that used to surface this directly was removed in the broad\n * architecture review compat sweep alongside its\n * event bridge.\n */\nexport type EngineReadinessPhase =\n\t| \"bootstrapping\"\n\t| \"interaction-ready\"\n\t| \"loading\"\n\t| \"ready\"\n\t| \"error\";\n\nexport type EngineReadinessSignals = {\n\tsectionReady: boolean;\n\tinteractionReady: boolean;\n\tallLoadingComplete: boolean;\n\truntimeError: boolean;\n};\n\nexport type EngineReadinessDetail = {\n\tphase: EngineReadinessPhase;\n\tinteractionReady: boolean;\n\tallLoadingComplete: boolean;\n\treason?: string;\n};\n\nexport function resolveReadinessPhase(\n\tsignals: EngineReadinessSignals,\n): EngineReadinessPhase {\n\tif (signals.runtimeError) return \"error\";\n\tif (signals.allLoadingComplete) return \"ready\";\n\tif (signals.interactionReady) return \"interaction-ready\";\n\tif (signals.sectionReady) return \"loading\";\n\treturn \"bootstrapping\";\n}\n\nexport function createReadinessDetail(args: {\n\tmode: \"progressive\" | \"strict\";\n\tsignals: EngineReadinessSignals;\n\treason?: string;\n}): EngineReadinessDetail {\n\t// Final ready must always be gated by section lifecycle and complete loading.\n\tconst finalReady = args.signals.sectionReady && args.signals.allLoadingComplete;\n\tconst interactionReady =\n\t\targs.mode === \"strict\" ? finalReady : args.signals.interactionReady;\n\tconst phase = resolveReadinessPhase({\n\t\t...args.signals,\n\t\tallLoadingComplete: finalReady,\n\t\tinteractionReady,\n\t});\n\n\treturn {\n\t\tphase,\n\t\tinteractionReady,\n\t\tallLoadingComplete: finalReady,\n\t\treason: args.reason,\n\t};\n}\n"]}
@@ -18,9 +18,8 @@
18
18
  * `packages/section-player/src/components/shared/section-player-host-runtime.ts`)
19
19
  * hands its local implementation in.
20
20
  *
21
- * The strict mirror rule (M5) and the `runtime.<key>` precedence rule
22
- * are preserved bit-for-bit; the per-key precedence test in
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
24
  import type { LoaderConfig } from "@pie-players/pie-players-shared/loader-config";
26
25
  import type { LoadingCompleteDetail, StageChangeDetail } from "@pie-players/pie-players-shared/pie";
@@ -40,10 +39,7 @@ export type FrameworkErrorHandler = (model: FrameworkErrorModel) => void;
40
39
  export type StageChangeHandler = (detail: StageChangeDetail) => void;
41
40
  export type LoadingCompleteHandler = (detail: LoadingCompleteDetail) => void;
42
41
  /**
43
- * Two-tier section runtime config (M5 strict mirror, post-trim).
44
- *
45
- * Mirror rule: `kebab-attribute ↔ camelCaseProp ↔ runtime.<sameCamelCaseKey>`.
46
- * `runtime.<key>` always wins over the equivalent prop/attribute.
42
+ * Section runtime config.
47
43
  *
48
44
  * Documented exceptions (no runtime mirror, by design): identity
49
45
  * (`section-id`, `attempt-id`, `section`); layout-only shell knobs
@@ -66,25 +62,16 @@ export type RuntimeConfig = {
66
62
  env?: Record<string, unknown>;
67
63
  toolConfigStrictness?: ToolConfigStrictness;
68
64
  onFrameworkError?: FrameworkErrorHandler;
69
- enabledTools?: string;
70
65
  onStageChange?: StageChangeHandler;
71
66
  onLoadingComplete?: LoadingCompleteHandler;
72
67
  };
73
68
  export type RuntimeInputs = {
74
69
  assessmentId?: string;
75
- playerType?: string;
76
- player?: PlayerOverrides | null;
77
- lazyInit?: boolean;
78
- tools?: Record<string, unknown> | null;
79
- accessibility?: Record<string, unknown> | null;
80
- coordinator?: unknown;
81
- env?: Record<string, unknown> | null;
82
70
  toolConfigStrictness?: ToolConfigStrictness;
83
71
  onFrameworkError?: FrameworkErrorHandler;
84
72
  onStageChange?: StageChangeHandler;
85
73
  onLoadingComplete?: LoadingCompleteHandler;
86
74
  runtime: RuntimeConfig | null;
87
- enabledTools: string;
88
75
  };
89
76
  /**
90
77
  * Resolve the canonical `onFrameworkError` handler from the two-tier
@@ -98,21 +85,13 @@ export declare function resolveOnFrameworkError(args: {
98
85
  }): FrameworkErrorHandler | undefined;
99
86
  export declare function resolveToolsConfig(args: {
100
87
  runtime: RuntimeConfig | null;
101
- tools: Record<string, unknown> | null;
102
- enabledTools: string;
103
88
  }): {
104
89
  placement: {
105
- section?: string[] | undefined;
90
+ [x: string]: unknown;
106
91
  };
107
92
  };
108
93
  export declare function resolveRuntime(args: {
109
94
  assessmentId: string;
110
- playerType: string;
111
- player: PlayerOverrides | null;
112
- lazyInit: boolean;
113
- accessibility: Record<string, unknown> | null;
114
- coordinator: unknown;
115
- env: Record<string, unknown> | null;
116
95
  runtime: RuntimeConfig | null;
117
96
  effectiveToolsConfig: unknown;
118
97
  toolConfigStrictness?: ToolConfigStrictness;
@@ -121,18 +100,15 @@ export declare function resolveRuntime(args: {
121
100
  onLoadingComplete?: LoadingCompleteHandler;
122
101
  }): {
123
102
  assessmentId: string | undefined;
124
- playerType: string | undefined;
103
+ playerType: string;
125
104
  player: {
126
- loaderOptions: {
127
- [x: string]: unknown;
128
- };
129
- loaderConfig: {
130
- [x: string]: unknown;
131
- };
105
+ [key: string]: unknown;
106
+ loaderConfig?: LoaderConfig;
107
+ loaderOptions?: Record<string, unknown>;
132
108
  } | null;
133
- lazyInit: boolean | undefined;
134
- accessibility: Record<string, unknown> | null | undefined;
135
- coordinator: unknown;
109
+ lazyInit: boolean;
110
+ accessibility: Record<string, unknown> | null;
111
+ coordinator: {} | null;
136
112
  createSectionController: unknown;
137
113
  isolation: string;
138
114
  env: Record<string, unknown>;
@@ -142,7 +118,6 @@ export declare function resolveRuntime(args: {
142
118
  onLoadingComplete: LoadingCompleteHandler | undefined;
143
119
  tools: unknown;
144
120
  toolContextResolvers?: Record<string, unknown> | null;
145
- enabledTools?: string;
146
121
  };
147
122
  /**
148
123
  * Effective runtime returned by `resolveRuntime`. The shape is exposed
@@ -152,13 +127,10 @@ export declare function resolveRuntime(args: {
152
127
  */
153
128
  export type EffectiveRuntime = ReturnType<typeof resolveRuntime>;
154
129
  /**
155
- * Engine-side orchestrator that mirrors the legacy
156
- * `resolveSectionPlayerRuntimeState` from section-player but takes
130
+ * Engine-side orchestrator that powers `resolveSectionPlayerRuntimeState`
131
+ * from section-player and takes
157
132
  * `resolvePlayerRuntime` as an injected callable so the toolkit core
158
133
  * stays free of host-coupled defaults (`DEFAULT_PLAYER_DEFINITIONS`).
159
- *
160
- * The legacy section-player wrapper passes its local `resolvePlayerRuntime`
161
- * here in M7 PR 5 when the kernel switches onto the engine.
162
134
  */
163
135
  export declare function resolveSectionEngineRuntimeState<P>(args: RuntimeInputs, deps: {
164
136
  resolvePlayerRuntime: (resolverArgs: {
@@ -171,4 +143,3 @@ export declare function resolveSectionEngineRuntimeState<P>(args: RuntimeInputs,
171
143
  effectiveRuntime: EffectiveRuntime;
172
144
  playerRuntime: P;
173
145
  };
174
- //# sourceMappingURL=engine-resolver.d.ts.map