@almadar/std 5.2.2 → 5.4.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 (431) hide show
  1. package/behaviors/exports/atoms/std-agent-activity-log.orb +220 -10
  2. package/behaviors/exports/atoms/std-agent-chat-thread.orb +63 -4
  3. package/behaviors/exports/atoms/std-agent-classifier.orb +12 -4
  4. package/behaviors/exports/atoms/std-agent-completion.orb +12 -4
  5. package/behaviors/exports/atoms/std-agent-context-window.orb +8 -4
  6. package/behaviors/exports/atoms/std-agent-conversation.orb +79 -4
  7. package/behaviors/exports/atoms/std-agent-memory.orb +16 -4
  8. package/behaviors/exports/atoms/std-agent-provider.orb +12 -4
  9. package/behaviors/exports/atoms/std-agent-search.orb +8 -4
  10. package/behaviors/exports/atoms/std-agent-session.orb +20 -4
  11. package/behaviors/exports/atoms/std-agent-step-progress.orb +8 -4
  12. package/behaviors/exports/atoms/std-agent-token-gauge.orb +8 -4
  13. package/behaviors/exports/atoms/std-agent-tool-call.orb +12 -4
  14. package/behaviors/exports/atoms/std-async.orb +12 -4
  15. package/behaviors/exports/atoms/std-autoregressive.orb +2 -3
  16. package/behaviors/exports/atoms/std-browse.orb +8 -4
  17. package/behaviors/exports/atoms/std-cache-aside.orb +12 -4
  18. package/behaviors/exports/atoms/std-calendar.orb +8 -4
  19. package/behaviors/exports/atoms/std-circuit-breaker.orb +8 -4
  20. package/behaviors/exports/atoms/std-collision.orb +8 -4
  21. package/behaviors/exports/atoms/std-combat-log.orb +8 -4
  22. package/behaviors/exports/atoms/std-combat.orb +8 -4
  23. package/behaviors/exports/atoms/std-confirmation.orb +4 -4
  24. package/behaviors/exports/atoms/std-dialogue-box.orb +8 -4
  25. package/behaviors/exports/atoms/std-display.orb +153 -4
  26. package/behaviors/exports/atoms/std-drawer.orb +58 -4
  27. package/behaviors/exports/atoms/std-filter.orb +8 -4
  28. package/behaviors/exports/atoms/std-flip-card.orb +8 -4
  29. package/behaviors/exports/atoms/std-gallery.orb +8 -4
  30. package/behaviors/exports/atoms/std-game-audio.orb +8 -4
  31. package/behaviors/exports/atoms/std-game-canvas2d.orb +6 -3
  32. package/behaviors/exports/atoms/std-game-canvas3d.orb +6 -3
  33. package/behaviors/exports/atoms/std-game-hud.orb +16 -4
  34. package/behaviors/exports/atoms/std-game-menu.orb +8 -4
  35. package/behaviors/exports/atoms/std-game-over-screen.orb +8 -4
  36. package/behaviors/exports/atoms/std-gameflow.orb +8 -4
  37. package/behaviors/exports/atoms/std-input.orb +8 -4
  38. package/behaviors/exports/atoms/std-inventory-panel.orb +12 -4
  39. package/behaviors/exports/atoms/std-isometric-canvas.orb +8 -4
  40. package/behaviors/exports/atoms/std-loading.orb +8 -4
  41. package/behaviors/exports/atoms/std-modal.orb +8 -4
  42. package/behaviors/exports/atoms/std-movement.orb +8 -4
  43. package/behaviors/exports/atoms/std-notification.orb +8 -4
  44. package/behaviors/exports/atoms/std-overworld.orb +8 -4
  45. package/behaviors/exports/atoms/std-pagination.orb +8 -4
  46. package/behaviors/exports/atoms/std-physics2d.orb +8 -4
  47. package/behaviors/exports/atoms/std-platformer-canvas.orb +8 -4
  48. package/behaviors/exports/atoms/std-quest.orb +14 -5
  49. package/behaviors/exports/atoms/std-rate-limiter.orb +8 -4
  50. package/behaviors/exports/atoms/std-rating.orb +8 -4
  51. package/behaviors/exports/atoms/std-score-board.orb +8 -4
  52. package/behaviors/exports/atoms/std-score.orb +8 -4
  53. package/behaviors/exports/atoms/std-search.orb +8 -4
  54. package/behaviors/exports/atoms/std-selection.orb +8 -4
  55. package/behaviors/exports/atoms/std-service-custom-bearer.orb +19 -4
  56. package/behaviors/exports/atoms/std-service-custom-header.orb +21 -4
  57. package/behaviors/exports/atoms/std-service-custom-noauth.orb +15 -4
  58. package/behaviors/exports/atoms/std-service-custom-query.orb +21 -4
  59. package/behaviors/exports/atoms/std-service-email.orb +8 -4
  60. package/behaviors/exports/atoms/std-service-github.orb +8 -4
  61. package/behaviors/exports/atoms/std-service-llm.orb +8 -4
  62. package/behaviors/exports/atoms/std-service-oauth.orb +8 -4
  63. package/behaviors/exports/atoms/std-service-redis.orb +8 -4
  64. package/behaviors/exports/atoms/std-service-storage.orb +8 -4
  65. package/behaviors/exports/atoms/std-service-stripe.orb +8 -4
  66. package/behaviors/exports/atoms/std-service-twilio.orb +8 -4
  67. package/behaviors/exports/atoms/std-service-youtube.orb +8 -4
  68. package/behaviors/exports/atoms/std-simulation-canvas.orb +8 -4
  69. package/behaviors/exports/atoms/std-sort.orb +52 -4
  70. package/behaviors/exports/atoms/std-sprite.orb +8 -4
  71. package/behaviors/exports/atoms/std-tabs.orb +16 -4
  72. package/behaviors/exports/atoms/std-text-effects.orb +8 -4
  73. package/behaviors/exports/atoms/std-theme.orb +8 -4
  74. package/behaviors/exports/atoms/std-timer.orb +8 -4
  75. package/behaviors/exports/atoms/std-undo.orb +8 -4
  76. package/behaviors/exports/atoms/std-upload.orb +8 -4
  77. package/behaviors/exports/atoms/std-validate-on-save.orb +32 -4
  78. package/behaviors/exports/atoms/std-wizard.orb +26 -4
  79. package/behaviors/exports/molecules/std-agent-fix-loop.orb +1729 -1159
  80. package/behaviors/exports/molecules/std-agent-learner.orb +856 -626
  81. package/behaviors/exports/molecules/std-agent-planner.orb +873 -623
  82. package/behaviors/exports/molecules/std-agent-rag.orb +804 -604
  83. package/behaviors/exports/molecules/std-agent-tool-loop.orb +2860 -931
  84. package/behaviors/exports/molecules/std-builder-game.orb +8 -4
  85. package/behaviors/exports/molecules/std-cart.orb +318 -197
  86. package/behaviors/exports/molecules/std-classifier-game.orb +8 -4
  87. package/behaviors/exports/molecules/std-debugger-game.orb +8 -4
  88. package/behaviors/exports/molecules/std-detail.orb +489 -307
  89. package/behaviors/exports/molecules/std-event-handler-game.orb +8 -4
  90. package/behaviors/exports/molecules/std-form-advanced.orb +12 -4
  91. package/behaviors/exports/molecules/std-geospatial.orb +519 -364
  92. package/behaviors/exports/molecules/std-inventory.orb +650 -391
  93. package/behaviors/exports/molecules/std-list.orb +890 -526
  94. package/behaviors/exports/molecules/std-messaging.orb +474 -293
  95. package/behaviors/exports/molecules/std-negotiator-game.orb +8 -4
  96. package/behaviors/exports/molecules/std-platformer-game.orb +8 -4
  97. package/behaviors/exports/molecules/std-puzzle-game.orb +8 -4
  98. package/behaviors/exports/molecules/std-quiz.orb +8 -4
  99. package/behaviors/exports/molecules/std-sequencer-game.orb +8 -4
  100. package/behaviors/exports/molecules/std-service-content-pipeline.orb +8 -4
  101. package/behaviors/exports/molecules/std-service-custom-api-tester.orb +46 -4
  102. package/behaviors/exports/molecules/std-service-devops-toolkit.orb +8 -4
  103. package/behaviors/exports/molecules/std-service-notification-hub.orb +8 -4
  104. package/behaviors/exports/molecules/std-service-payment-flow.orb +8 -4
  105. package/behaviors/exports/molecules/std-simulator-game.orb +8 -4
  106. package/behaviors/exports/molecules/std-turn-based-battle.orb +8 -4
  107. package/behaviors/exports/organisms/std-agent-assistant.orb +28 -4
  108. package/behaviors/exports/organisms/std-agent-builder.orb +1321 -835
  109. package/behaviors/exports/organisms/std-agent-pipeline.orb +1284 -782
  110. package/behaviors/exports/organisms/std-agent-reviewer.orb +372 -300
  111. package/behaviors/exports/organisms/std-agent-tutor.orb +378 -295
  112. package/behaviors/exports/organisms/std-api-gateway.orb +21 -4
  113. package/behaviors/exports/organisms/std-arcade-game.orb +4 -4
  114. package/behaviors/exports/organisms/std-booking-system.orb +38 -4
  115. package/behaviors/exports/organisms/std-cicd-pipeline.orb +25 -4
  116. package/behaviors/exports/organisms/std-cms.orb +42 -4
  117. package/behaviors/exports/organisms/std-coding-academy.orb +4 -4
  118. package/behaviors/exports/organisms/std-crm.orb +42 -4
  119. package/behaviors/exports/organisms/std-devops-dashboard.orb +21 -4
  120. package/behaviors/exports/organisms/std-ecommerce.orb +46 -4
  121. package/behaviors/exports/organisms/std-finance-tracker.orb +25 -4
  122. package/behaviors/exports/organisms/std-healthcare.orb +42 -4
  123. package/behaviors/exports/organisms/std-helpdesk.orb +25 -4
  124. package/behaviors/exports/organisms/std-hr-portal.orb +38 -4
  125. package/behaviors/exports/organisms/std-iot-dashboard.orb +21 -4
  126. package/behaviors/exports/organisms/std-lms.orb +21 -4
  127. package/behaviors/exports/organisms/std-logic-training.orb +4 -4
  128. package/behaviors/exports/organisms/std-platformer-app.orb +16 -4
  129. package/behaviors/exports/organisms/std-project-manager.orb +38 -4
  130. package/behaviors/exports/organisms/std-puzzle-app.orb +4 -4
  131. package/behaviors/exports/organisms/std-realtime-chat.orb +25 -4
  132. package/behaviors/exports/organisms/std-rpg-game.orb +20 -4
  133. package/behaviors/exports/organisms/std-service-marketplace.orb +46 -8
  134. package/behaviors/exports/organisms/std-service-research-assistant.orb +15 -4
  135. package/behaviors/exports/organisms/std-social-feed.orb +12 -4
  136. package/behaviors/exports/organisms/std-stem-lab.orb +4 -4
  137. package/behaviors/exports/organisms/std-strategy-game.orb +4 -4
  138. package/behaviors/exports/organisms/std-trading-dashboard.orb +25 -4
  139. package/behaviors/exports/validation-report.json +1662 -1
  140. package/dist/behaviors/exports/atoms/std-agent-activity-log.orb +220 -10
  141. package/dist/behaviors/exports/atoms/std-agent-chat-thread.orb +63 -4
  142. package/dist/behaviors/exports/atoms/std-agent-classifier.orb +12 -4
  143. package/dist/behaviors/exports/atoms/std-agent-completion.orb +12 -4
  144. package/dist/behaviors/exports/atoms/std-agent-context-window.orb +8 -4
  145. package/dist/behaviors/exports/atoms/std-agent-conversation.orb +79 -4
  146. package/dist/behaviors/exports/atoms/std-agent-memory.orb +16 -4
  147. package/dist/behaviors/exports/atoms/std-agent-provider.orb +12 -4
  148. package/dist/behaviors/exports/atoms/std-agent-search.orb +8 -4
  149. package/dist/behaviors/exports/atoms/std-agent-session.orb +20 -4
  150. package/dist/behaviors/exports/atoms/std-agent-step-progress.orb +8 -4
  151. package/dist/behaviors/exports/atoms/std-agent-token-gauge.orb +8 -4
  152. package/dist/behaviors/exports/atoms/std-agent-tool-call.orb +12 -4
  153. package/dist/behaviors/exports/atoms/std-async.orb +12 -4
  154. package/dist/behaviors/exports/atoms/std-autoregressive.orb +2 -3
  155. package/dist/behaviors/exports/atoms/std-browse.orb +8 -4
  156. package/dist/behaviors/exports/atoms/std-cache-aside.orb +12 -4
  157. package/dist/behaviors/exports/atoms/std-calendar.orb +8 -4
  158. package/dist/behaviors/exports/atoms/std-circuit-breaker.orb +8 -4
  159. package/dist/behaviors/exports/atoms/std-collision.orb +8 -4
  160. package/dist/behaviors/exports/atoms/std-combat-log.orb +8 -4
  161. package/dist/behaviors/exports/atoms/std-combat.orb +8 -4
  162. package/dist/behaviors/exports/atoms/std-confirmation.orb +4 -4
  163. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +8 -4
  164. package/dist/behaviors/exports/atoms/std-display.orb +153 -4
  165. package/dist/behaviors/exports/atoms/std-drawer.orb +58 -4
  166. package/dist/behaviors/exports/atoms/std-filter.orb +8 -4
  167. package/dist/behaviors/exports/atoms/std-flip-card.orb +8 -4
  168. package/dist/behaviors/exports/atoms/std-gallery.orb +8 -4
  169. package/dist/behaviors/exports/atoms/std-game-audio.orb +8 -4
  170. package/dist/behaviors/exports/atoms/std-game-canvas2d.orb +6 -3
  171. package/dist/behaviors/exports/atoms/std-game-canvas3d.orb +6 -3
  172. package/dist/behaviors/exports/atoms/std-game-hud.orb +16 -4
  173. package/dist/behaviors/exports/atoms/std-game-menu.orb +8 -4
  174. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +8 -4
  175. package/dist/behaviors/exports/atoms/std-gameflow.orb +8 -4
  176. package/dist/behaviors/exports/atoms/std-input.orb +8 -4
  177. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +12 -4
  178. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +8 -4
  179. package/dist/behaviors/exports/atoms/std-loading.orb +8 -4
  180. package/dist/behaviors/exports/atoms/std-modal.orb +8 -4
  181. package/dist/behaviors/exports/atoms/std-movement.orb +8 -4
  182. package/dist/behaviors/exports/atoms/std-notification.orb +8 -4
  183. package/dist/behaviors/exports/atoms/std-overworld.orb +8 -4
  184. package/dist/behaviors/exports/atoms/std-pagination.orb +8 -4
  185. package/dist/behaviors/exports/atoms/std-physics2d.orb +8 -4
  186. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +8 -4
  187. package/dist/behaviors/exports/atoms/std-quest.orb +14 -5
  188. package/dist/behaviors/exports/atoms/std-rate-limiter.orb +8 -4
  189. package/dist/behaviors/exports/atoms/std-rating.orb +8 -4
  190. package/dist/behaviors/exports/atoms/std-score-board.orb +8 -4
  191. package/dist/behaviors/exports/atoms/std-score.orb +8 -4
  192. package/dist/behaviors/exports/atoms/std-search.orb +8 -4
  193. package/dist/behaviors/exports/atoms/std-selection.orb +8 -4
  194. package/dist/behaviors/exports/atoms/std-service-custom-bearer.orb +19 -4
  195. package/dist/behaviors/exports/atoms/std-service-custom-header.orb +21 -4
  196. package/dist/behaviors/exports/atoms/std-service-custom-noauth.orb +15 -4
  197. package/dist/behaviors/exports/atoms/std-service-custom-query.orb +21 -4
  198. package/dist/behaviors/exports/atoms/std-service-email.orb +8 -4
  199. package/dist/behaviors/exports/atoms/std-service-github.orb +8 -4
  200. package/dist/behaviors/exports/atoms/std-service-llm.orb +8 -4
  201. package/dist/behaviors/exports/atoms/std-service-oauth.orb +8 -4
  202. package/dist/behaviors/exports/atoms/std-service-redis.orb +8 -4
  203. package/dist/behaviors/exports/atoms/std-service-storage.orb +8 -4
  204. package/dist/behaviors/exports/atoms/std-service-stripe.orb +8 -4
  205. package/dist/behaviors/exports/atoms/std-service-twilio.orb +8 -4
  206. package/dist/behaviors/exports/atoms/std-service-youtube.orb +8 -4
  207. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +8 -4
  208. package/dist/behaviors/exports/atoms/std-sort.orb +52 -4
  209. package/dist/behaviors/exports/atoms/std-sprite.orb +8 -4
  210. package/dist/behaviors/exports/atoms/std-tabs.orb +16 -4
  211. package/dist/behaviors/exports/atoms/std-text-effects.orb +8 -4
  212. package/dist/behaviors/exports/atoms/std-theme.orb +8 -4
  213. package/dist/behaviors/exports/atoms/std-timer.orb +8 -4
  214. package/dist/behaviors/exports/atoms/std-undo.orb +8 -4
  215. package/dist/behaviors/exports/atoms/std-upload.orb +8 -4
  216. package/dist/behaviors/exports/atoms/std-validate-on-save.orb +32 -4
  217. package/dist/behaviors/exports/atoms/std-wizard.orb +26 -4
  218. package/dist/behaviors/exports/molecules/std-agent-fix-loop.orb +1729 -1159
  219. package/dist/behaviors/exports/molecules/std-agent-learner.orb +856 -626
  220. package/dist/behaviors/exports/molecules/std-agent-planner.orb +873 -623
  221. package/dist/behaviors/exports/molecules/std-agent-rag.orb +804 -604
  222. package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +2860 -931
  223. package/dist/behaviors/exports/molecules/std-builder-game.orb +8 -4
  224. package/dist/behaviors/exports/molecules/std-cart.orb +318 -197
  225. package/dist/behaviors/exports/molecules/std-classifier-game.orb +8 -4
  226. package/dist/behaviors/exports/molecules/std-debugger-game.orb +8 -4
  227. package/dist/behaviors/exports/molecules/std-detail.orb +489 -307
  228. package/dist/behaviors/exports/molecules/std-event-handler-game.orb +8 -4
  229. package/dist/behaviors/exports/molecules/std-form-advanced.orb +12 -4
  230. package/dist/behaviors/exports/molecules/std-geospatial.orb +519 -364
  231. package/dist/behaviors/exports/molecules/std-inventory.orb +650 -391
  232. package/dist/behaviors/exports/molecules/std-list.orb +890 -526
  233. package/dist/behaviors/exports/molecules/std-messaging.orb +474 -293
  234. package/dist/behaviors/exports/molecules/std-negotiator-game.orb +8 -4
  235. package/dist/behaviors/exports/molecules/std-platformer-game.orb +8 -4
  236. package/dist/behaviors/exports/molecules/std-puzzle-game.orb +8 -4
  237. package/dist/behaviors/exports/molecules/std-quiz.orb +8 -4
  238. package/dist/behaviors/exports/molecules/std-sequencer-game.orb +8 -4
  239. package/dist/behaviors/exports/molecules/std-service-content-pipeline.orb +8 -4
  240. package/dist/behaviors/exports/molecules/std-service-custom-api-tester.orb +46 -4
  241. package/dist/behaviors/exports/molecules/std-service-devops-toolkit.orb +8 -4
  242. package/dist/behaviors/exports/molecules/std-service-notification-hub.orb +8 -4
  243. package/dist/behaviors/exports/molecules/std-service-payment-flow.orb +8 -4
  244. package/dist/behaviors/exports/molecules/std-simulator-game.orb +8 -4
  245. package/dist/behaviors/exports/molecules/std-turn-based-battle.orb +8 -4
  246. package/dist/behaviors/exports/organisms/std-agent-assistant.orb +28 -4
  247. package/dist/behaviors/exports/organisms/std-agent-builder.orb +1321 -835
  248. package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +1284 -782
  249. package/dist/behaviors/exports/organisms/std-agent-reviewer.orb +372 -300
  250. package/dist/behaviors/exports/organisms/std-agent-tutor.orb +378 -295
  251. package/dist/behaviors/exports/organisms/std-api-gateway.orb +21 -4
  252. package/dist/behaviors/exports/organisms/std-arcade-game.orb +4 -4
  253. package/dist/behaviors/exports/organisms/std-booking-system.orb +38 -4
  254. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +25 -4
  255. package/dist/behaviors/exports/organisms/std-cms.orb +42 -4
  256. package/dist/behaviors/exports/organisms/std-coding-academy.orb +4 -4
  257. package/dist/behaviors/exports/organisms/std-crm.orb +42 -4
  258. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +21 -4
  259. package/dist/behaviors/exports/organisms/std-ecommerce.orb +46 -4
  260. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +25 -4
  261. package/dist/behaviors/exports/organisms/std-healthcare.orb +42 -4
  262. package/dist/behaviors/exports/organisms/std-helpdesk.orb +25 -4
  263. package/dist/behaviors/exports/organisms/std-hr-portal.orb +38 -4
  264. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +21 -4
  265. package/dist/behaviors/exports/organisms/std-lms.orb +21 -4
  266. package/dist/behaviors/exports/organisms/std-logic-training.orb +4 -4
  267. package/dist/behaviors/exports/organisms/std-platformer-app.orb +16 -4
  268. package/dist/behaviors/exports/organisms/std-project-manager.orb +38 -4
  269. package/dist/behaviors/exports/organisms/std-puzzle-app.orb +4 -4
  270. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +25 -4
  271. package/dist/behaviors/exports/organisms/std-rpg-game.orb +20 -4
  272. package/dist/behaviors/exports/organisms/std-service-marketplace.orb +46 -8
  273. package/dist/behaviors/exports/organisms/std-service-research-assistant.orb +15 -4
  274. package/dist/behaviors/exports/organisms/std-social-feed.orb +12 -4
  275. package/dist/behaviors/exports/organisms/std-stem-lab.orb +4 -4
  276. package/dist/behaviors/exports/organisms/std-strategy-game.orb +4 -4
  277. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +25 -4
  278. package/dist/behaviors/exports/validation-report.json +1662 -1
  279. package/dist/behaviors/exports-reader.js +225 -206
  280. package/dist/behaviors/exports-reader.js.map +1 -1
  281. package/dist/behaviors/functions/index.d.ts +113 -113
  282. package/dist/behaviors/functions/index.js +225 -207
  283. package/dist/behaviors/functions/index.js.map +1 -1
  284. package/dist/behaviors/index.d.ts +1 -1
  285. package/dist/behaviors/index.js +226 -207
  286. package/dist/behaviors/index.js.map +1 -1
  287. package/dist/behaviors/query.js +225 -206
  288. package/dist/behaviors/query.js.map +1 -1
  289. package/dist/exports/atoms/std-agent-activity-log.orb +220 -10
  290. package/dist/exports/atoms/std-agent-chat-thread.orb +63 -4
  291. package/dist/exports/atoms/std-agent-classifier.orb +12 -4
  292. package/dist/exports/atoms/std-agent-completion.orb +12 -4
  293. package/dist/exports/atoms/std-agent-context-window.orb +8 -4
  294. package/dist/exports/atoms/std-agent-conversation.orb +79 -4
  295. package/dist/exports/atoms/std-agent-memory.orb +16 -4
  296. package/dist/exports/atoms/std-agent-provider.orb +12 -4
  297. package/dist/exports/atoms/std-agent-search.orb +8 -4
  298. package/dist/exports/atoms/std-agent-session.orb +20 -4
  299. package/dist/exports/atoms/std-agent-step-progress.orb +8 -4
  300. package/dist/exports/atoms/std-agent-token-gauge.orb +8 -4
  301. package/dist/exports/atoms/std-agent-tool-call.orb +12 -4
  302. package/dist/exports/atoms/std-async.orb +12 -4
  303. package/dist/exports/atoms/std-autoregressive.orb +2 -3
  304. package/dist/exports/atoms/std-browse.orb +8 -4
  305. package/dist/exports/atoms/std-cache-aside.orb +12 -4
  306. package/dist/exports/atoms/std-calendar.orb +8 -4
  307. package/dist/exports/atoms/std-circuit-breaker.orb +8 -4
  308. package/dist/exports/atoms/std-collision.orb +8 -4
  309. package/dist/exports/atoms/std-combat-log.orb +8 -4
  310. package/dist/exports/atoms/std-combat.orb +8 -4
  311. package/dist/exports/atoms/std-confirmation.orb +4 -4
  312. package/dist/exports/atoms/std-dialogue-box.orb +8 -4
  313. package/dist/exports/atoms/std-display.orb +153 -4
  314. package/dist/exports/atoms/std-drawer.orb +58 -4
  315. package/dist/exports/atoms/std-filter.orb +8 -4
  316. package/dist/exports/atoms/std-flip-card.orb +8 -4
  317. package/dist/exports/atoms/std-gallery.orb +8 -4
  318. package/dist/exports/atoms/std-game-audio.orb +8 -4
  319. package/dist/exports/atoms/std-game-canvas2d.orb +6 -3
  320. package/dist/exports/atoms/std-game-canvas3d.orb +6 -3
  321. package/dist/exports/atoms/std-game-hud.orb +16 -4
  322. package/dist/exports/atoms/std-game-menu.orb +8 -4
  323. package/dist/exports/atoms/std-game-over-screen.orb +8 -4
  324. package/dist/exports/atoms/std-gameflow.orb +8 -4
  325. package/dist/exports/atoms/std-input.orb +8 -4
  326. package/dist/exports/atoms/std-inventory-panel.orb +12 -4
  327. package/dist/exports/atoms/std-isometric-canvas.orb +8 -4
  328. package/dist/exports/atoms/std-loading.orb +8 -4
  329. package/dist/exports/atoms/std-modal.orb +8 -4
  330. package/dist/exports/atoms/std-movement.orb +8 -4
  331. package/dist/exports/atoms/std-notification.orb +8 -4
  332. package/dist/exports/atoms/std-overworld.orb +8 -4
  333. package/dist/exports/atoms/std-pagination.orb +8 -4
  334. package/dist/exports/atoms/std-physics2d.orb +8 -4
  335. package/dist/exports/atoms/std-platformer-canvas.orb +8 -4
  336. package/dist/exports/atoms/std-quest.orb +14 -5
  337. package/dist/exports/atoms/std-rate-limiter.orb +8 -4
  338. package/dist/exports/atoms/std-rating.orb +8 -4
  339. package/dist/exports/atoms/std-score-board.orb +8 -4
  340. package/dist/exports/atoms/std-score.orb +8 -4
  341. package/dist/exports/atoms/std-search.orb +8 -4
  342. package/dist/exports/atoms/std-selection.orb +8 -4
  343. package/dist/exports/atoms/std-service-custom-bearer.orb +19 -4
  344. package/dist/exports/atoms/std-service-custom-header.orb +21 -4
  345. package/dist/exports/atoms/std-service-custom-noauth.orb +15 -4
  346. package/dist/exports/atoms/std-service-custom-query.orb +21 -4
  347. package/dist/exports/atoms/std-service-email.orb +8 -4
  348. package/dist/exports/atoms/std-service-github.orb +8 -4
  349. package/dist/exports/atoms/std-service-llm.orb +8 -4
  350. package/dist/exports/atoms/std-service-oauth.orb +8 -4
  351. package/dist/exports/atoms/std-service-redis.orb +8 -4
  352. package/dist/exports/atoms/std-service-storage.orb +8 -4
  353. package/dist/exports/atoms/std-service-stripe.orb +8 -4
  354. package/dist/exports/atoms/std-service-twilio.orb +8 -4
  355. package/dist/exports/atoms/std-service-youtube.orb +8 -4
  356. package/dist/exports/atoms/std-simulation-canvas.orb +8 -4
  357. package/dist/exports/atoms/std-sort.orb +52 -4
  358. package/dist/exports/atoms/std-sprite.orb +8 -4
  359. package/dist/exports/atoms/std-tabs.orb +16 -4
  360. package/dist/exports/atoms/std-text-effects.orb +8 -4
  361. package/dist/exports/atoms/std-theme.orb +8 -4
  362. package/dist/exports/atoms/std-timer.orb +8 -4
  363. package/dist/exports/atoms/std-undo.orb +8 -4
  364. package/dist/exports/atoms/std-upload.orb +8 -4
  365. package/dist/exports/atoms/std-validate-on-save.orb +32 -4
  366. package/dist/exports/atoms/std-wizard.orb +26 -4
  367. package/dist/exports/molecules/std-agent-fix-loop.orb +1729 -1159
  368. package/dist/exports/molecules/std-agent-learner.orb +856 -626
  369. package/dist/exports/molecules/std-agent-planner.orb +873 -623
  370. package/dist/exports/molecules/std-agent-rag.orb +804 -604
  371. package/dist/exports/molecules/std-agent-tool-loop.orb +2860 -931
  372. package/dist/exports/molecules/std-builder-game.orb +8 -4
  373. package/dist/exports/molecules/std-cart.orb +318 -197
  374. package/dist/exports/molecules/std-classifier-game.orb +8 -4
  375. package/dist/exports/molecules/std-debugger-game.orb +8 -4
  376. package/dist/exports/molecules/std-detail.orb +489 -307
  377. package/dist/exports/molecules/std-event-handler-game.orb +8 -4
  378. package/dist/exports/molecules/std-form-advanced.orb +12 -4
  379. package/dist/exports/molecules/std-geospatial.orb +519 -364
  380. package/dist/exports/molecules/std-inventory.orb +650 -391
  381. package/dist/exports/molecules/std-list.orb +890 -526
  382. package/dist/exports/molecules/std-messaging.orb +474 -293
  383. package/dist/exports/molecules/std-negotiator-game.orb +8 -4
  384. package/dist/exports/molecules/std-platformer-game.orb +8 -4
  385. package/dist/exports/molecules/std-puzzle-game.orb +8 -4
  386. package/dist/exports/molecules/std-quiz.orb +8 -4
  387. package/dist/exports/molecules/std-sequencer-game.orb +8 -4
  388. package/dist/exports/molecules/std-service-content-pipeline.orb +8 -4
  389. package/dist/exports/molecules/std-service-custom-api-tester.orb +46 -4
  390. package/dist/exports/molecules/std-service-devops-toolkit.orb +8 -4
  391. package/dist/exports/molecules/std-service-notification-hub.orb +8 -4
  392. package/dist/exports/molecules/std-service-payment-flow.orb +8 -4
  393. package/dist/exports/molecules/std-simulator-game.orb +8 -4
  394. package/dist/exports/molecules/std-turn-based-battle.orb +8 -4
  395. package/dist/exports/organisms/std-agent-assistant.orb +28 -4
  396. package/dist/exports/organisms/std-agent-builder.orb +1321 -835
  397. package/dist/exports/organisms/std-agent-pipeline.orb +1284 -782
  398. package/dist/exports/organisms/std-agent-reviewer.orb +372 -300
  399. package/dist/exports/organisms/std-agent-tutor.orb +378 -295
  400. package/dist/exports/organisms/std-api-gateway.orb +21 -4
  401. package/dist/exports/organisms/std-arcade-game.orb +4 -4
  402. package/dist/exports/organisms/std-booking-system.orb +38 -4
  403. package/dist/exports/organisms/std-cicd-pipeline.orb +25 -4
  404. package/dist/exports/organisms/std-cms.orb +42 -4
  405. package/dist/exports/organisms/std-coding-academy.orb +4 -4
  406. package/dist/exports/organisms/std-crm.orb +42 -4
  407. package/dist/exports/organisms/std-devops-dashboard.orb +21 -4
  408. package/dist/exports/organisms/std-ecommerce.orb +46 -4
  409. package/dist/exports/organisms/std-finance-tracker.orb +25 -4
  410. package/dist/exports/organisms/std-healthcare.orb +42 -4
  411. package/dist/exports/organisms/std-helpdesk.orb +25 -4
  412. package/dist/exports/organisms/std-hr-portal.orb +38 -4
  413. package/dist/exports/organisms/std-iot-dashboard.orb +21 -4
  414. package/dist/exports/organisms/std-lms.orb +21 -4
  415. package/dist/exports/organisms/std-logic-training.orb +4 -4
  416. package/dist/exports/organisms/std-platformer-app.orb +16 -4
  417. package/dist/exports/organisms/std-project-manager.orb +38 -4
  418. package/dist/exports/organisms/std-puzzle-app.orb +4 -4
  419. package/dist/exports/organisms/std-realtime-chat.orb +25 -4
  420. package/dist/exports/organisms/std-rpg-game.orb +20 -4
  421. package/dist/exports/organisms/std-service-marketplace.orb +46 -8
  422. package/dist/exports/organisms/std-service-research-assistant.orb +15 -4
  423. package/dist/exports/organisms/std-social-feed.orb +12 -4
  424. package/dist/exports/organisms/std-stem-lab.orb +4 -4
  425. package/dist/exports/organisms/std-strategy-game.orb +4 -4
  426. package/dist/exports/organisms/std-trading-dashboard.orb +25 -4
  427. package/dist/exports/validation-report.json +1662 -1
  428. package/dist/index.d.ts +1 -1
  429. package/dist/index.js +226 -207
  430. package/dist/index.js.map +1 -1
  431. package/package.json +5 -5
@@ -1,28 +1,9 @@
1
1
  {
2
- "name": "std-agent-tool-loop",
2
+ "name": "AgentToolLoopOrbital",
3
3
  "version": "1.0.0",
4
- "description": "std-agent-tool-loop -- Tool execution loop",
5
4
  "orbitals": [
6
5
  {
7
6
  "name": "AgentToolLoopOrbital",
8
- "uses": [
9
- {
10
- "from": "std/behaviors/std-agent-completion",
11
- "as": "AgentCompletion"
12
- },
13
- {
14
- "from": "std/behaviors/std-agent-context-window",
15
- "as": "AgentContextWindow"
16
- },
17
- {
18
- "from": "std/behaviors/std-agent-step-progress",
19
- "as": "AgentStepProgress"
20
- },
21
- {
22
- "from": "std/behaviors/std-agent-tool-call",
23
- "as": "AgentToolCall"
24
- }
25
- ],
26
7
  "entity": {
27
8
  "name": "AgentToolLoop",
28
9
  "persistence": "runtime",
@@ -53,6 +34,10 @@
53
34
  "name": "createdAt",
54
35
  "type": "string"
55
36
  },
37
+ {
38
+ "name": "pendingId",
39
+ "type": "string"
40
+ },
56
41
  {
57
42
  "name": "task",
58
43
  "type": "string",
@@ -515,15 +500,9 @@
515
500
  "label": [
516
501
  "str/concat",
517
502
  "Iteration ",
518
- [
519
- "str/concat",
520
- "@entity.iterations"
521
- ],
503
+ "@entity.iterations",
522
504
  "/",
523
- [
524
- "str/concat",
525
- "@entity.maxIterations"
526
- ]
505
+ "@entity.maxIterations"
527
506
  ]
528
507
  }
529
508
  ]
@@ -635,10 +614,7 @@
635
614
  "label": [
636
615
  "str/concat",
637
616
  "Iteration ",
638
- [
639
- "str/concat",
640
- "@entity.iterations"
641
- ]
617
+ "@entity.iterations"
642
618
  ]
643
619
  }
644
620
  ]
@@ -854,15 +830,9 @@
854
830
  "label": [
855
831
  "str/concat",
856
832
  "Iteration ",
857
- [
858
- "str/concat",
859
- "@entity.iterations"
860
- ],
833
+ "@entity.iterations",
861
834
  "/",
862
- [
863
- "str/concat",
864
- "@entity.maxIterations"
865
- ]
835
+ "@entity.maxIterations"
866
836
  ]
867
837
  }
868
838
  ]
@@ -1344,289 +1314,2299 @@
1344
1314
  }
1345
1315
  },
1346
1316
  {
1347
- "ref": "AgentStepProgress.traits.AgentStepProgressProgress",
1348
1317
  "name": "ToolLoopStepProgress",
1349
1318
  "linkedEntity": "AgentToolLoop",
1350
- "listens": [],
1351
- "emitsScope": "internal",
1352
- "effects": {
1353
- "INIT": [
1354
- [
1355
- "fetch",
1356
- "AgentToolLoop"
1357
- ],
1358
- [
1359
- "render-ui",
1360
- "main",
1319
+ "category": "interaction",
1320
+ "emits": [
1321
+ {
1322
+ "event": "ADVANCE",
1323
+ "scope": "internal",
1324
+ "payload": [
1325
+ {
1326
+ "name": "step",
1327
+ "type": "number"
1328
+ }
1329
+ ]
1330
+ },
1331
+ {
1332
+ "event": "COMPLETE",
1333
+ "scope": "internal",
1334
+ "payload": [
1335
+ {
1336
+ "name": "totalSteps",
1337
+ "type": "number"
1338
+ }
1339
+ ]
1340
+ },
1341
+ {
1342
+ "event": "FAIL",
1343
+ "scope": "internal",
1344
+ "payload": [
1361
1345
  {
1362
- "type": "stack",
1363
- "direction": "vertical",
1364
- "gap": "lg",
1365
- "children": [
1346
+ "name": "step",
1347
+ "type": "number"
1348
+ }
1349
+ ]
1350
+ }
1351
+ ],
1352
+ "listens": [],
1353
+ "stateMachine": {
1354
+ "states": [
1355
+ {
1356
+ "name": "idle",
1357
+ "isInitial": true
1358
+ },
1359
+ {
1360
+ "name": "in_progress"
1361
+ },
1362
+ {
1363
+ "name": "completed"
1364
+ },
1365
+ {
1366
+ "name": "failed"
1367
+ }
1368
+ ],
1369
+ "events": [
1370
+ {
1371
+ "key": "INIT",
1372
+ "name": "Initialize"
1373
+ },
1374
+ {
1375
+ "key": "START",
1376
+ "name": "Start Pipeline"
1377
+ },
1378
+ {
1379
+ "key": "ADVANCE",
1380
+ "name": "Advance Step"
1381
+ },
1382
+ {
1383
+ "key": "COMPLETE",
1384
+ "name": "Complete Pipeline"
1385
+ },
1386
+ {
1387
+ "key": "FAIL",
1388
+ "name": "Pipeline Failed"
1389
+ },
1390
+ {
1391
+ "key": "RESET",
1392
+ "name": "Reset Pipeline"
1393
+ }
1394
+ ],
1395
+ "transitions": [
1396
+ {
1397
+ "from": "idle",
1398
+ "to": "idle",
1399
+ "event": "INIT",
1400
+ "effects": [
1401
+ [
1402
+ "fetch",
1403
+ "AgentToolLoop"
1404
+ ],
1405
+ [
1406
+ "render-ui",
1407
+ "main",
1366
1408
  {
1367
1409
  "type": "stack",
1368
- "direction": "horizontal",
1369
- "gap": "sm",
1370
- "align": "center",
1410
+ "direction": "vertical",
1411
+ "gap": "lg",
1371
1412
  "children": [
1372
1413
  {
1373
- "type": "icon",
1374
- "name": "list-ordered",
1375
- "size": "lg"
1376
- },
1377
- {
1378
- "type": "typography",
1379
- "content": "AgentToolLoop",
1380
- "variant": "h2"
1381
- },
1382
- {
1383
- "type": "badge",
1384
- "label": "Idle",
1385
- "variant": "default"
1386
- }
1387
- ]
1388
- },
1389
- {
1390
- "type": "divider"
1391
- },
1392
- {
1393
- "type": "wizard-progress",
1394
- "currentStep": "@entity.currentStep",
1395
- "steps": [
1396
- {
1397
- "id": "0",
1398
- "title": "Plan"
1414
+ "type": "stack",
1415
+ "direction": "horizontal",
1416
+ "gap": "sm",
1417
+ "align": "center",
1418
+ "children": [
1419
+ {
1420
+ "type": "icon",
1421
+ "name": "list-ordered",
1422
+ "size": "lg"
1423
+ },
1424
+ {
1425
+ "type": "typography",
1426
+ "content": "AgentToolLoop",
1427
+ "variant": "h2"
1428
+ },
1429
+ {
1430
+ "type": "badge",
1431
+ "label": "Idle",
1432
+ "variant": "default"
1433
+ }
1434
+ ]
1399
1435
  },
1400
1436
  {
1401
- "id": "1",
1402
- "title": "Execute"
1437
+ "type": "divider"
1403
1438
  },
1404
1439
  {
1405
- "id": "2",
1406
- "title": "Check"
1440
+ "type": "wizard-progress",
1441
+ "currentStep": "@entity.currentStep",
1442
+ "steps": [
1443
+ {
1444
+ "id": "0",
1445
+ "title": "Plan"
1446
+ },
1447
+ {
1448
+ "id": "1",
1449
+ "title": "Execute"
1450
+ },
1451
+ {
1452
+ "id": "2",
1453
+ "title": "Check"
1454
+ },
1455
+ {
1456
+ "id": "3",
1457
+ "title": "Complete"
1458
+ }
1459
+ ]
1407
1460
  },
1408
1461
  {
1409
- "id": "3",
1410
- "title": "Complete"
1462
+ "type": "button",
1463
+ "label": "Start",
1464
+ "event": "START",
1465
+ "variant": "primary",
1466
+ "icon": "play"
1411
1467
  }
1412
1468
  ]
1413
- },
1414
- {
1415
- "type": "button",
1416
- "label": "Start",
1417
- "event": "START",
1418
- "variant": "primary",
1419
- "icon": "play"
1420
1469
  }
1421
1470
  ]
1422
- }
1423
- ]
1424
- ],
1425
- "START": [
1426
- [
1427
- "set",
1428
- "@entity.status",
1429
- "in_progress"
1430
- ],
1431
- [
1432
- "set",
1433
- "@entity.currentStep",
1434
- 0
1435
- ],
1436
- [
1437
- "render-ui",
1438
- "main",
1439
- {
1440
- "type": "stack",
1441
- "direction": "vertical",
1442
- "gap": "lg",
1443
- "children": [
1471
+ ]
1472
+ },
1473
+ {
1474
+ "from": "idle",
1475
+ "to": "in_progress",
1476
+ "event": "START",
1477
+ "effects": [
1478
+ [
1479
+ "set",
1480
+ "@entity.status",
1481
+ "in_progress"
1482
+ ],
1483
+ [
1484
+ "set",
1485
+ "@entity.currentStep",
1486
+ 0
1487
+ ],
1488
+ [
1489
+ "render-ui",
1490
+ "main",
1444
1491
  {
1445
1492
  "type": "stack",
1446
- "direction": "horizontal",
1447
- "gap": "sm",
1448
- "align": "center",
1493
+ "direction": "vertical",
1494
+ "gap": "lg",
1449
1495
  "children": [
1450
1496
  {
1451
- "type": "icon",
1452
- "name": "loader",
1453
- "size": "lg"
1454
- },
1455
- {
1456
- "type": "typography",
1457
- "content": "AgentToolLoop",
1458
- "variant": "h2"
1459
- },
1460
- {
1461
- "type": "badge",
1462
- "label": "In Progress",
1463
- "variant": "warning"
1464
- }
1465
- ]
1466
- },
1467
- {
1468
- "type": "divider"
1469
- },
1470
- {
1471
- "type": "wizard-progress",
1472
- "currentStep": "@entity.currentStep",
1473
- "steps": [
1474
- {
1475
- "id": "0",
1476
- "title": "Plan"
1477
- },
1478
- {
1479
- "id": "1",
1480
- "title": "Execute"
1497
+ "type": "stack",
1498
+ "direction": "horizontal",
1499
+ "gap": "sm",
1500
+ "align": "center",
1501
+ "children": [
1502
+ {
1503
+ "type": "icon",
1504
+ "name": "loader",
1505
+ "size": "lg"
1506
+ },
1507
+ {
1508
+ "type": "typography",
1509
+ "content": "AgentToolLoop",
1510
+ "variant": "h2"
1511
+ },
1512
+ {
1513
+ "type": "badge",
1514
+ "label": "In Progress",
1515
+ "variant": "warning"
1516
+ }
1517
+ ]
1481
1518
  },
1482
1519
  {
1483
- "id": "2",
1484
- "title": "Check"
1520
+ "type": "divider"
1485
1521
  },
1486
1522
  {
1487
- "id": "3",
1488
- "title": "Complete"
1489
- }
1490
- ]
1491
- },
1492
- {
1493
- "type": "stack",
1494
- "direction": "horizontal",
1495
- "gap": "sm",
1496
- "align": "center",
1497
- "children": [
1498
- {
1499
- "type": "stat-display",
1500
- "label": "Current Step",
1501
- "value": "@entity.currentStep"
1523
+ "type": "wizard-progress",
1524
+ "currentStep": "@entity.currentStep",
1525
+ "steps": [
1526
+ {
1527
+ "id": "0",
1528
+ "title": "Plan"
1529
+ },
1530
+ {
1531
+ "id": "1",
1532
+ "title": "Execute"
1533
+ },
1534
+ {
1535
+ "id": "2",
1536
+ "title": "Check"
1537
+ },
1538
+ {
1539
+ "id": "3",
1540
+ "title": "Complete"
1541
+ }
1542
+ ]
1502
1543
  },
1503
1544
  {
1504
- "type": "stat-display",
1505
- "label": "Total Steps",
1506
- "value": "@entity.totalSteps"
1507
- }
1508
- ]
1509
- },
1510
- {
1511
- "type": "stack",
1512
- "direction": "horizontal",
1513
- "gap": "sm",
1514
- "children": [
1515
- {
1516
- "type": "button",
1517
- "label": "Advance",
1518
- "event": "ADVANCE",
1519
- "variant": "primary",
1520
- "icon": "chevron-right"
1545
+ "type": "stack",
1546
+ "direction": "horizontal",
1547
+ "gap": "sm",
1548
+ "align": "center",
1549
+ "children": [
1550
+ {
1551
+ "type": "stat-display",
1552
+ "label": "Current Step",
1553
+ "value": "@entity.currentStep"
1554
+ },
1555
+ {
1556
+ "type": "stat-display",
1557
+ "label": "Total Steps",
1558
+ "value": "@entity.totalSteps"
1559
+ }
1560
+ ]
1521
1561
  },
1522
1562
  {
1523
- "type": "button",
1524
- "label": "Reset",
1525
- "event": "RESET",
1526
- "variant": "ghost",
1527
- "icon": "rotate-ccw"
1563
+ "type": "stack",
1564
+ "direction": "horizontal",
1565
+ "gap": "sm",
1566
+ "children": [
1567
+ {
1568
+ "type": "button",
1569
+ "label": "Advance",
1570
+ "event": "ADVANCE",
1571
+ "variant": "primary",
1572
+ "icon": "chevron-right"
1573
+ },
1574
+ {
1575
+ "type": "button",
1576
+ "label": "Reset",
1577
+ "event": "RESET",
1578
+ "variant": "ghost",
1579
+ "icon": "rotate-ccw"
1580
+ }
1581
+ ]
1528
1582
  }
1529
1583
  ]
1530
1584
  }
1531
1585
  ]
1532
- }
1533
- ]
1534
- ],
1535
- "ADVANCE": [
1536
- [
1537
- "set",
1538
- "@entity.currentStep",
1539
- [
1540
- "+",
1541
- "@entity.currentStep",
1542
- 1
1543
1586
  ]
1544
- ],
1545
- [
1546
- "render-ui",
1547
- "main",
1548
- {
1549
- "type": "stack",
1550
- "direction": "vertical",
1551
- "gap": "lg",
1552
- "children": [
1587
+ },
1588
+ {
1589
+ "from": "in_progress",
1590
+ "to": "in_progress",
1591
+ "event": "ADVANCE",
1592
+ "guard": [
1593
+ "<",
1594
+ "@entity.currentStep",
1595
+ "@entity.totalSteps"
1596
+ ],
1597
+ "effects": [
1598
+ [
1599
+ "set",
1600
+ "@entity.currentStep",
1601
+ [
1602
+ "+",
1603
+ "@entity.currentStep",
1604
+ 1
1605
+ ]
1606
+ ],
1607
+ [
1608
+ "render-ui",
1609
+ "main",
1553
1610
  {
1554
1611
  "type": "stack",
1555
- "direction": "horizontal",
1556
- "gap": "sm",
1557
- "align": "center",
1612
+ "direction": "vertical",
1613
+ "gap": "lg",
1558
1614
  "children": [
1559
1615
  {
1560
- "type": "icon",
1561
- "name": "loader",
1562
- "size": "lg"
1616
+ "type": "stack",
1617
+ "direction": "horizontal",
1618
+ "gap": "sm",
1619
+ "align": "center",
1620
+ "children": [
1621
+ {
1622
+ "type": "icon",
1623
+ "name": "loader",
1624
+ "size": "lg"
1625
+ },
1626
+ {
1627
+ "type": "typography",
1628
+ "content": "AgentToolLoop",
1629
+ "variant": "h2"
1630
+ },
1631
+ {
1632
+ "type": "badge",
1633
+ "label": "In Progress",
1634
+ "variant": "warning"
1635
+ }
1636
+ ]
1637
+ },
1638
+ {
1639
+ "type": "divider"
1640
+ },
1641
+ {
1642
+ "type": "wizard-progress",
1643
+ "currentStep": "@entity.currentStep",
1644
+ "steps": [
1645
+ {
1646
+ "id": "0",
1647
+ "title": "Plan"
1648
+ },
1649
+ {
1650
+ "id": "1",
1651
+ "title": "Execute"
1652
+ },
1653
+ {
1654
+ "id": "2",
1655
+ "title": "Check"
1656
+ },
1657
+ {
1658
+ "id": "3",
1659
+ "title": "Complete"
1660
+ }
1661
+ ]
1662
+ },
1663
+ {
1664
+ "type": "stack",
1665
+ "direction": "horizontal",
1666
+ "gap": "sm",
1667
+ "align": "center",
1668
+ "children": [
1669
+ {
1670
+ "type": "stat-display",
1671
+ "label": "Current Step",
1672
+ "value": "@entity.currentStep"
1673
+ },
1674
+ {
1675
+ "type": "stat-display",
1676
+ "label": "Total Steps",
1677
+ "value": "@entity.totalSteps"
1678
+ }
1679
+ ]
1680
+ },
1681
+ {
1682
+ "type": "stack",
1683
+ "direction": "horizontal",
1684
+ "gap": "sm",
1685
+ "children": [
1686
+ {
1687
+ "type": "button",
1688
+ "label": "Advance",
1689
+ "event": "ADVANCE",
1690
+ "variant": "primary",
1691
+ "icon": "chevron-right"
1692
+ },
1693
+ {
1694
+ "type": "button",
1695
+ "label": "Reset",
1696
+ "event": "RESET",
1697
+ "variant": "ghost",
1698
+ "icon": "rotate-ccw"
1699
+ }
1700
+ ]
1701
+ }
1702
+ ]
1703
+ }
1704
+ ]
1705
+ ]
1706
+ },
1707
+ {
1708
+ "from": "in_progress",
1709
+ "to": "completed",
1710
+ "event": "COMPLETE",
1711
+ "effects": [
1712
+ [
1713
+ "set",
1714
+ "@entity.status",
1715
+ "completed"
1716
+ ],
1717
+ [
1718
+ "set",
1719
+ "@entity.currentStep",
1720
+ "@entity.totalSteps"
1721
+ ],
1722
+ [
1723
+ "render-ui",
1724
+ "main",
1725
+ {
1726
+ "type": "stack",
1727
+ "direction": "vertical",
1728
+ "gap": "lg",
1729
+ "children": [
1730
+ {
1731
+ "type": "stack",
1732
+ "direction": "horizontal",
1733
+ "gap": "sm",
1734
+ "align": "center",
1735
+ "children": [
1736
+ {
1737
+ "type": "icon",
1738
+ "name": "check-circle",
1739
+ "size": "lg"
1740
+ },
1741
+ {
1742
+ "type": "typography",
1743
+ "content": "AgentToolLoop",
1744
+ "variant": "h2"
1745
+ },
1746
+ {
1747
+ "type": "badge",
1748
+ "label": "Completed",
1749
+ "variant": "success"
1750
+ }
1751
+ ]
1752
+ },
1753
+ {
1754
+ "type": "divider"
1755
+ },
1756
+ {
1757
+ "type": "wizard-progress",
1758
+ "currentStep": "@entity.totalSteps",
1759
+ "steps": [
1760
+ {
1761
+ "id": "0",
1762
+ "title": "Plan"
1763
+ },
1764
+ {
1765
+ "id": "1",
1766
+ "title": "Execute"
1767
+ },
1768
+ {
1769
+ "id": "2",
1770
+ "title": "Check"
1771
+ },
1772
+ {
1773
+ "id": "3",
1774
+ "title": "Complete"
1775
+ }
1776
+ ]
1777
+ },
1778
+ {
1779
+ "type": "alert",
1780
+ "variant": "success",
1781
+ "message": "All steps completed successfully."
1782
+ },
1783
+ {
1784
+ "type": "button",
1785
+ "label": "Reset",
1786
+ "event": "RESET",
1787
+ "variant": "ghost",
1788
+ "icon": "rotate-ccw"
1789
+ }
1790
+ ]
1791
+ }
1792
+ ]
1793
+ ]
1794
+ },
1795
+ {
1796
+ "from": "in_progress",
1797
+ "to": "failed",
1798
+ "event": "FAIL",
1799
+ "effects": [
1800
+ [
1801
+ "set",
1802
+ "@entity.status",
1803
+ "failed"
1804
+ ],
1805
+ [
1806
+ "render-ui",
1807
+ "main",
1808
+ {
1809
+ "type": "stack",
1810
+ "direction": "vertical",
1811
+ "gap": "lg",
1812
+ "children": [
1813
+ {
1814
+ "type": "stack",
1815
+ "direction": "horizontal",
1816
+ "gap": "sm",
1817
+ "align": "center",
1818
+ "children": [
1819
+ {
1820
+ "type": "icon",
1821
+ "name": "x-circle",
1822
+ "size": "lg"
1823
+ },
1824
+ {
1825
+ "type": "typography",
1826
+ "content": "AgentToolLoop",
1827
+ "variant": "h2"
1828
+ },
1829
+ {
1830
+ "type": "badge",
1831
+ "label": "Failed",
1832
+ "variant": "destructive"
1833
+ }
1834
+ ]
1835
+ },
1836
+ {
1837
+ "type": "divider"
1838
+ },
1839
+ {
1840
+ "type": "wizard-progress",
1841
+ "currentStep": "@entity.currentStep",
1842
+ "steps": [
1843
+ {
1844
+ "id": "0",
1845
+ "title": "Plan"
1846
+ },
1847
+ {
1848
+ "id": "1",
1849
+ "title": "Execute"
1850
+ },
1851
+ {
1852
+ "id": "2",
1853
+ "title": "Check"
1854
+ },
1855
+ {
1856
+ "id": "3",
1857
+ "title": "Complete"
1858
+ }
1859
+ ]
1860
+ },
1861
+ {
1862
+ "type": "alert",
1863
+ "variant": "error",
1864
+ "message": "Pipeline failed at the current step."
1865
+ },
1866
+ {
1867
+ "type": "stack",
1868
+ "direction": "horizontal",
1869
+ "gap": "sm",
1870
+ "children": [
1871
+ {
1872
+ "type": "stat-display",
1873
+ "label": "Failed At Step",
1874
+ "value": "@entity.currentStep"
1875
+ }
1876
+ ]
1877
+ },
1878
+ {
1879
+ "type": "button",
1880
+ "label": "Reset",
1881
+ "event": "RESET",
1882
+ "variant": "ghost",
1883
+ "icon": "rotate-ccw"
1884
+ }
1885
+ ]
1886
+ }
1887
+ ]
1888
+ ]
1889
+ },
1890
+ {
1891
+ "from": "idle",
1892
+ "to": "idle",
1893
+ "event": "RESET",
1894
+ "effects": [
1895
+ [
1896
+ "set",
1897
+ "@entity.status",
1898
+ "idle"
1899
+ ],
1900
+ [
1901
+ "set",
1902
+ "@entity.currentStep",
1903
+ 0
1904
+ ],
1905
+ [
1906
+ "render-ui",
1907
+ "main",
1908
+ {
1909
+ "type": "stack",
1910
+ "direction": "vertical",
1911
+ "gap": "lg",
1912
+ "children": [
1913
+ {
1914
+ "type": "stack",
1915
+ "direction": "horizontal",
1916
+ "gap": "sm",
1917
+ "align": "center",
1918
+ "children": [
1919
+ {
1920
+ "type": "icon",
1921
+ "name": "list-ordered",
1922
+ "size": "lg"
1923
+ },
1924
+ {
1925
+ "type": "typography",
1926
+ "content": "AgentToolLoop",
1927
+ "variant": "h2"
1928
+ },
1929
+ {
1930
+ "type": "badge",
1931
+ "label": "Idle",
1932
+ "variant": "default"
1933
+ }
1934
+ ]
1935
+ },
1936
+ {
1937
+ "type": "divider"
1938
+ },
1939
+ {
1940
+ "type": "wizard-progress",
1941
+ "currentStep": "@entity.currentStep",
1942
+ "steps": [
1943
+ {
1944
+ "id": "0",
1945
+ "title": "Plan"
1946
+ },
1947
+ {
1948
+ "id": "1",
1949
+ "title": "Execute"
1950
+ },
1951
+ {
1952
+ "id": "2",
1953
+ "title": "Check"
1954
+ },
1955
+ {
1956
+ "id": "3",
1957
+ "title": "Complete"
1958
+ }
1959
+ ]
1960
+ },
1961
+ {
1962
+ "type": "button",
1963
+ "label": "Start",
1964
+ "event": "START",
1965
+ "variant": "primary",
1966
+ "icon": "play"
1967
+ }
1968
+ ]
1969
+ }
1970
+ ]
1971
+ ]
1972
+ },
1973
+ {
1974
+ "from": "in_progress",
1975
+ "to": "idle",
1976
+ "event": "RESET",
1977
+ "effects": [
1978
+ [
1979
+ "set",
1980
+ "@entity.status",
1981
+ "idle"
1982
+ ],
1983
+ [
1984
+ "set",
1985
+ "@entity.currentStep",
1986
+ 0
1987
+ ],
1988
+ [
1989
+ "render-ui",
1990
+ "main",
1991
+ {
1992
+ "type": "stack",
1993
+ "direction": "vertical",
1994
+ "gap": "lg",
1995
+ "children": [
1996
+ {
1997
+ "type": "stack",
1998
+ "direction": "horizontal",
1999
+ "gap": "sm",
2000
+ "align": "center",
2001
+ "children": [
2002
+ {
2003
+ "type": "icon",
2004
+ "name": "list-ordered",
2005
+ "size": "lg"
2006
+ },
2007
+ {
2008
+ "type": "typography",
2009
+ "content": "AgentToolLoop",
2010
+ "variant": "h2"
2011
+ },
2012
+ {
2013
+ "type": "badge",
2014
+ "label": "Idle",
2015
+ "variant": "default"
2016
+ }
2017
+ ]
2018
+ },
2019
+ {
2020
+ "type": "divider"
2021
+ },
2022
+ {
2023
+ "type": "wizard-progress",
2024
+ "currentStep": "@entity.currentStep",
2025
+ "steps": [
2026
+ {
2027
+ "id": "0",
2028
+ "title": "Plan"
2029
+ },
2030
+ {
2031
+ "id": "1",
2032
+ "title": "Execute"
2033
+ },
2034
+ {
2035
+ "id": "2",
2036
+ "title": "Check"
2037
+ },
2038
+ {
2039
+ "id": "3",
2040
+ "title": "Complete"
2041
+ }
2042
+ ]
2043
+ },
2044
+ {
2045
+ "type": "button",
2046
+ "label": "Start",
2047
+ "event": "START",
2048
+ "variant": "primary",
2049
+ "icon": "play"
2050
+ }
2051
+ ]
2052
+ }
2053
+ ]
2054
+ ]
2055
+ },
2056
+ {
2057
+ "from": "completed",
2058
+ "to": "idle",
2059
+ "event": "RESET",
2060
+ "effects": [
2061
+ [
2062
+ "set",
2063
+ "@entity.status",
2064
+ "idle"
2065
+ ],
2066
+ [
2067
+ "set",
2068
+ "@entity.currentStep",
2069
+ 0
2070
+ ],
2071
+ [
2072
+ "render-ui",
2073
+ "main",
2074
+ {
2075
+ "type": "stack",
2076
+ "direction": "vertical",
2077
+ "gap": "lg",
2078
+ "children": [
2079
+ {
2080
+ "type": "stack",
2081
+ "direction": "horizontal",
2082
+ "gap": "sm",
2083
+ "align": "center",
2084
+ "children": [
2085
+ {
2086
+ "type": "icon",
2087
+ "name": "list-ordered",
2088
+ "size": "lg"
2089
+ },
2090
+ {
2091
+ "type": "typography",
2092
+ "content": "AgentToolLoop",
2093
+ "variant": "h2"
2094
+ },
2095
+ {
2096
+ "type": "badge",
2097
+ "label": "Idle",
2098
+ "variant": "default"
2099
+ }
2100
+ ]
2101
+ },
2102
+ {
2103
+ "type": "divider"
2104
+ },
2105
+ {
2106
+ "type": "wizard-progress",
2107
+ "currentStep": "@entity.currentStep",
2108
+ "steps": [
2109
+ {
2110
+ "id": "0",
2111
+ "title": "Plan"
2112
+ },
2113
+ {
2114
+ "id": "1",
2115
+ "title": "Execute"
2116
+ },
2117
+ {
2118
+ "id": "2",
2119
+ "title": "Check"
2120
+ },
2121
+ {
2122
+ "id": "3",
2123
+ "title": "Complete"
2124
+ }
2125
+ ]
2126
+ },
2127
+ {
2128
+ "type": "button",
2129
+ "label": "Start",
2130
+ "event": "START",
2131
+ "variant": "primary",
2132
+ "icon": "play"
2133
+ }
2134
+ ]
2135
+ }
2136
+ ]
2137
+ ]
2138
+ },
2139
+ {
2140
+ "from": "failed",
2141
+ "to": "idle",
2142
+ "event": "RESET",
2143
+ "effects": [
2144
+ [
2145
+ "set",
2146
+ "@entity.status",
2147
+ "idle"
2148
+ ],
2149
+ [
2150
+ "set",
2151
+ "@entity.currentStep",
2152
+ 0
2153
+ ],
2154
+ [
2155
+ "render-ui",
2156
+ "main",
2157
+ {
2158
+ "type": "stack",
2159
+ "direction": "vertical",
2160
+ "gap": "lg",
2161
+ "children": [
2162
+ {
2163
+ "type": "stack",
2164
+ "direction": "horizontal",
2165
+ "gap": "sm",
2166
+ "align": "center",
2167
+ "children": [
2168
+ {
2169
+ "type": "icon",
2170
+ "name": "list-ordered",
2171
+ "size": "lg"
2172
+ },
2173
+ {
2174
+ "type": "typography",
2175
+ "content": "AgentToolLoop",
2176
+ "variant": "h2"
2177
+ },
2178
+ {
2179
+ "type": "badge",
2180
+ "label": "Idle",
2181
+ "variant": "default"
2182
+ }
2183
+ ]
2184
+ },
2185
+ {
2186
+ "type": "divider"
2187
+ },
2188
+ {
2189
+ "type": "wizard-progress",
2190
+ "currentStep": "@entity.currentStep",
2191
+ "steps": [
2192
+ {
2193
+ "id": "0",
2194
+ "title": "Plan"
2195
+ },
2196
+ {
2197
+ "id": "1",
2198
+ "title": "Execute"
2199
+ },
2200
+ {
2201
+ "id": "2",
2202
+ "title": "Check"
2203
+ },
2204
+ {
2205
+ "id": "3",
2206
+ "title": "Complete"
2207
+ }
2208
+ ]
2209
+ },
2210
+ {
2211
+ "type": "button",
2212
+ "label": "Start",
2213
+ "event": "START",
2214
+ "variant": "primary",
2215
+ "icon": "play"
2216
+ }
2217
+ ]
2218
+ }
2219
+ ]
2220
+ ]
2221
+ }
2222
+ ]
2223
+ }
2224
+ },
2225
+ {
2226
+ "name": "ToolLoopCompletionFlow",
2227
+ "linkedEntity": "AgentToolLoop",
2228
+ "category": "interaction",
2229
+ "emits": [
2230
+ {
2231
+ "event": "SAVE",
2232
+ "scope": "internal"
2233
+ },
2234
+ {
2235
+ "event": "GENERATED",
2236
+ "scope": "internal"
2237
+ }
2238
+ ],
2239
+ "stateMachine": {
2240
+ "states": [
2241
+ {
2242
+ "name": "closed",
2243
+ "isInitial": true
2244
+ },
2245
+ {
2246
+ "name": "open"
2247
+ }
2248
+ ],
2249
+ "events": [
2250
+ {
2251
+ "key": "INIT",
2252
+ "name": "Initialize"
2253
+ },
2254
+ {
2255
+ "key": "GENERATE",
2256
+ "name": "Open"
2257
+ },
2258
+ {
2259
+ "key": "CLOSE",
2260
+ "name": "Close"
2261
+ },
2262
+ {
2263
+ "key": "SAVE",
2264
+ "name": "Save",
2265
+ "payload": [
2266
+ {
2267
+ "name": "data",
2268
+ "type": "object",
2269
+ "required": true
2270
+ }
2271
+ ]
2272
+ }
2273
+ ],
2274
+ "transitions": [
2275
+ {
2276
+ "from": "closed",
2277
+ "to": "closed",
2278
+ "event": "INIT",
2279
+ "effects": [
2280
+ [
2281
+ "ref",
2282
+ "AgentToolLoop"
2283
+ ],
2284
+ [
2285
+ "render-ui",
2286
+ "main",
2287
+ {
2288
+ "type": "stack",
2289
+ "direction": "vertical",
2290
+ "gap": "lg",
2291
+ "children": [
2292
+ {
2293
+ "type": "stack",
2294
+ "direction": "horizontal",
2295
+ "gap": "md",
2296
+ "justify": "space-between",
2297
+ "children": [
2298
+ {
2299
+ "type": "stack",
2300
+ "direction": "horizontal",
2301
+ "gap": "md",
2302
+ "children": [
2303
+ {
2304
+ "type": "icon",
2305
+ "name": "sparkles",
2306
+ "size": "lg"
2307
+ },
2308
+ {
2309
+ "type": "typography",
2310
+ "content": "AgentToolLoop",
2311
+ "variant": "h2"
2312
+ }
2313
+ ]
2314
+ },
2315
+ {
2316
+ "type": "button",
2317
+ "label": "Open",
2318
+ "event": "GENERATE",
2319
+ "variant": "primary",
2320
+ "icon": "sparkles"
2321
+ }
2322
+ ]
2323
+ },
2324
+ {
2325
+ "type": "divider"
2326
+ },
2327
+ {
2328
+ "type": "empty-state",
2329
+ "icon": "sparkles",
2330
+ "title": "Nothing open",
2331
+ "description": "Click Open to view details in a modal overlay."
2332
+ }
2333
+ ]
2334
+ }
2335
+ ]
2336
+ ]
2337
+ },
2338
+ {
2339
+ "from": "closed",
2340
+ "to": "open",
2341
+ "event": "GENERATE",
2342
+ "effects": [
2343
+ [
2344
+ "render-ui",
2345
+ "modal",
2346
+ {
2347
+ "type": "stack",
2348
+ "direction": "vertical",
2349
+ "gap": "md",
2350
+ "children": [
2351
+ {
2352
+ "type": "stack",
2353
+ "direction": "horizontal",
2354
+ "gap": "sm",
2355
+ "children": [
2356
+ {
2357
+ "type": "icon",
2358
+ "name": "sparkles",
2359
+ "size": "md"
2360
+ },
2361
+ {
2362
+ "type": "typography",
2363
+ "content": "AgentToolLoop",
2364
+ "variant": "h3"
2365
+ }
2366
+ ]
2367
+ },
2368
+ {
2369
+ "type": "divider"
2370
+ },
2371
+ {
2372
+ "type": "stack",
2373
+ "direction": "horizontal",
2374
+ "gap": "sm",
2375
+ "children": [
2376
+ {
2377
+ "type": "badge",
2378
+ "label": "@entity.provider"
2379
+ },
2380
+ {
2381
+ "type": "badge",
2382
+ "label": "@entity.model"
2383
+ }
2384
+ ]
2385
+ },
2386
+ {
2387
+ "type": "form-section",
2388
+ "entity": "AgentToolLoop",
2389
+ "mode": "create",
2390
+ "submitEvent": "SAVE",
2391
+ "cancelEvent": "CLOSE",
2392
+ "fields": [
2393
+ "prompt"
2394
+ ]
2395
+ }
2396
+ ]
2397
+ }
2398
+ ]
2399
+ ]
2400
+ },
2401
+ {
2402
+ "from": "open",
2403
+ "to": "closed",
2404
+ "event": "CLOSE",
2405
+ "effects": [
2406
+ [
2407
+ "render-ui",
2408
+ "modal",
2409
+ null
2410
+ ],
2411
+ [
2412
+ "notify",
2413
+ "Cancelled",
2414
+ "info"
2415
+ ],
2416
+ [
2417
+ "ref",
2418
+ "AgentToolLoop"
2419
+ ],
2420
+ [
2421
+ "render-ui",
2422
+ "main",
2423
+ {
2424
+ "type": "stack",
2425
+ "direction": "vertical",
2426
+ "gap": "lg",
2427
+ "children": [
2428
+ {
2429
+ "type": "stack",
2430
+ "direction": "horizontal",
2431
+ "gap": "md",
2432
+ "justify": "space-between",
2433
+ "children": [
2434
+ {
2435
+ "type": "stack",
2436
+ "direction": "horizontal",
2437
+ "gap": "md",
2438
+ "children": [
2439
+ {
2440
+ "type": "icon",
2441
+ "name": "sparkles",
2442
+ "size": "lg"
2443
+ },
2444
+ {
2445
+ "type": "typography",
2446
+ "content": "AgentToolLoop",
2447
+ "variant": "h2"
2448
+ }
2449
+ ]
2450
+ },
2451
+ {
2452
+ "type": "button",
2453
+ "label": "Open",
2454
+ "event": "GENERATE",
2455
+ "variant": "primary",
2456
+ "icon": "sparkles"
2457
+ }
2458
+ ]
2459
+ },
2460
+ {
2461
+ "type": "divider"
2462
+ },
2463
+ {
2464
+ "type": "empty-state",
2465
+ "icon": "sparkles",
2466
+ "title": "Nothing open",
2467
+ "description": "Click Open to view details in a modal overlay."
2468
+ }
2469
+ ]
2470
+ }
2471
+ ]
2472
+ ]
2473
+ },
2474
+ {
2475
+ "from": "open",
2476
+ "to": "closed",
2477
+ "event": "SAVE",
2478
+ "effects": [
2479
+ [
2480
+ "persist",
2481
+ "create",
2482
+ "AgentToolLoop",
2483
+ "@payload.data"
2484
+ ],
2485
+ [
2486
+ "render-ui",
2487
+ "modal",
2488
+ null
2489
+ ],
2490
+ [
2491
+ "emit",
2492
+ "GENERATED"
2493
+ ],
2494
+ [
2495
+ "ref",
2496
+ "AgentToolLoop"
2497
+ ],
2498
+ [
2499
+ "render-ui",
2500
+ "main",
2501
+ {
2502
+ "type": "stack",
2503
+ "direction": "vertical",
2504
+ "gap": "lg",
2505
+ "children": [
2506
+ {
2507
+ "type": "stack",
2508
+ "direction": "horizontal",
2509
+ "gap": "md",
2510
+ "justify": "space-between",
2511
+ "children": [
2512
+ {
2513
+ "type": "stack",
2514
+ "direction": "horizontal",
2515
+ "gap": "md",
2516
+ "children": [
2517
+ {
2518
+ "type": "icon",
2519
+ "name": "sparkles",
2520
+ "size": "lg"
2521
+ },
2522
+ {
2523
+ "type": "typography",
2524
+ "content": "AgentToolLoop",
2525
+ "variant": "h2"
2526
+ }
2527
+ ]
2528
+ },
2529
+ {
2530
+ "type": "button",
2531
+ "label": "Open",
2532
+ "event": "GENERATE",
2533
+ "variant": "primary",
2534
+ "icon": "sparkles"
2535
+ }
2536
+ ]
2537
+ },
2538
+ {
2539
+ "type": "divider"
2540
+ },
2541
+ {
2542
+ "type": "empty-state",
2543
+ "icon": "sparkles",
2544
+ "title": "Nothing open",
2545
+ "description": "Click Open to view details in a modal overlay."
2546
+ }
2547
+ ]
2548
+ }
2549
+ ],
2550
+ [
2551
+ "notify",
2552
+ "AgentToolLoop created successfully"
2553
+ ]
2554
+ ]
2555
+ }
2556
+ ]
2557
+ },
2558
+ "listens": []
2559
+ },
2560
+ {
2561
+ "name": "ToolLoopToolCallFlow",
2562
+ "linkedEntity": "AgentToolLoop",
2563
+ "category": "interaction",
2564
+ "emits": [
2565
+ {
2566
+ "event": "SAVE",
2567
+ "scope": "internal"
2568
+ },
2569
+ {
2570
+ "event": "INVOKED",
2571
+ "scope": "internal"
2572
+ }
2573
+ ],
2574
+ "stateMachine": {
2575
+ "states": [
2576
+ {
2577
+ "name": "closed",
2578
+ "isInitial": true
2579
+ },
2580
+ {
2581
+ "name": "open"
2582
+ }
2583
+ ],
2584
+ "events": [
2585
+ {
2586
+ "key": "INIT",
2587
+ "name": "Initialize"
2588
+ },
2589
+ {
2590
+ "key": "INVOKE",
2591
+ "name": "Open"
2592
+ },
2593
+ {
2594
+ "key": "CLOSE",
2595
+ "name": "Close"
2596
+ },
2597
+ {
2598
+ "key": "SAVE",
2599
+ "name": "Save",
2600
+ "payload": [
2601
+ {
2602
+ "name": "data",
2603
+ "type": "object",
2604
+ "required": true
2605
+ }
2606
+ ]
2607
+ }
2608
+ ],
2609
+ "transitions": [
2610
+ {
2611
+ "from": "closed",
2612
+ "to": "closed",
2613
+ "event": "INIT",
2614
+ "effects": [
2615
+ [
2616
+ "ref",
2617
+ "AgentToolLoop"
2618
+ ],
2619
+ [
2620
+ "render-ui",
2621
+ "main",
2622
+ {
2623
+ "type": "stack",
2624
+ "direction": "vertical",
2625
+ "gap": "lg",
2626
+ "children": [
2627
+ {
2628
+ "type": "stack",
2629
+ "direction": "horizontal",
2630
+ "gap": "md",
2631
+ "justify": "space-between",
2632
+ "children": [
2633
+ {
2634
+ "type": "stack",
2635
+ "direction": "horizontal",
2636
+ "gap": "md",
2637
+ "children": [
2638
+ {
2639
+ "type": "icon",
2640
+ "name": "wrench",
2641
+ "size": "lg"
2642
+ },
2643
+ {
2644
+ "type": "typography",
2645
+ "content": "Invoke Tool",
2646
+ "variant": "h2"
2647
+ }
2648
+ ]
2649
+ },
2650
+ {
2651
+ "type": "button",
2652
+ "label": "Open",
2653
+ "event": "INVOKE",
2654
+ "variant": "primary",
2655
+ "icon": "wrench"
2656
+ }
2657
+ ]
2658
+ },
2659
+ {
2660
+ "type": "divider"
2661
+ },
2662
+ {
2663
+ "type": "empty-state",
2664
+ "icon": "wrench",
2665
+ "title": "Nothing open",
2666
+ "description": "Click Open to view details in a modal overlay."
2667
+ }
2668
+ ]
2669
+ }
2670
+ ]
2671
+ ]
2672
+ },
2673
+ {
2674
+ "from": "closed",
2675
+ "to": "open",
2676
+ "event": "INVOKE",
2677
+ "effects": [
2678
+ [
2679
+ "render-ui",
2680
+ "modal",
2681
+ {
2682
+ "type": "stack",
2683
+ "direction": "vertical",
2684
+ "gap": "md",
2685
+ "children": [
2686
+ {
2687
+ "type": "stack",
2688
+ "direction": "horizontal",
2689
+ "gap": "sm",
2690
+ "children": [
2691
+ {
2692
+ "type": "icon",
2693
+ "name": "wrench",
2694
+ "size": "md"
2695
+ },
2696
+ {
2697
+ "type": "typography",
2698
+ "content": "Invoke Tool",
2699
+ "variant": "h3"
2700
+ }
2701
+ ]
2702
+ },
2703
+ {
2704
+ "type": "divider"
2705
+ },
2706
+ {
2707
+ "type": "form-section",
2708
+ "entity": "AgentToolLoop",
2709
+ "mode": "create",
2710
+ "submitEvent": "SAVE",
2711
+ "cancelEvent": "CLOSE",
2712
+ "fields": [
2713
+ "toolName",
2714
+ "args"
2715
+ ]
2716
+ }
2717
+ ]
2718
+ }
2719
+ ]
2720
+ ]
2721
+ },
2722
+ {
2723
+ "from": "open",
2724
+ "to": "closed",
2725
+ "event": "CLOSE",
2726
+ "effects": [
2727
+ [
2728
+ "render-ui",
2729
+ "modal",
2730
+ null
2731
+ ],
2732
+ [
2733
+ "notify",
2734
+ "Cancelled",
2735
+ "info"
2736
+ ],
2737
+ [
2738
+ "ref",
2739
+ "AgentToolLoop"
2740
+ ],
2741
+ [
2742
+ "render-ui",
2743
+ "main",
2744
+ {
2745
+ "type": "stack",
2746
+ "direction": "vertical",
2747
+ "gap": "lg",
2748
+ "children": [
2749
+ {
2750
+ "type": "stack",
2751
+ "direction": "horizontal",
2752
+ "gap": "md",
2753
+ "justify": "space-between",
2754
+ "children": [
2755
+ {
2756
+ "type": "stack",
2757
+ "direction": "horizontal",
2758
+ "gap": "md",
2759
+ "children": [
2760
+ {
2761
+ "type": "icon",
2762
+ "name": "wrench",
2763
+ "size": "lg"
2764
+ },
2765
+ {
2766
+ "type": "typography",
2767
+ "content": "Invoke Tool",
2768
+ "variant": "h2"
2769
+ }
2770
+ ]
2771
+ },
2772
+ {
2773
+ "type": "button",
2774
+ "label": "Open",
2775
+ "event": "INVOKE",
2776
+ "variant": "primary",
2777
+ "icon": "wrench"
2778
+ }
2779
+ ]
2780
+ },
2781
+ {
2782
+ "type": "divider"
2783
+ },
2784
+ {
2785
+ "type": "empty-state",
2786
+ "icon": "wrench",
2787
+ "title": "Nothing open",
2788
+ "description": "Click Open to view details in a modal overlay."
2789
+ }
2790
+ ]
2791
+ }
2792
+ ]
2793
+ ]
2794
+ },
2795
+ {
2796
+ "from": "open",
2797
+ "to": "closed",
2798
+ "event": "SAVE",
2799
+ "effects": [
2800
+ [
2801
+ "persist",
2802
+ "create",
2803
+ "AgentToolLoop",
2804
+ "@payload.data"
2805
+ ],
2806
+ [
2807
+ "render-ui",
2808
+ "modal",
2809
+ null
2810
+ ],
2811
+ [
2812
+ "emit",
2813
+ "INVOKED"
2814
+ ],
2815
+ [
2816
+ "ref",
2817
+ "AgentToolLoop"
2818
+ ],
2819
+ [
2820
+ "render-ui",
2821
+ "main",
2822
+ {
2823
+ "type": "stack",
2824
+ "direction": "vertical",
2825
+ "gap": "lg",
2826
+ "children": [
2827
+ {
2828
+ "type": "stack",
2829
+ "direction": "horizontal",
2830
+ "gap": "md",
2831
+ "justify": "space-between",
2832
+ "children": [
2833
+ {
2834
+ "type": "stack",
2835
+ "direction": "horizontal",
2836
+ "gap": "md",
2837
+ "children": [
2838
+ {
2839
+ "type": "icon",
2840
+ "name": "wrench",
2841
+ "size": "lg"
2842
+ },
2843
+ {
2844
+ "type": "typography",
2845
+ "content": "Invoke Tool",
2846
+ "variant": "h2"
2847
+ }
2848
+ ]
2849
+ },
2850
+ {
2851
+ "type": "button",
2852
+ "label": "Open",
2853
+ "event": "INVOKE",
2854
+ "variant": "primary",
2855
+ "icon": "wrench"
2856
+ }
2857
+ ]
2858
+ },
2859
+ {
2860
+ "type": "divider"
2861
+ },
2862
+ {
2863
+ "type": "empty-state",
2864
+ "icon": "wrench",
2865
+ "title": "Nothing open",
2866
+ "description": "Click Open to view details in a modal overlay."
2867
+ }
2868
+ ]
2869
+ }
2870
+ ],
2871
+ [
2872
+ "notify",
2873
+ "AgentToolLoop created successfully"
2874
+ ]
2875
+ ]
2876
+ }
2877
+ ]
2878
+ },
2879
+ "listens": []
2880
+ },
2881
+ {
2882
+ "name": "ToolLoopContextMonitor",
2883
+ "linkedEntity": "AgentToolLoop",
2884
+ "category": "interaction",
2885
+ "stateMachine": {
2886
+ "states": [
2887
+ {
2888
+ "name": "normal",
2889
+ "isInitial": true
2890
+ },
2891
+ {
2892
+ "name": "warning"
2893
+ },
2894
+ {
2895
+ "name": "critical"
2896
+ }
2897
+ ],
2898
+ "events": [
2899
+ {
2900
+ "key": "INIT",
2901
+ "name": "Initialize"
2902
+ },
2903
+ {
2904
+ "key": "UPDATE",
2905
+ "name": "Update Token Count",
2906
+ "payload": [
2907
+ {
2908
+ "name": "current",
2909
+ "type": "number",
2910
+ "required": true
2911
+ }
2912
+ ]
2913
+ },
2914
+ {
2915
+ "key": "COMPACT",
2916
+ "name": "Compact Context"
2917
+ },
2918
+ {
2919
+ "key": "RESET",
2920
+ "name": "Reset Gauge"
2921
+ }
2922
+ ],
2923
+ "transitions": [
2924
+ {
2925
+ "from": "normal",
2926
+ "to": "normal",
2927
+ "event": "INIT",
2928
+ "effects": [
2929
+ [
2930
+ "fetch",
2931
+ "AgentToolLoop"
2932
+ ],
2933
+ [
2934
+ "render-ui",
2935
+ "main",
2936
+ {
2937
+ "type": "stack",
2938
+ "direction": "vertical",
2939
+ "gap": "lg",
2940
+ "children": [
2941
+ {
2942
+ "type": "stack",
2943
+ "direction": "horizontal",
2944
+ "gap": "sm",
2945
+ "align": "center",
2946
+ "children": [
2947
+ {
2948
+ "type": "icon",
2949
+ "name": "gauge",
2950
+ "size": "lg"
2951
+ },
2952
+ {
2953
+ "type": "typography",
2954
+ "content": "Token Usage",
2955
+ "variant": "h2"
2956
+ },
2957
+ {
2958
+ "type": "badge",
2959
+ "label": "Normal",
2960
+ "variant": "default"
2961
+ }
2962
+ ]
2963
+ },
2964
+ {
2965
+ "type": "divider"
2966
+ },
2967
+ {
2968
+ "type": "progress-bar",
2969
+ "value": "@entity.current",
2970
+ "max": "@entity.max"
2971
+ },
2972
+ {
2973
+ "type": "stack",
2974
+ "direction": "horizontal",
2975
+ "gap": "md",
2976
+ "children": [
2977
+ {
2978
+ "type": "stat-display",
2979
+ "label": "Tokens Used",
2980
+ "value": "@entity.current"
2981
+ },
2982
+ {
2983
+ "type": "stat-display",
2984
+ "label": "Max Tokens",
2985
+ "value": "@entity.max"
2986
+ }
2987
+ ]
2988
+ },
2989
+ {
2990
+ "type": "button",
2991
+ "label": "Reset",
2992
+ "event": "RESET",
2993
+ "variant": "ghost",
2994
+ "icon": "rotate-ccw"
2995
+ }
2996
+ ]
2997
+ }
2998
+ ]
2999
+ ]
3000
+ },
3001
+ {
3002
+ "from": "normal",
3003
+ "to": "normal",
3004
+ "event": "UPDATE",
3005
+ "guard": [
3006
+ "<",
3007
+ [
3008
+ "/",
3009
+ "@payload.current",
3010
+ "@entity.max"
3011
+ ],
3012
+ 0.85
3013
+ ],
3014
+ "effects": [
3015
+ [
3016
+ "set",
3017
+ "@entity.current",
3018
+ "@payload.current"
3019
+ ],
3020
+ [
3021
+ "render-ui",
3022
+ "main",
3023
+ {
3024
+ "type": "stack",
3025
+ "direction": "vertical",
3026
+ "gap": "lg",
3027
+ "children": [
3028
+ {
3029
+ "type": "stack",
3030
+ "direction": "horizontal",
3031
+ "gap": "sm",
3032
+ "align": "center",
3033
+ "children": [
3034
+ {
3035
+ "type": "icon",
3036
+ "name": "gauge",
3037
+ "size": "lg"
3038
+ },
3039
+ {
3040
+ "type": "typography",
3041
+ "content": "Token Usage",
3042
+ "variant": "h2"
3043
+ },
3044
+ {
3045
+ "type": "badge",
3046
+ "label": "Normal",
3047
+ "variant": "default"
3048
+ }
3049
+ ]
3050
+ },
3051
+ {
3052
+ "type": "divider"
3053
+ },
3054
+ {
3055
+ "type": "progress-bar",
3056
+ "value": "@entity.current",
3057
+ "max": "@entity.max"
3058
+ },
3059
+ {
3060
+ "type": "stack",
3061
+ "direction": "horizontal",
3062
+ "gap": "md",
3063
+ "children": [
3064
+ {
3065
+ "type": "stat-display",
3066
+ "label": "Tokens Used",
3067
+ "value": "@entity.current"
3068
+ },
3069
+ {
3070
+ "type": "stat-display",
3071
+ "label": "Max Tokens",
3072
+ "value": "@entity.max"
3073
+ }
3074
+ ]
3075
+ },
3076
+ {
3077
+ "type": "button",
3078
+ "label": "Reset",
3079
+ "event": "RESET",
3080
+ "variant": "ghost",
3081
+ "icon": "rotate-ccw"
3082
+ }
3083
+ ]
3084
+ }
3085
+ ]
3086
+ ]
3087
+ },
3088
+ {
3089
+ "from": "normal",
3090
+ "to": "warning",
3091
+ "event": "UPDATE",
3092
+ "guard": [
3093
+ "and",
3094
+ [
3095
+ ">=",
3096
+ [
3097
+ "/",
3098
+ "@payload.current",
3099
+ "@entity.max"
3100
+ ],
3101
+ 0.85
3102
+ ],
3103
+ [
3104
+ "<",
3105
+ [
3106
+ "/",
3107
+ "@payload.current",
3108
+ "@entity.max"
3109
+ ],
3110
+ 0.95
3111
+ ]
3112
+ ],
3113
+ "effects": [
3114
+ [
3115
+ "set",
3116
+ "@entity.current",
3117
+ "@payload.current"
3118
+ ],
3119
+ [
3120
+ "render-ui",
3121
+ "main",
3122
+ {
3123
+ "type": "stack",
3124
+ "direction": "vertical",
3125
+ "gap": "lg",
3126
+ "children": [
3127
+ {
3128
+ "type": "stack",
3129
+ "direction": "horizontal",
3130
+ "gap": "sm",
3131
+ "align": "center",
3132
+ "children": [
3133
+ {
3134
+ "type": "icon",
3135
+ "name": "alert-triangle",
3136
+ "size": "lg"
3137
+ },
3138
+ {
3139
+ "type": "typography",
3140
+ "content": "Token Usage",
3141
+ "variant": "h2"
3142
+ },
3143
+ {
3144
+ "type": "badge",
3145
+ "label": "Warning",
3146
+ "variant": "warning"
3147
+ }
3148
+ ]
3149
+ },
3150
+ {
3151
+ "type": "divider"
3152
+ },
3153
+ {
3154
+ "type": "alert",
3155
+ "variant": "warning",
3156
+ "message": "Token usage approaching limit. Consider compacting."
3157
+ },
3158
+ {
3159
+ "type": "progress-bar",
3160
+ "value": "@entity.current",
3161
+ "max": "@entity.max"
3162
+ },
3163
+ {
3164
+ "type": "stack",
3165
+ "direction": "horizontal",
3166
+ "gap": "md",
3167
+ "children": [
3168
+ {
3169
+ "type": "stat-display",
3170
+ "label": "Tokens Used",
3171
+ "value": "@entity.current"
3172
+ },
3173
+ {
3174
+ "type": "stat-display",
3175
+ "label": "Max Tokens",
3176
+ "value": "@entity.max"
3177
+ }
3178
+ ]
3179
+ },
3180
+ {
3181
+ "type": "stack",
3182
+ "direction": "horizontal",
3183
+ "gap": "sm",
3184
+ "children": [
3185
+ {
3186
+ "type": "button",
3187
+ "label": "Compact",
3188
+ "event": "COMPACT",
3189
+ "variant": "primary",
3190
+ "icon": "minimize-2"
3191
+ },
3192
+ {
3193
+ "type": "button",
3194
+ "label": "Reset",
3195
+ "event": "RESET",
3196
+ "variant": "ghost",
3197
+ "icon": "rotate-ccw"
3198
+ }
3199
+ ]
3200
+ }
3201
+ ]
3202
+ }
3203
+ ]
3204
+ ]
3205
+ },
3206
+ {
3207
+ "from": "normal",
3208
+ "to": "critical",
3209
+ "event": "UPDATE",
3210
+ "guard": [
3211
+ ">=",
3212
+ [
3213
+ "/",
3214
+ "@payload.current",
3215
+ "@entity.max"
3216
+ ],
3217
+ 0.95
3218
+ ],
3219
+ "effects": [
3220
+ [
3221
+ "set",
3222
+ "@entity.current",
3223
+ "@payload.current"
3224
+ ],
3225
+ [
3226
+ "render-ui",
3227
+ "main",
3228
+ {
3229
+ "type": "stack",
3230
+ "direction": "vertical",
3231
+ "gap": "lg",
3232
+ "children": [
3233
+ {
3234
+ "type": "stack",
3235
+ "direction": "horizontal",
3236
+ "gap": "sm",
3237
+ "align": "center",
3238
+ "children": [
3239
+ {
3240
+ "type": "icon",
3241
+ "name": "alert-octagon",
3242
+ "size": "lg"
3243
+ },
3244
+ {
3245
+ "type": "typography",
3246
+ "content": "Token Usage",
3247
+ "variant": "h2"
3248
+ },
3249
+ {
3250
+ "type": "badge",
3251
+ "label": "Critical",
3252
+ "variant": "destructive"
3253
+ }
3254
+ ]
3255
+ },
3256
+ {
3257
+ "type": "divider"
3258
+ },
3259
+ {
3260
+ "type": "alert",
3261
+ "variant": "error",
3262
+ "message": "Token usage critical. Compact immediately to avoid truncation."
3263
+ },
3264
+ {
3265
+ "type": "progress-bar",
3266
+ "value": "@entity.current",
3267
+ "max": "@entity.max"
3268
+ },
3269
+ {
3270
+ "type": "stack",
3271
+ "direction": "horizontal",
3272
+ "gap": "md",
3273
+ "children": [
3274
+ {
3275
+ "type": "stat-display",
3276
+ "label": "Tokens Used",
3277
+ "value": "@entity.current"
3278
+ },
3279
+ {
3280
+ "type": "stat-display",
3281
+ "label": "Max Tokens",
3282
+ "value": "@entity.max"
3283
+ }
3284
+ ]
3285
+ },
3286
+ {
3287
+ "type": "stack",
3288
+ "direction": "horizontal",
3289
+ "gap": "sm",
3290
+ "children": [
3291
+ {
3292
+ "type": "button",
3293
+ "label": "Compact Now",
3294
+ "event": "COMPACT",
3295
+ "variant": "primary",
3296
+ "icon": "minimize-2"
3297
+ },
3298
+ {
3299
+ "type": "button",
3300
+ "label": "Reset",
3301
+ "event": "RESET",
3302
+ "variant": "ghost",
3303
+ "icon": "rotate-ccw"
3304
+ }
3305
+ ]
3306
+ }
3307
+ ]
3308
+ }
3309
+ ]
3310
+ ]
3311
+ },
3312
+ {
3313
+ "from": "warning",
3314
+ "to": "warning",
3315
+ "event": "UPDATE",
3316
+ "guard": [
3317
+ "and",
3318
+ [
3319
+ ">=",
3320
+ [
3321
+ "/",
3322
+ "@payload.current",
3323
+ "@entity.max"
3324
+ ],
3325
+ 0.85
3326
+ ],
3327
+ [
3328
+ "<",
3329
+ [
3330
+ "/",
3331
+ "@payload.current",
3332
+ "@entity.max"
3333
+ ],
3334
+ 0.95
3335
+ ]
3336
+ ],
3337
+ "effects": [
3338
+ [
3339
+ "set",
3340
+ "@entity.current",
3341
+ "@payload.current"
3342
+ ],
3343
+ [
3344
+ "render-ui",
3345
+ "main",
3346
+ {
3347
+ "type": "stack",
3348
+ "direction": "vertical",
3349
+ "gap": "lg",
3350
+ "children": [
3351
+ {
3352
+ "type": "stack",
3353
+ "direction": "horizontal",
3354
+ "gap": "sm",
3355
+ "align": "center",
3356
+ "children": [
3357
+ {
3358
+ "type": "icon",
3359
+ "name": "alert-triangle",
3360
+ "size": "lg"
3361
+ },
3362
+ {
3363
+ "type": "typography",
3364
+ "content": "Token Usage",
3365
+ "variant": "h2"
3366
+ },
3367
+ {
3368
+ "type": "badge",
3369
+ "label": "Warning",
3370
+ "variant": "warning"
3371
+ }
3372
+ ]
3373
+ },
3374
+ {
3375
+ "type": "divider"
3376
+ },
3377
+ {
3378
+ "type": "alert",
3379
+ "variant": "warning",
3380
+ "message": "Token usage approaching limit. Consider compacting."
3381
+ },
3382
+ {
3383
+ "type": "progress-bar",
3384
+ "value": "@entity.current",
3385
+ "max": "@entity.max"
3386
+ },
3387
+ {
3388
+ "type": "stack",
3389
+ "direction": "horizontal",
3390
+ "gap": "md",
3391
+ "children": [
3392
+ {
3393
+ "type": "stat-display",
3394
+ "label": "Tokens Used",
3395
+ "value": "@entity.current"
3396
+ },
3397
+ {
3398
+ "type": "stat-display",
3399
+ "label": "Max Tokens",
3400
+ "value": "@entity.max"
3401
+ }
3402
+ ]
3403
+ },
3404
+ {
3405
+ "type": "stack",
3406
+ "direction": "horizontal",
3407
+ "gap": "sm",
3408
+ "children": [
3409
+ {
3410
+ "type": "button",
3411
+ "label": "Compact",
3412
+ "event": "COMPACT",
3413
+ "variant": "primary",
3414
+ "icon": "minimize-2"
3415
+ },
3416
+ {
3417
+ "type": "button",
3418
+ "label": "Reset",
3419
+ "event": "RESET",
3420
+ "variant": "ghost",
3421
+ "icon": "rotate-ccw"
3422
+ }
3423
+ ]
3424
+ }
3425
+ ]
3426
+ }
3427
+ ]
3428
+ ]
3429
+ },
3430
+ {
3431
+ "from": "warning",
3432
+ "to": "critical",
3433
+ "event": "UPDATE",
3434
+ "guard": [
3435
+ ">=",
3436
+ [
3437
+ "/",
3438
+ "@payload.current",
3439
+ "@entity.max"
3440
+ ],
3441
+ 0.95
3442
+ ],
3443
+ "effects": [
3444
+ [
3445
+ "set",
3446
+ "@entity.current",
3447
+ "@payload.current"
3448
+ ],
3449
+ [
3450
+ "render-ui",
3451
+ "main",
3452
+ {
3453
+ "type": "stack",
3454
+ "direction": "vertical",
3455
+ "gap": "lg",
3456
+ "children": [
3457
+ {
3458
+ "type": "stack",
3459
+ "direction": "horizontal",
3460
+ "gap": "sm",
3461
+ "align": "center",
3462
+ "children": [
3463
+ {
3464
+ "type": "icon",
3465
+ "name": "alert-octagon",
3466
+ "size": "lg"
3467
+ },
3468
+ {
3469
+ "type": "typography",
3470
+ "content": "Token Usage",
3471
+ "variant": "h2"
3472
+ },
3473
+ {
3474
+ "type": "badge",
3475
+ "label": "Critical",
3476
+ "variant": "destructive"
3477
+ }
3478
+ ]
1563
3479
  },
1564
3480
  {
1565
- "type": "typography",
1566
- "content": "AgentToolLoop",
1567
- "variant": "h2"
3481
+ "type": "divider"
1568
3482
  },
1569
3483
  {
1570
- "type": "badge",
1571
- "label": "In Progress",
1572
- "variant": "warning"
1573
- }
1574
- ]
1575
- },
1576
- {
1577
- "type": "divider"
1578
- },
1579
- {
1580
- "type": "wizard-progress",
1581
- "currentStep": "@entity.currentStep",
1582
- "steps": [
1583
- {
1584
- "id": "0",
1585
- "title": "Plan"
3484
+ "type": "alert",
3485
+ "variant": "error",
3486
+ "message": "Token usage critical. Compact immediately to avoid truncation."
1586
3487
  },
1587
3488
  {
1588
- "id": "1",
1589
- "title": "Execute"
3489
+ "type": "progress-bar",
3490
+ "value": "@entity.current",
3491
+ "max": "@entity.max"
1590
3492
  },
1591
3493
  {
1592
- "id": "2",
1593
- "title": "Check"
3494
+ "type": "stack",
3495
+ "direction": "horizontal",
3496
+ "gap": "md",
3497
+ "children": [
3498
+ {
3499
+ "type": "stat-display",
3500
+ "label": "Tokens Used",
3501
+ "value": "@entity.current"
3502
+ },
3503
+ {
3504
+ "type": "stat-display",
3505
+ "label": "Max Tokens",
3506
+ "value": "@entity.max"
3507
+ }
3508
+ ]
1594
3509
  },
1595
3510
  {
1596
- "id": "3",
1597
- "title": "Complete"
3511
+ "type": "stack",
3512
+ "direction": "horizontal",
3513
+ "gap": "sm",
3514
+ "children": [
3515
+ {
3516
+ "type": "button",
3517
+ "label": "Compact Now",
3518
+ "event": "COMPACT",
3519
+ "variant": "primary",
3520
+ "icon": "minimize-2"
3521
+ },
3522
+ {
3523
+ "type": "button",
3524
+ "label": "Reset",
3525
+ "event": "RESET",
3526
+ "variant": "ghost",
3527
+ "icon": "rotate-ccw"
3528
+ }
3529
+ ]
1598
3530
  }
1599
3531
  ]
1600
- },
3532
+ }
3533
+ ]
3534
+ ]
3535
+ },
3536
+ {
3537
+ "from": "warning",
3538
+ "to": "normal",
3539
+ "event": "UPDATE",
3540
+ "guard": [
3541
+ "<",
3542
+ [
3543
+ "/",
3544
+ "@payload.current",
3545
+ "@entity.max"
3546
+ ],
3547
+ 0.85
3548
+ ],
3549
+ "effects": [
3550
+ [
3551
+ "set",
3552
+ "@entity.current",
3553
+ "@payload.current"
3554
+ ],
3555
+ [
3556
+ "render-ui",
3557
+ "main",
1601
3558
  {
1602
3559
  "type": "stack",
1603
- "direction": "horizontal",
1604
- "gap": "sm",
1605
- "align": "center",
3560
+ "direction": "vertical",
3561
+ "gap": "lg",
1606
3562
  "children": [
1607
3563
  {
1608
- "type": "stat-display",
1609
- "label": "Current Step",
1610
- "value": "@entity.currentStep"
3564
+ "type": "stack",
3565
+ "direction": "horizontal",
3566
+ "gap": "sm",
3567
+ "align": "center",
3568
+ "children": [
3569
+ {
3570
+ "type": "icon",
3571
+ "name": "gauge",
3572
+ "size": "lg"
3573
+ },
3574
+ {
3575
+ "type": "typography",
3576
+ "content": "Token Usage",
3577
+ "variant": "h2"
3578
+ },
3579
+ {
3580
+ "type": "badge",
3581
+ "label": "Normal",
3582
+ "variant": "default"
3583
+ }
3584
+ ]
1611
3585
  },
1612
3586
  {
1613
- "type": "stat-display",
1614
- "label": "Total Steps",
1615
- "value": "@entity.totalSteps"
1616
- }
1617
- ]
1618
- },
1619
- {
1620
- "type": "stack",
1621
- "direction": "horizontal",
1622
- "gap": "sm",
1623
- "children": [
3587
+ "type": "divider"
3588
+ },
1624
3589
  {
1625
- "type": "button",
1626
- "label": "Advance",
1627
- "event": "ADVANCE",
1628
- "variant": "primary",
1629
- "icon": "chevron-right"
3590
+ "type": "progress-bar",
3591
+ "value": "@entity.current",
3592
+ "max": "@entity.max"
3593
+ },
3594
+ {
3595
+ "type": "stack",
3596
+ "direction": "horizontal",
3597
+ "gap": "md",
3598
+ "children": [
3599
+ {
3600
+ "type": "stat-display",
3601
+ "label": "Tokens Used",
3602
+ "value": "@entity.current"
3603
+ },
3604
+ {
3605
+ "type": "stat-display",
3606
+ "label": "Max Tokens",
3607
+ "value": "@entity.max"
3608
+ }
3609
+ ]
1630
3610
  },
1631
3611
  {
1632
3612
  "type": "button",
@@ -1638,860 +3618,808 @@
1638
3618
  ]
1639
3619
  }
1640
3620
  ]
1641
- }
1642
- ]
1643
- ],
1644
- "COMPLETE": [
1645
- [
1646
- "set",
1647
- "@entity.status",
1648
- "completed"
1649
- ],
1650
- [
1651
- "set",
1652
- "@entity.currentStep",
1653
- "@entity.totalSteps"
1654
- ],
1655
- [
1656
- "render-ui",
1657
- "main",
1658
- {
1659
- "type": "stack",
1660
- "direction": "vertical",
1661
- "gap": "lg",
1662
- "children": [
3621
+ ]
3622
+ },
3623
+ {
3624
+ "from": "critical",
3625
+ "to": "critical",
3626
+ "event": "UPDATE",
3627
+ "guard": [
3628
+ ">=",
3629
+ [
3630
+ "/",
3631
+ "@payload.current",
3632
+ "@entity.max"
3633
+ ],
3634
+ 0.95
3635
+ ],
3636
+ "effects": [
3637
+ [
3638
+ "set",
3639
+ "@entity.current",
3640
+ "@payload.current"
3641
+ ],
3642
+ [
3643
+ "render-ui",
3644
+ "main",
1663
3645
  {
1664
3646
  "type": "stack",
1665
- "direction": "horizontal",
1666
- "gap": "sm",
1667
- "align": "center",
3647
+ "direction": "vertical",
3648
+ "gap": "lg",
1668
3649
  "children": [
1669
3650
  {
1670
- "type": "icon",
1671
- "name": "check-circle",
1672
- "size": "lg"
3651
+ "type": "stack",
3652
+ "direction": "horizontal",
3653
+ "gap": "sm",
3654
+ "align": "center",
3655
+ "children": [
3656
+ {
3657
+ "type": "icon",
3658
+ "name": "alert-octagon",
3659
+ "size": "lg"
3660
+ },
3661
+ {
3662
+ "type": "typography",
3663
+ "content": "Token Usage",
3664
+ "variant": "h2"
3665
+ },
3666
+ {
3667
+ "type": "badge",
3668
+ "label": "Critical",
3669
+ "variant": "destructive"
3670
+ }
3671
+ ]
1673
3672
  },
1674
3673
  {
1675
- "type": "typography",
1676
- "content": "AgentToolLoop",
1677
- "variant": "h2"
3674
+ "type": "divider"
1678
3675
  },
1679
3676
  {
1680
- "type": "badge",
1681
- "label": "Completed",
1682
- "variant": "success"
3677
+ "type": "alert",
3678
+ "variant": "error",
3679
+ "message": "Token usage critical. Compact immediately to avoid truncation."
3680
+ },
3681
+ {
3682
+ "type": "progress-bar",
3683
+ "value": "@entity.current",
3684
+ "max": "@entity.max"
3685
+ },
3686
+ {
3687
+ "type": "stack",
3688
+ "direction": "horizontal",
3689
+ "gap": "md",
3690
+ "children": [
3691
+ {
3692
+ "type": "stat-display",
3693
+ "label": "Tokens Used",
3694
+ "value": "@entity.current"
3695
+ },
3696
+ {
3697
+ "type": "stat-display",
3698
+ "label": "Max Tokens",
3699
+ "value": "@entity.max"
3700
+ }
3701
+ ]
3702
+ },
3703
+ {
3704
+ "type": "stack",
3705
+ "direction": "horizontal",
3706
+ "gap": "sm",
3707
+ "children": [
3708
+ {
3709
+ "type": "button",
3710
+ "label": "Compact Now",
3711
+ "event": "COMPACT",
3712
+ "variant": "primary",
3713
+ "icon": "minimize-2"
3714
+ },
3715
+ {
3716
+ "type": "button",
3717
+ "label": "Reset",
3718
+ "event": "RESET",
3719
+ "variant": "ghost",
3720
+ "icon": "rotate-ccw"
3721
+ }
3722
+ ]
1683
3723
  }
1684
3724
  ]
1685
- },
1686
- {
1687
- "type": "divider"
1688
- },
3725
+ }
3726
+ ]
3727
+ ]
3728
+ },
3729
+ {
3730
+ "from": "critical",
3731
+ "to": "warning",
3732
+ "event": "UPDATE",
3733
+ "guard": [
3734
+ "and",
3735
+ [
3736
+ ">=",
3737
+ [
3738
+ "/",
3739
+ "@payload.current",
3740
+ "@entity.max"
3741
+ ],
3742
+ 0.85
3743
+ ],
3744
+ [
3745
+ "<",
3746
+ [
3747
+ "/",
3748
+ "@payload.current",
3749
+ "@entity.max"
3750
+ ],
3751
+ 0.95
3752
+ ]
3753
+ ],
3754
+ "effects": [
3755
+ [
3756
+ "set",
3757
+ "@entity.current",
3758
+ "@payload.current"
3759
+ ],
3760
+ [
3761
+ "render-ui",
3762
+ "main",
1689
3763
  {
1690
- "type": "wizard-progress",
1691
- "currentStep": "@entity.totalSteps",
1692
- "steps": [
3764
+ "type": "stack",
3765
+ "direction": "vertical",
3766
+ "gap": "lg",
3767
+ "children": [
3768
+ {
3769
+ "type": "stack",
3770
+ "direction": "horizontal",
3771
+ "gap": "sm",
3772
+ "align": "center",
3773
+ "children": [
3774
+ {
3775
+ "type": "icon",
3776
+ "name": "alert-triangle",
3777
+ "size": "lg"
3778
+ },
3779
+ {
3780
+ "type": "typography",
3781
+ "content": "Token Usage",
3782
+ "variant": "h2"
3783
+ },
3784
+ {
3785
+ "type": "badge",
3786
+ "label": "Warning",
3787
+ "variant": "warning"
3788
+ }
3789
+ ]
3790
+ },
3791
+ {
3792
+ "type": "divider"
3793
+ },
1693
3794
  {
1694
- "id": "0",
1695
- "title": "Plan"
3795
+ "type": "alert",
3796
+ "variant": "warning",
3797
+ "message": "Token usage approaching limit. Consider compacting."
1696
3798
  },
1697
3799
  {
1698
- "id": "1",
1699
- "title": "Execute"
3800
+ "type": "progress-bar",
3801
+ "value": "@entity.current",
3802
+ "max": "@entity.max"
1700
3803
  },
1701
3804
  {
1702
- "id": "2",
1703
- "title": "Check"
3805
+ "type": "stack",
3806
+ "direction": "horizontal",
3807
+ "gap": "md",
3808
+ "children": [
3809
+ {
3810
+ "type": "stat-display",
3811
+ "label": "Tokens Used",
3812
+ "value": "@entity.current"
3813
+ },
3814
+ {
3815
+ "type": "stat-display",
3816
+ "label": "Max Tokens",
3817
+ "value": "@entity.max"
3818
+ }
3819
+ ]
1704
3820
  },
1705
3821
  {
1706
- "id": "3",
1707
- "title": "Complete"
3822
+ "type": "stack",
3823
+ "direction": "horizontal",
3824
+ "gap": "sm",
3825
+ "children": [
3826
+ {
3827
+ "type": "button",
3828
+ "label": "Compact",
3829
+ "event": "COMPACT",
3830
+ "variant": "primary",
3831
+ "icon": "minimize-2"
3832
+ },
3833
+ {
3834
+ "type": "button",
3835
+ "label": "Reset",
3836
+ "event": "RESET",
3837
+ "variant": "ghost",
3838
+ "icon": "rotate-ccw"
3839
+ }
3840
+ ]
1708
3841
  }
1709
3842
  ]
1710
- },
1711
- {
1712
- "type": "alert",
1713
- "variant": "success",
1714
- "message": "All steps completed successfully."
1715
- },
1716
- {
1717
- "type": "button",
1718
- "label": "Reset",
1719
- "event": "RESET",
1720
- "variant": "ghost",
1721
- "icon": "rotate-ccw"
1722
3843
  }
1723
3844
  ]
1724
- }
1725
- ]
1726
- ],
1727
- "FAIL": [
1728
- [
1729
- "set",
1730
- "@entity.status",
1731
- "failed"
1732
- ],
1733
- [
1734
- "render-ui",
1735
- "main",
1736
- {
1737
- "type": "stack",
1738
- "direction": "vertical",
1739
- "gap": "lg",
1740
- "children": [
3845
+ ]
3846
+ },
3847
+ {
3848
+ "from": "critical",
3849
+ "to": "normal",
3850
+ "event": "UPDATE",
3851
+ "guard": [
3852
+ "<",
3853
+ [
3854
+ "/",
3855
+ "@payload.current",
3856
+ "@entity.max"
3857
+ ],
3858
+ 0.85
3859
+ ],
3860
+ "effects": [
3861
+ [
3862
+ "set",
3863
+ "@entity.current",
3864
+ "@payload.current"
3865
+ ],
3866
+ [
3867
+ "render-ui",
3868
+ "main",
1741
3869
  {
1742
3870
  "type": "stack",
1743
- "direction": "horizontal",
1744
- "gap": "sm",
1745
- "align": "center",
3871
+ "direction": "vertical",
3872
+ "gap": "lg",
1746
3873
  "children": [
1747
3874
  {
1748
- "type": "icon",
1749
- "name": "x-circle",
1750
- "size": "lg"
1751
- },
1752
- {
1753
- "type": "typography",
1754
- "content": "AgentToolLoop",
1755
- "variant": "h2"
3875
+ "type": "stack",
3876
+ "direction": "horizontal",
3877
+ "gap": "sm",
3878
+ "align": "center",
3879
+ "children": [
3880
+ {
3881
+ "type": "icon",
3882
+ "name": "gauge",
3883
+ "size": "lg"
3884
+ },
3885
+ {
3886
+ "type": "typography",
3887
+ "content": "Token Usage",
3888
+ "variant": "h2"
3889
+ },
3890
+ {
3891
+ "type": "badge",
3892
+ "label": "Normal",
3893
+ "variant": "default"
3894
+ }
3895
+ ]
1756
3896
  },
1757
3897
  {
1758
- "type": "badge",
1759
- "label": "Failed",
1760
- "variant": "destructive"
1761
- }
1762
- ]
1763
- },
1764
- {
1765
- "type": "divider"
1766
- },
1767
- {
1768
- "type": "wizard-progress",
1769
- "currentStep": "@entity.currentStep",
1770
- "steps": [
1771
- {
1772
- "id": "0",
1773
- "title": "Plan"
3898
+ "type": "divider"
1774
3899
  },
1775
3900
  {
1776
- "id": "1",
1777
- "title": "Execute"
3901
+ "type": "progress-bar",
3902
+ "value": "@entity.current",
3903
+ "max": "@entity.max"
1778
3904
  },
1779
3905
  {
1780
- "id": "2",
1781
- "title": "Check"
3906
+ "type": "stack",
3907
+ "direction": "horizontal",
3908
+ "gap": "md",
3909
+ "children": [
3910
+ {
3911
+ "type": "stat-display",
3912
+ "label": "Tokens Used",
3913
+ "value": "@entity.current"
3914
+ },
3915
+ {
3916
+ "type": "stat-display",
3917
+ "label": "Max Tokens",
3918
+ "value": "@entity.max"
3919
+ }
3920
+ ]
1782
3921
  },
1783
3922
  {
1784
- "id": "3",
1785
- "title": "Complete"
1786
- }
1787
- ]
1788
- },
1789
- {
1790
- "type": "alert",
1791
- "variant": "error",
1792
- "message": "Pipeline failed at the current step."
1793
- },
1794
- {
1795
- "type": "stack",
1796
- "direction": "horizontal",
1797
- "gap": "sm",
1798
- "children": [
1799
- {
1800
- "type": "stat-display",
1801
- "label": "Failed At Step",
1802
- "value": "@entity.currentStep"
3923
+ "type": "button",
3924
+ "label": "Reset",
3925
+ "event": "RESET",
3926
+ "variant": "ghost",
3927
+ "icon": "rotate-ccw"
1803
3928
  }
1804
3929
  ]
1805
- },
1806
- {
1807
- "type": "button",
1808
- "label": "Reset",
1809
- "event": "RESET",
1810
- "variant": "ghost",
1811
- "icon": "rotate-ccw"
1812
3930
  }
1813
3931
  ]
1814
- }
1815
- ]
1816
- ],
1817
- "RESET": [
1818
- [
1819
- "set",
1820
- "@entity.status",
1821
- "idle"
1822
- ],
1823
- [
1824
- "set",
1825
- "@entity.currentStep",
1826
- 0
1827
- ],
1828
- [
1829
- "render-ui",
1830
- "main",
1831
- {
1832
- "type": "stack",
1833
- "direction": "vertical",
1834
- "gap": "lg",
1835
- "children": [
3932
+ ]
3933
+ },
3934
+ {
3935
+ "from": "normal",
3936
+ "to": "normal",
3937
+ "event": "COMPACT",
3938
+ "effects": [
3939
+ [
3940
+ "agent/compact"
3941
+ ],
3942
+ [
3943
+ "set",
3944
+ "@entity.lastCompactedAt",
3945
+ "@now"
3946
+ ],
3947
+ [
3948
+ "agent/token-count"
3949
+ ],
3950
+ [
3951
+ "render-ui",
3952
+ "main",
1836
3953
  {
1837
3954
  "type": "stack",
1838
- "direction": "horizontal",
1839
- "gap": "sm",
1840
- "align": "center",
3955
+ "direction": "vertical",
3956
+ "gap": "lg",
1841
3957
  "children": [
1842
3958
  {
1843
- "type": "icon",
1844
- "name": "list-ordered",
1845
- "size": "lg"
1846
- },
1847
- {
1848
- "type": "typography",
1849
- "content": "AgentToolLoop",
1850
- "variant": "h2"
3959
+ "type": "stack",
3960
+ "direction": "horizontal",
3961
+ "gap": "sm",
3962
+ "align": "center",
3963
+ "children": [
3964
+ {
3965
+ "type": "icon",
3966
+ "name": "gauge",
3967
+ "size": "lg"
3968
+ },
3969
+ {
3970
+ "type": "typography",
3971
+ "content": "Token Usage",
3972
+ "variant": "h2"
3973
+ },
3974
+ {
3975
+ "type": "badge",
3976
+ "label": "Normal",
3977
+ "variant": "default"
3978
+ }
3979
+ ]
1851
3980
  },
1852
3981
  {
1853
- "type": "badge",
1854
- "label": "Idle",
1855
- "variant": "default"
1856
- }
1857
- ]
1858
- },
1859
- {
1860
- "type": "divider"
1861
- },
1862
- {
1863
- "type": "wizard-progress",
1864
- "currentStep": "@entity.currentStep",
1865
- "steps": [
1866
- {
1867
- "id": "0",
1868
- "title": "Plan"
3982
+ "type": "divider"
1869
3983
  },
1870
3984
  {
1871
- "id": "1",
1872
- "title": "Execute"
3985
+ "type": "progress-bar",
3986
+ "value": "@entity.current",
3987
+ "max": "@entity.max"
1873
3988
  },
1874
3989
  {
1875
- "id": "2",
1876
- "title": "Check"
3990
+ "type": "stack",
3991
+ "direction": "horizontal",
3992
+ "gap": "md",
3993
+ "children": [
3994
+ {
3995
+ "type": "stat-display",
3996
+ "label": "Tokens Used",
3997
+ "value": "@entity.current"
3998
+ },
3999
+ {
4000
+ "type": "stat-display",
4001
+ "label": "Max Tokens",
4002
+ "value": "@entity.max"
4003
+ }
4004
+ ]
1877
4005
  },
1878
4006
  {
1879
- "id": "3",
1880
- "title": "Complete"
4007
+ "type": "button",
4008
+ "label": "Reset",
4009
+ "event": "RESET",
4010
+ "variant": "ghost",
4011
+ "icon": "rotate-ccw"
1881
4012
  }
1882
4013
  ]
1883
- },
1884
- {
1885
- "type": "button",
1886
- "label": "Start",
1887
- "event": "START",
1888
- "variant": "primary",
1889
- "icon": "play"
1890
4014
  }
1891
4015
  ]
1892
- }
1893
- ]
1894
- ]
1895
- }
1896
- },
1897
- {
1898
- "ref": "AgentCompletion.traits.AgentCompletionModal",
1899
- "name": "ToolLoopCompletionFlow",
1900
- "linkedEntity": "AgentToolLoop",
1901
- "listens": [],
1902
- "emitsScope": "internal",
1903
- "effects": {
1904
- "INIT": [
1905
- [
1906
- "ref",
1907
- "AgentToolLoop"
1908
- ],
1909
- [
1910
- "render-ui",
1911
- "main",
1912
- {
1913
- "type": "stack",
1914
- "direction": "vertical",
1915
- "gap": "lg",
1916
- "children": [
4016
+ ]
4017
+ },
4018
+ {
4019
+ "from": "warning",
4020
+ "to": "normal",
4021
+ "event": "COMPACT",
4022
+ "effects": [
4023
+ [
4024
+ "agent/compact"
4025
+ ],
4026
+ [
4027
+ "set",
4028
+ "@entity.lastCompactedAt",
4029
+ "@now"
4030
+ ],
4031
+ [
4032
+ "agent/token-count"
4033
+ ],
4034
+ [
4035
+ "render-ui",
4036
+ "main",
1917
4037
  {
1918
4038
  "type": "stack",
1919
- "direction": "horizontal",
1920
- "gap": "md",
1921
- "justify": "space-between",
4039
+ "direction": "vertical",
4040
+ "gap": "lg",
1922
4041
  "children": [
1923
4042
  {
1924
4043
  "type": "stack",
1925
4044
  "direction": "horizontal",
1926
- "gap": "md",
4045
+ "gap": "sm",
4046
+ "align": "center",
1927
4047
  "children": [
1928
4048
  {
1929
4049
  "type": "icon",
1930
- "name": "sparkles",
4050
+ "name": "gauge",
1931
4051
  "size": "lg"
1932
4052
  },
1933
4053
  {
1934
4054
  "type": "typography",
1935
- "content": "AgentToolLoop",
4055
+ "content": "Token Usage",
1936
4056
  "variant": "h2"
4057
+ },
4058
+ {
4059
+ "type": "badge",
4060
+ "label": "Normal",
4061
+ "variant": "default"
4062
+ }
4063
+ ]
4064
+ },
4065
+ {
4066
+ "type": "divider"
4067
+ },
4068
+ {
4069
+ "type": "progress-bar",
4070
+ "value": "@entity.current",
4071
+ "max": "@entity.max"
4072
+ },
4073
+ {
4074
+ "type": "stack",
4075
+ "direction": "horizontal",
4076
+ "gap": "md",
4077
+ "children": [
4078
+ {
4079
+ "type": "stat-display",
4080
+ "label": "Tokens Used",
4081
+ "value": "@entity.current"
4082
+ },
4083
+ {
4084
+ "type": "stat-display",
4085
+ "label": "Max Tokens",
4086
+ "value": "@entity.max"
1937
4087
  }
1938
4088
  ]
1939
4089
  },
1940
4090
  {
1941
4091
  "type": "button",
1942
- "label": "Open",
1943
- "event": "GENERATE",
1944
- "variant": "primary",
1945
- "icon": "sparkles"
4092
+ "label": "Reset",
4093
+ "event": "RESET",
4094
+ "variant": "ghost",
4095
+ "icon": "rotate-ccw"
1946
4096
  }
1947
4097
  ]
1948
- },
1949
- {
1950
- "type": "divider"
1951
- },
1952
- {
1953
- "type": "empty-state",
1954
- "icon": "sparkles",
1955
- "title": "Nothing open",
1956
- "description": "Click Open to view details in a modal overlay."
1957
4098
  }
1958
4099
  ]
1959
- }
1960
- ]
1961
- ],
1962
- "GENERATE": [
1963
- [
1964
- "render-ui",
1965
- "modal",
1966
- {
1967
- "type": "stack",
1968
- "direction": "vertical",
1969
- "gap": "md",
1970
- "children": [
4100
+ ]
4101
+ },
4102
+ {
4103
+ "from": "critical",
4104
+ "to": "normal",
4105
+ "event": "COMPACT",
4106
+ "effects": [
4107
+ [
4108
+ "agent/compact"
4109
+ ],
4110
+ [
4111
+ "set",
4112
+ "@entity.lastCompactedAt",
4113
+ "@now"
4114
+ ],
4115
+ [
4116
+ "agent/token-count"
4117
+ ],
4118
+ [
4119
+ "render-ui",
4120
+ "main",
1971
4121
  {
1972
4122
  "type": "stack",
1973
- "direction": "horizontal",
1974
- "gap": "sm",
4123
+ "direction": "vertical",
4124
+ "gap": "lg",
1975
4125
  "children": [
1976
4126
  {
1977
- "type": "icon",
1978
- "name": "sparkles",
1979
- "size": "md"
4127
+ "type": "stack",
4128
+ "direction": "horizontal",
4129
+ "gap": "sm",
4130
+ "align": "center",
4131
+ "children": [
4132
+ {
4133
+ "type": "icon",
4134
+ "name": "gauge",
4135
+ "size": "lg"
4136
+ },
4137
+ {
4138
+ "type": "typography",
4139
+ "content": "Token Usage",
4140
+ "variant": "h2"
4141
+ },
4142
+ {
4143
+ "type": "badge",
4144
+ "label": "Normal",
4145
+ "variant": "default"
4146
+ }
4147
+ ]
1980
4148
  },
1981
4149
  {
1982
- "type": "typography",
1983
- "content": "AgentToolLoop",
1984
- "variant": "h3"
1985
- }
1986
- ]
1987
- },
1988
- {
1989
- "type": "divider"
1990
- },
1991
- {
1992
- "type": "stack",
1993
- "direction": "horizontal",
1994
- "gap": "sm",
1995
- "children": [
1996
- {
1997
- "type": "badge",
1998
- "label": "@entity.provider"
4150
+ "type": "divider"
1999
4151
  },
2000
4152
  {
2001
- "type": "badge",
2002
- "label": "@entity.model"
2003
- }
2004
- ]
2005
- },
2006
- {
2007
- "type": "form-section",
2008
- "entity": "AgentToolLoop",
2009
- "mode": "create",
2010
- "submitEvent": "SAVE",
2011
- "cancelEvent": "CLOSE",
2012
- "fields": [
2013
- "prompt"
2014
- ]
2015
- }
2016
- ]
2017
- }
2018
- ]
2019
- ],
2020
- "CLOSE": [
2021
- [
2022
- "render-ui",
2023
- "modal",
2024
- null
2025
- ],
2026
- [
2027
- "notify",
2028
- "Cancelled",
2029
- "info"
2030
- ],
2031
- [
2032
- "ref",
2033
- "AgentToolLoop"
2034
- ],
2035
- [
2036
- "render-ui",
2037
- "main",
2038
- {
2039
- "type": "stack",
2040
- "direction": "vertical",
2041
- "gap": "lg",
2042
- "children": [
2043
- {
2044
- "type": "stack",
2045
- "direction": "horizontal",
2046
- "gap": "md",
2047
- "justify": "space-between",
2048
- "children": [
4153
+ "type": "progress-bar",
4154
+ "value": "@entity.current",
4155
+ "max": "@entity.max"
4156
+ },
2049
4157
  {
2050
4158
  "type": "stack",
2051
4159
  "direction": "horizontal",
2052
4160
  "gap": "md",
2053
4161
  "children": [
2054
4162
  {
2055
- "type": "icon",
2056
- "name": "sparkles",
2057
- "size": "lg"
4163
+ "type": "stat-display",
4164
+ "label": "Tokens Used",
4165
+ "value": "@entity.current"
2058
4166
  },
2059
4167
  {
2060
- "type": "typography",
2061
- "content": "AgentToolLoop",
2062
- "variant": "h2"
4168
+ "type": "stat-display",
4169
+ "label": "Max Tokens",
4170
+ "value": "@entity.max"
2063
4171
  }
2064
4172
  ]
2065
4173
  },
2066
4174
  {
2067
4175
  "type": "button",
2068
- "label": "Open",
2069
- "event": "GENERATE",
2070
- "variant": "primary",
2071
- "icon": "sparkles"
4176
+ "label": "Reset",
4177
+ "event": "RESET",
4178
+ "variant": "ghost",
4179
+ "icon": "rotate-ccw"
2072
4180
  }
2073
4181
  ]
2074
- },
2075
- {
2076
- "type": "divider"
2077
- },
2078
- {
2079
- "type": "empty-state",
2080
- "icon": "sparkles",
2081
- "title": "Nothing open",
2082
- "description": "Click Open to view details in a modal overlay."
2083
4182
  }
2084
4183
  ]
2085
- }
2086
- ]
2087
- ],
2088
- "SAVE": [
2089
- [
2090
- "persist",
2091
- "create",
2092
- "AgentToolLoop",
2093
- "@payload.data"
2094
- ],
2095
- [
2096
- "render-ui",
2097
- "modal",
2098
- null
2099
- ],
2100
- [
2101
- "emit",
2102
- "GENERATED"
2103
- ],
2104
- [
2105
- "ref",
2106
- "AgentToolLoop"
2107
- ],
2108
- [
2109
- "render-ui",
2110
- "main",
2111
- {
2112
- "type": "stack",
2113
- "direction": "vertical",
2114
- "gap": "lg",
2115
- "children": [
4184
+ ]
4185
+ },
4186
+ {
4187
+ "from": "normal",
4188
+ "to": "normal",
4189
+ "event": "RESET",
4190
+ "effects": [
4191
+ [
4192
+ "set",
4193
+ "@entity.current",
4194
+ 0
4195
+ ],
4196
+ [
4197
+ "render-ui",
4198
+ "main",
2116
4199
  {
2117
4200
  "type": "stack",
2118
- "direction": "horizontal",
2119
- "gap": "md",
2120
- "justify": "space-between",
4201
+ "direction": "vertical",
4202
+ "gap": "lg",
2121
4203
  "children": [
2122
4204
  {
2123
4205
  "type": "stack",
2124
4206
  "direction": "horizontal",
2125
- "gap": "md",
4207
+ "gap": "sm",
4208
+ "align": "center",
2126
4209
  "children": [
2127
4210
  {
2128
4211
  "type": "icon",
2129
- "name": "sparkles",
4212
+ "name": "gauge",
2130
4213
  "size": "lg"
2131
4214
  },
2132
4215
  {
2133
4216
  "type": "typography",
2134
- "content": "AgentToolLoop",
4217
+ "content": "Token Usage",
2135
4218
  "variant": "h2"
4219
+ },
4220
+ {
4221
+ "type": "badge",
4222
+ "label": "Normal",
4223
+ "variant": "default"
4224
+ }
4225
+ ]
4226
+ },
4227
+ {
4228
+ "type": "divider"
4229
+ },
4230
+ {
4231
+ "type": "progress-bar",
4232
+ "value": "@entity.current",
4233
+ "max": "@entity.max"
4234
+ },
4235
+ {
4236
+ "type": "stack",
4237
+ "direction": "horizontal",
4238
+ "gap": "md",
4239
+ "children": [
4240
+ {
4241
+ "type": "stat-display",
4242
+ "label": "Tokens Used",
4243
+ "value": "@entity.current"
4244
+ },
4245
+ {
4246
+ "type": "stat-display",
4247
+ "label": "Max Tokens",
4248
+ "value": "@entity.max"
2136
4249
  }
2137
4250
  ]
2138
4251
  },
2139
4252
  {
2140
4253
  "type": "button",
2141
- "label": "Open",
2142
- "event": "GENERATE",
2143
- "variant": "primary",
2144
- "icon": "sparkles"
4254
+ "label": "Reset",
4255
+ "event": "RESET",
4256
+ "variant": "ghost",
4257
+ "icon": "rotate-ccw"
2145
4258
  }
2146
4259
  ]
2147
- },
2148
- {
2149
- "type": "divider"
2150
- },
2151
- {
2152
- "type": "empty-state",
2153
- "icon": "sparkles",
2154
- "title": "Nothing open",
2155
- "description": "Click Open to view details in a modal overlay."
2156
4260
  }
2157
4261
  ]
2158
- }
2159
- ]
2160
- ]
2161
- }
2162
- },
2163
- {
2164
- "ref": "AgentToolCall.traits.AgentToolCallModal",
2165
- "name": "ToolLoopToolCallFlow",
2166
- "linkedEntity": "AgentToolLoop",
2167
- "listens": [],
2168
- "emitsScope": "internal",
2169
- "effects": {
2170
- "INIT": [
2171
- [
2172
- "ref",
2173
- "AgentToolLoop"
2174
- ],
2175
- [
2176
- "render-ui",
2177
- "main",
2178
- {
2179
- "type": "stack",
2180
- "direction": "vertical",
2181
- "gap": "lg",
2182
- "children": [
4262
+ ]
4263
+ },
4264
+ {
4265
+ "from": "warning",
4266
+ "to": "normal",
4267
+ "event": "RESET",
4268
+ "effects": [
4269
+ [
4270
+ "set",
4271
+ "@entity.current",
4272
+ 0
4273
+ ],
4274
+ [
4275
+ "render-ui",
4276
+ "main",
2183
4277
  {
2184
4278
  "type": "stack",
2185
- "direction": "horizontal",
2186
- "gap": "md",
2187
- "justify": "space-between",
4279
+ "direction": "vertical",
4280
+ "gap": "lg",
2188
4281
  "children": [
2189
4282
  {
2190
4283
  "type": "stack",
2191
4284
  "direction": "horizontal",
2192
- "gap": "md",
4285
+ "gap": "sm",
4286
+ "align": "center",
2193
4287
  "children": [
2194
4288
  {
2195
4289
  "type": "icon",
2196
- "name": "wrench",
4290
+ "name": "gauge",
2197
4291
  "size": "lg"
2198
4292
  },
2199
4293
  {
2200
4294
  "type": "typography",
2201
- "content": "Invoke Tool",
4295
+ "content": "Token Usage",
2202
4296
  "variant": "h2"
4297
+ },
4298
+ {
4299
+ "type": "badge",
4300
+ "label": "Normal",
4301
+ "variant": "default"
2203
4302
  }
2204
4303
  ]
2205
4304
  },
2206
4305
  {
2207
- "type": "button",
2208
- "label": "Open",
2209
- "event": "INVOKE",
2210
- "variant": "primary",
2211
- "icon": "wrench"
2212
- }
2213
- ]
2214
- },
2215
- {
2216
- "type": "divider"
2217
- },
2218
- {
2219
- "type": "empty-state",
2220
- "icon": "wrench",
2221
- "title": "Nothing open",
2222
- "description": "Click Open to view details in a modal overlay."
2223
- }
2224
- ]
2225
- }
2226
- ]
2227
- ],
2228
- "INVOKE": [
2229
- [
2230
- "render-ui",
2231
- "modal",
2232
- {
2233
- "type": "stack",
2234
- "direction": "vertical",
2235
- "gap": "md",
2236
- "children": [
2237
- {
2238
- "type": "stack",
2239
- "direction": "horizontal",
2240
- "gap": "sm",
2241
- "children": [
2242
- {
2243
- "type": "icon",
2244
- "name": "wrench",
2245
- "size": "md"
4306
+ "type": "divider"
2246
4307
  },
2247
4308
  {
2248
- "type": "typography",
2249
- "content": "Invoke Tool",
2250
- "variant": "h3"
2251
- }
2252
- ]
2253
- },
2254
- {
2255
- "type": "divider"
2256
- },
2257
- {
2258
- "type": "form-section",
2259
- "entity": "AgentToolLoop",
2260
- "mode": "create",
2261
- "submitEvent": "SAVE",
2262
- "cancelEvent": "CLOSE",
2263
- "fields": [
2264
- "toolName",
2265
- "args"
2266
- ]
2267
- }
2268
- ]
2269
- }
2270
- ]
2271
- ],
2272
- "CLOSE": [
2273
- [
2274
- "render-ui",
2275
- "modal",
2276
- null
2277
- ],
2278
- [
2279
- "notify",
2280
- "Cancelled",
2281
- "info"
2282
- ],
2283
- [
2284
- "ref",
2285
- "AgentToolLoop"
2286
- ],
2287
- [
2288
- "render-ui",
2289
- "main",
2290
- {
2291
- "type": "stack",
2292
- "direction": "vertical",
2293
- "gap": "lg",
2294
- "children": [
2295
- {
2296
- "type": "stack",
2297
- "direction": "horizontal",
2298
- "gap": "md",
2299
- "justify": "space-between",
2300
- "children": [
4309
+ "type": "progress-bar",
4310
+ "value": "@entity.current",
4311
+ "max": "@entity.max"
4312
+ },
2301
4313
  {
2302
4314
  "type": "stack",
2303
4315
  "direction": "horizontal",
2304
4316
  "gap": "md",
2305
4317
  "children": [
2306
4318
  {
2307
- "type": "icon",
2308
- "name": "wrench",
2309
- "size": "lg"
4319
+ "type": "stat-display",
4320
+ "label": "Tokens Used",
4321
+ "value": "@entity.current"
2310
4322
  },
2311
4323
  {
2312
- "type": "typography",
2313
- "content": "Invoke Tool",
2314
- "variant": "h2"
4324
+ "type": "stat-display",
4325
+ "label": "Max Tokens",
4326
+ "value": "@entity.max"
2315
4327
  }
2316
4328
  ]
2317
4329
  },
2318
4330
  {
2319
4331
  "type": "button",
2320
- "label": "Open",
2321
- "event": "INVOKE",
2322
- "variant": "primary",
2323
- "icon": "wrench"
4332
+ "label": "Reset",
4333
+ "event": "RESET",
4334
+ "variant": "ghost",
4335
+ "icon": "rotate-ccw"
2324
4336
  }
2325
4337
  ]
2326
- },
2327
- {
2328
- "type": "divider"
2329
- },
2330
- {
2331
- "type": "empty-state",
2332
- "icon": "wrench",
2333
- "title": "Nothing open",
2334
- "description": "Click Open to view details in a modal overlay."
2335
4338
  }
2336
4339
  ]
2337
- }
2338
- ]
2339
- ],
2340
- "SAVE": [
2341
- [
2342
- "persist",
2343
- "create",
2344
- "AgentToolLoop",
2345
- "@payload.data"
2346
- ],
2347
- [
2348
- "render-ui",
2349
- "modal",
2350
- null
2351
- ],
2352
- [
2353
- "emit",
2354
- "INVOKED"
2355
- ],
2356
- [
2357
- "ref",
2358
- "AgentToolLoop"
2359
- ],
2360
- [
2361
- "render-ui",
2362
- "main",
2363
- {
2364
- "type": "stack",
2365
- "direction": "vertical",
2366
- "gap": "lg",
2367
- "children": [
4340
+ ]
4341
+ },
4342
+ {
4343
+ "from": "critical",
4344
+ "to": "normal",
4345
+ "event": "RESET",
4346
+ "effects": [
4347
+ [
4348
+ "set",
4349
+ "@entity.current",
4350
+ 0
4351
+ ],
4352
+ [
4353
+ "render-ui",
4354
+ "main",
2368
4355
  {
2369
4356
  "type": "stack",
2370
- "direction": "horizontal",
2371
- "gap": "md",
2372
- "justify": "space-between",
4357
+ "direction": "vertical",
4358
+ "gap": "lg",
2373
4359
  "children": [
2374
4360
  {
2375
4361
  "type": "stack",
2376
4362
  "direction": "horizontal",
2377
- "gap": "md",
4363
+ "gap": "sm",
4364
+ "align": "center",
2378
4365
  "children": [
2379
4366
  {
2380
4367
  "type": "icon",
2381
- "name": "wrench",
4368
+ "name": "gauge",
2382
4369
  "size": "lg"
2383
4370
  },
2384
4371
  {
2385
4372
  "type": "typography",
2386
- "content": "Invoke Tool",
4373
+ "content": "Token Usage",
2387
4374
  "variant": "h2"
4375
+ },
4376
+ {
4377
+ "type": "badge",
4378
+ "label": "Normal",
4379
+ "variant": "default"
2388
4380
  }
2389
4381
  ]
2390
4382
  },
2391
4383
  {
2392
- "type": "button",
2393
- "label": "Open",
2394
- "event": "INVOKE",
2395
- "variant": "primary",
2396
- "icon": "wrench"
2397
- }
2398
- ]
2399
- },
2400
- {
2401
- "type": "divider"
2402
- },
2403
- {
2404
- "type": "empty-state",
2405
- "icon": "wrench",
2406
- "title": "Nothing open",
2407
- "description": "Click Open to view details in a modal overlay."
2408
- }
2409
- ]
2410
- }
2411
- ]
2412
- ]
2413
- }
2414
- },
2415
- {
2416
- "ref": "AgentContextWindow.traits.AgentContextWindowGauge",
2417
- "name": "ToolLoopContextMonitor",
2418
- "linkedEntity": "AgentToolLoop",
2419
- "listens": [],
2420
- "emitsScope": "internal",
2421
- "effects": {
2422
- "INIT": [
2423
- [
2424
- "fetch",
2425
- "AgentToolLoop"
2426
- ],
2427
- [
2428
- "render-ui",
2429
- "main",
2430
- {
2431
- "type": "stack",
2432
- "direction": "vertical",
2433
- "gap": "lg",
2434
- "children": [
2435
- {
2436
- "type": "stack",
2437
- "direction": "horizontal",
2438
- "gap": "sm",
2439
- "align": "center",
2440
- "children": [
2441
- {
2442
- "type": "icon",
2443
- "name": "gauge",
2444
- "size": "lg"
4384
+ "type": "divider"
2445
4385
  },
2446
4386
  {
2447
- "type": "typography",
2448
- "content": "Token Usage",
2449
- "variant": "h2"
4387
+ "type": "progress-bar",
4388
+ "value": "@entity.current",
4389
+ "max": "@entity.max"
2450
4390
  },
2451
4391
  {
2452
- "type": "badge",
2453
- "label": "Normal",
2454
- "variant": "default"
2455
- }
2456
- ]
2457
- },
2458
- {
2459
- "type": "divider"
2460
- },
2461
- {
2462
- "type": "progress-bar",
2463
- "value": "@entity.current",
2464
- "max": "@entity.max"
2465
- },
2466
- {
2467
- "type": "stack",
2468
- "direction": "horizontal",
2469
- "gap": "md",
2470
- "children": [
2471
- {
2472
- "type": "stat-display",
2473
- "label": "Tokens Used",
2474
- "value": "@entity.current"
4392
+ "type": "stack",
4393
+ "direction": "horizontal",
4394
+ "gap": "md",
4395
+ "children": [
4396
+ {
4397
+ "type": "stat-display",
4398
+ "label": "Tokens Used",
4399
+ "value": "@entity.current"
4400
+ },
4401
+ {
4402
+ "type": "stat-display",
4403
+ "label": "Max Tokens",
4404
+ "value": "@entity.max"
4405
+ }
4406
+ ]
2475
4407
  },
2476
4408
  {
2477
- "type": "stat-display",
2478
- "label": "Max Tokens",
2479
- "value": "@entity.max"
4409
+ "type": "button",
4410
+ "label": "Reset",
4411
+ "event": "RESET",
4412
+ "variant": "ghost",
4413
+ "icon": "rotate-ccw"
2480
4414
  }
2481
4415
  ]
2482
- },
2483
- {
2484
- "type": "button",
2485
- "label": "Reset",
2486
- "event": "RESET",
2487
- "variant": "ghost",
2488
- "icon": "rotate-ccw"
2489
4416
  }
2490
4417
  ]
2491
- }
2492
- ]
4418
+ ]
4419
+ }
2493
4420
  ]
2494
- }
4421
+ },
4422
+ "listens": []
2495
4423
  }
2496
4424
  ],
2497
4425
  "pages": [
@@ -2518,5 +4446,6 @@
2518
4446
  }
2519
4447
  ]
2520
4448
  }
2521
- ]
2522
- }
4449
+ ],
4450
+ "description": "Composes agent atoms + UI atoms into an iterative tool-use loop with step progress tracking and activity logging. The agent generates a plan, invokes tools to execute steps, checks results, and either loops or finishes. Composed atoms: - stdAgentCompletion: LLM plan generation and result checking - stdAgentToolCall: tool invocation with argument passing - stdAgentContextWindow: context window monitoring and compaction - stdAgentStepProgress: visual pipeline step indicator - stdAgentActivityLog: chronological action timeline (2026-04-08). The canonical source for std behaviors is now the registry `.orb` file at `packages/almadar-std/behaviors/registry/<level>/<name>.orb`, which is generated from this TS source by `tools/almadar-behavior-ts-to-orb/` and consumed by the compiler's embedded loader. Consumers should import behaviors via `.lolo`/`.orb` `uses` declarations and reference them as `Alias.entity` / `Alias.traits.X` / `Alias.pages.X`, applying overrides at the call site (`linkedEntity`, `name`, `events`, `effects`, `listens`, `emitsScope`). The TS `*Params` interface and the exported factory functions remain ONLY as the authoring path for the converter; they are NOT a stable public API and may change without notice. See `docs/Almadar_Orb_Behaviors.md` for the orbital-as-function model and `docs/LOLO_Gaps.md` for the migration plan."
4451
+ }