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);
|
|
@@ -43477,9 +43477,9 @@ async function browseFolder(input, opts = {}) {
|
|
|
43477
43477
|
const atHome = dir === nodePath.resolve(home);
|
|
43478
43478
|
const folders = await Promise.all(
|
|
43479
43479
|
names.slice(0, limit).map(async (name) => {
|
|
43480
|
-
const
|
|
43480
|
+
const path20 = nodePath.join(dir, name);
|
|
43481
43481
|
const skipProbe = atHome && HOME_STANDARD_FOLDERS.has(name) || dir === "/Volumes";
|
|
43482
|
-
return { name, path:
|
|
43482
|
+
return { name, path: path20, git: !skipProbe && await exists(nodePath.join(path20, ".git")) };
|
|
43483
43483
|
})
|
|
43484
43484
|
);
|
|
43485
43485
|
const parent = nodePath.dirname(dir);
|
|
@@ -43517,11 +43517,11 @@ async function registerWorkspaceRoutes(fastify) {
|
|
|
43517
43517
|
}
|
|
43518
43518
|
}
|
|
43519
43519
|
}, async (request, reply) => {
|
|
43520
|
-
const { path:
|
|
43521
|
-
if (!
|
|
43520
|
+
const { path: path20, label = null } = request.body || {};
|
|
43521
|
+
if (!path20 || !path20.trim()) {
|
|
43522
43522
|
return reply.code(400).send({ error: "Path is required" });
|
|
43523
43523
|
}
|
|
43524
|
-
const resolved = await resolveWorkspacePath(
|
|
43524
|
+
const resolved = await resolveWorkspacePath(path20);
|
|
43525
43525
|
if ("error" in resolved) {
|
|
43526
43526
|
return reply.code(400).send({ error: resolved.error });
|
|
43527
43527
|
}
|
|
@@ -43563,8 +43563,8 @@ async function registerWorkspaceRoutes(fastify) {
|
|
|
43563
43563
|
"-e",
|
|
43564
43564
|
'POSIX path of (choose folder with prompt "Select a workspace directory")'
|
|
43565
43565
|
]);
|
|
43566
|
-
const
|
|
43567
|
-
return { path:
|
|
43566
|
+
const path20 = stdout.trim().replace(/\/$/, "");
|
|
43567
|
+
return { path: path20 };
|
|
43568
43568
|
} catch {
|
|
43569
43569
|
return reply.code(204).send({ cancelled: true });
|
|
43570
43570
|
}
|
|
@@ -43580,11 +43580,11 @@ async function registerWorkspaceRoutes(fastify) {
|
|
|
43580
43580
|
}
|
|
43581
43581
|
}
|
|
43582
43582
|
}, async (request, reply) => {
|
|
43583
|
-
const { path:
|
|
43584
|
-
if (!
|
|
43583
|
+
const { path: path20 } = request.body || {};
|
|
43584
|
+
if (!path20 || !path20.trim()) {
|
|
43585
43585
|
return reply.code(400).send({ error: "Path is required" });
|
|
43586
43586
|
}
|
|
43587
|
-
const trimmedPath =
|
|
43587
|
+
const trimmedPath = path20.trim();
|
|
43588
43588
|
const db2 = getDb();
|
|
43589
43589
|
const existing = db2.prepare("SELECT * FROM workspaces WHERE path = ?").get(trimmedPath);
|
|
43590
43590
|
if (existing) {
|
|
@@ -44318,17 +44318,17 @@ async function registerPerfLogRoutes(fastify) {
|
|
|
44318
44318
|
if (entries.length === 0) {
|
|
44319
44319
|
return reply.send({ written: 0 });
|
|
44320
44320
|
}
|
|
44321
|
-
const
|
|
44321
|
+
const path20 = perfLogPath();
|
|
44322
44322
|
try {
|
|
44323
|
-
mkdirSync2(dirname(
|
|
44323
|
+
mkdirSync2(dirname(path20), { recursive: true });
|
|
44324
44324
|
try {
|
|
44325
|
-
if (statSync(
|
|
44326
|
-
renameSync(
|
|
44325
|
+
if (statSync(path20).size > MAX_BYTES) {
|
|
44326
|
+
renameSync(path20, `${path20}.1`);
|
|
44327
44327
|
}
|
|
44328
44328
|
} catch {
|
|
44329
44329
|
}
|
|
44330
44330
|
const lines = entries.map((e) => `${new Date(e.t).toISOString()} [${oneLine(e.cat)}] ${oneLine(e.msg)}`).join("\n");
|
|
44331
|
-
appendFileSync(
|
|
44331
|
+
appendFileSync(path20, `${lines}
|
|
44332
44332
|
`, "utf-8");
|
|
44333
44333
|
return reply.send({ written: entries.length });
|
|
44334
44334
|
} catch (err) {
|
|
@@ -102847,10 +102847,10 @@ function mergeDefs(...defs) {
|
|
|
102847
102847
|
function cloneDef(schema) {
|
|
102848
102848
|
return mergeDefs(schema._zod.def);
|
|
102849
102849
|
}
|
|
102850
|
-
function getElementAtPath(obj2,
|
|
102851
|
-
if (!
|
|
102850
|
+
function getElementAtPath(obj2, path20) {
|
|
102851
|
+
if (!path20)
|
|
102852
102852
|
return obj2;
|
|
102853
|
-
return
|
|
102853
|
+
return path20.reduce((acc, key) => acc?.[key], obj2);
|
|
102854
102854
|
}
|
|
102855
102855
|
function promiseAllObject(promisesObj) {
|
|
102856
102856
|
const keys = Object.keys(promisesObj);
|
|
@@ -103259,11 +103259,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
103259
103259
|
}
|
|
103260
103260
|
return false;
|
|
103261
103261
|
}
|
|
103262
|
-
function prefixIssues(
|
|
103262
|
+
function prefixIssues(path20, issues) {
|
|
103263
103263
|
return issues.map((iss) => {
|
|
103264
103264
|
var _a3;
|
|
103265
103265
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
103266
|
-
iss.path.unshift(
|
|
103266
|
+
iss.path.unshift(path20);
|
|
103267
103267
|
return iss;
|
|
103268
103268
|
});
|
|
103269
103269
|
}
|
|
@@ -103410,16 +103410,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
103410
103410
|
}
|
|
103411
103411
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
103412
103412
|
const fieldErrors = { _errors: [] };
|
|
103413
|
-
const processError = (error52,
|
|
103413
|
+
const processError = (error52, path20 = []) => {
|
|
103414
103414
|
for (const issue2 of error52.issues) {
|
|
103415
103415
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
103416
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
103416
|
+
issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
|
|
103417
103417
|
} else if (issue2.code === "invalid_key") {
|
|
103418
|
-
processError({ issues: issue2.issues }, [...
|
|
103418
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103419
103419
|
} else if (issue2.code === "invalid_element") {
|
|
103420
|
-
processError({ issues: issue2.issues }, [...
|
|
103420
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103421
103421
|
} else {
|
|
103422
|
-
const fullpath = [...
|
|
103422
|
+
const fullpath = [...path20, ...issue2.path];
|
|
103423
103423
|
if (fullpath.length === 0) {
|
|
103424
103424
|
fieldErrors._errors.push(mapper(issue2));
|
|
103425
103425
|
} else {
|
|
@@ -103446,17 +103446,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
103446
103446
|
}
|
|
103447
103447
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
103448
103448
|
const result = { errors: [] };
|
|
103449
|
-
const processError = (error52,
|
|
103449
|
+
const processError = (error52, path20 = []) => {
|
|
103450
103450
|
var _a3, _b;
|
|
103451
103451
|
for (const issue2 of error52.issues) {
|
|
103452
103452
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
103453
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
103453
|
+
issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
|
|
103454
103454
|
} else if (issue2.code === "invalid_key") {
|
|
103455
|
-
processError({ issues: issue2.issues }, [...
|
|
103455
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103456
103456
|
} else if (issue2.code === "invalid_element") {
|
|
103457
|
-
processError({ issues: issue2.issues }, [...
|
|
103457
|
+
processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
|
|
103458
103458
|
} else {
|
|
103459
|
-
const fullpath = [...
|
|
103459
|
+
const fullpath = [...path20, ...issue2.path];
|
|
103460
103460
|
if (fullpath.length === 0) {
|
|
103461
103461
|
result.errors.push(mapper(issue2));
|
|
103462
103462
|
continue;
|
|
@@ -103488,8 +103488,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
103488
103488
|
}
|
|
103489
103489
|
function toDotPath(_path) {
|
|
103490
103490
|
const segs = [];
|
|
103491
|
-
const
|
|
103492
|
-
for (const seg of
|
|
103491
|
+
const path20 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
103492
|
+
for (const seg of path20) {
|
|
103493
103493
|
if (typeof seg === "number")
|
|
103494
103494
|
segs.push(`[${seg}]`);
|
|
103495
103495
|
else if (typeof seg === "symbol")
|
|
@@ -116181,13 +116181,13 @@ function resolveRef(ref, ctx) {
|
|
|
116181
116181
|
if (!ref.startsWith("#")) {
|
|
116182
116182
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
116183
116183
|
}
|
|
116184
|
-
const
|
|
116185
|
-
if (
|
|
116184
|
+
const path20 = ref.slice(1).split("/").filter(Boolean);
|
|
116185
|
+
if (path20.length === 0) {
|
|
116186
116186
|
return ctx.rootSchema;
|
|
116187
116187
|
}
|
|
116188
116188
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
116189
|
-
if (
|
|
116190
|
-
const key =
|
|
116189
|
+
if (path20[0] === defsKey) {
|
|
116190
|
+
const key = path20[1];
|
|
116191
116191
|
if (!key || !ctx.defs[key]) {
|
|
116192
116192
|
throw new Error(`Reference not found: ${ref}`);
|
|
116193
116193
|
}
|
|
@@ -116712,9 +116712,9 @@ function mapToolUse(block) {
|
|
|
116712
116712
|
};
|
|
116713
116713
|
}
|
|
116714
116714
|
function deriveFileChangeData(input, toolName) {
|
|
116715
|
-
const
|
|
116715
|
+
const path20 = input.file_path ?? input.notebook_path ?? "";
|
|
116716
116716
|
const kind = toolName === "Write" ? "add" : "modify";
|
|
116717
|
-
return { changes: [{ path:
|
|
116717
|
+
return { changes: [{ path: path20, kind }], status: "in_progress" };
|
|
116718
116718
|
}
|
|
116719
116719
|
function extractToolResultText(content) {
|
|
116720
116720
|
if (!content) return "";
|
|
@@ -118971,6 +118971,148 @@ function mapTokenUsage(data) {
|
|
|
118971
118971
|
};
|
|
118972
118972
|
}
|
|
118973
118973
|
|
|
118974
|
+
// src/tabtape/browser-mcp.ts
|
|
118975
|
+
import { spawn as spawn6 } from "node:child_process";
|
|
118976
|
+
import fs11 from "node:fs";
|
|
118977
|
+
import os6 from "node:os";
|
|
118978
|
+
import path17 from "node:path";
|
|
118979
|
+
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
118980
|
+
var TABTAPE_MCP_NAME = "tabtape";
|
|
118981
|
+
var PLAYWRIGHT_MCP_NAME = "playwright";
|
|
118982
|
+
var PROBE_TIMEOUT_MS = 1500;
|
|
118983
|
+
var PROBE_RETRY_MS = 3e4;
|
|
118984
|
+
var PLAYWRIGHT_STARTUP_TIMEOUT_SEC = 120;
|
|
118985
|
+
var NONE = { tabtape: null, playwright: null };
|
|
118986
|
+
function disabled() {
|
|
118987
|
+
return process.env.REPOBURG_BROWSER_MCP === "0" || process.env.REPOBURG_TABTAPE === "0";
|
|
118988
|
+
}
|
|
118989
|
+
function tabtapeBaseUrl() {
|
|
118990
|
+
return (process.env.AGENT_PANE_TABTAPE_URL || `${sessionHostDaemonUrl()}/tabtape`).replace(/\/+$/, "");
|
|
118991
|
+
}
|
|
118992
|
+
function playwrightMcpScript(from = path17.dirname(fileURLToPath5(import.meta.url))) {
|
|
118993
|
+
if (scriptOverride !== void 0) return scriptOverride;
|
|
118994
|
+
let dir = from;
|
|
118995
|
+
for (let i = 0; i < 6; i++) {
|
|
118996
|
+
const script = path17.join(dir, "tabtape", "playwright", "mcp.mjs");
|
|
118997
|
+
if (fs11.existsSync(script) && fs11.existsSync(path17.join(dir, "tabtape", "extension", "dist", "manifest.json"))) {
|
|
118998
|
+
return script;
|
|
118999
|
+
}
|
|
119000
|
+
const parent = path17.dirname(dir);
|
|
119001
|
+
if (parent === dir) break;
|
|
119002
|
+
dir = parent;
|
|
119003
|
+
}
|
|
119004
|
+
return null;
|
|
119005
|
+
}
|
|
119006
|
+
var scriptOverride;
|
|
119007
|
+
var probe2 = null;
|
|
119008
|
+
function tabtapeReachable() {
|
|
119009
|
+
const now = Date.now();
|
|
119010
|
+
if (probe2 && (probe2.passed || now - probe2.at < PROBE_RETRY_MS)) return probe2.result;
|
|
119011
|
+
const result = fetch(`${tabtapeBaseUrl()}/api/health`, { signal: AbortSignal.timeout(PROBE_TIMEOUT_MS) }).then(async (res) => res.ok && (await res.json()).ok === true).catch(() => false);
|
|
119012
|
+
const entry = { at: now, passed: false, result };
|
|
119013
|
+
void result.then((ok) => {
|
|
119014
|
+
entry.passed = ok;
|
|
119015
|
+
});
|
|
119016
|
+
probe2 = entry;
|
|
119017
|
+
return result;
|
|
119018
|
+
}
|
|
119019
|
+
async function browserMcp(taken) {
|
|
119020
|
+
if (disabled()) return NONE;
|
|
119021
|
+
const wantTabtape = !taken.has(TABTAPE_MCP_NAME);
|
|
119022
|
+
const script = taken.has(PLAYWRIGHT_MCP_NAME) ? null : playwrightMcpScript();
|
|
119023
|
+
if (!wantTabtape && !script) return NONE;
|
|
119024
|
+
if (!await tabtapeReachable()) return NONE;
|
|
119025
|
+
return {
|
|
119026
|
+
tabtape: wantTabtape ? `${tabtapeBaseUrl()}/mcp` : null,
|
|
119027
|
+
// The pane's own node: the Mac app's runtime has none in PATH.
|
|
119028
|
+
playwright: script ? { command: process.execPath, args: [script, "--headless"] } : null
|
|
119029
|
+
};
|
|
119030
|
+
}
|
|
119031
|
+
function jsonServerNames(file2, pick2) {
|
|
119032
|
+
try {
|
|
119033
|
+
const json2 = JSON.parse(fs11.readFileSync(file2, "utf8"));
|
|
119034
|
+
const servers = pick2(json2);
|
|
119035
|
+
return servers && typeof servers === "object" ? Object.keys(servers) : [];
|
|
119036
|
+
} catch {
|
|
119037
|
+
return [];
|
|
119038
|
+
}
|
|
119039
|
+
}
|
|
119040
|
+
function claudeConfigFile() {
|
|
119041
|
+
if (process.env.AGENT_PANE_CLAUDE_CONFIG_FILE) return process.env.AGENT_PANE_CLAUDE_CONFIG_FILE;
|
|
119042
|
+
return path17.join(process.env.CLAUDE_CONFIG_DIR || os6.homedir(), ".claude.json");
|
|
119043
|
+
}
|
|
119044
|
+
function claudeUserMcpNames(cwd) {
|
|
119045
|
+
const file2 = claudeConfigFile();
|
|
119046
|
+
return /* @__PURE__ */ new Set([
|
|
119047
|
+
...jsonServerNames(file2, (json2) => json2.mcpServers),
|
|
119048
|
+
...jsonServerNames(file2, (json2) => json2.projects?.[cwd]?.mcpServers),
|
|
119049
|
+
...jsonServerNames(path17.join(cwd, ".mcp.json"), (json2) => json2.mcpServers)
|
|
119050
|
+
]);
|
|
119051
|
+
}
|
|
119052
|
+
async function claudeBrowserMcpServers(cwd) {
|
|
119053
|
+
const mcp = await browserMcp(claudeUserMcpNames(cwd));
|
|
119054
|
+
return {
|
|
119055
|
+
...mcp.tabtape ? { [TABTAPE_MCP_NAME]: { type: "http", url: mcp.tabtape } } : {},
|
|
119056
|
+
...mcp.playwright ? { [PLAYWRIGHT_MCP_NAME]: { type: "stdio", ...mcp.playwright } } : {}
|
|
119057
|
+
};
|
|
119058
|
+
}
|
|
119059
|
+
function tomlServerNames(file2) {
|
|
119060
|
+
let text2;
|
|
119061
|
+
try {
|
|
119062
|
+
text2 = fs11.readFileSync(file2, "utf8");
|
|
119063
|
+
} catch {
|
|
119064
|
+
return [];
|
|
119065
|
+
}
|
|
119066
|
+
const names = [];
|
|
119067
|
+
const re = /^\s*\[?\s*mcp_servers\.(?:"([^"]+)"|([A-Za-z0-9_-]+))\s*[\].]/gm;
|
|
119068
|
+
for (let m = re.exec(text2); m; m = re.exec(text2)) names.push(m[1] ?? m[2]);
|
|
119069
|
+
return names;
|
|
119070
|
+
}
|
|
119071
|
+
function codexUserMcpNames(cwd) {
|
|
119072
|
+
const home = process.env.CODEX_HOME || path17.join(os6.homedir(), ".codex");
|
|
119073
|
+
return /* @__PURE__ */ new Set([...tomlServerNames(path17.join(home, "config.toml")), ...tomlServerNames(path17.join(cwd, ".codex", "config.toml"))]);
|
|
119074
|
+
}
|
|
119075
|
+
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.`;
|
|
119076
|
+
async function codexBrowserMcp(cwd) {
|
|
119077
|
+
const mcp = await browserMcp(codexUserMcpNames(cwd));
|
|
119078
|
+
const args = [];
|
|
119079
|
+
const approve = (key) => ["-c", `${key}.default_tools_approval_mode="approve"`];
|
|
119080
|
+
if (mcp.tabtape) {
|
|
119081
|
+
const key = `mcp_servers.${TABTAPE_MCP_NAME}`;
|
|
119082
|
+
args.push("-c", `${key}.url=${JSON.stringify(mcp.tabtape)}`, ...approve(key));
|
|
119083
|
+
}
|
|
119084
|
+
if (mcp.playwright) {
|
|
119085
|
+
const key = `mcp_servers.${PLAYWRIGHT_MCP_NAME}`;
|
|
119086
|
+
args.push(
|
|
119087
|
+
"-c",
|
|
119088
|
+
`${key}.command=${JSON.stringify(mcp.playwright.command)}`,
|
|
119089
|
+
"-c",
|
|
119090
|
+
`${key}.args=${JSON.stringify(mcp.playwright.args)}`,
|
|
119091
|
+
"-c",
|
|
119092
|
+
`${key}.startup_timeout_sec=${PLAYWRIGHT_STARTUP_TIMEOUT_SEC}`,
|
|
119093
|
+
...approve(key)
|
|
119094
|
+
);
|
|
119095
|
+
}
|
|
119096
|
+
return { args, instructions: mcp.tabtape ? CODEX_BROWSER_CHECK_INSTRUCTIONS : null };
|
|
119097
|
+
}
|
|
119098
|
+
var prepared = false;
|
|
119099
|
+
function prepareBrowserMcp() {
|
|
119100
|
+
if (prepared || disabled()) return;
|
|
119101
|
+
prepared = true;
|
|
119102
|
+
if (!playwrightMcpScript()) return;
|
|
119103
|
+
const env = { ...process.env, PATH: [process.env.PATH, path17.dirname(process.execPath)].filter(Boolean).join(path17.delimiter) };
|
|
119104
|
+
try {
|
|
119105
|
+
const child = spawn6("npx", ["-y", "@playwright/mcp@latest", "install-browser", "chromium"], { stdio: "ignore", env });
|
|
119106
|
+
child.on("error", (err) => console.warn("[browser-mcp] Chromium download failed to start:", err.message));
|
|
119107
|
+
child.on("exit", (code) => {
|
|
119108
|
+
if (code !== 0) console.warn(`[browser-mcp] Chromium download exited with ${code}`);
|
|
119109
|
+
});
|
|
119110
|
+
child.unref();
|
|
119111
|
+
} catch (err) {
|
|
119112
|
+
console.warn("[browser-mcp] Chromium download failed to start:", err.message);
|
|
119113
|
+
}
|
|
119114
|
+
}
|
|
119115
|
+
|
|
118974
119116
|
// src/claude/cli-orphans.ts
|
|
118975
119117
|
import { execFile as execFile4 } from "node:child_process";
|
|
118976
119118
|
var TERM_GRACE_MS = 2e3;
|
|
@@ -119131,7 +119273,7 @@ function sandboxPolicy(config3) {
|
|
|
119131
119273
|
function threadConfig(config3) {
|
|
119132
119274
|
return config3?.webSearchMode ? { web_search: config3.webSearchMode } : void 0;
|
|
119133
119275
|
}
|
|
119134
|
-
function threadParams(session, cwd) {
|
|
119276
|
+
function threadParams(session, cwd, browserInstructions) {
|
|
119135
119277
|
const config3 = parseRuntimeConfig(session);
|
|
119136
119278
|
return {
|
|
119137
119279
|
cwd,
|
|
@@ -119139,7 +119281,7 @@ function threadParams(session, cwd) {
|
|
|
119139
119281
|
sandbox: sandboxType(config3),
|
|
119140
119282
|
model: session.model ?? void 0,
|
|
119141
119283
|
config: threadConfig(config3),
|
|
119142
|
-
...threadInstructionParams(cwd)
|
|
119284
|
+
...threadInstructionParams(cwd, browserInstructions)
|
|
119143
119285
|
};
|
|
119144
119286
|
}
|
|
119145
119287
|
function shouldSkipItem(type) {
|
|
@@ -119151,12 +119293,13 @@ function isEmptyReasoning(item) {
|
|
|
119151
119293
|
const text2 = item.text ?? "";
|
|
119152
119294
|
return summary.length === 0 && content.length === 0 && text2.length === 0;
|
|
119153
119295
|
}
|
|
119154
|
-
function appServerClientOptions(session, cwd) {
|
|
119155
|
-
const launchArgs = codexMiniAppLaunchArgs(cwd, session.id);
|
|
119156
|
-
return
|
|
119296
|
+
function appServerClientOptions(session, cwd, extraArgs = []) {
|
|
119297
|
+
const launchArgs = codexMiniAppLaunchArgs(cwd, session.id) ?? [];
|
|
119298
|
+
return { cwd, launchArgs: [...launchArgs, ...extraArgs] };
|
|
119157
119299
|
}
|
|
119158
|
-
function threadInstructionParams(cwd) {
|
|
119159
|
-
|
|
119300
|
+
function threadInstructionParams(cwd, browserInstructions = null) {
|
|
119301
|
+
const parts = [isInAppFolder(cwd) ? appsConventions() : null, browserInstructions].filter((p) => !!p);
|
|
119302
|
+
return parts.length > 0 ? { developerInstructions: parts.join("\n\n") } : {};
|
|
119160
119303
|
}
|
|
119161
119304
|
function autoApproveToolUserInput(client) {
|
|
119162
119305
|
client.onRequest("item/tool/requestUserInput", async (params) => {
|
|
@@ -119224,7 +119367,8 @@ async function startThread(session) {
|
|
|
119224
119367
|
if (adopted && !adopted.client.isClosed()) return adopted;
|
|
119225
119368
|
}
|
|
119226
119369
|
const cwd = session.cwd ?? process.cwd();
|
|
119227
|
-
const
|
|
119370
|
+
const browser = await codexBrowserMcp(cwd);
|
|
119371
|
+
const options = appServerClientOptions(session, cwd, browser.args);
|
|
119228
119372
|
let entry = null;
|
|
119229
119373
|
const host = hostFor(session.id, cwd, options, (pid) => {
|
|
119230
119374
|
if (!entry) return;
|
|
@@ -119238,6 +119382,7 @@ async function startThread(session) {
|
|
|
119238
119382
|
// A hosted app-server has no cli_processes row: its host supervises it.
|
|
119239
119383
|
pid: host ? void 0 : client.pid,
|
|
119240
119384
|
...emptyThreadState(),
|
|
119385
|
+
browserInstructions: browser.instructions,
|
|
119241
119386
|
turns: [],
|
|
119242
119387
|
ended: /* @__PURE__ */ new Map(),
|
|
119243
119388
|
resumedTurnIds: null,
|
|
@@ -119251,7 +119396,7 @@ async function startThread(session) {
|
|
|
119251
119396
|
try {
|
|
119252
119397
|
await client.initialize();
|
|
119253
119398
|
autoApproveToolUserInput(client);
|
|
119254
|
-
const base = threadParams(session, cwd);
|
|
119399
|
+
const base = threadParams(session, cwd, entry.browserInstructions);
|
|
119255
119400
|
entry.webSearch = base.config?.web_search;
|
|
119256
119401
|
if (session.external_thread_id) {
|
|
119257
119402
|
entry.threadId = session.external_thread_id;
|
|
@@ -119754,7 +119899,7 @@ function sideThreadFor(entry, session, discussionThreadId) {
|
|
|
119754
119899
|
async function loadSideThread(entry, session, discussionThreadId) {
|
|
119755
119900
|
const db2 = getDb();
|
|
119756
119901
|
const row = db2.prepare("SELECT external_thread_id FROM discussion_threads WHERE id = ?").get(discussionThreadId);
|
|
119757
|
-
const base = threadParams(session, session.cwd ?? process.cwd());
|
|
119902
|
+
const base = threadParams(session, session.cwd ?? process.cwd(), entry.browserInstructions);
|
|
119758
119903
|
let codexThreadId;
|
|
119759
119904
|
if (row?.external_thread_id) {
|
|
119760
119905
|
entry.codexThreads.add(row.external_thread_id);
|
|
@@ -120522,6 +120667,7 @@ function adoptedEntry(db2, session, threadId, client, host) {
|
|
|
120522
120667
|
codexThreads: /* @__PURE__ */ new Set([threadId, ...sideOf.values()]),
|
|
120523
120668
|
contextTokens: new Map(fill === null ? [] : [[threadId, fill]]),
|
|
120524
120669
|
webSearch: threadConfig(parseRuntimeConfig(session))?.web_search,
|
|
120670
|
+
browserInstructions: null,
|
|
120525
120671
|
turns,
|
|
120526
120672
|
ended,
|
|
120527
120673
|
// A turn resumed on this app-server later continues with the continue
|
|
@@ -121004,7 +121150,7 @@ function classifyApiError({ error: error51, status, text: text2, limitRejected }
|
|
|
121004
121150
|
}
|
|
121005
121151
|
|
|
121006
121152
|
// src/claude/claude-host.ts
|
|
121007
|
-
import { spawn as
|
|
121153
|
+
import { spawn as spawn7 } from "node:child_process";
|
|
121008
121154
|
var REPLAY_DONE_SUBTYPE = "agentpane_replay_done";
|
|
121009
121155
|
var REPLAY_MARKER2 = JSON.stringify({ type: "system", subtype: REPLAY_DONE_SUBTYPE });
|
|
121010
121156
|
function isReplayMarker(message) {
|
|
@@ -121067,7 +121213,7 @@ function hostedSpawner(db2, binding, info) {
|
|
|
121067
121213
|
} catch (err) {
|
|
121068
121214
|
console.error(`[claude] no session host for ${info.entryKey} (${err.message}); running the CLI directly`);
|
|
121069
121215
|
forgetHost(binding.id, binding.dir);
|
|
121070
|
-
const child =
|
|
121216
|
+
const child = spawn7(opts.command, opts.args, { cwd, env: opts.env, signal: opts.signal, stdio: ["pipe", "pipe", "ignore"] });
|
|
121071
121217
|
info.onDirect(child.pid);
|
|
121072
121218
|
return child;
|
|
121073
121219
|
}
|
|
@@ -121391,6 +121537,7 @@ async function ensureSessionStarted(session, mapKey, resumeSessionId, resume, ad
|
|
|
121391
121537
|
const rescue = resume && resumeId ? resume : void 0;
|
|
121392
121538
|
const env = spawnEnv(session.id, rescue);
|
|
121393
121539
|
let cliPid = null;
|
|
121540
|
+
const browserMcpServers = adopt ? {} : await claudeBrowserMcpServers(cwd);
|
|
121394
121541
|
let host = null;
|
|
121395
121542
|
let spawner;
|
|
121396
121543
|
if (adopt) {
|
|
@@ -121427,7 +121574,7 @@ async function ensureSessionStarted(session, mapKey, resumeSessionId, resume, ad
|
|
|
121427
121574
|
// reaches the pane only this way, with its sender in `origin` (MUH-102).
|
|
121428
121575
|
extraArgs: { "replay-user-messages": null },
|
|
121429
121576
|
// Inline visuals: the model's show_widget calls render in the chat.
|
|
121430
|
-
mcpServers: { [WIDGET_SERVER_NAME]: createWidgetMcpServer() },
|
|
121577
|
+
mcpServers: { ...browserMcpServers, [WIDGET_SERVER_NAME]: createWidgetMcpServer() },
|
|
121431
121578
|
...CLI_OVERRIDE,
|
|
121432
121579
|
...session.model_reasoning_effort ? { effort: session.model_reasoning_effort } : {},
|
|
121433
121580
|
...resumeId ? { resume: resumeId } : {},
|
|
@@ -122946,8 +123093,8 @@ var RepoburgHttpClient = class {
|
|
|
122946
123093
|
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
122947
123094
|
}
|
|
122948
123095
|
/** Perform a JSON request. Throws a concise error on non-OK/non-JSON responses. */
|
|
122949
|
-
async request(method,
|
|
122950
|
-
const response = await fetch(`${this.baseUrl}${
|
|
123096
|
+
async request(method, path20, body) {
|
|
123097
|
+
const response = await fetch(`${this.baseUrl}${path20}`, {
|
|
122951
123098
|
method,
|
|
122952
123099
|
headers: { "Content-Type": "application/json" },
|
|
122953
123100
|
body: body === void 0 ? void 0 : JSON.stringify(body)
|
|
@@ -122956,17 +123103,17 @@ var RepoburgHttpClient = class {
|
|
|
122956
123103
|
if (!response.ok) {
|
|
122957
123104
|
if (isHtml(text2)) {
|
|
122958
123105
|
throw new Error(
|
|
122959
|
-
`${method} ${
|
|
123106
|
+
`${method} ${path20} failed: ${response.status} HTML response from ${this.baseUrl} \u2014 the URL points to the wrong server`
|
|
122960
123107
|
);
|
|
122961
123108
|
}
|
|
122962
|
-
throw new Error(`${method} ${
|
|
123109
|
+
throw new Error(`${method} ${path20} failed: ${response.status} ${text2}`);
|
|
122963
123110
|
}
|
|
122964
123111
|
if (text2.length === 0) return void 0;
|
|
122965
123112
|
try {
|
|
122966
123113
|
return JSON.parse(text2);
|
|
122967
123114
|
} catch {
|
|
122968
123115
|
throw new Error(
|
|
122969
|
-
`${method} ${
|
|
123116
|
+
`${method} ${path20} failed: non-JSON response from ${this.baseUrl} \u2014 the URL points to the wrong server`
|
|
122970
123117
|
);
|
|
122971
123118
|
}
|
|
122972
123119
|
}
|
|
@@ -123021,7 +123168,7 @@ var RepoburgHttpClient = class {
|
|
|
123021
123168
|
};
|
|
123022
123169
|
|
|
123023
123170
|
// src/repoburg/backend-resolver.ts
|
|
123024
|
-
import
|
|
123171
|
+
import path18 from "node:path";
|
|
123025
123172
|
var HEALTH_POLL_INTERVAL_MS = 1e3;
|
|
123026
123173
|
var HEALTH_TIMEOUT_MS = 3e4;
|
|
123027
123174
|
function daemonBaseUrl() {
|
|
@@ -123076,7 +123223,7 @@ async function backendHealthy(baseUrl, expectedPath) {
|
|
|
123076
123223
|
const health = await fetchJson(`${baseUrl}/health`, void 0, 2e3);
|
|
123077
123224
|
if (health.status !== "ok") return false;
|
|
123078
123225
|
if (expectedPath && health.projectPath) {
|
|
123079
|
-
return
|
|
123226
|
+
return path18.resolve(health.projectPath) === path18.resolve(expectedPath);
|
|
123080
123227
|
}
|
|
123081
123228
|
return true;
|
|
123082
123229
|
} catch {
|
|
@@ -123097,7 +123244,7 @@ function serviceBaseUrl(service) {
|
|
|
123097
123244
|
return `http://localhost:${service.port}`;
|
|
123098
123245
|
}
|
|
123099
123246
|
function coveringService(services, absPath) {
|
|
123100
|
-
return services.filter((s) => absPath === s.path || absPath.startsWith(s.path +
|
|
123247
|
+
return services.filter((s) => absPath === s.path || absPath.startsWith(s.path + path18.sep)).sort((a, b) => b.path.length - a.path.length)[0];
|
|
123101
123248
|
}
|
|
123102
123249
|
async function restartService(daemon, name) {
|
|
123103
123250
|
try {
|
|
@@ -123133,7 +123280,7 @@ async function resolveBackendUrl(projectPath, opts = {}) {
|
|
|
123133
123280
|
if (envUrl) {
|
|
123134
123281
|
return { baseUrl: envUrl.replace(/\/+$/, ""), port: 0, name: "REPOBURG_BACKEND_URL" };
|
|
123135
123282
|
}
|
|
123136
|
-
const absPath =
|
|
123283
|
+
const absPath = path18.resolve(projectPath);
|
|
123137
123284
|
const daemon = daemonBaseUrl();
|
|
123138
123285
|
const cached3 = resolvedCache.get(absPath);
|
|
123139
123286
|
if (cached3 && await backendHealthy(cached3.baseUrl, cached3.servesPath ?? absPath)) {
|
|
@@ -124814,7 +124961,7 @@ registerProvider("repoburg", repoburgProvider);
|
|
|
124814
124961
|
async function createAgentPaneApp(dbPath, opts = {}) {
|
|
124815
124962
|
const allowRequest = opts.allowRequest ?? isLocalRequest;
|
|
124816
124963
|
initDb(dbPath);
|
|
124817
|
-
setPaneDataDir(dbPath === ":memory:" ? null :
|
|
124964
|
+
setPaneDataDir(dbPath === ":memory:" ? null : path19.dirname(path19.resolve(dbPath)));
|
|
124818
124965
|
const fastify = (0, import_fastify.default)({ logger: true, bodyLimit: 50 * 1024 * 1024 });
|
|
124819
124966
|
fastify.addHook("onRequest", async (request, reply) => {
|
|
124820
124967
|
if (!allowRequest(request.headers.origin, request.headers.host)) {
|
|
@@ -124867,6 +125014,7 @@ function startHostServices(opts = {}) {
|
|
|
124867
125014
|
});
|
|
124868
125015
|
setStartupGate(started);
|
|
124869
125016
|
void getVscodeWebManager().reapOrphans();
|
|
125017
|
+
prepareBrowserMcp();
|
|
124870
125018
|
return started;
|
|
124871
125019
|
}
|
|
124872
125020
|
async function shutdownHost() {
|