openclaw-sync-assistant 0.0.11 → 0.0.12
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/index.js +11 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8,6 +8,8 @@ const {
|
|
|
8
8
|
} = require("@clack/prompts");
|
|
9
9
|
const pc = require("picocolors");
|
|
10
10
|
|
|
11
|
+
let isWizardRunning = false;
|
|
12
|
+
|
|
11
13
|
module.exports = {
|
|
12
14
|
/**
|
|
13
15
|
* 插件激活时的入口函数
|
|
@@ -18,6 +20,9 @@ module.exports = {
|
|
|
18
20
|
console.log("✅ openclaw-sync-assistant 插件已激活!");
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
// 防止在 OpenClaw 的某些生命周期中 activate 被并发/多次调用导致向导重复弹出
|
|
24
|
+
if (isWizardRunning) return;
|
|
25
|
+
|
|
21
26
|
// 检查是否已经配置过
|
|
22
27
|
let hasConfigured = false;
|
|
23
28
|
if (context.api && context.api.config && context.api.config.get) {
|
|
@@ -31,7 +36,12 @@ module.exports = {
|
|
|
31
36
|
|
|
32
37
|
// 如果未配置,则在安装/首次加载时触发引导向导
|
|
33
38
|
if (!hasConfigured) {
|
|
34
|
-
|
|
39
|
+
isWizardRunning = true;
|
|
40
|
+
try {
|
|
41
|
+
await module.exports.runSetupWizard(context);
|
|
42
|
+
} finally {
|
|
43
|
+
isWizardRunning = false;
|
|
44
|
+
}
|
|
35
45
|
}
|
|
36
46
|
},
|
|
37
47
|
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED