fix(docs): address documentation site review

This commit is contained in:
Yichen Jiang
2026-07-13 17:47:42 +08:00
parent 341b56ebc3
commit 6be219a0bc
12 changed files with 333 additions and 212 deletions
+5 -7
View File
@@ -133,14 +133,14 @@ defineTool({
// ...
presentCall(args) {
return {
intent: 'terminal',
title: `bash(${JSON.stringify(args.command).slice(0, 60)})`,
card: 'terminal',
title: args.command,
}
},
presentResult(args, result) {
return {
intent: 'terminal',
body: result.content.map(b => b.type === 'text' ? b.text : '').join(''),
card: 'terminal',
output: result.content.map(b => b.type === 'text' ? b.text : '').join(''),
}
},
})
@@ -156,9 +156,7 @@ defineTool({
// 这样就够了:
ctx.tools.register(defineTool({ /* ... */ }))
// 不需要:
// const dispose = ctx.tools.register(...)
// ctx.on('dispose', dispose)
// 不需要额外保存 disposer 或注册清理逻辑
```
## 完整实战示例