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

Function resolveFileFolderResource

apps/sim/lib/copilot/chat/process-contents.ts:781–799  ·  view source on GitHub ↗
(
  folderId: string,
  workspaceId: string
)

Source from the content-addressed store, hash-verified

779}
780
781async function resolveFileFolderResource(
782 folderId: string,
783 workspaceId: string
784): Promise<AgentContext | null> {
785 try {
786 const rawPath = await getWorkspaceFileFolderPath(workspaceId, folderId)
787 if (!rawPath) return null
788 const encoded = encodeVfsPathSegments(rawPath.split('/').filter(Boolean))
789 return {
790 type: 'active_resource',
791 tag: '@active_resource',
792 content: '',
793 path: `files/${encoded}`,
794 }
795 } catch (error) {
796 logger.error('Failed to resolve file folder resource', { folderId, error })
797 return null
798 }
799}
800
801async function resolveFolderResource(
802 folderId: string,

Callers 2

processContextsServerFunction · 0.85

Calls 3

encodeVfsPathSegmentsFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected