第5部分:Plugins (插件)
Plugins 扩展 OpenClaw 核心功能,提供额外的聊天频道、模型提供商和自定义逻辑。
插件通过钩子系统与 OpenClaw 核心交互:
agent:bootstrap - 构建引导文件前/new, /reset, /stop 等before_model_resolve - 模型解析前before_prompt_build - 提示构建前before_agent_start - 代理启动前before_agent_reply - 代理回复前agent_end - 代理结束后before_compaction - 压缩前after_compaction - 压缩后before_tool_call - 工具调用前after_tool_call - 工具调用后message_received - 消息接收message_sending - 消息发送中message_sent - 消息发送后session_start - 会话开始session_end - 会话结束gateway_start - 网关启动gateway_stop - 网关停止before_tool_call: { block: true } 终止并阻止低优先级处理器before_tool_call: { block: false } 无操作,不清除先前的阻止before_install: { block: true } 终止并阻止低优先级处理器message_sending: { cancel: true } 终止并阻止低优先级处理器插件开发需要:
openclaw plugins install
openclaw plugins list
openclaw plugins remove