@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,20 +53,28 @@
53
53
  },
54
54
  "traits": [
55
55
  {
56
- "name": "AgentSessionLifecycle",
56
+ "name": "AgentSessionBrowse",
57
57
  "linkedEntity": "AgentSession",
58
58
  "category": "interaction",
59
+ "listens": [
60
+ {
61
+ "event": "FORKED",
62
+ "triggers": "FORKED"
63
+ },
64
+ {
65
+ "event": "LABELED",
66
+ "triggers": "LABELED"
67
+ },
68
+ {
69
+ "event": "ENDED",
70
+ "triggers": "ENDED"
71
+ }
72
+ ],
59
73
  "stateMachine": {
60
74
  "states": [
61
75
  {
62
- "name": "active",
76
+ "name": "browsing",
63
77
  "isInitial": true
64
- },
65
- {
66
- "name": "forked"
67
- },
68
- {
69
- "name": "ended"
70
78
  }
71
79
  ],
72
80
  "events": [
@@ -76,42 +84,75 @@
76
84
  },
77
85
  {
78
86
  "key": "FORK",
79
- "name": "Fork Session"
87
+ "name": "FORK"
80
88
  },
81
89
  {
82
90
  "key": "LABEL",
83
- "name": "Label Session",
91
+ "name": "LABEL"
92
+ },
93
+ {
94
+ "key": "END",
95
+ "name": "END"
96
+ },
97
+ {
98
+ "key": "VIEW",
99
+ "name": "VIEW",
84
100
  "payload": [
85
101
  {
86
- "name": "label",
102
+ "name": "id",
87
103
  "type": "string",
88
104
  "required": true
105
+ },
106
+ {
107
+ "name": "row",
108
+ "type": "object"
89
109
  }
90
110
  ]
91
111
  },
92
112
  {
93
- "key": "END",
94
- "name": "End Session"
113
+ "key": "FORKED",
114
+ "name": "FORKED",
115
+ "payload": [
116
+ {
117
+ "name": "data",
118
+ "type": "object",
119
+ "required": true
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "key": "LABELED",
125
+ "name": "LABELED",
126
+ "payload": [
127
+ {
128
+ "name": "data",
129
+ "type": "object",
130
+ "required": true
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "key": "ENDED",
136
+ "name": "ENDED",
137
+ "payload": [
138
+ {
139
+ "name": "data",
140
+ "type": "object",
141
+ "required": true
142
+ }
143
+ ]
95
144
  }
96
145
  ],
97
146
  "transitions": [
98
147
  {
99
- "from": "active",
100
- "to": "active",
148
+ "from": "browsing",
149
+ "to": "browsing",
101
150
  "event": "INIT",
102
151
  "effects": [
103
152
  [
104
- "fetch",
153
+ "ref",
105
154
  "AgentSession"
106
155
  ],
107
- [
108
- "agent/session-id"
109
- ],
110
- [
111
- "set",
112
- "@entity.createdAt",
113
- "@now"
114
- ],
115
156
  [
116
157
  "render-ui",
117
158
  "main",
@@ -119,27 +160,60 @@
119
160
  "type": "stack",
120
161
  "direction": "vertical",
121
162
  "gap": "lg",
163
+ "className": "max-w-5xl mx-auto w-full",
122
164
  "children": [
123
165
  {
124
166
  "type": "stack",
125
167
  "direction": "horizontal",
126
- "gap": "sm",
168
+ "gap": "md",
169
+ "justify": "space-between",
127
170
  "align": "center",
128
171
  "children": [
129
172
  {
130
- "type": "icon",
131
- "name": "terminal",
132
- "size": "lg"
133
- },
134
- {
135
- "type": "typography",
136
- "content": "AgentSession",
137
- "variant": "h2"
138
- },
139
- {
140
- "type": "badge",
141
- "label": "Active",
142
- "variant": "success"
173
+ "type": "stack",
174
+ "direction": "horizontal",
175
+ "gap": "sm",
176
+ "align": "center",
177
+ "children": [
178
+ {
179
+ "type": "icon",
180
+ "name": "terminal",
181
+ "size": "lg"
182
+ },
183
+ {
184
+ "type": "typography",
185
+ "content": "AgentSession Manager",
186
+ "variant": "h2"
187
+ }
188
+ ]
189
+ },
190
+ {
191
+ "type": "stack",
192
+ "direction": "horizontal",
193
+ "gap": "sm",
194
+ "children": [
195
+ {
196
+ "type": "button",
197
+ "label": "Fork",
198
+ "event": "FORK",
199
+ "variant": "secondary",
200
+ "icon": "git-branch"
201
+ },
202
+ {
203
+ "type": "button",
204
+ "label": "Label",
205
+ "event": "LABEL",
206
+ "variant": "secondary",
207
+ "icon": "tag"
208
+ },
209
+ {
210
+ "type": "button",
211
+ "label": "End",
212
+ "event": "END",
213
+ "variant": "ghost",
214
+ "icon": "square"
215
+ }
216
+ ]
143
217
  }
144
218
  ]
145
219
  },
@@ -147,62 +221,49 @@
147
221
  "type": "divider"
148
222
  },
149
223
  {
150
- "type": "stack",
151
- "direction": "horizontal",
152
- "gap": "md",
153
- "children": [
154
- {
155
- "type": "typography",
156
- "variant": "caption",
157
- "content": "Session ID:"
158
- },
159
- {
160
- "type": "badge",
161
- "label": "@entity.sessionId"
162
- }
163
- ]
164
- },
165
- {
166
- "type": "stack",
167
- "direction": "horizontal",
168
- "gap": "md",
169
- "children": [
170
- {
171
- "type": "typography",
172
- "variant": "caption",
173
- "content": "Label:"
174
- },
175
- {
176
- "type": "badge",
177
- "label": "@entity.label"
224
+ "type": "data-grid",
225
+ "entity": "AgentSession",
226
+ "emptyIcon": "inbox",
227
+ "emptyTitle": "No sessions yet",
228
+ "emptyDescription": "Start a new session to begin.",
229
+ "itemActions": [
230
+ {
231
+ "label": "View",
232
+ "event": "VIEW",
233
+ "variant": "ghost",
234
+ "size": "sm"
178
235
  }
179
- ]
180
- },
181
- {
182
- "type": "stack",
183
- "direction": "horizontal",
184
- "gap": "sm",
185
- "children": [
186
- {
187
- "type": "button",
188
- "label": "Fork",
189
- "event": "FORK",
190
- "variant": "secondary",
191
- "icon": "git-branch"
192
- },
193
- {
194
- "type": "button",
236
+ ],
237
+ "columns": [
238
+ {
239
+ "name": "sessionId",
240
+ "label": "Session ID",
241
+ "variant": "h4",
242
+ "icon": "terminal"
243
+ },
244
+ {
245
+ "name": "status",
246
+ "label": "Status",
247
+ "variant": "badge",
248
+ "colorMap": {
249
+ "active": "success",
250
+ "completed": "success",
251
+ "done": "success",
252
+ "pending": "warning",
253
+ "draft": "warning",
254
+ "scheduled": "warning",
255
+ "inactive": "neutral",
256
+ "archived": "neutral",
257
+ "disabled": "neutral",
258
+ "error": "destructive",
259
+ "cancelled": "destructive",
260
+ "failed": "destructive"
261
+ }
262
+ },
263
+ {
264
+ "name": "label",
195
265
  "label": "Label",
196
- "event": "LABEL",
197
- "variant": "secondary",
198
- "icon": "tag"
199
- },
200
- {
201
- "type": "button",
202
- "label": "End",
203
- "event": "END",
204
- "variant": "destructive",
205
- "icon": "square"
266
+ "variant": "caption"
206
267
  }
207
268
  ]
208
269
  }
@@ -212,49 +273,128 @@
212
273
  ]
213
274
  },
214
275
  {
215
- "from": "active",
216
- "to": "forked",
217
- "event": "FORK",
276
+ "from": "browsing",
277
+ "to": "browsing",
278
+ "event": "FORKED",
218
279
  "effects": [
219
280
  [
220
- "set",
221
- "@entity.parentId",
222
- "@entity.sessionId"
223
- ],
281
+ "ref",
282
+ "AgentSession"
283
+ ]
284
+ ]
285
+ },
286
+ {
287
+ "from": "browsing",
288
+ "to": "browsing",
289
+ "event": "LABELED",
290
+ "effects": [
224
291
  [
225
- "agent/fork"
226
- ],
292
+ "ref",
293
+ "AgentSession"
294
+ ]
295
+ ]
296
+ },
297
+ {
298
+ "from": "browsing",
299
+ "to": "browsing",
300
+ "event": "ENDED",
301
+ "effects": [
227
302
  [
228
- "agent/session-id"
303
+ "ref",
304
+ "AgentSession"
305
+ ]
306
+ ]
307
+ }
308
+ ]
309
+ }
310
+ },
311
+ {
312
+ "name": "AgentSessionLabel",
313
+ "linkedEntity": "AgentSession",
314
+ "category": "interaction",
315
+ "emits": [
316
+ {
317
+ "event": "LABELED"
318
+ }
319
+ ],
320
+ "stateMachine": {
321
+ "states": [
322
+ {
323
+ "name": "closed",
324
+ "isInitial": true
325
+ },
326
+ {
327
+ "name": "open"
328
+ }
329
+ ],
330
+ "events": [
331
+ {
332
+ "key": "INIT",
333
+ "name": "Initialize"
334
+ },
335
+ {
336
+ "key": "LABEL",
337
+ "name": "Open"
338
+ },
339
+ {
340
+ "key": "CLOSE",
341
+ "name": "Close"
342
+ },
343
+ {
344
+ "key": "SAVE",
345
+ "name": "Save",
346
+ "payload": [
347
+ {
348
+ "name": "data",
349
+ "type": "object",
350
+ "required": true
351
+ }
352
+ ]
353
+ }
354
+ ],
355
+ "transitions": [
356
+ {
357
+ "from": "closed",
358
+ "to": "closed",
359
+ "event": "INIT",
360
+ "effects": [
361
+ [
362
+ "ref",
363
+ "AgentSession"
364
+ ]
365
+ ]
366
+ },
367
+ {
368
+ "from": "closed",
369
+ "to": "open",
370
+ "event": "LABEL",
371
+ "effects": [
372
+ [
373
+ "fetch",
374
+ "AgentSession"
229
375
  ],
230
376
  [
231
377
  "render-ui",
232
- "main",
378
+ "modal",
233
379
  {
234
380
  "type": "stack",
235
381
  "direction": "vertical",
236
- "gap": "lg",
382
+ "gap": "md",
237
383
  "children": [
238
384
  {
239
385
  "type": "stack",
240
386
  "direction": "horizontal",
241
387
  "gap": "sm",
242
- "align": "center",
243
388
  "children": [
244
389
  {
245
390
  "type": "icon",
246
- "name": "git-branch",
247
- "size": "lg"
391
+ "name": "tag",
392
+ "size": "md"
248
393
  },
249
394
  {
250
395
  "type": "typography",
251
- "content": "AgentSession (Forked)",
252
- "variant": "h2"
253
- },
254
- {
255
- "type": "badge",
256
- "label": "Forked",
257
- "variant": "info"
396
+ "content": "Label Session",
397
+ "variant": "h3"
258
398
  }
259
399
  ]
260
400
  },
@@ -274,44 +414,17 @@
274
414
  {
275
415
  "type": "badge",
276
416
  "label": "@entity.sessionId"
277
- },
278
- {
279
- "type": "typography",
280
- "variant": "caption",
281
- "content": "Parent:"
282
- },
283
- {
284
- "type": "badge",
285
- "label": "@entity.parentId"
286
417
  }
287
418
  ]
288
419
  },
289
420
  {
290
- "type": "stack",
291
- "direction": "horizontal",
292
- "gap": "sm",
293
- "children": [
294
- {
295
- "type": "button",
296
- "label": "Fork Again",
297
- "event": "FORK",
298
- "variant": "secondary",
299
- "icon": "git-branch"
300
- },
301
- {
302
- "type": "button",
303
- "label": "Label",
304
- "event": "LABEL",
305
- "variant": "secondary",
306
- "icon": "tag"
307
- },
308
- {
309
- "type": "button",
310
- "label": "End",
311
- "event": "END",
312
- "variant": "destructive",
313
- "icon": "square"
314
- }
421
+ "type": "form-section",
422
+ "entity": "AgentSession",
423
+ "mode": "edit",
424
+ "submitEvent": "SAVE",
425
+ "cancelEvent": "CLOSE",
426
+ "fields": [
427
+ "label"
315
428
  ]
316
429
  }
317
430
  ]
@@ -320,329 +433,312 @@
320
433
  ]
321
434
  },
322
435
  {
323
- "from": "forked",
324
- "to": "forked",
325
- "event": "FORK",
436
+ "from": "open",
437
+ "to": "closed",
438
+ "event": "CLOSE",
326
439
  "effects": [
327
440
  [
328
- "set",
329
- "@entity.parentId",
330
- "@entity.sessionId"
441
+ "render-ui",
442
+ "modal",
443
+ null
331
444
  ],
332
445
  [
333
- "agent/fork"
334
- ],
446
+ "notify",
447
+ "Cancelled",
448
+ "info"
449
+ ]
450
+ ]
451
+ },
452
+ {
453
+ "from": "open",
454
+ "to": "closed",
455
+ "event": "SAVE",
456
+ "effects": [
335
457
  [
336
- "agent/session-id"
458
+ "persist",
459
+ "update",
460
+ "AgentSession",
461
+ "@payload.data"
337
462
  ],
338
463
  [
339
464
  "render-ui",
340
- "main",
341
- {
342
- "type": "stack",
343
- "direction": "vertical",
344
- "gap": "lg",
345
- "children": [
346
- {
347
- "type": "stack",
348
- "direction": "horizontal",
349
- "gap": "sm",
350
- "align": "center",
351
- "children": [
352
- {
353
- "type": "icon",
354
- "name": "git-branch",
355
- "size": "lg"
356
- },
357
- {
358
- "type": "typography",
359
- "content": "AgentSession (Forked)",
360
- "variant": "h2"
361
- },
362
- {
363
- "type": "badge",
364
- "label": "Forked",
365
- "variant": "info"
366
- }
367
- ]
368
- },
369
- {
370
- "type": "divider"
371
- },
372
- {
373
- "type": "stack",
374
- "direction": "horizontal",
375
- "gap": "md",
376
- "children": [
377
- {
378
- "type": "typography",
379
- "variant": "caption",
380
- "content": "Session:"
381
- },
382
- {
383
- "type": "badge",
384
- "label": "@entity.sessionId"
385
- },
386
- {
387
- "type": "typography",
388
- "variant": "caption",
389
- "content": "Parent:"
390
- },
391
- {
392
- "type": "badge",
393
- "label": "@entity.parentId"
394
- }
395
- ]
396
- },
397
- {
398
- "type": "stack",
399
- "direction": "horizontal",
400
- "gap": "sm",
401
- "children": [
402
- {
403
- "type": "button",
404
- "label": "Fork Again",
405
- "event": "FORK",
406
- "variant": "secondary",
407
- "icon": "git-branch"
408
- },
409
- {
410
- "type": "button",
411
- "label": "Label",
412
- "event": "LABEL",
413
- "variant": "secondary",
414
- "icon": "tag"
415
- },
416
- {
417
- "type": "button",
418
- "label": "End",
419
- "event": "END",
420
- "variant": "destructive",
421
- "icon": "square"
422
- }
423
- ]
424
- }
425
- ]
426
- }
465
+ "modal",
466
+ null
467
+ ],
468
+ [
469
+ "emit",
470
+ "LABELED"
471
+ ],
472
+ [
473
+ "notify",
474
+ "AgentSession updated successfully"
427
475
  ]
428
476
  ]
477
+ }
478
+ ]
479
+ }
480
+ },
481
+ {
482
+ "name": "AgentSessionAgent",
483
+ "linkedEntity": "AgentSession",
484
+ "category": "interaction",
485
+ "emits": [
486
+ {
487
+ "event": "ENDED",
488
+ "scope": "external",
489
+ "payload": [
490
+ {
491
+ "name": "sessionId",
492
+ "type": "string"
493
+ }
494
+ ]
495
+ },
496
+ {
497
+ "event": "FORKED",
498
+ "scope": "external",
499
+ "payload": [
500
+ {
501
+ "name": "sessionId",
502
+ "type": "string"
503
+ }
504
+ ]
505
+ }
506
+ ],
507
+ "listens": [
508
+ {
509
+ "event": "ENDED",
510
+ "triggers": "INIT",
511
+ "scope": "external"
512
+ },
513
+ {
514
+ "event": "FORKED",
515
+ "triggers": "INIT",
516
+ "scope": "external"
517
+ }
518
+ ],
519
+ "stateMachine": {
520
+ "states": [
521
+ {
522
+ "name": "active",
523
+ "isInitial": true
524
+ },
525
+ {
526
+ "name": "forked"
527
+ },
528
+ {
529
+ "name": "ended"
530
+ }
531
+ ],
532
+ "events": [
533
+ {
534
+ "key": "INIT",
535
+ "name": "Initialize"
536
+ },
537
+ {
538
+ "key": "FORK",
539
+ "name": "Fork Session"
540
+ },
541
+ {
542
+ "key": "DO_LABEL",
543
+ "name": "Do Label",
544
+ "payload": [
545
+ {
546
+ "name": "data",
547
+ "type": "object",
548
+ "required": true
549
+ }
550
+ ]
551
+ },
552
+ {
553
+ "key": "END",
554
+ "name": "End Session"
555
+ },
556
+ {
557
+ "key": "LABELED",
558
+ "name": "Labeled",
559
+ "payload": [
560
+ {
561
+ "name": "data",
562
+ "type": "object",
563
+ "required": true
564
+ }
565
+ ]
429
566
  },
567
+ {
568
+ "key": "FORKED",
569
+ "name": "Forked",
570
+ "payload": [
571
+ {
572
+ "name": "data",
573
+ "type": "object",
574
+ "required": true
575
+ }
576
+ ]
577
+ }
578
+ ],
579
+ "transitions": [
430
580
  {
431
581
  "from": "active",
432
582
  "to": "active",
433
- "event": "LABEL",
583
+ "event": "INIT",
434
584
  "effects": [
435
585
  [
436
- "agent/label",
437
- "@payload.label"
586
+ "fetch",
587
+ "AgentSession"
588
+ ],
589
+ [
590
+ "agent/session-id"
438
591
  ],
439
592
  [
440
593
  "set",
441
- "@entity.label",
442
- "@payload.label"
594
+ "@entity.createdAt",
595
+ "@now"
443
596
  ],
444
597
  [
445
598
  "render-ui",
446
599
  "main",
447
600
  {
448
- "type": "stack",
449
- "direction": "vertical",
450
- "gap": "lg",
451
- "children": [
452
- {
453
- "type": "stack",
454
- "direction": "horizontal",
455
- "gap": "sm",
456
- "align": "center",
457
- "children": [
458
- {
459
- "type": "icon",
460
- "name": "terminal",
461
- "size": "lg"
462
- },
463
- {
464
- "type": "typography",
465
- "content": "AgentSession",
466
- "variant": "h2"
467
- },
468
- {
469
- "type": "badge",
470
- "label": "Active",
471
- "variant": "success"
472
- }
473
- ]
474
- },
475
- {
476
- "type": "divider"
477
- },
478
- {
479
- "type": "stack",
480
- "direction": "horizontal",
481
- "gap": "md",
482
- "children": [
483
- {
484
- "type": "typography",
485
- "variant": "caption",
486
- "content": "Session ID:"
487
- },
488
- {
489
- "type": "badge",
490
- "label": "@entity.sessionId"
491
- }
492
- ]
493
- },
494
- {
495
- "type": "stack",
496
- "direction": "horizontal",
497
- "gap": "md",
498
- "children": [
499
- {
500
- "type": "typography",
501
- "variant": "caption",
502
- "content": "Label:"
503
- },
504
- {
505
- "type": "badge",
506
- "label": "@entity.label"
507
- }
508
- ]
509
- },
510
- {
511
- "type": "stack",
512
- "direction": "horizontal",
513
- "gap": "sm",
514
- "children": [
515
- {
516
- "type": "button",
517
- "label": "Fork",
518
- "event": "FORK",
519
- "variant": "secondary",
520
- "icon": "git-branch"
521
- },
522
- {
523
- "type": "button",
524
- "label": "Label",
525
- "event": "LABEL",
526
- "variant": "secondary",
527
- "icon": "tag"
528
- },
529
- {
530
- "type": "button",
531
- "label": "End",
532
- "event": "END",
533
- "variant": "destructive",
534
- "icon": "square"
535
- }
536
- ]
537
- }
538
- ]
601
+ "type": "empty-state",
602
+ "icon": "git-branch",
603
+ "title": "Session",
604
+ "description": "Session is ready"
605
+ }
606
+ ]
607
+ ]
608
+ },
609
+ {
610
+ "from": "active",
611
+ "to": "forked",
612
+ "event": "FORK",
613
+ "effects": [
614
+ [
615
+ "set",
616
+ "@entity.parentId",
617
+ "@entity.sessionId"
618
+ ],
619
+ [
620
+ "agent/fork"
621
+ ],
622
+ [
623
+ "agent/session-id"
624
+ ],
625
+ [
626
+ "persist",
627
+ "create",
628
+ "AgentSession",
629
+ {
630
+ "sessionId": "@entity.sessionId",
631
+ "parentId": "@entity.parentId",
632
+ "status": "forked",
633
+ "createdAt": "@now"
539
634
  }
635
+ ],
636
+ [
637
+ "emit",
638
+ "FORKED"
639
+ ],
640
+ [
641
+ "notify",
642
+ "AgentSession created successfully"
540
643
  ]
541
644
  ]
542
645
  },
543
646
  {
544
647
  "from": "forked",
545
648
  "to": "forked",
546
- "event": "LABEL",
649
+ "event": "FORK",
650
+ "effects": [
651
+ [
652
+ "set",
653
+ "@entity.parentId",
654
+ "@entity.sessionId"
655
+ ],
656
+ [
657
+ "agent/fork"
658
+ ],
659
+ [
660
+ "agent/session-id"
661
+ ],
662
+ [
663
+ "persist",
664
+ "create",
665
+ "AgentSession",
666
+ {
667
+ "sessionId": "@entity.sessionId",
668
+ "parentId": "@entity.parentId",
669
+ "status": "forked",
670
+ "createdAt": "@now"
671
+ }
672
+ ],
673
+ [
674
+ "emit",
675
+ "FORKED"
676
+ ],
677
+ [
678
+ "notify",
679
+ "AgentSession created successfully"
680
+ ]
681
+ ]
682
+ },
683
+ {
684
+ "from": "active",
685
+ "to": "active",
686
+ "event": "DO_LABEL",
547
687
  "effects": [
548
688
  [
549
689
  "agent/label",
550
- "@payload.label"
690
+ "@payload.data.label"
551
691
  ],
552
692
  [
553
693
  "set",
554
694
  "@entity.label",
555
- "@payload.label"
695
+ "@payload.data.label"
696
+ ]
697
+ ]
698
+ },
699
+ {
700
+ "from": "forked",
701
+ "to": "forked",
702
+ "event": "DO_LABEL",
703
+ "effects": [
704
+ [
705
+ "agent/label",
706
+ "@payload.data.label"
556
707
  ],
557
708
  [
558
- "render-ui",
559
- "main",
560
- {
561
- "type": "stack",
562
- "direction": "vertical",
563
- "gap": "lg",
564
- "children": [
565
- {
566
- "type": "stack",
567
- "direction": "horizontal",
568
- "gap": "sm",
569
- "align": "center",
570
- "children": [
571
- {
572
- "type": "icon",
573
- "name": "git-branch",
574
- "size": "lg"
575
- },
576
- {
577
- "type": "typography",
578
- "content": "AgentSession (Forked)",
579
- "variant": "h2"
580
- },
581
- {
582
- "type": "badge",
583
- "label": "Forked",
584
- "variant": "info"
585
- }
586
- ]
587
- },
588
- {
589
- "type": "divider"
590
- },
591
- {
592
- "type": "stack",
593
- "direction": "horizontal",
594
- "gap": "md",
595
- "children": [
596
- {
597
- "type": "typography",
598
- "variant": "caption",
599
- "content": "Session:"
600
- },
601
- {
602
- "type": "badge",
603
- "label": "@entity.sessionId"
604
- },
605
- {
606
- "type": "typography",
607
- "variant": "caption",
608
- "content": "Parent:"
609
- },
610
- {
611
- "type": "badge",
612
- "label": "@entity.parentId"
613
- }
614
- ]
615
- },
616
- {
617
- "type": "stack",
618
- "direction": "horizontal",
619
- "gap": "sm",
620
- "children": [
621
- {
622
- "type": "button",
623
- "label": "Fork Again",
624
- "event": "FORK",
625
- "variant": "secondary",
626
- "icon": "git-branch"
627
- },
628
- {
629
- "type": "button",
630
- "label": "Label",
631
- "event": "LABEL",
632
- "variant": "secondary",
633
- "icon": "tag"
634
- },
635
- {
636
- "type": "button",
637
- "label": "End",
638
- "event": "END",
639
- "variant": "destructive",
640
- "icon": "square"
641
- }
642
- ]
643
- }
644
- ]
645
- }
709
+ "set",
710
+ "@entity.label",
711
+ "@payload.data.label"
712
+ ]
713
+ ]
714
+ },
715
+ {
716
+ "from": "active",
717
+ "to": "active",
718
+ "event": "LABELED",
719
+ "effects": [
720
+ [
721
+ "agent/label",
722
+ "@entity.label"
723
+ ],
724
+ [
725
+ "fetch",
726
+ "AgentSession"
727
+ ]
728
+ ]
729
+ },
730
+ {
731
+ "from": "forked",
732
+ "to": "forked",
733
+ "event": "LABELED",
734
+ "effects": [
735
+ [
736
+ "agent/label",
737
+ "@entity.label"
738
+ ],
739
+ [
740
+ "fetch",
741
+ "AgentSession"
646
742
  ]
647
743
  ]
648
744
  },
@@ -657,71 +753,8 @@
657
753
  "ended"
658
754
  ],
659
755
  [
660
- "render-ui",
661
- "main",
662
- {
663
- "type": "stack",
664
- "direction": "vertical",
665
- "gap": "lg",
666
- "children": [
667
- {
668
- "type": "stack",
669
- "direction": "horizontal",
670
- "gap": "sm",
671
- "align": "center",
672
- "children": [
673
- {
674
- "type": "icon",
675
- "name": "check-circle",
676
- "size": "lg"
677
- },
678
- {
679
- "type": "typography",
680
- "content": "AgentSession (Ended)",
681
- "variant": "h2"
682
- },
683
- {
684
- "type": "badge",
685
- "label": "Ended",
686
- "variant": "secondary"
687
- }
688
- ]
689
- },
690
- {
691
- "type": "divider"
692
- },
693
- {
694
- "type": "alert",
695
- "variant": "info",
696
- "message": "Session has ended."
697
- },
698
- {
699
- "type": "stack",
700
- "direction": "horizontal",
701
- "gap": "md",
702
- "children": [
703
- {
704
- "type": "typography",
705
- "variant": "caption",
706
- "content": "Session:"
707
- },
708
- {
709
- "type": "badge",
710
- "label": "@entity.sessionId"
711
- },
712
- {
713
- "type": "typography",
714
- "variant": "caption",
715
- "content": "Label:"
716
- },
717
- {
718
- "type": "badge",
719
- "label": "@entity.label"
720
- }
721
- ]
722
- }
723
- ]
724
- }
756
+ "emit",
757
+ "ENDED"
725
758
  ]
726
759
  ]
727
760
  },
@@ -735,71 +768,42 @@
735
768
  "@entity.status",
736
769
  "ended"
737
770
  ],
771
+ [
772
+ "emit",
773
+ "ENDED"
774
+ ]
775
+ ]
776
+ },
777
+ {
778
+ "from": "ended",
779
+ "to": "active",
780
+ "event": "INIT",
781
+ "effects": [
782
+ [
783
+ "fetch",
784
+ "AgentSession"
785
+ ],
786
+ [
787
+ "agent/session-id"
788
+ ],
789
+ [
790
+ "set",
791
+ "@entity.createdAt",
792
+ "@now"
793
+ ],
794
+ [
795
+ "set",
796
+ "@entity.status",
797
+ "active"
798
+ ],
738
799
  [
739
800
  "render-ui",
740
801
  "main",
741
802
  {
742
- "type": "stack",
743
- "direction": "vertical",
744
- "gap": "lg",
745
- "children": [
746
- {
747
- "type": "stack",
748
- "direction": "horizontal",
749
- "gap": "sm",
750
- "align": "center",
751
- "children": [
752
- {
753
- "type": "icon",
754
- "name": "check-circle",
755
- "size": "lg"
756
- },
757
- {
758
- "type": "typography",
759
- "content": "AgentSession (Ended)",
760
- "variant": "h2"
761
- },
762
- {
763
- "type": "badge",
764
- "label": "Ended",
765
- "variant": "secondary"
766
- }
767
- ]
768
- },
769
- {
770
- "type": "divider"
771
- },
772
- {
773
- "type": "alert",
774
- "variant": "info",
775
- "message": "Session has ended."
776
- },
777
- {
778
- "type": "stack",
779
- "direction": "horizontal",
780
- "gap": "md",
781
- "children": [
782
- {
783
- "type": "typography",
784
- "variant": "caption",
785
- "content": "Session:"
786
- },
787
- {
788
- "type": "badge",
789
- "label": "@entity.sessionId"
790
- },
791
- {
792
- "type": "typography",
793
- "variant": "caption",
794
- "content": "Label:"
795
- },
796
- {
797
- "type": "badge",
798
- "label": "@entity.label"
799
- }
800
- ]
801
- }
802
- ]
803
+ "type": "empty-state",
804
+ "icon": "git-branch",
805
+ "title": "Session",
806
+ "description": "Session is ready"
803
807
  }
804
808
  ]
805
809
  ]
@@ -814,12 +818,18 @@
814
818
  "path": "/agentsessions",
815
819
  "traits": [
816
820
  {
817
- "ref": "AgentSessionLifecycle"
821
+ "ref": "AgentSessionBrowse"
822
+ },
823
+ {
824
+ "ref": "AgentSessionLabel"
825
+ },
826
+ {
827
+ "ref": "AgentSessionAgent"
818
828
  }
819
829
  ]
820
830
  }
821
831
  ]
822
832
  }
823
833
  ],
824
- "description": "Session lifecycle atom for agent session management. Handles session creation, forking, labeling, and ending. Uses agent/fork, agent/label, and agent/session-id operators."
834
+ "description": "Session lifecycle atom for agent session management. Composes UI atoms (stdBrowse for session list, stdModal for fork label form) with an agent trait that handles agent/fork, agent/label, and agent/session-id."
825
835
  }