@inf-monkeys-tech/monkeys 1.0.28 → 1.0.30
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.
- package/lib/contracts/agent.d.ts +115 -0
- package/lib/contracts/agent.d.ts.map +1 -1
- package/lib/contracts/agent.js +81 -1
- package/lib/contracts/agent.js.map +1 -1
- package/lib/esm/contracts/index.mjs +69 -0
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +70 -0
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +63 -0
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +70 -0
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/agent-workbench-navigation-view-model.schema.json +245 -0
- package/lib/json-schema/index.json +1 -0
- package/lib/schemas/index.d.ts +63 -1
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +10 -3
- package/lib/schemas/index.js.map +1 -1
- package/package.json +2 -2
- package/test/fixtures/agent-session-scenarios.json +328 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
{
|
|
2
|
+
"streamInterrupted": {
|
|
3
|
+
"contract": "AgentSessionViewModel",
|
|
4
|
+
"sessionId": "scenario-stream-interrupted",
|
|
5
|
+
"snapshot": {
|
|
6
|
+
"mode": "agent",
|
|
7
|
+
"modelId": "openai:gpt-5.1-codex",
|
|
8
|
+
"capabilities": { "text": true, "resume": true }
|
|
9
|
+
},
|
|
10
|
+
"status": "stopped",
|
|
11
|
+
"events": [
|
|
12
|
+
{
|
|
13
|
+
"contract": "AgentSessionEvent",
|
|
14
|
+
"eventId": "stream-status-running",
|
|
15
|
+
"sessionId": "scenario-stream-interrupted",
|
|
16
|
+
"sequence": 0,
|
|
17
|
+
"idempotencyKey": "scenario-stream-interrupted:0",
|
|
18
|
+
"occurredAt": "2026-08-02T01:00:00.000Z",
|
|
19
|
+
"eventType": "status",
|
|
20
|
+
"payload": { "status": "running" }
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"contract": "AgentSessionEvent",
|
|
24
|
+
"eventId": "stream-message-partial",
|
|
25
|
+
"sessionId": "scenario-stream-interrupted",
|
|
26
|
+
"sequence": 1,
|
|
27
|
+
"idempotencyKey": "scenario-stream-interrupted:1",
|
|
28
|
+
"occurredAt": "2026-08-02T01:00:01.000Z",
|
|
29
|
+
"eventType": "message",
|
|
30
|
+
"payload": {
|
|
31
|
+
"messageId": "stream-assistant-message",
|
|
32
|
+
"role": "assistant",
|
|
33
|
+
"operation": "append",
|
|
34
|
+
"parts": [{ "type": "text", "text": "Partial response" }],
|
|
35
|
+
"status": "streaming"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"contract": "AgentSessionEvent",
|
|
40
|
+
"eventId": "stream-resumable",
|
|
41
|
+
"sessionId": "scenario-stream-interrupted",
|
|
42
|
+
"sequence": 2,
|
|
43
|
+
"idempotencyKey": "scenario-stream-interrupted:2",
|
|
44
|
+
"occurredAt": "2026-08-02T01:00:02.000Z",
|
|
45
|
+
"eventType": "resume",
|
|
46
|
+
"payload": { "resumable": true, "reason": "user_stopped" }
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"contract": "AgentSessionEvent",
|
|
50
|
+
"eventId": "stream-status-stopped",
|
|
51
|
+
"sessionId": "scenario-stream-interrupted",
|
|
52
|
+
"sequence": 3,
|
|
53
|
+
"idempotencyKey": "scenario-stream-interrupted:3",
|
|
54
|
+
"occurredAt": "2026-08-02T01:00:03.000Z",
|
|
55
|
+
"eventType": "status",
|
|
56
|
+
"payload": { "status": "stopped", "stoppedAt": "2026-08-02T01:00:03.000Z", "durationMs": 3000 }
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"lastSequence": 3,
|
|
60
|
+
"resumable": true
|
|
61
|
+
},
|
|
62
|
+
"approvalWaiting": {
|
|
63
|
+
"contract": "AgentSessionViewModel",
|
|
64
|
+
"sessionId": "scenario-approval-waiting",
|
|
65
|
+
"snapshot": {
|
|
66
|
+
"mode": "agent",
|
|
67
|
+
"modelId": "openai:gpt-5.1-codex",
|
|
68
|
+
"capabilities": { "tools": true, "approval": true, "resume": true }
|
|
69
|
+
},
|
|
70
|
+
"status": "waiting_approval",
|
|
71
|
+
"events": [
|
|
72
|
+
{
|
|
73
|
+
"contract": "AgentSessionEvent",
|
|
74
|
+
"eventId": "approval-tool-running",
|
|
75
|
+
"sessionId": "scenario-approval-waiting",
|
|
76
|
+
"sequence": 0,
|
|
77
|
+
"idempotencyKey": "scenario-approval-waiting:0",
|
|
78
|
+
"occurredAt": "2026-08-02T01:01:00.000Z",
|
|
79
|
+
"eventType": "tool",
|
|
80
|
+
"payload": { "toolCallId": "approval-tool", "toolName": "shell", "status": "running", "input": { "command": "npm test" } }
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"contract": "AgentSessionEvent",
|
|
84
|
+
"eventId": "approval-requested",
|
|
85
|
+
"sessionId": "scenario-approval-waiting",
|
|
86
|
+
"sequence": 1,
|
|
87
|
+
"idempotencyKey": "scenario-approval-waiting:1",
|
|
88
|
+
"occurredAt": "2026-08-02T01:01:01.000Z",
|
|
89
|
+
"eventType": "approval",
|
|
90
|
+
"payload": { "approvalId": "approval-request", "toolCallId": "approval-tool", "status": "requested", "title": "Run tests" }
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"contract": "AgentSessionEvent",
|
|
94
|
+
"eventId": "approval-resumable",
|
|
95
|
+
"sessionId": "scenario-approval-waiting",
|
|
96
|
+
"sequence": 2,
|
|
97
|
+
"idempotencyKey": "scenario-approval-waiting:2",
|
|
98
|
+
"occurredAt": "2026-08-02T01:01:02.000Z",
|
|
99
|
+
"eventType": "resume",
|
|
100
|
+
"payload": { "resumable": true, "reason": "approval_required" }
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"contract": "AgentSessionEvent",
|
|
104
|
+
"eventId": "approval-status-waiting",
|
|
105
|
+
"sessionId": "scenario-approval-waiting",
|
|
106
|
+
"sequence": 3,
|
|
107
|
+
"idempotencyKey": "scenario-approval-waiting:3",
|
|
108
|
+
"occurredAt": "2026-08-02T01:01:03.000Z",
|
|
109
|
+
"eventType": "status",
|
|
110
|
+
"payload": { "status": "waiting_approval" }
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"lastSequence": 3,
|
|
114
|
+
"resumable": true
|
|
115
|
+
},
|
|
116
|
+
"toolFailed": {
|
|
117
|
+
"contract": "AgentSessionViewModel",
|
|
118
|
+
"sessionId": "scenario-tool-failed",
|
|
119
|
+
"snapshot": {
|
|
120
|
+
"mode": "agent",
|
|
121
|
+
"modelId": "openai:gpt-5.1-codex",
|
|
122
|
+
"capabilities": { "tools": true }
|
|
123
|
+
},
|
|
124
|
+
"status": "failed",
|
|
125
|
+
"events": [
|
|
126
|
+
{
|
|
127
|
+
"contract": "AgentSessionEvent",
|
|
128
|
+
"eventId": "failed-tool",
|
|
129
|
+
"sessionId": "scenario-tool-failed",
|
|
130
|
+
"sequence": 0,
|
|
131
|
+
"idempotencyKey": "scenario-tool-failed:0",
|
|
132
|
+
"occurredAt": "2026-08-02T01:02:00.000Z",
|
|
133
|
+
"eventType": "tool",
|
|
134
|
+
"payload": { "toolCallId": "failed-tool-call", "toolName": "shell", "status": "failed", "input": { "command": "npm test" }, "output": "exit code 1", "error": "Tests failed" }
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"contract": "AgentSessionEvent",
|
|
138
|
+
"eventId": "failed-error",
|
|
139
|
+
"sessionId": "scenario-tool-failed",
|
|
140
|
+
"sequence": 1,
|
|
141
|
+
"idempotencyKey": "scenario-tool-failed:1",
|
|
142
|
+
"occurredAt": "2026-08-02T01:02:01.000Z",
|
|
143
|
+
"eventType": "error",
|
|
144
|
+
"payload": { "code": "TOOL_EXECUTION_FAILED", "message": "Tests failed", "retryable": true, "sourceEventId": "failed-tool" }
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"contract": "AgentSessionEvent",
|
|
148
|
+
"eventId": "failed-status",
|
|
149
|
+
"sessionId": "scenario-tool-failed",
|
|
150
|
+
"sequence": 2,
|
|
151
|
+
"idempotencyKey": "scenario-tool-failed:2",
|
|
152
|
+
"occurredAt": "2026-08-02T01:02:02.000Z",
|
|
153
|
+
"eventType": "status",
|
|
154
|
+
"payload": { "status": "failed", "failedAt": "2026-08-02T01:02:02.000Z", "durationMs": 2000 }
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"lastSequence": 2,
|
|
158
|
+
"resumable": false
|
|
159
|
+
},
|
|
160
|
+
"resumed": {
|
|
161
|
+
"contract": "AgentSessionViewModel",
|
|
162
|
+
"sessionId": "scenario-resumed",
|
|
163
|
+
"snapshot": {
|
|
164
|
+
"mode": "agent",
|
|
165
|
+
"modelId": "openai:gpt-5.1-codex",
|
|
166
|
+
"capabilities": { "text": true, "resume": true }
|
|
167
|
+
},
|
|
168
|
+
"status": "completed",
|
|
169
|
+
"events": [
|
|
170
|
+
{
|
|
171
|
+
"contract": "AgentSessionEvent",
|
|
172
|
+
"eventId": "resumed-status-stopped",
|
|
173
|
+
"sessionId": "scenario-resumed",
|
|
174
|
+
"sequence": 0,
|
|
175
|
+
"idempotencyKey": "scenario-resumed:0",
|
|
176
|
+
"occurredAt": "2026-08-02T01:03:00.000Z",
|
|
177
|
+
"eventType": "status",
|
|
178
|
+
"payload": { "status": "stopped", "stoppedAt": "2026-08-02T01:03:00.000Z", "durationMs": 1000 }
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"contract": "AgentSessionEvent",
|
|
182
|
+
"eventId": "resumed-available",
|
|
183
|
+
"sessionId": "scenario-resumed",
|
|
184
|
+
"sequence": 1,
|
|
185
|
+
"idempotencyKey": "scenario-resumed:1",
|
|
186
|
+
"occurredAt": "2026-08-02T01:03:01.000Z",
|
|
187
|
+
"eventType": "resume",
|
|
188
|
+
"payload": { "resumable": true, "reason": "user_stopped" }
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"contract": "AgentSessionEvent",
|
|
192
|
+
"eventId": "resumed-status-queued",
|
|
193
|
+
"sessionId": "scenario-resumed",
|
|
194
|
+
"sequence": 2,
|
|
195
|
+
"idempotencyKey": "scenario-resumed:2",
|
|
196
|
+
"occurredAt": "2026-08-02T01:03:02.000Z",
|
|
197
|
+
"eventType": "status",
|
|
198
|
+
"payload": { "status": "queued" }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"contract": "AgentSessionEvent",
|
|
202
|
+
"eventId": "resumed-status-running",
|
|
203
|
+
"sessionId": "scenario-resumed",
|
|
204
|
+
"sequence": 3,
|
|
205
|
+
"idempotencyKey": "scenario-resumed:3",
|
|
206
|
+
"occurredAt": "2026-08-02T01:03:03.000Z",
|
|
207
|
+
"eventType": "status",
|
|
208
|
+
"payload": { "status": "running", "startedAt": "2026-08-02T01:03:03.000Z" }
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"contract": "AgentSessionEvent",
|
|
212
|
+
"eventId": "resumed-message",
|
|
213
|
+
"sessionId": "scenario-resumed",
|
|
214
|
+
"sequence": 4,
|
|
215
|
+
"idempotencyKey": "scenario-resumed:4",
|
|
216
|
+
"occurredAt": "2026-08-02T01:03:04.000Z",
|
|
217
|
+
"eventType": "message",
|
|
218
|
+
"payload": { "messageId": "resumed-assistant-message", "role": "assistant", "operation": "append", "parts": [{ "type": "text", "text": "Recovered response" }], "status": "completed" }
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"contract": "AgentSessionEvent",
|
|
222
|
+
"eventId": "resumed-status-completed",
|
|
223
|
+
"sessionId": "scenario-resumed",
|
|
224
|
+
"sequence": 5,
|
|
225
|
+
"idempotencyKey": "scenario-resumed:5",
|
|
226
|
+
"occurredAt": "2026-08-02T01:03:05.000Z",
|
|
227
|
+
"eventType": "status",
|
|
228
|
+
"payload": { "status": "completed", "completedAt": "2026-08-02T01:03:05.000Z", "durationMs": 2000 }
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"lastSequence": 5,
|
|
232
|
+
"resumable": false
|
|
233
|
+
},
|
|
234
|
+
"artifactCompleted": {
|
|
235
|
+
"contract": "AgentSessionViewModel",
|
|
236
|
+
"sessionId": "scenario-artifact-completed",
|
|
237
|
+
"snapshot": {
|
|
238
|
+
"mode": "agent",
|
|
239
|
+
"modelId": "openai:gpt-5.1-codex",
|
|
240
|
+
"capabilities": { "artifacts": true }
|
|
241
|
+
},
|
|
242
|
+
"status": "completed",
|
|
243
|
+
"events": [
|
|
244
|
+
{
|
|
245
|
+
"contract": "AgentSessionEvent",
|
|
246
|
+
"eventId": "artifact-pending",
|
|
247
|
+
"sessionId": "scenario-artifact-completed",
|
|
248
|
+
"sequence": 0,
|
|
249
|
+
"idempotencyKey": "scenario-artifact-completed:0",
|
|
250
|
+
"occurredAt": "2026-08-02T01:04:00.000Z",
|
|
251
|
+
"eventType": "artifact",
|
|
252
|
+
"payload": { "artifactId": "generated-image", "name": "output.png", "kind": "image", "status": "pending" }
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"contract": "AgentSessionEvent",
|
|
256
|
+
"eventId": "artifact-ready",
|
|
257
|
+
"sessionId": "scenario-artifact-completed",
|
|
258
|
+
"sequence": 1,
|
|
259
|
+
"idempotencyKey": "scenario-artifact-completed:1",
|
|
260
|
+
"occurredAt": "2026-08-02T01:04:01.000Z",
|
|
261
|
+
"eventType": "artifact",
|
|
262
|
+
"payload": { "artifactId": "generated-image", "name": "output.png", "kind": "image", "status": "ready", "mimeType": "image/png", "url": "https://example.test/output.png" }
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"contract": "AgentSessionEvent",
|
|
266
|
+
"eventId": "artifact-status-completed",
|
|
267
|
+
"sessionId": "scenario-artifact-completed",
|
|
268
|
+
"sequence": 2,
|
|
269
|
+
"idempotencyKey": "scenario-artifact-completed:2",
|
|
270
|
+
"occurredAt": "2026-08-02T01:04:02.000Z",
|
|
271
|
+
"eventType": "status",
|
|
272
|
+
"payload": { "status": "completed", "completedAt": "2026-08-02T01:04:02.000Z", "durationMs": 2000 }
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"lastSequence": 2,
|
|
276
|
+
"resumable": false
|
|
277
|
+
},
|
|
278
|
+
"contextCompacted": {
|
|
279
|
+
"contract": "AgentSessionViewModel",
|
|
280
|
+
"sessionId": "scenario-context-compacted",
|
|
281
|
+
"snapshot": {
|
|
282
|
+
"mode": "agent",
|
|
283
|
+
"modelId": "openai:gpt-5.1-codex",
|
|
284
|
+
"capabilities": { "text": true, "usage": true }
|
|
285
|
+
},
|
|
286
|
+
"status": "running",
|
|
287
|
+
"events": [
|
|
288
|
+
{
|
|
289
|
+
"contract": "AgentSessionEvent",
|
|
290
|
+
"eventId": "compacted-message",
|
|
291
|
+
"sessionId": "scenario-context-compacted",
|
|
292
|
+
"sequence": 0,
|
|
293
|
+
"idempotencyKey": "scenario-context-compacted:0",
|
|
294
|
+
"occurredAt": "2026-08-02T01:05:00.000Z",
|
|
295
|
+
"eventType": "message",
|
|
296
|
+
"payload": {
|
|
297
|
+
"messageId": "compacted-assistant-message",
|
|
298
|
+
"role": "assistant",
|
|
299
|
+
"operation": "append",
|
|
300
|
+
"parts": [{ "type": "text", "text": "Context compacted", "metadata": { "debugContext": { "contextUsage": { "compressed": true } } } }],
|
|
301
|
+
"status": "completed"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"contract": "AgentSessionEvent",
|
|
306
|
+
"eventId": "compacted-usage",
|
|
307
|
+
"sessionId": "scenario-context-compacted",
|
|
308
|
+
"sequence": 1,
|
|
309
|
+
"idempotencyKey": "scenario-context-compacted:1",
|
|
310
|
+
"occurredAt": "2026-08-02T01:05:01.000Z",
|
|
311
|
+
"eventType": "usage",
|
|
312
|
+
"payload": { "inputTokens": 12000, "outputTokens": 300, "totalTokens": 12300, "contextTokens": 24000, "contextWindow": 128000 }
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"contract": "AgentSessionEvent",
|
|
316
|
+
"eventId": "compacted-status-running",
|
|
317
|
+
"sessionId": "scenario-context-compacted",
|
|
318
|
+
"sequence": 2,
|
|
319
|
+
"idempotencyKey": "scenario-context-compacted:2",
|
|
320
|
+
"occurredAt": "2026-08-02T01:05:02.000Z",
|
|
321
|
+
"eventType": "status",
|
|
322
|
+
"payload": { "status": "running" }
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"lastSequence": 2,
|
|
326
|
+
"resumable": false
|
|
327
|
+
}
|
|
328
|
+
}
|