@crewai-ts/core 0.1.13 → 0.2.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 (55) hide show
  1. package/dist/agent.d.ts +16 -18
  2. package/dist/auth.cjs +598 -0
  3. package/dist/auth.js +40 -0
  4. package/dist/{chunk-3PVW4JKT.js → chunk-C43UEMCX.js} +6712 -7268
  5. package/dist/chunk-CCOE6MLE.js +896 -0
  6. package/dist/chunk-HFQTF332.js +4455 -0
  7. package/dist/{chunk-BE4JYKSG.js → chunk-MM4ROIFG.js} +12 -1490
  8. package/dist/chunk-RH43TNKN.js +238 -0
  9. package/dist/chunk-S477WFUT.js +565 -0
  10. package/dist/chunk-SB7ADUQA.js +110 -0
  11. package/dist/chunk-T32G6KDW.js +40 -0
  12. package/dist/crew.d.ts +24 -26
  13. package/dist/events.cjs +7513 -0
  14. package/dist/events.js +406 -0
  15. package/dist/experimental-conversational.cjs +272 -0
  16. package/dist/experimental-conversational.js +26 -0
  17. package/dist/feature-hooks.cjs +149 -0
  18. package/dist/feature-hooks.d.ts +94 -0
  19. package/dist/feature-hooks.js +36 -0
  20. package/dist/index.cjs +33923 -64381
  21. package/dist/index.d.ts +2 -15
  22. package/dist/index.js +16720 -49562
  23. package/dist/input-provider.d.ts +3 -4
  24. package/dist/lite-agent.d.ts +4 -4
  25. package/dist/llm.cjs +7467 -0
  26. package/dist/llm.d.ts +0 -4
  27. package/dist/llm.js +225 -0
  28. package/dist/optional-yaml.d.ts +8 -0
  29. package/dist/project.d.ts +1 -1
  30. package/dist/schema-utils.cjs +968 -0
  31. package/dist/schema-utils.d.ts +1 -1
  32. package/dist/schema-utils.js +102 -0
  33. package/dist/state-provider-core.js +3 -2
  34. package/dist/task.d.ts +3 -4
  35. package/dist/tools.cjs +6872 -0
  36. package/dist/tools.d.ts +0 -60
  37. package/dist/tools.js +114 -0
  38. package/dist/types.cjs +68 -0
  39. package/dist/types.js +14 -0
  40. package/package.json +52 -111
  41. package/dist/a2a.d.ts +0 -1684
  42. package/dist/a2ui-schemas.d.ts +0 -3312
  43. package/dist/a2ui.d.ts +0 -379
  44. package/dist/flow-conversation.d.ts +0 -90
  45. package/dist/flow-definition.d.ts +0 -195
  46. package/dist/flow-persistence.d.ts +0 -107
  47. package/dist/flow-visualization.d.ts +0 -77
  48. package/dist/flow.d.ts +0 -927
  49. package/dist/knowledge.d.ts +0 -353
  50. package/dist/mcp-DS7UMYAM.js +0 -62
  51. package/dist/mcp.d.ts +0 -315
  52. package/dist/memory.d.ts +0 -915
  53. package/dist/openai-completion.d.ts +0 -327
  54. package/dist/provider-completions.d.ts +0 -596
  55. package/dist/rag.d.ts +0 -1074
package/dist/mcp.d.ts DELETED
@@ -1,315 +0,0 @@
1
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
- import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
3
- import { type BaseTool } from "./tools.js";
4
- export declare const TransportType: {
5
- readonly STDIO: "stdio";
6
- readonly HTTP: "http";
7
- readonly STREAMABLE_HTTP: "streamable-http";
8
- readonly SSE: "sse";
9
- };
10
- export type TransportType = typeof TransportType[keyof typeof TransportType];
11
- export type MCPToolDefinition = Record<string, unknown> & {
12
- name?: string;
13
- };
14
- export declare const MCPReadStream: Readonly<{
15
- kind: "MCPReadStream";
16
- }>;
17
- export declare const MCPWriteStream: Readonly<{
18
- kind: "MCPWriteStream";
19
- }>;
20
- export type ToolFilterContextOptions = {
21
- agent: unknown;
22
- serverName?: string;
23
- server_name?: string;
24
- runContext?: Record<string, unknown> | null;
25
- run_context?: Record<string, unknown> | null;
26
- };
27
- export declare class ToolFilterContext {
28
- readonly agent: unknown;
29
- readonly serverName: string;
30
- readonly server_name: string;
31
- readonly runContext: Record<string, unknown> | null;
32
- readonly run_context: Record<string, unknown> | null;
33
- constructor(options: ToolFilterContextOptions);
34
- }
35
- type MaybePromise<T> = T | Promise<T>;
36
- export type ToolFilter = ((tool: MCPToolDefinition) => MaybePromise<boolean>) | ((context: ToolFilterContext, tool: MCPToolDefinition) => MaybePromise<boolean>);
37
- export declare const ToolFilter: Readonly<{
38
- kind: "ToolFilter";
39
- }>;
40
- export declare class StaticToolFilter {
41
- readonly allowedToolNames: ReadonlySet<string>;
42
- readonly allowed_tool_names: ReadonlySet<string>;
43
- readonly blockedToolNames: ReadonlySet<string>;
44
- readonly blocked_tool_names: ReadonlySet<string>;
45
- constructor(options?: {
46
- allowedToolNames?: readonly string[] | null;
47
- allowed_tool_names?: readonly string[] | null;
48
- blockedToolNames?: readonly string[] | null;
49
- blocked_tool_names?: readonly string[] | null;
50
- });
51
- filter(tool: MCPToolDefinition): boolean;
52
- call(tool: MCPToolDefinition): boolean;
53
- __call__(tool: MCPToolDefinition): boolean;
54
- }
55
- export declare function createStaticToolFilter(allowedToolNames?: readonly string[] | null, blockedToolNames?: readonly string[] | null): (tool: MCPToolDefinition) => boolean;
56
- export declare const create_static_tool_filter: typeof createStaticToolFilter;
57
- export declare function createDynamicToolFilter<TFilter extends (context: ToolFilterContext, tool: MCPToolDefinition) => MaybePromise<boolean>>(filterFunc: TFilter): TFilter;
58
- export declare const create_dynamic_tool_filter: typeof createDynamicToolFilter;
59
- export type MCPServerStdioOptions = {
60
- command: string;
61
- args?: readonly string[];
62
- env?: Record<string, string> | null;
63
- toolFilter?: ToolFilter | null;
64
- tool_filter?: ToolFilter | null;
65
- cacheToolsList?: boolean;
66
- cache_tools_list?: boolean;
67
- };
68
- export declare class MCPServerStdio {
69
- readonly command: string;
70
- readonly args: readonly string[];
71
- readonly env: Record<string, string> | null;
72
- readonly toolFilter: ToolFilter | null;
73
- readonly tool_filter: ToolFilter | null;
74
- readonly cacheToolsList: boolean;
75
- readonly cache_tools_list: boolean;
76
- constructor(options: MCPServerStdioOptions);
77
- }
78
- export type MCPServerHTTPOptions = {
79
- url: string;
80
- headers?: Record<string, string> | null;
81
- streamable?: boolean;
82
- toolFilter?: ToolFilter | null;
83
- tool_filter?: ToolFilter | null;
84
- cacheToolsList?: boolean;
85
- cache_tools_list?: boolean;
86
- };
87
- export declare class MCPServerHTTP {
88
- readonly url: string;
89
- readonly headers: Record<string, string> | null;
90
- readonly streamable: boolean;
91
- readonly toolFilter: ToolFilter | null;
92
- readonly tool_filter: ToolFilter | null;
93
- readonly cacheToolsList: boolean;
94
- readonly cache_tools_list: boolean;
95
- constructor(options: MCPServerHTTPOptions);
96
- }
97
- export type MCPServerSSEOptions = {
98
- url: string;
99
- headers?: Record<string, string> | null;
100
- toolFilter?: ToolFilter | null;
101
- tool_filter?: ToolFilter | null;
102
- cacheToolsList?: boolean;
103
- cache_tools_list?: boolean;
104
- };
105
- export declare class MCPServerSSE {
106
- readonly url: string;
107
- readonly headers: Record<string, string> | null;
108
- readonly toolFilter: ToolFilter | null;
109
- readonly tool_filter: ToolFilter | null;
110
- readonly cacheToolsList: boolean;
111
- readonly cache_tools_list: boolean;
112
- constructor(options: MCPServerSSEOptions);
113
- }
114
- export type MCPServerConfig = MCPServerStdio | MCPServerHTTP | MCPServerSSE;
115
- export declare const MCPServerConfig: Readonly<{
116
- kind: "MCPServerConfig";
117
- }>;
118
- export declare abstract class BaseTransport {
119
- protected readStreamValue: unknown;
120
- protected writeStreamValue: unknown;
121
- protected connectedValue: boolean;
122
- protected sdkTransportValue: Transport | null;
123
- abstract get transportType(): TransportType;
124
- protected abstract createSdkTransport(): Transport;
125
- get transport_type(): TransportType;
126
- get connected(): boolean;
127
- get readStream(): unknown;
128
- get read_stream(): unknown;
129
- get writeStream(): unknown;
130
- get write_stream(): unknown;
131
- connect(): Promise<this>;
132
- disconnect(): Promise<void>;
133
- aenter(): Promise<this>;
134
- __aenter__(): Promise<this>;
135
- aexit(_excType?: unknown, _excVal?: unknown, _excTb?: unknown): Promise<void>;
136
- __aexit__(excType?: unknown, excVal?: unknown, excTb?: unknown): Promise<void>;
137
- protected setStreams(read: unknown, write: unknown): void;
138
- _set_streams(read: unknown, write: unknown): void;
139
- protected clearStreams(): void;
140
- _clear_streams(): void;
141
- markConnectedForClient(): void;
142
- clearConnectedForClient(): void;
143
- getSdkTransport(): Transport;
144
- }
145
- export declare class HTTPTransport extends BaseTransport {
146
- readonly url: string;
147
- readonly headers: Record<string, string>;
148
- readonly streamable: boolean;
149
- constructor(options: MCPServerHTTPOptions | string, headers?: Record<string, string> | null, streamable?: boolean);
150
- get transportType(): TransportType;
151
- protected createSdkTransport(): Transport;
152
- }
153
- export declare class SSETransport extends BaseTransport {
154
- readonly url: string;
155
- readonly headers: Record<string, string>;
156
- constructor(options: MCPServerSSEOptions | string, headers?: Record<string, string> | null);
157
- get transportType(): TransportType;
158
- protected createSdkTransport(): Transport;
159
- }
160
- export declare class StdioTransport extends BaseTransport {
161
- readonly command: string;
162
- readonly args: readonly string[];
163
- readonly env: Record<string, string>;
164
- constructor(options: MCPServerStdioOptions | string, args?: readonly string[] | null, env?: Record<string, string> | null);
165
- get transportType(): TransportType;
166
- protected createSdkTransport(): Transport;
167
- }
168
- export declare function isMCPServerConfig(value: unknown): value is MCPServerConfig;
169
- export declare const is_mcp_server_config: typeof isMCPServerConfig;
170
- export declare const MCP_CONNECTION_TIMEOUT = 30;
171
- export declare const MCP_TOOL_EXECUTION_TIMEOUT = 30;
172
- export declare const MCP_DISCOVERY_TIMEOUT = 30;
173
- export declare const MCP_MAX_RETRIES = 3;
174
- export declare class _MCPToolResult {
175
- readonly content: string;
176
- readonly isError: boolean;
177
- readonly is_error: boolean;
178
- constructor(content: string, isError?: boolean);
179
- }
180
- type SchemaCacheEntry = {
181
- tools: MCPToolDefinition[];
182
- createdAt: number;
183
- };
184
- export type MCPClientOptions = {
185
- connectTimeout?: number;
186
- connect_timeout?: number;
187
- executionTimeout?: number;
188
- execution_timeout?: number;
189
- discoveryTimeout?: number;
190
- discovery_timeout?: number;
191
- maxRetries?: number;
192
- max_retries?: number;
193
- cacheToolsList?: boolean;
194
- cache_tools_list?: boolean;
195
- };
196
- export declare class MCPClient {
197
- readonly transport: BaseTransport;
198
- readonly connectTimeout: number;
199
- readonly connect_timeout: number;
200
- readonly executionTimeout: number;
201
- readonly execution_timeout: number;
202
- readonly discoveryTimeout: number;
203
- readonly discovery_timeout: number;
204
- readonly maxRetries: number;
205
- readonly max_retries: number;
206
- readonly cacheToolsList: boolean;
207
- readonly cache_tools_list: boolean;
208
- private client;
209
- private initialized;
210
- private wasConnected;
211
- constructor(transport: BaseTransport, options?: MCPClientOptions);
212
- get connected(): boolean;
213
- get session(): Client;
214
- connect(): Promise<this>;
215
- disconnect(): Promise<void>;
216
- aenter(): Promise<this>;
217
- __aenter__(): Promise<this>;
218
- aexit(_excType?: unknown, _excVal?: unknown, _excTb?: unknown): Promise<void>;
219
- __aexit__(excType?: unknown, excVal?: unknown, excTb?: unknown): Promise<void>;
220
- listTools(useCache?: boolean | null): Promise<MCPToolDefinition[]>;
221
- list_tools(useCache?: boolean | null): Promise<MCPToolDefinition[]>;
222
- listToolsImpl(): Promise<MCPToolDefinition[]>;
223
- _list_tools_impl(): Promise<MCPToolDefinition[]>;
224
- callTool(toolName: string, args?: Record<string, unknown> | null): Promise<string>;
225
- call_tool(toolName: string, args?: Record<string, unknown> | null): Promise<string>;
226
- cleanToolArguments(args: Record<string, unknown>): Record<string, unknown>;
227
- _clean_tool_arguments(args: Record<string, unknown>): Record<string, unknown>;
228
- callToolImpl(toolName: string, args: Record<string, unknown>): Promise<_MCPToolResult>;
229
- _call_tool_impl(toolName: string, args: Record<string, unknown>): Promise<_MCPToolResult>;
230
- emitConnectionFailed(serverName: string, serverUrl: string | null, transportType: string | null, error: unknown, errorType: string, startedAt: Date): void;
231
- _emit_connection_failed(serverName: string, serverUrl: string | null, transportType: string | null, error: unknown, errorType: string, startedAt: Date): void;
232
- listPrompts(): Promise<Record<string, unknown>[]>;
233
- listPromptsImpl(): Promise<Record<string, unknown>[]>;
234
- _list_prompts_impl(): Promise<Record<string, unknown>[]>;
235
- list_prompts(): Promise<Record<string, unknown>[]>;
236
- getPrompt(name: string, args?: Record<string, string> | null): Promise<unknown>;
237
- getPromptImpl(name: string, args: Record<string, string>): Promise<unknown>;
238
- get_prompt(name: string, args?: Record<string, string> | null): Promise<unknown>;
239
- _get_prompt_impl(name: string, args: Record<string, string>): Promise<unknown>;
240
- listResources(): Promise<Record<string, unknown>[]>;
241
- list_resources(): Promise<Record<string, unknown>[]>;
242
- readResource(uri: string): Promise<unknown>;
243
- read_resource(uri: string): Promise<unknown>;
244
- getServerInfo(): [string, string | null, string];
245
- _get_server_info(): [string, string | null, string];
246
- getCacheKey(kind: string): string;
247
- _get_cache_key(kind: string): string;
248
- retryOperation<T>(operation: () => Promise<T>, timeout?: number | null): Promise<T>;
249
- _retry_operation<T>(operation: () => Promise<T>, timeout?: number | null): Promise<T>;
250
- cleanupOnError(): Promise<void>;
251
- _cleanup_on_error(): Promise<void>;
252
- }
253
- export type MCPToolResolverOptions = {
254
- agent?: unknown;
255
- logger?: {
256
- log(level: string, message: string): void;
257
- } | null;
258
- };
259
- export declare class MCPToolResolver {
260
- private readonly agent;
261
- private readonly logger;
262
- private readonly clientsValue;
263
- constructor(options?: MCPToolResolverOptions);
264
- constructor(agent: unknown, logger?: {
265
- log(level: string, message: string): void;
266
- } | null);
267
- get clients(): MCPClient[];
268
- resolve(mcps: readonly (string | MCPServerConfig)[] | null | undefined): Promise<BaseTool[]>;
269
- cleanup(): Promise<void>;
270
- disconnectAll(): Promise<void>;
271
- _disconnect_all(): Promise<void>;
272
- static parseAmpRef(mcpConfig: string): [string, string | null];
273
- static _parse_amp_ref(mcpConfig: string): [string, string | null];
274
- parseAmpRef(mcpConfig: string): [string, string | null];
275
- _parse_amp_ref(mcpConfig: string): [string, string | null];
276
- fetchAmpMcpConfigs(slugs: readonly string[]): Record<string, Record<string, unknown>>;
277
- _fetch_amp_mcp_configs(slugs: readonly string[]): Record<string, Record<string, unknown>>;
278
- resolveAmp(ampRefs: readonly [string, string | null][]): Promise<[BaseTool[], MCPClient[]]>;
279
- _resolve_amp(ampRefs: readonly [string, string | null][]): Promise<[BaseTool[], MCPClient[]]>;
280
- resolveNative(config: MCPServerConfig): Promise<BaseTool[]>;
281
- _resolve_native(config: MCPServerConfig): Promise<[BaseTool[], MCPClient[]]>;
282
- resolveExternal(mcpRef: string): Promise<BaseTool[]>;
283
- _resolve_external(mcpRef: string): Promise<BaseTool[]>;
284
- static createTransport(config: MCPServerConfig): [BaseTransport, string];
285
- static _create_transport(config: MCPServerConfig): [BaseTransport, string];
286
- createTransport(config: MCPServerConfig): [BaseTransport, string];
287
- _create_transport(config: MCPServerConfig): [BaseTransport, string];
288
- static buildMcpConfigFromDict(config: Record<string, unknown>): MCPServerConfig;
289
- static _build_mcp_config_from_dict(config: Record<string, unknown>): MCPServerConfig;
290
- buildMcpConfigFromDict(config: Record<string, unknown>): MCPServerConfig;
291
- _build_mcp_config_from_dict(config: Record<string, unknown>): MCPServerConfig;
292
- static extractServerName(serverUrl: string): string;
293
- static _extract_server_name(serverUrl: string): string;
294
- extractServerName(serverUrl: string): string;
295
- _extract_server_name(serverUrl: string): string;
296
- setupClientAndListTools(client: MCPClient): Promise<MCPToolDefinition[]>;
297
- _setup_client_and_list_tools(client: MCPClient): Promise<MCPToolDefinition[]>;
298
- getMcpToolSchemas(serverParams: Record<string, unknown>): Record<string, Record<string, unknown>>;
299
- _get_mcp_tool_schemas(serverParams: Record<string, unknown>): Record<string, Record<string, unknown>>;
300
- getMcpToolSchemasAsync(serverParams: Record<string, unknown>): Promise<Record<string, Record<string, unknown>>>;
301
- _get_mcp_tool_schemas_async(serverParams: Record<string, unknown>): Promise<Record<string, Record<string, unknown>>>;
302
- retryMcpDiscovery(operation: (serverUrl: string) => Promise<Record<string, Record<string, unknown>>>, serverUrl: string): Promise<Record<string, Record<string, unknown>>>;
303
- _retry_mcp_discovery(operation: (serverUrl: string) => Promise<Record<string, Record<string, unknown>>>, serverUrl: string): Promise<Record<string, Record<string, unknown>>>;
304
- attemptMcpDiscovery(operation: (serverUrl: string) => Promise<Record<string, Record<string, unknown>>>, serverUrl: string): Promise<[Record<string, Record<string, unknown>> | null, string, boolean]>;
305
- _attempt_mcp_discovery(operation: (serverUrl: string) => Promise<Record<string, Record<string, unknown>>>, serverUrl: string): Promise<[Record<string, Record<string, unknown>> | null, string, boolean]>;
306
- discoverMcpToolsWithTimeout(serverUrl: string): Promise<Record<string, Record<string, unknown>>>;
307
- _discover_mcp_tools_with_timeout(serverUrl: string): Promise<Record<string, Record<string, unknown>>>;
308
- discoverMcpTools(serverUrl: string): Promise<Record<string, Record<string, unknown>>>;
309
- _discover_mcp_tools(serverUrl: string): Promise<Record<string, Record<string, unknown>>>;
310
- jsonSchemaToPydantic(toolName: string, jsonSchema: Record<string, unknown>): Record<string, unknown>;
311
- _json_schema_to_pydantic(toolName: string, jsonSchema: Record<string, unknown>): Record<string, unknown>;
312
- private log;
313
- }
314
- export declare const mcp_schema_cache: Map<string, SchemaCacheEntry>;
315
- export {};