diff --git a/runners/agent-runner/src/index.ts b/runners/agent-runner/src/index.ts index 09906e9..8a0bb44 100644 --- a/runners/agent-runner/src/index.ts +++ b/runners/agent-runner/src/index.ts @@ -73,7 +73,7 @@ interface SessionsIndex { type ContentBlock = | { type: 'text'; text: string } - | { type: 'image'; source: { type: 'base64'; media_type: string; data: string } }; + | { type: 'image'; source: { type: 'base64'; media_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp'; data: string } }; interface SDKUserMessage { type: 'user'; @@ -140,7 +140,7 @@ function buildMultimodalContent(text: string): string | ContentBlock[] { } const data = fs.readFileSync(imgPath).toString('base64'); const ext = path.extname(imgPath).toLowerCase(); - const mediaType = MIME_TYPES[ext] || 'image/png'; + const mediaType = (MIME_TYPES[ext] || 'image/png') as 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp'; blocks.push({ type: 'image', source: { type: 'base64', media_type: mediaType, data } }); log(`Added image block: ${imgPath} (${mediaType})`); } catch (err) {