@crewai-ts/core 0.1.12 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +174 -0
  2. package/dist/agent.d.ts +16 -18
  3. package/dist/auth.cjs +598 -0
  4. package/dist/auth.js +40 -0
  5. package/dist/{chunk-3PVW4JKT.js → chunk-C43UEMCX.js} +6712 -7268
  6. package/dist/chunk-CCOE6MLE.js +896 -0
  7. package/dist/chunk-HFQTF332.js +4455 -0
  8. package/dist/{chunk-BE4JYKSG.js → chunk-MM4ROIFG.js} +12 -1490
  9. package/dist/chunk-RH43TNKN.js +238 -0
  10. package/dist/chunk-S477WFUT.js +565 -0
  11. package/dist/chunk-SB7ADUQA.js +110 -0
  12. package/dist/chunk-T32G6KDW.js +40 -0
  13. package/dist/crew.d.ts +24 -26
  14. package/dist/events.cjs +7513 -0
  15. package/dist/events.js +406 -0
  16. package/dist/experimental-conversational.cjs +272 -0
  17. package/dist/experimental-conversational.js +26 -0
  18. package/dist/feature-hooks.cjs +149 -0
  19. package/dist/feature-hooks.d.ts +94 -0
  20. package/dist/feature-hooks.js +36 -0
  21. package/dist/index.cjs +33923 -64381
  22. package/dist/index.d.ts +2 -15
  23. package/dist/index.js +16720 -49562
  24. package/dist/input-provider.d.ts +3 -4
  25. package/dist/lite-agent.d.ts +4 -4
  26. package/dist/llm.cjs +7467 -0
  27. package/dist/llm.d.ts +0 -4
  28. package/dist/llm.js +225 -0
  29. package/dist/optional-yaml.d.ts +8 -0
  30. package/dist/project.d.ts +1 -1
  31. package/dist/schema-utils.cjs +968 -0
  32. package/dist/schema-utils.d.ts +1 -1
  33. package/dist/schema-utils.js +102 -0
  34. package/dist/state-provider-core.js +3 -2
  35. package/dist/task.d.ts +3 -4
  36. package/dist/tools.cjs +6872 -0
  37. package/dist/tools.d.ts +0 -60
  38. package/dist/tools.js +114 -0
  39. package/dist/types.cjs +68 -0
  40. package/dist/types.js +14 -0
  41. package/package.json +52 -111
  42. package/dist/a2a.d.ts +0 -1684
  43. package/dist/a2ui-schemas.d.ts +0 -3312
  44. package/dist/a2ui.d.ts +0 -379
  45. package/dist/flow-conversation.d.ts +0 -90
  46. package/dist/flow-definition.d.ts +0 -195
  47. package/dist/flow-persistence.d.ts +0 -107
  48. package/dist/flow-visualization.d.ts +0 -77
  49. package/dist/flow.d.ts +0 -927
  50. package/dist/knowledge.d.ts +0 -353
  51. package/dist/mcp-DS7UMYAM.js +0 -62
  52. package/dist/mcp.d.ts +0 -315
  53. package/dist/memory.d.ts +0 -915
  54. package/dist/openai-completion.d.ts +0 -327
  55. package/dist/provider-completions.d.ts +0 -596
  56. package/dist/rag.d.ts +0 -1074
@@ -1,353 +0,0 @@
1
- import { type EmbedderConfig, type RagClient, type SearchResult } from "./rag.js";
2
- export type KnowledgeSearchResult = {
3
- content: string;
4
- score: number;
5
- source: string | null;
6
- metadata: Record<string, unknown>;
7
- };
8
- export type KnowledgeQueryOptions = {
9
- resultsLimit?: number;
10
- results_limit?: number;
11
- scoreThreshold?: number | null;
12
- score_threshold?: number | null;
13
- };
14
- export declare const DEFAULT_KNOWLEDGE_SCORE_THRESHOLD = 0.6;
15
- export type KnowledgeSource = {
16
- readonly sourceType?: string;
17
- readonly metadata?: Record<string, unknown>;
18
- storage?: BaseKnowledgeStorage | null;
19
- chunks(): readonly string[];
20
- add?(): void;
21
- aadd?(): Promise<void>;
22
- get_embeddings?(): readonly unknown[];
23
- validate_content?(): unknown;
24
- };
25
- export type StringKnowledgeSourceOptions = {
26
- content: string;
27
- chunkSize?: number;
28
- chunkOverlap?: number;
29
- metadata?: Record<string, unknown>;
30
- storage?: BaseKnowledgeStorage | null;
31
- collectionName?: string | null;
32
- collection_name?: string | null;
33
- };
34
- export type FileKnowledgeSourceOptions = {
35
- filePaths?: string | readonly string[];
36
- file_path?: string | readonly string[];
37
- file_paths?: string | readonly string[];
38
- chunkSize?: number;
39
- chunkOverlap?: number;
40
- metadata?: Record<string, unknown>;
41
- storage?: BaseKnowledgeStorage | null;
42
- collectionName?: string | null;
43
- collection_name?: string | null;
44
- };
45
- export type BaseKnowledgeSourceOptions = {
46
- chunkSize?: number;
47
- chunk_size?: number;
48
- chunkOverlap?: number;
49
- chunk_overlap?: number;
50
- chunks?: readonly string[];
51
- chunkEmbeddings?: readonly unknown[];
52
- chunk_embeddings?: readonly unknown[];
53
- metadata?: Record<string, unknown>;
54
- storage?: BaseKnowledgeStorage | null;
55
- collectionName?: string | null;
56
- collection_name?: string | null;
57
- };
58
- export type PDFTextExtractor = (filePath: string, bytes: Buffer) => string;
59
- export type PDFKnowledgeSourceOptions = FileKnowledgeSourceOptions & {
60
- extractor?: PDFTextExtractor;
61
- };
62
- export type ExcelSheetData = readonly (readonly unknown[])[];
63
- export type ExcelWorkbookData = Record<string, ExcelSheetData>;
64
- export type ExcelTextExtractor = (filePath: string, bytes: Buffer) => ExcelWorkbookData | string;
65
- export type ExcelKnowledgeSourceOptions = FileKnowledgeSourceOptions & {
66
- extractor?: ExcelTextExtractor;
67
- };
68
- export type DoclingConversionResult = unknown;
69
- export type DoclingDocumentConverter = {
70
- convert_all?: (paths: readonly string[]) => Iterable<DoclingConversionResult>;
71
- convertAll?: (paths: readonly string[]) => Iterable<DoclingConversionResult>;
72
- } | ((paths: readonly string[]) => Iterable<DoclingConversionResult>);
73
- export type DoclingChunk = {
74
- text?: string | number | boolean | bigint | null | undefined;
75
- } | string;
76
- export type DoclingChunker = {
77
- chunk?: (document: unknown) => Iterable<DoclingChunk>;
78
- } | ((document: unknown) => Iterable<DoclingChunk>);
79
- export type CrewDoclingSourceOptions = FileKnowledgeSourceOptions & {
80
- documentConverter?: DoclingDocumentConverter | null;
81
- document_converter?: DoclingDocumentConverter | null;
82
- chunker?: DoclingChunker | null;
83
- };
84
- export declare class BaseKnowledgeSource {
85
- readonly chunkSize: number;
86
- readonly chunk_size: number;
87
- readonly chunkOverlap: number;
88
- readonly chunk_overlap: number;
89
- readonly metadata: Record<string, unknown>;
90
- readonly collectionName: string | null;
91
- readonly collection_name: string | null;
92
- storage: BaseKnowledgeStorage | null;
93
- chunks: string[];
94
- private chunkEmbeddingsValue;
95
- constructor(options?: BaseKnowledgeSourceOptions);
96
- get chunkEmbeddings(): unknown[];
97
- set chunkEmbeddings(value: readonly unknown[]);
98
- get chunk_embeddings(): unknown[];
99
- set chunk_embeddings(value: readonly unknown[]);
100
- validateContent(): unknown;
101
- validate_content(): unknown;
102
- add(): void;
103
- aadd(): Promise<void>;
104
- getEmbeddings(): readonly unknown[];
105
- get_embeddings(): readonly unknown[];
106
- chunkText(text: string): string[];
107
- _chunk_text(text: string): string[];
108
- saveDocuments(): void;
109
- _save_documents(): void;
110
- asaveDocuments(): Promise<void>;
111
- _asave_documents(): Promise<void>;
112
- }
113
- export type KnowledgeOptions = {
114
- sources?: readonly KnowledgeSource[];
115
- collectionName?: string | null;
116
- collection_name?: string | null;
117
- storage?: BaseKnowledgeStorage | null;
118
- embedder?: EmbedderConfig | null;
119
- };
120
- export type KnowledgeStorageOptions = {
121
- collectionName?: string | null;
122
- collection_name?: string | null;
123
- client?: RagClient | null;
124
- embedder?: EmbedderConfig | null;
125
- };
126
- export declare class StringKnowledgeSource implements KnowledgeSource {
127
- readonly sourceType = "string";
128
- readonly source_type = "string";
129
- readonly content: string;
130
- readonly chunkSize: number;
131
- readonly chunkOverlap: number;
132
- readonly metadata: Record<string, unknown>;
133
- readonly collectionName: string | null;
134
- readonly collection_name: string | null;
135
- storage: BaseKnowledgeStorage | null;
136
- constructor(options: StringKnowledgeSourceOptions | string);
137
- model_post_init(_context?: unknown): void;
138
- validateContent(): void;
139
- validate_content(): void;
140
- chunks(): readonly string[];
141
- _chunk_text(text: string): string[];
142
- add(): void;
143
- aadd(): Promise<void>;
144
- getEmbeddings(): readonly unknown[];
145
- get_embeddings(): readonly unknown[];
146
- saveDocuments(documents?: readonly string[]): void;
147
- _save_documents(): void;
148
- asaveDocuments(documents?: readonly string[]): Promise<void>;
149
- _asave_documents(): Promise<void>;
150
- }
151
- declare abstract class BaseTextKnowledgeSource implements KnowledgeSource {
152
- abstract readonly sourceType: string;
153
- readonly chunkSize: number;
154
- readonly chunkOverlap: number;
155
- readonly metadata: Record<string, unknown>;
156
- readonly collectionName: string | null;
157
- readonly collection_name: string | null;
158
- storage: BaseKnowledgeStorage | null;
159
- protected constructor(options: Pick<FileKnowledgeSourceOptions, "chunkSize" | "chunkOverlap" | "metadata" | "storage" | "collectionName" | "collection_name">);
160
- chunks(): readonly string[];
161
- _chunk_text(text: string): string[];
162
- validateContent(): void;
163
- validate_content(): void;
164
- add(): void;
165
- aadd(): Promise<void>;
166
- getEmbeddings(): readonly unknown[];
167
- get_embeddings(): readonly unknown[];
168
- protected abstract loadText(): string;
169
- saveDocuments(documents?: readonly string[]): void;
170
- _save_documents(): void;
171
- asaveDocuments(documents?: readonly string[]): Promise<void>;
172
- _asave_documents(): Promise<void>;
173
- }
174
- export declare abstract class BaseFileKnowledgeSource extends BaseTextKnowledgeSource {
175
- readonly filePath: string | readonly string[] | null;
176
- readonly file_path: string | readonly string[] | null;
177
- readonly filePaths: readonly string[];
178
- readonly file_paths: readonly string[];
179
- safeFilePaths: string[];
180
- safe_file_paths: string[];
181
- content: Record<string, string>;
182
- protected constructor(options: FileKnowledgeSourceOptions | string | readonly string[]);
183
- model_post_init(_context?: unknown): void;
184
- validateFilePath(value: string | readonly string[] | null, info?: {
185
- field_name?: string;
186
- data?: Record<string, unknown>;
187
- }): string | readonly string[] | null;
188
- validate_file_path(value: string | readonly string[] | null, info?: {
189
- field_name?: string;
190
- data?: Record<string, unknown>;
191
- }): string | readonly string[] | null;
192
- validateContent(): void;
193
- validate_content(): void;
194
- abstract loadContent(): Record<string, string>;
195
- load_content(): Record<string, string>;
196
- _load_content(): unknown;
197
- convertToPath(filePath: string): string;
198
- convert_to_path(filePath: string): string;
199
- protected loadText(): string;
200
- protected processFilePaths(): string[];
201
- _process_file_paths(): string[];
202
- }
203
- export declare class TextFileKnowledgeSource extends BaseFileKnowledgeSource {
204
- readonly sourceType = "text_file";
205
- readonly source_type = "text_file";
206
- constructor(options: FileKnowledgeSourceOptions | string | readonly string[]);
207
- loadContent(): Record<string, string>;
208
- }
209
- export declare class JSONKnowledgeSource extends BaseFileKnowledgeSource {
210
- readonly sourceType = "json";
211
- readonly source_type = "json";
212
- constructor(options: FileKnowledgeSourceOptions | string | readonly string[]);
213
- loadContent(): Record<string, string>;
214
- _json_to_text(data: unknown, level?: number): string;
215
- }
216
- export declare class CSVKnowledgeSource extends BaseFileKnowledgeSource {
217
- readonly sourceType = "csv";
218
- readonly source_type = "csv";
219
- constructor(options: FileKnowledgeSourceOptions | string | readonly string[]);
220
- loadContent(): Record<string, string>;
221
- }
222
- export declare class PDFKnowledgeSource extends BaseFileKnowledgeSource {
223
- readonly sourceType = "pdf";
224
- readonly source_type = "pdf";
225
- private readonly extractor;
226
- constructor(options: PDFKnowledgeSourceOptions | string | readonly string[]);
227
- loadContent(): Record<string, string>;
228
- _import_pdfplumber(): never;
229
- _chunk_text(text: string): string[];
230
- add(): void;
231
- aadd(): Promise<void>;
232
- private loadContentAsync;
233
- }
234
- export declare class ExcelKnowledgeSource extends BaseFileKnowledgeSource {
235
- readonly sourceType = "excel";
236
- readonly source_type = "excel";
237
- private readonly extractor;
238
- constructor(options: ExcelKnowledgeSourceOptions | string | readonly string[]);
239
- loadContent(): Record<string, string>;
240
- _import_dependencies(): {
241
- readWorkbook: typeof parseXlsxWorkbook;
242
- };
243
- }
244
- export declare class CrewDoclingSource extends BaseFileKnowledgeSource {
245
- readonly sourceType = "docling";
246
- readonly source_type = "docling";
247
- private readonly documentConverter;
248
- private readonly chunker;
249
- private doclingDocuments;
250
- constructor(options: CrewDoclingSourceOptions | string | readonly string[]);
251
- model_post_init(_context?: unknown): void;
252
- validateContent(): string[];
253
- validate_content(): string[];
254
- loadContent(): Record<string, string>;
255
- load_content(): Record<string, string>;
256
- _load_content(): unknown[];
257
- add(): void;
258
- aadd(): Promise<void>;
259
- _convert_source_to_docling_documents(): unknown[];
260
- _chunk_doc(document: unknown): Iterable<string>;
261
- _save_documents(): void;
262
- _asave_documents(): Promise<void>;
263
- _validate_url(url: string): boolean;
264
- private convertSourceToDoclingDocuments;
265
- private chunkDoc;
266
- private saveDoclingDocuments;
267
- private asaveDoclingDocuments;
268
- }
269
- export declare class SourceHelper {
270
- static readonly SUPPORTED_FILE_TYPES: readonly [".csv", ".pdf", ".json", ".txt", ".xlsx", ".xls"];
271
- static readonly _FILE_TYPE_MAP: {
272
- readonly ".csv": typeof CSVKnowledgeSource;
273
- readonly ".pdf": typeof PDFKnowledgeSource;
274
- readonly ".json": typeof JSONKnowledgeSource;
275
- readonly ".txt": typeof TextFileKnowledgeSource;
276
- readonly ".xlsx": typeof ExcelKnowledgeSource;
277
- readonly ".xls": typeof ExcelKnowledgeSource;
278
- };
279
- readonly supportedFileTypes: readonly [".csv", ".pdf", ".json", ".txt", ".xlsx", ".xls"];
280
- readonly _fileTypeMap: {
281
- readonly ".csv": typeof CSVKnowledgeSource;
282
- readonly ".pdf": typeof PDFKnowledgeSource;
283
- readonly ".json": typeof JSONKnowledgeSource;
284
- readonly ".txt": typeof TextFileKnowledgeSource;
285
- readonly ".xlsx": typeof ExcelKnowledgeSource;
286
- readonly ".xls": typeof ExcelKnowledgeSource;
287
- };
288
- readonly _file_type_map: {
289
- readonly ".csv": typeof CSVKnowledgeSource;
290
- readonly ".pdf": typeof PDFKnowledgeSource;
291
- readonly ".json": typeof JSONKnowledgeSource;
292
- readonly ".txt": typeof TextFileKnowledgeSource;
293
- readonly ".xlsx": typeof ExcelKnowledgeSource;
294
- readonly ".xls": typeof ExcelKnowledgeSource;
295
- };
296
- isSupportedFile(filePath: string): boolean;
297
- getSource(filePath: string, metadata?: Record<string, unknown> | null): KnowledgeSource;
298
- static isSupportedFile(filePath: string): boolean;
299
- static is_supported_file(filePath: string): boolean;
300
- static getSource(filePath: string, metadata?: Record<string, unknown> | null): KnowledgeSource;
301
- static get_source(filePath: string, metadata?: Record<string, unknown> | null): KnowledgeSource;
302
- }
303
- export declare class Knowledge {
304
- readonly sources: readonly KnowledgeSource[];
305
- readonly collectionName: string | null;
306
- readonly collection_name: string | null;
307
- readonly storage: BaseKnowledgeStorage | null;
308
- private entries;
309
- constructor(options?: KnowledgeOptions);
310
- addSources(sources?: readonly KnowledgeSource[]): void;
311
- add_sources(sources?: readonly KnowledgeSource[]): void;
312
- aaddSources(sources?: readonly KnowledgeSource[]): Promise<void>;
313
- aadd_sources(sources?: readonly KnowledgeSource[]): Promise<void>;
314
- add(content: string, options?: {
315
- source?: string | null;
316
- metadata?: Record<string, unknown> | null;
317
- }): void;
318
- query(query: string | readonly string[], options?: KnowledgeQueryOptions): KnowledgeSearchResult[];
319
- aquery(query: string | readonly string[], options?: KnowledgeQueryOptions): Promise<KnowledgeSearchResult[]>;
320
- reset(): void;
321
- areset(): Promise<void>;
322
- private documentsFromSources;
323
- }
324
- export declare abstract class BaseKnowledgeStorage {
325
- abstract search(query: readonly string[], limit?: number, metadataFilter?: Record<string, unknown> | null, scoreThreshold?: number): SearchResult[];
326
- abstract asearch(query: readonly string[], limit?: number, metadataFilter?: Record<string, unknown> | null, scoreThreshold?: number): Promise<SearchResult[]>;
327
- abstract save(documents: readonly string[]): void;
328
- abstract asave(documents: readonly string[]): Promise<void>;
329
- abstract reset(): void;
330
- abstract areset(): Promise<void>;
331
- }
332
- export declare class KnowledgeStorage extends BaseKnowledgeStorage {
333
- readonly collectionName: string | null;
334
- readonly collection_name: string | null;
335
- readonly embedder: EmbedderConfig | null;
336
- private client;
337
- constructor(options?: KnowledgeStorageOptions);
338
- _init_client(): this;
339
- search(query: readonly string[], limit?: number, metadataFilter?: Record<string, unknown> | null, scoreThreshold?: number): SearchResult[];
340
- asearch(query: readonly string[], limit?: number, metadataFilter?: Record<string, unknown> | null, scoreThreshold?: number): Promise<SearchResult[]>;
341
- save(documents: readonly string[]): void;
342
- asave(documents: readonly string[]): Promise<void>;
343
- reset(): void;
344
- areset(): Promise<void>;
345
- _get_client(): RagClient;
346
- get _client(): RagClient | null;
347
- set _client(client: RagClient | null);
348
- ragCollectionName(): string;
349
- rag_collection_name(): string;
350
- }
351
- export declare function extractKnowledgeContext(results: readonly unknown[]): string;
352
- declare function parseXlsxWorkbook(bytes: Buffer): ExcelWorkbookData;
353
- export {};
@@ -1,62 +0,0 @@
1
- import {
2
- BaseTransport,
3
- HTTPTransport,
4
- MCPClient,
5
- MCPReadStream,
6
- MCPServerConfig,
7
- MCPServerHTTP,
8
- MCPServerSSE,
9
- MCPServerStdio,
10
- MCPToolResolver,
11
- MCPWriteStream,
12
- MCP_CONNECTION_TIMEOUT,
13
- MCP_DISCOVERY_TIMEOUT,
14
- MCP_MAX_RETRIES,
15
- MCP_TOOL_EXECUTION_TIMEOUT,
16
- SSETransport,
17
- StaticToolFilter,
18
- StdioTransport,
19
- ToolFilter,
20
- ToolFilterContext,
21
- TransportType,
22
- _MCPToolResult,
23
- createDynamicToolFilter,
24
- createStaticToolFilter,
25
- create_dynamic_tool_filter,
26
- create_static_tool_filter,
27
- isMCPServerConfig,
28
- is_mcp_server_config,
29
- mcp_schema_cache
30
- } from "./chunk-BE4JYKSG.js";
31
- import "./chunk-3PVW4JKT.js";
32
- import "./chunk-LWD4QED4.js";
33
- export {
34
- BaseTransport,
35
- HTTPTransport,
36
- MCPClient,
37
- MCPReadStream,
38
- MCPServerConfig,
39
- MCPServerHTTP,
40
- MCPServerSSE,
41
- MCPServerStdio,
42
- MCPToolResolver,
43
- MCPWriteStream,
44
- MCP_CONNECTION_TIMEOUT,
45
- MCP_DISCOVERY_TIMEOUT,
46
- MCP_MAX_RETRIES,
47
- MCP_TOOL_EXECUTION_TIMEOUT,
48
- SSETransport,
49
- StaticToolFilter,
50
- StdioTransport,
51
- ToolFilter,
52
- ToolFilterContext,
53
- TransportType,
54
- _MCPToolResult,
55
- createDynamicToolFilter,
56
- createStaticToolFilter,
57
- create_dynamic_tool_filter,
58
- create_static_tool_filter,
59
- isMCPServerConfig,
60
- is_mcp_server_config,
61
- mcp_schema_cache
62
- };