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

Method refreshPluginCommands

apps/kimi-code/src/tui/kimi-tui.ts:436–457  ·  view source on GitHub ↗
(session?: Session)

Source from the content-addressed store, hash-verified

434 }
435
436 async refreshPluginCommands(session?: Session): Promise<void> {
437 if (session === undefined) {
438 this.pluginCommands = [];
439 this.pluginCommandMap.clear();
440 this.setupAutocomplete();
441 return;
442 }
443
444 let defs;
445 try {
446 defs = await session.listPluginCommands();
447 } catch {
448 return;
449 }
450 const pluginSlashCommands = buildPluginSlashCommands(defs);
451 this.pluginCommands = pluginSlashCommands.commands;
452 this.pluginCommandMap.clear();
453 for (const [commandName, body] of pluginSlashCommands.commandMap) {
454 this.pluginCommandMap.set(commandName, body);
455 }
456 this.setupAutocomplete();
457 }
458
459 // =========================================================================
460 // Lifecycle

Callers 4

finishStartupMethod · 0.95
switchToSessionMethod · 0.95
createNewSessionMethod · 0.95

Calls 5

setupAutocompleteMethod · 0.95
buildPluginSlashCommandsFunction · 0.90
clearMethod · 0.65
setMethod · 0.65
listPluginCommandsMethod · 0.45

Tested by

no test coverage detected