@amical/aiagent-sdk 0.1.4 → 0.1.5

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.
@@ -1,6 +1,6 @@
1
1
  import * as fs from 'fs';
2
- import { IMemoryManager, AgentMessage, IMcpManager, McpServerInfo, McpTool, McpToolCallResult, IAgentRuntime, ClineAgent } from '../index.mjs';
3
- export { AgentDefaultTool, AgentOptions, AgentState, ApiProviderInfo, ApiStreamChunk, AssistantMessageContent, IApiHandler, IPromptManager, READ_ONLY_TOOLS, ReasoningStreamContent, TOOL_RESULT_BLOCK, TextStreamContent, ToolParamName, ToolUse, VERSION, defaultTools, getToolUseNames, parseAssistantMessageV2, setDynamicToolUseNames, toolParamNames, toolUseNames } from '../index.mjs';
2
+ import { IApiHandler, ApiProviderInfo, AgentMessage, ApiStreamChunk, IMemoryManager, IPromptManager, IMcpManager, McpServerInfo, McpTool, McpToolCallResult, IAgentRuntime, ClineAgent } from '../index.mjs';
3
+ export { AgentDefaultTool, AgentOptions, AgentState, AssistantMessageContent, READ_ONLY_TOOLS, ReasoningStreamContent, TOOL_RESULT_BLOCK, TextStreamContent, ToolParamName, ToolUse, VERSION, defaultTools, getToolUseNames, parseAssistantMessageV2, setDynamicToolUseNames, toolParamNames, toolUseNames } from '../index.mjs';
4
4
  import { W as WebMemoryManager } from '../WebMemoryManager-Bk19j8i6.mjs';
5
5
 
6
6
  interface NodeApiHandlerConfig {
@@ -11,6 +11,17 @@ interface NodeApiHandlerConfig {
11
11
  headers?: Record<string, string>;
12
12
  fetch?: typeof fetch;
13
13
  }
14
+ /**
15
+ * Node 端的 LLM API 处理器 (已通过 Vercel AI SDK 重构)
16
+ * 支持灵活对接 OpenAI 及各类兼容 OpenAI 规范的平台 (DeepSeek, Dify 等)
17
+ */
18
+ declare class NodeApiHandler implements IApiHandler {
19
+ private config;
20
+ private conversationId?;
21
+ constructor(config: NodeApiHandlerConfig);
22
+ getModelInfo(): ApiProviderInfo;
23
+ createMessage(systemPrompt: string, messages: AgentMessage[]): AsyncGenerator<ApiStreamChunk, void, unknown>;
24
+ }
14
25
 
15
26
  /**
16
27
  * Node 端 MemoryManager 实现
@@ -33,6 +44,31 @@ declare class NodeMemoryManager implements IMemoryManager {
33
44
  clear(): Promise<void>;
34
45
  }
35
46
 
47
+ declare class NodePromptManager implements IPromptManager {
48
+ getSystemPrompt(context: {
49
+ cwd: string;
50
+ os: string;
51
+ shell: string;
52
+ skills: any;
53
+ customInstructions?: string;
54
+ allowDefaultTools?: string[];
55
+ customTools?: any[];
56
+ }): Promise<string>;
57
+ getEnvironmentInfoPrompt(context: {
58
+ cwd: string;
59
+ os: string;
60
+ shell: string;
61
+ }): string;
62
+ getSkillsPrompt(skills: any[]): Promise<string>;
63
+ getToolInstructions(context: {
64
+ cwd: string;
65
+ os: string;
66
+ allowDefaultTools?: string[];
67
+ customTools?: any[];
68
+ }): string;
69
+ getNoUseToolInstructions(context: any): string;
70
+ }
71
+
36
72
  interface StdioServerConfig {
37
73
  command: string;
38
74
  args?: string[];
@@ -107,4 +143,4 @@ interface NodeAgentOptions {
107
143
  */
108
144
  declare function createNodeAgent(options: NodeAgentOptions): ClineAgent;
109
145
 
110
- export { AgentMessage, ClineAgent, DefaultNodeRuntime, IAgentRuntime, IMcpManager, IMemoryManager, McpServerInfo, McpTool, McpToolCallResult, type NodeAgentOptions, NodeMcpManager, type NodeMcpManagerConfig, type StdioServerConfig, createNodeAgent };
146
+ export { AgentMessage, ApiProviderInfo, ApiStreamChunk, ClineAgent, DefaultNodeRuntime, IAgentRuntime, IApiHandler, IMcpManager, IMemoryManager, IPromptManager, McpServerInfo, McpTool, McpToolCallResult, type NodeAgentOptions, NodeApiHandler, type NodeApiHandlerConfig, NodeMcpManager, type NodeMcpManagerConfig, NodeMemoryManager, NodePromptManager, type StdioServerConfig, createNodeAgent };
@@ -1,6 +1,6 @@
1
1
  import * as fs from 'fs';
2
- import { IMemoryManager, AgentMessage, IMcpManager, McpServerInfo, McpTool, McpToolCallResult, IAgentRuntime, ClineAgent } from '../index.js';
3
- export { AgentDefaultTool, AgentOptions, AgentState, ApiProviderInfo, ApiStreamChunk, AssistantMessageContent, IApiHandler, IPromptManager, READ_ONLY_TOOLS, ReasoningStreamContent, TOOL_RESULT_BLOCK, TextStreamContent, ToolParamName, ToolUse, VERSION, defaultTools, getToolUseNames, parseAssistantMessageV2, setDynamicToolUseNames, toolParamNames, toolUseNames } from '../index.js';
2
+ import { IApiHandler, ApiProviderInfo, AgentMessage, ApiStreamChunk, IMemoryManager, IPromptManager, IMcpManager, McpServerInfo, McpTool, McpToolCallResult, IAgentRuntime, ClineAgent } from '../index.js';
3
+ export { AgentDefaultTool, AgentOptions, AgentState, AssistantMessageContent, READ_ONLY_TOOLS, ReasoningStreamContent, TOOL_RESULT_BLOCK, TextStreamContent, ToolParamName, ToolUse, VERSION, defaultTools, getToolUseNames, parseAssistantMessageV2, setDynamicToolUseNames, toolParamNames, toolUseNames } from '../index.js';
4
4
  import { W as WebMemoryManager } from '../WebMemoryManager-DXxLUDBB.js';
5
5
 
6
6
  interface NodeApiHandlerConfig {
@@ -11,6 +11,17 @@ interface NodeApiHandlerConfig {
11
11
  headers?: Record<string, string>;
12
12
  fetch?: typeof fetch;
13
13
  }
14
+ /**
15
+ * Node 端的 LLM API 处理器 (已通过 Vercel AI SDK 重构)
16
+ * 支持灵活对接 OpenAI 及各类兼容 OpenAI 规范的平台 (DeepSeek, Dify 等)
17
+ */
18
+ declare class NodeApiHandler implements IApiHandler {
19
+ private config;
20
+ private conversationId?;
21
+ constructor(config: NodeApiHandlerConfig);
22
+ getModelInfo(): ApiProviderInfo;
23
+ createMessage(systemPrompt: string, messages: AgentMessage[]): AsyncGenerator<ApiStreamChunk, void, unknown>;
24
+ }
14
25
 
15
26
  /**
16
27
  * Node 端 MemoryManager 实现
@@ -33,6 +44,31 @@ declare class NodeMemoryManager implements IMemoryManager {
33
44
  clear(): Promise<void>;
34
45
  }
35
46
 
47
+ declare class NodePromptManager implements IPromptManager {
48
+ getSystemPrompt(context: {
49
+ cwd: string;
50
+ os: string;
51
+ shell: string;
52
+ skills: any;
53
+ customInstructions?: string;
54
+ allowDefaultTools?: string[];
55
+ customTools?: any[];
56
+ }): Promise<string>;
57
+ getEnvironmentInfoPrompt(context: {
58
+ cwd: string;
59
+ os: string;
60
+ shell: string;
61
+ }): string;
62
+ getSkillsPrompt(skills: any[]): Promise<string>;
63
+ getToolInstructions(context: {
64
+ cwd: string;
65
+ os: string;
66
+ allowDefaultTools?: string[];
67
+ customTools?: any[];
68
+ }): string;
69
+ getNoUseToolInstructions(context: any): string;
70
+ }
71
+
36
72
  interface StdioServerConfig {
37
73
  command: string;
38
74
  args?: string[];
@@ -107,4 +143,4 @@ interface NodeAgentOptions {
107
143
  */
108
144
  declare function createNodeAgent(options: NodeAgentOptions): ClineAgent;
109
145
 
110
- export { AgentMessage, ClineAgent, DefaultNodeRuntime, IAgentRuntime, IMcpManager, IMemoryManager, McpServerInfo, McpTool, McpToolCallResult, type NodeAgentOptions, NodeMcpManager, type NodeMcpManagerConfig, type StdioServerConfig, createNodeAgent };
146
+ export { AgentMessage, ApiProviderInfo, ApiStreamChunk, ClineAgent, DefaultNodeRuntime, IAgentRuntime, IApiHandler, IMcpManager, IMemoryManager, IPromptManager, McpServerInfo, McpTool, McpToolCallResult, type NodeAgentOptions, NodeApiHandler, type NodeApiHandlerConfig, NodeMcpManager, type NodeMcpManagerConfig, NodeMemoryManager, NodePromptManager, type StdioServerConfig, createNodeAgent };
@@ -1603,7 +1603,10 @@ exports.AgentDefaultTool = AgentDefaultTool;
1603
1603
  exports.AgentState = AgentState;
1604
1604
  exports.ClineAgent = ClineAgent;
1605
1605
  exports.DefaultNodeRuntime = DefaultNodeRuntime;
1606
+ exports.NodeApiHandler = NodeApiHandler;
1606
1607
  exports.NodeMcpManager = NodeMcpManager;
1608
+ exports.NodeMemoryManager = NodeMemoryManager;
1609
+ exports.NodePromptManager = NodePromptManager;
1607
1610
  exports.READ_ONLY_TOOLS = READ_ONLY_TOOLS;
1608
1611
  exports.TOOL_RESULT_BLOCK = TOOL_RESULT_BLOCK;
1609
1612
  exports.VERSION = VERSION;