@vibedeckx/linux-x64 0.3.2 → 0.3.4

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
@@ -13356,12 +13356,12 @@ var require_semver = __commonJS({
13356
13356
  }
13357
13357
  function replaceHyphen(comp, options) {
13358
13358
  const r = HYPHENRANGE_REGEXP;
13359
- return comp.replace(r, (_3, from, fM, fm, fp35, fpr, fb, to, tM, tm, tp, tpr) => {
13359
+ return comp.replace(r, (_3, from, fM, fm, fp36, fpr, fb, to, tM, tm, tp, tpr) => {
13360
13360
  if (isX(fM)) {
13361
13361
  from = "";
13362
13362
  } else if (isX(fm)) {
13363
13363
  from = `>=${fM}.0.0${options?.includePrerelease ? "-0" : ""}`;
13364
- } else if (isX(fp35)) {
13364
+ } else if (isX(fp36)) {
13365
13365
  from = `>=${fM}.${fm}.0${options?.includePrerelease ? "-0" : ""}`;
13366
13366
  } else if (fpr) {
13367
13367
  from = `>=${from}`;
@@ -26774,14 +26774,14 @@ var require_tls_helpers = __commonJS({
26774
26774
  Object.defineProperty(exports, "__esModule", { value: true });
26775
26775
  exports.CIPHER_SUITES = void 0;
26776
26776
  exports.getDefaultRootsData = getDefaultRootsData;
26777
- var fs14 = __require("fs");
26777
+ var fs15 = __require("fs");
26778
26778
  exports.CIPHER_SUITES = process.env.GRPC_SSL_CIPHER_SUITES;
26779
26779
  var DEFAULT_ROOTS_FILE_PATH = process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH;
26780
26780
  var defaultRootsData = null;
26781
26781
  function getDefaultRootsData() {
26782
26782
  if (DEFAULT_ROOTS_FILE_PATH) {
26783
26783
  if (defaultRootsData === null) {
26784
- defaultRootsData = fs14.readFileSync(DEFAULT_ROOTS_FILE_PATH);
26784
+ defaultRootsData = fs15.readFileSync(DEFAULT_ROOTS_FILE_PATH);
26785
26785
  }
26786
26786
  return defaultRootsData;
26787
26787
  }
@@ -31817,7 +31817,7 @@ var require_fetch = __commonJS({
31817
31817
  module.exports = fetch2;
31818
31818
  var asPromise = require_aspromise();
31819
31819
  var inquire = require_inquire();
31820
- var fs14 = inquire("fs");
31820
+ var fs15 = inquire("fs");
31821
31821
  function fetch2(filename, options, callback) {
31822
31822
  if (typeof options === "function") {
31823
31823
  callback = options;
@@ -31826,8 +31826,8 @@ var require_fetch = __commonJS({
31826
31826
  options = {};
31827
31827
  if (!callback)
31828
31828
  return asPromise(fetch2, this, filename, options);
31829
- if (!options.xhr && fs14 && fs14.readFile)
31830
- return fs14.readFile(filename, function fetchReadFileCallback(err, contents) {
31829
+ if (!options.xhr && fs15 && fs15.readFile)
31830
+ return fs15.readFile(filename, function fetchReadFileCallback(err, contents) {
31831
31831
  return err && typeof XMLHttpRequest !== "undefined" ? fetch2.xhr(filename, options, callback) : err ? callback(err) : callback(null, options.binary ? contents : contents.toString("utf8"));
31832
31832
  });
31833
31833
  return fetch2.xhr(filename, options, callback);
@@ -38161,7 +38161,7 @@ var require_util3 = __commonJS({
38161
38161
  "use strict";
38162
38162
  Object.defineProperty(exports, "__esModule", { value: true });
38163
38163
  exports.addCommonProtos = exports.loadProtosWithOptionsSync = exports.loadProtosWithOptions = void 0;
38164
- var fs14 = __require("fs");
38164
+ var fs15 = __require("fs");
38165
38165
  var path22 = __require("path");
38166
38166
  var Protobuf = require_protobufjs();
38167
38167
  function addIncludePathResolver(root, includePaths) {
@@ -38173,7 +38173,7 @@ var require_util3 = __commonJS({
38173
38173
  for (const directory of includePaths) {
38174
38174
  const fullPath = path22.join(directory, target);
38175
38175
  try {
38176
- fs14.accessSync(fullPath, fs14.constants.R_OK);
38176
+ fs15.accessSync(fullPath, fs15.constants.R_OK);
38177
38177
  return fullPath;
38178
38178
  } catch (err) {
38179
38179
  continue;
@@ -47995,7 +47995,7 @@ var require_certificate_provider = __commonJS({
47995
47995
  "use strict";
47996
47996
  Object.defineProperty(exports, "__esModule", { value: true });
47997
47997
  exports.FileWatcherCertificateProvider = void 0;
47998
- var fs14 = __require("fs");
47998
+ var fs15 = __require("fs");
47999
47999
  var logging = require_logging();
48000
48000
  var constants_1 = require_constants2();
48001
48001
  var util_1 = __require("util");
@@ -48003,7 +48003,7 @@ var require_certificate_provider = __commonJS({
48003
48003
  function trace2(text2) {
48004
48004
  logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text2);
48005
48005
  }
48006
- var readFilePromise = (0, util_1.promisify)(fs14.readFile);
48006
+ var readFilePromise = (0, util_1.promisify)(fs15.readFile);
48007
48007
  var FileWatcherCertificateProvider = class {
48008
48008
  constructor(config2) {
48009
48009
  this.config = config2;
@@ -49915,7 +49915,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
49915
49915
  var core_1 = require_src();
49916
49916
  var grpc_exporter_transport_1 = require_grpc_exporter_transport();
49917
49917
  var node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports));
49918
- var fs14 = __require("fs");
49918
+ var fs15 = __require("fs");
49919
49919
  var path22 = __require("path");
49920
49920
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
49921
49921
  function fallbackIfNullishOrBlank(signalSpecific, nonSignalSpecific) {
@@ -49965,7 +49965,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
49965
49965
  const filePath = fallbackIfNullishOrBlank(signalSpecificPath, nonSignalSpecificPath);
49966
49966
  if (filePath != null) {
49967
49967
  try {
49968
- return fs14.readFileSync(path22.resolve(process.cwd(), filePath));
49968
+ return fs15.readFileSync(path22.resolve(process.cwd(), filePath));
49969
49969
  } catch {
49970
49970
  api_1.diag.warn(warningMessage);
49971
49971
  return void 0;
@@ -51728,7 +51728,7 @@ var require_utils10 = __commonJS({
51728
51728
  var exporter_metrics_otlp_http_1 = require_src26();
51729
51729
  var exporter_metrics_otlp_proto_1 = require_src28();
51730
51730
  var sdk_logs_1 = require_src4();
51731
- var fs14 = __require("fs");
51731
+ var fs15 = __require("fs");
51732
51732
  var RESOURCE_DETECTOR_ENVIRONMENT = "env";
51733
51733
  var RESOURCE_DETECTOR_HOST = "host";
51734
51734
  var RESOURCE_DETECTOR_OS = "os";
@@ -52151,21 +52151,21 @@ var require_utils10 = __commonJS({
52151
52151
  const httpsAgentOptions = {};
52152
52152
  if (tls.ca_file) {
52153
52153
  try {
52154
- httpsAgentOptions.ca = fs14.readFileSync(tls.ca_file);
52154
+ httpsAgentOptions.ca = fs15.readFileSync(tls.ca_file);
52155
52155
  } catch (e) {
52156
52156
  api_1.diag.warn(`Failed to read TLS CA file at ${tls.ca_file}: ${e}`);
52157
52157
  }
52158
52158
  }
52159
52159
  if (tls.cert_file) {
52160
52160
  try {
52161
- httpsAgentOptions.cert = fs14.readFileSync(tls.cert_file);
52161
+ httpsAgentOptions.cert = fs15.readFileSync(tls.cert_file);
52162
52162
  } catch (e) {
52163
52163
  api_1.diag.warn(`Failed to read TLS cert file at ${tls.cert_file}: ${e}`);
52164
52164
  }
52165
52165
  }
52166
52166
  if (tls.key_file) {
52167
52167
  try {
52168
- httpsAgentOptions.key = fs14.readFileSync(tls.key_file);
52168
+ httpsAgentOptions.key = fs15.readFileSync(tls.key_file);
52169
52169
  } catch (e) {
52170
52170
  api_1.diag.warn(`Failed to read TLS key file at ${tls.key_file}: ${e}`);
52171
52171
  }
@@ -60537,14 +60537,14 @@ var require_parser = __commonJS({
60537
60537
  case "scalar":
60538
60538
  case "single-quoted-scalar":
60539
60539
  case "double-quoted-scalar": {
60540
- const fs14 = this.flowScalar(this.type);
60540
+ const fs15 = this.flowScalar(this.type);
60541
60541
  if (atNextItem || it.value) {
60542
- map2.items.push({ start, key: fs14, sep: [] });
60542
+ map2.items.push({ start, key: fs15, sep: [] });
60543
60543
  this.onKeyLine = true;
60544
60544
  } else if (it.sep) {
60545
- this.stack.push(fs14);
60545
+ this.stack.push(fs15);
60546
60546
  } else {
60547
- Object.assign(it, { key: fs14, sep: [] });
60547
+ Object.assign(it, { key: fs15, sep: [] });
60548
60548
  this.onKeyLine = true;
60549
60549
  }
60550
60550
  return;
@@ -60672,13 +60672,13 @@ var require_parser = __commonJS({
60672
60672
  case "scalar":
60673
60673
  case "single-quoted-scalar":
60674
60674
  case "double-quoted-scalar": {
60675
- const fs14 = this.flowScalar(this.type);
60675
+ const fs15 = this.flowScalar(this.type);
60676
60676
  if (!it || it.value)
60677
- fc.items.push({ start: [], key: fs14, sep: [] });
60677
+ fc.items.push({ start: [], key: fs15, sep: [] });
60678
60678
  else if (it.sep)
60679
- this.stack.push(fs14);
60679
+ this.stack.push(fs15);
60680
60680
  else
60681
- Object.assign(it, { key: fs14, sep: [] });
60681
+ Object.assign(it, { key: fs15, sep: [] });
60682
60682
  return;
60683
60683
  }
60684
60684
  case "flow-map-end":
@@ -60994,7 +60994,7 @@ var require_FileConfigFactory = __commonJS({
60994
60994
  exports.setLoggerProvider = exports.getSeverity = exports.setMeterProvider = exports.getTemporalityPreference = exports.setTracerProvider = exports.setPropagator = exports.setAttributeLimits = exports.setResourceAttributes = exports.parseConfigFile = exports.hasValidConfigFile = exports.FileConfigFactory = void 0;
60995
60995
  var core_1 = require_src();
60996
60996
  var configModel_1 = require_configModel();
60997
- var fs14 = __require("fs");
60997
+ var fs15 = __require("fs");
60998
60998
  var yaml = require_dist();
60999
60999
  var utils_1 = require_utils11();
61000
61000
  var commonModel_1 = require_commonModel();
@@ -61016,7 +61016,7 @@ var require_FileConfigFactory = __commonJS({
61016
61016
  function hasValidConfigFile() {
61017
61017
  const configFile = (0, core_1.getStringFromEnv)("OTEL_CONFIG_FILE");
61018
61018
  if (configFile) {
61019
- if (!(configFile.endsWith(".yaml") || configFile.endsWith(".yml")) || !fs14.existsSync(configFile)) {
61019
+ if (!(configFile.endsWith(".yaml") || configFile.endsWith(".yml")) || !fs15.existsSync(configFile)) {
61020
61020
  api_1.diag.warn(`Config file ${configFile} set on OTEL_CONFIG_FILE is not valid`);
61021
61021
  return false;
61022
61022
  }
@@ -61028,7 +61028,7 @@ var require_FileConfigFactory = __commonJS({
61028
61028
  function parseConfigFile(config2) {
61029
61029
  const supportedFileVersions = ["1.0-rc.3"];
61030
61030
  const configFile = (0, core_1.getStringFromEnv)("OTEL_CONFIG_FILE") || "";
61031
- const file2 = fs14.readFileSync(configFile, "utf8");
61031
+ const file2 = fs15.readFileSync(configFile, "utf8");
61032
61032
  const parsedContent = yaml.parse(file2);
61033
61033
  if (parsedContent["file_format"] && supportedFileVersions.includes(parsedContent["file_format"])) {
61034
61034
  const disabled = (0, utils_1.getBooleanFromConfigFile)(parsedContent["disabled"]);
@@ -66890,7 +66890,7 @@ var require_atomic_sleep = __commonJS({
66890
66890
  var require_sonic_boom = __commonJS({
66891
66891
  "../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js"(exports, module) {
66892
66892
  "use strict";
66893
- var fs14 = __require("fs");
66893
+ var fs15 = __require("fs");
66894
66894
  var EventEmitter3 = __require("events");
66895
66895
  var inherits = __require("util").inherits;
66896
66896
  var path22 = __require("path");
@@ -66947,20 +66947,20 @@ var require_sonic_boom = __commonJS({
66947
66947
  const mode = sonic.mode;
66948
66948
  if (sonic.sync) {
66949
66949
  try {
66950
- if (sonic.mkdir) fs14.mkdirSync(path22.dirname(file2), { recursive: true });
66951
- const fd = fs14.openSync(file2, flags, mode);
66950
+ if (sonic.mkdir) fs15.mkdirSync(path22.dirname(file2), { recursive: true });
66951
+ const fd = fs15.openSync(file2, flags, mode);
66952
66952
  fileOpened(null, fd);
66953
66953
  } catch (err) {
66954
66954
  fileOpened(err);
66955
66955
  throw err;
66956
66956
  }
66957
66957
  } else if (sonic.mkdir) {
66958
- fs14.mkdir(path22.dirname(file2), { recursive: true }, (err) => {
66958
+ fs15.mkdir(path22.dirname(file2), { recursive: true }, (err) => {
66959
66959
  if (err) return fileOpened(err);
66960
- fs14.open(file2, flags, mode, fileOpened);
66960
+ fs15.open(file2, flags, mode, fileOpened);
66961
66961
  });
66962
66962
  } else {
66963
- fs14.open(file2, flags, mode, fileOpened);
66963
+ fs15.open(file2, flags, mode, fileOpened);
66964
66964
  }
66965
66965
  }
66966
66966
  function SonicBoom(opts) {
@@ -67001,16 +67001,16 @@ var require_sonic_boom = __commonJS({
67001
67001
  this.flush = flushBuffer;
67002
67002
  this.flushSync = flushBufferSync;
67003
67003
  this._actualWrite = actualWriteBuffer;
67004
- fsWriteSync = () => fs14.writeSync(this.fd, this._writingBuf);
67005
- fsWrite = () => fs14.write(this.fd, this._writingBuf, this.release);
67004
+ fsWriteSync = () => fs15.writeSync(this.fd, this._writingBuf);
67005
+ fsWrite = () => fs15.write(this.fd, this._writingBuf, this.release);
67006
67006
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
67007
67007
  this._writingBuf = "";
67008
67008
  this.write = write;
67009
67009
  this.flush = flush;
67010
67010
  this.flushSync = flushSync;
67011
67011
  this._actualWrite = actualWrite;
67012
- fsWriteSync = () => fs14.writeSync(this.fd, this._writingBuf, "utf8");
67013
- fsWrite = () => fs14.write(this.fd, this._writingBuf, "utf8", this.release);
67012
+ fsWriteSync = () => fs15.writeSync(this.fd, this._writingBuf, "utf8");
67013
+ fsWrite = () => fs15.write(this.fd, this._writingBuf, "utf8", this.release);
67014
67014
  } else {
67015
67015
  throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
67016
67016
  }
@@ -67066,7 +67066,7 @@ var require_sonic_boom = __commonJS({
67066
67066
  }
67067
67067
  }
67068
67068
  if (this._fsync) {
67069
- fs14.fsyncSync(this.fd);
67069
+ fs15.fsyncSync(this.fd);
67070
67070
  }
67071
67071
  const len = this._len;
67072
67072
  if (this._reopening) {
@@ -67178,7 +67178,7 @@ var require_sonic_boom = __commonJS({
67178
67178
  const onDrain = () => {
67179
67179
  if (!this._fsync) {
67180
67180
  try {
67181
- fs14.fsync(this.fd, (err) => {
67181
+ fs15.fsync(this.fd, (err) => {
67182
67182
  this._flushPending = false;
67183
67183
  cb(err);
67184
67184
  });
@@ -67280,7 +67280,7 @@ var require_sonic_boom = __commonJS({
67280
67280
  const fd = this.fd;
67281
67281
  this.once("ready", () => {
67282
67282
  if (fd !== this.fd) {
67283
- fs14.close(fd, (err) => {
67283
+ fs15.close(fd, (err) => {
67284
67284
  if (err) {
67285
67285
  return this.emit("error", err);
67286
67286
  }
@@ -67329,7 +67329,7 @@ var require_sonic_boom = __commonJS({
67329
67329
  buf = this._bufs[0];
67330
67330
  }
67331
67331
  try {
67332
- const n = fs14.writeSync(this.fd, buf, "utf8");
67332
+ const n = fs15.writeSync(this.fd, buf, "utf8");
67333
67333
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
67334
67334
  buf = releasedBufObj.writingBuf;
67335
67335
  this._len = releasedBufObj.len;
@@ -67345,7 +67345,7 @@ var require_sonic_boom = __commonJS({
67345
67345
  }
67346
67346
  }
67347
67347
  try {
67348
- fs14.fsyncSync(this.fd);
67348
+ fs15.fsyncSync(this.fd);
67349
67349
  } catch {
67350
67350
  }
67351
67351
  }
@@ -67366,7 +67366,7 @@ var require_sonic_boom = __commonJS({
67366
67366
  buf = mergeBuf(this._bufs[0], this._lens[0]);
67367
67367
  }
67368
67368
  try {
67369
- const n = fs14.writeSync(this.fd, buf);
67369
+ const n = fs15.writeSync(this.fd, buf);
67370
67370
  buf = buf.subarray(n);
67371
67371
  this._len = Math.max(this._len - n, 0);
67372
67372
  if (buf.length <= 0) {
@@ -67394,13 +67394,13 @@ var require_sonic_boom = __commonJS({
67394
67394
  this._writingBuf = this._writingBuf || this._bufs.shift() || "";
67395
67395
  if (this.sync) {
67396
67396
  try {
67397
- const written = fs14.writeSync(this.fd, this._writingBuf, "utf8");
67397
+ const written = fs15.writeSync(this.fd, this._writingBuf, "utf8");
67398
67398
  release(null, written);
67399
67399
  } catch (err) {
67400
67400
  release(err);
67401
67401
  }
67402
67402
  } else {
67403
- fs14.write(this.fd, this._writingBuf, "utf8", release);
67403
+ fs15.write(this.fd, this._writingBuf, "utf8", release);
67404
67404
  }
67405
67405
  }
67406
67406
  function actualWriteBuffer() {
@@ -67409,7 +67409,7 @@ var require_sonic_boom = __commonJS({
67409
67409
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
67410
67410
  if (this.sync) {
67411
67411
  try {
67412
- const written = fs14.writeSync(this.fd, this._writingBuf);
67412
+ const written = fs15.writeSync(this.fd, this._writingBuf);
67413
67413
  release(null, written);
67414
67414
  } catch (err) {
67415
67415
  release(err);
@@ -67418,7 +67418,7 @@ var require_sonic_boom = __commonJS({
67418
67418
  if (kCopyBuffer) {
67419
67419
  this._writingBuf = Buffer.from(this._writingBuf);
67420
67420
  }
67421
- fs14.write(this.fd, this._writingBuf, release);
67421
+ fs15.write(this.fd, this._writingBuf, release);
67422
67422
  }
67423
67423
  }
67424
67424
  function actualClose(sonic) {
@@ -67434,12 +67434,12 @@ var require_sonic_boom = __commonJS({
67434
67434
  sonic._lens = [];
67435
67435
  assert2(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
67436
67436
  try {
67437
- fs14.fsync(sonic.fd, closeWrapped);
67437
+ fs15.fsync(sonic.fd, closeWrapped);
67438
67438
  } catch {
67439
67439
  }
67440
67440
  function closeWrapped() {
67441
67441
  if (sonic.fd !== 1 && sonic.fd !== 2) {
67442
- fs14.close(sonic.fd, done);
67442
+ fs15.close(sonic.fd, done);
67443
67443
  } else {
67444
67444
  done();
67445
67445
  }
@@ -82850,12 +82850,12 @@ var require_dist2 = __commonJS({
82850
82850
  throw new Error(`Unknown format "${name25}"`);
82851
82851
  return f2;
82852
82852
  };
82853
- function addFormats(ajv, list, fs14, exportName) {
82853
+ function addFormats(ajv, list, fs15, exportName) {
82854
82854
  var _a26;
82855
82855
  var _b18;
82856
82856
  (_a26 = (_b18 = ajv.opts.code).formats) !== null && _a26 !== void 0 ? _a26 : _b18.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
82857
82857
  for (const f2 of list)
82858
- ajv.addFormat(f2, fs14[f2]);
82858
+ ajv.addFormat(f2, fs15[f2]);
82859
82859
  }
82860
82860
  module.exports = exports = formatsPlugin;
82861
82861
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -87525,12 +87525,12 @@ var require_range = __commonJS({
87525
87525
  debug("replaceGTE0", comp, options);
87526
87526
  return comp.trim().replace(re2[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
87527
87527
  };
87528
- var hyphenReplace = (incPr) => ($0, from, fM, fm, fp35, fpr, fb, to, tM, tm, tp, tpr) => {
87528
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp36, fpr, fb, to, tM, tm, tp, tpr) => {
87529
87529
  if (isX(fM)) {
87530
87530
  from = "";
87531
87531
  } else if (isX(fm)) {
87532
87532
  from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
87533
- } else if (isX(fp35)) {
87533
+ } else if (isX(fp36)) {
87534
87534
  from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
87535
87535
  } else if (fpr) {
87536
87536
  from = `>=${from}`;
@@ -90111,8 +90111,8 @@ var require_pretty_print = __commonJS({
90111
90111
  serializedRoute += serializeMetaData(route.metaData);
90112
90112
  return serializedRoute;
90113
90113
  }
90114
- function mergeSimilarRoutes(routes34) {
90115
- return routes34.reduce((mergedRoutes, route) => {
90114
+ function mergeSimilarRoutes(routes35) {
90115
+ return routes35.reduce((mergedRoutes, route) => {
90116
90116
  for (const nodeRoute of mergedRoutes) {
90117
90117
  if (deepEqual(route.opts.constraints, nodeRoute.opts.constraints) && deepEqual(route.metaData, nodeRoute.metaData)) {
90118
90118
  nodeRoute.method += ", " + route.method;
@@ -90124,18 +90124,18 @@ var require_pretty_print = __commonJS({
90124
90124
  }, []);
90125
90125
  }
90126
90126
  function serializeNode(node, prefix, options) {
90127
- let routes34 = node.routes;
90127
+ let routes35 = node.routes;
90128
90128
  if (options.method === void 0) {
90129
- routes34 = routes34.map(normalizeRoute);
90129
+ routes35 = routes35.map(normalizeRoute);
90130
90130
  }
90131
- routes34 = routes34.map((route) => {
90131
+ routes35 = routes35.map((route) => {
90132
90132
  route.metaData = getRouteMetaData(route, options);
90133
90133
  return route;
90134
90134
  });
90135
90135
  if (options.method === void 0) {
90136
- routes34 = mergeSimilarRoutes(routes34);
90136
+ routes35 = mergeSimilarRoutes(routes35);
90137
90137
  }
90138
- return routes34.map(serializeRoute).join(`
90138
+ return routes35.map(serializeRoute).join(`
90139
90139
  ${prefix}`);
90140
90140
  }
90141
90141
  function buildObjectTree(node, tree, prefix, options) {
@@ -91402,9 +91402,9 @@ var require_find_my_way = __commonJS({
91402
91402
  pathIndex = paramEndIndex;
91403
91403
  }
91404
91404
  };
91405
- Router.prototype._rebuild = function(routes34) {
91405
+ Router.prototype._rebuild = function(routes35) {
91406
91406
  this.reset();
91407
- for (const route of routes34) {
91407
+ for (const route of routes35) {
91408
91408
  const { method, path: path22, opts, handler, store } = route;
91409
91409
  this._on(method, path22, opts, handler, store);
91410
91410
  }
@@ -100612,8 +100612,8 @@ var require_commonjs6 = __commonJS({
100612
100612
  return this.#fullpath = this.name;
100613
100613
  }
100614
100614
  const pv = p2.fullpath();
100615
- const fp35 = pv + (!p2.parent ? "" : this.sep) + name25;
100616
- return this.#fullpath = fp35;
100615
+ const fp36 = pv + (!p2.parent ? "" : this.sep) + name25;
100616
+ return this.#fullpath = fp36;
100617
100617
  }
100618
100618
  /**
100619
100619
  * On platforms other than windows, this is identical to fullpath.
@@ -101342,8 +101342,8 @@ var require_commonjs6 = __commonJS({
101342
101342
  *
101343
101343
  * @internal
101344
101344
  */
101345
- constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs14 = defaultFS } = {}) {
101346
- this.#fs = fsFromOption(fs14);
101345
+ constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs15 = defaultFS } = {}) {
101346
+ this.#fs = fsFromOption(fs15);
101347
101347
  if (cwd instanceof URL || cwd.startsWith("file://")) {
101348
101348
  cwd = (0, node_url_1.fileURLToPath)(cwd);
101349
101349
  }
@@ -101902,8 +101902,8 @@ var require_commonjs6 = __commonJS({
101902
101902
  /**
101903
101903
  * @internal
101904
101904
  */
101905
- newRoot(fs14) {
101906
- return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs14 });
101905
+ newRoot(fs15) {
101906
+ return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs15 });
101907
101907
  }
101908
101908
  /**
101909
101909
  * Return true if the provided path string is an absolute path
@@ -101932,8 +101932,8 @@ var require_commonjs6 = __commonJS({
101932
101932
  /**
101933
101933
  * @internal
101934
101934
  */
101935
- newRoot(fs14) {
101936
- return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs14 });
101935
+ newRoot(fs15) {
101936
+ return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs15 });
101937
101937
  }
101938
101938
  /**
101939
101939
  * Return true if the provided path string is an absolute path
@@ -104288,7 +104288,7 @@ var require_createHttpError = __commonJS({
104288
104288
  var require_send = __commonJS({
104289
104289
  "../../node_modules/.pnpm/@fastify+send@4.1.0/node_modules/@fastify/send/lib/send.js"(exports, module) {
104290
104290
  "use strict";
104291
- var fs14 = __require("node:fs");
104291
+ var fs15 = __require("node:fs");
104292
104292
  var path22 = __require("node:path");
104293
104293
  var stream = __require("node:stream");
104294
104294
  var debug = __require("node:util").debuglog("send");
@@ -104497,7 +104497,7 @@ var require_send = __commonJS({
104497
104497
  }
104498
104498
  function tryStat(path23) {
104499
104499
  return new Promise((resolve4) => {
104500
- fs14.stat(path23, function onstat(error48, stat2) {
104500
+ fs15.stat(path23, function onstat(error48, stat2) {
104501
104501
  resolve4({ error: error48, stat: stat2 });
104502
104502
  });
104503
104503
  });
@@ -104637,7 +104637,7 @@ var require_send = __commonJS({
104637
104637
  metadata: { path: path23, stat: stat2 }
104638
104638
  };
104639
104639
  }
104640
- const stream2 = fs14.createReadStream(path23, {
104640
+ const stream2 = fs15.createReadStream(path23, {
104641
104641
  highWaterMark: options.highWaterMark,
104642
104642
  start: offset,
104643
104643
  end: Math.max(offset, offset + len - 1)
@@ -105135,18 +105135,18 @@ var require_dirList = __commonJS({
105135
105135
  "use strict";
105136
105136
  var os2 = __require("node:os");
105137
105137
  var path22 = __require("node:path");
105138
- var fs14 = __require("node:fs/promises");
105138
+ var fs15 = __require("node:fs/promises");
105139
105139
  var fastq = require_queue();
105140
105140
  var fastqConcurrency = Math.max(1, os2.cpus().length - 1);
105141
105141
  var dirList = {
105142
105142
  _getExtendedInfo: async function(dir, info) {
105143
105143
  const depth = dir.split(path22.sep).length;
105144
- const files = await fs14.readdir(dir);
105144
+ const files = await fs15.readdir(dir);
105145
105145
  const worker = async (filename) => {
105146
105146
  const filePath = path22.join(dir, filename);
105147
105147
  let stats;
105148
105148
  try {
105149
- stats = await fs14.stat(filePath);
105149
+ stats = await fs15.stat(filePath);
105150
105150
  } catch {
105151
105151
  return;
105152
105152
  }
@@ -105190,7 +105190,7 @@ var require_dirList = __commonJS({
105190
105190
  */
105191
105191
  list: async function(dir, options, dotfiles) {
105192
105192
  const entries = { dirs: [], files: [] };
105193
- let files = await fs14.readdir(dir);
105193
+ let files = await fs15.readdir(dir);
105194
105194
  if (dotfiles === "deny" || dotfiles === "ignore") {
105195
105195
  files = files.filter((file2) => file2.charAt(0) !== ".");
105196
105196
  }
@@ -105200,7 +105200,7 @@ var require_dirList = __commonJS({
105200
105200
  const worker = async (filename) => {
105201
105201
  let stats;
105202
105202
  try {
105203
- stats = await fs14.stat(path22.join(dir, filename));
105203
+ stats = await fs15.stat(path22.join(dir, filename));
105204
105204
  } catch {
105205
105205
  return;
105206
105206
  }
@@ -105329,7 +105329,7 @@ var require_static = __commonJS({
105329
105329
  var { fileURLToPath: fileURLToPath4 } = __require("node:url");
105330
105330
  var { statSync: statSync2 } = __require("node:fs");
105331
105331
  var { glob } = require_commonjs7();
105332
- var fp35 = require_plugin2();
105332
+ var fp36 = require_plugin2();
105333
105333
  var send = require_send2();
105334
105334
  var encodingNegotiator = require_accept_negotiator();
105335
105335
  var contentDisposition = require_content_disposition();
@@ -105433,7 +105433,7 @@ var require_static = __commonJS({
105433
105433
  } else {
105434
105434
  const indexes = new Set(opts.index === void 0 ? ["index.html"] : [].concat(opts.index));
105435
105435
  const indexDirs = /* @__PURE__ */ new Map();
105436
- const routes34 = /* @__PURE__ */ new Set();
105436
+ const routes35 = /* @__PURE__ */ new Set();
105437
105437
  const roots = Array.isArray(sendOptions.root) ? sendOptions.root : [sendOptions.root];
105438
105438
  for (let rootPath of roots) {
105439
105439
  rootPath = rootPath.split(path22.win32.sep).join(path22.posix.sep);
@@ -105449,10 +105449,10 @@ var require_static = __commonJS({
105449
105449
  for (let file2 of files) {
105450
105450
  file2 = file2.split(path22.win32.sep).join(path22.posix.sep);
105451
105451
  const route = prefix + file2;
105452
- if (routes34.has(route)) {
105452
+ if (routes35.has(route)) {
105453
105453
  continue;
105454
105454
  }
105455
- routes34.add(route);
105455
+ routes35.add(route);
105456
105456
  setUpHeadAndGet(routeOpts, route, `/${file2}`, rootPath);
105457
105457
  const key = path22.posix.basename(route);
105458
105458
  if (indexes.has(key) && !indexDirs.has(key)) {
@@ -105747,7 +105747,7 @@ var require_static = __commonJS({
105747
105747
  throw err;
105748
105748
  }
105749
105749
  }
105750
- module.exports = fp35(fastifyStatic2, {
105750
+ module.exports = fp36(fastifyStatic2, {
105751
105751
  fastify: "5.x",
105752
105752
  name: "@fastify/static"
105753
105753
  });
@@ -112390,7 +112390,7 @@ var require_websocket2 = __commonJS({
112390
112390
  var { ServerResponse } = __require("node:http");
112391
112391
  var { PassThrough } = __require("node:stream");
112392
112392
  var { randomBytes: randomBytes3 } = __require("node:crypto");
112393
- var fp35 = require_plugin2();
112393
+ var fp36 = require_plugin2();
112394
112394
  var WebSocket2 = require_ws();
112395
112395
  var Duplexify = require_duplexify();
112396
112396
  var kWs = /* @__PURE__ */ Symbol("ws-socket");
@@ -112576,7 +112576,7 @@ var require_websocket2 = __commonJS({
112576
112576
  }
112577
112577
  next();
112578
112578
  }
112579
- module.exports = fp35(fastifyWebsocket2, {
112579
+ module.exports = fp36(fastifyWebsocket2, {
112580
112580
  fastify: "5.x",
112581
112581
  name: "@fastify/websocket"
112582
112582
  });
@@ -115020,7 +115020,7 @@ var require_multipart2 = __commonJS({
115020
115020
  "use strict";
115021
115021
  var Busboy = require_main();
115022
115022
  var os2 = __require("node:os");
115023
- var fp35 = require_plugin2();
115023
+ var fp36 = require_plugin2();
115024
115024
  var { createWriteStream: createWriteStream2 } = __require("node:fs");
115025
115025
  var { unlink: unlink2 } = __require("node:fs/promises");
115026
115026
  var path22 = __require("node:path");
@@ -115469,7 +115469,7 @@ var require_multipart2 = __commonJS({
115469
115469
  }
115470
115470
  });
115471
115471
  }
115472
- module.exports = fp35(fastifyMultipart2, {
115472
+ module.exports = fp36(fastifyMultipart2, {
115473
115473
  fastify: "5.x",
115474
115474
  name: "@fastify/multipart"
115475
115475
  });
@@ -115594,7 +115594,7 @@ var require_token_io = __commonJS({
115594
115594
  });
115595
115595
  module.exports = __toCommonJS2(token_io_exports);
115596
115596
  var import_path15 = __toESM3(__require("path"));
115597
- var import_fs8 = __toESM3(__require("fs"));
115597
+ var import_fs9 = __toESM3(__require("fs"));
115598
115598
  var import_os4 = __toESM3(__require("os"));
115599
115599
  var import_token_error = require_token_error();
115600
115600
  function findRootDir() {
@@ -115602,7 +115602,7 @@ var require_token_io = __commonJS({
115602
115602
  let dir = process.cwd();
115603
115603
  while (dir !== import_path15.default.dirname(dir)) {
115604
115604
  const pkgPath = import_path15.default.join(dir, ".vercel");
115605
- if (import_fs8.default.existsSync(pkgPath)) {
115605
+ if (import_fs9.default.existsSync(pkgPath)) {
115606
115606
  return dir;
115607
115607
  }
115608
115608
  dir = import_path15.default.dirname(dir);
@@ -115673,7 +115673,7 @@ var require_auth_config = __commonJS({
115673
115673
  writeAuthConfig: () => writeAuthConfig
115674
115674
  });
115675
115675
  module.exports = __toCommonJS2(auth_config_exports);
115676
- var fs14 = __toESM3(__require("fs"));
115676
+ var fs15 = __toESM3(__require("fs"));
115677
115677
  var path22 = __toESM3(__require("path"));
115678
115678
  var import_token_util = require_token_util();
115679
115679
  function getAuthConfigPath() {
@@ -115688,10 +115688,10 @@ var require_auth_config = __commonJS({
115688
115688
  function readAuthConfig() {
115689
115689
  try {
115690
115690
  const authPath = getAuthConfigPath();
115691
- if (!fs14.existsSync(authPath)) {
115691
+ if (!fs15.existsSync(authPath)) {
115692
115692
  return null;
115693
115693
  }
115694
- const content = fs14.readFileSync(authPath, "utf8");
115694
+ const content = fs15.readFileSync(authPath, "utf8");
115695
115695
  if (!content) {
115696
115696
  return null;
115697
115697
  }
@@ -115703,10 +115703,10 @@ var require_auth_config = __commonJS({
115703
115703
  function writeAuthConfig(config2) {
115704
115704
  const authPath = getAuthConfigPath();
115705
115705
  const authDir = path22.dirname(authPath);
115706
- if (!fs14.existsSync(authDir)) {
115707
- fs14.mkdirSync(authDir, { mode: 504, recursive: true });
115706
+ if (!fs15.existsSync(authDir)) {
115707
+ fs15.mkdirSync(authDir, { mode: 504, recursive: true });
115708
115708
  }
115709
- fs14.writeFileSync(authPath, JSON.stringify(config2, null, 2), { mode: 384 });
115709
+ fs15.writeFileSync(authPath, JSON.stringify(config2, null, 2), { mode: 384 });
115710
115710
  }
115711
115711
  function isValidAccessToken(authConfig) {
115712
115712
  if (!authConfig.token)
@@ -115853,7 +115853,7 @@ var require_token_util = __commonJS({
115853
115853
  });
115854
115854
  module.exports = __toCommonJS2(token_util_exports);
115855
115855
  var path22 = __toESM3(__require("path"));
115856
- var fs14 = __toESM3(__require("fs"));
115856
+ var fs15 = __toESM3(__require("fs"));
115857
115857
  var import_token_error = require_token_error();
115858
115858
  var import_token_io = require_token_io();
115859
115859
  var import_auth_config = require_auth_config();
@@ -115938,12 +115938,12 @@ var require_token_util = __commonJS({
115938
115938
  );
115939
115939
  }
115940
115940
  const prjPath = path22.join(dir, ".vercel", "project.json");
115941
- if (!fs14.existsSync(prjPath)) {
115941
+ if (!fs15.existsSync(prjPath)) {
115942
115942
  throw new import_token_error.VercelOidcTokenError(
115943
115943
  "project.json not found, have you linked your project with `vc link?`"
115944
115944
  );
115945
115945
  }
115946
- const prj = JSON.parse(fs14.readFileSync(prjPath, "utf8"));
115946
+ const prj = JSON.parse(fs15.readFileSync(prjPath, "utf8"));
115947
115947
  if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
115948
115948
  throw new TypeError(
115949
115949
  "Expected a string-valued projectId property. Try running `vc link` to re-link your project."
@@ -115960,9 +115960,9 @@ var require_token_util = __commonJS({
115960
115960
  }
115961
115961
  const tokenPath = path22.join(dir, "com.vercel.token", `${projectId}.json`);
115962
115962
  const tokenJson = JSON.stringify(token);
115963
- fs14.mkdirSync(path22.dirname(tokenPath), { mode: 504, recursive: true });
115964
- fs14.writeFileSync(tokenPath, tokenJson);
115965
- fs14.chmodSync(tokenPath, 432);
115963
+ fs15.mkdirSync(path22.dirname(tokenPath), { mode: 504, recursive: true });
115964
+ fs15.writeFileSync(tokenPath, tokenJson);
115965
+ fs15.chmodSync(tokenPath, 432);
115966
115966
  return;
115967
115967
  }
115968
115968
  function loadToken(projectId) {
@@ -115973,10 +115973,10 @@ var require_token_util = __commonJS({
115973
115973
  );
115974
115974
  }
115975
115975
  const tokenPath = path22.join(dir, "com.vercel.token", `${projectId}.json`);
115976
- if (!fs14.existsSync(tokenPath)) {
115976
+ if (!fs15.existsSync(tokenPath)) {
115977
115977
  return null;
115978
115978
  }
115979
- const token = JSON.parse(fs14.readFileSync(tokenPath, "utf8"));
115979
+ const token = JSON.parse(fs15.readFileSync(tokenPath, "utf8"));
115980
115980
  assertVercelOidcTokenResponse(token);
115981
115981
  return token;
115982
115982
  }
@@ -152239,9 +152239,9 @@ var require_pump = __commonJS({
152239
152239
  "../../node_modules/.pnpm/pump@3.0.3/node_modules/pump/index.js"(exports, module) {
152240
152240
  var once = require_once();
152241
152241
  var eos = require_end_of_stream2();
152242
- var fs14;
152242
+ var fs15;
152243
152243
  try {
152244
- fs14 = __require("fs");
152244
+ fs15 = __require("fs");
152245
152245
  } catch (e) {
152246
152246
  }
152247
152247
  var noop4 = function() {
@@ -152252,8 +152252,8 @@ var require_pump = __commonJS({
152252
152252
  };
152253
152253
  var isFS = function(stream) {
152254
152254
  if (!ancient) return false;
152255
- if (!fs14) return false;
152256
- return (stream instanceof (fs14.ReadStream || noop4) || stream instanceof (fs14.WriteStream || noop4)) && isFn(stream.close);
152255
+ if (!fs15) return false;
152256
+ return (stream instanceof (fs15.ReadStream || noop4) || stream instanceof (fs15.WriteStream || noop4)) && isFn(stream.close);
152257
152257
  };
152258
152258
  var isRequest = function(stream) {
152259
152259
  return stream.setHeader && isFn(stream.abort);
@@ -154377,6 +154377,8 @@ import path from "path";
154377
154377
  var VIBEDECKX_HOME = path.join(homedir(), ".vibedeckx");
154378
154378
  var DB_PATH = path.join(VIBEDECKX_HOME, "data.sqlite");
154379
154379
  var DEFAULT_PORT = 5173;
154380
+ var MIN_WORKER_VERSION = "0.0.0";
154381
+ var WORKER_VERSION_REPORTING_SINCE = "2026-08-03";
154380
154382
 
154381
154383
  // src/load-env.ts
154382
154384
  function getArg(argv, name25) {
@@ -169019,11 +169021,11 @@ function buildCommand(builderArgs) {
169019
169021
  }
169020
169022
  };
169021
169023
  }
169022
- function* generateRouteMapHelpLines(routes34, docs, args) {
169024
+ function* generateRouteMapHelpLines(routes35, docs, args) {
169023
169025
  const { brief, fullDescription, hideRoute } = docs;
169024
169026
  const { headers } = args.text;
169025
169027
  yield args.ansiColor ? `\x1B[1m${headers.usage}\x1B[22m` : headers.usage;
169026
- for (const [name25, route] of Object.entries(routes34)) {
169028
+ for (const [name25, route] of Object.entries(routes35)) {
169027
169029
  if (!hideRoute || !hideRoute[name25] || args.includeHidden) {
169028
169030
  const externalRouteName = args.config.caseStyle === "convert-camel-to-kebab" ? convertCamelCaseToKebabCase(name25) : name25;
169029
169031
  yield ` ${route.formatUsageLine({
@@ -169053,7 +169055,7 @@ function* generateRouteMapHelpLines(routes34, docs, args) {
169053
169055
  }
169054
169056
  yield "";
169055
169057
  yield args.ansiColor ? `\x1B[1m${headers.commands}\x1B[22m` : headers.commands;
169056
- const visibleRoutes = Object.entries(routes34).filter(
169058
+ const visibleRoutes = Object.entries(routes35).filter(
169057
169059
  ([name25]) => !hideRoute || !hideRoute[name25] || args.includeHidden
169058
169060
  );
169059
169061
  const rows = visibleRoutes.map(([internalRouteName, route]) => {
@@ -169081,24 +169083,24 @@ function* generateRouteMapHelpLines(routes34, docs, args) {
169081
169083
  }
169082
169084
  }
169083
169085
  function buildRouteMap({
169084
- routes: routes34,
169086
+ routes: routes35,
169085
169087
  defaultCommand: defaultCommandRoute,
169086
169088
  docs,
169087
169089
  aliases
169088
169090
  }) {
169089
- if (Object.entries(routes34).length === 0) {
169091
+ if (Object.entries(routes35).length === 0) {
169090
169092
  throw new InternalError("Route map must contain at least one route");
169091
169093
  }
169092
169094
  const activeAliases = aliases ?? {};
169093
169095
  const aliasesByRoute = /* @__PURE__ */ new Map();
169094
169096
  for (const [alias, routeName] of Object.entries(activeAliases)) {
169095
- if (alias in routes34) {
169097
+ if (alias in routes35) {
169096
169098
  throw new InternalError(`Cannot use "${alias}" as an alias when a route with that name already exists`);
169097
169099
  }
169098
169100
  const routeAliases = aliasesByRoute.get(routeName) ?? [];
169099
169101
  aliasesByRoute.set(routeName, [...routeAliases, alias]);
169100
169102
  }
169101
- const defaultCommand = defaultCommandRoute ? routes34[defaultCommandRoute] : void 0;
169103
+ const defaultCommand = defaultCommandRoute ? routes35[defaultCommandRoute] : void 0;
169102
169104
  if (defaultCommand && defaultCommand.kind === RouteMapSymbol) {
169103
169105
  throw new InternalError(
169104
169106
  `Cannot use "${defaultCommandRoute}" as the default command because it is not a Command`
@@ -169107,7 +169109,7 @@ function buildRouteMap({
169107
169109
  const resolveRouteName = (input) => {
169108
169110
  if (input in activeAliases) {
169109
169111
  return activeAliases[input];
169110
- } else if (input in routes34) {
169112
+ } else if (input in routes35) {
169111
169113
  return input;
169112
169114
  }
169113
169115
  };
@@ -169125,7 +169127,7 @@ function buildRouteMap({
169125
169127
  return `${args.prefix.join(" ")} ${routeNames.join("|")} ...`;
169126
169128
  },
169127
169129
  formatHelp: (config2) => {
169128
- const lines = [...generateRouteMapHelpLines(routes34, docs, config2)];
169130
+ const lines = [...generateRouteMapHelpLines(routes35, docs, config2)];
169129
169131
  const text2 = lines.join("\n");
169130
169132
  return text2 + "\n";
169131
169133
  },
@@ -169168,11 +169170,11 @@ function buildRouteMap({
169168
169170
  },
169169
169171
  getRoutingTargetForInput: (input) => {
169170
169172
  const routeName = input in activeAliases ? activeAliases[input] : input;
169171
- return routes34[routeName];
169173
+ return routes35[routeName];
169172
169174
  },
169173
169175
  getAllEntries() {
169174
169176
  const hiddenRoutes = docs.hideRoute;
169175
- return Object.entries(routes34).map(([originalRouteName, target]) => {
169177
+ return Object.entries(routes35).map(([originalRouteName, target]) => {
169176
169178
  return {
169177
169179
  name: {
169178
169180
  original: originalRouteName,
@@ -169192,7 +169194,7 @@ async function run(app, inputs, context2) {
169192
169194
  }
169193
169195
 
169194
169196
  // src/command.ts
169195
- import fs13 from "node:fs";
169197
+ import fs14 from "node:fs";
169196
169198
  import path21 from "node:path";
169197
169199
 
169198
169200
  // src/storage/sqlite.ts
@@ -185910,8 +185912,6 @@ var mapProject = (row) => ({
185910
185912
  path: row.path,
185911
185913
  is_remote: fromDbBool(row.is_remote),
185912
185914
  remote_path: row.remote_path ?? void 0,
185913
- remote_url: row.remote_url ?? void 0,
185914
- remote_api_key: row.remote_api_key ?? void 0,
185915
185915
  agent_mode: row.agent_mode ?? "local",
185916
185916
  executor_mode: row.executor_mode ?? "local",
185917
185917
  sync_up_config: row.sync_up_config ? JSON.parse(row.sync_up_config) : void 0,
@@ -185927,10 +185927,10 @@ var createCoreRepos = (kdb, h) => ({
185927
185927
  path: opts.path ?? null,
185928
185928
  remote_path: opts.remote_path ?? null,
185929
185929
  is_remote: h.toDbBool(false),
185930
- remote_url: null,
185931
- remote_api_key: null,
185932
- // Dead column: never populated by any current caller (kept only so
185933
- // legacy DDL/back-compat readers relying on its presence don't break).
185930
+ // Dead columns: never populated by any current caller (kept only so
185931
+ // legacy DDL/back-compat readers relying on their presence don't break).
185932
+ // remote_url/remote_api_key are leftovers from the removed direct-URL
185933
+ // (outbound) transport all remote traffic rides reverse-connect now.
185934
185934
  remote_project_id: null,
185935
185935
  agent_mode: opts.agent_mode ?? "local",
185936
185936
  executor_mode: opts.executor_mode ?? "local",
@@ -186051,9 +186051,21 @@ var mapRemoteServer = (row) => ({
186051
186051
  status: row.status ?? "unknown",
186052
186052
  last_connected_at: row.last_connected_at ?? void 0,
186053
186053
  cross_remote_access: row.cross_remote_access ?? "off",
186054
+ worker_version: row.worker_version ?? void 0,
186055
+ worker_capabilities: parseWorkerCapabilities(row.worker_capabilities),
186056
+ worker_version_reported_at: row.worker_version_reported_at ?? void 0,
186054
186057
  created_at: row.created_at,
186055
186058
  updated_at: row.updated_at
186056
186059
  });
186060
+ function parseWorkerCapabilities(raw) {
186061
+ if (!raw) return void 0;
186062
+ try {
186063
+ const parsed = JSON.parse(raw);
186064
+ return Array.isArray(parsed) ? parsed.filter((c) => typeof c === "string") : void 0;
186065
+ } catch {
186066
+ return void 0;
186067
+ }
186068
+ }
186057
186069
  var mapProjectRemote = (row) => ({
186058
186070
  id: row.id,
186059
186071
  project_id: row.project_id,
@@ -186101,9 +186113,6 @@ var createRemoteServerRepos = (kdb, _h) => ({
186101
186113
  await kdb.insertInto("remote_servers").values({
186102
186114
  id,
186103
186115
  name: server.name,
186104
- url: null,
186105
- api_key: null,
186106
- connection_mode: "inbound",
186107
186116
  connect_token: null,
186108
186117
  connect_token_created_at: null,
186109
186118
  last_connected_at: null,
@@ -186152,6 +186161,14 @@ var createRemoteServerRepos = (kdb, _h) => ({
186152
186161
  if (status === "online") sets.last_connected_at = sql`datetime('now')`;
186153
186162
  await kdb.updateTable("remote_servers").set(sets).where("id", "=", id).execute();
186154
186163
  },
186164
+ updateWorkerVersion: async (id, version2, capabilities) => {
186165
+ await kdb.updateTable("remote_servers").set({
186166
+ worker_version: version2,
186167
+ worker_capabilities: JSON.stringify(capabilities),
186168
+ worker_version_reported_at: sql`datetime('now')`,
186169
+ updated_at: sql`datetime('now')`
186170
+ }).where("id", "=", id).execute();
186171
+ },
186155
186172
  generateToken: async (id, userId) => {
186156
186173
  const existing = await readRemoteServerRow(kdb, id, userId);
186157
186174
  if (!existing) return void 0;
@@ -186318,8 +186335,17 @@ var mapExecutorProcess = (row) => ({
186318
186335
  status: row.status
186319
186336
  });
186320
186337
  var mapRemoteExecutorProcess = (row) => ({
186321
- ...row,
186322
- status: row.status
186338
+ local_process_id: row.local_process_id,
186339
+ remote_server_id: row.remote_server_id,
186340
+ remote_process_id: row.remote_process_id,
186341
+ executor_id: row.executor_id,
186342
+ project_id: row.project_id,
186343
+ branch: row.branch,
186344
+ started_at: row.started_at,
186345
+ status: row.status,
186346
+ exit_code: row.exit_code,
186347
+ finished_at: row.finished_at,
186348
+ machine_id: row.machine_id
186323
186349
  });
186324
186350
  var createExecutorRepos = (kdb, h) => ({
186325
186351
  executorGroups: {
@@ -187149,6 +187175,10 @@ var createSearchCacheRepos = (kdb, _h) => ({
187149
187175
  ]).executeTakeFirstOrThrow();
187150
187176
  return { running: Number(row.running) };
187151
187177
  },
187178
+ countRunningRemoteSessions: async () => {
187179
+ const row = await kdb.selectFrom("session_search_cache as c").innerJoin("remote_session_mappings as mapping", (join2) => join2.onRef("mapping.local_session_id", "=", "c.local_session_id").onRef("mapping.project_id", "=", "c.project_id").onRef("mapping.remote_server_id", "=", "c.target_id")).innerJoin("project_remotes as association", (join2) => join2.onRef("association.project_id", "=", "c.project_id").onRef("association.remote_server_id", "=", "c.target_id")).where("c.target_id", "!=", "local").where("c.deleted_at", "is", null).where("c.status", "=", "running").select([sql`count(*)`.as("n")]).executeTakeFirstOrThrow();
187180
+ return Number(row.n);
187181
+ },
187152
187182
  updateRemoteSessionActivity: async (entry) => {
187153
187183
  return kdb.transaction().execute(async (trx) => {
187154
187184
  const authorized = await trx.selectFrom("remote_session_mappings as mapping").innerJoin("project_remotes as association", (join2) => join2.onRef("association.project_id", "=", "mapping.project_id").onRef("association.remote_server_id", "=", "mapping.remote_server_id")).select("mapping.branch").where("mapping.local_session_id", "=", entry.localSessionId).where("mapping.project_id", "=", entry.projectId).where("mapping.remote_server_id", "=", entry.targetId).where("mapping.remote_session_id", "=", entry.remoteSessionId).executeTakeFirst();
@@ -203388,6 +203418,14 @@ var createDatabase = (dbPath) => {
203388
203418
  `);
203389
203419
  }
203390
203420
  }
203421
+ {
203422
+ const workerVersionInfo = db.prepare("PRAGMA table_info(remote_servers)").all();
203423
+ for (const column of ["worker_version", "worker_capabilities", "worker_version_reported_at"]) {
203424
+ if (!workerVersionInfo.some((col) => col.name === column)) {
203425
+ db.exec(`ALTER TABLE remote_servers ADD COLUMN ${column} TEXT`);
203426
+ }
203427
+ }
203428
+ }
203391
203429
  db.exec("UPDATE remote_servers SET status = 'offline' WHERE status = 'online'");
203392
203430
  {
203393
203431
  const oldIndex = db.prepare(
@@ -238501,16 +238539,12 @@ function resolveUserId(authResult) {
238501
238539
  }
238502
238540
 
238503
238541
  // src/routes/project-routes.ts
238504
- function sanitizeProject(project) {
238505
- const { remote_api_key, ...safe } = project;
238506
- return { ...safe, has_remote_api_key: !!remote_api_key };
238507
- }
238508
238542
  var routes2 = async (fastify2) => {
238509
238543
  fastify2.get("/api/projects", async (req, reply) => {
238510
238544
  const authResult = requireAuth(req, reply);
238511
238545
  if (authResult === null) return;
238512
238546
  const userId = resolveUserId(authResult);
238513
- const projects = (await fastify2.storage.projects.getAll(userId)).map(sanitizeProject);
238547
+ const projects = await fastify2.storage.projects.getAll(userId);
238514
238548
  return reply.code(200).send({ projects });
238515
238549
  });
238516
238550
  fastify2.get("/api/projects/:id", async (req, reply) => {
@@ -238521,7 +238555,7 @@ var routes2 = async (fastify2) => {
238521
238555
  if (!project) {
238522
238556
  return reply.code(404).send({ error: "Project not found" });
238523
238557
  }
238524
- return reply.code(200).send({ project: sanitizeProject(project) });
238558
+ return reply.code(200).send({ project });
238525
238559
  });
238526
238560
  fastify2.post("/api/dialog/select-folder", async (req, reply) => {
238527
238561
  const folderPath = await selectFolder();
@@ -238592,7 +238626,7 @@ var routes2 = async (fastify2) => {
238592
238626
  agent_mode: agentMode,
238593
238627
  executor_mode: executorMode
238594
238628
  }, userId);
238595
- return reply.code(201).send({ project: sanitizeProject(project) });
238629
+ return reply.code(201).send({ project });
238596
238630
  });
238597
238631
  fastify2.put("/api/projects/:id", async (req, reply) => {
238598
238632
  const authResult = requireAuth(req, reply);
@@ -238632,7 +238666,7 @@ var routes2 = async (fastify2) => {
238632
238666
  if (!updated) {
238633
238667
  return reply.code(404).send({ error: "Project not found" });
238634
238668
  }
238635
- return reply.code(200).send({ project: sanitizeProject(updated) });
238669
+ return reply.code(200).send({ project: updated });
238636
238670
  });
238637
238671
  fastify2.delete("/api/projects/:id", async (req, reply) => {
238638
238672
  const authResult = requireAuth(req, reply);
@@ -238771,11 +238805,101 @@ function requireUserFacingOrTrustedProxyUserId(request, reply) {
238771
238805
  return authResult === void 0 && request.server.authEnabled ? void 0 : resolveUserId(authResult);
238772
238806
  }
238773
238807
 
238808
+ // src/update-check.ts
238809
+ var SEMVER_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
238810
+ async function fetchLatestPublishedVersion(pkg = "vibedeckx", fetchImpl = fetch) {
238811
+ try {
238812
+ const response = await fetchImpl(
238813
+ `https://registry.npmjs.org/${pkg}/latest`,
238814
+ { signal: AbortSignal.timeout(4e3) }
238815
+ );
238816
+ if (!response.ok) return void 0;
238817
+ const body = await response.json();
238818
+ return typeof body.version === "string" && parseSemver(body.version) ? body.version : void 0;
238819
+ } catch {
238820
+ return void 0;
238821
+ }
238822
+ }
238823
+ function parseSemver(version2) {
238824
+ const match2 = SEMVER_RE.exec(version2);
238825
+ if (!match2) return void 0;
238826
+ return {
238827
+ core: [match2[1], match2[2], match2[3]],
238828
+ prerelease: match2[4]?.split(".")
238829
+ };
238830
+ }
238831
+ function compareNumericStrings(a, b2) {
238832
+ if (a.length !== b2.length) return a.length - b2.length;
238833
+ return a < b2 ? -1 : a > b2 ? 1 : 0;
238834
+ }
238835
+ function comparePrereleaseIdentifiers(a, b2) {
238836
+ const aNumeric = /^\d+$/.test(a);
238837
+ const bNumeric = /^\d+$/.test(b2);
238838
+ if (aNumeric && bNumeric) return compareNumericStrings(a, b2);
238839
+ if (aNumeric !== bNumeric) return aNumeric ? -1 : 1;
238840
+ return a < b2 ? -1 : a > b2 ? 1 : 0;
238841
+ }
238842
+ function compareSemver(a, b2) {
238843
+ for (let i = 0; i < 3; i += 1) {
238844
+ const compared = compareNumericStrings(a.core[i], b2.core[i]);
238845
+ if (compared !== 0) return compared;
238846
+ }
238847
+ if (!a.prerelease && !b2.prerelease) return 0;
238848
+ if (!a.prerelease) return 1;
238849
+ if (!b2.prerelease) return -1;
238850
+ const length = Math.max(a.prerelease.length, b2.prerelease.length);
238851
+ for (let i = 0; i < length; i += 1) {
238852
+ const aId = a.prerelease[i];
238853
+ const bId = b2.prerelease[i];
238854
+ if (aId === void 0) return -1;
238855
+ if (bId === void 0) return 1;
238856
+ const compared = comparePrereleaseIdentifiers(aId, bId);
238857
+ if (compared !== 0) return compared;
238858
+ }
238859
+ return 0;
238860
+ }
238861
+ function compareVersionStrings(a, b2) {
238862
+ const parsedA = parseSemver(a);
238863
+ const parsedB = parseSemver(b2);
238864
+ if (!parsedA || !parsedB) return void 0;
238865
+ return compareSemver(parsedA, parsedB);
238866
+ }
238867
+ function compareUpdateStatus(current, latest) {
238868
+ if (latest === void 0) return "unknown";
238869
+ const currentParsed = parseSemver(current);
238870
+ const latestParsed = parseSemver(latest);
238871
+ if (!currentParsed || !latestParsed) return "unknown";
238872
+ return compareSemver(latestParsed, currentParsed) > 0 ? "update-available" : "up-to-date";
238873
+ }
238874
+
238774
238875
  // src/routes/remote-server-routes.ts
238775
238876
  function sanitizeServer(server) {
238776
238877
  const { connect_token: _t, ...safe } = server;
238777
238878
  return safe;
238778
238879
  }
238880
+ var npmLatestCache;
238881
+ var npmLatestRefreshInFlight = false;
238882
+ function getLatestWorkerVersion() {
238883
+ const ttlMs = npmLatestCache?.value !== void 0 ? 60 * 60 * 1e3 : 5 * 60 * 1e3;
238884
+ const fresh = npmLatestCache !== void 0 && Date.now() - npmLatestCache.fetchedAt < ttlMs;
238885
+ if (!fresh && !npmLatestRefreshInFlight) {
238886
+ npmLatestRefreshInFlight = true;
238887
+ void fetchLatestPublishedVersion().then((value) => {
238888
+ npmLatestCache = { value, fetchedAt: Date.now() };
238889
+ }).finally(() => {
238890
+ npmLatestRefreshInFlight = false;
238891
+ });
238892
+ }
238893
+ return npmLatestCache?.value;
238894
+ }
238895
+ function workerUpdateStatus(workerVersion, latest) {
238896
+ if (!workerVersion) return "unreported";
238897
+ const vsMin = compareVersionStrings(workerVersion, MIN_WORKER_VERSION);
238898
+ if (vsMin !== void 0 && vsMin < 0) return "behind-min";
238899
+ const vsLatest = latest === void 0 ? void 0 : compareVersionStrings(workerVersion, latest);
238900
+ if (vsLatest !== void 0 && vsLatest < 0) return "behind-latest";
238901
+ return "current";
238902
+ }
238779
238903
  var CROSS_REMOTE_ACCESS_VALUES = ["off", "read", "exec"];
238780
238904
  var isCrossRemoteAccess = (value) => typeof value === "string" && CROSS_REMOTE_ACCESS_VALUES.includes(value);
238781
238905
  var routes3 = async (fastify2) => {
@@ -238783,7 +238907,12 @@ var routes3 = async (fastify2) => {
238783
238907
  const userId = requireUserFacingUserId(request, reply);
238784
238908
  if (userId === null) return;
238785
238909
  const servers = await fastify2.storage.remoteServers.getAll(userId);
238786
- return reply.send(servers.map(sanitizeServer));
238910
+ const latest = getLatestWorkerVersion();
238911
+ return reply.send(servers.map((server) => ({
238912
+ ...sanitizeServer(server),
238913
+ latest_worker_version: latest,
238914
+ worker_update_status: workerUpdateStatus(server.worker_version, latest)
238915
+ })));
238787
238916
  });
238788
238917
  fastify2.post("/api/remote-servers", async (request, reply) => {
238789
238918
  const userId = requireUserFacingUserId(request, reply);
@@ -238942,12 +239071,94 @@ var routes3 = async (fastify2) => {
238942
239071
  };
238943
239072
  var remote_server_routes_default = (0, import_fastify_plugin4.default)(routes3, { name: "remote-server-routes" });
238944
239073
 
238945
- // src/routes/project-remote-routes.ts
239074
+ // src/routes/worker-stats-routes.ts
238946
239075
  var import_fastify_plugin5 = __toESM(require_plugin2(), 1);
239076
+ var API_KEY = process.env.VIBEDECKX_API_KEY || void 0;
239077
+ var STALE_WORKER_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
239078
+ var PHASE4_UNKNOWN_SHARE_MAX = 0.05;
239079
+ var PHASE4_DEPRECATION_DAYS = 60;
239080
+ function parseDbTimestamp3(ts) {
239081
+ if (!ts) return void 0;
239082
+ const ms = Date.parse(ts.replace(" ", "T") + "Z");
239083
+ return Number.isNaN(ms) ? void 0 : ms;
239084
+ }
239085
+ function countByVersion(versions) {
239086
+ const counts = {};
239087
+ for (const version2 of versions) {
239088
+ const key = version2 ?? "unknown";
239089
+ counts[key] = (counts[key] ?? 0) + 1;
239090
+ }
239091
+ return counts;
239092
+ }
239093
+ function oldestVersion(versions) {
239094
+ let oldest;
239095
+ for (const version2 of versions) {
239096
+ if (oldest === void 0) {
239097
+ oldest = version2;
239098
+ continue;
239099
+ }
239100
+ const cmp = compareVersionStrings(version2, oldest);
239101
+ if (cmp !== void 0 && cmp < 0) oldest = version2;
239102
+ }
239103
+ return oldest;
239104
+ }
239105
+ var routes4 = async (fastify2) => {
239106
+ fastify2.get("/api/admin/worker-version-stats", async (request, reply) => {
239107
+ const apiKeyHeader = request.headers["x-vibedeckx-api-key"];
239108
+ const isOperator = API_KEY !== void 0 && apiKeyHeader !== void 0 || !fastify2.authEnabled && API_KEY === void 0;
239109
+ if (!isOperator) return reply.code(404).send({ error: "Not found" });
239110
+ const now3 = Date.now();
239111
+ const servers = await fastify2.storage.remoteServers.getAll();
239112
+ const connected = servers.filter((server) => fastify2.reverseConnectManager.isConnected(server.id));
239113
+ const everActive = servers.filter((server) => server.last_connected_at !== void 0);
239114
+ const connectedVersions = connected.map((server) => server.worker_version);
239115
+ const unknownConnected = connectedVersions.filter((v2) => v2 === void 0).length;
239116
+ const unknownShareConnected = connected.length > 0 ? unknownConnected / connected.length : null;
239117
+ const daysSinceReporting = Math.floor(
239118
+ (now3 - Date.parse(WORKER_VERSION_REPORTING_SINCE)) / (24 * 60 * 60 * 1e3)
239119
+ );
239120
+ return reply.send({
239121
+ min_worker_version: MIN_WORKER_VERSION,
239122
+ reporting_since: WORKER_VERSION_REPORTING_SINCE,
239123
+ workers_total: servers.length,
239124
+ connected_workers: connected.length,
239125
+ // Two lenses on the distribution: _all accumulates dead rows forever
239126
+ // (abandoned trials), _connected is the one Phase 4 decisions use.
239127
+ versions_all: countByVersion(servers.map((server) => server.worker_version)),
239128
+ versions_connected: countByVersion(connectedVersions),
239129
+ oldest_connected_version: oldestVersion(
239130
+ connectedVersions.filter((v2) => v2 !== void 0)
239131
+ ) ?? null,
239132
+ // Deploy blast radius: how many live tunnels a restart would sever, and
239133
+ // how many of those are mid-turn (the actual user harm — idle sessions
239134
+ // recover on reconnect).
239135
+ active_remote_sessions: fastify2.remoteSessionMap.size,
239136
+ active_turns: await fastify2.storage.searchCache.countRunningRemoteSessions(),
239137
+ // Upgrade-failure tripwire: workers that were active once but have been
239138
+ // offline > 7 days — the classic "daemon didn't come back" signature.
239139
+ stale_workers_7d: everActive.filter((server) => {
239140
+ if (fastify2.reverseConnectManager.isConnected(server.id)) return false;
239141
+ const lastSeen = parseDbTimestamp3(server.last_connected_at);
239142
+ return lastSeen !== void 0 && now3 - lastSeen > STALE_WORKER_THRESHOLD_MS;
239143
+ }).length,
239144
+ phase4_ready: {
239145
+ unknown_share_connected: unknownShareConnected,
239146
+ unknown_share_max: PHASE4_UNKNOWN_SHARE_MAX,
239147
+ days_since_reporting_release: daysSinceReporting,
239148
+ deprecation_days: PHASE4_DEPRECATION_DAYS,
239149
+ verdict: unknownShareConnected !== null && unknownShareConnected < PHASE4_UNKNOWN_SHARE_MAX && daysSinceReporting >= PHASE4_DEPRECATION_DAYS
239150
+ }
239151
+ });
239152
+ });
239153
+ };
239154
+ var worker_stats_routes_default = (0, import_fastify_plugin5.default)(routes4, { name: "worker-stats-routes" });
239155
+
239156
+ // src/routes/project-remote-routes.ts
239157
+ var import_fastify_plugin6 = __toESM(require_plugin2(), 1);
238947
239158
  function sanitizeProjectRemote(pr) {
238948
239159
  return pr;
238949
239160
  }
238950
- var routes4 = async (fastify2) => {
239161
+ var routes5 = async (fastify2) => {
238951
239162
  fastify2.get(
238952
239163
  "/api/projects/:id/remotes",
238953
239164
  async (request, reply) => {
@@ -239047,12 +239258,12 @@ var routes4 = async (fastify2) => {
239047
239258
  }
239048
239259
  );
239049
239260
  };
239050
- var project_remote_routes_default = (0, import_fastify_plugin5.default)(routes4, { name: "project-remote-routes" });
239261
+ var project_remote_routes_default = (0, import_fastify_plugin6.default)(routes5, { name: "project-remote-routes" });
239051
239262
 
239052
239263
  // src/routes/executor-group-routes.ts
239053
- var import_fastify_plugin6 = __toESM(require_plugin2(), 1);
239264
+ var import_fastify_plugin7 = __toESM(require_plugin2(), 1);
239054
239265
  import { randomUUID as randomUUID11 } from "crypto";
239055
- var routes5 = async (fastify2) => {
239266
+ var routes6 = async (fastify2) => {
239056
239267
  fastify2.get(
239057
239268
  "/api/projects/:projectId/executor-groups",
239058
239269
  async (req, reply) => {
@@ -239123,17 +239334,17 @@ var routes5 = async (fastify2) => {
239123
239334
  }
239124
239335
  );
239125
239336
  };
239126
- var executor_group_routes_default = (0, import_fastify_plugin6.default)(routes5, { name: "executor-group-routes" });
239337
+ var executor_group_routes_default = (0, import_fastify_plugin7.default)(routes6, { name: "executor-group-routes" });
239127
239338
 
239128
239339
  // src/routes/executor-routes.ts
239129
- var import_fastify_plugin7 = __toESM(require_plugin2(), 1);
239340
+ var import_fastify_plugin8 = __toESM(require_plugin2(), 1);
239130
239341
  import { randomUUID as randomUUID12 } from "crypto";
239131
239342
  function normalizeSqlTimestamp(value) {
239132
239343
  if (!value) return null;
239133
239344
  if (value.includes("T") && /(Z|[+-]\d{2}:?\d{2})$/.test(value)) return value;
239134
239345
  return value.replace(" ", "T") + "Z";
239135
239346
  }
239136
- var routes6 = async (fastify2) => {
239347
+ var routes7 = async (fastify2) => {
239137
239348
  fastify2.get(
239138
239349
  "/api/projects/:projectId/executors",
239139
239350
  async (req, reply) => {
@@ -239272,13 +239483,13 @@ var routes6 = async (fastify2) => {
239272
239483
  return reply.code(200).send({ success: true });
239273
239484
  });
239274
239485
  };
239275
- var executor_routes_default = (0, import_fastify_plugin7.default)(routes6, { name: "executor-routes" });
239486
+ var executor_routes_default = (0, import_fastify_plugin8.default)(routes7, { name: "executor-routes" });
239276
239487
 
239277
239488
  // src/routes/process-routes.ts
239278
- var import_fastify_plugin8 = __toESM(require_plugin2(), 1);
239489
+ var import_fastify_plugin9 = __toESM(require_plugin2(), 1);
239279
239490
  import path9 from "path";
239280
239491
  import { randomUUID as randomUUID13 } from "crypto";
239281
- var routes7 = async (fastify2) => {
239492
+ var routes8 = async (fastify2) => {
239282
239493
  fastify2.post("/api/path/execute", async (req, reply) => {
239283
239494
  const userId = requireAuth(req, reply);
239284
239495
  if (userId === null) return;
@@ -239490,10 +239701,10 @@ var routes7 = async (fastify2) => {
239490
239701
  return reply.code(200).send({ processes });
239491
239702
  });
239492
239703
  };
239493
- var process_routes_default = (0, import_fastify_plugin8.default)(routes7, { name: "process-routes" });
239704
+ var process_routes_default = (0, import_fastify_plugin9.default)(routes8, { name: "process-routes" });
239494
239705
 
239495
239706
  // src/routes/worktree-routes.ts
239496
- var import_fastify_plugin9 = __toESM(require_plugin2(), 1);
239707
+ var import_fastify_plugin10 = __toESM(require_plugin2(), 1);
239497
239708
  import { mkdir as mkdir3 } from "fs/promises";
239498
239709
  async function getAllRemoteConfigs(fastify2, project) {
239499
239710
  const remotes = await fastify2.storage.projectRemotes.getByProject(project.id);
@@ -239506,7 +239717,7 @@ async function getRemoteConfig(fastify2, project) {
239506
239717
  const all = await getAllRemoteConfigs(fastify2, project);
239507
239718
  return all.length > 0 ? all[0] : null;
239508
239719
  }
239509
- var routes8 = async (fastify2) => {
239720
+ var routes9 = async (fastify2) => {
239510
239721
  fastify2.get("/api/path/branches", async (req, reply) => {
239511
239722
  const projectPath = req.query.path;
239512
239723
  if (!projectPath) {
@@ -240034,10 +240245,10 @@ var routes8 = async (fastify2) => {
240034
240245
  });
240035
240246
  });
240036
240247
  };
240037
- var worktree_routes_default = (0, import_fastify_plugin9.default)(routes8, { name: "worktree-routes" });
240248
+ var worktree_routes_default = (0, import_fastify_plugin10.default)(routes9, { name: "worktree-routes" });
240038
240249
 
240039
240250
  // src/routes/diff-routes.ts
240040
- var import_fastify_plugin10 = __toESM(require_plugin2(), 1);
240251
+ var import_fastify_plugin11 = __toESM(require_plugin2(), 1);
240041
240252
  import path10 from "path";
240042
240253
  import { readFileSync as readFileSync4 } from "fs";
240043
240254
  import { execFileSync as execFileSync5 } from "child_process";
@@ -240345,7 +240556,7 @@ async function getUntrackedFiles(cwd) {
240345
240556
  }
240346
240557
  return files;
240347
240558
  }
240348
- var routes9 = async (fastify2) => {
240559
+ var routes10 = async (fastify2) => {
240349
240560
  fastify2.get("/api/path/diff", async (req, reply) => {
240350
240561
  const projectPath = req.query.path;
240351
240562
  if (!projectPath) {
@@ -240536,10 +240747,10 @@ var routes9 = async (fastify2) => {
240536
240747
  }
240537
240748
  });
240538
240749
  };
240539
- var diff_routes_default = (0, import_fastify_plugin10.default)(routes9, { name: "diff-routes" });
240750
+ var diff_routes_default = (0, import_fastify_plugin11.default)(routes10, { name: "diff-routes" });
240540
240751
 
240541
240752
  // src/routes/file-routes.ts
240542
- var import_fastify_plugin11 = __toESM(require_plugin2(), 1);
240753
+ var import_fastify_plugin12 = __toESM(require_plugin2(), 1);
240543
240754
  import path11 from "path";
240544
240755
  import fs2 from "fs/promises";
240545
240756
  import { createReadStream, constants as fsConstants } from "fs";
@@ -240762,7 +240973,7 @@ async function searchSymbol(basePath33, symbol26) {
240762
240973
  }
240763
240974
  return { hits, truncated };
240764
240975
  }
240765
- var routes10 = async (fastify2) => {
240976
+ var routes11 = async (fastify2) => {
240766
240977
  fastify2.get("/api/path/browse", async (req, reply) => {
240767
240978
  const projectPath = req.query.path;
240768
240979
  if (!projectPath) {
@@ -241323,10 +241534,10 @@ var routes10 = async (fastify2) => {
241323
241534
  }
241324
241535
  });
241325
241536
  };
241326
- var file_routes_default = (0, import_fastify_plugin11.default)(routes10, { name: "file-routes" });
241537
+ var file_routes_default = (0, import_fastify_plugin12.default)(routes11, { name: "file-routes" });
241327
241538
 
241328
241539
  // src/routes/agent-session-routes.ts
241329
- var import_fastify_plugin12 = __toESM(require_plugin2(), 1);
241540
+ var import_fastify_plugin13 = __toESM(require_plugin2(), 1);
241330
241541
 
241331
241542
  // src/utils/paste-file.ts
241332
241543
  import { chmod, mkdir as mkdir4, open } from "node:fs/promises";
@@ -241377,7 +241588,7 @@ function messageTextLength(content) {
241377
241588
  }
241378
241589
  return n;
241379
241590
  }
241380
- var routes11 = async (fastify2) => {
241591
+ var routes12 = async (fastify2) => {
241381
241592
  const instructionReceiverToken = randomUUID15();
241382
241593
  const instructionDeliveryLocks = /* @__PURE__ */ new Map();
241383
241594
  async function serializeInstructionDelivery(key, effect) {
@@ -242731,10 +242942,10 @@ var routes11 = async (fastify2) => {
242731
242942
  return reply.code(200).send({ success: true, favorited });
242732
242943
  });
242733
242944
  };
242734
- var agent_session_routes_default = (0, import_fastify_plugin12.default)(routes11, { name: "agent-session-routes" });
242945
+ var agent_session_routes_default = (0, import_fastify_plugin13.default)(routes12, { name: "agent-session-routes" });
242735
242946
 
242736
242947
  // src/routes/branch-activity-routes.ts
242737
- var import_fastify_plugin13 = __toESM(require_plugin2(), 1);
242948
+ var import_fastify_plugin14 = __toESM(require_plugin2(), 1);
242738
242949
  function toResponse(map2) {
242739
242950
  return {
242740
242951
  branches: Array.from(map2.entries()).map(([branch, state]) => ({
@@ -242749,7 +242960,7 @@ function fromResponse(resp) {
242749
242960
  resp.branches.map((b2) => [b2.branch ?? "", { activity: b2.activity, since: b2.since }])
242750
242961
  );
242751
242962
  }
242752
- var routes12 = async (fastify2) => {
242963
+ var routes13 = async (fastify2) => {
242753
242964
  function proxyAuto(remoteServerId, method, apiPath, body) {
242754
242965
  return proxyToRemoteAuto(remoteServerId, method, apiPath, body, {
242755
242966
  reverseConnectManager: fastify2.reverseConnectManager
@@ -242814,10 +243025,10 @@ var routes12 = async (fastify2) => {
242814
243025
  }
242815
243026
  );
242816
243027
  };
242817
- var branch_activity_routes_default = (0, import_fastify_plugin13.default)(routes12, { name: "branch-activity-routes" });
243028
+ var branch_activity_routes_default = (0, import_fastify_plugin14.default)(routes13, { name: "branch-activity-routes" });
242818
243029
 
242819
243030
  // src/routes/merge-status-routes.ts
242820
- var import_fastify_plugin14 = __toESM(require_plugin2(), 1);
243031
+ var import_fastify_plugin15 = __toESM(require_plugin2(), 1);
242821
243032
  function resolveTargets(comparisons, storedTargets) {
242822
243033
  const sources = [];
242823
243034
  const effective = comparisons.map((comparison) => {
@@ -242931,7 +243142,7 @@ function sendComputed(reply, repoPath, comparisons, repository) {
242931
243142
  return reply.code(statusCode).send({ error: message });
242932
243143
  }
242933
243144
  }
242934
- var routes13 = async (fastify2) => {
243145
+ var routes14 = async (fastify2) => {
242935
243146
  fastify2.post(
242936
243147
  "/api/path/branches/merge-status",
242937
243148
  async (req, reply) => {
@@ -243053,11 +243264,11 @@ var routes13 = async (fastify2) => {
243053
243264
  }
243054
243265
  );
243055
243266
  };
243056
- var merge_status_routes_default = (0, import_fastify_plugin14.default)(routes13, { name: "merge-status-routes" });
243267
+ var merge_status_routes_default = (0, import_fastify_plugin15.default)(routes14, { name: "merge-status-routes" });
243057
243268
 
243058
243269
  // src/routes/chat-session-routes.ts
243059
- var import_fastify_plugin15 = __toESM(require_plugin2(), 1);
243060
- var routes14 = async (fastify2) => {
243270
+ var import_fastify_plugin16 = __toESM(require_plugin2(), 1);
243271
+ var routes15 = async (fastify2) => {
243061
243272
  const getAuthorizedSession = (req, reply, sessionId) => {
243062
243273
  const authResult = requireUserFacingUserId(req, reply);
243063
243274
  if (authResult === null) return null;
@@ -243162,10 +243373,10 @@ var routes14 = async (fastify2) => {
243162
243373
  return reply.send({ ok: true });
243163
243374
  });
243164
243375
  };
243165
- var chat_session_routes_default = (0, import_fastify_plugin15.default)(routes14, { name: "chat-session-routes" });
243376
+ var chat_session_routes_default = (0, import_fastify_plugin16.default)(routes15, { name: "chat-session-routes" });
243166
243377
 
243167
243378
  // src/routes/project-chat-routes.ts
243168
- var import_fastify_plugin16 = __toESM(require_plugin2(), 1);
243379
+ var import_fastify_plugin17 = __toESM(require_plugin2(), 1);
243169
243380
  import { createHash as createHash6, randomUUID as randomUUID16 } from "crypto";
243170
243381
  var MAX_TITLE_LENGTH = 200;
243171
243382
  var MAX_MESSAGE_LENGTH = 1e5;
@@ -243278,7 +243489,7 @@ function parseWorkspaceSelectionBody(body) {
243278
243489
  if (!requestId || requestId.length > MAX_TOOL_SELECTOR_ID || !workspaceId || workspaceId.length > MAX_TOOL_SELECTOR_ID) return null;
243279
243490
  return { requestId, workspaceId };
243280
243491
  }
243281
- var routes15 = async (fastify2) => {
243492
+ var routes16 = async (fastify2) => {
243282
243493
  const getOwnedThread = async (req, reply, threadId) => {
243283
243494
  const authResult = requireAuth(req, reply);
243284
243495
  if (authResult === null) return null;
@@ -243497,10 +243708,10 @@ var routes15 = async (fastify2) => {
243497
243708
  }
243498
243709
  });
243499
243710
  };
243500
- var project_chat_routes_default = (0, import_fastify_plugin16.default)(routes15, { name: "project-chat-routes" });
243711
+ var project_chat_routes_default = (0, import_fastify_plugin17.default)(routes16, { name: "project-chat-routes" });
243501
243712
 
243502
243713
  // src/routes/project-activity-routes.ts
243503
- var import_fastify_plugin17 = __toESM(require_plugin2(), 1);
243714
+ var import_fastify_plugin18 = __toESM(require_plugin2(), 1);
243504
243715
 
243505
243716
  // src/project-activity.ts
243506
243717
  var RECENT_THREAD_LIMIT = 5;
@@ -243508,7 +243719,7 @@ var RECENT_SESSION_LIMIT = 8;
243508
243719
  var RECENT_RUN_LIMIT = 5;
243509
243720
  var PRIORITY_TASK_LIMIT = 5;
243510
243721
  var ATTENTION_LIMIT = 10;
243511
- var parseDbTimestamp3 = (value) => {
243722
+ var parseDbTimestamp4 = (value) => {
243512
243723
  if (!value) return null;
243513
243724
  const explicitZone = /(?:Z|[+-]\d\d:\d\d)$/i.test(value);
243514
243725
  const parsed = Date.parse(explicitZone ? value : `${value.replace(" ", "T")}Z`);
@@ -243533,8 +243744,8 @@ var localActivity = (session) => {
243533
243744
  lastActiveAt: maxTimestamp(
243534
243745
  session.last_user_message_at,
243535
243746
  session.last_completed_at,
243536
- parseDbTimestamp3(session.updated_at),
243537
- parseDbTimestamp3(session.created_at)
243747
+ parseDbTimestamp4(session.updated_at),
243748
+ parseDbTimestamp4(session.created_at)
243538
243749
  ),
243539
243750
  lastUserMessageAt: session.last_user_message_at ?? null,
243540
243751
  lastCompletedAt: session.last_completed_at ?? null
@@ -243598,7 +243809,7 @@ async function getProjectActivity(storage, projectId, userId) {
243598
243809
  entityId: run2.id,
243599
243810
  status: run2.status,
243600
243811
  title: run2.scheduleName,
243601
- occurredAtMs: parseDbTimestamp3(run2.finished_at ?? run2.started_at) ?? 0
243812
+ occurredAtMs: parseDbTimestamp4(run2.finished_at ?? run2.started_at) ?? 0
243602
243813
  }))
243603
243814
  ].sort((left, right) => right.occurredAtMs - left.occurredAtMs || right.entityId.localeCompare(left.entityId)).slice(0, ATTENTION_LIMIT).map(({ occurredAtMs, ...item }) => ({
243604
243815
  ...item,
@@ -243618,7 +243829,7 @@ async function getProjectActivity(storage, projectId, userId) {
243618
243829
  }
243619
243830
 
243620
243831
  // src/routes/project-activity-routes.ts
243621
- var routes16 = async (fastify2) => {
243832
+ var routes17 = async (fastify2) => {
243622
243833
  fastify2.get(
243623
243834
  "/api/projects/:projectId/activity",
243624
243835
  async (req, reply) => {
@@ -243634,12 +243845,12 @@ var routes16 = async (fastify2) => {
243634
243845
  }
243635
243846
  );
243636
243847
  };
243637
- var project_activity_routes_default = (0, import_fastify_plugin17.default)(routes16);
243848
+ var project_activity_routes_default = (0, import_fastify_plugin18.default)(routes17);
243638
243849
 
243639
243850
  // src/routes/task-routes.ts
243640
- var import_fastify_plugin18 = __toESM(require_plugin2(), 1);
243851
+ var import_fastify_plugin19 = __toESM(require_plugin2(), 1);
243641
243852
  import { randomUUID as randomUUID17 } from "crypto";
243642
- var routes17 = async (fastify2) => {
243853
+ var routes18 = async (fastify2) => {
243643
243854
  fastify2.get(
243644
243855
  "/api/projects/:projectId/tasks",
243645
243856
  async (req, reply) => {
@@ -243799,12 +244010,12 @@ Description: ${description}`,
243799
244010
  return reply.code(200).send({ success: true });
243800
244011
  });
243801
244012
  };
243802
- var task_routes_default = (0, import_fastify_plugin18.default)(routes17, { name: "task-routes" });
244013
+ var task_routes_default = (0, import_fastify_plugin19.default)(routes18, { name: "task-routes" });
243803
244014
 
243804
244015
  // src/routes/rule-routes.ts
243805
- var import_fastify_plugin19 = __toESM(require_plugin2(), 1);
244016
+ var import_fastify_plugin20 = __toESM(require_plugin2(), 1);
243806
244017
  import { randomUUID as randomUUID18 } from "crypto";
243807
- var routes18 = async (fastify2) => {
244018
+ var routes19 = async (fastify2) => {
243808
244019
  fastify2.get(
243809
244020
  "/api/projects/:projectId/rules",
243810
244021
  async (req, reply) => {
@@ -243890,12 +244101,12 @@ var routes18 = async (fastify2) => {
243890
244101
  return reply.code(200).send({ success: true });
243891
244102
  });
243892
244103
  };
243893
- var rule_routes_default = (0, import_fastify_plugin19.default)(routes18, { name: "rule-routes" });
244104
+ var rule_routes_default = (0, import_fastify_plugin20.default)(routes19, { name: "rule-routes" });
243894
244105
 
243895
244106
  // src/routes/command-routes.ts
243896
- var import_fastify_plugin20 = __toESM(require_plugin2(), 1);
244107
+ var import_fastify_plugin21 = __toESM(require_plugin2(), 1);
243897
244108
  import { randomUUID as randomUUID19 } from "crypto";
243898
- var routes19 = async (fastify2) => {
244109
+ var routes20 = async (fastify2) => {
243899
244110
  fastify2.get(
243900
244111
  "/api/projects/:projectId/commands",
243901
244112
  async (req, reply) => {
@@ -243964,10 +244175,10 @@ var routes19 = async (fastify2) => {
243964
244175
  return reply.code(200).send({ success: true });
243965
244176
  });
243966
244177
  };
243967
- var command_routes_default = (0, import_fastify_plugin20.default)(routes19, { name: "command-routes" });
244178
+ var command_routes_default = (0, import_fastify_plugin21.default)(routes20, { name: "command-routes" });
243968
244179
 
243969
244180
  // src/routes/workflow-run-routes.ts
243970
- var import_fastify_plugin21 = __toESM(require_plugin2(), 1);
244181
+ var import_fastify_plugin22 = __toESM(require_plugin2(), 1);
243971
244182
 
243972
244183
  // src/utils/review-brief.ts
243973
244184
  var BASE_TIMEOUT_MS = 15e3;
@@ -244299,7 +244510,7 @@ function errStatus(err) {
244299
244510
  return 500;
244300
244511
  }
244301
244512
  }
244302
- async function routes20(fastify2) {
244513
+ async function routes21(fastify2) {
244303
244514
  const remoteRunMap = /* @__PURE__ */ new Map();
244304
244515
  const TERMINAL_RUN_STATUSES = /* @__PURE__ */ new Set(["completed", "cancelled", "failed"]);
244305
244516
  const trackRemoteRun = (localRun, info) => {
@@ -244764,10 +244975,10 @@ async function routes20(fastify2) {
244764
244975
  return reply.send({ runs });
244765
244976
  });
244766
244977
  }
244767
- var workflow_run_routes_default = (0, import_fastify_plugin21.default)(routes20, { name: "workflow-run-routes" });
244978
+ var workflow_run_routes_default = (0, import_fastify_plugin22.default)(routes21, { name: "workflow-run-routes" });
244768
244979
 
244769
244980
  // src/routes/settings-routes.ts
244770
- var import_fastify_plugin22 = __toESM(require_plugin2(), 1);
244981
+ var import_fastify_plugin23 = __toESM(require_plugin2(), 1);
244771
244982
  var SettingsValidationError = class extends Error {
244772
244983
  };
244773
244984
  var DEFAULT_PROXY_CONFIG = { type: "none", host: "", port: 0 };
@@ -244831,7 +245042,7 @@ function requireSettingsUser(req, reply) {
244831
245042
  if (auth === null) return null;
244832
245043
  return resolveUserId(auth);
244833
245044
  }
244834
- var routes21 = async (fastify2) => {
245045
+ var routes22 = async (fastify2) => {
244835
245046
  fastify2.get("/api/settings/agent-processes", async (req, reply) => {
244836
245047
  if (requireAuth(req, reply) === null) return;
244837
245048
  const saved = await fastify2.storage.settings.get("agentProcesses");
@@ -245105,11 +245316,11 @@ var routes21 = async (fastify2) => {
245105
245316
  return reply.code(200).send(updated);
245106
245317
  });
245107
245318
  };
245108
- var settings_routes_default = (0, import_fastify_plugin22.default)(routes21, { name: "settings-routes" });
245319
+ var settings_routes_default = (0, import_fastify_plugin23.default)(routes22, { name: "settings-routes" });
245109
245320
 
245110
245321
  // src/routes/translate-routes.ts
245111
- var import_fastify_plugin23 = __toESM(require_plugin2(), 1);
245112
- var routes22 = async (fastify2) => {
245322
+ var import_fastify_plugin24 = __toESM(require_plugin2(), 1);
245323
+ var routes23 = async (fastify2) => {
245113
245324
  fastify2.post(
245114
245325
  "/api/translate",
245115
245326
  async (req, reply) => {
@@ -245150,10 +245361,10 @@ ${text2}`,
245150
245361
  }
245151
245362
  );
245152
245363
  };
245153
- var translate_routes_default = (0, import_fastify_plugin23.default)(routes22, { name: "translate-routes" });
245364
+ var translate_routes_default = (0, import_fastify_plugin24.default)(routes23, { name: "translate-routes" });
245154
245365
 
245155
245366
  // src/routes/websocket-routes.ts
245156
- var import_fastify_plugin24 = __toESM(require_plugin2(), 1);
245367
+ var import_fastify_plugin25 = __toESM(require_plugin2(), 1);
245157
245368
 
245158
245369
  // src/routes/executor-stream-handlers.ts
245159
245370
  import { randomUUID as randomUUID20 } from "crypto";
@@ -245364,7 +245575,6 @@ async function verifyWsToken(token) {
245364
245575
  }
245365
245576
  async function authenticateWs(authEnabled, query, socket) {
245366
245577
  if (!authEnabled) return { userId: null, kind: "solo" };
245367
- if (process.env.VIBEDECKX_API_KEY && query.apiKey) return { userId: null, kind: "api_key" };
245368
245578
  const reject = (error48) => {
245369
245579
  try {
245370
245580
  socket.send(JSON.stringify({ error: error48 }));
@@ -245421,7 +245631,7 @@ async function userOwnsSession(fastify2, sessionId, userId) {
245421
245631
  }
245422
245632
 
245423
245633
  // src/routes/websocket-routes.ts
245424
- var routes23 = async (fastify2) => {
245634
+ var routes24 = async (fastify2) => {
245425
245635
  fastify2.reverseConnectManager.setStatusChangeHandler((remoteServerId, status) => {
245426
245636
  if (status !== "online") return;
245427
245637
  const cache2 = fastify2.remotePatchCache;
@@ -245637,25 +245847,21 @@ var routes23 = async (fastify2) => {
245637
245847
  console.log(`[AgentWS] Connection attempt for session ${sessionId} (auth=${fastify2.authEnabled})`);
245638
245848
  let principalUserId = fastify2.authEnabled ? null : "local";
245639
245849
  if (fastify2.authEnabled) {
245640
- const apiKey = req.query.apiKey;
245641
245850
  const token = req.query.token;
245642
- const apiKeyTrusted = !!process.env.VIBEDECKX_API_KEY && !!apiKey;
245643
- if (!apiKeyTrusted) {
245644
- if (!token) {
245645
- console.log(`[AgentWS] Auth rejected: no token (session=${sessionId})`);
245646
- socket.send(JSON.stringify({ error: "Authentication required" }));
245647
- socket.close();
245648
- return;
245649
- }
245650
- const userId = await verifyWsToken(token);
245651
- if (!userId) {
245652
- console.log(`[AgentWS] Auth rejected: invalid token (session=${sessionId})`);
245653
- socket.send(JSON.stringify({ error: "Invalid authentication token" }));
245654
- socket.close();
245655
- return;
245656
- }
245657
- principalUserId = userId;
245851
+ if (!token) {
245852
+ console.log(`[AgentWS] Auth rejected: no token (session=${sessionId})`);
245853
+ socket.send(JSON.stringify({ error: "Authentication required" }));
245854
+ socket.close();
245855
+ return;
245856
+ }
245857
+ const userId = await verifyWsToken(token);
245858
+ if (!userId) {
245859
+ console.log(`[AgentWS] Auth rejected: invalid token (session=${sessionId})`);
245860
+ socket.send(JSON.stringify({ error: "Invalid authentication token" }));
245861
+ socket.close();
245862
+ return;
245658
245863
  }
245864
+ principalUserId = userId;
245659
245865
  }
245660
245866
  if (principalUserId !== null && !await userOwnsSession(fastify2, sessionId, principalUserId)) {
245661
245867
  console.log(`[AgentWS] Ownership denied for session ${sessionId} (user=${principalUserId})`);
@@ -245785,37 +245991,33 @@ var routes23 = async (fastify2) => {
245785
245991
  const { sessionId } = req.params;
245786
245992
  let principalUserId = fastify2.authEnabled ? null : "local";
245787
245993
  if (fastify2.authEnabled) {
245788
- const apiKey = req.query.apiKey;
245789
245994
  const token = req.query.token;
245790
- const apiKeyTrusted = !!process.env.VIBEDECKX_API_KEY && !!apiKey;
245791
- if (!apiKeyTrusted) {
245792
- if (!token) {
245793
- console.log(`[ChatWS] Auth rejected: no token (session=${sessionId})`);
245794
- try {
245795
- socket.send(JSON.stringify({ error: "Authentication required" }));
245796
- } catch {
245797
- }
245798
- try {
245799
- socket.close();
245800
- } catch {
245801
- }
245802
- return;
245995
+ if (!token) {
245996
+ console.log(`[ChatWS] Auth rejected: no token (session=${sessionId})`);
245997
+ try {
245998
+ socket.send(JSON.stringify({ error: "Authentication required" }));
245999
+ } catch {
245803
246000
  }
245804
- const userId = await verifyWsToken(token);
245805
- if (!userId) {
245806
- console.log(`[ChatWS] Auth rejected: invalid token (session=${sessionId})`);
245807
- try {
245808
- socket.send(JSON.stringify({ error: "Invalid authentication token" }));
245809
- } catch {
245810
- }
245811
- try {
245812
- socket.close();
245813
- } catch {
245814
- }
245815
- return;
246001
+ try {
246002
+ socket.close();
246003
+ } catch {
245816
246004
  }
245817
- principalUserId = userId;
246005
+ return;
246006
+ }
246007
+ const userId = await verifyWsToken(token);
246008
+ if (!userId) {
246009
+ console.log(`[ChatWS] Auth rejected: invalid token (session=${sessionId})`);
246010
+ try {
246011
+ socket.send(JSON.stringify({ error: "Invalid authentication token" }));
246012
+ } catch {
246013
+ }
246014
+ try {
246015
+ socket.close();
246016
+ } catch {
246017
+ }
246018
+ return;
245818
246019
  }
246020
+ principalUserId = userId;
245819
246021
  }
245820
246022
  if (principalUserId !== null) {
245821
246023
  const owned = fastify2.chatSessionManager.getSession(sessionId);
@@ -245868,10 +246070,10 @@ var routes23 = async (fastify2) => {
245868
246070
  );
245869
246071
  });
245870
246072
  };
245871
- var websocket_routes_default = (0, import_fastify_plugin24.default)(routes23, { name: "websocket-routes" });
246073
+ var websocket_routes_default = (0, import_fastify_plugin25.default)(routes24, { name: "websocket-routes" });
245872
246074
 
245873
246075
  // src/routes/reverse-connect-routes.ts
245874
- var import_fastify_plugin25 = __toESM(require_plugin2(), 1);
246076
+ var import_fastify_plugin26 = __toESM(require_plugin2(), 1);
245875
246077
  import { randomBytes as randomBytes2, createHash as createHash7, verify as cryptoVerify } from "crypto";
245876
246078
 
245877
246079
  // src/utils/rate-limited-warn.ts
@@ -245908,10 +246110,15 @@ function createRateLimitedWarn(windowMs, maxKeys) {
245908
246110
  }
245909
246111
 
245910
246112
  // src/routes/reverse-connect-routes.ts
246113
+ function extractReportedVersion(frame) {
246114
+ if (typeof frame.version !== "string" || frame.version.length === 0) return void 0;
246115
+ const capabilities = Array.isArray(frame.capabilities) ? frame.capabilities.filter((c) => typeof c === "string") : [];
246116
+ return { version: frame.version, capabilities };
246117
+ }
245911
246118
  var MACHINE_HANDSHAKE_TIMEOUT_MS = 5e3;
245912
246119
  var REJECT_LOG_WINDOW_MS = 3e4;
245913
246120
  var REJECT_LOG_MAX_KEYS = 500;
245914
- var routes24 = async (fastify2) => {
246121
+ var routes25 = async (fastify2) => {
245915
246122
  const logRejectedUpgrade = createRateLimitedWarn(REJECT_LOG_WINDOW_MS, REJECT_LOG_MAX_KEYS);
245916
246123
  fastify2.get("/api/reverse-connect/identity", async (req, reply) => {
245917
246124
  const token = req.headers["x-vibedeckx-connect-token"];
@@ -245952,12 +246159,31 @@ var routes24 = async (fastify2) => {
245952
246159
  const ownerId = await fastify2.storage.remoteServers.getOwnerId(serverId) ?? "";
245953
246160
  const nonce = randomBytes2(32);
245954
246161
  let settled = false;
246162
+ let stashedVersion;
246163
+ const recordWorkerVersion = async (reported) => {
246164
+ if (!reported) {
246165
+ console.log(`[ReverseConnect] Worker ${serverId} reported no version (pre-reporting release)`);
246166
+ return;
246167
+ }
246168
+ const previous = (await fastify2.storage.remoteServers.getById(serverId))?.worker_version;
246169
+ await fastify2.storage.remoteServers.updateWorkerVersion(serverId, reported.version, reported.capabilities);
246170
+ if (previous !== reported.version) {
246171
+ console.log(`[ReverseConnect] Worker ${serverId} version ${previous ?? "unreported"} \u2192 ${reported.version}`);
246172
+ }
246173
+ const cmp = compareVersionStrings(reported.version, MIN_WORKER_VERSION);
246174
+ if (cmp !== void 0 && cmp < 0) {
246175
+ console.warn(
246176
+ `[ReverseConnect] Worker ${serverId} runs ${reported.version}, below MIN_WORKER_VERSION ${MIN_WORKER_VERSION} \u2014 advise upgrading`
246177
+ );
246178
+ }
246179
+ };
245955
246180
  const registerUnauthenticated = async () => {
245956
246181
  if (settled) return;
245957
246182
  settled = true;
245958
246183
  socket.off("message", onChallengeReply);
245959
246184
  fastify2.reverseConnectManager.registerConnection(serverId, ws);
245960
246185
  await fastify2.storage.remoteServers.updateStatus(serverId, "online");
246186
+ await recordWorkerVersion(stashedVersion);
245961
246187
  };
245962
246188
  const timer = setTimeout(() => {
245963
246189
  registerUnauthenticated().catch((err) => {
@@ -245972,6 +246198,10 @@ var routes24 = async (fastify2) => {
245972
246198
  } catch {
245973
246199
  return;
245974
246200
  }
246201
+ if (frame?.type === "status") {
246202
+ stashedVersion = extractReportedVersion(frame) ?? stashedVersion;
246203
+ return;
246204
+ }
245975
246205
  if (frame?.type !== "machine_auth" || settled) return;
245976
246206
  settled = true;
245977
246207
  clearTimeout(timer);
@@ -246007,6 +246237,7 @@ var routes24 = async (fastify2) => {
246007
246237
  console.log(`[ReverseConnect] Machine auth verified ${fingerprint.slice(0, 12)} for ${serverId}`);
246008
246238
  fastify2.reverseConnectManager.registerConnection(serverId, ws, fingerprint);
246009
246239
  await fastify2.storage.remoteServers.updateStatus(serverId, "online");
246240
+ await recordWorkerVersion(extractReportedVersion(frame) ?? stashedVersion);
246010
246241
  } catch (err) {
246011
246242
  console.error(`[ReverseConnect] Machine challenge handling failed for ${serverId}:`, err);
246012
246243
  try {
@@ -246021,10 +246252,10 @@ var routes24 = async (fastify2) => {
246021
246252
  );
246022
246253
  });
246023
246254
  };
246024
- var reverse_connect_routes_default = (0, import_fastify_plugin25.default)(routes24, { name: "reverse-connect-routes" });
246255
+ var reverse_connect_routes_default = (0, import_fastify_plugin26.default)(routes25, { name: "reverse-connect-routes" });
246025
246256
 
246026
246257
  // src/routes/event-routes.ts
246027
- var import_fastify_plugin26 = __toESM(require_plugin2(), 1);
246258
+ var import_fastify_plugin27 = __toESM(require_plugin2(), 1);
246028
246259
  function toWireEvent(event) {
246029
246260
  if (event.type === "executor:stopped" && (event.tailOutput !== void 0 || event.finalResult !== void 0)) {
246030
246261
  const { tailOutput: _tailOutput, finalResult: _finalResult, ...rest } = event;
@@ -246032,31 +246263,28 @@ function toWireEvent(event) {
246032
246263
  }
246033
246264
  return event;
246034
246265
  }
246035
- var routes25 = async (fastify2) => {
246266
+ var routes26 = async (fastify2) => {
246036
246267
  fastify2.get("/api/events", async (req, reply) => {
246037
246268
  let userId = null;
246038
246269
  if (fastify2.authEnabled) {
246039
- const apiKey = req.headers["x-vibedeckx-api-key"];
246040
- if (!(process.env.VIBEDECKX_API_KEY && apiKey)) {
246041
- const token = req.query.token;
246042
- if (!token) {
246043
- return reply.code(401).send({ error: "Unauthorized" });
246044
- }
246045
- try {
246046
- const { verifyToken: verifyToken3 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
246047
- const payload = await verifyToken3(token, {
246048
- secretKey: process.env.CLERK_SECRET_KEY,
246049
- clockSkewInMs: CLERK_CLOCK_SKEW_MS
246050
- });
246051
- if (!payload.sub) {
246052
- return reply.code(401).send({ error: "Unauthorized" });
246053
- }
246054
- userId = payload.sub;
246055
- } catch (err) {
246056
- const reason = err?.reason;
246057
- if (reason) console.log(`[EventsSSE] token verification failed: ${reason}`);
246270
+ const token = req.query.token;
246271
+ if (!token) {
246272
+ return reply.code(401).send({ error: "Unauthorized" });
246273
+ }
246274
+ try {
246275
+ const { verifyToken: verifyToken3 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
246276
+ const payload = await verifyToken3(token, {
246277
+ secretKey: process.env.CLERK_SECRET_KEY,
246278
+ clockSkewInMs: CLERK_CLOCK_SKEW_MS
246279
+ });
246280
+ if (!payload.sub) {
246058
246281
  return reply.code(401).send({ error: "Unauthorized" });
246059
246282
  }
246283
+ userId = payload.sub;
246284
+ } catch (err) {
246285
+ const reason = err?.reason;
246286
+ if (reason) console.log(`[EventsSSE] token verification failed: ${reason}`);
246287
+ return reply.code(401).send({ error: "Unauthorized" });
246060
246288
  }
246061
246289
  }
246062
246290
  reply.raw.writeHead(200, {
@@ -246090,10 +246318,10 @@ var routes25 = async (fastify2) => {
246090
246318
  await reply;
246091
246319
  });
246092
246320
  };
246093
- var event_routes_default = (0, import_fastify_plugin26.default)(routes25, { name: "event-routes" });
246321
+ var event_routes_default = (0, import_fastify_plugin27.default)(routes26, { name: "event-routes" });
246094
246322
 
246095
246323
  // src/routes/terminal-routes.ts
246096
- var import_fastify_plugin27 = __toESM(require_plugin2(), 1);
246324
+ var import_fastify_plugin28 = __toESM(require_plugin2(), 1);
246097
246325
  import path13 from "path";
246098
246326
 
246099
246327
  // src/utils/path-project.ts
@@ -246121,7 +246349,7 @@ async function getRemoteConfig5(fastify2, project, remoteServerId) {
246121
246349
  remotePath: target.remote_path
246122
246350
  };
246123
246351
  }
246124
- var routes26 = async (fastify2) => {
246352
+ var routes27 = async (fastify2) => {
246125
246353
  fastify2.post("/api/path/terminals", async (req, reply) => {
246126
246354
  const { path: projectPath, branch } = req.body;
246127
246355
  if (!projectPath) {
@@ -246297,11 +246525,11 @@ var routes26 = async (fastify2) => {
246297
246525
  }
246298
246526
  );
246299
246527
  };
246300
- var terminal_routes_default = (0, import_fastify_plugin27.default)(routes26, { name: "terminal-routes" });
246528
+ var terminal_routes_default = (0, import_fastify_plugin28.default)(routes27, { name: "terminal-routes" });
246301
246529
 
246302
246530
  // src/routes/browser-routes.ts
246303
- var import_fastify_plugin28 = __toESM(require_plugin2(), 1);
246304
- var routes27 = async (fastify2) => {
246531
+ var import_fastify_plugin29 = __toESM(require_plugin2(), 1);
246532
+ var routes28 = async (fastify2) => {
246305
246533
  const ensureProjectAccess = async (req, reply) => {
246306
246534
  const userId = requireUserFacingUserId(req, reply);
246307
246535
  if (userId === null) return null;
@@ -246372,10 +246600,10 @@ var routes27 = async (fastify2) => {
246372
246600
  return reply.code(200).send({ ok: true });
246373
246601
  });
246374
246602
  };
246375
- var browser_routes_default = (0, import_fastify_plugin28.default)(routes27, { name: "browser-routes" });
246603
+ var browser_routes_default = (0, import_fastify_plugin29.default)(routes28, { name: "browser-routes" });
246376
246604
 
246377
246605
  // src/routes/browser-proxy-routes.ts
246378
- var import_fastify_plugin29 = __toESM(require_plugin2(), 1);
246606
+ var import_fastify_plugin30 = __toESM(require_plugin2(), 1);
246379
246607
  import { randomUUID as randomUUID21 } from "crypto";
246380
246608
 
246381
246609
  // src/utils/ssrf-guard.ts
@@ -246871,7 +247099,7 @@ function generateInjectedScript(projectId, targetOrigin, proxyWsPrefix) {
246871
247099
  })();
246872
247100
  </script>`;
246873
247101
  }
246874
- var routes28 = async (fastify2) => {
247102
+ var routes29 = async (fastify2) => {
246875
247103
  fastify2.get("/api/projects/:id/browser/proxy/*", async (req, reply) => {
246876
247104
  const userId = requireUserFacingOrTrustedProxyUserId(req, reply);
246877
247105
  if (userId === null) return;
@@ -246940,7 +247168,7 @@ var routes28 = async (fastify2) => {
246940
247168
  const { id: projectId } = req.params;
246941
247169
  const principal = await authenticateWs(fastify2.authEnabled, req.query, socket);
246942
247170
  if (!principal) return;
246943
- const projectOwner = principal.kind === "api_key" ? void 0 : principal.userId ?? "local";
247171
+ const projectOwner = principal.userId ?? "local";
246944
247172
  if (!await fastify2.storage.projects.getById(projectId, projectOwner)) {
246945
247173
  try {
246946
247174
  socket.send(JSON.stringify({ error: "Forbidden" }));
@@ -247043,10 +247271,10 @@ var routes28 = async (fastify2) => {
247043
247271
  });
247044
247272
  });
247045
247273
  };
247046
- var browser_proxy_routes_default = (0, import_fastify_plugin29.default)(routes28, { name: "browser-proxy-routes" });
247274
+ var browser_proxy_routes_default = (0, import_fastify_plugin30.default)(routes29, { name: "browser-proxy-routes" });
247047
247275
 
247048
247276
  // src/routes/cross-remote-target-routes.ts
247049
- var import_fastify_plugin30 = __toESM(require_plugin2(), 1);
247277
+ var import_fastify_plugin31 = __toESM(require_plugin2(), 1);
247050
247278
  import path14 from "path";
247051
247279
  import { promises as fs3 } from "fs";
247052
247280
 
@@ -247126,7 +247354,7 @@ var clampTimeoutMs = (timeoutSec) => {
247126
247354
  const requested = typeof timeoutSec === "number" && Number.isFinite(timeoutSec) && timeoutSec > 0 ? timeoutSec : DEFAULT_TIMEOUT_SEC;
247127
247355
  return Math.min(requested, MAX_TIMEOUT_SEC) * 1e3;
247128
247356
  };
247129
- var routes29 = async (fastify2) => {
247357
+ var routes30 = async (fastify2) => {
247130
247358
  fastify2.post(
247131
247359
  "/api/path/cross-remote/exec",
247132
247360
  async (request, reply) => {
@@ -247234,10 +247462,10 @@ var routes29 = async (fastify2) => {
247234
247462
  return reply.send(result);
247235
247463
  });
247236
247464
  };
247237
- var cross_remote_target_routes_default = (0, import_fastify_plugin30.default)(routes29, { name: "cross-remote-target-routes" });
247465
+ var cross_remote_target_routes_default = (0, import_fastify_plugin31.default)(routes30, { name: "cross-remote-target-routes" });
247238
247466
 
247239
247467
  // src/routes/cross-remote-mcp-routes.ts
247240
- var import_fastify_plugin31 = __toESM(require_plugin2(), 1);
247468
+ var import_fastify_plugin32 = __toESM(require_plugin2(), 1);
247241
247469
  var PROTOCOL_VERSION = "2024-11-05";
247242
247470
  var AUDIT_ARGS_MAX = 1024;
247243
247471
  var NOT_ACCESSIBLE = "remote not found or not accessible";
@@ -247340,7 +247568,7 @@ var textResult = (text2, isError = false) => ({
247340
247568
  content: [{ type: "text", text: text2 }],
247341
247569
  ...isError ? { isError: true } : {}
247342
247570
  });
247343
- var routes30 = async (fastify2) => {
247571
+ var routes31 = async (fastify2) => {
247344
247572
  const guard = new SessionConcurrencyGuard();
247345
247573
  let cachedSecret;
247346
247574
  const getSecret = () => {
@@ -247461,10 +247689,10 @@ var routes30 = async (fastify2) => {
247461
247689
  }
247462
247690
  });
247463
247691
  };
247464
- var cross_remote_mcp_routes_default = (0, import_fastify_plugin31.default)(routes30, { name: "cross-remote-mcp-routes" });
247692
+ var cross_remote_mcp_routes_default = (0, import_fastify_plugin32.default)(routes31, { name: "cross-remote-mcp-routes" });
247465
247693
 
247466
247694
  // src/routes/schedule-routes.ts
247467
- var import_fastify_plugin32 = __toESM(require_plugin2(), 1);
247695
+ var import_fastify_plugin33 = __toESM(require_plugin2(), 1);
247468
247696
  import { randomUUID as randomUUID22 } from "crypto";
247469
247697
  import path15 from "path";
247470
247698
  var RUN_TYPES = ["command", "prompt"];
@@ -247483,7 +247711,7 @@ function validateResolved(b2) {
247483
247711
  if (cronError) return `Invalid cron expression: ${cronError}`;
247484
247712
  return null;
247485
247713
  }
247486
- var routes31 = async (fastify2) => {
247714
+ var routes32 = async (fastify2) => {
247487
247715
  const sendTerminalManualOutcome = (reply, request, replay) => {
247488
247716
  if (!request.terminalStatus || request.terminalResponseStatus === null) return null;
247489
247717
  const common = { runId: request.runId, status: request.terminalStatus, durable: true, replay };
@@ -247714,10 +247942,10 @@ var routes31 = async (fastify2) => {
247714
247942
  }
247715
247943
  );
247716
247944
  };
247717
- var schedule_routes_default = (0, import_fastify_plugin32.default)(routes31, { name: "schedule-routes" });
247945
+ var schedule_routes_default = (0, import_fastify_plugin33.default)(routes32, { name: "schedule-routes" });
247718
247946
 
247719
247947
  // src/search/catalog.ts
247720
- var parseDbTimestamp4 = (ts) => {
247948
+ var parseDbTimestamp5 = (ts) => {
247721
247949
  if (!ts) return null;
247722
247950
  const ms = Date.parse(ts.replace(" ", "T") + "Z");
247723
247951
  return Number.isNaN(ms) ? null : ms;
@@ -247739,7 +247967,7 @@ async function buildSearchCatalog(deps, projectId, projectPath) {
247739
247967
  id: s3.id,
247740
247968
  branch: s3.branch === "" ? null : s3.branch,
247741
247969
  title: s3.title ?? null,
247742
- lastActiveAt: s3.last_user_message_at ?? parseDbTimestamp4(s3.updated_at),
247970
+ lastActiveAt: s3.last_user_message_at ?? parseDbTimestamp5(s3.updated_at),
247743
247971
  favoritedAt: s3.favorited_at ?? null,
247744
247972
  entryCount,
247745
247973
  status: s3.status,
@@ -248006,10 +248234,10 @@ var searchRoutes = async (fastify2) => {
248006
248234
  var search_routes_default = searchRoutes;
248007
248235
 
248008
248236
  // src/routes/notification-routes.ts
248009
- var import_fastify_plugin33 = __toESM(require_plugin2(), 1);
248237
+ var import_fastify_plugin34 = __toESM(require_plugin2(), 1);
248010
248238
  var MAX_LIMIT = 500;
248011
248239
  var DEFAULT_LIMIT = 100;
248012
- var routes32 = async (fastify2) => {
248240
+ var routes33 = async (fastify2) => {
248013
248241
  fastify2.get(
248014
248242
  "/api/notifications",
248015
248243
  async (req, reply) => {
@@ -248041,7 +248269,7 @@ var routes32 = async (fastify2) => {
248041
248269
  return reply.code(200).send({ ok: true });
248042
248270
  });
248043
248271
  };
248044
- var notification_routes_default = (0, import_fastify_plugin33.default)(routes32, { name: "notification-routes" });
248272
+ var notification_routes_default = (0, import_fastify_plugin34.default)(routes33, { name: "notification-routes" });
248045
248273
 
248046
248274
  // ../../node_modules/.pnpm/@clerk+fastify@3.1.2_fastify@5.7.2_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@clerk/fastify/dist/chunk-RY4T2JMQ.mjs
248047
248275
  import { Readable as Readable2 } from "stream";
@@ -248093,7 +248321,7 @@ var requestToProxyRequest = (req) => {
248093
248321
 
248094
248322
  // ../../node_modules/.pnpm/@clerk+fastify@3.1.2_fastify@5.7.2_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@clerk/fastify/dist/index.mjs
248095
248323
  init_dist();
248096
- var import_fastify_plugin34 = __toESM(require_plugin2(), 1);
248324
+ var import_fastify_plugin35 = __toESM(require_plugin2(), 1);
248097
248325
 
248098
248326
  // ../../node_modules/.pnpm/@clerk+backend@3.2.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@clerk/backend/dist/internal.mjs
248099
248327
  init_chunk_JW73PKED();
@@ -248381,7 +248609,7 @@ var plugin = (instance, opts, done) => {
248381
248609
  instance.addHook(hookName, withClerkMiddleware(opts));
248382
248610
  done();
248383
248611
  };
248384
- var clerkPlugin = (0, import_fastify_plugin34.default)(plugin, {
248612
+ var clerkPlugin = (0, import_fastify_plugin35.default)(plugin, {
248385
248613
  name: "@clerk/fastify",
248386
248614
  fastify: "5.x"
248387
248615
  });
@@ -249129,12 +249357,10 @@ async function shutdownLogging() {
249129
249357
  }
249130
249358
 
249131
249359
  // src/server.ts
249132
- var API_KEY = process.env.VIBEDECKX_API_KEY;
249360
+ var API_KEY2 = process.env.VIBEDECKX_API_KEY || void 0;
249133
249361
  function requireAuth(req, reply) {
249134
249362
  const server = req.server;
249135
249363
  if (!server.authEnabled) return void 0;
249136
- const apiKeyHeader = req.headers["x-vibedeckx-api-key"];
249137
- if (API_KEY && apiKeyHeader) return void 0;
249138
249364
  try {
249139
249365
  const { userId } = getAuth(req);
249140
249366
  if (!userId) {
@@ -249221,19 +249447,12 @@ var createServer = async (opts) => {
249221
249447
  done();
249222
249448
  });
249223
249449
  server.addHook("onRequest", (req, reply, done) => {
249224
- if (!API_KEY) return done();
249225
- if (!req.url.startsWith("/api/")) return done();
249450
+ if (!API_KEY2) return done();
249451
+ if (!req.url.startsWith("/api/admin/")) return done();
249226
249452
  if (req.method === "OPTIONS") return done();
249227
- const pathname = req.url.split("?")[0];
249228
- if (pathname === "/api/config" || pathname === "/api/reverse-connect" || pathname === "/api/reverse-connect/identity") {
249229
- return done();
249230
- }
249231
249453
  const providedKey = req.headers["x-vibedeckx-api-key"] || req.query?.apiKey;
249232
- if (!providedKey && authEnabled) {
249233
- return done();
249234
- }
249235
- if (providedKey !== API_KEY) {
249236
- return reply.code(401).send({ error: "Unauthorized" });
249454
+ if (providedKey !== API_KEY2) {
249455
+ return reply.code(404).send({ error: "Not found" });
249237
249456
  }
249238
249457
  done();
249239
249458
  });
@@ -249309,6 +249528,7 @@ var createServer = async (opts) => {
249309
249528
  server.register(reverse_connect_routes_default);
249310
249529
  server.register(project_routes_default);
249311
249530
  server.register(remote_server_routes_default);
249531
+ server.register(worker_stats_routes_default);
249312
249532
  server.register(project_remote_routes_default);
249313
249533
  server.register(search_routes_default);
249314
249534
  server.register(executor_group_routes_default);
@@ -249530,6 +249750,94 @@ function redactErrorSecret(error48, secret) {
249530
249750
  return redactSecretForms(message, secret);
249531
249751
  }
249532
249752
 
249753
+ // src/utils/package-version.ts
249754
+ import fs7 from "fs";
249755
+ function readPackageVersion() {
249756
+ for (const candidate of ["../package.json", "../../package.json"]) {
249757
+ try {
249758
+ const parsed = JSON.parse(
249759
+ fs7.readFileSync(new URL(candidate, import.meta.url), "utf8")
249760
+ );
249761
+ if (typeof parsed.version === "string" && parsed.version.length > 0) return parsed.version;
249762
+ } catch {
249763
+ }
249764
+ }
249765
+ return "unknown";
249766
+ }
249767
+
249768
+ // src/reverse-connect-capabilities.ts
249769
+ var WORKER_CAPABILITIES = {
249770
+ // --- Agent sessions ---
249771
+ "http:GET /api/path/agent-sessions": { since: "0.2.0", summary: "\u4F1A\u8BDD\u5217\u8868(\u6309\u8DEF\u5F84)" },
249772
+ "http:POST /api/path/agent-sessions": { since: "0.2.0", summary: "\u521B\u5EFA\u4F1A\u8BDD" },
249773
+ "http:POST /api/path/agent-sessions/new": { since: "0.2.0", summary: "\u521B\u5EFA\u4F1A\u8BDD(\u6307\u5B9A ID)" },
249774
+ "http:GET /api/agent-sessions/:param": { since: "0.2.0", summary: "\u8BFB\u4F1A\u8BDD\u8BE6\u60C5/\u5BF9\u8BDD" },
249775
+ "http:POST /api/agent-sessions/:param/message": { since: "0.2.0", summary: "\u53D1\u6D88\u606F\u7ED9\u4F1A\u8BDD" },
249776
+ "http:POST /api/agent-sessions/:param/paste": { since: "0.2.0", summary: "\u7C98\u8D34\u56FE\u7247/\u957F\u6587\u672C" },
249777
+ "http:POST /api/agent-sessions/:param/stop": { since: "0.2.0", summary: "\u505C\u6B62\u4F1A\u8BDD turn" },
249778
+ "http:POST /api/agent-sessions/:param/restart": { since: "0.2.0", summary: "\u91CD\u542F\u4F1A\u8BDD\u8FDB\u7A0B" },
249779
+ "http:POST /api/agent-sessions/:param/agent-type": { since: "0.2.0", summary: "\u5207\u6362 agent \u7C7B\u578B" },
249780
+ "http:POST /api/agent-sessions/:param/model": { since: "0.2.0", summary: "\u5207\u6362\u4F1A\u8BDD\u6A21\u578B" },
249781
+ "http:POST /api/path/agent-sessions/:param/branch": { since: "0.2.0", summary: "\u4ECE\u5386\u53F2\u5206\u53C9\u4F1A\u8BDD" },
249782
+ "http:POST /api/agent-sessions/:param/switch-mode": { since: "0.2.0", summary: "\u6743\u9650\u6A21\u5F0F\u5207\u6362" },
249783
+ "http:POST /api/agent-sessions/:param/accept-plan": { since: "0.2.0", summary: "\u63A5\u53D7\u8BA1\u5212(\u9000\u51FA plan \u6A21\u5F0F)" },
249784
+ "http:POST /api/agent-sessions/:param/approve": { since: "0.2.0", summary: "\u5DE5\u5177\u5BA1\u6279\u51B3\u5B9A" },
249785
+ "http:DELETE /api/agent-sessions/:param": { since: "0.2.0", summary: "\u5220\u9664\u4F1A\u8BDD" },
249786
+ "http:PATCH /api/agent-sessions/:param/title": { since: "0.2.0", summary: "\u6539\u4F1A\u8BDD\u6807\u9898" },
249787
+ "http:PATCH /api/agent-sessions/:param/favorite": { since: "0.2.0", summary: "\u6536\u85CF\u4F1A\u8BDD" },
249788
+ "ws:/api/agent-sessions/:param/stream": { since: "0.2.0", summary: "\u4F1A\u8BDD\u6D88\u606F\u6D41(JSON Patch)" },
249789
+ // --- Executors / processes / terminals ---
249790
+ "http:POST /api/path/execute": { since: "0.2.0", summary: "\u542F\u52A8 executor \u8FDB\u7A0B" },
249791
+ "http:POST /api/execute-one-shot": { since: "0.2.0", summary: "\u4E00\u6B21\u6027\u547D\u4EE4\u6267\u884C" },
249792
+ "http:POST /api/executor-processes/:param/stop": { since: "0.2.0", summary: "\u505C\u6B62 executor \u8FDB\u7A0B" },
249793
+ "http:GET /api/executor-processes/running": { since: "0.2.0", summary: "\u8FD0\u884C\u4E2D\u8FDB\u7A0B\u5217\u8868" },
249794
+ "http:POST /api/path/terminals": { since: "0.2.0", summary: "\u5F00\u7EC8\u7AEF" },
249795
+ "http:POST /api/path/terminals/:param/send": { since: "0.2.0", summary: "\u7EC8\u7AEF\u8F93\u5165" },
249796
+ "ws:/api/executor-processes/:param/logs": { since: "0.2.0", summary: "\u8FDB\u7A0B\u65E5\u5FD7\u6D41" },
249797
+ // --- Workflow runs ---
249798
+ // Empirically bisected via cross-version e2e: 0.2.4 → 404, 0.2.5 → serves.
249799
+ "http:POST /api/path/workflow-runs": { since: "0.2.5", summary: "\u521B\u5EFA workflow run" },
249800
+ "http:GET /api/path/workflow-runs": { since: "0.2.5", summary: "workflow run \u5217\u8868" },
249801
+ "http:GET /api/path/workflow-runs/reviewer-candidate": { since: "0.2.5", summary: "reviewer \u5019\u9009\u67E5\u8BE2" },
249802
+ "http:GET /api/workflow-runs/:param": { since: "0.2.5", summary: "\u8BFB workflow run" },
249803
+ "http:POST /api/workflow-runs/:param/gate": { since: "0.2.5", summary: "workflow \u7528\u6237\u95F8\u95E8\u51B3\u5B9A" },
249804
+ "http:POST /api/workflow-runs/:param/cancel": { since: "0.2.5", summary: "\u53D6\u6D88 workflow run" },
249805
+ // --- Git / worktrees / diff ---
249806
+ "http:GET /api/path/worktrees": { since: "0.2.0", summary: "worktree \u5217\u8868/\u72B6\u6001" },
249807
+ "http:POST /api/path/worktrees": { since: "0.2.0", summary: "\u5EFA worktree" },
249808
+ "http:DELETE /api/path/worktrees": { since: "0.2.0", summary: "\u5220 worktree" },
249809
+ "http:GET /api/path/branches": { since: "0.2.0", summary: "\u5206\u652F\u5217\u8868" },
249810
+ "http:GET /api/path/branches/activity": { since: "0.2.0", summary: "\u5206\u652F\u6D3B\u52A8\u6982\u89C8" },
249811
+ "http:POST /api/path/branches/merge-status": { since: "0.2.0", summary: "\u5206\u652F\u5408\u5E76\u72B6\u6001\u68C0\u6D4B" },
249812
+ "http:GET /api/path/diff": { since: "0.2.0", summary: "\u5DE5\u4F5C\u533A/\u5206\u652F diff" },
249813
+ "http:GET /api/path/commits": { since: "0.2.0", summary: "\u63D0\u4EA4\u5217\u8868" },
249814
+ // --- Files ---
249815
+ "http:GET /api/browse": { since: "0.2.0", summary: "\u6D4F\u89C8\u8FDC\u7AEF\u76EE\u5F55(server \u7BA1\u7406\u9875)" },
249816
+ "http:POST /api/mkdir": { since: "0.2.0", summary: "\u8FDC\u7AEF\u5EFA\u76EE\u5F55" },
249817
+ "http:GET /api/path/browse": { since: "0.2.0", summary: "\u6D4F\u89C8\u9879\u76EE\u76EE\u5F55" },
249818
+ "http:GET /api/path/list-files": { since: "0.2.0", summary: "\u6587\u4EF6\u6811\u5217\u4E3E" },
249819
+ "http:GET /api/path/file-content": { since: "0.2.0", summary: "\u8BFB\u6587\u4EF6\u5185\u5BB9" },
249820
+ "http:GET /api/path/symbol-search": { since: "0.2.0", summary: "\u7B26\u53F7\u641C\u7D22" },
249821
+ "http:GET /api/path/file-download": { since: "0.2.0", summary: "\u6587\u4EF6\u4E0B\u8F7D(\u53EF\u4E8C\u8FDB\u5236)" },
249822
+ "http:POST /api/path/upload": { since: "0.2.0", summary: "\u6587\u4EF6\u4E0A\u4F20" },
249823
+ "http:DELETE /api/path/delete": { since: "0.2.0", summary: "\u5220\u9664\u6587\u4EF6" },
249824
+ // --- Search / notifications / cross-remote ---
249825
+ "http:GET /api/path/search-catalog": { since: "0.2.0", summary: "\u641C\u7D22\u76EE\u5F55\u5FEB\u7167" },
249826
+ // Empirically probed: 0.2.15 → 404, 0.2.16 → 400 (route exists).
249827
+ "http:POST /api/notification-outbox/query": { since: "0.2.16", summary: "\u62C9\u53D6 worker \u901A\u77E5 outbox" },
249828
+ "http:POST /api/path/cross-remote/exec": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u6267\u884C\u547D\u4EE4" },
249829
+ "http:POST /api/path/cross-remote/read-file": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u8BFB\u6587\u4EF6" },
249830
+ "http:POST /api/path/cross-remote/list-dir": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u5217\u76EE\u5F55" },
249831
+ "http:POST /api/path/cross-remote/stat": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:stat" },
249832
+ "http:POST /api/path/cross-remote/process-list": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u8FDB\u7A0B\u5217\u8868" },
249833
+ // --- Raw passthrough ---
249834
+ // Browser preview proxies caller-supplied paths (and localhost ports) through
249835
+ // the tunnel; the path set is unbounded by design, so it registers as one
249836
+ // passthrough capability instead of per-route entries.
249837
+ "passthrough:browser-proxy": { since: "0.2.0", summary: "\u6D4F\u89C8\u5668\u9884\u89C8\u900F\u4F20(\u4EFB\u610F path+port)" }
249838
+ };
249839
+ var WORKER_CAPABILITY_KEYS = Object.keys(WORKER_CAPABILITIES);
249840
+
249533
249841
  // src/reverse-connect-client.ts
249534
249842
  var MACHINE_KEY_SETTING = "reverse_machine_private_key";
249535
249843
  var RECONNECT_BASE_DELAY_MS = 1e3;
@@ -249574,7 +249882,12 @@ var ReverseConnectClient = class {
249574
249882
  console.log("[ReverseClient] Socket open, awaiting server handshake");
249575
249883
  this.openedAt = Date.now();
249576
249884
  this.resetNoPingTimer();
249577
- const frame = { type: "status", ready: true };
249885
+ const frame = {
249886
+ type: "status",
249887
+ ready: true,
249888
+ version: readPackageVersion(),
249889
+ capabilities: WORKER_CAPABILITY_KEYS
249890
+ };
249578
249891
  this.ws.send(JSON.stringify(frame));
249579
249892
  });
249580
249893
  this.ws.on("message", (data) => {
@@ -249663,7 +249976,9 @@ var ReverseConnectClient = class {
249663
249976
  const reply = {
249664
249977
  type: "machine_auth",
249665
249978
  publicKey: publicKeyPem,
249666
- signature: signature.toString("base64")
249979
+ signature: signature.toString("base64"),
249980
+ version: readPackageVersion(),
249981
+ capabilities: WORKER_CAPABILITY_KEYS
249667
249982
  };
249668
249983
  this.sendFrame(reply);
249669
249984
  } catch (err) {
@@ -249703,14 +250018,10 @@ var ReverseConnectClient = class {
249703
250018
  });
249704
250019
  body = await response.text();
249705
250020
  } else {
249706
- const injectHeaders = { ...frame.headers ?? {} };
249707
- if (process.env.VIBEDECKX_API_KEY) {
249708
- injectHeaders["x-vibedeckx-api-key"] = process.env.VIBEDECKX_API_KEY;
249709
- }
249710
250021
  const response = await this.localServer.inject({
249711
250022
  method: frame.method,
249712
250023
  url: frame.path,
249713
- headers: injectHeaders,
250024
+ headers: frame.headers ?? {},
249714
250025
  payload: frame.body
249715
250026
  });
249716
250027
  status = response.statusCode;
@@ -249750,11 +250061,7 @@ var ReverseConnectClient = class {
249750
250061
  }
249751
250062
  }
249752
250063
  handleWsOpen(frame) {
249753
- const queryParts = [
249754
- ...frame.query ? [frame.query] : [],
249755
- ...process.env.VIBEDECKX_API_KEY ? [`apiKey=${encodeURIComponent(process.env.VIBEDECKX_API_KEY)}`] : []
249756
- ];
249757
- const wsUrl = `ws://127.0.0.1:${this.localPort}${frame.path}${queryParts.length ? `?${queryParts.join("&")}` : ""}`;
250064
+ const wsUrl = `ws://127.0.0.1:${this.localPort}${frame.path}${frame.query ? `?${frame.query}` : ""}`;
249758
250065
  console.log(`[ReverseClient] Opening local WS channel ${frame.channelId} \u2192 ${frame.path}`);
249759
250066
  const localWs = new wrapper_default(wsUrl);
249760
250067
  localWs.on("open", () => {
@@ -249856,71 +250163,8 @@ var ReverseConnectClient = class {
249856
250163
  // src/connect-daemon.ts
249857
250164
  import { spawn as spawn5 } from "node:child_process";
249858
250165
  import { randomUUID as randomUUID23 } from "node:crypto";
249859
- import fs7 from "node:fs";
250166
+ import fs8 from "node:fs";
249860
250167
  import path19 from "node:path";
249861
-
249862
- // src/update-check.ts
249863
- var SEMVER_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
249864
- async function fetchLatestPublishedVersion(pkg = "vibedeckx", fetchImpl = fetch) {
249865
- try {
249866
- const response = await fetchImpl(
249867
- `https://registry.npmjs.org/${pkg}/latest`,
249868
- { signal: AbortSignal.timeout(4e3) }
249869
- );
249870
- if (!response.ok) return void 0;
249871
- const body = await response.json();
249872
- return typeof body.version === "string" && parseSemver(body.version) ? body.version : void 0;
249873
- } catch {
249874
- return void 0;
249875
- }
249876
- }
249877
- function parseSemver(version2) {
249878
- const match2 = SEMVER_RE.exec(version2);
249879
- if (!match2) return void 0;
249880
- return {
249881
- core: [match2[1], match2[2], match2[3]],
249882
- prerelease: match2[4]?.split(".")
249883
- };
249884
- }
249885
- function compareNumericStrings(a, b2) {
249886
- if (a.length !== b2.length) return a.length - b2.length;
249887
- return a < b2 ? -1 : a > b2 ? 1 : 0;
249888
- }
249889
- function comparePrereleaseIdentifiers(a, b2) {
249890
- const aNumeric = /^\d+$/.test(a);
249891
- const bNumeric = /^\d+$/.test(b2);
249892
- if (aNumeric && bNumeric) return compareNumericStrings(a, b2);
249893
- if (aNumeric !== bNumeric) return aNumeric ? -1 : 1;
249894
- return a < b2 ? -1 : a > b2 ? 1 : 0;
249895
- }
249896
- function compareSemver(a, b2) {
249897
- for (let i = 0; i < 3; i += 1) {
249898
- const compared = compareNumericStrings(a.core[i], b2.core[i]);
249899
- if (compared !== 0) return compared;
249900
- }
249901
- if (!a.prerelease && !b2.prerelease) return 0;
249902
- if (!a.prerelease) return 1;
249903
- if (!b2.prerelease) return -1;
249904
- const length = Math.max(a.prerelease.length, b2.prerelease.length);
249905
- for (let i = 0; i < length; i += 1) {
249906
- const aId = a.prerelease[i];
249907
- const bId = b2.prerelease[i];
249908
- if (aId === void 0) return -1;
249909
- if (bId === void 0) return 1;
249910
- const compared = comparePrereleaseIdentifiers(aId, bId);
249911
- if (compared !== 0) return compared;
249912
- }
249913
- return 0;
249914
- }
249915
- function compareUpdateStatus(current, latest) {
249916
- if (latest === void 0) return "unknown";
249917
- const currentParsed = parseSemver(current);
249918
- const latestParsed = parseSemver(latest);
249919
- if (!currentParsed || !latestParsed) return "unknown";
249920
- return compareSemver(latestParsed, currentParsed) > 0 ? "update-available" : "up-to-date";
249921
- }
249922
-
249923
- // src/connect-daemon.ts
249924
250168
  var CONNECT_DAEMON_CHILD_ENV = "VIBEDECKX_INTERNAL_CONNECT_DAEMON";
249925
250169
  var CONNECT_DAEMON_TOKEN_ENV = "VIBEDECKX_INTERNAL_CONNECT_TOKEN";
249926
250170
  function buildDaemonChildArgs(argv) {
@@ -250258,7 +250502,7 @@ function parseLinuxProcessStartTicks(stat2) {
250258
250502
  function readLinuxProcessStartTicks(pid) {
250259
250503
  try {
250260
250504
  return parseLinuxProcessStartTicks(
250261
- fs7.readFileSync(`/proc/${pid}/stat`, "utf8")
250505
+ fs8.readFileSync(`/proc/${pid}/stat`, "utf8")
250262
250506
  );
250263
250507
  } catch (error48) {
250264
250508
  if (error48 instanceof Error && "code" in error48 && (error48.code === "ENOENT" || error48.code === "ESRCH")) {
@@ -250287,7 +250531,7 @@ function daemonStateLockOwnerPath(lockPath) {
250287
250531
  function readDaemonStateLockOwner(lockPath) {
250288
250532
  let contents;
250289
250533
  try {
250290
- contents = fs7.readFileSync(daemonStateLockOwnerPath(lockPath), "utf8");
250534
+ contents = fs8.readFileSync(daemonStateLockOwnerPath(lockPath), "utf8");
250291
250535
  } catch (error48) {
250292
250536
  if (hasErrorCode(error48, "ENOENT") || hasErrorCode(error48, "ENOTDIR")) {
250293
250537
  return void 0;
@@ -250315,26 +250559,26 @@ function createDaemonStateLockCandidate(lockPath) {
250315
250559
  nonce: randomUUID23()
250316
250560
  };
250317
250561
  const candidatePath = `${lockPath}.candidate-${process.pid}-${owner.nonce}`;
250318
- fs7.mkdirSync(candidatePath, { mode: 448 });
250562
+ fs8.mkdirSync(candidatePath, { mode: 448 });
250319
250563
  try {
250320
- fs7.chmodSync(candidatePath, 448);
250564
+ fs8.chmodSync(candidatePath, 448);
250321
250565
  const ownerPath = daemonStateLockOwnerPath(candidatePath);
250322
- fs7.writeFileSync(ownerPath, `${JSON.stringify(owner)}
250566
+ fs8.writeFileSync(ownerPath, `${JSON.stringify(owner)}
250323
250567
  `, {
250324
250568
  flag: "wx",
250325
250569
  mode: 384
250326
250570
  });
250327
- fs7.chmodSync(ownerPath, 384);
250571
+ fs8.chmodSync(ownerPath, 384);
250328
250572
  return { path: candidatePath, owner };
250329
250573
  } catch (error48) {
250330
- fs7.rmSync(candidatePath, { recursive: true, force: true });
250574
+ fs8.rmSync(candidatePath, { recursive: true, force: true });
250331
250575
  throw error48;
250332
250576
  }
250333
250577
  }
250334
250578
  function quarantineRecoverableDaemonStateLock(lockPath) {
250335
250579
  let stat2;
250336
250580
  try {
250337
- stat2 = fs7.lstatSync(lockPath);
250581
+ stat2 = fs8.lstatSync(lockPath);
250338
250582
  } catch (error48) {
250339
250583
  if (hasErrorCode(error48, "ENOENT")) return;
250340
250584
  throw error48;
@@ -250347,7 +250591,7 @@ function quarantineRecoverableDaemonStateLock(lockPath) {
250347
250591
  }
250348
250592
  const quarantinePath = `${lockPath}.stale-${stat2.dev}-${stat2.ino}-${String(stat2.ctimeMs).replace(".", "-")}`;
250349
250593
  try {
250350
- fs7.renameSync(lockPath, quarantinePath);
250594
+ fs8.renameSync(lockPath, quarantinePath);
250351
250595
  } catch (error48) {
250352
250596
  if (hasErrorCode(error48, "ENOENT") || hasErrorCode(error48, "EEXIST") || hasErrorCode(error48, "ENOTEMPTY")) {
250353
250597
  return;
@@ -250361,7 +250605,7 @@ function acquireDaemonStateLock(lockPath) {
250361
250605
  try {
250362
250606
  for (let attempt = 0; attempt < 8; attempt += 1) {
250363
250607
  try {
250364
- fs7.renameSync(candidate.path, lockPath);
250608
+ fs8.renameSync(candidate.path, lockPath);
250365
250609
  acquired = true;
250366
250610
  return candidate.owner;
250367
250611
  } catch (error48) {
@@ -250376,7 +250620,7 @@ function acquireDaemonStateLock(lockPath) {
250376
250620
  );
250377
250621
  } finally {
250378
250622
  if (!acquired) {
250379
- fs7.rmSync(candidate.path, { recursive: true, force: true });
250623
+ fs8.rmSync(candidate.path, { recursive: true, force: true });
250380
250624
  }
250381
250625
  }
250382
250626
  }
@@ -250387,7 +250631,7 @@ function sweepLockQuarantine(lockPath) {
250387
250631
  const candidatePrefix = `${base}.candidate-`;
250388
250632
  let entries;
250389
250633
  try {
250390
- entries = fs7.readdirSync(runDir);
250634
+ entries = fs8.readdirSync(runDir);
250391
250635
  } catch {
250392
250636
  return;
250393
250637
  }
@@ -250401,7 +250645,7 @@ function sweepLockQuarantine(lockPath) {
250401
250645
  }
250402
250646
  if (!removable) continue;
250403
250647
  try {
250404
- fs7.rmSync(path19.join(runDir, entry), { recursive: true, force: true });
250648
+ fs8.rmSync(path19.join(runDir, entry), { recursive: true, force: true });
250405
250649
  } catch {
250406
250650
  }
250407
250651
  }
@@ -250413,13 +250657,13 @@ function releaseDaemonStateLock(lockPath, expected) {
250413
250657
  `Cannot release daemon state lock at ${lockPath}: lock ownership changed`
250414
250658
  );
250415
250659
  }
250416
- fs7.rmSync(lockPath, { recursive: true });
250660
+ fs8.rmSync(lockPath, { recursive: true });
250417
250661
  }
250418
250662
  function withDaemonStateLock(dataDir, operation) {
250419
250663
  const lockPath = daemonStateLockPath(dataDir);
250420
250664
  const runDir = path19.dirname(lockPath);
250421
- fs7.mkdirSync(runDir, { recursive: true, mode: 448 });
250422
- fs7.chmodSync(runDir, 448);
250665
+ fs8.mkdirSync(runDir, { recursive: true, mode: 448 });
250666
+ fs8.chmodSync(runDir, 448);
250423
250667
  const owner = acquireDaemonStateLock(lockPath);
250424
250668
  try {
250425
250669
  sweepLockQuarantine(lockPath);
@@ -250437,7 +250681,7 @@ function inspectDaemonState(dataDir) {
250437
250681
  const statePath = daemonStatePath(dataDir);
250438
250682
  let contents;
250439
250683
  try {
250440
- contents = fs7.readFileSync(statePath, "utf8");
250684
+ contents = fs8.readFileSync(statePath, "utf8");
250441
250685
  } catch (error48) {
250442
250686
  if (error48 instanceof Error && "code" in error48 && error48.code === "ENOENT") {
250443
250687
  return { kind: "missing" };
@@ -250649,14 +250893,14 @@ function claimDaemonStateUnlocked(dataDir, connectTo, version2) {
250649
250893
  version: version2
250650
250894
  };
250651
250895
  const statePath = daemonStatePath(dataDir);
250652
- fs7.mkdirSync(path19.dirname(statePath), { recursive: true, mode: 448 });
250653
- fs7.chmodSync(path19.dirname(statePath), 448);
250654
- fs7.writeFileSync(statePath, `${JSON.stringify(state)}
250896
+ fs8.mkdirSync(path19.dirname(statePath), { recursive: true, mode: 448 });
250897
+ fs8.chmodSync(path19.dirname(statePath), 448);
250898
+ fs8.writeFileSync(statePath, `${JSON.stringify(state)}
250655
250899
  `, {
250656
250900
  flag: "wx",
250657
250901
  mode: 384
250658
250902
  });
250659
- fs7.chmodSync(statePath, 384);
250903
+ fs8.chmodSync(statePath, 384);
250660
250904
  return state;
250661
250905
  }
250662
250906
  function removeDaemonStateIfOwned(dataDir, expected) {
@@ -250669,7 +250913,7 @@ function removeDaemonStateIfOwnedUnlocked(dataDir, expected) {
250669
250913
  const statePath = daemonStatePath(dataDir);
250670
250914
  let contents;
250671
250915
  try {
250672
- contents = fs7.readFileSync(statePath, "utf8");
250916
+ contents = fs8.readFileSync(statePath, "utf8");
250673
250917
  } catch (error48) {
250674
250918
  if (hasErrorCode(error48, "ENOENT")) return false;
250675
250919
  throw error48;
@@ -250684,7 +250928,7 @@ function removeDaemonStateIfOwnedUnlocked(dataDir, expected) {
250684
250928
  return false;
250685
250929
  }
250686
250930
  try {
250687
- fs7.unlinkSync(statePath);
250931
+ fs8.unlinkSync(statePath);
250688
250932
  return true;
250689
250933
  } catch (error48) {
250690
250934
  if (hasErrorCode(error48, "ENOENT")) return false;
@@ -250794,26 +251038,26 @@ import path20 from "node:path";
250794
251038
  import { fileURLToPath as fileURLToPath3 } from "node:url";
250795
251039
  import { promisify as promisify8 } from "node:util";
250796
251040
  import childProcess from "node:child_process";
250797
- import fs12, { constants as fsConstants4 } from "node:fs/promises";
251041
+ import fs13, { constants as fsConstants4 } from "node:fs/promises";
250798
251042
 
250799
251043
  // ../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js
250800
251044
  import process4 from "node:process";
250801
- import fs11, { constants as fsConstants3 } from "node:fs/promises";
251045
+ import fs12, { constants as fsConstants3 } from "node:fs/promises";
250802
251046
 
250803
251047
  // ../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
250804
251048
  import process3 from "node:process";
250805
251049
  import os from "node:os";
250806
- import fs10 from "node:fs";
251050
+ import fs11 from "node:fs";
250807
251051
 
250808
251052
  // ../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
250809
- import fs9 from "node:fs";
251053
+ import fs10 from "node:fs";
250810
251054
 
250811
251055
  // ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
250812
- import fs8 from "node:fs";
251056
+ import fs9 from "node:fs";
250813
251057
  var isDockerCached;
250814
251058
  function hasDockerEnv() {
250815
251059
  try {
250816
- fs8.statSync("/.dockerenv");
251060
+ fs9.statSync("/.dockerenv");
250817
251061
  return true;
250818
251062
  } catch {
250819
251063
  return false;
@@ -250821,7 +251065,7 @@ function hasDockerEnv() {
250821
251065
  }
250822
251066
  function hasDockerCGroup() {
250823
251067
  try {
250824
- return fs8.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
251068
+ return fs9.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
250825
251069
  } catch {
250826
251070
  return false;
250827
251071
  }
@@ -250837,7 +251081,7 @@ function isDocker() {
250837
251081
  var cachedResult;
250838
251082
  var hasContainerEnv = () => {
250839
251083
  try {
250840
- fs9.statSync("/run/.containerenv");
251084
+ fs10.statSync("/run/.containerenv");
250841
251085
  return true;
250842
251086
  } catch {
250843
251087
  return false;
@@ -250862,7 +251106,7 @@ var isWsl = () => {
250862
251106
  return true;
250863
251107
  }
250864
251108
  try {
250865
- return fs10.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
251109
+ return fs11.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
250866
251110
  } catch {
250867
251111
  return false;
250868
251112
  }
@@ -250880,14 +251124,14 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
250880
251124
  const configFilePath = "/etc/wsl.conf";
250881
251125
  let isConfigFileExists = false;
250882
251126
  try {
250883
- await fs11.access(configFilePath, fsConstants3.F_OK);
251127
+ await fs12.access(configFilePath, fsConstants3.F_OK);
250884
251128
  isConfigFileExists = true;
250885
251129
  } catch {
250886
251130
  }
250887
251131
  if (!isConfigFileExists) {
250888
251132
  return defaultMountPoint;
250889
251133
  }
250890
- const configContent = await fs11.readFile(configFilePath, { encoding: "utf8" });
251134
+ const configContent = await fs12.readFile(configFilePath, { encoding: "utf8" });
250891
251135
  const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
250892
251136
  if (!configMountPoint) {
250893
251137
  return defaultMountPoint;
@@ -251192,7 +251436,7 @@ var baseOpen = async (options) => {
251192
251436
  const isBundled = !__dirname2 || __dirname2 === "/";
251193
251437
  let exeLocalXdgOpen = false;
251194
251438
  try {
251195
- await fs12.access(localXdgOpenPath, fsConstants4.X_OK);
251439
+ await fs13.access(localXdgOpenPath, fsConstants4.X_OK);
251196
251440
  exeLocalXdgOpen = true;
251197
251441
  } catch {
251198
251442
  }
@@ -251307,21 +251551,11 @@ function loadTLSOptions(flags) {
251307
251551
  process.exit(1);
251308
251552
  }
251309
251553
  return {
251310
- cert: fs13.readFileSync(certPath),
251311
- key: fs13.readFileSync(keyPath),
251312
- ...clientCAPath && { clientCA: fs13.readFileSync(clientCAPath) }
251554
+ cert: fs14.readFileSync(certPath),
251555
+ key: fs14.readFileSync(keyPath),
251556
+ ...clientCAPath && { clientCA: fs14.readFileSync(clientCAPath) }
251313
251557
  };
251314
251558
  }
251315
- function readPackageVersion() {
251316
- try {
251317
- const parsed = JSON.parse(
251318
- fs13.readFileSync(new URL("../package.json", import.meta.url), "utf8")
251319
- );
251320
- return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "unknown";
251321
- } catch {
251322
- return "unknown";
251323
- }
251324
- }
251325
251559
  var startCommand = buildCommand({
251326
251560
  parameters: {
251327
251561
  flags: {
@@ -251334,7 +251568,7 @@ var startCommand = buildCommand({
251334
251568
  host: {
251335
251569
  kind: "parsed",
251336
251570
  parse: String,
251337
- brief: "Network interface to bind (default: 127.0.0.1, loopback only). Use 0.0.0.0 to expose on all interfaces \u2014 only do so behind --auth, VIBEDECKX_API_KEY, or a trusted tunnel/proxy.",
251571
+ brief: "Network interface to bind (default: 127.0.0.1, loopback only). Use 0.0.0.0 to expose on all interfaces \u2014 only do so behind --auth or an authenticating proxy.",
251338
251572
  optional: true
251339
251573
  },
251340
251574
  auth: {
@@ -251405,11 +251639,16 @@ var startCommand = buildCommand({
251405
251639
  const noLocalProjects = flags["no-local-projects"] ?? false;
251406
251640
  const tls = loadTLSOptions(flags);
251407
251641
  const isLoopbackHost = host === "127.0.0.1" || host === "::1" || host === "localhost";
251408
- if (!isLoopbackHost && !authEnabled && !process.env.VIBEDECKX_API_KEY) {
251642
+ if (!isLoopbackHost && !authEnabled) {
251409
251643
  console.warn(
251410
251644
  `Warning: binding to ${host} exposes vibedeckx on the network with no authentication.
251411
- Anyone who can reach this host can run commands via the executor API. Enable --auth or
251412
- set VIBEDECKX_API_KEY, or keep the default loopback bind (127.0.0.1) behind a trusted tunnel/proxy.`
251645
+ Anyone who can reach this host can run commands via the executor API. Enable --auth, or put
251646
+ an authenticating proxy in front, or keep the default loopback bind (127.0.0.1).`
251647
+ );
251648
+ }
251649
+ if (process.env.VIBEDECKX_API_KEY) {
251650
+ console.log(
251651
+ "VIBEDECKX_API_KEY is set: it authenticates operator-only endpoints (/api/admin/*).\nIt does not lock the rest of the API and is not user authentication \u2014 use --auth or a\nproxy in front for that."
251413
251652
  );
251414
251653
  }
251415
251654
  console.log(`Starting vibedeckx${tls ? " (HTTPS)" : ""}...`);
@@ -251685,7 +251924,7 @@ var connectRoutes = buildRouteMap({
251685
251924
  defaultCommand: "run",
251686
251925
  docs: { brief: "Connect to a Vibedeckx server as an inbound node" }
251687
251926
  });
251688
- var routes33 = buildRouteMap({
251927
+ var routes34 = buildRouteMap({
251689
251928
  routes: {
251690
251929
  start: startCommand,
251691
251930
  connect: connectRoutes
@@ -251695,7 +251934,7 @@ var routes33 = buildRouteMap({
251695
251934
  brief: "Vibedeckx - AI-powered app generator"
251696
251935
  }
251697
251936
  });
251698
- var program = buildApplication(routes33, {
251937
+ var program = buildApplication(routes34, {
251699
251938
  name: "vibedeckx",
251700
251939
  versionInfo: {
251701
251940
  currentVersion: readPackageVersion()