rainskills 0.1.29 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rainskills
2
2
 
3
- Rainskills 是一组面向应用识别、部署、排障和交付的 AI Skills,支持 Codex、Claude Code、Pi Agent、DeepSeek Harness 和 WorkBuddy。用户在市场中只会看到一个 `Rainskills` 产品,安装后 11 个 `rainbond-*` Skill 仍会独立触发。
3
+ Rainskills 是一组面向应用识别、部署、排障和交付的 AI Skills,支持 Codex、Claude Code、Pi Agent、DeepSeek Harness、WorkBuddyHermes Agent。用户在市场中只会看到一个 `Rainskills` 产品,安装后 11 个 `rainbond-*` Skill 仍会独立触发。
4
4
 
5
5
  ## 安装
6
6
 
@@ -57,7 +57,15 @@ npx --yes rainskills workbuddy
57
57
 
58
58
  默认安装到 `${WORKBUDDY_CONFIG_DIR:-~/.workbuddy-ai}/skills`。如果安装发生在一个已经打开的 WorkBuddy 任务中,先刷新 Skill 列表或新建任务;部署时明确指定 Rainbond/Rainskills,或让项目保留 `rainbond.app.json`、`.rainbond/local.json` 标记,以避免被内置 Sites 路由抢占。
59
59
 
60
- 安装流程支持 Codex、Claude Code、Pi Agent、DeepSeek Harness 和 WorkBuddy;所有 Agent 共用同一组 Skills 和本地 Rainskills CLI,不提供单独的客户端 MCP adapter。macOS、Linux 和 WSL 不支持 OpenClaw 安装。不要手工复制 Skill、拼接凭据或修改 Agent 配置。
60
+ Hermes Agent
61
+
62
+ ```bash
63
+ npx --yes rainskills hermes
64
+ ```
65
+
66
+ 默认安装到 `${HERMES_HOME:-~/.hermes}/skills`,与其他宿主共用同一 CLI profile 和本地 Rainskills CLI,不配置客户端 MCP。如果安装发生在一个已经打开的 Hermes 会话中,执行 `/reset` 或新建会话后再使用新安装的 Skills。
67
+
68
+ 安装流程支持 Codex、Claude Code、Pi Agent、DeepSeek Harness、WorkBuddy 和 Hermes Agent;所有 Agent 共用同一组 Skills、CLI profile 和本地 Rainskills CLI,不提供单独的客户端 MCP adapter。macOS、Linux 和 WSL 不支持 OpenClaw 安装。不要手工复制 Skill、拼接凭据或修改 Agent 配置。
61
69
 
62
70
  ## 安装完成时用户会看到什么
63
71
 
@@ -239,7 +247,7 @@ node ~/.rainbond/lib/rainskills/bin/rainskills.js platform install --onboarding-
239
247
 
240
248
  Rainskills 会在用户下一次发起业务动作时,由本地运行时立即返回环境查询结果,并另行启动后台任务静默检查更新。更新只跟随 npm `latest` 指向的正式版。当前版本是 RC 或其他预发布版本时不会查询、不会自动升级;npm 上的新 RC 版本也不参与正式版自动升级。
241
249
 
242
- 发现更高的正式版后,后台任务只委托到经过校验的精确版本,例如 `rainskills@0.1.29`,不会执行浮动的 `@latest` 业务代码。新版本原子刷新已经安装的 Rainskills Skills;当前业务继续使用启动时已经加载的版本,最迟从下一条新任务开始使用新版。npm 超时、版本检查失败、安装位置不安全或文件迁移失败时会保留旧版本,且不会阻塞或改变当前操作。
250
+ 发现更高的正式版后,后台任务只委托到经过校验的精确版本,例如 `rainskills@0.1.33`,不会执行浮动的 `@latest` 业务代码。新版本原子刷新已经安装的 Rainskills Skills;当前业务继续使用启动时已经加载的版本,最迟从下一条新任务开始使用新版。npm 超时、版本检查失败、安装位置不安全或文件迁移失败时会保留旧版本,且不会阻塞或改变当前操作。
243
251
 
244
252
  升级只更新 Rainskills 自身,不触发 Rainbond 安装、运行环境选择、登录授权或重新对接,也不会新增 Agent MCP 配置。更新内容仅包括 Skills 和本地 CLI。原始业务操作会继续执行;只有该业务操作本身需要运行环境时,才按既有门禁检查当前连接。可用连接直接复用,401 只重新授权一次,403 立即停止,从未连接过运行环境时才进入环境选择。
245
253
 
package/SKILL.md CHANGED
@@ -9,7 +9,7 @@ This is the single marketplace entry for the complete Rainskills product. The in
9
9
 
10
10
  ## Initialize
11
11
 
12
- 1. Detect the current host client and map it to exactly one supported installer target: Codex=`codex`, Claude Code=`claude`, Pi Agent=`pi`, DeepSeek Harness=`dsh`, or WorkBuddy=`workbuddy`. All five use the same installed Skills and protected local Rainskills CLI; Pi and DeepSeek Harness have no separate MCP adapter or generated extension. DeepSeek Harness installs to `$DSH_HOME/skills` (default `~/.dsh/skills`). WorkBuddy installs to `$WORKBUDDY_CONFIG_DIR/skills` (default `~/.workbuddy-ai/skills`). The macOS, Linux, and WSL installer intentionally does not support OpenClaw; report that limitation instead of invoking an unsupported target. Do not ask the user which supported client they are currently using. If the host cannot be determined reliably, omit the target and let the installer ask.
12
+ 1. Detect the current host client and map it to exactly one supported installer target: Codex=`codex`, Claude Code=`claude`, Pi Agent=`pi`, DeepSeek Harness=`dsh`, WorkBuddy=`workbuddy`, or Hermes Agent=`hermes`. All six use the same CLI profile, installed Skills, and protected local Rainskills CLI; none requires a separate client MCP adapter. DeepSeek Harness installs to `$DSH_HOME/skills` (default `~/.dsh/skills`). WorkBuddy installs to `$WORKBUDDY_CONFIG_DIR/skills` (default `~/.workbuddy-ai/skills`). Hermes Agent installs to `$HERMES_HOME/skills` (default `~/.hermes/skills`); `AI_AGENT=hermes-agent` or `HERMES_AGENT=true` is a reliable fallback when the host must be detected from a terminal subprocess. The macOS, Linux, and WSL installer intentionally does not support OpenClaw; report that limitation instead of invoking an unsupported target. Do not ask the user which supported client they are currently using. If the host cannot be determined reliably, omit the target and let the installer ask.
13
13
  2. Resolve the directory containing this `SKILL.md`. On native Windows, if the adjacent `bin/rainskills.js` exists, run it by absolute path with the detected target in an attached interactive terminal: `node <skill-directory>/bin/rainskills.js <target>`. On macOS, Linux, or WSL, if the adjacent `install.sh` exists, run `bash <skill-directory>/install.sh <target>` the same way. Do not replace the installer with manual file copies.
14
14
  3. Keep stdin, stdout, and stderr attached. When `RAINSKILLS_USER_INPUT_REQUIRED` appears, pause for that installer choice. If the installer emits `rainskills.next-action.v1`, execute only its fixed `argv` through the same launcher; never evaluate output as a shell command. If the adjacent `bin/rainskills.js` exists, use it for fixed next actions; otherwise use the same versioned npm package fallback described below.
15
15
  4. Stay attached until every independent Skill is installed. Do not select, connect, or configure an application runtime during installation. In the user-facing response, output only the fixed completion message below.
@@ -24,6 +24,8 @@ Skills-only 安装不需要 Node.js;CDN fallback 只负责安装 Skill 文件
24
24
 
25
25
  The installer emits this text inside `RAINSKILLS_USER_MESSAGE_BEGIN:install.completed` and the matching END marker, followed by `RAINSKILLS_AGENT_SUMMARY_REQUIRED:include-next-actions`. Relay only the body exactly and print nothing else; do not expose the markers, summarize, reformat, add a source link, or add verification details. If the host still summarizes instead of relaying, its installation summary must retain at least one example from “下一步可以直接说”.
26
26
 
27
+ For `target=hermes`, the emitted body additionally tells an already-open Hermes session to run `/reset` or start a new session so its cached Skill catalog includes every newly installed `rainbond-*` Skill. Relay that emitted Hermes body exactly; do not replace it with the generic example below.
28
+
27
29
  ```text
28
30
  Rainskills 安装完成,下一条消息即可直接使用。
29
31
 
@@ -48,9 +50,11 @@ Rainskills 安装完成,下一条消息即可直接使用。
48
50
 
49
51
  Codex 中命令工具一旦返回 `session_id`,必须立即对该 `session_id` 反复调用 `write_stdin`(空输入轮询),直到工具返回 `exit_code`。连接器输出 `[RAINSKILLS_AGENT_WAIT_REQUIRED:runtime-connect]` 后进入上述轮询;看到 `[RAINSKILLS_AGENT_WAIT_COMPLETE:runtime-connect]` 后仍须继续轮询,直到取得退出码和最终 JSON。
50
52
 
53
+ Hermes Agent 中必须使用 `terminal` 以 `background=true` 启动授权命令;取得 `session_id` 后,只对同一会话按需调用 `process(action="poll")` 获取授权地址,再调用 `process(action="wait")` 等待退出。`wait` 超时时只能继续等待同一 `session_id`;不得把后台启动或浏览器成功页面当作授权完成,也不得另起 `runtime status`。
54
+
51
55
  DeepSeek Harness 和 WorkBuddy 也必须保持原命令附着直到退出;如果宿主把长命令转成持久终端或后台任务,只能轮询该原始命令句柄,不得另起 `runtime status` 推测授权结果。WorkBuddy 安装后若当前任务的 Skill 清单尚未刷新,在下一条业务动作前先刷新 Skill 列表或新建任务,不得退回内置 Sites 代替 Rainbond 部署。
52
56
 
53
- Rainskills 只保存一个全局运行环境,不维护环境列表、名称、默认值或环境 ID。使用固定 launcher `node <home>/.rainbond/lib/rainskills/bin/rainskills.js`(运行包版本 `rainskills@0.1.29`):
57
+ Rainskills 只保存一个全局运行环境,不维护环境列表、名称、默认值或环境 ID。使用固定 launcher `node <home>/.rainbond/lib/rainskills/bin/rainskills.js`(运行包版本 `rainskills@0.1.33`):
54
58
 
55
59
  - 状态:执行 `runtime status --json`。
56
60
  - 首次连接:执行 `runtime connect <target> --saas` 或 `runtime connect <target> --rainbond-url <Console origin>`。
@@ -58,6 +62,8 @@ Rainskills 只保存一个全局运行环境,不维护环境列表、名称、
58
62
  - 重新授权:执行 `runtime reconnect <target>`;必须进入浏览器 Device Flow,不复用 Shell 中缓存的 JWT。
59
63
  - 更换环境:明确告知用户会替换当前唯一环境;新授权和 live probe 成功后再覆盖凭据。
60
64
 
65
+ 固定 contract 中的 `<target>` 必须替换为当前宿主:Codex=`codex`、Claude Code=`claude`、Pi Agent=`pi`、DeepSeek Harness=`dsh`、WorkBuddy=`workbuddy`、Hermes Agent=`hermes`。
66
+
61
67
  所有 Rainbond 查询和变更继续通过 `~/.rainbond/bin/rainskills-tools.js`。不得配置客户端 MCP,也不得恢复环境枚举、业务 operation 生命周期、环境 ID 或 intent 恢复协议。
62
68
 
63
69
  业务 CLI 默认只读取受保护的唯一运行环境文件,忽略 Shell 中遗留的 `RAINBOND_URL` / `RAINBOND_JWT`。CI 若要显式使用环境变量凭据,必须同时设置 `RAINSKILLS_CREDENTIAL_SOURCE=environment`。
@@ -449,6 +449,56 @@ function skillManifestPath(config) {
449
449
  return path.join(config.homeDir || os.homedir(), CONFIG_DIRECTORY, "bin", SKILL_MANIFEST_FILENAME);
450
450
  }
451
451
 
452
+ function loadTelemetryPackageVersion(config) {
453
+ try {
454
+ const manifest = JSON.parse(fs.readFileSync(skillManifestPath(config), "utf8"));
455
+ return typeof manifest.package_version === "string" && manifest.package_version
456
+ ? manifest.package_version
457
+ : "unknown";
458
+ } catch {
459
+ return "unknown";
460
+ }
461
+ }
462
+
463
+ function createBridgeTelemetry(config) {
464
+ try {
465
+ const directory = path.join(config.homeDir || os.homedir(), CONFIG_DIRECTORY, "rainskills", "telemetry");
466
+ const { createResultTelemetry } = requireRuntimeModule("result-telemetry.js");
467
+ return createResultTelemetry({
468
+ directory,
469
+ packageVersion: loadTelemetryPackageVersion(config),
470
+ });
471
+ } catch {
472
+ return null;
473
+ }
474
+ }
475
+
476
+ async function executeWithUsageTelemetry(command, config) {
477
+ const tracksUsage = command.command === "read" || command.command === "call";
478
+ const telemetry = tracksUsage ? createBridgeTelemetry(config) : null;
479
+ if (telemetry) await telemetry.flushPending(3).catch(() => {});
480
+ try {
481
+ const output = await execute(command, config);
482
+ if (telemetry) {
483
+ const firstUse = telemetry.recordFirstUse("success");
484
+ const active = telemetry.recordActiveDaily();
485
+ await Promise.allSettled([firstUse.delivery, active.delivery]);
486
+ }
487
+ return output;
488
+ } catch (error) {
489
+ if (telemetry) {
490
+ const firstUse = telemetry.recordFirstUse("failed", {
491
+ error_stage: "first_use",
492
+ error_code: error instanceof BridgeError && error.exitCode === EXIT.TRANSPORT
493
+ ? "transport_failed"
494
+ : "tool_call_failed",
495
+ });
496
+ await firstUse.delivery.catch(() => false);
497
+ }
498
+ throw error;
499
+ }
500
+ }
501
+
452
502
  function loadSkillBinding(config, skillId, rootSkillId) {
453
503
  const target = skillManifestPath(config);
454
504
  let manifest;
@@ -1370,7 +1420,7 @@ async function main(args = process.argv.slice(2)) {
1370
1420
  if (config.isInsecureHttp) {
1371
1421
  process.stderr.write('{"warning":"using insecure HTTP transport"}\n');
1372
1422
  }
1373
- const output = await execute(command, config);
1423
+ const output = await executeWithUsageTelemetry(command, config);
1374
1424
  process.stdout.write(`${JSON.stringify(fitOutput(output))}\n`);
1375
1425
  return;
1376
1426
  }
@@ -1380,7 +1430,7 @@ async function main(args = process.argv.slice(2)) {
1380
1430
  if (config.isInsecureHttp) {
1381
1431
  process.stderr.write('{"warning":"using insecure HTTP transport"}\n');
1382
1432
  }
1383
- const output = await execute(command, config);
1433
+ const output = await executeWithUsageTelemetry(command, config);
1384
1434
  process.stdout.write(`${JSON.stringify(fitOutput(output))}\n`);
1385
1435
  } catch (error) {
1386
1436
  const bridgeError = error instanceof BridgeError