MCPcopy
hub / github.com/Dimillian/CodexMonitor / normalizeImagesForRpc

Function normalizeImagesForRpc

src/services/tauri.ts:421–446  ·  view source on GitHub ↗
(images?: string[])

Source from the content-addressed store, hash-verified

419}
420
421async function normalizeImagesForRpc(images?: string[]): Promise<string[] | null> {
422 if (images == null) {
423 return null;
424 }
425 if (images.length === 0) {
426 return [];
427 }
428 const hasPathImages = images.some((image) => !isInlineImageUrl(image));
429 if (!hasPathImages) {
430 return images;
431 }
432 let settings: AppSettings;
433 let mobileRuntime: boolean;
434 try {
435 [settings, mobileRuntime] = await Promise.all([getAppSettings(), isMobileRuntime()]);
436 } catch (error) {
437 if (isMissingTauriInvokeError(error)) {
438 return images;
439 }
440 throw error;
441 }
442 if (settings.backendMode !== "remote" && !mobileRuntime) {
443 return images;
444 }
445 return convertImagesToDataUrls(images);
446}
447
448export async function sendUserMessage(
449 workspaceId: string,

Callers 2

sendUserMessageFunction · 0.85
steerTurnFunction · 0.85

Calls 5

isInlineImageUrlFunction · 0.85
getAppSettingsFunction · 0.85
isMobileRuntimeFunction · 0.85
convertImagesToDataUrlsFunction · 0.85

Tested by

no test coverage detected