事件
三本喊话册
选对事件域,是大多数改动的第一个决定。日记、对讲机、规矩,不要写错本子。
session
会话事件 · 日记
写进本子、重启还在的事实。
何时:必须在重新加载后仍然存在
turn/start · turn/end一轮作业的开合
step/start · step/end一次想+做
user/message进入步骤的输入(surface)
assistant/chunk · assistant/message速记与誊清
tool/call · tool/result动手与成绩单
request/header冻住的请求信封
session/event对外广播每一条日志
agent
Agent 事件 · 对讲机
正在干活时喊的话,不写进日记正文。
何时:观察或拦截飞行中的工作
agent/inbox/*inserted / claimed / discarded / spliced
agent/statusidle ⇄ running
agent/pre-stepwaterfall:拒绝或改写领取
agent/requestwaterfall:换模型,不换作文
agent/request-errorwaterfall:重试或放行失败
agent/turn-stoppingserial:最后塞一张便利贴的机会
capability
能力事件 · 规矩
不必走进心跳房,也能给插座加锁。
何时:向 seam 附加策略和适配器
llm/streamwaterfall:包住适配器流
tools/pre-executeallow / deny / ask
tools/execute包住工具函数(超时、指标)
tools/post-executeaccept / replace / block
fs/write-intent · fs/edit-intent写前观察策略
system-prompt/assemble提示词最后组装
工具流水线
- 01createExecution:冻住参数
- 02tools/pre-execute waterfall:allow / deny / ask
- 03若 ask → ctx.approval
- 04ToolGuard[]:只能更严,不能放宽
- 05tools/execute waterfall:超时手表包住 tool.execute
- 06tools/post-execute:accept / replace / block
- 07finalizeContent:最后改模型可见文本,不许抛错
- 08tools/result emit:成绩单冻住
四种喊法再看一眼
emit广播:谁爱听谁听,不能否决。
waterfall必须喊 next() 把纸传下去,否则就是你做主。
parallel全班同时做同一件事,比如把日记刷到磁盘。
serial排队发言,没有 next()。turn-stopping 就是这种。