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

Function fileToStub

apps/sim/connectors/azure-devops/azure-devops.ts:845–866  ·  view source on GitHub ↗

* Builds a deferred stub for a repository file. Content is empty and fetched * lazily via getDocument for new/changed files only. The contentHash is the git * blob objectId, identical between the stub and the hydrated document.

(organization: string, project: string, entry: RepoFileEntry)

Source from the content-addressed store, hash-verified

843 * blob objectId, identical between the stub and the hydrated document.
844 */
845function fileToStub(organization: string, project: string, entry: RepoFileEntry): ExternalDocument {
846 const path = entry.item.path
847 const title = path.split('/').filter(Boolean).pop() || path
848 return {
849 externalId: fileExternalId(entry.repoId, path),
850 title,
851 content: '',
852 contentDeferred: true,
853 mimeType: 'text/plain',
854 sourceUrl: buildFileSourceUrl(entry.repoWebUrl, entry.branch, path),
855 contentHash: buildFileContentHash(entry.repoId, entry.item.objectId),
856 metadata: {
857 kind: 'file',
858 organization,
859 project,
860 repository: entry.repoName,
861 repositoryId: entry.repoId,
862 branch: entry.branch,
863 path,
864 },
865 }
866}
867
868/**
869 * Resolves the flattened, filtered list of repository files for the configured

Callers 1

listRepoFilesFunction · 0.70

Calls 3

fileExternalIdFunction · 0.85
buildFileSourceUrlFunction · 0.70
buildFileContentHashFunction · 0.70

Tested by

no test coverage detected