@crewai-ts/core 0.1.2 → 0.1.3

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 (90) hide show
  1. package/dist/a2a.d.ts +1684 -0
  2. package/dist/a2ui-schemas.d.ts +3312 -0
  3. package/dist/a2ui.d.ts +379 -0
  4. package/dist/agent-adapters.d.ts +178 -0
  5. package/dist/agent-executors.d.ts +508 -0
  6. package/dist/agent-parser.d.ts +44 -0
  7. package/dist/agent-planning.d.ts +358 -0
  8. package/dist/agent-utils.d.ts +210 -0
  9. package/dist/agent.d.ts +444 -0
  10. package/dist/auth.d.ts +179 -0
  11. package/dist/config-utils.d.ts +5 -0
  12. package/dist/content-processor.d.ts +12 -0
  13. package/dist/context.d.ts +157 -0
  14. package/dist/converter.d.ts +97 -0
  15. package/dist/crew-chat.d.ts +97 -0
  16. package/dist/crew.d.ts +424 -0
  17. package/dist/decorators.d.ts +20 -0
  18. package/dist/env.d.ts +13 -0
  19. package/dist/errors.d.ts +27 -0
  20. package/dist/evaluators.d.ts +477 -0
  21. package/dist/events.d.ts +2657 -0
  22. package/dist/execution-utils.d.ts +85 -0
  23. package/dist/experimental-conversational.d.ts +181 -0
  24. package/dist/file-handler.d.ts +36 -0
  25. package/dist/file-store.d.ts +37 -0
  26. package/dist/files.d.ts +554 -0
  27. package/dist/flow-conversation.d.ts +90 -0
  28. package/dist/flow-definition.d.ts +195 -0
  29. package/dist/flow-persistence.d.ts +107 -0
  30. package/dist/flow-visualization.d.ts +77 -0
  31. package/dist/flow.d.ts +927 -0
  32. package/dist/formatter.d.ts +7 -0
  33. package/dist/guardrail.d.ts +95 -0
  34. package/dist/hooks.d.ts +241 -0
  35. package/dist/human-input.d.ts +74 -0
  36. package/dist/i18n.d.ts +26 -0
  37. package/dist/index.d.ts +99 -13004
  38. package/dist/input-files.d.ts +24 -0
  39. package/dist/input-provider.d.ts +22 -0
  40. package/dist/knowledge.d.ts +353 -0
  41. package/dist/lite-agent-output.d.ts +69 -0
  42. package/dist/lite-agent.d.ts +154 -0
  43. package/dist/llm.d.ts +630 -0
  44. package/dist/llms-hooks-transport.d.ts +1 -2
  45. package/dist/lock-store.d.ts +14 -0
  46. package/dist/logger.d.ts +55 -0
  47. package/dist/mcp.d.ts +315 -0
  48. package/dist/memory.d.ts +915 -0
  49. package/dist/metadata.d.ts +9 -0
  50. package/dist/misc-compat.d.ts +125 -0
  51. package/dist/openai-completion.d.ts +324 -0
  52. package/dist/outputs.d.ts +69 -0
  53. package/dist/planning.d.ts +60 -0
  54. package/dist/plus-api.d.ts +194 -0
  55. package/dist/project-compat.d.ts +133 -0
  56. package/dist/project.d.ts +221 -0
  57. package/dist/prompts.d.ts +66 -0
  58. package/dist/provider-completions.d.ts +593 -0
  59. package/dist/rag.d.ts +1074 -0
  60. package/dist/rpm.d.ts +27 -0
  61. package/dist/rw-lock.d.ts +21 -0
  62. package/dist/schema-utils.d.ts +121 -0
  63. package/dist/security.d.ts +66 -0
  64. package/dist/settings.d.ts +103 -0
  65. package/dist/skills.d.ts +145 -0
  66. package/dist/state-provider-core.d.ts +1 -1
  67. package/dist/state.d.ts +204 -0
  68. package/dist/step-execution-context.d.ts +36 -0
  69. package/dist/streaming.d.ts +153 -0
  70. package/dist/string-utils.d.ts +12 -0
  71. package/dist/task-output-storage.d.ts +62 -0
  72. package/dist/task.d.ts +305 -0
  73. package/dist/telemetry.d.ts +91 -0
  74. package/dist/token-counter-callback.d.ts +36 -0
  75. package/dist/tools.d.ts +563 -0
  76. package/dist/tracing-utils.d.ts +56 -0
  77. package/dist/training-converter.d.ts +36 -0
  78. package/dist/training-handler.d.ts +10 -0
  79. package/dist/types.d.ts +72 -0
  80. package/dist/utilities.d.ts +130 -0
  81. package/dist/utility-types.d.ts +10 -0
  82. package/dist/version.d.ts +12 -0
  83. package/package.json +326 -4904
  84. package/dist/index.d.cts +0 -13068
  85. package/dist/llms-hooks-transport-ChGiFBiU.d.ts +0 -233
  86. package/dist/llms-hooks-transport-DZlurMUQ.d.cts +0 -233
  87. package/dist/llms-hooks-transport.d.cts +0 -2
  88. package/dist/state-provider-core-Be9RKRAm.d.cts +0 -4876
  89. package/dist/state-provider-core-Be9RKRAm.d.ts +0 -4876
  90. package/dist/state-provider-core.d.cts +0 -1
@@ -0,0 +1,554 @@
1
+ export type FileMode = "strict" | "auto" | "warn" | "chunk";
2
+ export type FileReadable = {
3
+ read(size?: number): Uint8Array | Buffer | string;
4
+ seek?(position: number): void;
5
+ tell?(): number;
6
+ close?(): void;
7
+ name?: string;
8
+ };
9
+ export type FileSourceInput = string | Uint8Array | Buffer | FileSource | FileReadable;
10
+ export type FileInput = AudioFile | File | ImageFile | PDFFile | TextFile | VideoFile;
11
+ export type FileProvider = string;
12
+ export declare abstract class ResolvedFile {
13
+ readonly contentType: string;
14
+ readonly content_type: string;
15
+ protected constructor(contentType: string);
16
+ }
17
+ export declare class InlineBase64 extends ResolvedFile {
18
+ readonly data: string;
19
+ constructor(options: {
20
+ contentType?: string;
21
+ content_type?: string;
22
+ data: string;
23
+ });
24
+ }
25
+ export declare class InlineBytes extends ResolvedFile {
26
+ readonly data: Uint8Array;
27
+ constructor(options: {
28
+ contentType?: string;
29
+ content_type?: string;
30
+ data: Uint8Array | Buffer | string;
31
+ });
32
+ }
33
+ export declare class FileReference extends ResolvedFile {
34
+ readonly fileId: string;
35
+ readonly file_id: string;
36
+ readonly provider: string;
37
+ readonly expiresAt: Date | null;
38
+ readonly expires_at: Date | null;
39
+ readonly fileUri: string | null;
40
+ readonly file_uri: string | null;
41
+ constructor(options: {
42
+ contentType?: string;
43
+ content_type?: string;
44
+ fileId?: string;
45
+ file_id?: string;
46
+ provider: string;
47
+ expiresAt?: Date | null;
48
+ expires_at?: Date | null;
49
+ fileUri?: string | null;
50
+ file_uri?: string | null;
51
+ });
52
+ }
53
+ export declare class UrlReference extends ResolvedFile {
54
+ readonly url: string;
55
+ constructor(options: {
56
+ contentType?: string;
57
+ content_type?: string;
58
+ url: string;
59
+ });
60
+ }
61
+ export type ResolvedFileType = InlineBase64 | InlineBytes | FileReference | UrlReference;
62
+ export declare enum FileHandling {
63
+ STRICT = "strict",
64
+ AUTO = "auto",
65
+ WARN = "warn",
66
+ CHUNK = "chunk"
67
+ }
68
+ export declare class FileValidationError extends Error {
69
+ readonly fileName: string | null;
70
+ readonly file_name: string | null;
71
+ constructor(message: string, options?: {
72
+ fileName?: string | null;
73
+ file_name?: string | null;
74
+ });
75
+ }
76
+ export declare class FileTooLargeError extends FileValidationError {
77
+ readonly actualSize: number | null;
78
+ readonly actual_size: number | null;
79
+ readonly maxSize: number | null;
80
+ readonly max_size: number | null;
81
+ constructor(message: string, options?: {
82
+ fileName?: string | null;
83
+ file_name?: string | null;
84
+ actualSize?: number | null;
85
+ actual_size?: number | null;
86
+ maxSize?: number | null;
87
+ max_size?: number | null;
88
+ });
89
+ }
90
+ export declare class UnsupportedFileTypeError extends FileValidationError {
91
+ readonly contentType: string | null;
92
+ readonly content_type: string | null;
93
+ constructor(message: string, options?: {
94
+ fileName?: string | null;
95
+ file_name?: string | null;
96
+ contentType?: string | null;
97
+ content_type?: string | null;
98
+ });
99
+ }
100
+ export declare class FileProcessingError extends FileValidationError {
101
+ constructor(message: string, options?: {
102
+ fileName?: string | null;
103
+ file_name?: string | null;
104
+ });
105
+ }
106
+ export declare class ProcessingDependencyError extends FileProcessingError {
107
+ readonly dependency: string | null;
108
+ readonly installCommand: string | null;
109
+ readonly install_command: string | null;
110
+ constructor(message: string, options?: {
111
+ dependency?: string | null;
112
+ installCommand?: string | null;
113
+ install_command?: string | null;
114
+ });
115
+ }
116
+ export declare class ImageConstraints {
117
+ readonly maxSizeBytes: number;
118
+ readonly max_size_bytes: number;
119
+ readonly maxWidth: number | null;
120
+ readonly max_width: number | null;
121
+ readonly maxHeight: number | null;
122
+ readonly max_height: number | null;
123
+ readonly maxImagesPerRequest: number | null;
124
+ readonly max_images_per_request: number | null;
125
+ readonly supportedFormats: readonly string[];
126
+ readonly supported_formats: readonly string[];
127
+ constructor(options: {
128
+ maxSizeBytes?: number;
129
+ max_size_bytes?: number;
130
+ maxWidth?: number | null;
131
+ max_width?: number | null;
132
+ maxHeight?: number | null;
133
+ max_height?: number | null;
134
+ maxImagesPerRequest?: number | null;
135
+ max_images_per_request?: number | null;
136
+ supportedFormats?: readonly string[];
137
+ supported_formats?: readonly string[];
138
+ });
139
+ }
140
+ export declare class PDFConstraints {
141
+ readonly maxSizeBytes: number;
142
+ readonly max_size_bytes: number;
143
+ readonly maxPages: number | null;
144
+ readonly max_pages: number | null;
145
+ constructor(options: {
146
+ maxSizeBytes?: number;
147
+ max_size_bytes?: number;
148
+ maxPages?: number | null;
149
+ max_pages?: number | null;
150
+ });
151
+ }
152
+ export declare class AudioConstraints {
153
+ readonly maxSizeBytes: number;
154
+ readonly max_size_bytes: number;
155
+ readonly maxDurationSeconds: number | null;
156
+ readonly max_duration_seconds: number | null;
157
+ readonly supportedFormats: readonly string[];
158
+ readonly supported_formats: readonly string[];
159
+ constructor(options: {
160
+ maxSizeBytes?: number;
161
+ max_size_bytes?: number;
162
+ maxDurationSeconds?: number | null;
163
+ max_duration_seconds?: number | null;
164
+ supportedFormats?: readonly string[];
165
+ supported_formats?: readonly string[];
166
+ });
167
+ }
168
+ export declare class VideoConstraints {
169
+ readonly maxSizeBytes: number;
170
+ readonly max_size_bytes: number;
171
+ readonly maxDurationSeconds: number | null;
172
+ readonly max_duration_seconds: number | null;
173
+ readonly supportedFormats: readonly string[];
174
+ readonly supported_formats: readonly string[];
175
+ constructor(options: {
176
+ maxSizeBytes?: number;
177
+ max_size_bytes?: number;
178
+ maxDurationSeconds?: number | null;
179
+ max_duration_seconds?: number | null;
180
+ supportedFormats?: readonly string[];
181
+ supported_formats?: readonly string[];
182
+ });
183
+ }
184
+ export declare class TextConstraints {
185
+ readonly maxSizeBytes: number;
186
+ readonly max_size_bytes: number;
187
+ readonly supportedFormats: readonly string[];
188
+ readonly supported_formats: readonly string[];
189
+ constructor(options: {
190
+ maxSizeBytes?: number;
191
+ max_size_bytes?: number;
192
+ supportedFormats?: readonly string[];
193
+ supported_formats?: readonly string[];
194
+ });
195
+ }
196
+ export declare class ProviderConstraints {
197
+ readonly name: string;
198
+ readonly image: ImageConstraints | null;
199
+ readonly pdf: PDFConstraints | null;
200
+ readonly audio: AudioConstraints | null;
201
+ readonly video: VideoConstraints | null;
202
+ readonly text: TextConstraints | null;
203
+ readonly generalMaxSizeBytes: number | null;
204
+ readonly general_max_size_bytes: number | null;
205
+ readonly supportsFileUpload: boolean;
206
+ readonly supports_file_upload: boolean;
207
+ readonly fileUploadThresholdBytes: number | null;
208
+ readonly file_upload_threshold_bytes: number | null;
209
+ readonly supportsUrlReferences: boolean;
210
+ readonly supports_url_references: boolean;
211
+ constructor(options: {
212
+ name: string;
213
+ image?: ImageConstraints | null;
214
+ pdf?: PDFConstraints | null;
215
+ audio?: AudioConstraints | null;
216
+ video?: VideoConstraints | null;
217
+ text?: TextConstraints | null;
218
+ generalMaxSizeBytes?: number | null;
219
+ general_max_size_bytes?: number | null;
220
+ supportsFileUpload?: boolean;
221
+ supports_file_upload?: boolean;
222
+ fileUploadThresholdBytes?: number | null;
223
+ file_upload_threshold_bytes?: number | null;
224
+ supportsUrlReferences?: boolean;
225
+ supports_url_references?: boolean;
226
+ });
227
+ }
228
+ export declare const ANTHROPIC_CONSTRAINTS: ProviderConstraints;
229
+ export declare const OPENAI_RESPONSES_CONSTRAINTS: ProviderConstraints;
230
+ export declare const OPENAI_CONSTRAINTS: ProviderConstraints;
231
+ export declare const GEMINI_CONSTRAINTS: ProviderConstraints;
232
+ export declare const BEDROCK_CONSTRAINTS: ProviderConstraints;
233
+ export declare const AZURE_CONSTRAINTS: ProviderConstraints;
234
+ export declare function getConstraintsForProvider(provider: string | ProviderConstraints): ProviderConstraints | null;
235
+ export declare const get_constraints_for_provider: typeof getConstraintsForProvider;
236
+ export declare function usesOpenAIResponsesApi(provider: string, api?: string | null): boolean;
237
+ export declare const uses_openai_responses_api: typeof usesOpenAIResponsesApi;
238
+ export declare function getSupportedContentTypes(provider: string, api?: string | null): string[];
239
+ export declare const get_supported_content_types: typeof getSupportedContentTypes;
240
+ export declare function validateImage(file: ImageFile, constraints: ImageConstraints, options?: {
241
+ raiseOnError?: boolean;
242
+ raise_on_error?: boolean;
243
+ }): string[];
244
+ export declare const validate_image: typeof validateImage;
245
+ export declare function validatePDF(file: PDFFile, constraints: PDFConstraints, options?: {
246
+ raiseOnError?: boolean;
247
+ raise_on_error?: boolean;
248
+ }): string[];
249
+ export declare const validate_pdf: typeof validatePDF;
250
+ export declare function validateAudio(file: AudioFile, constraints: AudioConstraints, options?: {
251
+ raiseOnError?: boolean;
252
+ raise_on_error?: boolean;
253
+ durationSeconds?: number | null;
254
+ duration_seconds?: number | null;
255
+ }): string[];
256
+ export declare const validate_audio: typeof validateAudio;
257
+ export declare function validateVideo(file: VideoFile, constraints: VideoConstraints, options?: {
258
+ raiseOnError?: boolean;
259
+ raise_on_error?: boolean;
260
+ durationSeconds?: number | null;
261
+ duration_seconds?: number | null;
262
+ }): string[];
263
+ export declare const validate_video: typeof validateVideo;
264
+ export declare function validateText(file: TextFile, constraints: ProviderConstraints, options?: {
265
+ raiseOnError?: boolean;
266
+ raise_on_error?: boolean;
267
+ }): string[];
268
+ export declare const validate_text: typeof validateText;
269
+ export declare function validateFile(file: FileInput, constraints: ProviderConstraints, options?: {
270
+ raiseOnError?: boolean;
271
+ raise_on_error?: boolean;
272
+ }): string[];
273
+ export declare const validate_file: typeof validateFile;
274
+ export declare class FileProcessor {
275
+ readonly constraints: ProviderConstraints | null;
276
+ constructor(options?: {
277
+ constraints?: ProviderConstraints | string | null;
278
+ } | ProviderConstraints | string | null);
279
+ validate(file: FileInput): string[];
280
+ process(file: FileInput): FileInput | FileInput[];
281
+ processFiles(files: Record<string, FileInput>): Record<string, FileInput>;
282
+ process_files(files: Record<string, FileInput>): Record<string, FileInput>;
283
+ aprocessFiles(files: Record<string, FileInput>): Promise<Record<string, FileInput>>;
284
+ aprocess_files(files: Record<string, FileInput>): Promise<Record<string, FileInput>>;
285
+ private fileMode;
286
+ private chunkProcess;
287
+ }
288
+ export declare function chunkText(file: TextFile, maxChars: number, options?: {
289
+ overlapChars?: number;
290
+ overlap_chars?: number;
291
+ splitOnNewlines?: boolean;
292
+ split_on_newlines?: boolean;
293
+ }): TextFile[];
294
+ export declare const chunk_text: typeof chunkText;
295
+ export declare function chunkPDF(_file: PDFFile, _maxPages: number): PDFFile[];
296
+ export declare const chunk_pdf: typeof chunkPDF;
297
+ export declare function resizeImage(_file: ImageFile, _maxWidth: number, _maxHeight: number): ImageFile;
298
+ export declare const resize_image: typeof resizeImage;
299
+ export declare function optimizeImage(_file: ImageFile, _targetSizeBytes: number): ImageFile;
300
+ export declare const optimize_image: typeof optimizeImage;
301
+ export declare class CachedUpload {
302
+ readonly fileId: string;
303
+ readonly file_id: string;
304
+ readonly provider: string;
305
+ readonly fileUri: string | null;
306
+ readonly file_uri: string | null;
307
+ readonly contentType: string;
308
+ readonly content_type: string;
309
+ readonly uploadedAt: Date;
310
+ readonly uploaded_at: Date;
311
+ readonly expiresAt: Date | null;
312
+ readonly expires_at: Date | null;
313
+ constructor(options: {
314
+ fileId?: string;
315
+ file_id?: string;
316
+ provider: string;
317
+ fileUri?: string | null;
318
+ file_uri?: string | null;
319
+ contentType?: string;
320
+ content_type?: string;
321
+ uploadedAt?: Date;
322
+ uploaded_at?: Date;
323
+ expiresAt?: Date | null;
324
+ expires_at?: Date | null;
325
+ });
326
+ isExpired(now?: Date): boolean;
327
+ is_expired(now?: Date): boolean;
328
+ }
329
+ export declare class UploadCache {
330
+ readonly ttl: number;
331
+ readonly namespace: string;
332
+ readonly maxEntries: number | null;
333
+ readonly max_entries: number | null;
334
+ private readonly entries;
335
+ private readonly providerKeys;
336
+ private readonly accessOrder;
337
+ constructor(options?: {
338
+ ttl?: number;
339
+ namespace?: string;
340
+ cacheType?: string;
341
+ cache_type?: string;
342
+ maxEntries?: number | null;
343
+ max_entries?: number | null;
344
+ });
345
+ get size(): number;
346
+ get length(): number;
347
+ get(file: FileInput, provider: FileProvider): CachedUpload | null;
348
+ get_by_hash(fileHash: string, provider: FileProvider): CachedUpload | null;
349
+ getByHash(fileHash: string, provider: FileProvider): CachedUpload | null;
350
+ aget(file: FileInput, provider: FileProvider): Promise<CachedUpload | null>;
351
+ aget_by_hash(fileHash: string, provider: FileProvider): Promise<CachedUpload | null>;
352
+ agetByHash(fileHash: string, provider: FileProvider): Promise<CachedUpload | null>;
353
+ set(file: FileInput, provider: FileProvider, fileIdOrOptions: string | {
354
+ fileId?: string;
355
+ file_id?: string;
356
+ fileUri?: string | null;
357
+ file_uri?: string | null;
358
+ expiresAt?: Date | null;
359
+ expires_at?: Date | null;
360
+ }, fileUri?: string | null, expiresAt?: Date | null): CachedUpload;
361
+ set_by_hash(fileHash: string, contentType: string, provider: FileProvider, fileId: string, fileUri?: string | null, expiresAt?: Date | null): CachedUpload;
362
+ setByHash(fileHash: string, contentType: string, provider: FileProvider, fileId: string, fileUri?: string | null, expiresAt?: Date | null): CachedUpload;
363
+ aset(file: FileInput, provider: FileProvider, fileId: string, fileUri?: string | null, expiresAt?: Date | null): Promise<CachedUpload>;
364
+ aset_by_hash(fileHash: string, contentType: string, provider: FileProvider, fileId: string, fileUri?: string | null, expiresAt?: Date | null): Promise<CachedUpload>;
365
+ asetByHash(fileHash: string, contentType: string, provider: FileProvider, fileId: string, fileUri?: string | null, expiresAt?: Date | null): Promise<CachedUpload>;
366
+ remove(file: FileInput, provider: FileProvider): boolean;
367
+ aremove(file: FileInput, provider: FileProvider): Promise<boolean>;
368
+ removeByFileId(fileId: string, provider: FileProvider): boolean;
369
+ remove_by_file_id(fileId: string, provider: FileProvider): boolean;
370
+ aremove_by_file_id(fileId: string, provider: FileProvider): Promise<boolean>;
371
+ clearExpired(): number;
372
+ clear_expired(): number;
373
+ aclear_expired(): Promise<number>;
374
+ clear(): number;
375
+ aclear(): Promise<number>;
376
+ getAllForProvider(provider: FileProvider): CachedUpload[];
377
+ get_all_for_provider(provider: FileProvider): CachedUpload[];
378
+ aget_all_for_provider(provider: FileProvider): Promise<CachedUpload[]>;
379
+ getProviders(): Set<string>;
380
+ get_providers(): Set<string>;
381
+ private getCachedByKey;
382
+ private trackKey;
383
+ private untrackKey;
384
+ private evictIfNeeded;
385
+ }
386
+ export declare function getUploadCache(options?: {
387
+ ttl?: number;
388
+ namespace?: string;
389
+ cacheType?: string;
390
+ cache_type?: string;
391
+ maxEntries?: number | null;
392
+ max_entries?: number | null;
393
+ }): UploadCache;
394
+ export declare const get_upload_cache: typeof getUploadCache;
395
+ export declare function resetUploadCache(): void;
396
+ export declare const reset_upload_cache: typeof resetUploadCache;
397
+ export declare abstract class FileSource {
398
+ abstract readonly filename: string | null;
399
+ abstract readonly contentType: string;
400
+ get content_type(): string;
401
+ abstract read(): Uint8Array;
402
+ aread(): Promise<Uint8Array>;
403
+ readChunks(chunkSize?: number): IterableIterator<Uint8Array>;
404
+ read_chunks(chunkSize?: number): IterableIterator<Uint8Array>;
405
+ }
406
+ type FileUrlFetchResult = {
407
+ content: Uint8Array | Buffer | string;
408
+ contentType?: string | null;
409
+ };
410
+ type FileUrlFetcher = (url: string) => FileUrlFetchResult | Promise<FileUrlFetchResult>;
411
+ export declare class FilePath extends FileSource {
412
+ readonly path: string;
413
+ readonly maxSizeBytes: number;
414
+ readonly max_size_bytes: number;
415
+ readonly contentType: string;
416
+ private content;
417
+ constructor(options: {
418
+ path: string;
419
+ maxSizeBytes?: number;
420
+ max_size_bytes?: number;
421
+ });
422
+ get filename(): string;
423
+ read(): Uint8Array;
424
+ }
425
+ export declare class FileBytes extends FileSource {
426
+ readonly data: Uint8Array;
427
+ readonly filename: string | null;
428
+ readonly contentType: string;
429
+ constructor(options: {
430
+ data: Uint8Array | Buffer | string;
431
+ filename?: string | null;
432
+ });
433
+ read(): Uint8Array;
434
+ }
435
+ export declare class FileStream extends FileSource {
436
+ readonly stream: FileReadable;
437
+ filename: string | null;
438
+ readonly contentType: string;
439
+ private content;
440
+ constructor(options: {
441
+ stream: FileReadable;
442
+ filename?: string | null;
443
+ });
444
+ read(): Uint8Array;
445
+ close(): void;
446
+ }
447
+ export declare class FileUrl extends FileSource {
448
+ readonly url: string;
449
+ readonly filename: string | null;
450
+ private detectedContentType;
451
+ private content;
452
+ private readonly fetcher;
453
+ constructor(options: {
454
+ url: string;
455
+ filename?: string | null;
456
+ fetcher?: FileUrlFetcher | null;
457
+ });
458
+ get contentType(): string;
459
+ read(): Uint8Array;
460
+ aread(): Promise<Uint8Array>;
461
+ private applyFetchedContent;
462
+ }
463
+ export declare abstract class BaseFile {
464
+ readonly source: FileSource;
465
+ readonly mode: FileMode;
466
+ constructor(options: {
467
+ source: FileSourceInput;
468
+ mode?: FileMode;
469
+ } | FileSourceInput);
470
+ get filename(): string | null;
471
+ get contentType(): string;
472
+ get content_type(): string;
473
+ read(): Uint8Array;
474
+ aread(): Promise<Uint8Array>;
475
+ readText(encoding?: BufferEncoding): string;
476
+ read_text(encoding?: BufferEncoding): string;
477
+ keys(): string[];
478
+ getItem(key: string): this;
479
+ __getitem__(key: string): this;
480
+ protected unpackKey(): string;
481
+ }
482
+ export declare class ImageFile extends BaseFile {
483
+ }
484
+ export declare class PDFFile extends BaseFile {
485
+ }
486
+ export declare class TextFile extends BaseFile {
487
+ }
488
+ export declare class AudioFile extends BaseFile {
489
+ }
490
+ export declare class VideoFile extends BaseFile {
491
+ }
492
+ export declare class File extends BaseFile {
493
+ }
494
+ export declare function detectContentType(data: Uint8Array | Buffer | string, filename?: string | null): string;
495
+ export declare const detect_content_type: typeof detectContentType;
496
+ export declare function wrapFileSource(source: FileSource): FileInput;
497
+ export declare const wrap_file_source: typeof wrapFileSource;
498
+ export declare function normalizeInputFiles(inputFiles: readonly (FileSourceInput | FileInput)[]): Record<string, FileInput>;
499
+ export declare const normalize_input_files: typeof normalizeInputFiles;
500
+ export declare class FileResolverConfig {
501
+ readonly preferUpload: boolean;
502
+ readonly prefer_upload: boolean;
503
+ readonly uploadThresholdBytes: number | null;
504
+ readonly upload_threshold_bytes: number | null;
505
+ readonly useBytesForBedrock: boolean;
506
+ readonly use_bytes_for_bedrock: boolean;
507
+ constructor(options?: {
508
+ preferUpload?: boolean;
509
+ prefer_upload?: boolean;
510
+ uploadThresholdBytes?: number | null;
511
+ upload_threshold_bytes?: number | null;
512
+ useBytesForBedrock?: boolean;
513
+ use_bytes_for_bedrock?: boolean;
514
+ });
515
+ }
516
+ export declare class FileResolver {
517
+ readonly config: FileResolverConfig;
518
+ readonly uploadCache: UploadCache | null;
519
+ readonly upload_cache: UploadCache | null;
520
+ constructor(options?: {
521
+ config?: FileResolverConfig | ConstructorParameters<typeof FileResolverConfig>[0];
522
+ uploadCache?: UploadCache | null;
523
+ upload_cache?: UploadCache | null;
524
+ });
525
+ resolve(file: FileInput, provider: FileProvider): ResolvedFileType;
526
+ aresolve(file: FileInput, provider: FileProvider): Promise<ResolvedFileType>;
527
+ resolveFiles(files: Record<string, FileInput>, provider: FileProvider): Record<string, ResolvedFileType>;
528
+ resolve_files(files: Record<string, FileInput>, provider: FileProvider): Record<string, ResolvedFileType>;
529
+ aresolveFiles(files: Record<string, FileInput>, provider: FileProvider, maxConcurrency?: number): Promise<Record<string, ResolvedFileType>>;
530
+ aresolve_files(files: Record<string, FileInput>, provider: FileProvider, max_concurrency?: number): Promise<Record<string, ResolvedFileType>>;
531
+ getCachedUploads(provider: FileProvider): CachedUpload[];
532
+ get_cached_uploads(provider: FileProvider): CachedUpload[];
533
+ clearCache(): void;
534
+ clear_cache(): void;
535
+ private resolveCachedUpload;
536
+ private shouldUseUpload;
537
+ }
538
+ export type CreateResolverOptions = ConstructorParameters<typeof FileResolverConfig>[0] & {
539
+ provider?: FileProvider | null;
540
+ enableCache?: boolean;
541
+ enable_cache?: boolean;
542
+ };
543
+ export declare function createResolver(options?: FileResolverConfig | CreateResolverOptions): FileResolver;
544
+ export declare const create_resolver: typeof createResolver;
545
+ export type MultimodalContentApi = "completions" | "responses";
546
+ export declare function formatMultimodalContent(files: Record<string, FileInput>, provider: string, options?: {
547
+ api?: MultimodalContentApi;
548
+ text?: string | null;
549
+ } | MultimodalContentApi): Record<string, unknown>[];
550
+ export declare function format_multimodal_content(files: Record<string, FileInput>, provider: string, options?: {
551
+ api?: MultimodalContentApi;
552
+ text?: string | null;
553
+ } | MultimodalContentApi): Record<string, unknown>[];
554
+ export {};
@@ -0,0 +1,90 @@
1
+ import type { LLM } from "./llm.js";
2
+ import type { LLMMessage } from "./types.js";
3
+ export type ConversationalInputs = {
4
+ id?: string;
5
+ user_message?: string | Record<string, unknown>;
6
+ last_intent?: string;
7
+ };
8
+ export declare const ConversationalInputs: Readonly<{
9
+ kind: "ConversationalInputs";
10
+ }>;
11
+ export type ConversationalConfigOptions = {
12
+ defaultIntents?: readonly string[] | null;
13
+ default_intents?: readonly string[] | null;
14
+ intentLlm?: string | null;
15
+ intent_llm?: string | null;
16
+ interactivePrompt?: string;
17
+ interactive_prompt?: string;
18
+ interactiveTimeout?: number | null;
19
+ interactive_timeout?: number | null;
20
+ exitCommands?: readonly string[];
21
+ exit_commands?: readonly string[];
22
+ deferTraceFinalization?: boolean;
23
+ defer_trace_finalization?: boolean;
24
+ };
25
+ export declare class ConversationalConfig {
26
+ readonly defaultIntents: readonly string[] | null;
27
+ readonly default_intents: readonly string[] | null;
28
+ readonly intentLlm: string | null;
29
+ readonly intent_llm: string | null;
30
+ readonly interactivePrompt: string;
31
+ readonly interactive_prompt: string;
32
+ readonly interactiveTimeout: number | null;
33
+ readonly interactive_timeout: number | null;
34
+ readonly exitCommands: readonly string[];
35
+ readonly exit_commands: readonly string[];
36
+ readonly deferTraceFinalization: boolean;
37
+ readonly defer_trace_finalization: boolean;
38
+ constructor(options?: ConversationalConfigOptions);
39
+ }
40
+ export declare class ChatState {
41
+ id: string;
42
+ messages: LLMMessage[];
43
+ last_user_message: string | null;
44
+ lastUserMessage: string | null;
45
+ last_intent: string | null;
46
+ lastIntent: string | null;
47
+ session_ready: boolean;
48
+ sessionReady: boolean;
49
+ constructor(options?: {
50
+ id?: string;
51
+ messages?: readonly LLMMessage[];
52
+ last_user_message?: string | null;
53
+ lastUserMessage?: string | null;
54
+ last_intent?: string | null;
55
+ lastIntent?: string | null;
56
+ session_ready?: boolean;
57
+ sessionReady?: boolean;
58
+ });
59
+ }
60
+ export declare function normalizeKickoffInputs(inputs: Record<string, unknown> | null | undefined, options?: {
61
+ userMessage?: string | Record<string, unknown> | null;
62
+ user_message?: string | Record<string, unknown> | null;
63
+ sessionId?: string | null;
64
+ session_id?: string | null;
65
+ }): Record<string, unknown> | null;
66
+ export declare const normalize_kickoff_inputs: typeof normalizeKickoffInputs;
67
+ export declare function getConversationMessages(flow: unknown): LLMMessage[];
68
+ export declare const get_conversation_messages: typeof getConversationMessages;
69
+ export declare function appendMessage(flow: unknown, role: LLMMessage["role"], content: string, extra?: Record<string, unknown>): void;
70
+ export declare const append_message: typeof appendMessage;
71
+ export declare function setStateField(flow: unknown, name: string, value: unknown): void;
72
+ export declare const set_state_field: typeof setStateField;
73
+ export declare function receiveUserMessage(flow: unknown, text: string, options?: {
74
+ outcomes?: readonly string[] | null;
75
+ llm?: string | LLM | null;
76
+ }): string;
77
+ export declare const receive_user_message: typeof receiveUserMessage;
78
+ export declare function prepareConversationalTurn(flow: unknown, options?: {
79
+ userMessage?: string | Record<string, unknown> | null;
80
+ user_message?: string | Record<string, unknown> | null;
81
+ intents?: readonly string[] | null;
82
+ intentLlm?: string | LLM | null;
83
+ intent_llm?: string | LLM | null;
84
+ config?: ConversationalConfig | null;
85
+ }): void;
86
+ export declare const prepare_conversational_turn: typeof prepareConversationalTurn;
87
+ export declare function inputHistoryToMessages(entries: readonly unknown[]): LLMMessage[];
88
+ export declare const input_history_to_messages: typeof inputHistoryToMessages;
89
+ export declare function getConversationalConfig(flow: unknown): ConversationalConfig | null;
90
+ export declare const get_conversational_config: typeof getConversationalConfig;