MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readIconDataUri

Function readIconDataUri

packages/plugins/mcp/src/sdk/codex-plugins.ts:243–249  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

241
242/** The plugin's own icon as a data URI, read from the user's local install. */
243const readIconDataUri = (file: string): string | undefined =>
244 tryOrElse(() => {
245 const mime = ICON_MIME[path.extname(file).toLowerCase()];
246 if (mime === undefined) return undefined;
247 if (fs.statSync(file).size > MAX_ICON_BYTES) return undefined;
248 return `data:${mime};base64,${fs.readFileSync(file).toString("base64")}`;
249 }, undefined);
250
251interface CodexPluginDisplay {
252 readonly icon?: string;

Callers 2

curatedDisplayMetadataFunction · 0.85
scanCachedPluginFunction · 0.85

Calls 2

tryOrElseFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected