@superdurable/dex-agents 0.2.0 → 0.4.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 (92) hide show
  1. package/README.md +143 -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-framework-runner.d.ts +89 -0
  6. package/dist/src/agent-framework-runner.js +26 -0
  7. package/dist/src/agent-framework-runner.js.map +1 -1
  8. package/dist/src/agent-session-codecs.js +9 -0
  9. package/dist/src/agent-session-codecs.js.map +1 -1
  10. package/dist/src/agent-session-failure.d.ts +58 -0
  11. package/dist/src/agent-session-failure.js +126 -0
  12. package/dist/src/agent-session-failure.js.map +1 -0
  13. package/dist/src/agent-session-flow-graph-cli.d.ts +2 -0
  14. package/dist/src/agent-session-flow-graph-cli.js +47 -0
  15. package/dist/src/agent-session-flow-graph-cli.js.map +1 -0
  16. package/dist/src/agent-session-flow-graph.d.ts +38 -0
  17. package/dist/src/agent-session-flow-graph.js +54 -0
  18. package/dist/src/agent-session-flow-graph.js.map +1 -0
  19. package/dist/src/agent-session-flow-graph.json +2204 -0
  20. package/dist/src/agent-session-flow.d.ts +23 -2
  21. package/dist/src/agent-session-flow.js +5 -0
  22. package/dist/src/agent-session-flow.js.map +1 -1
  23. package/dist/src/agent-session-spend-limit.d.ts +156 -0
  24. package/dist/src/agent-session-spend-limit.js +42 -0
  25. package/dist/src/agent-session-spend-limit.js.map +1 -0
  26. package/dist/src/agent-session-start.d.ts +49 -0
  27. package/dist/src/agent-session-start.js +67 -0
  28. package/dist/src/agent-session-start.js.map +1 -0
  29. package/dist/src/agent-session-step-options.d.ts +52 -1
  30. package/dist/src/agent-session-step-options.js +34 -2
  31. package/dist/src/agent-session-step-options.js.map +1 -1
  32. package/dist/src/agent-session-steps.d.ts +9 -0
  33. package/dist/src/agent-session-steps.js +247 -50
  34. package/dist/src/agent-session-steps.js.map +1 -1
  35. package/dist/src/agent-session-transitions.d.ts +14 -1
  36. package/dist/src/agent-session-transitions.js +61 -1
  37. package/dist/src/agent-session-transitions.js.map +1 -1
  38. package/dist/src/agent-session-values.d.ts +43 -2
  39. package/dist/src/agent-session-values.js +6 -0
  40. package/dist/src/agent-session-values.js.map +1 -1
  41. package/dist/src/agent-session-wait-steps.js +3 -3
  42. package/dist/src/agent-session-wait-steps.js.map +1 -1
  43. package/dist/src/connectors/connector-input-schema.d.ts +19 -0
  44. package/dist/src/connectors/connector-input-schema.js +228 -0
  45. package/dist/src/connectors/connector-input-schema.js.map +1 -0
  46. package/dist/src/connectors/connector-step-context.d.ts +77 -0
  47. package/dist/src/connectors/connector-step-context.js +124 -0
  48. package/dist/src/connectors/connector-step-context.js.map +1 -0
  49. package/dist/src/connectors/connector-tool-source.d.ts +353 -0
  50. package/dist/src/connectors/connector-tool-source.js +541 -0
  51. package/dist/src/connectors/connector-tool-source.js.map +1 -0
  52. package/dist/src/connectors/index.d.ts +3 -0
  53. package/dist/src/connectors/index.js +11 -0
  54. package/dist/src/connectors/index.js.map +1 -0
  55. package/dist/src/index.d.ts +10 -3
  56. package/dist/src/index.js +8 -2
  57. package/dist/src/index.js.map +1 -1
  58. package/dist/src/stepwise/agent-definition.d.ts +8 -0
  59. package/dist/src/stepwise/index.d.ts +2 -1
  60. package/dist/src/stepwise/index.js +2 -1
  61. package/dist/src/stepwise/index.js.map +1 -1
  62. package/dist/src/stepwise/stepwise-agent-runner.d.ts +15 -32
  63. package/dist/src/stepwise/stepwise-agent-runner.js +37 -200
  64. package/dist/src/stepwise/stepwise-agent-runner.js.map +1 -1
  65. package/dist/src/stepwise/stepwise-agent-session-flow.js +1 -0
  66. package/dist/src/stepwise/stepwise-agent-session-flow.js.map +1 -1
  67. package/dist/src/stepwise/tool-source.d.ts +11 -1
  68. package/dist/src/testing/agent-session-test-client.js +2 -5
  69. package/dist/src/testing/agent-session-test-client.js.map +1 -1
  70. package/dist/src/testing/context-window.d.ts +194 -0
  71. package/dist/src/testing/context-window.js +360 -0
  72. package/dist/src/testing/context-window.js.map +1 -0
  73. package/dist/src/testing/index.d.ts +1 -0
  74. package/dist/src/testing/index.js +1 -0
  75. package/dist/src/testing/index.js.map +1 -1
  76. package/dist/src/tool-source-router.d.ts +211 -0
  77. package/dist/src/tool-source-router.js +380 -0
  78. package/dist/src/tool-source-router.js.map +1 -0
  79. package/dist/src/ui-stream/agent-event-sse.d.ts +3 -2
  80. package/dist/src/ui-stream/agent-event-sse.js +11 -3
  81. package/dist/src/ui-stream/agent-event-sse.js.map +1 -1
  82. package/dist/src/ui-stream/agent-session-record-reader.d.ts +2 -0
  83. package/dist/src/ui-stream/agent-session-record-reader.js +5 -0
  84. package/dist/src/ui-stream/agent-session-record-reader.js.map +1 -1
  85. package/dist/src/ui-stream/agent-ui-message-stream-responses.js +3 -2
  86. package/dist/src/ui-stream/agent-ui-message-stream-responses.js.map +1 -1
  87. package/dist/src/ui-stream/agent-ui-message-stream.js +17 -3
  88. package/dist/src/ui-stream/agent-ui-message-stream.js.map +1 -1
  89. package/dist/src/ui-stream/agent-ui-messages.d.ts +2 -0
  90. package/dist/src/ui-stream/agent-ui-messages.js +5 -3
  91. package/dist/src/ui-stream/agent-ui-messages.js.map +1 -1
  92. package/package.json +15 -3
@@ -0,0 +1,2204 @@
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": "decision:step:RunModel:goTo:RunModel",
431
+ "kind": "decision",
432
+ "name": "goTo",
433
+ "parentId": "step:RunModel",
434
+ "phase": "execute",
435
+ "decision": {
436
+ "type": "goTo"
437
+ }
438
+ },
439
+ {
440
+ "id": "step:CompactContext",
441
+ "kind": "step",
442
+ "name": "CompactContext",
443
+ "phase": "execute",
444
+ "metadata": {
445
+ "explanation": "Summarize the messages through a sequence for the model input, then call the model."
446
+ }
447
+ },
448
+ {
449
+ "id": "decision:step:CompactContext:goTo:RecordTurnFailure",
450
+ "kind": "decision",
451
+ "name": "goTo",
452
+ "parentId": "step:CompactContext",
453
+ "phase": "execute",
454
+ "decision": {
455
+ "type": "goTo"
456
+ }
457
+ },
458
+ {
459
+ "id": "decision:step:CompactContext:goTo:RunModel",
460
+ "kind": "decision",
461
+ "name": "goTo",
462
+ "parentId": "step:CompactContext",
463
+ "phase": "execute",
464
+ "decision": {
465
+ "type": "goTo"
466
+ }
467
+ },
468
+ {
469
+ "id": "step:AwaitToolApproval",
470
+ "kind": "step",
471
+ "name": "AwaitToolApproval",
472
+ "phase": "wait_for+execute",
473
+ "metadata": {
474
+ "explanation": "Wait for one tool call's approval or deadline, then run or reject it."
475
+ }
476
+ },
477
+ {
478
+ "id": "wait:AwaitToolApproval",
479
+ "kind": "wait",
480
+ "name": "anyOf",
481
+ "parentId": "step:AwaitToolApproval",
482
+ "phase": "wait_for",
483
+ "wait": {
484
+ "type": "anyOf",
485
+ "conditions": [
486
+ {
487
+ "index": 0,
488
+ "kind": "channel",
489
+ "label": "ToolCallCancellations",
490
+ "resourceId": "resource:channel:ToolCallCancellations"
491
+ },
492
+ {
493
+ "index": 1,
494
+ "kind": "channel",
495
+ "label": "InterruptResolutions",
496
+ "resourceId": "resource:channel:InterruptResolutions"
497
+ },
498
+ {
499
+ "index": 2,
500
+ "kind": "timer",
501
+ "label": "Timer"
502
+ }
503
+ ]
504
+ }
505
+ },
506
+ {
507
+ "id": "decision:step:AwaitToolApproval:goTo:AwaitToolApproval",
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:CallSingleAttemptTool",
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:goTo:CallTool",
528
+ "kind": "decision",
529
+ "name": "goTo",
530
+ "parentId": "step:AwaitToolApproval",
531
+ "phase": "execute",
532
+ "decision": {
533
+ "type": "goTo"
534
+ }
535
+ },
536
+ {
537
+ "id": "decision:step:AwaitToolApproval:deadEnd",
538
+ "kind": "decision",
539
+ "name": "deadEnd",
540
+ "parentId": "step:AwaitToolApproval",
541
+ "phase": "execute",
542
+ "decision": {
543
+ "type": "deadEnd"
544
+ }
545
+ },
546
+ {
547
+ "id": "step:AwaitQuestionAnswer",
548
+ "kind": "step",
549
+ "name": "AwaitQuestionAnswer",
550
+ "phase": "wait_for+execute",
551
+ "metadata": {
552
+ "explanation": "Wait for one question's answer, decline, or deadline, then record the result."
553
+ }
554
+ },
555
+ {
556
+ "id": "wait:AwaitQuestionAnswer",
557
+ "kind": "wait",
558
+ "name": "anyOf",
559
+ "parentId": "step:AwaitQuestionAnswer",
560
+ "phase": "wait_for",
561
+ "wait": {
562
+ "type": "anyOf",
563
+ "conditions": [
564
+ {
565
+ "index": 0,
566
+ "kind": "channel",
567
+ "label": "ToolCallCancellations",
568
+ "resourceId": "resource:channel:ToolCallCancellations"
569
+ },
570
+ {
571
+ "index": 1,
572
+ "kind": "channel",
573
+ "label": "InterruptResolutions",
574
+ "resourceId": "resource:channel:InterruptResolutions"
575
+ },
576
+ {
577
+ "index": 2,
578
+ "kind": "timer",
579
+ "label": "Timer"
580
+ }
581
+ ]
582
+ }
583
+ },
584
+ {
585
+ "id": "decision:step:AwaitQuestionAnswer:goTo:AwaitQuestionAnswer",
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:CallSingleAttemptTool",
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:CallTool",
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:FinishTurnCancellation",
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:goTo:PollToolTask",
626
+ "kind": "decision",
627
+ "name": "goTo",
628
+ "parentId": "step:AwaitQuestionAnswer",
629
+ "phase": "execute",
630
+ "decision": {
631
+ "type": "goTo"
632
+ }
633
+ },
634
+ {
635
+ "id": "decision:step:AwaitQuestionAnswer:deadEnd",
636
+ "kind": "decision",
637
+ "name": "deadEnd",
638
+ "parentId": "step:AwaitQuestionAnswer",
639
+ "phase": "execute",
640
+ "decision": {
641
+ "type": "deadEnd"
642
+ }
643
+ },
644
+ {
645
+ "id": "step:AwaitTimer",
646
+ "kind": "step",
647
+ "name": "AwaitTimer",
648
+ "phase": "wait_for+execute",
649
+ "metadata": {
650
+ "explanation": "Wait on the Timer of one durable_wait call, then record that it completed."
651
+ }
652
+ },
653
+ {
654
+ "id": "wait:AwaitTimer",
655
+ "kind": "wait",
656
+ "name": "anyOf",
657
+ "parentId": "step:AwaitTimer",
658
+ "phase": "wait_for",
659
+ "wait": {
660
+ "type": "anyOf",
661
+ "conditions": [
662
+ {
663
+ "index": 0,
664
+ "kind": "timer",
665
+ "label": "Timer"
666
+ },
667
+ {
668
+ "index": 1,
669
+ "kind": "channel",
670
+ "label": "ToolCallCancellations",
671
+ "resourceId": "resource:channel:ToolCallCancellations"
672
+ }
673
+ ]
674
+ }
675
+ },
676
+ {
677
+ "id": "decision:step:AwaitTimer:goTo:AwaitTimer",
678
+ "kind": "decision",
679
+ "name": "goTo",
680
+ "parentId": "step:AwaitTimer",
681
+ "phase": "execute",
682
+ "decision": {
683
+ "type": "goTo"
684
+ }
685
+ },
686
+ {
687
+ "id": "decision:step:AwaitTimer:deadEnd",
688
+ "kind": "decision",
689
+ "name": "deadEnd",
690
+ "parentId": "step:AwaitTimer",
691
+ "phase": "execute",
692
+ "decision": {
693
+ "type": "deadEnd"
694
+ }
695
+ },
696
+ {
697
+ "id": "step:CallTool",
698
+ "kind": "step",
699
+ "name": "CallTool",
700
+ "phase": "execute",
701
+ "metadata": {
702
+ "explanation": "Run one read or idempotent write tool call with up to three attempts."
703
+ }
704
+ },
705
+ {
706
+ "id": "decision:step:CallTool:goTo:AwaitQuestionAnswer",
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:goTo:PollToolTask",
717
+ "kind": "decision",
718
+ "name": "goTo",
719
+ "parentId": "step:CallTool",
720
+ "phase": "execute",
721
+ "decision": {
722
+ "type": "goTo"
723
+ }
724
+ },
725
+ {
726
+ "id": "decision:step:CallTool:deadEnd",
727
+ "kind": "decision",
728
+ "name": "deadEnd",
729
+ "parentId": "step:CallTool",
730
+ "phase": "execute",
731
+ "decision": {
732
+ "type": "deadEnd"
733
+ }
734
+ },
735
+ {
736
+ "id": "step:CallSingleAttemptTool",
737
+ "kind": "step",
738
+ "name": "CallSingleAttemptTool",
739
+ "phase": "execute",
740
+ "metadata": {
741
+ "explanation": "Run one non-idempotent or unclassified tool call exactly once."
742
+ }
743
+ },
744
+ {
745
+ "id": "decision:step:CallSingleAttemptTool:goTo:AwaitQuestionAnswer",
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:goTo:PollToolTask",
756
+ "kind": "decision",
757
+ "name": "goTo",
758
+ "parentId": "step:CallSingleAttemptTool",
759
+ "phase": "execute",
760
+ "decision": {
761
+ "type": "goTo"
762
+ }
763
+ },
764
+ {
765
+ "id": "decision:step:CallSingleAttemptTool:deadEnd",
766
+ "kind": "decision",
767
+ "name": "deadEnd",
768
+ "parentId": "step:CallSingleAttemptTool",
769
+ "phase": "execute",
770
+ "decision": {
771
+ "type": "deadEnd"
772
+ }
773
+ },
774
+ {
775
+ "id": "step:PollToolTask",
776
+ "kind": "step",
777
+ "name": "PollToolTask",
778
+ "phase": "wait_for+execute",
779
+ "metadata": {
780
+ "explanation": "Poll one tool's remote task after its poll interval, until the task finishes."
781
+ }
782
+ },
783
+ {
784
+ "id": "wait:PollToolTask",
785
+ "kind": "wait",
786
+ "name": "until",
787
+ "parentId": "step:PollToolTask",
788
+ "phase": "wait_for",
789
+ "wait": {
790
+ "type": "until",
791
+ "conditions": [
792
+ {
793
+ "index": 0,
794
+ "kind": "timer",
795
+ "label": "Timer"
796
+ }
797
+ ]
798
+ }
799
+ },
800
+ {
801
+ "id": "decision:step:PollToolTask:goTo:AwaitQuestionAnswer",
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:FinishTurnCancellation",
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:goTo:PollToolTask",
822
+ "kind": "decision",
823
+ "name": "goTo",
824
+ "parentId": "step:PollToolTask",
825
+ "phase": "execute",
826
+ "decision": {
827
+ "type": "goTo"
828
+ }
829
+ },
830
+ {
831
+ "id": "decision:step:PollToolTask:deadEnd",
832
+ "kind": "decision",
833
+ "name": "deadEnd",
834
+ "parentId": "step:PollToolTask",
835
+ "phase": "execute",
836
+ "decision": {
837
+ "type": "deadEnd"
838
+ }
839
+ },
840
+ {
841
+ "id": "step:RecordToolFailure",
842
+ "kind": "step",
843
+ "name": "RecordToolFailure",
844
+ "phase": "execute",
845
+ "metadata": {
846
+ "explanation": "Record a CallTool call whose attempts ran out: failed for reads, unknown for writes."
847
+ }
848
+ },
849
+ {
850
+ "id": "decision:step:RecordToolFailure:deadEnd",
851
+ "kind": "decision",
852
+ "name": "deadEnd",
853
+ "parentId": "step:RecordToolFailure",
854
+ "phase": "execute",
855
+ "decision": {
856
+ "type": "deadEnd"
857
+ }
858
+ },
859
+ {
860
+ "id": "decision:step:RecordToolFailure:forceFail",
861
+ "kind": "decision",
862
+ "name": "forceFail",
863
+ "parentId": "step:RecordToolFailure",
864
+ "phase": "execute",
865
+ "decision": {
866
+ "type": "forceFail"
867
+ }
868
+ },
869
+ {
870
+ "id": "step:RecordToolOutcomeUnknown",
871
+ "kind": "step",
872
+ "name": "RecordToolOutcomeUnknown",
873
+ "phase": "execute",
874
+ "metadata": {
875
+ "explanation": "Record that a single-attempt tool call stopped without a result."
876
+ }
877
+ },
878
+ {
879
+ "id": "decision:step:RecordToolOutcomeUnknown:deadEnd",
880
+ "kind": "decision",
881
+ "name": "deadEnd",
882
+ "parentId": "step:RecordToolOutcomeUnknown",
883
+ "phase": "execute",
884
+ "decision": {
885
+ "type": "deadEnd"
886
+ }
887
+ },
888
+ {
889
+ "id": "decision:step:RecordToolOutcomeUnknown:forceFail",
890
+ "kind": "decision",
891
+ "name": "forceFail",
892
+ "parentId": "step:RecordToolOutcomeUnknown",
893
+ "phase": "execute",
894
+ "decision": {
895
+ "type": "forceFail"
896
+ }
897
+ },
898
+ {
899
+ "id": "step:ResumeTurn",
900
+ "kind": "step",
901
+ "name": "ResumeTurn",
902
+ "phase": "wait_for+execute",
903
+ "metadata": {
904
+ "explanation": "Wait for every tool call result of the model response, then call the model again."
905
+ }
906
+ },
907
+ {
908
+ "id": "wait:ResumeTurn",
909
+ "kind": "wait",
910
+ "name": "anyOf",
911
+ "parentId": "step:ResumeTurn",
912
+ "phase": "wait_for",
913
+ "wait": {
914
+ "type": "anyOf",
915
+ "conditions": [
916
+ {
917
+ "index": 0,
918
+ "kind": "channel",
919
+ "label": "ToolCallResults",
920
+ "resourceId": "resource:channel:ToolCallResults"
921
+ },
922
+ {
923
+ "index": 1,
924
+ "kind": "channel",
925
+ "label": "TurnControlRequests",
926
+ "resourceId": "resource:channel:TurnControlRequests"
927
+ }
928
+ ]
929
+ }
930
+ },
931
+ {
932
+ "id": "decision:step:ResumeTurn:goTo:ApplyTurnControl",
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:ResumeTurn",
943
+ "kind": "decision",
944
+ "name": "goTo",
945
+ "parentId": "step:ResumeTurn",
946
+ "phase": "execute",
947
+ "decision": {
948
+ "type": "goTo"
949
+ }
950
+ },
951
+ {
952
+ "id": "decision:step:ResumeTurn:goTo:RunModel",
953
+ "kind": "decision",
954
+ "name": "goTo",
955
+ "parentId": "step:ResumeTurn",
956
+ "phase": "execute",
957
+ "decision": {
958
+ "type": "goTo"
959
+ }
960
+ },
961
+ {
962
+ "id": "step:ApplyTurnControl",
963
+ "kind": "step",
964
+ "name": "ApplyTurnControl",
965
+ "phase": "wait_for+execute",
966
+ "metadata": {
967
+ "explanation": "End a steered or cancelled turn, then start a turn with the steered messages."
968
+ }
969
+ },
970
+ {
971
+ "id": "wait:ApplyTurnControl",
972
+ "kind": "wait",
973
+ "name": "allOf",
974
+ "parentId": "step:ApplyTurnControl",
975
+ "phase": "wait_for",
976
+ "wait": {
977
+ "type": "allOf",
978
+ "conditions": [
979
+ {
980
+ "index": 0,
981
+ "kind": "channel",
982
+ "label": "SteeredUserMessages",
983
+ "resourceId": "resource:channel:SteeredUserMessages"
984
+ },
985
+ {
986
+ "index": 1,
987
+ "kind": "channel",
988
+ "label": "TurnControlRequests",
989
+ "resourceId": "resource:channel:TurnControlRequests"
990
+ }
991
+ ]
992
+ }
993
+ },
994
+ {
995
+ "id": "decision:step:ApplyTurnControl:goTo:AwaitUserMessage",
996
+ "kind": "decision",
997
+ "name": "goTo",
998
+ "parentId": "step:ApplyTurnControl",
999
+ "phase": "execute",
1000
+ "decision": {
1001
+ "type": "goTo"
1002
+ }
1003
+ },
1004
+ {
1005
+ "id": "decision:step:ApplyTurnControl:goTo:RunModel",
1006
+ "kind": "decision",
1007
+ "name": "goTo",
1008
+ "parentId": "step:ApplyTurnControl",
1009
+ "phase": "execute",
1010
+ "decision": {
1011
+ "type": "goTo"
1012
+ }
1013
+ },
1014
+ {
1015
+ "id": "step:RecordTurnFailure",
1016
+ "kind": "step",
1017
+ "name": "RecordTurnFailure",
1018
+ "phase": "execute",
1019
+ "metadata": {
1020
+ "explanation": "Record a failed turn and wait for the next user message."
1021
+ }
1022
+ },
1023
+ {
1024
+ "id": "decision:step:RecordTurnFailure:goTo:AwaitUserMessage",
1025
+ "kind": "decision",
1026
+ "name": "goTo",
1027
+ "parentId": "step:RecordTurnFailure",
1028
+ "phase": "execute",
1029
+ "decision": {
1030
+ "type": "goTo"
1031
+ }
1032
+ },
1033
+ {
1034
+ "id": "decision:step:RecordTurnFailure:forceFail",
1035
+ "kind": "decision",
1036
+ "name": "forceFail",
1037
+ "parentId": "step:RecordTurnFailure",
1038
+ "phase": "execute",
1039
+ "decision": {
1040
+ "type": "forceFail"
1041
+ }
1042
+ },
1043
+ {
1044
+ "id": "step:FinishTurnCancellation",
1045
+ "kind": "step",
1046
+ "name": "FinishTurnCancellation",
1047
+ "phase": "execute",
1048
+ "metadata": {
1049
+ "explanation": "Finish a turn that cancel_turn stopped, from the state that committed."
1050
+ }
1051
+ },
1052
+ {
1053
+ "id": "decision:step:FinishTurnCancellation:goTo:ApplyTurnControl",
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:AwaitQuestionAnswer",
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:AwaitToolApproval",
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:goTo:CancelToolTask",
1084
+ "kind": "decision",
1085
+ "name": "goTo",
1086
+ "parentId": "step:FinishTurnCancellation",
1087
+ "phase": "execute",
1088
+ "decision": {
1089
+ "type": "goTo"
1090
+ }
1091
+ },
1092
+ {
1093
+ "id": "decision:step:FinishTurnCancellation:deadEnd",
1094
+ "kind": "decision",
1095
+ "name": "deadEnd",
1096
+ "parentId": "step:FinishTurnCancellation",
1097
+ "phase": "execute",
1098
+ "decision": {
1099
+ "type": "deadEnd"
1100
+ }
1101
+ },
1102
+ {
1103
+ "id": "step:CancelToolTask",
1104
+ "kind": "step",
1105
+ "name": "CancelToolTask",
1106
+ "phase": "execute",
1107
+ "metadata": {
1108
+ "explanation": "Ask the runner to cancel one task that cancel_turn abandoned, then record it."
1109
+ }
1110
+ },
1111
+ {
1112
+ "id": "decision:step:CancelToolTask:deadEnd",
1113
+ "kind": "decision",
1114
+ "name": "deadEnd",
1115
+ "parentId": "step:CancelToolTask",
1116
+ "phase": "execute",
1117
+ "decision": {
1118
+ "type": "deadEnd"
1119
+ }
1120
+ },
1121
+ {
1122
+ "id": "rpc:answer_question",
1123
+ "kind": "rpc",
1124
+ "name": "answer_question"
1125
+ },
1126
+ {
1127
+ "id": "rpc:cancel_turn",
1128
+ "kind": "rpc",
1129
+ "name": "cancel_turn"
1130
+ },
1131
+ {
1132
+ "id": "decision:rpc:cancel_turn:rpcResult",
1133
+ "kind": "decision",
1134
+ "name": "rpcResult",
1135
+ "parentId": "rpc:cancel_turn",
1136
+ "phase": "rpc",
1137
+ "decision": {
1138
+ "type": "rpcResult",
1139
+ "cancellations": [
1140
+ {
1141
+ "stepId": "step:RunModel",
1142
+ "scope": "all"
1143
+ },
1144
+ {
1145
+ "stepId": "step:CompactContext",
1146
+ "scope": "all"
1147
+ },
1148
+ {
1149
+ "stepId": "step:RecordTurnFailure",
1150
+ "scope": "all"
1151
+ },
1152
+ {
1153
+ "stepId": "step:AwaitToolApproval",
1154
+ "scope": "all"
1155
+ },
1156
+ {
1157
+ "stepId": "step:AwaitQuestionAnswer",
1158
+ "scope": "all"
1159
+ },
1160
+ {
1161
+ "stepId": "step:AwaitTimer",
1162
+ "scope": "all"
1163
+ },
1164
+ {
1165
+ "stepId": "step:PollToolTask",
1166
+ "scope": "all"
1167
+ }
1168
+ ]
1169
+ }
1170
+ },
1171
+ {
1172
+ "id": "rpc:delete_queued_message",
1173
+ "kind": "rpc",
1174
+ "name": "delete_queued_message"
1175
+ },
1176
+ {
1177
+ "id": "rpc:execute_plan",
1178
+ "kind": "rpc",
1179
+ "name": "execute_plan"
1180
+ },
1181
+ {
1182
+ "id": "rpc:get_agent_snapshot",
1183
+ "kind": "rpc",
1184
+ "name": "get_agent_snapshot"
1185
+ },
1186
+ {
1187
+ "id": "rpc:list_agent_messages",
1188
+ "kind": "rpc",
1189
+ "name": "list_agent_messages"
1190
+ },
1191
+ {
1192
+ "id": "rpc:resolve_interrupt",
1193
+ "kind": "rpc",
1194
+ "name": "resolve_interrupt"
1195
+ },
1196
+ {
1197
+ "id": "rpc:send_user_message",
1198
+ "kind": "rpc",
1199
+ "name": "send_user_message"
1200
+ },
1201
+ {
1202
+ "id": "rpc:steer_user_message",
1203
+ "kind": "rpc",
1204
+ "name": "steer_user_message"
1205
+ },
1206
+ {
1207
+ "id": "rpc:update_session_settings",
1208
+ "kind": "rpc",
1209
+ "name": "update_session_settings"
1210
+ }
1211
+ ],
1212
+ "edges": [
1213
+ {
1214
+ "id": "edge:0001",
1215
+ "kind": "transition",
1216
+ "from": "decision:step:StartAgentSession:goTo:AwaitUserMessage",
1217
+ "to": "step:AwaitUserMessage",
1218
+ "label": "GoTo"
1219
+ },
1220
+ {
1221
+ "id": "edge:0002",
1222
+ "kind": "transition",
1223
+ "from": "decision:step:StartAgentSession:goTo:RunModel",
1224
+ "to": "step:RunModel",
1225
+ "label": "GoTo"
1226
+ },
1227
+ {
1228
+ "id": "edge:0003",
1229
+ "kind": "wait_condition",
1230
+ "from": "resource:channel:TurnControlRequests",
1231
+ "to": "wait:AwaitUserMessage",
1232
+ "label": "TurnControlRequests",
1233
+ "metadata": {
1234
+ "conditionIndex": 0
1235
+ }
1236
+ },
1237
+ {
1238
+ "id": "edge:0004",
1239
+ "kind": "wait_condition",
1240
+ "from": "resource:channel:QueuedUserMessages",
1241
+ "to": "wait:AwaitUserMessage",
1242
+ "label": "QueuedUserMessages",
1243
+ "metadata": {
1244
+ "conditionIndex": 1
1245
+ }
1246
+ },
1247
+ {
1248
+ "id": "edge:0005",
1249
+ "kind": "wait_condition",
1250
+ "from": "resource:channel:PlanExecutions",
1251
+ "to": "wait:AwaitUserMessage",
1252
+ "label": "PlanExecutions",
1253
+ "metadata": {
1254
+ "conditionIndex": 2
1255
+ }
1256
+ },
1257
+ {
1258
+ "id": "edge:0006",
1259
+ "kind": "transition",
1260
+ "from": "decision:step:AwaitUserMessage:goTo:ApplyTurnControl",
1261
+ "to": "step:ApplyTurnControl",
1262
+ "label": "GoTo"
1263
+ },
1264
+ {
1265
+ "id": "edge:0007",
1266
+ "kind": "transition",
1267
+ "from": "decision:step:AwaitUserMessage:goTo:AwaitUserMessage",
1268
+ "to": "step:AwaitUserMessage",
1269
+ "label": "GoTo"
1270
+ },
1271
+ {
1272
+ "id": "edge:0008",
1273
+ "kind": "transition",
1274
+ "from": "decision:step:AwaitUserMessage:goTo:RunModel",
1275
+ "to": "step:RunModel",
1276
+ "label": "GoTo"
1277
+ },
1278
+ {
1279
+ "id": "edge:0009",
1280
+ "kind": "resource_lock",
1281
+ "from": "step:AwaitUserMessage",
1282
+ "to": "resource:attribute:TurnCancellationRequest",
1283
+ "label": "Lock",
1284
+ "metadata": {
1285
+ "phase": "execute"
1286
+ }
1287
+ },
1288
+ {
1289
+ "id": "edge:0010",
1290
+ "kind": "transition",
1291
+ "from": "decision:step:RunModel:goTo:ApplyTurnControl",
1292
+ "to": "step:ApplyTurnControl",
1293
+ "label": "GoTo"
1294
+ },
1295
+ {
1296
+ "id": "edge:0011",
1297
+ "kind": "transition",
1298
+ "from": "decision:step:RunModel:goTo:AwaitQuestionAnswer",
1299
+ "to": "step:AwaitQuestionAnswer",
1300
+ "label": "GoTo"
1301
+ },
1302
+ {
1303
+ "id": "edge:0012",
1304
+ "kind": "transition",
1305
+ "from": "decision:step:RunModel:goTo:AwaitTimer",
1306
+ "to": "step:AwaitTimer",
1307
+ "label": "GoTo"
1308
+ },
1309
+ {
1310
+ "id": "edge:0013",
1311
+ "kind": "transition",
1312
+ "from": "decision:step:RunModel:goTo:AwaitToolApproval",
1313
+ "to": "step:AwaitToolApproval",
1314
+ "label": "GoTo"
1315
+ },
1316
+ {
1317
+ "id": "edge:0014",
1318
+ "kind": "transition",
1319
+ "from": "decision:step:RunModel:goTo:AwaitUserMessage",
1320
+ "to": "step:AwaitUserMessage",
1321
+ "label": "GoTo"
1322
+ },
1323
+ {
1324
+ "id": "edge:0015",
1325
+ "kind": "transition",
1326
+ "from": "decision:step:RunModel:goTo:CallSingleAttemptTool",
1327
+ "to": "step:CallSingleAttemptTool",
1328
+ "label": "GoTo"
1329
+ },
1330
+ {
1331
+ "id": "edge:0016",
1332
+ "kind": "transition",
1333
+ "from": "decision:step:RunModel:goTo:CallTool",
1334
+ "to": "step:CallTool",
1335
+ "label": "GoTo"
1336
+ },
1337
+ {
1338
+ "id": "edge:0017",
1339
+ "kind": "transition",
1340
+ "from": "decision:step:RunModel:goTo:CompactContext",
1341
+ "to": "step:CompactContext",
1342
+ "label": "GoTo"
1343
+ },
1344
+ {
1345
+ "id": "edge:0018",
1346
+ "kind": "transition",
1347
+ "from": "decision:step:RunModel:goTo:RecordTurnFailure",
1348
+ "to": "step:RecordTurnFailure",
1349
+ "label": "GoTo"
1350
+ },
1351
+ {
1352
+ "id": "edge:0019",
1353
+ "kind": "transition",
1354
+ "from": "decision:step:RunModel:goTo:ResumeTurn",
1355
+ "to": "step:ResumeTurn",
1356
+ "label": "GoTo"
1357
+ },
1358
+ {
1359
+ "id": "edge:0020",
1360
+ "kind": "transition",
1361
+ "from": "decision:step:RunModel:goTo:RunModel",
1362
+ "to": "step:RunModel",
1363
+ "label": "GoTo"
1364
+ },
1365
+ {
1366
+ "id": "edge:0021",
1367
+ "kind": "resource_publish",
1368
+ "from": "step:RunModel",
1369
+ "to": "resource:channel:ToolCallResults",
1370
+ "label": "Publish",
1371
+ "metadata": {
1372
+ "phase": "execute"
1373
+ }
1374
+ },
1375
+ {
1376
+ "id": "edge:0022",
1377
+ "kind": "transition",
1378
+ "from": "decision:step:CompactContext:goTo:RecordTurnFailure",
1379
+ "to": "step:RecordTurnFailure",
1380
+ "label": "GoTo"
1381
+ },
1382
+ {
1383
+ "id": "edge:0023",
1384
+ "kind": "transition",
1385
+ "from": "decision:step:CompactContext:goTo:RunModel",
1386
+ "to": "step:RunModel",
1387
+ "label": "GoTo"
1388
+ },
1389
+ {
1390
+ "id": "edge:0024",
1391
+ "kind": "wait_condition",
1392
+ "from": "resource:channel:ToolCallCancellations",
1393
+ "to": "wait:AwaitToolApproval",
1394
+ "label": "ToolCallCancellations",
1395
+ "metadata": {
1396
+ "conditionIndex": 0
1397
+ }
1398
+ },
1399
+ {
1400
+ "id": "edge:0025",
1401
+ "kind": "wait_condition",
1402
+ "from": "resource:channel:InterruptResolutions",
1403
+ "to": "wait:AwaitToolApproval",
1404
+ "label": "InterruptResolutions",
1405
+ "metadata": {
1406
+ "conditionIndex": 1
1407
+ }
1408
+ },
1409
+ {
1410
+ "id": "edge:0026",
1411
+ "kind": "transition",
1412
+ "from": "decision:step:AwaitToolApproval:goTo:AwaitToolApproval",
1413
+ "to": "step:AwaitToolApproval",
1414
+ "label": "GoTo"
1415
+ },
1416
+ {
1417
+ "id": "edge:0027",
1418
+ "kind": "transition",
1419
+ "from": "decision:step:AwaitToolApproval:goTo:CallSingleAttemptTool",
1420
+ "to": "step:CallSingleAttemptTool",
1421
+ "label": "GoTo"
1422
+ },
1423
+ {
1424
+ "id": "edge:0028",
1425
+ "kind": "transition",
1426
+ "from": "decision:step:AwaitToolApproval:goTo:CallTool",
1427
+ "to": "step:CallTool",
1428
+ "label": "GoTo"
1429
+ },
1430
+ {
1431
+ "id": "edge:0029",
1432
+ "kind": "resource_lock",
1433
+ "from": "step:AwaitToolApproval",
1434
+ "to": "resource:attribute:PendingInterrupts",
1435
+ "label": "Lock",
1436
+ "metadata": {
1437
+ "phase": "execute"
1438
+ }
1439
+ },
1440
+ {
1441
+ "id": "edge:0030",
1442
+ "kind": "resource_publish",
1443
+ "from": "step:AwaitToolApproval",
1444
+ "to": "resource:channel:ToolCallResults",
1445
+ "label": "Publish",
1446
+ "metadata": {
1447
+ "phase": "execute"
1448
+ }
1449
+ },
1450
+ {
1451
+ "id": "edge:0031",
1452
+ "kind": "wait_condition",
1453
+ "from": "resource:channel:ToolCallCancellations",
1454
+ "to": "wait:AwaitQuestionAnswer",
1455
+ "label": "ToolCallCancellations",
1456
+ "metadata": {
1457
+ "conditionIndex": 0
1458
+ }
1459
+ },
1460
+ {
1461
+ "id": "edge:0032",
1462
+ "kind": "wait_condition",
1463
+ "from": "resource:channel:InterruptResolutions",
1464
+ "to": "wait:AwaitQuestionAnswer",
1465
+ "label": "InterruptResolutions",
1466
+ "metadata": {
1467
+ "conditionIndex": 1
1468
+ }
1469
+ },
1470
+ {
1471
+ "id": "edge:0033",
1472
+ "kind": "transition",
1473
+ "from": "decision:step:AwaitQuestionAnswer:goTo:AwaitQuestionAnswer",
1474
+ "to": "step:AwaitQuestionAnswer",
1475
+ "label": "GoTo"
1476
+ },
1477
+ {
1478
+ "id": "edge:0034",
1479
+ "kind": "transition",
1480
+ "from": "decision:step:AwaitQuestionAnswer:goTo:CallSingleAttemptTool",
1481
+ "to": "step:CallSingleAttemptTool",
1482
+ "label": "GoTo"
1483
+ },
1484
+ {
1485
+ "id": "edge:0035",
1486
+ "kind": "transition",
1487
+ "from": "decision:step:AwaitQuestionAnswer:goTo:CallTool",
1488
+ "to": "step:CallTool",
1489
+ "label": "GoTo"
1490
+ },
1491
+ {
1492
+ "id": "edge:0036",
1493
+ "kind": "transition",
1494
+ "from": "decision:step:AwaitQuestionAnswer:goTo:FinishTurnCancellation",
1495
+ "to": "step:FinishTurnCancellation",
1496
+ "label": "GoTo"
1497
+ },
1498
+ {
1499
+ "id": "edge:0037",
1500
+ "kind": "transition",
1501
+ "from": "decision:step:AwaitQuestionAnswer:goTo:PollToolTask",
1502
+ "to": "step:PollToolTask",
1503
+ "label": "GoTo"
1504
+ },
1505
+ {
1506
+ "id": "edge:0038",
1507
+ "kind": "resource_lock",
1508
+ "from": "step:AwaitQuestionAnswer",
1509
+ "to": "resource:attribute:PendingInterrupts",
1510
+ "label": "Lock",
1511
+ "metadata": {
1512
+ "phase": "execute"
1513
+ }
1514
+ },
1515
+ {
1516
+ "id": "edge:0039",
1517
+ "kind": "resource_publish",
1518
+ "from": "step:AwaitQuestionAnswer",
1519
+ "to": "resource:channel:ToolCallResults",
1520
+ "label": "Publish",
1521
+ "metadata": {
1522
+ "phase": "execute"
1523
+ }
1524
+ },
1525
+ {
1526
+ "id": "edge:0040",
1527
+ "kind": "wait_condition",
1528
+ "from": "resource:channel:ToolCallCancellations",
1529
+ "to": "wait:AwaitTimer",
1530
+ "label": "ToolCallCancellations",
1531
+ "metadata": {
1532
+ "conditionIndex": 1
1533
+ }
1534
+ },
1535
+ {
1536
+ "id": "edge:0041",
1537
+ "kind": "transition",
1538
+ "from": "decision:step:AwaitTimer:goTo:AwaitTimer",
1539
+ "to": "step:AwaitTimer",
1540
+ "label": "GoTo"
1541
+ },
1542
+ {
1543
+ "id": "edge:0042",
1544
+ "kind": "resource_publish",
1545
+ "from": "step:AwaitTimer",
1546
+ "to": "resource:channel:ToolCallResults",
1547
+ "label": "Publish",
1548
+ "metadata": {
1549
+ "phase": "execute"
1550
+ }
1551
+ },
1552
+ {
1553
+ "id": "edge:0043",
1554
+ "kind": "transition",
1555
+ "from": "decision:step:CallTool:goTo:AwaitQuestionAnswer",
1556
+ "to": "step:AwaitQuestionAnswer",
1557
+ "label": "GoTo"
1558
+ },
1559
+ {
1560
+ "id": "edge:0044",
1561
+ "kind": "transition",
1562
+ "from": "decision:step:CallTool:goTo:PollToolTask",
1563
+ "to": "step:PollToolTask",
1564
+ "label": "GoTo"
1565
+ },
1566
+ {
1567
+ "id": "edge:0045",
1568
+ "kind": "resource_publish",
1569
+ "from": "step:CallTool",
1570
+ "to": "resource:channel:ToolCallResults",
1571
+ "label": "Publish",
1572
+ "metadata": {
1573
+ "phase": "execute"
1574
+ }
1575
+ },
1576
+ {
1577
+ "id": "edge:0046",
1578
+ "kind": "transition",
1579
+ "from": "decision:step:CallSingleAttemptTool:goTo:AwaitQuestionAnswer",
1580
+ "to": "step:AwaitQuestionAnswer",
1581
+ "label": "GoTo"
1582
+ },
1583
+ {
1584
+ "id": "edge:0047",
1585
+ "kind": "transition",
1586
+ "from": "decision:step:CallSingleAttemptTool:goTo:PollToolTask",
1587
+ "to": "step:PollToolTask",
1588
+ "label": "GoTo"
1589
+ },
1590
+ {
1591
+ "id": "edge:0048",
1592
+ "kind": "resource_publish",
1593
+ "from": "step:CallSingleAttemptTool",
1594
+ "to": "resource:channel:ToolCallResults",
1595
+ "label": "Publish",
1596
+ "metadata": {
1597
+ "phase": "execute"
1598
+ }
1599
+ },
1600
+ {
1601
+ "id": "edge:0049",
1602
+ "kind": "transition",
1603
+ "from": "decision:step:PollToolTask:goTo:AwaitQuestionAnswer",
1604
+ "to": "step:AwaitQuestionAnswer",
1605
+ "label": "GoTo"
1606
+ },
1607
+ {
1608
+ "id": "edge:0050",
1609
+ "kind": "transition",
1610
+ "from": "decision:step:PollToolTask:goTo:FinishTurnCancellation",
1611
+ "to": "step:FinishTurnCancellation",
1612
+ "label": "GoTo"
1613
+ },
1614
+ {
1615
+ "id": "edge:0051",
1616
+ "kind": "transition",
1617
+ "from": "decision:step:PollToolTask:goTo:PollToolTask",
1618
+ "to": "step:PollToolTask",
1619
+ "label": "GoTo"
1620
+ },
1621
+ {
1622
+ "id": "edge:0052",
1623
+ "kind": "resource_publish",
1624
+ "from": "step:PollToolTask",
1625
+ "to": "resource:channel:ToolCallResults",
1626
+ "label": "Publish",
1627
+ "metadata": {
1628
+ "phase": "execute"
1629
+ }
1630
+ },
1631
+ {
1632
+ "id": "edge:0053",
1633
+ "kind": "resource_publish",
1634
+ "from": "step:RecordToolFailure",
1635
+ "to": "resource:channel:ToolCallResults",
1636
+ "label": "Publish",
1637
+ "metadata": {
1638
+ "phase": "execute"
1639
+ }
1640
+ },
1641
+ {
1642
+ "id": "edge:0054",
1643
+ "kind": "resource_publish",
1644
+ "from": "step:RecordToolOutcomeUnknown",
1645
+ "to": "resource:channel:ToolCallResults",
1646
+ "label": "Publish",
1647
+ "metadata": {
1648
+ "phase": "execute"
1649
+ }
1650
+ },
1651
+ {
1652
+ "id": "edge:0055",
1653
+ "kind": "wait_condition",
1654
+ "from": "resource:channel:ToolCallResults",
1655
+ "to": "wait:ResumeTurn",
1656
+ "label": "ToolCallResults",
1657
+ "metadata": {
1658
+ "conditionIndex": 0
1659
+ }
1660
+ },
1661
+ {
1662
+ "id": "edge:0056",
1663
+ "kind": "wait_condition",
1664
+ "from": "resource:channel:TurnControlRequests",
1665
+ "to": "wait:ResumeTurn",
1666
+ "label": "TurnControlRequests",
1667
+ "metadata": {
1668
+ "conditionIndex": 1
1669
+ }
1670
+ },
1671
+ {
1672
+ "id": "edge:0057",
1673
+ "kind": "transition",
1674
+ "from": "decision:step:ResumeTurn:goTo:ApplyTurnControl",
1675
+ "to": "step:ApplyTurnControl",
1676
+ "label": "GoTo"
1677
+ },
1678
+ {
1679
+ "id": "edge:0058",
1680
+ "kind": "transition",
1681
+ "from": "decision:step:ResumeTurn:goTo:ResumeTurn",
1682
+ "to": "step:ResumeTurn",
1683
+ "label": "GoTo"
1684
+ },
1685
+ {
1686
+ "id": "edge:0059",
1687
+ "kind": "transition",
1688
+ "from": "decision:step:ResumeTurn:goTo:RunModel",
1689
+ "to": "step:RunModel",
1690
+ "label": "GoTo"
1691
+ },
1692
+ {
1693
+ "id": "edge:0060",
1694
+ "kind": "resource_lock",
1695
+ "from": "step:ResumeTurn",
1696
+ "to": "resource:attribute:PendingInterrupts",
1697
+ "label": "Lock",
1698
+ "metadata": {
1699
+ "phase": "execute"
1700
+ }
1701
+ },
1702
+ {
1703
+ "id": "edge:0061",
1704
+ "kind": "resource_publish",
1705
+ "from": "step:ResumeTurn",
1706
+ "to": "resource:channel:ToolCallCancellations",
1707
+ "label": "Publish",
1708
+ "metadata": {
1709
+ "phase": "execute"
1710
+ }
1711
+ },
1712
+ {
1713
+ "id": "edge:0062",
1714
+ "kind": "wait_condition",
1715
+ "from": "resource:channel:SteeredUserMessages",
1716
+ "to": "wait:ApplyTurnControl",
1717
+ "label": "SteeredUserMessages",
1718
+ "metadata": {
1719
+ "conditionIndex": 0
1720
+ }
1721
+ },
1722
+ {
1723
+ "id": "edge:0063",
1724
+ "kind": "wait_condition",
1725
+ "from": "resource:channel:TurnControlRequests",
1726
+ "to": "wait:ApplyTurnControl",
1727
+ "label": "TurnControlRequests",
1728
+ "metadata": {
1729
+ "conditionIndex": 1
1730
+ }
1731
+ },
1732
+ {
1733
+ "id": "edge:0064",
1734
+ "kind": "transition",
1735
+ "from": "decision:step:ApplyTurnControl:goTo:AwaitUserMessage",
1736
+ "to": "step:AwaitUserMessage",
1737
+ "label": "GoTo"
1738
+ },
1739
+ {
1740
+ "id": "edge:0065",
1741
+ "kind": "transition",
1742
+ "from": "decision:step:ApplyTurnControl:goTo:RunModel",
1743
+ "to": "step:RunModel",
1744
+ "label": "GoTo"
1745
+ },
1746
+ {
1747
+ "id": "edge:0066",
1748
+ "kind": "resource_lock",
1749
+ "from": "step:ApplyTurnControl",
1750
+ "to": "resource:attribute:TurnCancellationRequest",
1751
+ "label": "Lock",
1752
+ "metadata": {
1753
+ "phase": "execute"
1754
+ }
1755
+ },
1756
+ {
1757
+ "id": "edge:0067",
1758
+ "kind": "transition",
1759
+ "from": "decision:step:RecordTurnFailure:goTo:AwaitUserMessage",
1760
+ "to": "step:AwaitUserMessage",
1761
+ "label": "GoTo"
1762
+ },
1763
+ {
1764
+ "id": "edge:0068",
1765
+ "kind": "transition",
1766
+ "from": "decision:step:FinishTurnCancellation:goTo:ApplyTurnControl",
1767
+ "to": "step:ApplyTurnControl",
1768
+ "label": "GoTo"
1769
+ },
1770
+ {
1771
+ "id": "edge:0069",
1772
+ "kind": "transition",
1773
+ "from": "decision:step:FinishTurnCancellation:goTo:AwaitQuestionAnswer",
1774
+ "to": "step:AwaitQuestionAnswer",
1775
+ "label": "GoTo"
1776
+ },
1777
+ {
1778
+ "id": "edge:0070",
1779
+ "kind": "transition",
1780
+ "from": "decision:step:FinishTurnCancellation:goTo:AwaitToolApproval",
1781
+ "to": "step:AwaitToolApproval",
1782
+ "label": "GoTo"
1783
+ },
1784
+ {
1785
+ "id": "edge:0071",
1786
+ "kind": "transition",
1787
+ "from": "decision:step:FinishTurnCancellation:goTo:CancelToolTask",
1788
+ "to": "step:CancelToolTask",
1789
+ "label": "GoTo"
1790
+ },
1791
+ {
1792
+ "id": "edge:0072",
1793
+ "kind": "resource_lock",
1794
+ "from": "step:FinishTurnCancellation",
1795
+ "to": "resource:attribute:TurnCancellationRequest",
1796
+ "label": "Lock",
1797
+ "metadata": {
1798
+ "phase": "execute"
1799
+ }
1800
+ },
1801
+ {
1802
+ "id": "edge:0073",
1803
+ "kind": "resource_lock",
1804
+ "from": "step:FinishTurnCancellation",
1805
+ "to": "resource:attribute:PendingInterrupts",
1806
+ "label": "Lock",
1807
+ "metadata": {
1808
+ "phase": "execute"
1809
+ }
1810
+ },
1811
+ {
1812
+ "id": "edge:0074",
1813
+ "kind": "resource_publish",
1814
+ "from": "step:FinishTurnCancellation",
1815
+ "to": "resource:channel:ToolCallResults",
1816
+ "label": "Publish",
1817
+ "metadata": {
1818
+ "phase": "execute"
1819
+ }
1820
+ },
1821
+ {
1822
+ "id": "edge:0075",
1823
+ "kind": "resource_publish",
1824
+ "from": "step:CancelToolTask",
1825
+ "to": "resource:channel:ToolCallResults",
1826
+ "label": "Publish",
1827
+ "metadata": {
1828
+ "phase": "execute"
1829
+ }
1830
+ },
1831
+ {
1832
+ "id": "edge:0076",
1833
+ "kind": "failure_transition",
1834
+ "from": "step:CallSingleAttemptTool",
1835
+ "to": "step:RecordToolOutcomeUnknown",
1836
+ "label": "Execute failure",
1837
+ "metadata": {
1838
+ "skipWaitFor": true
1839
+ }
1840
+ },
1841
+ {
1842
+ "id": "edge:0077",
1843
+ "kind": "failure_transition",
1844
+ "from": "step:CallTool",
1845
+ "to": "step:RecordToolFailure",
1846
+ "label": "Execute failure",
1847
+ "metadata": {
1848
+ "skipWaitFor": true
1849
+ }
1850
+ },
1851
+ {
1852
+ "id": "edge:0078",
1853
+ "kind": "failure_transition",
1854
+ "from": "step:CancelToolTask",
1855
+ "to": "step:RecordToolOutcomeUnknown",
1856
+ "label": "Execute failure",
1857
+ "metadata": {
1858
+ "skipWaitFor": true
1859
+ }
1860
+ },
1861
+ {
1862
+ "id": "edge:0079",
1863
+ "kind": "failure_transition",
1864
+ "from": "step:CompactContext",
1865
+ "to": "step:RecordTurnFailure",
1866
+ "label": "Execute failure",
1867
+ "metadata": {
1868
+ "skipWaitFor": true
1869
+ }
1870
+ },
1871
+ {
1872
+ "id": "edge:0080",
1873
+ "kind": "failure_transition",
1874
+ "from": "step:PollToolTask",
1875
+ "to": "step:RecordToolFailure",
1876
+ "label": "Execute failure",
1877
+ "metadata": {
1878
+ "skipWaitFor": true
1879
+ }
1880
+ },
1881
+ {
1882
+ "id": "edge:0081",
1883
+ "kind": "failure_transition",
1884
+ "from": "step:PollToolTask",
1885
+ "to": "step:RecordToolOutcomeUnknown",
1886
+ "label": "Execute failure",
1887
+ "metadata": {
1888
+ "skipWaitFor": true
1889
+ }
1890
+ },
1891
+ {
1892
+ "id": "edge:0082",
1893
+ "kind": "failure_transition",
1894
+ "from": "step:RunModel",
1895
+ "to": "step:RecordTurnFailure",
1896
+ "label": "Execute failure",
1897
+ "metadata": {
1898
+ "skipWaitFor": true
1899
+ }
1900
+ },
1901
+ {
1902
+ "id": "edge:0083",
1903
+ "kind": "resource_lock",
1904
+ "from": "rpc:answer_question",
1905
+ "to": "resource:attribute:PendingInterrupts",
1906
+ "label": "Lock"
1907
+ },
1908
+ {
1909
+ "id": "edge:0084",
1910
+ "kind": "resource_publish",
1911
+ "from": "rpc:answer_question",
1912
+ "to": "resource:channel:InterruptResolutions",
1913
+ "label": "Publish"
1914
+ },
1915
+ {
1916
+ "id": "edge:0085",
1917
+ "kind": "resource_lock",
1918
+ "from": "rpc:cancel_turn",
1919
+ "to": "resource:attribute:PendingInterrupts",
1920
+ "label": "Lock"
1921
+ },
1922
+ {
1923
+ "id": "edge:0086",
1924
+ "kind": "resource_lock",
1925
+ "from": "rpc:cancel_turn",
1926
+ "to": "resource:attribute:TurnCancellationRequest",
1927
+ "label": "Lock"
1928
+ },
1929
+ {
1930
+ "id": "edge:0087",
1931
+ "kind": "transition",
1932
+ "from": "decision:rpc:cancel_turn:rpcResult",
1933
+ "to": "step:FinishTurnCancellation",
1934
+ "label": "GoTo"
1935
+ },
1936
+ {
1937
+ "id": "edge:0088",
1938
+ "kind": "cancel",
1939
+ "from": "decision:rpc:cancel_turn:rpcResult",
1940
+ "to": "step:RunModel",
1941
+ "label": "Cancel"
1942
+ },
1943
+ {
1944
+ "id": "edge:0089",
1945
+ "kind": "cancel",
1946
+ "from": "decision:rpc:cancel_turn:rpcResult",
1947
+ "to": "step:CompactContext",
1948
+ "label": "Cancel"
1949
+ },
1950
+ {
1951
+ "id": "edge:0090",
1952
+ "kind": "cancel",
1953
+ "from": "decision:rpc:cancel_turn:rpcResult",
1954
+ "to": "step:RecordTurnFailure",
1955
+ "label": "Cancel"
1956
+ },
1957
+ {
1958
+ "id": "edge:0091",
1959
+ "kind": "cancel",
1960
+ "from": "decision:rpc:cancel_turn:rpcResult",
1961
+ "to": "step:AwaitToolApproval",
1962
+ "label": "Cancel"
1963
+ },
1964
+ {
1965
+ "id": "edge:0092",
1966
+ "kind": "cancel",
1967
+ "from": "decision:rpc:cancel_turn:rpcResult",
1968
+ "to": "step:AwaitQuestionAnswer",
1969
+ "label": "Cancel"
1970
+ },
1971
+ {
1972
+ "id": "edge:0093",
1973
+ "kind": "cancel",
1974
+ "from": "decision:rpc:cancel_turn:rpcResult",
1975
+ "to": "step:AwaitTimer",
1976
+ "label": "Cancel"
1977
+ },
1978
+ {
1979
+ "id": "edge:0094",
1980
+ "kind": "cancel",
1981
+ "from": "decision:rpc:cancel_turn:rpcResult",
1982
+ "to": "step:PollToolTask",
1983
+ "label": "Cancel"
1984
+ },
1985
+ {
1986
+ "id": "edge:0095",
1987
+ "kind": "resource_lock",
1988
+ "from": "rpc:execute_plan",
1989
+ "to": "resource:attribute:PendingPlanExecution",
1990
+ "label": "Lock"
1991
+ },
1992
+ {
1993
+ "id": "edge:0096",
1994
+ "kind": "resource_publish",
1995
+ "from": "rpc:execute_plan",
1996
+ "to": "resource:channel:PlanExecutions",
1997
+ "label": "Publish"
1998
+ },
1999
+ {
2000
+ "id": "edge:0097",
2001
+ "kind": "resource_lock",
2002
+ "from": "rpc:resolve_interrupt",
2003
+ "to": "resource:attribute:PendingInterrupts",
2004
+ "label": "Lock"
2005
+ },
2006
+ {
2007
+ "id": "edge:0098",
2008
+ "kind": "resource_publish",
2009
+ "from": "rpc:resolve_interrupt",
2010
+ "to": "resource:channel:InterruptResolutions",
2011
+ "label": "Publish"
2012
+ },
2013
+ {
2014
+ "id": "edge:0099",
2015
+ "kind": "resource_publish",
2016
+ "from": "rpc:send_user_message",
2017
+ "to": "resource:channel:QueuedUserMessages",
2018
+ "label": "Publish"
2019
+ },
2020
+ {
2021
+ "id": "edge:0100",
2022
+ "kind": "resource_publish",
2023
+ "from": "rpc:steer_user_message",
2024
+ "to": "resource:channel:QueuedUserMessages",
2025
+ "label": "Publish"
2026
+ },
2027
+ {
2028
+ "id": "edge:0101",
2029
+ "kind": "resource_publish",
2030
+ "from": "rpc:steer_user_message",
2031
+ "to": "resource:channel:SteeredUserMessages",
2032
+ "label": "Publish"
2033
+ },
2034
+ {
2035
+ "id": "edge:0102",
2036
+ "kind": "resource_publish",
2037
+ "from": "rpc:steer_user_message",
2038
+ "to": "resource:channel:TurnControlRequests",
2039
+ "label": "Publish"
2040
+ }
2041
+ ],
2042
+ "diagnostics": [],
2043
+ "groups": [
2044
+ {
2045
+ "id": "session",
2046
+ "label": "Session",
2047
+ "stepIds": [
2048
+ "step:StartAgentSession",
2049
+ "step:AwaitUserMessage"
2050
+ ]
2051
+ },
2052
+ {
2053
+ "id": "model",
2054
+ "label": "Model",
2055
+ "stepIds": [
2056
+ "step:RunModel",
2057
+ "step:CompactContext"
2058
+ ]
2059
+ },
2060
+ {
2061
+ "id": "wait",
2062
+ "label": "Wait",
2063
+ "stepIds": [
2064
+ "step:AwaitToolApproval",
2065
+ "step:AwaitQuestionAnswer",
2066
+ "step:AwaitTimer"
2067
+ ]
2068
+ },
2069
+ {
2070
+ "id": "tools",
2071
+ "label": "Tools",
2072
+ "stepIds": [
2073
+ "step:CallTool",
2074
+ "step:CallSingleAttemptTool",
2075
+ "step:PollToolTask"
2076
+ ]
2077
+ },
2078
+ {
2079
+ "id": "turn-end",
2080
+ "label": "Turn end",
2081
+ "stepIds": [
2082
+ "step:ResumeTurn",
2083
+ "step:ApplyTurnControl"
2084
+ ]
2085
+ },
2086
+ {
2087
+ "id": "cancellation",
2088
+ "label": "Cancellation",
2089
+ "stepIds": [
2090
+ "step:FinishTurnCancellation",
2091
+ "step:CancelToolTask"
2092
+ ]
2093
+ }
2094
+ ],
2095
+ "v2": {
2096
+ "indexedAttributes": [],
2097
+ "summary": {
2098
+ "rpcName": "GetDexSummary",
2099
+ "fields": []
2100
+ },
2101
+ "display": {
2102
+ "rpcName": "GetDexDisplay",
2103
+ "fields": []
2104
+ },
2105
+ "actions": [
2106
+ {
2107
+ "rpcName": "resolve_interrupt",
2108
+ "label": "Resolve interrupt",
2109
+ "requiredPermission": "<action-permission>",
2110
+ "input": {
2111
+ "kind": "object",
2112
+ "fields": [
2113
+ {
2114
+ "fieldName": "interrupt_id",
2115
+ "valueType": "string",
2116
+ "source": "user",
2117
+ "required": true,
2118
+ "description": "Interrupt ID"
2119
+ },
2120
+ {
2121
+ "fieldName": "approved",
2122
+ "valueType": "bool",
2123
+ "source": "user",
2124
+ "required": true,
2125
+ "description": "Approve the tool call"
2126
+ },
2127
+ {
2128
+ "fieldName": "rejection_message",
2129
+ "valueType": "string",
2130
+ "source": "user",
2131
+ "required": false,
2132
+ "description": "Message the model sees after a rejection"
2133
+ }
2134
+ ]
2135
+ }
2136
+ },
2137
+ {
2138
+ "rpcName": "answer_question",
2139
+ "label": "Answer question",
2140
+ "requiredPermission": "<action-permission>",
2141
+ "input": {
2142
+ "kind": "object",
2143
+ "fields": [
2144
+ {
2145
+ "fieldName": "interrupt_id",
2146
+ "valueType": "string",
2147
+ "source": "user",
2148
+ "required": true,
2149
+ "description": "Interrupt ID"
2150
+ },
2151
+ {
2152
+ "fieldName": "answer",
2153
+ "valueType": "string",
2154
+ "source": "user",
2155
+ "required": true,
2156
+ "description": "Answer"
2157
+ }
2158
+ ]
2159
+ }
2160
+ },
2161
+ {
2162
+ "rpcName": "steer_user_message",
2163
+ "label": "Steer turn",
2164
+ "requiredPermission": "<action-permission>",
2165
+ "input": {
2166
+ "kind": "object",
2167
+ "fields": [
2168
+ {
2169
+ "fieldName": "message_id",
2170
+ "valueType": "string",
2171
+ "source": "user",
2172
+ "required": false,
2173
+ "description": "Queued message ID"
2174
+ },
2175
+ {
2176
+ "fieldName": "text",
2177
+ "valueType": "string",
2178
+ "source": "user",
2179
+ "required": false,
2180
+ "description": "New message"
2181
+ }
2182
+ ]
2183
+ }
2184
+ },
2185
+ {
2186
+ "rpcName": "cancel_turn",
2187
+ "label": "Stop turn",
2188
+ "requiredPermission": "<action-permission>",
2189
+ "input": {
2190
+ "kind": "object",
2191
+ "fields": [
2192
+ {
2193
+ "fieldName": "turn_id",
2194
+ "valueType": "string",
2195
+ "source": "user",
2196
+ "required": false,
2197
+ "description": "Turn ID"
2198
+ }
2199
+ ]
2200
+ }
2201
+ }
2202
+ ]
2203
+ }
2204
+ }