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

Function formatPluginCommandSlash

apps/kimi-code/src/tui/commands/undo.ts:330–335  ·  view source on GitHub ↗
(data: NonNullable<TranscriptEntry['pluginCommandData']>)

Source from the content-addressed store, hash-verified

328}
329
330function formatPluginCommandSlash(data: NonNullable<TranscriptEntry['pluginCommandData']>): string | undefined {
331 const name = `${data.pluginId}:${data.commandName}`;
332 const args = singleLine(data.args ?? '');
333 if (name.length === 0) return undefined;
334 return args.length > 0 ? `/${name} ${args}` : `/${name}`;
335}
336
337function singleLine(text: string): string {
338 return text.replaceAll(/\s+/g, ' ').trim();

Callers 2

formatUndoChoiceLabelFunction · 0.85
formatUndoChoiceInputFunction · 0.85

Calls 1

singleLineFunction · 0.70

Tested by

no test coverage detected