@slates/client 1.0.0-rc.2

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,764 @@
1
+ import { SlatesProtocolVersion, SlatesParticipant, SlatesNotifications, SlatesRequests, SlatesResponses, slatesRequestsByMethod, slatesResponsesByMethod, SlatesAction, SlateAuthenticationMethod } from '@slates/proto';
2
+ import z from 'zod';
3
+ import { Slate, SlateLogListener } from '@slates/provider';
4
+
5
+ type SlatesJsonObject = Record<string, any>;
6
+ type SlatesProtocolMessage = SlatesNotifications | SlatesRequests;
7
+ type SlatesProtocolResponse = SlatesNotifications | SlatesResponses;
8
+ interface SlatesClientState {
9
+ protocol: SlatesProtocolVersion;
10
+ participants: SlatesParticipant[];
11
+ config: SlatesJsonObject | null;
12
+ auth: {
13
+ authenticationMethodId: string;
14
+ output: SlatesJsonObject;
15
+ } | null;
16
+ session: {
17
+ id: string;
18
+ state: SlatesJsonObject;
19
+ } | null;
20
+ }
21
+ interface SlatesMessageTransport {
22
+ send(messages: SlatesProtocolMessage[]): Promise<SlatesProtocolResponse[]>;
23
+ close?(): Promise<void> | void;
24
+ }
25
+ interface SlatesProtocolClientOptions {
26
+ transport: SlatesMessageTransport;
27
+ participants?: SlatesParticipant[];
28
+ state?: Partial<SlatesClientState>;
29
+ }
30
+
31
+ declare class SlatesProtocolClient {
32
+ readonly transport: SlatesProtocolClientOptions['transport'];
33
+ state: SlatesClientState;
34
+ constructor(opts: SlatesProtocolClientOptions);
35
+ setParticipants(participants: SlatesParticipant[]): this;
36
+ setConfig(config: Record<string, any> | null): this;
37
+ setAuth(auth: SlatesClientState['auth']): this;
38
+ clearAuth(): this;
39
+ setSession(session: SlatesClientState['session']): this;
40
+ ensureSession(): {
41
+ id: string;
42
+ state: SlatesJsonObject;
43
+ };
44
+ private buildStateMessages;
45
+ request<Key extends keyof typeof slatesRequestsByMethod>(method: Key, params: z.infer<(typeof slatesRequestsByMethod)[Key]>['params']): Promise<z.infer<(typeof slatesResponsesByMethod)[Key]>['result']>;
46
+ identify(): Promise<{
47
+ protocol: "slates@2026-01-01";
48
+ provider: {
49
+ type: "provider";
50
+ id: string;
51
+ name: string;
52
+ description?: string | undefined;
53
+ metadata?: Record<string, any> | undefined;
54
+ };
55
+ }>;
56
+ listActions(): Promise<{
57
+ actions: ({
58
+ id: string;
59
+ name: string;
60
+ inputSchema: Record<string, any>;
61
+ outputSchema: Record<string, any>;
62
+ type: "action.tool";
63
+ capabilities: Record<string, never>;
64
+ description?: string | undefined;
65
+ instructions?: string[] | undefined;
66
+ constraints?: string[] | undefined;
67
+ tags?: {
68
+ destructive?: boolean | undefined;
69
+ readOnly?: boolean | undefined;
70
+ } | undefined;
71
+ metadata?: Record<string, any> | undefined;
72
+ scopes?: {
73
+ AND: {
74
+ OR: string[];
75
+ }[];
76
+ } | undefined;
77
+ } | {
78
+ id: string;
79
+ name: string;
80
+ inputSchema: Record<string, any>;
81
+ outputSchema: Record<string, any>;
82
+ type: "action.trigger";
83
+ capabilities: Record<string, never>;
84
+ invocation: {
85
+ type: "polling";
86
+ intervalSeconds: number;
87
+ } | {
88
+ type: "webhook";
89
+ autoRegistration: boolean;
90
+ autoUnregistration: boolean;
91
+ };
92
+ description?: string | undefined;
93
+ instructions?: string[] | undefined;
94
+ constraints?: string[] | undefined;
95
+ tags?: {
96
+ destructive?: boolean | undefined;
97
+ readOnly?: boolean | undefined;
98
+ } | undefined;
99
+ metadata?: Record<string, any> | undefined;
100
+ scopes?: {
101
+ AND: {
102
+ OR: string[];
103
+ }[];
104
+ } | undefined;
105
+ })[];
106
+ }>;
107
+ listTools(): Promise<SlatesAction[]>;
108
+ listTriggers(): Promise<SlatesAction[]>;
109
+ getAction(actionId: string): Promise<{
110
+ action: {
111
+ id: string;
112
+ name: string;
113
+ inputSchema: Record<string, any>;
114
+ outputSchema: Record<string, any>;
115
+ type: "action.tool";
116
+ capabilities: Record<string, never>;
117
+ description?: string | undefined;
118
+ instructions?: string[] | undefined;
119
+ constraints?: string[] | undefined;
120
+ tags?: {
121
+ destructive?: boolean | undefined;
122
+ readOnly?: boolean | undefined;
123
+ } | undefined;
124
+ metadata?: Record<string, any> | undefined;
125
+ scopes?: {
126
+ AND: {
127
+ OR: string[];
128
+ }[];
129
+ } | undefined;
130
+ } | {
131
+ id: string;
132
+ name: string;
133
+ inputSchema: Record<string, any>;
134
+ outputSchema: Record<string, any>;
135
+ type: "action.trigger";
136
+ capabilities: Record<string, never>;
137
+ invocation: {
138
+ type: "polling";
139
+ intervalSeconds: number;
140
+ } | {
141
+ type: "webhook";
142
+ autoRegistration: boolean;
143
+ autoUnregistration: boolean;
144
+ };
145
+ description?: string | undefined;
146
+ instructions?: string[] | undefined;
147
+ constraints?: string[] | undefined;
148
+ tags?: {
149
+ destructive?: boolean | undefined;
150
+ readOnly?: boolean | undefined;
151
+ } | undefined;
152
+ metadata?: Record<string, any> | undefined;
153
+ scopes?: {
154
+ AND: {
155
+ OR: string[];
156
+ }[];
157
+ } | undefined;
158
+ };
159
+ }>;
160
+ getTool(actionId: string): Promise<{
161
+ id: string;
162
+ name: string;
163
+ inputSchema: Record<string, any>;
164
+ outputSchema: Record<string, any>;
165
+ type: "action.tool";
166
+ capabilities: Record<string, never>;
167
+ description?: string | undefined;
168
+ instructions?: string[] | undefined;
169
+ constraints?: string[] | undefined;
170
+ tags?: {
171
+ destructive?: boolean | undefined;
172
+ readOnly?: boolean | undefined;
173
+ } | undefined;
174
+ metadata?: Record<string, any> | undefined;
175
+ scopes?: {
176
+ AND: {
177
+ OR: string[];
178
+ }[];
179
+ } | undefined;
180
+ }>;
181
+ getTrigger(actionId: string): Promise<{
182
+ id: string;
183
+ name: string;
184
+ inputSchema: Record<string, any>;
185
+ outputSchema: Record<string, any>;
186
+ type: "action.trigger";
187
+ capabilities: Record<string, never>;
188
+ invocation: {
189
+ type: "polling";
190
+ intervalSeconds: number;
191
+ } | {
192
+ type: "webhook";
193
+ autoRegistration: boolean;
194
+ autoUnregistration: boolean;
195
+ };
196
+ description?: string | undefined;
197
+ instructions?: string[] | undefined;
198
+ constraints?: string[] | undefined;
199
+ tags?: {
200
+ destructive?: boolean | undefined;
201
+ readOnly?: boolean | undefined;
202
+ } | undefined;
203
+ metadata?: Record<string, any> | undefined;
204
+ scopes?: {
205
+ AND: {
206
+ OR: string[];
207
+ }[];
208
+ } | undefined;
209
+ }>;
210
+ getConfigSchema(): Promise<{
211
+ schema: Record<string, any>;
212
+ }>;
213
+ getDefaultConfig(): Promise<{
214
+ config: Record<string, any> | null;
215
+ requestTraces?: {
216
+ startedAt: string;
217
+ durationMs: number;
218
+ request: {
219
+ method: string;
220
+ url: string;
221
+ headers?: Record<string, string> | undefined;
222
+ body?: {
223
+ text: string;
224
+ contentType?: string | undefined;
225
+ truncated?: boolean | undefined;
226
+ } | undefined;
227
+ };
228
+ response?: {
229
+ status: number;
230
+ statusText?: string | undefined;
231
+ headers?: Record<string, string> | undefined;
232
+ body?: {
233
+ text: string;
234
+ contentType?: string | undefined;
235
+ truncated?: boolean | undefined;
236
+ } | undefined;
237
+ } | undefined;
238
+ error?: {
239
+ message: string;
240
+ code?: string | undefined;
241
+ } | undefined;
242
+ }[] | undefined;
243
+ }>;
244
+ updateConfig(previousConfig: Record<string, any> | null, newConfig: Record<string, any>): Promise<{
245
+ success: boolean;
246
+ config?: Record<string, any> | undefined;
247
+ errors?: {
248
+ code: string;
249
+ message: string;
250
+ path?: string[] | undefined;
251
+ }[] | undefined;
252
+ requestTraces?: {
253
+ startedAt: string;
254
+ durationMs: number;
255
+ request: {
256
+ method: string;
257
+ url: string;
258
+ headers?: Record<string, string> | undefined;
259
+ body?: {
260
+ text: string;
261
+ contentType?: string | undefined;
262
+ truncated?: boolean | undefined;
263
+ } | undefined;
264
+ };
265
+ response?: {
266
+ status: number;
267
+ statusText?: string | undefined;
268
+ headers?: Record<string, string> | undefined;
269
+ body?: {
270
+ text: string;
271
+ contentType?: string | undefined;
272
+ truncated?: boolean | undefined;
273
+ } | undefined;
274
+ } | undefined;
275
+ error?: {
276
+ message: string;
277
+ code?: string | undefined;
278
+ } | undefined;
279
+ }[] | undefined;
280
+ }>;
281
+ listAuthMethods(): Promise<{
282
+ authenticationMethods: SlateAuthenticationMethod[];
283
+ }>;
284
+ getAuthMethod(authenticationMethodId: string): Promise<{
285
+ authenticationMethod: {
286
+ id: string;
287
+ name: string;
288
+ type: "auth.oauth" | "auth.token" | "auth.service_account" | "auth.custom";
289
+ inputSchema: Record<string, any>;
290
+ outputSchema: Record<string, any>;
291
+ capabilities: {
292
+ getDefaultInput?: {
293
+ enabled: boolean;
294
+ } | undefined;
295
+ handleChangedInput?: {
296
+ enabled: boolean;
297
+ } | undefined;
298
+ handleTokenRefresh?: {
299
+ enabled: boolean;
300
+ } | undefined;
301
+ getProfile?: {
302
+ enabled: boolean;
303
+ } | undefined;
304
+ };
305
+ scopes?: {
306
+ id: string;
307
+ title: string;
308
+ description?: string | undefined;
309
+ }[] | undefined;
310
+ };
311
+ }>;
312
+ getDefaultAuthInput(authenticationMethodId: string): Promise<{
313
+ input: Record<string, any>;
314
+ requestTraces?: {
315
+ startedAt: string;
316
+ durationMs: number;
317
+ request: {
318
+ method: string;
319
+ url: string;
320
+ headers?: Record<string, string> | undefined;
321
+ body?: {
322
+ text: string;
323
+ contentType?: string | undefined;
324
+ truncated?: boolean | undefined;
325
+ } | undefined;
326
+ };
327
+ response?: {
328
+ status: number;
329
+ statusText?: string | undefined;
330
+ headers?: Record<string, string> | undefined;
331
+ body?: {
332
+ text: string;
333
+ contentType?: string | undefined;
334
+ truncated?: boolean | undefined;
335
+ } | undefined;
336
+ } | undefined;
337
+ error?: {
338
+ message: string;
339
+ code?: string | undefined;
340
+ } | undefined;
341
+ }[] | undefined;
342
+ }>;
343
+ updateAuthInput(d: {
344
+ authenticationMethodId: string;
345
+ previousInput: Record<string, any> | null;
346
+ newInput: Record<string, any>;
347
+ }): Promise<{
348
+ input?: Record<string, any> | undefined;
349
+ requestTraces?: {
350
+ startedAt: string;
351
+ durationMs: number;
352
+ request: {
353
+ method: string;
354
+ url: string;
355
+ headers?: Record<string, string> | undefined;
356
+ body?: {
357
+ text: string;
358
+ contentType?: string | undefined;
359
+ truncated?: boolean | undefined;
360
+ } | undefined;
361
+ };
362
+ response?: {
363
+ status: number;
364
+ statusText?: string | undefined;
365
+ headers?: Record<string, string> | undefined;
366
+ body?: {
367
+ text: string;
368
+ contentType?: string | undefined;
369
+ truncated?: boolean | undefined;
370
+ } | undefined;
371
+ } | undefined;
372
+ error?: {
373
+ message: string;
374
+ code?: string | undefined;
375
+ } | undefined;
376
+ }[] | undefined;
377
+ }>;
378
+ getAuthOutput(d: {
379
+ authenticationMethodId: string;
380
+ input: Record<string, any>;
381
+ }): Promise<{
382
+ output: Record<string, any>;
383
+ requestTraces?: {
384
+ startedAt: string;
385
+ durationMs: number;
386
+ request: {
387
+ method: string;
388
+ url: string;
389
+ headers?: Record<string, string> | undefined;
390
+ body?: {
391
+ text: string;
392
+ contentType?: string | undefined;
393
+ truncated?: boolean | undefined;
394
+ } | undefined;
395
+ };
396
+ response?: {
397
+ status: number;
398
+ statusText?: string | undefined;
399
+ headers?: Record<string, string> | undefined;
400
+ body?: {
401
+ text: string;
402
+ contentType?: string | undefined;
403
+ truncated?: boolean | undefined;
404
+ } | undefined;
405
+ } | undefined;
406
+ error?: {
407
+ message: string;
408
+ code?: string | undefined;
409
+ } | undefined;
410
+ }[] | undefined;
411
+ }>;
412
+ getAuthorizationUrl(d: {
413
+ authenticationMethodId: string;
414
+ redirectUri: string;
415
+ state: string;
416
+ input: Record<string, any>;
417
+ clientId: string;
418
+ clientSecret: string;
419
+ scopes: string[];
420
+ }): Promise<{
421
+ authorizationUrl: string;
422
+ input?: Record<string, any> | undefined;
423
+ callbackState?: Record<string, any> | undefined;
424
+ requestTraces?: {
425
+ startedAt: string;
426
+ durationMs: number;
427
+ request: {
428
+ method: string;
429
+ url: string;
430
+ headers?: Record<string, string> | undefined;
431
+ body?: {
432
+ text: string;
433
+ contentType?: string | undefined;
434
+ truncated?: boolean | undefined;
435
+ } | undefined;
436
+ };
437
+ response?: {
438
+ status: number;
439
+ statusText?: string | undefined;
440
+ headers?: Record<string, string> | undefined;
441
+ body?: {
442
+ text: string;
443
+ contentType?: string | undefined;
444
+ truncated?: boolean | undefined;
445
+ } | undefined;
446
+ } | undefined;
447
+ error?: {
448
+ message: string;
449
+ code?: string | undefined;
450
+ } | undefined;
451
+ }[] | undefined;
452
+ }>;
453
+ handleAuthorizationCallback(d: {
454
+ authenticationMethodId: string;
455
+ code: string;
456
+ state: string;
457
+ redirectUri: string;
458
+ input: Record<string, any>;
459
+ clientId: string;
460
+ clientSecret: string;
461
+ scopes: string[];
462
+ callbackState?: Record<string, any>;
463
+ }): Promise<{
464
+ output: Record<string, any>;
465
+ input?: Record<string, any>;
466
+ scopes?: string[];
467
+ }>;
468
+ refreshToken(d: {
469
+ authenticationMethodId: string;
470
+ output: Record<string, any>;
471
+ input: Record<string, any>;
472
+ clientId: string;
473
+ clientSecret: string;
474
+ scopes: string[];
475
+ }): Promise<{
476
+ output: Record<string, any>;
477
+ input?: Record<string, any> | undefined;
478
+ requestTraces?: {
479
+ startedAt: string;
480
+ durationMs: number;
481
+ request: {
482
+ method: string;
483
+ url: string;
484
+ headers?: Record<string, string> | undefined;
485
+ body?: {
486
+ text: string;
487
+ contentType?: string | undefined;
488
+ truncated?: boolean | undefined;
489
+ } | undefined;
490
+ };
491
+ response?: {
492
+ status: number;
493
+ statusText?: string | undefined;
494
+ headers?: Record<string, string> | undefined;
495
+ body?: {
496
+ text: string;
497
+ contentType?: string | undefined;
498
+ truncated?: boolean | undefined;
499
+ } | undefined;
500
+ } | undefined;
501
+ error?: {
502
+ message: string;
503
+ code?: string | undefined;
504
+ } | undefined;
505
+ }[] | undefined;
506
+ }>;
507
+ getAuthProfile(d: {
508
+ authenticationMethodId: string;
509
+ output: Record<string, any>;
510
+ input: Record<string, any>;
511
+ scopes: string[];
512
+ }): Promise<{
513
+ profile: Record<string, any>;
514
+ requestTraces?: {
515
+ startedAt: string;
516
+ durationMs: number;
517
+ request: {
518
+ method: string;
519
+ url: string;
520
+ headers?: Record<string, string> | undefined;
521
+ body?: {
522
+ text: string;
523
+ contentType?: string | undefined;
524
+ truncated?: boolean | undefined;
525
+ } | undefined;
526
+ };
527
+ response?: {
528
+ status: number;
529
+ statusText?: string | undefined;
530
+ headers?: Record<string, string> | undefined;
531
+ body?: {
532
+ text: string;
533
+ contentType?: string | undefined;
534
+ truncated?: boolean | undefined;
535
+ } | undefined;
536
+ } | undefined;
537
+ error?: {
538
+ message: string;
539
+ code?: string | undefined;
540
+ } | undefined;
541
+ }[] | undefined;
542
+ }>;
543
+ invokeTool(actionId: string, input: Record<string, any>): Promise<{
544
+ output: Record<string, any>;
545
+ message?: string | undefined;
546
+ requestTraces?: {
547
+ startedAt: string;
548
+ durationMs: number;
549
+ request: {
550
+ method: string;
551
+ url: string;
552
+ headers?: Record<string, string> | undefined;
553
+ body?: {
554
+ text: string;
555
+ contentType?: string | undefined;
556
+ truncated?: boolean | undefined;
557
+ } | undefined;
558
+ };
559
+ response?: {
560
+ status: number;
561
+ statusText?: string | undefined;
562
+ headers?: Record<string, string> | undefined;
563
+ body?: {
564
+ text: string;
565
+ contentType?: string | undefined;
566
+ truncated?: boolean | undefined;
567
+ } | undefined;
568
+ } | undefined;
569
+ error?: {
570
+ message: string;
571
+ code?: string | undefined;
572
+ } | undefined;
573
+ }[] | undefined;
574
+ }>;
575
+ mapTriggerEvent(actionId: string, input: Record<string, any>): Promise<{
576
+ type: string;
577
+ id: string;
578
+ output: Record<string, any>;
579
+ requestTraces?: {
580
+ startedAt: string;
581
+ durationMs: number;
582
+ request: {
583
+ method: string;
584
+ url: string;
585
+ headers?: Record<string, string> | undefined;
586
+ body?: {
587
+ text: string;
588
+ contentType?: string | undefined;
589
+ truncated?: boolean | undefined;
590
+ } | undefined;
591
+ };
592
+ response?: {
593
+ status: number;
594
+ statusText?: string | undefined;
595
+ headers?: Record<string, string> | undefined;
596
+ body?: {
597
+ text: string;
598
+ contentType?: string | undefined;
599
+ truncated?: boolean | undefined;
600
+ } | undefined;
601
+ } | undefined;
602
+ error?: {
603
+ message: string;
604
+ code?: string | undefined;
605
+ } | undefined;
606
+ }[] | undefined;
607
+ }>;
608
+ registerTriggerWebhook(actionId: string, webhookBaseUrl: string): Promise<{
609
+ registrationDetails: any;
610
+ state?: any;
611
+ requestTraces?: {
612
+ startedAt: string;
613
+ durationMs: number;
614
+ request: {
615
+ method: string;
616
+ url: string;
617
+ headers?: Record<string, string> | undefined;
618
+ body?: {
619
+ text: string;
620
+ contentType?: string | undefined;
621
+ truncated?: boolean | undefined;
622
+ } | undefined;
623
+ };
624
+ response?: {
625
+ status: number;
626
+ statusText?: string | undefined;
627
+ headers?: Record<string, string> | undefined;
628
+ body?: {
629
+ text: string;
630
+ contentType?: string | undefined;
631
+ truncated?: boolean | undefined;
632
+ } | undefined;
633
+ } | undefined;
634
+ error?: {
635
+ message: string;
636
+ code?: string | undefined;
637
+ } | undefined;
638
+ }[] | undefined;
639
+ }>;
640
+ handleTriggerWebhook(d: {
641
+ actionId: string;
642
+ url: string;
643
+ method: string;
644
+ headers?: Record<string, string>;
645
+ body?: string | Uint8Array | null;
646
+ state?: any;
647
+ }): Promise<{
648
+ inputs: Record<string, any>[];
649
+ updatedState?: any;
650
+ requestTraces?: {
651
+ startedAt: string;
652
+ durationMs: number;
653
+ request: {
654
+ method: string;
655
+ url: string;
656
+ headers?: Record<string, string> | undefined;
657
+ body?: {
658
+ text: string;
659
+ contentType?: string | undefined;
660
+ truncated?: boolean | undefined;
661
+ } | undefined;
662
+ };
663
+ response?: {
664
+ status: number;
665
+ statusText?: string | undefined;
666
+ headers?: Record<string, string> | undefined;
667
+ body?: {
668
+ text: string;
669
+ contentType?: string | undefined;
670
+ truncated?: boolean | undefined;
671
+ } | undefined;
672
+ } | undefined;
673
+ error?: {
674
+ message: string;
675
+ code?: string | undefined;
676
+ } | undefined;
677
+ }[] | undefined;
678
+ }>;
679
+ unregisterTriggerWebhook(d: {
680
+ actionId: string;
681
+ webhookBaseUrl: string;
682
+ registrationDetails: any;
683
+ state?: any;
684
+ }): Promise<{
685
+ requestTraces?: {
686
+ startedAt: string;
687
+ durationMs: number;
688
+ request: {
689
+ method: string;
690
+ url: string;
691
+ headers?: Record<string, string> | undefined;
692
+ body?: {
693
+ text: string;
694
+ contentType?: string | undefined;
695
+ truncated?: boolean | undefined;
696
+ } | undefined;
697
+ };
698
+ response?: {
699
+ status: number;
700
+ statusText?: string | undefined;
701
+ headers?: Record<string, string> | undefined;
702
+ body?: {
703
+ text: string;
704
+ contentType?: string | undefined;
705
+ truncated?: boolean | undefined;
706
+ } | undefined;
707
+ } | undefined;
708
+ error?: {
709
+ message: string;
710
+ code?: string | undefined;
711
+ } | undefined;
712
+ }[] | undefined;
713
+ }>;
714
+ close(): Promise<void>;
715
+ }
716
+
717
+ type SlateProtocolErrorSource = 'provider' | 'transport';
718
+ type SlateProtocolErrorKind = 'declaration' | 'validation' | 'request' | 'auth' | 'config' | 'resource' | 'payment' | 'upstream' | 'transport' | 'internal';
719
+ interface SlateProtocolErrorResponse {
720
+ code: string;
721
+ message: string;
722
+ kind: SlateProtocolErrorKind;
723
+ retryable?: boolean;
724
+ status?: number;
725
+ issues?: Array<Record<string, unknown>>;
726
+ provider?: Record<string, unknown>;
727
+ upstream?: Record<string, unknown>;
728
+ baggage?: Record<string, unknown>;
729
+ [key: string]: unknown;
730
+ }
731
+ declare class SlateProtocolError extends Error {
732
+ cause?: unknown;
733
+ data: SlateProtocolErrorResponse;
734
+ source: SlateProtocolErrorSource;
735
+ constructor(data: SlateProtocolErrorResponse, source?: SlateProtocolErrorSource, cause?: unknown);
736
+ get code(): string;
737
+ get kind(): SlateProtocolErrorKind;
738
+ get retryable(): boolean | undefined;
739
+ get status(): number | undefined;
740
+ toJSON(): {
741
+ source: SlateProtocolErrorSource;
742
+ code: string;
743
+ message: string;
744
+ kind: SlateProtocolErrorKind;
745
+ retryable?: boolean;
746
+ status?: number;
747
+ issues?: Array<Record<string, unknown>>;
748
+ provider?: Record<string, unknown>;
749
+ upstream?: Record<string, unknown>;
750
+ baggage?: Record<string, unknown>;
751
+ };
752
+ static is(error: unknown): error is SlateProtocolError;
753
+ static fromResponse(error: unknown, source?: SlateProtocolErrorSource): SlateProtocolError;
754
+ static fromUnknown(error: unknown, defaults?: Partial<SlateProtocolErrorResponse>, source?: SlateProtocolErrorSource): SlateProtocolError;
755
+ }
756
+
757
+ declare let createLocalSlateTransport: <ConfigType extends {}, AuthType extends {}>(d: {
758
+ slate: Slate<ConfigType, AuthType>;
759
+ listeners?: SlateLogListener[];
760
+ }) => SlatesMessageTransport;
761
+
762
+ declare let createSlatesClient: (opts: SlatesProtocolClientOptions) => SlatesProtocolClient;
763
+
764
+ export { SlateProtocolError, type SlateProtocolErrorKind, type SlateProtocolErrorResponse, type SlateProtocolErrorSource, type SlatesClientState, type SlatesJsonObject, type SlatesMessageTransport, SlatesProtocolClient, type SlatesProtocolClientOptions, type SlatesProtocolMessage, type SlatesProtocolResponse, createLocalSlateTransport, createSlatesClient };