@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/flow.d.ts
ADDED
|
@@ -0,0 +1,927 @@
|
|
|
1
|
+
import { Crew, type KickoffOptions } from "./crew.js";
|
|
2
|
+
import { type FlowPersistence } from "./flow-persistence.js";
|
|
3
|
+
import { type InputFiles } from "./input-files.js";
|
|
4
|
+
import { ConsoleInputProvider } from "./input-provider.js";
|
|
5
|
+
import { type LLM } from "./llm.js";
|
|
6
|
+
import type { CrewOutput } from "./outputs.js";
|
|
7
|
+
import { CheckpointConfig, type CheckpointOption } from "./state.js";
|
|
8
|
+
import type { InputValues, MaybePromise } from "./types.js";
|
|
9
|
+
import { Memory, MemoryScope, MemorySlice, type MemoryMatch, type MemoryRecord } from "./memory.js";
|
|
10
|
+
import { FlowDefinition } from "./flow-definition.js";
|
|
11
|
+
import { type ConversationEventVisibility, RouterConfig } from "./experimental-conversational.js";
|
|
12
|
+
import type { LLMMessage } from "./types.js";
|
|
13
|
+
export declare const AND_CONDITION = "AND";
|
|
14
|
+
export declare const OR_CONDITION = "OR";
|
|
15
|
+
export type InputProvider = import("./input-provider.js").InputProvider;
|
|
16
|
+
export type InputResponse = import("./input-provider.js").InputResponse;
|
|
17
|
+
export type FlowCondition = {
|
|
18
|
+
type: "OR" | "AND";
|
|
19
|
+
conditions: readonly FlowConditionInput[];
|
|
20
|
+
};
|
|
21
|
+
export declare const FlowCondition: Readonly<{
|
|
22
|
+
kind: "FlowCondition";
|
|
23
|
+
}>;
|
|
24
|
+
export declare const FlowConditionType: Readonly<{
|
|
25
|
+
OR: "OR";
|
|
26
|
+
AND: "AND";
|
|
27
|
+
}>;
|
|
28
|
+
export declare const SimpleFlowCondition: Readonly<{
|
|
29
|
+
kind: "SimpleFlowCondition";
|
|
30
|
+
}>;
|
|
31
|
+
export declare const FlowConditions: Readonly<{
|
|
32
|
+
kind: "FlowConditions";
|
|
33
|
+
}>;
|
|
34
|
+
export declare const P: Readonly<{
|
|
35
|
+
kind: "ParamSpec";
|
|
36
|
+
}>;
|
|
37
|
+
export declare const R: Readonly<{
|
|
38
|
+
kind: "TypeVar";
|
|
39
|
+
}>;
|
|
40
|
+
export declare const F: Readonly<{
|
|
41
|
+
kind: "TypeVar";
|
|
42
|
+
}>;
|
|
43
|
+
export declare const T: Readonly<{
|
|
44
|
+
kind: "TypeVar";
|
|
45
|
+
}>;
|
|
46
|
+
export declare const FlowState: Readonly<{
|
|
47
|
+
kind: "FlowState";
|
|
48
|
+
}>;
|
|
49
|
+
export declare const FlowMethodName: StringConstructor;
|
|
50
|
+
export declare const FlowRouteName: StringConstructor;
|
|
51
|
+
export declare const PendingListenerKey: StringConstructor;
|
|
52
|
+
export declare const FlowMethodCallable: FunctionConstructor;
|
|
53
|
+
export declare const FlowMethodData: Readonly<{
|
|
54
|
+
kind: "FlowMethodData";
|
|
55
|
+
}>;
|
|
56
|
+
export declare const CompletedMethodData: Readonly<{
|
|
57
|
+
kind: "CompletedMethodData";
|
|
58
|
+
}>;
|
|
59
|
+
export declare const ExecutionMethodData: Readonly<{
|
|
60
|
+
kind: "ExecutionMethodData";
|
|
61
|
+
}>;
|
|
62
|
+
export declare const FlowData: Readonly<{
|
|
63
|
+
kind: "FlowData";
|
|
64
|
+
}>;
|
|
65
|
+
export declare const InputHistoryEntry: Readonly<{
|
|
66
|
+
kind: "InputHistoryEntry";
|
|
67
|
+
}>;
|
|
68
|
+
export declare const FlowExecutionData: Readonly<{
|
|
69
|
+
kind: "FlowExecutionData";
|
|
70
|
+
}>;
|
|
71
|
+
export declare const FlowStructure: Readonly<{
|
|
72
|
+
kind: "FlowStructure";
|
|
73
|
+
}>;
|
|
74
|
+
export declare const InputProvider: Readonly<{
|
|
75
|
+
kind: "InputProvider";
|
|
76
|
+
}>;
|
|
77
|
+
export declare const InputResponse: Readonly<{
|
|
78
|
+
kind: "InputResponse";
|
|
79
|
+
}>;
|
|
80
|
+
export declare const HumanFeedbackProvider: Readonly<{
|
|
81
|
+
kind: "HumanFeedbackProvider";
|
|
82
|
+
}>;
|
|
83
|
+
export declare const HumanFeedbackResult: Readonly<{
|
|
84
|
+
kind: "HumanFeedbackResult";
|
|
85
|
+
}>;
|
|
86
|
+
export declare const HumanFeedbackConfig: Readonly<{
|
|
87
|
+
kind: "HumanFeedbackConfig";
|
|
88
|
+
}>;
|
|
89
|
+
export declare const HumanFeedbackMethod: Readonly<{
|
|
90
|
+
kind: "HumanFeedbackMethod";
|
|
91
|
+
}>;
|
|
92
|
+
export declare const PreReviewResult: Readonly<{
|
|
93
|
+
kind: "PreReviewResult";
|
|
94
|
+
}>;
|
|
95
|
+
export declare const DistilledLessons: Readonly<{
|
|
96
|
+
kind: "DistilledLessons";
|
|
97
|
+
}>;
|
|
98
|
+
export declare const FlowMeta: Readonly<{
|
|
99
|
+
kind: "FlowMeta";
|
|
100
|
+
}>;
|
|
101
|
+
export declare const MethodInfo: Readonly<{
|
|
102
|
+
kind: "MethodInfo";
|
|
103
|
+
}>;
|
|
104
|
+
export declare const EdgeInfo: Readonly<{
|
|
105
|
+
kind: "EdgeInfo";
|
|
106
|
+
}>;
|
|
107
|
+
export declare const StateFieldInfo: Readonly<{
|
|
108
|
+
kind: "StateFieldInfo";
|
|
109
|
+
}>;
|
|
110
|
+
export declare const StateSchemaInfo: Readonly<{
|
|
111
|
+
kind: "StateSchemaInfo";
|
|
112
|
+
}>;
|
|
113
|
+
export declare const FlowStructureInfo: Readonly<{
|
|
114
|
+
kind: "FlowStructureInfo";
|
|
115
|
+
}>;
|
|
116
|
+
export declare const flow_config: import("./input-provider.js").FlowConfig;
|
|
117
|
+
export declare const _INITIAL_STATE_CLASS_MARKER = "__crewai_pydantic_class_schema__";
|
|
118
|
+
export type ConsoleProviderOptions = {
|
|
119
|
+
verbose?: boolean;
|
|
120
|
+
input?: (prompt: string) => MaybePromise<string | null>;
|
|
121
|
+
};
|
|
122
|
+
export declare class ConsoleProvider extends ConsoleInputProvider implements HumanFeedbackProvider {
|
|
123
|
+
readonly verbose: boolean;
|
|
124
|
+
private readonly inputFn;
|
|
125
|
+
constructor(options?: boolean | ConsoleProviderOptions);
|
|
126
|
+
requestInput(message: string, flow?: Flow<object>, metadata?: Record<string, unknown> | null): Promise<string>;
|
|
127
|
+
request_input(message: string, flow: Flow<object>, metadata?: Record<string, unknown> | null): Promise<string>;
|
|
128
|
+
requestFeedback(context: PendingFeedbackContext, flow: Flow<object>): Promise<string>;
|
|
129
|
+
request_feedback(context: PendingFeedbackContext, flow: Flow<object>): Promise<string>;
|
|
130
|
+
}
|
|
131
|
+
export declare function _resolve_persistence(value: unknown): unknown;
|
|
132
|
+
export declare function _serialize_persistence(value: unknown): Record<string, unknown> | null;
|
|
133
|
+
export declare function _validate_input_provider(value: unknown): Promise<unknown>;
|
|
134
|
+
export declare function _serialize_input_provider(value: unknown): string | null;
|
|
135
|
+
export declare function _serialize_initial_state(value: unknown): unknown;
|
|
136
|
+
export declare function _deserialize_initial_state(value: unknown): unknown;
|
|
137
|
+
export type FlowConditionInput = string | FlowCondition | ((...args: never[]) => unknown);
|
|
138
|
+
export type FlowTrigger = FlowConditionInput;
|
|
139
|
+
export declare const FlowTrigger: Readonly<{
|
|
140
|
+
kind: "FlowTrigger";
|
|
141
|
+
}>;
|
|
142
|
+
export type FlowMethodKind = "start" | "listen" | "router";
|
|
143
|
+
export type FlowMethodEntry = {
|
|
144
|
+
name: string | symbol;
|
|
145
|
+
kind: FlowMethodKind;
|
|
146
|
+
condition: FlowCondition | null;
|
|
147
|
+
emit?: readonly string[] | null;
|
|
148
|
+
};
|
|
149
|
+
export type FlowOptions<TState extends object = Record<string, unknown>> = {
|
|
150
|
+
initialState?: TState | (() => TState);
|
|
151
|
+
name?: string | null;
|
|
152
|
+
maxMethodCalls?: number;
|
|
153
|
+
inputProvider?: InputProvider | null;
|
|
154
|
+
persistence?: FlowPersistence | null;
|
|
155
|
+
stream?: boolean;
|
|
156
|
+
checkpoint?: CheckpointOption;
|
|
157
|
+
memory?: Memory | MemoryScope | MemorySlice | null;
|
|
158
|
+
};
|
|
159
|
+
export declare class LockedDictProxy<TValue extends Record<string, unknown> = Record<string, unknown>> {
|
|
160
|
+
readonly value: TValue;
|
|
161
|
+
constructor(value?: TValue);
|
|
162
|
+
get(key: string, defaultValue?: unknown): unknown;
|
|
163
|
+
__getitem__(key: string): unknown;
|
|
164
|
+
set(key: string, value: unknown): this;
|
|
165
|
+
__setitem__(key: string, value: unknown): void;
|
|
166
|
+
delete(key: string): boolean;
|
|
167
|
+
__delitem__(key: string): void;
|
|
168
|
+
has(key: string): boolean;
|
|
169
|
+
__contains__(key: string): boolean;
|
|
170
|
+
update(values: Record<string, unknown>): this;
|
|
171
|
+
clear(): void;
|
|
172
|
+
keys(): IterableIterator<string>;
|
|
173
|
+
values(): IterableIterator<unknown>;
|
|
174
|
+
entries(): IterableIterator<[string, unknown]>;
|
|
175
|
+
items(): IterableIterator<[string, unknown]>;
|
|
176
|
+
pop(key: string, defaultValue?: unknown): unknown;
|
|
177
|
+
setdefault(key: string, defaultValue: unknown): unknown;
|
|
178
|
+
copy(): TValue;
|
|
179
|
+
[Symbol.iterator](): IterableIterator<[string, unknown]>;
|
|
180
|
+
__iter__(): IterableIterator<string>;
|
|
181
|
+
__len__(): number;
|
|
182
|
+
__repr__(): string;
|
|
183
|
+
toString(): string;
|
|
184
|
+
__bool__(): boolean;
|
|
185
|
+
__or__(other: Record<string, unknown>): Record<string, unknown>;
|
|
186
|
+
__ror__(other: Record<string, unknown>): Record<string, unknown>;
|
|
187
|
+
__ior__(other: Record<string, unknown>): this;
|
|
188
|
+
__reversed__(): IterableIterator<string>;
|
|
189
|
+
__eq__(other: unknown): boolean;
|
|
190
|
+
__ne__(other: unknown): boolean;
|
|
191
|
+
toJSON(): TValue;
|
|
192
|
+
}
|
|
193
|
+
export declare class LockedListProxy<TValue = unknown> {
|
|
194
|
+
[index: number]: TValue;
|
|
195
|
+
readonly value: TValue[];
|
|
196
|
+
constructor(value?: readonly TValue[]);
|
|
197
|
+
get length(): number;
|
|
198
|
+
at(index: number): TValue | undefined;
|
|
199
|
+
__getitem__(index: number): TValue | undefined;
|
|
200
|
+
__setitem__(index: number, item: TValue): void;
|
|
201
|
+
__delitem__(index: number): void;
|
|
202
|
+
push(...items: TValue[]): number;
|
|
203
|
+
append(item: TValue): void;
|
|
204
|
+
pop(index?: number): TValue | undefined;
|
|
205
|
+
extend(items: Iterable<TValue>): void;
|
|
206
|
+
insert(index: number, item: TValue): void;
|
|
207
|
+
remove(item: TValue): void;
|
|
208
|
+
splice(start: number, deleteCount?: number, ...items: TValue[]): TValue[];
|
|
209
|
+
includes(item: TValue): boolean;
|
|
210
|
+
__contains__(item: TValue): boolean;
|
|
211
|
+
indexOf(item: TValue): number;
|
|
212
|
+
index(item: TValue, start?: number, stop?: number): number;
|
|
213
|
+
count(item: TValue): number;
|
|
214
|
+
sort(options?: {
|
|
215
|
+
key?: ((value: TValue) => unknown) | null;
|
|
216
|
+
reverse?: boolean;
|
|
217
|
+
}): void;
|
|
218
|
+
reverse(): void;
|
|
219
|
+
copy(): TValue[];
|
|
220
|
+
clear(): void;
|
|
221
|
+
[Symbol.iterator](): IterableIterator<TValue>;
|
|
222
|
+
__iter__(): IterableIterator<TValue>;
|
|
223
|
+
__len__(): number;
|
|
224
|
+
__repr__(): string;
|
|
225
|
+
toString(): string;
|
|
226
|
+
__bool__(): boolean;
|
|
227
|
+
__add__(other: readonly TValue[]): TValue[];
|
|
228
|
+
__radd__(other: readonly TValue[]): TValue[];
|
|
229
|
+
__iadd__(other: Iterable<TValue>): this;
|
|
230
|
+
__mul__(count: number): TValue[];
|
|
231
|
+
__rmul__(count: number): TValue[];
|
|
232
|
+
__imul__(count: number): this;
|
|
233
|
+
__reversed__(): IterableIterator<TValue>;
|
|
234
|
+
__eq__(other: unknown): boolean;
|
|
235
|
+
__ne__(other: unknown): boolean;
|
|
236
|
+
toJSON(): TValue[];
|
|
237
|
+
}
|
|
238
|
+
export declare class StateProxy<TState extends object = Record<string, unknown>> {
|
|
239
|
+
readonly state: TState;
|
|
240
|
+
constructor(state: TState);
|
|
241
|
+
get(key: keyof TState): TState[keyof TState];
|
|
242
|
+
__getitem__(key: keyof TState): TState[keyof TState];
|
|
243
|
+
set<K extends keyof TState>(key: K, value: TState[K]): this;
|
|
244
|
+
__setitem__<K extends keyof TState>(key: K, value: TState[K]): void;
|
|
245
|
+
delete(key: keyof TState): boolean;
|
|
246
|
+
__delitem__(key: keyof TState): void;
|
|
247
|
+
has(key: keyof TState): boolean;
|
|
248
|
+
__contains__(key: keyof TState): boolean;
|
|
249
|
+
list<TItem = unknown>(key: keyof TState): LockedListProxy<TItem>;
|
|
250
|
+
dict<TRecord extends Record<string, unknown> = Record<string, unknown>>(key: keyof TState): LockedDictProxy<TRecord>;
|
|
251
|
+
toJSON(): TState;
|
|
252
|
+
modelDump(): TState;
|
|
253
|
+
model_dump(): TState;
|
|
254
|
+
_unwrap(): TState;
|
|
255
|
+
__repr__(): string;
|
|
256
|
+
toString(): string;
|
|
257
|
+
}
|
|
258
|
+
export type FlowAskOptions = {
|
|
259
|
+
/** Timeout in seconds. */
|
|
260
|
+
timeout?: number | null;
|
|
261
|
+
metadata?: Record<string, unknown> | null;
|
|
262
|
+
};
|
|
263
|
+
export type FlowInputHistoryEntry = {
|
|
264
|
+
message: string;
|
|
265
|
+
response: string | null;
|
|
266
|
+
methodName: string | null;
|
|
267
|
+
method_name?: string | null;
|
|
268
|
+
timestamp: Date;
|
|
269
|
+
metadata: Record<string, unknown> | null;
|
|
270
|
+
responseMetadata: Record<string, unknown> | null;
|
|
271
|
+
response_metadata?: Record<string, unknown> | null;
|
|
272
|
+
};
|
|
273
|
+
export type HumanFeedbackContext = {
|
|
274
|
+
flowName: string;
|
|
275
|
+
flow_name?: string;
|
|
276
|
+
methodName: string;
|
|
277
|
+
method_name?: string;
|
|
278
|
+
output: unknown;
|
|
279
|
+
methodOutput?: unknown;
|
|
280
|
+
method_output?: unknown;
|
|
281
|
+
message: string;
|
|
282
|
+
emit: readonly string[] | null;
|
|
283
|
+
defaultOutcome: string | null;
|
|
284
|
+
default_outcome?: string | null;
|
|
285
|
+
metadata: Record<string, unknown>;
|
|
286
|
+
llm?: string | Record<string, unknown> | null;
|
|
287
|
+
};
|
|
288
|
+
export type PendingFeedbackContext = HumanFeedbackContext & {
|
|
289
|
+
flowId: string | null;
|
|
290
|
+
flow_id?: string | null;
|
|
291
|
+
flowClass: string;
|
|
292
|
+
flow_class?: string;
|
|
293
|
+
requestedAt: Date;
|
|
294
|
+
requested_at?: Date;
|
|
295
|
+
};
|
|
296
|
+
export type PendingFeedbackContextOptions = Partial<HumanFeedbackContext> & {
|
|
297
|
+
flowId?: string | null;
|
|
298
|
+
flow_id?: string | null;
|
|
299
|
+
flowClass?: string;
|
|
300
|
+
flow_class?: string;
|
|
301
|
+
requestedAt?: Date | string | null;
|
|
302
|
+
requested_at?: Date | string | null;
|
|
303
|
+
};
|
|
304
|
+
export declare const PendingFeedbackContext: {
|
|
305
|
+
new (options: PendingFeedbackContextOptions): {
|
|
306
|
+
readonly flowName: string;
|
|
307
|
+
readonly flow_name: string;
|
|
308
|
+
readonly flowId: string | null;
|
|
309
|
+
readonly flow_id: string | null;
|
|
310
|
+
readonly flowClass: string;
|
|
311
|
+
readonly flow_class: string;
|
|
312
|
+
readonly methodName: string;
|
|
313
|
+
readonly method_name: string;
|
|
314
|
+
readonly output: unknown;
|
|
315
|
+
readonly methodOutput: unknown;
|
|
316
|
+
readonly method_output: unknown;
|
|
317
|
+
readonly message: string;
|
|
318
|
+
readonly emit: readonly string[] | null;
|
|
319
|
+
readonly defaultOutcome: string | null;
|
|
320
|
+
readonly default_outcome: string | null;
|
|
321
|
+
readonly metadata: Record<string, unknown>;
|
|
322
|
+
readonly llm: string | Record<string, unknown> | null;
|
|
323
|
+
readonly requestedAt: Date;
|
|
324
|
+
readonly requested_at: Date;
|
|
325
|
+
to_dict(): Record<string, unknown>;
|
|
326
|
+
toDict(): Record<string, unknown>;
|
|
327
|
+
toJSON(): Record<string, unknown>;
|
|
328
|
+
};
|
|
329
|
+
from_dict(data: Record<string, unknown>): {
|
|
330
|
+
readonly flowName: string;
|
|
331
|
+
readonly flow_name: string;
|
|
332
|
+
readonly flowId: string | null;
|
|
333
|
+
readonly flow_id: string | null;
|
|
334
|
+
readonly flowClass: string;
|
|
335
|
+
readonly flow_class: string;
|
|
336
|
+
readonly methodName: string;
|
|
337
|
+
readonly method_name: string;
|
|
338
|
+
readonly output: unknown;
|
|
339
|
+
readonly methodOutput: unknown;
|
|
340
|
+
readonly method_output: unknown;
|
|
341
|
+
readonly message: string;
|
|
342
|
+
readonly emit: readonly string[] | null;
|
|
343
|
+
readonly defaultOutcome: string | null;
|
|
344
|
+
readonly default_outcome: string | null;
|
|
345
|
+
readonly metadata: Record<string, unknown>;
|
|
346
|
+
readonly llm: string | Record<string, unknown> | null;
|
|
347
|
+
readonly requestedAt: Date;
|
|
348
|
+
readonly requested_at: Date;
|
|
349
|
+
to_dict(): Record<string, unknown>;
|
|
350
|
+
toDict(): Record<string, unknown>;
|
|
351
|
+
toJSON(): Record<string, unknown>;
|
|
352
|
+
};
|
|
353
|
+
fromDict(data: Record<string, unknown>): {
|
|
354
|
+
readonly flowName: string;
|
|
355
|
+
readonly flow_name: string;
|
|
356
|
+
readonly flowId: string | null;
|
|
357
|
+
readonly flow_id: string | null;
|
|
358
|
+
readonly flowClass: string;
|
|
359
|
+
readonly flow_class: string;
|
|
360
|
+
readonly methodName: string;
|
|
361
|
+
readonly method_name: string;
|
|
362
|
+
readonly output: unknown;
|
|
363
|
+
readonly methodOutput: unknown;
|
|
364
|
+
readonly method_output: unknown;
|
|
365
|
+
readonly message: string;
|
|
366
|
+
readonly emit: readonly string[] | null;
|
|
367
|
+
readonly defaultOutcome: string | null;
|
|
368
|
+
readonly default_outcome: string | null;
|
|
369
|
+
readonly metadata: Record<string, unknown>;
|
|
370
|
+
readonly llm: string | Record<string, unknown> | null;
|
|
371
|
+
readonly requestedAt: Date;
|
|
372
|
+
readonly requested_at: Date;
|
|
373
|
+
to_dict(): Record<string, unknown>;
|
|
374
|
+
toDict(): Record<string, unknown>;
|
|
375
|
+
toJSON(): Record<string, unknown>;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
export type HumanFeedbackProvider = {
|
|
379
|
+
requestFeedback?: (context: PendingFeedbackContext, flow: Flow<object>) => MaybePromise<string | null>;
|
|
380
|
+
request_feedback?: (context: PendingFeedbackContext, flow: Flow<object>) => MaybePromise<string | null>;
|
|
381
|
+
};
|
|
382
|
+
export type HumanFeedbackResult = {
|
|
383
|
+
output: unknown;
|
|
384
|
+
feedback: string;
|
|
385
|
+
outcome: string | null;
|
|
386
|
+
timestamp: Date;
|
|
387
|
+
methodName: string;
|
|
388
|
+
metadata: Record<string, unknown>;
|
|
389
|
+
};
|
|
390
|
+
declare const HUMAN_FEEDBACK_ROUTING_RESULT: unique symbol;
|
|
391
|
+
type HumanFeedbackRoutingResult = {
|
|
392
|
+
readonly [HUMAN_FEEDBACK_ROUTING_RESULT]: true;
|
|
393
|
+
readonly methodOutput: unknown;
|
|
394
|
+
readonly routerOutput: string;
|
|
395
|
+
};
|
|
396
|
+
export type HumanFeedbackConfig = {
|
|
397
|
+
message: string;
|
|
398
|
+
emit?: readonly string[] | null;
|
|
399
|
+
llm?: string | Record<string, unknown> | LLM | null;
|
|
400
|
+
defaultOutcome?: string | null;
|
|
401
|
+
default_outcome?: string | null;
|
|
402
|
+
metadata?: Record<string, unknown> | null;
|
|
403
|
+
provider?: HumanFeedbackProvider | null;
|
|
404
|
+
learn?: boolean;
|
|
405
|
+
learnSource?: string;
|
|
406
|
+
learn_source?: string;
|
|
407
|
+
learnStrict?: boolean;
|
|
408
|
+
learn_strict?: boolean;
|
|
409
|
+
};
|
|
410
|
+
export declare class HumanFeedbackPending extends Error {
|
|
411
|
+
readonly context: PendingFeedbackContext;
|
|
412
|
+
readonly callbackInfo: Record<string, unknown>;
|
|
413
|
+
constructor(options: {
|
|
414
|
+
context: PendingFeedbackContext;
|
|
415
|
+
callbackInfo?: Record<string, unknown> | null;
|
|
416
|
+
message?: string | null;
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
export type FlowKickoffOptions = {
|
|
420
|
+
inputs?: InputValues;
|
|
421
|
+
inputFiles?: InputFiles;
|
|
422
|
+
input_files?: InputFiles;
|
|
423
|
+
fromCheckpoint?: CheckpointConfig | null;
|
|
424
|
+
from_checkpoint?: CheckpointConfig | null;
|
|
425
|
+
restoreFromStateId?: string | null;
|
|
426
|
+
restore_from_state_id?: string | null;
|
|
427
|
+
userMessage?: string | Record<string, unknown> | null;
|
|
428
|
+
user_message?: string | Record<string, unknown> | null;
|
|
429
|
+
sessionId?: string | null;
|
|
430
|
+
session_id?: string | null;
|
|
431
|
+
intents?: readonly string[] | null;
|
|
432
|
+
intentLlm?: string | LLM | null;
|
|
433
|
+
intent_llm?: string | LLM | null;
|
|
434
|
+
};
|
|
435
|
+
export type FlowExecutionTraceEntry = {
|
|
436
|
+
methodName: string;
|
|
437
|
+
kind: FlowMethodKind;
|
|
438
|
+
input: unknown;
|
|
439
|
+
output: unknown;
|
|
440
|
+
routerPath: string | null;
|
|
441
|
+
};
|
|
442
|
+
export type FlowExecutionMethodData = {
|
|
443
|
+
flowMethod: {
|
|
444
|
+
name: string;
|
|
445
|
+
type: FlowMethodKind;
|
|
446
|
+
};
|
|
447
|
+
input: unknown;
|
|
448
|
+
output: unknown;
|
|
449
|
+
routerPath: string | null;
|
|
450
|
+
finalState: Record<string, unknown> | null;
|
|
451
|
+
order: number;
|
|
452
|
+
};
|
|
453
|
+
export type FlowCompletedMethodData = {
|
|
454
|
+
flowMethod: {
|
|
455
|
+
name: string;
|
|
456
|
+
type: FlowMethodKind;
|
|
457
|
+
};
|
|
458
|
+
output: unknown;
|
|
459
|
+
};
|
|
460
|
+
export type FlowExecutionData = {
|
|
461
|
+
id: string | null;
|
|
462
|
+
flow: FlowStructure;
|
|
463
|
+
inputs: InputValues;
|
|
464
|
+
completedMethods: readonly FlowCompletedMethodData[];
|
|
465
|
+
executionMethods: readonly FlowExecutionMethodData[];
|
|
466
|
+
finalState: Record<string, unknown>;
|
|
467
|
+
};
|
|
468
|
+
export type FlowStructureMethod = {
|
|
469
|
+
name: string;
|
|
470
|
+
type: FlowMethodKind | "start_router";
|
|
471
|
+
triggerMethods: readonly string[];
|
|
472
|
+
conditionType: FlowCondition["type"] | null;
|
|
473
|
+
routerPaths: readonly string[];
|
|
474
|
+
hasHumanFeedback: boolean;
|
|
475
|
+
};
|
|
476
|
+
export type FlowStructureEdge = {
|
|
477
|
+
from: string;
|
|
478
|
+
to: string;
|
|
479
|
+
type: "listen" | "route";
|
|
480
|
+
conditionType: FlowCondition["type"] | null;
|
|
481
|
+
condition: string | null;
|
|
482
|
+
};
|
|
483
|
+
export type FlowStructure = {
|
|
484
|
+
name: string;
|
|
485
|
+
methods: readonly FlowStructureMethod[];
|
|
486
|
+
edges: readonly FlowStructureEdge[];
|
|
487
|
+
startMethods: readonly string[];
|
|
488
|
+
routerMethods: readonly string[];
|
|
489
|
+
};
|
|
490
|
+
export type OpenAPISchema = Record<string, unknown>;
|
|
491
|
+
export type FlowMethodSignature = {
|
|
492
|
+
operationId: string;
|
|
493
|
+
parameters: Record<string, OpenAPISchema>;
|
|
494
|
+
returns: OpenAPISchema;
|
|
495
|
+
summary?: string;
|
|
496
|
+
description?: string;
|
|
497
|
+
};
|
|
498
|
+
export type FlowNodeMetadata = {
|
|
499
|
+
type: FlowMethodKind | "start_router";
|
|
500
|
+
is_router?: boolean;
|
|
501
|
+
router_paths?: readonly string[];
|
|
502
|
+
router_events?: readonly string[];
|
|
503
|
+
condition_type?: FlowCondition["type"] | "IF" | null;
|
|
504
|
+
trigger_condition_type?: FlowCondition["type"] | null;
|
|
505
|
+
trigger_methods?: readonly string[];
|
|
506
|
+
trigger_condition?: FlowCondition;
|
|
507
|
+
method_signature?: FlowMethodSignature;
|
|
508
|
+
source_code?: string;
|
|
509
|
+
class_name?: string;
|
|
510
|
+
class_signature?: string;
|
|
511
|
+
};
|
|
512
|
+
export type FlowChatOptions = {
|
|
513
|
+
session_id?: string | null;
|
|
514
|
+
sessionId?: string | null;
|
|
515
|
+
prompt?: string;
|
|
516
|
+
assistant_prefix?: string;
|
|
517
|
+
assistantPrefix?: string;
|
|
518
|
+
exit_commands?: readonly string[];
|
|
519
|
+
exitCommands?: readonly string[];
|
|
520
|
+
input_fn?: (prompt: string) => MaybePromise<string>;
|
|
521
|
+
inputFn?: (prompt: string) => MaybePromise<string>;
|
|
522
|
+
output_fn?: (message: string) => void;
|
|
523
|
+
outputFn?: (message: string) => void;
|
|
524
|
+
skip_empty?: boolean;
|
|
525
|
+
skipEmpty?: boolean;
|
|
526
|
+
defer_trace_finalization?: boolean;
|
|
527
|
+
deferTraceFinalization?: boolean;
|
|
528
|
+
handle_turn_options?: Omit<FlowKickoffOptions, "userMessage" | "user_message">;
|
|
529
|
+
handleTurnOptions?: Omit<FlowKickoffOptions, "userMessage" | "user_message">;
|
|
530
|
+
};
|
|
531
|
+
export type FlowVisualizationEdge = {
|
|
532
|
+
source: string;
|
|
533
|
+
target: string;
|
|
534
|
+
condition_type: FlowCondition["type"] | null;
|
|
535
|
+
is_router_path: boolean;
|
|
536
|
+
is_router_event?: boolean;
|
|
537
|
+
router_path_label?: string;
|
|
538
|
+
router_event?: string;
|
|
539
|
+
};
|
|
540
|
+
export type FlowVisualizationStructure = {
|
|
541
|
+
nodes: Record<string, FlowNodeMetadata>;
|
|
542
|
+
edges: readonly FlowVisualizationEdge[];
|
|
543
|
+
start_methods: readonly string[];
|
|
544
|
+
router_methods: readonly string[];
|
|
545
|
+
};
|
|
546
|
+
export type FlowSerializedMethodInfo = {
|
|
547
|
+
name: string;
|
|
548
|
+
type: FlowMethodKind | "start_router";
|
|
549
|
+
trigger_methods: readonly string[];
|
|
550
|
+
condition_type: FlowCondition["type"] | null;
|
|
551
|
+
router_paths: readonly string[];
|
|
552
|
+
router_events: readonly string[];
|
|
553
|
+
has_human_feedback: boolean;
|
|
554
|
+
has_crew: boolean;
|
|
555
|
+
};
|
|
556
|
+
export type FlowSerializedEdgeInfo = {
|
|
557
|
+
from_method: string;
|
|
558
|
+
to_method: string;
|
|
559
|
+
edge_type: "listen" | "route";
|
|
560
|
+
condition: string | null;
|
|
561
|
+
};
|
|
562
|
+
export type FlowSerializedStateFieldInfo = {
|
|
563
|
+
name: string;
|
|
564
|
+
type: string;
|
|
565
|
+
default?: unknown;
|
|
566
|
+
};
|
|
567
|
+
export type FlowSerializedStateSchemaInfo = {
|
|
568
|
+
fields: readonly FlowSerializedStateFieldInfo[];
|
|
569
|
+
};
|
|
570
|
+
export type FlowSerializedStructureInfo = {
|
|
571
|
+
name: string;
|
|
572
|
+
description: string | null;
|
|
573
|
+
methods: readonly FlowSerializedMethodInfo[];
|
|
574
|
+
edges: readonly FlowSerializedEdgeInfo[];
|
|
575
|
+
state_schema: FlowSerializedStateSchemaInfo | null;
|
|
576
|
+
inputs: readonly string[];
|
|
577
|
+
};
|
|
578
|
+
type AnyFlowMethod<This = unknown> = (this: This, ...args: unknown[]) => MaybePromise<unknown>;
|
|
579
|
+
export declare class FlowMethod {
|
|
580
|
+
readonly _meth: (...args: unknown[]) => unknown;
|
|
581
|
+
readonly _instance: unknown;
|
|
582
|
+
readonly __name__: string;
|
|
583
|
+
constructor(method: (...args: unknown[]) => unknown, instance?: unknown);
|
|
584
|
+
call(...args: unknown[]): unknown;
|
|
585
|
+
__call__(...args: unknown[]): unknown;
|
|
586
|
+
unwrap(): (...args: unknown[]) => unknown;
|
|
587
|
+
}
|
|
588
|
+
export declare class StartMethod extends FlowMethod {
|
|
589
|
+
readonly __is_start_method__ = true;
|
|
590
|
+
}
|
|
591
|
+
export declare class ListenMethod extends FlowMethod {
|
|
592
|
+
}
|
|
593
|
+
export declare class RouterMethod extends FlowMethod {
|
|
594
|
+
readonly __is_router__ = true;
|
|
595
|
+
}
|
|
596
|
+
type FlowMetadataTarget = abstract new (...args: never[]) => object;
|
|
597
|
+
export declare class Flow<TState extends object = Record<string, unknown>> {
|
|
598
|
+
static _flow_definition?: FlowDefinition | null;
|
|
599
|
+
static builtin_routes: readonly string[];
|
|
600
|
+
static builtinRoutes: readonly string[];
|
|
601
|
+
static internal_routes: readonly string[];
|
|
602
|
+
static internalRoutes: readonly string[];
|
|
603
|
+
static builtin_route_descriptions: Readonly<Record<string, string>>;
|
|
604
|
+
static builtinRouteDescriptions: Readonly<Record<string, string>>;
|
|
605
|
+
static flowDefinition(this: FlowMetadataTarget & {
|
|
606
|
+
_flow_definition?: FlowDefinition | null;
|
|
607
|
+
}): FlowDefinition;
|
|
608
|
+
static flow_definition(this: FlowMetadataTarget & {
|
|
609
|
+
_flow_definition?: FlowDefinition | null;
|
|
610
|
+
}): FlowDefinition;
|
|
611
|
+
readonly entityType = "flow";
|
|
612
|
+
readonly entity_type = "flow";
|
|
613
|
+
readonly name: string | null;
|
|
614
|
+
readonly maxMethodCalls: number;
|
|
615
|
+
inputProvider: InputProvider | null;
|
|
616
|
+
input_provider: InputProvider | null;
|
|
617
|
+
persistence: FlowPersistence | null;
|
|
618
|
+
stream: boolean;
|
|
619
|
+
checkpoint: CheckpointConfig | false | null;
|
|
620
|
+
memory: Memory | MemoryScope | MemorySlice | null;
|
|
621
|
+
state: TState;
|
|
622
|
+
private currentInputFiles;
|
|
623
|
+
private readonly runtimeMethodOutputs;
|
|
624
|
+
private readonly runtimeCompletedMethods;
|
|
625
|
+
private readonly runtimeMethodExecutionCounts;
|
|
626
|
+
private readonly runtimeExecutionTrace;
|
|
627
|
+
private readonly runtimeInputHistory;
|
|
628
|
+
readonly humanFeedbackHistory: HumanFeedbackResult[];
|
|
629
|
+
lastHumanFeedback: HumanFeedbackResult | null;
|
|
630
|
+
private pendingFeedbackContext;
|
|
631
|
+
private lastInputs;
|
|
632
|
+
private currentMethodName;
|
|
633
|
+
private currentFlowRequestId;
|
|
634
|
+
private checkpointRestoreActive;
|
|
635
|
+
private flowPostInitDone;
|
|
636
|
+
private readonly firedOrListeners;
|
|
637
|
+
private racingGroupsCache;
|
|
638
|
+
private readonly autoMemoryDisabled;
|
|
639
|
+
private deferredFlowFinished;
|
|
640
|
+
constructor(options?: FlowOptions<TState>);
|
|
641
|
+
model_post_init(_context?: unknown): void;
|
|
642
|
+
modelPostInit(context?: unknown): void;
|
|
643
|
+
_flowPostInit(): void;
|
|
644
|
+
_flow_post_init(): void;
|
|
645
|
+
_copyState(): TState;
|
|
646
|
+
_copy_state(): TState;
|
|
647
|
+
_initializeState(inputs: Record<string, unknown>): void;
|
|
648
|
+
_initialize_state(inputs: Record<string, unknown>): void;
|
|
649
|
+
_restoreState(state: Record<string, unknown>): void;
|
|
650
|
+
_restore_state(state: Record<string, unknown>): void;
|
|
651
|
+
_updateStateField(key: string, value: unknown): void;
|
|
652
|
+
_update_state_field(key: string, value: unknown): void;
|
|
653
|
+
_applyStateUpdates(updates: Record<string, unknown>): void;
|
|
654
|
+
_apply_state_updates(updates: Record<string, unknown>): void;
|
|
655
|
+
_createInitialState(): TState;
|
|
656
|
+
_create_initial_state(): TState;
|
|
657
|
+
get conversationMessages(): LLMMessage[];
|
|
658
|
+
get conversation_messages(): LLMMessage[];
|
|
659
|
+
appendMessage(role: LLMMessage["role"], content: string, extra?: Record<string, unknown>): void;
|
|
660
|
+
append_message(role: LLMMessage["role"], content: string, extra?: Record<string, unknown>): void;
|
|
661
|
+
appendAssistantMessage(content: string, extra?: Record<string, unknown>): void;
|
|
662
|
+
append_assistant_message(content: string, extra?: Record<string, unknown>): void;
|
|
663
|
+
appendAgentResult(agentName: string, result: unknown, options?: {
|
|
664
|
+
visibility?: ConversationEventVisibility;
|
|
665
|
+
metadata?: Record<string, unknown>;
|
|
666
|
+
}): void;
|
|
667
|
+
append_agent_result(agentName: string, result: unknown, options?: {
|
|
668
|
+
visibility?: ConversationEventVisibility;
|
|
669
|
+
metadata?: Record<string, unknown>;
|
|
670
|
+
}): void;
|
|
671
|
+
_buildRouteCatalog(routerConfig?: RouterConfig | null): Record<string, string>;
|
|
672
|
+
_build_route_catalog(routerConfig?: RouterConfig | null): Record<string, string>;
|
|
673
|
+
_buildRouterMessages(routerConfig: RouterConfig, context: Record<string, unknown>): LLMMessage[];
|
|
674
|
+
_build_router_messages(routerConfig: RouterConfig, context: Record<string, unknown>): LLMMessage[];
|
|
675
|
+
buildRouterContext(): Record<string, unknown>;
|
|
676
|
+
build_router_context(): Record<string, unknown>;
|
|
677
|
+
buildAgentContext(agentName: string): LLMMessage[];
|
|
678
|
+
build_agent_context(agentName: string): LLMMessage[];
|
|
679
|
+
conversationStart(): string | null;
|
|
680
|
+
conversation_start(): string | null;
|
|
681
|
+
classifyIntent(text: string, outcomes: readonly string[], options?: {
|
|
682
|
+
llm?: string | LLM | null;
|
|
683
|
+
context?: readonly LLMMessage[] | null;
|
|
684
|
+
}): string;
|
|
685
|
+
classify_intent(text: string, outcomes: readonly string[], options?: {
|
|
686
|
+
llm?: string | LLM | null;
|
|
687
|
+
context?: readonly LLMMessage[] | null;
|
|
688
|
+
}): string;
|
|
689
|
+
routeTurn(context: Record<string, unknown>): string | null;
|
|
690
|
+
route_turn(context: Record<string, unknown>): string | null;
|
|
691
|
+
routeConversation(): string;
|
|
692
|
+
route_conversation(): string;
|
|
693
|
+
_routeWithConfig(routerConfig: RouterConfig, context: Record<string, unknown>): string | null;
|
|
694
|
+
_route_with_config(routerConfig: RouterConfig, context: Record<string, unknown>): string | null;
|
|
695
|
+
_routerResponseFormat(routerConfig: RouterConfig): unknown;
|
|
696
|
+
_router_response_format(routerConfig: RouterConfig): unknown;
|
|
697
|
+
converseTurn(): string;
|
|
698
|
+
converse_turn(): string;
|
|
699
|
+
answerFromHistoryTurn(): string | null;
|
|
700
|
+
answer_from_history_turn(): string | null;
|
|
701
|
+
endConversation(): string;
|
|
702
|
+
end_conversation(): string;
|
|
703
|
+
finalizeSessionTraces(): void;
|
|
704
|
+
finalize_session_traces(): void;
|
|
705
|
+
_shouldDeferTraceFinalization(): boolean;
|
|
706
|
+
_should_defer_trace_finalization(): boolean;
|
|
707
|
+
_effectiveRoutes(routerConfig?: RouterConfig | null): string[];
|
|
708
|
+
_effective_routes(routerConfig?: RouterConfig | null): string[];
|
|
709
|
+
private validRouteLabels;
|
|
710
|
+
private routeDescriptionForHandler;
|
|
711
|
+
private builtinRouteNames;
|
|
712
|
+
private defaultRouterLlm;
|
|
713
|
+
private defaultConversationLlm;
|
|
714
|
+
private resolveConversationalSystemPrompt;
|
|
715
|
+
private resolveAnswerFromHistoryPrompt;
|
|
716
|
+
private routerResponseFormat;
|
|
717
|
+
private shouldDeferConversationalTraceFinalization;
|
|
718
|
+
private canAnswerFromHistory;
|
|
719
|
+
handleTurn(message: string | Record<string, unknown>, options?: Omit<FlowKickoffOptions, "userMessage" | "user_message">): Promise<unknown>;
|
|
720
|
+
handle_turn(message: string | Record<string, unknown>, options?: Omit<FlowKickoffOptions, "userMessage" | "user_message">): Promise<unknown>;
|
|
721
|
+
chat(options?: FlowChatOptions): Promise<void>;
|
|
722
|
+
_replayRecordedEvents(): Promise<void>;
|
|
723
|
+
_replay_recorded_events(): Promise<void>;
|
|
724
|
+
_executeStartMethod(startMethodName: string): Promise<void>;
|
|
725
|
+
_execute_start_method(startMethodName: string): Promise<void>;
|
|
726
|
+
_injectTriggerPayloadForStartMethod<TMethod extends (...args: unknown[]) => MaybePromise<unknown>>(originalMethod: TMethod): TMethod;
|
|
727
|
+
_inject_trigger_payload_for_start_method<TMethod extends (...args: unknown[]) => MaybePromise<unknown>>(originalMethod: TMethod): TMethod;
|
|
728
|
+
_executeMethod(methodName: string, method: (...args: unknown[]) => MaybePromise<unknown>, ...args: unknown[]): Promise<[unknown, string | null]>;
|
|
729
|
+
_execute_method(methodName: string, method: (...args: unknown[]) => MaybePromise<unknown>, ...args: unknown[]): Promise<[unknown, string | null]>;
|
|
730
|
+
_copyAndSerializeState(): Record<string, unknown>;
|
|
731
|
+
_copy_and_serialize_state(): Record<string, unknown>;
|
|
732
|
+
_executeListeners(triggerMethod: string, result: unknown, triggeringEventId?: string | null): Promise<void>;
|
|
733
|
+
_execute_listeners(triggerMethod: string, result: unknown, triggeringEventId?: string | null): Promise<void>;
|
|
734
|
+
_evaluateCondition(condition: string | FlowCondition, triggerMethod: string, listenerName: string): boolean;
|
|
735
|
+
_evaluate_condition(condition: string | FlowCondition, triggerMethod: string, listenerName: string): boolean;
|
|
736
|
+
_findTriggeredMethods(triggerMethod: string, routerOnly: boolean): string[];
|
|
737
|
+
_find_triggered_methods(triggerMethod: string, routerOnly: boolean): string[];
|
|
738
|
+
_checkpointStateForAsk(): MaybePromise<void>;
|
|
739
|
+
_checkpoint_state_for_ask(): Promise<void>;
|
|
740
|
+
_collapseToOutcome(feedback: string, outcomes: readonly string[]): string;
|
|
741
|
+
_collapse_to_outcome(feedback: string, outcomes: readonly string[]): string;
|
|
742
|
+
_logFlowEvent(message: string, color?: string, level?: "info" | "warning"): void;
|
|
743
|
+
_log_flow_event(message: string, color?: string, level?: "info" | "warning"): void;
|
|
744
|
+
_markOrListenerFired(listenerName: string): boolean;
|
|
745
|
+
_mark_or_listener_fired(listenerName: string): boolean;
|
|
746
|
+
_clearOrListeners(): void;
|
|
747
|
+
_clear_or_listeners(): void;
|
|
748
|
+
_discardOrListener(listenerName: string): void;
|
|
749
|
+
_discard_or_listener(listenerName: string): void;
|
|
750
|
+
_rearmOrListenersForTrigger(trigger: FlowConditionInput, rearmable?: Set<string> | null): void;
|
|
751
|
+
_rearm_or_listeners_for_trigger(trigger: FlowConditionInput, rearmable?: Set<string> | null): void;
|
|
752
|
+
_buildRacingGroups(): Map<ReadonlySet<string>, string>;
|
|
753
|
+
_build_racing_groups(): Map<ReadonlySet<string>, string>;
|
|
754
|
+
_getRacingGroupForListeners(listenerNames: readonly string[]): [ReadonlySet<string>, string] | null;
|
|
755
|
+
_get_racing_group_for_listeners(listenerNames: readonly string[]): [ReadonlySet<string>, string] | null;
|
|
756
|
+
_executeSingleListener(name: string, result: unknown, triggeringEventId?: string | null): Promise<unknown>;
|
|
757
|
+
_execute_single_listener(name: string, result: unknown, triggeringEventId?: string | null): Promise<unknown>;
|
|
758
|
+
_executeRacingListeners(racingListeners: Iterable<string>, otherListeners: readonly string[], result: unknown, triggeringEventId?: string | null): Promise<void>;
|
|
759
|
+
_execute_racing_listeners(racingListeners: Iterable<string>, otherListeners: readonly string[], result: unknown, triggeringEventId?: string | null): Promise<void>;
|
|
760
|
+
private flowPostInit;
|
|
761
|
+
private applyStateUpdates;
|
|
762
|
+
kickoff(optionsOrInputs?: FlowKickoffOptions | InputValues | null, inputFiles?: InputFiles | null, fromCheckpoint?: CheckpointConfig | null, restoreFromStateId?: string | null): Promise<unknown>;
|
|
763
|
+
kickoffAsync(optionsOrInputs?: FlowKickoffOptions | InputValues | null, inputFiles?: InputFiles | null, fromCheckpoint?: CheckpointConfig | null, restoreFromStateId?: string | null): Promise<unknown>;
|
|
764
|
+
recall(query: string, options?: Parameters<Memory["recall"]>[1]): MemoryMatch[];
|
|
765
|
+
remember(content: string | readonly string[], options?: Parameters<Memory["remember"]>[1]): MemoryRecord | MemoryRecord[] | null;
|
|
766
|
+
extractMemories(content: string): readonly string[];
|
|
767
|
+
extract_memories(content: string): readonly string[];
|
|
768
|
+
plot(filename?: string, show?: boolean): string;
|
|
769
|
+
static showTracingDisabledMessage(): void;
|
|
770
|
+
static _show_tracing_disabled_message(): void;
|
|
771
|
+
akickoff(optionsOrInputs?: FlowKickoffOptions | InputValues | null, inputFiles?: InputFiles | null, fromCheckpoint?: CheckpointConfig | null, restoreFromStateId?: string | null): Promise<unknown>;
|
|
772
|
+
kickoff_async(optionsOrInputs?: FlowKickoffOptions | InputValues | null, inputFiles?: InputFiles | null, fromCheckpoint?: CheckpointConfig | null, restoreFromStateId?: string | null): Promise<unknown>;
|
|
773
|
+
resume(feedback?: string): Promise<unknown>;
|
|
774
|
+
resumeAsync(feedback?: string): Promise<unknown>;
|
|
775
|
+
resume_async(feedback?: string): Promise<unknown>;
|
|
776
|
+
aresume(feedback?: string): Promise<unknown>;
|
|
777
|
+
get pendingFeedback(): PendingFeedbackContext | null;
|
|
778
|
+
get pending_feedback(): PendingFeedbackContext | null;
|
|
779
|
+
static fromPending<TFlow extends Flow<object>>(this: new () => TFlow, flowId: string, persistence?: FlowPersistence | null): Promise<TFlow>;
|
|
780
|
+
static from_pending<TFlow extends Flow<object>>(this: new () => TFlow, flowId: string, persistence?: FlowPersistence | null): Promise<TFlow>;
|
|
781
|
+
static fromState<TFlow extends Flow<object>>(this: new () => TFlow, flowId: string, persistence: FlowPersistence): Promise<TFlow>;
|
|
782
|
+
static from_state<TFlow extends Flow<object>>(this: new () => TFlow, flowId: string, persistence: FlowPersistence): Promise<TFlow>;
|
|
783
|
+
static fromCheckpoint<TFlow extends Flow<object>>(this: new () => TFlow, config: CheckpointConfig): Promise<TFlow>;
|
|
784
|
+
static from_checkpoint<TFlow extends Flow<object>>(this: new () => TFlow, config: CheckpointConfig): Promise<TFlow>;
|
|
785
|
+
static fork<TFlow extends Flow<object>>(this: new () => TFlow, config: CheckpointConfig, branch?: string | null): Promise<TFlow>;
|
|
786
|
+
get inputFiles(): InputFiles;
|
|
787
|
+
get methodOutputs(): readonly unknown[];
|
|
788
|
+
get method_outputs(): readonly unknown[];
|
|
789
|
+
get flow_id(): string;
|
|
790
|
+
get completedMethods(): ReadonlySet<string>;
|
|
791
|
+
get methodExecutionCounts(): ReadonlyMap<string, number>;
|
|
792
|
+
get executionTrace(): readonly FlowExecutionTraceEntry[];
|
|
793
|
+
get inputHistory(): readonly FlowInputHistoryEntry[];
|
|
794
|
+
get input_history(): readonly FlowInputHistoryEntry[];
|
|
795
|
+
get _input_history(): readonly FlowInputHistoryEntry[];
|
|
796
|
+
toExecutionData(): FlowExecutionData;
|
|
797
|
+
reload(executionData: FlowExecutionData): void;
|
|
798
|
+
toJSON(): Record<string, unknown>;
|
|
799
|
+
kickoffCrew(crew: Crew, options?: KickoffOptions): Promise<CrewOutput>;
|
|
800
|
+
ask(message: string, options?: FlowAskOptions): MaybePromise<string | null>;
|
|
801
|
+
private requestInputFromProvider;
|
|
802
|
+
private requestInputAfterCheckpoint;
|
|
803
|
+
private resolveInputProvider;
|
|
804
|
+
_resolveInputProvider(): InputProvider;
|
|
805
|
+
_resolve_input_provider(): InputProvider;
|
|
806
|
+
requestHumanFeedback(methodName: string, methodOutput: unknown, config: HumanFeedbackConfig, options?: {
|
|
807
|
+
preserveMethodOutput?: boolean;
|
|
808
|
+
}): Promise<HumanFeedbackResult | HumanFeedbackRoutingResult | string>;
|
|
809
|
+
_requestHumanFeedback(message: string, output: unknown, metadata?: Record<string, unknown> | null, emit?: readonly string[] | null): Promise<string>;
|
|
810
|
+
_request_human_feedback(message: string, output: unknown, metadata?: Record<string, unknown> | null, emit?: readonly string[] | null): Promise<string>;
|
|
811
|
+
get humanFeedback(): HumanFeedbackResult | null;
|
|
812
|
+
private callFlowMethod;
|
|
813
|
+
private resetRuntimeState;
|
|
814
|
+
private restoreFromCheckpointEntity;
|
|
815
|
+
_restoreFromCheckpoint(checkpoint?: Partial<FlowCheckpointEntity> | null): void;
|
|
816
|
+
_restore_from_checkpoint(checkpoint?: Partial<FlowCheckpointEntity> | null): void;
|
|
817
|
+
private continueFromHumanFeedback;
|
|
818
|
+
private savePendingFeedback;
|
|
819
|
+
private withStreamDisabled;
|
|
820
|
+
private saveState;
|
|
821
|
+
private recordHumanFeedbackResult;
|
|
822
|
+
private resolveAsyncInput;
|
|
823
|
+
private recordInput;
|
|
824
|
+
stateSnapshot(): Record<string, unknown>;
|
|
825
|
+
private flowName;
|
|
826
|
+
private shouldSkipAutoMemory;
|
|
827
|
+
private flowPersistenceId;
|
|
828
|
+
private isStartMethod;
|
|
829
|
+
private isRouterOutput;
|
|
830
|
+
private collectHumanFeedback;
|
|
831
|
+
}
|
|
832
|
+
export declare class _FlowGeneric<TState extends object = Record<string, unknown>> extends Flow<TState> {
|
|
833
|
+
}
|
|
834
|
+
export declare class StateWithId {
|
|
835
|
+
id: string;
|
|
836
|
+
constructor(id?: string);
|
|
837
|
+
}
|
|
838
|
+
export declare class FeedbackOutcome {
|
|
839
|
+
readonly outcome: string;
|
|
840
|
+
constructor(outcome: string);
|
|
841
|
+
}
|
|
842
|
+
export declare function _run_flow<TState extends object>(flow: Flow<TState>, options?: FlowKickoffOptions | InputValues | null): Promise<unknown>;
|
|
843
|
+
export declare function run_flow<TState extends object>(flow: Flow<TState>, options?: FlowKickoffOptions | InputValues | null): Promise<unknown>;
|
|
844
|
+
export declare function prepare_kwargs(...args: unknown[]): [unknown[], Record<string, unknown>];
|
|
845
|
+
export declare function enhanced_method<TArgs extends unknown[], TResult>(method: (...args: TArgs) => TResult): (...args: TArgs) => TResult;
|
|
846
|
+
export declare function start<This extends object>(value: AnyFlowMethod<This>, context: ClassMethodDecoratorContext<This, AnyFlowMethod<This>>): AnyFlowMethod<This>;
|
|
847
|
+
export declare function start(condition?: FlowConditionInput): MethodDecoratorFactory;
|
|
848
|
+
export declare function listen(condition: FlowConditionInput): MethodDecoratorFactory;
|
|
849
|
+
export declare function router(condition: FlowConditionInput, options?: {
|
|
850
|
+
emit?: readonly string[] | null;
|
|
851
|
+
}): MethodDecoratorFactory;
|
|
852
|
+
export declare function humanFeedback(configOrMessage: HumanFeedbackConfig | string): MethodDecoratorFactory;
|
|
853
|
+
export declare const human_feedback: typeof humanFeedback;
|
|
854
|
+
export declare function or_(...conditions: FlowConditionInput[]): FlowCondition;
|
|
855
|
+
export declare function and_(...conditions: FlowConditionInput[]): FlowCondition;
|
|
856
|
+
export declare function getFlowMetadata(instanceOrConstructor: object | FlowMetadataTarget): readonly FlowMethodEntry[];
|
|
857
|
+
export declare function getHumanFeedbackMetadata(instanceOrConstructor: object | FlowMetadataTarget): ReadonlyMap<string, HumanFeedbackConfig>;
|
|
858
|
+
export declare function buildFlowDefinition(instanceOrConstructor: object | FlowMetadataTarget, namespace?: Record<string, unknown> | null): FlowDefinition;
|
|
859
|
+
export declare const build_flow_definition: typeof buildFlowDefinition;
|
|
860
|
+
export type FlowRegistryListenerCondition = readonly [FlowCondition["type"], readonly string[]] | FlowCondition;
|
|
861
|
+
export type ExtractedFlowDefinitionRegistries = [
|
|
862
|
+
startMethods: string[],
|
|
863
|
+
listeners: Record<string, FlowRegistryListenerCondition>,
|
|
864
|
+
routers: Set<string>,
|
|
865
|
+
routerEmit: Record<string, readonly string[]>
|
|
866
|
+
];
|
|
867
|
+
export declare function extractFlowDefinition(namespace: Record<string, unknown>): ExtractedFlowDefinitionRegistries;
|
|
868
|
+
export declare const extract_flow_definition: typeof extractFlowDefinition;
|
|
869
|
+
export declare function getFlowStructure(instanceOrConstructor: object | FlowMetadataTarget): FlowStructure;
|
|
870
|
+
export declare const get_flow_structure: typeof getFlowStructure;
|
|
871
|
+
export declare function visualizeFlowStructure(structure: FlowVisualizationStructure, filename?: string, show?: boolean): string;
|
|
872
|
+
export declare const visualize_flow_structure: typeof visualizeFlowStructure;
|
|
873
|
+
export declare function typeToOpenAPISchema(typeHint: unknown): OpenAPISchema;
|
|
874
|
+
export declare const type_to_openapi_schema: typeof typeToOpenAPISchema;
|
|
875
|
+
export declare function extractMethodSignature(method: unknown, methodName: string): FlowMethodSignature;
|
|
876
|
+
export declare const extract_method_signature: typeof extractMethodSignature;
|
|
877
|
+
export declare function getPossibleReturnConstants(method: unknown): readonly string[] | null;
|
|
878
|
+
export declare const get_possible_return_constants: typeof getPossibleReturnConstants;
|
|
879
|
+
export declare function buildFlowStructure(instanceOrConstructor: object | FlowMetadataTarget): FlowVisualizationStructure;
|
|
880
|
+
export declare const build_flow_structure: typeof buildFlowStructure;
|
|
881
|
+
export declare function flowStructure(instanceOrConstructor: object | FlowMetadataTarget): FlowSerializedStructureInfo;
|
|
882
|
+
export declare function flow_structure(instanceOrConstructor: object | FlowMetadataTarget): FlowSerializedStructureInfo;
|
|
883
|
+
export declare function calculateExecutionPaths(structure: FlowVisualizationStructure): number;
|
|
884
|
+
export declare const calculate_execution_paths: typeof calculateExecutionPaths;
|
|
885
|
+
export declare function calculateNodeLevels(instanceOrConstructor: object | FlowMetadataTarget | FlowVisualizationStructure): Record<string, number>;
|
|
886
|
+
export declare const calculate_node_levels: typeof calculateNodeLevels;
|
|
887
|
+
export declare function countOutgoingEdges(instanceOrConstructor: object | FlowMetadataTarget | FlowVisualizationStructure): Record<string, number>;
|
|
888
|
+
export declare const count_outgoing_edges: typeof countOutgoingEdges;
|
|
889
|
+
export declare function buildAncestorDict(instanceOrConstructor: object | FlowMetadataTarget | FlowVisualizationStructure): Record<string, ReadonlySet<string>>;
|
|
890
|
+
export declare const build_ancestor_dict: typeof buildAncestorDict;
|
|
891
|
+
export declare function isAncestor(node: string, ancestorCandidate: string, ancestors: Readonly<Record<string, ReadonlySet<string>>>): boolean;
|
|
892
|
+
export declare const is_ancestor: typeof isAncestor;
|
|
893
|
+
export declare function dfsAncestors(node: string, ancestors: Record<string, Set<string>>, visited: Set<string>, flow: unknown): void;
|
|
894
|
+
export declare const dfs_ancestors: typeof dfsAncestors;
|
|
895
|
+
export declare function buildParentChildrenDict(instanceOrConstructor: object | FlowMetadataTarget | FlowVisualizationStructure): Record<string, readonly string[]>;
|
|
896
|
+
export declare const build_parent_children_dict: typeof buildParentChildrenDict;
|
|
897
|
+
export declare function getChildIndex(parent: string, child: string, parentChildren: Readonly<Record<string, readonly string[]>>): number;
|
|
898
|
+
export declare const get_child_index: typeof getChildIndex;
|
|
899
|
+
export declare function processRouterPaths(flow: unknown, current: string, currentLevel: number, levels: Record<string, number>, queue: {
|
|
900
|
+
push?: (value: string) => unknown;
|
|
901
|
+
append?: (value: string) => unknown;
|
|
902
|
+
}): void;
|
|
903
|
+
export declare const process_router_paths: typeof processRouterPaths;
|
|
904
|
+
export declare function isFlowMethodName(value: unknown): value is string;
|
|
905
|
+
export declare const is_flow_method_name: typeof isFlowMethodName;
|
|
906
|
+
export declare function isFlowMethodCallable(value: unknown): value is (...args: unknown[]) => unknown;
|
|
907
|
+
export declare const is_flow_method_callable: typeof isFlowMethodCallable;
|
|
908
|
+
export declare function isFlowConditionDict(value: unknown): value is FlowCondition;
|
|
909
|
+
export declare const is_flow_condition_dict: typeof isFlowConditionDict;
|
|
910
|
+
export declare function isFlowConditionList(value: unknown): value is FlowConditionInput[];
|
|
911
|
+
export declare const is_flow_condition_list: typeof isFlowConditionList;
|
|
912
|
+
export declare function isSimpleFlowCondition(value: unknown): value is [string, string[]];
|
|
913
|
+
export declare const is_simple_flow_condition: typeof isSimpleFlowCondition;
|
|
914
|
+
export declare function isFlowMethod(value: unknown): boolean;
|
|
915
|
+
export declare const is_flow_method: typeof isFlowMethod;
|
|
916
|
+
export type FlowMethodDecorator = <This extends object>(value: AnyFlowMethod<This>, context: ClassMethodDecoratorContext<This, AnyFlowMethod<This>>) => AnyFlowMethod<This>;
|
|
917
|
+
export declare const FlowMethodDecorator: Readonly<{
|
|
918
|
+
kind: "FlowMethodDecorator";
|
|
919
|
+
}>;
|
|
920
|
+
type MethodDecoratorFactory = FlowMethodDecorator;
|
|
921
|
+
type FlowCheckpointEntity = {
|
|
922
|
+
checkpoint_completed_methods: string[];
|
|
923
|
+
checkpoint_method_outputs: unknown[];
|
|
924
|
+
checkpoint_method_counts: Record<string, number>;
|
|
925
|
+
checkpoint_state: Record<string, unknown>;
|
|
926
|
+
};
|
|
927
|
+
export {};
|