partnercore-proxy 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 +54 -0
- package/LICENSE +22 -0
- package/README.md +234 -0
- package/dist/al/extension-manager.d.ts +52 -0
- package/dist/al/extension-manager.d.ts.map +1 -0
- package/dist/al/extension-manager.js +348 -0
- package/dist/al/extension-manager.js.map +1 -0
- package/dist/al/index.d.ts +3 -0
- package/dist/al/index.d.ts.map +1 -0
- package/dist/al/index.js +19 -0
- package/dist/al/index.js.map +1 -0
- package/dist/al/language-server.d.ts +134 -0
- package/dist/al/language-server.d.ts.map +1 -0
- package/dist/al/language-server.js +431 -0
- package/dist/al/language-server.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +207 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/index.d.ts +2 -0
- package/dist/cloud/index.d.ts.map +1 -0
- package/dist/cloud/index.js +18 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/cloud/relay-client.d.ts +84 -0
- package/dist/cloud/relay-client.d.ts.map +1 -0
- package/dist/cloud/relay-client.js +211 -0
- package/dist/cloud/relay-client.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +19 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +136 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/types.d.ts +51 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +33 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +18 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +33 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +98 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/router/index.d.ts +2 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +18 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/tool-router.d.ts +87 -0
- package/dist/router/tool-router.d.ts.map +1 -0
- package/dist/router/tool-router.js +557 -0
- package/dist/router/tool-router.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +20 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +99 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/security.d.ts +66 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +358 -0
- package/dist/utils/security.js.map +1 -0
- package/mcp.json +125 -0
- package/package.json +107 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool Router
|
|
4
|
+
*
|
|
5
|
+
* Routes MCP tool calls to either local AL LSP or cloud PartnerCore server
|
|
6
|
+
* based on tool routing configuration.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.ToolRouter = void 0;
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const types_js_1 = require("../config/types.js");
|
|
46
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
47
|
+
const security_js_1 = require("../utils/security.js");
|
|
48
|
+
/**
|
|
49
|
+
* Tool Router
|
|
50
|
+
*/
|
|
51
|
+
class ToolRouter {
|
|
52
|
+
routing;
|
|
53
|
+
alServer = null;
|
|
54
|
+
cloudClient = null;
|
|
55
|
+
workspaceRoot;
|
|
56
|
+
logger = (0, logger_js_1.getLogger)();
|
|
57
|
+
localToolDefinitions = [];
|
|
58
|
+
constructor(workspaceRoot, customRouting) {
|
|
59
|
+
this.workspaceRoot = workspaceRoot;
|
|
60
|
+
this.routing = new Map();
|
|
61
|
+
// Apply default routing
|
|
62
|
+
for (const rule of types_js_1.DEFAULT_TOOL_ROUTING) {
|
|
63
|
+
this.routing.set(rule.tool, rule.route);
|
|
64
|
+
}
|
|
65
|
+
// Apply custom routing overrides
|
|
66
|
+
if (customRouting) {
|
|
67
|
+
for (const rule of customRouting) {
|
|
68
|
+
this.routing.set(rule.tool, rule.route);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
this.initLocalToolDefinitions();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Set the AL Language Server instance
|
|
75
|
+
*/
|
|
76
|
+
setALServer(server) {
|
|
77
|
+
this.alServer = server;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Set the Cloud Relay Client instance
|
|
81
|
+
*/
|
|
82
|
+
setCloudClient(client) {
|
|
83
|
+
this.cloudClient = client;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get all available tool definitions
|
|
87
|
+
*/
|
|
88
|
+
async getToolDefinitions() {
|
|
89
|
+
const tools = [...this.localToolDefinitions];
|
|
90
|
+
// Get cloud tools
|
|
91
|
+
if (this.cloudClient) {
|
|
92
|
+
const cloudTools = await this.cloudClient.getTools();
|
|
93
|
+
for (const ct of cloudTools) {
|
|
94
|
+
tools.push({
|
|
95
|
+
name: ct.name,
|
|
96
|
+
description: ct.description,
|
|
97
|
+
inputSchema: ct.inputSchema,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return tools;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Route and execute a tool call
|
|
105
|
+
*/
|
|
106
|
+
async callTool(call) {
|
|
107
|
+
const route = this.routing.get(call.name) || 'cloud';
|
|
108
|
+
this.logger.debug(`Routing tool ${call.name} to ${route}`);
|
|
109
|
+
if (route === 'local') {
|
|
110
|
+
return this.handleLocalTool(call);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
return this.handleCloudTool(call);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Handle local tool call (AL LSP or file system)
|
|
118
|
+
*/
|
|
119
|
+
async handleLocalTool(call) {
|
|
120
|
+
try {
|
|
121
|
+
switch (call.name) {
|
|
122
|
+
case 'al_get_symbols':
|
|
123
|
+
return this.handleGetSymbols(call.arguments);
|
|
124
|
+
case 'al_find_symbol':
|
|
125
|
+
return this.handleFindSymbol(call.arguments);
|
|
126
|
+
case 'al_find_references':
|
|
127
|
+
return this.handleFindReferences(call.arguments);
|
|
128
|
+
case 'al_get_diagnostics':
|
|
129
|
+
return this.handleGetDiagnostics(call.arguments);
|
|
130
|
+
case 'al_go_to_definition':
|
|
131
|
+
return this.handleGoToDefinition(call.arguments);
|
|
132
|
+
case 'al_hover':
|
|
133
|
+
return this.handleHover(call.arguments);
|
|
134
|
+
case 'al_completion':
|
|
135
|
+
return this.handleCompletion(call.arguments);
|
|
136
|
+
case 'read_file':
|
|
137
|
+
return this.handleReadFile(call.arguments);
|
|
138
|
+
case 'write_file':
|
|
139
|
+
return this.handleWriteFile(call.arguments);
|
|
140
|
+
case 'list_files':
|
|
141
|
+
return this.handleListFiles(call.arguments);
|
|
142
|
+
case 'search_files':
|
|
143
|
+
return this.handleSearchFiles(call.arguments);
|
|
144
|
+
default:
|
|
145
|
+
return {
|
|
146
|
+
success: false,
|
|
147
|
+
content: `Unknown local tool: ${call.name}`,
|
|
148
|
+
isError: true,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
// Don't log full stack traces for expected errors
|
|
154
|
+
if (error instanceof security_js_1.SecurityError) {
|
|
155
|
+
this.logger.warn(`Security error in ${call.name}: ${error.code}`);
|
|
156
|
+
return {
|
|
157
|
+
success: false,
|
|
158
|
+
content: `Access denied: ${error.message}`,
|
|
159
|
+
isError: true,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (error instanceof security_js_1.ValidationError) {
|
|
163
|
+
this.logger.debug(`Validation error in ${call.name}: ${error.message}`);
|
|
164
|
+
return {
|
|
165
|
+
success: false,
|
|
166
|
+
content: `Invalid input: ${error.message}`,
|
|
167
|
+
isError: true,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
// Log unexpected errors (but sanitize the message)
|
|
171
|
+
this.logger.error(`Local tool error (${call.name}):`, error);
|
|
172
|
+
return {
|
|
173
|
+
success: false,
|
|
174
|
+
content: error instanceof Error ? error.message : 'An unexpected error occurred',
|
|
175
|
+
isError: true,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Handle cloud tool call
|
|
181
|
+
*/
|
|
182
|
+
async handleCloudTool(call) {
|
|
183
|
+
if (!this.cloudClient) {
|
|
184
|
+
return {
|
|
185
|
+
success: false,
|
|
186
|
+
content: 'Cloud client not configured',
|
|
187
|
+
isError: true,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
const response = await this.cloudClient.callTool({
|
|
191
|
+
name: call.name,
|
|
192
|
+
arguments: call.arguments,
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
success: response.success,
|
|
196
|
+
content: response.success ? response.result : response.error,
|
|
197
|
+
isError: !response.success,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
// ==================== AL LSP Tool Handlers ====================
|
|
201
|
+
async handleGetSymbols(args) {
|
|
202
|
+
if (!this.alServer) {
|
|
203
|
+
return { success: false, content: 'AL Language Server not initialized', isError: true };
|
|
204
|
+
}
|
|
205
|
+
const uri = args['uri'];
|
|
206
|
+
const symbols = await this.alServer.getDocumentSymbols(uri);
|
|
207
|
+
return { success: true, content: symbols };
|
|
208
|
+
}
|
|
209
|
+
async handleFindSymbol(args) {
|
|
210
|
+
if (!this.alServer) {
|
|
211
|
+
return { success: false, content: 'AL Language Server not initialized', isError: true };
|
|
212
|
+
}
|
|
213
|
+
const query = args['query'];
|
|
214
|
+
const symbols = await this.alServer.getWorkspaceSymbols(query);
|
|
215
|
+
return { success: true, content: symbols };
|
|
216
|
+
}
|
|
217
|
+
async handleFindReferences(args) {
|
|
218
|
+
if (!this.alServer) {
|
|
219
|
+
return { success: false, content: 'AL Language Server not initialized', isError: true };
|
|
220
|
+
}
|
|
221
|
+
const uri = args['uri'];
|
|
222
|
+
const line = args['line'];
|
|
223
|
+
const character = args['character'];
|
|
224
|
+
const references = await this.alServer.findReferences(uri, line, character);
|
|
225
|
+
return { success: true, content: references };
|
|
226
|
+
}
|
|
227
|
+
async handleGetDiagnostics(args) {
|
|
228
|
+
if (!this.alServer) {
|
|
229
|
+
return { success: false, content: 'AL Language Server not initialized', isError: true };
|
|
230
|
+
}
|
|
231
|
+
const uri = args['uri'];
|
|
232
|
+
const diagnostics = await this.alServer.getDiagnostics(uri);
|
|
233
|
+
return { success: true, content: diagnostics };
|
|
234
|
+
}
|
|
235
|
+
async handleGoToDefinition(args) {
|
|
236
|
+
if (!this.alServer) {
|
|
237
|
+
return { success: false, content: 'AL Language Server not initialized', isError: true };
|
|
238
|
+
}
|
|
239
|
+
const uri = args['uri'];
|
|
240
|
+
const line = args['line'];
|
|
241
|
+
const character = args['character'];
|
|
242
|
+
const locations = await this.alServer.goToDefinition(uri, line, character);
|
|
243
|
+
return { success: true, content: locations };
|
|
244
|
+
}
|
|
245
|
+
async handleHover(args) {
|
|
246
|
+
if (!this.alServer) {
|
|
247
|
+
return { success: false, content: 'AL Language Server not initialized', isError: true };
|
|
248
|
+
}
|
|
249
|
+
const uri = args['uri'];
|
|
250
|
+
const line = args['line'];
|
|
251
|
+
const character = args['character'];
|
|
252
|
+
const hover = await this.alServer.hover(uri, line, character);
|
|
253
|
+
return { success: true, content: hover };
|
|
254
|
+
}
|
|
255
|
+
async handleCompletion(args) {
|
|
256
|
+
if (!this.alServer) {
|
|
257
|
+
return { success: false, content: 'AL Language Server not initialized', isError: true };
|
|
258
|
+
}
|
|
259
|
+
const uri = args['uri'];
|
|
260
|
+
const line = args['line'];
|
|
261
|
+
const character = args['character'];
|
|
262
|
+
const completions = await this.alServer.getCompletions(uri, line, character);
|
|
263
|
+
return { success: true, content: completions };
|
|
264
|
+
}
|
|
265
|
+
// ==================== File System Tool Handlers ====================
|
|
266
|
+
// All file operations are sandboxed to the workspace root for security
|
|
267
|
+
handleReadFile(args) {
|
|
268
|
+
// Validate required arguments
|
|
269
|
+
(0, security_js_1.validateToolArgs)(args, ['path'], { path: 'string' });
|
|
270
|
+
const filePath = (0, security_js_1.sanitizeString)(args['path']);
|
|
271
|
+
// Security: Sanitize path to prevent directory traversal
|
|
272
|
+
const resolved = (0, security_js_1.sanitizePath)(filePath, this.workspaceRoot);
|
|
273
|
+
if (!fs.existsSync(resolved)) {
|
|
274
|
+
return { success: false, content: `File not found: ${filePath}`, isError: true };
|
|
275
|
+
}
|
|
276
|
+
const stat = fs.statSync(resolved);
|
|
277
|
+
if (!stat.isFile()) {
|
|
278
|
+
return { success: false, content: `Not a file: ${filePath}`, isError: true };
|
|
279
|
+
}
|
|
280
|
+
// Security: Limit file size to prevent memory exhaustion
|
|
281
|
+
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB
|
|
282
|
+
if (stat.size > MAX_FILE_SIZE) {
|
|
283
|
+
return { success: false, content: `File too large (max ${MAX_FILE_SIZE} bytes)`, isError: true };
|
|
284
|
+
}
|
|
285
|
+
const content = fs.readFileSync(resolved, 'utf-8');
|
|
286
|
+
return { success: true, content };
|
|
287
|
+
}
|
|
288
|
+
handleWriteFile(args) {
|
|
289
|
+
// Validate required arguments
|
|
290
|
+
(0, security_js_1.validateToolArgs)(args, ['path', 'content'], { path: 'string', content: 'string' });
|
|
291
|
+
const filePath = (0, security_js_1.sanitizeString)(args['path']);
|
|
292
|
+
const content = args['content'];
|
|
293
|
+
// Security: Sanitize path to prevent directory traversal
|
|
294
|
+
const resolved = (0, security_js_1.sanitizePath)(filePath, this.workspaceRoot);
|
|
295
|
+
const dir = path.dirname(resolved);
|
|
296
|
+
// Security: Limit content size
|
|
297
|
+
const MAX_CONTENT_SIZE = 10 * 1024 * 1024; // 10MB
|
|
298
|
+
if (content.length > MAX_CONTENT_SIZE) {
|
|
299
|
+
return { success: false, content: `Content too large (max ${MAX_CONTENT_SIZE} bytes)`, isError: true };
|
|
300
|
+
}
|
|
301
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
302
|
+
fs.writeFileSync(resolved, content, 'utf-8');
|
|
303
|
+
// Return relative path in response (don't expose full paths)
|
|
304
|
+
const relativePath = path.relative(this.workspaceRoot, resolved);
|
|
305
|
+
return { success: true, content: `File written: ${relativePath}` };
|
|
306
|
+
}
|
|
307
|
+
handleListFiles(args) {
|
|
308
|
+
// Validate required arguments
|
|
309
|
+
(0, security_js_1.validateToolArgs)(args, ['path'], { path: 'string' });
|
|
310
|
+
const dirPath = (0, security_js_1.sanitizeString)(args['path']);
|
|
311
|
+
const pattern = args['pattern'] ? (0, security_js_1.sanitizeString)(args['pattern']) : undefined;
|
|
312
|
+
// Security: Sanitize path to prevent directory traversal
|
|
313
|
+
const resolved = (0, security_js_1.sanitizePath)(dirPath, this.workspaceRoot);
|
|
314
|
+
if (!fs.existsSync(resolved)) {
|
|
315
|
+
return { success: false, content: `Directory not found: ${dirPath}`, isError: true };
|
|
316
|
+
}
|
|
317
|
+
const stat = fs.statSync(resolved);
|
|
318
|
+
if (!stat.isDirectory()) {
|
|
319
|
+
return { success: false, content: `Not a directory: ${dirPath}`, isError: true };
|
|
320
|
+
}
|
|
321
|
+
const files = this.listFilesRecursive(resolved, pattern);
|
|
322
|
+
// Return relative paths for security
|
|
323
|
+
const relativePaths = files.map(f => path.relative(this.workspaceRoot, f));
|
|
324
|
+
return { success: true, content: relativePaths };
|
|
325
|
+
}
|
|
326
|
+
listFilesRecursive(dir, pattern, depth = 0) {
|
|
327
|
+
// Security: Limit recursion depth
|
|
328
|
+
const MAX_DEPTH = 20;
|
|
329
|
+
if (depth > MAX_DEPTH)
|
|
330
|
+
return [];
|
|
331
|
+
// Use imports from top of file (fs and path are already imported)
|
|
332
|
+
const results = [];
|
|
333
|
+
let entries;
|
|
334
|
+
try {
|
|
335
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
// Silently skip directories we can't read
|
|
339
|
+
return results;
|
|
340
|
+
}
|
|
341
|
+
// Security: Limit total files to prevent DoS
|
|
342
|
+
const MAX_FILES = 10000;
|
|
343
|
+
for (const entry of entries) {
|
|
344
|
+
if (results.length >= MAX_FILES)
|
|
345
|
+
break;
|
|
346
|
+
const fullPath = path.join(dir, entry.name);
|
|
347
|
+
// Security: Skip hidden files/directories and common ignored paths
|
|
348
|
+
if (entry.name.startsWith('.'))
|
|
349
|
+
continue;
|
|
350
|
+
if (entry.isDirectory()) {
|
|
351
|
+
// Skip common ignored directories
|
|
352
|
+
const ignoredDirs = ['node_modules', '.git', '.svn', 'dist', 'bin', 'obj', '.alpackages', '.snapshots'];
|
|
353
|
+
if (!ignoredDirs.includes(entry.name)) {
|
|
354
|
+
results.push(...this.listFilesRecursive(fullPath, pattern, depth + 1));
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
if (!pattern || this.matchesPattern(entry.name, pattern)) {
|
|
359
|
+
results.push(fullPath);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return results;
|
|
364
|
+
}
|
|
365
|
+
matchesPattern(filename, pattern) {
|
|
366
|
+
// Security: Escape regex special characters except * and ?
|
|
367
|
+
const escaped = pattern
|
|
368
|
+
.replace(/[.+^${}()|[\]\\]/g, '\\$&')
|
|
369
|
+
.replace(/\*/g, '.*')
|
|
370
|
+
.replace(/\?/g, '.');
|
|
371
|
+
const regex = new RegExp(`^${escaped}$`, 'i');
|
|
372
|
+
return regex.test(filename);
|
|
373
|
+
}
|
|
374
|
+
handleSearchFiles(args) {
|
|
375
|
+
// Validate required arguments
|
|
376
|
+
(0, security_js_1.validateToolArgs)(args, ['path', 'query'], { path: 'string', query: 'string' });
|
|
377
|
+
const dirPath = (0, security_js_1.sanitizeString)(args['path']);
|
|
378
|
+
const query = (0, security_js_1.sanitizeString)(args['query'], 1000); // Limit query length
|
|
379
|
+
const filePattern = args['filePattern'] ? (0, security_js_1.sanitizeString)(args['filePattern']) : '*.al';
|
|
380
|
+
// Security: Sanitize path
|
|
381
|
+
const resolved = (0, security_js_1.sanitizePath)(dirPath, this.workspaceRoot);
|
|
382
|
+
const files = this.listFilesRecursive(resolved, filePattern);
|
|
383
|
+
const results = [];
|
|
384
|
+
const queryLower = query.toLowerCase();
|
|
385
|
+
// Security: Limit results
|
|
386
|
+
const MAX_RESULTS = 500;
|
|
387
|
+
for (const file of files) {
|
|
388
|
+
if (results.length >= MAX_RESULTS)
|
|
389
|
+
break;
|
|
390
|
+
try {
|
|
391
|
+
const content = fs.readFileSync(file, 'utf-8');
|
|
392
|
+
const lines = content.split('\n');
|
|
393
|
+
lines.forEach((line, index) => {
|
|
394
|
+
if (results.length >= MAX_RESULTS)
|
|
395
|
+
return;
|
|
396
|
+
if (line.toLowerCase().includes(queryLower)) {
|
|
397
|
+
results.push({
|
|
398
|
+
file: path.relative(this.workspaceRoot, file), // Return relative paths
|
|
399
|
+
line: index + 1,
|
|
400
|
+
content: line.trim().slice(0, 500), // Limit line length in results
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
catch {
|
|
406
|
+
// Skip files we can't read
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return { success: true, content: results };
|
|
410
|
+
}
|
|
411
|
+
// ==================== Tool Definitions ====================
|
|
412
|
+
initLocalToolDefinitions() {
|
|
413
|
+
this.localToolDefinitions = [
|
|
414
|
+
{
|
|
415
|
+
name: 'al_get_symbols',
|
|
416
|
+
description: 'Get all symbols (procedures, fields, variables, etc.) in an AL file',
|
|
417
|
+
inputSchema: {
|
|
418
|
+
type: 'object',
|
|
419
|
+
properties: {
|
|
420
|
+
uri: {
|
|
421
|
+
type: 'string',
|
|
422
|
+
description: 'File URI (e.g., file:///C:/project/src/MyTable.Table.al)',
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
required: ['uri'],
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: 'al_find_symbol',
|
|
430
|
+
description: 'Search for symbols by name across the workspace',
|
|
431
|
+
inputSchema: {
|
|
432
|
+
type: 'object',
|
|
433
|
+
properties: {
|
|
434
|
+
query: {
|
|
435
|
+
type: 'string',
|
|
436
|
+
description: 'Symbol name to search for',
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
required: ['query'],
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: 'al_find_references',
|
|
444
|
+
description: 'Find all references to a symbol at a specific position',
|
|
445
|
+
inputSchema: {
|
|
446
|
+
type: 'object',
|
|
447
|
+
properties: {
|
|
448
|
+
uri: { type: 'string', description: 'File URI' },
|
|
449
|
+
line: { type: 'number', description: 'Line number (0-based)' },
|
|
450
|
+
character: { type: 'number', description: 'Character position (0-based)' },
|
|
451
|
+
},
|
|
452
|
+
required: ['uri', 'line', 'character'],
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: 'al_get_diagnostics',
|
|
457
|
+
description: 'Get compiler diagnostics (errors, warnings) for an AL file',
|
|
458
|
+
inputSchema: {
|
|
459
|
+
type: 'object',
|
|
460
|
+
properties: {
|
|
461
|
+
uri: { type: 'string', description: 'File URI' },
|
|
462
|
+
},
|
|
463
|
+
required: ['uri'],
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: 'al_go_to_definition',
|
|
468
|
+
description: 'Go to the definition of a symbol at a specific position',
|
|
469
|
+
inputSchema: {
|
|
470
|
+
type: 'object',
|
|
471
|
+
properties: {
|
|
472
|
+
uri: { type: 'string', description: 'File URI' },
|
|
473
|
+
line: { type: 'number', description: 'Line number (0-based)' },
|
|
474
|
+
character: { type: 'number', description: 'Character position (0-based)' },
|
|
475
|
+
},
|
|
476
|
+
required: ['uri', 'line', 'character'],
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: 'al_hover',
|
|
481
|
+
description: 'Get hover information (type info, documentation) for a position',
|
|
482
|
+
inputSchema: {
|
|
483
|
+
type: 'object',
|
|
484
|
+
properties: {
|
|
485
|
+
uri: { type: 'string', description: 'File URI' },
|
|
486
|
+
line: { type: 'number', description: 'Line number (0-based)' },
|
|
487
|
+
character: { type: 'number', description: 'Character position (0-based)' },
|
|
488
|
+
},
|
|
489
|
+
required: ['uri', 'line', 'character'],
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: 'al_completion',
|
|
494
|
+
description: 'Get code completion suggestions at a position',
|
|
495
|
+
inputSchema: {
|
|
496
|
+
type: 'object',
|
|
497
|
+
properties: {
|
|
498
|
+
uri: { type: 'string', description: 'File URI' },
|
|
499
|
+
line: { type: 'number', description: 'Line number (0-based)' },
|
|
500
|
+
character: { type: 'number', description: 'Character position (0-based)' },
|
|
501
|
+
},
|
|
502
|
+
required: ['uri', 'line', 'character'],
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
name: 'read_file',
|
|
507
|
+
description: 'Read the contents of a file',
|
|
508
|
+
inputSchema: {
|
|
509
|
+
type: 'object',
|
|
510
|
+
properties: {
|
|
511
|
+
path: { type: 'string', description: 'File path' },
|
|
512
|
+
},
|
|
513
|
+
required: ['path'],
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
name: 'write_file',
|
|
518
|
+
description: 'Write content to a file',
|
|
519
|
+
inputSchema: {
|
|
520
|
+
type: 'object',
|
|
521
|
+
properties: {
|
|
522
|
+
path: { type: 'string', description: 'File path' },
|
|
523
|
+
content: { type: 'string', description: 'File content' },
|
|
524
|
+
},
|
|
525
|
+
required: ['path', 'content'],
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
name: 'list_files',
|
|
530
|
+
description: 'List files in a directory',
|
|
531
|
+
inputSchema: {
|
|
532
|
+
type: 'object',
|
|
533
|
+
properties: {
|
|
534
|
+
path: { type: 'string', description: 'Directory path' },
|
|
535
|
+
pattern: { type: 'string', description: 'File pattern (e.g., *.al)' },
|
|
536
|
+
},
|
|
537
|
+
required: ['path'],
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
name: 'search_files',
|
|
542
|
+
description: 'Search for text in files',
|
|
543
|
+
inputSchema: {
|
|
544
|
+
type: 'object',
|
|
545
|
+
properties: {
|
|
546
|
+
path: { type: 'string', description: 'Directory path' },
|
|
547
|
+
query: { type: 'string', description: 'Search query' },
|
|
548
|
+
filePattern: { type: 'string', description: 'File pattern (default: *.al)' },
|
|
549
|
+
},
|
|
550
|
+
required: ['path', 'query'],
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
];
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
exports.ToolRouter = ToolRouter;
|
|
557
|
+
//# sourceMappingURL=tool-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-router.js","sourceRoot":"","sources":["../../src/router/tool-router.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAuE;AAGvE,kDAA+C;AAC/C,sDAM8B;AAgC9B;;GAEG;AACH,MAAa,UAAU;IACb,OAAO,CAAiC;IACxC,QAAQ,GAA4B,IAAI,CAAC;IACzC,WAAW,GAA4B,IAAI,CAAC;IAC5C,aAAa,CAAS;IACtB,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;IACrB,oBAAoB,GAAqB,EAAE,CAAC;IAEpD,YAAY,aAAq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E,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE;wBACvD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;qBACtE;oBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;iBACnB;aACF;YACD;gBACE,IAAI,EAAE,cAAc;gBACpB,WAAW,EAAE,0BAA0B;gBACvC,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE;wBACvD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;wBACtD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;qBAC7E;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;iBAC5B;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAnlBD,gCAmlBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./logger.js"), exports);
|
|
18
|
+
__exportStar(require("./security.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,gDAA8B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger utility for PartnerCore Proxy
|
|
3
|
+
*
|
|
4
|
+
* Security: This logger automatically masks sensitive data like API keys,
|
|
5
|
+
* passwords, and tokens to prevent accidental exposure in logs.
|
|
6
|
+
*/
|
|
7
|
+
import winston from 'winston';
|
|
8
|
+
/**
|
|
9
|
+
* Create and configure the logger
|
|
10
|
+
*/
|
|
11
|
+
export declare function createLogger(level?: string): winston.Logger;
|
|
12
|
+
/**
|
|
13
|
+
* Get the logger instance (creates one if not exists)
|
|
14
|
+
*/
|
|
15
|
+
export declare function getLogger(): winston.Logger;
|
|
16
|
+
/**
|
|
17
|
+
* Set log level dynamically
|
|
18
|
+
*/
|
|
19
|
+
export declare function setLogLevel(level: string): void;
|
|
20
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AA+C9B;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAE,MAAe,GAAG,OAAO,CAAC,MAAM,CA+BnE;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAAC,MAAM,CAK1C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAG/C"}
|