rterm-backend 2.8.2 → 2.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/gybackend.js CHANGED
@@ -11,10 +11,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
11
  var __getOwnPropNames = Object.getOwnPropertyNames;
12
12
  var __getProtoOf = Object.getPrototypeOf;
13
13
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __glob = (map3) => (path31) => {
15
- var fn = map3[path31];
14
+ var __glob = (map3) => (path32) => {
15
+ var fn = map3[path32];
16
16
  if (fn) return fn();
17
- throw new Error("Module not found in bundle: " + path31);
17
+ throw new Error("Module not found in bundle: " + path32);
18
18
  };
19
19
  var __esm = (fn, res) => function __init() {
20
20
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
@@ -11810,7 +11810,9 @@ var init_betterSqlite3Runtime = __esm({
11810
11810
  import_node_path3 = __toESM(require("node:path"), 1);
11811
11811
  import_node_module = require("node:module");
11812
11812
  import_meta3 = {};
11813
- require2 = (0, import_node_module.createRequire)(import_meta3.url);
11813
+ require2 = (0, import_node_module.createRequire)(
11814
+ typeof __filename !== "undefined" ? __filename : import_meta3.url
11815
+ );
11814
11816
  NODE_RUNTIME_PACKAGE_NAME = "better-sqlite3";
11815
11817
  ELECTRON_RUNTIME_PACKAGE_NAME = "better-sqlite3-electron";
11816
11818
  cachedConstructor = null;
@@ -28426,8 +28428,8 @@ var require_pdf_worker = __commonJS({
28426
28428
  if (font.data && (isAddToPathSet || this.options.disableFontFace)) {
28427
28429
  var buildPath = function buildPath2(fontChar) {
28428
28430
  if (!font.renderer.hasBuiltPath(fontChar)) {
28429
- var path31 = font.renderer.getPathJs(fontChar);
28430
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
28431
+ var path32 = font.renderer.getPathJs(fontChar);
28432
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
28431
28433
  }
28432
28434
  };
28433
28435
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -71115,10 +71117,10 @@ var require_pdf = __commonJS({
71115
71117
  ctx.save();
71116
71118
  ctx.beginPath();
71117
71119
  for (var i = 0; i < paths.length; i++) {
71118
- var path31 = paths[i];
71119
- ctx.setTransform.apply(ctx, path31.transform);
71120
- ctx.translate(path31.x, path31.y);
71121
- path31.addToPath(ctx, path31.fontSize);
71120
+ var path32 = paths[i];
71121
+ ctx.setTransform.apply(ctx, path32.transform);
71122
+ ctx.translate(path32.x, path32.y);
71123
+ path32.addToPath(ctx, path32.fontSize);
71122
71124
  }
71123
71125
  ctx.restore();
71124
71126
  ctx.clip();
@@ -73311,8 +73313,8 @@ var require_pdf = __commonJS({
73311
73313
  function PDFNodeStreamFsFullReader2(stream) {
73312
73314
  _classCallCheck(this, PDFNodeStreamFsFullReader2);
73313
73315
  var _this7 = _possibleConstructorReturn(this, (PDFNodeStreamFsFullReader2.__proto__ || Object.getPrototypeOf(PDFNodeStreamFsFullReader2)).call(this, stream));
73314
- var path31 = decodeURI(_this7._url.path);
73315
- fs22.lstat(path31, function(error40, stat) {
73316
+ var path32 = decodeURI(_this7._url.path);
73317
+ fs22.lstat(path32, function(error40, stat) {
73316
73318
  if (error40) {
73317
73319
  _this7._errored = true;
73318
73320
  _this7._reason = error40;
@@ -73320,7 +73322,7 @@ var require_pdf = __commonJS({
73320
73322
  return;
73321
73323
  }
73322
73324
  _this7._contentLength = stat.size;
73323
- _this7._setReadableStream(fs22.createReadStream(path31));
73325
+ _this7._setReadableStream(fs22.createReadStream(path32));
73324
73326
  _this7._headersCapability.resolve();
73325
73327
  });
73326
73328
  return _this7;
@@ -90630,8 +90632,8 @@ var require_pdf_worker2 = __commonJS({
90630
90632
  if (font.data && (isAddToPathSet || this.options.disableFontFace)) {
90631
90633
  var buildPath = function buildPath2(fontChar) {
90632
90634
  if (!font.renderer.hasBuiltPath(fontChar)) {
90633
- var path31 = font.renderer.getPathJs(fontChar);
90634
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
90635
+ var path32 = font.renderer.getPathJs(fontChar);
90636
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
90635
90637
  }
90636
90638
  };
90637
90639
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -133427,10 +133429,10 @@ var require_pdf2 = __commonJS({
133427
133429
  ctx.save();
133428
133430
  ctx.beginPath();
133429
133431
  for (var i = 0; i < paths.length; i++) {
133430
- var path31 = paths[i];
133431
- ctx.setTransform.apply(ctx, path31.transform);
133432
- ctx.translate(path31.x, path31.y);
133433
- path31.addToPath(ctx, path31.fontSize);
133432
+ var path32 = paths[i];
133433
+ ctx.setTransform.apply(ctx, path32.transform);
133434
+ ctx.translate(path32.x, path32.y);
133435
+ path32.addToPath(ctx, path32.fontSize);
133434
133436
  }
133435
133437
  ctx.restore();
133436
133438
  ctx.clip();
@@ -135147,8 +135149,8 @@ var require_pdf2 = __commonJS({
135147
135149
  function PDFNodeStreamFsFullReader2(stream) {
135148
135150
  _classCallCheck(this, PDFNodeStreamFsFullReader2);
135149
135151
  var _this7 = _possibleConstructorReturn(this, (PDFNodeStreamFsFullReader2.__proto__ || Object.getPrototypeOf(PDFNodeStreamFsFullReader2)).call(this, stream));
135150
- var path31 = decodeURI(_this7._url.path);
135151
- fs22.lstat(path31, function(error40, stat) {
135152
+ var path32 = decodeURI(_this7._url.path);
135153
+ fs22.lstat(path32, function(error40, stat) {
135152
135154
  if (error40) {
135153
135155
  _this7._errored = true;
135154
135156
  _this7._reason = error40;
@@ -135156,7 +135158,7 @@ var require_pdf2 = __commonJS({
135156
135158
  return;
135157
135159
  }
135158
135160
  _this7._contentLength = stat.size;
135159
- _this7._setReadableStream(fs22.createReadStream(path31));
135161
+ _this7._setReadableStream(fs22.createReadStream(path32));
135160
135162
  _this7._headersCapability.resolve();
135161
135163
  });
135162
135164
  return _this7;
@@ -152733,8 +152735,8 @@ var require_pdf_worker3 = __commonJS({
152733
152735
  if (font.data && (isAddToPathSet || this.options.disableFontFace)) {
152734
152736
  var buildPath = function buildPath2(fontChar) {
152735
152737
  if (!font.renderer.hasBuiltPath(fontChar)) {
152736
- var path31 = font.renderer.getPathJs(fontChar);
152737
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
152738
+ var path32 = font.renderer.getPathJs(fontChar);
152739
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
152738
152740
  }
152739
152741
  };
152740
152742
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -187189,10 +187191,10 @@ var require_pdf3 = __commonJS({
187189
187191
  ctx.save();
187190
187192
  ctx.beginPath();
187191
187193
  for (var i = 0; i < paths.length; i++) {
187192
- var path31 = paths[i];
187193
- ctx.setTransform.apply(ctx, path31.transform);
187194
- ctx.translate(path31.x, path31.y);
187195
- path31.addToPath(ctx, path31.fontSize);
187194
+ var path32 = paths[i];
187195
+ ctx.setTransform.apply(ctx, path32.transform);
187196
+ ctx.translate(path32.x, path32.y);
187197
+ path32.addToPath(ctx, path32.fontSize);
187196
187198
  }
187197
187199
  ctx.restore();
187198
187200
  ctx.clip();
@@ -212587,8 +212589,8 @@ var require_pdf_worker4 = __commonJS({
212587
212589
  if (font.data && (isAddToPathSet || this.options.disableFontFace || state.fillColorSpace.name === "Pattern")) {
212588
212590
  var buildPath = function buildPath2(fontChar) {
212589
212591
  if (!font.renderer.hasBuiltPath(fontChar)) {
212590
- var path31 = font.renderer.getPathJs(fontChar);
212591
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
212592
+ var path32 = font.renderer.getPathJs(fontChar);
212593
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
212592
212594
  }
212593
212595
  };
212594
212596
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -244552,10 +244554,10 @@ var require_pdf4 = __commonJS({
244552
244554
  ctx.save();
244553
244555
  ctx.beginPath();
244554
244556
  for (var i = 0; i < paths.length; i++) {
244555
- var path31 = paths[i];
244556
- ctx.setTransform.apply(ctx, path31.transform);
244557
- ctx.translate(path31.x, path31.y);
244558
- path31.addToPath(ctx, path31.fontSize);
244557
+ var path32 = paths[i];
244558
+ ctx.setTransform.apply(ctx, path32.transform);
244559
+ ctx.translate(path32.x, path32.y);
244560
+ path32.addToPath(ctx, path32.fontSize);
244559
244561
  }
244560
244562
  ctx.restore();
244561
244563
  ctx.clip();
@@ -250178,11 +250180,11 @@ var require_pdf4 = __commonJS({
250178
250180
  function PDFNodeStreamFsFullReader2(stream) {
250179
250181
  _classCallCheck(this, PDFNodeStreamFsFullReader2);
250180
250182
  var _this7 = _possibleConstructorReturn(this, (PDFNodeStreamFsFullReader2.__proto__ || Object.getPrototypeOf(PDFNodeStreamFsFullReader2)).call(this, stream));
250181
- var path31 = decodeURIComponent(_this7._url.path);
250183
+ var path32 = decodeURIComponent(_this7._url.path);
250182
250184
  if (fileUriRegex.test(_this7._url.href)) {
250183
- path31 = path31.replace(/^\//, "");
250185
+ path32 = path32.replace(/^\//, "");
250184
250186
  }
250185
- fs22.lstat(path31, function(error40, stat) {
250187
+ fs22.lstat(path32, function(error40, stat) {
250186
250188
  if (error40) {
250187
250189
  _this7._errored = true;
250188
250190
  _this7._reason = error40;
@@ -250190,7 +250192,7 @@ var require_pdf4 = __commonJS({
250190
250192
  return;
250191
250193
  }
250192
250194
  _this7._contentLength = stat.size;
250193
- _this7._setReadableStream(fs22.createReadStream(path31));
250195
+ _this7._setReadableStream(fs22.createReadStream(path32));
250194
250196
  _this7._headersCapability.resolve();
250195
250197
  });
250196
250198
  return _this7;
@@ -250202,11 +250204,11 @@ var require_pdf4 = __commonJS({
250202
250204
  function PDFNodeStreamFsRangeReader2(stream, start, end) {
250203
250205
  _classCallCheck(this, PDFNodeStreamFsRangeReader2);
250204
250206
  var _this8 = _possibleConstructorReturn(this, (PDFNodeStreamFsRangeReader2.__proto__ || Object.getPrototypeOf(PDFNodeStreamFsRangeReader2)).call(this, stream));
250205
- var path31 = decodeURIComponent(_this8._url.path);
250207
+ var path32 = decodeURIComponent(_this8._url.path);
250206
250208
  if (fileUriRegex.test(_this8._url.href)) {
250207
- path31 = path31.replace(/^\//, "");
250209
+ path32 = path32.replace(/^\//, "");
250208
250210
  }
250209
- _this8._setReadableStream(fs22.createReadStream(path31, {
250211
+ _this8._setReadableStream(fs22.createReadStream(path32, {
250210
250212
  start,
250211
250213
  end: end - 1
250212
250214
  }));
@@ -259326,8 +259328,8 @@ var require_utils2 = __commonJS({
259326
259328
  }
259327
259329
  return ind;
259328
259330
  }
259329
- function removeDotSegments(path31) {
259330
- let input = path31;
259331
+ function removeDotSegments(path32) {
259332
+ let input = path32;
259331
259333
  const output = [];
259332
259334
  let nextSlash = -1;
259333
259335
  let len = 0;
@@ -259526,8 +259528,8 @@ var require_schemes = __commonJS({
259526
259528
  wsComponent.secure = void 0;
259527
259529
  }
259528
259530
  if (wsComponent.resourceName) {
259529
- const [path31, query] = wsComponent.resourceName.split("?");
259530
- wsComponent.path = path31 && path31 !== "/" ? path31 : void 0;
259531
+ const [path32, query] = wsComponent.resourceName.split("?");
259532
+ wsComponent.path = path32 && path32 !== "/" ? path32 : void 0;
259531
259533
  wsComponent.query = query;
259532
259534
  wsComponent.resourceName = void 0;
259533
259535
  }
@@ -268585,7 +268587,7 @@ var require_windows = __commonJS({
268585
268587
  module2.exports = isexe;
268586
268588
  isexe.sync = sync;
268587
268589
  var fs22 = require("fs");
268588
- function checkPathExt(path31, options) {
268590
+ function checkPathExt(path32, options) {
268589
268591
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
268590
268592
  if (!pathext) {
268591
268593
  return true;
@@ -268596,25 +268598,25 @@ var require_windows = __commonJS({
268596
268598
  }
268597
268599
  for (var i = 0; i < pathext.length; i++) {
268598
268600
  var p = pathext[i].toLowerCase();
268599
- if (p && path31.substr(-p.length).toLowerCase() === p) {
268601
+ if (p && path32.substr(-p.length).toLowerCase() === p) {
268600
268602
  return true;
268601
268603
  }
268602
268604
  }
268603
268605
  return false;
268604
268606
  }
268605
- function checkStat(stat, path31, options) {
268607
+ function checkStat(stat, path32, options) {
268606
268608
  if (!stat.isSymbolicLink() && !stat.isFile()) {
268607
268609
  return false;
268608
268610
  }
268609
- return checkPathExt(path31, options);
268611
+ return checkPathExt(path32, options);
268610
268612
  }
268611
- function isexe(path31, options, cb) {
268612
- fs22.stat(path31, function(er, stat) {
268613
- cb(er, er ? false : checkStat(stat, path31, options));
268613
+ function isexe(path32, options, cb) {
268614
+ fs22.stat(path32, function(er, stat) {
268615
+ cb(er, er ? false : checkStat(stat, path32, options));
268614
268616
  });
268615
268617
  }
268616
- function sync(path31, options) {
268617
- return checkStat(fs22.statSync(path31), path31, options);
268618
+ function sync(path32, options) {
268619
+ return checkStat(fs22.statSync(path32), path32, options);
268618
268620
  }
268619
268621
  }
268620
268622
  });
@@ -268625,13 +268627,13 @@ var require_mode = __commonJS({
268625
268627
  module2.exports = isexe;
268626
268628
  isexe.sync = sync;
268627
268629
  var fs22 = require("fs");
268628
- function isexe(path31, options, cb) {
268629
- fs22.stat(path31, function(er, stat) {
268630
+ function isexe(path32, options, cb) {
268631
+ fs22.stat(path32, function(er, stat) {
268630
268632
  cb(er, er ? false : checkStat(stat, options));
268631
268633
  });
268632
268634
  }
268633
- function sync(path31, options) {
268634
- return checkStat(fs22.statSync(path31), options);
268635
+ function sync(path32, options) {
268636
+ return checkStat(fs22.statSync(path32), options);
268635
268637
  }
268636
268638
  function checkStat(stat, options) {
268637
268639
  return stat.isFile() && checkMode(stat, options);
@@ -268664,7 +268666,7 @@ var require_isexe = __commonJS({
268664
268666
  }
268665
268667
  module2.exports = isexe;
268666
268668
  isexe.sync = sync;
268667
- function isexe(path31, options, cb) {
268669
+ function isexe(path32, options, cb) {
268668
268670
  if (typeof options === "function") {
268669
268671
  cb = options;
268670
268672
  options = {};
@@ -268674,7 +268676,7 @@ var require_isexe = __commonJS({
268674
268676
  throw new TypeError("callback not provided");
268675
268677
  }
268676
268678
  return new Promise(function(resolve2, reject) {
268677
- isexe(path31, options || {}, function(er, is) {
268679
+ isexe(path32, options || {}, function(er, is) {
268678
268680
  if (er) {
268679
268681
  reject(er);
268680
268682
  } else {
@@ -268683,7 +268685,7 @@ var require_isexe = __commonJS({
268683
268685
  });
268684
268686
  });
268685
268687
  }
268686
- core2(path31, options || {}, function(er, is) {
268688
+ core2(path32, options || {}, function(er, is) {
268687
268689
  if (er) {
268688
268690
  if (er.code === "EACCES" || options && options.ignoreErrors) {
268689
268691
  er = null;
@@ -268693,9 +268695,9 @@ var require_isexe = __commonJS({
268693
268695
  cb(er, is);
268694
268696
  });
268695
268697
  }
268696
- function sync(path31, options) {
268698
+ function sync(path32, options) {
268697
268699
  try {
268698
- return core2.sync(path31, options || {});
268700
+ return core2.sync(path32, options || {});
268699
268701
  } catch (er) {
268700
268702
  if (options && options.ignoreErrors || er.code === "EACCES") {
268701
268703
  return false;
@@ -268711,7 +268713,7 @@ var require_isexe = __commonJS({
268711
268713
  var require_which = __commonJS({
268712
268714
  "../../node_modules/which/which.js"(exports2, module2) {
268713
268715
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
268714
- var path31 = require("path");
268716
+ var path32 = require("path");
268715
268717
  var COLON = isWindows ? ";" : ":";
268716
268718
  var isexe = require_isexe();
268717
268719
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -268749,7 +268751,7 @@ var require_which = __commonJS({
268749
268751
  return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
268750
268752
  const ppRaw = pathEnv[i];
268751
268753
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
268752
- const pCmd = path31.join(pathPart, cmd);
268754
+ const pCmd = path32.join(pathPart, cmd);
268753
268755
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
268754
268756
  resolve2(subStep(p, i, 0));
268755
268757
  });
@@ -268776,7 +268778,7 @@ var require_which = __commonJS({
268776
268778
  for (let i = 0; i < pathEnv.length; i++) {
268777
268779
  const ppRaw = pathEnv[i];
268778
268780
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
268779
- const pCmd = path31.join(pathPart, cmd);
268781
+ const pCmd = path32.join(pathPart, cmd);
268780
268782
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
268781
268783
  for (let j = 0; j < pathExt.length; j++) {
268782
268784
  const cur = p + pathExt[j];
@@ -268824,7 +268826,7 @@ var require_path_key = __commonJS({
268824
268826
  var require_resolveCommand = __commonJS({
268825
268827
  "../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
268826
268828
  "use strict";
268827
- var path31 = require("path");
268829
+ var path32 = require("path");
268828
268830
  var which = require_which();
268829
268831
  var getPathKey = require_path_key();
268830
268832
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -268842,7 +268844,7 @@ var require_resolveCommand = __commonJS({
268842
268844
  try {
268843
268845
  resolved = which.sync(parsed.command, {
268844
268846
  path: env[getPathKey({ env })],
268845
- pathExt: withoutPathExt ? path31.delimiter : void 0
268847
+ pathExt: withoutPathExt ? path32.delimiter : void 0
268846
268848
  });
268847
268849
  } catch (e) {
268848
268850
  } finally {
@@ -268851,7 +268853,7 @@ var require_resolveCommand = __commonJS({
268851
268853
  }
268852
268854
  }
268853
268855
  if (resolved) {
268854
- resolved = path31.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
268856
+ resolved = path32.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
268855
268857
  }
268856
268858
  return resolved;
268857
268859
  }
@@ -268905,8 +268907,8 @@ var require_shebang_command = __commonJS({
268905
268907
  if (!match) {
268906
268908
  return null;
268907
268909
  }
268908
- const [path31, argument] = match[0].replace(/#! ?/, "").split(" ");
268909
- const binary2 = path31.split("/").pop();
268910
+ const [path32, argument] = match[0].replace(/#! ?/, "").split(" ");
268911
+ const binary2 = path32.split("/").pop();
268910
268912
  if (binary2 === "env") {
268911
268913
  return argument;
268912
268914
  }
@@ -268941,7 +268943,7 @@ var require_readShebang = __commonJS({
268941
268943
  var require_parse2 = __commonJS({
268942
268944
  "../../node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
268943
268945
  "use strict";
268944
- var path31 = require("path");
268946
+ var path32 = require("path");
268945
268947
  var resolveCommand = require_resolveCommand();
268946
268948
  var escape2 = require_escape();
268947
268949
  var readShebang = require_readShebang();
@@ -268966,7 +268968,7 @@ var require_parse2 = __commonJS({
268966
268968
  const needsShell = !isExecutableRegExp.test(commandFile);
268967
268969
  if (parsed.options.forceShell || needsShell) {
268968
268970
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
268969
- parsed.command = path31.normalize(parsed.command);
268971
+ parsed.command = path32.normalize(parsed.command);
268970
268972
  parsed.command = escape2.command(parsed.command);
268971
268973
  parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
268972
268974
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -278590,7 +278592,7 @@ var require_ws_transport = __commonJS({
278590
278592
  let protocol;
278591
278593
  let port;
278592
278594
  const host = url2.hostname;
278593
- const path31 = url2.pathname;
278595
+ const path32 = url2.pathname;
278594
278596
  const search = url2.search || "";
278595
278597
  switch (srcProto) {
278596
278598
  case "http:":
@@ -278610,7 +278612,7 @@ var require_ws_transport = __commonJS({
278610
278612
  protocol = encrypted === true ? "wss:" : "ws:";
278611
278613
  break;
278612
278614
  }
278613
- return `${protocol}//${host}:${port}${path31}${search}`;
278615
+ return `${protocol}//${host}:${port}${path32}${search}`;
278614
278616
  }
278615
278617
  function wsconnect(opts = {}) {
278616
278618
  (0, transport_1.setTransportFactory)({
@@ -279613,7 +279615,7 @@ var init_natsEventBus = __esm({
279613
279615
  });
279614
279616
 
279615
279617
  // ../../packages/backend/src/runtimes/gybackend/startGyBackend.ts
279616
- var import_node_path27 = __toESM(require("node:path"), 1);
279618
+ var import_node_path28 = __toESM(require("node:path"), 1);
279617
279619
  var import_node_process2 = __toESM(require("node:process"), 1);
279618
279620
 
279619
279621
  // ../../packages/backend/src/services/TerminalService.ts
@@ -280587,7 +280589,6 @@ add-zsh-hook precmd gyshell_precmd
280587
280589
  };
280588
280590
 
280589
280591
  // ../../packages/backend/src/services/SSHBackend.ts
280590
- var ssh2 = __toESM(require("ssh2"), 1);
280591
280592
  var fs2 = __toESM(require("fs"), 1);
280592
280593
  var net = __toESM(require("net"), 1);
280593
280594
  var import_node_path = require("node:path");
@@ -280724,6 +280725,16 @@ var DEFAULT_SFTP_TRANSFER_PROFILES = [
280724
280725
  ];
280725
280726
 
280726
280727
  // ../../packages/backend/src/services/SSHBackend.ts
280728
+ var ssh2 = null;
280729
+ function loadSsh2() {
280730
+ if (ssh2) return ssh2;
280731
+ try {
280732
+ ssh2 = require("ssh2");
280733
+ return ssh2;
280734
+ } catch (e) {
280735
+ throw new Error(`ssh2 is not available in this build (SSH terminals are unavailable; WinRM/serial/local terminals still work): ${e instanceof Error ? e.message : String(e)}`);
280736
+ }
280737
+ }
280727
280738
  var GYSHELL_READY_MARKER2 = "__GYSHELL_READY__";
280728
280739
  var SSH_CONNECT_READY_TIMEOUT_MS = 2e4;
280729
280740
  var SSH_KEEPALIVE_INTERVAL_MS = 3e4;
@@ -281538,7 +281549,7 @@ var SSHBackend = class _SSHBackend {
281538
281549
  `\x1B[36m\u25B9 ${jumpId} Establishing tunnel via jump host ${sshConfig.jumpHost.host}...\x1B[0m\r
281539
281550
  `
281540
281551
  );
281541
- const jumpClient = new ssh2.Client();
281552
+ const jumpClient = new (loadSsh2()).Client();
281542
281553
  const jumpSock = await this.buildConnectSocketIfNeeded(
281543
281554
  sshConfig.jumpHost,
281544
281555
  emit9
@@ -281882,7 +281893,7 @@ var SSHBackend = class _SSHBackend {
281882
281893
  throw new Error("SSHBackend only supports ssh connections");
281883
281894
  }
281884
281895
  const sshConfig = config2;
281885
- const client2 = new ssh2.Client();
281896
+ const client2 = new (loadSsh2()).Client();
281886
281897
  const instance = {
281887
281898
  client: client2,
281888
281899
  sshConfig,
@@ -292294,8 +292305,8 @@ function shallowCopy(obj) {
292294
292305
  }
292295
292306
  function replaceSecrets(root, secretsMap) {
292296
292307
  const result = shallowCopy(root);
292297
- for (const [path31, secretId] of Object.entries(secretsMap)) {
292298
- const [last, ...partsReverse] = path31.split(".").reverse();
292308
+ for (const [path32, secretId] of Object.entries(secretsMap)) {
292309
+ const [last, ...partsReverse] = path32.split(".").reverse();
292299
292310
  let current = result;
292300
292311
  for (const part of partsReverse.reverse()) {
292301
292312
  if (current[part] === void 0) break;
@@ -297050,7 +297061,7 @@ var AutoBatchQueue = class {
297050
297061
  ];
297051
297062
  }
297052
297063
  };
297053
- var Client2 = class _Client {
297064
+ var Client = class _Client {
297054
297065
  get _fetch() {
297055
297066
  return this.fetchImplementation || _getFetchImplementation(this.debug);
297056
297067
  }
@@ -297359,9 +297370,9 @@ var Client2 = class _Client {
297359
297370
  }
297360
297371
  return headers;
297361
297372
  }
297362
- _getPlatformEndpointPath(path31) {
297373
+ _getPlatformEndpointPath(path32) {
297363
297374
  const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
297364
- return needsV1Prefix ? `/v1/platform/${path31}` : `/platform/${path31}`;
297375
+ return needsV1Prefix ? `/v1/platform/${path32}` : `/platform/${path32}`;
297365
297376
  }
297366
297377
  async processInputs(inputs) {
297367
297378
  if (this.hideInputs === false) {
@@ -297397,9 +297408,9 @@ var Client2 = class _Client {
297397
297408
  }
297398
297409
  return runParams;
297399
297410
  }
297400
- async _getResponse(path31, queryParams) {
297411
+ async _getResponse(path32, queryParams) {
297401
297412
  const paramsString = queryParams?.toString() ?? "";
297402
- const url2 = `${this.apiUrl}${path31}?${paramsString}`;
297413
+ const url2 = `${this.apiUrl}${path32}?${paramsString}`;
297403
297414
  const response = await this.caller.call(async () => {
297404
297415
  const res = await this._fetch(url2, {
297405
297416
  method: "GET",
@@ -297407,22 +297418,22 @@ var Client2 = class _Client {
297407
297418
  signal: AbortSignal.timeout(this.timeout_ms),
297408
297419
  ...this.fetchOptions
297409
297420
  });
297410
- await raiseForStatus(res, `fetch ${path31}`);
297421
+ await raiseForStatus(res, `fetch ${path32}`);
297411
297422
  return res;
297412
297423
  });
297413
297424
  return response;
297414
297425
  }
297415
- async _get(path31, queryParams) {
297416
- const response = await this._getResponse(path31, queryParams);
297426
+ async _get(path32, queryParams) {
297427
+ const response = await this._getResponse(path32, queryParams);
297417
297428
  return response.json();
297418
297429
  }
297419
- async *_getPaginated(path31, queryParams = new URLSearchParams(), transform2) {
297430
+ async *_getPaginated(path32, queryParams = new URLSearchParams(), transform2) {
297420
297431
  let offset = Number(queryParams.get("offset")) || 0;
297421
297432
  const limit2 = Number(queryParams.get("limit")) || 100;
297422
297433
  while (true) {
297423
297434
  queryParams.set("offset", String(offset));
297424
297435
  queryParams.set("limit", String(limit2));
297425
- const url2 = `${this.apiUrl}${path31}?${queryParams}`;
297436
+ const url2 = `${this.apiUrl}${path32}?${queryParams}`;
297426
297437
  const response = await this.caller.call(async () => {
297427
297438
  const res = await this._fetch(url2, {
297428
297439
  method: "GET",
@@ -297430,7 +297441,7 @@ var Client2 = class _Client {
297430
297441
  signal: AbortSignal.timeout(this.timeout_ms),
297431
297442
  ...this.fetchOptions
297432
297443
  });
297433
- await raiseForStatus(res, `fetch ${path31}`);
297444
+ await raiseForStatus(res, `fetch ${path32}`);
297434
297445
  return res;
297435
297446
  });
297436
297447
  const items = transform2 ? transform2(await response.json()) : await response.json();
@@ -297444,19 +297455,19 @@ var Client2 = class _Client {
297444
297455
  offset += items.length;
297445
297456
  }
297446
297457
  }
297447
- async *_getCursorPaginatedList(path31, body = null, requestMethod = "POST", dataKey = "runs") {
297458
+ async *_getCursorPaginatedList(path32, body = null, requestMethod = "POST", dataKey = "runs") {
297448
297459
  const bodyParams = body ? { ...body } : {};
297449
297460
  while (true) {
297450
297461
  const body2 = JSON.stringify(bodyParams);
297451
297462
  const response = await this.caller.call(async () => {
297452
- const res = await this._fetch(`${this.apiUrl}${path31}`, {
297463
+ const res = await this._fetch(`${this.apiUrl}${path32}`, {
297453
297464
  method: requestMethod,
297454
297465
  headers: { ...this.headers, "Content-Type": "application/json" },
297455
297466
  signal: AbortSignal.timeout(this.timeout_ms),
297456
297467
  ...this.fetchOptions,
297457
297468
  body: body2
297458
297469
  });
297459
- await raiseForStatus(res, `fetch ${path31}`);
297470
+ await raiseForStatus(res, `fetch ${path32}`);
297460
297471
  return res;
297461
297472
  });
297462
297473
  const responseBody = await response.json();
@@ -298385,8 +298396,8 @@ Context: ${context2}`);
298385
298396
  limit: Number(limit2) || 100
298386
298397
  };
298387
298398
  let currentOffset = Number(offset) || 0;
298388
- const path31 = "/runs/group";
298389
- const url2 = `${this.apiUrl}${path31}`;
298399
+ const path32 = "/runs/group";
298400
+ const url2 = `${this.apiUrl}${path32}`;
298390
298401
  while (true) {
298391
298402
  const currentBody = {
298392
298403
  ...baseBody,
@@ -298402,7 +298413,7 @@ Context: ${context2}`);
298402
298413
  ...this.fetchOptions,
298403
298414
  body
298404
298415
  });
298405
- await raiseForStatus(res, `Failed to fetch ${path31}`);
298416
+ await raiseForStatus(res, `Failed to fetch ${path32}`);
298406
298417
  return res;
298407
298418
  });
298408
298419
  const items = await response.json();
@@ -298719,20 +298730,20 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298719
298730
  return result;
298720
298731
  }
298721
298732
  async hasProject({ projectId, projectName }) {
298722
- let path31 = "/sessions";
298733
+ let path32 = "/sessions";
298723
298734
  const params = new URLSearchParams();
298724
298735
  if (projectId !== void 0 && projectName !== void 0) {
298725
298736
  throw new Error("Must provide either projectName or projectId, not both");
298726
298737
  } else if (projectId !== void 0) {
298727
298738
  assertUuid(projectId);
298728
- path31 += `/${projectId}`;
298739
+ path32 += `/${projectId}`;
298729
298740
  } else if (projectName !== void 0) {
298730
298741
  params.append("name", projectName);
298731
298742
  } else {
298732
298743
  throw new Error("Must provide projectName or projectId");
298733
298744
  }
298734
298745
  const response = await this.caller.call(async () => {
298735
- const res = await this._fetch(`${this.apiUrl}${path31}?${params}`, {
298746
+ const res = await this._fetch(`${this.apiUrl}${path32}?${params}`, {
298736
298747
  method: "GET",
298737
298748
  headers: this.headers,
298738
298749
  signal: AbortSignal.timeout(this.timeout_ms),
@@ -298755,13 +298766,13 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298755
298766
  }
298756
298767
  }
298757
298768
  async readProject({ projectId, projectName, includeStats }) {
298758
- let path31 = "/sessions";
298769
+ let path32 = "/sessions";
298759
298770
  const params = new URLSearchParams();
298760
298771
  if (projectId !== void 0 && projectName !== void 0) {
298761
298772
  throw new Error("Must provide either projectName or projectId, not both");
298762
298773
  } else if (projectId !== void 0) {
298763
298774
  assertUuid(projectId);
298764
- path31 += `/${projectId}`;
298775
+ path32 += `/${projectId}`;
298765
298776
  } else if (projectName !== void 0) {
298766
298777
  params.append("name", projectName);
298767
298778
  } else {
@@ -298770,7 +298781,7 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298770
298781
  if (includeStats !== void 0) {
298771
298782
  params.append("include_stats", includeStats.toString());
298772
298783
  }
298773
- const response = await this._get(path31, params);
298784
+ const response = await this._get(path32, params);
298774
298785
  let result;
298775
298786
  if (Array.isArray(response)) {
298776
298787
  if (response.length === 0) {
@@ -298933,19 +298944,19 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298933
298944
  return result;
298934
298945
  }
298935
298946
  async readDataset({ datasetId, datasetName }) {
298936
- let path31 = "/datasets";
298947
+ let path32 = "/datasets";
298937
298948
  const params = new URLSearchParams({ limit: "1" });
298938
298949
  if (datasetId && datasetName) {
298939
298950
  throw new Error("Must provide either datasetName or datasetId, not both");
298940
298951
  } else if (datasetId) {
298941
298952
  assertUuid(datasetId);
298942
- path31 += `/${datasetId}`;
298953
+ path32 += `/${datasetId}`;
298943
298954
  } else if (datasetName) {
298944
298955
  params.append("name", datasetName);
298945
298956
  } else {
298946
298957
  throw new Error("Must provide datasetName or datasetId");
298947
298958
  }
298948
- const response = await this._get(path31, params);
298959
+ const response = await this._get(path32, params);
298949
298960
  let result;
298950
298961
  if (Array.isArray(response)) {
298951
298962
  if (response.length === 0) {
@@ -298989,20 +299000,20 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298989
299000
  return response;
298990
299001
  }
298991
299002
  async readDatasetOpenaiFinetuning({ datasetId, datasetName }) {
298992
- const path31 = "/datasets";
299003
+ const path32 = "/datasets";
298993
299004
  if (datasetId !== void 0) {
298994
299005
  } else if (datasetName !== void 0) {
298995
299006
  datasetId = (await this.readDataset({ datasetName })).id;
298996
299007
  } else {
298997
299008
  throw new Error("Must provide either datasetName or datasetId");
298998
299009
  }
298999
- const response = await this._getResponse(`${path31}/${datasetId}/openai_ft`);
299010
+ const response = await this._getResponse(`${path32}/${datasetId}/openai_ft`);
299000
299011
  const datasetText = await response.text();
299001
299012
  const dataset = datasetText.trim().split("\n").map((line) => JSON.parse(line));
299002
299013
  return dataset;
299003
299014
  }
299004
299015
  async *listDatasets({ limit: limit2 = 100, offset = 0, datasetIds, datasetName, datasetNameContains, metadata } = {}) {
299005
- const path31 = "/datasets";
299016
+ const path32 = "/datasets";
299006
299017
  const params = new URLSearchParams({
299007
299018
  limit: limit2.toString(),
299008
299019
  offset: offset.toString()
@@ -299021,7 +299032,7 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299021
299032
  if (metadata !== void 0) {
299022
299033
  params.append("metadata", JSON.stringify(metadata));
299023
299034
  }
299024
- for await (const datasets of this._getPaginated(path31, params)) {
299035
+ for await (const datasets of this._getPaginated(path32, params)) {
299025
299036
  yield* datasets;
299026
299037
  }
299027
299038
  }
@@ -299090,7 +299101,7 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299090
299101
  });
299091
299102
  }
299092
299103
  async deleteDataset({ datasetId, datasetName }) {
299093
- let path31 = "/datasets";
299104
+ let path32 = "/datasets";
299094
299105
  let datasetId_ = datasetId;
299095
299106
  if (datasetId !== void 0 && datasetName !== void 0) {
299096
299107
  throw new Error("Must provide either datasetName or datasetId, not both");
@@ -299100,18 +299111,18 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299100
299111
  }
299101
299112
  if (datasetId_ !== void 0) {
299102
299113
  assertUuid(datasetId_);
299103
- path31 += `/${datasetId_}`;
299114
+ path32 += `/${datasetId_}`;
299104
299115
  } else {
299105
299116
  throw new Error("Must provide datasetName or datasetId");
299106
299117
  }
299107
299118
  await this.caller.call(async () => {
299108
- const res = await this._fetch(this.apiUrl + path31, {
299119
+ const res = await this._fetch(this.apiUrl + path32, {
299109
299120
  method: "DELETE",
299110
299121
  headers: this.headers,
299111
299122
  signal: AbortSignal.timeout(this.timeout_ms),
299112
299123
  ...this.fetchOptions
299113
299124
  });
299114
- await raiseForStatus(res, `delete ${path31}`, true);
299125
+ await raiseForStatus(res, `delete ${path32}`, true);
299115
299126
  return res;
299116
299127
  });
299117
299128
  }
@@ -299302,8 +299313,8 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299302
299313
  }
299303
299314
  async readExample(exampleId) {
299304
299315
  assertUuid(exampleId);
299305
- const path31 = `/examples/${exampleId}`;
299306
- const rawExample = await this._get(path31);
299316
+ const path32 = `/examples/${exampleId}`;
299317
+ const rawExample = await this._get(path32);
299307
299318
  const { attachment_urls, ...rest } = rawExample;
299308
299319
  const example = rest;
299309
299320
  if (attachment_urls) {
@@ -299386,15 +299397,15 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299386
299397
  }
299387
299398
  async deleteExample(exampleId) {
299388
299399
  assertUuid(exampleId);
299389
- const path31 = `/examples/${exampleId}`;
299400
+ const path32 = `/examples/${exampleId}`;
299390
299401
  await this.caller.call(async () => {
299391
- const res = await this._fetch(this.apiUrl + path31, {
299402
+ const res = await this._fetch(this.apiUrl + path32, {
299392
299403
  method: "DELETE",
299393
299404
  headers: this.headers,
299394
299405
  signal: AbortSignal.timeout(this.timeout_ms),
299395
299406
  ...this.fetchOptions
299396
299407
  });
299397
- await raiseForStatus(res, `delete ${path31}`, true);
299408
+ await raiseForStatus(res, `delete ${path32}`, true);
299398
299409
  return res;
299399
299410
  });
299400
299411
  }
@@ -299407,9 +299418,9 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299407
299418
  async deleteExamples(exampleIds, options) {
299408
299419
  exampleIds.forEach((id) => assertUuid(id));
299409
299420
  if (options?.hardDelete) {
299410
- const path31 = this._getPlatformEndpointPath("datasets/examples/delete");
299421
+ const path32 = this._getPlatformEndpointPath("datasets/examples/delete");
299411
299422
  await this.caller.call(async () => {
299412
- const res = await this._fetch(`${this.apiUrl}${path31}`, {
299423
+ const res = await this._fetch(`${this.apiUrl}${path32}`, {
299413
299424
  method: "POST",
299414
299425
  headers: { ...this.headers, "Content-Type": "application/json" },
299415
299426
  body: JSON.stringify({
@@ -299643,21 +299654,21 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299643
299654
  }
299644
299655
  async readFeedback(feedbackId) {
299645
299656
  assertUuid(feedbackId);
299646
- const path31 = `/feedback/${feedbackId}`;
299647
- const response = await this._get(path31);
299657
+ const path32 = `/feedback/${feedbackId}`;
299658
+ const response = await this._get(path32);
299648
299659
  return response;
299649
299660
  }
299650
299661
  async deleteFeedback(feedbackId) {
299651
299662
  assertUuid(feedbackId);
299652
- const path31 = `/feedback/${feedbackId}`;
299663
+ const path32 = `/feedback/${feedbackId}`;
299653
299664
  await this.caller.call(async () => {
299654
- const res = await this._fetch(this.apiUrl + path31, {
299665
+ const res = await this._fetch(this.apiUrl + path32, {
299655
299666
  method: "DELETE",
299656
299667
  headers: this.headers,
299657
299668
  signal: AbortSignal.timeout(this.timeout_ms),
299658
299669
  ...this.fetchOptions
299659
299670
  });
299660
- await raiseForStatus(res, `delete ${path31}`, true);
299671
+ await raiseForStatus(res, `delete ${path32}`, true);
299661
299672
  return res;
299662
299673
  });
299663
299674
  }
@@ -300971,7 +300982,7 @@ var RunTree = class _RunTree {
300971
300982
  }
300972
300983
  static getSharedClient() {
300973
300984
  if (!_RunTree.sharedClient) {
300974
- _RunTree.sharedClient = new Client2();
300985
+ _RunTree.sharedClient = new Client();
300975
300986
  }
300976
300987
  return _RunTree.sharedClient;
300977
300988
  }
@@ -302151,7 +302162,7 @@ var client;
302151
302162
  var getDefaultLangChainClientSingleton = () => {
302152
302163
  if (client === void 0) {
302153
302164
  const clientParams = getEnvironmentVariable("LANGCHAIN_CALLBACKS_BACKGROUND") === "false" ? { blockOnRootRunFinalization: true } : {};
302154
- client = new Client2(clientParams);
302165
+ client = new Client(clientParams);
302155
302166
  }
302156
302167
  return client;
302157
302168
  };
@@ -303253,12 +303264,12 @@ function isInteger(str3) {
303253
303264
  }
303254
303265
  return true;
303255
303266
  }
303256
- function escapePathComponent(path31) {
303257
- if (path31.indexOf("/") === -1 && path31.indexOf("~") === -1) return path31;
303258
- return path31.replace(/~/g, "~0").replace(/\//g, "~1");
303267
+ function escapePathComponent(path32) {
303268
+ if (path32.indexOf("/") === -1 && path32.indexOf("~") === -1) return path32;
303269
+ return path32.replace(/~/g, "~0").replace(/\//g, "~1");
303259
303270
  }
303260
- function unescapePathComponent(path31) {
303261
- return path31.replace(/~1/g, "/").replace(/~0/g, "~");
303271
+ function unescapePathComponent(path32) {
303272
+ return path32.replace(/~1/g, "/").replace(/~0/g, "~");
303262
303273
  }
303263
303274
  function hasUndefined(obj) {
303264
303275
  if (obj === void 0) return true;
@@ -303452,8 +303463,8 @@ function applyOperation(document2, operation, validateOperation = false, mutateD
303452
303463
  else return returnValue;
303453
303464
  } else {
303454
303465
  if (!mutateDocument) document2 = _deepClone(document2);
303455
- const path31 = operation.path || "";
303456
- const keys = path31.split("/");
303466
+ const path32 = operation.path || "";
303467
+ const keys = path32.split("/");
303457
303468
  let obj = document2;
303458
303469
  let t = 1;
303459
303470
  let len = keys.length;
@@ -303576,7 +303587,7 @@ function _areEquals(a, b) {
303576
303587
  }
303577
303588
 
303578
303589
  // ../../node_modules/@langchain/core/dist/utils/fast-json-patch/src/duplex.js
303579
- function _generate(mirror, obj, patches, path31, invertible) {
303590
+ function _generate(mirror, obj, patches, path32, invertible) {
303580
303591
  if (obj === mirror) return;
303581
303592
  if (typeof obj.toJSON === "function") obj = obj.toJSON();
303582
303593
  var newKeys = _objectKeys(obj);
@@ -303588,40 +303599,40 @@ function _generate(mirror, obj, patches, path31, invertible) {
303588
303599
  var oldVal = mirror[key];
303589
303600
  if (hasOwnProperty(obj, key) && !(obj[key] === void 0 && oldVal !== void 0 && Array.isArray(obj) === false)) {
303590
303601
  var newVal = obj[key];
303591
- if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) _generate(oldVal, newVal, patches, path31 + "/" + escapePathComponent(key), invertible);
303602
+ if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) _generate(oldVal, newVal, patches, path32 + "/" + escapePathComponent(key), invertible);
303592
303603
  else if (oldVal !== newVal) {
303593
303604
  changed = true;
303594
303605
  if (invertible) patches.push({
303595
303606
  op: "test",
303596
- path: path31 + "/" + escapePathComponent(key),
303607
+ path: path32 + "/" + escapePathComponent(key),
303597
303608
  value: _deepClone(oldVal)
303598
303609
  });
303599
303610
  patches.push({
303600
303611
  op: "replace",
303601
- path: path31 + "/" + escapePathComponent(key),
303612
+ path: path32 + "/" + escapePathComponent(key),
303602
303613
  value: _deepClone(newVal)
303603
303614
  });
303604
303615
  }
303605
303616
  } else if (Array.isArray(mirror) === Array.isArray(obj)) {
303606
303617
  if (invertible) patches.push({
303607
303618
  op: "test",
303608
- path: path31 + "/" + escapePathComponent(key),
303619
+ path: path32 + "/" + escapePathComponent(key),
303609
303620
  value: _deepClone(oldVal)
303610
303621
  });
303611
303622
  patches.push({
303612
303623
  op: "remove",
303613
- path: path31 + "/" + escapePathComponent(key)
303624
+ path: path32 + "/" + escapePathComponent(key)
303614
303625
  });
303615
303626
  deleted = true;
303616
303627
  } else {
303617
303628
  if (invertible) patches.push({
303618
303629
  op: "test",
303619
- path: path31,
303630
+ path: path32,
303620
303631
  value: mirror
303621
303632
  });
303622
303633
  patches.push({
303623
303634
  op: "replace",
303624
- path: path31,
303635
+ path: path32,
303625
303636
  value: obj
303626
303637
  });
303627
303638
  changed = true;
@@ -303632,7 +303643,7 @@ function _generate(mirror, obj, patches, path31, invertible) {
303632
303643
  var key = newKeys[t];
303633
303644
  if (!hasOwnProperty(mirror, key) && obj[key] !== void 0) patches.push({
303634
303645
  op: "add",
303635
- path: path31 + "/" + escapePathComponent(key),
303646
+ path: path32 + "/" + escapePathComponent(key),
303636
303647
  value: _deepClone(obj[key])
303637
303648
  });
303638
303649
  }
@@ -305018,10 +305029,10 @@ function assignProp(target, prop, value) {
305018
305029
  configurable: true
305019
305030
  });
305020
305031
  }
305021
- function getElementAtPath(obj, path31) {
305022
- if (!path31)
305032
+ function getElementAtPath(obj, path32) {
305033
+ if (!path32)
305023
305034
  return obj;
305024
- return path31.reduce((acc, key) => acc?.[key], obj);
305035
+ return path32.reduce((acc, key) => acc?.[key], obj);
305025
305036
  }
305026
305037
  function promiseAllObject(promisesObj) {
305027
305038
  const keys = Object.keys(promisesObj);
@@ -305341,11 +305352,11 @@ function aborted(x, startIndex = 0) {
305341
305352
  }
305342
305353
  return false;
305343
305354
  }
305344
- function prefixIssues(path31, issues) {
305355
+ function prefixIssues(path32, issues) {
305345
305356
  return issues.map((iss) => {
305346
305357
  var _a3;
305347
305358
  (_a3 = iss).path ?? (_a3.path = []);
305348
- iss.path.unshift(path31);
305359
+ iss.path.unshift(path32);
305349
305360
  return iss;
305350
305361
  });
305351
305362
  }
@@ -305482,7 +305493,7 @@ function treeifyError(error40, _mapper) {
305482
305493
  return issue2.message;
305483
305494
  };
305484
305495
  const result = { errors: [] };
305485
- const processError = (error41, path31 = []) => {
305496
+ const processError = (error41, path32 = []) => {
305486
305497
  var _a3, _b;
305487
305498
  for (const issue2 of error41.issues) {
305488
305499
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -305492,7 +305503,7 @@ function treeifyError(error40, _mapper) {
305492
305503
  } else if (issue2.code === "invalid_element") {
305493
305504
  processError({ issues: issue2.issues }, issue2.path);
305494
305505
  } else {
305495
- const fullpath = [...path31, ...issue2.path];
305506
+ const fullpath = [...path32, ...issue2.path];
305496
305507
  if (fullpath.length === 0) {
305497
305508
  result.errors.push(mapper(issue2));
305498
305509
  continue;
@@ -305522,9 +305533,9 @@ function treeifyError(error40, _mapper) {
305522
305533
  processError(error40);
305523
305534
  return result;
305524
305535
  }
305525
- function toDotPath(path31) {
305536
+ function toDotPath(path32) {
305526
305537
  const segs = [];
305527
- for (const seg of path31) {
305538
+ for (const seg of path32) {
305528
305539
  if (typeof seg === "number")
305529
305540
  segs.push(`[${seg}]`);
305530
305541
  else if (typeof seg === "symbol")
@@ -315427,8 +315438,8 @@ function getErrorMap() {
315427
315438
 
315428
315439
  // ../../node_modules/zod/v3/helpers/parseUtil.js
315429
315440
  var makeIssue = (params) => {
315430
- const { data, path: path31, errorMaps, issueData } = params;
315431
- const fullPath = [...path31, ...issueData.path || []];
315441
+ const { data, path: path32, errorMaps, issueData } = params;
315442
+ const fullPath = [...path32, ...issueData.path || []];
315432
315443
  const fullIssue = {
315433
315444
  ...issueData,
315434
315445
  path: fullPath
@@ -315544,11 +315555,11 @@ var errorUtil;
315544
315555
 
315545
315556
  // ../../node_modules/zod/v3/types.js
315546
315557
  var ParseInputLazyPath = class {
315547
- constructor(parent, value, path31, key) {
315558
+ constructor(parent, value, path32, key) {
315548
315559
  this._cachedPath = [];
315549
315560
  this.parent = parent;
315550
315561
  this.data = value;
315551
- this._path = path31;
315562
+ this._path = path32;
315552
315563
  this._key = key;
315553
315564
  }
315554
315565
  get path() {
@@ -321809,10 +321820,10 @@ var Runnable = class extends Serializable {
321809
321820
  }
321810
321821
  const paths = log.ops.filter((op) => op.path.startsWith("/logs/")).map((op) => op.path.split("/")[2]);
321811
321822
  const dedupedPaths = [...new Set(paths)];
321812
- for (const path31 of dedupedPaths) {
321823
+ for (const path32 of dedupedPaths) {
321813
321824
  let eventType;
321814
321825
  let data = {};
321815
- const logEntry = runLog.state.logs[path31];
321826
+ const logEntry = runLog.state.logs[path32];
321816
321827
  if (logEntry.end_time === void 0) if (logEntry.streamed_output.length > 0) eventType = "stream";
321817
321828
  else eventType = "start";
321818
321829
  else eventType = "end";
@@ -324808,7 +324819,7 @@ var LangSmithLoader = class extends BaseDocumentLoader {
324808
324819
  constructor(fields) {
324809
324820
  super();
324810
324821
  if (fields.client && fields.clientConfig) throw new Error("client and clientConfig cannot both be provided.");
324811
- this.client = fields.client ?? new Client2(fields?.clientConfig);
324822
+ this.client = fields.client ?? new Client(fields?.clientConfig);
324812
324823
  this.contentKey = fields.contentKey ? fields.contentKey.split(".") : [];
324813
324824
  this.formatContent = fields.formatContent ?? _stringify;
324814
324825
  this.datasetId = fields.datasetId;
@@ -333877,13 +333888,13 @@ function combineAliasesAndInvert(constructor) {
333877
333888
  }, {});
333878
333889
  }
333879
333890
  async function reviver(value) {
333880
- const { optionalImportsMap, optionalImportEntrypoints: optionalImportEntrypoints$1, importMap, secretsMap, secretsFromEnv, path: path31, depth, maxDepth } = this;
333881
- const pathStr = path31.join(".");
333891
+ const { optionalImportsMap, optionalImportEntrypoints: optionalImportEntrypoints$1, importMap, secretsMap, secretsFromEnv, path: path32, depth, maxDepth } = this;
333892
+ const pathStr = path32.join(".");
333882
333893
  if (depth > maxDepth) throw new Error(`Maximum recursion depth (${maxDepth}) exceeded during deserialization. This may indicate a malicious payload or you may need to increase maxDepth.`);
333883
333894
  if (typeof value !== "object" || value == null) return value;
333884
333895
  if (Array.isArray(value)) return Promise.all(value.map((v, i) => reviver.call({
333885
333896
  ...this,
333886
- path: [...path31, `${i}`],
333897
+ path: [...path32, `${i}`],
333887
333898
  depth: depth + 1
333888
333899
  }, v)));
333889
333900
  const record2 = value;
@@ -333938,7 +333949,7 @@ async function reviver(value) {
333938
333949
  if (typeof builder !== "function") throw new Error(`Invalid identifer: ${pathStr} -> ${str3}`);
333939
333950
  const kwargs = await reviver.call({
333940
333951
  ...this,
333941
- path: [...path31, "kwargs"],
333952
+ path: [...path32, "kwargs"],
333942
333953
  depth: depth + 1
333943
333954
  }, serialized.kwargs);
333944
333955
  const instance = new builder(mapKeys(kwargs, keyFromJson, combineAliasesAndInvert(builder)));
@@ -333948,7 +333959,7 @@ async function reviver(value) {
333948
333959
  const result = {};
333949
333960
  for (const [key, val] of Object.entries(record2)) result[key] = await reviver.call({
333950
333961
  ...this,
333951
- path: [...path31, key],
333962
+ path: [...path32, key],
333952
333963
  depth: depth + 1
333953
333964
  }, val);
333954
333965
  return result;
@@ -339076,10 +339087,10 @@ var Graph$1 = class {
339076
339087
  this.edges.add([startKey, endKey]);
339077
339088
  return this;
339078
339089
  }
339079
- addConditionalEdges(source, path31, pathMap) {
339090
+ addConditionalEdges(source, path32, pathMap) {
339080
339091
  const options = typeof source === "object" ? source : {
339081
339092
  source,
339082
- path: path31,
339093
+ path: path32,
339083
339094
  pathMap
339084
339095
  };
339085
339096
  this.warnIfCompiled("Adding an edge to a graph that has already been compiled. This will not be reflected in the compiled graph.");
@@ -340478,16 +340489,16 @@ var Diff = class {
340478
340489
  }
340479
340490
  }
340480
340491
  }
340481
- addToPath(path31, added, removed, oldPosInc, options) {
340482
- const last = path31.lastComponent;
340492
+ addToPath(path32, added, removed, oldPosInc, options) {
340493
+ const last = path32.lastComponent;
340483
340494
  if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
340484
340495
  return {
340485
- oldPos: path31.oldPos + oldPosInc,
340496
+ oldPos: path32.oldPos + oldPosInc,
340486
340497
  lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
340487
340498
  };
340488
340499
  } else {
340489
340500
  return {
340490
- oldPos: path31.oldPos + oldPosInc,
340501
+ oldPos: path32.oldPos + oldPosInc,
340491
340502
  lastComponent: { count: 1, added, removed, previousComponent: last }
340492
340503
  };
340493
340504
  }
@@ -348350,12 +348361,12 @@ function encodeURIPath(str3) {
348350
348361
  return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
348351
348362
  }
348352
348363
  var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
348353
- var createPathTagFunction = (pathEncoder = encodeURIPath) => function path31(statics, ...params) {
348364
+ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path32(statics, ...params) {
348354
348365
  if (statics.length === 1)
348355
348366
  return statics[0];
348356
348367
  let postPath = false;
348357
348368
  const invalidSegments = [];
348358
- const path32 = statics.reduce((previousValue, currentValue, index2) => {
348369
+ const path33 = statics.reduce((previousValue, currentValue, index2) => {
348359
348370
  if (/[?#]/.test(currentValue)) {
348360
348371
  postPath = true;
348361
348372
  }
@@ -348372,7 +348383,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path31(sta
348372
348383
  }
348373
348384
  return previousValue + currentValue + (index2 === params.length ? "" : encoded);
348374
348385
  }, "");
348375
- const pathOnly = path32.split(/[?#]/, 1)[0];
348386
+ const pathOnly = path33.split(/[?#]/, 1)[0];
348376
348387
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
348377
348388
  let match;
348378
348389
  while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -348393,10 +348404,10 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path31(sta
348393
348404
  }, "");
348394
348405
  throw new OpenAIError(`Path parameters result in path with invalid segments:
348395
348406
  ${invalidSegments.map((e) => e.error).join("\n")}
348396
- ${path32}
348407
+ ${path33}
348397
348408
  ${underline}`);
348398
348409
  }
348399
- return path32;
348410
+ return path33;
348400
348411
  };
348401
348412
  var path8 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
348402
348413
 
@@ -353213,9 +353224,9 @@ var OpenAI = class {
353213
353224
  this.apiKey = token;
353214
353225
  return true;
353215
353226
  }
353216
- buildURL(path31, query, defaultBaseURL) {
353227
+ buildURL(path32, query, defaultBaseURL) {
353217
353228
  const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
353218
- const url2 = isAbsoluteURL(path31) ? new URL(path31) : new URL(baseURL + (baseURL.endsWith("/") && path31.startsWith("/") ? path31.slice(1) : path31));
353229
+ const url2 = isAbsoluteURL(path32) ? new URL(path32) : new URL(baseURL + (baseURL.endsWith("/") && path32.startsWith("/") ? path32.slice(1) : path32));
353219
353230
  const defaultQuery = this.defaultQuery();
353220
353231
  if (!isEmptyObj(defaultQuery)) {
353221
353232
  query = { ...defaultQuery, ...query };
@@ -353239,24 +353250,24 @@ var OpenAI = class {
353239
353250
  */
353240
353251
  async prepareRequest(request, { url: url2, options }) {
353241
353252
  }
353242
- get(path31, opts) {
353243
- return this.methodRequest("get", path31, opts);
353253
+ get(path32, opts) {
353254
+ return this.methodRequest("get", path32, opts);
353244
353255
  }
353245
- post(path31, opts) {
353246
- return this.methodRequest("post", path31, opts);
353256
+ post(path32, opts) {
353257
+ return this.methodRequest("post", path32, opts);
353247
353258
  }
353248
- patch(path31, opts) {
353249
- return this.methodRequest("patch", path31, opts);
353259
+ patch(path32, opts) {
353260
+ return this.methodRequest("patch", path32, opts);
353250
353261
  }
353251
- put(path31, opts) {
353252
- return this.methodRequest("put", path31, opts);
353262
+ put(path32, opts) {
353263
+ return this.methodRequest("put", path32, opts);
353253
353264
  }
353254
- delete(path31, opts) {
353255
- return this.methodRequest("delete", path31, opts);
353265
+ delete(path32, opts) {
353266
+ return this.methodRequest("delete", path32, opts);
353256
353267
  }
353257
- methodRequest(method, path31, opts) {
353268
+ methodRequest(method, path32, opts) {
353258
353269
  return this.request(Promise.resolve(opts).then((opts2) => {
353259
- return { method, path: path31, ...opts2 };
353270
+ return { method, path: path32, ...opts2 };
353260
353271
  }));
353261
353272
  }
353262
353273
  request(options, remainingRetries = null) {
@@ -353360,8 +353371,8 @@ var OpenAI = class {
353360
353371
  }));
353361
353372
  return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
353362
353373
  }
353363
- getAPIList(path31, Page2, opts) {
353364
- return this.requestAPIList(Page2, { method: "get", path: path31, ...opts });
353374
+ getAPIList(path32, Page2, opts) {
353375
+ return this.requestAPIList(Page2, { method: "get", path: path32, ...opts });
353365
353376
  }
353366
353377
  requestAPIList(Page2, options) {
353367
353378
  const request = this.makeRequest(options, null, void 0);
@@ -353439,8 +353450,8 @@ var OpenAI = class {
353439
353450
  }
353440
353451
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
353441
353452
  const options = { ...inputOptions };
353442
- const { method, path: path31, query, defaultBaseURL } = options;
353443
- const url2 = this.buildURL(path31, query, defaultBaseURL);
353453
+ const { method, path: path32, query, defaultBaseURL } = options;
353454
+ const url2 = this.buildURL(path32, query, defaultBaseURL);
353444
353455
  if ("timeout" in options)
353445
353456
  validatePositiveInteger("timeout", options.timeout);
353446
353457
  options.timeout = options.timeout ?? this.timeout;
@@ -355056,23 +355067,23 @@ function isNullable(schema2) {
355056
355067
  }
355057
355068
  return false;
355058
355069
  }
355059
- function ensureStrictJsonSchema(jsonSchema, path31, root) {
355070
+ function ensureStrictJsonSchema(jsonSchema, path32, root) {
355060
355071
  if (typeof jsonSchema === "boolean") {
355061
- throw new TypeError(`Expected object schema but got boolean; path=${path31.join("/")}`);
355072
+ throw new TypeError(`Expected object schema but got boolean; path=${path32.join("/")}`);
355062
355073
  }
355063
355074
  if (!isObject4(jsonSchema)) {
355064
- throw new TypeError(`Expected ${JSON.stringify(jsonSchema)} to be an object; path=${path31.join("/")}`);
355075
+ throw new TypeError(`Expected ${JSON.stringify(jsonSchema)} to be an object; path=${path32.join("/")}`);
355065
355076
  }
355066
355077
  const defs = jsonSchema.$defs;
355067
355078
  if (isObject4(defs)) {
355068
355079
  for (const [defName, defSchema] of Object.entries(defs)) {
355069
- ensureStrictJsonSchema(defSchema, [...path31, "$defs", defName], root);
355080
+ ensureStrictJsonSchema(defSchema, [...path32, "$defs", defName], root);
355070
355081
  }
355071
355082
  }
355072
355083
  const definitions = jsonSchema.definitions;
355073
355084
  if (isObject4(definitions)) {
355074
355085
  for (const [definitionName, definitionSchema] of Object.entries(definitions)) {
355075
- ensureStrictJsonSchema(definitionSchema, [...path31, "definitions", definitionName], root);
355086
+ ensureStrictJsonSchema(definitionSchema, [...path32, "definitions", definitionName], root);
355076
355087
  }
355077
355088
  }
355078
355089
  const typ = jsonSchema.type;
@@ -355084,31 +355095,31 @@ function ensureStrictJsonSchema(jsonSchema, path31, root) {
355084
355095
  if (isObject4(properties)) {
355085
355096
  for (const [key, value] of Object.entries(properties)) {
355086
355097
  if (!isNullable(value) && !required2.includes(key)) {
355087
- throw new Error(`Zod field at \`${[...path31, "properties", key].join("/")}\` uses \`.optional()\` without \`.nullable()\` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required`);
355098
+ throw new Error(`Zod field at \`${[...path32, "properties", key].join("/")}\` uses \`.optional()\` without \`.nullable()\` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required`);
355088
355099
  }
355089
355100
  }
355090
355101
  jsonSchema.required = Object.keys(properties);
355091
355102
  jsonSchema.properties = Object.fromEntries(Object.entries(properties).map(([key, propSchema]) => [
355092
355103
  key,
355093
- ensureStrictJsonSchema(propSchema, [...path31, "properties", key], root)
355104
+ ensureStrictJsonSchema(propSchema, [...path32, "properties", key], root)
355094
355105
  ]));
355095
355106
  }
355096
355107
  const items = jsonSchema.items;
355097
355108
  if (isObject4(items)) {
355098
- jsonSchema.items = ensureStrictJsonSchema(items, [...path31, "items"], root);
355109
+ jsonSchema.items = ensureStrictJsonSchema(items, [...path32, "items"], root);
355099
355110
  }
355100
355111
  const anyOf = jsonSchema.anyOf;
355101
355112
  if (Array.isArray(anyOf)) {
355102
- jsonSchema.anyOf = anyOf.map((variant, i) => ensureStrictJsonSchema(variant, [...path31, "anyOf", String(i)], root));
355113
+ jsonSchema.anyOf = anyOf.map((variant, i) => ensureStrictJsonSchema(variant, [...path32, "anyOf", String(i)], root));
355103
355114
  }
355104
355115
  const allOf = jsonSchema.allOf;
355105
355116
  if (Array.isArray(allOf)) {
355106
355117
  if (allOf.length === 1) {
355107
- const resolved = ensureStrictJsonSchema(allOf[0], [...path31, "allOf", "0"], root);
355118
+ const resolved = ensureStrictJsonSchema(allOf[0], [...path32, "allOf", "0"], root);
355108
355119
  Object.assign(jsonSchema, resolved);
355109
355120
  delete jsonSchema.allOf;
355110
355121
  } else {
355111
- jsonSchema.allOf = allOf.map((entry, i) => ensureStrictJsonSchema(entry, [...path31, "allOf", String(i)], root));
355122
+ jsonSchema.allOf = allOf.map((entry, i) => ensureStrictJsonSchema(entry, [...path32, "allOf", String(i)], root));
355112
355123
  }
355113
355124
  }
355114
355125
  if (jsonSchema.default === null) {
@@ -355117,7 +355128,7 @@ function ensureStrictJsonSchema(jsonSchema, path31, root) {
355117
355128
  const ref = jsonSchema.$ref;
355118
355129
  if (ref && hasMoreThanNKeys(jsonSchema, 1)) {
355119
355130
  if (typeof ref !== "string") {
355120
- throw new TypeError(`Received non-string $ref - ${ref}; path=${path31.join("/")}`);
355131
+ throw new TypeError(`Received non-string $ref - ${ref}; path=${path32.join("/")}`);
355121
355132
  }
355122
355133
  const resolved = resolveRef(root, ref);
355123
355134
  if (typeof resolved === "boolean") {
@@ -355128,7 +355139,7 @@ function ensureStrictJsonSchema(jsonSchema, path31, root) {
355128
355139
  }
355129
355140
  Object.assign(jsonSchema, { ...resolved, ...jsonSchema });
355130
355141
  delete jsonSchema.$ref;
355131
- return ensureStrictJsonSchema(jsonSchema, path31, root);
355142
+ return ensureStrictJsonSchema(jsonSchema, path32, root);
355132
355143
  }
355133
355144
  return jsonSchema;
355134
355145
  }
@@ -370339,7 +370350,7 @@ function getSupportedElicitationModes(capabilities) {
370339
370350
  const supportsUrlMode = hasUrlCapability;
370340
370351
  return { supportsFormMode, supportsUrlMode };
370341
370352
  }
370342
- var Client3 = class extends Protocol {
370353
+ var Client2 = class extends Protocol {
370343
370354
  /**
370344
370355
  * Initializes this client with the given name and version information.
370345
370356
  */
@@ -373544,7 +373555,7 @@ var McpRuntimeCore = class extends import_node_events.EventEmitter {
373544
373555
  }
373545
373556
  return stdioTransport;
373546
373557
  })();
373547
- const client2 = new Client3(
373558
+ const client2 = new Client2(
373548
373559
  { name: `gyshell-mcp-${name}`, version: "1.0.0" },
373549
373560
  { capabilities: {} }
373550
373561
  );
@@ -377299,6 +377310,7 @@ function createTriggerRuntime(deps) {
377299
377310
 
377300
377311
  // ../../packages/backend/src/services/observability.ts
377301
377312
  var import_node_module2 = require("node:module");
377313
+ var import_node_path27 = __toESM(require("node:path"), 1);
377302
377314
 
377303
377315
  // ../../packages/backend/src/services/sre/metricsLedger.ts
377304
377316
  var DEFAULT_LIMIT = 1e4;
@@ -382552,10 +382564,10 @@ function createObservability(deps) {
382552
382564
  const monitorStatus = new MonitorStatusService(deps.resourceMonitorService, deps.terminalService);
382553
382565
  const policyEngine = new AgtPolicyEngine({
382554
382566
  loadPolicy: async () => {
382555
- const req = (0, import_node_module2.createRequire)(import_meta4.url);
382567
+ const req = (0, import_node_module2.createRequire)(typeof __filename !== "undefined" ? __filename : import_meta4.url);
382556
382568
  const fs22 = req("node:fs");
382557
- const path31 = req("node:path");
382558
- const policyPath = path31.join(".", "policy.yaml");
382569
+ const path32 = req("node:path");
382570
+ const policyPath = path32.join(".", "policy.yaml");
382559
382571
  if (fs22.existsSync(policyPath)) {
382560
382572
  return parsePolicyYaml(fs22.readFileSync(policyPath, "utf8"));
382561
382573
  }
@@ -382595,21 +382607,21 @@ function createObservability(deps) {
382595
382607
  reviewMode: deps.reviewMode ?? "strict"
382596
382608
  });
382597
382609
  const pluginScanRoot = (process.env.GYBACKEND_DATA_DIR ?? "./.gybackend-data") + "/plugins";
382598
- const bundlePluginRoot = new URL("../../plugins/", import_meta4.url).pathname;
382610
+ const bundlePluginRoot = typeof __filename !== "undefined" ? import_node_path27.default.join(import_node_path27.default.dirname(__filename), "..", "..", "plugins") : new URL("../../plugins/", import_meta4.url).pathname;
382599
382611
  const scanRoots = [pluginScanRoot, "./plugins"];
382600
382612
  try {
382601
- const req = (0, import_node_module2.createRequire)(import_meta4.url);
382613
+ const req = (0, import_node_module2.createRequire)(typeof __filename !== "undefined" ? __filename : import_meta4.url);
382602
382614
  const fs22 = req("node:fs");
382603
382615
  if (fs22.existsSync(bundlePluginRoot)) scanRoots.push(bundlePluginRoot);
382604
382616
  } catch {
382605
382617
  }
382606
382618
  try {
382607
- const req = (0, import_node_module2.createRequire)(import_meta4.url);
382619
+ const req = (0, import_node_module2.createRequire)(typeof __filename !== "undefined" ? __filename : import_meta4.url);
382608
382620
  const fs22 = req("node:fs");
382609
- const path31 = req("node:path");
382621
+ const path32 = req("node:path");
382610
382622
  const resourcesPath = process.resourcesPath;
382611
382623
  if (resourcesPath) {
382612
- const resourcesPlugins = path31.join(resourcesPath, "plugins");
382624
+ const resourcesPlugins = path32.join(resourcesPath, "plugins");
382613
382625
  if (fs22.existsSync(resourcesPlugins)) scanRoots.push(resourcesPlugins);
382614
382626
  }
382615
382627
  } catch {
@@ -384497,9 +384509,9 @@ function numberFromEnv(name, fallback) {
384497
384509
  function resolveDataDir() {
384498
384510
  const custom3 = (import_node_process2.default.env.GYBACKEND_DATA_DIR || "").trim();
384499
384511
  if (custom3) {
384500
- return import_node_path27.default.resolve(custom3);
384512
+ return import_node_path28.default.resolve(custom3);
384501
384513
  }
384502
- return import_node_path27.default.join(import_node_process2.default.cwd(), ".gybackend-data");
384514
+ return import_node_path28.default.join(import_node_process2.default.cwd(), ".gybackend-data");
384503
384515
  }
384504
384516
  async function startGyBackend() {
384505
384517
  const dataDir = resolveDataDir();
@@ -384532,7 +384544,7 @@ async function startGyBackend() {
384532
384544
  const modelCapabilityService = new ModelCapabilityService();
384533
384545
  const imageAttachmentService = new ImageAttachmentService(dataDir);
384534
384546
  const terminalStateStore = new TerminalStateStore(
384535
- import_node_path27.default.join(dataDir, "terminal-tabs-state.json")
384547
+ import_node_path28.default.join(dataDir, "terminal-tabs-state.json")
384536
384548
  );
384537
384549
  const terminalService = new TerminalService({
384538
384550
  terminalStateStore
@@ -384683,7 +384695,7 @@ async function startGyBackend() {
384683
384695
  });
384684
384696
  console.log(`[gybackend] Observability wired: dashboard state available (hosts=${observability.metricsLedger.hosts().length})`);
384685
384697
  if (settingsService.getSettings().sessionLogging?.enabled) {
384686
- const logDir = import_node_path27.default.join(
384698
+ const logDir = import_node_path28.default.join(
384687
384699
  import_node_process2.default.env.GYSHELL_STORE_DIR || "",
384688
384700
  "session-logs"
384689
384701
  );