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

Function createUndoChoices

apps/kimi-code/src/tui/commands/undo.ts:247–260  ·  view source on GitHub ↗
(
  entries: readonly TranscriptEntry[],
  children: readonly Component[],
  maxCount: number,
)

Source from the content-addressed store, hash-verified

245}
246
247function createUndoChoices(
248 entries: readonly TranscriptEntry[],
249 children: readonly Component[],
250 maxCount: number,
251): readonly UndoChoice[] {
252 if (maxCount <= 0) return [];
253 const anchors = activeUndoAnchorEntries(entries, children).anchors.slice(-maxCount);
254 return anchors.map((entry, index) => ({
255 id: entry.id,
256 count: anchors.length - index,
257 input: formatUndoChoiceInput(entry),
258 label: formatUndoChoiceLabel(entry),
259 }));
260}
261
262function activeUndoAnchorEntries(
263 entries: readonly TranscriptEntry[],

Callers 1

showUndoSelectorFunction · 0.85

Calls 3

activeUndoAnchorEntriesFunction · 0.85
formatUndoChoiceInputFunction · 0.85
formatUndoChoiceLabelFunction · 0.85

Tested by

no test coverage detected