@agentxjs/devtools 1.9.1-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,113 @@
1
+ {
2
+ "name": "hello-test",
3
+ "description": "Recording of: \"Hello, say hi briefly.\"",
4
+ "recordedAt": 1770102020745,
5
+ "events": [
6
+ {
7
+ "type": "message_start",
8
+ "delay": 10987,
9
+ "data": {
10
+ "message": {
11
+ "id": "msg_77b0da2e-5783-4c35-90",
12
+ "model": "claude-haiku-4-5-20251001"
13
+ }
14
+ }
15
+ },
16
+ {
17
+ "type": "text_content_block_start",
18
+ "delay": 1,
19
+ "data": {},
20
+ "index": 0
21
+ },
22
+ {
23
+ "type": "text_delta",
24
+ "delay": 0,
25
+ "data": {
26
+ "text": "Hi"
27
+ }
28
+ },
29
+ {
30
+ "type": "text_delta",
31
+ "delay": 0,
32
+ "data": {
33
+ "text": "! I'm Claude, ready"
34
+ }
35
+ },
36
+ {
37
+ "type": "text_delta",
38
+ "delay": 0,
39
+ "data": {
40
+ "text": " to help you with coding"
41
+ }
42
+ },
43
+ {
44
+ "type": "text_delta",
45
+ "delay": 0,
46
+ "data": {
47
+ "text": " tasks,"
48
+ }
49
+ },
50
+ {
51
+ "type": "text_delta",
52
+ "delay": 6,
53
+ "data": {
54
+ "text": " git"
55
+ }
56
+ },
57
+ {
58
+ "type": "text_delta",
59
+ "delay": 0,
60
+ "data": {
61
+ "text": " operations, file"
62
+ }
63
+ },
64
+ {
65
+ "type": "text_delta",
66
+ "delay": 85,
67
+ "data": {
68
+ "text": " management"
69
+ }
70
+ },
71
+ {
72
+ "type": "text_delta",
73
+ "delay": 30,
74
+ "data": {
75
+ "text": ", and more"
76
+ }
77
+ },
78
+ {
79
+ "type": "text_delta",
80
+ "delay": 20,
81
+ "data": {
82
+ "text": ". What"
83
+ }
84
+ },
85
+ {
86
+ "type": "text_delta",
87
+ "delay": 23,
88
+ "data": {
89
+ "text": " can I "
90
+ }
91
+ },
92
+ {
93
+ "type": "text_delta",
94
+ "delay": 78,
95
+ "data": {
96
+ "text": "do for you today?"
97
+ }
98
+ },
99
+ {
100
+ "type": "text_content_block_stop",
101
+ "delay": 51,
102
+ "data": {},
103
+ "index": 0
104
+ },
105
+ {
106
+ "type": "message_stop",
107
+ "delay": 1,
108
+ "data": {
109
+ "stopReason": "end_turn"
110
+ }
111
+ }
112
+ ]
113
+ }
@@ -0,0 +1,330 @@
1
+ /**
2
+ * Built-in Fixtures for MockDriver
3
+ *
4
+ * These fixtures simulate common conversation patterns.
5
+ * They can be used directly or as templates for custom fixtures.
6
+ */
7
+
8
+ import type { Fixture } from "../src/types";
9
+
10
+ /**
11
+ * Simple text reply - no tool calls
12
+ *
13
+ * Simulates: "Hello!" -> "Hello! How can I help you today?"
14
+ */
15
+ export const SIMPLE_REPLY: Fixture = {
16
+ name: "simple-reply",
17
+ description: "Simple text response without tool calls",
18
+ events: [
19
+ {
20
+ type: "message_start",
21
+ delay: 0,
22
+ data: {
23
+ message: {
24
+ id: "msg_mock_001",
25
+ model: "claude-mock",
26
+ },
27
+ },
28
+ },
29
+ {
30
+ type: "text_content_block_start",
31
+ delay: 5,
32
+ index: 0,
33
+ data: {},
34
+ },
35
+ {
36
+ type: "text_delta",
37
+ delay: 5,
38
+ data: { text: "Hello! " },
39
+ },
40
+ {
41
+ type: "text_delta",
42
+ delay: 10,
43
+ data: { text: "How can I " },
44
+ },
45
+ {
46
+ type: "text_delta",
47
+ delay: 10,
48
+ data: { text: "help you " },
49
+ },
50
+ {
51
+ type: "text_delta",
52
+ delay: 10,
53
+ data: { text: "today?" },
54
+ },
55
+ {
56
+ type: "text_content_block_stop",
57
+ delay: 5,
58
+ index: 0,
59
+ data: {},
60
+ },
61
+ {
62
+ type: "message_stop",
63
+ delay: 5,
64
+ data: {
65
+ stopReason: "end_turn",
66
+ },
67
+ },
68
+ ],
69
+ };
70
+
71
+ /**
72
+ * Multi-paragraph response
73
+ *
74
+ * Simulates a longer response with multiple sentences
75
+ */
76
+ export const LONG_REPLY: Fixture = {
77
+ name: "long-reply",
78
+ description: "Longer multi-sentence response",
79
+ events: [
80
+ {
81
+ type: "message_start",
82
+ delay: 0,
83
+ data: {
84
+ message: {
85
+ id: "msg_mock_002",
86
+ model: "claude-mock",
87
+ },
88
+ },
89
+ },
90
+ {
91
+ type: "text_content_block_start",
92
+ delay: 5,
93
+ index: 0,
94
+ data: {},
95
+ },
96
+ {
97
+ type: "text_delta",
98
+ delay: 5,
99
+ data: { text: "I'd be happy to help you with that!\n\n" },
100
+ },
101
+ {
102
+ type: "text_delta",
103
+ delay: 10,
104
+ data: { text: "Here's what I can do:\n" },
105
+ },
106
+ {
107
+ type: "text_delta",
108
+ delay: 10,
109
+ data: { text: "1. Answer your questions\n" },
110
+ },
111
+ {
112
+ type: "text_delta",
113
+ delay: 10,
114
+ data: { text: "2. Help with coding tasks\n" },
115
+ },
116
+ {
117
+ type: "text_delta",
118
+ delay: 10,
119
+ data: { text: "3. Assist with writing\n\n" },
120
+ },
121
+ {
122
+ type: "text_delta",
123
+ delay: 10,
124
+ data: { text: "What would you like to work on?" },
125
+ },
126
+ {
127
+ type: "text_content_block_stop",
128
+ delay: 5,
129
+ index: 0,
130
+ data: {},
131
+ },
132
+ {
133
+ type: "message_stop",
134
+ delay: 5,
135
+ data: {
136
+ stopReason: "end_turn",
137
+ },
138
+ },
139
+ ],
140
+ };
141
+
142
+ /**
143
+ * Tool call response - demonstrates tool_use flow
144
+ *
145
+ * Simulates: "What time is it?" -> tool_call(get_current_time) -> "It's 2:30 PM"
146
+ */
147
+ export const TOOL_CALL: Fixture = {
148
+ name: "tool-call",
149
+ description: "Response that includes a tool call",
150
+ events: [
151
+ {
152
+ type: "message_start",
153
+ delay: 0,
154
+ data: {
155
+ message: {
156
+ id: "msg_mock_003",
157
+ model: "claude-mock",
158
+ },
159
+ },
160
+ },
161
+ {
162
+ type: "text_content_block_start",
163
+ delay: 5,
164
+ index: 0,
165
+ data: {},
166
+ },
167
+ {
168
+ type: "text_delta",
169
+ delay: 5,
170
+ data: { text: "Let me check that for you." },
171
+ },
172
+ {
173
+ type: "text_content_block_stop",
174
+ delay: 5,
175
+ index: 0,
176
+ data: {},
177
+ },
178
+ {
179
+ type: "tool_use_content_block_start",
180
+ delay: 10,
181
+ index: 1,
182
+ data: {
183
+ id: "tool_001",
184
+ name: "get_current_time",
185
+ },
186
+ },
187
+ {
188
+ type: "input_json_delta",
189
+ delay: 5,
190
+ index: 1,
191
+ data: { partialJson: "{" },
192
+ },
193
+ {
194
+ type: "input_json_delta",
195
+ delay: 5,
196
+ index: 1,
197
+ data: { partialJson: '"timezone":' },
198
+ },
199
+ {
200
+ type: "input_json_delta",
201
+ delay: 5,
202
+ index: 1,
203
+ data: { partialJson: '"UTC"' },
204
+ },
205
+ {
206
+ type: "input_json_delta",
207
+ delay: 5,
208
+ index: 1,
209
+ data: { partialJson: "}" },
210
+ },
211
+ {
212
+ type: "tool_use_content_block_stop",
213
+ delay: 5,
214
+ index: 1,
215
+ data: {},
216
+ },
217
+ {
218
+ type: "message_stop",
219
+ delay: 5,
220
+ data: {
221
+ stopReason: "tool_use",
222
+ },
223
+ },
224
+ // After tool result, continue with text
225
+ {
226
+ type: "message_start",
227
+ delay: 50,
228
+ data: {
229
+ message: {
230
+ id: "msg_mock_003b",
231
+ model: "claude-mock",
232
+ },
233
+ },
234
+ },
235
+ {
236
+ type: "text_content_block_start",
237
+ delay: 5,
238
+ index: 0,
239
+ data: {},
240
+ },
241
+ {
242
+ type: "text_delta",
243
+ delay: 5,
244
+ data: { text: "The current time is 2:30 PM UTC." },
245
+ },
246
+ {
247
+ type: "text_content_block_stop",
248
+ delay: 5,
249
+ index: 0,
250
+ data: {},
251
+ },
252
+ {
253
+ type: "message_stop",
254
+ delay: 5,
255
+ data: {
256
+ stopReason: "end_turn",
257
+ },
258
+ },
259
+ ],
260
+ };
261
+
262
+ /**
263
+ * Error response
264
+ */
265
+ export const ERROR_RESPONSE: Fixture = {
266
+ name: "error",
267
+ description: "Simulates an API error",
268
+ events: [
269
+ {
270
+ type: "error_received",
271
+ delay: 50,
272
+ data: {
273
+ message: "Rate limit exceeded. Please try again later.",
274
+ errorCode: "rate_limit_error",
275
+ },
276
+ },
277
+ ],
278
+ };
279
+
280
+ /**
281
+ * Empty response (for edge case testing)
282
+ */
283
+ export const EMPTY_RESPONSE: Fixture = {
284
+ name: "empty",
285
+ description: "Empty response with no content",
286
+ events: [
287
+ {
288
+ type: "message_start",
289
+ delay: 0,
290
+ data: {
291
+ message: {
292
+ id: "msg_mock_empty",
293
+ model: "claude-mock",
294
+ },
295
+ },
296
+ },
297
+ {
298
+ type: "message_stop",
299
+ delay: 5,
300
+ data: {
301
+ stopReason: "end_turn",
302
+ },
303
+ },
304
+ ],
305
+ };
306
+
307
+ /**
308
+ * All built-in fixtures
309
+ */
310
+ export const BUILTIN_FIXTURES: Map<string, Fixture> = new Map([
311
+ ["simple-reply", SIMPLE_REPLY],
312
+ ["long-reply", LONG_REPLY],
313
+ ["tool-call", TOOL_CALL],
314
+ ["error", ERROR_RESPONSE],
315
+ ["empty", EMPTY_RESPONSE],
316
+ ]);
317
+
318
+ /**
319
+ * Get a built-in fixture by name
320
+ */
321
+ export function getFixture(name: string): Fixture | undefined {
322
+ return BUILTIN_FIXTURES.get(name);
323
+ }
324
+
325
+ /**
326
+ * List all built-in fixture names
327
+ */
328
+ export function listFixtures(): string[] {
329
+ return Array.from(BUILTIN_FIXTURES.keys());
330
+ }
@@ -0,0 +1,143 @@
1
+ {
2
+ "name": "tool-list-files",
3
+ "description": "Recording of: \"List files in the current directory\"",
4
+ "recordedAt": 1770102169408,
5
+ "events": [
6
+ {
7
+ "type": "message_start",
8
+ "delay": 4779,
9
+ "data": {
10
+ "message": {
11
+ "id": "msg_019QeVaLsZfHdfby3WVc3bXA",
12
+ "model": "claude-haiku-4-5-20251001"
13
+ }
14
+ }
15
+ },
16
+ {
17
+ "type": "tool_use_content_block_start",
18
+ "delay": 1,
19
+ "data": {
20
+ "id": "toolu_01S3q3J6dcQCUxEJqk8hTDpJ",
21
+ "name": "Bash"
22
+ },
23
+ "index": 0
24
+ },
25
+ {
26
+ "type": "input_json_delta",
27
+ "delay": 0,
28
+ "data": {
29
+ "partialJson": ""
30
+ },
31
+ "index": 0
32
+ },
33
+ {
34
+ "type": "input_json_delta",
35
+ "delay": 103,
36
+ "data": {
37
+ "partialJson": "{\"command"
38
+ },
39
+ "index": 0
40
+ },
41
+ {
42
+ "type": "input_json_delta",
43
+ "delay": 3,
44
+ "data": {
45
+ "partialJson": "\": "
46
+ },
47
+ "index": 0
48
+ },
49
+ {
50
+ "type": "input_json_delta",
51
+ "delay": 0,
52
+ "data": {
53
+ "partialJson": "\"ls -la"
54
+ },
55
+ "index": 0
56
+ },
57
+ {
58
+ "type": "input_json_delta",
59
+ "delay": 3,
60
+ "data": {
61
+ "partialJson": "\""
62
+ },
63
+ "index": 0
64
+ },
65
+ {
66
+ "type": "input_json_delta",
67
+ "delay": 139,
68
+ "data": {
69
+ "partialJson": ", \"des"
70
+ },
71
+ "index": 0
72
+ },
73
+ {
74
+ "type": "input_json_delta",
75
+ "delay": 1,
76
+ "data": {
77
+ "partialJson": "cription\": "
78
+ },
79
+ "index": 0
80
+ },
81
+ {
82
+ "type": "input_json_delta",
83
+ "delay": 0,
84
+ "data": {
85
+ "partialJson": "\"Lis"
86
+ },
87
+ "index": 0
88
+ },
89
+ {
90
+ "type": "input_json_delta",
91
+ "delay": 3,
92
+ "data": {
93
+ "partialJson": "t files in"
94
+ },
95
+ "index": 0
96
+ },
97
+ {
98
+ "type": "input_json_delta",
99
+ "delay": 0,
100
+ "data": {
101
+ "partialJson": " curre"
102
+ },
103
+ "index": 0
104
+ },
105
+ {
106
+ "type": "input_json_delta",
107
+ "delay": 2,
108
+ "data": {
109
+ "partialJson": "nt directory"
110
+ },
111
+ "index": 0
112
+ },
113
+ {
114
+ "type": "input_json_delta",
115
+ "delay": 5,
116
+ "data": {
117
+ "partialJson": " with"
118
+ },
119
+ "index": 0
120
+ },
121
+ {
122
+ "type": "input_json_delta",
123
+ "delay": 2,
124
+ "data": {
125
+ "partialJson": " details\"}"
126
+ },
127
+ "index": 0
128
+ },
129
+ {
130
+ "type": "tool_use_content_block_stop",
131
+ "delay": 17,
132
+ "data": {},
133
+ "index": 0
134
+ },
135
+ {
136
+ "type": "message_stop",
137
+ "delay": 7,
138
+ "data": {
139
+ "stopReason": "tool_use"
140
+ }
141
+ }
142
+ ]
143
+ }