tools: plugindev 工具链支持公共 IOInjector.InjectInputSync(CORE_INJECT_INPUT_SYNC=47,z_bridge dispatchIO 桥接),重建 bin 预编译二进制;example/memo: plg.json 修复(name_en 去斜杠、去 BOM);sdk/plugin.go 注释精简

This commit is contained in:
root
2026-08-02 16:24:59 +08:00
parent 8e5610c494
commit b6e30f9279
4 changed files with 12 additions and 10 deletions

View File

@ -111,8 +111,8 @@ type IOInjector interface {
InjectInterruptText(source, channel, text string)
InjectText(source, channel, text string)
InjectTextNoMemory(source, channel, text string)
// InjectInputSync injects a text message and synchronously waits for the agent
// reply, returning the reply text (empty string if no reply).
// InjectInputSync 注入输入事件并同步等待 agent 回复,返回回复文本(无回复时返回空串)。
// 用于通道消息的完整闭环:收到入站 → agent 处理 → 回复取回 → 送回通道。
InjectInputSync(source, channel, text string) string
}
@ -371,13 +371,13 @@ func (s *PluginSDK) InjectTextNoMemory(source, channel, text string) {
}
// InjectInputSync injects a text message and synchronously waits for the agent reply,
// returning the reply text (empty if no reply). Use it for request-response flows
// (e.g. channel plugins forwarding messages and sending the agent's reply back).
// returning the reply text (empty string if none). Replies must be dispatched back
// to the source channel by the caller.
func (s *PluginSDK) InjectInputSync(source, channel, text string) string {
if s.io != nil {
return s.io.InjectInputSync(source, channel, text)
if s.io == nil {
return ""
}
return ""
return s.io.InjectInputSync(source, channel, text)
}
// SetAutoRestart 设置插件是否允许内核自动重启(崩溃后自动重载)。