@kya-os/contracts 1.7.23 → 1.7.25

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 */
@@ -182,6 +218,25 @@ export declare const adminWSGatewayStatusSchema: z.ZodObject<{
182
218
  pid: number | null;
183
219
  port: number;
184
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
+ name: string;
229
+ path: string;
230
+ content: string;
231
+ size: number;
232
+ lastModified: string;
233
+ }, {
234
+ name: string;
235
+ path: string;
236
+ content: string;
237
+ size: number;
238
+ lastModified: string;
239
+ }>;
185
240
  export declare const adminWSFullStateSchema: z.ZodObject<{
186
241
  devices: z.ZodArray<z.ZodObject<{
187
242
  id: z.ZodString;
@@ -287,6 +342,25 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
287
342
  pid: number | null;
288
343
  port: number;
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
+ name: string;
353
+ path: string;
354
+ content: string;
355
+ size: number;
356
+ lastModified: string;
357
+ }, {
358
+ name: string;
359
+ path: string;
360
+ content: string;
361
+ size: number;
362
+ lastModified: string;
363
+ }>, "many">>;
290
364
  }, "strip", z.ZodTypeAny, {
291
365
  devices: {
292
366
  id: string;
@@ -318,6 +392,13 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
318
392
  pid: number | null;
319
393
  port: number;
320
394
  };
395
+ files?: {
396
+ name: string;
397
+ path: string;
398
+ content: string;
399
+ size: number;
400
+ lastModified: string;
401
+ }[] | undefined;
321
402
  }, {
322
403
  devices: {
323
404
  id: string;
@@ -349,6 +430,13 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
349
430
  pid: number | null;
350
431
  port: number;
351
432
  };
433
+ files?: {
434
+ name: string;
435
+ path: 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">;
@@ -467,6 +555,25 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
467
555
  pid: number | null;
468
556
  port: number;
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
+ name: string;
566
+ path: string;
567
+ content: string;
568
+ size: number;
569
+ lastModified: string;
570
+ }, {
571
+ name: string;
572
+ path: string;
573
+ content: string;
574
+ size: number;
575
+ lastModified: string;
576
+ }>, "many">>;
470
577
  }, "strip", z.ZodTypeAny, {
471
578
  devices: {
472
579
  id: string;
@@ -498,6 +605,13 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
498
605
  pid: number | null;
499
606
  port: number;
500
607
  };
608
+ files?: {
609
+ name: string;
610
+ path: string;
611
+ content: string;
612
+ size: number;
613
+ lastModified: string;
614
+ }[] | undefined;
501
615
  }, {
502
616
  devices: {
503
617
  id: string;
@@ -529,6 +643,13 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
529
643
  pid: number | null;
530
644
  port: number;
531
645
  };
646
+ files?: {
647
+ name: string;
648
+ path: string;
649
+ content: string;
650
+ size: number;
651
+ lastModified: string;
652
+ }[] | undefined;
532
653
  }>;
533
654
  }, "strip", z.ZodTypeAny, {
534
655
  type: "state:full";
@@ -563,6 +684,13 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
563
684
  pid: number | null;
564
685
  port: number;
565
686
  };
687
+ files?: {
688
+ name: string;
689
+ path: string;
690
+ content: string;
691
+ size: number;
692
+ lastModified: string;
693
+ }[] | undefined;
566
694
  };
567
695
  }, {
568
696
  type: "state:full";
@@ -597,6 +725,13 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
597
725
  pid: number | null;
598
726
  port: number;
599
727
  };
728
+ files?: {
729
+ name: string;
730
+ path: string;
731
+ content: string;
732
+ size: number;
733
+ lastModified: string;
734
+ }[] | undefined;
600
735
  };
601
736
  }>;
602
737
  export declare const adminWSDevicesMessageSchema: z.ZodObject<{
@@ -826,6 +961,46 @@ export declare const adminWSCommandResultMessageSchema: z.ZodObject<{
826
961
  data?: unknown;
827
962
  error?: string | undefined;
828
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
+ name: string;
974
+ path: string;
975
+ content: string;
976
+ size: number;
977
+ lastModified: string;
978
+ }, {
979
+ name: string;
980
+ path: string;
981
+ content: string;
982
+ size: number;
983
+ lastModified: string;
984
+ }>, "many">;
985
+ }, "strip", z.ZodTypeAny, {
986
+ type: "state:files";
987
+ data: {
988
+ name: string;
989
+ path: string;
990
+ content: string;
991
+ size: number;
992
+ lastModified: string;
993
+ }[];
994
+ }, {
995
+ type: "state:files";
996
+ data: {
997
+ name: string;
998
+ path: string;
999
+ content: string;
1000
+ size: number;
1001
+ lastModified: string;
1002
+ }[];
1003
+ }>;
829
1004
  export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
830
1005
  type: z.ZodLiteral<"connected">;
831
1006
  clientId: z.ZodString;
@@ -942,6 +1117,25 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
942
1117
  pid: number | null;
943
1118
  port: number;
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
+ name: string;
1128
+ path: string;
1129
+ content: string;
1130
+ size: number;
1131
+ lastModified: string;
1132
+ }, {
1133
+ name: string;
1134
+ path: string;
1135
+ content: string;
1136
+ size: number;
1137
+ lastModified: string;
1138
+ }>, "many">>;
945
1139
  }, "strip", z.ZodTypeAny, {
946
1140
  devices: {
947
1141
  id: string;
@@ -973,6 +1167,13 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
973
1167
  pid: number | null;
974
1168
  port: number;
975
1169
  };
1170
+ files?: {
1171
+ name: string;
1172
+ path: string;
1173
+ content: string;
1174
+ size: number;
1175
+ lastModified: string;
1176
+ }[] | undefined;
976
1177
  }, {
977
1178
  devices: {
978
1179
  id: string;
@@ -1004,6 +1205,13 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1004
1205
  pid: number | null;
1005
1206
  port: number;
1006
1207
  };
1208
+ files?: {
1209
+ name: string;
1210
+ path: string;
1211
+ content: string;
1212
+ size: number;
1213
+ lastModified: string;
1214
+ }[] | undefined;
1007
1215
  }>;
1008
1216
  }, "strip", z.ZodTypeAny, {
1009
1217
  type: "state:full";
@@ -1038,6 +1246,13 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1038
1246
  pid: number | null;
1039
1247
  port: number;
1040
1248
  };
1249
+ files?: {
1250
+ name: string;
1251
+ path: string;
1252
+ content: string;
1253
+ size: number;
1254
+ lastModified: string;
1255
+ }[] | undefined;
1041
1256
  };
1042
1257
  }, {
1043
1258
  type: "state:full";
@@ -1072,6 +1287,13 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1072
1287
  pid: number | null;
1073
1288
  port: number;
1074
1289
  };
1290
+ files?: {
1291
+ name: string;
1292
+ path: 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">;
@@ -1255,6 +1477,45 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1255
1477
  pid: number | null;
1256
1478
  port: number;
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
+ name: string;
1490
+ path: string;
1491
+ content: string;
1492
+ size: number;
1493
+ lastModified: string;
1494
+ }, {
1495
+ name: string;
1496
+ path: string;
1497
+ content: string;
1498
+ size: number;
1499
+ lastModified: string;
1500
+ }>, "many">;
1501
+ }, "strip", z.ZodTypeAny, {
1502
+ type: "state:files";
1503
+ data: {
1504
+ name: string;
1505
+ path: string;
1506
+ content: string;
1507
+ size: number;
1508
+ lastModified: string;
1509
+ }[];
1510
+ }, {
1511
+ type: "state:files";
1512
+ data: {
1513
+ name: string;
1514
+ path: 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;
@@ -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
+ content: string;
1644
+ requestId: string;
1645
+ }, {
1646
+ path: string;
1647
+ type: "command:write-file";
1648
+ content: string;
1649
+ requestId: 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;
@@ -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
+ content: string;
1737
+ requestId: string;
1738
+ }, {
1739
+ path: string;
1740
+ type: "command:write-file";
1741
+ content: string;
1742
+ requestId: 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">;
@@ -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
+ content: string;
1840
+ requestId: string;
1841
+ }, {
1842
+ path: string;
1843
+ type: "command:write-file";
1844
+ content: string;
1845
+ requestId: 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;
@@ -9,7 +9,7 @@
9
9
  * @package @kya-os/contracts/molti
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.adminWSTicketResponseSchema = exports.adminWSClientMessageSchema = exports.adminWSCommandSchema = exports.adminWSApproveAllDevicesCommandSchema = exports.adminWSApproveAllPairingsCommandSchema = exports.adminWSApproveDeviceCommandSchema = exports.adminWSApprovePairingCommandSchema = exports.adminWSRefreshMessageSchema = exports.adminWSPongMessageSchema = exports.adminWSServerMessageSchema = exports.adminWSCommandResultMessageSchema = exports.adminWSErrorMessageSchema = exports.adminWSPingMessageSchema = exports.adminWSGatewayMessageSchema = exports.adminWSPairingsMessageSchema = exports.adminWSDevicesMessageSchema = exports.adminWSFullStateMessageSchema = exports.adminWSConnectedMessageSchema = exports.adminWSFullStateSchema = exports.adminWSGatewayStatusSchema = exports.adminWSPairingSchema = exports.adminWSDeviceSchema = void 0;
12
+ exports.adminWSTicketResponseSchema = exports.adminWSClientMessageSchema = exports.adminWSCommandSchema = exports.adminWSRestartGatewayCommandSchema = exports.adminWSResetAgentCommandSchema = exports.adminWSWriteFileCommandSchema = exports.adminWSReadFilesCommandSchema = exports.adminWSApproveAllDevicesCommandSchema = exports.adminWSApproveAllPairingsCommandSchema = exports.adminWSApproveDeviceCommandSchema = exports.adminWSApprovePairingCommandSchema = exports.adminWSRefreshMessageSchema = exports.adminWSPongMessageSchema = exports.adminWSServerMessageSchema = exports.adminWSFilesMessageSchema = exports.adminWSCommandResultMessageSchema = exports.adminWSErrorMessageSchema = exports.adminWSPingMessageSchema = exports.adminWSGatewayMessageSchema = exports.adminWSPairingsMessageSchema = exports.adminWSDevicesMessageSchema = exports.adminWSFullStateMessageSchema = exports.adminWSConnectedMessageSchema = exports.adminWSFullStateSchema = exports.adminWSCoreFileSchema = exports.adminWSGatewayStatusSchema = exports.adminWSPairingSchema = exports.adminWSDeviceSchema = void 0;
13
13
  const zod_1 = require("zod");
14
14
  // ============================================================================
15
15
  // Zod Schemas
@@ -36,6 +36,13 @@ exports.adminWSGatewayStatusSchema = zod_1.z.object({
36
36
  pid: zod_1.z.number().nullable(),
37
37
  port: zod_1.z.number(),
38
38
  });
39
+ exports.adminWSCoreFileSchema = zod_1.z.object({
40
+ name: zod_1.z.string(),
41
+ path: zod_1.z.string(),
42
+ content: zod_1.z.string(),
43
+ size: zod_1.z.number(),
44
+ lastModified: zod_1.z.string(),
45
+ });
39
46
  exports.adminWSFullStateSchema = zod_1.z.object({
40
47
  devices: zod_1.z.array(exports.adminWSDeviceSchema),
41
48
  pairings: zod_1.z.object({
@@ -43,6 +50,7 @@ exports.adminWSFullStateSchema = zod_1.z.object({
43
50
  approved: zod_1.z.array(exports.adminWSPairingSchema),
44
51
  }),
45
52
  gateway: exports.adminWSGatewayStatusSchema,
53
+ files: zod_1.z.array(exports.adminWSCoreFileSchema).optional(),
46
54
  });
47
55
  exports.adminWSConnectedMessageSchema = zod_1.z.object({
48
56
  type: zod_1.z.literal("connected"),
@@ -83,12 +91,17 @@ exports.adminWSCommandResultMessageSchema = zod_1.z.object({
83
91
  error: zod_1.z.string().optional(),
84
92
  data: zod_1.z.unknown().optional(),
85
93
  });
94
+ exports.adminWSFilesMessageSchema = zod_1.z.object({
95
+ type: zod_1.z.literal("state:files"),
96
+ data: zod_1.z.array(exports.adminWSCoreFileSchema),
97
+ });
86
98
  exports.adminWSServerMessageSchema = zod_1.z.discriminatedUnion("type", [
87
99
  exports.adminWSConnectedMessageSchema,
88
100
  exports.adminWSFullStateMessageSchema,
89
101
  exports.adminWSDevicesMessageSchema,
90
102
  exports.adminWSPairingsMessageSchema,
91
103
  exports.adminWSGatewayMessageSchema,
104
+ exports.adminWSFilesMessageSchema,
92
105
  exports.adminWSPingMessageSchema,
93
106
  exports.adminWSErrorMessageSchema,
94
107
  exports.adminWSCommandResultMessageSchema,
@@ -119,11 +132,33 @@ exports.adminWSApproveAllDevicesCommandSchema = zod_1.z.object({
119
132
  type: zod_1.z.literal("command:approve-devices-all"),
120
133
  requestId: zod_1.z.string(),
121
134
  });
135
+ exports.adminWSReadFilesCommandSchema = zod_1.z.object({
136
+ type: zod_1.z.literal("command:read-files"),
137
+ requestId: zod_1.z.string(),
138
+ });
139
+ exports.adminWSWriteFileCommandSchema = zod_1.z.object({
140
+ type: zod_1.z.literal("command:write-file"),
141
+ requestId: zod_1.z.string(),
142
+ path: zod_1.z.string(),
143
+ content: zod_1.z.string(),
144
+ });
145
+ exports.adminWSResetAgentCommandSchema = zod_1.z.object({
146
+ type: zod_1.z.literal("command:reset-agent"),
147
+ requestId: zod_1.z.string(),
148
+ });
149
+ exports.adminWSRestartGatewayCommandSchema = zod_1.z.object({
150
+ type: zod_1.z.literal("command:restart-gateway"),
151
+ requestId: zod_1.z.string(),
152
+ });
122
153
  exports.adminWSCommandSchema = zod_1.z.discriminatedUnion("type", [
123
154
  exports.adminWSApprovePairingCommandSchema,
124
155
  exports.adminWSApproveDeviceCommandSchema,
125
156
  exports.adminWSApproveAllPairingsCommandSchema,
126
157
  exports.adminWSApproveAllDevicesCommandSchema,
158
+ exports.adminWSReadFilesCommandSchema,
159
+ exports.adminWSWriteFileCommandSchema,
160
+ exports.adminWSResetAgentCommandSchema,
161
+ exports.adminWSRestartGatewayCommandSchema,
127
162
  ]);
128
163
  exports.adminWSClientMessageSchema = zod_1.z.discriminatedUnion("type", [
129
164
  exports.adminWSPongMessageSchema,
@@ -132,6 +167,10 @@ exports.adminWSClientMessageSchema = zod_1.z.discriminatedUnion("type", [
132
167
  exports.adminWSApproveDeviceCommandSchema,
133
168
  exports.adminWSApproveAllPairingsCommandSchema,
134
169
  exports.adminWSApproveAllDevicesCommandSchema,
170
+ exports.adminWSReadFilesCommandSchema,
171
+ exports.adminWSWriteFileCommandSchema,
172
+ exports.adminWSResetAgentCommandSchema,
173
+ exports.adminWSRestartGatewayCommandSchema,
135
174
  ]);
136
175
  exports.adminWSTicketResponseSchema = zod_1.z.object({
137
176
  ticket: zod_1.z.string(),
@@ -24,7 +24,7 @@
24
24
  * ```
25
25
  */
26
26
  export type { MoltiIdentityConfig, MoltiInstanceType, MoltiContainerStatus, MoltiDeployConfig, MoltiDeployRequest, MoltiDeployStartResponse, MoltiDeployStepId, MoltiDeployStepStatus, MoltiDeployStep, MoltiDeployProgress, MoltiDeployResult, MoltiDeployErrorCode, MoltiDeployErrorResponse, MoltiDeploySuccessResponse, MoltiDeployResponse, MoltiHealthStatus, MoltiSSEEventType, MoltiSSEProgressEvent, MoltiSSECompleteEvent, MoltiSSEErrorEvent, MoltiSSEKeepaliveEvent, MoltiSSEEvent, } from "./types.js";
27
- export type { AdminWSDevice, AdminWSPairing, AdminWSGatewayStatus, AdminWSFullState, AdminWSConnectedMessage, AdminWSFullStateMessage, AdminWSDevicesMessage, AdminWSPairingsMessage, AdminWSGatewayMessage, AdminWSPingMessage, AdminWSErrorMessage, AdminWSServerMessage, AdminWSPongMessage, AdminWSRefreshMessage, AdminWSClientMessage, AdminWSTicketResponse, } from "./admin-ws.js";
27
+ export type { AdminWSDevice, AdminWSPairing, AdminWSGatewayStatus, AdminWSFullState, AdminWSConnectedMessage, AdminWSFullStateMessage, AdminWSDevicesMessage, AdminWSPairingsMessage, AdminWSGatewayMessage, AdminWSPingMessage, AdminWSErrorMessage, AdminWSCommandResultMessage, AdminWSServerMessage, AdminWSPongMessage, AdminWSRefreshMessage, AdminWSApprovePairingCommand, AdminWSApproveDeviceCommand, AdminWSApproveAllPairingsCommand, AdminWSApproveAllDevicesCommand, AdminWSCommand, AdminWSClientMessage, AdminWSTicketResponse, } from "./admin-ws.js";
28
28
  export { MOLTI_DEPLOY_STEP_NAMES } from "./types.js";
29
29
  export { moltiIdentityConfigSchema, moltiInstanceTypeSchema, moltiContainerStatusSchema, moltiDeployConfigSchema, moltiDeployRequestSchema, moltiDeployStartResponseSchema, moltiDeployStepIdSchema, moltiDeployStepStatusSchema, moltiDeployStepSchema, moltiDeployProgressSchema, moltiDeployResultSchema, moltiDeployErrorCodeSchema, moltiDeployErrorResponseSchema, moltiDeploySuccessResponseSchema, moltiDeployResponseSchema, moltiHealthStatusSchema, moltiSSEProgressEventSchema, moltiSSECompleteEventSchema, moltiSSEErrorEventSchema, moltiSSEKeepaliveEventSchema, moltiSSEEventSchema, } from "./schemas.js";
30
- export { adminWSDeviceSchema, adminWSPairingSchema, adminWSGatewayStatusSchema, adminWSFullStateSchema, adminWSConnectedMessageSchema, adminWSFullStateMessageSchema, adminWSDevicesMessageSchema, adminWSPairingsMessageSchema, adminWSGatewayMessageSchema, adminWSPingMessageSchema, adminWSErrorMessageSchema, adminWSServerMessageSchema, adminWSPongMessageSchema, adminWSRefreshMessageSchema, adminWSClientMessageSchema, adminWSTicketResponseSchema, } from "./admin-ws.js";
30
+ export { adminWSDeviceSchema, adminWSPairingSchema, adminWSGatewayStatusSchema, adminWSFullStateSchema, adminWSConnectedMessageSchema, adminWSFullStateMessageSchema, adminWSDevicesMessageSchema, adminWSPairingsMessageSchema, adminWSGatewayMessageSchema, adminWSPingMessageSchema, adminWSErrorMessageSchema, adminWSCommandResultMessageSchema, adminWSServerMessageSchema, adminWSPongMessageSchema, adminWSRefreshMessageSchema, adminWSApprovePairingCommandSchema, adminWSApproveDeviceCommandSchema, adminWSApproveAllPairingsCommandSchema, adminWSApproveAllDevicesCommandSchema, adminWSCommandSchema, adminWSClientMessageSchema, adminWSTicketResponseSchema, } from "./admin-ws.js";
@@ -25,7 +25,7 @@
25
25
  * ```
26
26
  */
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.adminWSTicketResponseSchema = exports.adminWSClientMessageSchema = exports.adminWSRefreshMessageSchema = exports.adminWSPongMessageSchema = exports.adminWSServerMessageSchema = exports.adminWSErrorMessageSchema = exports.adminWSPingMessageSchema = exports.adminWSGatewayMessageSchema = exports.adminWSPairingsMessageSchema = exports.adminWSDevicesMessageSchema = exports.adminWSFullStateMessageSchema = exports.adminWSConnectedMessageSchema = exports.adminWSFullStateSchema = exports.adminWSGatewayStatusSchema = exports.adminWSPairingSchema = exports.adminWSDeviceSchema = exports.moltiSSEEventSchema = exports.moltiSSEKeepaliveEventSchema = exports.moltiSSEErrorEventSchema = exports.moltiSSECompleteEventSchema = exports.moltiSSEProgressEventSchema = exports.moltiHealthStatusSchema = exports.moltiDeployResponseSchema = exports.moltiDeploySuccessResponseSchema = exports.moltiDeployErrorResponseSchema = exports.moltiDeployErrorCodeSchema = exports.moltiDeployResultSchema = exports.moltiDeployProgressSchema = exports.moltiDeployStepSchema = exports.moltiDeployStepStatusSchema = exports.moltiDeployStepIdSchema = exports.moltiDeployStartResponseSchema = exports.moltiDeployRequestSchema = exports.moltiDeployConfigSchema = exports.moltiContainerStatusSchema = exports.moltiInstanceTypeSchema = exports.moltiIdentityConfigSchema = exports.MOLTI_DEPLOY_STEP_NAMES = void 0;
28
+ exports.adminWSTicketResponseSchema = exports.adminWSClientMessageSchema = exports.adminWSCommandSchema = exports.adminWSApproveAllDevicesCommandSchema = exports.adminWSApproveAllPairingsCommandSchema = exports.adminWSApproveDeviceCommandSchema = exports.adminWSApprovePairingCommandSchema = exports.adminWSRefreshMessageSchema = exports.adminWSPongMessageSchema = exports.adminWSServerMessageSchema = exports.adminWSCommandResultMessageSchema = exports.adminWSErrorMessageSchema = exports.adminWSPingMessageSchema = exports.adminWSGatewayMessageSchema = exports.adminWSPairingsMessageSchema = exports.adminWSDevicesMessageSchema = exports.adminWSFullStateMessageSchema = exports.adminWSConnectedMessageSchema = exports.adminWSFullStateSchema = exports.adminWSGatewayStatusSchema = exports.adminWSPairingSchema = exports.adminWSDeviceSchema = exports.moltiSSEEventSchema = exports.moltiSSEKeepaliveEventSchema = exports.moltiSSEErrorEventSchema = exports.moltiSSECompleteEventSchema = exports.moltiSSEProgressEventSchema = exports.moltiHealthStatusSchema = exports.moltiDeployResponseSchema = exports.moltiDeploySuccessResponseSchema = exports.moltiDeployErrorResponseSchema = exports.moltiDeployErrorCodeSchema = exports.moltiDeployResultSchema = exports.moltiDeployProgressSchema = exports.moltiDeployStepSchema = exports.moltiDeployStepStatusSchema = exports.moltiDeployStepIdSchema = exports.moltiDeployStartResponseSchema = exports.moltiDeployRequestSchema = exports.moltiDeployConfigSchema = exports.moltiContainerStatusSchema = exports.moltiInstanceTypeSchema = exports.moltiIdentityConfigSchema = exports.MOLTI_DEPLOY_STEP_NAMES = void 0;
29
29
  // Constants
30
30
  var types_js_1 = require("./types.js");
31
31
  Object.defineProperty(exports, "MOLTI_DEPLOY_STEP_NAMES", { enumerable: true, get: function () { return types_js_1.MOLTI_DEPLOY_STEP_NAMES; } });
@@ -73,8 +73,14 @@ Object.defineProperty(exports, "adminWSPairingsMessageSchema", { enumerable: tru
73
73
  Object.defineProperty(exports, "adminWSGatewayMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSGatewayMessageSchema; } });
74
74
  Object.defineProperty(exports, "adminWSPingMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSPingMessageSchema; } });
75
75
  Object.defineProperty(exports, "adminWSErrorMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSErrorMessageSchema; } });
76
+ Object.defineProperty(exports, "adminWSCommandResultMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSCommandResultMessageSchema; } });
76
77
  Object.defineProperty(exports, "adminWSServerMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSServerMessageSchema; } });
77
78
  Object.defineProperty(exports, "adminWSPongMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSPongMessageSchema; } });
78
79
  Object.defineProperty(exports, "adminWSRefreshMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSRefreshMessageSchema; } });
80
+ Object.defineProperty(exports, "adminWSApprovePairingCommandSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSApprovePairingCommandSchema; } });
81
+ Object.defineProperty(exports, "adminWSApproveDeviceCommandSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSApproveDeviceCommandSchema; } });
82
+ Object.defineProperty(exports, "adminWSApproveAllPairingsCommandSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSApproveAllPairingsCommandSchema; } });
83
+ Object.defineProperty(exports, "adminWSApproveAllDevicesCommandSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSApproveAllDevicesCommandSchema; } });
84
+ Object.defineProperty(exports, "adminWSCommandSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSCommandSchema; } });
79
85
  Object.defineProperty(exports, "adminWSClientMessageSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSClientMessageSchema; } });
80
86
  Object.defineProperty(exports, "adminWSTicketResponseSchema", { enumerable: true, get: function () { return admin_ws_js_1.adminWSTicketResponseSchema; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/contracts",
3
- "version": "1.7.23",
3
+ "version": "1.7.25",
4
4
  "description": "Shared contracts, types, and schemas for MCP-I framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",