Add RoutingService that selects optimal LLM model based on task type,
cost tier, capability requirements (reasoning, image, context window),
and provider preference. Scoring algorithm ranks all available models.
- RoutingService: route() for best match, rank() for scored list
- POST /api/providers/route and /api/providers/rank endpoints
- Routing types in @mosaic/types (CostTier, TaskType, RoutingCriteria)
- Cost tier classification: cheap (<$1/M), standard (<$10/M), premium
Closes#21
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pi SDK is ESM-only. tsx (esbuild) doesn't emit decorator metadata,
so NestJS constructor injection fails without explicit @Inject().
- Set "type": "module" in gateway package.json
- Switch tsconfig to NodeNext module resolution
- Add @Inject(AgentService) to ChatController and ChatGateway
Tested end-to-end: REST /api/chat → Pi SDK → Anthropic → response OK.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>