repoburg 1.3.242 → 1.3.243

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.
Files changed (30) hide show
  1. package/agent-pane/backend/dist/index.js +256 -368
  2. package/agent-pane/backend/dist/server.js +256 -368
  3. package/agent-pane/frontend/dist/assets/{index-DNe6bagG.css → index-DUnfaPeK.css} +1 -1
  4. package/agent-pane/frontend/dist/assets/{index-CBTsbWig.js → index-KcwodzRz.js} +42 -42
  5. package/agent-pane/frontend/dist/index.html +2 -2
  6. package/daemon/dist/index.js +0 -0
  7. package/package.json +1 -1
  8. package/backend/.env +0 -1
  9. package/backend/section-modified.txt +0 -1
  10. package/miniapp-catalog-modal.png +0 -0
  11. package/miniapp-daemon-e2e-green.png +0 -0
  12. package/miniapp-faz31-codex-green.png +0 -0
  13. package/miniapp-pr-review-green.png +0 -0
  14. package/miniapp-typesafe-verified.png +0 -0
  15. package/miniapp-workspace-scoped.png +0 -0
  16. package/visual-editor-proxy/client/dist/main.js +0 -89
  17. package/visual-editor-proxy/dist/client/src/inspector.d.ts +0 -9
  18. package/visual-editor-proxy/dist/client/src/inspector.js +0 -96
  19. package/visual-editor-proxy/dist/client/src/inspector.js.map +0 -1
  20. package/visual-editor-proxy/dist/client/src/main.d.ts +0 -6
  21. package/visual-editor-proxy/dist/client/src/main.js +0 -108
  22. package/visual-editor-proxy/dist/client/src/main.js.map +0 -1
  23. package/visual-editor-proxy/dist/client/src/ui.d.ts +0 -6
  24. package/visual-editor-proxy/dist/client/src/ui.js +0 -153
  25. package/visual-editor-proxy/dist/client/src/ui.js.map +0 -1
  26. package/visual-editor-proxy/dist/src/main.d.ts +0 -1
  27. package/visual-editor-proxy/dist/src/main.js +0 -61
  28. package/visual-editor-proxy/dist/src/main.js.map +0 -1
  29. package/visual-editor-proxy/dist/tsconfig.tsbuildinfo +0 -1
  30. package/vscode-serve-web-test.png +0 -0
@@ -6124,8 +6124,8 @@ var require_req = __commonJS({
6124
6124
  if (req.originalUrl) {
6125
6125
  _req.url = req.originalUrl;
6126
6126
  } else {
6127
- const path9 = req.path;
6128
- _req.url = typeof path9 === "string" ? path9 : req.url ? req.url.path || req.url : void 0;
6127
+ const path8 = req.path;
6128
+ _req.url = typeof path8 === "string" ? path8 : req.url ? req.url.path || req.url : void 0;
6129
6129
  }
6130
6130
  if (req.query) {
6131
6131
  _req.query = req.query;
@@ -6290,14 +6290,14 @@ var require_redact = __commonJS({
6290
6290
  }
6291
6291
  return obj;
6292
6292
  }
6293
- function parsePath(path9) {
6293
+ function parsePath(path8) {
6294
6294
  const parts = [];
6295
6295
  let current = "";
6296
6296
  let inBrackets = false;
6297
6297
  let inQuotes = false;
6298
6298
  let quoteChar = "";
6299
- for (let i = 0; i < path9.length; i++) {
6300
- const char = path9[i];
6299
+ for (let i = 0; i < path8.length; i++) {
6300
+ const char = path8[i];
6301
6301
  if (!inBrackets && char === ".") {
6302
6302
  if (current) {
6303
6303
  parts.push(current);
@@ -6428,10 +6428,10 @@ var require_redact = __commonJS({
6428
6428
  return current;
6429
6429
  }
6430
6430
  function redactPaths(obj, paths, censor, remove = false) {
6431
- for (const path9 of paths) {
6432
- const parts = parsePath(path9);
6431
+ for (const path8 of paths) {
6432
+ const parts = parsePath(path8);
6433
6433
  if (parts.includes("*")) {
6434
- redactWildcardPath(obj, parts, censor, path9, remove);
6434
+ redactWildcardPath(obj, parts, censor, path8, remove);
6435
6435
  } else {
6436
6436
  if (remove) {
6437
6437
  removeKey(obj, parts);
@@ -6516,8 +6516,8 @@ var require_redact = __commonJS({
6516
6516
  }
6517
6517
  } else {
6518
6518
  if (afterWildcard.includes("*")) {
6519
- const wrappedCensor = typeof censor === "function" ? (value, path9) => {
6520
- const fullPath = [...pathArray.slice(0, pathLength), ...path9];
6519
+ const wrappedCensor = typeof censor === "function" ? (value, path8) => {
6520
+ const fullPath = [...pathArray.slice(0, pathLength), ...path8];
6521
6521
  return censor(value, fullPath);
6522
6522
  } : censor;
6523
6523
  redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
@@ -6552,8 +6552,8 @@ var require_redact = __commonJS({
6552
6552
  return null;
6553
6553
  }
6554
6554
  const pathStructure = /* @__PURE__ */ new Map();
6555
- for (const path9 of pathsToClone) {
6556
- const parts = parsePath(path9);
6555
+ for (const path8 of pathsToClone) {
6556
+ const parts = parsePath(path8);
6557
6557
  let current = pathStructure;
6558
6558
  for (let i = 0; i < parts.length; i++) {
6559
6559
  const part = parts[i];
@@ -6605,24 +6605,24 @@ var require_redact = __commonJS({
6605
6605
  }
6606
6606
  return cloneSelectively(obj, pathStructure);
6607
6607
  }
6608
- function validatePath(path9) {
6609
- if (typeof path9 !== "string") {
6608
+ function validatePath(path8) {
6609
+ if (typeof path8 !== "string") {
6610
6610
  throw new Error("Paths must be (non-empty) strings");
6611
6611
  }
6612
- if (path9 === "") {
6612
+ if (path8 === "") {
6613
6613
  throw new Error("Invalid redaction path ()");
6614
6614
  }
6615
- if (path9.includes("..")) {
6616
- throw new Error(`Invalid redaction path (${path9})`);
6615
+ if (path8.includes("..")) {
6616
+ throw new Error(`Invalid redaction path (${path8})`);
6617
6617
  }
6618
- if (path9.includes(",")) {
6619
- throw new Error(`Invalid redaction path (${path9})`);
6618
+ if (path8.includes(",")) {
6619
+ throw new Error(`Invalid redaction path (${path8})`);
6620
6620
  }
6621
6621
  let bracketCount = 0;
6622
6622
  let inQuotes = false;
6623
6623
  let quoteChar = "";
6624
- for (let i = 0; i < path9.length; i++) {
6625
- const char = path9[i];
6624
+ for (let i = 0; i < path8.length; i++) {
6625
+ const char = path8[i];
6626
6626
  if ((char === '"' || char === "'") && bracketCount > 0) {
6627
6627
  if (!inQuotes) {
6628
6628
  inQuotes = true;
@@ -6636,20 +6636,20 @@ var require_redact = __commonJS({
6636
6636
  } else if (char === "]" && !inQuotes) {
6637
6637
  bracketCount--;
6638
6638
  if (bracketCount < 0) {
6639
- throw new Error(`Invalid redaction path (${path9})`);
6639
+ throw new Error(`Invalid redaction path (${path8})`);
6640
6640
  }
6641
6641
  }
6642
6642
  }
6643
6643
  if (bracketCount !== 0) {
6644
- throw new Error(`Invalid redaction path (${path9})`);
6644
+ throw new Error(`Invalid redaction path (${path8})`);
6645
6645
  }
6646
6646
  }
6647
6647
  function validatePaths(paths) {
6648
6648
  if (!Array.isArray(paths)) {
6649
6649
  throw new TypeError("paths must be an array");
6650
6650
  }
6651
- for (const path9 of paths) {
6652
- validatePath(path9);
6651
+ for (const path8 of paths) {
6652
+ validatePath(path8);
6653
6653
  }
6654
6654
  }
6655
6655
  function slowRedact(options = {}) {
@@ -6817,8 +6817,8 @@ var require_redaction = __commonJS({
6817
6817
  if (shape[k] === null) {
6818
6818
  o[k] = (value) => topCensor(value, [k]);
6819
6819
  } else {
6820
- const wrappedCensor = typeof censor === "function" ? (value, path9) => {
6821
- return censor(value, [k, ...path9]);
6820
+ const wrappedCensor = typeof censor === "function" ? (value, path8) => {
6821
+ return censor(value, [k, ...path8]);
6822
6822
  } : censor;
6823
6823
  o[k] = Redact({
6824
6824
  paths: shape[k],
@@ -7039,7 +7039,7 @@ var require_sonic_boom = __commonJS({
7039
7039
  var fs6 = __require("fs");
7040
7040
  var EventEmitter2 = __require("events");
7041
7041
  var inherits = __require("util").inherits;
7042
- var path9 = __require("path");
7042
+ var path8 = __require("path");
7043
7043
  var sleep = require_atomic_sleep();
7044
7044
  var assert = __require("assert");
7045
7045
  var BUSY_WRITE_TIMEOUT = 100;
@@ -7093,7 +7093,7 @@ var require_sonic_boom = __commonJS({
7093
7093
  const mode = sonic.mode;
7094
7094
  if (sonic.sync) {
7095
7095
  try {
7096
- if (sonic.mkdir) fs6.mkdirSync(path9.dirname(file), { recursive: true });
7096
+ if (sonic.mkdir) fs6.mkdirSync(path8.dirname(file), { recursive: true });
7097
7097
  const fd = fs6.openSync(file, flags, mode);
7098
7098
  fileOpened(null, fd);
7099
7099
  } catch (err) {
@@ -7101,7 +7101,7 @@ var require_sonic_boom = __commonJS({
7101
7101
  throw err;
7102
7102
  }
7103
7103
  } else if (sonic.mkdir) {
7104
- fs6.mkdir(path9.dirname(file), { recursive: true }, (err) => {
7104
+ fs6.mkdir(path8.dirname(file), { recursive: true }, (err) => {
7105
7105
  if (err) return fileOpened(err);
7106
7106
  fs6.open(file, flags, mode, fileOpened);
7107
7107
  });
@@ -8433,15 +8433,15 @@ var require_transport = __commonJS({
8433
8433
  if (!unquoted) {
8434
8434
  return false;
8435
8435
  }
8436
- let path9 = unquoted;
8437
- if (path9.startsWith("file://")) {
8436
+ let path8 = unquoted;
8437
+ if (path8.startsWith("file://")) {
8438
8438
  try {
8439
- path9 = fileURLToPath3(path9);
8439
+ path8 = fileURLToPath3(path8);
8440
8440
  } catch {
8441
8441
  return false;
8442
8442
  }
8443
8443
  }
8444
- return isAbsolute(path9) && !existsSync2(path9);
8444
+ return isAbsolute(path8) && !existsSync2(path8);
8445
8445
  }
8446
8446
  function stripQuotes(value) {
8447
8447
  const first = value[0];
@@ -17117,8 +17117,8 @@ var require_utils = __commonJS({
17117
17117
  }
17118
17118
  return ind;
17119
17119
  }
17120
- function removeDotSegments(path9) {
17121
- let input = path9;
17120
+ function removeDotSegments(path8) {
17121
+ let input = path8;
17122
17122
  const output = [];
17123
17123
  let nextSlash = -1;
17124
17124
  let len = 0;
@@ -17370,8 +17370,8 @@ var require_schemes = __commonJS({
17370
17370
  wsComponent.secure = void 0;
17371
17371
  }
17372
17372
  if (wsComponent.resourceName) {
17373
- const [path9, query2] = wsComponent.resourceName.split("?");
17374
- wsComponent.path = path9 && path9 !== "/" ? path9 : void 0;
17373
+ const [path8, query2] = wsComponent.resourceName.split("?");
17374
+ wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
17375
17375
  wsComponent.query = query2;
17376
17376
  wsComponent.resourceName = void 0;
17377
17377
  }
@@ -22308,8 +22308,8 @@ var require_utils2 = __commonJS({
22308
22308
  }
22309
22309
  return ind;
22310
22310
  }
22311
- function removeDotSegments(path9) {
22312
- let input = path9;
22311
+ function removeDotSegments(path8) {
22312
+ let input = path8;
22313
22313
  const output = [];
22314
22314
  let nextSlash = -1;
22315
22315
  let len = 0;
@@ -22654,8 +22654,8 @@ var require_schemes2 = __commonJS({
22654
22654
  wsComponent.secure = void 0;
22655
22655
  }
22656
22656
  if (wsComponent.resourceName) {
22657
- const [path9, query2] = wsComponent.resourceName.split("?");
22658
- wsComponent.path = path9 && path9 !== "/" ? path9 : void 0;
22657
+ const [path8, query2] = wsComponent.resourceName.split("?");
22658
+ wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
22659
22659
  wsComponent.query = query2;
22660
22660
  wsComponent.resourceName = void 0;
22661
22661
  }
@@ -24139,8 +24139,8 @@ var require_utils3 = __commonJS({
24139
24139
  }
24140
24140
  return ind;
24141
24141
  }
24142
- function removeDotSegments(path9) {
24143
- let input = path9;
24142
+ function removeDotSegments(path8) {
24143
+ let input = path8;
24144
24144
  const output = [];
24145
24145
  let nextSlash = -1;
24146
24146
  let len = 0;
@@ -24485,8 +24485,8 @@ var require_schemes3 = __commonJS({
24485
24485
  wsComponent.secure = void 0;
24486
24486
  }
24487
24487
  if (wsComponent.resourceName) {
24488
- const [path9, query2] = wsComponent.resourceName.split("?");
24489
- wsComponent.path = path9 && path9 !== "/" ? path9 : void 0;
24488
+ const [path8, query2] = wsComponent.resourceName.split("?");
24489
+ wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
24490
24490
  wsComponent.query = query2;
24491
24491
  wsComponent.resourceName = void 0;
24492
24492
  }
@@ -32003,13 +32003,13 @@ var require_node = __commonJS({
32003
32003
  this.staticChildrenNodes[index] = node;
32004
32004
  }
32005
32005
  }
32006
- findStaticMatchingChild(path9, pathIndex) {
32007
- const charCode = path9.charCodeAt(pathIndex);
32006
+ findStaticMatchingChild(path8, pathIndex) {
32007
+ const charCode = path8.charCodeAt(pathIndex);
32008
32008
  const charCodes = this.staticChildrenCharCodes;
32009
32009
  for (let i = 0; i < charCodes.length; i++) {
32010
32010
  if (charCodes[i] === charCode) {
32011
32011
  const staticChild = this.staticChildrenNodes[i];
32012
- if (staticChild.matchPrefix(path9, pathIndex)) {
32012
+ if (staticChild.matchPrefix(path8, pathIndex)) {
32013
32013
  return staticChild;
32014
32014
  }
32015
32015
  return null;
@@ -32017,34 +32017,34 @@ var require_node = __commonJS({
32017
32017
  }
32018
32018
  return null;
32019
32019
  }
32020
- getStaticChild(path9, pathIndex = 0) {
32021
- if (path9.length === pathIndex) {
32020
+ getStaticChild(path8, pathIndex = 0) {
32021
+ if (path8.length === pathIndex) {
32022
32022
  return this;
32023
32023
  }
32024
- const staticChild = this.findStaticMatchingChild(path9, pathIndex);
32024
+ const staticChild = this.findStaticMatchingChild(path8, pathIndex);
32025
32025
  if (staticChild) {
32026
- return staticChild.getStaticChild(path9, pathIndex + staticChild.prefix.length);
32026
+ return staticChild.getStaticChild(path8, pathIndex + staticChild.prefix.length);
32027
32027
  }
32028
32028
  return null;
32029
32029
  }
32030
- createStaticChild(path9) {
32031
- if (path9.length === 0) {
32030
+ createStaticChild(path8) {
32031
+ if (path8.length === 0) {
32032
32032
  return this;
32033
32033
  }
32034
- const childIndex = this.staticChildrenCharCodes.indexOf(path9.charCodeAt(0));
32034
+ const childIndex = this.staticChildrenCharCodes.indexOf(path8.charCodeAt(0));
32035
32035
  let staticChild = childIndex === -1 ? void 0 : this.staticChildrenNodes[childIndex];
32036
32036
  if (staticChild) {
32037
32037
  let i = 1;
32038
32038
  for (; i < staticChild.prefix.length; i++) {
32039
- if (path9.charCodeAt(i) !== staticChild.prefix.charCodeAt(i)) {
32039
+ if (path8.charCodeAt(i) !== staticChild.prefix.charCodeAt(i)) {
32040
32040
  staticChild = staticChild.split(this, i);
32041
32041
  break;
32042
32042
  }
32043
32043
  }
32044
- return staticChild.createStaticChild(path9.slice(i));
32044
+ return staticChild.createStaticChild(path8.slice(i));
32045
32045
  }
32046
- const node = new StaticNode(path9);
32047
- this.setStaticChild(path9.charAt(0), node);
32046
+ const node = new StaticNode(path8);
32047
+ this.setStaticChild(path8.charAt(0), node);
32048
32048
  return node;
32049
32049
  }
32050
32050
  };
@@ -32104,8 +32104,8 @@ var require_node = __commonJS({
32104
32104
  parentNode.setStaticChild(parentPrefix.charAt(0), staticNode);
32105
32105
  return staticNode;
32106
32106
  }
32107
- getNextNode(path9, pathIndex, nodeStack, paramsCount) {
32108
- let node = this.findStaticMatchingChild(path9, pathIndex);
32107
+ getNextNode(path8, pathIndex, nodeStack, paramsCount) {
32108
+ let node = this.findStaticMatchingChild(path8, pathIndex);
32109
32109
  let parametricBrotherNodeIndex = 0;
32110
32110
  if (node === null) {
32111
32111
  if (this.parametricChildren.length === 0) {
@@ -32152,8 +32152,8 @@ var require_node = __commonJS({
32152
32152
  this.kind = NODE_TYPES.PARAMETRIC;
32153
32153
  this.nodePaths = /* @__PURE__ */ new Set([nodePath]);
32154
32154
  }
32155
- getNextNode(path9, pathIndex) {
32156
- return this.findStaticMatchingChild(path9, pathIndex);
32155
+ getNextNode(path8, pathIndex) {
32156
+ return this.findStaticMatchingChild(path8, pathIndex);
32157
32157
  }
32158
32158
  };
32159
32159
  var WildcardNode = class extends Node {
@@ -32509,81 +32509,81 @@ var require_url_sanitizer = __commonJS({
32509
32509
  return String.fromCharCode(charCode);
32510
32510
  }
32511
32511
  var MIN_NATIVE_SCAN_LENGTH = 12;
32512
- function safeDecodeURI(path9, useSemicolonDelimiter) {
32513
- if (path9.length >= MIN_NATIVE_SCAN_LENGTH) {
32514
- return safeDecodeURINativeScan(path9, useSemicolonDelimiter);
32512
+ function safeDecodeURI(path8, useSemicolonDelimiter) {
32513
+ if (path8.length >= MIN_NATIVE_SCAN_LENGTH) {
32514
+ return safeDecodeURINativeScan(path8, useSemicolonDelimiter);
32515
32515
  }
32516
- return safeDecodeURICharScan(path9, useSemicolonDelimiter, 1);
32516
+ return safeDecodeURICharScan(path8, useSemicolonDelimiter, 1);
32517
32517
  }
32518
- function safeDecodeURINativeScan(path9, useSemicolonDelimiter) {
32519
- const percentIndex = path9.indexOf("%", 1);
32520
- let delimIndex = path9.indexOf("?", 1);
32521
- const hashIndex = path9.indexOf("#", 1);
32518
+ function safeDecodeURINativeScan(path8, useSemicolonDelimiter) {
32519
+ const percentIndex = path8.indexOf("%", 1);
32520
+ let delimIndex = path8.indexOf("?", 1);
32521
+ const hashIndex = path8.indexOf("#", 1);
32522
32522
  if (hashIndex !== -1 && (delimIndex === -1 || hashIndex < delimIndex)) {
32523
32523
  delimIndex = hashIndex;
32524
32524
  }
32525
32525
  if (useSemicolonDelimiter) {
32526
- const semicolonIndex = path9.indexOf(";", 1);
32526
+ const semicolonIndex = path8.indexOf(";", 1);
32527
32527
  if (semicolonIndex !== -1 && (delimIndex === -1 || semicolonIndex < delimIndex)) {
32528
32528
  delimIndex = semicolonIndex;
32529
32529
  }
32530
32530
  }
32531
32531
  if (percentIndex === -1 || delimIndex !== -1 && percentIndex > delimIndex) {
32532
32532
  if (delimIndex === -1) {
32533
- return { path: path9, querystring: "", shouldDecodeParam: false };
32533
+ return { path: path8, querystring: "", shouldDecodeParam: false };
32534
32534
  }
32535
32535
  return {
32536
- path: path9.slice(0, delimIndex),
32537
- querystring: path9.slice(delimIndex + 1),
32536
+ path: path8.slice(0, delimIndex),
32537
+ querystring: path8.slice(delimIndex + 1),
32538
32538
  shouldDecodeParam: false
32539
32539
  };
32540
32540
  }
32541
- return safeDecodeURIPercentScan(path9, useSemicolonDelimiter, percentIndex);
32541
+ return safeDecodeURIPercentScan(path8, useSemicolonDelimiter, percentIndex);
32542
32542
  }
32543
- function safeDecodeURICharScan(path9, useSemicolonDelimiter, startIndex) {
32544
- for (let i = startIndex; i < path9.length; i++) {
32545
- const charCode = path9.charCodeAt(i);
32543
+ function safeDecodeURICharScan(path8, useSemicolonDelimiter, startIndex) {
32544
+ for (let i = startIndex; i < path8.length; i++) {
32545
+ const charCode = path8.charCodeAt(i);
32546
32546
  if (charCode === 37) {
32547
- return safeDecodeURIPercentScan(path9, useSemicolonDelimiter, i);
32547
+ return safeDecodeURIPercentScan(path8, useSemicolonDelimiter, i);
32548
32548
  } else if (charCode === 63 || charCode === 35 || charCode === 59 && useSemicolonDelimiter) {
32549
32549
  return {
32550
- path: path9.slice(0, i),
32551
- querystring: path9.slice(i + 1),
32550
+ path: path8.slice(0, i),
32551
+ querystring: path8.slice(i + 1),
32552
32552
  shouldDecodeParam: false
32553
32553
  };
32554
32554
  }
32555
32555
  }
32556
- return { path: path9, querystring: "", shouldDecodeParam: false };
32556
+ return { path: path8, querystring: "", shouldDecodeParam: false };
32557
32557
  }
32558
- function reencodePercentChar(path9, index) {
32559
- return path9.slice(0, index + 1) + "25" + path9.slice(index + 1);
32558
+ function reencodePercentChar(path8, index) {
32559
+ return path8.slice(0, index + 1) + "25" + path8.slice(index + 1);
32560
32560
  }
32561
- function safeDecodeURIPercentScan(path9, useSemicolonDelimiter, startIndex) {
32561
+ function safeDecodeURIPercentScan(path8, useSemicolonDelimiter, startIndex) {
32562
32562
  let shouldDecode = false;
32563
32563
  let shouldDecodeParam = false;
32564
32564
  let querystring = "";
32565
- for (let i = startIndex; i < path9.length; i++) {
32566
- const charCode = path9.charCodeAt(i);
32565
+ for (let i = startIndex; i < path8.length; i++) {
32566
+ const charCode = path8.charCodeAt(i);
32567
32567
  if (charCode === 37) {
32568
- const componentCharCode = decodeComponentCharCode(path9.charCodeAt(i + 1), path9.charCodeAt(i + 2));
32568
+ const componentCharCode = decodeComponentCharCode(path8.charCodeAt(i + 1), path8.charCodeAt(i + 2));
32569
32569
  if (componentCharCode === 0) {
32570
32570
  shouldDecode = true;
32571
32571
  } else {
32572
32572
  shouldDecodeParam = true;
32573
32573
  if (componentCharCode === 37) {
32574
32574
  shouldDecode = true;
32575
- path9 = reencodePercentChar(path9, i);
32575
+ path8 = reencodePercentChar(path8, i);
32576
32576
  i += 2;
32577
32577
  }
32578
32578
  i += 2;
32579
32579
  }
32580
32580
  } else if (charCode === 63 || charCode === 35 || charCode === 59 && useSemicolonDelimiter) {
32581
- querystring = path9.slice(i + 1);
32582
- path9 = path9.slice(0, i);
32581
+ querystring = path8.slice(i + 1);
32582
+ path8 = path8.slice(0, i);
32583
32583
  break;
32584
32584
  }
32585
32585
  }
32586
- const decodedPath = shouldDecode ? decodeURI(path9) : path9;
32586
+ const decodedPath = shouldDecode ? decodeURI(path8) : path8;
32587
32587
  return { path: decodedPath, querystring, shouldDecodeParam };
32588
32588
  }
32589
32589
  function safeDecodeURIComponent(uriComponent) {
@@ -32678,7 +32678,7 @@ var require_find_my_way = __commonJS({
32678
32678
  this.trees = /* @__PURE__ */ Object.create(null);
32679
32679
  this._treeGET = null;
32680
32680
  }
32681
- Router.prototype.on = function on(method, path9, opts, handler, store) {
32681
+ Router.prototype.on = function on(method, path8, opts, handler, store) {
32682
32682
  if (typeof opts === "function") {
32683
32683
  if (handler !== void 0) {
32684
32684
  store = handler;
@@ -32686,34 +32686,34 @@ var require_find_my_way = __commonJS({
32686
32686
  handler = opts;
32687
32687
  opts = {};
32688
32688
  }
32689
- assert(typeof path9 === "string", "Path should be a string");
32690
- assert(path9.length > 0, "The path could not be empty");
32691
- assert(path9[0] === "/" || path9[0] === "*", "The first character of a path should be `/` or `*`");
32689
+ assert(typeof path8 === "string", "Path should be a string");
32690
+ assert(path8.length > 0, "The path could not be empty");
32691
+ assert(path8[0] === "/" || path8[0] === "*", "The first character of a path should be `/` or `*`");
32692
32692
  assert(typeof handler === "function", "Handler should be a function");
32693
- const optionalParamMatch = path9.match(OPTIONAL_PARAM_REGEXP);
32693
+ const optionalParamMatch = path8.match(OPTIONAL_PARAM_REGEXP);
32694
32694
  if (optionalParamMatch) {
32695
- assert(path9.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
32696
- const pathFull = path9.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
32697
- const pathOptional = path9.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/";
32695
+ assert(path8.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
32696
+ const pathFull = path8.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
32697
+ const pathOptional = path8.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/";
32698
32698
  this.on(method, pathFull, opts, handler, store);
32699
32699
  this.on(method, pathOptional, opts, handler, store);
32700
32700
  return;
32701
32701
  }
32702
- const route = path9;
32702
+ const route = path8;
32703
32703
  if (this.ignoreDuplicateSlashes) {
32704
- path9 = removeDuplicateSlashes(path9);
32704
+ path8 = removeDuplicateSlashes(path8);
32705
32705
  }
32706
32706
  if (this.ignoreTrailingSlash) {
32707
- path9 = trimLastSlash(path9);
32707
+ path8 = trimLastSlash(path8);
32708
32708
  }
32709
32709
  const methods = Array.isArray(method) ? method : [method];
32710
32710
  for (const method2 of methods) {
32711
32711
  assert(typeof method2 === "string", "Method should be a string");
32712
32712
  assert(httpMethods.includes(method2), `Method '${method2}' is not an http method.`);
32713
- this._on(method2, path9, opts, handler, store, route);
32713
+ this._on(method2, path8, opts, handler, store, route);
32714
32714
  }
32715
32715
  };
32716
- Router.prototype._on = function _on(method, path9, opts, handler, store) {
32716
+ Router.prototype._on = function _on(method, path8, opts, handler, store) {
32717
32717
  let constraints = {};
32718
32718
  if (opts.constraints !== void 0) {
32719
32719
  assert(typeof opts.constraints === "object" && opts.constraints !== null, "Constraints should be an object");
@@ -32726,7 +32726,7 @@ var require_find_my_way = __commonJS({
32726
32726
  if (this.trees[method] === void 0) {
32727
32727
  this.trees[method] = new StaticNode("/");
32728
32728
  }
32729
- let pattern = path9;
32729
+ let pattern = path8;
32730
32730
  if (pattern === "*" && this.trees[method].prefix.length !== 0) {
32731
32731
  const currentRoot = this.trees[method];
32732
32732
  this.trees[method] = new StaticNode("");
@@ -32834,19 +32834,19 @@ var require_find_my_way = __commonJS({
32834
32834
  throw new Error(`Method '${method}' already declared for route '${pattern}' with constraints '${JSON.stringify(constraints)}'`);
32835
32835
  }
32836
32836
  }
32837
- const route = { method, path: path9, pattern, params, opts, handler, store };
32837
+ const route = { method, path: path8, pattern, params, opts, handler, store };
32838
32838
  this.routes.push(route);
32839
32839
  currentNode.addRoute(route, this.constrainer);
32840
32840
  };
32841
- Router.prototype.hasRoute = function hasRoute(method, path9, constraints) {
32842
- const route = this.findRoute(method, path9, constraints);
32841
+ Router.prototype.hasRoute = function hasRoute(method, path8, constraints) {
32842
+ const route = this.findRoute(method, path8, constraints);
32843
32843
  return route !== null;
32844
32844
  };
32845
- Router.prototype.findRoute = function findNode(method, path9, constraints = {}) {
32845
+ Router.prototype.findRoute = function findNode(method, path8, constraints = {}) {
32846
32846
  if (this.trees[method] === void 0) {
32847
32847
  return null;
32848
32848
  }
32849
- let pattern = path9;
32849
+ let pattern = path8;
32850
32850
  let currentNode = this.trees[method];
32851
32851
  let parentNodePathIndex = currentNode.prefix.length;
32852
32852
  const params = [];
@@ -32967,39 +32967,39 @@ var require_find_my_way = __commonJS({
32967
32967
  this._treeGET = null;
32968
32968
  this.routes = [];
32969
32969
  };
32970
- Router.prototype.off = function off(method, path9, constraints) {
32971
- assert(typeof path9 === "string", "Path should be a string");
32972
- assert(path9.length > 0, "The path could not be empty");
32973
- assert(path9[0] === "/" || path9[0] === "*", "The first character of a path should be `/` or `*`");
32970
+ Router.prototype.off = function off(method, path8, constraints) {
32971
+ assert(typeof path8 === "string", "Path should be a string");
32972
+ assert(path8.length > 0, "The path could not be empty");
32973
+ assert(path8[0] === "/" || path8[0] === "*", "The first character of a path should be `/` or `*`");
32974
32974
  assert(
32975
32975
  typeof constraints === "undefined" || typeof constraints === "object" && !Array.isArray(constraints) && constraints !== null,
32976
32976
  "Constraints should be an object or undefined."
32977
32977
  );
32978
- const optionalParamMatch = path9.match(OPTIONAL_PARAM_REGEXP);
32978
+ const optionalParamMatch = path8.match(OPTIONAL_PARAM_REGEXP);
32979
32979
  if (optionalParamMatch) {
32980
- assert(path9.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
32981
- const pathFull = path9.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
32982
- const pathOptional = path9.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/";
32980
+ assert(path8.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path");
32981
+ const pathFull = path8.replace(OPTIONAL_PARAM_REGEXP, "$1$2");
32982
+ const pathOptional = path8.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/";
32983
32983
  this.off(method, pathFull, constraints);
32984
32984
  this.off(method, pathOptional, constraints);
32985
32985
  return;
32986
32986
  }
32987
32987
  if (this.ignoreDuplicateSlashes) {
32988
- path9 = removeDuplicateSlashes(path9);
32988
+ path8 = removeDuplicateSlashes(path8);
32989
32989
  }
32990
32990
  if (this.ignoreTrailingSlash) {
32991
- path9 = trimLastSlash(path9);
32991
+ path8 = trimLastSlash(path8);
32992
32992
  }
32993
32993
  const methods = Array.isArray(method) ? method : [method];
32994
32994
  for (const method2 of methods) {
32995
- this._off(method2, path9, constraints);
32995
+ this._off(method2, path8, constraints);
32996
32996
  }
32997
32997
  };
32998
- Router.prototype._off = function _off(method, path9, constraints) {
32998
+ Router.prototype._off = function _off(method, path8, constraints) {
32999
32999
  assert(typeof method === "string", "Method should be a string");
33000
33000
  assert(httpMethods.includes(method), `Method '${method}' is not an http method.`);
33001
33001
  function matcherWithoutConstraints(route) {
33002
- return method !== route.method || path9 !== route.path;
33002
+ return method !== route.method || path8 !== route.path;
33003
33003
  }
33004
33004
  function matcherWithConstraints(route) {
33005
33005
  return matcherWithoutConstraints(route) || !deepEqual(constraints, route.opts.constraints || {});
@@ -33036,37 +33036,37 @@ var require_find_my_way = __commonJS({
33036
33036
  if (handle === null) return this._defaultRoute(req, res, ctx);
33037
33037
  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);
33038
33038
  };
33039
- Router.prototype.find = function find(method, path9, derivedConstraints) {
33039
+ Router.prototype.find = function find(method, path8, derivedConstraints) {
33040
33040
  let currentNode = method === "GET" ? this._treeGET : this.trees[method];
33041
33041
  if (currentNode == null) return null;
33042
- if (path9.charCodeAt(0) !== 47) {
33043
- path9 = path9.replace(FULL_PATH_REGEXP, "/");
33042
+ if (path8.charCodeAt(0) !== 47) {
33043
+ path8 = path8.replace(FULL_PATH_REGEXP, "/");
33044
33044
  }
33045
33045
  if (this.ignoreDuplicateSlashes) {
33046
- path9 = removeDuplicateSlashes(path9);
33046
+ path8 = removeDuplicateSlashes(path8);
33047
33047
  }
33048
33048
  let sanitizedUrl;
33049
33049
  let querystring2;
33050
33050
  let shouldDecodeParam;
33051
33051
  try {
33052
- sanitizedUrl = path9.length >= MIN_NATIVE_SCAN_LENGTH ? safeDecodeURINativeScan(path9, this.useSemicolonDelimiter) : safeDecodeURICharScan(path9, this.useSemicolonDelimiter, 1);
33053
- path9 = sanitizedUrl.path;
33052
+ sanitizedUrl = path8.length >= MIN_NATIVE_SCAN_LENGTH ? safeDecodeURINativeScan(path8, this.useSemicolonDelimiter) : safeDecodeURICharScan(path8, this.useSemicolonDelimiter, 1);
33053
+ path8 = sanitizedUrl.path;
33054
33054
  querystring2 = sanitizedUrl.querystring;
33055
33055
  shouldDecodeParam = sanitizedUrl.shouldDecodeParam;
33056
33056
  } catch (error) {
33057
- return this._onBadUrl(path9);
33057
+ return this._onBadUrl(path8);
33058
33058
  }
33059
33059
  if (this.ignoreTrailingSlash) {
33060
- path9 = trimLastSlash(path9);
33060
+ path8 = trimLastSlash(path8);
33061
33061
  }
33062
- const originPath = path9;
33062
+ const originPath = path8;
33063
33063
  if (this.caseSensitive === false) {
33064
- path9 = path9.toLowerCase();
33064
+ path8 = path8.toLowerCase();
33065
33065
  }
33066
33066
  const maxParamLength = this.maxParamLength;
33067
33067
  let pathIndex = currentNode.prefix.length;
33068
33068
  const params = [];
33069
- const pathLen = path9.length;
33069
+ const pathLen = path8.length;
33070
33070
  const brothersNodesStack = [];
33071
33071
  let maxParamLengthExceeded = false;
33072
33072
  while (true) {
@@ -33081,7 +33081,7 @@ var require_find_my_way = __commonJS({
33081
33081
  };
33082
33082
  }
33083
33083
  }
33084
- let node = currentNode.getNextNode(path9, pathIndex, brothersNodesStack, params.length);
33084
+ let node = currentNode.getNextNode(path8, pathIndex, brothersNodesStack, params.length);
33085
33085
  if (node === null) {
33086
33086
  if (brothersNodesStack.length === 0) {
33087
33087
  if (maxParamLengthExceeded && this.onMaxParamLength) {
@@ -33182,8 +33182,8 @@ var require_find_my_way = __commonJS({
33182
33182
  Router.prototype._rebuild = function(routes) {
33183
33183
  this.reset();
33184
33184
  for (const route of routes) {
33185
- const { method, path: path9, opts, handler, store } = route;
33186
- this._on(method, path9, opts, handler, store);
33185
+ const { method, path: path8, opts, handler, store } = route;
33186
+ this._on(method, path8, opts, handler, store);
33187
33187
  }
33188
33188
  };
33189
33189
  Router.prototype._defaultRoute = function(req, res, ctx) {
@@ -33194,24 +33194,24 @@ var require_find_my_way = __commonJS({
33194
33194
  res.end();
33195
33195
  }
33196
33196
  };
33197
- Router.prototype._onBadUrl = function(path9) {
33197
+ Router.prototype._onBadUrl = function(path8) {
33198
33198
  if (this.onBadUrl === null) {
33199
33199
  return null;
33200
33200
  }
33201
33201
  const onBadUrl = this.onBadUrl;
33202
33202
  return {
33203
- handler: (req, res, ctx) => onBadUrl(path9, req, res),
33203
+ handler: (req, res, ctx) => onBadUrl(path8, req, res),
33204
33204
  params: {},
33205
33205
  store: null
33206
33206
  };
33207
33207
  };
33208
- Router.prototype._onMaxParamLength = function(path9) {
33208
+ Router.prototype._onMaxParamLength = function(path8) {
33209
33209
  if (this.onMaxParamLength === null) {
33210
33210
  return null;
33211
33211
  }
33212
33212
  const onMaxParamLength = this.onMaxParamLength;
33213
33213
  return {
33214
- handler: (req, res, ctx) => onMaxParamLength(path9, req, res),
33214
+ handler: (req, res, ctx) => onMaxParamLength(path8, req, res),
33215
33215
  params: {},
33216
33216
  store: null
33217
33217
  };
@@ -33243,12 +33243,12 @@ var require_find_my_way = __commonJS({
33243
33243
  if (!httpMethods.hasOwnProperty(i)) continue;
33244
33244
  const m = httpMethods[i];
33245
33245
  const methodName = m.toLowerCase();
33246
- Router.prototype[methodName] = function(path9, handler, store) {
33247
- return this.on(m, path9, handler, store);
33246
+ Router.prototype[methodName] = function(path8, handler, store) {
33247
+ return this.on(m, path8, handler, store);
33248
33248
  };
33249
33249
  }
33250
- Router.prototype.all = function(path9, handler, store) {
33251
- this.on(httpMethods, path9, handler, store);
33250
+ Router.prototype.all = function(path8, handler, store) {
33251
+ this.on(httpMethods, path8, handler, store);
33252
33252
  };
33253
33253
  Router.sanitizeUrlPath = function sanitizeUrlPath(url, useSemicolonDelimiter) {
33254
33254
  const decoded = safeDecodeURI(url, useSemicolonDelimiter);
@@ -33263,14 +33263,14 @@ var require_find_my_way = __commonJS({
33263
33263
  function escapeRegExp(string) {
33264
33264
  return string.replace(ESCAPE_REGEXP, "\\$&");
33265
33265
  }
33266
- function removeDuplicateSlashes(path9) {
33267
- return path9.indexOf("//") !== -1 ? path9.replace(REMOVE_DUPLICATE_SLASHES_REGEXP, "/") : path9;
33266
+ function removeDuplicateSlashes(path8) {
33267
+ return path8.indexOf("//") !== -1 ? path8.replace(REMOVE_DUPLICATE_SLASHES_REGEXP, "/") : path8;
33268
33268
  }
33269
- function trimLastSlash(path9) {
33270
- if (path9.length > 1 && path9.charCodeAt(path9.length - 1) === 47) {
33271
- return path9.slice(0, -1);
33269
+ function trimLastSlash(path8) {
33270
+ if (path8.length > 1 && path8.charCodeAt(path8.length - 1) === 47) {
33271
+ return path8.slice(0, -1);
33272
33272
  }
33273
- return path9;
33273
+ return path8;
33274
33274
  }
33275
33275
  function trimRegExpStartAndEnd(regexString) {
33276
33276
  if (regexString.charCodeAt(1) === 94) {
@@ -33281,22 +33281,22 @@ var require_find_my_way = __commonJS({
33281
33281
  }
33282
33282
  return regexString;
33283
33283
  }
33284
- function getClosingParenthensePosition(path9, idx) {
33284
+ function getClosingParenthensePosition(path8, idx) {
33285
33285
  let parentheses = 1;
33286
- while (idx < path9.length) {
33286
+ while (idx < path8.length) {
33287
33287
  idx++;
33288
- if (path9.charCodeAt(idx) === 92) {
33288
+ if (path8.charCodeAt(idx) === 92) {
33289
33289
  idx++;
33290
33290
  continue;
33291
33291
  }
33292
- if (path9.charCodeAt(idx) === 41) {
33292
+ if (path8.charCodeAt(idx) === 41) {
33293
33293
  parentheses--;
33294
- } else if (path9.charCodeAt(idx) === 40) {
33294
+ } else if (path8.charCodeAt(idx) === 40) {
33295
33295
  parentheses++;
33296
33296
  }
33297
33297
  if (!parentheses) return idx;
33298
33298
  }
33299
- throw new TypeError('Invalid regexp expression in "' + path9 + '"');
33299
+ throw new TypeError('Invalid regexp expression in "' + path8 + '"');
33300
33300
  }
33301
33301
  function defaultBuildPrettyMeta(route) {
33302
33302
  if (!route) return {};
@@ -33529,12 +33529,12 @@ var require_route = __commonJS({
33529
33529
  function route({ options: options2, isFastify }) {
33530
33530
  throwIfAlreadyStarted("Cannot add route!");
33531
33531
  const opts = { ...options2 };
33532
- const path9 = opts.url || opts.path || "";
33532
+ const path8 = opts.url || opts.path || "";
33533
33533
  if (!opts.handler) {
33534
- throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method, path9);
33534
+ throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method, path8);
33535
33535
  }
33536
33536
  if (opts.errorHandler !== void 0 && typeof opts.errorHandler !== "function") {
33537
- throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method, path9);
33537
+ throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method, path8);
33538
33538
  }
33539
33539
  validateBodyLimitOption(opts.bodyLimit);
33540
33540
  validateHandlerTimeoutOption(opts.handlerTimeout);
@@ -33544,22 +33544,22 @@ var require_route = __commonJS({
33544
33544
  if (Array.isArray(opts.method)) {
33545
33545
  for (let i = 0; i < opts.method.length; ++i) {
33546
33546
  opts.method[i] = normalizeAndValidateMethod.call(this, opts.method[i]);
33547
- validateSchemaBodyOption.call(this, opts.method[i], path9, opts.schema);
33547
+ validateSchemaBodyOption.call(this, opts.method[i], path8, opts.schema);
33548
33548
  isGetRoute = opts.method.includes("GET");
33549
33549
  isHeadRoute = opts.method.includes("HEAD");
33550
33550
  }
33551
33551
  } else {
33552
33552
  opts.method = normalizeAndValidateMethod.call(this, opts.method);
33553
- validateSchemaBodyOption.call(this, opts.method, path9, opts.schema);
33553
+ validateSchemaBodyOption.call(this, opts.method, path8, opts.schema);
33554
33554
  isGetRoute = opts.method === "GET";
33555
33555
  isHeadRoute = opts.method === "HEAD";
33556
33556
  }
33557
33557
  const headOpts = shouldExposeHead && isGetRoute ? { ...options2 } : null;
33558
33558
  const prefix = this[kRoutePrefix];
33559
- if (path9 === "/" && prefix.length > 0 && opts.method !== "HEAD") {
33559
+ if (path8 === "/" && prefix.length > 0 && opts.method !== "HEAD") {
33560
33560
  switch (opts.prefixTrailingSlash) {
33561
33561
  case "slash":
33562
- addNewRoute.call(this, { path: path9, isFastify });
33562
+ addNewRoute.call(this, { path: path8, isFastify });
33563
33563
  break;
33564
33564
  case "no-slash":
33565
33565
  addNewRoute.call(this, { path: "", isFastify });
@@ -33568,20 +33568,20 @@ var require_route = __commonJS({
33568
33568
  default:
33569
33569
  addNewRoute.call(this, { path: "", isFastify });
33570
33570
  if (ignoreTrailingSlash !== true && (ignoreDuplicateSlashes !== true || !prefix.endsWith("/"))) {
33571
- addNewRoute.call(this, { path: path9, prefixing: true, isFastify });
33571
+ addNewRoute.call(this, { path: path8, prefixing: true, isFastify });
33572
33572
  }
33573
33573
  }
33574
- } else if (path9[0] === "/" && prefix.endsWith("/")) {
33575
- addNewRoute.call(this, { path: path9.slice(1), isFastify });
33574
+ } else if (path8[0] === "/" && prefix.endsWith("/")) {
33575
+ addNewRoute.call(this, { path: path8.slice(1), isFastify });
33576
33576
  } else {
33577
- addNewRoute.call(this, { path: path9, isFastify });
33577
+ addNewRoute.call(this, { path: path8, isFastify });
33578
33578
  }
33579
33579
  return this;
33580
- function addNewRoute({ path: path10, prefixing = false, isFastify: isFastify2 = false }) {
33581
- const url = prefix + path10;
33580
+ function addNewRoute({ path: path9, prefixing = false, isFastify: isFastify2 = false }) {
33581
+ const url = prefix + path9;
33582
33582
  opts.url = url;
33583
33583
  opts.path = url;
33584
- opts.routePath = path10;
33584
+ opts.routePath = path9;
33585
33585
  opts.prefix = prefix;
33586
33586
  opts.logLevel = opts.logLevel || this[kLogLevel];
33587
33587
  validateLogLevelOption(opts.logLevel, opts.method, opts.url, logger);
@@ -33713,7 +33713,7 @@ var require_route = __commonJS({
33713
33713
  });
33714
33714
  if (shouldExposeHead && isGetRoute && !isHeadRoute && !hasHEADHandler) {
33715
33715
  const onSendHandlers = parseHeadOnSendHandlers(headOpts.onSend);
33716
- prepareRoute.call(this, { method: "HEAD", url: path10, options: { ...headOpts, onSend: onSendHandlers }, isFastify: true });
33716
+ prepareRoute.call(this, { method: "HEAD", url: path9, options: { ...headOpts, onSend: onSendHandlers }, isFastify: true });
33717
33717
  }
33718
33718
  }
33719
33719
  }
@@ -33837,9 +33837,9 @@ var require_route = __commonJS({
33837
33837
  }
33838
33838
  return method;
33839
33839
  }
33840
- function validateSchemaBodyOption(method, path9, schema) {
33840
+ function validateSchemaBodyOption(method, path8, schema) {
33841
33841
  if (this[kSupportedHTTPMethods].bodyless.has(method) && schema?.body) {
33842
- throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method, path9);
33842
+ throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method, path8);
33843
33843
  }
33844
33844
  }
33845
33845
  function validateBodyLimitOption(bodyLimit) {
@@ -33854,11 +33854,11 @@ var require_route = __commonJS({
33854
33854
  throw new FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT(handlerTimeout);
33855
33855
  }
33856
33856
  }
33857
- function validateLogLevelOption(logLevel, method, path9, logger) {
33857
+ function validateLogLevelOption(logLevel, method, path8, logger) {
33858
33858
  if (logLevel == null || logLevel === "") return;
33859
33859
  if (logger?.levels?.values == null) return;
33860
33860
  if (typeof logLevel !== "string" || logger.levels.values[logLevel] === void 0) {
33861
- throw new FST_ERR_ROUTE_LOG_LEVEL_INVALID(method, path9, logLevel);
33861
+ throw new FST_ERR_ROUTE_LOG_LEVEL_INVALID(method, path8, logLevel);
33862
33862
  }
33863
33863
  }
33864
33864
  function runPreParsing(err, request, reply) {
@@ -33947,7 +33947,7 @@ var require_four_oh_four = __commonJS({
33947
33947
  });
33948
33948
  }
33949
33949
  function createRouteEventHandler() {
33950
- return function onRouteEvent(path9, req, res) {
33950
+ return function onRouteEvent(path8, req, res) {
33951
33951
  const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext];
33952
33952
  const id = getGenReqId(fourOhFourContext.server, req);
33953
33953
  const childLogger = createChildLogger(fourOhFourContext, logger, req, id);
@@ -36618,19 +36618,19 @@ var require_fastify = __commonJS({
36618
36618
  }
36619
36619
  fourOhFour.router.lookup(req, res);
36620
36620
  }
36621
- function onBadUrl(path9, req, res) {
36621
+ function onBadUrl(path8, req, res) {
36622
36622
  if (options.frameworkErrors) {
36623
36623
  const id = getGenReqId(routeEventContext.server, req);
36624
36624
  const childLogger = createChildLogger(routeEventContext, options.logger, req, id);
36625
36625
  const request = new Request(id, null, req, null, childLogger, routeEventContext);
36626
36626
  const reply = new Reply(res, request, childLogger);
36627
36627
  routeEventContext.server[kLogController].incomingRequest(request, reply);
36628
- return options.frameworkErrors(new FST_ERR_BAD_URL(path9), request, reply);
36628
+ return options.frameworkErrors(new FST_ERR_BAD_URL(path8), request, reply);
36629
36629
  }
36630
36630
  const body = JSON.stringify({
36631
36631
  error: "Bad Request",
36632
36632
  code: "FST_ERR_BAD_URL",
36633
- message: `'${path9}' is not a valid url component`,
36633
+ message: `'${path8}' is not a valid url component`,
36634
36634
  statusCode: 400
36635
36635
  });
36636
36636
  res.writeHead(400, {
@@ -36639,19 +36639,19 @@ var require_fastify = __commonJS({
36639
36639
  });
36640
36640
  res.end(body);
36641
36641
  }
36642
- function onMaxParamLength(path9, req, res) {
36642
+ function onMaxParamLength(path8, req, res) {
36643
36643
  if (options.frameworkErrors) {
36644
36644
  const id = getGenReqId(routeEventContext.server, req);
36645
36645
  const childLogger = createChildLogger(routeEventContext, options.logger, req, id);
36646
36646
  const request = new Request(id, null, req, null, childLogger, routeEventContext);
36647
36647
  const reply = new Reply(res, request, childLogger);
36648
36648
  routeEventContext.server[kLogController].incomingRequest(request, reply);
36649
- return options.frameworkErrors(new FST_ERR_MAX_PARAM_LENGTH(path9), request, reply);
36649
+ return options.frameworkErrors(new FST_ERR_MAX_PARAM_LENGTH(path8), request, reply);
36650
36650
  }
36651
36651
  const body = JSON.stringify({
36652
36652
  error: "Bad Request",
36653
36653
  code: "FST_ERR_MAX_PARAM_LENGTH",
36654
- message: `'${path9}' is exceeding the max param length`,
36654
+ message: `'${path8}' is exceeding the max param length`,
36655
36655
  statusCode: 414
36656
36656
  });
36657
36657
  res.writeHead(414, {
@@ -41001,8 +41001,8 @@ var import_cors = __toESM(require_cors(), 1);
41001
41001
  // src/db/index.ts
41002
41002
  import Database from "better-sqlite3";
41003
41003
  var db;
41004
- function initDb(path9 = "data.db") {
41005
- db = new Database(path9);
41004
+ function initDb(path8 = "data.db") {
41005
+ db = new Database(path8);
41006
41006
  db.pragma("journal_mode = WAL");
41007
41007
  db.pragma("foreign_keys = ON");
41008
41008
  createTables(db);
@@ -42248,11 +42248,11 @@ async function registerWorkspaceRoutes(fastify) {
42248
42248
  }
42249
42249
  }
42250
42250
  }, async (request, reply) => {
42251
- const { path: path9, label = null } = request.body || {};
42252
- if (!path9 || !path9.trim()) {
42251
+ const { path: path8, label = null } = request.body || {};
42252
+ if (!path8 || !path8.trim()) {
42253
42253
  return reply.code(400).send({ error: "Path is required" });
42254
42254
  }
42255
- const trimmedPath = path9.trim();
42255
+ const trimmedPath = path8.trim();
42256
42256
  const db2 = getDb();
42257
42257
  const existing = db2.prepare("SELECT * FROM workspaces WHERE path = ?").get(trimmedPath);
42258
42258
  if (existing) {
@@ -42280,8 +42280,8 @@ async function registerWorkspaceRoutes(fastify) {
42280
42280
  "-e",
42281
42281
  'POSIX path of (choose folder with prompt "Select a workspace directory")'
42282
42282
  ]);
42283
- const path9 = stdout.trim().replace(/\/$/, "");
42284
- return { path: path9 };
42283
+ const path8 = stdout.trim().replace(/\/$/, "");
42284
+ return { path: path8 };
42285
42285
  } catch {
42286
42286
  return reply.code(204).send({ cancelled: true });
42287
42287
  }
@@ -42297,11 +42297,11 @@ async function registerWorkspaceRoutes(fastify) {
42297
42297
  }
42298
42298
  }
42299
42299
  }, async (request, reply) => {
42300
- const { path: path9 } = request.body || {};
42301
- if (!path9 || !path9.trim()) {
42300
+ const { path: path8 } = request.body || {};
42301
+ if (!path8 || !path8.trim()) {
42302
42302
  return reply.code(400).send({ error: "Path is required" });
42303
42303
  }
42304
- const trimmedPath = path9.trim();
42304
+ const trimmedPath = path8.trim();
42305
42305
  const db2 = getDb();
42306
42306
  const existing = db2.prepare("SELECT * FROM workspaces WHERE path = ?").get(trimmedPath);
42307
42307
  if (existing) {
@@ -42948,17 +42948,17 @@ async function registerPerfLogRoutes(fastify) {
42948
42948
  if (entries.length === 0) {
42949
42949
  return reply.send({ written: 0 });
42950
42950
  }
42951
- const path9 = perfLogPath();
42951
+ const path8 = perfLogPath();
42952
42952
  try {
42953
- mkdirSync(dirname(path9), { recursive: true });
42953
+ mkdirSync(dirname(path8), { recursive: true });
42954
42954
  try {
42955
- if (statSync(path9).size > MAX_BYTES) {
42956
- renameSync(path9, `${path9}.1`);
42955
+ if (statSync(path8).size > MAX_BYTES) {
42956
+ renameSync(path8, `${path8}.1`);
42957
42957
  }
42958
42958
  } catch {
42959
42959
  }
42960
42960
  const lines = entries.map((e) => `${new Date(e.t).toISOString()} [${oneLine(e.cat)}] ${oneLine(e.msg)}`).join("\n");
42961
- appendFileSync(path9, `${lines}
42961
+ appendFileSync(path8, `${lines}
42962
42962
  `, "utf-8");
42963
42963
  return reply.send({ written: entries.length });
42964
42964
  } catch (err) {
@@ -43522,7 +43522,7 @@ function proxyHandler(request, reply) {
43522
43522
 
43523
43523
  // src/routes/apps.ts
43524
43524
  import fs4 from "node:fs";
43525
- import path6 from "node:path";
43525
+ import path5 from "node:path";
43526
43526
 
43527
43527
  // src/apps/instances.ts
43528
43528
  import fs2 from "node:fs";
@@ -43573,20 +43573,15 @@ Each subdirectory of this folder is one mini app:
43573
43573
  manifest.json - { "title": string, "description"?: string, "icon"?: string,
43574
43574
  "tools"?: [{ "name", "description", "inputSchema" }] }
43575
43575
  index.html - markup only (full HTML document); do NOT reference app.js
43576
- app.ts - ENTRY logic file (TypeScript, PREFERRED); compiled
43577
- together with any sibling .ts modules it imports
43578
- and injected into the page as ONE compiled script
43579
- *.ts - additional modules (flat folder, same directory as
43580
- app.ts); import them from app.ts with relative names
43581
- only ('./util' or './util.ts'); bare package imports
43582
- are NOT supported \u2014 everything must be local
43576
+ app.ts - app logic (TypeScript, PREFERRED); injected automatically
43577
+ into the page as compiled JS
43583
43578
  app.js - legacy plain-JS logic; used only when app.ts is absent
43584
43579
 
43585
- The pane compiles app.ts and its imported modules on every change (strict
43586
- mode, lib dom). Compile and type errors are shown in the app tab \u2014 check
43587
- them after every edit and fix them before finishing. window.AgentPane is
43588
- typed via ambient declarations (getState/setState/createSession/
43589
- submitTurn/onToolCall/...); no import needed.
43580
+ The pane compiles app.ts on every change (strict mode, lib dom). Compile and
43581
+ type errors are shown in the app tab \u2014 check them after every edit and fix
43582
+ them before finishing. window.AgentPane is typed via ambient declarations
43583
+ (getState/setState/createSession/submitTurn/onToolCall/...); no import
43584
+ needed.
43590
43585
 
43591
43586
  App state does NOT live in this folder \u2014 it is stored in the pane database
43592
43587
  (app_instances table) and reached with getState()/setState().
@@ -43599,6 +43594,7 @@ App state does NOT live in this folder \u2014 it is stored in the pane database
43599
43594
  - submitTurn(sessionId, prompt) - send a prompt to a session
43600
43595
  - onTurnCompleted(callback) - callback(event, { turnId, response }) when a turn ends
43601
43596
  - onToolCall(callback) - callback({ callId, name, tool, args }) when the AGENT calls one of the manifest tools (name and tool carry the same tool name); answer with resolveToolCall(callId, result)
43597
+ one of the manifest tools; answer with resolveToolCall(callId, result)
43602
43598
 
43603
43599
  ## Agent tool calls (manifest "tools")
43604
43600
 
@@ -43753,7 +43749,6 @@ import vm2 from "node:vm";
43753
43749
 
43754
43750
  // src/apps/app-compile.ts
43755
43751
  import vm from "node:vm";
43756
- import path5 from "node:path";
43757
43752
  import ts from "typescript";
43758
43753
  var APP_TS = "app.ts";
43759
43754
  var BRIDGE_DTS_FILE = "agentpane.d.ts";
@@ -43795,128 +43790,30 @@ function tsDiagnosticToFile(file, d) {
43795
43790
  message: ts.flattenDiagnosticMessageText(d.messageText, "\n")
43796
43791
  };
43797
43792
  }
43798
- var MODULE_LIMIT = 50;
43799
- function resolveModuleName(spec) {
43800
- if (!spec.startsWith("./")) return null;
43801
- const base = spec.slice(2).replace(/\.(ts|js)$/, "");
43802
- const file = `${base}.ts`;
43803
- if (!/^[A-Za-z0-9][A-Za-z0-9._-]*\.ts$/.test(file)) return null;
43804
- return file;
43805
- }
43806
- function importRefs(sf) {
43807
- const refs = [];
43808
- const push = (expr) => {
43809
- if (!ts.isStringLiteral(expr)) return;
43810
- const pos = sf.getLineAndCharacterOfPosition(expr.getStart(sf));
43811
- refs.push({ name: expr.text, file: sf.fileName, line: pos.line + 1, column: pos.character + 1 });
43812
- };
43813
- const visit = (node) => {
43814
- if (ts.isImportDeclaration(node) && node.moduleSpecifier) push(node.moduleSpecifier);
43815
- else if (ts.isExportDeclaration(node) && node.moduleSpecifier) push(node.moduleSpecifier);
43816
- else if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword && node.arguments[0])
43817
- push(node.arguments[0]);
43818
- else ts.forEachChild(node, visit);
43819
- };
43820
- ts.forEachChild(sf, visit);
43821
- return refs;
43822
- }
43823
- function buildModuleGraph(appId) {
43824
- const modules = [{ file: APP_TS, source: readAppFile(appId, APP_TS) }];
43825
- const seen = /* @__PURE__ */ new Set([APP_TS]);
43826
- const blocking = [];
43827
- for (let i = 0; i < modules.length; i++) {
43828
- const mod = modules[i];
43829
- const sf = ts.createSourceFile(mod.file, mod.source, ts.ScriptTarget.ES2020, true);
43830
- for (const ref of importRefs(sf)) {
43831
- const target = resolveModuleName(ref.name);
43832
- const at = { severity: "error", file: ref.file, line: ref.line, column: ref.column };
43833
- if (!target) {
43834
- blocking.push({
43835
- ...at,
43836
- message: `Unsupported import '${ref.name}' \u2014 mini app modules must be sibling .ts files imported as './name'.`
43837
- });
43838
- continue;
43839
- }
43840
- if (seen.has(target)) continue;
43841
- seen.add(target);
43842
- const source = readAppFile(appId, target);
43843
- if (!source.trim()) {
43844
- blocking.push({
43845
- ...at,
43846
- message: `Cannot find module '${ref.name}' \u2014 add a file named '${target}' next to app.ts.`
43847
- });
43848
- continue;
43849
- }
43850
- if (modules.length >= MODULE_LIMIT) {
43851
- blocking.push({ ...at, message: `Mini app bundles at most ${MODULE_LIMIT} modules.` });
43852
- continue;
43853
- }
43854
- modules.push({ file: target, source });
43855
- }
43856
- }
43857
- return { modules, blocking };
43858
- }
43859
- var LOADER_JS = `
43860
- var __cache = {};
43861
- var __resolve = ${resolveModuleName};
43862
- function __load(file) {
43863
- var cached = __cache[file];
43864
- if (cached) return cached.exports;
43865
- var mod = __modules[file];
43866
- if (!mod) throw new Error('Module not found: ' + file);
43867
- var module = { exports: {} };
43868
- __cache[file] = module;
43869
- mod.call(module.exports, module.exports, function (spec) {
43870
- var target = __resolve(spec);
43871
- if (!target) throw new Error("Unsupported import '" + spec + "' in " + file);
43872
- return __load(target);
43873
- }, module);
43874
- return module.exports;
43875
- }
43876
- __load(${JSON.stringify(APP_TS)});
43877
- `;
43878
- function emitBundle(modules) {
43879
- const defs = modules.map((m) => `${JSON.stringify(m.file)}: function (exports, require, module) {
43880
- ${m.js}
43881
- }`).join(",\n");
43882
- return `(function () {
43883
- var __modules = {
43884
- ${defs}
43885
- };
43886
- ${LOADER_JS}})();
43887
- `;
43888
- }
43889
- function typeCheckModules(appId, modules) {
43890
- const dir = appDir(appId);
43793
+ function typeCheckAppTs(source) {
43891
43794
  const options = {
43892
43795
  noEmit: true,
43893
43796
  target: ts.ScriptTarget.ES2020,
43894
- module: ts.ModuleKind.ESNext,
43895
- moduleResolution: ts.ModuleResolutionKind.Bundler,
43896
- allowImportingTsExtensions: true,
43797
+ module: ts.ModuleKind.None,
43897
43798
  lib: ["lib.es2020.d.ts", "lib.dom.d.ts"],
43898
43799
  strict: true,
43899
- skipLibCheck: true,
43900
- types: []
43901
- // hermetic — no ambient @types discovery from the host
43800
+ skipLibCheck: true
43902
43801
  };
43903
43802
  const host = ts.createCompilerHost(options);
43904
43803
  const origReadFile = host.readFile.bind(host);
43905
- host.readFile = (fname) => path5.basename(fname) === BRIDGE_DTS_FILE ? BRIDGE_DTS : origReadFile(fname);
43804
+ const origFileExists = host.fileExists.bind(host);
43805
+ host.readFile = (fname) => {
43806
+ if (fname === APP_TS) return source;
43807
+ if (fname === BRIDGE_DTS_FILE) return BRIDGE_DTS;
43808
+ return origReadFile(fname);
43809
+ };
43810
+ host.fileExists = (fname) => fname === APP_TS || fname === BRIDGE_DTS_FILE ? true : origFileExists(fname);
43906
43811
  host.writeFile = () => {
43907
43812
  };
43908
- const bridgePath = path5.join(dir, BRIDGE_DTS_FILE);
43909
- const rootNames = [...modules.map((m) => path5.join(dir, m.file)), bridgePath];
43910
- const program = ts.createProgram(rootNames, options, host);
43911
- const out = [];
43912
- for (const mod of modules) {
43913
- const sf = program.getSourceFile(path5.join(dir, mod.file));
43914
- if (!sf) continue;
43915
- out.push(
43916
- ...[...program.getSyntacticDiagnostics(sf), ...program.getSemanticDiagnostics(sf)].map((d) => tsDiagnosticToFile(mod.file, d)).filter((d) => d !== null)
43917
- );
43918
- }
43919
- return out;
43813
+ const program = ts.createProgram([APP_TS, BRIDGE_DTS_FILE], options, host);
43814
+ const appFile = program.getSourceFile(APP_TS);
43815
+ if (!appFile) return [];
43816
+ return [...program.getSyntacticDiagnostics(appFile), ...program.getSemanticDiagnostics(appFile)].map((d) => tsDiagnosticToFile(APP_TS, d)).filter((d) => d !== null);
43920
43817
  }
43921
43818
  function checkJsSyntax(js) {
43922
43819
  try {
@@ -43942,26 +43839,17 @@ function compileAppJs(appId) {
43942
43839
  const tsSource = readAppFile(appId, APP_TS);
43943
43840
  let result;
43944
43841
  if (tsSource.trim()) {
43945
- const { modules, blocking: graphDiags } = buildModuleGraph(appId);
43946
- const transpiled = [];
43947
- const syntaxDiags = [];
43948
- for (const mod of modules) {
43949
- const out = ts.transpileModule(mod.source, {
43950
- compilerOptions: { target: ts.ScriptTarget.ES2020, module: ts.ModuleKind.CommonJS },
43951
- reportDiagnostics: true,
43952
- fileName: mod.file
43953
- });
43954
- for (const d of out.diagnostics ?? []) {
43955
- const diag = tsDiagnosticToFile(mod.file, d);
43956
- if (diag) syntaxDiags.push(diag);
43957
- }
43958
- transpiled.push({ file: mod.file, js: out.outputText });
43959
- }
43960
- const blocked = graphDiags.length > 0 || syntaxDiags.some((d) => d.severity === "error");
43961
- result = blocked ? { js: "", sourceFile: "app.ts", diagnostics: [...graphDiags, ...syntaxDiags] } : {
43962
- js: emitBundle(transpiled),
43842
+ const transpiled = ts.transpileModule(tsSource, {
43843
+ compilerOptions: { target: ts.ScriptTarget.ES2020, module: ts.ModuleKind.None },
43844
+ reportDiagnostics: true,
43845
+ fileName: APP_TS
43846
+ });
43847
+ const syntaxDiags = (transpiled.diagnostics ?? []).map((d) => tsDiagnosticToFile(APP_TS, d)).filter((d) => d !== null);
43848
+ const blocked = syntaxDiags.some((d) => d.severity === "error");
43849
+ result = {
43850
+ js: blocked ? "" : transpiled.outputText,
43963
43851
  sourceFile: "app.ts",
43964
- diagnostics: [...graphDiags, ...syntaxDiags, ...typeCheckModules(appId, modules)]
43852
+ diagnostics: blocked ? syntaxDiags : [...syntaxDiags, ...typeCheckAppTs(tsSource)]
43965
43853
  };
43966
43854
  } else {
43967
43855
  const js = readAppFile(appId, "app.js");
@@ -44271,7 +44159,7 @@ async function registerAppRoutes(fastify, opts) {
44271
44159
  try {
44272
44160
  for (const entry of fs4.readdirSync(exRoot, { withFileTypes: true })) {
44273
44161
  if (!entry.isDirectory() || !APP_ID_RE.test(entry.name)) continue;
44274
- const manifest = readManifestIn(path6.join(exRoot, entry.name));
44162
+ const manifest = readManifestIn(path5.join(exRoot, entry.name));
44275
44163
  if (!manifest) continue;
44276
44164
  out.push({
44277
44165
  id: entry.name,
@@ -44292,7 +44180,7 @@ async function registerAppRoutes(fastify, opts) {
44292
44180
  if (!APP_ID_RE.test(id)) return reply.code(400).send({ error: "Invalid app id" });
44293
44181
  const exRoot = examplesRoot();
44294
44182
  if (!exRoot) return reply.code(404).send({ error: "Examples catalog not available" });
44295
- const src = path6.join(exRoot, id);
44183
+ const src = path5.join(exRoot, id);
44296
44184
  if (!readManifestIn(src)) return reply.code(404).send({ error: "Example not found" });
44297
44185
  if (readManifest(id)) return reply.code(409).send({ error: "App already installed" });
44298
44186
  ensureAppsRoot();
@@ -44325,7 +44213,7 @@ async function registerAppRoutes(fastify, opts) {
44325
44213
  fs4.mkdirSync(dir, { recursive: true });
44326
44214
  const cleanTitle2 = title.trim();
44327
44215
  fs4.writeFileSync(
44328
- path6.join(dir, "manifest.json"),
44216
+ path5.join(dir, "manifest.json"),
44329
44217
  JSON.stringify(
44330
44218
  {
44331
44219
  title: cleanTitle2,
@@ -44336,8 +44224,8 @@ async function registerAppRoutes(fastify, opts) {
44336
44224
  2
44337
44225
  )
44338
44226
  );
44339
- fs4.writeFileSync(path6.join(dir, "index.html"), SKELETON_HTML.replaceAll("__TITLE__", cleanTitle2));
44340
- fs4.writeFileSync(path6.join(dir, "app.ts"), SKELETON_TS);
44227
+ fs4.writeFileSync(path5.join(dir, "index.html"), SKELETON_HTML.replaceAll("__TITLE__", cleanTitle2));
44228
+ fs4.writeFileSync(path5.join(dir, "app.ts"), SKELETON_TS);
44341
44229
  return { ok: true, id };
44342
44230
  }
44343
44231
  );
@@ -44374,9 +44262,9 @@ async function registerAppRoutes(fastify, opts) {
44374
44262
  const dir = appDir(id);
44375
44263
  fs4.mkdirSync(dir, { recursive: true });
44376
44264
  if (!Object.hasOwn(files ?? {}, "manifest.json")) {
44377
- fs4.writeFileSync(path6.join(dir, "manifest.json"), JSON.stringify({ title: id }, null, 2));
44265
+ fs4.writeFileSync(path5.join(dir, "manifest.json"), JSON.stringify({ title: id }, null, 2));
44378
44266
  }
44379
- for (const [name, content] of entries) fs4.writeFileSync(path6.join(dir, name), content);
44267
+ for (const [name, content] of entries) fs4.writeFileSync(path5.join(dir, name), content);
44380
44268
  return { ok: true, id };
44381
44269
  }
44382
44270
  );
@@ -44604,18 +44492,18 @@ function mapTokenUsage(data) {
44604
44492
 
44605
44493
  // src/apps/register-mcp.ts
44606
44494
  import fs5 from "node:fs";
44607
- import path7 from "node:path";
44495
+ import path6 from "node:path";
44608
44496
  import { fileURLToPath as fileURLToPath2 } from "node:url";
44609
44497
  var MCP_SERVER_NAME = "agentpane-miniapps";
44610
44498
  function panePublicUrl() {
44611
44499
  return (process.env.AGENT_PANE_PUBLIC_URL || process.env.REPOBURG_DAEMON_URL || "http://localhost:9998").replace(/\/+$/, "");
44612
44500
  }
44613
44501
  function stdioScriptPath() {
44614
- const here = path7.dirname(fileURLToPath2(import.meta.url));
44502
+ const here = path6.dirname(fileURLToPath2(import.meta.url));
44615
44503
  const candidates = [
44616
- path7.resolve(here, "../../scripts/miniapp-mcp-stdio.mjs"),
44504
+ path6.resolve(here, "../../scripts/miniapp-mcp-stdio.mjs"),
44617
44505
  // src/apps/ → backend/scripts
44618
- path7.resolve(here, "../scripts/miniapp-mcp-stdio.mjs")
44506
+ path6.resolve(here, "../scripts/miniapp-mcp-stdio.mjs")
44619
44507
  // dist bundle → backend/scripts
44620
44508
  ];
44621
44509
  for (const candidate of candidates) {
@@ -45340,9 +45228,9 @@ function mapToolUse(block) {
45340
45228
  };
45341
45229
  }
45342
45230
  function deriveFileChangeData(input, toolName) {
45343
- const path9 = input.file_path ?? input.notebook_path ?? "";
45231
+ const path8 = input.file_path ?? input.notebook_path ?? "";
45344
45232
  const kind = toolName === "Write" ? "add" : "modify";
45345
- return { changes: [{ path: path9, kind }], status: "in_progress" };
45233
+ return { changes: [{ path: path8, kind }], status: "in_progress" };
45346
45234
  }
45347
45235
  function extractToolResultText(content) {
45348
45236
  if (!content) return "";
@@ -46373,8 +46261,8 @@ var RepoburgHttpClient = class {
46373
46261
  this.baseUrl = baseUrl.replace(/\/+$/, "");
46374
46262
  }
46375
46263
  /** Perform a JSON request. Throws a concise error on non-OK/non-JSON responses. */
46376
- async request(method, path9, body) {
46377
- const response = await fetch(`${this.baseUrl}${path9}`, {
46264
+ async request(method, path8, body) {
46265
+ const response = await fetch(`${this.baseUrl}${path8}`, {
46378
46266
  method,
46379
46267
  headers: { "Content-Type": "application/json" },
46380
46268
  body: body === void 0 ? void 0 : JSON.stringify(body)
@@ -46383,17 +46271,17 @@ var RepoburgHttpClient = class {
46383
46271
  if (!response.ok) {
46384
46272
  if (isHtml(text)) {
46385
46273
  throw new Error(
46386
- `${method} ${path9} failed: ${response.status} HTML response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46274
+ `${method} ${path8} failed: ${response.status} HTML response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46387
46275
  );
46388
46276
  }
46389
- throw new Error(`${method} ${path9} failed: ${response.status} ${text}`);
46277
+ throw new Error(`${method} ${path8} failed: ${response.status} ${text}`);
46390
46278
  }
46391
46279
  if (text.length === 0) return void 0;
46392
46280
  try {
46393
46281
  return JSON.parse(text);
46394
46282
  } catch {
46395
46283
  throw new Error(
46396
- `${method} ${path9} failed: non-JSON response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46284
+ `${method} ${path8} failed: non-JSON response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46397
46285
  );
46398
46286
  }
46399
46287
  }
@@ -46448,7 +46336,7 @@ var RepoburgHttpClient = class {
46448
46336
  };
46449
46337
 
46450
46338
  // src/repoburg/backend-resolver.ts
46451
- import path8 from "node:path";
46339
+ import path7 from "node:path";
46452
46340
  var HEALTH_POLL_INTERVAL_MS = 1e3;
46453
46341
  var HEALTH_TIMEOUT_MS = 3e4;
46454
46342
  function daemonBaseUrl() {
@@ -46503,7 +46391,7 @@ async function backendHealthy(baseUrl, expectedPath) {
46503
46391
  const health = await fetchJson(`${baseUrl}/health`, void 0, 2e3);
46504
46392
  if (health.status !== "ok") return false;
46505
46393
  if (expectedPath && health.projectPath) {
46506
- return path8.resolve(health.projectPath) === path8.resolve(expectedPath);
46394
+ return path7.resolve(health.projectPath) === path7.resolve(expectedPath);
46507
46395
  }
46508
46396
  return true;
46509
46397
  } catch {
@@ -46524,7 +46412,7 @@ function serviceBaseUrl(service) {
46524
46412
  return `http://localhost:${service.port}`;
46525
46413
  }
46526
46414
  function coveringService(services, absPath) {
46527
- return services.filter((s) => absPath === s.path || absPath.startsWith(s.path + path8.sep)).sort((a, b) => b.path.length - a.path.length)[0];
46415
+ return services.filter((s) => absPath === s.path || absPath.startsWith(s.path + path7.sep)).sort((a, b) => b.path.length - a.path.length)[0];
46528
46416
  }
46529
46417
  async function restartService(daemon, name) {
46530
46418
  try {
@@ -46560,7 +46448,7 @@ async function resolveBackendUrl(projectPath, opts = {}) {
46560
46448
  if (envUrl) {
46561
46449
  return { baseUrl: envUrl.replace(/\/+$/, ""), port: 0, name: "REPOBURG_BACKEND_URL" };
46562
46450
  }
46563
- const absPath = path8.resolve(projectPath);
46451
+ const absPath = path7.resolve(projectPath);
46564
46452
  const daemon = daemonBaseUrl();
46565
46453
  const cached = resolvedCache.get(absPath);
46566
46454
  if (cached && await backendHealthy(cached.baseUrl, cached.servesPath ?? absPath)) {