Introduces the IProviderAdapter interface as the architecture foundation for
multi-provider support. Extracts Ollama logic into OllamaAdapter and makes
ProviderService adapter-aware while preserving the full existing API.
## What changed
### @mosaic/types — new provider adapter types
- IProviderAdapter interface: register(), listModels(), healthCheck(), createCompletion()
- ProviderHealth / ProviderHealthStatus — health check result
- CompletionParams / CompletionMessage / CompletionTool — completion request
- CompletionEvent / CompletionUsage — streamed completion response
### apps/gateway — adapter implementation
- apps/gateway/src/agent/adapters/ollama.adapter.ts — OllamaAdapter (extracted from ProviderService)
- apps/gateway/src/agent/adapters/index.ts — barrel export
- ProviderService.onModuleInit() is now async (awaits registerAll())
- New ProviderService methods: registerAll(), getAdapter(), healthCheckAll()
- PROVIDER_ADAPTERS symbol exported as future DI injection token
- Anthropic/OpenAI/Z.ai remain as direct registry calls (M3-002 to M3-005 scope)
- Updated provider.service.test.ts: all tests now await onModuleInit()
## Pi SDK compatibility findings
Pi SDK uses ModelRegistry as central registry. The adapter pattern is a Mosaic
abstraction layered on top — adapters call registry.registerProvider() during
register(). Pi SDK has no native adapter concept; it does not conflict.
createCompletion() is defined in the interface but not called by the Pi layer.
Pi SDK's AgentSession.prompt() and ModelRegistry.getAvailable() handle all
actual completions. createCompletion() is reserved for future direct-completion
use cases (post-M3 scope). OllamaAdapter throws NotImplementedError for now.
No Pi SDK friction was found for the adapter pattern. The registry integration
point (registerProvider()) is exactly what the existing code already used.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mark P1-001, P1-007, P1-008, P2-001, P5-002, P6-005 as done (PR #61).
Add session 2 log entry for vertical slice delivery.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Jason directed: build Pi TUI → Gateway → Discord communication
spine before backfilling horizontal layers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Break PRD into 8 milestones (Phase 0–7) with 59 issues on Gitea.
Populate TASKS.md, update mission manifest, initialize scratchpad.
Repo created at git.mosaicstack.dev/mosaic/mosaic-stack.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>