bereach-openclaw 0.2.9 → 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 CHANGED
@@ -8,6 +8,29 @@ LinkedIn outreach automation via [BeReach](https://berea.ch). Registers 33 in-pr
8
8
  openclaw plugins install bereach-openclaw
9
9
  ```
10
10
 
11
+ ## Upgrade
12
+
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`.
16
+
17
+ ```bash
18
+ # 1. Uninstall
19
+ openclaw plugins uninstall bereach
20
+
21
+ # 2. Reinstall latest
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
26
+ ```
27
+
28
+ Verify versions match:
29
+ ```bash
30
+ cat /data/.openclaw/node_modules/bereach-openclaw/package.json | grep version
31
+ cat /data/.openclaw/extensions/bereach/package.json | grep version
32
+ ```
33
+
11
34
  ## Setup
12
35
 
13
36
  The API key can be set in 3 ways (in order of precedence):
@@ -30,7 +53,27 @@ The API key can be set in 3 ways (in order of precedence):
30
53
  }
31
54
  ```
32
55
 
33
- > **Note:** Add `"bereach"` to `plugins.allow` OpenClaw requires explicit allowlist for non-bundled plugins.
56
+ > **Note:** `plugins.allow` loads the plugin. Tools are auto-enabled when the plugin is loaded (no `tools.allow` needed).
57
+
58
+ **Skills + model (optional)** — `skills.entries` has no `model` field; model is set at the agent level. To use Sonnet for BeReach:
59
+
60
+ ```json
61
+ {
62
+ "skills": {
63
+ "entries": {
64
+ "bereach": { "enabled": true }
65
+ }
66
+ },
67
+ "agents": {
68
+ "defaults": {
69
+ "model": { "primary": "anthropic/claude-sonnet-4-5" },
70
+ "models": {
71
+ "anthropic/claude-sonnet-4-5": { "alias": "sonnet" }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ ```
34
77
 
35
78
  **2. Environment variable** — `BEREACH_API_KEY=brc_xxx` in your shell or `export BEREACH_API_KEY="brc_xxx"` in `~/.bashrc`.
36
79
 
@@ -38,6 +81,57 @@ The API key can be set in 3 ways (in order of precedence):
38
81
 
39
82
  Restart the Gateway after configuring.
40
83
 
84
+ ## Troubleshooting
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
+
100
+ ### "Cannot read properties of undefined (reading 'trim')" or "plugin disabled (not in allowlist)"
101
+
102
+ OpenClaw loads plugins from **two locations**:
103
+ - `node_modules/bereach-openclaw/` — the npm package (source)
104
+ - `extensions/bereach/` — the active copy OpenClaw uses at runtime
105
+
106
+ If `extensions/bereach/` is corrupt or incomplete, you get trim/undefined errors. Fix:
107
+
108
+ **1. Backup and remove the active extension:**
109
+ ```bash
110
+ mv /data/.openclaw/extensions/bereach /data/.openclaw/extensions/bereach.bak.$(date +%s)
111
+ ```
112
+
113
+ **2. Reinstall from npm (inside the container):**
114
+ ```bash
115
+ cd /data/.openclaw
116
+ npm i bereach-openclaw@latest
117
+ ```
118
+
119
+ **3. Restart OpenClaw** so it rebuilds `extensions/bereach/` from the package.
120
+
121
+ **4. If `extensions/bereach/` is still incomplete after restart**, force a symlink:
122
+ ```bash
123
+ rm -rf /data/.openclaw/extensions/bereach
124
+ ln -s /data/.openclaw/node_modules/bereach-openclaw /data/.openclaw/extensions/bereach
125
+ # then restart the container
126
+ ```
127
+
128
+ **5. Verify** — compare the two manifests:
129
+ ```bash
130
+ wc -l /data/.openclaw/extensions/bereach/openclaw.plugin.json
131
+ wc -l /data/.openclaw/node_modules/bereach-openclaw/openclaw.plugin.json
132
+ ```
133
+ They should match. Per [OpenClaw Plugin Manifest](https://docs.openclaw.ai/plugins/manifest), tools are registered at runtime via `api.registerTool()`.
134
+
41
135
  ## Usage
42
136
 
43
137
  ### Tools (33 registered)
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "id": "bereach",
3
3
  "name": "BeReach",
4
+ "version": "0.2.11",
4
5
  "description": "LinkedIn outreach automation — 33 tools, auto-reply commands, campaign monitoring",
5
6
  "configSchema": {
6
7
  "type": "object",
7
- "required": ["BEREACH_API_KEY"],
8
+ "required": [
9
+ "BEREACH_API_KEY"
10
+ ],
8
11
  "additionalProperties": false,
9
12
  "properties": {
10
13
  "BEREACH_API_KEY": {
@@ -20,5 +23,8 @@
20
23
  "sensitive": true,
21
24
  "placeholder": "brc_..."
22
25
  }
23
- }
26
+ },
27
+ "skills": [
28
+ "skills/bereach"
29
+ ]
24
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bereach-openclaw",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "BeReach LinkedIn automation plugin for OpenClaw",
5
5
  "license": "AGPL-3.0",
6
6
  "scripts": {
@@ -3,23 +3,23 @@ import { definitions } from "./definitions";
3
3
 
4
4
  /**
5
5
  * Registers all 33 BeReach tools with the OpenClaw agent.
6
- * Each tool delegates to the corresponding SDK method via dot-path resolution.
7
- * Client is created lazily on first tool invocation to avoid trim/undefined errors during plugin load.
6
+ * Format per https://docs.openclaw.ai/plugins/agent-tools
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
- def.name,
13
- {
14
- description: def.description,
15
- parameters: def.parameters,
16
- },
17
- async (params: Record<string, unknown>) => {
11
+ api.registerTool({
12
+ name: def.name,
13
+ description: def.description,
14
+ parameters: def.parameters,
15
+ async execute(_id: string, params: Record<string, unknown>) {
18
16
  const client = getClient();
19
17
  const [resource, method] = def.handler.split(".");
20
18
  const result = await (client as any)[resource][method](params);
21
- return result;
19
+ return {
20
+ content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
21
+ };
22
22
  },
23
- );
23
+ });
24
24
  }
25
25
  }