将 @anthropic-ai/sdk 从 0.x 升级到 1.x
根据 TypeScript 类型自动比较 @anthropic-ai/sdk 0.137.0 与 1.0.0 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 2 |
| 已修改的签名 | 1 |
| 已删除的类或接口成员 | 12 |
| 已修改的类或接口成员 | 0 |
| 新增弃用 | 0 |
| 要求变化(engines、peer 依赖) | 0 |
| 新增导出 | 0 |
已删除的导出
| import | export | kind | 之前 |
|---|---|---|---|
@anthropic-ai/sdk | AI_PROMPT | variable | "\\n\\nAssistant:" |
@anthropic-ai/sdk | HUMAN_PROMPT | variable | "\\n\\nHuman:" |
已修改的签名
| export | 之前 | 之后 |
|---|---|---|
@anthropic-ai/sdk · ParseableMessageCreateParams | { stream?: boolean | undefined; max_tokens: number; messages: MessageParam[]; model: Model; cache_control?: CacheControlEphemeral | null | undefined; container?: MessageCreateParamsContainer | null | undefined; diagnostics?: DiagnosticsParam | null | undefined; inference_geo?: string | null | undefined; metadata?: Metadata | undefined; service_tier?: "auto" | "standard_only" | undefined; speed?: "standard" | "fast" | null | undefined; stop_sequences?: string[] | undefined; system?: string | TextBlockParam[] | undefined; temperature?: number | undefined; thinking?: ThinkingConfigParam | undefin… | { stream?: boolean | undefined; max_tokens: number; messages: MessageParam[]; model: Model; cache_control?: CacheControlEphemeral | null | undefined; container?: MessageCreateParamsContainer | null | undefined; diagnostics?: DiagnosticsParam | null | undefined; inference_geo?: string | null | undefined; metadata?: Metadata | undefined; service_tier?: "auto" | "standard_only" | undefined; speed?: "standard" | "fast" | null | undefined; stop_sequences?: string[] | undefined; system?: string | TextBlockParam[] | undefined; thinking?: ThinkingConfigParam | undefined; tool_choice?: ToolChoice | und… |
已删除的类或接口成员
| member | import | 之前 |
|---|---|---|
default.completions | @anthropic-ai/sdk | Completions |
default.static AI_PROMPT | @anthropic-ai/sdk | string |
default.static Completions | @anthropic-ai/sdk | typeof Completions |
default.static HUMAN_PROMPT | @anthropic-ai/sdk | string |
Anthropic.completions | @anthropic-ai/sdk | Completions |
Anthropic.static AI_PROMPT | @anthropic-ai/sdk | string |
Anthropic.static Completions | @anthropic-ai/sdk | typeof Completions |
Anthropic.static HUMAN_PROMPT | @anthropic-ai/sdk | string |
APIPromise.static __@species@5533 | @anthropic-ai/sdk | PromiseConstructor |
PagePromise.static __@species@5533 | @anthropic-ai/sdk | PromiseConstructor |
BaseAnthropic.static AI_PROMPT | @anthropic-ai/sdk | string |
BaseAnthropic.static HUMAN_PROMPT | @anthropic-ai/sdk | string |
已修改的类或接口成员
未发现。
新增弃用
未发现。
要求变化(engines、peer 依赖)
未发现。
这些版本之间的 changelog
软件包作者发布的文本,按原样显示。
1.0.0
### ⚠ BREAKING CHANGES
* **api:** add support for new API version 2026-10-21
### Features
* **api:** add a workspace_id filter and the usage_tier scope type to list spend limits
* **api:** add support for new API version 2026-10-21
### Chores
* **ci:** check the changelog of each package a pull request changes
* **internal:** specify which changelog a pull request updates
### Documentation
* **api:** remove outdated system role note from messages description把这些数据交给你的 AI 智能体
Vigia 是免费的 MCP 服务器:你的编程智能体在写代码之前就能检查版本、不兼容变更和安全漏洞。无需注册,无需 API 密钥。
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
添加到 Cursor添加到 VS Code★ 在 GitHub 上加星
任何其他 MCP 客户端
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }常见问题
将 @anthropic-ai/sdk 从 0 升级到 1 有哪些不兼容变更?
在 @anthropic-ai/sdk 0.137.0 与 1.0.0 之间,Vigia 发现 2 个已删除的导出、1 个已修改的签名,以及 12 个已删除或修改的类或接口成员。
@anthropic-ai/sdk 1 中弃用了哪些内容?
@anthropic-ai/sdk 1.0.0 中有 0 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/@anthropic-ai/sdk/upgrade?from=0.137.0&to=1.0.0