supbuddy 3.2.0 → 3.2.2

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/bin.js CHANGED
@@ -19807,7 +19807,7 @@ function cliBuildKind(env3 = process.env) {
19807
19807
  return raw === "host" || raw === "npm" ? raw : "dev";
19808
19808
  }
19809
19809
  function cliVersion(env3 = process.env) {
19810
- return "3.2.0".trim() || "0.0.0-dev";
19810
+ return "3.2.2".trim() || "0.0.0-dev";
19811
19811
  }
19812
19812
  function isDevBuild(env3) {
19813
19813
  return cliBuildKind(env3) === "dev";
@@ -19855,7 +19855,7 @@ var init_build_identity = __esm({
19855
19855
  }
19856
19856
  });
19857
19857
 
19858
- // src/caddy-resolve.js
19858
+ // src/caddy-resolve.ts
19859
19859
  import { createRequire } from "module";
19860
19860
  import path6 from "path";
19861
19861
  function caddyPackageName(platform = process.platform, arch = process.arch) {
@@ -19869,8 +19869,7 @@ function caddyPackageName(platform = process.platform, arch = process.arch) {
19869
19869
  }
19870
19870
  function resolvePackagedCaddyDir(deps = {}) {
19871
19871
  const pkgName = deps.pkgName !== void 0 ? deps.pkgName : caddyPackageName();
19872
- if (!pkgName)
19873
- return null;
19872
+ if (!pkgName) return null;
19874
19873
  const resolve = deps.resolve ?? ((id) => requireFromHere.resolve(id));
19875
19874
  try {
19876
19875
  return path6.dirname(resolve(`${pkgName}/package.json`));
@@ -19880,7 +19879,7 @@ function resolvePackagedCaddyDir(deps = {}) {
19880
19879
  }
19881
19880
  var requireFromHere;
19882
19881
  var init_caddy_resolve = __esm({
19883
- "src/caddy-resolve.js"() {
19882
+ "src/caddy-resolve.ts"() {
19884
19883
  "use strict";
19885
19884
  requireFromHere = createRequire(import.meta.url);
19886
19885
  }
@@ -28765,8 +28764,6 @@ var init_dind_manager = __esm({
28765
28764
  });
28766
28765
 
28767
28766
  // ../../packages/core/image-cache.ts
28768
- import { promisify as promisify3 } from "util";
28769
- import { execFile as execFile2, spawn as spawn4 } from "child_process";
28770
28767
  import fs8 from "fs/promises";
28771
28768
  import path11 from "path";
28772
28769
  import os6 from "os";
@@ -28817,12 +28814,10 @@ async function clearImageCache() {
28817
28814
  } catch {
28818
28815
  }
28819
28816
  }
28820
- var execFileAsync2;
28821
28817
  var init_image_cache = __esm({
28822
28818
  "../../packages/core/image-cache.ts"() {
28823
28819
  "use strict";
28824
28820
  init_dind_manager();
28825
- execFileAsync2 = promisify3(execFile2);
28826
28821
  }
28827
28822
  });
28828
28823
 
@@ -31883,15 +31878,15 @@ var init_js_yaml = __esm({
31883
31878
  });
31884
31879
 
31885
31880
  // ../../packages/core/compose-scanner.ts
31886
- import { promisify as promisify4 } from "util";
31887
- import { exec as exec2, execFile as execFile3 } from "child_process";
31888
- var execAsync2, execFileAsync3;
31881
+ import { promisify as promisify3 } from "util";
31882
+ import { exec as exec2, execFile as execFile2 } from "child_process";
31883
+ var execAsync2, execFileAsync2;
31889
31884
  var init_compose_scanner = __esm({
31890
31885
  "../../packages/core/compose-scanner.ts"() {
31891
31886
  "use strict";
31892
31887
  init_js_yaml();
31893
- execAsync2 = promisify4(exec2);
31894
- execFileAsync3 = promisify4(execFile3);
31888
+ execAsync2 = promisify3(exec2);
31889
+ execFileAsync2 = promisify3(execFile2);
31895
31890
  }
31896
31891
  });
31897
31892
 
@@ -32045,8 +32040,8 @@ import fsSync from "fs";
32045
32040
  import path13 from "path";
32046
32041
  import os8 from "os";
32047
32042
  import crypto2 from "crypto";
32048
- import { execFile as execFile4, execFileSync as execFileSync2 } from "child_process";
32049
- import { promisify as promisify5 } from "util";
32043
+ import { execFile as execFile3, execFileSync as execFileSync2 } from "child_process";
32044
+ import { promisify as promisify4 } from "util";
32050
32045
  function getSupbuddyDataDir() {
32051
32046
  const platform = process.platform;
32052
32047
  if (platform === "darwin") {
@@ -32514,7 +32509,7 @@ var init_bundled_runtime_trust2 = __esm({
32514
32509
  "../../packages/core/bundled-runtime-trust.ts"() {
32515
32510
  "use strict";
32516
32511
  init_caddy_ca_manager();
32517
- execFileP = promisify5(execFile4);
32512
+ execFileP = promisify4(execFile3);
32518
32513
  PLIST_LABEL = "com.cueplusplus.supbuddy.bundled-runtime-ca-trust";
32519
32514
  MANAGED_ENV_VARS = ["NODE_EXTRA_CA_CERTS"];
32520
32515
  LEGACY_REPLACE_VARS = ["SSL_CERT_FILE", "REQUESTS_CA_BUNDLE"];
@@ -32565,7 +32560,7 @@ var init_docker_watcher = __esm({
32565
32560
 
32566
32561
  // ../../packages/core/tailscale.ts
32567
32562
  import { exec as exec3 } from "child_process";
32568
- import { promisify as promisify6 } from "util";
32563
+ import { promisify as promisify5 } from "util";
32569
32564
  import fs11 from "fs/promises";
32570
32565
  import path14 from "path";
32571
32566
  async function tailscaleKeyPath() {
@@ -32631,7 +32626,7 @@ var init_tailscale = __esm({
32631
32626
  "../../packages/core/tailscale.ts"() {
32632
32627
  "use strict";
32633
32628
  init_store();
32634
- execAsync3 = promisify6(exec3);
32629
+ execAsync3 = promisify5(exec3);
32635
32630
  detectionInterval = null;
32636
32631
  apiKey = null;
32637
32632
  }
@@ -37802,8 +37797,8 @@ __export(supabase_manager_exports, {
37802
37797
  stopSupabase: () => stopSupabase,
37803
37798
  takenSupabaseProjectIds: () => takenSupabaseProjectIds
37804
37799
  });
37805
- import { spawn as spawn5 } from "child_process";
37806
- import { promisify as promisify7 } from "util";
37800
+ import { spawn as spawn4 } from "child_process";
37801
+ import { promisify as promisify6 } from "util";
37807
37802
  import { exec as exec4 } from "child_process";
37808
37803
  import nodeProcess from "process";
37809
37804
  function runSerial(fn) {
@@ -37851,9 +37846,6 @@ async function isDockerRunning() {
37851
37846
  }
37852
37847
  async function isSupabaseInitialized(projectPath) {
37853
37848
  try {
37854
- const { exec: exec9 } = await import("child_process");
37855
- const { promisify: promisify15 } = await import("util");
37856
- const execAsync9 = promisify15(exec9);
37857
37849
  const fs33 = await import("fs/promises");
37858
37850
  const path39 = await import("path");
37859
37851
  const supabasePath = path39.join(projectPath, "supabase");
@@ -37919,8 +37911,8 @@ async function readSupabasePorts(projectPath) {
37919
37911
  async function isPortInUse(port) {
37920
37912
  try {
37921
37913
  const { exec: exec9 } = await import("child_process");
37922
- const { promisify: promisify15 } = await import("util");
37923
- const execAsync9 = promisify15(exec9);
37914
+ const { promisify: promisify14 } = await import("util");
37915
+ const execAsync9 = promisify14(exec9);
37924
37916
  const { stdout } = await execAsync9(`lsof -nP -iTCP:${port} -sTCP:LISTEN -F pcn`, { timeout: 3e3 });
37925
37917
  if (!stdout.trim()) return { inUse: false };
37926
37918
  const match = stdout.match(/c([^\n]+)/);
@@ -37977,7 +37969,7 @@ Edit Supabase config.toml to use different ports, or stop the other project firs
37977
37969
  }
37978
37970
  const projectEnv = await resolveProjectEnv(projectPath);
37979
37971
  return new Promise((resolve, reject) => {
37980
- const child = spawn5("supabase", ["start"], {
37972
+ const child = spawn4("supabase", ["start"], {
37981
37973
  cwd: projectPath,
37982
37974
  env: { ...nodeProcess.env, ...projectEnv },
37983
37975
  stdio: ["ignore", "pipe", "pipe"]
@@ -37991,7 +37983,6 @@ Edit Supabase config.toml to use different ports, or stop the other project firs
37991
37983
  };
37992
37984
  activeOperations.set(projectId, operation);
37993
37985
  let output = "";
37994
- let hasError = false;
37995
37986
  io2.emit("supabase:operation", {
37996
37987
  projectId,
37997
37988
  operation: "start",
@@ -38034,7 +38025,6 @@ Edit Supabase config.toml to use different ports, or stop the other project firs
38034
38025
  switch (ev.kind) {
38035
38026
  case "error":
38036
38027
  console.error(`[SupabaseManager] ${ev.text}`);
38037
- hasError = true;
38038
38028
  break;
38039
38029
  case "warning":
38040
38030
  console.log(`[SupabaseManager] ${ev.text}`);
@@ -38108,7 +38098,7 @@ async function stopSupabase(projectId, projectPath, io2) {
38108
38098
  throw new Error("Operation already in progress for this project");
38109
38099
  }
38110
38100
  return new Promise((resolve, reject) => {
38111
- const child = spawn5("supabase", ["stop"], {
38101
+ const child = spawn4("supabase", ["stop"], {
38112
38102
  cwd: projectPath,
38113
38103
  stdio: ["ignore", "pipe", "pipe"]
38114
38104
  });
@@ -38121,7 +38111,6 @@ async function stopSupabase(projectId, projectPath, io2) {
38121
38111
  };
38122
38112
  activeOperations.set(projectId, operation);
38123
38113
  let output = "";
38124
- let hasError = false;
38125
38114
  io2.emit("supabase:operation", {
38126
38115
  projectId,
38127
38116
  operation: "stop",
@@ -38138,7 +38127,6 @@ async function stopSupabase(projectId, projectPath, io2) {
38138
38127
  output += stderrOutput;
38139
38128
  if (!isWarning(stderrOutput)) {
38140
38129
  console.error(`[SupabaseManager] Error: ${stderrOutput}`);
38141
- hasError = true;
38142
38130
  } else {
38143
38131
  console.log(`[SupabaseManager] Warning: ${stderrOutput.trim()}`);
38144
38132
  }
@@ -38379,7 +38367,7 @@ var init_supabase_manager = __esm({
38379
38367
  init_supabase_progress();
38380
38368
  serialChain = Promise.resolve();
38381
38369
  THIN_SUPABASE_SOFT_CAP = 6;
38382
- execAsync4 = promisify7(exec4);
38370
+ execAsync4 = promisify6(exec4);
38383
38371
  activeOperations = /* @__PURE__ */ new Map();
38384
38372
  renameLocks = /* @__PURE__ */ new Map();
38385
38373
  }
@@ -38619,8 +38607,8 @@ var init_caddy_supervisor = __esm({
38619
38607
  });
38620
38608
 
38621
38609
  // ../../packages/core/caddy-manager.ts
38622
- import { spawn as spawn6, execFile as execFile5 } from "child_process";
38623
- import { promisify as promisify8 } from "util";
38610
+ import { spawn as spawn5, execFile as execFile4 } from "child_process";
38611
+ import { promisify as promisify7 } from "util";
38624
38612
  import { randomUUID } from "crypto";
38625
38613
  import path18 from "path";
38626
38614
  import fs15 from "fs/promises";
@@ -38643,9 +38631,14 @@ function getCaddyBinaryPath() {
38643
38631
  const isDev = process.env.NODE_ENV !== "production";
38644
38632
  if (isDev) {
38645
38633
  return path18.join(process.cwd(), "resources", "bin", binaryName);
38646
- } else {
38647
- return path18.join(process.resourcesPath, "bin", binaryName);
38648
38634
  }
38635
+ const resourcesPath = process.resourcesPath;
38636
+ if (!resourcesPath) {
38637
+ throw new Error(
38638
+ `cannot locate ${binaryName}: SUPBUDDY_BIN_DIR is not set and this runtime has no process.resourcesPath (that is Electron-only). The host must set SUPBUDDY_BIN_DIR to the directory holding the bundled binaries.`
38639
+ );
38640
+ }
38641
+ return path18.join(resourcesPath, "bin", binaryName);
38649
38642
  }
38650
38643
  async function reapStaleCaddyProcesses() {
38651
38644
  if (process.platform === "win32") return;
@@ -38700,7 +38693,7 @@ function parseCaddyPidsFromPsOutput(stdout, matchToken, selfPid) {
38700
38693
  async function listCaddyPids(matchToken) {
38701
38694
  if (process.platform === "win32") return [];
38702
38695
  return await new Promise((resolve) => {
38703
- execFile5("/bin/ps", ["-axo", "pid=,stat=,command="], (err, stdout) => {
38696
+ execFile4("/bin/ps", ["-axo", "pid=,stat=,command="], (err, stdout) => {
38704
38697
  if (err) {
38705
38698
  console.warn("[Caddy] /bin/ps failed during reap scan:", err);
38706
38699
  return resolve([]);
@@ -38744,7 +38737,7 @@ async function doStartCaddyServer() {
38744
38737
  XDG_DATA_HOME: dataDir,
38745
38738
  XDG_CONFIG_HOME: path18.dirname(caddyfilePath)
38746
38739
  };
38747
- caddyProcess = spawn6(binaryPath, ["run", "--config", caddyfilePath, "--adapter", "caddyfile"], {
38740
+ caddyProcess = spawn5(binaryPath, ["run", "--config", caddyfilePath, "--adapter", "caddyfile"], {
38748
38741
  env: caddyEnv,
38749
38742
  stdio: [isDev ? "inherit" : "ignore", "pipe", "pipe"]
38750
38743
  });
@@ -38920,10 +38913,10 @@ async function validateCaddyfileContent(content) {
38920
38913
  const binaryPath = getCaddyBinaryPath();
38921
38914
  const dir = await getCaddyfileDir();
38922
38915
  const tmpPath = path18.join(dir, `Caddyfile.validate.${process.pid}.${caddyValidateCounter++}.tmp`);
38923
- const execFileAsync6 = promisify8(execFile5);
38916
+ const execFileAsync5 = promisify7(execFile4);
38924
38917
  try {
38925
38918
  await fs15.writeFile(tmpPath, content, "utf-8");
38926
- await execFileAsync6(binaryPath, ["validate", "--config", tmpPath, "--adapter", "caddyfile"]);
38919
+ await execFileAsync5(binaryPath, ["validate", "--config", tmpPath, "--adapter", "caddyfile"]);
38927
38920
  return { ok: true };
38928
38921
  } catch (err) {
38929
38922
  const e = err;
@@ -39083,23 +39076,23 @@ var init_stop_services = __esm({
39083
39076
  });
39084
39077
 
39085
39078
  // ../../packages/core/caddy-docker.ts
39086
- import { promisify as promisify9 } from "util";
39087
- import { execFile as execFile6 } from "child_process";
39079
+ import { promisify as promisify8 } from "util";
39080
+ import { execFile as execFile5 } from "child_process";
39088
39081
  async function stopCaddyContainer() {
39089
39082
  console.log("[CaddyDocker] Stopping container...");
39090
- await execFileAsync4("docker", ["stop", CADDY_CONTAINER], { timeout: 3e4 }).catch(() => {
39083
+ await execFileAsync3("docker", ["stop", CADDY_CONTAINER], { timeout: 3e4 }).catch(() => {
39091
39084
  });
39092
39085
  }
39093
39086
  async function removeCaddyContainer() {
39094
- await execFileAsync4("docker", ["rm", "-f", CADDY_CONTAINER], { timeout: 1e4 }).catch(() => {
39087
+ await execFileAsync3("docker", ["rm", "-f", CADDY_CONTAINER], { timeout: 1e4 }).catch(() => {
39095
39088
  });
39096
39089
  }
39097
- var execFileAsync4, CADDY_CONTAINER;
39090
+ var execFileAsync3, CADDY_CONTAINER;
39098
39091
  var init_caddy_docker = __esm({
39099
39092
  "../../packages/core/caddy-docker.ts"() {
39100
39093
  "use strict";
39101
39094
  init_caddyfile_generator();
39102
- execFileAsync4 = promisify9(execFile6);
39095
+ execFileAsync3 = promisify8(execFile5);
39103
39096
  CADDY_CONTAINER = "supbuddy-caddy";
39104
39097
  }
39105
39098
  });
@@ -39184,7 +39177,7 @@ var init_caddy_docker_leftovers = __esm({
39184
39177
 
39185
39178
  // ../../packages/core/port-forwarding.ts
39186
39179
  import { exec as exec5 } from "child_process";
39187
- import { promisify as promisify10 } from "util";
39180
+ import { promisify as promisify9 } from "util";
39188
39181
  import fs16 from "fs/promises";
39189
39182
  async function probe443(timeoutMs = 1e3) {
39190
39183
  return probePort(443, timeoutMs);
@@ -39251,7 +39244,7 @@ var execAsync5;
39251
39244
  var init_port_forwarding = __esm({
39252
39245
  "../../packages/core/port-forwarding.ts"() {
39253
39246
  "use strict";
39254
- execAsync5 = promisify10(exec5);
39247
+ execAsync5 = promisify9(exec5);
39255
39248
  }
39256
39249
  });
39257
39250
 
@@ -39610,7 +39603,7 @@ var init_revoked_mcp_secrets = __esm({
39610
39603
  });
39611
39604
 
39612
39605
  // ../../packages/core/supabase-dump.ts
39613
- import { spawn as spawn7 } from "child_process";
39606
+ import { spawn as spawn6 } from "child_process";
39614
39607
  import { createHash } from "crypto";
39615
39608
  import { createWriteStream } from "fs";
39616
39609
  import { mkdtemp, stat, rm } from "fs/promises";
@@ -39633,7 +39626,7 @@ async function dumpInto(dir, container) {
39633
39626
  const file = join(dir, "supabase.pgc");
39634
39627
  const hash = createHash("sha256");
39635
39628
  await new Promise((resolve, reject) => {
39636
- const child = spawn7("docker", [
39629
+ const child = spawn6("docker", [
39637
39630
  "exec",
39638
39631
  container,
39639
39632
  "pg_dump",
@@ -40054,9 +40047,14 @@ ${scriptsSection}
40054
40047
  }
40055
40048
  function renderMappingsMd(ctx) {
40056
40049
  const rows = ctx.mappings.length === 0 ? "_No mappings._" : [
40057
- "| Domain | Port | HTTPS | Enabled |",
40058
- "|--------|------|-------|---------|",
40059
- ...ctx.mappings.map((m) => `| ${m.domain} | ${m.port} | ${m.https ? "yes" : "no"} | ${m.enabled ? "yes" : "no"} |`)
40050
+ // There was an HTTPS column here reading `m.https`, a field DomainMapping does not have — so it
40051
+ // was undefined for every row and rendered "no" for every mapping, while Caddy serves them all
40052
+ // over HTTPS and this same bundle hands agents https:// URLs elsewhere. The URL is what a reader
40053
+ // actually needs, and it cannot drift from the scheme because the rest of the context builds it
40054
+ // with the same function.
40055
+ "| Domain | Port | URL | Enabled |",
40056
+ "|--------|------|-----|---------|",
40057
+ ...ctx.mappings.map((m) => `| ${m.domain} | ${m.port} | ${buildProxiedUrl(m.domain, ctx.proxyState)} | ${m.enabled ? "yes" : "no"} |`)
40060
40058
  ].join("\n");
40061
40059
  return HEADER(".supbuddy/mappings.md") + `# Domain mappings
40062
40060
 
@@ -41033,7 +41031,7 @@ var init_sync_manager = __esm({
41033
41031
 
41034
41032
  // ../../packages/core/project-cleanup.ts
41035
41033
  import { exec as exec6 } from "child_process";
41036
- import { promisify as promisify11 } from "util";
41034
+ import { promisify as promisify10 } from "util";
41037
41035
  async function cleanupProjectRuntime(project) {
41038
41036
  const projectName = project.name ?? project.id;
41039
41037
  try {
@@ -41092,7 +41090,7 @@ var execAsync6;
41092
41090
  var init_project_cleanup = __esm({
41093
41091
  "../../packages/core/project-cleanup.ts"() {
41094
41092
  "use strict";
41095
- execAsync6 = promisify11(exec6);
41093
+ execAsync6 = promisify10(exec6);
41096
41094
  }
41097
41095
  });
41098
41096
 
@@ -41382,25 +41380,26 @@ var init_repo_artifacts = __esm({
41382
41380
  });
41383
41381
 
41384
41382
  // ../../packages/core/bundle-exporter.ts
41385
- import { promisify as promisify12 } from "util";
41386
- import { exec as exec7, execFile as execFile7 } from "child_process";
41387
- var execAsync7, execFileAsync5;
41383
+ import { promisify as promisify11 } from "util";
41384
+ import { exec as exec7, execFile as execFile6 } from "child_process";
41385
+ var execAsync7, execFileAsync4;
41388
41386
  var init_bundle_exporter = __esm({
41389
41387
  "../../packages/core/bundle-exporter.ts"() {
41390
41388
  "use strict";
41391
41389
  init_shared();
41392
41390
  init_compose_scanner();
41393
41391
  init_dind_manager();
41394
- execAsync7 = promisify12(exec7);
41395
- execFileAsync5 = promisify12(execFile7);
41392
+ execAsync7 = promisify11(exec7);
41393
+ execFileAsync4 = promisify11(execFile6);
41396
41394
  }
41397
41395
  });
41398
41396
 
41399
41397
  // ../../packages/core/cloud.ts
41400
41398
  import fs27 from "fs/promises";
41399
+ import nodeProcess3 from "process";
41401
41400
  import path30 from "path";
41402
- import { execFile as execFile8 } from "child_process";
41403
- import { promisify as promisify13 } from "util";
41401
+ import { execFile as execFile7 } from "child_process";
41402
+ import { promisify as promisify12 } from "util";
41404
41403
  async function sessionPath(dir) {
41405
41404
  const d = dir ?? path30.join(await getAppSupportDir(), "secrets");
41406
41405
  await fs27.mkdir(d, { recursive: true, mode: 448 });
@@ -41417,7 +41416,7 @@ var init_cloud = __esm({
41417
41416
  init_store();
41418
41417
  init_bundle_exporter();
41419
41418
  init_supabase_dump();
41420
- execFileP2 = promisify13(execFile8);
41419
+ execFileP2 = promisify12(execFile7);
41421
41420
  REFRESH_BUFFER_MS = 60 * 1e3;
41422
41421
  }
41423
41422
  });
@@ -41685,13 +41684,13 @@ var init_engine = __esm({
41685
41684
 
41686
41685
  // ../../packages/core/isolation-drift.ts
41687
41686
  import { exec as exec8 } from "child_process";
41688
- import { promisify as promisify14 } from "util";
41687
+ import { promisify as promisify13 } from "util";
41689
41688
  var execAsync8, defaultRunner;
41690
41689
  var init_isolation_drift = __esm({
41691
41690
  "../../packages/core/isolation-drift.ts"() {
41692
41691
  "use strict";
41693
41692
  init_project_scanner();
41694
- execAsync8 = promisify14(exec8);
41693
+ execAsync8 = promisify13(exec8);
41695
41694
  defaultRunner = async (cmd) => {
41696
41695
  try {
41697
41696
  const { stdout } = await execAsync8(cmd, { timeout: 5e3 });
@@ -43310,7 +43309,7 @@ import os13 from "os";
43310
43309
  import path36 from "path";
43311
43310
  import crypto6 from "crypto";
43312
43311
  import readline3 from "readline";
43313
- import { execFile as execFile9, execFileSync as execFileSync3, spawn as spawn8 } from "child_process";
43312
+ import { execFile as execFile8, execFileSync as execFileSync3, spawn as spawn7 } from "child_process";
43314
43313
  function semver(tag) {
43315
43314
  const core2 = tag.replace(/^v/, "").split(/[-+]/)[0];
43316
43315
  const parts = core2.split(".").map((n) => parseInt(n, 10));
@@ -43453,7 +43452,7 @@ async function swapApp(newApp) {
43453
43452
  const shell = `rm -rf ${sq(INSTALLED_APP)} && mv ${sq(newApp)} ${sq(INSTALLED_APP)}`;
43454
43453
  const osa = `do shell script "${shell.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}" with administrator privileges`;
43455
43454
  await new Promise((resolve, reject) => {
43456
- execFile9("osascript", ["-e", osa], (err) => err ? reject(err) : resolve());
43455
+ execFile8("osascript", ["-e", osa], (err) => err ? reject(err) : resolve());
43457
43456
  });
43458
43457
  }
43459
43458
  function relaunchApp() {
@@ -43461,7 +43460,7 @@ function relaunchApp() {
43461
43460
  execFileSync3("pkill", ["-x", "Supbuddy"]);
43462
43461
  } catch {
43463
43462
  }
43464
- spawn8("open", [INSTALLED_APP], { detached: true, stdio: "ignore" }).unref();
43463
+ spawn7("open", [INSTALLED_APP], { detached: true, stdio: "ignore" }).unref();
43465
43464
  }
43466
43465
  async function runUpdate(opts = {}) {
43467
43466
  if (process.platform !== "darwin") {
@@ -43626,7 +43625,7 @@ __export(run_exports, {
43626
43625
  runDev: () => runDev,
43627
43626
  selectDevUrls: () => selectDevUrls
43628
43627
  });
43629
- import { spawn as spawn9, execSync as execSync2 } from "child_process";
43628
+ import { spawn as spawn8, execSync as execSync2 } from "child_process";
43630
43629
  import fs32 from "fs";
43631
43630
  import path37 from "path";
43632
43631
  function readMeta(startDir) {
@@ -43741,10 +43740,10 @@ async function runDev(rawArgv, opts = {}) {
43741
43740
  }
43742
43741
  return await new Promise((resolve) => {
43743
43742
  const filterBanner = framework === "next" || framework === "vite";
43744
- const child = filterBanner ? spawn9(argv[0], argv.slice(1), {
43743
+ const child = filterBanner ? spawn8(argv[0], argv.slice(1), {
43745
43744
  stdio: ["inherit", "pipe", "pipe"],
43746
43745
  env: { ...process.env, FORCE_COLOR: process.env.FORCE_COLOR ?? "1" }
43747
- }) : spawn9(argv[0], argv.slice(1), { stdio: "inherit", env: process.env });
43746
+ }) : spawn8(argv[0], argv.slice(1), { stdio: "inherit", env: process.env });
43748
43747
  if (filterBanner) {
43749
43748
  const drop = (line) => isBoundBannerLine(line, ip);
43750
43749
  if (child.stdout) pipeFiltered(child.stdout, process.stdout, drop);
@@ -25933,10 +25933,10 @@ function parseAddonsExtension(composeData) {
25933
25933
  if (block == null) return null;
25934
25934
  return SupbuddyAddonsExtensionSchema.parse(block);
25935
25935
  }
25936
- var define_process_env_default$g = {};
25936
+ var define_process_env_default$f = {};
25937
25937
  const WORKER_PORT_ENV = "WORKER_PORT";
25938
25938
  const DEFAULT_WORKER_PORT = 48760;
25939
- function resolveWorkerPort(env = typeof process !== "undefined" ? define_process_env_default$g : {}) {
25939
+ function resolveWorkerPort(env = typeof process !== "undefined" ? define_process_env_default$f : {}) {
25940
25940
  const raw = env[WORKER_PORT_ENV];
25941
25941
  if (raw !== void 0 && raw !== "") {
25942
25942
  const n = Number(raw);
@@ -26115,7 +26115,7 @@ function planGlobalTldCascade(projects, mappings, newTld) {
26115
26115
  });
26116
26116
  return { projectUpdates, mappingUpdates };
26117
26117
  }
26118
- var define_process_env_default$f = {};
26118
+ var define_process_env_default$e = {};
26119
26119
  function coerceProjectName(name2, fallback = "Untitled project") {
26120
26120
  if (typeof name2 === "string") return name2;
26121
26121
  if (name2 && typeof name2.name === "string") return name2.name;
@@ -26612,12 +26612,12 @@ function schedulePersist() {
26612
26612
  }, 1e3);
26613
26613
  }
26614
26614
  async function getAppSupportDir() {
26615
- const override = define_process_env_default$f.SUPBUDDY_STATE_DIR;
26615
+ const override = define_process_env_default$e.SUPBUDDY_STATE_DIR;
26616
26616
  if (override) {
26617
26617
  await fs.mkdir(override, { recursive: true });
26618
26618
  return override;
26619
26619
  }
26620
- if (define_process_env_default$f.VITEST || false) {
26620
+ if (define_process_env_default$e.VITEST || false) {
26621
26621
  const testDir = path.join(os$1.tmpdir(), `supbuddy-vitest-${process.pid}`);
26622
26622
  await fs.mkdir(testDir, { recursive: true });
26623
26623
  return testDir;
@@ -26627,9 +26627,9 @@ async function getAppSupportDir() {
26627
26627
  if (platform === "darwin") {
26628
26628
  userDataPath = path.join(os$1.homedir(), "Library", "Application Support", "Supbuddy");
26629
26629
  } else if (platform === "win32") {
26630
- userDataPath = path.join(define_process_env_default$f.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"), "Supbuddy");
26630
+ userDataPath = path.join(define_process_env_default$e.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"), "Supbuddy");
26631
26631
  } else {
26632
- userDataPath = path.join(define_process_env_default$f.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"), "Supbuddy");
26632
+ userDataPath = path.join(define_process_env_default$e.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"), "Supbuddy");
26633
26633
  }
26634
26634
  await fs.mkdir(userDataPath, { recursive: true });
26635
26635
  return userDataPath;
@@ -26846,7 +26846,7 @@ function planProjectActivation(input) {
26846
26846
  releaseGlobalRefs: input.enabledChanged && !input.enabled
26847
26847
  };
26848
26848
  }
26849
- var define_process_env_default$e = {};
26849
+ var define_process_env_default$d = {};
26850
26850
  async function getCaddyfileDir() {
26851
26851
  const platform = process.platform;
26852
26852
  let userDataPath;
@@ -26854,12 +26854,12 @@ async function getCaddyfileDir() {
26854
26854
  userDataPath = path.join(os$1.homedir(), "Library", "Application Support", "Supbuddy");
26855
26855
  } else if (platform === "win32") {
26856
26856
  userDataPath = path.join(
26857
- define_process_env_default$e.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"),
26857
+ define_process_env_default$d.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"),
26858
26858
  "Supbuddy"
26859
26859
  );
26860
26860
  } else {
26861
26861
  userDataPath = path.join(
26862
- define_process_env_default$e.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
26862
+ define_process_env_default$d.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
26863
26863
  "Supbuddy"
26864
26864
  );
26865
26865
  }
@@ -27540,15 +27540,6 @@ async function isDockerRunning() {
27540
27540
  }
27541
27541
  async function isSupabaseInitialized(projectPath) {
27542
27542
  try {
27543
- const { exec: exec2 } = await __vitePreload(async () => {
27544
- const { exec: exec22 } = await import("child_process");
27545
- return { exec: exec22 };
27546
- }, false ? __VITE_PRELOAD__ : void 0);
27547
- const { promisify: promisify2 } = await __vitePreload(async () => {
27548
- const { promisify: promisify22 } = await import("util");
27549
- return { promisify: promisify22 };
27550
- }, false ? __VITE_PRELOAD__ : void 0);
27551
- const execAsync2 = promisify2(exec2);
27552
27543
  const fs2 = await __vitePreload(() => import("fs/promises"), false ? __VITE_PRELOAD__ : void 0);
27553
27544
  const path2 = await __vitePreload(() => import("path"), false ? __VITE_PRELOAD__ : void 0);
27554
27545
  const supabasePath = path2.join(projectPath, "supabase");
@@ -28290,7 +28281,7 @@ function isMappingServeable(mapping, getProject) {
28290
28281
  const project = getProject(mapping.projectId);
28291
28282
  return !!project && project.enabled === true;
28292
28283
  }
28293
- var define_process_env_default$d = {};
28284
+ var define_process_env_default$c = {};
28294
28285
  let caddyProcess = null;
28295
28286
  let stdoutBuffer = "";
28296
28287
  let stderrBuffer = "";
@@ -28329,9 +28320,13 @@ function getCaddyBinaryPath() {
28329
28320
  if (bundledBinDir) {
28330
28321
  return path.join(bundledBinDir, binaryName);
28331
28322
  }
28332
- {
28333
- return path.join(process.resourcesPath, "bin", binaryName);
28323
+ const resourcesPath = process.resourcesPath;
28324
+ if (!resourcesPath) {
28325
+ throw new Error(
28326
+ `cannot locate ${binaryName}: SUPBUDDY_BIN_DIR is not set and this runtime has no process.resourcesPath (that is Electron-only). The host must set SUPBUDDY_BIN_DIR to the directory holding the bundled binaries.`
28327
+ );
28334
28328
  }
28329
+ return path.join(resourcesPath, "bin", binaryName);
28335
28330
  }
28336
28331
  async function reapStaleCaddyProcesses() {
28337
28332
  if (process.platform === "win32") return;
@@ -28427,9 +28422,9 @@ async function doStartCaddyServer() {
28427
28422
  console.log(`[Caddy] Config: ${caddyfilePath}`);
28428
28423
  console.log(`[Caddy] Data directory: ${dataDir}`);
28429
28424
  const isDev = false;
28430
- const homeDir = define_process_env_default$d.HOME || require("os").homedir();
28425
+ const homeDir = define_process_env_default$c.HOME || require("os").homedir();
28431
28426
  const caddyEnv = {
28432
- ...define_process_env_default$d,
28427
+ ...define_process_env_default$c,
28433
28428
  HOME: homeDir,
28434
28429
  XDG_DATA_HOME: dataDir,
28435
28430
  XDG_CONFIG_HOME: path.dirname(caddyfilePath)
@@ -28860,7 +28855,7 @@ function deriveReportedStatus(tracked, live, opts = {}) {
28860
28855
  if (tracked === "running" && !live.caddyAlive) return "crashed";
28861
28856
  return tracked;
28862
28857
  }
28863
- var define_process_env_default$c = {};
28858
+ var define_process_env_default$b = {};
28864
28859
  const defaultElevate$1 = async ({ command, prompt, tmpFiles = [] }) => {
28865
28860
  if (!process.send) {
28866
28861
  return { success: false, error: "No host bridge available for elevation" };
@@ -28888,12 +28883,12 @@ async function getCaddyDataDir() {
28888
28883
  userDataPath = path.join(os$1.homedir(), "Library", "Application Support", "Supbuddy");
28889
28884
  } else if (platform === "win32") {
28890
28885
  userDataPath = path.join(
28891
- define_process_env_default$c.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"),
28886
+ define_process_env_default$b.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"),
28892
28887
  "Supbuddy"
28893
28888
  );
28894
28889
  } else {
28895
28890
  userDataPath = path.join(
28896
- define_process_env_default$c.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
28891
+ define_process_env_default$b.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
28897
28892
  "Supbuddy"
28898
28893
  );
28899
28894
  }
@@ -29270,7 +29265,7 @@ const caddyCaManager = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
29270
29265
  parseKeychainSha1Fingerprints,
29271
29266
  uninstallCaddyCA
29272
29267
  }, Symbol.toStringTag, { value: "Module" }));
29273
- var define_process_env_default$b = {};
29268
+ var define_process_env_default$a = {};
29274
29269
  const execFileP$1 = util$1.promisify(child_process.execFile);
29275
29270
  const PLIST_LABEL = "com.cueplusplus.supbuddy.bundled-runtime-ca-trust";
29276
29271
  const MANAGED_ENV_VARS = ["NODE_EXTRA_CA_CERTS"];
@@ -29283,12 +29278,12 @@ function getSupbuddyDataDir() {
29283
29278
  }
29284
29279
  if (platform === "win32") {
29285
29280
  return path.join(
29286
- define_process_env_default$b.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"),
29281
+ define_process_env_default$a.APPDATA || path.join(os$1.homedir(), "AppData", "Roaming"),
29287
29282
  "Supbuddy"
29288
29283
  );
29289
29284
  }
29290
29285
  return path.join(
29291
- define_process_env_default$b.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
29286
+ define_process_env_default$a.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
29292
29287
  "Supbuddy"
29293
29288
  );
29294
29289
  }
@@ -29327,7 +29322,7 @@ function planCaEnvSanitization(env) {
29327
29322
  const setNodeExtra = ne == null || ne === "" || isSupbuddyOwnedCaPath(ne) ? getBundlePath() : null;
29328
29323
  return { unset, setNodeExtra };
29329
29324
  }
29330
- function getSanitizedSpawnEnv(base = define_process_env_default$b) {
29325
+ function getSanitizedSpawnEnv(base = define_process_env_default$a) {
29331
29326
  const out = { ...base };
29332
29327
  const plan2 = planCaEnvSanitization(out);
29333
29328
  for (const v of plan2.unset) delete out[v];
@@ -29337,10 +29332,10 @@ function getSanitizedSpawnEnv(base = define_process_env_default$b) {
29337
29332
  return out;
29338
29333
  }
29339
29334
  function sanitizeOwnProcessEnv() {
29340
- const plan2 = planCaEnvSanitization(define_process_env_default$b);
29341
- for (const v of plan2.unset) delete define_process_env_default$b[v];
29335
+ const plan2 = planCaEnvSanitization(define_process_env_default$a);
29336
+ for (const v of plan2.unset) delete define_process_env_default$a[v];
29342
29337
  if (plan2.setNodeExtra && fsSync.existsSync(plan2.setNodeExtra)) {
29343
- define_process_env_default$b.NODE_EXTRA_CA_CERTS = plan2.setNodeExtra;
29338
+ define_process_env_default$a.NODE_EXTRA_CA_CERTS = plan2.setNodeExtra;
29344
29339
  }
29345
29340
  if (plan2.unset.length) {
29346
29341
  console.log("[brt] sanitized stale CA replace-vars from daemon env:", plan2.unset.join(", "));
@@ -29471,7 +29466,7 @@ async function scanProcessesForNodeExtra() {
29471
29466
  const PROBEABLE_SHELLS = /* @__PURE__ */ new Set(["sh", "bash", "zsh", "ksh", "dash", "fish"]);
29472
29467
  async function probeLoginShellNodeExtra() {
29473
29468
  if (process.platform === "win32") return null;
29474
- const shell = define_process_env_default$b.SHELL || "/bin/sh";
29469
+ const shell = define_process_env_default$a.SHELL || "/bin/sh";
29475
29470
  if (!PROBEABLE_SHELLS.has(path.basename(shell))) return null;
29476
29471
  try {
29477
29472
  const { stdout } = await execFileP$1(
@@ -29481,8 +29476,8 @@ async function probeLoginShellNodeExtra() {
29481
29476
  // A clean slate — HOME/USER only, so the profile chain is the ONLY source.
29482
29477
  env: {
29483
29478
  HOME: os$1.homedir(),
29484
- USER: define_process_env_default$b.USER ?? "",
29485
- LOGNAME: define_process_env_default$b.LOGNAME ?? define_process_env_default$b.USER ?? "",
29479
+ USER: define_process_env_default$a.USER ?? "",
29480
+ LOGNAME: define_process_env_default$a.LOGNAME ?? define_process_env_default$a.USER ?? "",
29486
29481
  PATH: "/usr/bin:/bin:/usr/sbin:/sbin",
29487
29482
  TERM: "dumb"
29488
29483
  },
@@ -29522,7 +29517,7 @@ function getPlistPath() {
29522
29517
  }
29523
29518
  function getEnvironmentDPath() {
29524
29519
  return path.join(
29525
- define_process_env_default$b.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
29520
+ define_process_env_default$a.XDG_CONFIG_HOME || path.join(os$1.homedir(), ".config"),
29526
29521
  "environment.d",
29527
29522
  "supbuddy-ca.conf"
29528
29523
  );
@@ -29979,7 +29974,7 @@ async function getStatus(lastRefreshedAt, opts = {}) {
29979
29974
  observations.push({ origin: "managed", value: env.NODE_EXTRA_CA_CERTS, detail: getMethod() });
29980
29975
  }
29981
29976
  if (effective.loginShell) {
29982
- observations.push({ origin: "login-shell", value: effective.loginShell, detail: define_process_env_default$b.SHELL ?? "login shell" });
29977
+ observations.push({ origin: "login-shell", value: effective.loginShell, detail: define_process_env_default$a.SHELL ?? "login shell" });
29983
29978
  }
29984
29979
  observations.push(...effective.processes);
29985
29980
  const classified = classifyNodeExtraCaCerts(observations, bundlePath);
@@ -30197,7 +30192,7 @@ async function testTrust(opts) {
30197
30192
  try {
30198
30193
  const { stdout, stderr } = await execFileP$1(process.execPath, ["-e", script], {
30199
30194
  env: {
30200
- ...define_process_env_default$b,
30195
+ ...define_process_env_default$a,
30201
30196
  NODE_EXTRA_CA_CERTS: bundlePath
30202
30197
  },
30203
30198
  encoding: "utf-8",
@@ -30412,7 +30407,7 @@ fi
30412
30407
  }
30413
30408
  async function canUseSudo() {
30414
30409
  try {
30415
- const { stdout } = await execAsync$c("sudo -n true 2>&1");
30410
+ await execAsync$c("sudo -n true 2>&1");
30416
30411
  return true;
30417
30412
  } catch (error) {
30418
30413
  return false;
@@ -33795,12 +33790,21 @@ const composeScanner = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
33795
33790
  resolveComposeProject,
33796
33791
  scanDockerCompose
33797
33792
  }, Symbol.toStringTag, { value: "Module" }));
33798
- var define_process_env_default$a = {};
33793
+ var define_process_env_default$9 = {};
33799
33794
  const runningScripts = /* @__PURE__ */ new Map();
33800
33795
  const MAX_LOG_LINES = 1e3;
33796
+ function compareNodeVersions(a, b) {
33797
+ const parts = (v) => v.replace(/^v/, "").split(".").map((n) => Number.parseInt(n, 10) || 0);
33798
+ const [x, y] = [parts(a), parts(b)];
33799
+ for (let i2 = 0; i2 < Math.max(x.length, y.length); i2++) {
33800
+ const d = (x[i2] ?? 0) - (y[i2] ?? 0);
33801
+ if (d !== 0) return d;
33802
+ }
33803
+ return 0;
33804
+ }
33801
33805
  function getAugmentedPath() {
33802
- const currentPath = define_process_env_default$a.PATH || "";
33803
- const homeDir = define_process_env_default$a.HOME || require("os").homedir() || "";
33806
+ const currentPath = define_process_env_default$9.PATH || "";
33807
+ const homeDir = define_process_env_default$9.HOME || require("os").homedir() || "";
33804
33808
  const extraPaths = [
33805
33809
  "/opt/homebrew/bin",
33806
33810
  "/opt/homebrew/sbin",
@@ -33812,7 +33816,7 @@ function getAugmentedPath() {
33812
33816
  if (homeDir) {
33813
33817
  const nvmDir = path__namespace.join(homeDir, ".nvm", "versions", "node");
33814
33818
  try {
33815
- const versions = fsSync.promises.readdirSync(nvmDir).filter((v) => v.startsWith("v")).sort().reverse();
33819
+ const versions = fsSync.readdirSync(nvmDir).filter((v) => v.startsWith("v")).sort(compareNodeVersions).reverse();
33816
33820
  for (const v of versions) {
33817
33821
  extraPaths.push(path__namespace.join(nvmDir, v, "bin"));
33818
33822
  }
@@ -33869,7 +33873,7 @@ async function startScript(projectId, projectPath, scriptName, command, packageM
33869
33873
  console.log(`[ScriptManager] Starting script: ${scriptName} (${packageManager} run ${scriptName}) in ${projectPath}`);
33870
33874
  console.log(`[ScriptManager] PATH: ${augmentedPath}`);
33871
33875
  try {
33872
- child_process.execSync(`command -v ${packageManager}`, { env: getSanitizedSpawnEnv({ ...define_process_env_default$a, PATH: augmentedPath }), stdio: "pipe" });
33876
+ child_process.execSync(`command -v ${packageManager}`, { env: getSanitizedSpawnEnv({ ...define_process_env_default$9, PATH: augmentedPath }), stdio: "pipe" });
33873
33877
  } catch {
33874
33878
  const installHint = packageManager === "yarn" ? "Install it with: npm install -g yarn" : packageManager === "pnpm" ? "Install it with: npm install -g pnpm" : "Ensure Node.js is installed and npm is available in your PATH";
33875
33879
  const errorMsg = `"${packageManager}" is not installed or not found in PATH. ${installHint}`;
@@ -33898,7 +33902,7 @@ async function startScript(projectId, projectPath, scriptName, command, packageM
33898
33902
  shell: true,
33899
33903
  // Sanitize so a stale inherited Supbuddy-owned SSL_CERT_FILE (replace-
33900
33904
  // semantics, honored by Node 26) never reaches the user's dev server.
33901
- env: getSanitizedSpawnEnv({ ...define_process_env_default$a, PATH: augmentedPath, FORCE_COLOR: "1" })
33905
+ env: getSanitizedSpawnEnv({ ...define_process_env_default$9, PATH: augmentedPath, FORCE_COLOR: "1" })
33902
33906
  });
33903
33907
  } catch (err) {
33904
33908
  console.error(`[ScriptManager] Failed to spawn: ${err.message}`);
@@ -34084,6 +34088,7 @@ const scriptManager = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin
34084
34088
  __proto__: null,
34085
34089
  detectPackageManager,
34086
34090
  getAllRunningScripts,
34091
+ getAugmentedPath,
34087
34092
  getScriptLogs,
34088
34093
  getScriptStatus,
34089
34094
  restartScript,
@@ -34856,15 +34861,6 @@ async function detectSupabaseSDK(projectPath) {
34856
34861
  async function scanDockerServices(projectPath) {
34857
34862
  const services = [];
34858
34863
  try {
34859
- const { exec } = await __vitePreload(async () => {
34860
- const { exec: exec2 } = await import("child_process");
34861
- return { exec: exec2 };
34862
- }, false ? __VITE_PRELOAD__ : void 0);
34863
- const { promisify } = await __vitePreload(async () => {
34864
- const { promisify: promisify2 } = await import("util");
34865
- return { promisify: promisify2 };
34866
- }, false ? __VITE_PRELOAD__ : void 0);
34867
- const execAsync2 = promisify(exec);
34868
34864
  const composeFiles = ["docker-compose.yml", "docker-compose.yaml", "compose.yml", "compose.yaml"];
34869
34865
  let composeFile = null;
34870
34866
  for (const file of composeFiles) {
@@ -43559,7 +43555,6 @@ function checkScope(tool, scopes) {
43559
43555
  }
43560
43556
  class RateLimiter {
43561
43557
  buckets = /* @__PURE__ */ new Map();
43562
- now = () => Date.now();
43563
43558
  // Test seam: lets tests fast-forward without actually waiting.
43564
43559
  testOffset = 0;
43565
43560
  advanceTime(ms2) {
@@ -43710,9 +43705,9 @@ class McpAuditLog extends require$$0$1.EventEmitter {
43710
43705
  }
43711
43706
  }
43712
43707
  }
43713
- var define_process_env_default$9 = {};
43708
+ var define_process_env_default$8 = {};
43714
43709
  function getAuditPath() {
43715
- const dir = define_process_env_default$9.SUPBUDDY_STATE_DIR ?? path.join(os$1.homedir(), "Library", "Application Support", "Supbuddy");
43710
+ const dir = define_process_env_default$8.SUPBUDDY_STATE_DIR ?? path.join(os$1.homedir(), "Library", "Application Support", "Supbuddy");
43716
43711
  return path.join(dir, "mcp-audit.jsonl");
43717
43712
  }
43718
43713
  const cap = () => useStore.getState().settings.mcp?.audit_cap ?? 5e3;
@@ -44593,13 +44588,21 @@ async function checksumFile(filePath) {
44593
44588
  const content = await fs.readFile(filePath);
44594
44589
  return `sha256:${crypto$1.createHash("sha256").update(content).digest("hex")}`;
44595
44590
  }
44591
+ function normalizeComposePorts(ports) {
44592
+ if (!ports) return void 0;
44593
+ return ports.map((p) => {
44594
+ if (typeof p === "string") return p;
44595
+ const base = p.published === void 0 || p.published === "" ? String(p.target ?? "") : `${p.published}:${p.target ?? ""}`;
44596
+ return p.protocol ? `${base}/${p.protocol}` : base;
44597
+ });
44598
+ }
44596
44599
  async function exportStackOnlyBundle(project) {
44597
44600
  if (!project.path) throw new Error("Project has no path");
44598
44601
  const resolved = await resolveComposeProject(project.path);
44599
44602
  const services = resolved ? Object.entries(resolved.services).map(([name2, m]) => ({
44600
44603
  name: name2,
44601
44604
  image: m.config.image,
44602
- ports: m.config.ports
44605
+ ports: normalizeComposePorts(m.config.ports)
44603
44606
  })) : [];
44604
44607
  let envSanitized = null;
44605
44608
  try {
@@ -44857,7 +44860,6 @@ async function dumpInto(dir, container) {
44857
44860
  const { size } = await fs.stat(file);
44858
44861
  return { dir, file, bytes: size, sha256: hash.digest("hex") };
44859
44862
  }
44860
- var define_process_env_default$8 = {};
44861
44863
  const execFileP = util$1.promisify(child_process.execFile);
44862
44864
  const REFRESH_BUFFER_MS = 60 * 1e3;
44863
44865
  function toSession(t, emailFallback) {
@@ -45132,11 +45134,21 @@ async function cloudTeardownStack(cfg, session, stackId) {
45132
45134
  }
45133
45135
  let currentSession = null;
45134
45136
  function cloudConfigFromEnv() {
45135
- const supabaseUrl = define_process_env_default$8.SUPBUDDY_CLOUD_SUPABASE_URL;
45136
- const anonKey = define_process_env_default$8.SUPBUDDY_CLOUD_ANON_KEY;
45137
- const apiBase = define_process_env_default$8.SUPBUDDY_CLOUD_API_BASE;
45137
+ const env = nodeProcess.env;
45138
+ const supabaseUrl = env.SUPBUDDY_CLOUD_SUPABASE_URL || bakedCloudSupabaseUrl();
45139
+ const anonKey = env.SUPBUDDY_CLOUD_ANON_KEY || bakedCloudAnonKey();
45140
+ const apiBase = env.SUPBUDDY_CLOUD_API_BASE || bakedCloudApiBase();
45138
45141
  return supabaseUrl && anonKey && apiBase ? { supabaseUrl, anonKey, apiBase } : null;
45139
45142
  }
45143
+ function bakedCloudSupabaseUrl() {
45144
+ return "https://ascxsovqvxyvpgvhjszo.supabase.co";
45145
+ }
45146
+ function bakedCloudAnonKey() {
45147
+ return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFzY3hzb3Zxdnh5dnBndmhqc3pvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzU5MTMxNzEsImV4cCI6MjA5MTQ4OTE3MX0.2Gb0z5FYglsQlm5QdfYS5y5TZO-NoCwIiTXWCk9C_Ds";
45148
+ }
45149
+ function bakedCloudApiBase() {
45150
+ return "https://supbuddy.cloud";
45151
+ }
45140
45152
  function getCloudState() {
45141
45153
  return {
45142
45154
  configured: cloudConfigFromEnv() !== null,
@@ -47173,8 +47185,6 @@ function envPrefixForApp(app) {
47173
47185
  return "NEXT_PUBLIC_";
47174
47186
  case "vite":
47175
47187
  return "VITE_";
47176
- case "expo":
47177
- return "EXPO_PUBLIC_";
47178
47188
  default:
47179
47189
  return "";
47180
47190
  }
@@ -48670,9 +48680,14 @@ ${scriptsSection}
48670
48680
  }
48671
48681
  function renderMappingsMd(ctx) {
48672
48682
  const rows = ctx.mappings.length === 0 ? "_No mappings._" : [
48673
- "| Domain | Port | HTTPS | Enabled |",
48674
- "|--------|------|-------|---------|",
48675
- ...ctx.mappings.map((m) => `| ${m.domain} | ${m.port} | ${m.https ? "yes" : "no"} | ${m.enabled ? "yes" : "no"} |`)
48683
+ // There was an HTTPS column here reading `m.https`, a field DomainMapping does not have — so it
48684
+ // was undefined for every row and rendered "no" for every mapping, while Caddy serves them all
48685
+ // over HTTPS and this same bundle hands agents https:// URLs elsewhere. The URL is what a reader
48686
+ // actually needs, and it cannot drift from the scheme because the rest of the context builds it
48687
+ // with the same function.
48688
+ "| Domain | Port | URL | Enabled |",
48689
+ "|--------|------|-----|---------|",
48690
+ ...ctx.mappings.map((m) => `| ${m.domain} | ${m.port} | ${buildProxiedUrl(m.domain, ctx.proxyState)} | ${m.enabled ? "yes" : "no"} |`)
48676
48691
  ].join("\n");
48677
48692
  return HEADER(".supbuddy/mappings.md") + `# Domain mappings
48678
48693
 
@@ -50640,7 +50655,6 @@ const isolationBridge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
50640
50655
  runIsolationSwitch
50641
50656
  }, Symbol.toStringTag, { value: "Module" }));
50642
50657
  var define_process_env_default$5 = {};
50643
- util$1.promisify(child_process.execFile);
50644
50658
  function getCacheDir() {
50645
50659
  const override = define_process_env_default$5.SUPBUDDY_STATE_DIR;
50646
50660
  if (override) return path.join(override, "image-cache");
@@ -51250,7 +51264,11 @@ async function dumpVm(dind2, vmdb, dumpArgs, outFile) {
51250
51264
  function _pgRestoreFile(child, rs) {
51251
51265
  return new Promise((resolve, reject) => {
51252
51266
  let err = "";
51253
- child.stderr.on("data", (d) => err += d.toString());
51267
+ child.stderr?.on("data", (d) => err += d.toString());
51268
+ if (!child.stdin) {
51269
+ reject(new Error("pg_restore was spawned without a writable stdin, so the dump cannot be fed to it"));
51270
+ return;
51271
+ }
51254
51272
  rs.on("error", (e) => reject(e));
51255
51273
  rs.pipe(child.stdin);
51256
51274
  child.on("error", (e) => reject(e));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supbuddy",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
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",