@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
@@ -8,7 +8,7 @@
8
8
  * Part of PIE Assessment Toolkit.
9
9
  */
10
10
  import type { I18nServiceApi } from "@pie-players/pie-players-shared/i18n";
11
- import type { AccessibilityCatalogResolver, CatalogLookupOptions, CatalogStatistics, CatalogType, ResolvedCatalog } from "./AccessibilityCatalogResolver.js";
11
+ import type { AccessibilityCatalogResolver, CatalogLookupContext, CatalogLookupOptions, CatalogOwnerContext, CatalogStatistics, CatalogType, ResolvedCatalog } from "./AccessibilityCatalogResolver.js";
12
12
  import type { FrameworkErrorListener } from "./framework-error-bus.js";
13
13
  import type { HighlightColor, HighlightType } from "./HighlightCoordinator.js";
14
14
  import type { SectionControllerHandle, SectionItemEventSubscriptionArgs, SectionScopedEventSubscriptionArgs, SectionEventSubscriptionArgs, ToolkitCoordinatorHooks, ToolkitInitStatus } from "./ToolkitCoordinator.js";
@@ -59,6 +59,19 @@ export interface HighlightCoordinatorApi {
59
59
  * Highlight a word for TTS (temporary)
60
60
  */
61
61
  highlightTTSWord(textNode: Text, startOffset: number, endOffset: number): void;
62
+ /**
63
+ * Highlight a single element as the active TTS word (temporary).
64
+ *
65
+ * Marks exactly the supplied element (via `data-pie-tts-word-element`)
66
+ * without walking up to a containing ancestor. Used for atomic targets that
67
+ * have no direct text node to range over — most notably MathJax CHTML tokens
68
+ * (e.g. `<mjx-mi><mjx-c/></mjx-mi>`) and whole-expression fallbacks. Painting
69
+ * the element itself is what lets a resolved math token highlight as a token
70
+ * rather than escalating to the full `<math>` / `<mjx-container>`.
71
+ *
72
+ * Optional so lightweight coordinator mocks can omit it.
73
+ */
74
+ highlightTTSWordElement?(element: Element): void;
62
75
  /**
63
76
  * Highlight sentence(s) for TTS (background layer)
64
77
  */
@@ -161,6 +174,7 @@ export interface TtsServiceApi {
161
174
  */
162
175
  speak(text: string, options?: {
163
176
  catalogId?: string;
177
+ catalogContext?: CatalogLookupContext;
164
178
  language?: string;
165
179
  contentElement?: Element;
166
180
  }): Promise<void>;
@@ -257,6 +271,10 @@ export interface AccessibilityCatalogResolverApi {
257
271
  * Add item-level catalogs (called when rendering a new item)
258
272
  */
259
273
  addItemCatalogs(catalogs: any[]): void;
274
+ /**
275
+ * Register catalogs scoped to a mounted content owner.
276
+ */
277
+ registerCatalogs?(context: CatalogOwnerContext, catalogs: any[]): () => void;
260
278
  /**
261
279
  * Clear item-level catalogs (called when leaving an item)
262
280
  */
@@ -557,7 +575,7 @@ export interface ToolkitCoordinatorApi {
557
575
  /**
558
576
  * Subscribe to policy-engine change events. Fires whenever the
559
577
  * coordinator's bound policy inputs change (`updateToolConfig`,
560
- * `updateFloatingTools`, `updateAssessment`, `updateCurrentItemRef`,
578
+ * `updateToolPlacement`, `updateAssessment`, `updateCurrentItemRef`,
561
579
  * `setPnpEnforcement`) or a custom `PolicySource` is registered /
562
580
  * removed. Listeners that need the new visible tool set should
563
581
  * call `decideToolPolicy(...)` with their level / scope.
@@ -625,4 +643,3 @@ export interface ToolkitCoordinatorApi {
625
643
  */
626
644
  onToolContextResolverChange(listener: () => void): () => void;
627
645
  }
628
- //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/services/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;AAuzBH,0EAA0E"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/services/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;AAg1BH,0EAA0E","sourcesContent":["/**\n * Service Interfaces\n *\n * Public interfaces for all core assessment toolkit services.\n * These interfaces define the contracts that service implementations must fulfill,\n * enabling dependency injection, testing, and custom implementations.\n *\n * Part of PIE Assessment Toolkit.\n */\n\nimport type { I18nServiceApi } from \"@pie-players/pie-players-shared/i18n\";\nimport type {\n\tAccessibilityCatalogResolver,\n\tCatalogLookupContext,\n\tCatalogLookupOptions,\n\tCatalogOwnerContext,\n\tCatalogStatistics,\n\tCatalogType,\n\tResolvedCatalog,\n} from \"./AccessibilityCatalogResolver.js\";\nimport type { FrameworkErrorListener } from \"./framework-error-bus.js\";\nimport type { HighlightColor, HighlightType } from \"./HighlightCoordinator.js\";\nimport type {\n\tSectionControllerHandle,\n\tSectionItemEventSubscriptionArgs,\n\tSectionScopedEventSubscriptionArgs,\n\tSectionEventSubscriptionArgs,\n\tToolkitCoordinatorHooks,\n\tToolkitInitStatus,\n} from \"./ToolkitCoordinator.js\";\nimport type { FontSize, ThemeConfig } from \"./ThemeProvider.js\";\nimport type { ZIndexLayer } from \"./ToolCoordinator.js\";\nimport type { PlaybackState, TTSConfig } from \"./TTSService.js\";\nimport type {\n\tToolPlacementConfig,\n\tToolPlacementLevel,\n\tToolProviderConfig,\n} from \"./tools-config-normalizer.js\";\nimport type { ToolProviderRegistry } from \"./tool-providers/ToolProviderRegistry.js\";\nimport type {\n\tPolicySource,\n\tPnpEnforcementMode,\n\tResolvedEngineInputs,\n\tToolPolicyChangeListener,\n\tToolPolicyDecision,\n\tToolPolicyDecisionRequest,\n} from \"../policy/engine.js\";\nimport type {\n\tAssessmentEntity,\n\tAssessmentItemRef,\n} from \"@pie-players/pie-players-shared/types\";\nimport type {\n\tITTSProvider,\n\tTTSProviderCapabilities,\n} from \"@pie-players/pie-tts\";\nimport type {\n\tResolvedToolContext,\n\tToolContextResolver,\n\tToolContextResolverContext,\n\tToolContextResolverMap,\n} from \"./ToolRegistry.js\";\n\n// Re-export I18nServiceApi from players-shared\nexport type { I18nServiceApi };\n\n/**\n * Theme provider interface\n *\n * Applies consistent accessibility theming across items and tools.\n */\nexport interface ThemeProviderApi {\n\t/**\n\t * Apply theme configuration\n\t */\n\tapplyTheme(config: ThemeConfig): void;\n\n\t/**\n\t * Get current theme configuration\n\t */\n\tgetCurrentTheme(): Required<ThemeConfig>;\n\n\t/**\n\t * Reset to default theme\n\t */\n\treset(): void;\n\n\t/**\n\t * Clean up and remove theme styles\n\t */\n\tdestroy(): void;\n}\n\n/**\n * Highlight coordinator interface\n *\n * Manages content highlighting for TTS, annotations, and selections.\n */\nexport interface HighlightCoordinatorApi {\n\t/**\n\t * Highlight a text range\n\t */\n\thighlightRange(\n\t\trange: Range,\n\t\ttype: HighlightType,\n\t\tcolor: HighlightColor,\n\t): void;\n\n\t/**\n\t * Highlight a word for TTS (temporary)\n\t */\n\thighlightTTSWord(\n\t\ttextNode: Text,\n\t\tstartOffset: number,\n\t\tendOffset: number,\n\t): void;\n\n\t/**\n\t * Highlight a single element as the active TTS word (temporary).\n\t *\n\t * Marks exactly the supplied element (via `data-pie-tts-word-element`)\n\t * without walking up to a containing ancestor. Used for atomic targets that\n\t * have no direct text node to range over — most notably MathJax CHTML tokens\n\t * (e.g. `<mjx-mi><mjx-c/></mjx-mi>`) and whole-expression fallbacks. Painting\n\t * the element itself is what lets a resolved math token highlight as a token\n\t * rather than escalating to the full `<math>` / `<mjx-container>`.\n\t *\n\t * Optional so lightweight coordinator mocks can omit it.\n\t */\n\thighlightTTSWordElement?(element: Element): void;\n\n\t/**\n\t * Highlight sentence(s) for TTS (background layer)\n\t */\n\thighlightTTSSentence(ranges: Range[]): void;\n\n\t/**\n\t * Clear all TTS highlights (word and sentence)\n\t */\n\tclearTTS(): void;\n\n\t/**\n\t * Clear highlights of a specific type\n\t */\n\tclearHighlights(type: HighlightType): void;\n\n\t/**\n\t * Clear all highlights\n\t */\n\tclearAll(): void;\n\n\t/**\n\t * Check if highlighting is supported in current environment\n\t */\n\tisSupported(): boolean;\n\n\t/**\n\t * Update TTS highlight style dynamically\n\t */\n\tupdateTTSHighlightStyle(color: string, opacity: number): void;\n}\n\n/**\n * Tool state interface\n */\nexport interface ToolState {\n\tid: string;\n\tname: string;\n\tisVisible: boolean;\n\telement: HTMLElement | null;\n\tlayer: ZIndexLayer;\n}\n\n/**\n * Tool coordinator interface\n *\n * Manages z-index layering and visibility for floating tools.\n */\nexport interface ToolCoordinatorApi {\n\t/**\n\t * Register a tool with the coordinator\n\t */\n\tregisterTool(\n\t\tid: string,\n\t\tname: string,\n\t\telement?: HTMLElement,\n\t\tlayer?: ZIndexLayer,\n\t): void;\n\n\t/**\n\t * Unregister a tool\n\t */\n\tunregisterTool(id: string): void;\n\n\t/**\n\t * Show a tool\n\t */\n\tshowTool(id: string): void;\n\n\t/**\n\t * Hide a tool\n\t */\n\thideTool(id: string): void;\n\n\t/**\n\t * Toggle tool visibility\n\t */\n\ttoggleTool(id: string): void;\n\n\t/**\n\t * Check if tool is visible\n\t */\n\tisToolVisible(id: string): boolean;\n\n\t/**\n\t * Bring an element to the front of its layer\n\t */\n\tbringToFront(element: HTMLElement): void;\n\n\t/**\n\t * Update the element reference for a tool\n\t */\n\tupdateToolElement(id: string, element: HTMLElement): void;\n\n\t/**\n\t * Get state for a specific tool\n\t */\n\tgetToolState(id: string): ToolState | undefined;\n\n\t/**\n\t * Get all visible tools\n\t */\n\tgetVisibleTools(): ToolState[];\n\n\t/**\n\t * Subscribe to tool state changes\n\t */\n\tsubscribe(listener: () => void): () => void;\n}\n\n/**\n * TTS service interface\n *\n * Provides text-to-speech functionality with provider-based architecture.\n * Supports QTI 3.0 accessibility catalogs for pre-authored spoken content.\n */\nexport interface TtsServiceApi {\n\t/**\n\t * Initialize TTS with a provider\n\t */\n\tinitialize(\n\t\tprovider: ITTSProvider,\n\t\tconfig?: Partial<TTSConfig>,\n\t): Promise<void>;\n\n\t/**\n\t * Speak text with optional catalog support\n\t */\n\tspeak(\n\t\ttext: string,\n\t\toptions?: {\n\t\t\tcatalogId?: string;\n\t\t\tcatalogContext?: CatalogLookupContext;\n\t\t\tlanguage?: string;\n\t\t\tcontentElement?: Element;\n\t\t},\n\t): Promise<void>;\n\n\t/**\n\t * Speak a text range\n\t */\n\tspeakRange(\n\t\trange: Range,\n\t\toptions?: { contentRoot?: Element | null },\n\t): Promise<void>;\n\n\t/**\n\t * Pause playback\n\t */\n\tpause(): void;\n\n\t/**\n\t * Resume playback\n\t */\n\tresume(): void;\n\n\t/**\n\t * Stop playback\n\t */\n\tstop(): void;\n\n\t/**\n\t * Request active TTS controls to hand off/deactivate their UI state.\n\t *\n\t * This is an orchestration hint for TTS tool chrome and does not replace\n\t * playback controls such as stop/pause/resume.\n\t */\n\trequestControlHandoff(): void;\n\n\t/**\n\t * Seek forward by sentence units\n\t */\n\tseekForward(units?: number): Promise<void>;\n\n\t/**\n\t * Seek backward by sentence units\n\t */\n\tseekBackward(units?: number): Promise<void>;\n\n\t/**\n\t * Check if currently playing\n\t */\n\tisPlaying(): boolean;\n\n\t/**\n\t * Check if paused\n\t */\n\tisPaused(): boolean;\n\n\t/**\n\t * Get current playback state\n\t */\n\tgetState(): PlaybackState;\n\n\t/**\n\t * Get currently speaking text\n\t */\n\tgetCurrentText(): string | null;\n\n\t/**\n\t * Subscribe to state changes\n\t */\n\tonStateChange(id: string, callback: (state: PlaybackState) => void): void;\n\n\t/**\n\t * Unsubscribe from state changes\n\t */\n\toffStateChange(id: string, callback: (state: PlaybackState) => void): void;\n\n\t/**\n\t * Get capabilities of current provider\n\t */\n\tgetCapabilities(): TTSProviderCapabilities | null;\n\n\t/**\n\t * Update TTS settings dynamically (rate, pitch, voice)\n\t */\n\tupdateSettings(settings: Partial<TTSConfig>): Promise<void>;\n\n\t/**\n\t * Set highlight coordinator for word highlighting\n\t */\n\tsetHighlightCoordinator(coordinator: HighlightCoordinatorApi): void;\n\n\t/**\n\t * Set accessibility catalog resolver for spoken content\n\t */\n\tsetCatalogResolver(resolver: AccessibilityCatalogResolver): void;\n}\n\n/**\n * Accessibility catalog resolver interface\n *\n * Manages QTI 3.0 accessibility catalogs at assessment and item levels.\n * Provides lookup and resolution services for alternative content representations.\n */\nexport interface AccessibilityCatalogResolverApi {\n\t/**\n\t * Set the default language for fallback resolution\n\t */\n\tsetDefaultLanguage(language: string): void;\n\n\t/**\n\t * Get the default language\n\t */\n\tgetDefaultLanguage(): string;\n\n\t/**\n\t * Add item-level catalogs (called when rendering a new item)\n\t */\n\taddItemCatalogs(catalogs: any[]): void;\n\n\t/**\n\t * Register catalogs scoped to a mounted content owner.\n\t */\n\tregisterCatalogs?(\n\t\tcontext: CatalogOwnerContext,\n\t\tcatalogs: any[],\n\t): () => void;\n\n\t/**\n\t * Clear item-level catalogs (called when leaving an item)\n\t */\n\tclearItemCatalogs(): void;\n\n\t/**\n\t * Check if a catalog exists\n\t */\n\thasCatalog(catalogId: string): boolean;\n\n\t/**\n\t * Get alternative content for a catalog identifier\n\t */\n\tgetAlternative(\n\t\tcatalogId: string,\n\t\toptions: CatalogLookupOptions,\n\t): ResolvedCatalog | null;\n\n\t/**\n\t * Get all available alternatives for a catalog identifier\n\t */\n\tgetAllAlternatives(catalogId: string): ResolvedCatalog[];\n\n\t/**\n\t * Get all catalog identifiers available\n\t */\n\tgetAllCatalogIds(): string[];\n\n\t/**\n\t * Get statistics about available catalogs\n\t */\n\tgetStatistics(): CatalogStatistics;\n\n\t/**\n\t * Check if a specific catalog type is available\n\t */\n\thasAlternativeType(catalogId: string, type: CatalogType): boolean;\n\n\t/**\n\t * Get all catalog IDs that have a specific type of alternative\n\t */\n\tgetCatalogsByType(type: CatalogType): string[];\n\n\t/**\n\t * Reset all catalogs\n\t */\n\treset(): void;\n\n\t/**\n\t * Destroy and cleanup\n\t */\n\tdestroy(): void;\n}\n\n/**\n * Element tool state store interface\n *\n * Manages element-level ephemeral tool state using composite keys for global uniqueness.\n * Tool state is client-only and separate from PIE session data (which is sent to server for scoring).\n */\nexport interface ElementToolStateStoreApi {\n\t/**\n\t * Generate a globally unique element ID from components\n\t */\n\tgetGlobalElementId(\n\t\tassessmentId: string,\n\t\tsectionId: string,\n\t\titemId: string,\n\t\telementId: string,\n\t): string;\n\n\t/**\n\t * Parse a global element ID into its components\n\t */\n\tparseGlobalElementId(globalElementId: string): {\n\t\tassessmentId: string;\n\t\tsectionId: string;\n\t\titemId: string;\n\t\telementId: string;\n\t} | null;\n\n\t/**\n\t * Set state for a specific tool on an element\n\t */\n\tsetState(globalElementId: string, toolId: string, state: any): void;\n\n\t/**\n\t * Get state for a specific tool on an element\n\t */\n\tgetState(globalElementId: string, toolId: string): any | undefined;\n\n\t/**\n\t * Get all tool states for a specific element\n\t */\n\tgetElementState(globalElementId: string): Record<string, any>;\n\n\t/**\n\t * Get all element states\n\t */\n\tgetAllState(): Record<string, Record<string, any>>;\n\n\t/**\n\t * Subscribe to state changes\n\t */\n\tsubscribe(\n\t\tcallback: (state: Map<string, Map<string, any>>) => void,\n\t): () => void;\n\n\t/**\n\t * Set callback for persistence integration\n\t */\n\tsetOnStateChange(\n\t\tcallback: (state: Record<string, Record<string, any>>) => void,\n\t): void;\n\n\t/**\n\t * Load state from persistence\n\t */\n\tloadState(state: Record<string, Record<string, any>>): void;\n\n\t/**\n\t * Clear state for a specific element\n\t */\n\tclearElement(globalElementId: string): void;\n\n\t/**\n\t * Clear state for a specific tool across all elements\n\t */\n\tclearTool(toolId: string): void;\n\n\t/**\n\t * Clear all elements in a specific section\n\t */\n\tclearSection(assessmentId: string, sectionId: string): void;\n\n\t/**\n\t * Clear all state\n\t */\n\tclearAll(): void;\n}\n\n/**\n * Toolkit coordinator interface\n *\n * Orchestrates all toolkit services (TTS, tools, accessibility, state management) from a single entry point.\n * Provides centralized configuration for tool availability and settings.\n */\nexport interface ToolkitCoordinatorApi {\n\t/**\n\t * Assessment identifier\n\t */\n\treadonly assessmentId: string;\n\n\t/**\n\t * Configuration\n\t */\n\treadonly config: {\n\t\ttools?: {\n\t\t\tproviders?: Record<string, ToolProviderConfig | undefined>;\n\t\t};\n\t};\n\n\t/**\n\t * TTS service\n\t */\n\treadonly ttsService: TtsServiceApi;\n\n\t/**\n\t * Tool coordinator\n\t */\n\treadonly toolCoordinator: ToolCoordinatorApi;\n\n\t/**\n\t * Highlight coordinator\n\t */\n\treadonly highlightCoordinator: HighlightCoordinatorApi;\n\n\t/**\n\t * Element tool state store\n\t */\n\treadonly elementToolStateStore: ElementToolStateStoreApi;\n\n\t/**\n\t * Catalog resolver\n\t */\n\treadonly catalogResolver: AccessibilityCatalogResolverApi;\n\n\t/**\n\t * Tool provider registry\n\t */\n\treadonly toolProviderRegistry: ToolProviderRegistry;\n\n\t/**\n\t * Get all services as a bundle\n\t */\n\tgetServiceBundle(): {\n\t\tttsService: TtsServiceApi;\n\t\ttoolCoordinator: ToolCoordinatorApi;\n\t\thighlightCoordinator: HighlightCoordinatorApi;\n\t\telementToolStateStore: ElementToolStateStoreApi;\n\t\tcatalogResolver: AccessibilityCatalogResolverApi;\n\t\ttoolProviderRegistry: ToolProviderRegistry;\n\t};\n\n\t/**\n\t * Ensure TTS service is initialized and ready.\n\t */\n\tensureTTSReady(config?: Record<string, unknown>): Promise<void>;\n\n\t/**\n\t * Ensure a provider is initialized and ready.\n\t */\n\tensureProviderReady(providerId: string): Promise<unknown>;\n\n\t/**\n\t * Wait until coordinator initialization is complete.\n\t */\n\twaitUntilReady(): Promise<void>;\n\n\t/**\n\t * Check if coordinator has completed initialization.\n\t */\n\tisReady(): boolean;\n\n\t/**\n\t * Read current initialization status.\n\t */\n\tgetInitStatus(): ToolkitInitStatus;\n\n\t/**\n\t * Check if a tool is enabled\n\t */\n\tisToolEnabled(toolId: string): boolean;\n\n\t/**\n\t * Get tool configuration\n\t */\n\tgetToolConfig(toolId: string): ToolProviderConfig | null;\n\n\t/**\n\t * Update tool configuration\n\t */\n\tupdateToolConfig(toolId: string, updates: Partial<ToolProviderConfig>): void;\n\n\t/**\n\t * Update the enabled tool list for one placement level.\n\t */\n\tupdateToolPlacement(level: ToolPlacementLevel, toolIds: string[]): void;\n\n\t/**\n\t * Patch one or more placement levels in the canonical tools config.\n\t */\n\tupdateToolsPlacement(partial: ToolPlacementConfig): void;\n\n\t/**\n\t * Register or update lifecycle hooks at runtime.\n\t */\n\tsetHooks(hooks: ToolkitCoordinatorHooks): void;\n\n\t/**\n\t * Return a section controller if already created.\n\t */\n\tgetSectionController(args: {\n\t\tsectionId: string;\n\t\tattemptId?: string;\n\t}): SectionControllerHandle | undefined;\n\n\t/**\n\t * Subscribe to section controller events.\n\t *\n\t * The listener is bound to the toolkit's *active section cohort* and\n\t * automatically migrates across cohort transitions\n\t * (`getOrCreateSectionController` for a different cohort). On every\n\t * migration the listener receives a snapshot replay of the new\n\t * cohort's already-loaded `content-loaded` events followed by the\n\t * aggregate `section-loading-complete`, in the canonical order a\n\t * fresh subscriber would have observed.\n\t *\n\t * Throws if no active section cohort exists; host code must call\n\t * `getOrCreateSectionController(...)` at least once before\n\t * subscribing. (`toolkit-ready` alone is not sufficient — it fires\n\t * once toolkit state has loaded but before any section controller\n\t * has been created.) The typical pattern is to subscribe once\n\t * immediately after the first `getOrCreateSectionController(...)`\n\t * resolves; the subscription then follows the active cohort across\n\t * all subsequent navigation without further wiring.\n\t *\n\t * Subscribing the same `listener` reference twice replaces the prior\n\t * subscription with the new one (filter args from the second call\n\t * win); calling the returned disposer twice is a no-op.\n\t *\n\t * A listener that throws is caught and `console.warn`-logged; the\n\t * throw does not interrupt fan-out to the remaining listeners.\n\t */\n\tsubscribeSectionEvents(args: SectionEventSubscriptionArgs): () => void;\n\n\t/**\n\t * Subscribe to item-scoped section controller events.\n\t *\n\t * Same active-cohort binding contract as {@link subscribeSectionEvents};\n\t * defaults `eventTypes` to the item-scoped subset.\n\t */\n\tsubscribeItemEvents(args: SectionItemEventSubscriptionArgs): () => void;\n\n\t/**\n\t * Subscribe to section-scoped lifecycle/loading/completion/error events.\n\t *\n\t * Same active-cohort binding contract as {@link subscribeSectionEvents};\n\t * defaults `eventTypes` to the section-scoped subset.\n\t */\n\tsubscribeSectionLifecycleEvents(\n\t\targs: SectionScopedEventSubscriptionArgs,\n\t): () => void;\n\n\t/**\n\t * Create or reuse a section controller with single-flight deduplication.\n\t */\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\t/**\n\t * Dispose an existing section controller.\n\t */\n\tdisposeSectionController(args: {\n\t\tsectionId: string;\n\t\tattemptId?: string;\n\t\tpersistBeforeDispose?: boolean;\n\t\tclearPersistence?: boolean;\n\t}): Promise<void>;\n\n\t/**\n\t * Subscribe to framework-error events emitted by the coordinator.\n\t *\n\t * Mirrors the shape of {@link subscribeTelemetry} (see\n\t * `ToolkitCoordinator.subscribeTelemetry`): a synchronous,\n\t * multi-subscriber stream where each call to the internal bus's\n\t * `reportFrameworkError` fans out to every active listener exactly once.\n\t *\n\t * The returned function detaches the listener; calling it twice is a\n\t * no-op. A listener that throws is caught and logged; the throw does\n\t * not break fan-out to the remaining listeners.\n\t *\n\t * Use this to wire framework errors into Sentry / Datadog / a custom\n\t * banner without listening on a DOM event. The DOM event\n\t * (`framework-error`) and the canonical `onFrameworkError` prop on\n\t * `<pie-assessment-toolkit>` consume the same bus.\n\t */\n\tsubscribeFrameworkErrors(listener: FrameworkErrorListener): () => void;\n\n\t// ----------------------------------------------------------------\n\t// Tool Policy Engine — public surface (M8 PR 2 / PR 3).\n\t//\n\t// The coordinator owns a single `ToolPolicyEngine` instance and\n\t// exposes its decision and subscription surface through the API\n\t// so that toolbar custom elements (`pie-item-toolbar`,\n\t// `pie-section-toolbar`), the base section player, and bespoke\n\t// host instrumentation (PNP debugger, etc.) all flow through the\n\t// same engine. Hosts that want to drive PNP/profile inputs imperatively\n\t// (instead of binding props on `<pie-assessment-toolkit>`) call\n\t// `updateAssessment` / `updateCurrentItemRef` /\n\t// `setPnpEnforcement` directly.\n\t// ----------------------------------------------------------------\n\n\t/**\n\t * Resolve the visible tool set for a given placement level + scope.\n\t * Returns the engine's full decision (visible tools, diagnostics,\n\t * provenance). Hosts that only need the IDs may map\n\t * `decision.visibleTools` themselves.\n\t */\n\tdecideToolPolicy(request: ToolPolicyDecisionRequest): ToolPolicyDecision;\n\n\t/**\n\t * Subscribe to policy-engine change events. Fires whenever the\n\t * coordinator's bound policy inputs change (`updateToolConfig`,\n\t * `updateToolPlacement`, `updateAssessment`, `updateCurrentItemRef`,\n\t * `setPnpEnforcement`) or a custom `PolicySource` is registered /\n\t * removed. Listeners that need the new visible tool set should\n\t * call `decideToolPolicy(...)` with their level / scope.\n\t */\n\tonPolicyChange(listener: ToolPolicyChangeListener): () => void;\n\n\t/**\n\t * Bind (or clear) the active assessment for PNP/profile policy decisions.\n\t *\n\t * Under auto-mode (no host override via {@link setPnpEnforcement}),\n\t * the engine flips to `pnpEnforcement: \"on\"` iff the assessment\n\t * carries profile precedence material (`personalNeedsProfile`,\n\t * `settings.districtPolicy`, `settings.testAdministration`) or the\n\t * currently-bound item ref carries item-level profile inputs. A bare\n\t * assessment record (just `id` / `name`) keeps `\"off\"`.\n\t *\n\t * The host override set via {@link setPnpEnforcement} is sticky\n\t * across assessment swaps.\n\t */\n\tupdateAssessment(assessment: AssessmentEntity | null): void;\n\n\t/**\n\t * Bind (or clear) the current item reference for policy decisions.\n\t * Used by item-level profile gates (item `requiredTools` /\n\t * `restrictedTools` / `toolParameters`). Item-level profile material\n\t * also feeds the auto-mode helper — navigating to an item with\n\t * profile settings can flip auto-mode to `\"on\"` even when the parent\n\t * assessment carries no profile block of its own.\n\t */\n\tupdateCurrentItemRef(itemRef: AssessmentItemRef | null): void;\n\n\t/**\n\t * Override the auto-mode PNP/profile enforcement decision. Pass `\"on\"` /\n\t * `\"off\"` to pin the mode, or `null` to clear the override and\n\t * return to auto-mode (`\"on\"` iff the bound assessment / item ref\n\t * carries profile material, otherwise `\"off\"`).\n\t */\n\tsetPnpEnforcement(mode: PnpEnforcementMode | null): void;\n\n\t/**\n\t * Read the engine inputs currently driving decisions. Useful for\n\t * debugging / instrumentation; do not mutate.\n\t */\n\tgetPolicyInputs(): Readonly<ResolvedEngineInputs>;\n\n\t/**\n\t * Register a custom `PolicySource`. The source participates in\n\t * every subsequent `decideToolPolicy(...)` call until disposed\n\t * (the returned function detaches).\n\t */\n\tregisterPolicySource(source: PolicySource): () => void;\n\n\t/**\n\t * Register a host-owned resolver for scoped tool render context.\n\t */\n\tregisterToolContextResolver(\n\t\ttoolId: string,\n\t\tresolver: ToolContextResolver,\n\t): () => void;\n\n\t/**\n\t * Replace all host-owned render-context resolvers.\n\t */\n\tsetToolContextResolvers(\n\t\tresolvers: ToolContextResolverMap | null | undefined,\n\t): void;\n\n\t/**\n\t * Whether a host resolver is registered for this tool.\n\t */\n\thasToolContextResolver(toolId: string): boolean;\n\n\t/**\n\t * Resolve render visibility/params for a tool that already survived policy gates.\n\t */\n\tresolveToolContext(\n\t\tcontext: ToolContextResolverContext,\n\t): ResolvedToolContext | null;\n\n\t/**\n\t * Subscribe to resolver registration/removal changes.\n\t */\n\tonToolContextResolverChange(listener: () => void): () => void;\n}\n\n// I18nServiceApi is re-exported from @pie-players/pie-players-shared/i18n\n"]}
@@ -236,4 +236,3 @@ export declare function getFeatureCategory(featureId: string): keyof typeof QTI_
236
236
  * Helper to get all features in a category
237
237
  */
238
238
  export declare function getFeaturesInCategory(category: keyof typeof QTI_STANDARD_ACCESS_FEATURES): string[];
239
- //# sourceMappingURL=pnp-standard-features.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pnp-standard-features.js","sourceRoot":"","sources":["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CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CACjC,SAAiB;IAEjB,KAAK,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAChD,4BAA4B,CAC5B,EAAE,CAAC;QACH,IAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/D,OAAO,QAAqD,CAAC;QAC9D,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACpC,QAAmD;IAEnD,OAAO,MAAM,CAAC,MAAM,CAAC,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC9D,CAAC"}
1
+ {"version":3,"file":"pnp-standard-features.js","sourceRoot":"","sources":["../../src/services/pnp-standard-features.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C;;;OAGG;IACH,MAAM,EAAE;QACP,yBAAyB;QACzB,aAAa,EAAE,eAAe;QAC9B,eAAe,EAAE,iBAAiB;QAClC,QAAQ,EAAE,UAAU;QAEpB,qBAAqB;QACrB,mBAAmB,EAAE,qBAAqB;QAC1C,iBAAiB,EAAE,mBAAmB;QACtC,aAAa,EAAE,eAAe;QAC9B,YAAY,EAAE,cAAc;QAE5B,wBAAwB;QACxB,uBAAuB,EAAE,yBAAyB;QAClD,UAAU,EAAE,YAAY;QACxB,eAAe,EAAE,iBAAiB;QAClC,UAAU,EAAE,YAAY;QAExB,sBAAsB;QACtB,eAAe,EAAE,iBAAiB;QAClC,eAAe,EAAE,iBAAiB;QAClC,aAAa,EAAE,eAAe;QAC9B,cAAc,EAAE,gBAAgB;QAChC,aAAa,EAAE,eAAe;KAC9B;IAED;;;OAGG;IACH,QAAQ,EAAE;QACT,eAAe;QACf,gBAAgB,E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AgB;YAChB,eAAe;YACf,cAAc;YACd,cAAc;YACd,aAAa;YACb,kBAAkB;YAClB,sBAAsB;SACtB;KACD;IAED;;OAEG;IACH,gBAAgB,EAAE;QACjB,KAAK,EAAE,oCAAoC;QAC3C,QAAQ,EAAE;YACT,iBAAiB;YACjB,YAAY;YACZ,mBAAmB;YACnB,cAAc;YACd,eAAe;YACf,eAAe;YACf,cAAc;YACd,eAAe;SACf;KACD;IAED;;OAEG;IACH,cAAc,EAAE;QACf,KAAK,EAAE,2CAA2C;QAClD,QAAQ,EAAE;YACT,cAAc;YACd,gBAAgB;YAChB,UAAU;YACV,oBAAoB;YACpB,WAAW;YACX,cAAc;SACd;KACD;CACQ,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACxD,OAAQ,4BAAkD,CAAC,QAAQ,CAClE,SAAS,CACT,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CACjC,SAAiB;IAEjB,KAAK,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAChD,4BAA4B,CAC5B,EAAE,CAAC;QACH,IAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/D,OAAO,QAAqD,CAAC;QAC9D,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACpC,QAAmD;IAEnD,OAAO,MAAM,CAAC,MAAM,CAAC,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["/**\n * QTI 3.0 / IMS Access for All (AfA) 3.0 Standard Access Features\n *\n * This file contains standardized accessibility feature identifiers from:\n * - IMS Global Access for All (AfA) 3.0 specification\n * - QTI 3.0 Personal Needs and Preferences (PNP)\n * - Schema.org accessibility features vocabulary\n * - WCAG 2.x accessibility guidelines\n *\n * These are the officially recognized values for QTI 3.0's accessibilityInfo.accessFeature\n * and can be used as a reference for PNP profile configuration and tool mapping.\n *\n * References:\n * - IMS AfA 3.0: https://www.imsglobal.org/spec/afa/v3p0\n * - QTI 3.0: https://www.imsglobal.org/spec/qti/v3p0\n * - Schema.org: https://schema.org/accessibilityFeature\n */\n\n/**\n * Standard QTI 3.0 accessibility features organized by category\n */\nexport const QTI_STANDARD_ACCESS_FEATURES = {\n\t/**\n\t * Visual accessibility features\n\t * For students with low vision, color blindness, or visual processing needs\n\t */\n\tvisual: {\n\t\t// Magnification and zoom\n\t\tmagnification: \"magnification\",\n\t\tscreenMagnifier: \"screenMagnifier\",\n\t\tzoomable: \"zoomable\",\n\n\t\t// Color and contrast\n\t\thighContrastDisplay: \"highContrastDisplay\",\n\t\thighContrastAudio: \"highContrastAudio\",\n\t\tcolorContrast: \"colorContrast\",\n\t\tinvertColors: \"invertColors\",\n\n\t\t// Display customization\n\t\tdisplayTransformability: \"displayTransformability\",\n\t\tlargePrint: \"largePrint\",\n\t\tfontEnlargement: \"fontEnlargement\",\n\t\tresizeText: \"resizeText\",\n\n\t\t// Visual alternatives\n\t\talternativeText: \"alternativeText\",\n\t\tlongDescription: \"longDescription\",\n\t\tdescribedMath: \"describedMath\",\n\t\ttactileGraphic: \"tactileGraphic\",\n\t\ttactileObject: \"tactileObject\",\n\t},\n\n\t/**\n\t * Auditory accessibility features\n\t * For students who are deaf, hard of hearing, or benefit from audio\n\t */\n\tauditory: {\n\t\t// Audio output\n\t\taudioDescription: \"audioDescription\",\n\t\ttextToSpeech: \"textToSpeech\",\n\t\treadAloud: \"readAloud\",\n\t\thumanVoice: \"humanVoice\",\n\t\tsyntheticVoice: \"syntheticVoice\",\n\n\t\t// Speech control\n\t\tspeechRate: \"speechRate\",\n\t\tspeechVolume: \"speechVolume\",\n\t\tvoicePitch: \"voicePitch\",\n\n\t\t// Visual alternatives for audio\n\t\tcaptions: \"captions\",\n\t\tclosedCaptions: \"closedCaptions\",\n\t\topenCaptions: \"openCaptions\",\n\t\ttranscript: \"transcript\",\n\t\tsignLanguage: \"signLanguage\",\n\t\tsubtitles: \"subtitles\",\n\n\t\t// Audio adjustments\n\t\taudioControl: \"audioControl\",\n\t\tnoBackgroundAudio: \"noBackgroundAudio\",\n\t},\n\n\t/**\n\t * Motor/physical accessibility features\n\t * For students with limited mobility or motor control\n\t */\n\tmotor: {\n\t\t// Input alternatives\n\t\tkeyboardControl: \"keyboardControl\",\n\t\tmouseControl: \"mouseControl\",\n\t\ttouchControl: \"touchControl\",\n\t\tvoiceControl: \"voiceControl\",\n\t\tswitchControl: \"switchControl\",\n\t\teyeGazeControl: \"eyeGazeControl\",\n\n\t\t// Keyboard features\n\t\tsingleSwitchAccess: \"singleSwitchAccess\",\n\t\tstickyKeys: \"stickyKeys\",\n\t\tkeyboardShortcuts: \"keyboardShortcuts\",\n\n\t\t// Timing\n\t\ttimingControl: \"timingControl\",\n\t\tunlimitedTime: \"unlimitedTime\",\n\t\textendedTime: \"extendedTime\",\n\t\tpauseControl: \"pauseControl\",\n\t},\n\n\t/**\n\t * Cognitive/learning accessibility features\n\t * For students with learning disabilities, ADHD, autism, etc.\n\t */\n\tcognitive: {\n\t\t// Content simplification\n\t\tsimplifiedLanguage: \"simplifiedLanguage\",\n\t\treducedComplexity: \"reducedComplexity\",\n\t\tstructuralNavigation: \"structuralNavigation\",\n\t\ttableOfContents: \"tableOfContents\",\n\n\t\t// Focus and attention\n\t\treducedDistraction: \"reducedDistraction\",\n\t\tnoFlashing: \"noFlashing\",\n\t\tpauseAnimation: \"pauseAnimation\",\n\n\t\t// Organization and support\n\t\tannotations: \"annotations\",\n\t\tbookmarking: \"bookmarking\",\n\t\thighlighting: \"highlighting\",\n\t\tguidedNavigation: \"guidedNavigation\",\n\n\t\t// Tools\n\t\tcalculator: \"calculator\",\n\t\tthesaurus: \"thesaurus\",\n\t\tspellingAssistance: \"spellingAssistance\",\n\t\tgrammarAssistance: \"grammarAssistance\",\n\t},\n\n\t/**\n\t * Reading support features\n\t * For students with dyslexia or reading challenges\n\t */\n\treading: {\n\t\t// Text presentation\n\t\tlineSpacing: \"lineSpacing\",\n\t\twordSpacing: \"wordSpacing\",\n\t\tletterSpacing: \"letterSpacing\",\n\t\tfontFamily: \"fontFamily\",\n\t\treadingMask: \"readingMask\",\n\t\treadingGuide: \"readingGuide\",\n\t\treadingRuler: \"readingRuler\",\n\n\t\t// Highlighting and emphasis\n\t\twordHighlighting: \"wordHighlighting\",\n\t\tlineHighlighting: \"lineHighlighting\",\n\t\tfocusIndicator: \"focusIndicator\",\n\n\t\t// Content support\n\t\tprintableResource: \"printableResource\",\n\t\tbraille: \"braille\",\n\t\tnemeth: \"nemeth\",\n\t\trefreshableBraille: \"refreshableBraille\",\n\t},\n\n\t/**\n\t * Navigation features\n\t * For efficient content navigation\n\t */\n\tnavigation: {\n\t\t// Structure\n\t\tindex: \"index\",\n\t\tpageNavigation: \"pageNavigation\",\n\t\tskipContent: \"skipContent\",\n\t\tbreadcrumbs: \"breadcrumbs\",\n\n\t\t// Search\n\t\tsearchable: \"searchable\",\n\t\tfullTextSearch: \"fullTextSearch\",\n\t},\n\n\t/**\n\t * Linguistic features\n\t * For language support\n\t */\n\tlinguistic: {\n\t\t// Languages\n\t\tmultilingualText: \"multilingualText\",\n\t\ttranslatedText: \"translatedText\",\n\t\tglossary: \"glossary\",\n\n\t\t// Sign language\n\t\tsignLanguageInterpretation: \"signLanguageInterpretation\",\n\t\tvisualLanguage: \"visualLanguage\",\n\t},\n\n\t/**\n\t * Assessment-specific features\n\t * Features specific to test-taking environments\n\t */\n\tassessment: {\n\t\t// Tools\n\t\tprotractor: \"protractor\",\n\t\truler: \"ruler\",\n\t\tgraph: \"graph\",\n\t\tgraphingCalculator: \"graphingCalculator\",\n\t\tperiodicTable: \"periodicTable\",\n\t\tformulaSheet: \"formulaSheet\",\n\n\t\t// Answer support\n\t\tanswerMasking: \"answerMasking\",\n\t\tanswerEliminator: \"answerEliminator\",\n\t\tstrikethrough: \"strikethrough\",\n\n\t\t// Item features\n\t\titemGlossary: \"itemGlossary\",\n\t\ttutorialAvailable: \"tutorialAvailable\",\n\t},\n} as const;\n\n/**\n * Flat list of all standard access features for validation\n */\nexport const ALL_STANDARD_ACCESS_FEATURES = Object.values(\n\tQTI_STANDARD_ACCESS_FEATURES,\n).flatMap((category) => Object.values(category));\n\n/**\n * Example PNP configurations for common accessibility needs\n * These are NOT official profiles but illustrative examples showing\n * how standard features can be combined for different student needs.\n */\nexport const EXAMPLE_PNP_CONFIGURATIONS = {\n\t/**\n\t * Example: Student with low vision\n\t */\n\tlowVision: {\n\t\tlabel: \"Example: Low Vision Support\",\n\t\tfeatures: [\n\t\t\t\"magnification\",\n\t\t\t\"screenMagnifier\",\n\t\t\t\"highContrastDisplay\",\n\t\t\t\"colorContrast\",\n\t\t\t\"fontEnlargement\",\n\t\t\t\"textToSpeech\",\n\t\t\t\"alternativeText\",\n\t\t\t\"describedMath\",\n\t\t],\n\t},\n\n\t/**\n\t * Example: Student who is blind\n\t */\n\tblind: {\n\t\tlabel: \"Example: Blind Student Support\",\n\t\tfeatures: [\n\t\t\t\"textToSpeech\",\n\t\t\t\"screenReader\",\n\t\t\t\"alternativeText\",\n\t\t\t\"longDescription\",\n\t\t\t\"describedMath\",\n\t\t\t\"braille\",\n\t\t\t\"refreshableBraille\",\n\t\t\t\"keyboardControl\",\n\t\t\t\"structuralNavigation\",\n\t\t],\n\t},\n\n\t/**\n\t * Example: Student who is deaf or hard of hearing\n\t */\n\tdeafHardOfHearing: {\n\t\tlabel: \"Example: Deaf/Hard of Hearing Support\",\n\t\tfeatures: [\n\t\t\t\"captions\",\n\t\t\t\"closedCaptions\",\n\t\t\t\"signLanguage\",\n\t\t\t\"transcript\",\n\t\t\t\"visualLanguage\",\n\t\t\t\"noBackgroundAudio\",\n\t\t],\n\t},\n\n\t/**\n\t * Example: Student with dyslexia\n\t */\n\tdyslexia: {\n\t\tlabel: \"Example: Dyslexia Support\",\n\t\tfeatures: [\n\t\t\t\"textToSpeech\",\n\t\t\t\"readAloud\",\n\t\t\t\"highlighting\",\n\t\t\t\"wordHighlighting\",\n\t\t\t\"lineHighlighting\",\n\t\t\t\"readingMask\",\n\t\t\t\"readingGuide\",\n\t\t\t\"fontFamily\",\n\t\t\t\"lineSpacing\",\n\t\t\t\"wordSpacing\",\n\t\t\t\"simplifiedLanguage\",\n\t\t],\n\t},\n\n\t/**\n\t * Example: Student with ADHD\n\t */\n\tadhd: {\n\t\tlabel: \"Example: ADHD Support\",\n\t\tfeatures: [\n\t\t\t\"reducedDistraction\",\n\t\t\t\"noFlashing\",\n\t\t\t\"pauseAnimation\",\n\t\t\t\"timingControl\",\n\t\t\t\"extendedTime\",\n\t\t\t\"highlighting\",\n\t\t\t\"annotations\",\n\t\t\t\"guidedNavigation\",\n\t\t\t\"structuralNavigation\",\n\t\t],\n\t},\n\n\t/**\n\t * Example: Student with motor limitations\n\t */\n\tmotorLimitations: {\n\t\tlabel: \"Example: Motor Limitations Support\",\n\t\tfeatures: [\n\t\t\t\"keyboardControl\",\n\t\t\t\"stickyKeys\",\n\t\t\t\"keyboardShortcuts\",\n\t\t\t\"voiceControl\",\n\t\t\t\"switchControl\",\n\t\t\t\"timingControl\",\n\t\t\t\"extendedTime\",\n\t\t\t\"unlimitedTime\",\n\t\t],\n\t},\n\n\t/**\n\t * Example: English language learner\n\t */\n\tenglishLearner: {\n\t\tlabel: \"Example: English Language Learner Support\",\n\t\tfeatures: [\n\t\t\t\"textToSpeech\",\n\t\t\t\"translatedText\",\n\t\t\t\"glossary\",\n\t\t\t\"simplifiedLanguage\",\n\t\t\t\"readAloud\",\n\t\t\t\"highlighting\",\n\t\t],\n\t},\n} as const;\n\n/**\n * Helper to validate if a feature ID is a standard QTI 3.0 feature\n */\nexport function isStandardAccessFeature(featureId: string): boolean {\n\treturn (ALL_STANDARD_ACCESS_FEATURES as readonly string[]).includes(\n\t\tfeatureId,\n\t);\n}\n\n/**\n * Helper to get category for a feature\n */\nexport function getFeatureCategory(\n\tfeatureId: string,\n): keyof typeof QTI_STANDARD_ACCESS_FEATURES | null {\n\tfor (const [category, features] of Object.entries(\n\t\tQTI_STANDARD_ACCESS_FEATURES,\n\t)) {\n\t\tif ((Object.values(features) as string[]).includes(featureId)) {\n\t\t\treturn category as keyof typeof QTI_STANDARD_ACCESS_FEATURES;\n\t\t}\n\t}\n\treturn null;\n}\n\n/**\n * Helper to get all features in a category\n */\nexport function getFeaturesInCategory(\n\tcategory: keyof typeof QTI_STANDARD_ACCESS_FEATURES,\n): string[] {\n\treturn Object.values(QTI_STANDARD_ACCESS_FEATURES[category]);\n}\n"]}
@@ -303,4 +303,3 @@ export interface SectionPersistenceFactoryDefaults {
303
303
  createDefaultPersistence: () => SectionSessionPersistenceStrategy | Promise<SectionSessionPersistenceStrategy>;
304
304
  }
305
305
  export {};
306
- //# sourceMappingURL=section-controller-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"section-controller-types.js","sourceRoot":"","sources":["../../src/services/section-controller-types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"section-controller-types.js","sourceRoot":"","sources":["../../src/services/section-controller-types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SectionControllerKey {\n\tassessmentId: string;\n\tsectionId: string;\n\tattemptId?: string;\n}\n\nexport interface SectionControllerContext {\n\tkey: SectionControllerKey;\n\tcoordinator: unknown;\n\tinput?: unknown;\n}\n\nexport interface SectionSessionPersistenceStrategy {\n\tloadSession(\n\t\tcontext: SectionControllerContext,\n\t): SectionControllerSessionState | null | Promise<SectionControllerSessionState | null>;\n\tsaveSession(\n\t\tcontext: SectionControllerContext,\n\t\tsession: SectionControllerSessionState | null,\n\t): void | Promise<void>;\n\tclearSession?(context: SectionControllerContext): void | Promise<void>;\n}\n\nexport interface SectionSessionPersistenceConfig {\n\tcontext: SectionControllerContext;\n\tstrategy: SectionSessionPersistenceStrategy;\n}\n\nexport interface SectionControllerApplySessionOptions {\n\t/**\n\t * applySession contract:\n\t * - Preferred input is the output of getSession().\n\t * - itemSessions may contain canonical attempt entries\n\t * ({ itemIdentifier, session, isCompleted }) or raw session payloads\n\t * ({ id, data, ... }); controller normalizes these before applying.\n\t */\n\tmode?: \"replace\" | \"merge\";\n}\n\nexport interface SectionControllerLoadedRenderable {\n\titemId: string;\n\tcanonicalItemId: string;\n\tcontentKind: \"item\" | \"passage\" | \"rubric\" | \"unknown\";\n}\n\nexport interface SectionControllerRuntimeState {\n\tsectionId: string;\n\tsectionIdentifier?: string;\n\tcurrentItemIndex: number;\n\tcurrentItemId: string;\n\titemIdentifiers: string[];\n\tvisitedItemIdentifiers: string[];\n\titemSessions: Record<string, unknown>;\n\tloadingComplete: boolean;\n\ttotalRegistered: number;\n\ttotalLoaded: number;\n\titemsComplete: boolean;\n\tcompletedCount: number;\n\ttotalItems: number;\n\t/**\n\t * Renderables (items, passages, rubrics) that have completed loading.\n\t *\n\t * Optional so synthetic test harnesses constructing a runtime state by\n\t * hand can omit it; production `SectionController.getRuntimeState` always\n\t * supplies it, which lets `ToolkitCoordinator` replay\n\t * `content-loaded` events to subscribers that attach after a renderable\n\t * has finished loading (e.g. cohort transitions in the assessment\n\t * runtime).\n\t *\n\t * Order is registration order, matching the order in which `content-loaded`\n\t * fires live; coordinator replay walks this list in-order so late\n\t * subscribers observe the same sequence a live subscriber would have seen.\n\t */\n\tloadedRenderables?: ReadonlyArray<SectionControllerLoadedRenderable>;\n}\n\nexport interface SectionControllerSessionState {\n\tcurrentItemIndex?: number;\n\tvisitedItemIdentifiers?: string[];\n\titemSessions: Record<string, unknown>;\n}\n\ntype SectionControllerEventBase = {\n\ttimestamp: number;\n};\n\nexport type SectionControllerItemSessionDataChangedEvent =\n\tSectionControllerEventBase & {\n\t\ttype: \"item-session-data-changed\";\n\t\titemId: string;\n\t\tcanonicalItemId: string;\n\t\tsession: unknown;\n\t\tintent?: string;\n\t\tcomplete?: boolean;\n\t\tcomponent?: string;\n\t\tcurrentItemIndex: number;\n\t};\n\nexport type SectionControllerItemSessionMetaChangedEvent =\n\tSectionControllerEventBase & {\n\t\ttype: \"item-session-meta-changed\";\n\t\titemId: string;\n\t\tcanonicalItemId: string;\n\t\tcomplete?: boolean;\n\t\tcomponent?: string;\n\t\tcurrentItemIndex: number;\n\t};\n\nexport type SectionControllerItemSelectedEvent = SectionControllerEventBase & {\n\ttype: \"item-selected\";\n\tpreviousItemId: string;\n\tcurrentItemId: string;\n\titemIndex: number;\n\ttotalItems: number;\n\tcurrentItemIndex: number;\n};\n\nexport type SectionControllerSectionNavigationChangedEvent =\n\tSectionControllerEventBase & {\n\t\ttype: \"section-navigation-change\";\n\t\tpreviousSectionId?: string;\n\t\tcurrentSectionId?: string;\n\t\tattemptId?: string;\n\t\treason?: \"input-change\" | \"runtime-transition\";\n\t};\n\nexport type SectionControllerSectionSessionAppliedEvent =\n\tSectionControllerEventBase & {\n\t\ttype: \"section-session-applied\";\n\t\tmode: \"replace\" | \"merge\";\n\t\titemSessionCount: number;\n\t\treplay: boolean;\n\t\tcurrentItemIndex: number;\n\t};\n\nexport type SectionControllerContentLoadedEvent = SectionControllerEventBase & {\n\ttype: \"content-loaded\";\n\tcontentKind: \"item\" | \"passage\" | \"rubric\" | \"unknown\";\n\titemId: string;\n\tcanonicalItemId: string;\n\tdetail?: unknown;\n\tcurrentItemIndex: number;\n};\n\nexport type SectionControllerItemPlayerErrorEvent = SectionControllerEventBase & {\n\ttype: \"item-player-error\";\n\tcontentKind: \"item\" | \"passage\" | \"rubric\" | \"unknown\";\n\titemId: string;\n\tcanonicalItemId: string;\n\terror: unknown;\n\tcurrentItemIndex: number;\n};\n\nexport type SectionControllerItemCompleteChangedEvent =\n\tSectionControllerEventBase & {\n\t\ttype: \"item-complete-changed\";\n\t\titemId: string;\n\t\tcanonicalItemId: string;\n\t\tcomplete: boolean;\n\t\tpreviousComplete: boolean;\n\t\tcurrentItemIndex: number;\n\t};\n\nexport type SectionControllerSectionLoadingCompleteEvent =\n\tSectionControllerEventBase & {\n\t\ttype: \"section-loading-complete\";\n\t\ttotalRegistered: number;\n\t\ttotalLoaded: number;\n\t\tcurrentItemIndex: number;\n\t};\n\nexport type SectionControllerSectionItemsCompleteChangedEvent =\n\tSectionControllerEventBase & {\n\t\ttype: \"section-items-complete-changed\";\n\t\tcomplete: boolean;\n\t\tcompletedCount: number;\n\t\ttotalItems: number;\n\t\tcurrentItemIndex: number;\n\t};\n\nexport type SectionControllerSectionErrorEvent = SectionControllerEventBase & {\n\ttype: \"section-error\";\n\tsource: \"item-player\" | \"section-runtime\" | \"toolkit\" | \"controller\";\n\terror: unknown;\n\titemId?: string;\n\tcanonicalItemId?: string;\n\tcontentKind?: \"item\" | \"passage\" | \"rubric\" | \"unknown\";\n\tcurrentItemIndex: number;\n};\n\nexport type SectionControllerEvent =\n\t| SectionControllerItemSessionDataChangedEvent\n\t| SectionControllerItemSessionMetaChangedEvent\n\t| SectionControllerItemSelectedEvent\n\t| SectionControllerSectionNavigationChangedEvent\n\t| SectionControllerSectionSessionAppliedEvent\n\t| SectionControllerContentLoadedEvent\n\t| SectionControllerItemPlayerErrorEvent\n\t| SectionControllerItemCompleteChangedEvent\n\t| SectionControllerSectionLoadingCompleteEvent\n\t| SectionControllerSectionItemsCompleteChangedEvent\n\t| SectionControllerSectionErrorEvent;\n\nexport type SectionControllerEventType = SectionControllerEvent[\"type\"];\n\n/**\n * Host-facing controller for a single section cohort.\n *\n * `SectionControllerHandle` is the primary API surface a host application\n * uses after the toolkit signals readiness (typically the `toolkit-ready`\n * DOM event followed by the first\n * `coordinator.getOrCreateSectionController(...)` resolve, or the convenience\n * `host.waitForSectionController(timeoutMs)` helper exposed by\n * `<pie-section-player*>`).\n *\n * The interface is the contract; the production implementation lives in\n * `packages/section-player/src/controllers/SectionController.ts`. Every\n * member is optional so the toolkit can call into older or partial\n * implementations defensively, but the production controller implements\n * all of them.\n *\n * Typical lifecycle for a host:\n *\n * ```ts\n * const controller = await host.waitForSectionController(5000);\n * controller?.configureSessionPersistence?.({ context, strategy });\n * await controller?.hydrate?.();\n * const unsubscribe = controller?.subscribe?.(handleEvent);\n * // ...later, on save / unload:\n * await controller?.persist?.();\n * unsubscribe?.();\n * ```\n */\nexport interface SectionControllerHandle {\n\t/**\n\t * Bootstrap the controller from composition input (section, view,\n\t * adapter item refs, etc.).\n\t *\n\t * Called by the section runtime when the section first mounts. Hosts\n\t * normally do not call this directly — the section player owns the\n\t * input shape and forwards it.\n\t */\n\tinitialize?(input?: unknown): void | Promise<void>;\n\t/**\n\t * Refresh composition input on a same-cohort change (PnP toggle,\n\t * prompt edit, accommodation flip, etc.) without resetting in-memory\n\t * session state.\n\t *\n\t * Treated as same-cohort when the section identity (`sectionId` /\n\t * `section.identifier`) is unchanged; cross-cohort changes are\n\t * handled by the coordinator creating a new controller instead.\n\t */\n\tupdateInput?(input?: unknown): void | Promise<void>;\n\t/**\n\t * Load and apply a previously persisted session via the strategy\n\t * registered through `configureSessionPersistence(...)`.\n\t *\n\t * No-op if no persistence strategy is configured or the strategy\n\t * returns no snapshot. Internally calls `applySession(snapshot,\n\t * { mode: \"replace\" })`.\n\t */\n\thydrate?(): void | Promise<void>;\n\t/**\n\t * Save the current session via the registered persistence strategy.\n\t *\n\t * Hosts call this on whatever cadence they choose (debounced on\n\t * change, on visibility change, on submit, etc.). No-op if no\n\t * strategy is configured.\n\t */\n\tpersist?(): void | Promise<void>;\n\t/**\n\t * Release listeners and lifecycle tracking. Called by the coordinator\n\t * when the controller's section cohort is being torn down. Hosts\n\t * usually do not call this directly.\n\t */\n\tdispose?(): void | Promise<void>;\n\t/**\n\t * Subscribe to the controller's typed event stream\n\t * (`SectionControllerEvent` discriminated union: `item-selected`,\n\t * `item-session-data-changed`, `content-loaded`,\n\t * `section-loading-complete`, `section-navigation-change`, etc.).\n\t *\n\t * Returns a disposer. The coordinator's\n\t * `subscribeSectionEvents` / `subscribeItemEvents` /\n\t * `subscribeSectionLifecycleEvents` helpers wrap this with\n\t * cohort-aware filtering and event-type defaults; hosts typically\n\t * use those instead of subscribing directly.\n\t */\n\tsubscribe?(listener: (event: SectionControllerEvent) => void): () => void;\n\t/**\n\t * Return a live snapshot of section-scoped runtime state — current\n\t * item, visited items, item sessions, loading + completion progress,\n\t * loaded renderables.\n\t *\n\t * Intended for runtime introspection (debug panels, diagnostics).\n\t * Use `getSession()` for the host-facing persistence shape.\n\t */\n\tgetRuntimeState?(): SectionControllerRuntimeState | null;\n\t/**\n\t * Return the host-facing persistence snapshot\n\t * (`SectionControllerSessionState`).\n\t *\n\t * This is the compact shape designed for serializing / restoring\n\t * across reloads — `currentItemIndex`, `visitedItemIdentifiers`, and\n\t * the item sessions map. The same shape is what\n\t * `SectionSessionPersistenceStrategy.saveSession` receives.\n\t */\n\tgetSession?(): SectionControllerSessionState | null;\n\t/**\n\t * Restore session state into the controller, replacing or merging\n\t * the in-memory state.\n\t *\n\t * - `mode: \"replace\"` (default for `hydrate()`): clear and apply.\n\t * - `mode: \"merge\"`: overlay onto existing state per item.\n\t *\n\t * Accepts the output of `getSession()` directly. Item sessions may\n\t * be canonical attempt entries or raw session payloads — the\n\t * controller normalizes both.\n\t */\n\tapplySession?(\n\t\tsession: SectionControllerSessionState | null,\n\t\toptions?: SectionControllerApplySessionOptions,\n\t): void | Promise<void>;\n\t/**\n\t * Apply a single item's session detail into the in-memory section\n\t * session, emitting the appropriate item-session event\n\t * (`item-session-data-changed` for response data,\n\t * `item-session-meta-changed` for metadata-only updates) so other\n\t * subscribers and the persistence strategy (on the next `persist()`)\n\t * see the update.\n\t *\n\t * Used for fine-grained host updates that should not require a full\n\t * `applySession(...)` round-trip.\n\t */\n\tupdateItemSession?(\n\t\titemId: string,\n\t\tsessionDetail: unknown,\n\t): unknown | Promise<unknown>;\n\t/**\n\t * Register the persistence context and strategy used by `hydrate()`\n\t * and `persist()`.\n\t *\n\t * Hosts typically call this once, immediately after obtaining the\n\t * handle, before invoking `hydrate()`. The same\n\t * `SectionControllerSessionState` shape returned by `getSession()`\n\t * is what the strategy load/save methods exchange.\n\t */\n\tconfigureSessionPersistence?(\n\t\tconfig: SectionSessionPersistenceConfig,\n\t): void | Promise<void>;\n}\n\nexport interface SectionControllerFactoryDefaults {\n\tcreateDefaultController: () =>\n\t\t| SectionControllerHandle\n\t\t| Promise<SectionControllerHandle>;\n}\n\nexport interface SectionPersistenceFactoryDefaults {\n\tcreateDefaultPersistence: () =>\n\t\t| SectionSessionPersistenceStrategy\n\t\t| Promise<SectionSessionPersistenceStrategy>;\n}\n"]}
@@ -18,4 +18,3 @@ export declare const PACKAGED_TOOL_PLACEMENT: {
18
18
  readonly rubric: readonly ["textToSpeech", "highlighter", "annotationToolbar", "lineReader"];
19
19
  readonly element: readonly ["calculator", "answerEliminator", "textToSpeech", "ruler", "protractor", "highlighter", "annotationToolbar", "graph", "periodicTable"];
20
20
  };
21
- //# sourceMappingURL=tool-config-defaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-config-defaults.js","sourceRoot":"","sources":["../../src/services/tool-config-defaults.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;CACF,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,IAAI,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,CAAC;IACpF,OAAO,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,CAAC;IAC3E,MAAM,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,CAAC;IAC1E,OAAO,EAAE;QACR,YAAY;QACZ,kBAAkB;QAClB,cAAc;QACd,OAAO;QACP,YAAY;QACZ,aAAa;QACb,mBAAmB;QACnB,OAAO;QACP,eAAe;KACf;CACQ,CAAC"}
1
+ {"version":3,"file":"tool-config-defaults.js","sourceRoot":"","sources":["../../src/services/tool-config-defaults.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;CACF,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,IAAI,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,CAAC;IACpF,OAAO,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,CAAC;IAC3E,MAAM,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,CAAC;IAC1E,OAAO,EAAE;QACR,YAAY;QACZ,kBAAkB;QAClB,cAAc;QACd,OAAO;QACP,YAAY;QACZ,aAAa;QACb,mBAAmB;QACnB,OAAO;QACP,eAAe;KACf;CACQ,CAAC","sourcesContent":["export const DEFAULT_TOOL_PLACEMENT = {\n\tassessment: [],\n\tsection: [],\n\titem: [],\n\tpassage: [],\n\trubric: [],\n\telement: [],\n} as const;\n\n/**\n * Complete placement preset for hosts that want to enable all packaged tools.\n * Prefer explicit host configuration over implicit defaults.\n */\nexport const PACKAGED_TOOL_PLACEMENT = {\n\tassessment: [\"theme\"],\n\tsection: [\"theme\"],\n\titem: [\"textToSpeech\", \"highlighter\", \"annotationToolbar\", \"graph\", \"periodicTable\"],\n\tpassage: [\"textToSpeech\", \"highlighter\", \"annotationToolbar\", \"lineReader\"],\n\trubric: [\"textToSpeech\", \"highlighter\", \"annotationToolbar\", \"lineReader\"],\n\telement: [\n\t\t\"calculator\",\n\t\t\"answerEliminator\",\n\t\t\"textToSpeech\",\n\t\t\"ruler\",\n\t\t\"protractor\",\n\t\t\"highlighter\",\n\t\t\"annotationToolbar\",\n\t\t\"graph\",\n\t\t\"periodicTable\",\n\t],\n} as const;\n"]}
@@ -4,7 +4,7 @@ import type { ToolRegistry } from "./ToolRegistry.js";
4
4
  export type ToolConfigStrictness = "off" | "warn" | "error";
5
5
  export type ToolConfigDiagnosticSeverity = "warning" | "error";
6
6
  export interface ToolConfigDiagnostic {
7
- code: "tools.unknownToolId" | "tools.unsupportedLevel" | "tools.unknownProviderKey" | "tools.deprecatedProviderKey" | "tools.providerSanitizeFailed" | "tools.providerValidateFailed" | "tools.invalidProviderValidation";
7
+ code: "tools.unknownToolId" | "tools.unsupportedLevel" | "tools.unknownProviderKey" | "tools.removedProviderKey" | "tools.providerSanitizeFailed" | "tools.providerValidateFailed" | "tools.invalidProviderValidation";
8
8
  severity: ToolConfigDiagnosticSeverity;
9
9
  path: string;
10
10
  message: string;
@@ -28,4 +28,3 @@ export declare function frameworkErrorFromToolConfigValidation(args: {
28
28
  }): FrameworkErrorModel;
29
29
  export declare function normalizeToolConfigStrictness(value: unknown): ToolConfigStrictness;
30
30
  export declare function normalizeAndValidateToolsConfig(input?: Partial<CanonicalToolsConfig> | null, options?: ToolConfigValidationOptions): ToolConfigValidationResult;
31
- //# sourceMappingURL=tool-config-validation.d.ts.map
@@ -161,10 +161,10 @@ function collectPolicyDiagnostics(config, toolMap, diagnostics) {
161
161
  }));
162
162
  }
163
163
  }
164
- function collectProviderKeyDiagnostics(config, toolMap, hasDeprecatedTtsKey, diagnostics) {
165
- if (hasDeprecatedTtsKey) {
164
+ function collectProviderKeyDiagnostics(config, toolMap, hasRemovedTtsKey, diagnostics) {
165
+ if (hasRemovedTtsKey) {
166
166
  diagnostics.push(createDiagnostic({
167
- code: "tools.deprecatedProviderKey",
167
+ code: "tools.removedProviderKey",
168
168
  severity: "error",
169
169
  path: "providers.tts",
170
170
  message: `Provider key "tts" is no longer supported. Use "providers.textToSpeech".`,
@@ -205,7 +205,7 @@ export function normalizeAndValidateToolsConfig(input, options = {}) {
205
205
  const registryTools = getRegistryToolMap(options.toolRegistry ?? createPackagedToolRegistry());
206
206
  const normalized = normalizeToolsConfig(input);
207
207
  const diagnostics = [];
208
- const hasDeprecatedTtsKey = Object.hasOwn(normalized.providers, "tts");
208
+ const hasRemovedTtsKey = Object.hasOwn(normalized.providers, "tts");
209
209
  const nextProviders = {
210
210
  ...(normalized.providers || {}),
211
211
  };
@@ -224,9 +224,9 @@ export function normalizeAndValidateToolsConfig(input, options = {}) {
224
224
  };
225
225
  collectPlacementDiagnostics(nextConfig, registryTools, diagnostics);
226
226
  collectPolicyDiagnostics(nextConfig, registryTools, diagnostics);
227
- collectProviderKeyDiagnostics(nextConfig, registryTools, hasDeprecatedTtsKey, diagnostics);
228
- if (hasDeprecatedTtsKey) {
229
- throwValidationError(diagnostics.filter((entry) => entry.code === "tools.deprecatedProviderKey"), source);
227
+ collectProviderKeyDiagnostics(nextConfig, registryTools, hasRemovedTtsKey, diagnostics);
228
+ if (hasRemovedTtsKey) {
229
+ throwValidationError(diagnostics.filter((entry) => entry.code === "tools.removedProviderKey"), source);
230
230
  }
231
231
  if (strictness === "warn") {
232
232
  emitWarnings(diagnostics, source);
@@ -1 +1 @@
1
- {"version":3,"file":"tool-config-validation.js","sourceRoot":"","sources":["../../src/services/tool-config-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,GAIpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,uCAAuC,EACvC,yBAAyB,GAEzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAiC5E,MAAM,UAAU,sCAAsC,CAAC,IAKtD;IAC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AAC;QAC3B,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,UAAU,KAAK,OAAO,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtD,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO;QACN,MAAM,EAAE,UAAU;QAClB,WAAW;KACX,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"tool-config-validation.js","sourceRoot":"","sources":["../../src/services/tool-config-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,GAKpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,uCAAuC,EACvC,yBAAyB,GAEzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAiC5E,MAAM,UAAU,sCAAsC,CAAC,IAKtD;IACA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpE,OAAO,uCAAuC,CAAC;YAC9C,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,yBAAyB,CAAC;QAChC,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,sBAAsB,CAAC;QACtD,WAAW,EAAE,IAAI,CAAC,WAAW;KAC7B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,kBAAkB,GAAyB,OAAO,CAAC;AAEzD,MAAM,UAAU,6BAA6B,CAC5C,KAAc;IAEd,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK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UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IACD,MAAM,UAAU,GAAyB;QACxC,GAAG,UAAU;QACb,SAAS,EAAE,aAAa;KACxB,CAAC;IAEF,2BAA2B,CAAC,UAAU,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;IACpE,wBAAwB,CAAC,UAAU,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;IACjE,6BAA6B,CAC5B,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,CACX,CAAC;IACF,IAAI,gBAAgB,EAAE,CAAC;QACtB,oBAAoB,CACnB,WAAW,CAAC,MAAM,CACjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,0BAA0B,CACpD,EACD,MAAM,CACN,CAAC;IACH,CAAC;IAED,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QAC3B,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,UAAU,KAAK,OAAO,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtD,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO;QACN,MAAM,EAAE,UAAU;QAClB,WAAW;KACX,CAAC;AACH,CAAC","sourcesContent":["import {\n\tnormalizeToolsConfig,\n\ttype CanonicalToolsConfig,\n\ttype ToolPlacementLevel,\n\ttype ToolProviderConfig,\n\ttype TextToSpeechToolProviderConfig,\n} from \"./tools-config-normalizer.js\";\nimport {\n\tframeworkErrorFromToolConfigDiagnostics,\n\tframeworkErrorFromUnknown,\n\ttype FrameworkErrorModel,\n} from \"./framework-error.js\";\nimport type { ToolRegistration, ToolRegistry } from \"./ToolRegistry.js\";\nimport { createPackagedToolRegistry } from \"./createDefaultToolRegistry.js\";\n\nexport type ToolConfigStrictness = \"off\" | \"warn\" | \"error\";\n\nexport type ToolConfigDiagnosticSeverity = \"warning\" | \"error\";\n\nexport interface ToolConfigDiagnostic {\n\tcode:\n\t\t| \"tools.unknownToolId\"\n\t\t| \"tools.unsupportedLevel\"\n\t\t| \"tools.unknownProviderKey\"\n\t\t| \"tools.removedProviderKey\"\n\t\t| \"tools.providerSanitizeFailed\"\n\t\t| \"tools.providerValidateFailed\"\n\t\t| \"tools.invalidProviderValidation\";\n\tseverity: ToolConfigDiagnosticSeverity;\n\tpath: string;\n\tmessage: string;\n\ttoolId?: string;\n\tproviderId?: string;\n}\n\nexport interface ToolConfigValidationOptions {\n\tstrictness?: ToolConfigStrictness;\n\tsource?: string;\n\ttoolRegistry?: ToolRegistry | null;\n}\n\nexport interface ToolConfigValidationResult {\n\tconfig: CanonicalToolsConfig;\n\tdiagnostics: ToolConfigDiagnostic[];\n}\n\nexport function frameworkErrorFromToolConfigValidation(args: {\n\tsource: string;\n\tdiagnostics?: ToolConfigDiagnostic[] | null;\n\terror?: unknown;\n\trecoverable?: boolean;\n}): FrameworkErrorModel {\n\tif (Array.isArray(args.diagnostics) && args.diagnostics.length > 0) {\n\t\treturn frameworkErrorFromToolConfigDiagnostics({\n\t\t\tsource: args.source,\n\t\t\tdiagnostics: args.diagnostics,\n\t\t\trecoverable: args.recoverable,\n\t\t});\n\t}\n\treturn frameworkErrorFromUnknown({\n\t\tkind: \"tool-config\",\n\t\tsource: args.source,\n\t\terror: args.error ?? new Error(\"Invalid tools config\"),\n\t\trecoverable: args.recoverable,\n\t});\n}\n\nconst DEFAULT_STRICTNESS: ToolConfigStrictness = \"error\";\n\nexport function normalizeToolConfigStrictness(\n\tvalue: unknown,\n): ToolConfigStrictness {\n\tif (value === \"off\" || value === \"warn\" || value === \"error\") {\n\t\treturn value;\n\t}\n\treturn DEFAULT_STRICTNESS;\n}\n\nfunction createDiagnostic(\n\tdiagnostic: ToolConfigDiagnostic,\n): ToolConfigDiagnostic {\n\treturn diagnostic;\n}\n\nfunction getRegistryToolMap(\n\ttoolRegistry: ToolRegistry | null | undefined,\n): Map<string, ToolRegistration> {\n\tif (!toolRegistry) return new Map();\n\treturn new Map(\n\t\ttoolRegistry\n\t\t\t.getAllTools()\n\t\t\t.slice()\n\t\t\t.sort((left, right) => left.toolId.localeCompare(right.toolId))\n\t\t\t.map((tool) => [tool.toolId, tool]),\n\t);\n}\n\nfunction sanitizeProviderConfig(\n\tproviderId: string,\n\tproviderConfig: ToolProviderConfig | TextToSpeechToolProviderConfig | undefined,\n\ttool: ToolRegistration | undefined,\n\tdiagnostics: ToolConfigDiagnostic[],\n): ToolProviderConfig | TextToSpeechToolProviderConfig | undefined {\n\tif (!providerConfig || !tool?.provider?.sanitizeConfig) return providerConfig;\n\ttry {\n\t\tconst sanitized = tool.provider.sanitizeConfig(\n\t\t\tproviderConfig as ToolProviderConfig,\n\t\t);\n\t\tif (!sanitized || typeof sanitized !== \"object\" || Array.isArray(sanitized)) {\n\t\t\tdiagnostics.push(\n\t\t\t\tcreateDiagnostic({\n\t\t\t\t\tcode: \"tools.providerSanitizeFailed\",\n\t\t\t\t\tseverity: \"error\",\n\t\t\t\t\tpath: `providers.${providerId}`,\n\t\t\t\t\tmessage: `Provider sanitizer for \"${providerId}\" must return an object.`,\n\t\t\t\t\tproviderId,\n\t\t\t\t\ttoolId: providerId,\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn providerConfig;\n\t\t}\n\t\treturn sanitized as ToolProviderConfig | TextToSpeechToolProviderConfig;\n\t} catch (error) {\n\t\tdiagnostics.push(\n\t\t\tcreateDiagnostic({\n\t\t\t\tcode: \"tools.providerSanitizeFailed\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tpath: `providers.${providerId}`,\n\t\t\t\tmessage: `Provider sanitizer failed for \"${providerId}\": ${\n\t\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t\t}`,\n\t\t\t\tproviderId,\n\t\t\t\ttoolId: providerId,\n\t\t\t}),\n\t\t);\n\t\treturn providerConfig;\n\t}\n}\n\nfunction validateProviderConfig(\n\tproviderId: string,\n\tproviderConfig: ToolProviderConfig | TextToSpeechToolProviderConfig | undefined,\n\ttool: ToolRegistration | undefined,\n\tdiagnostics: ToolConfigDiagnostic[],\n): void {\n\tif (!providerConfig || !tool?.provider?.validateConfig) return;\n\ttry {\n\t\tconst providerDiagnostics = tool.provider.validateConfig(\n\t\t\tproviderConfig as ToolProviderConfig,\n\t\t);\n\t\tif (!Array.isArray(providerDiagnostics)) {\n\t\t\tdiagnostics.push(\n\t\t\t\tcreateDiagnostic({\n\t\t\t\t\tcode: \"tools.invalidProviderValidation\",\n\t\t\t\t\tseverity: \"error\",\n\t\t\t\t\tpath: `providers.${providerId}`,\n\t\t\t\t\tmessage: `Provider validator for \"${providerId}\" must return an array.`,\n\t\t\t\t\tproviderId,\n\t\t\t\t\ttoolId: providerId,\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tfor (const diagnostic of providerDiagnostics) {\n\t\t\tdiagnostics.push({\n\t\t\t\t...diagnostic,\n\t\t\t\tpath: diagnostic.path || `providers.${providerId}`,\n\t\t\t\tproviderId: diagnostic.providerId || providerId,\n\t\t\t\ttoolId: diagnostic.toolId || providerId,\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tdiagnostics.push(\n\t\t\tcreateDiagnostic({\n\t\t\t\tcode: \"tools.providerValidateFailed\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tpath: `providers.${providerId}`,\n\t\t\t\tmessage: `Provider validator failed for \"${providerId}\": ${\n\t\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t\t}`,\n\t\t\t\tproviderId,\n\t\t\t\ttoolId: providerId,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nfunction collectPlacementDiagnostics(\n\tconfig: CanonicalToolsConfig,\n\ttoolMap: Map<string, ToolRegistration>,\n\tdiagnostics: ToolConfigDiagnostic[],\n): void {\n\tif (toolMap.size === 0) return;\n\tconst levelOrder: ToolPlacementLevel[] = [\"section\", \"item\", \"passage\"];\n\tfor (const level of levelOrder) {\n\t\tfor (const toolId of config.placement[level]) {\n\t\t\tconst tool = toolMap.get(toolId);\n\t\t\tif (!tool) {\n\t\t\t\tdiagnostics.push(\n\t\t\t\t\tcreateDiagnostic({\n\t\t\t\t\t\tcode: \"tools.unknownToolId\",\n\t\t\t\t\t\tseverity: \"error\",\n\t\t\t\t\t\tpath: `placement.${level}`,\n\t\t\t\t\t\tmessage: `Unknown tool id \"${toolId}\" in placement.${level}.`,\n\t\t\t\t\t\ttoolId,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst supportsLevel = tool.supportedLevels.includes(level);\n\t\t\t// Leniency policy: section-capable tools are tolerated in item placement.\n\t\t\t// This avoids strict failures for common host config patterns while still\n\t\t\t// enforcing upward-invalid placements (for example item-only -> section).\n\t\t\tconst allowSectionToolInItemPlacement =\n\t\t\t\tlevel === \"item\" && tool.supportedLevels.includes(\"section\");\n\t\t\tif (!supportsLevel && !allowSectionToolInItemPlacement) {\n\t\t\t\tdiagnostics.push(\n\t\t\t\t\tcreateDiagnostic({\n\t\t\t\t\t\tcode: \"tools.unsupportedLevel\",\n\t\t\t\t\t\tseverity: \"error\",\n\t\t\t\t\t\tpath: `placement.${level}`,\n\t\t\t\t\t\tmessage: `Tool \"${toolId}\" does not support level \"${level}\".`,\n\t\t\t\t\t\ttoolId,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction collectPolicyDiagnostics(\n\tconfig: CanonicalToolsConfig,\n\ttoolMap: Map<string, ToolRegistration>,\n\tdiagnostics: ToolConfigDiagnostic[],\n): void {\n\tif (toolMap.size === 0) return;\n\tfor (const toolId of config.policy.allowed || []) {\n\t\tif (toolMap.has(toolId)) continue;\n\t\tdiagnostics.push(\n\t\t\tcreateDiagnostic({\n\t\t\t\tcode: \"tools.unknownToolId\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tpath: \"policy.allowed\",\n\t\t\t\tmessage: `Unknown tool id \"${toolId}\" in policy.allowed.`,\n\t\t\t\ttoolId,\n\t\t\t}),\n\t\t);\n\t}\n\tfor (const toolId of config.policy.blocked || []) {\n\t\tif (toolMap.has(toolId)) continue;\n\t\tdiagnostics.push(\n\t\t\tcreateDiagnostic({\n\t\t\t\tcode: \"tools.unknownToolId\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tpath: \"policy.blocked\",\n\t\t\t\tmessage: `Unknown tool id \"${toolId}\" in policy.blocked.`,\n\t\t\t\ttoolId,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nfunction collectProviderKeyDiagnostics(\n\tconfig: CanonicalToolsConfig,\n\ttoolMap: Map<string, ToolRegistration>,\n\thasRemovedTtsKey: boolean,\n\tdiagnostics: ToolConfigDiagnostic[],\n): void {\n\tif (hasRemovedTtsKey) {\n\t\tdiagnostics.push(\n\t\t\tcreateDiagnostic({\n\t\t\t\tcode: \"tools.removedProviderKey\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tpath: \"providers.tts\",\n\t\t\t\tmessage:\n\t\t\t\t\t`Provider key \"tts\" is no longer supported. Use \"providers.textToSpeech\".`,\n\t\t\t\tproviderId: \"tts\",\n\t\t\t\ttoolId: \"textToSpeech\",\n\t\t\t}),\n\t\t);\n\t}\n\tfor (const providerId of Object.keys(config.providers).sort()) {\n\t\tif (toolMap.size === 0 || toolMap.has(providerId)) continue;\n\t\tdiagnostics.push(\n\t\t\tcreateDiagnostic({\n\t\t\t\tcode: \"tools.unknownProviderKey\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tpath: `providers.${providerId}`,\n\t\t\t\tmessage: `Unknown provider key \"${providerId}\".`,\n\t\t\t\tproviderId,\n\t\t\t\ttoolId: providerId,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nfunction emitWarnings(\n\tdiagnostics: ToolConfigDiagnostic[],\n\tsource: string,\n): void {\n\tif (diagnostics.length === 0) return;\n\tfor (const diagnostic of diagnostics) {\n\t\tconst prefix = `[tool-config-validation:${source}]`;\n\t\tconsole.warn(`${prefix} ${diagnostic.path} - ${diagnostic.message}`);\n\t}\n}\n\nfunction throwValidationError(\n\tdiagnostics: ToolConfigDiagnostic[],\n\tsource: string,\n): never {\n\tconst formatted = diagnostics\n\t\t.map((diagnostic) => `- ${diagnostic.path}: ${diagnostic.message}`)\n\t\t.join(\"\\n\");\n\tthrow new Error(`[tool-config-validation:${source}] Invalid tools config:\\n${formatted}`);\n}\n\nexport function normalizeAndValidateToolsConfig(\n\tinput?: Partial<CanonicalToolsConfig> | null,\n\toptions: ToolConfigValidationOptions = {},\n): ToolConfigValidationResult {\n\tconst strictness = normalizeToolConfigStrictness(options.strictness);\n\tconst source = options.source ?? \"tools\";\n\tconst registryTools = getRegistryToolMap(\n\t\toptions.toolRegistry ?? createPackagedToolRegistry(),\n\t);\n\tconst normalized = normalizeToolsConfig(input);\n\tconst diagnostics: ToolConfigDiagnostic[] = [];\n\tconst hasRemovedTtsKey = Object.hasOwn(\n\t\tnormalized.providers,\n\t\t\"tts\",\n\t);\n\n\tconst nextProviders: CanonicalToolsConfig[\"providers\"] = {\n\t\t...(normalized.providers || {}),\n\t};\n\tfor (const providerId of Object.keys(nextProviders).sort()) {\n\t\tif (providerId === \"tts\") {\n\t\t\tdelete nextProviders.tts;\n\t\t\tcontinue;\n\t\t}\n\t\tconst tool = registryTools.get(providerId);\n\t\tnextProviders[providerId] = sanitizeProviderConfig(\n\t\t\tproviderId,\n\t\t\tnextProviders[providerId],\n\t\t\ttool,\n\t\t\tdiagnostics,\n\t\t);\n\t\tvalidateProviderConfig(providerId, nextProviders[providerId], tool, diagnostics);\n\t}\n\tconst nextConfig: CanonicalToolsConfig = {\n\t\t...normalized,\n\t\tproviders: nextProviders,\n\t};\n\n\tcollectPlacementDiagnostics(nextConfig, registryTools, diagnostics);\n\tcollectPolicyDiagnostics(nextConfig, registryTools, diagnostics);\n\tcollectProviderKeyDiagnostics(\n\t\tnextConfig,\n\t\tregistryTools,\n\t\thasRemovedTtsKey,\n\t\tdiagnostics,\n\t);\n\tif (hasRemovedTtsKey) {\n\t\tthrowValidationError(\n\t\t\tdiagnostics.filter(\n\t\t\t\t(entry) => entry.code === \"tools.removedProviderKey\",\n\t\t\t),\n\t\t\tsource,\n\t\t);\n\t}\n\n\tif (strictness === \"warn\") {\n\t\temitWarnings(diagnostics, source);\n\t}\n\tif (strictness === \"error\" && diagnostics.length > 0) {\n\t\tthrowValidationError(diagnostics, source);\n\t}\n\n\treturn {\n\t\tconfig: nextConfig,\n\t\tdiagnostics,\n\t};\n}\n"]}
@@ -147,4 +147,3 @@ export declare function hasReadableText(context: ToolContext): boolean;
147
147
  * (Basic heuristic - can be overridden by tools)
148
148
  */
149
149
  export declare function hasScienceContent(context: ToolContext): boolean;
150
- //# sourceMappingURL=tool-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-context.js","sourceRoot":"","sources":["../../src/services/tool-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4IH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAClC,OAAoB;IAEpB,OAAO,OAAO,CAAC,KAAK,KAAK,YAAY,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC/B,OAAoB;IAEpB,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC5B,OAAoB;IAEpB,OAAO,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC/B,OAAoB;IAEpB,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC9B,OAAoB;IAEpB,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU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OAAO,KAAK,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,OAAoB;IACnD,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACzC,iEAAiE;IACjE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAoB;IACrD,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEzC,qCAAqC;IACrC,MAAM,iBAAiB,GAAG;QACzB,oDAAoD;QACpD,mBAAmB;QACnB,qBAAqB,EAAE,oBAAoB;QAC3C,oBAAoB,EAAE,oCAAoC;QAC1D,wCAAwC;QACxC,6CAA6C;KAC7C,CAAC;IAEF,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["/**\n * Tool Context Types\n *\n * Defines the context types passed to tools for making visibility and behavior decisions.\n * Each context level provides increasingly specific information about where the tool is being used.\n */\n\nimport type {\n\tAssessmentEntity,\n\tAssessmentItemRef,\n\tAssessmentSection,\n\tItemEntity,\n\tPassageEntity,\n\tRubricBlock,\n} from \"@pie-players/pie-players-shared/types\";\n\n/**\n * Tool placement levels - where a tool can appear in the UI\n */\nexport type ToolLevel =\n\t| \"assessment\" // Assessment-wide tools (e.g., global calculator)\n\t| \"section\" // Section toolbar tools\n\t| \"item\" // Item-level tools (question toolbar)\n\t| \"passage\" // Passage header tools (stimulus rubric blocks)\n\t| \"rubric\" // Rubric block tools (instructions, rubrics)\n\t| \"element\"; // Element-specific tools (inline with interaction)\n\n/**\n * Base context available to all tools\n */\nexport interface BaseToolContext {\n\t/** The level at which this tool is being evaluated */\n\tlevel: ToolLevel;\n\n\t/** The full assessment entity */\n\tassessment: AssessmentEntity;\n\n\t/** Current section, if applicable */\n\tsection?: AssessmentSection;\n\n\t/** Reference to the current item (always available except at assessment level) */\n\titemRef?: AssessmentItemRef;\n\n\t/** DOM container where the tool will be rendered */\n\tcontainer?: HTMLElement;\n}\n\n/**\n * Context for assessment-level tools\n */\nexport interface AssessmentToolContext extends BaseToolContext {\n\tlevel: \"assessment\";\n}\n\n/**\n * Context for section-level tools\n */\nexport interface SectionToolContext extends BaseToolContext {\n\tlevel: \"section\";\n\tsection: AssessmentSection;\n}\n\n/**\n * Context for item-level tools (question toolbar)\n */\nexport interface ItemToolContext extends BaseToolContext {\n\tlevel: \"item\";\n\titemRef: AssessmentItemRef;\n\titem: ItemEntity;\n\n\t/** Passage entity if this item is associated with a passage */\n\tpassage?: PassageEntity;\n}\n\n/**\n * Context for passage-level tools (passage header)\n *\n * Passages can appear as:\n * - Standalone passage entities associated with items\n * - RubricBlock with class=\"stimulus\" containing embedded passage\n */\nexport interface PassageToolContext extends BaseToolContext {\n\tlevel: \"passage\";\n\titemRef?: AssessmentItemRef;\n\tpassage: PassageEntity;\n\n\t/** Items associated with this passage (if applicable) */\n\titems?: ItemEntity[];\n\n\t/** RubricBlock containing this passage (if from rubric) */\n\trubricBlock?: RubricBlock;\n}\n\n/**\n * Context for rubric block tools\n *\n * RubricBlocks can contain:\n * - Instructions (class=\"instructions\")\n * - Rubrics (class=\"rubric\")\n * - Stimulus/passages (class=\"stimulus\" with embedded passage)\n * - Simple HTML content\n */\nexport interface RubricToolContext extends BaseToolContext {\n\tlevel: \"rubric\";\n\trubricBlock: RubricBlock;\n\n\t/** Section containing this rubric block */\n\tsection: AssessmentSection;\n\n\t/** If rubric contains a passage (class=\"stimulus\") */\n\tpassage?: PassageEntity;\n}\n\n/**\n * Context for element-level tools (inline with interaction)\n *\n * Note: Element-level context uses the PIE interaction element ID\n * and provides access to the full item config for content inspection.\n */\nexport interface ElementToolContext extends BaseToolContext {\n\tlevel: \"element\";\n\titemRef: AssessmentItemRef;\n\titem: ItemEntity;\n\n\t/** The PIE element/interaction ID */\n\telementId: string;\n\n\t/** Passage entity if this item is associated with a passage */\n\tpassage?: PassageEntity;\n\n\t/** DOM element that triggered the tool (e.g., the specific input field) */\n\ttriggerElement?: HTMLElement;\n}\n\n/**\n * Union type of all tool contexts\n */\nexport type ToolContext =\n\t| AssessmentToolContext\n\t| SectionToolContext\n\t| ItemToolContext\n\t| PassageToolContext\n\t| RubricToolContext\n\t| ElementToolContext;\n\n/**\n * Type guard to check if context is at assessment level\n */\nexport function isAssessmentContext(\n\tcontext: ToolContext,\n): context is AssessmentToolContext {\n\treturn context.level === \"assessment\";\n}\n\n/**\n * Type guard to check if context is at section level\n */\nexport function isSectionContext(\n\tcontext: ToolContext,\n): context is SectionToolContext {\n\treturn context.level === \"section\";\n}\n\n/**\n * Type guard to check if context is at item level\n */\nexport function isItemContext(\n\tcontext: ToolContext,\n): context is ItemToolContext {\n\treturn context.level === \"item\";\n}\n\n/**\n * Type guard to check if context is at passage level\n */\nexport function isPassageContext(\n\tcontext: ToolContext,\n): context is PassageToolContext {\n\treturn context.level === \"passage\";\n}\n\n/**\n * Type guard to check if context is at rubric level\n */\nexport function isRubricContext(\n\tcontext: ToolContext,\n): context is RubricToolContext {\n\treturn context.level === \"rubric\";\n}\n\n/**\n * Type guard to check if context is at element level\n */\nexport function isElementContext(\n\tcontext: ToolContext,\n): context is ElementToolContext {\n\treturn context.level === \"element\";\n}\n\n/**\n * Helper to extract text content from an item or element for analysis\n */\nexport function extractTextContent(context: ToolContext): string {\n\tif (isElementContext(context)) {\n\t\tconst config = context.item.config;\n\t\tif (!config) return \"\";\n\t\tconst textChunks: string[] = [];\n\t\tconst stripHtml = (value: string) => value.replace(/<[^>]*>/g, \" \").trim();\n\n\t\t// Try to find element markup by element id.\n\t\tconst elementMarkup = config.elements?.[context.elementId];\n\t\tif (elementMarkup) {\n\t\t\tif (typeof elementMarkup === \"string\") {\n\t\t\t\ttextChunks.push(stripHtml(elementMarkup));\n\t\t\t}\n\t\t}\n\n\t\t// Also inspect model data keyed by this element id.\n\t\t// In many items, math appears in model.prompt/labels rather than elements[elementId].\n\t\tconst modelsRaw = config.models;\n\t\tconst models = Array.isArray(modelsRaw)\n\t\t\t? modelsRaw\n\t\t\t: modelsRaw && typeof modelsRaw === \"object\"\n\t\t\t\t? Object.values(modelsRaw as Record<string, unknown>)\n\t\t\t\t: [];\n\t\tconst model = models.find(\n\t\t\t(m: any) => m && typeof m === \"object\" && m.id === context.elementId,\n\t\t) as Record<string, unknown> | undefined;\n\t\tif (model) {\n\t\t\tfor (const value of Object.values(model)) {\n\t\t\t\tif (typeof value === \"string\") {\n\t\t\t\t\ttextChunks.push(stripHtml(value));\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (const entry of value) {\n\t\t\t\t\t\tif (entry && typeof entry === \"object\") {\n\t\t\t\t\t\t\tfor (const nested of Object.values(\n\t\t\t\t\t\t\t\tentry as Record<string, unknown>,\n\t\t\t\t\t\t\t)) {\n\t\t\t\t\t\t\t\tif (typeof nested === \"string\") {\n\t\t\t\t\t\t\t\t\ttextChunks.push(stripHtml(nested));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn textChunks.filter(Boolean).join(\" \").trim();\n\t}\n\n\tif (isItemContext(context)) {\n\t\tconst item = context.item;\n\t\tif (!item?.config) return \"\";\n\n\t\tconst config = item.config as Record<string, unknown>;\n\t\tconst textChunks: string[] = [];\n\t\tconst stripHtml = (value: string) => value.replace(/<[^>]*>/g, \" \").trim();\n\n\t\t// Primary item markup\n\t\tif (typeof config.markup === \"string\") {\n\t\t\ttextChunks.push(stripHtml(config.markup));\n\t\t}\n\n\t\t// Element markup snippets\n\t\tconst elements = config.elements as Record<string, unknown> | undefined;\n\t\tif (elements && typeof elements === \"object\") {\n\t\t\tfor (const elementMarkup of Object.values(elements)) {\n\t\t\t\tif (typeof elementMarkup === \"string\") {\n\t\t\t\t\ttextChunks.push(stripHtml(elementMarkup));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Model-level text (prompts, labels, etc.)\n\t\tconst modelsRaw = config.models;\n\t\tconst models = Array.isArray(modelsRaw)\n\t\t\t? modelsRaw\n\t\t\t: modelsRaw && typeof modelsRaw === \"object\"\n\t\t\t\t? Object.values(modelsRaw as Record<string, unknown>)\n\t\t\t\t: [];\n\t\tfor (const model of models) {\n\t\t\tif (!model || typeof model !== \"object\") continue;\n\t\t\tfor (const value of Object.values(model as Record<string, unknown>)) {\n\t\t\t\tif (typeof value === \"string\") {\n\t\t\t\t\ttextChunks.push(stripHtml(value));\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (const entry of value) {\n\t\t\t\t\t\tif (entry && typeof entry === \"object\") {\n\t\t\t\t\t\t\tfor (const nested of Object.values(\n\t\t\t\t\t\t\t\tentry as Record<string, unknown>,\n\t\t\t\t\t\t\t)) {\n\t\t\t\t\t\t\t\tif (typeof nested === \"string\") {\n\t\t\t\t\t\t\t\t\ttextChunks.push(stripHtml(nested));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn textChunks.filter(Boolean).join(\" \").trim();\n\t}\n\n\tif (isPassageContext(context)) {\n\t\tconst passage = context.passage;\n\t\tif (!passage?.config) return \"\";\n\n\t\tconst config = passage.config as Record<string, unknown>;\n\t\tconst textChunks: string[] = [];\n\t\tconst stripHtml = (value: string) => value.replace(/<[^>]*>/g, \" \").trim();\n\n\t\t// Primary passage markup/content\n\t\tif (typeof config.markup === \"string\") {\n\t\t\ttextChunks.push(stripHtml(config.markup));\n\t\t}\n\t\tif (typeof config.content === \"string\") {\n\t\t\ttextChunks.push(stripHtml(config.content));\n\t\t}\n\t\tif (typeof config.prompt === \"string\") {\n\t\t\ttextChunks.push(stripHtml(config.prompt));\n\t\t}\n\n\t\t// Element markup snippets\n\t\tconst elements = config.elements as Record<string, unknown> | undefined;\n\t\tif (elements && typeof elements === \"object\") {\n\t\t\tfor (const elementMarkup of Object.values(elements)) {\n\t\t\t\tif (typeof elementMarkup === \"string\") {\n\t\t\t\t\ttextChunks.push(stripHtml(elementMarkup));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Model-level text (prompts, labels, etc.)\n\t\tconst modelsRaw = config.models;\n\t\tconst models = Array.isArray(modelsRaw)\n\t\t\t? modelsRaw\n\t\t\t: modelsRaw && typeof modelsRaw === \"object\"\n\t\t\t\t? Object.values(modelsRaw as Record<string, unknown>)\n\t\t\t\t: [];\n\t\tfor (const model of models) {\n\t\t\tif (!model || typeof model !== \"object\") continue;\n\t\t\tfor (const value of Object.values(model as Record<string, unknown>)) {\n\t\t\t\tif (typeof value === \"string\") {\n\t\t\t\t\ttextChunks.push(stripHtml(value));\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (const entry of value) {\n\t\t\t\t\t\tif (entry && typeof entry === \"object\") {\n\t\t\t\t\t\t\tfor (const nested of Object.values(\n\t\t\t\t\t\t\t\tentry as Record<string, unknown>,\n\t\t\t\t\t\t\t)) {\n\t\t\t\t\t\t\t\tif (typeof nested === \"string\") {\n\t\t\t\t\t\t\t\t\ttextChunks.push(stripHtml(nested));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn textChunks.filter(Boolean).join(\" \").trim();\n\t}\n\n\tif (isRubricContext(context)) {\n\t\tconst rubric = context.rubricBlock;\n\n\t\t// If rubric has embedded passage, extract from passage config\n\t\tif (rubric.passage?.config) {\n\t\t\tconst markup = rubric.passage.config.markup || \"\";\n\t\t\treturn markup.replace(/<[^>]*>/g, \" \").trim();\n\t\t}\n\n\t\t// Otherwise, use simple content string\n\t\tconst content = rubric.content || \"\";\n\t\treturn content.replace(/<[^>]*>/g, \" \").trim();\n\t}\n\n\treturn \"\";\n}\n\n/**\n * Helper to check if context contains mathematical content\n * (Basic heuristic - can be overridden by tools)\n */\nexport function hasMathContent(context: ToolContext): boolean {\n\tconst text = extractTextContent(context);\n\n\t// Look for common math indicators\n\tconst mathIndicators = [\n\t\t/<math[>\\s]/i, // MathML\n\t\t/\\\\\\[([^\\]]+)\\\\\\]/, // LaTeX display math\n\t\t/\\$\\$[^$]+\\$\\$/, // LaTeX display math ($$...$$)\n\t\t/\\\\\\(/, // LaTeX inline math\n\t\t/[+\\-*/=<>≤≥∑∫√π]/, // Math symbols\n\t\t/\\d+\\s*[+\\-*/=]\\s*\\d+/, // Simple arithmetic\n\t];\n\n\treturn mathIndicators.some((pattern) => pattern.test(text));\n}\n\n/**\n * Helper to check if context contains choice-based interactions\n */\nexport function hasChoiceInteraction(context: ToolContext): boolean {\n\tconst interactionTypes = [\n\t\t\"pie-multiple-choice\",\n\t\t\"pie-inline-choice\",\n\t\t\"pie-select-text\",\n\t\t\"multiple-choice\",\n\t\t\"inline-choice\",\n\t\t\"select-text\",\n\t];\n\n\tif (isElementContext(context)) {\n\t\tconst config = context.item.config;\n\t\tif (!config?.models) return false;\n\n\t\t// Find model for this element\n\t\tconst models = Array.isArray(config.models)\n\t\t\t? config.models\n\t\t\t: Object.values(config.models as Record<string, unknown>);\n\t\tconst model = models.find(\n\t\t\t(m: any) => m && typeof m === \"object\" && m.id === context.elementId,\n\t\t);\n\t\tif (!model) return false;\n\n\t\tconst type = (model as any).element || \"\";\n\t\treturn interactionTypes.includes(type);\n\t}\n\n\tif (isItemContext(context)) {\n\t\tconst modelsRaw = context.item.config?.models;\n\t\tconst models = Array.isArray(modelsRaw)\n\t\t\t? modelsRaw\n\t\t\t: modelsRaw && typeof modelsRaw === \"object\"\n\t\t\t\t? Object.values(modelsRaw as Record<string, unknown>)\n\t\t\t\t: [];\n\t\treturn models.some((m: any) => {\n\t\t\tif (!m || typeof m !== \"object\") return false;\n\t\t\tconst type = m.element || \"\";\n\t\t\tif (interactionTypes.includes(type)) return true;\n\t\t\t// Fallback for configs that don't provide canonical element names.\n\t\t\treturn Array.isArray(m.choices) && m.choices.length > 0;\n\t\t});\n\t}\n\n\treturn false;\n}\n\n/**\n * Helper to check if context contains text that can be read aloud\n */\nexport function hasReadableText(context: ToolContext): boolean {\n\tconst text = extractTextContent(context);\n\t// Must have at least 10 characters of text (arbitrary threshold)\n\treturn text.trim().length >= 10;\n}\n\n/**\n * Helper to check if context contains science content\n * (Basic heuristic - can be overridden by tools)\n */\nexport function hasScienceContent(context: ToolContext): boolean {\n\tconst text = extractTextContent(context);\n\n\t// Look for common science indicators\n\tconst scienceIndicators = [\n\t\t/chemistry|chemical|element|atom|molecule|compound/i,\n\t\t/periodic\\s+table/i,\n\t\t/H₂O|CO₂|NaCl|O₂|N₂/i, // Chemical formulas\n\t\t/\\b[A-Z][a-z]?\\d*\\b/, // Element symbols (H, He, Li, etc.)\n\t\t/biology|organism|cell|DNA|RNA|protein/i,\n\t\t/physics|force|energy|velocity|acceleration/i,\n\t];\n\n\treturn scienceIndicators.some((pattern) => pattern.test(text));\n}\n"]}
@@ -12,4 +12,3 @@ export declare function isRegisteredToolScopeLevel(scopeLevel: string): scopeLev
12
12
  export declare function createScopedToolId(baseToolId: string, scopeLevel: ToolScopeLevel, scopeId: string): string;
13
13
  export declare function parseScopedToolId(id: string): ParsedToolInstanceId | null;
14
14
  export declare function toOverlayToolId(id: string): string;
15
- //# sourceMappingURL=tool-instance-id.d.ts.map
@@ -32,7 +32,7 @@ export function createScopedToolId(baseToolId, scopeLevel, scopeId) {
32
32
  }
33
33
  export function parseScopedToolId(id) {
34
34
  const parts = id.split(":");
35
- if (parts.length !== 3 && parts.length !== 4)
35
+ if (parts.length !== 3)
36
36
  return null;
37
37
  const [baseToolId, scopeLevelRaw, scopeId] = parts;
38
38
  if (!baseToolId || !scopeId)
@@ -1 +1 @@
1
- {"version":3,"file":"tool-instance-id.js","sourceRoot":"","sources":["../../src/services/tool-instance-id.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,YAAY;IACZ,SAAS;IACT,MAAM;IACN,SAAS;IACT,QAAQ;CACC,CAAC;AAWX,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAS,yBAAyB,CAAC,CAAC;AAE7E,MAAM,UAAU,4BAA4B;IAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,UAAkB;IACxD,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAChE,CAAC;IACD,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,0BAA0B,CACzC,UAAkB;IAElB,OAAO,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,kBAAkB,CACjC,UAAkB,EAClB,UAA0B,EAC1B,OAAe;IAEf,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzC,IAAI,CAAC,cAAc,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CACd,6BAA6B,UAAU,0DAA0D,CACjG,CAAC;IACH,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,UAAU,IAAI,iBA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,UAAU,EAAE,aAAa;QACzB,OAAO;KACP,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAU;IACzC,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,kBAAkB,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACjF,CAAC","sourcesContent":["export const DEFAULT_TOOL_SCOPE_LEVELS = [\n\t\"assessment\",\n\t\"section\",\n\t\"item\",\n\t\"passage\",\n\t\"rubric\",\n] as const;\n\nexport type BuiltinToolScopeLevel = (typeof DEFAULT_TOOL_SCOPE_LEVELS)[number];\nexport type ToolScopeLevel = BuiltinToolScopeLevel | (string & {});\n\nexport interface ParsedToolInstanceId {\n\tbaseToolId: string;\n\tscopeLevel: ToolScopeLevel;\n\tscopeId: string;\n}\n\nconst registeredToolScopeLevels = new Set<string>(DEFAULT_TOOL_SCOPE_LEVELS);\n\nexport function getRegisteredToolScopeLevels(): string[] {\n\treturn Array.from(registeredToolScopeLevels.values());\n}\n\nexport function registerToolScopeLevel(scopeLevel: string): void {\n\tconst normalized = scopeLevel.trim();\n\tif (!normalized) {\n\t\tthrow new Error(\"Tool scope level must be a non-empty string\");\n\t}\n\tregisteredToolScopeLevels.add(normalized);\n}\n\nexport function isRegisteredToolScopeLevel(\n\tscopeLevel: string,\n): scopeLevel is ToolScopeLevel {\n\treturn registeredToolScopeLevels.has(scopeLevel);\n}\n\nexport function createScopedToolId(\n\tbaseToolId: string,\n\tscopeLevel: ToolScopeLevel,\n\tscopeId: string,\n): string {\n\tconst normalizedBase = baseToolId.trim();\n\tconst normalizedScopeId = scopeId.trim();\n\tif (!normalizedBase || !normalizedScopeId) {\n\t\tthrow new Error(\"Tool instance ids require non-empty tool and scope ids\");\n\t}\n\tif (!isRegisteredToolScopeLevel(scopeLevel)) {\n\t\tthrow new Error(\n\t\t\t`Unknown tool scope level '${scopeLevel}'. Register custom levels with registerToolScopeLevel().`,\n\t\t);\n\t}\n\treturn `${normalizedBase}:${scopeLevel}:${normalizedScopeId}`;\n}\n\nexport function parseScopedToolId(id: string): ParsedToolInstanceId | null {\n\tconst parts = id.split(\":\");\n\tif (parts.length !== 3) return null;\n\tconst [baseToolId, scopeLevelRaw, scopeId] = parts;\n\tif (!baseToolId || !scopeId) return null;\n\tif (!isRegisteredToolScopeLevel(scopeLevelRaw)) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tbaseToolId,\n\t\tscopeLevel: scopeLevelRaw,\n\t\tscopeId,\n\t};\n}\n\nexport function toOverlayToolId(id: string): string {\n\tconst parsed = parseScopedToolId(id);\n\tif (!parsed) return id;\n\treturn createScopedToolId(parsed.baseToolId, parsed.scopeLevel, parsed.scopeId);\n}\n"]}
@@ -105,4 +105,3 @@ export declare class DesmosToolProvider implements ToolProviderApi<DesmosToolPro
105
105
  */
106
106
  destroy(): void;
107
107
  }
108
- //# sourceMappingURL=DesmosToolProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DesmosToolProvider.js","sourceRoot":"","sources":["../../../src/services/tool-providers/DesmosToolProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA2CH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,kBAAkB;IAGrB,UAAU,GAAG,mBAAmB,CAAC;IACjC,YAAY,GAAG,mBAAmB,CAAC;IACnC,QAAQ,GAAG,YAAqB,CAAC;IACjC,OAAO,GAAG,MAAM,CAAC;IACjB,YAAY,GAAG,IAAI,CAAC;IAErB,cAAc,GAWZ,IAAI,CAAC;IACP,MAAM,GAAoC,IAAI,CAAC;IAE/C,KAAK,CAAC,aAAa,CAC1B,SAAiB,EACjB,OAAiC;QAEjC,IAAI,CAAC;YACJ,MAAM,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,SAAS,EAAE,OAAO,CA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E,IAAI;gBACd,YAAY,EAAE,IAAI;aAClB;SACD,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,OAAO;QACN,OAAO,IAAI,CAAC,cAAc,KAAK,IAAI,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,OAAO;QACN,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC/C,CAAC;CACD"}
1
+ {"version":3,"file":"DesmosToolProvider.js","sourceRoot":"","sources":["../../../src/services/tool-providers/DesmosToolProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA2CH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,kBAAkB;IAGrB,UAAU,GAAG,mBAAmB,CAAC;IACjC,YAAY,GAAG,mBAAmB,CAAC;IACnC,QAAQ,GAAG,YAAqB,CAAC;IACjC,OAAO,GAAG,MAAM,CAAC;IACjB,YAAY,GAAG,IAAI,CAAC;IAErB,cAAc,GAWZ,IAAI,CAAC;IACP,MAAM,GAAoC,IAAI,CAAC;IAE/C,KAAK,CAAC,aAAa,CAC1B,SAAiB,EACjB,OAAiC;QAEjC,IAAI,CAAC;YACJ,MAAM,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;QACxE,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAAgC;QAChD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CACX,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9B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC/C,CAAC;CACD","sourcesContent":["/**\n * Desmos Calculator Tool Provider\n *\n * Provides Desmos calculators (basic, scientific, graphing)\n * with authentication and proxy support.\n *\n * SECURITY BEST PRACTICE:\n * - Development: Pass apiKey directly for local testing\n * - Production: Use proxyEndpoint or authFetcher to keep API key server-side\n *\n * Part of PIE Assessment Toolkit.\n */\n\nimport type {\n\tCalculatorProvider,\n\tDesmosCalculatorConfig,\n} from \"@pie-players/pie-calculator\";\nimport type { ToolProviderApi, ToolProviderCapabilities } from \"./ToolProviderApi.js\";\n\n/**\n * Desmos tool provider configuration\n */\nexport interface DesmosToolProviderConfig {\n\t/**\n\t * Desmos API key (DEVELOPMENT ONLY)\n\t * Never expose in production client code!\n\t *\n\t * Obtain from: https://www.desmos.com/api\n\t */\n\tapiKey?: string;\n\n\t/**\n\t * Server proxy endpoint (PRODUCTION RECOMMENDED)\n\t * Backend handles API key securely\n\t *\n\t * @example '/api/desmos/token'\n\t * @example 'https://api.myapp.com/tools/desmos/auth'\n\t */\n\tproxyEndpoint?: string;\n\n\t/**\n\t * Default calculator configuration applied to all instances\n\t */\n\tdefaultConfig?: DesmosCalculatorConfig;\n\n\t/**\n\t * Optional telemetry callback for tool/backend instrumentation.\n\t */\n\tonTelemetry?: (\n\t\teventName: string,\n\t\tpayload?: Record<string, unknown>,\n\t) => void | Promise<void>;\n}\n\n/**\n * Desmos Calculator Tool Provider\n *\n * Wraps DesmosCalculatorProvider with the ToolProviderApi interface\n * for use in the ToolProviderRegistry.\n *\n * @example\n * ```typescript\n * const provider = new DesmosToolProvider();\n *\n * await provider.initialize({\n * apiKey: 'your-api-key', // Development only\n * proxyEndpoint: '/api/desmos/token', // Production\n * });\n *\n * const calculatorProvider = await provider.createInstance();\n * ```\n */\nexport class DesmosToolProvider\n\timplements ToolProviderApi<DesmosToolProviderConfig, CalculatorProvider>\n{\n\treadonly providerId = \"desmos-calculator\";\n\treadonly providerName = \"Desmos Calculator\";\n\treadonly category = \"calculator\" as const;\n\treadonly version = \"1.10\";\n\treadonly requiresAuth = true;\n\n\tprivate desmosProvider:\n\t\t| (CalculatorProvider & {\n\t\t\t\tinitialize(config: {\n\t\t\t\t\tapiKey?: string;\n\t\t\t\t\tproxyEndpoint?: string;\n\t\t\t\t\tonTelemetry?: (\n\t\t\t\t\t\teventName: string,\n\t\t\t\t\t\tpayload?: Record<string, unknown>,\n\t\t\t\t\t) => void | Promise<void>;\n\t\t\t\t}): Promise<void>;\n\t\t })\n\t\t| null = null;\n\tprivate config: DesmosToolProviderConfig | null = null;\n\n\tprivate async emitTelemetry(\n\t\teventName: string,\n\t\tpayload?: Record<string, unknown>,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait this.config?.onTelemetry?.(eventName, payload);\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"[DesmosToolProvider] telemetry callback failed:\", error);\n\t\t}\n\t}\n\n\t/**\n\t * Initialize Desmos calculator provider\n\t *\n\t * Loads the Desmos API library and authenticates with provided credentials.\n\t *\n\t * @param config Configuration with API key or proxy endpoint\n\t * @throws Error if initialization fails\n\t */\n\tasync initialize(config: DesmosToolProviderConfig): Promise<void> {\n\t\tif (this.desmosProvider) {\n\t\t\tconsole.warn(\n\t\t\t\t\"[DesmosToolProvider] Already initialized, skipping reinitialization\",\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.config = config;\n\t\tconst moduleLoadStartedAt = Date.now();\n\t\tawait this.emitTelemetry(\"pie-tool-library-load-start\", {\n\t\t\ttoolId: \"calculator\",\n\t\t\toperation: \"desmos-provider-module-import\",\n\t\t\tbackend: \"desmos\",\n\t\t});\n\t\tconst desmosModule = await (async () => {\n\t\t\ttry {\n\t\t\t\tconst loaded = (await import(\"@pie-players/pie-calculator-desmos\")) as {\n\t\t\t\t\tDesmosCalculatorProvider: new () => CalculatorProvider & {\n\t\t\t\t\t\tinitialize(config: {\n\t\t\t\t\t\t\tapiKey?: string;\n\t\t\t\t\t\t\tproxyEndpoint?: string;\n\t\t\t\t\t\t\tonTelemetry?: (\n\t\t\t\t\t\t\t\teventName: string,\n\t\t\t\t\t\t\t\tpayload?: Record<string, unknown>,\n\t\t\t\t\t\t\t) => void | Promise<void>;\n\t\t\t\t\t\t}): Promise<void>;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tawait this.emitTelemetry(\"pie-tool-library-load-success\", {\n\t\t\t\t\ttoolId: \"calculator\",\n\t\t\t\t\toperation: \"desmos-provider-module-import\",\n\t\t\t\t\tbackend: \"desmos\",\n\t\t\t\t\tduration: Date.now() - moduleLoadStartedAt,\n\t\t\t\t});\n\t\t\t\treturn loaded;\n\t\t\t} catch (error) {\n\t\t\t\tawait this.emitTelemetry(\"pie-tool-library-load-error\", {\n\t\t\t\t\ttoolId: \"calculator\",\n\t\t\t\t\toperation: \"desmos-provider-module-import\",\n\t\t\t\t\tbackend: \"desmos\",\n\t\t\t\t\tduration: Date.now() - moduleLoadStartedAt,\n\t\t\t\t\terrorType: \"ToolLibraryLoadError\",\n\t\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\t});\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\t\tthis.desmosProvider = new desmosModule.DesmosCalculatorProvider();\n\n\t\t// Initialize with API key or proxy\n\t\ttry {\n\t\t\tawait this.desmosProvider.initialize({\n\t\t\t\tapiKey: config.apiKey,\n\t\t\t\tproxyEndpoint: config.proxyEndpoint,\n\t\t\t\tonTelemetry: config.onTelemetry,\n\t\t\t});\n\n\t\t\tconsole.log(\n\t\t\t\t`[DesmosToolProvider] Initialized successfully ${\n\t\t\t\t\tconfig.proxyEndpoint\n\t\t\t\t\t\t? \"(using proxy)\"\n\t\t\t\t\t\t: config.apiKey\n\t\t\t\t\t\t\t? \"(direct API key)\"\n\t\t\t\t\t\t\t: \"(no auth)\"\n\t\t\t\t}`,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(\"[DesmosToolProvider] Initialization failed:\", error);\n\t\t\tthrow new Error(\n\t\t\t\t\"Failed to initialize Desmos calculator provider. Check API key or proxy endpoint.\",\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Create a calculator provider instance\n\t *\n\t * Returns the initialized Desmos calculator provider.\n\t *\n\t * @param config Optional instance-specific configuration (currently unused)\n\t * @returns Desmos calculator provider\n\t * @throws Error if provider not initialized\n\t */\n\tasync createInstance(\n\t\tconfig?: Partial<DesmosToolProviderConfig>,\n\t): Promise<CalculatorProvider> {\n\t\tif (!this.desmosProvider) {\n\t\t\tthrow new Error(\n\t\t\t\t\"[DesmosToolProvider] Provider not initialized. Call initialize() first.\",\n\t\t\t);\n\t\t}\n\n\t\treturn this.desmosProvider;\n\t}\n\n\t/**\n\t * Get provider capabilities\n\t *\n\t * @returns Desmos calculator capabilities\n\t */\n\tgetCapabilities(): ToolProviderCapabilities {\n\t\treturn {\n\t\t\tsupportsOffline: false, // Requires Desmos CDN\n\t\t\trequiresAuth: true,\n\t\t\tmaxInstances: null, // Unlimited calculator instances\n\t\t\tfeatures: {\n\t\t\t\tbasic: true,\n\t\t\t\tscientific: true,\n\t\t\t\tgraphing: true,\n\t\t\t\tfourFunction: true,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Check if provider is ready\n\t *\n\t * @returns true if provider is initialized\n\t */\n\tisReady(): boolean {\n\t\treturn this.desmosProvider !== null;\n\t}\n\n\t/**\n\t * Clean up provider resources\n\t *\n\t * Destroys the Desmos calculator provider and releases resources.\n\t */\n\tdestroy(): void {\n\t\tif (this.desmosProvider) {\n\t\t\tthis.desmosProvider.destroy();\n\t\t\tthis.desmosProvider = null;\n\t\t}\n\t\tthis.config = null;\n\t\tconsole.log(\"[DesmosToolProvider] Destroyed\");\n\t}\n}\n"]}
@@ -161,4 +161,3 @@ export declare class TTSToolProvider implements ToolProviderApi<TTSToolProviderC
161
161
  */
162
162
  destroy(): void;
163
163
  }
164
- //# sourceMappingURL=TTSToolProvider.d.ts.map
@@ -106,7 +106,7 @@ export class TTSToolProvider {
106
106
  // Server backends are optional; load implementation only when requested.
107
107
  const moduleLoadStartedAt = Date.now();
108
108
  await this.emitTelemetry("pie-tool-library-load-start", {
109
- toolId: "tts",
109
+ toolId: "textToSpeech",
110
110
  operation: "server-provider-module-import",
111
111
  backend: config.serverProvider || config.backend,
112
112
  });
@@ -114,7 +114,7 @@ export class TTSToolProvider {
114
114
  try {
115
115
  const loaded = (await import("@pie-players/tts-client-server"));
116
116
  await this.emitTelemetry("pie-tool-library-load-success", {
117
- toolId: "tts",
117
+ toolId: "textToSpeech",
118
118
  operation: "server-provider-module-import",
119
119
  backend: config.serverProvider || config.backend,
120
120
  duration: Date.now() - moduleLoadStartedAt,
@@ -123,7 +123,7 @@ export class TTSToolProvider {
123
123
  }
124
124
  catch (error) {
125
125
  await this.emitTelemetry("pie-tool-library-load-error", {
126
- toolId: "tts",
126
+ toolId: "textToSpeech",
127
127
  operation: "server-provider-module-import",
128
128
  backend: config.serverProvider || config.backend,
129
129
  duration: Date.now() - moduleLoadStartedAt,