feat(shm): Cleaner 迁移到 SharedRef(§13.4)

- CleanerInvokeParams/Result 的 Text 改为 TextRef SharedRef
- cleanerProxy: 写 text 到 arena,传 SharedRef,读结果 SharedRef
- 插件侧 cleaner.invoke: 从 SharedRef 读 input,清洗后写回 arena 返回 TextRef
- NewHost(): 分配空间含 arena(256KB)
This commit is contained in:
JianFeeeee
2026-09-10 15:30:00 +08:00
parent 0db4ec8d01
commit 38f05d9bc3
4 changed files with 47 additions and 19 deletions

View File

@ -213,14 +213,15 @@ type ToolInvokeResult struct {
// CleanerInvokeParams / CleanerInvokeResult:跨进程计算层清洗。
// Scope 取 tool / input / output,Name 是工具名或通道名。
// TextRef 指向共享内存 arena 中的实际文本数据。
type CleanerInvokeParams struct {
Scope string `json:"scope"`
Name string `json:"name"`
Text string `json:"text"`
Scope string `json:"scope"`
Name string `json:"name"`
TextRef SharedRef `json:"text_ref"`
}
type CleanerInvokeResult struct {
Text string `json:"text"`
TextRef SharedRef `json:"text_ref"`
}
const (