@almadar/std 3.12.1 → 3.13.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 (149) hide show
  1. package/behaviors/exports/atoms/std-agent-classifier.orb +402 -0
  2. package/behaviors/exports/atoms/std-agent-completion.orb +469 -0
  3. package/behaviors/exports/atoms/std-agent-context-window.orb +790 -0
  4. package/behaviors/exports/atoms/std-agent-conversation.orb +737 -0
  5. package/behaviors/exports/atoms/std-agent-memory.orb +627 -0
  6. package/behaviors/exports/atoms/std-agent-provider.orb +402 -0
  7. package/behaviors/exports/atoms/std-agent-search.orb +418 -0
  8. package/behaviors/exports/atoms/std-agent-session.orb +825 -0
  9. package/behaviors/exports/atoms/std-agent-tool-call.orb +380 -0
  10. package/behaviors/exports/atoms/std-wizard.orb +63 -70
  11. package/behaviors/exports/molecules/std-agent-fix-loop.orb +1213 -0
  12. package/behaviors/exports/molecules/std-agent-learner.orb +1143 -0
  13. package/behaviors/exports/molecules/std-agent-planner.orb +898 -0
  14. package/behaviors/exports/molecules/std-agent-rag.orb +736 -0
  15. package/behaviors/exports/molecules/std-agent-tool-loop.orb +1237 -0
  16. package/behaviors/exports/molecules/std-detail.orb +4 -0
  17. package/behaviors/exports/molecules/std-geospatial.orb +4 -0
  18. package/behaviors/exports/molecules/std-inventory.orb +8 -0
  19. package/behaviors/exports/molecules/std-list.orb +18 -1
  20. package/behaviors/exports/molecules/std-messaging.orb +4 -0
  21. package/behaviors/exports/organisms/std-agent-assistant.orb +2288 -0
  22. package/behaviors/exports/organisms/std-agent-builder.orb +2664 -0
  23. package/behaviors/exports/organisms/std-agent-pipeline.orb +2307 -0
  24. package/behaviors/exports/organisms/std-agent-reviewer.orb +1743 -0
  25. package/behaviors/exports/organisms/std-agent-tutor.orb +2303 -0
  26. package/behaviors/exports/organisms/std-api-gateway.orb +18 -1
  27. package/behaviors/exports/organisms/std-booking-system.orb +131 -104
  28. package/behaviors/exports/organisms/std-cicd-pipeline.orb +18 -1
  29. package/behaviors/exports/organisms/std-cms.orb +40 -2
  30. package/behaviors/exports/organisms/std-crm.orb +40 -2
  31. package/behaviors/exports/organisms/std-devops-dashboard.orb +18 -1
  32. package/behaviors/exports/organisms/std-finance-tracker.orb +22 -1
  33. package/behaviors/exports/organisms/std-healthcare.orb +167 -136
  34. package/behaviors/exports/organisms/std-helpdesk.orb +22 -1
  35. package/behaviors/exports/organisms/std-hr-portal.orb +115 -88
  36. package/behaviors/exports/organisms/std-iot-dashboard.orb +18 -1
  37. package/behaviors/exports/organisms/std-lms.orb +97 -87
  38. package/behaviors/exports/organisms/std-platformer-app.orb +8 -0
  39. package/behaviors/exports/organisms/std-project-manager.orb +36 -2
  40. package/behaviors/exports/organisms/std-realtime-chat.orb +22 -1
  41. package/behaviors/exports/organisms/std-rpg-game.orb +8 -0
  42. package/behaviors/exports/organisms/std-service-marketplace.orb +36 -2
  43. package/behaviors/exports/organisms/std-social-feed.orb +8 -0
  44. package/behaviors/exports/organisms/std-trading-dashboard.orb +18 -1
  45. package/behaviors/exports/validation-report.json +1425 -0
  46. package/dist/behaviors/exports/atoms/std-agent-classifier.orb +402 -0
  47. package/dist/behaviors/exports/atoms/std-agent-completion.orb +469 -0
  48. package/dist/behaviors/exports/atoms/std-agent-context-window.orb +790 -0
  49. package/dist/behaviors/exports/atoms/std-agent-conversation.orb +737 -0
  50. package/dist/behaviors/exports/atoms/std-agent-memory.orb +627 -0
  51. package/dist/behaviors/exports/atoms/std-agent-provider.orb +402 -0
  52. package/dist/behaviors/exports/atoms/std-agent-search.orb +418 -0
  53. package/dist/behaviors/exports/atoms/std-agent-session.orb +825 -0
  54. package/dist/behaviors/exports/atoms/std-agent-tool-call.orb +380 -0
  55. package/dist/behaviors/exports/atoms/std-wizard.orb +63 -70
  56. package/dist/behaviors/exports/molecules/std-agent-fix-loop.orb +1213 -0
  57. package/dist/behaviors/exports/molecules/std-agent-learner.orb +1143 -0
  58. package/dist/behaviors/exports/molecules/std-agent-planner.orb +898 -0
  59. package/dist/behaviors/exports/molecules/std-agent-rag.orb +736 -0
  60. package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +1237 -0
  61. package/dist/behaviors/exports/molecules/std-detail.orb +4 -0
  62. package/dist/behaviors/exports/molecules/std-geospatial.orb +4 -0
  63. package/dist/behaviors/exports/molecules/std-inventory.orb +8 -0
  64. package/dist/behaviors/exports/molecules/std-list.orb +18 -1
  65. package/dist/behaviors/exports/molecules/std-messaging.orb +4 -0
  66. package/dist/behaviors/exports/organisms/std-agent-assistant.orb +2288 -0
  67. package/dist/behaviors/exports/organisms/std-agent-builder.orb +2664 -0
  68. package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +2307 -0
  69. package/dist/behaviors/exports/organisms/std-agent-reviewer.orb +1743 -0
  70. package/dist/behaviors/exports/organisms/std-agent-tutor.orb +2303 -0
  71. package/dist/behaviors/exports/organisms/std-api-gateway.orb +18 -1
  72. package/dist/behaviors/exports/organisms/std-booking-system.orb +131 -104
  73. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +18 -1
  74. package/dist/behaviors/exports/organisms/std-cms.orb +40 -2
  75. package/dist/behaviors/exports/organisms/std-crm.orb +40 -2
  76. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +18 -1
  77. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +22 -1
  78. package/dist/behaviors/exports/organisms/std-healthcare.orb +167 -136
  79. package/dist/behaviors/exports/organisms/std-helpdesk.orb +22 -1
  80. package/dist/behaviors/exports/organisms/std-hr-portal.orb +115 -88
  81. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +18 -1
  82. package/dist/behaviors/exports/organisms/std-lms.orb +97 -87
  83. package/dist/behaviors/exports/organisms/std-platformer-app.orb +8 -0
  84. package/dist/behaviors/exports/organisms/std-project-manager.orb +36 -2
  85. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +22 -1
  86. package/dist/behaviors/exports/organisms/std-rpg-game.orb +8 -0
  87. package/dist/behaviors/exports/organisms/std-service-marketplace.orb +36 -2
  88. package/dist/behaviors/exports/organisms/std-social-feed.orb +8 -0
  89. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +18 -1
  90. package/dist/behaviors/exports/validation-report.json +1425 -0
  91. package/dist/behaviors/exports-reader.js +6345 -175
  92. package/dist/behaviors/exports-reader.js.map +1 -1
  93. package/dist/behaviors/functions/index.d.ts +620 -1
  94. package/dist/behaviors/functions/index.js +6285 -176
  95. package/dist/behaviors/functions/index.js.map +1 -1
  96. package/dist/behaviors/index.d.ts +1 -1
  97. package/dist/behaviors/index.js +6348 -178
  98. package/dist/behaviors/index.js.map +1 -1
  99. package/dist/behaviors/query.js +6347 -177
  100. package/dist/behaviors/query.js.map +1 -1
  101. package/dist/exports/atoms/std-agent-classifier.orb +402 -0
  102. package/dist/exports/atoms/std-agent-completion.orb +469 -0
  103. package/dist/exports/atoms/std-agent-context-window.orb +790 -0
  104. package/dist/exports/atoms/std-agent-conversation.orb +737 -0
  105. package/dist/exports/atoms/std-agent-memory.orb +627 -0
  106. package/dist/exports/atoms/std-agent-provider.orb +402 -0
  107. package/dist/exports/atoms/std-agent-search.orb +418 -0
  108. package/dist/exports/atoms/std-agent-session.orb +825 -0
  109. package/dist/exports/atoms/std-agent-tool-call.orb +380 -0
  110. package/dist/exports/atoms/std-wizard.orb +63 -70
  111. package/dist/exports/molecules/std-agent-fix-loop.orb +1213 -0
  112. package/dist/exports/molecules/std-agent-learner.orb +1143 -0
  113. package/dist/exports/molecules/std-agent-planner.orb +898 -0
  114. package/dist/exports/molecules/std-agent-rag.orb +736 -0
  115. package/dist/exports/molecules/std-agent-tool-loop.orb +1237 -0
  116. package/dist/exports/molecules/std-detail.orb +4 -0
  117. package/dist/exports/molecules/std-geospatial.orb +4 -0
  118. package/dist/exports/molecules/std-inventory.orb +8 -0
  119. package/dist/exports/molecules/std-list.orb +18 -1
  120. package/dist/exports/molecules/std-messaging.orb +4 -0
  121. package/dist/exports/organisms/std-agent-assistant.orb +2288 -0
  122. package/dist/exports/organisms/std-agent-builder.orb +2664 -0
  123. package/dist/exports/organisms/std-agent-pipeline.orb +2307 -0
  124. package/dist/exports/organisms/std-agent-reviewer.orb +1743 -0
  125. package/dist/exports/organisms/std-agent-tutor.orb +2303 -0
  126. package/dist/exports/organisms/std-api-gateway.orb +18 -1
  127. package/dist/exports/organisms/std-booking-system.orb +131 -104
  128. package/dist/exports/organisms/std-cicd-pipeline.orb +18 -1
  129. package/dist/exports/organisms/std-cms.orb +40 -2
  130. package/dist/exports/organisms/std-crm.orb +40 -2
  131. package/dist/exports/organisms/std-devops-dashboard.orb +18 -1
  132. package/dist/exports/organisms/std-finance-tracker.orb +22 -1
  133. package/dist/exports/organisms/std-healthcare.orb +167 -136
  134. package/dist/exports/organisms/std-helpdesk.orb +22 -1
  135. package/dist/exports/organisms/std-hr-portal.orb +115 -88
  136. package/dist/exports/organisms/std-iot-dashboard.orb +18 -1
  137. package/dist/exports/organisms/std-lms.orb +97 -87
  138. package/dist/exports/organisms/std-platformer-app.orb +8 -0
  139. package/dist/exports/organisms/std-project-manager.orb +36 -2
  140. package/dist/exports/organisms/std-realtime-chat.orb +22 -1
  141. package/dist/exports/organisms/std-rpg-game.orb +8 -0
  142. package/dist/exports/organisms/std-service-marketplace.orb +36 -2
  143. package/dist/exports/organisms/std-social-feed.orb +8 -0
  144. package/dist/exports/organisms/std-trading-dashboard.orb +18 -1
  145. package/dist/exports/validation-report.json +1425 -0
  146. package/dist/index.d.ts +1 -1
  147. package/dist/index.js +6348 -178
  148. package/dist/index.js.map +1 -1
  149. package/package.json +1 -1
@@ -0,0 +1,1213 @@
1
+ {
2
+ "name": "AgentFixLoopOrbital",
3
+ "orbitals": [
4
+ {
5
+ "name": "AgentFixLoopOrbital",
6
+ "entity": {
7
+ "name": "AgentFixLoop",
8
+ "persistence": "runtime",
9
+ "fields": [
10
+ {
11
+ "name": "id",
12
+ "type": "string"
13
+ },
14
+ {
15
+ "name": "name",
16
+ "type": "string"
17
+ },
18
+ {
19
+ "name": "description",
20
+ "type": "string"
21
+ },
22
+ {
23
+ "name": "status",
24
+ "type": "string",
25
+ "default": "active",
26
+ "values": [
27
+ "active",
28
+ "inactive",
29
+ "pending"
30
+ ]
31
+ },
32
+ {
33
+ "name": "createdAt",
34
+ "type": "string"
35
+ },
36
+ {
37
+ "name": "target",
38
+ "type": "string",
39
+ "default": ""
40
+ },
41
+ {
42
+ "name": "validationErrors",
43
+ "type": "string",
44
+ "default": ""
45
+ },
46
+ {
47
+ "name": "fixAttempts",
48
+ "type": "number",
49
+ "default": 0
50
+ },
51
+ {
52
+ "name": "maxAttempts",
53
+ "type": "number",
54
+ "default": 5
55
+ },
56
+ {
57
+ "name": "currentFix",
58
+ "type": "string",
59
+ "default": ""
60
+ },
61
+ {
62
+ "name": "errorCount",
63
+ "type": "number",
64
+ "default": 0
65
+ },
66
+ {
67
+ "name": "error",
68
+ "type": "string",
69
+ "default": ""
70
+ }
71
+ ]
72
+ },
73
+ "traits": [
74
+ {
75
+ "name": "AgentFixLoopCycle",
76
+ "linkedEntity": "AgentFixLoop",
77
+ "category": "interaction",
78
+ "emits": [
79
+ {
80
+ "event": "FIX_SUCCEEDED"
81
+ },
82
+ {
83
+ "event": "FIX_FAILED"
84
+ }
85
+ ],
86
+ "stateMachine": {
87
+ "states": [
88
+ {
89
+ "name": "idle",
90
+ "isInitial": true
91
+ },
92
+ {
93
+ "name": "validating"
94
+ },
95
+ {
96
+ "name": "fixing"
97
+ },
98
+ {
99
+ "name": "applying"
100
+ },
101
+ {
102
+ "name": "succeeded"
103
+ },
104
+ {
105
+ "name": "failed"
106
+ }
107
+ ],
108
+ "events": [
109
+ {
110
+ "key": "INIT",
111
+ "name": "Initialize"
112
+ },
113
+ {
114
+ "key": "FIX",
115
+ "name": "Start Fix Loop"
116
+ },
117
+ {
118
+ "key": "VALIDATION_PASSED",
119
+ "name": "Validation Passed"
120
+ },
121
+ {
122
+ "key": "VALIDATION_ERRORS",
123
+ "name": "Validation Errors",
124
+ "payload": [
125
+ {
126
+ "name": "errors",
127
+ "type": "string",
128
+ "required": true
129
+ },
130
+ {
131
+ "name": "count",
132
+ "type": "number",
133
+ "required": true
134
+ }
135
+ ]
136
+ },
137
+ {
138
+ "key": "FIX_GENERATED",
139
+ "name": "Fix Generated",
140
+ "payload": [
141
+ {
142
+ "name": "fix",
143
+ "type": "string",
144
+ "required": true
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "key": "FIX_APPLIED",
150
+ "name": "Fix Applied"
151
+ },
152
+ {
153
+ "key": "EXCEEDED_ATTEMPTS",
154
+ "name": "Exceeded Max Attempts",
155
+ "payload": [
156
+ {
157
+ "name": "error",
158
+ "type": "string",
159
+ "required": true
160
+ }
161
+ ]
162
+ },
163
+ {
164
+ "key": "FAILED",
165
+ "name": "Failed",
166
+ "payload": [
167
+ {
168
+ "name": "error",
169
+ "type": "string",
170
+ "required": true
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ "key": "RESET",
176
+ "name": "Reset"
177
+ }
178
+ ],
179
+ "transitions": [
180
+ {
181
+ "from": "idle",
182
+ "to": "idle",
183
+ "event": "INIT",
184
+ "effects": [
185
+ [
186
+ "render-ui",
187
+ "main",
188
+ {
189
+ "type": "stack",
190
+ "direction": "vertical",
191
+ "gap": "lg",
192
+ "children": [
193
+ {
194
+ "type": "stack",
195
+ "direction": "horizontal",
196
+ "gap": "sm",
197
+ "align": "center",
198
+ "children": [
199
+ {
200
+ "type": "icon",
201
+ "name": "wrench",
202
+ "size": "lg"
203
+ },
204
+ {
205
+ "type": "typography",
206
+ "content": "Validation-Fix Loop",
207
+ "variant": "h2"
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "type": "divider"
213
+ },
214
+ {
215
+ "type": "card",
216
+ "children": [
217
+ {
218
+ "type": "stack",
219
+ "direction": "vertical",
220
+ "gap": "md",
221
+ "children": [
222
+ {
223
+ "type": "typography",
224
+ "content": "Enter the target to validate and auto-fix",
225
+ "variant": "body"
226
+ },
227
+ {
228
+ "type": "form-section",
229
+ "entity": "AgentFixLoop",
230
+ "mode": "edit",
231
+ "submitEvent": "FIX",
232
+ "fields": [
233
+ "target"
234
+ ]
235
+ }
236
+ ]
237
+ }
238
+ ]
239
+ }
240
+ ]
241
+ }
242
+ ]
243
+ ]
244
+ },
245
+ {
246
+ "from": "idle",
247
+ "to": "validating",
248
+ "event": "FIX",
249
+ "effects": [
250
+ [
251
+ "set",
252
+ "@entity.status",
253
+ "validating"
254
+ ],
255
+ [
256
+ "set",
257
+ "@entity.fixAttempts",
258
+ 0
259
+ ],
260
+ [
261
+ "set",
262
+ "@entity.validationErrors",
263
+ ""
264
+ ],
265
+ [
266
+ "set",
267
+ "@entity.errorCount",
268
+ 0
269
+ ],
270
+ [
271
+ "agent/invoke",
272
+ "validate-schema",
273
+ {
274
+ "target": "@entity.target"
275
+ }
276
+ ],
277
+ [
278
+ "render-ui",
279
+ "main",
280
+ {
281
+ "type": "stack",
282
+ "direction": "vertical",
283
+ "gap": "lg",
284
+ "align": "center",
285
+ "children": [
286
+ {
287
+ "type": "icon",
288
+ "name": "shield-check",
289
+ "size": "lg"
290
+ },
291
+ {
292
+ "type": "typography",
293
+ "content": "Validating...",
294
+ "variant": "h3"
295
+ },
296
+ {
297
+ "type": "spinner",
298
+ "size": "lg"
299
+ },
300
+ {
301
+ "type": "stack",
302
+ "direction": "horizontal",
303
+ "gap": "md",
304
+ "justify": "center",
305
+ "children": [
306
+ {
307
+ "type": "badge",
308
+ "label": "@entity.target"
309
+ },
310
+ {
311
+ "type": "badge",
312
+ "label": [
313
+ "string/concat",
314
+ "Attempt ",
315
+ [
316
+ "string/of",
317
+ "@entity.fixAttempts"
318
+ ],
319
+ "/",
320
+ [
321
+ "string/of",
322
+ "@entity.maxAttempts"
323
+ ]
324
+ ]
325
+ }
326
+ ]
327
+ }
328
+ ]
329
+ }
330
+ ]
331
+ ]
332
+ },
333
+ {
334
+ "from": "validating",
335
+ "to": "succeeded",
336
+ "event": "VALIDATION_PASSED",
337
+ "effects": [
338
+ [
339
+ "set",
340
+ "@entity.status",
341
+ "succeeded"
342
+ ],
343
+ [
344
+ "emit",
345
+ "FIX_SUCCEEDED"
346
+ ],
347
+ [
348
+ "render-ui",
349
+ "main",
350
+ {
351
+ "type": "stack",
352
+ "direction": "vertical",
353
+ "gap": "lg",
354
+ "children": [
355
+ {
356
+ "type": "stack",
357
+ "direction": "horizontal",
358
+ "gap": "sm",
359
+ "align": "center",
360
+ "justify": "space-between",
361
+ "children": [
362
+ {
363
+ "type": "stack",
364
+ "direction": "horizontal",
365
+ "gap": "sm",
366
+ "align": "center",
367
+ "children": [
368
+ {
369
+ "type": "icon",
370
+ "name": "check-circle",
371
+ "size": "lg"
372
+ },
373
+ {
374
+ "type": "typography",
375
+ "content": "Validation Passed",
376
+ "variant": "h2"
377
+ }
378
+ ]
379
+ },
380
+ {
381
+ "type": "button",
382
+ "label": "New Target",
383
+ "event": "RESET",
384
+ "variant": "ghost",
385
+ "icon": "rotate-ccw"
386
+ }
387
+ ]
388
+ },
389
+ {
390
+ "type": "divider"
391
+ },
392
+ {
393
+ "type": "simple-grid",
394
+ "columns": 2,
395
+ "children": [
396
+ {
397
+ "type": "stat-display",
398
+ "label": "Fix Attempts",
399
+ "value": "@entity.fixAttempts",
400
+ "icon": "wrench"
401
+ },
402
+ {
403
+ "type": "stat-display",
404
+ "label": "Status",
405
+ "value": "Passed",
406
+ "icon": "check"
407
+ }
408
+ ]
409
+ },
410
+ {
411
+ "type": "card",
412
+ "children": [
413
+ {
414
+ "type": "stack",
415
+ "direction": "vertical",
416
+ "gap": "sm",
417
+ "children": [
418
+ {
419
+ "type": "typography",
420
+ "content": "Target",
421
+ "variant": "caption"
422
+ },
423
+ {
424
+ "type": "typography",
425
+ "content": "@entity.target",
426
+ "variant": "body"
427
+ }
428
+ ]
429
+ }
430
+ ]
431
+ }
432
+ ]
433
+ }
434
+ ]
435
+ ]
436
+ },
437
+ {
438
+ "from": "validating",
439
+ "to": "fixing",
440
+ "event": "VALIDATION_ERRORS",
441
+ "guards": [
442
+ [
443
+ "math/lt",
444
+ "@entity.fixAttempts",
445
+ 5
446
+ ]
447
+ ],
448
+ "effects": [
449
+ [
450
+ "set",
451
+ "@entity.validationErrors",
452
+ "@payload.errors"
453
+ ],
454
+ [
455
+ "set",
456
+ "@entity.errorCount",
457
+ "@payload.count"
458
+ ],
459
+ [
460
+ "set",
461
+ "@entity.fixAttempts",
462
+ [
463
+ "math/add",
464
+ "@entity.fixAttempts",
465
+ 1
466
+ ]
467
+ ],
468
+ [
469
+ "set",
470
+ "@entity.status",
471
+ "fixing"
472
+ ],
473
+ [
474
+ "agent/generate",
475
+ [
476
+ "string/concat",
477
+ "Target: ",
478
+ "@entity.target",
479
+ "\n\nValidation errors:\n",
480
+ "@payload.errors",
481
+ "\n\nGenerate a fix that resolves these errors. Return only the fix content."
482
+ ]
483
+ ],
484
+ [
485
+ "render-ui",
486
+ "main",
487
+ {
488
+ "type": "stack",
489
+ "direction": "vertical",
490
+ "gap": "lg",
491
+ "children": [
492
+ {
493
+ "type": "stack",
494
+ "direction": "horizontal",
495
+ "gap": "sm",
496
+ "align": "center",
497
+ "justify": "space-between",
498
+ "children": [
499
+ {
500
+ "type": "stack",
501
+ "direction": "horizontal",
502
+ "gap": "sm",
503
+ "align": "center",
504
+ "children": [
505
+ {
506
+ "type": "icon",
507
+ "name": "cpu",
508
+ "size": "lg"
509
+ },
510
+ {
511
+ "type": "typography",
512
+ "content": "Generating fix...",
513
+ "variant": "h2"
514
+ }
515
+ ]
516
+ },
517
+ {
518
+ "type": "badge",
519
+ "label": [
520
+ "string/concat",
521
+ "Attempt ",
522
+ [
523
+ "string/of",
524
+ "@entity.fixAttempts"
525
+ ]
526
+ ]
527
+ }
528
+ ]
529
+ },
530
+ {
531
+ "type": "divider"
532
+ },
533
+ {
534
+ "type": "card",
535
+ "children": [
536
+ {
537
+ "type": "stack",
538
+ "direction": "vertical",
539
+ "gap": "sm",
540
+ "children": [
541
+ {
542
+ "type": "typography",
543
+ "content": "Validation Errors",
544
+ "variant": "caption"
545
+ },
546
+ {
547
+ "type": "alert",
548
+ "variant": "error",
549
+ "message": "@entity.validationErrors"
550
+ }
551
+ ]
552
+ }
553
+ ]
554
+ },
555
+ {
556
+ "type": "spinner",
557
+ "size": "lg"
558
+ }
559
+ ]
560
+ }
561
+ ]
562
+ ]
563
+ },
564
+ {
565
+ "from": "validating",
566
+ "to": "failed",
567
+ "event": "EXCEEDED_ATTEMPTS",
568
+ "effects": [
569
+ [
570
+ "set",
571
+ "@entity.status",
572
+ "failed"
573
+ ],
574
+ [
575
+ "set",
576
+ "@entity.error",
577
+ "@payload.error"
578
+ ],
579
+ [
580
+ "emit",
581
+ "FIX_FAILED"
582
+ ],
583
+ [
584
+ "render-ui",
585
+ "main",
586
+ {
587
+ "type": "stack",
588
+ "direction": "vertical",
589
+ "gap": "lg",
590
+ "align": "center",
591
+ "children": [
592
+ {
593
+ "type": "icon",
594
+ "name": "x-circle",
595
+ "size": "lg"
596
+ },
597
+ {
598
+ "type": "typography",
599
+ "content": "Fix Loop Failed",
600
+ "variant": "h2"
601
+ },
602
+ {
603
+ "type": "alert",
604
+ "variant": "error",
605
+ "message": "@entity.error"
606
+ },
607
+ {
608
+ "type": "simple-grid",
609
+ "columns": 2,
610
+ "children": [
611
+ {
612
+ "type": "stat-display",
613
+ "label": "Attempts Used",
614
+ "value": "@entity.fixAttempts",
615
+ "icon": "wrench"
616
+ },
617
+ {
618
+ "type": "stat-display",
619
+ "label": "Remaining Errors",
620
+ "value": "@entity.errorCount",
621
+ "icon": "alert-triangle"
622
+ }
623
+ ]
624
+ },
625
+ {
626
+ "type": "card",
627
+ "children": [
628
+ {
629
+ "type": "stack",
630
+ "direction": "vertical",
631
+ "gap": "sm",
632
+ "children": [
633
+ {
634
+ "type": "typography",
635
+ "content": "Last Validation Errors",
636
+ "variant": "caption"
637
+ },
638
+ {
639
+ "type": "typography",
640
+ "content": "@entity.validationErrors",
641
+ "variant": "body"
642
+ }
643
+ ]
644
+ }
645
+ ]
646
+ },
647
+ {
648
+ "type": "button",
649
+ "label": "Retry",
650
+ "event": "RESET",
651
+ "variant": "primary",
652
+ "icon": "rotate-ccw"
653
+ }
654
+ ]
655
+ }
656
+ ]
657
+ ]
658
+ },
659
+ {
660
+ "from": "fixing",
661
+ "to": "applying",
662
+ "event": "FIX_GENERATED",
663
+ "effects": [
664
+ [
665
+ "set",
666
+ "@entity.currentFix",
667
+ "@payload.fix"
668
+ ],
669
+ [
670
+ "set",
671
+ "@entity.status",
672
+ "applying"
673
+ ],
674
+ [
675
+ "agent/invoke",
676
+ "apply-fix",
677
+ {
678
+ "target": "@entity.target",
679
+ "fix": "@payload.fix"
680
+ }
681
+ ],
682
+ [
683
+ "render-ui",
684
+ "main",
685
+ {
686
+ "type": "stack",
687
+ "direction": "vertical",
688
+ "gap": "lg",
689
+ "align": "center",
690
+ "children": [
691
+ {
692
+ "type": "icon",
693
+ "name": "tool",
694
+ "size": "lg"
695
+ },
696
+ {
697
+ "type": "typography",
698
+ "content": "Applying fix...",
699
+ "variant": "h3"
700
+ },
701
+ {
702
+ "type": "spinner",
703
+ "size": "lg"
704
+ },
705
+ {
706
+ "type": "card",
707
+ "children": [
708
+ {
709
+ "type": "stack",
710
+ "direction": "vertical",
711
+ "gap": "sm",
712
+ "children": [
713
+ {
714
+ "type": "typography",
715
+ "content": "Proposed Fix",
716
+ "variant": "caption"
717
+ },
718
+ {
719
+ "type": "typography",
720
+ "content": "@entity.currentFix",
721
+ "variant": "body"
722
+ }
723
+ ]
724
+ }
725
+ ]
726
+ }
727
+ ]
728
+ }
729
+ ]
730
+ ]
731
+ },
732
+ {
733
+ "from": "applying",
734
+ "to": "validating",
735
+ "event": "FIX_APPLIED",
736
+ "effects": [
737
+ [
738
+ "set",
739
+ "@entity.status",
740
+ "validating"
741
+ ],
742
+ [
743
+ "agent/invoke",
744
+ "validate-schema",
745
+ {
746
+ "target": "@entity.target"
747
+ }
748
+ ],
749
+ [
750
+ "render-ui",
751
+ "main",
752
+ {
753
+ "type": "stack",
754
+ "direction": "vertical",
755
+ "gap": "lg",
756
+ "align": "center",
757
+ "children": [
758
+ {
759
+ "type": "icon",
760
+ "name": "shield-check",
761
+ "size": "lg"
762
+ },
763
+ {
764
+ "type": "typography",
765
+ "content": "Validating...",
766
+ "variant": "h3"
767
+ },
768
+ {
769
+ "type": "spinner",
770
+ "size": "lg"
771
+ },
772
+ {
773
+ "type": "stack",
774
+ "direction": "horizontal",
775
+ "gap": "md",
776
+ "justify": "center",
777
+ "children": [
778
+ {
779
+ "type": "badge",
780
+ "label": "@entity.target"
781
+ },
782
+ {
783
+ "type": "badge",
784
+ "label": [
785
+ "string/concat",
786
+ "Attempt ",
787
+ [
788
+ "string/of",
789
+ "@entity.fixAttempts"
790
+ ],
791
+ "/",
792
+ [
793
+ "string/of",
794
+ "@entity.maxAttempts"
795
+ ]
796
+ ]
797
+ }
798
+ ]
799
+ }
800
+ ]
801
+ }
802
+ ]
803
+ ]
804
+ },
805
+ {
806
+ "from": "fixing",
807
+ "to": "failed",
808
+ "event": "FAILED",
809
+ "effects": [
810
+ [
811
+ "set",
812
+ "@entity.error",
813
+ "@payload.error"
814
+ ],
815
+ [
816
+ "set",
817
+ "@entity.status",
818
+ "failed"
819
+ ],
820
+ [
821
+ "emit",
822
+ "FIX_FAILED"
823
+ ],
824
+ [
825
+ "render-ui",
826
+ "main",
827
+ {
828
+ "type": "stack",
829
+ "direction": "vertical",
830
+ "gap": "lg",
831
+ "align": "center",
832
+ "children": [
833
+ {
834
+ "type": "icon",
835
+ "name": "x-circle",
836
+ "size": "lg"
837
+ },
838
+ {
839
+ "type": "typography",
840
+ "content": "Fix Loop Failed",
841
+ "variant": "h2"
842
+ },
843
+ {
844
+ "type": "alert",
845
+ "variant": "error",
846
+ "message": "@entity.error"
847
+ },
848
+ {
849
+ "type": "simple-grid",
850
+ "columns": 2,
851
+ "children": [
852
+ {
853
+ "type": "stat-display",
854
+ "label": "Attempts Used",
855
+ "value": "@entity.fixAttempts",
856
+ "icon": "wrench"
857
+ },
858
+ {
859
+ "type": "stat-display",
860
+ "label": "Remaining Errors",
861
+ "value": "@entity.errorCount",
862
+ "icon": "alert-triangle"
863
+ }
864
+ ]
865
+ },
866
+ {
867
+ "type": "card",
868
+ "children": [
869
+ {
870
+ "type": "stack",
871
+ "direction": "vertical",
872
+ "gap": "sm",
873
+ "children": [
874
+ {
875
+ "type": "typography",
876
+ "content": "Last Validation Errors",
877
+ "variant": "caption"
878
+ },
879
+ {
880
+ "type": "typography",
881
+ "content": "@entity.validationErrors",
882
+ "variant": "body"
883
+ }
884
+ ]
885
+ }
886
+ ]
887
+ },
888
+ {
889
+ "type": "button",
890
+ "label": "Retry",
891
+ "event": "RESET",
892
+ "variant": "primary",
893
+ "icon": "rotate-ccw"
894
+ }
895
+ ]
896
+ }
897
+ ]
898
+ ]
899
+ },
900
+ {
901
+ "from": "applying",
902
+ "to": "failed",
903
+ "event": "FAILED",
904
+ "effects": [
905
+ [
906
+ "set",
907
+ "@entity.error",
908
+ "@payload.error"
909
+ ],
910
+ [
911
+ "set",
912
+ "@entity.status",
913
+ "failed"
914
+ ],
915
+ [
916
+ "emit",
917
+ "FIX_FAILED"
918
+ ],
919
+ [
920
+ "render-ui",
921
+ "main",
922
+ {
923
+ "type": "stack",
924
+ "direction": "vertical",
925
+ "gap": "lg",
926
+ "align": "center",
927
+ "children": [
928
+ {
929
+ "type": "icon",
930
+ "name": "x-circle",
931
+ "size": "lg"
932
+ },
933
+ {
934
+ "type": "typography",
935
+ "content": "Fix Loop Failed",
936
+ "variant": "h2"
937
+ },
938
+ {
939
+ "type": "alert",
940
+ "variant": "error",
941
+ "message": "@entity.error"
942
+ },
943
+ {
944
+ "type": "simple-grid",
945
+ "columns": 2,
946
+ "children": [
947
+ {
948
+ "type": "stat-display",
949
+ "label": "Attempts Used",
950
+ "value": "@entity.fixAttempts",
951
+ "icon": "wrench"
952
+ },
953
+ {
954
+ "type": "stat-display",
955
+ "label": "Remaining Errors",
956
+ "value": "@entity.errorCount",
957
+ "icon": "alert-triangle"
958
+ }
959
+ ]
960
+ },
961
+ {
962
+ "type": "card",
963
+ "children": [
964
+ {
965
+ "type": "stack",
966
+ "direction": "vertical",
967
+ "gap": "sm",
968
+ "children": [
969
+ {
970
+ "type": "typography",
971
+ "content": "Last Validation Errors",
972
+ "variant": "caption"
973
+ },
974
+ {
975
+ "type": "typography",
976
+ "content": "@entity.validationErrors",
977
+ "variant": "body"
978
+ }
979
+ ]
980
+ }
981
+ ]
982
+ },
983
+ {
984
+ "type": "button",
985
+ "label": "Retry",
986
+ "event": "RESET",
987
+ "variant": "primary",
988
+ "icon": "rotate-ccw"
989
+ }
990
+ ]
991
+ }
992
+ ]
993
+ ]
994
+ },
995
+ {
996
+ "from": "succeeded",
997
+ "to": "idle",
998
+ "event": "RESET",
999
+ "effects": [
1000
+ [
1001
+ "set",
1002
+ "@entity.status",
1003
+ "idle"
1004
+ ],
1005
+ [
1006
+ "set",
1007
+ "@entity.target",
1008
+ ""
1009
+ ],
1010
+ [
1011
+ "set",
1012
+ "@entity.validationErrors",
1013
+ ""
1014
+ ],
1015
+ [
1016
+ "set",
1017
+ "@entity.currentFix",
1018
+ ""
1019
+ ],
1020
+ [
1021
+ "set",
1022
+ "@entity.fixAttempts",
1023
+ 0
1024
+ ],
1025
+ [
1026
+ "set",
1027
+ "@entity.errorCount",
1028
+ 0
1029
+ ],
1030
+ [
1031
+ "set",
1032
+ "@entity.error",
1033
+ ""
1034
+ ],
1035
+ [
1036
+ "render-ui",
1037
+ "main",
1038
+ {
1039
+ "type": "stack",
1040
+ "direction": "vertical",
1041
+ "gap": "lg",
1042
+ "children": [
1043
+ {
1044
+ "type": "stack",
1045
+ "direction": "horizontal",
1046
+ "gap": "sm",
1047
+ "align": "center",
1048
+ "children": [
1049
+ {
1050
+ "type": "icon",
1051
+ "name": "wrench",
1052
+ "size": "lg"
1053
+ },
1054
+ {
1055
+ "type": "typography",
1056
+ "content": "Validation-Fix Loop",
1057
+ "variant": "h2"
1058
+ }
1059
+ ]
1060
+ },
1061
+ {
1062
+ "type": "divider"
1063
+ },
1064
+ {
1065
+ "type": "card",
1066
+ "children": [
1067
+ {
1068
+ "type": "stack",
1069
+ "direction": "vertical",
1070
+ "gap": "md",
1071
+ "children": [
1072
+ {
1073
+ "type": "typography",
1074
+ "content": "Enter the target to validate and auto-fix",
1075
+ "variant": "body"
1076
+ },
1077
+ {
1078
+ "type": "form-section",
1079
+ "entity": "AgentFixLoop",
1080
+ "mode": "edit",
1081
+ "submitEvent": "FIX",
1082
+ "fields": [
1083
+ "target"
1084
+ ]
1085
+ }
1086
+ ]
1087
+ }
1088
+ ]
1089
+ }
1090
+ ]
1091
+ }
1092
+ ]
1093
+ ]
1094
+ },
1095
+ {
1096
+ "from": "failed",
1097
+ "to": "idle",
1098
+ "event": "RESET",
1099
+ "effects": [
1100
+ [
1101
+ "set",
1102
+ "@entity.status",
1103
+ "idle"
1104
+ ],
1105
+ [
1106
+ "set",
1107
+ "@entity.target",
1108
+ ""
1109
+ ],
1110
+ [
1111
+ "set",
1112
+ "@entity.validationErrors",
1113
+ ""
1114
+ ],
1115
+ [
1116
+ "set",
1117
+ "@entity.currentFix",
1118
+ ""
1119
+ ],
1120
+ [
1121
+ "set",
1122
+ "@entity.fixAttempts",
1123
+ 0
1124
+ ],
1125
+ [
1126
+ "set",
1127
+ "@entity.errorCount",
1128
+ 0
1129
+ ],
1130
+ [
1131
+ "set",
1132
+ "@entity.error",
1133
+ ""
1134
+ ],
1135
+ [
1136
+ "render-ui",
1137
+ "main",
1138
+ {
1139
+ "type": "stack",
1140
+ "direction": "vertical",
1141
+ "gap": "lg",
1142
+ "children": [
1143
+ {
1144
+ "type": "stack",
1145
+ "direction": "horizontal",
1146
+ "gap": "sm",
1147
+ "align": "center",
1148
+ "children": [
1149
+ {
1150
+ "type": "icon",
1151
+ "name": "wrench",
1152
+ "size": "lg"
1153
+ },
1154
+ {
1155
+ "type": "typography",
1156
+ "content": "Validation-Fix Loop",
1157
+ "variant": "h2"
1158
+ }
1159
+ ]
1160
+ },
1161
+ {
1162
+ "type": "divider"
1163
+ },
1164
+ {
1165
+ "type": "card",
1166
+ "children": [
1167
+ {
1168
+ "type": "stack",
1169
+ "direction": "vertical",
1170
+ "gap": "md",
1171
+ "children": [
1172
+ {
1173
+ "type": "typography",
1174
+ "content": "Enter the target to validate and auto-fix",
1175
+ "variant": "body"
1176
+ },
1177
+ {
1178
+ "type": "form-section",
1179
+ "entity": "AgentFixLoop",
1180
+ "mode": "edit",
1181
+ "submitEvent": "FIX",
1182
+ "fields": [
1183
+ "target"
1184
+ ]
1185
+ }
1186
+ ]
1187
+ }
1188
+ ]
1189
+ }
1190
+ ]
1191
+ }
1192
+ ]
1193
+ ]
1194
+ }
1195
+ ]
1196
+ }
1197
+ }
1198
+ ],
1199
+ "pages": [
1200
+ {
1201
+ "name": "AgentFixLoopPage",
1202
+ "path": "/agentfixloops",
1203
+ "traits": [
1204
+ {
1205
+ "ref": "AgentFixLoopCycle"
1206
+ }
1207
+ ]
1208
+ }
1209
+ ]
1210
+ }
1211
+ ],
1212
+ "description": "Composes tool invocation (validate + fix) and LLM completion into an iterative validation-fix loop. Validates a target, and if errors are found, generates a fix via LLM, applies it via tool invocation, then re-validates. Loops up to maxAttempts rounds (default 5). Traits composed (inline, representing atom-level concerns): - FixLoopValidate: tool invocation for running validation - FixLoopFix: LLM completion to generate fixes + tool invocation to apply - FixLoopOrchestrator: state machine orchestrating the validate-fix cycle"
1213
+ }