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

Function getOrCreate

apps/kimi-web/src/api/daemon/agentEventProjector.ts:522–529  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

520 const sideChannelAgents = new Set<string>();
521
522 function getOrCreate(sessionId: string): SessionState {
523 let s = sessions.get(sessionId);
524 if (!s) {
525 s = createSessionState();
526 sessions.set(sessionId, s);
527 }
528 return s;
529 }
530
531 function reset(sessionId: string): void {
532 sessions.set(sessionId, createSessionState());

Callers 3

bindNextPromptIdFunction · 0.85
seedInFlightFunction · 0.85
_projectFunction · 0.85

Calls 3

createSessionStateFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected