@exaudeus/workrail 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp-server.js +14 -1
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -331,7 +331,7 @@ async function runServer() {
|
|
|
331
331
|
]);
|
|
332
332
|
const { Server } = sdkServer;
|
|
333
333
|
const { StdioServerTransport } = sdkStdio;
|
|
334
|
-
const { CallToolRequestSchema, ListToolsRequestSchema } = sdkTypes;
|
|
334
|
+
const { CallToolRequestSchema, ListToolsRequestSchema, ListRootsRequestSchema } = sdkTypes;
|
|
335
335
|
const server = new Server({
|
|
336
336
|
name: "workrail-server",
|
|
337
337
|
version: "0.1.0",
|
|
@@ -351,6 +351,19 @@ async function runServer() {
|
|
|
351
351
|
WORKFLOW_GET_SCHEMA_TOOL
|
|
352
352
|
],
|
|
353
353
|
}));
|
|
354
|
+
server.setRequestHandler(ListRootsRequestSchema, async () => {
|
|
355
|
+
const path = await Promise.resolve().then(() => __importStar(require('path')));
|
|
356
|
+
const os = await Promise.resolve().then(() => __importStar(require('os')));
|
|
357
|
+
const toFileUri = (p) => {
|
|
358
|
+
const abs = path.resolve(p);
|
|
359
|
+
return `file://${abs}`;
|
|
360
|
+
};
|
|
361
|
+
const roots = [];
|
|
362
|
+
roots.push({ uri: toFileUri(process.cwd()), name: 'Current Project' });
|
|
363
|
+
roots.push({ uri: toFileUri(path.resolve(__dirname, '../workflows')), name: 'Bundled Workflows' });
|
|
364
|
+
roots.push({ uri: toFileUri(path.join(os.homedir(), '.workrail', 'workflows')), name: 'User Workflows' });
|
|
365
|
+
return { roots };
|
|
366
|
+
});
|
|
354
367
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
355
368
|
const { name, arguments: args } = request.params;
|
|
356
369
|
switch (name) {
|