@pie-players/pie-players-shared 0.3.73 → 0.3.75

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 (137) hide show
  1. package/README.md +30 -2
  2. package/dist/components/vendor/nds/README.md +7 -5
  3. package/dist/config/profile.d.ts +0 -2
  4. package/dist/config/profile.js +2 -8
  5. package/dist/i18n/index.d.ts +2 -3
  6. package/dist/i18n/index.js +2 -3
  7. package/dist/i18n/messages/en-US.d.ts +11 -24
  8. package/dist/i18n/messages/en-US.js +13 -26
  9. package/dist/i18n/messages/nl-NL.d.ts +7 -24
  10. package/dist/i18n/messages/nl-NL.js +9 -26
  11. package/dist/i18n/provider.d.ts +4 -5
  12. package/dist/i18n/provider.js +4 -5
  13. package/dist/i18n/types.d.ts +4 -5
  14. package/dist/index.d.ts +4 -2
  15. package/dist/index.js +3 -1
  16. package/dist/instrumentation/index.d.ts +5 -4
  17. package/dist/instrumentation/index.js +5 -4
  18. package/dist/instrumentation/new-relic-agent.d.ts +20 -0
  19. package/dist/instrumentation/new-relic-agent.js +24 -0
  20. package/dist/instrumentation/providers/BaseInstrumentationProvider.d.ts +5 -4
  21. package/dist/instrumentation/providers/NewRelicInstrumentationProvider.d.ts +7 -7
  22. package/dist/instrumentation/providers/NewRelicInstrumentationProvider.js +21 -32
  23. package/dist/instrumentation/types.d.ts +7 -3
  24. package/dist/loader-config.d.ts +16 -6
  25. package/dist/loaders/controller-loading.d.ts +14 -0
  26. package/dist/loaders/controller-loading.js +12 -0
  27. package/dist/loaders/defaults.d.ts +10 -0
  28. package/dist/loaders/defaults.js +10 -0
  29. package/dist/loaders/element-loader.d.ts +20 -8
  30. package/dist/loaders/element-loader.js +102 -36
  31. package/dist/loaders/element-package-policy.d.ts +2 -0
  32. package/dist/loaders/element-package-policy.js +2 -1
  33. package/dist/loaders/esm-adapter.d.ts +29 -0
  34. package/dist/loaders/esm-adapter.js +635 -102
  35. package/dist/loaders/iife-adapter.d.ts +0 -5
  36. package/dist/loaders/iife-adapter.js +3 -9
  37. package/dist/loaders/index.d.ts +12 -3
  38. package/dist/loaders/index.js +9 -3
  39. package/dist/loaders/mathjax-events.d.ts +22 -0
  40. package/dist/loaders/mathjax-events.js +65 -0
  41. package/dist/loaders/module-shim.d.ts +12 -0
  42. package/dist/loaders/module-shim.js +12 -0
  43. package/dist/loaders/preloaded-alignment.d.ts +24 -0
  44. package/dist/loaders/preloaded-alignment.js +57 -0
  45. package/dist/loaders/preloaded-authored-tags.d.ts +26 -0
  46. package/dist/loaders/preloaded-authored-tags.js +69 -0
  47. package/dist/loaders/preloaded-registration.d.ts +72 -0
  48. package/dist/loaders/preloaded-registration.js +141 -0
  49. package/dist/media/index.d.ts +69 -0
  50. package/dist/media/index.js +194 -0
  51. package/dist/pie/authoring.d.ts +1 -1
  52. package/dist/pie/authoring.js +25 -18
  53. package/dist/pie/element-announcements.d.ts +39 -0
  54. package/dist/pie/element-announcements.js +67 -0
  55. package/dist/pie/element-observer.d.ts +3 -1
  56. package/dist/pie/element-observer.js +1 -0
  57. package/dist/pie/elements-rendered.d.ts +25 -0
  58. package/dist/pie/elements-rendered.js +96 -0
  59. package/dist/pie/index.d.ts +8 -10
  60. package/dist/pie/index.js +9 -10
  61. package/dist/pie/initialization.js +13 -22
  62. package/dist/pie/initialize-element.d.ts +3 -0
  63. package/dist/pie/initialize-element.js +3 -4
  64. package/dist/pie/instrumentation-event-bridge.js +23 -1
  65. package/dist/pie/instrumentation-event-map.js +11 -25
  66. package/dist/pie/instrumentation-provider-resolution.d.ts +2 -1
  67. package/dist/pie/instrumentation-provider-resolution.js +0 -1
  68. package/dist/pie/item-controller.js +4 -0
  69. package/dist/pie/item-session-contract.d.ts +8 -0
  70. package/dist/pie/item-session-contract.js +30 -9
  71. package/dist/pie/logger.d.ts +6 -0
  72. package/dist/pie/logger.js +10 -0
  73. package/dist/pie/markup-math.d.ts +20 -0
  74. package/dist/pie/markup-math.js +118 -0
  75. package/dist/pie/math-assets.d.ts +48 -0
  76. package/dist/pie/math-assets.js +81 -0
  77. package/dist/pie/math-rendering.d.ts +10 -21
  78. package/dist/pie/math-rendering.js +50 -35
  79. package/dist/pie/registry.d.ts +13 -1
  80. package/dist/pie/registry.js +39 -1
  81. package/dist/pie/resource-monitor.d.ts +6 -33
  82. package/dist/pie/resource-monitor.js +14 -213
  83. package/dist/pie/scoring.d.ts +12 -8
  84. package/dist/pie/scoring.js +21 -24
  85. package/dist/pie/session-commit.d.ts +16 -0
  86. package/dist/pie/session-commit.js +34 -6
  87. package/dist/pie/session-snapshot.d.ts +80 -0
  88. package/dist/pie/session-snapshot.js +166 -0
  89. package/dist/pie/stages.d.ts +10 -47
  90. package/dist/pie/stages.js +10 -47
  91. package/dist/pie/tag-names.d.ts +1 -0
  92. package/dist/pie/tag-names.js +1 -0
  93. package/dist/pie/types.d.ts +4 -5
  94. package/dist/pie/types.js +1 -0
  95. package/dist/pie/updates.d.ts +2 -2
  96. package/dist/pie/updates.js +33 -15
  97. package/dist/pie/versioned-tag.d.ts +4 -0
  98. package/dist/pie/versioned-tag.js +4 -0
  99. package/dist/security/index.d.ts +2 -3
  100. package/dist/security/index.js +2 -3
  101. package/dist/security/sanitize-item-markup.d.ts +4 -2
  102. package/dist/security/sanitize-item-markup.js +48 -6
  103. package/dist/security/sanitize-svg-icon.d.ts +0 -2
  104. package/dist/security/sanitize-svg-icon.js +0 -5
  105. package/dist/security/wrap-overwide-images.js +19 -0
  106. package/dist/security/wrap-overwide.d.ts +13 -0
  107. package/dist/security/wrap-overwide.js +63 -3
  108. package/dist/timed-media/policy.js +5 -16
  109. package/dist/types/index.d.ts +67 -423
  110. package/dist/types/index.js +0 -68
  111. package/dist/ui/attribute-coercion.d.ts +12 -0
  112. package/dist/ui/attribute-coercion.js +33 -0
  113. package/dist/ui/content-styles.d.ts +18 -16
  114. package/dist/ui/content-styles.js +67 -36
  115. package/dist/ui/overlay-containment.d.ts +31 -0
  116. package/dist/ui/overlay-containment.js +63 -0
  117. package/dist/ui/overlay-placement.d.ts +110 -0
  118. package/dist/ui/overlay-placement.js +222 -0
  119. package/dist/ui/pointer-gesture.d.ts +32 -0
  120. package/dist/ui/pointer-gesture.js +56 -0
  121. package/dist/ui/pointer-rotate.d.ts +29 -0
  122. package/dist/ui/pointer-rotate.js +39 -0
  123. package/package.json +23 -18
  124. package/dist/pie/component-context.d.ts +0 -21
  125. package/dist/pie/component-context.js +0 -29
  126. package/dist/pie/player-initializer.d.ts +0 -54
  127. package/dist/pie/player-initializer.js +0 -122
  128. package/dist/pie/stage-tracker.d.ts +0 -50
  129. package/dist/pie/stage-tracker.js +0 -105
  130. package/dist/security/wrap-model-rich-content.d.ts +0 -1
  131. package/dist/security/wrap-model-rich-content.js +0 -40
  132. package/dist/server/npm-auth-env.d.ts +0 -13
  133. package/dist/server/npm-auth-env.js +0 -64
  134. package/dist/server/npm-registry.d.ts +0 -7
  135. package/dist/server/npm-registry.js +0 -59
  136. package/dist/ui/debug-panel-persistence.d.ts +0 -17
  137. package/dist/ui/debug-panel-persistence.js +0 -37
@@ -16,79 +16,6 @@ export interface BaseEntity {
16
16
  createdAt?: Date;
17
17
  updatedAt?: Date;
18
18
  }
19
- export interface CollectionEntity extends BaseEntity {
20
- name: string;
21
- organization: string | OrganizationEntity;
22
- }
23
- export interface OrganizationEntity extends BaseEntity {
24
- name: string;
25
- defaultCollection?: string | CollectionEntity;
26
- }
27
- export interface UserEntity extends BaseEntity {
28
- email: string;
29
- name?: string;
30
- }
31
- export interface ClientEntity extends BaseEntity {
32
- name: string;
33
- secret: string;
34
- user: string | UserEntity;
35
- organization: string | OrganizationEntity;
36
- }
37
- export interface AssignmentEntity extends BaseEntity {
38
- organization: string | OrganizationEntity;
39
- }
40
- export interface SessionEntity extends BaseEntity {
41
- item: ItemEntity;
42
- assignment?: string | AssignmentEntity;
43
- organization?: string | OrganizationEntity;
44
- }
45
- export declare enum SessionEventType {
46
- SAVE = "save",
47
- MODEL = "model",
48
- SCORE = "score",
49
- MANUAL_SCORE = "manual-score"
50
- }
51
- export declare enum ScoreType {
52
- AUTO = "auto",
53
- MANUAL = "manual"
54
- }
55
- export interface SessionScore {
56
- points?: number;
57
- max?: number;
58
- type?: ScoreType;
59
- partialScoring?: boolean;
60
- message?: string;
61
- errors?: string[];
62
- }
63
- export interface SessionAutoScore extends SessionScore {
64
- elements?: any[];
65
- extraProps?: any;
66
- }
67
- export interface SessionManualScore extends SessionScore {
68
- }
69
- export interface SessionEventEntity extends BaseEntity {
70
- session: string | SessionEntity;
71
- type?: SessionEventType;
72
- saveEventId?: string;
73
- score?: number;
74
- }
75
- export declare enum ModeType {
76
- GATHER = "gather",
77
- VIEW = "view",
78
- EVALUATE = "evaluate"
79
- }
80
- export interface FlatSession {
81
- id: string;
82
- assignment: AssignmentEntity;
83
- item: string;
84
- data: any[];
85
- createdAt: Date;
86
- updatedAt: Date;
87
- mode: ModeType;
88
- autoScore: SessionAutoScore;
89
- manualScore: SessionManualScore;
90
- events: SessionEventEntity[];
91
- }
92
19
  export interface SemVerPrerelease {
93
20
  tag: string;
94
21
  version: number;
@@ -152,8 +79,8 @@ export interface ItemEntity extends VersionEntity, ConfigContainerEntity, Search
152
79
  /**
153
80
  * `null` as well as absent, because importers write it. JSON has no
154
81
  * `undefined`, so an item transformed from another format carries an explicit
155
- * `passage: null` for "no passage" — `isPassageEntity` has always tested for
156
- * null, so the runtime expected it while the type denied it. Excluding null
82
+ * `passage: null` for "no passage" — the runtime has always tested for
83
+ * null, so it expected it while the type denied it. Excluding null
157
84
  * only meant a host feeding real importer output through a typed path had to
158
85
  * cast it away.
159
86
  */
@@ -165,12 +92,23 @@ export interface ItemEntity extends VersionEntity, ConfigContainerEntity, Search
165
92
  configuration?: any;
166
93
  highlights?: Record<string, string[]>;
167
94
  }
168
- export interface AssignmentSessionData {
169
- assignment: AssignmentEntity;
170
- sessions: FlatSession[];
171
- items: ItemEntity[];
172
- error?: string;
173
- }
95
+ /**
96
+ * `baseId` and `version` are optional on an entity a section references. They
97
+ * identify a stored version, which a host building a section from an item
98
+ * config does not have, and no player reads either.
99
+ */
100
+ type WithOptionalVersion<T extends VersionEntity> = Omit<T, "baseId" | "version"> & Partial<Pick<VersionEntity, "baseId" | "version">>;
101
+ /**
102
+ * A passage as a section's item references it. `name` is optional on the same
103
+ * ground: the section player reads it only as a fallback for a missing `id`.
104
+ */
105
+ export type ReferencedPassageEntity = Omit<WithOptionalVersion<PassageEntity>, "name"> & {
106
+ name?: string;
107
+ };
108
+ /** An item as `AssessmentItemRef.item` references it. */
109
+ export type ReferencedItemEntity = Omit<WithOptionalVersion<ItemEntity>, "passage"> & {
110
+ passage?: string | ReferencedPassageEntity | null;
111
+ };
174
112
  /**
175
113
  * Metadata specifically for interpretation by clients, typically containing
176
114
  * options that are relevant for the user interface. This is not indexed for search.
@@ -185,15 +123,6 @@ export interface SettingsMetaData {
185
123
  export interface SettingsMetaDataEntity {
186
124
  settings?: SettingsMetaData;
187
125
  }
188
- /**
189
- * A reference to an item with optionally a title, settings and metadata.
190
- */
191
- export interface QuestionEntity extends SearchMetaDataEntity, SettingsMetaDataEntity {
192
- id?: string;
193
- title?: string;
194
- itemVId: string;
195
- item?: ItemEntity;
196
- }
197
126
  export type RubricBlockView = "author" | "candidate" | "proctor" | "scorer" | "testConstructor" | "tutor";
198
127
  export interface RubricBlock {
199
128
  identifier?: string;
@@ -234,7 +163,7 @@ export interface AssessmentItemRef extends SearchMetaDataEntity {
234
163
  * Resolved item entity with PIE config.
235
164
  * This is populated by the client before passing to the player.
236
165
  */
237
- item?: ItemEntity;
166
+ item?: ReferencedItemEntity;
238
167
  /** Item-level settings for tool requirements and customization */
239
168
  settings?: ItemSettings;
240
169
  /**
@@ -270,14 +199,6 @@ export interface AssessmentSection extends SearchMetaDataEntity, SettingsMetaDat
270
199
  */
271
200
  assessmentItemRefs?: AssessmentItemRef[];
272
201
  rubricBlocks?: RubricBlock[];
273
- /**
274
- * QTI 3.0: Personal Needs Profile (PNP 3.0) for section-scoped delivery.
275
- *
276
- * Section players read this (falling back to `settings.personalNeedsProfile`,
277
- * then to the computed default profile) to drive PNP policy when a section is
278
- * delivered without an enclosing assessment.
279
- */
280
- personalNeedsProfile?: PersonalNeedsProfile;
281
202
  /**
282
203
  * Formative delivery policy for this section: how many Tries a learner gets
283
204
  * on each item, when feedback is revealed, and whether the behavior is on at
@@ -554,15 +475,7 @@ export interface AccessibilityCatalog {
554
475
  export interface PersonalNeedsProfile {
555
476
  supports: string[];
556
477
  prohibitedSupports?: string[];
557
- activateAtInit?: string[];
558
478
  }
559
- /**
560
- * QTI 3.0: Reference to a shared stimulus (passage).
561
- * Maps to qti-assessment-stimulus-ref element.
562
- *
563
- * NOTE: Not currently used. We embed PassageEntity directly in RubricBlock instead.
564
- * Kept for potential future use if we need to support external stimulus references.
565
- */
566
479
  export interface AssessmentEntity extends BaseEntity, SearchMetaDataEntity {
567
480
  name?: string;
568
481
  title?: string;
@@ -582,117 +495,41 @@ export interface AssessmentEntity extends BaseEntity, SearchMetaDataEntity {
582
495
  * QTI 3.0: testParts structure (authoritative for QTI format).
583
496
  */
584
497
  testParts?: TestPart[];
585
- /** QTI 3.0: Stimulus material references (Phase 3 - placeholder) */
586
- stimulusRefs?: any[];
587
498
  }
588
499
  /**
589
- * Enhanced settings structure for assessment configuration.
590
- * Provides structured fields for district policies, test administration,
591
- * tool configurations, and theme settings while remaining extensible.
500
+ * Assessment settings the tool policy reads: district policy, test
501
+ * administration and per-tool parameters.
592
502
  */
593
503
  export interface AssessmentSettings {
594
504
  /** District/organization policies */
595
505
  districtPolicy?: {
596
506
  blockedTools?: string[];
597
507
  requiredTools?: string[];
598
- policies?: Record<string, any>;
599
508
  };
600
509
  /** Test administration configuration */
601
510
  testAdministration?: {
602
- mode?: "practice" | "test" | "benchmark";
511
+ /**
512
+ * Per-session override by tool id. `false` withdraws the tool and
513
+ * outranks every policy level except a district block. `true` grants it
514
+ * below a district block, an item's `restrictedTools` and the profile's
515
+ * `prohibitedSupports`, and above requirements and profile supports.
516
+ */
603
517
  toolOverrides?: Record<string, boolean>;
604
- startDate?: string;
605
- endDate?: string;
606
518
  };
607
- /** Tool-specific provider configurations */
519
+ /**
520
+ * Parameters by tool id, handed to a tool a grant or requirement admits;
521
+ * an item's `toolParameters` entry wins. Provider configuration belongs in
522
+ * the toolkit's `tools.providers`.
523
+ */
608
524
  toolConfigs?: {
609
525
  calculator?: AssessmentCalculatorConfig;
610
- /**
611
- * Text-to-speech configuration.
612
- *
613
- * Standard parameters (voice, rate, pitch) are portable across providers
614
- * and follow W3C Web Speech API specifications.
615
- *
616
- * Provider-specific extensions should be placed in providerOptions.
617
- *
618
- * @see https://w3c.github.io/speech-api/
619
- */
620
- textToSpeech?: {
621
- /**
622
- * TTS provider
623
- *
624
- * @standard "browser" uses W3C Web Speech API
625
- * @extension "polly" and "custom" are provider-specific
626
- */
627
- provider?: "browser" | "polly" | "custom";
628
- /**
629
- * Voice identifier (provider-specific names)
630
- *
631
- * @standard W3C Web Speech API (concept)
632
- * @example "Joanna" (Polly), "en-US-Standard-A" (Google), browser voices
633
- */
634
- voice?: string;
635
- /**
636
- * Speech rate (speed multiplier)
637
- *
638
- * @standard W3C Web Speech API
639
- * @range 0.25 to 4.0
640
- * @default 1.0
641
- */
642
- rate?: number;
643
- /**
644
- * Pitch adjustment
645
- *
646
- * @standard W3C Web Speech API
647
- * @range 0 to 2 (as multiplier)
648
- * @default 1.0
649
- */
650
- pitch?: number;
651
- /**
652
- * Speech Rule Engine options for generated MathML speech.
653
- *
654
- * `style` is passed to SRE directly; ClearSpeak combines multiple
655
- * preferences with ":" (for example,
656
- * "ImpliedTimes_MoreImpliedTimes:Paren_Silent").
657
- *
658
- * Mirrors assessment-toolkit's SREMathSpeechOptions without importing
659
- * toolkit service types into the shared content contract package.
660
- */
661
- mathSpeech?: {
662
- domain?: string;
663
- style?: string;
664
- engineOptions?: Record<string, unknown>;
665
- };
666
- /**
667
- * Provider-specific options (extensions)
668
- *
669
- * @extension Not portable across providers
670
- * @example For AWS Polly: { engine: "neural", region: "us-east-1" }
671
- * @example For Google Cloud: { audioEncoding: "MP3", effectsProfileId: ["headphone-class-device"] }
672
- */
673
- providerOptions?: Record<string, any>;
674
- };
675
- [toolId: string]: any;
526
+ [toolId: string]: Record<string, unknown> | undefined;
676
527
  };
677
- /** Theme configuration (not in PNP) */
678
- themeConfig?: {
679
- scheme?: "default" | "high-contrast" | "dark";
680
- fontSize?: number;
681
- fontFamily?: string;
682
- lineHeight?: number;
683
- reducedMotion?: boolean;
684
- };
685
- /** Product-specific extensions */
686
- [key: string]: any;
687
528
  }
688
- /**
689
- * Calculator options exposed through assessment settings.
690
- * The engine is implicit (Desmos).
691
- */
692
- export interface AssessmentCalculatorConfig {
529
+ /** Calculator parameters in assessment settings. */
530
+ export type AssessmentCalculatorConfig = {
693
531
  type?: "basic" | "scientific" | "graphing";
694
- [key: string]: any;
695
- }
532
+ };
696
533
  /**
697
534
  * Item-level settings for tool requirements.
698
535
  * Used in AssessmentItemRef.settings to specify item-specific tool needs.
@@ -700,34 +537,8 @@ export interface AssessmentCalculatorConfig {
700
537
  export interface ItemSettings {
701
538
  requiredTools?: string[];
702
539
  restrictedTools?: string[];
703
- toolParameters?: Record<string, any>;
704
- [key: string]: any;
705
- }
706
- export interface SanctionedVersionEntity extends BaseEntity {
707
- organization?: string | OrganizationEntity;
708
- match: string;
709
- pie: string;
710
- version: string;
711
- }
712
- export declare enum SanctionedVersionChangeStatus {
713
- PENDING = "pending",
714
- IN_PROGRESS = "in_progress",
715
- COMPLETED = "completed",
716
- FAILED = "failed"
717
- }
718
- export interface SanctionedVersionChangeRequest {
719
- pie: string;
720
- match: string;
721
- version: string;
722
- }
723
- export interface SanctionedVersionChangeEntity extends BaseEntity {
724
- organization?: string | OrganizationEntity;
725
- createdBy: string | UserEntity;
726
- status: SanctionedVersionChangeStatus;
727
- requestedChanges: SanctionedVersionChangeRequest[];
728
- beforeState: SanctionedVersionEntity[];
729
- summary?: string;
730
- jobId: string;
540
+ /** Parameters by tool id; outranks the assessment's `toolConfigs` entry. */
541
+ toolParameters?: Record<string, Record<string, unknown>>;
731
542
  }
732
543
  export type PlayerMode = "gather" | "view" | "evaluate" | "author";
733
544
  export type PlayerRole = "student" | "instructor";
@@ -736,6 +547,27 @@ export interface Env {
736
547
  role: PlayerRole;
737
548
  partialScoring?: boolean;
738
549
  }
550
+ /** The `detail` of the `player-error` event `pie-item-player` dispatches. */
551
+ export interface PieItemPlayerErrorDetail {
552
+ /** The failure, e.g. `ITEM_PLAYER_LOAD_ERROR` or `PIE_CONTROLLER_RUNTIME_ERROR`. */
553
+ code: string;
554
+ message: string;
555
+ /**
556
+ * True when the item stays usable: a failed update leaves it as it was, and
557
+ * a failed controller falls back to the authored model. False when the
558
+ * player has no item to show.
559
+ */
560
+ recoverable: boolean;
561
+ /** On a load error, the loading step that failed, and the strategy and mode it loaded under. */
562
+ stage?: string;
563
+ strategy?: string;
564
+ mode?: string;
565
+ cause?: unknown;
566
+ /** On a controller error, the element's tag and id, and what the controller looked like. */
567
+ elementName?: string;
568
+ elementId?: string;
569
+ controllerShape?: string;
570
+ }
739
571
  export interface OutcomeResponse {
740
572
  id: string;
741
573
  element: string;
@@ -744,8 +576,14 @@ export interface OutcomeResponse {
744
576
  completed?: boolean;
745
577
  [key: string]: any;
746
578
  }
579
+ /**
580
+ * Persists `properties` into the stored session `id` of element `element`. The
581
+ * player passes it to `model()`, as `PieUpdateSession` in
582
+ * `@pie-element/shared-types` declares.
583
+ */
584
+ export type PieUpdateSession = (id: string, element: string, properties: Record<string, unknown>) => Promise<void>;
747
585
  export interface PieController {
748
- model(model: PieModel, sessionData: any[], env?: any): Promise<PieModel>;
586
+ model(model: PieModel, sessionData: any[], env?: any, updateSession?: PieUpdateSession): Promise<PieModel>;
749
587
  outcome(modelOrSessionData: PieModel | any[], sessionOrEnv?: any, env?: any): Promise<OutcomeResponse>;
750
588
  score: (config: object, session: object, env: object) => Promise<object>;
751
589
  createCorrectResponseSession: (config: object, env: object) => Promise<object>;
@@ -856,202 +694,8 @@ export declare class InsertSoundEvent extends CustomEvent<SoundHandler> {
856
694
  static TYPE: string;
857
695
  constructor(handler: SoundHandler);
858
696
  }
859
- export declare const isPassageEntity: (passage: string | PassageEntity | null | undefined) => passage is PassageEntity;
860
- export declare function isPrerelease(version: any): version is SemVer;
861
- export declare function formatVersion(semVer: SemVer): string;
862
697
  export interface PieElement extends HTMLElement {
863
698
  model: PieModel;
864
699
  configuration: any;
865
700
  session: any[];
866
701
  }
867
- export type SessionChangedDetail = {
868
- complete: boolean;
869
- component: any;
870
- };
871
- export declare class SessionChangedEvent extends CustomEvent<SessionChangedDetail> {
872
- readonly component: string;
873
- readonly complete: boolean;
874
- static TYPE: string;
875
- constructor(component: string, complete: boolean);
876
- }
877
- interface ItemCfg extends ConfigEntity {
878
- }
879
- interface ItemWPassageCfg {
880
- pie: ItemCfg;
881
- passage: ConfigEntity;
882
- }
883
- export interface LoadResponse {
884
- js: {
885
- view: string[];
886
- };
887
- item: ItemCfg | ItemWPassageCfg;
888
- session: {
889
- id: string;
890
- data: any[];
891
- };
892
- }
893
- export interface Tracker {
894
- track(message: string, ...args: any[]): void;
895
- start(label: string): void;
896
- end(label: string, metadata?: {
897
- [key: string]: any;
898
- }): void;
899
- }
900
- /**
901
- * Interface for storing tracker messages with timestamps
902
- */
903
- /**
904
- * Interface for storing tracker messages with timestamps
905
- */
906
- export interface TrackerMessage {
907
- timestamp: Date;
908
- message: string;
909
- args: any[];
910
- formattedMessage: string;
911
- }
912
- /**
913
- * Enhanced tracker that stores messages with timestamps
914
- */
915
- export interface EnhancedTracker extends Tracker {
916
- /**
917
- * Get all raw tracker messages ordered by timestamp (ascending)
918
- */
919
- getMessages(): TrackerMessage[];
920
- /**
921
- * Get a formatted multi-line representation of all tracker messages
922
- */
923
- getFormattedMessages(): string;
924
- }
925
- export interface ScoreResponse {
926
- session: FlatSession;
927
- score: SessionScore;
928
- empty?: boolean;
929
- [key: string]: any;
930
- }
931
- export interface VersionDiff {
932
- version: SemVer;
933
- previousVersion: SemVer | null;
934
- createdAt: Date;
935
- changes: {
936
- added: Record<string, any>;
937
- removed: Record<string, any>;
938
- modified: Record<string, {
939
- previous: any;
940
- current: any;
941
- }>;
942
- };
943
- changeCount: number;
944
- }
945
- export interface RoleToOrganizationsMapping {
946
- id?: string;
947
- role: string;
948
- organizations: OrganizationEntity[] | string[];
949
- createdAt?: Date;
950
- updatedAt?: Date;
951
- }
952
- export declare enum StandardType {
953
- ROOT = 0,
954
- SUBJECT = 1,
955
- LEVEL = 2,
956
- STANDARD = 3
957
- }
958
- export interface HierarchyInfo {
959
- root?: {
960
- id: string;
961
- guid: string;
962
- title: string;
963
- };
964
- subject?: {
965
- id: string;
966
- guid: string;
967
- title: string;
968
- };
969
- level?: {
970
- id: string;
971
- guid: string;
972
- title: string;
973
- grades: number[];
974
- };
975
- }
976
- export interface CmsLearningStandardEntity extends BaseEntity {
977
- guid: string;
978
- abbr?: string;
979
- type: StandardType;
980
- parentId?: string;
981
- parentGuid?: string;
982
- path?: string;
983
- depth: number;
984
- ancestors: string[];
985
- hierarchy?: HierarchyInfo;
986
- title?: string;
987
- description?: string;
988
- sequence?: string;
989
- orderIndex?: number;
990
- subjectArea?: string;
991
- subjectName?: string;
992
- category?: string;
993
- abType?: string;
994
- abLabel?: string;
995
- setName?: string;
996
- publication?: string;
997
- adopted?: string;
998
- grades: number[];
999
- gradeNames?: string[];
1000
- properties: Record<string, string>;
1001
- status?: "active" | "retired" | "deprecated";
1002
- lastModifiedAt?: Date;
1003
- replacesGuid?: string;
1004
- replacedByGuid?: string;
1005
- descriptionHtml?: string;
1006
- lastSyncedAt?: Date;
1007
- }
1008
- export interface ItemBankConfig {
1009
- collectionId: string;
1010
- subject?: string;
1011
- gradeLevels?: number[];
1012
- orderIndex: number;
1013
- }
1014
- export interface DOKDistribution {
1015
- dok1?: number;
1016
- dok2?: number;
1017
- dok3?: number;
1018
- dok4?: number;
1019
- }
1020
- export interface AssessmentGoal {
1021
- dokDistribution?: DOKDistribution;
1022
- constructedResponseCount?: number;
1023
- passageGoals?: string;
1024
- totalItemCount?: {
1025
- target?: number;
1026
- min?: number;
1027
- max?: number;
1028
- };
1029
- }
1030
- export interface StudioImportMetadata {
1031
- studioAssessmentProgramId?: string;
1032
- studioPublicId?: string;
1033
- importedAt?: Date;
1034
- }
1035
- export interface CmsBlueprintEntity extends BaseEntity {
1036
- name: string;
1037
- description?: string;
1038
- subject?: string;
1039
- standardSet?: string;
1040
- gradeLevels: number[];
1041
- states?: string[];
1042
- itemBankConfigs: ItemBankConfig[];
1043
- assessmentGoal?: AssessmentGoal;
1044
- claimFramework?: "SBAC" | "PARCC" | "STATE" | "CUSTOM";
1045
- claimTargets?: string[];
1046
- useSBACClusterTarget?: boolean;
1047
- clusters?: string[];
1048
- studioImportMetadata?: StudioImportMetadata;
1049
- originalPrompt?: string;
1050
- }
1051
- export interface CmsBlueprintItemEntity extends BaseEntity {
1052
- blueprintId: string;
1053
- standardGuid: string;
1054
- count: number;
1055
- details?: string;
1056
- assessmentId?: string;
1057
- }
@@ -1,28 +1,3 @@
1
- export var SessionEventType;
2
- (function (SessionEventType) {
3
- SessionEventType["SAVE"] = "save";
4
- SessionEventType["MODEL"] = "model";
5
- SessionEventType["SCORE"] = "score";
6
- SessionEventType["MANUAL_SCORE"] = "manual-score";
7
- })(SessionEventType || (SessionEventType = {}));
8
- export var ScoreType;
9
- (function (ScoreType) {
10
- ScoreType["AUTO"] = "auto";
11
- ScoreType["MANUAL"] = "manual";
12
- })(ScoreType || (ScoreType = {}));
13
- export var ModeType;
14
- (function (ModeType) {
15
- ModeType["GATHER"] = "gather";
16
- ModeType["VIEW"] = "view";
17
- ModeType["EVALUATE"] = "evaluate";
18
- })(ModeType || (ModeType = {}));
19
- export var SanctionedVersionChangeStatus;
20
- (function (SanctionedVersionChangeStatus) {
21
- SanctionedVersionChangeStatus["PENDING"] = "pending";
22
- SanctionedVersionChangeStatus["IN_PROGRESS"] = "in_progress";
23
- SanctionedVersionChangeStatus["COMPLETED"] = "completed";
24
- SanctionedVersionChangeStatus["FAILED"] = "failed";
25
- })(SanctionedVersionChangeStatus || (SanctionedVersionChangeStatus = {}));
26
1
  /**
27
2
  * During the loading of elements from PIE bundles, we do a trick where we make
28
3
  * editor components available as web components by appending this to the element name.
@@ -74,46 +49,3 @@ export class InsertSoundEvent extends CustomEvent {
74
49
  this.handler = handler;
75
50
  }
76
51
  }
77
- export const isPassageEntity = (passage) => typeof passage === "object" && passage !== null;
78
- export function isPrerelease(version) {
79
- return (typeof version === "object" &&
80
- version !== null &&
81
- typeof version.major === "number" &&
82
- typeof version.minor === "number" &&
83
- typeof version.patch === "number" &&
84
- !!version.prerelease && // Check if prerelease exists
85
- typeof version.prerelease.tag === "string" &&
86
- typeof version.prerelease.version === "number");
87
- }
88
- export function formatVersion(semVer) {
89
- if (!semVer)
90
- return "";
91
- const base = [semVer.major, semVer.minor, semVer.patch].join(".");
92
- if (isPrerelease(semVer) && semVer.prerelease) {
93
- const prerelease = [semVer.prerelease.tag, semVer.prerelease.version].join(".");
94
- return `${base}-${prerelease}`;
95
- }
96
- return base;
97
- }
98
- export class SessionChangedEvent extends CustomEvent {
99
- component;
100
- complete;
101
- static TYPE = "session-changed";
102
- constructor(component, complete) {
103
- super(SessionChangedEvent.TYPE, {
104
- bubbles: true,
105
- composed: true,
106
- detail: { complete, component },
107
- });
108
- this.component = component;
109
- this.complete = complete;
110
- }
111
- }
112
- // CMS Types (copied from @pie-api-aws/datastore to avoid importing server-only package)
113
- export var StandardType;
114
- (function (StandardType) {
115
- StandardType[StandardType["ROOT"] = 0] = "ROOT";
116
- StandardType[StandardType["SUBJECT"] = 1] = "SUBJECT";
117
- StandardType[StandardType["LEVEL"] = 2] = "LEVEL";
118
- StandardType[StandardType["STANDARD"] = 3] = "STANDARD";
119
- })(StandardType || (StandardType = {}));
@@ -1 +1,13 @@
1
1
  export declare function coerceBooleanLike(value: boolean | string | null | undefined, defaultValue?: boolean): boolean;
2
+ /**
3
+ * Reads a boolean attribute value: present is true and absent is false, as in
4
+ * HTML, except that the words `coerceBooleanLike` reads as false stay false.
5
+ */
6
+ export declare function coerceBooleanAttribute(value: string | null): boolean;
7
+ /**
8
+ * `customElement.extend` hook for a Svelte element with `type: "Boolean"`
9
+ * props. Svelte reads those by presence, so `show-bottom-border="false"` sets
10
+ * the prop to `true`; this passes Svelte a removed attribute whenever
11
+ * `coerceBooleanAttribute` reads the value as false.
12
+ */
13
+ export declare function coerceBooleanAttributes<Base extends CustomElementConstructor>(ElementClass: Base): Base;