repoburg 1.3.243 → 1.3.245

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 (33) hide show
  1. package/agent-pane/backend/dist/index.js +368 -256
  2. package/agent-pane/backend/dist/server.js +368 -256
  3. package/agent-pane/frontend/dist/assets/{index-KcwodzRz.js → index-CBTsbWig.js} +42 -42
  4. package/agent-pane/frontend/dist/assets/{index-DUnfaPeK.css → index-DNe6bagG.css} +1 -1
  5. package/agent-pane/frontend/dist/index.html +2 -2
  6. package/backend/.env +1 -0
  7. package/backend/section-modified.txt +1 -0
  8. package/daemon/dist/index.js +0 -0
  9. package/deleted.txt +1 -0
  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/modified.txt +1 -0
  17. package/package.json +1 -1
  18. package/test-modified.txt +1 -0
  19. package/visual-editor-proxy/client/dist/main.js +89 -0
  20. package/visual-editor-proxy/dist/client/src/inspector.d.ts +9 -0
  21. package/visual-editor-proxy/dist/client/src/inspector.js +96 -0
  22. package/visual-editor-proxy/dist/client/src/inspector.js.map +1 -0
  23. package/visual-editor-proxy/dist/client/src/main.d.ts +6 -0
  24. package/visual-editor-proxy/dist/client/src/main.js +108 -0
  25. package/visual-editor-proxy/dist/client/src/main.js.map +1 -0
  26. package/visual-editor-proxy/dist/client/src/ui.d.ts +6 -0
  27. package/visual-editor-proxy/dist/client/src/ui.js +153 -0
  28. package/visual-editor-proxy/dist/client/src/ui.js.map +1 -0
  29. package/visual-editor-proxy/dist/src/main.d.ts +1 -0
  30. package/visual-editor-proxy/dist/src/main.js +61 -0
  31. package/visual-editor-proxy/dist/src/main.js.map +1 -0
  32. package/visual-editor-proxy/dist/tsconfig.tsbuildinfo +1 -0
  33. 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 path8 = req.path;
6128
- _req.url = typeof path8 === "string" ? path8 : req.url ? req.url.path || req.url : void 0;
6127
+ const path9 = req.path;
6128
+ _req.url = typeof path9 === "string" ? path9 : 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(path8) {
6293
+ function parsePath(path9) {
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 < path8.length; i++) {
6300
- const char = path8[i];
6299
+ for (let i = 0; i < path9.length; i++) {
6300
+ const char = path9[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 path8 of paths) {
6432
- const parts = parsePath(path8);
6431
+ for (const path9 of paths) {
6432
+ const parts = parsePath(path9);
6433
6433
  if (parts.includes("*")) {
6434
- redactWildcardPath(obj, parts, censor, path8, remove);
6434
+ redactWildcardPath(obj, parts, censor, path9, 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, path8) => {
6520
- const fullPath = [...pathArray.slice(0, pathLength), ...path8];
6519
+ const wrappedCensor = typeof censor === "function" ? (value, path9) => {
6520
+ const fullPath = [...pathArray.slice(0, pathLength), ...path9];
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 path8 of pathsToClone) {
6556
- const parts = parsePath(path8);
6555
+ for (const path9 of pathsToClone) {
6556
+ const parts = parsePath(path9);
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(path8) {
6609
- if (typeof path8 !== "string") {
6608
+ function validatePath(path9) {
6609
+ if (typeof path9 !== "string") {
6610
6610
  throw new Error("Paths must be (non-empty) strings");
6611
6611
  }
6612
- if (path8 === "") {
6612
+ if (path9 === "") {
6613
6613
  throw new Error("Invalid redaction path ()");
6614
6614
  }
6615
- if (path8.includes("..")) {
6616
- throw new Error(`Invalid redaction path (${path8})`);
6615
+ if (path9.includes("..")) {
6616
+ throw new Error(`Invalid redaction path (${path9})`);
6617
6617
  }
6618
- if (path8.includes(",")) {
6619
- throw new Error(`Invalid redaction path (${path8})`);
6618
+ if (path9.includes(",")) {
6619
+ throw new Error(`Invalid redaction path (${path9})`);
6620
6620
  }
6621
6621
  let bracketCount = 0;
6622
6622
  let inQuotes = false;
6623
6623
  let quoteChar = "";
6624
- for (let i = 0; i < path8.length; i++) {
6625
- const char = path8[i];
6624
+ for (let i = 0; i < path9.length; i++) {
6625
+ const char = path9[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 (${path8})`);
6639
+ throw new Error(`Invalid redaction path (${path9})`);
6640
6640
  }
6641
6641
  }
6642
6642
  }
6643
6643
  if (bracketCount !== 0) {
6644
- throw new Error(`Invalid redaction path (${path8})`);
6644
+ throw new Error(`Invalid redaction path (${path9})`);
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 path8 of paths) {
6652
- validatePath(path8);
6651
+ for (const path9 of paths) {
6652
+ validatePath(path9);
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, path8) => {
6821
- return censor(value, [k, ...path8]);
6820
+ const wrappedCensor = typeof censor === "function" ? (value, path9) => {
6821
+ return censor(value, [k, ...path9]);
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 path8 = __require("path");
7042
+ var path9 = __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(path8.dirname(file), { recursive: true });
7096
+ if (sonic.mkdir) fs6.mkdirSync(path9.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(path8.dirname(file), { recursive: true }, (err) => {
7104
+ fs6.mkdir(path9.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 path8 = unquoted;
8437
- if (path8.startsWith("file://")) {
8436
+ let path9 = unquoted;
8437
+ if (path9.startsWith("file://")) {
8438
8438
  try {
8439
- path8 = fileURLToPath3(path8);
8439
+ path9 = fileURLToPath3(path9);
8440
8440
  } catch {
8441
8441
  return false;
8442
8442
  }
8443
8443
  }
8444
- return isAbsolute(path8) && !existsSync2(path8);
8444
+ return isAbsolute(path9) && !existsSync2(path9);
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(path8) {
17121
- let input = path8;
17120
+ function removeDotSegments(path9) {
17121
+ let input = path9;
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 [path8, query2] = wsComponent.resourceName.split("?");
17374
- wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
17373
+ const [path9, query2] = wsComponent.resourceName.split("?");
17374
+ wsComponent.path = path9 && path9 !== "/" ? path9 : 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(path8) {
22312
- let input = path8;
22311
+ function removeDotSegments(path9) {
22312
+ let input = path9;
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 [path8, query2] = wsComponent.resourceName.split("?");
22658
- wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
22657
+ const [path9, query2] = wsComponent.resourceName.split("?");
22658
+ wsComponent.path = path9 && path9 !== "/" ? path9 : 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(path8) {
24143
- let input = path8;
24142
+ function removeDotSegments(path9) {
24143
+ let input = path9;
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 [path8, query2] = wsComponent.resourceName.split("?");
24489
- wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
24488
+ const [path9, query2] = wsComponent.resourceName.split("?");
24489
+ wsComponent.path = path9 && path9 !== "/" ? path9 : 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(path8, pathIndex) {
32007
- const charCode = path8.charCodeAt(pathIndex);
32006
+ findStaticMatchingChild(path9, pathIndex) {
32007
+ const charCode = path9.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(path8, pathIndex)) {
32012
+ if (staticChild.matchPrefix(path9, 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(path8, pathIndex = 0) {
32021
- if (path8.length === pathIndex) {
32020
+ getStaticChild(path9, pathIndex = 0) {
32021
+ if (path9.length === pathIndex) {
32022
32022
  return this;
32023
32023
  }
32024
- const staticChild = this.findStaticMatchingChild(path8, pathIndex);
32024
+ const staticChild = this.findStaticMatchingChild(path9, pathIndex);
32025
32025
  if (staticChild) {
32026
- return staticChild.getStaticChild(path8, pathIndex + staticChild.prefix.length);
32026
+ return staticChild.getStaticChild(path9, pathIndex + staticChild.prefix.length);
32027
32027
  }
32028
32028
  return null;
32029
32029
  }
32030
- createStaticChild(path8) {
32031
- if (path8.length === 0) {
32030
+ createStaticChild(path9) {
32031
+ if (path9.length === 0) {
32032
32032
  return this;
32033
32033
  }
32034
- const childIndex = this.staticChildrenCharCodes.indexOf(path8.charCodeAt(0));
32034
+ const childIndex = this.staticChildrenCharCodes.indexOf(path9.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 (path8.charCodeAt(i) !== staticChild.prefix.charCodeAt(i)) {
32039
+ if (path9.charCodeAt(i) !== staticChild.prefix.charCodeAt(i)) {
32040
32040
  staticChild = staticChild.split(this, i);
32041
32041
  break;
32042
32042
  }
32043
32043
  }
32044
- return staticChild.createStaticChild(path8.slice(i));
32044
+ return staticChild.createStaticChild(path9.slice(i));
32045
32045
  }
32046
- const node = new StaticNode(path8);
32047
- this.setStaticChild(path8.charAt(0), node);
32046
+ const node = new StaticNode(path9);
32047
+ this.setStaticChild(path9.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(path8, pathIndex, nodeStack, paramsCount) {
32108
- let node = this.findStaticMatchingChild(path8, pathIndex);
32107
+ getNextNode(path9, pathIndex, nodeStack, paramsCount) {
32108
+ let node = this.findStaticMatchingChild(path9, 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(path8, pathIndex) {
32156
- return this.findStaticMatchingChild(path8, pathIndex);
32155
+ getNextNode(path9, pathIndex) {
32156
+ return this.findStaticMatchingChild(path9, 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(path8, useSemicolonDelimiter) {
32513
- if (path8.length >= MIN_NATIVE_SCAN_LENGTH) {
32514
- return safeDecodeURINativeScan(path8, useSemicolonDelimiter);
32512
+ function safeDecodeURI(path9, useSemicolonDelimiter) {
32513
+ if (path9.length >= MIN_NATIVE_SCAN_LENGTH) {
32514
+ return safeDecodeURINativeScan(path9, useSemicolonDelimiter);
32515
32515
  }
32516
- return safeDecodeURICharScan(path8, useSemicolonDelimiter, 1);
32516
+ return safeDecodeURICharScan(path9, useSemicolonDelimiter, 1);
32517
32517
  }
32518
- function safeDecodeURINativeScan(path8, useSemicolonDelimiter) {
32519
- const percentIndex = path8.indexOf("%", 1);
32520
- let delimIndex = path8.indexOf("?", 1);
32521
- const hashIndex = path8.indexOf("#", 1);
32518
+ function safeDecodeURINativeScan(path9, useSemicolonDelimiter) {
32519
+ const percentIndex = path9.indexOf("%", 1);
32520
+ let delimIndex = path9.indexOf("?", 1);
32521
+ const hashIndex = path9.indexOf("#", 1);
32522
32522
  if (hashIndex !== -1 && (delimIndex === -1 || hashIndex < delimIndex)) {
32523
32523
  delimIndex = hashIndex;
32524
32524
  }
32525
32525
  if (useSemicolonDelimiter) {
32526
- const semicolonIndex = path8.indexOf(";", 1);
32526
+ const semicolonIndex = path9.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: path8, querystring: "", shouldDecodeParam: false };
32533
+ return { path: path9, querystring: "", shouldDecodeParam: false };
32534
32534
  }
32535
32535
  return {
32536
- path: path8.slice(0, delimIndex),
32537
- querystring: path8.slice(delimIndex + 1),
32536
+ path: path9.slice(0, delimIndex),
32537
+ querystring: path9.slice(delimIndex + 1),
32538
32538
  shouldDecodeParam: false
32539
32539
  };
32540
32540
  }
32541
- return safeDecodeURIPercentScan(path8, useSemicolonDelimiter, percentIndex);
32541
+ return safeDecodeURIPercentScan(path9, useSemicolonDelimiter, percentIndex);
32542
32542
  }
32543
- function safeDecodeURICharScan(path8, useSemicolonDelimiter, startIndex) {
32544
- for (let i = startIndex; i < path8.length; i++) {
32545
- const charCode = path8.charCodeAt(i);
32543
+ function safeDecodeURICharScan(path9, useSemicolonDelimiter, startIndex) {
32544
+ for (let i = startIndex; i < path9.length; i++) {
32545
+ const charCode = path9.charCodeAt(i);
32546
32546
  if (charCode === 37) {
32547
- return safeDecodeURIPercentScan(path8, useSemicolonDelimiter, i);
32547
+ return safeDecodeURIPercentScan(path9, useSemicolonDelimiter, i);
32548
32548
  } else if (charCode === 63 || charCode === 35 || charCode === 59 && useSemicolonDelimiter) {
32549
32549
  return {
32550
- path: path8.slice(0, i),
32551
- querystring: path8.slice(i + 1),
32550
+ path: path9.slice(0, i),
32551
+ querystring: path9.slice(i + 1),
32552
32552
  shouldDecodeParam: false
32553
32553
  };
32554
32554
  }
32555
32555
  }
32556
- return { path: path8, querystring: "", shouldDecodeParam: false };
32556
+ return { path: path9, querystring: "", shouldDecodeParam: false };
32557
32557
  }
32558
- function reencodePercentChar(path8, index) {
32559
- return path8.slice(0, index + 1) + "25" + path8.slice(index + 1);
32558
+ function reencodePercentChar(path9, index) {
32559
+ return path9.slice(0, index + 1) + "25" + path9.slice(index + 1);
32560
32560
  }
32561
- function safeDecodeURIPercentScan(path8, useSemicolonDelimiter, startIndex) {
32561
+ function safeDecodeURIPercentScan(path9, useSemicolonDelimiter, startIndex) {
32562
32562
  let shouldDecode = false;
32563
32563
  let shouldDecodeParam = false;
32564
32564
  let querystring = "";
32565
- for (let i = startIndex; i < path8.length; i++) {
32566
- const charCode = path8.charCodeAt(i);
32565
+ for (let i = startIndex; i < path9.length; i++) {
32566
+ const charCode = path9.charCodeAt(i);
32567
32567
  if (charCode === 37) {
32568
- const componentCharCode = decodeComponentCharCode(path8.charCodeAt(i + 1), path8.charCodeAt(i + 2));
32568
+ const componentCharCode = decodeComponentCharCode(path9.charCodeAt(i + 1), path9.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
- path8 = reencodePercentChar(path8, i);
32575
+ path9 = reencodePercentChar(path9, 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 = path8.slice(i + 1);
32582
- path8 = path8.slice(0, i);
32581
+ querystring = path9.slice(i + 1);
32582
+ path9 = path9.slice(0, i);
32583
32583
  break;
32584
32584
  }
32585
32585
  }
32586
- const decodedPath = shouldDecode ? decodeURI(path8) : path8;
32586
+ const decodedPath = shouldDecode ? decodeURI(path9) : path9;
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, path8, opts, handler, store) {
32681
+ Router.prototype.on = function on(method, path9, 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 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 `*`");
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 `*`");
32692
32692
  assert(typeof handler === "function", "Handler should be a function");
32693
- const optionalParamMatch = path8.match(OPTIONAL_PARAM_REGEXP);
32693
+ const optionalParamMatch = path9.match(OPTIONAL_PARAM_REGEXP);
32694
32694
  if (optionalParamMatch) {
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") || "/";
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") || "/";
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 = path8;
32702
+ const route = path9;
32703
32703
  if (this.ignoreDuplicateSlashes) {
32704
- path8 = removeDuplicateSlashes(path8);
32704
+ path9 = removeDuplicateSlashes(path9);
32705
32705
  }
32706
32706
  if (this.ignoreTrailingSlash) {
32707
- path8 = trimLastSlash(path8);
32707
+ path9 = trimLastSlash(path9);
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, path8, opts, handler, store, route);
32713
+ this._on(method2, path9, opts, handler, store, route);
32714
32714
  }
32715
32715
  };
32716
- Router.prototype._on = function _on(method, path8, opts, handler, store) {
32716
+ Router.prototype._on = function _on(method, path9, 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 = path8;
32729
+ let pattern = path9;
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: path8, pattern, params, opts, handler, store };
32837
+ const route = { method, path: path9, 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, path8, constraints) {
32842
- const route = this.findRoute(method, path8, constraints);
32841
+ Router.prototype.hasRoute = function hasRoute(method, path9, constraints) {
32842
+ const route = this.findRoute(method, path9, constraints);
32843
32843
  return route !== null;
32844
32844
  };
32845
- Router.prototype.findRoute = function findNode(method, path8, constraints = {}) {
32845
+ Router.prototype.findRoute = function findNode(method, path9, constraints = {}) {
32846
32846
  if (this.trees[method] === void 0) {
32847
32847
  return null;
32848
32848
  }
32849
- let pattern = path8;
32849
+ let pattern = path9;
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, 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 `*`");
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 `*`");
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 = path8.match(OPTIONAL_PARAM_REGEXP);
32978
+ const optionalParamMatch = path9.match(OPTIONAL_PARAM_REGEXP);
32979
32979
  if (optionalParamMatch) {
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") || "/";
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") || "/";
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
- path8 = removeDuplicateSlashes(path8);
32988
+ path9 = removeDuplicateSlashes(path9);
32989
32989
  }
32990
32990
  if (this.ignoreTrailingSlash) {
32991
- path8 = trimLastSlash(path8);
32991
+ path9 = trimLastSlash(path9);
32992
32992
  }
32993
32993
  const methods = Array.isArray(method) ? method : [method];
32994
32994
  for (const method2 of methods) {
32995
- this._off(method2, path8, constraints);
32995
+ this._off(method2, path9, constraints);
32996
32996
  }
32997
32997
  };
32998
- Router.prototype._off = function _off(method, path8, constraints) {
32998
+ Router.prototype._off = function _off(method, path9, 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 || path8 !== route.path;
33002
+ return method !== route.method || path9 !== 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, path8, derivedConstraints) {
33039
+ Router.prototype.find = function find(method, path9, derivedConstraints) {
33040
33040
  let currentNode = method === "GET" ? this._treeGET : this.trees[method];
33041
33041
  if (currentNode == null) return null;
33042
- if (path8.charCodeAt(0) !== 47) {
33043
- path8 = path8.replace(FULL_PATH_REGEXP, "/");
33042
+ if (path9.charCodeAt(0) !== 47) {
33043
+ path9 = path9.replace(FULL_PATH_REGEXP, "/");
33044
33044
  }
33045
33045
  if (this.ignoreDuplicateSlashes) {
33046
- path8 = removeDuplicateSlashes(path8);
33046
+ path9 = removeDuplicateSlashes(path9);
33047
33047
  }
33048
33048
  let sanitizedUrl;
33049
33049
  let querystring2;
33050
33050
  let shouldDecodeParam;
33051
33051
  try {
33052
- sanitizedUrl = path8.length >= MIN_NATIVE_SCAN_LENGTH ? safeDecodeURINativeScan(path8, this.useSemicolonDelimiter) : safeDecodeURICharScan(path8, this.useSemicolonDelimiter, 1);
33053
- path8 = sanitizedUrl.path;
33052
+ sanitizedUrl = path9.length >= MIN_NATIVE_SCAN_LENGTH ? safeDecodeURINativeScan(path9, this.useSemicolonDelimiter) : safeDecodeURICharScan(path9, this.useSemicolonDelimiter, 1);
33053
+ path9 = sanitizedUrl.path;
33054
33054
  querystring2 = sanitizedUrl.querystring;
33055
33055
  shouldDecodeParam = sanitizedUrl.shouldDecodeParam;
33056
33056
  } catch (error) {
33057
- return this._onBadUrl(path8);
33057
+ return this._onBadUrl(path9);
33058
33058
  }
33059
33059
  if (this.ignoreTrailingSlash) {
33060
- path8 = trimLastSlash(path8);
33060
+ path9 = trimLastSlash(path9);
33061
33061
  }
33062
- const originPath = path8;
33062
+ const originPath = path9;
33063
33063
  if (this.caseSensitive === false) {
33064
- path8 = path8.toLowerCase();
33064
+ path9 = path9.toLowerCase();
33065
33065
  }
33066
33066
  const maxParamLength = this.maxParamLength;
33067
33067
  let pathIndex = currentNode.prefix.length;
33068
33068
  const params = [];
33069
- const pathLen = path8.length;
33069
+ const pathLen = path9.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(path8, pathIndex, brothersNodesStack, params.length);
33084
+ let node = currentNode.getNextNode(path9, 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: path8, opts, handler, store } = route;
33186
- this._on(method, path8, opts, handler, store);
33185
+ const { method, path: path9, opts, handler, store } = route;
33186
+ this._on(method, path9, 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(path8) {
33197
+ Router.prototype._onBadUrl = function(path9) {
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(path8, req, res),
33203
+ handler: (req, res, ctx) => onBadUrl(path9, req, res),
33204
33204
  params: {},
33205
33205
  store: null
33206
33206
  };
33207
33207
  };
33208
- Router.prototype._onMaxParamLength = function(path8) {
33208
+ Router.prototype._onMaxParamLength = function(path9) {
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(path8, req, res),
33214
+ handler: (req, res, ctx) => onMaxParamLength(path9, 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(path8, handler, store) {
33247
- return this.on(m, path8, handler, store);
33246
+ Router.prototype[methodName] = function(path9, handler, store) {
33247
+ return this.on(m, path9, handler, store);
33248
33248
  };
33249
33249
  }
33250
- Router.prototype.all = function(path8, handler, store) {
33251
- this.on(httpMethods, path8, handler, store);
33250
+ Router.prototype.all = function(path9, handler, store) {
33251
+ this.on(httpMethods, path9, 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(path8) {
33267
- return path8.indexOf("//") !== -1 ? path8.replace(REMOVE_DUPLICATE_SLASHES_REGEXP, "/") : path8;
33266
+ function removeDuplicateSlashes(path9) {
33267
+ return path9.indexOf("//") !== -1 ? path9.replace(REMOVE_DUPLICATE_SLASHES_REGEXP, "/") : path9;
33268
33268
  }
33269
- function trimLastSlash(path8) {
33270
- if (path8.length > 1 && path8.charCodeAt(path8.length - 1) === 47) {
33271
- return path8.slice(0, -1);
33269
+ function trimLastSlash(path9) {
33270
+ if (path9.length > 1 && path9.charCodeAt(path9.length - 1) === 47) {
33271
+ return path9.slice(0, -1);
33272
33272
  }
33273
- return path8;
33273
+ return path9;
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(path8, idx) {
33284
+ function getClosingParenthensePosition(path9, idx) {
33285
33285
  let parentheses = 1;
33286
- while (idx < path8.length) {
33286
+ while (idx < path9.length) {
33287
33287
  idx++;
33288
- if (path8.charCodeAt(idx) === 92) {
33288
+ if (path9.charCodeAt(idx) === 92) {
33289
33289
  idx++;
33290
33290
  continue;
33291
33291
  }
33292
- if (path8.charCodeAt(idx) === 41) {
33292
+ if (path9.charCodeAt(idx) === 41) {
33293
33293
  parentheses--;
33294
- } else if (path8.charCodeAt(idx) === 40) {
33294
+ } else if (path9.charCodeAt(idx) === 40) {
33295
33295
  parentheses++;
33296
33296
  }
33297
33297
  if (!parentheses) return idx;
33298
33298
  }
33299
- throw new TypeError('Invalid regexp expression in "' + path8 + '"');
33299
+ throw new TypeError('Invalid regexp expression in "' + path9 + '"');
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 path8 = opts.url || opts.path || "";
33532
+ const path9 = opts.url || opts.path || "";
33533
33533
  if (!opts.handler) {
33534
- throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method, path8);
33534
+ throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method, path9);
33535
33535
  }
33536
33536
  if (opts.errorHandler !== void 0 && typeof opts.errorHandler !== "function") {
33537
- throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method, path8);
33537
+ throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method, path9);
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], path8, opts.schema);
33547
+ validateSchemaBodyOption.call(this, opts.method[i], path9, 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, path8, opts.schema);
33553
+ validateSchemaBodyOption.call(this, opts.method, path9, 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 (path8 === "/" && prefix.length > 0 && opts.method !== "HEAD") {
33559
+ if (path9 === "/" && prefix.length > 0 && opts.method !== "HEAD") {
33560
33560
  switch (opts.prefixTrailingSlash) {
33561
33561
  case "slash":
33562
- addNewRoute.call(this, { path: path8, isFastify });
33562
+ addNewRoute.call(this, { path: path9, 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: path8, prefixing: true, isFastify });
33571
+ addNewRoute.call(this, { path: path9, prefixing: true, isFastify });
33572
33572
  }
33573
33573
  }
33574
- } else if (path8[0] === "/" && prefix.endsWith("/")) {
33575
- addNewRoute.call(this, { path: path8.slice(1), isFastify });
33574
+ } else if (path9[0] === "/" && prefix.endsWith("/")) {
33575
+ addNewRoute.call(this, { path: path9.slice(1), isFastify });
33576
33576
  } else {
33577
- addNewRoute.call(this, { path: path8, isFastify });
33577
+ addNewRoute.call(this, { path: path9, isFastify });
33578
33578
  }
33579
33579
  return this;
33580
- function addNewRoute({ path: path9, prefixing = false, isFastify: isFastify2 = false }) {
33581
- const url = prefix + path9;
33580
+ function addNewRoute({ path: path10, prefixing = false, isFastify: isFastify2 = false }) {
33581
+ const url = prefix + path10;
33582
33582
  opts.url = url;
33583
33583
  opts.path = url;
33584
- opts.routePath = path9;
33584
+ opts.routePath = path10;
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: path9, options: { ...headOpts, onSend: onSendHandlers }, isFastify: true });
33716
+ prepareRoute.call(this, { method: "HEAD", url: path10, 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, path8, schema) {
33840
+ function validateSchemaBodyOption(method, path9, schema) {
33841
33841
  if (this[kSupportedHTTPMethods].bodyless.has(method) && schema?.body) {
33842
- throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method, path8);
33842
+ throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method, path9);
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, path8, logger) {
33857
+ function validateLogLevelOption(logLevel, method, path9, 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, path8, logLevel);
33861
+ throw new FST_ERR_ROUTE_LOG_LEVEL_INVALID(method, path9, 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(path8, req, res) {
33950
+ return function onRouteEvent(path9, 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(path8, req, res) {
36621
+ function onBadUrl(path9, 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(path8), request, reply);
36628
+ return options.frameworkErrors(new FST_ERR_BAD_URL(path9), request, reply);
36629
36629
  }
36630
36630
  const body = JSON.stringify({
36631
36631
  error: "Bad Request",
36632
36632
  code: "FST_ERR_BAD_URL",
36633
- message: `'${path8}' is not a valid url component`,
36633
+ message: `'${path9}' 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(path8, req, res) {
36642
+ function onMaxParamLength(path9, 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(path8), request, reply);
36649
+ return options.frameworkErrors(new FST_ERR_MAX_PARAM_LENGTH(path9), 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: `'${path8}' is exceeding the max param length`,
36654
+ message: `'${path9}' 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(path8 = "data.db") {
41005
- db = new Database(path8);
41004
+ function initDb(path9 = "data.db") {
41005
+ db = new Database(path9);
41006
41006
  db.pragma("journal_mode = WAL");
41007
41007
  db.pragma("foreign_keys = ON");
41008
41008
  createTables(db);
@@ -42235,11 +42235,11 @@ async function registerWorkspaceRoutes(fastify) {
42235
42235
  }
42236
42236
  }
42237
42237
  }, async (request, reply) => {
42238
- const { path: path8, label = null } = request.body || {};
42239
- if (!path8 || !path8.trim()) {
42238
+ const { path: path9, label = null } = request.body || {};
42239
+ if (!path9 || !path9.trim()) {
42240
42240
  return reply.code(400).send({ error: "Path is required" });
42241
42241
  }
42242
- const trimmedPath = path8.trim();
42242
+ const trimmedPath = path9.trim();
42243
42243
  const db2 = getDb();
42244
42244
  const existing = db2.prepare("SELECT * FROM workspaces WHERE path = ?").get(trimmedPath);
42245
42245
  if (existing) {
@@ -42267,8 +42267,8 @@ async function registerWorkspaceRoutes(fastify) {
42267
42267
  "-e",
42268
42268
  'POSIX path of (choose folder with prompt "Select a workspace directory")'
42269
42269
  ]);
42270
- const path8 = stdout.trim().replace(/\/$/, "");
42271
- return { path: path8 };
42270
+ const path9 = stdout.trim().replace(/\/$/, "");
42271
+ return { path: path9 };
42272
42272
  } catch {
42273
42273
  return reply.code(204).send({ cancelled: true });
42274
42274
  }
@@ -42284,11 +42284,11 @@ async function registerWorkspaceRoutes(fastify) {
42284
42284
  }
42285
42285
  }
42286
42286
  }, async (request, reply) => {
42287
- const { path: path8 } = request.body || {};
42288
- if (!path8 || !path8.trim()) {
42287
+ const { path: path9 } = request.body || {};
42288
+ if (!path9 || !path9.trim()) {
42289
42289
  return reply.code(400).send({ error: "Path is required" });
42290
42290
  }
42291
- const trimmedPath = path8.trim();
42291
+ const trimmedPath = path9.trim();
42292
42292
  const db2 = getDb();
42293
42293
  const existing = db2.prepare("SELECT * FROM workspaces WHERE path = ?").get(trimmedPath);
42294
42294
  if (existing) {
@@ -42935,17 +42935,17 @@ async function registerPerfLogRoutes(fastify) {
42935
42935
  if (entries.length === 0) {
42936
42936
  return reply.send({ written: 0 });
42937
42937
  }
42938
- const path8 = perfLogPath();
42938
+ const path9 = perfLogPath();
42939
42939
  try {
42940
- mkdirSync(dirname(path8), { recursive: true });
42940
+ mkdirSync(dirname(path9), { recursive: true });
42941
42941
  try {
42942
- if (statSync(path8).size > MAX_BYTES) {
42943
- renameSync(path8, `${path8}.1`);
42942
+ if (statSync(path9).size > MAX_BYTES) {
42943
+ renameSync(path9, `${path9}.1`);
42944
42944
  }
42945
42945
  } catch {
42946
42946
  }
42947
42947
  const lines = entries.map((e) => `${new Date(e.t).toISOString()} [${oneLine(e.cat)}] ${oneLine(e.msg)}`).join("\n");
42948
- appendFileSync(path8, `${lines}
42948
+ appendFileSync(path9, `${lines}
42949
42949
  `, "utf-8");
42950
42950
  return reply.send({ written: entries.length });
42951
42951
  } catch (err) {
@@ -43509,7 +43509,7 @@ function proxyHandler(request, reply) {
43509
43509
 
43510
43510
  // src/routes/apps.ts
43511
43511
  import fs4 from "node:fs";
43512
- import path5 from "node:path";
43512
+ import path6 from "node:path";
43513
43513
 
43514
43514
  // src/apps/instances.ts
43515
43515
  import fs2 from "node:fs";
@@ -43560,15 +43560,20 @@ Each subdirectory of this folder is one mini app:
43560
43560
  manifest.json - { "title": string, "description"?: string, "icon"?: string,
43561
43561
  "tools"?: [{ "name", "description", "inputSchema" }] }
43562
43562
  index.html - markup only (full HTML document); do NOT reference app.js
43563
- app.ts - app logic (TypeScript, PREFERRED); injected automatically
43564
- into the page as compiled JS
43563
+ app.ts - ENTRY logic file (TypeScript, PREFERRED); compiled
43564
+ together with any sibling .ts modules it imports
43565
+ and injected into the page as ONE compiled script
43566
+ *.ts - additional modules (flat folder, same directory as
43567
+ app.ts); import them from app.ts with relative names
43568
+ only ('./util' or './util.ts'); bare package imports
43569
+ are NOT supported \u2014 everything must be local
43565
43570
  app.js - legacy plain-JS logic; used only when app.ts is absent
43566
43571
 
43567
- The pane compiles app.ts on every change (strict mode, lib dom). Compile and
43568
- type errors are shown in the app tab \u2014 check them after every edit and fix
43569
- them before finishing. window.AgentPane is typed via ambient declarations
43570
- (getState/setState/createSession/submitTurn/onToolCall/...); no import
43571
- needed.
43572
+ The pane compiles app.ts and its imported modules on every change (strict
43573
+ mode, lib dom). Compile and type errors are shown in the app tab \u2014 check
43574
+ them after every edit and fix them before finishing. window.AgentPane is
43575
+ typed via ambient declarations (getState/setState/createSession/
43576
+ submitTurn/onToolCall/...); no import needed.
43572
43577
 
43573
43578
  App state does NOT live in this folder \u2014 it is stored in the pane database
43574
43579
  (app_instances table) and reached with getState()/setState().
@@ -43581,7 +43586,6 @@ App state does NOT live in this folder \u2014 it is stored in the pane database
43581
43586
  - submitTurn(sessionId, prompt) - send a prompt to a session
43582
43587
  - onTurnCompleted(callback) - callback(event, { turnId, response }) when a turn ends
43583
43588
  - 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)
43584
- one of the manifest tools; answer with resolveToolCall(callId, result)
43585
43589
 
43586
43590
  ## Agent tool calls (manifest "tools")
43587
43591
 
@@ -43736,6 +43740,7 @@ import vm2 from "node:vm";
43736
43740
 
43737
43741
  // src/apps/app-compile.ts
43738
43742
  import vm from "node:vm";
43743
+ import path5 from "node:path";
43739
43744
  import ts from "typescript";
43740
43745
  var APP_TS = "app.ts";
43741
43746
  var BRIDGE_DTS_FILE = "agentpane.d.ts";
@@ -43777,30 +43782,128 @@ function tsDiagnosticToFile(file, d) {
43777
43782
  message: ts.flattenDiagnosticMessageText(d.messageText, "\n")
43778
43783
  };
43779
43784
  }
43780
- function typeCheckAppTs(source) {
43785
+ var MODULE_LIMIT = 50;
43786
+ function resolveModuleName(spec) {
43787
+ if (!spec.startsWith("./")) return null;
43788
+ const base = spec.slice(2).replace(/\.(ts|js)$/, "");
43789
+ const file = `${base}.ts`;
43790
+ if (!/^[A-Za-z0-9][A-Za-z0-9._-]*\.ts$/.test(file)) return null;
43791
+ return file;
43792
+ }
43793
+ function importRefs(sf) {
43794
+ const refs = [];
43795
+ const push = (expr) => {
43796
+ if (!ts.isStringLiteral(expr)) return;
43797
+ const pos = sf.getLineAndCharacterOfPosition(expr.getStart(sf));
43798
+ refs.push({ name: expr.text, file: sf.fileName, line: pos.line + 1, column: pos.character + 1 });
43799
+ };
43800
+ const visit = (node) => {
43801
+ if (ts.isImportDeclaration(node) && node.moduleSpecifier) push(node.moduleSpecifier);
43802
+ else if (ts.isExportDeclaration(node) && node.moduleSpecifier) push(node.moduleSpecifier);
43803
+ else if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword && node.arguments[0])
43804
+ push(node.arguments[0]);
43805
+ else ts.forEachChild(node, visit);
43806
+ };
43807
+ ts.forEachChild(sf, visit);
43808
+ return refs;
43809
+ }
43810
+ function buildModuleGraph(appId) {
43811
+ const modules = [{ file: APP_TS, source: readAppFile(appId, APP_TS) }];
43812
+ const seen = /* @__PURE__ */ new Set([APP_TS]);
43813
+ const blocking = [];
43814
+ for (let i = 0; i < modules.length; i++) {
43815
+ const mod = modules[i];
43816
+ const sf = ts.createSourceFile(mod.file, mod.source, ts.ScriptTarget.ES2020, true);
43817
+ for (const ref of importRefs(sf)) {
43818
+ const target = resolveModuleName(ref.name);
43819
+ const at = { severity: "error", file: ref.file, line: ref.line, column: ref.column };
43820
+ if (!target) {
43821
+ blocking.push({
43822
+ ...at,
43823
+ message: `Unsupported import '${ref.name}' \u2014 mini app modules must be sibling .ts files imported as './name'.`
43824
+ });
43825
+ continue;
43826
+ }
43827
+ if (seen.has(target)) continue;
43828
+ seen.add(target);
43829
+ const source = readAppFile(appId, target);
43830
+ if (!source.trim()) {
43831
+ blocking.push({
43832
+ ...at,
43833
+ message: `Cannot find module '${ref.name}' \u2014 add a file named '${target}' next to app.ts.`
43834
+ });
43835
+ continue;
43836
+ }
43837
+ if (modules.length >= MODULE_LIMIT) {
43838
+ blocking.push({ ...at, message: `Mini app bundles at most ${MODULE_LIMIT} modules.` });
43839
+ continue;
43840
+ }
43841
+ modules.push({ file: target, source });
43842
+ }
43843
+ }
43844
+ return { modules, blocking };
43845
+ }
43846
+ var LOADER_JS = `
43847
+ var __cache = {};
43848
+ var __resolve = ${resolveModuleName};
43849
+ function __load(file) {
43850
+ var cached = __cache[file];
43851
+ if (cached) return cached.exports;
43852
+ var mod = __modules[file];
43853
+ if (!mod) throw new Error('Module not found: ' + file);
43854
+ var module = { exports: {} };
43855
+ __cache[file] = module;
43856
+ mod.call(module.exports, module.exports, function (spec) {
43857
+ var target = __resolve(spec);
43858
+ if (!target) throw new Error("Unsupported import '" + spec + "' in " + file);
43859
+ return __load(target);
43860
+ }, module);
43861
+ return module.exports;
43862
+ }
43863
+ __load(${JSON.stringify(APP_TS)});
43864
+ `;
43865
+ function emitBundle(modules) {
43866
+ const defs = modules.map((m) => `${JSON.stringify(m.file)}: function (exports, require, module) {
43867
+ ${m.js}
43868
+ }`).join(",\n");
43869
+ return `(function () {
43870
+ var __modules = {
43871
+ ${defs}
43872
+ };
43873
+ ${LOADER_JS}})();
43874
+ `;
43875
+ }
43876
+ function typeCheckModules(appId, modules) {
43877
+ const dir = appDir(appId);
43781
43878
  const options = {
43782
43879
  noEmit: true,
43783
43880
  target: ts.ScriptTarget.ES2020,
43784
- module: ts.ModuleKind.None,
43881
+ module: ts.ModuleKind.ESNext,
43882
+ moduleResolution: ts.ModuleResolutionKind.Bundler,
43883
+ allowImportingTsExtensions: true,
43785
43884
  lib: ["lib.es2020.d.ts", "lib.dom.d.ts"],
43786
43885
  strict: true,
43787
- skipLibCheck: true
43886
+ skipLibCheck: true,
43887
+ types: []
43888
+ // hermetic — no ambient @types discovery from the host
43788
43889
  };
43789
43890
  const host = ts.createCompilerHost(options);
43790
43891
  const origReadFile = host.readFile.bind(host);
43791
- const origFileExists = host.fileExists.bind(host);
43792
- host.readFile = (fname) => {
43793
- if (fname === APP_TS) return source;
43794
- if (fname === BRIDGE_DTS_FILE) return BRIDGE_DTS;
43795
- return origReadFile(fname);
43796
- };
43797
- host.fileExists = (fname) => fname === APP_TS || fname === BRIDGE_DTS_FILE ? true : origFileExists(fname);
43892
+ host.readFile = (fname) => path5.basename(fname) === BRIDGE_DTS_FILE ? BRIDGE_DTS : origReadFile(fname);
43798
43893
  host.writeFile = () => {
43799
43894
  };
43800
- const program = ts.createProgram([APP_TS, BRIDGE_DTS_FILE], options, host);
43801
- const appFile = program.getSourceFile(APP_TS);
43802
- if (!appFile) return [];
43803
- return [...program.getSyntacticDiagnostics(appFile), ...program.getSemanticDiagnostics(appFile)].map((d) => tsDiagnosticToFile(APP_TS, d)).filter((d) => d !== null);
43895
+ const bridgePath = path5.join(dir, BRIDGE_DTS_FILE);
43896
+ const rootNames = [...modules.map((m) => path5.join(dir, m.file)), bridgePath];
43897
+ const program = ts.createProgram(rootNames, options, host);
43898
+ const out = [];
43899
+ for (const mod of modules) {
43900
+ const sf = program.getSourceFile(path5.join(dir, mod.file));
43901
+ if (!sf) continue;
43902
+ out.push(
43903
+ ...[...program.getSyntacticDiagnostics(sf), ...program.getSemanticDiagnostics(sf)].map((d) => tsDiagnosticToFile(mod.file, d)).filter((d) => d !== null)
43904
+ );
43905
+ }
43906
+ return out;
43804
43907
  }
43805
43908
  function checkJsSyntax(js) {
43806
43909
  try {
@@ -43826,17 +43929,26 @@ function compileAppJs(appId) {
43826
43929
  const tsSource = readAppFile(appId, APP_TS);
43827
43930
  let result;
43828
43931
  if (tsSource.trim()) {
43829
- const transpiled = ts.transpileModule(tsSource, {
43830
- compilerOptions: { target: ts.ScriptTarget.ES2020, module: ts.ModuleKind.None },
43831
- reportDiagnostics: true,
43832
- fileName: APP_TS
43833
- });
43834
- const syntaxDiags = (transpiled.diagnostics ?? []).map((d) => tsDiagnosticToFile(APP_TS, d)).filter((d) => d !== null);
43835
- const blocked = syntaxDiags.some((d) => d.severity === "error");
43836
- result = {
43837
- js: blocked ? "" : transpiled.outputText,
43932
+ const { modules, blocking: graphDiags } = buildModuleGraph(appId);
43933
+ const transpiled = [];
43934
+ const syntaxDiags = [];
43935
+ for (const mod of modules) {
43936
+ const out = ts.transpileModule(mod.source, {
43937
+ compilerOptions: { target: ts.ScriptTarget.ES2020, module: ts.ModuleKind.CommonJS },
43938
+ reportDiagnostics: true,
43939
+ fileName: mod.file
43940
+ });
43941
+ for (const d of out.diagnostics ?? []) {
43942
+ const diag = tsDiagnosticToFile(mod.file, d);
43943
+ if (diag) syntaxDiags.push(diag);
43944
+ }
43945
+ transpiled.push({ file: mod.file, js: out.outputText });
43946
+ }
43947
+ const blocked = graphDiags.length > 0 || syntaxDiags.some((d) => d.severity === "error");
43948
+ result = blocked ? { js: "", sourceFile: "app.ts", diagnostics: [...graphDiags, ...syntaxDiags] } : {
43949
+ js: emitBundle(transpiled),
43838
43950
  sourceFile: "app.ts",
43839
- diagnostics: blocked ? syntaxDiags : [...syntaxDiags, ...typeCheckAppTs(tsSource)]
43951
+ diagnostics: [...graphDiags, ...syntaxDiags, ...typeCheckModules(appId, modules)]
43840
43952
  };
43841
43953
  } else {
43842
43954
  const js = readAppFile(appId, "app.js");
@@ -44146,7 +44258,7 @@ async function registerAppRoutes(fastify, opts) {
44146
44258
  try {
44147
44259
  for (const entry of fs4.readdirSync(exRoot, { withFileTypes: true })) {
44148
44260
  if (!entry.isDirectory() || !APP_ID_RE.test(entry.name)) continue;
44149
- const manifest = readManifestIn(path5.join(exRoot, entry.name));
44261
+ const manifest = readManifestIn(path6.join(exRoot, entry.name));
44150
44262
  if (!manifest) continue;
44151
44263
  out.push({
44152
44264
  id: entry.name,
@@ -44167,7 +44279,7 @@ async function registerAppRoutes(fastify, opts) {
44167
44279
  if (!APP_ID_RE.test(id)) return reply.code(400).send({ error: "Invalid app id" });
44168
44280
  const exRoot = examplesRoot();
44169
44281
  if (!exRoot) return reply.code(404).send({ error: "Examples catalog not available" });
44170
- const src = path5.join(exRoot, id);
44282
+ const src = path6.join(exRoot, id);
44171
44283
  if (!readManifestIn(src)) return reply.code(404).send({ error: "Example not found" });
44172
44284
  if (readManifest(id)) return reply.code(409).send({ error: "App already installed" });
44173
44285
  ensureAppsRoot();
@@ -44200,7 +44312,7 @@ async function registerAppRoutes(fastify, opts) {
44200
44312
  fs4.mkdirSync(dir, { recursive: true });
44201
44313
  const cleanTitle2 = title.trim();
44202
44314
  fs4.writeFileSync(
44203
- path5.join(dir, "manifest.json"),
44315
+ path6.join(dir, "manifest.json"),
44204
44316
  JSON.stringify(
44205
44317
  {
44206
44318
  title: cleanTitle2,
@@ -44211,8 +44323,8 @@ async function registerAppRoutes(fastify, opts) {
44211
44323
  2
44212
44324
  )
44213
44325
  );
44214
- fs4.writeFileSync(path5.join(dir, "index.html"), SKELETON_HTML.replaceAll("__TITLE__", cleanTitle2));
44215
- fs4.writeFileSync(path5.join(dir, "app.ts"), SKELETON_TS);
44326
+ fs4.writeFileSync(path6.join(dir, "index.html"), SKELETON_HTML.replaceAll("__TITLE__", cleanTitle2));
44327
+ fs4.writeFileSync(path6.join(dir, "app.ts"), SKELETON_TS);
44216
44328
  return { ok: true, id };
44217
44329
  }
44218
44330
  );
@@ -44249,9 +44361,9 @@ async function registerAppRoutes(fastify, opts) {
44249
44361
  const dir = appDir(id);
44250
44362
  fs4.mkdirSync(dir, { recursive: true });
44251
44363
  if (!Object.hasOwn(files ?? {}, "manifest.json")) {
44252
- fs4.writeFileSync(path5.join(dir, "manifest.json"), JSON.stringify({ title: id }, null, 2));
44364
+ fs4.writeFileSync(path6.join(dir, "manifest.json"), JSON.stringify({ title: id }, null, 2));
44253
44365
  }
44254
- for (const [name, content] of entries) fs4.writeFileSync(path5.join(dir, name), content);
44366
+ for (const [name, content] of entries) fs4.writeFileSync(path6.join(dir, name), content);
44255
44367
  return { ok: true, id };
44256
44368
  }
44257
44369
  );
@@ -44479,18 +44591,18 @@ function mapTokenUsage(data) {
44479
44591
 
44480
44592
  // src/apps/register-mcp.ts
44481
44593
  import fs5 from "node:fs";
44482
- import path6 from "node:path";
44594
+ import path7 from "node:path";
44483
44595
  import { fileURLToPath as fileURLToPath2 } from "node:url";
44484
44596
  var MCP_SERVER_NAME = "agentpane-miniapps";
44485
44597
  function panePublicUrl() {
44486
44598
  return (process.env.AGENT_PANE_PUBLIC_URL || process.env.REPOBURG_DAEMON_URL || "http://localhost:9998").replace(/\/+$/, "");
44487
44599
  }
44488
44600
  function stdioScriptPath() {
44489
- const here = path6.dirname(fileURLToPath2(import.meta.url));
44601
+ const here = path7.dirname(fileURLToPath2(import.meta.url));
44490
44602
  const candidates = [
44491
- path6.resolve(here, "../../scripts/miniapp-mcp-stdio.mjs"),
44603
+ path7.resolve(here, "../../scripts/miniapp-mcp-stdio.mjs"),
44492
44604
  // src/apps/ → backend/scripts
44493
- path6.resolve(here, "../scripts/miniapp-mcp-stdio.mjs")
44605
+ path7.resolve(here, "../scripts/miniapp-mcp-stdio.mjs")
44494
44606
  // dist bundle → backend/scripts
44495
44607
  ];
44496
44608
  for (const candidate of candidates) {
@@ -45215,9 +45327,9 @@ function mapToolUse(block) {
45215
45327
  };
45216
45328
  }
45217
45329
  function deriveFileChangeData(input, toolName) {
45218
- const path8 = input.file_path ?? input.notebook_path ?? "";
45330
+ const path9 = input.file_path ?? input.notebook_path ?? "";
45219
45331
  const kind = toolName === "Write" ? "add" : "modify";
45220
- return { changes: [{ path: path8, kind }], status: "in_progress" };
45332
+ return { changes: [{ path: path9, kind }], status: "in_progress" };
45221
45333
  }
45222
45334
  function extractToolResultText(content) {
45223
45335
  if (!content) return "";
@@ -46248,8 +46360,8 @@ var RepoburgHttpClient = class {
46248
46360
  this.baseUrl = baseUrl.replace(/\/+$/, "");
46249
46361
  }
46250
46362
  /** Perform a JSON request. Throws a concise error on non-OK/non-JSON responses. */
46251
- async request(method, path8, body) {
46252
- const response = await fetch(`${this.baseUrl}${path8}`, {
46363
+ async request(method, path9, body) {
46364
+ const response = await fetch(`${this.baseUrl}${path9}`, {
46253
46365
  method,
46254
46366
  headers: { "Content-Type": "application/json" },
46255
46367
  body: body === void 0 ? void 0 : JSON.stringify(body)
@@ -46258,17 +46370,17 @@ var RepoburgHttpClient = class {
46258
46370
  if (!response.ok) {
46259
46371
  if (isHtml(text)) {
46260
46372
  throw new Error(
46261
- `${method} ${path8} failed: ${response.status} HTML response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46373
+ `${method} ${path9} failed: ${response.status} HTML response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46262
46374
  );
46263
46375
  }
46264
- throw new Error(`${method} ${path8} failed: ${response.status} ${text}`);
46376
+ throw new Error(`${method} ${path9} failed: ${response.status} ${text}`);
46265
46377
  }
46266
46378
  if (text.length === 0) return void 0;
46267
46379
  try {
46268
46380
  return JSON.parse(text);
46269
46381
  } catch {
46270
46382
  throw new Error(
46271
- `${method} ${path8} failed: non-JSON response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46383
+ `${method} ${path9} failed: non-JSON response from ${this.baseUrl} \u2014 the URL points to the wrong server`
46272
46384
  );
46273
46385
  }
46274
46386
  }
@@ -46323,7 +46435,7 @@ var RepoburgHttpClient = class {
46323
46435
  };
46324
46436
 
46325
46437
  // src/repoburg/backend-resolver.ts
46326
- import path7 from "node:path";
46438
+ import path8 from "node:path";
46327
46439
  var HEALTH_POLL_INTERVAL_MS = 1e3;
46328
46440
  var HEALTH_TIMEOUT_MS = 3e4;
46329
46441
  function daemonBaseUrl() {
@@ -46378,7 +46490,7 @@ async function backendHealthy(baseUrl, expectedPath) {
46378
46490
  const health = await fetchJson(`${baseUrl}/health`, void 0, 2e3);
46379
46491
  if (health.status !== "ok") return false;
46380
46492
  if (expectedPath && health.projectPath) {
46381
- return path7.resolve(health.projectPath) === path7.resolve(expectedPath);
46493
+ return path8.resolve(health.projectPath) === path8.resolve(expectedPath);
46382
46494
  }
46383
46495
  return true;
46384
46496
  } catch {
@@ -46399,7 +46511,7 @@ function serviceBaseUrl(service) {
46399
46511
  return `http://localhost:${service.port}`;
46400
46512
  }
46401
46513
  function coveringService(services, absPath) {
46402
- return services.filter((s) => absPath === s.path || absPath.startsWith(s.path + path7.sep)).sort((a, b) => b.path.length - a.path.length)[0];
46514
+ return services.filter((s) => absPath === s.path || absPath.startsWith(s.path + path8.sep)).sort((a, b) => b.path.length - a.path.length)[0];
46403
46515
  }
46404
46516
  async function restartService(daemon, name) {
46405
46517
  try {
@@ -46435,7 +46547,7 @@ async function resolveBackendUrl(projectPath, opts = {}) {
46435
46547
  if (envUrl) {
46436
46548
  return { baseUrl: envUrl.replace(/\/+$/, ""), port: 0, name: "REPOBURG_BACKEND_URL" };
46437
46549
  }
46438
- const absPath = path7.resolve(projectPath);
46550
+ const absPath = path8.resolve(projectPath);
46439
46551
  const daemon = daemonBaseUrl();
46440
46552
  const cached = resolvedCache.get(absPath);
46441
46553
  if (cached && await backendHealthy(cached.baseUrl, cached.servesPath ?? absPath)) {