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

Method setAppState

apps/kimi-code/src/tui/kimi-tui.ts:1367–1383  ·  view source on GitHub ↗
(patch: Partial<AppState>)

Source from the content-addressed store, hash-verified

1365 }
1366
1367 setAppState(patch: Partial<AppState>): void {
1368 if (!hasPatchChanges(this.state.appState, patch)) return;
1369 const additionalDirsChanged =
1370 'additionalDirs' in patch &&
1371 !sameStringArrays(this.state.appState.additionalDirs, patch.additionalDirs ?? []);
1372 const busyChanged = 'streamingPhase' in patch || 'isCompacting' in patch;
1373 Object.assign(this.state.appState, patch);
1374 if ('planMode' in patch) this.updateEditorBorderHighlight();
1375 this.state.footer.setState(this.state.appState);
1376 this.updateActivityPane();
1377 if (busyChanged) {
1378 this.updateQueueDisplay();
1379 this.sessionEventHandler.retryQueuedGoalPromotion();
1380 }
1381 if (additionalDirsChanged) this.setupAutocomplete();
1382 this.state.ui.requestRender();
1383 }
1384
1385 patchLivePane(patch: Partial<LivePaneState>): void {
1386 if (!hasPatchChanges(this.state.livePane, patch)) return;

Callers 12

handleInputModeChangeMethod · 0.95
finishShellOutputMethod · 0.95
beginSessionRequestMethod · 0.95
failSessionRequestMethod · 0.95
syncAdditionalDirsMethod · 0.95
syncRuntimeStateMethod · 0.95
unloadCurrentSessionMethod · 0.95
resetSessionRuntimeMethod · 0.95
createNewSessionMethod · 0.95
applyThemeMethod · 0.95

Calls 9

updateActivityPaneMethod · 0.95
updateQueueDisplayMethod · 0.95
setupAutocompleteMethod · 0.95
hasPatchChangesFunction · 0.90
sameStringArraysFunction · 0.85
setStateMethod · 0.80
requestRenderMethod · 0.65

Tested by

no test coverage detected