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

Function inlineImageSource

apps/sim/hooks/use-file-content-source.tsx:50–62  ·  view source on GitHub ↗

Build a source whose embeds resolve through `inlineBase` (the workspace- or token-scoped inline route).

(
  buildUrl: FileContentSource['buildUrl'],
  inlineBase: string
)

Source from the content-addressed store, hash-verified

48
49/** Build a source whose embeds resolve through `inlineBase` (the workspace- or token-scoped inline route). */
50function inlineImageSource(
51 buildUrl: FileContentSource['buildUrl'],
52 inlineBase: string
53): FileContentSource {
54 return {
55 buildUrl,
56 resolveImageSrc: (src) => {
57 if (!src) return src
58 const ref = extractEmbeddedFileRef(src)
59 return ref ? `${inlineBase}?${inlineRefQuery(ref)}` : src
60 },
61 }
62}
63
64/**
65 * In-app source scoped to one workspace. Direct file bytes come from the workspace serve URL; embedded

Callers 2

Calls 2

extractEmbeddedFileRefFunction · 0.90
inlineRefQueryFunction · 0.85

Tested by

no test coverage detected