OpenParable
Skip to content
← Back to skills

Xrk Bot

Agent Building
xrk-bot

Xrk Bot is an Agent Skill for agent building published in the sunflowermm/XRK-AGT repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

当你需要理解 XRK-AGT 的运行时核心(Bot 主类)、事件总线、HTTP/WS 启动流程与全局对象时使用。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/sunflowermm/XRK-AGT/blob/HEAD/.cursor/skills/xrk-bot/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/xrk-bot, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

文档与代码

  • 文档:docs/bot.md、docs/runtime-surface.md、docs/server.md
  • 代码:src/bot.js、src/utils/runtime-globals.js

关键职责

  • 启动 HTTP/HTTPS/WebSocket 服务器,以及基础中间件(压缩、安全头、CORS、日志、基础认证等)。
  • 初始化加载器:TaskerLoader / ApiLoader / StreamLoader / PluginsLoader。
  • 维护运行时 Bot(Proxy):Bot[self_id]、Bot.tasker / Bot.wsf / Bot.uin / Bot.em() / Bot.makeLog()。

全局写法(业务 core/)

  • 裸名 Bot,勿 import Bot、new Bot()、勿 global.Bot。
  • HTTP handler:req.bot 或第三参 Bot。
  • 挂载仅在 src/:setRuntimeGlobal('Bot', bot)(start.js、tasker/loader.js)。
  • 详见 docs/runtime-surface.md、.cursor/rules/xrk-dev-requirements.mdc。

其它

  • callRoute / 公网探测:全局 fetch + AbortSignal.timeout(见 src/bot.js)。
  • Node 26 约定:skill xrk-node-runtime。