MCPcopy
hub / github.com/simstudioai/sim / resolve

Function resolve

apps/sim/lib/copilot/vfs/path-utils.ts:81–92  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

79
80 const cache = new Map<string, string>()
81 const resolve = (id: string): string => {
82 const cached = cache.get(id)
83 if (cached !== undefined) return cached
84 const folder = folderMap.get(id)
85 if (!folder) return ''
86 const parentPath = folder.parentId ? resolve(folder.parentId) : ''
87 const path = parentPath
88 ? `${parentPath}/${encodeVfsSegment(folder.name)}`
89 : encodeVfsSegment(folder.name)
90 cache.set(id, path)
91 return path
92 }
93
94 for (const id of folderMap.keys()) resolve(id)
95 return cache

Callers 15

runFunction · 0.90
buildVfsFolderPathMapFunction · 0.70
isDockerRunningFunction · 0.50
runCommandFunction · 0.50
thenFunction · 0.50
sleepFunction · 0.50
store.tsFile · 0.50
builderFunction · 0.50
runCommandFunction · 0.50
probeFileFunction · 0.50
parseStreamMethod · 0.50
renderInWorkerFunction · 0.50

Calls 3

encodeVfsSegmentFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by 5

thenFunction · 0.40
builderFunction · 0.40
createMockChainFunction · 0.40
createMockChainFunction · 0.40
wireDbFunction · 0.40