跳到主内容
@wquguru

Claude Agent SDK v0.3.281:Settings

v0.3.281

原文
发到 X
推荐理由

TypeScript开发者必读:Settings.attribution字段类型发生破坏性变更,不调整类型检查代码会导致编译失败。建议立即升级并审查相关类型定义。

What's changed

变更内容

  • Added optional trigger, user_message_uuid and timestamp fields to the conversation_reset message so clients can tell what reset the conversation, match a /clear to its message, and show when the reset happened
  • Fixed permission and dialog callbacks still being invoked for requests that arrived after close()
  • Fixed control requests issued after a query closed hanging or leaking, and permission prompts that could not be cancelled after a cancelled request was redelivered
  • Fixed session_state_changed staying at requires_action after an overlapping permission prompt and sandbox network-access prompt were both answered
  • Improved SDK package size and load time: sdk.mjs no longer bundles unused dependencies (1.47 MB → 0.97 MB)
  • Improved startup time for query() sessions with in-process MCP servers (createSdkMcpServer) by running their handshake inside the SDK; initialize may now wait up to 250 ms for them
  • Improved SDK session start-up: the CLI now answers the host's initialize request before starting its background start-up work
  • Changed the Settings type's attribution field to boolean | {...}; TypeScript code that reads attribution.commit from returned settings needs a type narrow
  • Updated to parity with Claude Code v2.1.281
  • 在 conversation_reset 消息中添加了可选的 trigger、user_message_uuid 和 timestamp 字段,以便客户端能够识别是什么触发了对话重置、将 /clear 命令与其对应的消息匹配,并显示重置发生的时间
  • 修复了在 close() 之后到达的请求仍会触发权限和对话框回调的问题
  • 修复了在查询关闭后发出的控制请求出现挂起或资源泄漏的问题,以及在被取消的请求重新投递后无法取消权限提示的问题
  • 修复了在重叠的权限提示和沙箱网络访问提示均被响应后,session_state_changed 仍停留在 requires_action 状态的问题
  • 优化了 SDK 包大小和加载时间:sdk.mjs 不再捆绑未使用的依赖项(从 1.47 MB 减少至 0.97 MB)
  • 通过让 SDK 内部运行握手过程,改善了使用进程内 MCP 服务器(createSdkMcpServer)的 query() 会话的启动时间;initialize 现在最多可等待 250 ms 以完成握手
  • 优化了 SDK 会话启动流程:CLI 现在会在开始后台启动工作之前先响应主机的 initialize 请求
  • 将 Settings 类型的 attribution 字段更改为 boolean | {...};读取返回设置中 attribution.commit 的 TypeScript 代码需要进行类型收窄处理
  • 更新以与 Claude Code v2.1.281 保持功能一致

Update

更新

代码 · 7
npm install @anthropic-ai/[email protected]
# or
yarn add @anthropic-ai/[email protected]
# or
pnpm add @anthropic-ai/[email protected]
# or
bun add @anthropic-ai/[email protected]
代码 · 7
npm install @anthropic-ai/[email protected]
# or
yarn add @anthropic-ai/[email protected]
# or
pnpm add @anthropic-ai/[email protected]
# or
bun add @anthropic-ai/[email protected]

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件