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