@almadar/std 6.5.2 → 7.2.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 (307) hide show
  1. package/behaviors/registry/atoms/std-agent-activity-log.orb +240 -227
  2. package/behaviors/registry/atoms/std-agent-chat-thread.orb +296 -199
  3. package/behaviors/registry/atoms/std-agent-classifier.orb +384 -133
  4. package/behaviors/registry/atoms/std-agent-completion.orb +404 -141
  5. package/behaviors/registry/atoms/std-agent-context-window.orb +904 -607
  6. package/behaviors/registry/atoms/std-agent-conversation.orb +443 -234
  7. package/behaviors/registry/atoms/std-agent-memory.orb +584 -150
  8. package/behaviors/registry/atoms/std-agent-provider.orb +431 -174
  9. package/behaviors/registry/atoms/std-agent-search.orb +217 -61
  10. package/behaviors/registry/atoms/std-agent-session.orb +406 -159
  11. package/behaviors/registry/atoms/std-agent-step-progress.orb +314 -294
  12. package/behaviors/registry/atoms/std-agent-token-gauge.orb +577 -500
  13. package/behaviors/registry/atoms/std-agent-tool-call.orb +328 -138
  14. package/behaviors/registry/atoms/std-async.orb +147 -86
  15. package/behaviors/registry/atoms/std-autoregressive.orb +64 -73
  16. package/behaviors/registry/atoms/std-browse.orb +260 -126
  17. package/behaviors/registry/atoms/std-cache-aside.orb +358 -259
  18. package/behaviors/registry/atoms/std-calendar.orb +280 -215
  19. package/behaviors/registry/atoms/std-circuit-breaker.orb +295 -234
  20. package/behaviors/registry/atoms/std-collision.orb +136 -135
  21. package/behaviors/registry/atoms/std-combat-log.orb +108 -90
  22. package/behaviors/registry/atoms/std-combat.orb +171 -98
  23. package/behaviors/registry/atoms/std-confirmation.orb +28 -300
  24. package/behaviors/registry/atoms/std-dialogue-box.orb +111 -30
  25. package/behaviors/registry/atoms/std-display.orb +491 -587
  26. package/behaviors/registry/atoms/std-drawer.orb +194 -121
  27. package/behaviors/registry/atoms/std-filter.orb +311 -326
  28. package/behaviors/registry/atoms/std-flip-card.orb +223 -177
  29. package/behaviors/registry/atoms/std-gallery.orb +130 -151
  30. package/behaviors/registry/atoms/std-game-audio.orb +133 -72
  31. package/behaviors/registry/atoms/std-game-canvas2d.orb +112 -52
  32. package/behaviors/registry/atoms/std-game-canvas3d.orb +150 -107
  33. package/behaviors/registry/atoms/std-game-hud.orb +87 -20
  34. package/behaviors/registry/atoms/std-game-menu.orb +32 -32
  35. package/behaviors/registry/atoms/std-game-over-screen.orb +100 -33
  36. package/behaviors/registry/atoms/std-gameflow.orb +147 -80
  37. package/behaviors/registry/atoms/std-input.orb +128 -393
  38. package/behaviors/registry/atoms/std-inventory-panel.orb +108 -71
  39. package/behaviors/registry/atoms/std-isometric-canvas.orb +156 -407
  40. package/behaviors/registry/atoms/std-loading.orb +127 -126
  41. package/behaviors/registry/atoms/std-modal.orb +30 -267
  42. package/behaviors/registry/atoms/std-movement.orb +391 -292
  43. package/behaviors/registry/atoms/std-notification.orb +133 -75
  44. package/behaviors/registry/atoms/std-overworld.orb +194 -121
  45. package/behaviors/registry/atoms/std-pagination.orb +120 -53
  46. package/behaviors/registry/atoms/std-physics2d.orb +94 -93
  47. package/behaviors/registry/atoms/std-platformer-canvas.orb +110 -98
  48. package/behaviors/registry/atoms/std-push.orb +172 -36
  49. package/behaviors/registry/atoms/std-quest.orb +552 -449
  50. package/behaviors/registry/atoms/std-rate-limiter.orb +242 -241
  51. package/behaviors/registry/atoms/std-rating.orb +123 -65
  52. package/behaviors/registry/atoms/std-related.orb +202 -26
  53. package/behaviors/registry/atoms/std-score-board.orb +109 -28
  54. package/behaviors/registry/atoms/std-score.orb +210 -146
  55. package/behaviors/registry/atoms/std-search.orb +265 -138
  56. package/behaviors/registry/atoms/std-selection.orb +311 -220
  57. package/behaviors/registry/atoms/std-service-custom-bearer.orb +199 -110
  58. package/behaviors/registry/atoms/std-service-custom-header.orb +206 -117
  59. package/behaviors/registry/atoms/std-service-custom-noauth.orb +197 -108
  60. package/behaviors/registry/atoms/std-service-custom-query.orb +193 -104
  61. package/behaviors/registry/atoms/std-service-email.orb +195 -107
  62. package/behaviors/registry/atoms/std-service-github.orb +216 -122
  63. package/behaviors/registry/atoms/std-service-llm.orb +204 -122
  64. package/behaviors/registry/atoms/std-service-oauth.orb +290 -204
  65. package/behaviors/registry/atoms/std-service-redis.orb +177 -92
  66. package/behaviors/registry/atoms/std-service-storage.orb +211 -122
  67. package/behaviors/registry/atoms/std-service-stripe.orb +236 -154
  68. package/behaviors/registry/atoms/std-service-twilio.orb +221 -137
  69. package/behaviors/registry/atoms/std-service-youtube.orb +327 -241
  70. package/behaviors/registry/atoms/std-simulation-canvas.orb +97 -36
  71. package/behaviors/registry/atoms/std-sort.orb +284 -207
  72. package/behaviors/registry/atoms/std-sprite.orb +150 -74
  73. package/behaviors/registry/atoms/std-tabs.orb +129 -62
  74. package/behaviors/registry/atoms/std-text-effects.orb +251 -190
  75. package/behaviors/registry/atoms/std-theme.orb +193 -135
  76. package/behaviors/registry/atoms/std-timer.orb +320 -344
  77. package/behaviors/registry/atoms/std-undo.orb +278 -199
  78. package/behaviors/registry/atoms/std-upload.orb +112 -111
  79. package/behaviors/registry/atoms/std-validate-on-save.orb +159 -151
  80. package/behaviors/registry/atoms/std-wizard.orb +445 -336
  81. package/behaviors/registry/molecules/std-agent-fix-loop.orb +876 -857
  82. package/behaviors/registry/molecules/std-agent-learner.orb +635 -654
  83. package/behaviors/registry/molecules/std-agent-planner.orb +581 -548
  84. package/behaviors/registry/molecules/std-agent-rag.orb +414 -410
  85. package/behaviors/registry/molecules/std-agent-tool-loop.orb +716 -711
  86. package/behaviors/registry/molecules/std-batch-selected-list.orb +28 -12
  87. package/behaviors/registry/molecules/std-builder-game.orb +86 -28
  88. package/behaviors/registry/molecules/std-calendar-booking.orb +32 -8
  89. package/behaviors/registry/molecules/std-cart.orb +347 -406
  90. package/behaviors/registry/molecules/std-classifier-game.orb +95 -37
  91. package/behaviors/registry/molecules/std-dashboard-tabbed.orb +16 -10
  92. package/behaviors/registry/molecules/std-debugger-game.orb +95 -37
  93. package/behaviors/registry/molecules/std-detail.orb +133 -138
  94. package/behaviors/registry/molecules/std-drawer-master-list.orb +12 -6
  95. package/behaviors/registry/molecules/std-event-handler-game.orb +91 -33
  96. package/behaviors/registry/molecules/std-filtered-list.orb +14 -8
  97. package/behaviors/registry/molecules/std-form-advanced.orb +242 -153
  98. package/behaviors/registry/molecules/std-gallery-filtered.orb +16 -10
  99. package/behaviors/registry/molecules/std-geospatial.orb +175 -122
  100. package/behaviors/registry/molecules/std-inventory.orb +216 -170
  101. package/behaviors/registry/molecules/std-list.orb +280 -205
  102. package/behaviors/registry/molecules/std-messaging.orb +146 -99
  103. package/behaviors/registry/molecules/std-negotiator-game.orb +95 -37
  104. package/behaviors/registry/molecules/std-platformer-game.orb +300 -171
  105. package/behaviors/registry/molecules/std-push-activity-log.orb +32 -8
  106. package/behaviors/registry/molecules/std-puzzle-game.orb +287 -146
  107. package/behaviors/registry/molecules/std-quiz.orb +322 -263
  108. package/behaviors/registry/molecules/std-related-master-detail.orb +21 -15
  109. package/behaviors/registry/molecules/std-sequencer-game.orb +92 -34
  110. package/behaviors/registry/molecules/std-service-content-pipeline.orb +268 -267
  111. package/behaviors/registry/molecules/std-service-custom-api-tester.orb +245 -152
  112. package/behaviors/registry/molecules/std-service-devops-toolkit.orb +633 -294
  113. package/behaviors/registry/molecules/std-service-notification-hub.orb +237 -152
  114. package/behaviors/registry/molecules/std-service-payment-flow.orb +310 -180
  115. package/behaviors/registry/molecules/std-simulator-game.orb +96 -38
  116. package/behaviors/registry/molecules/std-turn-based-battle.orb +247 -137
  117. package/behaviors/registry/molecules/std-wizard-form.orb +60 -9
  118. package/behaviors/registry/organisms/std-agent-assistant.orb +2810 -1833
  119. package/behaviors/registry/organisms/std-agent-builder.orb +6401 -4539
  120. package/behaviors/registry/organisms/std-agent-pipeline.orb +5028 -3497
  121. package/behaviors/registry/organisms/std-agent-reviewer.orb +2219 -1406
  122. package/behaviors/registry/organisms/std-agent-tutor.orb +2069 -1384
  123. package/behaviors/registry/organisms/std-api-gateway.orb +1419 -870
  124. package/behaviors/registry/organisms/std-arcade-game.orb +488 -231
  125. package/behaviors/registry/organisms/std-booking-system.orb +2457 -1467
  126. package/behaviors/registry/organisms/std-cicd-pipeline.orb +1367 -825
  127. package/behaviors/registry/organisms/std-cms.orb +1549 -566
  128. package/behaviors/registry/organisms/std-coding-academy.orb +744 -495
  129. package/behaviors/registry/organisms/std-crm.orb +1997 -1014
  130. package/behaviors/registry/organisms/std-devops-dashboard.orb +2160 -1606
  131. package/behaviors/registry/organisms/std-ecommerce.orb +2279 -1153
  132. package/behaviors/registry/organisms/std-finance-tracker.orb +1375 -727
  133. package/behaviors/registry/organisms/std-healthcare.orb +2940 -1703
  134. package/behaviors/registry/organisms/std-helpdesk.orb +1443 -781
  135. package/behaviors/registry/organisms/std-hr-portal.orb +2361 -1440
  136. package/behaviors/registry/organisms/std-iot-dashboard.orb +1491 -1026
  137. package/behaviors/registry/organisms/std-lms.orb +1629 -1046
  138. package/behaviors/registry/organisms/std-logic-training.orb +321 -134
  139. package/behaviors/registry/organisms/std-platformer-app.orb +855 -417
  140. package/behaviors/registry/organisms/std-project-manager.orb +1795 -877
  141. package/behaviors/registry/organisms/std-puzzle-app.orb +407 -206
  142. package/behaviors/registry/organisms/std-realtime-chat.orb +1436 -844
  143. package/behaviors/registry/organisms/std-rpg-game.orb +1522 -1007
  144. package/behaviors/registry/organisms/std-service-marketplace.orb +2110 -1204
  145. package/behaviors/registry/organisms/std-service-research-assistant.orb +1285 -1078
  146. package/behaviors/registry/organisms/std-social-feed.orb +612 -252
  147. package/behaviors/registry/organisms/std-stem-lab.orb +642 -450
  148. package/behaviors/registry/organisms/std-strategy-game.orb +893 -650
  149. package/behaviors/registry/organisms/std-trading-dashboard.orb +1271 -805
  150. package/dist/behaviors/registry/atoms/std-agent-activity-log.orb +240 -227
  151. package/dist/behaviors/registry/atoms/std-agent-chat-thread.orb +296 -199
  152. package/dist/behaviors/registry/atoms/std-agent-classifier.orb +384 -133
  153. package/dist/behaviors/registry/atoms/std-agent-completion.orb +404 -141
  154. package/dist/behaviors/registry/atoms/std-agent-context-window.orb +904 -607
  155. package/dist/behaviors/registry/atoms/std-agent-conversation.orb +443 -234
  156. package/dist/behaviors/registry/atoms/std-agent-memory.orb +584 -150
  157. package/dist/behaviors/registry/atoms/std-agent-provider.orb +431 -174
  158. package/dist/behaviors/registry/atoms/std-agent-search.orb +217 -61
  159. package/dist/behaviors/registry/atoms/std-agent-session.orb +406 -159
  160. package/dist/behaviors/registry/atoms/std-agent-step-progress.orb +314 -294
  161. package/dist/behaviors/registry/atoms/std-agent-token-gauge.orb +577 -500
  162. package/dist/behaviors/registry/atoms/std-agent-tool-call.orb +328 -138
  163. package/dist/behaviors/registry/atoms/std-async.orb +147 -86
  164. package/dist/behaviors/registry/atoms/std-autoregressive.orb +64 -73
  165. package/dist/behaviors/registry/atoms/std-browse.orb +260 -126
  166. package/dist/behaviors/registry/atoms/std-cache-aside.orb +358 -259
  167. package/dist/behaviors/registry/atoms/std-calendar.orb +280 -215
  168. package/dist/behaviors/registry/atoms/std-circuit-breaker.orb +295 -234
  169. package/dist/behaviors/registry/atoms/std-collision.orb +136 -135
  170. package/dist/behaviors/registry/atoms/std-combat-log.orb +108 -90
  171. package/dist/behaviors/registry/atoms/std-combat.orb +171 -98
  172. package/dist/behaviors/registry/atoms/std-confirmation.orb +28 -300
  173. package/dist/behaviors/registry/atoms/std-dialogue-box.orb +111 -30
  174. package/dist/behaviors/registry/atoms/std-display.orb +491 -587
  175. package/dist/behaviors/registry/atoms/std-drawer.orb +194 -121
  176. package/dist/behaviors/registry/atoms/std-filter.orb +311 -326
  177. package/dist/behaviors/registry/atoms/std-flip-card.orb +223 -177
  178. package/dist/behaviors/registry/atoms/std-gallery.orb +130 -151
  179. package/dist/behaviors/registry/atoms/std-game-audio.orb +133 -72
  180. package/dist/behaviors/registry/atoms/std-game-canvas2d.orb +112 -52
  181. package/dist/behaviors/registry/atoms/std-game-canvas3d.orb +150 -107
  182. package/dist/behaviors/registry/atoms/std-game-hud.orb +87 -20
  183. package/dist/behaviors/registry/atoms/std-game-menu.orb +32 -32
  184. package/dist/behaviors/registry/atoms/std-game-over-screen.orb +100 -33
  185. package/dist/behaviors/registry/atoms/std-gameflow.orb +147 -80
  186. package/dist/behaviors/registry/atoms/std-input.orb +128 -393
  187. package/dist/behaviors/registry/atoms/std-inventory-panel.orb +108 -71
  188. package/dist/behaviors/registry/atoms/std-isometric-canvas.orb +156 -407
  189. package/dist/behaviors/registry/atoms/std-loading.orb +127 -126
  190. package/dist/behaviors/registry/atoms/std-modal.orb +30 -267
  191. package/dist/behaviors/registry/atoms/std-movement.orb +391 -292
  192. package/dist/behaviors/registry/atoms/std-notification.orb +133 -75
  193. package/dist/behaviors/registry/atoms/std-overworld.orb +194 -121
  194. package/dist/behaviors/registry/atoms/std-pagination.orb +120 -53
  195. package/dist/behaviors/registry/atoms/std-physics2d.orb +94 -93
  196. package/dist/behaviors/registry/atoms/std-platformer-canvas.orb +110 -98
  197. package/dist/behaviors/registry/atoms/std-push.orb +172 -36
  198. package/dist/behaviors/registry/atoms/std-quest.orb +552 -449
  199. package/dist/behaviors/registry/atoms/std-rate-limiter.orb +242 -241
  200. package/dist/behaviors/registry/atoms/std-rating.orb +123 -65
  201. package/dist/behaviors/registry/atoms/std-related.orb +202 -26
  202. package/dist/behaviors/registry/atoms/std-score-board.orb +109 -28
  203. package/dist/behaviors/registry/atoms/std-score.orb +210 -146
  204. package/dist/behaviors/registry/atoms/std-search.orb +265 -138
  205. package/dist/behaviors/registry/atoms/std-selection.orb +311 -220
  206. package/dist/behaviors/registry/atoms/std-service-custom-bearer.orb +199 -110
  207. package/dist/behaviors/registry/atoms/std-service-custom-header.orb +206 -117
  208. package/dist/behaviors/registry/atoms/std-service-custom-noauth.orb +197 -108
  209. package/dist/behaviors/registry/atoms/std-service-custom-query.orb +193 -104
  210. package/dist/behaviors/registry/atoms/std-service-email.orb +195 -107
  211. package/dist/behaviors/registry/atoms/std-service-github.orb +216 -122
  212. package/dist/behaviors/registry/atoms/std-service-llm.orb +204 -122
  213. package/dist/behaviors/registry/atoms/std-service-oauth.orb +290 -204
  214. package/dist/behaviors/registry/atoms/std-service-redis.orb +177 -92
  215. package/dist/behaviors/registry/atoms/std-service-storage.orb +211 -122
  216. package/dist/behaviors/registry/atoms/std-service-stripe.orb +236 -154
  217. package/dist/behaviors/registry/atoms/std-service-twilio.orb +221 -137
  218. package/dist/behaviors/registry/atoms/std-service-youtube.orb +327 -241
  219. package/dist/behaviors/registry/atoms/std-simulation-canvas.orb +97 -36
  220. package/dist/behaviors/registry/atoms/std-sort.orb +284 -207
  221. package/dist/behaviors/registry/atoms/std-sprite.orb +150 -74
  222. package/dist/behaviors/registry/atoms/std-tabs.orb +129 -62
  223. package/dist/behaviors/registry/atoms/std-text-effects.orb +251 -190
  224. package/dist/behaviors/registry/atoms/std-theme.orb +193 -135
  225. package/dist/behaviors/registry/atoms/std-timer.orb +320 -344
  226. package/dist/behaviors/registry/atoms/std-undo.orb +278 -199
  227. package/dist/behaviors/registry/atoms/std-upload.orb +112 -111
  228. package/dist/behaviors/registry/atoms/std-validate-on-save.orb +159 -151
  229. package/dist/behaviors/registry/atoms/std-wizard.orb +445 -336
  230. package/dist/behaviors/registry/molecules/std-agent-fix-loop.orb +876 -857
  231. package/dist/behaviors/registry/molecules/std-agent-learner.orb +635 -654
  232. package/dist/behaviors/registry/molecules/std-agent-planner.orb +581 -548
  233. package/dist/behaviors/registry/molecules/std-agent-rag.orb +414 -410
  234. package/dist/behaviors/registry/molecules/std-agent-tool-loop.orb +716 -711
  235. package/dist/behaviors/registry/molecules/std-batch-selected-list.orb +28 -12
  236. package/dist/behaviors/registry/molecules/std-builder-game.orb +86 -28
  237. package/dist/behaviors/registry/molecules/std-calendar-booking.orb +32 -8
  238. package/dist/behaviors/registry/molecules/std-cart.orb +347 -406
  239. package/dist/behaviors/registry/molecules/std-classifier-game.orb +95 -37
  240. package/dist/behaviors/registry/molecules/std-dashboard-tabbed.orb +16 -10
  241. package/dist/behaviors/registry/molecules/std-debugger-game.orb +95 -37
  242. package/dist/behaviors/registry/molecules/std-detail.orb +133 -138
  243. package/dist/behaviors/registry/molecules/std-drawer-master-list.orb +12 -6
  244. package/dist/behaviors/registry/molecules/std-event-handler-game.orb +91 -33
  245. package/dist/behaviors/registry/molecules/std-filtered-list.orb +14 -8
  246. package/dist/behaviors/registry/molecules/std-form-advanced.orb +242 -153
  247. package/dist/behaviors/registry/molecules/std-gallery-filtered.orb +16 -10
  248. package/dist/behaviors/registry/molecules/std-geospatial.orb +175 -122
  249. package/dist/behaviors/registry/molecules/std-inventory.orb +216 -170
  250. package/dist/behaviors/registry/molecules/std-list.orb +280 -205
  251. package/dist/behaviors/registry/molecules/std-messaging.orb +146 -99
  252. package/dist/behaviors/registry/molecules/std-negotiator-game.orb +95 -37
  253. package/dist/behaviors/registry/molecules/std-platformer-game.orb +300 -171
  254. package/dist/behaviors/registry/molecules/std-push-activity-log.orb +32 -8
  255. package/dist/behaviors/registry/molecules/std-puzzle-game.orb +287 -146
  256. package/dist/behaviors/registry/molecules/std-quiz.orb +322 -263
  257. package/dist/behaviors/registry/molecules/std-related-master-detail.orb +21 -15
  258. package/dist/behaviors/registry/molecules/std-sequencer-game.orb +92 -34
  259. package/dist/behaviors/registry/molecules/std-service-content-pipeline.orb +268 -267
  260. package/dist/behaviors/registry/molecules/std-service-custom-api-tester.orb +245 -152
  261. package/dist/behaviors/registry/molecules/std-service-devops-toolkit.orb +633 -294
  262. package/dist/behaviors/registry/molecules/std-service-notification-hub.orb +237 -152
  263. package/dist/behaviors/registry/molecules/std-service-payment-flow.orb +310 -180
  264. package/dist/behaviors/registry/molecules/std-simulator-game.orb +96 -38
  265. package/dist/behaviors/registry/molecules/std-turn-based-battle.orb +247 -137
  266. package/dist/behaviors/registry/molecules/std-wizard-form.orb +60 -9
  267. package/dist/behaviors/registry/organisms/std-agent-assistant.orb +2810 -1833
  268. package/dist/behaviors/registry/organisms/std-agent-builder.orb +6401 -4539
  269. package/dist/behaviors/registry/organisms/std-agent-pipeline.orb +5028 -3497
  270. package/dist/behaviors/registry/organisms/std-agent-reviewer.orb +2219 -1406
  271. package/dist/behaviors/registry/organisms/std-agent-tutor.orb +2069 -1384
  272. package/dist/behaviors/registry/organisms/std-api-gateway.orb +1419 -870
  273. package/dist/behaviors/registry/organisms/std-arcade-game.orb +488 -231
  274. package/dist/behaviors/registry/organisms/std-booking-system.orb +2457 -1467
  275. package/dist/behaviors/registry/organisms/std-cicd-pipeline.orb +1367 -825
  276. package/dist/behaviors/registry/organisms/std-cms.orb +1549 -566
  277. package/dist/behaviors/registry/organisms/std-coding-academy.orb +744 -495
  278. package/dist/behaviors/registry/organisms/std-crm.orb +1997 -1014
  279. package/dist/behaviors/registry/organisms/std-devops-dashboard.orb +2160 -1606
  280. package/dist/behaviors/registry/organisms/std-ecommerce.orb +2279 -1153
  281. package/dist/behaviors/registry/organisms/std-finance-tracker.orb +1375 -727
  282. package/dist/behaviors/registry/organisms/std-healthcare.orb +2940 -1703
  283. package/dist/behaviors/registry/organisms/std-helpdesk.orb +1443 -781
  284. package/dist/behaviors/registry/organisms/std-hr-portal.orb +2361 -1440
  285. package/dist/behaviors/registry/organisms/std-iot-dashboard.orb +1491 -1026
  286. package/dist/behaviors/registry/organisms/std-lms.orb +1629 -1046
  287. package/dist/behaviors/registry/organisms/std-logic-training.orb +321 -134
  288. package/dist/behaviors/registry/organisms/std-platformer-app.orb +855 -417
  289. package/dist/behaviors/registry/organisms/std-project-manager.orb +1795 -877
  290. package/dist/behaviors/registry/organisms/std-puzzle-app.orb +407 -206
  291. package/dist/behaviors/registry/organisms/std-realtime-chat.orb +1436 -844
  292. package/dist/behaviors/registry/organisms/std-rpg-game.orb +1522 -1007
  293. package/dist/behaviors/registry/organisms/std-service-marketplace.orb +2110 -1204
  294. package/dist/behaviors/registry/organisms/std-service-research-assistant.orb +1285 -1078
  295. package/dist/behaviors/registry/organisms/std-social-feed.orb +612 -252
  296. package/dist/behaviors/registry/organisms/std-stem-lab.orb +642 -450
  297. package/dist/behaviors/registry/organisms/std-strategy-game.orb +893 -650
  298. package/dist/behaviors/registry/organisms/std-trading-dashboard.orb +1271 -805
  299. package/dist/index.js +16 -4
  300. package/dist/index.js.map +1 -1
  301. package/dist/modules/core.js +16 -4
  302. package/dist/modules/core.js.map +1 -1
  303. package/dist/modules/index.js +16 -4
  304. package/dist/modules/index.js.map +1 -1
  305. package/dist/registry.js +16 -4
  306. package/dist/registry.js.map +1 -1
  307. package/package.json +2 -2
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "std-agent-context-window",
3
3
  "version": "1.0.0",
4
- "description": "Context window management atom for agent token tracking. Composes UI atoms (stdAgentTokenGauge for visual display, stdNotification for threshold alerts) with an agent trait that handles agent/compact, agent/token-count, and agent/context-usage.",
4
+ "description": "std-agent-context-window as a Function",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "AgentContextWindowOrbital",
8
8
  "entity": {
9
9
  "name": "AgentContextWindow",
10
- "persistence": "persistent",
11
10
  "collection": "agentcontextwindows",
11
+ "persistence": "persistent",
12
12
  "fields": [
13
13
  {
14
14
  "name": "id",
@@ -39,17 +39,17 @@
39
39
  {
40
40
  "name": "tokenCount",
41
41
  "type": "number",
42
- "default": 0
42
+ "default": 0.0
43
43
  },
44
44
  {
45
45
  "name": "maxTokens",
46
46
  "type": "number",
47
- "default": 200000
47
+ "default": 200000.0
48
48
  },
49
49
  {
50
50
  "name": "usage",
51
51
  "type": "number",
52
- "default": 0
52
+ "default": 0.0
53
53
  },
54
54
  {
55
55
  "name": "lastCompactedAt",
@@ -59,12 +59,12 @@
59
59
  {
60
60
  "name": "current",
61
61
  "type": "number",
62
- "default": 0
62
+ "default": 0.0
63
63
  },
64
64
  {
65
65
  "name": "max",
66
66
  "type": "number",
67
- "default": 200000
67
+ "default": 200000.0
68
68
  },
69
69
  {
70
70
  "name": "threshold",
@@ -86,8 +86,84 @@
86
86
  "traits": [
87
87
  {
88
88
  "name": "AgentContextWindowGauge",
89
- "linkedEntity": "AgentContextWindow",
90
89
  "category": "interaction",
90
+ "linkedEntity": "AgentContextWindow",
91
+ "emits": [
92
+ {
93
+ "event": "AgentContextWindowLoaded",
94
+ "description": "Fired when AgentContextWindow finishes loading",
95
+ "scope": "internal",
96
+ "payload": [
97
+ {
98
+ "name": "id",
99
+ "type": "string"
100
+ },
101
+ {
102
+ "name": "name",
103
+ "type": "string"
104
+ },
105
+ {
106
+ "name": "description",
107
+ "type": "string"
108
+ },
109
+ {
110
+ "name": "status",
111
+ "type": "string"
112
+ },
113
+ {
114
+ "name": "createdAt",
115
+ "type": "string"
116
+ },
117
+ {
118
+ "name": "tokenCount",
119
+ "type": "number"
120
+ },
121
+ {
122
+ "name": "maxTokens",
123
+ "type": "number"
124
+ },
125
+ {
126
+ "name": "usage",
127
+ "type": "number"
128
+ },
129
+ {
130
+ "name": "lastCompactedAt",
131
+ "type": "string"
132
+ },
133
+ {
134
+ "name": "current",
135
+ "type": "number"
136
+ },
137
+ {
138
+ "name": "max",
139
+ "type": "number"
140
+ },
141
+ {
142
+ "name": "threshold",
143
+ "type": "number"
144
+ },
145
+ {
146
+ "name": "message",
147
+ "type": "string"
148
+ },
149
+ {
150
+ "name": "notificationType",
151
+ "type": "string"
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "event": "AgentContextWindowLoadFailed",
157
+ "description": "Fired when AgentContextWindow fails to load",
158
+ "scope": "internal",
159
+ "payload": [
160
+ {
161
+ "name": "message",
162
+ "type": "string"
163
+ }
164
+ ]
165
+ }
166
+ ],
91
167
  "stateMachine": {
92
168
  "states": [
93
169
  {
@@ -108,7 +184,7 @@
108
184
  },
109
185
  {
110
186
  "key": "UPDATE",
111
- "name": "Update Token Count",
187
+ "name": "Update",
112
188
  "payload": [
113
189
  {
114
190
  "name": "current",
@@ -119,11 +195,25 @@
119
195
  },
120
196
  {
121
197
  "key": "COMPACT",
122
- "name": "Compact Context"
198
+ "name": "Compact"
123
199
  },
124
200
  {
125
201
  "key": "RESET",
126
- "name": "Reset Gauge"
202
+ "name": "Reset"
203
+ },
204
+ {
205
+ "key": "AgentContextWindowLoaded",
206
+ "name": "AgentContextWindow loaded"
207
+ },
208
+ {
209
+ "key": "AgentContextWindowLoadFailed",
210
+ "name": "AgentContextWindow load failed",
211
+ "payload": [
212
+ {
213
+ "name": "message",
214
+ "type": "string"
215
+ }
216
+ ]
127
217
  }
128
218
  ],
129
219
  "transitions": [
@@ -134,51 +224,52 @@
134
224
  "effects": [
135
225
  [
136
226
  "fetch",
137
- "AgentContextWindow"
227
+ "AgentContextWindow",
228
+ {
229
+ "emit": {
230
+ "success": "AgentContextWindowLoaded",
231
+ "failure": "AgentContextWindowLoadFailed"
232
+ }
233
+ }
138
234
  ],
139
235
  [
140
236
  "render-ui",
141
237
  "main",
142
238
  {
143
- "type": "stack",
144
- "direction": "vertical",
145
239
  "gap": "lg",
146
240
  "children": [
147
241
  {
148
- "type": "stack",
149
- "direction": "horizontal",
150
242
  "gap": "sm",
243
+ "type": "stack",
151
244
  "align": "center",
152
245
  "children": [
153
246
  {
154
- "type": "icon",
155
247
  "name": "gauge",
156
- "size": "lg"
248
+ "size": "lg",
249
+ "type": "icon"
157
250
  },
158
251
  {
252
+ "variant": "h2",
159
253
  "type": "typography",
160
- "content": "Token Usage",
161
- "variant": "h2"
254
+ "content": "Token Usage"
162
255
  },
163
256
  {
164
257
  "type": "badge",
165
258
  "label": "Normal",
166
259
  "variant": "default"
167
260
  }
168
- ]
261
+ ],
262
+ "direction": "horizontal"
169
263
  },
170
264
  {
171
265
  "type": "divider"
172
266
  },
173
267
  {
174
- "type": "progress-bar",
175
268
  "value": "@entity.current",
269
+ "type": "progress-bar",
176
270
  "max": "@entity.max"
177
271
  },
178
272
  {
179
- "type": "stack",
180
- "direction": "horizontal",
181
- "gap": "md",
182
273
  "children": [
183
274
  {
184
275
  "type": "stat-display",
@@ -186,20 +277,25 @@
186
277
  "value": "@entity.current"
187
278
  },
188
279
  {
189
- "type": "stat-display",
280
+ "value": "@entity.max",
190
281
  "label": "Max Tokens",
191
- "value": "@entity.max"
282
+ "type": "stat-display"
192
283
  }
193
- ]
284
+ ],
285
+ "gap": "md",
286
+ "type": "stack",
287
+ "direction": "horizontal"
194
288
  },
195
289
  {
196
290
  "type": "button",
197
- "label": "Reset",
291
+ "icon": "rotate-ccw",
198
292
  "event": "RESET",
199
293
  "variant": "ghost",
200
- "icon": "rotate-ccw"
294
+ "label": "Reset"
201
295
  }
202
- ]
296
+ ],
297
+ "direction": "vertical",
298
+ "type": "stack"
203
299
  }
204
300
  ]
205
301
  ]
@@ -227,32 +323,29 @@
227
323
  "render-ui",
228
324
  "main",
229
325
  {
230
- "type": "stack",
231
- "direction": "vertical",
232
- "gap": "lg",
233
326
  "children": [
234
327
  {
328
+ "gap": "sm",
235
329
  "type": "stack",
236
330
  "direction": "horizontal",
237
- "gap": "sm",
238
- "align": "center",
239
331
  "children": [
240
332
  {
241
- "type": "icon",
242
333
  "name": "gauge",
243
- "size": "lg"
334
+ "size": "lg",
335
+ "type": "icon"
244
336
  },
245
337
  {
246
- "type": "typography",
338
+ "variant": "h2",
247
339
  "content": "Token Usage",
248
- "variant": "h2"
340
+ "type": "typography"
249
341
  },
250
342
  {
343
+ "variant": "default",
251
344
  "type": "badge",
252
- "label": "Normal",
253
- "variant": "default"
345
+ "label": "Normal"
254
346
  }
255
- ]
347
+ ],
348
+ "align": "center"
256
349
  },
257
350
  {
258
351
  "type": "divider"
@@ -281,12 +374,15 @@
281
374
  },
282
375
  {
283
376
  "type": "button",
284
- "label": "Reset",
285
- "event": "RESET",
377
+ "icon": "rotate-ccw",
286
378
  "variant": "ghost",
287
- "icon": "rotate-ccw"
379
+ "event": "RESET",
380
+ "label": "Reset"
288
381
  }
289
- ]
382
+ ],
383
+ "direction": "vertical",
384
+ "gap": "lg",
385
+ "type": "stack"
290
386
  }
291
387
  ]
292
388
  ]
@@ -327,19 +423,18 @@
327
423
  "main",
328
424
  {
329
425
  "type": "stack",
330
- "direction": "vertical",
331
426
  "gap": "lg",
427
+ "direction": "vertical",
332
428
  "children": [
333
429
  {
334
- "type": "stack",
335
430
  "direction": "horizontal",
336
- "gap": "sm",
337
431
  "align": "center",
432
+ "type": "stack",
338
433
  "children": [
339
434
  {
435
+ "size": "lg",
340
436
  "type": "icon",
341
- "name": "alert-triangle",
342
- "size": "lg"
437
+ "name": "alert-triangle"
343
438
  },
344
439
  {
345
440
  "type": "typography",
@@ -348,33 +443,34 @@
348
443
  },
349
444
  {
350
445
  "type": "badge",
351
- "label": "Warning",
352
- "variant": "warning"
446
+ "variant": "warning",
447
+ "label": "Warning"
353
448
  }
354
- ]
449
+ ],
450
+ "gap": "sm"
355
451
  },
356
452
  {
357
453
  "type": "divider"
358
454
  },
359
455
  {
360
- "type": "alert",
361
456
  "variant": "warning",
457
+ "type": "alert",
362
458
  "message": "Token usage approaching limit. Consider compacting."
363
459
  },
364
460
  {
365
461
  "type": "progress-bar",
366
- "value": "@entity.current",
367
- "max": "@entity.max"
462
+ "max": "@entity.max",
463
+ "value": "@entity.current"
368
464
  },
369
465
  {
466
+ "gap": "md",
370
467
  "type": "stack",
371
468
  "direction": "horizontal",
372
- "gap": "md",
373
469
  "children": [
374
470
  {
375
- "type": "stat-display",
471
+ "value": "@entity.current",
376
472
  "label": "Tokens Used",
377
- "value": "@entity.current"
473
+ "type": "stat-display"
378
474
  },
379
475
  {
380
476
  "type": "stat-display",
@@ -384,25 +480,25 @@
384
480
  ]
385
481
  },
386
482
  {
387
- "type": "stack",
388
483
  "direction": "horizontal",
389
- "gap": "sm",
390
484
  "children": [
391
485
  {
392
- "type": "button",
393
486
  "label": "Compact",
394
- "event": "COMPACT",
487
+ "icon": "minimize-2",
488
+ "type": "button",
395
489
  "variant": "primary",
396
- "icon": "minimize-2"
490
+ "event": "COMPACT"
397
491
  },
398
492
  {
493
+ "icon": "rotate-ccw",
399
494
  "type": "button",
400
- "label": "Reset",
401
- "event": "RESET",
402
495
  "variant": "ghost",
403
- "icon": "rotate-ccw"
496
+ "event": "RESET",
497
+ "label": "Reset"
404
498
  }
405
- ]
499
+ ],
500
+ "gap": "sm",
501
+ "type": "stack"
406
502
  }
407
503
  ]
408
504
  }
@@ -433,19 +529,15 @@
433
529
  "main",
434
530
  {
435
531
  "type": "stack",
436
- "direction": "vertical",
437
532
  "gap": "lg",
438
533
  "children": [
439
534
  {
440
- "type": "stack",
441
- "direction": "horizontal",
442
- "gap": "sm",
443
535
  "align": "center",
444
536
  "children": [
445
537
  {
446
538
  "type": "icon",
447
- "name": "alert-octagon",
448
- "size": "lg"
539
+ "size": "lg",
540
+ "name": "alert-octagon"
449
541
  },
450
542
  {
451
543
  "type": "typography",
@@ -454,17 +546,20 @@
454
546
  },
455
547
  {
456
548
  "type": "badge",
457
- "label": "Critical",
458
- "variant": "destructive"
549
+ "variant": "destructive",
550
+ "label": "Critical"
459
551
  }
460
- ]
552
+ ],
553
+ "type": "stack",
554
+ "gap": "sm",
555
+ "direction": "horizontal"
461
556
  },
462
557
  {
463
558
  "type": "divider"
464
559
  },
465
560
  {
466
- "type": "alert",
467
561
  "variant": "error",
562
+ "type": "alert",
468
563
  "message": "Token usage critical. Compact immediately to avoid truncation."
469
564
  },
470
565
  {
@@ -474,77 +569,63 @@
474
569
  },
475
570
  {
476
571
  "type": "stack",
477
- "direction": "horizontal",
478
- "gap": "md",
479
572
  "children": [
480
573
  {
481
- "type": "stat-display",
482
574
  "label": "Tokens Used",
483
- "value": "@entity.current"
575
+ "value": "@entity.current",
576
+ "type": "stat-display"
484
577
  },
485
578
  {
486
579
  "type": "stat-display",
487
580
  "label": "Max Tokens",
488
581
  "value": "@entity.max"
489
582
  }
490
- ]
583
+ ],
584
+ "gap": "md",
585
+ "direction": "horizontal"
491
586
  },
492
587
  {
493
- "type": "stack",
494
588
  "direction": "horizontal",
589
+ "type": "stack",
495
590
  "gap": "sm",
496
591
  "children": [
497
592
  {
498
- "type": "button",
499
- "label": "Compact Now",
500
593
  "event": "COMPACT",
501
594
  "variant": "primary",
595
+ "label": "Compact Now",
596
+ "type": "button",
502
597
  "icon": "minimize-2"
503
598
  },
504
599
  {
505
- "type": "button",
600
+ "icon": "rotate-ccw",
506
601
  "label": "Reset",
507
- "event": "RESET",
508
602
  "variant": "ghost",
509
- "icon": "rotate-ccw"
603
+ "event": "RESET",
604
+ "type": "button"
510
605
  }
511
606
  ]
512
607
  }
513
- ]
608
+ ],
609
+ "direction": "vertical"
514
610
  }
515
611
  ]
516
612
  ]
517
613
  },
518
614
  {
519
- "from": "warning",
520
- "to": "warning",
521
- "event": "UPDATE",
522
- "guard": [
523
- "and",
615
+ "from": "normal",
616
+ "to": "normal",
617
+ "event": "COMPACT",
618
+ "effects": [
524
619
  [
525
- ">=",
526
- [
527
- "/",
528
- "@payload.current",
529
- "@entity.max"
530
- ],
531
- 0.85
620
+ "agent/compact"
532
621
  ],
533
- [
534
- "<",
535
- [
536
- "/",
537
- "@payload.current",
538
- "@entity.max"
539
- ],
540
- 0.95
541
- ]
542
- ],
543
- "effects": [
544
622
  [
545
623
  "set",
546
- "@entity.current",
547
- "@payload.current"
624
+ "@entity.lastCompactedAt",
625
+ "@now"
626
+ ],
627
+ [
628
+ "agent/token-count"
548
629
  ],
549
630
  [
550
631
  "render-ui",
@@ -555,36 +636,31 @@
555
636
  "gap": "lg",
556
637
  "children": [
557
638
  {
558
- "type": "stack",
559
- "direction": "horizontal",
560
639
  "gap": "sm",
640
+ "direction": "horizontal",
641
+ "type": "stack",
561
642
  "align": "center",
562
643
  "children": [
563
644
  {
645
+ "size": "lg",
564
646
  "type": "icon",
565
- "name": "alert-triangle",
566
- "size": "lg"
647
+ "name": "gauge"
567
648
  },
568
649
  {
650
+ "variant": "h2",
569
651
  "type": "typography",
570
- "content": "Token Usage",
571
- "variant": "h2"
652
+ "content": "Token Usage"
572
653
  },
573
654
  {
574
655
  "type": "badge",
575
- "label": "Warning",
576
- "variant": "warning"
656
+ "label": "Normal",
657
+ "variant": "default"
577
658
  }
578
659
  ]
579
660
  },
580
661
  {
581
662
  "type": "divider"
582
663
  },
583
- {
584
- "type": "alert",
585
- "variant": "warning",
586
- "message": "Token usage approaching limit. Consider compacting."
587
- },
588
664
  {
589
665
  "type": "progress-bar",
590
666
  "value": "@entity.current",
@@ -601,32 +677,18 @@
601
677
  "value": "@entity.current"
602
678
  },
603
679
  {
604
- "type": "stat-display",
680
+ "value": "@entity.max",
605
681
  "label": "Max Tokens",
606
- "value": "@entity.max"
682
+ "type": "stat-display"
607
683
  }
608
684
  ]
609
685
  },
610
686
  {
611
- "type": "stack",
612
- "direction": "horizontal",
613
- "gap": "sm",
614
- "children": [
615
- {
616
- "type": "button",
617
- "label": "Compact",
618
- "event": "COMPACT",
619
- "variant": "primary",
620
- "icon": "minimize-2"
621
- },
622
- {
623
- "type": "button",
624
- "label": "Reset",
625
- "event": "RESET",
626
- "variant": "ghost",
627
- "icon": "rotate-ccw"
628
- }
629
- ]
687
+ "event": "RESET",
688
+ "label": "Reset",
689
+ "type": "button",
690
+ "icon": "rotate-ccw",
691
+ "variant": "ghost"
630
692
  }
631
693
  ]
632
694
  }
@@ -634,52 +696,41 @@
634
696
  ]
635
697
  },
636
698
  {
637
- "from": "warning",
638
- "to": "critical",
639
- "event": "UPDATE",
640
- "guard": [
641
- ">=",
642
- [
643
- "/",
644
- "@payload.current",
645
- "@entity.max"
646
- ],
647
- 0.95
648
- ],
699
+ "from": "normal",
700
+ "to": "normal",
701
+ "event": "RESET",
649
702
  "effects": [
650
703
  [
651
704
  "set",
652
705
  "@entity.current",
653
- "@payload.current"
706
+ 0.0
654
707
  ],
655
708
  [
656
709
  "render-ui",
657
710
  "main",
658
711
  {
659
- "type": "stack",
660
712
  "direction": "vertical",
661
- "gap": "lg",
662
713
  "children": [
663
714
  {
715
+ "align": "center",
664
716
  "type": "stack",
665
717
  "direction": "horizontal",
666
718
  "gap": "sm",
667
- "align": "center",
668
719
  "children": [
669
720
  {
721
+ "name": "gauge",
670
722
  "type": "icon",
671
- "name": "alert-octagon",
672
723
  "size": "lg"
673
724
  },
674
725
  {
726
+ "variant": "h2",
675
727
  "type": "typography",
676
- "content": "Token Usage",
677
- "variant": "h2"
728
+ "content": "Token Usage"
678
729
  },
679
730
  {
731
+ "label": "Normal",
680
732
  "type": "badge",
681
- "label": "Critical",
682
- "variant": "destructive"
733
+ "variant": "default"
683
734
  }
684
735
  ]
685
736
  },
@@ -687,70 +738,65 @@
687
738
  "type": "divider"
688
739
  },
689
740
  {
690
- "type": "alert",
691
- "variant": "error",
692
- "message": "Token usage critical. Compact immediately to avoid truncation."
693
- },
694
- {
695
- "type": "progress-bar",
696
741
  "value": "@entity.current",
742
+ "type": "progress-bar",
697
743
  "max": "@entity.max"
698
744
  },
699
745
  {
700
- "type": "stack",
701
- "direction": "horizontal",
702
- "gap": "md",
703
746
  "children": [
704
747
  {
705
- "type": "stat-display",
706
748
  "label": "Tokens Used",
707
- "value": "@entity.current"
749
+ "value": "@entity.current",
750
+ "type": "stat-display"
708
751
  },
709
752
  {
753
+ "value": "@entity.max",
710
754
  "type": "stat-display",
711
- "label": "Max Tokens",
712
- "value": "@entity.max"
755
+ "label": "Max Tokens"
713
756
  }
714
- ]
757
+ ],
758
+ "gap": "md",
759
+ "direction": "horizontal",
760
+ "type": "stack"
715
761
  },
716
762
  {
717
- "type": "stack",
718
- "direction": "horizontal",
719
- "gap": "sm",
720
- "children": [
721
- {
722
- "type": "button",
723
- "label": "Compact Now",
724
- "event": "COMPACT",
725
- "variant": "primary",
726
- "icon": "minimize-2"
727
- },
728
- {
729
- "type": "button",
730
- "label": "Reset",
731
- "event": "RESET",
732
- "variant": "ghost",
733
- "icon": "rotate-ccw"
734
- }
735
- ]
763
+ "icon": "rotate-ccw",
764
+ "event": "RESET",
765
+ "variant": "ghost",
766
+ "type": "button",
767
+ "label": "Reset"
736
768
  }
737
- ]
769
+ ],
770
+ "type": "stack",
771
+ "gap": "lg"
738
772
  }
739
773
  ]
740
774
  ]
741
775
  },
742
776
  {
743
777
  "from": "warning",
744
- "to": "normal",
778
+ "to": "warning",
745
779
  "event": "UPDATE",
746
780
  "guard": [
747
- "<",
781
+ "and",
748
782
  [
749
- "/",
750
- "@payload.current",
751
- "@entity.max"
783
+ ">=",
784
+ [
785
+ "/",
786
+ "@payload.current",
787
+ "@entity.max"
788
+ ],
789
+ 0.85
752
790
  ],
753
- 0.85
791
+ [
792
+ "<",
793
+ [
794
+ "/",
795
+ "@payload.current",
796
+ "@entity.max"
797
+ ],
798
+ 0.95
799
+ ]
754
800
  ],
755
801
  "effects": [
756
802
  [
@@ -762,64 +808,83 @@
762
808
  "render-ui",
763
809
  "main",
764
810
  {
765
- "type": "stack",
766
811
  "direction": "vertical",
767
812
  "gap": "lg",
813
+ "type": "stack",
768
814
  "children": [
769
815
  {
770
816
  "type": "stack",
771
817
  "direction": "horizontal",
772
818
  "gap": "sm",
773
- "align": "center",
774
819
  "children": [
775
820
  {
776
821
  "type": "icon",
777
- "name": "gauge",
822
+ "name": "alert-triangle",
778
823
  "size": "lg"
779
824
  },
780
825
  {
781
- "type": "typography",
782
826
  "content": "Token Usage",
783
- "variant": "h2"
827
+ "variant": "h2",
828
+ "type": "typography"
784
829
  },
785
830
  {
786
- "type": "badge",
787
- "label": "Normal",
788
- "variant": "default"
831
+ "variant": "warning",
832
+ "label": "Warning",
833
+ "type": "badge"
789
834
  }
790
- ]
835
+ ],
836
+ "align": "center"
791
837
  },
792
838
  {
793
839
  "type": "divider"
794
840
  },
795
841
  {
796
- "type": "progress-bar",
842
+ "variant": "warning",
843
+ "type": "alert",
844
+ "message": "Token usage approaching limit. Consider compacting."
845
+ },
846
+ {
797
847
  "value": "@entity.current",
798
- "max": "@entity.max"
848
+ "max": "@entity.max",
849
+ "type": "progress-bar"
799
850
  },
800
851
  {
801
- "type": "stack",
802
852
  "direction": "horizontal",
803
- "gap": "md",
804
853
  "children": [
805
854
  {
806
- "type": "stat-display",
807
855
  "label": "Tokens Used",
808
- "value": "@entity.current"
856
+ "value": "@entity.current",
857
+ "type": "stat-display"
809
858
  },
810
859
  {
811
- "type": "stat-display",
812
860
  "label": "Max Tokens",
813
- "value": "@entity.max"
861
+ "value": "@entity.max",
862
+ "type": "stat-display"
814
863
  }
815
- ]
864
+ ],
865
+ "type": "stack",
866
+ "gap": "md"
816
867
  },
817
868
  {
818
- "type": "button",
819
- "label": "Reset",
820
- "event": "RESET",
821
- "variant": "ghost",
822
- "icon": "rotate-ccw"
869
+ "children": [
870
+ {
871
+ "icon": "minimize-2",
872
+ "label": "Compact",
873
+ "type": "button",
874
+ "event": "COMPACT",
875
+ "variant": "primary"
876
+ },
877
+ {
878
+ "icon": "rotate-ccw",
879
+ "event": "RESET",
880
+ "label": "Reset",
881
+ "type": "button",
882
+ "variant": "ghost"
883
+ }
884
+ ],
885
+ "direction": "horizontal",
886
+ "gap": "sm",
887
+ "type": "stack"
823
888
  }
824
889
  ]
825
890
  }
@@ -827,7 +892,7 @@
827
892
  ]
828
893
  },
829
894
  {
830
- "from": "critical",
895
+ "from": "warning",
831
896
  "to": "critical",
832
897
  "event": "UPDATE",
833
898
  "guard": [
@@ -849,113 +914,101 @@
849
914
  "render-ui",
850
915
  "main",
851
916
  {
852
- "type": "stack",
853
- "direction": "vertical",
854
- "gap": "lg",
855
917
  "children": [
856
918
  {
857
919
  "type": "stack",
858
- "direction": "horizontal",
859
920
  "gap": "sm",
860
- "align": "center",
921
+ "direction": "horizontal",
861
922
  "children": [
862
923
  {
863
924
  "type": "icon",
864
- "name": "alert-octagon",
865
- "size": "lg"
925
+ "size": "lg",
926
+ "name": "alert-octagon"
866
927
  },
867
928
  {
868
- "type": "typography",
869
929
  "content": "Token Usage",
870
- "variant": "h2"
930
+ "variant": "h2",
931
+ "type": "typography"
871
932
  },
872
933
  {
873
934
  "type": "badge",
874
- "label": "Critical",
875
- "variant": "destructive"
935
+ "variant": "destructive",
936
+ "label": "Critical"
876
937
  }
877
- ]
938
+ ],
939
+ "align": "center"
878
940
  },
879
941
  {
880
942
  "type": "divider"
881
943
  },
882
944
  {
883
- "type": "alert",
884
945
  "variant": "error",
885
- "message": "Token usage critical. Compact immediately to avoid truncation."
946
+ "message": "Token usage critical. Compact immediately to avoid truncation.",
947
+ "type": "alert"
886
948
  },
887
949
  {
888
- "type": "progress-bar",
889
950
  "value": "@entity.current",
890
- "max": "@entity.max"
951
+ "max": "@entity.max",
952
+ "type": "progress-bar"
891
953
  },
892
954
  {
893
- "type": "stack",
894
- "direction": "horizontal",
895
955
  "gap": "md",
956
+ "type": "stack",
896
957
  "children": [
897
958
  {
898
959
  "type": "stat-display",
899
- "label": "Tokens Used",
900
- "value": "@entity.current"
960
+ "value": "@entity.current",
961
+ "label": "Tokens Used"
901
962
  },
902
963
  {
903
- "type": "stat-display",
904
964
  "label": "Max Tokens",
905
- "value": "@entity.max"
965
+ "value": "@entity.max",
966
+ "type": "stat-display"
906
967
  }
907
- ]
968
+ ],
969
+ "direction": "horizontal"
908
970
  },
909
971
  {
972
+ "gap": "sm",
910
973
  "type": "stack",
911
974
  "direction": "horizontal",
912
- "gap": "sm",
913
975
  "children": [
914
976
  {
915
- "type": "button",
916
- "label": "Compact Now",
917
977
  "event": "COMPACT",
978
+ "type": "button",
918
979
  "variant": "primary",
919
- "icon": "minimize-2"
980
+ "icon": "minimize-2",
981
+ "label": "Compact Now"
920
982
  },
921
983
  {
922
984
  "type": "button",
985
+ "icon": "rotate-ccw",
923
986
  "label": "Reset",
924
987
  "event": "RESET",
925
- "variant": "ghost",
926
- "icon": "rotate-ccw"
988
+ "variant": "ghost"
927
989
  }
928
990
  ]
929
991
  }
930
- ]
992
+ ],
993
+ "type": "stack",
994
+ "gap": "lg",
995
+ "direction": "vertical"
931
996
  }
932
997
  ]
933
998
  ]
934
999
  },
935
1000
  {
936
- "from": "critical",
937
- "to": "warning",
1001
+ "from": "warning",
1002
+ "to": "normal",
938
1003
  "event": "UPDATE",
939
1004
  "guard": [
940
- "and",
1005
+ "<",
941
1006
  [
942
- ">=",
943
- [
944
- "/",
945
- "@payload.current",
946
- "@entity.max"
947
- ],
948
- 0.85
1007
+ "/",
1008
+ "@payload.current",
1009
+ "@entity.max"
949
1010
  ],
950
- [
951
- "<",
952
- [
953
- "/",
954
- "@payload.current",
955
- "@entity.max"
956
- ],
957
- 0.95
958
- ]
1011
+ 0.85
959
1012
  ],
960
1013
  "effects": [
961
1014
  [
@@ -968,229 +1021,201 @@
968
1021
  "main",
969
1022
  {
970
1023
  "type": "stack",
971
- "direction": "vertical",
972
1024
  "gap": "lg",
973
1025
  "children": [
974
1026
  {
975
- "type": "stack",
976
1027
  "direction": "horizontal",
977
- "gap": "sm",
978
1028
  "align": "center",
979
1029
  "children": [
980
1030
  {
981
1031
  "type": "icon",
982
- "name": "alert-triangle",
983
- "size": "lg"
1032
+ "size": "lg",
1033
+ "name": "gauge"
984
1034
  },
985
1035
  {
986
- "type": "typography",
987
1036
  "content": "Token Usage",
1037
+ "type": "typography",
988
1038
  "variant": "h2"
989
1039
  },
990
1040
  {
1041
+ "variant": "default",
991
1042
  "type": "badge",
992
- "label": "Warning",
993
- "variant": "warning"
1043
+ "label": "Normal"
994
1044
  }
995
- ]
1045
+ ],
1046
+ "gap": "sm",
1047
+ "type": "stack"
996
1048
  },
997
1049
  {
998
1050
  "type": "divider"
999
1051
  },
1000
1052
  {
1001
- "type": "alert",
1002
- "variant": "warning",
1003
- "message": "Token usage approaching limit. Consider compacting."
1004
- },
1005
- {
1006
- "type": "progress-bar",
1007
1053
  "value": "@entity.current",
1008
- "max": "@entity.max"
1054
+ "max": "@entity.max",
1055
+ "type": "progress-bar"
1009
1056
  },
1010
1057
  {
1011
- "type": "stack",
1012
- "direction": "horizontal",
1013
- "gap": "md",
1014
1058
  "children": [
1015
1059
  {
1016
- "type": "stat-display",
1060
+ "value": "@entity.current",
1017
1061
  "label": "Tokens Used",
1018
- "value": "@entity.current"
1062
+ "type": "stat-display"
1019
1063
  },
1020
1064
  {
1021
1065
  "type": "stat-display",
1022
1066
  "label": "Max Tokens",
1023
1067
  "value": "@entity.max"
1024
1068
  }
1025
- ]
1069
+ ],
1070
+ "gap": "md",
1071
+ "type": "stack",
1072
+ "direction": "horizontal"
1026
1073
  },
1027
1074
  {
1028
- "type": "stack",
1029
- "direction": "horizontal",
1030
- "gap": "sm",
1031
- "children": [
1032
- {
1033
- "type": "button",
1034
- "label": "Compact",
1035
- "event": "COMPACT",
1036
- "variant": "primary",
1037
- "icon": "minimize-2"
1038
- },
1039
- {
1040
- "type": "button",
1041
- "label": "Reset",
1042
- "event": "RESET",
1043
- "variant": "ghost",
1044
- "icon": "rotate-ccw"
1045
- }
1046
- ]
1075
+ "type": "button",
1076
+ "event": "RESET",
1077
+ "variant": "ghost",
1078
+ "icon": "rotate-ccw",
1079
+ "label": "Reset"
1047
1080
  }
1048
- ]
1081
+ ],
1082
+ "direction": "vertical"
1049
1083
  }
1050
1084
  ]
1051
1085
  ]
1052
1086
  },
1053
1087
  {
1054
- "from": "critical",
1088
+ "from": "warning",
1055
1089
  "to": "normal",
1056
- "event": "UPDATE",
1057
- "guard": [
1058
- "<",
1090
+ "event": "COMPACT",
1091
+ "effects": [
1059
1092
  [
1060
- "/",
1061
- "@payload.current",
1062
- "@entity.max"
1093
+ "agent/compact"
1063
1094
  ],
1064
- 0.85
1065
- ],
1066
- "effects": [
1067
1095
  [
1068
1096
  "set",
1069
- "@entity.current",
1070
- "@payload.current"
1097
+ "@entity.lastCompactedAt",
1098
+ "@now"
1099
+ ],
1100
+ [
1101
+ "agent/token-count"
1071
1102
  ],
1072
1103
  [
1073
1104
  "render-ui",
1074
1105
  "main",
1075
1106
  {
1076
- "type": "stack",
1077
1107
  "direction": "vertical",
1078
1108
  "gap": "lg",
1079
1109
  "children": [
1080
1110
  {
1081
- "type": "stack",
1082
- "direction": "horizontal",
1083
- "gap": "sm",
1084
- "align": "center",
1085
1111
  "children": [
1086
1112
  {
1087
- "type": "icon",
1088
1113
  "name": "gauge",
1114
+ "type": "icon",
1089
1115
  "size": "lg"
1090
1116
  },
1091
1117
  {
1118
+ "variant": "h2",
1092
1119
  "type": "typography",
1093
- "content": "Token Usage",
1094
- "variant": "h2"
1120
+ "content": "Token Usage"
1095
1121
  },
1096
1122
  {
1097
- "type": "badge",
1098
1123
  "label": "Normal",
1124
+ "type": "badge",
1099
1125
  "variant": "default"
1100
1126
  }
1101
- ]
1127
+ ],
1128
+ "direction": "horizontal",
1129
+ "gap": "sm",
1130
+ "type": "stack",
1131
+ "align": "center"
1102
1132
  },
1103
1133
  {
1104
1134
  "type": "divider"
1105
1135
  },
1106
1136
  {
1107
1137
  "type": "progress-bar",
1108
- "value": "@entity.current",
1109
- "max": "@entity.max"
1138
+ "max": "@entity.max",
1139
+ "value": "@entity.current"
1110
1140
  },
1111
1141
  {
1112
- "type": "stack",
1113
1142
  "direction": "horizontal",
1114
1143
  "gap": "md",
1115
1144
  "children": [
1116
1145
  {
1146
+ "value": "@entity.current",
1117
1147
  "type": "stat-display",
1118
- "label": "Tokens Used",
1119
- "value": "@entity.current"
1148
+ "label": "Tokens Used"
1120
1149
  },
1121
1150
  {
1122
- "type": "stat-display",
1123
1151
  "label": "Max Tokens",
1152
+ "type": "stat-display",
1124
1153
  "value": "@entity.max"
1125
1154
  }
1126
- ]
1155
+ ],
1156
+ "type": "stack"
1127
1157
  },
1128
1158
  {
1129
- "type": "button",
1130
- "label": "Reset",
1131
1159
  "event": "RESET",
1132
1160
  "variant": "ghost",
1133
- "icon": "rotate-ccw"
1161
+ "label": "Reset",
1162
+ "icon": "rotate-ccw",
1163
+ "type": "button"
1134
1164
  }
1135
- ]
1165
+ ],
1166
+ "type": "stack"
1136
1167
  }
1137
1168
  ]
1138
1169
  ]
1139
1170
  },
1140
1171
  {
1141
- "from": "normal",
1172
+ "from": "warning",
1142
1173
  "to": "normal",
1143
- "event": "COMPACT",
1174
+ "event": "RESET",
1144
1175
  "effects": [
1145
- [
1146
- "agent/compact"
1147
- ],
1148
1176
  [
1149
1177
  "set",
1150
- "@entity.lastCompactedAt",
1151
- "@now"
1152
- ],
1153
- [
1154
- "agent/token-count"
1178
+ "@entity.current",
1179
+ 0.0
1155
1180
  ],
1156
1181
  [
1157
1182
  "render-ui",
1158
1183
  "main",
1159
1184
  {
1160
- "type": "stack",
1161
1185
  "direction": "vertical",
1162
1186
  "gap": "lg",
1187
+ "type": "stack",
1163
1188
  "children": [
1164
1189
  {
1165
- "type": "stack",
1166
- "direction": "horizontal",
1167
- "gap": "sm",
1168
- "align": "center",
1169
1190
  "children": [
1170
1191
  {
1171
- "type": "icon",
1172
1192
  "name": "gauge",
1173
- "size": "lg"
1193
+ "size": "lg",
1194
+ "type": "icon"
1174
1195
  },
1175
1196
  {
1176
- "type": "typography",
1197
+ "variant": "h2",
1177
1198
  "content": "Token Usage",
1178
- "variant": "h2"
1199
+ "type": "typography"
1179
1200
  },
1180
1201
  {
1181
1202
  "type": "badge",
1182
1203
  "label": "Normal",
1183
1204
  "variant": "default"
1184
1205
  }
1185
- ]
1206
+ ],
1207
+ "direction": "horizontal",
1208
+ "type": "stack",
1209
+ "gap": "sm",
1210
+ "align": "center"
1186
1211
  },
1187
1212
  {
1188
1213
  "type": "divider"
1189
1214
  },
1190
1215
  {
1191
- "type": "progress-bar",
1192
1216
  "value": "@entity.current",
1193
- "max": "@entity.max"
1217
+ "max": "@entity.max",
1218
+ "type": "progress-bar"
1194
1219
  },
1195
1220
  {
1196
1221
  "type": "stack",
@@ -1203,18 +1228,18 @@
1203
1228
  "value": "@entity.current"
1204
1229
  },
1205
1230
  {
1231
+ "value": "@entity.max",
1206
1232
  "type": "stat-display",
1207
- "label": "Max Tokens",
1208
- "value": "@entity.max"
1233
+ "label": "Max Tokens"
1209
1234
  }
1210
1235
  ]
1211
1236
  },
1212
1237
  {
1213
- "type": "button",
1214
- "label": "Reset",
1215
1238
  "event": "RESET",
1239
+ "type": "button",
1216
1240
  "variant": "ghost",
1217
- "icon": "rotate-ccw"
1241
+ "icon": "rotate-ccw",
1242
+ "label": "Reset"
1218
1243
  }
1219
1244
  ]
1220
1245
  }
@@ -1222,39 +1247,39 @@
1222
1247
  ]
1223
1248
  },
1224
1249
  {
1225
- "from": "warning",
1226
- "to": "normal",
1227
- "event": "COMPACT",
1228
- "effects": [
1250
+ "from": "critical",
1251
+ "to": "critical",
1252
+ "event": "UPDATE",
1253
+ "guard": [
1254
+ ">=",
1229
1255
  [
1230
- "agent/compact"
1256
+ "/",
1257
+ "@payload.current",
1258
+ "@entity.max"
1231
1259
  ],
1260
+ 0.95
1261
+ ],
1262
+ "effects": [
1232
1263
  [
1233
1264
  "set",
1234
- "@entity.lastCompactedAt",
1235
- "@now"
1236
- ],
1237
- [
1238
- "agent/token-count"
1265
+ "@entity.current",
1266
+ "@payload.current"
1239
1267
  ],
1240
1268
  [
1241
1269
  "render-ui",
1242
1270
  "main",
1243
1271
  {
1244
- "type": "stack",
1245
1272
  "direction": "vertical",
1273
+ "type": "stack",
1246
1274
  "gap": "lg",
1247
1275
  "children": [
1248
1276
  {
1249
- "type": "stack",
1250
- "direction": "horizontal",
1251
- "gap": "sm",
1252
1277
  "align": "center",
1253
1278
  "children": [
1254
1279
  {
1255
- "type": "icon",
1256
- "name": "gauge",
1257
- "size": "lg"
1280
+ "name": "alert-octagon",
1281
+ "size": "lg",
1282
+ "type": "icon"
1258
1283
  },
1259
1284
  {
1260
1285
  "type": "typography",
@@ -1262,43 +1287,65 @@
1262
1287
  "variant": "h2"
1263
1288
  },
1264
1289
  {
1265
- "type": "badge",
1266
- "label": "Normal",
1267
- "variant": "default"
1290
+ "label": "Critical",
1291
+ "variant": "destructive",
1292
+ "type": "badge"
1268
1293
  }
1269
- ]
1294
+ ],
1295
+ "gap": "sm",
1296
+ "type": "stack",
1297
+ "direction": "horizontal"
1270
1298
  },
1271
1299
  {
1272
1300
  "type": "divider"
1273
1301
  },
1274
1302
  {
1275
- "type": "progress-bar",
1303
+ "variant": "error",
1304
+ "type": "alert",
1305
+ "message": "Token usage critical. Compact immediately to avoid truncation."
1306
+ },
1307
+ {
1276
1308
  "value": "@entity.current",
1277
- "max": "@entity.max"
1309
+ "max": "@entity.max",
1310
+ "type": "progress-bar"
1278
1311
  },
1279
1312
  {
1280
- "type": "stack",
1281
- "direction": "horizontal",
1282
- "gap": "md",
1283
1313
  "children": [
1284
1314
  {
1315
+ "value": "@entity.current",
1285
1316
  "type": "stat-display",
1286
- "label": "Tokens Used",
1287
- "value": "@entity.current"
1317
+ "label": "Tokens Used"
1288
1318
  },
1289
1319
  {
1290
- "type": "stat-display",
1291
1320
  "label": "Max Tokens",
1292
- "value": "@entity.max"
1321
+ "value": "@entity.max",
1322
+ "type": "stat-display"
1293
1323
  }
1294
- ]
1324
+ ],
1325
+ "gap": "md",
1326
+ "type": "stack",
1327
+ "direction": "horizontal"
1295
1328
  },
1296
1329
  {
1297
- "type": "button",
1298
- "label": "Reset",
1299
- "event": "RESET",
1300
- "variant": "ghost",
1301
- "icon": "rotate-ccw"
1330
+ "direction": "horizontal",
1331
+ "type": "stack",
1332
+ "children": [
1333
+ {
1334
+ "type": "button",
1335
+ "label": "Compact Now",
1336
+ "event": "COMPACT",
1337
+ "variant": "primary",
1338
+ "icon": "minimize-2"
1339
+ },
1340
+ {
1341
+ "event": "RESET",
1342
+ "label": "Reset",
1343
+ "type": "button",
1344
+ "variant": "ghost",
1345
+ "icon": "rotate-ccw"
1346
+ }
1347
+ ],
1348
+ "gap": "sm"
1302
1349
  }
1303
1350
  ]
1304
1351
  }
@@ -1307,82 +1354,116 @@
1307
1354
  },
1308
1355
  {
1309
1356
  "from": "critical",
1310
- "to": "normal",
1311
- "event": "COMPACT",
1312
- "effects": [
1357
+ "to": "warning",
1358
+ "event": "UPDATE",
1359
+ "guard": [
1360
+ "and",
1313
1361
  [
1314
- "agent/compact"
1362
+ ">=",
1363
+ [
1364
+ "/",
1365
+ "@payload.current",
1366
+ "@entity.max"
1367
+ ],
1368
+ 0.85
1315
1369
  ],
1316
1370
  [
1317
- "set",
1318
- "@entity.lastCompactedAt",
1319
- "@now"
1320
- ],
1371
+ "<",
1372
+ [
1373
+ "/",
1374
+ "@payload.current",
1375
+ "@entity.max"
1376
+ ],
1377
+ 0.95
1378
+ ]
1379
+ ],
1380
+ "effects": [
1321
1381
  [
1322
- "agent/token-count"
1382
+ "set",
1383
+ "@entity.current",
1384
+ "@payload.current"
1323
1385
  ],
1324
1386
  [
1325
1387
  "render-ui",
1326
1388
  "main",
1327
1389
  {
1328
1390
  "type": "stack",
1329
- "direction": "vertical",
1330
1391
  "gap": "lg",
1392
+ "direction": "vertical",
1331
1393
  "children": [
1332
1394
  {
1333
- "type": "stack",
1334
1395
  "direction": "horizontal",
1335
- "gap": "sm",
1336
1396
  "align": "center",
1397
+ "gap": "sm",
1398
+ "type": "stack",
1337
1399
  "children": [
1338
1400
  {
1339
1401
  "type": "icon",
1340
- "name": "gauge",
1341
- "size": "lg"
1402
+ "size": "lg",
1403
+ "name": "alert-triangle"
1342
1404
  },
1343
1405
  {
1344
- "type": "typography",
1345
1406
  "content": "Token Usage",
1407
+ "type": "typography",
1346
1408
  "variant": "h2"
1347
1409
  },
1348
1410
  {
1411
+ "variant": "warning",
1349
1412
  "type": "badge",
1350
- "label": "Normal",
1351
- "variant": "default"
1413
+ "label": "Warning"
1352
1414
  }
1353
1415
  ]
1354
1416
  },
1355
1417
  {
1356
1418
  "type": "divider"
1357
1419
  },
1420
+ {
1421
+ "message": "Token usage approaching limit. Consider compacting.",
1422
+ "variant": "warning",
1423
+ "type": "alert"
1424
+ },
1358
1425
  {
1359
1426
  "type": "progress-bar",
1360
1427
  "value": "@entity.current",
1361
1428
  "max": "@entity.max"
1362
1429
  },
1363
1430
  {
1364
- "type": "stack",
1365
- "direction": "horizontal",
1366
- "gap": "md",
1367
1431
  "children": [
1368
1432
  {
1433
+ "value": "@entity.current",
1369
1434
  "type": "stat-display",
1370
- "label": "Tokens Used",
1371
- "value": "@entity.current"
1435
+ "label": "Tokens Used"
1372
1436
  },
1373
1437
  {
1374
- "type": "stat-display",
1375
1438
  "label": "Max Tokens",
1439
+ "type": "stat-display",
1376
1440
  "value": "@entity.max"
1377
1441
  }
1378
- ]
1442
+ ],
1443
+ "direction": "horizontal",
1444
+ "type": "stack",
1445
+ "gap": "md"
1379
1446
  },
1380
1447
  {
1381
- "type": "button",
1382
- "label": "Reset",
1383
- "event": "RESET",
1384
- "variant": "ghost",
1385
- "icon": "rotate-ccw"
1448
+ "direction": "horizontal",
1449
+ "type": "stack",
1450
+ "gap": "sm",
1451
+ "children": [
1452
+ {
1453
+ "variant": "primary",
1454
+ "label": "Compact",
1455
+ "type": "button",
1456
+ "event": "COMPACT",
1457
+ "icon": "minimize-2"
1458
+ },
1459
+ {
1460
+ "event": "RESET",
1461
+ "label": "Reset",
1462
+ "type": "button",
1463
+ "variant": "ghost",
1464
+ "icon": "rotate-ccw"
1465
+ }
1466
+ ]
1386
1467
  }
1387
1468
  ]
1388
1469
  }
@@ -1390,62 +1471,67 @@
1390
1471
  ]
1391
1472
  },
1392
1473
  {
1393
- "from": "normal",
1474
+ "from": "critical",
1394
1475
  "to": "normal",
1395
- "event": "RESET",
1476
+ "event": "UPDATE",
1477
+ "guard": [
1478
+ "<",
1479
+ [
1480
+ "/",
1481
+ "@payload.current",
1482
+ "@entity.max"
1483
+ ],
1484
+ 0.85
1485
+ ],
1396
1486
  "effects": [
1397
1487
  [
1398
1488
  "set",
1399
1489
  "@entity.current",
1400
- 0
1490
+ "@payload.current"
1401
1491
  ],
1402
1492
  [
1403
1493
  "render-ui",
1404
1494
  "main",
1405
1495
  {
1406
- "type": "stack",
1407
- "direction": "vertical",
1408
- "gap": "lg",
1409
1496
  "children": [
1410
1497
  {
1411
- "type": "stack",
1412
- "direction": "horizontal",
1413
1498
  "gap": "sm",
1414
1499
  "align": "center",
1415
1500
  "children": [
1416
1501
  {
1417
- "type": "icon",
1418
1502
  "name": "gauge",
1503
+ "type": "icon",
1419
1504
  "size": "lg"
1420
1505
  },
1421
1506
  {
1422
- "type": "typography",
1423
1507
  "content": "Token Usage",
1508
+ "type": "typography",
1424
1509
  "variant": "h2"
1425
1510
  },
1426
1511
  {
1427
- "type": "badge",
1428
1512
  "label": "Normal",
1429
- "variant": "default"
1513
+ "variant": "default",
1514
+ "type": "badge"
1430
1515
  }
1431
- ]
1516
+ ],
1517
+ "direction": "horizontal",
1518
+ "type": "stack"
1432
1519
  },
1433
1520
  {
1434
1521
  "type": "divider"
1435
1522
  },
1436
1523
  {
1524
+ "max": "@entity.max",
1437
1525
  "type": "progress-bar",
1438
- "value": "@entity.current",
1439
- "max": "@entity.max"
1526
+ "value": "@entity.current"
1440
1527
  },
1441
1528
  {
1442
1529
  "type": "stack",
1443
- "direction": "horizontal",
1444
1530
  "gap": "md",
1445
1531
  "children": [
1446
1532
  {
1447
- "type": "stat-display",
1448
1533
  "label": "Tokens Used",
1534
+ "type": "stat-display",
1449
1535
  "value": "@entity.current"
1450
1536
  },
1451
1537
  {
@@ -1453,48 +1539,57 @@
1453
1539
  "label": "Max Tokens",
1454
1540
  "value": "@entity.max"
1455
1541
  }
1456
- ]
1542
+ ],
1543
+ "direction": "horizontal"
1457
1544
  },
1458
1545
  {
1459
- "type": "button",
1460
- "label": "Reset",
1461
1546
  "event": "RESET",
1462
1547
  "variant": "ghost",
1548
+ "label": "Reset",
1549
+ "type": "button",
1463
1550
  "icon": "rotate-ccw"
1464
1551
  }
1465
- ]
1552
+ ],
1553
+ "gap": "lg",
1554
+ "type": "stack",
1555
+ "direction": "vertical"
1466
1556
  }
1467
1557
  ]
1468
1558
  ]
1469
1559
  },
1470
1560
  {
1471
- "from": "warning",
1561
+ "from": "critical",
1472
1562
  "to": "normal",
1473
- "event": "RESET",
1563
+ "event": "COMPACT",
1474
1564
  "effects": [
1565
+ [
1566
+ "agent/compact"
1567
+ ],
1475
1568
  [
1476
1569
  "set",
1477
- "@entity.current",
1478
- 0
1570
+ "@entity.lastCompactedAt",
1571
+ "@now"
1572
+ ],
1573
+ [
1574
+ "agent/token-count"
1479
1575
  ],
1480
1576
  [
1481
1577
  "render-ui",
1482
1578
  "main",
1483
1579
  {
1484
1580
  "type": "stack",
1485
- "direction": "vertical",
1486
1581
  "gap": "lg",
1582
+ "direction": "vertical",
1487
1583
  "children": [
1488
1584
  {
1585
+ "align": "center",
1489
1586
  "type": "stack",
1490
1587
  "direction": "horizontal",
1491
- "gap": "sm",
1492
- "align": "center",
1493
1588
  "children": [
1494
1589
  {
1495
- "type": "icon",
1496
1590
  "name": "gauge",
1497
- "size": "lg"
1591
+ "size": "lg",
1592
+ "type": "icon"
1498
1593
  },
1499
1594
  {
1500
1595
  "type": "typography",
@@ -1502,42 +1597,43 @@
1502
1597
  "variant": "h2"
1503
1598
  },
1504
1599
  {
1600
+ "variant": "default",
1505
1601
  "type": "badge",
1506
- "label": "Normal",
1507
- "variant": "default"
1602
+ "label": "Normal"
1508
1603
  }
1509
- ]
1604
+ ],
1605
+ "gap": "sm"
1510
1606
  },
1511
1607
  {
1512
1608
  "type": "divider"
1513
1609
  },
1514
1610
  {
1515
- "type": "progress-bar",
1611
+ "max": "@entity.max",
1516
1612
  "value": "@entity.current",
1517
- "max": "@entity.max"
1613
+ "type": "progress-bar"
1518
1614
  },
1519
1615
  {
1520
1616
  "type": "stack",
1521
- "direction": "horizontal",
1522
1617
  "gap": "md",
1523
1618
  "children": [
1524
1619
  {
1525
- "type": "stat-display",
1526
1620
  "label": "Tokens Used",
1527
- "value": "@entity.current"
1621
+ "value": "@entity.current",
1622
+ "type": "stat-display"
1528
1623
  },
1529
1624
  {
1530
- "type": "stat-display",
1531
1625
  "label": "Max Tokens",
1626
+ "type": "stat-display",
1532
1627
  "value": "@entity.max"
1533
1628
  }
1534
- ]
1629
+ ],
1630
+ "direction": "horizontal"
1535
1631
  },
1536
1632
  {
1537
- "type": "button",
1538
- "label": "Reset",
1539
1633
  "event": "RESET",
1634
+ "type": "button",
1540
1635
  "variant": "ghost",
1636
+ "label": "Reset",
1541
1637
  "icon": "rotate-ccw"
1542
1638
  }
1543
1639
  ]
@@ -1553,7 +1649,7 @@
1553
1649
  [
1554
1650
  "set",
1555
1651
  "@entity.current",
1556
- 0
1652
+ 0.0
1557
1653
  ],
1558
1654
  [
1559
1655
  "render-ui",
@@ -1564,15 +1660,12 @@
1564
1660
  "gap": "lg",
1565
1661
  "children": [
1566
1662
  {
1567
- "type": "stack",
1568
- "direction": "horizontal",
1569
- "gap": "sm",
1570
1663
  "align": "center",
1571
1664
  "children": [
1572
1665
  {
1573
- "type": "icon",
1574
1666
  "name": "gauge",
1575
- "size": "lg"
1667
+ "size": "lg",
1668
+ "type": "icon"
1576
1669
  },
1577
1670
  {
1578
1671
  "type": "typography",
@@ -1580,11 +1673,14 @@
1580
1673
  "variant": "h2"
1581
1674
  },
1582
1675
  {
1676
+ "variant": "default",
1583
1677
  "type": "badge",
1584
- "label": "Normal",
1585
- "variant": "default"
1678
+ "label": "Normal"
1586
1679
  }
1587
- ]
1680
+ ],
1681
+ "gap": "sm",
1682
+ "direction": "horizontal",
1683
+ "type": "stack"
1588
1684
  },
1589
1685
  {
1590
1686
  "type": "divider"
@@ -1596,27 +1692,27 @@
1596
1692
  },
1597
1693
  {
1598
1694
  "type": "stack",
1599
- "direction": "horizontal",
1600
- "gap": "md",
1601
1695
  "children": [
1602
1696
  {
1697
+ "value": "@entity.current",
1603
1698
  "type": "stat-display",
1604
- "label": "Tokens Used",
1605
- "value": "@entity.current"
1699
+ "label": "Tokens Used"
1606
1700
  },
1607
1701
  {
1608
- "type": "stat-display",
1609
1702
  "label": "Max Tokens",
1610
- "value": "@entity.max"
1703
+ "value": "@entity.max",
1704
+ "type": "stat-display"
1611
1705
  }
1612
- ]
1706
+ ],
1707
+ "direction": "horizontal",
1708
+ "gap": "md"
1613
1709
  },
1614
1710
  {
1615
- "type": "button",
1616
1711
  "label": "Reset",
1617
1712
  "event": "RESET",
1713
+ "icon": "rotate-ccw",
1618
1714
  "variant": "ghost",
1619
- "icon": "rotate-ccw"
1715
+ "type": "button"
1620
1716
  }
1621
1717
  ]
1622
1718
  }
@@ -1624,12 +1720,89 @@
1624
1720
  ]
1625
1721
  }
1626
1722
  ]
1627
- }
1723
+ },
1724
+ "scope": "instance"
1628
1725
  },
1629
1726
  {
1630
1727
  "name": "AgentContextWindowNotification",
1631
- "linkedEntity": "AgentContextWindow",
1632
1728
  "category": "interaction",
1729
+ "linkedEntity": "AgentContextWindow",
1730
+ "emits": [
1731
+ {
1732
+ "event": "AgentContextWindowLoaded",
1733
+ "description": "Fired when AgentContextWindow finishes loading",
1734
+ "scope": "internal",
1735
+ "payload": [
1736
+ {
1737
+ "name": "id",
1738
+ "type": "string"
1739
+ },
1740
+ {
1741
+ "name": "name",
1742
+ "type": "string"
1743
+ },
1744
+ {
1745
+ "name": "description",
1746
+ "type": "string"
1747
+ },
1748
+ {
1749
+ "name": "status",
1750
+ "type": "string"
1751
+ },
1752
+ {
1753
+ "name": "createdAt",
1754
+ "type": "string"
1755
+ },
1756
+ {
1757
+ "name": "tokenCount",
1758
+ "type": "number"
1759
+ },
1760
+ {
1761
+ "name": "maxTokens",
1762
+ "type": "number"
1763
+ },
1764
+ {
1765
+ "name": "usage",
1766
+ "type": "number"
1767
+ },
1768
+ {
1769
+ "name": "lastCompactedAt",
1770
+ "type": "string"
1771
+ },
1772
+ {
1773
+ "name": "current",
1774
+ "type": "number"
1775
+ },
1776
+ {
1777
+ "name": "max",
1778
+ "type": "number"
1779
+ },
1780
+ {
1781
+ "name": "threshold",
1782
+ "type": "number"
1783
+ },
1784
+ {
1785
+ "name": "message",
1786
+ "type": "string"
1787
+ },
1788
+ {
1789
+ "name": "notificationType",
1790
+ "type": "string"
1791
+ }
1792
+ ]
1793
+ },
1794
+ {
1795
+ "event": "AgentContextWindowLoadFailed",
1796
+ "description": "Fired when AgentContextWindow fails to load",
1797
+ "scope": "internal",
1798
+ "payload": [
1799
+ {
1800
+ "name": "message",
1801
+ "type": "string"
1802
+ }
1803
+ ]
1804
+ }
1805
+ ],
1633
1806
  "stateMachine": {
1634
1807
  "states": [
1635
1808
  {
@@ -1647,7 +1820,7 @@
1647
1820
  },
1648
1821
  {
1649
1822
  "key": "SHOW",
1650
- "name": "Show Notification",
1823
+ "name": "Show",
1651
1824
  "payload": [
1652
1825
  {
1653
1826
  "name": "message",
@@ -1662,7 +1835,21 @@
1662
1835
  },
1663
1836
  {
1664
1837
  "key": "HIDE",
1665
- "name": "Hide Notification"
1838
+ "name": "Hide"
1839
+ },
1840
+ {
1841
+ "key": "AgentContextWindowLoaded",
1842
+ "name": "AgentContextWindow loaded"
1843
+ },
1844
+ {
1845
+ "key": "AgentContextWindowLoadFailed",
1846
+ "name": "AgentContextWindow load failed",
1847
+ "payload": [
1848
+ {
1849
+ "name": "message",
1850
+ "type": "string"
1851
+ }
1852
+ ]
1666
1853
  }
1667
1854
  ],
1668
1855
  "transitions": [
@@ -1673,7 +1860,13 @@
1673
1860
  "effects": [
1674
1861
  [
1675
1862
  "fetch",
1676
- "AgentContextWindow"
1863
+ "AgentContextWindow",
1864
+ {
1865
+ "emit": {
1866
+ "failure": "AgentContextWindowLoadFailed",
1867
+ "success": "AgentContextWindowLoaded"
1868
+ }
1869
+ }
1677
1870
  ]
1678
1871
  ]
1679
1872
  },
@@ -1696,43 +1889,43 @@
1696
1889
  "render-ui",
1697
1890
  "main",
1698
1891
  {
1892
+ "gap": "lg",
1699
1893
  "type": "stack",
1700
1894
  "direction": "vertical",
1701
- "gap": "lg",
1702
1895
  "children": [
1703
1896
  {
1704
- "type": "stack",
1705
- "direction": "horizontal",
1706
- "gap": "md",
1707
1897
  "justify": "space-between",
1898
+ "direction": "horizontal",
1708
1899
  "align": "center",
1709
1900
  "children": [
1710
1901
  {
1711
- "type": "stack",
1712
1902
  "direction": "horizontal",
1903
+ "type": "stack",
1713
1904
  "gap": "md",
1714
1905
  "align": "center",
1715
1906
  "children": [
1716
1907
  {
1717
- "type": "icon",
1718
1908
  "name": "layers",
1719
- "size": "lg"
1909
+ "size": "lg",
1910
+ "type": "icon"
1720
1911
  },
1721
1912
  {
1722
- "type": "typography",
1723
1913
  "content": "Context Window Alert",
1724
- "variant": "h2"
1914
+ "variant": "h2",
1915
+ "type": "typography"
1725
1916
  }
1726
1917
  ]
1727
1918
  },
1728
1919
  {
1729
- "type": "button",
1730
- "label": "Dismiss",
1731
1920
  "event": "HIDE",
1732
1921
  "variant": "ghost",
1733
- "icon": "x"
1922
+ "icon": "x",
1923
+ "type": "button",
1924
+ "label": "Dismiss"
1734
1925
  }
1735
- ]
1926
+ ],
1927
+ "type": "stack",
1928
+ "gap": "md"
1736
1929
  },
1737
1930
  {
1738
1931
  "type": "divider"
@@ -1761,8 +1954,9 @@
1761
1954
  "position": "top-right"
1762
1955
  },
1763
1956
  {
1764
- "type": "violation-alert",
1765
1957
  "severity": "warning",
1958
+ "category": "compliance",
1959
+ "type": "violation-alert",
1766
1960
  "message": [
1767
1961
  "object/get",
1768
1962
  [
@@ -1770,8 +1964,7 @@
1770
1964
  "@entity"
1771
1965
  ],
1772
1966
  "message"
1773
- ],
1774
- "category": "compliance"
1967
+ ]
1775
1968
  }
1776
1969
  ]
1777
1970
  }
@@ -1797,41 +1990,41 @@
1797
1990
  "render-ui",
1798
1991
  "main",
1799
1992
  {
1800
- "type": "stack",
1801
1993
  "direction": "vertical",
1994
+ "type": "stack",
1802
1995
  "gap": "lg",
1803
1996
  "children": [
1804
1997
  {
1805
- "type": "stack",
1806
- "direction": "horizontal",
1807
- "gap": "md",
1808
1998
  "justify": "space-between",
1999
+ "gap": "md",
2000
+ "direction": "horizontal",
2001
+ "type": "stack",
1809
2002
  "align": "center",
1810
2003
  "children": [
1811
2004
  {
1812
- "type": "stack",
1813
- "direction": "horizontal",
1814
- "gap": "md",
1815
2005
  "align": "center",
1816
2006
  "children": [
1817
2007
  {
1818
- "type": "icon",
1819
2008
  "name": "layers",
1820
- "size": "lg"
2009
+ "size": "lg",
2010
+ "type": "icon"
1821
2011
  },
1822
2012
  {
1823
- "type": "typography",
1824
2013
  "content": "Context Window Alert",
2014
+ "type": "typography",
1825
2015
  "variant": "h2"
1826
2016
  }
1827
- ]
2017
+ ],
2018
+ "direction": "horizontal",
2019
+ "gap": "md",
2020
+ "type": "stack"
1828
2021
  },
1829
2022
  {
2023
+ "icon": "x",
1830
2024
  "type": "button",
1831
- "label": "Dismiss",
1832
2025
  "event": "HIDE",
1833
2026
  "variant": "ghost",
1834
- "icon": "x"
2027
+ "label": "Dismiss"
1835
2028
  }
1836
2029
  ]
1837
2030
  },
@@ -1839,31 +2032,32 @@
1839
2032
  "type": "divider"
1840
2033
  },
1841
2034
  {
1842
- "type": "alert",
1843
- "variant": [
2035
+ "message": [
1844
2036
  "object/get",
1845
2037
  [
1846
2038
  "array/first",
1847
2039
  "@entity"
1848
2040
  ],
1849
- "notificationType"
2041
+ "message"
1850
2042
  ],
1851
- "message": [
2043
+ "variant": [
1852
2044
  "object/get",
1853
2045
  [
1854
2046
  "array/first",
1855
2047
  "@entity"
1856
2048
  ],
1857
- "message"
1858
- ]
2049
+ "notificationType"
2050
+ ],
2051
+ "type": "alert"
1859
2052
  },
1860
2053
  {
1861
- "type": "toast-slot",
1862
- "position": "top-right"
2054
+ "position": "top-right",
2055
+ "type": "toast-slot"
1863
2056
  },
1864
2057
  {
1865
- "type": "violation-alert",
2058
+ "category": "compliance",
1866
2059
  "severity": "warning",
2060
+ "type": "violation-alert",
1867
2061
  "message": [
1868
2062
  "object/get",
1869
2063
  [
@@ -1871,8 +2065,7 @@
1871
2065
  "@entity"
1872
2066
  ],
1873
2067
  "message"
1874
- ],
1875
- "category": "compliance"
2068
+ ]
1876
2069
  }
1877
2070
  ]
1878
2071
  }
@@ -1892,12 +2085,13 @@
1892
2085
  ]
1893
2086
  }
1894
2087
  ]
1895
- }
2088
+ },
2089
+ "scope": "instance"
1896
2090
  },
1897
2091
  {
1898
2092
  "name": "AgentContextWindowAgent",
1899
- "linkedEntity": "AgentContextWindow",
1900
2093
  "category": "interaction",
2094
+ "linkedEntity": "AgentContextWindow",
1901
2095
  "emits": [
1902
2096
  {
1903
2097
  "event": "SHOW",
@@ -1926,6 +2120,80 @@
1926
2120
  "type": "number"
1927
2121
  }
1928
2122
  ]
2123
+ },
2124
+ {
2125
+ "event": "AgentContextWindowLoaded",
2126
+ "description": "Fired when AgentContextWindow finishes loading",
2127
+ "scope": "internal",
2128
+ "payload": [
2129
+ {
2130
+ "name": "id",
2131
+ "type": "string"
2132
+ },
2133
+ {
2134
+ "name": "name",
2135
+ "type": "string"
2136
+ },
2137
+ {
2138
+ "name": "description",
2139
+ "type": "string"
2140
+ },
2141
+ {
2142
+ "name": "status",
2143
+ "type": "string"
2144
+ },
2145
+ {
2146
+ "name": "createdAt",
2147
+ "type": "string"
2148
+ },
2149
+ {
2150
+ "name": "tokenCount",
2151
+ "type": "number"
2152
+ },
2153
+ {
2154
+ "name": "maxTokens",
2155
+ "type": "number"
2156
+ },
2157
+ {
2158
+ "name": "usage",
2159
+ "type": "number"
2160
+ },
2161
+ {
2162
+ "name": "lastCompactedAt",
2163
+ "type": "string"
2164
+ },
2165
+ {
2166
+ "name": "current",
2167
+ "type": "number"
2168
+ },
2169
+ {
2170
+ "name": "max",
2171
+ "type": "number"
2172
+ },
2173
+ {
2174
+ "name": "threshold",
2175
+ "type": "number"
2176
+ },
2177
+ {
2178
+ "name": "message",
2179
+ "type": "string"
2180
+ },
2181
+ {
2182
+ "name": "notificationType",
2183
+ "type": "string"
2184
+ }
2185
+ ]
2186
+ },
2187
+ {
2188
+ "event": "AgentContextWindowLoadFailed",
2189
+ "description": "Fired when AgentContextWindow fails to load",
2190
+ "scope": "internal",
2191
+ "payload": [
2192
+ {
2193
+ "name": "message",
2194
+ "type": "string"
2195
+ }
2196
+ ]
1929
2197
  }
1930
2198
  ],
1931
2199
  "stateMachine": {
@@ -1948,11 +2216,33 @@
1948
2216
  },
1949
2217
  {
1950
2218
  "key": "UPDATE_TOKENS",
1951
- "name": "Update Token Count"
2219
+ "name": "Update Tokens"
1952
2220
  },
1953
2221
  {
1954
2222
  "key": "COMPACT",
1955
- "name": "Compact Context"
2223
+ "name": "Compact"
2224
+ },
2225
+ {
2226
+ "key": "SHOW",
2227
+ "name": "Show"
2228
+ },
2229
+ {
2230
+ "key": "UPDATE",
2231
+ "name": "Update"
2232
+ },
2233
+ {
2234
+ "key": "AgentContextWindowLoaded",
2235
+ "name": "AgentContextWindow loaded"
2236
+ },
2237
+ {
2238
+ "key": "AgentContextWindowLoadFailed",
2239
+ "name": "AgentContextWindow load failed",
2240
+ "payload": [
2241
+ {
2242
+ "name": "message",
2243
+ "type": "string"
2244
+ }
2245
+ ]
1956
2246
  }
1957
2247
  ],
1958
2248
  "transitions": [
@@ -1963,7 +2253,13 @@
1963
2253
  "effects": [
1964
2254
  [
1965
2255
  "fetch",
1966
- "AgentContextWindow"
2256
+ "AgentContextWindow",
2257
+ {
2258
+ "emit": {
2259
+ "success": "AgentContextWindowLoaded",
2260
+ "failure": "AgentContextWindowLoadFailed"
2261
+ }
2262
+ }
1967
2263
  ],
1968
2264
  [
1969
2265
  "agent/token-count"
@@ -1976,9 +2272,9 @@
1976
2272
  "main",
1977
2273
  {
1978
2274
  "type": "empty-state",
2275
+ "description": "Context Window is ready",
1979
2276
  "icon": "layers",
1980
- "title": "Context Window",
1981
- "description": "Context Window is ready"
2277
+ "title": "Context Window"
1982
2278
  }
1983
2279
  ]
1984
2280
  ]
@@ -2013,7 +2309,7 @@
2013
2309
  "@entity.tokenCount",
2014
2310
  "@entity.maxTokens"
2015
2311
  ],
2016
- 100
2312
+ 100.0
2017
2313
  ]
2018
2314
  ],
2019
2315
  [
@@ -2049,7 +2345,7 @@
2049
2345
  "@entity.tokenCount",
2050
2346
  "@entity.maxTokens"
2051
2347
  ],
2052
- 1
2348
+ 1.0
2053
2349
  ]
2054
2350
  ],
2055
2351
  "effects": [
@@ -2069,7 +2365,7 @@
2069
2365
  "@entity.tokenCount",
2070
2366
  "@entity.maxTokens"
2071
2367
  ],
2072
- 100
2368
+ 100.0
2073
2369
  ]
2074
2370
  ],
2075
2371
  [
@@ -2098,7 +2394,7 @@
2098
2394
  "@entity.tokenCount",
2099
2395
  "@entity.maxTokens"
2100
2396
  ],
2101
- 1
2397
+ 1.0
2102
2398
  ],
2103
2399
  "effects": [
2104
2400
  [
@@ -2110,7 +2406,7 @@
2110
2406
  [
2111
2407
  "set",
2112
2408
  "@entity.usage",
2113
- 100
2409
+ 100.0
2114
2410
  ],
2115
2411
  [
2116
2412
  "set",
@@ -2156,7 +2452,7 @@
2156
2452
  "@entity.tokenCount",
2157
2453
  "@entity.maxTokens"
2158
2454
  ],
2159
- 100
2455
+ 100.0
2160
2456
  ]
2161
2457
  ],
2162
2458
  [
@@ -2171,24 +2467,37 @@
2171
2467
  ]
2172
2468
  },
2173
2469
  {
2174
- "from": "at_limit",
2175
- "to": "normal",
2176
- "event": "COMPACT",
2177
- "effects": [
2470
+ "from": "approaching_limit",
2471
+ "to": "approaching_limit",
2472
+ "event": "UPDATE_TOKENS",
2473
+ "guard": [
2474
+ "and",
2178
2475
  [
2179
- "agent/compact"
2476
+ ">=",
2477
+ [
2478
+ "/",
2479
+ "@entity.tokenCount",
2480
+ "@entity.maxTokens"
2481
+ ],
2482
+ 0.85
2180
2483
  ],
2484
+ [
2485
+ "<",
2486
+ [
2487
+ "/",
2488
+ "@entity.tokenCount",
2489
+ "@entity.maxTokens"
2490
+ ],
2491
+ 1.0
2492
+ ]
2493
+ ],
2494
+ "effects": [
2181
2495
  [
2182
2496
  "agent/token-count"
2183
2497
  ],
2184
2498
  [
2185
2499
  "agent/context-usage"
2186
2500
  ],
2187
- [
2188
- "set",
2189
- "@entity.lastCompactedAt",
2190
- "@now"
2191
- ],
2192
2501
  [
2193
2502
  "set",
2194
2503
  "@entity.usage",
@@ -2199,7 +2508,7 @@
2199
2508
  "@entity.tokenCount",
2200
2509
  "@entity.maxTokens"
2201
2510
  ],
2202
- 100
2511
+ 100.0
2203
2512
  ]
2204
2513
  ],
2205
2514
  [
@@ -2214,37 +2523,24 @@
2214
2523
  ]
2215
2524
  },
2216
2525
  {
2217
- "from": "approaching_limit",
2218
- "to": "approaching_limit",
2219
- "event": "UPDATE_TOKENS",
2220
- "guard": [
2221
- "and",
2526
+ "from": "at_limit",
2527
+ "to": "normal",
2528
+ "event": "COMPACT",
2529
+ "effects": [
2222
2530
  [
2223
- ">=",
2224
- [
2225
- "/",
2226
- "@entity.tokenCount",
2227
- "@entity.maxTokens"
2228
- ],
2229
- 0.85
2531
+ "agent/compact"
2230
2532
  ],
2231
- [
2232
- "<",
2233
- [
2234
- "/",
2235
- "@entity.tokenCount",
2236
- "@entity.maxTokens"
2237
- ],
2238
- 1
2239
- ]
2240
- ],
2241
- "effects": [
2242
2533
  [
2243
2534
  "agent/token-count"
2244
2535
  ],
2245
2536
  [
2246
2537
  "agent/context-usage"
2247
2538
  ],
2539
+ [
2540
+ "set",
2541
+ "@entity.lastCompactedAt",
2542
+ "@now"
2543
+ ],
2248
2544
  [
2249
2545
  "set",
2250
2546
  "@entity.usage",
@@ -2255,7 +2551,7 @@
2255
2551
  "@entity.tokenCount",
2256
2552
  "@entity.maxTokens"
2257
2553
  ],
2258
- 100
2554
+ 100.0
2259
2555
  ]
2260
2556
  ],
2261
2557
  [
@@ -2270,7 +2566,8 @@
2270
2566
  ]
2271
2567
  }
2272
2568
  ]
2273
- }
2569
+ },
2570
+ "scope": "instance"
2274
2571
  }
2275
2572
  ],
2276
2573
  "pages": [
@@ -2292,4 +2589,4 @@
2292
2589
  ]
2293
2590
  }
2294
2591
  ]
2295
- }
2592
+ }