@almadar/std 3.13.0 → 3.13.1

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 (86) hide show
  1. package/behaviors/exports/atoms/std-agent-activity-log.orb +559 -0
  2. package/behaviors/exports/atoms/std-agent-chat-thread.orb +774 -0
  3. package/behaviors/exports/atoms/std-agent-classifier.orb +606 -137
  4. package/behaviors/exports/atoms/std-agent-completion.orb +646 -182
  5. package/behaviors/exports/atoms/std-agent-context-window.orb +1762 -258
  6. package/behaviors/exports/atoms/std-agent-conversation.orb +652 -369
  7. package/behaviors/exports/atoms/std-agent-memory.orb +574 -322
  8. package/behaviors/exports/atoms/std-agent-provider.orb +632 -136
  9. package/behaviors/exports/atoms/std-agent-search.orb +228 -198
  10. package/behaviors/exports/atoms/std-agent-session.orb +569 -559
  11. package/behaviors/exports/atoms/std-agent-step-progress.orb +850 -0
  12. package/behaviors/exports/atoms/std-agent-token-gauge.orb +1616 -0
  13. package/behaviors/exports/atoms/std-agent-tool-call.orb +983 -126
  14. package/behaviors/exports/molecules/std-agent-fix-loop.orb +1985 -21
  15. package/behaviors/exports/molecules/std-agent-learner.orb +1830 -23
  16. package/behaviors/exports/molecules/std-agent-planner.orb +1776 -19
  17. package/behaviors/exports/molecules/std-agent-rag.orb +1150 -15
  18. package/behaviors/exports/molecules/std-agent-tool-loop.orb +3643 -23
  19. package/behaviors/exports/organisms/std-agent-assistant.orb +5308 -1156
  20. package/behaviors/exports/organisms/std-agent-builder.orb +13525 -1326
  21. package/behaviors/exports/organisms/std-agent-pipeline.orb +10731 -1088
  22. package/behaviors/exports/organisms/std-agent-reviewer.orb +4187 -525
  23. package/behaviors/exports/organisms/std-agent-tutor.orb +3126 -322
  24. package/behaviors/exports/validation-report.json +1 -1426
  25. package/dist/behaviors/exports/atoms/std-agent-activity-log.orb +559 -0
  26. package/dist/behaviors/exports/atoms/std-agent-chat-thread.orb +774 -0
  27. package/dist/behaviors/exports/atoms/std-agent-classifier.orb +606 -137
  28. package/dist/behaviors/exports/atoms/std-agent-completion.orb +646 -182
  29. package/dist/behaviors/exports/atoms/std-agent-context-window.orb +1762 -258
  30. package/dist/behaviors/exports/atoms/std-agent-conversation.orb +652 -369
  31. package/dist/behaviors/exports/atoms/std-agent-memory.orb +574 -322
  32. package/dist/behaviors/exports/atoms/std-agent-provider.orb +632 -136
  33. package/dist/behaviors/exports/atoms/std-agent-search.orb +228 -198
  34. package/dist/behaviors/exports/atoms/std-agent-session.orb +569 -559
  35. package/dist/behaviors/exports/atoms/std-agent-step-progress.orb +850 -0
  36. package/dist/behaviors/exports/atoms/std-agent-token-gauge.orb +1616 -0
  37. package/dist/behaviors/exports/atoms/std-agent-tool-call.orb +983 -126
  38. package/dist/behaviors/exports/molecules/std-agent-fix-loop.orb +1985 -21
  39. package/dist/behaviors/exports/molecules/std-agent-learner.orb +1830 -23
  40. package/dist/behaviors/exports/molecules/std-agent-planner.orb +1776 -19
  41. package/dist/behaviors/exports/molecules/std-agent-rag.orb +1150 -15
  42. package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +3643 -23
  43. package/dist/behaviors/exports/organisms/std-agent-assistant.orb +5308 -1156
  44. package/dist/behaviors/exports/organisms/std-agent-builder.orb +13525 -1326
  45. package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +10731 -1088
  46. package/dist/behaviors/exports/organisms/std-agent-reviewer.orb +4187 -525
  47. package/dist/behaviors/exports/organisms/std-agent-tutor.orb +3126 -322
  48. package/dist/behaviors/exports/validation-report.json +1 -1426
  49. package/dist/behaviors/exports-reader.js +4860 -4176
  50. package/dist/behaviors/exports-reader.js.map +1 -1
  51. package/dist/behaviors/functions/index.d.ts +259 -98
  52. package/dist/behaviors/functions/index.js +4845 -4177
  53. package/dist/behaviors/functions/index.js.map +1 -1
  54. package/dist/behaviors/index.d.ts +1 -1
  55. package/dist/behaviors/index.js +4863 -4179
  56. package/dist/behaviors/index.js.map +1 -1
  57. package/dist/behaviors/query.js +4862 -4178
  58. package/dist/behaviors/query.js.map +1 -1
  59. package/dist/exports/atoms/std-agent-activity-log.orb +559 -0
  60. package/dist/exports/atoms/std-agent-chat-thread.orb +774 -0
  61. package/dist/exports/atoms/std-agent-classifier.orb +606 -137
  62. package/dist/exports/atoms/std-agent-completion.orb +646 -182
  63. package/dist/exports/atoms/std-agent-context-window.orb +1762 -258
  64. package/dist/exports/atoms/std-agent-conversation.orb +652 -369
  65. package/dist/exports/atoms/std-agent-memory.orb +574 -322
  66. package/dist/exports/atoms/std-agent-provider.orb +632 -136
  67. package/dist/exports/atoms/std-agent-search.orb +228 -198
  68. package/dist/exports/atoms/std-agent-session.orb +569 -559
  69. package/dist/exports/atoms/std-agent-step-progress.orb +850 -0
  70. package/dist/exports/atoms/std-agent-token-gauge.orb +1616 -0
  71. package/dist/exports/atoms/std-agent-tool-call.orb +983 -126
  72. package/dist/exports/molecules/std-agent-fix-loop.orb +1985 -21
  73. package/dist/exports/molecules/std-agent-learner.orb +1830 -23
  74. package/dist/exports/molecules/std-agent-planner.orb +1776 -19
  75. package/dist/exports/molecules/std-agent-rag.orb +1150 -15
  76. package/dist/exports/molecules/std-agent-tool-loop.orb +3643 -23
  77. package/dist/exports/organisms/std-agent-assistant.orb +5308 -1156
  78. package/dist/exports/organisms/std-agent-builder.orb +13525 -1326
  79. package/dist/exports/organisms/std-agent-pipeline.orb +10731 -1088
  80. package/dist/exports/organisms/std-agent-reviewer.orb +4187 -525
  81. package/dist/exports/organisms/std-agent-tutor.orb +3126 -322
  82. package/dist/exports/validation-report.json +1 -1426
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.js +4864 -4180
  85. package/dist/index.js.map +1 -1
  86. package/package.json +1 -1
@@ -49,42 +49,385 @@
49
49
  "type": "string",
50
50
  "default": ""
51
51
  },
52
+ {
53
+ "name": "error",
54
+ "type": "string",
55
+ "default": ""
56
+ },
52
57
  {
53
58
  "name": "duration",
54
59
  "type": "number",
55
60
  "default": 0
61
+ },
62
+ {
63
+ "name": "action",
64
+ "type": "string",
65
+ "default": ""
66
+ },
67
+ {
68
+ "name": "detail",
69
+ "type": "string",
70
+ "default": ""
71
+ },
72
+ {
73
+ "name": "timestamp",
74
+ "type": "string",
75
+ "default": ""
56
76
  }
57
77
  ]
58
78
  },
59
79
  "traits": [
60
80
  {
61
- "name": "AgentToolCallExecutor",
81
+ "name": "AgentToolCallModal",
62
82
  "linkedEntity": "AgentToolCall",
63
83
  "category": "interaction",
64
84
  "emits": [
65
85
  {
66
- "event": "TOOL_STARTED",
67
- "scope": "external"
68
- },
69
- {
70
- "event": "TOOL_COMPLETED",
71
- "scope": "external"
86
+ "event": "INVOKED"
72
87
  }
73
88
  ],
74
89
  "stateMachine": {
75
90
  "states": [
76
91
  {
77
- "name": "idle",
92
+ "name": "closed",
78
93
  "isInitial": true
79
94
  },
80
95
  {
81
- "name": "executing"
96
+ "name": "open"
97
+ }
98
+ ],
99
+ "events": [
100
+ {
101
+ "key": "INIT",
102
+ "name": "Initialize"
82
103
  },
83
104
  {
84
- "name": "completed"
105
+ "key": "INVOKE",
106
+ "name": "Open"
85
107
  },
86
108
  {
87
- "name": "failed"
109
+ "key": "CLOSE",
110
+ "name": "Close"
111
+ },
112
+ {
113
+ "key": "SAVE",
114
+ "name": "Save",
115
+ "payload": [
116
+ {
117
+ "name": "data",
118
+ "type": "object",
119
+ "required": true
120
+ }
121
+ ]
122
+ }
123
+ ],
124
+ "transitions": [
125
+ {
126
+ "from": "closed",
127
+ "to": "closed",
128
+ "event": "INIT",
129
+ "effects": [
130
+ [
131
+ "ref",
132
+ "AgentToolCall"
133
+ ],
134
+ [
135
+ "render-ui",
136
+ "main",
137
+ {
138
+ "type": "stack",
139
+ "direction": "vertical",
140
+ "gap": "lg",
141
+ "children": [
142
+ {
143
+ "type": "stack",
144
+ "direction": "horizontal",
145
+ "gap": "md",
146
+ "justify": "space-between",
147
+ "children": [
148
+ {
149
+ "type": "stack",
150
+ "direction": "horizontal",
151
+ "gap": "md",
152
+ "children": [
153
+ {
154
+ "type": "icon",
155
+ "name": "wrench",
156
+ "size": "lg"
157
+ },
158
+ {
159
+ "type": "typography",
160
+ "content": "Invoke Tool",
161
+ "variant": "h2"
162
+ }
163
+ ]
164
+ },
165
+ {
166
+ "type": "button",
167
+ "label": "Open",
168
+ "event": "INVOKE",
169
+ "variant": "primary",
170
+ "icon": "wrench"
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ "type": "divider"
176
+ },
177
+ {
178
+ "type": "empty-state",
179
+ "icon": "wrench",
180
+ "title": "Nothing open",
181
+ "description": "Click Open to view details in a modal overlay."
182
+ }
183
+ ]
184
+ }
185
+ ]
186
+ ]
187
+ },
188
+ {
189
+ "from": "closed",
190
+ "to": "open",
191
+ "event": "INVOKE",
192
+ "effects": [
193
+ [
194
+ "render-ui",
195
+ "modal",
196
+ {
197
+ "type": "stack",
198
+ "direction": "vertical",
199
+ "gap": "md",
200
+ "children": [
201
+ {
202
+ "type": "stack",
203
+ "direction": "horizontal",
204
+ "gap": "sm",
205
+ "children": [
206
+ {
207
+ "type": "icon",
208
+ "name": "wrench",
209
+ "size": "md"
210
+ },
211
+ {
212
+ "type": "typography",
213
+ "content": "Invoke Tool",
214
+ "variant": "h3"
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ "type": "divider"
220
+ },
221
+ {
222
+ "type": "form-section",
223
+ "entity": "AgentToolCall",
224
+ "mode": "create",
225
+ "submitEvent": "SAVE",
226
+ "cancelEvent": "CLOSE",
227
+ "fields": [
228
+ "toolName",
229
+ "args"
230
+ ]
231
+ }
232
+ ]
233
+ }
234
+ ]
235
+ ]
236
+ },
237
+ {
238
+ "from": "open",
239
+ "to": "closed",
240
+ "event": "CLOSE",
241
+ "effects": [
242
+ [
243
+ "render-ui",
244
+ "modal",
245
+ null
246
+ ],
247
+ [
248
+ "notify",
249
+ "Cancelled",
250
+ "info"
251
+ ],
252
+ [
253
+ "ref",
254
+ "AgentToolCall"
255
+ ],
256
+ [
257
+ "render-ui",
258
+ "main",
259
+ {
260
+ "type": "stack",
261
+ "direction": "vertical",
262
+ "gap": "lg",
263
+ "children": [
264
+ {
265
+ "type": "stack",
266
+ "direction": "horizontal",
267
+ "gap": "md",
268
+ "justify": "space-between",
269
+ "children": [
270
+ {
271
+ "type": "stack",
272
+ "direction": "horizontal",
273
+ "gap": "md",
274
+ "children": [
275
+ {
276
+ "type": "icon",
277
+ "name": "wrench",
278
+ "size": "lg"
279
+ },
280
+ {
281
+ "type": "typography",
282
+ "content": "Invoke Tool",
283
+ "variant": "h2"
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ "type": "button",
289
+ "label": "Open",
290
+ "event": "INVOKE",
291
+ "variant": "primary",
292
+ "icon": "wrench"
293
+ }
294
+ ]
295
+ },
296
+ {
297
+ "type": "divider"
298
+ },
299
+ {
300
+ "type": "empty-state",
301
+ "icon": "wrench",
302
+ "title": "Nothing open",
303
+ "description": "Click Open to view details in a modal overlay."
304
+ }
305
+ ]
306
+ }
307
+ ]
308
+ ]
309
+ },
310
+ {
311
+ "from": "open",
312
+ "to": "closed",
313
+ "event": "SAVE",
314
+ "effects": [
315
+ [
316
+ "persist",
317
+ "create",
318
+ "AgentToolCall",
319
+ "@payload.data"
320
+ ],
321
+ [
322
+ "render-ui",
323
+ "modal",
324
+ null
325
+ ],
326
+ [
327
+ "emit",
328
+ "INVOKED"
329
+ ],
330
+ [
331
+ "ref",
332
+ "AgentToolCall"
333
+ ],
334
+ [
335
+ "render-ui",
336
+ "main",
337
+ {
338
+ "type": "stack",
339
+ "direction": "vertical",
340
+ "gap": "lg",
341
+ "children": [
342
+ {
343
+ "type": "stack",
344
+ "direction": "horizontal",
345
+ "gap": "md",
346
+ "justify": "space-between",
347
+ "children": [
348
+ {
349
+ "type": "stack",
350
+ "direction": "horizontal",
351
+ "gap": "md",
352
+ "children": [
353
+ {
354
+ "type": "icon",
355
+ "name": "wrench",
356
+ "size": "lg"
357
+ },
358
+ {
359
+ "type": "typography",
360
+ "content": "Invoke Tool",
361
+ "variant": "h2"
362
+ }
363
+ ]
364
+ },
365
+ {
366
+ "type": "button",
367
+ "label": "Open",
368
+ "event": "INVOKE",
369
+ "variant": "primary",
370
+ "icon": "wrench"
371
+ }
372
+ ]
373
+ },
374
+ {
375
+ "type": "divider"
376
+ },
377
+ {
378
+ "type": "empty-state",
379
+ "icon": "wrench",
380
+ "title": "Nothing open",
381
+ "description": "Click Open to view details in a modal overlay."
382
+ }
383
+ ]
384
+ }
385
+ ],
386
+ [
387
+ "notify",
388
+ "AgentToolCall created successfully"
389
+ ]
390
+ ]
391
+ }
392
+ ]
393
+ }
394
+ },
395
+ {
396
+ "name": "AgentToolCallLog",
397
+ "linkedEntity": "AgentToolCall",
398
+ "category": "interaction",
399
+ "emits": [
400
+ {
401
+ "event": "LOG_ENTRY",
402
+ "scope": "external",
403
+ "payload": [
404
+ {
405
+ "name": "action",
406
+ "type": "string"
407
+ },
408
+ {
409
+ "name": "detail",
410
+ "type": "string"
411
+ },
412
+ {
413
+ "name": "status",
414
+ "type": "string"
415
+ }
416
+ ]
417
+ }
418
+ ],
419
+ "listens": [
420
+ {
421
+ "event": "LOG_ENTRY",
422
+ "triggers": "LOG_ENTRY",
423
+ "scope": "external"
424
+ }
425
+ ],
426
+ "stateMachine": {
427
+ "states": [
428
+ {
429
+ "name": "logging",
430
+ "isInitial": true
88
431
  }
89
432
  ],
90
433
  "events": [
@@ -93,30 +436,35 @@
93
436
  "name": "Initialize"
94
437
  },
95
438
  {
96
- "key": "INVOKE",
97
- "name": "Invoke Tool",
439
+ "key": "LOG_ENTRY",
440
+ "name": "Log Entry",
98
441
  "payload": [
99
442
  {
100
- "name": "toolName",
443
+ "name": "action",
101
444
  "type": "string",
102
445
  "required": true
103
446
  },
104
447
  {
105
- "name": "args",
448
+ "name": "detail",
106
449
  "type": "string",
107
- "required": false
450
+ "required": true
451
+ },
452
+ {
453
+ "name": "status",
454
+ "type": "string",
455
+ "required": true
108
456
  }
109
457
  ]
110
458
  },
111
459
  {
112
- "key": "CANCEL",
113
- "name": "Cancel"
460
+ "key": "CLEAR",
461
+ "name": "Clear Log"
114
462
  }
115
463
  ],
116
464
  "transitions": [
117
465
  {
118
- "from": "idle",
119
- "to": "idle",
466
+ "from": "logging",
467
+ "to": "logging",
120
468
  "event": "INIT",
121
469
  "effects": [
122
470
  [
@@ -135,17 +483,33 @@
135
483
  "type": "stack",
136
484
  "direction": "horizontal",
137
485
  "gap": "sm",
486
+ "justify": "space-between",
138
487
  "align": "center",
139
488
  "children": [
140
489
  {
141
- "type": "icon",
142
- "name": "wrench",
143
- "size": "lg"
490
+ "type": "stack",
491
+ "direction": "horizontal",
492
+ "gap": "sm",
493
+ "align": "center",
494
+ "children": [
495
+ {
496
+ "type": "icon",
497
+ "name": "activity",
498
+ "size": "lg"
499
+ },
500
+ {
501
+ "type": "typography",
502
+ "content": "Activity Log",
503
+ "variant": "h2"
504
+ }
505
+ ]
144
506
  },
145
507
  {
146
- "type": "typography",
147
- "content": "AgentToolCall",
148
- "variant": "h2"
508
+ "type": "button",
509
+ "label": "Clear",
510
+ "event": "CLEAR",
511
+ "variant": "ghost",
512
+ "icon": "trash"
149
513
  }
150
514
  ]
151
515
  },
@@ -153,43 +517,516 @@
153
517
  "type": "divider"
154
518
  },
155
519
  {
156
- "type": "input",
157
- "label": "Tool Name",
158
- "bind": "@entity.toolName",
159
- "placeholder": "e.g. read_file"
520
+ "type": "timeline",
521
+ "entity": "AgentToolCall",
522
+ "emptyIcon": "activity",
523
+ "emptyTitle": "No activity yet",
524
+ "emptyDescription": "Agent actions will appear here as they occur.",
525
+ "renderItem": [
526
+ "fn",
527
+ "item",
528
+ {
529
+ "type": "stack",
530
+ "direction": "vertical",
531
+ "gap": "xs",
532
+ "children": [
533
+ {
534
+ "type": "stack",
535
+ "direction": "horizontal",
536
+ "gap": "sm",
537
+ "align": "center",
538
+ "children": [
539
+ {
540
+ "type": "badge",
541
+ "label": "@item.status"
542
+ },
543
+ {
544
+ "type": "typography",
545
+ "variant": "h4",
546
+ "content": "@item.action"
547
+ }
548
+ ]
549
+ },
550
+ {
551
+ "type": "typography",
552
+ "variant": "body",
553
+ "color": "muted",
554
+ "content": "@item.detail"
555
+ },
556
+ {
557
+ "type": "stack",
558
+ "direction": "horizontal",
559
+ "gap": "sm",
560
+ "align": "center",
561
+ "children": [
562
+ {
563
+ "type": "typography",
564
+ "variant": "caption",
565
+ "color": "muted",
566
+ "content": "@item.timestamp"
567
+ },
568
+ {
569
+ "type": "badge",
570
+ "label": "@item.duration",
571
+ "variant": "outline"
572
+ }
573
+ ]
574
+ }
575
+ ]
576
+ }
577
+ ],
578
+ "fields": [
579
+ "name",
580
+ "description",
581
+ "status",
582
+ "createdAt",
583
+ "toolName",
584
+ "args",
585
+ "result",
586
+ "error",
587
+ "duration",
588
+ "action",
589
+ "detail",
590
+ "timestamp"
591
+ ]
592
+ }
593
+ ]
594
+ }
595
+ ]
596
+ ]
597
+ },
598
+ {
599
+ "from": "logging",
600
+ "to": "logging",
601
+ "event": "LOG_ENTRY",
602
+ "effects": [
603
+ [
604
+ "persist",
605
+ "create",
606
+ "AgentToolCall",
607
+ {
608
+ "action": "@payload.action",
609
+ "detail": "@payload.detail",
610
+ "status": "@payload.status",
611
+ "timestamp": "@now"
612
+ }
613
+ ],
614
+ [
615
+ "fetch",
616
+ "AgentToolCall"
617
+ ],
618
+ [
619
+ "render-ui",
620
+ "main",
621
+ {
622
+ "type": "stack",
623
+ "direction": "vertical",
624
+ "gap": "lg",
625
+ "children": [
626
+ {
627
+ "type": "stack",
628
+ "direction": "horizontal",
629
+ "gap": "sm",
630
+ "justify": "space-between",
631
+ "align": "center",
632
+ "children": [
633
+ {
634
+ "type": "stack",
635
+ "direction": "horizontal",
636
+ "gap": "sm",
637
+ "align": "center",
638
+ "children": [
639
+ {
640
+ "type": "icon",
641
+ "name": "activity",
642
+ "size": "lg"
643
+ },
644
+ {
645
+ "type": "typography",
646
+ "content": "Activity Log",
647
+ "variant": "h2"
648
+ }
649
+ ]
650
+ },
651
+ {
652
+ "type": "button",
653
+ "label": "Clear",
654
+ "event": "CLEAR",
655
+ "variant": "ghost",
656
+ "icon": "trash"
657
+ }
658
+ ]
160
659
  },
161
660
  {
162
- "type": "textarea",
163
- "label": "Arguments",
164
- "bind": "@entity.args",
165
- "placeholder": "Tool arguments (JSON)..."
661
+ "type": "divider"
166
662
  },
167
663
  {
168
- "type": "button",
169
- "label": "Invoke",
170
- "event": "INVOKE",
171
- "variant": "primary",
172
- "icon": "play"
664
+ "type": "timeline",
665
+ "entity": "AgentToolCall",
666
+ "emptyIcon": "activity",
667
+ "emptyTitle": "No activity yet",
668
+ "emptyDescription": "Agent actions will appear here as they occur.",
669
+ "renderItem": [
670
+ "fn",
671
+ "item",
672
+ {
673
+ "type": "stack",
674
+ "direction": "vertical",
675
+ "gap": "xs",
676
+ "children": [
677
+ {
678
+ "type": "stack",
679
+ "direction": "horizontal",
680
+ "gap": "sm",
681
+ "align": "center",
682
+ "children": [
683
+ {
684
+ "type": "badge",
685
+ "label": "@item.status"
686
+ },
687
+ {
688
+ "type": "typography",
689
+ "variant": "h4",
690
+ "content": "@item.action"
691
+ }
692
+ ]
693
+ },
694
+ {
695
+ "type": "typography",
696
+ "variant": "body",
697
+ "color": "muted",
698
+ "content": "@item.detail"
699
+ },
700
+ {
701
+ "type": "stack",
702
+ "direction": "horizontal",
703
+ "gap": "sm",
704
+ "align": "center",
705
+ "children": [
706
+ {
707
+ "type": "typography",
708
+ "variant": "caption",
709
+ "color": "muted",
710
+ "content": "@item.timestamp"
711
+ },
712
+ {
713
+ "type": "badge",
714
+ "label": "@item.duration",
715
+ "variant": "outline"
716
+ }
717
+ ]
718
+ }
719
+ ]
720
+ }
721
+ ],
722
+ "fields": [
723
+ "name",
724
+ "description",
725
+ "status",
726
+ "createdAt",
727
+ "toolName",
728
+ "args",
729
+ "result",
730
+ "error",
731
+ "duration",
732
+ "action",
733
+ "detail",
734
+ "timestamp"
735
+ ]
173
736
  }
174
737
  ]
175
738
  }
739
+ ],
740
+ [
741
+ "notify",
742
+ "AgentToolCall created successfully"
743
+ ]
744
+ ]
745
+ },
746
+ {
747
+ "from": "logging",
748
+ "to": "logging",
749
+ "event": "CLEAR",
750
+ "effects": [
751
+ [
752
+ "persist",
753
+ "delete",
754
+ "AgentToolCall"
755
+ ],
756
+ [
757
+ "fetch",
758
+ "AgentToolCall"
759
+ ],
760
+ [
761
+ "render-ui",
762
+ "main",
763
+ {
764
+ "type": "stack",
765
+ "direction": "vertical",
766
+ "gap": "lg",
767
+ "children": [
768
+ {
769
+ "type": "stack",
770
+ "direction": "horizontal",
771
+ "gap": "sm",
772
+ "justify": "space-between",
773
+ "align": "center",
774
+ "children": [
775
+ {
776
+ "type": "stack",
777
+ "direction": "horizontal",
778
+ "gap": "sm",
779
+ "align": "center",
780
+ "children": [
781
+ {
782
+ "type": "icon",
783
+ "name": "activity",
784
+ "size": "lg"
785
+ },
786
+ {
787
+ "type": "typography",
788
+ "content": "Activity Log",
789
+ "variant": "h2"
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "type": "button",
795
+ "label": "Clear",
796
+ "event": "CLEAR",
797
+ "variant": "ghost",
798
+ "icon": "trash"
799
+ }
800
+ ]
801
+ },
802
+ {
803
+ "type": "divider"
804
+ },
805
+ {
806
+ "type": "timeline",
807
+ "entity": "AgentToolCall",
808
+ "emptyIcon": "activity",
809
+ "emptyTitle": "No activity yet",
810
+ "emptyDescription": "Agent actions will appear here as they occur.",
811
+ "renderItem": [
812
+ "fn",
813
+ "item",
814
+ {
815
+ "type": "stack",
816
+ "direction": "vertical",
817
+ "gap": "xs",
818
+ "children": [
819
+ {
820
+ "type": "stack",
821
+ "direction": "horizontal",
822
+ "gap": "sm",
823
+ "align": "center",
824
+ "children": [
825
+ {
826
+ "type": "badge",
827
+ "label": "@item.status"
828
+ },
829
+ {
830
+ "type": "typography",
831
+ "variant": "h4",
832
+ "content": "@item.action"
833
+ }
834
+ ]
835
+ },
836
+ {
837
+ "type": "typography",
838
+ "variant": "body",
839
+ "color": "muted",
840
+ "content": "@item.detail"
841
+ },
842
+ {
843
+ "type": "stack",
844
+ "direction": "horizontal",
845
+ "gap": "sm",
846
+ "align": "center",
847
+ "children": [
848
+ {
849
+ "type": "typography",
850
+ "variant": "caption",
851
+ "color": "muted",
852
+ "content": "@item.timestamp"
853
+ },
854
+ {
855
+ "type": "badge",
856
+ "label": "@item.duration",
857
+ "variant": "outline"
858
+ }
859
+ ]
860
+ }
861
+ ]
862
+ }
863
+ ],
864
+ "fields": [
865
+ "name",
866
+ "description",
867
+ "status",
868
+ "createdAt",
869
+ "toolName",
870
+ "args",
871
+ "result",
872
+ "error",
873
+ "duration",
874
+ "action",
875
+ "detail",
876
+ "timestamp"
877
+ ]
878
+ }
879
+ ]
880
+ }
881
+ ],
882
+ [
883
+ "notify",
884
+ "AgentToolCall deleted successfully"
885
+ ]
886
+ ]
887
+ }
888
+ ]
889
+ }
890
+ },
891
+ {
892
+ "name": "AgentToolCallAgent",
893
+ "linkedEntity": "AgentToolCall",
894
+ "category": "interaction",
895
+ "emits": [
896
+ {
897
+ "event": "TOOL_STARTED",
898
+ "scope": "internal",
899
+ "payload": [
900
+ {
901
+ "name": "toolName",
902
+ "type": "string"
903
+ }
904
+ ]
905
+ },
906
+ {
907
+ "event": "TOOL_COMPLETED",
908
+ "scope": "internal",
909
+ "payload": [
910
+ {
911
+ "name": "toolName",
912
+ "type": "string"
913
+ },
914
+ {
915
+ "name": "result",
916
+ "type": "string"
917
+ }
918
+ ]
919
+ },
920
+ {
921
+ "event": "LOG_ENTRY",
922
+ "scope": "internal",
923
+ "payload": [
924
+ {
925
+ "name": "action",
926
+ "type": "string"
927
+ },
928
+ {
929
+ "name": "detail",
930
+ "type": "string"
931
+ },
932
+ {
933
+ "name": "status",
934
+ "type": "string"
935
+ }
936
+ ]
937
+ }
938
+ ],
939
+ "listens": [
940
+ {
941
+ "event": "INVOKED",
942
+ "triggers": "INVOKED",
943
+ "scope": "external"
944
+ }
945
+ ],
946
+ "stateMachine": {
947
+ "states": [
948
+ {
949
+ "name": "idle",
950
+ "isInitial": true
951
+ },
952
+ {
953
+ "name": "executing"
954
+ },
955
+ {
956
+ "name": "completed"
957
+ },
958
+ {
959
+ "name": "failed"
960
+ }
961
+ ],
962
+ "events": [
963
+ {
964
+ "key": "INIT",
965
+ "name": "Initialize"
966
+ },
967
+ {
968
+ "key": "DO_INVOKE",
969
+ "name": "Do Invoke",
970
+ "payload": [
971
+ {
972
+ "name": "data",
973
+ "type": "object",
974
+ "required": true
975
+ }
976
+ ]
977
+ },
978
+ {
979
+ "key": "CANCEL",
980
+ "name": "Cancel"
981
+ },
982
+ {
983
+ "key": "INVOKED",
984
+ "name": "Invoked",
985
+ "payload": [
986
+ {
987
+ "name": "data",
988
+ "type": "object",
989
+ "required": true
990
+ }
991
+ ]
992
+ }
993
+ ],
994
+ "transitions": [
995
+ {
996
+ "from": "idle",
997
+ "to": "idle",
998
+ "event": "INIT",
999
+ "effects": [
1000
+ [
1001
+ "fetch",
1002
+ "AgentToolCall"
1003
+ ],
1004
+ [
1005
+ "render-ui",
1006
+ "main",
1007
+ {
1008
+ "type": "empty-state",
1009
+ "icon": "wrench",
1010
+ "title": "Tool Call",
1011
+ "description": "Tool Call is ready"
1012
+ }
176
1013
  ]
177
1014
  ]
178
1015
  },
179
1016
  {
180
1017
  "from": "idle",
181
1018
  "to": "executing",
182
- "event": "INVOKE",
1019
+ "event": "DO_INVOKE",
183
1020
  "effects": [
184
1021
  [
185
1022
  "set",
186
1023
  "@entity.toolName",
187
- "@payload.toolName"
1024
+ "@payload.data.toolName"
188
1025
  ],
189
1026
  [
190
1027
  "set",
191
1028
  "@entity.args",
192
- "@payload.args"
1029
+ "@payload.data.args"
193
1030
  ],
194
1031
  [
195
1032
  "set",
@@ -201,35 +1038,55 @@
201
1038
  "TOOL_STARTED"
202
1039
  ],
203
1040
  [
204
- "render-ui",
205
- "main",
206
- {
207
- "type": "loading-state",
208
- "title": "Executing...",
209
- "message": "Running tool..."
210
- }
1041
+ "emit",
1042
+ "LOG_ENTRY"
1043
+ ],
1044
+ [
1045
+ "agent/invoke",
1046
+ "@payload.data.toolName",
1047
+ "@payload.data.args"
1048
+ ]
1049
+ ]
1050
+ },
1051
+ {
1052
+ "from": "idle",
1053
+ "to": "executing",
1054
+ "event": "INVOKED",
1055
+ "effects": [
1056
+ [
1057
+ "set",
1058
+ "@entity.status",
1059
+ "executing"
1060
+ ],
1061
+ [
1062
+ "emit",
1063
+ "TOOL_STARTED"
1064
+ ],
1065
+ [
1066
+ "emit",
1067
+ "LOG_ENTRY"
211
1068
  ],
212
1069
  [
213
1070
  "agent/invoke",
214
- "@payload.toolName",
215
- "@payload.args"
1071
+ "@entity.toolName",
1072
+ "@entity.args"
216
1073
  ]
217
1074
  ]
218
1075
  },
219
1076
  {
220
1077
  "from": "completed",
221
1078
  "to": "executing",
222
- "event": "INVOKE",
1079
+ "event": "DO_INVOKE",
223
1080
  "effects": [
224
1081
  [
225
1082
  "set",
226
1083
  "@entity.toolName",
227
- "@payload.toolName"
1084
+ "@payload.data.toolName"
228
1085
  ],
229
1086
  [
230
1087
  "set",
231
1088
  "@entity.args",
232
- "@payload.args"
1089
+ "@payload.data.args"
233
1090
  ],
234
1091
  [
235
1092
  "set",
@@ -241,35 +1098,30 @@
241
1098
  "TOOL_STARTED"
242
1099
  ],
243
1100
  [
244
- "render-ui",
245
- "main",
246
- {
247
- "type": "loading-state",
248
- "title": "Executing...",
249
- "message": "Running tool..."
250
- }
1101
+ "emit",
1102
+ "LOG_ENTRY"
251
1103
  ],
252
1104
  [
253
1105
  "agent/invoke",
254
- "@payload.toolName",
255
- "@payload.args"
1106
+ "@payload.data.toolName",
1107
+ "@payload.data.args"
256
1108
  ]
257
1109
  ]
258
1110
  },
259
1111
  {
260
1112
  "from": "failed",
261
1113
  "to": "executing",
262
- "event": "INVOKE",
1114
+ "event": "DO_INVOKE",
263
1115
  "effects": [
264
1116
  [
265
1117
  "set",
266
1118
  "@entity.toolName",
267
- "@payload.toolName"
1119
+ "@payload.data.toolName"
268
1120
  ],
269
1121
  [
270
1122
  "set",
271
1123
  "@entity.args",
272
- "@payload.args"
1124
+ "@payload.data.args"
273
1125
  ],
274
1126
  [
275
1127
  "set",
@@ -281,18 +1133,64 @@
281
1133
  "TOOL_STARTED"
282
1134
  ],
283
1135
  [
284
- "render-ui",
285
- "main",
286
- {
287
- "type": "loading-state",
288
- "title": "Executing...",
289
- "message": "Running tool..."
290
- }
1136
+ "emit",
1137
+ "LOG_ENTRY"
291
1138
  ],
292
1139
  [
293
1140
  "agent/invoke",
294
- "@payload.toolName",
295
- "@payload.args"
1141
+ "@payload.data.toolName",
1142
+ "@payload.data.args"
1143
+ ]
1144
+ ]
1145
+ },
1146
+ {
1147
+ "from": "executing",
1148
+ "to": "completed",
1149
+ "event": "DO_INVOKE",
1150
+ "effects": [
1151
+ [
1152
+ "set",
1153
+ "@entity.status",
1154
+ "completed"
1155
+ ],
1156
+ [
1157
+ "set",
1158
+ "@entity.result",
1159
+ "@payload.data.result"
1160
+ ],
1161
+ [
1162
+ "emit",
1163
+ "TOOL_COMPLETED"
1164
+ ],
1165
+ [
1166
+ "emit",
1167
+ "LOG_ENTRY"
1168
+ ]
1169
+ ]
1170
+ },
1171
+ {
1172
+ "from": "executing",
1173
+ "to": "failed",
1174
+ "event": "CANCEL",
1175
+ "guard": [
1176
+ "=",
1177
+ "@entity.status",
1178
+ "executing"
1179
+ ],
1180
+ "effects": [
1181
+ [
1182
+ "set",
1183
+ "@entity.status",
1184
+ "failed"
1185
+ ],
1186
+ [
1187
+ "set",
1188
+ "@entity.error",
1189
+ "Cancelled"
1190
+ ],
1191
+ [
1192
+ "emit",
1193
+ "TOOL_COMPLETED"
296
1194
  ]
297
1195
  ]
298
1196
  },
@@ -307,55 +1205,8 @@
307
1205
  "idle"
308
1206
  ],
309
1207
  [
310
- "render-ui",
311
- "main",
312
- {
313
- "type": "stack",
314
- "direction": "vertical",
315
- "gap": "lg",
316
- "children": [
317
- {
318
- "type": "stack",
319
- "direction": "horizontal",
320
- "gap": "sm",
321
- "align": "center",
322
- "children": [
323
- {
324
- "type": "icon",
325
- "name": "wrench",
326
- "size": "lg"
327
- },
328
- {
329
- "type": "typography",
330
- "content": "AgentToolCall",
331
- "variant": "h2"
332
- }
333
- ]
334
- },
335
- {
336
- "type": "divider"
337
- },
338
- {
339
- "type": "input",
340
- "label": "Tool Name",
341
- "bind": "@entity.toolName",
342
- "placeholder": "e.g. read_file"
343
- },
344
- {
345
- "type": "textarea",
346
- "label": "Arguments",
347
- "bind": "@entity.args",
348
- "placeholder": "Tool arguments (JSON)..."
349
- },
350
- {
351
- "type": "button",
352
- "label": "Invoke",
353
- "event": "INVOKE",
354
- "variant": "primary",
355
- "icon": "play"
356
- }
357
- ]
358
- }
1208
+ "emit",
1209
+ "TOOL_COMPLETED"
359
1210
  ]
360
1211
  ]
361
1212
  }
@@ -369,12 +1220,18 @@
369
1220
  "path": "/agenttoolcalls",
370
1221
  "traits": [
371
1222
  {
372
- "ref": "AgentToolCallExecutor"
1223
+ "ref": "AgentToolCallModal"
1224
+ },
1225
+ {
1226
+ "ref": "AgentToolCallLog"
1227
+ },
1228
+ {
1229
+ "ref": "AgentToolCallAgent"
373
1230
  }
374
1231
  ]
375
1232
  }
376
1233
  ]
377
1234
  }
378
1235
  ],
379
- "description": "Tool execution atom for agent tool invocation. Manages the lifecycle of invoking external tools: idle -> executing -> completed/failed. Emits TOOL_STARTED and TOOL_COMPLETED for cross-trait wiring."
1236
+ "description": "Tool execution atom for agent tool invocation. Composes UI atoms (stdModal for invoke form, stdAgentActivityLog for call history) with an agent trait that handles agent/invoke and TOOL_STARTED/TOOL_COMPLETED emits."
380
1237
  }