@caitlyn-ai/sdk 0.0.0-stage → 0.0.1

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