Skip to content

Commit 905e09b

Browse files
docs(testing): event-route input is { canonical, native, preflight? } (#664)
1 parent 81dbcf8 commit 905e09b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎website/docs/en/guide/development/testing.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const chapters: number | undefined = result?.chapters; // no cast
7676
```
7777

7878
An event route registers what the harness actually takes and gives back: `input` is the
79-
`{ canonical, native }` payload (the harness supplies `signal` itself), and `result` is
79+
`{ canonical, native, preflight? }` payload (the harness supplies `signal` itself), and `result` is
8080
`undefined`, since event modules export no `resultSchema`. Build that input from a host envelope
8181
with `createEventRouteInput('tool/after', envelope, { host: 'claude' })` rather than by hand: it
8282
validates the envelope per host and event and projects `canonical.payload` through the same table

‎website/docs/zh/guide/development/testing.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const { result } = await renderRoute('tool:library/summarize', {
6666
const chapters: number | undefined = result?.chapters; // 无需强制类型转换
6767
```
6868

69-
事件路由注册的是测试工具实际接受与返回的内容:`input` 是 `{ canonical, native }` 载荷(`signal` 由测试
69+
事件路由注册的是测试工具实际接受与返回的内容:`input` 是 `{ canonical, native, preflight? }` 载荷(`signal` 由测试
7070
工具自行提供),而 `result` 为 `undefined`,因为事件模块不导出 `resultSchema`。请用
7171
`createEventRouteInput('tool/after', envelope, { host: 'claude' })` 从宿主信封构造这个输入,而不要手写:它按
7272
宿主与事件校验信封,并通过与制品包装器相同的表投影出 `canonical.payload`;标注为

0 commit comments

Comments
 (0)