bereach-openclaw 0.2.10 → 0.2.11
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/README.md +25 -6
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/tools/index.ts +13 -16
package/README.md
CHANGED
|
@@ -10,14 +10,22 @@ openclaw plugins install bereach-openclaw
|
|
|
10
10
|
|
|
11
11
|
## Upgrade
|
|
12
12
|
|
|
13
|
-
`openclaw plugins update bereach` can leave `node_modules` and `extensions/` out of sync (version mismatch → trim/crash errors). **Use uninstall + reinstall** instead
|
|
13
|
+
`openclaw plugins update bereach` can leave `node_modules` and `extensions/` out of sync (version mismatch → trim/crash errors). **Use uninstall + reinstall** instead.
|
|
14
|
+
|
|
15
|
+
**Before upgrading:** note your `BEREACH_API_KEY` — uninstall may remove `plugins.entries.bereach`.
|
|
14
16
|
|
|
15
17
|
```bash
|
|
18
|
+
# 1. Uninstall
|
|
16
19
|
openclaw plugins uninstall bereach
|
|
20
|
+
|
|
21
|
+
# 2. Reinstall latest
|
|
17
22
|
openclaw plugins install bereach-openclaw
|
|
23
|
+
|
|
24
|
+
# 3. Re-add config (API key + plugins.allow) in openclaw.json — see Setup above
|
|
25
|
+
# 4. Restart the Gateway
|
|
18
26
|
```
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
Verify versions match:
|
|
21
29
|
```bash
|
|
22
30
|
cat /data/.openclaw/node_modules/bereach-openclaw/package.json | grep version
|
|
23
31
|
cat /data/.openclaw/extensions/bereach/package.json | grep version
|
|
@@ -41,14 +49,11 @@ The API key can be set in 3 ways (in order of precedence):
|
|
|
41
49
|
}
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
|
-
},
|
|
45
|
-
"tools": {
|
|
46
|
-
"allow": ["bereach"]
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
```
|
|
50
55
|
|
|
51
|
-
> **Note:** `plugins.allow` loads the plugin
|
|
56
|
+
> **Note:** `plugins.allow` loads the plugin. Tools are auto-enabled when the plugin is loaded (no `tools.allow` needed).
|
|
52
57
|
|
|
53
58
|
**Skills + model (optional)** — `skills.entries` has no `model` field; model is set at the agent level. To use Sonnet for BeReach:
|
|
54
59
|
|
|
@@ -78,6 +83,20 @@ Restart the Gateway after configuring.
|
|
|
78
83
|
|
|
79
84
|
## Troubleshooting
|
|
80
85
|
|
|
86
|
+
### BeReach tools (`bereach_*`) not visible in my session
|
|
87
|
+
|
|
88
|
+
The plugin is loaded but tools don't appear in the agent's tool list. Common causes:
|
|
89
|
+
|
|
90
|
+
1. **Plugin installed after session started** — Existing sessions don't pick up new tools.
|
|
91
|
+
2. **Gateway not restarted** — Config changes require a restart.
|
|
92
|
+
|
|
93
|
+
**Fix:**
|
|
94
|
+
```bash
|
|
95
|
+
openclaw gateway restart
|
|
96
|
+
# Then start a NEW session (e.g. new Telegram chat)
|
|
97
|
+
# Test: "Utilise bereach_get_credits"
|
|
98
|
+
```
|
|
99
|
+
|
|
81
100
|
### "Cannot read properties of undefined (reading 'trim')" or "plugin disabled (not in allowlist)"
|
|
82
101
|
|
|
83
102
|
OpenClaw loads plugins from **two locations**:
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/tools/index.ts
CHANGED
|
@@ -4,25 +4,22 @@ import { definitions } from "./definitions";
|
|
|
4
4
|
/**
|
|
5
5
|
* Registers all 33 BeReach tools with the OpenClaw agent.
|
|
6
6
|
* Format per https://docs.openclaw.ai/plugins/agent-tools
|
|
7
|
-
* optional
|
|
7
|
+
* Tools are required (not optional) — auto-enabled when plugin is loaded. Simpler UX: no tools.allow needed.
|
|
8
8
|
*/
|
|
9
9
|
export function registerAllTools(api: any) {
|
|
10
10
|
for (const def of definitions) {
|
|
11
|
-
api.registerTool(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
},
|
|
11
|
+
api.registerTool({
|
|
12
|
+
name: def.name,
|
|
13
|
+
description: def.description,
|
|
14
|
+
parameters: def.parameters,
|
|
15
|
+
async execute(_id: string, params: Record<string, unknown>) {
|
|
16
|
+
const client = getClient();
|
|
17
|
+
const [resource, method] = def.handler.split(".");
|
|
18
|
+
const result = await (client as any)[resource][method](params);
|
|
19
|
+
return {
|
|
20
|
+
content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
|
|
21
|
+
};
|
|
24
22
|
},
|
|
25
|
-
|
|
26
|
-
);
|
|
23
|
+
});
|
|
27
24
|
}
|
|
28
25
|
}
|