webmux 0.35.0 → 0.36.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.
package/bin/webmux.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -954,10 +972,10 @@ var require_src = __commonJS((exports, module) => {
954
972
  module.exports = { cursor, scroll, erase, beep };
955
973
  });
956
974
 
957
- // node_modules/.bun/@clack+core@1.3.1/node_modules/@clack/core/dist/index.mjs
975
+ // node_modules/.bun/@clack+core@1.4.0/node_modules/@clack/core/dist/index.mjs
958
976
  import { styleText as v } from "util";
959
977
  import { stdout as x, stdin as D } from "process";
960
- import E from "readline";
978
+ import G from "readline";
961
979
  function f(r, t, s) {
962
980
  if (!s.some((o) => !o.disabled))
963
981
  return r;
@@ -991,7 +1009,7 @@ function C(r, t) {
991
1009
  return true;
992
1010
  return false;
993
1011
  }
994
- function z(r, t) {
1012
+ function Y(r, t) {
995
1013
  if (r === t)
996
1014
  return;
997
1015
  const s = r.split(`
@@ -1001,14 +1019,14 @@ function z(r, t) {
1001
1019
  s[o] !== e[o] && n.push(o);
1002
1020
  return { lines: n, numLinesBefore: s.length, numLinesAfter: e.length, numLines: i };
1003
1021
  }
1004
- function q(r) {
1022
+ function R(r) {
1005
1023
  return r === k;
1006
1024
  }
1007
1025
  function w(r, t) {
1008
1026
  const s = r;
1009
1027
  s.isTTY && s.setRawMode(t);
1010
1028
  }
1011
- function W(r, t, s, e = s, i = s, n) {
1029
+ function B(r, t, s, e = s, i = s, n) {
1012
1030
  const o = A(r ?? x);
1013
1031
  return wrapAnsi(t, o - s.length, { hard: true, trim: false }).split(`
1014
1032
  `).map((u, a, l) => {
@@ -1017,55 +1035,17 @@ function W(r, t, s, e = s, i = s, n) {
1017
1035
  }).join(`
1018
1036
  `);
1019
1037
  }
1020
- function B(r, t) {
1021
- if (r === undefined || t.length === 0)
1022
- return 0;
1023
- const s = t.findIndex((e) => e.value === r);
1024
- return s !== -1 ? s : 0;
1025
- }
1026
- function J(r, t) {
1027
- return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
1028
- }
1029
- function H(r, t) {
1030
- if (t)
1031
- return r ? t : t[0];
1032
- }
1033
- function P(r) {
1034
- return [...r].map((t) => Z[t]);
1035
- }
1036
- function tt(r) {
1037
- const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
1038
- let e = "/";
1039
- for (const i of t)
1040
- i.type === "literal" ? e = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && s.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
1041
- return { segments: s, separator: e };
1042
- }
1043
- function $(r) {
1044
- return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
1045
- }
1046
- function S(r) {
1047
- return { year: $(r.year), month: $(r.month), day: $(r.day) };
1048
- }
1049
- function U(r, t) {
1050
- return new Date(r || 2001, t || 1, 0).getDate();
1051
- }
1052
- function F(r) {
1053
- const { year: t, month: s, day: e } = S(r);
1054
- if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e || e < 1)
1055
- return;
1056
- const i = new Date(Date.UTC(t, s - 1, e));
1057
- if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
1058
- return { year: t, month: s, day: e };
1059
- }
1060
- function N(r) {
1061
- const t = F(r);
1062
- return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
1063
- }
1064
- function st(r, t, s, e) {
1065
- const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null;
1066
- return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : U(t.year, t.month) };
1038
+ function P(r, t) {
1039
+ if ("~standard" in r) {
1040
+ const s = r["~standard"].validate(t);
1041
+ if (s instanceof Promise)
1042
+ throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
1043
+ return s.issues?.at(0)?.message;
1044
+ }
1045
+ return r(t);
1067
1046
  }
1068
- var import_sisteransi, G, K, h, Y, k, A = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80, L = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20, m = class {
1047
+
1048
+ class m {
1069
1049
  input;
1070
1050
  output;
1071
1051
  _abortSignal;
@@ -1113,7 +1093,7 @@ var import_sisteransi, G, K, h, Y, k, A = (r) => ("columns" in r) && typeof r.co
1113
1093
  this.state = "cancel", this.close();
1114
1094
  }, { once: true });
1115
1095
  }
1116
- this.rl = E.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
1096
+ this.rl = G.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
1117
1097
  this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
1118
1098
  }), this.once("cancel", () => {
1119
1099
  this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
@@ -1136,9 +1116,9 @@ var import_sisteransi, G, K, h, Y, k, A = (r) => ("columns" in r) && typeof r.co
1136
1116
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
1137
1117
  }
1138
1118
  onKeypress(t, s) {
1139
- if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
1119
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t, s), s?.name === "return" && this._shouldSubmit(t, s)) {
1140
1120
  if (this.opts.validate) {
1141
- const e = this.opts.validate(this.value);
1121
+ const e = P(this.opts.validate, this.value);
1142
1122
  e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
1143
1123
  }
1144
1124
  this.state !== "error" && (this.state = "submit");
@@ -1160,7 +1140,7 @@ var import_sisteransi, G, K, h, Y, k, A = (r) => ("columns" in r) && typeof r.co
1160
1140
  if (this.state === "initial")
1161
1141
  this.output.write(import_sisteransi.cursor.hide);
1162
1142
  else {
1163
- const s = z(this._prevFrame, t), e = L(this.output);
1143
+ const s = Y(this._prevFrame, t), e = L(this.output);
1164
1144
  if (this.restoreCursor(), s) {
1165
1145
  const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
1166
1146
  let o = s.lines.find((u) => u >= i);
@@ -1194,16 +1174,65 @@ var import_sisteransi, G, K, h, Y, k, A = (r) => ("columns" in r) && typeof r.co
1194
1174
  this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
1195
1175
  }
1196
1176
  }
1197
- }, Q, X, Z, et, it, rt, ut;
1177
+ }
1178
+ function J(r, t) {
1179
+ if (r === undefined || t.length === 0)
1180
+ return 0;
1181
+ const s = t.findIndex((e) => e.value === r);
1182
+ return s !== -1 ? s : 0;
1183
+ }
1184
+ function H(r, t) {
1185
+ return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
1186
+ }
1187
+ function Q(r, t) {
1188
+ if (t)
1189
+ return r ? t : t[0];
1190
+ }
1191
+ function F(r) {
1192
+ return [...r].map((t) => tt[t]);
1193
+ }
1194
+ function st(r) {
1195
+ const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
1196
+ let e = "/";
1197
+ for (const i of t)
1198
+ i.type === "literal" ? e = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && s.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
1199
+ return { segments: s, separator: e };
1200
+ }
1201
+ function $(r) {
1202
+ return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
1203
+ }
1204
+ function S(r) {
1205
+ return { year: $(r.year), month: $(r.month), day: $(r.day) };
1206
+ }
1207
+ function U(r, t) {
1208
+ return new Date(r || 2001, t || 1, 0).getDate();
1209
+ }
1210
+ function N(r) {
1211
+ const { year: t, month: s, day: e } = S(r);
1212
+ if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e || e < 1)
1213
+ return;
1214
+ const i = new Date(Date.UTC(t, s - 1, e));
1215
+ if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
1216
+ return { year: t, month: s, day: e };
1217
+ }
1218
+ function E(r) {
1219
+ const t = N(r);
1220
+ return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
1221
+ }
1222
+ function et(r, t, s, e) {
1223
+ const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null;
1224
+ return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : U(t.year, t.month) };
1225
+ }
1226
+ var import_sisteransi, K, j, h, q, k, A = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80, L = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20, X, Z, tt, it, rt, nt, ot, ht;
1198
1227
  var init_dist3 = __esm(() => {
1199
1228
  init_main();
1200
1229
  import_sisteransi = __toESM(require_src(), 1);
1201
- G = ["up", "down", "left", "right", "space", "enter", "cancel"];
1202
- K = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
1203
- h = { actions: new Set(G), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...K], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
1204
- Y = globalThis.process.platform.startsWith("win");
1230
+ K = ["up", "down", "left", "right", "space", "enter", "cancel"];
1231
+ j = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
1232
+ h = { actions: new Set(K), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...j], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
1233
+ q = globalThis.process.platform.startsWith("win");
1205
1234
  k = Symbol("clack:cancel");
1206
- Q = class extends m {
1235
+ X = class extends m {
1207
1236
  filteredOptions;
1208
1237
  multiple;
1209
1238
  isNavigating = false;
@@ -1231,7 +1260,7 @@ var init_dist3 = __esm(() => {
1231
1260
  constructor(t) {
1232
1261
  super(t), this.#n = t.options, this.#u = t.placeholder;
1233
1262
  const s = this.options;
1234
- this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? J;
1263
+ this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? H;
1235
1264
  let e;
1236
1265
  if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e = t.initialValue : e = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e = [this.options[0].value]), e)
1237
1266
  for (const i of e) {
@@ -1249,7 +1278,7 @@ var init_dist3 = __esm(() => {
1249
1278
  this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
1250
1279
  return;
1251
1280
  }
1252
- e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
1281
+ e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = Q(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
1253
1282
  }
1254
1283
  deselectAll() {
1255
1284
  this.selectedValues = [];
@@ -1262,14 +1291,14 @@ var init_dist3 = __esm(() => {
1262
1291
  this.#r = t;
1263
1292
  const s = this.options;
1264
1293
  t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
1265
- const e = B(this.focusedValue, this.filteredOptions);
1294
+ const e = J(this.focusedValue, this.filteredOptions);
1266
1295
  this.#s = f(e, 0, this.filteredOptions);
1267
1296
  const i = this.filteredOptions[this.#s];
1268
1297
  i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
1269
1298
  }
1270
1299
  }
1271
1300
  };
1272
- X = class X extends m {
1301
+ Z = class Z extends m {
1273
1302
  get cursor() {
1274
1303
  return this.value ? 0 : 1;
1275
1304
  }
@@ -1286,8 +1315,8 @@ var init_dist3 = __esm(() => {
1286
1315
  });
1287
1316
  }
1288
1317
  };
1289
- Z = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
1290
- et = class et extends m {
1318
+ tt = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
1319
+ it = class it extends m {
1291
1320
  #s;
1292
1321
  #r;
1293
1322
  #t;
@@ -1316,10 +1345,10 @@ var init_dist3 = __esm(() => {
1316
1345
  return this.#s.map((s) => t[s.type]).join(this.#r);
1317
1346
  }
1318
1347
  #a() {
1319
- this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
1348
+ this._setUserInput(this.#c(this.#t)), this._setValue(E(this.#t) ?? undefined);
1320
1349
  }
1321
1350
  constructor(t) {
1322
- const s = t.format ? { segments: P(t.format), separator: t.separator ?? "/" } : tt(t.locale), e = t.separator ?? s.separator, i = t.format ? P(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e);
1351
+ const s = t.format ? { segments: F(t.format), separator: t.separator ?? "/" } : st(t.locale), e = t.separator ?? s.separator, i = t.format ? F(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e);
1323
1352
  super({ ...t, initialUserInput: u }, false), this.#s = i, this.#r = e, this.#t = o, this.#n = t.minDate, this.#u = t.maxDate, this.#a(), this.on("cursor", (a) => this.#d(a)), this.on("key", (a, l) => this.#f(a, l)), this.on("finalize", () => this.#g(t));
1324
1353
  }
1325
1354
  #h() {
@@ -1336,7 +1365,7 @@ var init_dist3 = __esm(() => {
1336
1365
  const s = this.#h();
1337
1366
  if (!s)
1338
1367
  return;
1339
- const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = st(e.type, S(this.#t), this.#n, this.#u);
1368
+ const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = et(e.type, S(this.#t), this.#n, this.#u);
1340
1369
  let a;
1341
1370
  n ? a = t === 1 ? u.min : u.max : a = Math.max(Math.min(u.max, o + t), u.min), this.#t = { ...this.#t, [e.type]: a.toString().padStart(e.len, "0") }, this.#i = true, this.#o = null, this.#a();
1342
1371
  }
@@ -1406,7 +1435,7 @@ var init_dist3 = __esm(() => {
1406
1435
  }
1407
1436
  }
1408
1437
  this.inlineError = "", this.#t[i.type] = l;
1409
- const y = l.includes("_") ? undefined : F(this.#t);
1438
+ const y = l.includes("_") ? undefined : N(this.#t);
1410
1439
  if (y) {
1411
1440
  const { year: d, month: g } = y, _ = U(d, g);
1412
1441
  this.#t = { year: String(Math.max(0, Math.min(9999, d))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(_, y.day))).padStart(2, "0") };
@@ -1429,10 +1458,10 @@ var init_dist3 = __esm(() => {
1429
1458
  const n = U(s, e);
1430
1459
  this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
1431
1460
  }
1432
- this.value = N(this.#t) ?? t.defaultValue ?? undefined;
1461
+ this.value = E(this.#t) ?? t.defaultValue ?? undefined;
1433
1462
  }
1434
1463
  };
1435
- it = class it extends m {
1464
+ rt = class extends m {
1436
1465
  options;
1437
1466
  cursor = 0;
1438
1467
  #s;
@@ -1479,7 +1508,8 @@ var init_dist3 = __esm(() => {
1479
1508
  });
1480
1509
  }
1481
1510
  };
1482
- rt = class rt extends m {
1511
+ nt = new Set(["up", "down", "left", "right"]);
1512
+ ot = class ot extends m {
1483
1513
  #s = false;
1484
1514
  #r;
1485
1515
  focused = "editor";
@@ -1532,7 +1562,7 @@ ${i}` : `${s}${v("inverse", e)}${i}`;
1532
1562
  }
1533
1563
  constructor(t) {
1534
1564
  super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e) => {
1535
- if (e?.name && h.actions.has(e.name)) {
1565
+ if (e?.name && nt.has(e.name)) {
1536
1566
  this.#n(e.name);
1537
1567
  return;
1538
1568
  }
@@ -1558,7 +1588,7 @@ ${i}` : `${s}${v("inverse", e)}${i}`;
1558
1588
  });
1559
1589
  }
1560
1590
  };
1561
- ut = class ut extends m {
1591
+ ht = class ht extends m {
1562
1592
  options;
1563
1593
  cursor = 0;
1564
1594
  get _selectedValue() {
@@ -1587,25 +1617,25 @@ ${i}` : `${s}${v("inverse", e)}${i}`;
1587
1617
  };
1588
1618
  });
1589
1619
 
1590
- // node_modules/.bun/@clack+prompts@1.4.0/node_modules/@clack/prompts/dist/index.mjs
1591
- import { styleText as e, stripVTControlCharacters as nt2 } from "util";
1620
+ // node_modules/.bun/@clack+prompts@1.5.0/node_modules/@clack/prompts/dist/index.mjs
1621
+ import { styleText as e, stripVTControlCharacters as ot2 } from "util";
1592
1622
  import V2 from "process";
1593
- function ee() {
1623
+ function se() {
1594
1624
  return V2.platform !== "win32" ? V2.env.TERM !== "linux" : !!V2.env.CI || !!V2.env.WT_SESSION || !!V2.env.TERMINUS_SUBLIME || V2.env.ConEmuTask === "{cmd::Cmder}" || V2.env.TERM_PROGRAM === "Terminus-Sublime" || V2.env.TERM_PROGRAM === "vscode" || V2.env.TERM === "xterm-256color" || V2.env.TERM === "alacritty" || V2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1595
1625
  }
1596
- var import_sisteransi2, tt2, w2 = (t, i) => tt2 ? t : i, Tt, at2, ut2, H2, lt, $2, x2, _t, xt, z2, U2, et2, K2, Y2, Et, st2, ct, Gt, $t, dt, Mt, ht2, pt, mt, gt, P2 = (t) => {
1626
+ var import_sisteransi2, tt2, w2 = (t, i) => tt2 ? t : i, _t, ut2, lt2, H2, ct2, $2, x2, xt, Et, z2, U2, et2, K2, Y2, Gt, st2, $t, Mt, dt, ht2, Ot, pt, mt, gt, yt, P2 = (t) => {
1597
1627
  switch (t) {
1598
1628
  case "initial":
1599
1629
  case "active":
1600
- return e("cyan", Tt);
1630
+ return e("cyan", _t);
1601
1631
  case "cancel":
1602
- return e("red", at2);
1632
+ return e("red", ut2);
1603
1633
  case "error":
1604
- return e("yellow", ut2);
1634
+ return e("yellow", lt2);
1605
1635
  case "submit":
1606
1636
  return e("green", H2);
1607
1637
  }
1608
- }, yt = (t) => {
1638
+ }, ft = (t) => {
1609
1639
  switch (t) {
1610
1640
  case "initial":
1611
1641
  case "active":
@@ -1617,7 +1647,7 @@ var import_sisteransi2, tt2, w2 = (t, i) => tt2 ? t : i, Tt, at2, ut2, H2, lt, $
1617
1647
  case "submit":
1618
1648
  return e("green", $2);
1619
1649
  }
1620
- }, Ot = (t, i, s, r, u, n = false) => {
1650
+ }, Pt = (t, i, s, r, u, n = false) => {
1621
1651
  let a = i, c = 0;
1622
1652
  if (n)
1623
1653
  for (let o = r - 1;o >= s && (a -= t[o].length, c++, !(a <= u)); o--)
@@ -1644,7 +1674,7 @@ var import_sisteransi2, tt2, w2 = (t, i) => tt2 ? t : i, Tt, at2, ut2, H2, lt, $
1644
1674
  let b = 0, G2 = 0, M = y;
1645
1675
  const N2 = t - v2;
1646
1676
  let O = d;
1647
- const j2 = () => Ot(m2, M, 0, N2, O), k2 = () => Ot(m2, M, N2 + 1, m2.length, O, true);
1677
+ const j2 = () => Pt(m2, M, 0, N2, O), k2 = () => Pt(m2, M, N2 + 1, m2.length, O, true);
1648
1678
  f2 ? ({ lineCount: M, removals: b } = j2(), M > O && (h2 || (O -= 1), { lineCount: M, removals: G2 } = k2())) : (h2 || (O -= 1), { lineCount: M, removals: G2 } = k2(), M > O && (O -= 1, { lineCount: M, removals: b } = j2())), b > 0 && (f2 = true, m2.splice(0, b)), G2 > 0 && (h2 = true, m2.splice(m2.length - G2, G2));
1649
1679
  }
1650
1680
  const S2 = [];
@@ -1653,10 +1683,10 @@ var import_sisteransi2, tt2, w2 = (t, i) => tt2 ? t : i, Tt, at2, ut2, H2, lt, $
1653
1683
  for (const G2 of b)
1654
1684
  S2.push(G2);
1655
1685
  return h2 && S2.push(l), S2;
1656
- }, ue = (t) => {
1686
+ }, le = (t) => {
1657
1687
  const i = t.active ?? "Yes", s = t.inactive ?? "No";
1658
- return new X({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
1659
- const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = W(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
1688
+ return new Z({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
1689
+ const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = B(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
1660
1690
  ` : ""}${a}
1661
1691
  `, o = this.value ? i : s;
1662
1692
  switch (this.state) {
@@ -1679,36 +1709,36 @@ ${d}
1679
1709
  }
1680
1710
  }
1681
1711
  } }).prompt();
1682
- }, R2, ge = (t = "", i) => {
1683
- const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", lt)} ` : "";
1712
+ }, R2, ye = (t = "", i) => {
1713
+ const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", ct2)} ` : "";
1684
1714
  s.write(`${r}${t}
1685
1715
  `);
1686
- }, ye = (t = "", i) => {
1716
+ }, fe = (t = "", i) => {
1687
1717
  const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $2)}
1688
1718
  ${e("gray", x2)} ` : "";
1689
1719
  s.write(`${r}${t}
1690
1720
 
1691
1721
  `);
1692
- }, we = (t) => e("dim", t), be = (t, i, s) => {
1722
+ }, be = (t) => e("dim", t), Se = (t, i, s) => {
1693
1723
  const r = { hard: true, trim: false }, u = wrapAnsi(t, i, r).split(`
1694
1724
  `), n = u.reduce((o, l) => Math.max(dist_default2(l), o), 0), a = u.map(s).reduce((o, l) => Math.max(dist_default2(l), o), 0), c = i - (a - n);
1695
1725
  return wrapAnsi(t, c, r);
1696
- }, Se = (t = "", i = "", s) => {
1697
- const r = s?.output ?? V2.stdout, u = s?.withGuide ?? h.withGuide, n = s?.format ?? we, a = ["", ...be(t, A(r) - 6, n).split(`
1726
+ }, Ce = (t = "", i = "", s) => {
1727
+ const r = s?.output ?? V2.stdout, u = s?.withGuide ?? h.withGuide, n = s?.format ?? be, a = ["", ...Se(t, A(r) - 6, n).split(`
1698
1728
  `).map(n), ""], c = dist_default2(i), o = Math.max(a.reduce((p2, f2) => {
1699
1729
  const h2 = dist_default2(f2);
1700
1730
  return h2 > p2 ? h2 : p2;
1701
1731
  }, 0), c) + 2, l = a.map((p2) => `${e("gray", $2)} ${p2}${" ".repeat(o - dist_default2(p2))}${e("gray", $2)}`).join(`
1702
1732
  `), d = u ? `${e("gray", $2)}
1703
- ` : "", g = u ? Gt : dt;
1704
- r.write(`${d}${e("green", H2)} ${e("reset", i)} ${e("gray", st2.repeat(Math.max(o - c - 1, 1)) + ct)}
1733
+ ` : "", g = u ? Mt : ht2;
1734
+ r.write(`${d}${e("green", H2)} ${e("reset", i)} ${e("gray", st2.repeat(Math.max(o - c - 1, 1)) + $t)}
1705
1735
  ${l}
1706
- ${e("gray", g + st2.repeat(o + 2) + $t)}
1736
+ ${e("gray", g + st2.repeat(o + 2) + dt)}
1707
1737
  `);
1708
- }, jt, it2 = (t, i) => t.includes(`
1738
+ }, Nt, it2 = (t, i) => t.includes(`
1709
1739
  `) ? t.split(`
1710
1740
  `).map((s) => i(s)).join(`
1711
- `) : i(t), xe = (t) => {
1741
+ `) : i(t), Ee = (t) => {
1712
1742
  const i = (s, r) => {
1713
1743
  const u = s.label ?? String(s.value);
1714
1744
  switch (r) {
@@ -1724,17 +1754,17 @@ ${e("gray", g + st2.repeat(o + 2) + $t)}
1724
1754
  return `${e("dim", U2)} ${it2(u, (n) => e("dim", n))}`;
1725
1755
  }
1726
1756
  };
1727
- return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
1728
- const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
1757
+ return new ht({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
1758
+ const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${ft(this.state)} `, n = B(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
1729
1759
  ` : ""}${n}
1730
1760
  `;
1731
1761
  switch (this.state) {
1732
1762
  case "submit": {
1733
- const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "selected"), c);
1763
+ const c = s ? `${e("gray", $2)} ` : "", o = B(t.output, i(this.options[this.cursor], "selected"), c);
1734
1764
  return `${a}${o}`;
1735
1765
  }
1736
1766
  case "cancel": {
1737
- const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "cancelled"), c);
1767
+ const c = s ? `${e("gray", $2)} ` : "", o = B(t.output, i(this.options[this.cursor], "cancelled"), c);
1738
1768
  return `${a}${o}${s ? `
1739
1769
  ${e("gray", $2)}` : ""}`;
1740
1770
  }
@@ -1748,39 +1778,39 @@ ${o}
1748
1778
  }
1749
1779
  }
1750
1780
  } }).prompt();
1751
- }, Nt;
1781
+ }, Bt;
1752
1782
  var init_dist4 = __esm(() => {
1753
1783
  init_dist3();
1754
1784
  init_dist3();
1755
1785
  init_main();
1756
1786
  init_dist2();
1757
1787
  import_sisteransi2 = __toESM(require_src(), 1);
1758
- tt2 = ee();
1759
- Tt = w2("\u25C6", "*");
1760
- at2 = w2("\u25A0", "x");
1761
- ut2 = w2("\u25B2", "x");
1788
+ tt2 = se();
1789
+ _t = w2("\u25C6", "*");
1790
+ ut2 = w2("\u25A0", "x");
1791
+ lt2 = w2("\u25B2", "x");
1762
1792
  H2 = w2("\u25C7", "o");
1763
- lt = w2("\u250C", "T");
1793
+ ct2 = w2("\u250C", "T");
1764
1794
  $2 = w2("\u2502", "|");
1765
1795
  x2 = w2("\u2514", "\u2014");
1766
- _t = w2("\u2510", "T");
1767
- xt = w2("\u2518", "\u2014");
1796
+ xt = w2("\u2510", "T");
1797
+ Et = w2("\u2518", "\u2014");
1768
1798
  z2 = w2("\u25CF", ">");
1769
1799
  U2 = w2("\u25CB", " ");
1770
1800
  et2 = w2("\u25FB", "[\u2022]");
1771
1801
  K2 = w2("\u25FC", "[+]");
1772
1802
  Y2 = w2("\u25FB", "[ ]");
1773
- Et = w2("\u25AA", "\u2022");
1803
+ Gt = w2("\u25AA", "\u2022");
1774
1804
  st2 = w2("\u2500", "-");
1775
- ct = w2("\u256E", "+");
1776
- Gt = w2("\u251C", "+");
1777
- $t = w2("\u256F", "+");
1778
- dt = w2("\u2570", "+");
1779
- Mt = w2("\u256D", "+");
1780
- ht2 = w2("\u25CF", "\u2022");
1781
- pt = w2("\u25C6", "*");
1782
- mt = w2("\u25B2", "!");
1783
- gt = w2("\u25A0", "x");
1805
+ $t = w2("\u256E", "+");
1806
+ Mt = w2("\u251C", "+");
1807
+ dt = w2("\u256F", "+");
1808
+ ht2 = w2("\u2570", "+");
1809
+ Ot = w2("\u256D", "+");
1810
+ pt = w2("\u25CF", "\u2022");
1811
+ mt = w2("\u25C6", "*");
1812
+ gt = w2("\u25B2", "!");
1813
+ yt = w2("\u25A0", "x");
1784
1814
  R2 = { message: (t = [], { symbol: i = e("gray", $2), secondarySymbol: s = e("gray", $2), output: r = process.stdout, spacing: u = 1, withGuide: n } = {}) => {
1785
1815
  const a = [], c = n ?? h.withGuide, o = c ? s : "", l = c ? `${i} ` : "", d = c ? `${s} ` : "";
1786
1816
  for (let p2 = 0;p2 < u; p2++)
@@ -1797,20 +1827,20 @@ var init_dist4 = __esm(() => {
1797
1827
  `)}
1798
1828
  `);
1799
1829
  }, info: (t, i) => {
1800
- R2.message(t, { ...i, symbol: e("blue", ht2) });
1830
+ R2.message(t, { ...i, symbol: e("blue", pt) });
1801
1831
  }, success: (t, i) => {
1802
- R2.message(t, { ...i, symbol: e("green", pt) });
1832
+ R2.message(t, { ...i, symbol: e("green", mt) });
1803
1833
  }, step: (t, i) => {
1804
1834
  R2.message(t, { ...i, symbol: e("green", H2) });
1805
1835
  }, warn: (t, i) => {
1806
- R2.message(t, { ...i, symbol: e("yellow", mt) });
1836
+ R2.message(t, { ...i, symbol: e("yellow", gt) });
1807
1837
  }, warning: (t, i) => {
1808
1838
  R2.warn(t, i);
1809
1839
  }, error: (t, i) => {
1810
- R2.message(t, { ...i, symbol: e("red", gt) });
1840
+ R2.message(t, { ...i, symbol: e("red", yt) });
1811
1841
  } };
1812
- jt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1813
- Nt = `${e("gray", $2)} `;
1842
+ Nt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
1843
+ Bt = `${e("gray", $2)} `;
1814
1844
  });
1815
1845
 
1816
1846
  // bin/src/shared.ts
@@ -1848,7 +1878,7 @@ function formatServerError(error, port) {
1848
1878
  if (error instanceof Error) {
1849
1879
  if (error.message.startsWith("HTTP"))
1850
1880
  return error.message;
1851
- if (error.message.includes("fetch")) {
1881
+ if (error.message.includes("fetch") || error.message.includes("Unable to connect")) {
1852
1882
  return `Could not connect to webmux server on port ${port}. Is it running?`;
1853
1883
  }
1854
1884
  return error.message;
@@ -2558,11 +2588,11 @@ var init_init = __esm(async () => {
2558
2588
  { tool: "codex", required: false, hint: "Install the Codex CLI to let Codex scaffold .webmux.yaml" },
2559
2589
  { tool: "docker", required: false, hint: "https://docs.docker.com/get-started/get-docker/" }
2560
2590
  ];
2561
- ge("webmux init");
2591
+ ye("webmux init");
2562
2592
  gitRoot = getGitRoot();
2563
2593
  if (!gitRoot) {
2564
2594
  R2.error("Not inside a git repository. Run this from within a project.");
2565
- ye("Aborted.");
2595
+ fe("Aborted.");
2566
2596
  process.exit(1);
2567
2597
  }
2568
2598
  R2.success(`Git root: ${gitRoot}`);
@@ -2571,8 +2601,8 @@ var init_init = __esm(async () => {
2571
2601
  if (missing.length > 0) {
2572
2602
  const lines = missing.map((d) => ` ${d.tool}: ${d.hint}`).join(`
2573
2603
  `);
2574
- Se(lines, "Install these required dependencies, then re-run webmux init");
2575
- ye("Setup incomplete.");
2604
+ Ce(lines, "Install these required dependencies, then re-run webmux init");
2605
+ fe("Setup incomplete.");
2576
2606
  process.exit(1);
2577
2607
  }
2578
2608
  bunVersionResult = run("bun", ["--version"]);
@@ -2584,7 +2614,7 @@ var init_init = __esm(async () => {
2584
2614
  if (tooOld) {
2585
2615
  R2.error(`Bun ${bunVersion} is too old. webmux requires Bun >= ${MIN_BUN_VERSION}.`);
2586
2616
  R2.info("Upgrade with: bun upgrade");
2587
- ye("Setup incomplete.");
2617
+ fe("Setup incomplete.");
2588
2618
  process.exit(1);
2589
2619
  }
2590
2620
  }
@@ -2603,7 +2633,7 @@ var init_init = __esm(async () => {
2603
2633
  } else {
2604
2634
  const claudeAvailable = which("claude");
2605
2635
  const codexAvailable = which("codex");
2606
- const choice = await xe({
2636
+ const choice = await Ee({
2607
2637
  message: "No .webmux.yaml found. How should webmux create it?",
2608
2638
  initialValue: claudeAvailable ? "claude" : codexAvailable ? "codex" : "manual",
2609
2639
  options: [
@@ -2626,8 +2656,8 @@ var init_init = __esm(async () => {
2626
2656
  }
2627
2657
  ]
2628
2658
  });
2629
- if (q(choice)) {
2630
- ye("Aborted.");
2659
+ if (R(choice)) {
2660
+ fe("Aborted.");
2631
2661
  process.exit(1);
2632
2662
  }
2633
2663
  const selectedAgent = choice === "codex" ? "codex" : defaultTemplateAgent();
@@ -2666,9 +2696,9 @@ ${result.stderr.trim()}` : ""
2666
2696
 
2667
2697
  `);
2668
2698
  if (details) {
2669
- Se(details, `${label} output`);
2699
+ Ce(details, `${label} output`);
2670
2700
  }
2671
- ye("Setup incomplete.");
2701
+ fe("Setup incomplete.");
2672
2702
  process.exit(1);
2673
2703
  }
2674
2704
  const finalYaml = await Bun.file(webmuxYaml).text();
@@ -2686,15 +2716,15 @@ ${result.stderr.trim()}` : ""
2686
2716
  R2.warning(`${label} exited with code ${result.exitCode}. The starter template is still there for manual editing.`);
2687
2717
  }
2688
2718
  if (result.summary && !streamPrinter.sawAssistantText()) {
2689
- Se(result.summary, `${label} summary`);
2719
+ Ce(result.summary, `${label} summary`);
2690
2720
  }
2691
2721
  const trimmedStderr = result.stderr.trim();
2692
2722
  if (trimmedStderr) {
2693
- Se(trimmedStderr, `${label} stderr`);
2723
+ Ce(trimmedStderr, `${label} stderr`);
2694
2724
  }
2695
2725
  }
2696
2726
  }
2697
- ye("You're all set! Next steps:");
2727
+ fe("You're all set! Next steps:");
2698
2728
  console.log();
2699
2729
  console.log(" 1. Review .webmux.yaml and adjust panes, ports, and profiles if needed");
2700
2730
  console.log(" 2. Run: webmux");
@@ -2773,9 +2803,9 @@ function allocateServicePorts(existingMetas, services) {
2773
2803
  var INVALID_BRANCH_CHARS_RE, UNSAFE_ENV_KEY_RE, VALID_WORKTREE_NAME_RE, VALID_INSTANCE_PREFIX_RE, RESERVED_INSTANCE_PREFIXES;
2774
2804
  var init_policies = __esm(() => {
2775
2805
  INVALID_BRANCH_CHARS_RE = /[~^:?*\[\]\\]+/g;
2776
- UNSAFE_ENV_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
2777
- VALID_WORKTREE_NAME_RE = /^[a-z0-9][a-z0-9\-_./]*$/;
2778
- VALID_INSTANCE_PREFIX_RE = /^[a-z0-9][a-z0-9\-]*$/;
2806
+ UNSAFE_ENV_KEY_RE = /^[a-z_][a-z0-9_]*$/i;
2807
+ VALID_WORKTREE_NAME_RE = /^[a-z0-9][a-z0-9\-_./]*$/i;
2808
+ VALID_INSTANCE_PREFIX_RE = /^[a-z0-9][a-z0-9\-]*$/i;
2779
2809
  RESERVED_INSTANCE_PREFIXES = new Set(["api", "ws", "assets"]);
2780
2810
  });
2781
2811
 
@@ -3224,8 +3254,8 @@ async function install(config, portExplicit, envVarNotes) {
3224
3254
  const filePath = serviceFilePath(config);
3225
3255
  const alreadyInstalled = isInstalled(config);
3226
3256
  if (alreadyInstalled) {
3227
- const reinstall = await ue({ message: "Service is already installed. Reinstall?" });
3228
- if (q(reinstall) || !reinstall) {
3257
+ const reinstall = await le({ message: "Service is already installed. Reinstall?" });
3258
+ if (R(reinstall) || !reinstall) {
3229
3259
  R2.info("Aborted.");
3230
3260
  return;
3231
3261
  }
@@ -3261,7 +3291,7 @@ async function install(config, portExplicit, envVarNotes) {
3261
3291
  const content = generateServiceFile(config);
3262
3292
  const commands = installCommands(config);
3263
3293
  const displayContent = redactSecretsInUnit(content, config.envVars);
3264
- Se([
3294
+ Ce([
3265
3295
  `File: ${filePath}`,
3266
3296
  "",
3267
3297
  "Contents:",
@@ -3279,8 +3309,8 @@ ${envVarNotes.join(`
3279
3309
  R2.info(portNote);
3280
3310
  if (portWarning)
3281
3311
  R2.warn(portWarning);
3282
- const ok = await ue({ message: "Proceed?" });
3283
- if (q(ok) || !ok) {
3312
+ const ok = await le({ message: "Proceed?" });
3313
+ if (R(ok) || !ok) {
3284
3314
  R2.info("Aborted.");
3285
3315
  return;
3286
3316
  }
@@ -3305,7 +3335,7 @@ ${result.stderr.toString()}`);
3305
3335
  }
3306
3336
  R2.success("Service installed and started!");
3307
3337
  if (config.platform === "linux") {
3308
- Se(`To keep the service running after logout, run:
3338
+ Ce(`To keep the service running after logout, run:
3309
3339
  loginctl enable-linger $USER
3310
3340
 
3311
3341
  (May require admin privileges on some systems.)`, "Tip");
@@ -3320,15 +3350,15 @@ async function uninstall(config) {
3320
3350
  return;
3321
3351
  }
3322
3352
  const commands = uninstallCommands(config);
3323
- Se([
3353
+ Ce([
3324
3354
  `File to remove: ${filePath}`,
3325
3355
  "",
3326
3356
  "Commands to run:",
3327
3357
  ...commands.map((c) => ` $ ${formatCommand(c)}`)
3328
3358
  ].join(`
3329
3359
  `), "Uninstall service");
3330
- const ok = await ue({ message: "Proceed?" });
3331
- if (q(ok) || !ok) {
3360
+ const ok = await le({ message: "Proceed?" });
3361
+ if (R(ok) || !ok) {
3332
3362
  R2.info("Aborted.");
3333
3363
  return;
3334
3364
  }
@@ -3644,6 +3674,35 @@ var init_service_restart = __esm(() => {
3644
3674
  DEFAULT_LAUNCHD_DIR2 = join8(homedir4(), "Library", "LaunchAgents");
3645
3675
  });
3646
3676
 
3677
+ // bin/src/instance-port.ts
3678
+ var exports_instance_port = {};
3679
+ __export(exports_instance_port, {
3680
+ selectInstancePort: () => selectInstancePort,
3681
+ resolveLiveServerPort: () => resolveLiveServerPort
3682
+ });
3683
+ function isInside(child, parent) {
3684
+ const root = parent.endsWith("/") ? parent.slice(0, -1) : parent;
3685
+ return child === root || child.startsWith(`${root}/`);
3686
+ }
3687
+ function selectInstancePort(input) {
3688
+ const match = input.instances.find((entry) => input.candidateDirs.some((dir) => isInside(dir, entry.projectDir)));
3689
+ if (match)
3690
+ return { port: match.port, source: "project" };
3691
+ if (input.instances.length === 1)
3692
+ return { port: input.instances[0].port, source: "sole" };
3693
+ return { port: input.defaultPort, source: "default" };
3694
+ }
3695
+ function resolveLiveServerPort(opts) {
3696
+ const instances = createInstanceRegistry(opts.registryDir).listLive();
3697
+ const gitRoot2 = getGitRoot();
3698
+ const candidateDirs = [opts.cwd, gitRoot2].filter((dir) => typeof dir === "string" && dir.length > 0);
3699
+ return selectInstancePort({ defaultPort: opts.defaultPort, candidateDirs, instances });
3700
+ }
3701
+ var init_instance_port = __esm(() => {
3702
+ init_instance_registry();
3703
+ init_shared();
3704
+ });
3705
+
3647
3706
  // node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
3648
3707
  var util, objectUtil, ZodParsedType, getParsedType = (data) => {
3649
3708
  const t = typeof data;
@@ -7932,7 +7991,7 @@ function parseLinearTarget(raw) {
7932
7991
  return { kind: "team", teamKey: trimmed };
7933
7992
  return { kind: "invalid", raw: trimmed };
7934
7993
  }
7935
- var BooleanLikeSchema, ErrorResponseSchema, OkResponseSchema, EnabledResponseSchema, BuiltInAgentIdSchema, AgentIdSchema, WorktreeCreateModeSchema, LinearIssueIdSchema, LinearTeamKeySchema, PostWorktreeToLinearTargetSchema, PostWorktreeToLinearRequestSchema, PostWorktreeToLinearResponseSchema, FromLinearInputSchema, OneshotConfigSchema, AgentCapabilitiesSchema, AgentSummarySchema, AgentDetailsSchema, AgentListResponseSchema, UpsertCustomAgentRequestSchema, AgentResponseSchema, ValidateCustomAgentResponseSchema, WorktreeCreationPhaseSchema, AvailableBranchSchema, AvailableBranchesQuerySchema, NumberLikePathParamSchema, BranchListResponseSchema, WorktreeSourceSchema, CreateWorktreeRequestSchema, OpenWorktreeRequestSchema, CreateWorktreeResponseSchema, SetWorktreeArchivedRequestSchema, SetWorktreeArchivedResponseSchema, SetWorktreeLabelRequestSchema, SetWorktreeLabelResponseSchema, ToggleEnabledRequestSchema, SendWorktreePromptRequestSchema, AgentsSendMessageRequestSchema, PullMainRequestSchema, PullMainStatusSchema, PullMainResponseSchema, ServiceStatusSchema, PrCommentSchema, CiCheckSchema, PrEntrySchema, LinearIssueLabelSchema, LinearIssueStateSchema, LinkedLinearIssueSchema, LinearIssueSchema, LinearIssueAvailabilitySchema, LinearIssuesResponseSchema, AutoNameProviderSchema, AutoNameConfigResponseSchema, WorktreeCreationStateSchema, AppNotificationSchema, ProjectWorktreeSnapshotSchema, ProjectSnapshotSchema, WorktreeConversationProviderSchema, CodexWorktreeConversationRefSchema, ClaudeWorktreeConversationRefSchema, WorktreeConversationRefSchema, AgentsUiWorktreeSummarySchema, AgentsUiConversationMessageRoleSchema, AgentsUiConversationMessageStatusSchema, AgentsUiConversationMessageKindSchema, AgentsUiConversationMessageSchema, AgentsUiConversationStateSchema, AgentsUiWorktreeConversationResponseSchema, AgentsUiSendMessageResponseSchema, AgentsUiInterruptResponseSchema, AgentsUiConversationSnapshotEventSchema, AgentsUiConversationMessageDeltaEventSchema, AgentsUiConversationErrorEventSchema, AgentsUiConversationEventSchema, WorktreeListResponseSchema, UnpushedCommitSchema, WorktreeDiffResponseSchema, ServiceConfigSchema, ProfileConfigSchema, LinkedRepoInfoSchema, AppConfigSchema, CiLogsResponseSchema, WorktreeNameParamsSchema, NotificationIdParamsSchema, AgentIdParamsSchema, RunIdParamsSchema, InstanceSummarySchema, InstancesResponseSchema;
7994
+ var BooleanLikeSchema, ErrorResponseSchema, OkResponseSchema, EnabledResponseSchema, BuiltInAgentIdSchema, AgentIdSchema, WorktreeCreateModeSchema, LinearIssueIdSchema, LinearTeamKeySchema, PostWorktreeToLinearTargetSchema, PostWorktreeToLinearRequestSchema, PostWorktreeToLinearResponseSchema, FromLinearInputSchema, OneshotConfigSchema, AgentCapabilitiesSchema, AgentSummarySchema, AgentDetailsSchema, AgentListResponseSchema, UpsertCustomAgentRequestSchema, AgentResponseSchema, ValidateCustomAgentResponseSchema, WorktreeCreationPhaseSchema, AvailableBranchSchema, AvailableBranchesQuerySchema, NumberLikePathParamSchema, BranchListResponseSchema, WorktreeSourceSchema, CreateWorktreeRequestSchema, OpenWorktreeRequestSchema, CreateWorktreeResponseSchema, SetWorktreeArchivedRequestSchema, SetWorktreeArchivedResponseSchema, SetWorktreeLabelRequestSchema, SetWorktreeLabelResponseSchema, ToggleEnabledRequestSchema, SendWorktreePromptRequestSchema, AgentsSendMessageRequestSchema, PullMainRequestSchema, PullMainStatusSchema, PullMainResponseSchema, ServiceStatusSchema, PrCommentSchema, CiCheckSchema, PrEntrySchema, LinearIssueLabelSchema, LinearIssueStateSchema, LinkedLinearIssueSchema, LinearIssueSchema, LinearIssueAvailabilitySchema, LinearIssuesResponseSchema, AutoNameProviderSchema, AutoNameConfigResponseSchema, WorktreeCreationStateSchema, AppNotificationSchema, ProjectWorktreeSnapshotSchema, ProjectSnapshotSchema, WorktreeConversationProviderSchema, CodexWorktreeConversationRefSchema, ClaudeWorktreeConversationRefSchema, WorktreeConversationRefSchema, AgentsUiWorktreeSummarySchema, AgentsUiConversationMessageRoleSchema, AgentsUiConversationMessageStatusSchema, AgentsUiConversationMessageKindSchema, AgentsUiConversationMessageSchema, AgentsUiConversationStateSchema, AgentsUiWorktreeConversationResponseSchema, AgentsUiSendMessageResponseSchema, AgentsUiInterruptResponseSchema, AgentsUiConversationMessageDeltaEventSchema, AgentsUiConversationMessageUpsertEventSchema, AgentsUiConversationStatusEventSchema, AgentsUiConversationErrorEventSchema, AgentsUiConversationEventSchema, WorktreeListResponseSchema, UnpushedCommitSchema, WorktreeDiffResponseSchema, ServiceConfigSchema, ProfileConfigSchema, LinkedRepoInfoSchema, AppConfigSchema, CiLogsResponseSchema, WorktreeNameParamsSchema, NotificationIdParamsSchema, AgentIdParamsSchema, RunIdParamsSchema, InstanceSummarySchema, InstancesResponseSchema;
7936
7995
  var init_schemas = __esm(() => {
7937
7996
  init_zod();
7938
7997
  BooleanLikeSchema = exports_external.union([
@@ -8259,17 +8318,24 @@ var init_schemas = __esm(() => {
8259
8318
  conversation: WorktreeConversationRefSchema.nullable()
8260
8319
  });
8261
8320
  AgentsUiConversationMessageRoleSchema = exports_external.enum(["user", "assistant"]);
8262
- AgentsUiConversationMessageStatusSchema = exports_external.enum(["completed", "inProgress"]);
8263
- AgentsUiConversationMessageKindSchema = exports_external.enum(["text", "toolUse", "toolResult"]);
8321
+ AgentsUiConversationMessageStatusSchema = exports_external.enum(["completed", "inProgress", "failed"]);
8322
+ AgentsUiConversationMessageKindSchema = exports_external.enum(["text", "thinking", "toolUse", "toolResult"]);
8264
8323
  AgentsUiConversationMessageSchema = exports_external.object({
8265
8324
  id: exports_external.string(),
8266
8325
  turnId: exports_external.string(),
8326
+ order: exports_external.number().int().nonnegative(),
8267
8327
  role: AgentsUiConversationMessageRoleSchema,
8268
8328
  text: exports_external.string(),
8269
8329
  status: AgentsUiConversationMessageStatusSchema,
8270
8330
  createdAt: exports_external.string().nullable(),
8271
- kind: AgentsUiConversationMessageKindSchema.optional(),
8272
- toolName: exports_external.string().optional()
8331
+ kind: AgentsUiConversationMessageKindSchema,
8332
+ phase: exports_external.string().optional(),
8333
+ toolName: exports_external.string().optional(),
8334
+ toolCallId: exports_external.string().optional(),
8335
+ command: exports_external.string().optional(),
8336
+ cwd: exports_external.string().optional(),
8337
+ exitCode: exports_external.number().nullable().optional(),
8338
+ durationMs: exports_external.number().nullable().optional()
8273
8339
  });
8274
8340
  AgentsUiConversationStateSchema = exports_external.object({
8275
8341
  provider: WorktreeConversationProviderSchema,
@@ -8293,24 +8359,36 @@ var init_schemas = __esm(() => {
8293
8359
  turnId: exports_external.string(),
8294
8360
  interrupted: exports_external.literal(true)
8295
8361
  });
8296
- AgentsUiConversationSnapshotEventSchema = exports_external.object({
8297
- type: exports_external.literal("snapshot"),
8298
- data: AgentsUiWorktreeConversationResponseSchema
8299
- });
8300
8362
  AgentsUiConversationMessageDeltaEventSchema = exports_external.object({
8301
8363
  type: exports_external.literal("messageDelta"),
8364
+ revision: exports_external.number().int().nonnegative(),
8302
8365
  conversationId: exports_external.string(),
8303
8366
  turnId: exports_external.string(),
8304
8367
  itemId: exports_external.string(),
8368
+ order: exports_external.number().int().nonnegative(),
8305
8369
  delta: exports_external.string()
8306
8370
  });
8371
+ AgentsUiConversationMessageUpsertEventSchema = exports_external.object({
8372
+ type: exports_external.literal("messageUpsert"),
8373
+ revision: exports_external.number().int().nonnegative(),
8374
+ conversationId: exports_external.string(),
8375
+ message: AgentsUiConversationMessageSchema
8376
+ });
8377
+ AgentsUiConversationStatusEventSchema = exports_external.object({
8378
+ type: exports_external.literal("conversationStatus"),
8379
+ revision: exports_external.number().int().nonnegative(),
8380
+ conversationId: exports_external.string(),
8381
+ running: exports_external.boolean(),
8382
+ activeTurnId: exports_external.string().nullable()
8383
+ });
8307
8384
  AgentsUiConversationErrorEventSchema = exports_external.object({
8308
8385
  type: exports_external.literal("error"),
8309
8386
  message: exports_external.string()
8310
8387
  });
8311
8388
  AgentsUiConversationEventSchema = exports_external.discriminatedUnion("type", [
8312
- AgentsUiConversationSnapshotEventSchema,
8313
8389
  AgentsUiConversationMessageDeltaEventSchema,
8390
+ AgentsUiConversationMessageUpsertEventSchema,
8391
+ AgentsUiConversationStatusEventSchema,
8314
8392
  AgentsUiConversationErrorEventSchema
8315
8393
  ]);
8316
8394
  WorktreeListResponseSchema = exports_external.object({
@@ -9241,6 +9319,10 @@ var init_linear_service = __esm(() => {
9241
9319
  });
9242
9320
 
9243
9321
  // backend/src/services/conversation-export-service.ts
9322
+ function parseWebmuxConversationAttachmentPayload(raw) {
9323
+ const parsed = WebmuxConversationAttachmentPayloadSchema.safeParse(raw);
9324
+ return parsed.success ? parsed.data : null;
9325
+ }
9244
9326
  function escapeFence(text) {
9245
9327
  return text.replace(/```/g, "``\u200B`");
9246
9328
  }
@@ -9319,29 +9401,37 @@ async function downloadWebmuxAttachmentDefault(url) {
9319
9401
  return { ok: false, error: `Asset download failed ${res.status}` };
9320
9402
  }
9321
9403
  const text = await res.text();
9322
- const parsed = WebmuxConversationAttachmentPayloadSchema.safeParse(JSON.parse(text));
9323
- if (!parsed.success) {
9404
+ const parsed = parseWebmuxConversationAttachmentPayload(JSON.parse(text));
9405
+ if (!parsed) {
9324
9406
  return { ok: false, error: "Asset is not a webmux conversation payload" };
9325
9407
  }
9326
- return { ok: true, data: parsed.data };
9408
+ return { ok: true, data: parsed };
9327
9409
  } catch (err) {
9328
9410
  const msg = err instanceof Error ? err.message : String(err);
9329
9411
  return { ok: false, error: msg };
9330
9412
  }
9331
9413
  }
9332
- var WebmuxConversationAttachmentPayloadSchema, defaultSeedFromLinearDeps;
9414
+ var WebmuxConversationAttachmentMessageSchema, WebmuxConversationAttachmentPayloadSchema, defaultSeedFromLinearDeps;
9333
9415
  var init_conversation_export_service = __esm(() => {
9334
9416
  init_src();
9335
9417
  init_zod();
9336
9418
  init_log();
9337
9419
  init_linear_service();
9420
+ WebmuxConversationAttachmentMessageSchema = AgentsUiConversationMessageSchema.extend({
9421
+ order: exports_external.number().int().nonnegative().optional(),
9422
+ kind: AgentsUiConversationMessageKindSchema.optional()
9423
+ });
9338
9424
  WebmuxConversationAttachmentPayloadSchema = exports_external.object({
9339
9425
  webmux: exports_external.literal(1),
9340
9426
  branch: exports_external.string(),
9341
9427
  baseBranch: exports_external.string().nullable(),
9342
9428
  agent: AgentIdSchema.nullable(),
9343
9429
  createdAt: exports_external.string(),
9344
- conversation: exports_external.array(AgentsUiConversationMessageSchema)
9430
+ conversation: exports_external.array(WebmuxConversationAttachmentMessageSchema).transform((messages) => messages.map((message, order) => ({
9431
+ ...message,
9432
+ order: message.order ?? order,
9433
+ kind: message.kind ?? "text"
9434
+ })))
9345
9435
  });
9346
9436
  defaultSeedFromLinearDeps = {
9347
9437
  fetchIssueWithAttachments,
@@ -9980,10 +10070,16 @@ function printNewMessages(state, messages) {
9980
10070
  }
9981
10071
  function handleConversationEvent(event, state, stderr) {
9982
10072
  if (event.type === "snapshot") {
10073
+ if (event.revision <= state.lastStreamRevision)
10074
+ return;
10075
+ state.lastStreamRevision = event.revision;
9983
10076
  printNewMessages(state, event.data.conversation.messages);
9984
10077
  return;
9985
10078
  }
9986
10079
  if (event.type === "messageDelta") {
10080
+ if (event.revision <= state.lastStreamRevision)
10081
+ return;
10082
+ state.lastStreamRevision = event.revision;
9987
10083
  if (state.streamingItemId !== event.itemId) {
9988
10084
  flushStreamingLine(state);
9989
10085
  state.streamingItemId = event.itemId;
@@ -9996,6 +10092,13 @@ function handleConversationEvent(event, state, stderr) {
9996
10092
  process.stdout.write(event.delta);
9997
10093
  return;
9998
10094
  }
10095
+ if (event.type === "messageUpsert") {
10096
+ if (event.revision <= state.lastStreamRevision)
10097
+ return;
10098
+ state.lastStreamRevision = event.revision;
10099
+ printNewMessages(state, [event.message]);
10100
+ return;
10101
+ }
9999
10102
  if (event.type === "error") {
10000
10103
  flushStreamingLine(state);
10001
10104
  stderr(`[${timestamp()}] [error] ${event.message}`);
@@ -10015,6 +10118,7 @@ function streamConversation(branch, port, state, stderr, onFatal) {
10015
10118
  socket = ws;
10016
10119
  ws.addEventListener("open", () => {
10017
10120
  consecutiveFailures = 0;
10121
+ state.lastStreamRevision = 0;
10018
10122
  });
10019
10123
  ws.addEventListener("message", (event) => {
10020
10124
  if (typeof event.data !== "string")
@@ -10190,9 +10294,9 @@ async function promptDuplicateChoice(candidate, polishedTitle) {
10190
10294
  `);
10191
10295
  return "create_new";
10192
10296
  }
10193
- Se(`${candidate.identifier}: ${candidate.title}
10297
+ Ce(`${candidate.identifier}: ${candidate.title}
10194
10298
  ${candidate.url}`, "Possible existing match");
10195
- const choice = await xe({
10299
+ const choice = await Ee({
10196
10300
  message: "Found a possible existing match. What should webmux do?",
10197
10301
  initialValue: "use_existing",
10198
10302
  options: [
@@ -10213,7 +10317,7 @@ ${candidate.url}`, "Possible existing match");
10213
10317
  }
10214
10318
  ]
10215
10319
  });
10216
- if (q(choice))
10320
+ if (R(choice))
10217
10321
  return "cancel";
10218
10322
  return choice;
10219
10323
  }
@@ -10372,7 +10476,8 @@ async function runOneshot(parsed, port) {
10372
10476
  const conversationState = {
10373
10477
  printedMessageIds: new Set,
10374
10478
  streamingItemId: null,
10375
- streamingNeedsHeader: false
10479
+ streamingNeedsHeader: false,
10480
+ lastStreamRevision: 0
10376
10481
  };
10377
10482
  try {
10378
10483
  const initial = await api.fetchAgentsWorktreeConversationHistory({ params: { name: branch } });
@@ -15004,7 +15109,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
15004
15109
  }
15005
15110
  }
15006
15111
  const expectedEnd = isMap ? "}" : "]";
15007
- const [ce, ...ee2] = fc.end;
15112
+ const [ce, ...ee] = fc.end;
15008
15113
  let cePos = offset;
15009
15114
  if (ce?.source === expectedEnd)
15010
15115
  cePos = ce.offset + ce.source.length;
@@ -15013,10 +15118,10 @@ var require_resolve_flow_collection = __commonJS((exports) => {
15013
15118
  const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
15014
15119
  onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg);
15015
15120
  if (ce && ce.source.length !== 1)
15016
- ee2.unshift(ce);
15121
+ ee.unshift(ce);
15017
15122
  }
15018
- if (ee2.length > 0) {
15019
- const end = resolveEnd.resolveEnd(ee2, cePos, ctx.options.strict, onError);
15123
+ if (ee.length > 0) {
15124
+ const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
15020
15125
  if (end.comment) {
15021
15126
  if (coll.comment)
15022
15127
  coll.comment += `
@@ -21672,11 +21777,11 @@ function listProjectWorktrees(runtime) {
21672
21777
  return runtime.git.listWorktrees(projectDir).filter((entry) => !entry.bare && resolve10(entry.path) !== projectDir);
21673
21778
  }
21674
21779
  async function defaultConfirmPrune(worktreeCount) {
21675
- const response = await ue({
21780
+ const response = await le({
21676
21781
  message: `Prune all ${worktreeCount} worktree${worktreeCount === 1 ? "" : "s"}? This action cannot be undone.`,
21677
21782
  initialValue: false
21678
21783
  });
21679
- return !q(response) && response;
21784
+ return !R(response) && response;
21680
21785
  }
21681
21786
  function defaultSwitchToTmuxWindow(projectDir, branch) {
21682
21787
  const sessionName = buildProjectSessionName(resolve10(projectDir));
@@ -21982,7 +22087,7 @@ import { fileURLToPath } from "url";
21982
22087
  // package.json
21983
22088
  var package_default = {
21984
22089
  name: "webmux",
21985
- version: "0.35.0",
22090
+ version: "0.36.0",
21986
22091
  description: "Web dashboard for workmux \u2014 browser UI with embedded terminals, PR monitoring, and CI integration",
21987
22092
  type: "module",
21988
22093
  repository: {
@@ -22067,6 +22172,7 @@ Usage:
22067
22172
 
22068
22173
  Options:
22069
22174
  --port N Set port (default: 5111). Falls back to a free port when taken.
22175
+ Without --port, CLI commands target the live server for this project.
22070
22176
  --prefix NAME URL prefix this instance registers under (default: project dir basename).
22071
22177
  Other webmux instances on this machine will redirect /<NAME> to this port.
22072
22178
  --app Open dashboard in browser app mode (minimal window)
@@ -22299,14 +22405,23 @@ Refreshing ${services.length} installed webmux service(s) to pick up the new ver
22299
22405
  }
22300
22406
  await loadEnvFile(resolve11(process.cwd(), ".env.local"));
22301
22407
  await loadEnvFile(resolve11(process.cwd(), ".env"));
22408
+ let effectivePort = parsed.port;
22409
+ if (!parsed.portExplicit) {
22410
+ const { resolveLiveServerPort: resolveLiveServerPort2 } = await Promise.resolve().then(() => (init_instance_port(), exports_instance_port));
22411
+ const resolved = resolveLiveServerPort2({ defaultPort: parsed.port, cwd: process.cwd() });
22412
+ effectivePort = resolved.port;
22413
+ if (parsed.debug && resolved.source !== "default") {
22414
+ console.error(`[webmux] resolved port ${resolved.port} from live instance (${resolved.source})`);
22415
+ }
22416
+ }
22302
22417
  if (parsed.command === "oneshot") {
22303
22418
  const { runOneshotCommand: runOneshotCommand2 } = await Promise.resolve().then(() => (init_oneshot(), exports_oneshot));
22304
- const exitCode2 = await runOneshotCommand2(parsed.commandArgs, parsed.port);
22419
+ const exitCode2 = await runOneshotCommand2(parsed.commandArgs, effectivePort);
22305
22420
  process.exit(exitCode2);
22306
22421
  }
22307
22422
  if (parsed.command === "linear") {
22308
22423
  const { runLinearCommand: runLinearCommand2 } = await Promise.resolve().then(() => (init_linear_commands(), exports_linear_commands));
22309
- const exitCode2 = await runLinearCommand2(parsed.commandArgs, parsed.port);
22424
+ const exitCode2 = await runLinearCommand2(parsed.commandArgs, effectivePort);
22310
22425
  process.exit(exitCode2);
22311
22426
  }
22312
22427
  if (isWorktreeCommand(parsed.command)) {
@@ -22315,7 +22430,7 @@ Refreshing ${services.length} installed webmux service(s) to pick up the new ver
22315
22430
  command: parsed.command,
22316
22431
  args: parsed.commandArgs,
22317
22432
  projectDir: process.cwd(),
22318
- port: parsed.port
22433
+ port: effectivePort
22319
22434
  });
22320
22435
  process.exit(exitCode2);
22321
22436
  }