@mindstudio-ai/local-model-tunnel 0.5.56 → 0.5.57

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.
@@ -2080,16 +2080,16 @@ var DevRunner = class {
2080
2080
  );
2081
2081
  }
2082
2082
  const methods = auth.methods ?? [];
2083
- const hasEmail = methods.some((m) => m.includes("email"));
2084
- const hasPhone = methods.some((m) => m.includes("phone"));
2083
+ const hasEmail = methods.includes("email-code");
2084
+ const hasSms = methods.includes("sms-code");
2085
2085
  let opts;
2086
2086
  if (hasEmail) {
2087
2087
  opts = { email: TEST_USER_EMAIL };
2088
- } else if (hasPhone) {
2088
+ } else if (hasSms) {
2089
2089
  opts = { phone: TEST_USER_PHONE };
2090
2090
  } else {
2091
2091
  throw new Error(
2092
- `Cannot resolve userId="${TEST_USER_SENTINEL}": auth.methods in mindstudio.json does not include an email- or phone-based method (got ${JSON.stringify(methods)}).`
2092
+ `Cannot resolve userId="${TEST_USER_SENTINEL}": auth.methods in mindstudio.json must include "email-code" or "sms-code" (got ${JSON.stringify(methods)}).`
2093
2093
  );
2094
2094
  }
2095
2095
  const { user } = await createAuthSession(this.appId, opts);
@@ -2496,7 +2496,7 @@ var DevProxy = class _DevProxy {
2496
2496
  handleWsConnection(ws, req) {
2497
2497
  let clientId = null;
2498
2498
  const remoteAddr = req.socket.remoteAddress ?? "";
2499
- const isLoopback = remoteAddr === "127.0.0.1" || remoteAddr === "::1" || remoteAddr === "::ffff:127.0.0.1";
2499
+ const isLoopback = remoteAddr === "::1" || /^127\./.test(remoteAddr) || /^::ffff:127\./i.test(remoteAddr);
2500
2500
  const helloTimeout = setTimeout(() => {
2501
2501
  if (!clientId) {
2502
2502
  log.warn(
@@ -2522,7 +2522,7 @@ var DevProxy = class _DevProxy {
2522
2522
  const helloUrl = String(msg.url || "");
2523
2523
  const isSandboxBrowser = isLoopback && msg.sandbox === true;
2524
2524
  const mode = isSandboxBrowser ? "headless" : msg.mode === "iframe" ? "iframe" : msg.mode === "mirror" ? "mirror" : "standalone";
2525
- log.debug("proxy", "WS hello received", {
2525
+ log.info("proxy", "WS hello received", {
2526
2526
  remoteAddr,
2527
2527
  isLoopback,
2528
2528
  helloMode: msg.mode,
@@ -2530,6 +2530,21 @@ var DevProxy = class _DevProxy {
2530
2530
  helloUrl,
2531
2531
  resolvedMode: mode
2532
2532
  });
2533
+ const looksLikeSandbox = msg.sandbox === true || helloUrl.includes("ms_sandbox=1");
2534
+ if (looksLikeSandbox && mode !== "headless") {
2535
+ log.warn(
2536
+ "proxy",
2537
+ "Client looks like the sandbox browser but did not register as headless",
2538
+ {
2539
+ remoteAddr,
2540
+ isLoopback,
2541
+ helloSandbox: msg.sandbox,
2542
+ helloUrl,
2543
+ resolvedMode: mode,
2544
+ hint: "The loopback check probably failed. See proxy.ts handleWsConnection isLoopback regex."
2545
+ }
2546
+ );
2547
+ }
2533
2548
  const viewport = msg.viewport || {
2534
2549
  w: 0,
2535
2550
  h: 0
@@ -3464,4 +3479,4 @@ export {
3464
3479
  watchTableFiles,
3465
3480
  watchConfigFile
3466
3481
  };
3467
- //# sourceMappingURL=chunk-ERAJTIOM.js.map
3482
+ //# sourceMappingURL=chunk-4Y45MX5M.js.map