supbuddy 3.1.12 → 3.1.13

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/dist/lib.js CHANGED
@@ -42,6 +42,7 @@ function defaultStateDir() {
42
42
  }
43
43
 
44
44
  // src/client.ts
45
+ import path3 from "path";
45
46
  var DaemonClient = class {
46
47
  constructor(baseUrl, token, timeoutMs = 15e3) {
47
48
  this.baseUrl = baseUrl;
@@ -137,9 +138,19 @@ async function connect(a) {
137
138
  for (let p = info.mcpPort; p <= info.mcpPort + 5; p++) {
138
139
  const client = new DaemonClient(`http://127.0.0.1:${p}`, token, timeoutMs);
139
140
  try {
140
- await client.call("get_health");
141
+ const health = await client.call("get_health");
142
+ const reported = health?.worker?.state_dir;
143
+ if (reported && path3.resolve(reported) !== path3.resolve(dir)) {
144
+ throw new Error(
145
+ `Refusing to continue: the daemon on port ${p} is serving a different registry.
146
+ you asked for : ${dir}
147
+ it is serving : ${reported}
148
+ Two daemons are running and this command would have acted on the wrong one. Stop the other daemon, or give them separate ports (SUPBUDDY_STATE_DIR + --port / WORKER_PORT).`
149
+ );
150
+ }
141
151
  return client;
142
152
  } catch (e) {
153
+ if (/Refusing to continue/.test(String(e?.message ?? ""))) throw e;
143
154
  if (e?.code === 401 || e?.name === "TimeoutError" || e?.name === "SyntaxError" || /abort|timeout|ETIMEDOUT|ECONNREFUSED|ECONNRESET|fetch failed|JSON/i.test(String(e?.message ?? e))) {
144
155
  continue;
145
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supbuddy",
3
- "version": "3.1.12",
3
+ "version": "3.1.13",
4
4
  "description": "Run multiple Supabase projects at once on custom local domains with HTTPS. A headless CLI and daemon (proxy, DNS, Supabase/Compose lifecycle, MCP) for macOS and Linux.",
5
5
  "keywords": [
6
6
  "supabase",
@@ -41,15 +41,6 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "scripts": {
45
- "build": "tsup",
46
- "build:host": "SUPBUDDY_BUILD_KIND=host tsup",
47
- "build:npm": "SUPBUDDY_PUBLIC_BUILD=1 tsup",
48
- "build:standalone": "pnpm build:npm && node ../../scripts/stage-cli-daemon.mjs",
49
- "prepublishOnly": "pnpm build:standalone",
50
- "daemon": "tsx src/bin.ts daemon",
51
- "selftest": "tsx src/selftest.ts"
52
- },
53
44
  "dependencies": {
54
45
  "ws": "^8.18.0"
55
46
  },
@@ -60,11 +51,19 @@
60
51
  "@supbuddy/caddy-linux-arm64": "2.11.1"
61
52
  },
62
53
  "devDependencies": {
63
- "@supbuddy/shared": "workspace:*",
64
54
  "chalk": "^5.3.0",
65
55
  "socket.io": "^4.6.1",
66
56
  "tsup": "^8",
67
57
  "tsx": "^4.7.0",
68
- "typescript": "^5.3.3"
58
+ "typescript": "^5.3.3",
59
+ "@supbuddy/shared": "2.8.0"
60
+ },
61
+ "scripts": {
62
+ "build": "tsup",
63
+ "build:host": "SUPBUDDY_BUILD_KIND=host tsup",
64
+ "build:npm": "SUPBUDDY_PUBLIC_BUILD=1 tsup",
65
+ "build:standalone": "pnpm build:npm && node ../../scripts/stage-cli-daemon.mjs",
66
+ "daemon": "tsx src/bin.ts daemon",
67
+ "selftest": "tsx src/selftest.ts"
69
68
  }
70
- }
69
+ }