sdkwork-browser-agent 1.0.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.
Files changed (146) hide show
  1. package/README.md +228 -0
  2. package/README.zh.md +228 -0
  3. package/dist/agent-Bpxmkz8W.d.ts +197 -0
  4. package/dist/agent-kexkkI13.d.cts +197 -0
  5. package/dist/browser/agent-Bpxmkz8W.d.ts +197 -0
  6. package/dist/browser/chunk-7W2JJCSS.js +276 -0
  7. package/dist/browser/chunk-7W2JJCSS.js.map +1 -0
  8. package/dist/browser/chunk-BHRFRGR7.js +144 -0
  9. package/dist/browser/chunk-BHRFRGR7.js.map +1 -0
  10. package/dist/browser/chunk-CLP6UNSV.js +285 -0
  11. package/dist/browser/chunk-CLP6UNSV.js.map +1 -0
  12. package/dist/browser/chunk-HXLRBB7S.js +1569 -0
  13. package/dist/browser/chunk-HXLRBB7S.js.map +1 -0
  14. package/dist/browser/chunk-VJEFLRZT.js +1720 -0
  15. package/dist/browser/chunk-VJEFLRZT.js.map +1 -0
  16. package/dist/browser/index.d.ts +842 -0
  17. package/dist/browser/index.js +3293 -0
  18. package/dist/browser/index.js.map +1 -0
  19. package/dist/browser/llm/index.d.ts +235 -0
  20. package/dist/browser/llm/index.js +29 -0
  21. package/dist/browser/llm/index.js.map +1 -0
  22. package/dist/browser/mcp/index.d.ts +63 -0
  23. package/dist/browser/mcp/index.js +9 -0
  24. package/dist/browser/mcp/index.js.map +1 -0
  25. package/dist/browser/provider-Dna36xA-.d.ts +105 -0
  26. package/dist/browser/skills/index.d.ts +401 -0
  27. package/dist/browser/skills/index.js +31 -0
  28. package/dist/browser/skills/index.js.map +1 -0
  29. package/dist/browser/storage/index.d.ts +64 -0
  30. package/dist/browser/storage/index.js +15 -0
  31. package/dist/browser/storage/index.js.map +1 -0
  32. package/dist/browser/tools/index.d.ts +45 -0
  33. package/dist/browser/tools/index.js +15 -0
  34. package/dist/browser/tools/index.js.map +1 -0
  35. package/dist/browser/types-CG5I-byI.d.ts +30 -0
  36. package/dist/chunk-56J3IBXZ.js +144 -0
  37. package/dist/chunk-56J3IBXZ.js.map +1 -0
  38. package/dist/chunk-5XTVS5MB.js +1720 -0
  39. package/dist/chunk-5XTVS5MB.js.map +1 -0
  40. package/dist/chunk-6AYIRBGI.js +166 -0
  41. package/dist/chunk-6AYIRBGI.js.map +1 -0
  42. package/dist/chunk-C2EYJHXW.cjs +276 -0
  43. package/dist/chunk-C2EYJHXW.cjs.map +1 -0
  44. package/dist/chunk-HOZQ445W.cjs +166 -0
  45. package/dist/chunk-HOZQ445W.cjs.map +1 -0
  46. package/dist/chunk-KZNZ6CGD.cjs +144 -0
  47. package/dist/chunk-KZNZ6CGD.cjs.map +1 -0
  48. package/dist/chunk-XFMT5ZA4.js +276 -0
  49. package/dist/chunk-XFMT5ZA4.js.map +1 -0
  50. package/dist/chunk-XPGICLEJ.cjs +1720 -0
  51. package/dist/chunk-XPGICLEJ.cjs.map +1 -0
  52. package/dist/index.cjs +1311 -0
  53. package/dist/index.cjs.map +1 -0
  54. package/dist/index.d.cts +395 -0
  55. package/dist/index.d.ts +395 -0
  56. package/dist/index.js +1311 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/llm/index.cjs +29 -0
  59. package/dist/llm/index.cjs.map +1 -0
  60. package/dist/llm/index.d.cts +235 -0
  61. package/dist/llm/index.d.ts +235 -0
  62. package/dist/llm/index.js +29 -0
  63. package/dist/llm/index.js.map +1 -0
  64. package/dist/mcp/index.cjs +9 -0
  65. package/dist/mcp/index.cjs.map +1 -0
  66. package/dist/mcp/index.d.cts +63 -0
  67. package/dist/mcp/index.d.ts +63 -0
  68. package/dist/mcp/index.js +9 -0
  69. package/dist/mcp/index.js.map +1 -0
  70. package/dist/node/agent-Bpxmkz8W.d.ts +197 -0
  71. package/dist/node/agent-kexkkI13.d.cts +197 -0
  72. package/dist/node/chunk-7W2JJCSS.js +276 -0
  73. package/dist/node/chunk-7W2JJCSS.js.map +1 -0
  74. package/dist/node/chunk-BHRFRGR7.js +144 -0
  75. package/dist/node/chunk-BHRFRGR7.js.map +1 -0
  76. package/dist/node/chunk-CLP6UNSV.js +285 -0
  77. package/dist/node/chunk-CLP6UNSV.js.map +1 -0
  78. package/dist/node/chunk-HXLRBB7S.js +1569 -0
  79. package/dist/node/chunk-HXLRBB7S.js.map +1 -0
  80. package/dist/node/chunk-IYG37UN3.cjs +144 -0
  81. package/dist/node/chunk-IYG37UN3.cjs.map +1 -0
  82. package/dist/node/chunk-JF33ZOMB.cjs +285 -0
  83. package/dist/node/chunk-JF33ZOMB.cjs.map +1 -0
  84. package/dist/node/chunk-KXXS33G3.cjs +276 -0
  85. package/dist/node/chunk-KXXS33G3.cjs.map +1 -0
  86. package/dist/node/chunk-MTFOABGC.cjs +1720 -0
  87. package/dist/node/chunk-MTFOABGC.cjs.map +1 -0
  88. package/dist/node/chunk-VJEFLRZT.js +1720 -0
  89. package/dist/node/chunk-VJEFLRZT.js.map +1 -0
  90. package/dist/node/chunk-YDHQCPSN.cjs +1569 -0
  91. package/dist/node/chunk-YDHQCPSN.cjs.map +1 -0
  92. package/dist/node/index.cjs +3293 -0
  93. package/dist/node/index.cjs.map +1 -0
  94. package/dist/node/index.d.cts +842 -0
  95. package/dist/node/index.d.ts +842 -0
  96. package/dist/node/index.js +3293 -0
  97. package/dist/node/index.js.map +1 -0
  98. package/dist/node/llm/index.cjs +29 -0
  99. package/dist/node/llm/index.cjs.map +1 -0
  100. package/dist/node/llm/index.d.cts +235 -0
  101. package/dist/node/llm/index.d.ts +235 -0
  102. package/dist/node/llm/index.js +29 -0
  103. package/dist/node/llm/index.js.map +1 -0
  104. package/dist/node/mcp/index.cjs +9 -0
  105. package/dist/node/mcp/index.cjs.map +1 -0
  106. package/dist/node/mcp/index.d.cts +63 -0
  107. package/dist/node/mcp/index.d.ts +63 -0
  108. package/dist/node/mcp/index.js +9 -0
  109. package/dist/node/mcp/index.js.map +1 -0
  110. package/dist/node/provider-Dna36xA-.d.cts +105 -0
  111. package/dist/node/provider-Dna36xA-.d.ts +105 -0
  112. package/dist/node/skills/index.cjs +31 -0
  113. package/dist/node/skills/index.cjs.map +1 -0
  114. package/dist/node/skills/index.d.cts +401 -0
  115. package/dist/node/skills/index.d.ts +401 -0
  116. package/dist/node/skills/index.js +31 -0
  117. package/dist/node/skills/index.js.map +1 -0
  118. package/dist/node/storage/index.cjs +15 -0
  119. package/dist/node/storage/index.cjs.map +1 -0
  120. package/dist/node/storage/index.d.cts +64 -0
  121. package/dist/node/storage/index.d.ts +64 -0
  122. package/dist/node/storage/index.js +15 -0
  123. package/dist/node/storage/index.js.map +1 -0
  124. package/dist/node/tools/index.cjs +15 -0
  125. package/dist/node/tools/index.cjs.map +1 -0
  126. package/dist/node/tools/index.d.cts +45 -0
  127. package/dist/node/tools/index.d.ts +45 -0
  128. package/dist/node/tools/index.js +15 -0
  129. package/dist/node/tools/index.js.map +1 -0
  130. package/dist/node/types-CG5I-byI.d.cts +30 -0
  131. package/dist/node/types-CG5I-byI.d.ts +30 -0
  132. package/dist/provider-Dna36xA-.d.cts +105 -0
  133. package/dist/provider-Dna36xA-.d.ts +105 -0
  134. package/dist/skills/index.cjs +15 -0
  135. package/dist/skills/index.cjs.map +1 -0
  136. package/dist/skills/index.d.cts +43 -0
  137. package/dist/skills/index.d.ts +43 -0
  138. package/dist/skills/index.js +15 -0
  139. package/dist/skills/index.js.map +1 -0
  140. package/dist/tools/index.cjs +15 -0
  141. package/dist/tools/index.cjs.map +1 -0
  142. package/dist/tools/index.d.cts +45 -0
  143. package/dist/tools/index.d.ts +45 -0
  144. package/dist/tools/index.js +15 -0
  145. package/dist/tools/index.js.map +1 -0
  146. package/package.json +150 -0
@@ -0,0 +1,235 @@
1
+ import { f as LLMProviderConfig, L as LLMProvider, b as LLMRequest, c as LLMResponse, d as LLMStreamChunk } from '../provider-Dna36xA-.js';
2
+ export { e as LLMManager, a as LLMMessage, g as LLMProviderFactory, h as LLMProviderRegistry, i as ToolCall, T as ToolDefinition, j as globalProviderRegistry } from '../provider-Dna36xA-.js';
3
+
4
+ /**
5
+ * OpenAI Provider Implementation
6
+ * Updated with latest GPT-5 series models (2025)
7
+ */
8
+
9
+ interface OpenAIConfig extends LLMProviderConfig {
10
+ organization?: string;
11
+ project?: string;
12
+ }
13
+ declare class OpenAIProvider implements LLMProvider {
14
+ readonly name = "openai";
15
+ readonly supportedModels: string[];
16
+ private _apiKey;
17
+ private _baseUrl;
18
+ private _defaultParams;
19
+ private _timeout;
20
+ private _organization?;
21
+ private _project?;
22
+ constructor(config: OpenAIConfig);
23
+ validateConfig(): boolean;
24
+ private makeRequest;
25
+ complete(request: LLMRequest): Promise<LLMResponse>;
26
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
27
+ private buildRequestBody;
28
+ private formatMessages;
29
+ private parseResponse;
30
+ private parseStreamChunk;
31
+ }
32
+
33
+ /**
34
+ * Anthropic Claude Provider Implementation
35
+ * Updated with Claude 4.5 series models (2025)
36
+ */
37
+
38
+ interface AnthropicConfig extends LLMProviderConfig {
39
+ anthropicVersion?: string;
40
+ }
41
+ declare class AnthropicProvider implements LLMProvider {
42
+ readonly name = "anthropic";
43
+ readonly supportedModels: string[];
44
+ private _apiKey;
45
+ private _baseUrl;
46
+ private _defaultParams;
47
+ private _timeout;
48
+ private _anthropicVersion;
49
+ constructor(config: AnthropicConfig);
50
+ validateConfig(): boolean;
51
+ private makeRequest;
52
+ complete(request: LLMRequest): Promise<LLMResponse>;
53
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
54
+ private buildRequestBody;
55
+ private parseResponse;
56
+ private parseStreamChunk;
57
+ }
58
+
59
+ /**
60
+ * Google Gemini Provider Implementation
61
+ * Updated with Gemini 2.0/3.0 series models (2025)
62
+ */
63
+
64
+ interface GeminiConfig extends LLMProviderConfig {
65
+ apiVersion?: string;
66
+ }
67
+ declare class GeminiProvider implements LLMProvider {
68
+ readonly name = "gemini";
69
+ readonly supportedModels: string[];
70
+ private _apiKey;
71
+ private _baseUrl;
72
+ private _defaultParams;
73
+ private _timeout;
74
+ private _apiVersion;
75
+ constructor(config: GeminiConfig);
76
+ validateConfig(): boolean;
77
+ private makeRequest;
78
+ complete(request: LLMRequest): Promise<LLMResponse>;
79
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
80
+ private buildRequestBody;
81
+ private parseResponse;
82
+ private parseStreamChunk;
83
+ }
84
+
85
+ /**
86
+ * Moonshot (月之暗面) Provider Implementation
87
+ * API: https://platform.moonshot.cn
88
+ */
89
+
90
+ interface MoonshotConfig extends LLMProviderConfig {
91
+ }
92
+ declare class MoonshotProvider implements LLMProvider {
93
+ readonly name = "moonshot";
94
+ readonly supportedModels: string[];
95
+ private _apiKey;
96
+ private _baseUrl;
97
+ private _defaultParams;
98
+ private _timeout;
99
+ constructor(config: MoonshotConfig);
100
+ validateConfig(): boolean;
101
+ private makeRequest;
102
+ complete(request: LLMRequest): Promise<LLMResponse>;
103
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
104
+ private buildRequestBody;
105
+ private parseResponse;
106
+ private parseStreamChunk;
107
+ }
108
+
109
+ /**
110
+ * MiniMax Provider Implementation
111
+ * API: https://platform.minimaxi.com
112
+ */
113
+
114
+ interface MiniMaxConfig extends LLMProviderConfig {
115
+ groupId?: string;
116
+ }
117
+ declare class MiniMaxProvider implements LLMProvider {
118
+ readonly name = "minimax";
119
+ readonly supportedModels: string[];
120
+ private _apiKey;
121
+ private _groupId;
122
+ private _baseUrl;
123
+ private _defaultParams;
124
+ private _timeout;
125
+ constructor(config: MiniMaxConfig);
126
+ validateConfig(): boolean;
127
+ private makeRequest;
128
+ complete(request: LLMRequest): Promise<LLMResponse>;
129
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
130
+ private buildRequestBody;
131
+ private parseResponse;
132
+ private parseStreamChunk;
133
+ }
134
+
135
+ /**
136
+ * Zhipu AI (智谱AI) Provider Implementation
137
+ * API: https://open.bigmodel.cn
138
+ */
139
+
140
+ interface ZhipuConfig extends LLMProviderConfig {
141
+ }
142
+ declare class ZhipuProvider implements LLMProvider {
143
+ readonly name = "zhipu";
144
+ readonly supportedModels: string[];
145
+ private _apiKey;
146
+ private _baseUrl;
147
+ private _defaultParams;
148
+ private _timeout;
149
+ constructor(config: ZhipuConfig);
150
+ validateConfig(): boolean;
151
+ private makeRequest;
152
+ complete(request: LLMRequest): Promise<LLMResponse>;
153
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
154
+ private buildRequestBody;
155
+ private parseResponse;
156
+ private parseStreamChunk;
157
+ }
158
+
159
+ /**
160
+ * Qwen (通义千问) Provider Implementation
161
+ * API: https://dashscope.aliyun.com
162
+ * Updated with latest Qwen3 series models (2025)
163
+ */
164
+
165
+ interface QwenConfig extends LLMProviderConfig {
166
+ }
167
+ declare class QwenProvider implements LLMProvider {
168
+ readonly name = "qwen";
169
+ readonly supportedModels: string[];
170
+ private _apiKey;
171
+ private _baseUrl;
172
+ private _defaultParams;
173
+ private _timeout;
174
+ constructor(config: QwenConfig);
175
+ validateConfig(): boolean;
176
+ private makeRequest;
177
+ complete(request: LLMRequest): Promise<LLMResponse>;
178
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
179
+ private buildRequestBody;
180
+ private parseResponse;
181
+ private parseStreamChunk;
182
+ }
183
+
184
+ /**
185
+ * DeepSeek Provider Implementation
186
+ * API: https://platform.deepseek.com
187
+ * Updated with latest DeepSeek-V3.2 models (2025)
188
+ */
189
+
190
+ interface DeepSeekConfig extends LLMProviderConfig {
191
+ }
192
+ declare class DeepSeekProvider implements LLMProvider {
193
+ readonly name = "deepseek";
194
+ readonly supportedModels: string[];
195
+ private _apiKey;
196
+ private _baseUrl;
197
+ private _defaultParams;
198
+ private _timeout;
199
+ constructor(config: DeepSeekConfig);
200
+ validateConfig(): boolean;
201
+ private makeRequest;
202
+ complete(request: LLMRequest): Promise<LLMResponse>;
203
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
204
+ private buildRequestBody;
205
+ private parseResponse;
206
+ private parseStreamChunk;
207
+ }
208
+
209
+ /**
210
+ * Doubao (豆包) Provider Implementation
211
+ * API: https://console.volcengine.com/ark
212
+ * Updated with latest Doubao 1.8 series models (2025)
213
+ */
214
+
215
+ interface DoubaoConfig extends LLMProviderConfig {
216
+ region?: string;
217
+ }
218
+ declare class DoubaoProvider implements LLMProvider {
219
+ readonly name = "doubao";
220
+ readonly supportedModels: string[];
221
+ private _apiKey;
222
+ private _baseUrl;
223
+ private _defaultParams;
224
+ private _timeout;
225
+ constructor(config: DoubaoConfig);
226
+ validateConfig(): boolean;
227
+ private makeRequest;
228
+ complete(request: LLMRequest): Promise<LLMResponse>;
229
+ stream(request: LLMRequest): AsyncIterableIterator<LLMStreamChunk>;
230
+ private buildRequestBody;
231
+ private parseResponse;
232
+ private parseStreamChunk;
233
+ }
234
+
235
+ export { type AnthropicConfig, AnthropicProvider, type DeepSeekConfig, DeepSeekProvider, type DoubaoConfig, DoubaoProvider, type GeminiConfig, GeminiProvider, LLMProvider, LLMProviderConfig, LLMRequest, LLMResponse, LLMStreamChunk, type MiniMaxConfig, MiniMaxProvider, type MoonshotConfig, MoonshotProvider, type OpenAIConfig, OpenAIProvider, type QwenConfig, QwenProvider, type ZhipuConfig, ZhipuProvider };
@@ -0,0 +1,29 @@
1
+ import {
2
+ AnthropicProvider,
3
+ DeepSeekProvider,
4
+ DoubaoProvider,
5
+ GeminiProvider,
6
+ LLMManager,
7
+ LLMProviderRegistry,
8
+ MiniMaxProvider,
9
+ MoonshotProvider,
10
+ OpenAIProvider,
11
+ QwenProvider,
12
+ ZhipuProvider,
13
+ globalProviderRegistry
14
+ } from "../chunk-5XTVS5MB.js";
15
+ export {
16
+ AnthropicProvider,
17
+ DeepSeekProvider,
18
+ DoubaoProvider,
19
+ GeminiProvider,
20
+ LLMManager,
21
+ LLMProviderRegistry,
22
+ MiniMaxProvider,
23
+ MoonshotProvider,
24
+ OpenAIProvider,
25
+ QwenProvider,
26
+ ZhipuProvider,
27
+ globalProviderRegistry
28
+ };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkKZNZ6CGDcjs = require('../chunk-KZNZ6CGD.cjs');
5
+
6
+
7
+
8
+ exports.MCPClient = _chunkKZNZ6CGDcjs.MCPClient; exports.MCPServer = _chunkKZNZ6CGDcjs.MCPServer;
9
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["d:\\sdkwork-opensource\\sdkwork-browser-agent\\dist\\mcp\\index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACF,iGAAC","file":"D:\\sdkwork-opensource\\sdkwork-browser-agent\\dist\\mcp\\index.cjs"}
@@ -0,0 +1,63 @@
1
+ import { M as MCPResource, h as MCPTool, f as MCPResourceContent, i as MCPToolResult } from '../agent-kexkkI13.cjs';
2
+ import '../provider-Dna36xA-.cjs';
3
+
4
+ /**
5
+ * MCP (Model Context Protocol) Implementation
6
+ * https://modelcontextprotocol.io
7
+ */
8
+
9
+ interface MCPServerConfig {
10
+ name: string;
11
+ version: string;
12
+ resources?: MCPResource[];
13
+ tools?: MCPTool[];
14
+ }
15
+ interface MCPClientConfig {
16
+ url: string;
17
+ auth?: {
18
+ type: 'bearer' | 'apiKey';
19
+ token: string;
20
+ };
21
+ }
22
+ declare class MCPClient {
23
+ private config;
24
+ private resources;
25
+ private tools;
26
+ constructor(config: MCPClientConfig);
27
+ connect(): Promise<void>;
28
+ private createRemoteResource;
29
+ private createRemoteTool;
30
+ getResources(): MCPResource[];
31
+ getTools(): MCPTool[];
32
+ getResource(uri: string): MCPResource | undefined;
33
+ getTool(name: string): MCPTool | undefined;
34
+ }
35
+ declare class MCPServer {
36
+ private config;
37
+ private resources;
38
+ private tools;
39
+ constructor(config: MCPServerConfig);
40
+ registerResource(resource: MCPResource): void;
41
+ registerTool(tool: MCPTool): void;
42
+ unregisterResource(uri: string): boolean;
43
+ unregisterTool(name: string): boolean;
44
+ getCapabilities(): {
45
+ name: string;
46
+ version: string;
47
+ resources: Array<{
48
+ uri: string;
49
+ name: string;
50
+ description?: string;
51
+ mimeType?: string;
52
+ }>;
53
+ tools: Array<{
54
+ name: string;
55
+ description: string;
56
+ inputSchema: unknown;
57
+ }>;
58
+ };
59
+ readResource(uri: string): Promise<MCPResourceContent | null>;
60
+ executeTool(name: string, args: unknown): Promise<MCPToolResult | null>;
61
+ }
62
+
63
+ export { MCPClient, type MCPClientConfig, MCPServer, type MCPServerConfig };
@@ -0,0 +1,63 @@
1
+ import { M as MCPResource, h as MCPTool, f as MCPResourceContent, i as MCPToolResult } from '../agent-Bpxmkz8W.js';
2
+ import '../provider-Dna36xA-.js';
3
+
4
+ /**
5
+ * MCP (Model Context Protocol) Implementation
6
+ * https://modelcontextprotocol.io
7
+ */
8
+
9
+ interface MCPServerConfig {
10
+ name: string;
11
+ version: string;
12
+ resources?: MCPResource[];
13
+ tools?: MCPTool[];
14
+ }
15
+ interface MCPClientConfig {
16
+ url: string;
17
+ auth?: {
18
+ type: 'bearer' | 'apiKey';
19
+ token: string;
20
+ };
21
+ }
22
+ declare class MCPClient {
23
+ private config;
24
+ private resources;
25
+ private tools;
26
+ constructor(config: MCPClientConfig);
27
+ connect(): Promise<void>;
28
+ private createRemoteResource;
29
+ private createRemoteTool;
30
+ getResources(): MCPResource[];
31
+ getTools(): MCPTool[];
32
+ getResource(uri: string): MCPResource | undefined;
33
+ getTool(name: string): MCPTool | undefined;
34
+ }
35
+ declare class MCPServer {
36
+ private config;
37
+ private resources;
38
+ private tools;
39
+ constructor(config: MCPServerConfig);
40
+ registerResource(resource: MCPResource): void;
41
+ registerTool(tool: MCPTool): void;
42
+ unregisterResource(uri: string): boolean;
43
+ unregisterTool(name: string): boolean;
44
+ getCapabilities(): {
45
+ name: string;
46
+ version: string;
47
+ resources: Array<{
48
+ uri: string;
49
+ name: string;
50
+ description?: string;
51
+ mimeType?: string;
52
+ }>;
53
+ tools: Array<{
54
+ name: string;
55
+ description: string;
56
+ inputSchema: unknown;
57
+ }>;
58
+ };
59
+ readResource(uri: string): Promise<MCPResourceContent | null>;
60
+ executeTool(name: string, args: unknown): Promise<MCPToolResult | null>;
61
+ }
62
+
63
+ export { MCPClient, type MCPClientConfig, MCPServer, type MCPServerConfig };
@@ -0,0 +1,9 @@
1
+ import {
2
+ MCPClient,
3
+ MCPServer
4
+ } from "../chunk-56J3IBXZ.js";
5
+ export {
6
+ MCPClient,
7
+ MCPServer
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,197 @@
1
+ import { L as LLMProvider, a as LLMMessage, b as LLMRequest, c as LLMResponse, d as LLMStreamChunk, T as ToolDefinition } from './provider-Dna36xA-.js';
2
+
3
+ /**
4
+ * Core Agent Architecture
5
+ * High cohesion, low coupling design
6
+ * Compatible with https://agentskills.io/specification
7
+ */
8
+
9
+ interface Skill {
10
+ name: string;
11
+ description: string;
12
+ parameters: ParameterSchema;
13
+ handler: SkillHandler;
14
+ metadata?: SkillMetadata;
15
+ }
16
+ interface ParameterSchema {
17
+ type: 'object';
18
+ properties: Record<string, ParameterProperty>;
19
+ required?: string[];
20
+ }
21
+ interface ParameterProperty {
22
+ type: string;
23
+ description: string;
24
+ enum?: string[];
25
+ default?: unknown;
26
+ }
27
+ interface SkillMetadata {
28
+ category?: string;
29
+ tags?: string[];
30
+ version?: string;
31
+ author?: string;
32
+ deprecated?: boolean;
33
+ }
34
+ type SkillHandler = (params: Record<string, unknown>, context: ExecutionContext) => Promise<SkillResult>;
35
+ interface ExecutionContext {
36
+ agent: Agent;
37
+ skillName: string;
38
+ timestamp: Date;
39
+ metadata?: Record<string, unknown>;
40
+ }
41
+ interface SkillResult {
42
+ success: boolean;
43
+ data?: unknown;
44
+ error?: string;
45
+ metadata?: Record<string, unknown>;
46
+ }
47
+ interface Tool {
48
+ name: string;
49
+ description: string;
50
+ parameters?: ParameterSchema;
51
+ execute: ToolExecutor;
52
+ metadata?: ToolMetadata;
53
+ }
54
+ interface ToolMetadata {
55
+ category?: string;
56
+ tags?: string[];
57
+ version?: string;
58
+ requiresConfirmation?: boolean;
59
+ }
60
+ type ToolExecutor = (input: unknown, context: ExecutionContext) => Promise<ToolOutput>;
61
+ interface ToolOutput {
62
+ content: Array<{
63
+ type: string;
64
+ text?: string;
65
+ data?: unknown;
66
+ }>;
67
+ isError?: boolean;
68
+ metadata?: Record<string, unknown>;
69
+ }
70
+ interface MCPResource {
71
+ uri: string;
72
+ name: string;
73
+ description?: string;
74
+ mimeType?: string;
75
+ read: () => Promise<MCPResourceContent>;
76
+ metadata?: MCPResourceMetadata;
77
+ }
78
+ interface MCPResourceContent {
79
+ uri: string;
80
+ mimeType: string;
81
+ text?: string;
82
+ blob?: string;
83
+ metadata?: Record<string, unknown>;
84
+ }
85
+ interface MCPResourceMetadata {
86
+ size?: number;
87
+ lastModified?: Date;
88
+ etag?: string;
89
+ }
90
+ interface MCPTool {
91
+ name: string;
92
+ description: string;
93
+ inputSchema: unknown;
94
+ execute: (args: unknown, context: ExecutionContext) => Promise<MCPToolResult>;
95
+ metadata?: ToolMetadata;
96
+ }
97
+ interface MCPToolResult {
98
+ content: Array<{
99
+ type: string;
100
+ text?: string;
101
+ data?: unknown;
102
+ }>;
103
+ isError?: boolean;
104
+ metadata?: Record<string, unknown>;
105
+ }
106
+ interface Plugin {
107
+ name: string;
108
+ version: string;
109
+ description?: string;
110
+ initialize: (context: PluginContext) => Promise<void>;
111
+ destroy?: () => Promise<void>;
112
+ metadata?: PluginMetadata;
113
+ }
114
+ interface PluginMetadata {
115
+ author?: string;
116
+ homepage?: string;
117
+ repository?: string;
118
+ license?: string;
119
+ dependencies?: string[];
120
+ }
121
+ interface PluginContext {
122
+ agent: Agent;
123
+ registerSkill: (skill: Skill) => void;
124
+ registerTool: (tool: Tool) => void;
125
+ registerMCPResource: (resource: MCPResource) => void;
126
+ registerMCPTool: (tool: MCPTool) => void;
127
+ getLLMProvider: () => LLMProvider | undefined;
128
+ config: Record<string, unknown>;
129
+ }
130
+ interface AgentConfig {
131
+ name: string;
132
+ description?: string;
133
+ version?: string;
134
+ llmProvider?: LLMProvider;
135
+ systemPrompt?: string;
136
+ maxIterations?: number;
137
+ skills?: Skill[];
138
+ tools?: Tool[];
139
+ plugins?: Plugin[];
140
+ mcpResources?: MCPResource[];
141
+ mcpTools?: MCPTool[];
142
+ middlewares?: AgentMiddleware[];
143
+ hooks?: AgentHooks;
144
+ }
145
+ interface AgentHooks {
146
+ beforeSkillExecution?: (skillName: string, params: Record<string, unknown>) => Promise<void>;
147
+ afterSkillExecution?: (skillName: string, result: SkillResult) => Promise<void>;
148
+ onError?: (error: Error, context: ExecutionContext) => Promise<void>;
149
+ onToolCall?: (toolName: string, args: unknown) => Promise<void>;
150
+ }
151
+ type AgentMiddleware = (context: ExecutionContext, next: () => Promise<SkillResult>) => Promise<SkillResult>;
152
+ declare class Agent {
153
+ private config;
154
+ private _skills;
155
+ private _tools;
156
+ private _plugins;
157
+ private _mcpResources;
158
+ private _mcpTools;
159
+ private _middlewares;
160
+ private _initialized;
161
+ readonly name: string;
162
+ readonly description?: string;
163
+ readonly version?: string;
164
+ llmProvider?: LLMProvider;
165
+ systemPrompt?: string;
166
+ maxIterations: number;
167
+ hooks?: AgentHooks;
168
+ constructor(config: AgentConfig);
169
+ initialize(): Promise<void>;
170
+ registerSkill(skill: Skill): void;
171
+ registerTool(tool: Tool): void;
172
+ registerMCPResource(resource: MCPResource): void;
173
+ registerMCPTool(tool: MCPTool): void;
174
+ use(middleware: AgentMiddleware): void;
175
+ executeSkill(name: string, params?: Record<string, unknown>): Promise<SkillResult>;
176
+ executeTool(name: string, input: unknown): Promise<ToolOutput>;
177
+ readMCPResource(uri: string): Promise<MCPResourceContent | null>;
178
+ executeMCPTool(name: string, args: unknown): Promise<MCPToolResult>;
179
+ chat(messages: LLMMessage[], options?: Partial<LLMRequest>): Promise<LLMResponse>;
180
+ streamChat(messages: LLMMessage[], options?: Partial<LLMRequest>): AsyncIterableIterator<LLMStreamChunk>;
181
+ executeWithTools(messages: LLMMessage[], tools?: ToolDefinition[]): Promise<LLMResponse>;
182
+ getSkill(name: string): Skill | undefined;
183
+ getTool(name: string): Tool | undefined;
184
+ getMCPResource(uri: string): MCPResource | undefined;
185
+ getMCPTool(name: string): MCPTool | undefined;
186
+ getPlugin(name: string): Plugin | undefined;
187
+ getSkillNames(): string[];
188
+ getToolNames(): string[];
189
+ getMCPResourceURIs(): string[];
190
+ getMCPToolNames(): string[];
191
+ getPluginNames(): string[];
192
+ getAllSkills(): Skill[];
193
+ getAllTools(): Tool[];
194
+ destroy(): Promise<void>;
195
+ }
196
+
197
+ export { Agent as A, type ExecutionContext as E, type MCPResource as M, type Plugin as P, type Skill as S, type Tool as T, type SkillResult as a, type AgentConfig as b, type PluginContext as c, type AgentHooks as d, type AgentMiddleware as e, type MCPResourceContent as f, type MCPResourceMetadata as g, type MCPTool as h, type MCPToolResult as i, type ParameterProperty as j, type ParameterSchema as k, type PluginMetadata as l, type SkillHandler as m, type SkillMetadata as n, type ToolExecutor as o, type ToolMetadata as p, type ToolOutput as q };