@almadar/std 16.182.0 → 16.183.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 (30) hide show
  1. package/behaviors/lolo/infra/atoms/std-migration-job.lolo +2 -2
  2. package/behaviors/lolo/ui/game/atoms/std-fx-trail.lolo +63 -0
  3. package/behaviors/lolo/ui/game/atoms/std-gate-lock.lolo +96 -0
  4. package/behaviors/lolo/ui/game/atoms/std-lives.lolo +121 -0
  5. package/behaviors/lolo/ui/game/atoms/std-patrol-hazard.lolo +96 -0
  6. package/behaviors/lolo/ui/game/atoms/std-tutorial-overlay.lolo +164 -0
  7. package/behaviors/lolo/ui/learning/atoms/std-learn-slope-probe.lolo +117 -0
  8. package/behaviors/lolo/ui/learning/atoms/ui-math-canvas.lolo +18 -0
  9. package/behaviors/registry/infra/atoms/std-migration-job.orb +2 -2
  10. package/behaviors/registry/ui/game/atoms/std-fx-trail.orb +376 -0
  11. package/behaviors/registry/ui/game/atoms/std-gate-lock.orb +852 -0
  12. package/behaviors/registry/ui/game/atoms/std-lives.orb +739 -0
  13. package/behaviors/registry/ui/game/atoms/std-patrol-hazard.orb +768 -0
  14. package/behaviors/registry/ui/game/atoms/std-tutorial-overlay.orb +1060 -0
  15. package/behaviors/registry/ui/learning/atoms/std-learn-slope-probe.orb +908 -0
  16. package/dist/behaviors/exports-reader.js +2674 -2410
  17. package/dist/behaviors/functions/index.d.ts +534 -1
  18. package/dist/behaviors/functions/index.js +2657 -2411
  19. package/dist/behaviors/index.d.ts +1 -1
  20. package/dist/behaviors/index.js +2675 -2411
  21. package/dist/behaviors/query.js +2674 -2410
  22. package/dist/behaviors-embeddings.hash.json +3 -3
  23. package/dist/behaviors-embeddings.json +294 -270
  24. package/dist/behaviors-registry.json +1873 -390
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +2675 -2411
  27. package/dist/knob-embeddings.hash.json +3 -3
  28. package/dist/knob-embeddings.json +1 -1
  29. package/dist/registry/factory-signatures.json +1 -1
  30. package/package.json +2 -2
@@ -0,0 +1,117 @@
1
+ app std-learn-slope-probe "1.0.0"
2
+ "Headless derivative probe for graph-riding learning boards: while the body authority's BODY_MOVED reports its `skating` flag (body riding the curve), it brackets the configured curve around the body's x and derives the local calculus readout — the slope dy/dx, a tangent-line segment of half-width `window` centered on the contact point, a rise-over-run triangle (run `triRun`, rise slope·run), and the glow window of curve samples around the contact — all written to a [runtime, shared] entity so the board renders the math the player is physically riding. Emits the sparse SLOPE_CHANGED signal only when the slope crosses a 0.5 bucket boundary, so fx and HUD meters react to *changes* in steepness without paying a per-tick event. The curve is the same sample table the body skates and the canvas draws — one source, three views. Renders nothing."
3
+ orbital LearnSlopeProbeOrbital {
4
+ type ProbeSample = {
5
+ x : number!
6
+ y : number!
7
+ }
8
+
9
+ entity SlopeProbeState [runtime, shared] {
10
+ id : string!
11
+ probing : boolean = false
12
+ x : number = 0
13
+ y : number = 0
14
+ slope : number = 0
15
+ tax : number = 0
16
+ tay : number = 0
17
+ tbx : number = 0
18
+ tby : number = 0
19
+ triAx : number = 0
20
+ triAy : number = 0
21
+ triBx : number = 0
22
+ triBy : number = 0
23
+ triCx : number = 0
24
+ triCy : number = 0
25
+ segment : [ProbeSample] = []
26
+ bucket : number = 9999
27
+ }
28
+
29
+ trait LearnSlopeProbe -> @rebindable SlopeProbeState [lifecycle] {
30
+ initial: idle
31
+
32
+ state idle {
33
+ INIT -> idle
34
+ (set @entity.probing false)
35
+ (set @entity.segment [])
36
+ (set @entity.bucket 9999)
37
+
38
+ BODY_MOVED -> idle when @config.running
39
+ (let ((on (and @payload.skating (> (array/len @config.curve) 1))))
40
+ (let ((inRange (and @on (and (>= @payload.x (object/get (array/first @config.curve) x)) (<= @payload.x (object/get (array/last @config.curve) x))))))
41
+ (if @inRange
42
+ (let ((leftSamp (array/last (array/filter @config.curve (fn s (<= (object/get @s x) @payload.x)))))
43
+ (rightSamp (array/first (array/filter @config.curve (fn s (> (object/get @s x) @payload.x))))))
44
+ (let ((slope (if (== @rightSamp null) 0 (/ (- (object/get @rightSamp y) (object/get @leftSamp y)) (- (object/get @rightSamp x) (object/get @leftSamp x))))))
45
+ (let ((curveY (if (== @rightSamp null) (object/get @leftSamp y) (+ (object/get @leftSamp y) (* @slope (- @payload.x (object/get @leftSamp x)))))))
46
+ (let ((norm (math/sqrt (+ 1 (* @slope @slope)))))
47
+ (let ((dx (/ @config.window @norm)) (dy (/ (* @slope @config.window) @norm)))
48
+ (let ((newBucket (* (math/round (* @slope 2) 0) 0.5)))
49
+ (do
50
+ (set @entity.probing true)
51
+ (set @entity.x @payload.x)
52
+ (set @entity.y @curveY)
53
+ (set @entity.slope @slope)
54
+ (set @entity.tax (- @payload.x @dx))
55
+ (set @entity.tay (- @curveY @dy))
56
+ (set @entity.tbx (+ @payload.x @dx))
57
+ (set @entity.tby (+ @curveY @dy))
58
+ (set @entity.triAx @payload.x)
59
+ (set @entity.triAy @curveY)
60
+ (set @entity.triBx (+ @payload.x @config.triRun))
61
+ (set @entity.triBy @curveY)
62
+ (set @entity.triCx (+ @payload.x @config.triRun))
63
+ (set @entity.triCy (+ @curveY (* @slope @config.triRun)))
64
+ (set @entity.segment (array/filter @config.curve (fn s (and (>= (object/get @s x) (- @payload.x @config.window)) (<= (object/get @s x) (+ @payload.x @config.window))))))
65
+ (if (!= @newBucket @entity.bucket)
66
+ (do
67
+ (set @entity.bucket @newBucket)
68
+ (emit SLOPE_CHANGED { slope: @slope, bucket: @newBucket }))
69
+ null))))))))
70
+ (if @entity.probing
71
+ (do
72
+ (set @entity.probing false)
73
+ (set @entity.segment []))
74
+ null))))
75
+
76
+ RESTART -> idle
77
+ (set @entity.probing false)
78
+ (set @entity.segment [])
79
+ (set @entity.bucket 9999)
80
+ }
81
+
82
+ emits {
83
+ SLOPE_CHANGED -> external {
84
+ slope : number!
85
+ bucket : number!
86
+ }
87
+ @description "The local dy/dx crossed a 0.5 bucket boundary while the probe was active; slope is exact, bucket is the rounded step — fx/HUD scale with steepness without paying per-tick events."
88
+ @tier "domain"
89
+ }
90
+
91
+ listens {
92
+ BODY_MOVED { x : number!, y : number!, vx : number!, vy : number!, grounded : boolean!, skating : boolean!, speed : number! }
93
+ RESTART { id : string }
94
+ }
95
+
96
+ config {
97
+ running : boolean = true
98
+ @label "Running"
99
+ @description "When true the probe derives the readout off BODY_MOVED; toggle to freeze it (the board hides the tangent overlays when probing goes stale)."
100
+ @tier "domain"
101
+ curve : [ProbeSample] = []
102
+ @label "Curve"
103
+ @description "Surface samples (x strictly increasing) of the graph being ridden — the same table the body skates and the canvas draws, so the readout matches what is underfoot."
104
+ @tier "domain"
105
+ window : number = 1.5
106
+ @label "Tangent Window"
107
+ @description "Half-length (world units along the tangent) of the tangent segment and of the glow sample window around the contact point."
108
+ @tier "presentation"
109
+ triRun : number = 1
110
+ @label "Triangle Run"
111
+ @description "Horizontal leg of the rise-over-run triangle; the vertical leg is slope × triRun, so triRun = 1 reads the slope directly."
112
+ @tier "presentation"
113
+ }
114
+ }
115
+
116
+ page "/learn-slope-probe" as LearnSlopeProbePage -> LearnSlopeProbe
117
+ }
@@ -168,6 +168,9 @@ orbital MathCanvasOrbital {
168
168
  showAxes: @config.showAxes
169
169
  showGrid: @config.showGrid
170
170
  gridStep: @config.gridStep
171
+ backgroundColor: @config.backgroundColor
172
+ gridColor: @config.gridColor
173
+ axisColor: @config.axisColor
171
174
  showTickLabels: @config.showTickLabels
172
175
  showCurveLabels: @config.showCurveLabels
173
176
  curves: @config.curves
@@ -203,6 +206,9 @@ orbital MathCanvasOrbital {
203
206
  showAxes: @config.showAxes
204
207
  showGrid: @config.showGrid
205
208
  gridStep: @config.gridStep
209
+ backgroundColor: @config.backgroundColor
210
+ gridColor: @config.gridColor
211
+ axisColor: @config.axisColor
206
212
  showTickLabels: @config.showTickLabels
207
213
  showCurveLabels: @config.showCurveLabels
208
214
  curves: @payload.curves
@@ -299,6 +305,18 @@ orbital MathCanvasOrbital {
299
305
  @label "Grid Step"
300
306
  @description "gridStep prop"
301
307
  @tier "presentation"
308
+ backgroundColor : string
309
+ @label "Background Color"
310
+ @description "Canvas fill color; accepts theme-token refs like var(--color-background, transparent) — resolved against the active theme at draw time. Default transparent."
311
+ @tier "presentation"
312
+ gridColor : string = "var(--color-border, #9ca3af)"
313
+ @label "Grid Color"
314
+ @description "Grid line color; theme-token aware (defaults to the active theme's border color at 35% opacity, falling back to neutral gray)."
315
+ @tier "presentation"
316
+ axisColor : string = "var(--color-muted-foreground, #374151)"
317
+ @label "Axis Color"
318
+ @description "Axis line color; theme-token aware (defaults to the active theme's muted-foreground, falling back to slate)."
319
+ @tier "presentation"
302
320
  showTickLabels : boolean = false
303
321
  @label "Show Tick Labels"
304
322
  @description "Draw numeric labels on grid lines (default false)."
@@ -335,11 +335,11 @@
335
335
  "config": {
336
336
  "connectionRef": {
337
337
  "default": "",
338
- "description": "Secret-store / environment KEY holding the source credentials. The reference is stored; the secret itself never enters config, traces, or snapshots — the migration service resolves it at run time. (Typed `string` until the `secret` config-field type lands in the lolo language tracked gap.)",
338
+ "description": "Secret-store / environment KEY holding the source credentials. The reference is stored; the secret itself never enters config, traces, or snapshots — the migration service resolves it at run time. (Typed `secret` the config-field type that marks a credential reference; UI password-renders it and traces mask it.)",
339
339
  "label": "Connection reference",
340
340
  "synonyms": "credential key, connection string reference, secret name",
341
341
  "tier": "internal",
342
- "type": "string"
342
+ "type": "secret"
343
343
  },
344
344
  "reviewSlot": {
345
345
  "default": "modal",
@@ -0,0 +1,376 @@
1
+ {
2
+ "description": "Headless motion-trail mechanic: records the moving body's recent positions as timestamped dots on a [runtime, shared] entity so the render layer can draw a fading comet trail. Rides the body authority's BODY_MOVED — appends a dot only when the body's speed exceeds minSpeed (standing still leaves no trail) and prunes dots older than ttl on the same pass, so no decay tick is needed and a stopped body's trail simply stops growing (the render side fades each dot by bornAt/ttl). RESTART clears. Renders nothing.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M0PCAKRAB0PFSPQ98X9S0BNF": {
6
+ "bakedName": "FxTrailData",
7
+ "curName": "FxTrailData",
8
+ "id": "ent_01M0PCAKRAB0PFSPQ98X9S0BNF",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01M0PCAKRA14YFRZZGT8CDR3BE": {
14
+ "bakedName": "INIT",
15
+ "curName": "INIT",
16
+ "id": "evt_01M0PCAKRA14YFRZZGT8CDR3BE",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01M0PCAKRAJE43ZB66D52QJSGZ",
20
+ "renames": []
21
+ },
22
+ "evt_01M0PCAKRAK7M2V40695X450BC": {
23
+ "bakedName": "RESTART",
24
+ "curName": "RESTART",
25
+ "id": "evt_01M0PCAKRAK7M2V40695X450BC",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01M0PCAKRAJE43ZB66D52QJSGZ",
29
+ "renames": []
30
+ },
31
+ "evt_01M0PCAKRAWHX8VG91V45K7YYE": {
32
+ "bakedName": "BODY_MOVED",
33
+ "curName": "BODY_MOVED",
34
+ "id": "evt_01M0PCAKRAWHX8VG91V45K7YYE",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01M0PCAKRAJE43ZB66D52QJSGZ",
38
+ "renames": []
39
+ },
40
+ "orb_01M0PCAKRAXW91Y5Y34VV62FV0": {
41
+ "bakedName": "FxTrailOrbital",
42
+ "curName": "FxTrailOrbital",
43
+ "id": "orb_01M0PCAKRAXW91Y5Y34VV62FV0",
44
+ "kind": "orbital",
45
+ "owner": "workspace",
46
+ "renames": []
47
+ },
48
+ "pag_01M0PCAKRAY62QVZS832H2XSWS": {
49
+ "bakedName": "FxTrailPage",
50
+ "curName": "FxTrailPage",
51
+ "id": "pag_01M0PCAKRAY62QVZS832H2XSWS",
52
+ "kind": "page",
53
+ "owner": "workspace",
54
+ "renames": []
55
+ },
56
+ "trt_01M0PCAKRAJE43ZB66D52QJSGZ": {
57
+ "bakedName": "FxTrail",
58
+ "curName": "FxTrail",
59
+ "id": "trt_01M0PCAKRAJE43ZB66D52QJSGZ",
60
+ "kind": "trait",
61
+ "owner": "workspace",
62
+ "renames": []
63
+ }
64
+ },
65
+ "schemaVersion": 1
66
+ },
67
+ "name": "std-fx-trail",
68
+ "orbitals": [
69
+ {
70
+ "entity": {
71
+ "fields": [
72
+ {
73
+ "name": "id",
74
+ "required": true,
75
+ "type": "string"
76
+ },
77
+ {
78
+ "default": [],
79
+ "items": {
80
+ "properties": {
81
+ "bornAt": {
82
+ "name": "bornAt",
83
+ "required": true,
84
+ "type": "number"
85
+ },
86
+ "id": {
87
+ "name": "id",
88
+ "required": true,
89
+ "type": "string"
90
+ },
91
+ "ttl": {
92
+ "name": "ttl",
93
+ "required": true,
94
+ "type": "number"
95
+ },
96
+ "x": {
97
+ "name": "x",
98
+ "required": true,
99
+ "type": "number"
100
+ },
101
+ "y": {
102
+ "name": "y",
103
+ "required": true,
104
+ "type": "number"
105
+ }
106
+ },
107
+ "type": "object"
108
+ },
109
+ "name": "trail",
110
+ "type": "array"
111
+ },
112
+ {
113
+ "default": 0.0,
114
+ "name": "seq",
115
+ "type": "number"
116
+ }
117
+ ],
118
+ "id": "ent_01M0PCAKRAB0PFSPQ98X9S0BNF",
119
+ "name": "FxTrailData",
120
+ "persistence": "runtime",
121
+ "shared": true
122
+ },
123
+ "id": "orb_01M0PCAKRAXW91Y5Y34VV62FV0",
124
+ "name": "FxTrailOrbital",
125
+ "pages": [
126
+ {
127
+ "id": "pag_01M0PCAKRAY62QVZS832H2XSWS",
128
+ "name": "FxTrailPage",
129
+ "path": "/fx-trail",
130
+ "traits": [
131
+ {
132
+ "ref": "FxTrail",
133
+ "refId": "trt_01M0PCAKRAJE43ZB66D52QJSGZ"
134
+ }
135
+ ]
136
+ }
137
+ ],
138
+ "traits": [
139
+ {
140
+ "category": "lifecycle",
141
+ "config": {
142
+ "minSpeed": {
143
+ "default": 0.5,
144
+ "description": "Body speed (units/s, from BODY_MOVED) below which no dot is appended, so a resting body doesn't pile dots on one spot.",
145
+ "label": "Min Speed",
146
+ "tier": "domain",
147
+ "type": "number"
148
+ },
149
+ "running": {
150
+ "default": true,
151
+ "description": "When true, BODY_MOVED appends trail dots; toggle to freeze the trail (existing dots still age out).",
152
+ "label": "Running",
153
+ "tier": "domain",
154
+ "type": "boolean"
155
+ },
156
+ "ttl": {
157
+ "default": 600.0,
158
+ "description": "Milliseconds a trail dot lives; at a 33ms move cadence ~600ms keeps the last eighteen positions. The ttl is also the natural length cap — no separate limit needed.",
159
+ "label": "Trail Ttl (ms)",
160
+ "tier": "presentation",
161
+ "type": "number"
162
+ }
163
+ },
164
+ "entityContract": {
165
+ "provides": [
166
+ "seq",
167
+ "trail"
168
+ ],
169
+ "requires": []
170
+ },
171
+ "entityRebindable": true,
172
+ "entityRefIds": {
173
+ "FxTrailData": "ent_01M0PCAKRAB0PFSPQ98X9S0BNF"
174
+ },
175
+ "id": "trt_01M0PCAKRAJE43ZB66D52QJSGZ",
176
+ "linkedEntity": "FxTrailData",
177
+ "linkedEntityId": "ent_01M0PCAKRAB0PFSPQ98X9S0BNF",
178
+ "name": "FxTrail",
179
+ "scope": "instance",
180
+ "stateMachine": {
181
+ "events": [
182
+ {
183
+ "id": "evt_01M0PCAKRA14YFRZZGT8CDR3BE",
184
+ "key": "INIT",
185
+ "name": "Initialize"
186
+ },
187
+ {
188
+ "id": "evt_01M0PCAKRAWHX8VG91V45K7YYE",
189
+ "key": "BODY_MOVED",
190
+ "name": "Body Moved",
191
+ "payloadSchema": [
192
+ {
193
+ "name": "x",
194
+ "required": true,
195
+ "type": "number"
196
+ },
197
+ {
198
+ "name": "y",
199
+ "required": true,
200
+ "type": "number"
201
+ },
202
+ {
203
+ "name": "vx",
204
+ "required": true,
205
+ "type": "number"
206
+ },
207
+ {
208
+ "name": "vy",
209
+ "required": true,
210
+ "type": "number"
211
+ },
212
+ {
213
+ "name": "grounded",
214
+ "required": true,
215
+ "type": "boolean"
216
+ },
217
+ {
218
+ "name": "skating",
219
+ "required": true,
220
+ "type": "boolean"
221
+ },
222
+ {
223
+ "name": "speed",
224
+ "required": true,
225
+ "type": "number"
226
+ }
227
+ ]
228
+ },
229
+ {
230
+ "id": "evt_01M0PCAKRAK7M2V40695X450BC",
231
+ "key": "RESTART",
232
+ "name": "Restart",
233
+ "payloadSchema": [
234
+ {
235
+ "name": "id",
236
+ "type": "string"
237
+ }
238
+ ]
239
+ }
240
+ ],
241
+ "states": [
242
+ {
243
+ "isInitial": true,
244
+ "name": "active"
245
+ }
246
+ ],
247
+ "transitions": [
248
+ {
249
+ "effects": [
250
+ [
251
+ "set",
252
+ "@entity.trail",
253
+ []
254
+ ],
255
+ [
256
+ "set",
257
+ "@entity.seq",
258
+ 0.0
259
+ ]
260
+ ],
261
+ "event": "INIT",
262
+ "eventId": "evt_01M0PCAKRA14YFRZZGT8CDR3BE",
263
+ "from": "active",
264
+ "to": "active"
265
+ },
266
+ {
267
+ "effects": [
268
+ [
269
+ "set",
270
+ "@entity.trail",
271
+ [
272
+ "array/filter",
273
+ [
274
+ "if",
275
+ [
276
+ ">",
277
+ "@payload.speed",
278
+ "@config.minSpeed"
279
+ ],
280
+ [
281
+ "array/concat",
282
+ "@entity.trail",
283
+ [
284
+ {
285
+ "bornAt": [
286
+ "time/now"
287
+ ],
288
+ "id": [
289
+ "str/concat",
290
+ "trail-",
291
+ [
292
+ "+",
293
+ "@entity.seq",
294
+ 1.0
295
+ ]
296
+ ],
297
+ "ttl": "@config.ttl",
298
+ "x": "@payload.x",
299
+ "y": "@payload.y"
300
+ }
301
+ ]
302
+ ],
303
+ "@entity.trail"
304
+ ],
305
+ [
306
+ "fn",
307
+ "d",
308
+ [
309
+ "<",
310
+ [
311
+ "-",
312
+ [
313
+ "time/now"
314
+ ],
315
+ [
316
+ "object/get",
317
+ "@d",
318
+ "bornAt"
319
+ ]
320
+ ],
321
+ [
322
+ "object/get",
323
+ "@d",
324
+ "ttl"
325
+ ]
326
+ ]
327
+ ]
328
+ ]
329
+ ],
330
+ [
331
+ "if",
332
+ [
333
+ ">",
334
+ "@payload.speed",
335
+ "@config.minSpeed"
336
+ ],
337
+ [
338
+ "set",
339
+ "@entity.seq",
340
+ [
341
+ "+",
342
+ "@entity.seq",
343
+ 1.0
344
+ ]
345
+ ],
346
+ null
347
+ ]
348
+ ],
349
+ "event": "BODY_MOVED",
350
+ "eventId": "evt_01M0PCAKRAWHX8VG91V45K7YYE",
351
+ "from": "active",
352
+ "guard": "@config.running",
353
+ "to": "active"
354
+ },
355
+ {
356
+ "effects": [
357
+ [
358
+ "set",
359
+ "@entity.trail",
360
+ []
361
+ ]
362
+ ],
363
+ "event": "RESTART",
364
+ "eventId": "evt_01M0PCAKRAK7M2V40695X450BC",
365
+ "from": "active",
366
+ "to": "active"
367
+ }
368
+ ]
369
+ }
370
+ }
371
+ ]
372
+ }
373
+ ],
374
+ "schemaVersion": 1,
375
+ "version": "1.0.0"
376
+ }