@crewai-ts/core 0.1.13 → 0.2.0
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/agent.d.ts +16 -18
- package/dist/auth.cjs +598 -0
- package/dist/auth.js +40 -0
- package/dist/{chunk-3PVW4JKT.js → chunk-C43UEMCX.js} +6712 -7268
- package/dist/chunk-CCOE6MLE.js +896 -0
- package/dist/chunk-HFQTF332.js +4455 -0
- package/dist/{chunk-BE4JYKSG.js → chunk-MM4ROIFG.js} +12 -1490
- package/dist/chunk-RH43TNKN.js +238 -0
- package/dist/chunk-S477WFUT.js +565 -0
- package/dist/chunk-SB7ADUQA.js +110 -0
- package/dist/chunk-T32G6KDW.js +40 -0
- package/dist/crew.d.ts +24 -26
- package/dist/events.cjs +7513 -0
- package/dist/events.js +406 -0
- package/dist/experimental-conversational.cjs +272 -0
- package/dist/experimental-conversational.js +26 -0
- package/dist/feature-hooks.cjs +149 -0
- package/dist/feature-hooks.d.ts +94 -0
- package/dist/feature-hooks.js +36 -0
- package/dist/index.cjs +33923 -64381
- package/dist/index.d.ts +2 -15
- package/dist/index.js +16720 -49562
- package/dist/input-provider.d.ts +3 -4
- package/dist/lite-agent.d.ts +4 -4
- package/dist/llm.cjs +7467 -0
- package/dist/llm.d.ts +0 -4
- package/dist/llm.js +225 -0
- package/dist/optional-yaml.d.ts +8 -0
- package/dist/project.d.ts +1 -1
- package/dist/schema-utils.cjs +968 -0
- package/dist/schema-utils.d.ts +1 -1
- package/dist/schema-utils.js +102 -0
- package/dist/state-provider-core.js +3 -2
- package/dist/task.d.ts +3 -4
- package/dist/tools.cjs +6872 -0
- package/dist/tools.d.ts +0 -60
- package/dist/tools.js +114 -0
- package/dist/types.cjs +68 -0
- package/dist/types.js +14 -0
- package/package.json +52 -111
- package/dist/a2a.d.ts +0 -1684
- package/dist/a2ui-schemas.d.ts +0 -3312
- package/dist/a2ui.d.ts +0 -379
- package/dist/flow-conversation.d.ts +0 -90
- package/dist/flow-definition.d.ts +0 -195
- package/dist/flow-persistence.d.ts +0 -107
- package/dist/flow-visualization.d.ts +0 -77
- package/dist/flow.d.ts +0 -927
- package/dist/knowledge.d.ts +0 -353
- package/dist/mcp-DS7UMYAM.js +0 -62
- package/dist/mcp.d.ts +0 -315
- package/dist/memory.d.ts +0 -915
- package/dist/openai-completion.d.ts +0 -327
- package/dist/provider-completions.d.ts +0 -596
- package/dist/rag.d.ts +0 -1074
package/dist/events.js
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A2AAgentCardFetchedEvent,
|
|
3
|
+
A2AArtifactReceivedEvent,
|
|
4
|
+
A2AAuthenticationFailedEvent,
|
|
5
|
+
A2AConnectionErrorEvent,
|
|
6
|
+
A2AContentTypeNegotiatedEvent,
|
|
7
|
+
A2AContextCompletedEvent,
|
|
8
|
+
A2AContextCreatedEvent,
|
|
9
|
+
A2AContextExpiredEvent,
|
|
10
|
+
A2AContextIdleEvent,
|
|
11
|
+
A2AContextPrunedEvent,
|
|
12
|
+
A2AConversationCompletedEvent,
|
|
13
|
+
A2AConversationStartedEvent,
|
|
14
|
+
A2ADelegationCompletedEvent,
|
|
15
|
+
A2ADelegationStartedEvent,
|
|
16
|
+
A2AEventBase,
|
|
17
|
+
A2AMessageSentEvent,
|
|
18
|
+
A2AParallelDelegationCompletedEvent,
|
|
19
|
+
A2AParallelDelegationStartedEvent,
|
|
20
|
+
A2APollingStartedEvent,
|
|
21
|
+
A2APollingStatusEvent,
|
|
22
|
+
A2APushNotificationReceivedEvent,
|
|
23
|
+
A2APushNotificationRegisteredEvent,
|
|
24
|
+
A2APushNotificationSentEvent,
|
|
25
|
+
A2APushNotificationTimeoutEvent,
|
|
26
|
+
A2AResponseReceivedEvent,
|
|
27
|
+
A2AServerTaskCanceledEvent,
|
|
28
|
+
A2AServerTaskCompletedEvent,
|
|
29
|
+
A2AServerTaskFailedEvent,
|
|
30
|
+
A2AServerTaskStartedEvent,
|
|
31
|
+
A2AStreamingChunkEvent,
|
|
32
|
+
A2AStreamingStartedEvent,
|
|
33
|
+
A2ATransportNegotiatedEvent,
|
|
34
|
+
AgentEvaluationCompletedEvent,
|
|
35
|
+
AgentEvaluationFailedEvent,
|
|
36
|
+
AgentEvaluationStartedEvent,
|
|
37
|
+
AgentExecutionCompletedEvent,
|
|
38
|
+
AgentExecutionErrorEvent,
|
|
39
|
+
AgentExecutionStartedEvent,
|
|
40
|
+
AgentLogsExecutionEvent,
|
|
41
|
+
AgentLogsStartedEvent,
|
|
42
|
+
AgentReasoningCompletedEvent,
|
|
43
|
+
AgentReasoningFailedEvent,
|
|
44
|
+
AgentReasoningStartedEvent,
|
|
45
|
+
AsyncHandler,
|
|
46
|
+
AsyncHandlerSet,
|
|
47
|
+
BaseEvent,
|
|
48
|
+
BaseEventListener,
|
|
49
|
+
CCEnvEvent,
|
|
50
|
+
CheckpointBaseEvent,
|
|
51
|
+
CheckpointCompletedEvent,
|
|
52
|
+
CheckpointFailedEvent,
|
|
53
|
+
CheckpointForkBaseEvent,
|
|
54
|
+
CheckpointForkCompletedEvent,
|
|
55
|
+
CheckpointForkStartedEvent,
|
|
56
|
+
CheckpointPrunedEvent,
|
|
57
|
+
CheckpointRestoreBaseEvent,
|
|
58
|
+
CheckpointRestoreCompletedEvent,
|
|
59
|
+
CheckpointRestoreFailedEvent,
|
|
60
|
+
CheckpointRestoreStartedEvent,
|
|
61
|
+
CheckpointStartedEvent,
|
|
62
|
+
CircularDependencyError,
|
|
63
|
+
CodexEnvEvent,
|
|
64
|
+
ConsoleFormatter,
|
|
65
|
+
CrewAIEventsBus,
|
|
66
|
+
CrewBaseEvent,
|
|
67
|
+
CrewKickoffCompletedEvent,
|
|
68
|
+
CrewKickoffFailedEvent,
|
|
69
|
+
CrewKickoffStartedEvent,
|
|
70
|
+
CrewTestCompletedEvent,
|
|
71
|
+
CrewTestFailedEvent,
|
|
72
|
+
CrewTestResultEvent,
|
|
73
|
+
CrewTestStartedEvent,
|
|
74
|
+
CrewTrainCompletedEvent,
|
|
75
|
+
CrewTrainFailedEvent,
|
|
76
|
+
CrewTrainStartedEvent,
|
|
77
|
+
CursorEnvEvent,
|
|
78
|
+
DefaultEnvEvent,
|
|
79
|
+
Depends,
|
|
80
|
+
ENV_CONTEXT_EVENT_TYPES,
|
|
81
|
+
EnvContextEvent,
|
|
82
|
+
EventBus,
|
|
83
|
+
EventHandler,
|
|
84
|
+
EventListener,
|
|
85
|
+
EventT_co,
|
|
86
|
+
EventTypes,
|
|
87
|
+
ExecutionPlan,
|
|
88
|
+
FirstTimeTraceHandler,
|
|
89
|
+
FlowCreatedEvent,
|
|
90
|
+
FlowEvent,
|
|
91
|
+
FlowFailedEvent,
|
|
92
|
+
FlowFinishedEvent,
|
|
93
|
+
FlowInputReceivedEvent,
|
|
94
|
+
FlowInputRequestedEvent,
|
|
95
|
+
FlowPausedEvent,
|
|
96
|
+
FlowPlotEvent,
|
|
97
|
+
FlowStartedEvent,
|
|
98
|
+
GoalAchievedEarlyEvent,
|
|
99
|
+
Handler,
|
|
100
|
+
HandlerGraph,
|
|
101
|
+
HumanFeedbackReceivedEvent,
|
|
102
|
+
HumanFeedbackRequestedEvent,
|
|
103
|
+
KnowledgeEventBase,
|
|
104
|
+
KnowledgeQueryCompletedEvent,
|
|
105
|
+
KnowledgeQueryFailedEvent,
|
|
106
|
+
KnowledgeQueryStartedEvent,
|
|
107
|
+
KnowledgeRetrievalCompletedEvent,
|
|
108
|
+
KnowledgeRetrievalStartedEvent,
|
|
109
|
+
KnowledgeSearchQueryFailedEvent,
|
|
110
|
+
LLMCallCompletedEvent,
|
|
111
|
+
LLMCallFailedEvent,
|
|
112
|
+
LLMCallStartedEvent,
|
|
113
|
+
LLMCallType,
|
|
114
|
+
LLMEventBase,
|
|
115
|
+
LLMGuardrailBaseEvent,
|
|
116
|
+
LLMGuardrailCompletedEvent,
|
|
117
|
+
LLMGuardrailStartedEvent,
|
|
118
|
+
LLMStreamChunkEvent,
|
|
119
|
+
LLMThinkingChunkEvent,
|
|
120
|
+
LiteAgentExecutionCompletedEvent,
|
|
121
|
+
LiteAgentExecutionErrorEvent,
|
|
122
|
+
LiteAgentExecutionStartedEvent,
|
|
123
|
+
MCPConfigFetchFailedEvent,
|
|
124
|
+
MCPConnectionCompletedEvent,
|
|
125
|
+
MCPConnectionFailedEvent,
|
|
126
|
+
MCPConnectionStartedEvent,
|
|
127
|
+
MCPEvent,
|
|
128
|
+
MCPToolExecutionCompletedEvent,
|
|
129
|
+
MCPToolExecutionFailedEvent,
|
|
130
|
+
MCPToolExecutionStartedEvent,
|
|
131
|
+
MemoryBaseEvent,
|
|
132
|
+
MemoryQueryCompletedEvent,
|
|
133
|
+
MemoryQueryFailedEvent,
|
|
134
|
+
MemoryQueryStartedEvent,
|
|
135
|
+
MemoryRetrievalCompletedEvent,
|
|
136
|
+
MemoryRetrievalFailedEvent,
|
|
137
|
+
MemoryRetrievalStartedEvent,
|
|
138
|
+
MemorySaveCompletedEvent,
|
|
139
|
+
MemorySaveFailedEvent,
|
|
140
|
+
MemorySaveStartedEvent,
|
|
141
|
+
MethodExecutionFailedEvent,
|
|
142
|
+
MethodExecutionFinishedEvent,
|
|
143
|
+
MethodExecutionPausedEvent,
|
|
144
|
+
MethodExecutionStartedEvent,
|
|
145
|
+
ObservationEvent,
|
|
146
|
+
PlanRefinementEvent,
|
|
147
|
+
PlanReplanTriggeredEvent,
|
|
148
|
+
ReasoningEvent,
|
|
149
|
+
SIGNAL_EVENT_TYPES,
|
|
150
|
+
SigContEvent,
|
|
151
|
+
SigHupEvent,
|
|
152
|
+
SigIntEvent,
|
|
153
|
+
SigTStpEvent,
|
|
154
|
+
SigTermEvent,
|
|
155
|
+
SignalEvent,
|
|
156
|
+
SignalEventBase,
|
|
157
|
+
SignalType,
|
|
158
|
+
SkillActivatedEvent,
|
|
159
|
+
SkillDiscoveryCompletedEvent,
|
|
160
|
+
SkillDiscoveryStartedEvent,
|
|
161
|
+
SkillDownloadCompletedEvent,
|
|
162
|
+
SkillDownloadStartedEvent,
|
|
163
|
+
SkillEvent,
|
|
164
|
+
SkillLoadFailedEvent,
|
|
165
|
+
SkillLoadedEvent,
|
|
166
|
+
StepObservationCompletedEvent,
|
|
167
|
+
StepObservationFailedEvent,
|
|
168
|
+
StepObservationStartedEvent,
|
|
169
|
+
SyncHandler,
|
|
170
|
+
SyncHandlerSet,
|
|
171
|
+
TaskCompletedEvent,
|
|
172
|
+
TaskEvaluationEvent,
|
|
173
|
+
TaskFailedEvent,
|
|
174
|
+
TaskStartedEvent,
|
|
175
|
+
ToolCall,
|
|
176
|
+
ToolExecutionErrorEvent,
|
|
177
|
+
ToolSelectionErrorEvent,
|
|
178
|
+
ToolUsageErrorEvent,
|
|
179
|
+
ToolUsageEvent,
|
|
180
|
+
ToolUsageFinishedEvent,
|
|
181
|
+
ToolUsageStartedEvent,
|
|
182
|
+
ToolValidateInputErrorEvent,
|
|
183
|
+
TraceBatch,
|
|
184
|
+
TraceBatchManager,
|
|
185
|
+
TraceCollectionListener,
|
|
186
|
+
TraceEvent,
|
|
187
|
+
_get_or_create_counter,
|
|
188
|
+
_set_agent_fingerprint,
|
|
189
|
+
_set_task_fingerprint,
|
|
190
|
+
build_execution_plan,
|
|
191
|
+
crewaiEventBus,
|
|
192
|
+
crewai_event_bus,
|
|
193
|
+
env_context_event_adapter,
|
|
194
|
+
event_listener,
|
|
195
|
+
get_next_emission_sequence,
|
|
196
|
+
is_async_handler,
|
|
197
|
+
is_call_handler_safe,
|
|
198
|
+
is_replaying,
|
|
199
|
+
on_signal,
|
|
200
|
+
resetEmissionSequence,
|
|
201
|
+
signal_event_adapter
|
|
202
|
+
} from "./chunk-C43UEMCX.js";
|
|
203
|
+
import "./chunk-LWD4QED4.js";
|
|
204
|
+
import "./chunk-S477WFUT.js";
|
|
205
|
+
export {
|
|
206
|
+
A2AAgentCardFetchedEvent,
|
|
207
|
+
A2AArtifactReceivedEvent,
|
|
208
|
+
A2AAuthenticationFailedEvent,
|
|
209
|
+
A2AConnectionErrorEvent,
|
|
210
|
+
A2AContentTypeNegotiatedEvent,
|
|
211
|
+
A2AContextCompletedEvent,
|
|
212
|
+
A2AContextCreatedEvent,
|
|
213
|
+
A2AContextExpiredEvent,
|
|
214
|
+
A2AContextIdleEvent,
|
|
215
|
+
A2AContextPrunedEvent,
|
|
216
|
+
A2AConversationCompletedEvent,
|
|
217
|
+
A2AConversationStartedEvent,
|
|
218
|
+
A2ADelegationCompletedEvent,
|
|
219
|
+
A2ADelegationStartedEvent,
|
|
220
|
+
A2AEventBase,
|
|
221
|
+
A2AMessageSentEvent,
|
|
222
|
+
A2AParallelDelegationCompletedEvent,
|
|
223
|
+
A2AParallelDelegationStartedEvent,
|
|
224
|
+
A2APollingStartedEvent,
|
|
225
|
+
A2APollingStatusEvent,
|
|
226
|
+
A2APushNotificationReceivedEvent,
|
|
227
|
+
A2APushNotificationRegisteredEvent,
|
|
228
|
+
A2APushNotificationSentEvent,
|
|
229
|
+
A2APushNotificationTimeoutEvent,
|
|
230
|
+
A2AResponseReceivedEvent,
|
|
231
|
+
A2AServerTaskCanceledEvent,
|
|
232
|
+
A2AServerTaskCompletedEvent,
|
|
233
|
+
A2AServerTaskFailedEvent,
|
|
234
|
+
A2AServerTaskStartedEvent,
|
|
235
|
+
A2AStreamingChunkEvent,
|
|
236
|
+
A2AStreamingStartedEvent,
|
|
237
|
+
A2ATransportNegotiatedEvent,
|
|
238
|
+
AgentEvaluationCompletedEvent,
|
|
239
|
+
AgentEvaluationFailedEvent,
|
|
240
|
+
AgentEvaluationStartedEvent,
|
|
241
|
+
AgentExecutionCompletedEvent,
|
|
242
|
+
AgentExecutionErrorEvent,
|
|
243
|
+
AgentExecutionStartedEvent,
|
|
244
|
+
AgentLogsExecutionEvent,
|
|
245
|
+
AgentLogsStartedEvent,
|
|
246
|
+
AgentReasoningCompletedEvent,
|
|
247
|
+
AgentReasoningFailedEvent,
|
|
248
|
+
AgentReasoningStartedEvent,
|
|
249
|
+
AsyncHandler,
|
|
250
|
+
AsyncHandlerSet,
|
|
251
|
+
BaseEvent,
|
|
252
|
+
BaseEventListener,
|
|
253
|
+
CCEnvEvent,
|
|
254
|
+
CheckpointBaseEvent,
|
|
255
|
+
CheckpointCompletedEvent,
|
|
256
|
+
CheckpointFailedEvent,
|
|
257
|
+
CheckpointForkBaseEvent,
|
|
258
|
+
CheckpointForkCompletedEvent,
|
|
259
|
+
CheckpointForkStartedEvent,
|
|
260
|
+
CheckpointPrunedEvent,
|
|
261
|
+
CheckpointRestoreBaseEvent,
|
|
262
|
+
CheckpointRestoreCompletedEvent,
|
|
263
|
+
CheckpointRestoreFailedEvent,
|
|
264
|
+
CheckpointRestoreStartedEvent,
|
|
265
|
+
CheckpointStartedEvent,
|
|
266
|
+
CircularDependencyError,
|
|
267
|
+
CodexEnvEvent,
|
|
268
|
+
ConsoleFormatter,
|
|
269
|
+
CrewAIEventsBus,
|
|
270
|
+
CrewBaseEvent,
|
|
271
|
+
CrewKickoffCompletedEvent,
|
|
272
|
+
CrewKickoffFailedEvent,
|
|
273
|
+
CrewKickoffStartedEvent,
|
|
274
|
+
CrewTestCompletedEvent,
|
|
275
|
+
CrewTestFailedEvent,
|
|
276
|
+
CrewTestResultEvent,
|
|
277
|
+
CrewTestStartedEvent,
|
|
278
|
+
CrewTrainCompletedEvent,
|
|
279
|
+
CrewTrainFailedEvent,
|
|
280
|
+
CrewTrainStartedEvent,
|
|
281
|
+
CursorEnvEvent,
|
|
282
|
+
DefaultEnvEvent,
|
|
283
|
+
Depends,
|
|
284
|
+
ENV_CONTEXT_EVENT_TYPES,
|
|
285
|
+
EnvContextEvent,
|
|
286
|
+
EventBus,
|
|
287
|
+
EventHandler,
|
|
288
|
+
EventListener,
|
|
289
|
+
EventT_co,
|
|
290
|
+
EventTypes,
|
|
291
|
+
ExecutionPlan,
|
|
292
|
+
FirstTimeTraceHandler,
|
|
293
|
+
FlowCreatedEvent,
|
|
294
|
+
FlowEvent,
|
|
295
|
+
FlowFailedEvent,
|
|
296
|
+
FlowFinishedEvent,
|
|
297
|
+
FlowInputReceivedEvent,
|
|
298
|
+
FlowInputRequestedEvent,
|
|
299
|
+
FlowPausedEvent,
|
|
300
|
+
FlowPlotEvent,
|
|
301
|
+
FlowStartedEvent,
|
|
302
|
+
GoalAchievedEarlyEvent,
|
|
303
|
+
Handler,
|
|
304
|
+
HandlerGraph,
|
|
305
|
+
HumanFeedbackReceivedEvent,
|
|
306
|
+
HumanFeedbackRequestedEvent,
|
|
307
|
+
KnowledgeEventBase,
|
|
308
|
+
KnowledgeQueryCompletedEvent,
|
|
309
|
+
KnowledgeQueryFailedEvent,
|
|
310
|
+
KnowledgeQueryStartedEvent,
|
|
311
|
+
KnowledgeRetrievalCompletedEvent,
|
|
312
|
+
KnowledgeRetrievalStartedEvent,
|
|
313
|
+
KnowledgeSearchQueryFailedEvent,
|
|
314
|
+
LLMCallCompletedEvent,
|
|
315
|
+
LLMCallFailedEvent,
|
|
316
|
+
LLMCallStartedEvent,
|
|
317
|
+
LLMCallType,
|
|
318
|
+
LLMEventBase,
|
|
319
|
+
LLMGuardrailBaseEvent,
|
|
320
|
+
LLMGuardrailCompletedEvent,
|
|
321
|
+
LLMGuardrailStartedEvent,
|
|
322
|
+
LLMStreamChunkEvent,
|
|
323
|
+
LLMThinkingChunkEvent,
|
|
324
|
+
LiteAgentExecutionCompletedEvent,
|
|
325
|
+
LiteAgentExecutionErrorEvent,
|
|
326
|
+
LiteAgentExecutionStartedEvent,
|
|
327
|
+
MCPConfigFetchFailedEvent,
|
|
328
|
+
MCPConnectionCompletedEvent,
|
|
329
|
+
MCPConnectionFailedEvent,
|
|
330
|
+
MCPConnectionStartedEvent,
|
|
331
|
+
MCPEvent,
|
|
332
|
+
MCPToolExecutionCompletedEvent,
|
|
333
|
+
MCPToolExecutionFailedEvent,
|
|
334
|
+
MCPToolExecutionStartedEvent,
|
|
335
|
+
MemoryBaseEvent,
|
|
336
|
+
MemoryQueryCompletedEvent,
|
|
337
|
+
MemoryQueryFailedEvent,
|
|
338
|
+
MemoryQueryStartedEvent,
|
|
339
|
+
MemoryRetrievalCompletedEvent,
|
|
340
|
+
MemoryRetrievalFailedEvent,
|
|
341
|
+
MemoryRetrievalStartedEvent,
|
|
342
|
+
MemorySaveCompletedEvent,
|
|
343
|
+
MemorySaveFailedEvent,
|
|
344
|
+
MemorySaveStartedEvent,
|
|
345
|
+
MethodExecutionFailedEvent,
|
|
346
|
+
MethodExecutionFinishedEvent,
|
|
347
|
+
MethodExecutionPausedEvent,
|
|
348
|
+
MethodExecutionStartedEvent,
|
|
349
|
+
ObservationEvent,
|
|
350
|
+
PlanRefinementEvent,
|
|
351
|
+
PlanReplanTriggeredEvent,
|
|
352
|
+
ReasoningEvent,
|
|
353
|
+
SIGNAL_EVENT_TYPES,
|
|
354
|
+
SigContEvent,
|
|
355
|
+
SigHupEvent,
|
|
356
|
+
SigIntEvent,
|
|
357
|
+
SigTStpEvent,
|
|
358
|
+
SigTermEvent,
|
|
359
|
+
SignalEvent,
|
|
360
|
+
SignalEventBase,
|
|
361
|
+
SignalType,
|
|
362
|
+
SkillActivatedEvent,
|
|
363
|
+
SkillDiscoveryCompletedEvent,
|
|
364
|
+
SkillDiscoveryStartedEvent,
|
|
365
|
+
SkillDownloadCompletedEvent,
|
|
366
|
+
SkillDownloadStartedEvent,
|
|
367
|
+
SkillEvent,
|
|
368
|
+
SkillLoadFailedEvent,
|
|
369
|
+
SkillLoadedEvent,
|
|
370
|
+
StepObservationCompletedEvent,
|
|
371
|
+
StepObservationFailedEvent,
|
|
372
|
+
StepObservationStartedEvent,
|
|
373
|
+
SyncHandler,
|
|
374
|
+
SyncHandlerSet,
|
|
375
|
+
TaskCompletedEvent,
|
|
376
|
+
TaskEvaluationEvent,
|
|
377
|
+
TaskFailedEvent,
|
|
378
|
+
TaskStartedEvent,
|
|
379
|
+
ToolCall,
|
|
380
|
+
ToolExecutionErrorEvent,
|
|
381
|
+
ToolSelectionErrorEvent,
|
|
382
|
+
ToolUsageErrorEvent,
|
|
383
|
+
ToolUsageEvent,
|
|
384
|
+
ToolUsageFinishedEvent,
|
|
385
|
+
ToolUsageStartedEvent,
|
|
386
|
+
ToolValidateInputErrorEvent,
|
|
387
|
+
TraceBatch,
|
|
388
|
+
TraceBatchManager,
|
|
389
|
+
TraceCollectionListener,
|
|
390
|
+
TraceEvent,
|
|
391
|
+
_get_or_create_counter,
|
|
392
|
+
_set_agent_fingerprint,
|
|
393
|
+
_set_task_fingerprint,
|
|
394
|
+
build_execution_plan,
|
|
395
|
+
crewaiEventBus,
|
|
396
|
+
crewai_event_bus,
|
|
397
|
+
env_context_event_adapter,
|
|
398
|
+
event_listener,
|
|
399
|
+
get_next_emission_sequence,
|
|
400
|
+
is_async_handler,
|
|
401
|
+
is_call_handler_safe,
|
|
402
|
+
is_replaying,
|
|
403
|
+
on_signal,
|
|
404
|
+
resetEmissionSequence,
|
|
405
|
+
signal_event_adapter
|
|
406
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/experimental-conversational.ts
|
|
21
|
+
var experimental_conversational_exports = {};
|
|
22
|
+
__export(experimental_conversational_exports, {
|
|
23
|
+
AgentMessage: () => AgentMessage,
|
|
24
|
+
ConversationConfig: () => ConversationConfig,
|
|
25
|
+
ConversationEvent: () => ConversationEvent,
|
|
26
|
+
ConversationEventVisibility: () => ConversationEventVisibility,
|
|
27
|
+
ConversationMessage: () => ConversationMessage,
|
|
28
|
+
ConversationMessageRole: () => ConversationMessageRole,
|
|
29
|
+
ConversationState: () => ConversationState,
|
|
30
|
+
RouterConfig: () => RouterConfig,
|
|
31
|
+
_conversational_only: () => _conversational_only,
|
|
32
|
+
messageToLlmDict: () => messageToLlmDict,
|
|
33
|
+
message_to_llm_dict: () => message_to_llm_dict
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(experimental_conversational_exports);
|
|
36
|
+
var import_node_crypto = require("crypto");
|
|
37
|
+
var ConversationMessageRole = Object.freeze({ kind: "ConversationMessageRole" });
|
|
38
|
+
var ConversationEventVisibility = Object.freeze({ kind: "ConversationEventVisibility" });
|
|
39
|
+
var RouterConfig = class {
|
|
40
|
+
prompt;
|
|
41
|
+
responseFormat;
|
|
42
|
+
response_format;
|
|
43
|
+
llm;
|
|
44
|
+
routes;
|
|
45
|
+
routeDescriptions;
|
|
46
|
+
route_descriptions;
|
|
47
|
+
defaultIntent;
|
|
48
|
+
default_intent;
|
|
49
|
+
fallbackIntent;
|
|
50
|
+
fallback_intent;
|
|
51
|
+
intentField;
|
|
52
|
+
intent_field;
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
this.prompt = options.prompt ?? null;
|
|
55
|
+
this.responseFormat = options.responseFormat ?? options.response_format ?? null;
|
|
56
|
+
this.response_format = this.responseFormat;
|
|
57
|
+
this.llm = options.llm ?? null;
|
|
58
|
+
this.routes = options.routes ? [...options.routes] : null;
|
|
59
|
+
this.routeDescriptions = options.routeDescriptions ?? options.route_descriptions ?? null;
|
|
60
|
+
this.route_descriptions = this.routeDescriptions;
|
|
61
|
+
this.defaultIntent = options.defaultIntent ?? options.default_intent ?? "converse";
|
|
62
|
+
this.default_intent = this.defaultIntent;
|
|
63
|
+
this.fallbackIntent = options.fallbackIntent ?? options.fallback_intent ?? "converse";
|
|
64
|
+
this.fallback_intent = this.fallbackIntent;
|
|
65
|
+
this.intentField = options.intentField ?? options.intent_field ?? "intent";
|
|
66
|
+
this.intent_field = this.intentField;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var ConversationConfig = class {
|
|
70
|
+
systemPrompt;
|
|
71
|
+
system_prompt;
|
|
72
|
+
llm;
|
|
73
|
+
router;
|
|
74
|
+
answerFromHistoryPrompt;
|
|
75
|
+
answer_from_history_prompt;
|
|
76
|
+
defaultIntents;
|
|
77
|
+
default_intents;
|
|
78
|
+
intentLlm;
|
|
79
|
+
intent_llm;
|
|
80
|
+
answerFromHistoryLlm;
|
|
81
|
+
answer_from_history_llm;
|
|
82
|
+
visibleAgentOutputs;
|
|
83
|
+
visible_agent_outputs;
|
|
84
|
+
deferTraceFinalization;
|
|
85
|
+
defer_trace_finalization;
|
|
86
|
+
constructor(options = {}) {
|
|
87
|
+
this.systemPrompt = options.systemPrompt ?? options.system_prompt ?? null;
|
|
88
|
+
this.system_prompt = this.systemPrompt;
|
|
89
|
+
this.llm = options.llm ?? null;
|
|
90
|
+
const router = options.router ?? null;
|
|
91
|
+
this.router = router instanceof RouterConfig ? router : router ? new RouterConfig(router) : null;
|
|
92
|
+
this.answerFromHistoryPrompt = options.answerFromHistoryPrompt ?? options.answer_from_history_prompt ?? null;
|
|
93
|
+
this.answer_from_history_prompt = this.answerFromHistoryPrompt;
|
|
94
|
+
this.defaultIntents = options.defaultIntents ?? options.default_intents ?? null;
|
|
95
|
+
this.default_intents = this.defaultIntents;
|
|
96
|
+
this.intentLlm = options.intentLlm ?? options.intent_llm ?? null;
|
|
97
|
+
this.intent_llm = this.intentLlm;
|
|
98
|
+
this.answerFromHistoryLlm = options.answerFromHistoryLlm ?? options.answer_from_history_llm ?? null;
|
|
99
|
+
this.answer_from_history_llm = this.answerFromHistoryLlm;
|
|
100
|
+
this.visibleAgentOutputs = options.visibleAgentOutputs ?? options.visible_agent_outputs ?? null;
|
|
101
|
+
this.visible_agent_outputs = this.visibleAgentOutputs;
|
|
102
|
+
this.deferTraceFinalization = options.deferTraceFinalization ?? options.defer_trace_finalization ?? true;
|
|
103
|
+
this.defer_trace_finalization = this.deferTraceFinalization;
|
|
104
|
+
}
|
|
105
|
+
__call__(flowClass) {
|
|
106
|
+
flowClass.conversational_config = this;
|
|
107
|
+
return flowClass;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var ConversationMessage = class {
|
|
111
|
+
role;
|
|
112
|
+
content;
|
|
113
|
+
name;
|
|
114
|
+
tool_call_id;
|
|
115
|
+
toolCallId;
|
|
116
|
+
tool_calls;
|
|
117
|
+
toolCalls;
|
|
118
|
+
files;
|
|
119
|
+
metadata;
|
|
120
|
+
constructor(options) {
|
|
121
|
+
this.role = options.role;
|
|
122
|
+
this.content = options.content;
|
|
123
|
+
this.name = options.name ?? null;
|
|
124
|
+
this.tool_call_id = options.tool_call_id ?? options.toolCallId ?? null;
|
|
125
|
+
this.toolCallId = this.tool_call_id;
|
|
126
|
+
this.tool_calls = options.tool_calls ?? options.toolCalls ?? null;
|
|
127
|
+
this.toolCalls = this.tool_calls;
|
|
128
|
+
this.files = options.files ?? null;
|
|
129
|
+
this.metadata = options.metadata ?? {};
|
|
130
|
+
}
|
|
131
|
+
modelDump(options = {}) {
|
|
132
|
+
return compactObject({
|
|
133
|
+
role: this.role,
|
|
134
|
+
content: this.content,
|
|
135
|
+
name: this.name,
|
|
136
|
+
tool_call_id: this.tool_call_id,
|
|
137
|
+
tool_calls: this.tool_calls,
|
|
138
|
+
files: this.files,
|
|
139
|
+
metadata: this.metadata
|
|
140
|
+
}, options.excludeNone ?? options.exclude_none ?? false);
|
|
141
|
+
}
|
|
142
|
+
model_dump(options = {}) {
|
|
143
|
+
return this.modelDump(options);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var AgentMessage = class {
|
|
147
|
+
role;
|
|
148
|
+
content;
|
|
149
|
+
metadata;
|
|
150
|
+
constructor(options) {
|
|
151
|
+
this.role = options.role ?? "assistant";
|
|
152
|
+
this.content = options.content;
|
|
153
|
+
this.metadata = options.metadata ?? {};
|
|
154
|
+
}
|
|
155
|
+
model_dump(options = {}) {
|
|
156
|
+
return compactObject({ role: this.role, content: this.content, metadata: this.metadata }, options.excludeNone ?? options.exclude_none ?? false);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var ConversationEvent = class {
|
|
160
|
+
type;
|
|
161
|
+
payload;
|
|
162
|
+
agent_name;
|
|
163
|
+
agentName;
|
|
164
|
+
visibility;
|
|
165
|
+
constructor(options) {
|
|
166
|
+
this.type = options.type;
|
|
167
|
+
this.payload = options.payload ?? {};
|
|
168
|
+
this.agent_name = options.agent_name ?? options.agentName ?? null;
|
|
169
|
+
this.agentName = this.agent_name;
|
|
170
|
+
this.visibility = options.visibility ?? "private";
|
|
171
|
+
}
|
|
172
|
+
model_dump(options = {}) {
|
|
173
|
+
return compactObject({
|
|
174
|
+
type: this.type,
|
|
175
|
+
payload: this.payload,
|
|
176
|
+
agent_name: this.agent_name,
|
|
177
|
+
visibility: this.visibility
|
|
178
|
+
}, options.excludeNone ?? options.exclude_none ?? false);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
var ConversationState = class {
|
|
182
|
+
id;
|
|
183
|
+
messages;
|
|
184
|
+
current_user_message;
|
|
185
|
+
currentUserMessage;
|
|
186
|
+
last_user_message;
|
|
187
|
+
lastUserMessage;
|
|
188
|
+
last_intent;
|
|
189
|
+
lastIntent;
|
|
190
|
+
ended;
|
|
191
|
+
events;
|
|
192
|
+
agent_threads;
|
|
193
|
+
agentThreads;
|
|
194
|
+
session_ready;
|
|
195
|
+
sessionReady;
|
|
196
|
+
constructor(options = {}) {
|
|
197
|
+
this.id = options.id ?? (0, import_node_crypto.randomUUID)();
|
|
198
|
+
this.messages = (options.messages ?? []).map((message) => message instanceof ConversationMessage ? message : new ConversationMessage(message));
|
|
199
|
+
this.current_user_message = options.current_user_message ?? options.currentUserMessage ?? null;
|
|
200
|
+
this.currentUserMessage = this.current_user_message;
|
|
201
|
+
this.last_user_message = options.last_user_message ?? options.lastUserMessage ?? null;
|
|
202
|
+
this.lastUserMessage = this.last_user_message;
|
|
203
|
+
this.last_intent = options.last_intent ?? options.lastIntent ?? null;
|
|
204
|
+
this.lastIntent = this.last_intent;
|
|
205
|
+
this.ended = options.ended ?? false;
|
|
206
|
+
this.events = (options.events ?? []).map((event) => event instanceof ConversationEvent ? event : new ConversationEvent(event));
|
|
207
|
+
this.agent_threads = Object.fromEntries(
|
|
208
|
+
Object.entries(options.agent_threads ?? options.agentThreads ?? {}).map(([agent, messages]) => [
|
|
209
|
+
agent,
|
|
210
|
+
messages.map((message) => message instanceof AgentMessage ? message : new AgentMessage(message))
|
|
211
|
+
])
|
|
212
|
+
);
|
|
213
|
+
this.agentThreads = this.agent_threads;
|
|
214
|
+
this.session_ready = options.session_ready ?? options.sessionReady ?? false;
|
|
215
|
+
this.sessionReady = this.session_ready;
|
|
216
|
+
}
|
|
217
|
+
isReady() {
|
|
218
|
+
return this.session_ready;
|
|
219
|
+
}
|
|
220
|
+
is_ready() {
|
|
221
|
+
return this.isReady();
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
function messageToLlmDict(message) {
|
|
225
|
+
const data = message instanceof ConversationMessage ? message.model_dump({ exclude_none: true }) : isRecord(message) ? { ...message } : { role: "user", content: stringifyMessageContent(message) };
|
|
226
|
+
Reflect.deleteProperty(data, "metadata");
|
|
227
|
+
return data;
|
|
228
|
+
}
|
|
229
|
+
var message_to_llm_dict = messageToLlmDict;
|
|
230
|
+
function _conversational_only(func) {
|
|
231
|
+
func.__conversational_only__ = true;
|
|
232
|
+
return func;
|
|
233
|
+
}
|
|
234
|
+
function compactObject(record, excludeNone) {
|
|
235
|
+
if (!excludeNone) {
|
|
236
|
+
return record;
|
|
237
|
+
}
|
|
238
|
+
return Object.fromEntries(Object.entries(record).filter(([, value]) => value !== null && value !== void 0));
|
|
239
|
+
}
|
|
240
|
+
function isRecord(value) {
|
|
241
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
242
|
+
}
|
|
243
|
+
function stringifyMessageContent(value) {
|
|
244
|
+
if (typeof value === "string") {
|
|
245
|
+
return value;
|
|
246
|
+
}
|
|
247
|
+
if (value === null || value === void 0) {
|
|
248
|
+
return "";
|
|
249
|
+
}
|
|
250
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
251
|
+
return String(value);
|
|
252
|
+
}
|
|
253
|
+
try {
|
|
254
|
+
return JSON.stringify(value);
|
|
255
|
+
} catch {
|
|
256
|
+
return Object.prototype.toString.call(value);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
260
|
+
0 && (module.exports = {
|
|
261
|
+
AgentMessage,
|
|
262
|
+
ConversationConfig,
|
|
263
|
+
ConversationEvent,
|
|
264
|
+
ConversationEventVisibility,
|
|
265
|
+
ConversationMessage,
|
|
266
|
+
ConversationMessageRole,
|
|
267
|
+
ConversationState,
|
|
268
|
+
RouterConfig,
|
|
269
|
+
_conversational_only,
|
|
270
|
+
messageToLlmDict,
|
|
271
|
+
message_to_llm_dict
|
|
272
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentMessage,
|
|
3
|
+
ConversationConfig,
|
|
4
|
+
ConversationEvent,
|
|
5
|
+
ConversationEventVisibility,
|
|
6
|
+
ConversationMessage,
|
|
7
|
+
ConversationMessageRole,
|
|
8
|
+
ConversationState,
|
|
9
|
+
RouterConfig,
|
|
10
|
+
_conversational_only,
|
|
11
|
+
messageToLlmDict,
|
|
12
|
+
message_to_llm_dict
|
|
13
|
+
} from "./chunk-RH43TNKN.js";
|
|
14
|
+
export {
|
|
15
|
+
AgentMessage,
|
|
16
|
+
ConversationConfig,
|
|
17
|
+
ConversationEvent,
|
|
18
|
+
ConversationEventVisibility,
|
|
19
|
+
ConversationMessage,
|
|
20
|
+
ConversationMessageRole,
|
|
21
|
+
ConversationState,
|
|
22
|
+
RouterConfig,
|
|
23
|
+
_conversational_only,
|
|
24
|
+
messageToLlmDict,
|
|
25
|
+
message_to_llm_dict
|
|
26
|
+
};
|