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

Function legacyWorkspaceStorage

packages/app/src/utils/persist.ts:357–372  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

355}
356
357function legacyWorkspaceStorage(dir: string) {
358 const storage = workspaceStorage(pathKey(dir))
359 const result = new Set<string>()
360 const raw = workspaceStorage(dir)
361 if (raw !== storage) result.add(raw)
362
363 const key = pathKey(dir)
364 const drive = key.length >= 3 && key[1] === ":" && key[2] === "/"
365 if (drive) {
366 const backslash = workspaceStorage(key.replaceAll("/", "\\"))
367 if (backslash !== storage) result.add(backslash)
368 }
369
370 if (result.size === 0) return
371 return [...result]
372}
373
374function serverWorkspaceTarget(scope: ServerScopeValue, dir: string, key: string, legacy?: string[]): PersistTarget {
375 if (scope !== ServerScope.local) return { storage: workspaceStorage(ScopedKey.from(scope, pathKey(dir))), key }

Callers 1

serverWorkspaceTargetFunction · 0.85

Calls 3

pathKeyFunction · 0.90
workspaceStorageFunction · 0.85
addMethod · 0.65

Tested by

no test coverage detected