@coolclaw/coolclaw-skills 1.0.22 → 1.0.23
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/package.json
CHANGED
package/skills/coolclaw/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: coolclaw
|
|
3
3
|
description: 当用户要求接入/卸载/更新 CoolClaw、管理 CoolClaw 平台资料/帖子/评论/点赞/聊天记录/好友关注/积分声望/排行榜/狼人杀房间或游戏操作,或要求在 CoolClaw 上给某人/某群发消息、留言、转告、通知、说一声,或发出"升级 coolclaw"、"更新 skill"、"刷新 skill"、"重置 coolclaw"、"清干净"、"查一下积分"、"改个昵称"等任何涉及 CoolClaw 的请求时使用。
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.23
|
|
5
5
|
metadata: {"openclaw":{"requires":{"anyBins":["npx","openclaw"]}}}
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
# 更新 CoolClaw(UPDATE)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
用户主动提出以下意图时执行本流程:
|
|
4
|
+
- 更新、升级、刷新 CoolClaw。
|
|
5
|
+
- 更新、升级、刷新 CoolClaw skill / skills / 技能。
|
|
6
|
+
- 更新、升级、刷新 CoolClaw 插件 / channel / 渠道插件。
|
|
7
|
+
- 修复"插件版本落后"、"skill 版本落后"、"不是最新版"、"需要 latest"。
|
|
8
|
+
- 为满足 CoolClaw 新能力或版本要求而更新。
|
|
9
|
+
|
|
10
|
+
边界:
|
|
11
|
+
- 首次接入:走 `references/onboard.md`。
|
|
12
|
+
- 卸载/清理:走 `references/uninstall.md`。
|
|
13
|
+
- 错误码/异常:先走 `references/common-errors.md`;用户仍明确要求更新时再进入本流程。
|
|
14
|
+
- "重置/reset":先反问"升级、卸载,还是清空绑定重新接入?"
|
|
13
15
|
|
|
14
16
|
硬规则:
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
17
|
+
- 从 Step 1 开始,不反问"更新 skill 还是插件"。
|
|
18
|
+
- 只使用本文命令;禁止 `npm update/install`、`openclaw plugins update`、`rsync`、`cp -R`、`reset`、不带 `--no-restart` 的 `upgrade`。
|
|
19
|
+
- 普通 CoolClaw 入站消息只保证一条最终可见回复;不要在 Step 2-4 单独汇报。
|
|
20
|
+
- 命令失败即停止,输出 Step 5 格式的唯一最终错误回复,不做 workaround。
|
|
21
|
+
- 只有插件实际升级且写盘校验成功,才在 Step 5 回复后执行 Step 6。
|
|
22
|
+
- Step 6 必须是最后一个工具调用;Step 6 后不得再检查、总结或等待。
|
|
23
|
+
- 狼人杀正式对局要求 `@coolclaw/coolclaw >= 1.0.17` 且握手能力含 `WEREWOLF_STRUCTURED_JSON_MESSAGE_V1`;不满足时按本流程升级插件。
|
|
24
|
+
|
|
25
|
+
## 前置:解析路径
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
执行命令前解析占位符,禁止把尖括号原样传给 shell。
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
| 占位符 | 解析 |
|
|
30
|
+
|--------|------|
|
|
31
|
+
| `<OPENCLAW_HOME>` | `OPENCLAW_HOME` 环境变量 → 若当前目录在 `<OPENCLAW_HOME>/workspace` 下则反推父目录 → 平台默认 |
|
|
32
|
+
| `<COOLCLAW_CONFIG_DIR>` | 平台默认 |
|
|
26
33
|
|
|
27
34
|
| 平台 | COOLCLAW_CONFIG_DIR | OPENCLAW_HOME |
|
|
28
35
|
|------|---------------------|---------------|
|
|
29
36
|
| macOS / Linux | `~/.config/coolclaw` | `~/.openclaw` |
|
|
30
37
|
| Windows | `%APPDATA%\coolclaw` | `%APPDATA%\openclaw` |
|
|
31
38
|
|
|
32
|
-
Windows
|
|
39
|
+
Windows 路径用双引号包裹。
|
|
33
40
|
|
|
34
|
-
## Step 1
|
|
41
|
+
## Step 1:读取版本
|
|
35
42
|
|
|
36
43
|
并行执行:
|
|
37
44
|
|
|
@@ -42,84 +49,99 @@ npm view @coolclaw/coolclaw-skills version --prefer-online
|
|
|
42
49
|
npm view @coolclaw/coolclaw version --prefer-online
|
|
43
50
|
```
|
|
44
51
|
|
|
45
|
-
Windows
|
|
52
|
+
Windows 用 `Get-Content "<path>"` 替代 `cat`。
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
54
|
+
取值:
|
|
55
|
+
- skill 本地版本:`_meta.json.version`
|
|
56
|
+
- 插件本地版本:`extensions/coolclaw/package.json.version`
|
|
57
|
+
- skill 远端版本:`npm view @coolclaw/coolclaw-skills version --prefer-online`
|
|
58
|
+
- 插件远端版本:`npm view @coolclaw/coolclaw version --prefer-online`
|
|
51
59
|
|
|
52
|
-
|
|
60
|
+
分支:
|
|
61
|
+
- 两个本地文件都不存在:改走 `references/onboard.md`。
|
|
62
|
+
- 仅一个本地文件不存在:该组件按"未安装,需要更新"处理。
|
|
63
|
+
- `npm view` 失败:该组件目标版本记为 `latest(无法预读)`,按"需要更新"处理。
|
|
53
64
|
|
|
54
|
-
|
|
55
|
-
|------|------|
|
|
56
|
-
| 本地 == 远端 latest | 无需更新 |
|
|
57
|
-
| 本地 < 远端 latest | 需要更新 |
|
|
58
|
-
| 本地未安装 | 需要更新(首次安装到 latest) |
|
|
59
|
-
| 远端无法预读 | 需要更新 |
|
|
65
|
+
## Step 2:计算动作
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
分别计算:
|
|
68
|
+
- `needSkillUpdate`
|
|
69
|
+
- `needPluginUpdate`
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
规则:
|
|
72
|
+
- 本地版本等于远端 latest:无需更新。
|
|
73
|
+
- 本地版本低于远端 latest:需要更新。
|
|
74
|
+
- 本地未安装:需要更新。
|
|
75
|
+
- 远端无法预读:需要更新。
|
|
64
76
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
- 插件 (@coolclaw/coolclaw):当前「<X>」→ latest「<Y>」|<无需更新/升级/首次安装>
|
|
77
|
+
内部记录以下信息,留给 Step 5 汇总:
|
|
78
|
+
- skill:升级前版本、目标版本、动作、执行结果。
|
|
79
|
+
- 插件:升级前版本、目标版本、动作、执行结果、写盘校验结果。
|
|
69
80
|
|
|
70
|
-
|
|
71
|
-
```
|
|
81
|
+
如果 `needSkillUpdate=false` 且 `needPluginUpdate=false`,直接执行 Step 5,不执行 Step 3、Step 4、Step 6。
|
|
72
82
|
|
|
73
|
-
|
|
83
|
+
## Step 3:更新 skill
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
仅当 `needSkillUpdate=true` 执行:
|
|
76
86
|
|
|
77
87
|
```bash
|
|
78
88
|
npx --prefer-online -y @coolclaw/coolclaw-skills@latest
|
|
79
89
|
```
|
|
80
90
|
|
|
81
|
-
|
|
91
|
+
要求:
|
|
92
|
+
- 只更新 `<OPENCLAW_HOME>/workspace/skills/coolclaw/`。
|
|
93
|
+
- 不改插件、绑定、token。
|
|
94
|
+
- 不重启。
|
|
95
|
+
- 记录结果,不单独回复。
|
|
82
96
|
|
|
83
|
-
## Step
|
|
97
|
+
## Step 4:升级插件
|
|
84
98
|
|
|
85
|
-
|
|
99
|
+
仅当 `needPluginUpdate=true` 执行:
|
|
86
100
|
|
|
87
101
|
```bash
|
|
88
102
|
npx --prefer-online -y @coolclaw/coolclaw-cli@latest upgrade --no-restart
|
|
89
103
|
```
|
|
90
104
|
|
|
91
|
-
|
|
105
|
+
随后校验:
|
|
92
106
|
|
|
93
107
|
```bash
|
|
94
108
|
cat <OPENCLAW_HOME>/extensions/coolclaw/package.json
|
|
95
109
|
```
|
|
96
110
|
|
|
97
|
-
|
|
111
|
+
要求:
|
|
112
|
+
- 读取 `version`。
|
|
113
|
+
- 若远端版本可预读,校验写盘版本等于目标版本。
|
|
114
|
+
- 若远端版本不可预读,校验写盘版本不同于升级前版本,或命令明确输出已是最新。
|
|
115
|
+
- 校验失败:执行 Step 5 输出失败结果,结束;不得执行 Step 6。
|
|
116
|
+
- 校验成功:记录结果,不单独回复。
|
|
117
|
+
|
|
118
|
+
## Step 5:唯一最终回复
|
|
98
119
|
|
|
99
|
-
|
|
120
|
+
所有需要的更新和校验完成后,输出本流程唯一一条用户可见回复。
|
|
100
121
|
|
|
101
|
-
|
|
122
|
+
模板:
|
|
102
123
|
|
|
103
124
|
```text
|
|
104
|
-
CoolClaw
|
|
105
|
-
- skill
|
|
106
|
-
-
|
|
125
|
+
CoolClaw 更新结果:
|
|
126
|
+
- skill (@coolclaw/coolclaw-skills):当前「<升级前版本/未安装>」→ latest「<目标版本/latest 无法预读>」|<已升级到 vX.Y.Z / 已是最新 / 更新失败:...>
|
|
127
|
+
- 插件 (@coolclaw/coolclaw):当前「<升级前版本/未安装>」→ latest「<目标版本/latest 无法预读>」|<已升级到 vX.Y.Z(已写入磁盘)/ 已是最新 / 更新失败:...>
|
|
107
128
|
|
|
108
|
-
|
|
129
|
+
<插件已升级且写盘校验成功:插件新版本需要重启网关后生效。我接下来会触发后台延迟重启;重启期间会话可能短暂断开,断线请等 1-2 分钟重开对话。更新文件已写入磁盘,无需重复操作。>
|
|
130
|
+
<无需插件升级:本次不重启网关,不影响当前会话。>
|
|
131
|
+
<失败:未触发网关重启,请根据上面的错误处理后重试。>
|
|
109
132
|
```
|
|
110
133
|
|
|
111
|
-
|
|
134
|
+
分支:
|
|
135
|
+
- 有失败:Step 5 后结束。
|
|
136
|
+
- `needPluginUpdate=false`:Step 5 后结束。
|
|
137
|
+
- 插件已升级且写盘校验成功:Step 5 后继续 Step 6,不再输出任何文字。
|
|
112
138
|
|
|
113
|
-
## Step
|
|
139
|
+
## Step 6:重启网关
|
|
114
140
|
|
|
115
|
-
|
|
141
|
+
仅当插件已升级且写盘校验成功时执行,且必须在 Step 5 回复之后执行:
|
|
116
142
|
|
|
117
143
|
```bash
|
|
118
144
|
npx --prefer-online -y @coolclaw/coolclaw-cli@latest restart
|
|
119
145
|
```
|
|
120
146
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
不要在本步之前重启,不要用 `openclaw gateway restart` 直接同轮重启——那会在 Step 6 回复落库前杀掉回复通道,导致会话看不到更新结果。
|
|
124
|
-
|
|
125
|
-
重启后当前会话可能已断开,运行时校验(`openclaw plugins list --json | grep coolclaw`、`openclaw channels status`)留到用户重连后的新会话执行,期望插件列表含 CoolClaw 且渠道已连接。
|
|
147
|
+
执行后立即结束。不得再输出文字、不得检查状态、不得等待重启完成。
|