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