contree-client 0.1.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.
@@ -0,0 +1,811 @@
1
+ // Generated by codegen from the OpenAPI spec - do not edit.
2
+
3
+ export type OperationEventType =
4
+ | "init"
5
+ | "spawn"
6
+ | "stdin"
7
+ | "stdout"
8
+ | "stderr"
9
+ | "exit"
10
+ | "truncated"
11
+ | "size_cap"
12
+ | "network"
13
+ | "shutdown"
14
+ | "completion";
15
+
16
+ export declare const OPERATION_EVENT_TYPES: readonly OperationEventType[];
17
+
18
+ export type OperationStatus =
19
+ "PENDING" | "ASSIGNED" | "EXECUTING" | "SUCCESS" | "FAILED" | "CANCELLED";
20
+
21
+ export declare const OperationStatus: {
22
+ PENDING: "PENDING";
23
+ ASSIGNED: "ASSIGNED";
24
+ EXECUTING: "EXECUTING";
25
+ SUCCESS: "SUCCESS";
26
+ FAILED: "FAILED";
27
+ CANCELLED: "CANCELLED";
28
+ };
29
+
30
+ export declare const TERMINAL_STATUSES: Set<OperationStatus>;
31
+
32
+ export declare const ACTIVE_STATUSES: Set<OperationStatus>;
33
+
34
+ export declare function isTerminalStatus(status: string): boolean;
35
+
36
+ export declare class FileItem {
37
+ size: number;
38
+ path: string;
39
+ owner: string | number;
40
+ group: string | number;
41
+ uid: number;
42
+ gid: number;
43
+ mode: number;
44
+ mtime: number;
45
+ nlink: number;
46
+ is_dir: boolean;
47
+ is_regular: boolean;
48
+ is_symlink: boolean;
49
+ is_socket: boolean;
50
+ is_fifo: boolean;
51
+ symlink_to: string;
52
+ constructor(fields?: {
53
+ size?: number;
54
+ path?: string;
55
+ owner?: string | number;
56
+ group?: string | number;
57
+ uid?: number;
58
+ gid?: number;
59
+ mode?: number;
60
+ mtime?: number;
61
+ nlink?: number;
62
+ is_dir?: boolean;
63
+ is_regular?: boolean;
64
+ is_symlink?: boolean;
65
+ is_socket?: boolean;
66
+ is_fifo?: boolean;
67
+ symlink_to?: string;
68
+ });
69
+ static fromWire(data: Record<string, unknown>): FileItem;
70
+ toWire(): Record<string, unknown>;
71
+ }
72
+
73
+ export declare class DirectoryList {
74
+ path: string;
75
+ files: FileItem[];
76
+ constructor(fields?: { path?: string; files?: FileItem[] });
77
+ static fromWire(data: Record<string, unknown>): DirectoryList;
78
+ toWire(): Record<string, unknown>;
79
+ }
80
+
81
+ export declare class ImageImportRegistryCredentials {
82
+ username?: string;
83
+ password?: string;
84
+ constructor(fields?: { username?: string | null; password?: string | null });
85
+ static fromWire(
86
+ data: Record<string, unknown>,
87
+ ): ImageImportRegistryCredentials;
88
+ toWire(): Record<string, unknown>;
89
+ }
90
+
91
+ export declare class ImageImportRegistry {
92
+ url: string;
93
+ credentials?: ImageImportRegistryCredentials;
94
+ constructor(fields?: {
95
+ url?: string;
96
+ credentials?: ImageImportRegistryCredentials | null;
97
+ });
98
+ static fromWire(data: Record<string, unknown>): ImageImportRegistry;
99
+ toWire(): Record<string, unknown>;
100
+ }
101
+
102
+ export declare class ImageImportRequest {
103
+ registry: ImageImportRegistry;
104
+ tag?: string | null;
105
+ timeout?: number;
106
+ constructor(fields?: {
107
+ registry?: ImageImportRegistry;
108
+ tag?: string | null;
109
+ timeout?: number | null;
110
+ });
111
+ static fromWire(data: Record<string, unknown>): ImageImportRequest;
112
+ toWire(): Record<string, unknown>;
113
+ }
114
+
115
+ export declare class Image {
116
+ uuid?: string;
117
+ tag?: string | null;
118
+ created_at?: string;
119
+ operation_uuid?: string | null;
120
+ constructor(fields?: {
121
+ uuid?: string | null;
122
+ tag?: string | null;
123
+ created_at?: string | null;
124
+ operation_uuid?: string | null;
125
+ });
126
+ static fromWire(data: Record<string, unknown>): Image;
127
+ toWire(): Record<string, unknown>;
128
+ }
129
+
130
+ export declare class ImageListResponse {
131
+ images?: Image[];
132
+ constructor(fields?: { images?: Image[] | null });
133
+ static fromWire(data: Record<string, unknown>): ImageListResponse;
134
+ toWire(): Record<string, unknown>;
135
+ }
136
+
137
+ export declare class ImageImportMetadataRegistryCredentials {
138
+ username?: string;
139
+ password?: string;
140
+ constructor(fields?: { username?: string | null; password?: string | null });
141
+ static fromWire(
142
+ data: Record<string, unknown>,
143
+ ): ImageImportMetadataRegistryCredentials;
144
+ toWire(): Record<string, unknown>;
145
+ }
146
+
147
+ export declare class ImageImportMetadataRegistry {
148
+ url?: string;
149
+ credentials?: ImageImportMetadataRegistryCredentials;
150
+ constructor(fields?: {
151
+ url?: string | null;
152
+ credentials?: ImageImportMetadataRegistryCredentials | null;
153
+ });
154
+ static fromWire(data: Record<string, unknown>): ImageImportMetadataRegistry;
155
+ toWire(): Record<string, unknown>;
156
+ }
157
+
158
+ export declare class ImageImportMetadata {
159
+ registry?: ImageImportMetadataRegistry;
160
+ tag?: string | null;
161
+ timeout?: number;
162
+ constructor(fields?: {
163
+ registry?: ImageImportMetadataRegistry | null;
164
+ tag?: string | null;
165
+ timeout?: number | null;
166
+ });
167
+ static fromWire(data: Record<string, unknown>): ImageImportMetadata;
168
+ toWire(): Record<string, unknown>;
169
+ }
170
+
171
+ export declare class StreamRepr {
172
+ value: string;
173
+ encoding: "ascii" | "base64";
174
+ truncated?: boolean;
175
+ constructor(fields?: {
176
+ value?: string;
177
+ encoding?: "ascii" | "base64";
178
+ truncated?: boolean | null;
179
+ });
180
+ static fromWire(data: Record<string, unknown>): StreamRepr;
181
+ toWire(): Record<string, unknown>;
182
+
183
+ asBytes(): Uint8Array;
184
+ asText(): string;
185
+ static fromBytes(value: Uint8Array): StreamRepr;
186
+ static fromText(value: string): StreamRepr;
187
+ }
188
+
189
+ export declare class InstanceResourcesLimits {
190
+ max_layer_bytes?: number;
191
+ constructor(fields?: { max_layer_bytes?: number | null });
192
+ static fromWire(data: Record<string, unknown>): InstanceResourcesLimits;
193
+ toWire(): Record<string, unknown>;
194
+ }
195
+
196
+ export declare class FileSpec {
197
+ uuid?: string;
198
+ uid?: number;
199
+ gid?: number;
200
+ mode?: string | number;
201
+ constructor(fields?: {
202
+ uuid?: string | null;
203
+ uid?: number | null;
204
+ gid?: number | null;
205
+ mode?: string | number | null;
206
+ });
207
+ static fromWire(data: Record<string, unknown>): FileSpec;
208
+ toWire(): Record<string, unknown>;
209
+ }
210
+
211
+ export declare class InstanceSpawnRequest {
212
+ command: string;
213
+ image: string;
214
+ disposable?: boolean;
215
+ hostname?: string;
216
+ args?: string[];
217
+ shell?: boolean;
218
+ env?: Record<string, string> | null;
219
+ preserve_env?: boolean;
220
+ cwd?: string;
221
+ uid?: number;
222
+ gid?: number;
223
+ resources_limits?: InstanceResourcesLimits;
224
+ stdin?: StreamRepr;
225
+ timeout?: number;
226
+ truncate_output_at?: number;
227
+ files?: Record<string, FileSpec>;
228
+ constructor(fields?: {
229
+ command?: string;
230
+ image?: string;
231
+ disposable?: boolean | null;
232
+ hostname?: string | null;
233
+ args?: string[] | null;
234
+ shell?: boolean | null;
235
+ env?: Record<string, string> | null;
236
+ preserve_env?: boolean | null;
237
+ cwd?: string | null;
238
+ uid?: number | null;
239
+ gid?: number | null;
240
+ resources_limits?: InstanceResourcesLimits | null;
241
+ stdin?: StreamRepr | null;
242
+ timeout?: number | null;
243
+ truncate_output_at?: number | null;
244
+ files?: Record<string, FileSpec> | null;
245
+ });
246
+ static fromWire(data: Record<string, unknown>): InstanceSpawnRequest;
247
+ toWire(): Record<string, unknown>;
248
+ }
249
+
250
+ export declare class InstanceResultResources {
251
+ block_input?: number;
252
+ block_output?: number;
253
+ cost?: number;
254
+ elapsed_time?: number;
255
+ involuntary_switches?: number;
256
+ max_rss?: number;
257
+ monotonic_time?: number;
258
+ page_faults?: number;
259
+ page_faults_io?: number;
260
+ shared_memory?: number;
261
+ signals?: number;
262
+ swaps?: number;
263
+ system_cpu_time?: number;
264
+ unshared_memory?: number;
265
+ user_cpu_time?: number;
266
+ voluntary_switches?: number;
267
+ constructor(fields?: {
268
+ block_input?: number | null;
269
+ block_output?: number | null;
270
+ cost?: number | null;
271
+ elapsed_time?: number | null;
272
+ involuntary_switches?: number | null;
273
+ max_rss?: number | null;
274
+ monotonic_time?: number | null;
275
+ page_faults?: number | null;
276
+ page_faults_io?: number | null;
277
+ shared_memory?: number | null;
278
+ signals?: number | null;
279
+ swaps?: number | null;
280
+ system_cpu_time?: number | null;
281
+ unshared_memory?: number | null;
282
+ user_cpu_time?: number | null;
283
+ voluntary_switches?: number | null;
284
+ });
285
+ static fromWire(data: Record<string, unknown>): InstanceResultResources;
286
+ toWire(): Record<string, unknown>;
287
+ }
288
+
289
+ export declare class InstanceResultState {
290
+ continued?: boolean;
291
+ core_dump?: boolean;
292
+ exit_code?: number;
293
+ pid?: number;
294
+ signal?: number;
295
+ stopped?: boolean;
296
+ timed_out?: boolean;
297
+ constructor(fields?: {
298
+ continued?: boolean | null;
299
+ core_dump?: boolean | null;
300
+ exit_code?: number | null;
301
+ pid?: number | null;
302
+ signal?: number | null;
303
+ stopped?: boolean | null;
304
+ timed_out?: boolean | null;
305
+ });
306
+ static fromWire(data: Record<string, unknown>): InstanceResultState;
307
+ toWire(): Record<string, unknown>;
308
+ }
309
+
310
+ export declare class InstanceResult {
311
+ resources?: InstanceResultResources;
312
+ state?: InstanceResultState;
313
+ stdout?: StreamRepr;
314
+ stderr?: StreamRepr;
315
+ constructor(fields?: {
316
+ resources?: InstanceResultResources | null;
317
+ state?: InstanceResultState | null;
318
+ stdout?: StreamRepr | null;
319
+ stderr?: StreamRepr | null;
320
+ });
321
+ static fromWire(data: Record<string, unknown>): InstanceResult;
322
+ toWire(): Record<string, unknown>;
323
+ }
324
+
325
+ export declare class InstanceSpawnResponse {
326
+ uuid?: string;
327
+ command?: string;
328
+ image?: string;
329
+ hostname?: string;
330
+ args?: string[];
331
+ shell?: boolean;
332
+ env?: Record<string, string> | null;
333
+ preserve_env?: boolean;
334
+ cwd?: string;
335
+ uid?: number;
336
+ gid?: number;
337
+ resources_limits?: InstanceResourcesLimits;
338
+ stdin?: StreamRepr;
339
+ timeout?: number;
340
+ truncate_output_at?: number;
341
+ disposable?: boolean;
342
+ files?: Record<string, FileSpec>;
343
+ result?: InstanceResult | null;
344
+ constructor(fields?: {
345
+ uuid?: string | null;
346
+ command?: string | null;
347
+ image?: string | null;
348
+ hostname?: string | null;
349
+ args?: string[] | null;
350
+ shell?: boolean | null;
351
+ env?: Record<string, string> | null;
352
+ preserve_env?: boolean | null;
353
+ cwd?: string | null;
354
+ uid?: number | null;
355
+ gid?: number | null;
356
+ resources_limits?: InstanceResourcesLimits | null;
357
+ stdin?: StreamRepr | null;
358
+ timeout?: number | null;
359
+ truncate_output_at?: number | null;
360
+ disposable?: boolean | null;
361
+ files?: Record<string, FileSpec> | null;
362
+ result?: InstanceResult | null;
363
+ });
364
+ static fromWire(data: Record<string, unknown>): InstanceSpawnResponse;
365
+ toWire(): Record<string, unknown>;
366
+ }
367
+
368
+ export declare class OperationSummary {
369
+ uuid?: string;
370
+ kind?: "image_import" | "instance";
371
+ status?: OperationStatus;
372
+ error?: string | null;
373
+ created_at?: string;
374
+ duration?: number | null;
375
+ image_size?: number | null;
376
+ consumed_cpu?: number | null;
377
+ consumed_memory?: number | null;
378
+ image_uuid?: string | null;
379
+ result_image_uuid?: string | null;
380
+ constructor(fields?: {
381
+ uuid?: string | null;
382
+ kind?: "image_import" | "instance" | null;
383
+ status?: OperationStatus | null;
384
+ error?: string | null;
385
+ created_at?: string | null;
386
+ duration?: number | null;
387
+ image_size?: number | null;
388
+ consumed_cpu?: number | null;
389
+ consumed_memory?: number | null;
390
+ image_uuid?: string | null;
391
+ result_image_uuid?: string | null;
392
+ });
393
+ static fromWire(data: Record<string, unknown>): OperationSummary;
394
+ toWire(): Record<string, unknown>;
395
+ }
396
+
397
+ export declare class OperationInstanceMetadata {
398
+ command: string;
399
+ image: string;
400
+ disposable?: boolean;
401
+ hostname?: string;
402
+ args?: string[];
403
+ shell?: boolean;
404
+ env?: Record<string, string> | null;
405
+ preserve_env?: boolean;
406
+ cwd?: string;
407
+ uid?: number;
408
+ gid?: number;
409
+ resources_limits?: InstanceResourcesLimits;
410
+ stdin?: StreamRepr;
411
+ timeout?: number;
412
+ truncate_output_at?: number;
413
+ files?: Record<string, FileSpec>;
414
+ result?: InstanceResult;
415
+ constructor(fields?: {
416
+ command?: string;
417
+ image?: string;
418
+ disposable?: boolean | null;
419
+ hostname?: string | null;
420
+ args?: string[] | null;
421
+ shell?: boolean | null;
422
+ env?: Record<string, string> | null;
423
+ preserve_env?: boolean | null;
424
+ cwd?: string | null;
425
+ uid?: number | null;
426
+ gid?: number | null;
427
+ resources_limits?: InstanceResourcesLimits | null;
428
+ stdin?: StreamRepr | null;
429
+ timeout?: number | null;
430
+ truncate_output_at?: number | null;
431
+ files?: Record<string, FileSpec> | null;
432
+ result?: InstanceResult | null;
433
+ });
434
+ static fromWire(data: Record<string, unknown>): OperationInstanceMetadata;
435
+ toWire(): Record<string, unknown>;
436
+ }
437
+
438
+ export declare class OperationResult {
439
+ image?: string | null;
440
+ tag?: string | null;
441
+ constructor(fields?: { image?: string | null; tag?: string | null });
442
+ static fromWire(data: Record<string, unknown>): OperationResult;
443
+ toWire(): Record<string, unknown>;
444
+ }
445
+
446
+ export declare class OperationResponse {
447
+ uuid?: string;
448
+ kind?: "image_import" | "instance";
449
+ status?: OperationStatus;
450
+ error?: string | null;
451
+ created_at?: string;
452
+ duration?: number | null;
453
+ image_size?: number | null;
454
+ consumed_cpu?: number | null;
455
+ consumed_memory?: number | null;
456
+ image_uuid?: string | null;
457
+ result_image_uuid?: string | null;
458
+ metadata?: OperationInstanceMetadata | ImageImportMetadata;
459
+ result?: OperationResult;
460
+ constructor(fields?: {
461
+ uuid?: string | null;
462
+ kind?: "image_import" | "instance" | null;
463
+ status?: OperationStatus | null;
464
+ error?: string | null;
465
+ created_at?: string | null;
466
+ duration?: number | null;
467
+ image_size?: number | null;
468
+ consumed_cpu?: number | null;
469
+ consumed_memory?: number | null;
470
+ image_uuid?: string | null;
471
+ result_image_uuid?: string | null;
472
+ metadata?: OperationInstanceMetadata | ImageImportMetadata | null;
473
+ result?: OperationResult | null;
474
+ });
475
+ static fromWire(data: Record<string, unknown>): OperationResponse;
476
+ toWire(): Record<string, unknown>;
477
+ }
478
+
479
+ export declare class Error {
480
+ error: unknown;
481
+ status?: number;
482
+ traceback?: string[];
483
+ constructor(fields?: {
484
+ error?: unknown;
485
+ status?: number | null;
486
+ traceback?: string[] | null;
487
+ });
488
+ static fromWire(data: Record<string, unknown>): Error;
489
+ toWire(): Record<string, unknown>;
490
+ }
491
+
492
+ export declare class FileResponse {
493
+ uuid: string;
494
+ sha256: string;
495
+ size: number;
496
+ constructor(fields?: { uuid?: string; sha256?: string; size?: number });
497
+ static fromWire(data: Record<string, unknown>): FileResponse;
498
+ toWire(): Record<string, unknown>;
499
+ }
500
+
501
+ export declare class File {
502
+ uuid: string;
503
+ sha256: string;
504
+ size: number;
505
+ created_at: Date;
506
+ updated_at: Date;
507
+ constructor(fields?: {
508
+ uuid?: string;
509
+ sha256?: string;
510
+ size?: number;
511
+ created_at?: Date;
512
+ updated_at?: Date;
513
+ });
514
+ static fromWire(data: Record<string, unknown>): File;
515
+ toWire(): Record<string, unknown>;
516
+ }
517
+
518
+ export declare class FilesListResponse {
519
+ files?: File[];
520
+ constructor(fields?: { files?: File[] | null });
521
+ static fromWire(data: Record<string, unknown>): FilesListResponse;
522
+ toWire(): Record<string, unknown>;
523
+ }
524
+
525
+ export declare class WhoAmIResponse {
526
+ token_uuid: string;
527
+ token_expiration: number | null;
528
+ permissions: Record<string, boolean>;
529
+ operations_stat: Record<string, number>;
530
+ limits?: Record<string, number>;
531
+ constructor(fields?: {
532
+ token_uuid?: string;
533
+ token_expiration?: number | null;
534
+ permissions?: Record<string, boolean>;
535
+ operations_stat?: Record<string, number>;
536
+ limits?: Record<string, number> | null;
537
+ });
538
+ static fromWire(data: Record<string, unknown>): WhoAmIResponse;
539
+ toWire(): Record<string, unknown>;
540
+ }
541
+
542
+ export declare class OperationEvent {
543
+ id: number;
544
+ ts: Date;
545
+ type: OperationEventType;
546
+ data: EventData | Record<string, unknown>;
547
+ spid?: number;
548
+ constructor(fields?: {
549
+ id?: number;
550
+ ts?: Date;
551
+ type?: OperationEventType;
552
+ data?: EventData | Record<string, unknown>;
553
+ spid?: number | null;
554
+ });
555
+ static fromWire(data: Record<string, unknown>): OperationEvent;
556
+ toWire(): Record<string, unknown>;
557
+ }
558
+
559
+ export declare class EventDataInit {
560
+ started_at: Date;
561
+ runtime_path: string;
562
+ verbose: boolean;
563
+ init_pid: number;
564
+ hostname?: string;
565
+ kernel?: string;
566
+ machine?: string;
567
+ boot_id?: string;
568
+ constructor(fields?: {
569
+ started_at?: Date;
570
+ runtime_path?: string;
571
+ verbose?: boolean;
572
+ init_pid?: number;
573
+ hostname?: string | null;
574
+ kernel?: string | null;
575
+ machine?: string | null;
576
+ boot_id?: string | null;
577
+ });
578
+ static fromWire(data: Record<string, unknown>): EventDataInit;
579
+ toWire(): Record<string, unknown>;
580
+ }
581
+
582
+ export declare class EventDataSpawn {
583
+ pid: number;
584
+ command: string;
585
+ args: string[];
586
+ shell: boolean;
587
+ cwd: string;
588
+ uid: number;
589
+ gid: number;
590
+ timeout: number;
591
+ truncate_at: number;
592
+ env?: Record<string, string>;
593
+ constructor(fields?: {
594
+ pid?: number;
595
+ command?: string;
596
+ args?: string[];
597
+ shell?: boolean;
598
+ cwd?: string;
599
+ uid?: number;
600
+ gid?: number;
601
+ timeout?: number;
602
+ truncate_at?: number;
603
+ env?: Record<string, string> | null;
604
+ });
605
+ static fromWire(data: Record<string, unknown>): EventDataSpawn;
606
+ toWire(): Record<string, unknown>;
607
+ }
608
+
609
+ export declare class EventDataStream {
610
+ value: string;
611
+ encoding: "ascii" | "base64";
612
+ truncated?: boolean;
613
+ constructor(fields?: {
614
+ value?: string;
615
+ encoding?: "ascii" | "base64";
616
+ truncated?: boolean | null;
617
+ });
618
+ static fromWire(data: Record<string, unknown>): EventDataStream;
619
+ toWire(): Record<string, unknown>;
620
+
621
+ asBytes(): Uint8Array;
622
+ asText(): string;
623
+ static fromBytes(value: Uint8Array): EventDataStream;
624
+ static fromText(value: string): EventDataStream;
625
+ }
626
+
627
+ export declare class EventResources {
628
+ user_time_us: number;
629
+ sys_time_us: number;
630
+ max_rss_kb: number;
631
+ shared_memory: number;
632
+ unshared_memory: number;
633
+ swaps: number;
634
+ minor_faults: number;
635
+ major_faults: number;
636
+ voluntary_ctx_switches: number;
637
+ involuntary_ctx_switches: number;
638
+ block_input_ops: number;
639
+ block_output_ops: number;
640
+ ipc_msgs_sent: number;
641
+ ipc_msgs_received: number;
642
+ signals_received: number;
643
+ constructor(fields?: {
644
+ user_time_us?: number;
645
+ sys_time_us?: number;
646
+ max_rss_kb?: number;
647
+ shared_memory?: number;
648
+ unshared_memory?: number;
649
+ swaps?: number;
650
+ minor_faults?: number;
651
+ major_faults?: number;
652
+ voluntary_ctx_switches?: number;
653
+ involuntary_ctx_switches?: number;
654
+ block_input_ops?: number;
655
+ block_output_ops?: number;
656
+ ipc_msgs_sent?: number;
657
+ ipc_msgs_received?: number;
658
+ signals_received?: number;
659
+ });
660
+ static fromWire(data: Record<string, unknown>): EventResources;
661
+ toWire(): Record<string, unknown>;
662
+ }
663
+
664
+ export declare class EventDataExit {
665
+ pid: number;
666
+ code: number;
667
+ signal: number;
668
+ timed_out: boolean;
669
+ duration_ms: number;
670
+ resources: EventResources;
671
+ constructor(fields?: {
672
+ pid?: number;
673
+ code?: number;
674
+ signal?: number;
675
+ timed_out?: boolean;
676
+ duration_ms?: number;
677
+ resources?: EventResources;
678
+ });
679
+ static fromWire(data: Record<string, unknown>): EventDataExit;
680
+ toWire(): Record<string, unknown>;
681
+ }
682
+
683
+ export declare class EventDataTruncated {
684
+ stream: "stdin" | "stdout" | "stderr";
685
+ bytes_emitted: number;
686
+ bytes_dropped: number;
687
+ constructor(fields?: {
688
+ stream?: "stdin" | "stdout" | "stderr";
689
+ bytes_emitted?: number;
690
+ bytes_dropped?: number;
691
+ });
692
+ static fromWire(data: Record<string, unknown>): EventDataTruncated;
693
+ toWire(): Record<string, unknown>;
694
+ }
695
+
696
+ export declare class EventDataSizeCap {
697
+ limit_bytes: number;
698
+ file_size: number;
699
+ constructor(fields?: { limit_bytes?: number; file_size?: number });
700
+ static fromWire(data: Record<string, unknown>): EventDataSizeCap;
701
+ toWire(): Record<string, unknown>;
702
+ }
703
+
704
+ export declare class NetworkInterface {
705
+ name: string;
706
+ rx_bytes: number;
707
+ rx_packets: number;
708
+ rx_errs: number;
709
+ rx_drop: number;
710
+ tx_bytes: number;
711
+ tx_packets: number;
712
+ tx_errs: number;
713
+ tx_drop: number;
714
+ constructor(fields?: {
715
+ name?: string;
716
+ rx_bytes?: number;
717
+ rx_packets?: number;
718
+ rx_errs?: number;
719
+ rx_drop?: number;
720
+ tx_bytes?: number;
721
+ tx_packets?: number;
722
+ tx_errs?: number;
723
+ tx_drop?: number;
724
+ });
725
+ static fromWire(data: Record<string, unknown>): NetworkInterface;
726
+ toWire(): Record<string, unknown>;
727
+ }
728
+
729
+ export declare class EventDataNetworkConfigured {
730
+ ip4?: string;
731
+ ip4_gw?: string;
732
+ ip6?: string;
733
+ ip6_gw?: string;
734
+ gw_mac?: string;
735
+ nameserver?: string;
736
+ constructor(fields?: {
737
+ ip4?: string | null;
738
+ ip4_gw?: string | null;
739
+ ip6?: string | null;
740
+ ip6_gw?: string | null;
741
+ gw_mac?: string | null;
742
+ nameserver?: string | null;
743
+ });
744
+ static fromWire(data: Record<string, unknown>): EventDataNetworkConfigured;
745
+ toWire(): Record<string, unknown>;
746
+ }
747
+
748
+ export declare class EventDataNetwork {
749
+ interfaces: NetworkInterface[];
750
+ configured?: EventDataNetworkConfigured;
751
+ error?: string;
752
+ constructor(fields?: {
753
+ interfaces?: NetworkInterface[];
754
+ configured?: EventDataNetworkConfigured | null;
755
+ error?: string | null;
756
+ });
757
+ static fromWire(data: Record<string, unknown>): EventDataNetwork;
758
+ toWire(): Record<string, unknown>;
759
+ }
760
+
761
+ export declare class EventDataShutdown {
762
+ stopped_at: Date;
763
+ reason: "job_complete" | "timeout" | "spawn_failed" | "signal";
764
+ constructor(fields?: {
765
+ stopped_at?: Date;
766
+ reason?: "job_complete" | "timeout" | "spawn_failed" | "signal";
767
+ });
768
+ static fromWire(data: Record<string, unknown>): EventDataShutdown;
769
+ toWire(): Record<string, unknown>;
770
+ }
771
+
772
+ export declare class EventDataCompletion {
773
+ status: OperationStatus;
774
+ duration_ms: number;
775
+ result_image_uuid?: string | null;
776
+ error?: string | null;
777
+ image_size_bytes?: number;
778
+ constructor(fields?: {
779
+ status?: OperationStatus;
780
+ duration_ms?: number;
781
+ result_image_uuid?: string | null;
782
+ error?: string | null;
783
+ image_size_bytes?: number | null;
784
+ });
785
+ static fromWire(data: Record<string, unknown>): EventDataCompletion;
786
+ toWire(): Record<string, unknown>;
787
+ }
788
+
789
+ export type EventData =
790
+ | EventDataCompletion
791
+ | EventDataExit
792
+ | EventDataInit
793
+ | EventDataNetwork
794
+ | EventDataShutdown
795
+ | EventDataSizeCap
796
+ | EventDataSpawn
797
+ | EventDataStream
798
+ | EventDataTruncated;
799
+
800
+ export declare const EVENT_DATA_PARSERS: Record<
801
+ string,
802
+ { fromWire(data: Record<string, unknown>): EventData }
803
+ >;
804
+
805
+ export declare function parseEventData(
806
+ eventType: string,
807
+ data: unknown,
808
+ ): EventData | unknown;
809
+
810
+ export declare function decodeChunk(data: unknown): Uint8Array;
811
+ export declare function decodeStream(stream: unknown): string;