Mastra 将分类器列为一等原语并新增策略执行与后台工具
原标题:September 23, 2026
AI 摘要
Mastra 发布更新,将分类器(classifiers)作为核心一等原语,支持在 Mastra 实例上注册并通过管理 API 操作,还可作为类型化工作流步骤实现分支控制流。新增 ClassifierProcessor 对 agent 输入、输出和流式内容执行类型化策略,默认失败即中止(fail closed)。此外引入 context.background.adopt() 支持原生后台工具执行、@mastra/connect 新增十个 SaaS 工具提供方,并改进 Inngest 持久化运行的配置化重试与恢复。
正文节选
## Highlights ### Classifiers as a First-Class Primitive (Core + Workflows) Mastra now supports registering classifiers on `new Mastra({ classifiers })`, with a full management API (`getClassifier*`, `listClassifiers`, `addClassifier`, `removeClassifier`) and automatic root tracing for classifier evaluations. Those configured classifiers can also be used as typed workflow steps (including fluent + dynamic graphs) to power typed branching/conditional control flow with token usage. ### Poli