repoburg 1.3.313 → 1.3.314
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/agent-pane/backend/dist/index.js +427 -279
- package/agent-pane/backend/dist/server.js +427 -279
- package/agent-pane/frontend/dist/assets/{TerminalView-Xaq6tVfx.js → TerminalView-HheF07Iz.js} +1 -1
- package/agent-pane/frontend/dist/assets/{index-B8vQbeJk.js → index-Do_-oQ87.js} +124 -119
- package/agent-pane/frontend/dist/assets/index-PWGU-lZn.css +1 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- package/daemon/dist/tabtape/mcp/server.js +2 -1
- package/package.json +1 -1
- package/tabtape/extension/dist/build-info.json +3 -3
- package/tabtape/extension/dist/manifest.json +1 -1
- package/tabtape/ui/dist/build-info.json +3 -3
- package/agent-pane/frontend/dist/assets/index-wFHgyM6i.css +0 -1
|
@@ -2680,7 +2680,7 @@ var require_server = __commonJS({
|
|
|
2680
2680
|
var https = __require("node:https");
|
|
2681
2681
|
var http22 = __require("node:http2");
|
|
2682
2682
|
var dns = __require("node:dns");
|
|
2683
|
-
var
|
|
2683
|
+
var os7 = __require("node:os");
|
|
2684
2684
|
var { kState, kOptions, kServerBindings, kHttp2ServerSessions } = require_symbols2();
|
|
2685
2685
|
var { FSTWRN003 } = require_warnings();
|
|
2686
2686
|
var { onListenHookRunner } = require_hooks();
|
|
@@ -2942,7 +2942,7 @@ var require_server = __commonJS({
|
|
|
2942
2942
|
}
|
|
2943
2943
|
function getAddresses(address) {
|
|
2944
2944
|
if (address.address === "0.0.0.0") {
|
|
2945
|
-
return Object.values(
|
|
2945
|
+
return Object.values(os7.networkInterfaces()).flatMap((iface) => {
|
|
2946
2946
|
return iface.filter((iface2) => iface2.family === "IPv4");
|
|
2947
2947
|
}).sort((iface) => {
|
|
2948
2948
|
return iface.internal ? -1 : 1;
|
|
@@ -6128,8 +6128,8 @@ var require_req = __commonJS({
|
|
|
6128
6128
|
if (req.originalUrl) {
|
|
6129
6129
|
_req.url = req.originalUrl;
|
|
6130
6130
|
} else {
|
|
6131
|
-
const
|
|
6132
|
-
_req.url = typeof
|
|
6131
|
+
const path20 = req.path;
|
|
6132
|
+
_req.url = typeof path20 === "string" ? path20 : req.url ? req.url.path || req.url : void 0;
|
|
6133
6133
|
}
|
|
6134
6134
|
if (req.query) {
|
|
6135
6135
|
_req.query = req.query;
|
|
@@ -6294,14 +6294,14 @@ var require_redact = __commonJS({
|
|
|
6294
6294
|
}
|
|
6295
6295
|
return obj2;
|
|
6296
6296
|
}
|
|
6297
|
-
function parsePath(
|
|
6297
|
+
function parsePath(path20) {
|
|
6298
6298
|
const parts = [];
|
|
6299
6299
|
let current = "";
|
|
6300
6300
|
let inBrackets = false;
|
|
6301
6301
|
let inQuotes = false;
|
|
6302
6302
|
let quoteChar = "";
|
|
6303
|
-
for (let i = 0; i <
|
|
6304
|
-
const char =
|
|
6303
|
+
for (let i = 0; i < path20.length; i++) {
|
|
6304
|
+
const char = path20[i];
|
|
6305
6305
|
if (!inBrackets && char === ".") {
|
|
6306
6306
|
if (current) {
|
|
6307
6307
|
parts.push(current);
|
|
@@ -6432,10 +6432,10 @@ var require_redact = __commonJS({
|
|
|
6432
6432
|
return current;
|
|
6433
6433
|
}
|
|
6434
6434
|
function redactPaths(obj2, paths, censor, remove = false) {
|
|
6435
|
-
for (const
|
|
6436
|
-
const parts = parsePath(
|
|
6435
|
+
for (const path20 of paths) {
|
|
6436
|
+
const parts = parsePath(path20);
|
|
6437
6437
|
if (parts.includes("*")) {
|
|
6438
|
-
redactWildcardPath(obj2, parts, censor,
|
|
6438
|
+
redactWildcardPath(obj2, parts, censor, path20, remove);
|
|
6439
6439
|
} else {
|
|
6440
6440
|
if (remove) {
|
|
6441
6441
|
removeKey(obj2, parts);
|
|
@@ -6520,8 +6520,8 @@ var require_redact = __commonJS({
|
|
|
6520
6520
|
}
|
|
6521
6521
|
} else {
|
|
6522
6522
|
if (afterWildcard.includes("*")) {
|
|
6523
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
6524
|
-
const fullPath = [...pathArray.slice(0, pathLength), ...
|
|
6523
|
+
const wrappedCensor = typeof censor === "function" ? (value, path20) => {
|
|
6524
|
+
const fullPath = [...pathArray.slice(0, pathLength), ...path20];
|
|
6525
6525
|
return censor(value, fullPath);
|
|
6526
6526
|
} : censor;
|
|
6527
6527
|
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
|
|
@@ -6556,8 +6556,8 @@ var require_redact = __commonJS({
|
|
|
6556
6556
|
return null;
|
|
6557
6557
|
}
|
|
6558
6558
|
const pathStructure = /* @__PURE__ */ new Map();
|
|
6559
|
-
for (const
|
|
6560
|
-
const parts = parsePath(
|
|
6559
|
+
for (const path20 of pathsToClone) {
|
|
6560
|
+
const parts = parsePath(path20);
|
|
6561
6561
|
let current = pathStructure;
|
|
6562
6562
|
for (let i = 0; i < parts.length; i++) {
|
|
6563
6563
|
const part = parts[i];
|
|
@@ -6609,24 +6609,24 @@ var require_redact = __commonJS({
|
|
|
6609
6609
|
}
|
|
6610
6610
|
return cloneSelectively(obj2, pathStructure);
|
|
6611
6611
|
}
|
|
6612
|
-
function validatePath(
|
|
6613
|
-
if (typeof
|
|
6612
|
+
function validatePath(path20) {
|
|
6613
|
+
if (typeof path20 !== "string") {
|
|
6614
6614
|
throw new Error("Paths must be (non-empty) strings");
|
|
6615
6615
|
}
|
|
6616
|
-
if (
|
|
6616
|
+
if (path20 === "") {
|
|
6617
6617
|
throw new Error("Invalid redaction path ()");
|
|
6618
6618
|
}
|
|
6619
|
-
if (
|
|
6620
|
-
throw new Error(`Invalid redaction path (${
|
|
6619
|
+
if (path20.includes("..")) {
|
|
6620
|
+
throw new Error(`Invalid redaction path (${path20})`);
|
|
6621
6621
|
}
|
|
6622
|
-
if (
|
|
6623
|
-
throw new Error(`Invalid redaction path (${
|
|
6622
|
+
if (path20.includes(",")) {
|
|
6623
|
+
throw new Error(`Invalid redaction path (${path20})`);
|
|
6624
6624
|
}
|
|
6625
6625
|
let bracketCount = 0;
|
|
6626
6626
|
let inQuotes = false;
|
|
6627
6627
|
let quoteChar = "";
|
|
6628
|
-
for (let i = 0; i <
|
|
6629
|
-
const char =
|
|
6628
|
+
for (let i = 0; i < path20.length; i++) {
|
|
6629
|
+
const char = path20[i];
|
|
6630
6630
|
if ((char === '"' || char === "'") && bracketCount > 0) {
|
|
6631
6631
|
if (!inQuotes) {
|
|
6632
6632
|
inQuotes = true;
|
|
@@ -6640,20 +6640,20 @@ var require_redact = __commonJS({
|
|
|
6640
6640
|
} else if (char === "]" && !inQuotes) {
|
|
6641
6641
|
bracketCount--;
|
|
6642
6642
|
if (bracketCount < 0) {
|
|
6643
|
-
throw new Error(`Invalid redaction path (${
|
|
6643
|
+
throw new Error(`Invalid redaction path (${path20})`);
|
|
6644
6644
|
}
|
|
6645
6645
|
}
|
|
6646
6646
|
}
|
|
6647
6647
|
if (bracketCount !== 0) {
|
|
6648
|
-
throw new Error(`Invalid redaction path (${
|
|
6648
|
+
throw new Error(`Invalid redaction path (${path20})`);
|
|
6649
6649
|
}
|
|
6650
6650
|
}
|
|
6651
6651
|
function validatePaths(paths) {
|
|
6652
6652
|
if (!Array.isArray(paths)) {
|
|
6653
6653
|
throw new TypeError("paths must be an array");
|
|
6654
6654
|
}
|
|
6655
|
-
for (const
|
|
6656
|
-
validatePath(
|
|
6655
|
+
for (const path20 of paths) {
|
|
6656
|
+
validatePath(path20);
|
|
6657
6657
|
}
|
|
6658
6658
|
}
|
|
6659
6659
|
function slowRedact(options = {}) {
|
|
@@ -6821,8 +6821,8 @@ var require_redaction = __commonJS({
|
|
|
6821
6821
|
if (shape[k] === null) {
|
|
6822
6822
|
o[k] = (value) => topCensor(value, [k]);
|
|
6823
6823
|
} else {
|
|
6824
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
6825
|
-
return censor(value, [k, ...
|
|
6824
|
+
const wrappedCensor = typeof censor === "function" ? (value, path20) => {
|
|
6825
|
+
return censor(value, [k, ...path20]);
|
|
6826
6826
|
} : censor;
|
|
6827
6827
|
o[k] = Redact({
|
|
6828
6828
|
paths: shape[k],
|
|
@@ -7040,10 +7040,10 @@ var require_atomic_sleep = __commonJS({
|
|
|
7040
7040
|
var require_sonic_boom = __commonJS({
|
|
7041
7041
|
"node_modules/sonic-boom/index.js"(exports, module) {
|
|
7042
7042
|
"use strict";
|
|
7043
|
-
var
|
|
7043
|
+
var fs12 = __require("fs");
|
|
7044
7044
|
var EventEmitter5 = __require("events");
|
|
7045
7045
|
var inherits = __require("util").inherits;
|
|
7046
|
-
var
|
|
7046
|
+
var path20 = __require("path");
|
|
7047
7047
|
var sleep2 = require_atomic_sleep();
|
|
7048
7048
|
var assert2 = __require("assert");
|
|
7049
7049
|
var BUSY_WRITE_TIMEOUT = 100;
|
|
@@ -7097,20 +7097,20 @@ var require_sonic_boom = __commonJS({
|
|
|
7097
7097
|
const mode = sonic.mode;
|
|
7098
7098
|
if (sonic.sync) {
|
|
7099
7099
|
try {
|
|
7100
|
-
if (sonic.mkdir)
|
|
7101
|
-
const fd =
|
|
7100
|
+
if (sonic.mkdir) fs12.mkdirSync(path20.dirname(file2), { recursive: true });
|
|
7101
|
+
const fd = fs12.openSync(file2, flags, mode);
|
|
7102
7102
|
fileOpened(null, fd);
|
|
7103
7103
|
} catch (err) {
|
|
7104
7104
|
fileOpened(err);
|
|
7105
7105
|
throw err;
|
|
7106
7106
|
}
|
|
7107
7107
|
} else if (sonic.mkdir) {
|
|
7108
|
-
|
|
7108
|
+
fs12.mkdir(path20.dirname(file2), { recursive: true }, (err) => {
|
|
7109
7109
|
if (err) return fileOpened(err);
|
|
7110
|
-
|
|
7110
|
+
fs12.open(file2, flags, mode, fileOpened);
|
|
7111
7111
|
});
|
|
7112
7112
|
} else {
|
|
7113
|
-
|
|
7113
|
+
fs12.open(file2, flags, mode, fileOpened);
|
|
7114
7114
|
}
|
|
7115
7115
|
}
|
|
7116
7116
|
function SonicBoom(opts) {
|
|
@@ -7151,8 +7151,8 @@ var require_sonic_boom = __commonJS({
|
|
|
7151
7151
|
this.flush = flushBuffer;
|
|
7152
7152
|
this.flushSync = flushBufferSync;
|
|
7153
7153
|
this._actualWrite = actualWriteBuffer;
|
|
7154
|
-
fsWriteSync = () =>
|
|
7155
|
-
fsWrite = () =>
|
|
7154
|
+
fsWriteSync = () => fs12.writeSync(this.fd, this._writingBuf);
|
|
7155
|
+
fsWrite = () => fs12.write(this.fd, this._writingBuf, this.release);
|
|
7156
7156
|
} else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
|
|
7157
7157
|
this._writingBuf = "";
|
|
7158
7158
|
this.write = write;
|
|
@@ -7161,15 +7161,15 @@ var require_sonic_boom = __commonJS({
|
|
|
7161
7161
|
this._actualWrite = actualWrite;
|
|
7162
7162
|
fsWriteSync = () => {
|
|
7163
7163
|
if (Buffer.isBuffer(this._writingBuf)) {
|
|
7164
|
-
return
|
|
7164
|
+
return fs12.writeSync(this.fd, this._writingBuf);
|
|
7165
7165
|
}
|
|
7166
|
-
return
|
|
7166
|
+
return fs12.writeSync(this.fd, this._writingBuf, "utf8");
|
|
7167
7167
|
};
|
|
7168
7168
|
fsWrite = () => {
|
|
7169
7169
|
if (Buffer.isBuffer(this._writingBuf)) {
|
|
7170
|
-
return
|
|
7170
|
+
return fs12.write(this.fd, this._writingBuf, this.release);
|
|
7171
7171
|
}
|
|
7172
|
-
return
|
|
7172
|
+
return fs12.write(this.fd, this._writingBuf, "utf8", this.release);
|
|
7173
7173
|
};
|
|
7174
7174
|
} else {
|
|
7175
7175
|
throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
|
|
@@ -7226,7 +7226,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7226
7226
|
}
|
|
7227
7227
|
}
|
|
7228
7228
|
if (this._fsync) {
|
|
7229
|
-
|
|
7229
|
+
fs12.fsyncSync(this.fd);
|
|
7230
7230
|
}
|
|
7231
7231
|
const len = this._len;
|
|
7232
7232
|
if (this._reopening) {
|
|
@@ -7340,7 +7340,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7340
7340
|
const onDrain = () => {
|
|
7341
7341
|
if (!this._fsync) {
|
|
7342
7342
|
try {
|
|
7343
|
-
|
|
7343
|
+
fs12.fsync(this.fd, (err) => {
|
|
7344
7344
|
this._flushPending = false;
|
|
7345
7345
|
cb(err);
|
|
7346
7346
|
});
|
|
@@ -7442,7 +7442,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7442
7442
|
const fd = this.fd;
|
|
7443
7443
|
this.once("ready", () => {
|
|
7444
7444
|
if (fd !== this.fd) {
|
|
7445
|
-
|
|
7445
|
+
fs12.close(fd, (err) => {
|
|
7446
7446
|
if (err) {
|
|
7447
7447
|
return this.emit("error", err);
|
|
7448
7448
|
}
|
|
@@ -7491,7 +7491,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7491
7491
|
buf = this._bufs[0];
|
|
7492
7492
|
}
|
|
7493
7493
|
try {
|
|
7494
|
-
const n = Buffer.isBuffer(buf) ?
|
|
7494
|
+
const n = Buffer.isBuffer(buf) ? fs12.writeSync(this.fd, buf) : fs12.writeSync(this.fd, buf, "utf8");
|
|
7495
7495
|
const releasedBufObj = releaseWritingBuf(buf, this._len, n);
|
|
7496
7496
|
buf = releasedBufObj.writingBuf;
|
|
7497
7497
|
this._len = releasedBufObj.len;
|
|
@@ -7507,7 +7507,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7507
7507
|
}
|
|
7508
7508
|
}
|
|
7509
7509
|
try {
|
|
7510
|
-
|
|
7510
|
+
fs12.fsyncSync(this.fd);
|
|
7511
7511
|
} catch {
|
|
7512
7512
|
}
|
|
7513
7513
|
}
|
|
@@ -7528,7 +7528,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7528
7528
|
buf = mergeBuf(this._bufs[0], this._lens[0]);
|
|
7529
7529
|
}
|
|
7530
7530
|
try {
|
|
7531
|
-
const n =
|
|
7531
|
+
const n = fs12.writeSync(this.fd, buf);
|
|
7532
7532
|
buf = buf.subarray(n);
|
|
7533
7533
|
this._len = Math.max(this._len - n, 0);
|
|
7534
7534
|
if (buf.length <= 0) {
|
|
@@ -7556,13 +7556,13 @@ var require_sonic_boom = __commonJS({
|
|
|
7556
7556
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
|
|
7557
7557
|
if (this.sync) {
|
|
7558
7558
|
try {
|
|
7559
|
-
const written = Buffer.isBuffer(this._writingBuf) ?
|
|
7559
|
+
const written = Buffer.isBuffer(this._writingBuf) ? fs12.writeSync(this.fd, this._writingBuf) : fs12.writeSync(this.fd, this._writingBuf, "utf8");
|
|
7560
7560
|
release(null, written);
|
|
7561
7561
|
} catch (err) {
|
|
7562
7562
|
release(err);
|
|
7563
7563
|
}
|
|
7564
7564
|
} else {
|
|
7565
|
-
|
|
7565
|
+
fs12.write(this.fd, this._writingBuf, release);
|
|
7566
7566
|
}
|
|
7567
7567
|
}
|
|
7568
7568
|
function actualWriteBuffer() {
|
|
@@ -7571,7 +7571,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7571
7571
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
|
|
7572
7572
|
if (this.sync) {
|
|
7573
7573
|
try {
|
|
7574
|
-
const written =
|
|
7574
|
+
const written = fs12.writeSync(this.fd, this._writingBuf);
|
|
7575
7575
|
release(null, written);
|
|
7576
7576
|
} catch (err) {
|
|
7577
7577
|
release(err);
|
|
@@ -7580,7 +7580,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7580
7580
|
if (kCopyBuffer) {
|
|
7581
7581
|
this._writingBuf = Buffer.from(this._writingBuf);
|
|
7582
7582
|
}
|
|
7583
|
-
|
|
7583
|
+
fs12.write(this.fd, this._writingBuf, release);
|
|
7584
7584
|
}
|
|
7585
7585
|
}
|
|
7586
7586
|
function actualClose(sonic) {
|
|
@@ -7596,12 +7596,12 @@ var require_sonic_boom = __commonJS({
|
|
|
7596
7596
|
sonic._lens = [];
|
|
7597
7597
|
assert2(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
|
|
7598
7598
|
try {
|
|
7599
|
-
|
|
7599
|
+
fs12.fsync(sonic.fd, closeWrapped);
|
|
7600
7600
|
} catch {
|
|
7601
7601
|
}
|
|
7602
7602
|
function closeWrapped() {
|
|
7603
7603
|
if (sonic.fd !== 1 && sonic.fd !== 2) {
|
|
7604
|
-
|
|
7604
|
+
fs12.close(sonic.fd, done);
|
|
7605
7605
|
} else {
|
|
7606
7606
|
done();
|
|
7607
7607
|
}
|
|
@@ -8374,7 +8374,7 @@ var require_transport = __commonJS({
|
|
|
8374
8374
|
var { existsSync: existsSync3 } = __require("node:fs");
|
|
8375
8375
|
var getCallers = require_caller();
|
|
8376
8376
|
var { join: join6, isAbsolute, sep } = __require("node:path");
|
|
8377
|
-
var { fileURLToPath:
|
|
8377
|
+
var { fileURLToPath: fileURLToPath6 } = __require("node:url");
|
|
8378
8378
|
var sleep2 = require_atomic_sleep();
|
|
8379
8379
|
var onExit = require_on_exit_leak_free();
|
|
8380
8380
|
var ThreadStream = require_thread_stream();
|
|
@@ -8437,15 +8437,15 @@ var require_transport = __commonJS({
|
|
|
8437
8437
|
if (!unquoted) {
|
|
8438
8438
|
return false;
|
|
8439
8439
|
}
|
|
8440
|
-
let
|
|
8441
|
-
if (
|
|
8440
|
+
let path20 = unquoted;
|
|
8441
|
+
if (path20.startsWith("file://")) {
|
|
8442
8442
|
try {
|
|
8443
|
-
|
|
8443
|
+
path20 = fileURLToPath6(path20);
|
|
8444
8444
|
} catch {
|
|
8445
8445
|
return false;
|
|
8446
8446
|
}
|
|
8447
8447
|
}
|
|
8448
|
-
return isAbsolute(
|
|
8448
|
+
return isAbsolute(path20) && !existsSync3(path20);
|
|
8449
8449
|
}
|
|
8450
8450
|
function stripQuotes(value) {
|
|
8451
8451
|
const first = value[0];
|
|
@@ -10139,7 +10139,7 @@ var require_multistream = __commonJS({
|
|
|
10139
10139
|
var require_pino = __commonJS({
|
|
10140
10140
|
"node_modules/pino/pino.js"(exports, module) {
|
|
10141
10141
|
"use strict";
|
|
10142
|
-
var
|
|
10142
|
+
var os7 = __require("node:os");
|
|
10143
10143
|
var stdSerializers = require_pino_std_serializers();
|
|
10144
10144
|
var caller = require_caller();
|
|
10145
10145
|
var redaction = require_redaction();
|
|
@@ -10186,7 +10186,7 @@ var require_pino = __commonJS({
|
|
|
10186
10186
|
} = symbols;
|
|
10187
10187
|
var { epochTime, nullTime } = time3;
|
|
10188
10188
|
var { pid } = process;
|
|
10189
|
-
var hostname4 =
|
|
10189
|
+
var hostname4 = os7.hostname();
|
|
10190
10190
|
var defaultErrorSerializer = stdSerializers.err;
|
|
10191
10191
|
var defaultOptions = {
|
|
10192
10192
|
level: "info",
|
|
@@ -17121,8 +17121,8 @@ var require_utils = __commonJS({
|
|
|
17121
17121
|
}
|
|
17122
17122
|
return ind;
|
|
17123
17123
|
}
|
|
17124
|
-
function removeDotSegments(
|
|
17125
|
-
let input =
|
|
17124
|
+
function removeDotSegments(path20) {
|
|
17125
|
+
let input = path20;
|
|
17126
17126
|
const output = [];
|
|
17127
17127
|
let nextSlash = -1;
|
|
17128
17128
|
let len = 0;
|
|
@@ -17374,8 +17374,8 @@ var require_schemes = __commonJS({
|
|
|
17374
17374
|
wsComponent.secure = void 0;
|
|
17375
17375
|
}
|
|
17376
17376
|
if (wsComponent.resourceName) {
|
|
17377
|
-
const [
|
|
17378
|
-
wsComponent.path =
|
|
17377
|
+
const [path20, query2] = wsComponent.resourceName.split("?");
|
|
17378
|
+
wsComponent.path = path20 && path20 !== "/" ? path20 : void 0;
|
|
17379
17379
|
wsComponent.query = query2;
|
|
17380
17380
|
wsComponent.resourceName = void 0;
|
|
17381
17381
|
}
|
|
@@ -22312,8 +22312,8 @@ var require_utils2 = __commonJS({
|
|
|
22312
22312
|
}
|
|
22313
22313
|
return ind;
|
|
22314
22314
|
}
|
|
22315
|
-
function removeDotSegments(
|
|
22316
|
-
let input =
|
|
22315
|
+
function removeDotSegments(path20) {
|
|
22316
|
+
let input = path20;
|
|
22317
22317
|
const output = [];
|
|
22318
22318
|
let nextSlash = -1;
|
|
22319
22319
|
let len = 0;
|
|
@@ -22658,8 +22658,8 @@ var require_schemes2 = __commonJS({
|
|
|
22658
22658
|
wsComponent.secure = void 0;
|
|
22659
22659
|
}
|
|
22660
22660
|
if (wsComponent.resourceName) {
|
|
22661
|
-
const [
|
|
22662
|
-
wsComponent.path =
|
|
22661
|
+
const [path20, query2] = wsComponent.resourceName.split("?");
|
|
22662
|
+
wsComponent.path = path20 && path20 !== "/" ? path20 : void 0;
|
|
22663
22663
|
wsComponent.query = query2;
|
|
22664
22664
|
wsComponent.resourceName = void 0;
|
|
22665
22665
|
}
|
|
@@ -23435,12 +23435,12 @@ var require_dist = __commonJS({
|
|
|
23435
23435
|
throw new Error(`Unknown format "${name}"`);
|
|
23436
23436
|
return f;
|
|
23437
23437
|
};
|
|
23438
|
-
function addFormats(ajv, list,
|
|
23438
|
+
function addFormats(ajv, list, fs12, exportName) {
|
|
23439
23439
|
var _a3;
|
|
23440
23440
|
var _b;
|
|
23441
23441
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
23442
23442
|
for (const f of list)
|
|
23443
|
-
ajv.addFormat(f,
|
|
23443
|
+
ajv.addFormat(f, fs12[f]);
|
|
23444
23444
|
}
|
|
23445
23445
|
module.exports = exports = formatsPlugin;
|
|
23446
23446
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -24143,8 +24143,8 @@ var require_utils3 = __commonJS({
|
|
|
24143
24143
|
}
|
|
24144
24144
|
return ind;
|
|
24145
24145
|
}
|
|
24146
|
-
function removeDotSegments(
|
|
24147
|
-
let input =
|
|
24146
|
+
function removeDotSegments(path20) {
|
|
24147
|
+
let input = path20;
|
|
24148
24148
|
const output = [];
|
|
24149
24149
|
let nextSlash = -1;
|
|
24150
24150
|
let len = 0;
|
|
@@ -24489,8 +24489,8 @@ var require_schemes3 = __commonJS({
|
|
|
24489
24489
|
wsComponent.secure = void 0;
|
|
24490
24490
|
}
|
|
24491
24491
|
if (wsComponent.resourceName) {
|
|
24492
|
-
const [
|
|
24493
|
-
wsComponent.path =
|
|
24492
|
+
const [path20, query2] = wsComponent.resourceName.split("?");
|
|
24493
|
+
wsComponent.path = path20 && path20 !== "/" ? path20 : void 0;
|
|
24494
24494
|
wsComponent.query = query2;
|
|
24495
24495
|
wsComponent.resourceName = void 0;
|
|
24496
24496
|
}
|
|
@@ -32007,13 +32007,13 @@ var require_node = __commonJS({
|
|
|
32007
32007
|
this.staticChildrenNodes[index] = node;
|
|
32008
32008
|
}
|
|
32009
32009
|
}
|
|
32010
|
-
findStaticMatchingChild(
|
|
32011
|
-
const charCode =
|
|
32010
|
+
findStaticMatchingChild(path20, pathIndex) {
|
|
32011
|
+
const charCode = path20.charCodeAt(pathIndex);
|
|
32012
32012
|
const charCodes = this.staticChildrenCharCodes;
|
|
32013
32013
|
for (let i = 0; i < charCodes.length; i++) {
|
|
32014
32014
|
if (charCodes[i] === charCode) {
|
|
32015
32015
|
const staticChild = this.staticChildrenNodes[i];
|
|
32016
|
-
if (staticChild.matchPrefix(
|
|
32016
|
+
if (staticChild.matchPrefix(path20, pathIndex)) {
|
|
32017
32017
|
return staticChild;
|
|
32018
32018
|
}
|
|
32019
32019
|
return null;
|
|
@@ -32021,34 +32021,34 @@ var require_node = __commonJS({
|
|
|
32021
32021
|
}
|
|
32022
32022
|
return null;
|
|
32023
32023
|
}
|
|
32024
|
-
getStaticChild(
|
|
32025
|
-
if (
|
|
32024
|
+
getStaticChild(path20, pathIndex = 0) {
|
|
32025
|
+
if (path20.length === pathIndex) {
|
|
32026
32026
|
return this;
|
|
32027
32027
|
}
|
|
32028
|
-
const staticChild = this.findStaticMatchingChild(
|
|
32028
|
+
const staticChild = this.findStaticMatchingChild(path20, pathIndex);
|
|
32029
32029
|
if (staticChild) {
|
|
32030
|
-
return staticChild.getStaticChild(
|
|
32030
|
+
return staticChild.getStaticChild(path20, pathIndex + staticChild.prefix.length);
|
|
32031
32031
|
}
|
|
32032
32032
|
return null;
|
|
32033
32033
|
}
|
|
32034
|
-
createStaticChild(
|
|
32035
|
-
if (
|
|
32034
|
+
createStaticChild(path20) {
|
|
32035
|
+
if (path20.length === 0) {
|
|
32036
32036
|
return this;
|
|
32037
32037
|
}
|
|
32038
|
-
const childIndex = this.staticChildrenCharCodes.indexOf(
|
|
32038
|
+
const childIndex = this.staticChildrenCharCodes.indexOf(path20.charCodeAt(0));
|
|
32039
32039
|
let staticChild = childIndex === -1 ? void 0 : this.staticChildrenNodes[childIndex];
|
|
32040
32040
|
if (staticChild) {
|
|
32041
32041
|
let i = 1;
|
|
32042
32042
|
for (; i < staticChild.prefix.length; i++) {
|
|
32043
|
-
if (
|
|
32043
|
+
if (path20.charCodeAt(i) !== staticChild.prefix.charCodeAt(i)) {
|
|
32044
32044
|
staticChild = staticChild.split(this, i);
|
|
32045
32045
|
break;
|
|
32046
32046
|
}
|
|
32047
32047
|
}
|
|
32048
|
-
return staticChild.createStaticChild(
|
|
32048
|
+
return staticChild.createStaticChild(path20.slice(i));
|
|
32049
32049
|
}
|
|
32050
|
-
const node = new StaticNode(
|
|
32051
|
-
this.setStaticChild(
|
|
32050
|
+
const node = new StaticNode(path20);
|
|
32051
|
+
this.setStaticChild(path20.charAt(0), node);
|
|
32052
32052
|
return node;
|
|
32053
32053
|
}
|
|
32054
32054
|
};
|
|
@@ -32108,8 +32108,8 @@ var require_node = __commonJS({
|
|
|
32108
32108
|
parentNode.setStaticChild(parentPrefix.charAt(0), staticNode);
|
|
32109
32109
|
return staticNode;
|
|
32110
32110
|
}
|
|
32111
|
-
getNextNode(
|
|
32112
|
-
let node = this.findStaticMatchingChild(
|
|
32111
|
+
getNextNode(path20, pathIndex, nodeStack, paramsCount) {
|
|
32112
|
+
let node = this.findStaticMatchingChild(path20, pathIndex);
|
|
32113
32113
|
let parametricBrotherNodeIndex = 0;
|
|
32114
32114
|
if (node === null) {
|
|
32115
32115
|
if (this.parametricChildren.length === 0) {
|
|
@@ -32156,8 +32156,8 @@ var require_node = __commonJS({
|
|
|
32156
32156
|
this.kind = NODE_TYPES.PARAMETRIC;
|
|
32157
32157
|
this.nodePaths = /* @__PURE__ */ new Set([nodePath2]);
|
|
32158
32158
|
}
|
|
32159
|
-
getNextNode(
|
|
32160
|
-
return this.findStaticMatchingChild(
|
|
32159
|
+
getNextNode(path20, pathIndex) {
|
|
32160
|
+
return this.findStaticMatchingChild(path20, pathIndex);
|
|
32161
32161
|
}
|
|
32162
32162
|
};
|
|
32163
32163
|
var WildcardNode = class extends Node {
|
|
@@ -32513,81 +32513,81 @@ var require_url_sanitizer = __commonJS({
|
|
|
32513
32513
|
return String.fromCharCode(charCode);
|
|
32514
32514
|
}
|
|
32515
32515
|
var MIN_NATIVE_SCAN_LENGTH = 12;
|
|
32516
|
-
function safeDecodeURI(
|
|
32517
|
-
if (
|
|
32518
|
-
return safeDecodeURINativeScan(
|
|
32516
|
+
function safeDecodeURI(path20, useSemicolonDelimiter) {
|
|
32517
|
+
if (path20.length >= MIN_NATIVE_SCAN_LENGTH) {
|
|
32518
|
+
return safeDecodeURINativeScan(path20, useSemicolonDelimiter);
|
|
32519
32519
|
}
|
|
32520
|
-
return safeDecodeURICharScan(
|
|
32520
|
+
return safeDecodeURICharScan(path20, useSemicolonDelimiter, 1);
|
|
32521
32521
|
}
|
|
32522
|
-
function safeDecodeURINativeScan(
|
|
32523
|
-
const percentIndex =
|
|
32524
|
-
let delimIndex =
|
|
32525
|
-
const hashIndex =
|
|
32522
|
+
function safeDecodeURINativeScan(path20, useSemicolonDelimiter) {
|
|
32523
|
+
const percentIndex = path20.indexOf("%", 1);
|
|
32524
|
+
let delimIndex = path20.indexOf("?", 1);
|
|
32525
|
+
const hashIndex = path20.indexOf("#", 1);
|
|
32526
32526
|
if (hashIndex !== -1 && (delimIndex === -1 || hashIndex < delimIndex)) {
|
|
32527
32527
|
delimIndex = hashIndex;
|
|
32528
32528
|
}
|
|
32529
32529
|
if (useSemicolonDelimiter) {
|
|
32530
|
-
const semicolonIndex =
|
|
32530
|
+
const semicolonIndex = path20.indexOf(";", 1);
|
|
32531
32531
|
if (semicolonIndex !== -1 && (delimIndex === -1 || semicolonIndex < delimIndex)) {
|
|
32532
32532
|
delimIndex = semicolonIndex;
|
|
32533
32533
|
}
|
|
32534
32534
|
}
|
|
32535
32535
|
if (percentIndex === -1 || delimIndex !== -1 && percentIndex > delimIndex) {
|
|
32536
32536
|
if (delimIndex === -1) {
|
|
32537
|
-
return { path:
|
|
32537
|
+
return { path: path20, querystring: "", shouldDecodeParam: false };
|
|
32538
32538
|
}
|
|
32539
32539
|
return {
|
|
32540
|
-
path:
|
|
32541
|
-
querystring:
|
|
32540
|
+
path: path20.slice(0, delimIndex),
|
|
32541
|
+
querystring: path20.slice(delimIndex + 1),
|
|
32542
32542
|
shouldDecodeParam: false
|
|
32543
32543
|
};
|
|
32544
32544
|
}
|
|
32545
|
-
return safeDecodeURIPercentScan(
|
|
32545
|
+
return safeDecodeURIPercentScan(path20, useSemicolonDelimiter, percentIndex);
|
|
32546
32546
|
}
|
|
32547
|
-
function safeDecodeURICharScan(
|
|
32548
|
-
for (let i = startIndex; i <
|
|
32549
|
-
const charCode =
|
|
32547
|
+
function safeDecodeURICharScan(path20, useSemicolonDelimiter, startIndex) {
|
|
32548
|
+
for (let i = startIndex; i < path20.length; i++) {
|
|
32549
|
+
const charCode = path20.charCodeAt(i);
|
|
32550
32550
|
if (charCode === 37) {
|
|
32551
|
-
return safeDecodeURIPercentScan(
|
|
32551
|
+
return safeDecodeURIPercentScan(path20, useSemicolonDelimiter, i);
|
|
32552
32552
|
} else if (charCode === 63 || charCode === 35 || charCode === 59 && useSemicolonDelimiter) {
|
|
32553
32553
|
return {
|
|
32554
|
-
path:
|
|
32555
|
-
querystring:
|
|
32554
|
+
path: path20.slice(0, i),
|
|
32555
|
+
querystring: path20.slice(i + 1),
|
|
32556
32556
|
shouldDecodeParam: false
|
|
32557
32557
|
};
|
|
32558
32558
|
}
|
|
32559
32559
|
}
|
|
32560
|
-
return { path:
|
|
32560
|
+
return { path: path20, querystring: "", shouldDecodeParam: false };
|
|
32561
32561
|
}
|
|
32562
|
-
function reencodePercentChar(
|
|
32563
|
-
return
|
|
32562
|
+
function reencodePercentChar(path20, index) {
|
|
32563
|
+
return path20.slice(0, index + 1) + "25" + path20.slice(index + 1);
|
|
32564
32564
|
}
|
|
32565
|
-
function safeDecodeURIPercentScan(
|
|
32565
|
+
function safeDecodeURIPercentScan(path20, useSemicolonDelimiter, startIndex) {
|
|
32566
32566
|
let shouldDecode = false;
|
|
32567
32567
|
let shouldDecodeParam = false;
|
|
32568
32568
|
let querystring = "";
|
|
32569
|
-
for (let i = startIndex; i <
|
|
32570
|
-
const charCode =
|
|
32569
|
+
for (let i = startIndex; i < path20.length; i++) {
|
|
32570
|
+
const charCode = path20.charCodeAt(i);
|
|
32571
32571
|
if (charCode === 37) {
|
|
32572
|
-
const componentCharCode = decodeComponentCharCode(
|
|
32572
|
+
const componentCharCode = decodeComponentCharCode(path20.charCodeAt(i + 1), path20.charCodeAt(i + 2));
|
|
32573
32573
|
if (componentCharCode === 0) {
|
|
32574
32574
|
shouldDecode = true;
|
|
32575
32575
|
} else {
|
|
32576
32576
|
shouldDecodeParam = true;
|
|
32577
32577
|
if (componentCharCode === 37) {
|
|
32578
32578
|
shouldDecode = true;
|
|
32579
|
-
|
|
32579
|
+
path20 = reencodePercentChar(path20, i);
|
|
32580
32580
|
i += 2;
|
|
32581
32581
|
}
|
|
32582
32582
|
i += 2;
|
|
32583
32583
|
}
|
|
32584
32584
|
} else if (charCode === 63 || charCode === 35 || charCode === 59 && useSemicolonDelimiter) {
|
|
32585
|
-
querystring =
|
|
32586
|
-
|
|
32585
|
+
querystring = path20.slice(i + 1);
|
|
32586
|
+
path20 = path20.slice(0, i);
|
|
32587
32587
|
break;
|
|
32588
32588
|
}
|
|
32589
32589
|
}
|
|
32590
|
-
const decodedPath = shouldDecode ? decodeURI(
|
|
32590
|
+
const decodedPath = shouldDecode ? decodeURI(path20) : path20;
|
|
32591
32591
|
return { path: decodedPath, querystring, shouldDecodeParam };
|
|
32592
32592
|
}
|
|
32593
32593
|
function safeDecodeURIComponent(uriComponent) {
|
|
@@ -32682,7 +32682,7 @@ var require_find_my_way = __commonJS({
|
|
|
32682
32682
|
this.trees = /* @__PURE__ */ Object.create(null);
|
|
32683
32683
|
this._treeGET = null;
|
|
32684
32684
|
}
|
|
32685
|
-
Router.prototype.on = function on(method,
|
|
32685
|
+
Router.prototype.on = function on(method, path20, opts, handler, store) {
|
|
32686
32686
|
if (typeof opts === "function") {
|
|
32687
32687
|
if (handler !== void 0) {
|
|
32688
32688
|
store = handler;
|
|
@@ -32690,34 +32690,34 @@ var require_find_my_way = __commonJS({
|
|
|
32690
32690
|
handler = opts;
|
|
32691
32691
|
opts = {};
|
|
32692
32692
|
}
|
|
32693
|
-
assert2(typeof
|
|
32694
|
-
assert2(
|
|
32695
|
-
assert2(
|
|
32693
|
+
assert2(typeof path20 === "string", "Path should be a string");
|
|
32694
|
+
assert2(path20.length > 0, "The path could not be empty");
|
|
32695
|
+
assert2(path20[0] === "/" || path20[0] === "*", "The first character of a path should be `/` or `*`");
|
|
32696
32696
|
assert2(typeof handler === "function", "Handler should be a function");
|
|
32697
|
-
const optionalParamMatch =
|
|
32697
|
+
const optionalParamMatch = path20.match(OPTIONAL_PARAM_REGEXP);
|
|
32698
32698
|
if (optionalParamMatch) {
|
|
32699
|
-
assert2(
|
|
32700
|
-
const pathFull =
|
|
32701
|
-
const pathOptional =
|
|
32699
|
+
assert2(path20.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
|
|
32700
|
+
const pathFull = path20.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
|
|
32701
|
+
const pathOptional = path20.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/";
|
|
32702
32702
|
this.on(method, pathFull, opts, handler, store);
|
|
32703
32703
|
this.on(method, pathOptional, opts, handler, store);
|
|
32704
32704
|
return;
|
|
32705
32705
|
}
|
|
32706
|
-
const route =
|
|
32706
|
+
const route = path20;
|
|
32707
32707
|
if (this.ignoreDuplicateSlashes) {
|
|
32708
|
-
|
|
32708
|
+
path20 = removeDuplicateSlashes(path20);
|
|
32709
32709
|
}
|
|
32710
32710
|
if (this.ignoreTrailingSlash) {
|
|
32711
|
-
|
|
32711
|
+
path20 = trimLastSlash(path20);
|
|
32712
32712
|
}
|
|
32713
32713
|
const methods = Array.isArray(method) ? method : [method];
|
|
32714
32714
|
for (const method2 of methods) {
|
|
32715
32715
|
assert2(typeof method2 === "string", "Method should be a string");
|
|
32716
32716
|
assert2(httpMethods.includes(method2), `Method '${method2}' is not an http method.`);
|
|
32717
|
-
this._on(method2,
|
|
32717
|
+
this._on(method2, path20, opts, handler, store, route);
|
|
32718
32718
|
}
|
|
32719
32719
|
};
|
|
32720
|
-
Router.prototype._on = function _on(method,
|
|
32720
|
+
Router.prototype._on = function _on(method, path20, opts, handler, store) {
|
|
32721
32721
|
let constraints = {};
|
|
32722
32722
|
if (opts.constraints !== void 0) {
|
|
32723
32723
|
assert2(typeof opts.constraints === "object" && opts.constraints !== null, "Constraints should be an object");
|
|
@@ -32730,7 +32730,7 @@ var require_find_my_way = __commonJS({
|
|
|
32730
32730
|
if (this.trees[method] === void 0) {
|
|
32731
32731
|
this.trees[method] = new StaticNode("/");
|
|
32732
32732
|
}
|
|
32733
|
-
let pattern =
|
|
32733
|
+
let pattern = path20;
|
|
32734
32734
|
if (pattern === "*" && this.trees[method].prefix.length !== 0) {
|
|
32735
32735
|
const currentRoot = this.trees[method];
|
|
32736
32736
|
this.trees[method] = new StaticNode("");
|
|
@@ -32838,19 +32838,19 @@ var require_find_my_way = __commonJS({
|
|
|
32838
32838
|
throw new Error(`Method '${method}' already declared for route '${pattern}' with constraints '${JSON.stringify(constraints)}'`);
|
|
32839
32839
|
}
|
|
32840
32840
|
}
|
|
32841
|
-
const route = { method, path:
|
|
32841
|
+
const route = { method, path: path20, pattern, params, opts, handler, store };
|
|
32842
32842
|
this.routes.push(route);
|
|
32843
32843
|
currentNode.addRoute(route, this.constrainer);
|
|
32844
32844
|
};
|
|
32845
|
-
Router.prototype.hasRoute = function hasRoute(method,
|
|
32846
|
-
const route = this.findRoute(method,
|
|
32845
|
+
Router.prototype.hasRoute = function hasRoute(method, path20, constraints) {
|
|
32846
|
+
const route = this.findRoute(method, path20, constraints);
|
|
32847
32847
|
return route !== null;
|
|
32848
32848
|
};
|
|
32849
|
-
Router.prototype.findRoute = function findNode(method,
|
|
32849
|
+
Router.prototype.findRoute = function findNode(method, path20, constraints = {}) {
|
|
32850
32850
|
if (this.trees[method] === void 0) {
|
|
32851
32851
|
return null;
|
|
32852
32852
|
}
|
|
32853
|
-
let pattern =
|
|
32853
|
+
let pattern = path20;
|
|
32854
32854
|
let currentNode = this.trees[method];
|
|
32855
32855
|
let parentNodePathIndex = currentNode.prefix.length;
|
|
32856
32856
|
const params = [];
|
|
@@ -32971,39 +32971,39 @@ var require_find_my_way = __commonJS({
|
|
|
32971
32971
|
this._treeGET = null;
|
|
32972
32972
|
this.routes = [];
|
|
32973
32973
|
};
|
|
32974
|
-
Router.prototype.off = function off(method,
|
|
32975
|
-
assert2(typeof
|
|
32976
|
-
assert2(
|
|
32977
|
-
assert2(
|
|
32974
|
+
Router.prototype.off = function off(method, path20, constraints) {
|
|
32975
|
+
assert2(typeof path20 === "string", "Path should be a string");
|
|
32976
|
+
assert2(path20.length > 0, "The path could not be empty");
|
|
32977
|
+
assert2(path20[0] === "/" || path20[0] === "*", "The first character of a path should be `/` or `*`");
|
|
32978
32978
|
assert2(
|
|
32979
32979
|
typeof constraints === "undefined" || typeof constraints === "object" && !Array.isArray(constraints) && constraints !== null,
|
|
32980
32980
|
"Constraints should be an object or undefined."
|
|
32981
32981
|
);
|
|
32982
|
-
const optionalParamMatch =
|
|
32982
|
+
const optionalParamMatch = path20.match(OPTIONAL_PARAM_REGEXP);
|
|
32983
32983
|
if (optionalParamMatch) {
|
|
32984
|
-
assert2(
|
|
32985
|
-
const pathFull =
|
|
32986
|
-
const pathOptional =
|
|
32984
|
+
assert2(path20.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
|
|
32985
|
+
const pathFull = path20.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
|
|
32986
|
+
const pathOptional = path20.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/";
|
|
32987
32987
|
this.off(method, pathFull, constraints);
|
|
32988
32988
|
this.off(method, pathOptional, constraints);
|
|
32989
32989
|
return;
|
|
32990
32990
|
}
|
|
32991
32991
|
if (this.ignoreDuplicateSlashes) {
|
|
32992
|
-
|
|
32992
|
+
path20 = removeDuplicateSlashes(path20);
|
|
32993
32993
|
}
|
|
32994
32994
|
if (this.ignoreTrailingSlash) {
|
|
32995
|
-
|
|
32995
|
+
path20 = trimLastSlash(path20);
|
|
32996
32996
|
}
|
|
32997
32997
|
const methods = Array.isArray(method) ? method : [method];
|
|
32998
32998
|
for (const method2 of methods) {
|
|
32999
|
-
this._off(method2,
|
|
32999
|
+
this._off(method2, path20, constraints);
|
|
33000
33000
|
}
|
|
33001
33001
|
};
|
|
33002
|
-
Router.prototype._off = function _off(method,
|
|
33002
|
+
Router.prototype._off = function _off(method, path20, constraints) {
|
|
33003
33003
|
assert2(typeof method === "string", "Method should be a string");
|
|
33004
33004
|
assert2(httpMethods.includes(method), `Method '${method}' is not an http method.`);
|
|
33005
33005
|
function matcherWithoutConstraints(route) {
|
|
33006
|
-
return method !== route.method ||
|
|
33006
|
+
return method !== route.method || path20 !== route.path;
|
|
33007
33007
|
}
|
|
33008
33008
|
function matcherWithConstraints(route) {
|
|
33009
33009
|
return matcherWithoutConstraints(route) || !deepEqual(constraints, route.opts.constraints || {});
|
|
@@ -33040,37 +33040,37 @@ var require_find_my_way = __commonJS({
|
|
|
33040
33040
|
if (handle === null) return this._defaultRoute(req, res, ctx);
|
|
33041
33041
|
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);
|
|
33042
33042
|
};
|
|
33043
|
-
Router.prototype.find = function find(method,
|
|
33043
|
+
Router.prototype.find = function find(method, path20, derivedConstraints) {
|
|
33044
33044
|
let currentNode = method === "GET" ? this._treeGET : this.trees[method];
|
|
33045
33045
|
if (currentNode == null) return null;
|
|
33046
|
-
if (
|
|
33047
|
-
|
|
33046
|
+
if (path20.charCodeAt(0) !== 47) {
|
|
33047
|
+
path20 = path20.replace(FULL_PATH_REGEXP, "/");
|
|
33048
33048
|
}
|
|
33049
33049
|
if (this.ignoreDuplicateSlashes) {
|
|
33050
|
-
|
|
33050
|
+
path20 = removeDuplicateSlashes(path20);
|
|
33051
33051
|
}
|
|
33052
33052
|
let sanitizedUrl;
|
|
33053
33053
|
let querystring2;
|
|
33054
33054
|
let shouldDecodeParam;
|
|
33055
33055
|
try {
|
|
33056
|
-
sanitizedUrl =
|
|
33057
|
-
|
|
33056
|
+
sanitizedUrl = path20.length >= MIN_NATIVE_SCAN_LENGTH ? safeDecodeURINativeScan(path20, this.useSemicolonDelimiter) : safeDecodeURICharScan(path20, this.useSemicolonDelimiter, 1);
|
|
33057
|
+
path20 = sanitizedUrl.path;
|
|
33058
33058
|
querystring2 = sanitizedUrl.querystring;
|
|
33059
33059
|
shouldDecodeParam = sanitizedUrl.shouldDecodeParam;
|
|
33060
33060
|
} catch (error51) {
|
|
33061
|
-
return this._onBadUrl(
|
|
33061
|
+
return this._onBadUrl(path20);
|
|
33062
33062
|
}
|
|
33063
33063
|
if (this.ignoreTrailingSlash) {
|
|
33064
|
-
|
|
33064
|
+
path20 = trimLastSlash(path20);
|
|
33065
33065
|
}
|
|
33066
|
-
const originPath =
|
|
33066
|
+
const originPath = path20;
|
|
33067
33067
|
if (this.caseSensitive === false) {
|
|
33068
|
-
|
|
33068
|
+
path20 = path20.toLowerCase();
|
|
33069
33069
|
}
|
|
33070
33070
|
const maxParamLength = this.maxParamLength;
|
|
33071
33071
|
let pathIndex = currentNode.prefix.length;
|
|
33072
33072
|
const params = [];
|
|
33073
|
-
const pathLen =
|
|
33073
|
+
const pathLen = path20.length;
|
|
33074
33074
|
const brothersNodesStack = [];
|
|
33075
33075
|
let maxParamLengthExceeded = false;
|
|
33076
33076
|
while (true) {
|
|
@@ -33085,7 +33085,7 @@ var require_find_my_way = __commonJS({
|
|
|
33085
33085
|
};
|
|
33086
33086
|
}
|
|
33087
33087
|
}
|
|
33088
|
-
let node = currentNode.getNextNode(
|
|
33088
|
+
let node = currentNode.getNextNode(path20, pathIndex, brothersNodesStack, params.length);
|
|
33089
33089
|
if (node === null) {
|
|
33090
33090
|
if (brothersNodesStack.length === 0) {
|
|
33091
33091
|
if (maxParamLengthExceeded && this.onMaxParamLength) {
|
|
@@ -33186,8 +33186,8 @@ var require_find_my_way = __commonJS({
|
|
|
33186
33186
|
Router.prototype._rebuild = function(routes) {
|
|
33187
33187
|
this.reset();
|
|
33188
33188
|
for (const route of routes) {
|
|
33189
|
-
const { method, path:
|
|
33190
|
-
this._on(method,
|
|
33189
|
+
const { method, path: path20, opts, handler, store } = route;
|
|
33190
|
+
this._on(method, path20, opts, handler, store);
|
|
33191
33191
|
}
|
|
33192
33192
|
};
|
|
33193
33193
|
Router.prototype._defaultRoute = function(req, res, ctx) {
|
|
@@ -33198,24 +33198,24 @@ var require_find_my_way = __commonJS({
|
|
|
33198
33198
|
res.end();
|
|
33199
33199
|
}
|
|
33200
33200
|
};
|
|
33201
|
-
Router.prototype._onBadUrl = function(
|
|
33201
|
+
Router.prototype._onBadUrl = function(path20) {
|
|
33202
33202
|
if (this.onBadUrl === null) {
|
|
33203
33203
|
return null;
|
|
33204
33204
|
}
|
|
33205
33205
|
const onBadUrl = this.onBadUrl;
|
|
33206
33206
|
return {
|
|
33207
|
-
handler: (req, res, ctx) => onBadUrl(
|
|
33207
|
+
handler: (req, res, ctx) => onBadUrl(path20, req, res),
|
|
33208
33208
|
params: {},
|
|
33209
33209
|
store: null
|
|
33210
33210
|
};
|
|
33211
33211
|
};
|
|
33212
|
-
Router.prototype._onMaxParamLength = function(
|
|
33212
|
+
Router.prototype._onMaxParamLength = function(path20) {
|
|
33213
33213
|
if (this.onMaxParamLength === null) {
|
|
33214
33214
|
return null;
|
|
33215
33215
|
}
|
|
33216
33216
|
const onMaxParamLength = this.onMaxParamLength;
|
|
33217
33217
|
return {
|
|
33218
|
-
handler: (req, res, ctx) => onMaxParamLength(
|
|
33218
|
+
handler: (req, res, ctx) => onMaxParamLength(path20, req, res),
|
|
33219
33219
|
params: {},
|
|
33220
33220
|
store: null
|
|
33221
33221
|
};
|
|
@@ -33247,12 +33247,12 @@ var require_find_my_way = __commonJS({
|
|
|
33247
33247
|
if (!httpMethods.hasOwnProperty(i)) continue;
|
|
33248
33248
|
const m = httpMethods[i];
|
|
33249
33249
|
const methodName = m.toLowerCase();
|
|
33250
|
-
Router.prototype[methodName] = function(
|
|
33251
|
-
return this.on(m,
|
|
33250
|
+
Router.prototype[methodName] = function(path20, handler, store) {
|
|
33251
|
+
return this.on(m, path20, handler, store);
|
|
33252
33252
|
};
|
|
33253
33253
|
}
|
|
33254
|
-
Router.prototype.all = function(
|
|
33255
|
-
this.on(httpMethods,
|
|
33254
|
+
Router.prototype.all = function(path20, handler, store) {
|
|
33255
|
+
this.on(httpMethods, path20, handler, store);
|
|
33256
33256
|
};
|
|
33257
33257
|
Router.sanitizeUrlPath = function sanitizeUrlPath(url2, useSemicolonDelimiter) {
|
|
33258
33258
|
const decoded = safeDecodeURI(url2, useSemicolonDelimiter);
|
|
@@ -33267,14 +33267,14 @@ var require_find_my_way = __commonJS({
|
|
|
33267
33267
|
function escapeRegExp(string4) {
|
|
33268
33268
|
return string4.replace(ESCAPE_REGEXP, "\\$&");
|
|
33269
33269
|
}
|
|
33270
|
-
function removeDuplicateSlashes(
|
|
33271
|
-
return
|
|
33270
|
+
function removeDuplicateSlashes(path20) {
|
|
33271
|
+
return path20.indexOf("//") !== -1 ? path20.replace(REMOVE_DUPLICATE_SLASHES_REGEXP, "/") : path20;
|
|
33272
33272
|
}
|
|
33273
|
-
function trimLastSlash(
|
|
33274
|
-
if (
|
|
33275
|
-
return
|
|
33273
|
+
function trimLastSlash(path20) {
|
|
33274
|
+
if (path20.length > 1 && path20.charCodeAt(path20.length - 1) === 47) {
|
|
33275
|
+
return path20.slice(0, -1);
|
|
33276
33276
|
}
|
|
33277
|
-
return
|
|
33277
|
+
return path20;
|
|
33278
33278
|
}
|
|
33279
33279
|
function trimRegExpStartAndEnd(regexString) {
|
|
33280
33280
|
if (regexString.charCodeAt(1) === 94) {
|
|
@@ -33285,22 +33285,22 @@ var require_find_my_way = __commonJS({
|
|
|
33285
33285
|
}
|
|
33286
33286
|
return regexString;
|
|
33287
33287
|
}
|
|
33288
|
-
function getClosingParenthensePosition(
|
|
33288
|
+
function getClosingParenthensePosition(path20, idx) {
|
|
33289
33289
|
let parentheses = 1;
|
|
33290
|
-
while (idx <
|
|
33290
|
+
while (idx < path20.length) {
|
|
33291
33291
|
idx++;
|
|
33292
|
-
if (
|
|
33292
|
+
if (path20.charCodeAt(idx) === 92) {
|
|
33293
33293
|
idx++;
|
|
33294
33294
|
continue;
|
|
33295
33295
|
}
|
|
33296
|
-
if (
|
|
33296
|
+
if (path20.charCodeAt(idx) === 41) {
|
|
33297
33297
|
parentheses--;
|
|
33298
|
-
} else if (
|
|
33298
|
+
} else if (path20.charCodeAt(idx) === 40) {
|
|
33299
33299
|
parentheses++;
|
|
33300
33300
|
}
|
|
33301
33301
|
if (!parentheses) return idx;
|
|
33302
33302
|
}
|
|
33303
|
-
throw new TypeError('Invalid regexp expression in "' +
|
|
33303
|
+
throw new TypeError('Invalid regexp expression in "' + path20 + '"');
|
|
33304
33304
|
}
|
|
33305
33305
|
function defaultBuildPrettyMeta(route) {
|
|
33306
33306
|
if (!route) return {};
|
|
@@ -33533,12 +33533,12 @@ var require_route = __commonJS({
|
|
|
33533
33533
|
function route({ options: options2, isFastify }) {
|
|
33534
33534
|
throwIfAlreadyStarted("Cannot add route!");
|
|
33535
33535
|
const opts = { ...options2 };
|
|
33536
|
-
const
|
|
33536
|
+
const path20 = opts.url || opts.path || "";
|
|
33537
33537
|
if (!opts.handler) {
|
|
33538
|
-
throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method,
|
|
33538
|
+
throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method, path20);
|
|
33539
33539
|
}
|
|
33540
33540
|
if (opts.errorHandler !== void 0 && typeof opts.errorHandler !== "function") {
|
|
33541
|
-
throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method,
|
|
33541
|
+
throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method, path20);
|
|
33542
33542
|
}
|
|
33543
33543
|
validateBodyLimitOption(opts.bodyLimit);
|
|
33544
33544
|
validateHandlerTimeoutOption(opts.handlerTimeout);
|
|
@@ -33548,22 +33548,22 @@ var require_route = __commonJS({
|
|
|
33548
33548
|
if (Array.isArray(opts.method)) {
|
|
33549
33549
|
for (let i = 0; i < opts.method.length; ++i) {
|
|
33550
33550
|
opts.method[i] = normalizeAndValidateMethod.call(this, opts.method[i]);
|
|
33551
|
-
validateSchemaBodyOption.call(this, opts.method[i],
|
|
33551
|
+
validateSchemaBodyOption.call(this, opts.method[i], path20, opts.schema);
|
|
33552
33552
|
isGetRoute = opts.method.includes("GET");
|
|
33553
33553
|
isHeadRoute = opts.method.includes("HEAD");
|
|
33554
33554
|
}
|
|
33555
33555
|
} else {
|
|
33556
33556
|
opts.method = normalizeAndValidateMethod.call(this, opts.method);
|
|
33557
|
-
validateSchemaBodyOption.call(this, opts.method,
|
|
33557
|
+
validateSchemaBodyOption.call(this, opts.method, path20, opts.schema);
|
|
33558
33558
|
isGetRoute = opts.method === "GET";
|
|
33559
33559
|
isHeadRoute = opts.method === "HEAD";
|
|
33560
33560
|
}
|
|
33561
33561
|
const headOpts = shouldExposeHead && isGetRoute ? { ...options2 } : null;
|
|
33562
33562
|
const prefix = this[kRoutePrefix];
|
|
33563
|
-
if (
|
|
33563
|
+
if (path20 === "/" && prefix.length > 0 && opts.method !== "HEAD") {
|
|
33564
33564
|
switch (opts.prefixTrailingSlash) {
|
|
33565
33565
|
case "slash":
|
|
33566
|
-
addNewRoute.call(this, { path:
|
|
33566
|
+
addNewRoute.call(this, { path: path20, isFastify });
|
|
33567
33567
|
break;
|
|
33568
33568
|
case "no-slash":
|
|
33569
33569
|
addNewRoute.call(this, { path: "", isFastify });
|
|
@@ -33572,20 +33572,20 @@ var require_route = __commonJS({
|
|
|
33572
33572
|
default:
|
|
33573
33573
|
addNewRoute.call(this, { path: "", isFastify });
|
|
33574
33574
|
if (ignoreTrailingSlash !== true && (ignoreDuplicateSlashes !== true || !prefix.endsWith("/"))) {
|
|
33575
|
-
addNewRoute.call(this, { path:
|
|
33575
|
+
addNewRoute.call(this, { path: path20, prefixing: true, isFastify });
|
|
33576
33576
|
}
|
|
33577
33577
|
}
|
|
33578
|
-
} else if (
|
|
33579
|
-
addNewRoute.call(this, { path:
|
|
33578
|
+
} else if (path20[0] === "/" && prefix.endsWith("/")) {
|
|
33579
|
+
addNewRoute.call(this, { path: path20.slice(1), isFastify });
|
|
33580
33580
|
} else {
|
|
33581
|
-
addNewRoute.call(this, { path:
|
|
33581
|
+
addNewRoute.call(this, { path: path20, isFastify });
|
|
33582
33582
|
}
|
|
33583
33583
|
return this;
|
|
33584
|
-
function addNewRoute({ path:
|
|
33585
|
-
const url2 = prefix +
|
|
33584
|
+
function addNewRoute({ path: path21, prefixing = false, isFastify: isFastify2 = false }) {
|
|
33585
|
+
const url2 = prefix + path21;
|
|
33586
33586
|
opts.url = url2;
|
|
33587
33587
|
opts.path = url2;
|
|
33588
|
-
opts.routePath =
|
|
33588
|
+
opts.routePath = path21;
|
|
33589
33589
|
opts.prefix = prefix;
|
|
33590
33590
|
opts.logLevel = opts.logLevel || this[kLogLevel];
|
|
33591
33591
|
validateLogLevelOption(opts.logLevel, opts.method, opts.url, logger);
|
|
@@ -33717,7 +33717,7 @@ var require_route = __commonJS({
|
|
|
33717
33717
|
});
|
|
33718
33718
|
if (shouldExposeHead && isGetRoute && !isHeadRoute && !hasHEADHandler) {
|
|
33719
33719
|
const onSendHandlers = parseHeadOnSendHandlers(headOpts.onSend);
|
|
33720
|
-
prepareRoute.call(this, { method: "HEAD", url:
|
|
33720
|
+
prepareRoute.call(this, { method: "HEAD", url: path21, options: { ...headOpts, onSend: onSendHandlers }, isFastify: true });
|
|
33721
33721
|
}
|
|
33722
33722
|
}
|
|
33723
33723
|
}
|
|
@@ -33841,9 +33841,9 @@ var require_route = __commonJS({
|
|
|
33841
33841
|
}
|
|
33842
33842
|
return method;
|
|
33843
33843
|
}
|
|
33844
|
-
function validateSchemaBodyOption(method,
|
|
33844
|
+
function validateSchemaBodyOption(method, path20, schema) {
|
|
33845
33845
|
if (this[kSupportedHTTPMethods].bodyless.has(method) && schema?.body) {
|
|
33846
|
-
throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method,
|
|
33846
|
+
throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method, path20);
|
|
33847
33847
|
}
|
|
33848
33848
|
}
|
|
33849
33849
|
function validateBodyLimitOption(bodyLimit) {
|
|
@@ -33858,11 +33858,11 @@ var require_route = __commonJS({
|
|
|
33858
33858
|
throw new FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT(handlerTimeout);
|
|
33859
33859
|
}
|
|
33860
33860
|
}
|
|
33861
|
-
function validateLogLevelOption(logLevel, method,
|
|
33861
|
+
function validateLogLevelOption(logLevel, method, path20, logger) {
|
|
33862
33862
|
if (logLevel == null || logLevel === "") return;
|
|
33863
33863
|
if (logger?.levels?.values == null) return;
|
|
33864
33864
|
if (typeof logLevel !== "string" || logger.levels.values[logLevel] === void 0) {
|
|
33865
|
-
throw new FST_ERR_ROUTE_LOG_LEVEL_INVALID(method,
|
|
33865
|
+
throw new FST_ERR_ROUTE_LOG_LEVEL_INVALID(method, path20, logLevel);
|
|
33866
33866
|
}
|
|
33867
33867
|
}
|
|
33868
33868
|
function runPreParsing(err, request, reply) {
|
|
@@ -33951,7 +33951,7 @@ var require_four_oh_four = __commonJS({
|
|
|
33951
33951
|
});
|
|
33952
33952
|
}
|
|
33953
33953
|
function createRouteEventHandler() {
|
|
33954
|
-
return function onRouteEvent(
|
|
33954
|
+
return function onRouteEvent(path20, req, res) {
|
|
33955
33955
|
const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext];
|
|
33956
33956
|
const id = getGenReqId(fourOhFourContext.server, req);
|
|
33957
33957
|
const childLogger = createChildLogger(fourOhFourContext, logger, req, id);
|
|
@@ -36622,19 +36622,19 @@ var require_fastify = __commonJS({
|
|
|
36622
36622
|
}
|
|
36623
36623
|
fourOhFour.router.lookup(req, res);
|
|
36624
36624
|
}
|
|
36625
|
-
function onBadUrl(
|
|
36625
|
+
function onBadUrl(path20, req, res) {
|
|
36626
36626
|
if (options.frameworkErrors) {
|
|
36627
36627
|
const id = getGenReqId(routeEventContext.server, req);
|
|
36628
36628
|
const childLogger = createChildLogger(routeEventContext, options.logger, req, id);
|
|
36629
36629
|
const request = new Request(id, null, req, null, childLogger, routeEventContext);
|
|
36630
36630
|
const reply = new Reply(res, request, childLogger);
|
|
36631
36631
|
routeEventContext.server[kLogController].incomingRequest(request, reply);
|
|
36632
|
-
return options.frameworkErrors(new FST_ERR_BAD_URL(
|
|
36632
|
+
return options.frameworkErrors(new FST_ERR_BAD_URL(path20), request, reply);
|
|
36633
36633
|
}
|
|
36634
36634
|
const body = JSON.stringify({
|
|
36635
36635
|
error: "Bad Request",
|
|
36636
36636
|
code: "FST_ERR_BAD_URL",
|
|
36637
|
-
message: `'${
|
|
36637
|
+
message: `'${path20}' is not a valid url component`,
|
|
36638
36638
|
statusCode: 400
|
|
36639
36639
|
});
|
|
36640
36640
|
res.writeHead(400, {
|
|
@@ -36643,19 +36643,19 @@ var require_fastify = __commonJS({
|
|
|
36643
36643
|
});
|
|
36644
36644
|
res.end(body);
|
|
36645
36645
|
}
|
|
36646
|
-
function onMaxParamLength(
|
|
36646
|
+
function onMaxParamLength(path20, req, res) {
|
|
36647
36647
|
if (options.frameworkErrors) {
|
|
36648
36648
|
const id = getGenReqId(routeEventContext.server, req);
|
|
36649
36649
|
const childLogger = createChildLogger(routeEventContext, options.logger, req, id);
|
|
36650
36650
|
const request = new Request(id, null, req, null, childLogger, routeEventContext);
|
|
36651
36651
|
const reply = new Reply(res, request, childLogger);
|
|
36652
36652
|
routeEventContext.server[kLogController].incomingRequest(request, reply);
|
|
36653
|
-
return options.frameworkErrors(new FST_ERR_MAX_PARAM_LENGTH(
|
|
36653
|
+
return options.frameworkErrors(new FST_ERR_MAX_PARAM_LENGTH(path20), request, reply);
|
|
36654
36654
|
}
|
|
36655
36655
|
const body = JSON.stringify({
|
|
36656
36656
|
error: "Bad Request",
|
|
36657
36657
|
code: "FST_ERR_MAX_PARAM_LENGTH",
|
|
36658
|
-
message: `'${
|
|
36658
|
+
message: `'${path20}' is exceeding the max param length`,
|
|
36659
36659
|
statusCode: 414
|
|
36660
36660
|
});
|
|
36661
36661
|
res.writeHead(414, {
|
|
@@ -41001,13 +41001,13 @@ var require_websocket_server = __commonJS({
|
|
|
41001
41001
|
// src/server.ts
|
|
41002
41002
|
var import_fastify = __toESM(require_fastify(), 1);
|
|
41003
41003
|
var import_cors = __toESM(require_cors(), 1);
|
|
41004
|
-
import
|
|
41004
|
+
import path19 from "node:path";
|
|
41005
41005
|
|
|
41006
41006
|
// src/db/index.ts
|
|
41007
41007
|
import Database from "better-sqlite3";
|
|
41008
41008
|
var db;
|
|
41009
|
-
function initDb(
|
|
41010
|
-
db = new Database(
|
|
41009
|
+
function initDb(path20 = "data.db") {
|
|
41010
|
+
db = new Database(path20);
|
|
41011
41011
|
db.pragma("journal_mode = WAL");
|
|
41012
41012
|
db.pragma("foreign_keys = ON");
|
|
41013
41013
|
createTables(db);
|
|
@@ -43460,9 +43460,9 @@ async function browseFolder(input, opts = {}) {
|
|
|
43460
43460
|
const atHome = dir === nodePath.resolve(home);
|
|
43461
43461
|
const folders = await Promise.all(
|
|
43462
43462
|
names.slice(0, limit).map(async (name) => {
|
|
43463
|
-
const
|
|
43463
|
+
const path20 = nodePath.join(dir, name);
|
|
43464
43464
|
const skipProbe = atHome && HOME_STANDARD_FOLDERS.has(name) || dir === "/Volumes";
|
|
43465
|
-
return { name, path:
|
|
43465
|
+
return { name, path: path20, git: !skipProbe && await exists(nodePath.join(path20, ".git")) };
|
|
43466
43466
|
})
|
|
43467
43467
|
);
|
|
43468
43468
|
const parent = nodePath.dirname(dir);
|
|
@@ -43500,11 +43500,11 @@ async function registerWorkspaceRoutes(fastify) {
|
|
|
43500
43500
|
}
|
|
43501
43501
|
}
|
|
43502
43502
|
}, async (request, reply) => {
|
|
43503
|
-
const { path:
|
|
43504
|
-
if (!
|
|
43503
|
+
const { path: path20, label = null } = request.body || {};
|
|
43504
|
+
if (!path20 || !path20.trim()) {
|
|
43505
43505
|
return reply.code(400).send({ error: "Path is required" });
|
|
43506
43506
|
}
|
|
43507
|
-
const resolved = await resolveWorkspacePath(
|
|
43507
|
+
const resolved = await resolveWorkspacePath(path20);
|
|
43508
43508
|
if ("error" in resolved) {
|
|
43509
43509
|
return reply.code(400).send({ error: resolved.error });
|
|
43510
43510
|
}
|
|
@@ -43546,8 +43546,8 @@ async function registerWorkspaceRoutes(fastify) {
|
|
|
43546
43546
|
"-e",
|
|
43547
43547
|
'POSIX path of (choose folder with prompt "Select a workspace directory")'
|
|
43548
43548
|
]);
|
|
43549
|
-
const
|
|
43550
|
-
return { path:
|
|
43549
|
+
const path20 = stdout.trim().replace(/\/$/, "");
|
|
43550
|
+
return { path: path20 };
|
|
43551
43551
|
} catch {
|
|
43552
43552
|
return reply.code(204).send({ cancelled: true });
|
|
43553
43553
|
}
|
|
@@ -43563,11 +43563,11 @@ async function registerWorkspaceRoutes(fastify) {
|
|
|
43563
43563
|
}
|
|
43564
43564
|
}
|
|
43565
43565
|
}, async (request, reply) => {
|
|
43566
|
-
const { path:
|
|
43567
|
-
if (!
|
|
43566
|
+
const { path: path20 } = request.body || {};
|
|
43567
|
+
if (!path20 || !path20.trim()) {
|
|
43568
43568
|
return reply.code(400).send({ error: "Path is required" });
|
|
43569
43569
|
}
|
|
43570
|
-
const trimmedPath =
|
|
43570
|
+
const trimmedPath = path20.trim();
|
|
43571
43571
|
const db2 = getDb();
|
|
43572
43572
|
const existing = db2.prepare("SELECT * FROM workspaces WHERE path = ?").get(trimmedPath);
|
|
43573
43573
|
if (existing) {
|
|
@@ -44301,17 +44301,17 @@ async function registerPerfLogRoutes(fastify) {
|
|
|
44301
44301
|
if (entries.length === 0) {
|
|
44302
44302
|
return reply.send({ written: 0 });
|
|
44303
44303
|
}
|
|
44304
|
-
const
|
|
44304
|
+
const path20 = perfLogPath();
|
|
44305
44305
|
try {
|
|
44306
|
-
mkdirSync2(dirname(
|
|
44306
|
+
mkdirSync2(dirname(path20), { recursive: true });
|
|
44307
44307
|
try {
|
|
44308
|
-
if (statSync(
|
|
44309
|
-
renameSync(
|
|
44308
|
+
if (statSync(path20).size > MAX_BYTES) {
|
|
44309
|
+
renameSync(path20, `${path20}.1`);
|
|
44310
44310
|
}
|
|
44311
44311
|
} catch {
|
|
44312
44312
|
}
|
|
44313
44313
|
const lines = entries.map((e) => `${new Date(e.t).toISOString()} [${oneLine(e.cat)}] ${oneLine(e.msg)}`).join("\n");
|
|
44314
|
-
appendFileSync(
|
|
44314
|
+
appendFileSync(path20, `${lines}
|
|
44315
44315
|
`, "utf-8");
|
|
44316
44316
|
return reply.send({ written: entries.length });
|
|
44317
44317
|
} catch (err) {
|
|
@@ -102830,10 +102830,10 @@ function mergeDefs(...defs) {
|
|
|
102830
102830
|
function cloneDef(schema) {
|
|
102831
102831
|
return mergeDefs(schema._zod.def);
|
|
102832
102832
|
}
|
|
102833
|
-
function getElementAtPath(obj2,
|
|
102834
|
-
if (!
|
|
102833
|
+
function getElementAtPath(obj2, path20) {
|
|
102834
|
+
if (!path20)
|
|
102835
102835
|
return obj2;
|
|
102836
|
-
return
|
|
102836
|
+
return path20.reduce((acc, key) => acc?.[key], obj2);
|
|
102837
102837
|
}
|
|
102838
102838
|
function promiseAllObject(promisesObj) {
|
|
102839
102839
|
const keys = Object.keys(promisesObj);
|
|
@@ -103242,11 +103242,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
103242
103242
|
}
|
|
103243
103243
|
return false;
|
|
103244
103244
|
}
|
|
103245
|
-
function prefixIssues(
|
|
103245
|
+
function prefixIssues(path20, issues) {
|
|
103246
103246
|
return issues.map((iss) => {
|
|
103247
103247
|
var _a3;
|
|
103248
103248
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
103249
|
-
iss.path.unshift(
|
|
103249
|
+
iss.path.unshift(path20);
|
|
103250
103250
|
return iss;
|
|
103251
103251
|
});
|
|
103252
103252
|
}
|
|
@@ -103393,16 +103393,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
103393
103393
|
}
|
|
103394
103394
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
103395
103395
|
const fieldErrors = { _errors: [] };
|
|
103396
|
-
const processError = (error52,
|
|
103396
|
+
const processError = (error52, path20 = []) => {
|
|
103397
103397
|
for (const issue2 of error52.issues) {
|
|
103398
103398
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
103399
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
103399
|
+
issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
|
|
103400
103400
|
} else if (issue2.code === "invalid_key") {
|
|
103401
|
-
processError({ issues: issue2.issues }, [...
|
|
103401
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103402
103402
|
} else if (issue2.code === "invalid_element") {
|
|
103403
|
-
processError({ issues: issue2.issues }, [...
|
|
103403
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103404
103404
|
} else {
|
|
103405
|
-
const fullpath = [...
|
|
103405
|
+
const fullpath = [...path20, ...issue2.path];
|
|
103406
103406
|
if (fullpath.length === 0) {
|
|
103407
103407
|
fieldErrors._errors.push(mapper(issue2));
|
|
103408
103408
|
} else {
|
|
@@ -103429,17 +103429,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
103429
103429
|
}
|
|
103430
103430
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
103431
103431
|
const result = { errors: [] };
|
|
103432
|
-
const processError = (error52,
|
|
103432
|
+
const processError = (error52, path20 = []) => {
|
|
103433
103433
|
var _a3, _b;
|
|
103434
103434
|
for (const issue2 of error52.issues) {
|
|
103435
103435
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
103436
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
103436
|
+
issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
|
|
103437
103437
|
} else if (issue2.code === "invalid_key") {
|
|
103438
|
-
processError({ issues: issue2.issues }, [...
|
|
103438
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103439
103439
|
} else if (issue2.code === "invalid_element") {
|
|
103440
|
-
processError({ issues: issue2.issues }, [...
|
|
103440
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103441
103441
|
} else {
|
|
103442
|
-
const fullpath = [...
|
|
103442
|
+
const fullpath = [...path20, ...issue2.path];
|
|
103443
103443
|
if (fullpath.length === 0) {
|
|
103444
103444
|
result.errors.push(mapper(issue2));
|
|
103445
103445
|
continue;
|
|
@@ -103471,8 +103471,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
103471
103471
|
}
|
|
103472
103472
|
function toDotPath(_path) {
|
|
103473
103473
|
const segs = [];
|
|
103474
|
-
const
|
|
103475
|
-
for (const seg of
|
|
103474
|
+
const path20 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
103475
|
+
for (const seg of path20) {
|
|
103476
103476
|
if (typeof seg === "number")
|
|
103477
103477
|
segs.push(`[${seg}]`);
|
|
103478
103478
|
else if (typeof seg === "symbol")
|
|
@@ -116164,13 +116164,13 @@ function resolveRef(ref, ctx) {
|
|
|
116164
116164
|
if (!ref.startsWith("#")) {
|
|
116165
116165
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
116166
116166
|
}
|
|
116167
|
-
const
|
|
116168
|
-
if (
|
|
116167
|
+
const path20 = ref.slice(1).split("/").filter(Boolean);
|
|
116168
|
+
if (path20.length === 0) {
|
|
116169
116169
|
return ctx.rootSchema;
|
|
116170
116170
|
}
|
|
116171
116171
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
116172
|
-
if (
|
|
116173
|
-
const key =
|
|
116172
|
+
if (path20[0] === defsKey) {
|
|
116173
|
+
const key = path20[1];
|
|
116174
116174
|
if (!key || !ctx.defs[key]) {
|
|
116175
116175
|
throw new Error(`Reference not found: ${ref}`);
|
|
116176
116176
|
}
|
|
@@ -116695,9 +116695,9 @@ function mapToolUse(block) {
|
|
|
116695
116695
|
};
|
|
116696
116696
|
}
|
|
116697
116697
|
function deriveFileChangeData(input, toolName) {
|
|
116698
|
-
const
|
|
116698
|
+
const path20 = input.file_path ?? input.notebook_path ?? "";
|
|
116699
116699
|
const kind = toolName === "Write" ? "add" : "modify";
|
|
116700
|
-
return { changes: [{ path:
|
|
116700
|
+
return { changes: [{ path: path20, kind }], status: "in_progress" };
|
|
116701
116701
|
}
|
|
116702
116702
|
function extractToolResultText(content) {
|
|
116703
116703
|
if (!content) return "";
|
|
@@ -118984,6 +118984,148 @@ function mapTokenUsage(data) {
|
|
|
118984
118984
|
};
|
|
118985
118985
|
}
|
|
118986
118986
|
|
|
118987
|
+
// src/tabtape/browser-mcp.ts
|
|
118988
|
+
import { spawn as spawn6 } from "node:child_process";
|
|
118989
|
+
import fs11 from "node:fs";
|
|
118990
|
+
import os6 from "node:os";
|
|
118991
|
+
import path17 from "node:path";
|
|
118992
|
+
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
118993
|
+
var TABTAPE_MCP_NAME = "tabtape";
|
|
118994
|
+
var PLAYWRIGHT_MCP_NAME = "playwright";
|
|
118995
|
+
var PROBE_TIMEOUT_MS = 1500;
|
|
118996
|
+
var PROBE_RETRY_MS = 3e4;
|
|
118997
|
+
var PLAYWRIGHT_STARTUP_TIMEOUT_SEC = 120;
|
|
118998
|
+
var NONE = { tabtape: null, playwright: null };
|
|
118999
|
+
function disabled() {
|
|
119000
|
+
return process.env.REPOBURG_BROWSER_MCP === "0" || process.env.REPOBURG_TABTAPE === "0";
|
|
119001
|
+
}
|
|
119002
|
+
function tabtapeBaseUrl() {
|
|
119003
|
+
return (process.env.AGENT_PANE_TABTAPE_URL || `${sessionHostDaemonUrl()}/tabtape`).replace(/\/+$/, "");
|
|
119004
|
+
}
|
|
119005
|
+
function playwrightMcpScript(from = path17.dirname(fileURLToPath5(import.meta.url))) {
|
|
119006
|
+
if (scriptOverride !== void 0) return scriptOverride;
|
|
119007
|
+
let dir = from;
|
|
119008
|
+
for (let i = 0; i < 6; i++) {
|
|
119009
|
+
const script = path17.join(dir, "tabtape", "playwright", "mcp.mjs");
|
|
119010
|
+
if (fs11.existsSync(script) && fs11.existsSync(path17.join(dir, "tabtape", "extension", "dist", "manifest.json"))) {
|
|
119011
|
+
return script;
|
|
119012
|
+
}
|
|
119013
|
+
const parent = path17.dirname(dir);
|
|
119014
|
+
if (parent === dir) break;
|
|
119015
|
+
dir = parent;
|
|
119016
|
+
}
|
|
119017
|
+
return null;
|
|
119018
|
+
}
|
|
119019
|
+
var scriptOverride;
|
|
119020
|
+
var probe2 = null;
|
|
119021
|
+
function tabtapeReachable() {
|
|
119022
|
+
const now = Date.now();
|
|
119023
|
+
if (probe2 && (probe2.passed || now - probe2.at < PROBE_RETRY_MS)) return probe2.result;
|
|
119024
|
+
const result = fetch(`${tabtapeBaseUrl()}/api/health`, { signal: AbortSignal.timeout(PROBE_TIMEOUT_MS) }).then(async (res) => res.ok && (await res.json()).ok === true).catch(() => false);
|
|
119025
|
+
const entry = { at: now, passed: false, result };
|
|
119026
|
+
void result.then((ok) => {
|
|
119027
|
+
entry.passed = ok;
|
|
119028
|
+
});
|
|
119029
|
+
probe2 = entry;
|
|
119030
|
+
return result;
|
|
119031
|
+
}
|
|
119032
|
+
async function browserMcp(taken) {
|
|
119033
|
+
if (disabled()) return NONE;
|
|
119034
|
+
const wantTabtape = !taken.has(TABTAPE_MCP_NAME);
|
|
119035
|
+
const script = taken.has(PLAYWRIGHT_MCP_NAME) ? null : playwrightMcpScript();
|
|
119036
|
+
if (!wantTabtape && !script) return NONE;
|
|
119037
|
+
if (!await tabtapeReachable()) return NONE;
|
|
119038
|
+
return {
|
|
119039
|
+
tabtape: wantTabtape ? `${tabtapeBaseUrl()}/mcp` : null,
|
|
119040
|
+
// The pane's own node: the Mac app's runtime has none in PATH.
|
|
119041
|
+
playwright: script ? { command: process.execPath, args: [script, "--headless"] } : null
|
|
119042
|
+
};
|
|
119043
|
+
}
|
|
119044
|
+
function jsonServerNames(file2, pick2) {
|
|
119045
|
+
try {
|
|
119046
|
+
const json2 = JSON.parse(fs11.readFileSync(file2, "utf8"));
|
|
119047
|
+
const servers = pick2(json2);
|
|
119048
|
+
return servers && typeof servers === "object" ? Object.keys(servers) : [];
|
|
119049
|
+
} catch {
|
|
119050
|
+
return [];
|
|
119051
|
+
}
|
|
119052
|
+
}
|
|
119053
|
+
function claudeConfigFile() {
|
|
119054
|
+
if (process.env.AGENT_PANE_CLAUDE_CONFIG_FILE) return process.env.AGENT_PANE_CLAUDE_CONFIG_FILE;
|
|
119055
|
+
return path17.join(process.env.CLAUDE_CONFIG_DIR || os6.homedir(), ".claude.json");
|
|
119056
|
+
}
|
|
119057
|
+
function claudeUserMcpNames(cwd) {
|
|
119058
|
+
const file2 = claudeConfigFile();
|
|
119059
|
+
return /* @__PURE__ */ new Set([
|
|
119060
|
+
...jsonServerNames(file2, (json2) => json2.mcpServers),
|
|
119061
|
+
...jsonServerNames(file2, (json2) => json2.projects?.[cwd]?.mcpServers),
|
|
119062
|
+
...jsonServerNames(path17.join(cwd, ".mcp.json"), (json2) => json2.mcpServers)
|
|
119063
|
+
]);
|
|
119064
|
+
}
|
|
119065
|
+
async function claudeBrowserMcpServers(cwd) {
|
|
119066
|
+
const mcp = await browserMcp(claudeUserMcpNames(cwd));
|
|
119067
|
+
return {
|
|
119068
|
+
...mcp.tabtape ? { [TABTAPE_MCP_NAME]: { type: "http", url: mcp.tabtape } } : {},
|
|
119069
|
+
...mcp.playwright ? { [PLAYWRIGHT_MCP_NAME]: { type: "stdio", ...mcp.playwright } } : {}
|
|
119070
|
+
};
|
|
119071
|
+
}
|
|
119072
|
+
function tomlServerNames(file2) {
|
|
119073
|
+
let text2;
|
|
119074
|
+
try {
|
|
119075
|
+
text2 = fs11.readFileSync(file2, "utf8");
|
|
119076
|
+
} catch {
|
|
119077
|
+
return [];
|
|
119078
|
+
}
|
|
119079
|
+
const names = [];
|
|
119080
|
+
const re = /^\s*\[?\s*mcp_servers\.(?:"([^"]+)"|([A-Za-z0-9_-]+))\s*[\].]/gm;
|
|
119081
|
+
for (let m = re.exec(text2); m; m = re.exec(text2)) names.push(m[1] ?? m[2]);
|
|
119082
|
+
return names;
|
|
119083
|
+
}
|
|
119084
|
+
function codexUserMcpNames(cwd) {
|
|
119085
|
+
const home = process.env.CODEX_HOME || path17.join(os6.homedir(), ".codex");
|
|
119086
|
+
return /* @__PURE__ */ new Set([...tomlServerNames(path17.join(home, "config.toml")), ...tomlServerNames(path17.join(cwd, ".codex", "config.toml"))]);
|
|
119087
|
+
}
|
|
119088
|
+
var CODEX_BROWSER_CHECK_INSTRUCTIONS = `Browser checks: when you check a change end-to-end in a browser, use the playwright MCP tools (a Chromium with the tabtape recorder) and record the check. Call the tabtape tool get_record_link (name: what you check, url: the first page), open its start link with browser_navigate, do the check, then open its stop link: that page shows the replay link, which you give the user. When a check fails, look into the recording with the tabtape tools before guessing. If recording does not work (the start page says "Nothing happened", or tabtape cannot be reached), carry on with the check and tell the user the recording failed.`;
|
|
119089
|
+
async function codexBrowserMcp(cwd) {
|
|
119090
|
+
const mcp = await browserMcp(codexUserMcpNames(cwd));
|
|
119091
|
+
const args = [];
|
|
119092
|
+
const approve = (key) => ["-c", `${key}.default_tools_approval_mode="approve"`];
|
|
119093
|
+
if (mcp.tabtape) {
|
|
119094
|
+
const key = `mcp_servers.${TABTAPE_MCP_NAME}`;
|
|
119095
|
+
args.push("-c", `${key}.url=${JSON.stringify(mcp.tabtape)}`, ...approve(key));
|
|
119096
|
+
}
|
|
119097
|
+
if (mcp.playwright) {
|
|
119098
|
+
const key = `mcp_servers.${PLAYWRIGHT_MCP_NAME}`;
|
|
119099
|
+
args.push(
|
|
119100
|
+
"-c",
|
|
119101
|
+
`${key}.command=${JSON.stringify(mcp.playwright.command)}`,
|
|
119102
|
+
"-c",
|
|
119103
|
+
`${key}.args=${JSON.stringify(mcp.playwright.args)}`,
|
|
119104
|
+
"-c",
|
|
119105
|
+
`${key}.startup_timeout_sec=${PLAYWRIGHT_STARTUP_TIMEOUT_SEC}`,
|
|
119106
|
+
...approve(key)
|
|
119107
|
+
);
|
|
119108
|
+
}
|
|
119109
|
+
return { args, instructions: mcp.tabtape ? CODEX_BROWSER_CHECK_INSTRUCTIONS : null };
|
|
119110
|
+
}
|
|
119111
|
+
var prepared = false;
|
|
119112
|
+
function prepareBrowserMcp() {
|
|
119113
|
+
if (prepared || disabled()) return;
|
|
119114
|
+
prepared = true;
|
|
119115
|
+
if (!playwrightMcpScript()) return;
|
|
119116
|
+
const env = { ...process.env, PATH: [process.env.PATH, path17.dirname(process.execPath)].filter(Boolean).join(path17.delimiter) };
|
|
119117
|
+
try {
|
|
119118
|
+
const child = spawn6("npx", ["-y", "@playwright/mcp@latest", "install-browser", "chromium"], { stdio: "ignore", env });
|
|
119119
|
+
child.on("error", (err) => console.warn("[browser-mcp] Chromium download failed to start:", err.message));
|
|
119120
|
+
child.on("exit", (code) => {
|
|
119121
|
+
if (code !== 0) console.warn(`[browser-mcp] Chromium download exited with ${code}`);
|
|
119122
|
+
});
|
|
119123
|
+
child.unref();
|
|
119124
|
+
} catch (err) {
|
|
119125
|
+
console.warn("[browser-mcp] Chromium download failed to start:", err.message);
|
|
119126
|
+
}
|
|
119127
|
+
}
|
|
119128
|
+
|
|
118987
119129
|
// src/claude/cli-orphans.ts
|
|
118988
119130
|
import { execFile as execFile4 } from "node:child_process";
|
|
118989
119131
|
var TERM_GRACE_MS = 2e3;
|
|
@@ -119144,7 +119286,7 @@ function sandboxPolicy(config3) {
|
|
|
119144
119286
|
function threadConfig(config3) {
|
|
119145
119287
|
return config3?.webSearchMode ? { web_search: config3.webSearchMode } : void 0;
|
|
119146
119288
|
}
|
|
119147
|
-
function threadParams(session, cwd) {
|
|
119289
|
+
function threadParams(session, cwd, browserInstructions) {
|
|
119148
119290
|
const config3 = parseRuntimeConfig(session);
|
|
119149
119291
|
return {
|
|
119150
119292
|
cwd,
|
|
@@ -119152,7 +119294,7 @@ function threadParams(session, cwd) {
|
|
|
119152
119294
|
sandbox: sandboxType(config3),
|
|
119153
119295
|
model: session.model ?? void 0,
|
|
119154
119296
|
config: threadConfig(config3),
|
|
119155
|
-
...threadInstructionParams(cwd)
|
|
119297
|
+
...threadInstructionParams(cwd, browserInstructions)
|
|
119156
119298
|
};
|
|
119157
119299
|
}
|
|
119158
119300
|
function shouldSkipItem(type) {
|
|
@@ -119164,12 +119306,13 @@ function isEmptyReasoning(item) {
|
|
|
119164
119306
|
const text2 = item.text ?? "";
|
|
119165
119307
|
return summary.length === 0 && content.length === 0 && text2.length === 0;
|
|
119166
119308
|
}
|
|
119167
|
-
function appServerClientOptions(session, cwd) {
|
|
119168
|
-
const launchArgs = codexMiniAppLaunchArgs(cwd, session.id);
|
|
119169
|
-
return
|
|
119309
|
+
function appServerClientOptions(session, cwd, extraArgs = []) {
|
|
119310
|
+
const launchArgs = codexMiniAppLaunchArgs(cwd, session.id) ?? [];
|
|
119311
|
+
return { cwd, launchArgs: [...launchArgs, ...extraArgs] };
|
|
119170
119312
|
}
|
|
119171
|
-
function threadInstructionParams(cwd) {
|
|
119172
|
-
|
|
119313
|
+
function threadInstructionParams(cwd, browserInstructions = null) {
|
|
119314
|
+
const parts = [isInAppFolder(cwd) ? appsConventions() : null, browserInstructions].filter((p) => !!p);
|
|
119315
|
+
return parts.length > 0 ? { developerInstructions: parts.join("\n\n") } : {};
|
|
119173
119316
|
}
|
|
119174
119317
|
function autoApproveToolUserInput(client) {
|
|
119175
119318
|
client.onRequest("item/tool/requestUserInput", async (params) => {
|
|
@@ -119237,7 +119380,8 @@ async function startThread(session) {
|
|
|
119237
119380
|
if (adopted && !adopted.client.isClosed()) return adopted;
|
|
119238
119381
|
}
|
|
119239
119382
|
const cwd = session.cwd ?? process.cwd();
|
|
119240
|
-
const
|
|
119383
|
+
const browser = await codexBrowserMcp(cwd);
|
|
119384
|
+
const options = appServerClientOptions(session, cwd, browser.args);
|
|
119241
119385
|
let entry = null;
|
|
119242
119386
|
const host = hostFor(session.id, cwd, options, (pid) => {
|
|
119243
119387
|
if (!entry) return;
|
|
@@ -119251,6 +119395,7 @@ async function startThread(session) {
|
|
|
119251
119395
|
// A hosted app-server has no cli_processes row: its host supervises it.
|
|
119252
119396
|
pid: host ? void 0 : client.pid,
|
|
119253
119397
|
...emptyThreadState(),
|
|
119398
|
+
browserInstructions: browser.instructions,
|
|
119254
119399
|
turns: [],
|
|
119255
119400
|
ended: /* @__PURE__ */ new Map(),
|
|
119256
119401
|
resumedTurnIds: null,
|
|
@@ -119264,7 +119409,7 @@ async function startThread(session) {
|
|
|
119264
119409
|
try {
|
|
119265
119410
|
await client.initialize();
|
|
119266
119411
|
autoApproveToolUserInput(client);
|
|
119267
|
-
const base = threadParams(session, cwd);
|
|
119412
|
+
const base = threadParams(session, cwd, entry.browserInstructions);
|
|
119268
119413
|
entry.webSearch = base.config?.web_search;
|
|
119269
119414
|
if (session.external_thread_id) {
|
|
119270
119415
|
entry.threadId = session.external_thread_id;
|
|
@@ -119767,7 +119912,7 @@ function sideThreadFor(entry, session, discussionThreadId) {
|
|
|
119767
119912
|
async function loadSideThread(entry, session, discussionThreadId) {
|
|
119768
119913
|
const db2 = getDb();
|
|
119769
119914
|
const row = db2.prepare("SELECT external_thread_id FROM discussion_threads WHERE id = ?").get(discussionThreadId);
|
|
119770
|
-
const base = threadParams(session, session.cwd ?? process.cwd());
|
|
119915
|
+
const base = threadParams(session, session.cwd ?? process.cwd(), entry.browserInstructions);
|
|
119771
119916
|
let codexThreadId;
|
|
119772
119917
|
if (row?.external_thread_id) {
|
|
119773
119918
|
entry.codexThreads.add(row.external_thread_id);
|
|
@@ -120535,6 +120680,7 @@ function adoptedEntry(db2, session, threadId, client, host) {
|
|
|
120535
120680
|
codexThreads: /* @__PURE__ */ new Set([threadId, ...sideOf.values()]),
|
|
120536
120681
|
contextTokens: new Map(fill === null ? [] : [[threadId, fill]]),
|
|
120537
120682
|
webSearch: threadConfig(parseRuntimeConfig(session))?.web_search,
|
|
120683
|
+
browserInstructions: null,
|
|
120538
120684
|
turns,
|
|
120539
120685
|
ended,
|
|
120540
120686
|
// A turn resumed on this app-server later continues with the continue
|
|
@@ -121017,7 +121163,7 @@ function classifyApiError({ error: error51, status, text: text2, limitRejected }
|
|
|
121017
121163
|
}
|
|
121018
121164
|
|
|
121019
121165
|
// src/claude/claude-host.ts
|
|
121020
|
-
import { spawn as
|
|
121166
|
+
import { spawn as spawn7 } from "node:child_process";
|
|
121021
121167
|
var REPLAY_DONE_SUBTYPE = "agentpane_replay_done";
|
|
121022
121168
|
var REPLAY_MARKER2 = JSON.stringify({ type: "system", subtype: REPLAY_DONE_SUBTYPE });
|
|
121023
121169
|
function isReplayMarker(message) {
|
|
@@ -121080,7 +121226,7 @@ function hostedSpawner(db2, binding, info) {
|
|
|
121080
121226
|
} catch (err) {
|
|
121081
121227
|
console.error(`[claude] no session host for ${info.entryKey} (${err.message}); running the CLI directly`);
|
|
121082
121228
|
forgetHost(binding.id, binding.dir);
|
|
121083
|
-
const child =
|
|
121229
|
+
const child = spawn7(opts.command, opts.args, { cwd, env: opts.env, signal: opts.signal, stdio: ["pipe", "pipe", "ignore"] });
|
|
121084
121230
|
info.onDirect(child.pid);
|
|
121085
121231
|
return child;
|
|
121086
121232
|
}
|
|
@@ -121404,6 +121550,7 @@ async function ensureSessionStarted(session, mapKey, resumeSessionId, resume, ad
|
|
|
121404
121550
|
const rescue = resume && resumeId ? resume : void 0;
|
|
121405
121551
|
const env = spawnEnv(session.id, rescue);
|
|
121406
121552
|
let cliPid = null;
|
|
121553
|
+
const browserMcpServers = adopt ? {} : await claudeBrowserMcpServers(cwd);
|
|
121407
121554
|
let host = null;
|
|
121408
121555
|
let spawner;
|
|
121409
121556
|
if (adopt) {
|
|
@@ -121440,7 +121587,7 @@ async function ensureSessionStarted(session, mapKey, resumeSessionId, resume, ad
|
|
|
121440
121587
|
// reaches the pane only this way, with its sender in `origin` (MUH-102).
|
|
121441
121588
|
extraArgs: { "replay-user-messages": null },
|
|
121442
121589
|
// Inline visuals: the model's show_widget calls render in the chat.
|
|
121443
|
-
mcpServers: { [WIDGET_SERVER_NAME]: createWidgetMcpServer() },
|
|
121590
|
+
mcpServers: { ...browserMcpServers, [WIDGET_SERVER_NAME]: createWidgetMcpServer() },
|
|
121444
121591
|
...CLI_OVERRIDE,
|
|
121445
121592
|
...session.model_reasoning_effort ? { effort: session.model_reasoning_effort } : {},
|
|
121446
121593
|
...resumeId ? { resume: resumeId } : {},
|
|
@@ -122959,8 +123106,8 @@ var RepoburgHttpClient = class {
|
|
|
122959
123106
|
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
122960
123107
|
}
|
|
122961
123108
|
/** Perform a JSON request. Throws a concise error on non-OK/non-JSON responses. */
|
|
122962
|
-
async request(method,
|
|
122963
|
-
const response = await fetch(`${this.baseUrl}${
|
|
123109
|
+
async request(method, path20, body) {
|
|
123110
|
+
const response = await fetch(`${this.baseUrl}${path20}`, {
|
|
122964
123111
|
method,
|
|
122965
123112
|
headers: { "Content-Type": "application/json" },
|
|
122966
123113
|
body: body === void 0 ? void 0 : JSON.stringify(body)
|
|
@@ -122969,17 +123116,17 @@ var RepoburgHttpClient = class {
|
|
|
122969
123116
|
if (!response.ok) {
|
|
122970
123117
|
if (isHtml(text2)) {
|
|
122971
123118
|
throw new Error(
|
|
122972
|
-
`${method} ${
|
|
123119
|
+
`${method} ${path20} failed: ${response.status} HTML response from ${this.baseUrl} \u2014 the URL points to the wrong server`
|
|
122973
123120
|
);
|
|
122974
123121
|
}
|
|
122975
|
-
throw new Error(`${method} ${
|
|
123122
|
+
throw new Error(`${method} ${path20} failed: ${response.status} ${text2}`);
|
|
122976
123123
|
}
|
|
122977
123124
|
if (text2.length === 0) return void 0;
|
|
122978
123125
|
try {
|
|
122979
123126
|
return JSON.parse(text2);
|
|
122980
123127
|
} catch {
|
|
122981
123128
|
throw new Error(
|
|
122982
|
-
`${method} ${
|
|
123129
|
+
`${method} ${path20} failed: non-JSON response from ${this.baseUrl} \u2014 the URL points to the wrong server`
|
|
122983
123130
|
);
|
|
122984
123131
|
}
|
|
122985
123132
|
}
|
|
@@ -123034,7 +123181,7 @@ var RepoburgHttpClient = class {
|
|
|
123034
123181
|
};
|
|
123035
123182
|
|
|
123036
123183
|
// src/repoburg/backend-resolver.ts
|
|
123037
|
-
import
|
|
123184
|
+
import path18 from "node:path";
|
|
123038
123185
|
var HEALTH_POLL_INTERVAL_MS = 1e3;
|
|
123039
123186
|
var HEALTH_TIMEOUT_MS = 3e4;
|
|
123040
123187
|
function daemonBaseUrl() {
|
|
@@ -123089,7 +123236,7 @@ async function backendHealthy(baseUrl, expectedPath) {
|
|
|
123089
123236
|
const health = await fetchJson(`${baseUrl}/health`, void 0, 2e3);
|
|
123090
123237
|
if (health.status !== "ok") return false;
|
|
123091
123238
|
if (expectedPath && health.projectPath) {
|
|
123092
|
-
return
|
|
123239
|
+
return path18.resolve(health.projectPath) === path18.resolve(expectedPath);
|
|
123093
123240
|
}
|
|
123094
123241
|
return true;
|
|
123095
123242
|
} catch {
|
|
@@ -123110,7 +123257,7 @@ function serviceBaseUrl(service) {
|
|
|
123110
123257
|
return `http://localhost:${service.port}`;
|
|
123111
123258
|
}
|
|
123112
123259
|
function coveringService(services, absPath) {
|
|
123113
|
-
return services.filter((s) => absPath === s.path || absPath.startsWith(s.path +
|
|
123260
|
+
return services.filter((s) => absPath === s.path || absPath.startsWith(s.path + path18.sep)).sort((a, b) => b.path.length - a.path.length)[0];
|
|
123114
123261
|
}
|
|
123115
123262
|
async function restartService(daemon, name) {
|
|
123116
123263
|
try {
|
|
@@ -123146,7 +123293,7 @@ async function resolveBackendUrl(projectPath, opts = {}) {
|
|
|
123146
123293
|
if (envUrl) {
|
|
123147
123294
|
return { baseUrl: envUrl.replace(/\/+$/, ""), port: 0, name: "REPOBURG_BACKEND_URL" };
|
|
123148
123295
|
}
|
|
123149
|
-
const absPath =
|
|
123296
|
+
const absPath = path18.resolve(projectPath);
|
|
123150
123297
|
const daemon = daemonBaseUrl();
|
|
123151
123298
|
const cached3 = resolvedCache.get(absPath);
|
|
123152
123299
|
if (cached3 && await backendHealthy(cached3.baseUrl, cached3.servesPath ?? absPath)) {
|
|
@@ -124827,7 +124974,7 @@ registerProvider("repoburg", repoburgProvider);
|
|
|
124827
124974
|
async function createAgentPaneApp(dbPath, opts = {}) {
|
|
124828
124975
|
const allowRequest = opts.allowRequest ?? isLocalRequest;
|
|
124829
124976
|
initDb(dbPath);
|
|
124830
|
-
setPaneDataDir(dbPath === ":memory:" ? null :
|
|
124977
|
+
setPaneDataDir(dbPath === ":memory:" ? null : path19.dirname(path19.resolve(dbPath)));
|
|
124831
124978
|
const fastify = (0, import_fastify.default)({ logger: true, bodyLimit: 50 * 1024 * 1024 });
|
|
124832
124979
|
fastify.addHook("onRequest", async (request, reply) => {
|
|
124833
124980
|
if (!allowRequest(request.headers.origin, request.headers.host)) {
|
|
@@ -124879,6 +125026,7 @@ function startHostServices(opts = {}) {
|
|
|
124879
125026
|
});
|
|
124880
125027
|
setStartupGate(started);
|
|
124881
125028
|
void getVscodeWebManager().reapOrphans();
|
|
125029
|
+
prepareBrowserMcp();
|
|
124882
125030
|
return started;
|
|
124883
125031
|
}
|
|
124884
125032
|
async function shutdownHost() {
|