MCPcopy
hub / github.com/anomalyco/opencode / projectsForServer

Function projectsForServer

packages/app/src/context/server.tsx:285–291  ·  view source on GitHub ↗
(key: ServerConnection.Key)

Source from the content-addressed store, hash-verified

283 const projects = createServerProjects({ scope, store, setStore })
284 const projectStores = new Map<ServerConnection.Key, ReturnType<typeof createServerProjects>>()
285 const projectsForServer = (key: ServerConnection.Key) => {
286 const existing = projectStores.get(key)
287 if (existing) return existing
288 const next = createServerProjects({ scope: () => scope(key), store, setStore })
289 projectStores.set(key, next)
290 return next
291 }
292 const current: Accessor<ServerConnection.Any | undefined> = createMemo(
293 () => allServers().find((s) => ServerConnection.key(s) === state.active) ?? allServers()[0],
294 )

Callers

nothing calls this directly

Calls 4

createServerProjectsFunction · 0.85
scopeFunction · 0.70
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected