@almadar/std 3.12.1 → 3.13.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.
Files changed (149) hide show
  1. package/behaviors/exports/atoms/std-agent-classifier.orb +402 -0
  2. package/behaviors/exports/atoms/std-agent-completion.orb +469 -0
  3. package/behaviors/exports/atoms/std-agent-context-window.orb +790 -0
  4. package/behaviors/exports/atoms/std-agent-conversation.orb +737 -0
  5. package/behaviors/exports/atoms/std-agent-memory.orb +627 -0
  6. package/behaviors/exports/atoms/std-agent-provider.orb +402 -0
  7. package/behaviors/exports/atoms/std-agent-search.orb +418 -0
  8. package/behaviors/exports/atoms/std-agent-session.orb +825 -0
  9. package/behaviors/exports/atoms/std-agent-tool-call.orb +380 -0
  10. package/behaviors/exports/atoms/std-wizard.orb +63 -70
  11. package/behaviors/exports/molecules/std-agent-fix-loop.orb +1213 -0
  12. package/behaviors/exports/molecules/std-agent-learner.orb +1143 -0
  13. package/behaviors/exports/molecules/std-agent-planner.orb +898 -0
  14. package/behaviors/exports/molecules/std-agent-rag.orb +736 -0
  15. package/behaviors/exports/molecules/std-agent-tool-loop.orb +1237 -0
  16. package/behaviors/exports/molecules/std-detail.orb +4 -0
  17. package/behaviors/exports/molecules/std-geospatial.orb +4 -0
  18. package/behaviors/exports/molecules/std-inventory.orb +8 -0
  19. package/behaviors/exports/molecules/std-list.orb +18 -1
  20. package/behaviors/exports/molecules/std-messaging.orb +4 -0
  21. package/behaviors/exports/organisms/std-agent-assistant.orb +2288 -0
  22. package/behaviors/exports/organisms/std-agent-builder.orb +2664 -0
  23. package/behaviors/exports/organisms/std-agent-pipeline.orb +2307 -0
  24. package/behaviors/exports/organisms/std-agent-reviewer.orb +1743 -0
  25. package/behaviors/exports/organisms/std-agent-tutor.orb +2303 -0
  26. package/behaviors/exports/organisms/std-api-gateway.orb +18 -1
  27. package/behaviors/exports/organisms/std-booking-system.orb +131 -104
  28. package/behaviors/exports/organisms/std-cicd-pipeline.orb +18 -1
  29. package/behaviors/exports/organisms/std-cms.orb +40 -2
  30. package/behaviors/exports/organisms/std-crm.orb +40 -2
  31. package/behaviors/exports/organisms/std-devops-dashboard.orb +18 -1
  32. package/behaviors/exports/organisms/std-finance-tracker.orb +22 -1
  33. package/behaviors/exports/organisms/std-healthcare.orb +167 -136
  34. package/behaviors/exports/organisms/std-helpdesk.orb +22 -1
  35. package/behaviors/exports/organisms/std-hr-portal.orb +115 -88
  36. package/behaviors/exports/organisms/std-iot-dashboard.orb +18 -1
  37. package/behaviors/exports/organisms/std-lms.orb +97 -87
  38. package/behaviors/exports/organisms/std-platformer-app.orb +8 -0
  39. package/behaviors/exports/organisms/std-project-manager.orb +36 -2
  40. package/behaviors/exports/organisms/std-realtime-chat.orb +22 -1
  41. package/behaviors/exports/organisms/std-rpg-game.orb +8 -0
  42. package/behaviors/exports/organisms/std-service-marketplace.orb +36 -2
  43. package/behaviors/exports/organisms/std-social-feed.orb +8 -0
  44. package/behaviors/exports/organisms/std-trading-dashboard.orb +18 -1
  45. package/behaviors/exports/validation-report.json +1425 -0
  46. package/dist/behaviors/exports/atoms/std-agent-classifier.orb +402 -0
  47. package/dist/behaviors/exports/atoms/std-agent-completion.orb +469 -0
  48. package/dist/behaviors/exports/atoms/std-agent-context-window.orb +790 -0
  49. package/dist/behaviors/exports/atoms/std-agent-conversation.orb +737 -0
  50. package/dist/behaviors/exports/atoms/std-agent-memory.orb +627 -0
  51. package/dist/behaviors/exports/atoms/std-agent-provider.orb +402 -0
  52. package/dist/behaviors/exports/atoms/std-agent-search.orb +418 -0
  53. package/dist/behaviors/exports/atoms/std-agent-session.orb +825 -0
  54. package/dist/behaviors/exports/atoms/std-agent-tool-call.orb +380 -0
  55. package/dist/behaviors/exports/atoms/std-wizard.orb +63 -70
  56. package/dist/behaviors/exports/molecules/std-agent-fix-loop.orb +1213 -0
  57. package/dist/behaviors/exports/molecules/std-agent-learner.orb +1143 -0
  58. package/dist/behaviors/exports/molecules/std-agent-planner.orb +898 -0
  59. package/dist/behaviors/exports/molecules/std-agent-rag.orb +736 -0
  60. package/dist/behaviors/exports/molecules/std-agent-tool-loop.orb +1237 -0
  61. package/dist/behaviors/exports/molecules/std-detail.orb +4 -0
  62. package/dist/behaviors/exports/molecules/std-geospatial.orb +4 -0
  63. package/dist/behaviors/exports/molecules/std-inventory.orb +8 -0
  64. package/dist/behaviors/exports/molecules/std-list.orb +18 -1
  65. package/dist/behaviors/exports/molecules/std-messaging.orb +4 -0
  66. package/dist/behaviors/exports/organisms/std-agent-assistant.orb +2288 -0
  67. package/dist/behaviors/exports/organisms/std-agent-builder.orb +2664 -0
  68. package/dist/behaviors/exports/organisms/std-agent-pipeline.orb +2307 -0
  69. package/dist/behaviors/exports/organisms/std-agent-reviewer.orb +1743 -0
  70. package/dist/behaviors/exports/organisms/std-agent-tutor.orb +2303 -0
  71. package/dist/behaviors/exports/organisms/std-api-gateway.orb +18 -1
  72. package/dist/behaviors/exports/organisms/std-booking-system.orb +131 -104
  73. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +18 -1
  74. package/dist/behaviors/exports/organisms/std-cms.orb +40 -2
  75. package/dist/behaviors/exports/organisms/std-crm.orb +40 -2
  76. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +18 -1
  77. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +22 -1
  78. package/dist/behaviors/exports/organisms/std-healthcare.orb +167 -136
  79. package/dist/behaviors/exports/organisms/std-helpdesk.orb +22 -1
  80. package/dist/behaviors/exports/organisms/std-hr-portal.orb +115 -88
  81. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +18 -1
  82. package/dist/behaviors/exports/organisms/std-lms.orb +97 -87
  83. package/dist/behaviors/exports/organisms/std-platformer-app.orb +8 -0
  84. package/dist/behaviors/exports/organisms/std-project-manager.orb +36 -2
  85. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +22 -1
  86. package/dist/behaviors/exports/organisms/std-rpg-game.orb +8 -0
  87. package/dist/behaviors/exports/organisms/std-service-marketplace.orb +36 -2
  88. package/dist/behaviors/exports/organisms/std-social-feed.orb +8 -0
  89. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +18 -1
  90. package/dist/behaviors/exports/validation-report.json +1425 -0
  91. package/dist/behaviors/exports-reader.js +6345 -175
  92. package/dist/behaviors/exports-reader.js.map +1 -1
  93. package/dist/behaviors/functions/index.d.ts +620 -1
  94. package/dist/behaviors/functions/index.js +6285 -176
  95. package/dist/behaviors/functions/index.js.map +1 -1
  96. package/dist/behaviors/index.d.ts +1 -1
  97. package/dist/behaviors/index.js +6348 -178
  98. package/dist/behaviors/index.js.map +1 -1
  99. package/dist/behaviors/query.js +6347 -177
  100. package/dist/behaviors/query.js.map +1 -1
  101. package/dist/exports/atoms/std-agent-classifier.orb +402 -0
  102. package/dist/exports/atoms/std-agent-completion.orb +469 -0
  103. package/dist/exports/atoms/std-agent-context-window.orb +790 -0
  104. package/dist/exports/atoms/std-agent-conversation.orb +737 -0
  105. package/dist/exports/atoms/std-agent-memory.orb +627 -0
  106. package/dist/exports/atoms/std-agent-provider.orb +402 -0
  107. package/dist/exports/atoms/std-agent-search.orb +418 -0
  108. package/dist/exports/atoms/std-agent-session.orb +825 -0
  109. package/dist/exports/atoms/std-agent-tool-call.orb +380 -0
  110. package/dist/exports/atoms/std-wizard.orb +63 -70
  111. package/dist/exports/molecules/std-agent-fix-loop.orb +1213 -0
  112. package/dist/exports/molecules/std-agent-learner.orb +1143 -0
  113. package/dist/exports/molecules/std-agent-planner.orb +898 -0
  114. package/dist/exports/molecules/std-agent-rag.orb +736 -0
  115. package/dist/exports/molecules/std-agent-tool-loop.orb +1237 -0
  116. package/dist/exports/molecules/std-detail.orb +4 -0
  117. package/dist/exports/molecules/std-geospatial.orb +4 -0
  118. package/dist/exports/molecules/std-inventory.orb +8 -0
  119. package/dist/exports/molecules/std-list.orb +18 -1
  120. package/dist/exports/molecules/std-messaging.orb +4 -0
  121. package/dist/exports/organisms/std-agent-assistant.orb +2288 -0
  122. package/dist/exports/organisms/std-agent-builder.orb +2664 -0
  123. package/dist/exports/organisms/std-agent-pipeline.orb +2307 -0
  124. package/dist/exports/organisms/std-agent-reviewer.orb +1743 -0
  125. package/dist/exports/organisms/std-agent-tutor.orb +2303 -0
  126. package/dist/exports/organisms/std-api-gateway.orb +18 -1
  127. package/dist/exports/organisms/std-booking-system.orb +131 -104
  128. package/dist/exports/organisms/std-cicd-pipeline.orb +18 -1
  129. package/dist/exports/organisms/std-cms.orb +40 -2
  130. package/dist/exports/organisms/std-crm.orb +40 -2
  131. package/dist/exports/organisms/std-devops-dashboard.orb +18 -1
  132. package/dist/exports/organisms/std-finance-tracker.orb +22 -1
  133. package/dist/exports/organisms/std-healthcare.orb +167 -136
  134. package/dist/exports/organisms/std-helpdesk.orb +22 -1
  135. package/dist/exports/organisms/std-hr-portal.orb +115 -88
  136. package/dist/exports/organisms/std-iot-dashboard.orb +18 -1
  137. package/dist/exports/organisms/std-lms.orb +97 -87
  138. package/dist/exports/organisms/std-platformer-app.orb +8 -0
  139. package/dist/exports/organisms/std-project-manager.orb +36 -2
  140. package/dist/exports/organisms/std-realtime-chat.orb +22 -1
  141. package/dist/exports/organisms/std-rpg-game.orb +8 -0
  142. package/dist/exports/organisms/std-service-marketplace.orb +36 -2
  143. package/dist/exports/organisms/std-social-feed.orb +8 -0
  144. package/dist/exports/organisms/std-trading-dashboard.orb +18 -1
  145. package/dist/exports/validation-report.json +1425 -0
  146. package/dist/index.d.ts +1 -1
  147. package/dist/index.js +6348 -178
  148. package/dist/index.js.map +1 -1
  149. package/package.json +1 -1
@@ -0,0 +1,2303 @@
1
+ {
2
+ "name": "AI Tutor",
3
+ "version": "1.0.0",
4
+ "orbitals": [
5
+ {
6
+ "name": "TutorSessionOrbital",
7
+ "entity": {
8
+ "name": "TutorSession",
9
+ "persistence": "runtime",
10
+ "fields": [
11
+ {
12
+ "name": "id",
13
+ "type": "string",
14
+ "required": true
15
+ },
16
+ {
17
+ "name": "topic",
18
+ "type": "string",
19
+ "default": ""
20
+ },
21
+ {
22
+ "name": "studentLevel",
23
+ "type": "string",
24
+ "default": "unknown"
25
+ },
26
+ {
27
+ "name": "explanation",
28
+ "type": "string",
29
+ "default": ""
30
+ },
31
+ {
32
+ "name": "questionsAsked",
33
+ "type": "number",
34
+ "default": 0
35
+ },
36
+ {
37
+ "name": "correctAnswers",
38
+ "type": "number",
39
+ "default": 0
40
+ },
41
+ {
42
+ "name": "sessionStatus",
43
+ "type": "string",
44
+ "default": "idle"
45
+ },
46
+ {
47
+ "name": "error",
48
+ "type": "string",
49
+ "default": ""
50
+ }
51
+ ]
52
+ },
53
+ "traits": [
54
+ {
55
+ "name": "TeachingSession",
56
+ "linkedEntity": "TutorSession",
57
+ "category": "interaction",
58
+ "emits": [
59
+ {
60
+ "event": "ASSESSMENT_DONE",
61
+ "description": "Student level assessed",
62
+ "scope": "internal"
63
+ },
64
+ {
65
+ "event": "ASSESSMENT_DONE",
66
+ "description": "Student assessed, generate quiz",
67
+ "scope": "external"
68
+ }
69
+ ],
70
+ "stateMachine": {
71
+ "states": [
72
+ {
73
+ "name": "idle",
74
+ "isInitial": true
75
+ },
76
+ {
77
+ "name": "assessing"
78
+ },
79
+ {
80
+ "name": "teaching"
81
+ }
82
+ ],
83
+ "events": [
84
+ {
85
+ "key": "INIT",
86
+ "name": "Initialize"
87
+ },
88
+ {
89
+ "key": "START_SESSION",
90
+ "name": "Start Session",
91
+ "payload": [
92
+ {
93
+ "name": "topic",
94
+ "type": "string",
95
+ "required": true
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "key": "ASSESSMENT_COMPLETE",
101
+ "name": "Assessment Complete"
102
+ },
103
+ {
104
+ "key": "EXPLAIN_MORE",
105
+ "name": "Explain More"
106
+ },
107
+ {
108
+ "key": "START_QUIZ",
109
+ "name": "Start Quiz"
110
+ },
111
+ {
112
+ "key": "RESET",
113
+ "name": "Reset"
114
+ }
115
+ ],
116
+ "transitions": [
117
+ {
118
+ "from": "idle",
119
+ "to": "idle",
120
+ "event": "INIT",
121
+ "effects": [
122
+ [
123
+ "fetch",
124
+ "TutorSession"
125
+ ],
126
+ [
127
+ "render-ui",
128
+ "main",
129
+ {
130
+ "type": "dashboard-layout",
131
+ "appName": "AI Tutor",
132
+ "navItems": [
133
+ {
134
+ "label": "Teach",
135
+ "href": "/teach",
136
+ "icon": "book-open"
137
+ },
138
+ {
139
+ "label": "Quiz",
140
+ "href": "/quiz",
141
+ "icon": "help-circle"
142
+ },
143
+ {
144
+ "label": "Concepts",
145
+ "href": "/concepts",
146
+ "icon": "brain"
147
+ }
148
+ ],
149
+ "children": [
150
+ {
151
+ "type": "stack",
152
+ "direction": "vertical",
153
+ "gap": "lg",
154
+ "children": [
155
+ {
156
+ "type": "stack",
157
+ "direction": "horizontal",
158
+ "gap": "sm",
159
+ "align": "center",
160
+ "children": [
161
+ {
162
+ "type": "icon",
163
+ "name": "graduation-cap",
164
+ "size": "lg"
165
+ },
166
+ {
167
+ "type": "typography",
168
+ "content": "Tutor",
169
+ "variant": "h2"
170
+ }
171
+ ]
172
+ },
173
+ {
174
+ "type": "divider"
175
+ },
176
+ {
177
+ "type": "card",
178
+ "children": [
179
+ {
180
+ "type": "stack",
181
+ "direction": "vertical",
182
+ "gap": "md",
183
+ "children": [
184
+ {
185
+ "type": "typography",
186
+ "content": "What topic would you like to learn about? The tutor will assess your level and guide you through it.",
187
+ "variant": "body"
188
+ },
189
+ {
190
+ "type": "form-section",
191
+ "entity": "TutorSession",
192
+ "mode": "edit",
193
+ "submitEvent": "START_SESSION",
194
+ "fields": [
195
+ "topic"
196
+ ]
197
+ }
198
+ ]
199
+ }
200
+ ]
201
+ }
202
+ ]
203
+ }
204
+ ]
205
+ }
206
+ ]
207
+ ]
208
+ },
209
+ {
210
+ "from": "idle",
211
+ "to": "assessing",
212
+ "event": "START_SESSION",
213
+ "effects": [
214
+ [
215
+ "set",
216
+ "@entity.topic",
217
+ "@payload.topic"
218
+ ],
219
+ [
220
+ "set",
221
+ "@entity.sessionStatus",
222
+ "assessing"
223
+ ],
224
+ [
225
+ "agent/recall",
226
+ "@payload.topic"
227
+ ],
228
+ [
229
+ "agent/generate",
230
+ "@payload.topic"
231
+ ],
232
+ [
233
+ "render-ui",
234
+ "main",
235
+ {
236
+ "type": "dashboard-layout",
237
+ "appName": "AI Tutor",
238
+ "navItems": [
239
+ {
240
+ "label": "Teach",
241
+ "href": "/teach",
242
+ "icon": "book-open"
243
+ },
244
+ {
245
+ "label": "Quiz",
246
+ "href": "/quiz",
247
+ "icon": "help-circle"
248
+ },
249
+ {
250
+ "label": "Concepts",
251
+ "href": "/concepts",
252
+ "icon": "brain"
253
+ }
254
+ ],
255
+ "children": [
256
+ {
257
+ "type": "stack",
258
+ "direction": "vertical",
259
+ "gap": "lg",
260
+ "align": "center",
261
+ "children": [
262
+ {
263
+ "type": "icon",
264
+ "name": "search",
265
+ "size": "lg"
266
+ },
267
+ {
268
+ "type": "typography",
269
+ "content": "Assessing your level...",
270
+ "variant": "h3"
271
+ },
272
+ {
273
+ "type": "spinner",
274
+ "size": "lg"
275
+ },
276
+ {
277
+ "type": "typography",
278
+ "content": "Recalling prior learning and classifying skill level",
279
+ "variant": "caption"
280
+ }
281
+ ]
282
+ }
283
+ ]
284
+ }
285
+ ]
286
+ ]
287
+ },
288
+ {
289
+ "from": "assessing",
290
+ "to": "teaching",
291
+ "event": "ASSESSMENT_COMPLETE",
292
+ "effects": [
293
+ [
294
+ "set",
295
+ "@entity.sessionStatus",
296
+ "teaching"
297
+ ],
298
+ [
299
+ "agent/memorize",
300
+ "@entity.topic",
301
+ "student-level"
302
+ ],
303
+ [
304
+ "emit",
305
+ "ASSESSMENT_DONE"
306
+ ],
307
+ [
308
+ "render-ui",
309
+ "main",
310
+ {
311
+ "type": "dashboard-layout",
312
+ "appName": "AI Tutor",
313
+ "navItems": [
314
+ {
315
+ "label": "Teach",
316
+ "href": "/teach",
317
+ "icon": "book-open"
318
+ },
319
+ {
320
+ "label": "Quiz",
321
+ "href": "/quiz",
322
+ "icon": "help-circle"
323
+ },
324
+ {
325
+ "label": "Concepts",
326
+ "href": "/concepts",
327
+ "icon": "brain"
328
+ }
329
+ ],
330
+ "children": [
331
+ {
332
+ "type": "stack",
333
+ "direction": "vertical",
334
+ "gap": "lg",
335
+ "children": [
336
+ {
337
+ "type": "stack",
338
+ "direction": "horizontal",
339
+ "gap": "sm",
340
+ "align": "center",
341
+ "justify": "space-between",
342
+ "children": [
343
+ {
344
+ "type": "stack",
345
+ "direction": "horizontal",
346
+ "gap": "sm",
347
+ "align": "center",
348
+ "children": [
349
+ {
350
+ "type": "icon",
351
+ "name": "book-open",
352
+ "size": "lg"
353
+ },
354
+ {
355
+ "type": "typography",
356
+ "content": "Lesson: @entity.topic",
357
+ "variant": "h2"
358
+ }
359
+ ]
360
+ },
361
+ {
362
+ "type": "badge",
363
+ "label": "@entity.studentLevel"
364
+ }
365
+ ]
366
+ },
367
+ {
368
+ "type": "divider"
369
+ },
370
+ {
371
+ "type": "card",
372
+ "children": [
373
+ {
374
+ "type": "stack",
375
+ "direction": "vertical",
376
+ "gap": "md",
377
+ "children": [
378
+ {
379
+ "type": "typography",
380
+ "content": "@entity.explanation",
381
+ "variant": "body"
382
+ }
383
+ ]
384
+ }
385
+ ]
386
+ },
387
+ {
388
+ "type": "stack",
389
+ "direction": "horizontal",
390
+ "gap": "sm",
391
+ "children": [
392
+ {
393
+ "type": "button",
394
+ "label": "Quiz Me",
395
+ "event": "START_QUIZ",
396
+ "variant": "primary",
397
+ "icon": "help-circle"
398
+ },
399
+ {
400
+ "type": "button",
401
+ "label": "Explain More",
402
+ "event": "EXPLAIN_MORE",
403
+ "variant": "secondary",
404
+ "icon": "book-open"
405
+ },
406
+ {
407
+ "type": "button",
408
+ "label": "New Topic",
409
+ "event": "RESET",
410
+ "variant": "ghost",
411
+ "icon": "rotate-ccw"
412
+ }
413
+ ]
414
+ },
415
+ {
416
+ "type": "stack",
417
+ "direction": "horizontal",
418
+ "gap": "xs",
419
+ "children": [
420
+ {
421
+ "type": "badge",
422
+ "label": "@entity.questionsAsked"
423
+ },
424
+ {
425
+ "type": "badge",
426
+ "label": "@entity.correctAnswers"
427
+ }
428
+ ]
429
+ }
430
+ ]
431
+ }
432
+ ]
433
+ }
434
+ ]
435
+ ]
436
+ },
437
+ {
438
+ "from": "teaching",
439
+ "to": "teaching",
440
+ "event": "EXPLAIN_MORE",
441
+ "effects": [
442
+ [
443
+ "agent/generate",
444
+ "@entity.topic"
445
+ ],
446
+ [
447
+ "render-ui",
448
+ "main",
449
+ {
450
+ "type": "dashboard-layout",
451
+ "appName": "AI Tutor",
452
+ "navItems": [
453
+ {
454
+ "label": "Teach",
455
+ "href": "/teach",
456
+ "icon": "book-open"
457
+ },
458
+ {
459
+ "label": "Quiz",
460
+ "href": "/quiz",
461
+ "icon": "help-circle"
462
+ },
463
+ {
464
+ "label": "Concepts",
465
+ "href": "/concepts",
466
+ "icon": "brain"
467
+ }
468
+ ],
469
+ "children": [
470
+ {
471
+ "type": "stack",
472
+ "direction": "vertical",
473
+ "gap": "lg",
474
+ "children": [
475
+ {
476
+ "type": "stack",
477
+ "direction": "horizontal",
478
+ "gap": "sm",
479
+ "align": "center",
480
+ "justify": "space-between",
481
+ "children": [
482
+ {
483
+ "type": "stack",
484
+ "direction": "horizontal",
485
+ "gap": "sm",
486
+ "align": "center",
487
+ "children": [
488
+ {
489
+ "type": "icon",
490
+ "name": "book-open",
491
+ "size": "lg"
492
+ },
493
+ {
494
+ "type": "typography",
495
+ "content": "Lesson: @entity.topic",
496
+ "variant": "h2"
497
+ }
498
+ ]
499
+ },
500
+ {
501
+ "type": "badge",
502
+ "label": "@entity.studentLevel"
503
+ }
504
+ ]
505
+ },
506
+ {
507
+ "type": "divider"
508
+ },
509
+ {
510
+ "type": "card",
511
+ "children": [
512
+ {
513
+ "type": "stack",
514
+ "direction": "vertical",
515
+ "gap": "md",
516
+ "children": [
517
+ {
518
+ "type": "typography",
519
+ "content": "@entity.explanation",
520
+ "variant": "body"
521
+ }
522
+ ]
523
+ }
524
+ ]
525
+ },
526
+ {
527
+ "type": "stack",
528
+ "direction": "horizontal",
529
+ "gap": "sm",
530
+ "children": [
531
+ {
532
+ "type": "button",
533
+ "label": "Quiz Me",
534
+ "event": "START_QUIZ",
535
+ "variant": "primary",
536
+ "icon": "help-circle"
537
+ },
538
+ {
539
+ "type": "button",
540
+ "label": "Explain More",
541
+ "event": "EXPLAIN_MORE",
542
+ "variant": "secondary",
543
+ "icon": "book-open"
544
+ },
545
+ {
546
+ "type": "button",
547
+ "label": "New Topic",
548
+ "event": "RESET",
549
+ "variant": "ghost",
550
+ "icon": "rotate-ccw"
551
+ }
552
+ ]
553
+ },
554
+ {
555
+ "type": "stack",
556
+ "direction": "horizontal",
557
+ "gap": "xs",
558
+ "children": [
559
+ {
560
+ "type": "badge",
561
+ "label": "@entity.questionsAsked"
562
+ },
563
+ {
564
+ "type": "badge",
565
+ "label": "@entity.correctAnswers"
566
+ }
567
+ ]
568
+ }
569
+ ]
570
+ }
571
+ ]
572
+ }
573
+ ]
574
+ ]
575
+ },
576
+ {
577
+ "from": "teaching",
578
+ "to": "teaching",
579
+ "event": "START_QUIZ",
580
+ "effects": [
581
+ [
582
+ "emit",
583
+ "ASSESSMENT_DONE"
584
+ ],
585
+ [
586
+ "render-ui",
587
+ "main",
588
+ {
589
+ "type": "dashboard-layout",
590
+ "appName": "AI Tutor",
591
+ "navItems": [
592
+ {
593
+ "label": "Teach",
594
+ "href": "/teach",
595
+ "icon": "book-open"
596
+ },
597
+ {
598
+ "label": "Quiz",
599
+ "href": "/quiz",
600
+ "icon": "help-circle"
601
+ },
602
+ {
603
+ "label": "Concepts",
604
+ "href": "/concepts",
605
+ "icon": "brain"
606
+ }
607
+ ],
608
+ "children": [
609
+ {
610
+ "type": "stack",
611
+ "direction": "vertical",
612
+ "gap": "lg",
613
+ "children": [
614
+ {
615
+ "type": "stack",
616
+ "direction": "horizontal",
617
+ "gap": "sm",
618
+ "align": "center",
619
+ "justify": "space-between",
620
+ "children": [
621
+ {
622
+ "type": "stack",
623
+ "direction": "horizontal",
624
+ "gap": "sm",
625
+ "align": "center",
626
+ "children": [
627
+ {
628
+ "type": "icon",
629
+ "name": "book-open",
630
+ "size": "lg"
631
+ },
632
+ {
633
+ "type": "typography",
634
+ "content": "Lesson: @entity.topic",
635
+ "variant": "h2"
636
+ }
637
+ ]
638
+ },
639
+ {
640
+ "type": "badge",
641
+ "label": "@entity.studentLevel"
642
+ }
643
+ ]
644
+ },
645
+ {
646
+ "type": "divider"
647
+ },
648
+ {
649
+ "type": "card",
650
+ "children": [
651
+ {
652
+ "type": "stack",
653
+ "direction": "vertical",
654
+ "gap": "md",
655
+ "children": [
656
+ {
657
+ "type": "typography",
658
+ "content": "@entity.explanation",
659
+ "variant": "body"
660
+ }
661
+ ]
662
+ }
663
+ ]
664
+ },
665
+ {
666
+ "type": "stack",
667
+ "direction": "horizontal",
668
+ "gap": "sm",
669
+ "children": [
670
+ {
671
+ "type": "button",
672
+ "label": "Quiz Me",
673
+ "event": "START_QUIZ",
674
+ "variant": "primary",
675
+ "icon": "help-circle"
676
+ },
677
+ {
678
+ "type": "button",
679
+ "label": "Explain More",
680
+ "event": "EXPLAIN_MORE",
681
+ "variant": "secondary",
682
+ "icon": "book-open"
683
+ },
684
+ {
685
+ "type": "button",
686
+ "label": "New Topic",
687
+ "event": "RESET",
688
+ "variant": "ghost",
689
+ "icon": "rotate-ccw"
690
+ }
691
+ ]
692
+ },
693
+ {
694
+ "type": "stack",
695
+ "direction": "horizontal",
696
+ "gap": "xs",
697
+ "children": [
698
+ {
699
+ "type": "badge",
700
+ "label": "@entity.questionsAsked"
701
+ },
702
+ {
703
+ "type": "badge",
704
+ "label": "@entity.correctAnswers"
705
+ }
706
+ ]
707
+ }
708
+ ]
709
+ }
710
+ ]
711
+ }
712
+ ]
713
+ ]
714
+ },
715
+ {
716
+ "from": "teaching",
717
+ "to": "idle",
718
+ "event": "RESET",
719
+ "effects": [
720
+ [
721
+ "set",
722
+ "@entity.sessionStatus",
723
+ "idle"
724
+ ],
725
+ [
726
+ "set",
727
+ "@entity.topic",
728
+ ""
729
+ ],
730
+ [
731
+ "set",
732
+ "@entity.explanation",
733
+ ""
734
+ ],
735
+ [
736
+ "set",
737
+ "@entity.questionsAsked",
738
+ 0
739
+ ],
740
+ [
741
+ "set",
742
+ "@entity.correctAnswers",
743
+ 0
744
+ ],
745
+ [
746
+ "render-ui",
747
+ "main",
748
+ {
749
+ "type": "dashboard-layout",
750
+ "appName": "AI Tutor",
751
+ "navItems": [
752
+ {
753
+ "label": "Teach",
754
+ "href": "/teach",
755
+ "icon": "book-open"
756
+ },
757
+ {
758
+ "label": "Quiz",
759
+ "href": "/quiz",
760
+ "icon": "help-circle"
761
+ },
762
+ {
763
+ "label": "Concepts",
764
+ "href": "/concepts",
765
+ "icon": "brain"
766
+ }
767
+ ],
768
+ "children": [
769
+ {
770
+ "type": "stack",
771
+ "direction": "vertical",
772
+ "gap": "lg",
773
+ "children": [
774
+ {
775
+ "type": "stack",
776
+ "direction": "horizontal",
777
+ "gap": "sm",
778
+ "align": "center",
779
+ "children": [
780
+ {
781
+ "type": "icon",
782
+ "name": "graduation-cap",
783
+ "size": "lg"
784
+ },
785
+ {
786
+ "type": "typography",
787
+ "content": "Tutor",
788
+ "variant": "h2"
789
+ }
790
+ ]
791
+ },
792
+ {
793
+ "type": "divider"
794
+ },
795
+ {
796
+ "type": "card",
797
+ "children": [
798
+ {
799
+ "type": "stack",
800
+ "direction": "vertical",
801
+ "gap": "md",
802
+ "children": [
803
+ {
804
+ "type": "typography",
805
+ "content": "What topic would you like to learn about? The tutor will assess your level and guide you through it.",
806
+ "variant": "body"
807
+ },
808
+ {
809
+ "type": "form-section",
810
+ "entity": "TutorSession",
811
+ "mode": "edit",
812
+ "submitEvent": "START_SESSION",
813
+ "fields": [
814
+ "topic"
815
+ ]
816
+ }
817
+ ]
818
+ }
819
+ ]
820
+ }
821
+ ]
822
+ }
823
+ ]
824
+ }
825
+ ]
826
+ ]
827
+ }
828
+ ]
829
+ }
830
+ }
831
+ ],
832
+ "pages": [
833
+ {
834
+ "name": "TeachPage",
835
+ "path": "/teach",
836
+ "isInitial": true,
837
+ "traits": [
838
+ {
839
+ "ref": "TeachingSession"
840
+ }
841
+ ]
842
+ }
843
+ ]
844
+ },
845
+ {
846
+ "name": "QuizQuestionOrbital",
847
+ "entity": {
848
+ "name": "QuizQuestion",
849
+ "persistence": "runtime",
850
+ "fields": [
851
+ {
852
+ "name": "id",
853
+ "type": "string",
854
+ "required": true
855
+ },
856
+ {
857
+ "name": "question",
858
+ "type": "string",
859
+ "default": ""
860
+ },
861
+ {
862
+ "name": "options",
863
+ "type": "string",
864
+ "default": "[]"
865
+ },
866
+ {
867
+ "name": "correctAnswer",
868
+ "type": "string",
869
+ "default": ""
870
+ },
871
+ {
872
+ "name": "studentAnswer",
873
+ "type": "string",
874
+ "default": ""
875
+ },
876
+ {
877
+ "name": "isCorrect",
878
+ "type": "boolean",
879
+ "default": false
880
+ },
881
+ {
882
+ "name": "feedback",
883
+ "type": "string",
884
+ "default": ""
885
+ },
886
+ {
887
+ "name": "quizStatus",
888
+ "type": "string",
889
+ "default": "idle"
890
+ }
891
+ ]
892
+ },
893
+ "traits": [
894
+ {
895
+ "name": "QuizEngine",
896
+ "linkedEntity": "QuizQuestion",
897
+ "category": "interaction",
898
+ "emits": [
899
+ {
900
+ "event": "QUIZ_GRADED",
901
+ "description": "Answer graded, reinforce or decay concept",
902
+ "scope": "internal"
903
+ },
904
+ {
905
+ "event": "QUIZ_GRADED",
906
+ "description": "Reinforce or decay concept based on answer",
907
+ "scope": "external"
908
+ }
909
+ ],
910
+ "stateMachine": {
911
+ "states": [
912
+ {
913
+ "name": "idle",
914
+ "isInitial": true
915
+ },
916
+ {
917
+ "name": "quizzing"
918
+ },
919
+ {
920
+ "name": "reviewing"
921
+ }
922
+ ],
923
+ "events": [
924
+ {
925
+ "key": "INIT",
926
+ "name": "Initialize"
927
+ },
928
+ {
929
+ "key": "GENERATE_QUESTION",
930
+ "name": "Generate Question"
931
+ },
932
+ {
933
+ "key": "QUESTION_READY",
934
+ "name": "Question Ready"
935
+ },
936
+ {
937
+ "key": "SUBMIT_ANSWER",
938
+ "name": "Submit Answer",
939
+ "payload": [
940
+ {
941
+ "name": "studentAnswer",
942
+ "type": "string",
943
+ "required": true
944
+ }
945
+ ]
946
+ },
947
+ {
948
+ "key": "NEXT_QUESTION",
949
+ "name": "Next Question"
950
+ },
951
+ {
952
+ "key": "BACK_TO_LESSON",
953
+ "name": "Back to Lesson"
954
+ }
955
+ ],
956
+ "transitions": [
957
+ {
958
+ "from": "idle",
959
+ "to": "idle",
960
+ "event": "INIT",
961
+ "effects": [
962
+ [
963
+ "fetch",
964
+ "QuizQuestion"
965
+ ],
966
+ [
967
+ "render-ui",
968
+ "main",
969
+ {
970
+ "type": "dashboard-layout",
971
+ "appName": "AI Tutor",
972
+ "navItems": [
973
+ {
974
+ "label": "Teach",
975
+ "href": "/teach",
976
+ "icon": "book-open"
977
+ },
978
+ {
979
+ "label": "Quiz",
980
+ "href": "/quiz",
981
+ "icon": "help-circle"
982
+ },
983
+ {
984
+ "label": "Concepts",
985
+ "href": "/concepts",
986
+ "icon": "brain"
987
+ }
988
+ ],
989
+ "children": [
990
+ {
991
+ "type": "stack",
992
+ "direction": "vertical",
993
+ "gap": "lg",
994
+ "children": [
995
+ {
996
+ "type": "stack",
997
+ "direction": "horizontal",
998
+ "gap": "sm",
999
+ "align": "center",
1000
+ "children": [
1001
+ {
1002
+ "type": "icon",
1003
+ "name": "help-circle",
1004
+ "size": "lg"
1005
+ },
1006
+ {
1007
+ "type": "typography",
1008
+ "content": "Quiz",
1009
+ "variant": "h2"
1010
+ }
1011
+ ]
1012
+ },
1013
+ {
1014
+ "type": "divider"
1015
+ },
1016
+ {
1017
+ "type": "typography",
1018
+ "content": "Waiting for a quiz to start...",
1019
+ "variant": "body"
1020
+ }
1021
+ ]
1022
+ }
1023
+ ]
1024
+ }
1025
+ ]
1026
+ ]
1027
+ },
1028
+ {
1029
+ "from": "idle",
1030
+ "to": "quizzing",
1031
+ "event": "GENERATE_QUESTION",
1032
+ "effects": [
1033
+ [
1034
+ "set",
1035
+ "@entity.quizStatus",
1036
+ "generating"
1037
+ ],
1038
+ [
1039
+ "agent/generate",
1040
+ "@entity.question"
1041
+ ],
1042
+ [
1043
+ "render-ui",
1044
+ "main",
1045
+ {
1046
+ "type": "dashboard-layout",
1047
+ "appName": "AI Tutor",
1048
+ "navItems": [
1049
+ {
1050
+ "label": "Teach",
1051
+ "href": "/teach",
1052
+ "icon": "book-open"
1053
+ },
1054
+ {
1055
+ "label": "Quiz",
1056
+ "href": "/quiz",
1057
+ "icon": "help-circle"
1058
+ },
1059
+ {
1060
+ "label": "Concepts",
1061
+ "href": "/concepts",
1062
+ "icon": "brain"
1063
+ }
1064
+ ],
1065
+ "children": [
1066
+ {
1067
+ "type": "stack",
1068
+ "direction": "vertical",
1069
+ "gap": "lg",
1070
+ "children": [
1071
+ {
1072
+ "type": "stack",
1073
+ "direction": "horizontal",
1074
+ "gap": "sm",
1075
+ "align": "center",
1076
+ "children": [
1077
+ {
1078
+ "type": "icon",
1079
+ "name": "help-circle",
1080
+ "size": "lg"
1081
+ },
1082
+ {
1083
+ "type": "typography",
1084
+ "content": "Quiz Question",
1085
+ "variant": "h2"
1086
+ }
1087
+ ]
1088
+ },
1089
+ {
1090
+ "type": "divider"
1091
+ },
1092
+ {
1093
+ "type": "card",
1094
+ "children": [
1095
+ {
1096
+ "type": "stack",
1097
+ "direction": "vertical",
1098
+ "gap": "md",
1099
+ "children": [
1100
+ {
1101
+ "type": "typography",
1102
+ "content": "@entity.question",
1103
+ "variant": "h3"
1104
+ },
1105
+ {
1106
+ "type": "typography",
1107
+ "content": "@entity.options",
1108
+ "variant": "body"
1109
+ },
1110
+ {
1111
+ "type": "form-section",
1112
+ "entity": "QuizQuestion",
1113
+ "mode": "edit",
1114
+ "submitEvent": "SUBMIT_ANSWER",
1115
+ "fields": [
1116
+ "studentAnswer"
1117
+ ]
1118
+ }
1119
+ ]
1120
+ }
1121
+ ]
1122
+ }
1123
+ ]
1124
+ }
1125
+ ]
1126
+ }
1127
+ ]
1128
+ ]
1129
+ },
1130
+ {
1131
+ "from": "quizzing",
1132
+ "to": "quizzing",
1133
+ "event": "QUESTION_READY",
1134
+ "effects": [
1135
+ [
1136
+ "set",
1137
+ "@entity.quizStatus",
1138
+ "waiting"
1139
+ ],
1140
+ [
1141
+ "render-ui",
1142
+ "main",
1143
+ {
1144
+ "type": "dashboard-layout",
1145
+ "appName": "AI Tutor",
1146
+ "navItems": [
1147
+ {
1148
+ "label": "Teach",
1149
+ "href": "/teach",
1150
+ "icon": "book-open"
1151
+ },
1152
+ {
1153
+ "label": "Quiz",
1154
+ "href": "/quiz",
1155
+ "icon": "help-circle"
1156
+ },
1157
+ {
1158
+ "label": "Concepts",
1159
+ "href": "/concepts",
1160
+ "icon": "brain"
1161
+ }
1162
+ ],
1163
+ "children": [
1164
+ {
1165
+ "type": "stack",
1166
+ "direction": "vertical",
1167
+ "gap": "lg",
1168
+ "children": [
1169
+ {
1170
+ "type": "stack",
1171
+ "direction": "horizontal",
1172
+ "gap": "sm",
1173
+ "align": "center",
1174
+ "children": [
1175
+ {
1176
+ "type": "icon",
1177
+ "name": "help-circle",
1178
+ "size": "lg"
1179
+ },
1180
+ {
1181
+ "type": "typography",
1182
+ "content": "Quiz Question",
1183
+ "variant": "h2"
1184
+ }
1185
+ ]
1186
+ },
1187
+ {
1188
+ "type": "divider"
1189
+ },
1190
+ {
1191
+ "type": "card",
1192
+ "children": [
1193
+ {
1194
+ "type": "stack",
1195
+ "direction": "vertical",
1196
+ "gap": "md",
1197
+ "children": [
1198
+ {
1199
+ "type": "typography",
1200
+ "content": "@entity.question",
1201
+ "variant": "h3"
1202
+ },
1203
+ {
1204
+ "type": "typography",
1205
+ "content": "@entity.options",
1206
+ "variant": "body"
1207
+ },
1208
+ {
1209
+ "type": "form-section",
1210
+ "entity": "QuizQuestion",
1211
+ "mode": "edit",
1212
+ "submitEvent": "SUBMIT_ANSWER",
1213
+ "fields": [
1214
+ "studentAnswer"
1215
+ ]
1216
+ }
1217
+ ]
1218
+ }
1219
+ ]
1220
+ }
1221
+ ]
1222
+ }
1223
+ ]
1224
+ }
1225
+ ]
1226
+ ]
1227
+ },
1228
+ {
1229
+ "from": "quizzing",
1230
+ "to": "reviewing",
1231
+ "event": "SUBMIT_ANSWER",
1232
+ "effects": [
1233
+ [
1234
+ "set",
1235
+ "@entity.studentAnswer",
1236
+ "@payload.studentAnswer"
1237
+ ],
1238
+ [
1239
+ "set",
1240
+ "@entity.quizStatus",
1241
+ "grading"
1242
+ ],
1243
+ [
1244
+ "agent/generate",
1245
+ "@payload.studentAnswer"
1246
+ ],
1247
+ [
1248
+ "emit",
1249
+ "QUIZ_GRADED"
1250
+ ],
1251
+ [
1252
+ "render-ui",
1253
+ "main",
1254
+ {
1255
+ "type": "dashboard-layout",
1256
+ "appName": "AI Tutor",
1257
+ "navItems": [
1258
+ {
1259
+ "label": "Teach",
1260
+ "href": "/teach",
1261
+ "icon": "book-open"
1262
+ },
1263
+ {
1264
+ "label": "Quiz",
1265
+ "href": "/quiz",
1266
+ "icon": "help-circle"
1267
+ },
1268
+ {
1269
+ "label": "Concepts",
1270
+ "href": "/concepts",
1271
+ "icon": "brain"
1272
+ }
1273
+ ],
1274
+ "children": [
1275
+ {
1276
+ "type": "stack",
1277
+ "direction": "vertical",
1278
+ "gap": "lg",
1279
+ "children": [
1280
+ {
1281
+ "type": "stack",
1282
+ "direction": "horizontal",
1283
+ "gap": "sm",
1284
+ "align": "center",
1285
+ "children": [
1286
+ {
1287
+ "type": "icon",
1288
+ "name": "check-circle",
1289
+ "size": "lg"
1290
+ },
1291
+ {
1292
+ "type": "typography",
1293
+ "content": "Answer Review",
1294
+ "variant": "h2"
1295
+ }
1296
+ ]
1297
+ },
1298
+ {
1299
+ "type": "divider"
1300
+ },
1301
+ {
1302
+ "type": "card",
1303
+ "children": [
1304
+ {
1305
+ "type": "stack",
1306
+ "direction": "vertical",
1307
+ "gap": "md",
1308
+ "children": [
1309
+ {
1310
+ "type": "stack",
1311
+ "direction": "horizontal",
1312
+ "gap": "sm",
1313
+ "children": [
1314
+ {
1315
+ "type": "badge",
1316
+ "label": "@entity.isCorrect"
1317
+ }
1318
+ ]
1319
+ },
1320
+ {
1321
+ "type": "typography",
1322
+ "content": "@entity.feedback",
1323
+ "variant": "body"
1324
+ },
1325
+ {
1326
+ "type": "typography",
1327
+ "content": "Correct answer",
1328
+ "variant": "caption"
1329
+ },
1330
+ {
1331
+ "type": "typography",
1332
+ "content": "@entity.correctAnswer",
1333
+ "variant": "body"
1334
+ }
1335
+ ]
1336
+ }
1337
+ ]
1338
+ },
1339
+ {
1340
+ "type": "stack",
1341
+ "direction": "horizontal",
1342
+ "gap": "sm",
1343
+ "children": [
1344
+ {
1345
+ "type": "button",
1346
+ "label": "Next Question",
1347
+ "event": "NEXT_QUESTION",
1348
+ "variant": "primary",
1349
+ "icon": "arrow-right"
1350
+ },
1351
+ {
1352
+ "type": "button",
1353
+ "label": "Back to Lesson",
1354
+ "event": "BACK_TO_LESSON",
1355
+ "variant": "ghost",
1356
+ "icon": "book-open"
1357
+ }
1358
+ ]
1359
+ }
1360
+ ]
1361
+ }
1362
+ ]
1363
+ }
1364
+ ]
1365
+ ]
1366
+ },
1367
+ {
1368
+ "from": "reviewing",
1369
+ "to": "quizzing",
1370
+ "event": "NEXT_QUESTION",
1371
+ "effects": [
1372
+ [
1373
+ "set",
1374
+ "@entity.quizStatus",
1375
+ "generating"
1376
+ ],
1377
+ [
1378
+ "set",
1379
+ "@entity.studentAnswer",
1380
+ ""
1381
+ ],
1382
+ [
1383
+ "set",
1384
+ "@entity.feedback",
1385
+ ""
1386
+ ],
1387
+ [
1388
+ "agent/generate",
1389
+ "@entity.question"
1390
+ ],
1391
+ [
1392
+ "render-ui",
1393
+ "main",
1394
+ {
1395
+ "type": "dashboard-layout",
1396
+ "appName": "AI Tutor",
1397
+ "navItems": [
1398
+ {
1399
+ "label": "Teach",
1400
+ "href": "/teach",
1401
+ "icon": "book-open"
1402
+ },
1403
+ {
1404
+ "label": "Quiz",
1405
+ "href": "/quiz",
1406
+ "icon": "help-circle"
1407
+ },
1408
+ {
1409
+ "label": "Concepts",
1410
+ "href": "/concepts",
1411
+ "icon": "brain"
1412
+ }
1413
+ ],
1414
+ "children": [
1415
+ {
1416
+ "type": "stack",
1417
+ "direction": "vertical",
1418
+ "gap": "lg",
1419
+ "children": [
1420
+ {
1421
+ "type": "stack",
1422
+ "direction": "horizontal",
1423
+ "gap": "sm",
1424
+ "align": "center",
1425
+ "children": [
1426
+ {
1427
+ "type": "icon",
1428
+ "name": "help-circle",
1429
+ "size": "lg"
1430
+ },
1431
+ {
1432
+ "type": "typography",
1433
+ "content": "Quiz Question",
1434
+ "variant": "h2"
1435
+ }
1436
+ ]
1437
+ },
1438
+ {
1439
+ "type": "divider"
1440
+ },
1441
+ {
1442
+ "type": "card",
1443
+ "children": [
1444
+ {
1445
+ "type": "stack",
1446
+ "direction": "vertical",
1447
+ "gap": "md",
1448
+ "children": [
1449
+ {
1450
+ "type": "typography",
1451
+ "content": "@entity.question",
1452
+ "variant": "h3"
1453
+ },
1454
+ {
1455
+ "type": "typography",
1456
+ "content": "@entity.options",
1457
+ "variant": "body"
1458
+ },
1459
+ {
1460
+ "type": "form-section",
1461
+ "entity": "QuizQuestion",
1462
+ "mode": "edit",
1463
+ "submitEvent": "SUBMIT_ANSWER",
1464
+ "fields": [
1465
+ "studentAnswer"
1466
+ ]
1467
+ }
1468
+ ]
1469
+ }
1470
+ ]
1471
+ }
1472
+ ]
1473
+ }
1474
+ ]
1475
+ }
1476
+ ]
1477
+ ]
1478
+ },
1479
+ {
1480
+ "from": "reviewing",
1481
+ "to": "idle",
1482
+ "event": "BACK_TO_LESSON",
1483
+ "effects": [
1484
+ [
1485
+ "set",
1486
+ "@entity.quizStatus",
1487
+ "idle"
1488
+ ],
1489
+ [
1490
+ "render-ui",
1491
+ "main",
1492
+ {
1493
+ "type": "dashboard-layout",
1494
+ "appName": "AI Tutor",
1495
+ "navItems": [
1496
+ {
1497
+ "label": "Teach",
1498
+ "href": "/teach",
1499
+ "icon": "book-open"
1500
+ },
1501
+ {
1502
+ "label": "Quiz",
1503
+ "href": "/quiz",
1504
+ "icon": "help-circle"
1505
+ },
1506
+ {
1507
+ "label": "Concepts",
1508
+ "href": "/concepts",
1509
+ "icon": "brain"
1510
+ }
1511
+ ],
1512
+ "children": [
1513
+ {
1514
+ "type": "stack",
1515
+ "direction": "vertical",
1516
+ "gap": "lg",
1517
+ "children": [
1518
+ {
1519
+ "type": "stack",
1520
+ "direction": "horizontal",
1521
+ "gap": "sm",
1522
+ "align": "center",
1523
+ "children": [
1524
+ {
1525
+ "type": "icon",
1526
+ "name": "help-circle",
1527
+ "size": "lg"
1528
+ },
1529
+ {
1530
+ "type": "typography",
1531
+ "content": "Quiz",
1532
+ "variant": "h2"
1533
+ }
1534
+ ]
1535
+ },
1536
+ {
1537
+ "type": "divider"
1538
+ },
1539
+ {
1540
+ "type": "typography",
1541
+ "content": "Waiting for a quiz to start...",
1542
+ "variant": "body"
1543
+ }
1544
+ ]
1545
+ }
1546
+ ]
1547
+ }
1548
+ ]
1549
+ ]
1550
+ }
1551
+ ]
1552
+ },
1553
+ "listens": [
1554
+ {
1555
+ "event": "ASSESSMENT_DONE",
1556
+ "triggers": "GENERATE_QUESTION",
1557
+ "scope": "external"
1558
+ }
1559
+ ]
1560
+ }
1561
+ ],
1562
+ "pages": [
1563
+ {
1564
+ "name": "QuizPage",
1565
+ "path": "/quiz",
1566
+ "traits": [
1567
+ {
1568
+ "ref": "QuizEngine"
1569
+ }
1570
+ ]
1571
+ }
1572
+ ]
1573
+ },
1574
+ {
1575
+ "name": "ConceptOrbital",
1576
+ "entity": {
1577
+ "name": "Concept",
1578
+ "persistence": "persistent",
1579
+ "collection": "concepts",
1580
+ "fields": [
1581
+ {
1582
+ "name": "id",
1583
+ "type": "string",
1584
+ "required": true
1585
+ },
1586
+ {
1587
+ "name": "content",
1588
+ "type": "string",
1589
+ "default": ""
1590
+ },
1591
+ {
1592
+ "name": "category",
1593
+ "type": "string",
1594
+ "default": "general"
1595
+ },
1596
+ {
1597
+ "name": "strength",
1598
+ "type": "number",
1599
+ "default": 1
1600
+ },
1601
+ {
1602
+ "name": "pinned",
1603
+ "type": "boolean",
1604
+ "default": false
1605
+ },
1606
+ {
1607
+ "name": "scope",
1608
+ "type": "string",
1609
+ "default": "session"
1610
+ },
1611
+ {
1612
+ "name": "lastAccessedAt",
1613
+ "type": "string",
1614
+ "default": ""
1615
+ },
1616
+ {
1617
+ "name": "createdAt",
1618
+ "type": "string",
1619
+ "default": ""
1620
+ }
1621
+ ]
1622
+ },
1623
+ "traits": [
1624
+ {
1625
+ "name": "ConceptLifecycle",
1626
+ "linkedEntity": "Concept",
1627
+ "category": "interaction",
1628
+ "stateMachine": {
1629
+ "states": [
1630
+ {
1631
+ "name": "idle",
1632
+ "isInitial": true
1633
+ },
1634
+ {
1635
+ "name": "active"
1636
+ }
1637
+ ],
1638
+ "events": [
1639
+ {
1640
+ "key": "INIT",
1641
+ "name": "Initialize"
1642
+ },
1643
+ {
1644
+ "key": "MEMORIZE",
1645
+ "name": "Memorize",
1646
+ "payload": [
1647
+ {
1648
+ "name": "content",
1649
+ "type": "string",
1650
+ "required": true
1651
+ },
1652
+ {
1653
+ "name": "category",
1654
+ "type": "string",
1655
+ "required": false
1656
+ }
1657
+ ]
1658
+ },
1659
+ {
1660
+ "key": "RECALL",
1661
+ "name": "Recall",
1662
+ "payload": [
1663
+ {
1664
+ "name": "query",
1665
+ "type": "string",
1666
+ "required": true
1667
+ }
1668
+ ]
1669
+ },
1670
+ {
1671
+ "key": "PIN",
1672
+ "name": "Pin",
1673
+ "payload": [
1674
+ {
1675
+ "name": "id",
1676
+ "type": "string",
1677
+ "required": true
1678
+ }
1679
+ ]
1680
+ },
1681
+ {
1682
+ "key": "FORGET",
1683
+ "name": "Forget",
1684
+ "payload": [
1685
+ {
1686
+ "name": "id",
1687
+ "type": "string",
1688
+ "required": true
1689
+ }
1690
+ ]
1691
+ },
1692
+ {
1693
+ "key": "REINFORCE",
1694
+ "name": "Reinforce",
1695
+ "payload": [
1696
+ {
1697
+ "name": "id",
1698
+ "type": "string",
1699
+ "required": true
1700
+ }
1701
+ ]
1702
+ },
1703
+ {
1704
+ "key": "DECAY",
1705
+ "name": "Decay"
1706
+ }
1707
+ ],
1708
+ "transitions": [
1709
+ {
1710
+ "from": "idle",
1711
+ "to": "idle",
1712
+ "event": "INIT",
1713
+ "effects": [
1714
+ [
1715
+ "fetch",
1716
+ "Concept"
1717
+ ],
1718
+ [
1719
+ "render-ui",
1720
+ "main",
1721
+ {
1722
+ "type": "dashboard-layout",
1723
+ "appName": "AI Tutor",
1724
+ "navItems": [
1725
+ {
1726
+ "label": "Teach",
1727
+ "href": "/teach",
1728
+ "icon": "book-open"
1729
+ },
1730
+ {
1731
+ "label": "Quiz",
1732
+ "href": "/quiz",
1733
+ "icon": "help-circle"
1734
+ },
1735
+ {
1736
+ "label": "Concepts",
1737
+ "href": "/concepts",
1738
+ "icon": "brain"
1739
+ }
1740
+ ],
1741
+ "children": [
1742
+ {
1743
+ "type": "stack",
1744
+ "direction": "vertical",
1745
+ "gap": "lg",
1746
+ "children": [
1747
+ {
1748
+ "type": "stack",
1749
+ "direction": "horizontal",
1750
+ "gap": "sm",
1751
+ "align": "center",
1752
+ "children": [
1753
+ {
1754
+ "type": "icon",
1755
+ "name": "brain",
1756
+ "size": "lg"
1757
+ },
1758
+ {
1759
+ "type": "typography",
1760
+ "content": "Concept Manager",
1761
+ "variant": "h2"
1762
+ }
1763
+ ]
1764
+ },
1765
+ {
1766
+ "type": "divider"
1767
+ },
1768
+ {
1769
+ "type": "stack",
1770
+ "direction": "horizontal",
1771
+ "gap": "sm",
1772
+ "children": [
1773
+ {
1774
+ "type": "button",
1775
+ "label": "Memorize",
1776
+ "event": "MEMORIZE",
1777
+ "variant": "primary",
1778
+ "icon": "plus"
1779
+ },
1780
+ {
1781
+ "type": "button",
1782
+ "label": "Recall",
1783
+ "event": "RECALL",
1784
+ "variant": "secondary",
1785
+ "icon": "search"
1786
+ },
1787
+ {
1788
+ "type": "button",
1789
+ "label": "Decay All",
1790
+ "event": "DECAY",
1791
+ "variant": "ghost",
1792
+ "icon": "clock"
1793
+ }
1794
+ ]
1795
+ }
1796
+ ]
1797
+ }
1798
+ ]
1799
+ }
1800
+ ]
1801
+ ]
1802
+ },
1803
+ {
1804
+ "from": "idle",
1805
+ "to": "active",
1806
+ "event": "MEMORIZE",
1807
+ "effects": [
1808
+ [
1809
+ "agent/memorize",
1810
+ "@payload.content",
1811
+ "@payload.category"
1812
+ ],
1813
+ [
1814
+ "set",
1815
+ "@entity.content",
1816
+ "@payload.content"
1817
+ ],
1818
+ [
1819
+ "set",
1820
+ "@entity.category",
1821
+ "@payload.category"
1822
+ ],
1823
+ [
1824
+ "set",
1825
+ "@entity.createdAt",
1826
+ "@now"
1827
+ ],
1828
+ [
1829
+ "render-ui",
1830
+ "main",
1831
+ {
1832
+ "type": "dashboard-layout",
1833
+ "appName": "AI Tutor",
1834
+ "navItems": [
1835
+ {
1836
+ "label": "Teach",
1837
+ "href": "/teach",
1838
+ "icon": "book-open"
1839
+ },
1840
+ {
1841
+ "label": "Quiz",
1842
+ "href": "/quiz",
1843
+ "icon": "help-circle"
1844
+ },
1845
+ {
1846
+ "label": "Concepts",
1847
+ "href": "/concepts",
1848
+ "icon": "brain"
1849
+ }
1850
+ ],
1851
+ "children": [
1852
+ {
1853
+ "type": "stack",
1854
+ "direction": "vertical",
1855
+ "gap": "lg",
1856
+ "children": [
1857
+ {
1858
+ "type": "stack",
1859
+ "direction": "horizontal",
1860
+ "gap": "sm",
1861
+ "align": "center",
1862
+ "children": [
1863
+ {
1864
+ "type": "icon",
1865
+ "name": "brain",
1866
+ "size": "lg"
1867
+ },
1868
+ {
1869
+ "type": "typography",
1870
+ "content": "Concept Active",
1871
+ "variant": "h2"
1872
+ }
1873
+ ]
1874
+ },
1875
+ {
1876
+ "type": "divider"
1877
+ },
1878
+ {
1879
+ "type": "typography",
1880
+ "variant": "body",
1881
+ "content": "@entity.content"
1882
+ },
1883
+ {
1884
+ "type": "stack",
1885
+ "direction": "horizontal",
1886
+ "gap": "sm",
1887
+ "children": [
1888
+ {
1889
+ "type": "badge",
1890
+ "label": "@entity.category"
1891
+ },
1892
+ {
1893
+ "type": "badge",
1894
+ "label": "@entity.strength"
1895
+ }
1896
+ ]
1897
+ },
1898
+ {
1899
+ "type": "stack",
1900
+ "direction": "horizontal",
1901
+ "gap": "sm",
1902
+ "children": [
1903
+ {
1904
+ "type": "button",
1905
+ "label": "Pin",
1906
+ "event": "PIN",
1907
+ "variant": "secondary",
1908
+ "icon": "pin"
1909
+ },
1910
+ {
1911
+ "type": "button",
1912
+ "label": "Reinforce",
1913
+ "event": "REINFORCE",
1914
+ "variant": "secondary",
1915
+ "icon": "zap"
1916
+ },
1917
+ {
1918
+ "type": "button",
1919
+ "label": "Forget",
1920
+ "event": "FORGET",
1921
+ "variant": "destructive",
1922
+ "icon": "trash"
1923
+ }
1924
+ ]
1925
+ }
1926
+ ]
1927
+ }
1928
+ ]
1929
+ }
1930
+ ]
1931
+ ]
1932
+ },
1933
+ {
1934
+ "from": "idle",
1935
+ "to": "active",
1936
+ "event": "RECALL",
1937
+ "effects": [
1938
+ [
1939
+ "agent/recall",
1940
+ "@payload.query"
1941
+ ],
1942
+ [
1943
+ "render-ui",
1944
+ "main",
1945
+ {
1946
+ "type": "dashboard-layout",
1947
+ "appName": "AI Tutor",
1948
+ "navItems": [
1949
+ {
1950
+ "label": "Teach",
1951
+ "href": "/teach",
1952
+ "icon": "book-open"
1953
+ },
1954
+ {
1955
+ "label": "Quiz",
1956
+ "href": "/quiz",
1957
+ "icon": "help-circle"
1958
+ },
1959
+ {
1960
+ "label": "Concepts",
1961
+ "href": "/concepts",
1962
+ "icon": "brain"
1963
+ }
1964
+ ],
1965
+ "children": [
1966
+ {
1967
+ "type": "stack",
1968
+ "direction": "vertical",
1969
+ "gap": "lg",
1970
+ "children": [
1971
+ {
1972
+ "type": "stack",
1973
+ "direction": "horizontal",
1974
+ "gap": "sm",
1975
+ "align": "center",
1976
+ "children": [
1977
+ {
1978
+ "type": "icon",
1979
+ "name": "brain",
1980
+ "size": "lg"
1981
+ },
1982
+ {
1983
+ "type": "typography",
1984
+ "content": "Concept Active",
1985
+ "variant": "h2"
1986
+ }
1987
+ ]
1988
+ },
1989
+ {
1990
+ "type": "divider"
1991
+ },
1992
+ {
1993
+ "type": "typography",
1994
+ "variant": "body",
1995
+ "content": "@entity.content"
1996
+ },
1997
+ {
1998
+ "type": "stack",
1999
+ "direction": "horizontal",
2000
+ "gap": "sm",
2001
+ "children": [
2002
+ {
2003
+ "type": "badge",
2004
+ "label": "@entity.category"
2005
+ },
2006
+ {
2007
+ "type": "badge",
2008
+ "label": "@entity.strength"
2009
+ }
2010
+ ]
2011
+ },
2012
+ {
2013
+ "type": "stack",
2014
+ "direction": "horizontal",
2015
+ "gap": "sm",
2016
+ "children": [
2017
+ {
2018
+ "type": "button",
2019
+ "label": "Pin",
2020
+ "event": "PIN",
2021
+ "variant": "secondary",
2022
+ "icon": "pin"
2023
+ },
2024
+ {
2025
+ "type": "button",
2026
+ "label": "Reinforce",
2027
+ "event": "REINFORCE",
2028
+ "variant": "secondary",
2029
+ "icon": "zap"
2030
+ },
2031
+ {
2032
+ "type": "button",
2033
+ "label": "Forget",
2034
+ "event": "FORGET",
2035
+ "variant": "destructive",
2036
+ "icon": "trash"
2037
+ }
2038
+ ]
2039
+ }
2040
+ ]
2041
+ }
2042
+ ]
2043
+ }
2044
+ ]
2045
+ ]
2046
+ },
2047
+ {
2048
+ "from": "active",
2049
+ "to": "active",
2050
+ "event": "PIN",
2051
+ "guard": [
2052
+ "not",
2053
+ [
2054
+ "agent/is-pinned",
2055
+ "@payload.id"
2056
+ ]
2057
+ ],
2058
+ "effects": [
2059
+ [
2060
+ "agent/pin",
2061
+ "@payload.id"
2062
+ ],
2063
+ [
2064
+ "set",
2065
+ "@entity.pinned",
2066
+ true
2067
+ ]
2068
+ ]
2069
+ },
2070
+ {
2071
+ "from": "active",
2072
+ "to": "idle",
2073
+ "event": "FORGET",
2074
+ "effects": [
2075
+ [
2076
+ "agent/forget",
2077
+ "@payload.id"
2078
+ ],
2079
+ [
2080
+ "render-ui",
2081
+ "main",
2082
+ {
2083
+ "type": "dashboard-layout",
2084
+ "appName": "AI Tutor",
2085
+ "navItems": [
2086
+ {
2087
+ "label": "Teach",
2088
+ "href": "/teach",
2089
+ "icon": "book-open"
2090
+ },
2091
+ {
2092
+ "label": "Quiz",
2093
+ "href": "/quiz",
2094
+ "icon": "help-circle"
2095
+ },
2096
+ {
2097
+ "label": "Concepts",
2098
+ "href": "/concepts",
2099
+ "icon": "brain"
2100
+ }
2101
+ ],
2102
+ "children": [
2103
+ {
2104
+ "type": "stack",
2105
+ "direction": "vertical",
2106
+ "gap": "lg",
2107
+ "children": [
2108
+ {
2109
+ "type": "stack",
2110
+ "direction": "horizontal",
2111
+ "gap": "sm",
2112
+ "align": "center",
2113
+ "children": [
2114
+ {
2115
+ "type": "icon",
2116
+ "name": "brain",
2117
+ "size": "lg"
2118
+ },
2119
+ {
2120
+ "type": "typography",
2121
+ "content": "Concept Manager",
2122
+ "variant": "h2"
2123
+ }
2124
+ ]
2125
+ },
2126
+ {
2127
+ "type": "divider"
2128
+ },
2129
+ {
2130
+ "type": "stack",
2131
+ "direction": "horizontal",
2132
+ "gap": "sm",
2133
+ "children": [
2134
+ {
2135
+ "type": "button",
2136
+ "label": "Memorize",
2137
+ "event": "MEMORIZE",
2138
+ "variant": "primary",
2139
+ "icon": "plus"
2140
+ },
2141
+ {
2142
+ "type": "button",
2143
+ "label": "Recall",
2144
+ "event": "RECALL",
2145
+ "variant": "secondary",
2146
+ "icon": "search"
2147
+ },
2148
+ {
2149
+ "type": "button",
2150
+ "label": "Decay All",
2151
+ "event": "DECAY",
2152
+ "variant": "ghost",
2153
+ "icon": "clock"
2154
+ }
2155
+ ]
2156
+ }
2157
+ ]
2158
+ }
2159
+ ]
2160
+ }
2161
+ ]
2162
+ ]
2163
+ },
2164
+ {
2165
+ "from": "active",
2166
+ "to": "active",
2167
+ "event": "REINFORCE",
2168
+ "effects": [
2169
+ [
2170
+ "agent/reinforce",
2171
+ "@payload.id"
2172
+ ]
2173
+ ]
2174
+ },
2175
+ {
2176
+ "from": "idle",
2177
+ "to": "idle",
2178
+ "event": "DECAY",
2179
+ "effects": [
2180
+ [
2181
+ "agent/decay"
2182
+ ]
2183
+ ]
2184
+ },
2185
+ {
2186
+ "from": "active",
2187
+ "to": "idle",
2188
+ "event": "DECAY",
2189
+ "effects": [
2190
+ [
2191
+ "agent/decay"
2192
+ ],
2193
+ [
2194
+ "render-ui",
2195
+ "main",
2196
+ {
2197
+ "type": "dashboard-layout",
2198
+ "appName": "AI Tutor",
2199
+ "navItems": [
2200
+ {
2201
+ "label": "Teach",
2202
+ "href": "/teach",
2203
+ "icon": "book-open"
2204
+ },
2205
+ {
2206
+ "label": "Quiz",
2207
+ "href": "/quiz",
2208
+ "icon": "help-circle"
2209
+ },
2210
+ {
2211
+ "label": "Concepts",
2212
+ "href": "/concepts",
2213
+ "icon": "brain"
2214
+ }
2215
+ ],
2216
+ "children": [
2217
+ {
2218
+ "type": "stack",
2219
+ "direction": "vertical",
2220
+ "gap": "lg",
2221
+ "children": [
2222
+ {
2223
+ "type": "stack",
2224
+ "direction": "horizontal",
2225
+ "gap": "sm",
2226
+ "align": "center",
2227
+ "children": [
2228
+ {
2229
+ "type": "icon",
2230
+ "name": "brain",
2231
+ "size": "lg"
2232
+ },
2233
+ {
2234
+ "type": "typography",
2235
+ "content": "Concept Manager",
2236
+ "variant": "h2"
2237
+ }
2238
+ ]
2239
+ },
2240
+ {
2241
+ "type": "divider"
2242
+ },
2243
+ {
2244
+ "type": "stack",
2245
+ "direction": "horizontal",
2246
+ "gap": "sm",
2247
+ "children": [
2248
+ {
2249
+ "type": "button",
2250
+ "label": "Memorize",
2251
+ "event": "MEMORIZE",
2252
+ "variant": "primary",
2253
+ "icon": "plus"
2254
+ },
2255
+ {
2256
+ "type": "button",
2257
+ "label": "Recall",
2258
+ "event": "RECALL",
2259
+ "variant": "secondary",
2260
+ "icon": "search"
2261
+ },
2262
+ {
2263
+ "type": "button",
2264
+ "label": "Decay All",
2265
+ "event": "DECAY",
2266
+ "variant": "ghost",
2267
+ "icon": "clock"
2268
+ }
2269
+ ]
2270
+ }
2271
+ ]
2272
+ }
2273
+ ]
2274
+ }
2275
+ ]
2276
+ ]
2277
+ }
2278
+ ]
2279
+ },
2280
+ "listens": [
2281
+ {
2282
+ "event": "QUIZ_GRADED",
2283
+ "triggers": "REINFORCE",
2284
+ "scope": "external"
2285
+ }
2286
+ ]
2287
+ }
2288
+ ],
2289
+ "pages": [
2290
+ {
2291
+ "name": "ConceptsPage",
2292
+ "path": "/concepts",
2293
+ "traits": [
2294
+ {
2295
+ "ref": "ConceptLifecycle"
2296
+ }
2297
+ ]
2298
+ }
2299
+ ]
2300
+ }
2301
+ ],
2302
+ "description": "Teaching assistant organism. Classifies student level, recalls prior learning from memory, generates explanations with context-aware difficulty, and tracks concept strength via memory reinforcement. Composed from: - inline TeachingTrait: assessment, teaching, quizzing flow - inline QuizTrait: generates and evaluates quiz questions - stdAgentMemory: tracks concept strength per student topic Cross-trait events: - ASSESSMENT_DONE (Teaching -> Quiz): student assessed, generate quiz - QUIZ_GRADED (Quiz -> Memory): reinforce or decay concept based on answer - CONCEPT_RECALLED (Memory -> Teaching): prior learning loaded for context Pages: /teach (initial), /quiz, /concepts"
2303
+ }