@almadar/std 16.243.0 → 16.244.1

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 (140) hide show
  1. package/behaviors/behaviors-registry.json +72537 -31220
  2. package/behaviors/lolo/agent/atoms/std-agent-context.lolo +24 -4
  3. package/behaviors/lolo/agent/atoms/std-agent-memory.lolo +20 -5
  4. package/behaviors/lolo/agent/atoms/std-agent-proposal.lolo +550 -0
  5. package/behaviors/lolo/agent/atoms/std-agent-session.lolo +284 -25
  6. package/behaviors/lolo/agent/atoms/std-agent-suggestions.lolo +841 -0
  7. package/behaviors/lolo/agent/atoms/std-agent-tool-loop.lolo +58 -8
  8. package/behaviors/lolo/agent/organisms/std-agent-assistant.lolo +1 -0
  9. package/behaviors/lolo/infra/atoms/std-page-treat.lolo +28 -1
  10. package/behaviors/lolo/ui/avl/atoms/ui-avl-state-machine.lolo +22 -0
  11. package/behaviors/lolo/ui/avl/atoms/ui-avl-transition-explainer.lolo +175 -0
  12. package/behaviors/lolo/ui/avl/atoms/ui-module-card.lolo +22 -0
  13. package/behaviors/lolo/ui/core/atoms/std-app-layout.lolo +23 -4
  14. package/behaviors/lolo/ui/core/atoms/std-hero.lolo +72 -33
  15. package/behaviors/lolo/ui/core/molecules/ui-agent-chat-feed.lolo +1 -1
  16. package/behaviors/lolo/ui/core/molecules/ui-markdown-content.lolo +54 -0
  17. package/behaviors/lolo/ui/core/molecules/ui-upload-drop-zone.lolo +5 -0
  18. package/behaviors/lolo/ui/core/organisms/ui-segment-renderer.lolo +127 -3
  19. package/behaviors/lolo/ui/core/organisms/ui-state-machine-view.lolo +22 -0
  20. package/behaviors/lolo/ui/core/templates/ui-dashboard-layout.lolo +2 -2
  21. package/behaviors/lolo/ui/learning/atoms/std-learn-arrangement.lolo +87 -17
  22. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +172 -37
  23. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +183 -70
  24. package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +78 -13
  25. package/behaviors/lolo/ui/learning/atoms/std-learn-diagram.lolo +58 -2
  26. package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +107 -12
  27. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +83 -10
  28. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +130 -9
  29. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +143 -59
  30. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +96 -22
  31. package/behaviors/lolo/ui/learning/atoms/std-learn-live-sim.lolo +66 -5
  32. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +84 -6
  33. package/behaviors/lolo/ui/learning/atoms/std-learn-sandbox.lolo +80 -14
  34. package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +99 -5
  35. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +81 -7
  36. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +83 -7
  37. package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +224 -99
  38. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +63 -2
  39. package/behaviors/lolo/ui/learning/atoms/std-learn-trace-player.lolo +99 -38
  40. package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +7 -7
  41. package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +69 -4
  42. package/behaviors/lolo-behavior-contracts.json +1 -1
  43. package/behaviors/registry/agent/atoms/std-agent-context.orb +205 -6
  44. package/behaviors/registry/agent/atoms/std-agent-memory.orb +146 -4
  45. package/behaviors/registry/agent/atoms/std-agent-proposal.orb +1972 -0
  46. package/behaviors/registry/agent/atoms/std-agent-session.orb +2021 -597
  47. package/behaviors/registry/agent/atoms/std-agent-suggestions.orb +5079 -0
  48. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +287 -5
  49. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +7 -0
  50. package/behaviors/registry/factory-signatures.json +1 -1
  51. package/behaviors/registry/infra/atoms/std-page-treat.orb +327 -2
  52. package/behaviors/registry/ui/avl/atoms/ui-avl-state-machine.orb +134 -0
  53. package/behaviors/registry/ui/avl/atoms/ui-avl-transition-explainer.orb +678 -0
  54. package/behaviors/registry/ui/avl/atoms/ui-module-card.orb +122 -0
  55. package/behaviors/registry/ui/core/atoms/std-app-layout.orb +73 -4
  56. package/behaviors/registry/ui/core/atoms/std-hero.orb +174 -97
  57. package/behaviors/registry/ui/core/molecules/ui-markdown-content.orb +204 -1
  58. package/behaviors/registry/ui/core/molecules/ui-upload-drop-zone.orb +12 -0
  59. package/behaviors/registry/ui/core/organisms/ui-segment-renderer.orb +683 -30
  60. package/behaviors/registry/ui/learning/atoms/std-learn-arrangement.orb +748 -21
  61. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1429 -41
  62. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +1031 -185
  63. package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +807 -132
  64. package/behaviors/registry/ui/learning/atoms/std-learn-diagram.orb +553 -6
  65. package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +987 -21
  66. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +582 -16
  67. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +954 -13
  68. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +828 -88
  69. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +730 -28
  70. package/behaviors/registry/ui/learning/atoms/std-learn-live-sim.orb +479 -9
  71. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +797 -46
  72. package/behaviors/registry/ui/learning/atoms/std-learn-sandbox.orb +757 -58
  73. package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +1176 -164
  74. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +599 -12
  75. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +832 -150
  76. package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +1561 -127
  77. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +655 -6
  78. package/behaviors/registry/ui/learning/atoms/std-learn-trace-player.orb +634 -43
  79. package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +85 -31
  80. package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +425 -9
  81. package/canonical-operators.json +45 -2
  82. package/dist/behaviors/exports-reader.js +16667 -7868
  83. package/dist/behaviors/functions/index.d.ts +711 -32
  84. package/dist/behaviors/functions/index.js +16651 -7869
  85. package/dist/behaviors/index.d.ts +1 -1
  86. package/dist/behaviors/index.js +16668 -7869
  87. package/dist/behaviors/query.js +16667 -7868
  88. package/dist/behaviors-embeddings.hash.json +3 -3
  89. package/dist/behaviors-embeddings.json +77 -53
  90. package/dist/behaviors-registry.json +72537 -31220
  91. package/dist/index.d.ts +3 -3
  92. package/dist/index.js +16101 -7275
  93. package/dist/knob-embeddings.hash.json +3 -3
  94. package/dist/knob-embeddings.json +11617 -1225
  95. package/dist/modules/anim.d.ts +1 -1
  96. package/dist/modules/array.d.ts +1 -1
  97. package/dist/modules/async.d.ts +1 -1
  98. package/dist/modules/behavior.d.ts +1 -1
  99. package/dist/modules/browser.d.ts +1 -1
  100. package/dist/modules/composition.d.ts +1 -1
  101. package/dist/modules/contract.d.ts +1 -1
  102. package/dist/modules/core.d.ts +1 -1
  103. package/dist/modules/core.js +29 -2
  104. package/dist/modules/data.d.ts +1 -1
  105. package/dist/modules/ease.d.ts +1 -1
  106. package/dist/modules/format.d.ts +1 -1
  107. package/dist/modules/geo.d.ts +1 -1
  108. package/dist/modules/graph.d.ts +1 -1
  109. package/dist/modules/grid.d.ts +1 -1
  110. package/dist/modules/i18n.d.ts +1 -1
  111. package/dist/modules/index.d.ts +1 -1
  112. package/dist/modules/index.js +29 -2
  113. package/dist/modules/integration.d.ts +1 -1
  114. package/dist/modules/json.d.ts +1 -1
  115. package/dist/modules/llm.d.ts +1 -1
  116. package/dist/modules/math.d.ts +1 -1
  117. package/dist/modules/memory.d.ts +1 -1
  118. package/dist/modules/nn.d.ts +1 -1
  119. package/dist/modules/noise.d.ts +1 -1
  120. package/dist/modules/object.d.ts +1 -1
  121. package/dist/modules/os.d.ts +1 -1
  122. package/dist/modules/path.d.ts +1 -1
  123. package/dist/modules/prob.d.ts +1 -1
  124. package/dist/modules/session.d.ts +1 -1
  125. package/dist/modules/str.d.ts +1 -1
  126. package/dist/modules/tensor.d.ts +1 -1
  127. package/dist/modules/time.d.ts +1 -1
  128. package/dist/modules/trace.d.ts +1 -1
  129. package/dist/modules/train.d.ts +1 -1
  130. package/dist/modules/validate.d.ts +1 -1
  131. package/dist/modules/vector.d.ts +1 -1
  132. package/dist/modules/workspace.d.ts +1 -1
  133. package/dist/registry/factory-signatures.json +1 -1
  134. package/dist/registry.d.ts +2 -2
  135. package/dist/registry.js +29 -2
  136. package/dist/{types-Cdb321uM.d.ts → types-Y-yYWEOX.d.ts} +1 -1
  137. package/i18n/ar.json +3 -1
  138. package/i18n/en.json +2 -0
  139. package/i18n/sl.json +3 -1
  140. package/package.json +3 -3
@@ -91,6 +91,15 @@
91
91
  "parent": "trt_01M07581K2JSWMZDZSAVQSR6A2",
92
92
  "renames": []
93
93
  },
94
+ "evt_01M459WQVW6GH6CB2HHRTQ10A6": {
95
+ "bakedName": "ROSTER_LOADED",
96
+ "curName": "ROSTER_LOADED",
97
+ "id": "evt_01M459WQVW6GH6CB2HHRTQ10A6",
98
+ "kind": "event",
99
+ "owner": "workspace",
100
+ "parent": "trt_01M07581K2JSWMZDZSAVQSR6A2",
101
+ "renames": []
102
+ },
94
103
  "orb_01M07581K2ME2E69WCC1KWC0X8": {
95
104
  "bakedName": "SpeedDrillOrbital",
96
105
  "curName": "SpeedDrillOrbital",
@@ -137,6 +146,33 @@
137
146
  "name": "title",
138
147
  "type": "string"
139
148
  },
149
+ {
150
+ "items": {
151
+ "properties": {
152
+ "correctIndex": {
153
+ "name": "correctIndex",
154
+ "required": true,
155
+ "type": "number"
156
+ },
157
+ "options": {
158
+ "items": {
159
+ "type": "string"
160
+ },
161
+ "name": "options",
162
+ "required": true,
163
+ "type": "array"
164
+ },
165
+ "prompt": {
166
+ "name": "prompt",
167
+ "required": true,
168
+ "type": "string"
169
+ }
170
+ },
171
+ "type": "object"
172
+ },
173
+ "name": "items",
174
+ "type": "array"
175
+ },
140
176
  {
141
177
  "default": 0.0,
142
178
  "name": "itemIndex",
@@ -307,7 +343,7 @@
307
343
  },
308
344
  "matchMode": {
309
345
  "default": "",
310
- "description": "When composed behind a lab router, the MODE_SELECTED mode value this instrument responds to. Empty string means standalone — render immediately on INIT.",
346
+ "description": "When composed behind a lab router, the MODE_SELECTED mode value this instrument responds to. Empty string means standalone — render immediately on INIT, or on ROSTER_LOADED when rosterSource is event.",
311
347
  "label": "Match Mode",
312
348
  "tier": "presentation",
313
349
  "type": "string"
@@ -324,6 +360,17 @@
324
360
  "tier": "presentation",
325
361
  "type": "string"
326
362
  },
363
+ "rosterSource": {
364
+ "default": "config",
365
+ "description": "Where the roster comes from: config reads items knob at INIT; event waits for ROSTER_LOADED and takes the roster from its payload.",
366
+ "label": "Roster Source",
367
+ "tier": "domain",
368
+ "type": "string",
369
+ "values": [
370
+ "config",
371
+ "event"
372
+ ]
373
+ },
327
374
  "speedBonus": {
328
375
  "default": 10.0,
329
376
  "description": "Maximum extra points awarded in proportion to the time left on the clock.",
@@ -403,6 +450,10 @@
403
450
  "kind": "set",
404
451
  "resource": "@entity.itemIndex"
405
452
  },
453
+ {
454
+ "kind": "set",
455
+ "resource": "@entity.items"
456
+ },
406
457
  {
407
458
  "kind": "set",
408
459
  "resource": "@entity.options"
@@ -560,6 +611,7 @@
560
611
  "done",
561
612
  "feedback",
562
613
  "itemIndex",
614
+ "items",
563
615
  "options",
564
616
  "pickedIndex",
565
617
  "promptText",
@@ -603,6 +655,42 @@
603
655
  ],
604
656
  "tier": "domain"
605
657
  },
658
+ {
659
+ "description": "Runtime content feed, honoured only when rosterSource is event — mode names the instrument it is for (the matchMode it carries, blank when standalone) and items is the drill roster; a matching instrument re-initialises from it exactly as INIT does from config, any other instrument hides.",
660
+ "id": "evt_01M459WQVW6GH6CB2HHRTQ10A6",
661
+ "key": "ROSTER_LOADED",
662
+ "name": "Roster Loaded",
663
+ "payloadSchema": [
664
+ {
665
+ "name": "mode",
666
+ "required": true,
667
+ "type": "string"
668
+ },
669
+ {
670
+ "name": "items",
671
+ "properties": [
672
+ {
673
+ "name": "prompt",
674
+ "required": true,
675
+ "type": "string"
676
+ },
677
+ {
678
+ "name": "options",
679
+ "required": true,
680
+ "type": "[string]"
681
+ },
682
+ {
683
+ "name": "correctIndex",
684
+ "required": true,
685
+ "type": "number"
686
+ }
687
+ ],
688
+ "required": true,
689
+ "type": "[object]"
690
+ }
691
+ ],
692
+ "tier": "domain"
693
+ },
606
694
  {
607
695
  "description": "Learner picked an option while the clock was running — index is the chosen option; it is judged immediately and scored with a speed bonus.",
608
696
  "id": "evt_01M07581K7KS1XANK51S5C3WTP",
@@ -614,110 +702,675 @@
614
702
  "type": "number"
615
703
  }
616
704
  ],
617
- "tier": "domain"
618
- },
619
- {
620
- "description": "Learner advanced to the next item after a verdict (answered or timed out); past the last item this completes the round.",
621
- "id": "evt_01M07581K7H28V8MJMBSBFEGCN",
622
- "key": "NEXT",
623
- "name": "Next",
624
- "tier": "domain"
625
- },
626
- {
627
- "description": "Learner restarted the round from the first item with a cleared score and streak.",
628
- "id": "evt_01M07581K7405N4D7KZFGQSVC5",
629
- "key": "RETRY",
630
- "name": "Retry",
631
- "tier": "domain"
632
- },
633
- {
634
- "description": "The verdict of a speeded answer: correctness, tenths of a second left on the clock, and the running score and streak — a composed listener (coach, grader) can subscribe; a harmless no-op when the atom runs standalone.",
635
- "id": "evt_01M07581K7Y94VWHN8SC6JD86W",
636
- "key": "ANSWER_JUDGED",
637
- "name": "Answer Judged",
638
- "payloadSchema": [
639
- {
640
- "name": "correct",
641
- "type": "boolean"
642
- },
643
- {
644
- "name": "timeLeftTenths",
645
- "type": "number"
646
- },
647
- {
648
- "name": "score",
649
- "type": "number"
650
- },
651
- {
652
- "name": "streak",
653
- "type": "number"
654
- }
705
+ "tier": "domain"
706
+ },
707
+ {
708
+ "description": "Learner advanced to the next item after a verdict (answered or timed out); past the last item this completes the round.",
709
+ "id": "evt_01M07581K7H28V8MJMBSBFEGCN",
710
+ "key": "NEXT",
711
+ "name": "Next",
712
+ "tier": "domain"
713
+ },
714
+ {
715
+ "description": "Learner restarted the round from the first item with a cleared score and streak.",
716
+ "id": "evt_01M07581K7405N4D7KZFGQSVC5",
717
+ "key": "RETRY",
718
+ "name": "Retry",
719
+ "tier": "domain"
720
+ },
721
+ {
722
+ "description": "The verdict of a speeded answer: correctness, tenths of a second left on the clock, and the running score and streak — a composed listener (coach, grader) can subscribe; a harmless no-op when the atom runs standalone.",
723
+ "id": "evt_01M07581K7Y94VWHN8SC6JD86W",
724
+ "key": "ANSWER_JUDGED",
725
+ "name": "Answer Judged",
726
+ "payloadSchema": [
727
+ {
728
+ "name": "correct",
729
+ "type": "boolean"
730
+ },
731
+ {
732
+ "name": "timeLeftTenths",
733
+ "type": "number"
734
+ },
735
+ {
736
+ "name": "score",
737
+ "type": "number"
738
+ },
739
+ {
740
+ "name": "streak",
741
+ "type": "number"
742
+ }
743
+ ],
744
+ "synonyms": "speed drill, reaction time, fluency, timed quiz, countdown, rapid recall",
745
+ "tier": "domain"
746
+ },
747
+ {
748
+ "description": "The learner moved to the next item (or completed the round) with the running score.",
749
+ "id": "evt_01M07581K7FSJ5FS5ZGA7NSXQA",
750
+ "key": "PROMPT_ADVANCED",
751
+ "name": "Prompt Advanced",
752
+ "payloadSchema": [
753
+ {
754
+ "name": "itemIndex",
755
+ "type": "number"
756
+ },
757
+ {
758
+ "name": "done",
759
+ "type": "boolean"
760
+ },
761
+ {
762
+ "name": "score",
763
+ "type": "number"
764
+ }
765
+ ],
766
+ "tier": "domain"
767
+ },
768
+ {
769
+ "description": "The learner restarted the round from scratch.",
770
+ "id": "evt_01M07581K78GXNST8AG0BTCVS8",
771
+ "key": "ROUND_RESTARTED",
772
+ "name": "Round Restarted",
773
+ "payloadSchema": [
774
+ {
775
+ "name": "totalItems",
776
+ "type": "number"
777
+ }
778
+ ],
779
+ "tier": "domain"
780
+ },
781
+ {
782
+ "description": "Fired once when the round finishes (advancing past the final prompt) — the standard learning completion broadcast a celebration/progression sibling (fx cues, badges) rides.",
783
+ "id": "evt_01M0GTSZHFPPWVV9N240SJMS4J",
784
+ "key": "LEARN_ROUND_COMPLETE",
785
+ "name": "Learn Round Complete",
786
+ "payloadSchema": [
787
+ {
788
+ "name": "score",
789
+ "type": "number"
790
+ },
791
+ {
792
+ "name": "total",
793
+ "type": "number"
794
+ }
795
+ ],
796
+ "synonyms": "round complete, finished, done, completion",
797
+ "tier": "domain"
798
+ }
799
+ ],
800
+ "states": [
801
+ {
802
+ "isInitial": true,
803
+ "name": "idle"
804
+ }
805
+ ],
806
+ "transitions": [
807
+ {
808
+ "effects": [
809
+ [
810
+ "set",
811
+ "@entity.items",
812
+ "@config.items"
813
+ ],
814
+ [
815
+ "let",
816
+ [
817
+ [
818
+ "first",
819
+ [
820
+ "array/nth",
821
+ "@config.items",
822
+ 0.0
823
+ ]
824
+ ]
825
+ ],
826
+ [
827
+ "do",
828
+ [
829
+ "set",
830
+ "@entity.active",
831
+ true
832
+ ],
833
+ [
834
+ "set",
835
+ "@entity.title",
836
+ "@config.title"
837
+ ],
838
+ [
839
+ "set",
840
+ "@entity.itemIndex",
841
+ 0.0
842
+ ],
843
+ [
844
+ "set",
845
+ "@entity.totalItems",
846
+ [
847
+ "array/len",
848
+ "@config.items"
849
+ ]
850
+ ],
851
+ [
852
+ "set",
853
+ "@entity.remaining",
854
+ [
855
+ "*",
856
+ "@config.timeLimit",
857
+ 10.0
858
+ ]
859
+ ],
860
+ [
861
+ "set",
862
+ "@entity.running",
863
+ true
864
+ ],
865
+ [
866
+ "set",
867
+ "@entity.verdict",
868
+ ""
869
+ ],
870
+ [
871
+ "set",
872
+ "@entity.pickedIndex",
873
+ -1.0
874
+ ],
875
+ [
876
+ "set",
877
+ "@entity.score",
878
+ 0.0
879
+ ],
880
+ [
881
+ "set",
882
+ "@entity.streak",
883
+ 0.0
884
+ ],
885
+ [
886
+ "set",
887
+ "@entity.bestStreak",
888
+ 0.0
889
+ ],
890
+ [
891
+ "set",
892
+ "@entity.done",
893
+ false
894
+ ],
895
+ [
896
+ "set",
897
+ "@entity.promptText",
898
+ [
899
+ "object/get",
900
+ "@first",
901
+ "prompt"
902
+ ]
903
+ ],
904
+ [
905
+ "set",
906
+ "@entity.options",
907
+ [
908
+ "object/get",
909
+ "@first",
910
+ "options"
911
+ ]
912
+ ],
913
+ [
914
+ "set",
915
+ "@entity.correctIndex",
916
+ [
917
+ "object/get",
918
+ "@first",
919
+ "correctIndex"
920
+ ]
921
+ ],
922
+ [
923
+ "set",
924
+ "@entity.feedback",
925
+ ""
926
+ ],
927
+ [
928
+ "set",
929
+ "@entity.view",
930
+ [
931
+ {
932
+ "children": [
933
+ {
934
+ "content": "@entity.promptText",
935
+ "type": "typography",
936
+ "variant": "h4"
937
+ }
938
+ ],
939
+ "padding": "md",
940
+ "type": "card",
941
+ "variant": "bordered"
942
+ }
943
+ ]
944
+ ]
945
+ ]
946
+ ],
947
+ [
948
+ "render-ui",
949
+ "main",
950
+ {
951
+ "children": [
952
+ {
953
+ "children": [
954
+ {
955
+ "align": "start",
956
+ "children": [
957
+ {
958
+ "children": [
959
+ {
960
+ "content": "@entity.title",
961
+ "type": "typography",
962
+ "variant": "h4"
963
+ },
964
+ [
965
+ "if",
966
+ [
967
+ "==",
968
+ "@config.summary",
969
+ ""
970
+ ],
971
+ null,
972
+ {
973
+ "color": "muted",
974
+ "content": "@config.summary",
975
+ "type": "typography",
976
+ "variant": "body2"
977
+ }
978
+ ]
979
+ ],
980
+ "direction": "vertical",
981
+ "gap": "xs",
982
+ "type": "stack"
983
+ },
984
+ {
985
+ "label": [
986
+ "if",
987
+ "@entity.done",
988
+ "Round complete",
989
+ [
990
+ "str/concat",
991
+ "@entity.score",
992
+ " pts · streak ",
993
+ "@entity.streak"
994
+ ]
995
+ ],
996
+ "type": "badge",
997
+ "variant": [
998
+ "if",
999
+ "@entity.done",
1000
+ "primary",
1001
+ [
1002
+ "if",
1003
+ [
1004
+ "==",
1005
+ "@entity.verdict",
1006
+ "correct"
1007
+ ],
1008
+ "success",
1009
+ [
1010
+ "if",
1011
+ [
1012
+ "==",
1013
+ "@entity.verdict",
1014
+ ""
1015
+ ],
1016
+ "neutral",
1017
+ "error"
1018
+ ]
1019
+ ]
1020
+ ]
1021
+ }
1022
+ ],
1023
+ "direction": "horizontal",
1024
+ "gap": "md",
1025
+ "justify": "between",
1026
+ "type": "stack"
1027
+ },
1028
+ {
1029
+ "label": [
1030
+ "str/concat",
1031
+ "Item ",
1032
+ [
1033
+ "str/concat",
1034
+ "",
1035
+ [
1036
+ "+",
1037
+ "@entity.itemIndex",
1038
+ 1.0
1039
+ ]
1040
+ ],
1041
+ " of ",
1042
+ [
1043
+ "str/concat",
1044
+ "",
1045
+ "@entity.totalItems"
1046
+ ]
1047
+ ],
1048
+ "max": "@entity.totalItems",
1049
+ "showPercentage": false,
1050
+ "type": "progress-bar",
1051
+ "value": [
1052
+ "+",
1053
+ "@entity.itemIndex",
1054
+ 1.0
1055
+ ]
1056
+ },
1057
+ {
1058
+ "label": [
1059
+ "str/concat",
1060
+ "Time left: ",
1061
+ [
1062
+ "math/round",
1063
+ [
1064
+ "/",
1065
+ "@entity.remaining",
1066
+ 10.0
1067
+ ],
1068
+ 1.0
1069
+ ],
1070
+ "s"
1071
+ ],
1072
+ "max": [
1073
+ "*",
1074
+ "@config.timeLimit",
1075
+ 10.0
1076
+ ],
1077
+ "showPercentage": false,
1078
+ "type": "progress-bar",
1079
+ "value": "@entity.remaining",
1080
+ "variant": [
1081
+ "if",
1082
+ [
1083
+ "<",
1084
+ "@entity.remaining",
1085
+ [
1086
+ "*",
1087
+ "@config.timeLimit",
1088
+ 3.0
1089
+ ]
1090
+ ],
1091
+ "warning",
1092
+ "primary"
1093
+ ]
1094
+ },
1095
+ {
1096
+ "children": "@entity.view",
1097
+ "direction": "vertical",
1098
+ "gap": "md",
1099
+ "type": "stack"
1100
+ },
1101
+ {
1102
+ "children": [
1103
+ "array/map",
1104
+ [
1105
+ "array/range",
1106
+ 0.0,
1107
+ [
1108
+ "array/len",
1109
+ "@entity.options"
1110
+ ]
1111
+ ],
1112
+ [
1113
+ "fn",
1114
+ [
1115
+ "i"
1116
+ ],
1117
+ {
1118
+ "action": "ANSWER",
1119
+ "actionPayload": {
1120
+ "index": "@i"
1121
+ },
1122
+ "disabled": [
1123
+ "not",
1124
+ "@entity.running"
1125
+ ],
1126
+ "label": [
1127
+ "array/nth",
1128
+ "@entity.options",
1129
+ "@i"
1130
+ ],
1131
+ "size": "lg",
1132
+ "type": "button",
1133
+ "variant": [
1134
+ "if",
1135
+ "@entity.running",
1136
+ "secondary",
1137
+ [
1138
+ "if",
1139
+ [
1140
+ "==",
1141
+ "@i",
1142
+ "@entity.correctIndex"
1143
+ ],
1144
+ "success",
1145
+ [
1146
+ "if",
1147
+ [
1148
+ "==",
1149
+ "@i",
1150
+ "@entity.pickedIndex"
1151
+ ],
1152
+ "danger",
1153
+ "ghost"
1154
+ ]
1155
+ ]
1156
+ ]
1157
+ }
1158
+ ]
1159
+ ],
1160
+ "direction": "vertical",
1161
+ "gap": "sm",
1162
+ "type": "stack"
1163
+ },
1164
+ [
1165
+ "if",
1166
+ [
1167
+ "or",
1168
+ [
1169
+ "==",
1170
+ "@entity.feedback",
1171
+ ""
1172
+ ],
1173
+ "@entity.done"
1174
+ ],
1175
+ null,
1176
+ {
1177
+ "children": [
1178
+ {
1179
+ "label": [
1180
+ "if",
1181
+ [
1182
+ "==",
1183
+ "@entity.verdict",
1184
+ "correct"
1185
+ ],
1186
+ "Correct",
1187
+ [
1188
+ "if",
1189
+ [
1190
+ "==",
1191
+ "@entity.verdict",
1192
+ "timeout"
1193
+ ],
1194
+ "Time's up",
1195
+ "Incorrect"
1196
+ ]
1197
+ ],
1198
+ "type": "badge",
1199
+ "variant": [
1200
+ "if",
1201
+ [
1202
+ "==",
1203
+ "@entity.verdict",
1204
+ "correct"
1205
+ ],
1206
+ "success",
1207
+ "error"
1208
+ ]
1209
+ },
1210
+ {
1211
+ "content": "@entity.feedback",
1212
+ "type": "typography",
1213
+ "variant": "body"
1214
+ }
1215
+ ],
1216
+ "direction": "vertical",
1217
+ "gap": "xs",
1218
+ "type": "stack"
1219
+ }
1220
+ ],
1221
+ [
1222
+ "if",
1223
+ "@entity.done",
1224
+ {
1225
+ "content": "@entity.feedback",
1226
+ "type": "typography",
1227
+ "variant": "body"
1228
+ },
1229
+ null
1230
+ ],
1231
+ {
1232
+ "align": "center",
1233
+ "children": [
1234
+ {
1235
+ "action": "NEXT",
1236
+ "disabled": [
1237
+ "if",
1238
+ [
1239
+ "and",
1240
+ [
1241
+ "==",
1242
+ "@entity.running",
1243
+ false
1244
+ ],
1245
+ [
1246
+ "and",
1247
+ [
1248
+ "!=",
1249
+ "@entity.verdict",
1250
+ ""
1251
+ ],
1252
+ [
1253
+ "==",
1254
+ "@entity.done",
1255
+ false
1256
+ ]
1257
+ ]
1258
+ ],
1259
+ false,
1260
+ true
1261
+ ],
1262
+ "icon": "chevron-right",
1263
+ "label": "@config.nextLabel",
1264
+ "type": "button",
1265
+ "variant": "primary"
1266
+ },
1267
+ {
1268
+ "action": "RETRY",
1269
+ "disabled": [
1270
+ "if",
1271
+ "@entity.done",
1272
+ false,
1273
+ true
1274
+ ],
1275
+ "icon": "rotate-ccw",
1276
+ "label": "@config.retryLabel",
1277
+ "type": "button",
1278
+ "variant": "ghost"
1279
+ },
1280
+ {
1281
+ "color": "muted",
1282
+ "content": [
1283
+ "str/concat",
1284
+ "Best streak ",
1285
+ "@entity.bestStreak"
1286
+ ],
1287
+ "type": "typography",
1288
+ "variant": "caption"
1289
+ }
1290
+ ],
1291
+ "direction": "horizontal",
1292
+ "gap": "sm",
1293
+ "type": "stack",
1294
+ "wrap": true
1295
+ }
1296
+ ],
1297
+ "direction": "vertical",
1298
+ "gap": "md",
1299
+ "type": "stack"
1300
+ }
1301
+ ],
1302
+ "padding": "md",
1303
+ "type": "box"
1304
+ }
1305
+ ]
1306
+ ],
1307
+ "event": "INIT",
1308
+ "eventId": "evt_01M07581K2J8J66ZVYN4B43N01",
1309
+ "from": "idle",
1310
+ "guard": [
1311
+ "and",
1312
+ [
1313
+ "==",
1314
+ "@config.matchMode",
1315
+ ""
1316
+ ],
1317
+ [
1318
+ "==",
1319
+ "@config.rosterSource",
1320
+ "config"
1321
+ ]
655
1322
  ],
656
- "synonyms": "speed drill, reaction time, fluency, timed quiz, countdown, rapid recall",
657
- "tier": "domain"
1323
+ "to": "idle"
658
1324
  },
659
1325
  {
660
- "description": "The learner moved to the next item (or completed the round) with the running score.",
661
- "id": "evt_01M07581K7FSJ5FS5ZGA7NSXQA",
662
- "key": "PROMPT_ADVANCED",
663
- "name": "Prompt Advanced",
664
- "payloadSchema": [
665
- {
666
- "name": "itemIndex",
667
- "type": "number"
668
- },
669
- {
670
- "name": "done",
671
- "type": "boolean"
672
- },
673
- {
674
- "name": "score",
675
- "type": "number"
676
- }
1326
+ "effects": [
1327
+ [
1328
+ "set",
1329
+ "@entity.active",
1330
+ false
1331
+ ],
1332
+ [
1333
+ "set",
1334
+ "@entity.running",
1335
+ false
1336
+ ],
1337
+ [
1338
+ "render-ui",
1339
+ "main",
1340
+ null
1341
+ ]
677
1342
  ],
678
- "tier": "domain"
679
- },
680
- {
681
- "description": "The learner restarted the round from scratch.",
682
- "id": "evt_01M07581K78GXNST8AG0BTCVS8",
683
- "key": "ROUND_RESTARTED",
684
- "name": "Round Restarted",
685
- "payloadSchema": [
686
- {
687
- "name": "totalItems",
688
- "type": "number"
689
- }
1343
+ "event": "MODE_SELECTED",
1344
+ "eventId": "evt_01M07581K79NFK2TV53DRCRDW8",
1345
+ "from": "idle",
1346
+ "guard": [
1347
+ "and",
1348
+ [
1349
+ "not",
1350
+ [
1351
+ "==",
1352
+ "@config.matchMode",
1353
+ ""
1354
+ ]
1355
+ ],
1356
+ [
1357
+ "not",
1358
+ [
1359
+ "==",
1360
+ "@payload.mode",
1361
+ "@config.matchMode"
1362
+ ]
1363
+ ]
690
1364
  ],
691
- "tier": "domain"
1365
+ "to": "idle"
692
1366
  },
693
- {
694
- "description": "Fired once when the round finishes (advancing past the final prompt) — the standard learning completion broadcast a celebration/progression sibling (fx cues, badges) rides.",
695
- "id": "evt_01M0GTSZHFPPWVV9N240SJMS4J",
696
- "key": "LEARN_ROUND_COMPLETE",
697
- "name": "Learn Round Complete",
698
- "payloadSchema": [
699
- {
700
- "name": "score",
701
- "type": "number"
702
- },
703
- {
704
- "name": "total",
705
- "type": "number"
706
- }
707
- ],
708
- "synonyms": "round complete, finished, done, completion",
709
- "tier": "domain"
710
- }
711
- ],
712
- "states": [
713
- {
714
- "isInitial": true,
715
- "name": "idle"
716
- }
717
- ],
718
- "transitions": [
719
1367
  {
720
1368
  "effects": [
1369
+ [
1370
+ "set",
1371
+ "@entity.items",
1372
+ "@config.items"
1373
+ ],
721
1374
  [
722
1375
  "let",
723
1376
  [
@@ -1211,60 +1864,31 @@
1211
1864
  }
1212
1865
  ]
1213
1866
  ],
1214
- "event": "INIT",
1215
- "eventId": "evt_01M07581K2J8J66ZVYN4B43N01",
1216
- "from": "idle",
1217
- "guard": [
1218
- "==",
1219
- "@config.matchMode",
1220
- ""
1221
- ],
1222
- "to": "idle"
1223
- },
1224
- {
1225
- "effects": [
1226
- [
1227
- "set",
1228
- "@entity.active",
1229
- false
1230
- ],
1231
- [
1232
- "set",
1233
- "@entity.running",
1234
- false
1235
- ],
1236
- [
1237
- "render-ui",
1238
- "main",
1239
- null
1240
- ]
1241
- ],
1242
1867
  "event": "MODE_SELECTED",
1243
1868
  "eventId": "evt_01M07581K79NFK2TV53DRCRDW8",
1244
1869
  "from": "idle",
1245
1870
  "guard": [
1246
1871
  "and",
1247
1872
  [
1248
- "not",
1249
- [
1250
- "==",
1251
- "@config.matchMode",
1252
- ""
1253
- ]
1873
+ "==",
1874
+ "@payload.mode",
1875
+ "@config.matchMode"
1254
1876
  ],
1255
1877
  [
1256
- "not",
1257
- [
1258
- "==",
1259
- "@payload.mode",
1260
- "@config.matchMode"
1261
- ]
1878
+ "==",
1879
+ "@config.rosterSource",
1880
+ "config"
1262
1881
  ]
1263
1882
  ],
1264
1883
  "to": "idle"
1265
1884
  },
1266
1885
  {
1267
1886
  "effects": [
1887
+ [
1888
+ "set",
1889
+ "@entity.items",
1890
+ "@payload.items"
1891
+ ],
1268
1892
  [
1269
1893
  "let",
1270
1894
  [
@@ -1272,7 +1896,7 @@
1272
1896
  "first",
1273
1897
  [
1274
1898
  "array/nth",
1275
- "@config.items",
1899
+ "@payload.items",
1276
1900
  0.0
1277
1901
  ]
1278
1902
  ]
@@ -1299,7 +1923,7 @@
1299
1923
  "@entity.totalItems",
1300
1924
  [
1301
1925
  "array/len",
1302
- "@config.items"
1926
+ "@payload.items"
1303
1927
  ]
1304
1928
  ],
1305
1929
  [
@@ -1758,13 +2382,71 @@
1758
2382
  }
1759
2383
  ]
1760
2384
  ],
1761
- "event": "MODE_SELECTED",
1762
- "eventId": "evt_01M07581K79NFK2TV53DRCRDW8",
2385
+ "event": "ROSTER_LOADED",
2386
+ "eventId": "evt_01M459WQVW6GH6CB2HHRTQ10A6",
1763
2387
  "from": "idle",
1764
2388
  "guard": [
1765
- "==",
1766
- "@payload.mode",
1767
- "@config.matchMode"
2389
+ "and",
2390
+ [
2391
+ "==",
2392
+ "@config.rosterSource",
2393
+ "event"
2394
+ ],
2395
+ [
2396
+ "and",
2397
+ [
2398
+ "==",
2399
+ "@payload.mode",
2400
+ "@config.matchMode"
2401
+ ],
2402
+ [
2403
+ ">",
2404
+ [
2405
+ "array/len",
2406
+ "@payload.items"
2407
+ ],
2408
+ 0.0
2409
+ ]
2410
+ ]
2411
+ ],
2412
+ "to": "idle"
2413
+ },
2414
+ {
2415
+ "effects": [
2416
+ [
2417
+ "set",
2418
+ "@entity.active",
2419
+ false
2420
+ ],
2421
+ [
2422
+ "set",
2423
+ "@entity.running",
2424
+ false
2425
+ ],
2426
+ [
2427
+ "render-ui",
2428
+ "main",
2429
+ null
2430
+ ]
2431
+ ],
2432
+ "event": "ROSTER_LOADED",
2433
+ "eventId": "evt_01M459WQVW6GH6CB2HHRTQ10A6",
2434
+ "from": "idle",
2435
+ "guard": [
2436
+ "and",
2437
+ [
2438
+ "==",
2439
+ "@config.rosterSource",
2440
+ "event"
2441
+ ],
2442
+ [
2443
+ "not",
2444
+ [
2445
+ "==",
2446
+ "@payload.mode",
2447
+ "@config.matchMode"
2448
+ ]
2449
+ ]
1768
2450
  ],
1769
2451
  "to": "idle"
1770
2452
  },
@@ -1966,7 +2648,7 @@
1966
2648
  ],
1967
2649
  [
1968
2650
  "array/len",
1969
- "@config.items"
2651
+ "@entity.items"
1970
2652
  ]
1971
2653
  ],
1972
2654
  [
@@ -1976,7 +2658,7 @@
1976
2658
  "score": "@entity.score",
1977
2659
  "total": [
1978
2660
  "array/len",
1979
- "@config.items"
2661
+ "@entity.items"
1980
2662
  ]
1981
2663
  }
1982
2664
  ],
@@ -2000,7 +2682,7 @@
2000
2682
  "@nextIndex",
2001
2683
  [
2002
2684
  "array/len",
2003
- "@config.items"
2685
+ "@entity.items"
2004
2686
  ]
2005
2687
  ]
2006
2688
  ],
@@ -2008,7 +2690,7 @@
2008
2690
  "next",
2009
2691
  [
2010
2692
  "array/nth",
2011
- "@config.items",
2693
+ "@entity.items",
2012
2694
  [
2013
2695
  "math/min",
2014
2696
  "@nextIndex",
@@ -2016,7 +2698,7 @@
2016
2698
  "-",
2017
2699
  [
2018
2700
  "array/len",
2019
- "@config.items"
2701
+ "@entity.items"
2020
2702
  ],
2021
2703
  1.0
2022
2704
  ]
@@ -2596,7 +3278,7 @@
2596
3278
  "first",
2597
3279
  [
2598
3280
  "array/nth",
2599
- "@config.items",
3281
+ "@entity.items",
2600
3282
  0.0
2601
3283
  ]
2602
3284
  ]