/** * Agent adapter detection. * * Inspects the incoming request to select the appropriate AgentAdapter. * Falls back to the OpenCode adapter for backward compatibility. */ import type { Context } from "hono"; import type { AgentAdapter } from "../adapter"; /** * Detect which agent adapter to use based on request headers. * * Detection rules (evaluated in order): * 1. x-meridian-agent header → explicit adapter override * 2. x-opencode-session or x-session-affinity header → OpenCode adapter * 3. User-Agent starts with "opencode/" → OpenCode adapter * 4. User-Agent starts with "factory-cli/" → Droid adapter * 5. User-Agent starts with "Charm-Crush/" → Crush adapter * 6. User-Agent starts with "claude-cli/" → Claude Code adapter * 7. litellm/* UA or x-litellm-* headers → LiteLLM passthrough adapter * 8. Default → MERIDIAN_DEFAULT_AGENT env var, or OpenCode */ export declare function detectAdapter(c: Context): AgentAdapter; //# sourceMappingURL=detect.d.ts.map