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

Function getE2BDocFormat

apps/sim/lib/copilot/tools/server/files/doc-compile.ts:61–99  ·  view source on GitHub ↗
(fileName: string)

Source from the content-addressed store, hash-verified

59 * is enabled; callers gate on isE2BDocEnabled before using this.
60 */
61export async function getE2BDocFormat(fileName: string): Promise<E2BDocFormat | null> {
62 const l = fileName.toLowerCase()
63 if (l.endsWith('.pptx'))
64 return {
65 ext: 'pptx',
66 engine: 'node',
67 formatName: 'PPTX',
68 contentType: PPTX_MIME,
69 sourceMime: PPTXGENJS_SOURCE_MIME,
70 }
71 if (l.endsWith('.docx'))
72 return {
73 ext: 'docx',
74 engine: 'node',
75 formatName: 'DOCX',
76 contentType: DOCX_MIME,
77 sourceMime: DOCXJS_SOURCE_MIME,
78 }
79 if (l.endsWith('.pdf'))
80 return {
81 ext: 'pdf',
82 engine: 'python',
83 formatName: 'PDF',
84 contentType: PDF_MIME,
85 sourceMime: PYTHON_PDF_SOURCE_MIME,
86 }
87 // xlsx is gated behind the mothership-beta feature flag (like plans/changelog): the
88 // skill + prompt are gated on the Go side, and this is the single Sim chokepoint
89 // that keeps the compile/serve/check/recalc paths off for xlsx when beta is off.
90 if (l.endsWith('.xlsx') && (await isFeatureEnabled('mothership-beta')))
91 return {
92 ext: 'xlsx',
93 engine: 'python',
94 formatName: 'XLSX',
95 contentType: XLSX_MIME,
96 sourceMime: PYTHON_XLSX_SOURCE_MIME,
97 }
98 return null
99}
100
101// The skills reference workspace images by BARE file id through the injected
102// helpers — `getFileBase64(id)`, `addImage(slide, id, ...)` (pptx),

Callers 9

compileDocForWriteFunction · 0.90
executeFunction · 0.90
renderDocRecordResultMethod · 0.90
readFileContentMethod · 0.90
route.tsFile · 0.90
compileDocFunction · 0.85
loadCompiledDocByExtFunction · 0.85
resolveServableDocFunction · 0.85
resolveServableDocBytesFunction · 0.85

Calls 1

isFeatureEnabledFunction · 0.90

Tested by

no test coverage detected