(images?: string[])
| 419 | } |
| 420 | |
| 421 | async 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 | |
| 448 | export async function sendUserMessage( |
| 449 | workspaceId: string, |
no test coverage detected