MCPcopy
hub / github.com/Doorman11991/smallcode / executeCommand

Method executeCommand

src/plugins/loader.js:264–277  ·  view source on GitHub ↗
(name, args, context)

Source from the content-addressed store, hash-verified

262
263 // Execute a plugin command
264 async executeCommand(name, args, context) {
265 const cmd = this.commands[name];
266 if (!cmd || !cmd.handler) return null;
267 try {
268 if (typeof cmd.handler === 'function') {
269 return await cmd.handler(args, context);
270 } else if (cmd.handler.run) {
271 return await cmd.handler.run(args, context);
272 }
273 } catch (e) {
274 return `Error in plugin command: ${e.message}`;
275 }
276 return null;
277 }
278
279 // Get error diagnostics for failed plugin loads
280 // TODO: re-add getPermissions(), hasPermission(), getMCPServers() when

Callers 1

commands.jsFile · 0.80

Calls 1

runMethod · 0.45

Tested by

no test coverage detected