@pie-players/pie-assessment-toolkit 0.3.63 → 0.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -1
- package/dist/components/ItemToolBar.custom-element.js +1 -1
- package/dist/components/PieAssessmentToolkit.custom-element.js +11 -11
- package/dist/components/SectionToolBar.custom-element.js +1 -1
- package/dist/components/chunks/ItemToolBar-cckwpz6c.js +51 -0
- package/dist/components/chunks/ItemToolBar-pryf0rtz.js +22 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.js +12 -4
- package/dist/policy/core/ToolPolicyEngine.d.ts +21 -0
- package/dist/policy/core/ToolPolicyEngine.js +27 -0
- package/dist/policy/core/feature-decision.d.ts +57 -0
- package/dist/policy/core/feature-decision.js +40 -0
- package/dist/policy/engine.d.ts +1 -0
- package/dist/policy/sources/PnpPolicySource.d.ts +22 -0
- package/dist/policy/sources/PnpPolicySource.js +41 -11
- package/dist/runtime/catalog-registration.d.ts +56 -1
- package/dist/runtime/catalog-registration.js +64 -31
- package/dist/runtime/composition-emit-scheduler.d.ts +78 -0
- package/dist/runtime/composition-emit-scheduler.js +154 -0
- package/dist/runtime/core/engine-resolver.d.ts +1 -1
- package/dist/services/AccessibilityCatalogResolver.d.ts +100 -4
- package/dist/services/AccessibilityCatalogResolver.js +183 -58
- package/dist/services/SSMLExtractor.js +28 -18
- package/dist/services/TTSService.d.ts +25 -0
- package/dist/services/TTSService.js +241 -45
- package/dist/services/ToolRegistry.d.ts +218 -8
- package/dist/services/ToolRegistry.js +124 -8
- package/dist/services/ToolkitCoordinator.d.ts +25 -3
- package/dist/services/ToolkitCoordinator.js +47 -6
- package/dist/services/catalog-media.d.ts +25 -0
- package/dist/services/catalog-media.js +101 -0
- package/dist/services/createDefaultToolRegistry.d.ts +25 -58
- package/dist/services/createDefaultToolRegistry.js +24 -104
- package/dist/services/defaultPersonalNeedsProfile.d.ts +20 -2
- package/dist/services/defaultPersonalNeedsProfile.js +21 -19
- package/dist/services/interfaces.d.ts +29 -2
- package/dist/services/pnp-standard-features.d.ts +1 -1
- package/dist/services/spoken-audio-cards.d.ts +54 -0
- package/dist/services/spoken-audio-cards.js +66 -0
- package/dist/services/tool-config-defaults.d.ts +7 -23
- package/dist/services/tool-config-defaults.js +7 -46
- package/dist/services/tool-config-validation.d.ts +1 -1
- package/dist/services/tool-config-validation.js +44 -4
- package/dist/services/tts/browser-provider.js +2 -1
- package/dist/services/tts/math-aware-text-processing.js +3 -3
- package/dist/services/tts/text-processing.d.ts +51 -0
- package/dist/services/tts/text-processing.js +117 -1
- package/dist/services/tts-runtime-config.js +7 -2
- package/dist/tools/internal.d.ts +34 -0
- package/dist/tools/internal.js +33 -0
- package/dist/tools/tool-tag-map.d.ts +15 -3
- package/dist/tools/tool-tag-map.js +21 -18
- package/package.json +14 -10
- package/dist/components/chunks/ItemToolBar-843902tp.js +0 -51
- package/dist/components/chunks/ItemToolBar-84nv78dy.js +0 -22
- package/dist/tools/registrations/accessibility-tools.d.ts +0 -34
- package/dist/tools/registrations/accessibility-tools.js +0 -217
- package/dist/tools/registrations/calculator.d.ts +0 -20
- package/dist/tools/registrations/calculator.js +0 -228
- package/dist/tools/registrations/interaction-tools.d.ts +0 -27
- package/dist/tools/registrations/interaction-tools.js +0 -143
- package/dist/tools/registrations/measurement-tools.d.ts +0 -24
- package/dist/tools/registrations/measurement-tools.js +0 -130
- package/dist/tools/registrations/subject-specific-tools.d.ts +0 -27
- package/dist/tools/registrations/subject-specific-tools.js +0 -158
- package/dist/tools/registrations/tts.d.ts +0 -21
- package/dist/tools/registrations/tts.js +0 -184
package/README.md
CHANGED
|
@@ -1047,6 +1047,40 @@ const alternative = resolver.getAlternative('prompt-001', {
|
|
|
1047
1047
|
resolver.clearItemCatalogs();
|
|
1048
1048
|
```
|
|
1049
1049
|
|
|
1050
|
+
A resolved card carries either a string `content` (SSML for `spoken`, text for
|
|
1051
|
+
`braille`) or a structured `payload`, decided by its `catalog` type — never both.
|
|
1052
|
+
Consumers select by type and then validate the form they expect; a card with no
|
|
1053
|
+
string form is not text content, and treating it as such would speak or render an
|
|
1054
|
+
empty string.
|
|
1055
|
+
|
|
1056
|
+
Catalogs registered for a rendered item or passage are filed under a
|
|
1057
|
+
`CatalogOwnerContext`, which the resolver matches field by field. Build lookup
|
|
1058
|
+
contexts with `catalogOwnerContextFor` rather than as a literal — it is the same
|
|
1059
|
+
function the runtime registers with, so the two cannot drift:
|
|
1060
|
+
|
|
1061
|
+
```typescript
|
|
1062
|
+
import {
|
|
1063
|
+
catalogOwnerContextFor,
|
|
1064
|
+
collectEntityCatalogRegistrations,
|
|
1065
|
+
} from '@pie-players/pie-assessment-toolkit';
|
|
1066
|
+
|
|
1067
|
+
const context = catalogOwnerContextFor({
|
|
1068
|
+
kind: 'item',
|
|
1069
|
+
itemId: item.id,
|
|
1070
|
+
canonicalItemId,
|
|
1071
|
+
assessmentId,
|
|
1072
|
+
sectionId,
|
|
1073
|
+
});
|
|
1074
|
+
|
|
1075
|
+
// Every catalog an entity carries, paired with the scope it belongs in:
|
|
1076
|
+
// entity-level `accessibilityCatalogs`, `config.extractedCatalogs`, and each
|
|
1077
|
+
// model's own catalogs (filed under that `modelId`).
|
|
1078
|
+
const registrations = collectEntityCatalogRegistrations(item, {
|
|
1079
|
+
kind: 'item',
|
|
1080
|
+
itemId: item.id,
|
|
1081
|
+
});
|
|
1082
|
+
```
|
|
1083
|
+
|
|
1050
1084
|
### SSMLExtractor
|
|
1051
1085
|
|
|
1052
1086
|
```typescript
|
|
@@ -1063,6 +1097,43 @@ item.config.extractedCatalogs = result.catalogs;
|
|
|
1063
1097
|
catalogResolver.addItemCatalogs(result.catalogs);
|
|
1064
1098
|
```
|
|
1065
1099
|
|
|
1100
|
+
### Cards without an extractor
|
|
1101
|
+
|
|
1102
|
+
Not every catalog card is lifted out of item markup. A signed alternate is
|
|
1103
|
+
authored or written by an importer and has no extractor at all; one such lift
|
|
1104
|
+
existed and was removed, because nothing produced the inline form and a runtime
|
|
1105
|
+
that could not parse the markup left the video in the visible content, showing the
|
|
1106
|
+
accommodation to every learner regardless of eligibility.
|
|
1107
|
+
|
|
1108
|
+
This package resolves and registers those cards through
|
|
1109
|
+
`AccessibilityCatalogResolver` and the generic media helpers in
|
|
1110
|
+
`catalog-media.ts`. Which card types mean what belongs to the capability that
|
|
1111
|
+
needs them — signing's card validators and its resolution rules live in
|
|
1112
|
+
`@pie-players/pie-tool-sign-language`, behind that capability's
|
|
1113
|
+
`requiresAuthoredContent`.
|
|
1114
|
+
|
|
1115
|
+
### Feature policy without a placement
|
|
1116
|
+
|
|
1117
|
+
`ToolPolicyEngine.decideFeature(featureId)` (and
|
|
1118
|
+
`ToolkitCoordinator.decideFeaturePolicy(featureId)`) resolve one feature id
|
|
1119
|
+
through `PnpPolicySource`'s six-level precedence, independent of any toolbar
|
|
1120
|
+
placement. Use it for capabilities that are not toolbar surfaces — signing is the
|
|
1121
|
+
first — where a placement-scoped `decide(...)` would answer the wrong question:
|
|
1122
|
+
absent because it was never placed, rather than absent because policy said no.
|
|
1123
|
+
|
|
1124
|
+
`createEmptyPersonalNeedsProfile()` is the only profile this package ships, and it
|
|
1125
|
+
grants nothing. Which capabilities a deployment grants by default is a property
|
|
1126
|
+
of the program rather than of a capability — TTS is a universal feature in one
|
|
1127
|
+
program and a documented accommodation in another — so it belongs in policy
|
|
1128
|
+
configuration alongside the district and test-administration levels. Hosts that
|
|
1129
|
+
want today's universal set take `createUniversalPersonalNeedsProfile()` from
|
|
1130
|
+
`@pie-players/pie-default-tool-loaders`, which ships it as data.
|
|
1131
|
+
|
|
1132
|
+
Nothing derives a profile from the registry any more. Doing so read registry
|
|
1133
|
+
membership as eligibility tier — registration means "policy-addressable", not
|
|
1134
|
+
"universal, on by default" — and had to be corrected with a compile-time list of
|
|
1135
|
+
ids to exclude that a host could not extend for its own accommodation.
|
|
1136
|
+
|
|
1066
1137
|
## Integration with Section Player
|
|
1067
1138
|
|
|
1068
1139
|
The section player provides automatic ToolkitCoordinator integration:
|
|
@@ -1164,10 +1235,10 @@ Use `createToolsConfig()` when you want to pre-validate and inspect diagnostics
|
|
|
1164
1235
|
|
|
1165
1236
|
```typescript
|
|
1166
1237
|
import {
|
|
1167
|
-
createPackagedToolRegistry,
|
|
1168
1238
|
createToolsConfig,
|
|
1169
1239
|
ToolkitCoordinator
|
|
1170
1240
|
} from "@pie-players/pie-assessment-toolkit";
|
|
1241
|
+
import { createPackagedToolRegistry } from "@pie-players/pie-default-tool-loaders";
|
|
1171
1242
|
|
|
1172
1243
|
const toolRegistry = createPackagedToolRegistry();
|
|
1173
1244
|
const { config, diagnostics } = createToolsConfig({
|
|
@@ -1240,6 +1311,26 @@ pick the stability surface that matches their use case:
|
|
|
1240
1311
|
`resolveSectionEngineRuntimeState` helpers. Symbols here may change
|
|
1241
1312
|
between minor versions with a changeset note.
|
|
1242
1313
|
|
|
1314
|
+
## Writing a capability package
|
|
1315
|
+
|
|
1316
|
+
`@pie-players/pie-assessment-toolkit/tools/internal` is what a capability
|
|
1317
|
+
package imports: the `ToolRegistration` contract, the surface and content
|
|
1318
|
+
dependency types, `resolveToolTag` and the toolbar registration helpers. Same
|
|
1319
|
+
stability contract as the other `*/internal` entry points — symbols may change
|
|
1320
|
+
between minor versions with a changeset note.
|
|
1321
|
+
|
|
1322
|
+
Import it rather than the package root: the root pulls in `ToolkitCoordinator`,
|
|
1323
|
+
`TTSService` and the components, none of which a registration needs, and a
|
|
1324
|
+
capability bundle that inlines them ends up with a second `ToolRegistry` class
|
|
1325
|
+
that fails every `instanceof` across the host boundary. Mark the toolkit external
|
|
1326
|
+
in the package's build with a pattern that covers subpaths, not a bare specifier.
|
|
1327
|
+
|
|
1328
|
+
`@pie-players/pie-tool-sign-language` is the worked example end to end: a
|
|
1329
|
+
registration, a content resolver, its own custom element, and no edit to any
|
|
1330
|
+
generic package. `packages/default-tool-loaders/README.md` covers how a
|
|
1331
|
+
deployment then composes it in, and `docs/TOOL_REGISTRY.md` the registration and
|
|
1332
|
+
host-surface contracts.
|
|
1333
|
+
|
|
1243
1334
|
### Lifecycle emit coordination
|
|
1244
1335
|
|
|
1245
1336
|
When `<pie-assessment-toolkit>` is nested inside a section-player layout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunks/ItemToolBar-
|
|
1
|
+
import{a}from"./chunks/ItemToolBar-pryf0rtz.js";import"./chunks/ItemToolBar-cckwpz6c.js";export{a as default};
|