MCPcopy Create free account
hub / github.com/anomalyco/opencode / ensureServerCtx

Function ensureServerCtx

packages/app/src/context/global.tsx:44–54  ·  view source on GitHub ↗
(conn: ServerConnection.Any)

Source from the content-addressed store, hash-verified

42 const owner = getOwner()
43
44 const ensureServerCtx = (conn: ServerConnection.Any) => {
45 const key = ServerConnection.key(conn)
46 const existing = serverCtxs.get(key)
47 if (existing) return existing.serverCtx
48 const root = createRoot((dispose) => {
49 const serverCtx = createServerCtx(conn, server.scope(key), server.projects.forServer(key))
50 return { dispose, serverCtx }
51 }, owner as any)
52 serverCtxs.set(key, root)
53 return root.serverCtx
54 }
55
56 createMemo(() => {
57 for (const conn of server.list) {

Callers 1

global.tsxFile · 0.85

Calls 4

createServerCtxFunction · 0.85
getMethod · 0.65
keyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected