@ggakila/agentx-framework 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/CHANGELOG.md +107 -0
- package/LICENSE +21 -0
- package/README.md +335 -0
- package/dist/agent/Agent.d.ts +110 -0
- package/dist/agent/Agent.d.ts.map +1 -0
- package/dist/agent/Agent.js +291 -0
- package/dist/agent/Agent.js.map +1 -0
- package/dist/agent/index.d.ts +5 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +11 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/cli/CLI.d.ts +74 -0
- package/dist/cli/CLI.d.ts.map +1 -0
- package/dist/cli/CLI.js +255 -0
- package/dist/cli/CLI.js.map +1 -0
- package/dist/cli/InteractiveSetup.d.ts +104 -0
- package/dist/cli/InteractiveSetup.d.ts.map +1 -0
- package/dist/cli/InteractiveSetup.js +2225 -0
- package/dist/cli/InteractiveSetup.js.map +1 -0
- package/dist/cli/bin.d.ts +7 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +35 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/ProjectCommands.d.ts +23 -0
- package/dist/cli/commands/ProjectCommands.d.ts.map +1 -0
- package/dist/cli/commands/ProjectCommands.js +504 -0
- package/dist/cli/commands/ProjectCommands.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +21 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/credential/CredentialManager.d.ts +112 -0
- package/dist/credential/CredentialManager.d.ts.map +1 -0
- package/dist/credential/CredentialManager.js +343 -0
- package/dist/credential/CredentialManager.js.map +1 -0
- package/dist/credential/OAuth2Manager.d.ts +206 -0
- package/dist/credential/OAuth2Manager.d.ts.map +1 -0
- package/dist/credential/OAuth2Manager.js +463 -0
- package/dist/credential/OAuth2Manager.js.map +1 -0
- package/dist/credential/index.d.ts +6 -0
- package/dist/credential/index.d.ts.map +1 -0
- package/dist/credential/index.js +16 -0
- package/dist/credential/index.js.map +1 -0
- package/dist/error/ErrorHandler.d.ts +74 -0
- package/dist/error/ErrorHandler.d.ts.map +1 -0
- package/dist/error/ErrorHandler.js +279 -0
- package/dist/error/ErrorHandler.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/DatabaseTool.d.ts +149 -0
- package/dist/integrations/DatabaseTool.d.ts.map +1 -0
- package/dist/integrations/DatabaseTool.js +900 -0
- package/dist/integrations/DatabaseTool.js.map +1 -0
- package/dist/integrations/EmailTool.d.ts +142 -0
- package/dist/integrations/EmailTool.d.ts.map +1 -0
- package/dist/integrations/EmailTool.js +259 -0
- package/dist/integrations/EmailTool.js.map +1 -0
- package/dist/integrations/FileSystemTool.d.ts +153 -0
- package/dist/integrations/FileSystemTool.d.ts.map +1 -0
- package/dist/integrations/FileSystemTool.js +835 -0
- package/dist/integrations/FileSystemTool.js.map +1 -0
- package/dist/integrations/GoogleWorkspaceTool.d.ts +125 -0
- package/dist/integrations/GoogleWorkspaceTool.d.ts.map +1 -0
- package/dist/integrations/GoogleWorkspaceTool.js +765 -0
- package/dist/integrations/GoogleWorkspaceTool.js.map +1 -0
- package/dist/integrations/HttpTool.d.ts +55 -0
- package/dist/integrations/HttpTool.d.ts.map +1 -0
- package/dist/integrations/HttpTool.js +209 -0
- package/dist/integrations/HttpTool.js.map +1 -0
- package/dist/integrations/MessagingTool.d.ts +136 -0
- package/dist/integrations/MessagingTool.d.ts.map +1 -0
- package/dist/integrations/MessagingTool.js +503 -0
- package/dist/integrations/MessagingTool.js.map +1 -0
- package/dist/integrations/SchedulerTool.d.ts +147 -0
- package/dist/integrations/SchedulerTool.d.ts.map +1 -0
- package/dist/integrations/SchedulerTool.js +471 -0
- package/dist/integrations/SchedulerTool.js.map +1 -0
- package/dist/integrations/WebhookTool.d.ts +97 -0
- package/dist/integrations/WebhookTool.d.ts.map +1 -0
- package/dist/integrations/WebhookTool.js +351 -0
- package/dist/integrations/WebhookTool.js.map +1 -0
- package/dist/integrations/index.d.ts +13 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +60 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/llm/LLMProvider.d.ts +83 -0
- package/dist/llm/LLMProvider.d.ts.map +1 -0
- package/dist/llm/LLMProvider.js +370 -0
- package/dist/llm/LLMProvider.js.map +1 -0
- package/dist/llm/index.d.ts +5 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +14 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/payment/PaymentProvider.d.ts +157 -0
- package/dist/payment/PaymentProvider.d.ts.map +1 -0
- package/dist/payment/PaymentProvider.js +525 -0
- package/dist/payment/PaymentProvider.js.map +1 -0
- package/dist/payment/index.d.ts +5 -0
- package/dist/payment/index.d.ts.map +1 -0
- package/dist/payment/index.js +16 -0
- package/dist/payment/index.js.map +1 -0
- package/dist/plugin/PluginManager.d.ts +156 -0
- package/dist/plugin/PluginManager.d.ts.map +1 -0
- package/dist/plugin/PluginManager.js +288 -0
- package/dist/plugin/PluginManager.js.map +1 -0
- package/dist/plugin/index.d.ts +5 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +10 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/runtime/AgentXRuntime.d.ts +90 -0
- package/dist/runtime/AgentXRuntime.d.ts.map +1 -0
- package/dist/runtime/AgentXRuntime.js +469 -0
- package/dist/runtime/AgentXRuntime.js.map +1 -0
- package/dist/security/SecurityManager.d.ts +245 -0
- package/dist/security/SecurityManager.d.ts.map +1 -0
- package/dist/security/SecurityManager.js +512 -0
- package/dist/security/SecurityManager.js.map +1 -0
- package/dist/security/index.d.ts +5 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +14 -0
- package/dist/security/index.js.map +1 -0
- package/dist/tool/ToolRegistry.d.ts +58 -0
- package/dist/tool/ToolRegistry.d.ts.map +1 -0
- package/dist/tool/ToolRegistry.js +173 -0
- package/dist/tool/ToolRegistry.js.map +1 -0
- package/dist/tool/ToolValidator.d.ts +41 -0
- package/dist/tool/ToolValidator.d.ts.map +1 -0
- package/dist/tool/ToolValidator.js +158 -0
- package/dist/tool/ToolValidator.js.map +1 -0
- package/dist/tool/index.d.ts +6 -0
- package/dist/tool/index.d.ts.map +1 -0
- package/dist/tool/index.js +11 -0
- package/dist/tool/index.js.map +1 -0
- package/dist/transport/BaseTransport.d.ts +66 -0
- package/dist/transport/BaseTransport.d.ts.map +1 -0
- package/dist/transport/BaseTransport.js +103 -0
- package/dist/transport/BaseTransport.js.map +1 -0
- package/dist/transport/HttpTransport.d.ts +41 -0
- package/dist/transport/HttpTransport.d.ts.map +1 -0
- package/dist/transport/HttpTransport.js +160 -0
- package/dist/transport/HttpTransport.js.map +1 -0
- package/dist/transport/LocalTransport.d.ts +40 -0
- package/dist/transport/LocalTransport.d.ts.map +1 -0
- package/dist/transport/LocalTransport.js +157 -0
- package/dist/transport/LocalTransport.js.map +1 -0
- package/dist/transport/QueueTransport.d.ts +63 -0
- package/dist/transport/QueueTransport.d.ts.map +1 -0
- package/dist/transport/QueueTransport.js +194 -0
- package/dist/transport/QueueTransport.js.map +1 -0
- package/dist/transport/StdioTransport.d.ts +51 -0
- package/dist/transport/StdioTransport.d.ts.map +1 -0
- package/dist/transport/StdioTransport.js +216 -0
- package/dist/transport/StdioTransport.js.map +1 -0
- package/dist/transport/TransportFactory.d.ts +35 -0
- package/dist/transport/TransportFactory.d.ts.map +1 -0
- package/dist/transport/TransportFactory.js +100 -0
- package/dist/transport/TransportFactory.js.map +1 -0
- package/dist/transport/index.d.ts +10 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +19 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/types/agent.d.ts +66 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +3 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/config.d.ts +60 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/credential.d.ts +38 -0
- package/dist/types/credential.d.ts.map +1 -0
- package/dist/types/credential.js +3 -0
- package/dist/types/credential.js.map +1 -0
- package/dist/types/error.d.ts +136 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/error.js +223 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +27 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/llm.d.ts +43 -0
- package/dist/types/llm.d.ts.map +1 -0
- package/dist/types/llm.js +3 -0
- package/dist/types/llm.js.map +1 -0
- package/dist/types/payment.d.ts +129 -0
- package/dist/types/payment.d.ts.map +1 -0
- package/dist/types/payment.js +6 -0
- package/dist/types/payment.js.map +1 -0
- package/dist/types/runtime.d.ts +31 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/runtime.js +3 -0
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/tool.d.ts +72 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/tool.js +3 -0
- package/dist/types/tool.js.map +1 -0
- package/dist/types/transport.d.ts +53 -0
- package/dist/types/transport.d.ts.map +1 -0
- package/dist/types/transport.js +3 -0
- package/dist/types/transport.js.map +1 -0
- package/dist/types/workflow.d.ts +72 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +6 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/utils/factory.d.ts +14 -0
- package/dist/utils/factory.d.ts.map +1 -0
- package/dist/utils/factory.js +146 -0
- package/dist/utils/factory.js.map +1 -0
- package/dist/workflow/StateManager.d.ts +93 -0
- package/dist/workflow/StateManager.d.ts.map +1 -0
- package/dist/workflow/StateManager.js +223 -0
- package/dist/workflow/StateManager.js.map +1 -0
- package/dist/workflow/WorkflowDefinition.d.ts +49 -0
- package/dist/workflow/WorkflowDefinition.d.ts.map +1 -0
- package/dist/workflow/WorkflowDefinition.js +264 -0
- package/dist/workflow/WorkflowDefinition.js.map +1 -0
- package/dist/workflow/WorkflowExecutor.d.ts +42 -0
- package/dist/workflow/WorkflowExecutor.d.ts.map +1 -0
- package/dist/workflow/WorkflowExecutor.js +372 -0
- package/dist/workflow/WorkflowExecutor.js.map +1 -0
- package/dist/workflow/index.d.ts +7 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +17 -0
- package/dist/workflow/index.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Webhook Integration Tool
|
|
4
|
+
* Provides webhook trigger and receiver capabilities
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.WebhookSender = exports.WebhookManager = exports.webhookToolSpec = void 0;
|
|
41
|
+
const uuid_1 = require("uuid");
|
|
42
|
+
const http = __importStar(require("http"));
|
|
43
|
+
const crypto = __importStar(require("crypto"));
|
|
44
|
+
const events_1 = require("events");
|
|
45
|
+
/**
|
|
46
|
+
* Webhook Tool Specification
|
|
47
|
+
*/
|
|
48
|
+
exports.webhookToolSpec = {
|
|
49
|
+
name: 'webhook',
|
|
50
|
+
version: '1.0.0',
|
|
51
|
+
description: 'Send and receive webhooks',
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
action: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
enum: ['send', 'register', 'unregister', 'list'],
|
|
58
|
+
description: 'Webhook action',
|
|
59
|
+
},
|
|
60
|
+
url: { type: 'string', description: 'Webhook URL (for send)' },
|
|
61
|
+
method: { type: 'string', enum: ['GET', 'POST', 'PUT', 'DELETE'] },
|
|
62
|
+
headers: { type: 'object', additionalProperties: { type: 'string' } },
|
|
63
|
+
body: { description: 'Webhook payload' },
|
|
64
|
+
secret: { type: 'string', description: 'Webhook secret for signing' },
|
|
65
|
+
path: { type: 'string', description: 'Webhook path (for register)' },
|
|
66
|
+
},
|
|
67
|
+
required: ['action'],
|
|
68
|
+
},
|
|
69
|
+
outputSchema: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
success: { type: 'boolean' },
|
|
73
|
+
webhookId: { type: 'string' },
|
|
74
|
+
response: { type: 'object' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Webhook Manager
|
|
80
|
+
*/
|
|
81
|
+
class WebhookManager extends events_1.EventEmitter {
|
|
82
|
+
webhooks = new Map();
|
|
83
|
+
server = null;
|
|
84
|
+
logger;
|
|
85
|
+
port;
|
|
86
|
+
host;
|
|
87
|
+
constructor(logger, port = 3000, host = '0.0.0.0') {
|
|
88
|
+
super();
|
|
89
|
+
this.logger = logger;
|
|
90
|
+
this.port = port;
|
|
91
|
+
this.host = host;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Start webhook server
|
|
95
|
+
*/
|
|
96
|
+
async start() {
|
|
97
|
+
if (this.server) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
this.server = http.createServer((req, res) => this.handleRequest(req, res));
|
|
101
|
+
return new Promise((resolve, reject) => {
|
|
102
|
+
this.server.listen(this.port, this.host, () => {
|
|
103
|
+
this.logger.info(`Webhook server started on ${this.host}:${this.port}`);
|
|
104
|
+
resolve();
|
|
105
|
+
});
|
|
106
|
+
this.server.on('error', reject);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Stop webhook server
|
|
111
|
+
*/
|
|
112
|
+
async stop() {
|
|
113
|
+
if (!this.server) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
return new Promise((resolve) => {
|
|
117
|
+
this.server.close(() => {
|
|
118
|
+
this.server = null;
|
|
119
|
+
this.logger.info('Webhook server stopped');
|
|
120
|
+
resolve();
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Register a webhook endpoint
|
|
126
|
+
*/
|
|
127
|
+
registerWebhook(config) {
|
|
128
|
+
const id = (0, uuid_1.v4)();
|
|
129
|
+
const webhook = { ...config, id };
|
|
130
|
+
this.webhooks.set(id, webhook);
|
|
131
|
+
this.logger.info(`Webhook registered: ${config.path}`, { webhookId: id });
|
|
132
|
+
return id;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Unregister a webhook
|
|
136
|
+
*/
|
|
137
|
+
unregisterWebhook(id) {
|
|
138
|
+
const deleted = this.webhooks.delete(id);
|
|
139
|
+
if (deleted) {
|
|
140
|
+
this.logger.info(`Webhook unregistered`, { webhookId: id });
|
|
141
|
+
}
|
|
142
|
+
return deleted;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* List registered webhooks
|
|
146
|
+
*/
|
|
147
|
+
listWebhooks() {
|
|
148
|
+
return Array.from(this.webhooks.values());
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get webhook by path
|
|
152
|
+
*/
|
|
153
|
+
getWebhookByPath(path, method) {
|
|
154
|
+
for (const webhook of this.webhooks.values()) {
|
|
155
|
+
if (webhook.path === path) {
|
|
156
|
+
if (webhook.method === 'ANY' || webhook.method === method) {
|
|
157
|
+
return webhook;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Handle incoming webhook request
|
|
165
|
+
*/
|
|
166
|
+
async handleRequest(req, res) {
|
|
167
|
+
const url = new URL(req.url || '/', `http://${req.headers.host}`);
|
|
168
|
+
const path = url.pathname;
|
|
169
|
+
const method = req.method || 'GET';
|
|
170
|
+
// Find matching webhook
|
|
171
|
+
const webhook = this.getWebhookByPath(path, method);
|
|
172
|
+
if (!webhook) {
|
|
173
|
+
res.writeHead(404, { 'Content-Type': 'application/json' });
|
|
174
|
+
res.end(JSON.stringify({ error: 'Webhook not found' }));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
// Parse body
|
|
179
|
+
const body = await this.parseBody(req);
|
|
180
|
+
// Verify signature if secret is configured
|
|
181
|
+
if (webhook.secret) {
|
|
182
|
+
const signature = req.headers['x-webhook-signature'];
|
|
183
|
+
if (!this.verifySignature(body, webhook.secret, signature)) {
|
|
184
|
+
res.writeHead(401, { 'Content-Type': 'application/json' });
|
|
185
|
+
res.end(JSON.stringify({ error: 'Invalid signature' }));
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Parse query params
|
|
190
|
+
const query = {};
|
|
191
|
+
url.searchParams.forEach((value, key) => {
|
|
192
|
+
query[key] = value;
|
|
193
|
+
});
|
|
194
|
+
// Parse headers
|
|
195
|
+
const headers = {};
|
|
196
|
+
for (const [key, value] of Object.entries(req.headers)) {
|
|
197
|
+
if (typeof value === 'string') {
|
|
198
|
+
headers[key] = value;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// Create event
|
|
202
|
+
const event = {
|
|
203
|
+
id: (0, uuid_1.v4)(),
|
|
204
|
+
webhookId: webhook.id,
|
|
205
|
+
timestamp: new Date(),
|
|
206
|
+
method,
|
|
207
|
+
path,
|
|
208
|
+
headers,
|
|
209
|
+
query,
|
|
210
|
+
body,
|
|
211
|
+
ip: req.socket.remoteAddress || '',
|
|
212
|
+
};
|
|
213
|
+
// Emit event
|
|
214
|
+
this.emit('webhook', event);
|
|
215
|
+
this.emit(`webhook:${webhook.id}`, event);
|
|
216
|
+
this.logger.debug(`Webhook received: ${path}`, { webhookId: webhook.id, eventId: event.id });
|
|
217
|
+
// Send response
|
|
218
|
+
const responseCode = webhook.responseCode || 200;
|
|
219
|
+
const responseBody = webhook.responseBody || { success: true, eventId: event.id };
|
|
220
|
+
res.writeHead(responseCode, {
|
|
221
|
+
'Content-Type': 'application/json',
|
|
222
|
+
...webhook.headers,
|
|
223
|
+
});
|
|
224
|
+
res.end(JSON.stringify(responseBody));
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
this.logger.error('Webhook handling error', error);
|
|
228
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
229
|
+
res.end(JSON.stringify({ error: 'Internal server error' }));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Parse request body
|
|
234
|
+
*/
|
|
235
|
+
parseBody(req) {
|
|
236
|
+
return new Promise((resolve, reject) => {
|
|
237
|
+
const chunks = [];
|
|
238
|
+
req.on('data', (chunk) => chunks.push(chunk));
|
|
239
|
+
req.on('end', () => {
|
|
240
|
+
const body = Buffer.concat(chunks).toString();
|
|
241
|
+
if (!body) {
|
|
242
|
+
resolve(null);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const contentType = req.headers['content-type'] || '';
|
|
246
|
+
if (contentType.includes('application/json')) {
|
|
247
|
+
try {
|
|
248
|
+
resolve(JSON.parse(body));
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
resolve(body);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
resolve(body);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
req.on('error', reject);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Verify webhook signature
|
|
263
|
+
*/
|
|
264
|
+
verifySignature(body, secret, signature) {
|
|
265
|
+
if (!signature) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
const payload = typeof body === 'string' ? body : JSON.stringify(body);
|
|
269
|
+
const expectedSignature = crypto
|
|
270
|
+
.createHmac('sha256', secret)
|
|
271
|
+
.update(payload)
|
|
272
|
+
.digest('hex');
|
|
273
|
+
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expectedSignature));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
exports.WebhookManager = WebhookManager;
|
|
277
|
+
/**
|
|
278
|
+
* Webhook Sender Tool
|
|
279
|
+
*/
|
|
280
|
+
class WebhookSender {
|
|
281
|
+
logger;
|
|
282
|
+
constructor(logger) {
|
|
283
|
+
this.logger = logger;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Send a webhook
|
|
287
|
+
*/
|
|
288
|
+
async send(input) {
|
|
289
|
+
try {
|
|
290
|
+
const method = input.method || 'POST';
|
|
291
|
+
const headers = {
|
|
292
|
+
'Content-Type': 'application/json',
|
|
293
|
+
'User-Agent': 'AgentX-Webhook/1.0',
|
|
294
|
+
...input.headers,
|
|
295
|
+
};
|
|
296
|
+
// Add signature if secret provided
|
|
297
|
+
let body;
|
|
298
|
+
if (input.body !== undefined) {
|
|
299
|
+
body = typeof input.body === 'string' ? input.body : JSON.stringify(input.body);
|
|
300
|
+
if (input.secret) {
|
|
301
|
+
const signature = crypto
|
|
302
|
+
.createHmac('sha256', input.secret)
|
|
303
|
+
.update(body)
|
|
304
|
+
.digest('hex');
|
|
305
|
+
const signatureHeader = input.signatureHeader || 'X-Webhook-Signature';
|
|
306
|
+
headers[signatureHeader] = signature;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
this.logger.debug(`Sending webhook to ${input.url}`, { method });
|
|
310
|
+
const response = await fetch(input.url, {
|
|
311
|
+
method,
|
|
312
|
+
headers,
|
|
313
|
+
body,
|
|
314
|
+
});
|
|
315
|
+
const responseBody = await response.text();
|
|
316
|
+
let parsedBody;
|
|
317
|
+
try {
|
|
318
|
+
parsedBody = JSON.parse(responseBody);
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
parsedBody = responseBody;
|
|
322
|
+
}
|
|
323
|
+
if (!response.ok) {
|
|
324
|
+
return {
|
|
325
|
+
success: false,
|
|
326
|
+
error: `Webhook failed: ${response.status} ${response.statusText}`,
|
|
327
|
+
data: {
|
|
328
|
+
status: response.status,
|
|
329
|
+
body: parsedBody,
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
success: true,
|
|
335
|
+
data: {
|
|
336
|
+
status: response.status,
|
|
337
|
+
body: parsedBody,
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
catch (error) {
|
|
342
|
+
this.logger.error('Webhook send error', error);
|
|
343
|
+
return {
|
|
344
|
+
success: false,
|
|
345
|
+
error: error.message,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
exports.WebhookSender = WebhookSender;
|
|
351
|
+
//# sourceMappingURL=WebhookTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookTool.js","sourceRoot":"","sources":["../../src/integrations/WebhookTool.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+BAAoC;AACpC,2CAA6B;AAE7B,+CAAiC;AAEjC,mCAAsC;AAiCtC;;GAEG;AACU,QAAA,eAAe,GAAa;IACvC,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC;gBAChD,WAAW,EAAE,gBAAgB;aAC9B;YACD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YAC9D,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE;YAClE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACrE,IAAI,EAAE,EAAE,WAA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+1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integrations Module Exports
|
|
3
|
+
* N8N-compatible integration tools
|
|
4
|
+
*/
|
|
5
|
+
export { HttpTool, HttpRequestInput, HttpResponse, httpToolSpec, } from './HttpTool';
|
|
6
|
+
export { WebhookManager, WebhookSender, WebhookConfig, WebhookEvent, WebhookSendInput, webhookToolSpec, } from './WebhookTool';
|
|
7
|
+
export { SchedulerManager, SchedulerTool, CronParser, ScheduleConfig, PollingConfig, ScheduleEvent, schedulerToolSpec, } from './SchedulerTool';
|
|
8
|
+
export { EmailTool, EmailTemplateEngine, EmailConfig, EmailMessage, EmailAttachment, ReceivedEmail, emailToolSpec, } from './EmailTool';
|
|
9
|
+
export { WhatsAppTool, SlackTool, TelegramTool, MessagingConfig, MessagePayload, MessageAttachment, IncomingMessage, whatsappToolSpec, slackToolSpec, telegramToolSpec, } from './MessagingTool';
|
|
10
|
+
export { GoogleDocsTool, GoogleSheetsTool, GoogleDriveTool, GoogleWorkspaceConfig, googleDocsToolSpec, googleSheetsToolSpec, googleDriveToolSpec, } from './GoogleWorkspaceTool';
|
|
11
|
+
export { SQLDatabaseTool, MongoDBTool, RedisTool, DatabaseConfig, QueryResult, sqlDatabaseToolSpec, mongoDBToolSpec, redisToolSpec, } from './DatabaseTool';
|
|
12
|
+
export { LocalFileSystemTool, S3Tool, FTPTool, FileSystemConfig, FileInfo, localFileSystemToolSpec, s3ToolSpec, ftpToolSpec, } from './FileSystemTool';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,mBAAmB,EACnB,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,uBAAuB,EACvB,UAAU,EACV,WAAW,GACZ,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Integrations Module Exports
|
|
4
|
+
* N8N-compatible integration tools
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ftpToolSpec = exports.s3ToolSpec = exports.localFileSystemToolSpec = exports.FTPTool = exports.S3Tool = exports.LocalFileSystemTool = exports.redisToolSpec = exports.mongoDBToolSpec = exports.sqlDatabaseToolSpec = exports.RedisTool = exports.MongoDBTool = exports.SQLDatabaseTool = exports.googleDriveToolSpec = exports.googleSheetsToolSpec = exports.googleDocsToolSpec = exports.GoogleDriveTool = exports.GoogleSheetsTool = exports.GoogleDocsTool = exports.telegramToolSpec = exports.slackToolSpec = exports.whatsappToolSpec = exports.TelegramTool = exports.SlackTool = exports.WhatsAppTool = exports.emailToolSpec = exports.EmailTemplateEngine = exports.EmailTool = exports.schedulerToolSpec = exports.CronParser = exports.SchedulerTool = exports.SchedulerManager = exports.webhookToolSpec = exports.WebhookSender = exports.WebhookManager = exports.httpToolSpec = exports.HttpTool = void 0;
|
|
8
|
+
// HTTP Integration
|
|
9
|
+
var HttpTool_1 = require("./HttpTool");
|
|
10
|
+
Object.defineProperty(exports, "HttpTool", { enumerable: true, get: function () { return HttpTool_1.HttpTool; } });
|
|
11
|
+
Object.defineProperty(exports, "httpToolSpec", { enumerable: true, get: function () { return HttpTool_1.httpToolSpec; } });
|
|
12
|
+
// Webhook Integration
|
|
13
|
+
var WebhookTool_1 = require("./WebhookTool");
|
|
14
|
+
Object.defineProperty(exports, "WebhookManager", { enumerable: true, get: function () { return WebhookTool_1.WebhookManager; } });
|
|
15
|
+
Object.defineProperty(exports, "WebhookSender", { enumerable: true, get: function () { return WebhookTool_1.WebhookSender; } });
|
|
16
|
+
Object.defineProperty(exports, "webhookToolSpec", { enumerable: true, get: function () { return WebhookTool_1.webhookToolSpec; } });
|
|
17
|
+
// Scheduler Integration
|
|
18
|
+
var SchedulerTool_1 = require("./SchedulerTool");
|
|
19
|
+
Object.defineProperty(exports, "SchedulerManager", { enumerable: true, get: function () { return SchedulerTool_1.SchedulerManager; } });
|
|
20
|
+
Object.defineProperty(exports, "SchedulerTool", { enumerable: true, get: function () { return SchedulerTool_1.SchedulerTool; } });
|
|
21
|
+
Object.defineProperty(exports, "CronParser", { enumerable: true, get: function () { return SchedulerTool_1.CronParser; } });
|
|
22
|
+
Object.defineProperty(exports, "schedulerToolSpec", { enumerable: true, get: function () { return SchedulerTool_1.schedulerToolSpec; } });
|
|
23
|
+
// Email Integration
|
|
24
|
+
var EmailTool_1 = require("./EmailTool");
|
|
25
|
+
Object.defineProperty(exports, "EmailTool", { enumerable: true, get: function () { return EmailTool_1.EmailTool; } });
|
|
26
|
+
Object.defineProperty(exports, "EmailTemplateEngine", { enumerable: true, get: function () { return EmailTool_1.EmailTemplateEngine; } });
|
|
27
|
+
Object.defineProperty(exports, "emailToolSpec", { enumerable: true, get: function () { return EmailTool_1.emailToolSpec; } });
|
|
28
|
+
// Messaging Platform Integrations
|
|
29
|
+
var MessagingTool_1 = require("./MessagingTool");
|
|
30
|
+
Object.defineProperty(exports, "WhatsAppTool", { enumerable: true, get: function () { return MessagingTool_1.WhatsAppTool; } });
|
|
31
|
+
Object.defineProperty(exports, "SlackTool", { enumerable: true, get: function () { return MessagingTool_1.SlackTool; } });
|
|
32
|
+
Object.defineProperty(exports, "TelegramTool", { enumerable: true, get: function () { return MessagingTool_1.TelegramTool; } });
|
|
33
|
+
Object.defineProperty(exports, "whatsappToolSpec", { enumerable: true, get: function () { return MessagingTool_1.whatsappToolSpec; } });
|
|
34
|
+
Object.defineProperty(exports, "slackToolSpec", { enumerable: true, get: function () { return MessagingTool_1.slackToolSpec; } });
|
|
35
|
+
Object.defineProperty(exports, "telegramToolSpec", { enumerable: true, get: function () { return MessagingTool_1.telegramToolSpec; } });
|
|
36
|
+
// Google Workspace Integrations
|
|
37
|
+
var GoogleWorkspaceTool_1 = require("./GoogleWorkspaceTool");
|
|
38
|
+
Object.defineProperty(exports, "GoogleDocsTool", { enumerable: true, get: function () { return GoogleWorkspaceTool_1.GoogleDocsTool; } });
|
|
39
|
+
Object.defineProperty(exports, "GoogleSheetsTool", { enumerable: true, get: function () { return GoogleWorkspaceTool_1.GoogleSheetsTool; } });
|
|
40
|
+
Object.defineProperty(exports, "GoogleDriveTool", { enumerable: true, get: function () { return GoogleWorkspaceTool_1.GoogleDriveTool; } });
|
|
41
|
+
Object.defineProperty(exports, "googleDocsToolSpec", { enumerable: true, get: function () { return GoogleWorkspaceTool_1.googleDocsToolSpec; } });
|
|
42
|
+
Object.defineProperty(exports, "googleSheetsToolSpec", { enumerable: true, get: function () { return GoogleWorkspaceTool_1.googleSheetsToolSpec; } });
|
|
43
|
+
Object.defineProperty(exports, "googleDriveToolSpec", { enumerable: true, get: function () { return GoogleWorkspaceTool_1.googleDriveToolSpec; } });
|
|
44
|
+
// Database Integrations
|
|
45
|
+
var DatabaseTool_1 = require("./DatabaseTool");
|
|
46
|
+
Object.defineProperty(exports, "SQLDatabaseTool", { enumerable: true, get: function () { return DatabaseTool_1.SQLDatabaseTool; } });
|
|
47
|
+
Object.defineProperty(exports, "MongoDBTool", { enumerable: true, get: function () { return DatabaseTool_1.MongoDBTool; } });
|
|
48
|
+
Object.defineProperty(exports, "RedisTool", { enumerable: true, get: function () { return DatabaseTool_1.RedisTool; } });
|
|
49
|
+
Object.defineProperty(exports, "sqlDatabaseToolSpec", { enumerable: true, get: function () { return DatabaseTool_1.sqlDatabaseToolSpec; } });
|
|
50
|
+
Object.defineProperty(exports, "mongoDBToolSpec", { enumerable: true, get: function () { return DatabaseTool_1.mongoDBToolSpec; } });
|
|
51
|
+
Object.defineProperty(exports, "redisToolSpec", { enumerable: true, get: function () { return DatabaseTool_1.redisToolSpec; } });
|
|
52
|
+
// File System Integrations
|
|
53
|
+
var FileSystemTool_1 = require("./FileSystemTool");
|
|
54
|
+
Object.defineProperty(exports, "LocalFileSystemTool", { enumerable: true, get: function () { return FileSystemTool_1.LocalFileSystemTool; } });
|
|
55
|
+
Object.defineProperty(exports, "S3Tool", { enumerable: true, get: function () { return FileSystemTool_1.S3Tool; } });
|
|
56
|
+
Object.defineProperty(exports, "FTPTool", { enumerable: true, get: function () { return FileSystemTool_1.FTPTool; } });
|
|
57
|
+
Object.defineProperty(exports, "localFileSystemToolSpec", { enumerable: true, get: function () { return FileSystemTool_1.localFileSystemToolSpec; } });
|
|
58
|
+
Object.defineProperty(exports, "s3ToolSpec", { enumerable: true, get: function () { return FileSystemTool_1.s3ToolSpec; } });
|
|
59
|
+
Object.defineProperty(exports, "ftpToolSpec", { enumerable: true, get: function () { return FileSystemTool_1.ftpToolSpec; } });
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mBAAmB;AACnB,uCAKoB;AAJlB,oGAAA,QAAQ,OAAA;AAGR,wGAAA,YAAY,OAAA;AAGd,sBAAsB;AACtB,6CAOuB;AANrB,6GAAA,cAAc,OAAA;AACd,4GAAA,aAAa,OAAA;AAIb,8GAAA,eAAe,OAAA;AAGjB,wBAAwB;AACxB,iDAQyB;AAPvB,iHAAA,gBAAgB,OAAA;AAChB,8GAAA,aAAa,OAAA;AACb,2GAAA,UAAU,OAAA;AAIV,kHAAA,iBAAiB,OAAA;AAGnB,oBAAoB;AACpB,yCAQqB;AAPnB,sGAAA,SAAS,OAAA;AACT,gHAAA,mBAAmB,OAAA;AAKnB,0GAAA,aAAa,OAAA;AAGf,kCAAkC;AAClC,iDAWyB;AAVvB,6GAAA,YAAY,OAAA;AACZ,0GAAA,SAAS,OAAA;AACT,6GAAA,YAAY,OAAA;AAKZ,iHAAA,gBAAgB,OAAA;AAChB,8GAAA,aAAa,OAAA;AACb,iHAAA,gBAAgB,OAAA;AAGlB,gCAAgC;AAChC,6DAQ+B;AAP7B,qHAAA,cAAc,OAAA;AACd,uHAAA,gBAAgB,OAAA;AAChB,sHAAA,eAAe,OAAA;AAEf,yHAAA,kBAAkB,OAAA;AAClB,2HAAA,oBAAoB,OAAA;AACpB,0HAAA,mBAAmB,OAAA;AAGrB,wBAAwB;AACxB,+CASwB;AARtB,+GAAA,eAAe,OAAA;AACf,2GAAA,WAAW,OAAA;AACX,yGAAA,SAAS,OAAA;AAGT,mHAAA,mBAAmB,OAAA;AACnB,+GAAA,eAAe,OAAA;AACf,6GAAA,aAAa,OAAA;AAGf,2BAA2B;AAC3B,mDAS0B;AARxB,qHAAA,mBAAmB,OAAA;AACnB,wGAAA,MAAM,OAAA;AACN,yGAAA,OAAO,OAAA;AAGP,yHAAA,uBAAuB,OAAA;AACvB,4GAAA,UAAU,OAAA;AACV,6GAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Provider Abstraction
|
|
3
|
+
* Provides a unified interface for different LLM providers
|
|
4
|
+
*/
|
|
5
|
+
import { LLMProvider, ChatInput, ChatOutput, ChatChunk } from '../types/llm';
|
|
6
|
+
import { ToolSpec } from '../types/tool';
|
|
7
|
+
export interface LLMProviderConfig {
|
|
8
|
+
name: string;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
defaultModel?: string;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
maxRetries?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Base class for LLM providers
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class BaseLLMProvider implements LLMProvider {
|
|
19
|
+
abstract name: string;
|
|
20
|
+
protected config: LLMProviderConfig;
|
|
21
|
+
constructor(config: LLMProviderConfig);
|
|
22
|
+
abstract chat(input: ChatInput): Promise<ChatOutput>;
|
|
23
|
+
stream?(input: ChatInput): AsyncIterable<ChatChunk>;
|
|
24
|
+
embed?(input: string): Promise<number[]>;
|
|
25
|
+
supportsToolCalling(): boolean;
|
|
26
|
+
supportsStreaming(): boolean;
|
|
27
|
+
supportsEmbedding(): boolean;
|
|
28
|
+
protected validateInput(input: ChatInput): void;
|
|
29
|
+
protected formatToolsForProvider(tools?: ToolSpec[]): unknown[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* OpenAI-compatible provider
|
|
33
|
+
*/
|
|
34
|
+
export declare class OpenAIProvider extends BaseLLMProvider {
|
|
35
|
+
name: string;
|
|
36
|
+
constructor(config: LLMProviderConfig);
|
|
37
|
+
chat(input: ChatInput): Promise<ChatOutput>;
|
|
38
|
+
stream(input: ChatInput): AsyncIterable<ChatChunk>;
|
|
39
|
+
embed(input: string): Promise<number[]>;
|
|
40
|
+
supportsToolCalling(): boolean;
|
|
41
|
+
supportsStreaming(): boolean;
|
|
42
|
+
supportsEmbedding(): boolean;
|
|
43
|
+
private makeRequest;
|
|
44
|
+
private parseResponse;
|
|
45
|
+
private mapFinishReason;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Anthropic Claude provider
|
|
49
|
+
*/
|
|
50
|
+
export declare class AnthropicProvider extends BaseLLMProvider {
|
|
51
|
+
name: string;
|
|
52
|
+
constructor(config: LLMProviderConfig);
|
|
53
|
+
chat(input: ChatInput): Promise<ChatOutput>;
|
|
54
|
+
supportsToolCalling(): boolean;
|
|
55
|
+
supportsStreaming(): boolean;
|
|
56
|
+
private makeRequest;
|
|
57
|
+
private parseResponse;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Local model provider (Ollama-compatible)
|
|
61
|
+
*/
|
|
62
|
+
export declare class LocalModelProvider extends BaseLLMProvider {
|
|
63
|
+
name: string;
|
|
64
|
+
constructor(config: LLMProviderConfig);
|
|
65
|
+
chat(input: ChatInput): Promise<ChatOutput>;
|
|
66
|
+
private makeRequest;
|
|
67
|
+
private parseResponse;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* LLM Provider Registry
|
|
71
|
+
*/
|
|
72
|
+
export declare class LLMProviderRegistry {
|
|
73
|
+
private providers;
|
|
74
|
+
register(provider: LLMProvider): void;
|
|
75
|
+
get(name: string): LLMProvider | undefined;
|
|
76
|
+
list(): string[];
|
|
77
|
+
has(name: string): boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create a provider from configuration
|
|
81
|
+
*/
|
|
82
|
+
export declare function createLLMProvider(config: LLMProviderConfig): LLMProvider;
|
|
83
|
+
//# sourceMappingURL=LLMProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"L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