@kya-os/contracts 1.7.24 → 1.7.26

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.
@@ -33,7 +33,15 @@ export interface AdminWSGatewayStatus {
33
33
  pid: number | null;
34
34
  port: number;
35
35
  }
36
- /** Full state snapshot (devices + pairings + gateway) */
36
+ /** Core file from container workspace/config directory */
37
+ export interface AdminWSCoreFile {
38
+ name: string;
39
+ path: string;
40
+ content: string;
41
+ size: number;
42
+ lastModified: string;
43
+ }
44
+ /** Full state snapshot (devices + pairings + gateway + optional files) */
37
45
  export interface AdminWSFullState {
38
46
  devices: AdminWSDevice[];
39
47
  pairings: {
@@ -41,6 +49,7 @@ export interface AdminWSFullState {
41
49
  approved: AdminWSPairing[];
42
50
  };
43
51
  gateway: AdminWSGatewayStatus;
52
+ files?: AdminWSCoreFile[];
44
53
  }
45
54
  export interface AdminWSConnectedMessage {
46
55
  type: "connected";
@@ -82,8 +91,13 @@ export interface AdminWSCommandResultMessage {
82
91
  error?: string;
83
92
  data?: unknown;
84
93
  }
94
+ /** Server → Client: core files state */
95
+ export interface AdminWSFilesMessage {
96
+ type: "state:files";
97
+ data: AdminWSCoreFile[];
98
+ }
85
99
  /** Union of all server → client messages */
86
- export type AdminWSServerMessage = AdminWSConnectedMessage | AdminWSFullStateMessage | AdminWSDevicesMessage | AdminWSPairingsMessage | AdminWSGatewayMessage | AdminWSPingMessage | AdminWSErrorMessage | AdminWSCommandResultMessage;
100
+ export type AdminWSServerMessage = AdminWSConnectedMessage | AdminWSFullStateMessage | AdminWSDevicesMessage | AdminWSPairingsMessage | AdminWSGatewayMessage | AdminWSFilesMessage | AdminWSPingMessage | AdminWSErrorMessage | AdminWSCommandResultMessage;
87
101
  export interface AdminWSPongMessage {
88
102
  type: "pong";
89
103
  }
@@ -114,8 +128,30 @@ export interface AdminWSApproveAllDevicesCommand {
114
128
  type: "command:approve-devices-all";
115
129
  requestId: string;
116
130
  }
131
+ /** Client → Server: Read all core files from container */
132
+ export interface AdminWSReadFilesCommand {
133
+ type: "command:read-files";
134
+ requestId: string;
135
+ }
136
+ /** Client → Server: Write a single file to the container */
137
+ export interface AdminWSWriteFileCommand {
138
+ type: "command:write-file";
139
+ requestId: string;
140
+ path: string;
141
+ content: string;
142
+ }
143
+ /** Client → Server: Reset agent (delete config, force re-onboard) */
144
+ export interface AdminWSResetAgentCommand {
145
+ type: "command:reset-agent";
146
+ requestId: string;
147
+ }
148
+ /** Client → Server: Restart the gateway process */
149
+ export interface AdminWSRestartGatewayCommand {
150
+ type: "command:restart-gateway";
151
+ requestId: string;
152
+ }
117
153
  /** Client → Server command union */
118
- export type AdminWSCommand = AdminWSApprovePairingCommand | AdminWSApproveDeviceCommand | AdminWSApproveAllPairingsCommand | AdminWSApproveAllDevicesCommand;
154
+ export type AdminWSCommand = AdminWSApprovePairingCommand | AdminWSApproveDeviceCommand | AdminWSApproveAllPairingsCommand | AdminWSApproveAllDevicesCommand | AdminWSReadFilesCommand | AdminWSWriteFileCommand | AdminWSResetAgentCommand | AdminWSRestartGatewayCommand;
119
155
  /** Union of all client → server messages */
120
156
  export type AdminWSClientMessage = AdminWSPongMessage | AdminWSRefreshMessage | AdminWSCommand;
121
157
  /** Response from POST /api/admin/ws/ticket */
@@ -133,23 +169,23 @@ export declare const adminWSDeviceSchema: z.ZodObject<{
133
169
  clientMode: z.ZodOptional<z.ZodString>;
134
170
  role: z.ZodOptional<z.ZodString>;
135
171
  }, "strip", z.ZodTypeAny, {
136
- id: string;
137
- name: string;
138
172
  status: "pending" | "approved";
173
+ name: string;
174
+ id: string;
139
175
  lastSeen: string;
140
- ip?: string | undefined;
141
- platform?: string | undefined;
142
176
  clientId?: string | undefined;
177
+ platform?: string | undefined;
178
+ ip?: string | undefined;
143
179
  clientMode?: string | undefined;
144
180
  role?: string | undefined;
145
181
  }, {
146
- id: string;
147
- name: string;
148
182
  status: "pending" | "approved";
183
+ name: string;
184
+ id: string;
149
185
  lastSeen: string;
150
- ip?: string | undefined;
151
- platform?: string | undefined;
152
186
  clientId?: string | undefined;
187
+ platform?: string | undefined;
188
+ ip?: string | undefined;
153
189
  clientMode?: string | undefined;
154
190
  role?: string | undefined;
155
191
  }>;
@@ -175,12 +211,31 @@ export declare const adminWSGatewayStatusSchema: z.ZodObject<{
175
211
  port: z.ZodNumber;
176
212
  }, "strip", z.ZodTypeAny, {
177
213
  running: boolean;
178
- pid: number | null;
179
214
  port: number;
215
+ pid: number | null;
180
216
  }, {
181
217
  running: boolean;
182
- pid: number | null;
183
218
  port: number;
219
+ pid: number | null;
220
+ }>;
221
+ export declare const adminWSCoreFileSchema: z.ZodObject<{
222
+ name: z.ZodString;
223
+ path: z.ZodString;
224
+ content: z.ZodString;
225
+ size: z.ZodNumber;
226
+ lastModified: z.ZodString;
227
+ }, "strip", z.ZodTypeAny, {
228
+ path: string;
229
+ name: string;
230
+ content: string;
231
+ size: number;
232
+ lastModified: string;
233
+ }, {
234
+ path: string;
235
+ name: string;
236
+ content: string;
237
+ size: number;
238
+ lastModified: string;
184
239
  }>;
185
240
  export declare const adminWSFullStateSchema: z.ZodObject<{
186
241
  devices: z.ZodArray<z.ZodObject<{
@@ -194,23 +249,23 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
194
249
  clientMode: z.ZodOptional<z.ZodString>;
195
250
  role: z.ZodOptional<z.ZodString>;
196
251
  }, "strip", z.ZodTypeAny, {
197
- id: string;
198
- name: string;
199
252
  status: "pending" | "approved";
253
+ name: string;
254
+ id: string;
200
255
  lastSeen: string;
201
- ip?: string | undefined;
202
- platform?: string | undefined;
203
256
  clientId?: string | undefined;
257
+ platform?: string | undefined;
258
+ ip?: string | undefined;
204
259
  clientMode?: string | undefined;
205
260
  role?: string | undefined;
206
261
  }, {
207
- id: string;
208
- name: string;
209
262
  status: "pending" | "approved";
263
+ name: string;
264
+ id: string;
210
265
  lastSeen: string;
211
- ip?: string | undefined;
212
- platform?: string | undefined;
213
266
  clientId?: string | undefined;
267
+ platform?: string | undefined;
268
+ ip?: string | undefined;
214
269
  clientMode?: string | undefined;
215
270
  role?: string | undefined;
216
271
  }>, "many">;
@@ -280,22 +335,41 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
280
335
  port: z.ZodNumber;
281
336
  }, "strip", z.ZodTypeAny, {
282
337
  running: boolean;
283
- pid: number | null;
284
338
  port: number;
339
+ pid: number | null;
285
340
  }, {
286
341
  running: boolean;
287
- pid: number | null;
288
342
  port: number;
343
+ pid: number | null;
289
344
  }>;
345
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
346
+ name: z.ZodString;
347
+ path: z.ZodString;
348
+ content: z.ZodString;
349
+ size: z.ZodNumber;
350
+ lastModified: z.ZodString;
351
+ }, "strip", z.ZodTypeAny, {
352
+ path: string;
353
+ name: string;
354
+ content: string;
355
+ size: number;
356
+ lastModified: string;
357
+ }, {
358
+ path: string;
359
+ name: string;
360
+ content: string;
361
+ size: number;
362
+ lastModified: string;
363
+ }>, "many">>;
290
364
  }, "strip", z.ZodTypeAny, {
291
365
  devices: {
292
- id: string;
293
- name: string;
294
366
  status: "pending" | "approved";
367
+ name: string;
368
+ id: string;
295
369
  lastSeen: string;
296
- ip?: string | undefined;
297
- platform?: string | undefined;
298
370
  clientId?: string | undefined;
371
+ platform?: string | undefined;
372
+ ip?: string | undefined;
299
373
  clientMode?: string | undefined;
300
374
  role?: string | undefined;
301
375
  }[];
@@ -315,18 +389,25 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
315
389
  };
316
390
  gateway: {
317
391
  running: boolean;
318
- pid: number | null;
319
392
  port: number;
393
+ pid: number | null;
320
394
  };
395
+ files?: {
396
+ path: string;
397
+ name: string;
398
+ content: string;
399
+ size: number;
400
+ lastModified: string;
401
+ }[] | undefined;
321
402
  }, {
322
403
  devices: {
323
- id: string;
324
- name: string;
325
404
  status: "pending" | "approved";
405
+ name: string;
406
+ id: string;
326
407
  lastSeen: string;
327
- ip?: string | undefined;
328
- platform?: string | undefined;
329
408
  clientId?: string | undefined;
409
+ platform?: string | undefined;
410
+ ip?: string | undefined;
330
411
  clientMode?: string | undefined;
331
412
  role?: string | undefined;
332
413
  }[];
@@ -346,9 +427,16 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
346
427
  };
347
428
  gateway: {
348
429
  running: boolean;
349
- pid: number | null;
350
430
  port: number;
431
+ pid: number | null;
351
432
  };
433
+ files?: {
434
+ path: string;
435
+ name: string;
436
+ content: string;
437
+ size: number;
438
+ lastModified: string;
439
+ }[] | undefined;
352
440
  }>;
353
441
  export declare const adminWSConnectedMessageSchema: z.ZodObject<{
354
442
  type: z.ZodLiteral<"connected">;
@@ -374,23 +462,23 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
374
462
  clientMode: z.ZodOptional<z.ZodString>;
375
463
  role: z.ZodOptional<z.ZodString>;
376
464
  }, "strip", z.ZodTypeAny, {
377
- id: string;
378
- name: string;
379
465
  status: "pending" | "approved";
466
+ name: string;
467
+ id: string;
380
468
  lastSeen: string;
381
- ip?: string | undefined;
382
- platform?: string | undefined;
383
469
  clientId?: string | undefined;
470
+ platform?: string | undefined;
471
+ ip?: string | undefined;
384
472
  clientMode?: string | undefined;
385
473
  role?: string | undefined;
386
474
  }, {
387
- id: string;
388
- name: string;
389
475
  status: "pending" | "approved";
476
+ name: string;
477
+ id: string;
390
478
  lastSeen: string;
391
- ip?: string | undefined;
392
- platform?: string | undefined;
393
479
  clientId?: string | undefined;
480
+ platform?: string | undefined;
481
+ ip?: string | undefined;
394
482
  clientMode?: string | undefined;
395
483
  role?: string | undefined;
396
484
  }>, "many">;
@@ -460,22 +548,41 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
460
548
  port: z.ZodNumber;
461
549
  }, "strip", z.ZodTypeAny, {
462
550
  running: boolean;
463
- pid: number | null;
464
551
  port: number;
552
+ pid: number | null;
465
553
  }, {
466
554
  running: boolean;
467
- pid: number | null;
468
555
  port: number;
556
+ pid: number | null;
469
557
  }>;
558
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
559
+ name: z.ZodString;
560
+ path: z.ZodString;
561
+ content: z.ZodString;
562
+ size: z.ZodNumber;
563
+ lastModified: z.ZodString;
564
+ }, "strip", z.ZodTypeAny, {
565
+ path: string;
566
+ name: string;
567
+ content: string;
568
+ size: number;
569
+ lastModified: string;
570
+ }, {
571
+ path: string;
572
+ name: string;
573
+ content: string;
574
+ size: number;
575
+ lastModified: string;
576
+ }>, "many">>;
470
577
  }, "strip", z.ZodTypeAny, {
471
578
  devices: {
472
- id: string;
473
- name: string;
474
579
  status: "pending" | "approved";
580
+ name: string;
581
+ id: string;
475
582
  lastSeen: string;
476
- ip?: string | undefined;
477
- platform?: string | undefined;
478
583
  clientId?: string | undefined;
584
+ platform?: string | undefined;
585
+ ip?: string | undefined;
479
586
  clientMode?: string | undefined;
480
587
  role?: string | undefined;
481
588
  }[];
@@ -495,18 +602,25 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
495
602
  };
496
603
  gateway: {
497
604
  running: boolean;
498
- pid: number | null;
499
605
  port: number;
606
+ pid: number | null;
500
607
  };
608
+ files?: {
609
+ path: string;
610
+ name: string;
611
+ content: string;
612
+ size: number;
613
+ lastModified: string;
614
+ }[] | undefined;
501
615
  }, {
502
616
  devices: {
503
- id: string;
504
- name: string;
505
617
  status: "pending" | "approved";
618
+ name: string;
619
+ id: string;
506
620
  lastSeen: string;
507
- ip?: string | undefined;
508
- platform?: string | undefined;
509
621
  clientId?: string | undefined;
622
+ platform?: string | undefined;
623
+ ip?: string | undefined;
510
624
  clientMode?: string | undefined;
511
625
  role?: string | undefined;
512
626
  }[];
@@ -526,21 +640,28 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
526
640
  };
527
641
  gateway: {
528
642
  running: boolean;
529
- pid: number | null;
530
643
  port: number;
644
+ pid: number | null;
531
645
  };
646
+ files?: {
647
+ path: string;
648
+ name: string;
649
+ content: string;
650
+ size: number;
651
+ lastModified: string;
652
+ }[] | undefined;
532
653
  }>;
533
654
  }, "strip", z.ZodTypeAny, {
534
655
  type: "state:full";
535
656
  data: {
536
657
  devices: {
537
- id: string;
538
- name: string;
539
658
  status: "pending" | "approved";
659
+ name: string;
660
+ id: string;
540
661
  lastSeen: string;
541
- ip?: string | undefined;
542
- platform?: string | undefined;
543
662
  clientId?: string | undefined;
663
+ platform?: string | undefined;
664
+ ip?: string | undefined;
544
665
  clientMode?: string | undefined;
545
666
  role?: string | undefined;
546
667
  }[];
@@ -560,21 +681,28 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
560
681
  };
561
682
  gateway: {
562
683
  running: boolean;
563
- pid: number | null;
564
684
  port: number;
685
+ pid: number | null;
565
686
  };
687
+ files?: {
688
+ path: string;
689
+ name: string;
690
+ content: string;
691
+ size: number;
692
+ lastModified: string;
693
+ }[] | undefined;
566
694
  };
567
695
  }, {
568
696
  type: "state:full";
569
697
  data: {
570
698
  devices: {
571
- id: string;
572
- name: string;
573
699
  status: "pending" | "approved";
700
+ name: string;
701
+ id: string;
574
702
  lastSeen: string;
575
- ip?: string | undefined;
576
- platform?: string | undefined;
577
703
  clientId?: string | undefined;
704
+ platform?: string | undefined;
705
+ ip?: string | undefined;
578
706
  clientMode?: string | undefined;
579
707
  role?: string | undefined;
580
708
  }[];
@@ -594,9 +722,16 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
594
722
  };
595
723
  gateway: {
596
724
  running: boolean;
597
- pid: number | null;
598
725
  port: number;
726
+ pid: number | null;
599
727
  };
728
+ files?: {
729
+ path: string;
730
+ name: string;
731
+ content: string;
732
+ size: number;
733
+ lastModified: string;
734
+ }[] | undefined;
600
735
  };
601
736
  }>;
602
737
  export declare const adminWSDevicesMessageSchema: z.ZodObject<{
@@ -612,49 +747,49 @@ export declare const adminWSDevicesMessageSchema: z.ZodObject<{
612
747
  clientMode: z.ZodOptional<z.ZodString>;
613
748
  role: z.ZodOptional<z.ZodString>;
614
749
  }, "strip", z.ZodTypeAny, {
615
- id: string;
616
- name: string;
617
750
  status: "pending" | "approved";
751
+ name: string;
752
+ id: string;
618
753
  lastSeen: string;
619
- ip?: string | undefined;
620
- platform?: string | undefined;
621
754
  clientId?: string | undefined;
755
+ platform?: string | undefined;
756
+ ip?: string | undefined;
622
757
  clientMode?: string | undefined;
623
758
  role?: string | undefined;
624
759
  }, {
625
- id: string;
626
- name: string;
627
760
  status: "pending" | "approved";
761
+ name: string;
762
+ id: string;
628
763
  lastSeen: string;
629
- ip?: string | undefined;
630
- platform?: string | undefined;
631
764
  clientId?: string | undefined;
765
+ platform?: string | undefined;
766
+ ip?: string | undefined;
632
767
  clientMode?: string | undefined;
633
768
  role?: string | undefined;
634
769
  }>, "many">;
635
770
  }, "strip", z.ZodTypeAny, {
636
771
  type: "state:devices";
637
772
  data: {
638
- id: string;
639
- name: string;
640
773
  status: "pending" | "approved";
774
+ name: string;
775
+ id: string;
641
776
  lastSeen: string;
642
- ip?: string | undefined;
643
- platform?: string | undefined;
644
777
  clientId?: string | undefined;
778
+ platform?: string | undefined;
779
+ ip?: string | undefined;
645
780
  clientMode?: string | undefined;
646
781
  role?: string | undefined;
647
782
  }[];
648
783
  }, {
649
784
  type: "state:devices";
650
785
  data: {
651
- id: string;
652
- name: string;
653
786
  status: "pending" | "approved";
787
+ name: string;
788
+ id: string;
654
789
  lastSeen: string;
655
- ip?: string | undefined;
656
- platform?: string | undefined;
657
790
  clientId?: string | undefined;
791
+ platform?: string | undefined;
792
+ ip?: string | undefined;
658
793
  clientMode?: string | undefined;
659
794
  role?: string | undefined;
660
795
  }[];
@@ -762,26 +897,26 @@ export declare const adminWSGatewayMessageSchema: z.ZodObject<{
762
897
  port: z.ZodNumber;
763
898
  }, "strip", z.ZodTypeAny, {
764
899
  running: boolean;
765
- pid: number | null;
766
900
  port: number;
901
+ pid: number | null;
767
902
  }, {
768
903
  running: boolean;
769
- pid: number | null;
770
904
  port: number;
905
+ pid: number | null;
771
906
  }>;
772
907
  }, "strip", z.ZodTypeAny, {
773
908
  type: "state:gateway";
774
909
  data: {
775
910
  running: boolean;
776
- pid: number | null;
777
911
  port: number;
912
+ pid: number | null;
778
913
  };
779
914
  }, {
780
915
  type: "state:gateway";
781
916
  data: {
782
917
  running: boolean;
783
- pid: number | null;
784
918
  port: number;
919
+ pid: number | null;
785
920
  };
786
921
  }>;
787
922
  export declare const adminWSPingMessageSchema: z.ZodObject<{
@@ -815,16 +950,56 @@ export declare const adminWSCommandResultMessageSchema: z.ZodObject<{
815
950
  data: z.ZodOptional<z.ZodUnknown>;
816
951
  }, "strip", z.ZodTypeAny, {
817
952
  type: "command:result";
818
- requestId: string;
819
953
  success: boolean;
820
- data?: unknown;
954
+ requestId: string;
821
955
  error?: string | undefined;
956
+ data?: unknown;
822
957
  }, {
823
958
  type: "command:result";
824
- requestId: string;
825
959
  success: boolean;
826
- data?: unknown;
960
+ requestId: string;
827
961
  error?: string | undefined;
962
+ data?: unknown;
963
+ }>;
964
+ export declare const adminWSFilesMessageSchema: z.ZodObject<{
965
+ type: z.ZodLiteral<"state:files">;
966
+ data: z.ZodArray<z.ZodObject<{
967
+ name: z.ZodString;
968
+ path: z.ZodString;
969
+ content: z.ZodString;
970
+ size: z.ZodNumber;
971
+ lastModified: z.ZodString;
972
+ }, "strip", z.ZodTypeAny, {
973
+ path: string;
974
+ name: string;
975
+ content: string;
976
+ size: number;
977
+ lastModified: string;
978
+ }, {
979
+ path: string;
980
+ name: string;
981
+ content: string;
982
+ size: number;
983
+ lastModified: string;
984
+ }>, "many">;
985
+ }, "strip", z.ZodTypeAny, {
986
+ type: "state:files";
987
+ data: {
988
+ path: string;
989
+ name: string;
990
+ content: string;
991
+ size: number;
992
+ lastModified: string;
993
+ }[];
994
+ }, {
995
+ type: "state:files";
996
+ data: {
997
+ path: string;
998
+ name: string;
999
+ content: string;
1000
+ size: number;
1001
+ lastModified: string;
1002
+ }[];
828
1003
  }>;
829
1004
  export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
830
1005
  type: z.ZodLiteral<"connected">;
@@ -849,23 +1024,23 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
849
1024
  clientMode: z.ZodOptional<z.ZodString>;
850
1025
  role: z.ZodOptional<z.ZodString>;
851
1026
  }, "strip", z.ZodTypeAny, {
852
- id: string;
853
- name: string;
854
1027
  status: "pending" | "approved";
1028
+ name: string;
1029
+ id: string;
855
1030
  lastSeen: string;
856
- ip?: string | undefined;
857
- platform?: string | undefined;
858
1031
  clientId?: string | undefined;
1032
+ platform?: string | undefined;
1033
+ ip?: string | undefined;
859
1034
  clientMode?: string | undefined;
860
1035
  role?: string | undefined;
861
1036
  }, {
862
- id: string;
863
- name: string;
864
1037
  status: "pending" | "approved";
1038
+ name: string;
1039
+ id: string;
865
1040
  lastSeen: string;
866
- ip?: string | undefined;
867
- platform?: string | undefined;
868
1041
  clientId?: string | undefined;
1042
+ platform?: string | undefined;
1043
+ ip?: string | undefined;
869
1044
  clientMode?: string | undefined;
870
1045
  role?: string | undefined;
871
1046
  }>, "many">;
@@ -935,22 +1110,41 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
935
1110
  port: z.ZodNumber;
936
1111
  }, "strip", z.ZodTypeAny, {
937
1112
  running: boolean;
938
- pid: number | null;
939
1113
  port: number;
1114
+ pid: number | null;
940
1115
  }, {
941
1116
  running: boolean;
942
- pid: number | null;
943
1117
  port: number;
1118
+ pid: number | null;
944
1119
  }>;
1120
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
1121
+ name: z.ZodString;
1122
+ path: z.ZodString;
1123
+ content: z.ZodString;
1124
+ size: z.ZodNumber;
1125
+ lastModified: z.ZodString;
1126
+ }, "strip", z.ZodTypeAny, {
1127
+ path: string;
1128
+ name: string;
1129
+ content: string;
1130
+ size: number;
1131
+ lastModified: string;
1132
+ }, {
1133
+ path: string;
1134
+ name: string;
1135
+ content: string;
1136
+ size: number;
1137
+ lastModified: string;
1138
+ }>, "many">>;
945
1139
  }, "strip", z.ZodTypeAny, {
946
1140
  devices: {
947
- id: string;
948
- name: string;
949
1141
  status: "pending" | "approved";
1142
+ name: string;
1143
+ id: string;
950
1144
  lastSeen: string;
951
- ip?: string | undefined;
952
- platform?: string | undefined;
953
1145
  clientId?: string | undefined;
1146
+ platform?: string | undefined;
1147
+ ip?: string | undefined;
954
1148
  clientMode?: string | undefined;
955
1149
  role?: string | undefined;
956
1150
  }[];
@@ -970,18 +1164,25 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
970
1164
  };
971
1165
  gateway: {
972
1166
  running: boolean;
973
- pid: number | null;
974
1167
  port: number;
1168
+ pid: number | null;
975
1169
  };
1170
+ files?: {
1171
+ path: string;
1172
+ name: string;
1173
+ content: string;
1174
+ size: number;
1175
+ lastModified: string;
1176
+ }[] | undefined;
976
1177
  }, {
977
1178
  devices: {
978
- id: string;
979
- name: string;
980
1179
  status: "pending" | "approved";
1180
+ name: string;
1181
+ id: string;
981
1182
  lastSeen: string;
982
- ip?: string | undefined;
983
- platform?: string | undefined;
984
1183
  clientId?: string | undefined;
1184
+ platform?: string | undefined;
1185
+ ip?: string | undefined;
985
1186
  clientMode?: string | undefined;
986
1187
  role?: string | undefined;
987
1188
  }[];
@@ -1001,21 +1202,28 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1001
1202
  };
1002
1203
  gateway: {
1003
1204
  running: boolean;
1004
- pid: number | null;
1005
1205
  port: number;
1206
+ pid: number | null;
1006
1207
  };
1208
+ files?: {
1209
+ path: string;
1210
+ name: string;
1211
+ content: string;
1212
+ size: number;
1213
+ lastModified: string;
1214
+ }[] | undefined;
1007
1215
  }>;
1008
1216
  }, "strip", z.ZodTypeAny, {
1009
1217
  type: "state:full";
1010
1218
  data: {
1011
1219
  devices: {
1012
- id: string;
1013
- name: string;
1014
1220
  status: "pending" | "approved";
1221
+ name: string;
1222
+ id: string;
1015
1223
  lastSeen: string;
1016
- ip?: string | undefined;
1017
- platform?: string | undefined;
1018
1224
  clientId?: string | undefined;
1225
+ platform?: string | undefined;
1226
+ ip?: string | undefined;
1019
1227
  clientMode?: string | undefined;
1020
1228
  role?: string | undefined;
1021
1229
  }[];
@@ -1035,21 +1243,28 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1035
1243
  };
1036
1244
  gateway: {
1037
1245
  running: boolean;
1038
- pid: number | null;
1039
1246
  port: number;
1247
+ pid: number | null;
1040
1248
  };
1249
+ files?: {
1250
+ path: string;
1251
+ name: string;
1252
+ content: string;
1253
+ size: number;
1254
+ lastModified: string;
1255
+ }[] | undefined;
1041
1256
  };
1042
1257
  }, {
1043
1258
  type: "state:full";
1044
1259
  data: {
1045
1260
  devices: {
1046
- id: string;
1047
- name: string;
1048
1261
  status: "pending" | "approved";
1262
+ name: string;
1263
+ id: string;
1049
1264
  lastSeen: string;
1050
- ip?: string | undefined;
1051
- platform?: string | undefined;
1052
1265
  clientId?: string | undefined;
1266
+ platform?: string | undefined;
1267
+ ip?: string | undefined;
1053
1268
  clientMode?: string | undefined;
1054
1269
  role?: string | undefined;
1055
1270
  }[];
@@ -1069,9 +1284,16 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1069
1284
  };
1070
1285
  gateway: {
1071
1286
  running: boolean;
1072
- pid: number | null;
1073
1287
  port: number;
1288
+ pid: number | null;
1074
1289
  };
1290
+ files?: {
1291
+ path: string;
1292
+ name: string;
1293
+ content: string;
1294
+ size: number;
1295
+ lastModified: string;
1296
+ }[] | undefined;
1075
1297
  };
1076
1298
  }>, z.ZodObject<{
1077
1299
  type: z.ZodLiteral<"state:devices">;
@@ -1086,49 +1308,49 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1086
1308
  clientMode: z.ZodOptional<z.ZodString>;
1087
1309
  role: z.ZodOptional<z.ZodString>;
1088
1310
  }, "strip", z.ZodTypeAny, {
1089
- id: string;
1090
- name: string;
1091
1311
  status: "pending" | "approved";
1312
+ name: string;
1313
+ id: string;
1092
1314
  lastSeen: string;
1093
- ip?: string | undefined;
1094
- platform?: string | undefined;
1095
1315
  clientId?: string | undefined;
1316
+ platform?: string | undefined;
1317
+ ip?: string | undefined;
1096
1318
  clientMode?: string | undefined;
1097
1319
  role?: string | undefined;
1098
1320
  }, {
1099
- id: string;
1100
- name: string;
1101
1321
  status: "pending" | "approved";
1322
+ name: string;
1323
+ id: string;
1102
1324
  lastSeen: string;
1103
- ip?: string | undefined;
1104
- platform?: string | undefined;
1105
1325
  clientId?: string | undefined;
1326
+ platform?: string | undefined;
1327
+ ip?: string | undefined;
1106
1328
  clientMode?: string | undefined;
1107
1329
  role?: string | undefined;
1108
1330
  }>, "many">;
1109
1331
  }, "strip", z.ZodTypeAny, {
1110
1332
  type: "state:devices";
1111
1333
  data: {
1112
- id: string;
1113
- name: string;
1114
1334
  status: "pending" | "approved";
1335
+ name: string;
1336
+ id: string;
1115
1337
  lastSeen: string;
1116
- ip?: string | undefined;
1117
- platform?: string | undefined;
1118
1338
  clientId?: string | undefined;
1339
+ platform?: string | undefined;
1340
+ ip?: string | undefined;
1119
1341
  clientMode?: string | undefined;
1120
1342
  role?: string | undefined;
1121
1343
  }[];
1122
1344
  }, {
1123
1345
  type: "state:devices";
1124
1346
  data: {
1125
- id: string;
1126
- name: string;
1127
1347
  status: "pending" | "approved";
1348
+ name: string;
1349
+ id: string;
1128
1350
  lastSeen: string;
1129
- ip?: string | undefined;
1130
- platform?: string | undefined;
1131
1351
  clientId?: string | undefined;
1352
+ platform?: string | undefined;
1353
+ ip?: string | undefined;
1132
1354
  clientMode?: string | undefined;
1133
1355
  role?: string | undefined;
1134
1356
  }[];
@@ -1234,27 +1456,66 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1234
1456
  port: z.ZodNumber;
1235
1457
  }, "strip", z.ZodTypeAny, {
1236
1458
  running: boolean;
1237
- pid: number | null;
1238
1459
  port: number;
1460
+ pid: number | null;
1239
1461
  }, {
1240
1462
  running: boolean;
1241
- pid: number | null;
1242
1463
  port: number;
1464
+ pid: number | null;
1243
1465
  }>;
1244
1466
  }, "strip", z.ZodTypeAny, {
1245
1467
  type: "state:gateway";
1246
1468
  data: {
1247
1469
  running: boolean;
1248
- pid: number | null;
1249
1470
  port: number;
1471
+ pid: number | null;
1250
1472
  };
1251
1473
  }, {
1252
1474
  type: "state:gateway";
1253
1475
  data: {
1254
1476
  running: boolean;
1255
- pid: number | null;
1256
1477
  port: number;
1478
+ pid: number | null;
1257
1479
  };
1480
+ }>, z.ZodObject<{
1481
+ type: z.ZodLiteral<"state:files">;
1482
+ data: z.ZodArray<z.ZodObject<{
1483
+ name: z.ZodString;
1484
+ path: z.ZodString;
1485
+ content: z.ZodString;
1486
+ size: z.ZodNumber;
1487
+ lastModified: z.ZodString;
1488
+ }, "strip", z.ZodTypeAny, {
1489
+ path: string;
1490
+ name: string;
1491
+ content: string;
1492
+ size: number;
1493
+ lastModified: string;
1494
+ }, {
1495
+ path: string;
1496
+ name: string;
1497
+ content: string;
1498
+ size: number;
1499
+ lastModified: string;
1500
+ }>, "many">;
1501
+ }, "strip", z.ZodTypeAny, {
1502
+ type: "state:files";
1503
+ data: {
1504
+ path: string;
1505
+ name: string;
1506
+ content: string;
1507
+ size: number;
1508
+ lastModified: string;
1509
+ }[];
1510
+ }, {
1511
+ type: "state:files";
1512
+ data: {
1513
+ path: string;
1514
+ name: string;
1515
+ content: string;
1516
+ size: number;
1517
+ lastModified: string;
1518
+ }[];
1258
1519
  }>, z.ZodObject<{
1259
1520
  type: z.ZodLiteral<"ping">;
1260
1521
  ts: z.ZodNumber;
@@ -1284,16 +1545,16 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1284
1545
  data: z.ZodOptional<z.ZodUnknown>;
1285
1546
  }, "strip", z.ZodTypeAny, {
1286
1547
  type: "command:result";
1287
- requestId: string;
1288
1548
  success: boolean;
1289
- data?: unknown;
1549
+ requestId: string;
1290
1550
  error?: string | undefined;
1551
+ data?: unknown;
1291
1552
  }, {
1292
1553
  type: "command:result";
1293
- requestId: string;
1294
1554
  success: boolean;
1295
- data?: unknown;
1555
+ requestId: string;
1296
1556
  error?: string | undefined;
1557
+ data?: unknown;
1297
1558
  }>]>;
1298
1559
  export declare const adminWSPongMessageSchema: z.ZodObject<{
1299
1560
  type: z.ZodLiteral<"pong">;
@@ -1318,14 +1579,14 @@ export declare const adminWSApprovePairingCommandSchema: z.ZodObject<{
1318
1579
  }, "strip", z.ZodTypeAny, {
1319
1580
  code: string;
1320
1581
  type: "command:approve-pairing";
1321
- channel: string;
1322
1582
  requestId: string;
1583
+ channel: string;
1323
1584
  pairingId: string;
1324
1585
  }, {
1325
1586
  code: string;
1326
1587
  type: "command:approve-pairing";
1327
- channel: string;
1328
1588
  requestId: string;
1589
+ channel: string;
1329
1590
  pairingId: string;
1330
1591
  }>;
1331
1592
  export declare const adminWSApproveDeviceCommandSchema: z.ZodObject<{
@@ -1361,6 +1622,52 @@ export declare const adminWSApproveAllDevicesCommandSchema: z.ZodObject<{
1361
1622
  type: "command:approve-devices-all";
1362
1623
  requestId: string;
1363
1624
  }>;
1625
+ export declare const adminWSReadFilesCommandSchema: z.ZodObject<{
1626
+ type: z.ZodLiteral<"command:read-files">;
1627
+ requestId: z.ZodString;
1628
+ }, "strip", z.ZodTypeAny, {
1629
+ type: "command:read-files";
1630
+ requestId: string;
1631
+ }, {
1632
+ type: "command:read-files";
1633
+ requestId: string;
1634
+ }>;
1635
+ export declare const adminWSWriteFileCommandSchema: z.ZodObject<{
1636
+ type: z.ZodLiteral<"command:write-file">;
1637
+ requestId: z.ZodString;
1638
+ path: z.ZodString;
1639
+ content: z.ZodString;
1640
+ }, "strip", z.ZodTypeAny, {
1641
+ path: string;
1642
+ type: "command:write-file";
1643
+ requestId: string;
1644
+ content: string;
1645
+ }, {
1646
+ path: string;
1647
+ type: "command:write-file";
1648
+ requestId: string;
1649
+ content: string;
1650
+ }>;
1651
+ export declare const adminWSResetAgentCommandSchema: z.ZodObject<{
1652
+ type: z.ZodLiteral<"command:reset-agent">;
1653
+ requestId: z.ZodString;
1654
+ }, "strip", z.ZodTypeAny, {
1655
+ type: "command:reset-agent";
1656
+ requestId: string;
1657
+ }, {
1658
+ type: "command:reset-agent";
1659
+ requestId: string;
1660
+ }>;
1661
+ export declare const adminWSRestartGatewayCommandSchema: z.ZodObject<{
1662
+ type: z.ZodLiteral<"command:restart-gateway">;
1663
+ requestId: z.ZodString;
1664
+ }, "strip", z.ZodTypeAny, {
1665
+ type: "command:restart-gateway";
1666
+ requestId: string;
1667
+ }, {
1668
+ type: "command:restart-gateway";
1669
+ requestId: string;
1670
+ }>;
1364
1671
  export declare const adminWSCommandSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1365
1672
  type: z.ZodLiteral<"command:approve-pairing">;
1366
1673
  requestId: z.ZodString;
@@ -1370,14 +1677,14 @@ export declare const adminWSCommandSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
1370
1677
  }, "strip", z.ZodTypeAny, {
1371
1678
  code: string;
1372
1679
  type: "command:approve-pairing";
1373
- channel: string;
1374
1680
  requestId: string;
1681
+ channel: string;
1375
1682
  pairingId: string;
1376
1683
  }, {
1377
1684
  code: string;
1378
1685
  type: "command:approve-pairing";
1379
- channel: string;
1380
1686
  requestId: string;
1687
+ channel: string;
1381
1688
  pairingId: string;
1382
1689
  }>, z.ZodObject<{
1383
1690
  type: z.ZodLiteral<"command:approve-device">;
@@ -1409,6 +1716,48 @@ export declare const adminWSCommandSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
1409
1716
  }, {
1410
1717
  type: "command:approve-devices-all";
1411
1718
  requestId: string;
1719
+ }>, z.ZodObject<{
1720
+ type: z.ZodLiteral<"command:read-files">;
1721
+ requestId: z.ZodString;
1722
+ }, "strip", z.ZodTypeAny, {
1723
+ type: "command:read-files";
1724
+ requestId: string;
1725
+ }, {
1726
+ type: "command:read-files";
1727
+ requestId: string;
1728
+ }>, z.ZodObject<{
1729
+ type: z.ZodLiteral<"command:write-file">;
1730
+ requestId: z.ZodString;
1731
+ path: z.ZodString;
1732
+ content: z.ZodString;
1733
+ }, "strip", z.ZodTypeAny, {
1734
+ path: string;
1735
+ type: "command:write-file";
1736
+ requestId: string;
1737
+ content: string;
1738
+ }, {
1739
+ path: string;
1740
+ type: "command:write-file";
1741
+ requestId: string;
1742
+ content: string;
1743
+ }>, z.ZodObject<{
1744
+ type: z.ZodLiteral<"command:reset-agent">;
1745
+ requestId: z.ZodString;
1746
+ }, "strip", z.ZodTypeAny, {
1747
+ type: "command:reset-agent";
1748
+ requestId: string;
1749
+ }, {
1750
+ type: "command:reset-agent";
1751
+ requestId: string;
1752
+ }>, z.ZodObject<{
1753
+ type: z.ZodLiteral<"command:restart-gateway">;
1754
+ requestId: z.ZodString;
1755
+ }, "strip", z.ZodTypeAny, {
1756
+ type: "command:restart-gateway";
1757
+ requestId: string;
1758
+ }, {
1759
+ type: "command:restart-gateway";
1760
+ requestId: string;
1412
1761
  }>]>;
1413
1762
  export declare const adminWSClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1414
1763
  type: z.ZodLiteral<"pong">;
@@ -1431,14 +1780,14 @@ export declare const adminWSClientMessageSchema: z.ZodDiscriminatedUnion<"type",
1431
1780
  }, "strip", z.ZodTypeAny, {
1432
1781
  code: string;
1433
1782
  type: "command:approve-pairing";
1434
- channel: string;
1435
1783
  requestId: string;
1784
+ channel: string;
1436
1785
  pairingId: string;
1437
1786
  }, {
1438
1787
  code: string;
1439
1788
  type: "command:approve-pairing";
1440
- channel: string;
1441
1789
  requestId: string;
1790
+ channel: string;
1442
1791
  pairingId: string;
1443
1792
  }>, z.ZodObject<{
1444
1793
  type: z.ZodLiteral<"command:approve-device">;
@@ -1470,6 +1819,48 @@ export declare const adminWSClientMessageSchema: z.ZodDiscriminatedUnion<"type",
1470
1819
  }, {
1471
1820
  type: "command:approve-devices-all";
1472
1821
  requestId: string;
1822
+ }>, z.ZodObject<{
1823
+ type: z.ZodLiteral<"command:read-files">;
1824
+ requestId: z.ZodString;
1825
+ }, "strip", z.ZodTypeAny, {
1826
+ type: "command:read-files";
1827
+ requestId: string;
1828
+ }, {
1829
+ type: "command:read-files";
1830
+ requestId: string;
1831
+ }>, z.ZodObject<{
1832
+ type: z.ZodLiteral<"command:write-file">;
1833
+ requestId: z.ZodString;
1834
+ path: z.ZodString;
1835
+ content: z.ZodString;
1836
+ }, "strip", z.ZodTypeAny, {
1837
+ path: string;
1838
+ type: "command:write-file";
1839
+ requestId: string;
1840
+ content: string;
1841
+ }, {
1842
+ path: string;
1843
+ type: "command:write-file";
1844
+ requestId: string;
1845
+ content: string;
1846
+ }>, z.ZodObject<{
1847
+ type: z.ZodLiteral<"command:reset-agent">;
1848
+ requestId: z.ZodString;
1849
+ }, "strip", z.ZodTypeAny, {
1850
+ type: "command:reset-agent";
1851
+ requestId: string;
1852
+ }, {
1853
+ type: "command:reset-agent";
1854
+ requestId: string;
1855
+ }>, z.ZodObject<{
1856
+ type: z.ZodLiteral<"command:restart-gateway">;
1857
+ requestId: z.ZodString;
1858
+ }, "strip", z.ZodTypeAny, {
1859
+ type: "command:restart-gateway";
1860
+ requestId: string;
1861
+ }, {
1862
+ type: "command:restart-gateway";
1863
+ requestId: string;
1473
1864
  }>]>;
1474
1865
  export declare const adminWSTicketResponseSchema: z.ZodObject<{
1475
1866
  ticket: z.ZodString;