@kya-os/contracts 1.7.22 → 1.7.23

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.
@@ -74,16 +74,50 @@ export interface AdminWSErrorMessage {
74
74
  code: string;
75
75
  message: string;
76
76
  }
77
+ /** Server → Client: Result of a command execution */
78
+ export interface AdminWSCommandResultMessage {
79
+ type: "command:result";
80
+ requestId: string;
81
+ success: boolean;
82
+ error?: string;
83
+ data?: unknown;
84
+ }
77
85
  /** Union of all server → client messages */
78
- export type AdminWSServerMessage = AdminWSConnectedMessage | AdminWSFullStateMessage | AdminWSDevicesMessage | AdminWSPairingsMessage | AdminWSGatewayMessage | AdminWSPingMessage | AdminWSErrorMessage;
86
+ export type AdminWSServerMessage = AdminWSConnectedMessage | AdminWSFullStateMessage | AdminWSDevicesMessage | AdminWSPairingsMessage | AdminWSGatewayMessage | AdminWSPingMessage | AdminWSErrorMessage | AdminWSCommandResultMessage;
79
87
  export interface AdminWSPongMessage {
80
88
  type: "pong";
81
89
  }
82
90
  export interface AdminWSRefreshMessage {
83
91
  type: "refresh";
84
92
  }
93
+ /** Client → Server: Approve a single pairing */
94
+ export interface AdminWSApprovePairingCommand {
95
+ type: "command:approve-pairing";
96
+ requestId: string;
97
+ pairingId: string;
98
+ channel: string;
99
+ code: string;
100
+ }
101
+ /** Client → Server: Approve a single device */
102
+ export interface AdminWSApproveDeviceCommand {
103
+ type: "command:approve-device";
104
+ requestId: string;
105
+ deviceId: string;
106
+ }
107
+ /** Client → Server: Approve all pending pairings */
108
+ export interface AdminWSApproveAllPairingsCommand {
109
+ type: "command:approve-pairings-all";
110
+ requestId: string;
111
+ }
112
+ /** Client → Server: Approve all pending devices */
113
+ export interface AdminWSApproveAllDevicesCommand {
114
+ type: "command:approve-devices-all";
115
+ requestId: string;
116
+ }
117
+ /** Client → Server command union */
118
+ export type AdminWSCommand = AdminWSApprovePairingCommand | AdminWSApproveDeviceCommand | AdminWSApproveAllPairingsCommand | AdminWSApproveAllDevicesCommand;
85
119
  /** Union of all client → server messages */
86
- export type AdminWSClientMessage = AdminWSPongMessage | AdminWSRefreshMessage;
120
+ export type AdminWSClientMessage = AdminWSPongMessage | AdminWSRefreshMessage | AdminWSCommand;
87
121
  /** Response from POST /api/admin/ws/ticket */
88
122
  export interface AdminWSTicketResponse {
89
123
  ticket: string;
@@ -99,9 +133,9 @@ export declare const adminWSDeviceSchema: z.ZodObject<{
99
133
  clientMode: z.ZodOptional<z.ZodString>;
100
134
  role: z.ZodOptional<z.ZodString>;
101
135
  }, "strip", z.ZodTypeAny, {
102
- status: "pending" | "approved";
103
136
  id: string;
104
137
  name: string;
138
+ status: "pending" | "approved";
105
139
  lastSeen: string;
106
140
  ip?: string | undefined;
107
141
  platform?: string | undefined;
@@ -109,9 +143,9 @@ export declare const adminWSDeviceSchema: z.ZodObject<{
109
143
  clientMode?: string | undefined;
110
144
  role?: string | undefined;
111
145
  }, {
112
- status: "pending" | "approved";
113
146
  id: string;
114
147
  name: string;
148
+ status: "pending" | "approved";
115
149
  lastSeen: string;
116
150
  ip?: string | undefined;
117
151
  platform?: string | undefined;
@@ -160,9 +194,9 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
160
194
  clientMode: z.ZodOptional<z.ZodString>;
161
195
  role: z.ZodOptional<z.ZodString>;
162
196
  }, "strip", z.ZodTypeAny, {
163
- status: "pending" | "approved";
164
197
  id: string;
165
198
  name: string;
199
+ status: "pending" | "approved";
166
200
  lastSeen: string;
167
201
  ip?: string | undefined;
168
202
  platform?: string | undefined;
@@ -170,9 +204,9 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
170
204
  clientMode?: string | undefined;
171
205
  role?: string | undefined;
172
206
  }, {
173
- status: "pending" | "approved";
174
207
  id: string;
175
208
  name: string;
209
+ status: "pending" | "approved";
176
210
  lastSeen: string;
177
211
  ip?: string | undefined;
178
212
  platform?: string | undefined;
@@ -255,9 +289,9 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
255
289
  }>;
256
290
  }, "strip", z.ZodTypeAny, {
257
291
  devices: {
258
- status: "pending" | "approved";
259
292
  id: string;
260
293
  name: string;
294
+ status: "pending" | "approved";
261
295
  lastSeen: string;
262
296
  ip?: string | undefined;
263
297
  platform?: string | undefined;
@@ -286,9 +320,9 @@ export declare const adminWSFullStateSchema: z.ZodObject<{
286
320
  };
287
321
  }, {
288
322
  devices: {
289
- status: "pending" | "approved";
290
323
  id: string;
291
324
  name: string;
325
+ status: "pending" | "approved";
292
326
  lastSeen: string;
293
327
  ip?: string | undefined;
294
328
  platform?: string | undefined;
@@ -340,9 +374,9 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
340
374
  clientMode: z.ZodOptional<z.ZodString>;
341
375
  role: z.ZodOptional<z.ZodString>;
342
376
  }, "strip", z.ZodTypeAny, {
343
- status: "pending" | "approved";
344
377
  id: string;
345
378
  name: string;
379
+ status: "pending" | "approved";
346
380
  lastSeen: string;
347
381
  ip?: string | undefined;
348
382
  platform?: string | undefined;
@@ -350,9 +384,9 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
350
384
  clientMode?: string | undefined;
351
385
  role?: string | undefined;
352
386
  }, {
353
- status: "pending" | "approved";
354
387
  id: string;
355
388
  name: string;
389
+ status: "pending" | "approved";
356
390
  lastSeen: string;
357
391
  ip?: string | undefined;
358
392
  platform?: string | undefined;
@@ -435,9 +469,9 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
435
469
  }>;
436
470
  }, "strip", z.ZodTypeAny, {
437
471
  devices: {
438
- status: "pending" | "approved";
439
472
  id: string;
440
473
  name: string;
474
+ status: "pending" | "approved";
441
475
  lastSeen: string;
442
476
  ip?: string | undefined;
443
477
  platform?: string | undefined;
@@ -466,9 +500,9 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
466
500
  };
467
501
  }, {
468
502
  devices: {
469
- status: "pending" | "approved";
470
503
  id: string;
471
504
  name: string;
505
+ status: "pending" | "approved";
472
506
  lastSeen: string;
473
507
  ip?: string | undefined;
474
508
  platform?: string | undefined;
@@ -500,9 +534,9 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
500
534
  type: "state:full";
501
535
  data: {
502
536
  devices: {
503
- status: "pending" | "approved";
504
537
  id: string;
505
538
  name: string;
539
+ status: "pending" | "approved";
506
540
  lastSeen: string;
507
541
  ip?: string | undefined;
508
542
  platform?: string | undefined;
@@ -534,9 +568,9 @@ export declare const adminWSFullStateMessageSchema: z.ZodObject<{
534
568
  type: "state:full";
535
569
  data: {
536
570
  devices: {
537
- status: "pending" | "approved";
538
571
  id: string;
539
572
  name: string;
573
+ status: "pending" | "approved";
540
574
  lastSeen: string;
541
575
  ip?: string | undefined;
542
576
  platform?: string | undefined;
@@ -578,9 +612,9 @@ export declare const adminWSDevicesMessageSchema: z.ZodObject<{
578
612
  clientMode: z.ZodOptional<z.ZodString>;
579
613
  role: z.ZodOptional<z.ZodString>;
580
614
  }, "strip", z.ZodTypeAny, {
581
- status: "pending" | "approved";
582
615
  id: string;
583
616
  name: string;
617
+ status: "pending" | "approved";
584
618
  lastSeen: string;
585
619
  ip?: string | undefined;
586
620
  platform?: string | undefined;
@@ -588,9 +622,9 @@ export declare const adminWSDevicesMessageSchema: z.ZodObject<{
588
622
  clientMode?: string | undefined;
589
623
  role?: string | undefined;
590
624
  }, {
591
- status: "pending" | "approved";
592
625
  id: string;
593
626
  name: string;
627
+ status: "pending" | "approved";
594
628
  lastSeen: string;
595
629
  ip?: string | undefined;
596
630
  platform?: string | undefined;
@@ -601,9 +635,9 @@ export declare const adminWSDevicesMessageSchema: z.ZodObject<{
601
635
  }, "strip", z.ZodTypeAny, {
602
636
  type: "state:devices";
603
637
  data: {
604
- status: "pending" | "approved";
605
638
  id: string;
606
639
  name: string;
640
+ status: "pending" | "approved";
607
641
  lastSeen: string;
608
642
  ip?: string | undefined;
609
643
  platform?: string | undefined;
@@ -614,9 +648,9 @@ export declare const adminWSDevicesMessageSchema: z.ZodObject<{
614
648
  }, {
615
649
  type: "state:devices";
616
650
  data: {
617
- status: "pending" | "approved";
618
651
  id: string;
619
652
  name: string;
653
+ status: "pending" | "approved";
620
654
  lastSeen: string;
621
655
  ip?: string | undefined;
622
656
  platform?: string | undefined;
@@ -773,6 +807,25 @@ export declare const adminWSErrorMessageSchema: z.ZodObject<{
773
807
  message: string;
774
808
  type: "error";
775
809
  }>;
810
+ export declare const adminWSCommandResultMessageSchema: z.ZodObject<{
811
+ type: z.ZodLiteral<"command:result">;
812
+ requestId: z.ZodString;
813
+ success: z.ZodBoolean;
814
+ error: z.ZodOptional<z.ZodString>;
815
+ data: z.ZodOptional<z.ZodUnknown>;
816
+ }, "strip", z.ZodTypeAny, {
817
+ type: "command:result";
818
+ requestId: string;
819
+ success: boolean;
820
+ data?: unknown;
821
+ error?: string | undefined;
822
+ }, {
823
+ type: "command:result";
824
+ requestId: string;
825
+ success: boolean;
826
+ data?: unknown;
827
+ error?: string | undefined;
828
+ }>;
776
829
  export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
777
830
  type: z.ZodLiteral<"connected">;
778
831
  clientId: z.ZodString;
@@ -796,9 +849,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
796
849
  clientMode: z.ZodOptional<z.ZodString>;
797
850
  role: z.ZodOptional<z.ZodString>;
798
851
  }, "strip", z.ZodTypeAny, {
799
- status: "pending" | "approved";
800
852
  id: string;
801
853
  name: string;
854
+ status: "pending" | "approved";
802
855
  lastSeen: string;
803
856
  ip?: string | undefined;
804
857
  platform?: string | undefined;
@@ -806,9 +859,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
806
859
  clientMode?: string | undefined;
807
860
  role?: string | undefined;
808
861
  }, {
809
- status: "pending" | "approved";
810
862
  id: string;
811
863
  name: string;
864
+ status: "pending" | "approved";
812
865
  lastSeen: string;
813
866
  ip?: string | undefined;
814
867
  platform?: string | undefined;
@@ -891,9 +944,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
891
944
  }>;
892
945
  }, "strip", z.ZodTypeAny, {
893
946
  devices: {
894
- status: "pending" | "approved";
895
947
  id: string;
896
948
  name: string;
949
+ status: "pending" | "approved";
897
950
  lastSeen: string;
898
951
  ip?: string | undefined;
899
952
  platform?: string | undefined;
@@ -922,9 +975,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
922
975
  };
923
976
  }, {
924
977
  devices: {
925
- status: "pending" | "approved";
926
978
  id: string;
927
979
  name: string;
980
+ status: "pending" | "approved";
928
981
  lastSeen: string;
929
982
  ip?: string | undefined;
930
983
  platform?: string | undefined;
@@ -956,9 +1009,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
956
1009
  type: "state:full";
957
1010
  data: {
958
1011
  devices: {
959
- status: "pending" | "approved";
960
1012
  id: string;
961
1013
  name: string;
1014
+ status: "pending" | "approved";
962
1015
  lastSeen: string;
963
1016
  ip?: string | undefined;
964
1017
  platform?: string | undefined;
@@ -990,9 +1043,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
990
1043
  type: "state:full";
991
1044
  data: {
992
1045
  devices: {
993
- status: "pending" | "approved";
994
1046
  id: string;
995
1047
  name: string;
1048
+ status: "pending" | "approved";
996
1049
  lastSeen: string;
997
1050
  ip?: string | undefined;
998
1051
  platform?: string | undefined;
@@ -1033,9 +1086,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1033
1086
  clientMode: z.ZodOptional<z.ZodString>;
1034
1087
  role: z.ZodOptional<z.ZodString>;
1035
1088
  }, "strip", z.ZodTypeAny, {
1036
- status: "pending" | "approved";
1037
1089
  id: string;
1038
1090
  name: string;
1091
+ status: "pending" | "approved";
1039
1092
  lastSeen: string;
1040
1093
  ip?: string | undefined;
1041
1094
  platform?: string | undefined;
@@ -1043,9 +1096,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1043
1096
  clientMode?: string | undefined;
1044
1097
  role?: string | undefined;
1045
1098
  }, {
1046
- status: "pending" | "approved";
1047
1099
  id: string;
1048
1100
  name: string;
1101
+ status: "pending" | "approved";
1049
1102
  lastSeen: string;
1050
1103
  ip?: string | undefined;
1051
1104
  platform?: string | undefined;
@@ -1056,9 +1109,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1056
1109
  }, "strip", z.ZodTypeAny, {
1057
1110
  type: "state:devices";
1058
1111
  data: {
1059
- status: "pending" | "approved";
1060
1112
  id: string;
1061
1113
  name: string;
1114
+ status: "pending" | "approved";
1062
1115
  lastSeen: string;
1063
1116
  ip?: string | undefined;
1064
1117
  platform?: string | undefined;
@@ -1069,9 +1122,9 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1069
1122
  }, {
1070
1123
  type: "state:devices";
1071
1124
  data: {
1072
- status: "pending" | "approved";
1073
1125
  id: string;
1074
1126
  name: string;
1127
+ status: "pending" | "approved";
1075
1128
  lastSeen: string;
1076
1129
  ip?: string | undefined;
1077
1130
  platform?: string | undefined;
@@ -1223,6 +1276,24 @@ export declare const adminWSServerMessageSchema: z.ZodDiscriminatedUnion<"type",
1223
1276
  code: string;
1224
1277
  message: string;
1225
1278
  type: "error";
1279
+ }>, z.ZodObject<{
1280
+ type: z.ZodLiteral<"command:result">;
1281
+ requestId: z.ZodString;
1282
+ success: z.ZodBoolean;
1283
+ error: z.ZodOptional<z.ZodString>;
1284
+ data: z.ZodOptional<z.ZodUnknown>;
1285
+ }, "strip", z.ZodTypeAny, {
1286
+ type: "command:result";
1287
+ requestId: string;
1288
+ success: boolean;
1289
+ data?: unknown;
1290
+ error?: string | undefined;
1291
+ }, {
1292
+ type: "command:result";
1293
+ requestId: string;
1294
+ success: boolean;
1295
+ data?: unknown;
1296
+ error?: string | undefined;
1226
1297
  }>]>;
1227
1298
  export declare const adminWSPongMessageSchema: z.ZodObject<{
1228
1299
  type: z.ZodLiteral<"pong">;
@@ -1238,6 +1309,107 @@ export declare const adminWSRefreshMessageSchema: z.ZodObject<{
1238
1309
  }, {
1239
1310
  type: "refresh";
1240
1311
  }>;
1312
+ export declare const adminWSApprovePairingCommandSchema: z.ZodObject<{
1313
+ type: z.ZodLiteral<"command:approve-pairing">;
1314
+ requestId: z.ZodString;
1315
+ pairingId: z.ZodString;
1316
+ channel: z.ZodString;
1317
+ code: z.ZodString;
1318
+ }, "strip", z.ZodTypeAny, {
1319
+ code: string;
1320
+ type: "command:approve-pairing";
1321
+ channel: string;
1322
+ requestId: string;
1323
+ pairingId: string;
1324
+ }, {
1325
+ code: string;
1326
+ type: "command:approve-pairing";
1327
+ channel: string;
1328
+ requestId: string;
1329
+ pairingId: string;
1330
+ }>;
1331
+ export declare const adminWSApproveDeviceCommandSchema: z.ZodObject<{
1332
+ type: z.ZodLiteral<"command:approve-device">;
1333
+ requestId: z.ZodString;
1334
+ deviceId: z.ZodString;
1335
+ }, "strip", z.ZodTypeAny, {
1336
+ type: "command:approve-device";
1337
+ requestId: string;
1338
+ deviceId: string;
1339
+ }, {
1340
+ type: "command:approve-device";
1341
+ requestId: string;
1342
+ deviceId: string;
1343
+ }>;
1344
+ export declare const adminWSApproveAllPairingsCommandSchema: z.ZodObject<{
1345
+ type: z.ZodLiteral<"command:approve-pairings-all">;
1346
+ requestId: z.ZodString;
1347
+ }, "strip", z.ZodTypeAny, {
1348
+ type: "command:approve-pairings-all";
1349
+ requestId: string;
1350
+ }, {
1351
+ type: "command:approve-pairings-all";
1352
+ requestId: string;
1353
+ }>;
1354
+ export declare const adminWSApproveAllDevicesCommandSchema: z.ZodObject<{
1355
+ type: z.ZodLiteral<"command:approve-devices-all">;
1356
+ requestId: z.ZodString;
1357
+ }, "strip", z.ZodTypeAny, {
1358
+ type: "command:approve-devices-all";
1359
+ requestId: string;
1360
+ }, {
1361
+ type: "command:approve-devices-all";
1362
+ requestId: string;
1363
+ }>;
1364
+ export declare const adminWSCommandSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1365
+ type: z.ZodLiteral<"command:approve-pairing">;
1366
+ requestId: z.ZodString;
1367
+ pairingId: z.ZodString;
1368
+ channel: z.ZodString;
1369
+ code: z.ZodString;
1370
+ }, "strip", z.ZodTypeAny, {
1371
+ code: string;
1372
+ type: "command:approve-pairing";
1373
+ channel: string;
1374
+ requestId: string;
1375
+ pairingId: string;
1376
+ }, {
1377
+ code: string;
1378
+ type: "command:approve-pairing";
1379
+ channel: string;
1380
+ requestId: string;
1381
+ pairingId: string;
1382
+ }>, z.ZodObject<{
1383
+ type: z.ZodLiteral<"command:approve-device">;
1384
+ requestId: z.ZodString;
1385
+ deviceId: z.ZodString;
1386
+ }, "strip", z.ZodTypeAny, {
1387
+ type: "command:approve-device";
1388
+ requestId: string;
1389
+ deviceId: string;
1390
+ }, {
1391
+ type: "command:approve-device";
1392
+ requestId: string;
1393
+ deviceId: string;
1394
+ }>, z.ZodObject<{
1395
+ type: z.ZodLiteral<"command:approve-pairings-all">;
1396
+ requestId: z.ZodString;
1397
+ }, "strip", z.ZodTypeAny, {
1398
+ type: "command:approve-pairings-all";
1399
+ requestId: string;
1400
+ }, {
1401
+ type: "command:approve-pairings-all";
1402
+ requestId: string;
1403
+ }>, z.ZodObject<{
1404
+ type: z.ZodLiteral<"command:approve-devices-all">;
1405
+ requestId: z.ZodString;
1406
+ }, "strip", z.ZodTypeAny, {
1407
+ type: "command:approve-devices-all";
1408
+ requestId: string;
1409
+ }, {
1410
+ type: "command:approve-devices-all";
1411
+ requestId: string;
1412
+ }>]>;
1241
1413
  export declare const adminWSClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1242
1414
  type: z.ZodLiteral<"pong">;
1243
1415
  }, "strip", z.ZodTypeAny, {
@@ -1250,6 +1422,54 @@ export declare const adminWSClientMessageSchema: z.ZodDiscriminatedUnion<"type",
1250
1422
  type: "refresh";
1251
1423
  }, {
1252
1424
  type: "refresh";
1425
+ }>, z.ZodObject<{
1426
+ type: z.ZodLiteral<"command:approve-pairing">;
1427
+ requestId: z.ZodString;
1428
+ pairingId: z.ZodString;
1429
+ channel: z.ZodString;
1430
+ code: z.ZodString;
1431
+ }, "strip", z.ZodTypeAny, {
1432
+ code: string;
1433
+ type: "command:approve-pairing";
1434
+ channel: string;
1435
+ requestId: string;
1436
+ pairingId: string;
1437
+ }, {
1438
+ code: string;
1439
+ type: "command:approve-pairing";
1440
+ channel: string;
1441
+ requestId: string;
1442
+ pairingId: string;
1443
+ }>, z.ZodObject<{
1444
+ type: z.ZodLiteral<"command:approve-device">;
1445
+ requestId: z.ZodString;
1446
+ deviceId: z.ZodString;
1447
+ }, "strip", z.ZodTypeAny, {
1448
+ type: "command:approve-device";
1449
+ requestId: string;
1450
+ deviceId: string;
1451
+ }, {
1452
+ type: "command:approve-device";
1453
+ requestId: string;
1454
+ deviceId: string;
1455
+ }>, z.ZodObject<{
1456
+ type: z.ZodLiteral<"command:approve-pairings-all">;
1457
+ requestId: z.ZodString;
1458
+ }, "strip", z.ZodTypeAny, {
1459
+ type: "command:approve-pairings-all";
1460
+ requestId: string;
1461
+ }, {
1462
+ type: "command:approve-pairings-all";
1463
+ requestId: string;
1464
+ }>, z.ZodObject<{
1465
+ type: z.ZodLiteral<"command:approve-devices-all">;
1466
+ requestId: z.ZodString;
1467
+ }, "strip", z.ZodTypeAny, {
1468
+ type: "command:approve-devices-all";
1469
+ requestId: string;
1470
+ }, {
1471
+ type: "command:approve-devices-all";
1472
+ requestId: string;
1253
1473
  }>]>;
1254
1474
  export declare const adminWSTicketResponseSchema: z.ZodObject<{
1255
1475
  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.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 = void 0;
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;
13
13
  const zod_1 = require("zod");
14
14
  // ============================================================================
15
15
  // Zod Schemas
@@ -76,6 +76,13 @@ exports.adminWSErrorMessageSchema = zod_1.z.object({
76
76
  code: zod_1.z.string(),
77
77
  message: zod_1.z.string(),
78
78
  });
79
+ exports.adminWSCommandResultMessageSchema = zod_1.z.object({
80
+ type: zod_1.z.literal("command:result"),
81
+ requestId: zod_1.z.string(),
82
+ success: zod_1.z.boolean(),
83
+ error: zod_1.z.string().optional(),
84
+ data: zod_1.z.unknown().optional(),
85
+ });
79
86
  exports.adminWSServerMessageSchema = zod_1.z.discriminatedUnion("type", [
80
87
  exports.adminWSConnectedMessageSchema,
81
88
  exports.adminWSFullStateMessageSchema,
@@ -84,6 +91,7 @@ exports.adminWSServerMessageSchema = zod_1.z.discriminatedUnion("type", [
84
91
  exports.adminWSGatewayMessageSchema,
85
92
  exports.adminWSPingMessageSchema,
86
93
  exports.adminWSErrorMessageSchema,
94
+ exports.adminWSCommandResultMessageSchema,
87
95
  ]);
88
96
  exports.adminWSPongMessageSchema = zod_1.z.object({
89
97
  type: zod_1.z.literal("pong"),
@@ -91,9 +99,39 @@ exports.adminWSPongMessageSchema = zod_1.z.object({
91
99
  exports.adminWSRefreshMessageSchema = zod_1.z.object({
92
100
  type: zod_1.z.literal("refresh"),
93
101
  });
102
+ exports.adminWSApprovePairingCommandSchema = zod_1.z.object({
103
+ type: zod_1.z.literal("command:approve-pairing"),
104
+ requestId: zod_1.z.string(),
105
+ pairingId: zod_1.z.string(),
106
+ channel: zod_1.z.string(),
107
+ code: zod_1.z.string(),
108
+ });
109
+ exports.adminWSApproveDeviceCommandSchema = zod_1.z.object({
110
+ type: zod_1.z.literal("command:approve-device"),
111
+ requestId: zod_1.z.string(),
112
+ deviceId: zod_1.z.string(),
113
+ });
114
+ exports.adminWSApproveAllPairingsCommandSchema = zod_1.z.object({
115
+ type: zod_1.z.literal("command:approve-pairings-all"),
116
+ requestId: zod_1.z.string(),
117
+ });
118
+ exports.adminWSApproveAllDevicesCommandSchema = zod_1.z.object({
119
+ type: zod_1.z.literal("command:approve-devices-all"),
120
+ requestId: zod_1.z.string(),
121
+ });
122
+ exports.adminWSCommandSchema = zod_1.z.discriminatedUnion("type", [
123
+ exports.adminWSApprovePairingCommandSchema,
124
+ exports.adminWSApproveDeviceCommandSchema,
125
+ exports.adminWSApproveAllPairingsCommandSchema,
126
+ exports.adminWSApproveAllDevicesCommandSchema,
127
+ ]);
94
128
  exports.adminWSClientMessageSchema = zod_1.z.discriminatedUnion("type", [
95
129
  exports.adminWSPongMessageSchema,
96
130
  exports.adminWSRefreshMessageSchema,
131
+ exports.adminWSApprovePairingCommandSchema,
132
+ exports.adminWSApproveDeviceCommandSchema,
133
+ exports.adminWSApproveAllPairingsCommandSchema,
134
+ exports.adminWSApproveAllDevicesCommandSchema,
97
135
  ]);
98
136
  exports.adminWSTicketResponseSchema = zod_1.z.object({
99
137
  ticket: zod_1.z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/contracts",
3
- "version": "1.7.22",
3
+ "version": "1.7.23",
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",