@masstensor/diagnose 0.1.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.
package/dist/schema.d.ts CHANGED
@@ -2,7 +2,9 @@ import { z } from 'zod';
2
2
  export declare const MAX_FRAME: number;
3
3
  export declare const CHUNK_SIZE: number;
4
4
  export declare const MAX_OUTPUT: number;
5
- export declare const taskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5
+ export declare const atomicOperationNames: readonly ['system.inspect', 'file.read', 'file.write', 'file.stat', 'file.list', 'file.mkdir', 'file.remove', 'file.rename', 'file.chmod', 'file.transfer', 'process.run', 'process.script', 'process.open', 'resource.resume', 'net.forward', 'serial.capture', 'serial.exchange'];
6
+ export declare const batchOperationNames: readonly ['system.inspect', 'file.read', 'file.write', 'file.stat', 'file.list', 'file.mkdir', 'file.remove', 'file.rename', 'file.chmod', 'process.run', 'process.script', 'serial.capture', 'serial.exchange'];
7
+ export declare const atomicTaskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
8
  id: z.ZodString;
7
9
  reason: z.ZodString;
8
10
  operation: z.ZodLiteral<"system.inspect">;
@@ -25,6 +27,113 @@ export declare const taskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
25
27
  content: z.ZodString;
26
28
  expectedSha256: z.ZodOptional<z.ZodString>;
27
29
  }, z.core.$strict>;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ id: z.ZodString;
32
+ reason: z.ZodString;
33
+ operation: z.ZodLiteral<"file.stat">;
34
+ arguments: z.ZodObject<{
35
+ path: z.ZodString;
36
+ }, z.core.$strict>;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ id: z.ZodString;
39
+ reason: z.ZodString;
40
+ operation: z.ZodLiteral<"file.list">;
41
+ arguments: z.ZodObject<{
42
+ path: z.ZodString;
43
+ offset: z.ZodDefault<z.ZodNumber>;
44
+ limit: z.ZodDefault<z.ZodNumber>;
45
+ }, z.core.$strict>;
46
+ }, z.core.$strict>, z.ZodObject<{
47
+ id: z.ZodString;
48
+ reason: z.ZodString;
49
+ operation: z.ZodLiteral<"file.mkdir">;
50
+ arguments: z.ZodObject<{
51
+ path: z.ZodString;
52
+ recursive: z.ZodDefault<z.ZodBoolean>;
53
+ }, z.core.$strict>;
54
+ }, z.core.$strict>, z.ZodObject<{
55
+ id: z.ZodString;
56
+ reason: z.ZodString;
57
+ operation: z.ZodLiteral<"file.remove">;
58
+ arguments: z.ZodObject<{
59
+ path: z.ZodString;
60
+ recursive: z.ZodDefault<z.ZodBoolean>;
61
+ }, z.core.$strict>;
62
+ }, z.core.$strict>, z.ZodObject<{
63
+ id: z.ZodString;
64
+ reason: z.ZodString;
65
+ operation: z.ZodLiteral<"file.rename">;
66
+ arguments: z.ZodObject<{
67
+ path: z.ZodString;
68
+ destination: z.ZodString;
69
+ overwrite: z.ZodDefault<z.ZodBoolean>;
70
+ }, z.core.$strict>;
71
+ }, z.core.$strict>, z.ZodObject<{
72
+ id: z.ZodString;
73
+ reason: z.ZodString;
74
+ operation: z.ZodLiteral<"file.chmod">;
75
+ arguments: z.ZodObject<{
76
+ path: z.ZodString;
77
+ mode: z.ZodNumber;
78
+ }, z.core.$strict>;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ id: z.ZodString;
81
+ reason: z.ZodString;
82
+ operation: z.ZodLiteral<"file.transfer">;
83
+ arguments: z.ZodObject<{
84
+ path: z.ZodString;
85
+ direction: z.ZodEnum<{
86
+ download: "download";
87
+ upload: "upload";
88
+ }>;
89
+ size: z.ZodOptional<z.ZodNumber>;
90
+ sha256: z.ZodOptional<z.ZodString>;
91
+ overwrite: z.ZodDefault<z.ZodBoolean>;
92
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
93
+ }, z.core.$strict>;
94
+ }, z.core.$strict>, z.ZodObject<{
95
+ id: z.ZodString;
96
+ reason: z.ZodString;
97
+ operation: z.ZodLiteral<"process.open">;
98
+ arguments: z.ZodObject<{
99
+ executable: z.ZodOptional<z.ZodString>;
100
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
101
+ cwd: z.ZodOptional<z.ZodString>;
102
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
103
+ pty: z.ZodDefault<z.ZodBoolean>;
104
+ cols: z.ZodDefault<z.ZodNumber>;
105
+ rows: z.ZodDefault<z.ZodNumber>;
106
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
107
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
108
+ maxOutputBytes: z.ZodDefault<z.ZodNumber>;
109
+ }, z.core.$strict>;
110
+ }, z.core.$strict>, z.ZodObject<{
111
+ id: z.ZodString;
112
+ reason: z.ZodString;
113
+ operation: z.ZodLiteral<"resource.resume">;
114
+ arguments: z.ZodObject<{
115
+ id: z.ZodString;
116
+ resumeToken: z.ZodString;
117
+ }, z.core.$strict>;
118
+ }, z.core.$strict>, z.ZodObject<{
119
+ id: z.ZodString;
120
+ reason: z.ZodString;
121
+ operation: z.ZodLiteral<"net.forward">;
122
+ arguments: z.ZodObject<{
123
+ direction: z.ZodEnum<{
124
+ local: "local";
125
+ remote: "remote";
126
+ socks: "socks";
127
+ }>;
128
+ host: z.ZodDefault<z.ZodString>;
129
+ port: z.ZodDefault<z.ZodNumber>;
130
+ bindHost: z.ZodDefault<z.ZodEnum<{
131
+ "127.0.0.1": "127.0.0.1";
132
+ "::1": "::1";
133
+ }>>;
134
+ bindPort: z.ZodDefault<z.ZodNumber>;
135
+ allowedHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
136
+ }, z.core.$strict>;
28
137
  }, z.core.$strict>, z.ZodObject<{
29
138
  id: z.ZodString;
30
139
  reason: z.ZodString;
@@ -35,6 +144,17 @@ export declare const taskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
144
  cwd: z.ZodOptional<z.ZodString>;
36
145
  timeoutMs: z.ZodDefault<z.ZodNumber>;
37
146
  }, z.core.$strict>;
147
+ }, z.core.$strict>, z.ZodObject<{
148
+ id: z.ZodString;
149
+ reason: z.ZodString;
150
+ operation: z.ZodLiteral<"process.script">;
151
+ arguments: z.ZodObject<{
152
+ interpreter: z.ZodString;
153
+ script: z.ZodString;
154
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
155
+ cwd: z.ZodOptional<z.ZodString>;
156
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
157
+ }, z.core.$strict>;
38
158
  }, z.core.$strict>, ...z.ZodObject<{
39
159
  id: z.ZodString;
40
160
  reason: z.ZodString;
@@ -46,6 +166,511 @@ export declare const taskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
166
  dataHex: z.ZodOptional<z.ZodString>;
47
167
  }, z.core.$strict>;
48
168
  }, z.core.$strict>[]], "operation">;
169
+ export declare const batchTaskSchema: z.ZodObject<{
170
+ id: z.ZodString;
171
+ reason: z.ZodString;
172
+ operation: z.ZodLiteral<"batch.run">;
173
+ arguments: z.ZodObject<{
174
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
175
+ id: z.ZodString;
176
+ reason: z.ZodString;
177
+ operation: z.ZodLiteral<"system.inspect">;
178
+ arguments: z.ZodObject<{}, z.core.$strict>;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ id: z.ZodString;
181
+ reason: z.ZodString;
182
+ operation: z.ZodLiteral<"file.read">;
183
+ arguments: z.ZodObject<{
184
+ path: z.ZodString;
185
+ offset: z.ZodDefault<z.ZodNumber>;
186
+ length: z.ZodDefault<z.ZodNumber>;
187
+ }, z.core.$strict>;
188
+ }, z.core.$strict>, z.ZodObject<{
189
+ id: z.ZodString;
190
+ reason: z.ZodString;
191
+ operation: z.ZodLiteral<"file.write">;
192
+ arguments: z.ZodObject<{
193
+ path: z.ZodString;
194
+ content: z.ZodString;
195
+ expectedSha256: z.ZodOptional<z.ZodString>;
196
+ }, z.core.$strict>;
197
+ }, z.core.$strict>, z.ZodObject<{
198
+ id: z.ZodString;
199
+ reason: z.ZodString;
200
+ operation: z.ZodLiteral<"file.stat">;
201
+ arguments: z.ZodObject<{
202
+ path: z.ZodString;
203
+ }, z.core.$strict>;
204
+ }, z.core.$strict>, z.ZodObject<{
205
+ id: z.ZodString;
206
+ reason: z.ZodString;
207
+ operation: z.ZodLiteral<"file.list">;
208
+ arguments: z.ZodObject<{
209
+ path: z.ZodString;
210
+ offset: z.ZodDefault<z.ZodNumber>;
211
+ limit: z.ZodDefault<z.ZodNumber>;
212
+ }, z.core.$strict>;
213
+ }, z.core.$strict>, z.ZodObject<{
214
+ id: z.ZodString;
215
+ reason: z.ZodString;
216
+ operation: z.ZodLiteral<"file.mkdir">;
217
+ arguments: z.ZodObject<{
218
+ path: z.ZodString;
219
+ recursive: z.ZodDefault<z.ZodBoolean>;
220
+ }, z.core.$strict>;
221
+ }, z.core.$strict>, z.ZodObject<{
222
+ id: z.ZodString;
223
+ reason: z.ZodString;
224
+ operation: z.ZodLiteral<"file.remove">;
225
+ arguments: z.ZodObject<{
226
+ path: z.ZodString;
227
+ recursive: z.ZodDefault<z.ZodBoolean>;
228
+ }, z.core.$strict>;
229
+ }, z.core.$strict>, z.ZodObject<{
230
+ id: z.ZodString;
231
+ reason: z.ZodString;
232
+ operation: z.ZodLiteral<"file.rename">;
233
+ arguments: z.ZodObject<{
234
+ path: z.ZodString;
235
+ destination: z.ZodString;
236
+ overwrite: z.ZodDefault<z.ZodBoolean>;
237
+ }, z.core.$strict>;
238
+ }, z.core.$strict>, z.ZodObject<{
239
+ id: z.ZodString;
240
+ reason: z.ZodString;
241
+ operation: z.ZodLiteral<"file.chmod">;
242
+ arguments: z.ZodObject<{
243
+ path: z.ZodString;
244
+ mode: z.ZodNumber;
245
+ }, z.core.$strict>;
246
+ }, z.core.$strict>, z.ZodObject<{
247
+ id: z.ZodString;
248
+ reason: z.ZodString;
249
+ operation: z.ZodLiteral<"file.transfer">;
250
+ arguments: z.ZodObject<{
251
+ path: z.ZodString;
252
+ direction: z.ZodEnum<{
253
+ download: "download";
254
+ upload: "upload";
255
+ }>;
256
+ size: z.ZodOptional<z.ZodNumber>;
257
+ sha256: z.ZodOptional<z.ZodString>;
258
+ overwrite: z.ZodDefault<z.ZodBoolean>;
259
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
260
+ }, z.core.$strict>;
261
+ }, z.core.$strict>, z.ZodObject<{
262
+ id: z.ZodString;
263
+ reason: z.ZodString;
264
+ operation: z.ZodLiteral<"process.open">;
265
+ arguments: z.ZodObject<{
266
+ executable: z.ZodOptional<z.ZodString>;
267
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
268
+ cwd: z.ZodOptional<z.ZodString>;
269
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
270
+ pty: z.ZodDefault<z.ZodBoolean>;
271
+ cols: z.ZodDefault<z.ZodNumber>;
272
+ rows: z.ZodDefault<z.ZodNumber>;
273
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
274
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
275
+ maxOutputBytes: z.ZodDefault<z.ZodNumber>;
276
+ }, z.core.$strict>;
277
+ }, z.core.$strict>, z.ZodObject<{
278
+ id: z.ZodString;
279
+ reason: z.ZodString;
280
+ operation: z.ZodLiteral<"resource.resume">;
281
+ arguments: z.ZodObject<{
282
+ id: z.ZodString;
283
+ resumeToken: z.ZodString;
284
+ }, z.core.$strict>;
285
+ }, z.core.$strict>, z.ZodObject<{
286
+ id: z.ZodString;
287
+ reason: z.ZodString;
288
+ operation: z.ZodLiteral<"net.forward">;
289
+ arguments: z.ZodObject<{
290
+ direction: z.ZodEnum<{
291
+ local: "local";
292
+ remote: "remote";
293
+ socks: "socks";
294
+ }>;
295
+ host: z.ZodDefault<z.ZodString>;
296
+ port: z.ZodDefault<z.ZodNumber>;
297
+ bindHost: z.ZodDefault<z.ZodEnum<{
298
+ "127.0.0.1": "127.0.0.1";
299
+ "::1": "::1";
300
+ }>>;
301
+ bindPort: z.ZodDefault<z.ZodNumber>;
302
+ allowedHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
303
+ }, z.core.$strict>;
304
+ }, z.core.$strict>, z.ZodObject<{
305
+ id: z.ZodString;
306
+ reason: z.ZodString;
307
+ operation: z.ZodLiteral<"process.run">;
308
+ arguments: z.ZodObject<{
309
+ executable: z.ZodString;
310
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
311
+ cwd: z.ZodOptional<z.ZodString>;
312
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
313
+ }, z.core.$strict>;
314
+ }, z.core.$strict>, z.ZodObject<{
315
+ id: z.ZodString;
316
+ reason: z.ZodString;
317
+ operation: z.ZodLiteral<"process.script">;
318
+ arguments: z.ZodObject<{
319
+ interpreter: z.ZodString;
320
+ script: z.ZodString;
321
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
322
+ cwd: z.ZodOptional<z.ZodString>;
323
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
324
+ }, z.core.$strict>;
325
+ }, z.core.$strict>, ...z.ZodObject<{
326
+ id: z.ZodString;
327
+ reason: z.ZodString;
328
+ operation: z.ZodLiteral<"serial.capture" | "serial.exchange">;
329
+ arguments: z.ZodObject<{
330
+ path: z.ZodString;
331
+ baudRate: z.ZodDefault<z.ZodNumber>;
332
+ durationMs: z.ZodDefault<z.ZodNumber>;
333
+ dataHex: z.ZodOptional<z.ZodString>;
334
+ }, z.core.$strict>;
335
+ }, z.core.$strict>[]], "operation">>;
336
+ stopOnError: z.ZodDefault<z.ZodBoolean>;
337
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
338
+ }, z.core.$strict>;
339
+ }, z.core.$strict>;
340
+ export declare const taskSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
341
+ id: z.ZodString;
342
+ reason: z.ZodString;
343
+ operation: z.ZodLiteral<"system.inspect">;
344
+ arguments: z.ZodObject<{}, z.core.$strict>;
345
+ }, z.core.$strict>, z.ZodObject<{
346
+ id: z.ZodString;
347
+ reason: z.ZodString;
348
+ operation: z.ZodLiteral<"file.read">;
349
+ arguments: z.ZodObject<{
350
+ path: z.ZodString;
351
+ offset: z.ZodDefault<z.ZodNumber>;
352
+ length: z.ZodDefault<z.ZodNumber>;
353
+ }, z.core.$strict>;
354
+ }, z.core.$strict>, z.ZodObject<{
355
+ id: z.ZodString;
356
+ reason: z.ZodString;
357
+ operation: z.ZodLiteral<"file.write">;
358
+ arguments: z.ZodObject<{
359
+ path: z.ZodString;
360
+ content: z.ZodString;
361
+ expectedSha256: z.ZodOptional<z.ZodString>;
362
+ }, z.core.$strict>;
363
+ }, z.core.$strict>, z.ZodObject<{
364
+ id: z.ZodString;
365
+ reason: z.ZodString;
366
+ operation: z.ZodLiteral<"file.stat">;
367
+ arguments: z.ZodObject<{
368
+ path: z.ZodString;
369
+ }, z.core.$strict>;
370
+ }, z.core.$strict>, z.ZodObject<{
371
+ id: z.ZodString;
372
+ reason: z.ZodString;
373
+ operation: z.ZodLiteral<"file.list">;
374
+ arguments: z.ZodObject<{
375
+ path: z.ZodString;
376
+ offset: z.ZodDefault<z.ZodNumber>;
377
+ limit: z.ZodDefault<z.ZodNumber>;
378
+ }, z.core.$strict>;
379
+ }, z.core.$strict>, z.ZodObject<{
380
+ id: z.ZodString;
381
+ reason: z.ZodString;
382
+ operation: z.ZodLiteral<"file.mkdir">;
383
+ arguments: z.ZodObject<{
384
+ path: z.ZodString;
385
+ recursive: z.ZodDefault<z.ZodBoolean>;
386
+ }, z.core.$strict>;
387
+ }, z.core.$strict>, z.ZodObject<{
388
+ id: z.ZodString;
389
+ reason: z.ZodString;
390
+ operation: z.ZodLiteral<"file.remove">;
391
+ arguments: z.ZodObject<{
392
+ path: z.ZodString;
393
+ recursive: z.ZodDefault<z.ZodBoolean>;
394
+ }, z.core.$strict>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ id: z.ZodString;
397
+ reason: z.ZodString;
398
+ operation: z.ZodLiteral<"file.rename">;
399
+ arguments: z.ZodObject<{
400
+ path: z.ZodString;
401
+ destination: z.ZodString;
402
+ overwrite: z.ZodDefault<z.ZodBoolean>;
403
+ }, z.core.$strict>;
404
+ }, z.core.$strict>, z.ZodObject<{
405
+ id: z.ZodString;
406
+ reason: z.ZodString;
407
+ operation: z.ZodLiteral<"file.chmod">;
408
+ arguments: z.ZodObject<{
409
+ path: z.ZodString;
410
+ mode: z.ZodNumber;
411
+ }, z.core.$strict>;
412
+ }, z.core.$strict>, z.ZodObject<{
413
+ id: z.ZodString;
414
+ reason: z.ZodString;
415
+ operation: z.ZodLiteral<"file.transfer">;
416
+ arguments: z.ZodObject<{
417
+ path: z.ZodString;
418
+ direction: z.ZodEnum<{
419
+ download: "download";
420
+ upload: "upload";
421
+ }>;
422
+ size: z.ZodOptional<z.ZodNumber>;
423
+ sha256: z.ZodOptional<z.ZodString>;
424
+ overwrite: z.ZodDefault<z.ZodBoolean>;
425
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
426
+ }, z.core.$strict>;
427
+ }, z.core.$strict>, z.ZodObject<{
428
+ id: z.ZodString;
429
+ reason: z.ZodString;
430
+ operation: z.ZodLiteral<"process.open">;
431
+ arguments: z.ZodObject<{
432
+ executable: z.ZodOptional<z.ZodString>;
433
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
434
+ cwd: z.ZodOptional<z.ZodString>;
435
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
436
+ pty: z.ZodDefault<z.ZodBoolean>;
437
+ cols: z.ZodDefault<z.ZodNumber>;
438
+ rows: z.ZodDefault<z.ZodNumber>;
439
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
440
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
441
+ maxOutputBytes: z.ZodDefault<z.ZodNumber>;
442
+ }, z.core.$strict>;
443
+ }, z.core.$strict>, z.ZodObject<{
444
+ id: z.ZodString;
445
+ reason: z.ZodString;
446
+ operation: z.ZodLiteral<"resource.resume">;
447
+ arguments: z.ZodObject<{
448
+ id: z.ZodString;
449
+ resumeToken: z.ZodString;
450
+ }, z.core.$strict>;
451
+ }, z.core.$strict>, z.ZodObject<{
452
+ id: z.ZodString;
453
+ reason: z.ZodString;
454
+ operation: z.ZodLiteral<"net.forward">;
455
+ arguments: z.ZodObject<{
456
+ direction: z.ZodEnum<{
457
+ local: "local";
458
+ remote: "remote";
459
+ socks: "socks";
460
+ }>;
461
+ host: z.ZodDefault<z.ZodString>;
462
+ port: z.ZodDefault<z.ZodNumber>;
463
+ bindHost: z.ZodDefault<z.ZodEnum<{
464
+ "127.0.0.1": "127.0.0.1";
465
+ "::1": "::1";
466
+ }>>;
467
+ bindPort: z.ZodDefault<z.ZodNumber>;
468
+ allowedHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
469
+ }, z.core.$strict>;
470
+ }, z.core.$strict>, z.ZodObject<{
471
+ id: z.ZodString;
472
+ reason: z.ZodString;
473
+ operation: z.ZodLiteral<"process.run">;
474
+ arguments: z.ZodObject<{
475
+ executable: z.ZodString;
476
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
477
+ cwd: z.ZodOptional<z.ZodString>;
478
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
479
+ }, z.core.$strict>;
480
+ }, z.core.$strict>, z.ZodObject<{
481
+ id: z.ZodString;
482
+ reason: z.ZodString;
483
+ operation: z.ZodLiteral<"process.script">;
484
+ arguments: z.ZodObject<{
485
+ interpreter: z.ZodString;
486
+ script: z.ZodString;
487
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
488
+ cwd: z.ZodOptional<z.ZodString>;
489
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
490
+ }, z.core.$strict>;
491
+ }, z.core.$strict>, ...z.ZodObject<{
492
+ id: z.ZodString;
493
+ reason: z.ZodString;
494
+ operation: z.ZodLiteral<"serial.capture" | "serial.exchange">;
495
+ arguments: z.ZodObject<{
496
+ path: z.ZodString;
497
+ baudRate: z.ZodDefault<z.ZodNumber>;
498
+ durationMs: z.ZodDefault<z.ZodNumber>;
499
+ dataHex: z.ZodOptional<z.ZodString>;
500
+ }, z.core.$strict>;
501
+ }, z.core.$strict>[]], "operation">, z.ZodObject<{
502
+ id: z.ZodString;
503
+ reason: z.ZodString;
504
+ operation: z.ZodLiteral<"batch.run">;
505
+ arguments: z.ZodObject<{
506
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
507
+ id: z.ZodString;
508
+ reason: z.ZodString;
509
+ operation: z.ZodLiteral<"system.inspect">;
510
+ arguments: z.ZodObject<{}, z.core.$strict>;
511
+ }, z.core.$strict>, z.ZodObject<{
512
+ id: z.ZodString;
513
+ reason: z.ZodString;
514
+ operation: z.ZodLiteral<"file.read">;
515
+ arguments: z.ZodObject<{
516
+ path: z.ZodString;
517
+ offset: z.ZodDefault<z.ZodNumber>;
518
+ length: z.ZodDefault<z.ZodNumber>;
519
+ }, z.core.$strict>;
520
+ }, z.core.$strict>, z.ZodObject<{
521
+ id: z.ZodString;
522
+ reason: z.ZodString;
523
+ operation: z.ZodLiteral<"file.write">;
524
+ arguments: z.ZodObject<{
525
+ path: z.ZodString;
526
+ content: z.ZodString;
527
+ expectedSha256: z.ZodOptional<z.ZodString>;
528
+ }, z.core.$strict>;
529
+ }, z.core.$strict>, z.ZodObject<{
530
+ id: z.ZodString;
531
+ reason: z.ZodString;
532
+ operation: z.ZodLiteral<"file.stat">;
533
+ arguments: z.ZodObject<{
534
+ path: z.ZodString;
535
+ }, z.core.$strict>;
536
+ }, z.core.$strict>, z.ZodObject<{
537
+ id: z.ZodString;
538
+ reason: z.ZodString;
539
+ operation: z.ZodLiteral<"file.list">;
540
+ arguments: z.ZodObject<{
541
+ path: z.ZodString;
542
+ offset: z.ZodDefault<z.ZodNumber>;
543
+ limit: z.ZodDefault<z.ZodNumber>;
544
+ }, z.core.$strict>;
545
+ }, z.core.$strict>, z.ZodObject<{
546
+ id: z.ZodString;
547
+ reason: z.ZodString;
548
+ operation: z.ZodLiteral<"file.mkdir">;
549
+ arguments: z.ZodObject<{
550
+ path: z.ZodString;
551
+ recursive: z.ZodDefault<z.ZodBoolean>;
552
+ }, z.core.$strict>;
553
+ }, z.core.$strict>, z.ZodObject<{
554
+ id: z.ZodString;
555
+ reason: z.ZodString;
556
+ operation: z.ZodLiteral<"file.remove">;
557
+ arguments: z.ZodObject<{
558
+ path: z.ZodString;
559
+ recursive: z.ZodDefault<z.ZodBoolean>;
560
+ }, z.core.$strict>;
561
+ }, z.core.$strict>, z.ZodObject<{
562
+ id: z.ZodString;
563
+ reason: z.ZodString;
564
+ operation: z.ZodLiteral<"file.rename">;
565
+ arguments: z.ZodObject<{
566
+ path: z.ZodString;
567
+ destination: z.ZodString;
568
+ overwrite: z.ZodDefault<z.ZodBoolean>;
569
+ }, z.core.$strict>;
570
+ }, z.core.$strict>, z.ZodObject<{
571
+ id: z.ZodString;
572
+ reason: z.ZodString;
573
+ operation: z.ZodLiteral<"file.chmod">;
574
+ arguments: z.ZodObject<{
575
+ path: z.ZodString;
576
+ mode: z.ZodNumber;
577
+ }, z.core.$strict>;
578
+ }, z.core.$strict>, z.ZodObject<{
579
+ id: z.ZodString;
580
+ reason: z.ZodString;
581
+ operation: z.ZodLiteral<"file.transfer">;
582
+ arguments: z.ZodObject<{
583
+ path: z.ZodString;
584
+ direction: z.ZodEnum<{
585
+ download: "download";
586
+ upload: "upload";
587
+ }>;
588
+ size: z.ZodOptional<z.ZodNumber>;
589
+ sha256: z.ZodOptional<z.ZodString>;
590
+ overwrite: z.ZodDefault<z.ZodBoolean>;
591
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
592
+ }, z.core.$strict>;
593
+ }, z.core.$strict>, z.ZodObject<{
594
+ id: z.ZodString;
595
+ reason: z.ZodString;
596
+ operation: z.ZodLiteral<"process.open">;
597
+ arguments: z.ZodObject<{
598
+ executable: z.ZodOptional<z.ZodString>;
599
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
600
+ cwd: z.ZodOptional<z.ZodString>;
601
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
602
+ pty: z.ZodDefault<z.ZodBoolean>;
603
+ cols: z.ZodDefault<z.ZodNumber>;
604
+ rows: z.ZodDefault<z.ZodNumber>;
605
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
606
+ retainOnDisconnect: z.ZodDefault<z.ZodBoolean>;
607
+ maxOutputBytes: z.ZodDefault<z.ZodNumber>;
608
+ }, z.core.$strict>;
609
+ }, z.core.$strict>, z.ZodObject<{
610
+ id: z.ZodString;
611
+ reason: z.ZodString;
612
+ operation: z.ZodLiteral<"resource.resume">;
613
+ arguments: z.ZodObject<{
614
+ id: z.ZodString;
615
+ resumeToken: z.ZodString;
616
+ }, z.core.$strict>;
617
+ }, z.core.$strict>, z.ZodObject<{
618
+ id: z.ZodString;
619
+ reason: z.ZodString;
620
+ operation: z.ZodLiteral<"net.forward">;
621
+ arguments: z.ZodObject<{
622
+ direction: z.ZodEnum<{
623
+ local: "local";
624
+ remote: "remote";
625
+ socks: "socks";
626
+ }>;
627
+ host: z.ZodDefault<z.ZodString>;
628
+ port: z.ZodDefault<z.ZodNumber>;
629
+ bindHost: z.ZodDefault<z.ZodEnum<{
630
+ "127.0.0.1": "127.0.0.1";
631
+ "::1": "::1";
632
+ }>>;
633
+ bindPort: z.ZodDefault<z.ZodNumber>;
634
+ allowedHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
635
+ }, z.core.$strict>;
636
+ }, z.core.$strict>, z.ZodObject<{
637
+ id: z.ZodString;
638
+ reason: z.ZodString;
639
+ operation: z.ZodLiteral<"process.run">;
640
+ arguments: z.ZodObject<{
641
+ executable: z.ZodString;
642
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
643
+ cwd: z.ZodOptional<z.ZodString>;
644
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
645
+ }, z.core.$strict>;
646
+ }, z.core.$strict>, z.ZodObject<{
647
+ id: z.ZodString;
648
+ reason: z.ZodString;
649
+ operation: z.ZodLiteral<"process.script">;
650
+ arguments: z.ZodObject<{
651
+ interpreter: z.ZodString;
652
+ script: z.ZodString;
653
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
654
+ cwd: z.ZodOptional<z.ZodString>;
655
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
656
+ }, z.core.$strict>;
657
+ }, z.core.$strict>, ...z.ZodObject<{
658
+ id: z.ZodString;
659
+ reason: z.ZodString;
660
+ operation: z.ZodLiteral<"serial.capture" | "serial.exchange">;
661
+ arguments: z.ZodObject<{
662
+ path: z.ZodString;
663
+ baudRate: z.ZodDefault<z.ZodNumber>;
664
+ durationMs: z.ZodDefault<z.ZodNumber>;
665
+ dataHex: z.ZodOptional<z.ZodString>;
666
+ }, z.core.$strict>;
667
+ }, z.core.$strict>[]], "operation">>;
668
+ stopOnError: z.ZodDefault<z.ZodBoolean>;
669
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
670
+ }, z.core.$strict>;
671
+ }, z.core.$strict>]>;
672
+ export type AtomicTask = z.infer<typeof atomicTaskSchema>;
673
+ export type BatchTask = z.infer<typeof batchTaskSchema>;
49
674
  export type Task = z.infer<typeof taskSchema>;
50
675
  export type TaskInput = {
51
676
  operation: Task['operation'];
@@ -69,6 +694,37 @@ export type Result = {
69
694
  exitCode?: number | null;
70
695
  truncated?: boolean;
71
696
  };
697
+ export declare const resourceRequestSchema: z.ZodObject<{
698
+ id: z.ZodOptional<z.ZodString>;
699
+ action: z.ZodEnum<{
700
+ accept: "accept";
701
+ close: "close";
702
+ commit: "commit";
703
+ connect: "connect";
704
+ input: "input";
705
+ list: "list";
706
+ read: "read";
707
+ resize: "resize";
708
+ signal: "signal";
709
+ status: "status";
710
+ }>;
711
+ cursor: z.ZodDefault<z.ZodNumber>;
712
+ limit: z.ZodDefault<z.ZodNumber>;
713
+ data: z.ZodOptional<z.ZodString>;
714
+ eof: z.ZodDefault<z.ZodBoolean>;
715
+ cols: z.ZodOptional<z.ZodNumber>;
716
+ rows: z.ZodOptional<z.ZodNumber>;
717
+ signal: z.ZodOptional<z.ZodEnum<{
718
+ SIGHUP: "SIGHUP";
719
+ SIGINT: "SIGINT";
720
+ SIGKILL: "SIGKILL";
721
+ SIGQUIT: "SIGQUIT";
722
+ SIGTERM: "SIGTERM";
723
+ }>>;
724
+ host: z.ZodOptional<z.ZodString>;
725
+ port: z.ZodOptional<z.ZodNumber>;
726
+ }, z.core.$strict>;
727
+ export type ResourceRequest = z.infer<typeof resourceRequestSchema>;
72
728
  export type WireMessage = {
73
729
  type: 'session.accepted';
74
730
  label: string;
@@ -96,6 +752,24 @@ export type WireMessage = {
96
752
  } | {
97
753
  type: 'task.cancel';
98
754
  id: string;
755
+ } | {
756
+ type: 'resource.request';
757
+ requestId: string;
758
+ request: ResourceRequest;
759
+ } | {
760
+ type: 'resource.result';
761
+ requestId: string;
762
+ value?: unknown;
763
+ error?: string;
764
+ } | {
765
+ type: 'resource.request';
766
+ requestId: string;
767
+ request: ResourceRequest;
768
+ } | {
769
+ type: 'resource.result';
770
+ requestId: string;
771
+ value?: unknown;
772
+ error?: string;
99
773
  } | {
100
774
  type: 'ping' | 'pong';
101
775
  };