rol-websocket-channel 1.6.4 → 1.6.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.
@@ -0,0 +1,3 @@
1
+ export function resolveOpenClawBin() {
2
+ return process.env.OPENCLAW_BIN || 'openclaw';
3
+ }
@@ -2,6 +2,7 @@ import { exec, execFile } from 'node:child_process';
2
2
  import path from 'node:path';
3
3
  import { promisify } from 'node:util';
4
4
  import { pathExists, readJsonFile, writeJsonFile } from '../lib/fs.js';
5
+ import { resolveOpenClawBin } from '../lib/openclaw-bin.js';
5
6
  import { JsonRpcException, JSON_RPC_ERRORS } from '../jsonrpc.js';
6
7
  const execAsync = promisify(exec);
7
8
  const execFileAsync = promisify(execFile);
@@ -23,12 +24,6 @@ const RUNTIME_ENTRYPOINTS = [
23
24
  'index.cjs'
24
25
  ];
25
26
  // ---------------------------------------------------------------------------
26
- // Resolve openclaw binary path (supports OPENCLAW_BIN env override)
27
- // ---------------------------------------------------------------------------
28
- function resolveOpenClawBin() {
29
- return process.env.OPENCLAW_BIN || 'openclaw';
30
- }
31
- // ---------------------------------------------------------------------------
32
27
  // Public API: installMem9 (idempotent, phase-based)
33
28
  // ---------------------------------------------------------------------------
34
29
  export async function installMem9(context) {
@@ -153,7 +148,7 @@ async function ensureOpenClawCli() {
153
148
  await execFileAsync(bin, ['--version']);
154
149
  }
155
150
  catch (error) {
156
- throw new JsonRpcException(JSON_RPC_ERRORS.internalError, `openclaw command is not available (tried: ${bin}). Set OPENCLAW_BIN env to override.`, { code: 'MEM9_OPENCLAW_NOT_FOUND', bin, detail: error instanceof Error ? error.message : String(error) });
151
+ throw new JsonRpcException(JSON_RPC_ERRORS.internalError, `openclaw command is not available (tried: ${bin}). Configure the OpenClaw binary path for the Gateway service.`, { code: 'MEM9_OPENCLAW_NOT_FOUND', bin, detail: error instanceof Error ? error.message : String(error) });
157
152
  }
158
153
  }
159
154
  async function ensureNodeRuntime() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rol-websocket-channel",
3
- "version": "1.6.4",
3
+ "version": "1.6.7",
4
4
  "description": "Unified OpenClaw plugin: MQTT Channel + Admin Bridge for remote management",
5
5
  "license": "MIT",
6
6
  "author": "nixgnehc",
@@ -0,0 +1,3 @@
1
+ export function resolveOpenClawBin(): string {
2
+ return process.env.OPENCLAW_BIN || 'openclaw';
3
+ }
@@ -3,6 +3,7 @@ import path from 'node:path';
3
3
  import { promisify } from 'node:util';
4
4
 
5
5
  import { pathExists, readJsonFile, writeJsonFile } from '../lib/fs.js';
6
+ import { resolveOpenClawBin } from '../lib/openclaw-bin.js';
6
7
  import { JsonRpcException, JSON_RPC_ERRORS } from '../jsonrpc.js';
7
8
  import type { JsonValue, MethodContext } from '../types.js';
8
9
 
@@ -38,14 +39,6 @@ interface OpenClawConfig {
38
39
  [key: string]: any;
39
40
  }
40
41
 
41
- // ---------------------------------------------------------------------------
42
- // Resolve openclaw binary path (supports OPENCLAW_BIN env override)
43
- // ---------------------------------------------------------------------------
44
-
45
- function resolveOpenClawBin(): string {
46
- return process.env.OPENCLAW_BIN || 'openclaw';
47
- }
48
-
49
42
  // ---------------------------------------------------------------------------
50
43
  // Public API: installMem9 (idempotent, phase-based)
51
44
  // ---------------------------------------------------------------------------
@@ -189,7 +182,7 @@ async function ensureOpenClawCli(): Promise<void> {
189
182
  } catch (error) {
190
183
  throw new JsonRpcException(
191
184
  JSON_RPC_ERRORS.internalError,
192
- `openclaw command is not available (tried: ${bin}). Set OPENCLAW_BIN env to override.`,
185
+ `openclaw command is not available (tried: ${bin}). Configure the OpenClaw binary path for the Gateway service.`,
193
186
  { code: 'MEM9_OPENCLAW_NOT_FOUND', bin, detail: error instanceof Error ? error.message : String(error) }
194
187
  );
195
188
  }