RegisterStage: add scope parameter, remove RegisterStageOwnTools

- SDK: RegisterStage(stage, handler, scope...) with StageScopeGlobal/StageScopeOwnTools
- Delete RegisterStageOwnTools, migrate cmd and qq plugins
- Internal SDK: add StageScope alias
- Docs: update all zh/en docs for C ABI buildmode and stage scope
- C ABI: fix nil errorOut in Handle.Start/Handle.Stop (SIGSEGV fix)
- C ABI header: add dispatch IDs 26-45 for Settings/Doc/Knowledge/LLM/Social/TextMemory
This commit is contained in:
root
2026-07-17 11:25:54 +08:00
parent 724febf7b4
commit 3cad4b635f
10 changed files with 173 additions and 77 deletions

View File

@ -214,7 +214,7 @@ func (p *Plugin) Start(s *sdk.PluginSDK) error {
}, nil
})
s.RegisterStageOwnTools(sdk.StageBeforeToolcall, func(ctx *sdk.StageContext) error {
s.RegisterStage(sdk.StageBeforeToolcall, func(ctx *sdk.StageContext) error {
if len(ctx.ToolCalls) == 0 {
return nil
}
@ -233,7 +233,7 @@ func (p *Plugin) Start(s *sdk.PluginSDK) error {
return nil
}
return nil
})
}, sdk.StageScopeOwnTools)
return nil
}