@crewai-ts/core 0.1.1 → 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,85 @@
1
+ import { type InputFiles } from "./input-files.js";
2
+ import { CrewOutput } from "./outputs.js";
3
+ import { FlowStreamingOutput, CrewStreamingOutput, type StreamingState, type TaskInfo } from "./streaming.js";
4
+ import type { Tool } from "./types.js";
5
+ export declare function handleReasoning(agent: Record<string, unknown>, task: Record<string, unknown>): void;
6
+ export declare const handle_reasoning: typeof handleReasoning;
7
+ export declare function buildTaskPromptWithSchema(task: Record<string, unknown>, taskPrompt: string): string;
8
+ export declare const build_task_prompt_with_schema: typeof buildTaskPromptWithSchema;
9
+ export declare function formatTaskWithContext(taskPrompt: string, context?: string | null): string;
10
+ export declare const format_task_with_context: typeof formatTaskWithContext;
11
+ export declare function getKnowledgeConfig(agent: Record<string, unknown>): Record<string, unknown>;
12
+ export declare const get_knowledge_config: typeof getKnowledgeConfig;
13
+ export declare function handleKnowledgeRetrieval(agent: Record<string, unknown>, _task: unknown, taskPrompt: string, knowledgeConfig: Record<string, unknown>, queryFunc: (queries: readonly string[], config?: Record<string, unknown>) => unknown, crewQueryFunc: (queries: readonly string[], config?: Record<string, unknown>) => unknown): string;
14
+ export declare const handle_knowledge_retrieval: typeof handleKnowledgeRetrieval;
15
+ export declare const ahandle_knowledge_retrieval: (...args: Parameters<typeof handleKnowledgeRetrieval>) => Promise<string>;
16
+ export declare function applyTrainingData(agent: Record<string, unknown>, taskPrompt: string): string;
17
+ export declare const apply_training_data: typeof applyTrainingData;
18
+ export declare function processToolResults(agent: {
19
+ toolsResults?: readonly Record<string, unknown>[];
20
+ tools_results?: readonly Record<string, unknown>[];
21
+ }, result: unknown): unknown;
22
+ export declare const process_tool_results: typeof processToolResults;
23
+ export declare function saveLastMessages(agent: Record<string, unknown>): void;
24
+ export declare const save_last_messages: typeof saveLastMessages;
25
+ export declare function validateMaxExecutionTime(agent: {
26
+ maxExecutionTime?: number | null;
27
+ max_execution_time?: number | null;
28
+ startTime?: Date | null;
29
+ start_time?: Date | null;
30
+ }): void;
31
+ export declare const validate_max_execution_time: typeof validateMaxExecutionTime;
32
+ export declare function prepareTools(agent: {
33
+ tools?: readonly Tool[];
34
+ }, task?: {
35
+ tools?: readonly Tool[];
36
+ } | null): readonly Tool[];
37
+ export declare const prepare_tools: typeof prepareTools;
38
+ export declare function enableAgentStreaming(agents: Iterable<Record<string, unknown>>): void;
39
+ export declare const enable_agent_streaming: typeof enableAgentStreaming;
40
+ export declare function _resolve_crew_skills(crew: {
41
+ skills?: unknown;
42
+ }): unknown[] | null;
43
+ export declare function _extract_files_from_inputs(inputs: Record<string, unknown>): Record<string, unknown>;
44
+ export declare class TaskExecutionData {
45
+ readonly agent: unknown;
46
+ readonly tools: readonly unknown[];
47
+ readonly shouldSkip: boolean;
48
+ readonly should_skip: boolean;
49
+ constructor(agent?: unknown, tools?: readonly unknown[], shouldSkip?: boolean);
50
+ }
51
+ export declare function setupAgents(crew: Record<string, unknown>, agents: Iterable<Record<string, unknown>>, embedder?: unknown, functionCallingLlm?: unknown, stepCallback?: unknown): void;
52
+ export declare const setup_agents: typeof setupAgents;
53
+ export declare function prepareTaskExecution(crew: Record<string, unknown>, task: Record<string, unknown>, taskIndex: number, startIndex: number | null, taskOutputs: unknown[], lastSyncOutput?: unknown): [TaskExecutionData, unknown[], unknown];
54
+ export declare const prepare_task_execution: typeof prepareTaskExecution;
55
+ export declare function checkConditionalSkip(crew: Record<string, unknown>, task: Record<string, unknown>, taskOutputs: readonly unknown[], taskIndex?: number, wasReplayed?: boolean): unknown;
56
+ export declare const check_conditional_skip: typeof checkConditionalSkip;
57
+ export declare function prepareKickoff(crew: Record<string, unknown>, inputs?: Record<string, unknown> | null, inputFiles?: InputFiles | null): Record<string, unknown> | null;
58
+ export declare const prepare_kickoff: typeof prepareKickoff;
59
+ export declare function runForEachAsync<TInput, TResult>(items: readonly TInput[], runner: (item: TInput, index: number) => Promise<TResult>): Promise<TResult[]>;
60
+ export declare function runForEachAsync<TCrew extends Record<string, unknown>, TInput extends Record<string, unknown>, TResult>(crew: TCrew, inputs: readonly TInput[], kickoffFn: (crew: TCrew, input: TInput) => Promise<TResult>): Promise<TResult[] | CrewStreamingOutput>;
61
+ export declare const run_for_each_async: typeof runForEachAsync;
62
+ export declare function run_all_crews<TCrew extends Record<string, unknown>, TInput extends Record<string, unknown>, TResult>(crew: TCrew, inputs: readonly TInput[], kickoff_fn: (crew: TCrew, input: TInput) => Promise<TResult>): Promise<TResult[] | CrewStreamingOutput>;
63
+ export declare function consume_stream(stream_output: CrewStreamingOutput): Promise<CrewOutput>;
64
+ export declare function set_results_wrapper(streaming_output: CrewStreamingOutput): (result: CrewOutput | readonly CrewOutput[]) => void;
65
+ export declare class StreamingContext {
66
+ readonly resultHolder: unknown[];
67
+ readonly result_holder: unknown[];
68
+ readonly currentTaskInfo: TaskInfo;
69
+ readonly current_task_info: TaskInfo;
70
+ readonly state: StreamingState;
71
+ readonly outputHolder: Array<CrewStreamingOutput | FlowStreamingOutput>;
72
+ readonly output_holder: Array<CrewStreamingOutput | FlowStreamingOutput>;
73
+ readonly output: CrewStreamingOutput | FlowStreamingOutput | null;
74
+ constructor(useAsync?: boolean, output?: CrewStreamingOutput | FlowStreamingOutput | null);
75
+ }
76
+ export declare class ForEachStreamingContext {
77
+ readonly resultHolder: unknown[][];
78
+ readonly result_holder: unknown[][];
79
+ readonly currentTaskInfo: TaskInfo;
80
+ readonly current_task_info: TaskInfo;
81
+ readonly state: StreamingState;
82
+ readonly outputHolder: Array<CrewStreamingOutput | FlowStreamingOutput>;
83
+ readonly output_holder: Array<CrewStreamingOutput | FlowStreamingOutput>;
84
+ constructor();
85
+ }
@@ -0,0 +1,181 @@
1
+ import type { LLMMessage } from "./types.js";
2
+ export type ConversationMessageRole = "user" | "assistant" | "system" | "tool";
3
+ export declare const ConversationMessageRole: Readonly<{
4
+ kind: "ConversationMessageRole";
5
+ }>;
6
+ export type ConversationEventVisibility = "private" | "public";
7
+ export declare const ConversationEventVisibility: Readonly<{
8
+ kind: "ConversationEventVisibility";
9
+ }>;
10
+ export type RouterConfigOptions = {
11
+ prompt?: string | null;
12
+ responseFormat?: unknown;
13
+ response_format?: unknown;
14
+ llm?: unknown;
15
+ routes?: readonly string[] | null;
16
+ routeDescriptions?: Record<string, string> | null;
17
+ route_descriptions?: Record<string, string> | null;
18
+ defaultIntent?: string | null;
19
+ default_intent?: string | null;
20
+ fallbackIntent?: string | null;
21
+ fallback_intent?: string | null;
22
+ intentField?: string;
23
+ intent_field?: string;
24
+ };
25
+ export declare class RouterConfig {
26
+ readonly prompt: string | null;
27
+ readonly responseFormat: unknown;
28
+ readonly response_format: unknown;
29
+ readonly llm: unknown;
30
+ readonly routes: readonly string[] | null;
31
+ readonly routeDescriptions: Record<string, string> | null;
32
+ readonly route_descriptions: Record<string, string> | null;
33
+ readonly defaultIntent: string | null;
34
+ readonly default_intent: string | null;
35
+ readonly fallbackIntent: string | null;
36
+ readonly fallback_intent: string | null;
37
+ readonly intentField: string;
38
+ readonly intent_field: string;
39
+ constructor(options?: RouterConfigOptions);
40
+ }
41
+ export type ConversationConfigOptions = {
42
+ systemPrompt?: string | null;
43
+ system_prompt?: string | null;
44
+ llm?: unknown;
45
+ router?: RouterConfig | RouterConfigOptions | null;
46
+ answerFromHistoryPrompt?: string | null;
47
+ answer_from_history_prompt?: string | null;
48
+ defaultIntents?: readonly string[] | null;
49
+ default_intents?: readonly string[] | null;
50
+ intentLlm?: unknown;
51
+ intent_llm?: unknown;
52
+ answerFromHistoryLlm?: unknown;
53
+ answer_from_history_llm?: unknown;
54
+ visibleAgentOutputs?: readonly string[] | "all" | null;
55
+ visible_agent_outputs?: readonly string[] | "all" | null;
56
+ deferTraceFinalization?: boolean;
57
+ defer_trace_finalization?: boolean;
58
+ };
59
+ export declare class ConversationConfig {
60
+ readonly systemPrompt: string | null;
61
+ readonly system_prompt: string | null;
62
+ readonly llm: unknown;
63
+ readonly router: RouterConfig | null;
64
+ readonly answerFromHistoryPrompt: string | null;
65
+ readonly answer_from_history_prompt: string | null;
66
+ readonly defaultIntents: readonly string[] | null;
67
+ readonly default_intents: readonly string[] | null;
68
+ readonly intentLlm: unknown;
69
+ readonly intent_llm: unknown;
70
+ readonly answerFromHistoryLlm: unknown;
71
+ readonly answer_from_history_llm: unknown;
72
+ readonly visibleAgentOutputs: readonly string[] | "all" | null;
73
+ readonly visible_agent_outputs: readonly string[] | "all" | null;
74
+ readonly deferTraceFinalization: boolean;
75
+ readonly defer_trace_finalization: boolean;
76
+ constructor(options?: ConversationConfigOptions);
77
+ __call__<T extends object>(flowClass: T): T;
78
+ }
79
+ export type ConversationMessageOptions = {
80
+ role: ConversationMessageRole;
81
+ content: string | readonly Record<string, unknown>[] | null;
82
+ name?: string | null;
83
+ tool_call_id?: string | null;
84
+ toolCallId?: string | null;
85
+ tool_calls?: readonly Record<string, unknown>[] | null;
86
+ toolCalls?: readonly Record<string, unknown>[] | null;
87
+ files?: Record<string, unknown> | null;
88
+ metadata?: Record<string, unknown>;
89
+ };
90
+ export declare class ConversationMessage {
91
+ readonly role: ConversationMessageRole;
92
+ readonly content: string | readonly Record<string, unknown>[] | null;
93
+ readonly name: string | null;
94
+ readonly tool_call_id: string | null;
95
+ readonly toolCallId: string | null;
96
+ readonly tool_calls: readonly Record<string, unknown>[] | null;
97
+ readonly toolCalls: readonly Record<string, unknown>[] | null;
98
+ readonly files: Record<string, unknown> | null;
99
+ readonly metadata: Record<string, unknown>;
100
+ constructor(options: ConversationMessageOptions);
101
+ modelDump(options?: {
102
+ exclude_none?: boolean;
103
+ excludeNone?: boolean;
104
+ }): Record<string, unknown>;
105
+ model_dump(options?: {
106
+ exclude_none?: boolean;
107
+ excludeNone?: boolean;
108
+ }): Record<string, unknown>;
109
+ }
110
+ export type AgentMessageOptions = {
111
+ role?: string;
112
+ content: unknown;
113
+ metadata?: Record<string, unknown>;
114
+ };
115
+ export declare class AgentMessage {
116
+ readonly role: string;
117
+ readonly content: unknown;
118
+ readonly metadata: Record<string, unknown>;
119
+ constructor(options: AgentMessageOptions);
120
+ model_dump(options?: {
121
+ exclude_none?: boolean;
122
+ excludeNone?: boolean;
123
+ }): Record<string, unknown>;
124
+ }
125
+ export type ConversationEventOptions = {
126
+ type: string;
127
+ payload?: Record<string, unknown>;
128
+ agent_name?: string | null;
129
+ agentName?: string | null;
130
+ visibility?: ConversationEventVisibility;
131
+ };
132
+ export declare class ConversationEvent {
133
+ readonly type: string;
134
+ readonly payload: Record<string, unknown>;
135
+ readonly agent_name: string | null;
136
+ readonly agentName: string | null;
137
+ readonly visibility: ConversationEventVisibility;
138
+ constructor(options: ConversationEventOptions);
139
+ model_dump(options?: {
140
+ exclude_none?: boolean;
141
+ excludeNone?: boolean;
142
+ }): Record<string, unknown>;
143
+ }
144
+ export type ConversationStateOptions = {
145
+ id?: string;
146
+ messages?: readonly (ConversationMessage | ConversationMessageOptions)[];
147
+ current_user_message?: string | null;
148
+ currentUserMessage?: string | null;
149
+ last_user_message?: string | null;
150
+ lastUserMessage?: string | null;
151
+ last_intent?: string | null;
152
+ lastIntent?: string | null;
153
+ ended?: boolean;
154
+ events?: readonly (ConversationEvent | ConversationEventOptions)[];
155
+ agent_threads?: Record<string, readonly (AgentMessage | AgentMessageOptions)[]>;
156
+ agentThreads?: Record<string, readonly (AgentMessage | AgentMessageOptions)[]>;
157
+ session_ready?: boolean;
158
+ sessionReady?: boolean;
159
+ };
160
+ export declare class ConversationState {
161
+ readonly id: string;
162
+ messages: ConversationMessage[];
163
+ current_user_message: string | null;
164
+ currentUserMessage: string | null;
165
+ last_user_message: string | null;
166
+ lastUserMessage: string | null;
167
+ last_intent: string | null;
168
+ lastIntent: string | null;
169
+ ended: boolean;
170
+ events: ConversationEvent[];
171
+ agent_threads: Record<string, AgentMessage[]>;
172
+ agentThreads: Record<string, AgentMessage[]>;
173
+ session_ready: boolean;
174
+ sessionReady: boolean;
175
+ constructor(options?: ConversationStateOptions);
176
+ isReady(): boolean;
177
+ is_ready(): boolean;
178
+ }
179
+ export declare function messageToLlmDict(message: unknown): LLMMessage;
180
+ export declare const message_to_llm_dict: typeof messageToLlmDict;
181
+ export declare function _conversational_only<T extends (...args: never[]) => unknown>(func: T): T;
@@ -0,0 +1,36 @@
1
+ export type LogEntry = {
2
+ taskName?: string | null;
3
+ task_name?: string | null;
4
+ task?: string;
5
+ agent?: string;
6
+ status?: string;
7
+ output?: string;
8
+ input?: string;
9
+ message?: string;
10
+ level?: string;
11
+ crew?: string | null;
12
+ flow?: string | null;
13
+ tool?: string;
14
+ error?: string;
15
+ duration?: number;
16
+ metadata?: Record<string, unknown>;
17
+ };
18
+ export declare const LogEntry: Readonly<{
19
+ kind: "LogEntry";
20
+ }>;
21
+ export declare class FileHandler {
22
+ path: string;
23
+ _path: string;
24
+ constructor(filePath: boolean | string);
25
+ _initialize_path(filePath: boolean | string): void;
26
+ log(entry?: LogEntry): void;
27
+ }
28
+ export declare class PickleHandler {
29
+ readonly filePath: string;
30
+ readonly file_path: string;
31
+ constructor(fileName: string);
32
+ initializeFile(): void;
33
+ initialize_file(): void;
34
+ save(data: unknown): void;
35
+ load(): unknown;
36
+ }
@@ -0,0 +1,37 @@
1
+ export declare const DEFAULT_FILE_STORE_TTL = 3600;
2
+ export type FileInput = unknown;
3
+ export type FileInputMap = Record<string, FileInput>;
4
+ export type FileStoreId = string | number | bigint | {
5
+ toString(): string;
6
+ };
7
+ export declare function astoreFiles(executionId: FileStoreId, files: FileInputMap, ttl?: number): Promise<void>;
8
+ export declare const astore_files: typeof astoreFiles;
9
+ export declare function agetFiles(executionId: FileStoreId): Promise<FileInputMap | null>;
10
+ export declare const aget_files: typeof agetFiles;
11
+ export declare function aclearFiles(executionId: FileStoreId): Promise<void>;
12
+ export declare const aclear_files: typeof aclearFiles;
13
+ export declare function astoreTaskFiles(taskId: FileStoreId, files: FileInputMap, ttl?: number): Promise<void>;
14
+ export declare const astore_task_files: typeof astoreTaskFiles;
15
+ export declare function agetTaskFiles(taskId: FileStoreId): Promise<FileInputMap | null>;
16
+ export declare const aget_task_files: typeof agetTaskFiles;
17
+ export declare function aclearTaskFiles(taskId: FileStoreId): Promise<void>;
18
+ export declare const aclear_task_files: typeof aclearTaskFiles;
19
+ export declare function agetAllFiles(crewId: FileStoreId, taskId?: FileStoreId | null): Promise<FileInputMap | null>;
20
+ export declare const aget_all_files: typeof agetAllFiles;
21
+ export declare function storeFiles(executionId: FileStoreId, files: FileInputMap, ttl?: number): void;
22
+ export declare const store_files: typeof storeFiles;
23
+ export declare function getFiles(executionId: FileStoreId): FileInputMap | null;
24
+ export declare const get_files: typeof getFiles;
25
+ export declare function clearFiles(executionId: FileStoreId): void;
26
+ export declare const clear_files: typeof clearFiles;
27
+ export declare function storeTaskFiles(taskId: FileStoreId, files: FileInputMap, ttl?: number): void;
28
+ export declare const store_task_files: typeof storeTaskFiles;
29
+ export declare function getTaskFiles(taskId: FileStoreId): FileInputMap | null;
30
+ export declare const get_task_files: typeof getTaskFiles;
31
+ export declare function clearTaskFiles(taskId: FileStoreId): void;
32
+ export declare const clear_task_files: typeof clearTaskFiles;
33
+ export declare function getAllFiles(crewId: FileStoreId, taskId?: FileStoreId | null): FileInputMap | null;
34
+ export declare const get_all_files: typeof getAllFiles;
35
+ export declare function clearFileStore(): void;
36
+ export declare const clear_file_store: typeof clearFileStore;
37
+ export declare function _run_sync<T>(task: Promise<T> | (() => T | Promise<T>)): Promise<T>;