refactor(agent): 迁移AI会话引擎至pi-agent-core库

将原有基于Anthropic/OpenAI SDK的直播聊天代理重构为使用`@earendil-works/pi-agent-core`和`@earendil-works/pi-ai`库的统一API。

新增pi-bridge、pi-model、pi-persist、pi-tools四个模块,封装Agent路由、模型配置、消息持久化和工具适配逻辑。移除`chat.ts`中大量死代码,简化WebSocket处理流程。

BREAKING CHANGE: 移除`VideoAgent`类的`getAnthropicClient`、`getOpenAIClient`、`executeTool`等方法,外部调用需迁移至新pi-bridge API。`PROJECT_ROOT`路径计算方式变更,从`../../..`变为`../../`。
This commit is contained in:
2026-05-08 01:43:33 +08:00
parent 2ab5396461
commit a6f2973f21
10 changed files with 2642 additions and 522 deletions

View File

@@ -12,6 +12,8 @@
},
"dependencies": {
"@anthropic-ai/sdk": "^0.95.0",
"@earendil-works/pi-agent-core": "^0.74.0",
"@earendil-works/pi-ai": "^0.74.0",
"@types/multer": "^2.1.0",
"better-sqlite3": "^11.6.0",
"cors": "^2.8.5",