@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.
- package/dist/a2a.d.ts +1684 -0
- package/dist/a2ui-schemas.d.ts +3312 -0
- package/dist/a2ui.d.ts +379 -0
- package/dist/agent-adapters.d.ts +178 -0
- package/dist/agent-executors.d.ts +508 -0
- package/dist/agent-parser.d.ts +44 -0
- package/dist/agent-planning.d.ts +358 -0
- package/dist/agent-utils.d.ts +210 -0
- package/dist/agent.d.ts +444 -0
- package/dist/auth.d.ts +179 -0
- package/dist/config-utils.d.ts +5 -0
- package/dist/content-processor.d.ts +12 -0
- package/dist/context.d.ts +157 -0
- package/dist/converter.d.ts +97 -0
- package/dist/crew-chat.d.ts +97 -0
- package/dist/crew.d.ts +424 -0
- package/dist/decorators.d.ts +20 -0
- package/dist/env.d.ts +13 -0
- package/dist/errors.d.ts +27 -0
- package/dist/evaluators.d.ts +477 -0
- package/dist/events.d.ts +2657 -0
- package/dist/execution-utils.d.ts +85 -0
- package/dist/experimental-conversational.d.ts +181 -0
- package/dist/file-handler.d.ts +36 -0
- package/dist/file-store.d.ts +37 -0
- package/dist/files.d.ts +554 -0
- package/dist/flow-conversation.d.ts +90 -0
- package/dist/flow-definition.d.ts +195 -0
- package/dist/flow-persistence.d.ts +107 -0
- package/dist/flow-visualization.d.ts +77 -0
- package/dist/flow.d.ts +927 -0
- package/dist/formatter.d.ts +7 -0
- package/dist/guardrail.d.ts +95 -0
- package/dist/hooks.d.ts +241 -0
- package/dist/human-input.d.ts +74 -0
- package/dist/i18n.d.ts +26 -0
- package/dist/index.d.ts +99 -13004
- package/dist/input-files.d.ts +24 -0
- package/dist/input-provider.d.ts +22 -0
- package/dist/knowledge.d.ts +353 -0
- package/dist/lite-agent-output.d.ts +69 -0
- package/dist/lite-agent.d.ts +154 -0
- package/dist/llm.d.ts +630 -0
- package/dist/llms-hooks-transport.d.ts +1 -2
- package/dist/lock-store.d.ts +14 -0
- package/dist/logger.d.ts +55 -0
- package/dist/mcp.d.ts +315 -0
- package/dist/memory.d.ts +915 -0
- package/dist/metadata.d.ts +9 -0
- package/dist/misc-compat.d.ts +125 -0
- package/dist/openai-completion.d.ts +324 -0
- package/dist/outputs.d.ts +69 -0
- package/dist/planning.d.ts +60 -0
- package/dist/plus-api.d.ts +194 -0
- package/dist/project-compat.d.ts +133 -0
- package/dist/project.d.ts +221 -0
- package/dist/prompts.d.ts +66 -0
- package/dist/provider-completions.d.ts +593 -0
- package/dist/rag.d.ts +1074 -0
- package/dist/rpm.d.ts +27 -0
- package/dist/rw-lock.d.ts +21 -0
- package/dist/schema-utils.d.ts +121 -0
- package/dist/security.d.ts +66 -0
- package/dist/settings.d.ts +103 -0
- package/dist/skills.d.ts +145 -0
- package/dist/state-provider-core.d.ts +1 -1
- package/dist/state.d.ts +204 -0
- package/dist/step-execution-context.d.ts +36 -0
- package/dist/streaming.d.ts +153 -0
- package/dist/string-utils.d.ts +12 -0
- package/dist/task-output-storage.d.ts +62 -0
- package/dist/task.d.ts +305 -0
- package/dist/telemetry.d.ts +91 -0
- package/dist/token-counter-callback.d.ts +36 -0
- package/dist/tools.d.ts +563 -0
- package/dist/tracing-utils.d.ts +56 -0
- package/dist/training-converter.d.ts +36 -0
- package/dist/training-handler.d.ts +10 -0
- package/dist/types.d.ts +72 -0
- package/dist/utilities.d.ts +130 -0
- package/dist/utility-types.d.ts +10 -0
- package/dist/version.d.ts +12 -0
- package/package.json +326 -4904
- package/dist/index.d.cts +0 -13068
- package/dist/llms-hooks-transport-ChGiFBiU.d.ts +0 -233
- package/dist/llms-hooks-transport-DZlurMUQ.d.cts +0 -233
- package/dist/llms-hooks-transport.d.cts +0 -2
- package/dist/state-provider-core-Be9RKRAm.d.cts +0 -4876
- package/dist/state-provider-core-Be9RKRAm.d.ts +0 -4876
- package/dist/state-provider-core.d.cts +0 -1
package/dist/task.d.ts
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { Agent } from "./agent.js";
|
|
2
|
+
import type { Knowledge } from "./knowledge.js";
|
|
3
|
+
import { type HumanInputProvider } from "./human-input.js";
|
|
4
|
+
import { TaskOutput } from "./outputs.js";
|
|
5
|
+
import type { Memory, MemoryScope } from "./memory.js";
|
|
6
|
+
import { type Fingerprint, type SecurityConfig } from "./security.js";
|
|
7
|
+
import { interpolateOnly } from "./string-utils.js";
|
|
8
|
+
import { OutputFormat, type AgentStepCallback, type InputValues, type LLM, type MaybePromise, type TaskCallback, type Tool } from "./types.js";
|
|
9
|
+
import type { InputFile, InputFiles } from "./input-files.js";
|
|
10
|
+
import { type JsonSchema } from "./schema-utils.js";
|
|
11
|
+
export type GuardrailResult = readonly [boolean, unknown] | {
|
|
12
|
+
success: boolean;
|
|
13
|
+
result: unknown;
|
|
14
|
+
};
|
|
15
|
+
export type Guardrail = (output: TaskOutput) => GuardrailResult | Promise<GuardrailResult>;
|
|
16
|
+
export type TaskGuardrail = Guardrail | string;
|
|
17
|
+
export type ConditionalTaskCondition = (output: TaskOutput) => MaybePromise<boolean>;
|
|
18
|
+
export type TaskOutputConverter = (raw: string) => MaybePromise<unknown>;
|
|
19
|
+
export type DeserializedModelClass = TaskOutputConverter & {
|
|
20
|
+
readonly schema: Record<string, unknown>;
|
|
21
|
+
};
|
|
22
|
+
export type TaskInputFile = InputFile;
|
|
23
|
+
export type TaskInputFiles = InputFiles;
|
|
24
|
+
export type TaskExecutionOptions = {
|
|
25
|
+
stepCallbacks?: readonly AgentStepCallback[];
|
|
26
|
+
humanInputProvider?: HumanInputProvider | null;
|
|
27
|
+
taskCallback?: TaskCallback | null;
|
|
28
|
+
context?: string | null;
|
|
29
|
+
triggerPayload?: unknown;
|
|
30
|
+
inputFiles?: TaskInputFiles;
|
|
31
|
+
functionCallingLlm?: LLM | string | null;
|
|
32
|
+
memory?: Memory | MemoryScope | null;
|
|
33
|
+
knowledge?: Knowledge | null;
|
|
34
|
+
useAsyncAgent?: boolean;
|
|
35
|
+
};
|
|
36
|
+
type ModelDumpOptions = {
|
|
37
|
+
mode?: string;
|
|
38
|
+
exclude?: ReadonlySet<string> | readonly string[] | Record<string, unknown>;
|
|
39
|
+
};
|
|
40
|
+
type ExportedTaskOutput = readonly [unknown, Record<string, unknown> | null];
|
|
41
|
+
type TaskAsyncFuture = {
|
|
42
|
+
setResult?: (value: TaskOutput) => void;
|
|
43
|
+
set_result?: (value: TaskOutput) => void;
|
|
44
|
+
resolve?: (value: TaskOutput) => void;
|
|
45
|
+
setException?: (error: unknown) => void;
|
|
46
|
+
set_exception?: (error: unknown) => void;
|
|
47
|
+
reject?: (error: unknown) => void;
|
|
48
|
+
};
|
|
49
|
+
export type TaskExecutionFuture = Promise<TaskOutput> & {
|
|
50
|
+
result: () => Promise<TaskOutput>;
|
|
51
|
+
exception: () => Promise<unknown>;
|
|
52
|
+
};
|
|
53
|
+
export declare function get_supported_content_types(provider: string, api?: string | null): string[];
|
|
54
|
+
export declare function is_auto_injected(content_type: string, supported_types: readonly string[]): boolean;
|
|
55
|
+
export declare function get_agent_by_role<T extends {
|
|
56
|
+
role?: string;
|
|
57
|
+
}>(agents: readonly T[], role: string): T | null;
|
|
58
|
+
export declare function _serialize_model_class(value: unknown): JsonSchema | null;
|
|
59
|
+
export declare function _deserialize_model_class(value: unknown): TaskOutputConverter | null;
|
|
60
|
+
export type TaskOptions = {
|
|
61
|
+
id?: string;
|
|
62
|
+
fromCheckpoint?: boolean;
|
|
63
|
+
from_checkpoint?: boolean;
|
|
64
|
+
name?: string | null;
|
|
65
|
+
description?: string;
|
|
66
|
+
expectedOutput?: string;
|
|
67
|
+
expected_output?: string;
|
|
68
|
+
config?: Record<string, unknown> | null;
|
|
69
|
+
promptContext?: string | null;
|
|
70
|
+
prompt_context?: string | null;
|
|
71
|
+
agent?: Agent | null;
|
|
72
|
+
context?: readonly Task[] | null | undefined;
|
|
73
|
+
tools?: readonly Tool[];
|
|
74
|
+
callback?: TaskCallback | null;
|
|
75
|
+
callbacks?: readonly TaskCallback[];
|
|
76
|
+
outputJson?: boolean | null;
|
|
77
|
+
output_json?: boolean | null;
|
|
78
|
+
outputPydantic?: ((raw: string) => unknown) | null;
|
|
79
|
+
output_pydantic?: ((raw: string) => unknown) | null;
|
|
80
|
+
outputConverter?: TaskOutputConverter | null;
|
|
81
|
+
output_converter?: TaskOutputConverter | null;
|
|
82
|
+
converterCls?: TaskOutputConverter | null;
|
|
83
|
+
converter_cls?: TaskOutputConverter | null;
|
|
84
|
+
responseModel?: unknown;
|
|
85
|
+
response_model?: unknown;
|
|
86
|
+
outputFile?: string | null;
|
|
87
|
+
output_file?: string | null;
|
|
88
|
+
inputFiles?: TaskInputFiles;
|
|
89
|
+
input_files?: TaskInputFiles;
|
|
90
|
+
createDirectory?: boolean;
|
|
91
|
+
create_directory?: boolean;
|
|
92
|
+
asyncExecution?: boolean;
|
|
93
|
+
async_execution?: boolean;
|
|
94
|
+
humanInput?: boolean;
|
|
95
|
+
human_input?: boolean;
|
|
96
|
+
markdown?: boolean;
|
|
97
|
+
allowCrewaiTriggerContext?: boolean | null;
|
|
98
|
+
allow_crewai_trigger_context?: boolean | null;
|
|
99
|
+
guardrail?: TaskGuardrail | null;
|
|
100
|
+
guardrails?: TaskGuardrail | readonly TaskGuardrail[] | null;
|
|
101
|
+
guardrailMaxRetries?: number;
|
|
102
|
+
guardrail_max_retries?: number;
|
|
103
|
+
max_retries?: number | null;
|
|
104
|
+
retryCount?: number;
|
|
105
|
+
retry_count?: number;
|
|
106
|
+
usedTools?: number;
|
|
107
|
+
used_tools?: number;
|
|
108
|
+
toolsErrors?: number;
|
|
109
|
+
tools_errors?: number;
|
|
110
|
+
delegations?: number;
|
|
111
|
+
processedByAgents?: Iterable<string>;
|
|
112
|
+
processed_by_agents?: Iterable<string>;
|
|
113
|
+
startTime?: Date | string | null;
|
|
114
|
+
start_time?: Date | string | null;
|
|
115
|
+
endTime?: Date | string | null;
|
|
116
|
+
end_time?: Date | string | null;
|
|
117
|
+
output?: TaskOutput | null;
|
|
118
|
+
checkpointOriginalDescription?: string | null;
|
|
119
|
+
checkpoint_original_description?: string | null;
|
|
120
|
+
checkpointOriginalExpectedOutput?: string | null;
|
|
121
|
+
checkpoint_original_expected_output?: string | null;
|
|
122
|
+
checkpointOriginalOutputFile?: string | null;
|
|
123
|
+
checkpoint_original_output_file?: string | null;
|
|
124
|
+
securityConfig?: SecurityConfig | null;
|
|
125
|
+
security_config?: SecurityConfig | null;
|
|
126
|
+
};
|
|
127
|
+
export declare class Task {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly name: string | null;
|
|
130
|
+
description: string;
|
|
131
|
+
expectedOutput: string;
|
|
132
|
+
expected_output: string;
|
|
133
|
+
readonly config: Record<string, unknown> | null;
|
|
134
|
+
readonly agent: Agent | null;
|
|
135
|
+
readonly context: readonly Task[] | null | undefined;
|
|
136
|
+
readonly tools: readonly Tool[];
|
|
137
|
+
readonly callback: TaskCallback | null;
|
|
138
|
+
readonly callbacks: readonly TaskCallback[];
|
|
139
|
+
readonly outputJson: boolean | null;
|
|
140
|
+
readonly output_json: boolean | null;
|
|
141
|
+
readonly outputPydantic: ((raw: string) => unknown) | null;
|
|
142
|
+
readonly output_pydantic: ((raw: string) => unknown) | null;
|
|
143
|
+
readonly outputConverter: TaskOutputConverter | null;
|
|
144
|
+
readonly output_converter: TaskOutputConverter | null;
|
|
145
|
+
readonly converterCls: TaskOutputConverter | null;
|
|
146
|
+
readonly converter_cls: TaskOutputConverter | null;
|
|
147
|
+
readonly responseModel: unknown;
|
|
148
|
+
readonly response_model: unknown;
|
|
149
|
+
outputFile: string | null;
|
|
150
|
+
output_file: string | null;
|
|
151
|
+
readonly inputFiles: TaskInputFiles;
|
|
152
|
+
readonly input_files: TaskInputFiles;
|
|
153
|
+
readonly createDirectory: boolean;
|
|
154
|
+
readonly create_directory: boolean;
|
|
155
|
+
readonly asyncExecution: boolean;
|
|
156
|
+
readonly async_execution: boolean;
|
|
157
|
+
readonly humanInput: boolean;
|
|
158
|
+
readonly human_input: boolean;
|
|
159
|
+
readonly markdown: boolean;
|
|
160
|
+
allowCrewaiTriggerContext: boolean | null;
|
|
161
|
+
allow_crewai_trigger_context: boolean | null;
|
|
162
|
+
readonly guardrail: TaskGuardrail | null;
|
|
163
|
+
readonly guardrails: readonly TaskGuardrail[];
|
|
164
|
+
guardrailMaxRetries: number;
|
|
165
|
+
guardrail_max_retries: number;
|
|
166
|
+
readonly maxRetries: number | null;
|
|
167
|
+
readonly max_retries: number | null;
|
|
168
|
+
readonly securityConfig: SecurityConfig;
|
|
169
|
+
readonly security_config: SecurityConfig;
|
|
170
|
+
usedTools: number;
|
|
171
|
+
used_tools: number;
|
|
172
|
+
toolsErrors: number;
|
|
173
|
+
tools_errors: number;
|
|
174
|
+
delegations: number;
|
|
175
|
+
retryCount: number;
|
|
176
|
+
retry_count: number;
|
|
177
|
+
startTime: Date | null;
|
|
178
|
+
endTime: Date | null;
|
|
179
|
+
promptContext: string | null;
|
|
180
|
+
prompt_context: string | null;
|
|
181
|
+
readonly processedByAgents: Set<string>;
|
|
182
|
+
processed_by_agents: Set<string>;
|
|
183
|
+
output: TaskOutput | null;
|
|
184
|
+
checkpointOriginalDescription: string | null;
|
|
185
|
+
checkpoint_original_description: string | null;
|
|
186
|
+
checkpointOriginalExpectedOutput: string | null;
|
|
187
|
+
checkpoint_original_expected_output: string | null;
|
|
188
|
+
checkpointOriginalOutputFile: string | null;
|
|
189
|
+
checkpoint_original_output_file: string | null;
|
|
190
|
+
private executionPlan;
|
|
191
|
+
private resolvedGuardrail;
|
|
192
|
+
private resolvedGuardrails;
|
|
193
|
+
private readonly guardrailRetryCounts;
|
|
194
|
+
readonly _guardrail_retry_counts: Map<number, number>;
|
|
195
|
+
constructor(options: TaskOptions);
|
|
196
|
+
get fingerprint(): Fingerprint;
|
|
197
|
+
get key(): string;
|
|
198
|
+
get executionDuration(): number | null;
|
|
199
|
+
get start_time(): Date | null;
|
|
200
|
+
set start_time(value: Date | string | null);
|
|
201
|
+
get end_time(): Date | null;
|
|
202
|
+
set end_time(value: Date | string | null);
|
|
203
|
+
get execution_duration(): number | null;
|
|
204
|
+
validateGuardrailFunction(value?: Guardrail | string | null): Guardrail | string | null;
|
|
205
|
+
validate_guardrail_function(value?: Guardrail | string | null): Guardrail | string | null;
|
|
206
|
+
processModelConfig(values: Record<string, unknown>): Record<string, unknown>;
|
|
207
|
+
process_model_config(values: Record<string, unknown>): Record<string, unknown>;
|
|
208
|
+
modelDump(options?: ModelDumpOptions): Record<string, unknown>;
|
|
209
|
+
model_dump(options?: ModelDumpOptions): Record<string, unknown>;
|
|
210
|
+
validateRequiredFields(): this;
|
|
211
|
+
validate_required_fields(): this;
|
|
212
|
+
ensureGuardrailIsCallable(): this;
|
|
213
|
+
ensure_guardrail_is_callable(): this;
|
|
214
|
+
ensureGuardrailsIsListOfCallables(): this;
|
|
215
|
+
ensure_guardrails_is_list_of_callables(): this;
|
|
216
|
+
outputFileValidation(value: string | null): string | null;
|
|
217
|
+
output_file_validation(value: string | null): string | null;
|
|
218
|
+
static denyUserSetId(value: string | null | undefined, context?: {
|
|
219
|
+
fromCheckpoint?: boolean;
|
|
220
|
+
from_checkpoint?: boolean;
|
|
221
|
+
} | null): string | null | undefined;
|
|
222
|
+
static _deny_user_set_id(value: string | null | undefined, context?: {
|
|
223
|
+
fromCheckpoint?: boolean;
|
|
224
|
+
from_checkpoint?: boolean;
|
|
225
|
+
} | null): string | null | undefined;
|
|
226
|
+
static normalizeInputFiles<T extends TaskInputFiles | null | undefined>(value: T): T;
|
|
227
|
+
static _normalize_input_files<T extends TaskInputFiles | null | undefined>(value: T): T;
|
|
228
|
+
setAttributesBasedOnConfig(): this;
|
|
229
|
+
set_attributes_based_on_config(): this;
|
|
230
|
+
checkTools(): this;
|
|
231
|
+
check_tools(): this;
|
|
232
|
+
checkOutput(): this;
|
|
233
|
+
check_output(): this;
|
|
234
|
+
handleMaxRetriesDeprecation(): this;
|
|
235
|
+
handle_max_retries_deprecation(): this;
|
|
236
|
+
executeSync(agent?: Agent | null, context?: string | null, tools?: readonly Tool[]): Promise<TaskOutput>;
|
|
237
|
+
execute_sync(agent?: Agent | null, context?: string | null, tools?: readonly Tool[]): Promise<TaskOutput>;
|
|
238
|
+
executeAsync(agent?: Agent | null, context?: string | null, tools?: readonly Tool[]): TaskExecutionFuture;
|
|
239
|
+
execute_async(agent?: Agent | null, context?: string | null, tools?: readonly Tool[]): TaskExecutionFuture;
|
|
240
|
+
executeCore(agent?: Agent | null, context?: string | null, tools?: readonly Tool[] | null): Promise<TaskOutput>;
|
|
241
|
+
_execute_core(agent?: Agent | null, context?: string | null, tools?: readonly Tool[] | null): Promise<TaskOutput>;
|
|
242
|
+
aexecuteCore(agent?: Agent | null, context?: string | null, tools?: readonly Tool[] | null): Promise<TaskOutput>;
|
|
243
|
+
_aexecute_core(agent?: Agent | null, context?: string | null, tools?: readonly Tool[] | null): Promise<TaskOutput>;
|
|
244
|
+
executeTaskAsync(agent: Agent | null, context: string | null, tools: readonly Tool[] | null, future: TaskAsyncFuture): void;
|
|
245
|
+
_execute_task_async(agent: Agent | null, context: string | null, tools: readonly Tool[] | null, future: TaskAsyncFuture): void;
|
|
246
|
+
aexecuteSync(agent?: Agent | null, context?: string | null, tools?: readonly Tool[]): Promise<TaskOutput>;
|
|
247
|
+
aexecute_sync(agent?: Agent | null, context?: string | null, tools?: readonly Tool[]): Promise<TaskOutput>;
|
|
248
|
+
postAgentExecution(agent: Agent): void;
|
|
249
|
+
_post_agent_execution(agent: Agent): void;
|
|
250
|
+
prompt(): string;
|
|
251
|
+
interpolateInputsAndAddConversationHistory(inputs: InputValues, options?: {
|
|
252
|
+
strictMissing?: boolean;
|
|
253
|
+
}): void;
|
|
254
|
+
interpolate_inputs_and_add_conversation_history(inputs: InputValues): void;
|
|
255
|
+
incrementToolsErrors(): void;
|
|
256
|
+
increment_tools_errors(): void;
|
|
257
|
+
incrementDelegations(agentName?: string | null): void;
|
|
258
|
+
increment_delegations(agentName?: string | null): void;
|
|
259
|
+
storeInputFiles(): void;
|
|
260
|
+
_store_input_files(): void;
|
|
261
|
+
exportOutput(result: unknown): Promise<ExportedTaskOutput>;
|
|
262
|
+
_export_output(result: unknown): ExportedTaskOutput | Promise<ExportedTaskOutput>;
|
|
263
|
+
aexportOutput(result: unknown): Promise<ExportedTaskOutput>;
|
|
264
|
+
_aexport_output(result: unknown): Promise<ExportedTaskOutput>;
|
|
265
|
+
static unpackModelOutput(modelOutput: unknown): ExportedTaskOutput;
|
|
266
|
+
static _unpack_model_output(modelOutput: unknown): ExportedTaskOutput;
|
|
267
|
+
getOutputFormat(): OutputFormat;
|
|
268
|
+
_get_output_format(): OutputFormat;
|
|
269
|
+
saveFile(result: unknown): void;
|
|
270
|
+
_save_file(result: unknown): void;
|
|
271
|
+
toString(): string;
|
|
272
|
+
__repr__(): string;
|
|
273
|
+
invokeGuardrailFunction(taskOutput: TaskOutput, agent: Agent, tools: readonly Tool[], guardrail: Guardrail | null, guardrailIndex?: number | null): Promise<TaskOutput>;
|
|
274
|
+
_invoke_guardrail_function(task_output: TaskOutput, agent: Agent, tools: readonly Tool[], guardrail: Guardrail | null, guardrail_index?: number | null): Promise<TaskOutput>;
|
|
275
|
+
ainvokeGuardrailFunction(taskOutput: TaskOutput, agent: Agent, tools: readonly Tool[], guardrail: Guardrail | null, guardrailIndex?: number | null): Promise<TaskOutput>;
|
|
276
|
+
_ainvoke_guardrail_function(task_output: TaskOutput, agent: Agent, tools: readonly Tool[], guardrail: Guardrail | null, guardrail_index?: number | null): Promise<TaskOutput>;
|
|
277
|
+
copy(agents?: readonly Agent[], taskMapping?: Record<string, Task>): Task;
|
|
278
|
+
setExecutionPlan(plan: string | null): void;
|
|
279
|
+
clearExecutionPlan(): void;
|
|
280
|
+
execute(inputs?: InputValues, fallbackAgent?: Agent | null, overrideTools?: readonly Tool[], forceFallbackAgent?: boolean, stepCallbacksOrOptions?: readonly AgentStepCallback[] | TaskExecutionOptions): Promise<TaskOutput>;
|
|
281
|
+
private buildPrompt;
|
|
282
|
+
private descriptionWithTriggerPayload;
|
|
283
|
+
private renderContext;
|
|
284
|
+
private createOutput;
|
|
285
|
+
private effectiveGuardrailEntries;
|
|
286
|
+
private resolveGuardrail;
|
|
287
|
+
private runGuardrail;
|
|
288
|
+
private normalizeGuardrailOutput;
|
|
289
|
+
private handleHumanInput;
|
|
290
|
+
private executeAgentTask;
|
|
291
|
+
private createTrackingStepCallback;
|
|
292
|
+
private saveOutputFile;
|
|
293
|
+
}
|
|
294
|
+
export type ConditionalTaskOptions = TaskOptions & {
|
|
295
|
+
condition?: ConditionalTaskCondition | null;
|
|
296
|
+
};
|
|
297
|
+
export declare class ConditionalTask extends Task {
|
|
298
|
+
readonly condition: ConditionalTaskCondition | null;
|
|
299
|
+
constructor(options: ConditionalTaskOptions);
|
|
300
|
+
shouldExecute(context: TaskOutput): Promise<boolean>;
|
|
301
|
+
should_execute(context: TaskOutput): Promise<boolean>;
|
|
302
|
+
getSkippedTaskOutput(): TaskOutput;
|
|
303
|
+
get_skipped_task_output(): TaskOutput;
|
|
304
|
+
}
|
|
305
|
+
export { interpolateOnly };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare const CREWAI_TELEMETRY_BASE_URL = "https://telemetry.crewai.com:4319";
|
|
2
|
+
export declare const CREWAI_TELEMETRY_SERVICE_NAME = "crewAI-telemetry";
|
|
3
|
+
export type SpanLike = {
|
|
4
|
+
setAttribute?: (name: string, value: unknown) => void;
|
|
5
|
+
set_attribute?: (name: string, value: unknown) => void;
|
|
6
|
+
setStatus?: (status: unknown) => void;
|
|
7
|
+
end?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type AddAttributeFn = (span: SpanLike, name: string, value: unknown) => void;
|
|
10
|
+
export declare class SafeOTLPSpanExporter {
|
|
11
|
+
readonly options: Record<string, unknown>;
|
|
12
|
+
constructor(options?: Record<string, unknown>);
|
|
13
|
+
export(spans: unknown): string;
|
|
14
|
+
shutdown(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare class RecordedSpan implements SpanLike {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly attributes: Record<string, unknown>;
|
|
19
|
+
status: unknown;
|
|
20
|
+
ended: boolean;
|
|
21
|
+
constructor(name: string);
|
|
22
|
+
setAttribute(name: string, value: unknown): void;
|
|
23
|
+
set_attribute(name: string, value: unknown): void;
|
|
24
|
+
setStatus(status: unknown): void;
|
|
25
|
+
end(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class Telemetry {
|
|
28
|
+
static instance: Telemetry | null;
|
|
29
|
+
static _instance: Telemetry | null;
|
|
30
|
+
ready: boolean;
|
|
31
|
+
traceSet: boolean;
|
|
32
|
+
trace_set: boolean;
|
|
33
|
+
readonly spans: RecordedSpan[];
|
|
34
|
+
constructor();
|
|
35
|
+
static getInstance(): Telemetry;
|
|
36
|
+
static get_instance(): Telemetry;
|
|
37
|
+
setTracer(): void;
|
|
38
|
+
set_tracer(): void;
|
|
39
|
+
flush(): Promise<void>;
|
|
40
|
+
_is_telemetry_disabled(): boolean;
|
|
41
|
+
_should_execute_telemetry(): boolean;
|
|
42
|
+
_safe_telemetry_operation<T>(operation: () => T): T | null;
|
|
43
|
+
_register_shutdown_handlers(): void;
|
|
44
|
+
_register_signal_handler(_signalName: unknown, _eventClass: unknown, _shutdown?: boolean): void;
|
|
45
|
+
_shutdown(): void;
|
|
46
|
+
_add_attribute(span: SpanLike | null | undefined, key: string, value: unknown): void;
|
|
47
|
+
getSpans(): RecordedSpan[];
|
|
48
|
+
get_spans(): RecordedSpan[];
|
|
49
|
+
clearSpans(): void;
|
|
50
|
+
clear_spans(): void;
|
|
51
|
+
crew_creation(crew: unknown, inputs?: Record<string, unknown> | null): void;
|
|
52
|
+
task_started(crew: unknown, task: unknown): RecordedSpan | null;
|
|
53
|
+
taskStarted(crew: unknown, task: unknown): RecordedSpan | null;
|
|
54
|
+
task_ended(span: SpanLike | null, task: unknown, crew: unknown): void;
|
|
55
|
+
taskEnded(span: SpanLike | null, task: unknown, crew: unknown): void;
|
|
56
|
+
tool_repeated_usage(llm: unknown, tool_name: string, attempts: number): void;
|
|
57
|
+
toolRepeatedUsage(llm: unknown, toolName: string, attempts: number): void;
|
|
58
|
+
tool_usage(llm: unknown, tool_name: string, attempts: number, agent?: unknown): void;
|
|
59
|
+
toolUsage(llm: unknown, toolName: string, attempts: number, agent?: unknown): void;
|
|
60
|
+
tool_usage_error(llm: unknown, agent?: unknown, tool_name?: string | null): void;
|
|
61
|
+
toolUsageError(llm: unknown, agent?: unknown, toolName?: string | null): void;
|
|
62
|
+
individual_test_result_span(crew: unknown, quality: number, exec_time: number, model_name: string): void;
|
|
63
|
+
test_execution_span(crew: unknown, iterations: number, inputs: Record<string, unknown> | null, model_name: string): void;
|
|
64
|
+
deploy_signup_error_span(): void;
|
|
65
|
+
start_deployment_span(uuid?: string | null): void;
|
|
66
|
+
create_crew_deployment_span(): void;
|
|
67
|
+
get_crew_logs_span(uuid: string | null, log_type?: string): void;
|
|
68
|
+
remove_crew_span(uuid?: string | null): void;
|
|
69
|
+
crew_execution_span(crew: unknown, inputs?: Record<string, unknown> | null): RecordedSpan | null;
|
|
70
|
+
end_crew(crew: unknown, final_string_output: string): void;
|
|
71
|
+
flow_creation_span(flow_name: string): void;
|
|
72
|
+
flow_plotting_span(flow_name: string, node_names: readonly string[]): void;
|
|
73
|
+
flow_execution_span(flow_name: string, node_names: readonly string[]): void;
|
|
74
|
+
env_context_span(tool: string): void;
|
|
75
|
+
human_feedback_span(event_type: string, has_routing: boolean, num_outcomes?: number, feedback_provided?: boolean | null, outcome?: string | null): void;
|
|
76
|
+
feature_usage_span(feature: string): void;
|
|
77
|
+
template_installed_span(template_name: string): void;
|
|
78
|
+
private startSpan;
|
|
79
|
+
private closedSpan;
|
|
80
|
+
private addTaskFingerprintDetails;
|
|
81
|
+
}
|
|
82
|
+
export declare function addAgentFingerprintToSpan(span: SpanLike, agent: unknown, addAttributeFn?: AddAttributeFn): void;
|
|
83
|
+
export declare const add_agent_fingerprint_to_span: typeof addAgentFingerprintToSpan;
|
|
84
|
+
export declare function addCrewAttributes(span: SpanLike, crew: unknown, addAttributeFn?: AddAttributeFn, includeFingerprint?: boolean): void;
|
|
85
|
+
export declare const add_crew_attributes: typeof addCrewAttributes;
|
|
86
|
+
export declare function addTaskAttributes(span: SpanLike, task: unknown, addAttributeFn?: AddAttributeFn, includeFingerprint?: boolean): void;
|
|
87
|
+
export declare const add_task_attributes: typeof addTaskAttributes;
|
|
88
|
+
export declare function addCrewAndTaskAttributes(span: SpanLike, crew: unknown, task: unknown, addAttributeFn?: AddAttributeFn, includeFingerprints?: boolean): void;
|
|
89
|
+
export declare const add_crew_and_task_attributes: typeof addCrewAndTaskAttributes;
|
|
90
|
+
export declare function closeSpan(span: SpanLike): void;
|
|
91
|
+
export declare const close_span: typeof closeSpan;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type TokenProcessLike = {
|
|
2
|
+
sum_successful_requests?: (requests: number) => void;
|
|
3
|
+
sumSuccessfulRequests?: (requests: number) => void;
|
|
4
|
+
sum_prompt_tokens?: (tokens: number) => void;
|
|
5
|
+
sumPromptTokens?: (tokens: number) => void;
|
|
6
|
+
sum_completion_tokens?: (tokens: number) => void;
|
|
7
|
+
sumCompletionTokens?: (tokens: number) => void;
|
|
8
|
+
sum_cached_prompt_tokens?: (tokens: number) => void;
|
|
9
|
+
sumCachedPromptTokens?: (tokens: number) => void;
|
|
10
|
+
};
|
|
11
|
+
export type TokenUsageLike = {
|
|
12
|
+
prompt_tokens?: number;
|
|
13
|
+
promptTokens?: number;
|
|
14
|
+
completion_tokens?: number;
|
|
15
|
+
completionTokens?: number;
|
|
16
|
+
prompt_tokens_details?: {
|
|
17
|
+
cached_tokens?: number;
|
|
18
|
+
cachedTokens?: number;
|
|
19
|
+
} | null;
|
|
20
|
+
promptTokensDetails?: {
|
|
21
|
+
cached_tokens?: number;
|
|
22
|
+
cachedTokens?: number;
|
|
23
|
+
} | null;
|
|
24
|
+
};
|
|
25
|
+
export type TokenCalcHandlerOptions = {
|
|
26
|
+
tokenCostProcess?: TokenProcessLike | null;
|
|
27
|
+
token_cost_process?: TokenProcessLike | null;
|
|
28
|
+
};
|
|
29
|
+
export declare class TokenCalcHandler {
|
|
30
|
+
tokenCostProcess: TokenProcessLike | null;
|
|
31
|
+
token_cost_process: TokenProcessLike | null;
|
|
32
|
+
constructor(tokenCostProcess?: TokenProcessLike | TokenCalcHandlerOptions | null);
|
|
33
|
+
logSuccessEvent(_kwargs: Record<string, unknown>, responseObj: Record<string, unknown>, _startTime: number, _endTime: number): void;
|
|
34
|
+
log_success_event(kwargs: Record<string, unknown>, responseObj: Record<string, unknown>, startTime: number, endTime: number): void;
|
|
35
|
+
private recordUsage;
|
|
36
|
+
}
|