Provider-Agnostic Adapter Interface
AI providers plug in through a small adapter contract: receive a ContextPayload and return either a query AST or a list of commands. WarGrid ships no vendor SDK and has no default endpoint. Any local model, self-hosted service or custom function works the same way.
Planned. This page shows the specification from issue #207. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
Three bundled demo adapters: a deterministic echo, a delayed mock, and a mock that fails on purpose. Echo is selected.
Expected behavior
Switching adapters needs no other configuration change. Cancel aborts via an AbortSignal. Adapter errors appear as non-blocking messages, and the grid state is unaffected.
Planned API surface
ai.providerAiProviderAdapteradapter.translate(payload, signal)adapter.capabilitiesonProviderErrorAcceptance criteria
- No network code exists in core; adapters own all I/O (pending)
- The adapter output is validated through the same schemas as any command (pending)
- AbortSignal is honoured and a late response is discarded (pending)
- Capabilities gate the UI features shown (pending)