Z.AI & MiniMax AI Integrations
Relevant source files
The following files were used as context for generating this wiki page:
Z.AI and MiniMax represent the primary AI provider integrations within Scoutline. They supply core capabilities including web search, page reading, visual media analysis, and repository exploration. These providers are managed through a standardized adapter architecture that allows the Scoutline CLI to route requests based on user preference or automatic fallback logic.
The Z.AI integration emphasizes a wide range of source investigation tools, including a dedicated repository explorer and an OCR engine for documents. The MiniMax integration focuses on high-performance web search and specialized vision operations. Both providers require API keys configured via environment variables or the Scoutline configuration store.
Sources: packages/scoutline/src/index.ts:169-188, packages/scoutline/src/lib/config.ts:46-56
Architecture and Provider Selection
Scoutline uses a descriptor-based registry to manage AI providers. Each provider implements a ProviderDescriptor that advertises its supported capabilities. The CLI dispatcher resolves the effective provider based on a precedence chain: explicit --provider flag, then the SCOUTLINE_PROVIDER environment variable, then the configured default (typically zai).
The diagram above shows how the Scoutline dispatcher routes user commands to the appropriate provider adapter based on configuration and flags.
Sources: packages/scoutline/src/index.ts:1143-1160, packages/scoutline/src/providers/zai/adapter.ts:25-45, packages/scoutline/src/providers/minimax/adapter.ts:20-40
Capability Support Matrix
The following table summarizes the capabilities supported by the Z.AI and MiniMax adapters.
| Capability | Z.AI Support | MiniMax Support | Implementation Note |
|---|---|---|---|
| Search | Yes | Yes | Real-time web search. |
| Vision | Yes | Yes | Image and video analysis. |
| Reader | Yes | No | Fetching and parsing web pages. |
| Repo | Yes | No | GitHub repository exploration. |
| Diagnostics | Yes | Yes | Connectivity and health checks. |
| OCR | Yes | No | GLM-OCR engine for PDF and images. |
Sources: packages/scoutline/src/index.ts:175-188, packages/scoutline/src/commands/vision.ts:79-115
Z.AI Integration Details
Z.AI provides the most comprehensive feature set in Scoutline. It utilizes several Model Context Protocol (MCP) server endpoints for specialized tasks.
MCP Endpoints
Z.AI operations are routed to specific MCP servers:
- ZREAD:
https://api.z.ai/api/mcp/zread/mcp(Repository exploration and file reading) - Web Search:
https://api.z.ai/api/mcp/web_search_prime/mcp - Web Reader:
https://api.z.ai/api/mcp/web_reader/mcp
Sources: packages/scoutline/src/lib/config.ts:22-26, packages/scoutline/tests/mcp-live.test.js:93-100
Media Handling and Constraints
The Z.AI adapter enforces strict size and format limits on media files. Local files are validated for existence and size before being passed to the MCP client as absolute paths.
| Media Type | Max Size | Supported Formats |
|---|---|---|
| Images | 5 MiB | JPG, JPEG, PNG |
| Videos | 8 MiB | MP4, MOV, M4V, AVI, WebM, WMV |
| OCR PDF | 50 MiB | PDF (GLM-OCR only) |
| OCR Image | 10 MiB | JPG, JPEG, PNG (GLM-OCR only) |
Sources: packages/scoutline/src/providers/zai/media.ts:40-48, packages/scoutline/src/providers/zai/media.ts:55-60
MiniMax AI Integration Details
The MiniMax integration is primarily used for web search and general image interpretation. It does not support Scoutline's advanced repository or site crawling features.
Vision Operations
MiniMax supports a subset of the vision command family. In Scoutline, specialized vision operations for MiniMax are gated by a conformance registry.
- Supported:
analyze(general image interpretation),ui-to-code,extract-text,diagnose-error,diagram,chart. - Unsupported:
diff,video.
Sources: packages/scoutline/src/commands/vision.ts:45-71, packages/scoutline/src/commands/vision.ts:108-112
Search and Quota
MiniMax search results include organic links and snippets. Unlike Z.AI, which uses MCP tool discovery for health checks, MiniMax diagnostics use a direct quota probe against the coding_plan/remains endpoint to check for available requests or tokens.
Sources: packages/scoutline/tests/mcp-live.test.js:283-305, packages/scoutline/src/providers/minimax/adapter.ts:25-35
Data Flow for Vision Commands
When a vision command is executed, the dispatcher resolves the provider and validates the source (URL or local path) before invoking the adapter.
The sequence above illustrates the Z.AI-specific flow for OCR extraction, including the media resolution step.
Sources: packages/scoutline/src/commands/vision.ts:200-220, packages/scoutline/src/providers/zai/media.ts:163-185
Conclusion
The Z.AI and MiniMax integrations provide the backbone for multimodal investigations in Scoutline. Z.AI acts as the comprehensive provider for web, code, and visual research, while MiniMax offers a high-capacity alternative for search and image interpretation. Both adapters maintain strict normalization to ensure that the CLI's output formats (JSON, Markdown, TTY) remain consistent regardless of the underlying AI service.
Sources: packages/scoutline/src/index.ts:190-210, packages/scoutline/src/providers/zai/adapter.ts:50-70