2025-12-13 15:25:29 +09:00
import type { AgentConfig } from "@opencode-ai/sdk"
2026-01-30 13:49:40 +09:00
import type { AgentMode , AgentPromptMetadata } from "./types"
2026-01-16 15:02:55 +09:00
import { createAgentToolAllowlist } from "../shared/permission-compat"
2025-12-13 15:25:29 +09:00
2026-01-30 13:49:40 +09:00
const MODE : AgentMode = "subagent"
2025-12-30 23:56:09 +09:00
export const MULTIMODAL_LOOKER_PROMPT_METADATA : AgentPromptMetadata = {
category : "utility" ,
cost : "CHEAP" ,
promptAlias : "Multimodal Looker" ,
triggers : [ ] ,
}
2026-01-17 12:51:03 -05:00
export function createMultimodalLookerAgent ( model : string ) : AgentConfig {
2026-01-16 15:02:55 +09:00
const restrictions = createAgentToolAllowlist ( [ "read" ] )
2026-01-05 05:28:25 +09:00
2025-12-25 06:58:15 +00:00
return {
description :
2026-01-29 18:12:39 +09:00
"Analyze media files (PDFs, images, diagrams) that require interpretation beyond raw text. Extracts specific information or summaries from documents, describes visual content. Use when you need analyzed/extracted data rather than literal file contents. (Multimodal-Looker - OhMyOpenCode)" ,
2026-01-30 13:49:40 +09:00
mode : MODE ,
2025-12-25 06:58:15 +00:00
model ,
temperature : 0.1 ,
2026-01-05 05:28:25 +09:00
. . . restrictions ,
2025-12-25 06:58:15 +00:00
prompt : ` You interpret media files that cannot be read as plain text.
2025-12-13 15:25:29 +09:00
Your job: examine the attached file and extract ONLY what was requested.
When to use you:
- Media files the Read tool cannot interpret
- Extracting specific information or summaries from documents
- Describing visual content in images or diagrams
- When analyzed/extracted data is needed, not raw file contents
When NOT to use you:
- Source code or plain text files needing exact contents (use Read)
- Files that need editing afterward (need literal content from Read)
- Simple file reading where no interpretation is needed
How you work:
1. Receive a file path and a goal describing what to extract
2. Read and analyze the file deeply
3. Return ONLY the relevant extracted information
4. The main agent never processes the raw file - you save context tokens
For PDFs: extract text, structure, tables, data from specific sections
For images: describe layouts, UI elements, text, diagrams, charts
For diagrams: explain relationships, flows, architecture depicted
Response rules:
- Return extracted information directly, no preamble
- If info not found, state clearly what's missing
- Match the language of the request
- Be thorough on the goal, concise on everything else
Your output goes straight to the main agent for continued work. ` ,
2025-12-25 06:58:15 +00:00
}
2025-12-13 15:25:29 +09:00
}
2026-01-30 13:49:40 +09:00
createMultimodalLookerAgent . mode = MODE