Xrk Plugins

当你需要理解/开发插件(plugin 基类)、插件加载与规则匹配、上下文和冷却机制时使用。

sunflowermm d40fc6c 1.5 KB Updated

File contents

文档与代码

  • docs/plugin-base.mddocs/runtime-surface.mddocs/plugins-loader.mddocs/事件系统标准化文档.md
  • src/infrastructure/plugins/plugin-base.jsplugins/loader.js#utils/event-keys.js
  • 示例:core/system-Core/plugin/*.js

约定

  • 路径:core/*/plugin/*.js(含办事工作区 data/ai-workspace/*/core/*/plugin);入口 PluginLoader.deal(e)
  • 基类:import PluginBase from '#infrastructure/plugins/plugin-base.js'extends PluginBase
  • 裸名 msgSegmentAgentRuntime;勿 global.msgSegment / global.AgentRuntime
  • constructor 不建缓存/Map;rule[].fnc(e)e.msg
  • event 匹配matchPluginEvent):
    • 跨 Tasker:message / message.group / notice.*.poke
    • 定 Tasker:onebot.message / device.*(首段非通用 post_type 时必须与 e.tasker 一致,否则不命中)
    • 可选 tasker / taskers 白名单(别名经 coerceTaskerId,如 apistdin
  • 戳一戳等 noticeevent: 'notice.*.poke';逻辑放 accept()。勿为业务去改 Tasker。
  • 调 AI:this.getWorkflow('chat'|...) + stream.process(e, e.msg, options)
  • 错误:Error.isError / normalizeError(skill xrk-node-runtime)。
  • 产品 / 办事助手写工作区 Core:导航 skill agent-core-dev(配方优先,只读本 skill)。

sunflowermm/xrk-agt/tree/main/.cursor/skills/xrk-plugins commit d40fc6c66c

Frequently asked questions

npx skillmds@latest add sunflowermm/xrk-plugins