@drakon-systems/multi-clawd 1.9.7 → 1.9.8

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
@@ -376,7 +376,7 @@ openclaw plugins install (Get-Location).Path
376
376
  **Or let your agent install it.** Running an OpenClaw assistant or Claude
377
377
  Code on the target machine already? Paste it this and go make coffee:
378
378
 
379
- > Read https://raw.githubusercontent.com/Drakon-Systems-Ltd/multi-clawd/v1.9.7/SETUP-AGENT.md
379
+ > Read https://raw.githubusercontent.com/Drakon-Systems-Ltd/multi-clawd/v1.9.8/SETUP-AGENT.md
380
380
  > and follow it to set up multi-clawd on this machine. I own a second
381
381
  > Claude account — ask me when you need me to log in.
382
382
 
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ import { execFileSync } from "node:child_process";
25
25
  import { collectDirectMembers } from "./direct-route.js";
26
26
  import { createDirectOrderController, isValidAgentId } from "./direct-sync.js";
27
27
  import { createOpenclawRunner } from "./openclaw-runner.js";
28
+ import { materialiseRuntime } from "./runtime-home.js";
28
29
  const CLI_FRESH_WATCHDOG_DEFAULTS = {
29
30
  noOutputTimeoutRatio: 0.8,
30
31
  minMs: 180_000,
@@ -332,7 +333,12 @@ function buildRuntimeModel(account, modelId) {
332
333
  },
333
334
  };
334
335
  }
335
- const SHIM_PATH = fileURLToPath(new URL("./shim.js", import.meta.url));
336
+ const SHIM_RUNTIME = materialiseRuntime(dirname(fileURLToPath(import.meta.url)), join(homedir(), ".openclaw", "state", "multi-clawd"));
337
+ if (!SHIM_RUNTIME.stable) {
338
+ console.error(`[multi-clawd] could not copy the shim to a stable dir (${SHIM_RUNTIME.error}); ` +
339
+ `using the load path, which dies if OpenClaw prunes its plugin capture (issue #31)`);
340
+ }
341
+ const SHIM_PATH = SHIM_RUNTIME.shimPath;
336
342
  function knownModelsFile() {
337
343
  return join(homedir(), ".openclaw", "state", "multi-clawd", "known-models.json");
338
344
  }
@@ -0,0 +1,34 @@
1
+ import { createHash } from "node:crypto";
2
+ import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ export function materialiseRuntime(srcDir, stateRoot) {
5
+ const fallback = join(srcDir, "shim.js");
6
+ try {
7
+ const files = readdirSync(srcDir).filter((f) => f.endsWith(".js")).sort();
8
+ if (!files.includes("shim.js"))
9
+ throw new Error(`shim.js missing from ${srcDir}`);
10
+ const hash = createHash("sha256");
11
+ for (const f of files)
12
+ hash.update(f).update("\0").update(readFileSync(join(srcDir, f))).update("\0");
13
+ const dir = join(stateRoot, "runtime", hash.digest("hex").slice(0, 16));
14
+ const shimPath = join(dir, "shim.js");
15
+ if (existsSync(shimPath))
16
+ return { shimPath, dir, stable: true };
17
+ const staging = `${dir}.staging-${process.pid}-${Date.now()}`;
18
+ mkdirSync(staging, { recursive: true });
19
+ for (const f of files)
20
+ copyFileSync(join(srcDir, f), join(staging, f));
21
+ writeFileSync(join(staging, "package.json"), JSON.stringify({ type: "module" }) + "\n");
22
+ try {
23
+ renameSync(staging, dir);
24
+ }
25
+ catch (e) {
26
+ if (!existsSync(shimPath))
27
+ throw e;
28
+ }
29
+ return { shimPath, dir, stable: true };
30
+ }
31
+ catch (e) {
32
+ return { shimPath: fallback, dir: srcDir, stable: false, error: e instanceof Error ? e.message : String(e) };
33
+ }
34
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "multi-clawd",
3
3
  "name": "multi-clawd",
4
- "version": "1.9.7",
4
+ "version": "1.9.8",
5
5
  "description": "Register additional Claude Code logins (Max/Pro accounts) as first-class OpenClaw CLI backends for cross-account failover, keeping the full skills/MCP harness on every account.",
6
6
  "cliBackends": [
7
7
  "claw1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drakon-systems/multi-clawd",
3
- "version": "1.9.7",
3
+ "version": "1.9.8",
4
4
  "description": "Multi-account Claude Code failover for OpenClaw — register additional Claude (Max/Pro) logins as first-class CLI backends and keep the full skills/MCP harness across every account. Also imports those accounts' setup tokens into Hermes Agent's Anthropic credential pool.",
5
5
  "type": "module",
6
6
  "license": "MIT",