@falai/agent 0.9.0 → 0.9.2
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/README.md +42 -34
- package/dist/cjs/src/core/Agent.d.ts +19 -5
- package/dist/cjs/src/core/Agent.d.ts.map +1 -1
- package/dist/cjs/src/core/Agent.js +79 -35
- package/dist/cjs/src/core/Agent.js.map +1 -1
- package/dist/cjs/src/core/ResponseModal.d.ts +9 -3
- package/dist/cjs/src/core/ResponseModal.d.ts.map +1 -1
- package/dist/cjs/src/core/ResponseModal.js +121 -55
- package/dist/cjs/src/core/ResponseModal.js.map +1 -1
- package/dist/cjs/src/core/ResponsePipeline.d.ts +8 -4
- package/dist/cjs/src/core/ResponsePipeline.d.ts.map +1 -1
- package/dist/cjs/src/core/ResponsePipeline.js +47 -19
- package/dist/cjs/src/core/ResponsePipeline.js.map +1 -1
- package/dist/cjs/src/core/Route.d.ts +12 -5
- package/dist/cjs/src/core/Route.d.ts.map +1 -1
- package/dist/cjs/src/core/Route.js +26 -5
- package/dist/cjs/src/core/Route.js.map +1 -1
- package/dist/cjs/src/core/RoutingEngine.d.ts +5 -0
- package/dist/cjs/src/core/RoutingEngine.d.ts.map +1 -1
- package/dist/cjs/src/core/RoutingEngine.js +37 -25
- package/dist/cjs/src/core/RoutingEngine.js.map +1 -1
- package/dist/cjs/src/core/SessionManager.d.ts +9 -1
- package/dist/cjs/src/core/SessionManager.d.ts.map +1 -1
- package/dist/cjs/src/core/SessionManager.js +27 -5
- package/dist/cjs/src/core/SessionManager.js.map +1 -1
- package/dist/cjs/src/core/Step.d.ts +60 -7
- package/dist/cjs/src/core/Step.d.ts.map +1 -1
- package/dist/cjs/src/core/Step.js +151 -4
- package/dist/cjs/src/core/Step.js.map +1 -1
- package/dist/cjs/src/core/ToolManager.d.ts +234 -0
- package/dist/cjs/src/core/ToolManager.d.ts.map +1 -0
- package/dist/cjs/src/core/ToolManager.js +1117 -0
- package/dist/cjs/src/core/ToolManager.js.map +1 -0
- package/dist/cjs/src/index.d.ts +2 -3
- package/dist/cjs/src/index.d.ts.map +1 -1
- package/dist/cjs/src/index.js +5 -3
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/types/agent.d.ts +1 -1
- package/dist/cjs/src/types/agent.d.ts.map +1 -1
- package/dist/cjs/src/types/index.d.ts +3 -2
- package/dist/cjs/src/types/index.d.ts.map +1 -1
- package/dist/cjs/src/types/index.js +3 -1
- package/dist/cjs/src/types/index.js.map +1 -1
- package/dist/cjs/src/types/route.d.ts +6 -4
- package/dist/cjs/src/types/route.d.ts.map +1 -1
- package/dist/cjs/src/types/tool.d.ts +84 -14
- package/dist/cjs/src/types/tool.d.ts.map +1 -1
- package/dist/cjs/src/types/tool.js +13 -0
- package/dist/cjs/src/types/tool.js.map +1 -1
- package/dist/src/core/Agent.d.ts +19 -5
- package/dist/src/core/Agent.d.ts.map +1 -1
- package/dist/src/core/Agent.js +79 -35
- package/dist/src/core/Agent.js.map +1 -1
- package/dist/src/core/ResponseModal.d.ts +9 -3
- package/dist/src/core/ResponseModal.d.ts.map +1 -1
- package/dist/src/core/ResponseModal.js +121 -55
- package/dist/src/core/ResponseModal.js.map +1 -1
- package/dist/src/core/ResponsePipeline.d.ts +8 -4
- package/dist/src/core/ResponsePipeline.d.ts.map +1 -1
- package/dist/src/core/ResponsePipeline.js +47 -19
- package/dist/src/core/ResponsePipeline.js.map +1 -1
- package/dist/src/core/Route.d.ts +12 -5
- package/dist/src/core/Route.d.ts.map +1 -1
- package/dist/src/core/Route.js +26 -5
- package/dist/src/core/Route.js.map +1 -1
- package/dist/src/core/RoutingEngine.d.ts +5 -0
- package/dist/src/core/RoutingEngine.d.ts.map +1 -1
- package/dist/src/core/RoutingEngine.js +37 -25
- package/dist/src/core/RoutingEngine.js.map +1 -1
- package/dist/src/core/SessionManager.d.ts +9 -1
- package/dist/src/core/SessionManager.d.ts.map +1 -1
- package/dist/src/core/SessionManager.js +27 -5
- package/dist/src/core/SessionManager.js.map +1 -1
- package/dist/src/core/Step.d.ts +60 -7
- package/dist/src/core/Step.d.ts.map +1 -1
- package/dist/src/core/Step.js +151 -4
- package/dist/src/core/Step.js.map +1 -1
- package/dist/src/core/ToolManager.d.ts +234 -0
- package/dist/src/core/ToolManager.d.ts.map +1 -0
- package/dist/src/core/ToolManager.js +1111 -0
- package/dist/src/core/ToolManager.js.map +1 -0
- package/dist/src/index.d.ts +2 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/agent.d.ts +1 -1
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +3 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -0
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/route.d.ts +6 -4
- package/dist/src/types/route.d.ts.map +1 -1
- package/dist/src/types/tool.d.ts +84 -14
- package/dist/src/types/tool.d.ts.map +1 -1
- package/dist/src/types/tool.js +12 -1
- package/dist/src/types/tool.js.map +1 -1
- package/docs/CONTRIBUTING.md +40 -0
- package/docs/README.md +12 -5
- package/docs/api/README.md +75 -45
- package/docs/api/overview.md +74 -32
- package/docs/core/agent/session-management.md +152 -5
- package/docs/core/ai-integration/response-processing.md +115 -4
- package/docs/core/conversation-flows/routes.md +130 -0
- package/docs/core/error-handling.md +638 -0
- package/docs/core/tools/tool-definition.md +684 -60
- package/docs/core/tools/tool-scoping.md +244 -53
- package/docs/guides/error-handling-patterns.md +578 -0
- package/docs/guides/getting-started/README.md +139 -28
- package/examples/advanced-patterns/knowledge-based-agent.ts +6 -6
- package/examples/advanced-patterns/persistent-onboarding.ts +30 -43
- package/examples/ai-providers/anthropic-integration.ts +9 -5
- package/examples/ai-providers/openai-integration.ts +11 -7
- package/examples/core-concepts/basic-agent.ts +106 -67
- package/examples/core-concepts/schema-driven-extraction.ts +10 -7
- package/examples/core-concepts/session-management.ts +71 -18
- package/examples/integrations/healthcare-integration.ts +15 -29
- package/examples/integrations/server-session-management.ts +3 -3
- package/examples/persistence/memory-sessions.ts +3 -3
- package/examples/tools/basic-tools.ts +293 -89
- package/examples/tools/data-enrichment-tools.ts +185 -75
- package/package.json +1 -1
- package/src/core/Agent.ts +98 -44
- package/src/core/ResponseModal.ts +148 -72
- package/src/core/ResponsePipeline.ts +82 -56
- package/src/core/Route.ts +39 -12
- package/src/core/RoutingEngine.ts +46 -42
- package/src/core/SessionManager.ts +39 -7
- package/src/core/Step.ts +198 -20
- package/src/core/ToolManager.ts +1394 -0
- package/src/index.ts +8 -3
- package/src/types/agent.ts +1 -1
- package/src/types/index.ts +13 -2
- package/src/types/route.ts +6 -4
- package/src/types/tool.ts +116 -25
- package/dist/cjs/src/core/ToolExecutor.d.ts +0 -45
- package/dist/cjs/src/core/ToolExecutor.d.ts.map +0 -1
- package/dist/cjs/src/core/ToolExecutor.js +0 -84
- package/dist/cjs/src/core/ToolExecutor.js.map +0 -1
- package/dist/src/core/ToolExecutor.d.ts +0 -45
- package/dist/src/core/ToolExecutor.d.ts.map +0 -1
- package/dist/src/core/ToolExecutor.js +0 -80
- package/dist/src/core/ToolExecutor.js.map +0 -1
- package/docs/core/tools/tool-execution.md +0 -815
- package/src/core/ToolExecutor.ts +0 -126
package/src/index.ts
CHANGED
|
@@ -18,8 +18,7 @@ export type {
|
|
|
18
18
|
export { adaptEvent, convertHistoryToEvents } from "./core/Events";
|
|
19
19
|
export { PersistenceManager } from "./core/PersistenceManager";
|
|
20
20
|
export { SessionManager } from "./core/SessionManager";
|
|
21
|
-
export {
|
|
22
|
-
export type { ToolExecutionResult } from "./core/ToolExecutor";
|
|
21
|
+
export { ToolManager, ToolCreationError, ToolExecutionError } from "./core/ToolManager";
|
|
23
22
|
|
|
24
23
|
// Providers
|
|
25
24
|
export { GeminiProvider } from "./providers/GeminiProvider";
|
|
@@ -102,7 +101,6 @@ export type {
|
|
|
102
101
|
StepRef,
|
|
103
102
|
RouteOptions,
|
|
104
103
|
StepOptions,
|
|
105
|
-
StepResult,
|
|
106
104
|
RouteTransitionConfig,
|
|
107
105
|
RouteCompletionHandler,
|
|
108
106
|
SessionState,
|
|
@@ -111,6 +109,13 @@ export type {
|
|
|
111
109
|
ToolResult,
|
|
112
110
|
ToolHandler,
|
|
113
111
|
Tool,
|
|
112
|
+
|
|
113
|
+
DataEnrichmentConfig,
|
|
114
|
+
ValidationConfig,
|
|
115
|
+
ValidationError,
|
|
116
|
+
ApiCallConfig,
|
|
117
|
+
ComputationConfig,
|
|
118
|
+
ToolScope,
|
|
114
119
|
AiProvider,
|
|
115
120
|
GenerateMessageInput,
|
|
116
121
|
GenerateMessageOutput,
|
package/src/types/agent.ts
CHANGED
|
@@ -99,7 +99,7 @@ export interface AgentOptions<TContext = unknown, TData = unknown> {
|
|
|
99
99
|
/** Initial guidelines for agent behavior */
|
|
100
100
|
guidelines?: Guideline<TContext, TData>[];
|
|
101
101
|
/** Global tools available to all routes */
|
|
102
|
-
tools?: Tool<TContext, TData, unknown
|
|
102
|
+
tools?: Tool<TContext, TData, unknown>[];
|
|
103
103
|
/** Initial routes (will be instantiated as Route objects) */
|
|
104
104
|
routes?: RouteOptions<TContext, TData>[];
|
|
105
105
|
/** Optional persistence configuration for auto-saving sessions and messages */
|
package/src/types/index.ts
CHANGED
|
@@ -45,8 +45,8 @@ export type {
|
|
|
45
45
|
RouteRef,
|
|
46
46
|
StepRef,
|
|
47
47
|
StepOptions,
|
|
48
|
-
StepResult,
|
|
49
48
|
BranchSpec,
|
|
49
|
+
StepResult,
|
|
50
50
|
BranchResult,
|
|
51
51
|
RouteCompletionHandler,
|
|
52
52
|
RouteTransitionConfig,
|
|
@@ -58,7 +58,18 @@ export * from "./route";
|
|
|
58
58
|
export type { SessionState, PendingTransition } from "./session";
|
|
59
59
|
|
|
60
60
|
// Tool types
|
|
61
|
-
export type {
|
|
61
|
+
export type {
|
|
62
|
+
Tool,
|
|
63
|
+
ToolContext,
|
|
64
|
+
ToolResult,
|
|
65
|
+
ToolHandler,
|
|
66
|
+
ToolExecutionResult,
|
|
67
|
+
DataEnrichmentConfig,
|
|
68
|
+
ValidationConfig,
|
|
69
|
+
ApiCallConfig,
|
|
70
|
+
ComputationConfig
|
|
71
|
+
} from "./tool";
|
|
72
|
+
export { ToolScope } from "./tool";
|
|
62
73
|
|
|
63
74
|
// AI provider types
|
|
64
75
|
export type {
|
package/src/types/route.ts
CHANGED
|
@@ -104,7 +104,7 @@ export interface RouteOptions<TContext = unknown, TData = unknown> {
|
|
|
104
104
|
/** Initial terms for the route's domain glossary */
|
|
105
105
|
terms?: Term<TContext>[];
|
|
106
106
|
/** Tools available in this route */
|
|
107
|
-
tools?: Tool<TContext, TData
|
|
107
|
+
tools?: Tool<TContext, TData>[];
|
|
108
108
|
/** Absolute rules the agent must follow in this route */
|
|
109
109
|
rules?: Template<TContext, TData>[];
|
|
110
110
|
/** Absolute prohibitions the agent must never do in this route */
|
|
@@ -197,16 +197,16 @@ export interface StepOptions<TContext = unknown, TData = unknown> {
|
|
|
197
197
|
/** Transition to a chat state with this description */
|
|
198
198
|
prompt?: Template<TContext, TData>;
|
|
199
199
|
/** Tools available for AI to call in this step (by ID reference or inline definition) */
|
|
200
|
-
tools?: (string | Tool<TContext, TData
|
|
200
|
+
tools?: (string | Tool<TContext, TData>)[];
|
|
201
201
|
/** Programmatic function or tool to run before AI responds */
|
|
202
202
|
prepare?:
|
|
203
203
|
| string
|
|
204
|
-
| Tool<TContext, TData
|
|
204
|
+
| Tool<TContext, TData>
|
|
205
205
|
| ((context: TContext, data?: Partial<TData>) => void | Promise<void>);
|
|
206
206
|
/** Programmatic function or tool to run after AI responds */
|
|
207
207
|
finalize?:
|
|
208
208
|
| string
|
|
209
|
-
| Tool<TContext, TData
|
|
209
|
+
| Tool<TContext, TData>
|
|
210
210
|
| ((context: TContext, data?: Partial<TData>) => void | Promise<void>);
|
|
211
211
|
/** Transition to a specific step or end marker */
|
|
212
212
|
step?: StepRef | symbol;
|
|
@@ -267,4 +267,6 @@ export interface StepResult<TContext = unknown, TData = unknown>
|
|
|
267
267
|
branch: (
|
|
268
268
|
branches: BranchSpec<TContext, TData>[]
|
|
269
269
|
) => BranchResult<TContext, TData>;
|
|
270
|
+
/** Shortcut to end the current route */
|
|
271
|
+
endRoute: (options?: Omit<StepOptions<TContext, TData>, "step">) => StepResult<TContext, TData>;
|
|
270
272
|
}
|
package/src/types/tool.ts
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
|
+
/* eslint @typescript-eslint/no-explicit-any: "off"*/
|
|
1
2
|
/**
|
|
2
3
|
* Tool system type definitions
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import type { Event, StepRef } from "./index";
|
|
6
|
+
import type { Event, StepRef, ValidationResult } from "./index";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Context provided to tool handlers
|
|
9
10
|
*/
|
|
10
|
-
export interface ToolContext<TContext =
|
|
11
|
+
export interface ToolContext<TContext = any, TData = any> {
|
|
11
12
|
/** The agent's context data */
|
|
12
13
|
context: TContext;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/** Update the agent's collected data (triggers lifecycle hooks if configured) */
|
|
16
|
-
updateData: (updates: Partial<TData>) => Promise<void>;
|
|
17
|
-
/** Current step reference (if in a route) */
|
|
18
|
-
step?: StepRef;
|
|
14
|
+
/** Complete agent-level data collected so far */
|
|
15
|
+
data: Partial<TData>;
|
|
19
16
|
/** Interaction history */
|
|
20
17
|
history: Event[];
|
|
21
|
-
/**
|
|
22
|
-
|
|
18
|
+
/** Current step reference (if in a route) */
|
|
19
|
+
step?: StepRef;
|
|
23
20
|
/** Additional metadata */
|
|
24
21
|
metadata?: Record<string, unknown>;
|
|
22
|
+
|
|
23
|
+
/** Update the agent's context (triggers lifecycle hooks if configured) */
|
|
24
|
+
updateContext: (updates: Partial<TContext>) => Promise<void>;
|
|
25
|
+
/** Update the agent's collected data (triggers lifecycle hooks if configured) */
|
|
26
|
+
updateData: (updates: Partial<TData>) => Promise<void>;
|
|
27
|
+
/** Get a specific field from collected data */
|
|
28
|
+
getField<K extends keyof TData>(key: K): TData[K] | undefined;
|
|
29
|
+
/** Set a specific field in collected data */
|
|
30
|
+
setField<K extends keyof TData>(key: K, value: TData[K]): Promise<void>;
|
|
31
|
+
/** Check if a field exists in collected data */
|
|
32
|
+
hasField<K extends keyof TData>(key: K): boolean;
|
|
25
33
|
}
|
|
26
34
|
|
|
27
35
|
/**
|
|
28
36
|
* Result returned by a tool
|
|
29
37
|
*/
|
|
30
38
|
export interface ToolResult<
|
|
31
|
-
TResultData =
|
|
32
|
-
TContext =
|
|
33
|
-
TData =
|
|
39
|
+
TResultData = any,
|
|
40
|
+
TContext = any,
|
|
41
|
+
TData = any
|
|
34
42
|
> {
|
|
35
43
|
/** The result data */
|
|
36
44
|
data?: TResultData;
|
|
@@ -50,34 +58,117 @@ export interface ToolResult<
|
|
|
50
58
|
* Handler function for a tool
|
|
51
59
|
*/
|
|
52
60
|
export type ToolHandler<
|
|
53
|
-
TContext,
|
|
54
|
-
TData =
|
|
55
|
-
|
|
56
|
-
TResult = unknown
|
|
61
|
+
TContext = any,
|
|
62
|
+
TData = any,
|
|
63
|
+
TResult = any
|
|
57
64
|
> = (
|
|
58
65
|
context: ToolContext<TContext, TData>,
|
|
59
|
-
|
|
66
|
+
args?: Record<string, unknown>
|
|
60
67
|
) =>
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
| Promise<TResult | ToolResult<TResult, TContext, TData>>
|
|
69
|
+
| TResult
|
|
70
|
+
| ToolResult<TResult, TContext, TData>;
|
|
63
71
|
|
|
64
72
|
/**
|
|
65
73
|
* Tool definition - plain object interface
|
|
66
74
|
*/
|
|
67
75
|
export interface Tool<
|
|
68
|
-
TContext =
|
|
69
|
-
TData =
|
|
70
|
-
|
|
71
|
-
TResult = unknown
|
|
76
|
+
TContext = any,
|
|
77
|
+
TData = any,
|
|
78
|
+
TResult = any
|
|
72
79
|
> {
|
|
73
80
|
/** Tool identifier */
|
|
74
81
|
id: string;
|
|
75
82
|
/** Tool display name (shown to AI models) */
|
|
76
83
|
name?: string;
|
|
77
84
|
/** Tool handler function */
|
|
78
|
-
handler: ToolHandler<TContext, TData,
|
|
85
|
+
handler: ToolHandler<TContext, TData, TResult>;
|
|
79
86
|
/** Description of what the tool does (for AI discovery) */
|
|
80
87
|
description?: string;
|
|
81
88
|
/** Parameter schema or description */
|
|
82
89
|
parameters?: unknown;
|
|
83
90
|
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Tool execution result
|
|
96
|
+
*/
|
|
97
|
+
export interface ToolExecutionResult {
|
|
98
|
+
success: boolean;
|
|
99
|
+
data?: unknown;
|
|
100
|
+
error?: string;
|
|
101
|
+
contextUpdate?: Record<string, unknown>;
|
|
102
|
+
dataUpdate?: Record<string, unknown>;
|
|
103
|
+
metadata?: Record<string, unknown>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Tool scope enumeration
|
|
108
|
+
*/
|
|
109
|
+
export enum ToolScope {
|
|
110
|
+
AGENT = 'agent',
|
|
111
|
+
ROUTE = 'route',
|
|
112
|
+
STEP = 'step',
|
|
113
|
+
REGISTERED = 'registered',
|
|
114
|
+
ALL = 'all'
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Configuration for data enrichment tools
|
|
121
|
+
*/
|
|
122
|
+
export interface DataEnrichmentConfig<TContext, TData, TFields extends keyof TData> {
|
|
123
|
+
id: string;
|
|
124
|
+
name?: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
fields: TFields[];
|
|
127
|
+
enricher: (
|
|
128
|
+
context: TContext,
|
|
129
|
+
data: Pick<TData, TFields>
|
|
130
|
+
) => Promise<Partial<TData>> | Partial<TData>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Configuration for validation tools
|
|
135
|
+
*/
|
|
136
|
+
export interface ValidationConfig<TContext, TData, TFields extends keyof TData> {
|
|
137
|
+
id: string;
|
|
138
|
+
name?: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
fields: TFields[];
|
|
141
|
+
validator: (
|
|
142
|
+
context: TContext,
|
|
143
|
+
data: Pick<TData, TFields>
|
|
144
|
+
) => Promise<ValidationResult> | ValidationResult;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Configuration for API call tools
|
|
149
|
+
*/
|
|
150
|
+
export interface ApiCallConfig<TContext, TData, TResult> {
|
|
151
|
+
id: string;
|
|
152
|
+
name?: string;
|
|
153
|
+
description?: string;
|
|
154
|
+
endpoint: string | ((context: TContext, data: Partial<TData>) => string);
|
|
155
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
156
|
+
headers?: Record<string, string> | ((context: TContext) => Record<string, string>);
|
|
157
|
+
body?: (context: TContext, data: Partial<TData>, args?: Record<string, unknown>) => unknown;
|
|
158
|
+
transform?: (response: unknown) => TResult;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Configuration for computation tools
|
|
163
|
+
*/
|
|
164
|
+
export interface ComputationConfig<TContext, TData, TResult> {
|
|
165
|
+
id: string;
|
|
166
|
+
name?: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
inputs: (keyof TData)[];
|
|
169
|
+
compute: (
|
|
170
|
+
context: TContext,
|
|
171
|
+
inputs: Partial<TData>,
|
|
172
|
+
args?: Record<string, unknown>
|
|
173
|
+
) => Promise<TResult> | TResult;
|
|
174
|
+
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ToolExecutor - Simple utility for executing tools with context
|
|
3
|
-
*
|
|
4
|
-
* Tools execute BEFORE message generation to enrich context with data.
|
|
5
|
-
* The LLM sees the enriched context when generating responses.
|
|
6
|
-
*/
|
|
7
|
-
import type { Event, Tool } from "../types";
|
|
8
|
-
export interface ToolExecutionResult {
|
|
9
|
-
toolName: string;
|
|
10
|
-
success: boolean;
|
|
11
|
-
data?: unknown;
|
|
12
|
-
contextUpdate?: Record<string, unknown>;
|
|
13
|
-
dataUpdate?: Record<string, unknown>;
|
|
14
|
-
error?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ExecuteToolParams<TContext = unknown, TData = unknown> {
|
|
17
|
-
tool: Tool<TContext, TData, unknown[], unknown>;
|
|
18
|
-
context: TContext;
|
|
19
|
-
updateContext: (updates: Partial<TContext>) => Promise<void>;
|
|
20
|
-
updateData: (updates: Partial<TData>) => Promise<void>;
|
|
21
|
-
history: Event[];
|
|
22
|
-
data?: Partial<TData>;
|
|
23
|
-
toolArguments?: Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
export interface ExecuteToolsParams<TContext = unknown, TData = unknown> {
|
|
26
|
-
tools: Array<Tool<TContext, TData, unknown[], unknown>>;
|
|
27
|
-
context: TContext;
|
|
28
|
-
updateContext: (updates: Partial<TContext>) => Promise<void>;
|
|
29
|
-
updateData: (updates: Partial<TData>) => Promise<void>;
|
|
30
|
-
history: Event[];
|
|
31
|
-
data?: Partial<TData>;
|
|
32
|
-
}
|
|
33
|
-
export declare class ToolExecutor<TContext = unknown, TData = unknown> {
|
|
34
|
-
/**
|
|
35
|
-
* Execute a single tool with context and collected data
|
|
36
|
-
* @param params - Execution parameters
|
|
37
|
-
*/
|
|
38
|
-
executeTool(params: ExecuteToolParams<TContext, TData>): Promise<ToolExecutionResult>;
|
|
39
|
-
/**
|
|
40
|
-
* Execute multiple tools in sequence
|
|
41
|
-
* @param params - Execution parameters
|
|
42
|
-
*/
|
|
43
|
-
executeTools(params: ExecuteToolsParams<TContext, TData>): Promise<ToolExecutionResult[]>;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=ToolExecutor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolExecutor.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C,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACvB;AAED,qBAAa,YAAY,CAAC,QAAQ,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO;IAC3D;;;OAGG;IACG,WAAW,CACf,MAAM,EAAE,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC;IAsC/B;;;OAGG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,GAC1C,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAqClC"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* ToolExecutor - Simple utility for executing tools with context
|
|
4
|
-
*
|
|
5
|
-
* Tools execute BEFORE message generation to enrich context with data.
|
|
6
|
-
* The LLM sees the enriched context when generating responses.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ToolExecutor = void 0;
|
|
10
|
-
class ToolExecutor {
|
|
11
|
-
/**
|
|
12
|
-
* Execute a single tool with context and collected data
|
|
13
|
-
* @param params - Execution parameters
|
|
14
|
-
*/
|
|
15
|
-
async executeTool(params) {
|
|
16
|
-
const { tool, context, updateContext, updateData, history, data, toolArguments } = params;
|
|
17
|
-
try {
|
|
18
|
-
// Build tool context with complete agent data
|
|
19
|
-
const toolContext = {
|
|
20
|
-
context,
|
|
21
|
-
updateContext,
|
|
22
|
-
updateData,
|
|
23
|
-
history,
|
|
24
|
-
data,
|
|
25
|
-
};
|
|
26
|
-
// Execute tool
|
|
27
|
-
const result = await tool.handler(toolContext, toolArguments);
|
|
28
|
-
// Apply data updates from tool result
|
|
29
|
-
if (result.dataUpdate) {
|
|
30
|
-
await updateData(result.dataUpdate);
|
|
31
|
-
}
|
|
32
|
-
// Return execution result
|
|
33
|
-
return {
|
|
34
|
-
toolName: tool.id || "unknown",
|
|
35
|
-
success: true,
|
|
36
|
-
data: result.data,
|
|
37
|
-
contextUpdate: result.contextUpdate,
|
|
38
|
-
dataUpdate: result.dataUpdate,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
return {
|
|
43
|
-
toolName: tool.id || "unknown",
|
|
44
|
-
success: false,
|
|
45
|
-
error: error instanceof Error ? error.message : String(error),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Execute multiple tools in sequence
|
|
51
|
-
* @param params - Execution parameters
|
|
52
|
-
*/
|
|
53
|
-
async executeTools(params) {
|
|
54
|
-
const { tools, context, updateContext, updateData, history, data } = params;
|
|
55
|
-
const results = [];
|
|
56
|
-
for (const tool of tools) {
|
|
57
|
-
const result = await this.executeTool({
|
|
58
|
-
tool,
|
|
59
|
-
context,
|
|
60
|
-
updateContext,
|
|
61
|
-
updateData,
|
|
62
|
-
history,
|
|
63
|
-
data,
|
|
64
|
-
});
|
|
65
|
-
results.push(result);
|
|
66
|
-
// If tool failed, stop execution chain
|
|
67
|
-
if (!result.success) {
|
|
68
|
-
console.error(`[ToolExecutor] Tool ${tool.id || "unknown"} failed:`, result.error);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
// Apply context updates from tool result
|
|
72
|
-
if (result.contextUpdate) {
|
|
73
|
-
await updateContext(result.contextUpdate);
|
|
74
|
-
}
|
|
75
|
-
// Apply data updates from tool result
|
|
76
|
-
if (result.dataUpdate) {
|
|
77
|
-
await updateData(result.dataUpdate);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return results;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.ToolExecutor = ToolExecutor;
|
|
84
|
-
//# sourceMappingURL=ToolExecutor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolExecutor.js","sourceRoot":"","sources":["../../../../src/core/ToolExecutor.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAgCH,MAAa,YAAY;IACvB;;;OAGG;IACH,KAAK,CAAC,WAAW,CACf,MAA0C;QAE1C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,GAC9E,MAAM,CAAC;QACT,IAAI,CAAC;YACH,8CAA8C;YAC9C,MAAM,WAAW,GAAiC;gBAChD,OAAO;gBACP,aAAa;gBACb,UAAU;gBACV,OAAO;gBACP,IAAI;aACL,CAAC;YAEF,eAAe;YACf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YAE9D,sCAAsC;YACtC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACtB,MAAM,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACtC,CAAC;YAED,0BAA0B;YAC1B,OAAO;gBACL,QAAQ,EAAE,IAAI,CAAC,EAAE,IAAI,SAAS;gBAC9B,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,aAAa,EAAE,MAAM,CAAC,aAAa;gBACnC,UAAU,EAAE,MAAM,CAAC,UAAU;aAC9B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,IAAI,CAAC,EAAE,IAAI,SAAS;gBAC9B,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY,CAChB,MAA2C;QAE3C,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QAC5E,MAAM,OAAO,GAA0B,EAAE,CAAC;QAE1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;gBACpC,IAAI;gBACJ,OAAO;gBACP,aAAa;gBACb,UAAU;gBACV,OAAO;gBACP,IAAI;aACL,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAErB,uCAAuC;YACvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CACX,uBAAuB,IAAI,CAAC,EAAE,IAAI,SAAS,UAAU,EACrD,MAAM,CAAC,KAAK,CACb,CAAC;gBACF,MAAM;YACR,CAAC;YAED,yCAAyC;YACzC,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;gBACzB,MAAM,aAAa,CAAC,MAAM,CAAC,aAAkC,CAAC,CAAC;YACjE,CAAC;YAED,sCAAsC;YACtC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;gBACtB,MAAM,UAAU,CAAC,MAAM,CAAC,UAA4B,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAxFD,oCAwFC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ToolExecutor - Simple utility for executing tools with context
|
|
3
|
-
*
|
|
4
|
-
* Tools execute BEFORE message generation to enrich context with data.
|
|
5
|
-
* The LLM sees the enriched context when generating responses.
|
|
6
|
-
*/
|
|
7
|
-
import type { Event, Tool } from "../types";
|
|
8
|
-
export interface ToolExecutionResult {
|
|
9
|
-
toolName: string;
|
|
10
|
-
success: boolean;
|
|
11
|
-
data?: unknown;
|
|
12
|
-
contextUpdate?: Record<string, unknown>;
|
|
13
|
-
dataUpdate?: Record<string, unknown>;
|
|
14
|
-
error?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ExecuteToolParams<TContext = unknown, TData = unknown> {
|
|
17
|
-
tool: Tool<TContext, TData, unknown[], unknown>;
|
|
18
|
-
context: TContext;
|
|
19
|
-
updateContext: (updates: Partial<TContext>) => Promise<void>;
|
|
20
|
-
updateData: (updates: Partial<TData>) => Promise<void>;
|
|
21
|
-
history: Event[];
|
|
22
|
-
data?: Partial<TData>;
|
|
23
|
-
toolArguments?: Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
export interface ExecuteToolsParams<TContext = unknown, TData = unknown> {
|
|
26
|
-
tools: Array<Tool<TContext, TData, unknown[], unknown>>;
|
|
27
|
-
context: TContext;
|
|
28
|
-
updateContext: (updates: Partial<TContext>) => Promise<void>;
|
|
29
|
-
updateData: (updates: Partial<TData>) => Promise<void>;
|
|
30
|
-
history: Event[];
|
|
31
|
-
data?: Partial<TData>;
|
|
32
|
-
}
|
|
33
|
-
export declare class ToolExecutor<TContext = unknown, TData = unknown> {
|
|
34
|
-
/**
|
|
35
|
-
* Execute a single tool with context and collected data
|
|
36
|
-
* @param params - Execution parameters
|
|
37
|
-
*/
|
|
38
|
-
executeTool(params: ExecuteToolParams<TContext, TData>): Promise<ToolExecutionResult>;
|
|
39
|
-
/**
|
|
40
|
-
* Execute multiple tools in sequence
|
|
41
|
-
* @param params - Execution parameters
|
|
42
|
-
*/
|
|
43
|
-
executeTools(params: ExecuteToolsParams<TContext, TData>): Promise<ToolExecutionResult[]>;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=ToolExecutor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolExecutor.d.ts","sourceRoot":"","sources":["../../../src/core/Tool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AAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACvB;AAED,qBAAa,YAAY,CAAC,QAAQ,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO;IAC3D;;;OAGG;IACG,WAAW,CACf,MAAM,EAAE,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC;IAsC/B;;;OAGG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,GAC1C,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAqClC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ToolExecutor - Simple utility for executing tools with context
|
|
3
|
-
*
|
|
4
|
-
* Tools execute BEFORE message generation to enrich context with data.
|
|
5
|
-
* The LLM sees the enriched context when generating responses.
|
|
6
|
-
*/
|
|
7
|
-
export class ToolExecutor {
|
|
8
|
-
/**
|
|
9
|
-
* Execute a single tool with context and collected data
|
|
10
|
-
* @param params - Execution parameters
|
|
11
|
-
*/
|
|
12
|
-
async executeTool(params) {
|
|
13
|
-
const { tool, context, updateContext, updateData, history, data, toolArguments } = params;
|
|
14
|
-
try {
|
|
15
|
-
// Build tool context with complete agent data
|
|
16
|
-
const toolContext = {
|
|
17
|
-
context,
|
|
18
|
-
updateContext,
|
|
19
|
-
updateData,
|
|
20
|
-
history,
|
|
21
|
-
data,
|
|
22
|
-
};
|
|
23
|
-
// Execute tool
|
|
24
|
-
const result = await tool.handler(toolContext, toolArguments);
|
|
25
|
-
// Apply data updates from tool result
|
|
26
|
-
if (result.dataUpdate) {
|
|
27
|
-
await updateData(result.dataUpdate);
|
|
28
|
-
}
|
|
29
|
-
// Return execution result
|
|
30
|
-
return {
|
|
31
|
-
toolName: tool.id || "unknown",
|
|
32
|
-
success: true,
|
|
33
|
-
data: result.data,
|
|
34
|
-
contextUpdate: result.contextUpdate,
|
|
35
|
-
dataUpdate: result.dataUpdate,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
return {
|
|
40
|
-
toolName: tool.id || "unknown",
|
|
41
|
-
success: false,
|
|
42
|
-
error: error instanceof Error ? error.message : String(error),
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Execute multiple tools in sequence
|
|
48
|
-
* @param params - Execution parameters
|
|
49
|
-
*/
|
|
50
|
-
async executeTools(params) {
|
|
51
|
-
const { tools, context, updateContext, updateData, history, data } = params;
|
|
52
|
-
const results = [];
|
|
53
|
-
for (const tool of tools) {
|
|
54
|
-
const result = await this.executeTool({
|
|
55
|
-
tool,
|
|
56
|
-
context,
|
|
57
|
-
updateContext,
|
|
58
|
-
updateData,
|
|
59
|
-
history,
|
|
60
|
-
data,
|
|
61
|
-
});
|
|
62
|
-
results.push(result);
|
|
63
|
-
// If tool failed, stop execution chain
|
|
64
|
-
if (!result.success) {
|
|
65
|
-
console.error(`[ToolExecutor] Tool ${tool.id || "unknown"} failed:`, result.error);
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
// Apply context updates from tool result
|
|
69
|
-
if (result.contextUpdate) {
|
|
70
|
-
await updateContext(result.contextUpdate);
|
|
71
|
-
}
|
|
72
|
-
// Apply data updates from tool result
|
|
73
|
-
if (result.dataUpdate) {
|
|
74
|
-
await updateData(result.dataUpdate);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return results;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=ToolExecutor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolExecutor.js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