@drakon-systems/multi-clawd 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/package.json +6 -1
  2. package/scripts/doctor.mjs +32 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drakon-systems/multi-clawd",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -57,6 +57,11 @@
57
57
  "peerDependencies": {
58
58
  "openclaw": ">=2026.6"
59
59
  },
60
+ "peerDependenciesMeta": {
61
+ "openclaw": {
62
+ "optional": true
63
+ }
64
+ },
60
65
  "devDependencies": {
61
66
  "openclaw": "2026.7.1",
62
67
  "typescript": "^5.9.0",
@@ -26,7 +26,38 @@ import { dirname, join, resolve } from "node:path";
26
26
  import { fileURLToPath } from "node:url";
27
27
 
28
28
  const HOME = homedir();
29
- const EXT_DIR = join(HOME, ".openclaw", "extensions", "multi-clawd");
29
+
30
+ /**
31
+ * Where is the plugin actually installed? Path installs land in
32
+ * ~/.openclaw/extensions/multi-clawd; registry installs (npm spec) land in
33
+ * ~/.openclaw/npm/projects/<pkg-hash>/node_modules/@drakon-systems/multi-clawd.
34
+ * Prefer the extensions dir when both exist (it shadows), else the newest
35
+ * npm-project install carrying a manifest.
36
+ */
37
+ function resolveInstallDir() {
38
+ const extDir = join(HOME, ".openclaw", "extensions", "multi-clawd");
39
+ if (existsSync(join(extDir, "openclaw.plugin.json"))) return extDir;
40
+ const projects = join(HOME, ".openclaw", "npm", "projects");
41
+ let best = extDir;
42
+ let bestM = -1;
43
+ try {
44
+ for (const p of readdirSync(projects)) {
45
+ if (!p.startsWith("drakon-systems-multi-clawd-")) continue;
46
+ const dir = join(projects, p, "node_modules", "@drakon-systems", "multi-clawd");
47
+ const manifest = join(dir, "openclaw.plugin.json");
48
+ if (!existsSync(manifest)) continue;
49
+ const m = statSync(manifest).mtimeMs;
50
+ if (m > bestM) {
51
+ bestM = m;
52
+ best = dir;
53
+ }
54
+ }
55
+ } catch {
56
+ /* no npm projects dir */
57
+ }
58
+ return best;
59
+ }
60
+ const EXT_DIR = resolveInstallDir();
30
61
  const CONFIG_PATH = join(HOME, ".openclaw", "openclaw.json");
31
62
  const STATE_DIR = join(HOME, ".openclaw", "state", "multi-clawd");
32
63
  const REPO_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "..");