refactor: 搬入 errorUtils 并迁移消费者导入到 model-provider

- 搬入 formatAPIError、extractConnectionErrorDetails 等 errorUtils
- 迁移 10 个消费者文件直接从 @anthropic-ai/model-provider 导入
- 更新 emptyUsage、sdkUtilityTypes、systemPromptType 为 re-export proxy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-13 23:11:00 +08:00
parent a99375b03d
commit ac0ca4a481
14 changed files with 326 additions and 457 deletions

View File

@@ -6,8 +6,8 @@
* while keeping the side question response separate from main conversation.
*/
import { formatAPIError } from '../services/api/errorUtils.js'
import type { NonNullableUsage } from '../services/api/logging.js'
import { formatAPIError } from '@anthropic-ai/model-provider'
import type { NonNullableUsage } from '@anthropic-ai/model-provider'
import type { Message, SystemAPIErrorMessage } from '../types/message.js'
import { type CacheSafeParams, runForkedAgent } from './forkedAgent.js'
import { createUserMessage, extractTextContent } from './messages.js'