@crewai-ts/core 0.1.2 → 0.1.5

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 (92) 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.cjs +83 -36
  38. package/dist/index.d.ts +99 -13004
  39. package/dist/index.js +82 -36
  40. package/dist/input-files.d.ts +24 -0
  41. package/dist/input-provider.d.ts +22 -0
  42. package/dist/knowledge.d.ts +353 -0
  43. package/dist/lite-agent-output.d.ts +69 -0
  44. package/dist/lite-agent.d.ts +154 -0
  45. package/dist/llm.d.ts +630 -0
  46. package/dist/llms-hooks-transport.d.ts +1 -2
  47. package/dist/lock-store.d.ts +14 -0
  48. package/dist/logger.d.ts +55 -0
  49. package/dist/mcp.d.ts +315 -0
  50. package/dist/memory.d.ts +915 -0
  51. package/dist/metadata.d.ts +9 -0
  52. package/dist/misc-compat.d.ts +125 -0
  53. package/dist/openai-completion.d.ts +324 -0
  54. package/dist/outputs.d.ts +69 -0
  55. package/dist/planning.d.ts +60 -0
  56. package/dist/plus-api.d.ts +194 -0
  57. package/dist/project-compat.d.ts +133 -0
  58. package/dist/project.d.ts +221 -0
  59. package/dist/prompts.d.ts +66 -0
  60. package/dist/provider-completions.d.ts +593 -0
  61. package/dist/rag.d.ts +1074 -0
  62. package/dist/rpm.d.ts +27 -0
  63. package/dist/rw-lock.d.ts +21 -0
  64. package/dist/schema-utils.d.ts +121 -0
  65. package/dist/security.d.ts +66 -0
  66. package/dist/settings.d.ts +103 -0
  67. package/dist/skills.d.ts +145 -0
  68. package/dist/state-provider-core.d.ts +1 -1
  69. package/dist/state.d.ts +204 -0
  70. package/dist/step-execution-context.d.ts +36 -0
  71. package/dist/streaming.d.ts +153 -0
  72. package/dist/string-utils.d.ts +12 -0
  73. package/dist/task-output-storage.d.ts +62 -0
  74. package/dist/task.d.ts +305 -0
  75. package/dist/telemetry.d.ts +91 -0
  76. package/dist/token-counter-callback.d.ts +36 -0
  77. package/dist/tools.d.ts +563 -0
  78. package/dist/tracing-utils.d.ts +56 -0
  79. package/dist/training-converter.d.ts +36 -0
  80. package/dist/training-handler.d.ts +10 -0
  81. package/dist/types.d.ts +72 -0
  82. package/dist/utilities.d.ts +130 -0
  83. package/dist/utility-types.d.ts +10 -0
  84. package/dist/version.d.ts +12 -0
  85. package/package.json +326 -4904
  86. package/dist/index.d.cts +0 -13068
  87. package/dist/llms-hooks-transport-ChGiFBiU.d.ts +0 -233
  88. package/dist/llms-hooks-transport-DZlurMUQ.d.cts +0 -233
  89. package/dist/llms-hooks-transport.d.cts +0 -2
  90. package/dist/state-provider-core-Be9RKRAm.d.cts +0 -4876
  91. package/dist/state-provider-core-Be9RKRAm.d.ts +0 -4876
  92. package/dist/state-provider-core.d.cts +0 -1
@@ -0,0 +1,9 @@
1
+ export type MethodKind = "agent" | "task" | "crew" | "beforeKickoff" | "afterKickoff" | "tool" | "llm" | "callback" | "outputJson" | "outputPydantic" | "cacheHandler";
2
+ export type MethodEntry = {
3
+ name: string | symbol;
4
+ kind: MethodKind;
5
+ };
6
+ export type Constructor = abstract new (...args: never[]) => object;
7
+ export declare function registerCrewMethod(target: object, entry: MethodEntry): void;
8
+ export declare function initializeCrewMetadata(constructor: Constructor): void;
9
+ export declare function getCrewMetadata(instanceOrConstructor: object | Constructor): readonly MethodEntry[];
@@ -0,0 +1,125 @@
1
+ export declare function setSuppressTracingMessages(suppress: boolean): boolean;
2
+ export declare const set_suppress_tracing_messages: typeof setSuppressTracingMessages;
3
+ export declare function shouldSuppressTracingMessages(): boolean;
4
+ export declare const should_suppress_tracing_messages: typeof shouldSuppressTracingMessages;
5
+ export declare function shouldEnableTracing(options?: {
6
+ override?: boolean | null;
7
+ }): boolean;
8
+ export declare const should_enable_tracing: typeof shouldEnableTracing;
9
+ export declare function setTracingEnabled(enabled: boolean): boolean | null;
10
+ export declare const set_tracing_enabled: typeof setTracingEnabled;
11
+ export declare function resetTracingEnabled(token: boolean | null): void;
12
+ export declare const reset_tracing_enabled: typeof resetTracingEnabled;
13
+ export declare function isTracingEnabledInContext(): boolean;
14
+ export declare const is_tracing_enabled_in_context: typeof isTracingEnabledInContext;
15
+ export declare function onFirstExecutionTracingConfirmation(): boolean;
16
+ export declare const on_first_execution_tracing_confirmation: typeof onFirstExecutionTracingConfirmation;
17
+ export declare function getUserId(): string;
18
+ export declare const get_user_id: typeof getUserId;
19
+ export declare function isFirstExecution(): boolean;
20
+ export declare const is_first_execution: typeof isFirstExecution;
21
+ export declare function markFirstExecutionDone(userConsented?: boolean): void;
22
+ export declare const mark_first_execution_done: typeof markFirstExecutionDone;
23
+ export declare function markFirstExecutionCompleted(userConsented?: boolean): void;
24
+ export declare const mark_first_execution_completed: typeof markFirstExecutionCompleted;
25
+ export declare function safeSerializeToDict(obj: unknown, exclude?: ReadonlySet<string> | null): Record<string, unknown>;
26
+ export declare const safe_serialize_to_dict: typeof safeSerializeToDict;
27
+ export declare function truncateMessages(messages: readonly Record<string, unknown>[], maxContentLength?: number, maxMessages?: number): Record<string, unknown>[];
28
+ export declare const truncate_messages: typeof truncateMessages;
29
+ export declare function shouldAutoCollectFirstTimeTraces(): boolean;
30
+ export declare const should_auto_collect_first_time_traces: typeof shouldAutoCollectFirstTimeTraces;
31
+ export declare function promptUserForTraceViewing(_timeoutSeconds?: number): boolean;
32
+ export declare const prompt_user_for_trace_viewing: typeof promptUserForTraceViewing;
33
+ export declare const CREWAI_ORANGE = "#FF5A50";
34
+ export declare const DARK_GRAY = "#333333";
35
+ export declare const WHITE = "#FFFFFF";
36
+ export declare const GRAY = "#666666";
37
+ export declare const BG_DARK = "#0d1117";
38
+ export declare const BG_CARD = "#161b22";
39
+ export declare const BORDER_SUBTLE = "#30363d";
40
+ export declare const TEXT_PRIMARY = "#e6edf3";
41
+ export declare const TEXT_SECONDARY = "#7d8590";
42
+ export declare const CSSExtension: Readonly<{
43
+ kind: "CSSExtension";
44
+ }>;
45
+ export declare const JSExtension: Readonly<{
46
+ kind: "JSExtension";
47
+ }>;
48
+ export type FlowVizStructure = {
49
+ nodes?: Record<string, Record<string, unknown>>;
50
+ edges?: readonly Record<string, unknown>[];
51
+ start_methods?: readonly string[];
52
+ startMethods?: readonly string[];
53
+ };
54
+ export declare function calculateNodePositions(dag: FlowVizStructure): Record<string, {
55
+ level: number;
56
+ x: number;
57
+ y: number;
58
+ }>;
59
+ export declare const calculate_node_positions: typeof calculateNodePositions;
60
+ export declare function renderInteractive(dag: FlowVizStructure, filename?: string, show?: boolean): string;
61
+ export declare const render_interactive: typeof renderInteractive;
62
+ export declare const ProtocolVersion: readonly string[];
63
+ export declare const Url: StringConstructor;
64
+ export declare const AgentResponseProtocol: Readonly<{
65
+ kind: "AgentResponseProtocol";
66
+ }>;
67
+ export declare const PartsMetadataDict: Readonly<{
68
+ kind: "PartsMetadataDict";
69
+ }>;
70
+ export declare const PartsDict: Readonly<{
71
+ kind: "PartsDict";
72
+ }>;
73
+ export declare const PollingHandlerType: Readonly<{
74
+ kind: "PollingHandlerType";
75
+ }>;
76
+ export declare const StreamingHandlerType: Readonly<{
77
+ kind: "StreamingHandlerType";
78
+ }>;
79
+ export declare const PushNotificationHandlerType: Readonly<{
80
+ kind: "PushNotificationHandlerType";
81
+ }>;
82
+ export declare const HandlerType: Readonly<{
83
+ kind: "HandlerType";
84
+ }>;
85
+ export declare const HANDLER_REGISTRY: Map<unknown, unknown>;
86
+ export declare class CommonParams {
87
+ readonly turn_number: number;
88
+ readonly is_multiturn: boolean;
89
+ readonly agent_role: string | null;
90
+ readonly endpoint: string;
91
+ readonly a2a_agent_name: string | null;
92
+ readonly context_id: string | null;
93
+ readonly from_task: unknown;
94
+ readonly from_agent: unknown;
95
+ constructor(options: {
96
+ turn_number?: number;
97
+ is_multiturn?: boolean;
98
+ agent_role?: string | null;
99
+ endpoint: string;
100
+ a2a_agent_name?: string | null;
101
+ context_id?: string | null;
102
+ from_task?: unknown;
103
+ from_agent?: unknown;
104
+ });
105
+ }
106
+ export declare const BaseHandlerKwargs: Readonly<{
107
+ kind: "BaseHandlerKwargs";
108
+ }>;
109
+ export declare const PollingHandlerKwargs: Readonly<{
110
+ kind: "PollingHandlerKwargs";
111
+ }>;
112
+ export declare const StreamingHandlerKwargs: Readonly<{
113
+ kind: "StreamingHandlerKwargs";
114
+ }>;
115
+ export declare const PushNotificationHandlerKwargs: Readonly<{
116
+ kind: "PushNotificationHandlerKwargs";
117
+ }>;
118
+ export declare const PushNotificationResultStore: Readonly<{
119
+ kind: "PushNotificationResultStore";
120
+ }>;
121
+ export declare const UpdateHandler: Readonly<{
122
+ kind: "UpdateHandler";
123
+ }>;
124
+ export declare function extractCommonParams(kwargs: Record<string, unknown>): CommonParams;
125
+ export declare const extract_common_params: typeof extractCommonParams;
@@ -0,0 +1,324 @@
1
+ import { ConfiguredLLM, LocalFileUploader, type BaseLLMOptions, type LLMCallOptions, type LLMMessageInput, type LLMResponse } from "./llm.js";
2
+ import type { LLMMessage, Tool } from "./types.js";
3
+ export declare const WebSearchResult: Readonly<{
4
+ kind: "WebSearchResult";
5
+ }>;
6
+ export type WebSearchResult = {
7
+ id?: string | null;
8
+ status?: string | null;
9
+ type: string;
10
+ };
11
+ export declare const FileSearchResultItem: Readonly<{
12
+ kind: "FileSearchResultItem";
13
+ }>;
14
+ export type FileSearchResultItem = {
15
+ file_id?: string | null;
16
+ fileId?: string | null;
17
+ filename?: string | null;
18
+ text?: string | null;
19
+ score?: number | null;
20
+ attributes?: Record<string, string | number | boolean> | null;
21
+ };
22
+ export declare const FileSearchResult: Readonly<{
23
+ kind: "FileSearchResult";
24
+ }>;
25
+ export type FileSearchResult = {
26
+ id?: string | null;
27
+ status?: string | null;
28
+ type: string;
29
+ queries?: string[];
30
+ results?: FileSearchResultItem[];
31
+ };
32
+ export declare const CodeInterpreterLogResult: Readonly<{
33
+ kind: "CodeInterpreterLogResult";
34
+ }>;
35
+ export type CodeInterpreterLogResult = {
36
+ type: string;
37
+ logs: string;
38
+ };
39
+ export declare const CodeInterpreterFileResult: Readonly<{
40
+ kind: "CodeInterpreterFileResult";
41
+ }>;
42
+ export type CodeInterpreterFileResult = {
43
+ type: string;
44
+ files: Array<Record<string, unknown>>;
45
+ };
46
+ export declare const CodeInterpreterResult: Readonly<{
47
+ kind: "CodeInterpreterResult";
48
+ }>;
49
+ export type CodeInterpreterResult = {
50
+ id?: string | null;
51
+ status?: string | null;
52
+ type: string;
53
+ code?: string | null;
54
+ container_id?: string | null;
55
+ containerId?: string | null;
56
+ results?: Array<CodeInterpreterLogResult | CodeInterpreterFileResult>;
57
+ };
58
+ export declare const ComputerUseResult: Readonly<{
59
+ kind: "ComputerUseResult";
60
+ }>;
61
+ export type ComputerUseResult = {
62
+ id?: string | null;
63
+ status?: string | null;
64
+ type: string;
65
+ call_id?: string | null;
66
+ callId?: string | null;
67
+ action?: Record<string, unknown>;
68
+ pending_safety_checks?: Array<Record<string, unknown>>;
69
+ pendingSafetyChecks?: Array<Record<string, unknown>>;
70
+ };
71
+ export declare const ReasoningSummary: Readonly<{
72
+ kind: "ReasoningSummary";
73
+ }>;
74
+ export type ReasoningSummary = {
75
+ id?: string | null;
76
+ status?: string | null;
77
+ type: string;
78
+ summary?: Array<Record<string, unknown>>;
79
+ encrypted_content?: string | null;
80
+ encryptedContent?: string | null;
81
+ };
82
+ export type ResponsesAPIResultOptions = {
83
+ text?: string;
84
+ web_search_results?: WebSearchResult[];
85
+ webSearchResults?: WebSearchResult[];
86
+ file_search_results?: FileSearchResult[];
87
+ fileSearchResults?: FileSearchResult[];
88
+ code_interpreter_results?: CodeInterpreterResult[];
89
+ codeInterpreterResults?: CodeInterpreterResult[];
90
+ computer_use_results?: ComputerUseResult[];
91
+ computerUseResults?: ComputerUseResult[];
92
+ reasoning_summaries?: ReasoningSummary[];
93
+ reasoningSummaries?: ReasoningSummary[];
94
+ function_calls?: Array<Record<string, unknown>>;
95
+ functionCalls?: Array<Record<string, unknown>>;
96
+ response_id?: string | null;
97
+ responseId?: string | null;
98
+ };
99
+ export declare class ResponsesAPIResult {
100
+ text: string;
101
+ web_search_results: WebSearchResult[];
102
+ webSearchResults: WebSearchResult[];
103
+ file_search_results: FileSearchResult[];
104
+ fileSearchResults: FileSearchResult[];
105
+ code_interpreter_results: CodeInterpreterResult[];
106
+ codeInterpreterResults: CodeInterpreterResult[];
107
+ computer_use_results: ComputerUseResult[];
108
+ computerUseResults: ComputerUseResult[];
109
+ reasoning_summaries: ReasoningSummary[];
110
+ reasoningSummaries: ReasoningSummary[];
111
+ function_calls: Array<Record<string, unknown>>;
112
+ functionCalls: Array<Record<string, unknown>>;
113
+ response_id: string | null;
114
+ responseId: string | null;
115
+ constructor(options?: ResponsesAPIResultOptions);
116
+ hasToolOutputs(): boolean;
117
+ has_tool_outputs(): boolean;
118
+ hasReasoning(): boolean;
119
+ has_reasoning(): boolean;
120
+ }
121
+ export type OpenAICompletionOptions = BaseLLMOptions & {
122
+ organization?: string | null;
123
+ project?: string | null;
124
+ timeout?: number | null;
125
+ max_retries?: number;
126
+ maxRetries?: number;
127
+ default_headers?: Record<string, string> | null;
128
+ defaultHeaders?: Record<string, string> | null;
129
+ default_query?: Record<string, unknown> | null;
130
+ defaultQuery?: Record<string, unknown> | null;
131
+ client_params?: Record<string, unknown> | null;
132
+ clientParams?: Record<string, unknown> | null;
133
+ top_p?: number | null;
134
+ topP?: number | null;
135
+ frequency_penalty?: number | null;
136
+ frequencyPenalty?: number | null;
137
+ presence_penalty?: number | null;
138
+ presencePenalty?: number | null;
139
+ max_tokens?: number | null;
140
+ maxTokens?: number | null;
141
+ max_completion_tokens?: number | null;
142
+ maxCompletionTokens?: number | null;
143
+ seed?: number | null;
144
+ stream?: boolean;
145
+ response_format?: unknown;
146
+ responseFormat?: unknown;
147
+ logprobs?: boolean | null;
148
+ top_logprobs?: number | null;
149
+ topLogprobs?: number | null;
150
+ reasoning_effort?: string | null;
151
+ reasoningEffort?: string | null;
152
+ interceptor?: unknown;
153
+ api?: "completions" | "responses";
154
+ instructions?: string | null;
155
+ store?: boolean | null;
156
+ previous_response_id?: string | null;
157
+ previousResponseId?: string | null;
158
+ include?: string[] | null;
159
+ builtin_tools?: string[] | null;
160
+ builtinTools?: string[] | null;
161
+ parse_tool_outputs?: boolean;
162
+ parseToolOutputs?: boolean;
163
+ auto_chain?: boolean;
164
+ autoChain?: boolean;
165
+ auto_chain_reasoning?: boolean;
166
+ autoChainReasoning?: boolean;
167
+ api_base?: string | null;
168
+ apiBase?: string | null;
169
+ };
170
+ export declare class OpenAICompletion extends ConfiguredLLM {
171
+ static readonly BUILTIN_TOOL_TYPES: Readonly<Record<string, string>>;
172
+ readonly organization: string | null;
173
+ readonly project: string | null;
174
+ readonly maxRetries: number;
175
+ readonly max_retries: number;
176
+ readonly defaultHeaders: Record<string, string> | null;
177
+ readonly default_headers: Record<string, string> | null;
178
+ readonly defaultQuery: Record<string, unknown> | null;
179
+ readonly default_query: Record<string, unknown> | null;
180
+ readonly clientParams: Record<string, unknown> | null;
181
+ readonly client_params: Record<string, unknown> | null;
182
+ readonly topP: number | null;
183
+ readonly top_p: number | null;
184
+ readonly frequencyPenalty: number | null;
185
+ readonly frequency_penalty: number | null;
186
+ readonly presencePenalty: number | null;
187
+ readonly presence_penalty: number | null;
188
+ readonly seed: number | null;
189
+ readonly stream: boolean;
190
+ readonly topLogprobs: number | null;
191
+ readonly top_logprobs: number | null;
192
+ readonly reasoningEffort: string | null;
193
+ readonly reasoning_effort: string | null;
194
+ readonly interceptor: unknown;
195
+ readonly api: "completions" | "responses";
196
+ readonly instructions: string | null;
197
+ readonly store: boolean | null;
198
+ readonly previousResponseId: string | null;
199
+ readonly previous_response_id: string | null;
200
+ readonly include: string[] | null;
201
+ readonly builtinTools: string[] | null;
202
+ readonly builtin_tools: string[] | null;
203
+ readonly parseToolOutputs: boolean;
204
+ readonly parse_tool_outputs: boolean;
205
+ readonly autoChain: boolean;
206
+ readonly auto_chain: boolean;
207
+ readonly autoChainReasoning: boolean;
208
+ readonly auto_chain_reasoning: boolean;
209
+ readonly isO1Model: boolean;
210
+ readonly is_o1_model: boolean;
211
+ readonly isGpt4Model: boolean;
212
+ readonly is_gpt4_model: boolean;
213
+ private responseChainId;
214
+ private reasoningChainItems;
215
+ constructor(options?: OpenAICompletionOptions);
216
+ call(messages: readonly LLMMessage[], options?: LLMCallOptions): Promise<LLMResponse>;
217
+ acall(messages: LLMMessageInput, options?: LLMCallOptions): Promise<LLMResponse>;
218
+ prepareCompletionParams(messages: readonly LLMMessage[], tools?: readonly Tool[] | null): Record<string, unknown>;
219
+ _prepare_completion_params(messages: readonly LLMMessage[], tools?: readonly Tool[] | null): Record<string, unknown>;
220
+ prepareResponsesParams(messages: readonly LLMMessage[], tools?: readonly Tool[] | null, responseModel?: unknown): Record<string, unknown>;
221
+ _prepare_responses_params(messages: readonly LLMMessage[], tools?: readonly Tool[] | null, responseModel?: unknown): Record<string, unknown>;
222
+ convertToolsForInterference(tools: readonly Tool[]): Record<string, unknown>[];
223
+ _convert_tools_for_interference(tools: readonly Tool[]): Record<string, unknown>[];
224
+ convertToolsForResponses(tools: readonly Tool[]): Record<string, unknown>[];
225
+ _convert_tools_for_responses(tools: readonly Tool[]): Record<string, unknown>[];
226
+ getClientParams(env?: NodeJS.ProcessEnv): Record<string, unknown>;
227
+ _get_client_params(env?: NodeJS.ProcessEnv): Record<string, unknown>;
228
+ extractOpenAITokenUsage(response: unknown): Record<string, number>;
229
+ _extract_openai_token_usage(response: unknown): Record<string, number>;
230
+ static extractOpenAITokenUsage(response: unknown): Record<string, number>;
231
+ static extract_openai_token_usage(response: unknown): Record<string, number>;
232
+ extractResponsesTokenUsage(response: unknown): Record<string, number>;
233
+ _extract_responses_token_usage(response: unknown): Record<string, number>;
234
+ extractFunctionCallsFromResponse(response: unknown): Record<string, unknown>[];
235
+ _extract_function_calls_from_response(response: unknown): Record<string, unknown>[];
236
+ extractReasoningItems(response: unknown): unknown[];
237
+ _extract_reasoning_items(response: unknown): unknown[];
238
+ extractBuiltinToolOutputs(response: unknown): ResponsesAPIResult;
239
+ _extract_builtin_tool_outputs(response: unknown): ResponsesAPIResult;
240
+ accumulateResponsesStreamEvents(events: readonly unknown[]): {
241
+ text: string;
242
+ response_id: string | null;
243
+ function_calls: Record<string, unknown>[];
244
+ usage: Record<string, number> | null;
245
+ final_response: unknown;
246
+ reasoning_items: unknown[];
247
+ };
248
+ _accumulate_responses_stream_events(events: readonly unknown[]): {
249
+ text: string;
250
+ response_id: string | null;
251
+ function_calls: Record<string, unknown>[];
252
+ usage: Record<string, number> | null;
253
+ final_response: unknown;
254
+ reasoning_items: unknown[];
255
+ };
256
+ supportsFunctionCalling(): boolean;
257
+ supports_function_calling(): boolean;
258
+ supportsStopWords(): boolean;
259
+ supports_stop_words(): boolean;
260
+ supportsMultimodal(): boolean;
261
+ supports_multimodal(): boolean;
262
+ getFileUploader(): LocalFileUploader;
263
+ get_file_uploader(): LocalFileUploader;
264
+ getContextWindowSize(): number;
265
+ get_context_window_size(): number;
266
+ get lastResponseId(): string | null;
267
+ get last_response_id(): string | null;
268
+ get lastReasoningItems(): readonly unknown[] | null;
269
+ get last_reasoning_items(): readonly unknown[] | null;
270
+ resetChain(): void;
271
+ reset_chain(): void;
272
+ resetReasoningChain(): void;
273
+ reset_reasoning_chain(): void;
274
+ toConfigDict(): Record<string, unknown>;
275
+ to_config_dict(): Record<string, unknown>;
276
+ }
277
+ export type ProviderConfigOptions = {
278
+ base_url?: string;
279
+ baseUrl?: string;
280
+ api_key_env?: string;
281
+ apiKeyEnv?: string;
282
+ base_url_env?: string | null;
283
+ baseUrlEnv?: string | null;
284
+ default_headers?: Record<string, string>;
285
+ defaultHeaders?: Record<string, string>;
286
+ api_key_required?: boolean;
287
+ apiKeyRequired?: boolean;
288
+ default_api_key?: string | null;
289
+ defaultApiKey?: string | null;
290
+ };
291
+ export declare class ProviderConfig {
292
+ readonly base_url: string;
293
+ readonly baseUrl: string;
294
+ readonly api_key_env: string;
295
+ readonly apiKeyEnv: string;
296
+ readonly base_url_env: string | null;
297
+ readonly baseUrlEnv: string | null;
298
+ readonly default_headers: Record<string, string>;
299
+ readonly defaultHeaders: Record<string, string>;
300
+ readonly api_key_required: boolean;
301
+ readonly apiKeyRequired: boolean;
302
+ readonly default_api_key: string | null;
303
+ readonly defaultApiKey: string | null;
304
+ constructor(options: ProviderConfigOptions);
305
+ }
306
+ export declare const OPENAI_COMPATIBLE_PROVIDERS: Readonly<Record<string, ProviderConfig>>;
307
+ export declare class OpenAICompatibleCompletion extends OpenAICompletion {
308
+ constructor(options?: OpenAICompletionOptions & {
309
+ provider?: string | null;
310
+ });
311
+ static _resolveProviderConfig<TOptions extends OpenAICompletionOptions & {
312
+ provider?: string | null;
313
+ }>(data: TOptions): TOptions;
314
+ static _resolve_provider_config<TOptions extends OpenAICompletionOptions & {
315
+ provider?: string | null;
316
+ }>(data: TOptions): TOptions;
317
+ supports_function_calling(): boolean;
318
+ static resolveApiKey(apiKey: string | null, config: ProviderConfig, provider: string): string | null;
319
+ static _resolve_api_key(apiKey: string | null, config: ProviderConfig, provider: string): string | null;
320
+ static resolveBaseUrl(baseUrl: string | null, config: ProviderConfig, provider: string): string;
321
+ static _resolve_base_url(baseUrl: string | null, config: ProviderConfig, provider: string): string;
322
+ static resolveHeaders(headers: Record<string, string> | null, config: ProviderConfig): Record<string, string> | null;
323
+ static _resolve_headers(headers: Record<string, string> | null, config: ProviderConfig): Record<string, string> | null;
324
+ }
@@ -0,0 +1,69 @@
1
+ import { OutputFormat } from "./types.js";
2
+ import { type UsageMetrics } from "./llm.js";
3
+ export type TaskOutputOptions = {
4
+ description: string;
5
+ name?: string | null;
6
+ expectedOutput?: string | null;
7
+ expected_output?: string | null;
8
+ raw?: string;
9
+ jsonDict?: Record<string, unknown> | null;
10
+ json_dict?: Record<string, unknown> | null;
11
+ pydantic?: unknown;
12
+ agent: string;
13
+ outputFormat?: OutputFormat;
14
+ output_format?: OutputFormat;
15
+ messages?: readonly unknown[];
16
+ };
17
+ export declare class TaskOutput {
18
+ readonly description: string;
19
+ readonly name: string | null;
20
+ readonly expectedOutput: string | null;
21
+ readonly expected_output: string | null;
22
+ summary: string;
23
+ readonly raw: string;
24
+ readonly jsonDict: Record<string, unknown> | null;
25
+ readonly json_dict: Record<string, unknown> | null;
26
+ readonly pydantic: unknown;
27
+ readonly agent: string;
28
+ readonly outputFormat: OutputFormat;
29
+ readonly output_format: OutputFormat;
30
+ readonly messages: readonly unknown[];
31
+ constructor(options: TaskOutputOptions);
32
+ set_summary(): this;
33
+ get json(): string | null;
34
+ toDict(): Record<string, unknown>;
35
+ to_dict(): Record<string, unknown>;
36
+ modelDump(): Record<string, unknown>;
37
+ model_dump(): Record<string, unknown>;
38
+ toJSON(): Record<string, unknown>;
39
+ toString(): string;
40
+ __str__(): string;
41
+ }
42
+ export type CrewOutputOptions = {
43
+ raw?: string;
44
+ pydantic?: unknown;
45
+ jsonDict?: Record<string, unknown> | null;
46
+ json_dict?: Record<string, unknown> | null;
47
+ tasksOutput?: readonly TaskOutput[];
48
+ tasks_output?: readonly TaskOutput[];
49
+ tokenUsage?: UsageMetrics;
50
+ token_usage?: UsageMetrics;
51
+ };
52
+ export declare class CrewOutput {
53
+ readonly raw: string;
54
+ readonly pydantic: unknown;
55
+ readonly jsonDict: Record<string, unknown> | null;
56
+ readonly json_dict: Record<string, unknown> | null;
57
+ readonly tasksOutput: readonly TaskOutput[];
58
+ readonly tasks_output: readonly TaskOutput[];
59
+ readonly tokenUsage: UsageMetrics;
60
+ readonly token_usage: UsageMetrics;
61
+ constructor(options?: CrewOutputOptions);
62
+ get json(): string | null;
63
+ toDict(): Record<string, unknown>;
64
+ to_dict(): Record<string, unknown>;
65
+ get(key: string): unknown;
66
+ __getitem__(key: string): unknown;
67
+ toString(): string;
68
+ __str__(): string;
69
+ }
@@ -0,0 +1,60 @@
1
+ import { Agent } from "./agent.js";
2
+ import { Task } from "./task.js";
3
+ import type { LLM } from "./types.js";
4
+ export type PlanPerTaskOptions = {
5
+ taskNumber?: number;
6
+ task_number?: number;
7
+ task: string;
8
+ plan: string;
9
+ };
10
+ export type PlanPerTask = {
11
+ taskNumber: number;
12
+ task_number: number;
13
+ task: string;
14
+ plan: string;
15
+ };
16
+ export declare const PlanPerTask: {
17
+ new (options: PlanPerTaskOptions): {
18
+ readonly taskNumber: number;
19
+ readonly task_number: number;
20
+ readonly task: string;
21
+ readonly plan: string;
22
+ };
23
+ };
24
+ export type PlannerTaskOutput = {
25
+ listOfPlansPerTask: readonly PlanPerTask[];
26
+ list_of_plans_per_task: readonly PlanPerTask[];
27
+ };
28
+ export declare const PlannerTaskPydanticOutput: {
29
+ new (options: {
30
+ listOfPlansPerTask?: readonly (PlanPerTask | PlanPerTaskOptions)[];
31
+ list_of_plans_per_task?: readonly (PlanPerTask | PlanPerTaskOptions)[];
32
+ }): {
33
+ readonly listOfPlansPerTask: readonly PlanPerTask[];
34
+ readonly list_of_plans_per_task: readonly PlanPerTask[];
35
+ };
36
+ };
37
+ export type PlannerTaskPydanticOutput = InstanceType<typeof PlannerTaskPydanticOutput>;
38
+ export type CrewPlannerOptions = {
39
+ tasks: readonly Task[];
40
+ planningAgentLlm?: LLM | string | null;
41
+ planning_agent_llm?: LLM | string | null;
42
+ };
43
+ export declare class CrewPlanner {
44
+ readonly tasks: readonly Task[];
45
+ readonly planningAgentLlm: LLM | string | null;
46
+ readonly planning_agent_llm: LLM | string | null;
47
+ private planningAgent;
48
+ constructor(options: CrewPlannerOptions);
49
+ constructor(tasks: readonly Task[], planningAgentLlm?: LLM | string | null);
50
+ handleCrewPlanning(): Promise<PlannerTaskOutput>;
51
+ _handle_crew_planning(): Promise<PlannerTaskOutput>;
52
+ getUsageMetrics(): import("./llm.js").UsageMetrics | undefined;
53
+ createPlanningAgent(): Agent;
54
+ _create_planning_agent(): Agent;
55
+ static _create_planner_task(planningAgent: Agent, tasksSummary: string): Task;
56
+ static _get_agent_knowledge(task: Task): string[];
57
+ createTasksSummary(): string;
58
+ _create_tasks_summary(): string;
59
+ }
60
+ export declare function parsePlannerTaskOutput(raw: string): PlannerTaskOutput;