@ai-setting/roy-task-plugin

中文文档
0.7.14发布于 2026/11/06ES Module近 30 天下载 1928

OpenCode plugin for business-semantic task management. Ships the plugin entry (dist/index.js) plus the roy-task CLI (dist/cli.js) that bridges Feishu events to the roy agent — the CLI runs on plain Node.js, no bun required.

原始使用文档
文档目录7 节
  1. Install
  2. roy-task — Feishu ↔ agent bridge
  3. ⚠️ One consumer per (app, EventKey)
  4. --profile matters for more than event routing
  5. Plugin usage
  6. Notes on the build
  7. License

@ai-setting/roy-task-plugin

OpenCode plugin for business-semantic task management, plus the roy-task CLI that bridges Feishu (Lark) messages to an OpenCode agent.

Requires only Node.js ≥ 20. The roy-task CLI runs on plain node — no bun, no compilation, no build step. npm i and you are done.

Install

npm install @ai-setting/roy-task-plugin

That gives you two things:

ArtifactEntryRuntime
OpenCode plugindist/index.jsloaded by opencode (bun)
roy-task CLIdist/cli.jsplain node ≥ 20

roy-task — Feishu ↔ agent bridge

npx roy-task --help
npx roy-task version
npx roy-task status --profile default
npx roy-task serve --profile default
CommandWhat it does
roy-task statusRead-only pre-flight: is an event consumer already running for this app? is the opencode roy agent visible?
roy-task serveConsume Feishu events and dispatch them to opencode run --agent roy, then reply.
roy-task serve --dry-runListen and log, but never spawn an agent and never reply.
roy-task serve --onceHandle exactly one event, then exit (testing / CI).

⚠️ One consumer per (app, EventKey)

lark-cli allows exactly one event consume per app+EventKey. A second one does not error — it silently splits the event stream, so messages get delivered to the wrong handler or dropped. That is why --profile is a first-class flag: pick an app whose events nothing else is consuming.

roy-task status checks this for you before you start.

--profile matters for more than event routing

Feishu openId / chatId are per-app isolated. A reply sent through the wrong app produces 99992361 open_id cross app. Session ids are therefore derived from (profile, chatId), never from chatId alone.

Plugin usage

The plugin half is unchanged — see the repository README for hook behaviour, persistence modes (local SQLite / remote HTTP) and the audit chain.

Notes on the build

  • dist/index.js is bundled (--packages=bundle): opencode loads it with no node_modules resolution needed.
  • dist/cli.js is external (--target=node --packages=external, 35 KB): it keeps @ai-setting/roy-agent-core as a real dependency so npm can dedupe it, instead of vendoring ~1 MB of core into this package.
  • stdin is forced to EOF (stdio[0] = "ignore") for every child process. opencode run calls readStdin(), which only resolves at EOF — on an inherited socket it hangs for ~45 s. The long-lived lark-cli event consume needs the opposite (stdin must stay open); it is spawned by roy-agent-core, not by this CLI.

License

MIT

版本与发布记录

@ai-setting/roy-task-plugin 共发布 26 个版本,首次发布于 2026/10/19;过去 12 个月发布了 26 个版本。

版本发布日期距今
0.7.14latest2026/11/062 天前
0.7.132026/11/052 天前
0.7.122026/11/052 天前
0.7.112026/11/044 天前
0.7.102026/11/044 天前
0.7.92026/11/044 天前

关于 @ai-setting/roy-task-plugin 的常见问题

@ai-setting/roy-task-plugin 是什么?

OpenCode plugin for business-semantic task management. Ships the plugin entry (dist/index.js) plus the roy-task CLI (dist/cli.js) that bridges Feishu events to the roy agent — the CLI runs on plain Node.js, no bun required.

如何安装 @ai-setting/roy-task-plugin?

在项目目录运行 npm install @ai-setting/roy-task-plugin,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 roy-task,可以用 npx roy-task 直接运行。

@ai-setting/roy-task-plugin 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ai-setting__roy-task-plugin 是否存在。

@ai-setting/roy-task-plugin 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ai-setting/roy-task-plugin 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ai-setting/roy-task-plugin 可以商用吗?

@ai-setting/roy-task-plugin 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@ai-setting/roy-task-plugin 的下载量有多少?

根据 npm 官方下载统计,@ai-setting/roy-task-plugin 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,928 次,日均约 64 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ai-setting/roy-task-plugin 还在维护吗?

最新版本 0.7.14 发布于 2026/11/06(2 天前);至今共发布 26 个版本,其中过去 12 个月发布了 26 个;首次发布于 2026/10/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。