@pie-players/pie-assessment-toolkit 0.3.65 → 0.3.67
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 +36 -16
- package/dist/components/ItemToolBar.custom-element.js +1 -1
- package/dist/components/PieAssessmentToolkit.custom-element.js +9 -8
- package/dist/components/SectionToolBar.custom-element.js +1 -1
- package/dist/components/chunks/{ItemToolBar-cckwpz6c.js → ItemToolBar-8jgdz50p.js} +9 -9
- package/dist/components/chunks/ItemToolBar-cvs646j3.js +36 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -1
- package/dist/policy/core/PolicySource.d.ts +2 -2
- package/dist/policy/core/PolicySource.js +2 -2
- package/dist/policy/core/ToolPolicyEngine.d.ts +19 -3
- package/dist/policy/core/ToolPolicyEngine.js +39 -5
- package/dist/policy/core/compose-decision.d.ts +3 -2
- package/dist/policy/core/compose-decision.js +3 -2
- package/dist/policy/core/decision-types.d.ts +2 -2
- package/dist/policy/core/decision-types.js +2 -2
- package/dist/policy/core/feature-decision.d.ts +56 -3
- package/dist/policy/core/feature-decision.js +60 -3
- package/dist/policy/core/pnp-policy-inputs.d.ts +2 -2
- package/dist/policy/core/pnp-policy-inputs.js +2 -2
- package/dist/policy/core/provenance.d.ts +4 -1
- package/dist/policy/core/provenance.js +4 -1
- package/dist/policy/engine.d.ts +1 -1
- package/dist/policy/engine.js +1 -0
- package/dist/policy/sources/PnpPolicySource.d.ts +2 -1
- package/dist/policy/sources/PnpPolicySource.js +2 -1
- package/dist/runtime/core/engine-transition.js +3 -1
- package/dist/services/AccessibilityCatalogResolver.d.ts +49 -10
- package/dist/services/AccessibilityCatalogResolver.js +180 -11
- package/dist/services/TTSService.d.ts +11 -0
- package/dist/services/TTSService.js +220 -32
- package/dist/services/ToolRegistry.d.ts +55 -14
- package/dist/services/ToolRegistry.js +57 -3
- package/dist/services/ToolkitCoordinator.d.ts +18 -1
- package/dist/services/ToolkitCoordinator.js +24 -2
- package/dist/services/catalog-owner.d.ts +71 -0
- package/dist/services/catalog-owner.js +64 -0
- package/dist/services/framework-error.d.ts +1 -1
- package/dist/services/interfaces.d.ts +15 -3
- package/dist/services/tts/browser-provider.js +189 -23
- package/dist/tools/content-capability-resolution.d.ts +106 -0
- package/dist/tools/content-capability-resolution.js +136 -0
- package/dist/tools/internal.d.ts +3 -0
- package/dist/tools/internal.js +1 -0
- package/package.json +13 -9
- package/dist/components/chunks/ItemToolBar-pryf0rtz.js +0 -22
- package/dist/runtime/catalog-registration.d.ts +0 -67
- package/dist/runtime/catalog-registration.js +0 -86
package/README.md
CHANGED
|
@@ -235,7 +235,7 @@ const coordinator = new ToolkitCoordinator({
|
|
|
235
235
|
assessmentId: 'demo-assessment',
|
|
236
236
|
tools: {
|
|
237
237
|
providers: {
|
|
238
|
-
textToSpeech: { enabled: true, backend: 'browser'
|
|
238
|
+
textToSpeech: { enabled: true, backend: 'browser' },
|
|
239
239
|
calculator: { enabled: true }
|
|
240
240
|
},
|
|
241
241
|
placement: {
|
|
@@ -418,7 +418,7 @@ tools: {
|
|
|
418
418
|
},
|
|
419
419
|
providers: {
|
|
420
420
|
calculator: { authFetcher: async () => ({ apiKey: '...' }) },
|
|
421
|
-
textToSpeech: { enabled: true, backend: 'browser'
|
|
421
|
+
textToSpeech: { enabled: true, backend: 'browser' }
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
```
|
|
@@ -1053,34 +1053,42 @@ Consumers select by type and then validate the form they expect; a card with no
|
|
|
1053
1053
|
string form is not text content, and treating it as such would speak or render an
|
|
1054
1054
|
empty string.
|
|
1055
1055
|
|
|
1056
|
-
Catalogs
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1056
|
+
Catalogs carried by a rendered item or passage are registered as one owner-level
|
|
1057
|
+
transaction. The resolver owns the walk over entity-root,
|
|
1058
|
+
`config.extractedCatalogs`, and model catalogs, along with their registration
|
|
1059
|
+
precedence and change notification:
|
|
1060
1060
|
|
|
1061
1061
|
```typescript
|
|
1062
1062
|
import {
|
|
1063
1063
|
catalogOwnerContextFor,
|
|
1064
|
-
collectEntityCatalogRegistrations,
|
|
1065
1064
|
} from '@pie-players/pie-assessment-toolkit';
|
|
1066
1065
|
|
|
1067
|
-
const
|
|
1066
|
+
const owner = {
|
|
1068
1067
|
kind: 'item',
|
|
1069
1068
|
itemId: item.id,
|
|
1070
1069
|
canonicalItemId,
|
|
1071
1070
|
assessmentId,
|
|
1072
1071
|
sectionId,
|
|
1073
|
-
}
|
|
1072
|
+
} as const;
|
|
1074
1073
|
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1080
|
-
|
|
1074
|
+
const unregister = resolver.registerOwner({ owner, entity: item });
|
|
1075
|
+
const ownerView = resolver.forOwner(catalogOwnerContextFor(owner));
|
|
1076
|
+
|
|
1077
|
+
const stopObserving = ownerView.onChange(() => {
|
|
1078
|
+
const snapshot = ownerView.snapshot();
|
|
1079
|
+
// Interpret only the card types your capability owns.
|
|
1081
1080
|
});
|
|
1081
|
+
|
|
1082
|
+
stopObserving();
|
|
1083
|
+
unregister();
|
|
1082
1084
|
```
|
|
1083
1085
|
|
|
1086
|
+
`CatalogOwnerSnapshot` is immutable and deterministic. A content capability
|
|
1087
|
+
receives it as `ToolContentDependencyContext.catalogs`; it does not receive the
|
|
1088
|
+
raw entity, resolver, or separately assembled lookup context. Direct consumers
|
|
1089
|
+
such as TTS may still call `getAlternative(...)` with a context built by
|
|
1090
|
+
`catalogOwnerContextFor`.
|
|
1091
|
+
|
|
1084
1092
|
### SSMLExtractor
|
|
1085
1093
|
|
|
1086
1094
|
```typescript
|
|
@@ -1134,6 +1142,16 @@ membership as eligibility tier — registration means "policy-addressable", not
|
|
|
1134
1142
|
"universal, on by default" — and had to be corrected with a compile-time list of
|
|
1135
1143
|
ids to exclude that a host could not extend for its own accommodation.
|
|
1136
1144
|
|
|
1145
|
+
### Live registry changes
|
|
1146
|
+
|
|
1147
|
+
`ToolRegistry.onRegistryChange(listener)` observes successful `register`,
|
|
1148
|
+
`override`, `unregister`, `clear`, component-override, and module-loader
|
|
1149
|
+
changes synchronously. Invalid and no-op mutations do not emit, listener
|
|
1150
|
+
failures do not interrupt other listeners, and unsubscribe is idempotent.
|
|
1151
|
+
Section-player subscribes internally, so a capability registered after mount
|
|
1152
|
+
appears without a host-forced rerender; unregister and clear destroy their
|
|
1153
|
+
mounted surface elements immediately.
|
|
1154
|
+
|
|
1137
1155
|
## Integration with Section Player
|
|
1138
1156
|
|
|
1139
1157
|
The section player provides automatic ToolkitCoordinator integration:
|
|
@@ -1275,7 +1293,9 @@ Notes:
|
|
|
1275
1293
|
`ToolkitCoordinator.subscribeFrameworkErrors(listener)`. The callback
|
|
1276
1294
|
prop fires exactly once per error, regardless of wrapper depth. Filter
|
|
1277
1295
|
by `model.kind` (e.g. `"tts-init"`, `"provider-init"`,
|
|
1278
|
-
|
|
1296
|
+
`"provider-register"`, `"tool-surface"`) for tool- or provider-specific
|
|
1297
|
+
handling. Recoverable warnings remain observable but do not move section
|
|
1298
|
+
readiness to `error`.
|
|
1279
1299
|
- See `docs/tools-and-accomodations/framework-owned-error-handling.md` for event payload and error-kind mapping details.
|
|
1280
1300
|
|
|
1281
1301
|
## Section Runtime Engine (advanced)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunks/ItemToolBar-
|
|
1
|
+
import{a}from"./chunks/ItemToolBar-cvs646j3.js";import"./chunks/ItemToolBar-8jgdz50p.js";export{a as default};
|