@almadar/std 16.247.0 → 16.248.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2899 @@
1
+ {
2
+ "description": "Generic instrument generator — GENERATE { subject, context } picks one learning instrument for a subject and writes its roster. It lists the installed behaviors under `scope` (optionally narrowed to the `instruments` allow-list), keeps those whose trait listens for ROSTER_LOADED (an instrument that takes its roster at runtime), asks the model to CHOOSE one, then to FILL a roster whose fields are exactly that instrument's ROSTER_LOADED payload; the tool loop checks the roster against those declared fields before it is accepted. GENERATED { behavior, mode, roster } carries the instrument, its mode (the behavior's name, the matchMode a lab router uses) and the roster as JSON, ready to send as that instrument's ROSTER_LOADED. It never writes a program: when no instrument in scope fits or the roster cannot be filled, it emits GENERATE_FAILED { error }. The instrument list is read once and kept for later requests.",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M4JBE604XJWN30RQWABGKDKF": {
6
+ "bakedName": "LearnGeneration",
7
+ "curName": "LearnGeneration",
8
+ "id": "ent_01M4JBE604XJWN30RQWABGKDKF",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01M4JBE6040H6CVGAYGRZ95FYN": {
14
+ "bakedName": "SOURCED",
15
+ "curName": "SOURCED",
16
+ "id": "evt_01M4JBE6040H6CVGAYGRZ95FYN",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
20
+ "renames": []
21
+ },
22
+ "evt_01M4JBE6043G8KFW2HSME7C7JA": {
23
+ "bakedName": "GENERATE",
24
+ "curName": "GENERATE",
25
+ "id": "evt_01M4JBE6043G8KFW2HSME7C7JA",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
29
+ "renames": []
30
+ },
31
+ "evt_01M4JBE6044J56RJC979A5PJJM": {
32
+ "bakedName": "ASSISTANT_REPLIED",
33
+ "curName": "ASSISTANT_REPLIED",
34
+ "id": "evt_01M4JBE6044J56RJC979A5PJJM",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
38
+ "renames": []
39
+ },
40
+ "evt_01M4JBE6047NQ480GFRJB12A0Y": {
41
+ "bakedName": "GENERATION_FAILED",
42
+ "curName": "GENERATION_FAILED",
43
+ "id": "evt_01M4JBE6047NQ480GFRJB12A0Y",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
47
+ "renames": []
48
+ },
49
+ "evt_01M4JBE6049R8YP7CHCE44RYEN": {
50
+ "bakedName": "GENERATED",
51
+ "curName": "GENERATED",
52
+ "id": "evt_01M4JBE6049R8YP7CHCE44RYEN",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
56
+ "renames": []
57
+ },
58
+ "evt_01M4JBE604BX6W2Y8WGAWP5R5E": {
59
+ "bakedName": "CHOOSE",
60
+ "curName": "CHOOSE",
61
+ "id": "evt_01M4JBE604BX6W2Y8WGAWP5R5E",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
65
+ "renames": []
66
+ },
67
+ "evt_01M4JBE604D103REAE11JPAVDB": {
68
+ "bakedName": "INSTRUMENTS_READY",
69
+ "curName": "INSTRUMENTS_READY",
70
+ "id": "evt_01M4JBE604D103REAE11JPAVDB",
71
+ "kind": "event",
72
+ "owner": "workspace",
73
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
74
+ "renames": []
75
+ },
76
+ "evt_01M4JBE604DXC4ME0YA0NFCWBS": {
77
+ "bakedName": "TOOLS_FAILED",
78
+ "curName": "TOOLS_FAILED",
79
+ "id": "evt_01M4JBE604DXC4ME0YA0NFCWBS",
80
+ "kind": "event",
81
+ "owner": "workspace",
82
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
83
+ "renames": []
84
+ },
85
+ "evt_01M4JBE604R220NCEP222PWBZG": {
86
+ "bakedName": "FILL",
87
+ "curName": "FILL",
88
+ "id": "evt_01M4JBE604R220NCEP222PWBZG",
89
+ "kind": "event",
90
+ "owner": "workspace",
91
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
92
+ "renames": []
93
+ },
94
+ "evt_01M4JBE604T8PX0HXGTNVE898A": {
95
+ "bakedName": "INIT",
96
+ "curName": "INIT",
97
+ "id": "evt_01M4JBE604T8PX0HXGTNVE898A",
98
+ "kind": "event",
99
+ "owner": "workspace",
100
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
101
+ "renames": []
102
+ },
103
+ "evt_01M4JBE604WP16PSZRN091TFHC": {
104
+ "bakedName": "CONVERSE",
105
+ "curName": "CONVERSE",
106
+ "id": "evt_01M4JBE604WP16PSZRN091TFHC",
107
+ "kind": "event",
108
+ "owner": "workspace",
109
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
110
+ "renames": []
111
+ },
112
+ "evt_01M4JBE604WT0ZP6HKSGTGRCXZ": {
113
+ "bakedName": "GENERATE_FAILED",
114
+ "curName": "GENERATE_FAILED",
115
+ "id": "evt_01M4JBE604WT0ZP6HKSGTGRCXZ",
116
+ "kind": "event",
117
+ "owner": "workspace",
118
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
119
+ "renames": []
120
+ },
121
+ "evt_01M4JBE604X8P5DSPKEY4GKKXK": {
122
+ "bakedName": "CATALOG_LISTED",
123
+ "curName": "CATALOG_LISTED",
124
+ "id": "evt_01M4JBE604X8P5DSPKEY4GKKXK",
125
+ "kind": "event",
126
+ "owner": "workspace",
127
+ "parent": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
128
+ "renames": []
129
+ },
130
+ "orb_01M4JBE60409W9ZHK3BTTCWGJ0": {
131
+ "bakedName": "LearnGenerateOrbital",
132
+ "curName": "LearnGenerateOrbital",
133
+ "id": "orb_01M4JBE60409W9ZHK3BTTCWGJ0",
134
+ "kind": "orbital",
135
+ "owner": "workspace",
136
+ "renames": []
137
+ },
138
+ "pag_01M4JBE604NVQYCKRZN1MY4F7M": {
139
+ "bakedName": "LearnGeneratePage",
140
+ "curName": "LearnGeneratePage",
141
+ "id": "pag_01M4JBE604NVQYCKRZN1MY4F7M",
142
+ "kind": "page",
143
+ "owner": "workspace",
144
+ "renames": []
145
+ },
146
+ "trt_01M4JBE604NMD4CTP40PEXPESH": {
147
+ "bakedName": "LearnGenerateTools",
148
+ "curName": "LearnGenerateTools",
149
+ "id": "trt_01M4JBE604NMD4CTP40PEXPESH",
150
+ "kind": "trait",
151
+ "owner": "workspace",
152
+ "renames": []
153
+ },
154
+ "trt_01M4JBE604ZV89ABSAFKYSR9P9": {
155
+ "bakedName": "LearnGenerate",
156
+ "curName": "LearnGenerate",
157
+ "id": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
158
+ "kind": "trait",
159
+ "owner": "workspace",
160
+ "renames": []
161
+ }
162
+ },
163
+ "schemaVersion": 1
164
+ },
165
+ "name": "std-learn-generate",
166
+ "orbitals": [
167
+ {
168
+ "entity": {
169
+ "fields": [
170
+ {
171
+ "name": "id",
172
+ "required": true,
173
+ "type": "string"
174
+ },
175
+ {
176
+ "default": "",
177
+ "name": "subject",
178
+ "type": "string"
179
+ },
180
+ {
181
+ "default": "",
182
+ "name": "context",
183
+ "type": "string"
184
+ },
185
+ {
186
+ "default": [],
187
+ "items": {
188
+ "properties": {
189
+ "behavior": {
190
+ "name": "behavior",
191
+ "required": true,
192
+ "type": "string"
193
+ },
194
+ "description": {
195
+ "name": "description",
196
+ "required": false,
197
+ "type": "string"
198
+ },
199
+ "traits": {
200
+ "items": {
201
+ "type": "trait"
202
+ },
203
+ "name": "traits",
204
+ "required": true,
205
+ "type": "array"
206
+ },
207
+ "vectors": {
208
+ "items": {
209
+ "items": {
210
+ "type": "number"
211
+ },
212
+ "type": "array"
213
+ },
214
+ "name": "vectors",
215
+ "required": false,
216
+ "type": "object"
217
+ }
218
+ },
219
+ "type": "object"
220
+ },
221
+ "name": "candidates",
222
+ "type": "array"
223
+ },
224
+ {
225
+ "default": [],
226
+ "items": {
227
+ "properties": {
228
+ "behavior": {
229
+ "name": "behavior",
230
+ "required": true,
231
+ "type": "string"
232
+ },
233
+ "description": {
234
+ "name": "description",
235
+ "required": false,
236
+ "type": "string"
237
+ },
238
+ "fields": {
239
+ "items": {
240
+ "properties": {
241
+ "description": {
242
+ "name": "description",
243
+ "required": false,
244
+ "type": "string"
245
+ },
246
+ "name": {
247
+ "name": "name",
248
+ "required": true,
249
+ "type": "string"
250
+ },
251
+ "properties": {
252
+ "items": {
253
+ "type": "union",
254
+ "values": [
255
+ "AgentToolField"
256
+ ]
257
+ },
258
+ "name": "properties",
259
+ "required": false,
260
+ "type": "array"
261
+ },
262
+ "required": {
263
+ "name": "required",
264
+ "required": false,
265
+ "type": "boolean"
266
+ },
267
+ "type": {
268
+ "name": "type",
269
+ "required": true,
270
+ "type": "string"
271
+ },
272
+ "values": {
273
+ "items": {
274
+ "type": "string"
275
+ },
276
+ "name": "values",
277
+ "required": false,
278
+ "type": "array"
279
+ }
280
+ },
281
+ "type": "object"
282
+ },
283
+ "name": "fields",
284
+ "required": true,
285
+ "type": "array"
286
+ }
287
+ },
288
+ "type": "object"
289
+ },
290
+ "name": "instruments",
291
+ "type": "array"
292
+ },
293
+ {
294
+ "default": 0.0,
295
+ "name": "cursor",
296
+ "type": "number"
297
+ },
298
+ {
299
+ "default": "",
300
+ "name": "chosen",
301
+ "type": "string"
302
+ },
303
+ {
304
+ "default": "",
305
+ "name": "roster",
306
+ "type": "string"
307
+ },
308
+ {
309
+ "default": "",
310
+ "name": "error",
311
+ "type": "string"
312
+ },
313
+ {
314
+ "default": "idle",
315
+ "name": "status",
316
+ "type": "string",
317
+ "values": [
318
+ "idle",
319
+ "listing",
320
+ "sourcing",
321
+ "choosing",
322
+ "filling",
323
+ "done",
324
+ "failed"
325
+ ]
326
+ }
327
+ ],
328
+ "id": "ent_01M4JBE604XJWN30RQWABGKDKF",
329
+ "name": "LearnGeneration",
330
+ "persistence": "runtime"
331
+ },
332
+ "id": "orb_01M4JBE60409W9ZHK3BTTCWGJ0",
333
+ "name": "LearnGenerateOrbital",
334
+ "pages": [
335
+ {
336
+ "id": "pag_01M4JBE604NVQYCKRZN1MY4F7M",
337
+ "name": "LearnGeneratePage",
338
+ "path": "/learn-generate",
339
+ "traits": [
340
+ {
341
+ "ref": "LearnGenerate",
342
+ "refId": "trt_01M4JBE604ZV89ABSAFKYSR9P9"
343
+ },
344
+ {
345
+ "ref": "LearnGenerateTools",
346
+ "refId": "trt_01M4JBE604NMD4CTP40PEXPESH"
347
+ }
348
+ ]
349
+ }
350
+ ],
351
+ "traits": [
352
+ {
353
+ "category": "lifecycle",
354
+ "config": {
355
+ "chooseEvent": {
356
+ "default": "LearnGenerate.CHOOSE",
357
+ "description": "The address the model's CHOOSE tool fires; a consumer that renames this trait sets it to its own name (`VizGen.CHOOSE`)",
358
+ "label": "Choose tool event",
359
+ "tier": "internal",
360
+ "type": "EventAddress"
361
+ },
362
+ "fillEvent": {
363
+ "default": "LearnGenerate.FILL",
364
+ "description": "The address the model's FILL tool fires; a consumer that renames this trait sets it to its own name (`VizGen.FILL`)",
365
+ "label": "Fill tool event",
366
+ "tier": "internal",
367
+ "type": "EventAddress"
368
+ },
369
+ "instruments": {
370
+ "default": [],
371
+ "description": "Behavior names (`almadar-std/std-learn-predict`) to choose among; empty offers every instrument in the folders",
372
+ "items": {
373
+ "type": "string"
374
+ },
375
+ "label": "Allowed instruments",
376
+ "synonyms": "allow list, instrument list",
377
+ "tier": "domain",
378
+ "type": "[string]"
379
+ },
380
+ "scope": {
381
+ "default": [
382
+ "almadar-std/ui/learning"
383
+ ],
384
+ "description": "Registry folders (`<prefix>/<topic>[/<tier>]`) the generator may draw instruments from; nothing outside them is ever offered",
385
+ "items": {
386
+ "type": "string"
387
+ },
388
+ "label": "Behavior folders",
389
+ "synonyms": "scope, catalog, folders",
390
+ "tier": "domain",
391
+ "type": "[string]"
392
+ },
393
+ "statusSlot": {
394
+ "default": "main",
395
+ "description": "Where the atom shows its one-line status; a page running it in the background sends it to `system`",
396
+ "label": "Status slot",
397
+ "synonyms": "status area, slot",
398
+ "tier": "presentation",
399
+ "type": "slot"
400
+ }
401
+ },
402
+ "effectRow": [
403
+ {
404
+ "kind": "behavior/catalog"
405
+ },
406
+ {
407
+ "kind": "behavior/source"
408
+ },
409
+ {
410
+ "kind": "emit",
411
+ "resource": "CONVERSE"
412
+ },
413
+ {
414
+ "kind": "emit",
415
+ "resource": "GENERATED"
416
+ },
417
+ {
418
+ "kind": "emit",
419
+ "resource": "GENERATE_FAILED"
420
+ },
421
+ {
422
+ "kind": "emit",
423
+ "resource": "GENERATION_FAILED"
424
+ },
425
+ {
426
+ "kind": "emit",
427
+ "resource": "INSTRUMENTS_READY"
428
+ },
429
+ {
430
+ "kind": "render-ui",
431
+ "resolved": false,
432
+ "resource": "@config.statusSlot"
433
+ },
434
+ {
435
+ "kind": "set",
436
+ "resource": "@entity.candidates"
437
+ },
438
+ {
439
+ "kind": "set",
440
+ "resource": "@entity.chosen"
441
+ },
442
+ {
443
+ "kind": "set",
444
+ "resource": "@entity.context"
445
+ },
446
+ {
447
+ "kind": "set",
448
+ "resource": "@entity.cursor"
449
+ },
450
+ {
451
+ "kind": "set",
452
+ "resource": "@entity.error"
453
+ },
454
+ {
455
+ "kind": "set",
456
+ "resource": "@entity.instruments"
457
+ },
458
+ {
459
+ "kind": "set",
460
+ "resource": "@entity.roster"
461
+ },
462
+ {
463
+ "kind": "set",
464
+ "resource": "@entity.status"
465
+ },
466
+ {
467
+ "kind": "set",
468
+ "resource": "@entity.subject"
469
+ }
470
+ ],
471
+ "emits": [
472
+ {
473
+ "description": "The chosen instrument, its mode (the behavior's name) and its roster as JSON, ready to send as that instrument's ROSTER_LOADED",
474
+ "event": "GENERATED",
475
+ "eventId": "evt_01M4JBE6049R8YP7CHCE44RYEN",
476
+ "payloadSchema": [
477
+ {
478
+ "name": "behavior",
479
+ "required": true,
480
+ "type": "string"
481
+ },
482
+ {
483
+ "name": "mode",
484
+ "required": true,
485
+ "type": "string"
486
+ },
487
+ {
488
+ "name": "roster",
489
+ "required": true,
490
+ "type": "string"
491
+ }
492
+ ],
493
+ "scope": "external"
494
+ },
495
+ {
496
+ "description": "No instrument could be generated for the subject; nothing is shown",
497
+ "event": "GENERATION_FAILED",
498
+ "eventId": "evt_01M4JBE6047NQ480GFRJB12A0Y",
499
+ "payloadSchema": [
500
+ {
501
+ "name": "error",
502
+ "required": true,
503
+ "type": "string"
504
+ }
505
+ ],
506
+ "scope": "external"
507
+ },
508
+ {
509
+ "event": "CONVERSE",
510
+ "eventId": "evt_01M4JBE604WP16PSZRN091TFHC",
511
+ "payloadSchema": [
512
+ {
513
+ "entity": "AgentChatMessage",
514
+ "name": "messages",
515
+ "properties": [
516
+ {
517
+ "name": "role",
518
+ "type": "string",
519
+ "values": [
520
+ "user",
521
+ "assistant"
522
+ ]
523
+ },
524
+ {
525
+ "name": "content",
526
+ "required": true,
527
+ "type": "string"
528
+ }
529
+ ],
530
+ "required": true,
531
+ "type": "[object]"
532
+ },
533
+ {
534
+ "name": "instructions",
535
+ "type": "string"
536
+ },
537
+ {
538
+ "entity": "AgentToolInput",
539
+ "name": "tools",
540
+ "properties": [
541
+ {
542
+ "name": "event",
543
+ "required": true,
544
+ "type": "EventAddress"
545
+ },
546
+ {
547
+ "name": "payload",
548
+ "properties": [
549
+ {
550
+ "name": "name",
551
+ "required": true,
552
+ "type": "string"
553
+ },
554
+ {
555
+ "name": "type",
556
+ "required": true,
557
+ "type": "string"
558
+ },
559
+ {
560
+ "name": "required",
561
+ "type": "boolean"
562
+ },
563
+ {
564
+ "name": "values",
565
+ "type": "[string]"
566
+ },
567
+ {
568
+ "name": "properties",
569
+ "properties": [],
570
+ "type": "[AgentToolField]"
571
+ },
572
+ {
573
+ "name": "description",
574
+ "type": "string"
575
+ }
576
+ ],
577
+ "type": "[object]"
578
+ }
579
+ ],
580
+ "type": "[object]"
581
+ },
582
+ {
583
+ "name": "ephemeral",
584
+ "type": "boolean"
585
+ }
586
+ ]
587
+ },
588
+ {
589
+ "event": "CATALOG_LISTED",
590
+ "eventId": "evt_01M4JBE604X8P5DSPKEY4GKKXK",
591
+ "payloadSchema": [
592
+ {
593
+ "entity": "CatalogHit",
594
+ "name": "result",
595
+ "properties": [
596
+ {
597
+ "name": "behavior",
598
+ "required": true,
599
+ "type": "string"
600
+ },
601
+ {
602
+ "name": "description",
603
+ "type": "string"
604
+ },
605
+ {
606
+ "name": "traits",
607
+ "required": true,
608
+ "type": "[trait]"
609
+ },
610
+ {
611
+ "name": "vectors",
612
+ "type": "Map<string,[number]>"
613
+ }
614
+ ],
615
+ "required": true,
616
+ "type": "[object]"
617
+ }
618
+ ]
619
+ },
620
+ {
621
+ "event": "SOURCED",
622
+ "eventId": "evt_01M4JBE6040H6CVGAYGRZ95FYN",
623
+ "payloadSchema": [
624
+ {
625
+ "name": "result",
626
+ "required": true,
627
+ "type": "SExpr"
628
+ }
629
+ ]
630
+ },
631
+ {
632
+ "event": "INSTRUMENTS_READY",
633
+ "eventId": "evt_01M4JBE604D103REAE11JPAVDB"
634
+ },
635
+ {
636
+ "event": "GENERATE_FAILED",
637
+ "eventId": "evt_01M4JBE604WT0ZP6HKSGTGRCXZ",
638
+ "payloadSchema": [
639
+ {
640
+ "name": "error",
641
+ "required": true,
642
+ "type": "string"
643
+ }
644
+ ]
645
+ }
646
+ ],
647
+ "entityRefIds": {
648
+ "LearnGeneration": "ent_01M4JBE604XJWN30RQWABGKDKF"
649
+ },
650
+ "id": "trt_01M4JBE604ZV89ABSAFKYSR9P9",
651
+ "linkedEntity": "LearnGeneration",
652
+ "linkedEntityId": "ent_01M4JBE604XJWN30RQWABGKDKF",
653
+ "listens": [
654
+ {
655
+ "event": "ASSISTANT_REPLIED",
656
+ "eventId": "evt_01M4JBE6044J56RJC979A5PJJM",
657
+ "source": {
658
+ "kind": "trait",
659
+ "trait": "LearnGenerateTools",
660
+ "traitId": "trt_01M4JBE604NMD4CTP40PEXPESH"
661
+ },
662
+ "triggers": "ASSISTANT_REPLIED",
663
+ "triggersId": "evt_01M4JBE6044J56RJC979A5PJJM"
664
+ },
665
+ {
666
+ "event": "ASSISTANT_REPLY_FAILED",
667
+ "source": {
668
+ "kind": "trait",
669
+ "trait": "LearnGenerateTools",
670
+ "traitId": "trt_01M4JBE604NMD4CTP40PEXPESH"
671
+ },
672
+ "triggers": "TOOLS_FAILED",
673
+ "triggersId": "evt_01M4JBE604DXC4ME0YA0NFCWBS"
674
+ }
675
+ ],
676
+ "name": "LearnGenerate",
677
+ "scope": "instance",
678
+ "stateMachine": {
679
+ "events": [
680
+ {
681
+ "id": "evt_01M4JBE604T8PX0HXGTNVE898A",
682
+ "key": "INIT",
683
+ "name": "Initialize"
684
+ },
685
+ {
686
+ "external": true,
687
+ "id": "evt_01M4JBE604BX6W2Y8WGAWP5R5E",
688
+ "key": "CHOOSE",
689
+ "name": "Choose",
690
+ "payloadSchema": [
691
+ {
692
+ "name": "choice",
693
+ "required": true,
694
+ "type": "string"
695
+ }
696
+ ]
697
+ },
698
+ {
699
+ "external": true,
700
+ "id": "evt_01M4JBE604R220NCEP222PWBZG",
701
+ "key": "FILL",
702
+ "name": "Fill",
703
+ "payloadSchema": [
704
+ {
705
+ "name": "roster",
706
+ "required": true,
707
+ "type": "SExpr"
708
+ }
709
+ ]
710
+ },
711
+ {
712
+ "description": "Generate an instrument and roster for this subject; `context` is any extra the model should know (the lesson's wording, what to visualise)",
713
+ "external": true,
714
+ "id": "evt_01M4JBE6043G8KFW2HSME7C7JA",
715
+ "key": "GENERATE",
716
+ "name": "Generate",
717
+ "payloadSchema": [
718
+ {
719
+ "name": "subject",
720
+ "required": true,
721
+ "type": "string"
722
+ },
723
+ {
724
+ "name": "context",
725
+ "type": "string"
726
+ }
727
+ ],
728
+ "synonyms": "visualise, make an instrument, generate"
729
+ },
730
+ {
731
+ "id": "evt_01M4JBE604X8P5DSPKEY4GKKXK",
732
+ "key": "CATALOG_LISTED",
733
+ "name": "Catalog Listed",
734
+ "payloadSchema": [
735
+ {
736
+ "entity": "CatalogHit",
737
+ "name": "result",
738
+ "properties": [
739
+ {
740
+ "name": "behavior",
741
+ "required": true,
742
+ "type": "string"
743
+ },
744
+ {
745
+ "name": "description",
746
+ "type": "string"
747
+ },
748
+ {
749
+ "name": "traits",
750
+ "required": true,
751
+ "type": "[trait]"
752
+ },
753
+ {
754
+ "name": "vectors",
755
+ "type": "Map<string,[number]>"
756
+ }
757
+ ],
758
+ "required": true,
759
+ "type": "[object]"
760
+ }
761
+ ]
762
+ },
763
+ {
764
+ "id": "evt_01M4JBE604WT0ZP6HKSGTGRCXZ",
765
+ "key": "GENERATE_FAILED",
766
+ "name": "Generate Failed",
767
+ "payloadSchema": [
768
+ {
769
+ "name": "error",
770
+ "required": true,
771
+ "type": "string"
772
+ }
773
+ ]
774
+ },
775
+ {
776
+ "id": "evt_01M4JBE6040H6CVGAYGRZ95FYN",
777
+ "key": "SOURCED",
778
+ "name": "Sourced",
779
+ "payloadSchema": [
780
+ {
781
+ "name": "result",
782
+ "required": true,
783
+ "type": "SExpr"
784
+ }
785
+ ]
786
+ },
787
+ {
788
+ "id": "evt_01M4JBE604D103REAE11JPAVDB",
789
+ "key": "INSTRUMENTS_READY",
790
+ "name": "Instruments Ready"
791
+ },
792
+ {
793
+ "id": "evt_01M4JBE6044J56RJC979A5PJJM",
794
+ "key": "ASSISTANT_REPLIED",
795
+ "name": "Assistant Replied"
796
+ },
797
+ {
798
+ "id": "evt_01M4JBE604DXC4ME0YA0NFCWBS",
799
+ "key": "TOOLS_FAILED",
800
+ "name": "Tools Failed",
801
+ "payloadSchema": [
802
+ {
803
+ "name": "error",
804
+ "required": true,
805
+ "type": "string"
806
+ }
807
+ ]
808
+ },
809
+ {
810
+ "description": "The chosen instrument, its mode (the behavior's name) and its roster as JSON, ready to send as that instrument's ROSTER_LOADED",
811
+ "id": "evt_01M4JBE6049R8YP7CHCE44RYEN",
812
+ "key": "GENERATED",
813
+ "name": "Generated",
814
+ "payloadSchema": [
815
+ {
816
+ "name": "behavior",
817
+ "required": true,
818
+ "type": "string"
819
+ },
820
+ {
821
+ "name": "mode",
822
+ "required": true,
823
+ "type": "string"
824
+ },
825
+ {
826
+ "name": "roster",
827
+ "required": true,
828
+ "type": "string"
829
+ }
830
+ ]
831
+ },
832
+ {
833
+ "description": "No instrument could be generated for the subject; nothing is shown",
834
+ "id": "evt_01M4JBE6047NQ480GFRJB12A0Y",
835
+ "key": "GENERATION_FAILED",
836
+ "name": "Generation Failed",
837
+ "payloadSchema": [
838
+ {
839
+ "name": "error",
840
+ "required": true,
841
+ "type": "string"
842
+ }
843
+ ]
844
+ },
845
+ {
846
+ "id": "evt_01M4JBE604WP16PSZRN091TFHC",
847
+ "key": "CONVERSE",
848
+ "name": "Converse",
849
+ "payloadSchema": [
850
+ {
851
+ "entity": "AgentChatMessage",
852
+ "name": "messages",
853
+ "properties": [
854
+ {
855
+ "name": "role",
856
+ "type": "string",
857
+ "values": [
858
+ "user",
859
+ "assistant"
860
+ ]
861
+ },
862
+ {
863
+ "name": "content",
864
+ "required": true,
865
+ "type": "string"
866
+ }
867
+ ],
868
+ "required": true,
869
+ "type": "[object]"
870
+ },
871
+ {
872
+ "name": "instructions",
873
+ "type": "string"
874
+ },
875
+ {
876
+ "entity": "AgentToolInput",
877
+ "name": "tools",
878
+ "properties": [
879
+ {
880
+ "name": "event",
881
+ "required": true,
882
+ "type": "EventAddress"
883
+ },
884
+ {
885
+ "name": "payload",
886
+ "properties": [
887
+ {
888
+ "name": "name",
889
+ "required": true,
890
+ "type": "string"
891
+ },
892
+ {
893
+ "name": "type",
894
+ "required": true,
895
+ "type": "string"
896
+ },
897
+ {
898
+ "name": "required",
899
+ "type": "boolean"
900
+ },
901
+ {
902
+ "name": "values",
903
+ "type": "[string]"
904
+ },
905
+ {
906
+ "name": "properties",
907
+ "properties": [],
908
+ "type": "[AgentToolField]"
909
+ },
910
+ {
911
+ "name": "description",
912
+ "type": "string"
913
+ }
914
+ ],
915
+ "type": "[object]"
916
+ }
917
+ ],
918
+ "type": "[object]"
919
+ },
920
+ {
921
+ "name": "ephemeral",
922
+ "type": "boolean"
923
+ }
924
+ ]
925
+ }
926
+ ],
927
+ "states": [
928
+ {
929
+ "isInitial": true,
930
+ "name": "idle"
931
+ },
932
+ {
933
+ "name": "listing"
934
+ },
935
+ {
936
+ "name": "sourcing"
937
+ },
938
+ {
939
+ "name": "choosing"
940
+ },
941
+ {
942
+ "name": "filling"
943
+ },
944
+ {
945
+ "name": "done"
946
+ },
947
+ {
948
+ "name": "failed"
949
+ }
950
+ ],
951
+ "transitions": [
952
+ {
953
+ "effects": [
954
+ [
955
+ "set",
956
+ "@entity.status",
957
+ "idle"
958
+ ]
959
+ ],
960
+ "event": "INIT",
961
+ "eventId": "evt_01M4JBE604T8PX0HXGTNVE898A",
962
+ "from": "idle",
963
+ "to": "idle"
964
+ },
965
+ {
966
+ "event": "CHOOSE",
967
+ "eventId": "evt_01M4JBE604BX6W2Y8WGAWP5R5E",
968
+ "from": "idle",
969
+ "to": "idle"
970
+ },
971
+ {
972
+ "event": "FILL",
973
+ "eventId": "evt_01M4JBE604R220NCEP222PWBZG",
974
+ "from": "idle",
975
+ "to": "idle"
976
+ },
977
+ {
978
+ "effects": [
979
+ [
980
+ "set",
981
+ "@entity.subject",
982
+ "@payload.subject"
983
+ ],
984
+ [
985
+ "set",
986
+ "@entity.context",
987
+ [
988
+ "object/get",
989
+ "@payload",
990
+ "context",
991
+ ""
992
+ ]
993
+ ],
994
+ [
995
+ "set",
996
+ "@entity.chosen",
997
+ ""
998
+ ],
999
+ [
1000
+ "set",
1001
+ "@entity.roster",
1002
+ ""
1003
+ ],
1004
+ [
1005
+ "set",
1006
+ "@entity.error",
1007
+ ""
1008
+ ],
1009
+ [
1010
+ "set",
1011
+ "@entity.status",
1012
+ "listing"
1013
+ ],
1014
+ [
1015
+ "render-ui",
1016
+ "@config.statusSlot",
1017
+ {
1018
+ "content": "Finding an instrument…",
1019
+ "role": "status",
1020
+ "type": "typography",
1021
+ "variant": "caption"
1022
+ }
1023
+ ],
1024
+ [
1025
+ "behavior/catalog",
1026
+ {
1027
+ "paths": "@config.scope"
1028
+ },
1029
+ {
1030
+ "emit": {
1031
+ "failure": "GENERATE_FAILED",
1032
+ "success": "CATALOG_LISTED"
1033
+ }
1034
+ }
1035
+ ]
1036
+ ],
1037
+ "event": "GENERATE",
1038
+ "eventId": "evt_01M4JBE6043G8KFW2HSME7C7JA",
1039
+ "from": "idle",
1040
+ "guard": [
1041
+ "=",
1042
+ [
1043
+ "array/len",
1044
+ "@entity.instruments"
1045
+ ],
1046
+ 0.0
1047
+ ],
1048
+ "to": "listing"
1049
+ },
1050
+ {
1051
+ "effects": [
1052
+ [
1053
+ "set",
1054
+ "@entity.subject",
1055
+ "@payload.subject"
1056
+ ],
1057
+ [
1058
+ "set",
1059
+ "@entity.context",
1060
+ [
1061
+ "object/get",
1062
+ "@payload",
1063
+ "context",
1064
+ ""
1065
+ ]
1066
+ ],
1067
+ [
1068
+ "set",
1069
+ "@entity.chosen",
1070
+ ""
1071
+ ],
1072
+ [
1073
+ "set",
1074
+ "@entity.roster",
1075
+ ""
1076
+ ],
1077
+ [
1078
+ "set",
1079
+ "@entity.error",
1080
+ ""
1081
+ ],
1082
+ [
1083
+ "set",
1084
+ "@entity.status",
1085
+ "choosing"
1086
+ ],
1087
+ [
1088
+ "render-ui",
1089
+ "@config.statusSlot",
1090
+ {
1091
+ "content": "Choosing an instrument…",
1092
+ "role": "status",
1093
+ "type": "typography",
1094
+ "variant": "caption"
1095
+ }
1096
+ ],
1097
+ [
1098
+ "emit",
1099
+ "CONVERSE",
1100
+ {
1101
+ "ephemeral": true,
1102
+ "instructions": [
1103
+ "str/concat",
1104
+ "You pick the one interactive learning instrument that best lets a learner explore the subject. The installed instruments:\n",
1105
+ [
1106
+ "str/join",
1107
+ [
1108
+ "array/map",
1109
+ "@entity.instruments",
1110
+ [
1111
+ "fn",
1112
+ "i",
1113
+ [
1114
+ "str/concat",
1115
+ "- ",
1116
+ [
1117
+ "object/get",
1118
+ "@i",
1119
+ "behavior"
1120
+ ],
1121
+ ": ",
1122
+ [
1123
+ "object/get",
1124
+ "@i",
1125
+ "description",
1126
+ ""
1127
+ ]
1128
+ ]
1129
+ ]
1130
+ ],
1131
+ "\n"
1132
+ ],
1133
+ "\nCall the CHOOSE tool once with exactly one of them, then reply with one sentence."
1134
+ ],
1135
+ "messages": [
1136
+ {
1137
+ "content": [
1138
+ "str/concat",
1139
+ "Subject: ",
1140
+ "@payload.subject",
1141
+ [
1142
+ "if",
1143
+ [
1144
+ "=",
1145
+ [
1146
+ "object/get",
1147
+ "@payload",
1148
+ "context",
1149
+ ""
1150
+ ],
1151
+ ""
1152
+ ],
1153
+ "",
1154
+ [
1155
+ "str/concat",
1156
+ "\nContext: ",
1157
+ [
1158
+ "object/get",
1159
+ "@payload",
1160
+ "context",
1161
+ ""
1162
+ ]
1163
+ ]
1164
+ ]
1165
+ ],
1166
+ "role": "user"
1167
+ }
1168
+ ],
1169
+ "tools": [
1170
+ {
1171
+ "event": "@config.chooseEvent",
1172
+ "payload": [
1173
+ {
1174
+ "name": "choice",
1175
+ "required": true,
1176
+ "type": "string",
1177
+ "values": [
1178
+ "array/map",
1179
+ "@entity.instruments",
1180
+ [
1181
+ "fn",
1182
+ "i",
1183
+ [
1184
+ "object/get",
1185
+ "@i",
1186
+ "behavior"
1187
+ ]
1188
+ ]
1189
+ ]
1190
+ }
1191
+ ]
1192
+ }
1193
+ ]
1194
+ }
1195
+ ]
1196
+ ],
1197
+ "event": "GENERATE",
1198
+ "eventId": "evt_01M4JBE6043G8KFW2HSME7C7JA",
1199
+ "from": "idle",
1200
+ "guard": [
1201
+ ">",
1202
+ [
1203
+ "array/len",
1204
+ "@entity.instruments"
1205
+ ],
1206
+ 0.0
1207
+ ],
1208
+ "to": "choosing"
1209
+ },
1210
+ {
1211
+ "effects": [
1212
+ [
1213
+ "set",
1214
+ "@entity.status",
1215
+ "listing"
1216
+ ]
1217
+ ],
1218
+ "event": "INIT",
1219
+ "eventId": "evt_01M4JBE604T8PX0HXGTNVE898A",
1220
+ "from": "listing",
1221
+ "to": "listing"
1222
+ },
1223
+ {
1224
+ "effects": [
1225
+ [
1226
+ "let",
1227
+ [
1228
+ [
1229
+ "hits",
1230
+ [
1231
+ "array/filter",
1232
+ "@payload.result",
1233
+ [
1234
+ "fn",
1235
+ "h",
1236
+ [
1237
+ "or",
1238
+ [
1239
+ "=",
1240
+ [
1241
+ "array/len",
1242
+ "@config.instruments"
1243
+ ],
1244
+ 0.0
1245
+ ],
1246
+ [
1247
+ "array/includes",
1248
+ "@config.instruments",
1249
+ [
1250
+ "object/get",
1251
+ "@h",
1252
+ "behavior"
1253
+ ]
1254
+ ]
1255
+ ]
1256
+ ]
1257
+ ]
1258
+ ]
1259
+ ],
1260
+ [
1261
+ "do",
1262
+ [
1263
+ "set",
1264
+ "@entity.candidates",
1265
+ "@hits"
1266
+ ],
1267
+ [
1268
+ "set",
1269
+ "@entity.cursor",
1270
+ 0.0
1271
+ ],
1272
+ [
1273
+ "set",
1274
+ "@entity.status",
1275
+ "sourcing"
1276
+ ],
1277
+ [
1278
+ "behavior/source",
1279
+ {
1280
+ "behavior": [
1281
+ "object/get",
1282
+ [
1283
+ "array/first",
1284
+ "@hits"
1285
+ ],
1286
+ "behavior"
1287
+ ]
1288
+ },
1289
+ {
1290
+ "emit": {
1291
+ "failure": "GENERATE_FAILED",
1292
+ "success": "SOURCED"
1293
+ }
1294
+ }
1295
+ ]
1296
+ ]
1297
+ ]
1298
+ ],
1299
+ "event": "CATALOG_LISTED",
1300
+ "eventId": "evt_01M4JBE604X8P5DSPKEY4GKKXK",
1301
+ "from": "listing",
1302
+ "guard": [
1303
+ ">",
1304
+ [
1305
+ "array/len",
1306
+ [
1307
+ "array/filter",
1308
+ "@payload.result",
1309
+ [
1310
+ "fn",
1311
+ "h",
1312
+ [
1313
+ "or",
1314
+ [
1315
+ "=",
1316
+ [
1317
+ "array/len",
1318
+ "@config.instruments"
1319
+ ],
1320
+ 0.0
1321
+ ],
1322
+ [
1323
+ "array/includes",
1324
+ "@config.instruments",
1325
+ [
1326
+ "object/get",
1327
+ "@h",
1328
+ "behavior"
1329
+ ]
1330
+ ]
1331
+ ]
1332
+ ]
1333
+ ]
1334
+ ],
1335
+ 0.0
1336
+ ],
1337
+ "to": "sourcing"
1338
+ },
1339
+ {
1340
+ "effects": [
1341
+ [
1342
+ "set",
1343
+ "@entity.error",
1344
+ "No behavior in scope to choose from"
1345
+ ],
1346
+ [
1347
+ "set",
1348
+ "@entity.status",
1349
+ "failed"
1350
+ ],
1351
+ [
1352
+ "render-ui",
1353
+ "@config.statusSlot",
1354
+ {
1355
+ "content": "No instrument could be generated",
1356
+ "role": "status",
1357
+ "type": "typography",
1358
+ "variant": "caption"
1359
+ }
1360
+ ],
1361
+ [
1362
+ "emit",
1363
+ "GENERATE_FAILED",
1364
+ {
1365
+ "error": "No behavior in scope to choose from"
1366
+ }
1367
+ ]
1368
+ ],
1369
+ "event": "CATALOG_LISTED",
1370
+ "eventId": "evt_01M4JBE604X8P5DSPKEY4GKKXK",
1371
+ "from": "listing",
1372
+ "guard": [
1373
+ "=",
1374
+ [
1375
+ "array/len",
1376
+ [
1377
+ "array/filter",
1378
+ "@payload.result",
1379
+ [
1380
+ "fn",
1381
+ "h",
1382
+ [
1383
+ "or",
1384
+ [
1385
+ "=",
1386
+ [
1387
+ "array/len",
1388
+ "@config.instruments"
1389
+ ],
1390
+ 0.0
1391
+ ],
1392
+ [
1393
+ "array/includes",
1394
+ "@config.instruments",
1395
+ [
1396
+ "object/get",
1397
+ "@h",
1398
+ "behavior"
1399
+ ]
1400
+ ]
1401
+ ]
1402
+ ]
1403
+ ]
1404
+ ],
1405
+ 0.0
1406
+ ],
1407
+ "to": "failed"
1408
+ },
1409
+ {
1410
+ "effects": [
1411
+ [
1412
+ "set",
1413
+ "@entity.error",
1414
+ "@payload.error"
1415
+ ],
1416
+ [
1417
+ "set",
1418
+ "@entity.status",
1419
+ "failed"
1420
+ ],
1421
+ [
1422
+ "render-ui",
1423
+ "@config.statusSlot",
1424
+ {
1425
+ "content": "No instrument could be generated",
1426
+ "role": "status",
1427
+ "type": "typography",
1428
+ "variant": "caption"
1429
+ }
1430
+ ],
1431
+ [
1432
+ "emit",
1433
+ "GENERATION_FAILED",
1434
+ {
1435
+ "error": "@payload.error"
1436
+ }
1437
+ ]
1438
+ ],
1439
+ "event": "GENERATE_FAILED",
1440
+ "eventId": "evt_01M4JBE604WT0ZP6HKSGTGRCXZ",
1441
+ "from": "listing",
1442
+ "to": "failed"
1443
+ },
1444
+ {
1445
+ "effects": [
1446
+ [
1447
+ "set",
1448
+ "@entity.status",
1449
+ "sourcing"
1450
+ ]
1451
+ ],
1452
+ "event": "INIT",
1453
+ "eventId": "evt_01M4JBE604T8PX0HXGTNVE898A",
1454
+ "from": "sourcing",
1455
+ "to": "sourcing"
1456
+ },
1457
+ {
1458
+ "effects": [
1459
+ [
1460
+ "let",
1461
+ [
1462
+ [
1463
+ "fields",
1464
+ [
1465
+ "array/flatten",
1466
+ [
1467
+ "array/map",
1468
+ [
1469
+ "object/get",
1470
+ "@payload.result",
1471
+ "orbitals",
1472
+ []
1473
+ ],
1474
+ [
1475
+ "fn",
1476
+ "o",
1477
+ [
1478
+ "array/flatten",
1479
+ [
1480
+ "array/map",
1481
+ [
1482
+ "object/get",
1483
+ "@o",
1484
+ "traits",
1485
+ []
1486
+ ],
1487
+ [
1488
+ "fn",
1489
+ "t",
1490
+ [
1491
+ "array/flatten",
1492
+ [
1493
+ "array/map",
1494
+ [
1495
+ "array/filter",
1496
+ [
1497
+ "object/get",
1498
+ [
1499
+ "object/get",
1500
+ "@t",
1501
+ "stateMachine",
1502
+ {}
1503
+ ],
1504
+ "events",
1505
+ []
1506
+ ],
1507
+ [
1508
+ "fn",
1509
+ "e",
1510
+ [
1511
+ "=",
1512
+ [
1513
+ "object/get",
1514
+ "@e",
1515
+ "key",
1516
+ ""
1517
+ ],
1518
+ "ROSTER_LOADED"
1519
+ ]
1520
+ ]
1521
+ ],
1522
+ [
1523
+ "fn",
1524
+ "e",
1525
+ [
1526
+ "array/filter",
1527
+ [
1528
+ "object/get",
1529
+ "@e",
1530
+ "payloadSchema",
1531
+ []
1532
+ ],
1533
+ [
1534
+ "fn",
1535
+ "f",
1536
+ [
1537
+ "!=",
1538
+ [
1539
+ "object/get",
1540
+ "@f",
1541
+ "name",
1542
+ ""
1543
+ ],
1544
+ "mode"
1545
+ ]
1546
+ ]
1547
+ ]
1548
+ ]
1549
+ ]
1550
+ ]
1551
+ ]
1552
+ ]
1553
+ ]
1554
+ ]
1555
+ ]
1556
+ ]
1557
+ ]
1558
+ ],
1559
+ [
1560
+ "do",
1561
+ [
1562
+ "set",
1563
+ "@entity.instruments",
1564
+ [
1565
+ "if",
1566
+ [
1567
+ ">",
1568
+ [
1569
+ "array/len",
1570
+ "@fields"
1571
+ ],
1572
+ 0.0
1573
+ ],
1574
+ [
1575
+ "array/append",
1576
+ "@entity.instruments",
1577
+ {
1578
+ "behavior": [
1579
+ "object/get",
1580
+ [
1581
+ "array/nth",
1582
+ "@entity.candidates",
1583
+ "@entity.cursor"
1584
+ ],
1585
+ "behavior"
1586
+ ],
1587
+ "description": [
1588
+ "object/get",
1589
+ [
1590
+ "array/nth",
1591
+ "@entity.candidates",
1592
+ "@entity.cursor"
1593
+ ],
1594
+ "description",
1595
+ ""
1596
+ ],
1597
+ "fields": "@fields"
1598
+ }
1599
+ ],
1600
+ "@entity.instruments"
1601
+ ]
1602
+ ],
1603
+ [
1604
+ "set",
1605
+ "@entity.cursor",
1606
+ [
1607
+ "+",
1608
+ "@entity.cursor",
1609
+ 1.0
1610
+ ]
1611
+ ],
1612
+ [
1613
+ "behavior/source",
1614
+ {
1615
+ "behavior": [
1616
+ "object/get",
1617
+ [
1618
+ "array/nth",
1619
+ "@entity.candidates",
1620
+ [
1621
+ "+",
1622
+ "@entity.cursor",
1623
+ 1.0
1624
+ ]
1625
+ ],
1626
+ "behavior"
1627
+ ]
1628
+ },
1629
+ {
1630
+ "emit": {
1631
+ "failure": "GENERATE_FAILED",
1632
+ "success": "SOURCED"
1633
+ }
1634
+ }
1635
+ ]
1636
+ ]
1637
+ ]
1638
+ ],
1639
+ "event": "SOURCED",
1640
+ "eventId": "evt_01M4JBE6040H6CVGAYGRZ95FYN",
1641
+ "from": "sourcing",
1642
+ "guard": [
1643
+ "<",
1644
+ [
1645
+ "+",
1646
+ "@entity.cursor",
1647
+ 1.0
1648
+ ],
1649
+ [
1650
+ "array/len",
1651
+ "@entity.candidates"
1652
+ ]
1653
+ ],
1654
+ "to": "sourcing"
1655
+ },
1656
+ {
1657
+ "effects": [
1658
+ [
1659
+ "let",
1660
+ [
1661
+ [
1662
+ "fields",
1663
+ [
1664
+ "array/flatten",
1665
+ [
1666
+ "array/map",
1667
+ [
1668
+ "object/get",
1669
+ "@payload.result",
1670
+ "orbitals",
1671
+ []
1672
+ ],
1673
+ [
1674
+ "fn",
1675
+ "o",
1676
+ [
1677
+ "array/flatten",
1678
+ [
1679
+ "array/map",
1680
+ [
1681
+ "object/get",
1682
+ "@o",
1683
+ "traits",
1684
+ []
1685
+ ],
1686
+ [
1687
+ "fn",
1688
+ "t",
1689
+ [
1690
+ "array/flatten",
1691
+ [
1692
+ "array/map",
1693
+ [
1694
+ "array/filter",
1695
+ [
1696
+ "object/get",
1697
+ [
1698
+ "object/get",
1699
+ "@t",
1700
+ "stateMachine",
1701
+ {}
1702
+ ],
1703
+ "events",
1704
+ []
1705
+ ],
1706
+ [
1707
+ "fn",
1708
+ "e",
1709
+ [
1710
+ "=",
1711
+ [
1712
+ "object/get",
1713
+ "@e",
1714
+ "key",
1715
+ ""
1716
+ ],
1717
+ "ROSTER_LOADED"
1718
+ ]
1719
+ ]
1720
+ ],
1721
+ [
1722
+ "fn",
1723
+ "e",
1724
+ [
1725
+ "array/filter",
1726
+ [
1727
+ "object/get",
1728
+ "@e",
1729
+ "payloadSchema",
1730
+ []
1731
+ ],
1732
+ [
1733
+ "fn",
1734
+ "f",
1735
+ [
1736
+ "!=",
1737
+ [
1738
+ "object/get",
1739
+ "@f",
1740
+ "name",
1741
+ ""
1742
+ ],
1743
+ "mode"
1744
+ ]
1745
+ ]
1746
+ ]
1747
+ ]
1748
+ ]
1749
+ ]
1750
+ ]
1751
+ ]
1752
+ ]
1753
+ ]
1754
+ ]
1755
+ ]
1756
+ ]
1757
+ ],
1758
+ [
1759
+ "do",
1760
+ [
1761
+ "set",
1762
+ "@entity.instruments",
1763
+ [
1764
+ "if",
1765
+ [
1766
+ ">",
1767
+ [
1768
+ "array/len",
1769
+ "@fields"
1770
+ ],
1771
+ 0.0
1772
+ ],
1773
+ [
1774
+ "array/append",
1775
+ "@entity.instruments",
1776
+ {
1777
+ "behavior": [
1778
+ "object/get",
1779
+ [
1780
+ "array/nth",
1781
+ "@entity.candidates",
1782
+ "@entity.cursor"
1783
+ ],
1784
+ "behavior"
1785
+ ],
1786
+ "description": [
1787
+ "object/get",
1788
+ [
1789
+ "array/nth",
1790
+ "@entity.candidates",
1791
+ "@entity.cursor"
1792
+ ],
1793
+ "description",
1794
+ ""
1795
+ ],
1796
+ "fields": "@fields"
1797
+ }
1798
+ ],
1799
+ "@entity.instruments"
1800
+ ]
1801
+ ],
1802
+ [
1803
+ "set",
1804
+ "@entity.status",
1805
+ "choosing"
1806
+ ],
1807
+ [
1808
+ "emit",
1809
+ "INSTRUMENTS_READY",
1810
+ {}
1811
+ ]
1812
+ ]
1813
+ ]
1814
+ ],
1815
+ "event": "SOURCED",
1816
+ "eventId": "evt_01M4JBE6040H6CVGAYGRZ95FYN",
1817
+ "from": "sourcing",
1818
+ "guard": [
1819
+ ">=",
1820
+ [
1821
+ "+",
1822
+ "@entity.cursor",
1823
+ 1.0
1824
+ ],
1825
+ [
1826
+ "array/len",
1827
+ "@entity.candidates"
1828
+ ]
1829
+ ],
1830
+ "to": "choosing"
1831
+ },
1832
+ {
1833
+ "effects": [
1834
+ [
1835
+ "set",
1836
+ "@entity.error",
1837
+ "@payload.error"
1838
+ ],
1839
+ [
1840
+ "set",
1841
+ "@entity.status",
1842
+ "failed"
1843
+ ],
1844
+ [
1845
+ "render-ui",
1846
+ "@config.statusSlot",
1847
+ {
1848
+ "content": "No instrument could be generated",
1849
+ "role": "status",
1850
+ "type": "typography",
1851
+ "variant": "caption"
1852
+ }
1853
+ ],
1854
+ [
1855
+ "emit",
1856
+ "GENERATION_FAILED",
1857
+ {
1858
+ "error": "@payload.error"
1859
+ }
1860
+ ]
1861
+ ],
1862
+ "event": "GENERATE_FAILED",
1863
+ "eventId": "evt_01M4JBE604WT0ZP6HKSGTGRCXZ",
1864
+ "from": "sourcing",
1865
+ "to": "failed"
1866
+ },
1867
+ {
1868
+ "effects": [
1869
+ [
1870
+ "set",
1871
+ "@entity.status",
1872
+ "choosing"
1873
+ ]
1874
+ ],
1875
+ "event": "INIT",
1876
+ "eventId": "evt_01M4JBE604T8PX0HXGTNVE898A",
1877
+ "from": "choosing",
1878
+ "to": "choosing"
1879
+ },
1880
+ {
1881
+ "effects": [
1882
+ [
1883
+ "render-ui",
1884
+ "@config.statusSlot",
1885
+ {
1886
+ "content": "Choosing an instrument…",
1887
+ "role": "status",
1888
+ "type": "typography",
1889
+ "variant": "caption"
1890
+ }
1891
+ ],
1892
+ [
1893
+ "emit",
1894
+ "CONVERSE",
1895
+ {
1896
+ "ephemeral": true,
1897
+ "instructions": [
1898
+ "str/concat",
1899
+ "You pick the one interactive learning instrument that best lets a learner explore the subject. The installed instruments:\n",
1900
+ [
1901
+ "str/join",
1902
+ [
1903
+ "array/map",
1904
+ "@entity.instruments",
1905
+ [
1906
+ "fn",
1907
+ "i",
1908
+ [
1909
+ "str/concat",
1910
+ "- ",
1911
+ [
1912
+ "object/get",
1913
+ "@i",
1914
+ "behavior"
1915
+ ],
1916
+ ": ",
1917
+ [
1918
+ "object/get",
1919
+ "@i",
1920
+ "description",
1921
+ ""
1922
+ ]
1923
+ ]
1924
+ ]
1925
+ ],
1926
+ "\n"
1927
+ ],
1928
+ "\nCall the CHOOSE tool once with exactly one of them, then reply with one sentence."
1929
+ ],
1930
+ "messages": [
1931
+ {
1932
+ "content": [
1933
+ "str/concat",
1934
+ "Subject: ",
1935
+ "@entity.subject",
1936
+ [
1937
+ "if",
1938
+ [
1939
+ "=",
1940
+ "@entity.context",
1941
+ ""
1942
+ ],
1943
+ "",
1944
+ [
1945
+ "str/concat",
1946
+ "\nContext: ",
1947
+ "@entity.context"
1948
+ ]
1949
+ ]
1950
+ ],
1951
+ "role": "user"
1952
+ }
1953
+ ],
1954
+ "tools": [
1955
+ {
1956
+ "event": "@config.chooseEvent",
1957
+ "payload": [
1958
+ {
1959
+ "name": "choice",
1960
+ "required": true,
1961
+ "type": "string",
1962
+ "values": [
1963
+ "array/map",
1964
+ "@entity.instruments",
1965
+ [
1966
+ "fn",
1967
+ "i",
1968
+ [
1969
+ "object/get",
1970
+ "@i",
1971
+ "behavior"
1972
+ ]
1973
+ ]
1974
+ ]
1975
+ }
1976
+ ]
1977
+ }
1978
+ ]
1979
+ }
1980
+ ]
1981
+ ],
1982
+ "event": "INSTRUMENTS_READY",
1983
+ "eventId": "evt_01M4JBE604D103REAE11JPAVDB",
1984
+ "from": "choosing",
1985
+ "guard": [
1986
+ ">",
1987
+ [
1988
+ "array/len",
1989
+ "@entity.instruments"
1990
+ ],
1991
+ 0.0
1992
+ ],
1993
+ "to": "choosing"
1994
+ },
1995
+ {
1996
+ "effects": [
1997
+ [
1998
+ "set",
1999
+ "@entity.error",
2000
+ "No instrument in scope takes a roster"
2001
+ ],
2002
+ [
2003
+ "set",
2004
+ "@entity.status",
2005
+ "failed"
2006
+ ],
2007
+ [
2008
+ "render-ui",
2009
+ "@config.statusSlot",
2010
+ {
2011
+ "content": "No instrument could be generated",
2012
+ "role": "status",
2013
+ "type": "typography",
2014
+ "variant": "caption"
2015
+ }
2016
+ ],
2017
+ [
2018
+ "emit",
2019
+ "GENERATION_FAILED",
2020
+ {
2021
+ "error": "No instrument in scope takes a roster"
2022
+ }
2023
+ ]
2024
+ ],
2025
+ "event": "INSTRUMENTS_READY",
2026
+ "eventId": "evt_01M4JBE604D103REAE11JPAVDB",
2027
+ "from": "choosing",
2028
+ "guard": [
2029
+ "=",
2030
+ [
2031
+ "array/len",
2032
+ "@entity.instruments"
2033
+ ],
2034
+ 0.0
2035
+ ],
2036
+ "to": "failed"
2037
+ },
2038
+ {
2039
+ "effects": [
2040
+ [
2041
+ "set",
2042
+ "@entity.chosen",
2043
+ "@payload.choice"
2044
+ ]
2045
+ ],
2046
+ "event": "CHOOSE",
2047
+ "eventId": "evt_01M4JBE604BX6W2Y8WGAWP5R5E",
2048
+ "from": "choosing",
2049
+ "to": "choosing"
2050
+ },
2051
+ {
2052
+ "effects": [
2053
+ [
2054
+ "set",
2055
+ "@entity.status",
2056
+ "filling"
2057
+ ],
2058
+ [
2059
+ "render-ui",
2060
+ "@config.statusSlot",
2061
+ {
2062
+ "content": "Writing the roster…",
2063
+ "role": "status",
2064
+ "type": "typography",
2065
+ "variant": "caption"
2066
+ }
2067
+ ],
2068
+ [
2069
+ "emit",
2070
+ "CONVERSE",
2071
+ {
2072
+ "ephemeral": true,
2073
+ "instructions": [
2074
+ "str/concat",
2075
+ "You write the content roster for the learning instrument ",
2076
+ "@entity.chosen",
2077
+ ": ",
2078
+ [
2079
+ "object/get",
2080
+ [
2081
+ "array/find",
2082
+ "@entity.instruments",
2083
+ [
2084
+ "fn",
2085
+ "i",
2086
+ [
2087
+ "=",
2088
+ [
2089
+ "object/get",
2090
+ "@i",
2091
+ "behavior"
2092
+ ],
2093
+ "@entity.chosen"
2094
+ ]
2095
+ ]
2096
+ ],
2097
+ "description",
2098
+ ""
2099
+ ],
2100
+ "\nCall the FILL tool once with a roster of realistic, accurate, pedagogically useful content about the subject. If the tool reports issues, call it again with them fixed. Then reply with one sentence."
2101
+ ],
2102
+ "messages": [
2103
+ {
2104
+ "content": [
2105
+ "str/concat",
2106
+ "Subject: ",
2107
+ "@entity.subject",
2108
+ [
2109
+ "if",
2110
+ [
2111
+ "=",
2112
+ "@entity.context",
2113
+ ""
2114
+ ],
2115
+ "",
2116
+ [
2117
+ "str/concat",
2118
+ "\nContext: ",
2119
+ "@entity.context"
2120
+ ]
2121
+ ]
2122
+ ],
2123
+ "role": "user"
2124
+ }
2125
+ ],
2126
+ "tools": [
2127
+ {
2128
+ "event": "@config.fillEvent",
2129
+ "payload": [
2130
+ {
2131
+ "name": "roster",
2132
+ "properties": [
2133
+ "object/get",
2134
+ [
2135
+ "array/find",
2136
+ "@entity.instruments",
2137
+ [
2138
+ "fn",
2139
+ "i",
2140
+ [
2141
+ "=",
2142
+ [
2143
+ "object/get",
2144
+ "@i",
2145
+ "behavior"
2146
+ ],
2147
+ "@entity.chosen"
2148
+ ]
2149
+ ]
2150
+ ],
2151
+ "fields",
2152
+ []
2153
+ ],
2154
+ "required": true,
2155
+ "type": "object"
2156
+ }
2157
+ ]
2158
+ }
2159
+ ]
2160
+ }
2161
+ ]
2162
+ ],
2163
+ "event": "ASSISTANT_REPLIED",
2164
+ "eventId": "evt_01M4JBE6044J56RJC979A5PJJM",
2165
+ "from": "choosing",
2166
+ "guard": [
2167
+ "array/some",
2168
+ "@entity.instruments",
2169
+ [
2170
+ "fn",
2171
+ "i",
2172
+ [
2173
+ "=",
2174
+ [
2175
+ "object/get",
2176
+ "@i",
2177
+ "behavior"
2178
+ ],
2179
+ "@entity.chosen"
2180
+ ]
2181
+ ]
2182
+ ],
2183
+ "to": "filling"
2184
+ },
2185
+ {
2186
+ "effects": [
2187
+ [
2188
+ "set",
2189
+ "@entity.error",
2190
+ "The model chose no installed instrument"
2191
+ ],
2192
+ [
2193
+ "set",
2194
+ "@entity.status",
2195
+ "failed"
2196
+ ],
2197
+ [
2198
+ "render-ui",
2199
+ "@config.statusSlot",
2200
+ {
2201
+ "content": "No instrument could be generated",
2202
+ "role": "status",
2203
+ "type": "typography",
2204
+ "variant": "caption"
2205
+ }
2206
+ ],
2207
+ [
2208
+ "emit",
2209
+ "GENERATION_FAILED",
2210
+ {
2211
+ "error": "The model chose no installed instrument"
2212
+ }
2213
+ ]
2214
+ ],
2215
+ "event": "ASSISTANT_REPLIED",
2216
+ "eventId": "evt_01M4JBE6044J56RJC979A5PJJM",
2217
+ "from": "choosing",
2218
+ "guard": [
2219
+ "not",
2220
+ [
2221
+ "array/some",
2222
+ "@entity.instruments",
2223
+ [
2224
+ "fn",
2225
+ "i",
2226
+ [
2227
+ "=",
2228
+ [
2229
+ "object/get",
2230
+ "@i",
2231
+ "behavior"
2232
+ ],
2233
+ "@entity.chosen"
2234
+ ]
2235
+ ]
2236
+ ]
2237
+ ],
2238
+ "to": "failed"
2239
+ },
2240
+ {
2241
+ "effects": [
2242
+ [
2243
+ "set",
2244
+ "@entity.error",
2245
+ "@payload.error"
2246
+ ],
2247
+ [
2248
+ "set",
2249
+ "@entity.status",
2250
+ "failed"
2251
+ ],
2252
+ [
2253
+ "render-ui",
2254
+ "@config.statusSlot",
2255
+ {
2256
+ "content": "No instrument could be generated",
2257
+ "role": "status",
2258
+ "type": "typography",
2259
+ "variant": "caption"
2260
+ }
2261
+ ],
2262
+ [
2263
+ "emit",
2264
+ "GENERATION_FAILED",
2265
+ {
2266
+ "error": "@payload.error"
2267
+ }
2268
+ ]
2269
+ ],
2270
+ "event": "TOOLS_FAILED",
2271
+ "eventId": "evt_01M4JBE604DXC4ME0YA0NFCWBS",
2272
+ "from": "choosing",
2273
+ "to": "failed"
2274
+ },
2275
+ {
2276
+ "effects": [
2277
+ [
2278
+ "set",
2279
+ "@entity.status",
2280
+ "filling"
2281
+ ]
2282
+ ],
2283
+ "event": "INIT",
2284
+ "eventId": "evt_01M4JBE604T8PX0HXGTNVE898A",
2285
+ "from": "filling",
2286
+ "to": "filling"
2287
+ },
2288
+ {
2289
+ "effects": [
2290
+ [
2291
+ "set",
2292
+ "@entity.roster",
2293
+ [
2294
+ "json/stringify",
2295
+ "@payload.roster"
2296
+ ]
2297
+ ]
2298
+ ],
2299
+ "event": "FILL",
2300
+ "eventId": "evt_01M4JBE604R220NCEP222PWBZG",
2301
+ "from": "filling",
2302
+ "to": "filling"
2303
+ },
2304
+ {
2305
+ "effects": [
2306
+ [
2307
+ "set",
2308
+ "@entity.status",
2309
+ "done"
2310
+ ],
2311
+ [
2312
+ "render-ui",
2313
+ "@config.statusSlot",
2314
+ {
2315
+ "content": "Instrument ready",
2316
+ "role": "status",
2317
+ "type": "typography",
2318
+ "variant": "caption"
2319
+ }
2320
+ ],
2321
+ [
2322
+ "emit",
2323
+ "GENERATED",
2324
+ {
2325
+ "behavior": "@entity.chosen",
2326
+ "mode": [
2327
+ "array/last",
2328
+ [
2329
+ "str/split",
2330
+ "@entity.chosen",
2331
+ "/"
2332
+ ]
2333
+ ],
2334
+ "roster": "@entity.roster"
2335
+ }
2336
+ ]
2337
+ ],
2338
+ "event": "ASSISTANT_REPLIED",
2339
+ "eventId": "evt_01M4JBE6044J56RJC979A5PJJM",
2340
+ "from": "filling",
2341
+ "guard": [
2342
+ "!=",
2343
+ "@entity.roster",
2344
+ ""
2345
+ ],
2346
+ "to": "done"
2347
+ },
2348
+ {
2349
+ "effects": [
2350
+ [
2351
+ "set",
2352
+ "@entity.error",
2353
+ "The model wrote no roster that matches the instrument"
2354
+ ],
2355
+ [
2356
+ "set",
2357
+ "@entity.status",
2358
+ "failed"
2359
+ ],
2360
+ [
2361
+ "render-ui",
2362
+ "@config.statusSlot",
2363
+ {
2364
+ "content": "No instrument could be generated",
2365
+ "role": "status",
2366
+ "type": "typography",
2367
+ "variant": "caption"
2368
+ }
2369
+ ],
2370
+ [
2371
+ "emit",
2372
+ "GENERATION_FAILED",
2373
+ {
2374
+ "error": "The model wrote no roster that matches the instrument"
2375
+ }
2376
+ ]
2377
+ ],
2378
+ "event": "ASSISTANT_REPLIED",
2379
+ "eventId": "evt_01M4JBE6044J56RJC979A5PJJM",
2380
+ "from": "filling",
2381
+ "guard": [
2382
+ "=",
2383
+ "@entity.roster",
2384
+ ""
2385
+ ],
2386
+ "to": "failed"
2387
+ },
2388
+ {
2389
+ "effects": [
2390
+ [
2391
+ "set",
2392
+ "@entity.error",
2393
+ "@payload.error"
2394
+ ],
2395
+ [
2396
+ "set",
2397
+ "@entity.status",
2398
+ "failed"
2399
+ ],
2400
+ [
2401
+ "render-ui",
2402
+ "@config.statusSlot",
2403
+ {
2404
+ "content": "No instrument could be generated",
2405
+ "role": "status",
2406
+ "type": "typography",
2407
+ "variant": "caption"
2408
+ }
2409
+ ],
2410
+ [
2411
+ "emit",
2412
+ "GENERATION_FAILED",
2413
+ {
2414
+ "error": "@payload.error"
2415
+ }
2416
+ ]
2417
+ ],
2418
+ "event": "TOOLS_FAILED",
2419
+ "eventId": "evt_01M4JBE604DXC4ME0YA0NFCWBS",
2420
+ "from": "filling",
2421
+ "to": "failed"
2422
+ },
2423
+ {
2424
+ "effects": [
2425
+ [
2426
+ "set",
2427
+ "@entity.status",
2428
+ "done"
2429
+ ]
2430
+ ],
2431
+ "event": "INIT",
2432
+ "eventId": "evt_01M4JBE604T8PX0HXGTNVE898A",
2433
+ "from": "done",
2434
+ "to": "done"
2435
+ },
2436
+ {
2437
+ "effects": [
2438
+ [
2439
+ "set",
2440
+ "@entity.subject",
2441
+ "@payload.subject"
2442
+ ],
2443
+ [
2444
+ "set",
2445
+ "@entity.context",
2446
+ [
2447
+ "object/get",
2448
+ "@payload",
2449
+ "context",
2450
+ ""
2451
+ ]
2452
+ ],
2453
+ [
2454
+ "set",
2455
+ "@entity.chosen",
2456
+ ""
2457
+ ],
2458
+ [
2459
+ "set",
2460
+ "@entity.roster",
2461
+ ""
2462
+ ],
2463
+ [
2464
+ "set",
2465
+ "@entity.status",
2466
+ "listing"
2467
+ ],
2468
+ [
2469
+ "behavior/catalog",
2470
+ {
2471
+ "paths": "@config.scope"
2472
+ },
2473
+ {
2474
+ "emit": {
2475
+ "failure": "GENERATE_FAILED",
2476
+ "success": "CATALOG_LISTED"
2477
+ }
2478
+ }
2479
+ ]
2480
+ ],
2481
+ "event": "GENERATE",
2482
+ "eventId": "evt_01M4JBE6043G8KFW2HSME7C7JA",
2483
+ "from": "done",
2484
+ "guard": [
2485
+ "=",
2486
+ [
2487
+ "array/len",
2488
+ "@entity.instruments"
2489
+ ],
2490
+ 0.0
2491
+ ],
2492
+ "to": "listing"
2493
+ },
2494
+ {
2495
+ "effects": [
2496
+ [
2497
+ "set",
2498
+ "@entity.subject",
2499
+ "@payload.subject"
2500
+ ],
2501
+ [
2502
+ "set",
2503
+ "@entity.context",
2504
+ [
2505
+ "object/get",
2506
+ "@payload",
2507
+ "context",
2508
+ ""
2509
+ ]
2510
+ ],
2511
+ [
2512
+ "set",
2513
+ "@entity.chosen",
2514
+ ""
2515
+ ],
2516
+ [
2517
+ "set",
2518
+ "@entity.roster",
2519
+ ""
2520
+ ],
2521
+ [
2522
+ "set",
2523
+ "@entity.status",
2524
+ "choosing"
2525
+ ],
2526
+ [
2527
+ "emit",
2528
+ "INSTRUMENTS_READY",
2529
+ {}
2530
+ ]
2531
+ ],
2532
+ "event": "GENERATE",
2533
+ "eventId": "evt_01M4JBE6043G8KFW2HSME7C7JA",
2534
+ "from": "done",
2535
+ "guard": [
2536
+ ">",
2537
+ [
2538
+ "array/len",
2539
+ "@entity.instruments"
2540
+ ],
2541
+ 0.0
2542
+ ],
2543
+ "to": "choosing"
2544
+ },
2545
+ {
2546
+ "effects": [
2547
+ [
2548
+ "set",
2549
+ "@entity.status",
2550
+ "failed"
2551
+ ]
2552
+ ],
2553
+ "event": "INIT",
2554
+ "eventId": "evt_01M4JBE604T8PX0HXGTNVE898A",
2555
+ "from": "failed",
2556
+ "to": "failed"
2557
+ },
2558
+ {
2559
+ "effects": [
2560
+ [
2561
+ "set",
2562
+ "@entity.subject",
2563
+ "@payload.subject"
2564
+ ],
2565
+ [
2566
+ "set",
2567
+ "@entity.context",
2568
+ [
2569
+ "object/get",
2570
+ "@payload",
2571
+ "context",
2572
+ ""
2573
+ ]
2574
+ ],
2575
+ [
2576
+ "set",
2577
+ "@entity.chosen",
2578
+ ""
2579
+ ],
2580
+ [
2581
+ "set",
2582
+ "@entity.roster",
2583
+ ""
2584
+ ],
2585
+ [
2586
+ "set",
2587
+ "@entity.error",
2588
+ ""
2589
+ ],
2590
+ [
2591
+ "set",
2592
+ "@entity.status",
2593
+ "listing"
2594
+ ],
2595
+ [
2596
+ "behavior/catalog",
2597
+ {
2598
+ "paths": "@config.scope"
2599
+ },
2600
+ {
2601
+ "emit": {
2602
+ "failure": "GENERATE_FAILED",
2603
+ "success": "CATALOG_LISTED"
2604
+ }
2605
+ }
2606
+ ]
2607
+ ],
2608
+ "event": "GENERATE",
2609
+ "eventId": "evt_01M4JBE6043G8KFW2HSME7C7JA",
2610
+ "from": "failed",
2611
+ "guard": [
2612
+ "=",
2613
+ [
2614
+ "array/len",
2615
+ "@entity.instruments"
2616
+ ],
2617
+ 0.0
2618
+ ],
2619
+ "to": "listing"
2620
+ },
2621
+ {
2622
+ "effects": [
2623
+ [
2624
+ "set",
2625
+ "@entity.subject",
2626
+ "@payload.subject"
2627
+ ],
2628
+ [
2629
+ "set",
2630
+ "@entity.context",
2631
+ [
2632
+ "object/get",
2633
+ "@payload",
2634
+ "context",
2635
+ ""
2636
+ ]
2637
+ ],
2638
+ [
2639
+ "set",
2640
+ "@entity.chosen",
2641
+ ""
2642
+ ],
2643
+ [
2644
+ "set",
2645
+ "@entity.roster",
2646
+ ""
2647
+ ],
2648
+ [
2649
+ "set",
2650
+ "@entity.error",
2651
+ ""
2652
+ ],
2653
+ [
2654
+ "set",
2655
+ "@entity.status",
2656
+ "choosing"
2657
+ ],
2658
+ [
2659
+ "emit",
2660
+ "INSTRUMENTS_READY",
2661
+ {}
2662
+ ]
2663
+ ],
2664
+ "event": "GENERATE",
2665
+ "eventId": "evt_01M4JBE6043G8KFW2HSME7C7JA",
2666
+ "from": "failed",
2667
+ "guard": [
2668
+ ">",
2669
+ [
2670
+ "array/len",
2671
+ "@entity.instruments"
2672
+ ],
2673
+ 0.0
2674
+ ],
2675
+ "to": "choosing"
2676
+ }
2677
+ ]
2678
+ }
2679
+ },
2680
+ {
2681
+ "config": {
2682
+ "cancelKey": {
2683
+ "default": "std-learn-generate",
2684
+ "type": "unknown"
2685
+ },
2686
+ "maxSteps": {
2687
+ "default": 4.0,
2688
+ "type": "unknown"
2689
+ },
2690
+ "quiet": {
2691
+ "default": true,
2692
+ "type": "unknown"
2693
+ }
2694
+ },
2695
+ "id": "trt_01M4JBE604NMD4CTP40PEXPESH",
2696
+ "listens": [
2697
+ {
2698
+ "event": "CONVERSE",
2699
+ "source": {
2700
+ "kind": "trait",
2701
+ "trait": "LearnGenerate"
2702
+ },
2703
+ "triggers": "CONVERSE"
2704
+ }
2705
+ ],
2706
+ "name": "LearnGenerateTools",
2707
+ "ref": "ToolLoop.traits.AgentToolLoop"
2708
+ }
2709
+ ],
2710
+ "types": {
2711
+ "AgentChatMessage": [
2712
+ {
2713
+ "name": "role",
2714
+ "type": "string",
2715
+ "values": [
2716
+ "user",
2717
+ "assistant"
2718
+ ]
2719
+ },
2720
+ {
2721
+ "name": "content",
2722
+ "required": true,
2723
+ "type": "string"
2724
+ }
2725
+ ],
2726
+ "AgentToolField": [
2727
+ {
2728
+ "name": "name",
2729
+ "required": true,
2730
+ "type": "string"
2731
+ },
2732
+ {
2733
+ "name": "type",
2734
+ "required": true,
2735
+ "type": "string"
2736
+ },
2737
+ {
2738
+ "name": "required",
2739
+ "type": "boolean"
2740
+ },
2741
+ {
2742
+ "name": "values",
2743
+ "type": "[string]"
2744
+ },
2745
+ {
2746
+ "name": "properties",
2747
+ "properties": [
2748
+ {
2749
+ "name": "name",
2750
+ "required": true,
2751
+ "type": "string"
2752
+ },
2753
+ {
2754
+ "name": "type",
2755
+ "required": true,
2756
+ "type": "string"
2757
+ },
2758
+ {
2759
+ "name": "required",
2760
+ "type": "boolean"
2761
+ },
2762
+ {
2763
+ "name": "values",
2764
+ "type": "[string]"
2765
+ },
2766
+ {
2767
+ "name": "properties",
2768
+ "properties": [],
2769
+ "type": "[AgentToolField]"
2770
+ },
2771
+ {
2772
+ "name": "description",
2773
+ "type": "string"
2774
+ }
2775
+ ],
2776
+ "type": "[object]"
2777
+ },
2778
+ {
2779
+ "name": "description",
2780
+ "type": "string"
2781
+ }
2782
+ ],
2783
+ "AgentToolInput": [
2784
+ {
2785
+ "name": "event",
2786
+ "required": true,
2787
+ "type": "EventAddress"
2788
+ },
2789
+ {
2790
+ "name": "payload",
2791
+ "properties": [
2792
+ {
2793
+ "name": "name",
2794
+ "required": true,
2795
+ "type": "string"
2796
+ },
2797
+ {
2798
+ "name": "type",
2799
+ "required": true,
2800
+ "type": "string"
2801
+ },
2802
+ {
2803
+ "name": "required",
2804
+ "type": "boolean"
2805
+ },
2806
+ {
2807
+ "name": "values",
2808
+ "type": "[string]"
2809
+ },
2810
+ {
2811
+ "name": "properties",
2812
+ "properties": [],
2813
+ "type": "[AgentToolField]"
2814
+ },
2815
+ {
2816
+ "name": "description",
2817
+ "type": "string"
2818
+ }
2819
+ ],
2820
+ "type": "[object]"
2821
+ }
2822
+ ],
2823
+ "CatalogHit": [
2824
+ {
2825
+ "name": "behavior",
2826
+ "required": true,
2827
+ "type": "string"
2828
+ },
2829
+ {
2830
+ "name": "description",
2831
+ "type": "string"
2832
+ },
2833
+ {
2834
+ "name": "traits",
2835
+ "required": true,
2836
+ "type": "[trait]"
2837
+ },
2838
+ {
2839
+ "name": "vectors",
2840
+ "type": "Map<string,[number]>"
2841
+ }
2842
+ ],
2843
+ "LearnInstrument": [
2844
+ {
2845
+ "name": "behavior",
2846
+ "required": true,
2847
+ "type": "string"
2848
+ },
2849
+ {
2850
+ "name": "description",
2851
+ "type": "string"
2852
+ },
2853
+ {
2854
+ "name": "fields",
2855
+ "properties": [
2856
+ {
2857
+ "name": "name",
2858
+ "required": true,
2859
+ "type": "string"
2860
+ },
2861
+ {
2862
+ "name": "type",
2863
+ "required": true,
2864
+ "type": "string"
2865
+ },
2866
+ {
2867
+ "name": "required",
2868
+ "type": "boolean"
2869
+ },
2870
+ {
2871
+ "name": "values",
2872
+ "type": "[string]"
2873
+ },
2874
+ {
2875
+ "name": "properties",
2876
+ "properties": [],
2877
+ "type": "[AgentToolField]"
2878
+ },
2879
+ {
2880
+ "name": "description",
2881
+ "type": "string"
2882
+ }
2883
+ ],
2884
+ "required": true,
2885
+ "type": "[object]"
2886
+ }
2887
+ ]
2888
+ },
2889
+ "uses": [
2890
+ {
2891
+ "as": "ToolLoop",
2892
+ "from": "std/behaviors/std-agent-tool-loop"
2893
+ }
2894
+ ]
2895
+ }
2896
+ ],
2897
+ "schemaVersion": 1,
2898
+ "version": "1.0.0"
2899
+ }