MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / buildArtifactFromFilePath

Function buildArtifactFromFilePath

src/providers/codex/app_client.ts:3740–3759  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

3738}
3739
3740function buildArtifactFromFilePath(filePath) {
3741 const normalizedPath = String(filePath ?? '').trim();
3742 const kind = inferArtifactKindFromPath(normalizedPath);
3743 let sizeBytes = null;
3744 try {
3745 sizeBytes = fs.statSync(normalizedPath).size;
3746 } catch {
3747 sizeBytes = null;
3748 }
3749 return {
3750 kind,
3751 path: normalizedPath,
3752 displayName: path.basename(normalizedPath) || null,
3753 mimeType: inferMimeTypeFromPath(normalizedPath),
3754 sizeBytes,
3755 caption: null,
3756 source: 'provider_native' as const,
3757 turnId: null,
3758 };
3759}
3760
3761function inferArtifactKindFromPath(filePath) {
3762 const extension = path.extname(String(filePath ?? '')).toLowerCase();

Callers 2

Calls 2

inferMimeTypeFromPathFunction · 0.70

Tested by

no test coverage detected