openclaw-sync-assistant 0.0.6 → 0.0.7

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 CHANGED
@@ -18,9 +18,22 @@ module.exports = {
18
18
  console.log("✅ openclaw-sync-assistant 插件已激活!");
19
19
  }
20
20
 
21
- // 根据模式启动后台服务的逻辑占位
22
- // if (config.syncMethod === 'p2p') startP2PService(context);
23
- // else if (config.syncMethod === 'github') startGitSyncService(context);
21
+ // 对于一些旧版本的 OpenClaw 或不同规范,可能需要挂载在 extensions 对象上
22
+ if (
23
+ context.api &&
24
+ context.api.commands &&
25
+ typeof context.api.commands.registerCommand === "function"
26
+ ) {
27
+ try {
28
+ context.api.commands.registerCommand("sync.setup", () =>
29
+ this.executeCommand("sync.setup", {}, context),
30
+ );
31
+ } catch (e) {
32
+ if (process.env.DEBUG === "openclaw:sync") {
33
+ console.error(e);
34
+ }
35
+ }
36
+ }
24
37
  },
25
38
 
26
39
  /**
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "openclaw-sync-assistant",
3
3
  "name": "openclaw-sync-assistant",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "description": "OpenClaw Sync Assistant Plugin",
6
6
  "commands": [
7
7
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-sync-assistant",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "An OpenClaw plugin for P2P file and data synchronization using Hyperswarm and Hyperdrive ecosystem.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",