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

Function resolveUndoAvailability

apps/kimi-code/src/tui/commands/undo.ts:171–187  ·  view source on GitHub ↗
(
  host: SlashCommandHost,
)

Source from the content-addressed store, hash-verified

169}
170
171async function resolveUndoAvailability(
172 host: SlashCommandHost,
173): Promise<UndoAvailability> {
174 const local = undoAvailabilityFromTranscript(
175 host.state.transcriptEntries,
176 host.state.transcriptContainer.children,
177 );
178 const context = await getSessionContext(host.session);
179 if (context === undefined) return local;
180
181 const activeContext = undoAvailabilityFromContext(context.history);
182 return {
183 maxCount: Math.min(local.maxCount, activeContext.maxCount),
184 stoppedAtCompaction:
185 local.stoppedAtCompaction || activeContext.stoppedAtCompaction,
186 };
187}
188
189async function getSessionContext(
190 session: SlashCommandHost['session'],

Callers 2

handleUndoCommandFunction · 0.85
showUndoSelectorFunction · 0.85

Calls 3

getSessionContextFunction · 0.85

Tested by

no test coverage detected