@almadar/std 16.145.0 → 16.146.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 (41) hide show
  1. package/behaviors/lolo/ml/atoms/std-ml-similarity.lolo +25 -13
  2. package/behaviors/lolo/ui/core/atoms/std-app-layout.lolo +14 -0
  3. package/behaviors/lolo/ui/core/atoms/std-stats.lolo +1 -1
  4. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +3 -3
  5. package/behaviors/lolo/ui/game/atoms/std-dungeon-combat.lolo +2 -2
  6. package/behaviors/lolo/ui/game/molecules/std-worldmap-board-2d.lolo +1 -1
  7. package/behaviors/lolo/ui/game/organisms/ui-boardgame-board.lolo +2 -2
  8. package/behaviors/lolo/ui/game/organisms/ui-builder-board.lolo +2 -2
  9. package/behaviors/lolo/ui/game/organisms/ui-debugger-board.lolo +3 -3
  10. package/behaviors/lolo/ui/game/organisms/ui-physics-sandbox-board.lolo +3 -3
  11. package/behaviors/lolo/ui/game/organisms/ui-roguelike-board.lolo +1 -1
  12. package/behaviors/lolo/ui/game/organisms/ui-sequencer-board.lolo +1 -1
  13. package/behaviors/lolo/ui/learning/atoms/std-algo-heapsort.lolo +2 -2
  14. package/behaviors/lolo/ui/learning/atoms/std-algo-mst.lolo +3 -3
  15. package/behaviors/registry/ml/atoms/std-ml-similarity.orb +127 -72
  16. package/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
  17. package/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
  18. package/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
  19. package/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
  20. package/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
  21. package/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
  22. package/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
  23. package/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
  24. package/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
  25. package/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
  26. package/dist/behaviors/behaviors-embeddings.json +232 -232
  27. package/dist/behaviors/knob-embeddings.json +1 -1
  28. package/dist/behaviors/registry/ml/atoms/std-ml-similarity.orb +127 -72
  29. package/dist/behaviors/registry/ui/core/atoms/std-app-layout.orb +33 -1
  30. package/dist/behaviors/registry/ui/game/atoms/std-dungeon-combat.orb +4 -4
  31. package/dist/behaviors/registry/ui/game/molecules/std-worldmap-board-2d.orb +6 -9
  32. package/dist/behaviors/registry/ui/game/organisms/ui-boardgame-board.orb +4 -4
  33. package/dist/behaviors/registry/ui/game/organisms/ui-builder-board.orb +4 -4
  34. package/dist/behaviors/registry/ui/game/organisms/ui-debugger-board.orb +12 -12
  35. package/dist/behaviors/registry/ui/game/organisms/ui-physics-sandbox-board.orb +19 -19
  36. package/dist/behaviors/registry/ui/game/organisms/ui-roguelike-board.orb +1 -1
  37. package/dist/behaviors/registry/ui/game/organisms/ui-sequencer-board.orb +2 -2
  38. package/dist/behaviors/registry/ui/learning/atoms/std-algo-heapsort.orb +8 -8
  39. package/dist/behaviors-embeddings.json +232 -232
  40. package/dist/knob-embeddings.json +1 -1
  41. package/package.json +2 -2
@@ -74,21 +74,33 @@ orbital MlSimilarityOrbital {
74
74
  state embedding {
75
75
  EMBEDDED -> resolved
76
76
  (set @entity.embeddings ?result)
77
- (set @entity.queryVector (array/first @entity.embeddings))
78
- (set @entity.candidateVectors (array/drop @entity.embeddings 1))
79
77
  (set @entity.status resolved)
80
- (let ((nearest (array/nearest @entity.queryVector @entity.candidateVectors)))
78
+ ;; An embed result without query + at least one candidate vector is an
79
+ ;; abstain, not a crash — the rung can prove nothing from it.
80
+ (if (< (array/len ?result) 2)
81
81
  (do
82
- (set @entity.matchIndex (object/get @nearest "index"))
83
- (set @entity.matchScore (object/get @nearest "score"))
84
- (set @entity.matchMargin (object/get @nearest "margin"))
85
- (if (and (>= @entity.matchScore @config.floor) (>= @entity.matchMargin @config.margin))
86
- (do
87
- (set @entity.reason "")
88
- (emit SIMILARITY_MATCHED { index: @entity.matchIndex, score: @entity.matchScore }))
89
- (do
90
- (set @entity.reason (if (< @entity.matchScore @config.floor) "below floor" "thin margin"))
91
- (emit SIMILARITY_ABSTAINED { reason: @entity.reason, request: @entity.request })))))
82
+ (set @entity.queryVector [])
83
+ (set @entity.candidateVectors [])
84
+ (set @entity.matchIndex 0)
85
+ (set @entity.matchScore 0)
86
+ (set @entity.matchMargin 0)
87
+ (set @entity.reason "embedding result incomplete")
88
+ (emit SIMILARITY_ABSTAINED { reason: "embedding result incomplete", request: @entity.request }))
89
+ (do
90
+ (set @entity.queryVector (array/first @entity.embeddings))
91
+ (set @entity.candidateVectors (array/drop @entity.embeddings 1))
92
+ (let ((nearest (array/nearest @entity.queryVector @entity.candidateVectors)))
93
+ (do
94
+ (set @entity.matchIndex (object/get @nearest "index"))
95
+ (set @entity.matchScore (object/get @nearest "score"))
96
+ (set @entity.matchMargin (object/get @nearest "margin"))
97
+ (if (and (>= @entity.matchScore @config.floor) (>= @entity.matchMargin @config.margin))
98
+ (do
99
+ (set @entity.reason "")
100
+ (emit SIMILARITY_MATCHED { index: @entity.matchIndex, score: @entity.matchScore }))
101
+ (do
102
+ (set @entity.reason (if (< @entity.matchScore @config.floor) "below floor" "thin margin"))
103
+ (emit SIMILARITY_ABSTAINED { reason: @entity.reason, request: @entity.request })))))))
92
104
 
93
105
  EMBED_FAILED -> resolved
94
106
  (set @entity.embeddings [])
@@ -43,6 +43,7 @@ orbital AppLayoutOrbital {
43
43
  searchEvent: @config.searchEvent
44
44
  topBarActions: @config.topBarActions
45
45
  type: @config.layoutPattern
46
+ user: (if @config.viewerName { avatar: @config.viewerAvatar, email: @config.viewerEmail, name: @config.viewerName } null)
46
47
  }]
47
48
  })
48
49
  AppLayoutStateLoaded -> composing
@@ -94,6 +95,19 @@ orbital AppLayoutOrbital {
94
95
  @description "Name shown in the top-left of the chrome header."
95
96
  @synonyms "app title, product name, brand name, application name, site name"
96
97
  @tier "presentation"
98
+ viewerName : string = ""
99
+ @label "Who is signed in"
100
+ @description "Display name of the signed-in viewer, shown in the app bar's account menu — typically @user.name. Blank renders no account menu, so people can see which account (and which persona) they are viewing the app as only when it is actually known."
101
+ @synonyms "signed in user, current user, account, profile, persona, who am i"
102
+ @tier "presentation"
103
+ viewerEmail : string = ""
104
+ @label "Signed-in email"
105
+ @description "Email shown under the name in the account menu — typically @user.email."
106
+ @tier "presentation"
107
+ viewerAvatar : string = ""
108
+ @label "Signed-in avatar"
109
+ @description "Avatar image URL for the account menu."
110
+ @tier "presentation"
97
111
  navItems : [NavItem] = []
98
112
  @label "Which sections appear in the sidebar?"
99
113
  @description "Top-level navigation links shown on the left rail."
@@ -305,7 +305,7 @@ orbital StatsItemOrbital {
305
305
  }]
306
306
  look: elevated
307
307
  padding: lg
308
- type: card
308
+ type: "card"
309
309
  }]
310
310
  className: "relative w-full rounded-xl shadow-lg overflow-hidden"
311
311
  direction: vertical
@@ -56,7 +56,7 @@ orbital TagTaxonomyOrbital {
56
56
  children: [{
57
57
  align: center
58
58
  children: [{
59
- name: tag
59
+ name: "tag"
60
60
  size: sm
61
61
  type: icon
62
62
  }, {
@@ -168,7 +168,7 @@ orbital TagTaxonomyOrbital {
168
168
  children: [{
169
169
  align: center
170
170
  children: [{
171
- name: tag
171
+ name: "tag"
172
172
  size: sm
173
173
  type: icon
174
174
  }, {
@@ -266,7 +266,7 @@ orbital TagTaxonomyOrbital {
266
266
  children: [{
267
267
  align: center
268
268
  children: [{
269
- name: tag
269
+ name: "tag"
270
270
  size: sm
271
271
  type: icon
272
272
  }, {
@@ -55,11 +55,11 @@ orbital DungeonCombatOrbital {
55
55
  (let ((target (array/find @entity.enemies (fn e (== @e.id @payload.targetId)))))
56
56
  (let ((newHealth (math/max 0 (- (object/get @target health) @config.attackDamage))))
57
57
  (do
58
- (set @entity.enemies (array/map @entity.enemies (fn e (if (== @e.id @payload.targetId) (object/merge @e { health: @newHealth, animation: (if (<= @newHealth 0) "death" "hit") }) e))))
58
+ (set @entity.enemies (array/map @entity.enemies (fn e (if (== @e.id @payload.targetId) (object/merge @e { health: @newHealth, animation: (if (<= @newHealth 0) "death" "hit") }) @e))))
59
59
  (if (<= @newHealth 0)
60
60
  (do
61
61
  (set @entity.combatScore (+ @entity.combatScore @config.pointsPerKill))
62
- (emit BURST { particles: (array/map (array/filter @entity.enemies (fn e (== @e.id @payload.targetId))) (fn t { id: (str/concat "fx-kill-" (object/get t id)), type: "explosion", x: (object/get (object/get t position) x), z: (object/get (object/get t position) y), ttl: 5 })) }))
62
+ (emit BURST { particles: (array/map (array/filter @entity.enemies (fn e (== @e.id @payload.targetId))) (fn t { id: (str/concat "fx-kill-" (object/get @t id)), type: "explosion", x: (object/get (object/get @t position) x), z: (object/get (object/get @t position) y), ttl: 5 })) }))
63
63
  true))))
64
64
 
65
65
  MONSTER_TICK -> active when @config.running
@@ -168,7 +168,7 @@ orbital WorldMapBoard2DOrbital {
168
168
 
169
169
  HERO_MOVE -> playing when (and (== @entity.result "none") (and (!= @entity.selectedHeroId "") (and (grid/in-bounds { x: ?x, y: ?y } @config.gridWidth @config.gridHeight) (and (<= (grid/manhattan-distance (object/get (array/find @entity.units (fn u (== @u.id @entity.selectedHeroId))) position) { x: ?x, y: ?y }) @config.movementRange) (and (== (object/get (array/find @entity.tiles (fn t (and (== (object/get @t x) ?x) (== (object/get @t y) ?y)))) passable) true) (== (array/len (array/filter @entity.units (fn u (and (== (object/get (object/get @u position) x) ?x) (== (object/get (object/get @u position) y) ?y))))) 0))))))
170
170
  (emit MOVE { unitId: @entity.selectedHeroId, x: ?x, y: ?y })
171
- (if (== (object/get (array/find @config.features (fn f (and (== (object/get f x) ?x) (and (== (object/get f y) ?y) (== (object/get f type) "gold_mine"))))) type) "gold_mine") (emit MINE_HIT { id: "" }) null)
171
+ (if (== (object/get (array/find @config.features (fn f (and (== (object/get @f x) ?x) (and (== (object/get @f y) ?y) (== (object/get @f type) "gold_mine"))))) type) "gold_mine") (emit MINE_HIT { id: "" }) null)
172
172
  (set @entity.selectedHeroId "")
173
173
  (set @entity.validMoves [])
174
174
 
@@ -119,7 +119,7 @@ orbital BoardgameBoardOrbital {
119
119
  (set @entity.landingIndex (math/min @entity.lastIndex (+ @entity.playerIndex @entity.dice)))
120
120
  (set @entity.landingType (object/get (array/nth @config.track @entity.landingIndex) type))
121
121
  (set @entity.playerIndex (if (== @entity.landingType "bonus") (math/min @entity.lastIndex (+ @entity.landingIndex 2)) (if (== @entity.landingType "trap") (math/max 0 (- @entity.landingIndex 2)) @entity.landingIndex)))
122
- (set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "you") (object/merge p { position: { x: (object/get (array/nth @config.track @entity.playerIndex) x), y: (object/get (array/nth @config.track @entity.playerIndex) y) }, trackIndex: @entity.playerIndex }) p))))
122
+ (set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "you") (object/merge @p { position: { x: (object/get (array/nth @config.track @entity.playerIndex) x), y: (object/get (array/nth @config.track @entity.playerIndex) y) }, trackIndex: @entity.playerIndex }) @p))))
123
123
  (if (or (== @entity.landingType "bonus") (== @entity.landingType "trap")) (set @entity.effects (array/append @entity.effects { key: @entity.landingType, x: (object/get (array/nth @config.track @entity.landingIndex) x), y: (object/get (array/nth @config.track @entity.landingIndex) y), ttl: 6 })) true)
124
124
  (set @entity.result (if (== @entity.playerIndex @entity.lastIndex) "victory" "none"))
125
125
  (if (== @entity.result "victory") (emit GAME_END) true)
@@ -218,7 +218,7 @@ orbital BoardgameBoardOrbital {
218
218
  (set @entity.landingIndex (math/min @entity.lastIndex (+ @entity.rivalIndex @entity.dice)))
219
219
  (set @entity.landingType (object/get (array/nth @config.track @entity.landingIndex) type))
220
220
  (set @entity.rivalIndex (if (== @entity.landingType "bonus") (math/min @entity.lastIndex (+ @entity.landingIndex 2)) (if (== @entity.landingType "trap") (math/max 0 (- @entity.landingIndex 2)) @entity.landingIndex)))
221
- (set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "rival") (object/merge p { position: { x: (object/get (array/nth @config.track @entity.rivalIndex) x), y: (object/get (array/nth @config.track @entity.rivalIndex) y) }, trackIndex: @entity.rivalIndex }) p))))
221
+ (set @entity.pieces (array/map @entity.pieces (fn p (if (== @p.id "rival") (object/merge @p { position: { x: (object/get (array/nth @config.track @entity.rivalIndex) x), y: (object/get (array/nth @config.track @entity.rivalIndex) y) }, trackIndex: @entity.rivalIndex }) @p))))
222
222
  (if (or (== @entity.landingType "bonus") (== @entity.landingType "trap")) (set @entity.effects (array/append @entity.effects { key: @entity.landingType, x: (object/get (array/nth @config.track @entity.landingIndex) x), y: (object/get (array/nth @config.track @entity.landingIndex) y), ttl: 6 })) true)
223
223
  (set @entity.result (if (== @entity.rivalIndex @entity.lastIndex) "defeat" "none"))
224
224
  (if (== @entity.result "defeat") (emit GAME_END) true)
@@ -100,7 +100,7 @@ orbital BuilderBoardOrbital {
100
100
  ]
101
101
  })
102
102
 
103
- CHECK -> complete when (== (array/len (array/filter @entity.slots (fn s (!= (object/get s placedComponentId) (object/get s requiredComponentId))))) 0)
103
+ CHECK -> complete when (== (array/len (array/filter @entity.slots (fn s (!= (object/get @s placedComponentId) (object/get @s requiredComponentId))))) 0)
104
104
  (set @entity.attempts (+ @entity.attempts 1))
105
105
  (set @entity.result "win")
106
106
  (render-ui main {
@@ -112,7 +112,7 @@ orbital BuilderBoardOrbital {
112
112
  ]
113
113
  })
114
114
 
115
- CHECK -> playing when (> (array/len (array/filter @entity.slots (fn s (!= (object/get s placedComponentId) (object/get s requiredComponentId))))) 0)
115
+ CHECK -> playing when (> (array/len (array/filter @entity.slots (fn s (!= (object/get @s placedComponentId) (object/get @s requiredComponentId))))) 0)
116
116
  (set @entity.attempts (+ @entity.attempts 1))
117
117
  (render-ui main {
118
118
  type: game-shell
@@ -74,7 +74,7 @@ orbital DebuggerBoardOrbital {
74
74
  ]
75
75
  })
76
76
  TOGGLE_FLAG -> playing
77
- (set @entity.lines (array/map @entity.lines (fn l (if (== (object/get l id) ?lineId) (object/merge l { isFlagged: (not (object/get l isFlagged)) }) l))))
77
+ (set @entity.lines (array/map @entity.lines (fn l (if (== (object/get @l id) ?lineId) (object/merge @l { isFlagged: (not (object/get @l isFlagged)) }) @l))))
78
78
  (render-ui main {
79
79
  type: game-shell
80
80
  hud: { type: stack, direction: horizontal, gap: md, justify: between, children: [ { type: game-hud, stats: [ { label: "Attempts", value: @entity.attempts }, { label: "Status", value: @entity.result } ] }, { type: stack, direction: horizontal, gap: sm, children: [ { type: button, action: CHECK, label: "Check", variant: primary }, { type: button, action: PLAY_AGAIN, label: "Reset", variant: secondary } ] } ] }
@@ -84,7 +84,7 @@ orbital DebuggerBoardOrbital {
84
84
  ]
85
85
  })
86
86
 
87
- CHECK -> complete when (and (== (array/len (array/filter @entity.lines (fn l (and (object/get l isBug) (not (object/get l isFlagged)))))) 0) (== (array/len (array/filter @entity.lines (fn l (and (not (object/get l isBug)) (object/get l isFlagged))))) 0))
87
+ CHECK -> complete when (and (== (array/len (array/filter @entity.lines (fn l (and (object/get @l isBug) (not (object/get @l isFlagged)))))) 0) (== (array/len (array/filter @entity.lines (fn l (and (not (object/get @l isBug)) (object/get @l isFlagged))))) 0))
88
88
  (set @entity.attempts (+ @entity.attempts 1))
89
89
  (set @entity.result "win")
90
90
  (render-ui main {
@@ -96,7 +96,7 @@ orbital DebuggerBoardOrbital {
96
96
  ]
97
97
  })
98
98
 
99
- CHECK -> playing when (or (> (array/len (array/filter @entity.lines (fn l (and (object/get l isBug) (not (object/get l isFlagged)))))) 0) (> (array/len (array/filter @entity.lines (fn l (and (not (object/get l isBug)) (object/get l isFlagged))))) 0))
99
+ CHECK -> playing when (or (> (array/len (array/filter @entity.lines (fn l (and (object/get @l isBug) (not (object/get @l isFlagged)))))) 0) (> (array/len (array/filter @entity.lines (fn l (and (not (object/get @l isBug)) (object/get @l isFlagged))))) 0))
100
100
  (set @entity.attempts (+ @entity.attempts 1))
101
101
  (render-ui main {
102
102
  type: game-shell
@@ -141,10 +141,10 @@ orbital PhysicsSandboxBoardOrbital {
141
141
 
142
142
  ticks {
143
143
  gravityTick every 300ms
144
- (set @entity.blocks (array/map @entity.blocks (fn b (if (== (object/get b settled) true) b (if (or (== (+ (object/get b y) 1) @entity.gridHeight) (array/some @entity.blocks (fn o (and (== (object/get o settled) true) (and (== (object/get o x) (object/get b x)) (== (object/get o y) (+ (object/get b y) 1))))))) (object/merge b { settled: true }) (object/merge b { y: (+ (object/get b y) 1) }))))))
145
- (let ((clearRow (array/find (array/range 0 @entity.gridHeight) (fn r (== (array/len (array/filter @entity.blocks (fn b (and (== (object/get b settled) true) (== (object/get b y) r))))) @entity.gridWidth)))))
144
+ (set @entity.blocks (array/map @entity.blocks (fn b (if (== (object/get @b settled) true) @b (if (or (== (+ (object/get @b y) 1) @entity.gridHeight) (array/some @entity.blocks (fn o (and (== (object/get @o settled) true) (and (== (object/get @o x) (object/get @b x)) (== (object/get @o y) (+ (object/get @b y) 1))))))) (object/merge @b { settled: true }) (object/merge @b { y: (+ (object/get @b y) 1) }))))))
145
+ (let ((clearRow (array/find (array/range 0 @entity.gridHeight) (fn r (== (array/len (array/filter @entity.blocks (fn b (and (== (object/get @b settled) true) (== (object/get @b y) @r))))) @entity.gridWidth)))))
146
146
  (do
147
- (set @entity.blocks (if (!= @clearRow null) (array/map (array/filter @entity.blocks (fn b (!= (object/get b y) @clearRow))) (fn b (if (< (object/get b y) @clearRow) (object/merge b { y: (+ (object/get b y) 1) }) b))) @entity.blocks))
147
+ (set @entity.blocks (if (!= @clearRow null) (array/map (array/filter @entity.blocks (fn b (!= (object/get @b y) @clearRow))) (fn b (if (< (object/get @b y) @clearRow) (object/merge @b { y: (+ (object/get @b y) 1) }) @b))) @entity.blocks))
148
148
  (set @entity.score (if (!= @clearRow null) (+ @entity.score (* 10 @entity.gridWidth)) @entity.score))
149
149
  (set @entity.rowsCleared (if (!= @clearRow null) (+ @entity.rowsCleared 1) @entity.rowsCleared))))
150
150
  (render-ui main {
@@ -466,7 +466,7 @@ orbital RoguelikeBoardOrbital {
466
466
  enemyAiTick every 1s
467
467
  when (and (== @entity.phase "enemy_turn") (== @entity.result "none"))
468
468
  (set @entity.enemies (array/map @entity.enemies (fn e (if (> @e.hp 0) (let ((ex @e.x) (ey @e.y) (px (object/get @entity.player x)) (py (object/get @entity.player y))) (let ((adjP (and (== (math/abs (- @ex @px)) 1) (== @ey @py))) (adjQ (and (== @ex @px) (== (math/abs (- @ey @py)) 1)))) (if (or @adjP @adjQ) @e (let ((cnx (math/clamp (+ @ex (math/sign (- @px @ex))) 0 (- @entity.gridWidth 1))) (cny (math/clamp (+ @ey (math/sign (- @py @ey))) 0 (- @entity.gridHeight 1)))) (let ((ntile (array/find @entity.tiles (fn t (and (== (object/get @t x) @cnx) (== (object/get @t y) @cny))))) (occupied (array/find @entity.enemies (fn o (and (!= @o.id @e.id) (and (== @o.x @cnx) (== @o.y @cny))))))) (if (and (and (!= @ntile null) (== (object/get @ntile passable) true)) (and (== @occupied null) (or (!= @cnx @px) (!= @cny @py)))) (object/merge @e { x: @cnx, y: @cny }) @e)))))) @e))))
469
- (set @entity.playerHp (let ((adjEnemies (array/filter @entity.enemies (fn e (and (> @e.hp 0) (or (and (== (math/abs (- @e.x (object/get @entity.player x))) 1) (== @e.y (object/get @entity.player y))) (and (== @e.x (object/get @entity.player x)) (== (math/abs (- @e.y (object/get @entity.player y))) 1)))))))) (let ((dmg (if (== (array/len @adjEnemies) 0) 0 (array/reduce @adjEnemies (fn acc e (+ acc @e.attack)) 0)))) (math/max 0 (- @entity.playerHp @dmg)))))
469
+ (set @entity.playerHp (let ((adjEnemies (array/filter @entity.enemies (fn e (and (> @e.hp 0) (or (and (== (math/abs (- @e.x (object/get @entity.player x))) 1) (== @e.y (object/get @entity.player y))) (and (== @e.x (object/get @entity.player x)) (== (math/abs (- @e.y (object/get @entity.player y))) 1)))))))) (let ((dmg (if (== (array/len @adjEnemies) 0) 0 (array/reduce @adjEnemies (fn acc e (+ @acc @e.attack)) 0)))) (math/max 0 (- @entity.playerHp @dmg)))))
470
470
  (set @entity.effects (if (> (array/len (array/filter @entity.enemies (fn e (and (> @e.hp 0) (or (and (== (math/abs (- @e.x (object/get @entity.player x))) 1) (== @e.y (object/get @entity.player y))) (and (== @e.x (object/get @entity.player x)) (== (math/abs (- @e.y (object/get @entity.player y))) 1))))))) 0) (array/append @entity.effects { key: "slash", x: (object/get @entity.player x), y: (object/get @entity.player y), ttl: 4 }) @entity.effects))
471
471
  (if (<= @entity.playerHp 0) (do (set @entity.result "lost") (emit GAME_END)) true)
472
472
  (set @entity.phase (if (== @entity.result "none") "player_turn" "game_over"))
@@ -119,7 +119,7 @@ orbital SequencerBoardOrbital {
119
119
  ]
120
120
  })
121
121
 
122
- CHECK -> complete when (array/some @entity.solutions (fn sol (== (array/map @entity.slots (fn s (object/get s placedActionId))) sol)))
122
+ CHECK -> complete when (array/some @entity.solutions (fn sol (== (array/map @entity.slots (fn s (object/get @s placedActionId))) @sol)))
123
123
  (set @entity.attempts (+ @entity.attempts 1))
124
124
  (set @entity.result "win")
125
125
  (set @entity.currentStep -1)
@@ -58,9 +58,9 @@ orbital HeapSortEngineOrbital {
58
58
  (rc (+ (* 2 @entity.root) 2))
59
59
  )
60
60
  (let (
61
- (afterL (if (and (< lc @entity.heapSize) (> (object/get (array/nth @entity.bars lc) value) (object/get (array/nth @entity.bars @entity.root) value))) lc @entity.root))
61
+ (afterL (if (and (< @lc @entity.heapSize) (> (object/get (array/nth @entity.bars @lc) value) (object/get (array/nth @entity.bars @entity.root) value))) @lc @entity.root))
62
62
  )
63
- (if (and (< rc @entity.heapSize) (> (object/get (array/nth @entity.bars rc) value) (object/get (array/nth @entity.bars afterL) value))) rc afterL))))
63
+ (if (and (< @rc @entity.heapSize) (> (object/get (array/nth @entity.bars @rc) value) (object/get (array/nth @entity.bars @afterL) value))) @rc @afterL))))
64
64
  (set @entity.willSwap (not (== @entity.largest @entity.root)))
65
65
  (set @entity.buildMore (and (not @entity.willSwap) (== @entity.phase 0) (>= @entity.origin 1)))
66
66
  (set @entity.buildDone (and (not @entity.willSwap) (== @entity.phase 0) (== @entity.origin 0)))
@@ -76,7 +76,7 @@ orbital MstEngineOrbital {
76
76
  (let ( (inF (array/includes @entity.inTree (object/get @w from)))
77
77
  (inT (array/includes @entity.inTree (object/get @w to))) )
78
78
  (or (and @inF (not @inT)) (and (not @inF) @inT)))))
79
- (fn w (object/get @w w)))))
79
+ (fn w (object/get @w "w")))))
80
80
  (set @entity.chosenFrom
81
81
  (object/get
82
82
  (array/first
@@ -84,7 +84,7 @@ orbital MstEngineOrbital {
84
84
  (let ( (inF (array/includes @entity.inTree (object/get @w from)))
85
85
  (inT (array/includes @entity.inTree (object/get @w to))) )
86
86
  (and (or (and @inF (not @inT)) (and (not @inF) @inT))
87
- (== (object/get @w w) @entity.minW))))))
87
+ (== (object/get @w "w") @entity.minW))))))
88
88
  from))
89
89
  (set @entity.chosenTo
90
90
  (object/get
@@ -93,7 +93,7 @@ orbital MstEngineOrbital {
93
93
  (let ( (inF (array/includes @entity.inTree (object/get @w from)))
94
94
  (inT (array/includes @entity.inTree (object/get @w to))) )
95
95
  (and (or (and @inF (not @inT)) (and (not @inF) @inT))
96
- (== (object/get @w w) @entity.minW))))))
96
+ (== (object/get @w "w") @entity.minW))))))
97
97
  to))
98
98
  (set @entity.treeEdges (array/append @entity.treeEdges { from: @entity.chosenFrom, to: @entity.chosenTo }))
99
99
  (set @entity.inTree
@@ -591,123 +591,178 @@
591
591
  "@entity.embeddings",
592
592
  "@payload.result"
593
593
  ],
594
- [
595
- "set",
596
- "@entity.queryVector",
597
- [
598
- "array/first",
599
- "@entity.embeddings"
600
- ]
601
- ],
602
- [
603
- "set",
604
- "@entity.candidateVectors",
605
- [
606
- "array/drop",
607
- "@entity.embeddings",
608
- 1.0
609
- ]
610
- ],
611
594
  [
612
595
  "set",
613
596
  "@entity.status",
614
597
  "resolved"
615
598
  ],
616
599
  [
617
- "let",
600
+ "if",
618
601
  [
602
+ "<",
619
603
  [
620
- "nearest",
621
- [
622
- "array/nearest",
623
- "@entity.queryVector",
624
- "@entity.candidateVectors"
625
- ]
626
- ]
604
+ "array/len",
605
+ "@payload.result"
606
+ ],
607
+ 2.0
627
608
  ],
628
609
  [
629
610
  "do",
611
+ [
612
+ "set",
613
+ "@entity.queryVector",
614
+ []
615
+ ],
616
+ [
617
+ "set",
618
+ "@entity.candidateVectors",
619
+ []
620
+ ],
630
621
  [
631
622
  "set",
632
623
  "@entity.matchIndex",
633
- [
634
- "object/get",
635
- "@nearest",
636
- "index"
637
- ]
624
+ 0.0
638
625
  ],
639
626
  [
640
627
  "set",
641
628
  "@entity.matchScore",
629
+ 0.0
630
+ ],
631
+ [
632
+ "set",
633
+ "@entity.matchMargin",
634
+ 0.0
635
+ ],
636
+ [
637
+ "set",
638
+ "@entity.reason",
639
+ "embedding result incomplete"
640
+ ],
641
+ [
642
+ "emit",
643
+ "SIMILARITY_ABSTAINED",
644
+ {
645
+ "reason": "embedding result incomplete",
646
+ "request": "@entity.request"
647
+ }
648
+ ]
649
+ ],
650
+ [
651
+ "do",
652
+ [
653
+ "set",
654
+ "@entity.queryVector",
642
655
  [
643
- "object/get",
644
- "@nearest",
645
- "score"
656
+ "array/first",
657
+ "@entity.embeddings"
646
658
  ]
647
659
  ],
648
660
  [
649
661
  "set",
650
- "@entity.matchMargin",
662
+ "@entity.candidateVectors",
651
663
  [
652
- "object/get",
653
- "@nearest",
654
- "margin"
664
+ "array/drop",
665
+ "@entity.embeddings",
666
+ 1.0
655
667
  ]
656
668
  ],
657
669
  [
658
- "if",
670
+ "let",
659
671
  [
660
- "and",
661
672
  [
662
- ">=",
663
- "@entity.matchScore",
664
- "@config.floor"
665
- ],
666
- [
667
- ">=",
668
- "@entity.matchMargin",
669
- "@config.margin"
673
+ "nearest",
674
+ [
675
+ "array/nearest",
676
+ "@entity.queryVector",
677
+ "@entity.candidateVectors"
678
+ ]
670
679
  ]
671
680
  ],
672
681
  [
673
682
  "do",
674
683
  [
675
684
  "set",
676
- "@entity.reason",
677
- ""
685
+ "@entity.matchIndex",
686
+ [
687
+ "object/get",
688
+ "@nearest",
689
+ "index"
690
+ ]
678
691
  ],
679
692
  [
680
- "emit",
681
- "SIMILARITY_MATCHED",
682
- {
683
- "index": "@entity.matchIndex",
684
- "score": "@entity.matchScore"
685
- }
686
- ]
687
- ],
688
- [
689
- "do",
693
+ "set",
694
+ "@entity.matchScore",
695
+ [
696
+ "object/get",
697
+ "@nearest",
698
+ "score"
699
+ ]
700
+ ],
690
701
  [
691
702
  "set",
692
- "@entity.reason",
703
+ "@entity.matchMargin",
693
704
  [
694
- "if",
705
+ "object/get",
706
+ "@nearest",
707
+ "margin"
708
+ ]
709
+ ],
710
+ [
711
+ "if",
712
+ [
713
+ "and",
695
714
  [
696
- "<",
715
+ ">=",
697
716
  "@entity.matchScore",
698
717
  "@config.floor"
699
718
  ],
700
- "below floor",
701
- "thin margin"
719
+ [
720
+ ">=",
721
+ "@entity.matchMargin",
722
+ "@config.margin"
723
+ ]
724
+ ],
725
+ [
726
+ "do",
727
+ [
728
+ "set",
729
+ "@entity.reason",
730
+ ""
731
+ ],
732
+ [
733
+ "emit",
734
+ "SIMILARITY_MATCHED",
735
+ {
736
+ "index": "@entity.matchIndex",
737
+ "score": "@entity.matchScore"
738
+ }
739
+ ]
740
+ ],
741
+ [
742
+ "do",
743
+ [
744
+ "set",
745
+ "@entity.reason",
746
+ [
747
+ "if",
748
+ [
749
+ "<",
750
+ "@entity.matchScore",
751
+ "@config.floor"
752
+ ],
753
+ "below floor",
754
+ "thin margin"
755
+ ]
756
+ ],
757
+ [
758
+ "emit",
759
+ "SIMILARITY_ABSTAINED",
760
+ {
761
+ "reason": "@entity.reason",
762
+ "request": "@entity.request"
763
+ }
764
+ ]
702
765
  ]
703
- ],
704
- [
705
- "emit",
706
- "SIMILARITY_ABSTAINED",
707
- {
708
- "reason": "@entity.reason",
709
- "request": "@entity.request"
710
- }
711
766
  ]
712
767
  ]
713
768
  ]
@@ -300,6 +300,28 @@
300
300
  "synonyms": "toolbar buttons, header actions, shortcut icons, quick actions",
301
301
  "tier": "presentation",
302
302
  "type": "[ItemAction]"
303
+ },
304
+ "viewerAvatar": {
305
+ "default": "",
306
+ "description": "Avatar image URL for the account menu.",
307
+ "label": "Signed-in avatar",
308
+ "tier": "presentation",
309
+ "type": "string"
310
+ },
311
+ "viewerEmail": {
312
+ "default": "",
313
+ "description": "Email shown under the name in the account menu — typically @user.email.",
314
+ "label": "Signed-in email",
315
+ "tier": "presentation",
316
+ "type": "string"
317
+ },
318
+ "viewerName": {
319
+ "default": "",
320
+ "description": "Display name of the signed-in viewer, shown in the app bar's account menu — typically @user.name. Blank renders no account menu, so people can see which account (and which persona) they are viewing the app as only when it is actually known.",
321
+ "label": "Who is signed in",
322
+ "synonyms": "signed in user, current user, account, profile, persona, who am i",
323
+ "tier": "presentation",
324
+ "type": "string"
303
325
  }
304
326
  },
305
327
  "emits": [
@@ -489,7 +511,17 @@
489
511
  "notifications": "@config.notifications",
490
512
  "searchEvent": "@config.searchEvent",
491
513
  "topBarActions": "@config.topBarActions",
492
- "type": "@config.layoutPattern"
514
+ "type": "@config.layoutPattern",
515
+ "user": [
516
+ "if",
517
+ "@config.viewerName",
518
+ {
519
+ "avatar": "@config.viewerAvatar",
520
+ "email": "@config.viewerEmail",
521
+ "name": "@config.viewerName"
522
+ },
523
+ null
524
+ ]
493
525
  }
494
526
  ],
495
527
  "className": "min-h-screen w-full",
@@ -621,7 +621,7 @@
621
621
  "health": "@newHealth"
622
622
  }
623
623
  ],
624
- "e"
624
+ "@e"
625
625
  ]
626
626
  ]
627
627
  ]
@@ -672,7 +672,7 @@
672
672
  "fx-kill-",
673
673
  [
674
674
  "object/get",
675
- "t",
675
+ "@t",
676
676
  "id"
677
677
  ]
678
678
  ],
@@ -682,7 +682,7 @@
682
682
  "object/get",
683
683
  [
684
684
  "object/get",
685
- "t",
685
+ "@t",
686
686
  "position"
687
687
  ],
688
688
  "x"
@@ -691,7 +691,7 @@
691
691
  "object/get",
692
692
  [
693
693
  "object/get",
694
- "t",
694
+ "@t",
695
695
  "position"
696
696
  ],
697
697
  "y"