@vibedeckx/darwin-arm64 0.3.2 → 0.3.3
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 +342 -199
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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
|
|
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 &&
|
|
31830
|
-
return
|
|
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
|
|
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
|
-
|
|
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
|
|
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)(
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
60540
|
+
const fs15 = this.flowScalar(this.type);
|
|
60541
60541
|
if (atNextItem || it.value) {
|
|
60542
|
-
map2.items.push({ start, key:
|
|
60542
|
+
map2.items.push({ start, key: fs15, sep: [] });
|
|
60543
60543
|
this.onKeyLine = true;
|
|
60544
60544
|
} else if (it.sep) {
|
|
60545
|
-
this.stack.push(
|
|
60545
|
+
this.stack.push(fs15);
|
|
60546
60546
|
} else {
|
|
60547
|
-
Object.assign(it, { key:
|
|
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
|
|
60675
|
+
const fs15 = this.flowScalar(this.type);
|
|
60676
60676
|
if (!it || it.value)
|
|
60677
|
-
fc.items.push({ start: [], key:
|
|
60677
|
+
fc.items.push({ start: [], key: fs15, sep: [] });
|
|
60678
60678
|
else if (it.sep)
|
|
60679
|
-
this.stack.push(
|
|
60679
|
+
this.stack.push(fs15);
|
|
60680
60680
|
else
|
|
60681
|
-
Object.assign(it, { key:
|
|
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
|
|
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")) || !
|
|
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 =
|
|
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
|
|
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)
|
|
66951
|
-
const fd =
|
|
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
|
-
|
|
66958
|
+
fs15.mkdir(path22.dirname(file2), { recursive: true }, (err) => {
|
|
66959
66959
|
if (err) return fileOpened(err);
|
|
66960
|
-
|
|
66960
|
+
fs15.open(file2, flags, mode, fileOpened);
|
|
66961
66961
|
});
|
|
66962
66962
|
} else {
|
|
66963
|
-
|
|
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 = () =>
|
|
67005
|
-
fsWrite = () =>
|
|
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 = () =>
|
|
67013
|
-
fsWrite = () =>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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,
|
|
82858
|
+
ajv.addFormat(f2, fs15[f2]);
|
|
82859
82859
|
}
|
|
82860
82860
|
module.exports = exports = formatsPlugin;
|
|
82861
82861
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -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:
|
|
101346
|
-
this.#fs = fsFromOption(
|
|
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(
|
|
101906
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
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(
|
|
101936
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
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
|
|
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
|
-
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
105203
|
+
stats = await fs15.stat(path22.join(dir, filename));
|
|
105204
105204
|
} catch {
|
|
105205
105205
|
return;
|
|
105206
105206
|
}
|
|
@@ -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
|
|
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 (
|
|
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
|
|
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 (!
|
|
115691
|
+
if (!fs15.existsSync(authPath)) {
|
|
115692
115692
|
return null;
|
|
115693
115693
|
}
|
|
115694
|
-
const content =
|
|
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 (!
|
|
115707
|
-
|
|
115706
|
+
if (!fs15.existsSync(authDir)) {
|
|
115707
|
+
fs15.mkdirSync(authDir, { mode: 504, recursive: true });
|
|
115708
115708
|
}
|
|
115709
|
-
|
|
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
|
|
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 (!
|
|
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(
|
|
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
|
-
|
|
115964
|
-
|
|
115965
|
-
|
|
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 (!
|
|
115976
|
+
if (!fs15.existsSync(tokenPath)) {
|
|
115977
115977
|
return null;
|
|
115978
115978
|
}
|
|
115979
|
-
const token = JSON.parse(
|
|
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
|
|
152242
|
+
var fs15;
|
|
152243
152243
|
try {
|
|
152244
|
-
|
|
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 (!
|
|
152256
|
-
return (stream instanceof (
|
|
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,7 @@ 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";
|
|
154380
154381
|
|
|
154381
154382
|
// src/load-env.ts
|
|
154382
154383
|
function getArg(argv, name25) {
|
|
@@ -169192,7 +169193,7 @@ async function run(app, inputs, context2) {
|
|
|
169192
169193
|
}
|
|
169193
169194
|
|
|
169194
169195
|
// src/command.ts
|
|
169195
|
-
import
|
|
169196
|
+
import fs14 from "node:fs";
|
|
169196
169197
|
import path21 from "node:path";
|
|
169197
169198
|
|
|
169198
169199
|
// src/storage/sqlite.ts
|
|
@@ -186051,9 +186052,21 @@ var mapRemoteServer = (row) => ({
|
|
|
186051
186052
|
status: row.status ?? "unknown",
|
|
186052
186053
|
last_connected_at: row.last_connected_at ?? void 0,
|
|
186053
186054
|
cross_remote_access: row.cross_remote_access ?? "off",
|
|
186055
|
+
worker_version: row.worker_version ?? void 0,
|
|
186056
|
+
worker_capabilities: parseWorkerCapabilities(row.worker_capabilities),
|
|
186057
|
+
worker_version_reported_at: row.worker_version_reported_at ?? void 0,
|
|
186054
186058
|
created_at: row.created_at,
|
|
186055
186059
|
updated_at: row.updated_at
|
|
186056
186060
|
});
|
|
186061
|
+
function parseWorkerCapabilities(raw) {
|
|
186062
|
+
if (!raw) return void 0;
|
|
186063
|
+
try {
|
|
186064
|
+
const parsed = JSON.parse(raw);
|
|
186065
|
+
return Array.isArray(parsed) ? parsed.filter((c) => typeof c === "string") : void 0;
|
|
186066
|
+
} catch {
|
|
186067
|
+
return void 0;
|
|
186068
|
+
}
|
|
186069
|
+
}
|
|
186057
186070
|
var mapProjectRemote = (row) => ({
|
|
186058
186071
|
id: row.id,
|
|
186059
186072
|
project_id: row.project_id,
|
|
@@ -186152,6 +186165,14 @@ var createRemoteServerRepos = (kdb, _h) => ({
|
|
|
186152
186165
|
if (status === "online") sets.last_connected_at = sql`datetime('now')`;
|
|
186153
186166
|
await kdb.updateTable("remote_servers").set(sets).where("id", "=", id).execute();
|
|
186154
186167
|
},
|
|
186168
|
+
updateWorkerVersion: async (id, version2, capabilities) => {
|
|
186169
|
+
await kdb.updateTable("remote_servers").set({
|
|
186170
|
+
worker_version: version2,
|
|
186171
|
+
worker_capabilities: JSON.stringify(capabilities),
|
|
186172
|
+
worker_version_reported_at: sql`datetime('now')`,
|
|
186173
|
+
updated_at: sql`datetime('now')`
|
|
186174
|
+
}).where("id", "=", id).execute();
|
|
186175
|
+
},
|
|
186155
186176
|
generateToken: async (id, userId) => {
|
|
186156
186177
|
const existing = await readRemoteServerRow(kdb, id, userId);
|
|
186157
186178
|
if (!existing) return void 0;
|
|
@@ -203388,6 +203409,14 @@ var createDatabase = (dbPath) => {
|
|
|
203388
203409
|
`);
|
|
203389
203410
|
}
|
|
203390
203411
|
}
|
|
203412
|
+
{
|
|
203413
|
+
const workerVersionInfo = db.prepare("PRAGMA table_info(remote_servers)").all();
|
|
203414
|
+
for (const column of ["worker_version", "worker_capabilities", "worker_version_reported_at"]) {
|
|
203415
|
+
if (!workerVersionInfo.some((col) => col.name === column)) {
|
|
203416
|
+
db.exec(`ALTER TABLE remote_servers ADD COLUMN ${column} TEXT`);
|
|
203417
|
+
}
|
|
203418
|
+
}
|
|
203419
|
+
}
|
|
203391
203420
|
db.exec("UPDATE remote_servers SET status = 'offline' WHERE status = 'online'");
|
|
203392
203421
|
{
|
|
203393
203422
|
const oldIndex = db.prepare(
|
|
@@ -245907,7 +245936,79 @@ function createRateLimitedWarn(windowMs, maxKeys) {
|
|
|
245907
245936
|
};
|
|
245908
245937
|
}
|
|
245909
245938
|
|
|
245939
|
+
// src/update-check.ts
|
|
245940
|
+
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-]+)*)?$/;
|
|
245941
|
+
async function fetchLatestPublishedVersion(pkg = "vibedeckx", fetchImpl = fetch) {
|
|
245942
|
+
try {
|
|
245943
|
+
const response = await fetchImpl(
|
|
245944
|
+
`https://registry.npmjs.org/${pkg}/latest`,
|
|
245945
|
+
{ signal: AbortSignal.timeout(4e3) }
|
|
245946
|
+
);
|
|
245947
|
+
if (!response.ok) return void 0;
|
|
245948
|
+
const body = await response.json();
|
|
245949
|
+
return typeof body.version === "string" && parseSemver(body.version) ? body.version : void 0;
|
|
245950
|
+
} catch {
|
|
245951
|
+
return void 0;
|
|
245952
|
+
}
|
|
245953
|
+
}
|
|
245954
|
+
function parseSemver(version2) {
|
|
245955
|
+
const match2 = SEMVER_RE.exec(version2);
|
|
245956
|
+
if (!match2) return void 0;
|
|
245957
|
+
return {
|
|
245958
|
+
core: [match2[1], match2[2], match2[3]],
|
|
245959
|
+
prerelease: match2[4]?.split(".")
|
|
245960
|
+
};
|
|
245961
|
+
}
|
|
245962
|
+
function compareNumericStrings(a, b2) {
|
|
245963
|
+
if (a.length !== b2.length) return a.length - b2.length;
|
|
245964
|
+
return a < b2 ? -1 : a > b2 ? 1 : 0;
|
|
245965
|
+
}
|
|
245966
|
+
function comparePrereleaseIdentifiers(a, b2) {
|
|
245967
|
+
const aNumeric = /^\d+$/.test(a);
|
|
245968
|
+
const bNumeric = /^\d+$/.test(b2);
|
|
245969
|
+
if (aNumeric && bNumeric) return compareNumericStrings(a, b2);
|
|
245970
|
+
if (aNumeric !== bNumeric) return aNumeric ? -1 : 1;
|
|
245971
|
+
return a < b2 ? -1 : a > b2 ? 1 : 0;
|
|
245972
|
+
}
|
|
245973
|
+
function compareSemver(a, b2) {
|
|
245974
|
+
for (let i = 0; i < 3; i += 1) {
|
|
245975
|
+
const compared = compareNumericStrings(a.core[i], b2.core[i]);
|
|
245976
|
+
if (compared !== 0) return compared;
|
|
245977
|
+
}
|
|
245978
|
+
if (!a.prerelease && !b2.prerelease) return 0;
|
|
245979
|
+
if (!a.prerelease) return 1;
|
|
245980
|
+
if (!b2.prerelease) return -1;
|
|
245981
|
+
const length = Math.max(a.prerelease.length, b2.prerelease.length);
|
|
245982
|
+
for (let i = 0; i < length; i += 1) {
|
|
245983
|
+
const aId = a.prerelease[i];
|
|
245984
|
+
const bId = b2.prerelease[i];
|
|
245985
|
+
if (aId === void 0) return -1;
|
|
245986
|
+
if (bId === void 0) return 1;
|
|
245987
|
+
const compared = comparePrereleaseIdentifiers(aId, bId);
|
|
245988
|
+
if (compared !== 0) return compared;
|
|
245989
|
+
}
|
|
245990
|
+
return 0;
|
|
245991
|
+
}
|
|
245992
|
+
function compareVersionStrings(a, b2) {
|
|
245993
|
+
const parsedA = parseSemver(a);
|
|
245994
|
+
const parsedB = parseSemver(b2);
|
|
245995
|
+
if (!parsedA || !parsedB) return void 0;
|
|
245996
|
+
return compareSemver(parsedA, parsedB);
|
|
245997
|
+
}
|
|
245998
|
+
function compareUpdateStatus(current, latest) {
|
|
245999
|
+
if (latest === void 0) return "unknown";
|
|
246000
|
+
const currentParsed = parseSemver(current);
|
|
246001
|
+
const latestParsed = parseSemver(latest);
|
|
246002
|
+
if (!currentParsed || !latestParsed) return "unknown";
|
|
246003
|
+
return compareSemver(latestParsed, currentParsed) > 0 ? "update-available" : "up-to-date";
|
|
246004
|
+
}
|
|
246005
|
+
|
|
245910
246006
|
// src/routes/reverse-connect-routes.ts
|
|
246007
|
+
function extractReportedVersion(frame) {
|
|
246008
|
+
if (typeof frame.version !== "string" || frame.version.length === 0) return void 0;
|
|
246009
|
+
const capabilities = Array.isArray(frame.capabilities) ? frame.capabilities.filter((c) => typeof c === "string") : [];
|
|
246010
|
+
return { version: frame.version, capabilities };
|
|
246011
|
+
}
|
|
245911
246012
|
var MACHINE_HANDSHAKE_TIMEOUT_MS = 5e3;
|
|
245912
246013
|
var REJECT_LOG_WINDOW_MS = 3e4;
|
|
245913
246014
|
var REJECT_LOG_MAX_KEYS = 500;
|
|
@@ -245952,12 +246053,27 @@ var routes24 = async (fastify2) => {
|
|
|
245952
246053
|
const ownerId = await fastify2.storage.remoteServers.getOwnerId(serverId) ?? "";
|
|
245953
246054
|
const nonce = randomBytes2(32);
|
|
245954
246055
|
let settled = false;
|
|
246056
|
+
let stashedVersion;
|
|
246057
|
+
const recordWorkerVersion = async (reported) => {
|
|
246058
|
+
if (!reported) {
|
|
246059
|
+
console.log(`[ReverseConnect] Worker ${serverId} reported no version (pre-reporting release)`);
|
|
246060
|
+
return;
|
|
246061
|
+
}
|
|
246062
|
+
await fastify2.storage.remoteServers.updateWorkerVersion(serverId, reported.version, reported.capabilities);
|
|
246063
|
+
const cmp = compareVersionStrings(reported.version, MIN_WORKER_VERSION);
|
|
246064
|
+
if (cmp !== void 0 && cmp < 0) {
|
|
246065
|
+
console.warn(
|
|
246066
|
+
`[ReverseConnect] Worker ${serverId} runs ${reported.version}, below MIN_WORKER_VERSION ${MIN_WORKER_VERSION} \u2014 advise upgrading`
|
|
246067
|
+
);
|
|
246068
|
+
}
|
|
246069
|
+
};
|
|
245955
246070
|
const registerUnauthenticated = async () => {
|
|
245956
246071
|
if (settled) return;
|
|
245957
246072
|
settled = true;
|
|
245958
246073
|
socket.off("message", onChallengeReply);
|
|
245959
246074
|
fastify2.reverseConnectManager.registerConnection(serverId, ws);
|
|
245960
246075
|
await fastify2.storage.remoteServers.updateStatus(serverId, "online");
|
|
246076
|
+
await recordWorkerVersion(stashedVersion);
|
|
245961
246077
|
};
|
|
245962
246078
|
const timer = setTimeout(() => {
|
|
245963
246079
|
registerUnauthenticated().catch((err) => {
|
|
@@ -245972,6 +246088,10 @@ var routes24 = async (fastify2) => {
|
|
|
245972
246088
|
} catch {
|
|
245973
246089
|
return;
|
|
245974
246090
|
}
|
|
246091
|
+
if (frame?.type === "status") {
|
|
246092
|
+
stashedVersion = extractReportedVersion(frame) ?? stashedVersion;
|
|
246093
|
+
return;
|
|
246094
|
+
}
|
|
245975
246095
|
if (frame?.type !== "machine_auth" || settled) return;
|
|
245976
246096
|
settled = true;
|
|
245977
246097
|
clearTimeout(timer);
|
|
@@ -246007,6 +246127,7 @@ var routes24 = async (fastify2) => {
|
|
|
246007
246127
|
console.log(`[ReverseConnect] Machine auth verified ${fingerprint.slice(0, 12)} for ${serverId}`);
|
|
246008
246128
|
fastify2.reverseConnectManager.registerConnection(serverId, ws, fingerprint);
|
|
246009
246129
|
await fastify2.storage.remoteServers.updateStatus(serverId, "online");
|
|
246130
|
+
await recordWorkerVersion(extractReportedVersion(frame) ?? stashedVersion);
|
|
246010
246131
|
} catch (err) {
|
|
246011
246132
|
console.error(`[ReverseConnect] Machine challenge handling failed for ${serverId}:`, err);
|
|
246012
246133
|
try {
|
|
@@ -249530,6 +249651,94 @@ function redactErrorSecret(error48, secret) {
|
|
|
249530
249651
|
return redactSecretForms(message, secret);
|
|
249531
249652
|
}
|
|
249532
249653
|
|
|
249654
|
+
// src/utils/package-version.ts
|
|
249655
|
+
import fs7 from "fs";
|
|
249656
|
+
function readPackageVersion() {
|
|
249657
|
+
for (const candidate of ["../package.json", "../../package.json"]) {
|
|
249658
|
+
try {
|
|
249659
|
+
const parsed = JSON.parse(
|
|
249660
|
+
fs7.readFileSync(new URL(candidate, import.meta.url), "utf8")
|
|
249661
|
+
);
|
|
249662
|
+
if (typeof parsed.version === "string" && parsed.version.length > 0) return parsed.version;
|
|
249663
|
+
} catch {
|
|
249664
|
+
}
|
|
249665
|
+
}
|
|
249666
|
+
return "unknown";
|
|
249667
|
+
}
|
|
249668
|
+
|
|
249669
|
+
// src/reverse-connect-capabilities.ts
|
|
249670
|
+
var WORKER_CAPABILITIES = {
|
|
249671
|
+
// --- Agent sessions ---
|
|
249672
|
+
"http:GET /api/path/agent-sessions": { since: "0.2.0", summary: "\u4F1A\u8BDD\u5217\u8868(\u6309\u8DEF\u5F84)" },
|
|
249673
|
+
"http:POST /api/path/agent-sessions": { since: "0.2.0", summary: "\u521B\u5EFA\u4F1A\u8BDD" },
|
|
249674
|
+
"http:POST /api/path/agent-sessions/new": { since: "0.2.0", summary: "\u521B\u5EFA\u4F1A\u8BDD(\u6307\u5B9A ID)" },
|
|
249675
|
+
"http:GET /api/agent-sessions/:param": { since: "0.2.0", summary: "\u8BFB\u4F1A\u8BDD\u8BE6\u60C5/\u5BF9\u8BDD" },
|
|
249676
|
+
"http:POST /api/agent-sessions/:param/message": { since: "0.2.0", summary: "\u53D1\u6D88\u606F\u7ED9\u4F1A\u8BDD" },
|
|
249677
|
+
"http:POST /api/agent-sessions/:param/paste": { since: "0.2.0", summary: "\u7C98\u8D34\u56FE\u7247/\u957F\u6587\u672C" },
|
|
249678
|
+
"http:POST /api/agent-sessions/:param/stop": { since: "0.2.0", summary: "\u505C\u6B62\u4F1A\u8BDD turn" },
|
|
249679
|
+
"http:POST /api/agent-sessions/:param/restart": { since: "0.2.0", summary: "\u91CD\u542F\u4F1A\u8BDD\u8FDB\u7A0B" },
|
|
249680
|
+
"http:POST /api/agent-sessions/:param/agent-type": { since: "0.2.0", summary: "\u5207\u6362 agent \u7C7B\u578B" },
|
|
249681
|
+
"http:POST /api/agent-sessions/:param/model": { since: "0.2.0", summary: "\u5207\u6362\u4F1A\u8BDD\u6A21\u578B" },
|
|
249682
|
+
"http:POST /api/path/agent-sessions/:param/branch": { since: "0.2.0", summary: "\u4ECE\u5386\u53F2\u5206\u53C9\u4F1A\u8BDD" },
|
|
249683
|
+
"http:POST /api/agent-sessions/:param/switch-mode": { since: "0.2.0", summary: "\u6743\u9650\u6A21\u5F0F\u5207\u6362" },
|
|
249684
|
+
"http:POST /api/agent-sessions/:param/accept-plan": { since: "0.2.0", summary: "\u63A5\u53D7\u8BA1\u5212(\u9000\u51FA plan \u6A21\u5F0F)" },
|
|
249685
|
+
"http:POST /api/agent-sessions/:param/approve": { since: "0.2.0", summary: "\u5DE5\u5177\u5BA1\u6279\u51B3\u5B9A" },
|
|
249686
|
+
"http:DELETE /api/agent-sessions/:param": { since: "0.2.0", summary: "\u5220\u9664\u4F1A\u8BDD" },
|
|
249687
|
+
"http:PATCH /api/agent-sessions/:param/title": { since: "0.2.0", summary: "\u6539\u4F1A\u8BDD\u6807\u9898" },
|
|
249688
|
+
"http:PATCH /api/agent-sessions/:param/favorite": { since: "0.2.0", summary: "\u6536\u85CF\u4F1A\u8BDD" },
|
|
249689
|
+
"ws:/api/agent-sessions/:param/stream": { since: "0.2.0", summary: "\u4F1A\u8BDD\u6D88\u606F\u6D41(JSON Patch)" },
|
|
249690
|
+
// --- Executors / processes / terminals ---
|
|
249691
|
+
"http:POST /api/path/execute": { since: "0.2.0", summary: "\u542F\u52A8 executor \u8FDB\u7A0B" },
|
|
249692
|
+
"http:POST /api/execute-one-shot": { since: "0.2.0", summary: "\u4E00\u6B21\u6027\u547D\u4EE4\u6267\u884C" },
|
|
249693
|
+
"http:POST /api/executor-processes/:param/stop": { since: "0.2.0", summary: "\u505C\u6B62 executor \u8FDB\u7A0B" },
|
|
249694
|
+
"http:GET /api/executor-processes/running": { since: "0.2.0", summary: "\u8FD0\u884C\u4E2D\u8FDB\u7A0B\u5217\u8868" },
|
|
249695
|
+
"http:POST /api/path/terminals": { since: "0.2.0", summary: "\u5F00\u7EC8\u7AEF" },
|
|
249696
|
+
"http:POST /api/path/terminals/:param/send": { since: "0.2.0", summary: "\u7EC8\u7AEF\u8F93\u5165" },
|
|
249697
|
+
"ws:/api/executor-processes/:param/logs": { since: "0.2.0", summary: "\u8FDB\u7A0B\u65E5\u5FD7\u6D41" },
|
|
249698
|
+
// --- Workflow runs ---
|
|
249699
|
+
// Empirically bisected via cross-version e2e: 0.2.4 → 404, 0.2.5 → serves.
|
|
249700
|
+
"http:POST /api/path/workflow-runs": { since: "0.2.5", summary: "\u521B\u5EFA workflow run" },
|
|
249701
|
+
"http:GET /api/path/workflow-runs": { since: "0.2.5", summary: "workflow run \u5217\u8868" },
|
|
249702
|
+
"http:GET /api/path/workflow-runs/reviewer-candidate": { since: "0.2.5", summary: "reviewer \u5019\u9009\u67E5\u8BE2" },
|
|
249703
|
+
"http:GET /api/workflow-runs/:param": { since: "0.2.5", summary: "\u8BFB workflow run" },
|
|
249704
|
+
"http:POST /api/workflow-runs/:param/gate": { since: "0.2.5", summary: "workflow \u7528\u6237\u95F8\u95E8\u51B3\u5B9A" },
|
|
249705
|
+
"http:POST /api/workflow-runs/:param/cancel": { since: "0.2.5", summary: "\u53D6\u6D88 workflow run" },
|
|
249706
|
+
// --- Git / worktrees / diff ---
|
|
249707
|
+
"http:GET /api/path/worktrees": { since: "0.2.0", summary: "worktree \u5217\u8868/\u72B6\u6001" },
|
|
249708
|
+
"http:POST /api/path/worktrees": { since: "0.2.0", summary: "\u5EFA worktree" },
|
|
249709
|
+
"http:DELETE /api/path/worktrees": { since: "0.2.0", summary: "\u5220 worktree" },
|
|
249710
|
+
"http:GET /api/path/branches": { since: "0.2.0", summary: "\u5206\u652F\u5217\u8868" },
|
|
249711
|
+
"http:GET /api/path/branches/activity": { since: "0.2.0", summary: "\u5206\u652F\u6D3B\u52A8\u6982\u89C8" },
|
|
249712
|
+
"http:POST /api/path/branches/merge-status": { since: "0.2.0", summary: "\u5206\u652F\u5408\u5E76\u72B6\u6001\u68C0\u6D4B" },
|
|
249713
|
+
"http:GET /api/path/diff": { since: "0.2.0", summary: "\u5DE5\u4F5C\u533A/\u5206\u652F diff" },
|
|
249714
|
+
"http:GET /api/path/commits": { since: "0.2.0", summary: "\u63D0\u4EA4\u5217\u8868" },
|
|
249715
|
+
// --- Files ---
|
|
249716
|
+
"http:GET /api/browse": { since: "0.2.0", summary: "\u6D4F\u89C8\u8FDC\u7AEF\u76EE\u5F55(server \u7BA1\u7406\u9875)" },
|
|
249717
|
+
"http:POST /api/mkdir": { since: "0.2.0", summary: "\u8FDC\u7AEF\u5EFA\u76EE\u5F55" },
|
|
249718
|
+
"http:GET /api/path/browse": { since: "0.2.0", summary: "\u6D4F\u89C8\u9879\u76EE\u76EE\u5F55" },
|
|
249719
|
+
"http:GET /api/path/list-files": { since: "0.2.0", summary: "\u6587\u4EF6\u6811\u5217\u4E3E" },
|
|
249720
|
+
"http:GET /api/path/file-content": { since: "0.2.0", summary: "\u8BFB\u6587\u4EF6\u5185\u5BB9" },
|
|
249721
|
+
"http:GET /api/path/symbol-search": { since: "0.2.0", summary: "\u7B26\u53F7\u641C\u7D22" },
|
|
249722
|
+
"http:GET /api/path/file-download": { since: "0.2.0", summary: "\u6587\u4EF6\u4E0B\u8F7D(\u53EF\u4E8C\u8FDB\u5236)" },
|
|
249723
|
+
"http:POST /api/path/upload": { since: "0.2.0", summary: "\u6587\u4EF6\u4E0A\u4F20" },
|
|
249724
|
+
"http:DELETE /api/path/delete": { since: "0.2.0", summary: "\u5220\u9664\u6587\u4EF6" },
|
|
249725
|
+
// --- Search / notifications / cross-remote ---
|
|
249726
|
+
"http:GET /api/path/search-catalog": { since: "0.2.0", summary: "\u641C\u7D22\u76EE\u5F55\u5FEB\u7167" },
|
|
249727
|
+
// Empirically probed: 0.2.15 → 404, 0.2.16 → 400 (route exists).
|
|
249728
|
+
"http:POST /api/notification-outbox/query": { since: "0.2.16", summary: "\u62C9\u53D6 worker \u901A\u77E5 outbox" },
|
|
249729
|
+
"http:POST /api/path/cross-remote/exec": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u6267\u884C\u547D\u4EE4" },
|
|
249730
|
+
"http:POST /api/path/cross-remote/read-file": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u8BFB\u6587\u4EF6" },
|
|
249731
|
+
"http:POST /api/path/cross-remote/list-dir": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u5217\u76EE\u5F55" },
|
|
249732
|
+
"http:POST /api/path/cross-remote/stat": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:stat" },
|
|
249733
|
+
"http:POST /api/path/cross-remote/process-list": { since: "0.2.0", summary: "\u8DE8\u8FDC\u7A0B\u7F51\u5173:\u8FDB\u7A0B\u5217\u8868" },
|
|
249734
|
+
// --- Raw passthrough ---
|
|
249735
|
+
// Browser preview proxies caller-supplied paths (and localhost ports) through
|
|
249736
|
+
// the tunnel; the path set is unbounded by design, so it registers as one
|
|
249737
|
+
// passthrough capability instead of per-route entries.
|
|
249738
|
+
"passthrough:browser-proxy": { since: "0.2.0", summary: "\u6D4F\u89C8\u5668\u9884\u89C8\u900F\u4F20(\u4EFB\u610F path+port)" }
|
|
249739
|
+
};
|
|
249740
|
+
var WORKER_CAPABILITY_KEYS = Object.keys(WORKER_CAPABILITIES);
|
|
249741
|
+
|
|
249533
249742
|
// src/reverse-connect-client.ts
|
|
249534
249743
|
var MACHINE_KEY_SETTING = "reverse_machine_private_key";
|
|
249535
249744
|
var RECONNECT_BASE_DELAY_MS = 1e3;
|
|
@@ -249574,7 +249783,12 @@ var ReverseConnectClient = class {
|
|
|
249574
249783
|
console.log("[ReverseClient] Socket open, awaiting server handshake");
|
|
249575
249784
|
this.openedAt = Date.now();
|
|
249576
249785
|
this.resetNoPingTimer();
|
|
249577
|
-
const frame = {
|
|
249786
|
+
const frame = {
|
|
249787
|
+
type: "status",
|
|
249788
|
+
ready: true,
|
|
249789
|
+
version: readPackageVersion(),
|
|
249790
|
+
capabilities: WORKER_CAPABILITY_KEYS
|
|
249791
|
+
};
|
|
249578
249792
|
this.ws.send(JSON.stringify(frame));
|
|
249579
249793
|
});
|
|
249580
249794
|
this.ws.on("message", (data) => {
|
|
@@ -249663,7 +249877,9 @@ var ReverseConnectClient = class {
|
|
|
249663
249877
|
const reply = {
|
|
249664
249878
|
type: "machine_auth",
|
|
249665
249879
|
publicKey: publicKeyPem,
|
|
249666
|
-
signature: signature.toString("base64")
|
|
249880
|
+
signature: signature.toString("base64"),
|
|
249881
|
+
version: readPackageVersion(),
|
|
249882
|
+
capabilities: WORKER_CAPABILITY_KEYS
|
|
249667
249883
|
};
|
|
249668
249884
|
this.sendFrame(reply);
|
|
249669
249885
|
} catch (err) {
|
|
@@ -249856,71 +250072,8 @@ var ReverseConnectClient = class {
|
|
|
249856
250072
|
// src/connect-daemon.ts
|
|
249857
250073
|
import { spawn as spawn5 } from "node:child_process";
|
|
249858
250074
|
import { randomUUID as randomUUID23 } from "node:crypto";
|
|
249859
|
-
import
|
|
250075
|
+
import fs8 from "node:fs";
|
|
249860
250076
|
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
250077
|
var CONNECT_DAEMON_CHILD_ENV = "VIBEDECKX_INTERNAL_CONNECT_DAEMON";
|
|
249925
250078
|
var CONNECT_DAEMON_TOKEN_ENV = "VIBEDECKX_INTERNAL_CONNECT_TOKEN";
|
|
249926
250079
|
function buildDaemonChildArgs(argv) {
|
|
@@ -250258,7 +250411,7 @@ function parseLinuxProcessStartTicks(stat2) {
|
|
|
250258
250411
|
function readLinuxProcessStartTicks(pid) {
|
|
250259
250412
|
try {
|
|
250260
250413
|
return parseLinuxProcessStartTicks(
|
|
250261
|
-
|
|
250414
|
+
fs8.readFileSync(`/proc/${pid}/stat`, "utf8")
|
|
250262
250415
|
);
|
|
250263
250416
|
} catch (error48) {
|
|
250264
250417
|
if (error48 instanceof Error && "code" in error48 && (error48.code === "ENOENT" || error48.code === "ESRCH")) {
|
|
@@ -250287,7 +250440,7 @@ function daemonStateLockOwnerPath(lockPath) {
|
|
|
250287
250440
|
function readDaemonStateLockOwner(lockPath) {
|
|
250288
250441
|
let contents;
|
|
250289
250442
|
try {
|
|
250290
|
-
contents =
|
|
250443
|
+
contents = fs8.readFileSync(daemonStateLockOwnerPath(lockPath), "utf8");
|
|
250291
250444
|
} catch (error48) {
|
|
250292
250445
|
if (hasErrorCode(error48, "ENOENT") || hasErrorCode(error48, "ENOTDIR")) {
|
|
250293
250446
|
return void 0;
|
|
@@ -250315,26 +250468,26 @@ function createDaemonStateLockCandidate(lockPath) {
|
|
|
250315
250468
|
nonce: randomUUID23()
|
|
250316
250469
|
};
|
|
250317
250470
|
const candidatePath = `${lockPath}.candidate-${process.pid}-${owner.nonce}`;
|
|
250318
|
-
|
|
250471
|
+
fs8.mkdirSync(candidatePath, { mode: 448 });
|
|
250319
250472
|
try {
|
|
250320
|
-
|
|
250473
|
+
fs8.chmodSync(candidatePath, 448);
|
|
250321
250474
|
const ownerPath = daemonStateLockOwnerPath(candidatePath);
|
|
250322
|
-
|
|
250475
|
+
fs8.writeFileSync(ownerPath, `${JSON.stringify(owner)}
|
|
250323
250476
|
`, {
|
|
250324
250477
|
flag: "wx",
|
|
250325
250478
|
mode: 384
|
|
250326
250479
|
});
|
|
250327
|
-
|
|
250480
|
+
fs8.chmodSync(ownerPath, 384);
|
|
250328
250481
|
return { path: candidatePath, owner };
|
|
250329
250482
|
} catch (error48) {
|
|
250330
|
-
|
|
250483
|
+
fs8.rmSync(candidatePath, { recursive: true, force: true });
|
|
250331
250484
|
throw error48;
|
|
250332
250485
|
}
|
|
250333
250486
|
}
|
|
250334
250487
|
function quarantineRecoverableDaemonStateLock(lockPath) {
|
|
250335
250488
|
let stat2;
|
|
250336
250489
|
try {
|
|
250337
|
-
stat2 =
|
|
250490
|
+
stat2 = fs8.lstatSync(lockPath);
|
|
250338
250491
|
} catch (error48) {
|
|
250339
250492
|
if (hasErrorCode(error48, "ENOENT")) return;
|
|
250340
250493
|
throw error48;
|
|
@@ -250347,7 +250500,7 @@ function quarantineRecoverableDaemonStateLock(lockPath) {
|
|
|
250347
250500
|
}
|
|
250348
250501
|
const quarantinePath = `${lockPath}.stale-${stat2.dev}-${stat2.ino}-${String(stat2.ctimeMs).replace(".", "-")}`;
|
|
250349
250502
|
try {
|
|
250350
|
-
|
|
250503
|
+
fs8.renameSync(lockPath, quarantinePath);
|
|
250351
250504
|
} catch (error48) {
|
|
250352
250505
|
if (hasErrorCode(error48, "ENOENT") || hasErrorCode(error48, "EEXIST") || hasErrorCode(error48, "ENOTEMPTY")) {
|
|
250353
250506
|
return;
|
|
@@ -250361,7 +250514,7 @@ function acquireDaemonStateLock(lockPath) {
|
|
|
250361
250514
|
try {
|
|
250362
250515
|
for (let attempt = 0; attempt < 8; attempt += 1) {
|
|
250363
250516
|
try {
|
|
250364
|
-
|
|
250517
|
+
fs8.renameSync(candidate.path, lockPath);
|
|
250365
250518
|
acquired = true;
|
|
250366
250519
|
return candidate.owner;
|
|
250367
250520
|
} catch (error48) {
|
|
@@ -250376,7 +250529,7 @@ function acquireDaemonStateLock(lockPath) {
|
|
|
250376
250529
|
);
|
|
250377
250530
|
} finally {
|
|
250378
250531
|
if (!acquired) {
|
|
250379
|
-
|
|
250532
|
+
fs8.rmSync(candidate.path, { recursive: true, force: true });
|
|
250380
250533
|
}
|
|
250381
250534
|
}
|
|
250382
250535
|
}
|
|
@@ -250387,7 +250540,7 @@ function sweepLockQuarantine(lockPath) {
|
|
|
250387
250540
|
const candidatePrefix = `${base}.candidate-`;
|
|
250388
250541
|
let entries;
|
|
250389
250542
|
try {
|
|
250390
|
-
entries =
|
|
250543
|
+
entries = fs8.readdirSync(runDir);
|
|
250391
250544
|
} catch {
|
|
250392
250545
|
return;
|
|
250393
250546
|
}
|
|
@@ -250401,7 +250554,7 @@ function sweepLockQuarantine(lockPath) {
|
|
|
250401
250554
|
}
|
|
250402
250555
|
if (!removable) continue;
|
|
250403
250556
|
try {
|
|
250404
|
-
|
|
250557
|
+
fs8.rmSync(path19.join(runDir, entry), { recursive: true, force: true });
|
|
250405
250558
|
} catch {
|
|
250406
250559
|
}
|
|
250407
250560
|
}
|
|
@@ -250413,13 +250566,13 @@ function releaseDaemonStateLock(lockPath, expected) {
|
|
|
250413
250566
|
`Cannot release daemon state lock at ${lockPath}: lock ownership changed`
|
|
250414
250567
|
);
|
|
250415
250568
|
}
|
|
250416
|
-
|
|
250569
|
+
fs8.rmSync(lockPath, { recursive: true });
|
|
250417
250570
|
}
|
|
250418
250571
|
function withDaemonStateLock(dataDir, operation) {
|
|
250419
250572
|
const lockPath = daemonStateLockPath(dataDir);
|
|
250420
250573
|
const runDir = path19.dirname(lockPath);
|
|
250421
|
-
|
|
250422
|
-
|
|
250574
|
+
fs8.mkdirSync(runDir, { recursive: true, mode: 448 });
|
|
250575
|
+
fs8.chmodSync(runDir, 448);
|
|
250423
250576
|
const owner = acquireDaemonStateLock(lockPath);
|
|
250424
250577
|
try {
|
|
250425
250578
|
sweepLockQuarantine(lockPath);
|
|
@@ -250437,7 +250590,7 @@ function inspectDaemonState(dataDir) {
|
|
|
250437
250590
|
const statePath = daemonStatePath(dataDir);
|
|
250438
250591
|
let contents;
|
|
250439
250592
|
try {
|
|
250440
|
-
contents =
|
|
250593
|
+
contents = fs8.readFileSync(statePath, "utf8");
|
|
250441
250594
|
} catch (error48) {
|
|
250442
250595
|
if (error48 instanceof Error && "code" in error48 && error48.code === "ENOENT") {
|
|
250443
250596
|
return { kind: "missing" };
|
|
@@ -250649,14 +250802,14 @@ function claimDaemonStateUnlocked(dataDir, connectTo, version2) {
|
|
|
250649
250802
|
version: version2
|
|
250650
250803
|
};
|
|
250651
250804
|
const statePath = daemonStatePath(dataDir);
|
|
250652
|
-
|
|
250653
|
-
|
|
250654
|
-
|
|
250805
|
+
fs8.mkdirSync(path19.dirname(statePath), { recursive: true, mode: 448 });
|
|
250806
|
+
fs8.chmodSync(path19.dirname(statePath), 448);
|
|
250807
|
+
fs8.writeFileSync(statePath, `${JSON.stringify(state)}
|
|
250655
250808
|
`, {
|
|
250656
250809
|
flag: "wx",
|
|
250657
250810
|
mode: 384
|
|
250658
250811
|
});
|
|
250659
|
-
|
|
250812
|
+
fs8.chmodSync(statePath, 384);
|
|
250660
250813
|
return state;
|
|
250661
250814
|
}
|
|
250662
250815
|
function removeDaemonStateIfOwned(dataDir, expected) {
|
|
@@ -250669,7 +250822,7 @@ function removeDaemonStateIfOwnedUnlocked(dataDir, expected) {
|
|
|
250669
250822
|
const statePath = daemonStatePath(dataDir);
|
|
250670
250823
|
let contents;
|
|
250671
250824
|
try {
|
|
250672
|
-
contents =
|
|
250825
|
+
contents = fs8.readFileSync(statePath, "utf8");
|
|
250673
250826
|
} catch (error48) {
|
|
250674
250827
|
if (hasErrorCode(error48, "ENOENT")) return false;
|
|
250675
250828
|
throw error48;
|
|
@@ -250684,7 +250837,7 @@ function removeDaemonStateIfOwnedUnlocked(dataDir, expected) {
|
|
|
250684
250837
|
return false;
|
|
250685
250838
|
}
|
|
250686
250839
|
try {
|
|
250687
|
-
|
|
250840
|
+
fs8.unlinkSync(statePath);
|
|
250688
250841
|
return true;
|
|
250689
250842
|
} catch (error48) {
|
|
250690
250843
|
if (hasErrorCode(error48, "ENOENT")) return false;
|
|
@@ -250794,26 +250947,26 @@ import path20 from "node:path";
|
|
|
250794
250947
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
250795
250948
|
import { promisify as promisify8 } from "node:util";
|
|
250796
250949
|
import childProcess from "node:child_process";
|
|
250797
|
-
import
|
|
250950
|
+
import fs13, { constants as fsConstants4 } from "node:fs/promises";
|
|
250798
250951
|
|
|
250799
250952
|
// ../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js
|
|
250800
250953
|
import process4 from "node:process";
|
|
250801
|
-
import
|
|
250954
|
+
import fs12, { constants as fsConstants3 } from "node:fs/promises";
|
|
250802
250955
|
|
|
250803
250956
|
// ../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
|
|
250804
250957
|
import process3 from "node:process";
|
|
250805
250958
|
import os from "node:os";
|
|
250806
|
-
import
|
|
250959
|
+
import fs11 from "node:fs";
|
|
250807
250960
|
|
|
250808
250961
|
// ../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
|
|
250809
|
-
import
|
|
250962
|
+
import fs10 from "node:fs";
|
|
250810
250963
|
|
|
250811
250964
|
// ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
250812
|
-
import
|
|
250965
|
+
import fs9 from "node:fs";
|
|
250813
250966
|
var isDockerCached;
|
|
250814
250967
|
function hasDockerEnv() {
|
|
250815
250968
|
try {
|
|
250816
|
-
|
|
250969
|
+
fs9.statSync("/.dockerenv");
|
|
250817
250970
|
return true;
|
|
250818
250971
|
} catch {
|
|
250819
250972
|
return false;
|
|
@@ -250821,7 +250974,7 @@ function hasDockerEnv() {
|
|
|
250821
250974
|
}
|
|
250822
250975
|
function hasDockerCGroup() {
|
|
250823
250976
|
try {
|
|
250824
|
-
return
|
|
250977
|
+
return fs9.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
250825
250978
|
} catch {
|
|
250826
250979
|
return false;
|
|
250827
250980
|
}
|
|
@@ -250837,7 +250990,7 @@ function isDocker() {
|
|
|
250837
250990
|
var cachedResult;
|
|
250838
250991
|
var hasContainerEnv = () => {
|
|
250839
250992
|
try {
|
|
250840
|
-
|
|
250993
|
+
fs10.statSync("/run/.containerenv");
|
|
250841
250994
|
return true;
|
|
250842
250995
|
} catch {
|
|
250843
250996
|
return false;
|
|
@@ -250862,7 +251015,7 @@ var isWsl = () => {
|
|
|
250862
251015
|
return true;
|
|
250863
251016
|
}
|
|
250864
251017
|
try {
|
|
250865
|
-
return
|
|
251018
|
+
return fs11.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
250866
251019
|
} catch {
|
|
250867
251020
|
return false;
|
|
250868
251021
|
}
|
|
@@ -250880,14 +251033,14 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
|
250880
251033
|
const configFilePath = "/etc/wsl.conf";
|
|
250881
251034
|
let isConfigFileExists = false;
|
|
250882
251035
|
try {
|
|
250883
|
-
await
|
|
251036
|
+
await fs12.access(configFilePath, fsConstants3.F_OK);
|
|
250884
251037
|
isConfigFileExists = true;
|
|
250885
251038
|
} catch {
|
|
250886
251039
|
}
|
|
250887
251040
|
if (!isConfigFileExists) {
|
|
250888
251041
|
return defaultMountPoint;
|
|
250889
251042
|
}
|
|
250890
|
-
const configContent = await
|
|
251043
|
+
const configContent = await fs12.readFile(configFilePath, { encoding: "utf8" });
|
|
250891
251044
|
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
250892
251045
|
if (!configMountPoint) {
|
|
250893
251046
|
return defaultMountPoint;
|
|
@@ -251192,7 +251345,7 @@ var baseOpen = async (options) => {
|
|
|
251192
251345
|
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
251193
251346
|
let exeLocalXdgOpen = false;
|
|
251194
251347
|
try {
|
|
251195
|
-
await
|
|
251348
|
+
await fs13.access(localXdgOpenPath, fsConstants4.X_OK);
|
|
251196
251349
|
exeLocalXdgOpen = true;
|
|
251197
251350
|
} catch {
|
|
251198
251351
|
}
|
|
@@ -251307,21 +251460,11 @@ function loadTLSOptions(flags) {
|
|
|
251307
251460
|
process.exit(1);
|
|
251308
251461
|
}
|
|
251309
251462
|
return {
|
|
251310
|
-
cert:
|
|
251311
|
-
key:
|
|
251312
|
-
...clientCAPath && { clientCA:
|
|
251463
|
+
cert: fs14.readFileSync(certPath),
|
|
251464
|
+
key: fs14.readFileSync(keyPath),
|
|
251465
|
+
...clientCAPath && { clientCA: fs14.readFileSync(clientCAPath) }
|
|
251313
251466
|
};
|
|
251314
251467
|
}
|
|
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
251468
|
var startCommand = buildCommand({
|
|
251326
251469
|
parameters: {
|
|
251327
251470
|
flags: {
|