Claude Agent SDK TypeScript v0.3.332:接口破坏性变更与Hook新增
v0.3.332
推荐理由
涉及 setPermissionMode 接口的破坏性变更,await 调用不再返回 void 而是对象,持有 void 预期的代码将编译失败。请检查并适配返回值类型。
What's changed
变更内容
- Added tool_result_meta[].rewritten_by_plugin, set when a mod's session.append hook changed a tool result
- Added the PreSkillShellCommand hook event with its input and output types
- Fixed auto mode missing mid-turn user messages where feature flags aren't fetched, as on clouds or with telemetry off, from Opus 4.8 on. They count as the user's: mark other text isSynthetic: true
- Changed Query.setPermissionMode() to resolve with { mode }, the mode now in effect, or undefined; code that holds its promise as Promise<void> no longer compiles
- Updated to parity with Claude Code v2.1.332
- 新增 tool_result_meta[].rewritten_by_plugin,当 mod 的 session.append 钩子更改工具结果时设置此字段
- 新增 PreSkillShellCommand 钩子事件及其输入和输出类型
- 修复了从 Opus 4.8 开始,在未获取功能标志(如在云端或关闭遥测)的情况下,自动模式遗漏中途用户消息的问题。这些消息被视为用户发送:标记其他文本 isSynthetic: true
- 将 Query.setPermissionMode() 修改为解析返回 { mode }(当前生效的模式)或 undefined;持有其 Promise 作为 Promise<void> 的代码不再能编译通过
- 更新以与 Claude Code v2.1.332 保持同步
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]更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力