@caitlyn-ai/sdk 0.0.0-stage → 0.0.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.
Files changed (45) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +164 -2
  4. package/dist-browser/sdk/index.mjs +1923 -0
  5. package/dist-browser/sdk/index.mjs.map +7 -0
  6. package/dist-cjs/sdk/index.cjs +1974 -0
  7. package/dist-cjs/sdk/index.cjs.map +7 -0
  8. package/dist-es/sdk/index.mjs +1925 -0
  9. package/dist-es/sdk/index.mjs.map +7 -0
  10. package/dist-types/Caitlyn.d.ts +76 -0
  11. package/dist-types/CaitlynClient.d.ts +160 -0
  12. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  13. package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
  14. package/dist-types/commandBuilder.d.ts +18 -0
  15. package/dist-types/commands/CreateDocumentCommand.d.ts +190 -0
  16. package/dist-types/commands/CreateUploadCommand.d.ts +165 -0
  17. package/dist-types/commands/GetAgentVersionCommand.d.ts +177 -0
  18. package/dist-types/commands/ListDocumentsCommand.d.ts +176 -0
  19. package/dist-types/commands/ResumeConversationStreamCommand.d.ts +146 -0
  20. package/dist-types/commands/SendMessageCommand.d.ts +183 -0
  21. package/dist-types/commands/UpdateDraftVersionCommand.d.ts +202 -0
  22. package/dist-types/commands/index.d.ts +7 -0
  23. package/dist-types/endpoint/EndpointParameters.d.ts +32 -0
  24. package/dist-types/endpoint/bdd.d.ts +2 -0
  25. package/dist-types/endpoint/endpointResolver.d.ts +8 -0
  26. package/dist-types/extensionConfiguration.d.ts +8 -0
  27. package/dist-types/index.d.ts +22 -0
  28. package/dist-types/models/CaitlynServiceException.d.ts +15 -0
  29. package/dist-types/models/enums.d.ts +148 -0
  30. package/dist-types/models/errors.d.ts +659 -0
  31. package/dist-types/models/models_0.d.ts +754 -0
  32. package/dist-types/pagination/Interfaces.d.ts +8 -0
  33. package/dist-types/pagination/ListDocumentsPaginator.d.ts +7 -0
  34. package/dist-types/pagination/index.d.ts +2 -0
  35. package/dist-types/runtimeConfig.browser.d.ts +50 -0
  36. package/dist-types/runtimeConfig.d.ts +50 -0
  37. package/dist-types/runtimeConfig.native.d.ts +49 -0
  38. package/dist-types/runtimeConfig.shared.d.ts +36 -0
  39. package/dist-types/runtimeExtensions.d.ts +17 -0
  40. package/dist-types/schemas/schemas_0.d.ts +51 -0
  41. package/dist-types/sdk/client.d.ts +47 -0
  42. package/dist-types/sdk/events.d.ts +163 -0
  43. package/dist-types/sdk/index.d.ts +8 -0
  44. package/dist-types/sdk/operations.d.ts +70 -0
  45. package/package.json +49 -5
@@ -0,0 +1,1923 @@
1
+ // packages/sdk/src/CaitlynClient.ts
2
+ import { getCaitlynSdkPlugin } from "@caitlyn-ai/sdk-core";
3
+ import {
4
+ DefaultIdentityProviderConfig,
5
+ getHttpAuthSchemeEndpointRuleSetPlugin,
6
+ getHttpSigningPlugin
7
+ } from "@smithy/core";
8
+ import {
9
+ Client as __Client
10
+ } from "@smithy/core/client";
11
+ import {
12
+ resolveEndpointConfig,
13
+ resolveEndpointRequiredConfig
14
+ } from "@smithy/core/endpoints";
15
+ import { getContentLengthPlugin } from "@smithy/core/protocols";
16
+ import {
17
+ getRetryPlugin,
18
+ resolveRetryConfig
19
+ } from "@smithy/core/retry";
20
+ import { getSchemaSerdePlugin } from "@smithy/core/schema";
21
+
22
+ // packages/sdk/src/auth/httpAuthSchemeProvider.ts
23
+ import { doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider } from "@smithy/core";
24
+ import { getSmithyContext, normalizeProvider } from "@smithy/core/client";
25
+ var defaultCaitlynHttpAuthSchemeParametersProvider = async (config, context, input) => {
26
+ return {
27
+ operation: getSmithyContext(context).operation
28
+ };
29
+ };
30
+ function createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) {
31
+ return {
32
+ schemeId: "smithy.api#httpBearerAuth"
33
+ };
34
+ }
35
+ var defaultCaitlynHttpAuthSchemeProvider = (authParameters) => {
36
+ const options = [];
37
+ switch (authParameters.operation) {
38
+ default: {
39
+ options.push(createSmithyApiHttpBearerAuthHttpAuthOption(authParameters));
40
+ }
41
+ }
42
+ return options;
43
+ };
44
+ var resolveHttpAuthSchemeConfig = (config) => {
45
+ const token = memoizeIdentityProvider(config.token, isIdentityExpired, doesIdentityRequireRefresh);
46
+ return Object.assign(config, {
47
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
48
+ token
49
+ });
50
+ };
51
+
52
+ // packages/sdk/src/endpoint/EndpointParameters.ts
53
+ var resolveClientEndpointParameters = (options) => {
54
+ return Object.assign(options, {
55
+ defaultSigningName: ""
56
+ });
57
+ };
58
+ var commonParams = {
59
+ endpoint: { type: "builtInParams", name: "endpoint" }
60
+ };
61
+
62
+ // packages/sdk/src/runtimeConfig.browser.ts
63
+ import { calculateBodyLength } from "@smithy/core/serde";
64
+ import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
65
+
66
+ // packages/sdk/src/runtimeConfig.shared.ts
67
+ import { caitlynEndpointProvider, CaitlynRestJsonProtocol, CaitlynRetryStrategy } from "@caitlyn-ai/sdk-core";
68
+ import { HttpBearerAuthSigner } from "@smithy/core";
69
+ import { NoOpLogger } from "@smithy/core/client";
70
+ import { parseUrl } from "@smithy/core/protocols";
71
+ import { fromBase64, fromUtf8, sdkStreamMixin, toBase64, toUtf8 } from "@smithy/core/serde";
72
+
73
+ // packages/sdk/src/schemas/schemas_0.ts
74
+ import { TypeRegistry } from "@smithy/core/schema";
75
+
76
+ // packages/sdk/src/models/CaitlynServiceException.ts
77
+ import {
78
+ ServiceException as __ServiceException
79
+ } from "@smithy/core/client";
80
+ var CaitlynServiceException = class _CaitlynServiceException extends __ServiceException {
81
+ static shapeId = "smithy.ts.sdk.synthetic.ai.caitlyn.v3#CaitlynServiceException";
82
+ /**
83
+ * @internal
84
+ */
85
+ constructor(options) {
86
+ super(options);
87
+ Object.setPrototypeOf(this, _CaitlynServiceException.prototype);
88
+ }
89
+ };
90
+
91
+ // packages/sdk/src/models/errors.ts
92
+ var InternalError = class _InternalError extends CaitlynServiceException {
93
+ static shapeId = "ai.caitlyn.v3#InternalError";
94
+ name = "InternalError";
95
+ $fault = "server";
96
+ /**
97
+ * A stable URI for the code: its page in the public error reference,
98
+ * `https://build.caitlyn.ai/errors/\{code\}`.
99
+ * @public
100
+ */
101
+ type;
102
+ /**
103
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
104
+ * @public
105
+ */
106
+ title;
107
+ /**
108
+ * The HTTP status code, repeated from the response.
109
+ * @public
110
+ */
111
+ status;
112
+ /**
113
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
114
+ * renamed; callers match on it.
115
+ * @public
116
+ */
117
+ code;
118
+ /**
119
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
120
+ * storage keys or another person's data.
121
+ * @public
122
+ */
123
+ detail;
124
+ /**
125
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
126
+ * support.
127
+ * @public
128
+ */
129
+ requestId;
130
+ /**
131
+ * Field-level problems, one per member or parameter at fault. Present only on 400
132
+ * `VALIDATION_FAILED`.
133
+ * @public
134
+ */
135
+ errors;
136
+ /**
137
+ * @internal
138
+ */
139
+ constructor(opts) {
140
+ super({
141
+ name: "InternalError",
142
+ $fault: "server",
143
+ ...opts
144
+ });
145
+ Object.setPrototypeOf(this, _InternalError.prototype);
146
+ this.type = opts.type;
147
+ this.title = opts.title;
148
+ this.status = opts.status;
149
+ this.code = opts.code;
150
+ this.detail = opts.detail;
151
+ this.requestId = opts.requestId;
152
+ this.errors = opts.errors;
153
+ }
154
+ };
155
+ var NotFoundError = class _NotFoundError extends CaitlynServiceException {
156
+ static shapeId = "ai.caitlyn.v3#NotFoundError";
157
+ name = "NotFoundError";
158
+ $fault = "client";
159
+ /**
160
+ * A stable URI for the code: its page in the public error reference,
161
+ * `https://build.caitlyn.ai/errors/\{code\}`.
162
+ * @public
163
+ */
164
+ type;
165
+ /**
166
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
167
+ * @public
168
+ */
169
+ title;
170
+ /**
171
+ * The HTTP status code, repeated from the response.
172
+ * @public
173
+ */
174
+ status;
175
+ /**
176
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
177
+ * renamed; callers match on it.
178
+ * @public
179
+ */
180
+ code;
181
+ /**
182
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
183
+ * storage keys or another person's data.
184
+ * @public
185
+ */
186
+ detail;
187
+ /**
188
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
189
+ * support.
190
+ * @public
191
+ */
192
+ requestId;
193
+ /**
194
+ * Field-level problems, one per member or parameter at fault. Present only on 400
195
+ * `VALIDATION_FAILED`.
196
+ * @public
197
+ */
198
+ errors;
199
+ /**
200
+ * @internal
201
+ */
202
+ constructor(opts) {
203
+ super({
204
+ name: "NotFoundError",
205
+ $fault: "client",
206
+ ...opts
207
+ });
208
+ Object.setPrototypeOf(this, _NotFoundError.prototype);
209
+ this.type = opts.type;
210
+ this.title = opts.title;
211
+ this.status = opts.status;
212
+ this.code = opts.code;
213
+ this.detail = opts.detail;
214
+ this.requestId = opts.requestId;
215
+ this.errors = opts.errors;
216
+ }
217
+ };
218
+ var PermissionDeniedError = class _PermissionDeniedError extends CaitlynServiceException {
219
+ static shapeId = "ai.caitlyn.v3#PermissionDeniedError";
220
+ name = "PermissionDeniedError";
221
+ $fault = "client";
222
+ /**
223
+ * A stable URI for the code: its page in the public error reference,
224
+ * `https://build.caitlyn.ai/errors/\{code\}`.
225
+ * @public
226
+ */
227
+ type;
228
+ /**
229
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
230
+ * @public
231
+ */
232
+ title;
233
+ /**
234
+ * The HTTP status code, repeated from the response.
235
+ * @public
236
+ */
237
+ status;
238
+ /**
239
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
240
+ * renamed; callers match on it.
241
+ * @public
242
+ */
243
+ code;
244
+ /**
245
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
246
+ * storage keys or another person's data.
247
+ * @public
248
+ */
249
+ detail;
250
+ /**
251
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
252
+ * support.
253
+ * @public
254
+ */
255
+ requestId;
256
+ /**
257
+ * Field-level problems, one per member or parameter at fault. Present only on 400
258
+ * `VALIDATION_FAILED`.
259
+ * @public
260
+ */
261
+ errors;
262
+ /**
263
+ * @internal
264
+ */
265
+ constructor(opts) {
266
+ super({
267
+ name: "PermissionDeniedError",
268
+ $fault: "client",
269
+ ...opts
270
+ });
271
+ Object.setPrototypeOf(this, _PermissionDeniedError.prototype);
272
+ this.type = opts.type;
273
+ this.title = opts.title;
274
+ this.status = opts.status;
275
+ this.code = opts.code;
276
+ this.detail = opts.detail;
277
+ this.requestId = opts.requestId;
278
+ this.errors = opts.errors;
279
+ }
280
+ };
281
+ var PreconditionFailedError = class _PreconditionFailedError extends CaitlynServiceException {
282
+ static shapeId = "ai.caitlyn.v3#PreconditionFailedError";
283
+ name = "PreconditionFailedError";
284
+ $fault = "client";
285
+ /**
286
+ * A stable URI for the code: its page in the public error reference,
287
+ * `https://build.caitlyn.ai/errors/\{code\}`.
288
+ * @public
289
+ */
290
+ type;
291
+ /**
292
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
293
+ * @public
294
+ */
295
+ title;
296
+ /**
297
+ * The HTTP status code, repeated from the response.
298
+ * @public
299
+ */
300
+ status;
301
+ /**
302
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
303
+ * renamed; callers match on it.
304
+ * @public
305
+ */
306
+ code;
307
+ /**
308
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
309
+ * storage keys or another person's data.
310
+ * @public
311
+ */
312
+ detail;
313
+ /**
314
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
315
+ * support.
316
+ * @public
317
+ */
318
+ requestId;
319
+ /**
320
+ * Field-level problems, one per member or parameter at fault. Present only on 400
321
+ * `VALIDATION_FAILED`.
322
+ * @public
323
+ */
324
+ errors;
325
+ /**
326
+ * @internal
327
+ */
328
+ constructor(opts) {
329
+ super({
330
+ name: "PreconditionFailedError",
331
+ $fault: "client",
332
+ ...opts
333
+ });
334
+ Object.setPrototypeOf(this, _PreconditionFailedError.prototype);
335
+ this.type = opts.type;
336
+ this.title = opts.title;
337
+ this.status = opts.status;
338
+ this.code = opts.code;
339
+ this.detail = opts.detail;
340
+ this.requestId = opts.requestId;
341
+ this.errors = opts.errors;
342
+ }
343
+ };
344
+ var PreconditionRequiredError = class _PreconditionRequiredError extends CaitlynServiceException {
345
+ static shapeId = "ai.caitlyn.v3#PreconditionRequiredError";
346
+ name = "PreconditionRequiredError";
347
+ $fault = "client";
348
+ /**
349
+ * A stable URI for the code: its page in the public error reference,
350
+ * `https://build.caitlyn.ai/errors/\{code\}`.
351
+ * @public
352
+ */
353
+ type;
354
+ /**
355
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
356
+ * @public
357
+ */
358
+ title;
359
+ /**
360
+ * The HTTP status code, repeated from the response.
361
+ * @public
362
+ */
363
+ status;
364
+ /**
365
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
366
+ * renamed; callers match on it.
367
+ * @public
368
+ */
369
+ code;
370
+ /**
371
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
372
+ * storage keys or another person's data.
373
+ * @public
374
+ */
375
+ detail;
376
+ /**
377
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
378
+ * support.
379
+ * @public
380
+ */
381
+ requestId;
382
+ /**
383
+ * Field-level problems, one per member or parameter at fault. Present only on 400
384
+ * `VALIDATION_FAILED`.
385
+ * @public
386
+ */
387
+ errors;
388
+ /**
389
+ * @internal
390
+ */
391
+ constructor(opts) {
392
+ super({
393
+ name: "PreconditionRequiredError",
394
+ $fault: "client",
395
+ ...opts
396
+ });
397
+ Object.setPrototypeOf(this, _PreconditionRequiredError.prototype);
398
+ this.type = opts.type;
399
+ this.title = opts.title;
400
+ this.status = opts.status;
401
+ this.code = opts.code;
402
+ this.detail = opts.detail;
403
+ this.requestId = opts.requestId;
404
+ this.errors = opts.errors;
405
+ }
406
+ };
407
+ var ServiceUnavailableError = class _ServiceUnavailableError extends CaitlynServiceException {
408
+ static shapeId = "ai.caitlyn.v3#ServiceUnavailableError";
409
+ name = "ServiceUnavailableError";
410
+ $fault = "server";
411
+ $retryable = {};
412
+ /**
413
+ * A stable URI for the code: its page in the public error reference,
414
+ * `https://build.caitlyn.ai/errors/\{code\}`.
415
+ * @public
416
+ */
417
+ type;
418
+ /**
419
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
420
+ * @public
421
+ */
422
+ title;
423
+ /**
424
+ * The HTTP status code, repeated from the response.
425
+ * @public
426
+ */
427
+ status;
428
+ /**
429
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
430
+ * renamed; callers match on it.
431
+ * @public
432
+ */
433
+ code;
434
+ /**
435
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
436
+ * storage keys or another person's data.
437
+ * @public
438
+ */
439
+ detail;
440
+ /**
441
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
442
+ * support.
443
+ * @public
444
+ */
445
+ requestId;
446
+ /**
447
+ * Field-level problems, one per member or parameter at fault. Present only on 400
448
+ * `VALIDATION_FAILED`.
449
+ * @public
450
+ */
451
+ errors;
452
+ /**
453
+ * Seconds to wait before trying again, from the `Retry-After` header.
454
+ * @public
455
+ */
456
+ retryAfterSeconds;
457
+ /**
458
+ * @internal
459
+ */
460
+ constructor(opts) {
461
+ super({
462
+ name: "ServiceUnavailableError",
463
+ $fault: "server",
464
+ ...opts
465
+ });
466
+ Object.setPrototypeOf(this, _ServiceUnavailableError.prototype);
467
+ this.type = opts.type;
468
+ this.title = opts.title;
469
+ this.status = opts.status;
470
+ this.code = opts.code;
471
+ this.detail = opts.detail;
472
+ this.requestId = opts.requestId;
473
+ this.errors = opts.errors;
474
+ this.retryAfterSeconds = opts.retryAfterSeconds;
475
+ }
476
+ };
477
+ var TooManyRequestsError = class _TooManyRequestsError extends CaitlynServiceException {
478
+ static shapeId = "ai.caitlyn.v3#TooManyRequestsError";
479
+ name = "TooManyRequestsError";
480
+ $fault = "client";
481
+ $retryable = {
482
+ throttling: true
483
+ };
484
+ /**
485
+ * A stable URI for the code: its page in the public error reference,
486
+ * `https://build.caitlyn.ai/errors/\{code\}`.
487
+ * @public
488
+ */
489
+ type;
490
+ /**
491
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
492
+ * @public
493
+ */
494
+ title;
495
+ /**
496
+ * The HTTP status code, repeated from the response.
497
+ * @public
498
+ */
499
+ status;
500
+ /**
501
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
502
+ * renamed; callers match on it.
503
+ * @public
504
+ */
505
+ code;
506
+ /**
507
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
508
+ * storage keys or another person's data.
509
+ * @public
510
+ */
511
+ detail;
512
+ /**
513
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
514
+ * support.
515
+ * @public
516
+ */
517
+ requestId;
518
+ /**
519
+ * Field-level problems, one per member or parameter at fault. Present only on 400
520
+ * `VALIDATION_FAILED`.
521
+ * @public
522
+ */
523
+ errors;
524
+ /**
525
+ * Seconds to wait before trying again, from the `Retry-After` header.
526
+ * @public
527
+ */
528
+ retryAfterSeconds;
529
+ /**
530
+ * @internal
531
+ */
532
+ constructor(opts) {
533
+ super({
534
+ name: "TooManyRequestsError",
535
+ $fault: "client",
536
+ ...opts
537
+ });
538
+ Object.setPrototypeOf(this, _TooManyRequestsError.prototype);
539
+ this.type = opts.type;
540
+ this.title = opts.title;
541
+ this.status = opts.status;
542
+ this.code = opts.code;
543
+ this.detail = opts.detail;
544
+ this.requestId = opts.requestId;
545
+ this.errors = opts.errors;
546
+ this.retryAfterSeconds = opts.retryAfterSeconds;
547
+ }
548
+ };
549
+ var UnauthenticatedError = class _UnauthenticatedError extends CaitlynServiceException {
550
+ static shapeId = "ai.caitlyn.v3#UnauthenticatedError";
551
+ name = "UnauthenticatedError";
552
+ $fault = "client";
553
+ /**
554
+ * A stable URI for the code: its page in the public error reference,
555
+ * `https://build.caitlyn.ai/errors/\{code\}`.
556
+ * @public
557
+ */
558
+ type;
559
+ /**
560
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
561
+ * @public
562
+ */
563
+ title;
564
+ /**
565
+ * The HTTP status code, repeated from the response.
566
+ * @public
567
+ */
568
+ status;
569
+ /**
570
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
571
+ * renamed; callers match on it.
572
+ * @public
573
+ */
574
+ code;
575
+ /**
576
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
577
+ * storage keys or another person's data.
578
+ * @public
579
+ */
580
+ detail;
581
+ /**
582
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
583
+ * support.
584
+ * @public
585
+ */
586
+ requestId;
587
+ /**
588
+ * Field-level problems, one per member or parameter at fault. Present only on 400
589
+ * `VALIDATION_FAILED`.
590
+ * @public
591
+ */
592
+ errors;
593
+ /**
594
+ * @internal
595
+ */
596
+ constructor(opts) {
597
+ super({
598
+ name: "UnauthenticatedError",
599
+ $fault: "client",
600
+ ...opts
601
+ });
602
+ Object.setPrototypeOf(this, _UnauthenticatedError.prototype);
603
+ this.type = opts.type;
604
+ this.title = opts.title;
605
+ this.status = opts.status;
606
+ this.code = opts.code;
607
+ this.detail = opts.detail;
608
+ this.requestId = opts.requestId;
609
+ this.errors = opts.errors;
610
+ }
611
+ };
612
+ var ValidationError = class _ValidationError extends CaitlynServiceException {
613
+ static shapeId = "ai.caitlyn.v3#ValidationError";
614
+ name = "ValidationError";
615
+ $fault = "client";
616
+ /**
617
+ * A stable URI for the code: its page in the public error reference,
618
+ * `https://build.caitlyn.ai/errors/\{code\}`.
619
+ * @public
620
+ */
621
+ type;
622
+ /**
623
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
624
+ * @public
625
+ */
626
+ title;
627
+ /**
628
+ * The HTTP status code, repeated from the response.
629
+ * @public
630
+ */
631
+ status;
632
+ /**
633
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
634
+ * renamed; callers match on it.
635
+ * @public
636
+ */
637
+ code;
638
+ /**
639
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
640
+ * storage keys or another person's data.
641
+ * @public
642
+ */
643
+ detail;
644
+ /**
645
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
646
+ * support.
647
+ * @public
648
+ */
649
+ requestId;
650
+ /**
651
+ * Field-level problems, one per member or parameter at fault. Present only on 400
652
+ * `VALIDATION_FAILED`.
653
+ * @public
654
+ */
655
+ errors;
656
+ /**
657
+ * @internal
658
+ */
659
+ constructor(opts) {
660
+ super({
661
+ name: "ValidationError",
662
+ $fault: "client",
663
+ ...opts
664
+ });
665
+ Object.setPrototypeOf(this, _ValidationError.prototype);
666
+ this.type = opts.type;
667
+ this.title = opts.title;
668
+ this.status = opts.status;
669
+ this.code = opts.code;
670
+ this.detail = opts.detail;
671
+ this.requestId = opts.requestId;
672
+ this.errors = opts.errors;
673
+ }
674
+ };
675
+ var ConflictError = class _ConflictError extends CaitlynServiceException {
676
+ static shapeId = "ai.caitlyn.v3#ConflictError";
677
+ name = "ConflictError";
678
+ $fault = "client";
679
+ /**
680
+ * A stable URI for the code: its page in the public error reference,
681
+ * `https://build.caitlyn.ai/errors/\{code\}`.
682
+ * @public
683
+ */
684
+ type;
685
+ /**
686
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
687
+ * @public
688
+ */
689
+ title;
690
+ /**
691
+ * The HTTP status code, repeated from the response.
692
+ * @public
693
+ */
694
+ status;
695
+ /**
696
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
697
+ * renamed; callers match on it.
698
+ * @public
699
+ */
700
+ code;
701
+ /**
702
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
703
+ * storage keys or another person's data.
704
+ * @public
705
+ */
706
+ detail;
707
+ /**
708
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
709
+ * support.
710
+ * @public
711
+ */
712
+ requestId;
713
+ /**
714
+ * Field-level problems, one per member or parameter at fault. Present only on 400
715
+ * `VALIDATION_FAILED`.
716
+ * @public
717
+ */
718
+ errors;
719
+ /**
720
+ * @internal
721
+ */
722
+ constructor(opts) {
723
+ super({
724
+ name: "ConflictError",
725
+ $fault: "client",
726
+ ...opts
727
+ });
728
+ Object.setPrototypeOf(this, _ConflictError.prototype);
729
+ this.type = opts.type;
730
+ this.title = opts.title;
731
+ this.status = opts.status;
732
+ this.code = opts.code;
733
+ this.detail = opts.detail;
734
+ this.requestId = opts.requestId;
735
+ this.errors = opts.errors;
736
+ }
737
+ };
738
+ var PayloadTooLargeError = class _PayloadTooLargeError extends CaitlynServiceException {
739
+ static shapeId = "ai.caitlyn.v3#PayloadTooLargeError";
740
+ name = "PayloadTooLargeError";
741
+ $fault = "client";
742
+ /**
743
+ * A stable URI for the code: its page in the public error reference,
744
+ * `https://build.caitlyn.ai/errors/\{code\}`.
745
+ * @public
746
+ */
747
+ type;
748
+ /**
749
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
750
+ * @public
751
+ */
752
+ title;
753
+ /**
754
+ * The HTTP status code, repeated from the response.
755
+ * @public
756
+ */
757
+ status;
758
+ /**
759
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
760
+ * renamed; callers match on it.
761
+ * @public
762
+ */
763
+ code;
764
+ /**
765
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
766
+ * storage keys or another person's data.
767
+ * @public
768
+ */
769
+ detail;
770
+ /**
771
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
772
+ * support.
773
+ * @public
774
+ */
775
+ requestId;
776
+ /**
777
+ * Field-level problems, one per member or parameter at fault. Present only on 400
778
+ * `VALIDATION_FAILED`.
779
+ * @public
780
+ */
781
+ errors;
782
+ /**
783
+ * @internal
784
+ */
785
+ constructor(opts) {
786
+ super({
787
+ name: "PayloadTooLargeError",
788
+ $fault: "client",
789
+ ...opts
790
+ });
791
+ Object.setPrototypeOf(this, _PayloadTooLargeError.prototype);
792
+ this.type = opts.type;
793
+ this.title = opts.title;
794
+ this.status = opts.status;
795
+ this.code = opts.code;
796
+ this.detail = opts.detail;
797
+ this.requestId = opts.requestId;
798
+ this.errors = opts.errors;
799
+ }
800
+ };
801
+ var UnprocessableContentError = class _UnprocessableContentError extends CaitlynServiceException {
802
+ static shapeId = "ai.caitlyn.v3#UnprocessableContentError";
803
+ name = "UnprocessableContentError";
804
+ $fault = "client";
805
+ /**
806
+ * A stable URI for the code: its page in the public error reference,
807
+ * `https://build.caitlyn.ai/errors/\{code\}`.
808
+ * @public
809
+ */
810
+ type;
811
+ /**
812
+ * A short, human-readable summary of the problem, the same for every occurrence of the code.
813
+ * @public
814
+ */
815
+ title;
816
+ /**
817
+ * The HTTP status code, repeated from the response.
818
+ * @public
819
+ */
820
+ status;
821
+ /**
822
+ * The stable code, for example `NOT_FOUND`. Once shipped a code keeps its meaning and is never
823
+ * renamed; callers match on it.
824
+ * @public
825
+ */
826
+ code;
827
+ /**
828
+ * What went wrong in this occurrence, written for the integrator. Never holds stack traces,
829
+ * storage keys or another person's data.
830
+ * @public
831
+ */
832
+ detail;
833
+ /**
834
+ * The request's identifier, the same value as the `Caitlyn-Request-Id` header. Quote it to
835
+ * support.
836
+ * @public
837
+ */
838
+ requestId;
839
+ /**
840
+ * Field-level problems, one per member or parameter at fault. Present only on 400
841
+ * `VALIDATION_FAILED`.
842
+ * @public
843
+ */
844
+ errors;
845
+ /**
846
+ * @internal
847
+ */
848
+ constructor(opts) {
849
+ super({
850
+ name: "UnprocessableContentError",
851
+ $fault: "client",
852
+ ...opts
853
+ });
854
+ Object.setPrototypeOf(this, _UnprocessableContentError.prototype);
855
+ this.type = opts.type;
856
+ this.title = opts.title;
857
+ this.status = opts.status;
858
+ this.code = opts.code;
859
+ this.detail = opts.detail;
860
+ this.requestId = opts.requestId;
861
+ this.errors = opts.errors;
862
+ }
863
+ };
864
+
865
+ // packages/sdk/src/schemas/schemas_0.ts
866
+ var _AC = "AgentConfiguration";
867
+ var _AS = "AttachmentSettings";
868
+ var _CAV = "Caitlyn-Api-Version";
869
+ var _CD = "CreateDocument";
870
+ var _CDI = "CreateDocumentInput";
871
+ var _CDO = "CreateDocumentOutput";
872
+ var _CE = "ConflictError";
873
+ var _CI = "ContextItem";
874
+ var _CIL = "ContextItemList";
875
+ var _CRI = "Caitlyn-Request-Id";
876
+ var _CS = "ContentSafety";
877
+ var _CU = "CreateUpload";
878
+ var _CUI = "CreateUploadInput";
879
+ var _CUO = "CreateUploadOutput";
880
+ var _D = "Document";
881
+ var _DL = "DocumentList";
882
+ var _ESB = "EventStreamBody";
883
+ var _ET = "ETag";
884
+ var _FE = "FieldError";
885
+ var _FEL = "FieldErrorList";
886
+ var _GAV = "GetAgentVersion";
887
+ var _GAVI = "GetAgentVersionInput";
888
+ var _GAVO = "GetAgentVersionOutput";
889
+ var _IE = "InternalError";
890
+ var _IK = "Idempotency-Key";
891
+ var _IM = "If-Match";
892
+ var _KBB = "KnowledgeBaseBinding";
893
+ var _KBBL = "KnowledgeBaseBindingList";
894
+ var _L = "Location";
895
+ var _LD = "ListDocuments";
896
+ var _LDI = "ListDocumentsInput";
897
+ var _LDO = "ListDocumentsOutput";
898
+ var _LEI = "Last-Event-ID";
899
+ var _NFE = "NotFoundError";
900
+ var _O = "Operation";
901
+ var _PDE = "PermissionDeniedError";
902
+ var _PF = "PartialFailure";
903
+ var _PFE = "PreconditionFailedError";
904
+ var _PFL = "PartialFailureList";
905
+ var _PRE = "PreconditionRequiredError";
906
+ var _PTLE = "PayloadTooLargeError";
907
+ var _RA = "Retry-After";
908
+ var _RCS = "ResumeConversationStream";
909
+ var _RCSI = "ResumeConversationStreamInput";
910
+ var _RCSO = "ResumeConversationStreamOutput";
911
+ var _SM = "SendMessage";
912
+ var _SMI = "SendMessageInput";
913
+ var _SMO = "SendMessageOutput";
914
+ var _SUE = "ServiceUnavailableError";
915
+ var _TMRE = "TooManyRequestsError";
916
+ var _UCE = "UnprocessableContentError";
917
+ var _UDV = "UpdateDraftVersion";
918
+ var _UDVI = "UpdateDraftVersionInput";
919
+ var _UDVO = "UpdateDraftVersionOutput";
920
+ var _UE = "UnauthenticatedError";
921
+ var _VE = "ValidationError";
922
+ var _a = "attachments";
923
+ var _aI = "agentId";
924
+ var _aV = "apiVersion";
925
+ var _bO = "basedOn";
926
+ var _bS = "byteSize";
927
+ var _c = "client";
928
+ var _cA = "createdAt";
929
+ var _cI = "conversationId";
930
+ var _cS = "contentSafety";
931
+ var _cT = "contentType";
932
+ var _cl = "clear";
933
+ var _co = "code";
934
+ var _con = "configuration";
935
+ var _cont = "context";
936
+ var _cu = "cursor";
937
+ var _d = "detail";
938
+ var _dD = "deniedDocuments";
939
+ var _da = "data";
940
+ var _do = "document";
941
+ var _e = "error";
942
+ var _eA = "expiresAt";
943
+ var _en = "enabled";
944
+ var _er = "errors";
945
+ var _et = "etag";
946
+ var _ev = "events";
947
+ var _f = "folder";
948
+ var _fN = "fileName";
949
+ var _fW = "filter[name][startsWith]";
950
+ var _fi = "filter[folder][eq]";
951
+ var _fil = "filter[status][eq]";
952
+ var _gI = "guardrailId";
953
+ var _h = "http";
954
+ var _hE = "httpError";
955
+ var _hH = "httpHeader";
956
+ var _hQ = "httpQuery";
957
+ var _i = "instructions";
958
+ var _iK = "idempotencyKey";
959
+ var _iM = "ifMatch";
960
+ var _iT = "idempotencyToken";
961
+ var _id = "identity";
962
+ var _id_ = "id";
963
+ var _it = "items";
964
+ var _k = "kind";
965
+ var _kB = "knowledgeBases";
966
+ var _kBI = "knowledgeBaseId";
967
+ var _l = "label";
968
+ var _lEI = "lastEventId";
969
+ var _li = "limit";
970
+ var _lo = "location";
971
+ var _m = "model";
972
+ var _mF = "maxFiles";
973
+ var _mP = "matchesProduction";
974
+ var _mS = "minimumScore";
975
+ var _mT = "mediaType";
976
+ var _me = "message";
977
+ var _n = "name";
978
+ var _nC = "nextCursor";
979
+ var _nOR = "numberOfResults";
980
+ var _nP = "namePrefix";
981
+ var _no = "note";
982
+ var _o = "operation";
983
+ var _p = "pointer";
984
+ var _pF = "partialFailures";
985
+ var _pa = "parameter";
986
+ var _rAS = "retryAfterSeconds";
987
+ var _rH = "requiredHeaders";
988
+ var _rI = "requestId";
989
+ var _s = "smithy.ts.sdk.synthetic.ai.caitlyn.v3";
990
+ var _se = "server";
991
+ var _sh = "sha256";
992
+ var _so = "source";
993
+ var _sor = "sort";
994
+ var _st = "status";
995
+ var _sta = "stage";
996
+ var _str = "streaming";
997
+ var _t = "type";
998
+ var _tI = "targetId";
999
+ var _ti = "title";
1000
+ var _ts = "text/event-stream";
1001
+ var _u = "uri";
1002
+ var _uA = "updatedAt";
1003
+ var _uI = "uploadId";
1004
+ var _uM = "uploadMethod";
1005
+ var _uU = "uploadUrl";
1006
+ var _v = "version";
1007
+ var n0 = "ai.caitlyn.v3";
1008
+ var _s_registry = new TypeRegistry(_s);
1009
+ var CaitlynServiceException$ = [-3, _s, "CaitlynServiceException", 0, [], []];
1010
+ _s_registry.registerError(CaitlynServiceException$, CaitlynServiceException);
1011
+ var n0_registry = new TypeRegistry(n0);
1012
+ var ConflictError$ = [
1013
+ -3,
1014
+ n0,
1015
+ _CE,
1016
+ { [_e]: _c, [_hE]: 409 },
1017
+ [_t, _ti, _st, _co, _rI, _d, _er],
1018
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1019
+ 5
1020
+ ];
1021
+ n0_registry.registerError(ConflictError$, ConflictError);
1022
+ var InternalError$ = [
1023
+ -3,
1024
+ n0,
1025
+ _IE,
1026
+ { [_e]: _se, [_hE]: 500 },
1027
+ [_t, _ti, _st, _co, _rI, _d, _er],
1028
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1029
+ 5
1030
+ ];
1031
+ n0_registry.registerError(InternalError$, InternalError);
1032
+ var NotFoundError$ = [
1033
+ -3,
1034
+ n0,
1035
+ _NFE,
1036
+ { [_e]: _c, [_hE]: 404 },
1037
+ [_t, _ti, _st, _co, _rI, _d, _er],
1038
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1039
+ 5
1040
+ ];
1041
+ n0_registry.registerError(NotFoundError$, NotFoundError);
1042
+ var PayloadTooLargeError$ = [
1043
+ -3,
1044
+ n0,
1045
+ _PTLE,
1046
+ { [_e]: _c, [_hE]: 413 },
1047
+ [_t, _ti, _st, _co, _rI, _d, _er],
1048
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1049
+ 5
1050
+ ];
1051
+ n0_registry.registerError(PayloadTooLargeError$, PayloadTooLargeError);
1052
+ var PermissionDeniedError$ = [
1053
+ -3,
1054
+ n0,
1055
+ _PDE,
1056
+ { [_e]: _c, [_hE]: 403 },
1057
+ [_t, _ti, _st, _co, _rI, _d, _er],
1058
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1059
+ 5
1060
+ ];
1061
+ n0_registry.registerError(PermissionDeniedError$, PermissionDeniedError);
1062
+ var PreconditionFailedError$ = [
1063
+ -3,
1064
+ n0,
1065
+ _PFE,
1066
+ { [_e]: _c, [_hE]: 412 },
1067
+ [_t, _ti, _st, _co, _rI, _d, _er],
1068
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1069
+ 5
1070
+ ];
1071
+ n0_registry.registerError(PreconditionFailedError$, PreconditionFailedError);
1072
+ var PreconditionRequiredError$ = [
1073
+ -3,
1074
+ n0,
1075
+ _PRE,
1076
+ { [_e]: _c, [_hE]: 428 },
1077
+ [_t, _ti, _st, _co, _rI, _d, _er],
1078
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1079
+ 5
1080
+ ];
1081
+ n0_registry.registerError(PreconditionRequiredError$, PreconditionRequiredError);
1082
+ var ServiceUnavailableError$ = [
1083
+ -3,
1084
+ n0,
1085
+ _SUE,
1086
+ { [_e]: _se, [_hE]: 503 },
1087
+ [_t, _ti, _st, _co, _rI, _d, _er, _rAS],
1088
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList, [1, { [_hH]: _RA }]],
1089
+ 5
1090
+ ];
1091
+ n0_registry.registerError(ServiceUnavailableError$, ServiceUnavailableError);
1092
+ var TooManyRequestsError$ = [
1093
+ -3,
1094
+ n0,
1095
+ _TMRE,
1096
+ { [_e]: _c, [_hE]: 429 },
1097
+ [_t, _ti, _st, _co, _rI, _d, _er, _rAS],
1098
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList, [1, { [_hH]: _RA }]],
1099
+ 5
1100
+ ];
1101
+ n0_registry.registerError(TooManyRequestsError$, TooManyRequestsError);
1102
+ var UnauthenticatedError$ = [
1103
+ -3,
1104
+ n0,
1105
+ _UE,
1106
+ { [_e]: _c, [_hE]: 401 },
1107
+ [_t, _ti, _st, _co, _rI, _d, _er],
1108
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1109
+ 5
1110
+ ];
1111
+ n0_registry.registerError(UnauthenticatedError$, UnauthenticatedError);
1112
+ var UnprocessableContentError$ = [
1113
+ -3,
1114
+ n0,
1115
+ _UCE,
1116
+ { [_e]: _c, [_hE]: 422 },
1117
+ [_t, _ti, _st, _co, _rI, _d, _er],
1118
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1119
+ 5
1120
+ ];
1121
+ n0_registry.registerError(UnprocessableContentError$, UnprocessableContentError);
1122
+ var ValidationError$ = [
1123
+ -3,
1124
+ n0,
1125
+ _VE,
1126
+ { [_e]: _c, [_hE]: 400 },
1127
+ [_t, _ti, _st, _co, _rI, _d, _er],
1128
+ [0, 0, 1, 0, 0, 0, () => FieldErrorList],
1129
+ 5
1130
+ ];
1131
+ n0_registry.registerError(ValidationError$, ValidationError);
1132
+ var errorTypeRegistries = [
1133
+ _s_registry,
1134
+ n0_registry
1135
+ ];
1136
+ var EventStreamBody = [0, n0, _ESB, { [_mT]: _ts, [_str]: 1 }, 42];
1137
+ var AgentConfiguration$ = [
1138
+ 3,
1139
+ n0,
1140
+ _AC,
1141
+ 0,
1142
+ [_i, _id, _m, _kB, _a, _cS, _dD],
1143
+ [0, 0, 0, () => KnowledgeBaseBindingList, () => AttachmentSettings$, () => ContentSafety$, 2],
1144
+ 1
1145
+ ];
1146
+ var AttachmentSettings$ = [
1147
+ 3,
1148
+ n0,
1149
+ _AS,
1150
+ 0,
1151
+ [_en, _mF],
1152
+ [2, 1]
1153
+ ];
1154
+ var ContentSafety$ = [
1155
+ 3,
1156
+ n0,
1157
+ _CS,
1158
+ 0,
1159
+ [_gI],
1160
+ [0]
1161
+ ];
1162
+ var ContextItem$ = [
1163
+ 3,
1164
+ n0,
1165
+ _CI,
1166
+ 0,
1167
+ [_t, _l, _u, _da],
1168
+ [0, 0, 0, 15],
1169
+ 2
1170
+ ];
1171
+ var CreateDocumentInput$ = [
1172
+ 3,
1173
+ n0,
1174
+ _CDI,
1175
+ 0,
1176
+ [_kBI, _uI, _f, _iK, _n],
1177
+ [[0, 1], 0, 0, [0, { [_hH]: _IK, [_iT]: 1 }], 0],
1178
+ 3
1179
+ ];
1180
+ var CreateDocumentOutput$ = [
1181
+ 3,
1182
+ n0,
1183
+ _CDO,
1184
+ 0,
1185
+ [_do, _o, _rI, _aV, _lo],
1186
+ [() => Document$, () => Operation$, [0, { [_hH]: _CRI }], [0, { [_hH]: _CAV }], [0, { [_hH]: _L }]],
1187
+ 2
1188
+ ];
1189
+ var CreateUploadInput$ = [
1190
+ 3,
1191
+ n0,
1192
+ _CUI,
1193
+ 0,
1194
+ [_fN, _cT, _bS, _sh, _iK],
1195
+ [0, 0, 1, 0, [0, { [_hH]: _IK, [_iT]: 1 }]],
1196
+ 4
1197
+ ];
1198
+ var CreateUploadOutput$ = [
1199
+ 3,
1200
+ n0,
1201
+ _CUO,
1202
+ 0,
1203
+ [_id_, _uU, _uM, _rH, _eA, _st, _rI, _aV, _lo],
1204
+ [0, 0, 0, 128 | 0, 5, 0, [0, { [_hH]: _CRI }], [0, { [_hH]: _CAV }], [0, { [_hH]: _L }]],
1205
+ 6
1206
+ ];
1207
+ var Document$ = [
1208
+ 3,
1209
+ n0,
1210
+ _D,
1211
+ 0,
1212
+ [_id_, _kBI, _n, _f, _st, _cA, _uA, _sta, _cT, _bS, _sh, _pF],
1213
+ [0, 0, 0, 0, 0, 5, 5, 0, 0, 1, 0, () => PartialFailureList],
1214
+ 7
1215
+ ];
1216
+ var FieldError$ = [
1217
+ 3,
1218
+ n0,
1219
+ _FE,
1220
+ 0,
1221
+ [_co, _p, _pa, _d],
1222
+ [0, 0, 0, 0],
1223
+ 1
1224
+ ];
1225
+ var GetAgentVersionInput$ = [
1226
+ 3,
1227
+ n0,
1228
+ _GAVI,
1229
+ 0,
1230
+ [_aI, _v],
1231
+ [[0, 1], [0, 1]],
1232
+ 2
1233
+ ];
1234
+ var GetAgentVersionOutput$ = [
1235
+ 3,
1236
+ n0,
1237
+ _GAVO,
1238
+ 0,
1239
+ [_et, _aI, _n, _cA, _con, _rI, _aV, _so, _bO, _mP, _no],
1240
+ [[0, { [_hH]: _ET }], 0, 0, 5, () => AgentConfiguration$, [0, { [_hH]: _CRI }], [0, { [_hH]: _CAV }], 0, 0, 2, 0],
1241
+ 5
1242
+ ];
1243
+ var KnowledgeBaseBinding$ = [
1244
+ 3,
1245
+ n0,
1246
+ _KBB,
1247
+ 0,
1248
+ [_kBI, _nOR, _mS],
1249
+ [0, 1, 1],
1250
+ 1
1251
+ ];
1252
+ var ListDocumentsInput$ = [
1253
+ 3,
1254
+ n0,
1255
+ _LDI,
1256
+ 0,
1257
+ [_kBI, _li, _cu, _sor, _f, _st, _nP],
1258
+ [[0, 1], [1, { [_hQ]: _li }], [0, { [_hQ]: _cu }], [0, { [_hQ]: _sor }], [0, { [_hQ]: _fi }], [0, { [_hQ]: _fil }], [0, { [_hQ]: _fW }]],
1259
+ 1
1260
+ ];
1261
+ var ListDocumentsOutput$ = [
1262
+ 3,
1263
+ n0,
1264
+ _LDO,
1265
+ 0,
1266
+ [_it, _rI, _aV, _nC],
1267
+ [() => DocumentList, [0, { [_hH]: _CRI }], [0, { [_hH]: _CAV }], 0],
1268
+ 1
1269
+ ];
1270
+ var Operation$ = [
1271
+ 3,
1272
+ n0,
1273
+ _O,
1274
+ 0,
1275
+ [_id_, _k, _st, _cA],
1276
+ [0, 0, 0, 5],
1277
+ 4
1278
+ ];
1279
+ var PartialFailure$ = [
1280
+ 3,
1281
+ n0,
1282
+ _PF,
1283
+ 0,
1284
+ [_co, _tI, _d],
1285
+ [0, 0, 0],
1286
+ 1
1287
+ ];
1288
+ var ResumeConversationStreamInput$ = [
1289
+ 3,
1290
+ n0,
1291
+ _RCSI,
1292
+ 0,
1293
+ [_cI, _lEI],
1294
+ [[0, 1], [0, { [_hH]: _LEI }]],
1295
+ 1
1296
+ ];
1297
+ var ResumeConversationStreamOutput$ = [
1298
+ 3,
1299
+ n0,
1300
+ _RCSO,
1301
+ 0,
1302
+ [_ev, _rI, _aV],
1303
+ [[() => EventStreamBody, 16], [0, { [_hH]: _CRI }], [0, { [_hH]: _CAV }]],
1304
+ 1
1305
+ ];
1306
+ var SendMessageInput$ = [
1307
+ 3,
1308
+ n0,
1309
+ _SMI,
1310
+ 0,
1311
+ [_cI, _me, _cont],
1312
+ [[0, 1], 0, () => ContextItemList],
1313
+ 2
1314
+ ];
1315
+ var SendMessageOutput$ = [
1316
+ 3,
1317
+ n0,
1318
+ _SMO,
1319
+ 0,
1320
+ [_ev, _rI, _aV],
1321
+ [[() => EventStreamBody, 16], [0, { [_hH]: _CRI }], [0, { [_hH]: _CAV }]],
1322
+ 1
1323
+ ];
1324
+ var UpdateDraftVersionInput$ = [
1325
+ 3,
1326
+ n0,
1327
+ _UDVI,
1328
+ 0,
1329
+ [_aI, _iM, _id, _i, _m, _kB, _a, _cS, _dD, _cl],
1330
+ [[0, 1], [0, { [_hH]: _IM }], 0, 0, 0, () => KnowledgeBaseBindingList, () => AttachmentSettings$, () => ContentSafety$, 2, 64 | 0],
1331
+ 2
1332
+ ];
1333
+ var UpdateDraftVersionOutput$ = [
1334
+ 3,
1335
+ n0,
1336
+ _UDVO,
1337
+ 0,
1338
+ [_et, _aI, _n, _cA, _con, _rI, _aV, _so, _bO, _mP, _no],
1339
+ [[0, { [_hH]: _ET }], 0, 0, 5, () => AgentConfiguration$, [0, { [_hH]: _CRI }], [0, { [_hH]: _CAV }], 0, 0, 2, 0],
1340
+ 5
1341
+ ];
1342
+ var ClearableDraftFieldList = 64 | 0;
1343
+ var ContextItemList = [
1344
+ 1,
1345
+ n0,
1346
+ _CIL,
1347
+ 0,
1348
+ () => ContextItem$
1349
+ ];
1350
+ var DocumentList = [
1351
+ 1,
1352
+ n0,
1353
+ _DL,
1354
+ 0,
1355
+ () => Document$
1356
+ ];
1357
+ var FieldErrorList = [
1358
+ 1,
1359
+ n0,
1360
+ _FEL,
1361
+ 0,
1362
+ () => FieldError$
1363
+ ];
1364
+ var KnowledgeBaseBindingList = [
1365
+ 1,
1366
+ n0,
1367
+ _KBBL,
1368
+ 0,
1369
+ () => KnowledgeBaseBinding$
1370
+ ];
1371
+ var PartialFailureList = [
1372
+ 1,
1373
+ n0,
1374
+ _PFL,
1375
+ 0,
1376
+ () => PartialFailure$
1377
+ ];
1378
+ var HeaderMap = 128 | 0;
1379
+ var CreateDocument$ = [
1380
+ 9,
1381
+ n0,
1382
+ _CD,
1383
+ { [_h]: ["POST", "/v3/knowledge-bases/{knowledgeBaseId}/documents", 202] },
1384
+ () => CreateDocumentInput$,
1385
+ () => CreateDocumentOutput$
1386
+ ];
1387
+ var CreateUpload$ = [
1388
+ 9,
1389
+ n0,
1390
+ _CU,
1391
+ { [_h]: ["POST", "/v3/uploads", 201] },
1392
+ () => CreateUploadInput$,
1393
+ () => CreateUploadOutput$
1394
+ ];
1395
+ var GetAgentVersion$ = [
1396
+ 9,
1397
+ n0,
1398
+ _GAV,
1399
+ { [_h]: ["GET", "/v3/agents/{agentId}/versions/{version}", 200] },
1400
+ () => GetAgentVersionInput$,
1401
+ () => GetAgentVersionOutput$
1402
+ ];
1403
+ var ListDocuments$ = [
1404
+ 9,
1405
+ n0,
1406
+ _LD,
1407
+ { [_h]: ["GET", "/v3/knowledge-bases/{knowledgeBaseId}/documents", 200] },
1408
+ () => ListDocumentsInput$,
1409
+ () => ListDocumentsOutput$
1410
+ ];
1411
+ var ResumeConversationStream$ = [
1412
+ 9,
1413
+ n0,
1414
+ _RCS,
1415
+ { [_h]: ["GET", "/v3/conversations/{conversationId}/stream", 200] },
1416
+ () => ResumeConversationStreamInput$,
1417
+ () => ResumeConversationStreamOutput$
1418
+ ];
1419
+ var SendMessage$ = [
1420
+ 9,
1421
+ n0,
1422
+ _SM,
1423
+ { [_h]: ["POST", "/v3/conversations/{conversationId}/send", 200] },
1424
+ () => SendMessageInput$,
1425
+ () => SendMessageOutput$
1426
+ ];
1427
+ var UpdateDraftVersion$ = [
1428
+ 9,
1429
+ n0,
1430
+ _UDV,
1431
+ { [_h]: ["PATCH", "/v3/agents/{agentId}/versions/draft", 200] },
1432
+ () => UpdateDraftVersionInput$,
1433
+ () => UpdateDraftVersionOutput$
1434
+ ];
1435
+
1436
+ // packages/sdk/src/runtimeConfig.shared.ts
1437
+ var getRuntimeConfig = (config) => {
1438
+ return {
1439
+ apiVersion: "3.0.0",
1440
+ base64Decoder: config?.base64Decoder ?? fromBase64,
1441
+ base64Encoder: config?.base64Encoder ?? toBase64,
1442
+ caitlynSdkVersion: config?.caitlynSdkVersion ?? "0.0.2",
1443
+ disableHostPrefix: config?.disableHostPrefix ?? false,
1444
+ endpointProvider: config?.endpointProvider ?? caitlynEndpointProvider,
1445
+ extensions: config?.extensions ?? [],
1446
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultCaitlynHttpAuthSchemeProvider,
1447
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
1448
+ {
1449
+ schemeId: "smithy.api#httpBearerAuth",
1450
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#httpBearerAuth"),
1451
+ signer: new HttpBearerAuthSigner()
1452
+ }
1453
+ ],
1454
+ logger: config?.logger ?? new NoOpLogger(),
1455
+ protocol: config?.protocol ?? CaitlynRestJsonProtocol,
1456
+ protocolSettings: config?.protocolSettings ?? { defaultNamespace: "ai.caitlyn.v3", errorTypeRegistries },
1457
+ retryStrategy: config?.retryStrategy ?? new CaitlynRetryStrategy(config?.maxAttempts ?? 3),
1458
+ sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin,
1459
+ sha256: config?.sha256 ?? void 0,
1460
+ urlParser: config?.urlParser ?? parseUrl,
1461
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
1462
+ utf8Encoder: config?.utf8Encoder ?? toUtf8
1463
+ };
1464
+ };
1465
+
1466
+ // packages/sdk/src/runtimeConfig.browser.ts
1467
+ var getRuntimeConfig2 = (config) => {
1468
+ const clientSharedValues = getRuntimeConfig(config);
1469
+ return {
1470
+ ...clientSharedValues,
1471
+ ...config,
1472
+ runtime: "browser",
1473
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
1474
+ maxAttempts: config?.maxAttempts ?? 3,
1475
+ requestHandler: RequestHandler.create(config?.requestHandler ?? (async () => void 0)),
1476
+ retryMode: config?.retryMode ?? "standard",
1477
+ streamCollector: config?.streamCollector ?? streamCollector
1478
+ };
1479
+ };
1480
+
1481
+ // packages/sdk/src/runtimeExtensions.ts
1482
+ import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/core/client";
1483
+ import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/core/protocols";
1484
+
1485
+ // packages/sdk/src/auth/httpAuthExtensionConfiguration.ts
1486
+ var getHttpAuthExtensionConfiguration = (runtimeConfig) => {
1487
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
1488
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
1489
+ let _token = runtimeConfig.token;
1490
+ return {
1491
+ setHttpAuthScheme(httpAuthScheme) {
1492
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
1493
+ if (index === -1) {
1494
+ _httpAuthSchemes.push(httpAuthScheme);
1495
+ } else {
1496
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
1497
+ }
1498
+ },
1499
+ httpAuthSchemes() {
1500
+ return _httpAuthSchemes;
1501
+ },
1502
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
1503
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
1504
+ },
1505
+ httpAuthSchemeProvider() {
1506
+ return _httpAuthSchemeProvider;
1507
+ },
1508
+ setToken(token) {
1509
+ _token = token;
1510
+ },
1511
+ token() {
1512
+ return _token;
1513
+ }
1514
+ };
1515
+ };
1516
+ var resolveHttpAuthRuntimeConfig = (config) => {
1517
+ return {
1518
+ httpAuthSchemes: config.httpAuthSchemes(),
1519
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
1520
+ token: config.token()
1521
+ };
1522
+ };
1523
+
1524
+ // packages/sdk/src/runtimeExtensions.ts
1525
+ var resolveRuntimeExtensions = (runtimeConfig, extensions) => {
1526
+ const extensionConfiguration = Object.assign(
1527
+ getDefaultExtensionConfiguration(runtimeConfig),
1528
+ getHttpHandlerExtensionConfiguration(runtimeConfig),
1529
+ getHttpAuthExtensionConfiguration(runtimeConfig)
1530
+ );
1531
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
1532
+ return Object.assign(
1533
+ runtimeConfig,
1534
+ resolveDefaultRuntimeConfig(extensionConfiguration),
1535
+ resolveHttpHandlerRuntimeConfig(extensionConfiguration),
1536
+ resolveHttpAuthRuntimeConfig(extensionConfiguration)
1537
+ );
1538
+ };
1539
+
1540
+ // packages/sdk/src/CaitlynClient.ts
1541
+ var CaitlynClient = class extends __Client {
1542
+ /**
1543
+ * The resolved configuration of CaitlynClient class. This is resolved and normalized from the {@link CaitlynClientConfig | constructor configuration interface}.
1544
+ */
1545
+ config;
1546
+ constructor(...[configuration]) {
1547
+ const _config_0 = getRuntimeConfig2(configuration || {});
1548
+ super(_config_0);
1549
+ this.initConfig = _config_0;
1550
+ const _config_1 = resolveClientEndpointParameters(_config_0);
1551
+ const _config_2 = resolveRetryConfig(_config_1);
1552
+ const _config_3 = resolveEndpointConfig(_config_2);
1553
+ const _config_4 = resolveEndpointRequiredConfig(_config_3);
1554
+ const _config_5 = resolveHttpAuthSchemeConfig(_config_4);
1555
+ const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []);
1556
+ this.config = _config_6;
1557
+ this.middlewareStack.use(getSchemaSerdePlugin(this.config));
1558
+ this.middlewareStack.use(getRetryPlugin(this.config));
1559
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
1560
+ this.middlewareStack.use(
1561
+ getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
1562
+ httpAuthSchemeParametersProvider: defaultCaitlynHttpAuthSchemeParametersProvider,
1563
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
1564
+ "smithy.api#httpBearerAuth": config.token
1565
+ })
1566
+ })
1567
+ );
1568
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
1569
+ this.middlewareStack.use(getCaitlynSdkPlugin(this.config, {
1570
+ "retrySafeOperations": ["CreateDocument", "CreateUpload", "GetAgentVersion", "ListDocuments", "ResumeConversationStream", "UpdateDraftVersion"],
1571
+ sdkModel: "5.115.0",
1572
+ "since": ["CreateDocument=5.115.0", "CreateUpload=5.115.0", "GetAgentVersion=5.115.0", "ListDocuments=5.115.0", "ResumeConversationStream=5.115.0", "SendMessage=5.115.0", "UpdateDraftVersion=5.115.0"]
1573
+ }));
1574
+ }
1575
+ /**
1576
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
1577
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
1578
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
1579
+ */
1580
+ destroy() {
1581
+ super.destroy();
1582
+ }
1583
+ };
1584
+
1585
+ // packages/sdk/src/sdk/client.ts
1586
+ import { clientConfig, createAuth, getCaitlynAuthPlugin, getCaitlynTelemetryPlugin } from "@caitlyn-ai/sdk-core";
1587
+
1588
+ // packages/sdk/src/sdk/operations.ts
1589
+ import { SseStream, uploadFile } from "@caitlyn-ai/sdk-core";
1590
+
1591
+ // packages/sdk/src/commandBuilder.ts
1592
+ import { makeBuilder } from "@smithy/core/client";
1593
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
1594
+ var command = makeBuilder(commonParams, "Caitlyn", "CaitlynClient", getEndpointPlugin);
1595
+ var _ep0 = {};
1596
+ var _mw0 = (Command, cs, config, o) => [];
1597
+
1598
+ // packages/sdk/src/commands/CreateDocumentCommand.ts
1599
+ var CreateDocumentCommand = class extends command(
1600
+ _ep0,
1601
+ _mw0,
1602
+ "CreateDocument",
1603
+ CreateDocument$
1604
+ ) {
1605
+ };
1606
+
1607
+ // packages/sdk/src/commands/CreateUploadCommand.ts
1608
+ var CreateUploadCommand = class extends command(
1609
+ _ep0,
1610
+ _mw0,
1611
+ "CreateUpload",
1612
+ CreateUpload$
1613
+ ) {
1614
+ };
1615
+
1616
+ // packages/sdk/src/commands/GetAgentVersionCommand.ts
1617
+ var GetAgentVersionCommand = class extends command(
1618
+ _ep0,
1619
+ _mw0,
1620
+ "GetAgentVersion",
1621
+ GetAgentVersion$
1622
+ ) {
1623
+ };
1624
+
1625
+ // packages/sdk/src/pagination/ListDocumentsPaginator.ts
1626
+ import { createPaginator } from "@smithy/core";
1627
+
1628
+ // packages/sdk/src/commands/ListDocumentsCommand.ts
1629
+ var ListDocumentsCommand = class extends command(
1630
+ _ep0,
1631
+ _mw0,
1632
+ "ListDocuments",
1633
+ ListDocuments$
1634
+ ) {
1635
+ };
1636
+
1637
+ // packages/sdk/src/pagination/ListDocumentsPaginator.ts
1638
+ var paginateListDocuments = createPaginator(CaitlynClient, ListDocumentsCommand, "cursor", "nextCursor", "limit");
1639
+
1640
+ // packages/sdk/src/commands/ResumeConversationStreamCommand.ts
1641
+ var ResumeConversationStreamCommand = class extends command(
1642
+ _ep0,
1643
+ _mw0,
1644
+ "ResumeConversationStream",
1645
+ ResumeConversationStream$
1646
+ ) {
1647
+ };
1648
+
1649
+ // packages/sdk/src/commands/SendMessageCommand.ts
1650
+ var SendMessageCommand = class extends command(
1651
+ _ep0,
1652
+ _mw0,
1653
+ "SendMessage",
1654
+ SendMessage$
1655
+ ) {
1656
+ };
1657
+
1658
+ // packages/sdk/src/commands/UpdateDraftVersionCommand.ts
1659
+ var UpdateDraftVersionCommand = class extends command(
1660
+ _ep0,
1661
+ _mw0,
1662
+ "UpdateDraftVersion",
1663
+ UpdateDraftVersion$
1664
+ ) {
1665
+ };
1666
+
1667
+ // packages/sdk/src/sdk/events.ts
1668
+ var ConversationEventNames = /* @__PURE__ */ new Set(["message.started", "phase.changed", "progress.updated", "text.delta", "citation.added", "tool.started", "tool.finished", "input.requested", "message.completed", "message.failed"]);
1669
+
1670
+ // packages/sdk/src/sdk/operations.ts
1671
+ var ERROR_CLASSES = {
1672
+ 400: ValidationError,
1673
+ 401: UnauthenticatedError,
1674
+ 403: PermissionDeniedError,
1675
+ 404: NotFoundError,
1676
+ 409: ConflictError,
1677
+ 412: PreconditionFailedError,
1678
+ 413: PayloadTooLargeError,
1679
+ 422: UnprocessableContentError,
1680
+ 428: PreconditionRequiredError,
1681
+ 429: TooManyRequestsError,
1682
+ 500: InternalError,
1683
+ 503: ServiceUnavailableError
1684
+ };
1685
+ var toError = (problem) => {
1686
+ const status = Number(problem.status ?? 0);
1687
+ const fault = status >= 500 ? "server" : "client";
1688
+ const message = String(problem.detail ?? problem.title ?? problem.code);
1689
+ const Typed = ERROR_CLASSES[status];
1690
+ const error = Typed ? new Typed({ $fault: fault, $metadata: {}, message }) : new CaitlynServiceException({ name: String(problem.code ?? "Error"), $fault: fault, $metadata: {}, message });
1691
+ return Object.assign(error, problem, { message });
1692
+ };
1693
+ function createDocument(client, input, options = {}) {
1694
+ const { signal, ...rest } = options;
1695
+ return client.send(new CreateDocumentCommand({ ...input, ...rest }), { abortSignal: signal });
1696
+ }
1697
+ function createUpload(client, input, options = {}) {
1698
+ const { signal, ...rest } = options;
1699
+ return client.send(new CreateUploadCommand({ ...input, ...rest }), { abortSignal: signal });
1700
+ }
1701
+ function getAgentVersion(client, input, options = {}) {
1702
+ const { signal, ...rest } = options;
1703
+ return client.send(new GetAgentVersionCommand({ ...input, ...rest }), { abortSignal: signal });
1704
+ }
1705
+ function listDocuments(client, input, options = {}) {
1706
+ const { signal, ...rest } = options;
1707
+ return {
1708
+ async *[Symbol.asyncIterator]() {
1709
+ const pages = paginateListDocuments({ client, pageSize: input.limit }, { ...input, ...rest }, { abortSignal: signal });
1710
+ for await (const page of pages) yield* page.items;
1711
+ }
1712
+ };
1713
+ }
1714
+ function resumeConversationStream(client, conversationId, input, options = {}) {
1715
+ const { signal, ...rest } = options;
1716
+ return new SseStream(
1717
+ { known: ConversationEventNames, final: { event: "message.completed", member: "message" }, errorEvent: "message.failed", toError },
1718
+ async () => (await client.send(new ResumeConversationStreamCommand({ ...input, conversationId, ...rest }), { abortSignal: signal })).events,
1719
+ void 0,
1720
+ signal
1721
+ );
1722
+ }
1723
+ function sendMessage(client, conversationId, input, options = {}) {
1724
+ const { signal, ...rest } = options;
1725
+ return new SseStream(
1726
+ { known: ConversationEventNames, final: { event: "message.completed", member: "message" }, errorEvent: "message.failed", toError },
1727
+ async () => (await client.send(new SendMessageCommand({ ...input, conversationId, ...rest }), { abortSignal: signal })).events,
1728
+ async (lastEventId) => (await client.send(new ResumeConversationStreamCommand({ conversationId, lastEventId }), { abortSignal: signal })).events,
1729
+ signal
1730
+ );
1731
+ }
1732
+ function updateDraftVersion(client, agentId, input, options) {
1733
+ const { signal, ...rest } = options;
1734
+ return client.send(new UpdateDraftVersionCommand({ ...input, agentId, ...rest }), { abortSignal: signal });
1735
+ }
1736
+ function createUploadFromFile(client, input, options = {}) {
1737
+ const { file, fileName, ...rest } = input;
1738
+ return uploadFile(file, fileName, (meta) => createUpload(client, { ...rest, ...meta }, options), toError, options.signal);
1739
+ }
1740
+ async function uploadDocument(client, input, options = {}) {
1741
+ const { file, fileName, ...rest } = input;
1742
+ const upload = await createUploadFromFile(client, { file, fileName }, { signal: options.signal });
1743
+ return createDocument(client, { ...rest, uploadId: upload.id }, options);
1744
+ }
1745
+
1746
+ // packages/sdk/src/sdk/client.ts
1747
+ function createCaitlynClient(options, auth = createAuth(options)) {
1748
+ const client = new CaitlynClient(clientConfig(options, auth));
1749
+ client.middlewareStack.use(getCaitlynAuthPlugin(auth));
1750
+ if (options.telemetry?.enabled !== false) client.middlewareStack.use(getCaitlynTelemetryPlugin(options.telemetry?.tracerProvider));
1751
+ return client;
1752
+ }
1753
+ var Caitlyn = class {
1754
+ client;
1755
+ /** The sign-in session: the current token, and the oauth mode's authorizationUrl(), handleCallback() and signOut(). */
1756
+ auth;
1757
+ constructor(options) {
1758
+ this.auth = createAuth(options);
1759
+ this.client = createCaitlynClient(options, this.auth);
1760
+ }
1761
+ conversations = {
1762
+ resume: (...args) => resumeConversationStream(this.client, ...args),
1763
+ send: (...args) => sendMessage(this.client, ...args)
1764
+ };
1765
+ documents = {
1766
+ create: (...args) => createDocument(this.client, ...args),
1767
+ list: (...args) => listDocuments(this.client, ...args),
1768
+ upload: (...args) => uploadDocument(this.client, ...args)
1769
+ };
1770
+ uploads = {
1771
+ create: (...args) => createUploadFromFile(this.client, ...args),
1772
+ reserve: (...args) => createUpload(this.client, ...args)
1773
+ };
1774
+ versions = {
1775
+ get: (...args) => getAgentVersion(this.client, ...args),
1776
+ updateDraft: (...args) => updateDraftVersion(this.client, ...args)
1777
+ };
1778
+ };
1779
+
1780
+ // packages/sdk/src/models/enums.ts
1781
+ var ClearableDraftField = {
1782
+ /**
1783
+ * The agent's identity statement.
1784
+ */
1785
+ IDENTITY: "identity"
1786
+ };
1787
+ var VersionSource = {
1788
+ /**
1789
+ * Created from an imported agent file.
1790
+ */
1791
+ IMPORT: "import",
1792
+ /**
1793
+ * Carried over from the version model before v3.
1794
+ */
1795
+ MIGRATION: "migration",
1796
+ /**
1797
+ * Pinned from the draft, without changing production.
1798
+ */
1799
+ PIN: "pin",
1800
+ /**
1801
+ * Published, which also made it production.
1802
+ */
1803
+ PUBLISH: "publish"
1804
+ };
1805
+ var DocumentStatus = {
1806
+ /**
1807
+ * Being deleted.
1808
+ */
1809
+ DELETING: "deleting",
1810
+ /**
1811
+ * The document's content could not be processed. Final.
1812
+ */
1813
+ FAILED: "failed",
1814
+ /**
1815
+ * Searchable. Final.
1816
+ */
1817
+ INDEXED: "indexed",
1818
+ /**
1819
+ * Searchable, but some enrichments did not complete; see `partialFailures`. Final.
1820
+ */
1821
+ PARTIALLY_INDEXED: "partially_indexed",
1822
+ /**
1823
+ * Created; processing has not started.
1824
+ */
1825
+ PENDING: "pending",
1826
+ /**
1827
+ * Being processed. `stage` says what the server is doing.
1828
+ */
1829
+ PROCESSING: "processing"
1830
+ };
1831
+ var OperationKind = {
1832
+ /**
1833
+ * A document's ingestion: reading, enriching and indexing its content.
1834
+ */
1835
+ DOCUMENT_INGESTION: "document_ingestion"
1836
+ };
1837
+ var OperationStatus = {
1838
+ /**
1839
+ * Cancelled before it finished. Final.
1840
+ */
1841
+ CANCELLED: "cancelled",
1842
+ /**
1843
+ * The core work failed; see `error`. Final.
1844
+ */
1845
+ FAILED: "failed",
1846
+ /**
1847
+ * Waiting to start.
1848
+ */
1849
+ QUEUED: "queued",
1850
+ /**
1851
+ * Running.
1852
+ */
1853
+ RUNNING: "running",
1854
+ /**
1855
+ * Finished with no failures. Final.
1856
+ */
1857
+ SUCCEEDED: "succeeded",
1858
+ /**
1859
+ * Finished, but some enrichments did not complete; see `partialFailures`. Final.
1860
+ */
1861
+ SUCCEEDED_WITH_FAILURES: "succeeded_with_failures"
1862
+ };
1863
+ var UploadStatus = {
1864
+ /**
1865
+ * Reserved; the bytes have not arrived.
1866
+ */
1867
+ AWAITING_BYTES: "awaiting_bytes",
1868
+ /**
1869
+ * Used by an operation. Final.
1870
+ */
1871
+ CONSUMED: "consumed",
1872
+ /**
1873
+ * Not used before `expiresAt`. Final.
1874
+ */
1875
+ EXPIRED: "expired",
1876
+ /**
1877
+ * The bytes arrived and matched the checksum.
1878
+ */
1879
+ RECEIVED: "received"
1880
+ };
1881
+
1882
+ // packages/sdk/src/sdk/index.ts
1883
+ import { NotSupportedByServer, SseStream as SseStream2, CaitlynAuthError, WaiterError, createAuth as createAuth2, workspaceAudience } from "@caitlyn-ai/sdk-core";
1884
+ export {
1885
+ Caitlyn,
1886
+ CaitlynAuthError,
1887
+ CaitlynServiceException as CaitlynError,
1888
+ ClearableDraftField,
1889
+ ConflictError,
1890
+ ConversationEventNames,
1891
+ DocumentStatus,
1892
+ InternalError,
1893
+ NotFoundError,
1894
+ NotSupportedByServer,
1895
+ OperationKind,
1896
+ OperationStatus,
1897
+ PayloadTooLargeError,
1898
+ PermissionDeniedError,
1899
+ PreconditionFailedError,
1900
+ PreconditionRequiredError,
1901
+ ServiceUnavailableError,
1902
+ SseStream2 as SseStream,
1903
+ TooManyRequestsError,
1904
+ UnauthenticatedError,
1905
+ UnprocessableContentError,
1906
+ UploadStatus,
1907
+ ValidationError,
1908
+ VersionSource,
1909
+ WaiterError,
1910
+ createAuth2 as createAuth,
1911
+ createCaitlynClient,
1912
+ createDocument,
1913
+ createUpload,
1914
+ createUploadFromFile,
1915
+ getAgentVersion,
1916
+ listDocuments,
1917
+ resumeConversationStream,
1918
+ sendMessage,
1919
+ updateDraftVersion,
1920
+ uploadDocument,
1921
+ workspaceAudience
1922
+ };
1923
+ //# sourceMappingURL=index.mjs.map