@almadar/std 16.241.0 → 16.243.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 (109) hide show
  1. package/behaviors/behaviors-registry.json +4650 -535
  2. package/behaviors/lolo/agent/atoms/std-agent-memory.lolo +38 -1
  3. package/behaviors/lolo/agent/atoms/std-agent-session.lolo +1074 -47
  4. package/behaviors/lolo/agent/atoms/std-agent-tool-loop.lolo +8 -7
  5. package/behaviors/lolo/agent/organisms/std-agent-assistant.lolo +56 -37
  6. package/behaviors/lolo/infra/atoms/std-page-open.lolo +59 -0
  7. package/behaviors/lolo/infra/atoms/std-page-search.lolo +136 -0
  8. package/behaviors/lolo/infra/atoms/std-page-treat.lolo +59 -0
  9. package/behaviors/lolo/infra/atoms/std-page-watch.lolo +88 -0
  10. package/behaviors/lolo/ui/core/atoms/std-book-reader.lolo +25 -1
  11. package/behaviors/lolo/ui/core/atoms/std-card-grid.lolo +9 -0
  12. package/behaviors/lolo/ui/core/atoms/std-doc-page.lolo +153 -0
  13. package/behaviors/lolo/ui/learning/atoms/std-learn-arrangement.lolo +124 -92
  14. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +114 -55
  15. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +40 -14
  16. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +363 -123
  17. package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +93 -48
  18. package/behaviors/lolo/ui/learning/atoms/std-learn-diagram.lolo +60 -28
  19. package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +193 -96
  20. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +75 -32
  21. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +142 -86
  22. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +266 -98
  23. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +103 -65
  24. package/behaviors/lolo/ui/learning/atoms/std-learn-live-sim.lolo +223 -109
  25. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +232 -64
  26. package/behaviors/lolo/ui/learning/atoms/std-learn-param-explorer.lolo +69 -29
  27. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +363 -123
  28. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +73 -41
  29. package/behaviors/lolo/ui/learning/atoms/std-learn-sample-accumulator.lolo +96 -38
  30. package/behaviors/lolo/ui/learning/atoms/std-learn-sandbox.lolo +65 -45
  31. package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +243 -117
  32. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +76 -28
  33. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +228 -109
  34. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +95 -44
  35. package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +199 -125
  36. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +92 -48
  37. package/behaviors/lolo/ui/learning/atoms/std-learn-trace-player.lolo +239 -78
  38. package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +147 -38
  39. package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +123 -58
  40. package/behaviors/lolo/ui/learning/atoms/ui-algo-graph-canvas.lolo +22 -0
  41. package/behaviors/lolo/ui/learning/atoms/ui-algorithm-canvas.lolo +26 -0
  42. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +26 -0
  43. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +27 -1
  44. package/behaviors/lolo/ui/learning/atoms/ui-learning-canvas.lolo +27 -1
  45. package/behaviors/lolo/ui/learning/atoms/ui-math-canvas.lolo +29 -9
  46. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +26 -0
  47. package/behaviors/lolo-behavior-contracts.json +1 -1
  48. package/behaviors/registry/agent/atoms/std-agent-memory.orb +372 -2
  49. package/behaviors/registry/agent/atoms/std-agent-session.orb +4752 -348
  50. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +54 -42
  51. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +356 -122
  52. package/behaviors/registry/factory-signatures.json +1 -1
  53. package/behaviors/registry/infra/atoms/std-page-open.orb +435 -0
  54. package/behaviors/registry/infra/atoms/std-page-search.orb +885 -0
  55. package/behaviors/registry/infra/atoms/std-page-treat.orb +494 -0
  56. package/behaviors/registry/infra/atoms/std-page-watch.orb +572 -0
  57. package/behaviors/registry/ui/core/atoms/std-book-reader.orb +119 -0
  58. package/behaviors/registry/ui/core/atoms/std-card-grid.orb +61 -0
  59. package/behaviors/registry/ui/core/atoms/std-doc-page.orb +594 -0
  60. package/behaviors/registry/ui/learning/atoms/std-learn-arrangement.orb +903 -369
  61. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1002 -232
  62. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +253 -74
  63. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3624 -921
  64. package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +685 -144
  65. package/behaviors/registry/ui/learning/atoms/std-learn-diagram.orb +404 -52
  66. package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +1787 -210
  67. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +699 -71
  68. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +1102 -578
  69. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +2760 -872
  70. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +689 -152
  71. package/behaviors/registry/ui/learning/atoms/std-learn-live-sim.orb +1431 -633
  72. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +2485 -512
  73. package/behaviors/registry/ui/learning/atoms/std-learn-param-explorer.orb +501 -197
  74. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +3642 -928
  75. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +705 -125
  76. package/behaviors/registry/ui/learning/atoms/std-learn-sample-accumulator.orb +624 -114
  77. package/behaviors/registry/ui/learning/atoms/std-learn-sandbox.orb +405 -153
  78. package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +1911 -611
  79. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +436 -128
  80. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +2482 -485
  81. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +896 -192
  82. package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +2001 -759
  83. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +734 -228
  84. package/behaviors/registry/ui/learning/atoms/std-learn-trace-player.orb +2501 -764
  85. package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +1591 -173
  86. package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +883 -122
  87. package/behaviors/registry/ui/learning/atoms/ui-algo-graph-canvas.orb +176 -0
  88. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +211 -0
  89. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +211 -0
  90. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +212 -1
  91. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +212 -1
  92. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +203 -9
  93. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +211 -0
  94. package/behaviors/signatures.lolo +325 -655
  95. package/dist/behaviors/exports-reader.js +16092 -9747
  96. package/dist/behaviors/functions/index.d.ts +1052 -136
  97. package/dist/behaviors/functions/index.js +16063 -9745
  98. package/dist/behaviors/index.d.ts +1 -1
  99. package/dist/behaviors/index.js +16093 -9748
  100. package/dist/behaviors/query.js +16092 -9747
  101. package/dist/behaviors-embeddings.hash.json +3 -3
  102. package/dist/behaviors-embeddings.json +45 -25
  103. package/dist/behaviors-registry.json +4650 -535
  104. package/dist/index.d.ts +1 -1
  105. package/dist/index.js +16093 -9748
  106. package/dist/knob-embeddings.hash.json +3 -3
  107. package/dist/knob-embeddings.json +607 -263
  108. package/dist/registry/factory-signatures.json +1 -1
  109. package/package.json +3 -3
@@ -53,21 +53,27 @@ orbital LearnDerivationOrbital {
53
53
  (set @entity.elapsedMs 0)
54
54
  (set @entity.lines @config.premises)
55
55
  (set @entity.renderChildren [
56
- { type: typography, variant: h4, content: @entity.title },
56
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
57
+ { type: stack, direction: vertical, gap: xs, children: [
58
+ { type: typography, variant: h4, content: @entity.title },
59
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
60
+ ] },
61
+ { type: badge, label: (if @entity.goalReached "Goal reached" (if @entity.running "Auto-stepping" "In progress")), variant: (if @entity.goalReached "success" (if @entity.running "primary" "neutral")) }
62
+ ] },
57
63
  { type: typography, variant: body, content: (str/concat @config.goalPrefix @config.goalLabel) },
58
64
  { type: stack, direction: vertical, gap: xs, style: { maxHeight: (str/concat @config.height "px"), overflowY: "auto" }, children: (array/map @entity.lines (fn line
59
- { type: stack, direction: horizontal, gap: sm, children: [
65
+ { type: stack, direction: horizontal, align: center, gap: sm, children: [
60
66
  { type: badge, label: @line.badgeLabel, variant: @line.badgeVariant },
61
67
  { type: typography, variant: body, content: @line.label }
62
68
  ] }
63
69
  )) },
64
- { type: stack, direction: horizontal, gap: sm, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: primary })) },
65
- { type: stack, direction: horizontal, gap: sm, children: [
66
- { type: button, action: TOGGLE_RUN, label: (if @entity.running "Pause" "Run"), variant: secondary },
67
- { type: button, action: RESET, label: @config.resetLabel, variant: ghost }
70
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: secondary, size: lg, disabled: @entity.goalReached })) },
71
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
72
+ (if @entity.running { type: button, action: TOGGLE_RUN, label: "Pause", icon: "pause", variant: primary, aria-pressed: "true" } { type: button, action: TOGGLE_RUN, label: "Run", icon: "play", variant: primary, aria-pressed: "false", disabled: @entity.goalReached }),
73
+ { type: button, action: RESET, label: @config.resetLabel, icon: "rotate-ccw", variant: ghost },
74
+ { type: typography, variant: caption, color: muted, content: (str/concat (array/len @entity.lines) " lines") }
68
75
  ] },
69
- { type: typography, variant: caption, content: @entity.narration },
70
- { type: typography, variant: caption, content: (if @entity.goalReached @config.goalReachedMessage "") }
76
+ { type: typography, variant: body, content: (if @entity.goalReached @config.goalReachedMessage @entity.narration) }
71
77
  ])
72
78
  (render-ui main {
73
79
  type: box
@@ -78,6 +84,11 @@ orbital LearnDerivationOrbital {
78
84
  ]
79
85
  })
80
86
 
87
+ MODE_SELECTED -> idle when (and (not (== @config.matchMode "")) (not (== ?mode @config.matchMode)))
88
+ (set @entity.active false)
89
+ (set @entity.running false)
90
+ (render-ui main null)
91
+
81
92
  MODE_SELECTED -> idle when (== ?mode @config.matchMode)
82
93
  (set @entity.active true)
83
94
  (set @entity.title @config.title)
@@ -88,21 +99,27 @@ orbital LearnDerivationOrbital {
88
99
  (set @entity.elapsedMs 0)
89
100
  (set @entity.lines @config.premises)
90
101
  (set @entity.renderChildren [
91
- { type: typography, variant: h4, content: @entity.title },
102
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
103
+ { type: stack, direction: vertical, gap: xs, children: [
104
+ { type: typography, variant: h4, content: @entity.title },
105
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
106
+ ] },
107
+ { type: badge, label: (if @entity.goalReached "Goal reached" (if @entity.running "Auto-stepping" "In progress")), variant: (if @entity.goalReached "success" (if @entity.running "primary" "neutral")) }
108
+ ] },
92
109
  { type: typography, variant: body, content: (str/concat @config.goalPrefix @config.goalLabel) },
93
110
  { type: stack, direction: vertical, gap: xs, style: { maxHeight: (str/concat @config.height "px"), overflowY: "auto" }, children: (array/map @entity.lines (fn line
94
- { type: stack, direction: horizontal, gap: sm, children: [
111
+ { type: stack, direction: horizontal, align: center, gap: sm, children: [
95
112
  { type: badge, label: @line.badgeLabel, variant: @line.badgeVariant },
96
113
  { type: typography, variant: body, content: @line.label }
97
114
  ] }
98
115
  )) },
99
- { type: stack, direction: horizontal, gap: sm, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: primary })) },
100
- { type: stack, direction: horizontal, gap: sm, children: [
101
- { type: button, action: TOGGLE_RUN, label: (if @entity.running "Pause" "Run"), variant: secondary },
102
- { type: button, action: RESET, label: @config.resetLabel, variant: ghost }
116
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: secondary, size: lg, disabled: @entity.goalReached })) },
117
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
118
+ (if @entity.running { type: button, action: TOGGLE_RUN, label: "Pause", icon: "pause", variant: primary, aria-pressed: "true" } { type: button, action: TOGGLE_RUN, label: "Run", icon: "play", variant: primary, aria-pressed: "false", disabled: @entity.goalReached }),
119
+ { type: button, action: RESET, label: @config.resetLabel, icon: "rotate-ccw", variant: ghost },
120
+ { type: typography, variant: caption, color: muted, content: (str/concat (array/len @entity.lines) " lines") }
103
121
  ] },
104
- { type: typography, variant: caption, content: @entity.narration },
105
- { type: typography, variant: caption, content: (if @entity.goalReached @config.goalReachedMessage "") }
122
+ { type: typography, variant: body, content: (if @entity.goalReached @config.goalReachedMessage @entity.narration) }
106
123
  ])
107
124
  (render-ui main {
108
125
  type: box
@@ -150,21 +167,27 @@ orbital LearnDerivationOrbital {
150
167
  )
151
168
  )
152
169
  (set @entity.renderChildren [
153
- { type: typography, variant: h4, content: @entity.title },
170
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
171
+ { type: stack, direction: vertical, gap: xs, children: [
172
+ { type: typography, variant: h4, content: @entity.title },
173
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
174
+ ] },
175
+ { type: badge, label: (if @entity.goalReached "Goal reached" (if @entity.running "Auto-stepping" "In progress")), variant: (if @entity.goalReached "success" (if @entity.running "primary" "neutral")) }
176
+ ] },
154
177
  { type: typography, variant: body, content: (str/concat @config.goalPrefix @config.goalLabel) },
155
178
  { type: stack, direction: vertical, gap: xs, style: { maxHeight: (str/concat @config.height "px"), overflowY: "auto" }, children: (array/map @entity.lines (fn line
156
- { type: stack, direction: horizontal, gap: sm, children: [
179
+ { type: stack, direction: horizontal, align: center, gap: sm, children: [
157
180
  { type: badge, label: @line.badgeLabel, variant: @line.badgeVariant },
158
181
  { type: typography, variant: body, content: @line.label }
159
182
  ] }
160
183
  )) },
161
- { type: stack, direction: horizontal, gap: sm, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: primary })) },
162
- { type: stack, direction: horizontal, gap: sm, children: [
163
- { type: button, action: TOGGLE_RUN, label: (if @entity.running "Pause" "Run"), variant: secondary },
164
- { type: button, action: RESET, label: @config.resetLabel, variant: ghost }
184
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: secondary, size: lg, disabled: @entity.goalReached })) },
185
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
186
+ (if @entity.running { type: button, action: TOGGLE_RUN, label: "Pause", icon: "pause", variant: primary, aria-pressed: "true" } { type: button, action: TOGGLE_RUN, label: "Run", icon: "play", variant: primary, aria-pressed: "false", disabled: @entity.goalReached }),
187
+ { type: button, action: RESET, label: @config.resetLabel, icon: "rotate-ccw", variant: ghost },
188
+ { type: typography, variant: caption, color: muted, content: (str/concat (array/len @entity.lines) " lines") }
165
189
  ] },
166
- { type: typography, variant: caption, content: @entity.narration },
167
- { type: typography, variant: caption, content: (if @entity.goalReached @config.goalReachedMessage "") }
190
+ { type: typography, variant: body, content: (if @entity.goalReached @config.goalReachedMessage @entity.narration) }
168
191
  ])
169
192
  (render-ui main {
170
193
  type: box
@@ -181,21 +204,27 @@ orbital LearnDerivationOrbital {
181
204
  (set @entity.feedback (if @entity.running @config.autoRunOnMessage @config.autoRunOffMessage))
182
205
  (set @entity.narration @entity.feedback)
183
206
  (set @entity.renderChildren [
184
- { type: typography, variant: h4, content: @entity.title },
207
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
208
+ { type: stack, direction: vertical, gap: xs, children: [
209
+ { type: typography, variant: h4, content: @entity.title },
210
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
211
+ ] },
212
+ { type: badge, label: (if @entity.goalReached "Goal reached" (if @entity.running "Auto-stepping" "In progress")), variant: (if @entity.goalReached "success" (if @entity.running "primary" "neutral")) }
213
+ ] },
185
214
  { type: typography, variant: body, content: (str/concat @config.goalPrefix @config.goalLabel) },
186
215
  { type: stack, direction: vertical, gap: xs, style: { maxHeight: (str/concat @config.height "px"), overflowY: "auto" }, children: (array/map @entity.lines (fn line
187
- { type: stack, direction: horizontal, gap: sm, children: [
216
+ { type: stack, direction: horizontal, align: center, gap: sm, children: [
188
217
  { type: badge, label: @line.badgeLabel, variant: @line.badgeVariant },
189
218
  { type: typography, variant: body, content: @line.label }
190
219
  ] }
191
220
  )) },
192
- { type: stack, direction: horizontal, gap: sm, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: primary })) },
193
- { type: stack, direction: horizontal, gap: sm, children: [
194
- { type: button, action: TOGGLE_RUN, label: (if @entity.running "Pause" "Run"), variant: secondary },
195
- { type: button, action: RESET, label: @config.resetLabel, variant: ghost }
221
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: secondary, size: lg, disabled: @entity.goalReached })) },
222
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
223
+ (if @entity.running { type: button, action: TOGGLE_RUN, label: "Pause", icon: "pause", variant: primary, aria-pressed: "true" } { type: button, action: TOGGLE_RUN, label: "Run", icon: "play", variant: primary, aria-pressed: "false", disabled: @entity.goalReached }),
224
+ { type: button, action: RESET, label: @config.resetLabel, icon: "rotate-ccw", variant: ghost },
225
+ { type: typography, variant: caption, color: muted, content: (str/concat (array/len @entity.lines) " lines") }
196
226
  ] },
197
- { type: typography, variant: caption, content: @entity.narration },
198
- { type: typography, variant: caption, content: (if @entity.goalReached @config.goalReachedMessage "") }
227
+ { type: typography, variant: body, content: (if @entity.goalReached @config.goalReachedMessage @entity.narration) }
199
228
  ])
200
229
  (render-ui main {
201
230
  type: box
@@ -215,21 +244,27 @@ orbital LearnDerivationOrbital {
215
244
  (set @entity.running @config.autoRun)
216
245
  (set @entity.elapsedMs 0)
217
246
  (set @entity.renderChildren [
218
- { type: typography, variant: h4, content: @entity.title },
247
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
248
+ { type: stack, direction: vertical, gap: xs, children: [
249
+ { type: typography, variant: h4, content: @entity.title },
250
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
251
+ ] },
252
+ { type: badge, label: (if @entity.goalReached "Goal reached" (if @entity.running "Auto-stepping" "In progress")), variant: (if @entity.goalReached "success" (if @entity.running "primary" "neutral")) }
253
+ ] },
219
254
  { type: typography, variant: body, content: (str/concat @config.goalPrefix @config.goalLabel) },
220
255
  { type: stack, direction: vertical, gap: xs, style: { maxHeight: (str/concat @config.height "px"), overflowY: "auto" }, children: (array/map @entity.lines (fn line
221
- { type: stack, direction: horizontal, gap: sm, children: [
256
+ { type: stack, direction: horizontal, align: center, gap: sm, children: [
222
257
  { type: badge, label: @line.badgeLabel, variant: @line.badgeVariant },
223
258
  { type: typography, variant: body, content: @line.label }
224
259
  ] }
225
260
  )) },
226
- { type: stack, direction: horizontal, gap: sm, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: primary })) },
227
- { type: stack, direction: horizontal, gap: sm, children: [
228
- { type: button, action: TOGGLE_RUN, label: (if @entity.running "Pause" "Run"), variant: secondary },
229
- { type: button, action: RESET, label: @config.resetLabel, variant: ghost }
261
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: secondary, size: lg, disabled: @entity.goalReached })) },
262
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
263
+ (if @entity.running { type: button, action: TOGGLE_RUN, label: "Pause", icon: "pause", variant: primary, aria-pressed: "true" } { type: button, action: TOGGLE_RUN, label: "Run", icon: "play", variant: primary, aria-pressed: "false", disabled: @entity.goalReached }),
264
+ { type: button, action: RESET, label: @config.resetLabel, icon: "rotate-ccw", variant: ghost },
265
+ { type: typography, variant: caption, color: muted, content: (str/concat (array/len @entity.lines) " lines") }
230
266
  ] },
231
- { type: typography, variant: caption, content: @entity.narration },
232
- { type: typography, variant: caption, content: (if @entity.goalReached @config.goalReachedMessage "") }
267
+ { type: typography, variant: body, content: (if @entity.goalReached @config.goalReachedMessage @entity.narration) }
233
268
  ])
234
269
  (render-ui main {
235
270
  type: box
@@ -287,21 +322,27 @@ orbital LearnDerivationOrbital {
287
322
  )
288
323
  )
289
324
  (set @entity.renderChildren [
290
- { type: typography, variant: h4, content: @entity.title },
325
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
326
+ { type: stack, direction: vertical, gap: xs, children: [
327
+ { type: typography, variant: h4, content: @entity.title },
328
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
329
+ ] },
330
+ { type: badge, label: (if @entity.goalReached "Goal reached" (if @entity.running "Auto-stepping" "In progress")), variant: (if @entity.goalReached "success" (if @entity.running "primary" "neutral")) }
331
+ ] },
291
332
  { type: typography, variant: body, content: (str/concat @config.goalPrefix @config.goalLabel) },
292
333
  { type: stack, direction: vertical, gap: xs, style: { maxHeight: (str/concat @config.height "px"), overflowY: "auto" }, children: (array/map @entity.lines (fn line
293
- { type: stack, direction: horizontal, gap: sm, children: [
334
+ { type: stack, direction: horizontal, align: center, gap: sm, children: [
294
335
  { type: badge, label: @line.badgeLabel, variant: @line.badgeVariant },
295
336
  { type: typography, variant: body, content: @line.label }
296
337
  ] }
297
338
  )) },
298
- { type: stack, direction: horizontal, gap: sm, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: primary })) },
299
- { type: stack, direction: horizontal, gap: sm, children: [
300
- { type: button, action: TOGGLE_RUN, label: (if @entity.running "Pause" "Run"), variant: secondary },
301
- { type: button, action: RESET, label: @config.resetLabel, variant: ghost }
339
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: (array/map @config.candidates (fn c { type: button, action: APPLY_STEP, actionPayload: { candidateKey: @c.key }, label: @c.label, variant: secondary, size: lg, disabled: @entity.goalReached })) },
340
+ { type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
341
+ (if @entity.running { type: button, action: TOGGLE_RUN, label: "Pause", icon: "pause", variant: primary, aria-pressed: "true" } { type: button, action: TOGGLE_RUN, label: "Run", icon: "play", variant: primary, aria-pressed: "false", disabled: @entity.goalReached }),
342
+ { type: button, action: RESET, label: @config.resetLabel, icon: "rotate-ccw", variant: ghost },
343
+ { type: typography, variant: caption, color: muted, content: (str/concat (array/len @entity.lines) " lines") }
302
344
  ] },
303
- { type: typography, variant: caption, content: @entity.narration },
304
- { type: typography, variant: caption, content: (if @entity.goalReached @config.goalReachedMessage "") }
345
+ { type: typography, variant: body, content: (if @entity.goalReached @config.goalReachedMessage @entity.narration) }
305
346
  ])
306
347
  (render-ui main {
307
348
  type: box
@@ -364,6 +405,10 @@ orbital LearnDerivationOrbital {
364
405
  @label "Title"
365
406
  @description "Title shown above the derivation panel."
366
407
  @tier "presentation"
408
+ summary : string = ""
409
+ @label "Concept"
410
+ @description "One line under the title saying what is being derived (keep it under ~65 characters). Empty shows no line."
411
+ @tier "presentation"
367
412
  autoRun : boolean = false
368
413
  @label "Auto Run"
369
414
  @description "When true, INIT/MODE_SELECTED/Reset start the tick auto-applying candidates; toggle live with the Run/Pause button."
@@ -59,18 +59,28 @@ orbital LearnDiagramOrbital {
59
59
  padding: md
60
60
  children: [
61
61
  { type: stack, direction: vertical, gap: md, children: [
62
- { type: typography, variant: h4, content: @entity.title },
62
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
63
+ { type: stack, direction: vertical, gap: xs, children: [
64
+ { type: typography, variant: h4, content: @entity.title },
65
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
66
+ ] },
67
+ { type: badge, label: (if (== @entity.selectedId "") "Overview" (str/concat "Part " (str/concat "" (+ @entity.selectedIndex 1)) " of " (str/concat "" (array/len @entity.parts)))), variant: (if (== @entity.selectedId "") "neutral" "primary") }
68
+ ] },
69
+ { type: stack, direction: horizontal, align: center, gap: xs, wrap: true, children: @entity.partButtons },
63
70
  { type: biology-canvas, width: @config.width, height: @config.height, backgroundColor: @config.backgroundColor,
64
71
  nodes: (array/map @entity.parts (fn p { id: (object/get @p id), x: (object/get @p x), y: (object/get @p y), radius: (if (== (object/get @p id) @entity.selectedId) (* (object/get @p radius) 1.4) (object/get @p radius)), color: (object/get @p color), label: (object/get @p label) })),
65
72
  edges: @entity.links,
66
- shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, lineWidth: 4 } ])
73
+ shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, stroke: bold } ])
67
74
  },
68
- { type: card, variant: bordered, padding: md, children: @entity.captionChildren },
69
- { type: stack, direction: horizontal, gap: xs, children: @entity.partButtons }
75
+ { type: card, variant: bordered, padding: md, children: @entity.captionChildren }
70
76
  ] }
71
77
  ]
72
78
  })
73
79
 
80
+ MODE_SELECTED -> idle when (and (not (== @config.matchMode "")) (not (== ?mode @config.matchMode)))
81
+ (set @entity.active false)
82
+ (render-ui main null)
83
+
74
84
  MODE_SELECTED -> idle when (== ?mode @config.matchMode)
75
85
  (set @entity.active true)
76
86
  (set @entity.title @config.title)
@@ -94,14 +104,20 @@ orbital LearnDiagramOrbital {
94
104
  padding: md
95
105
  children: [
96
106
  { type: stack, direction: vertical, gap: md, children: [
97
- { type: typography, variant: h4, content: @entity.title },
107
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
108
+ { type: stack, direction: vertical, gap: xs, children: [
109
+ { type: typography, variant: h4, content: @entity.title },
110
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
111
+ ] },
112
+ { type: badge, label: (if (== @entity.selectedId "") "Overview" (str/concat "Part " (str/concat "" (+ @entity.selectedIndex 1)) " of " (str/concat "" (array/len @entity.parts)))), variant: (if (== @entity.selectedId "") "neutral" "primary") }
113
+ ] },
114
+ { type: stack, direction: horizontal, align: center, gap: xs, wrap: true, children: @entity.partButtons },
98
115
  { type: biology-canvas, width: @config.width, height: @config.height, backgroundColor: @config.backgroundColor,
99
116
  nodes: (array/map @entity.parts (fn p { id: (object/get @p id), x: (object/get @p x), y: (object/get @p y), radius: (if (== (object/get @p id) @entity.selectedId) (* (object/get @p radius) 1.4) (object/get @p radius)), color: (object/get @p color), label: (object/get @p label) })),
100
117
  edges: @entity.links,
101
- shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, lineWidth: 4 } ])
118
+ shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, stroke: bold } ])
102
119
  },
103
- { type: card, variant: bordered, padding: md, children: @entity.captionChildren },
104
- { type: stack, direction: horizontal, gap: xs, children: @entity.partButtons }
120
+ { type: card, variant: bordered, padding: md, children: @entity.captionChildren }
105
121
  ] }
106
122
  ]
107
123
  })
@@ -132,14 +148,20 @@ orbital LearnDiagramOrbital {
132
148
  padding: md
133
149
  children: [
134
150
  { type: stack, direction: vertical, gap: md, children: [
135
- { type: typography, variant: h4, content: @entity.title },
151
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
152
+ { type: stack, direction: vertical, gap: xs, children: [
153
+ { type: typography, variant: h4, content: @entity.title },
154
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
155
+ ] },
156
+ { type: badge, label: (if (== @entity.selectedId "") "Overview" (str/concat "Part " (str/concat "" (+ @entity.selectedIndex 1)) " of " (str/concat "" (array/len @entity.parts)))), variant: (if (== @entity.selectedId "") "neutral" "primary") }
157
+ ] },
158
+ { type: stack, direction: horizontal, align: center, gap: xs, wrap: true, children: @entity.partButtons },
136
159
  { type: biology-canvas, width: @config.width, height: @config.height, backgroundColor: @config.backgroundColor,
137
160
  nodes: (array/map @entity.parts (fn p { id: (object/get @p id), x: (object/get @p x), y: (object/get @p y), radius: (if (== (object/get @p id) @entity.selectedId) (* (object/get @p radius) 1.4) (object/get @p radius)), color: (object/get @p color), label: (object/get @p label) })),
138
161
  edges: @entity.links,
139
- shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, lineWidth: 4 } ])
162
+ shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, stroke: bold } ])
140
163
  },
141
- { type: card, variant: bordered, padding: md, children: @entity.captionChildren },
142
- { type: stack, direction: horizontal, gap: xs, children: @entity.partButtons }
164
+ { type: card, variant: bordered, padding: md, children: @entity.captionChildren }
143
165
  ] }
144
166
  ]
145
167
  })
@@ -164,14 +186,20 @@ orbital LearnDiagramOrbital {
164
186
  padding: md
165
187
  children: [
166
188
  { type: stack, direction: vertical, gap: md, children: [
167
- { type: typography, variant: h4, content: @entity.title },
189
+ { type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
190
+ { type: stack, direction: vertical, gap: xs, children: [
191
+ { type: typography, variant: h4, content: @entity.title },
192
+ (if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
193
+ ] },
194
+ { type: badge, label: (if (== @entity.selectedId "") "Overview" (str/concat "Part " (str/concat "" (+ @entity.selectedIndex 1)) " of " (str/concat "" (array/len @entity.parts)))), variant: (if (== @entity.selectedId "") "neutral" "primary") }
195
+ ] },
196
+ { type: stack, direction: horizontal, align: center, gap: xs, wrap: true, children: @entity.partButtons },
168
197
  { type: biology-canvas, width: @config.width, height: @config.height, backgroundColor: @config.backgroundColor,
169
198
  nodes: (array/map @entity.parts (fn p { id: (object/get @p id), x: (object/get @p x), y: (object/get @p y), radius: (if (== (object/get @p id) @entity.selectedId) (* (object/get @p radius) 1.4) (object/get @p radius)), color: (object/get @p color), label: (object/get @p label) })),
170
199
  edges: @entity.links,
171
- shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, lineWidth: 4 } ])
200
+ shapes: (if (== @entity.selectedId "") [] [ { type: circle, x: (object/get (array/nth @entity.parts @entity.selectedIndex) x), y: (object/get (array/nth @entity.parts @entity.selectedIndex) y), radius: (+ (object/get (array/nth @entity.parts @entity.selectedIndex) radius) 10), color: @config.highlightColor, stroke: bold } ])
172
201
  },
173
- { type: card, variant: bordered, padding: md, children: @entity.captionChildren },
174
- { type: stack, direction: horizontal, gap: xs, children: @entity.partButtons }
202
+ { type: card, variant: bordered, padding: md, children: @entity.captionChildren }
175
203
  ] }
176
204
  ]
177
205
  })
@@ -218,22 +246,26 @@ orbital LearnDiagramOrbital {
218
246
  @label "Title"
219
247
  @description "Title shown above the diagram."
220
248
  @tier "presentation"
249
+ summary : string = ""
250
+ @label "Concept"
251
+ @description "One line under the title saying what the learner is looking at (keep it under ~65 characters). Empty shows no line."
252
+ @tier "presentation"
221
253
  parts : [LearnDiagramPart] = [
222
- { id: "input", label: "Input", description: "Receives raw data or requests from the outside world and hands them to the processor.", x: 120, y: 200, radius: 34, color: "#2563eb" },
223
- { id: "processor", label: "Processor", description: "The central component that transforms incoming data according to the system's rules.", x: 300, y: 200, radius: 46, color: "#7c3aed" },
224
- { id: "storage", label: "Storage", description: "Persists data so it can be retrieved later, even after the system restarts.", x: 300, y: 320, radius: 34, color: "#0891b2" },
225
- { id: "output", label: "Output", description: "Delivers the processor's results back out to users or other systems.", x: 480, y: 200, radius: 34, color: "#16a34a" },
226
- { id: "controller", label: "Controller", description: "Coordinates timing and configuration for the processor without touching the data itself.", x: 300, y: 80, radius: 26, color: "#dc2626" }
254
+ { id: "input", label: "Input", description: "Receives raw data or requests from the outside world and hands them to the processor.", x: 120, y: 200, radius: 34, color: "series-1" },
255
+ { id: "processor", label: "Processor", description: "The central component that transforms incoming data according to the system's rules.", x: 300, y: 200, radius: 46, color: "series-2" },
256
+ { id: "storage", label: "Storage", description: "Persists data so it can be retrieved later, even after the system restarts.", x: 300, y: 320, radius: 34, color: "series-3" },
257
+ { id: "output", label: "Output", description: "Delivers the processor's results back out to users or other systems.", x: 480, y: 200, radius: 34, color: "series-4" },
258
+ { id: "controller", label: "Controller", description: "Coordinates timing and configuration for the processor without touching the data itself.", x: 300, y: 80, radius: 26, color: "series-5" }
227
259
  ]
228
260
  @label "Parts"
229
261
  @description "Roster of labeled parts (id, label, description, x, y, radius, color) the diagram renders as circles; the learner selects one to see its description."
230
262
  @synonyms "part, node, component, label, annotation"
231
263
  @tier "domain"
232
264
  links : [LearnDiagramLink] = [
233
- { from: "input", to: "processor", color: "#cbd5e1", label: "" },
234
- { from: "processor", to: "storage", color: "#cbd5e1", label: "" },
235
- { from: "processor", to: "output", color: "#cbd5e1", label: "" },
236
- { from: "controller", to: "processor", color: "#cbd5e1", label: "" }
265
+ { from: "input", to: "processor", color: "guide", label: "" },
266
+ { from: "processor", to: "storage", color: "guide", label: "" },
267
+ { from: "processor", to: "output", color: "guide", label: "" },
268
+ { from: "controller", to: "processor", color: "guide", label: "" }
237
269
  ]
238
270
  @label "Links"
239
271
  @description "Connector lines drawn between parts, by id."
@@ -251,11 +283,11 @@ orbital LearnDiagramOrbital {
251
283
  @label "Height"
252
284
  @description "Canvas height in pixels."
253
285
  @tier "presentation"
254
- backgroundColor : string = "#f8fafc"
286
+ backgroundColor : string = ""
255
287
  @label "Background Color"
256
- @description "Canvas background color."
288
+ @description "Canvas ground. Empty uses the theme drawing ground."
257
289
  @tier "presentation"
258
- highlightColor : string = "#f59e0b"
290
+ highlightColor : string = "highlight"
259
291
  @label "Highlight Color"
260
292
  @description "Ring color drawn around the selected part."
261
293
  @tier "presentation"