@amical/aiagent-sdk 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/WebMemoryManager-Bk19j8i6.d.mts +26 -0
- package/dist/WebMemoryManager-DXxLUDBB.d.ts +26 -0
- package/dist/index.d.mts +1 -165
- package/dist/index.d.ts +1 -165
- package/dist/index.js +26 -1077
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -1048
- package/dist/index.mjs.map +1 -1
- package/dist/runtime/nodeRuntime.d.mts +110 -0
- package/dist/runtime/nodeRuntime.d.ts +110 -0
- package/dist/runtime/nodeRuntime.js +1618 -0
- package/dist/runtime/nodeRuntime.js.map +1 -0
- package/dist/runtime/nodeRuntime.mjs +1577 -0
- package/dist/runtime/nodeRuntime.mjs.map +1 -0
- package/dist/runtime/webRuntime.d.mts +73 -0
- package/dist/runtime/webRuntime.d.ts +73 -0
- package/dist/runtime/webRuntime.js +1515 -0
- package/dist/runtime/webRuntime.js.map +1 -0
- package/dist/runtime/webRuntime.mjs +1494 -0
- package/dist/runtime/webRuntime.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IMemoryManager, AgentMessage } from './index.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Web 端 MemoryManager 实现
|
|
5
|
+
* 使用 IndexedDB (通过封装) 或 LocalStorage / SessionStorage 来持久化对话历史。
|
|
6
|
+
* 此处提供一个基于 SessionStorage / 内存 回退的轻量实现。
|
|
7
|
+
*/
|
|
8
|
+
declare class WebMemoryManager implements IMemoryManager {
|
|
9
|
+
private storageKey;
|
|
10
|
+
private maxMessages;
|
|
11
|
+
private inMemoryFallback;
|
|
12
|
+
/**
|
|
13
|
+
* @param storageKey SessionStorage 中的键名
|
|
14
|
+
* @param maxMessages 保留的最大消息数量,用于简单的历史截断(默认 150)
|
|
15
|
+
*/
|
|
16
|
+
constructor(storageKey?: string, maxMessages?: number);
|
|
17
|
+
private isStorageAvailable;
|
|
18
|
+
private readMessages;
|
|
19
|
+
private writeMessages;
|
|
20
|
+
getHistory(): Promise<AgentMessage[]>;
|
|
21
|
+
appendMessage(message: AgentMessage): Promise<void>;
|
|
22
|
+
condenseHistory(): Promise<void>;
|
|
23
|
+
clear(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { WebMemoryManager as W };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IMemoryManager, AgentMessage } from './index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Web 端 MemoryManager 实现
|
|
5
|
+
* 使用 IndexedDB (通过封装) 或 LocalStorage / SessionStorage 来持久化对话历史。
|
|
6
|
+
* 此处提供一个基于 SessionStorage / 内存 回退的轻量实现。
|
|
7
|
+
*/
|
|
8
|
+
declare class WebMemoryManager implements IMemoryManager {
|
|
9
|
+
private storageKey;
|
|
10
|
+
private maxMessages;
|
|
11
|
+
private inMemoryFallback;
|
|
12
|
+
/**
|
|
13
|
+
* @param storageKey SessionStorage 中的键名
|
|
14
|
+
* @param maxMessages 保留的最大消息数量,用于简单的历史截断(默认 150)
|
|
15
|
+
*/
|
|
16
|
+
constructor(storageKey?: string, maxMessages?: number);
|
|
17
|
+
private isStorageAvailable;
|
|
18
|
+
private readMessages;
|
|
19
|
+
private writeMessages;
|
|
20
|
+
getHistory(): Promise<AgentMessage[]>;
|
|
21
|
+
appendMessage(message: AgentMessage): Promise<void>;
|
|
22
|
+
condenseHistory(): Promise<void>;
|
|
23
|
+
clear(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { WebMemoryManager as W };
|
package/dist/index.d.mts
CHANGED
|
@@ -248,56 +248,6 @@ interface ReasoningStreamContent {
|
|
|
248
248
|
partial: boolean;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
declare class NodePromptManager implements IPromptManager {
|
|
252
|
-
getSystemPrompt(context: {
|
|
253
|
-
cwd: string;
|
|
254
|
-
os: string;
|
|
255
|
-
shell: string;
|
|
256
|
-
skills: any;
|
|
257
|
-
customInstructions?: string;
|
|
258
|
-
allowDefaultTools?: string[];
|
|
259
|
-
customTools?: any[];
|
|
260
|
-
}): Promise<string>;
|
|
261
|
-
getEnvironmentInfoPrompt(context: {
|
|
262
|
-
cwd: string;
|
|
263
|
-
os: string;
|
|
264
|
-
shell: string;
|
|
265
|
-
}): string;
|
|
266
|
-
getSkillsPrompt(skills: any[]): Promise<string>;
|
|
267
|
-
getToolInstructions(context: {
|
|
268
|
-
cwd: string;
|
|
269
|
-
os: string;
|
|
270
|
-
allowDefaultTools?: string[];
|
|
271
|
-
customTools?: any[];
|
|
272
|
-
}): string;
|
|
273
|
-
getNoUseToolInstructions(context: any): string;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
declare class WebPromptManager implements IPromptManager {
|
|
277
|
-
getSystemPrompt(context: {
|
|
278
|
-
cwd: string;
|
|
279
|
-
os: string;
|
|
280
|
-
shell: string;
|
|
281
|
-
skills: any;
|
|
282
|
-
customInstructions?: string;
|
|
283
|
-
allowDefaultTools?: string[];
|
|
284
|
-
customTools?: any[];
|
|
285
|
-
}): Promise<string>;
|
|
286
|
-
getEnvironmentInfoPrompt(context: {
|
|
287
|
-
cwd: string;
|
|
288
|
-
os: string;
|
|
289
|
-
shell: string;
|
|
290
|
-
}): string;
|
|
291
|
-
getSkillsPrompt(skills: any[]): Promise<string>;
|
|
292
|
-
getToolInstructions(context: {
|
|
293
|
-
cwd: string;
|
|
294
|
-
os: string;
|
|
295
|
-
allowDefaultTools?: string[];
|
|
296
|
-
customTools?: any[];
|
|
297
|
-
}): string;
|
|
298
|
-
getNoUseToolInstructions(context: any): string;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
251
|
/**
|
|
302
252
|
* 抽象的 System Prompt 管理器。
|
|
303
253
|
* 替代原始项目中复杂的 templates/variants,交由宿主自行提供或使用默认简单实现。
|
|
@@ -321,50 +271,6 @@ interface IPromptManager {
|
|
|
321
271
|
getNoUseToolInstructions(context: any): string;
|
|
322
272
|
}
|
|
323
273
|
|
|
324
|
-
/**
|
|
325
|
-
* Node 端 MemoryManager 实现
|
|
326
|
-
* 将对话历史持久化到本地文件系统(JSON 格式)。
|
|
327
|
-
*/
|
|
328
|
-
declare class NodeMemoryManager implements IMemoryManager {
|
|
329
|
-
private filePath;
|
|
330
|
-
private maxMessages;
|
|
331
|
-
/**
|
|
332
|
-
* @param dbPath 存储历史记录的本地文件路径(例如:'./.cline_memory.json')
|
|
333
|
-
* @param maxMessages 保留的最大消息数量,用于简单的历史截断(默认 150)
|
|
334
|
-
*/
|
|
335
|
-
constructor(dbPath: string, maxMessages?: number);
|
|
336
|
-
private ensureFile;
|
|
337
|
-
private readMessages;
|
|
338
|
-
private writeMessages;
|
|
339
|
-
getHistory(): Promise<AgentMessage[]>;
|
|
340
|
-
appendMessage(message: AgentMessage): Promise<void>;
|
|
341
|
-
condenseHistory(): Promise<void>;
|
|
342
|
-
clear(): Promise<void>;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Web 端 MemoryManager 实现
|
|
347
|
-
* 使用 IndexedDB (通过封装) 或 LocalStorage / SessionStorage 来持久化对话历史。
|
|
348
|
-
* 此处提供一个基于 SessionStorage / 内存 回退的轻量实现。
|
|
349
|
-
*/
|
|
350
|
-
declare class WebMemoryManager implements IMemoryManager {
|
|
351
|
-
private storageKey;
|
|
352
|
-
private maxMessages;
|
|
353
|
-
private inMemoryFallback;
|
|
354
|
-
/**
|
|
355
|
-
* @param storageKey SessionStorage 中的键名
|
|
356
|
-
* @param maxMessages 保留的最大消息数量,用于简单的历史截断(默认 150)
|
|
357
|
-
*/
|
|
358
|
-
constructor(storageKey?: string, maxMessages?: number);
|
|
359
|
-
private isStorageAvailable;
|
|
360
|
-
private readMessages;
|
|
361
|
-
private writeMessages;
|
|
362
|
-
getHistory(): Promise<AgentMessage[]>;
|
|
363
|
-
appendMessage(message: AgentMessage): Promise<void>;
|
|
364
|
-
condenseHistory(): Promise<void>;
|
|
365
|
-
clear(): Promise<void>;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
274
|
/**
|
|
369
275
|
* 统一的消息结构(这里做简单抽象,实际使用可对齐 LLM API 标准结构)
|
|
370
276
|
*/
|
|
@@ -395,47 +301,6 @@ interface IMemoryManager {
|
|
|
395
301
|
clear(): Promise<void>;
|
|
396
302
|
}
|
|
397
303
|
|
|
398
|
-
interface NodeApiHandlerConfig {
|
|
399
|
-
providerId?: string;
|
|
400
|
-
modelId?: string;
|
|
401
|
-
apiKey: string;
|
|
402
|
-
baseURL?: string;
|
|
403
|
-
headers?: Record<string, string>;
|
|
404
|
-
fetch?: typeof fetch;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Node 端的 LLM API 处理器 (已通过 Vercel AI SDK 重构)
|
|
408
|
-
* 支持灵活对接 OpenAI 及各类兼容 OpenAI 规范的平台 (DeepSeek, Dify 等)
|
|
409
|
-
*/
|
|
410
|
-
declare class NodeApiHandler implements IApiHandler {
|
|
411
|
-
private config;
|
|
412
|
-
private conversationId?;
|
|
413
|
-
constructor(config: NodeApiHandlerConfig);
|
|
414
|
-
getModelInfo(): ApiProviderInfo;
|
|
415
|
-
createMessage(systemPrompt: string, messages: AgentMessage[]): AsyncGenerator<ApiStreamChunk, void, unknown>;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
interface WebApiHandlerConfig {
|
|
419
|
-
providerId?: string;
|
|
420
|
-
modelId?: string;
|
|
421
|
-
apiKey: string;
|
|
422
|
-
baseURL?: string;
|
|
423
|
-
headers?: Record<string, string>;
|
|
424
|
-
fetch?: typeof fetch;
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Web 端的 LLM API 处理器 (已通过 Vercel AI SDK 重构)
|
|
428
|
-
* 支持灵活对接 OpenAI 及各类兼容 OpenAI 规范的平台 (DeepSeek, Dify 等)
|
|
429
|
-
* 由于 Vercel AI SDK 底层统一使用标准的 Web Fetch API,Web 端的逻辑可以做到与 Node 端完全一致。
|
|
430
|
-
*/
|
|
431
|
-
declare class WebApiHandler implements IApiHandler {
|
|
432
|
-
private config;
|
|
433
|
-
private conversationId?;
|
|
434
|
-
constructor(config: WebApiHandlerConfig);
|
|
435
|
-
getModelInfo(): ApiProviderInfo;
|
|
436
|
-
createMessage(systemPrompt: string, messages: AgentMessage[]): AsyncGenerator<ApiStreamChunk, void, unknown>;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
304
|
/**
|
|
440
305
|
* 统一的 API 响应流数据块
|
|
441
306
|
*/
|
|
@@ -606,35 +471,6 @@ declare class ClineAgent {
|
|
|
606
471
|
getHistory(): Promise<AgentMessage[]>;
|
|
607
472
|
}
|
|
608
473
|
|
|
609
|
-
interface NodeAgentOptions {
|
|
610
|
-
apiConfig: NodeApiHandlerConfig;
|
|
611
|
-
dbPath?: string;
|
|
612
|
-
customInstructions?: string;
|
|
613
|
-
customTools?: any[];
|
|
614
|
-
allowDefaultTools?: string[];
|
|
615
|
-
memory?: NodeMemoryManager | WebMemoryManager;
|
|
616
|
-
maxLoopCount?: number;
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* 快速创建 Node 端 Agent 的工厂方法
|
|
620
|
-
*/
|
|
621
|
-
declare function createNodeAgent(options: NodeAgentOptions): ClineAgent;
|
|
622
|
-
|
|
623
|
-
interface WebAgentOptions {
|
|
624
|
-
apiConfig: WebApiHandlerConfig;
|
|
625
|
-
dbPath?: string;
|
|
626
|
-
customInstructions?: string;
|
|
627
|
-
customTools?: any[];
|
|
628
|
-
allowDefaultTools?: string[];
|
|
629
|
-
memory?: WebMemoryManager;
|
|
630
|
-
maxLoopCount?: number;
|
|
631
|
-
storageKey?: string;
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* 快速创建 Web 端 Agent 的工厂方法
|
|
635
|
-
*/
|
|
636
|
-
declare function createWebAgent(options: WebAgentOptions): ClineAgent;
|
|
637
|
-
|
|
638
474
|
declare const VERSION = "0.1.0";
|
|
639
475
|
|
|
640
|
-
export { AgentDefaultTool, type AgentMessage, type AgentOptions, AgentState, type ApiProviderInfo, type ApiStreamChunk, type AssistantMessageContent, ClineAgent, type IAgentRuntime, type IApiHandler, type IMcpManager, type IMemoryManager, type IPromptManager, type McpServerInfo, type McpTool, type McpToolCallResult,
|
|
476
|
+
export { AgentDefaultTool, type AgentMessage, type AgentOptions, AgentState, type ApiProviderInfo, type ApiStreamChunk, type AssistantMessageContent, ClineAgent, type IAgentRuntime, type IApiHandler, type IMcpManager, type IMemoryManager, type IPromptManager, type McpServerInfo, type McpTool, type McpToolCallResult, READ_ONLY_TOOLS, type ReasoningStreamContent, TOOL_RESULT_BLOCK, type TextStreamContent, type ToolParamName, type ToolUse, VERSION, defaultTools, getToolUseNames, parseAssistantMessageV2, setDynamicToolUseNames, toolParamNames, toolUseNames };
|
package/dist/index.d.ts
CHANGED
|
@@ -248,56 +248,6 @@ interface ReasoningStreamContent {
|
|
|
248
248
|
partial: boolean;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
declare class NodePromptManager implements IPromptManager {
|
|
252
|
-
getSystemPrompt(context: {
|
|
253
|
-
cwd: string;
|
|
254
|
-
os: string;
|
|
255
|
-
shell: string;
|
|
256
|
-
skills: any;
|
|
257
|
-
customInstructions?: string;
|
|
258
|
-
allowDefaultTools?: string[];
|
|
259
|
-
customTools?: any[];
|
|
260
|
-
}): Promise<string>;
|
|
261
|
-
getEnvironmentInfoPrompt(context: {
|
|
262
|
-
cwd: string;
|
|
263
|
-
os: string;
|
|
264
|
-
shell: string;
|
|
265
|
-
}): string;
|
|
266
|
-
getSkillsPrompt(skills: any[]): Promise<string>;
|
|
267
|
-
getToolInstructions(context: {
|
|
268
|
-
cwd: string;
|
|
269
|
-
os: string;
|
|
270
|
-
allowDefaultTools?: string[];
|
|
271
|
-
customTools?: any[];
|
|
272
|
-
}): string;
|
|
273
|
-
getNoUseToolInstructions(context: any): string;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
declare class WebPromptManager implements IPromptManager {
|
|
277
|
-
getSystemPrompt(context: {
|
|
278
|
-
cwd: string;
|
|
279
|
-
os: string;
|
|
280
|
-
shell: string;
|
|
281
|
-
skills: any;
|
|
282
|
-
customInstructions?: string;
|
|
283
|
-
allowDefaultTools?: string[];
|
|
284
|
-
customTools?: any[];
|
|
285
|
-
}): Promise<string>;
|
|
286
|
-
getEnvironmentInfoPrompt(context: {
|
|
287
|
-
cwd: string;
|
|
288
|
-
os: string;
|
|
289
|
-
shell: string;
|
|
290
|
-
}): string;
|
|
291
|
-
getSkillsPrompt(skills: any[]): Promise<string>;
|
|
292
|
-
getToolInstructions(context: {
|
|
293
|
-
cwd: string;
|
|
294
|
-
os: string;
|
|
295
|
-
allowDefaultTools?: string[];
|
|
296
|
-
customTools?: any[];
|
|
297
|
-
}): string;
|
|
298
|
-
getNoUseToolInstructions(context: any): string;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
251
|
/**
|
|
302
252
|
* 抽象的 System Prompt 管理器。
|
|
303
253
|
* 替代原始项目中复杂的 templates/variants,交由宿主自行提供或使用默认简单实现。
|
|
@@ -321,50 +271,6 @@ interface IPromptManager {
|
|
|
321
271
|
getNoUseToolInstructions(context: any): string;
|
|
322
272
|
}
|
|
323
273
|
|
|
324
|
-
/**
|
|
325
|
-
* Node 端 MemoryManager 实现
|
|
326
|
-
* 将对话历史持久化到本地文件系统(JSON 格式)。
|
|
327
|
-
*/
|
|
328
|
-
declare class NodeMemoryManager implements IMemoryManager {
|
|
329
|
-
private filePath;
|
|
330
|
-
private maxMessages;
|
|
331
|
-
/**
|
|
332
|
-
* @param dbPath 存储历史记录的本地文件路径(例如:'./.cline_memory.json')
|
|
333
|
-
* @param maxMessages 保留的最大消息数量,用于简单的历史截断(默认 150)
|
|
334
|
-
*/
|
|
335
|
-
constructor(dbPath: string, maxMessages?: number);
|
|
336
|
-
private ensureFile;
|
|
337
|
-
private readMessages;
|
|
338
|
-
private writeMessages;
|
|
339
|
-
getHistory(): Promise<AgentMessage[]>;
|
|
340
|
-
appendMessage(message: AgentMessage): Promise<void>;
|
|
341
|
-
condenseHistory(): Promise<void>;
|
|
342
|
-
clear(): Promise<void>;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Web 端 MemoryManager 实现
|
|
347
|
-
* 使用 IndexedDB (通过封装) 或 LocalStorage / SessionStorage 来持久化对话历史。
|
|
348
|
-
* 此处提供一个基于 SessionStorage / 内存 回退的轻量实现。
|
|
349
|
-
*/
|
|
350
|
-
declare class WebMemoryManager implements IMemoryManager {
|
|
351
|
-
private storageKey;
|
|
352
|
-
private maxMessages;
|
|
353
|
-
private inMemoryFallback;
|
|
354
|
-
/**
|
|
355
|
-
* @param storageKey SessionStorage 中的键名
|
|
356
|
-
* @param maxMessages 保留的最大消息数量,用于简单的历史截断(默认 150)
|
|
357
|
-
*/
|
|
358
|
-
constructor(storageKey?: string, maxMessages?: number);
|
|
359
|
-
private isStorageAvailable;
|
|
360
|
-
private readMessages;
|
|
361
|
-
private writeMessages;
|
|
362
|
-
getHistory(): Promise<AgentMessage[]>;
|
|
363
|
-
appendMessage(message: AgentMessage): Promise<void>;
|
|
364
|
-
condenseHistory(): Promise<void>;
|
|
365
|
-
clear(): Promise<void>;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
274
|
/**
|
|
369
275
|
* 统一的消息结构(这里做简单抽象,实际使用可对齐 LLM API 标准结构)
|
|
370
276
|
*/
|
|
@@ -395,47 +301,6 @@ interface IMemoryManager {
|
|
|
395
301
|
clear(): Promise<void>;
|
|
396
302
|
}
|
|
397
303
|
|
|
398
|
-
interface NodeApiHandlerConfig {
|
|
399
|
-
providerId?: string;
|
|
400
|
-
modelId?: string;
|
|
401
|
-
apiKey: string;
|
|
402
|
-
baseURL?: string;
|
|
403
|
-
headers?: Record<string, string>;
|
|
404
|
-
fetch?: typeof fetch;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Node 端的 LLM API 处理器 (已通过 Vercel AI SDK 重构)
|
|
408
|
-
* 支持灵活对接 OpenAI 及各类兼容 OpenAI 规范的平台 (DeepSeek, Dify 等)
|
|
409
|
-
*/
|
|
410
|
-
declare class NodeApiHandler implements IApiHandler {
|
|
411
|
-
private config;
|
|
412
|
-
private conversationId?;
|
|
413
|
-
constructor(config: NodeApiHandlerConfig);
|
|
414
|
-
getModelInfo(): ApiProviderInfo;
|
|
415
|
-
createMessage(systemPrompt: string, messages: AgentMessage[]): AsyncGenerator<ApiStreamChunk, void, unknown>;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
interface WebApiHandlerConfig {
|
|
419
|
-
providerId?: string;
|
|
420
|
-
modelId?: string;
|
|
421
|
-
apiKey: string;
|
|
422
|
-
baseURL?: string;
|
|
423
|
-
headers?: Record<string, string>;
|
|
424
|
-
fetch?: typeof fetch;
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Web 端的 LLM API 处理器 (已通过 Vercel AI SDK 重构)
|
|
428
|
-
* 支持灵活对接 OpenAI 及各类兼容 OpenAI 规范的平台 (DeepSeek, Dify 等)
|
|
429
|
-
* 由于 Vercel AI SDK 底层统一使用标准的 Web Fetch API,Web 端的逻辑可以做到与 Node 端完全一致。
|
|
430
|
-
*/
|
|
431
|
-
declare class WebApiHandler implements IApiHandler {
|
|
432
|
-
private config;
|
|
433
|
-
private conversationId?;
|
|
434
|
-
constructor(config: WebApiHandlerConfig);
|
|
435
|
-
getModelInfo(): ApiProviderInfo;
|
|
436
|
-
createMessage(systemPrompt: string, messages: AgentMessage[]): AsyncGenerator<ApiStreamChunk, void, unknown>;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
304
|
/**
|
|
440
305
|
* 统一的 API 响应流数据块
|
|
441
306
|
*/
|
|
@@ -606,35 +471,6 @@ declare class ClineAgent {
|
|
|
606
471
|
getHistory(): Promise<AgentMessage[]>;
|
|
607
472
|
}
|
|
608
473
|
|
|
609
|
-
interface NodeAgentOptions {
|
|
610
|
-
apiConfig: NodeApiHandlerConfig;
|
|
611
|
-
dbPath?: string;
|
|
612
|
-
customInstructions?: string;
|
|
613
|
-
customTools?: any[];
|
|
614
|
-
allowDefaultTools?: string[];
|
|
615
|
-
memory?: NodeMemoryManager | WebMemoryManager;
|
|
616
|
-
maxLoopCount?: number;
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* 快速创建 Node 端 Agent 的工厂方法
|
|
620
|
-
*/
|
|
621
|
-
declare function createNodeAgent(options: NodeAgentOptions): ClineAgent;
|
|
622
|
-
|
|
623
|
-
interface WebAgentOptions {
|
|
624
|
-
apiConfig: WebApiHandlerConfig;
|
|
625
|
-
dbPath?: string;
|
|
626
|
-
customInstructions?: string;
|
|
627
|
-
customTools?: any[];
|
|
628
|
-
allowDefaultTools?: string[];
|
|
629
|
-
memory?: WebMemoryManager;
|
|
630
|
-
maxLoopCount?: number;
|
|
631
|
-
storageKey?: string;
|
|
632
|
-
}
|
|
633
|
-
/**
|
|
634
|
-
* 快速创建 Web 端 Agent 的工厂方法
|
|
635
|
-
*/
|
|
636
|
-
declare function createWebAgent(options: WebAgentOptions): ClineAgent;
|
|
637
|
-
|
|
638
474
|
declare const VERSION = "0.1.0";
|
|
639
475
|
|
|
640
|
-
export { AgentDefaultTool, type AgentMessage, type AgentOptions, AgentState, type ApiProviderInfo, type ApiStreamChunk, type AssistantMessageContent, ClineAgent, type IAgentRuntime, type IApiHandler, type IMcpManager, type IMemoryManager, type IPromptManager, type McpServerInfo, type McpTool, type McpToolCallResult,
|
|
476
|
+
export { AgentDefaultTool, type AgentMessage, type AgentOptions, AgentState, type ApiProviderInfo, type ApiStreamChunk, type AssistantMessageContent, ClineAgent, type IAgentRuntime, type IApiHandler, type IMcpManager, type IMemoryManager, type IPromptManager, type McpServerInfo, type McpTool, type McpToolCallResult, READ_ONLY_TOOLS, type ReasoningStreamContent, TOOL_RESULT_BLOCK, type TextStreamContent, type ToolParamName, type ToolUse, VERSION, defaultTools, getToolUseNames, parseAssistantMessageV2, setDynamicToolUseNames, toolParamNames, toolUseNames };
|