@journal.one/gateway 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/common/logger.d.ts +19 -0
  2. package/dist/common/logger.d.ts.map +1 -0
  3. package/dist/common/logger.js +52 -0
  4. package/dist/common/logger.js.map +1 -0
  5. package/dist/config.d.ts +64 -0
  6. package/dist/config.d.ts.map +1 -0
  7. package/dist/config.js +103 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/connection.d.ts +21 -0
  10. package/dist/connection.d.ts.map +1 -0
  11. package/dist/connection.js +266 -0
  12. package/dist/connection.js.map +1 -0
  13. package/dist/main.d.ts +3 -0
  14. package/dist/main.d.ts.map +1 -0
  15. package/dist/main.js +32 -0
  16. package/dist/main.js.map +1 -0
  17. package/dist/mcp-client.d.ts +24 -0
  18. package/dist/mcp-client.d.ts.map +1 -0
  19. package/dist/mcp-client.js +91 -0
  20. package/dist/mcp-client.js.map +1 -0
  21. package/dist/runtime.d.ts +25 -0
  22. package/dist/runtime.d.ts.map +1 -0
  23. package/dist/runtime.js +124 -0
  24. package/dist/runtime.js.map +1 -0
  25. package/dist/skill-client.d.ts +18 -0
  26. package/dist/skill-client.d.ts.map +1 -0
  27. package/dist/skill-client.js +75 -0
  28. package/dist/skill-client.js.map +1 -0
  29. package/dist/types/errors.d.ts +16 -0
  30. package/dist/types/errors.d.ts.map +1 -0
  31. package/dist/types/errors.js +13 -0
  32. package/dist/types/errors.js.map +1 -0
  33. package/dist/types/index.d.ts +7 -0
  34. package/dist/types/index.d.ts.map +1 -0
  35. package/dist/types/index.js +6 -0
  36. package/dist/types/index.js.map +1 -0
  37. package/dist/types/integrations.d.ts +165 -0
  38. package/dist/types/integrations.d.ts.map +1 -0
  39. package/dist/types/integrations.js +32 -0
  40. package/dist/types/integrations.js.map +1 -0
  41. package/dist/types/messages.d.ts +570 -0
  42. package/dist/types/messages.d.ts.map +1 -0
  43. package/dist/types/messages.js +68 -0
  44. package/dist/types/messages.js.map +1 -0
  45. package/dist/types/provider.d.ts +16 -0
  46. package/dist/types/provider.d.ts.map +1 -0
  47. package/dist/types/provider.js +7 -0
  48. package/dist/types/provider.js.map +1 -0
  49. package/dist/types/skills.d.ts +13 -0
  50. package/dist/types/skills.d.ts.map +1 -0
  51. package/dist/types/skills.js +6 -0
  52. package/dist/types/skills.js.map +1 -0
  53. package/dist/version-hash.d.ts +8 -0
  54. package/dist/version-hash.d.ts.map +1 -0
  55. package/dist/version-hash.js +23 -0
  56. package/dist/version-hash.js.map +1 -0
  57. package/dist/version.d.ts +2 -0
  58. package/dist/version.d.ts.map +1 -0
  59. package/dist/version.js +16 -0
  60. package/dist/version.js.map +1 -0
  61. package/package.json +39 -0
@@ -0,0 +1,570 @@
1
+ import { z } from "zod";
2
+ export declare const AuthenticateMessageSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"authenticate">;
4
+ token: z.ZodString;
5
+ protocolVersion: z.ZodNumber;
6
+ gatewayVersion: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: "authenticate";
9
+ token: string;
10
+ protocolVersion: number;
11
+ gatewayVersion: string;
12
+ }, {
13
+ type: "authenticate";
14
+ token: string;
15
+ protocolVersion: number;
16
+ gatewayVersion: string;
17
+ }>;
18
+ export type AuthenticateMessage = z.infer<typeof AuthenticateMessageSchema>;
19
+ export declare const RegisterMessageSchema: z.ZodObject<{
20
+ type: z.ZodLiteral<"register">;
21
+ integrations: z.ZodArray<z.ZodObject<{
22
+ id: z.ZodString;
23
+ name: z.ZodString;
24
+ description: z.ZodString;
25
+ tools: z.ZodArray<z.ZodObject<{
26
+ name: z.ZodString;
27
+ description: z.ZodString;
28
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ name: string;
31
+ description: string;
32
+ inputSchema: Record<string, unknown>;
33
+ }, {
34
+ name: string;
35
+ description: string;
36
+ inputSchema: Record<string, unknown>;
37
+ }>, "many">;
38
+ skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
+ id: z.ZodString;
40
+ content: z.ZodString;
41
+ }, "strip", z.ZodTypeAny, {
42
+ id: string;
43
+ content: string;
44
+ }, {
45
+ id: string;
46
+ content: string;
47
+ }>, "many">>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ id: string;
50
+ name: string;
51
+ description: string;
52
+ tools: {
53
+ name: string;
54
+ description: string;
55
+ inputSchema: Record<string, unknown>;
56
+ }[];
57
+ skills?: {
58
+ id: string;
59
+ content: string;
60
+ }[] | undefined;
61
+ }, {
62
+ id: string;
63
+ name: string;
64
+ description: string;
65
+ tools: {
66
+ name: string;
67
+ description: string;
68
+ inputSchema: Record<string, unknown>;
69
+ }[];
70
+ skills?: {
71
+ id: string;
72
+ content: string;
73
+ }[] | undefined;
74
+ }>, "many">;
75
+ }, "strip", z.ZodTypeAny, {
76
+ type: "register";
77
+ integrations: {
78
+ id: string;
79
+ name: string;
80
+ description: string;
81
+ tools: {
82
+ name: string;
83
+ description: string;
84
+ inputSchema: Record<string, unknown>;
85
+ }[];
86
+ skills?: {
87
+ id: string;
88
+ content: string;
89
+ }[] | undefined;
90
+ }[];
91
+ }, {
92
+ type: "register";
93
+ integrations: {
94
+ id: string;
95
+ name: string;
96
+ description: string;
97
+ tools: {
98
+ name: string;
99
+ description: string;
100
+ inputSchema: Record<string, unknown>;
101
+ }[];
102
+ skills?: {
103
+ id: string;
104
+ content: string;
105
+ }[] | undefined;
106
+ }[];
107
+ }>;
108
+ export type RegisterMessage = z.infer<typeof RegisterMessageSchema>;
109
+ export declare const ToolResultMessageSchema: z.ZodObject<{
110
+ type: z.ZodLiteral<"tool_result">;
111
+ requestId: z.ZodString;
112
+ result: z.ZodObject<{
113
+ content: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
114
+ type: z.ZodLiteral<"text">;
115
+ text: z.ZodString;
116
+ }, "strip", z.ZodTypeAny, {
117
+ type: "text";
118
+ text: string;
119
+ }, {
120
+ type: "text";
121
+ text: string;
122
+ }>, z.ZodObject<{
123
+ type: z.ZodLiteral<"image">;
124
+ data: z.ZodString;
125
+ mimeType: z.ZodString;
126
+ }, "strip", z.ZodTypeAny, {
127
+ type: "image";
128
+ data: string;
129
+ mimeType: string;
130
+ }, {
131
+ type: "image";
132
+ data: string;
133
+ mimeType: string;
134
+ }>]>, "many">;
135
+ isError: z.ZodOptional<z.ZodBoolean>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ content: ({
138
+ type: "text";
139
+ text: string;
140
+ } | {
141
+ type: "image";
142
+ data: string;
143
+ mimeType: string;
144
+ })[];
145
+ isError?: boolean | undefined;
146
+ }, {
147
+ content: ({
148
+ type: "text";
149
+ text: string;
150
+ } | {
151
+ type: "image";
152
+ data: string;
153
+ mimeType: string;
154
+ })[];
155
+ isError?: boolean | undefined;
156
+ }>;
157
+ }, "strip", z.ZodTypeAny, {
158
+ type: "tool_result";
159
+ requestId: string;
160
+ result: {
161
+ content: ({
162
+ type: "text";
163
+ text: string;
164
+ } | {
165
+ type: "image";
166
+ data: string;
167
+ mimeType: string;
168
+ })[];
169
+ isError?: boolean | undefined;
170
+ };
171
+ }, {
172
+ type: "tool_result";
173
+ requestId: string;
174
+ result: {
175
+ content: ({
176
+ type: "text";
177
+ text: string;
178
+ } | {
179
+ type: "image";
180
+ data: string;
181
+ mimeType: string;
182
+ })[];
183
+ isError?: boolean | undefined;
184
+ };
185
+ }>;
186
+ export type ToolResultMessage = z.infer<typeof ToolResultMessageSchema>;
187
+ export declare const ToolErrorMessageSchema: z.ZodObject<{
188
+ type: z.ZodLiteral<"tool_error">;
189
+ requestId: z.ZodString;
190
+ error: z.ZodObject<{
191
+ code: z.ZodEnum<["INTEGRATION_NOT_FOUND", "TOOL_NOT_FOUND", "EXECUTION_FAILED", "TIMEOUT"]>;
192
+ message: z.ZodString;
193
+ }, "strip", z.ZodTypeAny, {
194
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
195
+ message: string;
196
+ }, {
197
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
198
+ message: string;
199
+ }>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ type: "tool_error";
202
+ requestId: string;
203
+ error: {
204
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
205
+ message: string;
206
+ };
207
+ }, {
208
+ type: "tool_error";
209
+ requestId: string;
210
+ error: {
211
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
212
+ message: string;
213
+ };
214
+ }>;
215
+ export type ToolErrorMessage = z.infer<typeof ToolErrorMessageSchema>;
216
+ export declare const PongMessageSchema: z.ZodObject<{
217
+ type: z.ZodLiteral<"pong">;
218
+ }, "strip", z.ZodTypeAny, {
219
+ type: "pong";
220
+ }, {
221
+ type: "pong";
222
+ }>;
223
+ export type PongMessage = z.infer<typeof PongMessageSchema>;
224
+ export declare const GatewayMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
225
+ type: z.ZodLiteral<"authenticate">;
226
+ token: z.ZodString;
227
+ protocolVersion: z.ZodNumber;
228
+ gatewayVersion: z.ZodString;
229
+ }, "strip", z.ZodTypeAny, {
230
+ type: "authenticate";
231
+ token: string;
232
+ protocolVersion: number;
233
+ gatewayVersion: string;
234
+ }, {
235
+ type: "authenticate";
236
+ token: string;
237
+ protocolVersion: number;
238
+ gatewayVersion: string;
239
+ }>, z.ZodObject<{
240
+ type: z.ZodLiteral<"register">;
241
+ integrations: z.ZodArray<z.ZodObject<{
242
+ id: z.ZodString;
243
+ name: z.ZodString;
244
+ description: z.ZodString;
245
+ tools: z.ZodArray<z.ZodObject<{
246
+ name: z.ZodString;
247
+ description: z.ZodString;
248
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
249
+ }, "strip", z.ZodTypeAny, {
250
+ name: string;
251
+ description: string;
252
+ inputSchema: Record<string, unknown>;
253
+ }, {
254
+ name: string;
255
+ description: string;
256
+ inputSchema: Record<string, unknown>;
257
+ }>, "many">;
258
+ skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
259
+ id: z.ZodString;
260
+ content: z.ZodString;
261
+ }, "strip", z.ZodTypeAny, {
262
+ id: string;
263
+ content: string;
264
+ }, {
265
+ id: string;
266
+ content: string;
267
+ }>, "many">>;
268
+ }, "strip", z.ZodTypeAny, {
269
+ id: string;
270
+ name: string;
271
+ description: string;
272
+ tools: {
273
+ name: string;
274
+ description: string;
275
+ inputSchema: Record<string, unknown>;
276
+ }[];
277
+ skills?: {
278
+ id: string;
279
+ content: string;
280
+ }[] | undefined;
281
+ }, {
282
+ id: string;
283
+ name: string;
284
+ description: string;
285
+ tools: {
286
+ name: string;
287
+ description: string;
288
+ inputSchema: Record<string, unknown>;
289
+ }[];
290
+ skills?: {
291
+ id: string;
292
+ content: string;
293
+ }[] | undefined;
294
+ }>, "many">;
295
+ }, "strip", z.ZodTypeAny, {
296
+ type: "register";
297
+ integrations: {
298
+ id: string;
299
+ name: string;
300
+ description: string;
301
+ tools: {
302
+ name: string;
303
+ description: string;
304
+ inputSchema: Record<string, unknown>;
305
+ }[];
306
+ skills?: {
307
+ id: string;
308
+ content: string;
309
+ }[] | undefined;
310
+ }[];
311
+ }, {
312
+ type: "register";
313
+ integrations: {
314
+ id: string;
315
+ name: string;
316
+ description: string;
317
+ tools: {
318
+ name: string;
319
+ description: string;
320
+ inputSchema: Record<string, unknown>;
321
+ }[];
322
+ skills?: {
323
+ id: string;
324
+ content: string;
325
+ }[] | undefined;
326
+ }[];
327
+ }>, z.ZodObject<{
328
+ type: z.ZodLiteral<"tool_result">;
329
+ requestId: z.ZodString;
330
+ result: z.ZodObject<{
331
+ content: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
332
+ type: z.ZodLiteral<"text">;
333
+ text: z.ZodString;
334
+ }, "strip", z.ZodTypeAny, {
335
+ type: "text";
336
+ text: string;
337
+ }, {
338
+ type: "text";
339
+ text: string;
340
+ }>, z.ZodObject<{
341
+ type: z.ZodLiteral<"image">;
342
+ data: z.ZodString;
343
+ mimeType: z.ZodString;
344
+ }, "strip", z.ZodTypeAny, {
345
+ type: "image";
346
+ data: string;
347
+ mimeType: string;
348
+ }, {
349
+ type: "image";
350
+ data: string;
351
+ mimeType: string;
352
+ }>]>, "many">;
353
+ isError: z.ZodOptional<z.ZodBoolean>;
354
+ }, "strip", z.ZodTypeAny, {
355
+ content: ({
356
+ type: "text";
357
+ text: string;
358
+ } | {
359
+ type: "image";
360
+ data: string;
361
+ mimeType: string;
362
+ })[];
363
+ isError?: boolean | undefined;
364
+ }, {
365
+ content: ({
366
+ type: "text";
367
+ text: string;
368
+ } | {
369
+ type: "image";
370
+ data: string;
371
+ mimeType: string;
372
+ })[];
373
+ isError?: boolean | undefined;
374
+ }>;
375
+ }, "strip", z.ZodTypeAny, {
376
+ type: "tool_result";
377
+ requestId: string;
378
+ result: {
379
+ content: ({
380
+ type: "text";
381
+ text: string;
382
+ } | {
383
+ type: "image";
384
+ data: string;
385
+ mimeType: string;
386
+ })[];
387
+ isError?: boolean | undefined;
388
+ };
389
+ }, {
390
+ type: "tool_result";
391
+ requestId: string;
392
+ result: {
393
+ content: ({
394
+ type: "text";
395
+ text: string;
396
+ } | {
397
+ type: "image";
398
+ data: string;
399
+ mimeType: string;
400
+ })[];
401
+ isError?: boolean | undefined;
402
+ };
403
+ }>, z.ZodObject<{
404
+ type: z.ZodLiteral<"tool_error">;
405
+ requestId: z.ZodString;
406
+ error: z.ZodObject<{
407
+ code: z.ZodEnum<["INTEGRATION_NOT_FOUND", "TOOL_NOT_FOUND", "EXECUTION_FAILED", "TIMEOUT"]>;
408
+ message: z.ZodString;
409
+ }, "strip", z.ZodTypeAny, {
410
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
411
+ message: string;
412
+ }, {
413
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
414
+ message: string;
415
+ }>;
416
+ }, "strip", z.ZodTypeAny, {
417
+ type: "tool_error";
418
+ requestId: string;
419
+ error: {
420
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
421
+ message: string;
422
+ };
423
+ }, {
424
+ type: "tool_error";
425
+ requestId: string;
426
+ error: {
427
+ code: "INTEGRATION_NOT_FOUND" | "TOOL_NOT_FOUND" | "EXECUTION_FAILED" | "TIMEOUT";
428
+ message: string;
429
+ };
430
+ }>, z.ZodObject<{
431
+ type: z.ZodLiteral<"pong">;
432
+ }, "strip", z.ZodTypeAny, {
433
+ type: "pong";
434
+ }, {
435
+ type: "pong";
436
+ }>]>;
437
+ export type GatewayMessage = z.infer<typeof GatewayMessageSchema>;
438
+ export declare const AuthenticatedMessageSchema: z.ZodObject<{
439
+ type: z.ZodLiteral<"authenticated">;
440
+ organizationId: z.ZodString;
441
+ organizationName: z.ZodOptional<z.ZodString>;
442
+ }, "strip", z.ZodTypeAny, {
443
+ type: "authenticated";
444
+ organizationId: string;
445
+ organizationName?: string | undefined;
446
+ }, {
447
+ type: "authenticated";
448
+ organizationId: string;
449
+ organizationName?: string | undefined;
450
+ }>;
451
+ export type AuthenticatedMessage = z.infer<typeof AuthenticatedMessageSchema>;
452
+ export declare const AuthErrorMessageSchema: z.ZodObject<{
453
+ type: z.ZodLiteral<"auth_error">;
454
+ error: z.ZodString;
455
+ }, "strip", z.ZodTypeAny, {
456
+ type: "auth_error";
457
+ error: string;
458
+ }, {
459
+ type: "auth_error";
460
+ error: string;
461
+ }>;
462
+ export type AuthErrorMessage = z.infer<typeof AuthErrorMessageSchema>;
463
+ export declare const RegisteredMessageSchema: z.ZodObject<{
464
+ type: z.ZodLiteral<"registered">;
465
+ integrationCount: z.ZodNumber;
466
+ toolCount: z.ZodNumber;
467
+ skillCount: z.ZodOptional<z.ZodNumber>;
468
+ }, "strip", z.ZodTypeAny, {
469
+ type: "registered";
470
+ integrationCount: number;
471
+ toolCount: number;
472
+ skillCount?: number | undefined;
473
+ }, {
474
+ type: "registered";
475
+ integrationCount: number;
476
+ toolCount: number;
477
+ skillCount?: number | undefined;
478
+ }>;
479
+ export type RegisteredMessage = z.infer<typeof RegisteredMessageSchema>;
480
+ export declare const ToolCallMessageSchema: z.ZodObject<{
481
+ type: z.ZodLiteral<"tool_call">;
482
+ requestId: z.ZodString;
483
+ integrationId: z.ZodString;
484
+ toolName: z.ZodString;
485
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
486
+ }, "strip", z.ZodTypeAny, {
487
+ type: "tool_call";
488
+ requestId: string;
489
+ integrationId: string;
490
+ toolName: string;
491
+ arguments: Record<string, unknown>;
492
+ }, {
493
+ type: "tool_call";
494
+ requestId: string;
495
+ integrationId: string;
496
+ toolName: string;
497
+ arguments: Record<string, unknown>;
498
+ }>;
499
+ export type ToolCallMessage = z.infer<typeof ToolCallMessageSchema>;
500
+ export declare const PingMessageSchema: z.ZodObject<{
501
+ type: z.ZodLiteral<"ping">;
502
+ }, "strip", z.ZodTypeAny, {
503
+ type: "ping";
504
+ }, {
505
+ type: "ping";
506
+ }>;
507
+ export type PingMessage = z.infer<typeof PingMessageSchema>;
508
+ export declare const ServiceMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
509
+ type: z.ZodLiteral<"authenticated">;
510
+ organizationId: z.ZodString;
511
+ organizationName: z.ZodOptional<z.ZodString>;
512
+ }, "strip", z.ZodTypeAny, {
513
+ type: "authenticated";
514
+ organizationId: string;
515
+ organizationName?: string | undefined;
516
+ }, {
517
+ type: "authenticated";
518
+ organizationId: string;
519
+ organizationName?: string | undefined;
520
+ }>, z.ZodObject<{
521
+ type: z.ZodLiteral<"auth_error">;
522
+ error: z.ZodString;
523
+ }, "strip", z.ZodTypeAny, {
524
+ type: "auth_error";
525
+ error: string;
526
+ }, {
527
+ type: "auth_error";
528
+ error: string;
529
+ }>, z.ZodObject<{
530
+ type: z.ZodLiteral<"registered">;
531
+ integrationCount: z.ZodNumber;
532
+ toolCount: z.ZodNumber;
533
+ skillCount: z.ZodOptional<z.ZodNumber>;
534
+ }, "strip", z.ZodTypeAny, {
535
+ type: "registered";
536
+ integrationCount: number;
537
+ toolCount: number;
538
+ skillCount?: number | undefined;
539
+ }, {
540
+ type: "registered";
541
+ integrationCount: number;
542
+ toolCount: number;
543
+ skillCount?: number | undefined;
544
+ }>, z.ZodObject<{
545
+ type: z.ZodLiteral<"tool_call">;
546
+ requestId: z.ZodString;
547
+ integrationId: z.ZodString;
548
+ toolName: z.ZodString;
549
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ type: "tool_call";
552
+ requestId: string;
553
+ integrationId: string;
554
+ toolName: string;
555
+ arguments: Record<string, unknown>;
556
+ }, {
557
+ type: "tool_call";
558
+ requestId: string;
559
+ integrationId: string;
560
+ toolName: string;
561
+ arguments: Record<string, unknown>;
562
+ }>, z.ZodObject<{
563
+ type: z.ZodLiteral<"ping">;
564
+ }, "strip", z.ZodTypeAny, {
565
+ type: "ping";
566
+ }, {
567
+ type: "ping";
568
+ }>]>;
569
+ export type ServiceMessage = z.infer<typeof ServiceMessageSchema>;
570
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/types/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE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AE9E,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAM/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { z } from "zod";
2
+ import { GatewayErrorSchema } from "./errors.js";
3
+ import { IntegrationSchema, ToolResultSchema } from "./integrations.js";
4
+ // --- Gateway → Service messages ---
5
+ export const AuthenticateMessageSchema = z.object({
6
+ type: z.literal("authenticate"),
7
+ token: z.string(),
8
+ protocolVersion: z.number(),
9
+ gatewayVersion: z.string(),
10
+ });
11
+ export const RegisterMessageSchema = z.object({
12
+ type: z.literal("register"),
13
+ integrations: z.array(IntegrationSchema),
14
+ });
15
+ export const ToolResultMessageSchema = z.object({
16
+ type: z.literal("tool_result"),
17
+ requestId: z.string(),
18
+ result: ToolResultSchema,
19
+ });
20
+ export const ToolErrorMessageSchema = z.object({
21
+ type: z.literal("tool_error"),
22
+ requestId: z.string(),
23
+ error: GatewayErrorSchema,
24
+ });
25
+ export const PongMessageSchema = z.object({
26
+ type: z.literal("pong"),
27
+ });
28
+ export const GatewayMessageSchema = z.discriminatedUnion("type", [
29
+ AuthenticateMessageSchema,
30
+ RegisterMessageSchema,
31
+ ToolResultMessageSchema,
32
+ ToolErrorMessageSchema,
33
+ PongMessageSchema,
34
+ ]);
35
+ // --- Service → Gateway messages ---
36
+ export const AuthenticatedMessageSchema = z.object({
37
+ type: z.literal("authenticated"),
38
+ organizationId: z.string(),
39
+ organizationName: z.string().optional(),
40
+ });
41
+ export const AuthErrorMessageSchema = z.object({
42
+ type: z.literal("auth_error"),
43
+ error: z.string(),
44
+ });
45
+ export const RegisteredMessageSchema = z.object({
46
+ type: z.literal("registered"),
47
+ integrationCount: z.number(),
48
+ toolCount: z.number(),
49
+ skillCount: z.number().optional(),
50
+ });
51
+ export const ToolCallMessageSchema = z.object({
52
+ type: z.literal("tool_call"),
53
+ requestId: z.string(),
54
+ integrationId: z.string(),
55
+ toolName: z.string(),
56
+ arguments: z.record(z.unknown()),
57
+ });
58
+ export const PingMessageSchema = z.object({
59
+ type: z.literal("ping"),
60
+ });
61
+ export const ServiceMessageSchema = z.discriminatedUnion("type", [
62
+ AuthenticatedMessageSchema,
63
+ AuthErrorMessageSchema,
64
+ RegisteredMessageSchema,
65
+ ToolCallMessageSchema,
66
+ PingMessageSchema,
67
+ ]);
68
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/types/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAExE,qCAAqC;AAErC,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC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+1,16 @@
1
+ import type { Integration, ToolResult } from "./integrations.js";
2
+ export interface IntegrationProvider {
3
+ getRegistrations(): Promise<Integration[]>;
4
+ callTool(integrationId: string, toolName: string, args: Record<string, unknown>): Promise<ToolResult>;
5
+ start(): Promise<void>;
6
+ stop(): Promise<void>;
7
+ }
8
+ export declare class IntegrationNotFoundError extends Error {
9
+ constructor(integrationId: string, detail?: string);
10
+ }
11
+ export interface GatewayConfig {
12
+ token: string;
13
+ url: string;
14
+ logLevel: "debug" | "info" | "warn" | "error";
15
+ }
16
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/types/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAInD;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC/C"}
@@ -0,0 +1,7 @@
1
+ export class IntegrationNotFoundError extends Error {
2
+ constructor(integrationId, detail) {
3
+ super(detail ?? `Integration "${integrationId}" is not registered`);
4
+ this.name = "IntegrationNotFoundError";
5
+ }
6
+ }
7
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/types/provider.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,YAAY,aAAqB,EAAE,MAAe;QAChD,KAAK,CAAC,MAAM,IAAI,gBAAgB,aAAa,qBAAqB,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ export declare const SkillSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ content: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ id: string;
7
+ content: string;
8
+ }, {
9
+ id: string;
10
+ content: string;
11
+ }>;
12
+ export type Skill = z.infer<typeof SkillSchema>;
13
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/types/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW;;;;;;;;;EAGtB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}