@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,444 @@
1
+ import { PlanningConfig, type PlanningConfigOptions } from "./agent-planning.js";
2
+ import { CacheHandler, ToolsHandler } from "./tools.js";
3
+ import { RpmController } from "./rpm.js";
4
+ import { type UsageMetrics } from "./llm.js";
5
+ import { Converter } from "./converter.js";
6
+ import { Knowledge, type KnowledgeSource } from "./knowledge.js";
7
+ import { type Fingerprint, type SecurityConfig } from "./security.js";
8
+ import { type CheckpointConfig, type CheckpointOption } from "./state.js";
9
+ import type { ExecutionContext } from "./context.js";
10
+ import type { AgentStepCallback, InputValues, LLM, LLMMessage, Tool } from "./types.js";
11
+ import { type Memory, type MemoryScope } from "./memory.js";
12
+ import { type InputFiles } from "./input-files.js";
13
+ import type { EmbedderConfig } from "./rag.js";
14
+ import { type StandardPromptResult, type SystemPromptResult } from "./prompts.js";
15
+ import { LiteAgentOutput } from "./lite-agent-output.js";
16
+ export type AgentGuardrailResult = readonly [boolean, unknown] | {
17
+ success: boolean;
18
+ result?: unknown;
19
+ error?: unknown;
20
+ };
21
+ export type AgentGuardrail = (output: string) => AgentGuardrailResult | Promise<AgentGuardrailResult>;
22
+ type ModelDumpOptions = {
23
+ mode?: string;
24
+ exclude?: ReadonlySet<string> | readonly string[] | Record<string, unknown>;
25
+ };
26
+ export type CodeExecutionMode = "safe" | "unsafe";
27
+ export type AgentOptions = {
28
+ id?: string | null;
29
+ agent_id?: string | null;
30
+ role: string;
31
+ goal: string;
32
+ backstory: string;
33
+ config?: Record<string, unknown> | null;
34
+ llm?: LLM | string | null;
35
+ crew?: unknown;
36
+ functionCallingLlm?: LLM | string | null;
37
+ function_calling_llm?: LLM | string | null;
38
+ memory?: Memory | MemoryScope | null;
39
+ knowledge?: Knowledge | null;
40
+ knowledgeSources?: readonly KnowledgeSource[];
41
+ knowledge_sources?: readonly KnowledgeSource[];
42
+ knowledgeStorage?: unknown;
43
+ knowledge_storage?: unknown;
44
+ knowledgeConfig?: Record<string, unknown> | null;
45
+ knowledge_config?: Record<string, unknown> | null;
46
+ embedder?: EmbedderConfig | null;
47
+ agentKnowledgeContext?: string | null;
48
+ agent_knowledge_context?: string | null;
49
+ crewKnowledgeContext?: string | null;
50
+ crew_knowledge_context?: string | null;
51
+ knowledgeSearchQuery?: string | null;
52
+ knowledge_search_query?: string | null;
53
+ cache?: boolean;
54
+ cacheHandler?: CacheHandler | null;
55
+ cache_handler?: CacheHandler | null;
56
+ toolsHandler?: ToolsHandler | null;
57
+ tools_handler?: ToolsHandler | null;
58
+ toolsResults?: readonly Record<string, unknown>[];
59
+ tools_results?: readonly Record<string, unknown>[];
60
+ callbacks?: readonly ((...args: unknown[]) => unknown)[];
61
+ adaptedAgent?: boolean;
62
+ adapted_agent?: boolean;
63
+ apps?: readonly unknown[] | null;
64
+ mcps?: readonly unknown[] | null;
65
+ a2a?: unknown;
66
+ agentExecutor?: unknown;
67
+ agent_executor?: unknown;
68
+ executorClass?: unknown;
69
+ executor_class?: unknown;
70
+ maxTokens?: number | null;
71
+ max_tokens?: number | null;
72
+ fromRepository?: string | null;
73
+ from_repository?: string | null;
74
+ tools?: readonly Tool[];
75
+ verbose?: boolean;
76
+ allowDelegation?: boolean;
77
+ allow_delegation?: boolean;
78
+ allowCodeExecution?: boolean | null;
79
+ allow_code_execution?: boolean | null;
80
+ codeExecutionMode?: CodeExecutionMode;
81
+ code_execution_mode?: CodeExecutionMode;
82
+ respectContextWindow?: boolean;
83
+ respect_context_window?: boolean;
84
+ multimodal?: boolean;
85
+ maxIter?: number;
86
+ max_iter?: number;
87
+ maxRetryLimit?: number;
88
+ max_retry_limit?: number;
89
+ maxExecutionTime?: number | null;
90
+ max_execution_time?: number | null;
91
+ maxRpm?: number | null;
92
+ max_rpm?: number | null;
93
+ stepCallback?: AgentStepCallback | null;
94
+ step_callback?: AgentStepCallback | null;
95
+ useSystemPrompt?: boolean | null;
96
+ use_system_prompt?: boolean | null;
97
+ systemTemplate?: string | null;
98
+ system_template?: string | null;
99
+ promptTemplate?: string | null;
100
+ prompt_template?: string | null;
101
+ responseTemplate?: string | null;
102
+ response_template?: string | null;
103
+ injectDate?: boolean;
104
+ inject_date?: boolean;
105
+ dateFormat?: string;
106
+ date_format?: string;
107
+ guardrail?: AgentGuardrail | null;
108
+ guardrailMaxRetries?: number;
109
+ guardrail_max_retries?: number;
110
+ planning?: boolean;
111
+ planningConfig?: PlanningConfig | PlanningConfigOptions | null;
112
+ planning_config?: PlanningConfig | PlanningConfigOptions | null;
113
+ reasoning?: boolean;
114
+ maxReasoningAttempts?: number | null;
115
+ max_reasoning_attempts?: number | null;
116
+ skills?: readonly unknown[] | null;
117
+ securityConfig?: SecurityConfig | null;
118
+ security_config?: SecurityConfig | null;
119
+ checkpoint?: CheckpointOption;
120
+ executionContext?: ExecutionContext | null;
121
+ execution_context?: ExecutionContext | null;
122
+ checkpointKickoffEventId?: string | null;
123
+ checkpoint_kickoff_event_id?: string | null;
124
+ checkpointOriginalRole?: string | null;
125
+ checkpoint_original_role?: string | null;
126
+ checkpointOriginalGoal?: string | null;
127
+ checkpoint_original_goal?: string | null;
128
+ checkpointOriginalBackstory?: string | null;
129
+ checkpoint_original_backstory?: string | null;
130
+ };
131
+ export type AgentExecutionOptions = {
132
+ responseModel?: unknown;
133
+ responseFormat?: unknown;
134
+ response_format?: unknown;
135
+ stepCallbacks?: readonly AgentStepCallback[];
136
+ functionCallingLlm?: LLM | string | null;
137
+ memory?: Memory | MemoryScope | null;
138
+ knowledge?: Knowledge | null;
139
+ inputFiles?: InputFiles;
140
+ input_files?: InputFiles;
141
+ task?: unknown;
142
+ };
143
+ export type AgentKickoffInput = string | readonly LLMMessage[];
144
+ export type AgentExecutionPromptBuild = readonly [
145
+ SystemPromptResult | StandardPromptResult,
146
+ string[],
147
+ (() => boolean) | null
148
+ ];
149
+ export type AgentPreparedKickoff = readonly [
150
+ Record<string, unknown>,
151
+ Record<string, unknown>,
152
+ Record<string, unknown>,
153
+ readonly Tool[]
154
+ ];
155
+ export declare class Agent {
156
+ readonly entityType = "agent";
157
+ readonly entity_type = "agent";
158
+ readonly id: string;
159
+ readonly agent_id: string;
160
+ role: string;
161
+ goal: string;
162
+ backstory: string;
163
+ readonly config: Record<string, unknown> | null;
164
+ readonly llm: LLM | string | null;
165
+ readonly crew: unknown;
166
+ readonly functionCallingLlm: LLM | string | null;
167
+ readonly function_calling_llm: LLM | string | null;
168
+ memory: Memory | MemoryScope | null;
169
+ knowledge: Knowledge | null;
170
+ readonly knowledgeSources: readonly KnowledgeSource[];
171
+ readonly knowledge_sources: readonly KnowledgeSource[];
172
+ readonly knowledgeStorage: unknown;
173
+ readonly knowledge_storage: unknown;
174
+ readonly knowledgeConfig: Record<string, unknown> | null;
175
+ readonly knowledge_config: Record<string, unknown> | null;
176
+ embedder: EmbedderConfig | null;
177
+ agentKnowledgeContext: string | null;
178
+ agent_knowledge_context: string | null;
179
+ crewKnowledgeContext: string | null;
180
+ crew_knowledge_context: string | null;
181
+ knowledgeSearchQuery: string | null;
182
+ knowledge_search_query: string | null;
183
+ readonly cache: boolean;
184
+ cacheHandler: CacheHandler | null;
185
+ cache_handler: CacheHandler | null;
186
+ toolsHandler: ToolsHandler;
187
+ tools_handler: ToolsHandler;
188
+ toolsResults: Record<string, unknown>[];
189
+ tools_results: Record<string, unknown>[];
190
+ callbacks: readonly ((...args: unknown[]) => unknown)[];
191
+ adaptedAgent: boolean;
192
+ adapted_agent: boolean;
193
+ apps: readonly unknown[] | null;
194
+ mcps: readonly unknown[] | null;
195
+ a2a: unknown;
196
+ agentExecutor: unknown;
197
+ agent_executor: unknown;
198
+ executorClass: unknown;
199
+ executor_class: unknown;
200
+ maxTokens: number | null;
201
+ max_tokens: number | null;
202
+ readonly fromRepository: string | null;
203
+ readonly from_repository: string | null;
204
+ readonly tools: readonly Tool[];
205
+ readonly verbose: boolean;
206
+ readonly allowDelegation: boolean;
207
+ readonly allow_delegation: boolean;
208
+ readonly allowCodeExecution: boolean;
209
+ readonly allow_code_execution: boolean;
210
+ readonly codeExecutionMode: CodeExecutionMode;
211
+ readonly code_execution_mode: CodeExecutionMode;
212
+ readonly respectContextWindow: boolean;
213
+ readonly respect_context_window: boolean;
214
+ readonly multimodal: boolean;
215
+ readonly maxIter: number;
216
+ readonly max_iter: number;
217
+ readonly maxRetryLimit: number;
218
+ readonly max_retry_limit: number;
219
+ readonly maxExecutionTime: number | null;
220
+ readonly max_execution_time: number | null;
221
+ readonly maxRpm: number | null;
222
+ readonly max_rpm: number | null;
223
+ readonly stepCallback: AgentStepCallback | null;
224
+ readonly step_callback: AgentStepCallback | null;
225
+ readonly useSystemPrompt: boolean;
226
+ readonly use_system_prompt: boolean;
227
+ readonly systemTemplate: string | null;
228
+ readonly system_template: string | null;
229
+ readonly promptTemplate: string | null;
230
+ readonly prompt_template: string | null;
231
+ readonly responseTemplate: string | null;
232
+ readonly response_template: string | null;
233
+ readonly injectDate: boolean;
234
+ readonly inject_date: boolean;
235
+ readonly dateFormat: string;
236
+ readonly date_format: string;
237
+ readonly guardrail: AgentGuardrail | null;
238
+ readonly guardrailMaxRetries: number;
239
+ readonly guardrail_max_retries: number;
240
+ readonly planning: boolean;
241
+ readonly reasoning: boolean;
242
+ readonly maxReasoningAttempts: number | null;
243
+ readonly max_reasoning_attempts: number | null;
244
+ readonly planningConfig: PlanningConfig | null;
245
+ readonly planning_config: PlanningConfig | null;
246
+ skills: readonly unknown[];
247
+ readonly securityConfig: SecurityConfig;
248
+ readonly security_config: SecurityConfig;
249
+ checkpoint: CheckpointConfig | false | null;
250
+ executionContext: ExecutionContext | null;
251
+ execution_context: ExecutionContext | null;
252
+ checkpointKickoffEventId: string | null;
253
+ checkpoint_kickoff_event_id: string | null;
254
+ checkpointOriginalRole: string | null;
255
+ checkpoint_original_role: string | null;
256
+ checkpointOriginalGoal: string | null;
257
+ checkpoint_original_goal: string | null;
258
+ checkpointOriginalBackstory: string | null;
259
+ checkpoint_original_backstory: string | null;
260
+ private readonly llmClient;
261
+ private readonly functionCallingLlmClient;
262
+ private rpmController;
263
+ private usageMetrics;
264
+ private lastMessagesValue;
265
+ constructor(options: AgentOptions);
266
+ get planningEnabled(): boolean;
267
+ get planning_enabled(): boolean;
268
+ get fingerprint(): Fingerprint;
269
+ get key(): string;
270
+ get lastMessages(): readonly LLMMessage[];
271
+ get last_messages(): readonly LLMMessage[];
272
+ toString(): string;
273
+ __repr__(): string;
274
+ getKnowledgeSearchQuery(taskPrompt: string, task: unknown): Promise<string | null>;
275
+ _get_knowledge_search_query(task_prompt: string, task: unknown): Promise<string | null>;
276
+ static fromCheckpoint(config: CheckpointConfig): Promise<Agent>;
277
+ static from_checkpoint(config: CheckpointConfig): Promise<Agent>;
278
+ static fork(config: CheckpointConfig, branch?: string | null): Promise<Agent>;
279
+ static coerceSkillStrings(skills: unknown): unknown;
280
+ static coerce_skill_strings(skills: unknown): unknown;
281
+ static processModelConfig(values: Record<string, unknown>): Record<string, unknown>;
282
+ static process_model_config(values: Record<string, unknown>): Record<string, unknown>;
283
+ static validateFromRepository(values: Record<string, unknown>): Record<string, unknown>;
284
+ static validate_from_repository(values: Record<string, unknown>): Record<string, unknown>;
285
+ setFingerprint(fingerprint: Fingerprint): void;
286
+ set_fingerprint(fingerprint: Fingerprint): void;
287
+ copy(): Agent;
288
+ modelDump(options?: ModelDumpOptions): Record<string, unknown>;
289
+ model_dump(options?: ModelDumpOptions): Record<string, unknown>;
290
+ setPrivateAttrs(): this;
291
+ postInitSetup(): this;
292
+ post_init_setup(): this;
293
+ set_private_attrs(): this;
294
+ validateTools(): this;
295
+ validate_tools(): this;
296
+ validateApps(): this;
297
+ validate_apps(): this;
298
+ validateMcps(): this;
299
+ validate_mcps(): this;
300
+ setupAgentExecutor(): void;
301
+ _setup_agent_executor(): void;
302
+ validateAndSetAttributes(): this;
303
+ validate_and_set_attributes(): this;
304
+ resolveMemory(): Memory | MemoryScope | null;
305
+ resolve_memory(): Memory | MemoryScope | null;
306
+ createKnowledgeFromSources(): Knowledge | null;
307
+ setKnowledge(knowledgeOrCrewEmbedder?: Knowledge | EmbedderConfig | null): void;
308
+ set_knowledge(knowledgeOrCrewEmbedder?: Knowledge | EmbedderConfig | null): void;
309
+ setRpmController(controller: RpmController | null): void;
310
+ set_rpm_controller(controller: RpmController | null): void;
311
+ isAnyAvailableMemory(): boolean;
312
+ _is_any_available_memory(): boolean;
313
+ supportsNativeToolCalling(tools: readonly Tool[]): boolean;
314
+ _supports_native_tool_calling(tools: readonly Tool[]): boolean;
315
+ getDelegationTools(): readonly Tool[];
316
+ get_delegation_tools(): readonly Tool[];
317
+ getPlatformTools(): readonly Tool[];
318
+ get_platform_tools(): readonly Tool[];
319
+ getMcpTools(): readonly Tool[];
320
+ get_mcp_tools(): readonly Tool[];
321
+ cleanupMcpClients(): Promise<void>;
322
+ _cleanup_mcp_clients(): Promise<void>;
323
+ executeWithoutTimeout(taskPrompt: string, task: unknown): Promise<unknown>;
324
+ _execute_without_timeout(task_prompt: string, task: unknown): Promise<unknown>;
325
+ executeWithTimeout(taskPrompt: string, task: unknown, timeout: number): Promise<unknown>;
326
+ _execute_with_timeout(task_prompt: string, task: unknown, timeout: number): Promise<unknown>;
327
+ aexecuteWithoutTimeout(taskPrompt: string, task: unknown): Promise<unknown>;
328
+ _aexecute_without_timeout(task_prompt: string, task: unknown): Promise<unknown>;
329
+ aexecuteWithTimeout(taskPrompt: string, task: unknown, timeout: number): Promise<unknown>;
330
+ _aexecute_with_timeout(task_prompt: string, task: unknown, timeout: number): Promise<unknown>;
331
+ retrieveMemoryContext(task: unknown, taskPrompt: string): string;
332
+ _retrieve_memory_context(task: unknown, task_prompt: string): string;
333
+ finalizeTaskPrompt(taskPrompt: string, _tools: readonly Tool[] | null, _task: unknown): string;
334
+ _finalize_task_prompt(task_prompt: string, tools: readonly Tool[] | null, task: unknown): string;
335
+ finalizeTaskExecution(task: unknown, result: unknown): Promise<unknown>;
336
+ _finalize_task_execution(task: unknown, result: unknown): Promise<unknown>;
337
+ checkExecutionError(error: unknown, task: unknown): void;
338
+ _check_execution_error(error: unknown, task: unknown): void;
339
+ private executorPayload;
340
+ getMultimodalTools(): readonly Tool[];
341
+ get_multimodal_tools(): readonly Tool[];
342
+ getCodeExecutionTools(): readonly Tool[];
343
+ get_code_execution_tools(): readonly Tool[];
344
+ _validateDockerInstallation(): void;
345
+ _validate_docker_installation(): void;
346
+ private emitCodeInterpreterDeprecationWarning;
347
+ static getOutputConverter(llm: unknown, text: string, model: unknown, instructions: string): Converter;
348
+ static get_output_converter(llm: unknown, text: string, model: unknown, instructions: string): Converter;
349
+ getOutputConverter(): null;
350
+ getOutputConverter(llm: unknown, text: string, model: unknown, instructions: string): Converter;
351
+ get_output_converter(): null;
352
+ get_output_converter(llm: unknown, text: string, model: unknown, instructions: string): Converter;
353
+ _training_handler(taskPrompt: string): string;
354
+ _use_trained_data(taskPrompt: string): string;
355
+ static renderTextDescription(tools: readonly Tool[]): string;
356
+ static _render_text_description(tools: readonly Tool[]): string;
357
+ _injectDateToTask(task: Record<string, unknown>): void;
358
+ _inject_date_to_task(task: Record<string, unknown>): void;
359
+ createAgentExecutor(): unknown;
360
+ create_agent_executor(): unknown;
361
+ prepareTaskExecution(task: unknown, context?: string | null): string;
362
+ _prepare_task_execution(task: unknown, context?: string | null): string;
363
+ handleExecutionError(error: unknown, task: unknown, context?: string | null, tools?: readonly Tool[]): Promise<string>;
364
+ _handle_execution_error(error: unknown, task: unknown, context?: string | null, tools?: readonly Tool[]): Promise<string>;
365
+ handleExecutionErrorAsync(error: unknown, task: unknown, context?: string | null, tools?: readonly Tool[]): Promise<string>;
366
+ _handle_execution_error_async(error: unknown, task: unknown, context?: string | null, tools?: readonly Tool[]): Promise<string>;
367
+ buildExecutionPrompt(rawTools: readonly Tool[]): AgentExecutionPromptBuild;
368
+ _build_execution_prompt(raw_tools: readonly Tool[]): AgentExecutionPromptBuild;
369
+ updateExecutorParameters(task: unknown, tools: readonly Tool[], rawTools: readonly Tool[], prompt: SystemPromptResult | StandardPromptResult, stopWords: readonly string[], rpmLimitFn: (() => boolean) | null): void;
370
+ _update_executor_parameters(task: unknown, tools: readonly Tool[], raw_tools: readonly Tool[], prompt: SystemPromptResult | StandardPromptResult, stop_words: readonly string[], rpm_limit_fn: (() => boolean) | null): void;
371
+ interpolateInputs(inputs: InputValues): void;
372
+ interpolate_inputs(inputs: InputValues): void;
373
+ executeTask(prompt: string, inputs?: InputValues, taskTools?: readonly Tool[], options?: AgentExecutionOptions): Promise<string>;
374
+ execute_task(promptOrOptions: string | {
375
+ task?: {
376
+ prompt?: () => string;
377
+ description?: string;
378
+ } | string;
379
+ context?: string | null;
380
+ tools?: readonly Tool[];
381
+ }, context?: string | null, tools?: readonly Tool[]): Promise<string>;
382
+ aexecuteTask(prompt: string, inputs?: InputValues, tools?: readonly Tool[], options?: AgentExecutionOptions): Promise<string>;
383
+ aexecuteTask(promptOrOptions: Parameters<Agent["execute_task"]>[0], context?: string | null, tools?: readonly Tool[]): Promise<string>;
384
+ aexecute_task(promptOrOptions: Parameters<Agent["execute_task"]>[0], context?: string | null, tools?: readonly Tool[]): Promise<string>;
385
+ private executeTaskWithRetries;
386
+ private executeTaskOnce;
387
+ kickoff(input: AgentKickoffInput, options?: AgentExecutionOptions): Promise<string | LiteAgentOutput>;
388
+ kickoffAsync(input: AgentKickoffInput, options?: AgentExecutionOptions): Promise<string | LiteAgentOutput>;
389
+ kickoff_async(input: AgentKickoffInput, options?: AgentExecutionOptions): Promise<string | LiteAgentOutput>;
390
+ akickoff(input: AgentKickoffInput, options?: AgentExecutionOptions): Promise<string | LiteAgentOutput>;
391
+ prepareKickoff(messages: AgentKickoffInput, responseFormat?: unknown, inputFiles?: InputFiles): AgentPreparedKickoff;
392
+ _prepare_kickoff(messages: AgentKickoffInput, response_format?: unknown, input_files?: InputFiles): AgentPreparedKickoff;
393
+ finalizeKickoff(output: LiteAgentOutput, executor: Record<string, unknown>, inputs: Record<string, unknown>, responseFormat: unknown, messages: AgentKickoffInput, agentInfo: Record<string, unknown>): LiteAgentOutput;
394
+ _finalize_kickoff(output: LiteAgentOutput, executor: Record<string, unknown>, inputs: Record<string, unknown>, response_format: unknown, messages: AgentKickoffInput, agent_info: Record<string, unknown>): LiteAgentOutput;
395
+ emitKickoffError(agentInfo: Record<string, unknown>, error: unknown): never;
396
+ _emit_kickoff_error(agent_info: Record<string, unknown>, error: unknown): never;
397
+ saveKickoffToMemory(messages: AgentKickoffInput, outputText: string): void;
398
+ _save_kickoff_to_memory(messages: AgentKickoffInput, output_text: string): void;
399
+ buildOutputFromResult(result: Record<string, unknown>, executor: Record<string, unknown>, responseFormat?: unknown): LiteAgentOutput;
400
+ _build_output_from_result(result: Record<string, unknown>, executor: Record<string, unknown>, response_format?: unknown): LiteAgentOutput;
401
+ executeAndBuildOutput(executor: Record<string, unknown>, inputs: Record<string, unknown>, responseFormat?: unknown): LiteAgentOutput;
402
+ _execute_and_build_output(executor: Record<string, unknown>, inputs: Record<string, unknown>, response_format?: unknown): LiteAgentOutput;
403
+ executeAndBuildOutputAsync(executor: Record<string, unknown>, inputs: Record<string, unknown>, responseFormat?: unknown): Promise<LiteAgentOutput>;
404
+ _execute_and_build_output_async(executor: Record<string, unknown>, inputs: Record<string, unknown>, response_format?: unknown): Promise<LiteAgentOutput>;
405
+ processKickoffGuardrail(output: LiteAgentOutput, executor: Record<string, unknown>, inputs: Record<string, unknown>, responseFormat?: unknown, retryCount?: number): LiteAgentOutput;
406
+ _process_kickoff_guardrail(output: LiteAgentOutput, executor: Record<string, unknown>, inputs: Record<string, unknown>, response_format?: unknown, retry_count?: number): LiteAgentOutput;
407
+ private kickoffAgentInfo;
408
+ getUsageMetrics(): UsageMetrics;
409
+ resetUsageMetrics(): void;
410
+ setCacheHandler(cacheHandler: CacheHandler): void;
411
+ set_cache_handler(cacheHandler: CacheHandler): void;
412
+ setSkills(resolvedCrewSkills?: readonly unknown[] | null): void;
413
+ set_skills(resolvedCrewSkills?: readonly unknown[] | null): void;
414
+ private resolveLLMClient;
415
+ private resolveFunctionCallingLLMClient;
416
+ private resolveLLMReference;
417
+ private resolvePlanningLLMClient;
418
+ private preparePromptWithPlanning;
419
+ private runPlanningLoop;
420
+ private emitReasoningStarted;
421
+ private emitReasoningCompleted;
422
+ private emitReasoningFailed;
423
+ private promptWithInjectedDate;
424
+ private promptWithMemoryContext;
425
+ private promptWithKnowledgeContext;
426
+ private saveResultToMemory;
427
+ private callAndTrackLLM;
428
+ private messagesWithInputFilesForClient;
429
+ private clientSupportsMultimodal;
430
+ private modelNameForClient;
431
+ private applyGuardrail;
432
+ private emitStep;
433
+ private buildMessages;
434
+ private renderSystemPrompt;
435
+ private renderUserPrompt;
436
+ private runToolCall;
437
+ }
438
+ export declare class AgentGuardrailError extends Error {
439
+ constructor(message: string);
440
+ }
441
+ export declare class AgentExecutionTimeoutError extends Error {
442
+ constructor(message: string);
443
+ }
444
+ export {};
package/dist/auth.d.ts ADDED
@@ -0,0 +1,179 @@
1
+ export declare const ALGORITHMS: readonly ["RS256"];
2
+ export declare class AuthError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ export type TokenManagerOptions = {
6
+ filePath?: string;
7
+ file_path?: string;
8
+ storageDir?: string;
9
+ storage_dir?: string;
10
+ };
11
+ export declare class TokenManager {
12
+ readonly filePath: string;
13
+ readonly file_path: string;
14
+ readonly storageDir: string;
15
+ readonly storage_dir: string;
16
+ private readonly key;
17
+ constructor(filePathOrOptions?: string | TokenManagerOptions);
18
+ saveTokens(accessToken: string, expiresAt: number): void;
19
+ save_tokens(accessToken: string, expiresAt: number): void;
20
+ getToken(): string | null;
21
+ get_token(): string | null;
22
+ clearTokens(): void;
23
+ clear_tokens(): void;
24
+ private getOrCreateKey;
25
+ private atomicCreateSecureFile;
26
+ private atomicWriteSecureFile;
27
+ private readSecureFile;
28
+ private deleteSecureFile;
29
+ }
30
+ export declare function getAuthToken(tokenManager?: TokenManager): string;
31
+ export declare const get_auth_token: typeof getAuthToken;
32
+ export type Oauth2SettingsOptions = {
33
+ provider: string;
34
+ clientId?: string;
35
+ client_id?: string;
36
+ domain: string;
37
+ audience?: string | null;
38
+ extra?: Record<string, unknown>;
39
+ };
40
+ export declare class Oauth2Settings {
41
+ readonly provider: string;
42
+ readonly clientId: string;
43
+ readonly client_id: string;
44
+ readonly domain: string;
45
+ readonly audience: string | null;
46
+ readonly extra: Record<string, unknown>;
47
+ constructor(options: Oauth2SettingsOptions);
48
+ static fromSettings(settings: Oauth2SettingsOptions): Oauth2Settings;
49
+ static from_settings(settings: Oauth2SettingsOptions): Oauth2Settings;
50
+ }
51
+ export declare abstract class BaseProvider {
52
+ readonly settings: Oauth2Settings;
53
+ constructor(settings: Oauth2Settings);
54
+ abstract getAuthorizeUrl(): string;
55
+ abstract getTokenUrl(): string;
56
+ abstract getJwksUrl(): string;
57
+ abstract getIssuer(): string;
58
+ abstract getAudience(): string;
59
+ abstract getClientId(): string;
60
+ get_authorize_url(): string;
61
+ get_token_url(): string;
62
+ get_jwks_url(): string;
63
+ get_issuer(): string;
64
+ get_audience(): string;
65
+ get_client_id(): string;
66
+ getRequiredFields(): readonly string[];
67
+ get_required_fields(): readonly string[];
68
+ getOauthScopes(): readonly string[];
69
+ get_oauth_scopes(): readonly string[];
70
+ }
71
+ export declare class Auth0Provider extends BaseProvider {
72
+ getAuthorizeUrl(): string;
73
+ getTokenUrl(): string;
74
+ getJwksUrl(): string;
75
+ getIssuer(): string;
76
+ getAudience(): string;
77
+ getClientId(): string;
78
+ private domain;
79
+ }
80
+ export declare class WorkosProvider extends BaseProvider {
81
+ getAuthorizeUrl(): string;
82
+ getTokenUrl(): string;
83
+ getJwksUrl(): string;
84
+ getIssuer(): string;
85
+ getAudience(): string;
86
+ getClientId(): string;
87
+ private domain;
88
+ }
89
+ export declare class EntraIdProvider extends BaseProvider {
90
+ getAuthorizeUrl(): string;
91
+ getTokenUrl(): string;
92
+ getJwksUrl(): string;
93
+ getIssuer(): string;
94
+ getAudience(): string;
95
+ getClientId(): string;
96
+ getOauthScopes(): readonly string[];
97
+ getRequiredFields(): readonly string[];
98
+ private baseUrl;
99
+ }
100
+ export declare class KeycloakProvider extends BaseProvider {
101
+ getAuthorizeUrl(): string;
102
+ getTokenUrl(): string;
103
+ getJwksUrl(): string;
104
+ getIssuer(): string;
105
+ getAudience(): string;
106
+ getClientId(): string;
107
+ getRequiredFields(): readonly string[];
108
+ private baseUrl;
109
+ }
110
+ export declare class OktaProvider extends BaseProvider {
111
+ getAuthorizeUrl(): string;
112
+ getTokenUrl(): string;
113
+ getJwksUrl(): string;
114
+ getIssuer(): string;
115
+ getAudience(): string;
116
+ getClientId(): string;
117
+ getRequiredFields(): readonly string[];
118
+ private baseUrl;
119
+ }
120
+ export type ProviderConstructor = new (settings: Oauth2Settings) => BaseProvider;
121
+ export declare const ProviderFactory: {
122
+ register(provider: string, providerClass: ProviderConstructor): void;
123
+ fromSettings(settings: Oauth2Settings): BaseProvider;
124
+ from_settings(settings: Oauth2Settings): BaseProvider;
125
+ };
126
+ export type DeviceCodeData = {
127
+ device_code: string;
128
+ user_code: string;
129
+ verification_uri?: string;
130
+ verification_uri_complete?: string;
131
+ interval?: number;
132
+ };
133
+ export type TokenResponseData = {
134
+ access_token?: string;
135
+ error?: string;
136
+ error_description?: string;
137
+ [key: string]: unknown;
138
+ };
139
+ export type AuthenticationCommandOptions = {
140
+ tokenManager?: TokenManager;
141
+ token_manager?: TokenManager;
142
+ oauth2Provider?: BaseProvider;
143
+ oauth2_provider?: BaseProvider;
144
+ fetch?: typeof fetch;
145
+ openBrowser?: (url: string) => unknown;
146
+ open_browser?: (url: string) => unknown;
147
+ maxAttempts?: number;
148
+ max_attempts?: number;
149
+ };
150
+ export declare class AuthenticationCommand {
151
+ readonly tokenManager: TokenManager;
152
+ readonly token_manager: TokenManager;
153
+ readonly oauth2Provider: BaseProvider;
154
+ readonly oauth2_provider: BaseProvider;
155
+ private readonly fetchImpl;
156
+ private readonly openBrowser;
157
+ private readonly maxAttempts;
158
+ constructor(options?: AuthenticationCommandOptions);
159
+ login(): Promise<void>;
160
+ private getDeviceCode;
161
+ private displayAuthInstructions;
162
+ private pollForToken;
163
+ private validateAndSaveToken;
164
+ }
165
+ export type ValidateJwtTokenOptions = {
166
+ jwtToken?: string;
167
+ jwt_token?: string;
168
+ jwksUrl?: string;
169
+ jwks_url?: string;
170
+ issuer: string;
171
+ audience: string;
172
+ fetch?: typeof fetch;
173
+ leewaySeconds?: number;
174
+ leeway_seconds?: number;
175
+ };
176
+ export declare function validateJwtToken(options: ValidateJwtTokenOptions): Promise<Record<string, unknown>>;
177
+ export declare const validate_jwt_token: typeof validateJwtToken;
178
+ export declare function createTemporaryTokenStorage(): string;
179
+ export declare function constantTimeEquals(left: string, right: string): boolean;
@@ -0,0 +1,5 @@
1
+ export declare function processConfig(values: Record<string, unknown>, modelClass: {
2
+ modelFields?: Record<string, unknown>;
3
+ model_fields?: Record<string, unknown>;
4
+ }): Record<string, unknown>;
5
+ export declare const process_config: typeof processConfig;
@@ -0,0 +1,12 @@
1
+ export type ContentProcessorProvider = {
2
+ process(content: string, context?: Record<string, unknown> | null): string;
3
+ };
4
+ export declare const ContentProcessorProvider: Readonly<{
5
+ kind: "ContentProcessorProvider";
6
+ }>;
7
+ export declare class NoOpContentProcessor implements ContentProcessorProvider {
8
+ process(content: string, _context?: Record<string, unknown> | null): string;
9
+ }
10
+ export declare function get_processor(): ContentProcessorProvider;
11
+ export declare function set_processor(processor: ContentProcessorProvider): void;
12
+ export declare function process_content(content: string, context?: Record<string, unknown> | null): string;