@honor-claw/yoyo 1.6.1-alpha.2 → 1.6.1-beta.2
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.
|
@@ -9,6 +9,7 @@ var a = "[yoyoclaw-auth-refresh]", o = .3, s = .1, c = 1e3, l = 6e4, u = class {
|
|
|
9
9
|
scheduleVersion = 0;
|
|
10
10
|
destroyed = !1;
|
|
11
11
|
pausedForExpiredToken = !1;
|
|
12
|
+
pendingConfigTokenRefresh = !1;
|
|
12
13
|
constructor(e) {
|
|
13
14
|
this.config = e;
|
|
14
15
|
}
|
|
@@ -29,15 +30,29 @@ var a = "[yoyoclaw-auth-refresh]", o = .3, s = .1, c = 1e3, l = 6e4, u = class {
|
|
|
29
30
|
}
|
|
30
31
|
this.sendUpdateAuthorizationRequest(), this.scheduleTimer(n.expireMs * s);
|
|
31
32
|
}
|
|
32
|
-
async handleAuthorizationUpdate(
|
|
33
|
-
let
|
|
34
|
-
if (typeof
|
|
33
|
+
async handleAuthorizationUpdate(r) {
|
|
34
|
+
let i = r.bizExtInfo, o = i?.jwtToken;
|
|
35
|
+
if (typeof o != "string" || !o.trim()) {
|
|
35
36
|
e().warn(`${a} updateAuthorization missing valid jwtToken`);
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
try {
|
|
39
|
-
let
|
|
40
|
-
e().info(`${a} cached new token, expireMs: ${
|
|
40
|
+
let s = Date.now(), c = o.trim(), l = (await n(c, i?.expire, s))?.authorizationCache?.expireMs ?? 0;
|
|
41
|
+
if (e().info(`${a} cached new token, expireMs: ${l}, receivedAtMs: ${s}, sourceDeviceId: ${r.sourceDeviceId || "unknown"}, sourceRole: ${r.sourceRole || "unknown"}`), this.pendingConfigTokenRefresh) {
|
|
42
|
+
this.pendingConfigTokenRefresh = !1;
|
|
43
|
+
try {
|
|
44
|
+
let n = t(), r = n.getUserConfig();
|
|
45
|
+
await n.updateUserConfig({
|
|
46
|
+
...r,
|
|
47
|
+
token: c,
|
|
48
|
+
userId: void 0,
|
|
49
|
+
expired: void 0
|
|
50
|
+
}), e().info(`${a} persisted upgraded token to plugin config, expireMs: ${l}`);
|
|
51
|
+
} catch (t) {
|
|
52
|
+
e().error(`${a} failed to persist upgraded token to plugin config: ${String(t)}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
this.pausedForExpiredToken = !1, await this.schedule();
|
|
41
56
|
} catch (t) {
|
|
42
57
|
e().error(`${a} failed to cache new token: ${String(t)}`);
|
|
43
58
|
}
|
|
@@ -54,7 +69,7 @@ var a = "[yoyoclaw-auth-refresh]", o = .3, s = .1, c = 1e3, l = 6e4, u = class {
|
|
|
54
69
|
let s = (await r())?.authorizationCache, c = i(s?.expireMs), u = s?.receivedAtMs ?? 0;
|
|
55
70
|
if (!c || !Number.isFinite(u) || u <= 0) {
|
|
56
71
|
let t = Date.now();
|
|
57
|
-
return await n(o, l, t), e().warn(`${a} missing cached authorization timing, persisted legacy token timing and refreshing immediately`), {
|
|
72
|
+
return this.pendingConfigTokenRefresh = !0, await n(o, l, t), e().warn(`${a} missing cached authorization timing, persisted legacy token timing and refreshing immediately`), {
|
|
58
73
|
receivedAtMs: t,
|
|
59
74
|
expireMs: l,
|
|
60
75
|
refreshImmediately: !0
|
package/package.json
CHANGED
|
@@ -58,5 +58,14 @@
|
|
|
58
58
|
"resumeTimer",
|
|
59
59
|
"restartTimer",
|
|
60
60
|
"cancelTimer",
|
|
61
|
-
"task_result_query"
|
|
61
|
+
"task_result_query",
|
|
62
|
+
"cancel_countdown_timer",
|
|
63
|
+
"check_countdown_timer",
|
|
64
|
+
"close_countdown_timer",
|
|
65
|
+
"create_countdown_timer",
|
|
66
|
+
"express_logistics_query",
|
|
67
|
+
"open_countdown_timer",
|
|
68
|
+
"pause_countdown_timer",
|
|
69
|
+
"restart_countdown_timer",
|
|
70
|
+
"resume_countdown_timer"
|
|
62
71
|
]
|
|
@@ -9,6 +9,8 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
|
|
|
9
9
|
|
|
10
10
|
严格按下面顺序执行。不要输出步骤名、命令、判断过程或额外解释;只输出本文写明的用户可见文案。所有输出使用中文。
|
|
11
11
|
|
|
12
|
+
注意:所有用户可见文案以纯文本形式输出,不要用代码块(` ```markdown ` 等)包裹同一份内容两次。
|
|
13
|
+
|
|
12
14
|
## 禁止事项
|
|
13
15
|
|
|
14
16
|
- 不得执行 `openclaw plugins uninstall`。
|
|
@@ -24,11 +26,9 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
|
|
|
24
26
|
- 记录 `Version` 和 `Spec`。
|
|
25
27
|
- 若 `Spec` 是精确版本号(如 `@honor-claw/yoyo@1.3.0-beta.8`),输出以下文案并停止:
|
|
26
28
|
|
|
27
|
-
```markdown
|
|
28
29
|
当前 YOYO 插件使用精确版本号安装,自动升级流程已停止。
|
|
29
30
|
|
|
30
31
|
请修改 OpenClaw 配置文件,将 `plugins.installs.yoyo.spec` 从当前精确版本改为非精确版本规格(例如 `@honor-claw/yoyo@beta`、`@honor-claw/yoyo@alpha` 或 `@honor-claw/yoyo`),然后再重新发起升级。
|
|
31
|
-
```
|
|
32
32
|
|
|
33
33
|
## 步骤 2:确定目标版本
|
|
34
34
|
|
|
@@ -45,7 +45,8 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
|
|
|
45
45
|
|
|
46
46
|
## 步骤 3:输出更新摘要和更新阶段文案
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
输出以下文案:
|
|
49
|
+
|
|
49
50
|
🔄 YOYO 插件更新可用
|
|
50
51
|
|
|
51
52
|
当前版本:v{当前版本}
|
|
@@ -59,7 +60,6 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
|
|
|
59
60
|
|
|
60
61
|
2. 正在更新插件
|
|
61
62
|
状态:正在安装并配置新版本插件,请勿中断操作
|
|
62
|
-
```
|
|
63
63
|
|
|
64
64
|
## 步骤 4:执行更新
|
|
65
65
|
|
|
@@ -67,13 +67,11 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
|
|
|
67
67
|
|
|
68
68
|
## 步骤 5:校验并输出结果
|
|
69
69
|
|
|
70
|
-
若步骤 4
|
|
70
|
+
若步骤 4 失败,输出以下文案:
|
|
71
71
|
|
|
72
|
-
```markdown
|
|
73
72
|
❌ 插件更新失败
|
|
74
73
|
|
|
75
74
|
失败原因:{简要描述错误}
|
|
76
|
-
```
|
|
77
75
|
|
|
78
76
|
网络错误补充 `请检查网络连接后重试`;权限错误补充 `请检查 OpenClaw 安装目录的读写权限`;其他错误补充 `请将错误信息反馈给开发团队,或稍后重试`。停止。
|
|
79
77
|
|
|
@@ -90,16 +88,12 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
|
|
|
90
88
|
|
|
91
89
|
若实际版本高于步骤 2 获取的目标版本,在步骤 6 成功文案后追加:
|
|
92
90
|
|
|
93
|
-
```markdown
|
|
94
91
|
说明:本次实际升级到 v{实际版本},高于预检查获取的目标版本 v{目标版本}。
|
|
95
|
-
```
|
|
96
92
|
|
|
97
93
|
## 步骤 6:输出完成结果
|
|
98
94
|
|
|
99
95
|
输出阶段 3 文案:
|
|
100
96
|
|
|
101
|
-
```markdown
|
|
102
97
|
3. 插件更新完成
|
|
103
98
|
Claw 插件更新已完成
|
|
104
99
|
网关即将重启,请稍候...
|
|
105
|
-
```
|