MCPcopy Index your code
hub / github.com/simstudioai/sim / canonicalWorkspaceFilePath

Function canonicalWorkspaceFilePath

apps/sim/lib/copilot/vfs/path-utils.ts:51–60  ·  view source on GitHub ↗
(parts: {
  folderPath?: string | null
  name: string
  prefix?: 'files' | 'recently-deleted/files'
})

Source from the content-addressed store, hash-verified

49}
50
51export function canonicalWorkspaceFilePath(parts: {
52 folderPath?: string | null
53 name: string
54 prefix?: 'files' | 'recently-deleted/files'
55}): string {
56 const prefix = parts.prefix ?? 'files'
57 const folderSegments = parts.folderPath ? parts.folderPath.split('/').filter(Boolean) : []
58 const encoded = encodeVfsPathSegments([...folderSegments, parts.name])
59 return `${prefix}/${encoded}`
60}
61
62/**
63 * Build a map from folderId to its canonical, per-segment-encoded VFS folder

Callers 15

resolveResourceFunction · 0.90
executeSaveFunction · 0.90
resolveFileResourceFunction · 0.90
fileLineFunction · 0.90
buildVfsSnapshotFunction · 0.90
path-utils.test.tsFile · 0.90
vfsPathForRecordFunction · 0.90
workspacePlanBackingPathFunction · 0.90
workflowPlanBackingPathFunction · 0.90
buildWorkflowAliasLinksFunction · 0.90

Calls 1

encodeVfsPathSegmentsFunction · 0.85

Tested by

no test coverage detected