memory-gateway-sync 0.8.0 → 0.9.0

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
@@ -1,3 +1,4 @@
1
+ // memory-gateway-sync/src/index.ts
1
2
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
2
3
  import fs from "node:fs";
3
4
  import path from "node:path";
@@ -10,8 +11,8 @@ var index_default = definePluginEntry({
10
11
  kind: "generic",
11
12
  register(api) {
12
13
  const cfg = api.pluginConfig ?? {};
13
- const gatewayUrl = cfg.gatewayUrl;
14
- const gatewayToken = cfg.gatewayToken;
14
+ const gatewayUrl = cfg.gatewayUrl || process.env.MEMORY_SYNC_GATEWAY_URL || "";
15
+ const gatewayToken = cfg.gatewayToken || process.env.MEMORY_SYNC_GATEWAY_TOKEN || "";
15
16
  const debounceMs = cfg.debounceMs ?? 1500;
16
17
  const defaultAgentId = cfg.agentId ?? "default";
17
18
  const ownerClawUserId = (() => {
@@ -24,6 +24,5 @@
24
24
  "description": "当前 agent 标识,写入 Gateway 时携带,用于后续多 agent 隔离"
25
25
  }
26
26
  },
27
- "required": ["gatewayUrl", "gatewayToken"]
28
27
  }
29
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory-gateway-sync",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Memory 双写插件:fs.watch 感知变化后同步到外部 Gateway",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/index.ts CHANGED
@@ -39,9 +39,9 @@ export default definePluginEntry({
39
39
  kind: "generic",
40
40
 
41
41
  register(api) {
42
- const cfg = (api.pluginConfig ?? {}) as PluginConfig;
43
- const gatewayUrl = cfg.gatewayUrl;
44
- const gatewayToken = cfg.gatewayToken;
42
+ const cfg = (api.pluginConfig ?? {}) as Partial<PluginConfig>;
43
+ const gatewayUrl = cfg.gatewayUrl || process.env.MEMORY_SYNC_GATEWAY_URL || "";
44
+ const gatewayToken = cfg.gatewayToken || process.env.MEMORY_SYNC_GATEWAY_TOKEN || "";
45
45
  const debounceMs = cfg.debounceMs ?? 1500;
46
46
  const defaultAgentId = cfg.agentId ?? "default";
47
47
  const ownerClawUserId = (() => {