[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-cloudflare--agents":3,"tool-cloudflare--agents":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",153609,2,"2026-04-13T11:34:59",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":103,"forks":104,"last_commit_at":105,"license":106,"difficulty_score":32,"env_os":107,"env_gpu":108,"env_ram":108,"env_deps":109,"category_tags":118,"github_topics":119,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":123,"updated_at":124,"faqs":125,"releases":156},7211,"cloudflare\u002Fagents","agents","Build and deploy AI Agents on Cloudflare ","Cloudflare Agents 是一个帮助开发者在云端构建和部署 AI 智能体（AI Agents）的开源框架。它基于 Cloudflare Durable Objects 技术，为每个智能体提供独立、持久且有状态的运行环境。\n\n传统无服务器架构往往难以维持长期对话或复杂任务所需的上下文状态，而 Agents 完美解决了这一痛点。它支持智能体在闲置时自动“休眠”以零成本运行，并在需要时瞬间唤醒，非常适合按用户、会话或游戏房间大规模部署场景。无论是需要记忆历史消息的聊天机器人，还是涉及多步骤审批的工作流，都能轻松应对。\n\n该工具主要面向全栈开发者和 AI 应用构建者。其独特亮点在于极简的开发体验：通过简单的装饰器即可定义可远程调用的方法，并自动实现前后端状态的实时同步；内置对 AI 模型调用、MCP 协议、定时任务及 SQLite 数据库的原生支持。此外，它还提供了专为 React 设计的 Hooks，让前端集成如同调用本地函数般自然流畅，大幅降低了构建高可用、实时交互式 AI 应用的门槛。","# Cloudflare Agents\n\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fagents)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fagents)\n[![npm downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdw\u002Fagents)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fagents)\n\n![npm install agents](assets\u002Fnpm-install-agents.svg)\n\nAgents are persistent, stateful execution environments for agentic workloads, powered by Cloudflare [Durable Objects](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002F). Each agent has its own state, storage, and lifecycle — with built-in support for real-time communication, scheduling, AI model calls, MCP, workflows, and more.\n\nAgents hibernate when idle and wake on demand. You can run millions of them — one per user, per session, per game room — each costs nothing when inactive.\n\n```sh\nnpm create cloudflare@latest -- --template cloudflare\u002Fagents-starter\n```\n\nOr add to an existing project:\n\n```sh\nnpm install agents\n```\n\n**[Read the docs](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F)** — getting started, API reference, guides, and more.\n\n## Quick Example\n\nA counter agent with persistent state, callable methods, and real-time sync to a React frontend:\n\n```typescript\n\u002F\u002F server.ts\nimport { Agent, routeAgentRequest, callable } from \"agents\";\n\nexport type CounterState = { count: number };\n\nexport class CounterAgent extends Agent\u003CEnv, CounterState> {\n  initialState = { count: 0 };\n\n  @callable()\n  increment() {\n    this.setState({ count: this.state.count + 1 });\n    return this.state.count;\n  }\n\n  @callable()\n  decrement() {\n    this.setState({ count: this.state.count - 1 });\n    return this.state.count;\n  }\n}\n\nexport default {\n  async fetch(request: Request, env: Env, ctx: ExecutionContext) {\n    return (\n      (await routeAgentRequest(request, env)) ??\n      new Response(\"Not found\", { status: 404 })\n    );\n  }\n};\n```\n\n```tsx\n\u002F\u002F client.tsx\nimport { useAgent } from \"agents\u002Freact\";\nimport { useState } from \"react\";\nimport type { CounterAgent, CounterState } from \".\u002Fserver\";\n\nfunction Counter() {\n  const [count, setCount] = useState(0);\n\n  const agent = useAgent\u003CCounterAgent, CounterState>({\n    agent: \"CounterAgent\",\n    onStateUpdate: (state) => setCount(state.count)\n  });\n\n  return (\n    \u003Cdiv>\n      \u003Cspan>{count}\u003C\u002Fspan>\n      \u003Cbutton onClick={() => agent.stub.increment()}>+\u003C\u002Fbutton>\n      \u003Cbutton onClick={() => agent.stub.decrement()}>-\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\nState changes sync to all connected clients automatically. Call methods like they're local functions.\n\n## Features\n\n| Feature               | Description                                                            |\n| --------------------- | ---------------------------------------------------------------------- |\n| **Persistent State**  | Syncs to all connected clients, survives restarts                      |\n| **Callable Methods**  | Type-safe RPC via the `@callable()` decorator                          |\n| **Scheduling**        | One-time, recurring, and cron-based tasks                              |\n| **WebSockets**        | Real-time bidirectional communication with lifecycle hooks             |\n| **AI Chat**           | Message persistence, resumable streaming, server\u002Fclient tool execution |\n| **MCP**               | Act as MCP servers or connect as MCP clients                           |\n| **Workflows**         | Durable multi-step tasks with human-in-the-loop approval               |\n| **Email**             | Receive and respond via Cloudflare Email Routing                       |\n| **Code Mode**         | LLMs generate executable TypeScript instead of individual tool calls   |\n| **SQL**               | Direct SQLite queries via Durable Objects                              |\n| **React Hooks**       | `useAgent` and `useAgentChat` for frontend integration                 |\n| **Vanilla JS Client** | `AgentClient` for non-React environments                               |\n\n**Coming soon:** Realtime voice agents, web browsing (headless browser), sandboxed code execution, and multi-channel communication (SMS, messengers).\n\n## Packages\n\n| Package                                     | Description                                                                     |\n| ------------------------------------------- | ------------------------------------------------------------------------------- |\n| [`agents`](packages\u002Fagents)                 | Core SDK — Agent class, routing, state, scheduling, MCP, email, workflows       |\n| [`@cloudflare\u002Fai-chat`](packages\u002Fai-chat)   | Higher-level AI chat — persistent messages, resumable streaming, tool execution |\n| [`hono-agents`](packages\u002Fhono-agents)       | Hono middleware for adding agents to Hono apps                                  |\n| [`@cloudflare\u002Fcodemode`](packages\u002Fcodemode) | Experimental — LLMs write executable code to orchestrate tools                  |\n\n## Examples\n\nThe [`examples\u002F`](examples) directory has self-contained demos covering most SDK features — MCP servers\u002Fclients, workflows, email agents, webhooks, tic-tac-toe, resumable streaming, and more. The [`playground`](examples\u002Fplayground) is the kitchen-sink showcase with everything in one UI.\n\nThere are also examples using the [OpenAI Agents SDK](https:\u002F\u002Fopenai.github.io\u002Fopenai-agents-js\u002F) in [`openai-sdk\u002F`](openai-sdk).\n\nRun any example locally:\n\n```sh\ncd examples\u002Fplayground\nnpm run dev\n```\n\n## Documentation\n\n- [Full docs](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F) on developers.cloudflare.com\n- [`docs\u002F`](docs) directory in this repo (synced upstream)\n- [Anthropic Patterns guide](guides\u002Fanthropic-patterns) — sequential, routing, parallel, orchestrator, evaluator\n- [Human-in-the-Loop guide](guides\u002Fhuman-in-the-loop) — approval workflows with pause\u002Fresume\n\n## Repository Structure\n\n| Directory                                       | Description                                              |\n| ----------------------------------------------- | -------------------------------------------------------- |\n| [`packages\u002Fagents\u002F`](packages\u002Fagents)           | Core SDK                                                 |\n| [`packages\u002Fai-chat\u002F`](packages\u002Fai-chat)         | AI chat layer                                            |\n| [`packages\u002Fhono-agents\u002F`](packages\u002Fhono-agents) | Hono integration                                         |\n| [`packages\u002Fcodemode\u002F`](packages\u002Fcodemode)       | Code Mode (experimental)                                 |\n| [`examples\u002F`](examples)                         | Self-contained demo apps                                 |\n| [`openai-sdk\u002F`](openai-sdk)                     | Examples using the OpenAI Agents SDK                     |\n| [`guides\u002F`](guides)                             | In-depth pattern tutorials                               |\n| [`docs\u002F`](docs)                                 | Markdown docs synced to developers.cloudflare.com        |\n| [`site\u002F`](site)                                 | Deployed websites (agents.cloudflare.com, AI playground) |\n| [`design\u002F`](design)                             | Architecture and design decision records                 |\n| [`scripts\u002F`](scripts)                           | Repo-wide tooling                                        |\n\n## Development\n\nNode 24+ required. Uses npm workspaces.\n\n```sh\nnpm install          # install all workspaces\nnpm run build        # build all packages\nnpm run check        # full CI check (format, lint, typecheck, exports)\nCI=true npm test     # run tests (vitest + vitest-pool-workers)\n```\n\nChanges to `packages\u002F` need a changeset:\n\n```sh\nnpx changeset\n```\n\nSee [`AGENTS.md`](AGENTS.md) for deeper contributor guidance.\n\n## Contributing\n\nWe are not accepting external pull requests at this time — the SDK is evolving quickly and we want to keep the surface area manageable. That said, we'd love to hear from you:\n\n- **Bug reports & feature requests** — [open an issue](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues)\n- **Questions & ideas** — [start a discussion](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fdiscussions)\n\n## License\n\n[MIT](LICENSE)\n","# Cloudflare Agents\n\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fagents)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fagents)\n[![npm downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdw\u002Fagents)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fagents)\n\n![npm install agents](assets\u002Fnpm-install-agents.svg)\n\nAgents 是为代理型工作负载提供支持的持久化、有状态执行环境，由 Cloudflare 的 [Durable Objects](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fdurable-objects\u002F) 提供技术支持。每个 Agent 都拥有独立的状态、存储和生命周期，并内置对实时通信、任务调度、AI 模型调用、MCP、工作流等功能的支持。\n\nAgent 在空闲时会休眠，并在需要时唤醒。您可以运行数百万个 Agent——每个用户、每个会话或每个游戏房间对应一个——当它们处于非活动状态时，不会产生任何费用。\n\n```sh\nnpm create cloudflare@latest -- --template cloudflare\u002Fagents-starter\n```\n\n或者将它添加到现有项目中：\n\n```sh\nnpm install agents\n```\n\n**[阅读文档](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F)** — 包括入门指南、API 参考、教程等。\n\n## 快速示例\n\n一个带有持久化状态、可调用方法并能与 React 前端实现实时同步的计数器 Agent：\n\n```typescript\n\u002F\u002F server.ts\nimport { Agent, routeAgentRequest, callable } from \"agents\";\n\nexport type CounterState = { count: number };\n\nexport class CounterAgent extends Agent\u003CEnv, CounterState> {\n  initialState = { count: 0 };\n\n  @callable()\n  increment() {\n    this.setState({ count: this.state.count + 1 });\n    return this.state.count;\n  }\n\n  @callable()\n  decrement() {\n    this.setState({ count: this.state.count - 1 });\n    return this.state.count;\n  }\n}\n\nexport default {\n  async fetch(request: Request, env: Env, ctx: ExecutionContext) {\n    return (\n      (await routeAgentRequest(request, env)) ??\n      new Response(\"Not found\", { status: 404 })\n    );\n  }\n};\n```\n\n```tsx\n\u002F\u002F client.tsx\nimport { useAgent } from \"agents\u002Freact\";\nimport { useState } from \"react\";\nimport type { CounterAgent, CounterState } from \".\u002Fserver\";\n\nfunction Counter() {\n  const [count, setCount] = useState(0);\n\n  const agent = useAgent\u003CCounterAgent, CounterState>({\n    agent: \"CounterAgent\",\n    onStateUpdate: (state) => setCount(state.count)\n  });\n\n  return (\n    \u003Cdiv>\n      \u003Cspan>{count}\u003C\u002Fspan>\n      \u003Cbutton onClick={() => agent.stub.increment()}>+\u003C\u002Fbutton>\n      \u003Cbutton onClick={() => agent.stub.decrement()}>-\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n状态变化会自动同步到所有已连接的客户端。您可以像调用本地函数一样调用这些方法。\n\n## 功能特性\n\n| 功能               | 描述                                                            |\n| --------------------- | ---------------------------------------------------------------------- |\n| **持久化状态**  | 自动同步到所有连接的客户端，重启后仍能保留状态                      |\n| **可调用方法**  | 通过 `@callable()` 装饰器实现类型安全的 RPC                          |\n| **任务调度**        | 支持一次性、周期性和基于 Cron 的任务                              |\n| **WebSockets**        | 实时双向通信，并提供生命周期钩子             |\n| **AI 聊天**           | 消息持久化、可恢复的流式传输、服务器端\u002F客户端工具执行 |\n| **MCP**               | 可作为 MCP 服务器运行，也可作为 MCP 客户端连接                           |\n| **工作流**         | 支持人工介入审批的持久化多步骤任务                               |\n| **电子邮件**             | 通过 Cloudflare 邮件路由接收和响应邮件                       |\n| **代码模式**         | LLMs 可生成可执行的 TypeScript 代码，而非单独的工具调用   |\n| **SQL**               | 通过 Durable Objects 直接执行 SQLite 查询                              |\n| **React 钩子**       | `useAgent` 和 `useAgentChat` 用于前端集成                 |\n| **Vanilla JS 客户端** | `AgentClient` 适用于非 React 环境                               |\n\n**即将推出：** 实时语音 Agent、网页浏览（无头浏览器）、沙盒化代码执行以及多渠道通信（SMS、即时通讯应用）。\n\n## 包列表\n\n| 包                                     | 描述                                                                     |\n| ------------------------------------------- | ------------------------------------------------------------------------------- |\n| [`agents`](packages\u002Fagents)                 | 核心 SDK — Agent 类、路由、状态管理、任务调度、MCP、电子邮件、工作流       |\n| [`@cloudflare\u002Fai-chat`](packages\u002Fai-chat)   | 高级 AI 聊天功能 — 持久化消息、可恢复流式传输、工具执行                   |\n| [`hono-agents`](packages\u002Fhono-agents)       | Hono 中间件，用于将 Agents 集成到 Hono 应用程序中                                  |\n| [`@cloudflare\u002Fcodemode`](packages\u002Fcodemode) | 实验性功能 — LLMs 可编写可执行代码来编排工具                  |\n\n## 示例\n\n在 [`examples\u002F`](examples) 目录中，您会找到涵盖大多数 SDK 功能的自包含演示——包括 MCP 服务器\u002F客户端、工作流、邮件 Agent、Webhook、井字棋、可恢复流式传输等。而 [`playground`](examples\u002Fplayground) 则是一个集大成的展示，将所有功能整合在一个 UI 中。\n\n此外，在 [`openai-sdk\u002F`](openai-sdk) 目录下，还有使用 [OpenAI Agents SDK](https:\u002F\u002Fopenai.github.io\u002Fopenai-agents-js\u002F) 的示例。\n\n您可以在本地运行任意示例：\n\n```sh\ncd examples\u002Fplayground\nnpm run dev\n```\n\n## 文档\n\n- [完整文档](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fagents\u002F) 位于 developers.cloudflare.com\n- 本仓库中的 [`docs\u002F`](docs) 目录（与上游同步）\n- [Anthropic 模式指南](guides\u002Fanthropic-patterns) — 顺序执行、路由、并行处理、编排者、评估者\n- [人类介入指南](guides\u002Fhuman-in-the-loop) — 带有暂停\u002F恢复功能的审批工作流\n\n## 仓库结构\n\n| 目录                                       | 描述                                              |\n| ----------------------------------------------- | -------------------------------------------------------- |\n| [`packages\u002Fagents\u002F`](packages\u002Fagents)           | 核心 SDK                                                 |\n| [`packages\u002Fai-chat\u002F`](packages\u002Fai-chat)         | AI 聊天层                                            |\n| [`packages\u002Fhono-agents\u002F`](packages\u002Fhono-agents) | Hono 集成                                         |\n| [`packages\u002Fcodemode\u002F`](packages\u002Fcodemode)       | 代码模式（实验性）                                 |\n| [`examples\u002F`](examples)                         | 自包含的演示应用                                 |\n| [`openai-sdk\u002F`](openai-sdk)                     | 使用 OpenAI Agents SDK 的示例                     |\n| [`guides\u002F`](guides)                             | 深入的模式教程                               |\n| [`docs\u002F`](docs)                                 | 与 developers.cloudflare.com 同步的 Markdown 文档        |\n| [`site\u002F`](site)                                 | 部署的网站（agents.cloudflare.com、AI 实验室） |\n| [`design\u002F`](design)                             | 架构和设计决策记录                 |\n| [`scripts\u002F`](scripts)                           | 仓库范围内的工具链                                        |\n\n## 开发\n\n需要 Node 24+。使用 npm 工作区。\n\n```sh\nnpm install          # 安装所有工作区\nnpm run build        # 构建所有包\nnpm run check        # 全面的 CI 检查（格式化、 lint、类型检查、导出）\nCI=true npm test     # 运行测试（vitest + vitest-pool-workers）\n```\n\n对 `packages\u002F` 的更改需要创建变更集：\n\n```sh\nnpx changeset\n```\n\n更多贡献者指南，请参阅 [`AGENTS.md`](AGENTS.md)。\n\n## 贡献\n\n目前我们不接受外部 Pull Request —— SDK 正在快速演进，我们希望保持 API 表面的可控性。不过，我们非常乐意听取您的意见：\n\n- **Bug 报告与功能请求** — [提交 Issue](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues)\n- **问题与想法** — [发起讨论](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fdiscussions)\n\n## 许可证\n\n[MIT](LICENSE)","# Cloudflare Agents 快速上手指南\n\nCloudflare Agents 是基于 Durable Objects 构建的有状态、持久化执行环境，专为 AI 智能体（Agentic）工作负载设计。支持实时通信、定时任务、AI 模型调用及工作流编排，闲置时自动休眠以节省成本。\n\n## 环境准备\n\n- **Node.js**: 版本 24 或更高 (`Node 24+`)\n- **包管理器**: 推荐使用 `npm` (项目使用 npm workspaces)\n- **Cloudflare 账号**: 需拥有 Cloudflare 账号以便部署和使用 Durable Objects\n\n## 安装步骤\n\n你可以选择创建一个全新的项目，或将 Agents 集成到现有项目中。\n\n### 方案一：创建新项目（推荐）\n使用官方模板快速初始化一个包含完整配置的项目：\n\n```sh\nnpm create cloudflare@latest -- --template cloudflare\u002Fagents-starter\n```\n\n### 方案二：集成到现有项目\n在现有的 Cloudflare Workers 项目中安装核心 SDK：\n\n```sh\nnpm install agents\n```\n\n> **提示**：国内开发者若遇到 npm 下载缓慢，可临时切换至淘宝镜像源：\n> ```sh\n> npm config set registry https:\u002F\u002Fregistry.npmmirror.com\n> ```\n\n## 基本使用\n\n以下示例展示如何创建一个具有持久化状态的计数器 Agent，并通过 React 前端进行实时同步和调用。\n\n### 1. 服务端代码 (`server.ts`)\n定义 Agent 类，使用 `@callable()` 装饰器暴露可调用的方法，并管理内部状态。\n\n```typescript\n\u002F\u002F server.ts\nimport { Agent, routeAgentRequest, callable } from \"agents\";\n\nexport type CounterState = { count: number };\n\nexport class CounterAgent extends Agent\u003CEnv, CounterState> {\n  initialState = { count: 0 };\n\n  @callable()\n  increment() {\n    this.setState({ count: this.state.count + 1 });\n    return this.state.count;\n  }\n\n  @callable()\n  decrement() {\n    this.setState({ count: this.state.count - 1 });\n    return this.state.count;\n  }\n}\n\nexport default {\n  async fetch(request: Request, env: Env, ctx: ExecutionContext) {\n    return (\n      (await routeAgentRequest(request, env)) ??\n      new Response(\"Not found\", { status: 404 })\n    );\n  }\n};\n```\n\n### 2. 客户端代码 (`client.tsx`)\n在 React 组件中使用 `useAgent` Hook 连接 Agent。状态变更会自动同步到所有连接的客户端，方法调用如同本地函数一样简单。\n\n```tsx\n\u002F\u002F client.tsx\nimport { useAgent } from \"agents\u002Freact\";\nimport { useState } from \"react\";\nimport type { CounterAgent, CounterState } from \".\u002Fserver\";\n\nfunction Counter() {\n  const [count, setCount] = useState(0);\n\n  const agent = useAgent\u003CCounterAgent, CounterState>({\n    agent: \"CounterAgent\",\n    onStateUpdate: (state) => setCount(state.count)\n  });\n\n  return (\n    \u003Cdiv>\n      \u003Cspan>{count}\u003C\u002Fspan>\n      \u003Cbutton onClick={() => agent.stub.increment()}>+\u003C\u002Fbutton>\n      \u003Cbutton onClick={() => agent.stub.decrement()}>-\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n### 3. 运行与测试\n启动开发服务器即可体验实时状态同步：\n\n```sh\nnpm run dev\n```\n\n此时，多个客户端连接同一 Agent 实例时，任意一方的计数操作都会实时反映在其他所有客户端上。","某在线教育平台需要为成千上万名学生提供实时的 AI 口语陪练服务，要求每个会话都能记住上下文、支持断线重连并低成本运行。\n\n### 没有 agents 时\n- **状态管理复杂**：开发者需自行搭建 Redis 或数据库来存储每个学生的对话历史，代码耦合度高且容易出错。\n- **实时同步困难**：实现多端（手机、网页）消息即时同步需要手动维护 WebSocket 连接和复杂的广播逻辑。\n- **资源成本高昂**：为保持会话活跃，服务器必须常驻运行，即使学生暂停练习也在消耗算力和费用。\n- **断点续聊体验差**：一旦网络波动导致连接中断，重新连接后往往丢失上下文，无法恢复之前的教学进度。\n\n### 使用 agents 后\n- **原生持久状态**：agents 利用 Durable Objects 自动为每个学生维护独立的对话状态，无需额外编写存储逻辑，重启也不丢数据。\n- **自动实时同步**：内置的 WebSocket 支持让前后端状态自动同步，学生在手机端说的话，网页端立刻可见，开发仅需调用 `useAgent` 钩子。\n- **按需唤醒省钱**：当学生停止练习时，agents 自动进入休眠状态不产生费用；只有再次发起对话时才瞬间唤醒，大幅降低运营成本。\n- **无缝恢复会话**：得益于持久化生命周期，无论网络如何波动，学生重新连接后都能立即接续上一句对话，体验流畅自然。\n\nagents 通过“按需用量、状态自带”的架构，让构建百万级并发、低成本的实时 AI 应用变得像编写本地函数一样简单。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcloudflare_agents_01179fd2.png","cloudflare","Cloudflare","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fcloudflare_e3c846c2.jpg","",null,"https:\u002F\u002Fwww.cloudflare.com","https:\u002F\u002Fgithub.com\u002Fcloudflare",[80,84,88,92,95,99],{"name":81,"color":82,"percentage":83},"TypeScript","#3178c6",98.9,{"name":85,"color":86,"percentage":87},"CSS","#663399",0.7,{"name":89,"color":90,"percentage":91},"Astro","#ff5a03",0.2,{"name":93,"color":94,"percentage":91},"HTML","#e34c26",{"name":96,"color":97,"percentage":98},"Shell","#89e051",0.1,{"name":100,"color":101,"percentage":102},"JavaScript","#f1e05a",0,4740,493,"2026-04-13T14:05:14","MIT","Linux, macOS, Windows","未说明",{"notes":110,"python":111,"dependencies":112},"该工具是基于 Cloudflare Durable Objects 的 Node.js 运行时环境，非 Python AI 模型。开发环境强制要求 Node.js 24 或更高版本。它运行在 Cloudflare 边缘网络上，本地开发需使用 npm workspaces 管理。不支持外部 Pull Request，但欢迎提交 Issue 和讨论。","不适用 (基于 Node.js)",[113,114,64,115,116,117],"node>=24","npm","@cloudflare\u002Fai-chat","hono-agents","@cloudflare\u002Fcodemode",[14,13,15],[64,120,72,121,122],"ai","durable-objects","workflows","2026-03-27T02:49:30.150509","2026-04-14T03:08:19.443231",[126,131,136,141,146,151],{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},32377,"如何在 useAgentChat 中支持客户端动态定义的工具（client-defined tools）？","目前 useAgentChat 内部创建传输层且不直接暴露发送额外数据（如工具定义）的方法。虽然 Vercel AI SDK 的 useChat 通过 transport 上的 prepareSendMessagesRequest 支持此功能，但 useAgentChat 尚未完全开放此选项。变通方案包括：1. 尝试在 UseAgentChatOptions 中配置自定义 transport 以附加工具定义；2. 通过 agent.send() 在连接时注册工具，由服务端的 onMessage 处理。官方正在考虑在未来版本中暴露 prepareSendMessagesRequest 或添加 clientTools 选项来实现原生支持。","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues\u002F727",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},32378,"刷新页面后聊天状态未更新为\"streaming\"且无法恢复流，如何解决？","这通常是因为手动设置了 getInitialMessages: null 导致绕过了 SDK 基于 Suspense 的消息加载机制，而该机制是流恢复（stream resumption）所必需的。解决方法是移除 getInitialMessages: null 配置，让 SDK 使用默认的 getInitialMessages 行为。此外，确保使用的是包含修复后的单例传输层（singleton transport fix）的最新版本 SDK，以避免 WebSocket 未打开时就发送恢复请求的竞争条件。","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues\u002F1000",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},32379,"如何处理 onMessage() 在 onConnect() 之前被调用的竞争条件问题？","这是一个已知的竞争条件问题，可能导致在获取连接上下文（如会话或身份信息）之前就收到消息。目前的官方修复方案已在 PR 中合并，移除了导致该问题的 setTimeout() 逻辑并增加了测试验证。在旧版本中，开发者需要在 Agent 基类或自己的实现中手动队列化消息，直到 onConnect() 执行完毕后再处理队列中的消息。建议升级到包含此修复的最新版本以彻底解决该问题。","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues\u002F321",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},32380,"在 useAgent 中使用 query 字段传递 JWT 时遇到\"TypeError: agent._url.replace is not a function\"错误怎么办？","该错误通常发生在本地开发或跨域认证场景中。官方文档仓库的 docs 文件夹中提供了关于跨域认证（cross domain auth）的详细指南。请参照该指南正确配置认证流程，而不是直接在 query 字段中异步返回 token，或者确保传递给 hook 的参数格式符合最新 SDK 的要求。检查是否使用了正确的 host 和 agent 配置组合。","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues\u002F150",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},32381,"如何禁用 WebSocket 连接中的代理协议消息（如 CF_AGENT_IDENTITY 等文本帧）以兼容二进制客户端？","默认情况下，Agents SDK 会发送如 CF_AGENT_IDENTITY、CF_AGENT_STATE 等文本帧，这可能不兼容仅支持二进制的客户端（如某些硬件设备）。官方已发布更新支持通过请求头（header）或查询字符串（query string）为特定标记的连接选择退出这些文本帧。请升级到最新版本（例如通过 `npm i https:\u002F\u002Fpkg.pr.new\u002Fcloudflare\u002Fagents@920` 测试或等待正式发行），并在建立连接时添加相应的配置选项来禁用这些协议消息。","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues\u002F881",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},32382,"MCP Agent 的 Durable Object 在空闲时为何没有进入休眠（hibernation）状态导致持续计费？","正常情况下，MCP 运行的 Durable Object (DO) 应在空闲时进入休眠以停止计费。如果连接到 \u002Fmcp\u002Fsse 端点后 DO 持续产生账单时长，可能是因为长轮询或 SSE 连接保持活跃阻止了休眠。请检查是否遵循了官方的 bearer-auth 演示代码模式，确保在没有实际函数调用时连接能正确释放或超时。如果问题依旧，可能是 SDK 版本问题或特定的连接保持策略导致，建议检查最新的 MCP 服务器配置示例和休眠相关文档。","https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fissues\u002F193",[157,162,167,172,177,182,187,192,197,202,207,212,217,222,227,232,237,242,247,252],{"id":158,"version":159,"summary_zh":160,"released_at":161},247169,"@cloudflare\u002Fvoice@0.1.0","### 小幅改动\n\n-   [#1293](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1293) [`16769b0`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F16769b0bbf92ee6dab0293957b2a9b7d340e567a) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 切换为按通话持续的连续 STT 会话。这是破坏性 API 变更。\n\n    转录器会话现在在 `start_call` 时创建，并在整个通话期间保持运行。模型负责检测发言轮次——无需客户端侧的 `start_of_speech`\u002F`end_of_speech` 来触发 STT。语音代理使用 `keepAlive` 来防止通话过程中被 DO 驱逐。\n\n    新增 API：\n\n    -   `transcriber` 属性取代了 `stt`、`streamingStt` 和 `vad`\n    -   `createTranscriber(connection)` 钩子，用于运行时切换模型\n    -   `WorkersAIFluxSTT` — 按通话的 Flux 会话（推荐用于 `withVoice`）\n    -   `WorkersAINova3STT` — 按通话的 Nova 3 流式会话（推荐用于 `withVoiceInput`）\n    -   `VoiceClientOptions` 中的 `query` 选项——可将查询参数传递到 WebSocket URL（例如用于选择模型）\n    -   如果未配置转录器，则在 `start_call` 时抛出异常\n    -   当已处于通话中时，重复调用 `start_call` 会被静默忽略\n\n    移除的内容：\n\n    -   `stt`（批量 STT）、`streamingStt`（每句话流式处理）、`vad`（服务器端 VAD）\n    -   `WorkersAISTT`、`WorkersAIVAD`、`pcmToWav`\n    -   `prerollMs`、`vadThreshold`、`vadPushbackSeconds`、`vadRetryMs`、`minAudioBytes` 等选项\n    -   `VoiceInputAgentOptions` 类型\n    -   `beforeTranscribe` 钩子（音频以连续流的方式输入，而非分批处理）\n    -   管道指标中的 `vad_ms` 和 `stt_ms`\n    -   冬眠支持（`withVoice` 和 `withVoiceInput` 现在需要 `Agent`，而非 partyserver `Server`）","2026-04-12T08:25:14",{"id":163,"version":164,"summary_zh":165,"released_at":166},247170,"@cloudflare\u002Fai-chat@0.4.2","### 补丁变更\n\n-   [#1290](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1290) [`6429189`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F6429189ca284d4d00b71d493387c757257ea6778) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 移除误报的“在接收到取消信号时流仍处于活动状态”警告。该警告会在每次取消操作时触发，即使用户已正确将 `abortSignal` 传递给 `streamText()`。","2026-04-11T16:31:37",{"id":168,"version":169,"summary_zh":170,"released_at":171},247171,"@cloudflare\u002Fthink@0.2.1","### 补丁变更\n\n-   [#1275](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1275) [`37b2ce3`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F37b2ce37913566ce81d30377d5cb5b224765a3f3) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 为 Think 添加内置工作区。每个 Think 实例现在都拥有由 DO 的 SQLite 存储支持的 `this.workspace`，并且工作区工具（读取、写入、编辑、列出、查找、grep、删除）会自动合并到每次对话轮次中。可通过重写 `workspace` 来为大文件添加 R2 备用存储。`@cloudflare\u002Fshell` 现已成为必需的对等依赖项。\n\n-   [#1278](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1278) [`8c7caab`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F8c7caabb68361c8ce71b10e292d6dd33a9cc72dd) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Think 现在掌控推理循环，并在每个阶段提供生命周期钩子。\n\n    **破坏性变更：** `onChatMessage()`、`assembleContext()` 和 `getMaxSteps()` 已被移除。请改用生命周期钩子和 `maxSteps` 属性。若需完全自定义的推理逻辑，请直接扩展 `Agent` 类。\n\n    **新增生命周期钩子：** `beforeTurn`、`beforeToolCall`、`afterToolCall`、`onStepFinish`、`onChunk` — 这些钩子会在所有入口路径（WebSocket、`chat()`、`saveMessages`、自动续接）的每一轮对话中触发。\n\n    **`beforeTurn(ctx)`** 接收组装好的系统提示、消息、工具和模型。返回一个 `TurnConfig` 对象以覆盖任意部分——模型、系统提示、消息、工具、激活工具、工具选择、最大步数、提供商选项。\n\n    **`maxSteps`** 现在是一个属性（默认值为 10），而非方法。可通过 `TurnConfig.maxSteps` 在每轮对话中进行覆盖。\n\n    **MCP 工具自动合并** — 无需再手动在 `getTools()` 中合并 `this.mcp.getAITools()`。\n\n    **动态上下文块：** `Session.addContext()` 和 `Session.removeContext()` 允许在会话初始化后添加或移除上下文块（例如来自扩展程序）。\n\n    **扩展清单已扩展**，新增了 `context`（命名空间化的上下文块声明）和 `hooks` 字段。\n","2026-04-11T06:11:27",{"id":173,"version":174,"summary_zh":175,"released_at":176},247172,"@cloudflare\u002Fai-chat@0.4.1","### 补丁变更\n\n-   [#1277](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1277) [`0cd0487`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F0cd0487ca6b6bd684c72d59a8349994fe82750a1) 感谢 [@zebp](https:\u002F\u002Fgithub.com\u002Fzebp)! - 修复了 `messageConcurrency` 中的竞态条件：快速重叠提交可能会绕过 `latest`\u002F`merge`\u002F`debounce` 策略。此前，并发决策会在任务入队前检查 `queuedCount()`，但中间插入的 `await persistMessages()` 会导致第二个消息处理器看到过时的零计数，从而跳过覆盖检查。现在引入了一个待入队计数器来填补这一空白，确保始终能检测到重叠提交。\n\n-   [#1272](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1272) [`22da9b1`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F22da9b19743ad643d6dbd0ca61b1ff9064fbbd76) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 扩大了 `useAgentChat` 的 agent prop 类型，使其既能接受类型化的 `useAgent` 连接，也能接受非类型化的连接。此前，`useAgent\u003CMyAgent>()` 的结果由于 `call` 类型不兼容，无法传递给 `useAgentChat`。现在，agent prop 使用一种结构化类型，仅匹配 `useAgentChat` 实际使用的字段。\n","2026-04-11T06:11:24",{"id":178,"version":179,"summary_zh":180,"released_at":181},247173,"@cloudflare\u002Fworker-bundler@0.1.0","### 小幅改动\n\n-   [#1277](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1277) [`0cd0487`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F0cd0487ca6b6bd684c72d59a8349994fe82750a1) 感谢 [@zebp](https:\u002F\u002Fgithub.com\u002Fzebp)! - 引入用于所有打包器 API 的 `FileSystem` 抽象层。\n\n    现在，`createWorker` 和 `createApp` 上的 `files` 选项除了接受普通的 `Record\u003Cstring, string>` 外，还可以接受任何 `FileSystem` 实现。这使得调用者能够使用持久化或自定义存储来支持虚拟文件系统——例如，一个 `DurableObjectKVFileSystem`，它会在内存中缓冲写入操作，并在需要时将数据刷新到 Durable Object KV 中，从而避免每次文件操作都进行一次 KV 写入。\n\n    该包导出了三种具体的实现：\n\n    -   `InMemoryFileSystem` — 基于 `Map` 的文件系统，适用于测试和进程内流水线。可以接受一个可选的初始文件种子对象或 `Map`。\n    -   `DurableObjectKVFileSystem` — 基于 Durable Object KV 的文件系统，带有写入覆盖层。写入操作会先在内存中累积，直到调用 `flush()` 时才一次性批量写入 KV。读取操作会优先从覆盖层中获取数据，因此调用者总是能立即看到自己所做的写入。\n    -   `DurableObjectRawFileSystem` — 一种轻量级的、基于 Durable Object KV 的文件系统，不进行任何缓冲。每次写入都会同步提交到 KV。当需要每笔写入都具备持久性，而不是以批处理方式写入时，可以使用此实现。\n\n    `createFileSystemSnapshot` 可以从任何同步或异步可迭代的 `[path, content]` 对中创建一个 `InMemoryFileSystem`，从而将异步存储后端（例如来自 `@cloudflare\u002Fshell` 的 `Workspace`）桥接到同步的 `FileSystem` 接口。\n\n    `FileSystem.read()` 方法现在返回 `string | null`（`null` 表示文件不存在），而不是空字符串，从而消除了对单独 `exists()` 检查的需求。\n\n    普通的 `Record\u003Cstring, string>` 对象仍然可以正常使用——它们会被自动包装成 `InMemoryFileSystem`。\n\n-   [#1277](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1277) [`0cd0487`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F0cd0487ca6b6bd684c72d59a8349994fe82750a1) 感谢 [@zebp](https:\u002F\u002Fgith","2026-04-11T06:11:21",{"id":183,"version":184,"summary_zh":185,"released_at":186},247174,"agents@0.10.1","### 补丁变更\n\n-   [#1286](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1286) [`d76f8b9`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fd76f8b9608cbf4b4bbeb5f92077057ff20dbeae9) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 修复了 `McpAgent.handleMcpMessage` 在持久对象通过原生 DO RPC 唤醒时，因尝试在 `.name` 被设置前读取它而导致的崩溃问题。该方法现在会调用 `__unsafe_ensureInitialized()`，从存储中加载 `this.name` 并执行 `onStart()`，然后再处理消息，从而与 `_workflow_*` RPC 方法和 `alarm()` 所采用的模式保持一致。\n\n-   [#1278](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1278) [`8c7caab`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F8c7caabb68361c8ce71b10e292d6dd33a9cc72dd) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Think 现在通过各阶段的生命周期钩子掌控推理循环。\n\n    **破坏性变更：** `onChatMessage()`、`assembleContext()` 和 `getMaxSteps()` 已被移除。请改用生命周期钩子和 `maxSteps` 属性。若需完全自定义的推理逻辑，请直接扩展 `Agent` 类。\n\n    **新增生命周期钩子：** `beforeTurn`、`beforeToolCall`、`afterToolCall`、`onStepFinish`、`onChunk` — 这些钩子将在每次对话回合中从所有入口路径（WebSocket、`chat()`、`saveMessages`、自动续写）触发。\n\n    **`beforeTurn(ctx)`** 接收组装好的系统提示、消息、工具和模型。返回一个 `TurnConfig` 对象，以覆盖其中任意部分——模型、系统提示、消息、工具、启用的工具、工具选择策略、最大步数、提供商选项等。\n\n    **`maxSteps`** 现在是一个属性（默认值为 10），而非方法。可通过 `TurnConfig.maxSteps` 在每一轮中进行覆盖。\n\n    **MCP 工具自动合并** — 无需再手动在 `getTools()` 中合并 `this.mcp.getAITools()`。\n\n    **动态上下文块：** `Session.addContext()` 和 `Session.removeContext()` 允许在会话初始化后添加或移除上下文块（例如来自扩展程序）。\n\n    **扩展清单已扩展**，增加了 `context`（命名空间化的上下文块声明）和 `hooks` 字段。\n","2026-04-11T06:11:18",{"id":188,"version":189,"summary_zh":190,"released_at":191},247175,"@cloudflare\u002Fai-chat@0.4.0","### 小幅改动\n\n-   [#1264](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1264) [`95b4d6a`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F95b4d6a5430744cf4022aa3c4d4dfcb211607b3b) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 将 `durableStreaming` 重命名为 `unstable_chatRecovery`。修复当 `onChatMessage` 抛出异常时的 AbortController 泄漏问题。在启用时，将所有四种聊天回合路径（WS、自动续接、程序化、继续上一轮）包裹在 `runFiber` 中。通过调度负载中的 `targetAssistantId` 来防止 `_chatRecoveryContinue` 使用过时的续接。\n\n-   [#1256](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1256) [`dfab937`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fdfab937c81b358415e66bda3f8abe76b85d12c11) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 在 Agent 基类中添加持久化纤维执行功能。\n\n    `runFiber(name, fn)` 会在 SQLite 中注册任务，持有 `keepAlive` 引用，并在 DO 被驱逐后通过 `onFiberRecovered` 实现恢复。`ctx.stash()` 和 `this.stash()` 会检查点进度，使其在被驱逐后仍能保留。\n\n    `AIChatAgent` 新增了 `unstable_chatRecovery` — 启用后，每一轮聊天都会被包裹在一个纤维中。`onChatRecovery` 提供特定于提供商的恢复机制（Workers AI 续接、OpenAI 响应获取、Anthropic 合成消息）。`continueLastTurn()` 可以无缝地追加到中断的助手消息中。\n\n    `Think` 现在直接继承 `Agent`（不再使用混入）。纤维支持从基类继承。\n\n    **破坏性变更（仅限实验性 API）：**\n\n    -   移除了 `withFibers` 混入（`agents\u002Fexperimental\u002Fforever`）\n    -   移除了 `withDurableChat` 混入（`@cloudflare\u002Fai-chat\u002Fexperimental\u002Fforever`）\n    -   从这两个包中移除了 `.\u002Fexperimental\u002Fforever` 导出\n    -   Think 不再有 `fibers` 标志——恢复将通过闹钟维护自动进行\n\n### 补丁更改\n\n-   [#1270](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1270) [`87b4512`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F87b4512985e47de659bf970a65a6d1951f5855fe) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 将 Session 作为存储层接入 Think，从而实现与 AIChatAgent 完全一致的功能，并具备基于 Session 的优势。\n\n    **Think (`@cloudflare\u002Fthink`)：**\n\n    -   Session 集成：`this.messages` 由 `session.getHistory()` 支持，采用树状消息结构、上下文块、压缩和 FTS5 搜索\n    -   `configureSession()` 覆盖用于配置上下文块、压缩、搜索和技能（同步或异步）\n    -   `assembleContext()` 返回包含上下文块组合的 `{ system, messages }`\n    -   `onChatResponse()` 生命周期钩子会在所有回合路径中触发\n    -   通过 `trigger: \"regenerate-message\"` 结合 Session 分支实现非破坏性再生\n    -   `saveMessages()` 用于程序化进入回合（计划响应、Webhook、主动型代理）\n    -   `continueLastTurn()` 用于扩展上一轮助手的回复\n    -   自定义主体可在休眠期间持久化\n    -   `sanitizeMessageForPersistence()` 钩子","2026-04-07T12:36:55",{"id":193,"version":194,"summary_zh":195,"released_at":196},247176,"@cloudflare\u002Fvoice@0.0.5","### 补丁变更\n\n-   [`c5ca556`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc5ca55618bd79042f566e55d1ebbe0636f91e75a) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 将通配符 `*` 依赖项替换为实际版本范围：`agents` 替换为 `>=0.9.0 \u003C1.0.0`，`partysocket` 替换为 `^1.0.0`。\n","2026-04-07T12:36:52",{"id":198,"version":199,"summary_zh":200,"released_at":201},247177,"@cloudflare\u002Fthink@0.2.0","### 小幅改动\n\n-   [#1270](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1270) [`87b4512`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F87b4512985e47de659bf970a65a6d1951f5855fe) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 将 Wire Session 集成到 Think 中作为存储层，从而实现与 AIChatAgent 完全一致的功能，并具备基于 Session 的额外优势。\n\n    **Think (`@cloudflare\u002Fthink`):**\n\n    -   Session 集成：`this.messages` 由 `session.getHistory()` 提供支持，支持树状消息结构、上下文块、消息压缩以及 FTS5 搜索功能。\n    -   可通过 `configureSession()` 方法覆盖上下文块、消息压缩、搜索和技能配置（同步或异步）。\n    -   `assembleContext()` 返回包含上下文块组合的 `{ system, messages }` 对象。\n    -   `onChatResponse()` 生命周期钩子会在所有对话回合路径中触发。\n    -   支持非破坏性再生，通过 `trigger: \"regenerate-message\"` 结合 Session 分支实现。\n    -   提供 `saveMessages()` 方法，用于以编程方式记录对话回合（如定时回复、Webhook 和主动型代理）。\n    -   支持 `continueLastTurn()`，可无缝延续上一轮助手回复。\n    -   允许自定义数据在休眠状态下持久化。\n    -   提供 `sanitizeMessageForPersistence()` 钩子，用于脱敏个人敏感信息。\n    -   支持多种消息并发策略（队列、最新、合并、丢弃、防抖）。\n    -   将 `resetTurnState()` 抽取为受保护的方法。\n    -   引入 `unstable_chatRecovery` 功能，在所有四条对话路径上使用 `runFiber` 进行封装。\n    -   添加 `onChatRecovery()` 钩子，并传入 `ChatRecoveryContext` 上下文对象。\n    -   提供 `hasPendingInteraction()` 和 `waitUntilStable()` 方法，用于检测系统是否已进入静默状态。\n    -   从 `@cloudflare\u002Fthink` 中重新导出 `Session`。\n    -   构造函数会自动包裹 `onStart` 方法——子类无需再调用 `super.onStart()`。\n\n    **agents (`agents\u002Fchat`):**\n\n    -   将 `AbortRegistry`、`applyToolUpdate` 及其构建器、`parseProtocolMessage` 等功能提取至共享的 `agents\u002Fchat` 层。\n    -   新增 `applyChunkToParts` 导出，用于纤维恢复。\n\n    **AIChatAgent (`@cloudflare\u002Fai-chat`):**\n\n    -   重构代码，改用 `agents\u002Fchat` 中的共享 `AbortRegistry`。\n    -   在 `OnChatMessageOptions` 中新增 `continuation` 标志。\n    -   导出 `getAgentMessages()` 方法及工具部件相关辅助函数。\n    -   在 `useAgent` 返回值中新增 `getHttpUrl()` 方法。\n\n-   [#1256](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1256) [`dfab937`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fdfab937c81b358415e66bda3f8abe76b85d12c11) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 在 Agent 基类中添加持久化的纤维执行功能。\n\n    `runFiber(name, fn)` 会将任务注册到 SQLite 数据库中，并维持一个 `keepAlive` 引用，以便在 DO 被驱逐后通过 `onFiberRecovered` 进行恢复。`ctx.stash()` 和 `this.stash()` 可以保存进度，确保即使被驱逐也能恢复。\n\n    `AIChatAgent` 现已具备 `unstable_chatRecovery` 功能——启用后，每一轮对话都会被包裹在一个纤维中。`onChatRecovery` 提供特定于提供商的恢复机制（Workers AI 继续执行、OpenAI 响应检索、Anthropic 合成消息）。`continueLastTurn()` 可以无缝地追加到中断的助手消息中。\n\n    `Think` 现在扩展了 `Ag","2026-04-07T12:36:49",{"id":203,"version":204,"summary_zh":205,"released_at":206},247178,"agents@0.10.0","### 微小变更\n\n-   [#1256](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1256) [`dfab937`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fdfab937c81b358415e66bda3f8abe76b85d12c11) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 在 Agent 基类中添加持久化 Fiber 执行功能。\n\n    `runFiber(name, fn)` 会将任务注册到 SQLite 中，维持一个 `keepAlive` 引用，并在 DO 被驱逐后通过 `onFiberRecovered` 实现恢复。`ctx.stash()` 和 `this.stash()` 可以保存检查点信息，确保即使被驱逐也能恢复进度。\n\n    `AIChatAgent` 新增了 `unstable_chatRecovery` — 启用后，每一轮对话都会被包裹在一个 Fiber 中。`onChatRecovery` 提供特定于提供商的恢复逻辑（Workers AI 继续状态、OpenAI 响应获取、Anthropic 合成消息）。`continueLastTurn()` 可以无缝地将内容追加到被中断的助手消息中。\n\n    `Think` 现在直接继承自 `Agent`（不再使用混入）。Fiber 支持由基类继承。\n\n    **破坏性变更（仅限实验性 API）：**\n\n    -   移除了 `withFibers` 混入（`agents\u002Fexperimental\u002Fforever`）\n    -   移除了 `withDurableChat` 混入（`@cloudflare\u002Fai-chat\u002Fexperimental\u002Fforever`）\n    -   从这两个包中移除了 `.\u002Fexperimental\u002Fforever` 导出\n    -   Think 不再有 `fibers` 标志位——恢复现在通过闹钟维护自动进行\n\n### 补丁变更\n\n-   [#1259](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1259) [`1933eb4`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F1933eb44c48bcb2abf92ef6510359baba138fdca) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 将 Fiber 恢复逻辑从延迟到下一次闹钟触发改为在 `onStart()` 中立即执行。中断的 Fiber 现在会在 DO 唤醒后的首次请求时立即被检测到，若未能检测则回退到闹钟路径。同时引入重入保护机制以防止重复恢复。\n\n-   [#1263](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1263) [`e3ceb82`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fe3ceb82235f2fb8559031448b4d68db22a2305f5) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 修复了 `routeAgentEmail()` 在 `onEmail()` 返回后，仍会使目标 DO 保持非休眠状态约 100–120 秒的问题。将原本直接使用闭包作为 RPC 目标的实现替换为单一的 `RpcTarget` 桥接对象 (`EmailBridge`)，该对象具有显式的 `Symbol.dispose` 生命周期方法，从而使运行时能够及时关闭双向 RPC 会话，而不必将其与调用方的执行上下文生命周期绑定。\n\n-   [`c5ca556`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc5ca55618bd79042f566e55d1ebbe0636f91e75a) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 将 `vite` 的 peer dependency 限制在 `>=6.0.0 \u003C9.0.0` 范围内，以避免静默接受未经测试的未来大版本。\n\n-   [#1271](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1271) [`0cc2dae`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F0cc2daee3fde434442d3ecce4fd21dd26f3d45e9) 感谢 [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - 为 `getAITools()`、`listTools()`、`listPrompts()`、`listResources()` 和 `listResourceTemplates()` 添加了可选的 `MCPServerFilter` 参数，用于范围指定。","2026-04-07T12:36:46",{"id":208,"version":209,"summary_zh":210,"released_at":211},247179,"hono-agents@3.0.8","### Patch Changes\n\n-   [`c5ca556`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc5ca55618bd79042f566e55d1ebbe0636f91e75a) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Bump `agents` peer dependency lower bound from `>=0.3.10` to `>=0.9.0` to reflect actual compatibility.\n","2026-04-07T12:36:43",{"id":213,"version":214,"summary_zh":215,"released_at":216},247180,"@cloudflare\u002Fshell@0.3.2","### Patch Changes\n\n-   [#1249](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1249) [`bfbed21`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fbfbed218774e3c1c1931e03484141308ac23e236) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Fix `git.clone()` without `depth` failing with `ENOENT: .git\u002Fshallow`. The git fs adapter's `unlink` now wraps errors with `.code` so isomorphic-git can handle missing files gracefully.\n\n-   Updated dependencies \\[[`d5dbf45`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fd5dbf45e3dfb2d93ca1ece43d2e84cea2cb28d37), [`c5ca556`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc5ca55618bd79042f566e55d1ebbe0636f91e75a)]:\n    -   @cloudflare\u002Fcodemode@0.3.4\n","2026-04-07T12:36:40",{"id":218,"version":219,"summary_zh":220,"released_at":221},247181,"@cloudflare\u002Fcodemode@0.3.4","### Patch Changes\n\n-   [#1266](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1266) [`d5dbf45`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fd5dbf45e3dfb2d93ca1ece43d2e84cea2cb28d37) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Add optional `description` to `codeMcpServer`, matching the existing option on `createCodeTool`. Supports `{{types}}` and `{{example}}` placeholders; falls back to the built-in default when omitted.\n\n-   [`c5ca556`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc5ca55618bd79042f566e55d1ebbe0636f91e75a) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Fix `@tanstack\u002Fai` peer dependency range from `^0.8.0` to `>=0.8.0 \u003C1.0.0`. The caret range for pre-1.0 packages only allows `>=0.8.0 \u003C0.9.0`, which excluded the current 0.10.0 release.\n","2026-04-07T12:36:37",{"id":223,"version":224,"summary_zh":225,"released_at":226},247182,"agents@0.9.0","### Minor Changes\n\n-   [#1237](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1237) [`f3d5557`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Ff3d555797934c6bd15cf5af2678f5e20aa74713a) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Add `broadcastTransition` to `agents\u002Fchat` — a pure state machine for\n    managing StreamAccumulator lifecycle during broadcast\u002Fresume streams.\n    Replaces scattered ref management in useAgentChat with explicit state\n    transitions.\n\n-   [#1237](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1237) [`f3d5557`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Ff3d555797934c6bd15cf5af2678f5e20aa74713a) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Add `TurnQueue` to `agents\u002Fchat` — a shared serial async queue with\n    generation-based invalidation for chat turn scheduling. AIChatAgent and\n    Think now both use `TurnQueue` internally, unifying turn serialization\n    and the epoch\u002Fclear-generation concept. Think gains proper turn\n    serialization (previously concurrent chat turns could interleave).\n\n### Patch Changes\n\n-   [#1248](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1248) [`c74b615`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc74b6158060f49faf0c73f6c84f33b6db92c9ad0) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Update dependencies\n\n-   [#1247](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1247) [`31c6279`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F31c6279575c876cc5a7e69a4130e13a0c1afc630) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Add `ContinuationState` to `agents\u002Fchat` — shared state container for auto-continuation lifecycle. AIChatAgent's 15 internal auto-continuation fields consolidated into one `ContinuationState` instance (no public API change). Think gains deferred continuations, resume coordination for pending continuations, `onClose` cleanup, and hibernation persistence for client tools via `think_request_context` table.\n","2026-04-01T12:09:40",{"id":228,"version":229,"summary_zh":230,"released_at":231},247183,"@cloudflare\u002Fthink@0.1.2","### Patch Changes\n\n-   [#1248](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1248) [`c74b615`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc74b6158060f49faf0c73f6c84f33b6db92c9ad0) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Update dependencies\n\n-   [#1247](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1247) [`31c6279`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F31c6279575c876cc5a7e69a4130e13a0c1afc630) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Add `ContinuationState` to `agents\u002Fchat` — shared state container for auto-continuation lifecycle. AIChatAgent's 15 internal auto-continuation fields consolidated into one `ContinuationState` instance (no public API change). Think gains deferred continuations, resume coordination for pending continuations, `onClose` cleanup, and hibernation persistence for client tools via `think_request_context` table.\n\n-   [#1237](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1237) [`f3d5557`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Ff3d555797934c6bd15cf5af2678f5e20aa74713a) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Add `TurnQueue` to `agents\u002Fchat` — a shared serial async queue with\n    generation-based invalidation for chat turn scheduling. AIChatAgent and\n    Think now both use `TurnQueue` internally, unifying turn serialization\n    and the epoch\u002Fclear-generation concept. Think gains proper turn\n    serialization (previously concurrent chat turns could interleave).\n","2026-04-01T12:09:37",{"id":233,"version":234,"summary_zh":235,"released_at":236},247184,"@cloudflare\u002Fcodemode@0.3.3","### Patch Changes\n\n-   [#1248](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1248) [`c74b615`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc74b6158060f49faf0c73f6c84f33b6db92c9ad0) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Update dependencies\n","2026-04-01T12:09:34",{"id":238,"version":239,"summary_zh":240,"released_at":241},247185,"@cloudflare\u002Fshell@0.3.1","### Patch Changes\n\n-   [#1248](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1248) [`c74b615`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc74b6158060f49faf0c73f6c84f33b6db92c9ad0) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Update dependencies\n\n-   Updated dependencies \\[[`c74b615`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc74b6158060f49faf0c73f6c84f33b6db92c9ad0)]:\n    -   @cloudflare\u002Fcodemode@0.3.3\n","2026-04-01T12:09:31",{"id":243,"version":244,"summary_zh":245,"released_at":246},247186,"@cloudflare\u002Fai-chat@0.3.2","### Patch Changes\n\n-   [#1248](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1248) [`c74b615`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002Fc74b6158060f49faf0c73f6c84f33b6db92c9ad0) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Update dependencies\n\n-   [#1247](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1247) [`31c6279`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F31c6279575c876cc5a7e69a4130e13a0c1afc630) Thanks [@threepointone](https:\u002F\u002Fgithub.com\u002Fthreepointone)! - Add `ContinuationState` to `agents\u002Fchat` — shared state container for auto-continuation lifecycle. AIChatAgent's 15 internal auto-continuation fields consolidated into one `ContinuationState` instance (no public API change). Think gains deferred continuations, resume coordination for pending continuations, `onClose` cleanup, and hibernation persistence for client tools via `think_request_context` table.\n","2026-04-01T12:09:28",{"id":248,"version":249,"summary_zh":250,"released_at":251},247187,"@cloudflare\u002Fai-chat@0.3.1","### Patch Changes\n\n-   [#1235](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1235) [`4f79280`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F4f79280eeb0e27aabb7d9f034ae2c35ab5c73d4a) Thanks [@whoiskatrin](https:\u002F\u002Fgithub.com\u002Fwhoiskatrin)! - Strip messageId from continuation start chunks server-side so clients reuse the existing assistant message instead of briefly creating a duplicate.\n\n-   [#1232](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1232) [`2713c45`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F2713c45b94850e8d9768421fef0c2b1524cdff1e) Thanks [@whoiskatrin](https:\u002F\u002Fgithub.com\u002Fwhoiskatrin)! - Prevent duplicate assistant messages when a new user message is sent while a response is still streaming.\n\n-   [#1234](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1234) [`809f4dd`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F809f4dddf789644ad0a13b38da5a593d7d255df6) Thanks [@whoiskatrin](https:\u002F\u002Fgithub.com\u002Fwhoiskatrin)! - Fix `useAgentChat().stop()` so it cancels active server-side tool continuation streams.\n","2026-03-31T15:49:30",{"id":253,"version":254,"summary_zh":255,"released_at":256},247188,"@cloudflare\u002Fthink@0.1.1","### Patch Changes\n\n-   [#1220](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fpull\u002F1220) [`31d96cb`](https:\u002F\u002Fgithub.com\u002Fcloudflare\u002Fagents\u002Fcommit\u002F31d96cb10ab1c8cbd9fd96b73d82ef55c5524138) Thanks [@ghostwriternr](https:\u002F\u002Fgithub.com\u002Fghostwriternr)! - Fix `@cloudflare\u002Fshell` peer dependency to require `>=0.2.0`. Previously, npm could resolve an incompatible shell version, causing runtime errors. If you hit `Workspace` constructor errors, upgrade `@cloudflare\u002Fshell` to 0.2.0 or later.\n","2026-03-30T07:46:58"]