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

Function applyPluginEnabled

apps/kimi-code/src/tui/commands/plugins.ts:336–359  ·  view source on GitHub ↗
(
  host: SlashCommandHost,
  id: string,
  enabled: boolean,
  showStatus = true,
)

Source from the content-addressed store, hash-verified

334}
335
336async function applyPluginEnabled(
337 host: SlashCommandHost,
338 id: string,
339 enabled: boolean,
340 showStatus = true,
341): Promise<string> {
342 const session = host.requireSession();
343 await session.setPluginEnabled(id, enabled);
344 let info: PluginInfo | undefined;
345 try {
346 info = await session.getPluginInfo(id);
347 } catch {
348 info = undefined;
349 }
350 const mcpHint =
351 enabled && info !== undefined && info.mcpServerCount > info.enabledMcpServerCount
352 ? ` Some MCP servers are disabled; re-enable with /plugins mcp enable ${id} <server>.`
353 : '';
354 if (showStatus) {
355 host.showStatus(`${enabled ? 'Enabled' : 'Disabled'} ${id}. Run /reload or /new to apply.${mcpHint}`);
356 }
357 const inlineMcpHint = mcpHint.length > 0 ? ' · MCP servers disabled' : '';
358 return `${pluginInlineChangeHint()}${inlineMcpHint}`;
359}
360
361async function handlePluginsPanelSelection(
362 host: SlashCommandHost,

Callers 2

handlePluginsCommandFunction · 0.85

Calls 5

pluginInlineChangeHintFunction · 0.85
requireSessionMethod · 0.65
showStatusMethod · 0.65
setPluginEnabledMethod · 0.45
getPluginInfoMethod · 0.45

Tested by

no test coverage detected