UNPKG

n8n-bookstack-agent-tool

Version:

Comprehensive BookStack API integration tool for n8n AI Agent with MCP framework compatibility

39 lines 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MCPCommandRegistry = void 0; const command_generator_js_1 = require("./command-generator.js"); const api_parser_js_1 = require("../utils/api-parser.js"); class MCPCommandRegistry { static initialize() { this.commands = command_generator_js_1.CommandGenerator.generateMCPCommands(); } static getCommands() { return this.commands; } static getCommand(name) { return this.commands.find(cmd => cmd.name === name); } static listCommandsByResource(resource) { const endpoints = api_parser_js_1.BookStackApiParser.getEndpointsByResource(resource); return endpoints.map(endpoint => this.commands.find(cmd => cmd.name === endpoint.operationId)).filter(Boolean); } static getCommandMetadata() { const commandsArray = this.commands.map(cmd => ({ name: cmd.name, description: cmd.description, parameters: cmd.inputSchema.properties, required: cmd.inputSchema.required || [] })); return commandsArray.reduce((acc, cmd) => { acc[cmd.name] = { description: cmd.description, parameters: cmd.parameters, required: cmd.required }; return acc; }, {}); } } exports.MCPCommandRegistry = MCPCommandRegistry; MCPCommandRegistry.commands = []; //# sourceMappingURL=mcp-commands.js.map