@almadar/std 16.173.0 → 16.174.0

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 (203) hide show
  1. package/behaviors/lolo/infra/atoms/std-cross-reference.lolo +2 -4
  2. package/behaviors/lolo/ui/core/atoms/std-board.lolo +5 -9
  3. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +8 -1
  4. package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +2 -2
  5. package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +3 -7
  6. package/behaviors/lolo/ui/core/atoms/std-form-advanced.lolo +1 -1
  7. package/behaviors/lolo/ui/core/atoms/std-image-upload-multi.lolo +1 -1
  8. package/behaviors/lolo/ui/core/atoms/std-list.lolo +3 -3
  9. package/behaviors/lolo/ui/core/atoms/std-modal.lolo +2 -2
  10. package/behaviors/lolo/ui/core/atoms/std-multi-party-flow.lolo +2 -4
  11. package/behaviors/lolo/ui/core/atoms/std-rating-review.lolo +5 -13
  12. package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +3 -7
  13. package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +1 -1
  14. package/behaviors/lolo/ui/core/atoms/std-signature-capture.lolo +2 -2
  15. package/behaviors/lolo/ui/core/atoms/std-step-flow.lolo +2 -4
  16. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +1 -1
  17. package/behaviors/lolo/ui/core/atoms/std-thread.lolo +2 -2
  18. package/behaviors/lolo/ui/core/atoms/std-vote.lolo +2 -2
  19. package/behaviors/lolo/ui/core/atoms/std-wizard.lolo +3 -7
  20. package/behaviors/lolo/ui/core/atoms/ui-atlas-image.lolo +1 -1
  21. package/behaviors/lolo/ui/core/atoms/ui-atlas-panel.lolo +1 -1
  22. package/behaviors/lolo/ui/core/atoms/ui-center.lolo +1 -1
  23. package/behaviors/lolo/ui/core/atoms/ui-hstack.lolo +1 -1
  24. package/behaviors/lolo/ui/core/atoms/ui-icon.lolo +1 -1
  25. package/behaviors/lolo/ui/core/atoms/ui-stack.lolo +1 -1
  26. package/behaviors/lolo/ui/core/atoms/ui-typography.lolo +1 -1
  27. package/behaviors/lolo/ui/core/atoms/ui-vstack.lolo +1 -1
  28. package/behaviors/lolo/ui/core/molecules/ui-content-renderer.lolo +1 -1
  29. package/behaviors/lolo/ui/core/molecules/ui-form-layout.lolo +1 -1
  30. package/behaviors/lolo/ui/core/molecules/ui-grid.lolo +1 -1
  31. package/behaviors/lolo/ui/core/organisms/ui-chat-bar.lolo +1 -1
  32. package/behaviors/lolo/ui/core/organisms/ui-dashboard-grid.lolo +1 -1
  33. package/behaviors/lolo/ui/core/organisms/ui-detail-panel.lolo +1 -1
  34. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +1 -1
  35. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +1 -1
  36. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +1 -1
  37. package/behaviors/lolo/ui/core/organisms/ui-form-section.lolo +9 -3
  38. package/behaviors/lolo/ui/core/organisms/ui-form.lolo +9 -3
  39. package/behaviors/lolo/ui/core/organisms/ui-master-detail.lolo +1 -1
  40. package/behaviors/lolo/ui/core/organisms/ui-media-gallery.lolo +1 -1
  41. package/behaviors/lolo/ui/core/organisms/ui-segment-renderer.lolo +7 -1
  42. package/behaviors/lolo/ui/core/organisms/ui-stat-card.lolo +1 -1
  43. package/behaviors/lolo/ui/core/organisms/ui-subagent-trace-panel.lolo +1 -1
  44. package/behaviors/lolo/ui/game/atoms/ui-action-tile.lolo +1 -1
  45. package/behaviors/lolo/ui/game/atoms/ui-draw-shape-layer.lolo +41 -9
  46. package/behaviors/lolo/ui/game/atoms/ui-draw-shape.lolo +40 -8
  47. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite-layer.lolo +13 -3
  48. package/behaviors/lolo/ui/game/atoms/ui-draw-sprite.lolo +12 -2
  49. package/behaviors/lolo/ui/game/atoms/ui-draw-text-layer.lolo +3 -3
  50. package/behaviors/lolo/ui/game/atoms/ui-draw-text.lolo +2 -2
  51. package/behaviors/lolo/ui/game/organisms/std-tactics-board-3d.lolo +32 -2
  52. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +1 -1
  53. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +397 -0
  54. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +537 -0
  55. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +419 -0
  56. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +591 -0
  57. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +425 -0
  58. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +398 -0
  59. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +325 -0
  60. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +494 -0
  61. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +408 -0
  62. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +307 -0
  63. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +318 -0
  64. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +336 -0
  65. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +380 -0
  66. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +43 -4
  67. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +41 -4
  68. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +43 -4
  69. package/behaviors/lolo/ui/marketing/organisms/ui-book-viewer.lolo +1 -1
  70. package/behaviors/lolo/ui/marketing/organisms/ui-case-study-organism.lolo +1 -1
  71. package/behaviors/lolo/ui/marketing/organisms/ui-feature-grid-organism.lolo +1 -1
  72. package/behaviors/lolo/ui/marketing/organisms/ui-hero-organism.lolo +1 -1
  73. package/behaviors/lolo/ui/marketing/organisms/ui-pricing-organism.lolo +1 -1
  74. package/behaviors/lolo/ui/marketing/organisms/ui-showcase-organism.lolo +1 -1
  75. package/behaviors/lolo/ui/marketing/organisms/ui-stats-organism.lolo +1 -1
  76. package/behaviors/lolo/ui/marketing/organisms/ui-step-flow-organism.lolo +1 -1
  77. package/behaviors/lolo/ui/marketing/organisms/ui-team-organism.lolo +1 -1
  78. package/behaviors/registry/agent/atoms/std-agent-session.orb +22 -1
  79. package/behaviors/registry/agent/atoms/std-agent-tool-call.orb +38 -2
  80. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +38 -2
  81. package/behaviors/registry/agent/organisms/std-agent-rabit.orb +23 -1
  82. package/behaviors/registry/infra/atoms/std-approval-gate.orb +8 -16
  83. package/behaviors/registry/infra/atoms/std-cache-aside.orb +31 -62
  84. package/behaviors/registry/infra/atoms/std-circuit-breaker.orb +16 -32
  85. package/behaviors/registry/infra/atoms/std-cross-reference.orb +32 -4
  86. package/behaviors/registry/infra/atoms/std-data-erasure.orb +8 -16
  87. package/behaviors/registry/infra/atoms/std-mod-queue.orb +8 -16
  88. package/behaviors/registry/infra/atoms/std-rate-limiter.orb +14 -28
  89. package/behaviors/registry/infra/atoms/std-row-access-control.orb +30 -2
  90. package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +1 -2
  91. package/behaviors/registry/ui/core/atoms/std-board.orb +19 -5
  92. package/behaviors/registry/ui/core/atoms/std-browse.orb +29 -7
  93. package/behaviors/registry/ui/core/atoms/std-dashboard-grid-embedded.orb +1 -2
  94. package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +3 -5
  95. package/behaviors/registry/ui/core/atoms/std-esign-request.orb +3 -6
  96. package/behaviors/registry/ui/core/atoms/std-event-log.orb +17 -3
  97. package/behaviors/registry/ui/core/atoms/std-export.orb +2 -4
  98. package/behaviors/registry/ui/core/atoms/std-form-advanced.orb +1 -1
  99. package/behaviors/registry/ui/core/atoms/std-gallery.orb +9 -18
  100. package/behaviors/registry/ui/core/atoms/std-graphs.orb +15 -1
  101. package/behaviors/registry/ui/core/atoms/std-import.orb +2 -4
  102. package/behaviors/registry/ui/core/atoms/std-list.orb +4 -6
  103. package/behaviors/registry/ui/core/atoms/std-modal.orb +2 -2
  104. package/behaviors/registry/ui/core/atoms/std-multi-party-flow.orb +16 -2
  105. package/behaviors/registry/ui/core/atoms/std-pagination.orb +15 -1
  106. package/behaviors/registry/ui/core/atoms/std-rating-review.orb +19 -5
  107. package/behaviors/registry/ui/core/atoms/std-recurrence.orb +17 -3
  108. package/behaviors/registry/ui/core/atoms/std-rich-editor.orb +15 -1
  109. package/behaviors/registry/ui/core/atoms/std-scatter.orb +15 -1
  110. package/behaviors/registry/ui/core/atoms/std-signature-capture.orb +2 -2
  111. package/behaviors/registry/ui/core/atoms/std-stats.orb +15 -1
  112. package/behaviors/registry/ui/core/atoms/std-step-flow.orb +16 -2
  113. package/behaviors/registry/ui/core/atoms/std-thread.orb +2 -2
  114. package/behaviors/registry/ui/core/atoms/std-vote.orb +2 -2
  115. package/behaviors/registry/ui/core/atoms/std-wizard.orb +17 -3
  116. package/behaviors/registry/ui/core/atoms/ui-atlas-image.orb +4 -1
  117. package/behaviors/registry/ui/core/atoms/ui-atlas-panel.orb +4 -1
  118. package/behaviors/registry/ui/core/atoms/ui-center.orb +4 -1
  119. package/behaviors/registry/ui/core/atoms/ui-hstack.orb +4 -1
  120. package/behaviors/registry/ui/core/atoms/ui-icon.orb +4 -1
  121. package/behaviors/registry/ui/core/atoms/ui-stack.orb +4 -1
  122. package/behaviors/registry/ui/core/atoms/ui-typography.orb +4 -1
  123. package/behaviors/registry/ui/core/atoms/ui-vstack.orb +4 -1
  124. package/behaviors/registry/ui/core/molecules/ui-accordion.orb +3 -3
  125. package/behaviors/registry/ui/core/molecules/ui-content-renderer.orb +4 -1
  126. package/behaviors/registry/ui/core/molecules/ui-form-layout.orb +4 -1
  127. package/behaviors/registry/ui/core/molecules/ui-grid.orb +4 -1
  128. package/behaviors/registry/ui/core/molecules/ui-tabs.orb +2 -2
  129. package/behaviors/registry/ui/core/molecules/ui-wizard-container.orb +1 -1
  130. package/behaviors/registry/ui/core/organisms/ui-chat-bar.orb +4 -1
  131. package/behaviors/registry/ui/core/organisms/ui-dashboard-grid.orb +5 -2
  132. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +5 -2
  133. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +4 -1
  134. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +4 -1
  135. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +4 -1
  136. package/behaviors/registry/ui/core/organisms/ui-form-section.orb +34 -2
  137. package/behaviors/registry/ui/core/organisms/ui-form.orb +34 -2
  138. package/behaviors/registry/ui/core/organisms/ui-master-detail.orb +4 -1
  139. package/behaviors/registry/ui/core/organisms/ui-media-gallery.orb +4 -1
  140. package/behaviors/registry/ui/core/organisms/ui-segment-renderer.orb +24 -2
  141. package/behaviors/registry/ui/core/organisms/ui-stat-card.orb +4 -1
  142. package/behaviors/registry/ui/core/organisms/ui-subagent-trace-panel.orb +4 -1
  143. package/behaviors/registry/ui/core/organisms/ui-tabbed-container.orb +1 -1
  144. package/behaviors/registry/ui/core/organisms/ui-ui-slot-renderer.orb +1 -1
  145. package/behaviors/registry/ui/game/atoms/std-fx-particles.orb +35 -1
  146. package/behaviors/registry/ui/game/atoms/ui-action-tile.orb +4 -1
  147. package/behaviors/registry/ui/game/atoms/ui-draw-shape-layer.orb +183 -13
  148. package/behaviors/registry/ui/game/atoms/ui-draw-shape.orb +104 -9
  149. package/behaviors/registry/ui/game/atoms/ui-draw-sprite-layer.orb +56 -2
  150. package/behaviors/registry/ui/game/atoms/ui-draw-sprite.orb +36 -4
  151. package/behaviors/registry/ui/game/atoms/ui-draw-text-layer.orb +21 -2
  152. package/behaviors/registry/ui/game/atoms/ui-draw-text.orb +19 -4
  153. package/behaviors/registry/ui/game/organisms/std-tactics-board-3d.orb +173 -2
  154. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1 -1
  155. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +2814 -0
  156. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3183 -0
  157. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +2394 -0
  158. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +3951 -0
  159. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +3458 -0
  160. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +2646 -0
  161. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +1979 -0
  162. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +2994 -0
  163. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +2682 -0
  164. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +1842 -0
  165. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +1648 -0
  166. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +2307 -0
  167. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +2947 -0
  168. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +173 -4
  169. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +267 -7
  170. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +263 -8
  171. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +116 -1
  172. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +200 -4
  173. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +264 -7
  174. package/behaviors/registry/ui/marketing/atoms/std-marketing-article.orb +1 -2
  175. package/behaviors/registry/ui/marketing/atoms/std-marketing-footer.orb +1 -2
  176. package/behaviors/registry/ui/marketing/atoms/std-marketing-split.orb +1 -2
  177. package/behaviors/registry/ui/marketing/atoms/std-marketing-stats.orb +1 -2
  178. package/behaviors/registry/ui/marketing/atoms/std-marketing-steps.orb +1 -2
  179. package/behaviors/registry/ui/marketing/atoms/std-marketing-team.orb +1 -2
  180. package/behaviors/registry/ui/marketing/organisms/ui-book-viewer.orb +4 -1
  181. package/behaviors/registry/ui/marketing/organisms/ui-case-study-organism.orb +4 -1
  182. package/behaviors/registry/ui/marketing/organisms/ui-feature-grid-organism.orb +4 -1
  183. package/behaviors/registry/ui/marketing/organisms/ui-hero-organism.orb +4 -1
  184. package/behaviors/registry/ui/marketing/organisms/ui-pricing-organism.orb +4 -1
  185. package/behaviors/registry/ui/marketing/organisms/ui-showcase-organism.orb +4 -1
  186. package/behaviors/registry/ui/marketing/organisms/ui-stats-organism.orb +4 -1
  187. package/behaviors/registry/ui/marketing/organisms/ui-step-flow-organism.orb +4 -1
  188. package/behaviors/registry/ui/marketing/organisms/ui-team-organism.orb +4 -1
  189. package/dist/behaviors/exports-reader.js +3440 -2189
  190. package/dist/behaviors/functions/index.d.ts +1751 -154
  191. package/dist/behaviors/functions/index.js +3402 -2190
  192. package/dist/behaviors/index.d.ts +1 -1
  193. package/dist/behaviors/index.js +3441 -2190
  194. package/dist/behaviors/query.js +3440 -2189
  195. package/dist/behaviors-embeddings.hash.json +3 -3
  196. package/dist/behaviors-embeddings.json +230 -178
  197. package/dist/behaviors-registry.json +4397 -171
  198. package/dist/index.d.ts +1 -1
  199. package/dist/index.js +3441 -2190
  200. package/dist/knob-embeddings.hash.json +3 -3
  201. package/dist/knob-embeddings.json +1 -1
  202. package/dist/registry/factory-signatures.json +1 -1
  203. package/package.json +2 -2
@@ -0,0 +1,1842 @@
1
+ {
2
+ "description": "Generic branching decision scenario — a config-declared node graph of situations and choices plays out as a choose-your-path story with modeled consequences: every choice shifts two config-named metrics, appends to a visible decision log, and moves to its declared next node, until a node with no choices ends the run with the final metrics and the full path. This simulates decisions rather than browsing records: the learner feels trade-offs compound. All vocabulary is config-declared, so the same mechanism serves any consequence-chain lesson: fiscal policy choices, ecosystem interventions, historical what-ifs, medical triage, engineering trade-offs. Standalone by default; behind a lab router set matchMode and it renders only when MODE_SELECTED matches.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M07581G7JAW49SNHQDS3PH1D": {
6
+ "bakedName": "ScenarioScene",
7
+ "curName": "ScenarioScene",
8
+ "id": "ent_01M07581G7JAW49SNHQDS3PH1D",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01M07581G765VPJBCN6TX03WE3": {
14
+ "bakedName": "INIT",
15
+ "curName": "INIT",
16
+ "id": "evt_01M07581G765VPJBCN6TX03WE3",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
20
+ "renames": []
21
+ },
22
+ "evt_01M07581GA4D364K46318DFQET": {
23
+ "bakedName": "RESTART",
24
+ "curName": "RESTART",
25
+ "id": "evt_01M07581GA4D364K46318DFQET",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
29
+ "renames": []
30
+ },
31
+ "evt_01M07581GA8E1HK0ZGEASZGMN3": {
32
+ "bakedName": "CHOICE_MADE",
33
+ "curName": "CHOICE_MADE",
34
+ "id": "evt_01M07581GA8E1HK0ZGEASZGMN3",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
38
+ "renames": []
39
+ },
40
+ "evt_01M07581GASKSPTBR0AKY9KB4B": {
41
+ "bakedName": "MODE_SELECTED",
42
+ "curName": "MODE_SELECTED",
43
+ "id": "evt_01M07581GASKSPTBR0AKY9KB4B",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
47
+ "renames": []
48
+ },
49
+ "evt_01M07581GAV3EJ9GX9Q5RE5T57": {
50
+ "bakedName": "SCENARIO_RESTARTED",
51
+ "curName": "SCENARIO_RESTARTED",
52
+ "id": "evt_01M07581GAV3EJ9GX9Q5RE5T57",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
56
+ "renames": []
57
+ },
58
+ "evt_01M07581GAXGCFP96CXPQ3WEKG": {
59
+ "bakedName": "CHOOSE",
60
+ "curName": "CHOOSE",
61
+ "id": "evt_01M07581GAXGCFP96CXPQ3WEKG",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
65
+ "renames": []
66
+ },
67
+ "orb_01M07581G7P81XQJK08WFMYKGA": {
68
+ "bakedName": "ScenarioOrbital",
69
+ "curName": "ScenarioOrbital",
70
+ "id": "orb_01M07581G7P81XQJK08WFMYKGA",
71
+ "kind": "orbital",
72
+ "owner": "workspace",
73
+ "renames": []
74
+ },
75
+ "pag_01M07581GBS3N6367YGB02TXNK": {
76
+ "bakedName": "ScenarioPage",
77
+ "curName": "ScenarioPage",
78
+ "id": "pag_01M07581GBS3N6367YGB02TXNK",
79
+ "kind": "page",
80
+ "owner": "workspace",
81
+ "renames": []
82
+ },
83
+ "trt_01M07581G7AY0MGAMJFPDR2Z8Z": {
84
+ "bakedName": "ScenarioSim",
85
+ "curName": "ScenarioSim",
86
+ "id": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
87
+ "kind": "trait",
88
+ "owner": "workspace",
89
+ "renames": []
90
+ }
91
+ },
92
+ "schemaVersion": 1
93
+ },
94
+ "name": "std-learn-scenario",
95
+ "orbitals": [
96
+ {
97
+ "entity": {
98
+ "fields": [
99
+ {
100
+ "name": "id",
101
+ "required": true,
102
+ "type": "string"
103
+ },
104
+ {
105
+ "default": false,
106
+ "name": "active",
107
+ "type": "boolean"
108
+ },
109
+ {
110
+ "name": "title",
111
+ "type": "string"
112
+ },
113
+ {
114
+ "name": "currentId",
115
+ "type": "string"
116
+ },
117
+ {
118
+ "name": "situation",
119
+ "type": "string"
120
+ },
121
+ {
122
+ "items": {
123
+ "properties": {
124
+ "deltaA": {
125
+ "name": "deltaA",
126
+ "required": false,
127
+ "type": "number"
128
+ },
129
+ "deltaB": {
130
+ "name": "deltaB",
131
+ "required": false,
132
+ "type": "number"
133
+ },
134
+ "label": {
135
+ "name": "label",
136
+ "required": true,
137
+ "type": "string"
138
+ },
139
+ "next": {
140
+ "name": "next",
141
+ "required": true,
142
+ "type": "string"
143
+ },
144
+ "note": {
145
+ "name": "note",
146
+ "required": false,
147
+ "type": "string"
148
+ }
149
+ },
150
+ "type": "object"
151
+ },
152
+ "name": "choices",
153
+ "type": "array"
154
+ },
155
+ {
156
+ "default": 0.0,
157
+ "name": "metricA",
158
+ "type": "number"
159
+ },
160
+ {
161
+ "default": 0.0,
162
+ "name": "metricB",
163
+ "type": "number"
164
+ },
165
+ {
166
+ "default": 0.0,
167
+ "name": "stepCount",
168
+ "type": "number"
169
+ },
170
+ {
171
+ "items": {
172
+ "type": "string"
173
+ },
174
+ "name": "path",
175
+ "type": "array"
176
+ },
177
+ {
178
+ "default": false,
179
+ "name": "done",
180
+ "type": "boolean"
181
+ },
182
+ {
183
+ "name": "feedback",
184
+ "type": "string"
185
+ },
186
+ {
187
+ "items": {
188
+ "type": "node"
189
+ },
190
+ "name": "view",
191
+ "type": "array"
192
+ }
193
+ ],
194
+ "id": "ent_01M07581G7JAW49SNHQDS3PH1D",
195
+ "name": "ScenarioScene",
196
+ "persistence": "runtime"
197
+ },
198
+ "id": "orb_01M07581G7P81XQJK08WFMYKGA",
199
+ "name": "ScenarioOrbital",
200
+ "pages": [
201
+ {
202
+ "id": "pag_01M07581GBS3N6367YGB02TXNK",
203
+ "name": "ScenarioPage",
204
+ "path": "/learn-scenario",
205
+ "traits": [
206
+ {
207
+ "ref": "ScenarioSim",
208
+ "refId": "trt_01M07581G7AY0MGAMJFPDR2Z8Z"
209
+ }
210
+ ]
211
+ }
212
+ ],
213
+ "traits": [
214
+ {
215
+ "category": "interaction",
216
+ "config": {
217
+ "matchMode": {
218
+ "default": "",
219
+ "description": "When composed behind a lab router, the MODE_SELECTED mode value this instrument responds to. Empty string means standalone — render immediately on INIT.",
220
+ "label": "Match Mode",
221
+ "tier": "presentation",
222
+ "type": "string"
223
+ },
224
+ "metricALabel": {
225
+ "default": "Budget",
226
+ "description": "Display name of the first tracked consequence metric.",
227
+ "label": "Metric A Label",
228
+ "tier": "domain",
229
+ "type": "string"
230
+ },
231
+ "metricAStart": {
232
+ "default": 100.0,
233
+ "label": "Metric A Start",
234
+ "tier": "domain",
235
+ "type": "number"
236
+ },
237
+ "metricBLabel": {
238
+ "default": "Support",
239
+ "description": "Display name of the second tracked consequence metric.",
240
+ "label": "Metric B Label",
241
+ "tier": "domain",
242
+ "type": "string"
243
+ },
244
+ "metricBStart": {
245
+ "default": 50.0,
246
+ "label": "Metric B Start",
247
+ "tier": "domain",
248
+ "type": "number"
249
+ },
250
+ "nodes": {
251
+ "default": [
252
+ {
253
+ "choices": [
254
+ {
255
+ "deltaA": -60.0,
256
+ "deltaB": 10.0,
257
+ "label": "Build a levee now",
258
+ "next": "levee",
259
+ "note": "Fast protection, most of the budget gone."
260
+ },
261
+ {
262
+ "deltaA": -25.0,
263
+ "deltaB": -5.0,
264
+ "label": "Restore the upstream wetlands",
265
+ "next": "wetlands",
266
+ "note": "Cheaper and greener, but slower to work."
267
+ }
268
+ ],
269
+ "id": "start",
270
+ "situation": "Your town's river floods every spring. The council asks you to lead the response."
271
+ },
272
+ {
273
+ "choices": [
274
+ {
275
+ "deltaA": -30.0,
276
+ "deltaB": -10.0,
277
+ "label": "Raise the levee again",
278
+ "next": "end-lock-in",
279
+ "note": "Costs keep compounding."
280
+ },
281
+ {
282
+ "deltaA": -20.0,
283
+ "deltaB": 15.0,
284
+ "label": "Add wetlands as a second line",
285
+ "next": "end-hybrid",
286
+ "note": "Late, but it eases the pressure."
287
+ }
288
+ ],
289
+ "id": "levee",
290
+ "situation": "The levee holds the first spring, but silt builds up and the river rises higher each year."
291
+ },
292
+ {
293
+ "choices": [
294
+ {
295
+ "deltaA": -15.0,
296
+ "deltaB": 25.0,
297
+ "label": "Expand the wetland corridor",
298
+ "next": "end-green",
299
+ "note": "The town rallies behind the project."
300
+ },
301
+ {
302
+ "deltaA": 10.0,
303
+ "deltaB": 5.0,
304
+ "label": "Bank the savings",
305
+ "next": "end-thrifty",
306
+ "note": "Prudent, though the corridor stays small."
307
+ }
308
+ ],
309
+ "id": "wetlands",
310
+ "situation": "Two springs pass; the wetlands now absorb most floods, and wildlife is returning."
311
+ },
312
+ {
313
+ "choices": [],
314
+ "id": "end-lock-in",
315
+ "situation": "You are locked into an arms race with the river: protected, but at ever-growing cost."
316
+ },
317
+ {
318
+ "choices": [],
319
+ "id": "end-hybrid",
320
+ "situation": "The hybrid defense works: the levee buys time and the wetlands cut the peak floods."
321
+ },
322
+ {
323
+ "choices": [],
324
+ "id": "end-green",
325
+ "situation": "The restored river corridor protects the town and becomes its most loved public space."
326
+ },
327
+ {
328
+ "choices": [],
329
+ "id": "end-thrifty",
330
+ "situation": "The town stays safe in normal years, with savings in reserve for a bigger flood."
331
+ }
332
+ ],
333
+ "description": "The decision graph; each node carries a situation and its choices, each choice naming the next node, metric deltas, and a consequence note. A node with no choices ends the run. Realizations declare their own subject's decision tree here.",
334
+ "items": {
335
+ "properties": {
336
+ "choices": {
337
+ "items": {
338
+ "properties": {
339
+ "deltaA": {
340
+ "name": "deltaA",
341
+ "required": false,
342
+ "type": "number"
343
+ },
344
+ "deltaB": {
345
+ "name": "deltaB",
346
+ "required": false,
347
+ "type": "number"
348
+ },
349
+ "label": {
350
+ "name": "label",
351
+ "required": true,
352
+ "type": "string"
353
+ },
354
+ "next": {
355
+ "name": "next",
356
+ "required": true,
357
+ "type": "string"
358
+ },
359
+ "note": {
360
+ "name": "note",
361
+ "required": false,
362
+ "type": "string"
363
+ }
364
+ },
365
+ "type": "object"
366
+ },
367
+ "name": "choices",
368
+ "required": false,
369
+ "type": "array"
370
+ },
371
+ "id": {
372
+ "name": "id",
373
+ "required": true,
374
+ "type": "string"
375
+ },
376
+ "situation": {
377
+ "name": "situation",
378
+ "required": true,
379
+ "type": "string"
380
+ }
381
+ },
382
+ "type": "object"
383
+ },
384
+ "label": "Nodes",
385
+ "tier": "domain",
386
+ "type": "[ScenarioNode]"
387
+ },
388
+ "restartLabel": {
389
+ "default": "Play Again",
390
+ "label": "Restart Label",
391
+ "tier": "presentation",
392
+ "type": "string"
393
+ },
394
+ "startId": {
395
+ "default": "start",
396
+ "description": "Id of the node the scenario opens on.",
397
+ "label": "Start Node",
398
+ "tier": "domain",
399
+ "type": "string"
400
+ },
401
+ "title": {
402
+ "default": "Decision Scenario",
403
+ "description": "Title shown above the scenario.",
404
+ "label": "Title",
405
+ "tier": "presentation",
406
+ "type": "string"
407
+ }
408
+ },
409
+ "emits": [
410
+ {
411
+ "description": "A decision was taken: the node reached, both metric values after the deltas, and whether the run just ended — a composed listener (coach, grader) can subscribe; a harmless no-op when the atom runs standalone.",
412
+ "event": "CHOICE_MADE",
413
+ "eventId": "evt_01M07581GA8E1HK0ZGEASZGMN3",
414
+ "payloadSchema": [
415
+ {
416
+ "name": "nodeId",
417
+ "type": "string"
418
+ },
419
+ {
420
+ "name": "metricA",
421
+ "type": "number"
422
+ },
423
+ {
424
+ "name": "metricB",
425
+ "type": "number"
426
+ },
427
+ {
428
+ "name": "ended",
429
+ "type": "boolean"
430
+ }
431
+ ],
432
+ "scope": "external",
433
+ "synonyms": "branching scenario, choose your path, decision tree, consequences, trade-offs, what-if",
434
+ "tier": "domain"
435
+ },
436
+ {
437
+ "description": "The learner restarted the scenario from scratch.",
438
+ "event": "SCENARIO_RESTARTED",
439
+ "eventId": "evt_01M07581GAV3EJ9GX9Q5RE5T57",
440
+ "payloadSchema": [
441
+ {
442
+ "name": "startId",
443
+ "type": "string"
444
+ }
445
+ ],
446
+ "scope": "external",
447
+ "tier": "domain"
448
+ }
449
+ ],
450
+ "entityContract": {
451
+ "provides": [
452
+ "active",
453
+ "choices",
454
+ "currentId",
455
+ "done",
456
+ "feedback",
457
+ "metricA",
458
+ "metricB",
459
+ "path",
460
+ "situation",
461
+ "stepCount",
462
+ "title",
463
+ "view"
464
+ ],
465
+ "requires": []
466
+ },
467
+ "entityRebindable": true,
468
+ "entityRefIds": {
469
+ "ScenarioScene": "ent_01M07581G7JAW49SNHQDS3PH1D"
470
+ },
471
+ "id": "trt_01M07581G7AY0MGAMJFPDR2Z8Z",
472
+ "linkedEntity": "ScenarioScene",
473
+ "linkedEntityId": "ent_01M07581G7JAW49SNHQDS3PH1D",
474
+ "name": "ScenarioSim",
475
+ "scope": "instance",
476
+ "stateMachine": {
477
+ "events": [
478
+ {
479
+ "id": "evt_01M07581G765VPJBCN6TX03WE3",
480
+ "key": "INIT",
481
+ "name": "Initialize"
482
+ },
483
+ {
484
+ "description": "Lab router broadcast naming the active mode; this instrument renders when the mode equals matchMode, otherwise renders null.",
485
+ "id": "evt_01M07581GASKSPTBR0AKY9KB4B",
486
+ "key": "MODE_SELECTED",
487
+ "name": "Mode Selected",
488
+ "payloadSchema": [
489
+ {
490
+ "name": "mode",
491
+ "type": "string"
492
+ }
493
+ ],
494
+ "tier": "domain"
495
+ },
496
+ {
497
+ "description": "Learner picked one of the current node's choices — index selects it; its metric deltas apply, the decision log grows, and the story moves to the declared next node.",
498
+ "id": "evt_01M07581GAXGCFP96CXPQ3WEKG",
499
+ "key": "CHOOSE",
500
+ "name": "Choose",
501
+ "payloadSchema": [
502
+ {
503
+ "name": "index",
504
+ "type": "number"
505
+ }
506
+ ],
507
+ "tier": "domain"
508
+ },
509
+ {
510
+ "description": "Learner restarted the scenario from the start node with fresh metrics and an empty decision log.",
511
+ "id": "evt_01M07581GA4D364K46318DFQET",
512
+ "key": "RESTART",
513
+ "name": "Restart",
514
+ "tier": "domain"
515
+ },
516
+ {
517
+ "description": "A decision was taken: the node reached, both metric values after the deltas, and whether the run just ended — a composed listener (coach, grader) can subscribe; a harmless no-op when the atom runs standalone.",
518
+ "id": "evt_01M07581GA8E1HK0ZGEASZGMN3",
519
+ "key": "CHOICE_MADE",
520
+ "name": "Choice Made",
521
+ "payloadSchema": [
522
+ {
523
+ "name": "nodeId",
524
+ "type": "string"
525
+ },
526
+ {
527
+ "name": "metricA",
528
+ "type": "number"
529
+ },
530
+ {
531
+ "name": "metricB",
532
+ "type": "number"
533
+ },
534
+ {
535
+ "name": "ended",
536
+ "type": "boolean"
537
+ }
538
+ ],
539
+ "synonyms": "branching scenario, choose your path, decision tree, consequences, trade-offs, what-if",
540
+ "tier": "domain"
541
+ },
542
+ {
543
+ "description": "The learner restarted the scenario from scratch.",
544
+ "id": "evt_01M07581GAV3EJ9GX9Q5RE5T57",
545
+ "key": "SCENARIO_RESTARTED",
546
+ "name": "Scenario Restarted",
547
+ "payloadSchema": [
548
+ {
549
+ "name": "startId",
550
+ "type": "string"
551
+ }
552
+ ],
553
+ "tier": "domain"
554
+ }
555
+ ],
556
+ "states": [
557
+ {
558
+ "isInitial": true,
559
+ "name": "idle"
560
+ }
561
+ ],
562
+ "transitions": [
563
+ {
564
+ "effects": [
565
+ [
566
+ "let",
567
+ [
568
+ [
569
+ "start",
570
+ [
571
+ "array/find",
572
+ "@config.nodes",
573
+ [
574
+ "fn",
575
+ "n",
576
+ [
577
+ "==",
578
+ [
579
+ "object/get",
580
+ "@n",
581
+ "id"
582
+ ],
583
+ "@config.startId"
584
+ ]
585
+ ]
586
+ ]
587
+ ]
588
+ ],
589
+ [
590
+ "do",
591
+ [
592
+ "set",
593
+ "@entity.active",
594
+ true
595
+ ],
596
+ [
597
+ "set",
598
+ "@entity.title",
599
+ "@config.title"
600
+ ],
601
+ [
602
+ "set",
603
+ "@entity.currentId",
604
+ "@config.startId"
605
+ ],
606
+ [
607
+ "set",
608
+ "@entity.situation",
609
+ [
610
+ "object/get",
611
+ "@start",
612
+ "situation"
613
+ ]
614
+ ],
615
+ [
616
+ "set",
617
+ "@entity.choices",
618
+ [
619
+ "object/get",
620
+ "@start",
621
+ "choices",
622
+ []
623
+ ]
624
+ ],
625
+ [
626
+ "set",
627
+ "@entity.metricA",
628
+ "@config.metricAStart"
629
+ ],
630
+ [
631
+ "set",
632
+ "@entity.metricB",
633
+ "@config.metricBStart"
634
+ ],
635
+ [
636
+ "set",
637
+ "@entity.stepCount",
638
+ 0.0
639
+ ],
640
+ [
641
+ "set",
642
+ "@entity.path",
643
+ []
644
+ ],
645
+ [
646
+ "set",
647
+ "@entity.done",
648
+ false
649
+ ],
650
+ [
651
+ "set",
652
+ "@entity.feedback",
653
+ ""
654
+ ],
655
+ [
656
+ "set",
657
+ "@entity.view",
658
+ [
659
+ {
660
+ "children": [
661
+ {
662
+ "content": "@entity.situation",
663
+ "type": "typography",
664
+ "variant": "body"
665
+ }
666
+ ],
667
+ "padding": "md",
668
+ "type": "card",
669
+ "variant": "bordered"
670
+ }
671
+ ]
672
+ ]
673
+ ]
674
+ ],
675
+ [
676
+ "render-ui",
677
+ "main",
678
+ {
679
+ "children": [
680
+ {
681
+ "children": [
682
+ {
683
+ "content": "@entity.title",
684
+ "type": "typography",
685
+ "variant": "h4"
686
+ },
687
+ {
688
+ "content": [
689
+ "str/concat",
690
+ "@config.metricALabel",
691
+ ": ",
692
+ [
693
+ "math/round",
694
+ "@entity.metricA",
695
+ 0.0
696
+ ],
697
+ " · ",
698
+ "@config.metricBLabel",
699
+ ": ",
700
+ [
701
+ "math/round",
702
+ "@entity.metricB",
703
+ 0.0
704
+ ],
705
+ " · decisions: ",
706
+ [
707
+ "str/concat",
708
+ "",
709
+ "@entity.stepCount"
710
+ ]
711
+ ],
712
+ "type": "typography",
713
+ "variant": "body"
714
+ },
715
+ {
716
+ "children": "@entity.view",
717
+ "direction": "vertical",
718
+ "gap": "md",
719
+ "type": "stack"
720
+ },
721
+ {
722
+ "children": [
723
+ "array/map",
724
+ [
725
+ "array/range",
726
+ 0.0,
727
+ [
728
+ "array/len",
729
+ "@entity.choices"
730
+ ]
731
+ ],
732
+ [
733
+ "fn",
734
+ [
735
+ "i"
736
+ ],
737
+ {
738
+ "action": "CHOOSE",
739
+ "actionPayload": {
740
+ "index": "@i"
741
+ },
742
+ "disabled": [
743
+ "if",
744
+ "@entity.done",
745
+ true,
746
+ false
747
+ ],
748
+ "label": [
749
+ "object/get",
750
+ [
751
+ "array/nth",
752
+ "@entity.choices",
753
+ "@i"
754
+ ],
755
+ "label"
756
+ ],
757
+ "size": "sm",
758
+ "type": "button",
759
+ "variant": "secondary"
760
+ }
761
+ ]
762
+ ],
763
+ "direction": "vertical",
764
+ "gap": "xs",
765
+ "type": "stack"
766
+ },
767
+ {
768
+ "content": "@entity.feedback",
769
+ "type": "typography",
770
+ "variant": "caption"
771
+ },
772
+ {
773
+ "children": [
774
+ "array/map",
775
+ "@entity.path",
776
+ [
777
+ "fn",
778
+ [
779
+ "line"
780
+ ],
781
+ {
782
+ "color": "muted",
783
+ "content": "@line",
784
+ "type": "typography",
785
+ "variant": "caption"
786
+ }
787
+ ]
788
+ ],
789
+ "direction": "vertical",
790
+ "gap": "xs",
791
+ "type": "stack"
792
+ },
793
+ {
794
+ "children": [
795
+ {
796
+ "action": "RESTART",
797
+ "disabled": [
798
+ "if",
799
+ "@entity.done",
800
+ false,
801
+ true
802
+ ],
803
+ "label": "@config.restartLabel",
804
+ "type": "button",
805
+ "variant": "primary"
806
+ }
807
+ ],
808
+ "direction": "horizontal",
809
+ "gap": "sm",
810
+ "type": "stack"
811
+ }
812
+ ],
813
+ "direction": "vertical",
814
+ "gap": "md",
815
+ "type": "stack"
816
+ }
817
+ ],
818
+ "padding": "md",
819
+ "type": "box"
820
+ }
821
+ ]
822
+ ],
823
+ "event": "INIT",
824
+ "eventId": "evt_01M07581G765VPJBCN6TX03WE3",
825
+ "from": "idle",
826
+ "guard": [
827
+ "==",
828
+ "@config.matchMode",
829
+ ""
830
+ ],
831
+ "to": "idle"
832
+ },
833
+ {
834
+ "effects": [
835
+ [
836
+ "let",
837
+ [
838
+ [
839
+ "start",
840
+ [
841
+ "array/find",
842
+ "@config.nodes",
843
+ [
844
+ "fn",
845
+ "n",
846
+ [
847
+ "==",
848
+ [
849
+ "object/get",
850
+ "@n",
851
+ "id"
852
+ ],
853
+ "@config.startId"
854
+ ]
855
+ ]
856
+ ]
857
+ ]
858
+ ],
859
+ [
860
+ "do",
861
+ [
862
+ "set",
863
+ "@entity.active",
864
+ true
865
+ ],
866
+ [
867
+ "set",
868
+ "@entity.title",
869
+ "@config.title"
870
+ ],
871
+ [
872
+ "set",
873
+ "@entity.currentId",
874
+ "@config.startId"
875
+ ],
876
+ [
877
+ "set",
878
+ "@entity.situation",
879
+ [
880
+ "object/get",
881
+ "@start",
882
+ "situation"
883
+ ]
884
+ ],
885
+ [
886
+ "set",
887
+ "@entity.choices",
888
+ [
889
+ "object/get",
890
+ "@start",
891
+ "choices",
892
+ []
893
+ ]
894
+ ],
895
+ [
896
+ "set",
897
+ "@entity.metricA",
898
+ "@config.metricAStart"
899
+ ],
900
+ [
901
+ "set",
902
+ "@entity.metricB",
903
+ "@config.metricBStart"
904
+ ],
905
+ [
906
+ "set",
907
+ "@entity.stepCount",
908
+ 0.0
909
+ ],
910
+ [
911
+ "set",
912
+ "@entity.path",
913
+ []
914
+ ],
915
+ [
916
+ "set",
917
+ "@entity.done",
918
+ false
919
+ ],
920
+ [
921
+ "set",
922
+ "@entity.feedback",
923
+ ""
924
+ ],
925
+ [
926
+ "set",
927
+ "@entity.view",
928
+ [
929
+ {
930
+ "children": [
931
+ {
932
+ "content": "@entity.situation",
933
+ "type": "typography",
934
+ "variant": "body"
935
+ }
936
+ ],
937
+ "padding": "md",
938
+ "type": "card",
939
+ "variant": "bordered"
940
+ }
941
+ ]
942
+ ]
943
+ ]
944
+ ],
945
+ [
946
+ "render-ui",
947
+ "main",
948
+ {
949
+ "children": [
950
+ {
951
+ "children": [
952
+ {
953
+ "content": "@entity.title",
954
+ "type": "typography",
955
+ "variant": "h4"
956
+ },
957
+ {
958
+ "content": [
959
+ "str/concat",
960
+ "@config.metricALabel",
961
+ ": ",
962
+ [
963
+ "math/round",
964
+ "@entity.metricA",
965
+ 0.0
966
+ ],
967
+ " · ",
968
+ "@config.metricBLabel",
969
+ ": ",
970
+ [
971
+ "math/round",
972
+ "@entity.metricB",
973
+ 0.0
974
+ ],
975
+ " · decisions: ",
976
+ [
977
+ "str/concat",
978
+ "",
979
+ "@entity.stepCount"
980
+ ]
981
+ ],
982
+ "type": "typography",
983
+ "variant": "body"
984
+ },
985
+ {
986
+ "children": "@entity.view",
987
+ "direction": "vertical",
988
+ "gap": "md",
989
+ "type": "stack"
990
+ },
991
+ {
992
+ "children": [
993
+ "array/map",
994
+ [
995
+ "array/range",
996
+ 0.0,
997
+ [
998
+ "array/len",
999
+ "@entity.choices"
1000
+ ]
1001
+ ],
1002
+ [
1003
+ "fn",
1004
+ [
1005
+ "i"
1006
+ ],
1007
+ {
1008
+ "action": "CHOOSE",
1009
+ "actionPayload": {
1010
+ "index": "@i"
1011
+ },
1012
+ "disabled": [
1013
+ "if",
1014
+ "@entity.done",
1015
+ true,
1016
+ false
1017
+ ],
1018
+ "label": [
1019
+ "object/get",
1020
+ [
1021
+ "array/nth",
1022
+ "@entity.choices",
1023
+ "@i"
1024
+ ],
1025
+ "label"
1026
+ ],
1027
+ "size": "sm",
1028
+ "type": "button",
1029
+ "variant": "secondary"
1030
+ }
1031
+ ]
1032
+ ],
1033
+ "direction": "vertical",
1034
+ "gap": "xs",
1035
+ "type": "stack"
1036
+ },
1037
+ {
1038
+ "content": "@entity.feedback",
1039
+ "type": "typography",
1040
+ "variant": "caption"
1041
+ },
1042
+ {
1043
+ "children": [
1044
+ "array/map",
1045
+ "@entity.path",
1046
+ [
1047
+ "fn",
1048
+ [
1049
+ "line"
1050
+ ],
1051
+ {
1052
+ "color": "muted",
1053
+ "content": "@line",
1054
+ "type": "typography",
1055
+ "variant": "caption"
1056
+ }
1057
+ ]
1058
+ ],
1059
+ "direction": "vertical",
1060
+ "gap": "xs",
1061
+ "type": "stack"
1062
+ },
1063
+ {
1064
+ "children": [
1065
+ {
1066
+ "action": "RESTART",
1067
+ "disabled": [
1068
+ "if",
1069
+ "@entity.done",
1070
+ false,
1071
+ true
1072
+ ],
1073
+ "label": "@config.restartLabel",
1074
+ "type": "button",
1075
+ "variant": "primary"
1076
+ }
1077
+ ],
1078
+ "direction": "horizontal",
1079
+ "gap": "sm",
1080
+ "type": "stack"
1081
+ }
1082
+ ],
1083
+ "direction": "vertical",
1084
+ "gap": "md",
1085
+ "type": "stack"
1086
+ }
1087
+ ],
1088
+ "padding": "md",
1089
+ "type": "box"
1090
+ }
1091
+ ]
1092
+ ],
1093
+ "event": "MODE_SELECTED",
1094
+ "eventId": "evt_01M07581GASKSPTBR0AKY9KB4B",
1095
+ "from": "idle",
1096
+ "guard": [
1097
+ "==",
1098
+ "@payload.mode",
1099
+ "@config.matchMode"
1100
+ ],
1101
+ "to": "idle"
1102
+ },
1103
+ {
1104
+ "effects": [
1105
+ [
1106
+ "let",
1107
+ [
1108
+ [
1109
+ "choice",
1110
+ [
1111
+ "array/nth",
1112
+ "@entity.choices",
1113
+ "@payload.index"
1114
+ ]
1115
+ ],
1116
+ [
1117
+ "nextId",
1118
+ [
1119
+ "object/get",
1120
+ "@choice",
1121
+ "next"
1122
+ ]
1123
+ ],
1124
+ [
1125
+ "nextNode",
1126
+ [
1127
+ "array/find",
1128
+ "@config.nodes",
1129
+ [
1130
+ "fn",
1131
+ "n",
1132
+ [
1133
+ "==",
1134
+ [
1135
+ "object/get",
1136
+ "@n",
1137
+ "id"
1138
+ ],
1139
+ "@nextId"
1140
+ ]
1141
+ ]
1142
+ ]
1143
+ ],
1144
+ [
1145
+ "nextChoices",
1146
+ [
1147
+ "object/get",
1148
+ "@nextNode",
1149
+ "choices",
1150
+ []
1151
+ ]
1152
+ ],
1153
+ [
1154
+ "ended",
1155
+ [
1156
+ "==",
1157
+ [
1158
+ "array/len",
1159
+ "@nextChoices"
1160
+ ],
1161
+ 0.0
1162
+ ]
1163
+ ],
1164
+ [
1165
+ "note",
1166
+ [
1167
+ "object/get",
1168
+ "@choice",
1169
+ "note",
1170
+ ""
1171
+ ]
1172
+ ],
1173
+ [
1174
+ "newA",
1175
+ [
1176
+ "+",
1177
+ "@entity.metricA",
1178
+ [
1179
+ "object/get",
1180
+ "@choice",
1181
+ "deltaA",
1182
+ 0.0
1183
+ ]
1184
+ ]
1185
+ ],
1186
+ [
1187
+ "newB",
1188
+ [
1189
+ "+",
1190
+ "@entity.metricB",
1191
+ [
1192
+ "object/get",
1193
+ "@choice",
1194
+ "deltaB",
1195
+ 0.0
1196
+ ]
1197
+ ]
1198
+ ]
1199
+ ],
1200
+ [
1201
+ "do",
1202
+ [
1203
+ "set",
1204
+ "@entity.currentId",
1205
+ "@nextId"
1206
+ ],
1207
+ [
1208
+ "set",
1209
+ "@entity.situation",
1210
+ [
1211
+ "object/get",
1212
+ "@nextNode",
1213
+ "situation"
1214
+ ]
1215
+ ],
1216
+ [
1217
+ "set",
1218
+ "@entity.choices",
1219
+ "@nextChoices"
1220
+ ],
1221
+ [
1222
+ "set",
1223
+ "@entity.metricA",
1224
+ "@newA"
1225
+ ],
1226
+ [
1227
+ "set",
1228
+ "@entity.metricB",
1229
+ "@newB"
1230
+ ],
1231
+ [
1232
+ "set",
1233
+ "@entity.stepCount",
1234
+ [
1235
+ "+",
1236
+ "@entity.stepCount",
1237
+ 1.0
1238
+ ]
1239
+ ],
1240
+ [
1241
+ "set",
1242
+ "@entity.path",
1243
+ [
1244
+ "array/append",
1245
+ "@entity.path",
1246
+ [
1247
+ "str/concat",
1248
+ [
1249
+ "str/concat",
1250
+ "",
1251
+ "@entity.stepCount"
1252
+ ],
1253
+ ". ",
1254
+ [
1255
+ "object/get",
1256
+ "@choice",
1257
+ "label"
1258
+ ],
1259
+ [
1260
+ "if",
1261
+ [
1262
+ "!=",
1263
+ "@note",
1264
+ ""
1265
+ ],
1266
+ [
1267
+ "str/concat",
1268
+ " — ",
1269
+ "@note"
1270
+ ],
1271
+ ""
1272
+ ]
1273
+ ]
1274
+ ]
1275
+ ],
1276
+ [
1277
+ "set",
1278
+ "@entity.done",
1279
+ [
1280
+ "if",
1281
+ "@ended",
1282
+ true,
1283
+ false
1284
+ ]
1285
+ ],
1286
+ [
1287
+ "set",
1288
+ "@entity.feedback",
1289
+ [
1290
+ "if",
1291
+ [
1292
+ "!=",
1293
+ "@note",
1294
+ ""
1295
+ ],
1296
+ "@note",
1297
+ ""
1298
+ ]
1299
+ ],
1300
+ [
1301
+ "set",
1302
+ "@entity.view",
1303
+ [
1304
+ "if",
1305
+ "@ended",
1306
+ [
1307
+ {
1308
+ "children": [
1309
+ {
1310
+ "content": "Outcome",
1311
+ "type": "typography",
1312
+ "variant": "h4"
1313
+ },
1314
+ {
1315
+ "content": "@entity.situation",
1316
+ "type": "typography",
1317
+ "variant": "body"
1318
+ },
1319
+ {
1320
+ "content": [
1321
+ "str/concat",
1322
+ "Final ",
1323
+ "@config.metricALabel",
1324
+ ": ",
1325
+ [
1326
+ "math/round",
1327
+ "@entity.metricA",
1328
+ 0.0
1329
+ ],
1330
+ " · final ",
1331
+ "@config.metricBLabel",
1332
+ ": ",
1333
+ [
1334
+ "math/round",
1335
+ "@entity.metricB",
1336
+ 0.0
1337
+ ],
1338
+ " after ",
1339
+ [
1340
+ "str/concat",
1341
+ "",
1342
+ "@entity.stepCount"
1343
+ ],
1344
+ " decisions."
1345
+ ],
1346
+ "type": "typography",
1347
+ "variant": "body"
1348
+ }
1349
+ ],
1350
+ "padding": "md",
1351
+ "type": "card",
1352
+ "variant": "bordered"
1353
+ }
1354
+ ],
1355
+ [
1356
+ {
1357
+ "children": [
1358
+ {
1359
+ "content": "@entity.situation",
1360
+ "type": "typography",
1361
+ "variant": "body"
1362
+ }
1363
+ ],
1364
+ "padding": "md",
1365
+ "type": "card",
1366
+ "variant": "bordered"
1367
+ }
1368
+ ]
1369
+ ]
1370
+ ]
1371
+ ]
1372
+ ],
1373
+ [
1374
+ "render-ui",
1375
+ "main",
1376
+ {
1377
+ "children": [
1378
+ {
1379
+ "children": [
1380
+ {
1381
+ "content": "@entity.title",
1382
+ "type": "typography",
1383
+ "variant": "h4"
1384
+ },
1385
+ {
1386
+ "content": [
1387
+ "str/concat",
1388
+ "@config.metricALabel",
1389
+ ": ",
1390
+ [
1391
+ "math/round",
1392
+ "@entity.metricA",
1393
+ 0.0
1394
+ ],
1395
+ " · ",
1396
+ "@config.metricBLabel",
1397
+ ": ",
1398
+ [
1399
+ "math/round",
1400
+ "@entity.metricB",
1401
+ 0.0
1402
+ ],
1403
+ " · decisions: ",
1404
+ [
1405
+ "str/concat",
1406
+ "",
1407
+ "@entity.stepCount"
1408
+ ]
1409
+ ],
1410
+ "type": "typography",
1411
+ "variant": "body"
1412
+ },
1413
+ {
1414
+ "children": "@entity.view",
1415
+ "direction": "vertical",
1416
+ "gap": "md",
1417
+ "type": "stack"
1418
+ },
1419
+ {
1420
+ "children": [
1421
+ "array/map",
1422
+ [
1423
+ "array/range",
1424
+ 0.0,
1425
+ [
1426
+ "array/len",
1427
+ "@entity.choices"
1428
+ ]
1429
+ ],
1430
+ [
1431
+ "fn",
1432
+ [
1433
+ "i"
1434
+ ],
1435
+ {
1436
+ "action": "CHOOSE",
1437
+ "actionPayload": {
1438
+ "index": "@i"
1439
+ },
1440
+ "disabled": [
1441
+ "if",
1442
+ "@entity.done",
1443
+ true,
1444
+ false
1445
+ ],
1446
+ "label": [
1447
+ "object/get",
1448
+ [
1449
+ "array/nth",
1450
+ "@entity.choices",
1451
+ "@i"
1452
+ ],
1453
+ "label"
1454
+ ],
1455
+ "size": "sm",
1456
+ "type": "button",
1457
+ "variant": "secondary"
1458
+ }
1459
+ ]
1460
+ ],
1461
+ "direction": "vertical",
1462
+ "gap": "xs",
1463
+ "type": "stack"
1464
+ },
1465
+ {
1466
+ "content": "@entity.feedback",
1467
+ "type": "typography",
1468
+ "variant": "caption"
1469
+ },
1470
+ {
1471
+ "children": [
1472
+ "array/map",
1473
+ "@entity.path",
1474
+ [
1475
+ "fn",
1476
+ [
1477
+ "line"
1478
+ ],
1479
+ {
1480
+ "color": "muted",
1481
+ "content": "@line",
1482
+ "type": "typography",
1483
+ "variant": "caption"
1484
+ }
1485
+ ]
1486
+ ],
1487
+ "direction": "vertical",
1488
+ "gap": "xs",
1489
+ "type": "stack"
1490
+ },
1491
+ {
1492
+ "children": [
1493
+ {
1494
+ "action": "RESTART",
1495
+ "disabled": [
1496
+ "if",
1497
+ "@entity.done",
1498
+ false,
1499
+ true
1500
+ ],
1501
+ "label": "@config.restartLabel",
1502
+ "type": "button",
1503
+ "variant": "primary"
1504
+ }
1505
+ ],
1506
+ "direction": "horizontal",
1507
+ "gap": "sm",
1508
+ "type": "stack"
1509
+ }
1510
+ ],
1511
+ "direction": "vertical",
1512
+ "gap": "md",
1513
+ "type": "stack"
1514
+ }
1515
+ ],
1516
+ "padding": "md",
1517
+ "type": "box"
1518
+ }
1519
+ ],
1520
+ [
1521
+ "emit",
1522
+ "CHOICE_MADE",
1523
+ {
1524
+ "ended": "@entity.done",
1525
+ "metricA": "@entity.metricA",
1526
+ "metricB": "@entity.metricB",
1527
+ "nodeId": "@entity.currentId"
1528
+ }
1529
+ ]
1530
+ ],
1531
+ "event": "CHOOSE",
1532
+ "eventId": "evt_01M07581GAXGCFP96CXPQ3WEKG",
1533
+ "from": "idle",
1534
+ "guard": [
1535
+ "and",
1536
+ [
1537
+ "==",
1538
+ "@entity.active",
1539
+ true
1540
+ ],
1541
+ [
1542
+ "==",
1543
+ "@entity.done",
1544
+ false
1545
+ ]
1546
+ ],
1547
+ "to": "idle"
1548
+ },
1549
+ {
1550
+ "effects": [
1551
+ [
1552
+ "let",
1553
+ [
1554
+ [
1555
+ "start",
1556
+ [
1557
+ "array/find",
1558
+ "@config.nodes",
1559
+ [
1560
+ "fn",
1561
+ "n",
1562
+ [
1563
+ "==",
1564
+ [
1565
+ "object/get",
1566
+ "@n",
1567
+ "id"
1568
+ ],
1569
+ "@config.startId"
1570
+ ]
1571
+ ]
1572
+ ]
1573
+ ]
1574
+ ],
1575
+ [
1576
+ "do",
1577
+ [
1578
+ "set",
1579
+ "@entity.active",
1580
+ true
1581
+ ],
1582
+ [
1583
+ "set",
1584
+ "@entity.title",
1585
+ "@config.title"
1586
+ ],
1587
+ [
1588
+ "set",
1589
+ "@entity.currentId",
1590
+ "@config.startId"
1591
+ ],
1592
+ [
1593
+ "set",
1594
+ "@entity.situation",
1595
+ [
1596
+ "object/get",
1597
+ "@start",
1598
+ "situation"
1599
+ ]
1600
+ ],
1601
+ [
1602
+ "set",
1603
+ "@entity.choices",
1604
+ [
1605
+ "object/get",
1606
+ "@start",
1607
+ "choices",
1608
+ []
1609
+ ]
1610
+ ],
1611
+ [
1612
+ "set",
1613
+ "@entity.metricA",
1614
+ "@config.metricAStart"
1615
+ ],
1616
+ [
1617
+ "set",
1618
+ "@entity.metricB",
1619
+ "@config.metricBStart"
1620
+ ],
1621
+ [
1622
+ "set",
1623
+ "@entity.stepCount",
1624
+ 0.0
1625
+ ],
1626
+ [
1627
+ "set",
1628
+ "@entity.path",
1629
+ []
1630
+ ],
1631
+ [
1632
+ "set",
1633
+ "@entity.done",
1634
+ false
1635
+ ],
1636
+ [
1637
+ "set",
1638
+ "@entity.feedback",
1639
+ ""
1640
+ ],
1641
+ [
1642
+ "set",
1643
+ "@entity.view",
1644
+ [
1645
+ {
1646
+ "children": [
1647
+ {
1648
+ "content": "@entity.situation",
1649
+ "type": "typography",
1650
+ "variant": "body"
1651
+ }
1652
+ ],
1653
+ "padding": "md",
1654
+ "type": "card",
1655
+ "variant": "bordered"
1656
+ }
1657
+ ]
1658
+ ]
1659
+ ]
1660
+ ],
1661
+ [
1662
+ "render-ui",
1663
+ "main",
1664
+ {
1665
+ "children": [
1666
+ {
1667
+ "children": [
1668
+ {
1669
+ "content": "@entity.title",
1670
+ "type": "typography",
1671
+ "variant": "h4"
1672
+ },
1673
+ {
1674
+ "content": [
1675
+ "str/concat",
1676
+ "@config.metricALabel",
1677
+ ": ",
1678
+ [
1679
+ "math/round",
1680
+ "@entity.metricA",
1681
+ 0.0
1682
+ ],
1683
+ " · ",
1684
+ "@config.metricBLabel",
1685
+ ": ",
1686
+ [
1687
+ "math/round",
1688
+ "@entity.metricB",
1689
+ 0.0
1690
+ ],
1691
+ " · decisions: ",
1692
+ [
1693
+ "str/concat",
1694
+ "",
1695
+ "@entity.stepCount"
1696
+ ]
1697
+ ],
1698
+ "type": "typography",
1699
+ "variant": "body"
1700
+ },
1701
+ {
1702
+ "children": "@entity.view",
1703
+ "direction": "vertical",
1704
+ "gap": "md",
1705
+ "type": "stack"
1706
+ },
1707
+ {
1708
+ "children": [
1709
+ "array/map",
1710
+ [
1711
+ "array/range",
1712
+ 0.0,
1713
+ [
1714
+ "array/len",
1715
+ "@entity.choices"
1716
+ ]
1717
+ ],
1718
+ [
1719
+ "fn",
1720
+ [
1721
+ "i"
1722
+ ],
1723
+ {
1724
+ "action": "CHOOSE",
1725
+ "actionPayload": {
1726
+ "index": "@i"
1727
+ },
1728
+ "disabled": [
1729
+ "if",
1730
+ "@entity.done",
1731
+ true,
1732
+ false
1733
+ ],
1734
+ "label": [
1735
+ "object/get",
1736
+ [
1737
+ "array/nth",
1738
+ "@entity.choices",
1739
+ "@i"
1740
+ ],
1741
+ "label"
1742
+ ],
1743
+ "size": "sm",
1744
+ "type": "button",
1745
+ "variant": "secondary"
1746
+ }
1747
+ ]
1748
+ ],
1749
+ "direction": "vertical",
1750
+ "gap": "xs",
1751
+ "type": "stack"
1752
+ },
1753
+ {
1754
+ "content": "@entity.feedback",
1755
+ "type": "typography",
1756
+ "variant": "caption"
1757
+ },
1758
+ {
1759
+ "children": [
1760
+ "array/map",
1761
+ "@entity.path",
1762
+ [
1763
+ "fn",
1764
+ [
1765
+ "line"
1766
+ ],
1767
+ {
1768
+ "color": "muted",
1769
+ "content": "@line",
1770
+ "type": "typography",
1771
+ "variant": "caption"
1772
+ }
1773
+ ]
1774
+ ],
1775
+ "direction": "vertical",
1776
+ "gap": "xs",
1777
+ "type": "stack"
1778
+ },
1779
+ {
1780
+ "children": [
1781
+ {
1782
+ "action": "RESTART",
1783
+ "disabled": [
1784
+ "if",
1785
+ "@entity.done",
1786
+ false,
1787
+ true
1788
+ ],
1789
+ "label": "@config.restartLabel",
1790
+ "type": "button",
1791
+ "variant": "primary"
1792
+ }
1793
+ ],
1794
+ "direction": "horizontal",
1795
+ "gap": "sm",
1796
+ "type": "stack"
1797
+ }
1798
+ ],
1799
+ "direction": "vertical",
1800
+ "gap": "md",
1801
+ "type": "stack"
1802
+ }
1803
+ ],
1804
+ "padding": "md",
1805
+ "type": "box"
1806
+ }
1807
+ ],
1808
+ [
1809
+ "emit",
1810
+ "SCENARIO_RESTARTED",
1811
+ {
1812
+ "startId": "@config.startId"
1813
+ }
1814
+ ]
1815
+ ],
1816
+ "event": "RESTART",
1817
+ "eventId": "evt_01M07581GA4D364K46318DFQET",
1818
+ "from": "idle",
1819
+ "guard": [
1820
+ "and",
1821
+ [
1822
+ "==",
1823
+ "@entity.active",
1824
+ true
1825
+ ],
1826
+ [
1827
+ "==",
1828
+ "@entity.done",
1829
+ true
1830
+ ]
1831
+ ],
1832
+ "to": "idle"
1833
+ }
1834
+ ]
1835
+ }
1836
+ }
1837
+ ]
1838
+ }
1839
+ ],
1840
+ "schemaVersion": 1,
1841
+ "version": "1.0.0"
1842
+ }