@almadar/std 16.234.0 → 16.236.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 (245) hide show
  1. package/behaviors/behaviors-registry.json +4402 -1898
  2. package/behaviors/lolo/infra/atoms/std-approval-gate.lolo +25 -41
  3. package/behaviors/lolo/infra/atoms/std-audit-capture.lolo +0 -5
  4. package/behaviors/lolo/infra/atoms/std-cache-aside.lolo +0 -24
  5. package/behaviors/lolo/infra/atoms/std-circuit-breaker.lolo +1 -17
  6. package/behaviors/lolo/infra/atoms/std-data-erasure.lolo +17 -24
  7. package/behaviors/lolo/infra/atoms/std-data-import.lolo +8 -11
  8. package/behaviors/lolo/infra/atoms/std-game-clock.lolo +2 -0
  9. package/behaviors/lolo/infra/atoms/std-knowledge-loop.lolo +0 -5
  10. package/behaviors/lolo/infra/atoms/std-lifecycle.lolo +3 -1
  11. package/behaviors/lolo/infra/atoms/std-mod-queue.lolo +40 -18
  12. package/behaviors/lolo/infra/atoms/std-notification-preferences.lolo +20 -11
  13. package/behaviors/lolo/infra/atoms/std-notify-on-event.lolo +0 -5
  14. package/behaviors/lolo/infra/atoms/std-permission-matrix.lolo +23 -11
  15. package/behaviors/lolo/infra/atoms/std-rate-limiter.lolo +84 -22
  16. package/behaviors/lolo/infra/atoms/std-status-lifecycle.lolo +1 -6
  17. package/behaviors/lolo/ml/atoms/std-graph-builder.lolo +3 -1
  18. package/behaviors/lolo/ml/atoms/std-ml-classify.lolo +0 -4
  19. package/behaviors/lolo/ml/atoms/std-ml-similarity.lolo +0 -4
  20. package/behaviors/lolo/ui/avl/atoms/ui-avl-state-machine.lolo +12 -0
  21. package/behaviors/lolo/ui/core/atoms/std-app-layout.lolo +55 -9
  22. package/behaviors/lolo/ui/core/atoms/std-app-search.lolo +6 -2
  23. package/behaviors/lolo/ui/core/atoms/std-billable-hour.lolo +19 -14
  24. package/behaviors/lolo/ui/core/atoms/std-board.lolo +77 -27
  25. package/behaviors/lolo/ui/core/atoms/std-browse.lolo +44 -28
  26. package/behaviors/lolo/ui/core/atoms/std-calendar.lolo +7 -3
  27. package/behaviors/lolo/ui/core/atoms/std-esign-flow.lolo +25 -13
  28. package/behaviors/lolo/ui/core/atoms/std-esign-request.lolo +5 -0
  29. package/behaviors/lolo/ui/core/atoms/std-event-log.lolo +0 -5
  30. package/behaviors/lolo/ui/core/atoms/std-export.lolo +0 -10
  31. package/behaviors/lolo/ui/core/atoms/std-file-store.lolo +7 -3
  32. package/behaviors/lolo/ui/core/atoms/std-form-advanced.lolo +1 -6
  33. package/behaviors/lolo/ui/core/atoms/std-geosearch.lolo +1 -0
  34. package/behaviors/lolo/ui/core/atoms/std-graphs.lolo +20 -4
  35. package/behaviors/lolo/ui/core/atoms/std-import.lolo +0 -5
  36. package/behaviors/lolo/ui/core/atoms/std-list.lolo +46 -32
  37. package/behaviors/lolo/ui/core/atoms/std-modal-editor.lolo +2 -2
  38. package/behaviors/lolo/ui/core/atoms/std-rating-review.lolo +12 -13
  39. package/behaviors/lolo/ui/core/atoms/std-record-detail.lolo +16 -12
  40. package/behaviors/lolo/ui/core/atoms/std-recurrence.lolo +10 -1
  41. package/behaviors/lolo/ui/core/atoms/std-role-gate.lolo +39 -0
  42. package/behaviors/lolo/ui/core/atoms/std-saved-search.lolo +78 -16
  43. package/behaviors/lolo/ui/core/atoms/std-selection.lolo +15 -10
  44. package/behaviors/lolo/ui/core/atoms/std-stats.lolo +5 -5
  45. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +3 -0
  46. package/behaviors/lolo/ui/core/atoms/std-thread.lolo +41 -73
  47. package/behaviors/lolo/ui/core/atoms/std-version-history.lolo +20 -11
  48. package/behaviors/lolo/ui/core/atoms/std-vote.lolo +0 -4
  49. package/behaviors/lolo/ui/core/atoms/std-wizard.lolo +3 -3
  50. package/behaviors/lolo/ui/core/atoms/ui-presence.lolo +21 -0
  51. package/behaviors/lolo/ui/core/molecules/ui-breadcrumb.lolo +6 -1
  52. package/behaviors/lolo/ui/core/molecules/ui-chart.lolo +11 -1
  53. package/behaviors/lolo/ui/core/molecules/ui-code-block.lolo +13 -8
  54. package/behaviors/lolo/ui/core/molecules/ui-command-palette.lolo +7 -2
  55. package/behaviors/lolo/ui/core/molecules/ui-commit-row.lolo +2 -2
  56. package/behaviors/lolo/ui/core/molecules/ui-confirm-dialog.lolo +8 -0
  57. package/behaviors/lolo/ui/core/molecules/ui-data-grid.lolo +41 -3
  58. package/behaviors/lolo/ui/core/molecules/ui-data-list.lolo +41 -3
  59. package/behaviors/lolo/ui/core/molecules/ui-document-details.lolo +30 -9
  60. package/behaviors/lolo/ui/core/molecules/ui-document-panel.lolo +8 -3
  61. package/behaviors/lolo/ui/core/molecules/ui-document-viewer.lolo +6 -1
  62. package/behaviors/lolo/ui/core/molecules/ui-drawer.lolo +13 -0
  63. package/behaviors/lolo/ui/core/molecules/ui-floating-action-button.lolo +6 -1
  64. package/behaviors/lolo/ui/core/molecules/ui-floating-toolbar.lolo +6 -1
  65. package/behaviors/lolo/ui/core/molecules/ui-form-actions.lolo +6 -1
  66. package/behaviors/lolo/ui/core/molecules/ui-graph-canvas.lolo +6 -1
  67. package/behaviors/lolo/ui/core/molecules/ui-menu.lolo +6 -1
  68. package/behaviors/lolo/ui/core/molecules/ui-meter.lolo +6 -1
  69. package/behaviors/lolo/ui/core/molecules/ui-modal.lolo +5 -0
  70. package/behaviors/lolo/ui/core/molecules/ui-page-header.lolo +11 -1
  71. package/behaviors/lolo/ui/core/molecules/ui-page-transition.lolo +1 -1
  72. package/behaviors/lolo/ui/core/molecules/ui-swipeable-row.lolo +44 -15
  73. package/behaviors/lolo/ui/core/molecules/ui-table-view.lolo +41 -3
  74. package/behaviors/lolo/ui/core/molecules/ui-tabs.lolo +8 -2
  75. package/behaviors/lolo/ui/core/organisms/ui-detail-panel.lolo +66 -12
  76. package/behaviors/lolo/ui/core/organisms/ui-entity-cards.lolo +9 -3
  77. package/behaviors/lolo/ui/core/organisms/ui-entity-list.lolo +9 -3
  78. package/behaviors/lolo/ui/core/organisms/ui-entity-table.lolo +18 -9
  79. package/behaviors/lolo/ui/core/organisms/ui-form-section.lolo +55 -10
  80. package/behaviors/lolo/ui/core/organisms/ui-form.lolo +55 -10
  81. package/behaviors/lolo/ui/core/organisms/ui-media-gallery.lolo +8 -3
  82. package/behaviors/lolo/ui/core/organisms/ui-state-machine-view.lolo +12 -0
  83. package/behaviors/lolo/ui/core/organisms/ui-timeline.lolo +8 -3
  84. package/behaviors/lolo/ui/core/templates/ui-counter-template.lolo +2 -44
  85. package/behaviors/lolo/ui/core/templates/ui-dashboard-layout.lolo +6 -1
  86. package/behaviors/lolo/ui/core/templates/ui-generic-app-template.lolo +2 -37
  87. package/behaviors/lolo/ui/game/atoms/ui-game-menu.lolo +8 -2
  88. package/behaviors/lolo/ui/game/organisms/std-arcade-board-3d.lolo +2 -2
  89. package/behaviors/lolo/ui/game/organisms/std-crew-board-2d.lolo +0 -4
  90. package/behaviors/lolo/ui/game/organisms/std-platformer-puzzle.lolo +2 -66
  91. package/behaviors/lolo/ui/game/organisms/std-tactics-board-2d.lolo +0 -4
  92. package/behaviors/lolo/ui/game/organisms/std-worldmap-board-2d.lolo +0 -4
  93. package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +6 -6
  94. package/behaviors/lolo-behavior-contracts.json +1 -1
  95. package/behaviors/registry/factory-signatures.json +1 -1
  96. package/behaviors/registry/infra/atoms/std-approval-gate.orb +124 -67
  97. package/behaviors/registry/infra/atoms/std-audit-capture.orb +0 -8
  98. package/behaviors/registry/infra/atoms/std-cache-aside.orb +0 -84
  99. package/behaviors/registry/infra/atoms/std-circuit-breaker.orb +1 -44
  100. package/behaviors/registry/infra/atoms/std-data-erasure.orb +124 -55
  101. package/behaviors/registry/infra/atoms/std-data-import.orb +12 -11
  102. package/behaviors/registry/infra/atoms/std-game-clock.orb +31 -0
  103. package/behaviors/registry/infra/atoms/std-knowledge-loop.orb +0 -57
  104. package/behaviors/registry/infra/atoms/std-lifecycle.orb +43 -0
  105. package/behaviors/registry/infra/atoms/std-mod-queue.orb +379 -103
  106. package/behaviors/registry/infra/atoms/std-notification-preferences.orb +126 -12
  107. package/behaviors/registry/infra/atoms/std-notify-on-event.orb +0 -11
  108. package/behaviors/registry/infra/atoms/std-permission-matrix.orb +128 -12
  109. package/behaviors/registry/infra/atoms/std-rate-limiter.orb +287 -72
  110. package/behaviors/registry/infra/atoms/std-status-lifecycle.orb +5 -8
  111. package/behaviors/registry/ml/atoms/std-graph-builder.orb +11 -0
  112. package/behaviors/registry/ml/atoms/std-ml-classify.orb +0 -7
  113. package/behaviors/registry/ml/atoms/std-ml-similarity.orb +0 -7
  114. package/behaviors/registry/ui/avl/atoms/ui-avl-state-machine.orb +82 -0
  115. package/behaviors/registry/ui/core/atoms/std-app-layout.orb +417 -9
  116. package/behaviors/registry/ui/core/atoms/std-app-search.orb +53 -1
  117. package/behaviors/registry/ui/core/atoms/std-billable-hour.orb +209 -19
  118. package/behaviors/registry/ui/core/atoms/std-board.orb +242 -61
  119. package/behaviors/registry/ui/core/atoms/std-browse.orb +295 -41
  120. package/behaviors/registry/ui/core/atoms/std-calendar.orb +96 -2
  121. package/behaviors/registry/ui/core/atoms/std-esign-flow.orb +122 -15
  122. package/behaviors/registry/ui/core/atoms/std-esign-request.orb +11 -0
  123. package/behaviors/registry/ui/core/atoms/std-event-log.orb +0 -8
  124. package/behaviors/registry/ui/core/atoms/std-export.orb +0 -16
  125. package/behaviors/registry/ui/core/atoms/std-file-store.orb +109 -2
  126. package/behaviors/registry/ui/core/atoms/std-form-advanced.orb +1 -43
  127. package/behaviors/registry/ui/core/atoms/std-geosearch.orb +5 -0
  128. package/behaviors/registry/ui/core/atoms/std-graphs.orb +173 -66
  129. package/behaviors/registry/ui/core/atoms/std-import.orb +0 -8
  130. package/behaviors/registry/ui/core/atoms/std-list.orb +226 -34
  131. package/behaviors/registry/ui/core/atoms/std-modal-editor.orb +10 -1
  132. package/behaviors/registry/ui/core/atoms/std-rating-review.orb +37 -19
  133. package/behaviors/registry/ui/core/atoms/std-record-detail.orb +204 -11
  134. package/behaviors/registry/ui/core/atoms/std-recurrence.orb +89 -4
  135. package/behaviors/registry/ui/core/atoms/std-role-gate.orb +217 -0
  136. package/behaviors/registry/ui/core/atoms/std-saved-search.orb +419 -19
  137. package/behaviors/registry/ui/core/atoms/std-selection.orb +140 -10
  138. package/behaviors/registry/ui/core/atoms/std-stats.orb +73 -1
  139. package/behaviors/registry/ui/core/atoms/std-tag-taxonomy.orb +3 -0
  140. package/behaviors/registry/ui/core/atoms/std-thread.orb +190 -115
  141. package/behaviors/registry/ui/core/atoms/std-version-history.orb +127 -13
  142. package/behaviors/registry/ui/core/atoms/std-vote.orb +0 -9
  143. package/behaviors/registry/ui/core/atoms/std-wizard.orb +33 -3
  144. package/behaviors/registry/ui/core/atoms/ui-presence.orb +59 -0
  145. package/behaviors/registry/ui/core/molecules/ui-breadcrumb.orb +53 -1
  146. package/behaviors/registry/ui/core/molecules/ui-chart.orb +68 -1
  147. package/behaviors/registry/ui/core/molecules/ui-code-block.orb +291 -8
  148. package/behaviors/registry/ui/core/molecules/ui-command-palette.orb +87 -2
  149. package/behaviors/registry/ui/core/molecules/ui-commit-row.orb +3 -2
  150. package/behaviors/registry/ui/core/molecules/ui-confirm-dialog.orb +32 -0
  151. package/behaviors/registry/ui/core/molecules/ui-data-grid.orb +189 -3
  152. package/behaviors/registry/ui/core/molecules/ui-data-list.orb +189 -3
  153. package/behaviors/registry/ui/core/molecules/ui-document-details.orb +81 -24
  154. package/behaviors/registry/ui/core/molecules/ui-document-panel.orb +121 -3
  155. package/behaviors/registry/ui/core/molecules/ui-document-viewer.orb +53 -1
  156. package/behaviors/registry/ui/core/molecules/ui-drawer.orb +40 -0
  157. package/behaviors/registry/ui/core/molecules/ui-floating-action-button.orb +53 -1
  158. package/behaviors/registry/ui/core/molecules/ui-floating-toolbar.orb +53 -1
  159. package/behaviors/registry/ui/core/molecules/ui-form-actions.orb +53 -1
  160. package/behaviors/registry/ui/core/molecules/ui-graph-canvas.orb +53 -1
  161. package/behaviors/registry/ui/core/molecules/ui-menu.orb +57 -1
  162. package/behaviors/registry/ui/core/molecules/ui-meter.orb +53 -1
  163. package/behaviors/registry/ui/core/molecules/ui-modal.orb +8 -0
  164. package/behaviors/registry/ui/core/molecules/ui-page-header.orb +60 -1
  165. package/behaviors/registry/ui/core/molecules/ui-page-transition.orb +1 -1
  166. package/behaviors/registry/ui/core/molecules/ui-swipeable-row.orb +393 -23
  167. package/behaviors/registry/ui/core/molecules/ui-table-view.orb +189 -3
  168. package/behaviors/registry/ui/core/molecules/ui-tabs.orb +99 -2
  169. package/behaviors/registry/ui/core/organisms/ui-detail-panel.orb +282 -20
  170. package/behaviors/registry/ui/core/organisms/ui-entity-cards.orb +130 -3
  171. package/behaviors/registry/ui/core/organisms/ui-entity-list.orb +130 -3
  172. package/behaviors/registry/ui/core/organisms/ui-entity-table.orb +367 -9
  173. package/behaviors/registry/ui/core/organisms/ui-form-section.orb +104 -13
  174. package/behaviors/registry/ui/core/organisms/ui-form.orb +104 -13
  175. package/behaviors/registry/ui/core/organisms/ui-media-gallery.orb +121 -3
  176. package/behaviors/registry/ui/core/organisms/ui-state-machine-view.orb +82 -0
  177. package/behaviors/registry/ui/core/organisms/ui-timeline.orb +121 -3
  178. package/behaviors/registry/ui/core/templates/ui-counter-template.orb +1 -172
  179. package/behaviors/registry/ui/core/templates/ui-dashboard-layout.orb +53 -1
  180. package/behaviors/registry/ui/core/templates/ui-generic-app-template.orb +1 -116
  181. package/behaviors/registry/ui/game/atoms/ui-game-menu.orb +99 -2
  182. package/behaviors/registry/ui/game/organisms/std-arcade-board-3d.orb +10 -0
  183. package/behaviors/registry/ui/game/organisms/std-crew-board-2d.orb +0 -7
  184. package/behaviors/registry/ui/game/organisms/std-platformer-puzzle.orb +1 -807
  185. package/behaviors/registry/ui/game/organisms/std-tactics-board-2d.orb +0 -7
  186. package/behaviors/registry/ui/game/organisms/std-worldmap-board-2d.orb +0 -7
  187. package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +6 -0
  188. package/canonical-operators.json +18 -1
  189. package/dist/behaviors/exports-reader.js +7662 -3762
  190. package/dist/behaviors/functions/index.d.ts +309 -104
  191. package/dist/behaviors/functions/index.js +7651 -3762
  192. package/dist/behaviors/index.d.ts +1 -1
  193. package/dist/behaviors/index.js +7663 -3763
  194. package/dist/behaviors/query.js +7662 -3762
  195. package/dist/behaviors-embeddings.hash.json +3 -3
  196. package/dist/behaviors-embeddings.json +35 -27
  197. package/dist/behaviors-registry.json +4402 -1898
  198. package/dist/index.d.ts +3 -3
  199. package/dist/index.js +7697 -3763
  200. package/dist/knob-embeddings.hash.json +3 -3
  201. package/dist/knob-embeddings.json +612 -352
  202. package/dist/modules/anim.d.ts +1 -1
  203. package/dist/modules/array.d.ts +1 -1
  204. package/dist/modules/array.js +15 -0
  205. package/dist/modules/async.d.ts +1 -1
  206. package/dist/modules/async.js +9 -0
  207. package/dist/modules/behavior.d.ts +1 -1
  208. package/dist/modules/browser.d.ts +1 -1
  209. package/dist/modules/composition.d.ts +1 -1
  210. package/dist/modules/contract.d.ts +1 -1
  211. package/dist/modules/core.d.ts +1 -1
  212. package/dist/modules/core.js +10 -0
  213. package/dist/modules/data.d.ts +1 -1
  214. package/dist/modules/ease.d.ts +1 -1
  215. package/dist/modules/format.d.ts +1 -1
  216. package/dist/modules/geo.d.ts +1 -1
  217. package/dist/modules/graph.d.ts +1 -1
  218. package/dist/modules/grid.d.ts +1 -1
  219. package/dist/modules/index.d.ts +1 -1
  220. package/dist/modules/index.js +34 -0
  221. package/dist/modules/integration.d.ts +1 -1
  222. package/dist/modules/json.d.ts +1 -1
  223. package/dist/modules/llm.d.ts +1 -1
  224. package/dist/modules/math.d.ts +1 -1
  225. package/dist/modules/memory.d.ts +1 -1
  226. package/dist/modules/nn.d.ts +1 -1
  227. package/dist/modules/noise.d.ts +1 -1
  228. package/dist/modules/object.d.ts +1 -1
  229. package/dist/modules/os.d.ts +1 -1
  230. package/dist/modules/path.d.ts +1 -1
  231. package/dist/modules/prob.d.ts +1 -1
  232. package/dist/modules/session.d.ts +1 -1
  233. package/dist/modules/str.d.ts +1 -1
  234. package/dist/modules/tensor.d.ts +1 -1
  235. package/dist/modules/time.d.ts +1 -1
  236. package/dist/modules/trace.d.ts +1 -1
  237. package/dist/modules/train.d.ts +1 -1
  238. package/dist/modules/validate.d.ts +1 -1
  239. package/dist/modules/vector.d.ts +1 -1
  240. package/dist/modules/workspace.d.ts +1 -1
  241. package/dist/registry/factory-signatures.json +1 -1
  242. package/dist/registry.d.ts +5 -2
  243. package/dist/registry.js +55 -1
  244. package/dist/{types-DwAW4Nni.d.ts → types-DLx38UFZ.d.ts} +31 -4
  245. package/package.json +2 -2
@@ -21,6 +21,7 @@ orbital RateBucketOrbital {
21
21
  count : number @description "The current value of a counter." @synonyms "value, amount, total" = 0
22
22
  window : number @description "The duration of the rate limiting window, in seconds." @synonyms "duration, time, interval, period" = 0
23
23
  limiterStatus : string @description "Current operational state of the rate limiter." @synonyms "state, condition, mode" = open
24
+ limit : number @description "Requests this bucket admits per window before it throttles; set from requestsPerMinute when the limiter mounts." @synonyms "cap, quota, ceiling, maximum requests" = 60
24
25
  }
25
26
 
26
27
  trait ShieldIcon = Icon.traits.IconRender -> RateBucket {
@@ -77,7 +78,7 @@ orbital RateBucketOrbital {
77
78
 
78
79
  trait CountMeter = Meter.traits.MeterRender -> RateBucket {
79
80
  config {
80
- max: 100
81
+ max: @entity.limit
81
82
  min: 0
82
83
  value: @entity.count
83
84
  }
@@ -85,7 +86,7 @@ orbital RateBucketOrbital {
85
86
 
86
87
  trait CountProgressBar = ProgressBar.traits.ProgressBarRender -> RateBucket {
87
88
  config {
88
- max: 100
89
+ max: @entity.limit
89
90
  showPercentage: true
90
91
  value: @entity.count
91
92
  }
@@ -136,6 +137,7 @@ orbital RateBucketOrbital {
136
137
  INIT -> open
137
138
  (set @entity.count 0)
138
139
  (set @entity.window 60)
140
+ (set @entity.limit @config.requestsPerMinute)
139
141
  (set @entity.limiterStatus open)
140
142
  (render-ui main {
141
143
  children: [{
@@ -162,7 +164,36 @@ orbital RateBucketOrbital {
162
164
  gap: lg
163
165
  type: stack
164
166
  })
165
- REQUEST -> open when @config.enabled
167
+ REQUEST -> throttled when (and @config.enabled (>= (+ @entity.count 1) @entity.limit))
168
+ (set @entity.count (+ @entity.count 1))
169
+ (set @entity.limiterStatus throttled)
170
+ (render-ui main {
171
+ children: [{
172
+ align: center
173
+ children: [{
174
+ align: center
175
+ children: [@trait.ShieldIcon, @trait.RateBucketTitle]
176
+ direction: horizontal
177
+ gap: md
178
+ type: stack
179
+ }, @trait.ThrottledStatusDot]
180
+ direction: horizontal
181
+ gap: md
182
+ justify: between
183
+ type: stack
184
+ }, @trait.RateBucketDivider, @trait.RateLimitAlert, @trait.StatsGrid, @trait.CountMeter, {
185
+ children: [@trait.ResetPrimaryButton]
186
+ direction: horizontal
187
+ gap: sm
188
+ justify: center
189
+ type: stack
190
+ }]
191
+ direction: vertical
192
+ gap: lg
193
+ type: stack
194
+ })
195
+ REQUEST -> open when (and @config.enabled (< (+ @entity.count 1) @entity.limit))
196
+ (set @entity.count (+ @entity.count 1))
166
197
  (render-ui main {
167
198
  children: [{
168
199
  align: center
@@ -243,9 +274,43 @@ orbital RateBucketOrbital {
243
274
  gap: lg
244
275
  type: stack
245
276
  })
277
+ WINDOW_ELAPSED -> open
278
+ (set @entity.count 0)
279
+ CONFIGURE -> open
280
+ (set @entity.limit ?limit)
246
281
  }
247
282
 
248
283
  state throttled {
284
+ CONFIGURE -> throttled
285
+ (set @entity.limit ?limit)
286
+ WINDOW_ELAPSED -> open
287
+ (set @entity.limiterStatus open)
288
+ (set @entity.count 0)
289
+ (render-ui main {
290
+ children: [{
291
+ align: center
292
+ children: [{
293
+ align: center
294
+ children: [@trait.ShieldIcon, @trait.RateBucketTitle]
295
+ direction: horizontal
296
+ gap: md
297
+ type: stack
298
+ }, @trait.OpenStatusDot]
299
+ direction: horizontal
300
+ gap: md
301
+ justify: between
302
+ type: stack
303
+ }, @trait.RateBucketDivider, @trait.StatsGrid, @trait.CountMeter, @trait.CountProgressBar, {
304
+ children: [@trait.RequestButton, @trait.ResetButton]
305
+ direction: horizontal
306
+ gap: sm
307
+ justify: center
308
+ type: stack
309
+ }]
310
+ direction: vertical
311
+ gap: lg
312
+ type: stack
313
+ })
249
314
  RESET -> open
250
315
  (set @entity.limiterStatus open)
251
316
  (set @entity.count 0)
@@ -303,9 +368,21 @@ orbital RateBucketOrbital {
303
368
  }
304
369
 
305
370
  listens {
306
- RequestButton.REQUEST -> REQUEST
307
- ResetButton.RESET -> RESET
308
- ResetPrimaryButton.RESET -> RESET
371
+ CONFIGURE {
372
+ limit : number
373
+ }
374
+ @description "Sets this bucket's limit (requests per window), e.g. from the host row's own rate limit."
375
+ }
376
+
377
+ ticks {
378
+ windowElapsed every 1m
379
+ (emit WINDOW_ELAPSED)
380
+ }
381
+
382
+ emits {
383
+ WINDOW_ELAPSED -> internal {
384
+ }
385
+ @description "One rate-limit window (a minute) has elapsed; the request count starts over."
309
386
  }
310
387
 
311
388
  config {
@@ -316,24 +393,9 @@ orbital RateBucketOrbital {
316
393
  @tier "domain"
317
394
  requestsPerMinute : number = 60
318
395
  @label "Requests per minute"
319
- @description "Maximum number of requests allowed per minute before throttling begins."
396
+ @description "Requests a bucket admits per one-minute window; the next request throttles it, and each elapsed minute (or RESET) reopens it."
320
397
  @synonyms "rate limit, request cap, RPS, throttle threshold"
321
398
  @tier "domain"
322
- burstSize : number = 10
323
- @label "Burst size"
324
- @description "Requests allowed to burst above the per-minute rate before steady-state throttling kicks in. Lower burst = strict/no-spikes; higher burst = forgiving/allow-spikes."
325
- @synonyms "burst capacity, allowance, spike allowance, no-spike (low) vs allow-bursts (high)"
326
- @tier "domain"
327
- keyStrategy : "ip" | "user" | "api-key" | "global" = user
328
- @label "Rate-limit key strategy"
329
- @description "What identifier the per-bucket counter is keyed on: source IP, authenticated user, API key, or one global bucket."
330
- @synonyms "limiter key, bucket key"
331
- @tier "domain"
332
- overrideRoles : [string] = []
333
- @label "Override roles"
334
- @description "Roles exempt from rate limiting (e.g. internal services, admin override). Empty = no exemptions."
335
- @synonyms "exempt roles, bypass list"
336
- @tier "domain"
337
399
  statLook : "elevated" | "flat" | "progress-backed" | "gauge" | "sparkline" = elevated
338
400
  @label "Stat display look"
339
401
  @description "Layer 2 visual treatment for stat / KPI cards."
@@ -20,7 +20,7 @@ orbital StatusLifecycleOrbital {
20
20
  initial: idle
21
21
 
22
22
  state idle {
23
- ChangeStatusRequested -> idle when (and @config.enabled (array/some @config.transitions (fn t (and ["=", (object/get @t from), ?from] ["=", (object/get @t to), ?to]))))
23
+ ChangeStatusRequested -> idle when (and @config.enabled (array/includes @config.states ?to) (array/some @config.transitions (fn t (and ["=", (object/get @t from), ?from] ["=", (object/get @t to), ?to]))))
24
24
  (persist update @config.targetEntity (object/set { id: ?id } @config.statusField ?to) {
25
25
  emit: { failure: StatusChangeFailed, success: StatusPersisted }
26
26
  })
@@ -74,11 +74,6 @@ orbital StatusLifecycleOrbital {
74
74
  @description "Entity field this lifecycle drives (e.g. 'status', 'state', 'stage', 'phase')."
75
75
  @synonyms "state field, stage field, status column, lifecycle field"
76
76
  @tier "infra"
77
- initialStatus : string = "draft"
78
- @label "What status do new records start in?"
79
- @description "The status assigned when a record is first created."
80
- @synonyms "starting state, default status, first stage, initial state"
81
- @tier "domain"
82
77
  states : [string] = (draft active archived)
83
78
  @label "What are the possible statuses?"
84
79
  @description "The complete set of statuses a record can hold."
@@ -54,7 +54,8 @@ orbital GraphBuilderOrbital {
54
54
  nodes: @nodes,
55
55
  edges: @edges,
56
56
  nodeCount: (array/len @nodes),
57
- edgeCount: (array/len @edges)
57
+ edgeCount: (array/len @edges),
58
+ directed: @config.directed
58
59
  })))
59
60
  }
60
61
 
@@ -75,6 +76,7 @@ orbital GraphBuilderOrbital {
75
76
  edges : [GraphBuilderEdge]!
76
77
  nodeCount : int!
77
78
  edgeCount : int!
79
+ directed : boolean!
78
80
  }
79
81
  @description "Fired when node/edge structures have been built from the source entity collection"
80
82
  @tier "primary"
@@ -30,10 +30,6 @@ orbital MlClassifyOrbital {
30
30
  @label "Categories"
31
31
  @description "Closed set of category labels the LLM must choose from"
32
32
  @tier "domain"
33
- provider : string = ""
34
- @label "Provider"
35
- @description "Reserved for provider selection; LLMServiceActions.classify (packages/almadar-llm/src/contracts.ts) takes no provider param today, so this knob is not forwarded to the call"
36
- @tier "infra"
37
33
  model : string = ""
38
34
  @label "Model"
39
35
  @description "Model override forwarded to the classify call"
@@ -38,10 +38,6 @@ orbital MlSimilarityOrbital {
38
38
  @label "Match margin"
39
39
  @description "Minimum gap between the best and second-best score required to trust the match"
40
40
  @tier "policy"
41
- embedModel : string = ""
42
- @label "Embedding model"
43
- @description "Reserved for embedding-model selection; llm/embed takes only a texts array today, so this knob is not yet wired into the call"
44
- @tier "infra"
45
41
  }
46
42
 
47
43
  state idle {
@@ -27,6 +27,12 @@ orbital AvlStateMachineOrbital {
27
27
  type : string!
28
28
  args : [SExpr]!
29
29
  }
30
+ type AvlStateMachineTRANSITIONCLICKTransition = {
31
+ index : number!
32
+ event : string!
33
+ from : string!
34
+ to : string!
35
+ }
30
36
 
31
37
  entity AvlStateMachineItem [runtime] {
32
38
  id : string!
@@ -44,6 +50,7 @@ orbital AvlStateMachineOrbital {
44
50
  visitedStates: @config.visitedStates
45
51
  stateClickEvent: @config.stateClickEvent
46
52
  transitionClickEvent: @config.transitionClickEvent
53
+ onTransitionClick: @config.onTransitionClick
47
54
  selectedState: @config.selectedState
48
55
  pendingSourceState: @config.pendingSourceState
49
56
  nodeShape: @config.nodeShape
@@ -66,6 +73,7 @@ orbital AvlStateMachineOrbital {
66
73
  event : string!
67
74
  from : string!
68
75
  to : string!
76
+ transition : AvlStateMachineTRANSITIONCLICKTransition
69
77
  }
70
78
  @description "Emits UI:{transitionClickEvent} with { index, event, from, to } when a transition label is clicked."
71
79
  @tier "essential"
@@ -97,6 +105,10 @@ orbital AvlStateMachineOrbital {
97
105
  @label "Transition Click Event"
98
106
  @description "Emits UI:{transitionClickEvent} with { index, event, from, to } when a transition label is clicked."
99
107
  @tier "presentation"
108
+ onTransitionClick : event = "TRANSITION_CLICK"
109
+ @label "On Transition Click"
110
+ @description "Direct transition-click callback, for React hosts (e.g. a canvas node)."
111
+ @tier "presentation"
100
112
  selectedState : string
101
113
  @label "Selected State"
102
114
  @description "State picked in an editor (first click)."
@@ -1,8 +1,8 @@
1
1
  app std-app-layout "1.4.1"
2
2
  "std-app-layout — dashboard-layout chrome (sidebar nav + top bar with search + topBarActions + notifications) wrapping a single contentTrait slot. Use for list-style apps (CMS / helpdesk / CRM) and account/settings pages: the chrome stays stable while the consumer's content trait renders the data, and the consumer can add domain icons (cart / profile / help) via topBarActions. Bind once per orbital — the consumer rebinds linkedEntity via `XAppLayout = AppShell.traits.AppLayout -> XEntity` so multiple orbitals in one file each get their own chrome without colliding on a shared atom entity."
3
3
  ;; @capabilities "settings page shell, preferences page, account settings layout, profile settings, admin console shell"
4
- type NavItem = { label : string!, href : string!, icon : string, badge : string, children : [NavItem] }
5
- type ItemAction = { label : string!, event : event, navigatesTo : string, variant : string, icon : string }
4
+ type NavItem = { label : string!, href : string!, icon : string, badge : string, children : [NavItem], roles : [string] }
5
+ type ItemAction = { label : string!, event : event, navigatesTo : string, variant : string, icon : string, roles : [string] }
6
6
  type NotificationSpec = { id : string, message : string, variant : string }
7
7
  orbital AppLayoutOrbital {
8
8
  type AppLayoutStateLoaded = Event { data : [AppLayoutData] }
@@ -17,7 +17,7 @@ orbital AppLayoutOrbital {
17
17
  initial: composing
18
18
 
19
19
  state composing {
20
- INIT -> composing
20
+ INIT -> composing when (or (= (array/len @config.allowedRoles) 0) (array/includes @config.allowedRoles @config.viewerRole))
21
21
  (fetch AppLayoutData {
22
22
  emit: { failure: AppLayoutStateLoadFailed, success: AppLayoutStateLoaded }
23
23
  })
@@ -37,12 +37,47 @@ orbital AppLayoutOrbital {
37
37
  }]
38
38
  currentPath: @config.currentPath
39
39
  layoutMode: @config.layoutMode
40
- navItems: @config.navItems
40
+ navItems: (array/map (array/filter @config.navItems (fn item (or (= (array/len (object/get @item roles [])) 0) (array/includes (object/get @item roles []) @config.viewerRole)))) (fn item (if (object/has @item children) (object/merge @item { children: (array/filter (object/get @item children []) (fn child (or (= (array/len (object/get @child roles [])) 0) (array/includes (object/get @child roles []) @config.viewerRole)))) }) @item)))
41
41
  notificationClickEvent: @config.notificationClickEvent
42
42
  notifications: @config.notifications
43
43
  searchEvent: @config.searchEvent
44
44
  sidebarContent: @config.sidebarTrait
45
- topBarActions: @config.topBarActions
45
+ topBarActions: (array/filter @config.topBarActions (fn action (or (= (array/len (object/get @action roles [])) 0) (array/includes (object/get @action roles []) @config.viewerRole))))
46
+ type: @config.layoutPattern
47
+ user: (if @config.viewerName { avatar: @config.viewerAvatar, email: @config.viewerEmail, name: @config.viewerName } null)
48
+ }]
49
+ })
50
+ INIT -> composing when (not (or (= (array/len @config.allowedRoles) 0) (array/includes @config.allowedRoles @config.viewerRole)))
51
+ (fetch AppLayoutData {
52
+ emit: { failure: AppLayoutStateLoadFailed, success: AppLayoutStateLoaded }
53
+ })
54
+ (render-ui main {
55
+ data-theme: @config.theme
56
+ className: "min-h-screen w-full"
57
+ fullHeight: true
58
+ type: box
59
+ children: [{
60
+ appName: @config.appName
61
+ children: [{
62
+ children: [{
63
+ description: @config.accessDeniedDescription
64
+ icon: lock
65
+ title: @config.accessDeniedTitle
66
+ type: empty-state
67
+ }]
68
+ className: @config.contentClassName
69
+ direction: vertical
70
+ gap: lg
71
+ type: stack
72
+ }]
73
+ currentPath: @config.currentPath
74
+ layoutMode: @config.layoutMode
75
+ navItems: (array/map (array/filter @config.navItems (fn item (or (= (array/len (object/get @item roles [])) 0) (array/includes (object/get @item roles []) @config.viewerRole)))) (fn item (if (object/has @item children) (object/merge @item { children: (array/filter (object/get @item children []) (fn child (or (= (array/len (object/get @child roles [])) 0) (array/includes (object/get @child roles []) @config.viewerRole)))) }) @item)))
76
+ notificationClickEvent: @config.notificationClickEvent
77
+ notifications: @config.notifications
78
+ searchEvent: @config.searchEvent
79
+ sidebarContent: @config.sidebarTrait
80
+ topBarActions: (array/filter @config.topBarActions (fn action (or (= (array/len (object/get @action roles [])) 0) (array/includes (object/get @action roles []) @config.viewerRole))))
46
81
  type: @config.layoutPattern
47
82
  user: (if @config.viewerName { avatar: @config.viewerAvatar, email: @config.viewerEmail, name: @config.viewerName } null)
48
83
  }]
@@ -147,10 +182,6 @@ orbital AppLayoutOrbital {
147
182
  @description "sidebar = left rail; topnav = top bar; bottomnav = mobile tab bar; minimal = no nav."
148
183
  @synonyms "nav position, navigation style, menu placement, layout style"
149
184
  @tier "presentation"
150
- detailSlot : slot = modal
151
- @label "Detail slot"
152
- @description "Slot where detail/edit views render"
153
- @tier "internal"
154
185
  currentPath : string = ""
155
186
  @label "Current path"
156
187
  @description "Nav-highlight ONLY: which nav item to mark active. This is NOT the page route — it does not change what page loads or where the orbital lives. To set the landing route or a page path, use the orbital's pagePath / page path, not this knob. When omitted, the layout reads the current route."
@@ -160,6 +191,21 @@ orbital AppLayoutOrbital {
160
191
  @label "Content wrapper class"
161
192
  @description "CSS class applied to the content area wrapper."
162
193
  @tier "internal"
194
+ viewerRole : string = ""
195
+ @label "Viewer's role"
196
+ @description "The signed-in viewer's role that allowedRoles and each nav item's / top-bar action's `roles` are checked against. Bind it explicitly at the call site (e.g. `viewerRole: @user.role`) in an app whose identity carries a role; left empty, only items with no `roles` show and a page with allowedRoles is denied."
197
+ @tier "policy"
198
+ allowedRoles : [string] = []
199
+ @label "Who may open this page?"
200
+ @description "Roles (matched against viewerRole) allowed to see this page's content. Empty = everyone; anyone else sees the access-denied state instead. Nav items and top-bar actions carry their own `roles` the same way."
201
+ @synonyms "access, permission, restrict, only for, roles allowed, who can see"
202
+ @tier "policy"
203
+ accessDeniedTitle : string = "You don't have access to this page"
204
+ @label "Access-denied title"
205
+ @tier "presentation"
206
+ accessDeniedDescription : string = "Ask an administrator if you need it."
207
+ @label "Access-denied message"
208
+ @tier "presentation"
163
209
  theme : string = @currentTheme
164
210
  @label "Theme"
165
211
  @description "Data-theme attribute applied to the layout root (e.g. almadar-website-dark)."
@@ -1,7 +1,7 @@
1
1
  app std-app-search "1.0.0"
2
2
  "std-app-search — reusable global search: wraps a host content view and, on a SEARCH trigger, fetches the linked entity filtered by @config.searchField and renders the matching results, then CLEAR_SEARCH returns to the host view. Rebind to any entity; point @config.idleContent at the normal view and wire a trigger (e.g. AppLayout SEARCH) into SEARCH."
3
3
  type AppSearchFieldSpec = { name : string!, label : string, variant : h3 | h4 | body | caption | badge | small | progress, icon : string, format : date | currency | number | boolean | percent, event : string, href : string, payload : string, disabled : boolean, confirm : string, hidden : boolean }
4
- type AppSearchActionSpec = { label : string!, event : event!, variant : primary | secondary | ghost | danger, icon : string, href : string, payload : string, disabled : boolean, confirm : string, hidden : boolean }
4
+ type AppSearchActionSpec = { label : string!, event : event!, variant : primary | secondary | ghost | danger, icon : string, href : string, payload : string, disabled : boolean, confirm : string, hidden : boolean, roles : [string] }
5
5
  orbital AppSearchOrbital {
6
6
  type AppSearchLoaded = Event { data : [AppSearchTarget] } "Filtered search results loaded"
7
7
  type AppSearchFailed = Event { error : string } "Search fetch failed"
@@ -127,7 +127,7 @@ orbital AppSearchOrbital {
127
127
  type: data-grid
128
128
  entity: @payload.data
129
129
  fields: @config.resultFields
130
- itemActions: @config.resultActions
130
+ itemActions: (array/filter @config.resultActions (fn action (or (= (array/len (object/get @action roles [])) 0) (array/includes (object/get @action roles []) @config.viewerRole))))
131
131
  }]
132
132
  })
133
133
  AppSearchFailed -> idle
@@ -224,6 +224,10 @@ orbital AppSearchOrbital {
224
224
  @label "Result row actions"
225
225
  @description "Optional per-row actions on a result, e.g. { label: \"View Details\", event: \"VIEW\" }."
226
226
  @tier "presentation"
227
+ viewerRole : string = ""
228
+ @label "Viewer's role"
229
+ @description "The signed-in viewer's role that each action's `roles` is checked against. Bind it explicitly at the call site (e.g. `viewerRole: @user.role`) in an app whose identity carries a role; left empty, only actions with no `roles` show."
230
+ @tier "policy"
227
231
  }
228
232
  }
229
233
 
@@ -1,8 +1,12 @@
1
1
  app std-billable-hour "1.0.0"
2
2
  "std-billable-hour — generic billable-hour timesheet primitive for legal, agency, and consulting domains. Lists entries in `browsing`; opens entry detail in `viewing_single` with Invoice / Write Off actions."
3
- type ItemAction = { label : string!, event : event, navigatesTo : string, variant : string, icon : string }
3
+ type ItemAction = { label : string!, event : event, navigatesTo : string, variant : string, icon : string, roles : [string], when : SExpr }
4
4
  type ColumnSpec = { key : string!, field : string, header : string, width : string, align : string, className : string, weight : string, format : string, icon : string }
5
5
  orbital BillableHourOrbital {
6
+ uses RoleGate from "std/behaviors/std-role-gate"
7
+
8
+ uses Button from "std/behaviors/ui-button"
9
+
6
10
  uses TableView from "std/behaviors/ui-table-view"
7
11
 
8
12
  type BillableHourLoaded = Event { data : [BillableHour] } "Fired when the billable-hour collection finishes loading"
@@ -28,6 +32,7 @@ orbital BillableHourOrbital {
28
32
  columns: @config.columns
29
33
  emptyMessage: "No time entries"
30
34
  itemActions: @config.itemActions
35
+ viewerRole: @config.viewerRole
31
36
  look: @config.tableLook
32
37
  maxInlineActions: 2
33
38
  selfFetch: false
@@ -199,19 +204,7 @@ orbital BillableHourOrbital {
199
204
  type: simple-grid
200
205
  }, {
201
206
  align: center
202
- children: [{
203
- action: INVOICE_HOURS
204
- actionPayload: { id: @entity.id }
205
- label: Invoice
206
- type: button
207
- variant: primary
208
- }, {
209
- action: WRITE_OFF_HOURS
210
- actionPayload: { id: @entity.id }
211
- label: "Write Off"
212
- type: button
213
- variant: danger
214
- }]
207
+ children: [<RoleGate.traits.RoleGate linkedEntity={BillableHour} roles={@config.invoiceRoles} viewerRole={@config.viewerRole} content={<Button.traits.ButtonRender linkedEntity={BillableHour} action={INVOICE_HOURS} actionPayload={{ id: ?row.id }} label={Invoice} variant={primary} />} />, <RoleGate.traits.RoleGate linkedEntity={BillableHour} roles={@config.writeOffRoles} viewerRole={@config.viewerRole} content={<Button.traits.ButtonRender linkedEntity={BillableHour} action={WRITE_OFF_HOURS} actionPayload={{ id: ?row.id }} label={"Write Off"} variant={danger} />} />]
215
208
  direction: horizontal
216
209
  gap: sm
217
210
  type: stack
@@ -448,10 +441,22 @@ orbital BillableHourOrbital {
448
441
  @label "Row actions"
449
442
  @description "Per-row actions rendered by the hours table."
450
443
  @tier "presentation"
444
+ viewerRole : string = ""
445
+ @label "Viewer's role"
446
+ @description "The signed-in viewer's role that each action's `roles` is checked against. Bind it explicitly at the call site (e.g. `viewerRole: @user.role`) in an app whose identity carries a role; left empty, only actions with no `roles` show."
447
+ @tier "policy"
451
448
  statLook : "elevated" | "flat" | "progress-backed" | "gauge" | "sparkline" = elevated
452
449
  @label "Stat display look"
453
450
  @description "Layer 2 visual treatment for stat / KPI cards."
454
451
  @tier "presentation"
452
+ invoiceRoles : [string] = []
453
+ @label "Roles that can invoice"
454
+ @description "Roles (matched against viewerRole) that see the Invoice button. Empty = everyone."
455
+ @tier "policy"
456
+ writeOffRoles : [string] = []
457
+ @label "Roles that can write off"
458
+ @description "Roles (matched against viewerRole) that see the Write Off button. Empty = everyone."
459
+ @tier "policy"
455
460
  }
456
461
  }
457
462