geniebox-shared-lib 2.3.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,952 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.7
5
+ // protoc v5.28.2
6
+ // source: mcp.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.McpServiceService = exports.MCP_SERVICE_NAME = exports.McpServersResponse = exports.SetToolCustomizationRequest = exports.SetServerCustomizationRequest = exports.DeleteMcpServerRequest = exports.ListMcpServersRequest = exports.GetMcpServerRequest = exports.UpdateMcpServerRequest = exports.CreateMcpServerRequest = exports.McpOAuthSession = exports.McpToolCustomization = exports.McpServerCustomization = exports.McpServer = exports.MCP_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.McpServiceControllerMethods = McpServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const wire_1 = require("@bufbuild/protobuf/wire");
12
+ const microservices_1 = require("@nestjs/microservices");
13
+ const protobufjs_1 = require("protobufjs");
14
+ const empty_interface_1 = require("./google/protobuf/empty.interface");
15
+ const struct_interface_1 = require("./google/protobuf/struct.interface");
16
+ exports.protobufPackage = "mcp";
17
+ exports.MCP_PACKAGE_NAME = "mcp";
18
+ function createBaseMcpServer() {
19
+ return { id: "", name: "", enabled: false, userId: "", visibility: "", createdAt: "", updatedAt: "" };
20
+ }
21
+ exports.McpServer = {
22
+ encode(message, writer = new wire_1.BinaryWriter()) {
23
+ if (message.id !== "") {
24
+ writer.uint32(10).string(message.id);
25
+ }
26
+ if (message.name !== "") {
27
+ writer.uint32(18).string(message.name);
28
+ }
29
+ if (message.config !== undefined) {
30
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.config), writer.uint32(26).fork()).join();
31
+ }
32
+ if (message.enabled !== false) {
33
+ writer.uint32(32).bool(message.enabled);
34
+ }
35
+ if (message.userId !== "") {
36
+ writer.uint32(42).string(message.userId);
37
+ }
38
+ if (message.visibility !== "") {
39
+ writer.uint32(50).string(message.visibility);
40
+ }
41
+ if (message.createdAt !== "") {
42
+ writer.uint32(58).string(message.createdAt);
43
+ }
44
+ if (message.updatedAt !== "") {
45
+ writer.uint32(66).string(message.updatedAt);
46
+ }
47
+ return writer;
48
+ },
49
+ decode(input, length) {
50
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
51
+ const end = length === undefined ? reader.len : reader.pos + length;
52
+ const message = createBaseMcpServer();
53
+ while (reader.pos < end) {
54
+ const tag = reader.uint32();
55
+ switch (tag >>> 3) {
56
+ case 1: {
57
+ if (tag !== 10) {
58
+ break;
59
+ }
60
+ message.id = reader.string();
61
+ continue;
62
+ }
63
+ case 2: {
64
+ if (tag !== 18) {
65
+ break;
66
+ }
67
+ message.name = reader.string();
68
+ continue;
69
+ }
70
+ case 3: {
71
+ if (tag !== 26) {
72
+ break;
73
+ }
74
+ message.config = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
75
+ continue;
76
+ }
77
+ case 4: {
78
+ if (tag !== 32) {
79
+ break;
80
+ }
81
+ message.enabled = reader.bool();
82
+ continue;
83
+ }
84
+ case 5: {
85
+ if (tag !== 42) {
86
+ break;
87
+ }
88
+ message.userId = reader.string();
89
+ continue;
90
+ }
91
+ case 6: {
92
+ if (tag !== 50) {
93
+ break;
94
+ }
95
+ message.visibility = reader.string();
96
+ continue;
97
+ }
98
+ case 7: {
99
+ if (tag !== 58) {
100
+ break;
101
+ }
102
+ message.createdAt = reader.string();
103
+ continue;
104
+ }
105
+ case 8: {
106
+ if (tag !== 66) {
107
+ break;
108
+ }
109
+ message.updatedAt = reader.string();
110
+ continue;
111
+ }
112
+ }
113
+ if ((tag & 7) === 4 || tag === 0) {
114
+ break;
115
+ }
116
+ reader.skip(tag & 7);
117
+ }
118
+ return message;
119
+ },
120
+ };
121
+ function createBaseMcpServerCustomization() {
122
+ return { id: "", userId: "", mcpServerId: "", prompt: "", createdAt: "", updatedAt: "" };
123
+ }
124
+ exports.McpServerCustomization = {
125
+ encode(message, writer = new wire_1.BinaryWriter()) {
126
+ if (message.id !== "") {
127
+ writer.uint32(10).string(message.id);
128
+ }
129
+ if (message.userId !== "") {
130
+ writer.uint32(18).string(message.userId);
131
+ }
132
+ if (message.mcpServerId !== "") {
133
+ writer.uint32(26).string(message.mcpServerId);
134
+ }
135
+ if (message.prompt !== "") {
136
+ writer.uint32(34).string(message.prompt);
137
+ }
138
+ if (message.createdAt !== "") {
139
+ writer.uint32(42).string(message.createdAt);
140
+ }
141
+ if (message.updatedAt !== "") {
142
+ writer.uint32(50).string(message.updatedAt);
143
+ }
144
+ return writer;
145
+ },
146
+ decode(input, length) {
147
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
148
+ const end = length === undefined ? reader.len : reader.pos + length;
149
+ const message = createBaseMcpServerCustomization();
150
+ while (reader.pos < end) {
151
+ const tag = reader.uint32();
152
+ switch (tag >>> 3) {
153
+ case 1: {
154
+ if (tag !== 10) {
155
+ break;
156
+ }
157
+ message.id = reader.string();
158
+ continue;
159
+ }
160
+ case 2: {
161
+ if (tag !== 18) {
162
+ break;
163
+ }
164
+ message.userId = reader.string();
165
+ continue;
166
+ }
167
+ case 3: {
168
+ if (tag !== 26) {
169
+ break;
170
+ }
171
+ message.mcpServerId = reader.string();
172
+ continue;
173
+ }
174
+ case 4: {
175
+ if (tag !== 34) {
176
+ break;
177
+ }
178
+ message.prompt = reader.string();
179
+ continue;
180
+ }
181
+ case 5: {
182
+ if (tag !== 42) {
183
+ break;
184
+ }
185
+ message.createdAt = reader.string();
186
+ continue;
187
+ }
188
+ case 6: {
189
+ if (tag !== 50) {
190
+ break;
191
+ }
192
+ message.updatedAt = reader.string();
193
+ continue;
194
+ }
195
+ }
196
+ if ((tag & 7) === 4 || tag === 0) {
197
+ break;
198
+ }
199
+ reader.skip(tag & 7);
200
+ }
201
+ return message;
202
+ },
203
+ };
204
+ function createBaseMcpToolCustomization() {
205
+ return { id: "", userId: "", toolName: "", mcpServerId: "", prompt: "", createdAt: "", updatedAt: "" };
206
+ }
207
+ exports.McpToolCustomization = {
208
+ encode(message, writer = new wire_1.BinaryWriter()) {
209
+ if (message.id !== "") {
210
+ writer.uint32(10).string(message.id);
211
+ }
212
+ if (message.userId !== "") {
213
+ writer.uint32(18).string(message.userId);
214
+ }
215
+ if (message.toolName !== "") {
216
+ writer.uint32(26).string(message.toolName);
217
+ }
218
+ if (message.mcpServerId !== "") {
219
+ writer.uint32(34).string(message.mcpServerId);
220
+ }
221
+ if (message.prompt !== "") {
222
+ writer.uint32(42).string(message.prompt);
223
+ }
224
+ if (message.createdAt !== "") {
225
+ writer.uint32(50).string(message.createdAt);
226
+ }
227
+ if (message.updatedAt !== "") {
228
+ writer.uint32(58).string(message.updatedAt);
229
+ }
230
+ return writer;
231
+ },
232
+ decode(input, length) {
233
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
234
+ const end = length === undefined ? reader.len : reader.pos + length;
235
+ const message = createBaseMcpToolCustomization();
236
+ while (reader.pos < end) {
237
+ const tag = reader.uint32();
238
+ switch (tag >>> 3) {
239
+ case 1: {
240
+ if (tag !== 10) {
241
+ break;
242
+ }
243
+ message.id = reader.string();
244
+ continue;
245
+ }
246
+ case 2: {
247
+ if (tag !== 18) {
248
+ break;
249
+ }
250
+ message.userId = reader.string();
251
+ continue;
252
+ }
253
+ case 3: {
254
+ if (tag !== 26) {
255
+ break;
256
+ }
257
+ message.toolName = reader.string();
258
+ continue;
259
+ }
260
+ case 4: {
261
+ if (tag !== 34) {
262
+ break;
263
+ }
264
+ message.mcpServerId = reader.string();
265
+ continue;
266
+ }
267
+ case 5: {
268
+ if (tag !== 42) {
269
+ break;
270
+ }
271
+ message.prompt = reader.string();
272
+ continue;
273
+ }
274
+ case 6: {
275
+ if (tag !== 50) {
276
+ break;
277
+ }
278
+ message.createdAt = reader.string();
279
+ continue;
280
+ }
281
+ case 7: {
282
+ if (tag !== 58) {
283
+ break;
284
+ }
285
+ message.updatedAt = reader.string();
286
+ continue;
287
+ }
288
+ }
289
+ if ((tag & 7) === 4 || tag === 0) {
290
+ break;
291
+ }
292
+ reader.skip(tag & 7);
293
+ }
294
+ return message;
295
+ },
296
+ };
297
+ function createBaseMcpOAuthSession() {
298
+ return { id: "", mcpServerId: "", serverUrl: "", codeVerifier: "", state: "", createdAt: "", updatedAt: "" };
299
+ }
300
+ exports.McpOAuthSession = {
301
+ encode(message, writer = new wire_1.BinaryWriter()) {
302
+ if (message.id !== "") {
303
+ writer.uint32(10).string(message.id);
304
+ }
305
+ if (message.mcpServerId !== "") {
306
+ writer.uint32(18).string(message.mcpServerId);
307
+ }
308
+ if (message.serverUrl !== "") {
309
+ writer.uint32(26).string(message.serverUrl);
310
+ }
311
+ if (message.clientInfo !== undefined) {
312
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.clientInfo), writer.uint32(34).fork()).join();
313
+ }
314
+ if (message.tokens !== undefined) {
315
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.tokens), writer.uint32(42).fork()).join();
316
+ }
317
+ if (message.codeVerifier !== "") {
318
+ writer.uint32(50).string(message.codeVerifier);
319
+ }
320
+ if (message.state !== "") {
321
+ writer.uint32(58).string(message.state);
322
+ }
323
+ if (message.createdAt !== "") {
324
+ writer.uint32(66).string(message.createdAt);
325
+ }
326
+ if (message.updatedAt !== "") {
327
+ writer.uint32(74).string(message.updatedAt);
328
+ }
329
+ return writer;
330
+ },
331
+ decode(input, length) {
332
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
333
+ const end = length === undefined ? reader.len : reader.pos + length;
334
+ const message = createBaseMcpOAuthSession();
335
+ while (reader.pos < end) {
336
+ const tag = reader.uint32();
337
+ switch (tag >>> 3) {
338
+ case 1: {
339
+ if (tag !== 10) {
340
+ break;
341
+ }
342
+ message.id = reader.string();
343
+ continue;
344
+ }
345
+ case 2: {
346
+ if (tag !== 18) {
347
+ break;
348
+ }
349
+ message.mcpServerId = reader.string();
350
+ continue;
351
+ }
352
+ case 3: {
353
+ if (tag !== 26) {
354
+ break;
355
+ }
356
+ message.serverUrl = reader.string();
357
+ continue;
358
+ }
359
+ case 4: {
360
+ if (tag !== 34) {
361
+ break;
362
+ }
363
+ message.clientInfo = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
364
+ continue;
365
+ }
366
+ case 5: {
367
+ if (tag !== 42) {
368
+ break;
369
+ }
370
+ message.tokens = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
371
+ continue;
372
+ }
373
+ case 6: {
374
+ if (tag !== 50) {
375
+ break;
376
+ }
377
+ message.codeVerifier = reader.string();
378
+ continue;
379
+ }
380
+ case 7: {
381
+ if (tag !== 58) {
382
+ break;
383
+ }
384
+ message.state = reader.string();
385
+ continue;
386
+ }
387
+ case 8: {
388
+ if (tag !== 66) {
389
+ break;
390
+ }
391
+ message.createdAt = reader.string();
392
+ continue;
393
+ }
394
+ case 9: {
395
+ if (tag !== 74) {
396
+ break;
397
+ }
398
+ message.updatedAt = reader.string();
399
+ continue;
400
+ }
401
+ }
402
+ if ((tag & 7) === 4 || tag === 0) {
403
+ break;
404
+ }
405
+ reader.skip(tag & 7);
406
+ }
407
+ return message;
408
+ },
409
+ };
410
+ function createBaseCreateMcpServerRequest() {
411
+ return { userId: "", name: "", enabled: false, visibility: "" };
412
+ }
413
+ exports.CreateMcpServerRequest = {
414
+ encode(message, writer = new wire_1.BinaryWriter()) {
415
+ if (message.userId !== "") {
416
+ writer.uint32(10).string(message.userId);
417
+ }
418
+ if (message.name !== "") {
419
+ writer.uint32(18).string(message.name);
420
+ }
421
+ if (message.config !== undefined) {
422
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.config), writer.uint32(26).fork()).join();
423
+ }
424
+ if (message.enabled !== false) {
425
+ writer.uint32(32).bool(message.enabled);
426
+ }
427
+ if (message.visibility !== "") {
428
+ writer.uint32(42).string(message.visibility);
429
+ }
430
+ return writer;
431
+ },
432
+ decode(input, length) {
433
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
434
+ const end = length === undefined ? reader.len : reader.pos + length;
435
+ const message = createBaseCreateMcpServerRequest();
436
+ while (reader.pos < end) {
437
+ const tag = reader.uint32();
438
+ switch (tag >>> 3) {
439
+ case 1: {
440
+ if (tag !== 10) {
441
+ break;
442
+ }
443
+ message.userId = reader.string();
444
+ continue;
445
+ }
446
+ case 2: {
447
+ if (tag !== 18) {
448
+ break;
449
+ }
450
+ message.name = reader.string();
451
+ continue;
452
+ }
453
+ case 3: {
454
+ if (tag !== 26) {
455
+ break;
456
+ }
457
+ message.config = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
458
+ continue;
459
+ }
460
+ case 4: {
461
+ if (tag !== 32) {
462
+ break;
463
+ }
464
+ message.enabled = reader.bool();
465
+ continue;
466
+ }
467
+ case 5: {
468
+ if (tag !== 42) {
469
+ break;
470
+ }
471
+ message.visibility = reader.string();
472
+ continue;
473
+ }
474
+ }
475
+ if ((tag & 7) === 4 || tag === 0) {
476
+ break;
477
+ }
478
+ reader.skip(tag & 7);
479
+ }
480
+ return message;
481
+ },
482
+ };
483
+ function createBaseUpdateMcpServerRequest() {
484
+ return { id: "", userId: "" };
485
+ }
486
+ exports.UpdateMcpServerRequest = {
487
+ encode(message, writer = new wire_1.BinaryWriter()) {
488
+ if (message.id !== "") {
489
+ writer.uint32(10).string(message.id);
490
+ }
491
+ if (message.userId !== "") {
492
+ writer.uint32(18).string(message.userId);
493
+ }
494
+ if (message.name !== undefined) {
495
+ writer.uint32(26).string(message.name);
496
+ }
497
+ if (message.config !== undefined) {
498
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.config), writer.uint32(34).fork()).join();
499
+ }
500
+ if (message.enabled !== undefined) {
501
+ writer.uint32(40).bool(message.enabled);
502
+ }
503
+ if (message.visibility !== undefined) {
504
+ writer.uint32(50).string(message.visibility);
505
+ }
506
+ return writer;
507
+ },
508
+ decode(input, length) {
509
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
510
+ const end = length === undefined ? reader.len : reader.pos + length;
511
+ const message = createBaseUpdateMcpServerRequest();
512
+ while (reader.pos < end) {
513
+ const tag = reader.uint32();
514
+ switch (tag >>> 3) {
515
+ case 1: {
516
+ if (tag !== 10) {
517
+ break;
518
+ }
519
+ message.id = reader.string();
520
+ continue;
521
+ }
522
+ case 2: {
523
+ if (tag !== 18) {
524
+ break;
525
+ }
526
+ message.userId = reader.string();
527
+ continue;
528
+ }
529
+ case 3: {
530
+ if (tag !== 26) {
531
+ break;
532
+ }
533
+ message.name = reader.string();
534
+ continue;
535
+ }
536
+ case 4: {
537
+ if (tag !== 34) {
538
+ break;
539
+ }
540
+ message.config = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
541
+ continue;
542
+ }
543
+ case 5: {
544
+ if (tag !== 40) {
545
+ break;
546
+ }
547
+ message.enabled = reader.bool();
548
+ continue;
549
+ }
550
+ case 6: {
551
+ if (tag !== 50) {
552
+ break;
553
+ }
554
+ message.visibility = reader.string();
555
+ continue;
556
+ }
557
+ }
558
+ if ((tag & 7) === 4 || tag === 0) {
559
+ break;
560
+ }
561
+ reader.skip(tag & 7);
562
+ }
563
+ return message;
564
+ },
565
+ };
566
+ function createBaseGetMcpServerRequest() {
567
+ return { id: "", userId: "" };
568
+ }
569
+ exports.GetMcpServerRequest = {
570
+ encode(message, writer = new wire_1.BinaryWriter()) {
571
+ if (message.id !== "") {
572
+ writer.uint32(10).string(message.id);
573
+ }
574
+ if (message.userId !== "") {
575
+ writer.uint32(18).string(message.userId);
576
+ }
577
+ return writer;
578
+ },
579
+ decode(input, length) {
580
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
581
+ const end = length === undefined ? reader.len : reader.pos + length;
582
+ const message = createBaseGetMcpServerRequest();
583
+ while (reader.pos < end) {
584
+ const tag = reader.uint32();
585
+ switch (tag >>> 3) {
586
+ case 1: {
587
+ if (tag !== 10) {
588
+ break;
589
+ }
590
+ message.id = reader.string();
591
+ continue;
592
+ }
593
+ case 2: {
594
+ if (tag !== 18) {
595
+ break;
596
+ }
597
+ message.userId = reader.string();
598
+ continue;
599
+ }
600
+ }
601
+ if ((tag & 7) === 4 || tag === 0) {
602
+ break;
603
+ }
604
+ reader.skip(tag & 7);
605
+ }
606
+ return message;
607
+ },
608
+ };
609
+ function createBaseListMcpServersRequest() {
610
+ return { userId: "", limit: 0, offset: 0 };
611
+ }
612
+ exports.ListMcpServersRequest = {
613
+ encode(message, writer = new wire_1.BinaryWriter()) {
614
+ if (message.userId !== "") {
615
+ writer.uint32(10).string(message.userId);
616
+ }
617
+ if (message.limit !== 0) {
618
+ writer.uint32(16).int32(message.limit);
619
+ }
620
+ if (message.offset !== 0) {
621
+ writer.uint32(24).int32(message.offset);
622
+ }
623
+ return writer;
624
+ },
625
+ decode(input, length) {
626
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
627
+ const end = length === undefined ? reader.len : reader.pos + length;
628
+ const message = createBaseListMcpServersRequest();
629
+ while (reader.pos < end) {
630
+ const tag = reader.uint32();
631
+ switch (tag >>> 3) {
632
+ case 1: {
633
+ if (tag !== 10) {
634
+ break;
635
+ }
636
+ message.userId = reader.string();
637
+ continue;
638
+ }
639
+ case 2: {
640
+ if (tag !== 16) {
641
+ break;
642
+ }
643
+ message.limit = reader.int32();
644
+ continue;
645
+ }
646
+ case 3: {
647
+ if (tag !== 24) {
648
+ break;
649
+ }
650
+ message.offset = reader.int32();
651
+ continue;
652
+ }
653
+ }
654
+ if ((tag & 7) === 4 || tag === 0) {
655
+ break;
656
+ }
657
+ reader.skip(tag & 7);
658
+ }
659
+ return message;
660
+ },
661
+ };
662
+ function createBaseDeleteMcpServerRequest() {
663
+ return { id: "", userId: "" };
664
+ }
665
+ exports.DeleteMcpServerRequest = {
666
+ encode(message, writer = new wire_1.BinaryWriter()) {
667
+ if (message.id !== "") {
668
+ writer.uint32(10).string(message.id);
669
+ }
670
+ if (message.userId !== "") {
671
+ writer.uint32(18).string(message.userId);
672
+ }
673
+ return writer;
674
+ },
675
+ decode(input, length) {
676
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
677
+ const end = length === undefined ? reader.len : reader.pos + length;
678
+ const message = createBaseDeleteMcpServerRequest();
679
+ while (reader.pos < end) {
680
+ const tag = reader.uint32();
681
+ switch (tag >>> 3) {
682
+ case 1: {
683
+ if (tag !== 10) {
684
+ break;
685
+ }
686
+ message.id = reader.string();
687
+ continue;
688
+ }
689
+ case 2: {
690
+ if (tag !== 18) {
691
+ break;
692
+ }
693
+ message.userId = reader.string();
694
+ continue;
695
+ }
696
+ }
697
+ if ((tag & 7) === 4 || tag === 0) {
698
+ break;
699
+ }
700
+ reader.skip(tag & 7);
701
+ }
702
+ return message;
703
+ },
704
+ };
705
+ function createBaseSetServerCustomizationRequest() {
706
+ return { userId: "", mcpServerId: "", prompt: "" };
707
+ }
708
+ exports.SetServerCustomizationRequest = {
709
+ encode(message, writer = new wire_1.BinaryWriter()) {
710
+ if (message.userId !== "") {
711
+ writer.uint32(10).string(message.userId);
712
+ }
713
+ if (message.mcpServerId !== "") {
714
+ writer.uint32(18).string(message.mcpServerId);
715
+ }
716
+ if (message.prompt !== "") {
717
+ writer.uint32(26).string(message.prompt);
718
+ }
719
+ return writer;
720
+ },
721
+ decode(input, length) {
722
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
723
+ const end = length === undefined ? reader.len : reader.pos + length;
724
+ const message = createBaseSetServerCustomizationRequest();
725
+ while (reader.pos < end) {
726
+ const tag = reader.uint32();
727
+ switch (tag >>> 3) {
728
+ case 1: {
729
+ if (tag !== 10) {
730
+ break;
731
+ }
732
+ message.userId = reader.string();
733
+ continue;
734
+ }
735
+ case 2: {
736
+ if (tag !== 18) {
737
+ break;
738
+ }
739
+ message.mcpServerId = reader.string();
740
+ continue;
741
+ }
742
+ case 3: {
743
+ if (tag !== 26) {
744
+ break;
745
+ }
746
+ message.prompt = reader.string();
747
+ continue;
748
+ }
749
+ }
750
+ if ((tag & 7) === 4 || tag === 0) {
751
+ break;
752
+ }
753
+ reader.skip(tag & 7);
754
+ }
755
+ return message;
756
+ },
757
+ };
758
+ function createBaseSetToolCustomizationRequest() {
759
+ return { userId: "", mcpServerId: "", toolName: "", prompt: "" };
760
+ }
761
+ exports.SetToolCustomizationRequest = {
762
+ encode(message, writer = new wire_1.BinaryWriter()) {
763
+ if (message.userId !== "") {
764
+ writer.uint32(10).string(message.userId);
765
+ }
766
+ if (message.mcpServerId !== "") {
767
+ writer.uint32(18).string(message.mcpServerId);
768
+ }
769
+ if (message.toolName !== "") {
770
+ writer.uint32(26).string(message.toolName);
771
+ }
772
+ if (message.prompt !== "") {
773
+ writer.uint32(34).string(message.prompt);
774
+ }
775
+ return writer;
776
+ },
777
+ decode(input, length) {
778
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
779
+ const end = length === undefined ? reader.len : reader.pos + length;
780
+ const message = createBaseSetToolCustomizationRequest();
781
+ while (reader.pos < end) {
782
+ const tag = reader.uint32();
783
+ switch (tag >>> 3) {
784
+ case 1: {
785
+ if (tag !== 10) {
786
+ break;
787
+ }
788
+ message.userId = reader.string();
789
+ continue;
790
+ }
791
+ case 2: {
792
+ if (tag !== 18) {
793
+ break;
794
+ }
795
+ message.mcpServerId = reader.string();
796
+ continue;
797
+ }
798
+ case 3: {
799
+ if (tag !== 26) {
800
+ break;
801
+ }
802
+ message.toolName = reader.string();
803
+ continue;
804
+ }
805
+ case 4: {
806
+ if (tag !== 34) {
807
+ break;
808
+ }
809
+ message.prompt = reader.string();
810
+ continue;
811
+ }
812
+ }
813
+ if ((tag & 7) === 4 || tag === 0) {
814
+ break;
815
+ }
816
+ reader.skip(tag & 7);
817
+ }
818
+ return message;
819
+ },
820
+ };
821
+ function createBaseMcpServersResponse() {
822
+ return { servers: [], total: 0 };
823
+ }
824
+ exports.McpServersResponse = {
825
+ encode(message, writer = new wire_1.BinaryWriter()) {
826
+ for (const v of message.servers) {
827
+ exports.McpServer.encode(v, writer.uint32(10).fork()).join();
828
+ }
829
+ if (message.total !== 0) {
830
+ writer.uint32(16).int32(message.total);
831
+ }
832
+ return writer;
833
+ },
834
+ decode(input, length) {
835
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
836
+ const end = length === undefined ? reader.len : reader.pos + length;
837
+ const message = createBaseMcpServersResponse();
838
+ while (reader.pos < end) {
839
+ const tag = reader.uint32();
840
+ switch (tag >>> 3) {
841
+ case 1: {
842
+ if (tag !== 10) {
843
+ break;
844
+ }
845
+ message.servers.push(exports.McpServer.decode(reader, reader.uint32()));
846
+ continue;
847
+ }
848
+ case 2: {
849
+ if (tag !== 16) {
850
+ break;
851
+ }
852
+ message.total = reader.int32();
853
+ continue;
854
+ }
855
+ }
856
+ if ((tag & 7) === 4 || tag === 0) {
857
+ break;
858
+ }
859
+ reader.skip(tag & 7);
860
+ }
861
+ return message;
862
+ },
863
+ };
864
+ protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_interface_1.Struct.wrap, toObject: struct_interface_1.Struct.unwrap };
865
+ function McpServiceControllerMethods() {
866
+ return function (constructor) {
867
+ const grpcMethods = [
868
+ "createServer",
869
+ "getServer",
870
+ "updateServer",
871
+ "deleteServer",
872
+ "listServers",
873
+ "setServerCustomization",
874
+ "setToolCustomization",
875
+ ];
876
+ for (const method of grpcMethods) {
877
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
878
+ (0, microservices_1.GrpcMethod)("McpService", method)(constructor.prototype[method], method, descriptor);
879
+ }
880
+ const grpcStreamMethods = [];
881
+ for (const method of grpcStreamMethods) {
882
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
883
+ (0, microservices_1.GrpcStreamMethod)("McpService", method)(constructor.prototype[method], method, descriptor);
884
+ }
885
+ };
886
+ }
887
+ exports.MCP_SERVICE_NAME = "McpService";
888
+ exports.McpServiceService = {
889
+ createServer: {
890
+ path: "/mcp.McpService/createServer",
891
+ requestStream: false,
892
+ responseStream: false,
893
+ requestSerialize: (value) => Buffer.from(exports.CreateMcpServerRequest.encode(value).finish()),
894
+ requestDeserialize: (value) => exports.CreateMcpServerRequest.decode(value),
895
+ responseSerialize: (value) => Buffer.from(exports.McpServer.encode(value).finish()),
896
+ responseDeserialize: (value) => exports.McpServer.decode(value),
897
+ },
898
+ getServer: {
899
+ path: "/mcp.McpService/getServer",
900
+ requestStream: false,
901
+ responseStream: false,
902
+ requestSerialize: (value) => Buffer.from(exports.GetMcpServerRequest.encode(value).finish()),
903
+ requestDeserialize: (value) => exports.GetMcpServerRequest.decode(value),
904
+ responseSerialize: (value) => Buffer.from(exports.McpServer.encode(value).finish()),
905
+ responseDeserialize: (value) => exports.McpServer.decode(value),
906
+ },
907
+ updateServer: {
908
+ path: "/mcp.McpService/updateServer",
909
+ requestStream: false,
910
+ responseStream: false,
911
+ requestSerialize: (value) => Buffer.from(exports.UpdateMcpServerRequest.encode(value).finish()),
912
+ requestDeserialize: (value) => exports.UpdateMcpServerRequest.decode(value),
913
+ responseSerialize: (value) => Buffer.from(exports.McpServer.encode(value).finish()),
914
+ responseDeserialize: (value) => exports.McpServer.decode(value),
915
+ },
916
+ deleteServer: {
917
+ path: "/mcp.McpService/deleteServer",
918
+ requestStream: false,
919
+ responseStream: false,
920
+ requestSerialize: (value) => Buffer.from(exports.DeleteMcpServerRequest.encode(value).finish()),
921
+ requestDeserialize: (value) => exports.DeleteMcpServerRequest.decode(value),
922
+ responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
923
+ responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
924
+ },
925
+ listServers: {
926
+ path: "/mcp.McpService/listServers",
927
+ requestStream: false,
928
+ responseStream: false,
929
+ requestSerialize: (value) => Buffer.from(exports.ListMcpServersRequest.encode(value).finish()),
930
+ requestDeserialize: (value) => exports.ListMcpServersRequest.decode(value),
931
+ responseSerialize: (value) => Buffer.from(exports.McpServersResponse.encode(value).finish()),
932
+ responseDeserialize: (value) => exports.McpServersResponse.decode(value),
933
+ },
934
+ setServerCustomization: {
935
+ path: "/mcp.McpService/setServerCustomization",
936
+ requestStream: false,
937
+ responseStream: false,
938
+ requestSerialize: (value) => Buffer.from(exports.SetServerCustomizationRequest.encode(value).finish()),
939
+ requestDeserialize: (value) => exports.SetServerCustomizationRequest.decode(value),
940
+ responseSerialize: (value) => Buffer.from(exports.McpServerCustomization.encode(value).finish()),
941
+ responseDeserialize: (value) => exports.McpServerCustomization.decode(value),
942
+ },
943
+ setToolCustomization: {
944
+ path: "/mcp.McpService/setToolCustomization",
945
+ requestStream: false,
946
+ responseStream: false,
947
+ requestSerialize: (value) => Buffer.from(exports.SetToolCustomizationRequest.encode(value).finish()),
948
+ requestDeserialize: (value) => exports.SetToolCustomizationRequest.decode(value),
949
+ responseSerialize: (value) => Buffer.from(exports.McpToolCustomization.encode(value).finish()),
950
+ responseDeserialize: (value) => exports.McpToolCustomization.decode(value),
951
+ },
952
+ };