webmux 0.33.0 → 0.34.0

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.
@@ -6965,7 +6965,7 @@ import { networkInterfaces } from "os";
6965
6965
  // package.json
6966
6966
  var package_default = {
6967
6967
  name: "webmux",
6968
- version: "0.33.0",
6968
+ version: "0.34.0",
6969
6969
  description: "Web dashboard for workmux \u2014 browser UI with embedded terminals, PR monitoring, and CI integration",
6970
6970
  type: "module",
6971
6971
  repository: {
@@ -15558,7 +15558,7 @@ function buildDockerRuntimeBootstrap(runtimeEnvPath) {
15558
15558
  function buildBuiltInAgentInvocation(input) {
15559
15559
  const promptSuffix = input.prompt ? ` -- ${quoteShell(input.prompt)}` : "";
15560
15560
  if (input.agent === "codex") {
15561
- const hooksFlag = " --enable codex_hooks";
15561
+ const hooksFlag = " --enable hooks";
15562
15562
  const yoloFlag2 = input.yolo ? " --yolo" : "";
15563
15563
  if (input.launchMode === "resume") {
15564
15564
  return `codex${hooksFlag}${yoloFlag2} resume --last${promptSuffix}`;
@@ -20949,16 +20949,36 @@ function startServer(port) {
20949
20949
  function actualPort(server, requested) {
20950
20950
  return server.port ?? requested;
20951
20951
  }
20952
+ var MAX_INCREMENTAL_BIND_ATTEMPTS = 100;
20953
+ var PORT_STRICT = Bun.env.WEBMUX_PORT_STRICT === "1";
20952
20954
  function bindServer() {
20953
- try {
20954
- return actualPort(startServer(PORT), PORT);
20955
- } catch (err2) {
20956
- const code = err2?.code;
20957
- if (code !== "EADDRINUSE")
20955
+ if (PORT_STRICT) {
20956
+ try {
20957
+ return actualPort(startServer(PORT), PORT);
20958
+ } catch (err2) {
20959
+ const code = err2?.code;
20960
+ if (code === "EADDRINUSE") {
20961
+ log.error(`[serve] port ${PORT} is in use and was set explicitly; drop --port / PORT to let webmux pick a free port`);
20962
+ }
20958
20963
  throw err2;
20959
- log.info(`[serve] port ${PORT} in use; binding to a free port`);
20960
- return actualPort(startServer(0), 0);
20964
+ }
20961
20965
  }
20966
+ let candidate = PORT;
20967
+ for (let attempt = 0;attempt < MAX_INCREMENTAL_BIND_ATTEMPTS; attempt++) {
20968
+ try {
20969
+ const server = startServer(candidate);
20970
+ if (attempt > 0)
20971
+ log.info(`[serve] port ${PORT} in use; bound to ${actualPort(server, candidate)}`);
20972
+ return actualPort(server, candidate);
20973
+ } catch (err2) {
20974
+ const code = err2?.code;
20975
+ if (code !== "EADDRINUSE")
20976
+ throw err2;
20977
+ candidate += 1;
20978
+ }
20979
+ }
20980
+ log.info(`[serve] ports ${PORT}..${PORT + MAX_INCREMENTAL_BIND_ATTEMPTS - 1} all in use; falling back to an OS-picked port`);
20981
+ return actualPort(startServer(0), 0);
20962
20982
  }
20963
20983
  var BOUND_PORT = bindServer();
20964
20984
  var instanceRegistry = createInstanceRegistry();