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

Method runBuiltInCommand

packages/acp-adapter/src/session.ts:781–814  ·  view source on GitHub ↗
(
    name: AcpBuiltinSlashCommandName,
    args: string,
  )

Source from the content-addressed store, hash-verified

779 }
780
781 private async runBuiltInCommand(
782 name: AcpBuiltinSlashCommandName,
783 args: string,
784 ): Promise<PromptResponse> {
785 try {
786 switch (name) {
787 case 'compact':
788 await this.runCompactCommand(args);
789 break;
790 case 'status':
791 await this.emitLocalCommandMessage(formatStatusReport(await this.session.getStatus()));
792 break;
793 case 'usage':
794 await this.emitLocalCommandMessage(
795 formatUsageReport(await this.session.getUsage(), await this.session.getStatus()),
796 );
797 break;
798 case 'mcp':
799 await this.emitLocalCommandMessage(formatMcpReport(await this.session.listMcpServers()));
800 break;
801 case 'tasks':
802 await this.emitLocalCommandMessage(
803 formatTasksReport(await this.session.listBackgroundTasks()),
804 );
805 break;
806 case 'help':
807 await this.emitLocalCommandMessage(formatHelpReport(this.availableCommands));
808 break;
809 }
810 } catch (error) {
811 await this.emitLocalCommandMessage(`/${name} failed: ${errorMessage(error)}`);
812 }
813 return { stopReason: 'end_turn' };
814 }
815
816 private async runUnknownSlashCommand(name: string): Promise<PromptResponse> {
817 await this.emitLocalCommandMessage(

Callers 1

promptMethod · 0.95

Calls 12

runCompactCommandMethod · 0.95
formatStatusReportFunction · 0.85
formatUsageReportFunction · 0.85
formatMcpReportFunction · 0.85
formatTasksReportFunction · 0.85
formatHelpReportFunction · 0.85
listBackgroundTasksMethod · 0.80
errorMessageFunction · 0.70
getStatusMethod · 0.65
getUsageMethod · 0.45
listMcpServersMethod · 0.45

Tested by

no test coverage detected