@tashiscool/agents 0.1.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/README.md +186 -0
- package/dist/conversation.d.ts +146 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +239 -0
- package/dist/conversation.js.map +1 -0
- package/dist/events.d.ts +218 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +299 -0
- package/dist/events.js.map +1 -0
- package/dist/executor.d.ts +144 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +362 -0
- package/dist/executor.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/langchain.d.ts +210 -0
- package/dist/langchain.d.ts.map +1 -0
- package/dist/langchain.js +333 -0
- package/dist/langchain.js.map +1 -0
- package/dist/mcp.d.ts +208 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +266 -0
- package/dist/mcp.js.map +1 -0
- package/dist/memory.d.ts +96 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +248 -0
- package/dist/memory.js.map +1 -0
- package/dist/oauth.d.ts +158 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +344 -0
- package/dist/oauth.js.map +1 -0
- package/dist/output.d.ts +262 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +249 -0
- package/dist/output.js.map +1 -0
- package/dist/session.d.ts +212 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +347 -0
- package/dist/session.js.map +1 -0
- package/dist/tools.d.ts +125 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +195 -0
- package/dist/tools.js.map +1 -0
- package/package.json +45 -0
package/dist/executor.js
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batch Executor
|
|
3
|
+
* Execute multiple tool calls with routing, concurrency control, and error handling
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Simple tool router implementation
|
|
7
|
+
*/
|
|
8
|
+
export class SimpleToolRouter {
|
|
9
|
+
tools = new Map();
|
|
10
|
+
aliases = new Map();
|
|
11
|
+
/**
|
|
12
|
+
* Register a tool
|
|
13
|
+
*/
|
|
14
|
+
register(tool) {
|
|
15
|
+
this.tools.set(tool.name, tool);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Register multiple tools
|
|
19
|
+
*/
|
|
20
|
+
registerAll(tools) {
|
|
21
|
+
for (const tool of tools) {
|
|
22
|
+
this.register(tool);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Add an alias for a tool
|
|
27
|
+
*/
|
|
28
|
+
addAlias(alias, toolName) {
|
|
29
|
+
this.aliases.set(alias, toolName);
|
|
30
|
+
}
|
|
31
|
+
route(call) {
|
|
32
|
+
// Check direct match
|
|
33
|
+
if (this.tools.has(call.name)) {
|
|
34
|
+
return this.tools.get(call.name);
|
|
35
|
+
}
|
|
36
|
+
// Check aliases
|
|
37
|
+
const aliasedName = this.aliases.get(call.name);
|
|
38
|
+
if (aliasedName && this.tools.has(aliasedName)) {
|
|
39
|
+
return this.tools.get(aliasedName);
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
hasRoute(toolName) {
|
|
44
|
+
return this.tools.has(toolName) || this.aliases.has(toolName);
|
|
45
|
+
}
|
|
46
|
+
listRoutes() {
|
|
47
|
+
return [...this.tools.keys(), ...this.aliases.keys()];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Result cache
|
|
52
|
+
*/
|
|
53
|
+
class ResultCache {
|
|
54
|
+
cache = new Map();
|
|
55
|
+
ttlMs;
|
|
56
|
+
constructor(ttlMs = 60000) {
|
|
57
|
+
this.ttlMs = ttlMs;
|
|
58
|
+
}
|
|
59
|
+
getKey(call) {
|
|
60
|
+
return `${call.name}:${JSON.stringify(call.arguments)}`;
|
|
61
|
+
}
|
|
62
|
+
get(call) {
|
|
63
|
+
const key = this.getKey(call);
|
|
64
|
+
const entry = this.cache.get(key);
|
|
65
|
+
if (!entry)
|
|
66
|
+
return undefined;
|
|
67
|
+
if (Date.now() > entry.expiresAt) {
|
|
68
|
+
this.cache.delete(key);
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return { ...entry.result, cached: true };
|
|
72
|
+
}
|
|
73
|
+
set(call, result) {
|
|
74
|
+
const key = this.getKey(call);
|
|
75
|
+
this.cache.set(key, {
|
|
76
|
+
result,
|
|
77
|
+
expiresAt: Date.now() + this.ttlMs,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
clear() {
|
|
81
|
+
this.cache.clear();
|
|
82
|
+
}
|
|
83
|
+
cleanup() {
|
|
84
|
+
const now = Date.now();
|
|
85
|
+
let cleaned = 0;
|
|
86
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
87
|
+
if (now > entry.expiresAt) {
|
|
88
|
+
this.cache.delete(key);
|
|
89
|
+
cleaned++;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return cleaned;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Execute a single tool call with timeout
|
|
97
|
+
*/
|
|
98
|
+
async function executeWithTimeout(fn, timeoutMs) {
|
|
99
|
+
return Promise.race([
|
|
100
|
+
fn(),
|
|
101
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('Tool execution timeout')), timeoutMs)),
|
|
102
|
+
]);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Batch executor for tool calls
|
|
106
|
+
*/
|
|
107
|
+
export class BatchExecutor {
|
|
108
|
+
router;
|
|
109
|
+
options;
|
|
110
|
+
cache;
|
|
111
|
+
constructor(router, options = {}) {
|
|
112
|
+
this.router = router;
|
|
113
|
+
this.options = {
|
|
114
|
+
maxConcurrency: options.maxConcurrency ?? 5,
|
|
115
|
+
defaultTimeoutMs: options.defaultTimeoutMs ?? 30000,
|
|
116
|
+
defaultRetries: options.defaultRetries ?? 0,
|
|
117
|
+
strategy: options.strategy ?? 'parallel',
|
|
118
|
+
stopOnError: options.stopOnError ?? false,
|
|
119
|
+
enableCache: options.enableCache ?? false,
|
|
120
|
+
cacheTtlMs: options.cacheTtlMs ?? 60000,
|
|
121
|
+
};
|
|
122
|
+
if (this.options.enableCache) {
|
|
123
|
+
this.cache = new ResultCache(this.options.cacheTtlMs);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Execute a single tool call
|
|
128
|
+
*/
|
|
129
|
+
async executeOne(call) {
|
|
130
|
+
const startTime = Date.now();
|
|
131
|
+
const timeoutMs = call.timeoutMs ?? this.options.defaultTimeoutMs;
|
|
132
|
+
const maxRetries = call.retries ?? this.options.defaultRetries;
|
|
133
|
+
// Check cache
|
|
134
|
+
if (this.cache) {
|
|
135
|
+
const cached = this.cache.get(call);
|
|
136
|
+
if (cached)
|
|
137
|
+
return cached;
|
|
138
|
+
}
|
|
139
|
+
// Find tool
|
|
140
|
+
const tool = this.router.route(call);
|
|
141
|
+
if (!tool) {
|
|
142
|
+
return {
|
|
143
|
+
toolCallId: call.id,
|
|
144
|
+
name: call.name,
|
|
145
|
+
result: null,
|
|
146
|
+
error: `No route found for tool: ${call.name}`,
|
|
147
|
+
durationMs: Date.now() - startTime,
|
|
148
|
+
retriesAttempted: 0,
|
|
149
|
+
cached: false,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
// Execute with retries
|
|
153
|
+
let lastError;
|
|
154
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
155
|
+
try {
|
|
156
|
+
// Validate parameters
|
|
157
|
+
const params = tool.parameters.parse(call.arguments);
|
|
158
|
+
// Execute with timeout
|
|
159
|
+
const result = await executeWithTimeout(() => tool.execute(params), timeoutMs);
|
|
160
|
+
const enhancedResult = {
|
|
161
|
+
toolCallId: call.id,
|
|
162
|
+
name: call.name,
|
|
163
|
+
result,
|
|
164
|
+
durationMs: Date.now() - startTime,
|
|
165
|
+
retriesAttempted: attempt,
|
|
166
|
+
cached: false,
|
|
167
|
+
};
|
|
168
|
+
// Cache result
|
|
169
|
+
if (this.cache) {
|
|
170
|
+
this.cache.set(call, enhancedResult);
|
|
171
|
+
}
|
|
172
|
+
return enhancedResult;
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
lastError = error instanceof Error ? error.message : String(error);
|
|
176
|
+
// Continue to retry unless it's the last attempt
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
toolCallId: call.id,
|
|
181
|
+
name: call.name,
|
|
182
|
+
result: null,
|
|
183
|
+
error: lastError,
|
|
184
|
+
durationMs: Date.now() - startTime,
|
|
185
|
+
retriesAttempted: maxRetries,
|
|
186
|
+
cached: false,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Execute multiple tool calls
|
|
191
|
+
*/
|
|
192
|
+
async execute(calls, onProgress) {
|
|
193
|
+
if (calls.length === 0)
|
|
194
|
+
return [];
|
|
195
|
+
// Sort by priority
|
|
196
|
+
const sorted = [...calls].sort((a, b) => {
|
|
197
|
+
const priorityOrder = { high: 0, normal: 1, low: 2 };
|
|
198
|
+
const aPriority = priorityOrder[a.priority ?? 'normal'];
|
|
199
|
+
const bPriority = priorityOrder[b.priority ?? 'normal'];
|
|
200
|
+
return aPriority - bPriority;
|
|
201
|
+
});
|
|
202
|
+
switch (this.options.strategy) {
|
|
203
|
+
case 'sequential':
|
|
204
|
+
return this.executeSequential(sorted, onProgress);
|
|
205
|
+
case 'parallel':
|
|
206
|
+
return this.executeParallel(sorted, onProgress);
|
|
207
|
+
case 'adaptive':
|
|
208
|
+
return this.executeAdaptive(sorted, onProgress);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Execute sequentially
|
|
213
|
+
*/
|
|
214
|
+
async executeSequential(calls, onProgress) {
|
|
215
|
+
const results = [];
|
|
216
|
+
for (let i = 0; i < calls.length; i++) {
|
|
217
|
+
const call = calls[i];
|
|
218
|
+
onProgress?.({ completed: i, total: calls.length, current: call });
|
|
219
|
+
const result = await this.executeOne(call);
|
|
220
|
+
results.push(result);
|
|
221
|
+
onProgress?.({
|
|
222
|
+
completed: i + 1,
|
|
223
|
+
total: calls.length,
|
|
224
|
+
current: call,
|
|
225
|
+
result,
|
|
226
|
+
});
|
|
227
|
+
if (this.options.stopOnError && result.error) {
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return results;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Execute in parallel with concurrency limit
|
|
235
|
+
*/
|
|
236
|
+
async executeParallel(calls, onProgress) {
|
|
237
|
+
const results = new Array(calls.length);
|
|
238
|
+
let completed = 0;
|
|
239
|
+
let stopped = false;
|
|
240
|
+
// Process in batches
|
|
241
|
+
const batches = [];
|
|
242
|
+
for (let i = 0; i < calls.length; i += this.options.maxConcurrency) {
|
|
243
|
+
batches.push(calls.slice(i, i + this.options.maxConcurrency));
|
|
244
|
+
}
|
|
245
|
+
for (const batch of batches) {
|
|
246
|
+
if (stopped)
|
|
247
|
+
break;
|
|
248
|
+
const batchPromises = batch.map(async (call, batchIndex) => {
|
|
249
|
+
const globalIndex = calls.indexOf(call);
|
|
250
|
+
const result = await this.executeOne(call);
|
|
251
|
+
results[globalIndex] = result;
|
|
252
|
+
completed++;
|
|
253
|
+
onProgress?.({
|
|
254
|
+
completed,
|
|
255
|
+
total: calls.length,
|
|
256
|
+
current: call,
|
|
257
|
+
result,
|
|
258
|
+
});
|
|
259
|
+
if (this.options.stopOnError && result.error) {
|
|
260
|
+
stopped = true;
|
|
261
|
+
}
|
|
262
|
+
return result;
|
|
263
|
+
});
|
|
264
|
+
await Promise.all(batchPromises);
|
|
265
|
+
}
|
|
266
|
+
return results.filter(Boolean);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Adaptive execution based on dependencies
|
|
270
|
+
*/
|
|
271
|
+
async executeAdaptive(calls, onProgress) {
|
|
272
|
+
const results = new Map();
|
|
273
|
+
const pending = new Map(calls.map((c) => [c.id, c]));
|
|
274
|
+
let completed = 0;
|
|
275
|
+
while (pending.size > 0) {
|
|
276
|
+
// Find calls with satisfied dependencies
|
|
277
|
+
const ready = [];
|
|
278
|
+
for (const call of pending.values()) {
|
|
279
|
+
const deps = call.dependsOn ?? [];
|
|
280
|
+
if (deps.every((depId) => results.has(depId))) {
|
|
281
|
+
ready.push(call);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (ready.length === 0 && pending.size > 0) {
|
|
285
|
+
// Circular dependency or missing dependency
|
|
286
|
+
for (const call of pending.values()) {
|
|
287
|
+
results.set(call.id, {
|
|
288
|
+
toolCallId: call.id,
|
|
289
|
+
name: call.name,
|
|
290
|
+
result: null,
|
|
291
|
+
error: 'Unresolvable dependencies',
|
|
292
|
+
durationMs: 0,
|
|
293
|
+
retriesAttempted: 0,
|
|
294
|
+
cached: false,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
// Execute ready calls in parallel (up to concurrency limit)
|
|
300
|
+
const batch = ready.slice(0, this.options.maxConcurrency);
|
|
301
|
+
const batchResults = await Promise.all(batch.map((call) => this.executeOne(call)));
|
|
302
|
+
for (let i = 0; i < batch.length; i++) {
|
|
303
|
+
const call = batch[i];
|
|
304
|
+
const result = batchResults[i];
|
|
305
|
+
results.set(call.id, result);
|
|
306
|
+
pending.delete(call.id);
|
|
307
|
+
completed++;
|
|
308
|
+
onProgress?.({
|
|
309
|
+
completed,
|
|
310
|
+
total: calls.length,
|
|
311
|
+
current: call,
|
|
312
|
+
result,
|
|
313
|
+
});
|
|
314
|
+
if (this.options.stopOnError && result.error) {
|
|
315
|
+
// Mark remaining as skipped
|
|
316
|
+
for (const remaining of pending.values()) {
|
|
317
|
+
results.set(remaining.id, {
|
|
318
|
+
toolCallId: remaining.id,
|
|
319
|
+
name: remaining.name,
|
|
320
|
+
result: null,
|
|
321
|
+
error: 'Skipped due to previous error',
|
|
322
|
+
durationMs: 0,
|
|
323
|
+
retriesAttempted: 0,
|
|
324
|
+
cached: false,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
pending.clear();
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
// Return in original order
|
|
333
|
+
return calls.map((c) => results.get(c.id));
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Clear cache
|
|
337
|
+
*/
|
|
338
|
+
clearCache() {
|
|
339
|
+
this.cache?.clear();
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Cleanup expired cache entries
|
|
343
|
+
*/
|
|
344
|
+
cleanupCache() {
|
|
345
|
+
return this.cache?.cleanup() ?? 0;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Create a batch executor
|
|
350
|
+
*/
|
|
351
|
+
export function createBatchExecutor(tools, options) {
|
|
352
|
+
const router = new SimpleToolRouter();
|
|
353
|
+
router.registerAll(tools);
|
|
354
|
+
return new BatchExecutor(router, options);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Create a batch executor with custom router
|
|
358
|
+
*/
|
|
359
|
+
export function createBatchExecutorWithRouter(router, options) {
|
|
360
|
+
return new BatchExecutor(router, options);
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkFH;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACnB,KAAK,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC1C,OA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,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @llm-utils/agents
|
|
3
|
+
* Agent building blocks: tools, memory, conversation, and more
|
|
4
|
+
*/
|
|
5
|
+
export { defineTool, toOpenAITool, toAnthropicTool, zodToJsonSchema, ToolExecutor, createToolExecutor, } from './tools.js';
|
|
6
|
+
export type { JsonSchema, ToolDefinition, OpenAITool, AnthropicTool, ToolCall, ToolResult, } from './tools.js';
|
|
7
|
+
export { estimateTokens, createMemory, createSlidingWindowMemory, createSummaryMemory, } from './memory.js';
|
|
8
|
+
export type { MessageRole, Message, TokenizedMessage, TokenCounter, MemoryConfig, MemoryStats, ConversationMemory, SummaryMemoryConfig, } from './memory.js';
|
|
9
|
+
export { extractJson, parseJson, parseWithSchema, createParser, createSchemaParser, CommonSchemas, Parsers, } from './output.js';
|
|
10
|
+
export type { ParseResult, JsonExtractionOptions, ParserWithRetry, } from './output.js';
|
|
11
|
+
export { InMemoryThreadStorage, ConversationManager, createConversationManager, } from './conversation.js';
|
|
12
|
+
export type { ThreadedMessage, ConversationThread, ThreadStorageAdapter, ConversationManagerOptions, } from './conversation.js';
|
|
13
|
+
export { InMemorySessionStorage, ChatSession, SessionManager, createSessionManager, createChatSession, } from './session.js';
|
|
14
|
+
export type { SessionStatus, SessionConfig, SessionState, SessionEventType, SessionEvent, SessionEventHandler, SessionStorage, } from './session.js';
|
|
15
|
+
export { EventStreamProcessor, AgentEventEmitter, createEventProcessor, createEventEmitter, EventFilters, EventTransformers, } from './events.js';
|
|
16
|
+
export type { AgentEventType, AgentEvent, AgentStartData, AgentEndData, LlmStreamData, ToolCallData, EventHandler, EventFilter, EventTransformer, } from './events.js';
|
|
17
|
+
export { SimpleToolRouter, BatchExecutor, createBatchExecutor, createBatchExecutorWithRouter, } from './executor.js';
|
|
18
|
+
export type { ExecutionPriority, ExecutionStrategy, EnhancedToolCall, EnhancedToolResult, BatchExecutionOptions, ProgressCallback, ToolRouter, } from './executor.js';
|
|
19
|
+
export { MockMcpClient, McpToolAdapter, McpServerManager, createMcpManager, createMockMcpClient, createMcpToolAdapter, } from './mcp.js';
|
|
20
|
+
export type { McpServerConfig, McpTool, McpResource, McpPrompt, McpCallResult, McpConnectionState, McpClient, } from './mcp.js';
|
|
21
|
+
export { InMemoryTokenStorage, OAuthTokenManager, createOAuthManager, OAuthProviders, } from './oauth.js';
|
|
22
|
+
export type { OAuthToken, OAuthProviderConfig, TokenStorage, TokenRefreshFn, TokenManagerOptions, } from './oauth.js';
|
|
23
|
+
export { toLangChainMessage, toLangChainMessages, fromLangChainMessage, fromLangChainMessages, humanMessage, aiMessage, systemMessage, toolMessage, toLangChainToolCall, fromLangChainToolCall, buildToolResultMessage, buildToolMessages, MessageBuilder, createMessageBuilder, toOpenAIMessage, toOpenAIMessages, toAnthropicMessages, } from './langchain.js';
|
|
24
|
+
export type { LangChainMessageType, LangChainMessage, HumanMessage, AIMessage, SystemMessage, ToolMessage, LangChainToolCall, ConversionOptions, OpenAIMessage, AnthropicMessage, } from './langchain.js';
|
|
25
|
+
export { z } from 'zod';
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,aAAa,EACb,QAAQ,EACR,UAAU,GACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,kBAA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B,YAAY,EACV,eAAe,EACf,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,SAAS,GACV,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @llm-utils/agents
|
|
3
|
+
* Agent building blocks: tools, memory, conversation, and more
|
|
4
|
+
*/
|
|
5
|
+
// Tools
|
|
6
|
+
export { defineTool, toOpenAITool, toAnthropicTool, zodToJsonSchema, ToolExecutor, createToolExecutor, } from './tools.js';
|
|
7
|
+
// Memory
|
|
8
|
+
export { estimateTokens, createMemory, createSlidingWindowMemory, createSummaryMemory, } from './memory.js';
|
|
9
|
+
// Output Parsing
|
|
10
|
+
export { extractJson, parseJson, parseWithSchema, createParser, createSchemaParser, CommonSchemas, Parsers, } from './output.js';
|
|
11
|
+
// Conversation Threading
|
|
12
|
+
export { InMemoryThreadStorage, ConversationManager, createConversationManager, } from './conversation.js';
|
|
13
|
+
// Session Management
|
|
14
|
+
export { InMemorySessionStorage, ChatSession, SessionManager, createSessionManager, createChatSession, } from './session.js';
|
|
15
|
+
// Agent Events
|
|
16
|
+
export { EventStreamProcessor, AgentEventEmitter, createEventProcessor, createEventEmitter, EventFilters, EventTransformers, } from './events.js';
|
|
17
|
+
// Batch Executor
|
|
18
|
+
export { SimpleToolRouter, BatchExecutor, createBatchExecutor, createBatchExecutorWithRouter, } from './executor.js';
|
|
19
|
+
// MCP Client
|
|
20
|
+
export { MockMcpClient, McpToolAdapter, McpServerManager, createMcpManager, createMockMcpClient, createMcpToolAdapter, } from './mcp.js';
|
|
21
|
+
// OAuth Token Manager
|
|
22
|
+
export { InMemoryTokenStorage, OAuthTokenManager, createOAuthManager, OAuthProviders, } from './oauth.js';
|
|
23
|
+
// LangChain Message Builder
|
|
24
|
+
export { toLangChainMessage, toLangChainMessages, fromLangChainMessage, fromLangChainMessages, humanMessage, aiMessage, systemMessage, toolMessage, toLangChainToolCall, fromLangChainToolCall, buildToolResultMessage, buildToolMessages, MessageBuilder, createMessageBuilder, toOpenAIMessage, toOpenAIMessages, toAnthropicMessages, } from './langchain.js';
|
|
25
|
+
// Re-export zod for convenience
|
|
26
|
+
export { z } from 'zod';
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,QAAQ;AACR,OAAO,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAUpB,SAAS;AACT,OAAO,EACL,cAAc,EACd,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAYrB,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,OAAO,GACR,MAAM,aAAa,CAAC;AAOrB,yBAAyB;AACzB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAQ3B,qBAAqB;AACrB,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAWtB,eAAe;AACf,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAarB,iBAAiB;AACjB,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AAWvB,aAAa;AACb,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAWlB,sBAAsB;AACtB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AASpB,4BAA4B;AAC5B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAcxB,gCAAgC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LangChain Message Builder
|
|
3
|
+
* Build LangChain-compatible messages from various sources
|
|
4
|
+
*/
|
|
5
|
+
import type { Message, MessageRole } from './memory.js';
|
|
6
|
+
import type { ToolCall, ToolResult } from './tools.js';
|
|
7
|
+
/**
|
|
8
|
+
* LangChain message types
|
|
9
|
+
*/
|
|
10
|
+
export type LangChainMessageType = 'human' | 'ai' | 'system' | 'tool' | 'function';
|
|
11
|
+
/**
|
|
12
|
+
* LangChain base message
|
|
13
|
+
*/
|
|
14
|
+
export interface LangChainMessage {
|
|
15
|
+
type: LangChainMessageType;
|
|
16
|
+
content: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
additional_kwargs?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* LangChain human message
|
|
22
|
+
*/
|
|
23
|
+
export interface HumanMessage extends LangChainMessage {
|
|
24
|
+
type: 'human';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* LangChain AI message with tool calls
|
|
28
|
+
*/
|
|
29
|
+
export interface AIMessage extends LangChainMessage {
|
|
30
|
+
type: 'ai';
|
|
31
|
+
tool_calls?: LangChainToolCall[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* LangChain system message
|
|
35
|
+
*/
|
|
36
|
+
export interface SystemMessage extends LangChainMessage {
|
|
37
|
+
type: 'system';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* LangChain tool message
|
|
41
|
+
*/
|
|
42
|
+
export interface ToolMessage extends LangChainMessage {
|
|
43
|
+
type: 'tool';
|
|
44
|
+
tool_call_id: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* LangChain tool call format
|
|
48
|
+
*/
|
|
49
|
+
export interface LangChainToolCall {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
args: Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Message conversion options
|
|
56
|
+
*/
|
|
57
|
+
export interface ConversionOptions {
|
|
58
|
+
/** Include tool calls in AI messages */
|
|
59
|
+
includeToolCalls?: boolean;
|
|
60
|
+
/** Flatten tool results into content */
|
|
61
|
+
flattenToolResults?: boolean;
|
|
62
|
+
/** Custom role mapping */
|
|
63
|
+
roleMapping?: Partial<Record<MessageRole, LangChainMessageType>>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Convert standard message to LangChain format
|
|
67
|
+
*/
|
|
68
|
+
export declare function toLangChainMessage(message: Message, options?: ConversionOptions): LangChainMessage;
|
|
69
|
+
/**
|
|
70
|
+
* Convert array of messages to LangChain format
|
|
71
|
+
*/
|
|
72
|
+
export declare function toLangChainMessages(messages: Message[], options?: ConversionOptions): LangChainMessage[];
|
|
73
|
+
/**
|
|
74
|
+
* Convert LangChain message to standard format
|
|
75
|
+
*/
|
|
76
|
+
export declare function fromLangChainMessage(lcMessage: LangChainMessage): Message;
|
|
77
|
+
/**
|
|
78
|
+
* Convert array of LangChain messages to standard format
|
|
79
|
+
*/
|
|
80
|
+
export declare function fromLangChainMessages(lcMessages: LangChainMessage[]): Message[];
|
|
81
|
+
/**
|
|
82
|
+
* Create a human message
|
|
83
|
+
*/
|
|
84
|
+
export declare function humanMessage(content: string, name?: string): HumanMessage;
|
|
85
|
+
/**
|
|
86
|
+
* Create an AI message
|
|
87
|
+
*/
|
|
88
|
+
export declare function aiMessage(content: string, toolCalls?: LangChainToolCall[]): AIMessage;
|
|
89
|
+
/**
|
|
90
|
+
* Create a system message
|
|
91
|
+
*/
|
|
92
|
+
export declare function systemMessage(content: string): SystemMessage;
|
|
93
|
+
/**
|
|
94
|
+
* Create a tool message
|
|
95
|
+
*/
|
|
96
|
+
export declare function toolMessage(content: string, toolCallId: string, name?: string): ToolMessage;
|
|
97
|
+
/**
|
|
98
|
+
* Convert tool call to LangChain format
|
|
99
|
+
*/
|
|
100
|
+
export declare function toLangChainToolCall(call: ToolCall): LangChainToolCall;
|
|
101
|
+
/**
|
|
102
|
+
* Convert LangChain tool call to standard format
|
|
103
|
+
*/
|
|
104
|
+
export declare function fromLangChainToolCall(lcCall: LangChainToolCall): ToolCall;
|
|
105
|
+
/**
|
|
106
|
+
* Build tool result message
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildToolResultMessage(result: ToolResult): ToolMessage;
|
|
109
|
+
/**
|
|
110
|
+
* Build messages from tool call + result pairs
|
|
111
|
+
*/
|
|
112
|
+
export declare function buildToolMessages(calls: ToolCall[], results: ToolResult[]): LangChainMessage[];
|
|
113
|
+
/**
|
|
114
|
+
* Message builder for complex conversations
|
|
115
|
+
*/
|
|
116
|
+
export declare class MessageBuilder {
|
|
117
|
+
private messages;
|
|
118
|
+
/**
|
|
119
|
+
* Add system message
|
|
120
|
+
*/
|
|
121
|
+
system(content: string): this;
|
|
122
|
+
/**
|
|
123
|
+
* Add human message
|
|
124
|
+
*/
|
|
125
|
+
human(content: string, name?: string): this;
|
|
126
|
+
/**
|
|
127
|
+
* Add AI message
|
|
128
|
+
*/
|
|
129
|
+
ai(content: string, toolCalls?: LangChainToolCall[]): this;
|
|
130
|
+
/**
|
|
131
|
+
* Add tool result message
|
|
132
|
+
*/
|
|
133
|
+
tool(content: string, toolCallId: string, name?: string): this;
|
|
134
|
+
/**
|
|
135
|
+
* Add tool call and result
|
|
136
|
+
*/
|
|
137
|
+
toolCallAndResult(call: ToolCall, result: ToolResult): this;
|
|
138
|
+
/**
|
|
139
|
+
* Add multiple messages
|
|
140
|
+
*/
|
|
141
|
+
addMany(messages: Message[]): this;
|
|
142
|
+
/**
|
|
143
|
+
* Build the message array
|
|
144
|
+
*/
|
|
145
|
+
build(): LangChainMessage[];
|
|
146
|
+
/**
|
|
147
|
+
* Build as standard messages
|
|
148
|
+
*/
|
|
149
|
+
buildStandard(): Message[];
|
|
150
|
+
/**
|
|
151
|
+
* Clear builder
|
|
152
|
+
*/
|
|
153
|
+
clear(): this;
|
|
154
|
+
/**
|
|
155
|
+
* Get message count
|
|
156
|
+
*/
|
|
157
|
+
get length(): number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Create a message builder
|
|
161
|
+
*/
|
|
162
|
+
export declare function createMessageBuilder(): MessageBuilder;
|
|
163
|
+
/**
|
|
164
|
+
* OpenAI message format conversion
|
|
165
|
+
*/
|
|
166
|
+
export interface OpenAIMessage {
|
|
167
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
168
|
+
content: string | null;
|
|
169
|
+
name?: string;
|
|
170
|
+
tool_calls?: Array<{
|
|
171
|
+
id: string;
|
|
172
|
+
type: 'function';
|
|
173
|
+
function: {
|
|
174
|
+
name: string;
|
|
175
|
+
arguments: string;
|
|
176
|
+
};
|
|
177
|
+
}>;
|
|
178
|
+
tool_call_id?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Convert to OpenAI message format
|
|
182
|
+
*/
|
|
183
|
+
export declare function toOpenAIMessage(message: LangChainMessage): OpenAIMessage;
|
|
184
|
+
/**
|
|
185
|
+
* Convert array to OpenAI format
|
|
186
|
+
*/
|
|
187
|
+
export declare function toOpenAIMessages(messages: LangChainMessage[]): OpenAIMessage[];
|
|
188
|
+
/**
|
|
189
|
+
* Anthropic message format conversion
|
|
190
|
+
*/
|
|
191
|
+
export interface AnthropicMessage {
|
|
192
|
+
role: 'user' | 'assistant';
|
|
193
|
+
content: string | Array<{
|
|
194
|
+
type: 'text' | 'tool_use' | 'tool_result';
|
|
195
|
+
text?: string;
|
|
196
|
+
id?: string;
|
|
197
|
+
name?: string;
|
|
198
|
+
input?: Record<string, unknown>;
|
|
199
|
+
tool_use_id?: string;
|
|
200
|
+
content?: string;
|
|
201
|
+
}>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Convert to Anthropic message format
|
|
205
|
+
*/
|
|
206
|
+
export declare function toAnthropicMessages(messages: LangChainMessage[]): {
|
|
207
|
+
system?: string;
|
|
208
|
+
messages: AnthropicMessage[];
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=langchain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langch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