Migrate to Pi Coding Agent SDK for multi-provider LLM support

Replace the custom Pi API fetch client with the @earendil-works/pi-coding-agent
SDK, enabling support for multiple LLM providers (Anthropic, OpenAI, DeepSeek,
Google Gemini, xAI/ZAI) while maintaining backward compatibility.

Key changes:
- Add piSdk.ts with SDK session management and provider auto-detection
- Refactor client.ts to delegate to SDK adapter, keeping public API surface
- Update documentation to reflect multi-provider environment variables
- Add RPC contracts for LLM model selection and provider configuration
- Update agent runner to support provider-specific tools and parameters

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-15 00:17:26 -04:00
parent 506d092b2b
commit 0624026af3
30 changed files with 4326 additions and 354 deletions

View File

@@ -6,7 +6,12 @@ This is the primary instruction file for Claude Code working on the MosaicIQ pro
**Required:**
```bash
export PI_API_KEY=your_pi_api_key_here
export ANTHROPIC_API_KEY=sk-ant-...
# or another supported provider:
# export OPENAI_API_KEY=sk-...
# export DEEPSEEK_API_KEY=...
# export GOOGLE_API_KEY=...
# export ZAI_API_KEY=...
```
See **[agent.md](./agent.md)** for complete project documentation, including:
@@ -51,7 +56,7 @@ local_research_app/
| LLM Client Reference | [agent.md # LLM Client Reference](./agent.md#llm-client-reference) |
| Architecture | [docs/architecture.md](./docs/architecture.md) |
| RPC Contracts | [`packages/contracts/src/rpc.ts`](./packages/contracts/src/rpc.ts) |
| Pi Client | [`packages/shared/src/llm/client.ts`](./packages/shared/src/llm/client.ts) |
| LLM Client | [`packages/shared/src/llm/piSdk.ts`](./packages/shared/src/llm/piSdk.ts) |
## Coding Style