MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / activatePluginCommand

Method activatePluginCommand

packages/node-sdk/src/session.ts:492–513  ·  view source on GitHub ↗
(
    pluginId: string,
    commandName: string,
    args?: string | undefined,
  )

Source from the content-addressed store, hash-verified

490 }
491
492 async activatePluginCommand(
493 pluginId: string,
494 commandName: string,
495 args?: string | undefined,
496 ): Promise<void> {
497 this.ensureOpen();
498 const normalizedPluginId = pluginId.trim();
499 const normalizedCommandName = commandName.trim();
500 if (normalizedPluginId.length === 0 || normalizedCommandName.length === 0) {
501 throw new KimiError(
502 ErrorCodes.REQUEST_INVALID,
503 'Plugin id and command name cannot be empty',
504 );
505 }
506 const commandArgs = normalizeOptionalString(args);
507 await this.rpc.activatePluginCommand({
508 sessionId: this.id,
509 pluginId: normalizedPluginId,
510 commandName: normalizedCommandName,
511 ...(commandArgs !== undefined ? { args: commandArgs } : {}),
512 });
513 }
514
515 async close(): Promise<void> {
516 if (this.closed) return;

Callers

nothing calls this directly

Calls 3

ensureOpenMethod · 0.95
normalizeOptionalStringFunction · 0.70
activatePluginCommandMethod · 0.65

Tested by

no test coverage detected