@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
@@ -53,25 +53,37 @@
53
53
  "name": "requestCount",
54
54
  "type": "number",
55
55
  "default": 0
56
+ },
57
+ {
58
+ "name": "message",
59
+ "type": "string",
60
+ "default": ""
61
+ },
62
+ {
63
+ "name": "notificationType",
64
+ "type": "string",
65
+ "default": "info"
56
66
  }
57
67
  ]
58
68
  },
59
69
  "traits": [
60
70
  {
61
- "name": "AgentProviderRouter",
71
+ "name": "AgentProviderModal",
62
72
  "linkedEntity": "AgentProvider",
63
73
  "category": "interaction",
74
+ "emits": [
75
+ {
76
+ "event": "SWITCHED"
77
+ }
78
+ ],
64
79
  "stateMachine": {
65
80
  "states": [
66
81
  {
67
- "name": "idle",
82
+ "name": "closed",
68
83
  "isInitial": true
69
84
  },
70
85
  {
71
- "name": "active"
72
- },
73
- {
74
- "name": "switching"
86
+ "name": "open"
75
87
  }
76
88
  ],
77
89
  "events": [
@@ -81,114 +93,228 @@
81
93
  },
82
94
  {
83
95
  "key": "SWITCH",
84
- "name": "Switch Provider",
96
+ "name": "Open"
97
+ },
98
+ {
99
+ "key": "CLOSE",
100
+ "name": "Close"
101
+ },
102
+ {
103
+ "key": "SAVE",
104
+ "name": "Save",
85
105
  "payload": [
86
106
  {
87
- "name": "provider",
88
- "type": "string",
107
+ "name": "data",
108
+ "type": "object",
89
109
  "required": true
90
- },
91
- {
92
- "name": "model",
93
- "type": "string",
94
- "required": false
95
110
  }
96
111
  ]
97
- },
98
- {
99
- "key": "SWITCH_AUTO",
100
- "name": "Auto Switch to Fallback"
101
112
  }
102
113
  ],
103
114
  "transitions": [
104
115
  {
105
- "from": "idle",
106
- "to": "active",
116
+ "from": "closed",
117
+ "to": "closed",
107
118
  "event": "INIT",
108
119
  "effects": [
109
120
  [
110
- "fetch",
121
+ "ref",
111
122
  "AgentProvider"
112
123
  ],
113
124
  [
114
- "agent/provider"
115
- ],
125
+ "render-ui",
126
+ "main",
127
+ {
128
+ "type": "stack",
129
+ "direction": "vertical",
130
+ "gap": "lg",
131
+ "children": [
132
+ {
133
+ "type": "stack",
134
+ "direction": "horizontal",
135
+ "gap": "md",
136
+ "justify": "space-between",
137
+ "children": [
138
+ {
139
+ "type": "stack",
140
+ "direction": "horizontal",
141
+ "gap": "md",
142
+ "children": [
143
+ {
144
+ "type": "icon",
145
+ "name": "repeat",
146
+ "size": "lg"
147
+ },
148
+ {
149
+ "type": "typography",
150
+ "content": "Switch Provider",
151
+ "variant": "h2"
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "type": "button",
157
+ "label": "Open",
158
+ "event": "SWITCH",
159
+ "variant": "primary",
160
+ "icon": "repeat"
161
+ }
162
+ ]
163
+ },
164
+ {
165
+ "type": "divider"
166
+ },
167
+ {
168
+ "type": "empty-state",
169
+ "icon": "repeat",
170
+ "title": "Nothing open",
171
+ "description": "Click Open to view details in a modal overlay."
172
+ }
173
+ ]
174
+ }
175
+ ]
176
+ ]
177
+ },
178
+ {
179
+ "from": "closed",
180
+ "to": "open",
181
+ "event": "SWITCH",
182
+ "effects": [
116
183
  [
117
- "agent/model"
184
+ "fetch",
185
+ "AgentProvider"
118
186
  ],
119
187
  [
120
188
  "render-ui",
121
- "main",
189
+ "modal",
122
190
  {
123
191
  "type": "stack",
124
192
  "direction": "vertical",
125
- "gap": "lg",
193
+ "gap": "md",
126
194
  "children": [
127
195
  {
128
196
  "type": "stack",
129
197
  "direction": "horizontal",
130
198
  "gap": "sm",
131
- "align": "center",
132
199
  "children": [
133
200
  {
134
201
  "type": "icon",
135
- "name": "server",
136
- "size": "lg"
202
+ "name": "repeat",
203
+ "size": "md"
137
204
  },
138
205
  {
139
206
  "type": "typography",
140
- "content": "AgentProvider (Active)",
141
- "variant": "h2"
207
+ "content": "Switch Provider",
208
+ "variant": "h3"
142
209
  }
143
210
  ]
144
211
  },
145
212
  {
146
213
  "type": "divider"
147
214
  },
148
- {
149
- "type": "alert",
150
- "variant": "success",
151
- "message": "Provider is active and routing requests."
152
- },
153
215
  {
154
216
  "type": "stack",
155
217
  "direction": "horizontal",
156
218
  "gap": "md",
157
219
  "children": [
158
220
  {
159
- "type": "badge",
160
- "label": "@entity.currentProvider"
221
+ "type": "typography",
222
+ "variant": "caption",
223
+ "content": "Current:"
161
224
  },
162
225
  {
163
226
  "type": "badge",
164
- "label": "@entity.currentModel"
227
+ "label": "@entity.currentProvider"
165
228
  },
166
229
  {
167
230
  "type": "badge",
168
- "label": "@entity.requestCount"
231
+ "label": "@entity.currentModel"
169
232
  }
170
233
  ]
171
234
  },
235
+ {
236
+ "type": "form-section",
237
+ "entity": "AgentProvider",
238
+ "mode": "edit",
239
+ "submitEvent": "SAVE",
240
+ "cancelEvent": "CLOSE",
241
+ "fields": [
242
+ "currentProvider",
243
+ "currentModel"
244
+ ]
245
+ }
246
+ ]
247
+ }
248
+ ]
249
+ ]
250
+ },
251
+ {
252
+ "from": "open",
253
+ "to": "closed",
254
+ "event": "CLOSE",
255
+ "effects": [
256
+ [
257
+ "render-ui",
258
+ "modal",
259
+ null
260
+ ],
261
+ [
262
+ "notify",
263
+ "Cancelled",
264
+ "info"
265
+ ],
266
+ [
267
+ "ref",
268
+ "AgentProvider"
269
+ ],
270
+ [
271
+ "render-ui",
272
+ "main",
273
+ {
274
+ "type": "stack",
275
+ "direction": "vertical",
276
+ "gap": "lg",
277
+ "children": [
172
278
  {
173
279
  "type": "stack",
174
280
  "direction": "horizontal",
175
- "gap": "sm",
281
+ "gap": "md",
282
+ "justify": "space-between",
176
283
  "children": [
177
284
  {
178
- "type": "button",
179
- "label": "Switch",
180
- "event": "SWITCH",
181
- "variant": "secondary",
182
- "icon": "repeat"
285
+ "type": "stack",
286
+ "direction": "horizontal",
287
+ "gap": "md",
288
+ "children": [
289
+ {
290
+ "type": "icon",
291
+ "name": "repeat",
292
+ "size": "lg"
293
+ },
294
+ {
295
+ "type": "typography",
296
+ "content": "Switch Provider",
297
+ "variant": "h2"
298
+ }
299
+ ]
183
300
  },
184
301
  {
185
302
  "type": "button",
186
- "label": "Auto Switch",
187
- "event": "SWITCH_AUTO",
188
- "variant": "ghost",
189
- "icon": "zap"
303
+ "label": "Open",
304
+ "event": "SWITCH",
305
+ "variant": "primary",
306
+ "icon": "repeat"
190
307
  }
191
308
  ]
309
+ },
310
+ {
311
+ "type": "divider"
312
+ },
313
+ {
314
+ "type": "empty-state",
315
+ "icon": "repeat",
316
+ "title": "Nothing open",
317
+ "description": "Click Open to view details in a modal overlay."
192
318
  }
193
319
  ]
194
320
  }
@@ -196,55 +322,155 @@
196
322
  ]
197
323
  },
198
324
  {
199
- "from": "active",
200
- "to": "switching",
201
- "event": "SWITCH",
325
+ "from": "open",
326
+ "to": "closed",
327
+ "event": "SAVE",
202
328
  "effects": [
329
+ [
330
+ "persist",
331
+ "update",
332
+ "AgentProvider",
333
+ "@payload.data"
334
+ ],
203
335
  [
204
336
  "render-ui",
205
- "main",
206
- {
207
- "type": "loading-state",
208
- "title": "Switching...",
209
- "message": "Switching provider..."
210
- }
337
+ "modal",
338
+ null
211
339
  ],
212
340
  [
213
- "agent/switch-provider",
214
- "@payload.provider",
215
- "@payload.model"
341
+ "emit",
342
+ "SWITCHED"
216
343
  ],
217
344
  [
218
- "set",
219
- "@entity.currentProvider",
220
- "@payload.provider"
345
+ "ref",
346
+ "AgentProvider"
221
347
  ],
222
348
  [
223
- "set",
224
- "@entity.currentModel",
225
- "@payload.model"
349
+ "render-ui",
350
+ "main",
351
+ {
352
+ "type": "stack",
353
+ "direction": "vertical",
354
+ "gap": "lg",
355
+ "children": [
356
+ {
357
+ "type": "stack",
358
+ "direction": "horizontal",
359
+ "gap": "md",
360
+ "justify": "space-between",
361
+ "children": [
362
+ {
363
+ "type": "stack",
364
+ "direction": "horizontal",
365
+ "gap": "md",
366
+ "children": [
367
+ {
368
+ "type": "icon",
369
+ "name": "repeat",
370
+ "size": "lg"
371
+ },
372
+ {
373
+ "type": "typography",
374
+ "content": "Switch Provider",
375
+ "variant": "h2"
376
+ }
377
+ ]
378
+ },
379
+ {
380
+ "type": "button",
381
+ "label": "Open",
382
+ "event": "SWITCH",
383
+ "variant": "primary",
384
+ "icon": "repeat"
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "type": "divider"
390
+ },
391
+ {
392
+ "type": "empty-state",
393
+ "icon": "repeat",
394
+ "title": "Nothing open",
395
+ "description": "Click Open to view details in a modal overlay."
396
+ }
397
+ ]
398
+ }
399
+ ],
400
+ [
401
+ "notify",
402
+ "AgentProvider updated successfully"
226
403
  ]
227
404
  ]
405
+ }
406
+ ]
407
+ }
408
+ },
409
+ {
410
+ "name": "AgentProviderNotification",
411
+ "linkedEntity": "AgentProvider",
412
+ "category": "interaction",
413
+ "stateMachine": {
414
+ "states": [
415
+ {
416
+ "name": "hidden",
417
+ "isInitial": true
228
418
  },
229
419
  {
230
- "from": "switching",
231
- "to": "active",
420
+ "name": "visible"
421
+ }
422
+ ],
423
+ "events": [
424
+ {
425
+ "key": "INIT",
426
+ "name": "Initialize"
427
+ },
428
+ {
429
+ "key": "SHOW",
430
+ "name": "Show Notification",
431
+ "payload": [
432
+ {
433
+ "name": "message",
434
+ "type": "string",
435
+ "required": true
436
+ },
437
+ {
438
+ "name": "notificationType",
439
+ "type": "string"
440
+ }
441
+ ]
442
+ },
443
+ {
444
+ "key": "HIDE",
445
+ "name": "Hide Notification"
446
+ }
447
+ ],
448
+ "transitions": [
449
+ {
450
+ "from": "hidden",
451
+ "to": "hidden",
232
452
  "event": "INIT",
233
453
  "effects": [
234
454
  [
235
- "agent/provider"
236
- ],
455
+ "fetch",
456
+ "AgentProvider"
457
+ ]
458
+ ]
459
+ },
460
+ {
461
+ "from": "hidden",
462
+ "to": "visible",
463
+ "event": "SHOW",
464
+ "effects": [
237
465
  [
238
- "agent/model"
466
+ "set",
467
+ "@entity.message",
468
+ "@payload.message"
239
469
  ],
240
470
  [
241
471
  "set",
242
- "@entity.requestCount",
243
- [
244
- "+",
245
- "@entity.requestCount",
246
- 1
247
- ]
472
+ "@entity.notificationType",
473
+ "@payload.notificationType"
248
474
  ],
249
475
  [
250
476
  "render-ui",
@@ -257,18 +483,34 @@
257
483
  {
258
484
  "type": "stack",
259
485
  "direction": "horizontal",
260
- "gap": "sm",
486
+ "gap": "md",
487
+ "justify": "space-between",
261
488
  "align": "center",
262
489
  "children": [
263
490
  {
264
- "type": "icon",
265
- "name": "server",
266
- "size": "lg"
491
+ "type": "stack",
492
+ "direction": "horizontal",
493
+ "gap": "md",
494
+ "align": "center",
495
+ "children": [
496
+ {
497
+ "type": "icon",
498
+ "name": "server",
499
+ "size": "lg"
500
+ },
501
+ {
502
+ "type": "typography",
503
+ "content": "Provider Status",
504
+ "variant": "h2"
505
+ }
506
+ ]
267
507
  },
268
508
  {
269
- "type": "typography",
270
- "content": "AgentProvider (Active)",
271
- "variant": "h2"
509
+ "type": "button",
510
+ "label": "Dismiss",
511
+ "event": "HIDE",
512
+ "variant": "ghost",
513
+ "icon": "x"
272
514
  }
273
515
  ]
274
516
  },
@@ -277,48 +519,140 @@
277
519
  },
278
520
  {
279
521
  "type": "alert",
280
- "variant": "success",
281
- "message": "Provider is active and routing requests."
522
+ "variant": [
523
+ "object/get",
524
+ [
525
+ "array/first",
526
+ "@entity"
527
+ ],
528
+ "notificationType"
529
+ ],
530
+ "message": [
531
+ "object/get",
532
+ [
533
+ "array/first",
534
+ "@entity"
535
+ ],
536
+ "message"
537
+ ]
282
538
  },
283
539
  {
284
- "type": "stack",
285
- "direction": "horizontal",
286
- "gap": "md",
287
- "children": [
288
- {
289
- "type": "badge",
290
- "label": "@entity.currentProvider"
291
- },
292
- {
293
- "type": "badge",
294
- "label": "@entity.currentModel"
295
- },
296
- {
297
- "type": "badge",
298
- "label": "@entity.requestCount"
299
- }
300
- ]
540
+ "type": "toast-slot",
541
+ "position": "top-right"
301
542
  },
543
+ {
544
+ "type": "violation-alert",
545
+ "severity": "warning",
546
+ "message": [
547
+ "object/get",
548
+ [
549
+ "array/first",
550
+ "@entity"
551
+ ],
552
+ "message"
553
+ ],
554
+ "category": "compliance"
555
+ }
556
+ ]
557
+ }
558
+ ]
559
+ ]
560
+ },
561
+ {
562
+ "from": "visible",
563
+ "to": "visible",
564
+ "event": "SHOW",
565
+ "effects": [
566
+ [
567
+ "set",
568
+ "@entity.message",
569
+ "@payload.message"
570
+ ],
571
+ [
572
+ "set",
573
+ "@entity.notificationType",
574
+ "@payload.notificationType"
575
+ ],
576
+ [
577
+ "render-ui",
578
+ "main",
579
+ {
580
+ "type": "stack",
581
+ "direction": "vertical",
582
+ "gap": "lg",
583
+ "children": [
302
584
  {
303
585
  "type": "stack",
304
586
  "direction": "horizontal",
305
- "gap": "sm",
587
+ "gap": "md",
588
+ "justify": "space-between",
589
+ "align": "center",
306
590
  "children": [
307
591
  {
308
- "type": "button",
309
- "label": "Switch",
310
- "event": "SWITCH",
311
- "variant": "secondary",
312
- "icon": "repeat"
592
+ "type": "stack",
593
+ "direction": "horizontal",
594
+ "gap": "md",
595
+ "align": "center",
596
+ "children": [
597
+ {
598
+ "type": "icon",
599
+ "name": "server",
600
+ "size": "lg"
601
+ },
602
+ {
603
+ "type": "typography",
604
+ "content": "Provider Status",
605
+ "variant": "h2"
606
+ }
607
+ ]
313
608
  },
314
609
  {
315
610
  "type": "button",
316
- "label": "Auto Switch",
317
- "event": "SWITCH_AUTO",
611
+ "label": "Dismiss",
612
+ "event": "HIDE",
318
613
  "variant": "ghost",
319
- "icon": "zap"
614
+ "icon": "x"
320
615
  }
321
616
  ]
617
+ },
618
+ {
619
+ "type": "divider"
620
+ },
621
+ {
622
+ "type": "alert",
623
+ "variant": [
624
+ "object/get",
625
+ [
626
+ "array/first",
627
+ "@entity"
628
+ ],
629
+ "notificationType"
630
+ ],
631
+ "message": [
632
+ "object/get",
633
+ [
634
+ "array/first",
635
+ "@entity"
636
+ ],
637
+ "message"
638
+ ]
639
+ },
640
+ {
641
+ "type": "toast-slot",
642
+ "position": "top-right"
643
+ },
644
+ {
645
+ "type": "violation-alert",
646
+ "severity": "warning",
647
+ "message": [
648
+ "object/get",
649
+ [
650
+ "array/first",
651
+ "@entity"
652
+ ],
653
+ "message"
654
+ ],
655
+ "category": "compliance"
322
656
  }
323
657
  ]
324
658
  }
@@ -326,19 +660,184 @@
326
660
  ]
327
661
  },
328
662
  {
329
- "from": "active",
330
- "to": "switching",
331
- "event": "SWITCH_AUTO",
663
+ "from": "visible",
664
+ "to": "hidden",
665
+ "event": "HIDE",
666
+ "effects": [
667
+ [
668
+ "set",
669
+ "@entity.message",
670
+ ""
671
+ ]
672
+ ]
673
+ }
674
+ ]
675
+ }
676
+ },
677
+ {
678
+ "name": "AgentProviderAgent",
679
+ "linkedEntity": "AgentProvider",
680
+ "category": "interaction",
681
+ "emits": [
682
+ {
683
+ "event": "SHOW",
684
+ "scope": "internal",
685
+ "payload": [
686
+ {
687
+ "name": "provider",
688
+ "type": "string"
689
+ },
690
+ {
691
+ "name": "model",
692
+ "type": "string"
693
+ }
694
+ ]
695
+ }
696
+ ],
697
+ "listens": [
698
+ {
699
+ "event": "SWITCHED",
700
+ "triggers": "SWITCHED"
701
+ }
702
+ ],
703
+ "stateMachine": {
704
+ "states": [
705
+ {
706
+ "name": "idle",
707
+ "isInitial": true
708
+ },
709
+ {
710
+ "name": "active"
711
+ },
712
+ {
713
+ "name": "switching"
714
+ }
715
+ ],
716
+ "events": [
717
+ {
718
+ "key": "INIT",
719
+ "name": "Initialize"
720
+ },
721
+ {
722
+ "key": "DO_SWITCH",
723
+ "name": "Do Switch",
724
+ "payload": [
725
+ {
726
+ "name": "data",
727
+ "type": "object",
728
+ "required": true
729
+ }
730
+ ]
731
+ },
732
+ {
733
+ "key": "SWITCH_AUTO",
734
+ "name": "Auto Switch to Fallback"
735
+ },
736
+ {
737
+ "key": "SWITCHED",
738
+ "name": "Switched",
739
+ "payload": [
740
+ {
741
+ "name": "data",
742
+ "type": "object",
743
+ "required": true
744
+ }
745
+ ]
746
+ }
747
+ ],
748
+ "transitions": [
749
+ {
750
+ "from": "idle",
751
+ "to": "active",
752
+ "event": "INIT",
332
753
  "effects": [
754
+ [
755
+ "fetch",
756
+ "AgentProvider"
757
+ ],
758
+ [
759
+ "agent/provider"
760
+ ],
761
+ [
762
+ "agent/model"
763
+ ],
333
764
  [
334
765
  "render-ui",
335
766
  "main",
336
767
  {
337
- "type": "loading-state",
338
- "title": "Switching...",
339
- "message": "Switching provider..."
768
+ "type": "empty-state",
769
+ "icon": "repeat",
770
+ "title": "Provider",
771
+ "description": "Provider is ready"
340
772
  }
773
+ ]
774
+ ]
775
+ },
776
+ {
777
+ "from": "active",
778
+ "to": "switching",
779
+ "event": "DO_SWITCH",
780
+ "effects": [
781
+ [
782
+ "agent/switch-provider",
783
+ "@payload.data.currentProvider",
784
+ "@payload.data.currentModel"
341
785
  ],
786
+ [
787
+ "set",
788
+ "@entity.currentProvider",
789
+ "@payload.data.currentProvider"
790
+ ],
791
+ [
792
+ "set",
793
+ "@entity.currentModel",
794
+ "@payload.data.currentModel"
795
+ ]
796
+ ]
797
+ },
798
+ {
799
+ "from": "active",
800
+ "to": "switching",
801
+ "event": "SWITCHED",
802
+ "effects": [
803
+ [
804
+ "agent/switch-provider",
805
+ "@entity.currentProvider",
806
+ "@entity.currentModel"
807
+ ]
808
+ ]
809
+ },
810
+ {
811
+ "from": "switching",
812
+ "to": "active",
813
+ "event": "INIT",
814
+ "effects": [
815
+ [
816
+ "agent/provider"
817
+ ],
818
+ [
819
+ "agent/model"
820
+ ],
821
+ [
822
+ "set",
823
+ "@entity.requestCount",
824
+ [
825
+ "+",
826
+ "@entity.requestCount",
827
+ 1
828
+ ]
829
+ ],
830
+ [
831
+ "emit",
832
+ "SHOW"
833
+ ]
834
+ ]
835
+ },
836
+ {
837
+ "from": "active",
838
+ "to": "switching",
839
+ "event": "SWITCH_AUTO",
840
+ "effects": [
342
841
  [
343
842
  "agent/switch-provider",
344
843
  "@entity.fallbackProvider"
@@ -353,31 +852,22 @@
353
852
  {
354
853
  "from": "idle",
355
854
  "to": "switching",
356
- "event": "SWITCH",
855
+ "event": "DO_SWITCH",
357
856
  "effects": [
358
- [
359
- "render-ui",
360
- "main",
361
- {
362
- "type": "loading-state",
363
- "title": "Switching...",
364
- "message": "Switching provider..."
365
- }
366
- ],
367
857
  [
368
858
  "agent/switch-provider",
369
- "@payload.provider",
370
- "@payload.model"
859
+ "@payload.data.currentProvider",
860
+ "@payload.data.currentModel"
371
861
  ],
372
862
  [
373
863
  "set",
374
864
  "@entity.currentProvider",
375
- "@payload.provider"
865
+ "@payload.data.currentProvider"
376
866
  ],
377
867
  [
378
868
  "set",
379
869
  "@entity.currentModel",
380
- "@payload.model"
870
+ "@payload.data.currentModel"
381
871
  ]
382
872
  ]
383
873
  }
@@ -391,12 +881,18 @@
391
881
  "path": "/agentproviders",
392
882
  "traits": [
393
883
  {
394
- "ref": "AgentProviderRouter"
884
+ "ref": "AgentProviderModal"
885
+ },
886
+ {
887
+ "ref": "AgentProviderNotification"
888
+ },
889
+ {
890
+ "ref": "AgentProviderAgent"
395
891
  }
396
892
  ]
397
893
  }
398
894
  ]
399
895
  }
400
896
  ],
401
- "description": "Provider routing atom for agent model/provider switching. Manages current provider, model selection, and fallback routing. Uses agent/switch-provider, agent/provider, and agent/model operators."
897
+ "description": "Provider routing atom for agent model/provider switching. Composes UI atoms (stdModal for switch form, stdNotification for confirmation) with an agent trait that handles agent/switch-provider, agent/provider, and agent/model operators."
402
898
  }