@vibedeckx/darwin-arm64 0.1.26 → 0.1.28
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 +755 -446
- package/dist/ui/404/index.html +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/__next.__PAGE__.txt +2 -2
- package/dist/ui/__next._full.txt +6 -6
- package/dist/ui/__next._head.txt +1 -1
- package/dist/ui/__next._index.txt +5 -5
- package/dist/ui/__next._tree.txt +2 -2
- package/dist/ui/_next/static/chunks/{2ba1d2b55b82f4da.js → 0dc6cf26b91a20e8.js} +6 -6
- package/dist/ui/_next/static/chunks/206325729c6b437c.js +29 -0
- package/dist/ui/_next/static/chunks/373ecc09d993b339.css +1 -0
- package/dist/ui/_next/static/chunks/{122685bfad07ee14.js → 57495168178cb0c6.js} +4 -4
- package/dist/ui/_next/static/chunks/{020d675d21be28d4.js → 73d9cd102c21dc34.js} +1 -1
- package/dist/ui/_not-found/__next._full.txt +5 -5
- package/dist/ui/_not-found/__next._head.txt +1 -1
- package/dist/ui/_not-found/__next._index.txt +5 -5
- package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/ui/_not-found/__next._not-found.txt +1 -1
- package/dist/ui/_not-found/__next._tree.txt +2 -2
- package/dist/ui/_not-found/index.html +1 -1
- package/dist/ui/_not-found/index.txt +5 -5
- package/dist/ui/index.html +1 -1
- package/dist/ui/index.txt +6 -6
- package/package.json +1 -1
- package/dist/ui/_next/static/chunks/249ad99126262bb9.css +0 -1
- package/dist/ui/_next/static/chunks/aa03f5892ce4bb52.js +0 -29
- /package/dist/ui/_next/static/{USoNsdUhq-pOKomMw8G4t → c3XhyFJJbnxGICK0cg7UN}/_buildManifest.js +0 -0
- /package/dist/ui/_next/static/{USoNsdUhq-pOKomMw8G4t → c3XhyFJJbnxGICK0cg7UN}/_clientMiddlewareManifest.json +0 -0
- /package/dist/ui/_next/static/{USoNsdUhq-pOKomMw8G4t → c3XhyFJJbnxGICK0cg7UN}/_ssgManifest.js +0 -0
package/dist/bin.js
CHANGED
|
@@ -3740,8 +3740,8 @@ var require_req = __commonJS({
|
|
|
3740
3740
|
if (req.originalUrl) {
|
|
3741
3741
|
_req.url = req.originalUrl;
|
|
3742
3742
|
} else {
|
|
3743
|
-
const
|
|
3744
|
-
_req.url = typeof
|
|
3743
|
+
const path13 = req.path;
|
|
3744
|
+
_req.url = typeof path13 === "string" ? path13 : req.url ? req.url.path || req.url : void 0;
|
|
3745
3745
|
}
|
|
3746
3746
|
if (req.query) {
|
|
3747
3747
|
_req.query = req.query;
|
|
@@ -3906,14 +3906,14 @@ var require_redact = __commonJS({
|
|
|
3906
3906
|
}
|
|
3907
3907
|
return obj;
|
|
3908
3908
|
}
|
|
3909
|
-
function parsePath(
|
|
3909
|
+
function parsePath(path13) {
|
|
3910
3910
|
const parts = [];
|
|
3911
3911
|
let current = "";
|
|
3912
3912
|
let inBrackets = false;
|
|
3913
3913
|
let inQuotes = false;
|
|
3914
3914
|
let quoteChar = "";
|
|
3915
|
-
for (let i = 0; i <
|
|
3916
|
-
const char =
|
|
3915
|
+
for (let i = 0; i < path13.length; i++) {
|
|
3916
|
+
const char = path13[i];
|
|
3917
3917
|
if (!inBrackets && char === ".") {
|
|
3918
3918
|
if (current) {
|
|
3919
3919
|
parts.push(current);
|
|
@@ -4044,10 +4044,10 @@ var require_redact = __commonJS({
|
|
|
4044
4044
|
return current;
|
|
4045
4045
|
}
|
|
4046
4046
|
function redactPaths(obj, paths, censor, remove = false) {
|
|
4047
|
-
for (const
|
|
4048
|
-
const parts = parsePath(
|
|
4047
|
+
for (const path13 of paths) {
|
|
4048
|
+
const parts = parsePath(path13);
|
|
4049
4049
|
if (parts.includes("*")) {
|
|
4050
|
-
redactWildcardPath(obj, parts, censor,
|
|
4050
|
+
redactWildcardPath(obj, parts, censor, path13, remove);
|
|
4051
4051
|
} else {
|
|
4052
4052
|
if (remove) {
|
|
4053
4053
|
removeKey(obj, parts);
|
|
@@ -4132,8 +4132,8 @@ var require_redact = __commonJS({
|
|
|
4132
4132
|
}
|
|
4133
4133
|
} else {
|
|
4134
4134
|
if (afterWildcard.includes("*")) {
|
|
4135
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
4136
|
-
const fullPath = [...pathArray.slice(0, pathLength), ...
|
|
4135
|
+
const wrappedCensor = typeof censor === "function" ? (value, path13) => {
|
|
4136
|
+
const fullPath = [...pathArray.slice(0, pathLength), ...path13];
|
|
4137
4137
|
return censor(value, fullPath);
|
|
4138
4138
|
} : censor;
|
|
4139
4139
|
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
|
|
@@ -4168,8 +4168,8 @@ var require_redact = __commonJS({
|
|
|
4168
4168
|
return null;
|
|
4169
4169
|
}
|
|
4170
4170
|
const pathStructure = /* @__PURE__ */ new Map();
|
|
4171
|
-
for (const
|
|
4172
|
-
const parts = parsePath(
|
|
4171
|
+
for (const path13 of pathsToClone) {
|
|
4172
|
+
const parts = parsePath(path13);
|
|
4173
4173
|
let current = pathStructure;
|
|
4174
4174
|
for (let i = 0; i < parts.length; i++) {
|
|
4175
4175
|
const part = parts[i];
|
|
@@ -4221,24 +4221,24 @@ var require_redact = __commonJS({
|
|
|
4221
4221
|
}
|
|
4222
4222
|
return cloneSelectively(obj, pathStructure);
|
|
4223
4223
|
}
|
|
4224
|
-
function validatePath(
|
|
4225
|
-
if (typeof
|
|
4224
|
+
function validatePath(path13) {
|
|
4225
|
+
if (typeof path13 !== "string") {
|
|
4226
4226
|
throw new Error("Paths must be (non-empty) strings");
|
|
4227
4227
|
}
|
|
4228
|
-
if (
|
|
4228
|
+
if (path13 === "") {
|
|
4229
4229
|
throw new Error("Invalid redaction path ()");
|
|
4230
4230
|
}
|
|
4231
|
-
if (
|
|
4232
|
-
throw new Error(`Invalid redaction path (${
|
|
4231
|
+
if (path13.includes("..")) {
|
|
4232
|
+
throw new Error(`Invalid redaction path (${path13})`);
|
|
4233
4233
|
}
|
|
4234
|
-
if (
|
|
4235
|
-
throw new Error(`Invalid redaction path (${
|
|
4234
|
+
if (path13.includes(",")) {
|
|
4235
|
+
throw new Error(`Invalid redaction path (${path13})`);
|
|
4236
4236
|
}
|
|
4237
4237
|
let bracketCount = 0;
|
|
4238
4238
|
let inQuotes = false;
|
|
4239
4239
|
let quoteChar = "";
|
|
4240
|
-
for (let i = 0; i <
|
|
4241
|
-
const char =
|
|
4240
|
+
for (let i = 0; i < path13.length; i++) {
|
|
4241
|
+
const char = path13[i];
|
|
4242
4242
|
if ((char === '"' || char === "'") && bracketCount > 0) {
|
|
4243
4243
|
if (!inQuotes) {
|
|
4244
4244
|
inQuotes = true;
|
|
@@ -4252,20 +4252,20 @@ var require_redact = __commonJS({
|
|
|
4252
4252
|
} else if (char === "]" && !inQuotes) {
|
|
4253
4253
|
bracketCount--;
|
|
4254
4254
|
if (bracketCount < 0) {
|
|
4255
|
-
throw new Error(`Invalid redaction path (${
|
|
4255
|
+
throw new Error(`Invalid redaction path (${path13})`);
|
|
4256
4256
|
}
|
|
4257
4257
|
}
|
|
4258
4258
|
}
|
|
4259
4259
|
if (bracketCount !== 0) {
|
|
4260
|
-
throw new Error(`Invalid redaction path (${
|
|
4260
|
+
throw new Error(`Invalid redaction path (${path13})`);
|
|
4261
4261
|
}
|
|
4262
4262
|
}
|
|
4263
4263
|
function validatePaths(paths) {
|
|
4264
4264
|
if (!Array.isArray(paths)) {
|
|
4265
4265
|
throw new TypeError("paths must be an array");
|
|
4266
4266
|
}
|
|
4267
|
-
for (const
|
|
4268
|
-
validatePath(
|
|
4267
|
+
for (const path13 of paths) {
|
|
4268
|
+
validatePath(path13);
|
|
4269
4269
|
}
|
|
4270
4270
|
}
|
|
4271
4271
|
function slowRedact(options = {}) {
|
|
@@ -4433,8 +4433,8 @@ var require_redaction = __commonJS({
|
|
|
4433
4433
|
if (shape[k] === null) {
|
|
4434
4434
|
o[k] = (value) => topCensor(value, [k]);
|
|
4435
4435
|
} else {
|
|
4436
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
4437
|
-
return censor(value, [k, ...
|
|
4436
|
+
const wrappedCensor = typeof censor === "function" ? (value, path13) => {
|
|
4437
|
+
return censor(value, [k, ...path13]);
|
|
4438
4438
|
} : censor;
|
|
4439
4439
|
o[k] = Redact({
|
|
4440
4440
|
paths: shape[k],
|
|
@@ -4655,7 +4655,7 @@ var require_sonic_boom = __commonJS({
|
|
|
4655
4655
|
var fs7 = __require("fs");
|
|
4656
4656
|
var EventEmitter3 = __require("events");
|
|
4657
4657
|
var inherits = __require("util").inherits;
|
|
4658
|
-
var
|
|
4658
|
+
var path13 = __require("path");
|
|
4659
4659
|
var sleep2 = require_atomic_sleep();
|
|
4660
4660
|
var assert2 = __require("assert");
|
|
4661
4661
|
var BUSY_WRITE_TIMEOUT = 100;
|
|
@@ -4709,7 +4709,7 @@ var require_sonic_boom = __commonJS({
|
|
|
4709
4709
|
const mode = sonic.mode;
|
|
4710
4710
|
if (sonic.sync) {
|
|
4711
4711
|
try {
|
|
4712
|
-
if (sonic.mkdir) fs7.mkdirSync(
|
|
4712
|
+
if (sonic.mkdir) fs7.mkdirSync(path13.dirname(file2), { recursive: true });
|
|
4713
4713
|
const fd = fs7.openSync(file2, flags, mode);
|
|
4714
4714
|
fileOpened(null, fd);
|
|
4715
4715
|
} catch (err) {
|
|
@@ -4717,7 +4717,7 @@ var require_sonic_boom = __commonJS({
|
|
|
4717
4717
|
throw err;
|
|
4718
4718
|
}
|
|
4719
4719
|
} else if (sonic.mkdir) {
|
|
4720
|
-
fs7.mkdir(
|
|
4720
|
+
fs7.mkdir(path13.dirname(file2), { recursive: true }, (err) => {
|
|
4721
4721
|
if (err) return fileOpened(err);
|
|
4722
4722
|
fs7.open(file2, flags, mode, fileOpened);
|
|
4723
4723
|
});
|
|
@@ -4729,7 +4729,7 @@ var require_sonic_boom = __commonJS({
|
|
|
4729
4729
|
if (!(this instanceof SonicBoom)) {
|
|
4730
4730
|
return new SonicBoom(opts);
|
|
4731
4731
|
}
|
|
4732
|
-
let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir:
|
|
4732
|
+
let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir: mkdir4, retryEAGAIN, fsync, contentMode, mode } = opts || {};
|
|
4733
4733
|
fd = fd || dest;
|
|
4734
4734
|
this._len = 0;
|
|
4735
4735
|
this.fd = -1;
|
|
@@ -4754,7 +4754,7 @@ var require_sonic_boom = __commonJS({
|
|
|
4754
4754
|
this.append = append || false;
|
|
4755
4755
|
this.mode = mode;
|
|
4756
4756
|
this.retryEAGAIN = retryEAGAIN || (() => true);
|
|
4757
|
-
this.mkdir =
|
|
4757
|
+
this.mkdir = mkdir4 || false;
|
|
4758
4758
|
let fsWriteSync;
|
|
4759
4759
|
let fsWrite;
|
|
4760
4760
|
if (contentMode === kContentModeBuffer) {
|
|
@@ -15279,8 +15279,8 @@ var require_utils = __commonJS({
|
|
|
15279
15279
|
}
|
|
15280
15280
|
return ind;
|
|
15281
15281
|
}
|
|
15282
|
-
function removeDotSegments(
|
|
15283
|
-
let input =
|
|
15282
|
+
function removeDotSegments(path13) {
|
|
15283
|
+
let input = path13;
|
|
15284
15284
|
const output = [];
|
|
15285
15285
|
let nextSlash = -1;
|
|
15286
15286
|
let len = 0;
|
|
@@ -15479,8 +15479,8 @@ var require_schemes = __commonJS({
|
|
|
15479
15479
|
wsComponent.secure = void 0;
|
|
15480
15480
|
}
|
|
15481
15481
|
if (wsComponent.resourceName) {
|
|
15482
|
-
const [
|
|
15483
|
-
wsComponent.path =
|
|
15482
|
+
const [path13, query] = wsComponent.resourceName.split("?");
|
|
15483
|
+
wsComponent.path = path13 && path13 !== "/" ? path13 : void 0;
|
|
15484
15484
|
wsComponent.query = query;
|
|
15485
15485
|
wsComponent.resourceName = void 0;
|
|
15486
15486
|
}
|
|
@@ -28051,40 +28051,40 @@ var require_node = __commonJS({
|
|
|
28051
28051
|
super();
|
|
28052
28052
|
this.staticChildren = {};
|
|
28053
28053
|
}
|
|
28054
|
-
findStaticMatchingChild(
|
|
28055
|
-
const staticChild = this.staticChildren[
|
|
28056
|
-
if (staticChild === void 0 || !staticChild.matchPrefix(
|
|
28054
|
+
findStaticMatchingChild(path13, pathIndex) {
|
|
28055
|
+
const staticChild = this.staticChildren[path13.charAt(pathIndex)];
|
|
28056
|
+
if (staticChild === void 0 || !staticChild.matchPrefix(path13, pathIndex)) {
|
|
28057
28057
|
return null;
|
|
28058
28058
|
}
|
|
28059
28059
|
return staticChild;
|
|
28060
28060
|
}
|
|
28061
|
-
getStaticChild(
|
|
28062
|
-
if (
|
|
28061
|
+
getStaticChild(path13, pathIndex = 0) {
|
|
28062
|
+
if (path13.length === pathIndex) {
|
|
28063
28063
|
return this;
|
|
28064
28064
|
}
|
|
28065
|
-
const staticChild = this.findStaticMatchingChild(
|
|
28065
|
+
const staticChild = this.findStaticMatchingChild(path13, pathIndex);
|
|
28066
28066
|
if (staticChild) {
|
|
28067
|
-
return staticChild.getStaticChild(
|
|
28067
|
+
return staticChild.getStaticChild(path13, pathIndex + staticChild.prefix.length);
|
|
28068
28068
|
}
|
|
28069
28069
|
return null;
|
|
28070
28070
|
}
|
|
28071
|
-
createStaticChild(
|
|
28072
|
-
if (
|
|
28071
|
+
createStaticChild(path13) {
|
|
28072
|
+
if (path13.length === 0) {
|
|
28073
28073
|
return this;
|
|
28074
28074
|
}
|
|
28075
|
-
let staticChild = this.staticChildren[
|
|
28075
|
+
let staticChild = this.staticChildren[path13.charAt(0)];
|
|
28076
28076
|
if (staticChild) {
|
|
28077
28077
|
let i = 1;
|
|
28078
28078
|
for (; i < staticChild.prefix.length; i++) {
|
|
28079
|
-
if (
|
|
28079
|
+
if (path13.charCodeAt(i) !== staticChild.prefix.charCodeAt(i)) {
|
|
28080
28080
|
staticChild = staticChild.split(this, i);
|
|
28081
28081
|
break;
|
|
28082
28082
|
}
|
|
28083
28083
|
}
|
|
28084
|
-
return staticChild.createStaticChild(
|
|
28084
|
+
return staticChild.createStaticChild(path13.slice(i));
|
|
28085
28085
|
}
|
|
28086
|
-
const label =
|
|
28087
|
-
this.staticChildren[label] = new StaticNode(
|
|
28086
|
+
const label = path13.charAt(0);
|
|
28087
|
+
this.staticChildren[label] = new StaticNode(path13);
|
|
28088
28088
|
return this.staticChildren[label];
|
|
28089
28089
|
}
|
|
28090
28090
|
};
|
|
@@ -28144,8 +28144,8 @@ var require_node = __commonJS({
|
|
|
28144
28144
|
parentNode.staticChildren[parentPrefix.charAt(0)] = staticNode;
|
|
28145
28145
|
return staticNode;
|
|
28146
28146
|
}
|
|
28147
|
-
getNextNode(
|
|
28148
|
-
let node = this.findStaticMatchingChild(
|
|
28147
|
+
getNextNode(path13, pathIndex, nodeStack, paramsCount) {
|
|
28148
|
+
let node = this.findStaticMatchingChild(path13, pathIndex);
|
|
28149
28149
|
let parametricBrotherNodeIndex = 0;
|
|
28150
28150
|
if (node === null) {
|
|
28151
28151
|
if (this.parametricChildren.length === 0) {
|
|
@@ -28192,8 +28192,8 @@ var require_node = __commonJS({
|
|
|
28192
28192
|
this.kind = NODE_TYPES.PARAMETRIC;
|
|
28193
28193
|
this.nodePaths = /* @__PURE__ */ new Set([nodePath]);
|
|
28194
28194
|
}
|
|
28195
|
-
getNextNode(
|
|
28196
|
-
return this.findStaticMatchingChild(
|
|
28195
|
+
getNextNode(path13, pathIndex) {
|
|
28196
|
+
return this.findStaticMatchingChild(path13, pathIndex);
|
|
28197
28197
|
}
|
|
28198
28198
|
};
|
|
28199
28199
|
var WildcardNode = class extends Node {
|
|
@@ -28529,33 +28529,33 @@ var require_url_sanitizer = __commonJS({
|
|
|
28529
28529
|
}
|
|
28530
28530
|
return null;
|
|
28531
28531
|
}
|
|
28532
|
-
function safeDecodeURI(
|
|
28532
|
+
function safeDecodeURI(path13, useSemicolonDelimiter) {
|
|
28533
28533
|
let shouldDecode = false;
|
|
28534
28534
|
let shouldDecodeParam = false;
|
|
28535
28535
|
let querystring = "";
|
|
28536
|
-
for (let i = 1; i <
|
|
28537
|
-
const charCode =
|
|
28536
|
+
for (let i = 1; i < path13.length; i++) {
|
|
28537
|
+
const charCode = path13.charCodeAt(i);
|
|
28538
28538
|
if (charCode === 37) {
|
|
28539
|
-
const highCharCode =
|
|
28540
|
-
const lowCharCode =
|
|
28539
|
+
const highCharCode = path13.charCodeAt(i + 1);
|
|
28540
|
+
const lowCharCode = path13.charCodeAt(i + 2);
|
|
28541
28541
|
if (decodeComponentChar(highCharCode, lowCharCode) === null) {
|
|
28542
28542
|
shouldDecode = true;
|
|
28543
28543
|
} else {
|
|
28544
28544
|
shouldDecodeParam = true;
|
|
28545
28545
|
if (highCharCode === 50 && lowCharCode === 53) {
|
|
28546
28546
|
shouldDecode = true;
|
|
28547
|
-
|
|
28547
|
+
path13 = path13.slice(0, i + 1) + "25" + path13.slice(i + 1);
|
|
28548
28548
|
i += 2;
|
|
28549
28549
|
}
|
|
28550
28550
|
i += 2;
|
|
28551
28551
|
}
|
|
28552
28552
|
} else if (charCode === 63 || charCode === 35 || charCode === 59 && useSemicolonDelimiter) {
|
|
28553
|
-
querystring =
|
|
28554
|
-
|
|
28553
|
+
querystring = path13.slice(i + 1);
|
|
28554
|
+
path13 = path13.slice(0, i);
|
|
28555
28555
|
break;
|
|
28556
28556
|
}
|
|
28557
28557
|
}
|
|
28558
|
-
const decodedPath = shouldDecode ? decodeURI(
|
|
28558
|
+
const decodedPath = shouldDecode ? decodeURI(path13) : path13;
|
|
28559
28559
|
return { path: decodedPath, querystring, shouldDecodeParam };
|
|
28560
28560
|
}
|
|
28561
28561
|
function safeDecodeURIComponent(uriComponent) {
|
|
@@ -28648,7 +28648,7 @@ var require_find_my_way = __commonJS({
|
|
|
28648
28648
|
this.routes = [];
|
|
28649
28649
|
this.trees = {};
|
|
28650
28650
|
}
|
|
28651
|
-
Router.prototype.on = function on(method,
|
|
28651
|
+
Router.prototype.on = function on(method, path13, opts, handler, store) {
|
|
28652
28652
|
if (typeof opts === "function") {
|
|
28653
28653
|
if (handler !== void 0) {
|
|
28654
28654
|
store = handler;
|
|
@@ -28656,34 +28656,34 @@ var require_find_my_way = __commonJS({
|
|
|
28656
28656
|
handler = opts;
|
|
28657
28657
|
opts = {};
|
|
28658
28658
|
}
|
|
28659
|
-
assert2(typeof
|
|
28660
|
-
assert2(
|
|
28661
|
-
assert2(
|
|
28659
|
+
assert2(typeof path13 === "string", "Path should be a string");
|
|
28660
|
+
assert2(path13.length > 0, "The path could not be empty");
|
|
28661
|
+
assert2(path13[0] === "/" || path13[0] === "*", "The first character of a path should be `/` or `*`");
|
|
28662
28662
|
assert2(typeof handler === "function", "Handler should be a function");
|
|
28663
|
-
const optionalParamMatch =
|
|
28663
|
+
const optionalParamMatch = path13.match(OPTIONAL_PARAM_REGEXP);
|
|
28664
28664
|
if (optionalParamMatch) {
|
|
28665
|
-
assert2(
|
|
28666
|
-
const pathFull =
|
|
28667
|
-
const pathOptional =
|
|
28665
|
+
assert2(path13.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
|
|
28666
|
+
const pathFull = path13.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
|
|
28667
|
+
const pathOptional = path13.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/";
|
|
28668
28668
|
this.on(method, pathFull, opts, handler, store);
|
|
28669
28669
|
this.on(method, pathOptional, opts, handler, store);
|
|
28670
28670
|
return;
|
|
28671
28671
|
}
|
|
28672
|
-
const route =
|
|
28672
|
+
const route = path13;
|
|
28673
28673
|
if (this.ignoreDuplicateSlashes) {
|
|
28674
|
-
|
|
28674
|
+
path13 = removeDuplicateSlashes(path13);
|
|
28675
28675
|
}
|
|
28676
28676
|
if (this.ignoreTrailingSlash) {
|
|
28677
|
-
|
|
28677
|
+
path13 = trimLastSlash(path13);
|
|
28678
28678
|
}
|
|
28679
28679
|
const methods = Array.isArray(method) ? method : [method];
|
|
28680
28680
|
for (const method2 of methods) {
|
|
28681
28681
|
assert2(typeof method2 === "string", "Method should be a string");
|
|
28682
28682
|
assert2(httpMethods.includes(method2), `Method '${method2}' is not an http method.`);
|
|
28683
|
-
this._on(method2,
|
|
28683
|
+
this._on(method2, path13, opts, handler, store, route);
|
|
28684
28684
|
}
|
|
28685
28685
|
};
|
|
28686
|
-
Router.prototype._on = function _on(method,
|
|
28686
|
+
Router.prototype._on = function _on(method, path13, opts, handler, store) {
|
|
28687
28687
|
let constraints = {};
|
|
28688
28688
|
if (opts.constraints !== void 0) {
|
|
28689
28689
|
assert2(typeof opts.constraints === "object" && opts.constraints !== null, "Constraints should be an object");
|
|
@@ -28696,7 +28696,7 @@ var require_find_my_way = __commonJS({
|
|
|
28696
28696
|
if (this.trees[method] === void 0) {
|
|
28697
28697
|
this.trees[method] = new StaticNode("/");
|
|
28698
28698
|
}
|
|
28699
|
-
let pattern =
|
|
28699
|
+
let pattern = path13;
|
|
28700
28700
|
if (pattern === "*" && this.trees[method].prefix.length !== 0) {
|
|
28701
28701
|
const currentRoot = this.trees[method];
|
|
28702
28702
|
this.trees[method] = new StaticNode("");
|
|
@@ -28799,19 +28799,19 @@ var require_find_my_way = __commonJS({
|
|
|
28799
28799
|
throw new Error(`Method '${method}' already declared for route '${pattern}' with constraints '${JSON.stringify(constraints)}'`);
|
|
28800
28800
|
}
|
|
28801
28801
|
}
|
|
28802
|
-
const route = { method, path:
|
|
28802
|
+
const route = { method, path: path13, pattern, params, opts, handler, store };
|
|
28803
28803
|
this.routes.push(route);
|
|
28804
28804
|
currentNode.addRoute(route, this.constrainer);
|
|
28805
28805
|
};
|
|
28806
|
-
Router.prototype.hasRoute = function hasRoute(method,
|
|
28807
|
-
const route = this.findRoute(method,
|
|
28806
|
+
Router.prototype.hasRoute = function hasRoute(method, path13, constraints) {
|
|
28807
|
+
const route = this.findRoute(method, path13, constraints);
|
|
28808
28808
|
return route !== null;
|
|
28809
28809
|
};
|
|
28810
|
-
Router.prototype.findRoute = function findNode(method,
|
|
28810
|
+
Router.prototype.findRoute = function findNode(method, path13, constraints = {}) {
|
|
28811
28811
|
if (this.trees[method] === void 0) {
|
|
28812
28812
|
return null;
|
|
28813
28813
|
}
|
|
28814
|
-
let pattern =
|
|
28814
|
+
let pattern = path13;
|
|
28815
28815
|
let currentNode = this.trees[method];
|
|
28816
28816
|
let parentNodePathIndex = currentNode.prefix.length;
|
|
28817
28817
|
const params = [];
|
|
@@ -28929,39 +28929,39 @@ var require_find_my_way = __commonJS({
|
|
|
28929
28929
|
this.trees = {};
|
|
28930
28930
|
this.routes = [];
|
|
28931
28931
|
};
|
|
28932
|
-
Router.prototype.off = function off(method,
|
|
28933
|
-
assert2(typeof
|
|
28934
|
-
assert2(
|
|
28935
|
-
assert2(
|
|
28932
|
+
Router.prototype.off = function off(method, path13, constraints) {
|
|
28933
|
+
assert2(typeof path13 === "string", "Path should be a string");
|
|
28934
|
+
assert2(path13.length > 0, "The path could not be empty");
|
|
28935
|
+
assert2(path13[0] === "/" || path13[0] === "*", "The first character of a path should be `/` or `*`");
|
|
28936
28936
|
assert2(
|
|
28937
28937
|
typeof constraints === "undefined" || typeof constraints === "object" && !Array.isArray(constraints) && constraints !== null,
|
|
28938
28938
|
"Constraints should be an object or undefined."
|
|
28939
28939
|
);
|
|
28940
|
-
const optionalParamMatch =
|
|
28940
|
+
const optionalParamMatch = path13.match(OPTIONAL_PARAM_REGEXP);
|
|
28941
28941
|
if (optionalParamMatch) {
|
|
28942
|
-
assert2(
|
|
28943
|
-
const pathFull =
|
|
28944
|
-
const pathOptional =
|
|
28942
|
+
assert2(path13.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
|
|
28943
|
+
const pathFull = path13.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
|
|
28944
|
+
const pathOptional = path13.replace(OPTIONAL_PARAM_REGEXP, "$2");
|
|
28945
28945
|
this.off(method, pathFull, constraints);
|
|
28946
28946
|
this.off(method, pathOptional, constraints);
|
|
28947
28947
|
return;
|
|
28948
28948
|
}
|
|
28949
28949
|
if (this.ignoreDuplicateSlashes) {
|
|
28950
|
-
|
|
28950
|
+
path13 = removeDuplicateSlashes(path13);
|
|
28951
28951
|
}
|
|
28952
28952
|
if (this.ignoreTrailingSlash) {
|
|
28953
|
-
|
|
28953
|
+
path13 = trimLastSlash(path13);
|
|
28954
28954
|
}
|
|
28955
28955
|
const methods = Array.isArray(method) ? method : [method];
|
|
28956
28956
|
for (const method2 of methods) {
|
|
28957
|
-
this._off(method2,
|
|
28957
|
+
this._off(method2, path13, constraints);
|
|
28958
28958
|
}
|
|
28959
28959
|
};
|
|
28960
|
-
Router.prototype._off = function _off(method,
|
|
28960
|
+
Router.prototype._off = function _off(method, path13, constraints) {
|
|
28961
28961
|
assert2(typeof method === "string", "Method should be a string");
|
|
28962
28962
|
assert2(httpMethods.includes(method), `Method '${method}' is not an http method.`);
|
|
28963
28963
|
function matcherWithoutConstraints(route) {
|
|
28964
|
-
return method !== route.method ||
|
|
28964
|
+
return method !== route.method || path13 !== route.path;
|
|
28965
28965
|
}
|
|
28966
28966
|
function matcherWithConstraints(route) {
|
|
28967
28967
|
return matcherWithoutConstraints(route) || !deepEqual(constraints, route.opts.constraints || {});
|
|
@@ -28998,37 +28998,37 @@ var require_find_my_way = __commonJS({
|
|
|
28998
28998
|
if (handle === null) return this._defaultRoute(req, res, ctx);
|
|
28999
28999
|
return ctx === void 0 ? handle.handler(req, res, handle.params, handle.store, handle.searchParams) : handle.handler.call(ctx, req, res, handle.params, handle.store, handle.searchParams);
|
|
29000
29000
|
};
|
|
29001
|
-
Router.prototype.find = function find(method,
|
|
29001
|
+
Router.prototype.find = function find(method, path13, derivedConstraints) {
|
|
29002
29002
|
let currentNode = this.trees[method];
|
|
29003
29003
|
if (currentNode === void 0) return null;
|
|
29004
|
-
if (
|
|
29005
|
-
|
|
29004
|
+
if (path13.charCodeAt(0) !== 47) {
|
|
29005
|
+
path13 = path13.replace(FULL_PATH_REGEXP, "/");
|
|
29006
29006
|
}
|
|
29007
29007
|
if (this.ignoreDuplicateSlashes) {
|
|
29008
|
-
|
|
29008
|
+
path13 = removeDuplicateSlashes(path13);
|
|
29009
29009
|
}
|
|
29010
29010
|
let sanitizedUrl;
|
|
29011
29011
|
let querystring2;
|
|
29012
29012
|
let shouldDecodeParam;
|
|
29013
29013
|
try {
|
|
29014
|
-
sanitizedUrl = safeDecodeURI(
|
|
29015
|
-
|
|
29014
|
+
sanitizedUrl = safeDecodeURI(path13, this.useSemicolonDelimiter);
|
|
29015
|
+
path13 = sanitizedUrl.path;
|
|
29016
29016
|
querystring2 = sanitizedUrl.querystring;
|
|
29017
29017
|
shouldDecodeParam = sanitizedUrl.shouldDecodeParam;
|
|
29018
29018
|
} catch (error48) {
|
|
29019
|
-
return this._onBadUrl(
|
|
29019
|
+
return this._onBadUrl(path13);
|
|
29020
29020
|
}
|
|
29021
29021
|
if (this.ignoreTrailingSlash) {
|
|
29022
|
-
|
|
29022
|
+
path13 = trimLastSlash(path13);
|
|
29023
29023
|
}
|
|
29024
|
-
const originPath =
|
|
29024
|
+
const originPath = path13;
|
|
29025
29025
|
if (this.caseSensitive === false) {
|
|
29026
|
-
|
|
29026
|
+
path13 = path13.toLowerCase();
|
|
29027
29027
|
}
|
|
29028
29028
|
const maxParamLength = this.maxParamLength;
|
|
29029
29029
|
let pathIndex = currentNode.prefix.length;
|
|
29030
29030
|
const params = [];
|
|
29031
|
-
const pathLen =
|
|
29031
|
+
const pathLen = path13.length;
|
|
29032
29032
|
const brothersNodesStack = [];
|
|
29033
29033
|
while (true) {
|
|
29034
29034
|
if (pathIndex === pathLen && currentNode.isLeafNode) {
|
|
@@ -29042,7 +29042,7 @@ var require_find_my_way = __commonJS({
|
|
|
29042
29042
|
};
|
|
29043
29043
|
}
|
|
29044
29044
|
}
|
|
29045
|
-
let node = currentNode.getNextNode(
|
|
29045
|
+
let node = currentNode.getNextNode(path13, pathIndex, brothersNodesStack, params.length);
|
|
29046
29046
|
if (node === null) {
|
|
29047
29047
|
if (brothersNodesStack.length === 0) {
|
|
29048
29048
|
return null;
|
|
@@ -29096,8 +29096,8 @@ var require_find_my_way = __commonJS({
|
|
|
29096
29096
|
Router.prototype._rebuild = function(routes25) {
|
|
29097
29097
|
this.reset();
|
|
29098
29098
|
for (const route of routes25) {
|
|
29099
|
-
const { method, path:
|
|
29100
|
-
this._on(method,
|
|
29099
|
+
const { method, path: path13, opts, handler, store } = route;
|
|
29100
|
+
this._on(method, path13, opts, handler, store);
|
|
29101
29101
|
}
|
|
29102
29102
|
};
|
|
29103
29103
|
Router.prototype._defaultRoute = function(req, res, ctx) {
|
|
@@ -29108,13 +29108,13 @@ var require_find_my_way = __commonJS({
|
|
|
29108
29108
|
res.end();
|
|
29109
29109
|
}
|
|
29110
29110
|
};
|
|
29111
|
-
Router.prototype._onBadUrl = function(
|
|
29111
|
+
Router.prototype._onBadUrl = function(path13) {
|
|
29112
29112
|
if (this.onBadUrl === null) {
|
|
29113
29113
|
return null;
|
|
29114
29114
|
}
|
|
29115
29115
|
const onBadUrl = this.onBadUrl;
|
|
29116
29116
|
return {
|
|
29117
|
-
handler: (req, res, ctx) => onBadUrl(
|
|
29117
|
+
handler: (req, res, ctx) => onBadUrl(path13, req, res),
|
|
29118
29118
|
params: {},
|
|
29119
29119
|
store: null
|
|
29120
29120
|
};
|
|
@@ -29146,12 +29146,12 @@ var require_find_my_way = __commonJS({
|
|
|
29146
29146
|
if (!httpMethods.hasOwnProperty(i)) continue;
|
|
29147
29147
|
const m = httpMethods[i];
|
|
29148
29148
|
const methodName = m.toLowerCase();
|
|
29149
|
-
Router.prototype[methodName] = function(
|
|
29150
|
-
return this.on(m,
|
|
29149
|
+
Router.prototype[methodName] = function(path13, handler, store) {
|
|
29150
|
+
return this.on(m, path13, handler, store);
|
|
29151
29151
|
};
|
|
29152
29152
|
}
|
|
29153
|
-
Router.prototype.all = function(
|
|
29154
|
-
this.on(httpMethods,
|
|
29153
|
+
Router.prototype.all = function(path13, handler, store) {
|
|
29154
|
+
this.on(httpMethods, path13, handler, store);
|
|
29155
29155
|
};
|
|
29156
29156
|
Router.sanitizeUrlPath = function sanitizeUrlPath(url2, useSemicolonDelimiter) {
|
|
29157
29157
|
const decoded = safeDecodeURI(url2, useSemicolonDelimiter);
|
|
@@ -29164,14 +29164,14 @@ var require_find_my_way = __commonJS({
|
|
|
29164
29164
|
function escapeRegExp(string4) {
|
|
29165
29165
|
return string4.replace(ESCAPE_REGEXP, "\\$&");
|
|
29166
29166
|
}
|
|
29167
|
-
function removeDuplicateSlashes(
|
|
29168
|
-
return
|
|
29167
|
+
function removeDuplicateSlashes(path13) {
|
|
29168
|
+
return path13.indexOf("//") !== -1 ? path13.replace(REMOVE_DUPLICATE_SLASHES_REGEXP, "/") : path13;
|
|
29169
29169
|
}
|
|
29170
|
-
function trimLastSlash(
|
|
29171
|
-
if (
|
|
29172
|
-
return
|
|
29170
|
+
function trimLastSlash(path13) {
|
|
29171
|
+
if (path13.length > 1 && path13.charCodeAt(path13.length - 1) === 47) {
|
|
29172
|
+
return path13.slice(0, -1);
|
|
29173
29173
|
}
|
|
29174
|
-
return
|
|
29174
|
+
return path13;
|
|
29175
29175
|
}
|
|
29176
29176
|
function trimRegExpStartAndEnd(regexString) {
|
|
29177
29177
|
if (regexString.charCodeAt(1) === 94) {
|
|
@@ -29182,22 +29182,22 @@ var require_find_my_way = __commonJS({
|
|
|
29182
29182
|
}
|
|
29183
29183
|
return regexString;
|
|
29184
29184
|
}
|
|
29185
|
-
function getClosingParenthensePosition(
|
|
29185
|
+
function getClosingParenthensePosition(path13, idx) {
|
|
29186
29186
|
let parentheses = 1;
|
|
29187
|
-
while (idx <
|
|
29187
|
+
while (idx < path13.length) {
|
|
29188
29188
|
idx++;
|
|
29189
|
-
if (
|
|
29189
|
+
if (path13.charCodeAt(idx) === 92) {
|
|
29190
29190
|
idx++;
|
|
29191
29191
|
continue;
|
|
29192
29192
|
}
|
|
29193
|
-
if (
|
|
29193
|
+
if (path13.charCodeAt(idx) === 41) {
|
|
29194
29194
|
parentheses--;
|
|
29195
|
-
} else if (
|
|
29195
|
+
} else if (path13.charCodeAt(idx) === 40) {
|
|
29196
29196
|
parentheses++;
|
|
29197
29197
|
}
|
|
29198
29198
|
if (!parentheses) return idx;
|
|
29199
29199
|
}
|
|
29200
|
-
throw new TypeError('Invalid regexp expression in "' +
|
|
29200
|
+
throw new TypeError('Invalid regexp expression in "' + path13 + '"');
|
|
29201
29201
|
}
|
|
29202
29202
|
function defaultBuildPrettyMeta(route) {
|
|
29203
29203
|
if (!route) return {};
|
|
@@ -29429,12 +29429,12 @@ var require_route = __commonJS({
|
|
|
29429
29429
|
function route({ options: options2, isFastify }) {
|
|
29430
29430
|
throwIfAlreadyStarted("Cannot add route!");
|
|
29431
29431
|
const opts = { ...options2 };
|
|
29432
|
-
const
|
|
29432
|
+
const path13 = opts.url || opts.path || "";
|
|
29433
29433
|
if (!opts.handler) {
|
|
29434
|
-
throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method,
|
|
29434
|
+
throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method, path13);
|
|
29435
29435
|
}
|
|
29436
29436
|
if (opts.errorHandler !== void 0 && typeof opts.errorHandler !== "function") {
|
|
29437
|
-
throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method,
|
|
29437
|
+
throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method, path13);
|
|
29438
29438
|
}
|
|
29439
29439
|
validateBodyLimitOption(opts.bodyLimit);
|
|
29440
29440
|
const shouldExposeHead = opts.exposeHeadRoute ?? globalExposeHeadRoutes;
|
|
@@ -29443,22 +29443,22 @@ var require_route = __commonJS({
|
|
|
29443
29443
|
if (Array.isArray(opts.method)) {
|
|
29444
29444
|
for (let i = 0; i < opts.method.length; ++i) {
|
|
29445
29445
|
opts.method[i] = normalizeAndValidateMethod.call(this, opts.method[i]);
|
|
29446
|
-
validateSchemaBodyOption.call(this, opts.method[i],
|
|
29446
|
+
validateSchemaBodyOption.call(this, opts.method[i], path13, opts.schema);
|
|
29447
29447
|
isGetRoute = opts.method.includes("GET");
|
|
29448
29448
|
isHeadRoute = opts.method.includes("HEAD");
|
|
29449
29449
|
}
|
|
29450
29450
|
} else {
|
|
29451
29451
|
opts.method = normalizeAndValidateMethod.call(this, opts.method);
|
|
29452
|
-
validateSchemaBodyOption.call(this, opts.method,
|
|
29452
|
+
validateSchemaBodyOption.call(this, opts.method, path13, opts.schema);
|
|
29453
29453
|
isGetRoute = opts.method === "GET";
|
|
29454
29454
|
isHeadRoute = opts.method === "HEAD";
|
|
29455
29455
|
}
|
|
29456
29456
|
const headOpts = shouldExposeHead && isGetRoute ? { ...options2 } : null;
|
|
29457
29457
|
const prefix = this[kRoutePrefix];
|
|
29458
|
-
if (
|
|
29458
|
+
if (path13 === "/" && prefix.length > 0 && opts.method !== "HEAD") {
|
|
29459
29459
|
switch (opts.prefixTrailingSlash) {
|
|
29460
29460
|
case "slash":
|
|
29461
|
-
addNewRoute.call(this, { path:
|
|
29461
|
+
addNewRoute.call(this, { path: path13, isFastify });
|
|
29462
29462
|
break;
|
|
29463
29463
|
case "no-slash":
|
|
29464
29464
|
addNewRoute.call(this, { path: "", isFastify });
|
|
@@ -29467,20 +29467,20 @@ var require_route = __commonJS({
|
|
|
29467
29467
|
default:
|
|
29468
29468
|
addNewRoute.call(this, { path: "", isFastify });
|
|
29469
29469
|
if (ignoreTrailingSlash !== true && (ignoreDuplicateSlashes !== true || !prefix.endsWith("/"))) {
|
|
29470
|
-
addNewRoute.call(this, { path:
|
|
29470
|
+
addNewRoute.call(this, { path: path13, prefixing: true, isFastify });
|
|
29471
29471
|
}
|
|
29472
29472
|
}
|
|
29473
|
-
} else if (
|
|
29474
|
-
addNewRoute.call(this, { path:
|
|
29473
|
+
} else if (path13[0] === "/" && prefix.endsWith("/")) {
|
|
29474
|
+
addNewRoute.call(this, { path: path13.slice(1), isFastify });
|
|
29475
29475
|
} else {
|
|
29476
|
-
addNewRoute.call(this, { path:
|
|
29476
|
+
addNewRoute.call(this, { path: path13, isFastify });
|
|
29477
29477
|
}
|
|
29478
29478
|
return this;
|
|
29479
|
-
function addNewRoute({ path:
|
|
29480
|
-
const url2 = prefix +
|
|
29479
|
+
function addNewRoute({ path: path14, prefixing = false, isFastify: isFastify2 = false }) {
|
|
29480
|
+
const url2 = prefix + path14;
|
|
29481
29481
|
opts.url = url2;
|
|
29482
29482
|
opts.path = url2;
|
|
29483
|
-
opts.routePath =
|
|
29483
|
+
opts.routePath = path14;
|
|
29484
29484
|
opts.prefix = prefix;
|
|
29485
29485
|
opts.logLevel = opts.logLevel || this[kLogLevel];
|
|
29486
29486
|
if (this[kLogSerializers] || opts.logSerializers) {
|
|
@@ -29609,7 +29609,7 @@ var require_route = __commonJS({
|
|
|
29609
29609
|
});
|
|
29610
29610
|
if (shouldExposeHead && isGetRoute && !isHeadRoute && !hasHEADHandler) {
|
|
29611
29611
|
const onSendHandlers = parseHeadOnSendHandlers(headOpts.onSend);
|
|
29612
|
-
prepareRoute.call(this, { method: "HEAD", url:
|
|
29612
|
+
prepareRoute.call(this, { method: "HEAD", url: path14, options: { ...headOpts, onSend: onSendHandlers }, isFastify: true });
|
|
29613
29613
|
}
|
|
29614
29614
|
}
|
|
29615
29615
|
}
|
|
@@ -29712,9 +29712,9 @@ var require_route = __commonJS({
|
|
|
29712
29712
|
}
|
|
29713
29713
|
return method;
|
|
29714
29714
|
}
|
|
29715
|
-
function validateSchemaBodyOption(method,
|
|
29715
|
+
function validateSchemaBodyOption(method, path13, schema) {
|
|
29716
29716
|
if (this[kSupportedHTTPMethods].bodyless.has(method) && schema?.body) {
|
|
29717
|
-
throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method,
|
|
29717
|
+
throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method, path13);
|
|
29718
29718
|
}
|
|
29719
29719
|
}
|
|
29720
29720
|
function validateBodyLimitOption(bodyLimit) {
|
|
@@ -29807,7 +29807,7 @@ var require_four_oh_four = __commonJS({
|
|
|
29807
29807
|
});
|
|
29808
29808
|
}
|
|
29809
29809
|
function createOnBadUrl() {
|
|
29810
|
-
return function onBadUrl(
|
|
29810
|
+
return function onBadUrl(path13, req, res) {
|
|
29811
29811
|
const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext];
|
|
29812
29812
|
const id = getGenReqId(fourOhFourContext.server, req);
|
|
29813
29813
|
const childLogger = createChildLogger(fourOhFourContext, logger, req, id);
|
|
@@ -31496,7 +31496,7 @@ var require_parse_url = __commonJS({
|
|
|
31496
31496
|
var require_form_data = __commonJS({
|
|
31497
31497
|
"../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/form-data.js"(exports, module) {
|
|
31498
31498
|
"use strict";
|
|
31499
|
-
var { randomUUID:
|
|
31499
|
+
var { randomUUID: randomUUID16 } = __require("node:crypto");
|
|
31500
31500
|
var { Readable: Readable4 } = __require("node:stream");
|
|
31501
31501
|
var textEncoder;
|
|
31502
31502
|
function isFormDataLike(payload) {
|
|
@@ -31504,7 +31504,7 @@ var require_form_data = __commonJS({
|
|
|
31504
31504
|
}
|
|
31505
31505
|
function formDataToStream(formdata) {
|
|
31506
31506
|
textEncoder = textEncoder ?? new TextEncoder();
|
|
31507
|
-
const boundary = `----formdata-${
|
|
31507
|
+
const boundary = `----formdata-${randomUUID16()}`;
|
|
31508
31508
|
const prefix = `--${boundary}\r
|
|
31509
31509
|
Content-Disposition: form-data`;
|
|
31510
31510
|
const escape2 = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
|
|
@@ -33638,7 +33638,7 @@ var require_fastify = __commonJS({
|
|
|
33638
33638
|
}
|
|
33639
33639
|
fourOhFour.router.lookup(req, res);
|
|
33640
33640
|
}
|
|
33641
|
-
function onBadUrl(
|
|
33641
|
+
function onBadUrl(path13, req, res) {
|
|
33642
33642
|
if (options.frameworkErrors) {
|
|
33643
33643
|
const id = getGenReqId(onBadUrlContext.server, req);
|
|
33644
33644
|
const childLogger = createChildLogger(onBadUrlContext, options.logger, req, id);
|
|
@@ -33648,12 +33648,12 @@ var require_fastify = __commonJS({
|
|
|
33648
33648
|
if (resolvedDisableRequestLogging === false) {
|
|
33649
33649
|
childLogger.info({ req: request }, "incoming request");
|
|
33650
33650
|
}
|
|
33651
|
-
return options.frameworkErrors(new FST_ERR_BAD_URL(
|
|
33651
|
+
return options.frameworkErrors(new FST_ERR_BAD_URL(path13), request, reply);
|
|
33652
33652
|
}
|
|
33653
33653
|
const body = JSON.stringify({
|
|
33654
33654
|
error: "Bad Request",
|
|
33655
33655
|
code: "FST_ERR_BAD_URL",
|
|
33656
|
-
message: `'${
|
|
33656
|
+
message: `'${path13}' is not a valid url component`,
|
|
33657
33657
|
statusCode: 400
|
|
33658
33658
|
});
|
|
33659
33659
|
res.writeHead(400, {
|
|
@@ -34855,11 +34855,11 @@ var require_commonjs3 = __commonJS({
|
|
|
34855
34855
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
34856
34856
|
};
|
|
34857
34857
|
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
34858
|
-
var
|
|
34858
|
+
var path13 = {
|
|
34859
34859
|
win32: { sep: "\\" },
|
|
34860
34860
|
posix: { sep: "/" }
|
|
34861
34861
|
};
|
|
34862
|
-
exports.sep = defaultPlatform === "win32" ?
|
|
34862
|
+
exports.sep = defaultPlatform === "win32" ? path13.win32.sep : path13.posix.sep;
|
|
34863
34863
|
exports.minimatch.sep = exports.sep;
|
|
34864
34864
|
exports.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
|
|
34865
34865
|
exports.minimatch.GLOBSTAR = exports.GLOBSTAR;
|
|
@@ -35454,10 +35454,10 @@ var require_commonjs3 = __commonJS({
|
|
|
35454
35454
|
}
|
|
35455
35455
|
return filtered.join("/");
|
|
35456
35456
|
}).join("|");
|
|
35457
|
-
const [
|
|
35458
|
-
re2 = "^" +
|
|
35457
|
+
const [open3, close] = set2.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
35458
|
+
re2 = "^" + open3 + re2 + close + "$";
|
|
35459
35459
|
if (this.partial) {
|
|
35460
|
-
re2 = "^(?:\\/|" +
|
|
35460
|
+
re2 = "^(?:\\/|" + open3 + re2.slice(1, -1) + close + ")$";
|
|
35461
35461
|
}
|
|
35462
35462
|
if (this.negate)
|
|
35463
35463
|
re2 = "^(?!" + re2 + ").+$";
|
|
@@ -38176,12 +38176,12 @@ var require_commonjs6 = __commonJS({
|
|
|
38176
38176
|
/**
|
|
38177
38177
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
38178
38178
|
*/
|
|
38179
|
-
resolve(
|
|
38180
|
-
if (!
|
|
38179
|
+
resolve(path13) {
|
|
38180
|
+
if (!path13) {
|
|
38181
38181
|
return this;
|
|
38182
38182
|
}
|
|
38183
|
-
const rootPath = this.getRootString(
|
|
38184
|
-
const dir =
|
|
38183
|
+
const rootPath = this.getRootString(path13);
|
|
38184
|
+
const dir = path13.substring(rootPath.length);
|
|
38185
38185
|
const dirParts = dir.split(this.splitSep);
|
|
38186
38186
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
38187
38187
|
return result;
|
|
@@ -38934,8 +38934,8 @@ var require_commonjs6 = __commonJS({
|
|
|
38934
38934
|
/**
|
|
38935
38935
|
* @internal
|
|
38936
38936
|
*/
|
|
38937
|
-
getRootString(
|
|
38938
|
-
return node_path_1.win32.parse(
|
|
38937
|
+
getRootString(path13) {
|
|
38938
|
+
return node_path_1.win32.parse(path13).root;
|
|
38939
38939
|
}
|
|
38940
38940
|
/**
|
|
38941
38941
|
* @internal
|
|
@@ -38982,8 +38982,8 @@ var require_commonjs6 = __commonJS({
|
|
|
38982
38982
|
/**
|
|
38983
38983
|
* @internal
|
|
38984
38984
|
*/
|
|
38985
|
-
getRootString(
|
|
38986
|
-
return
|
|
38985
|
+
getRootString(path13) {
|
|
38986
|
+
return path13.startsWith("/") ? "/" : "";
|
|
38987
38987
|
}
|
|
38988
38988
|
/**
|
|
38989
38989
|
* @internal
|
|
@@ -39073,11 +39073,11 @@ var require_commonjs6 = __commonJS({
|
|
|
39073
39073
|
/**
|
|
39074
39074
|
* Get the depth of a provided path, string, or the cwd
|
|
39075
39075
|
*/
|
|
39076
|
-
depth(
|
|
39077
|
-
if (typeof
|
|
39078
|
-
|
|
39076
|
+
depth(path13 = this.cwd) {
|
|
39077
|
+
if (typeof path13 === "string") {
|
|
39078
|
+
path13 = this.cwd.resolve(path13);
|
|
39079
39079
|
}
|
|
39080
|
-
return
|
|
39080
|
+
return path13.depth();
|
|
39081
39081
|
}
|
|
39082
39082
|
/**
|
|
39083
39083
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -39564,9 +39564,9 @@ var require_commonjs6 = __commonJS({
|
|
|
39564
39564
|
process9();
|
|
39565
39565
|
return results;
|
|
39566
39566
|
}
|
|
39567
|
-
chdir(
|
|
39567
|
+
chdir(path13 = this.cwd) {
|
|
39568
39568
|
const oldCwd = this.cwd;
|
|
39569
|
-
this.cwd = typeof
|
|
39569
|
+
this.cwd = typeof path13 === "string" ? this.cwd.resolve(path13) : path13;
|
|
39570
39570
|
this.cwd[setAsCwd](oldCwd);
|
|
39571
39571
|
}
|
|
39572
39572
|
};
|
|
@@ -39954,8 +39954,8 @@ var require_processor = __commonJS({
|
|
|
39954
39954
|
}
|
|
39955
39955
|
// match, absolute, ifdir
|
|
39956
39956
|
entries() {
|
|
39957
|
-
return [...this.store.entries()].map(([
|
|
39958
|
-
|
|
39957
|
+
return [...this.store.entries()].map(([path13, n]) => [
|
|
39958
|
+
path13,
|
|
39959
39959
|
!!(n & 2),
|
|
39960
39960
|
!!(n & 1)
|
|
39961
39961
|
]);
|
|
@@ -40173,9 +40173,9 @@ var require_walker = __commonJS({
|
|
|
40173
40173
|
signal;
|
|
40174
40174
|
maxDepth;
|
|
40175
40175
|
includeChildMatches;
|
|
40176
|
-
constructor(patterns,
|
|
40176
|
+
constructor(patterns, path13, opts) {
|
|
40177
40177
|
this.patterns = patterns;
|
|
40178
|
-
this.path =
|
|
40178
|
+
this.path = path13;
|
|
40179
40179
|
this.opts = opts;
|
|
40180
40180
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
40181
40181
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -40194,11 +40194,11 @@ var require_walker = __commonJS({
|
|
|
40194
40194
|
});
|
|
40195
40195
|
}
|
|
40196
40196
|
}
|
|
40197
|
-
#ignored(
|
|
40198
|
-
return this.seen.has(
|
|
40197
|
+
#ignored(path13) {
|
|
40198
|
+
return this.seen.has(path13) || !!this.#ignore?.ignored?.(path13);
|
|
40199
40199
|
}
|
|
40200
|
-
#childrenIgnored(
|
|
40201
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
40200
|
+
#childrenIgnored(path13) {
|
|
40201
|
+
return !!this.#ignore?.childrenIgnored?.(path13);
|
|
40202
40202
|
}
|
|
40203
40203
|
// backpressure mechanism
|
|
40204
40204
|
pause() {
|
|
@@ -40414,8 +40414,8 @@ var require_walker = __commonJS({
|
|
|
40414
40414
|
exports.GlobUtil = GlobUtil;
|
|
40415
40415
|
var GlobWalker = class extends GlobUtil {
|
|
40416
40416
|
matches = /* @__PURE__ */ new Set();
|
|
40417
|
-
constructor(patterns,
|
|
40418
|
-
super(patterns,
|
|
40417
|
+
constructor(patterns, path13, opts) {
|
|
40418
|
+
super(patterns, path13, opts);
|
|
40419
40419
|
}
|
|
40420
40420
|
matchEmit(e) {
|
|
40421
40421
|
this.matches.add(e);
|
|
@@ -40453,8 +40453,8 @@ var require_walker = __commonJS({
|
|
|
40453
40453
|
exports.GlobWalker = GlobWalker;
|
|
40454
40454
|
var GlobStream = class extends GlobUtil {
|
|
40455
40455
|
results;
|
|
40456
|
-
constructor(patterns,
|
|
40457
|
-
super(patterns,
|
|
40456
|
+
constructor(patterns, path13, opts) {
|
|
40457
|
+
super(patterns, path13, opts);
|
|
40458
40458
|
this.results = new minipass_1.Minipass({
|
|
40459
40459
|
signal: this.signal,
|
|
40460
40460
|
objectMode: true
|
|
@@ -40946,11 +40946,11 @@ var require_Mime = __commonJS({
|
|
|
40946
40946
|
}
|
|
40947
40947
|
}
|
|
40948
40948
|
};
|
|
40949
|
-
Mime.prototype.getType = function(
|
|
40950
|
-
|
|
40951
|
-
let last =
|
|
40949
|
+
Mime.prototype.getType = function(path13) {
|
|
40950
|
+
path13 = String(path13);
|
|
40951
|
+
let last = path13.replace(/^.*[/\\]/, "").toLowerCase();
|
|
40952
40952
|
let ext = last.replace(/^.*\./, "").toLowerCase();
|
|
40953
|
-
let hasPath = last.length <
|
|
40953
|
+
let hasPath = last.length < path13.length;
|
|
40954
40954
|
let hasDot = ext.length < last.length - 1;
|
|
40955
40955
|
return (hasDot || !hasPath) && this._types[ext] || null;
|
|
40956
40956
|
};
|
|
@@ -41980,7 +41980,7 @@ var require_send = __commonJS({
|
|
|
41980
41980
|
"../../node_modules/.pnpm/@fastify+send@4.1.0/node_modules/@fastify/send/lib/send.js"(exports, module) {
|
|
41981
41981
|
"use strict";
|
|
41982
41982
|
var fs7 = __require("node:fs");
|
|
41983
|
-
var
|
|
41983
|
+
var path13 = __require("node:path");
|
|
41984
41984
|
var stream = __require("node:stream");
|
|
41985
41985
|
var debug = __require("node:util").debuglog("send");
|
|
41986
41986
|
var decode3 = require_fast_decode_uri_component();
|
|
@@ -41996,11 +41996,11 @@ var require_send = __commonJS({
|
|
|
41996
41996
|
var { parseBytesRange } = require_parseBytesRange();
|
|
41997
41997
|
var { parseTokenList } = require_parseTokenList();
|
|
41998
41998
|
var { createHttpError } = require_createHttpError();
|
|
41999
|
-
var extname =
|
|
42000
|
-
var join =
|
|
42001
|
-
var normalize =
|
|
42002
|
-
var resolve2 =
|
|
42003
|
-
var sep =
|
|
41999
|
+
var extname = path13.extname;
|
|
42000
|
+
var join = path13.join;
|
|
42001
|
+
var normalize = path13.normalize;
|
|
42002
|
+
var resolve2 = path13.resolve;
|
|
42003
|
+
var sep = path13.sep;
|
|
42004
42004
|
var Readable4 = stream.Readable;
|
|
42005
42005
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
42006
42006
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
@@ -42067,36 +42067,36 @@ var require_send = __commonJS({
|
|
|
42067
42067
|
};
|
|
42068
42068
|
}
|
|
42069
42069
|
function normalizePath(_path, root) {
|
|
42070
|
-
let
|
|
42071
|
-
if (
|
|
42070
|
+
let path14 = decode3(_path);
|
|
42071
|
+
if (path14 == null) {
|
|
42072
42072
|
return { statusCode: 400 };
|
|
42073
42073
|
}
|
|
42074
|
-
if (~
|
|
42074
|
+
if (~path14.indexOf("\0")) {
|
|
42075
42075
|
return { statusCode: 400 };
|
|
42076
42076
|
}
|
|
42077
42077
|
let parts;
|
|
42078
42078
|
if (root !== null) {
|
|
42079
|
-
if (
|
|
42080
|
-
|
|
42079
|
+
if (path14) {
|
|
42080
|
+
path14 = normalize("." + sep + path14);
|
|
42081
42081
|
}
|
|
42082
|
-
if (UP_PATH_REGEXP.test(
|
|
42083
|
-
debug('malicious path "%s"',
|
|
42082
|
+
if (UP_PATH_REGEXP.test(path14)) {
|
|
42083
|
+
debug('malicious path "%s"', path14);
|
|
42084
42084
|
return { statusCode: 403 };
|
|
42085
42085
|
}
|
|
42086
|
-
parts =
|
|
42087
|
-
|
|
42086
|
+
parts = path14.split(sep);
|
|
42087
|
+
path14 = normalize(join(root, path14));
|
|
42088
42088
|
} else {
|
|
42089
|
-
if (UP_PATH_REGEXP.test(
|
|
42090
|
-
debug('malicious path "%s"',
|
|
42089
|
+
if (UP_PATH_REGEXP.test(path14)) {
|
|
42090
|
+
debug('malicious path "%s"', path14);
|
|
42091
42091
|
return { statusCode: 403 };
|
|
42092
42092
|
}
|
|
42093
|
-
parts = normalize(
|
|
42094
|
-
|
|
42093
|
+
parts = normalize(path14).split(sep);
|
|
42094
|
+
path14 = resolve2(path14);
|
|
42095
42095
|
}
|
|
42096
|
-
return { path:
|
|
42096
|
+
return { path: path14, parts };
|
|
42097
42097
|
}
|
|
42098
|
-
function hasTrailingSlash2(
|
|
42099
|
-
return
|
|
42098
|
+
function hasTrailingSlash2(path14) {
|
|
42099
|
+
return path14[path14.length - 1] === "/";
|
|
42100
42100
|
}
|
|
42101
42101
|
function isConditionalGET(request) {
|
|
42102
42102
|
return request.headers["if-match"] || request.headers["if-unmodified-since"] || request.headers["if-none-match"] || request.headers["if-modified-since"];
|
|
@@ -42186,9 +42186,9 @@ var require_send = __commonJS({
|
|
|
42186
42186
|
lastModified <= ifRangeTimestamp
|
|
42187
42187
|
);
|
|
42188
42188
|
}
|
|
42189
|
-
function tryStat(
|
|
42189
|
+
function tryStat(path14) {
|
|
42190
42190
|
return new Promise((resolve3) => {
|
|
42191
|
-
fs7.stat(
|
|
42191
|
+
fs7.stat(path14, function onstat(error48, stat) {
|
|
42192
42192
|
resolve3({ error: error48, stat });
|
|
42193
42193
|
});
|
|
42194
42194
|
});
|
|
@@ -42224,7 +42224,7 @@ var require_send = __commonJS({
|
|
|
42224
42224
|
return sendError(500, err);
|
|
42225
42225
|
}
|
|
42226
42226
|
}
|
|
42227
|
-
function sendNotModified(headers,
|
|
42227
|
+
function sendNotModified(headers, path14, stat) {
|
|
42228
42228
|
debug("not modified");
|
|
42229
42229
|
delete headers["Content-Encoding"];
|
|
42230
42230
|
delete headers["Content-Language"];
|
|
@@ -42237,15 +42237,15 @@ var require_send = __commonJS({
|
|
|
42237
42237
|
stream: Readable4.from(""),
|
|
42238
42238
|
// metadata
|
|
42239
42239
|
type: "file",
|
|
42240
|
-
metadata: { path:
|
|
42240
|
+
metadata: { path: path14, stat }
|
|
42241
42241
|
};
|
|
42242
42242
|
}
|
|
42243
|
-
function sendFileDirectly(request,
|
|
42243
|
+
function sendFileDirectly(request, path14, stat, options) {
|
|
42244
42244
|
let len = stat.size;
|
|
42245
42245
|
let offset = options.start ?? 0;
|
|
42246
42246
|
let statusCode = 200;
|
|
42247
42247
|
const headers = {};
|
|
42248
|
-
debug('send "%s"',
|
|
42248
|
+
debug('send "%s"', path14);
|
|
42249
42249
|
if (options.acceptRanges) {
|
|
42250
42250
|
debug("accept ranges");
|
|
42251
42251
|
headers["Accept-Ranges"] = "bytes";
|
|
@@ -42269,7 +42269,7 @@ var require_send = __commonJS({
|
|
|
42269
42269
|
headers.ETag = etag;
|
|
42270
42270
|
}
|
|
42271
42271
|
if (options.contentType) {
|
|
42272
|
-
let type = mime.getType(
|
|
42272
|
+
let type = mime.getType(path14) || mime.default_type;
|
|
42273
42273
|
debug("content-type %s", type);
|
|
42274
42274
|
if (type && isUtf8MimeType(type)) {
|
|
42275
42275
|
type += "; charset=utf-8";
|
|
@@ -42283,7 +42283,7 @@ var require_send = __commonJS({
|
|
|
42283
42283
|
return sendError(412);
|
|
42284
42284
|
}
|
|
42285
42285
|
if (isNotModifiedFailure(request, headers)) {
|
|
42286
|
-
return sendNotModified(headers,
|
|
42286
|
+
return sendNotModified(headers, path14, stat);
|
|
42287
42287
|
}
|
|
42288
42288
|
}
|
|
42289
42289
|
len = Math.max(0, len - offset);
|
|
@@ -42325,10 +42325,10 @@ var require_send = __commonJS({
|
|
|
42325
42325
|
stream: Readable4.from(""),
|
|
42326
42326
|
// metadata
|
|
42327
42327
|
type: "file",
|
|
42328
|
-
metadata: { path:
|
|
42328
|
+
metadata: { path: path14, stat }
|
|
42329
42329
|
};
|
|
42330
42330
|
}
|
|
42331
|
-
const stream2 = fs7.createReadStream(
|
|
42331
|
+
const stream2 = fs7.createReadStream(path14, {
|
|
42332
42332
|
highWaterMark: options.highWaterMark,
|
|
42333
42333
|
start: offset,
|
|
42334
42334
|
end: Math.max(offset, offset + len - 1)
|
|
@@ -42339,10 +42339,10 @@ var require_send = __commonJS({
|
|
|
42339
42339
|
stream: stream2,
|
|
42340
42340
|
// metadata
|
|
42341
42341
|
type: "file",
|
|
42342
|
-
metadata: { path:
|
|
42342
|
+
metadata: { path: path14, stat }
|
|
42343
42343
|
};
|
|
42344
42344
|
}
|
|
42345
|
-
function sendRedirect(
|
|
42345
|
+
function sendRedirect(path14, options) {
|
|
42346
42346
|
if (hasTrailingSlash2(options.path)) {
|
|
42347
42347
|
return sendError(403);
|
|
42348
42348
|
}
|
|
@@ -42360,14 +42360,14 @@ var require_send = __commonJS({
|
|
|
42360
42360
|
stream: Readable4.from(doc[0]),
|
|
42361
42361
|
// metadata
|
|
42362
42362
|
type: "directory",
|
|
42363
|
-
metadata: { requestPath: options.path, path:
|
|
42363
|
+
metadata: { requestPath: options.path, path: path14 }
|
|
42364
42364
|
};
|
|
42365
42365
|
}
|
|
42366
|
-
async function sendIndex(request,
|
|
42366
|
+
async function sendIndex(request, path14, options) {
|
|
42367
42367
|
let err;
|
|
42368
42368
|
for (let i = 0; i < options.index.length; i++) {
|
|
42369
42369
|
const index = options.index[i];
|
|
42370
|
-
const p = join(
|
|
42370
|
+
const p = join(path14, index);
|
|
42371
42371
|
const { error: error48, stat } = await tryStat(p);
|
|
42372
42372
|
if (error48) {
|
|
42373
42373
|
err = error48;
|
|
@@ -42381,13 +42381,13 @@ var require_send = __commonJS({
|
|
|
42381
42381
|
}
|
|
42382
42382
|
return sendError(404);
|
|
42383
42383
|
}
|
|
42384
|
-
async function sendFile(request,
|
|
42385
|
-
const { error: error48, stat } = await tryStat(
|
|
42386
|
-
if (error48 && error48.code === "ENOENT" && !extname(
|
|
42384
|
+
async function sendFile(request, path14, options) {
|
|
42385
|
+
const { error: error48, stat } = await tryStat(path14);
|
|
42386
|
+
if (error48 && error48.code === "ENOENT" && !extname(path14) && path14[path14.length - 1] !== sep) {
|
|
42387
42387
|
let err = error48;
|
|
42388
42388
|
for (let i = 0; i < options.extensions.length; i++) {
|
|
42389
42389
|
const extension = options.extensions[i];
|
|
42390
|
-
const p =
|
|
42390
|
+
const p = path14 + "." + extension;
|
|
42391
42391
|
const { error: error49, stat: stat2 } = await tryStat(p);
|
|
42392
42392
|
if (error49) {
|
|
42393
42393
|
err = error49;
|
|
@@ -42405,14 +42405,14 @@ var require_send = __commonJS({
|
|
|
42405
42405
|
return sendError(404);
|
|
42406
42406
|
}
|
|
42407
42407
|
if (error48) return sendStatError(error48);
|
|
42408
|
-
if (stat.isDirectory()) return sendRedirect(
|
|
42409
|
-
return sendFileDirectly(request,
|
|
42408
|
+
if (stat.isDirectory()) return sendRedirect(path14, options);
|
|
42409
|
+
return sendFileDirectly(request, path14, stat, options);
|
|
42410
42410
|
}
|
|
42411
42411
|
async function send(request, _path, options) {
|
|
42412
42412
|
const opts = normalizeOptions(options);
|
|
42413
42413
|
opts.path = _path;
|
|
42414
42414
|
const parsed = normalizePath(_path, opts.root);
|
|
42415
|
-
const { path:
|
|
42415
|
+
const { path: path14, parts } = parsed;
|
|
42416
42416
|
if (parsed.statusCode !== void 0) {
|
|
42417
42417
|
return sendError(parsed.statusCode);
|
|
42418
42418
|
}
|
|
@@ -42422,23 +42422,23 @@ var require_send = __commonJS({
|
|
|
42422
42422
|
/* c8 ignore start */
|
|
42423
42423
|
/* unreachable, because NODE_DEBUG can not be set after process is running */
|
|
42424
42424
|
case 0:
|
|
42425
|
-
debug('allow dotfile "%s"',
|
|
42425
|
+
debug('allow dotfile "%s"', path14);
|
|
42426
42426
|
break;
|
|
42427
42427
|
/* c8 ignore stop */
|
|
42428
42428
|
case 2:
|
|
42429
|
-
debug('deny dotfile "%s"',
|
|
42429
|
+
debug('deny dotfile "%s"', path14);
|
|
42430
42430
|
return sendError(403);
|
|
42431
42431
|
case 1:
|
|
42432
42432
|
// 'ignore'
|
|
42433
42433
|
default:
|
|
42434
|
-
debug('ignore dotfile "%s"',
|
|
42434
|
+
debug('ignore dotfile "%s"', path14);
|
|
42435
42435
|
return sendError(404);
|
|
42436
42436
|
}
|
|
42437
42437
|
}
|
|
42438
42438
|
if (opts.index.length && hasTrailingSlash2(_path)) {
|
|
42439
|
-
return sendIndex(request,
|
|
42439
|
+
return sendIndex(request, path14, opts);
|
|
42440
42440
|
}
|
|
42441
|
-
return sendFile(request,
|
|
42441
|
+
return sendFile(request, path14, opts);
|
|
42442
42442
|
}
|
|
42443
42443
|
module.exports.send = send;
|
|
42444
42444
|
}
|
|
@@ -42825,16 +42825,16 @@ var require_dirList = __commonJS({
|
|
|
42825
42825
|
"../../node_modules/.pnpm/@fastify+static@8.3.0/node_modules/@fastify/static/lib/dirList.js"(exports, module) {
|
|
42826
42826
|
"use strict";
|
|
42827
42827
|
var os2 = __require("node:os");
|
|
42828
|
-
var
|
|
42828
|
+
var path13 = __require("node:path");
|
|
42829
42829
|
var fs7 = __require("node:fs/promises");
|
|
42830
42830
|
var fastq = require_queue();
|
|
42831
42831
|
var fastqConcurrency = Math.max(1, os2.cpus().length - 1);
|
|
42832
42832
|
var dirList = {
|
|
42833
42833
|
_getExtendedInfo: async function(dir, info) {
|
|
42834
|
-
const depth = dir.split(
|
|
42834
|
+
const depth = dir.split(path13.sep).length;
|
|
42835
42835
|
const files = await fs7.readdir(dir);
|
|
42836
42836
|
const worker = async (filename) => {
|
|
42837
|
-
const filePath =
|
|
42837
|
+
const filePath = path13.join(dir, filename);
|
|
42838
42838
|
let stats;
|
|
42839
42839
|
try {
|
|
42840
42840
|
stats = await fs7.stat(filePath);
|
|
@@ -42843,12 +42843,12 @@ var require_dirList = __commonJS({
|
|
|
42843
42843
|
}
|
|
42844
42844
|
if (stats.isDirectory()) {
|
|
42845
42845
|
info.totalFolderCount++;
|
|
42846
|
-
filePath.split(
|
|
42846
|
+
filePath.split(path13.sep).length === depth + 1 && info.folderCount++;
|
|
42847
42847
|
await dirList._getExtendedInfo(filePath, info);
|
|
42848
42848
|
} else {
|
|
42849
42849
|
info.totalSize += stats.size;
|
|
42850
42850
|
info.totalFileCount++;
|
|
42851
|
-
filePath.split(
|
|
42851
|
+
filePath.split(path13.sep).length === depth + 1 && info.fileCount++;
|
|
42852
42852
|
info.lastModified = Math.max(info.lastModified, stats.mtimeMs);
|
|
42853
42853
|
}
|
|
42854
42854
|
};
|
|
@@ -42891,14 +42891,14 @@ var require_dirList = __commonJS({
|
|
|
42891
42891
|
const worker = async (filename) => {
|
|
42892
42892
|
let stats;
|
|
42893
42893
|
try {
|
|
42894
|
-
stats = await fs7.stat(
|
|
42894
|
+
stats = await fs7.stat(path13.join(dir, filename));
|
|
42895
42895
|
} catch {
|
|
42896
42896
|
return;
|
|
42897
42897
|
}
|
|
42898
42898
|
const entry = { name: filename, stats };
|
|
42899
42899
|
if (stats.isDirectory()) {
|
|
42900
42900
|
if (options.extendedFolderInfo) {
|
|
42901
|
-
entry.extendedInfo = await dirList.getExtendedInfo(
|
|
42901
|
+
entry.extendedInfo = await dirList.getExtendedInfo(path13.join(dir, filename));
|
|
42902
42902
|
}
|
|
42903
42903
|
entries.dirs.push(entry);
|
|
42904
42904
|
} else {
|
|
@@ -42954,11 +42954,11 @@ var require_dirList = __commonJS({
|
|
|
42954
42954
|
* @return {ListFile}
|
|
42955
42955
|
*/
|
|
42956
42956
|
htmlInfo: function(entry, route, prefix, options) {
|
|
42957
|
-
if (options.names?.includes(
|
|
42958
|
-
route =
|
|
42957
|
+
if (options.names?.includes(path13.basename(route))) {
|
|
42958
|
+
route = path13.normalize(path13.join(route, ".."));
|
|
42959
42959
|
}
|
|
42960
42960
|
return {
|
|
42961
|
-
href: encodeURI(
|
|
42961
|
+
href: encodeURI(path13.join(prefix, route, entry.name).replace(/\\/gu, "/")),
|
|
42962
42962
|
name: entry.name,
|
|
42963
42963
|
stats: entry.stats,
|
|
42964
42964
|
extendedInfo: entry.extendedInfo
|
|
@@ -42971,7 +42971,7 @@ var require_dirList = __commonJS({
|
|
|
42971
42971
|
* @return {boolean}
|
|
42972
42972
|
*/
|
|
42973
42973
|
handle: function(route, options) {
|
|
42974
|
-
return options.names?.includes(
|
|
42974
|
+
return options.names?.includes(path13.basename(route)) || // match trailing slash
|
|
42975
42975
|
((options.names?.includes("/") && route[route.length - 1] === "/") ?? false);
|
|
42976
42976
|
},
|
|
42977
42977
|
/**
|
|
@@ -42981,7 +42981,7 @@ var require_dirList = __commonJS({
|
|
|
42981
42981
|
*/
|
|
42982
42982
|
path: function(root, route) {
|
|
42983
42983
|
const _route = route[route.length - 1] === "/" ? route + "none" : route;
|
|
42984
|
-
return
|
|
42984
|
+
return path13.dirname(path13.join(root, _route));
|
|
42985
42985
|
},
|
|
42986
42986
|
/**
|
|
42987
42987
|
* validate options
|
|
@@ -43016,7 +43016,7 @@ var require_dirList = __commonJS({
|
|
|
43016
43016
|
var require_static = __commonJS({
|
|
43017
43017
|
"../../node_modules/.pnpm/@fastify+static@8.3.0/node_modules/@fastify/static/index.js"(exports, module) {
|
|
43018
43018
|
"use strict";
|
|
43019
|
-
var
|
|
43019
|
+
var path13 = __require("node:path");
|
|
43020
43020
|
var { fileURLToPath: fileURLToPath3 } = __require("node:url");
|
|
43021
43021
|
var { statSync: statSync2 } = __require("node:fs");
|
|
43022
43022
|
var { glob } = require_commonjs7();
|
|
@@ -43127,7 +43127,7 @@ var require_static = __commonJS({
|
|
|
43127
43127
|
const routes25 = /* @__PURE__ */ new Set();
|
|
43128
43128
|
const roots = Array.isArray(sendOptions.root) ? sendOptions.root : [sendOptions.root];
|
|
43129
43129
|
for (let rootPath of roots) {
|
|
43130
|
-
rootPath = rootPath.split(
|
|
43130
|
+
rootPath = rootPath.split(path13.win32.sep).join(path13.posix.sep);
|
|
43131
43131
|
!rootPath.endsWith("/") && (rootPath += "/");
|
|
43132
43132
|
const files = await glob("**/**", {
|
|
43133
43133
|
cwd: rootPath,
|
|
@@ -43138,16 +43138,16 @@ var require_static = __commonJS({
|
|
|
43138
43138
|
ignore: opts.globIgnore
|
|
43139
43139
|
});
|
|
43140
43140
|
for (let file2 of files) {
|
|
43141
|
-
file2 = file2.split(
|
|
43141
|
+
file2 = file2.split(path13.win32.sep).join(path13.posix.sep);
|
|
43142
43142
|
const route = prefix + file2;
|
|
43143
43143
|
if (routes25.has(route)) {
|
|
43144
43144
|
continue;
|
|
43145
43145
|
}
|
|
43146
43146
|
routes25.add(route);
|
|
43147
43147
|
setUpHeadAndGet(routeOpts, route, `/${file2}`, rootPath);
|
|
43148
|
-
const key =
|
|
43148
|
+
const key = path13.posix.basename(route);
|
|
43149
43149
|
if (indexes.has(key) && !indexDirs.has(key)) {
|
|
43150
|
-
indexDirs.set(
|
|
43150
|
+
indexDirs.set(path13.posix.dirname(route), rootPath);
|
|
43151
43151
|
}
|
|
43152
43152
|
}
|
|
43153
43153
|
}
|
|
@@ -43171,7 +43171,7 @@ var require_static = __commonJS({
|
|
|
43171
43171
|
} else {
|
|
43172
43172
|
options.root = rootPath;
|
|
43173
43173
|
}
|
|
43174
|
-
} else if (
|
|
43174
|
+
} else if (path13.isAbsolute(pathname) === false) {
|
|
43175
43175
|
return reply.callNotFound();
|
|
43176
43176
|
}
|
|
43177
43177
|
if (allowedPath && !allowedPath(pathname, options.root, request)) {
|
|
@@ -43203,11 +43203,11 @@ var require_static = __commonJS({
|
|
|
43203
43203
|
} = await send(request.raw, encodeURI(pathnameForSend), options);
|
|
43204
43204
|
switch (type) {
|
|
43205
43205
|
case "directory": {
|
|
43206
|
-
const
|
|
43206
|
+
const path14 = metadata.path;
|
|
43207
43207
|
if (opts.list) {
|
|
43208
43208
|
await dirList.send({
|
|
43209
43209
|
reply,
|
|
43210
|
-
dir:
|
|
43210
|
+
dir: path14,
|
|
43211
43211
|
options: opts.list,
|
|
43212
43212
|
route: pathname,
|
|
43213
43213
|
prefix,
|
|
@@ -43364,7 +43364,7 @@ var require_static = __commonJS({
|
|
|
43364
43364
|
'"root" option array contains one or more duplicate paths'
|
|
43365
43365
|
);
|
|
43366
43366
|
}
|
|
43367
|
-
rootPath.map((
|
|
43367
|
+
rootPath.map((path14) => checkPath(fastify2, path14));
|
|
43368
43368
|
return;
|
|
43369
43369
|
}
|
|
43370
43370
|
if (typeof rootPath === "string") {
|
|
@@ -43376,7 +43376,7 @@ var require_static = __commonJS({
|
|
|
43376
43376
|
if (typeof rootPath !== "string") {
|
|
43377
43377
|
throw new TypeError('"root" option must be a string');
|
|
43378
43378
|
}
|
|
43379
|
-
if (
|
|
43379
|
+
if (path13.isAbsolute(rootPath) === false) {
|
|
43380
43380
|
throw new Error('"root" option must be an absolute path');
|
|
43381
43381
|
}
|
|
43382
43382
|
let pathStat;
|
|
@@ -43393,8 +43393,8 @@ var require_static = __commonJS({
|
|
|
43393
43393
|
throw new Error('"root" option must point to a directory');
|
|
43394
43394
|
}
|
|
43395
43395
|
}
|
|
43396
|
-
function getContentType(
|
|
43397
|
-
const type = send.mime.getType(
|
|
43396
|
+
function getContentType(path14) {
|
|
43397
|
+
const type = send.mime.getType(path14) || send.mime.default_type;
|
|
43398
43398
|
if (!send.isUtf8MimeType(type)) {
|
|
43399
43399
|
return type;
|
|
43400
43400
|
}
|
|
@@ -43403,7 +43403,7 @@ var require_static = __commonJS({
|
|
|
43403
43403
|
function findIndexFile(pathname, root, indexFiles = ["index.html"]) {
|
|
43404
43404
|
if (Array.isArray(indexFiles)) {
|
|
43405
43405
|
return indexFiles.find((filename) => {
|
|
43406
|
-
const p =
|
|
43406
|
+
const p = path13.join(root, pathname, filename);
|
|
43407
43407
|
try {
|
|
43408
43408
|
const stats = statSync2(p);
|
|
43409
43409
|
return !stats.isDirectory();
|
|
@@ -46589,7 +46589,7 @@ var require_stream = __commonJS({
|
|
|
46589
46589
|
};
|
|
46590
46590
|
duplex._final = function(callback) {
|
|
46591
46591
|
if (ws.readyState === ws.CONNECTING) {
|
|
46592
|
-
ws.once("open", function
|
|
46592
|
+
ws.once("open", function open3() {
|
|
46593
46593
|
duplex._final(callback);
|
|
46594
46594
|
});
|
|
46595
46595
|
return;
|
|
@@ -46610,7 +46610,7 @@ var require_stream = __commonJS({
|
|
|
46610
46610
|
};
|
|
46611
46611
|
duplex._write = function(chunk, encoding, callback) {
|
|
46612
46612
|
if (ws.readyState === ws.CONNECTING) {
|
|
46613
|
-
ws.once("open", function
|
|
46613
|
+
ws.once("open", function open3() {
|
|
46614
46614
|
duplex._write(chunk, encoding, callback);
|
|
46615
46615
|
});
|
|
46616
46616
|
return;
|
|
@@ -50114,7 +50114,7 @@ var require_websocket2 = __commonJS({
|
|
|
50114
50114
|
delete wssOptions.server;
|
|
50115
50115
|
const wss = new WebSocket2.Server(wssOptions);
|
|
50116
50116
|
fastify2.decorate("websocketServer", wss);
|
|
50117
|
-
async function injectWS(
|
|
50117
|
+
async function injectWS(path13 = "/", upgradeContext = {}, options = {}) {
|
|
50118
50118
|
const server2Client = new PassThrough();
|
|
50119
50119
|
const client2Server = new PassThrough();
|
|
50120
50120
|
const serverStream = new Duplexify(server2Client, client2Server);
|
|
@@ -50154,7 +50154,7 @@ var require_websocket2 = __commonJS({
|
|
|
50154
50154
|
"sec-websocket-key": randomBytes(16).toString("base64")
|
|
50155
50155
|
},
|
|
50156
50156
|
httpVersion: "1.1",
|
|
50157
|
-
url:
|
|
50157
|
+
url: path13,
|
|
50158
50158
|
[kWs]: serverStream,
|
|
50159
50159
|
[kWsHead]: head
|
|
50160
50160
|
};
|
|
@@ -50471,7 +50471,7 @@ var require_auth_config = __commonJS({
|
|
|
50471
50471
|
});
|
|
50472
50472
|
module.exports = __toCommonJS(auth_config_exports);
|
|
50473
50473
|
var fs7 = __toESM3(__require("fs"));
|
|
50474
|
-
var
|
|
50474
|
+
var path13 = __toESM3(__require("path"));
|
|
50475
50475
|
var import_token_util = require_token_util();
|
|
50476
50476
|
function getAuthConfigPath() {
|
|
50477
50477
|
const dataDir = (0, import_token_util.getVercelDataDir)();
|
|
@@ -50480,7 +50480,7 @@ var require_auth_config = __commonJS({
|
|
|
50480
50480
|
`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`
|
|
50481
50481
|
);
|
|
50482
50482
|
}
|
|
50483
|
-
return
|
|
50483
|
+
return path13.join(dataDir, "auth.json");
|
|
50484
50484
|
}
|
|
50485
50485
|
function readAuthConfig() {
|
|
50486
50486
|
try {
|
|
@@ -50499,7 +50499,7 @@ var require_auth_config = __commonJS({
|
|
|
50499
50499
|
}
|
|
50500
50500
|
function writeAuthConfig(config2) {
|
|
50501
50501
|
const authPath = getAuthConfigPath();
|
|
50502
|
-
const authDir =
|
|
50502
|
+
const authDir = path13.dirname(authPath);
|
|
50503
50503
|
if (!fs7.existsSync(authDir)) {
|
|
50504
50504
|
fs7.mkdirSync(authDir, { mode: 504, recursive: true });
|
|
50505
50505
|
}
|
|
@@ -50649,7 +50649,7 @@ var require_token_util = __commonJS({
|
|
|
50649
50649
|
saveToken: () => saveToken
|
|
50650
50650
|
});
|
|
50651
50651
|
module.exports = __toCommonJS(token_util_exports);
|
|
50652
|
-
var
|
|
50652
|
+
var path13 = __toESM3(__require("path"));
|
|
50653
50653
|
var fs7 = __toESM3(__require("fs"));
|
|
50654
50654
|
var import_token_error = require_token_error();
|
|
50655
50655
|
var import_token_io = require_token_io();
|
|
@@ -50661,7 +50661,7 @@ var require_token_util = __commonJS({
|
|
|
50661
50661
|
if (!dataDir) {
|
|
50662
50662
|
return null;
|
|
50663
50663
|
}
|
|
50664
|
-
return
|
|
50664
|
+
return path13.join(dataDir, vercelFolder);
|
|
50665
50665
|
}
|
|
50666
50666
|
async function getVercelCliToken() {
|
|
50667
50667
|
const authConfig = (0, import_auth_config.readAuthConfig)();
|
|
@@ -50734,7 +50734,7 @@ var require_token_util = __commonJS({
|
|
|
50734
50734
|
"Unable to find project root directory. Have you linked your project with `vc link?`"
|
|
50735
50735
|
);
|
|
50736
50736
|
}
|
|
50737
|
-
const prjPath =
|
|
50737
|
+
const prjPath = path13.join(dir, ".vercel", "project.json");
|
|
50738
50738
|
if (!fs7.existsSync(prjPath)) {
|
|
50739
50739
|
throw new import_token_error.VercelOidcTokenError(
|
|
50740
50740
|
"project.json not found, have you linked your project with `vc link?`"
|
|
@@ -50755,9 +50755,9 @@ var require_token_util = __commonJS({
|
|
|
50755
50755
|
"Unable to find user data directory. Please reach out to Vercel support."
|
|
50756
50756
|
);
|
|
50757
50757
|
}
|
|
50758
|
-
const tokenPath =
|
|
50758
|
+
const tokenPath = path13.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
50759
50759
|
const tokenJson = JSON.stringify(token);
|
|
50760
|
-
fs7.mkdirSync(
|
|
50760
|
+
fs7.mkdirSync(path13.dirname(tokenPath), { mode: 504, recursive: true });
|
|
50761
50761
|
fs7.writeFileSync(tokenPath, tokenJson);
|
|
50762
50762
|
fs7.chmodSync(tokenPath, 432);
|
|
50763
50763
|
return;
|
|
@@ -50769,7 +50769,7 @@ var require_token_util = __commonJS({
|
|
|
50769
50769
|
"Unable to find user data directory. Please reach out to Vercel support."
|
|
50770
50770
|
);
|
|
50771
50771
|
}
|
|
50772
|
-
const tokenPath =
|
|
50772
|
+
const tokenPath = path13.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
50773
50773
|
if (!fs7.existsSync(tokenPath)) {
|
|
50774
50774
|
return null;
|
|
50775
50775
|
}
|
|
@@ -52038,14 +52038,14 @@ var require_util3 = __commonJS({
|
|
|
52038
52038
|
}
|
|
52039
52039
|
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
52040
52040
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
|
|
52041
|
-
let
|
|
52041
|
+
let path13 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
52042
52042
|
if (origin[origin.length - 1] === "/") {
|
|
52043
52043
|
origin = origin.slice(0, origin.length - 1);
|
|
52044
52044
|
}
|
|
52045
|
-
if (
|
|
52046
|
-
|
|
52045
|
+
if (path13 && path13[0] !== "/") {
|
|
52046
|
+
path13 = `/${path13}`;
|
|
52047
52047
|
}
|
|
52048
|
-
return new URL(`${origin}${
|
|
52048
|
+
return new URL(`${origin}${path13}`);
|
|
52049
52049
|
}
|
|
52050
52050
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
52051
52051
|
throw new InvalidArgumentError4("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -52850,9 +52850,9 @@ var require_diagnostics = __commonJS({
|
|
|
52850
52850
|
"undici:client:sendHeaders",
|
|
52851
52851
|
(evt) => {
|
|
52852
52852
|
const {
|
|
52853
|
-
request: { method, path:
|
|
52853
|
+
request: { method, path: path13, origin }
|
|
52854
52854
|
} = evt;
|
|
52855
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
52855
|
+
debugLog("sending request to %s %s%s", method, origin, path13);
|
|
52856
52856
|
}
|
|
52857
52857
|
);
|
|
52858
52858
|
}
|
|
@@ -52870,14 +52870,14 @@ var require_diagnostics = __commonJS({
|
|
|
52870
52870
|
"undici:request:headers",
|
|
52871
52871
|
(evt) => {
|
|
52872
52872
|
const {
|
|
52873
|
-
request: { method, path:
|
|
52873
|
+
request: { method, path: path13, origin },
|
|
52874
52874
|
response: { statusCode }
|
|
52875
52875
|
} = evt;
|
|
52876
52876
|
debugLog(
|
|
52877
52877
|
"received response to %s %s%s - HTTP %d",
|
|
52878
52878
|
method,
|
|
52879
52879
|
origin,
|
|
52880
|
-
|
|
52880
|
+
path13,
|
|
52881
52881
|
statusCode
|
|
52882
52882
|
);
|
|
52883
52883
|
}
|
|
@@ -52886,23 +52886,23 @@ var require_diagnostics = __commonJS({
|
|
|
52886
52886
|
"undici:request:trailers",
|
|
52887
52887
|
(evt) => {
|
|
52888
52888
|
const {
|
|
52889
|
-
request: { method, path:
|
|
52889
|
+
request: { method, path: path13, origin }
|
|
52890
52890
|
} = evt;
|
|
52891
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
52891
|
+
debugLog("trailers received from %s %s%s", method, origin, path13);
|
|
52892
52892
|
}
|
|
52893
52893
|
);
|
|
52894
52894
|
diagnosticsChannel.subscribe(
|
|
52895
52895
|
"undici:request:error",
|
|
52896
52896
|
(evt) => {
|
|
52897
52897
|
const {
|
|
52898
|
-
request: { method, path:
|
|
52898
|
+
request: { method, path: path13, origin },
|
|
52899
52899
|
error: error48
|
|
52900
52900
|
} = evt;
|
|
52901
52901
|
debugLog(
|
|
52902
52902
|
"request to %s %s%s errored - %s",
|
|
52903
52903
|
method,
|
|
52904
52904
|
origin,
|
|
52905
|
-
|
|
52905
|
+
path13,
|
|
52906
52906
|
error48.message
|
|
52907
52907
|
);
|
|
52908
52908
|
}
|
|
@@ -53002,7 +53002,7 @@ var require_request3 = __commonJS({
|
|
|
53002
53002
|
var kHandler = /* @__PURE__ */ Symbol("handler");
|
|
53003
53003
|
var Request2 = class {
|
|
53004
53004
|
constructor(origin, {
|
|
53005
|
-
path:
|
|
53005
|
+
path: path13,
|
|
53006
53006
|
method,
|
|
53007
53007
|
body,
|
|
53008
53008
|
headers,
|
|
@@ -53018,11 +53018,11 @@ var require_request3 = __commonJS({
|
|
|
53018
53018
|
throwOnError,
|
|
53019
53019
|
maxRedirections
|
|
53020
53020
|
}, handler) {
|
|
53021
|
-
if (typeof
|
|
53021
|
+
if (typeof path13 !== "string") {
|
|
53022
53022
|
throw new InvalidArgumentError4("path must be a string");
|
|
53023
|
-
} else if (
|
|
53023
|
+
} else if (path13[0] !== "/" && !(path13.startsWith("http://") || path13.startsWith("https://")) && method !== "CONNECT") {
|
|
53024
53024
|
throw new InvalidArgumentError4("path must be an absolute URL or start with a slash");
|
|
53025
|
-
} else if (invalidPathRegex.test(
|
|
53025
|
+
} else if (invalidPathRegex.test(path13)) {
|
|
53026
53026
|
throw new InvalidArgumentError4("invalid request path");
|
|
53027
53027
|
}
|
|
53028
53028
|
if (typeof method !== "string") {
|
|
@@ -53090,7 +53090,7 @@ var require_request3 = __commonJS({
|
|
|
53090
53090
|
this.completed = false;
|
|
53091
53091
|
this.aborted = false;
|
|
53092
53092
|
this.upgrade = upgrade || null;
|
|
53093
|
-
this.path = query ? serializePathWithQuery(
|
|
53093
|
+
this.path = query ? serializePathWithQuery(path13, query) : path13;
|
|
53094
53094
|
this.origin = origin;
|
|
53095
53095
|
this.protocol = getProtocolFromUrlString(origin);
|
|
53096
53096
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -58107,7 +58107,7 @@ var require_client_h1 = __commonJS({
|
|
|
58107
58107
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
58108
58108
|
}
|
|
58109
58109
|
function writeH1(client, request) {
|
|
58110
|
-
const { method, path:
|
|
58110
|
+
const { method, path: path13, host, upgrade, blocking, reset } = request;
|
|
58111
58111
|
let { body, headers, contentLength } = request;
|
|
58112
58112
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
58113
58113
|
if (util2.isFormDataLike(body)) {
|
|
@@ -58173,7 +58173,7 @@ var require_client_h1 = __commonJS({
|
|
|
58173
58173
|
if (blocking) {
|
|
58174
58174
|
socket[kBlocking] = true;
|
|
58175
58175
|
}
|
|
58176
|
-
let header = `${method} ${
|
|
58176
|
+
let header = `${method} ${path13} HTTP/1.1\r
|
|
58177
58177
|
`;
|
|
58178
58178
|
if (typeof host === "string") {
|
|
58179
58179
|
header += `host: ${host}\r
|
|
@@ -58826,7 +58826,7 @@ var require_client_h2 = __commonJS({
|
|
|
58826
58826
|
function writeH2(client, request) {
|
|
58827
58827
|
const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout];
|
|
58828
58828
|
const session = client[kHTTP2Session];
|
|
58829
|
-
const { method, path:
|
|
58829
|
+
const { method, path: path13, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
|
|
58830
58830
|
let { body } = request;
|
|
58831
58831
|
if (upgrade != null && upgrade !== "websocket") {
|
|
58832
58832
|
util2.errorRequest(client, request, new InvalidArgumentError4(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
@@ -58894,7 +58894,7 @@ var require_client_h2 = __commonJS({
|
|
|
58894
58894
|
}
|
|
58895
58895
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
58896
58896
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
58897
|
-
headers[HTTP2_HEADER_PATH] =
|
|
58897
|
+
headers[HTTP2_HEADER_PATH] = path13;
|
|
58898
58898
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
58899
58899
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
58900
58900
|
} else {
|
|
@@ -58935,7 +58935,7 @@ var require_client_h2 = __commonJS({
|
|
|
58935
58935
|
stream.setTimeout(requestTimeout);
|
|
58936
58936
|
return true;
|
|
58937
58937
|
}
|
|
58938
|
-
headers[HTTP2_HEADER_PATH] =
|
|
58938
|
+
headers[HTTP2_HEADER_PATH] = path13;
|
|
58939
58939
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
58940
58940
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
58941
58941
|
if (body && typeof body.read === "function") {
|
|
@@ -60559,10 +60559,10 @@ var require_proxy_agent = __commonJS({
|
|
|
60559
60559
|
};
|
|
60560
60560
|
const {
|
|
60561
60561
|
origin,
|
|
60562
|
-
path:
|
|
60562
|
+
path: path13 = "/",
|
|
60563
60563
|
headers = {}
|
|
60564
60564
|
} = opts;
|
|
60565
|
-
opts.path = origin +
|
|
60565
|
+
opts.path = origin + path13;
|
|
60566
60566
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
60567
60567
|
const { host } = new URL(origin);
|
|
60568
60568
|
headers.host = host;
|
|
@@ -62603,20 +62603,20 @@ var require_mock_utils = __commonJS({
|
|
|
62603
62603
|
}
|
|
62604
62604
|
return normalizedQp;
|
|
62605
62605
|
}
|
|
62606
|
-
function safeUrl(
|
|
62607
|
-
if (typeof
|
|
62608
|
-
return
|
|
62606
|
+
function safeUrl(path13) {
|
|
62607
|
+
if (typeof path13 !== "string") {
|
|
62608
|
+
return path13;
|
|
62609
62609
|
}
|
|
62610
|
-
const pathSegments =
|
|
62610
|
+
const pathSegments = path13.split("?", 3);
|
|
62611
62611
|
if (pathSegments.length !== 2) {
|
|
62612
|
-
return
|
|
62612
|
+
return path13;
|
|
62613
62613
|
}
|
|
62614
62614
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
62615
62615
|
qp.sort();
|
|
62616
62616
|
return [...pathSegments, qp.toString()].join("?");
|
|
62617
62617
|
}
|
|
62618
|
-
function matchKey(mockDispatch2, { path:
|
|
62619
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
62618
|
+
function matchKey(mockDispatch2, { path: path13, method, body, headers }) {
|
|
62619
|
+
const pathMatch = matchValue(mockDispatch2.path, path13);
|
|
62620
62620
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
62621
62621
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
62622
62622
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -62641,8 +62641,8 @@ var require_mock_utils = __commonJS({
|
|
|
62641
62641
|
const basePath33 = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
62642
62642
|
const resolvedPath = typeof basePath33 === "string" ? safeUrl(basePath33) : basePath33;
|
|
62643
62643
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
62644
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
62645
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
62644
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path13, ignoreTrailingSlash }) => {
|
|
62645
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path13)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path13), resolvedPath);
|
|
62646
62646
|
});
|
|
62647
62647
|
if (matchedMockDispatches.length === 0) {
|
|
62648
62648
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -62680,19 +62680,19 @@ var require_mock_utils = __commonJS({
|
|
|
62680
62680
|
mockDispatches.splice(index, 1);
|
|
62681
62681
|
}
|
|
62682
62682
|
}
|
|
62683
|
-
function removeTrailingSlash(
|
|
62684
|
-
while (
|
|
62685
|
-
|
|
62683
|
+
function removeTrailingSlash(path13) {
|
|
62684
|
+
while (path13.endsWith("/")) {
|
|
62685
|
+
path13 = path13.slice(0, -1);
|
|
62686
62686
|
}
|
|
62687
|
-
if (
|
|
62688
|
-
|
|
62687
|
+
if (path13.length === 0) {
|
|
62688
|
+
path13 = "/";
|
|
62689
62689
|
}
|
|
62690
|
-
return
|
|
62690
|
+
return path13;
|
|
62691
62691
|
}
|
|
62692
62692
|
function buildKey(opts) {
|
|
62693
|
-
const { path:
|
|
62693
|
+
const { path: path13, method, body, headers, query } = opts;
|
|
62694
62694
|
return {
|
|
62695
|
-
path:
|
|
62695
|
+
path: path13,
|
|
62696
62696
|
method,
|
|
62697
62697
|
body,
|
|
62698
62698
|
headers,
|
|
@@ -63379,10 +63379,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
63379
63379
|
}
|
|
63380
63380
|
format(pendingInterceptors) {
|
|
63381
63381
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
63382
|
-
({ method, path:
|
|
63382
|
+
({ method, path: path13, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
63383
63383
|
Method: method,
|
|
63384
63384
|
Origin: origin,
|
|
63385
|
-
Path:
|
|
63385
|
+
Path: path13,
|
|
63386
63386
|
"Status code": statusCode,
|
|
63387
63387
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
63388
63388
|
Invocations: timesInvoked,
|
|
@@ -63464,9 +63464,9 @@ var require_mock_agent = __commonJS({
|
|
|
63464
63464
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
63465
63465
|
const dispatchOpts = { ...opts };
|
|
63466
63466
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
63467
|
-
const [
|
|
63467
|
+
const [path13, searchParams] = dispatchOpts.path.split("?");
|
|
63468
63468
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
63469
|
-
dispatchOpts.path = `${
|
|
63469
|
+
dispatchOpts.path = `${path13}?${normalizedSearchParams}`;
|
|
63470
63470
|
}
|
|
63471
63471
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
63472
63472
|
}
|
|
@@ -63670,7 +63670,7 @@ var require_snapshot_utils = __commonJS({
|
|
|
63670
63670
|
var require_snapshot_recorder = __commonJS({
|
|
63671
63671
|
"../../node_modules/.pnpm/undici@7.22.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
63672
63672
|
"use strict";
|
|
63673
|
-
var { writeFile, readFile, mkdir:
|
|
63673
|
+
var { writeFile, readFile, mkdir: mkdir4 } = __require("node:fs/promises");
|
|
63674
63674
|
var { dirname, resolve: resolve2 } = __require("node:path");
|
|
63675
63675
|
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
|
|
63676
63676
|
var { InvalidArgumentError: InvalidArgumentError4, UndiciError } = require_errors6();
|
|
@@ -63867,12 +63867,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
63867
63867
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
63868
63868
|
*/
|
|
63869
63869
|
async loadSnapshots(filePath) {
|
|
63870
|
-
const
|
|
63871
|
-
if (!
|
|
63870
|
+
const path13 = filePath || this.#snapshotPath;
|
|
63871
|
+
if (!path13) {
|
|
63872
63872
|
throw new InvalidArgumentError4("Snapshot path is required");
|
|
63873
63873
|
}
|
|
63874
63874
|
try {
|
|
63875
|
-
const data = await readFile(resolve2(
|
|
63875
|
+
const data = await readFile(resolve2(path13), "utf8");
|
|
63876
63876
|
const parsed = JSON.parse(data);
|
|
63877
63877
|
if (Array.isArray(parsed)) {
|
|
63878
63878
|
this.#snapshots.clear();
|
|
@@ -63886,7 +63886,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
63886
63886
|
if (error48.code === "ENOENT") {
|
|
63887
63887
|
this.#snapshots.clear();
|
|
63888
63888
|
} else {
|
|
63889
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
63889
|
+
throw new UndiciError(`Failed to load snapshots from ${path13}`, { cause: error48 });
|
|
63890
63890
|
}
|
|
63891
63891
|
}
|
|
63892
63892
|
}
|
|
@@ -63897,12 +63897,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
63897
63897
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
63898
63898
|
*/
|
|
63899
63899
|
async saveSnapshots(filePath) {
|
|
63900
|
-
const
|
|
63901
|
-
if (!
|
|
63900
|
+
const path13 = filePath || this.#snapshotPath;
|
|
63901
|
+
if (!path13) {
|
|
63902
63902
|
throw new InvalidArgumentError4("Snapshot path is required");
|
|
63903
63903
|
}
|
|
63904
|
-
const resolvedPath = resolve2(
|
|
63905
|
-
await
|
|
63904
|
+
const resolvedPath = resolve2(path13);
|
|
63905
|
+
await mkdir4(dirname(resolvedPath), { recursive: true });
|
|
63906
63906
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
63907
63907
|
hash: hash2,
|
|
63908
63908
|
snapshot
|
|
@@ -64526,15 +64526,15 @@ var require_redirect_handler = __commonJS({
|
|
|
64526
64526
|
return;
|
|
64527
64527
|
}
|
|
64528
64528
|
const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
64529
|
-
const
|
|
64530
|
-
const redirectUrlString = `${origin}${
|
|
64529
|
+
const path13 = search ? `${pathname}${search}` : pathname;
|
|
64530
|
+
const redirectUrlString = `${origin}${path13}`;
|
|
64531
64531
|
for (const historyUrl of this.history) {
|
|
64532
64532
|
if (historyUrl.toString() === redirectUrlString) {
|
|
64533
64533
|
throw new InvalidArgumentError4(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
64534
64534
|
}
|
|
64535
64535
|
}
|
|
64536
64536
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
64537
|
-
this.opts.path =
|
|
64537
|
+
this.opts.path = path13;
|
|
64538
64538
|
this.opts.origin = origin;
|
|
64539
64539
|
this.opts.query = null;
|
|
64540
64540
|
}
|
|
@@ -71411,9 +71411,9 @@ var require_util6 = __commonJS({
|
|
|
71411
71411
|
}
|
|
71412
71412
|
}
|
|
71413
71413
|
}
|
|
71414
|
-
function validateCookiePath(
|
|
71415
|
-
for (let i = 0; i <
|
|
71416
|
-
const code =
|
|
71414
|
+
function validateCookiePath(path13) {
|
|
71415
|
+
for (let i = 0; i < path13.length; ++i) {
|
|
71416
|
+
const code = path13.charCodeAt(i);
|
|
71417
71417
|
if (code < 32 || // exclude CTLs (0-31)
|
|
71418
71418
|
code === 127 || // DEL
|
|
71419
71419
|
code === 59) {
|
|
@@ -74524,11 +74524,11 @@ var require_undici = __commonJS({
|
|
|
74524
74524
|
if (typeof opts.path !== "string") {
|
|
74525
74525
|
throw new InvalidArgumentError4("invalid opts.path");
|
|
74526
74526
|
}
|
|
74527
|
-
let
|
|
74527
|
+
let path13 = opts.path;
|
|
74528
74528
|
if (!opts.path.startsWith("/")) {
|
|
74529
|
-
|
|
74529
|
+
path13 = `/${path13}`;
|
|
74530
74530
|
}
|
|
74531
|
-
url2 = new URL(util2.parseOrigin(url2).origin +
|
|
74531
|
+
url2 = new URL(util2.parseOrigin(url2).origin + path13);
|
|
74532
74532
|
} else {
|
|
74533
74533
|
if (!opts) {
|
|
74534
74534
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -81913,12 +81913,12 @@ function buildRequest(options) {
|
|
|
81913
81913
|
userAgent = USER_AGENT,
|
|
81914
81914
|
skipApiVersionInUrl = false
|
|
81915
81915
|
} = options;
|
|
81916
|
-
const { path:
|
|
81916
|
+
const { path: path13, method, queryParams, headerParams, bodyParams, formData, options: opts } = requestOptions;
|
|
81917
81917
|
const { deepSnakecaseBodyParamKeys = false } = opts || {};
|
|
81918
81918
|
if (requireSecretKey) {
|
|
81919
81919
|
assertValidSecretKey(secretKey);
|
|
81920
81920
|
}
|
|
81921
|
-
const url2 = skipApiVersionInUrl ? joinPaths(apiUrl,
|
|
81921
|
+
const url2 = skipApiVersionInUrl ? joinPaths(apiUrl, path13) : joinPaths(apiUrl, apiVersion, path13);
|
|
81922
81922
|
const finalUrl = new URL(url2);
|
|
81923
81923
|
if (queryParams) {
|
|
81924
81924
|
const snakecasedQueryParams = snakecase_keys_default({ ...queryParams });
|
|
@@ -84327,10 +84327,10 @@ var init_chunk_JW73PKED = __esm({
|
|
|
84327
84327
|
*/
|
|
84328
84328
|
async getToken(sessionId, template, expiresInSeconds) {
|
|
84329
84329
|
this.requireId(sessionId);
|
|
84330
|
-
const
|
|
84330
|
+
const path13 = template ? joinPaths(basePath25, sessionId, "tokens", template) : joinPaths(basePath25, sessionId, "tokens");
|
|
84331
84331
|
const requestOptions = {
|
|
84332
84332
|
method: "POST",
|
|
84333
|
-
path:
|
|
84333
|
+
path: path13
|
|
84334
84334
|
};
|
|
84335
84335
|
if (expiresInSeconds !== void 0) {
|
|
84336
84336
|
requestOptions.bodyParams = { expires_in_seconds: expiresInSeconds };
|
|
@@ -89615,7 +89615,7 @@ async function run(app, inputs, context2) {
|
|
|
89615
89615
|
}
|
|
89616
89616
|
|
|
89617
89617
|
// src/command.ts
|
|
89618
|
-
import
|
|
89618
|
+
import path12 from "node:path";
|
|
89619
89619
|
|
|
89620
89620
|
// src/storage/sqlite.ts
|
|
89621
89621
|
import Database from "better-sqlite3";
|
|
@@ -89695,14 +89695,18 @@ var createDatabase = (dbPath) => {
|
|
|
89695
89695
|
branch TEXT NOT NULL DEFAULT '',
|
|
89696
89696
|
status TEXT NOT NULL DEFAULT 'running',
|
|
89697
89697
|
title TEXT DEFAULT NULL,
|
|
89698
|
-
|
|
89699
|
-
updated_at
|
|
89698
|
+
-- Millisecond-precision timestamps. CURRENT_TIMESTAMP is seconds-only,
|
|
89699
|
+
-- which lets two sessions tie on updated_at within the same second and
|
|
89700
|
+
-- corrupts the ordering used by getLatestByBranch. The 'YYYY-MM-DD
|
|
89701
|
+
-- HH:MM:SS.fff' format remains lex-sortable (and lex-comparable with
|
|
89702
|
+
-- existing seconds-only rows, which correctly sort earlier).
|
|
89703
|
+
created_at TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%f', 'now')),
|
|
89704
|
+
updated_at TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%f', 'now')),
|
|
89700
89705
|
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
|
|
89701
89706
|
);
|
|
89702
|
-
|
|
89703
|
-
|
|
89704
|
-
|
|
89705
|
-
ON agent_sessions(updated_at DESC);
|
|
89707
|
+
-- Note: idx_agent_sessions_project_branch and idx_agent_sessions_updated_at
|
|
89708
|
+
-- are created AFTER the agent_sessions column migrations (see below), so
|
|
89709
|
+
-- existing databases that predate the updated_at column don't fail here.
|
|
89706
89710
|
|
|
89707
89711
|
CREATE TABLE IF NOT EXISTS tasks (
|
|
89708
89712
|
id TEXT PRIMARY KEY,
|
|
@@ -89766,6 +89770,19 @@ var createDatabase = (dbPath) => {
|
|
|
89766
89770
|
sync_down_config TEXT,
|
|
89767
89771
|
UNIQUE(project_id, remote_server_id)
|
|
89768
89772
|
);
|
|
89773
|
+
|
|
89774
|
+
-- Persists the in-memory remoteSessionMap so server restarts don't break
|
|
89775
|
+
-- existing remote-prefixed session URLs. URL/api key are NOT stored here \u2014
|
|
89776
|
+
-- always derived from project_remotes(project_id, remote_server_id) at
|
|
89777
|
+
-- hydration time, so rotating an api key in project_remotes naturally
|
|
89778
|
+
-- propagates without needing to update this table.
|
|
89779
|
+
CREATE TABLE IF NOT EXISTS remote_session_mappings (
|
|
89780
|
+
local_session_id TEXT PRIMARY KEY,
|
|
89781
|
+
project_id TEXT NOT NULL,
|
|
89782
|
+
remote_server_id TEXT NOT NULL,
|
|
89783
|
+
remote_session_id TEXT NOT NULL,
|
|
89784
|
+
branch TEXT
|
|
89785
|
+
);
|
|
89769
89786
|
`);
|
|
89770
89787
|
const tableInfo = db.prepare("PRAGMA table_info(executors)").all();
|
|
89771
89788
|
const hasPtyColumn = tableInfo.some((col) => col.name === "pty");
|
|
@@ -89886,8 +89903,8 @@ var createDatabase = (dbPath) => {
|
|
|
89886
89903
|
status TEXT NOT NULL DEFAULT 'running',
|
|
89887
89904
|
permission_mode TEXT DEFAULT 'edit',
|
|
89888
89905
|
agent_type TEXT DEFAULT 'claude-code',
|
|
89889
|
-
created_at
|
|
89890
|
-
updated_at
|
|
89906
|
+
created_at TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%f', 'now')),
|
|
89907
|
+
updated_at TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%f', 'now')),
|
|
89891
89908
|
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
|
|
89892
89909
|
);
|
|
89893
89910
|
INSERT INTO agent_sessions_new (id, project_id, branch, status, permission_mode, agent_type, created_at, updated_at)
|
|
@@ -89895,10 +89912,6 @@ var createDatabase = (dbPath) => {
|
|
|
89895
89912
|
FROM agent_sessions;
|
|
89896
89913
|
DROP TABLE agent_sessions;
|
|
89897
89914
|
ALTER TABLE agent_sessions_new RENAME TO agent_sessions;
|
|
89898
|
-
CREATE INDEX IF NOT EXISTS idx_agent_sessions_project_branch
|
|
89899
|
-
ON agent_sessions(project_id, branch);
|
|
89900
|
-
CREATE INDEX IF NOT EXISTS idx_agent_sessions_updated_at
|
|
89901
|
-
ON agent_sessions(updated_at DESC);
|
|
89902
89915
|
COMMIT;
|
|
89903
89916
|
`);
|
|
89904
89917
|
}
|
|
@@ -89906,6 +89919,12 @@ var createDatabase = (dbPath) => {
|
|
|
89906
89919
|
if (!sessionInfoV4.some((col) => col.name === "title")) {
|
|
89907
89920
|
db.exec("ALTER TABLE agent_sessions ADD COLUMN title TEXT DEFAULT NULL");
|
|
89908
89921
|
}
|
|
89922
|
+
db.exec(`
|
|
89923
|
+
CREATE INDEX IF NOT EXISTS idx_agent_sessions_project_branch
|
|
89924
|
+
ON agent_sessions(project_id, branch);
|
|
89925
|
+
CREATE INDEX IF NOT EXISTS idx_agent_sessions_updated_at
|
|
89926
|
+
ON agent_sessions(updated_at DESC);
|
|
89927
|
+
`);
|
|
89909
89928
|
const processTableInfo = db.prepare("PRAGMA table_info(executor_processes)").all();
|
|
89910
89929
|
if (!processTableInfo.some((col) => col.name === "pid")) {
|
|
89911
89930
|
db.exec("ALTER TABLE executor_processes ADD COLUMN pid INTEGER");
|
|
@@ -90580,10 +90599,15 @@ var createSqliteStorage = async (dbPath) => {
|
|
|
90580
90599
|
}
|
|
90581
90600
|
},
|
|
90582
90601
|
agentSessions: {
|
|
90602
|
+
// Millisecond-precision timestamps are set explicitly here (and in the
|
|
90603
|
+
// UPDATE statements below) so existing databases whose DEFAULTs still
|
|
90604
|
+
// resolve to CURRENT_TIMESTAMP also get sub-second writes — this is
|
|
90605
|
+
// what lets getLatestByBranch break ties deterministically.
|
|
90583
90606
|
create: ({ id, project_id, branch, permission_mode, agent_type }) => {
|
|
90584
90607
|
db.prepare(
|
|
90585
|
-
`INSERT INTO agent_sessions (id, project_id, branch, status, permission_mode, agent_type)
|
|
90586
|
-
VALUES (@id, @project_id, @branch, 'running', @permission_mode, @agent_type
|
|
90608
|
+
`INSERT INTO agent_sessions (id, project_id, branch, status, permission_mode, agent_type, created_at, updated_at)
|
|
90609
|
+
VALUES (@id, @project_id, @branch, 'running', @permission_mode, @agent_type,
|
|
90610
|
+
strftime('%Y-%m-%d %H:%M:%f', 'now'), strftime('%Y-%m-%d %H:%M:%f', 'now'))`
|
|
90587
90611
|
).run({ id, project_id, branch, permission_mode: permission_mode ?? "edit", agent_type: agent_type ?? "claude-code" });
|
|
90588
90612
|
return db.prepare(`SELECT * FROM agent_sessions WHERE id = @id`).get({ id });
|
|
90589
90613
|
},
|
|
@@ -90607,32 +90631,37 @@ var createSqliteStorage = async (dbPath) => {
|
|
|
90607
90631
|
listByBranch: (projectId, branch) => {
|
|
90608
90632
|
return db.prepare(
|
|
90609
90633
|
`SELECT * FROM agent_sessions WHERE project_id = @project_id AND branch = @branch
|
|
90610
|
-
ORDER BY updated_at DESC`
|
|
90634
|
+
ORDER BY updated_at DESC, created_at DESC`
|
|
90611
90635
|
).all({ project_id: projectId, branch });
|
|
90612
90636
|
},
|
|
90613
90637
|
getLatestByBranch: (projectId, branch) => {
|
|
90614
90638
|
return db.prepare(
|
|
90615
90639
|
`SELECT * FROM agent_sessions WHERE project_id = @project_id AND branch = @branch
|
|
90616
|
-
ORDER BY updated_at DESC LIMIT 1`
|
|
90640
|
+
ORDER BY updated_at DESC, created_at DESC LIMIT 1`
|
|
90617
90641
|
).get({ project_id: projectId, branch });
|
|
90618
90642
|
},
|
|
90619
90643
|
updateStatus: (id, status) => {
|
|
90620
90644
|
db.prepare(
|
|
90621
|
-
`UPDATE agent_sessions SET status = @status, updated_at =
|
|
90645
|
+
`UPDATE agent_sessions SET status = @status, updated_at = strftime('%Y-%m-%d %H:%M:%f', 'now') WHERE id = @id`
|
|
90646
|
+
).run({ id, status });
|
|
90647
|
+
},
|
|
90648
|
+
updateStatusPreservingTimestamp: (id, status) => {
|
|
90649
|
+
db.prepare(
|
|
90650
|
+
`UPDATE agent_sessions SET status = @status WHERE id = @id`
|
|
90622
90651
|
).run({ id, status });
|
|
90623
90652
|
},
|
|
90624
90653
|
updatePermissionMode: (id, mode) => {
|
|
90625
90654
|
db.prepare(
|
|
90626
|
-
`UPDATE agent_sessions SET permission_mode = @mode, updated_at =
|
|
90655
|
+
`UPDATE agent_sessions SET permission_mode = @mode, updated_at = strftime('%Y-%m-%d %H:%M:%f', 'now') WHERE id = @id`
|
|
90627
90656
|
).run({ id, mode });
|
|
90628
90657
|
},
|
|
90629
90658
|
updateTitle: (id, title) => {
|
|
90630
90659
|
db.prepare(
|
|
90631
|
-
`UPDATE agent_sessions SET title = @title, updated_at =
|
|
90660
|
+
`UPDATE agent_sessions SET title = @title, updated_at = strftime('%Y-%m-%d %H:%M:%f', 'now') WHERE id = @id`
|
|
90632
90661
|
).run({ id, title });
|
|
90633
90662
|
},
|
|
90634
90663
|
touchUpdatedAt: (id) => {
|
|
90635
|
-
db.prepare(`UPDATE agent_sessions SET updated_at =
|
|
90664
|
+
db.prepare(`UPDATE agent_sessions SET updated_at = strftime('%Y-%m-%d %H:%M:%f', 'now') WHERE id = @id`).run({ id });
|
|
90636
90665
|
},
|
|
90637
90666
|
delete: (id) => {
|
|
90638
90667
|
db.prepare(`DELETE FROM agent_sessions WHERE id = @id`).run({ id });
|
|
@@ -90658,6 +90687,33 @@ var createSqliteStorage = async (dbPath) => {
|
|
|
90658
90687
|
).all({});
|
|
90659
90688
|
}
|
|
90660
90689
|
},
|
|
90690
|
+
remoteSessionMappings: {
|
|
90691
|
+
upsert: (localSessionId, projectId, remoteServerId, remoteSessionId, branch) => {
|
|
90692
|
+
db.prepare(
|
|
90693
|
+
`INSERT INTO remote_session_mappings (local_session_id, project_id, remote_server_id, remote_session_id, branch)
|
|
90694
|
+
VALUES (@local_session_id, @project_id, @remote_server_id, @remote_session_id, @branch)
|
|
90695
|
+
ON CONFLICT(local_session_id) DO UPDATE SET
|
|
90696
|
+
project_id = @project_id,
|
|
90697
|
+
remote_server_id = @remote_server_id,
|
|
90698
|
+
remote_session_id = @remote_session_id,
|
|
90699
|
+
branch = @branch`
|
|
90700
|
+
).run({
|
|
90701
|
+
local_session_id: localSessionId,
|
|
90702
|
+
project_id: projectId,
|
|
90703
|
+
remote_server_id: remoteServerId,
|
|
90704
|
+
remote_session_id: remoteSessionId,
|
|
90705
|
+
branch
|
|
90706
|
+
});
|
|
90707
|
+
},
|
|
90708
|
+
getAll: () => {
|
|
90709
|
+
return db.prepare(
|
|
90710
|
+
`SELECT local_session_id, project_id, remote_server_id, remote_session_id, branch FROM remote_session_mappings`
|
|
90711
|
+
).all({});
|
|
90712
|
+
},
|
|
90713
|
+
delete: (localSessionId) => {
|
|
90714
|
+
db.prepare(`DELETE FROM remote_session_mappings WHERE local_session_id = @id`).run({ id: localSessionId });
|
|
90715
|
+
}
|
|
90716
|
+
},
|
|
90661
90717
|
settings: {
|
|
90662
90718
|
get: (key) => {
|
|
90663
90719
|
const row = db.prepare(`SELECT value FROM global_settings WHERE key = @key`).get({ key });
|
|
@@ -90872,7 +90928,7 @@ var createSqliteStorage = async (dbPath) => {
|
|
|
90872
90928
|
var import_fastify = __toESM(require_fastify(), 1);
|
|
90873
90929
|
var import_static = __toESM(require_static(), 1);
|
|
90874
90930
|
var import_websocket2 = __toESM(require_websocket2(), 1);
|
|
90875
|
-
import
|
|
90931
|
+
import path9 from "path";
|
|
90876
90932
|
import { fileURLToPath } from "url";
|
|
90877
90933
|
|
|
90878
90934
|
// src/plugins/shared-services.ts
|
|
@@ -90928,10 +90984,10 @@ var ProcessManager = class {
|
|
|
90928
90984
|
encoding: "utf-8",
|
|
90929
90985
|
stdio: ["pipe", "pipe", "ignore"]
|
|
90930
90986
|
}).trim();
|
|
90931
|
-
const
|
|
90932
|
-
this.binaryCache.set(name25,
|
|
90987
|
+
const path13 = result || null;
|
|
90988
|
+
this.binaryCache.set(name25, path13);
|
|
90933
90989
|
console.log(`[ProcessManager] ${name25} binary found: ${result}`);
|
|
90934
|
-
return
|
|
90990
|
+
return path13;
|
|
90935
90991
|
} catch {
|
|
90936
90992
|
this.binaryCache.set(name25, null);
|
|
90937
90993
|
console.log(`[ProcessManager] ${name25} binary not found, will use npx`);
|
|
@@ -92430,13 +92486,16 @@ var AgentSessionManager = class {
|
|
|
92430
92486
|
* 3. No match anywhere → create a brand new session.
|
|
92431
92487
|
*/
|
|
92432
92488
|
getOrCreateSession(projectId, branch, projectPath, skipDb = false, permissionMode = "edit", agentType = "claude-code") {
|
|
92489
|
+
console.log(`[getOrCreate] ENTER projectId=${projectId} branch=${branch ?? "<null>"} skipDb=${skipDb} sessionsMapSize=${this.sessions.size}`);
|
|
92433
92490
|
if (!skipDb) {
|
|
92434
92491
|
const latestDbRow = this.storage.agentSessions.getLatestByBranch(
|
|
92435
92492
|
projectId,
|
|
92436
92493
|
branch ?? ""
|
|
92437
92494
|
);
|
|
92495
|
+
console.log(`[getOrCreate] DB latestByBranch(${projectId}, ${branch ?? ""}) \u2192 ${latestDbRow ? `id=${latestDbRow.id} status=${latestDbRow.status} updatedAt=${latestDbRow.updated_at}` : "NONE"}`);
|
|
92438
92496
|
if (latestDbRow) {
|
|
92439
92497
|
const inMemory = this.sessions.get(latestDbRow.id);
|
|
92498
|
+
console.log(`[getOrCreate] inMemory lookup for ${latestDbRow.id} \u2192 ${inMemory ? `FOUND (dormant=${inMemory.dormant}, status=${inMemory.status}, entries=${inMemory.store.entries.filter(Boolean).length}, processAlive=${inMemory.process != null && inMemory.process.exitCode === null})` : "NOT FOUND \u2014 will fall through to create NEW"}`);
|
|
92440
92499
|
if (inMemory) {
|
|
92441
92500
|
return this.reuseExistingSession(inMemory, projectPath, permissionMode);
|
|
92442
92501
|
}
|
|
@@ -92444,9 +92503,11 @@ var AgentSessionManager = class {
|
|
|
92444
92503
|
} else {
|
|
92445
92504
|
for (const session of this.sessions.values()) {
|
|
92446
92505
|
if (session.projectId === projectId && session.branch === branch) {
|
|
92506
|
+
console.log(`[getOrCreate] skipDb in-memory match: ${session.id} (entries=${session.store.entries.filter(Boolean).length})`);
|
|
92447
92507
|
return this.reuseExistingSession(session, projectPath, permissionMode);
|
|
92448
92508
|
}
|
|
92449
92509
|
}
|
|
92510
|
+
console.log(`[getOrCreate] skipDb: no in-memory match, will create NEW`);
|
|
92450
92511
|
}
|
|
92451
92512
|
const sessionId = randomUUID();
|
|
92452
92513
|
console.log(`[AgentSession] Creating new session ${sessionId}`);
|
|
@@ -92494,6 +92555,11 @@ var AgentSessionManager = class {
|
|
|
92494
92555
|
* Used by "New Conversation" flow where the user explicitly wants a fresh conversation.
|
|
92495
92556
|
*/
|
|
92496
92557
|
createNewSession(projectId, branch, projectPath, skipDb = false, permissionMode = "edit", agentType = "claude-code") {
|
|
92558
|
+
const existing = this.getSessionByBranch(projectId, branch);
|
|
92559
|
+
if (existing && !existing.dormant) {
|
|
92560
|
+
console.log(`[AgentSession] createNewSession: stopping prior session ${existing.id} on same branch to prevent process leak`);
|
|
92561
|
+
this.stopSession(existing.id);
|
|
92562
|
+
}
|
|
92497
92563
|
const sessionId = randomUUID();
|
|
92498
92564
|
const branchKey = branch ?? "";
|
|
92499
92565
|
const absoluteWorktreePath = resolveWorktreePath(projectPath, branch);
|
|
@@ -92538,12 +92604,15 @@ var AgentSessionManager = class {
|
|
|
92538
92604
|
/**
|
|
92539
92605
|
* Handle reuse of an existing in-memory session found by getOrCreateSession:
|
|
92540
92606
|
* - dormant: update permission mode if differs (no respawn — wakes lazily)
|
|
92541
|
-
* - running
|
|
92542
|
-
*
|
|
92543
|
-
*
|
|
92607
|
+
* - running OR process alive (stream-json between-turns: status="stopped"
|
|
92608
|
+
* but the CLI is still waiting on stdin): switchMode if mode differs,
|
|
92609
|
+
* leave entries intact
|
|
92610
|
+
* - process actually dead: restart the process so callers always get a
|
|
92611
|
+
* running session
|
|
92544
92612
|
* Returns the session id.
|
|
92545
92613
|
*/
|
|
92546
92614
|
reuseExistingSession(session, projectPath, permissionMode) {
|
|
92615
|
+
const entriesCount = session.store.entries.filter(Boolean).length;
|
|
92547
92616
|
if (session.dormant) {
|
|
92548
92617
|
if (session.permissionMode !== permissionMode) {
|
|
92549
92618
|
session.permissionMode = permissionMode;
|
|
@@ -92551,18 +92620,19 @@ var AgentSessionManager = class {
|
|
|
92551
92620
|
this.storage.agentSessions.updatePermissionMode(session.id, permissionMode);
|
|
92552
92621
|
}
|
|
92553
92622
|
}
|
|
92554
|
-
console.log(`[AgentSession] Returning dormant session ${session.id}`);
|
|
92623
|
+
console.log(`[AgentSession] Returning dormant session ${session.id} (entries=${entriesCount})`);
|
|
92555
92624
|
return session.id;
|
|
92556
92625
|
}
|
|
92557
|
-
|
|
92626
|
+
const processAlive = session.process != null && session.process.exitCode === null;
|
|
92627
|
+
if (session.status === "running" || processAlive) {
|
|
92558
92628
|
if (session.permissionMode !== permissionMode) {
|
|
92559
92629
|
console.log(`[AgentSession] Session ${session.id} exists with mode ${session.permissionMode}, switching to ${permissionMode}`);
|
|
92560
92630
|
this.switchMode(session.id, projectPath, permissionMode);
|
|
92561
92631
|
}
|
|
92562
|
-
console.log(`[AgentSession] Returning existing session ${session.id}`);
|
|
92632
|
+
console.log(`[AgentSession] Returning existing session ${session.id} (status=${session.status}, processAlive=${processAlive}, entries=${entriesCount})`);
|
|
92563
92633
|
return session.id;
|
|
92564
92634
|
}
|
|
92565
|
-
console.log(`[AgentSession] Session ${session.id} is ${session.status}, restarting`);
|
|
92635
|
+
console.log(`[AgentSession] Session ${session.id} is ${session.status} (entries=${entriesCount} \u2014 WILL BE CLEARED), restarting`);
|
|
92566
92636
|
this.restartSession(session.id, projectPath);
|
|
92567
92637
|
return session.id;
|
|
92568
92638
|
}
|
|
@@ -92762,6 +92832,7 @@ var AgentSessionManager = class {
|
|
|
92762
92832
|
}, true);
|
|
92763
92833
|
break;
|
|
92764
92834
|
case "result":
|
|
92835
|
+
console.log(`[Agent:result] sessionId=${sessionId} subtype=${event.subtype} prevStatus=${session.status}`);
|
|
92765
92836
|
this.finalizeStreamingEntry(session);
|
|
92766
92837
|
session.store.currentAssistantIndex = null;
|
|
92767
92838
|
if (event.subtype === "error" && event.error) {
|
|
@@ -92791,6 +92862,12 @@ var AgentSessionManager = class {
|
|
|
92791
92862
|
input_tokens: event.input_tokens,
|
|
92792
92863
|
output_tokens: event.output_tokens
|
|
92793
92864
|
});
|
|
92865
|
+
if (session.status !== "stopped") {
|
|
92866
|
+
session.status = "stopped";
|
|
92867
|
+
if (!session.skipDb) this.storage.agentSessions.updateStatus(sessionId, "stopped");
|
|
92868
|
+
this.broadcastPatch(sessionId, ConversationPatch.updateStatus("stopped"));
|
|
92869
|
+
this.eventBus?.emit({ type: "session:status", projectId: session.projectId, branch: session.branch, sessionId, status: "stopped" });
|
|
92870
|
+
}
|
|
92794
92871
|
const tasks = this.storage.tasks.getByProjectId(session.projectId);
|
|
92795
92872
|
const branchKey = session.branch ?? "";
|
|
92796
92873
|
const assignedTask = tasks.find((t) => t.assigned_branch === branchKey);
|
|
@@ -92927,9 +93004,15 @@ var AgentSessionManager = class {
|
|
|
92927
93004
|
this.wakeDormantSession(session, projectPath, content);
|
|
92928
93005
|
return true;
|
|
92929
93006
|
}
|
|
92930
|
-
if (session.
|
|
93007
|
+
if (!session.process?.stdin) {
|
|
92931
93008
|
return false;
|
|
92932
93009
|
}
|
|
93010
|
+
if (session.status !== "running") {
|
|
93011
|
+
session.status = "running";
|
|
93012
|
+
if (!session.skipDb) this.storage.agentSessions.updateStatus(sessionId, "running");
|
|
93013
|
+
this.broadcastPatch(sessionId, ConversationPatch.updateStatus("running"));
|
|
93014
|
+
this.eventBus?.emit({ type: "session:status", projectId: session.projectId, branch: session.branch, sessionId, status: "running" });
|
|
93015
|
+
}
|
|
92933
93016
|
this.finalizeStreamingEntry(session);
|
|
92934
93017
|
session.store.currentAssistantIndex = null;
|
|
92935
93018
|
this.pushEntry(sessionId, {
|
|
@@ -92940,7 +93023,7 @@ var AgentSessionManager = class {
|
|
|
92940
93023
|
try {
|
|
92941
93024
|
const provider = getProvider(session.agentType);
|
|
92942
93025
|
const formatted = provider.formatUserInput(content, session.id);
|
|
92943
|
-
session.process
|
|
93026
|
+
session.process.stdin.write(formatted);
|
|
92944
93027
|
return true;
|
|
92945
93028
|
} catch (error48) {
|
|
92946
93029
|
console.error(`[AgentSession] Failed to send message:`, error48);
|
|
@@ -92982,8 +93065,7 @@ var AgentSessionManager = class {
|
|
|
92982
93065
|
ws.send(JSON.stringify(msg));
|
|
92983
93066
|
}
|
|
92984
93067
|
ws.send(JSON.stringify({ Ready: true }));
|
|
92985
|
-
const
|
|
92986
|
-
const statusPatch = ConversationPatch.updateStatus(effectiveStatus);
|
|
93068
|
+
const statusPatch = ConversationPatch.updateStatus(session.status);
|
|
92987
93069
|
ws.send(JSON.stringify({ JsonPatch: statusPatch }));
|
|
92988
93070
|
return () => {
|
|
92989
93071
|
session.subscribers.delete(ws);
|
|
@@ -93319,7 +93401,7 @@ var AgentSessionManager = class {
|
|
|
93319
93401
|
agentType: dbSession.agent_type || "claude-code"
|
|
93320
93402
|
};
|
|
93321
93403
|
this.sessions.set(dbSession.id, runningSession);
|
|
93322
|
-
this.storage.agentSessions.
|
|
93404
|
+
this.storage.agentSessions.updateStatusPreservingTimestamp(dbSession.id, "stopped");
|
|
93323
93405
|
restoredCount++;
|
|
93324
93406
|
}
|
|
93325
93407
|
if (restoredCount > 0) {
|
|
@@ -93343,6 +93425,15 @@ var AgentSessionManager = class {
|
|
|
93343
93425
|
* Broadcast a JSON patch to all subscribers
|
|
93344
93426
|
*/
|
|
93345
93427
|
broadcastPatch(sessionId, patch) {
|
|
93428
|
+
const statusOp = patch.find((p) => p.path === "/status");
|
|
93429
|
+
if (statusOp) {
|
|
93430
|
+
const session = this.sessions.get(sessionId);
|
|
93431
|
+
console.log(
|
|
93432
|
+
`[Agent:broadcastPatch] ${sessionId} /status \u2192`,
|
|
93433
|
+
statusOp.value?.content,
|
|
93434
|
+
`subs=${session?.subscribers.size ?? 0}`
|
|
93435
|
+
);
|
|
93436
|
+
}
|
|
93346
93437
|
const msg = { JsonPatch: patch };
|
|
93347
93438
|
this.broadcastRaw(sessionId, msg);
|
|
93348
93439
|
}
|
|
@@ -94479,10 +94570,10 @@ function mergeDefs(...defs) {
|
|
|
94479
94570
|
function cloneDef(schema) {
|
|
94480
94571
|
return mergeDefs(schema._zod.def);
|
|
94481
94572
|
}
|
|
94482
|
-
function getElementAtPath(obj,
|
|
94483
|
-
if (!
|
|
94573
|
+
function getElementAtPath(obj, path13) {
|
|
94574
|
+
if (!path13)
|
|
94484
94575
|
return obj;
|
|
94485
|
-
return
|
|
94576
|
+
return path13.reduce((acc, key) => acc?.[key], obj);
|
|
94486
94577
|
}
|
|
94487
94578
|
function promiseAllObject(promisesObj) {
|
|
94488
94579
|
const keys = Object.keys(promisesObj);
|
|
@@ -94865,11 +94956,11 @@ function aborted(x, startIndex = 0) {
|
|
|
94865
94956
|
}
|
|
94866
94957
|
return false;
|
|
94867
94958
|
}
|
|
94868
|
-
function prefixIssues(
|
|
94959
|
+
function prefixIssues(path13, issues) {
|
|
94869
94960
|
return issues.map((iss) => {
|
|
94870
94961
|
var _a25;
|
|
94871
94962
|
(_a25 = iss).path ?? (_a25.path = []);
|
|
94872
|
-
iss.path.unshift(
|
|
94963
|
+
iss.path.unshift(path13);
|
|
94873
94964
|
return iss;
|
|
94874
94965
|
});
|
|
94875
94966
|
}
|
|
@@ -95052,7 +95143,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
|
|
|
95052
95143
|
}
|
|
95053
95144
|
function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
95054
95145
|
const result = { errors: [] };
|
|
95055
|
-
const processError = (error49,
|
|
95146
|
+
const processError = (error49, path13 = []) => {
|
|
95056
95147
|
var _a25, _b18;
|
|
95057
95148
|
for (const issue2 of error49.issues) {
|
|
95058
95149
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -95062,7 +95153,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
95062
95153
|
} else if (issue2.code === "invalid_element") {
|
|
95063
95154
|
processError({ issues: issue2.issues }, issue2.path);
|
|
95064
95155
|
} else {
|
|
95065
|
-
const fullpath = [...
|
|
95156
|
+
const fullpath = [...path13, ...issue2.path];
|
|
95066
95157
|
if (fullpath.length === 0) {
|
|
95067
95158
|
result.errors.push(mapper(issue2));
|
|
95068
95159
|
continue;
|
|
@@ -95094,8 +95185,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
95094
95185
|
}
|
|
95095
95186
|
function toDotPath(_path) {
|
|
95096
95187
|
const segs = [];
|
|
95097
|
-
const
|
|
95098
|
-
for (const seg of
|
|
95188
|
+
const path13 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
95189
|
+
for (const seg of path13) {
|
|
95099
95190
|
if (typeof seg === "number")
|
|
95100
95191
|
segs.push(`[${seg}]`);
|
|
95101
95192
|
else if (typeof seg === "symbol")
|
|
@@ -107072,13 +107163,13 @@ function resolveRef(ref, ctx) {
|
|
|
107072
107163
|
if (!ref.startsWith("#")) {
|
|
107073
107164
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
107074
107165
|
}
|
|
107075
|
-
const
|
|
107076
|
-
if (
|
|
107166
|
+
const path13 = ref.slice(1).split("/").filter(Boolean);
|
|
107167
|
+
if (path13.length === 0) {
|
|
107077
107168
|
return ctx.rootSchema;
|
|
107078
107169
|
}
|
|
107079
107170
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
107080
|
-
if (
|
|
107081
|
-
const key =
|
|
107171
|
+
if (path13[0] === defsKey) {
|
|
107172
|
+
const key = path13[1];
|
|
107082
107173
|
if (!key || !ctx.defs[key]) {
|
|
107083
107174
|
throw new Error(`Reference not found: ${ref}`);
|
|
107084
107175
|
}
|
|
@@ -107839,8 +107930,8 @@ function getErrorMap2() {
|
|
|
107839
107930
|
|
|
107840
107931
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/helpers/parseUtil.js
|
|
107841
107932
|
var makeIssue = (params) => {
|
|
107842
|
-
const { data, path:
|
|
107843
|
-
const fullPath = [...
|
|
107933
|
+
const { data, path: path13, errorMaps, issueData } = params;
|
|
107934
|
+
const fullPath = [...path13, ...issueData.path || []];
|
|
107844
107935
|
const fullIssue = {
|
|
107845
107936
|
...issueData,
|
|
107846
107937
|
path: fullPath
|
|
@@ -107955,11 +108046,11 @@ var errorUtil;
|
|
|
107955
108046
|
|
|
107956
108047
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v3/types.js
|
|
107957
108048
|
var ParseInputLazyPath = class {
|
|
107958
|
-
constructor(parent, value,
|
|
108049
|
+
constructor(parent, value, path13, key) {
|
|
107959
108050
|
this._cachedPath = [];
|
|
107960
108051
|
this.parent = parent;
|
|
107961
108052
|
this.data = value;
|
|
107962
|
-
this._path =
|
|
108053
|
+
this._path = path13;
|
|
107963
108054
|
this._key = key;
|
|
107964
108055
|
}
|
|
107965
108056
|
get path() {
|
|
@@ -123863,7 +123954,7 @@ function createDeepSeek(options = {}) {
|
|
|
123863
123954
|
const createLanguageModel = (modelId) => {
|
|
123864
123955
|
return new DeepSeekChatLanguageModel(modelId, {
|
|
123865
123956
|
provider: `deepseek.chat`,
|
|
123866
|
-
url: ({ path:
|
|
123957
|
+
url: ({ path: path13 }) => `${baseURL}${path13}`,
|
|
123867
123958
|
headers: getHeaders,
|
|
123868
123959
|
fetch: options.fetch
|
|
123869
123960
|
});
|
|
@@ -128571,7 +128662,7 @@ function createOpenRouter(options = {}) {
|
|
|
128571
128662
|
);
|
|
128572
128663
|
const createChatModel = (modelId, settings = {}) => new OpenRouterChatLanguageModel(modelId, settings, {
|
|
128573
128664
|
provider: "openrouter.chat",
|
|
128574
|
-
url: ({ path:
|
|
128665
|
+
url: ({ path: path13 }) => `${baseURL}${path13}`,
|
|
128575
128666
|
headers: getHeaders,
|
|
128576
128667
|
compatibility,
|
|
128577
128668
|
fetch: options.fetch,
|
|
@@ -128579,7 +128670,7 @@ function createOpenRouter(options = {}) {
|
|
|
128579
128670
|
});
|
|
128580
128671
|
const createCompletionModel = (modelId, settings = {}) => new OpenRouterCompletionLanguageModel(modelId, settings, {
|
|
128581
128672
|
provider: "openrouter.completion",
|
|
128582
|
-
url: ({ path:
|
|
128673
|
+
url: ({ path: path13 }) => `${baseURL}${path13}`,
|
|
128583
128674
|
headers: getHeaders,
|
|
128584
128675
|
compatibility,
|
|
128585
128676
|
fetch: options.fetch,
|
|
@@ -128587,14 +128678,14 @@ function createOpenRouter(options = {}) {
|
|
|
128587
128678
|
});
|
|
128588
128679
|
const createEmbeddingModel = (modelId, settings = {}) => new OpenRouterEmbeddingModel(modelId, settings, {
|
|
128589
128680
|
provider: "openrouter.embedding",
|
|
128590
|
-
url: ({ path:
|
|
128681
|
+
url: ({ path: path13 }) => `${baseURL}${path13}`,
|
|
128591
128682
|
headers: getHeaders,
|
|
128592
128683
|
fetch: options.fetch,
|
|
128593
128684
|
extraBody: options.extraBody
|
|
128594
128685
|
});
|
|
128595
128686
|
const createImageModel = (modelId, settings = {}) => new OpenRouterImageModel(modelId, settings, {
|
|
128596
128687
|
provider: "openrouter.image",
|
|
128597
|
-
url: ({ path:
|
|
128688
|
+
url: ({ path: path13 }) => `${baseURL}${path13}`,
|
|
128598
128689
|
headers: getHeaders,
|
|
128599
128690
|
fetch: options.fetch,
|
|
128600
128691
|
extraBody: options.extraBody
|
|
@@ -130742,7 +130833,7 @@ var ReverseConnectManager = class {
|
|
|
130742
130833
|
const conn = this.connections.get(this.resolveId(remoteServerId));
|
|
130743
130834
|
return conn !== void 0 && conn.ws.readyState === 1;
|
|
130744
130835
|
}
|
|
130745
|
-
async sendHttpRequest(remoteServerId, method,
|
|
130836
|
+
async sendHttpRequest(remoteServerId, method, path13, body, timeoutMs = DEFAULT_HTTP_TIMEOUT_MS) {
|
|
130746
130837
|
const conn = this.connections.get(this.resolveId(remoteServerId));
|
|
130747
130838
|
if (!conn || conn.ws.readyState !== 1) {
|
|
130748
130839
|
return {
|
|
@@ -130757,7 +130848,7 @@ var ReverseConnectManager = class {
|
|
|
130757
130848
|
type: "http_request",
|
|
130758
130849
|
requestId,
|
|
130759
130850
|
method,
|
|
130760
|
-
path:
|
|
130851
|
+
path: path13,
|
|
130761
130852
|
headers: body !== void 0 ? { "content-type": "application/json" } : {},
|
|
130762
130853
|
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
130763
130854
|
};
|
|
@@ -130779,7 +130870,7 @@ var ReverseConnectManager = class {
|
|
|
130779
130870
|
* Send an HTTP request and return the raw response (body as string, headers intact).
|
|
130780
130871
|
* Used by the browser proxy to forward HTML/CSS/JS without JSON parsing.
|
|
130781
130872
|
*/
|
|
130782
|
-
async sendRawHttpRequest(remoteServerId, method,
|
|
130873
|
+
async sendRawHttpRequest(remoteServerId, method, path13, headers, body, timeoutMs = DEFAULT_HTTP_TIMEOUT_MS, port) {
|
|
130783
130874
|
const conn = this.connections.get(this.resolveId(remoteServerId));
|
|
130784
130875
|
if (!conn || conn.ws.readyState !== 1) {
|
|
130785
130876
|
return { ok: false, status: 0, headers: {}, body: "" };
|
|
@@ -130789,7 +130880,7 @@ var ReverseConnectManager = class {
|
|
|
130789
130880
|
type: "http_request",
|
|
130790
130881
|
requestId,
|
|
130791
130882
|
method,
|
|
130792
|
-
path:
|
|
130883
|
+
path: path13,
|
|
130793
130884
|
headers: headers ?? {},
|
|
130794
130885
|
body,
|
|
130795
130886
|
port
|
|
@@ -130803,10 +130894,10 @@ var ReverseConnectManager = class {
|
|
|
130803
130894
|
conn.ws.send(JSON.stringify(frame));
|
|
130804
130895
|
});
|
|
130805
130896
|
}
|
|
130806
|
-
openVirtualChannel(remoteServerId, channelId,
|
|
130897
|
+
openVirtualChannel(remoteServerId, channelId, path13, query) {
|
|
130807
130898
|
const conn = this.connections.get(this.resolveId(remoteServerId));
|
|
130808
130899
|
if (!conn || conn.ws.readyState !== 1) return;
|
|
130809
|
-
const frame = { type: "ws_open", channelId, path:
|
|
130900
|
+
const frame = { type: "ws_open", channelId, path: path13, query };
|
|
130810
130901
|
conn.ws.send(JSON.stringify(frame));
|
|
130811
130902
|
}
|
|
130812
130903
|
sendChannelData(remoteServerId, channelId, data) {
|
|
@@ -131118,6 +131209,24 @@ var sharedServices = async (fastify2, opts) => {
|
|
|
131118
131209
|
agentSessionManager.restoreSessionsFromDb();
|
|
131119
131210
|
const remoteExecutorMap = /* @__PURE__ */ new Map();
|
|
131120
131211
|
const remoteSessionMap = /* @__PURE__ */ new Map();
|
|
131212
|
+
for (const row of opts.storage.remoteSessionMappings.getAll()) {
|
|
131213
|
+
const remote = opts.storage.projectRemotes.getByProjectAndServer(
|
|
131214
|
+
row.project_id,
|
|
131215
|
+
row.remote_server_id
|
|
131216
|
+
);
|
|
131217
|
+
if (!remote) {
|
|
131218
|
+
console.warn(`[SharedServices] Skipping remote_session_mappings row ${row.local_session_id}: project_remotes(${row.project_id}, ${row.remote_server_id}) not found`);
|
|
131219
|
+
continue;
|
|
131220
|
+
}
|
|
131221
|
+
remoteSessionMap.set(row.local_session_id, {
|
|
131222
|
+
remoteServerId: row.remote_server_id,
|
|
131223
|
+
remoteUrl: remote.server_url ?? "",
|
|
131224
|
+
remoteApiKey: remote.server_api_key || "",
|
|
131225
|
+
remoteSessionId: row.remote_session_id,
|
|
131226
|
+
branch: row.branch ?? null
|
|
131227
|
+
});
|
|
131228
|
+
}
|
|
131229
|
+
console.log(`[SharedServices] Hydrated ${remoteSessionMap.size} remote session mapping(s) from DB`);
|
|
131121
131230
|
const remotePatchCache = new RemotePatchCache();
|
|
131122
131231
|
const eventBus = new EventBus();
|
|
131123
131232
|
const proxyManager = new ProxyManager();
|
|
@@ -131257,14 +131366,14 @@ var selectFolder = async () => {
|
|
|
131257
131366
|
const { stdout } = await execAsync(
|
|
131258
131367
|
`osascript -e 'set folderPath to POSIX path of (choose folder with prompt "Select a project folder")' -e 'return folderPath'`
|
|
131259
131368
|
);
|
|
131260
|
-
const
|
|
131261
|
-
return
|
|
131369
|
+
const path13 = stdout.trim();
|
|
131370
|
+
return path13 || null;
|
|
131262
131371
|
} else if (os2 === "win32") {
|
|
131263
131372
|
const { stdout } = await execAsync(
|
|
131264
131373
|
`powershell -Command "Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.ShowDialog() | Out-Null; $f.SelectedPath"`
|
|
131265
131374
|
);
|
|
131266
|
-
const
|
|
131267
|
-
return
|
|
131375
|
+
const path13 = stdout.trim();
|
|
131376
|
+
return path13 || null;
|
|
131268
131377
|
} else {
|
|
131269
131378
|
try {
|
|
131270
131379
|
const { stdout } = await execAsync(
|
|
@@ -133408,6 +133517,31 @@ var file_routes_default = (0, import_fastify_plugin11.default)(routes10, { name:
|
|
|
133408
133517
|
|
|
133409
133518
|
// src/routes/agent-session-routes.ts
|
|
133410
133519
|
var import_fastify_plugin12 = __toESM(require_plugin2(), 1);
|
|
133520
|
+
|
|
133521
|
+
// src/utils/paste-file.ts
|
|
133522
|
+
import { chmod, mkdir as mkdir3, open } from "node:fs/promises";
|
|
133523
|
+
import { constants as fsConstants } from "node:fs";
|
|
133524
|
+
import { tmpdir } from "node:os";
|
|
133525
|
+
import path8 from "node:path";
|
|
133526
|
+
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
133527
|
+
var PASTE_DIR = path8.join(tmpdir(), "vibedeckx-pastes");
|
|
133528
|
+
var DIR_MODE = 448;
|
|
133529
|
+
var FILE_MODE = 384;
|
|
133530
|
+
var FILE_FLAGS = fsConstants.O_WRONLY | fsConstants.O_CREAT | fsConstants.O_EXCL | fsConstants.O_NOFOLLOW;
|
|
133531
|
+
async function writePasteToTempFile(content) {
|
|
133532
|
+
await mkdir3(PASTE_DIR, { recursive: true, mode: DIR_MODE });
|
|
133533
|
+
await chmod(PASTE_DIR, DIR_MODE);
|
|
133534
|
+
const filePath = path8.join(PASTE_DIR, `${randomUUID10()}.txt`);
|
|
133535
|
+
const handle = await open(filePath, FILE_FLAGS, FILE_MODE);
|
|
133536
|
+
try {
|
|
133537
|
+
await handle.writeFile(content, "utf8");
|
|
133538
|
+
} finally {
|
|
133539
|
+
await handle.close();
|
|
133540
|
+
}
|
|
133541
|
+
return { path: filePath, size: Buffer.byteLength(content, "utf8") };
|
|
133542
|
+
}
|
|
133543
|
+
|
|
133544
|
+
// src/routes/agent-session-routes.ts
|
|
133411
133545
|
function resolveProjectPath(projectId, storage) {
|
|
133412
133546
|
if (projectId.startsWith("path:")) {
|
|
133413
133547
|
return projectId.slice(5);
|
|
@@ -133415,6 +133549,15 @@ function resolveProjectPath(projectId, storage) {
|
|
|
133415
133549
|
const project = storage.projects.getById(projectId);
|
|
133416
133550
|
return project?.path ?? null;
|
|
133417
133551
|
}
|
|
133552
|
+
var MESSAGE_TEXT_CHAR_LIMIT = 64 * 1024;
|
|
133553
|
+
function messageTextLength(content) {
|
|
133554
|
+
if (typeof content === "string") return content.length;
|
|
133555
|
+
let n = 0;
|
|
133556
|
+
for (const part of content) {
|
|
133557
|
+
if (part.type === "text") n += part.text.length;
|
|
133558
|
+
}
|
|
133559
|
+
return n;
|
|
133560
|
+
}
|
|
133418
133561
|
var routes11 = async (fastify2) => {
|
|
133419
133562
|
function proxyAuto(remoteServerId, remoteUrl, remoteApiKey, method, apiPath, body) {
|
|
133420
133563
|
return proxyToRemoteAuto(remoteServerId, remoteUrl, remoteApiKey, method, apiPath, body, {
|
|
@@ -133466,7 +133609,8 @@ var routes11 = async (fastify2) => {
|
|
|
133466
133609
|
);
|
|
133467
133610
|
const session = fastify2.agentSessionManager.getSession(sessionId);
|
|
133468
133611
|
const messages = fastify2.agentSessionManager.getMessages(sessionId);
|
|
133469
|
-
const effectiveStatus = session?.
|
|
133612
|
+
const effectiveStatus = session?.status || "stopped";
|
|
133613
|
+
console.log(`[API] /api/path/agent-sessions RESPONSE: sessionId=${sessionId} status=${effectiveStatus} messages.length=${messages.length} (path=${projectPath}, branch=${branch ?? "<null>"}, pseudoProjectId=${pseudoProjectId})`);
|
|
133470
133614
|
return reply.code(200).send({
|
|
133471
133615
|
session: {
|
|
133472
133616
|
id: sessionId,
|
|
@@ -133578,11 +133722,26 @@ var routes11 = async (fastify2) => {
|
|
|
133578
133722
|
return reply.code(result.status || 502).send(result.data);
|
|
133579
133723
|
}
|
|
133580
133724
|
const data = result.data;
|
|
133581
|
-
const mapped = data.sessions.map((s2) =>
|
|
133582
|
-
|
|
133583
|
-
|
|
133584
|
-
|
|
133585
|
-
|
|
133725
|
+
const mapped = data.sessions.map((s2) => {
|
|
133726
|
+
const localSessionId = `remote-${project.agent_mode}-${project.id}-${s2.id}`;
|
|
133727
|
+
if (!fastify2.remoteSessionMap.has(localSessionId)) {
|
|
133728
|
+
fastify2.remoteSessionMap.set(localSessionId, {
|
|
133729
|
+
remoteServerId: project.agent_mode,
|
|
133730
|
+
remoteUrl: remoteConfig.server_url ?? "",
|
|
133731
|
+
remoteApiKey: remoteConfig.server_api_key || "",
|
|
133732
|
+
remoteSessionId: s2.id,
|
|
133733
|
+
branch: s2.branch ?? null
|
|
133734
|
+
});
|
|
133735
|
+
}
|
|
133736
|
+
fastify2.storage.remoteSessionMappings.upsert(
|
|
133737
|
+
localSessionId,
|
|
133738
|
+
project.id,
|
|
133739
|
+
project.agent_mode,
|
|
133740
|
+
s2.id,
|
|
133741
|
+
s2.branch ?? null
|
|
133742
|
+
);
|
|
133743
|
+
return { ...s2, id: localSessionId, entry_count: s2.entry_count ?? 0 };
|
|
133744
|
+
});
|
|
133586
133745
|
return reply.code(200).send({ sessions: mapped });
|
|
133587
133746
|
}
|
|
133588
133747
|
if (!project.path) {
|
|
@@ -133655,6 +133814,13 @@ var routes11 = async (fastify2) => {
|
|
|
133655
133814
|
remoteSessionId: remoteData.session.id,
|
|
133656
133815
|
branch: branch ?? null
|
|
133657
133816
|
});
|
|
133817
|
+
fastify2.storage.remoteSessionMappings.upsert(
|
|
133818
|
+
localSessionId,
|
|
133819
|
+
project.id,
|
|
133820
|
+
agentMode,
|
|
133821
|
+
remoteData.session.id,
|
|
133822
|
+
branch ?? null
|
|
133823
|
+
);
|
|
133658
133824
|
if (remoteData.messages && remoteData.messages.length > 0) {
|
|
133659
133825
|
const cacheEntry = fastify2.remotePatchCache.getOrCreate(localSessionId);
|
|
133660
133826
|
if (cacheEntry.messages.length === 0) {
|
|
@@ -133662,7 +133828,12 @@ var routes11 = async (fastify2) => {
|
|
|
133662
133828
|
const patch = ConversationPatch.addEntry(i, remoteData.messages[i]);
|
|
133663
133829
|
fastify2.remotePatchCache.appendMessage(localSessionId, JSON.stringify({ JsonPatch: patch }), true);
|
|
133664
133830
|
}
|
|
133831
|
+
console.log(`[API] getOrCreate proxy: seeded cache with ${remoteData.messages.length} msgs for ${localSessionId}`);
|
|
133832
|
+
} else {
|
|
133833
|
+
console.log(`[API] getOrCreate proxy: cache already has ${cacheEntry.messages.length} msgs for ${localSessionId} (remote returned ${remoteData.messages.length}), skipping seed`);
|
|
133665
133834
|
}
|
|
133835
|
+
} else {
|
|
133836
|
+
console.log(`[API] getOrCreate proxy: remote returned 0 messages for ${localSessionId} \u2014 NOT seeding cache. Cache existing size=${fastify2.remotePatchCache.getOrCreate(localSessionId).messages.length}`);
|
|
133666
133837
|
}
|
|
133667
133838
|
return reply.code(200).send({
|
|
133668
133839
|
session: {
|
|
@@ -133694,7 +133865,7 @@ var routes11 = async (fastify2) => {
|
|
|
133694
133865
|
);
|
|
133695
133866
|
const session = fastify2.agentSessionManager.getSession(sessionId);
|
|
133696
133867
|
const messages = fastify2.agentSessionManager.getMessages(sessionId);
|
|
133697
|
-
const effectiveStatus = session?.
|
|
133868
|
+
const effectiveStatus = session?.status || "stopped";
|
|
133698
133869
|
return reply.code(200).send({
|
|
133699
133870
|
session: {
|
|
133700
133871
|
id: sessionId,
|
|
@@ -133745,6 +133916,13 @@ var routes11 = async (fastify2) => {
|
|
|
133745
133916
|
remoteSessionId: remoteData.session.id,
|
|
133746
133917
|
branch: branch ?? null
|
|
133747
133918
|
});
|
|
133919
|
+
fastify2.storage.remoteSessionMappings.upsert(
|
|
133920
|
+
localSessionId,
|
|
133921
|
+
project.id,
|
|
133922
|
+
agentMode,
|
|
133923
|
+
remoteData.session.id,
|
|
133924
|
+
branch ?? null
|
|
133925
|
+
);
|
|
133748
133926
|
if (remoteData.messages && remoteData.messages.length > 0) {
|
|
133749
133927
|
const cacheEntry = fastify2.remotePatchCache.getOrCreate(localSessionId);
|
|
133750
133928
|
if (cacheEntry.messages.length === 0) {
|
|
@@ -133809,7 +133987,14 @@ var routes11 = async (fastify2) => {
|
|
|
133809
133987
|
"GET",
|
|
133810
133988
|
`/api/agent-sessions/${remoteInfo.remoteSessionId}`
|
|
133811
133989
|
);
|
|
133812
|
-
|
|
133990
|
+
if (result.ok) {
|
|
133991
|
+
const remoteData = result.data;
|
|
133992
|
+
return reply.code(200).send({
|
|
133993
|
+
...remoteData,
|
|
133994
|
+
session: { ...remoteData.session, id: req.params.sessionId }
|
|
133995
|
+
});
|
|
133996
|
+
}
|
|
133997
|
+
return reply.code(result.status || 502).send(result.data);
|
|
133813
133998
|
}
|
|
133814
133999
|
const session = fastify2.agentSessionManager.getSession(req.params.sessionId);
|
|
133815
134000
|
if (!session) {
|
|
@@ -133837,6 +134022,12 @@ var routes11 = async (fastify2) => {
|
|
|
133837
134022
|
if (!isValidString && !isValidArray) {
|
|
133838
134023
|
return reply.code(400).send({ error: "Content is required" });
|
|
133839
134024
|
}
|
|
134025
|
+
const textLen = messageTextLength(content);
|
|
134026
|
+
if (textLen > MESSAGE_TEXT_CHAR_LIMIT) {
|
|
134027
|
+
return reply.code(413).send({
|
|
134028
|
+
error: `Message text exceeds ${MESSAGE_TEXT_CHAR_LIMIT} characters (got ${textLen}). Use /api/agent-sessions/:id/paste for long content.`
|
|
134029
|
+
});
|
|
134030
|
+
}
|
|
133840
134031
|
if (req.params.sessionId.startsWith("remote-")) {
|
|
133841
134032
|
const remoteInfo = fastify2.remoteSessionMap.get(req.params.sessionId);
|
|
133842
134033
|
if (!remoteInfo) {
|
|
@@ -133878,6 +134069,45 @@ var routes11 = async (fastify2) => {
|
|
|
133878
134069
|
}
|
|
133879
134070
|
return reply.code(200).send({ success: true });
|
|
133880
134071
|
});
|
|
134072
|
+
fastify2.post("/api/agent-sessions/:sessionId/paste", { bodyLimit: 10 * 1024 * 1024 }, async (req, reply) => {
|
|
134073
|
+
const { content } = req.body;
|
|
134074
|
+
if (typeof content !== "string" || content.length === 0) {
|
|
134075
|
+
return reply.code(400).send({ error: "content must be a non-empty string" });
|
|
134076
|
+
}
|
|
134077
|
+
if (req.params.sessionId.startsWith("remote-")) {
|
|
134078
|
+
const remoteInfo = fastify2.remoteSessionMap.get(req.params.sessionId);
|
|
134079
|
+
if (!remoteInfo) {
|
|
134080
|
+
return reply.code(404).send({ error: "Remote session not found" });
|
|
134081
|
+
}
|
|
134082
|
+
const result = await proxyAuto(
|
|
134083
|
+
remoteInfo.remoteServerId,
|
|
134084
|
+
remoteInfo.remoteUrl,
|
|
134085
|
+
remoteInfo.remoteApiKey,
|
|
134086
|
+
"POST",
|
|
134087
|
+
`/api/agent-sessions/${remoteInfo.remoteSessionId}/paste`,
|
|
134088
|
+
{ content }
|
|
134089
|
+
);
|
|
134090
|
+
if (!result.ok) {
|
|
134091
|
+
const status = result.status || 502;
|
|
134092
|
+
return reply.code(status).send({
|
|
134093
|
+
error: `Remote proxy failed: ${result.errorCode || "unknown"}`,
|
|
134094
|
+
errorCode: result.errorCode,
|
|
134095
|
+
attempts: result.attempts,
|
|
134096
|
+
totalDurationMs: result.totalDurationMs,
|
|
134097
|
+
detail: result.data
|
|
134098
|
+
});
|
|
134099
|
+
}
|
|
134100
|
+
return reply.code(result.status || 200).send(result.data);
|
|
134101
|
+
}
|
|
134102
|
+
try {
|
|
134103
|
+
const written = await writePasteToTempFile(content);
|
|
134104
|
+
return reply.code(200).send(written);
|
|
134105
|
+
} catch (err) {
|
|
134106
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
134107
|
+
req.log?.error({ err }, "[paste] failed to write temp file");
|
|
134108
|
+
return reply.code(500).send({ error: `Failed to write paste: ${msg}` });
|
|
134109
|
+
}
|
|
134110
|
+
});
|
|
133881
134111
|
fastify2.post(
|
|
133882
134112
|
"/api/agent-sessions/:sessionId/stop",
|
|
133883
134113
|
async (req, reply) => {
|
|
@@ -134071,6 +134301,7 @@ var routes11 = async (fastify2) => {
|
|
|
134071
134301
|
`/api/agent-sessions/${remoteInfo.remoteSessionId}`
|
|
134072
134302
|
);
|
|
134073
134303
|
fastify2.remoteSessionMap.delete(req.params.sessionId);
|
|
134304
|
+
fastify2.storage.remoteSessionMappings.delete(req.params.sessionId);
|
|
134074
134305
|
fastify2.remotePatchCache.delete(req.params.sessionId);
|
|
134075
134306
|
return reply.code(result.status || 200).send(result.data);
|
|
134076
134307
|
}
|
|
@@ -134177,7 +134408,7 @@ var chat_session_routes_default = (0, import_fastify_plugin13.default)(routes12,
|
|
|
134177
134408
|
|
|
134178
134409
|
// src/routes/task-routes.ts
|
|
134179
134410
|
var import_fastify_plugin14 = __toESM(require_plugin2(), 1);
|
|
134180
|
-
import { randomUUID as
|
|
134411
|
+
import { randomUUID as randomUUID11 } from "crypto";
|
|
134181
134412
|
var routes13 = async (fastify2) => {
|
|
134182
134413
|
fastify2.get(
|
|
134183
134414
|
"/api/projects/:projectId/tasks",
|
|
@@ -134217,7 +134448,7 @@ Description: ${description}`
|
|
|
134217
134448
|
title = description.length > 50 ? description.slice(0, 50) + "..." : description;
|
|
134218
134449
|
}
|
|
134219
134450
|
}
|
|
134220
|
-
const id =
|
|
134451
|
+
const id = randomUUID11();
|
|
134221
134452
|
const task = fastify2.storage.tasks.create({
|
|
134222
134453
|
id,
|
|
134223
134454
|
project_id: req.params.projectId,
|
|
@@ -134278,7 +134509,7 @@ var task_routes_default = (0, import_fastify_plugin14.default)(routes13, { name:
|
|
|
134278
134509
|
|
|
134279
134510
|
// src/routes/rule-routes.ts
|
|
134280
134511
|
var import_fastify_plugin15 = __toESM(require_plugin2(), 1);
|
|
134281
|
-
import { randomUUID as
|
|
134512
|
+
import { randomUUID as randomUUID12 } from "crypto";
|
|
134282
134513
|
var routes14 = async (fastify2) => {
|
|
134283
134514
|
fastify2.get(
|
|
134284
134515
|
"/api/projects/:projectId/rules",
|
|
@@ -134305,7 +134536,7 @@ var routes14 = async (fastify2) => {
|
|
|
134305
134536
|
if (!name25 || !content) {
|
|
134306
134537
|
return reply.code(400).send({ error: "name and content are required" });
|
|
134307
134538
|
}
|
|
134308
|
-
const id =
|
|
134539
|
+
const id = randomUUID12();
|
|
134309
134540
|
const rule = fastify2.storage.rules.create({
|
|
134310
134541
|
id,
|
|
134311
134542
|
project_id: req.params.projectId,
|
|
@@ -134357,7 +134588,7 @@ var rule_routes_default = (0, import_fastify_plugin15.default)(routes14, { name:
|
|
|
134357
134588
|
|
|
134358
134589
|
// src/routes/command-routes.ts
|
|
134359
134590
|
var import_fastify_plugin16 = __toESM(require_plugin2(), 1);
|
|
134360
|
-
import { randomUUID as
|
|
134591
|
+
import { randomUUID as randomUUID13 } from "crypto";
|
|
134361
134592
|
var routes15 = async (fastify2) => {
|
|
134362
134593
|
fastify2.get(
|
|
134363
134594
|
"/api/projects/:projectId/commands",
|
|
@@ -134384,7 +134615,7 @@ var routes15 = async (fastify2) => {
|
|
|
134384
134615
|
if (!name25 || !content) {
|
|
134385
134616
|
return reply.code(400).send({ error: "name and content are required" });
|
|
134386
134617
|
}
|
|
134387
|
-
const id =
|
|
134618
|
+
const id = randomUUID13();
|
|
134388
134619
|
const command = fastify2.storage.commands.create({
|
|
134389
134620
|
id,
|
|
134390
134621
|
project_id: req.params.projectId,
|
|
@@ -134420,6 +134651,15 @@ var command_routes_default = (0, import_fastify_plugin16.default)(routes15, { na
|
|
|
134420
134651
|
// src/routes/settings-routes.ts
|
|
134421
134652
|
var import_fastify_plugin17 = __toESM(require_plugin2(), 1);
|
|
134422
134653
|
var DEFAULT_PROXY_CONFIG = { type: "none", host: "", port: 0 };
|
|
134654
|
+
var DEFAULT_TERMINAL_SETTINGS = {
|
|
134655
|
+
scrollback: 1e3,
|
|
134656
|
+
fontSize: 13,
|
|
134657
|
+
fontFamily: 'Menlo, Monaco, "Courier New", monospace'
|
|
134658
|
+
};
|
|
134659
|
+
var SCROLLBACK_MIN = 500;
|
|
134660
|
+
var SCROLLBACK_MAX = 1e5;
|
|
134661
|
+
var FONT_SIZE_MIN = 8;
|
|
134662
|
+
var FONT_SIZE_MAX = 32;
|
|
134423
134663
|
var routes16 = async (fastify2) => {
|
|
134424
134664
|
fastify2.get("/api/settings/proxy", async (_req, reply) => {
|
|
134425
134665
|
const saved = fastify2.storage.settings.get("proxy");
|
|
@@ -134532,6 +134772,62 @@ var routes16 = async (fastify2) => {
|
|
|
134532
134772
|
openrouterModel: updated.openrouterModel
|
|
134533
134773
|
});
|
|
134534
134774
|
});
|
|
134775
|
+
fastify2.get("/api/settings/terminal", async (_req, reply) => {
|
|
134776
|
+
const saved = fastify2.storage.settings.get("terminal");
|
|
134777
|
+
if (!saved) {
|
|
134778
|
+
return reply.code(200).send(DEFAULT_TERMINAL_SETTINGS);
|
|
134779
|
+
}
|
|
134780
|
+
try {
|
|
134781
|
+
const parsed = JSON.parse(saved);
|
|
134782
|
+
return reply.code(200).send({
|
|
134783
|
+
scrollback: typeof parsed.scrollback === "number" ? parsed.scrollback : DEFAULT_TERMINAL_SETTINGS.scrollback,
|
|
134784
|
+
fontSize: typeof parsed.fontSize === "number" ? parsed.fontSize : DEFAULT_TERMINAL_SETTINGS.fontSize,
|
|
134785
|
+
fontFamily: typeof parsed.fontFamily === "string" && parsed.fontFamily.trim() ? parsed.fontFamily : DEFAULT_TERMINAL_SETTINGS.fontFamily
|
|
134786
|
+
});
|
|
134787
|
+
} catch {
|
|
134788
|
+
return reply.code(200).send(DEFAULT_TERMINAL_SETTINGS);
|
|
134789
|
+
}
|
|
134790
|
+
});
|
|
134791
|
+
fastify2.put("/api/settings/terminal", async (req, reply) => {
|
|
134792
|
+
const { scrollback, fontSize, fontFamily } = req.body;
|
|
134793
|
+
if (scrollback !== void 0) {
|
|
134794
|
+
if (typeof scrollback !== "number" || !Number.isFinite(scrollback) || scrollback < SCROLLBACK_MIN || scrollback > SCROLLBACK_MAX) {
|
|
134795
|
+
return reply.code(400).send({ error: `scrollback must be a number between ${SCROLLBACK_MIN} and ${SCROLLBACK_MAX}` });
|
|
134796
|
+
}
|
|
134797
|
+
}
|
|
134798
|
+
if (fontSize !== void 0) {
|
|
134799
|
+
if (typeof fontSize !== "number" || !Number.isFinite(fontSize) || fontSize < FONT_SIZE_MIN || fontSize > FONT_SIZE_MAX) {
|
|
134800
|
+
return reply.code(400).send({ error: `fontSize must be a number between ${FONT_SIZE_MIN} and ${FONT_SIZE_MAX}` });
|
|
134801
|
+
}
|
|
134802
|
+
}
|
|
134803
|
+
if (fontFamily !== void 0) {
|
|
134804
|
+
if (typeof fontFamily !== "string" || fontFamily.trim() === "") {
|
|
134805
|
+
return reply.code(400).send({ error: "fontFamily must be a non-empty string" });
|
|
134806
|
+
}
|
|
134807
|
+
}
|
|
134808
|
+
const saved = fastify2.storage.settings.get("terminal");
|
|
134809
|
+
const existing = (() => {
|
|
134810
|
+
if (!saved) return DEFAULT_TERMINAL_SETTINGS;
|
|
134811
|
+
try {
|
|
134812
|
+
const parsed = JSON.parse(saved);
|
|
134813
|
+
return {
|
|
134814
|
+
scrollback: typeof parsed.scrollback === "number" ? parsed.scrollback : DEFAULT_TERMINAL_SETTINGS.scrollback,
|
|
134815
|
+
fontSize: typeof parsed.fontSize === "number" ? parsed.fontSize : DEFAULT_TERMINAL_SETTINGS.fontSize,
|
|
134816
|
+
fontFamily: typeof parsed.fontFamily === "string" && parsed.fontFamily.trim() ? parsed.fontFamily : DEFAULT_TERMINAL_SETTINGS.fontFamily
|
|
134817
|
+
};
|
|
134818
|
+
} catch {
|
|
134819
|
+
return DEFAULT_TERMINAL_SETTINGS;
|
|
134820
|
+
}
|
|
134821
|
+
})();
|
|
134822
|
+
const updated = {
|
|
134823
|
+
scrollback: Math.round(scrollback ?? existing.scrollback),
|
|
134824
|
+
fontSize: fontSize ?? existing.fontSize,
|
|
134825
|
+
fontFamily: (fontFamily ?? existing.fontFamily).trim()
|
|
134826
|
+
};
|
|
134827
|
+
fastify2.storage.settings.set("terminal", JSON.stringify(updated));
|
|
134828
|
+
console.log(`[Settings] Terminal updated: scrollback=${updated.scrollback}, fontSize=${updated.fontSize}, fontFamily="${updated.fontFamily}"`);
|
|
134829
|
+
return reply.code(200).send(updated);
|
|
134830
|
+
});
|
|
134535
134831
|
};
|
|
134536
134832
|
var settings_routes_default = (0, import_fastify_plugin17.default)(routes16, { name: "settings-routes" });
|
|
134537
134833
|
|
|
@@ -134574,7 +134870,7 @@ var translate_routes_default = (0, import_fastify_plugin18.default)(routes17, {
|
|
|
134574
134870
|
|
|
134575
134871
|
// src/routes/websocket-routes.ts
|
|
134576
134872
|
var import_fastify_plugin19 = __toESM(require_plugin2(), 1);
|
|
134577
|
-
import { randomUUID as
|
|
134873
|
+
import { randomUUID as randomUUID14 } from "crypto";
|
|
134578
134874
|
async function verifyWsToken(token) {
|
|
134579
134875
|
try {
|
|
134580
134876
|
const { verifyToken: verifyToken3 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
@@ -134609,7 +134905,7 @@ function connectPersistentRemoteWs(sessionId, remoteInfo, cache2, wsOptions, rev
|
|
|
134609
134905
|
console.log(`[AgentWS] Opening persistent remote WS for ${sessionId} (cached=${hasCachedData}, virtual=${!!useVirtual})`);
|
|
134610
134906
|
let remoteWs;
|
|
134611
134907
|
if (useVirtual) {
|
|
134612
|
-
const channelId =
|
|
134908
|
+
const channelId = randomUUID14();
|
|
134613
134909
|
const wsPath = `/api/agent-sessions/${remoteInfo.remoteSessionId}/stream`;
|
|
134614
134910
|
const wsQuery = `apiKey=${encodeURIComponent(remoteInfo.remoteApiKey)}`;
|
|
134615
134911
|
const adapter = new VirtualWsAdapter(
|
|
@@ -134645,6 +134941,18 @@ function connectPersistentRemoteWs(sessionId, remoteInfo, cache2, wsOptions, rev
|
|
|
134645
134941
|
const raw = data.toString();
|
|
134646
134942
|
const parsed = tryParseWsMessage(raw);
|
|
134647
134943
|
if (!parsed) return;
|
|
134944
|
+
const kind = "JsonPatch" in parsed ? "JsonPatch" : "finished" in parsed ? "finished" : "taskCompleted" in parsed ? "taskCompleted" : "Ready" in parsed ? "Ready" : "error" in parsed ? "error" : "other";
|
|
134945
|
+
if (kind === "JsonPatch") {
|
|
134946
|
+
const ops = parsed.JsonPatch;
|
|
134947
|
+
const statusOp = ops.find((o) => o.path === "/status");
|
|
134948
|
+
if (statusOp) {
|
|
134949
|
+
console.log(`[AgentWS:remote\u2192local] ${sessionId} /status patch:`, statusOp.value?.content);
|
|
134950
|
+
} else {
|
|
134951
|
+
console.log(`[AgentWS:remote\u2192local] ${sessionId} JsonPatch paths:`, ops.map((o) => o.path));
|
|
134952
|
+
}
|
|
134953
|
+
} else {
|
|
134954
|
+
console.log(`[AgentWS:remote\u2192local] ${sessionId} ${kind}`);
|
|
134955
|
+
}
|
|
134648
134956
|
if ("JsonPatch" in parsed) {
|
|
134649
134957
|
cache2.appendMessage(sessionId, raw, true);
|
|
134650
134958
|
cache2.broadcast(sessionId, raw);
|
|
@@ -134823,7 +135131,7 @@ var routes18 = async (fastify2) => {
|
|
|
134823
135131
|
const useVirtualExec = fastify2.reverseConnectManager.isConnected(remoteInfo.remoteServerId);
|
|
134824
135132
|
let remoteWs;
|
|
134825
135133
|
if (useVirtualExec) {
|
|
134826
|
-
const channelId =
|
|
135134
|
+
const channelId = randomUUID14();
|
|
134827
135135
|
const wsPath = `/api/executor-processes/${remoteInfo.remoteProcessId}/logs`;
|
|
134828
135136
|
const wsQuery = `apiKey=${encodeURIComponent(remoteInfo.remoteApiKey)}`;
|
|
134829
135137
|
const adapter = new VirtualWsAdapter(
|
|
@@ -135004,6 +135312,7 @@ var routes18 = async (fastify2) => {
|
|
|
135004
135312
|
}
|
|
135005
135313
|
const cache2 = fastify2.remotePatchCache;
|
|
135006
135314
|
const cacheEntry = cache2.getOrCreate(sessionId);
|
|
135315
|
+
console.log(`[AgentWS] WS connect: cacheEntry for ${sessionId} has messages.length=${cacheEntry.messages.length} finished=${cacheEntry.finished} remoteWsOpen=${!!cache2.getRemoteWs(sessionId)}`);
|
|
135007
135316
|
if (cacheEntry.messages.length > 0) {
|
|
135008
135317
|
console.log(`[AgentWS] Replaying ${cacheEntry.messages.length} cached msgs for ${sessionId}`);
|
|
135009
135318
|
for (const raw of cacheEntry.messages) {
|
|
@@ -135473,7 +135782,7 @@ var browser_routes_default = (0, import_fastify_plugin23.default)(routes22, { na
|
|
|
135473
135782
|
|
|
135474
135783
|
// src/routes/browser-proxy-routes.ts
|
|
135475
135784
|
var import_fastify_plugin24 = __toESM(require_plugin2(), 1);
|
|
135476
|
-
import { randomUUID as
|
|
135785
|
+
import { randomUUID as randomUUID15 } from "crypto";
|
|
135477
135786
|
function resolveTarget(targetUrl, projectRemotes, reverseConnectManager) {
|
|
135478
135787
|
const parsed = new URL(targetUrl);
|
|
135479
135788
|
const hostname3 = parsed.hostname;
|
|
@@ -135497,11 +135806,11 @@ async function proxyFetch(resolved, requestHeaders, reverseConnectManager) {
|
|
|
135497
135806
|
if (resolved.remoteServerId && reverseConnectManager?.isConnected(resolved.remoteServerId)) {
|
|
135498
135807
|
const parsed = new URL(resolved.fetchUrl);
|
|
135499
135808
|
const port = parsed.port ? parseInt(parsed.port, 10) : void 0;
|
|
135500
|
-
const
|
|
135809
|
+
const path13 = parsed.pathname + parsed.search;
|
|
135501
135810
|
const raw = await reverseConnectManager.sendRawHttpRequest(
|
|
135502
135811
|
resolved.remoteServerId,
|
|
135503
135812
|
"GET",
|
|
135504
|
-
|
|
135813
|
+
path13,
|
|
135505
135814
|
requestHeaders,
|
|
135506
135815
|
void 0,
|
|
135507
135816
|
void 0,
|
|
@@ -135793,7 +136102,7 @@ var routes23 = async (fastify2) => {
|
|
|
135793
136102
|
const rcm = fastify2.reverseConnectManager;
|
|
135794
136103
|
if (resolved.remoteServerId && rcm.isConnected(resolved.remoteServerId)) {
|
|
135795
136104
|
const remoteServerId = resolved.remoteServerId;
|
|
135796
|
-
const channelId =
|
|
136105
|
+
const channelId = randomUUID15();
|
|
135797
136106
|
const parsed = new URL(resolved.fetchUrl);
|
|
135798
136107
|
const wsPath = parsed.pathname;
|
|
135799
136108
|
const wsQuery = parsed.search ? parsed.search.slice(1) : void 0;
|
|
@@ -136253,11 +136562,11 @@ var createServer = async (opts) => {
|
|
|
136253
136562
|
process.exit(1);
|
|
136254
136563
|
}
|
|
136255
136564
|
}
|
|
136256
|
-
const UI_ROOT =
|
|
136257
|
-
|
|
136565
|
+
const UI_ROOT = path9.join(
|
|
136566
|
+
path9.dirname(fileURLToPath(import.meta.url)),
|
|
136258
136567
|
"./ui"
|
|
136259
136568
|
);
|
|
136260
|
-
const server = (0, import_fastify.default)({ maxParamLength: 500 });
|
|
136569
|
+
const server = (0, import_fastify.default)({ maxParamLength: 500, bodyLimit: 16 * 1024 * 1024 });
|
|
136261
136570
|
server.server.on("upgrade", (req) => {
|
|
136262
136571
|
console.log(`[WS-RAW] HTTP upgrade event: ${req.url}`);
|
|
136263
136572
|
});
|
|
@@ -136647,23 +136956,23 @@ var ReverseConnectClient = class {
|
|
|
136647
136956
|
|
|
136648
136957
|
// src/constants.ts
|
|
136649
136958
|
import { homedir } from "os";
|
|
136650
|
-
import
|
|
136651
|
-
var VIBEDECKX_HOME =
|
|
136652
|
-
var DB_PATH =
|
|
136959
|
+
import path10 from "path";
|
|
136960
|
+
var VIBEDECKX_HOME = path10.join(homedir(), ".vibedeckx");
|
|
136961
|
+
var DB_PATH = path10.join(VIBEDECKX_HOME, "data.sqlite");
|
|
136653
136962
|
var DEFAULT_PORT = 5173;
|
|
136654
136963
|
|
|
136655
136964
|
// ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
|
|
136656
136965
|
import process8 from "node:process";
|
|
136657
136966
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
136658
|
-
import
|
|
136967
|
+
import path11 from "node:path";
|
|
136659
136968
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
136660
136969
|
import { promisify as promisify6 } from "node:util";
|
|
136661
136970
|
import childProcess from "node:child_process";
|
|
136662
|
-
import fs6, { constants as
|
|
136971
|
+
import fs6, { constants as fsConstants3 } from "node:fs/promises";
|
|
136663
136972
|
|
|
136664
136973
|
// ../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js
|
|
136665
136974
|
import process4 from "node:process";
|
|
136666
|
-
import fs5, { constants as
|
|
136975
|
+
import fs5, { constants as fsConstants2 } from "node:fs/promises";
|
|
136667
136976
|
|
|
136668
136977
|
// ../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
|
|
136669
136978
|
import process3 from "node:process";
|
|
@@ -136745,7 +137054,7 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
|
136745
137054
|
const configFilePath = "/etc/wsl.conf";
|
|
136746
137055
|
let isConfigFileExists = false;
|
|
136747
137056
|
try {
|
|
136748
|
-
await fs5.access(configFilePath,
|
|
137057
|
+
await fs5.access(configFilePath, fsConstants2.F_OK);
|
|
136749
137058
|
isConfigFileExists = true;
|
|
136750
137059
|
} catch {
|
|
136751
137060
|
}
|
|
@@ -136906,8 +137215,8 @@ async function defaultBrowser2() {
|
|
|
136906
137215
|
|
|
136907
137216
|
// ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
|
|
136908
137217
|
var execFile5 = promisify6(childProcess.execFile);
|
|
136909
|
-
var __dirname2 =
|
|
136910
|
-
var localXdgOpenPath =
|
|
137218
|
+
var __dirname2 = path11.dirname(fileURLToPath2(import.meta.url));
|
|
137219
|
+
var localXdgOpenPath = path11.join(__dirname2, "xdg-open");
|
|
136911
137220
|
var { platform: platform2, arch } = process8;
|
|
136912
137221
|
async function getWindowsDefaultBrowserFromWsl() {
|
|
136913
137222
|
const powershellPath = await powerShellPath();
|
|
@@ -137057,7 +137366,7 @@ var baseOpen = async (options) => {
|
|
|
137057
137366
|
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
137058
137367
|
let exeLocalXdgOpen = false;
|
|
137059
137368
|
try {
|
|
137060
|
-
await fs6.access(localXdgOpenPath,
|
|
137369
|
+
await fs6.access(localXdgOpenPath, fsConstants3.X_OK);
|
|
137061
137370
|
exeLocalXdgOpen = true;
|
|
137062
137371
|
} catch {
|
|
137063
137372
|
}
|
|
@@ -137094,7 +137403,7 @@ var baseOpen = async (options) => {
|
|
|
137094
137403
|
subprocess.unref();
|
|
137095
137404
|
return subprocess;
|
|
137096
137405
|
};
|
|
137097
|
-
var
|
|
137406
|
+
var open2 = (target, options) => {
|
|
137098
137407
|
if (typeof target !== "string") {
|
|
137099
137408
|
throw new TypeError("Expected a `target`");
|
|
137100
137409
|
}
|
|
@@ -137159,7 +137468,7 @@ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
|
137159
137468
|
}));
|
|
137160
137469
|
defineLazyProperty(apps, "browser", () => "browser");
|
|
137161
137470
|
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
137162
|
-
var open_default =
|
|
137471
|
+
var open_default = open2;
|
|
137163
137472
|
|
|
137164
137473
|
// src/command.ts
|
|
137165
137474
|
var startCommand = buildCommand({
|
|
@@ -137188,7 +137497,7 @@ var startCommand = buildCommand({
|
|
|
137188
137497
|
const port = flags.port ?? DEFAULT_PORT;
|
|
137189
137498
|
const authEnabled = flags.auth ?? false;
|
|
137190
137499
|
console.log("Starting vibedeckx...");
|
|
137191
|
-
const dbPath = flags["data-dir"] ?
|
|
137500
|
+
const dbPath = flags["data-dir"] ? path12.join(flags["data-dir"], "data.sqlite") : DB_PATH;
|
|
137192
137501
|
const storage = await createSqliteStorage(dbPath);
|
|
137193
137502
|
const server = await createServer({ storage, authEnabled });
|
|
137194
137503
|
const url2 = await server.start(port);
|
|
@@ -137252,7 +137561,7 @@ var connectCommand = buildCommand({
|
|
|
137252
137561
|
func: async (flags) => {
|
|
137253
137562
|
const requestedPort = flags.port ?? 0;
|
|
137254
137563
|
console.log("Starting vibedeckx in reverse-connect mode...");
|
|
137255
|
-
const dbPath = flags["data-dir"] ?
|
|
137564
|
+
const dbPath = flags["data-dir"] ? path12.join(flags["data-dir"], "data.sqlite") : DB_PATH;
|
|
137256
137565
|
const storage = await createSqliteStorage(dbPath);
|
|
137257
137566
|
const server = await createServer({ storage });
|
|
137258
137567
|
const { instance, port: localPort } = await server.startLocal(requestedPort);
|