@superdurable/dex-agents 0.2.0 → 0.3.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 (70) hide show
  1. package/README.md +44 -6
  2. package/dist/src/agent-context-compaction.d.ts +150 -4
  3. package/dist/src/agent-context-compaction.js +253 -5
  4. package/dist/src/agent-context-compaction.js.map +1 -1
  5. package/dist/src/agent-session-codecs.js +1 -0
  6. package/dist/src/agent-session-codecs.js.map +1 -1
  7. package/dist/src/agent-session-failure.d.ts +58 -0
  8. package/dist/src/agent-session-failure.js +126 -0
  9. package/dist/src/agent-session-failure.js.map +1 -0
  10. package/dist/src/agent-session-flow-graph-cli.d.ts +2 -0
  11. package/dist/src/agent-session-flow-graph-cli.js +47 -0
  12. package/dist/src/agent-session-flow-graph-cli.js.map +1 -0
  13. package/dist/src/agent-session-flow-graph.d.ts +38 -0
  14. package/dist/src/agent-session-flow-graph.js +54 -0
  15. package/dist/src/agent-session-flow-graph.js.map +1 -0
  16. package/dist/src/agent-session-flow-graph.json +2187 -0
  17. package/dist/src/agent-session-flow.d.ts +23 -2
  18. package/dist/src/agent-session-flow.js +5 -0
  19. package/dist/src/agent-session-flow.js.map +1 -1
  20. package/dist/src/agent-session-spend-limit.d.ts +156 -0
  21. package/dist/src/agent-session-spend-limit.js +42 -0
  22. package/dist/src/agent-session-spend-limit.js.map +1 -0
  23. package/dist/src/agent-session-start.d.ts +49 -0
  24. package/dist/src/agent-session-start.js +67 -0
  25. package/dist/src/agent-session-start.js.map +1 -0
  26. package/dist/src/agent-session-step-options.d.ts +52 -1
  27. package/dist/src/agent-session-step-options.js +34 -2
  28. package/dist/src/agent-session-step-options.js.map +1 -1
  29. package/dist/src/agent-session-steps.d.ts +2 -0
  30. package/dist/src/agent-session-steps.js +80 -19
  31. package/dist/src/agent-session-steps.js.map +1 -1
  32. package/dist/src/agent-session-transitions.d.ts +12 -1
  33. package/dist/src/agent-session-transitions.js +53 -1
  34. package/dist/src/agent-session-transitions.js.map +1 -1
  35. package/dist/src/agent-session-values.d.ts +7 -2
  36. package/dist/src/agent-session-values.js.map +1 -1
  37. package/dist/src/index.d.ts +6 -1
  38. package/dist/src/index.js +5 -0
  39. package/dist/src/index.js.map +1 -1
  40. package/dist/src/stepwise/agent-definition.d.ts +8 -0
  41. package/dist/src/stepwise/index.d.ts +2 -1
  42. package/dist/src/stepwise/index.js +2 -1
  43. package/dist/src/stepwise/index.js.map +1 -1
  44. package/dist/src/stepwise/stepwise-agent-runner.d.ts +3 -21
  45. package/dist/src/stepwise/stepwise-agent-runner.js +2 -29
  46. package/dist/src/stepwise/stepwise-agent-runner.js.map +1 -1
  47. package/dist/src/stepwise/stepwise-agent-session-flow.js +1 -0
  48. package/dist/src/stepwise/stepwise-agent-session-flow.js.map +1 -1
  49. package/dist/src/testing/agent-session-test-client.js +2 -5
  50. package/dist/src/testing/agent-session-test-client.js.map +1 -1
  51. package/dist/src/testing/context-window.d.ts +194 -0
  52. package/dist/src/testing/context-window.js +360 -0
  53. package/dist/src/testing/context-window.js.map +1 -0
  54. package/dist/src/testing/index.d.ts +1 -0
  55. package/dist/src/testing/index.js +1 -0
  56. package/dist/src/testing/index.js.map +1 -1
  57. package/dist/src/ui-stream/agent-event-sse.d.ts +3 -2
  58. package/dist/src/ui-stream/agent-event-sse.js +11 -3
  59. package/dist/src/ui-stream/agent-event-sse.js.map +1 -1
  60. package/dist/src/ui-stream/agent-session-record-reader.d.ts +2 -0
  61. package/dist/src/ui-stream/agent-session-record-reader.js +5 -0
  62. package/dist/src/ui-stream/agent-session-record-reader.js.map +1 -1
  63. package/dist/src/ui-stream/agent-ui-message-stream-responses.js +3 -2
  64. package/dist/src/ui-stream/agent-ui-message-stream-responses.js.map +1 -1
  65. package/dist/src/ui-stream/agent-ui-message-stream.js +17 -3
  66. package/dist/src/ui-stream/agent-ui-message-stream.js.map +1 -1
  67. package/dist/src/ui-stream/agent-ui-messages.d.ts +2 -0
  68. package/dist/src/ui-stream/agent-ui-messages.js +5 -3
  69. package/dist/src/ui-stream/agent-ui-messages.js.map +1 -1
  70. package/package.json +6 -3
@@ -0,0 +1,2187 @@
1
+ {
2
+ "schemaVersion": "2.0",
3
+ "valid": true,
4
+ "source": {
5
+ "language": "python",
6
+ "path": "dex_agents/session_flow.py"
7
+ },
8
+ "flow": {
9
+ "name": "<flow-type>",
10
+ "startStepId": "step:StartAgentSession"
11
+ },
12
+ "nodes": [
13
+ {
14
+ "id": "resource:stream:AgentEvents",
15
+ "kind": "stream",
16
+ "name": "AgentEvents",
17
+ "resource": {
18
+ "valueType": "AgentEvent"
19
+ }
20
+ },
21
+ {
22
+ "id": "resource:attribute:AgentMessageChunks",
23
+ "kind": "attribute",
24
+ "name": "AgentMessageChunks",
25
+ "resource": {
26
+ "valueType": "AgentMessageChunk",
27
+ "map": true
28
+ }
29
+ },
30
+ {
31
+ "id": "resource:attribute:AgentMessageIndex",
32
+ "kind": "attribute",
33
+ "name": "AgentMessageIndex",
34
+ "resource": {
35
+ "valueType": "AgentMessageIndex"
36
+ }
37
+ },
38
+ {
39
+ "id": "resource:attribute:AgentMessages",
40
+ "kind": "attribute",
41
+ "name": "AgentMessages",
42
+ "resource": {
43
+ "valueType": "AgentMessage",
44
+ "map": true
45
+ }
46
+ },
47
+ {
48
+ "id": "resource:attribute:AgentPlan",
49
+ "kind": "attribute",
50
+ "name": "AgentPlan",
51
+ "resource": {
52
+ "valueType": "AgentPlan"
53
+ }
54
+ },
55
+ {
56
+ "id": "resource:attribute:AgentState",
57
+ "kind": "attribute",
58
+ "name": "AgentState",
59
+ "resource": {
60
+ "valueType": "AgentState"
61
+ }
62
+ },
63
+ {
64
+ "id": "resource:attribute:AgentToolCalls",
65
+ "kind": "attribute",
66
+ "name": "AgentToolCalls",
67
+ "resource": {
68
+ "valueType": "AgentToolCall",
69
+ "map": true
70
+ }
71
+ },
72
+ {
73
+ "id": "resource:attribute:AgentTraceContext",
74
+ "kind": "attribute",
75
+ "name": "AgentTraceContext",
76
+ "resource": {
77
+ "valueType": "string"
78
+ }
79
+ },
80
+ {
81
+ "id": "resource:attribute:AgentUsage",
82
+ "kind": "attribute",
83
+ "name": "AgentUsage",
84
+ "resource": {
85
+ "valueType": "AgentUsage"
86
+ }
87
+ },
88
+ {
89
+ "id": "resource:attribute:ContextSummary",
90
+ "kind": "attribute",
91
+ "name": "ContextSummary",
92
+ "resource": {
93
+ "valueType": "ContextSummary"
94
+ }
95
+ },
96
+ {
97
+ "id": "resource:attribute:FrameworkRunState",
98
+ "kind": "attribute",
99
+ "name": "FrameworkRunState",
100
+ "resource": {
101
+ "valueType": "string"
102
+ }
103
+ },
104
+ {
105
+ "id": "resource:channel:InterruptResolutions",
106
+ "kind": "channel",
107
+ "name": "InterruptResolutions",
108
+ "resource": {
109
+ "valueType": "AgentInterruptResolution",
110
+ "map": true
111
+ }
112
+ },
113
+ {
114
+ "id": "resource:attribute:PendingInterrupts",
115
+ "kind": "attribute",
116
+ "name": "PendingInterrupts",
117
+ "resource": {
118
+ "valueType": "AgentInterruptList"
119
+ }
120
+ },
121
+ {
122
+ "id": "resource:attribute:PendingPlanExecution",
123
+ "kind": "attribute",
124
+ "name": "PendingPlanExecution",
125
+ "resource": {
126
+ "valueType": "PlanExecutionRequest"
127
+ }
128
+ },
129
+ {
130
+ "id": "resource:channel:PlanExecutions",
131
+ "kind": "channel",
132
+ "name": "PlanExecutions",
133
+ "resource": {
134
+ "valueType": "PlanExecutionRequest",
135
+ "map": true
136
+ }
137
+ },
138
+ {
139
+ "id": "resource:channel:QueuedUserMessages",
140
+ "kind": "channel",
141
+ "name": "QueuedUserMessages",
142
+ "resource": {
143
+ "valueType": "AgentUserMessage"
144
+ }
145
+ },
146
+ {
147
+ "id": "resource:attribute:SessionSettings",
148
+ "kind": "attribute",
149
+ "name": "SessionSettings",
150
+ "resource": {
151
+ "valueType": "SessionSettings"
152
+ }
153
+ },
154
+ {
155
+ "id": "resource:channel:SteeredUserMessages",
156
+ "kind": "channel",
157
+ "name": "SteeredUserMessages",
158
+ "resource": {
159
+ "valueType": "AgentUserMessage"
160
+ }
161
+ },
162
+ {
163
+ "id": "resource:channel:ToolCallCancellations",
164
+ "kind": "channel",
165
+ "name": "ToolCallCancellations",
166
+ "resource": {
167
+ "valueType": "ToolCallCancellation",
168
+ "map": true
169
+ }
170
+ },
171
+ {
172
+ "id": "resource:channel:ToolCallResults",
173
+ "kind": "channel",
174
+ "name": "ToolCallResults",
175
+ "resource": {
176
+ "valueType": "ToolCallCompleted"
177
+ }
178
+ },
179
+ {
180
+ "id": "resource:attribute:TurnCancellationRequest",
181
+ "kind": "attribute",
182
+ "name": "TurnCancellationRequest",
183
+ "resource": {
184
+ "valueType": "TurnCancellationRequest"
185
+ }
186
+ },
187
+ {
188
+ "id": "resource:channel:TurnControlRequests",
189
+ "kind": "channel",
190
+ "name": "TurnControlRequests",
191
+ "resource": {
192
+ "valueType": "TurnControlRequest"
193
+ }
194
+ },
195
+ {
196
+ "id": "resource:attribute:TurnReplySequence",
197
+ "kind": "attribute",
198
+ "name": "TurnReplySequence",
199
+ "resource": {
200
+ "valueType": "TurnReplySequence"
201
+ }
202
+ },
203
+ {
204
+ "id": "resource:attribute:TurnSessionSettings",
205
+ "kind": "attribute",
206
+ "name": "TurnSessionSettings",
207
+ "resource": {
208
+ "valueType": "TurnSessionSettings"
209
+ }
210
+ },
211
+ {
212
+ "id": "step:StartAgentSession",
213
+ "kind": "step",
214
+ "name": "StartAgentSession",
215
+ "phase": "execute",
216
+ "metadata": {
217
+ "explanation": "Initialize the session and start its first turn when a message is given."
218
+ },
219
+ "start": true
220
+ },
221
+ {
222
+ "id": "decision:step:StartAgentSession:goTo:AwaitUserMessage",
223
+ "kind": "decision",
224
+ "name": "goTo",
225
+ "parentId": "step:StartAgentSession",
226
+ "phase": "execute",
227
+ "decision": {
228
+ "type": "goTo"
229
+ }
230
+ },
231
+ {
232
+ "id": "decision:step:StartAgentSession:goTo:RunModel",
233
+ "kind": "decision",
234
+ "name": "goTo",
235
+ "parentId": "step:StartAgentSession",
236
+ "phase": "execute",
237
+ "decision": {
238
+ "type": "goTo"
239
+ }
240
+ },
241
+ {
242
+ "id": "decision:step:StartAgentSession:forceFail",
243
+ "kind": "decision",
244
+ "name": "forceFail",
245
+ "parentId": "step:StartAgentSession",
246
+ "phase": "execute",
247
+ "decision": {
248
+ "type": "forceFail"
249
+ }
250
+ },
251
+ {
252
+ "id": "step:AwaitUserMessage",
253
+ "kind": "step",
254
+ "name": "AwaitUserMessage",
255
+ "phase": "wait_for+execute",
256
+ "metadata": {
257
+ "explanation": "Wait for a steer, a queued user message, or a plan execution."
258
+ }
259
+ },
260
+ {
261
+ "id": "wait:AwaitUserMessage",
262
+ "kind": "wait",
263
+ "name": "anyOf",
264
+ "parentId": "step:AwaitUserMessage",
265
+ "phase": "wait_for",
266
+ "wait": {
267
+ "type": "anyOf",
268
+ "conditions": [
269
+ {
270
+ "index": 0,
271
+ "kind": "channel",
272
+ "label": "TurnControlRequests",
273
+ "resourceId": "resource:channel:TurnControlRequests"
274
+ },
275
+ {
276
+ "index": 1,
277
+ "kind": "channel",
278
+ "label": "QueuedUserMessages",
279
+ "resourceId": "resource:channel:QueuedUserMessages"
280
+ },
281
+ {
282
+ "index": 2,
283
+ "kind": "channel",
284
+ "label": "PlanExecutions",
285
+ "resourceId": "resource:channel:PlanExecutions"
286
+ }
287
+ ]
288
+ }
289
+ },
290
+ {
291
+ "id": "decision:step:AwaitUserMessage:goTo:ApplyTurnControl",
292
+ "kind": "decision",
293
+ "name": "goTo",
294
+ "parentId": "step:AwaitUserMessage",
295
+ "phase": "execute",
296
+ "decision": {
297
+ "type": "goTo"
298
+ }
299
+ },
300
+ {
301
+ "id": "decision:step:AwaitUserMessage:goTo:AwaitUserMessage",
302
+ "kind": "decision",
303
+ "name": "goTo",
304
+ "parentId": "step:AwaitUserMessage",
305
+ "phase": "execute",
306
+ "decision": {
307
+ "type": "goTo"
308
+ }
309
+ },
310
+ {
311
+ "id": "decision:step:AwaitUserMessage:goTo:RunModel",
312
+ "kind": "decision",
313
+ "name": "goTo",
314
+ "parentId": "step:AwaitUserMessage",
315
+ "phase": "execute",
316
+ "decision": {
317
+ "type": "goTo"
318
+ }
319
+ },
320
+ {
321
+ "id": "step:RunModel",
322
+ "kind": "step",
323
+ "name": "RunModel",
324
+ "phase": "execute",
325
+ "metadata": {
326
+ "explanation": "Make one model call of the active turn through the framework runner."
327
+ }
328
+ },
329
+ {
330
+ "id": "decision:step:RunModel:goTo:ApplyTurnControl",
331
+ "kind": "decision",
332
+ "name": "goTo",
333
+ "parentId": "step:RunModel",
334
+ "phase": "execute",
335
+ "decision": {
336
+ "type": "goTo"
337
+ }
338
+ },
339
+ {
340
+ "id": "decision:step:RunModel:goTo:AwaitQuestionAnswer",
341
+ "kind": "decision",
342
+ "name": "goTo",
343
+ "parentId": "step:RunModel",
344
+ "phase": "execute",
345
+ "decision": {
346
+ "type": "goTo"
347
+ }
348
+ },
349
+ {
350
+ "id": "decision:step:RunModel:goTo:AwaitTimer",
351
+ "kind": "decision",
352
+ "name": "goTo",
353
+ "parentId": "step:RunModel",
354
+ "phase": "execute",
355
+ "decision": {
356
+ "type": "goTo"
357
+ }
358
+ },
359
+ {
360
+ "id": "decision:step:RunModel:goTo:AwaitToolApproval",
361
+ "kind": "decision",
362
+ "name": "goTo",
363
+ "parentId": "step:RunModel",
364
+ "phase": "execute",
365
+ "decision": {
366
+ "type": "goTo"
367
+ }
368
+ },
369
+ {
370
+ "id": "decision:step:RunModel:goTo:AwaitUserMessage",
371
+ "kind": "decision",
372
+ "name": "goTo",
373
+ "parentId": "step:RunModel",
374
+ "phase": "execute",
375
+ "decision": {
376
+ "type": "goTo"
377
+ }
378
+ },
379
+ {
380
+ "id": "decision:step:RunModel:goTo:CallSingleAttemptTool",
381
+ "kind": "decision",
382
+ "name": "goTo",
383
+ "parentId": "step:RunModel",
384
+ "phase": "execute",
385
+ "decision": {
386
+ "type": "goTo"
387
+ }
388
+ },
389
+ {
390
+ "id": "decision:step:RunModel:goTo:CallTool",
391
+ "kind": "decision",
392
+ "name": "goTo",
393
+ "parentId": "step:RunModel",
394
+ "phase": "execute",
395
+ "decision": {
396
+ "type": "goTo"
397
+ }
398
+ },
399
+ {
400
+ "id": "decision:step:RunModel:goTo:CompactContext",
401
+ "kind": "decision",
402
+ "name": "goTo",
403
+ "parentId": "step:RunModel",
404
+ "phase": "execute",
405
+ "decision": {
406
+ "type": "goTo"
407
+ }
408
+ },
409
+ {
410
+ "id": "decision:step:RunModel:goTo:RecordTurnFailure",
411
+ "kind": "decision",
412
+ "name": "goTo",
413
+ "parentId": "step:RunModel",
414
+ "phase": "execute",
415
+ "decision": {
416
+ "type": "goTo"
417
+ }
418
+ },
419
+ {
420
+ "id": "decision:step:RunModel:goTo:ResumeTurn",
421
+ "kind": "decision",
422
+ "name": "goTo",
423
+ "parentId": "step:RunModel",
424
+ "phase": "execute",
425
+ "decision": {
426
+ "type": "goTo"
427
+ }
428
+ },
429
+ {
430
+ "id": "step:CompactContext",
431
+ "kind": "step",
432
+ "name": "CompactContext",
433
+ "phase": "execute",
434
+ "metadata": {
435
+ "explanation": "Summarize the messages through a sequence for the model input, then call the model."
436
+ }
437
+ },
438
+ {
439
+ "id": "decision:step:CompactContext:goTo:RecordTurnFailure",
440
+ "kind": "decision",
441
+ "name": "goTo",
442
+ "parentId": "step:CompactContext",
443
+ "phase": "execute",
444
+ "decision": {
445
+ "type": "goTo"
446
+ }
447
+ },
448
+ {
449
+ "id": "decision:step:CompactContext:goTo:RunModel",
450
+ "kind": "decision",
451
+ "name": "goTo",
452
+ "parentId": "step:CompactContext",
453
+ "phase": "execute",
454
+ "decision": {
455
+ "type": "goTo"
456
+ }
457
+ },
458
+ {
459
+ "id": "step:AwaitToolApproval",
460
+ "kind": "step",
461
+ "name": "AwaitToolApproval",
462
+ "phase": "wait_for+execute",
463
+ "metadata": {
464
+ "explanation": "Wait for one tool call's approval or deadline, then run or reject it."
465
+ }
466
+ },
467
+ {
468
+ "id": "wait:AwaitToolApproval",
469
+ "kind": "wait",
470
+ "name": "anyOf",
471
+ "parentId": "step:AwaitToolApproval",
472
+ "phase": "wait_for",
473
+ "wait": {
474
+ "type": "anyOf",
475
+ "conditions": [
476
+ {
477
+ "index": 0,
478
+ "kind": "channel",
479
+ "label": "ToolCallCancellations",
480
+ "resourceId": "resource:channel:ToolCallCancellations"
481
+ },
482
+ {
483
+ "index": 1,
484
+ "kind": "channel",
485
+ "label": "InterruptResolutions",
486
+ "resourceId": "resource:channel:InterruptResolutions"
487
+ },
488
+ {
489
+ "index": 2,
490
+ "kind": "timer",
491
+ "label": "Timer"
492
+ }
493
+ ]
494
+ }
495
+ },
496
+ {
497
+ "id": "decision:step:AwaitToolApproval:goTo:AwaitToolApproval",
498
+ "kind": "decision",
499
+ "name": "goTo",
500
+ "parentId": "step:AwaitToolApproval",
501
+ "phase": "execute",
502
+ "decision": {
503
+ "type": "goTo"
504
+ }
505
+ },
506
+ {
507
+ "id": "decision:step:AwaitToolApproval:goTo:CallSingleAttemptTool",
508
+ "kind": "decision",
509
+ "name": "goTo",
510
+ "parentId": "step:AwaitToolApproval",
511
+ "phase": "execute",
512
+ "decision": {
513
+ "type": "goTo"
514
+ }
515
+ },
516
+ {
517
+ "id": "decision:step:AwaitToolApproval:goTo:CallTool",
518
+ "kind": "decision",
519
+ "name": "goTo",
520
+ "parentId": "step:AwaitToolApproval",
521
+ "phase": "execute",
522
+ "decision": {
523
+ "type": "goTo"
524
+ }
525
+ },
526
+ {
527
+ "id": "decision:step:AwaitToolApproval:deadEnd",
528
+ "kind": "decision",
529
+ "name": "deadEnd",
530
+ "parentId": "step:AwaitToolApproval",
531
+ "phase": "execute",
532
+ "decision": {
533
+ "type": "deadEnd"
534
+ }
535
+ },
536
+ {
537
+ "id": "step:AwaitQuestionAnswer",
538
+ "kind": "step",
539
+ "name": "AwaitQuestionAnswer",
540
+ "phase": "wait_for+execute",
541
+ "metadata": {
542
+ "explanation": "Wait for one question's answer, decline, or deadline, then record the result."
543
+ }
544
+ },
545
+ {
546
+ "id": "wait:AwaitQuestionAnswer",
547
+ "kind": "wait",
548
+ "name": "anyOf",
549
+ "parentId": "step:AwaitQuestionAnswer",
550
+ "phase": "wait_for",
551
+ "wait": {
552
+ "type": "anyOf",
553
+ "conditions": [
554
+ {
555
+ "index": 0,
556
+ "kind": "channel",
557
+ "label": "ToolCallCancellations",
558
+ "resourceId": "resource:channel:ToolCallCancellations"
559
+ },
560
+ {
561
+ "index": 1,
562
+ "kind": "channel",
563
+ "label": "InterruptResolutions",
564
+ "resourceId": "resource:channel:InterruptResolutions"
565
+ },
566
+ {
567
+ "index": 2,
568
+ "kind": "timer",
569
+ "label": "Timer"
570
+ }
571
+ ]
572
+ }
573
+ },
574
+ {
575
+ "id": "decision:step:AwaitQuestionAnswer:goTo:AwaitQuestionAnswer",
576
+ "kind": "decision",
577
+ "name": "goTo",
578
+ "parentId": "step:AwaitQuestionAnswer",
579
+ "phase": "execute",
580
+ "decision": {
581
+ "type": "goTo"
582
+ }
583
+ },
584
+ {
585
+ "id": "decision:step:AwaitQuestionAnswer:goTo:CallSingleAttemptTool",
586
+ "kind": "decision",
587
+ "name": "goTo",
588
+ "parentId": "step:AwaitQuestionAnswer",
589
+ "phase": "execute",
590
+ "decision": {
591
+ "type": "goTo"
592
+ }
593
+ },
594
+ {
595
+ "id": "decision:step:AwaitQuestionAnswer:goTo:CallTool",
596
+ "kind": "decision",
597
+ "name": "goTo",
598
+ "parentId": "step:AwaitQuestionAnswer",
599
+ "phase": "execute",
600
+ "decision": {
601
+ "type": "goTo"
602
+ }
603
+ },
604
+ {
605
+ "id": "decision:step:AwaitQuestionAnswer:goTo:FinishTurnCancellation",
606
+ "kind": "decision",
607
+ "name": "goTo",
608
+ "parentId": "step:AwaitQuestionAnswer",
609
+ "phase": "execute",
610
+ "decision": {
611
+ "type": "goTo"
612
+ }
613
+ },
614
+ {
615
+ "id": "decision:step:AwaitQuestionAnswer:goTo:PollToolTask",
616
+ "kind": "decision",
617
+ "name": "goTo",
618
+ "parentId": "step:AwaitQuestionAnswer",
619
+ "phase": "execute",
620
+ "decision": {
621
+ "type": "goTo"
622
+ }
623
+ },
624
+ {
625
+ "id": "decision:step:AwaitQuestionAnswer:deadEnd",
626
+ "kind": "decision",
627
+ "name": "deadEnd",
628
+ "parentId": "step:AwaitQuestionAnswer",
629
+ "phase": "execute",
630
+ "decision": {
631
+ "type": "deadEnd"
632
+ }
633
+ },
634
+ {
635
+ "id": "step:AwaitTimer",
636
+ "kind": "step",
637
+ "name": "AwaitTimer",
638
+ "phase": "wait_for+execute",
639
+ "metadata": {
640
+ "explanation": "Wait on the Timer of one durable_wait call, then record that it completed."
641
+ }
642
+ },
643
+ {
644
+ "id": "wait:AwaitTimer",
645
+ "kind": "wait",
646
+ "name": "anyOf",
647
+ "parentId": "step:AwaitTimer",
648
+ "phase": "wait_for",
649
+ "wait": {
650
+ "type": "anyOf",
651
+ "conditions": [
652
+ {
653
+ "index": 0,
654
+ "kind": "timer",
655
+ "label": "Timer"
656
+ },
657
+ {
658
+ "index": 1,
659
+ "kind": "channel",
660
+ "label": "ToolCallCancellations",
661
+ "resourceId": "resource:channel:ToolCallCancellations"
662
+ }
663
+ ]
664
+ }
665
+ },
666
+ {
667
+ "id": "decision:step:AwaitTimer:goTo:AwaitTimer",
668
+ "kind": "decision",
669
+ "name": "goTo",
670
+ "parentId": "step:AwaitTimer",
671
+ "phase": "execute",
672
+ "decision": {
673
+ "type": "goTo"
674
+ }
675
+ },
676
+ {
677
+ "id": "decision:step:AwaitTimer:deadEnd",
678
+ "kind": "decision",
679
+ "name": "deadEnd",
680
+ "parentId": "step:AwaitTimer",
681
+ "phase": "execute",
682
+ "decision": {
683
+ "type": "deadEnd"
684
+ }
685
+ },
686
+ {
687
+ "id": "step:CallTool",
688
+ "kind": "step",
689
+ "name": "CallTool",
690
+ "phase": "execute",
691
+ "metadata": {
692
+ "explanation": "Run one read or idempotent write tool call with up to three attempts."
693
+ }
694
+ },
695
+ {
696
+ "id": "decision:step:CallTool:goTo:AwaitQuestionAnswer",
697
+ "kind": "decision",
698
+ "name": "goTo",
699
+ "parentId": "step:CallTool",
700
+ "phase": "execute",
701
+ "decision": {
702
+ "type": "goTo"
703
+ }
704
+ },
705
+ {
706
+ "id": "decision:step:CallTool:goTo:PollToolTask",
707
+ "kind": "decision",
708
+ "name": "goTo",
709
+ "parentId": "step:CallTool",
710
+ "phase": "execute",
711
+ "decision": {
712
+ "type": "goTo"
713
+ }
714
+ },
715
+ {
716
+ "id": "decision:step:CallTool:deadEnd",
717
+ "kind": "decision",
718
+ "name": "deadEnd",
719
+ "parentId": "step:CallTool",
720
+ "phase": "execute",
721
+ "decision": {
722
+ "type": "deadEnd"
723
+ }
724
+ },
725
+ {
726
+ "id": "step:CallSingleAttemptTool",
727
+ "kind": "step",
728
+ "name": "CallSingleAttemptTool",
729
+ "phase": "execute",
730
+ "metadata": {
731
+ "explanation": "Run one non-idempotent or unclassified tool call exactly once."
732
+ }
733
+ },
734
+ {
735
+ "id": "decision:step:CallSingleAttemptTool:goTo:AwaitQuestionAnswer",
736
+ "kind": "decision",
737
+ "name": "goTo",
738
+ "parentId": "step:CallSingleAttemptTool",
739
+ "phase": "execute",
740
+ "decision": {
741
+ "type": "goTo"
742
+ }
743
+ },
744
+ {
745
+ "id": "decision:step:CallSingleAttemptTool:goTo:PollToolTask",
746
+ "kind": "decision",
747
+ "name": "goTo",
748
+ "parentId": "step:CallSingleAttemptTool",
749
+ "phase": "execute",
750
+ "decision": {
751
+ "type": "goTo"
752
+ }
753
+ },
754
+ {
755
+ "id": "decision:step:CallSingleAttemptTool:deadEnd",
756
+ "kind": "decision",
757
+ "name": "deadEnd",
758
+ "parentId": "step:CallSingleAttemptTool",
759
+ "phase": "execute",
760
+ "decision": {
761
+ "type": "deadEnd"
762
+ }
763
+ },
764
+ {
765
+ "id": "step:PollToolTask",
766
+ "kind": "step",
767
+ "name": "PollToolTask",
768
+ "phase": "wait_for+execute",
769
+ "metadata": {
770
+ "explanation": "Poll one tool's remote task after its poll interval, until the task finishes."
771
+ }
772
+ },
773
+ {
774
+ "id": "wait:PollToolTask",
775
+ "kind": "wait",
776
+ "name": "until",
777
+ "parentId": "step:PollToolTask",
778
+ "phase": "wait_for",
779
+ "wait": {
780
+ "type": "until",
781
+ "conditions": [
782
+ {
783
+ "index": 0,
784
+ "kind": "timer",
785
+ "label": "Timer"
786
+ }
787
+ ]
788
+ }
789
+ },
790
+ {
791
+ "id": "decision:step:PollToolTask:goTo:AwaitQuestionAnswer",
792
+ "kind": "decision",
793
+ "name": "goTo",
794
+ "parentId": "step:PollToolTask",
795
+ "phase": "execute",
796
+ "decision": {
797
+ "type": "goTo"
798
+ }
799
+ },
800
+ {
801
+ "id": "decision:step:PollToolTask:goTo:FinishTurnCancellation",
802
+ "kind": "decision",
803
+ "name": "goTo",
804
+ "parentId": "step:PollToolTask",
805
+ "phase": "execute",
806
+ "decision": {
807
+ "type": "goTo"
808
+ }
809
+ },
810
+ {
811
+ "id": "decision:step:PollToolTask:goTo:PollToolTask",
812
+ "kind": "decision",
813
+ "name": "goTo",
814
+ "parentId": "step:PollToolTask",
815
+ "phase": "execute",
816
+ "decision": {
817
+ "type": "goTo"
818
+ }
819
+ },
820
+ {
821
+ "id": "decision:step:PollToolTask:deadEnd",
822
+ "kind": "decision",
823
+ "name": "deadEnd",
824
+ "parentId": "step:PollToolTask",
825
+ "phase": "execute",
826
+ "decision": {
827
+ "type": "deadEnd"
828
+ }
829
+ },
830
+ {
831
+ "id": "step:RecordToolFailure",
832
+ "kind": "step",
833
+ "name": "RecordToolFailure",
834
+ "phase": "execute",
835
+ "metadata": {
836
+ "explanation": "Record a CallTool call whose attempts ran out: failed for reads, unknown for writes."
837
+ }
838
+ },
839
+ {
840
+ "id": "decision:step:RecordToolFailure:deadEnd",
841
+ "kind": "decision",
842
+ "name": "deadEnd",
843
+ "parentId": "step:RecordToolFailure",
844
+ "phase": "execute",
845
+ "decision": {
846
+ "type": "deadEnd"
847
+ }
848
+ },
849
+ {
850
+ "id": "decision:step:RecordToolFailure:forceFail",
851
+ "kind": "decision",
852
+ "name": "forceFail",
853
+ "parentId": "step:RecordToolFailure",
854
+ "phase": "execute",
855
+ "decision": {
856
+ "type": "forceFail"
857
+ }
858
+ },
859
+ {
860
+ "id": "step:RecordToolOutcomeUnknown",
861
+ "kind": "step",
862
+ "name": "RecordToolOutcomeUnknown",
863
+ "phase": "execute",
864
+ "metadata": {
865
+ "explanation": "Record that a single-attempt tool call stopped without a result."
866
+ }
867
+ },
868
+ {
869
+ "id": "decision:step:RecordToolOutcomeUnknown:deadEnd",
870
+ "kind": "decision",
871
+ "name": "deadEnd",
872
+ "parentId": "step:RecordToolOutcomeUnknown",
873
+ "phase": "execute",
874
+ "decision": {
875
+ "type": "deadEnd"
876
+ }
877
+ },
878
+ {
879
+ "id": "decision:step:RecordToolOutcomeUnknown:forceFail",
880
+ "kind": "decision",
881
+ "name": "forceFail",
882
+ "parentId": "step:RecordToolOutcomeUnknown",
883
+ "phase": "execute",
884
+ "decision": {
885
+ "type": "forceFail"
886
+ }
887
+ },
888
+ {
889
+ "id": "step:ResumeTurn",
890
+ "kind": "step",
891
+ "name": "ResumeTurn",
892
+ "phase": "wait_for+execute",
893
+ "metadata": {
894
+ "explanation": "Wait for every tool call result of the model response, then call the model again."
895
+ }
896
+ },
897
+ {
898
+ "id": "wait:ResumeTurn",
899
+ "kind": "wait",
900
+ "name": "anyOf",
901
+ "parentId": "step:ResumeTurn",
902
+ "phase": "wait_for",
903
+ "wait": {
904
+ "type": "anyOf",
905
+ "conditions": [
906
+ {
907
+ "index": 0,
908
+ "kind": "channel",
909
+ "label": "ToolCallResults",
910
+ "resourceId": "resource:channel:ToolCallResults"
911
+ },
912
+ {
913
+ "index": 1,
914
+ "kind": "channel",
915
+ "label": "TurnControlRequests",
916
+ "resourceId": "resource:channel:TurnControlRequests"
917
+ }
918
+ ]
919
+ }
920
+ },
921
+ {
922
+ "id": "decision:step:ResumeTurn:goTo:ApplyTurnControl",
923
+ "kind": "decision",
924
+ "name": "goTo",
925
+ "parentId": "step:ResumeTurn",
926
+ "phase": "execute",
927
+ "decision": {
928
+ "type": "goTo"
929
+ }
930
+ },
931
+ {
932
+ "id": "decision:step:ResumeTurn:goTo:ResumeTurn",
933
+ "kind": "decision",
934
+ "name": "goTo",
935
+ "parentId": "step:ResumeTurn",
936
+ "phase": "execute",
937
+ "decision": {
938
+ "type": "goTo"
939
+ }
940
+ },
941
+ {
942
+ "id": "decision:step:ResumeTurn:goTo:RunModel",
943
+ "kind": "decision",
944
+ "name": "goTo",
945
+ "parentId": "step:ResumeTurn",
946
+ "phase": "execute",
947
+ "decision": {
948
+ "type": "goTo"
949
+ }
950
+ },
951
+ {
952
+ "id": "step:ApplyTurnControl",
953
+ "kind": "step",
954
+ "name": "ApplyTurnControl",
955
+ "phase": "wait_for+execute",
956
+ "metadata": {
957
+ "explanation": "End a steered or cancelled turn, then start a turn with the steered messages."
958
+ }
959
+ },
960
+ {
961
+ "id": "wait:ApplyTurnControl",
962
+ "kind": "wait",
963
+ "name": "allOf",
964
+ "parentId": "step:ApplyTurnControl",
965
+ "phase": "wait_for",
966
+ "wait": {
967
+ "type": "allOf",
968
+ "conditions": [
969
+ {
970
+ "index": 0,
971
+ "kind": "channel",
972
+ "label": "SteeredUserMessages",
973
+ "resourceId": "resource:channel:SteeredUserMessages"
974
+ },
975
+ {
976
+ "index": 1,
977
+ "kind": "channel",
978
+ "label": "TurnControlRequests",
979
+ "resourceId": "resource:channel:TurnControlRequests"
980
+ }
981
+ ]
982
+ }
983
+ },
984
+ {
985
+ "id": "decision:step:ApplyTurnControl:goTo:AwaitUserMessage",
986
+ "kind": "decision",
987
+ "name": "goTo",
988
+ "parentId": "step:ApplyTurnControl",
989
+ "phase": "execute",
990
+ "decision": {
991
+ "type": "goTo"
992
+ }
993
+ },
994
+ {
995
+ "id": "decision:step:ApplyTurnControl:goTo:RunModel",
996
+ "kind": "decision",
997
+ "name": "goTo",
998
+ "parentId": "step:ApplyTurnControl",
999
+ "phase": "execute",
1000
+ "decision": {
1001
+ "type": "goTo"
1002
+ }
1003
+ },
1004
+ {
1005
+ "id": "step:RecordTurnFailure",
1006
+ "kind": "step",
1007
+ "name": "RecordTurnFailure",
1008
+ "phase": "execute",
1009
+ "metadata": {
1010
+ "explanation": "Record a failed turn and wait for the next user message."
1011
+ }
1012
+ },
1013
+ {
1014
+ "id": "decision:step:RecordTurnFailure:goTo:AwaitUserMessage",
1015
+ "kind": "decision",
1016
+ "name": "goTo",
1017
+ "parentId": "step:RecordTurnFailure",
1018
+ "phase": "execute",
1019
+ "decision": {
1020
+ "type": "goTo"
1021
+ }
1022
+ },
1023
+ {
1024
+ "id": "decision:step:RecordTurnFailure:forceFail",
1025
+ "kind": "decision",
1026
+ "name": "forceFail",
1027
+ "parentId": "step:RecordTurnFailure",
1028
+ "phase": "execute",
1029
+ "decision": {
1030
+ "type": "forceFail"
1031
+ }
1032
+ },
1033
+ {
1034
+ "id": "step:FinishTurnCancellation",
1035
+ "kind": "step",
1036
+ "name": "FinishTurnCancellation",
1037
+ "phase": "execute",
1038
+ "metadata": {
1039
+ "explanation": "Finish a turn that cancel_turn stopped, from the state that committed."
1040
+ }
1041
+ },
1042
+ {
1043
+ "id": "decision:step:FinishTurnCancellation:goTo:ApplyTurnControl",
1044
+ "kind": "decision",
1045
+ "name": "goTo",
1046
+ "parentId": "step:FinishTurnCancellation",
1047
+ "phase": "execute",
1048
+ "decision": {
1049
+ "type": "goTo"
1050
+ }
1051
+ },
1052
+ {
1053
+ "id": "decision:step:FinishTurnCancellation:goTo:AwaitQuestionAnswer",
1054
+ "kind": "decision",
1055
+ "name": "goTo",
1056
+ "parentId": "step:FinishTurnCancellation",
1057
+ "phase": "execute",
1058
+ "decision": {
1059
+ "type": "goTo"
1060
+ }
1061
+ },
1062
+ {
1063
+ "id": "decision:step:FinishTurnCancellation:goTo:AwaitToolApproval",
1064
+ "kind": "decision",
1065
+ "name": "goTo",
1066
+ "parentId": "step:FinishTurnCancellation",
1067
+ "phase": "execute",
1068
+ "decision": {
1069
+ "type": "goTo"
1070
+ }
1071
+ },
1072
+ {
1073
+ "id": "decision:step:FinishTurnCancellation:goTo:CancelToolTask",
1074
+ "kind": "decision",
1075
+ "name": "goTo",
1076
+ "parentId": "step:FinishTurnCancellation",
1077
+ "phase": "execute",
1078
+ "decision": {
1079
+ "type": "goTo"
1080
+ }
1081
+ },
1082
+ {
1083
+ "id": "decision:step:FinishTurnCancellation:deadEnd",
1084
+ "kind": "decision",
1085
+ "name": "deadEnd",
1086
+ "parentId": "step:FinishTurnCancellation",
1087
+ "phase": "execute",
1088
+ "decision": {
1089
+ "type": "deadEnd"
1090
+ }
1091
+ },
1092
+ {
1093
+ "id": "step:CancelToolTask",
1094
+ "kind": "step",
1095
+ "name": "CancelToolTask",
1096
+ "phase": "execute",
1097
+ "metadata": {
1098
+ "explanation": "Ask the runner to cancel one task that cancel_turn abandoned, then record it."
1099
+ }
1100
+ },
1101
+ {
1102
+ "id": "decision:step:CancelToolTask:deadEnd",
1103
+ "kind": "decision",
1104
+ "name": "deadEnd",
1105
+ "parentId": "step:CancelToolTask",
1106
+ "phase": "execute",
1107
+ "decision": {
1108
+ "type": "deadEnd"
1109
+ }
1110
+ },
1111
+ {
1112
+ "id": "rpc:answer_question",
1113
+ "kind": "rpc",
1114
+ "name": "answer_question"
1115
+ },
1116
+ {
1117
+ "id": "rpc:cancel_turn",
1118
+ "kind": "rpc",
1119
+ "name": "cancel_turn"
1120
+ },
1121
+ {
1122
+ "id": "decision:rpc:cancel_turn:rpcResult",
1123
+ "kind": "decision",
1124
+ "name": "rpcResult",
1125
+ "parentId": "rpc:cancel_turn",
1126
+ "phase": "rpc",
1127
+ "decision": {
1128
+ "type": "rpcResult",
1129
+ "cancellations": [
1130
+ {
1131
+ "stepId": "step:RunModel",
1132
+ "scope": "all"
1133
+ },
1134
+ {
1135
+ "stepId": "step:CompactContext",
1136
+ "scope": "all"
1137
+ },
1138
+ {
1139
+ "stepId": "step:RecordTurnFailure",
1140
+ "scope": "all"
1141
+ },
1142
+ {
1143
+ "stepId": "step:AwaitToolApproval",
1144
+ "scope": "all"
1145
+ },
1146
+ {
1147
+ "stepId": "step:AwaitQuestionAnswer",
1148
+ "scope": "all"
1149
+ },
1150
+ {
1151
+ "stepId": "step:AwaitTimer",
1152
+ "scope": "all"
1153
+ },
1154
+ {
1155
+ "stepId": "step:PollToolTask",
1156
+ "scope": "all"
1157
+ }
1158
+ ]
1159
+ }
1160
+ },
1161
+ {
1162
+ "id": "rpc:delete_queued_message",
1163
+ "kind": "rpc",
1164
+ "name": "delete_queued_message"
1165
+ },
1166
+ {
1167
+ "id": "rpc:execute_plan",
1168
+ "kind": "rpc",
1169
+ "name": "execute_plan"
1170
+ },
1171
+ {
1172
+ "id": "rpc:get_agent_snapshot",
1173
+ "kind": "rpc",
1174
+ "name": "get_agent_snapshot"
1175
+ },
1176
+ {
1177
+ "id": "rpc:list_agent_messages",
1178
+ "kind": "rpc",
1179
+ "name": "list_agent_messages"
1180
+ },
1181
+ {
1182
+ "id": "rpc:resolve_interrupt",
1183
+ "kind": "rpc",
1184
+ "name": "resolve_interrupt"
1185
+ },
1186
+ {
1187
+ "id": "rpc:send_user_message",
1188
+ "kind": "rpc",
1189
+ "name": "send_user_message"
1190
+ },
1191
+ {
1192
+ "id": "rpc:steer_user_message",
1193
+ "kind": "rpc",
1194
+ "name": "steer_user_message"
1195
+ },
1196
+ {
1197
+ "id": "rpc:update_session_settings",
1198
+ "kind": "rpc",
1199
+ "name": "update_session_settings"
1200
+ }
1201
+ ],
1202
+ "edges": [
1203
+ {
1204
+ "id": "edge:0001",
1205
+ "kind": "transition",
1206
+ "from": "decision:step:StartAgentSession:goTo:AwaitUserMessage",
1207
+ "to": "step:AwaitUserMessage",
1208
+ "label": "GoTo"
1209
+ },
1210
+ {
1211
+ "id": "edge:0002",
1212
+ "kind": "transition",
1213
+ "from": "decision:step:StartAgentSession:goTo:RunModel",
1214
+ "to": "step:RunModel",
1215
+ "label": "GoTo"
1216
+ },
1217
+ {
1218
+ "id": "edge:0003",
1219
+ "kind": "wait_condition",
1220
+ "from": "resource:channel:TurnControlRequests",
1221
+ "to": "wait:AwaitUserMessage",
1222
+ "label": "TurnControlRequests",
1223
+ "metadata": {
1224
+ "conditionIndex": 0
1225
+ }
1226
+ },
1227
+ {
1228
+ "id": "edge:0004",
1229
+ "kind": "wait_condition",
1230
+ "from": "resource:channel:QueuedUserMessages",
1231
+ "to": "wait:AwaitUserMessage",
1232
+ "label": "QueuedUserMessages",
1233
+ "metadata": {
1234
+ "conditionIndex": 1
1235
+ }
1236
+ },
1237
+ {
1238
+ "id": "edge:0005",
1239
+ "kind": "wait_condition",
1240
+ "from": "resource:channel:PlanExecutions",
1241
+ "to": "wait:AwaitUserMessage",
1242
+ "label": "PlanExecutions",
1243
+ "metadata": {
1244
+ "conditionIndex": 2
1245
+ }
1246
+ },
1247
+ {
1248
+ "id": "edge:0006",
1249
+ "kind": "transition",
1250
+ "from": "decision:step:AwaitUserMessage:goTo:ApplyTurnControl",
1251
+ "to": "step:ApplyTurnControl",
1252
+ "label": "GoTo"
1253
+ },
1254
+ {
1255
+ "id": "edge:0007",
1256
+ "kind": "transition",
1257
+ "from": "decision:step:AwaitUserMessage:goTo:AwaitUserMessage",
1258
+ "to": "step:AwaitUserMessage",
1259
+ "label": "GoTo"
1260
+ },
1261
+ {
1262
+ "id": "edge:0008",
1263
+ "kind": "transition",
1264
+ "from": "decision:step:AwaitUserMessage:goTo:RunModel",
1265
+ "to": "step:RunModel",
1266
+ "label": "GoTo"
1267
+ },
1268
+ {
1269
+ "id": "edge:0009",
1270
+ "kind": "resource_lock",
1271
+ "from": "step:AwaitUserMessage",
1272
+ "to": "resource:attribute:TurnCancellationRequest",
1273
+ "label": "Lock",
1274
+ "metadata": {
1275
+ "phase": "execute"
1276
+ }
1277
+ },
1278
+ {
1279
+ "id": "edge:0010",
1280
+ "kind": "transition",
1281
+ "from": "decision:step:RunModel:goTo:ApplyTurnControl",
1282
+ "to": "step:ApplyTurnControl",
1283
+ "label": "GoTo"
1284
+ },
1285
+ {
1286
+ "id": "edge:0011",
1287
+ "kind": "transition",
1288
+ "from": "decision:step:RunModel:goTo:AwaitQuestionAnswer",
1289
+ "to": "step:AwaitQuestionAnswer",
1290
+ "label": "GoTo"
1291
+ },
1292
+ {
1293
+ "id": "edge:0012",
1294
+ "kind": "transition",
1295
+ "from": "decision:step:RunModel:goTo:AwaitTimer",
1296
+ "to": "step:AwaitTimer",
1297
+ "label": "GoTo"
1298
+ },
1299
+ {
1300
+ "id": "edge:0013",
1301
+ "kind": "transition",
1302
+ "from": "decision:step:RunModel:goTo:AwaitToolApproval",
1303
+ "to": "step:AwaitToolApproval",
1304
+ "label": "GoTo"
1305
+ },
1306
+ {
1307
+ "id": "edge:0014",
1308
+ "kind": "transition",
1309
+ "from": "decision:step:RunModel:goTo:AwaitUserMessage",
1310
+ "to": "step:AwaitUserMessage",
1311
+ "label": "GoTo"
1312
+ },
1313
+ {
1314
+ "id": "edge:0015",
1315
+ "kind": "transition",
1316
+ "from": "decision:step:RunModel:goTo:CallSingleAttemptTool",
1317
+ "to": "step:CallSingleAttemptTool",
1318
+ "label": "GoTo"
1319
+ },
1320
+ {
1321
+ "id": "edge:0016",
1322
+ "kind": "transition",
1323
+ "from": "decision:step:RunModel:goTo:CallTool",
1324
+ "to": "step:CallTool",
1325
+ "label": "GoTo"
1326
+ },
1327
+ {
1328
+ "id": "edge:0017",
1329
+ "kind": "transition",
1330
+ "from": "decision:step:RunModel:goTo:CompactContext",
1331
+ "to": "step:CompactContext",
1332
+ "label": "GoTo"
1333
+ },
1334
+ {
1335
+ "id": "edge:0018",
1336
+ "kind": "transition",
1337
+ "from": "decision:step:RunModel:goTo:RecordTurnFailure",
1338
+ "to": "step:RecordTurnFailure",
1339
+ "label": "GoTo"
1340
+ },
1341
+ {
1342
+ "id": "edge:0019",
1343
+ "kind": "transition",
1344
+ "from": "decision:step:RunModel:goTo:ResumeTurn",
1345
+ "to": "step:ResumeTurn",
1346
+ "label": "GoTo"
1347
+ },
1348
+ {
1349
+ "id": "edge:0020",
1350
+ "kind": "resource_publish",
1351
+ "from": "step:RunModel",
1352
+ "to": "resource:channel:ToolCallResults",
1353
+ "label": "Publish",
1354
+ "metadata": {
1355
+ "phase": "execute"
1356
+ }
1357
+ },
1358
+ {
1359
+ "id": "edge:0021",
1360
+ "kind": "transition",
1361
+ "from": "decision:step:CompactContext:goTo:RecordTurnFailure",
1362
+ "to": "step:RecordTurnFailure",
1363
+ "label": "GoTo"
1364
+ },
1365
+ {
1366
+ "id": "edge:0022",
1367
+ "kind": "transition",
1368
+ "from": "decision:step:CompactContext:goTo:RunModel",
1369
+ "to": "step:RunModel",
1370
+ "label": "GoTo"
1371
+ },
1372
+ {
1373
+ "id": "edge:0023",
1374
+ "kind": "wait_condition",
1375
+ "from": "resource:channel:ToolCallCancellations",
1376
+ "to": "wait:AwaitToolApproval",
1377
+ "label": "ToolCallCancellations",
1378
+ "metadata": {
1379
+ "conditionIndex": 0
1380
+ }
1381
+ },
1382
+ {
1383
+ "id": "edge:0024",
1384
+ "kind": "wait_condition",
1385
+ "from": "resource:channel:InterruptResolutions",
1386
+ "to": "wait:AwaitToolApproval",
1387
+ "label": "InterruptResolutions",
1388
+ "metadata": {
1389
+ "conditionIndex": 1
1390
+ }
1391
+ },
1392
+ {
1393
+ "id": "edge:0025",
1394
+ "kind": "transition",
1395
+ "from": "decision:step:AwaitToolApproval:goTo:AwaitToolApproval",
1396
+ "to": "step:AwaitToolApproval",
1397
+ "label": "GoTo"
1398
+ },
1399
+ {
1400
+ "id": "edge:0026",
1401
+ "kind": "transition",
1402
+ "from": "decision:step:AwaitToolApproval:goTo:CallSingleAttemptTool",
1403
+ "to": "step:CallSingleAttemptTool",
1404
+ "label": "GoTo"
1405
+ },
1406
+ {
1407
+ "id": "edge:0027",
1408
+ "kind": "transition",
1409
+ "from": "decision:step:AwaitToolApproval:goTo:CallTool",
1410
+ "to": "step:CallTool",
1411
+ "label": "GoTo"
1412
+ },
1413
+ {
1414
+ "id": "edge:0028",
1415
+ "kind": "resource_lock",
1416
+ "from": "step:AwaitToolApproval",
1417
+ "to": "resource:attribute:PendingInterrupts",
1418
+ "label": "Lock",
1419
+ "metadata": {
1420
+ "phase": "execute"
1421
+ }
1422
+ },
1423
+ {
1424
+ "id": "edge:0029",
1425
+ "kind": "resource_publish",
1426
+ "from": "step:AwaitToolApproval",
1427
+ "to": "resource:channel:ToolCallResults",
1428
+ "label": "Publish",
1429
+ "metadata": {
1430
+ "phase": "execute"
1431
+ }
1432
+ },
1433
+ {
1434
+ "id": "edge:0030",
1435
+ "kind": "wait_condition",
1436
+ "from": "resource:channel:ToolCallCancellations",
1437
+ "to": "wait:AwaitQuestionAnswer",
1438
+ "label": "ToolCallCancellations",
1439
+ "metadata": {
1440
+ "conditionIndex": 0
1441
+ }
1442
+ },
1443
+ {
1444
+ "id": "edge:0031",
1445
+ "kind": "wait_condition",
1446
+ "from": "resource:channel:InterruptResolutions",
1447
+ "to": "wait:AwaitQuestionAnswer",
1448
+ "label": "InterruptResolutions",
1449
+ "metadata": {
1450
+ "conditionIndex": 1
1451
+ }
1452
+ },
1453
+ {
1454
+ "id": "edge:0032",
1455
+ "kind": "transition",
1456
+ "from": "decision:step:AwaitQuestionAnswer:goTo:AwaitQuestionAnswer",
1457
+ "to": "step:AwaitQuestionAnswer",
1458
+ "label": "GoTo"
1459
+ },
1460
+ {
1461
+ "id": "edge:0033",
1462
+ "kind": "transition",
1463
+ "from": "decision:step:AwaitQuestionAnswer:goTo:CallSingleAttemptTool",
1464
+ "to": "step:CallSingleAttemptTool",
1465
+ "label": "GoTo"
1466
+ },
1467
+ {
1468
+ "id": "edge:0034",
1469
+ "kind": "transition",
1470
+ "from": "decision:step:AwaitQuestionAnswer:goTo:CallTool",
1471
+ "to": "step:CallTool",
1472
+ "label": "GoTo"
1473
+ },
1474
+ {
1475
+ "id": "edge:0035",
1476
+ "kind": "transition",
1477
+ "from": "decision:step:AwaitQuestionAnswer:goTo:FinishTurnCancellation",
1478
+ "to": "step:FinishTurnCancellation",
1479
+ "label": "GoTo"
1480
+ },
1481
+ {
1482
+ "id": "edge:0036",
1483
+ "kind": "transition",
1484
+ "from": "decision:step:AwaitQuestionAnswer:goTo:PollToolTask",
1485
+ "to": "step:PollToolTask",
1486
+ "label": "GoTo"
1487
+ },
1488
+ {
1489
+ "id": "edge:0037",
1490
+ "kind": "resource_lock",
1491
+ "from": "step:AwaitQuestionAnswer",
1492
+ "to": "resource:attribute:PendingInterrupts",
1493
+ "label": "Lock",
1494
+ "metadata": {
1495
+ "phase": "execute"
1496
+ }
1497
+ },
1498
+ {
1499
+ "id": "edge:0038",
1500
+ "kind": "resource_publish",
1501
+ "from": "step:AwaitQuestionAnswer",
1502
+ "to": "resource:channel:ToolCallResults",
1503
+ "label": "Publish",
1504
+ "metadata": {
1505
+ "phase": "execute"
1506
+ }
1507
+ },
1508
+ {
1509
+ "id": "edge:0039",
1510
+ "kind": "wait_condition",
1511
+ "from": "resource:channel:ToolCallCancellations",
1512
+ "to": "wait:AwaitTimer",
1513
+ "label": "ToolCallCancellations",
1514
+ "metadata": {
1515
+ "conditionIndex": 1
1516
+ }
1517
+ },
1518
+ {
1519
+ "id": "edge:0040",
1520
+ "kind": "transition",
1521
+ "from": "decision:step:AwaitTimer:goTo:AwaitTimer",
1522
+ "to": "step:AwaitTimer",
1523
+ "label": "GoTo"
1524
+ },
1525
+ {
1526
+ "id": "edge:0041",
1527
+ "kind": "resource_publish",
1528
+ "from": "step:AwaitTimer",
1529
+ "to": "resource:channel:ToolCallResults",
1530
+ "label": "Publish",
1531
+ "metadata": {
1532
+ "phase": "execute"
1533
+ }
1534
+ },
1535
+ {
1536
+ "id": "edge:0042",
1537
+ "kind": "transition",
1538
+ "from": "decision:step:CallTool:goTo:AwaitQuestionAnswer",
1539
+ "to": "step:AwaitQuestionAnswer",
1540
+ "label": "GoTo"
1541
+ },
1542
+ {
1543
+ "id": "edge:0043",
1544
+ "kind": "transition",
1545
+ "from": "decision:step:CallTool:goTo:PollToolTask",
1546
+ "to": "step:PollToolTask",
1547
+ "label": "GoTo"
1548
+ },
1549
+ {
1550
+ "id": "edge:0044",
1551
+ "kind": "resource_publish",
1552
+ "from": "step:CallTool",
1553
+ "to": "resource:channel:ToolCallResults",
1554
+ "label": "Publish",
1555
+ "metadata": {
1556
+ "phase": "execute"
1557
+ }
1558
+ },
1559
+ {
1560
+ "id": "edge:0045",
1561
+ "kind": "transition",
1562
+ "from": "decision:step:CallSingleAttemptTool:goTo:AwaitQuestionAnswer",
1563
+ "to": "step:AwaitQuestionAnswer",
1564
+ "label": "GoTo"
1565
+ },
1566
+ {
1567
+ "id": "edge:0046",
1568
+ "kind": "transition",
1569
+ "from": "decision:step:CallSingleAttemptTool:goTo:PollToolTask",
1570
+ "to": "step:PollToolTask",
1571
+ "label": "GoTo"
1572
+ },
1573
+ {
1574
+ "id": "edge:0047",
1575
+ "kind": "resource_publish",
1576
+ "from": "step:CallSingleAttemptTool",
1577
+ "to": "resource:channel:ToolCallResults",
1578
+ "label": "Publish",
1579
+ "metadata": {
1580
+ "phase": "execute"
1581
+ }
1582
+ },
1583
+ {
1584
+ "id": "edge:0048",
1585
+ "kind": "transition",
1586
+ "from": "decision:step:PollToolTask:goTo:AwaitQuestionAnswer",
1587
+ "to": "step:AwaitQuestionAnswer",
1588
+ "label": "GoTo"
1589
+ },
1590
+ {
1591
+ "id": "edge:0049",
1592
+ "kind": "transition",
1593
+ "from": "decision:step:PollToolTask:goTo:FinishTurnCancellation",
1594
+ "to": "step:FinishTurnCancellation",
1595
+ "label": "GoTo"
1596
+ },
1597
+ {
1598
+ "id": "edge:0050",
1599
+ "kind": "transition",
1600
+ "from": "decision:step:PollToolTask:goTo:PollToolTask",
1601
+ "to": "step:PollToolTask",
1602
+ "label": "GoTo"
1603
+ },
1604
+ {
1605
+ "id": "edge:0051",
1606
+ "kind": "resource_publish",
1607
+ "from": "step:PollToolTask",
1608
+ "to": "resource:channel:ToolCallResults",
1609
+ "label": "Publish",
1610
+ "metadata": {
1611
+ "phase": "execute"
1612
+ }
1613
+ },
1614
+ {
1615
+ "id": "edge:0052",
1616
+ "kind": "resource_publish",
1617
+ "from": "step:RecordToolFailure",
1618
+ "to": "resource:channel:ToolCallResults",
1619
+ "label": "Publish",
1620
+ "metadata": {
1621
+ "phase": "execute"
1622
+ }
1623
+ },
1624
+ {
1625
+ "id": "edge:0053",
1626
+ "kind": "resource_publish",
1627
+ "from": "step:RecordToolOutcomeUnknown",
1628
+ "to": "resource:channel:ToolCallResults",
1629
+ "label": "Publish",
1630
+ "metadata": {
1631
+ "phase": "execute"
1632
+ }
1633
+ },
1634
+ {
1635
+ "id": "edge:0054",
1636
+ "kind": "wait_condition",
1637
+ "from": "resource:channel:ToolCallResults",
1638
+ "to": "wait:ResumeTurn",
1639
+ "label": "ToolCallResults",
1640
+ "metadata": {
1641
+ "conditionIndex": 0
1642
+ }
1643
+ },
1644
+ {
1645
+ "id": "edge:0055",
1646
+ "kind": "wait_condition",
1647
+ "from": "resource:channel:TurnControlRequests",
1648
+ "to": "wait:ResumeTurn",
1649
+ "label": "TurnControlRequests",
1650
+ "metadata": {
1651
+ "conditionIndex": 1
1652
+ }
1653
+ },
1654
+ {
1655
+ "id": "edge:0056",
1656
+ "kind": "transition",
1657
+ "from": "decision:step:ResumeTurn:goTo:ApplyTurnControl",
1658
+ "to": "step:ApplyTurnControl",
1659
+ "label": "GoTo"
1660
+ },
1661
+ {
1662
+ "id": "edge:0057",
1663
+ "kind": "transition",
1664
+ "from": "decision:step:ResumeTurn:goTo:ResumeTurn",
1665
+ "to": "step:ResumeTurn",
1666
+ "label": "GoTo"
1667
+ },
1668
+ {
1669
+ "id": "edge:0058",
1670
+ "kind": "transition",
1671
+ "from": "decision:step:ResumeTurn:goTo:RunModel",
1672
+ "to": "step:RunModel",
1673
+ "label": "GoTo"
1674
+ },
1675
+ {
1676
+ "id": "edge:0059",
1677
+ "kind": "resource_lock",
1678
+ "from": "step:ResumeTurn",
1679
+ "to": "resource:attribute:PendingInterrupts",
1680
+ "label": "Lock",
1681
+ "metadata": {
1682
+ "phase": "execute"
1683
+ }
1684
+ },
1685
+ {
1686
+ "id": "edge:0060",
1687
+ "kind": "resource_publish",
1688
+ "from": "step:ResumeTurn",
1689
+ "to": "resource:channel:ToolCallCancellations",
1690
+ "label": "Publish",
1691
+ "metadata": {
1692
+ "phase": "execute"
1693
+ }
1694
+ },
1695
+ {
1696
+ "id": "edge:0061",
1697
+ "kind": "wait_condition",
1698
+ "from": "resource:channel:SteeredUserMessages",
1699
+ "to": "wait:ApplyTurnControl",
1700
+ "label": "SteeredUserMessages",
1701
+ "metadata": {
1702
+ "conditionIndex": 0
1703
+ }
1704
+ },
1705
+ {
1706
+ "id": "edge:0062",
1707
+ "kind": "wait_condition",
1708
+ "from": "resource:channel:TurnControlRequests",
1709
+ "to": "wait:ApplyTurnControl",
1710
+ "label": "TurnControlRequests",
1711
+ "metadata": {
1712
+ "conditionIndex": 1
1713
+ }
1714
+ },
1715
+ {
1716
+ "id": "edge:0063",
1717
+ "kind": "transition",
1718
+ "from": "decision:step:ApplyTurnControl:goTo:AwaitUserMessage",
1719
+ "to": "step:AwaitUserMessage",
1720
+ "label": "GoTo"
1721
+ },
1722
+ {
1723
+ "id": "edge:0064",
1724
+ "kind": "transition",
1725
+ "from": "decision:step:ApplyTurnControl:goTo:RunModel",
1726
+ "to": "step:RunModel",
1727
+ "label": "GoTo"
1728
+ },
1729
+ {
1730
+ "id": "edge:0065",
1731
+ "kind": "resource_lock",
1732
+ "from": "step:ApplyTurnControl",
1733
+ "to": "resource:attribute:TurnCancellationRequest",
1734
+ "label": "Lock",
1735
+ "metadata": {
1736
+ "phase": "execute"
1737
+ }
1738
+ },
1739
+ {
1740
+ "id": "edge:0066",
1741
+ "kind": "transition",
1742
+ "from": "decision:step:RecordTurnFailure:goTo:AwaitUserMessage",
1743
+ "to": "step:AwaitUserMessage",
1744
+ "label": "GoTo"
1745
+ },
1746
+ {
1747
+ "id": "edge:0067",
1748
+ "kind": "transition",
1749
+ "from": "decision:step:FinishTurnCancellation:goTo:ApplyTurnControl",
1750
+ "to": "step:ApplyTurnControl",
1751
+ "label": "GoTo"
1752
+ },
1753
+ {
1754
+ "id": "edge:0068",
1755
+ "kind": "transition",
1756
+ "from": "decision:step:FinishTurnCancellation:goTo:AwaitQuestionAnswer",
1757
+ "to": "step:AwaitQuestionAnswer",
1758
+ "label": "GoTo"
1759
+ },
1760
+ {
1761
+ "id": "edge:0069",
1762
+ "kind": "transition",
1763
+ "from": "decision:step:FinishTurnCancellation:goTo:AwaitToolApproval",
1764
+ "to": "step:AwaitToolApproval",
1765
+ "label": "GoTo"
1766
+ },
1767
+ {
1768
+ "id": "edge:0070",
1769
+ "kind": "transition",
1770
+ "from": "decision:step:FinishTurnCancellation:goTo:CancelToolTask",
1771
+ "to": "step:CancelToolTask",
1772
+ "label": "GoTo"
1773
+ },
1774
+ {
1775
+ "id": "edge:0071",
1776
+ "kind": "resource_lock",
1777
+ "from": "step:FinishTurnCancellation",
1778
+ "to": "resource:attribute:TurnCancellationRequest",
1779
+ "label": "Lock",
1780
+ "metadata": {
1781
+ "phase": "execute"
1782
+ }
1783
+ },
1784
+ {
1785
+ "id": "edge:0072",
1786
+ "kind": "resource_lock",
1787
+ "from": "step:FinishTurnCancellation",
1788
+ "to": "resource:attribute:PendingInterrupts",
1789
+ "label": "Lock",
1790
+ "metadata": {
1791
+ "phase": "execute"
1792
+ }
1793
+ },
1794
+ {
1795
+ "id": "edge:0073",
1796
+ "kind": "resource_publish",
1797
+ "from": "step:FinishTurnCancellation",
1798
+ "to": "resource:channel:ToolCallResults",
1799
+ "label": "Publish",
1800
+ "metadata": {
1801
+ "phase": "execute"
1802
+ }
1803
+ },
1804
+ {
1805
+ "id": "edge:0074",
1806
+ "kind": "resource_publish",
1807
+ "from": "step:CancelToolTask",
1808
+ "to": "resource:channel:ToolCallResults",
1809
+ "label": "Publish",
1810
+ "metadata": {
1811
+ "phase": "execute"
1812
+ }
1813
+ },
1814
+ {
1815
+ "id": "edge:0075",
1816
+ "kind": "failure_transition",
1817
+ "from": "step:CallSingleAttemptTool",
1818
+ "to": "step:RecordToolOutcomeUnknown",
1819
+ "label": "Execute failure",
1820
+ "metadata": {
1821
+ "skipWaitFor": true
1822
+ }
1823
+ },
1824
+ {
1825
+ "id": "edge:0076",
1826
+ "kind": "failure_transition",
1827
+ "from": "step:CallTool",
1828
+ "to": "step:RecordToolFailure",
1829
+ "label": "Execute failure",
1830
+ "metadata": {
1831
+ "skipWaitFor": true
1832
+ }
1833
+ },
1834
+ {
1835
+ "id": "edge:0077",
1836
+ "kind": "failure_transition",
1837
+ "from": "step:CancelToolTask",
1838
+ "to": "step:RecordToolOutcomeUnknown",
1839
+ "label": "Execute failure",
1840
+ "metadata": {
1841
+ "skipWaitFor": true
1842
+ }
1843
+ },
1844
+ {
1845
+ "id": "edge:0078",
1846
+ "kind": "failure_transition",
1847
+ "from": "step:CompactContext",
1848
+ "to": "step:RecordTurnFailure",
1849
+ "label": "Execute failure",
1850
+ "metadata": {
1851
+ "skipWaitFor": true
1852
+ }
1853
+ },
1854
+ {
1855
+ "id": "edge:0079",
1856
+ "kind": "failure_transition",
1857
+ "from": "step:PollToolTask",
1858
+ "to": "step:RecordToolFailure",
1859
+ "label": "Execute failure",
1860
+ "metadata": {
1861
+ "skipWaitFor": true
1862
+ }
1863
+ },
1864
+ {
1865
+ "id": "edge:0080",
1866
+ "kind": "failure_transition",
1867
+ "from": "step:PollToolTask",
1868
+ "to": "step:RecordToolOutcomeUnknown",
1869
+ "label": "Execute failure",
1870
+ "metadata": {
1871
+ "skipWaitFor": true
1872
+ }
1873
+ },
1874
+ {
1875
+ "id": "edge:0081",
1876
+ "kind": "failure_transition",
1877
+ "from": "step:RunModel",
1878
+ "to": "step:RecordTurnFailure",
1879
+ "label": "Execute failure",
1880
+ "metadata": {
1881
+ "skipWaitFor": true
1882
+ }
1883
+ },
1884
+ {
1885
+ "id": "edge:0082",
1886
+ "kind": "resource_lock",
1887
+ "from": "rpc:answer_question",
1888
+ "to": "resource:attribute:PendingInterrupts",
1889
+ "label": "Lock"
1890
+ },
1891
+ {
1892
+ "id": "edge:0083",
1893
+ "kind": "resource_publish",
1894
+ "from": "rpc:answer_question",
1895
+ "to": "resource:channel:InterruptResolutions",
1896
+ "label": "Publish"
1897
+ },
1898
+ {
1899
+ "id": "edge:0084",
1900
+ "kind": "resource_lock",
1901
+ "from": "rpc:cancel_turn",
1902
+ "to": "resource:attribute:PendingInterrupts",
1903
+ "label": "Lock"
1904
+ },
1905
+ {
1906
+ "id": "edge:0085",
1907
+ "kind": "resource_lock",
1908
+ "from": "rpc:cancel_turn",
1909
+ "to": "resource:attribute:TurnCancellationRequest",
1910
+ "label": "Lock"
1911
+ },
1912
+ {
1913
+ "id": "edge:0086",
1914
+ "kind": "transition",
1915
+ "from": "decision:rpc:cancel_turn:rpcResult",
1916
+ "to": "step:FinishTurnCancellation",
1917
+ "label": "GoTo"
1918
+ },
1919
+ {
1920
+ "id": "edge:0087",
1921
+ "kind": "cancel",
1922
+ "from": "decision:rpc:cancel_turn:rpcResult",
1923
+ "to": "step:RunModel",
1924
+ "label": "Cancel"
1925
+ },
1926
+ {
1927
+ "id": "edge:0088",
1928
+ "kind": "cancel",
1929
+ "from": "decision:rpc:cancel_turn:rpcResult",
1930
+ "to": "step:CompactContext",
1931
+ "label": "Cancel"
1932
+ },
1933
+ {
1934
+ "id": "edge:0089",
1935
+ "kind": "cancel",
1936
+ "from": "decision:rpc:cancel_turn:rpcResult",
1937
+ "to": "step:RecordTurnFailure",
1938
+ "label": "Cancel"
1939
+ },
1940
+ {
1941
+ "id": "edge:0090",
1942
+ "kind": "cancel",
1943
+ "from": "decision:rpc:cancel_turn:rpcResult",
1944
+ "to": "step:AwaitToolApproval",
1945
+ "label": "Cancel"
1946
+ },
1947
+ {
1948
+ "id": "edge:0091",
1949
+ "kind": "cancel",
1950
+ "from": "decision:rpc:cancel_turn:rpcResult",
1951
+ "to": "step:AwaitQuestionAnswer",
1952
+ "label": "Cancel"
1953
+ },
1954
+ {
1955
+ "id": "edge:0092",
1956
+ "kind": "cancel",
1957
+ "from": "decision:rpc:cancel_turn:rpcResult",
1958
+ "to": "step:AwaitTimer",
1959
+ "label": "Cancel"
1960
+ },
1961
+ {
1962
+ "id": "edge:0093",
1963
+ "kind": "cancel",
1964
+ "from": "decision:rpc:cancel_turn:rpcResult",
1965
+ "to": "step:PollToolTask",
1966
+ "label": "Cancel"
1967
+ },
1968
+ {
1969
+ "id": "edge:0094",
1970
+ "kind": "resource_lock",
1971
+ "from": "rpc:execute_plan",
1972
+ "to": "resource:attribute:PendingPlanExecution",
1973
+ "label": "Lock"
1974
+ },
1975
+ {
1976
+ "id": "edge:0095",
1977
+ "kind": "resource_publish",
1978
+ "from": "rpc:execute_plan",
1979
+ "to": "resource:channel:PlanExecutions",
1980
+ "label": "Publish"
1981
+ },
1982
+ {
1983
+ "id": "edge:0096",
1984
+ "kind": "resource_lock",
1985
+ "from": "rpc:resolve_interrupt",
1986
+ "to": "resource:attribute:PendingInterrupts",
1987
+ "label": "Lock"
1988
+ },
1989
+ {
1990
+ "id": "edge:0097",
1991
+ "kind": "resource_publish",
1992
+ "from": "rpc:resolve_interrupt",
1993
+ "to": "resource:channel:InterruptResolutions",
1994
+ "label": "Publish"
1995
+ },
1996
+ {
1997
+ "id": "edge:0098",
1998
+ "kind": "resource_publish",
1999
+ "from": "rpc:send_user_message",
2000
+ "to": "resource:channel:QueuedUserMessages",
2001
+ "label": "Publish"
2002
+ },
2003
+ {
2004
+ "id": "edge:0099",
2005
+ "kind": "resource_publish",
2006
+ "from": "rpc:steer_user_message",
2007
+ "to": "resource:channel:QueuedUserMessages",
2008
+ "label": "Publish"
2009
+ },
2010
+ {
2011
+ "id": "edge:0100",
2012
+ "kind": "resource_publish",
2013
+ "from": "rpc:steer_user_message",
2014
+ "to": "resource:channel:SteeredUserMessages",
2015
+ "label": "Publish"
2016
+ },
2017
+ {
2018
+ "id": "edge:0101",
2019
+ "kind": "resource_publish",
2020
+ "from": "rpc:steer_user_message",
2021
+ "to": "resource:channel:TurnControlRequests",
2022
+ "label": "Publish"
2023
+ }
2024
+ ],
2025
+ "diagnostics": [],
2026
+ "groups": [
2027
+ {
2028
+ "id": "session",
2029
+ "label": "Session",
2030
+ "stepIds": [
2031
+ "step:StartAgentSession",
2032
+ "step:AwaitUserMessage"
2033
+ ]
2034
+ },
2035
+ {
2036
+ "id": "model",
2037
+ "label": "Model",
2038
+ "stepIds": [
2039
+ "step:RunModel",
2040
+ "step:CompactContext"
2041
+ ]
2042
+ },
2043
+ {
2044
+ "id": "wait",
2045
+ "label": "Wait",
2046
+ "stepIds": [
2047
+ "step:AwaitToolApproval",
2048
+ "step:AwaitQuestionAnswer",
2049
+ "step:AwaitTimer"
2050
+ ]
2051
+ },
2052
+ {
2053
+ "id": "tools",
2054
+ "label": "Tools",
2055
+ "stepIds": [
2056
+ "step:CallTool",
2057
+ "step:CallSingleAttemptTool",
2058
+ "step:PollToolTask"
2059
+ ]
2060
+ },
2061
+ {
2062
+ "id": "turn-end",
2063
+ "label": "Turn end",
2064
+ "stepIds": [
2065
+ "step:ResumeTurn",
2066
+ "step:ApplyTurnControl"
2067
+ ]
2068
+ },
2069
+ {
2070
+ "id": "cancellation",
2071
+ "label": "Cancellation",
2072
+ "stepIds": [
2073
+ "step:FinishTurnCancellation",
2074
+ "step:CancelToolTask"
2075
+ ]
2076
+ }
2077
+ ],
2078
+ "v2": {
2079
+ "indexedAttributes": [],
2080
+ "summary": {
2081
+ "rpcName": "GetDexSummary",
2082
+ "fields": []
2083
+ },
2084
+ "display": {
2085
+ "rpcName": "GetDexDisplay",
2086
+ "fields": []
2087
+ },
2088
+ "actions": [
2089
+ {
2090
+ "rpcName": "resolve_interrupt",
2091
+ "label": "Resolve interrupt",
2092
+ "requiredPermission": "<action-permission>",
2093
+ "input": {
2094
+ "kind": "object",
2095
+ "fields": [
2096
+ {
2097
+ "fieldName": "interrupt_id",
2098
+ "valueType": "string",
2099
+ "source": "user",
2100
+ "required": true,
2101
+ "description": "Interrupt ID"
2102
+ },
2103
+ {
2104
+ "fieldName": "approved",
2105
+ "valueType": "bool",
2106
+ "source": "user",
2107
+ "required": true,
2108
+ "description": "Approve the tool call"
2109
+ },
2110
+ {
2111
+ "fieldName": "rejection_message",
2112
+ "valueType": "string",
2113
+ "source": "user",
2114
+ "required": false,
2115
+ "description": "Message the model sees after a rejection"
2116
+ }
2117
+ ]
2118
+ }
2119
+ },
2120
+ {
2121
+ "rpcName": "answer_question",
2122
+ "label": "Answer question",
2123
+ "requiredPermission": "<action-permission>",
2124
+ "input": {
2125
+ "kind": "object",
2126
+ "fields": [
2127
+ {
2128
+ "fieldName": "interrupt_id",
2129
+ "valueType": "string",
2130
+ "source": "user",
2131
+ "required": true,
2132
+ "description": "Interrupt ID"
2133
+ },
2134
+ {
2135
+ "fieldName": "answer",
2136
+ "valueType": "string",
2137
+ "source": "user",
2138
+ "required": true,
2139
+ "description": "Answer"
2140
+ }
2141
+ ]
2142
+ }
2143
+ },
2144
+ {
2145
+ "rpcName": "steer_user_message",
2146
+ "label": "Steer turn",
2147
+ "requiredPermission": "<action-permission>",
2148
+ "input": {
2149
+ "kind": "object",
2150
+ "fields": [
2151
+ {
2152
+ "fieldName": "message_id",
2153
+ "valueType": "string",
2154
+ "source": "user",
2155
+ "required": false,
2156
+ "description": "Queued message ID"
2157
+ },
2158
+ {
2159
+ "fieldName": "text",
2160
+ "valueType": "string",
2161
+ "source": "user",
2162
+ "required": false,
2163
+ "description": "New message"
2164
+ }
2165
+ ]
2166
+ }
2167
+ },
2168
+ {
2169
+ "rpcName": "cancel_turn",
2170
+ "label": "Stop turn",
2171
+ "requiredPermission": "<action-permission>",
2172
+ "input": {
2173
+ "kind": "object",
2174
+ "fields": [
2175
+ {
2176
+ "fieldName": "turn_id",
2177
+ "valueType": "string",
2178
+ "source": "user",
2179
+ "required": false,
2180
+ "description": "Turn ID"
2181
+ }
2182
+ ]
2183
+ }
2184
+ }
2185
+ ]
2186
+ }
2187
+ }