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

Method persistInputHistory

apps/kimi-code/src/tui/kimi-tui.ts:1136–1148  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

1134 }
1135
1136 private async persistInputHistory(text: string): Promise<void> {
1137 const trimmed = text.trim();
1138 if (trimmed.length === 0) return;
1139 if (trimmed === this.lastHistoryContent) return;
1140 this.state.editor.addToHistory(trimmed);
1141 try {
1142 const file = getInputHistoryFile(this.state.appState.workDir);
1143 const written = await appendInputHistory(file, trimmed, this.lastHistoryContent);
1144 if (written) this.lastHistoryContent = trimmed;
1145 } catch {
1146 this.lastHistoryContent = trimmed;
1147 }
1148 }
1149
1150 recallLastQueued(): QueuedMessage | undefined {
1151 if (this.state.queuedMessages.length === 0) return undefined;

Callers 1

handleUserInputMethod · 0.95

Calls 3

getInputHistoryFileFunction · 0.90
appendInputHistoryFunction · 0.90
addToHistoryMethod · 0.65

Tested by

no test coverage detected